@economic/taco 2.46.9 → 2.47.0-server-2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Report/Report.d.ts +1 -1
- package/dist/components/SearchInput2/SearchInput2.d.ts +2 -0
- package/dist/components/Table3/components/Row/Editing/CreateNewRow.d.ts +1 -2
- package/dist/components/Table3/components/Row/Editing/TemporaryRow.d.ts +1 -0
- package/dist/components/Table3/features/useEditingState.d.ts +11 -11
- package/dist/components/Table3/features/useTableEditing.d.ts +13 -13
- package/dist/components/Table3/util/editing.d.ts +3 -0
- package/dist/esm/index.css +2 -2
- package/dist/esm/node_modules/babel-plugin-transform-async-to-promises/helpers.mjs.js +17 -17
- package/dist/esm/node_modules/babel-plugin-transform-async-to-promises/helpers.mjs.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Donut/Legend.js +1 -0
- package/dist/esm/packages/taco/src/charts/components/Donut/Legend.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Legend.js +1 -0
- package/dist/esm/packages/taco/src/charts/components/Legend.js.map +1 -1
- package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js +6 -3
- package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowActions.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +14 -4
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js +14 -9
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateNewRow.js +2 -4
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateNewRow.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/TemporaryRow.js +5 -4
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/TemporaryRow.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/features/useEditingState.js +32 -51
- package/dist/esm/packages/taco/src/components/Table3/features/useEditingState.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js +5 -3
- package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/listeners/useTableEditingListener.js +15 -12
- package/dist/esm/packages/taco/src/components/Table3/listeners/useTableEditingListener.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/util/editing.js +9 -1
- package/dist/esm/packages/taco/src/components/Table3/util/editing.js.map +1 -1
- package/dist/esm/packages/taco/src/index.js +1 -0
- package/dist/esm/packages/taco/src/index.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js +2 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Expansion.js +4 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Expansion.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Selection.js +7 -4
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Selection.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.js +7 -2
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Summary.js +7 -5
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Summary.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.js +24 -22
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/Row.js +41 -4
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/Row.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/Print.js +3 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/Print.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Search/Search.js +26 -3
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Search/Search.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableGlobalShortcuts.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableGlobalShortcuts.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js +36 -9
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/useTable.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js +5 -7
- package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader2.js +249 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader2.js.map +1 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActive.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActive.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowExpansion.js +2 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowExpansion.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSearch.js +3 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSearch.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableServerLoading.js +4 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableServerLoading.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableFilterListener.js +3 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableFilterListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.js +4 -4
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js +14 -13
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableServerLoadingListener.js +7 -3
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableServerLoadingListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js +4 -4
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/columns.js +4 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/columns.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js +7 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js +6 -0
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js.map +1 -1
- package/dist/hooks/useLazyDebouncedEffect.d.ts +2 -0
- package/dist/index.css +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/primitives/Table/Core/Table.d.ts +1 -0
- package/dist/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.d.ts +2 -2
- package/dist/primitives/Table/Core/components/Row/Row.d.ts +2 -0
- package/dist/primitives/Table/Core/features/useTableRenderer.d.ts +1 -1
- package/dist/primitives/Table/types.d.ts +11 -6
- package/dist/primitives/Table/useTableDataLoader2.d.ts +23 -0
- package/dist/primitives/Table/useTableManager/features/useTableRowExpansion.d.ts +2 -1
- package/dist/primitives/Table/useTableManager/features/useTableSearch.d.ts +4 -2
- package/dist/primitives/Table/useTableManager/features/useTableServerLoading.d.ts +3 -1
- package/dist/primitives/Table/useTableManager/listeners/useTableSearchListener.d.ts +1 -2
- package/dist/primitives/Table/useTableManager/util/columns.d.ts +2 -1
- package/dist/taco.cjs.development.js +607 -229
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/package.json +2 -3
@@ -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';\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 } from './filtering';\nimport { globalFilterFn } from './search';\nimport { ignoreInternalColumns } from './settings';\nimport { getDataTypeProperties } from './dataTypes';\nimport { Localization } from '../../../../components/Provider/Localization';\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 | undefined,\n localization: Localization\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 localization\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 const dataTypeProperties = getDataTypeProperties<TType>(child.props.dataType);\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 align: meta.align ?? dataTypeProperties.align,\n defaultWidth,\n enableOrdering: isGrouped ? false : enableOrdering,\n enablePrinting,\n enableTruncate,\n enableEditing,\n header,\n renderer,\n },\n };\n\n // renderers - use defined renderers first, then fall back to data type renderers (if there is one)\n if (typeof renderer === 'function') {\n column.cell = info => renderer(info.getValue(), info.row.original);\n } else if (dataTypeProperties.getDisplayValue) {\n const dataTypeRenderer = (value: any) => dataTypeProperties.getDisplayValue?.(value, { localization }) ?? value;\n column.cell = info => dataTypeRenderer(info.getValue());\n (column.meta as any).renderer = dataTypeRenderer;\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> | undefined,\n localization: Localization\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 localization\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 && 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>(\n options: TableFeatureProps<TType>,\n props: TableProps<TType>,\n localization: Localization\n) {\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 options.enableRowSelection === 'function'\n ? (row: ReactTableRow<TType>) => (options.enableRowSelection as (row: TType) => boolean)(row.original)\n : options.enableRowSelection;\n\n let getRowId;\n\n if (props.rowIdentityAccessor) {\n getRowId = (originalRow: TType | undefined, index: number) => {\n if (originalRow) {\n return String(originalRow[props.rowIdentityAccessor as string]);\n }\n\n return String(index);\n };\n }\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 enableRowPinning: true, // users can't customise row pinning, so it can just be always enabled\n enableRowSelection: reactTableEnableRowSelection ?? false,\n enableSorting: options.enableSorting ?? false,\n // models for default features\n getExpandedRowModel: getExpandedRowModel<TType>(),\n getGroupedRowModel: getGroupedRowModel<TType>(),\n getRowId,\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 = (row: ReactTableRow<TType>, columnId: string, searchQuery: any) =>\n globalFilterFn(row, columnId, searchQuery, localization);\n tableOptions.getColumnCanGlobalFilter = (column: ReactTableColumn<TType>) =>\n column.columnDef.meta?.enableSearch !== false && column.getIsVisible();\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","localization","columnHelper","createColumnHelper","React","isValidElement","props","children","id","header","push","group","Children","toArray","reduce","enableGrouping","accessor","_meta$align","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","dataTypeProperties","getDataTypeProperties","dataType","isGrouped","undefined","desc","column","accessorFn","row","get","align","cell","info","getValue","original","getDisplayValue","dataTypeRenderer","value","_dataTypeProperties$g","_dataTypeProperties$g2","call","table","getRowModel","rows","flatMap","filterFn","aggregatedCell","sortingFn","getSortingFn","sortDescFirst","sortUndefined","createInternalColumn","size","mapTableChildrenToColumns","options","internalColumns","_props$rowActions","enableRowExpansion","rowExpansionRenderer","rowExpansion","unshift","enableRowSelection","rowSelection","enableRowDrag","onRowDrag","rowDrag","enableRowActions","rowActions","length","configureReactTableOptions","reactTableEnableRowSelection","getRowId","rowIdentityAccessor","originalRow","index","String","tableOptions","defaultColumn","enableColumnHiding","enableColumnResizing","enableColumnFilters","_options$enableFilter","_options$enableColumn","enableExpanding","_options$enableRowExp","_options$enableColumn2","enablePinning","_options$enableColumn3","enableColumnFreezing","enableRowPinning","_options$enableSortin","getExpandedRowModel","getGroupedRowModel","groupedColumnMode","columnResizeMode","onChangeFilter","getFilteredRowModel","filterFns","tacoFilter","columnId","filter","columnFilterFn","globalFilterFn","searchQuery","getColumnCanGlobalFilter","_column$columnDef$met","columnDef","getIsVisible","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","_props$defaultSetting6","sorting","_props$defaultSetting7","_props$defaultSetting8","grouping","expanded"],"mappings":";;;;;;;;;;AA4BA;AACA,SAASA,eAAeA,CACpBC,KAAiE,EACjEC,OAAqC,EACrCC,aAA0C,EAC1CC,cAAsC,EACtCC,iBAA4C,EAC5CC,QAAuB,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DI,gBAAgB,GAAAC,KAAA,IAAAC,KAAA,IAAAC,sBAAA,GACZnC,iBAAiB,CAACgC,gBAAgB,cAAAG,sBAAA,cAAAA,sBAAA,IAAAC,sBAAA,GAAIvK,KAAK,CAAC6I,eAAe,cAAA0B,sBAAA,uBAArBA,sBAAA,CAAuBJ,gBAAgB,cAAAE,KAAA,cAAAA,KAAA,GAAIjC,QAAQ,CAAC5I,iBAAiB,cAAA4K,KAAA,cAAAA,KAAA,GAAI,EAAE;MACrHI,YAAY,GAAAC,qBAAA,GAAEtC,iBAAiB,CAACT,WAAW,cAAA+C,qBAAA,cAAAA,qBAAA,IAAAC,sBAAA,GAAI1K,KAAK,CAAC6I,eAAe,cAAA6B,sBAAA,uBAArBA,sBAAA,CAAuBhD,WAAW;MACjFiD,OAAO,EAAExC,iBAAiB,CAACwC,OAAO,GAC5BxC,iBAAiB,CAACwC,OAAO,CAACpD,MAAM,CAACe,uBAAuB,CAAC,IAAAsC,sBAAA,IAAAC,sBAAA,GACzD7K,KAAK,CAAC6I,eAAe,cAAAgC,sBAAA,uBAArBA,sBAAA,CAAuBF,OAAO,cAAAC,sBAAA,cAAAA,sBAAA,GAAIxC,QAAQ,CAAC7I;KACpD;IAED,IAAIS,KAAK,CAACN,uBAAuB,EAAE;MAC/B8J,KAAK,CAACsB,QAAQ,GAAG,CAAC9K,KAAK,CAACN,uBAAiC,CAAC;;MAE1D8J,KAAK,CAACuB,QAAQ,GAAG,IAAI;;IAGzB,OAAOvB,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';\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 } from './filtering';\nimport { globalFilterFn } from './search';\nimport { ignoreInternalColumns } from './settings';\nimport { getDataTypeProperties } from './dataTypes';\nimport { Localization } from '../../../../components/Provider/Localization';\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 | undefined,\n localization: Localization\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 localization\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 const dataTypeProperties = getDataTypeProperties<TType>(child.props.dataType);\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 align: meta.align ?? dataTypeProperties.align,\n defaultWidth,\n enableOrdering: isGrouped ? false : enableOrdering,\n enablePrinting,\n enableTruncate,\n enableEditing,\n header,\n renderer,\n },\n };\n\n // renderers - use defined renderers first, then fall back to data type renderers (if there is one)\n if (typeof renderer === 'function') {\n column.cell = info => renderer(info.getValue(), info.row.original);\n } else if (dataTypeProperties.getDisplayValue) {\n const dataTypeRenderer = (value: any) => dataTypeProperties.getDisplayValue?.(value, { localization }) ?? value;\n column.cell = info => dataTypeRenderer(info.getValue());\n (column.meta as any).renderer = dataTypeRenderer;\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> | undefined,\n localization: Localization\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 localization\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 && 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>(\n options: TableFeatureProps<TType>,\n props: TableProps<TType>,\n localization: Localization\n) {\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 options.enableRowSelection === 'function'\n ? (row: ReactTableRow<TType>) => (options.enableRowSelection as (row: TType) => boolean)(row.original)\n : options.enableRowSelection;\n\n let getRowId;\n\n if (props.rowIdentityAccessor) {\n getRowId = (originalRow: TType | undefined, index: number) => {\n if (originalRow) {\n return String(originalRow[props.rowIdentityAccessor as string]);\n }\n\n return String(index);\n };\n }\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 enableRowPinning: true, // users can't customise row pinning, so it can just be always enabled\n enableRowSelection: reactTableEnableRowSelection ?? false,\n enableSorting: options.enableSorting ?? false,\n // models for default features\n getExpandedRowModel: getExpandedRowModel<TType>(),\n getGroupedRowModel: getGroupedRowModel<TType>(),\n getRowId,\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 = (row: ReactTableRow<TType>, columnId: string, searchQuery: any) =>\n globalFilterFn(row, columnId, searchQuery, localization);\n tableOptions.getColumnCanGlobalFilter = (column: ReactTableColumn<TType>) =>\n column.columnDef.meta?.enableSearch !== false && column.getIsVisible();\n\n // enter controlled search mode (controlled could be local state, but usually the server)\n if (props.onChangeSearch) {\n if (props._experimentalDataLoader2) {\n tableOptions.manualFiltering = true;\n } else {\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\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","localization","columnHelper","createColumnHelper","React","isValidElement","props","children","id","header","push","group","Children","toArray","reduce","enableGrouping","accessor","_meta$align","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","dataTypeProperties","getDataTypeProperties","dataType","isGrouped","undefined","desc","column","accessorFn","row","get","align","cell","info","getValue","original","getDisplayValue","dataTypeRenderer","value","_dataTypeProperties$g","_dataTypeProperties$g2","call","table","getRowModel","rows","flatMap","filterFn","aggregatedCell","sortingFn","getSortingFn","sortDescFirst","sortUndefined","createInternalColumn","size","mapTableChildrenToColumns","options","internalColumns","_props$rowActions","enableRowExpansion","rowExpansionRenderer","rowExpansion","unshift","enableRowSelection","rowSelection","enableRowDrag","onRowDrag","rowDrag","enableRowActions","rowActions","length","configureReactTableOptions","reactTableEnableRowSelection","getRowId","rowIdentityAccessor","originalRow","index","String","tableOptions","defaultColumn","enableColumnHiding","enableColumnResizing","enableColumnFilters","_options$enableFilter","_options$enableColumn","enableExpanding","_options$enableRowExp","_options$enableColumn2","enablePinning","_options$enableColumn3","enableColumnFreezing","enableRowPinning","_options$enableSortin","getExpandedRowModel","getGroupedRowModel","groupedColumnMode","columnResizeMode","onChangeFilter","getFilteredRowModel","filterFns","tacoFilter","columnId","filter","columnFilterFn","globalFilterFn","searchQuery","getColumnCanGlobalFilter","_column$columnDef$met","columnDef","getIsVisible","onChangeSearch","_experimentalDataLoader2","manualFiltering","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","_props$defaultSetting6","sorting","_props$defaultSetting7","_props$defaultSetting8","grouping","expanded"],"mappings":";;;;;;;;;;AA4BA;AACA,SAASA,eAAeA,CACpBC,KAAiE,EACjEC,OAAqC,EACrCC,aAA0C,EAC1CC,cAAsC,EACtCC,iBAA4C,EAC5CC,QAAuB,EACvBC,uBAAgD,EAChDC,YAA0B;EAE1B,MAAMC,YAAY,GAAGC,kBAAkB,EAAS;EAEhD,iBAAIC,cAAK,CAACC,cAAc,CAAkBX,KAAK,CAAC,IAAIA,KAAK,CAACY,KAAK,CAACC,QAAQ,EAAE;IACtE,MAAM;MAAEA,QAAQ;MAAEC,EAAE;MAAEC;KAAQ,GAAGf,KAAK,CAACY,KAAK;IAE5CX,OAAO,CAACe,IAAI,CACRR,YAAY,CAACS,KAAK,CAAC;MACfH,EAAE;MACFC,MAAM;MACNd,OAAO,EAAES,cAAK,CAACQ,QAAQ,CAACC,OAAO,CAACN,QAAQ,CAAC,CAACO,MAAM,CAC5C,CAACnB,OAAqC,EAAED,KAAK,KACzCD,eAAe,CACXC,KAAK,EACLC,OAAO,EACPC,aAAa,EACbC,cAAc,EACdC,iBAAiB,EACjBC,QAAQ,EACRC,uBAAuB,EACvBC,YAAY,CACf,EACL,EAAE,CACL;;MAEDc,cAAc,EAAE;KACnB,CAAC,CACL;GACJ,MAAM,iBAAIX,cAAK,CAACC,cAAc,CAA0BX,KAAK,CAAC,KAAKA,KAAK,CAACY,KAA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kB,uBAAuB,CAAC,IAAAsC,sBAAA,IAAAC,sBAAA,GACzDhL,KAAK,CAACgJ,eAAe,cAAAgC,sBAAA,uBAArBA,sBAAA,CAAuBF,OAAO,cAAAC,sBAAA,cAAAA,sBAAA,GAAIxC,QAAQ,CAAChJ;KACpD;IAED,IAAIS,KAAK,CAACN,uBAAuB,EAAE;MAC/BiK,KAAK,CAACsB,QAAQ,GAAG,CAACjL,KAAK,CAACN,uBAAiC,CAAC;;MAE1DiK,KAAK,CAACuB,QAAQ,GAAG,IAAI;;IAGzB,OAAOvB,KAAK;GACf,EAAE,EAAE,CAAC;AACV;;;;"}
|
package/dist/index.css
CHANGED
@@ -752,14 +752,14 @@ table[data-taco^='table'] td:not([data-cell-truncate='true']) {
|
|
752
752
|
}
|
753
753
|
|
754
754
|
/* FOOTER */
|
755
|
-
table[data-taco^='table'] tfoot td {
|
755
|
+
table[data-taco^='table'] tfoot tr:not([data-row-index]) td {
|
756
756
|
/*
|
757
757
|
* Since footer has sticky position, the top and bottom padding ensures that the inner content doesn't come over
|
758
758
|
* the border of the footer row.
|
759
759
|
*/
|
760
760
|
@apply border-b-0 !py-1 font-bold;
|
761
761
|
}
|
762
|
-
table[data-taco^='table'] tfoot td:first-child {
|
762
|
+
table[data-taco^='table'] tfoot tr:not([data-row-index]) td:first-child {
|
763
763
|
@apply z-30 !pb-0 !pt-[2px];
|
764
764
|
}
|
765
765
|
|
package/dist/index.d.ts
CHANGED
@@ -63,6 +63,7 @@ export * from './components/Navigation2/Navigation2';
|
|
63
63
|
export * as CollectionPrimitive from './primitives/Collection/Collection';
|
64
64
|
export * from './primitives/Table/types';
|
65
65
|
export * from './primitives/Table/useTableDataLoader';
|
66
|
+
export * from './primitives/Table/useTableDataLoader2';
|
66
67
|
export * from './utils/date';
|
67
68
|
export * from './utils/keyboard';
|
68
69
|
export * from './utils/mergeRefs';
|
@@ -13,6 +13,7 @@ export declare namespace Table {
|
|
13
13
|
export declare type TableGridProps<TType = unknown> = React.TableHTMLAttributes<HTMLTableElement> & {
|
14
14
|
'data-taco': string;
|
15
15
|
enableHorizontalArrowKeyNavigation?: boolean;
|
16
|
+
footerRows?: null | JSX.Element | JSX.Element[];
|
16
17
|
table: useTableReturnValue<TType>;
|
17
18
|
};
|
18
19
|
export declare function TableGrid<TType = unknown>(props: TableGridProps<TType>): JSX.Element;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { Table as ReactTable
|
2
|
+
import { Table as ReactTable } from '@tanstack/react-table';
|
3
3
|
export declare type RowProps<TType = unknown> = {
|
4
4
|
index: number;
|
5
|
-
|
5
|
+
scrollDirection: 'forward' | 'backward' | undefined;
|
6
6
|
table: ReactTable<TType>;
|
7
7
|
};
|
8
8
|
export declare function SkeletonRow<TType = unknown>(props: RowProps<TType>): JSX.Element;
|
@@ -2,5 +2,7 @@ import React from 'react';
|
|
2
2
|
import { TableRowRenderer, TableRowRendererProps } from '../../types';
|
3
3
|
export declare type RowProps<TType = unknown> = React.HTMLAttributes<HTMLTableRowElement> & TableRowRendererProps<TType> & {
|
4
4
|
renderer: TableRowRenderer<TType>;
|
5
|
+
scrollDirection?: 'forward' | 'backward';
|
6
|
+
skipPageLoading?: boolean;
|
5
7
|
};
|
6
8
|
export declare function Row<TType = unknown>(props: RowProps<TType>): JSX.Element;
|
@@ -3,7 +3,7 @@ import { Table as ReactTable } from '@tanstack/react-table';
|
|
3
3
|
import { ScrollToOptions as ReactVirtualScrollToOptions } from '@tanstack/react-virtual';
|
4
4
|
import { useTableRenderers, useTableRenderOptions } from '../types';
|
5
5
|
import { TableRef } from '../../types';
|
6
|
-
export declare function useTableRenderer<TType = unknown>(renderers: useTableRenderers<TType>, table: ReactTable<TType>, tableRef: React.RefObject<TableRef>, defaultRowActiveIndex?: number | undefined, options?: useTableRenderOptions): {
|
6
|
+
export declare function useTableRenderer<TType = unknown>(renderers: useTableRenderers<TType>, table: ReactTable<TType>, tableRef: React.RefObject<TableRef>, length: number, defaultRowActiveIndex?: number | undefined, options?: useTableRenderOptions): {
|
7
7
|
rows: (JSX.Element | null)[] | null;
|
8
8
|
style: React.CSSProperties;
|
9
9
|
scrollToIndex: (index: number, options?: ReactVirtualScrollToOptions) => void;
|
@@ -67,7 +67,7 @@ export declare type TableRowDragHandler<TType = unknown> = (rows: TType[], showP
|
|
67
67
|
export declare type TableRowDropHandler<TType = unknown> = (event: React.DragEvent, row: TType) => void;
|
68
68
|
export declare type TableRowGotoHandler = (column: string, query: string, sorting: TableColumnSort[], filters: TableColumnFilter[], search: string | undefined) => Promise<number>;
|
69
69
|
export declare type TableRowHeight = 'short' | 'medium' | 'tall' | 'extra-tall';
|
70
|
-
export declare type TableRowSelectHandler<TType = unknown> = (rows: TType[]) => void;
|
70
|
+
export declare type TableRowSelectHandler<TType = unknown> = (rows: TType[], ids: (keyof TType)[]) => void;
|
71
71
|
export declare type TableRowWithMetaData<TType = unknown> = TType & {
|
72
72
|
_meta?: {
|
73
73
|
layout?: 'heading' | 'summary' | 'item';
|
@@ -79,16 +79,17 @@ export declare type TableShortcutHandlerObject<TType = unknown> = {
|
|
79
79
|
meta?: boolean;
|
80
80
|
shift?: boolean;
|
81
81
|
};
|
82
|
-
export declare type
|
82
|
+
export declare type TableSortHandler = (sorting: TableColumnSort[]) => Promise<void>;
|
83
|
+
export declare type TableFilterHandler = (filters: TableColumnFilter[], hiddenColumns: string[]) => Promise<void>;
|
84
|
+
export declare type TableSearchHandler = (search: string | undefined, hiddenColumns: string[]) => Promise<void>;
|
83
85
|
export declare type TableFontSize = keyof typeof FontSizes;
|
84
86
|
export declare type TablePreset = 'complex' | 'list' | 'simple';
|
85
87
|
export declare type TableRowExpansionRenderer<TType = unknown> = (row: TType) => (() => JSX.Element) | null;
|
86
88
|
export declare type TableScrollToIndexHandler = (index: number, options?: {
|
87
89
|
align: 'start' | 'center' | 'end' | 'auto';
|
88
90
|
}) => void;
|
89
|
-
export declare type
|
90
|
-
export declare type
|
91
|
-
export declare type TableServerLoadAllHandler = (sorting: TableColumnSort[], filters: TableColumnFilter[]) => Promise<void>;
|
91
|
+
export declare type TableServerLoadPageHandler = (pageIndex: number, sorting: TableColumnSort[], filters: TableColumnFilter[], search: string | undefined, hiddenColumns: string[]) => Promise<void>;
|
92
|
+
export declare type TableServerLoadAllHandler = (sorting: TableColumnSort[], filters: TableColumnFilter[], search: string | undefined, hiddenColumns: string[]) => Promise<void>;
|
92
93
|
export declare enum TableServerLoadAllState {
|
93
94
|
Incomplete = 0,
|
94
95
|
Loading = 1,
|
@@ -96,7 +97,6 @@ export declare enum TableServerLoadAllState {
|
|
96
97
|
}
|
97
98
|
export declare type TableSettingsHandler = (settings: TableSettings) => void | Promise<void>;
|
98
99
|
export declare type TableShortcuts<TType = unknown> = Record<string, TableShortcutHandlerFn<TType> | TableShortcutHandlerObject<TType>>;
|
99
|
-
export declare type TableSortHandler = (sorting: TableColumnSort[]) => void | Promise<void>;
|
100
100
|
export declare type TableCustomSettingsRenderer = (props: TableSettings) => React.ReactElement<MenuItemProps>[];
|
101
101
|
export declare type TableEmptyStateReason = 'empty' | 'filtering' | 'searching';
|
102
102
|
export declare type TableEmptyStateRenderer = (props: {
|
@@ -134,6 +134,7 @@ export declare type TableFeatureProps<TType = unknown> = {
|
|
134
134
|
enableColumnHiding?: boolean;
|
135
135
|
enableColumnResizing?: boolean;
|
136
136
|
enableRowExpansion?: boolean;
|
137
|
+
enableRowExpansionAll?: boolean;
|
137
138
|
enableRowSelection?: TableConditionalRowProp<TType>;
|
138
139
|
enableColumnOrdering?: boolean;
|
139
140
|
enableFontSize?: boolean;
|
@@ -184,12 +185,16 @@ export interface TableClientProps<TType = unknown> extends TableCommonProps<TTyp
|
|
184
185
|
loadAll?: never;
|
185
186
|
loadPage?: never;
|
186
187
|
pageSize?: never;
|
188
|
+
pages?: never;
|
189
|
+
_experimentalDataLoader2?: never;
|
187
190
|
}
|
188
191
|
export interface TableServerProps<TType = unknown> extends TableCommonProps<TType> {
|
189
192
|
length: number | undefined;
|
190
193
|
loadAll: TableServerLoadAllHandler;
|
191
194
|
loadPage: TableServerLoadPageHandler;
|
192
195
|
pageSize?: number;
|
196
|
+
pages?: number[];
|
197
|
+
_experimentalDataLoader2?: boolean;
|
193
198
|
}
|
194
199
|
export declare type TableProps<TType = unknown> = TableClientProps<TType> | TableServerProps<TType>;
|
195
200
|
export declare type TableColumnProps<TType = unknown> = ValueOf<{
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { TableColumnFilter, TableColumnSort, TableFilterHandler, TableServerLoadPageHandler, TableServerLoadAllHandler, TableSortHandler, TableSearchHandler } from './types';
|
2
|
+
import { useTableDataLoaderOptions } from './useTableDataLoader';
|
3
|
+
export declare type useTableDataPageFetcher2<TType = unknown> = (pageIndex: number, pageSize: number, sorting: TableColumnSort[], filters: TableColumnFilter[], search: string | undefined, hiddenColumns: string[]) => Promise<{
|
4
|
+
data: TType[];
|
5
|
+
length: number;
|
6
|
+
}>;
|
7
|
+
export declare type useTableDataAllFetcher2<TType = unknown> = (sorting: TableColumnSort[], filters: TableColumnFilter[], search: string | undefined, hiddenColumns: string[]) => Promise<{
|
8
|
+
data: TType[];
|
9
|
+
length: number;
|
10
|
+
}>;
|
11
|
+
export declare type useTableDataLoaderValues2<TType = unknown> = {
|
12
|
+
data: TType[];
|
13
|
+
length: number | undefined;
|
14
|
+
loadAll: TableServerLoadAllHandler;
|
15
|
+
loadPage: TableServerLoadPageHandler;
|
16
|
+
onChangeFilter: TableFilterHandler;
|
17
|
+
onChangeSearch: TableSearchHandler;
|
18
|
+
onChangeSort: TableSortHandler;
|
19
|
+
pageSize: number;
|
20
|
+
pages: number[];
|
21
|
+
_experimentalDataLoader2: boolean;
|
22
|
+
};
|
23
|
+
export declare function useTableDataLoader2<TType = unknown>(fetchPage: useTableDataPageFetcher2<TType>, fetchAll: useTableDataAllFetcher2<TType>, options?: useTableDataLoaderOptions): [useTableDataLoaderValues2<TType>, () => void];
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { TableRowExpansionRenderer } from '../../types';
|
2
|
-
export declare function useTableRowExpansion<TType = unknown>(isEnabled?: boolean, rowExpansionRenderer?: TableRowExpansionRenderer<TType>): {
|
2
|
+
export declare function useTableRowExpansion<TType = unknown>(isEnabled?: boolean, canExpandAll?: boolean, rowExpansionRenderer?: TableRowExpansionRenderer<TType>): {
|
3
3
|
isEnabled: boolean;
|
4
|
+
canExpandAll: boolean;
|
4
5
|
rowExpansionRenderer: TableRowExpansionRenderer<TType> | undefined;
|
5
6
|
};
|
@@ -1,11 +1,13 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { Table as ReactTable } from '@tanstack/react-table';
|
3
|
-
|
3
|
+
import { TableSearchHandler } from '../../types';
|
4
|
+
export declare function useTableSearch<TType = unknown>(isEnabled: boolean | undefined, onChangeSearch: TableSearchHandler | undefined, defaultEnableGlobalFilter?: boolean): {
|
4
5
|
isEnabled: boolean;
|
5
6
|
enableGlobalFilter: boolean;
|
6
|
-
setEnableGlobalFilter: <
|
7
|
+
setEnableGlobalFilter: <T extends TType>(enabled: boolean, instance: ReactTable<T>) => void;
|
7
8
|
highlightedColumnIndexes: number[][];
|
8
9
|
setHighlightedColumnIndexes: React.Dispatch<React.SetStateAction<number[][]>>;
|
9
10
|
currentHighlightColumnIndex: number | undefined;
|
10
11
|
setCurrentHighlightColumnIndex: React.Dispatch<React.SetStateAction<number | undefined>>;
|
12
|
+
handleSearch: TableSearchHandler | undefined;
|
11
13
|
};
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { TableServerLoadAllHandler, TableServerLoadAllState, TableServerLoadPageHandler } from '../../types';
|
2
|
-
export declare function useTableServerLoading(loadPage?: TableServerLoadPageHandler, loadAll?: TableServerLoadAllHandler, pageSize?: number): {
|
2
|
+
export declare function useTableServerLoading(loadPage?: TableServerLoadPageHandler, loadAll?: TableServerLoadAllHandler, pages?: number[], pageSize?: number, _experimentalDataLoader2?: boolean): {
|
3
|
+
pages: number[] | undefined;
|
3
4
|
isEnabled: boolean;
|
4
5
|
isReady: boolean;
|
5
6
|
loadPage: TableServerLoadPageHandler | undefined;
|
@@ -7,4 +8,5 @@ export declare function useTableServerLoading(loadPage?: TableServerLoadPageHand
|
|
7
8
|
loadAllIfNeeded: TableServerLoadAllHandler | undefined;
|
8
9
|
loadAllStatus: TableServerLoadAllState;
|
9
10
|
pageSize: number;
|
11
|
+
_experimentalDataLoader2: boolean;
|
10
12
|
};
|
@@ -1,3 +1,2 @@
|
|
1
1
|
import { Table as ReactTable } from '@tanstack/react-table';
|
2
|
-
|
3
|
-
export declare function useTableSearchListener<TType = unknown>(table: ReactTable<TType>, onChangeSearch?: TableSearchHandler): void;
|
2
|
+
export declare function useTableSearchListener<TType = unknown>(table: ReactTable<TType>): void;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ColumnDef as ReactTableColumnDef } from '@tanstack/react-table';
|
1
|
+
import { ColumnDef as ReactTableColumnDef, VisibilityState as ReactTableVisibilityState } from '@tanstack/react-table';
|
2
2
|
import { FontSize } from '../../../../types';
|
3
3
|
import { TableColumnDataType } from '../../types';
|
4
4
|
import { Localization } from '../../../../components/Provider/Localization';
|
@@ -8,3 +8,4 @@ export declare function isCellHighlighted(query: string, value: unknown, dataTyp
|
|
8
8
|
export declare function ensureOrdering<TType = unknown>(columns: ReactTableColumnDef<TType>[], settingsOrder: string[] | undefined, pinnedOrder?: string[] | undefined, internalColumnsPinnedToTheRight?: string[]): string[];
|
9
9
|
export declare function unfreezeAllExternalColumns(leftPinnedState?: string[]): string[];
|
10
10
|
export declare function freezeUptoExternalColumn(index: number, columns: string[]): string[];
|
11
|
+
export declare function getHiddenColumns(columnVisibility?: ReactTableVisibilityState): string[];
|