UNPKG

@itwin/itwinui-react

Version:

A react component library for iTwinUI

19 lines (18 loc) 550 B
import { SelectionColumn, SELECTION_CELL_ID } from '../columns/index.js'; export const useSelectionCell = (isSelectable, selectionMode, isRowDisabled, density = 'default') => (hooks) => { if (!isSelectable) return; hooks.allColumns.push((columns) => 'single' === selectionMode || columns.find((c) => c.id === SELECTION_CELL_ID) ? columns : [ SelectionColumn({ isDisabled: isRowDisabled, density: density, }), ...columns, ], ); };