UNPKG

@itwin/itwinui-react

Version:

A react component library for iTwinUI

34 lines (33 loc) 1.39 kB
import * as React from 'react'; import type { CellProps, CellRendererProps, HeaderProps } from '../../../react-table/react-table.js'; export declare const SELECTION_CELL_ID = "iui-table-checkbox-selector"; /** * Selection column that adds selection checkbox column to the Table. * It is recommended to use it as the first column. * @example * const isCheckboxDisabled = useCallback((rowData) => { * return rowData.name === 'Name1'; * }, []); * const columns = useMemo(() => [ * SelectionColumn({ isDisabled: isCheckboxDisabled }), * // Rest of your columns * ], [isCheckboxDisabled]); */ export declare const SelectionColumn: <T extends Record<string, unknown>>(props?: { /** Function that returns whether row checkbox should be disabled. */ isDisabled?: (rowData: T) => boolean; density?: "default" | "condensed" | "extra-condensed"; }) => { id: string; disableResizing: boolean; disableGroupBy: boolean; disableReordering: boolean; minWidth: number; width: number; maxWidth: number; columnClassName: string; cellClassName: string; Header: ({ getToggleAllRowsSelectedProps, toggleAllRowsSelected, rows, preFilteredFlatRows, state, }: HeaderProps<T>) => React.JSX.Element; Cell: ({ row, selectSubRows }: CellProps<T>) => React.JSX.Element; cellRenderer: (props: CellRendererProps<T>) => React.JSX.Element; };