Skip to content

Commit

Permalink
feat: add classname to enhanceColumns method, separate checkbox cell …
Browse files Browse the repository at this point in the history
…class
  • Loading branch information
Bluepuper committed Oct 19, 2023
1 parent fabb4db commit 86f852f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/components/Table/Table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
&__cell {
position: relative;

min-width: 17px;
box-sizing: content-box;
padding: 11px 10px;
border-bottom: 1px solid var(--g-color-line-generic);
Expand Down
1 change: 1 addition & 0 deletions src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export class Table<I extends TableDataItem = Record<string, string>> extends Rea
content = id;
}

if (id === '_selection') return content;
return <span className={b('th-content')}>{content}</span>;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
@use '../../variables';
@import '../../Table';

#{variables.$block} {
&__checkbox_cell {
min-width: 17px;
}

&__selection-checkbox {
@extend #{variables.$block}__cell;
@extend #{variables.$block}__cell_edge-padding;
padding: inherit;
border-bottom: none;
position: absolute;
top: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export function withTableSelection<I extends TableDataItem, E extends {} = {}>(
id: selectionColumnId,
name: this.renderHeadCell,
template: this.renderBodyCell,
width: 17, // checkbox width
className: b('checkbox_cell'),
sticky: _get(columns, [0, 'sticky']) === 'left' ? 'left' : undefined,
};

Expand Down

0 comments on commit 86f852f

Please sign in to comment.