@tanstack/table-core 8.11.8 → 8.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/core/cell.js +1 -4
- package/build/lib/core/cell.js.map +1 -1
- package/build/lib/core/column.js +2 -14
- package/build/lib/core/column.js.map +1 -1
- package/build/lib/core/headers.js +17 -112
- package/build/lib/core/headers.js.map +1 -1
- package/build/lib/core/row.js +2 -14
- package/build/lib/core/row.js.map +1 -1
- package/build/lib/core/table.d.ts +6 -0
- package/build/lib/core/table.js +5 -35
- package/build/lib/core/table.js.map +1 -1
- package/build/lib/features/ColumnSizing.d.ts +6 -2
- package/build/lib/features/ColumnSizing.js +3 -9
- package/build/lib/features/ColumnSizing.js.map +1 -1
- package/build/lib/features/Ordering.d.ts +21 -0
- package/build/lib/features/Ordering.js +15 -4
- package/build/lib/features/Ordering.js.map +1 -1
- package/build/lib/features/Pagination.js +1 -7
- package/build/lib/features/Pagination.js.map +1 -1
- package/build/lib/features/Pinning.js +9 -57
- package/build/lib/features/Pinning.js.map +1 -1
- package/build/lib/features/RowSelection.js +3 -21
- package/build/lib/features/RowSelection.js.map +1 -1
- package/build/lib/features/Visibility.d.ts +3 -1
- package/build/lib/features/Visibility.js +7 -21
- package/build/lib/features/Visibility.js.map +1 -1
- package/build/lib/index.esm.js +89 -382
- package/build/lib/index.esm.js.map +1 -1
- package/build/lib/index.js +2 -0
- package/build/lib/index.js.map +1 -1
- package/build/lib/index.mjs +89 -382
- package/build/lib/index.mjs.map +1 -1
- package/build/lib/types.d.ts +2 -2
- package/build/lib/utils/getCoreRowModel.js +1 -10
- package/build/lib/utils/getCoreRowModel.js.map +1 -1
- package/build/lib/utils/getExpandedRowModel.js +1 -7
- package/build/lib/utils/getExpandedRowModel.js.map +1 -1
- package/build/lib/utils/getFacetedMinMaxValues.js +1 -8
- package/build/lib/utils/getFacetedMinMaxValues.js.map +1 -1
- package/build/lib/utils/getFacetedRowModel.js +1 -8
- package/build/lib/utils/getFacetedRowModel.js.map +1 -1
- package/build/lib/utils/getFacetedUniqueValues.js +1 -8
- package/build/lib/utils/getFacetedUniqueValues.js.map +1 -1
- package/build/lib/utils/getFilteredRowModel.js +1 -10
- package/build/lib/utils/getFilteredRowModel.js.map +1 -1
- package/build/lib/utils/getGroupedRowModel.js +6 -13
- package/build/lib/utils/getGroupedRowModel.js.map +1 -1
- package/build/lib/utils/getPaginationRowModel.js +1 -7
- package/build/lib/utils/getPaginationRowModel.js.map +1 -1
- package/build/lib/utils/getSortedRowModel.js +1 -10
- package/build/lib/utils/getSortedRowModel.js.map +1 -1
- package/build/lib/utils.d.ts +8 -3
- package/build/lib/utils.js +13 -2
- package/build/lib/utils.js.map +1 -1
- package/build/umd/index.development.js +90 -381
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/core/cell.ts +2 -5
- package/src/core/column.ts +3 -9
- package/src/core/headers.ts +19 -65
- package/src/core/row.ts +3 -10
- package/src/core/table.ts +12 -21
- package/src/features/ColumnSizing.ts +33 -20
- package/src/features/Ordering.ts +74 -35
- package/src/features/Pagination.ts +7 -5
- package/src/features/Pinning.ts +34 -60
- package/src/features/RowSelection.ts +4 -16
- package/src/features/Visibility.ts +18 -13
- package/src/types.ts +3 -1
- package/src/utils/getCoreRowModel.ts +4 -8
- package/src/utils/getExpandedRowModel.ts +2 -5
- package/src/utils/getFacetedMinMaxValues.ts +2 -8
- package/src/utils/getFacetedRowModel.ts +2 -8
- package/src/utils/getFacetedUniqueValues.ts +6 -8
- package/src/utils/getFilteredRowModel.ts +4 -8
- package/src/utils/getGroupedRowModel.ts +7 -11
- package/src/utils/getPaginationRowModel.ts +2 -5
- package/src/utils/getSortedRowModel.ts +4 -8
- package/src/utils.ts +25 -6
package/build/lib/core/cell.js
CHANGED
|
@@ -30,10 +30,7 @@ function createCell(table, row, column, columnId) {
|
|
|
30
30
|
cell: cell,
|
|
31
31
|
getValue: cell.getValue,
|
|
32
32
|
renderValue: cell.renderValue
|
|
33
|
-
}),
|
|
34
|
-
key: process.env.NODE_ENV === 'development' && 'cell.getContext',
|
|
35
|
-
debug: () => table.options.debugAll
|
|
36
|
-
})
|
|
33
|
+
}), utils.getMemoOptions(table.options, 'debugCells', 'cell.getContext'))
|
|
37
34
|
};
|
|
38
35
|
table._features.forEach(feature => {
|
|
39
36
|
feature.createCell == null || feature.createCell(cell, column, row, table);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell.js","sources":["../../../src/core/cell.ts"],"sourcesContent":["import { RowData, Cell, Column, Row, Table } from '../types'\nimport { Getter, memo } from '../utils'\n\nexport interface CellContext<TData extends RowData, TValue> {\n cell: Cell<TData, TValue>\n column: Column<TData, TValue>\n getValue: Getter<TValue>\n renderValue: Getter<TValue | null>\n row: Row<TData>\n table: Table<TData>\n}\n\nexport interface CoreCell<TData extends RowData, TValue> {\n /**\n * The associated Column object for the cell.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#column)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/cells)\n */\n column: Column<TData, TValue>\n /**\n * Returns the rendering context (or props) for cell-based components like cells and aggregated cells. Use these props with your framework's `flexRender` utility to render these using the template of your choice:\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#getcontext)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/cells)\n */\n getContext: () => CellContext<TData, TValue>\n /**\n * Returns the value for the cell, accessed via the associated column's accessor key or accessor function.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#getvalue)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/cells)\n */\n getValue: CellContext<TData, TValue>['getValue']\n /**\n * The unique ID for the cell across the entire table.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#id)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/cells)\n */\n id: string\n /**\n * Renders the value for a cell the same as `getValue`, but will return the `renderFallbackValue` if no value is found.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#rendervalue)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/cells)\n */\n renderValue: CellContext<TData, TValue>['renderValue']\n /**\n * The associated Row object for the cell.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#row)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/cells)\n */\n row: Row<TData>\n}\n\nexport function createCell<TData extends RowData, TValue>(\n table: Table<TData>,\n row: Row<TData>,\n column: Column<TData, TValue>,\n columnId: string\n): Cell<TData, TValue> {\n const getRenderValue = () =>\n cell.getValue() ?? table.options.renderFallbackValue\n\n const cell: CoreCell<TData, TValue> = {\n id: `${row.id}_${column.id}`,\n row,\n column,\n getValue: () => row.getValue(columnId),\n renderValue: getRenderValue,\n getContext: memo(\n () => [table, column, row, cell],\n (table, column, row, cell) => ({\n table,\n column,\n row,\n cell: cell as Cell<TData, TValue>,\n getValue: cell.getValue,\n renderValue: cell.renderValue,\n }),\n
|
|
1
|
+
{"version":3,"file":"cell.js","sources":["../../../src/core/cell.ts"],"sourcesContent":["import { RowData, Cell, Column, Row, Table } from '../types'\nimport { Getter, getMemoOptions, memo } from '../utils'\n\nexport interface CellContext<TData extends RowData, TValue> {\n cell: Cell<TData, TValue>\n column: Column<TData, TValue>\n getValue: Getter<TValue>\n renderValue: Getter<TValue | null>\n row: Row<TData>\n table: Table<TData>\n}\n\nexport interface CoreCell<TData extends RowData, TValue> {\n /**\n * The associated Column object for the cell.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#column)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/cells)\n */\n column: Column<TData, TValue>\n /**\n * Returns the rendering context (or props) for cell-based components like cells and aggregated cells. Use these props with your framework's `flexRender` utility to render these using the template of your choice:\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#getcontext)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/cells)\n */\n getContext: () => CellContext<TData, TValue>\n /**\n * Returns the value for the cell, accessed via the associated column's accessor key or accessor function.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#getvalue)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/cells)\n */\n getValue: CellContext<TData, TValue>['getValue']\n /**\n * The unique ID for the cell across the entire table.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#id)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/cells)\n */\n id: string\n /**\n * Renders the value for a cell the same as `getValue`, but will return the `renderFallbackValue` if no value is found.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#rendervalue)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/cells)\n */\n renderValue: CellContext<TData, TValue>['renderValue']\n /**\n * The associated Row object for the cell.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#row)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/cells)\n */\n row: Row<TData>\n}\n\nexport function createCell<TData extends RowData, TValue>(\n table: Table<TData>,\n row: Row<TData>,\n column: Column<TData, TValue>,\n columnId: string\n): Cell<TData, TValue> {\n const getRenderValue = () =>\n cell.getValue() ?? table.options.renderFallbackValue\n\n const cell: CoreCell<TData, TValue> = {\n id: `${row.id}_${column.id}`,\n row,\n column,\n getValue: () => row.getValue(columnId),\n renderValue: getRenderValue,\n getContext: memo(\n () => [table, column, row, cell],\n (table, column, row, cell) => ({\n table,\n column,\n row,\n cell: cell as Cell<TData, TValue>,\n getValue: cell.getValue,\n renderValue: cell.renderValue,\n }),\n getMemoOptions(table.options, 'debugCells', 'cell.getContext')\n ),\n }\n\n table._features.forEach(feature => {\n feature.createCell?.(\n cell as Cell<TData, TValue>,\n column,\n row as Row<TData>,\n table\n )\n }, {})\n\n return cell as Cell<TData, TValue>\n}\n"],"names":["createCell","table","row","column","columnId","getRenderValue","_cell$getValue","cell","getValue","options","renderFallbackValue","id","renderValue","getContext","memo","getMemoOptions","_features","forEach","feature"],"mapp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AAOM,IAAI,CAAA;AACb;;;;"}
|
package/build/lib/core/column.js
CHANGED
|
@@ -58,13 +58,7 @@ function createColumn(table, columnDef, depth, parent) {
|
|
|
58
58
|
getFlatColumns: utils.memo(() => [true], () => {
|
|
59
59
|
var _column$columns;
|
|
60
60
|
return [column, ...((_column$columns = column.columns) == null ? void 0 : _column$columns.flatMap(d => d.getFlatColumns()))];
|
|
61
|
-
},
|
|
62
|
-
key: process.env.NODE_ENV === 'production' && 'column.getFlatColumns',
|
|
63
|
-
debug: () => {
|
|
64
|
-
var _table$options$debugA;
|
|
65
|
-
return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugColumns;
|
|
66
|
-
}
|
|
67
|
-
}),
|
|
61
|
+
}, utils.getMemoOptions(table.options, 'debugColumns', 'column.getFlatColumns')),
|
|
68
62
|
getLeafColumns: utils.memo(() => [table._getOrderColumnsFn()], orderColumns => {
|
|
69
63
|
var _column$columns2;
|
|
70
64
|
if ((_column$columns2 = column.columns) != null && _column$columns2.length) {
|
|
@@ -72,13 +66,7 @@ function createColumn(table, columnDef, depth, parent) {
|
|
|
72
66
|
return orderColumns(leafColumns);
|
|
73
67
|
}
|
|
74
68
|
return [column];
|
|
75
|
-
},
|
|
76
|
-
key: process.env.NODE_ENV === 'production' && 'column.getLeafColumns',
|
|
77
|
-
debug: () => {
|
|
78
|
-
var _table$options$debugA2;
|
|
79
|
-
return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugColumns;
|
|
80
|
-
}
|
|
81
|
-
})
|
|
69
|
+
}, utils.getMemoOptions(table.options, 'debugColumns', 'column.getLeafColumns'))
|
|
82
70
|
};
|
|
83
71
|
for (const feature of table._features) {
|
|
84
72
|
feature.createColumn == null || feature.createColumn(column, table);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column.js","sources":["../../../src/core/column.ts"],"sourcesContent":["import {\n Column,\n Table,\n AccessorFn,\n ColumnDef,\n RowData,\n ColumnDefResolved,\n} from '../types'\nimport { memo } from '../utils'\n\nexport interface CoreColumn<TData extends RowData, TValue> {\n /**\n * The resolved accessor function to use when extracting the value for the column from each row. Will only be defined if the column def has a valid accessor key or function defined.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#accessorfn)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs)\n */\n accessorFn?: AccessorFn<TData, TValue>\n /**\n * The original column def used to create the column.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#columndef)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs)\n */\n columnDef: ColumnDef<TData, TValue>\n /**\n * The child column (if the column is a group column). Will be an empty array if the column is not a group column.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#columns)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs)\n */\n columns: Column<TData, TValue>[]\n /**\n * The depth of the column (if grouped) relative to the root column def array.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#depth)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs)\n */\n depth: number\n /**\n * Returns the flattened array of this column and all child/grand-child columns for this column.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#getflatcolumns)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs)\n */\n getFlatColumns: () => Column<TData, TValue>[]\n /**\n * Returns an array of all leaf-node columns for this column. If a column has no children, it is considered the only leaf-node column.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#getleafcolumns)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs)\n */\n getLeafColumns: () => Column<TData, TValue>[]\n /**\n * The resolved unique identifier for the column resolved in this priority:\n - A manual `id` property from the column def\n - The accessor key from the column def\n - The header string from the column def\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#id)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs)\n */\n id: string\n /**\n * The parent column for this column. Will be undefined if this is a root column.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#parent)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs)\n */\n parent?: Column<TData, TValue>\n}\n\nexport function createColumn<TData extends RowData, TValue>(\n table: Table<TData>,\n columnDef: ColumnDef<TData, TValue>,\n depth: number,\n parent?: Column<TData, TValue>\n): Column<TData, TValue> {\n const defaultColumn = table._getDefaultColumnDef()\n\n const resolvedColumnDef = {\n ...defaultColumn,\n ...columnDef,\n } as ColumnDefResolved<TData>\n\n const accessorKey = resolvedColumnDef.accessorKey\n\n let id =\n resolvedColumnDef.id ??\n (accessorKey ? accessorKey.replace('.', '_') : undefined) ??\n (typeof resolvedColumnDef.header === 'string'\n ? resolvedColumnDef.header\n : undefined)\n\n let accessorFn: AccessorFn<TData> | undefined\n\n if (resolvedColumnDef.accessorFn) {\n accessorFn = resolvedColumnDef.accessorFn\n } else if (accessorKey) {\n // Support deep accessor keys\n if (accessorKey.includes('.')) {\n accessorFn = (originalRow: TData) => {\n let result = originalRow as Record<string, any>\n\n for (const key of accessorKey.split('.')) {\n result = result?.[key]\n if (process.env.NODE_ENV !== 'production' && result === undefined) {\n console.warn(\n `\"${key}\" in deeply nested key \"${accessorKey}\" returned undefined.`\n )\n }\n }\n\n return result\n }\n } else {\n accessorFn = (originalRow: TData) =>\n (originalRow as any)[resolvedColumnDef.accessorKey]\n }\n }\n\n if (!id) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n resolvedColumnDef.accessorFn\n ? `Columns require an id when using an accessorFn`\n : `Columns require an id when using a non-string header`\n )\n }\n throw new Error()\n }\n\n let column: CoreColumn<TData, any> = {\n id: `${String(id)}`,\n accessorFn,\n parent: parent as any,\n depth,\n columnDef: resolvedColumnDef as ColumnDef<TData, any>,\n columns: [],\n getFlatColumns: memo(\n () => [true],\n () => {\n return [\n column as Column<TData, TValue>,\n ...column.columns?.flatMap(d => d.getFlatColumns()),\n ]\n },\n
|
|
1
|
+
{"version":3,"file":"column.js","sources":["../../../src/core/column.ts"],"sourcesContent":["import {\n Column,\n Table,\n AccessorFn,\n ColumnDef,\n RowData,\n ColumnDefResolved,\n} from '../types'\nimport { getMemoOptions, memo } from '../utils'\n\nexport interface CoreColumn<TData extends RowData, TValue> {\n /**\n * The resolved accessor function to use when extracting the value for the column from each row. Will only be defined if the column def has a valid accessor key or function defined.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#accessorfn)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs)\n */\n accessorFn?: AccessorFn<TData, TValue>\n /**\n * The original column def used to create the column.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#columndef)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs)\n */\n columnDef: ColumnDef<TData, TValue>\n /**\n * The child column (if the column is a group column). Will be an empty array if the column is not a group column.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#columns)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs)\n */\n columns: Column<TData, TValue>[]\n /**\n * The depth of the column (if grouped) relative to the root column def array.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#depth)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs)\n */\n depth: number\n /**\n * Returns the flattened array of this column and all child/grand-child columns for this column.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#getflatcolumns)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs)\n */\n getFlatColumns: () => Column<TData, TValue>[]\n /**\n * Returns an array of all leaf-node columns for this column. If a column has no children, it is considered the only leaf-node column.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#getleafcolumns)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs)\n */\n getLeafColumns: () => Column<TData, TValue>[]\n /**\n * The resolved unique identifier for the column resolved in this priority:\n - A manual `id` property from the column def\n - The accessor key from the column def\n - The header string from the column def\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#id)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs)\n */\n id: string\n /**\n * The parent column for this column. Will be undefined if this is a root column.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#parent)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs)\n */\n parent?: Column<TData, TValue>\n}\n\nexport function createColumn<TData extends RowData, TValue>(\n table: Table<TData>,\n columnDef: ColumnDef<TData, TValue>,\n depth: number,\n parent?: Column<TData, TValue>\n): Column<TData, TValue> {\n const defaultColumn = table._getDefaultColumnDef()\n\n const resolvedColumnDef = {\n ...defaultColumn,\n ...columnDef,\n } as ColumnDefResolved<TData>\n\n const accessorKey = resolvedColumnDef.accessorKey\n\n let id =\n resolvedColumnDef.id ??\n (accessorKey ? accessorKey.replace('.', '_') : undefined) ??\n (typeof resolvedColumnDef.header === 'string'\n ? resolvedColumnDef.header\n : undefined)\n\n let accessorFn: AccessorFn<TData> | undefined\n\n if (resolvedColumnDef.accessorFn) {\n accessorFn = resolvedColumnDef.accessorFn\n } else if (accessorKey) {\n // Support deep accessor keys\n if (accessorKey.includes('.')) {\n accessorFn = (originalRow: TData) => {\n let result = originalRow as Record<string, any>\n\n for (const key of accessorKey.split('.')) {\n result = result?.[key]\n if (process.env.NODE_ENV !== 'production' && result === undefined) {\n console.warn(\n `\"${key}\" in deeply nested key \"${accessorKey}\" returned undefined.`\n )\n }\n }\n\n return result\n }\n } else {\n accessorFn = (originalRow: TData) =>\n (originalRow as any)[resolvedColumnDef.accessorKey]\n }\n }\n\n if (!id) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n resolvedColumnDef.accessorFn\n ? `Columns require an id when using an accessorFn`\n : `Columns require an id when using a non-string header`\n )\n }\n throw new Error()\n }\n\n let column: CoreColumn<TData, any> = {\n id: `${String(id)}`,\n accessorFn,\n parent: parent as any,\n depth,\n columnDef: resolvedColumnDef as ColumnDef<TData, any>,\n columns: [],\n getFlatColumns: memo(\n () => [true],\n () => {\n return [\n column as Column<TData, TValue>,\n ...column.columns?.flatMap(d => d.getFlatColumns()),\n ]\n },\n getMemoOptions(table.options, 'debugColumns', 'column.getFlatColumns')\n ),\n getLeafColumns: memo(\n () => [table._getOrderColumnsFn()],\n orderColumns => {\n if (column.columns?.length) {\n let leafColumns = column.columns.flatMap(column =>\n column.getLeafColumns()\n )\n\n return orderColumns(leafColumns)\n }\n\n return [column as Column<TData, TValue>]\n },\n getMemoOptions(table.options, 'debugColumns', 'column.getLeafColumns')\n ),\n }\n\n for (const feature of table._features) {\n feature.createColumn?.(column, table)\n }\n\n // Yes, we have to convert table to uknown, because we know more than the compiler here.\n return column as Column<TData, TValue>\n}\n"],"names":["createColumn","table","columnDef","depth","parent","_ref","_resolvedColumnDef$id","defaultColumn","_getDefaultColumnDef","resolvedColumnDef","accessorKey","id","replace","undefined","header","accessorFn","includes","originalRow","result","key","split","_result","process","env","NODE_ENV","console","warn","Error","column","String","columns","getFlatColumns","memo","_column$columns","flatMap","d","getMemoOptions","options","getLeafColumns","_getOrderColumnsFn","orderColumns","_column$columns2","length","leafColumns","feature","_features"],"mappings":";;;;;;;;;;;;;;AAgEO,SAASA,YAAYA,CAC1BC,KAAmB,EACnBC,SAAmC,EACnCC,KAAa,EACbC,MAA8B,EACP;EAAA,IAAAC,IAAA,EAAAC,qBAAA,CAAA;AACvB,EAAA,MAAMC,aAAa,GAAGN,KAAK,CAACO,oBAAoB,EAAE,CAAA;AAElD,EAAA,MAAMC,iBAAiB,GAAG;AACxB,IAAA,GAAGF,aAAa;IAChB,GAAGL,SAAAA;GACwB,CAAA;AAE7B,EAAA,MAAMQ,WAAW,GAAGD,iBAAiB,CAACC,WAAW,CAAA;AAEjD,EAAA,IAAIC,EAAE,GAAAN,CAAAA,IAAA,GAAAC,CAAAA,qBAAA,GACJG,iBAAiB,CAACE,EAAE,KAAA,IAAA,GAAAL,qBAAA,GACnBI,WAAW,GAAGA,WAAW,CAACE,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,GAAGC,SAAS,KAA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K,CAAC4C,SAAS,EAAE;IACrCD,OAAO,CAAC5C,YAAY,IAAA,IAAA,IAApB4C,OAAO,CAAC5C,YAAY,CAAG4B,MAAM,EAAE3B,KAAK,CAAC,CAAA;AACvC,GAAA;;AAEA;AACA,EAAA,OAAO2B,MAAM,CAAA;AACf;;;;"}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
var utils = require('../utils.js');
|
|
14
14
|
|
|
15
|
+
const debug = 'debugHeaders';
|
|
15
16
|
//
|
|
16
17
|
|
|
17
18
|
function createHeader(table, column, options) {
|
|
@@ -61,84 +62,36 @@ const Headers = {
|
|
|
61
62
|
const centerColumns = leafColumns.filter(column => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));
|
|
62
63
|
const headerGroups = buildHeaderGroups(allColumns, [...leftColumns, ...centerColumns, ...rightColumns], table);
|
|
63
64
|
return headerGroups;
|
|
64
|
-
},
|
|
65
|
-
key: process.env.NODE_ENV === 'development' && 'getHeaderGroups',
|
|
66
|
-
debug: () => {
|
|
67
|
-
var _table$options$debugA;
|
|
68
|
-
return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugHeaders;
|
|
69
|
-
}
|
|
70
|
-
});
|
|
65
|
+
}, utils.getMemoOptions(table.options, debug, 'getHeaderGroups'));
|
|
71
66
|
table.getCenterHeaderGroups = utils.memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {
|
|
72
67
|
leafColumns = leafColumns.filter(column => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));
|
|
73
68
|
return buildHeaderGroups(allColumns, leafColumns, table, 'center');
|
|
74
|
-
},
|
|
75
|
-
key: process.env.NODE_ENV === 'development' && 'getCenterHeaderGroups',
|
|
76
|
-
debug: () => {
|
|
77
|
-
var _table$options$debugA2;
|
|
78
|
-
return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugHeaders;
|
|
79
|
-
}
|
|
80
|
-
});
|
|
69
|
+
}, utils.getMemoOptions(table.options, debug, 'getCenterHeaderGroups'));
|
|
81
70
|
table.getLeftHeaderGroups = utils.memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left], (allColumns, leafColumns, left) => {
|
|
82
71
|
var _left$map$filter2;
|
|
83
72
|
const orderedLeafColumns = (_left$map$filter2 = left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter2 : [];
|
|
84
73
|
return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'left');
|
|
85
|
-
},
|
|
86
|
-
key: process.env.NODE_ENV === 'development' && 'getLeftHeaderGroups',
|
|
87
|
-
debug: () => {
|
|
88
|
-
var _table$options$debugA3;
|
|
89
|
-
return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugHeaders;
|
|
90
|
-
}
|
|
91
|
-
});
|
|
74
|
+
}, utils.getMemoOptions(table.options, debug, 'getLeftHeaderGroups'));
|
|
92
75
|
table.getRightHeaderGroups = utils.memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.right], (allColumns, leafColumns, right) => {
|
|
93
76
|
var _right$map$filter2;
|
|
94
77
|
const orderedLeafColumns = (_right$map$filter2 = right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter2 : [];
|
|
95
78
|
return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'right');
|
|
96
|
-
},
|
|
97
|
-
key: process.env.NODE_ENV === 'development' && 'getRightHeaderGroups',
|
|
98
|
-
debug: () => {
|
|
99
|
-
var _table$options$debugA4;
|
|
100
|
-
return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugHeaders;
|
|
101
|
-
}
|
|
102
|
-
});
|
|
79
|
+
}, utils.getMemoOptions(table.options, debug, 'getRightHeaderGroups'));
|
|
103
80
|
|
|
104
81
|
// Footer Groups
|
|
105
82
|
|
|
106
83
|
table.getFooterGroups = utils.memo(() => [table.getHeaderGroups()], headerGroups => {
|
|
107
84
|
return [...headerGroups].reverse();
|
|
108
|
-
},
|
|
109
|
-
key: process.env.NODE_ENV === 'development' && 'getFooterGroups',
|
|
110
|
-
debug: () => {
|
|
111
|
-
var _table$options$debugA5;
|
|
112
|
-
return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugHeaders;
|
|
113
|
-
}
|
|
114
|
-
});
|
|
85
|
+
}, utils.getMemoOptions(table.options, debug, 'getFooterGroups'));
|
|
115
86
|
table.getLeftFooterGroups = utils.memo(() => [table.getLeftHeaderGroups()], headerGroups => {
|
|
116
87
|
return [...headerGroups].reverse();
|
|
117
|
-
},
|
|
118
|
-
key: process.env.NODE_ENV === 'development' && 'getLeftFooterGroups',
|
|
119
|
-
debug: () => {
|
|
120
|
-
var _table$options$debugA6;
|
|
121
|
-
return (_table$options$debugA6 = table.options.debugAll) != null ? _table$options$debugA6 : table.options.debugHeaders;
|
|
122
|
-
}
|
|
123
|
-
});
|
|
88
|
+
}, utils.getMemoOptions(table.options, debug, 'getLeftFooterGroups'));
|
|
124
89
|
table.getCenterFooterGroups = utils.memo(() => [table.getCenterHeaderGroups()], headerGroups => {
|
|
125
90
|
return [...headerGroups].reverse();
|
|
126
|
-
},
|
|
127
|
-
key: process.env.NODE_ENV === 'development' && 'getCenterFooterGroups',
|
|
128
|
-
debug: () => {
|
|
129
|
-
var _table$options$debugA7;
|
|
130
|
-
return (_table$options$debugA7 = table.options.debugAll) != null ? _table$options$debugA7 : table.options.debugHeaders;
|
|
131
|
-
}
|
|
132
|
-
});
|
|
91
|
+
}, utils.getMemoOptions(table.options, debug, 'getCenterFooterGroups'));
|
|
133
92
|
table.getRightFooterGroups = utils.memo(() => [table.getRightHeaderGroups()], headerGroups => {
|
|
134
93
|
return [...headerGroups].reverse();
|
|
135
|
-
},
|
|
136
|
-
key: process.env.NODE_ENV === 'development' && 'getRightFooterGroups',
|
|
137
|
-
debug: () => {
|
|
138
|
-
var _table$options$debugA8;
|
|
139
|
-
return (_table$options$debugA8 = table.options.debugAll) != null ? _table$options$debugA8 : table.options.debugHeaders;
|
|
140
|
-
}
|
|
141
|
-
});
|
|
94
|
+
}, utils.getMemoOptions(table.options, debug, 'getRightFooterGroups'));
|
|
142
95
|
|
|
143
96
|
// Flat Headers
|
|
144
97
|
|
|
@@ -146,46 +99,22 @@ const Headers = {
|
|
|
146
99
|
return headerGroups.map(headerGroup => {
|
|
147
100
|
return headerGroup.headers;
|
|
148
101
|
}).flat();
|
|
149
|
-
},
|
|
150
|
-
key: process.env.NODE_ENV === 'development' && 'getFlatHeaders',
|
|
151
|
-
debug: () => {
|
|
152
|
-
var _table$options$debugA9;
|
|
153
|
-
return (_table$options$debugA9 = table.options.debugAll) != null ? _table$options$debugA9 : table.options.debugHeaders;
|
|
154
|
-
}
|
|
155
|
-
});
|
|
102
|
+
}, utils.getMemoOptions(table.options, debug, 'getFlatHeaders'));
|
|
156
103
|
table.getLeftFlatHeaders = utils.memo(() => [table.getLeftHeaderGroups()], left => {
|
|
157
104
|
return left.map(headerGroup => {
|
|
158
105
|
return headerGroup.headers;
|
|
159
106
|
}).flat();
|
|
160
|
-
},
|
|
161
|
-
key: process.env.NODE_ENV === 'development' && 'getLeftFlatHeaders',
|
|
162
|
-
debug: () => {
|
|
163
|
-
var _table$options$debugA10;
|
|
164
|
-
return (_table$options$debugA10 = table.options.debugAll) != null ? _table$options$debugA10 : table.options.debugHeaders;
|
|
165
|
-
}
|
|
166
|
-
});
|
|
107
|
+
}, utils.getMemoOptions(table.options, debug, 'getLeftFlatHeaders'));
|
|
167
108
|
table.getCenterFlatHeaders = utils.memo(() => [table.getCenterHeaderGroups()], left => {
|
|
168
109
|
return left.map(headerGroup => {
|
|
169
110
|
return headerGroup.headers;
|
|
170
111
|
}).flat();
|
|
171
|
-
},
|
|
172
|
-
key: process.env.NODE_ENV === 'development' && 'getCenterFlatHeaders',
|
|
173
|
-
debug: () => {
|
|
174
|
-
var _table$options$debugA11;
|
|
175
|
-
return (_table$options$debugA11 = table.options.debugAll) != null ? _table$options$debugA11 : table.options.debugHeaders;
|
|
176
|
-
}
|
|
177
|
-
});
|
|
112
|
+
}, utils.getMemoOptions(table.options, debug, 'getCenterFlatHeaders'));
|
|
178
113
|
table.getRightFlatHeaders = utils.memo(() => [table.getRightHeaderGroups()], left => {
|
|
179
114
|
return left.map(headerGroup => {
|
|
180
115
|
return headerGroup.headers;
|
|
181
116
|
}).flat();
|
|
182
|
-
},
|
|
183
|
-
key: process.env.NODE_ENV === 'development' && 'getRightFlatHeaders',
|
|
184
|
-
debug: () => {
|
|
185
|
-
var _table$options$debugA12;
|
|
186
|
-
return (_table$options$debugA12 = table.options.debugAll) != null ? _table$options$debugA12 : table.options.debugHeaders;
|
|
187
|
-
}
|
|
188
|
-
});
|
|
117
|
+
}, utils.getMemoOptions(table.options, debug, 'getRightFlatHeaders'));
|
|
189
118
|
|
|
190
119
|
// Leaf Headers
|
|
191
120
|
|
|
@@ -194,49 +123,25 @@ const Headers = {
|
|
|
194
123
|
var _header$subHeaders;
|
|
195
124
|
return !((_header$subHeaders = header.subHeaders) != null && _header$subHeaders.length);
|
|
196
125
|
});
|
|
197
|
-
},
|
|
198
|
-
key: process.env.NODE_ENV === 'development' && 'getCenterLeafHeaders',
|
|
199
|
-
debug: () => {
|
|
200
|
-
var _table$options$debugA13;
|
|
201
|
-
return (_table$options$debugA13 = table.options.debugAll) != null ? _table$options$debugA13 : table.options.debugHeaders;
|
|
202
|
-
}
|
|
203
|
-
});
|
|
126
|
+
}, utils.getMemoOptions(table.options, debug, 'getCenterLeafHeaders'));
|
|
204
127
|
table.getLeftLeafHeaders = utils.memo(() => [table.getLeftFlatHeaders()], flatHeaders => {
|
|
205
128
|
return flatHeaders.filter(header => {
|
|
206
129
|
var _header$subHeaders2;
|
|
207
130
|
return !((_header$subHeaders2 = header.subHeaders) != null && _header$subHeaders2.length);
|
|
208
131
|
});
|
|
209
|
-
},
|
|
210
|
-
key: process.env.NODE_ENV === 'development' && 'getLeftLeafHeaders',
|
|
211
|
-
debug: () => {
|
|
212
|
-
var _table$options$debugA14;
|
|
213
|
-
return (_table$options$debugA14 = table.options.debugAll) != null ? _table$options$debugA14 : table.options.debugHeaders;
|
|
214
|
-
}
|
|
215
|
-
});
|
|
132
|
+
}, utils.getMemoOptions(table.options, debug, 'getLeftLeafHeaders'));
|
|
216
133
|
table.getRightLeafHeaders = utils.memo(() => [table.getRightFlatHeaders()], flatHeaders => {
|
|
217
134
|
return flatHeaders.filter(header => {
|
|
218
135
|
var _header$subHeaders3;
|
|
219
136
|
return !((_header$subHeaders3 = header.subHeaders) != null && _header$subHeaders3.length);
|
|
220
137
|
});
|
|
221
|
-
},
|
|
222
|
-
key: process.env.NODE_ENV === 'development' && 'getRightLeafHeaders',
|
|
223
|
-
debug: () => {
|
|
224
|
-
var _table$options$debugA15;
|
|
225
|
-
return (_table$options$debugA15 = table.options.debugAll) != null ? _table$options$debugA15 : table.options.debugHeaders;
|
|
226
|
-
}
|
|
227
|
-
});
|
|
138
|
+
}, utils.getMemoOptions(table.options, debug, 'getRightLeafHeaders'));
|
|
228
139
|
table.getLeafHeaders = utils.memo(() => [table.getLeftHeaderGroups(), table.getCenterHeaderGroups(), table.getRightHeaderGroups()], (left, center, right) => {
|
|
229
140
|
var _left$0$headers, _left$, _center$0$headers, _center$, _right$0$headers, _right$;
|
|
230
141
|
return [...((_left$0$headers = (_left$ = left[0]) == null ? void 0 : _left$.headers) != null ? _left$0$headers : []), ...((_center$0$headers = (_center$ = center[0]) == null ? void 0 : _center$.headers) != null ? _center$0$headers : []), ...((_right$0$headers = (_right$ = right[0]) == null ? void 0 : _right$.headers) != null ? _right$0$headers : [])].map(header => {
|
|
231
142
|
return header.getLeafHeaders();
|
|
232
143
|
}).flat();
|
|
233
|
-
},
|
|
234
|
-
key: process.env.NODE_ENV === 'development' && 'getLeafHeaders',
|
|
235
|
-
debug: () => {
|
|
236
|
-
var _table$options$debugA16;
|
|
237
|
-
return (_table$options$debugA16 = table.options.debugAll) != null ? _table$options$debugA16 : table.options.debugHeaders;
|
|
238
|
-
}
|
|
239
|
-
});
|
|
144
|
+
}, utils.getMemoOptions(table.options, debug, 'getLeafHeaders'));
|
|
240
145
|
}
|
|
241
146
|
};
|
|
242
147
|
function buildHeaderGroups(allColumns, columnsToGroup, table, headerFamily) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headers.js","sources":["../../../src/core/headers.ts"],"sourcesContent":["import { RowData, Column, Header, HeaderGroup, Table } from '../types'\nimport { memo } from '../utils'\nimport { TableFeature } from './table'\n\nexport interface CoreHeaderGroup<TData extends RowData> {\n depth: number\n headers: Header<TData, unknown>[]\n id: string\n}\n\nexport interface HeaderContext<TData, TValue> {\n /**\n * An instance of a column.\n */\n column: Column<TData, TValue>\n /**\n * An instance of a header.\n */\n header: Header<TData, TValue>\n /**\n * The table instance.\n */\n table: Table<TData>\n}\n\nexport interface CoreHeader<TData extends RowData, TValue> {\n /**\n * The col-span for the header.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#colspan)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n colSpan: number\n /**\n * The header's associated column object.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#column)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n column: Column<TData, TValue>\n /**\n * The depth of the header, zero-indexed based.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#depth)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n depth: number\n /**\n * Returns the rendering context (or props) for column-based components like headers, footers and filters.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#getcontext)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getContext: () => HeaderContext<TData, TValue>\n /**\n * Returns the leaf headers hierarchically nested under this header.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#getleafheaders)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getLeafHeaders: () => Header<TData, unknown>[]\n /**\n * The header's associated header group object.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#headergroup)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n headerGroup: HeaderGroup<TData>\n /**\n * The unique identifier for the header.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#id)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n id: string\n /**\n * The index for the header within the header group.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#index)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n index: number\n /**\n * A boolean denoting if the header is a placeholder header.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#isplaceholder)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n isPlaceholder: boolean\n /**\n * If the header is a placeholder header, this will be a unique header ID that does not conflict with any other headers across the table.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#placeholderid)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n placeholderId?: string\n /**\n * The row-span for the header.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#rowspan)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n rowSpan: number\n /**\n * The header's hierarchical sub/child headers. Will be empty if the header's associated column is a leaf-column.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#subheaders)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n subHeaders: Header<TData, TValue>[]\n}\n\nexport interface HeadersInstance<TData extends RowData> {\n /**\n * Returns all header groups for the table.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getheadergroups)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getHeaderGroups: () => HeaderGroup<TData>[]\n /**\n * If pinning, returns the header groups for the left pinned columns.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getleftheadergroups)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getLeftHeaderGroups: () => HeaderGroup<TData>[]\n /**\n * If pinning, returns the header groups for columns that are not pinned.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getcenterheadergroups)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getCenterHeaderGroups: () => HeaderGroup<TData>[]\n /**\n * If pinning, returns the header groups for the right pinned columns.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getrightheadergroups)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getRightHeaderGroups: () => HeaderGroup<TData>[]\n\n /**\n * Returns the footer groups for the table.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getfootergroups)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getFooterGroups: () => HeaderGroup<TData>[]\n /**\n * If pinning, returns the footer groups for the left pinned columns.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getleftfootergroups)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getLeftFooterGroups: () => HeaderGroup<TData>[]\n /**\n * If pinning, returns the footer groups for columns that are not pinned.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getcenterfootergroups)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getCenterFooterGroups: () => HeaderGroup<TData>[]\n /**\n * If pinning, returns the footer groups for the right pinned columns.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getrightfootergroups)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getRightFooterGroups: () => HeaderGroup<TData>[]\n\n /**\n * Returns headers for all columns in the table, including parent headers.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getflatheaders)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getFlatHeaders: () => Header<TData, unknown>[]\n /**\n * If pinning, returns headers for all left pinned columns in the table, including parent headers.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getleftflatheaders)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getLeftFlatHeaders: () => Header<TData, unknown>[]\n /**\n * If pinning, returns headers for all columns that are not pinned, including parent headers.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getcenterflatheaders)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getCenterFlatHeaders: () => Header<TData, unknown>[]\n /**\n * If pinning, returns headers for all right pinned columns in the table, including parent headers.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getrightflatheaders)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getRightFlatHeaders: () => Header<TData, unknown>[]\n\n /**\n * Returns headers for all leaf columns in the table, (not including parent headers).\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getleafheaders)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getLeafHeaders: () => Header<TData, unknown>[]\n /**\n * If pinning, returns headers for all left pinned leaf columns in the table, (not including parent headers).\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getleftleafheaders)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getLeftLeafHeaders: () => Header<TData, unknown>[]\n /**\n * If pinning, returns headers for all columns that are not pinned, (not including parent headers).\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getcenterleafheaders)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getCenterLeafHeaders: () => Header<TData, unknown>[]\n /**\n * If pinning, returns headers for all right pinned leaf columns in the table, (not including parent headers).\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getrightleafheaders)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getRightLeafHeaders: () => Header<TData, unknown>[]\n}\n\n//\n\nfunction createHeader<TData extends RowData, TValue>(\n table: Table<TData>,\n column: Column<TData, TValue>,\n options: {\n id?: string\n isPlaceholder?: boolean\n placeholderId?: string\n index: number\n depth: number\n }\n): Header<TData, TValue> {\n const id = options.id ?? column.id\n\n let header: CoreHeader<TData, TValue> = {\n id,\n column,\n index: options.index,\n isPlaceholder: !!options.isPlaceholder,\n placeholderId: options.placeholderId,\n depth: options.depth,\n subHeaders: [],\n colSpan: 0,\n rowSpan: 0,\n headerGroup: null!,\n getLeafHeaders: (): Header<TData, unknown>[] => {\n const leafHeaders: Header<TData, unknown>[] = []\n\n const recurseHeader = (h: CoreHeader<TData, any>) => {\n if (h.subHeaders && h.subHeaders.length) {\n h.subHeaders.map(recurseHeader)\n }\n leafHeaders.push(h as Header<TData, unknown>)\n }\n\n recurseHeader(header)\n\n return leafHeaders\n },\n getContext: () => ({\n table,\n header: header as Header<TData, TValue>,\n column,\n }),\n }\n\n table._features.forEach(feature => {\n feature.createHeader?.(header, table)\n })\n\n return header as Header<TData, TValue>\n}\n\nexport const Headers: TableFeature = {\n createTable: <TData extends RowData>(table: Table<TData>): void => {\n // Header Groups\n\n table.getHeaderGroups = memo(\n () => [\n table.getAllColumns(),\n table.getVisibleLeafColumns(),\n table.getState().columnPinning.left,\n table.getState().columnPinning.right,\n ],\n (allColumns, leafColumns, left, right) => {\n const leftColumns =\n left\n ?.map(columnId => leafColumns.find(d => d.id === columnId)!)\n .filter(Boolean) ?? []\n\n const rightColumns =\n right\n ?.map(columnId => leafColumns.find(d => d.id === columnId)!)\n .filter(Boolean) ?? []\n\n const centerColumns = leafColumns.filter(\n column => !left?.includes(column.id) && !right?.includes(column.id)\n )\n\n const headerGroups = buildHeaderGroups(\n allColumns,\n [...leftColumns, ...centerColumns, ...rightColumns],\n table\n )\n\n return headerGroups\n },\n {\n key: process.env.NODE_ENV === 'development' && 'getHeaderGroups',\n debug: () => table.options.debugAll ?? table.options.debugHeaders,\n }\n )\n\n table.getCenterHeaderGroups = memo(\n () => [\n table.getAllColumns(),\n table.getVisibleLeafColumns(),\n table.getState().columnPinning.left,\n table.getState().columnPinning.right,\n ],\n (allColumns, leafColumns, left, right) => {\n leafColumns = leafColumns.filter(\n column => !left?.includes(column.id) && !right?.includes(column.id)\n )\n return buildHeaderGroups(allColumns, leafColumns, table, 'center')\n },\n {\n key: process.env.NODE_ENV === 'development' && 'getCenterHeaderGroups',\n debug: () => table.options.debugAll ?? table.options.debugHeaders,\n }\n )\n\n table.getLeftHeaderGroups = memo(\n () => [\n table.getAllColumns(),\n table.getVisibleLeafColumns(),\n table.getState().columnPinning.left,\n ],\n (allColumns, leafColumns, left) => {\n const orderedLeafColumns =\n left\n ?.map(columnId => leafColumns.find(d => d.id === columnId)!)\n .filter(Boolean) ?? []\n\n return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'left')\n },\n {\n key: process.env.NODE_ENV === 'development' && 'getLeftHeaderGroups',\n debug: () => table.options.debugAll ?? table.options.debugHeaders,\n }\n )\n\n table.getRightHeaderGroups = memo(\n () => [\n table.getAllColumns(),\n table.getVisibleLeafColumns(),\n table.getState().columnPinning.right,\n ],\n (allColumns, leafColumns, right) => {\n const orderedLeafColumns =\n right\n ?.map(columnId => leafColumns.find(d => d.id === columnId)!)\n .filter(Boolean) ?? []\n\n return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'right')\n },\n {\n key: process.env.NODE_ENV === 'development' && 'getRightHeaderGroups',\n debug: () => table.options.debugAll ?? table.options.debugHeaders,\n }\n )\n\n // Footer Groups\n\n table.getFooterGroups = memo(\n () => [table.getHeaderGroups()],\n headerGroups => {\n return [...headerGroups].reverse()\n },\n {\n key: process.env.NODE_ENV === 'development' && 'getFooterGroups',\n debug: () => table.options.debugAll ?? table.options.debugHeaders,\n }\n )\n\n table.getLeftFooterGroups = memo(\n () => [table.getLeftHeaderGroups()],\n headerGroups => {\n return [...headerGroups].reverse()\n },\n {\n key: process.env.NODE_ENV === 'development' && 'getLeftFooterGroups',\n debug: () => table.options.debugAll ?? table.options.debugHeaders,\n }\n )\n\n table.getCenterFooterGroups = memo(\n () => [table.getCenterHeaderGroups()],\n headerGroups => {\n return [...headerGroups].reverse()\n },\n {\n key: process.env.NODE_ENV === 'development' && 'getCenterFooterGroups',\n debug: () => table.options.debugAll ?? table.options.debugHeaders,\n }\n )\n\n table.getRightFooterGroups = memo(\n () => [table.getRightHeaderGroups()],\n headerGroups => {\n return [...headerGroups].reverse()\n },\n {\n key: process.env.NODE_ENV === 'development' && 'getRightFooterGroups',\n debug: () => table.options.debugAll ?? table.options.debugHeaders,\n }\n )\n\n // Flat Headers\n\n table.getFlatHeaders = memo(\n () => [table.getHeaderGroups()],\n headerGroups => {\n return headerGroups\n .map(headerGroup => {\n return headerGroup.headers\n })\n .flat()\n },\n {\n key: process.env.NODE_ENV === 'development' && 'getFlatHeaders',\n debug: () => table.options.debugAll ?? table.options.debugHeaders,\n }\n )\n\n table.getLeftFlatHeaders = memo(\n () => [table.getLeftHeaderGroups()],\n left => {\n return left\n .map(headerGroup => {\n return headerGroup.headers\n })\n .flat()\n },\n {\n key: process.env.NODE_ENV === 'development' && 'getLeftFlatHeaders',\n debug: () => table.options.debugAll ?? table.options.debugHeaders,\n }\n )\n\n table.getCenterFlatHeaders = memo(\n () => [table.getCenterHeaderGroups()],\n left => {\n return left\n .map(headerGroup => {\n return headerGroup.headers\n })\n .flat()\n },\n {\n key: process.env.NODE_ENV === 'development' && 'getCenterFlatHeaders',\n debug: () => table.options.debugAll ?? table.options.debugHeaders,\n }\n )\n\n table.getRightFlatHeaders = memo(\n () => [table.getRightHeaderGroups()],\n left => {\n return left\n .map(headerGroup => {\n return headerGroup.headers\n })\n .flat()\n },\n {\n key: process.env.NODE_ENV === 'development' && 'getRightFlatHeaders',\n debug: () => table.options.debugAll ?? table.options.debugHeaders,\n }\n )\n\n // Leaf Headers\n\n table.getCenterLeafHeaders = memo(\n () => [table.getCenterFlatHeaders()],\n flatHeaders => {\n return flatHeaders.filter(header => !header.subHeaders?.length)\n },\n {\n key: process.env.NODE_ENV === 'development' && 'getCenterLeafHeaders',\n debug: () => table.options.debugAll ?? table.options.debugHeaders,\n }\n )\n\n table.getLeftLeafHeaders = memo(\n () => [table.getLeftFlatHeaders()],\n flatHeaders => {\n return flatHeaders.filter(header => !header.subHeaders?.length)\n },\n {\n key: process.env.NODE_ENV === 'development' && 'getLeftLeafHeaders',\n debug: () => table.options.debugAll ?? table.options.debugHeaders,\n }\n )\n\n table.getRightLeafHeaders = memo(\n () => [table.getRightFlatHeaders()],\n flatHeaders => {\n return flatHeaders.filter(header => !header.subHeaders?.length)\n },\n {\n key: process.env.NODE_ENV === 'development' && 'getRightLeafHeaders',\n debug: () => table.options.debugAll ?? table.options.debugHeaders,\n }\n )\n\n table.getLeafHeaders = memo(\n () => [\n table.getLeftHeaderGroups(),\n table.getCenterHeaderGroups(),\n table.getRightHeaderGroups(),\n ],\n (left, center, right) => {\n return [\n ...(left[0]?.headers ?? []),\n ...(center[0]?.headers ?? []),\n ...(right[0]?.headers ?? []),\n ]\n .map(header => {\n return header.getLeafHeaders()\n })\n .flat()\n },\n {\n key: process.env.NODE_ENV === 'development' && 'getLeafHeaders',\n debug: () => table.options.debugAll ?? table.options.debugHeaders,\n }\n )\n },\n}\n\nexport function buildHeaderGroups<TData extends RowData>(\n allColumns: Column<TData, unknown>[],\n columnsToGroup: Column<TData, unknown>[],\n table: Table<TData>,\n headerFamily?: 'center' | 'left' | 'right'\n) {\n // Find the max depth of the columns:\n // build the leaf column row\n // build each buffer row going up\n // placeholder for non-existent level\n // real column for existing level\n\n let maxDepth = 0\n\n const findMaxDepth = (columns: Column<TData, unknown>[], depth = 1) => {\n maxDepth = Math.max(maxDepth, depth)\n\n columns\n .filter(column => column.getIsVisible())\n .forEach(column => {\n if (column.columns?.length) {\n findMaxDepth(column.columns, depth + 1)\n }\n }, 0)\n }\n\n findMaxDepth(allColumns)\n\n let headerGroups: HeaderGroup<TData>[] = []\n\n const createHeaderGroup = (\n headersToGroup: Header<TData, unknown>[],\n depth: number\n ) => {\n // The header group we are creating\n const headerGroup: HeaderGroup<TData> = {\n depth,\n id: [headerFamily, `${depth}`].filter(Boolean).join('_'),\n headers: [],\n }\n\n // The parent columns we're going to scan next\n const pendingParentHeaders: Header<TData, unknown>[] = []\n\n // Scan each column for parents\n headersToGroup.forEach(headerToGroup => {\n // What is the latest (last) parent column?\n\n const latestPendingParentHeader = [...pendingParentHeaders].reverse()[0]\n\n const isLeafHeader = headerToGroup.column.depth === headerGroup.depth\n\n let column: Column<TData, unknown>\n let isPlaceholder = false\n\n if (isLeafHeader && headerToGroup.column.parent) {\n // The parent header is new\n column = headerToGroup.column.parent\n } else {\n // The parent header is repeated\n column = headerToGroup.column\n isPlaceholder = true\n }\n\n if (\n latestPendingParentHeader &&\n latestPendingParentHeader?.column === column\n ) {\n // This column is repeated. Add it as a sub header to the next batch\n latestPendingParentHeader.subHeaders.push(headerToGroup)\n } else {\n // This is a new header. Let's create it\n const header = createHeader(table, column, {\n id: [headerFamily, depth, column.id, headerToGroup?.id]\n .filter(Boolean)\n .join('_'),\n isPlaceholder,\n placeholderId: isPlaceholder\n ? `${pendingParentHeaders.filter(d => d.column === column).length}`\n : undefined,\n depth,\n index: pendingParentHeaders.length,\n })\n\n // Add the headerToGroup as a subHeader of the new header\n header.subHeaders.push(headerToGroup)\n // Add the new header to the pendingParentHeaders to get grouped\n // in the next batch\n pendingParentHeaders.push(header)\n }\n\n headerGroup.headers.push(headerToGroup)\n headerToGroup.headerGroup = headerGroup\n })\n\n headerGroups.push(headerGroup)\n\n if (depth > 0) {\n createHeaderGroup(pendingParentHeaders, depth - 1)\n }\n }\n\n const bottomHeaders = columnsToGroup.map((column, index) =>\n createHeader(table, column, {\n depth: maxDepth,\n index,\n })\n )\n\n createHeaderGroup(bottomHeaders, maxDepth - 1)\n\n headerGroups.reverse()\n\n // headerGroups = headerGroups.filter(headerGroup => {\n // return !headerGroup.headers.every(header => header.isPlaceholder)\n // })\n\n const recurseHeadersForSpans = (\n headers: Header<TData, unknown>[]\n ): { colSpan: number; rowSpan: number }[] => {\n const filteredHeaders = headers.filter(header =>\n header.column.getIsVisible()\n )\n\n return filteredHeaders.map(header => {\n let colSpan = 0\n let rowSpan = 0\n let childRowSpans = [0]\n\n if (header.subHeaders && header.subHeaders.length) {\n childRowSpans = []\n\n recurseHeadersForSpans(header.subHeaders).forEach(\n ({ colSpan: childColSpan, rowSpan: childRowSpan }) => {\n colSpan += childColSpan\n childRowSpans.push(childRowSpan)\n }\n )\n } else {\n colSpan = 1\n }\n\n const minChildRowSpan = Math.min(...childRowSpans)\n rowSpan = rowSpan + minChildRowSpan\n\n header.colSpan = colSpan\n header.rowSpan = rowSpan\n\n return { colSpan, rowSpan }\n })\n }\n\n recurseHeadersForSpans(headerGroups[0]?.headers ?? [])\n\n return headerGroups\n}\n"],"names":["createHeader","table","column","options","_options$id","id","header","index","isPlaceholder","placeholderId","depth","subHeaders","colSpan","rowSpan","headerGroup","getLeafHeaders","leafHeaders","recurseHeader","h","length","map","push","getContext","_features","forEach","feature","Headers","createTable","getHeaderGroups","memo","getAllColumns","getVisibleLeafColumns","getState","columnPinning","left","right","allColumns","leafColumns","_left$map$filter","_right$map$filter","leftColumns","columnId","find","d","filter","Boolean","rightColumns","centerColumns","includes","headerGroups","buildHeaderGroups","key","process","env","NODE_ENV","debug","_table$options$debugA","debugAll","debugHeaders","getCenterHeaderGroups","_table$options$debugA2","getLeftHeaderGroups","_left$map$filter2","orderedLeafColumns","_table$options$debugA3","getRightHeaderGroups","_right$map$filter2","_table$options$debugA4","getFooterGroups","reverse","_table$options$debugA5","getLeftFooterGroups","_table$options$debugA6","getCenterFooterGroups","_table$options$debugA7","getRightFooterGroups","_table$options$debugA8","getFlatHeaders","headers","flat","_table$options$debugA9","getLeftFlatHeaders","_table$options$debugA10","getCenterFlatHeaders","_table$options$debugA11","getRightFlatHeaders","_table$options$debugA12","getCenterLeafHeaders","flatHeaders","_header$subHeaders","_table$options$debugA13","getLeftLeafHeaders","_header$subHeaders2","_table$options$debugA14","getRightLeafHeaders","_header$subHeaders3","_table$options$debugA15","center","_left$0$headers","_left$","_center$0$headers","_center$","_right$0$headers","_right$","_table$options$debugA16","columnsToGroup","headerFamily","_headerGroups$0$heade","_headerGroups$","maxDepth","findMaxDepth","columns","Math","max","getIsVisible","_column$columns","createHeaderGroup","headersToGroup","join","pendingParentHeaders","headerToGroup","latestPendingParentHeader","isLeafHeader","parent","undefined","bottomHeaders","recurseHeadersForSpans","filteredHeaders","childRowSpans","_ref","childColSpan","childRowSpan","minChildRowSpan","min"],"mappings":";;;;;;;;;;;;;;AA0MA;;AAEA,SAASA,YAAYA,CACnBC,KAAmB,EACnBC,MAA6B,EAC7BC,OAMC,EACsB;AAAA,EAAA,IAAAC,WAAA,CAAA;AACvB,EAAA,MAAMC,EAAE,GAAA,CAAAD,WAAA,GAAGD,OAAO,CAACE,EAAE,KAAA,IAAA,GAAAD,WAAA,GAAIF,MAAM,CAACG,EAAE,CAAA;AAElC,EAAA,IAAIC,MAAiC,GAAG;IACtCD,EAAE;IACFH,MAAM;IACNK,KAAK,EAAEJ,OAAO,CAACI,KAAK;AACpBC,IAAAA,aAAa,EAAE,CAAC,CAACL,OAAO,CAACK,aAAa;IACtCC,aAAa,EAAEN,OAAO,CAACM,aAAa;IACpCC,KAAK,EAAEP,OAAO,CAACO,KAAK;AACpBC,IAAAA,UAAU,EAAE,EAAE;AACdC,IAAAA,OAAO,EAAE,CAAC;AACVC,IAAAA,OAAO,EAAE,CAAC;AACVC,IAAAA,WAAW,EAAE,IAAK;IAClBC,cAAc,EAAEA,MAAgC;MAC9C,MAAMC,WAAqC,GAAG,EAAE,CAAA;MAEhD,MAAMC,aAAa,GAAIC,CAAyB,IAAK;QACnD,IAAIA,CAAC,CAACP,UAAU,IAAIO,CAAC,CAACP,UAAU,CAACQ,MAAM,EAAE;AACv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B;;;;;"}
|
|
1
|
+
{"version":3,"file":"headers.js","sources":["../../../src/core/headers.ts"],"sourcesContent":["import { RowData, Column, Header, HeaderGroup, Table } from '../types'\nimport { getMemoOptions, memo } from '../utils'\nimport { TableFeature } from './table'\n\nconst debug = 'debugHeaders'\n\nexport interface CoreHeaderGroup<TData extends RowData> {\n depth: number\n headers: Header<TData, unknown>[]\n id: string\n}\n\nexport interface HeaderContext<TData, TValue> {\n /**\n * An instance of a column.\n */\n column: Column<TData, TValue>\n /**\n * An instance of a header.\n */\n header: Header<TData, TValue>\n /**\n * The table instance.\n */\n table: Table<TData>\n}\n\nexport interface CoreHeader<TData extends RowData, TValue> {\n /**\n * The col-span for the header.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#colspan)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n colSpan: number\n /**\n * The header's associated column object.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#column)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n column: Column<TData, TValue>\n /**\n * The depth of the header, zero-indexed based.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#depth)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n depth: number\n /**\n * Returns the rendering context (or props) for column-based components like headers, footers and filters.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#getcontext)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getContext: () => HeaderContext<TData, TValue>\n /**\n * Returns the leaf headers hierarchically nested under this header.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#getleafheaders)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getLeafHeaders: () => Header<TData, unknown>[]\n /**\n * The header's associated header group object.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#headergroup)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n headerGroup: HeaderGroup<TData>\n /**\n * The unique identifier for the header.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#id)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n id: string\n /**\n * The index for the header within the header group.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#index)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n index: number\n /**\n * A boolean denoting if the header is a placeholder header.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#isplaceholder)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n isPlaceholder: boolean\n /**\n * If the header is a placeholder header, this will be a unique header ID that does not conflict with any other headers across the table.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#placeholderid)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n placeholderId?: string\n /**\n * The row-span for the header.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#rowspan)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n rowSpan: number\n /**\n * The header's hierarchical sub/child headers. Will be empty if the header's associated column is a leaf-column.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#subheaders)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n subHeaders: Header<TData, TValue>[]\n}\n\nexport interface HeadersInstance<TData extends RowData> {\n /**\n * Returns all header groups for the table.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getheadergroups)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getHeaderGroups: () => HeaderGroup<TData>[]\n /**\n * If pinning, returns the header groups for the left pinned columns.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getleftheadergroups)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getLeftHeaderGroups: () => HeaderGroup<TData>[]\n /**\n * If pinning, returns the header groups for columns that are not pinned.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getcenterheadergroups)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getCenterHeaderGroups: () => HeaderGroup<TData>[]\n /**\n * If pinning, returns the header groups for the right pinned columns.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getrightheadergroups)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getRightHeaderGroups: () => HeaderGroup<TData>[]\n\n /**\n * Returns the footer groups for the table.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getfootergroups)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getFooterGroups: () => HeaderGroup<TData>[]\n /**\n * If pinning, returns the footer groups for the left pinned columns.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getleftfootergroups)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getLeftFooterGroups: () => HeaderGroup<TData>[]\n /**\n * If pinning, returns the footer groups for columns that are not pinned.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getcenterfootergroups)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getCenterFooterGroups: () => HeaderGroup<TData>[]\n /**\n * If pinning, returns the footer groups for the right pinned columns.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getrightfootergroups)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getRightFooterGroups: () => HeaderGroup<TData>[]\n\n /**\n * Returns headers for all columns in the table, including parent headers.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getflatheaders)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getFlatHeaders: () => Header<TData, unknown>[]\n /**\n * If pinning, returns headers for all left pinned columns in the table, including parent headers.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getleftflatheaders)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getLeftFlatHeaders: () => Header<TData, unknown>[]\n /**\n * If pinning, returns headers for all columns that are not pinned, including parent headers.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getcenterflatheaders)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getCenterFlatHeaders: () => Header<TData, unknown>[]\n /**\n * If pinning, returns headers for all right pinned columns in the table, including parent headers.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getrightflatheaders)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getRightFlatHeaders: () => Header<TData, unknown>[]\n\n /**\n * Returns headers for all leaf columns in the table, (not including parent headers).\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getleafheaders)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getLeafHeaders: () => Header<TData, unknown>[]\n /**\n * If pinning, returns headers for all left pinned leaf columns in the table, (not including parent headers).\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getleftleafheaders)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getLeftLeafHeaders: () => Header<TData, unknown>[]\n /**\n * If pinning, returns headers for all columns that are not pinned, (not including parent headers).\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getcenterleafheaders)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getCenterLeafHeaders: () => Header<TData, unknown>[]\n /**\n * If pinning, returns headers for all right pinned leaf columns in the table, (not including parent headers).\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getrightleafheaders)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/headers)\n */\n getRightLeafHeaders: () => Header<TData, unknown>[]\n}\n\n//\n\nfunction createHeader<TData extends RowData, TValue>(\n table: Table<TData>,\n column: Column<TData, TValue>,\n options: {\n id?: string\n isPlaceholder?: boolean\n placeholderId?: string\n index: number\n depth: number\n }\n): Header<TData, TValue> {\n const id = options.id ?? column.id\n\n let header: CoreHeader<TData, TValue> = {\n id,\n column,\n index: options.index,\n isPlaceholder: !!options.isPlaceholder,\n placeholderId: options.placeholderId,\n depth: options.depth,\n subHeaders: [],\n colSpan: 0,\n rowSpan: 0,\n headerGroup: null!,\n getLeafHeaders: (): Header<TData, unknown>[] => {\n const leafHeaders: Header<TData, unknown>[] = []\n\n const recurseHeader = (h: CoreHeader<TData, any>) => {\n if (h.subHeaders && h.subHeaders.length) {\n h.subHeaders.map(recurseHeader)\n }\n leafHeaders.push(h as Header<TData, unknown>)\n }\n\n recurseHeader(header)\n\n return leafHeaders\n },\n getContext: () => ({\n table,\n header: header as Header<TData, TValue>,\n column,\n }),\n }\n\n table._features.forEach(feature => {\n feature.createHeader?.(header, table)\n })\n\n return header as Header<TData, TValue>\n}\n\nexport const Headers: TableFeature = {\n createTable: <TData extends RowData>(table: Table<TData>): void => {\n // Header Groups\n\n table.getHeaderGroups = memo(\n () => [\n table.getAllColumns(),\n table.getVisibleLeafColumns(),\n table.getState().columnPinning.left,\n table.getState().columnPinning.right,\n ],\n (allColumns, leafColumns, left, right) => {\n const leftColumns =\n left\n ?.map(columnId => leafColumns.find(d => d.id === columnId)!)\n .filter(Boolean) ?? []\n\n const rightColumns =\n right\n ?.map(columnId => leafColumns.find(d => d.id === columnId)!)\n .filter(Boolean) ?? []\n\n const centerColumns = leafColumns.filter(\n column => !left?.includes(column.id) && !right?.includes(column.id)\n )\n\n const headerGroups = buildHeaderGroups(\n allColumns,\n [...leftColumns, ...centerColumns, ...rightColumns],\n table\n )\n\n return headerGroups\n },\n getMemoOptions(table.options, debug, 'getHeaderGroups')\n )\n\n table.getCenterHeaderGroups = memo(\n () => [\n table.getAllColumns(),\n table.getVisibleLeafColumns(),\n table.getState().columnPinning.left,\n table.getState().columnPinning.right,\n ],\n (allColumns, leafColumns, left, right) => {\n leafColumns = leafColumns.filter(\n column => !left?.includes(column.id) && !right?.includes(column.id)\n )\n return buildHeaderGroups(allColumns, leafColumns, table, 'center')\n },\n getMemoOptions(table.options, debug, 'getCenterHeaderGroups')\n )\n\n table.getLeftHeaderGroups = memo(\n () => [\n table.getAllColumns(),\n table.getVisibleLeafColumns(),\n table.getState().columnPinning.left,\n ],\n (allColumns, leafColumns, left) => {\n const orderedLeafColumns =\n left\n ?.map(columnId => leafColumns.find(d => d.id === columnId)!)\n .filter(Boolean) ?? []\n\n return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'left')\n },\n getMemoOptions(table.options, debug, 'getLeftHeaderGroups')\n )\n\n table.getRightHeaderGroups = memo(\n () => [\n table.getAllColumns(),\n table.getVisibleLeafColumns(),\n table.getState().columnPinning.right,\n ],\n (allColumns, leafColumns, right) => {\n const orderedLeafColumns =\n right\n ?.map(columnId => leafColumns.find(d => d.id === columnId)!)\n .filter(Boolean) ?? []\n\n return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'right')\n },\n getMemoOptions(table.options, debug, 'getRightHeaderGroups')\n )\n\n // Footer Groups\n\n table.getFooterGroups = memo(\n () => [table.getHeaderGroups()],\n headerGroups => {\n return [...headerGroups].reverse()\n },\n getMemoOptions(table.options, debug, 'getFooterGroups')\n )\n\n table.getLeftFooterGroups = memo(\n () => [table.getLeftHeaderGroups()],\n headerGroups => {\n return [...headerGroups].reverse()\n },\n getMemoOptions(table.options, debug, 'getLeftFooterGroups')\n )\n\n table.getCenterFooterGroups = memo(\n () => [table.getCenterHeaderGroups()],\n headerGroups => {\n return [...headerGroups].reverse()\n },\n getMemoOptions(table.options, debug, 'getCenterFooterGroups')\n )\n\n table.getRightFooterGroups = memo(\n () => [table.getRightHeaderGroups()],\n headerGroups => {\n return [...headerGroups].reverse()\n },\n getMemoOptions(table.options, debug, 'getRightFooterGroups')\n )\n\n // Flat Headers\n\n table.getFlatHeaders = memo(\n () => [table.getHeaderGroups()],\n headerGroups => {\n return headerGroups\n .map(headerGroup => {\n return headerGroup.headers\n })\n .flat()\n },\n getMemoOptions(table.options, debug, 'getFlatHeaders')\n )\n\n table.getLeftFlatHeaders = memo(\n () => [table.getLeftHeaderGroups()],\n left => {\n return left\n .map(headerGroup => {\n return headerGroup.headers\n })\n .flat()\n },\n getMemoOptions(table.options, debug, 'getLeftFlatHeaders')\n )\n\n table.getCenterFlatHeaders = memo(\n () => [table.getCenterHeaderGroups()],\n left => {\n return left\n .map(headerGroup => {\n return headerGroup.headers\n })\n .flat()\n },\n getMemoOptions(table.options, debug, 'getCenterFlatHeaders')\n )\n\n table.getRightFlatHeaders = memo(\n () => [table.getRightHeaderGroups()],\n left => {\n return left\n .map(headerGroup => {\n return headerGroup.headers\n })\n .flat()\n },\n getMemoOptions(table.options, debug, 'getRightFlatHeaders')\n )\n\n // Leaf Headers\n\n table.getCenterLeafHeaders = memo(\n () => [table.getCenterFlatHeaders()],\n flatHeaders => {\n return flatHeaders.filter(header => !header.subHeaders?.length)\n },\n getMemoOptions(table.options, debug, 'getCenterLeafHeaders')\n )\n\n table.getLeftLeafHeaders = memo(\n () => [table.getLeftFlatHeaders()],\n flatHeaders => {\n return flatHeaders.filter(header => !header.subHeaders?.length)\n },\n getMemoOptions(table.options, debug, 'getLeftLeafHeaders')\n )\n\n table.getRightLeafHeaders = memo(\n () => [table.getRightFlatHeaders()],\n flatHeaders => {\n return flatHeaders.filter(header => !header.subHeaders?.length)\n },\n getMemoOptions(table.options, debug, 'getRightLeafHeaders')\n )\n\n table.getLeafHeaders = memo(\n () => [\n table.getLeftHeaderGroups(),\n table.getCenterHeaderGroups(),\n table.getRightHeaderGroups(),\n ],\n (left, center, right) => {\n return [\n ...(left[0]?.headers ?? []),\n ...(center[0]?.headers ?? []),\n ...(right[0]?.headers ?? []),\n ]\n .map(header => {\n return header.getLeafHeaders()\n })\n .flat()\n },\n getMemoOptions(table.options, debug, 'getLeafHeaders')\n )\n },\n}\n\nexport function buildHeaderGroups<TData extends RowData>(\n allColumns: Column<TData, unknown>[],\n columnsToGroup: Column<TData, unknown>[],\n table: Table<TData>,\n headerFamily?: 'center' | 'left' | 'right'\n) {\n // Find the max depth of the columns:\n // build the leaf column row\n // build each buffer row going up\n // placeholder for non-existent level\n // real column for existing level\n\n let maxDepth = 0\n\n const findMaxDepth = (columns: Column<TData, unknown>[], depth = 1) => {\n maxDepth = Math.max(maxDepth, depth)\n\n columns\n .filter(column => column.getIsVisible())\n .forEach(column => {\n if (column.columns?.length) {\n findMaxDepth(column.columns, depth + 1)\n }\n }, 0)\n }\n\n findMaxDepth(allColumns)\n\n let headerGroups: HeaderGroup<TData>[] = []\n\n const createHeaderGroup = (\n headersToGroup: Header<TData, unknown>[],\n depth: number\n ) => {\n // The header group we are creating\n const headerGroup: HeaderGroup<TData> = {\n depth,\n id: [headerFamily, `${depth}`].filter(Boolean).join('_'),\n headers: [],\n }\n\n // The parent columns we're going to scan next\n const pendingParentHeaders: Header<TData, unknown>[] = []\n\n // Scan each column for parents\n headersToGroup.forEach(headerToGroup => {\n // What is the latest (last) parent column?\n\n const latestPendingParentHeader = [...pendingParentHeaders].reverse()[0]\n\n const isLeafHeader = headerToGroup.column.depth === headerGroup.depth\n\n let column: Column<TData, unknown>\n let isPlaceholder = false\n\n if (isLeafHeader && headerToGroup.column.parent) {\n // The parent header is new\n column = headerToGroup.column.parent\n } else {\n // The parent header is repeated\n column = headerToGroup.column\n isPlaceholder = true\n }\n\n if (\n latestPendingParentHeader &&\n latestPendingParentHeader?.column === column\n ) {\n // This column is repeated. Add it as a sub header to the next batch\n latestPendingParentHeader.subHeaders.push(headerToGroup)\n } else {\n // This is a new header. Let's create it\n const header = createHeader(table, column, {\n id: [headerFamily, depth, column.id, headerToGroup?.id]\n .filter(Boolean)\n .join('_'),\n isPlaceholder,\n placeholderId: isPlaceholder\n ? `${pendingParentHeaders.filter(d => d.column === column).length}`\n : undefined,\n depth,\n index: pendingParentHeaders.length,\n })\n\n // Add the headerToGroup as a subHeader of the new header\n header.subHeaders.push(headerToGroup)\n // Add the new header to the pendingParentHeaders to get grouped\n // in the next batch\n pendingParentHeaders.push(header)\n }\n\n headerGroup.headers.push(headerToGroup)\n headerToGroup.headerGroup = headerGroup\n })\n\n headerGroups.push(headerGroup)\n\n if (depth > 0) {\n createHeaderGroup(pendingParentHeaders, depth - 1)\n }\n }\n\n const bottomHeaders = columnsToGroup.map((column, index) =>\n createHeader(table, column, {\n depth: maxDepth,\n index,\n })\n )\n\n createHeaderGroup(bottomHeaders, maxDepth - 1)\n\n headerGroups.reverse()\n\n // headerGroups = headerGroups.filter(headerGroup => {\n // return !headerGroup.headers.every(header => header.isPlaceholder)\n // })\n\n const recurseHeadersForSpans = (\n headers: Header<TData, unknown>[]\n ): { colSpan: number; rowSpan: number }[] => {\n const filteredHeaders = headers.filter(header =>\n header.column.getIsVisible()\n )\n\n return filteredHeaders.map(header => {\n let colSpan = 0\n let rowSpan = 0\n let childRowSpans = [0]\n\n if (header.subHeaders && header.subHeaders.length) {\n childRowSpans = []\n\n recurseHeadersForSpans(header.subHeaders).forEach(\n ({ colSpan: childColSpan, rowSpan: childRowSpan }) => {\n colSpan += childColSpan\n childRowSpans.push(childRowSpan)\n }\n )\n } else {\n colSpan = 1\n }\n\n const minChildRowSpan = Math.min(...childRowSpans)\n rowSpan = rowSpan + minChildRowSpan\n\n header.colSpan = colSpan\n header.rowSpan = rowSpan\n\n return { colSpan, rowSpan }\n })\n }\n\n recurseHeadersForSpans(headerGroups[0]?.headers ?? [])\n\n return headerGroups\n}\n"],"names":["debug","createHeader","table","column","options","_options$id","id","header","index","isPlaceholder","placeholderId","depth","subHeaders","colSpan","rowSpan","headerGroup","getLeafHeaders","leafHeaders","recurseHeader","h","length","map","push","getContext","_features","forEach","feature","Headers","createTable","getHeaderGroups","memo","getAllColumns","getVisibleLeafColumns","getState","columnPinning","left","right","allColumns","leafColumns","_left$map$filter","_right$map$filter","leftColumns","columnId","find","d","filter","Boolean","rightColumns","centerColumns","includes","headerGroups","buildHeaderGroups","getMemoOptions","getCenterHeaderGroups","getLeftHeaderGroups","_left$map$filter2","orderedLeafColumns","getRightHeaderGroups","_right$map$filter2","getFooterGroups","reverse","getLeftFooterGroups","getCenterFooterGroups","getRightFooterGroups","getFlatHeaders","headers","flat","getLeftFlatHeaders","getCenterFlatHeaders","getRightFlatHeaders","getCenterLeafHeaders","flatHeaders","_header$subHeaders","getLeftLeafHeaders","_header$subHeaders2","getRightLeafHeaders","_header$subHeaders3","center","_left$0$headers","_left$","_center$0$headers","_center$","_right$0$headers","_right$","columnsToGroup","headerFamily","_headerGroups$0$heade","_headerGroups$","maxDepth","findMaxDepth","columns","Math","max","getIsVisible","_column$columns","createHeaderGroup","headersToGroup","join","pendingParentHeaders","headerToGroup","latestPendingParentHeader","isLeafHeader","parent","undefined","bottomHeaders","recurseHeadersForSpans","filteredHeaders","childRowSpans","_ref","childColSpan","childRowSpan","minChildRowSpan","min"],"mappings":";;;;;;;;;;;;;;AAIA,MAAMA,KAAK,GAAG,cAAc,CAAA;AAwM5B;;AAEA,SAASC,YAAYA,CACnBC,KAAmB,EACnBC,MAA6B,EAC7BC,OAMC,EACsB;AAAA,EAAA,IAAAC,WAAA,CAAA;AACvB,EAAA,MAAMC,EAAE,GAAA,CAAAD,WAAA,GAAGD,OAAO,CAACE,EAAE,KAAA,IAAA,GAAAD,WAAA,GAAIF,MAAM,CAACG,EAAE,CAAA;AAElC,EAAA,IAAIC,MAAiC,GAAG;IACtCD,EAAE;IACFH,MAAM;IACNK,KAAK,EAAEJ,OAAO,CAACI,KAAK;AACpBC,IAAAA,aAAa,EAAE,CAAC,CAACL,OAAO,CAACK,aAAa;IACtCC,aAAa,EAAEN,OAAO,CAACM,aAAa;IACpCC,KAAK,EAAEP,OAAO,CAACO,KAAK;AACpBC,IAAAA,UAAU,EAAE,EAAE;AACdC,IAAAA,OAAO,EAAE,CAAC;AACVC,IAAAA,OAAO,EAAE,CAAC;AACVC,IAAAA,WAAW,EAAE,IAAK;IAClBC,cAAc,EAAEA,MAAgC;MAC9C,MAAMC,WAAqC,GAAG,EAAE,CAAA;MAEhD,MAAMC,aAAa,GAAIC,CAAyB,IAAK;QACnD,IAAIA,CAAC,CAACP,UAAU,IAAIO,CAAC,CAACP,UAAU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OAAO,CAC/CmF,IAAA,IAAsD;UAAA,IAArD;AAAE/F,YAAAA,OAAO,EAAEgG,YAAY;AAAE/F,YAAAA,OAAO,EAAEgG,YAAAA;AAAa,WAAC,GAAAF,IAAA,CAAA;AAC/C/F,UAAAA,OAAO,IAAIgG,YAAY,CAAA;AACvBF,UAAAA,aAAa,CAACrF,IAAI,CAACwF,YAAY,CAAC,CAAA;AAClC,SACF,CAAC,CAAA;AACH,OAAC,MAAM;AACLjG,QAAAA,OAAO,GAAG,CAAC,CAAA;AACb,OAAA;MAEA,MAAMkG,eAAe,GAAGpB,IAAI,CAACqB,GAAG,CAAC,GAAGL,aAAa,CAAC,CAAA;MAClD7F,OAAO,GAAGA,OAAO,GAAGiG,eAAe,CAAA;MAEnCxG,MAAM,CAACM,OAAO,GAAGA,OAAO,CAAA;MACxBN,MAAM,CAACO,OAAO,GAAGA,OAAO,CAAA;MAExB,OAAO;QAAED,OAAO;AAAEC,QAAAA,OAAAA;OAAS,CAAA;AAC7B,KAAC,CAAC,CAAA;GACH,CAAA;AAED2F,EAAAA,sBAAsB,EAAAnB,qBAAA,GAAA,CAAAC,cAAA,GAACrC,YAAY,CAAC,CAAC,CAAC,KAAA,IAAA,GAAA,KAAA,CAAA,GAAfqC,cAAA,CAAiBtB,OAAO,YAAAqB,qBAAA,GAAI,EAAE,CAAC,CAAA;AAEtD,EAAA,OAAOpC,YAAY,CAAA;AACrB;;;;;"}
|
package/build/lib/core/row.js
CHANGED
|
@@ -70,25 +70,13 @@ const createRow = (table, id, original, rowIndex, depth, subRows, parentId) => {
|
|
|
70
70
|
return leafColumns.map(column => {
|
|
71
71
|
return cell.createCell(table, row, column, column.id);
|
|
72
72
|
});
|
|
73
|
-
},
|
|
74
|
-
key: process.env.NODE_ENV === 'development' && 'row.getAllCells',
|
|
75
|
-
debug: () => {
|
|
76
|
-
var _table$options$debugA;
|
|
77
|
-
return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
|
|
78
|
-
}
|
|
79
|
-
}),
|
|
73
|
+
}, utils.getMemoOptions(table.options, 'debugRows', 'getAllCells')),
|
|
80
74
|
_getAllCellsByColumnId: utils.memo(() => [row.getAllCells()], allCells => {
|
|
81
75
|
return allCells.reduce((acc, cell) => {
|
|
82
76
|
acc[cell.column.id] = cell;
|
|
83
77
|
return acc;
|
|
84
78
|
}, {});
|
|
85
|
-
},
|
|
86
|
-
key: process.env.NODE_ENV === 'production' && 'row.getAllCellsByColumnId',
|
|
87
|
-
debug: () => {
|
|
88
|
-
var _table$options$debugA2;
|
|
89
|
-
return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
|
|
90
|
-
}
|
|
91
|
-
})
|
|
79
|
+
}, utils.getMemoOptions(table.options, 'debugRows', 'getAllCellsByColumnId'))
|
|
92
80
|
};
|
|
93
81
|
for (let i = 0; i < table._features.length; i++) {
|
|
94
82
|
const feature = table._features[i];
|