Skip to content

Commit

Permalink
chore(table): 紧凑模式样式优化
Browse files Browse the repository at this point in the history
  • Loading branch information
zyprepare committed Sep 20, 2023
1 parent fb9b128 commit e44cd94
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/ui/table/src/BaseTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const BaseTable = forwardRef<HTMLDivElement | null, BaseTableProps>(
onEmbedExpand,
expandedRender,
// 其它
size,
size = 'md',
extra,
onRow,
onHeaderRow,
Expand Down
5 changes: 2 additions & 3 deletions packages/ui/table/src/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,8 @@ export const Table = forwardRef<HTMLDivElement | null, TableProps>(
const checkboxColWidth = React.useMemo(() => {
return rowSelection && typeof rowSelection.checkboxColWidth === 'number'
? rowSelection.checkboxColWidth
: // 适配不同尺寸,默认常规尺寸
{ sm: 36, md: 44, lg: 52 }[rest.size ?? 'md']
}, [rest.size, rowSelection])
: 38
}, [rowSelection])

// 预处理 column 支持 多选渲染
const {
Expand Down
8 changes: 4 additions & 4 deletions packages/ui/table/src/styles/table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ $emptyContent: '#{$component-prefix}-table-empty-content' !default;
padding: use-spacing(7);

&.#{$prefix}__selection-col {
padding: use-spacing(7);
padding: use-spacing(7) use-spacing(5);
}
}
}
Expand All @@ -55,7 +55,7 @@ $emptyContent: '#{$component-prefix}-table-empty-content' !default;
padding: use-spacing(7);

&.#{$prefix}__selection-col {
padding: use-spacing(7);
padding: use-spacing(7) use-spacing(5);
}
}
}
Expand Down Expand Up @@ -93,7 +93,7 @@ $emptyContent: '#{$component-prefix}-table-empty-content' !default;
padding: use-spacing(9);

&.#{$prefix}__selection-col {
padding: use-spacing(9);
padding: use-spacing(9) use-spacing(5);
}
}
}
Expand All @@ -103,7 +103,7 @@ $emptyContent: '#{$component-prefix}-table-empty-content' !default;
padding: use-spacing(9);

&.#{$prefix}__selection-col {
padding: use-spacing(9);
padding: use-spacing(9) use-spacing(5);
}
}
}
Expand Down

0 comments on commit e44cd94

Please sign in to comment.