Lucas/t 295 fix checkbox column width (#261)

* wip

* Fixed table and column width

* Use last resizable column instead of table width 100%

* Removed comments

* Fix lint

* Fixed table theme

* Removed left clickable margin

* Removed overflow

* Added table width
This commit is contained in:
Lucas Bordeau
2023-06-12 12:47:35 +02:00
committed by GitHub
parent 551cd00790
commit 05d22c1b06
8 changed files with 64 additions and 55 deletions

View File

@ -0,0 +1,27 @@
import { CellContext } from '@tanstack/react-table';
import { CheckboxCell } from '@/ui/components/table/CheckboxCell';
import { SelectAllCheckbox } from '@/ui/components/table/SelectAllCheckbox';
export function getCheckBoxColumn() {
return {
id: 'select',
header: ({ table }: any) => (
<SelectAllCheckbox
checked={table.getIsAllRowsSelected()}
indeterminate={table.getIsSomeRowsSelected()}
onChange={(newValue) => table.toggleAllRowsSelected(newValue)}
/>
),
cell: (props: CellContext<any, string>) => (
<CheckboxCell
id={`checkbox-selected-${props.row.original.id}`}
name={`checkbox-selected-${props.row.original.id}`}
checked={props.row.getIsSelected()}
onChange={(newValue) => props.row.toggleSelected(newValue)}
/>
),
size: 32,
maxSize: 32,
};
}