Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Table): expand checkbox click area #654

Merged
merged 10 commits into from
Oct 19, 2023
3 changes: 1 addition & 2 deletions src/components/Table/Table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,8 @@
border-bottom-color: transparent;
}

&__th-content {
&__head &__cell {
@include mixins.text-accent;
display: inline-block;
&::first-letter {
text-transform: uppercase;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class Table<I extends TableDataItem = Record<string, string>> extends Rea
content = id;
}

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

static getBodyCellContent<I extends TableDataItem>(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
@use '../../variables';

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

&__selection-checkbox {
display: inline-block;
padding: inherit;
border-bottom: none;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}

&__row_selected {
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
Loading