@itwin/itwinui-react
Version:
A react component library for iTwinUI
29 lines (28 loc) • 747 B
JavaScript
;
Object.defineProperty(exports, '__esModule', {
value: true,
});
Object.defineProperty(exports, 'useSelectionCell', {
enumerable: true,
get: function () {
return useSelectionCell;
},
});
const _index = require('../columns/index.js');
const useSelectionCell =
(isSelectable, selectionMode, isRowDisabled, density = 'default') =>
(hooks) => {
if (!isSelectable) return;
hooks.allColumns.push((columns) =>
'single' === selectionMode ||
columns.find((c) => c.id === _index.SELECTION_CELL_ID)
? columns
: [
(0, _index.SelectionColumn)({
isDisabled: isRowDisabled,
density: density,
}),
...columns,
],
);
};