@economic/taco 2.40.2 → 2.41.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. package/dist/components/OverflowGroup/OverflowGroup.d.ts +1 -0
  2. package/dist/components/Tabs/Tabs.d.ts +5 -0
  3. package/dist/esm/index.css +2 -2
  4. package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js +1 -1
  5. package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js.map +1 -1
  6. package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js +3 -1
  7. package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js.map +1 -1
  8. package/dist/esm/packages/taco/src/components/Select2/components/Search.js +0 -1
  9. package/dist/esm/packages/taco/src/components/Select2/components/Search.js.map +1 -1
  10. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Cell.js +1 -1
  11. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Cell.js.map +1 -1
  12. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateRowButton.js +1 -1
  13. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateRowButton.js.map +1 -1
  14. package/dist/esm/packages/taco/src/components/Tabs/Tabs.js +17 -3
  15. package/dist/esm/packages/taco/src/components/Tabs/Tabs.js.map +1 -1
  16. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Drag.js +5 -44
  17. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Drag.js.map +1 -1
  18. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Selection.js +8 -5
  19. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Selection.js.map +1 -1
  20. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Summary.js +2 -1
  21. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Summary.js.map +1 -1
  22. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js +3 -1
  23. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js.map +1 -1
  24. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Resizer.js +1 -1
  25. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Resizer.js.map +1 -1
  26. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js +33 -1
  27. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js.map +1 -1
  28. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleGrid.js +2 -1
  29. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleGrid.js.map +1 -1
  30. package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -1
  31. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowSelection.js +4 -3
  32. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowSelection.js.map +1 -1
  33. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.js +13 -10
  34. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.js.map +1 -1
  35. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js +1 -1
  36. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js.map +1 -1
  37. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js +8 -6
  38. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js.map +1 -1
  39. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js +2 -2
  40. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js.map +1 -1
  41. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js +7 -2
  42. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js.map +1 -1
  43. package/dist/index.css +2 -2
  44. package/dist/primitives/Table/types.d.ts +7 -4
  45. package/dist/primitives/Table/useTableManager/useTableManager.d.ts +1 -0
  46. package/dist/taco.cjs.development.js +107 -85
  47. package/dist/taco.cjs.development.js.map +1 -1
  48. package/dist/taco.cjs.production.min.js +1 -1
  49. package/dist/taco.cjs.production.min.js.map +1 -1
  50. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"useTableManager.js","sources":["../../../../../../../../src/primitives/Table/useTableManager/useTableManager.ts"],"sourcesContent":["import { useReactTable, TableMeta as ReactTableMeta, RowData, getCoreRowModel } from '@tanstack/react-table';\nimport {\n TableColumnAlignment,\n TableColumnClassNameHandler,\n TableColumnDataType,\n TableColumnMenu,\n TableColumnRenderer,\n TableColumnRendererControl,\n TableFilterComparator,\n TableProps,\n} from '../types';\nimport { useReactTableInitialState, configureReactTableOptions, mapTableChildrenToColumns } from './util/setup';\nimport { getTableFeaturePreset } from './util/presets';\nimport { useTableColumnFreezing } from './features/useTableColumnFreezing';\nimport { useTableColumnOrdering } from './features/useTableColumnOrdering';\nimport { useTableFooter } from './features/useTableFooter';\nimport { useTableFontSize } from './features/useTableFontSize';\nimport { useTablePrinting } from './features/useTablePrinting';\nimport { useTableRowActions } from './features/useTableRowActions';\nimport { useTableRowActive } from './features/useTableRowActive';\nimport { useTableRowClick } from './features/useTableRowClick';\nimport { useTableRowExpansion } from './features/useTableRowExpansion';\nimport { useTableRowGoto } from './features/useTableRowGoto';\nimport { useTableRowGroups } from './features/useTableRowGroups';\nimport { useTableRowHeight } from './features/useTableRowHeight';\nimport { useTableRowSelection } from './features/useTableRowSelection';\nimport { useTableSearch } from './features/useTableSearch';\nimport { useTableServerLoading } from './features/useTableServerLoading';\nimport { useTableSettings } from './features/useTableSettings';\nimport { useTableDataListener } from './listeners/useTableDataListener';\nimport { useTableFilterListener } from './listeners/useTableFilterListener';\nimport { useTableFontSizeListener } from './listeners/useTableFontSizeListener';\nimport { useTableRowHeightListener } from './listeners/useTableRowHeightListener';\nimport { useTableRowSelectionListener } from './listeners/useTableRowSelectionListener';\nimport { useTableSearchListener } from './listeners/useTableSearchListener';\nimport { useTableSettingsListener } from './listeners/useTableSettingsListener';\nimport { useTableShortcutsListener } from './listeners/useTableShortcutsListener';\nimport { useTableSortingListener } from './listeners/useTableSortingListener';\nimport { useTableServerLoadingListener } from './listeners/useTableServerLoadingListener';\nimport { useTableManagerInternalColumns } from './types';\nimport { useTableRowDrag } from './features/useTableRowDrag';\nimport { useTableRowDrop } from './features/useTableRowDrop';\n\n/*\n EDITING THIS FILE? READ ME FIRST!\n\n This is a shared, common hook for multiple tables. It's feature set is specifically chosen to support features\n common across those tables. If you are adding a new feature or changing an existing one, before writing any code\n in this file ask yourself the question - is this specific to a given table, or is it common to all of them.\n If you are unsure, ask your team first.\n*/\n\ndeclare module '@tanstack/table-core' {\n interface TableMeta<TData extends RowData> {\n columnFreezing: ReturnType<typeof useTableColumnFreezing>;\n columnOrdering: ReturnType<typeof useTableColumnOrdering>;\n fontSize: ReturnType<typeof useTableFontSize>;\n footer: ReturnType<typeof useTableFooter>;\n length: number;\n printing: ReturnType<typeof useTablePrinting>;\n rowActions: ReturnType<typeof useTableRowActions>;\n rowActive: ReturnType<typeof useTableRowActive>;\n rowClick: ReturnType<typeof useTableRowClick>;\n rowDrag: ReturnType<typeof useTableRowDrag>;\n rowDrop: ReturnType<typeof useTableRowDrop>;\n rowExpansion: ReturnType<typeof useTableRowExpansion>;\n rowGoto: ReturnType<typeof useTableRowGoto>;\n rowGroups: ReturnType<typeof useTableRowGroups>;\n rowHeight: ReturnType<typeof useTableRowHeight>;\n rowIdentityColumnId?: string;\n rowSelection: ReturnType<typeof useTableRowSelection>;\n search: ReturnType<typeof useTableSearch>;\n server: ReturnType<typeof useTableServerLoading>;\n }\n\n interface ColumnMeta<TData extends RowData, TValue> {\n align?: TableColumnAlignment;\n className?: TableColumnClassNameHandler<TData>;\n control?: TableColumnRendererControl<TData>;\n dataType?: TableColumnDataType;\n defaultWidth?: number;\n enableOrdering?: boolean;\n enablePrinting?: boolean;\n enableSearch?: boolean;\n enableTruncate?: boolean;\n filters?: TableFilterComparator[];\n header: string;\n headerClassName?: string;\n menu?: TableColumnMenu;\n renderer?: TableColumnRenderer<TValue, TData>;\n tooltip?: string;\n }\n}\n\nexport function useTableManager<TType = unknown, TMeta = {}>(\n props: TableProps<TType>,\n meta?: Partial<ReactTableMeta<TType>> & TMeta,\n internalColumns?: useTableManagerInternalColumns<TType>\n) {\n // CSS.escape would be best here, but it doesn't seem to work very well\n const safeId = props.id.replace('.', '_');\n // configure table options, merging props with presets\n const options = getTableFeaturePreset(props);\n\n // load any persisted table settings and merge them with any defaults\n const [settings, setSettings] = useTableSettings(\n options.enableSaveSettings,\n safeId,\n props.defaultSettings,\n props.onChangeSettings\n );\n\n // configure common custom features\n const columnFreezing = useTableColumnFreezing(options.enableColumnFreezing);\n const columnOrdering = useTableColumnOrdering(options.enableColumnOrdering);\n const fontSize = useTableFontSize(options.enableFontSize, settings.fontSize);\n const footer = useTableFooter(options.enableFooter);\n const printing = useTablePrinting(options.enablePrinting, safeId);\n const rowActive = useTableRowActive(options.enableRowActive, props.defaultRowActiveIndex);\n const rowActions = useTableRowActions<TType>(options.enableRowActions, props.rowActions, props.rowActionsLength);\n const rowClick = useTableRowClick<TType>(options.enableRowClick, props.onRowClick);\n const rowDrag = useTableRowDrag<TType>(options.enableRowDrag, props.onRowDrag);\n const rowDrop = useTableRowDrop<TType>(options.enableRowDrop, props.onRowDrop);\n const rowExpansion = useTableRowExpansion<TType>(options.enableRowExpansion, props.rowExpansionRenderer);\n const rowGoto = useTableRowGoto(options.enableRowGoto, props.onRowGoto);\n const rowGroups = useTableRowGroups(props.rowActionsForGroup);\n const rowHeight = useTableRowHeight(options.enableRowHeight, settings.rowHeight);\n const rowSelection = useTableRowSelection(options.enableRowSelection);\n const search = useTableSearch(options.enableSearch, settings.excludeUnmatchedRecordsInSearch);\n const server = useTableServerLoading(props.loadPage, props.loadAll, props.pageSize);\n\n // TODO: memoise\n // convert jsx column components into valid table columns\n const { columns, ...defaultState } = mapTableChildrenToColumns<TType>(props, settings, options, internalColumns);\n\n // configure initial table state\n const initialState = useReactTableInitialState<TType>(props, columns, settings, defaultState);\n\n // ensure data is always valid\n const data = props.data ?? [];\n const length = props.length ?? data.length;\n\n // create a react-table instance\n const instance = useReactTable<TType>({\n data,\n columns,\n // configure initial table state\n initialState,\n getCoreRowModel: getCoreRowModel<TType>(),\n // configure react-table built-in features\n ...configureReactTableOptions<TType>(options, props),\n // settings that can be toggled by the user, and therefore require our own state\n enableGlobalFilter: search.enableGlobalFilter,\n // custom context\n meta: {\n // spread features from specific implementations\n ...meta,\n columnFreezing,\n columnOrdering,\n fontSize,\n footer,\n length,\n printing,\n rowActions: rowActions as any, // no other way around ReturnType<typeof X> not supporting generics\n rowActive,\n rowClick: rowClick as any, // no other way around ReturnType<typeof X> not supporting generics\n rowDrag,\n rowDrop: rowDrop as any, // no other way around ReturnType<typeof X> not supporting generics\n rowExpansion: rowExpansion as any, // no other way around ReturnType<typeof X> not supporting generics\n rowIdentityColumnId: props.rowIdentityColumnId,\n rowGoto,\n rowGroups: rowGroups as any, // no other way around ReturnType<typeof X> not supporting generics\n rowHeight,\n rowSelection,\n search,\n server,\n } as ReactTableMeta<TType> & TMeta,\n });\n\n // state listeners - we have these so that we don't have to control state outside the table\n useTableDataListener(instance);\n useTableFilterListener(instance, props.onChangeFilter);\n useTableFontSizeListener(instance);\n useTableRowHeightListener(instance);\n useTableRowSelectionListener(instance, props.onRowSelect);\n useTableSearchListener(instance, props.onChangeSearch);\n useTableServerLoadingListener(instance, server.loadPage);\n useTableSettingsListener(instance, setSettings);\n useTableShortcutsListener(instance, props.shortcuts);\n useTableSortingListener(instance, props.onChangeSort);\n\n return {\n id: safeId,\n instance,\n meta: (instance.options.meta ?? {}) as ReactTableMeta<TType> & TMeta,\n state: instance.getState(),\n };\n}\n"],"names":["useTableManager","props","meta","internalColumns","safeId","id","replace","options","getTableFeaturePreset","settings","setSettings","useTableSettings","enableSaveSettings","defaultSettings","onChangeSettings","columnFreezing","useTableColumnFreezing","enableColumnFreezing","columnOrdering","useTableColumnOrdering","enableColumnOrdering","fontSize","useTableFontSize","enableFontSize","footer","useTableFooter","enableFooter","printing","useTablePrinting","enablePrinting","rowActive","useTableRowActive","enableRowActive","defaultRowActiveIndex","rowActions","useTableRowActions","enableRowActions","rowActionsLength","rowClick","useTableRowClick","enableRowClick","onRowClick","rowDrag","useTableRowDrag","enableRowDrag","onRowDrag","rowDrop","useTableRowDrop","enableRowDrop","onRowDrop","rowExpansion","useTableRowExpansion","enableRowExpansion","rowExpansionRenderer","rowGoto","useTableRowGoto","enableRowGoto","onRowGoto","rowGroups","useTableRowGroups","rowActionsForGroup","rowHeight","useTableRowHeight","enableRowHeight","rowSelection","useTableRowSelection","enableRowSelection","search","useTableSearch","enableSearch","excludeUnmatchedRecordsInSearch","server","useTableServerLoading","loadPage","loadAll","pageSize","columns","defaultState","mapTableChildrenToColumns","initialState","useReactTableInitialState","data","_props$data","length","_props$length","instance","useReactTable","getCoreRowModel","configureReactTableOptions","enableGlobalFilter","rowIdentityColumnId","useTableDataListener","useTableFilterListener","onChangeFilter","useTableFontSizeListener","useTableRowHeightListener","useTableRowSelectionListener","onRowSelect","useTableSearchListener","onChangeSearch","useTableServerLoadingListener","useTableSettingsListener","useTableShortcutsListener","shortcuts","useTableSortingListener","onChangeSort","_instance$options$met","state","getState"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA8FgBA,eAAeA,CAC3BC,KAAwB,EACxBC,IAA6C,EAC7CC,eAAuD;;;EAGvD,MAAMC,MAAM,GAAGH,KAAK,CAACI,EAAE,CAACC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;;EAEzC,MAAMC,OAAO,GAAGC,qBAAqB,CAACP,KAAK,CAAC;;EAG5C,MAAM,CAACQ,QAAQ,EAAEC,WAAW,CAAC,GAAGC,gBAAgB,CAC5CJ,OAAO,CAACK,kBAAkB,EAC1BR,MAAM,EAC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Q,EAAEA,QAAe;MACzBI,OAAO;MACPI,OAAO,EAAEA,OAAc;MACvBI,YAAY,EAAEA,YAAmB;MACjCwC,mBAAmB,EAAEzF,KAAK,CAACyF,mBAAmB;MAC9CpC,OAAO;MACPI,SAAS,EAAEA,SAAgB;MAC3BG,SAAS;MACTG,YAAY;MACZG,MAAM;MACNI;;GAEP,CAAC;;EAGFoB,oBAAoB,CAACN,QAAQ,CAAC;EAC9BO,sBAAsB,CAACP,QAAQ,EAAEpF,KAAK,CAAC4F,cAAc,CAAC;EACtDC,wBAAwB,CAACT,QAAQ,CAAC;EAClCU,yBAAyB,CAACV,QAAQ,CAAC;EACnCW,4BAA4B,CAACX,QAAQ,EAAEpF,KAAK,CAACgG,WAAW,CAAC;EACzDC,sBAAsB,CAACb,QAAQ,EAAEpF,KAAK,CAACkG,cAAc,CAAC;EACtDC,6BAA6B,CAACf,QAAQ,EAAEd,MAAM,CAACE,QAAQ,CAAC;EACxD4B,wBAAwB,CAAChB,QAAQ,EAAE3E,WAAW,CAAC;EAC/C4F,yBAAyB,CAACjB,QAAQ,EAAEpF,KAAK,CAACsG,SAAS,CAAC;EACpDC,uBAAuB,CAACnB,QAAQ,EAAEpF,KAAK,CAACwG,YAAY,CAAC;EAErD,OAAO;IACHpG,EAAE,EAAED,MAAM;IACViF,QAAQ;IACRnF,IAAI,GAAAwG,qBAAA,GAAGrB,QAAQ,CAAC9E,OAAO,CAACL,IAAI,cAAAwG,qBAAA,cAAAA,qBAAA,GAAI,EAAoC;IACpEC,KAAK,EAAEtB,QAAQ,CAACuB,QAAQ;GAC3B;AACL;;;;"}
1
+ {"version":3,"file":"useTableManager.js","sources":["../../../../../../../../src/primitives/Table/useTableManager/useTableManager.ts"],"sourcesContent":["import { useReactTable, TableMeta as ReactTableMeta, RowData, getCoreRowModel } from '@tanstack/react-table';\nimport {\n TableColumnAlignment,\n TableColumnClassNameHandler,\n TableColumnDataType,\n TableColumnMenu,\n TableColumnRenderer,\n TableColumnRendererControl,\n TableFilterComparator,\n TableProps,\n} from '../types';\nimport { useReactTableInitialState, configureReactTableOptions, mapTableChildrenToColumns } from './util/setup';\nimport { getTableFeaturePreset } from './util/presets';\nimport { useTableColumnFreezing } from './features/useTableColumnFreezing';\nimport { useTableColumnOrdering } from './features/useTableColumnOrdering';\nimport { useTableFooter } from './features/useTableFooter';\nimport { useTableFontSize } from './features/useTableFontSize';\nimport { useTablePrinting } from './features/useTablePrinting';\nimport { useTableRowActions } from './features/useTableRowActions';\nimport { useTableRowActive } from './features/useTableRowActive';\nimport { useTableRowClick } from './features/useTableRowClick';\nimport { useTableRowExpansion } from './features/useTableRowExpansion';\nimport { useTableRowGoto } from './features/useTableRowGoto';\nimport { useTableRowGroups } from './features/useTableRowGroups';\nimport { useTableRowHeight } from './features/useTableRowHeight';\nimport { useTableRowSelection } from './features/useTableRowSelection';\nimport { useTableSearch } from './features/useTableSearch';\nimport { useTableServerLoading } from './features/useTableServerLoading';\nimport { useTableSettings } from './features/useTableSettings';\nimport { useTableDataListener } from './listeners/useTableDataListener';\nimport { useTableFilterListener } from './listeners/useTableFilterListener';\nimport { useTableFontSizeListener } from './listeners/useTableFontSizeListener';\nimport { useTableRowHeightListener } from './listeners/useTableRowHeightListener';\nimport { useTableRowSelectionListener } from './listeners/useTableRowSelectionListener';\nimport { useTableSearchListener } from './listeners/useTableSearchListener';\nimport { useTableSettingsListener } from './listeners/useTableSettingsListener';\nimport { useTableShortcutsListener } from './listeners/useTableShortcutsListener';\nimport { useTableSortingListener } from './listeners/useTableSortingListener';\nimport { useTableServerLoadingListener } from './listeners/useTableServerLoadingListener';\nimport { useTableManagerInternalColumns } from './types';\nimport { useTableRowDrag } from './features/useTableRowDrag';\nimport { useTableRowDrop } from './features/useTableRowDrop';\n\n/*\n EDITING THIS FILE? READ ME FIRST!\n\n This is a shared, common hook for multiple tables. It's feature set is specifically chosen to support features\n common across those tables. If you are adding a new feature or changing an existing one, before writing any code\n in this file ask yourself the question - is this specific to a given table, or is it common to all of them.\n If you are unsure, ask your team first.\n*/\n\ndeclare module '@tanstack/table-core' {\n interface TableMeta<TData extends RowData> {\n columnFreezing: ReturnType<typeof useTableColumnFreezing>;\n columnOrdering: ReturnType<typeof useTableColumnOrdering>;\n fontSize: ReturnType<typeof useTableFontSize>;\n footer: ReturnType<typeof useTableFooter>;\n length: number;\n printing: ReturnType<typeof useTablePrinting>;\n rowActions: ReturnType<typeof useTableRowActions>;\n rowActive: ReturnType<typeof useTableRowActive>;\n rowClick: ReturnType<typeof useTableRowClick>;\n rowDrag: ReturnType<typeof useTableRowDrag>;\n rowDrop: ReturnType<typeof useTableRowDrop>;\n rowExpansion: ReturnType<typeof useTableRowExpansion>;\n rowGoto: ReturnType<typeof useTableRowGoto>;\n rowGroups: ReturnType<typeof useTableRowGroups>;\n rowHeight: ReturnType<typeof useTableRowHeight>;\n rowIdentityColumnId?: string;\n rowSelection: ReturnType<typeof useTableRowSelection>;\n search: ReturnType<typeof useTableSearch>;\n server: ReturnType<typeof useTableServerLoading>;\n }\n\n interface ColumnMeta<TData extends RowData, TValue> {\n align?: TableColumnAlignment;\n className?: TableColumnClassNameHandler<TData>;\n control?: TableColumnRendererControl<TData>;\n dataType?: TableColumnDataType;\n defaultWidth?: number;\n enableEditing?: boolean;\n enableOrdering?: boolean;\n enablePrinting?: boolean;\n enableSearch?: boolean;\n enableTruncate?: boolean;\n filters?: TableFilterComparator[];\n header: string;\n headerClassName?: string;\n menu?: TableColumnMenu;\n renderer?: TableColumnRenderer<TValue, TData>;\n tooltip?: string;\n }\n}\n\n// Placed this array outside the hook to avoid creating a new array reference on each hook re-render\nconst DEFAULT_EMPTY_ARRAY = [];\n\nexport function useTableManager<TType = unknown, TMeta = {}>(\n props: TableProps<TType>,\n meta?: Partial<ReactTableMeta<TType>> & TMeta,\n internalColumns?: useTableManagerInternalColumns<TType>\n) {\n // CSS.escape would be best here, but it doesn't seem to work very well\n const safeId = props.id.replace('.', '_');\n // configure table options, merging props with presets\n const options = getTableFeaturePreset(props);\n\n // load any persisted table settings and merge them with any defaults\n const [settings, setSettings] = useTableSettings(\n options.enableSaveSettings,\n safeId,\n props.defaultSettings,\n props.onChangeSettings\n );\n\n // ensure data is always valid\n const data = props.data ?? DEFAULT_EMPTY_ARRAY;\n const length = props.length ?? data.length;\n\n // configure common custom features\n const columnFreezing = useTableColumnFreezing(options.enableColumnFreezing);\n const columnOrdering = useTableColumnOrdering(options.enableColumnOrdering);\n const fontSize = useTableFontSize(options.enableFontSize, settings.fontSize);\n const footer = useTableFooter(options.enableFooter);\n const printing = useTablePrinting(options.enablePrinting, safeId);\n const rowActive = useTableRowActive(options.enableRowActive, props.defaultRowActiveIndex);\n const rowActions = useTableRowActions<TType>(options.enableRowActions, props.rowActions, props.rowActionsLength);\n const rowClick = useTableRowClick<TType>(options.enableRowClick, props.onRowClick);\n const rowDrag = useTableRowDrag<TType>(options.enableRowDrag && !meta?.editing?.isEditing, props.onRowDrag);\n const rowDrop = useTableRowDrop<TType>(options.enableRowDrop, props.onRowDrop);\n const rowExpansion = useTableRowExpansion<TType>(options.enableRowExpansion, props.rowExpansionRenderer);\n const rowGoto = useTableRowGoto(options.enableRowGoto, props.onRowGoto);\n const rowGroups = useTableRowGroups(props.rowActionsForGroup);\n const rowHeight = useTableRowHeight(options.enableRowHeight, settings.rowHeight);\n const rowSelection = useTableRowSelection(!!options.enableRowSelection);\n const search = useTableSearch(options.enableSearch, settings.excludeUnmatchedRecordsInSearch);\n const server = useTableServerLoading(props.loadPage, props.loadAll, props.pageSize);\n\n // TODO: memoise\n // convert jsx column components into valid table columns\n const { columns, ...defaultState } = mapTableChildrenToColumns<TType>(props, settings, options, internalColumns);\n\n // configure initial table state\n const initialState = useReactTableInitialState<TType>(props, columns, settings, defaultState);\n\n // create a react-table instance\n const instance = useReactTable<TType>({\n data,\n columns,\n // configure initial table state\n initialState,\n getCoreRowModel: getCoreRowModel<TType>(),\n // configure react-table built-in features\n ...configureReactTableOptions<TType>(options, props),\n // settings that can be toggled by the user, and therefore require our own state\n enableGlobalFilter: search.enableGlobalFilter,\n // custom context\n meta: {\n // spread features from specific implementations\n ...meta,\n columnFreezing,\n columnOrdering,\n fontSize,\n footer,\n length,\n printing,\n rowActions: rowActions as any, // no other way around ReturnType<typeof X> not supporting generics\n rowActive,\n rowClick: rowClick as any, // no other way around ReturnType<typeof X> not supporting generics\n rowDrag,\n rowDrop: rowDrop as any, // no other way around ReturnType<typeof X> not supporting generics\n rowExpansion: rowExpansion as any, // no other way around ReturnType<typeof X> not supporting generics\n rowIdentityColumnId: props.rowIdentityColumnId,\n rowGoto,\n rowGroups: rowGroups as any, // no other way around ReturnType<typeof X> not supporting generics\n rowHeight,\n rowSelection,\n search,\n server,\n } as ReactTableMeta<TType> & TMeta,\n });\n\n // state listeners - we have these so that we don't have to control state outside the table\n useTableDataListener(instance);\n useTableFilterListener(instance, props.onChangeFilter);\n useTableFontSizeListener(instance);\n useTableRowHeightListener(instance);\n useTableRowSelectionListener(instance, props.onRowSelect);\n useTableSearchListener(instance, props.onChangeSearch);\n useTableServerLoadingListener(instance, server.loadPage);\n useTableSettingsListener(instance, setSettings);\n useTableShortcutsListener(instance, props.shortcuts);\n useTableSortingListener(instance, props.onChangeSort);\n\n return {\n id: safeId,\n instance,\n meta: (instance.options.meta ?? {}) as ReactTableMeta<TType> & TMeta,\n state: instance.getState(),\n };\n}\n"],"names":["DEFAULT_EMPTY_ARRAY","useTableManager","props","meta","internalColumns","safeId","id","replace","options","getTableFeaturePreset","settings","setSettings","useTableSettings","enableSaveSettings","defaultSettings","onChangeSettings","data","_props$data","length","_props$length","columnFreezing","useTableColumnFreezing","enableColumnFreezing","columnOrdering","useTableColumnOrdering","enableColumnOrdering","fontSize","useTableFontSize","enableFontSize","footer","useTableFooter","enableFooter","printing","useTablePrinting","enablePrinting","rowActive","useTableRowActive","enableRowActive","defaultRowActiveIndex","rowActions","useTableRowActions","enableRowActions","rowActionsLength","rowClick","useTableRowClick","enableRowClick","onRowClick","rowDrag","useTableRowDrag","enableRowDrag","_meta$editing","editing","isEditing","onRowDrag","rowDrop","useTableRowDrop","enableRowDrop","onRowDrop","rowExpansion","useTableRowExpansion","enableRowExpansion","rowExpansionRenderer","rowGoto","useTableRowGoto","enableRowGoto","onRowGoto","rowGroups","useTableRowGroups","rowActionsForGroup","rowHeight","useTableRowHeight","enableRowHeight","rowSelection","useTableRowSelection","enableRowSelection","search","useTableSearch","enableSearch","excludeUnmatchedRecordsInSearch","server","useTableServerLoading","loadPage","loadAll","pageSize","columns","defaultState","mapTableChildrenToColumns","initialState","useReactTableInitialState","instance","useReactTable","getCoreRowModel","configureReactTableOptions","enableGlobalFilter","rowIdentityColumnId","useTableDataListener","useTableFilterListener","onChangeFilter","useTableFontSizeListener","useTableRowHeightListener","useTableRowSelectionListener","onRowSelect","useTableSearchListener","onChangeSearch","useTableServerLoadingListener","useTableSettingsListener","useTableShortcutsListener","shortcuts","useTableSortingListener","onChangeSort","_instance$options$met","state","getState"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+FA;AACA,MAAMA,mBAAmB,GAAG,EAAE;SAEdC,eAAeA,CAC3BC,KAAwB,EACxBC,IAA6C,EAC7CC,eAAuD;;;EAGvD,MAAMC,MAAM,GAAGH,KAAK,CAACI,EAAE,CAACC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;;EAEzC,MAAMC,OAAO,GAAGC,qBAAqB,CAACP,KAAK,CAAC;;EAG5C,MAAM,CAACQ,QAAQ,EAAEC,WAAW,CAAC,GAAGC,gBAAgB,CAC5CJ,OAAO,CAACK,kBAAkB,EAC1BR,MAAM,EACNH,KAAK,CAACY,eAAe,EACrBZ,KAAK,CAACa,gBAAgB,CACzB;;EAGD,MAAMC,IAAI,IAAAC,WAAA,GAAGf,KAAK,CAACc,IAAI,cAAAC,WAAA,cAAAA,WAAA,GAAIjB,mBAAmB;EAC9C,MAAMkB,MAAM,IAAAC,aAAA,GAAGjB,KAAK,CAACgB,MAAM,cAAA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AAmB,EAAE5F,KAAK,CAAC4F,mBAAmB;MAC9ChC,OAAO;MACPI,SAAS,EAAEA,SAAgB;MAC3BG,SAAS;MACTG,YAAY;MACZG,MAAM;MACNI;;GAEP,CAAC;;EAGFgB,oBAAoB,CAACN,QAAQ,CAAC;EAC9BO,sBAAsB,CAACP,QAAQ,EAAEvF,KAAK,CAAC+F,cAAc,CAAC;EACtDC,wBAAwB,CAACT,QAAQ,CAAC;EAClCU,yBAAyB,CAACV,QAAQ,CAAC;EACnCW,4BAA4B,CAACX,QAAQ,EAAEvF,KAAK,CAACmG,WAAW,CAAC;EACzDC,sBAAsB,CAACb,QAAQ,EAAEvF,KAAK,CAACqG,cAAc,CAAC;EACtDC,6BAA6B,CAACf,QAAQ,EAAEV,MAAM,CAACE,QAAQ,CAAC;EACxDwB,wBAAwB,CAAChB,QAAQ,EAAE9E,WAAW,CAAC;EAC/C+F,yBAAyB,CAACjB,QAAQ,EAAEvF,KAAK,CAACyG,SAAS,CAAC;EACpDC,uBAAuB,CAACnB,QAAQ,EAAEvF,KAAK,CAAC2G,YAAY,CAAC;EAErD,OAAO;IACHvG,EAAE,EAAED,MAAM;IACVoF,QAAQ;IACRtF,IAAI,GAAA2G,qBAAA,GAAGrB,QAAQ,CAACjF,OAAO,CAACL,IAAI,cAAA2G,qBAAA,cAAAA,qBAAA,GAAI,EAAoC;IACpEC,KAAK,EAAEtB,QAAQ,CAACuB,QAAQ;GAC3B;AACL;;;;"}
@@ -123,8 +123,8 @@ function getTableFeaturePreset(props) {
123
123
  enableColumnHiding: (_props$enableColumnHi = props.enableColumnHiding) !== null && _props$enableColumnHi !== void 0 ? _props$enableColumnHi : presetOptions.enableColumnHiding,
124
124
  enableColumnResizing: (_props$enableColumnRe = props.enableColumnResizing) !== null && _props$enableColumnRe !== void 0 ? _props$enableColumnRe : presetOptions.enableColumnResizing,
125
125
  enableRowExpansion: enableRowExpansion && !!props.rowExpansionRenderer,
126
- enableRowSelection: enableRowSelection && !!props.onRowSelect,
127
- enableRowSelectionSingle: enableRowSelectionSingle && !!props.onRowSelect,
126
+ enableRowSelection: !!props.onRowSelect && enableRowSelection,
127
+ enableRowSelectionSingle: !!props.onRowSelect && enableRowSelectionSingle,
128
128
  // custom -- common between all table types
129
129
  enableColumnOrdering: (_props$enableColumnOr = props.enableColumnOrdering) !== null && _props$enableColumnOr !== void 0 ? _props$enableColumnOr : presetOptions.enableColumnOrdering,
130
130
  enableFontSize: (_props$enableFontSize = props.enableFontSize) !== null && _props$enableFontSize !== void 0 ? _props$enableFontSize : presetOptions.enableFontSize,
@@ -1 +1 @@
1
- {"version":3,"file":"presets.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/util/presets.ts"],"sourcesContent":["import { TableFeatureProps, TablePreset, TableProps } from '../../types';\n\nconst DEFAULT_PRESET: TableFeatureProps = {\n // react-table built-in\n enableFiltering: false,\n enableSearch: false,\n enableSorting: false,\n enableColumnFreezing: false,\n enableColumnHiding: false,\n enableColumnResizing: false,\n enableRowExpansion: false,\n enableRowSelection: false,\n enableRowSelectionSingle: false,\n\n // custom -- common between all table types\n enableColumnOrdering: false,\n enableFontSize: false,\n enableFooter: false,\n enablePrinting: false,\n enableRowActive: true,\n enableRowActions: true,\n enableRowClick: false,\n enableRowDrag: false,\n enableRowDrop: false,\n enableRowGoto: false,\n enableRowHeight: false,\n enableSaveSettings: false,\n};\n\nconst presets: Record<TablePreset, TableFeatureProps> = {\n // View/edit/create on page\n complex: {\n // react-table built-in\n enableFiltering: true,\n enableSearch: true,\n enableSorting: true,\n enableColumnFreezing: true,\n enableColumnHiding: true,\n enableColumnResizing: true,\n enableRowExpansion: true,\n enableRowSelection: true,\n enableRowSelectionSingle: false,\n\n // custom -- common between all table types\n enableColumnOrdering: true,\n enableFontSize: true,\n enableFooter: true,\n enablePrinting: true,\n enableRowActive: true,\n enableRowActions: true,\n enableRowClick: true,\n enableRowDrag: true,\n enableRowDrop: true,\n enableRowGoto: true,\n enableRowHeight: true,\n enableSaveSettings: true,\n },\n // View/create in dialog\n list: {\n // react-table built-in\n enableFiltering: false,\n enableSearch: true,\n enableSorting: true,\n enableColumnFreezing: false,\n enableColumnHiding: false,\n enableColumnResizing: false,\n enableRowExpansion: true,\n enableRowSelection: true,\n enableRowSelectionSingle: false,\n\n // custom -- common between all table types\n enableColumnOrdering: false,\n enableFontSize: false,\n enableFooter: false,\n enablePrinting: false,\n enableRowActive: true,\n enableRowActions: true,\n enableRowClick: true,\n enableRowDrag: false,\n enableRowDrop: false,\n enableRowGoto: false,\n enableRowHeight: false,\n enableSaveSettings: true,\n },\n // View in card or dialog\n simple: {\n // react-table built-in\n enableFiltering: false,\n enableSearch: false,\n enableSorting: true,\n enableColumnFreezing: false,\n enableColumnHiding: false,\n enableColumnResizing: false,\n enableRowExpansion: true,\n enableRowSelection: false,\n enableRowSelectionSingle: false,\n\n // custom -- common between all table types\n enableColumnOrdering: false,\n enableFontSize: false,\n enableFooter: false,\n enablePrinting: false,\n enableRowActive: true,\n enableRowActions: false,\n enableRowClick: true,\n enableRowDrag: false,\n enableRowDrop: false,\n enableRowGoto: false,\n enableRowHeight: false,\n enableSaveSettings: true,\n },\n};\n\nexport function getTableFeaturePreset<TType = unknown>(props: TableProps<TType>): TableFeatureProps<TType> {\n const presetOptions = props.preset ? presets[props.preset] : DEFAULT_PRESET;\n\n const enableRowActions = props.enableRowActions ?? presetOptions.enableRowActions;\n const enableRowClick = props.enableRowClick ?? presetOptions.enableRowClick;\n const enableRowDrag = props.enableRowDrag ?? presetOptions.enableRowDrag;\n const enableRowDrop = props.enableRowDrop ?? presetOptions.enableRowDrop;\n const enableRowGoto = props.enableRowGoto ?? presetOptions.enableRowGoto;\n const enableRowExpansion = props.enableRowExpansion ?? presetOptions.enableRowExpansion;\n const enableRowSelection = props.enableRowSelection ?? presetOptions.enableRowSelection;\n const enableRowSelectionSingle = props.enableRowSelectionSingle ?? presetOptions.enableRowSelectionSingle;\n\n return {\n // react-table built-in\n enableFiltering: props.enableFiltering ?? presetOptions.enableFiltering,\n enableSearch: props.enableSearch ?? presetOptions.enableSearch,\n enableSorting: props.enableSorting ?? presetOptions.enableSorting,\n enableColumnFreezing: props.enableColumnFreezing ?? presetOptions.enableColumnFreezing,\n enableColumnHiding: props.enableColumnHiding ?? presetOptions.enableColumnHiding,\n enableColumnResizing: props.enableColumnResizing ?? presetOptions.enableColumnResizing,\n enableRowExpansion: enableRowExpansion && !!props.rowExpansionRenderer,\n enableRowSelection: enableRowSelection && !!props.onRowSelect,\n enableRowSelectionSingle: enableRowSelectionSingle && !!props.onRowSelect,\n\n // custom -- common between all table types\n enableColumnOrdering: props.enableColumnOrdering ?? presetOptions.enableColumnOrdering,\n enableFontSize: props.enableFontSize ?? presetOptions.enableFontSize,\n enableFooter: props.enableFooter ?? presetOptions.enableFooter,\n enablePrinting: props.enablePrinting ?? presetOptions.enablePrinting,\n enableRowActive: props.enableRowActive ?? presetOptions.enableRowActive,\n enableRowActions: enableRowActions && !!props.rowActions?.length,\n // enableRowClick can be either function or boolean, that is why we need to pass exactly enableRowClick,\n // and not just result of the condition\n enableRowClick: enableRowClick && !!props.onRowClick ? enableRowClick : false,\n enableRowDrag: enableRowDrag && !!props.onRowDrag,\n enableRowDrop: enableRowDrop && !!props.onRowDrop,\n enableRowGoto: enableRowGoto && !!props.onRowGoto,\n enableRowHeight: props.enableRowHeight ?? presetOptions.enableRowHeight,\n enableSaveSettings: props.enableSaveSettings ?? presetOptions.enableSaveSettings,\n };\n}\n"],"names":["DEFAULT_PRESET","enableFiltering","enableSearch","enableSorting","enableColumnFreezing","enableColumnHiding","enableColumnResizing","enableRowExpansion","enableRowSelection","enableRowSelectionSingle","enableColumnOrdering","enableFontSize","enableFooter","enablePrinting","enableRowActive","enableRowActions","enableRowClick","enableRowDrag","enableRowDrop","enableRowGoto","enableRowHeight","enableSaveSettings","presets","complex","list","simple","getTableFeaturePreset","props","presetOptions","preset","_props$enableRowActio","_props$enableRowClick","_props$enableRowDrag","_props$enableRowDrop","_props$enableRowGoto","_props$enableRowExpan","_props$enableRowSelec","_props$enableRowSelec2","_props$enableFilterin","_props$enableSearch","_props$enableSorting","_props$enableColumnFr","_props$enableColumnHi","_props$enableColumnRe","rowExpansionRenderer","onRowSelect","_props$enableColumnOr","_props$enableFontSize","_props$enableFooter","_props$enablePrinting","_props$enableRowActiv","_props$rowActions","rowActions","length","onRowClick","onRowDrag","onRowDrop","onRowGoto","_props$enableRowHeigh","_props$enableSaveSett"],"mappings":"AAEA,MAAMA,cAAc,GAAsB;;EAEtCC,eAAe,EAAE,KAAK;EACtBC,YAAY,EAAE,KAAK;EACnBC,aAAa,EAAE,KAAK;EACpBC,oBAAoB,EAAE,KAAK;EAC3BC,kBAAkB,EAAE,KAAK;EACzBC,oBAAoB,EAAE,KAAK;EAC3BC,kBAAkB,EAAE,KAAK;EACzBC,kBAAkB,EAAE,KAAK;EACzBC,wBAAwB,EAAE,KAAK;;EAG/BC,oBAAoB,EAAE,KAAK;EAC3BC,cAAc,EAAE,KAAK;EACrBC,YAAY,EAAE,KAAK;EACnBC,cAAc,EAAE,KAAK;EACrBC,eAAe,EAAE,IAAI;EACrBC,gBAAgB,EAAE,IAAI;EACtBC,cAAc,EAAE,KAAK;EACrBC,aAAa,EAAE,KAAK;EACpBC,aAAa,EAAE,KAAK;EACpBC,aAAa,EAAE,KAAK;EACpBC,eAAe,EAAE,KAAK;EACtBC,kBAAkB,EAAE;CACvB;AAED,MAAMC,OAAO,GAA2C;;EAEpDC,OAAO,EAAE;;IAELtB,eAAe,EAAE,IAAI;IACrBC,YAAY,EAAE,IAAI;IAClBC,aAAa,EAAE,IAAI;IACnBC,oBAAoB,EAAE,IAAI;IAC1BC,kBAAkB,EAAE,IAAI;IACxBC,oBAAoB,EAAE,IAAI;IAC1BC,kBAAkB,EAAE,IAAI;IACxBC,kBAAkB,EAAE,IAAI;IACxBC,wBAAwB,EAAE,KAAK;;IAG/BC,oBAAoB,EAAE,IAAI;IAC1BC,cAAc,EAAE,IAAI;IAC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AAAoC,mBAAA,GAAErB,KAAK,CAACf,YAAY,cAAAoC,mBAAA,cAAAA,mBAAA,GAAIpB,aAAa,CAAChB,YAAY;IAC9DC,cAAc,GAAAoC,qBAAA,GAAEtB,KAAK,CAACd,cAAc,cAAAoC,qBAAA,cAAAA,qBAAA,GAAIrB,aAAa,CAACf,cAAc;IACpEC,eAAe,GAAAoC,qBAAA,GAAEvB,KAAK,CAACb,eAAe,cAAAoC,qBAAA,cAAAA,qBAAA,GAAItB,aAAa,CAACd,eAAe;IACvEC,gBAAgB,EAAEA,gBAAgB,IAAI,CAAC,GAAAoC,iBAAA,GAACxB,KAAK,CAACyB,UAAU,cAAAD,iBAAA,eAAhBA,iBAAA,CAAkBE,MAAM;;;IAGhErC,cAAc,EAAEA,cAAc,IAAI,CAAC,CAACW,KAAK,CAAC2B,UAAU,GAAGtC,cAAc,GAAG,KAAK;IAC7EC,aAAa,EAAEA,aAAa,IAAI,CAAC,CAACU,KAAK,CAAC4B,SAAS;IACjDrC,aAAa,EAAEA,aAAa,IAAI,CAAC,CAACS,KAAK,CAAC6B,SAAS;IACjDrC,aAAa,EAAEA,aAAa,IAAI,CAAC,CAACQ,KAAK,CAAC8B,SAAS;IACjDrC,eAAe,GAAAsC,qBAAA,GAAE/B,KAAK,CAACP,eAAe,cAAAsC,qBAAA,cAAAA,qBAAA,GAAI9B,aAAa,CAACR,eAAe;IACvEC,kBAAkB,GAAAsC,qBAAA,GAAEhC,KAAK,CAACN,kBAAkB,cAAAsC,qBAAA,cAAAA,qBAAA,GAAI/B,aAAa,CAACP;GACjE;AACL;;;;"}
1
+ {"version":3,"file":"presets.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/util/presets.ts"],"sourcesContent":["import { TableFeatureProps, TablePreset, TableProps } from '../../types';\n\nconst DEFAULT_PRESET: TableFeatureProps = {\n // react-table built-in\n enableFiltering: false,\n enableSearch: false,\n enableSorting: false,\n enableColumnFreezing: false,\n enableColumnHiding: false,\n enableColumnResizing: false,\n enableRowExpansion: false,\n enableRowSelection: false,\n enableRowSelectionSingle: false,\n\n // custom -- common between all table types\n enableColumnOrdering: false,\n enableFontSize: false,\n enableFooter: false,\n enablePrinting: false,\n enableRowActive: true,\n enableRowActions: true,\n enableRowClick: false,\n enableRowDrag: false,\n enableRowDrop: false,\n enableRowGoto: false,\n enableRowHeight: false,\n enableSaveSettings: false,\n};\n\nconst presets: Record<TablePreset, TableFeatureProps> = {\n // View/edit/create on page\n complex: {\n // react-table built-in\n enableFiltering: true,\n enableSearch: true,\n enableSorting: true,\n enableColumnFreezing: true,\n enableColumnHiding: true,\n enableColumnResizing: true,\n enableRowExpansion: true,\n enableRowSelection: true,\n enableRowSelectionSingle: false,\n\n // custom -- common between all table types\n enableColumnOrdering: true,\n enableFontSize: true,\n enableFooter: true,\n enablePrinting: true,\n enableRowActive: true,\n enableRowActions: true,\n enableRowClick: true,\n enableRowDrag: true,\n enableRowDrop: true,\n enableRowGoto: true,\n enableRowHeight: true,\n enableSaveSettings: true,\n },\n // View/create in dialog\n list: {\n // react-table built-in\n enableFiltering: false,\n enableSearch: true,\n enableSorting: true,\n enableColumnFreezing: false,\n enableColumnHiding: false,\n enableColumnResizing: false,\n enableRowExpansion: true,\n enableRowSelection: true,\n enableRowSelectionSingle: false,\n\n // custom -- common between all table types\n enableColumnOrdering: false,\n enableFontSize: false,\n enableFooter: false,\n enablePrinting: false,\n enableRowActive: true,\n enableRowActions: true,\n enableRowClick: true,\n enableRowDrag: false,\n enableRowDrop: false,\n enableRowGoto: false,\n enableRowHeight: false,\n enableSaveSettings: true,\n },\n // View in card or dialog\n simple: {\n // react-table built-in\n enableFiltering: false,\n enableSearch: false,\n enableSorting: true,\n enableColumnFreezing: false,\n enableColumnHiding: false,\n enableColumnResizing: false,\n enableRowExpansion: true,\n enableRowSelection: false,\n enableRowSelectionSingle: false,\n\n // custom -- common between all table types\n enableColumnOrdering: false,\n enableFontSize: false,\n enableFooter: false,\n enablePrinting: false,\n enableRowActive: true,\n enableRowActions: false,\n enableRowClick: true,\n enableRowDrag: false,\n enableRowDrop: false,\n enableRowGoto: false,\n enableRowHeight: false,\n enableSaveSettings: true,\n },\n};\n\nexport function getTableFeaturePreset<TType = unknown>(props: TableProps<TType>): TableFeatureProps<TType> {\n const presetOptions = props.preset ? presets[props.preset] : DEFAULT_PRESET;\n\n const enableRowActions = props.enableRowActions ?? presetOptions.enableRowActions;\n const enableRowClick = props.enableRowClick ?? presetOptions.enableRowClick;\n const enableRowDrag = props.enableRowDrag ?? presetOptions.enableRowDrag;\n const enableRowDrop = props.enableRowDrop ?? presetOptions.enableRowDrop;\n const enableRowGoto = props.enableRowGoto ?? presetOptions.enableRowGoto;\n const enableRowExpansion = props.enableRowExpansion ?? presetOptions.enableRowExpansion;\n const enableRowSelection = props.enableRowSelection ?? presetOptions.enableRowSelection;\n const enableRowSelectionSingle = props.enableRowSelectionSingle ?? presetOptions.enableRowSelectionSingle;\n\n return {\n // react-table built-in\n enableFiltering: props.enableFiltering ?? presetOptions.enableFiltering,\n enableSearch: props.enableSearch ?? presetOptions.enableSearch,\n enableSorting: props.enableSorting ?? presetOptions.enableSorting,\n enableColumnFreezing: props.enableColumnFreezing ?? presetOptions.enableColumnFreezing,\n enableColumnHiding: props.enableColumnHiding ?? presetOptions.enableColumnHiding,\n enableColumnResizing: props.enableColumnResizing ?? presetOptions.enableColumnResizing,\n enableRowExpansion: enableRowExpansion && !!props.rowExpansionRenderer,\n enableRowSelection: !!props.onRowSelect && enableRowSelection,\n enableRowSelectionSingle: !!props.onRowSelect && enableRowSelectionSingle,\n\n // custom -- common between all table types\n enableColumnOrdering: props.enableColumnOrdering ?? presetOptions.enableColumnOrdering,\n enableFontSize: props.enableFontSize ?? presetOptions.enableFontSize,\n enableFooter: props.enableFooter ?? presetOptions.enableFooter,\n enablePrinting: props.enablePrinting ?? presetOptions.enablePrinting,\n enableRowActive: props.enableRowActive ?? presetOptions.enableRowActive,\n enableRowActions: enableRowActions && !!props.rowActions?.length,\n // enableRowClick can be either function or boolean, that is why we need to pass exactly enableRowClick,\n // and not just result of the condition\n enableRowClick: enableRowClick && !!props.onRowClick ? enableRowClick : false,\n enableRowDrag: enableRowDrag && !!props.onRowDrag,\n enableRowDrop: enableRowDrop && !!props.onRowDrop,\n enableRowGoto: enableRowGoto && !!props.onRowGoto,\n enableRowHeight: props.enableRowHeight ?? presetOptions.enableRowHeight,\n enableSaveSettings: props.enableSaveSettings ?? presetOptions.enableSaveSettings,\n };\n}\n"],"names":["DEFAULT_PRESET","enableFiltering","enableSearch","enableSorting","enableColumnFreezing","enableColumnHiding","enableColumnResizing","enableRowExpansion","enableRowSelection","enableRowSelectionSingle","enableColumnOrdering","enableFontSize","enableFooter","enablePrinting","enableRowActive","enableRowActions","enableRowClick","enableRowDrag","enableRowDrop","enableRowGoto","enableRowHeight","enableSaveSettings","presets","complex","list","simple","getTableFeaturePreset","props","presetOptions","preset","_props$enableRowActio","_props$enableRowClick","_props$enableRowDrag","_props$enableRowDrop","_props$enableRowGoto","_props$enableRowExpan","_props$enableRowSelec","_props$enableRowSelec2","_props$enableFilterin","_props$enableSearch","_props$enableSorting","_props$enableColumnFr","_props$enableColumnHi","_props$enableColumnRe","rowExpansionRenderer","onRowSelect","_props$enableColumnOr","_props$enableFontSize","_props$enableFooter","_props$enablePrinting","_props$enableRowActiv","_props$rowActions","rowActions","length","onRowClick","onRowDrag","onRowDrop","onRowGoto","_props$enableRowHeigh","_props$enableSaveSett"],"mappings":"AAEA,MAAMA,cAAc,GAAsB;;EAEtCC,eAAe,EAAE,KAAK;EACtBC,YAAY,EAAE,KAAK;EACnBC,aAAa,EAAE,KAAK;EACpBC,oBAAoB,EAAE,KAAK;EAC3BC,kBAAkB,EAAE,KAAK;EACzBC,oBAAoB,EAAE,KAAK;EAC3BC,kBAAkB,EAAE,KAAK;EACzBC,kBAAkB,EAAE,KAAK;EACzBC,wBAAwB,EAAE,KAAK;;EAG/BC,oBAAoB,EAAE,KAAK;EAC3BC,cAAc,EA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ACjDrC,aAAa,EAAEA,aAAa,IAAI,CAAC,CAACS,KAAK,CAAC6B,SAAS;IACjDrC,aAAa,EAAEA,aAAa,IAAI,CAAC,CAACQ,KAAK,CAAC8B,SAAS;IACjDrC,eAAe,GAAAsC,qBAAA,GAAE/B,KAAK,CAACP,eAAe,cAAAsC,qBAAA,cAAAA,qBAAA,GAAI9B,aAAa,CAACR,eAAe;IACvEC,kBAAkB,GAAAsC,qBAAA,GAAEhC,KAAK,CAACN,kBAAkB,cAAAsC,qBAAA,cAAAA,qBAAA,GAAI/B,aAAa,CAACP;GACjE;AACL;;;;"}
@@ -35,6 +35,7 @@ function processChildren(child, columns, defaultSizing, defaultSorting, defaultV
35
35
  aggregationFn,
36
36
  defaultHidden,
37
37
  defaultWidth,
38
+ enableEditing = !!child.props.control,
38
39
  enableFiltering: enableColumnFilter = true,
39
40
  enableGrouping = false,
40
41
  enableHiding = true,
@@ -86,6 +87,7 @@ function processChildren(child, columns, defaultSizing, defaultSorting, defaultV
86
87
  enableOrdering: isGrouped ? false : enableOrdering,
87
88
  enablePrinting,
88
89
  enableTruncate,
90
+ enableEditing,
89
91
  header,
90
92
  renderer
91
93
  }
@@ -184,6 +186,9 @@ function mapTableChildrenToColumns(props, settings, options, internalColumns) {
184
186
  function configureReactTableOptions(options, props) {
185
187
  var _options$enableFilter, _options$enableColumn, _options$enableRowExp, _options$enableColumn2, _options$enableColumn3, _options$enableSortin;
186
188
  const enableRowSelection = options.enableRowSelection || options.enableRowSelectionSingle;
189
+ // We don't want to expose internal Tanstack Table row, so we need to wrap enableRowSelection callback into additional function,
190
+ // which receives the React Table Row object and passes row.original to a callback.
191
+ const reactTableEnableRowSelection = typeof enableRowSelection === 'function' ? row => enableRowSelection(row.original) : enableRowSelection;
187
192
  const tableOptions = {
188
193
  defaultColumn: {
189
194
  enableColumnFilter: options.enableFiltering || true,
@@ -202,8 +207,8 @@ function configureReactTableOptions(options, props) {
202
207
  enableGrouping: true,
203
208
  enableHiding: (_options$enableColumn2 = options.enableColumnHiding) !== null && _options$enableColumn2 !== void 0 ? _options$enableColumn2 : false,
204
209
  enablePinning: (_options$enableColumn3 = options.enableColumnFreezing) !== null && _options$enableColumn3 !== void 0 ? _options$enableColumn3 : false,
205
- enableRowSelection: enableRowSelection !== null && enableRowSelection !== void 0 ? enableRowSelection : false,
206
- enableMultiRowSelection: options.enableRowSelectionSingle === true ? false : enableRowSelection,
210
+ enableRowSelection: reactTableEnableRowSelection !== null && reactTableEnableRowSelection !== void 0 ? reactTableEnableRowSelection : false,
211
+ enableMultiRowSelection: !options.enableRowSelectionSingle && reactTableEnableRowSelection,
207
212
  enableSorting: (_options$enableSortin = options.enableSorting) !== null && _options$enableSortin !== void 0 ? _options$enableSortin : false,
208
213
  // models for default features
209
214
  getExpandedRowModel: getExpandedRowModel(),
@@ -1 +1 @@
1
- {"version":3,"file":"setup.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/util/setup.ts"],"sourcesContent":["import React from 'react';\nimport {\n createColumnHelper,\n getExpandedRowModel,\n getFilteredRowModel,\n getGroupedRowModel,\n getSortedRowModel,\n TableOptions as ReactTableOptions,\n Row as ReactTableRow,\n Column as ReactTableColumn,\n ColumnDef as ReactTableColumnDef,\n ColumnPinningState as ReactTableColumnPinningState,\n ColumnSizingState as ReactTableColumnSizingState,\n ColumnSort as ReactTableColumnSort,\n TableState as ReactTableState,\n VisibilityState as ReactTableVisibilityState,\n} from '@tanstack/react-table';\nimport get from 'lodash/get';\n\nimport { useTableManagerInternalColumns, useTableManagerInternalColumn } from '../types';\nimport { TableColumnProps, TableFeatureProps, TableGroupProps, TableProps, TableSettings } from '../../types';\nimport { getSortingFn } from './sorting';\nimport { ensureOrdering, freezeUptoExternalColumn, getCellMinWidth, unfreezeAllExternalColumns } from './columns';\nimport { columnFilterFn, globalFilterFn } from './filtering';\nimport { ignoreInternalColumns } from './settings';\n\n// mapping children to react-table columns\nfunction processChildren<TType>(\n child: React.ReactChild | React.ReactFragment | React.ReactPortal,\n columns: ReactTableColumnDef<TType>[],\n defaultSizing: ReactTableColumnSizingState,\n defaultSorting: ReactTableColumnSort[],\n defaultVisibility: ReactTableVisibilityState,\n settings: TableSettings,\n defaultRowGroupColumnId?: keyof TType\n): ReactTableColumnDef<TType>[] {\n const columnHelper = createColumnHelper<TType>();\n\n if (React.isValidElement<TableGroupProps>(child) && child.props.children) {\n const { children, id, header } = child.props;\n\n columns.push(\n columnHelper.group({\n id,\n header,\n columns: React.Children.toArray(children).reduce(\n (columns: ReactTableColumnDef<TType>[], child) =>\n processChildren<TType>(\n child,\n columns,\n defaultSizing,\n defaultSorting,\n defaultVisibility,\n settings,\n defaultRowGroupColumnId\n ),\n []\n ),\n // we don't want to let column groups be grouped/aggregrated\n enableGrouping: false,\n })\n );\n } else if (React.isValidElement<TableColumnProps<TType>>(child) && (child.props.accessor || child.props.id)) {\n const {\n id: untypedId,\n accessor: accessorKey = untypedId,\n // renderers\n renderer,\n aggregate,\n footer,\n header,\n // options\n aggregationFn,\n defaultHidden,\n defaultWidth,\n enableFiltering: enableColumnFilter = true,\n enableGrouping = false,\n enableHiding = true,\n enableOrdering = true,\n enablePrinting = true,\n enableResizing = true,\n enableSearch: enableGlobalFilter = true,\n enableSorting = true,\n enableTruncate = false,\n minWidth: minSize = getCellMinWidth(settings.fontSize),\n sort,\n sortFn,\n ...meta\n } = child.props;\n const id = untypedId as string;\n\n if (defaultHidden && enableHiding) {\n defaultVisibility[id] = false;\n }\n\n if (defaultWidth) {\n defaultSizing[id] = defaultWidth as any;\n }\n\n const isGrouped = defaultRowGroupColumnId === id;\n\n if (child.props.sort !== undefined || isGrouped) {\n defaultSorting.push({\n id,\n desc: sort === 'desc',\n });\n }\n\n const column: ReactTableColumnDef<TType, any> = {\n id,\n accessorKey,\n // To avoid errors caused by undefined row data values, we pass accessorFn as a preventive measure\n // accessorKey can be dot notated strings, so we use lodash.get to access deeply nested children\n accessorFn: row => get(row, accessorKey),\n header: header,\n // features\n enableColumnFilter,\n enableGlobalFilter,\n enableGrouping,\n enableHiding: isGrouped ? false : enableHiding,\n enableResizing,\n enableSorting,\n // config - sizing\n minSize,\n // meta\n meta: {\n ...(meta as any),\n defaultWidth,\n enableOrdering: isGrouped ? false : enableOrdering,\n enablePrinting,\n enableTruncate,\n header,\n renderer,\n },\n };\n\n // renderers\n if (typeof renderer === 'function') {\n column.cell = info => renderer(info.getValue(), info.row.original);\n }\n\n if (typeof footer === 'function') {\n column.footer = info =>\n footer(info.table.getRowModel().rows.flatMap(row => (row.original !== undefined ? row.original : [])));\n }\n\n // config - filtering\n if (enableColumnFilter) {\n column.filterFn = 'tacoFilter' as any;\n }\n\n // config - grouping/aggregation\n if (enableGrouping) {\n column.aggregationFn = aggregationFn;\n\n if (typeof aggregate === 'function') {\n column.aggregatedCell = info => aggregate(info.getValue(), info.row.original);\n }\n }\n\n // config - sorting\n if (enableSorting) {\n column.sortingFn = getSortingFn<TType>(child.props.dataType, sortFn);\n column.sortDescFirst = false;\n column.sortUndefined = 1;\n }\n\n columns.push(column);\n }\n\n return columns;\n}\n\nfunction createInternalColumn<TType = unknown>(\n id: string,\n column: useTableManagerInternalColumn<TType>,\n defaultSizing: ReactTableColumnSizingState\n) {\n if (column.size) {\n defaultSizing[id] = column.size;\n }\n\n return {\n id,\n accessorKey: id,\n header: column.header,\n cell: column.renderer,\n // features\n enableColumnFilter: false,\n enableGlobalFilter: false,\n enableGrouping: false,\n enableHiding: false,\n enableResizing: false,\n enableSorting: false,\n // config - sizing\n size: column.size,\n minSize: column.size,\n // meta\n meta: {\n ...(column.meta as any),\n enableOrdering: false,\n enablePrinting: false,\n enableTruncate: false,\n },\n } as ReactTableColumnDef<TType, any>;\n}\n\nexport function mapTableChildrenToColumns<TType = unknown>(\n props: TableProps<TType>,\n settings: TableSettings,\n options: TableFeatureProps<TType>,\n internalColumns?: useTableManagerInternalColumns<TType>\n) {\n const { children, defaultRowGroupColumnId } = props;\n const defaultSizing: ReactTableColumnSizingState = {};\n const defaultSorting: ReactTableColumnSort[] = [];\n const defaultVisibility: ReactTableVisibilityState = {};\n\n const columns = React.Children.toArray(children).reduce(\n (columns: ReactTableColumnDef<TType>[], child) =>\n processChildren<TType>(\n child,\n columns,\n defaultSizing,\n defaultSorting,\n defaultVisibility,\n settings,\n defaultRowGroupColumnId\n ),\n\n []\n );\n\n if (internalColumns) {\n if (options.enableRowExpansion && props.rowExpansionRenderer && internalColumns.rowExpansion) {\n const column = createInternalColumn<TType>('__expansion', internalColumns.rowExpansion, defaultSizing);\n columns.unshift(column);\n }\n\n if ((options.enableRowSelection || options.enableRowSelectionSingle) && internalColumns.rowSelection) {\n const column = createInternalColumn<TType>('__select', internalColumns.rowSelection, defaultSizing);\n columns.unshift(column);\n }\n\n if (options.enableRowDrag && props.onRowDrag && internalColumns.rowDrag) {\n const column = createInternalColumn<TType>('__drag', internalColumns.rowDrag, defaultSizing);\n columns.unshift(column);\n }\n\n if (options.enableRowActions && props.rowActions?.length && internalColumns.rowActions) {\n const column = createInternalColumn<TType>('__actions', internalColumns.rowActions, defaultSizing);\n columns.push(column);\n }\n }\n\n return { columns, defaultSizing, defaultSorting, defaultVisibility };\n}\n\nexport function configureReactTableOptions<TType = unknown>(options: TableFeatureProps<TType>, props: TableProps<TType>) {\n const enableRowSelection = options.enableRowSelection || options.enableRowSelectionSingle;\n const tableOptions: Partial<ReactTableOptions<TType>> = {\n defaultColumn: {\n enableColumnFilter: options.enableFiltering || true,\n enableGrouping: false,\n enableHiding: options.enableColumnHiding || true,\n enableResizing: options.enableColumnResizing || true,\n enableGlobalFilter: options.enableSearch || true,\n enableSorting: options.enableSorting || true,\n minSize: 1,\n // the default is 150, which is a bit random\n size: 1,\n },\n enableColumnFilters: options.enableFiltering ?? false,\n enableColumnResizing: options.enableColumnResizing ?? false,\n enableExpanding: options.enableRowExpansion ?? false,\n enableGrouping: true, // users can't customise row grouping, so it can just be always enabled and left to the defaultRowGroupColumnId prop\n enableHiding: options.enableColumnHiding ?? false,\n enablePinning: options.enableColumnFreezing ?? false,\n enableRowSelection: enableRowSelection ?? false,\n enableMultiRowSelection: options.enableRowSelectionSingle === true ? false : enableRowSelection,\n enableSorting: options.enableSorting ?? false,\n // models for default features\n getExpandedRowModel: getExpandedRowModel<TType>(),\n getGroupedRowModel: getGroupedRowModel<TType>(),\n groupedColumnMode: false,\n };\n\n if (tableOptions.enableColumnResizing) {\n tableOptions.columnResizeMode = 'onChange';\n }\n\n if (tableOptions.enableColumnFilters) {\n // enter controlled filter mode (controlled could be local state, but usually the server)\n if (props.onChangeFilter) {\n // tableOptions.manualFiltering = true;\n // we don't set it because it breaks global filtering (used for search, which is fully client side)\n //\n // tableOptions.onColumnFiltersChange = ...\n // we don't set this because it expects state to be maintained externally, and we don't want\n // consumers to control state outside the table. instead we have a listener that calls onFilter\n } else {\n tableOptions.getFilteredRowModel = getFilteredRowModel<TType>();\n tableOptions.filterFns = {\n tacoFilter: (row: ReactTableRow<TType>, columnId: string, filter: any) =>\n columnFilterFn(row.getValue(columnId), filter),\n };\n }\n }\n\n if (options.enableSearch) {\n // always set these because enableGlobalFilter can be toggled on and off by the user\n tableOptions.getFilteredRowModel = getFilteredRowModel<TType>();\n tableOptions.globalFilterFn = globalFilterFn;\n tableOptions.getColumnCanGlobalFilter = (column: ReactTableColumn<TType>) => column.columnDef.meta?.enableSearch ?? true;\n\n // enter controlled search mode (controlled could be local state, but usually the server)\n if (props.onChangeSearch) {\n // tableOptions.manualFiltering = true;\n // we don't set this because controlled search is not currently supported, search is always client side\n //\n // tableOptions.onGlobalFilterChange = ...\n // we don't set this because it expects state to be maintained externally, and we don't want\n // consumers to control state outside the table. instead we have a listener that calls onSearch.\n //\n // we also don't always filter when searching, we have the highlight functionality as the default\n // and filtering can be toggled by the user\n }\n }\n\n if (tableOptions.enableSorting) {\n // enter controlled sort mode (controlled could be local state, but usually the server)\n if (props.onChangeSort) {\n tableOptions.manualSorting = true;\n\n // tableOptions.onSortingChange = ...\n // we don't set this because it expects state to be maintained externally, and we don't want\n // consumers to control state outside the table. instead we have a listener that calls onSort\n } else {\n tableOptions.getSortedRowModel = getSortedRowModel();\n }\n }\n\n return tableOptions;\n}\n\nexport function useReactTableInitialState<TType = unknown>(\n props: TableProps<TType>,\n columns: ReactTableColumnDef<TType>[],\n persistedSettings: TableSettings,\n defaults: {\n defaultSizing: ReactTableColumnSizingState;\n defaultSorting: ReactTableColumnSort[];\n defaultVisibility: ReactTableVisibilityState;\n }\n): Partial<ReactTableState> {\n return React.useMemo(() => {\n const ignoreNotDefinedColumns = column => columns.find(definedColumn => definedColumn.id === column.id);\n\n const columnPinning: ReactTableColumnPinningState =\n persistedSettings.columnPinning ?? props.defaultSettings?.columnPinning ?? {};\n\n const columnOrder = ensureOrdering<TType>(\n columns,\n persistedSettings.columnOrder ?? props.defaultSettings?.columnOrder,\n columnPinning.left\n );\n\n // ensure internal columns are pinned, and are pinned in the correct order\n if (columnPinning?.left?.length) {\n columnPinning.left = freezeUptoExternalColumn(\n columnOrder.indexOf(columnPinning.left[columnPinning.left.length - 1]),\n columnOrder\n );\n } else {\n if (props.defaultColumnFreezingIndex) {\n columnPinning.left = freezeUptoExternalColumn(props.defaultColumnFreezingIndex, columnOrder);\n } else {\n columnPinning.left = unfreezeAllExternalColumns(columnOrder);\n }\n }\n\n const state: Partial<ReactTableState> = {\n columnFilters: persistedSettings.columnFilters ?? props.defaultSettings?.columnFilters ?? [],\n columnOrder,\n columnPinning,\n columnSizing: ignoreInternalColumns(\n persistedSettings.columnSizing ?? props.defaultSettings?.columnSizing ?? defaults.defaultSizing ?? {}\n ),\n columnVisibility:\n persistedSettings.columnVisibility ?? props.defaultSettings?.columnVisibility ?? defaults.defaultVisibility ?? {},\n globalFilter: persistedSettings.searchQuery ?? props.defaultSettings?.searchQuery,\n sorting: persistedSettings.sorting\n ? persistedSettings.sorting.filter(ignoreNotDefinedColumns)\n : props.defaultSettings?.sorting ?? defaults.defaultSorting,\n };\n\n if (props.defaultRowGroupColumnId) {\n state.grouping = [props.defaultRowGroupColumnId as string];\n // row groups should (all) always be expanded by default\n state.expanded = true;\n }\n\n return state;\n }, []);\n}\n"],"names":["processChildren","child","columns","defaultSizing","defaultSorting","defaultVisibility","settings","defaultRowGroupColumnId","columnHelper","createColumnHelper","React","isValidElement","props","children","id","header","push","group","Children","toArray","reduce","enableGrouping","accessor","untypedId","accessorKey","renderer","aggregate","footer","aggregationFn","defaultHidden","defaultWidth","enableFiltering","enableColumnFilter","enableHiding","enableOrdering","enablePrinting","enableResizing","enableSearch","enableGlobalFilter","enableSorting","enableTruncate","minWidth","minSize","getCellMinWidth","fontSize","sort","sortFn","meta","isGrouped","undefined","desc","column","accessorFn","row","get","cell","info","getValue","original","table","getRowModel","rows","flatMap","filterFn","aggregatedCell","sortingFn","getSortingFn","dataType","sortDescFirst","sortUndefined","createInternalColumn","size","mapTableChildrenToColumns","options","internalColumns","_props$rowActions","enableRowExpansion","rowExpansionRenderer","rowExpansion","unshift","enableRowSelection","enableRowSelectionSingle","rowSelection","enableRowDrag","onRowDrag","rowDrag","enableRowActions","rowActions","length","configureReactTableOptions","tableOptions","defaultColumn","enableColumnHiding","enableColumnResizing","enableColumnFilters","_options$enableFilter","_options$enableColumn","enableExpanding","_options$enableRowExp","_options$enableColumn2","enablePinning","_options$enableColumn3","enableColumnFreezing","enableMultiRowSelection","_options$enableSortin","getExpandedRowModel","getGroupedRowModel","groupedColumnMode","columnResizeMode","onChangeFilter","getFilteredRowModel","filterFns","tacoFilter","columnId","filter","columnFilterFn","globalFilterFn","getColumnCanGlobalFilter","_column$columnDef$met","_column$columnDef$met2","columnDef","onChangeSort","manualSorting","getSortedRowModel","useReactTableInitialState","persistedSettings","defaults","useMemo","ignoreNotDefinedColumns","find","definedColumn","columnPinning","_ref","_persistedSettings$co","_props$defaultSetting","defaultSettings","columnOrder","ensureOrdering","_persistedSettings$co2","_props$defaultSetting2","left","_columnPinning$left","freezeUptoExternalColumn","indexOf","defaultColumnFreezingIndex","unfreezeAllExternalColumns","state","columnFilters","_ref2","_persistedSettings$co3","_props$defaultSetting3","columnSizing","ignoreInternalColumns","_ref3","_ref4","_persistedSettings$co4","_props$defaultSetting4","columnVisibility","_ref5","_ref6","_persistedSettings$co5","_props$defaultSetting5","globalFilter","_persistedSettings$se","searchQuery","_props$defaultSetting6","sorting","_props$defaultSetting7","_props$defaultSetting8","grouping","expanded"],"mappings":";;;;;;;;AA0BA;AACA,SAASA,eAAeA,CACpBC,KAAiE,EACjEC,OAAqC,EACrCC,aAA0C,EAC1CC,cAAsC,EACtCC,iBAA4C,EAC5CC,QAAuB,EACvBC,uBAAqC;EAErC,MAAMC,YAAY,GAAGC,kBAAkB,EAAS;EAEhD,iBAAIC,cAAK,CAACC,cAAc,CAAkBV,KAAK,CAAC,IAAIA,KAAK,CAACW,KAAK,CAACC,QAAQ,EAAE;IACtE,MAAM;MAAEA,QAAQ;MAAEC,EAAE;MAAEC;KAAQ,GAAGd,KAAK,CAACW,KAAK;IAE5CV,OAAO,CAACc,IAAI,CACRR,YAAY,CAACS,KAAK,CAAC;MACfH,EAAE;MACFC,MAAM;MACNb,OAAO,EAAEQ,cAAK,CAACQ,QAAQ,CAACC,OAAO,CAACN,QAAQ,CAAC,CAACO,MAAM,CAC5C,CAAClB,OAAqC,EAAED,KAAK,KACzCD,eAAe,CACXC,KAAK,EACLC,OAAO,EACPC,aAAa,EACbC,cAAc,EACdC,iBAAiB,EACjBC,QAAQ,EACRC,uBAAuB,CAC1B,EACL,EAAE,CACL;;MAEDc,cAAc,EAAE;KACnB,CAAC,CACL;GACJ,MAAM,iBAAIX,cAAK,CAACC,cAAc,CAA0BV,KAAK,CAAC,KAAKA,KAAK,CAACW,KAAK,CAACU,QAAQ,IAAIrB,KAAK,CAACW,KAAK,CAACE,EAAE,CAAC,EAAE;IACzG,MAAM;MACFA,EAAE,EAAES,SAAS;MACbD,QAAQ,EAAEE,WAAW,GAAGD,SAAS;;MAEjCE,QAAQ;MACRC,SAAS;MACTC,MAAM;MACNZ,MAAM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C;;MAE1D2I,KAAK,CAACwB,QAAQ,GAAG,IAAI;;IAGzB,OAAOxB,KAAK;GACf,EAAE,EAAE,CAAC;AACV;;;;"}
1
+ {"version":3,"file":"setup.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/util/setup.ts"],"sourcesContent":["import React from 'react';\nimport {\n createColumnHelper,\n getExpandedRowModel,\n getFilteredRowModel,\n getGroupedRowModel,\n getSortedRowModel,\n TableOptions as ReactTableOptions,\n Row as ReactTableRow,\n Column as ReactTableColumn,\n ColumnDef as ReactTableColumnDef,\n ColumnPinningState as ReactTableColumnPinningState,\n ColumnSizingState as ReactTableColumnSizingState,\n ColumnSort as ReactTableColumnSort,\n TableState as ReactTableState,\n VisibilityState as ReactTableVisibilityState,\n} from '@tanstack/react-table';\nimport get from 'lodash/get';\n\nimport { useTableManagerInternalColumns, useTableManagerInternalColumn } from '../types';\nimport { TableColumnProps, TableFeatureProps, TableGroupProps, TableProps, TableSettings } from '../../types';\nimport { getSortingFn } from './sorting';\nimport { ensureOrdering, freezeUptoExternalColumn, getCellMinWidth, unfreezeAllExternalColumns } from './columns';\nimport { columnFilterFn, globalFilterFn } from './filtering';\nimport { ignoreInternalColumns } from './settings';\n\n// mapping children to react-table columns\nfunction processChildren<TType>(\n child: React.ReactChild | React.ReactFragment | React.ReactPortal,\n columns: ReactTableColumnDef<TType>[],\n defaultSizing: ReactTableColumnSizingState,\n defaultSorting: ReactTableColumnSort[],\n defaultVisibility: ReactTableVisibilityState,\n settings: TableSettings,\n defaultRowGroupColumnId?: keyof TType\n): ReactTableColumnDef<TType>[] {\n const columnHelper = createColumnHelper<TType>();\n\n if (React.isValidElement<TableGroupProps>(child) && child.props.children) {\n const { children, id, header } = child.props;\n\n columns.push(\n columnHelper.group({\n id,\n header,\n columns: React.Children.toArray(children).reduce(\n (columns: ReactTableColumnDef<TType>[], child) =>\n processChildren<TType>(\n child,\n columns,\n defaultSizing,\n defaultSorting,\n defaultVisibility,\n settings,\n defaultRowGroupColumnId\n ),\n []\n ),\n // we don't want to let column groups be grouped/aggregrated\n enableGrouping: false,\n })\n );\n } else if (React.isValidElement<TableColumnProps<TType>>(child) && (child.props.accessor || child.props.id)) {\n const {\n id: untypedId,\n accessor: accessorKey = untypedId,\n // renderers\n renderer,\n aggregate,\n footer,\n header,\n // options\n aggregationFn,\n defaultHidden,\n defaultWidth,\n enableEditing = !!child.props.control,\n enableFiltering: enableColumnFilter = true,\n enableGrouping = false,\n enableHiding = true,\n enableOrdering = true,\n enablePrinting = true,\n enableResizing = true,\n enableSearch: enableGlobalFilter = true,\n enableSorting = true,\n enableTruncate = false,\n minWidth: minSize = getCellMinWidth(settings.fontSize),\n sort,\n sortFn,\n ...meta\n } = child.props;\n const id = untypedId as string;\n\n if (defaultHidden && enableHiding) {\n defaultVisibility[id] = false;\n }\n\n if (defaultWidth) {\n defaultSizing[id] = defaultWidth as any;\n }\n\n const isGrouped = defaultRowGroupColumnId === id;\n\n if (child.props.sort !== undefined || isGrouped) {\n defaultSorting.push({\n id,\n desc: sort === 'desc',\n });\n }\n\n const column: ReactTableColumnDef<TType, any> = {\n id,\n accessorKey,\n // To avoid errors caused by undefined row data values, we pass accessorFn as a preventive measure\n // accessorKey can be dot notated strings, so we use lodash.get to access deeply nested children\n accessorFn: row => get(row, accessorKey),\n header: header,\n // features\n enableColumnFilter,\n enableGlobalFilter,\n enableGrouping,\n enableHiding: isGrouped ? false : enableHiding,\n enableResizing,\n enableSorting,\n // config - sizing\n minSize,\n // meta\n meta: {\n ...(meta as any),\n defaultWidth,\n enableOrdering: isGrouped ? false : enableOrdering,\n enablePrinting,\n enableTruncate,\n enableEditing,\n header,\n renderer,\n },\n };\n\n // renderers\n if (typeof renderer === 'function') {\n column.cell = info => renderer(info.getValue(), info.row.original);\n }\n\n if (typeof footer === 'function') {\n column.footer = info =>\n footer(info.table.getRowModel().rows.flatMap(row => (row.original !== undefined ? row.original : [])));\n }\n\n // config - filtering\n if (enableColumnFilter) {\n column.filterFn = 'tacoFilter' as any;\n }\n\n // config - grouping/aggregation\n if (enableGrouping) {\n column.aggregationFn = aggregationFn;\n\n if (typeof aggregate === 'function') {\n column.aggregatedCell = info => aggregate(info.getValue(), info.row.original);\n }\n }\n\n // config - sorting\n if (enableSorting) {\n column.sortingFn = getSortingFn<TType>(child.props.dataType, sortFn);\n column.sortDescFirst = false;\n column.sortUndefined = 1;\n }\n\n columns.push(column);\n }\n\n return columns;\n}\n\nfunction createInternalColumn<TType = unknown>(\n id: string,\n column: useTableManagerInternalColumn<TType>,\n defaultSizing: ReactTableColumnSizingState\n) {\n if (column.size) {\n defaultSizing[id] = column.size;\n }\n\n return {\n id,\n accessorKey: id,\n header: column.header,\n cell: column.renderer,\n // features\n enableColumnFilter: false,\n enableGlobalFilter: false,\n enableGrouping: false,\n enableHiding: false,\n enableResizing: false,\n enableSorting: false,\n // config - sizing\n size: column.size,\n minSize: column.size,\n // meta\n meta: {\n ...(column.meta as any),\n enableOrdering: false,\n enablePrinting: false,\n enableTruncate: false,\n },\n } as ReactTableColumnDef<TType, any>;\n}\n\nexport function mapTableChildrenToColumns<TType = unknown>(\n props: TableProps<TType>,\n settings: TableSettings,\n options: TableFeatureProps<TType>,\n internalColumns?: useTableManagerInternalColumns<TType>\n) {\n const { children, defaultRowGroupColumnId } = props;\n const defaultSizing: ReactTableColumnSizingState = {};\n const defaultSorting: ReactTableColumnSort[] = [];\n const defaultVisibility: ReactTableVisibilityState = {};\n\n const columns = React.Children.toArray(children).reduce(\n (columns: ReactTableColumnDef<TType>[], child) =>\n processChildren<TType>(\n child,\n columns,\n defaultSizing,\n defaultSorting,\n defaultVisibility,\n settings,\n defaultRowGroupColumnId\n ),\n\n []\n );\n\n if (internalColumns) {\n if (options.enableRowExpansion && props.rowExpansionRenderer && internalColumns.rowExpansion) {\n const column = createInternalColumn<TType>('__expansion', internalColumns.rowExpansion, defaultSizing);\n columns.unshift(column);\n }\n\n if ((options.enableRowSelection || options.enableRowSelectionSingle) && internalColumns.rowSelection) {\n const column = createInternalColumn<TType>('__select', internalColumns.rowSelection, defaultSizing);\n columns.unshift(column);\n }\n\n if (options.enableRowDrag && props.onRowDrag && internalColumns.rowDrag) {\n const column = createInternalColumn<TType>('__drag', internalColumns.rowDrag, defaultSizing);\n columns.unshift(column);\n }\n\n if (options.enableRowActions && props.rowActions?.length && internalColumns.rowActions) {\n const column = createInternalColumn<TType>('__actions', internalColumns.rowActions, defaultSizing);\n columns.push(column);\n }\n }\n\n return { columns, defaultSizing, defaultSorting, defaultVisibility };\n}\n\nexport function configureReactTableOptions<TType = unknown>(options: TableFeatureProps<TType>, props: TableProps<TType>) {\n const enableRowSelection = options.enableRowSelection || options.enableRowSelectionSingle;\n // We don't want to expose internal Tanstack Table row, so we need to wrap enableRowSelection callback into additional function,\n // which receives the React Table Row object and passes row.original to a callback.\n const reactTableEnableRowSelection =\n typeof enableRowSelection === 'function'\n ? (row: ReactTableRow<TType>) => (enableRowSelection as (row: TType) => boolean)(row.original)\n : enableRowSelection;\n\n const tableOptions: Partial<ReactTableOptions<TType>> = {\n defaultColumn: {\n enableColumnFilter: options.enableFiltering || true,\n enableGrouping: false,\n enableHiding: options.enableColumnHiding || true,\n enableResizing: options.enableColumnResizing || true,\n enableGlobalFilter: options.enableSearch || true,\n enableSorting: options.enableSorting || true,\n minSize: 1,\n // the default is 150, which is a bit random\n size: 1,\n },\n enableColumnFilters: options.enableFiltering ?? false,\n enableColumnResizing: options.enableColumnResizing ?? false,\n enableExpanding: options.enableRowExpansion ?? false,\n enableGrouping: true, // users can't customise row grouping, so it can just be always enabled and left to the defaultRowGroupColumnId prop\n enableHiding: options.enableColumnHiding ?? false,\n enablePinning: options.enableColumnFreezing ?? false,\n enableRowSelection: reactTableEnableRowSelection ?? false,\n enableMultiRowSelection: !options.enableRowSelectionSingle && reactTableEnableRowSelection,\n enableSorting: options.enableSorting ?? false,\n // models for default features\n getExpandedRowModel: getExpandedRowModel<TType>(),\n getGroupedRowModel: getGroupedRowModel<TType>(),\n groupedColumnMode: false,\n };\n\n if (tableOptions.enableColumnResizing) {\n tableOptions.columnResizeMode = 'onChange';\n }\n\n if (tableOptions.enableColumnFilters) {\n // enter controlled filter mode (controlled could be local state, but usually the server)\n if (props.onChangeFilter) {\n // tableOptions.manualFiltering = true;\n // we don't set it because it breaks global filtering (used for search, which is fully client side)\n //\n // tableOptions.onColumnFiltersChange = ...\n // we don't set this because it expects state to be maintained externally, and we don't want\n // consumers to control state outside the table. instead we have a listener that calls onFilter\n } else {\n tableOptions.getFilteredRowModel = getFilteredRowModel<TType>();\n tableOptions.filterFns = {\n tacoFilter: (row: ReactTableRow<TType>, columnId: string, filter: any) =>\n columnFilterFn(row.getValue(columnId), filter),\n };\n }\n }\n\n if (options.enableSearch) {\n // always set these because enableGlobalFilter can be toggled on and off by the user\n tableOptions.getFilteredRowModel = getFilteredRowModel<TType>();\n tableOptions.globalFilterFn = globalFilterFn;\n tableOptions.getColumnCanGlobalFilter = (column: ReactTableColumn<TType>) => column.columnDef.meta?.enableSearch ?? true;\n\n // enter controlled search mode (controlled could be local state, but usually the server)\n if (props.onChangeSearch) {\n // tableOptions.manualFiltering = true;\n // we don't set this because controlled search is not currently supported, search is always client side\n //\n // tableOptions.onGlobalFilterChange = ...\n // we don't set this because it expects state to be maintained externally, and we don't want\n // consumers to control state outside the table. instead we have a listener that calls onSearch.\n //\n // we also don't always filter when searching, we have the highlight functionality as the default\n // and filtering can be toggled by the user\n }\n }\n\n if (tableOptions.enableSorting) {\n // enter controlled sort mode (controlled could be local state, but usually the server)\n if (props.onChangeSort) {\n tableOptions.manualSorting = true;\n\n // tableOptions.onSortingChange = ...\n // we don't set this because it expects state to be maintained externally, and we don't want\n // consumers to control state outside the table. instead we have a listener that calls onSort\n } else {\n tableOptions.getSortedRowModel = getSortedRowModel();\n }\n }\n\n return tableOptions;\n}\n\nexport function useReactTableInitialState<TType = unknown>(\n props: TableProps<TType>,\n columns: ReactTableColumnDef<TType>[],\n persistedSettings: TableSettings,\n defaults: {\n defaultSizing: ReactTableColumnSizingState;\n defaultSorting: ReactTableColumnSort[];\n defaultVisibility: ReactTableVisibilityState;\n }\n): Partial<ReactTableState> {\n return React.useMemo(() => {\n const ignoreNotDefinedColumns = column => columns.find(definedColumn => definedColumn.id === column.id);\n\n const columnPinning: ReactTableColumnPinningState =\n persistedSettings.columnPinning ?? props.defaultSettings?.columnPinning ?? {};\n\n const columnOrder = ensureOrdering<TType>(\n columns,\n persistedSettings.columnOrder ?? props.defaultSettings?.columnOrder,\n columnPinning.left\n );\n\n // ensure internal columns are pinned, and are pinned in the correct order\n if (columnPinning?.left?.length) {\n columnPinning.left = freezeUptoExternalColumn(\n columnOrder.indexOf(columnPinning.left[columnPinning.left.length - 1]),\n columnOrder\n );\n } else {\n if (props.defaultColumnFreezingIndex) {\n columnPinning.left = freezeUptoExternalColumn(props.defaultColumnFreezingIndex, columnOrder);\n } else {\n columnPinning.left = unfreezeAllExternalColumns(columnOrder);\n }\n }\n\n const state: Partial<ReactTableState> = {\n columnFilters: persistedSettings.columnFilters ?? props.defaultSettings?.columnFilters ?? [],\n columnOrder,\n columnPinning,\n columnSizing: ignoreInternalColumns(\n persistedSettings.columnSizing ?? props.defaultSettings?.columnSizing ?? defaults.defaultSizing ?? {}\n ),\n columnVisibility:\n persistedSettings.columnVisibility ?? props.defaultSettings?.columnVisibility ?? defaults.defaultVisibility ?? {},\n globalFilter: persistedSettings.searchQuery ?? props.defaultSettings?.searchQuery,\n sorting: persistedSettings.sorting\n ? persistedSettings.sorting.filter(ignoreNotDefinedColumns)\n : props.defaultSettings?.sorting ?? defaults.defaultSorting,\n };\n\n if (props.defaultRowGroupColumnId) {\n state.grouping = [props.defaultRowGroupColumnId as string];\n // row groups should (all) always be expanded by default\n state.expanded = true;\n }\n\n return state;\n }, []);\n}\n"],"names":["processChildren","child","columns","defaultSizing","defaultSorting","defaultVisibility","settings","defaultRowGroupColumnId","columnHelper","createColumnHelper","React","isValidElement","props","children","id","header","push","group","Children","toArray","reduce","enableGrouping","accessor","untypedId","accessorKey","renderer","aggregate","footer","aggregationFn","defaultHidden","defaultWidth","enableEditing","control","enableFiltering","enableColumnFilter","enableHiding","enableOrdering","enablePrinting","enableResizing","enableSearch","enableGlobalFilter","enableSorting","enableTruncate","minWidth","minSize","getCellMinWidth","fontSize","sort","sortFn","meta","isGrouped","undefined","desc","column","accessorFn","row","get","cell","info","getValue","original","table","getRowModel","rows","flatMap","filterFn","aggregatedCell","sortingFn","getSortingFn","dataType","sortDescFirst","sortUndefined","createInternalColumn","size","mapTableChildrenToColumns","options","internalColumns","_props$rowActions","enableRowExpansion","rowExpansionRenderer","rowExpansion","unshift","enableRowSelection","enableRowSelectionSingle","rowSelection","enableRowDrag","onRowDrag","rowDrag","enableRowActions","rowActions","length","configureReactTableOptions","reactTableEnableRowSelection","tableOptions","defaultColumn","enableColumnHiding","enableColumnResizing","enableColumnFilters","_options$enableFilter","_options$enableColumn","enableExpanding","_options$enableRowExp","_options$enableColumn2","enablePinning","_options$enableColumn3","enableColumnFreezing","enableMultiRowSelection","_options$enableSortin","getExpandedRowModel","getGroupedRowModel","groupedColumnMode","columnResizeMode","onChangeFilter","getFilteredRowModel","filterFns","tacoFilter","columnId","filter","columnFilterFn","globalFilterFn","getColumnCanGlobalFilter","_column$columnDef$met","_column$columnDef$met2","columnDef","onChangeSort","manualSorting","getSortedRowModel","useReactTableInitialState","persistedSettings","defaults","useMemo","ignoreNotDefinedColumns","find","definedColumn","columnPinning","_ref","_persistedSettings$co","_props$defaultSetting","defaultSettings","columnOrder","ensureOrdering","_persistedSettings$co2","_props$defaultSetting2","left","_columnPinning$left","freezeUptoExternalColumn","indexOf","defaultColumnFreezingIndex","unfreezeAllExternalColumns","state","columnFilters","_ref2","_persistedSettings$co3","_props$defaultSetting3","columnSizing","ignoreInternalColumns","_ref3","_ref4","_persistedSettings$co4","_props$defaultSetting4","columnVisibility","_ref5","_ref6","_persistedSettings$co5","_props$defaultSetting5","globalFilter","_persistedSettings$se","searchQuery","_props$defaultSetting6","sorting","_props$defaultSetting7","_props$defaultSetting8","grouping","expanded"],"mappings":";;;;;;;;AA0BA;AACA,SAASA,eAAeA,CACpBC,KAAiE,EACjEC,OAAqC,EACrCC,aAA0C,EAC1CC,cAAsC,EACtCC,iBAA4C,EAC5CC,QAAuB,EACvBC,uBAAqC;EAErC,MAAMC,YAAY,GAAGC,kBAAkB,EAAS;EAEhD,iBAAIC,cAAK,CAACC,cAAc,CAAkBV,KAAK,CAAC,IAAIA,KAAK,CAACW,KAAK,CAACC,QAAQ,EAAE;IACtE,MAAM;MAAEA,QAAQ;MAAEC,EAAE;MAAEC;KAAQ,GAAGd,KAAK,CAACW,KAAK;IAE5CV,OAAO,CAACc,IAAI,CACRR,YAAY,CAACS,KAAK,CAAC;MACfH,EAAE;MACFC,MAAM;MACNb,OAAO,EAAEQ,cAAK,CAACQ,QAAQ,CAACC,OAAO,CAACN,QAAQ,CAAC,CAACO,MAAM,CAC5C,CAAClB,OAAqC,EAAED,KAAK,KACzCD,eAAe,CACXC,KAAK,EACLC,OAAO,EACPC,aAAa,EACbC,cAAc,EACdC,iBAAiB,EACjBC,QAAQ,EACRC,uBAAuB,CAC1B,EACL,EAAE,CACL;;MAEDc,cAAc,EAAE;KACnB,CAAC,CACL;GACJ,MAAM,iBAAIX,cAAK,CAACC,cAAc,CAA0BV,KAAK,CAAC,KAAKA,KAAK,CAACW,KAAK,CAACU,QAAQ,IAAIrB,KAAK,CAACW,KAAK,CAACE,EAAE,CAAC,EAAE;IACzG,MAAM;MACFA,EAAE,EAAES,SAAS;MACbD,QAAQ,EAAEE,WAAW,GAAGD,SAAS;;MAEjCE,QAAQ;MACRC,SAAS;MACTC,MAAM;MACNZ,MAAM;;MAENa,aAAa;MACbC,aAAa;MACbC,YAAY;MACZC,aAAa,GAAG,CAAC,CAAC9B,KAAK,CAACW,KAAK,CAACoB,OAAO;MACrCC,eAAe,EAAEC,kBAAkB,GAAG,IAAI;MAC1Cb,cAAc,GAAG,K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AG,CAAChK,KAAK,CAACL,uBAAiC,CAAC;;MAE1D8I,KAAK,CAACwB,QAAQ,GAAG,IAAI;;IAGzB,OAAOxB,KAAK;GACf,EAAE,EAAE,CAAC;AACV;;;;"}
package/dist/index.css CHANGED
@@ -591,7 +591,7 @@ table[data-taco^='table'] thead tr:not(:last-child) th:before {
591
591
 
592
592
  table[data-taco^='table'] tfoot {
593
593
  /* z-indexes & layout */
594
- @apply sticky bottom-0 isolate z-20;
594
+ @apply sticky bottom-0 isolate z-20 print:!static;
595
595
  /* grid */
596
596
  @apply col-span-full grid grid-cols-[subgrid];
597
597
  }
@@ -665,7 +665,7 @@ table[data-taco^='table'] th {
665
665
  }
666
666
 
667
667
  table[data-taco^='table'] th:not([data-cell-placeholder='true']):hover {
668
- @apply bg-grey-100;
668
+ @apply bg-grey-100 print:bg-white;
669
669
  }
670
670
 
671
671
  table[data-taco^='table'] th[aria-sort]:hover {
@@ -125,6 +125,7 @@ export declare type TableEnableSettingsOptions = {
125
125
  rowHeight: boolean;
126
126
  sorting: boolean;
127
127
  };
128
+ export declare type TableConditionalRowProp<TType = unknown> = boolean | ((row: TType) => boolean);
128
129
  export declare type TableFeatureProps<TType = unknown> = {
129
130
  enableFiltering?: boolean;
130
131
  enableSearch?: boolean;
@@ -133,23 +134,24 @@ export declare type TableFeatureProps<TType = unknown> = {
133
134
  enableColumnHiding?: boolean;
134
135
  enableColumnResizing?: boolean;
135
136
  enableRowExpansion?: boolean;
136
- enableRowSelection?: boolean;
137
- enableRowSelectionSingle?: boolean;
137
+ enableRowSelection?: TableConditionalRowProp<TType>;
138
+ enableRowSelectionSingle?: TableConditionalRowProp<TType>;
138
139
  enableColumnOrdering?: boolean;
139
140
  enableFontSize?: boolean;
140
141
  enableFooter?: boolean;
141
142
  enablePrinting?: boolean;
142
143
  enableRowActions?: boolean;
143
144
  enableRowActive?: boolean;
144
- enableRowClick?: boolean | ((row: TType) => boolean);
145
+ enableRowClick?: TableConditionalRowProp<TType>;
145
146
  enableRowDrag?: boolean;
146
147
  enableRowDrop?: boolean;
147
148
  enableRowGoto?: boolean;
148
149
  enableRowHeight?: boolean;
149
150
  enableSaveSettings?: boolean | Partial<TableEnableSettingsOptions>;
150
151
  };
152
+ export declare type TableChild = JSX.Element | boolean | null | undefined;
151
153
  export declare type TableCommonProps<TType = unknown> = TableFeatureProps<TType> & {
152
- children: (JSX.Element | boolean | null | undefined)[];
154
+ children: TableChild | TableChild[];
153
155
  data: TType[];
154
156
  id: string;
155
157
  customSettings?: TableCustomSettingsRenderer;
@@ -208,6 +210,7 @@ export declare type TableColumnProps<TType = unknown> = ValueOf<{
208
210
  dataType?: TableColumnDataType;
209
211
  defaultHidden?: boolean;
210
212
  defaultWidth?: TableColumnWidth;
213
+ enableEditing?: boolean;
211
214
  enableFiltering?: boolean;
212
215
  enableGrouping?: boolean;
213
216
  enableHiding?: boolean;
@@ -46,6 +46,7 @@ declare module '@tanstack/table-core' {
46
46
  control?: TableColumnRendererControl<TData>;
47
47
  dataType?: TableColumnDataType;
48
48
  defaultWidth?: number;
49
+ enableEditing?: boolean;
49
50
  enableOrdering?: boolean;
50
51
  enablePrinting?: boolean;
51
52
  enableSearch?: boolean;