@economic/taco 2.26.2 → 2.26.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,7 +12,7 @@ function Table(props) {
12
12
  Table.Toolbar = TableToolbar;
13
13
  Table.Grid = TableGrid;
14
14
  function TableGrid(props) {
15
- var _table$state$grouping, _table$renderer$rows;
15
+ var _table$state$grouping;
16
16
  const {
17
17
  enableHorizontalArrowKeyNavigation,
18
18
  table,
@@ -39,7 +39,7 @@ function TableGrid(props) {
39
39
  key: props.id,
40
40
  header: props,
41
41
  scrollToIndex: table.renderer.scrollToIndex
42
- }))))))), (_table$renderer$rows = table.renderer.rows) !== null && _table$renderer$rows !== void 0 && _table$renderer$rows.length ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Body, {
42
+ }))))))), table.instance.getRowModel().rows.length ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Body, {
43
43
  enableHorizontalArrowKeyNavigation: enableHorizontalArrowKeyNavigation,
44
44
  table: table.instance,
45
45
  style: table.renderer.style
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","sources":["../../../../../../../../src/primitives/Table/Core/Table.tsx"],"sourcesContent":["import React from 'react';\nimport { FocusScope } from '@react-aria/focus';\nimport { Header } from './components/Header/Header';\nimport { Body } from './components/Body/Body';\nimport { Footer } from './components/Footer/Footer';\nimport { EmptyStateBody } from './components/Body/EmptyStateBody';\nimport { useTableReturnValue } from './useTable';\nimport { TableToolbar } from './components/Toolbar/Toolbar';\nimport './style.css';\n\ntype TableProps = {\n children: JSX.Element | Array<JSX.Element | null>;\n};\n\nexport function Table(props: TableProps) {\n return <>{props.children}</>;\n}\nTable.Toolbar = TableToolbar;\nTable.Grid = TableGrid;\n\nexport type TableGridProps<TType = unknown> = React.TableHTMLAttributes<HTMLTableElement> & {\n 'data-taco': string;\n enableHorizontalArrowKeyNavigation?: boolean;\n table: useTableReturnValue<TType>;\n};\n\nexport function TableGrid<TType = unknown>(props: TableGridProps<TType>) {\n const { enableHorizontalArrowKeyNavigation, table, ...attributes } = props;\n const handleFocus =\n table.meta.rowActive.rowActiveIndex === undefined\n ? (event: React.FocusEvent) => {\n table.meta.rowActive.handleFocus(event, table.meta.length, table.renderer.scrollToIndex);\n }\n : undefined;\n\n return (\n <>\n {table.stylesheet}\n <FocusScope>\n <table\n {...attributes}\n id={table.id}\n data-table-font-size={table.meta.fontSize.size}\n data-table-horizontally-scrolled={table.meta.columnFreezing.isHorizontallyScrolled ? true : undefined}\n data-table-pause-hover={table.meta.rowActive.isHoverStatePaused ? true : undefined}\n data-table-resizing={table.state.columnSizingInfo.isResizingColumn ? true : undefined}\n data-table-row-height={table.meta.rowHeight.height}\n data-table-grouped={!!table.state.grouping?.length}\n onFocus={handleFocus}\n onScroll={table.meta.columnFreezing.handleScroll}\n ref={table.ref}\n tabIndex={-1}>\n <thead>\n {table.instance.getHeaderGroups().map(headerGroup => (\n <tr key={headerGroup.id}>\n {headerGroup.headers.map(props => (\n <Header key={props.id} header={props} scrollToIndex={table.renderer.scrollToIndex} />\n ))}\n </tr>\n ))}\n </thead>\n {table.renderer.rows?.length ? (\n <>\n <Body\n enableHorizontalArrowKeyNavigation={enableHorizontalArrowKeyNavigation}\n table={table.instance}\n style={table.renderer.style}>\n {table.renderer.rows}\n </Body>\n {table.meta.footer.isEnabled ? (\n <tfoot>\n <tr>{table.instance.getFooterGroups()[0].headers.map(Footer)}</tr>\n </tfoot>\n ) : null}\n </>\n ) : (\n <EmptyStateBody emptyState={table.props.emptyState} />\n )}\n </table>\n </FocusScope>\n </>\n );\n}\n"],"names":["Table","props","React","children","Toolbar","TableToolbar","Grid","TableGrid","enableHorizontalArrowKeyNavigation","table","attributes","handleFocus","meta","rowActive","rowActiveIndex","undefined","event","length","renderer","scrollToIndex","stylesheet","FocusScope","id","fontSize","size","columnFreezing","isHorizontallyScrolled","isHoverStatePaused","state","columnSizingInfo","isResizingColumn","rowHeight","height","_table$state$grouping","grouping","onFocus","onScroll","handleScroll","ref","tabIndex","instance","getHeaderGroups","map","headerGroup","key","headers","Header","header","_table$renderer$rows","rows","Body","style","footer","isEnabled","getFooterGroups","Footer","EmptyStateBody","emptyState"],"mappings":";;;;;;;;SAcgBA,KAAKA,CAACC,KAAiB;EACnC,oBAAOC,4DAAGD,KAAK,CAACE,QAAQ,CAAI;AAChC;AACAH,KAAK,CAACI,OAAO,GAAGC,YAAY;AAC5BL,KAAK,CAACM,IAAI,GAAGC,SAAS;SAQNA,SAASA,CAAkBN,KAA4B;;EACnE,MAAM;IAAEO,kCAAkC;IAAEC,KAAK;IAAE,GAAGC;GAAY,GAAGT,KAAK;EAC1E,MAAMU,WAAW,GACbF,KAAK,CAACG,IAAI,CAACC,SAAS,CAACC,cAAc,KAAKC,SAAS,GAC1CC,KAAuB;IACpBP,KAAK,CAACG,IAAI,CAACC,SAAS,CAACF,WAAW,CAACK,KAAK,EAAEP,KAAK,CAACG,IAAI,CAACK,MAAM,EAAER,KAAK,CAACS,QAAQ,CAACC,aAAa,CAAC;GAC3F,GACDJ,SAAS;EAEnB,oBACIb,4DACKO,KAAK,CAACW,UAAU,eACjBlB,6BAACmB,UAAU,qBACPnB,wDACQQ,UAAU;IACdY,EAAE,EAAEb,KAAK,CAACa,EAAE;4BACUb,KAAK,CAACG,IAAI,CAACW,QAAQ,CAACC,IAAI;wCACZf,KAAK,CAACG,IAAI,CAACa,cAAc,CAACC,sBAAsB,GAAG,IAAI,GAAGX,SAAS;8BAC7EN,KAAK,CAACG,IAAI,CAACC,SAAS,CAACc,kBAAkB,GAAG,IAAI,GAAGZ,SAAS;2BAC7DN,KAAK,CAACmB,KAAK,CAACC,gBAAgB,CAACC,gBAAgB,GAAG,IAAI,GAAGf,SAAS;6BAC9DN,KAAK,CAACG,IAAI,CAACmB,SAAS,CAACC,MAAM;0BAC9B,CAAC,GAAAC,qBAAA,GAACxB,KAAK,CAACmB,KAAK,CAACM,QAAQ,cAAAD,qBAAA,eAApBA,qBAAA,CAAsBhB,MAAM;IAClDkB,OAAO,EAAExB,WAAW;IACpByB,QAAQ,EAAE3B,KAAK,CAACG,IAAI,CAACa,cAAc,CAACY,YAAY;IAChDC,GAAG,EAAE7B,KAAK,CAAC6B,GAAG;IACdC,QAAQ,EAAE,CAAC;mBACXrC,4CACKO,KAAK,CAAC+B,QAAQ,CAACC,eAAe,EAAE,CAACC,GAAG,CAACC,WAAW,mBAC7CzC;IAAI0C,GAAG,EAAED,WAAW,CAACrB;KAChBqB,WAAW,CAACE,OAAO,CAACH,GAAG,CAACzC,KAAK,mBAC1BC,6BAAC4C,MAAM;IAACF,GAAG,EAAE3C,KAAK,CAACqB,EAAE;IAAEyB,MAAM,EAAE9C,KAAK;IAAEkB,aAAa,EAAEV,KAAK,CAACS,QAAQ,CAACC;IAAiB,CACxF,CAAC,CACD,CACR,CAAC,CACE,EACP,CAAA6B,oBAAA,GAAAvC,KAAK,CAACS,QAAQ,CAAC+B,IAAI,cAAAD,oBAAA,eAAnBA,oBAAA,CAAqB/B,MAAM,kBACxBf,yEACIA,6BAACgD,IAAI;IACD1C,kCAAkC,EAAEA,kCAAkC;IACtEC,KAAK,EAAEA,KAAK,CAAC+B,QAAQ;IACrBW,KAAK,EAAE1C,KAAK,CAACS,QAAQ,CAACiC;KACrB1C,KAAK,CAACS,QAAQ,CAAC+B,IAAI,CACjB,EACNxC,KAAK,CAACG,IAAI,CAACwC,MAAM,CAACC,SAAS,kBACxBnD,yDACIA,yCAAKO,KAAK,CAAC+B,QAAQ,CAACc,eAAe,EAAE,CAAC,CAAC,CAAC,CAACT,OAAO,CAACH,GAAG,CAACa,MAAM,CAAC,CAAM,CAC9D,IACR,IAAI,CACT,mBAEHrD,6BAACsD,cAAc;IAACC,UAAU,EAAEhD,KAAK,CAACR,KAAK,CAACwD;IAAc,CACzD,CACG,CACC,CACd;AAEX;;;;"}
1
+ {"version":3,"file":"Table.js","sources":["../../../../../../../../src/primitives/Table/Core/Table.tsx"],"sourcesContent":["import React from 'react';\nimport { FocusScope } from '@react-aria/focus';\nimport { Header } from './components/Header/Header';\nimport { Body } from './components/Body/Body';\nimport { Footer } from './components/Footer/Footer';\nimport { EmptyStateBody } from './components/Body/EmptyStateBody';\nimport { useTableReturnValue } from './useTable';\nimport { TableToolbar } from './components/Toolbar/Toolbar';\nimport './style.css';\n\ntype TableProps = {\n children: JSX.Element | Array<JSX.Element | null>;\n};\n\nexport function Table(props: TableProps) {\n return <>{props.children}</>;\n}\nTable.Toolbar = TableToolbar;\nTable.Grid = TableGrid;\n\nexport type TableGridProps<TType = unknown> = React.TableHTMLAttributes<HTMLTableElement> & {\n 'data-taco': string;\n enableHorizontalArrowKeyNavigation?: boolean;\n table: useTableReturnValue<TType>;\n};\n\nexport function TableGrid<TType = unknown>(props: TableGridProps<TType>) {\n const { enableHorizontalArrowKeyNavigation, table, ...attributes } = props;\n const handleFocus =\n table.meta.rowActive.rowActiveIndex === undefined\n ? (event: React.FocusEvent) => {\n table.meta.rowActive.handleFocus(event, table.meta.length, table.renderer.scrollToIndex);\n }\n : undefined;\n\n return (\n <>\n {table.stylesheet}\n <FocusScope>\n <table\n {...attributes}\n id={table.id}\n data-table-font-size={table.meta.fontSize.size}\n data-table-horizontally-scrolled={table.meta.columnFreezing.isHorizontallyScrolled ? true : undefined}\n data-table-pause-hover={table.meta.rowActive.isHoverStatePaused ? true : undefined}\n data-table-resizing={table.state.columnSizingInfo.isResizingColumn ? true : undefined}\n data-table-row-height={table.meta.rowHeight.height}\n data-table-grouped={!!table.state.grouping?.length}\n onFocus={handleFocus}\n onScroll={table.meta.columnFreezing.handleScroll}\n ref={table.ref}\n tabIndex={-1}>\n <thead>\n {table.instance.getHeaderGroups().map(headerGroup => (\n <tr key={headerGroup.id}>\n {headerGroup.headers.map(props => (\n <Header key={props.id} header={props} scrollToIndex={table.renderer.scrollToIndex} />\n ))}\n </tr>\n ))}\n </thead>\n {table.instance.getRowModel().rows.length ? (\n <>\n <Body\n enableHorizontalArrowKeyNavigation={enableHorizontalArrowKeyNavigation}\n table={table.instance}\n style={table.renderer.style}>\n {table.renderer.rows}\n </Body>\n {table.meta.footer.isEnabled ? (\n <tfoot>\n <tr>{table.instance.getFooterGroups()[0].headers.map(Footer)}</tr>\n </tfoot>\n ) : null}\n </>\n ) : (\n <EmptyStateBody emptyState={table.props.emptyState} />\n )}\n </table>\n </FocusScope>\n </>\n );\n}\n"],"names":["Table","props","React","children","Toolbar","TableToolbar","Grid","TableGrid","enableHorizontalArrowKeyNavigation","table","attributes","handleFocus","meta","rowActive","rowActiveIndex","undefined","event","length","renderer","scrollToIndex","stylesheet","FocusScope","id","fontSize","size","columnFreezing","isHorizontallyScrolled","isHoverStatePaused","state","columnSizingInfo","isResizingColumn","rowHeight","height","_table$state$grouping","grouping","onFocus","onScroll","handleScroll","ref","tabIndex","instance","getHeaderGroups","map","headerGroup","key","headers","Header","header","getRowModel","rows","Body","style","footer","isEnabled","getFooterGroups","Footer","EmptyStateBody","emptyState"],"mappings":";;;;;;;;SAcgBA,KAAKA,CAACC,KAAiB;EACnC,oBAAOC,4DAAGD,KAAK,CAACE,QAAQ,CAAI;AAChC;AACAH,KAAK,CAACI,OAAO,GAAGC,YAAY;AAC5BL,KAAK,CAACM,IAAI,GAAGC,SAAS;SAQNA,SAASA,CAAkBN,KAA4B;;EACnE,MAAM;IAAEO,kCAAkC;IAAEC,KAAK;IAAE,GAAGC;GAAY,GAAGT,KAAK;EAC1E,MAAMU,WAAW,GACbF,KAAK,CAACG,IAAI,CAACC,SAAS,CAACC,cAAc,KAAKC,SAAS,GAC1CC,KAAuB;IACpBP,KAAK,CAACG,IAAI,CAACC,SAAS,CAACF,WAAW,CAACK,KAAK,EAAEP,KAAK,CAACG,IAAI,CAACK,MAAM,EAAER,KAAK,CAACS,QAAQ,CAACC,aAAa,CAAC;GAC3F,GACDJ,SAAS;EAEnB,oBACIb,4DACKO,KAAK,CAACW,UAAU,eACjBlB,6BAACmB,UAAU,qBACPnB,wDACQQ,UAAU;IACdY,EAAE,E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AK,CAACS,QAAQ,CAAC+B,IAAI,CACjB,EACNxC,KAAK,CAACG,IAAI,CAACwC,MAAM,CAACC,SAAS,kBACxBnD,yDACIA,yCAAKO,KAAK,CAAC+B,QAAQ,CAACc,eAAe,EAAE,CAAC,CAAC,CAAC,CAACT,OAAO,CAACH,GAAG,CAACa,MAAM,CAAC,CAAM,CAC9D,IACR,IAAI,CACT,mBAEHrD,6BAACsD,cAAc;IAACC,UAAU,EAAEhD,KAAK,CAACR,KAAK,CAACwD;IAAc,CACzD,CACG,CACC,CACd;AAEX;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { useReactTable, getCoreRowModel } from '@tanstack/react-table';
2
2
  import { mapTableChildrenToColumns, useReactTableInitialState, configureReactTableOptions } from './util/setup.js';
3
- import { useTableFeaturePreset } from './util/presets.js';
3
+ import { getTableFeaturePreset } from './util/presets.js';
4
4
  import { useTableColumnFreezing } from './features/useTableColumnFreezing.js';
5
5
  import { useTableColumnOrdering } from './features/useTableColumnOrdering.js';
6
6
  import { useTableFooter } from './features/useTableFooter.js';
@@ -35,7 +35,7 @@ function useTableManager(props, meta, internalColumns) {
35
35
  // CSS.escape would be best here, but it doesn't seem to work very well
36
36
  const safeId = props.id.replace('.', '_');
37
37
  // configure table options, merging props with presets
38
- const options = useTableFeaturePreset(props);
38
+ const options = getTableFeaturePreset(props);
39
39
  // load any persisted table settings and merge them with any defaults
40
40
  const [settings, setSettings] = useTableSettings(options.enableSaveSettings, safeId, props.defaultSettings, props.onChangeSettings);
41
41
  // configure common custom features
@@ -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 TableColumnRendererControl,\n TableFilterComparator,\n TableProps,\n} from '../types';\nimport { useReactTableInitialState, configureReactTableOptions, mapTableChildrenToColumns } from './util/setup';\nimport { useTableFeaturePreset } 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 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 = useTableFeaturePreset(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);\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","useTableFeaturePreset","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","useTableServerLoadingListener","useTableSettingsListener","useTableShortcutsListener","shortcuts","useTableSortingListener","onChangeSort","_instance$options$met","state","getState"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA4FgBA,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,cAAc,GAAGC,sBAAsB,CAACT,OAAO,CAACU,oBAAoB,CAAC;EAC3E,MAAMC,cAAc,GAAGC,sBAAsB,CAACZ,OAAO,CAACa,oBAAoB,CAAC;EAC3E,MAAMC,QAAQ,GAAGC,gBAAgB,CAACf,OAAO,CAACgB,cAAc,EAAEd,QAAQ,CAACY,QAAQ,CAAC;EAC5E,MAAMG,MAAM,GAAGC,cAAc,CAAClB,OAAO,CAACmB,YAAY,CAAC;EACnD,MAAMC,QAAQ,GAAGC,gBAAgB,CAACrB,OAAO,CAACsB,cAAc,EAAEzB,MAAM,CAAC;EACjE,MAAM0B,SAAS,GAAGC,iBAAiB,CAACxB,OAAO,CAACyB,eAAe,EAAE/B,KAAK,CAACgC,qBAAq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AEd,MAAM,CAACE,QAAQ,CAAC;EACxD2B,wBAAwB,CAACf,QAAQ,EAAE3E,WAAW,CAAC;EAC/C2F,yBAAyB,CAAChB,QAAQ,EAAEpF,KAAK,CAACqG,SAAS,CAAC;EACpDC,uBAAuB,CAAClB,QAAQ,EAAEpF,KAAK,CAACuG,YAAY,CAAC;EAErD,OAAO;IACHnG,EAAE,EAAED,MAAM;IACViF,QAAQ;IACRnF,IAAI,GAAAuG,qBAAA,GAAGpB,QAAQ,CAAC9E,OAAO,CAACL,IAAI,cAAAuG,qBAAA,cAAAA,qBAAA,GAAI,EAAoC;IACpEC,KAAK,EAAErB,QAAQ,CAACsB,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 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 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);\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","useTableServerLoadingListener","useTableSettingsListener","useTableShortcutsListener","shortcuts","useTableSortingListener","onChangeSort","_instance$options$met","state","getState"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA4FgBA,eAAeA,CAC3BC,KAAwB,EACxBC,IAA6C,EAC7CC,eAAuD;;;EAGvD,MAAMC,MAAM,GAAGH,KAAK,CAACI,EAAE,CAACC,OAAO,CAAC,GAAG,EAAE,GA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iltering: false,
@@ -105,7 +103,7 @@ const presets = {
105
103
  enableSaveSettings: true
106
104
  }
107
105
  };
108
- function useTableFeaturePreset(props) {
106
+ function getTableFeaturePreset(props) {
109
107
  var _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, _props$enableColumnOr, _props$enableFontSize, _props$enableFooter, _props$enablePrinting, _props$enableRowActiv, _props$rowActions, _props$enableRowHeigh, _props$enableSaveSett;
110
108
  const presetOptions = props.preset ? presets[props.preset] : DEFAULT_PRESET;
111
109
  const enableRowActions = (_props$enableRowActio = props.enableRowActions) !== null && _props$enableRowActio !== void 0 ? _props$enableRowActio : presetOptions.enableRowActions;
@@ -116,24 +114,6 @@ function useTableFeaturePreset(props) {
116
114
  const enableRowExpansion = (_props$enableRowExpan = props.enableRowExpansion) !== null && _props$enableRowExpan !== void 0 ? _props$enableRowExpan : presetOptions.enableRowExpansion;
117
115
  const enableRowSelection = (_props$enableRowSelec = props.enableRowSelection) !== null && _props$enableRowSelec !== void 0 ? _props$enableRowSelec : presetOptions.enableRowSelection;
118
116
  const enableRowSelectionSingle = (_props$enableRowSelec2 = props.enableRowSelectionSingle) !== null && _props$enableRowSelec2 !== void 0 ? _props$enableRowSelec2 : presetOptions.enableRowSelectionSingle;
119
- // guard options that might be unintentionally broken
120
- React__default.useEffect(() => {
121
- if (enableRowClick && !props.onRowClick) {
122
- console.warn(`Table (id: ${props.id}) - Row click is enabled but no \`onRowClick\` handler has been provided. Provide one to enable row click or set \`enableRowClick\` to \`false\`.`);
123
- }
124
- if (enableRowGoto && !props.onRowGoto) {
125
- console.warn(`Table (id: ${props.id}) - Row click is enabled but no \`onRowGoto\` handler has been provided. Provide one to enable row goto or set \`enableRowGoto\` to \`false\`.`);
126
- }
127
- if (enableRowExpansion && !props.rowExpansionRenderer) {
128
- console.warn(`Table (id: ${props.id}) - Row expansion is enabled but no \`rowExpansionRenderer\` has been provided. Provide one to enable row expansion or set \`enableRowExpansion\` to \`false\`.`);
129
- }
130
- if (enableRowSelection && !props.onRowSelect) {
131
- console.warn(`Table (id: ${props.id}) - Row selection is enabled but no \`onRowSelect\` handler has been provided. Provide one to enable row selection or set \`enableRowSelection\` to \`false\`.`);
132
- }
133
- if (enableRowSelectionSingle && !props.onRowSelect) {
134
- console.warn(`Table (id: ${props.id}) - Row selection (single) is enabled but no \`onRowSelect\` handler has been provided. Provide one to enable row selection or set \`enableRowSelectionSingle\` to \`false\`.`);
135
- }
136
- }, []);
137
117
  return {
138
118
  // react-table built-in
139
119
  enableFiltering: (_props$enableFilterin = props.enableFiltering) !== null && _props$enableFilterin !== void 0 ? _props$enableFilterin : presetOptions.enableFiltering,
@@ -161,5 +141,5 @@ function useTableFeaturePreset(props) {
161
141
  };
162
142
  }
163
143
 
164
- export { useTableFeaturePreset };
144
+ export { getTableFeaturePreset };
165
145
  //# sourceMappingURL=presets.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"presets.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/util/presets.ts"],"sourcesContent":["import React from 'react';\nimport { 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 useTableFeaturePreset<TType = unknown>(props: TableProps<TType>): TableFeatureProps {\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 // guard options that might be unintentionally broken\n React.useEffect(() => {\n if (enableRowClick && !props.onRowClick) {\n console.warn(\n `Table (id: ${props.id}) - Row click is enabled but no \\`onRowClick\\` handler has been provided. Provide one to enable row click or set \\`enableRowClick\\` to \\`false\\`.`\n );\n }\n\n if (enableRowGoto && !props.onRowGoto) {\n console.warn(\n `Table (id: ${props.id}) - Row click is enabled but no \\`onRowGoto\\` handler has been provided. Provide one to enable row goto or set \\`enableRowGoto\\` to \\`false\\`.`\n );\n }\n\n if (enableRowExpansion && !props.rowExpansionRenderer) {\n console.warn(\n `Table (id: ${props.id}) - Row expansion is enabled but no \\`rowExpansionRenderer\\` has been provided. Provide one to enable row expansion or set \\`enableRowExpansion\\` to \\`false\\`.`\n );\n }\n\n if (enableRowSelection && !props.onRowSelect) {\n console.warn(\n `Table (id: ${props.id}) - Row selection is enabled but no \\`onRowSelect\\` handler has been provided. Provide one to enable row selection or set \\`enableRowSelection\\` to \\`false\\`.`\n );\n }\n\n if (enableRowSelectionSingle && !props.onRowSelect) {\n console.warn(\n `Table (id: ${props.id}) - Row selection (single) is enabled but no \\`onRowSelect\\` handler has been provided. Provide one to enable row selection or set \\`enableRowSelectionSingle\\` to \\`false\\`.`\n );\n }\n }, []);\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: enableRowClick && !!props.onRowClick,\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","useTableFeaturePreset","props","presetOptions","preset","_props$enableRowActio","_props$enableRowClick","_props$enableRowDrag","_props$enableRowDrop","_props$enableRowGoto","_props$enableRowExpan","_props$enableRowSelec","_props$enableRowSelec2","React","useEffect","onRowClick","console","warn","id","onRowGoto","rowExpansionRenderer","onRowSelect","_props$enableFilterin","_props$enableSearch","_props$enableSorting","_props$enableColumnFr","_props$enableColumnHi","_props$enableColumnRe","_props$enableColumnOr","_props$enableFontSize","_props$enableFooter","_props$enablePrinting","_props$enableRowActiv","_props$rowActions","rowActions","length","onRowDrag","onRowDrop","_props$enableRowHeigh","_props$enableSaveSett"],"mappings":";;AAGA,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;IACpBC,YAAY,EAAE,IAAI;IAClBC,cAAc,EAAE,IAAI;IACpBC,eAAe,EAAE,IAAI;IACrBC,gBAAgB,EAAE,IAAI;IACtBC,cAAc,EAAE,IAAI;IACpBC,aAAa,EAAE,IAAI;IACnBC,aAAa,EAAE,IAAI;IACnBC,aAAa,EA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C,KAAK,CAACP,eAAe,cAAA2C,qBAAA,cAAAA,qBAAA,GAAInC,aAAa,CAACR,eAAe;IACvEC,kBAAkB,GAAA2C,qBAAA,GAAErC,KAAK,CAACN,kBAAkB,cAAA2C,qBAAA,cAAAA,qBAAA,GAAIpC,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 {\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: enableRowClick && !!props.onRowClick,\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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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;IAChErC,cAAc,EAAEA,cAAc,IAAI,CAAC,CAACW,KAAK,CAAC2B,UAAU;IACpDrC,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,2 +1,2 @@
1
1
  import { TableFeatureProps, TableProps } from '../../types';
2
- export declare function useTableFeaturePreset<TType = unknown>(props: TableProps<TType>): TableFeatureProps;
2
+ export declare function getTableFeaturePreset<TType = unknown>(props: TableProps<TType>): TableFeatureProps;
@@ -9888,7 +9888,7 @@ const presets = {
9888
9888
  enableSaveSettings: true
9889
9889
  }
9890
9890
  };
9891
- function useTableFeaturePreset(props) {
9891
+ function getTableFeaturePreset(props) {
9892
9892
  var _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, _props$enableColumnOr, _props$enableFontSize, _props$enableFooter, _props$enablePrinting, _props$enableRowActiv, _props$rowActions, _props$enableRowHeigh, _props$enableSaveSett;
9893
9893
  const presetOptions = props.preset ? presets[props.preset] : DEFAULT_PRESET;
9894
9894
  const enableRowActions = (_props$enableRowActio = props.enableRowActions) !== null && _props$enableRowActio !== void 0 ? _props$enableRowActio : presetOptions.enableRowActions;
@@ -9899,24 +9899,6 @@ function useTableFeaturePreset(props) {
9899
9899
  const enableRowExpansion = (_props$enableRowExpan = props.enableRowExpansion) !== null && _props$enableRowExpan !== void 0 ? _props$enableRowExpan : presetOptions.enableRowExpansion;
9900
9900
  const enableRowSelection = (_props$enableRowSelec = props.enableRowSelection) !== null && _props$enableRowSelec !== void 0 ? _props$enableRowSelec : presetOptions.enableRowSelection;
9901
9901
  const enableRowSelectionSingle = (_props$enableRowSelec2 = props.enableRowSelectionSingle) !== null && _props$enableRowSelec2 !== void 0 ? _props$enableRowSelec2 : presetOptions.enableRowSelectionSingle;
9902
- // guard options that might be unintentionally broken
9903
- React__default.useEffect(() => {
9904
- if (enableRowClick && !props.onRowClick) {
9905
- console.warn(`Table (id: ${props.id}) - Row click is enabled but no \`onRowClick\` handler has been provided. Provide one to enable row click or set \`enableRowClick\` to \`false\`.`);
9906
- }
9907
- if (enableRowGoto && !props.onRowGoto) {
9908
- console.warn(`Table (id: ${props.id}) - Row click is enabled but no \`onRowGoto\` handler has been provided. Provide one to enable row goto or set \`enableRowGoto\` to \`false\`.`);
9909
- }
9910
- if (enableRowExpansion && !props.rowExpansionRenderer) {
9911
- console.warn(`Table (id: ${props.id}) - Row expansion is enabled but no \`rowExpansionRenderer\` has been provided. Provide one to enable row expansion or set \`enableRowExpansion\` to \`false\`.`);
9912
- }
9913
- if (enableRowSelection && !props.onRowSelect) {
9914
- console.warn(`Table (id: ${props.id}) - Row selection is enabled but no \`onRowSelect\` handler has been provided. Provide one to enable row selection or set \`enableRowSelection\` to \`false\`.`);
9915
- }
9916
- if (enableRowSelectionSingle && !props.onRowSelect) {
9917
- console.warn(`Table (id: ${props.id}) - Row selection (single) is enabled but no \`onRowSelect\` handler has been provided. Provide one to enable row selection or set \`enableRowSelectionSingle\` to \`false\`.`);
9918
- }
9919
- }, []);
9920
9902
  return {
9921
9903
  // react-table built-in
9922
9904
  enableFiltering: (_props$enableFilterin = props.enableFiltering) !== null && _props$enableFilterin !== void 0 ? _props$enableFilterin : presetOptions.enableFiltering,
@@ -10827,7 +10809,7 @@ function useTableManager(props, meta, internalColumns) {
10827
10809
  // CSS.escape would be best here, but it doesn't seem to work very well
10828
10810
  const safeId = props.id.replace('.', '_');
10829
10811
  // configure table options, merging props with presets
10830
- const options = useTableFeaturePreset(props);
10812
+ const options = getTableFeaturePreset(props);
10831
10813
  // load any persisted table settings and merge them with any defaults
10832
10814
  const [settings, setSettings] = useTableSettings(options.enableSaveSettings, safeId, props.defaultSettings, props.onChangeSettings);
10833
10815
  // configure common custom features
@@ -15718,7 +15700,7 @@ function Table(props) {
15718
15700
  Table.Toolbar = TableToolbar;
15719
15701
  Table.Grid = TableGrid;
15720
15702
  function TableGrid(props) {
15721
- var _table$state$grouping, _table$renderer$rows;
15703
+ var _table$state$grouping;
15722
15704
  const {
15723
15705
  enableHorizontalArrowKeyNavigation,
15724
15706
  table,
@@ -15745,7 +15727,7 @@ function TableGrid(props) {
15745
15727
  key: props.id,
15746
15728
  header: props,
15747
15729
  scrollToIndex: table.renderer.scrollToIndex
15748
- }))))))), (_table$renderer$rows = table.renderer.rows) !== null && _table$renderer$rows !== void 0 && _table$renderer$rows.length ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Body, {
15730
+ }))))))), table.instance.getRowModel().rows.length ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Body, {
15749
15731
  enableHorizontalArrowKeyNavigation: enableHorizontalArrowKeyNavigation,
15750
15732
  table: table.instance,
15751
15733
  style: table.renderer.style