@economic/taco 2.29.2 → 2.29.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,9 @@
1
1
  import React__default from 'react';
2
2
  import { v4 } from 'uuid';
3
+ import get from 'lodash-es/get';
3
4
  import set from 'lodash-es/set';
4
5
  import { convertRowIndexPathToNumberArray, getByRowIndexPath, getParentRowIndexPath } from '../util/rowIndexPath.js';
5
6
  import unset from 'lodash-es/unset';
6
- import get from 'lodash-es/get';
7
7
  import compact from 'lodash-es/compact';
8
8
  import pullAt from 'lodash-es/pullAt';
9
9
 
@@ -1,5 +1,6 @@
1
1
  import React__default from 'react';
2
2
  import { getExpandedRowModel, getGroupedRowModel, getFilteredRowModel, getSortedRowModel, createColumnHelper } from '@tanstack/react-table';
3
+ import get from 'lodash-es/get';
3
4
  import { getSortingFn } from './sorting.js';
4
5
  import { ensureOrdering, freezeUptoExternalColumn, unfreezeAllExternalColumns, getCellMinWidth } from './columns.js';
5
6
  import { columnFilterFn, globalFilterFn } from './filtering.js';
@@ -65,7 +66,7 @@ function processChildren(child, columns, defaultSizing, defaultSorting, defaultV
65
66
  id,
66
67
  accessorKey,
67
68
  // To avoid errors caused by undefined row data values, we pass accessorFn as a preventive measure
68
- accessorFn: row => row === null || row === void 0 ? void 0 : row[accessorKey],
69
+ accessorFn: row => get(row, accessorKey),
69
70
  header: header,
70
71
  // features
71
72
  enableColumnFilter,
@@ -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 { useTableManagerInternalColumns, useTableManagerInternalColumn } from '../types';\nimport { TableColumnProps, TableFeatureProps, TableGroupProps, TableProps, TableSettings } from '../../types';\nimport { getSortingFn } from './sorting';\nimport { ensureOrdering, freezeUptoExternalColumn, getCellMinWidth, unfreezeAllExternalColumns } from './columns';\nimport { columnFilterFn, globalFilterFn } from './filtering';\nimport { ignoreInternalColumns } from './settings';\n\n// mapping children to react-table columns\nfunction processChildren<TType>(\n child: React.ReactChild | React.ReactFragment | React.ReactPortal,\n columns: ReactTableColumnDef<TType>[],\n defaultSizing: ReactTableColumnSizingState,\n defaultSorting: ReactTableColumnSort[],\n defaultVisibility: ReactTableVisibilityState,\n settings: TableSettings,\n defaultRowGroupColumnId?: keyof TType\n): ReactTableColumnDef<TType>[] {\n const columnHelper = createColumnHelper<TType>();\n\n if (React.isValidElement<TableGroupProps>(child) && child.props.children) {\n const { children, id, header } = child.props;\n\n columns.push(\n columnHelper.group({\n id,\n header,\n columns: React.Children.toArray(children).reduce(\n (columns: ReactTableColumnDef<TType>[], child) =>\n processChildren<TType>(\n child,\n columns,\n defaultSizing,\n defaultSorting,\n defaultVisibility,\n settings,\n defaultRowGroupColumnId\n ),\n []\n ),\n // we don't want to let column groups be grouped/aggregrated\n enableGrouping: false,\n })\n );\n } else if (React.isValidElement<TableColumnProps<TType>>(child) && (child.props.accessor || child.props.id)) {\n const {\n id,\n accessor: accessorKey = id,\n // renderers\n renderer,\n aggregate,\n footer,\n header,\n // options\n aggregationFn,\n defaultHidden,\n defaultWidth,\n enableFiltering: enableColumnFilter = true,\n enableGrouping = false,\n enableHiding = true,\n enableOrdering = true,\n enablePrinting = true,\n enableResizing = true,\n enableSearch: enableGlobalFilter = true,\n enableSorting = true,\n enableTruncate = false,\n minWidth: minSize = getCellMinWidth(settings.fontSize),\n sort,\n sortFn,\n ...meta\n } = child.props;\n\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 accessorFn: row => row?.[accessorKey as string],\n header: header,\n // features\n enableColumnFilter,\n enableGlobalFilter,\n enableGrouping,\n enableHiding: isGrouped ? false : enableHiding,\n enableResizing,\n enableSorting,\n // config - sizing\n minSize,\n // meta\n meta: {\n ...(meta as any),\n defaultWidth,\n enableOrdering: isGrouped ? false : enableOrdering,\n enablePrinting,\n enableTruncate,\n header,\n renderer,\n },\n };\n\n // renderers\n if (typeof renderer === 'function') {\n column.cell = info => renderer(info.getValue(), info.row.original);\n }\n\n if (typeof footer === 'function') {\n column.footer = info =>\n footer(\n info.table.getRowModel().rows.flatMap(row => (row.original?.[id] !== undefined ? [row.original[id]] : []))\n );\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,\n internalColumns?: useTableManagerInternalColumns<TType>\n) {\n const { children, defaultRowGroupColumnId } = props;\n const defaultSizing: ReactTableColumnSizingState = {};\n const defaultSorting: ReactTableColumnSort[] = [];\n const defaultVisibility: ReactTableVisibilityState = {};\n\n const columns = React.Children.toArray(children).reduce(\n (columns: ReactTableColumnDef<TType>[], child) =>\n processChildren<TType>(\n child,\n columns,\n defaultSizing,\n defaultSorting,\n defaultVisibility,\n settings,\n defaultRowGroupColumnId\n ),\n\n []\n );\n\n if (internalColumns) {\n if (options.enableRowExpansion && props.rowExpansionRenderer && internalColumns.rowExpansion) {\n const column = createInternalColumn<TType>('__expansion', internalColumns.rowExpansion, defaultSizing);\n columns.unshift(column);\n }\n\n if ((options.enableRowSelection || options.enableRowSelectionSingle) && internalColumns.rowSelection) {\n const column = createInternalColumn<TType>('__select', internalColumns.rowSelection, defaultSizing);\n columns.unshift(column);\n }\n\n if (options.enableRowDrag && props.onRowDrag && internalColumns.rowDrag) {\n const column = createInternalColumn<TType>('__drag', internalColumns.rowDrag, defaultSizing);\n columns.unshift(column);\n }\n\n if (options.enableRowActions && props.rowActions?.length && internalColumns.rowActions) {\n const column = createInternalColumn<TType>('__actions', internalColumns.rowActions, defaultSizing);\n columns.push(column);\n }\n }\n\n return { columns, defaultSizing, defaultSorting, defaultVisibility };\n}\n\nexport function configureReactTableOptions<TType = unknown>(options: TableFeatureProps, props: TableProps<TType>) {\n const enableRowSelection = options.enableRowSelection || options.enableRowSelectionSingle;\n const tableOptions: Partial<ReactTableOptions<TType>> = {\n defaultColumn: {\n enableColumnFilter: options.enableFiltering || true,\n enableGrouping: false,\n enableHiding: options.enableColumnHiding || true,\n enableResizing: options.enableColumnResizing || true,\n enableGlobalFilter: options.enableSearch || true,\n enableSorting: options.enableSorting || true,\n minSize: 1,\n // the default is 150, which is a bit random\n size: 1,\n },\n enableColumnFilters: options.enableFiltering ?? false,\n enableColumnResizing: options.enableColumnResizing ?? false,\n enableExpanding: options.enableRowExpansion ?? false,\n enableGrouping: true, // users can't customise row grouping, so it can just be always enabled and left to the defaultRowGroupColumnId prop\n enableHiding: options.enableColumnHiding ?? false,\n enablePinning: options.enableColumnFreezing ?? false,\n enableRowSelection: enableRowSelection ?? false,\n enableMultiRowSelection: options.enableRowSelectionSingle === true ? false : enableRowSelection,\n enableSorting: options.enableSorting ?? false,\n // models for default features\n getExpandedRowModel: getExpandedRowModel<TType>(),\n getGroupedRowModel: getGroupedRowModel<TType>(),\n groupedColumnMode: false,\n };\n\n if (tableOptions.enableColumnResizing) {\n tableOptions.columnResizeMode = 'onChange';\n }\n\n if (tableOptions.enableColumnFilters) {\n // enter controlled filter mode (controlled could be local state, but usually the server)\n if (props.onChangeFilter) {\n // tableOptions.manualFiltering = true;\n // we don't set it because it breaks global filtering (used for search, which is fully client side)\n //\n // tableOptions.onColumnFiltersChange = ...\n // we don't set this because it expects state to be maintained externally, and we don't want\n // consumers to control state outside the table. instead we have a listener that calls onFilter\n } else {\n tableOptions.getFilteredRowModel = getFilteredRowModel<TType>();\n tableOptions.filterFns = {\n tacoFilter: (row: ReactTableRow<TType>, columnId: string, filter: any) =>\n columnFilterFn(row.getValue(columnId), filter),\n };\n }\n }\n\n if (options.enableSearch) {\n // always set these because enableGlobalFilter can be toggled on and off by the user\n tableOptions.getFilteredRowModel = getFilteredRowModel<TType>();\n tableOptions.globalFilterFn = globalFilterFn;\n tableOptions.getColumnCanGlobalFilter = (column: ReactTableColumn<TType>) => column.columnDef.meta?.enableSearch ?? true;\n\n // enter controlled search mode (controlled could be local state, but usually the server)\n if (props.onChangeSearch) {\n // tableOptions.manualFiltering = true;\n // we don't set this because controlled search is not currently supported, search is always client side\n //\n // tableOptions.onGlobalFilterChange = ...\n // we don't set this because it expects state to be maintained externally, and we don't want\n // consumers to control state outside the table. instead we have a listener that calls onSearch.\n //\n // we also don't always filter when searching, we have the highlight functionality as the default\n // and filtering can be toggled by the user\n }\n }\n\n if (tableOptions.enableSorting) {\n // enter controlled sort mode (controlled could be local state, but usually the server)\n if (props.onChangeSort) {\n tableOptions.manualSorting = true;\n\n // tableOptions.onSortingChange = ...\n // we don't set this because it expects state to be maintained externally, and we don't want\n // consumers to control state outside the table. instead we have a listener that calls onSort\n } else {\n tableOptions.getSortedRowModel = getSortedRowModel();\n }\n }\n\n return tableOptions;\n}\n\nexport function useReactTableInitialState<TType = unknown>(\n props: TableProps<TType>,\n columns: ReactTableColumnDef<TType>[],\n persistedSettings: TableSettings,\n defaults: {\n defaultSizing: ReactTableColumnSizingState;\n defaultSorting: ReactTableColumnSort[];\n defaultVisibility: ReactTableVisibilityState;\n }\n): Partial<ReactTableState> {\n return React.useMemo(() => {\n const ignoreNotDefinedColumns = column => columns.find(definedColumn => definedColumn.id === column.id);\n\n const columnPinning: ReactTableColumnPinningState =\n persistedSettings.columnPinning ?? props.defaultSettings?.columnPinning ?? {};\n\n const columnOrder = ensureOrdering<TType>(\n columns,\n persistedSettings.columnOrder ?? props.defaultSettings?.columnOrder,\n columnPinning.left\n );\n\n // ensure internal columns are pinned, and are pinned in the correct order\n if (columnPinning?.left?.length) {\n columnPinning.left = freezeUptoExternalColumn(\n columnOrder.indexOf(columnPinning.left[columnPinning.left.length - 1]),\n columnOrder\n );\n } else {\n if (props.defaultColumnFreezingIndex) {\n columnPinning.left = freezeUptoExternalColumn(props.defaultColumnFreezingIndex, columnOrder);\n } else {\n columnPinning.left = unfreezeAllExternalColumns(columnOrder);\n }\n }\n\n const state: Partial<ReactTableState> = {\n columnFilters: persistedSettings.columnFilters ?? props.defaultSettings?.columnFilters ?? [],\n columnOrder,\n columnPinning,\n columnSizing: ignoreInternalColumns(\n persistedSettings.columnSizing ?? props.defaultSettings?.columnSizing ?? defaults.defaultSizing ?? {}\n ),\n columnVisibility:\n persistedSettings.columnVisibility ?? props.defaultSettings?.columnVisibility ?? defaults.defaultVisibility ?? {},\n globalFilter: persistedSettings.searchQuery ?? props.defaultSettings?.searchQuery,\n sorting: persistedSettings.sorting\n ? persistedSettings.sorting.filter(ignoreNotDefinedColumns)\n : props.defaultSettings?.sorting ?? defaults.defaultSorting,\n };\n\n if (props.defaultRowGroupColumnId) {\n state.grouping = [props.defaultRowGroupColumnId as string];\n // row groups should (all) always be expanded by default\n state.expanded = true;\n }\n\n return state;\n }, []);\n}\n"],"names":["processChildren","child","columns","defaultSizing","defaultSorting","defaultVisibility","settings","defaultRowGroupColumnId","columnHelper","createColumnHelper","React","isValidElement","props","children","id","header","push","group","Children","toArray","reduce","enableGrouping","accessor","accessorKey","renderer","aggregate","footer","aggregationFn","defaultHidden","defaultWidth","enableFiltering","enableColumnFilter","enableHiding","enableOrdering","enablePrinting","enableResizing","enableSearch","enableGlobalFilter","enableSorting","enableTruncate","minWidth","minSize","getCellMinWidth","fontSize","sort","sortFn","meta","isGrouped","undefined","desc","column","accessorFn","row","cell","info","getValue","original","table","getRowModel","rows","flatMap","_row$original","filterFn","aggregatedCell","sortingFn","getSortingFn","dataType","sortDescFirst","sortUndefined","createInternalColumn","size","mapTableChildrenToColumns","options","internalColumns","_props$rowActions","enableRowExpansion","rowExpansionRenderer","rowExpansion","unshift","enableRowSelection","enableRowSelectionSingle","rowSelection","enableRowDrag","onRowDrag","rowDrag","enableRowActions","rowActions","length","configureReactTableOptions","tableOptions","defaultColumn","enableColumnHiding","enableColumnResizing","enableColumnFilters","_options$enableFilter","_options$enableColumn","enableExpanding","_options$enableRowExp","_options$enableColumn2","enablePinning","_options$enableColumn3","enableColumnFreezing","enableMultiRowSelection","_options$enableSortin","getExpandedRowModel","getGroupedRowModel","groupedColumnMode","columnResizeMode","onChangeFilter","getFilteredRowModel","filterFns","tacoFilter","columnId","filter","columnFilterFn","globalFilterFn","getColumnCanGlobalFilter","_column$columnDef$met","_column$columnDef$met2","columnDef","onChangeSort","manualSorting","getSortedRowModel","useReactTableInitialState","persistedSettings","defaults","useMemo","ignoreNotDefinedColumns","find","definedColumn","columnPinning","_ref","_persistedSettings$co","_props$defaultSetting","defaultSettings","columnOrder","ensureOrdering","_persistedSettings$co2","_props$defaultSetting2","left","_columnPinning$left","freezeUptoExternalColumn","indexOf","defaultColumnFreezingIndex","unfreezeAllExternalColumns","state","columnFilters","_ref2","_persistedSettings$co3","_props$defaultSetting3","columnSizing","ignoreInternalColumns","_ref3","_ref4","_persistedSettings$co4","_props$defaultSetting4","columnVisibility","_ref5","_ref6","_persistedSettings$co5","_props$defaultSetting5","globalFilter","_persistedSettings$se","searchQuery","_props$defaultSetting6","sorting","_props$defaultSetting7","_props$defaultSetting8","grouping","expanded"],"mappings":";;;;;;;AAwBA;AACA,SAASA,eAAeA,CACpBC,KAAiE,EACjEC,OAAqC,EACrCC,aAA0C,EAC1CC,cAAsC,EACtCC,iBAA4C,EAC5CC,QAAuB,EACvBC,uBAAqC;EAErC,MAAMC,YAAY,GAAGC,kBAAkB,EAAS;EAEhD,kBAAIC,cAAK,CAACC,cAAc,CAAkBV,KAAK,CAAC,IAAIA,KAAK,CAACW,KAAK,CAACC,QAAQ,EAAE;IACtE,MAAM;MAAEA,QAAQ;MAAEC,EAAE;MAAEC;KAAQ,GAAGd,KAAK,CAACW,KAAK;IAE5CV,OAAO,CAACc,IAAI,CACRR,YAAY,CAACS,KAAK,CAAC;MACfH,EAAE;MACFC,MAAM;MACNb,OAAO,EAAEQ,cAAK,CAACQ,QAAQ,CAACC,OAAO,CAACN,QAAQ,CAAC,CAACO,MAAM,CAC5C,CAAClB,OAAqC,EAAED,KAAK,KACzCD,eAAe,CACXC,KAAK,EACLC,OAAO,EACPC,aAAa,EACbC,cAAc,EACdC,iBAAiB,EACjBC,QAAQ,EACRC,uBAAuB,CAC1B,EACL,EAAE,CACL;;MAEDc,cAAc,EAAE;KACnB,CAAC,CACL;GACJ,MA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AAO,EAAEzC,iBAAiB,CAACyC,OAAO,GAC5BzC,iBAAiB,CAACyC,OAAO,CAACpD,MAAM,CAACc,uBAAuB,CAAC,IAAAuC,sBAAA,IAAAC,sBAAA,GACzD3J,KAAK,CAAC0H,eAAe,cAAAiC,sBAAA,uBAArBA,sBAAA,CAAuBF,OAAO,cAAAC,sBAAA,cAAAA,sBAAA,GAAIzC,QAAQ,CAACzH;KACpD;IAED,IAAIQ,KAAK,CAACL,uBAAuB,EAAE;MAC/B0I,KAAK,CAACuB,QAAQ,GAAG,CAAC5J,KAAK,CAACL,uBAAiC,CAAC;;MAE1D0I,KAAK,CAACwB,QAAQ,GAAG,IAAI;;IAGzB,OAAOxB,KAAK;GACf,EAAE,EAAE,CAAC;AACV;;;;"}
1
+ {"version":3,"file":"setup.js","sources":["../../../../../../../../../src/primitives/Table/useTableManager/util/setup.ts"],"sourcesContent":["import React from 'react';\nimport {\n createColumnHelper,\n getExpandedRowModel,\n getFilteredRowModel,\n getGroupedRowModel,\n getSortedRowModel,\n TableOptions as ReactTableOptions,\n Row as ReactTableRow,\n Column as ReactTableColumn,\n ColumnDef as ReactTableColumnDef,\n ColumnPinningState as ReactTableColumnPinningState,\n ColumnSizingState as ReactTableColumnSizingState,\n ColumnSort as ReactTableColumnSort,\n TableState as ReactTableState,\n VisibilityState as ReactTableVisibilityState,\n} from '@tanstack/react-table';\nimport get from 'lodash/get';\n\nimport { useTableManagerInternalColumns, useTableManagerInternalColumn } from '../types';\nimport { TableColumnProps, TableFeatureProps, TableGroupProps, TableProps, TableSettings } from '../../types';\nimport { getSortingFn } from './sorting';\nimport { ensureOrdering, freezeUptoExternalColumn, getCellMinWidth, unfreezeAllExternalColumns } from './columns';\nimport { columnFilterFn, globalFilterFn } from './filtering';\nimport { ignoreInternalColumns } from './settings';\n\n// mapping children to react-table columns\nfunction processChildren<TType>(\n child: React.ReactChild | React.ReactFragment | React.ReactPortal,\n columns: ReactTableColumnDef<TType>[],\n defaultSizing: ReactTableColumnSizingState,\n defaultSorting: ReactTableColumnSort[],\n defaultVisibility: ReactTableVisibilityState,\n settings: TableSettings,\n defaultRowGroupColumnId?: keyof TType\n): ReactTableColumnDef<TType>[] {\n const columnHelper = createColumnHelper<TType>();\n\n if (React.isValidElement<TableGroupProps>(child) && child.props.children) {\n const { children, id, header } = child.props;\n\n columns.push(\n columnHelper.group({\n id,\n header,\n columns: React.Children.toArray(children).reduce(\n (columns: ReactTableColumnDef<TType>[], child) =>\n processChildren<TType>(\n child,\n columns,\n defaultSizing,\n defaultSorting,\n defaultVisibility,\n settings,\n defaultRowGroupColumnId\n ),\n []\n ),\n // we don't want to let column groups be grouped/aggregrated\n enableGrouping: false,\n })\n );\n } else if (React.isValidElement<TableColumnProps<TType>>(child) && (child.props.accessor || child.props.id)) {\n const {\n id,\n accessor: accessorKey = id,\n // renderers\n renderer,\n aggregate,\n footer,\n header,\n // options\n aggregationFn,\n defaultHidden,\n defaultWidth,\n enableFiltering: enableColumnFilter = true,\n enableGrouping = false,\n enableHiding = true,\n enableOrdering = true,\n enablePrinting = true,\n enableResizing = true,\n enableSearch: enableGlobalFilter = true,\n enableSorting = true,\n enableTruncate = false,\n minWidth: minSize = getCellMinWidth(settings.fontSize),\n sort,\n sortFn,\n ...meta\n } = child.props;\n\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 accessorFn: row => get(row, accessorKey),\n header: header,\n // features\n enableColumnFilter,\n enableGlobalFilter,\n enableGrouping,\n enableHiding: isGrouped ? false : enableHiding,\n enableResizing,\n enableSorting,\n // config - sizing\n minSize,\n // meta\n meta: {\n ...(meta as any),\n defaultWidth,\n enableOrdering: isGrouped ? false : enableOrdering,\n enablePrinting,\n enableTruncate,\n header,\n renderer,\n },\n };\n\n // renderers\n if (typeof renderer === 'function') {\n column.cell = info => renderer(info.getValue(), info.row.original);\n }\n\n if (typeof footer === 'function') {\n column.footer = info =>\n footer(\n info.table.getRowModel().rows.flatMap(row => (row.original?.[id] !== undefined ? [row.original[id]] : []))\n );\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,\n internalColumns?: useTableManagerInternalColumns<TType>\n) {\n const { children, defaultRowGroupColumnId } = props;\n const defaultSizing: ReactTableColumnSizingState = {};\n const defaultSorting: ReactTableColumnSort[] = [];\n const defaultVisibility: ReactTableVisibilityState = {};\n\n const columns = React.Children.toArray(children).reduce(\n (columns: ReactTableColumnDef<TType>[], child) =>\n processChildren<TType>(\n child,\n columns,\n defaultSizing,\n defaultSorting,\n defaultVisibility,\n settings,\n defaultRowGroupColumnId\n ),\n\n []\n );\n\n if (internalColumns) {\n if (options.enableRowExpansion && props.rowExpansionRenderer && internalColumns.rowExpansion) {\n const column = createInternalColumn<TType>('__expansion', internalColumns.rowExpansion, defaultSizing);\n columns.unshift(column);\n }\n\n if ((options.enableRowSelection || options.enableRowSelectionSingle) && internalColumns.rowSelection) {\n const column = createInternalColumn<TType>('__select', internalColumns.rowSelection, defaultSizing);\n columns.unshift(column);\n }\n\n if (options.enableRowDrag && props.onRowDrag && internalColumns.rowDrag) {\n const column = createInternalColumn<TType>('__drag', internalColumns.rowDrag, defaultSizing);\n columns.unshift(column);\n }\n\n if (options.enableRowActions && props.rowActions?.length && internalColumns.rowActions) {\n const column = createInternalColumn<TType>('__actions', internalColumns.rowActions, defaultSizing);\n columns.push(column);\n }\n }\n\n return { columns, defaultSizing, defaultSorting, defaultVisibility };\n}\n\nexport function configureReactTableOptions<TType = unknown>(options: TableFeatureProps, props: TableProps<TType>) {\n const enableRowSelection = options.enableRowSelection || options.enableRowSelectionSingle;\n const tableOptions: Partial<ReactTableOptions<TType>> = {\n defaultColumn: {\n enableColumnFilter: options.enableFiltering || true,\n enableGrouping: false,\n enableHiding: options.enableColumnHiding || true,\n enableResizing: options.enableColumnResizing || true,\n enableGlobalFilter: options.enableSearch || true,\n enableSorting: options.enableSorting || true,\n minSize: 1,\n // the default is 150, which is a bit random\n size: 1,\n },\n enableColumnFilters: options.enableFiltering ?? false,\n enableColumnResizing: options.enableColumnResizing ?? false,\n enableExpanding: options.enableRowExpansion ?? false,\n enableGrouping: true, // users can't customise row grouping, so it can just be always enabled and left to the defaultRowGroupColumnId prop\n enableHiding: options.enableColumnHiding ?? false,\n enablePinning: options.enableColumnFreezing ?? false,\n enableRowSelection: enableRowSelection ?? false,\n enableMultiRowSelection: options.enableRowSelectionSingle === true ? false : enableRowSelection,\n enableSorting: options.enableSorting ?? false,\n // models for default features\n getExpandedRowModel: getExpandedRowModel<TType>(),\n getGroupedRowModel: getGroupedRowModel<TType>(),\n groupedColumnMode: false,\n };\n\n if (tableOptions.enableColumnResizing) {\n tableOptions.columnResizeMode = 'onChange';\n }\n\n if (tableOptions.enableColumnFilters) {\n // enter controlled filter mode (controlled could be local state, but usually the server)\n if (props.onChangeFilter) {\n // tableOptions.manualFiltering = true;\n // we don't set it because it breaks global filtering (used for search, which is fully client side)\n //\n // tableOptions.onColumnFiltersChange = ...\n // we don't set this because it expects state to be maintained externally, and we don't want\n // consumers to control state outside the table. instead we have a listener that calls onFilter\n } else {\n tableOptions.getFilteredRowModel = getFilteredRowModel<TType>();\n tableOptions.filterFns = {\n tacoFilter: (row: ReactTableRow<TType>, columnId: string, filter: any) =>\n columnFilterFn(row.getValue(columnId), filter),\n };\n }\n }\n\n if (options.enableSearch) {\n // always set these because enableGlobalFilter can be toggled on and off by the user\n tableOptions.getFilteredRowModel = getFilteredRowModel<TType>();\n tableOptions.globalFilterFn = globalFilterFn;\n tableOptions.getColumnCanGlobalFilter = (column: ReactTableColumn<TType>) => column.columnDef.meta?.enableSearch ?? true;\n\n // enter controlled search mode (controlled could be local state, but usually the server)\n if (props.onChangeSearch) {\n // tableOptions.manualFiltering = true;\n // we don't set this because controlled search is not currently supported, search is always client side\n //\n // tableOptions.onGlobalFilterChange = ...\n // we don't set this because it expects state to be maintained externally, and we don't want\n // consumers to control state outside the table. instead we have a listener that calls onSearch.\n //\n // we also don't always filter when searching, we have the highlight functionality as the default\n // and filtering can be toggled by the user\n }\n }\n\n if (tableOptions.enableSorting) {\n // enter controlled sort mode (controlled could be local state, but usually the server)\n if (props.onChangeSort) {\n tableOptions.manualSorting = true;\n\n // tableOptions.onSortingChange = ...\n // we don't set this because it expects state to be maintained externally, and we don't want\n // consumers to control state outside the table. instead we have a listener that calls onSort\n } else {\n tableOptions.getSortedRowModel = getSortedRowModel();\n }\n }\n\n return tableOptions;\n}\n\nexport function useReactTableInitialState<TType = unknown>(\n props: TableProps<TType>,\n columns: ReactTableColumnDef<TType>[],\n persistedSettings: TableSettings,\n defaults: {\n defaultSizing: ReactTableColumnSizingState;\n defaultSorting: ReactTableColumnSort[];\n defaultVisibility: ReactTableVisibilityState;\n }\n): Partial<ReactTableState> {\n return React.useMemo(() => {\n const ignoreNotDefinedColumns = column => columns.find(definedColumn => definedColumn.id === column.id);\n\n const columnPinning: ReactTableColumnPinningState =\n persistedSettings.columnPinning ?? props.defaultSettings?.columnPinning ?? {};\n\n const columnOrder = ensureOrdering<TType>(\n columns,\n persistedSettings.columnOrder ?? props.defaultSettings?.columnOrder,\n columnPinning.left\n );\n\n // ensure internal columns are pinned, and are pinned in the correct order\n if (columnPinning?.left?.length) {\n columnPinning.left = freezeUptoExternalColumn(\n columnOrder.indexOf(columnPinning.left[columnPinning.left.length - 1]),\n columnOrder\n );\n } else {\n if (props.defaultColumnFreezingIndex) {\n columnPinning.left = freezeUptoExternalColumn(props.defaultColumnFreezingIndex, columnOrder);\n } else {\n columnPinning.left = unfreezeAllExternalColumns(columnOrder);\n }\n }\n\n const state: Partial<ReactTableState> = {\n columnFilters: persistedSettings.columnFilters ?? props.defaultSettings?.columnFilters ?? [],\n columnOrder,\n columnPinning,\n columnSizing: ignoreInternalColumns(\n persistedSettings.columnSizing ?? props.defaultSettings?.columnSizing ?? defaults.defaultSizing ?? {}\n ),\n columnVisibility:\n persistedSettings.columnVisibility ?? props.defaultSettings?.columnVisibility ?? defaults.defaultVisibility ?? {},\n globalFilter: persistedSettings.searchQuery ?? props.defaultSettings?.searchQuery,\n sorting: persistedSettings.sorting\n ? persistedSettings.sorting.filter(ignoreNotDefinedColumns)\n : props.defaultSettings?.sorting ?? defaults.defaultSorting,\n };\n\n if (props.defaultRowGroupColumnId) {\n state.grouping = [props.defaultRowGroupColumnId as string];\n // row groups should (all) always be expanded by default\n state.expanded = true;\n }\n\n return state;\n }, []);\n}\n"],"names":["processChildren","child","columns","defaultSizing","defaultSorting","defaultVisibility","settings","defaultRowGroupColumnId","columnHelper","createColumnHelper","React","isValidElement","props","children","id","header","push","group","Children","toArray","reduce","enableGrouping","accessor","accessorKey","renderer","aggregate","footer","aggregationFn","defaultHidden","defaultWidth","enableFiltering","enableColumnFilter","enableHiding","enableOrdering","enablePrinting","enableResizing","enableSearch","enableGlobalFilter","enableSorting","enableTruncate","minWidth","minSize","getCellMinWidth","fontSize","sort","sortFn","meta","isGrouped","undefined","desc","column","accessorFn","row","get","cell","info","getValue","original","table","getRowModel","rows","flatMap","_row$original","filterFn","aggregatedCell","sortingFn","getSortingFn","dataType","sortDescFirst","sortUndefined","createInternalColumn","size","mapTableChildrenToColumns","options","internalColumns","_props$rowActions","enableRowExpansion","rowExpansionRenderer","rowExpansion","unshift","enableRowSelection","enableRowSelectionSingle","rowSelection","enableRowDrag","onRowDrag","rowDrag","enableRowActions","rowActions","length","configureReactTableOptions","tableOptions","defaultColumn","enableColumnHiding","enableColumnResizing","enableColumnFilters","_options$enableFilter","_options$enableColumn","enableExpanding","_options$enableRowExp","_options$enableColumn2","enablePinning","_options$enableColumn3","enableColumnFreezing","enableMultiRowSelection","_options$enableSortin","getExpandedRowModel","getGroupedRowModel","groupedColumnMode","columnResizeMode","onChangeFilter","getFilteredRowModel","filterFns","tacoFilter","columnId","filter","columnFilterFn","globalFilterFn","getColumnCanGlobalFilter","_column$columnDef$met","_column$columnDef$met2","columnDef","onChangeSort","manualSorting","getSortedRowModel","useReactTableInitialState","persistedSettings","defaults","useMemo","ignoreNotDefinedColumns","find","definedColumn","columnPinning","_ref","_persistedSettings$co","_props$defaultSetting","defaultSettings","columnOrder","ensureOrdering","_persistedSettings$co2","_props$defaultSetting2","left","_columnPinning$left","freezeUptoExternalColumn","indexOf","defaultColumnFreezingIndex","unfreezeAllExternalColumns","state","columnFilters","_ref2","_persistedSettings$co3","_props$defaultSetting3","columnSizing","ignoreInternalColumns","_ref3","_ref4","_persistedSettings$co4","_props$defaultSetting4","columnVisibility","_ref5","_ref6","_persistedSettings$co5","_props$defaultSetting5","globalFilter","_persistedSettings$se","searchQuery","_props$defaultSetting6","sorting","_props$defaultSetting7","_props$defaultSetting8","grouping","expanded"],"mappings":";;;;;;;;AA0BA;AACA,SAASA,eAAeA,CACpBC,KAAiE,EACjEC,OAAqC,EACrCC,aAA0C,EAC1CC,cAAsC,EACtCC,iBAA4C,EAC5CC,QAAuB,EACvBC,uBAAqC;EAErC,MAAMC,YAAY,GAAGC,kBAAkB,EAAS;EAEhD,kBAAIC,cAAK,CAACC,cAAc,CAAkBV,KAAK,CAAC,IAAIA,KAAK,CAACW,KAAK,CAACC,QAAQ,EAAE;IACtE,MAAM;MAAEA,QAAQ;MAAEC,EAAE;MAAEC;KAAQ,GAAGd,KAAK,CAACW,KAAK;IAE5CV,OAAO,CAACc,IAAI,CACRR,YAAY,CAACS,KAAK,CAAC;MACfH,EAAE;MACFC,MAAM;MACNb,OAAO,EAAEQ,cAAK,CAACQ,QAAQ,CAACC,OAAO,CAACN,QAAQ,CAAC,CAACO,MAAM,CAC5C,CAAClB,OAAqC,EAAED,KAAK,KACzCD,eAAe,CACXC,KAAK,EACLC,OAAO,EACPC,aAAa,EACbC,cAAc,EACdC,iBAAiB,EACjBC,QAAQ,EACRC,uBAAuB,CAC1B,EACL,EAAE,CACL;;MAEDc,cAAc,EAAE;KACnB,CAAC,CACL;GACJ,MAAM,kBAAIX,cAAK,CAACC,cAAc,CAA0BV,KAAK,CAAC,KAAKA,KAAK,CAACW,KAAK,CAACU,QAAQ,IAAIrB,KAAK,CAACW,KAAK,CAACE,EAAE,CAAC,EAAE;IACzG,MAAM;MACFA,EAAE;MACFQ,QAAQ,EAAEC,WAAW,GAAGT,EAAE;;MAE1BU,QAAQ;MACRC,SAAS;MACTC,MAAM;MACNX,MAAM;;MAENY,aAAa;MACbC,aAAa;MACbC,YAAY;MACZC,eAAe,EAAEC,kBAAkB,GAAG,IAAI;MAC1CV,cAAc,GAAG,KAAK;MACtBW,YA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CAACwB,QAAQ,GAAG,IAAI;;IAGzB,OAAOxB,KAAK;GACf,EAAE,EAAE,CAAC;AACV;;;;"}
@@ -29,6 +29,7 @@ var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
29
29
  var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
30
30
  var reactPortal = require('@radix-ui/react-portal');
31
31
  var reactTable = require('@tanstack/react-table');
32
+ var get = _interopDefault(require('lodash/get'));
32
33
  var reactVirtual = require('@tanstack/react-virtual');
33
34
  var reactIntersectionObserver = require('react-intersection-observer');
34
35
  var core = require('@dnd-kit/core');
@@ -40,7 +41,6 @@ var reactWindow = require('react-window');
40
41
  var InfiniteLoader = _interopDefault(require('react-window-infinite-loader'));
41
42
  var set = _interopDefault(require('lodash/set'));
42
43
  var unset = _interopDefault(require('lodash/unset'));
43
- var get = _interopDefault(require('lodash/get'));
44
44
  var compact = _interopDefault(require('lodash/compact'));
45
45
  var pullAt = _interopDefault(require('lodash/pullAt'));
46
46
  var TabsPrimitive = require('@radix-ui/react-tabs');
@@ -9924,7 +9924,7 @@ function processChildren(child, columns, defaultSizing, defaultSorting, defaultV
9924
9924
  id,
9925
9925
  accessorKey,
9926
9926
  // To avoid errors caused by undefined row data values, we pass accessorFn as a preventive measure
9927
- accessorFn: row => row === null || row === void 0 ? void 0 : row[accessorKey],
9927
+ accessorFn: row => get(row, accessorKey),
9928
9928
  header: header,
9929
9929
  // features
9930
9930
  enableColumnFilter,