fix(需求池): 修复列表换行和版本解绑状态
This commit is contained in:
20
apps/web/lib/requirement-table-layout.ts
Normal file
20
apps/web/lib/requirement-table-layout.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
export type RequirementTableTextColumn = 'source' | 'project' | 'type' | 'creator';
|
||||
|
||||
const TEXT_COLUMN_MAX_WIDTH: Record<RequirementTableTextColumn, string> = {
|
||||
source: 'max-w-[170px]',
|
||||
project: 'max-w-[120px]',
|
||||
type: 'max-w-[96px]',
|
||||
creator: 'max-w-[96px]',
|
||||
};
|
||||
|
||||
export const REQUIREMENT_TABLE_NOWRAP_CELL_CLASS = 'px-4 py-3 whitespace-nowrap';
|
||||
|
||||
export const REQUIREMENT_TABLE_BADGE_CLASS =
|
||||
'inline-flex h-6 min-w-[3.25rem] shrink-0 items-center justify-center whitespace-nowrap rounded-md px-2 py-0.5 text-[11px] font-medium';
|
||||
|
||||
export const REQUIREMENT_TABLE_SMALL_BADGE_CLASS =
|
||||
'inline-flex h-5 min-w-[2.75rem] shrink-0 items-center justify-center whitespace-nowrap rounded-md px-2 py-0.5 text-[10px] font-medium';
|
||||
|
||||
export function getRequirementTableTextClass(column: RequirementTableTextColumn): string {
|
||||
return `block truncate ${TEXT_COLUMN_MAX_WIDTH[column]}`;
|
||||
}
|
||||
Reference in New Issue
Block a user