@tanstack/table-core 9.0.0-alpha.47 → 9.0.0-alpha.48
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/README.md +10 -0
- package/dist/core/cells/coreCellsFeature.utils.cjs +11 -8
- package/dist/core/cells/coreCellsFeature.utils.cjs.map +1 -1
- package/dist/core/cells/coreCellsFeature.utils.d.cts +11 -8
- package/dist/core/cells/coreCellsFeature.utils.d.ts +11 -8
- package/dist/core/cells/coreCellsFeature.utils.js +11 -8
- package/dist/core/cells/coreCellsFeature.utils.js.map +1 -1
- package/dist/core/columns/coreColumnsFeature.types.d.cts +7 -6
- package/dist/core/columns/coreColumnsFeature.types.d.ts +7 -6
- package/dist/core/columns/coreColumnsFeature.utils.cjs +37 -27
- package/dist/core/columns/coreColumnsFeature.utils.cjs.map +1 -1
- package/dist/core/columns/coreColumnsFeature.utils.d.cts +37 -27
- package/dist/core/columns/coreColumnsFeature.utils.d.ts +37 -27
- package/dist/core/columns/coreColumnsFeature.utils.js +37 -27
- package/dist/core/columns/coreColumnsFeature.utils.js.map +1 -1
- package/dist/core/headers/coreHeadersFeature.types.d.cts +6 -4
- package/dist/core/headers/coreHeadersFeature.types.d.ts +6 -4
- package/dist/core/headers/coreHeadersFeature.utils.cjs +23 -18
- package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
- package/dist/core/headers/coreHeadersFeature.utils.d.cts +23 -18
- package/dist/core/headers/coreHeadersFeature.utils.d.ts +23 -18
- package/dist/core/headers/coreHeadersFeature.utils.js +23 -18
- package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.utils.cjs +48 -36
- package/dist/core/row-models/coreRowModelsFeature.utils.cjs.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.utils.d.cts +48 -36
- package/dist/core/row-models/coreRowModelsFeature.utils.d.ts +48 -36
- package/dist/core/row-models/coreRowModelsFeature.utils.js +48 -36
- package/dist/core/row-models/coreRowModelsFeature.utils.js.map +1 -1
- package/dist/core/rows/coreRowsFeature.types.d.cts +4 -4
- package/dist/core/rows/coreRowsFeature.types.d.ts +4 -4
- package/dist/core/rows/coreRowsFeature.utils.cjs +34 -28
- package/dist/core/rows/coreRowsFeature.utils.cjs.map +1 -1
- package/dist/core/rows/coreRowsFeature.utils.d.cts +34 -28
- package/dist/core/rows/coreRowsFeature.utils.d.ts +34 -28
- package/dist/core/rows/coreRowsFeature.utils.js +34 -28
- package/dist/core/rows/coreRowsFeature.utils.js.map +1 -1
- package/dist/core/table/coreTablesFeature.types.d.cts +6 -2
- package/dist/core/table/coreTablesFeature.types.d.ts +6 -2
- package/dist/core/table/coreTablesFeature.utils.cjs +2 -2
- package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
- package/dist/core/table/coreTablesFeature.utils.d.cts +2 -2
- package/dist/core/table/coreTablesFeature.utils.d.ts +2 -2
- package/dist/core/table/coreTablesFeature.utils.js +2 -2
- package/dist/core/table/coreTablesFeature.utils.js.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.types.d.cts +16 -10
- package/dist/features/column-faceting/columnFacetingFeature.types.d.ts +16 -10
- package/dist/features/column-faceting/columnFacetingFeature.utils.cjs +26 -18
- package/dist/features/column-faceting/columnFacetingFeature.utils.cjs.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.utils.d.cts +26 -18
- package/dist/features/column-faceting/columnFacetingFeature.utils.d.ts +26 -18
- package/dist/features/column-faceting/columnFacetingFeature.utils.js +26 -18
- package/dist/features/column-faceting/columnFacetingFeature.utils.js.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +21 -11
- package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +21 -11
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs +39 -28
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.cts +39 -28
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.ts +39 -28
- package/dist/features/column-filtering/columnFilteringFeature.utils.js +39 -28
- package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.types.d.cts +18 -14
- package/dist/features/column-grouping/columnGroupingFeature.types.d.ts +18 -14
- package/dist/features/column-grouping/columnGroupingFeature.utils.cjs +55 -43
- package/dist/features/column-grouping/columnGroupingFeature.utils.cjs.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.utils.d.cts +55 -43
- package/dist/features/column-grouping/columnGroupingFeature.utils.d.ts +55 -43
- package/dist/features/column-grouping/columnGroupingFeature.utils.js +55 -43
- package/dist/features/column-grouping/columnGroupingFeature.utils.js.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.types.d.cts +14 -5
- package/dist/features/column-ordering/columnOrderingFeature.types.d.ts +14 -5
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs +30 -23
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.cts +30 -23
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.ts +30 -23
- package/dist/features/column-ordering/columnOrderingFeature.utils.js +30 -23
- package/dist/features/column-ordering/columnOrderingFeature.utils.js.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.types.d.cts +43 -31
- package/dist/features/column-pinning/columnPinningFeature.types.d.ts +43 -31
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs +111 -91
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +111 -91
- package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +111 -91
- package/dist/features/column-pinning/columnPinningFeature.utils.js +111 -91
- package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.types.d.cts +9 -9
- package/dist/features/column-resizing/columnResizingFeature.types.d.ts +9 -9
- package/dist/features/column-resizing/columnResizingFeature.utils.cjs +28 -19
- package/dist/features/column-resizing/columnResizingFeature.utils.cjs.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.utils.d.cts +28 -19
- package/dist/features/column-resizing/columnResizingFeature.utils.d.ts +28 -19
- package/dist/features/column-resizing/columnResizingFeature.utils.js +28 -19
- package/dist/features/column-resizing/columnResizingFeature.utils.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.types.d.cts +19 -12
- package/dist/features/column-sizing/columnSizingFeature.types.d.ts +19 -12
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs +52 -41
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +52 -41
- package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +52 -41
- package/dist/features/column-sizing/columnSizingFeature.utils.js +52 -41
- package/dist/features/column-sizing/columnSizingFeature.utils.js.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.types.d.cts +16 -13
- package/dist/features/column-visibility/columnVisibilityFeature.types.d.ts +16 -13
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs +54 -42
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.cts +54 -42
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +54 -42
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js +54 -42
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.types.d.cts +10 -5
- package/dist/features/global-filtering/globalFilteringFeature.types.d.ts +10 -5
- package/dist/features/global-filtering/globalFilteringFeature.utils.cjs +20 -14
- package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.cts +20 -14
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.ts +20 -14
- package/dist/features/global-filtering/globalFilteringFeature.utils.js +20 -14
- package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.types.d.cts +16 -15
- package/dist/features/row-expanding/rowExpandingFeature.types.d.ts +16 -15
- package/dist/features/row-expanding/rowExpandingFeature.utils.cjs +56 -41
- package/dist/features/row-expanding/rowExpandingFeature.utils.cjs.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.utils.d.cts +56 -41
- package/dist/features/row-expanding/rowExpandingFeature.utils.d.ts +56 -41
- package/dist/features/row-expanding/rowExpandingFeature.utils.js +56 -41
- package/dist/features/row-expanding/rowExpandingFeature.utils.js.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.types.d.cts +19 -12
- package/dist/features/row-pagination/rowPaginationFeature.types.d.ts +19 -12
- package/dist/features/row-pagination/rowPaginationFeature.utils.cjs +49 -32
- package/dist/features/row-pagination/rowPaginationFeature.utils.cjs.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.utils.d.cts +49 -32
- package/dist/features/row-pagination/rowPaginationFeature.utils.d.ts +49 -32
- package/dist/features/row-pagination/rowPaginationFeature.utils.js +49 -32
- package/dist/features/row-pagination/rowPaginationFeature.utils.js.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.types.d.cts +12 -8
- package/dist/features/row-pinning/rowPinningFeature.types.d.ts +12 -8
- package/dist/features/row-pinning/rowPinningFeature.utils.cjs +39 -29
- package/dist/features/row-pinning/rowPinningFeature.utils.cjs.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.utils.d.cts +39 -29
- package/dist/features/row-pinning/rowPinningFeature.utils.d.ts +39 -29
- package/dist/features/row-pinning/rowPinningFeature.utils.js +39 -29
- package/dist/features/row-pinning/rowPinningFeature.utils.js.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.types.d.cts +30 -24
- package/dist/features/row-selection/rowSelectionFeature.types.d.ts +30 -24
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs +89 -69
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.utils.d.cts +89 -69
- package/dist/features/row-selection/rowSelectionFeature.utils.d.ts +89 -69
- package/dist/features/row-selection/rowSelectionFeature.utils.js +89 -69
- package/dist/features/row-selection/rowSelectionFeature.utils.js.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.types.d.cts +10 -8
- package/dist/features/row-sorting/rowSortingFeature.types.d.ts +10 -8
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs +61 -44
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.utils.d.cts +61 -44
- package/dist/features/row-sorting/rowSortingFeature.utils.d.ts +61 -44
- package/dist/features/row-sorting/rowSortingFeature.utils.js +61 -44
- package/dist/features/row-sorting/rowSortingFeature.utils.js.map +1 -1
- package/dist/fns/aggregationFns.cjs +33 -9
- package/dist/fns/aggregationFns.cjs.map +1 -1
- package/dist/fns/aggregationFns.d.cts +33 -9
- package/dist/fns/aggregationFns.d.ts +33 -9
- package/dist/fns/aggregationFns.js +33 -9
- package/dist/fns/aggregationFns.js.map +1 -1
- package/dist/fns/filterFns.cjs +48 -17
- package/dist/fns/filterFns.cjs.map +1 -1
- package/dist/fns/filterFns.d.cts +42 -15
- package/dist/fns/filterFns.d.ts +42 -15
- package/dist/fns/filterFns.js +48 -17
- package/dist/fns/filterFns.js.map +1 -1
- package/dist/helpers/columnHelper.cjs +9 -4
- package/dist/helpers/columnHelper.cjs.map +1 -1
- package/dist/helpers/columnHelper.d.cts +9 -4
- package/dist/helpers/columnHelper.d.ts +9 -4
- package/dist/helpers/columnHelper.js +9 -4
- package/dist/helpers/columnHelper.js.map +1 -1
- package/dist/helpers/tableOptions.cjs.map +1 -1
- package/dist/helpers/tableOptions.d.cts +12 -9
- package/dist/helpers/tableOptions.d.ts +12 -9
- package/dist/helpers/tableOptions.js.map +1 -1
- package/dist/types/ColumnDef.d.cts +38 -0
- package/dist/types/ColumnDef.d.ts +38 -0
- package/dist/types/TableOptions.d.cts +15 -0
- package/dist/types/TableOptions.d.ts +15 -0
- package/dist/types/TableState.d.cts +12 -0
- package/dist/types/TableState.d.ts +12 -0
- package/package.json +5 -3
- package/skills/column-definitions/SKILL.md +333 -0
- package/skills/column-layout/SKILL.md +328 -0
- package/skills/column-layout/references/subsystems.md +220 -0
- package/skills/customizing-feature-behavior/SKILL.md +416 -0
- package/skills/filtering/SKILL.md +357 -0
- package/skills/filtering/references/faceting-and-fuzzy.md +191 -0
- package/skills/grouping/SKILL.md +448 -0
- package/skills/migrate-v8-to-v9/SKILL.md +495 -0
- package/skills/pagination/SKILL.md +385 -0
- package/skills/row-expanding/SKILL.md +348 -0
- package/skills/row-pinning/SKILL.md +269 -0
- package/skills/row-selection/SKILL.md +391 -0
- package/skills/setup/SKILL.md +400 -0
- package/skills/sorting/SKILL.md +344 -0
- package/skills/state-management/SKILL.md +388 -0
- package/src/core/cells/coreCellsFeature.utils.ts +11 -8
- package/src/core/columns/coreColumnsFeature.types.ts +7 -6
- package/src/core/columns/coreColumnsFeature.utils.ts +37 -27
- package/src/core/headers/coreHeadersFeature.types.ts +6 -4
- package/src/core/headers/coreHeadersFeature.utils.ts +23 -18
- package/src/core/row-models/coreRowModelsFeature.utils.ts +48 -36
- package/src/core/rows/coreRowsFeature.types.ts +4 -4
- package/src/core/rows/coreRowsFeature.utils.ts +34 -28
- package/src/core/table/coreTablesFeature.types.ts +6 -2
- package/src/core/table/coreTablesFeature.utils.ts +2 -2
- package/src/features/column-faceting/columnFacetingFeature.types.ts +16 -10
- package/src/features/column-faceting/columnFacetingFeature.utils.ts +26 -18
- package/src/features/column-filtering/columnFilteringFeature.types.ts +21 -11
- package/src/features/column-filtering/columnFilteringFeature.utils.ts +39 -28
- package/src/features/column-grouping/columnGroupingFeature.types.ts +18 -14
- package/src/features/column-grouping/columnGroupingFeature.utils.ts +55 -43
- package/src/features/column-ordering/columnOrderingFeature.types.ts +14 -5
- package/src/features/column-ordering/columnOrderingFeature.utils.ts +30 -23
- package/src/features/column-pinning/columnPinningFeature.types.ts +43 -31
- package/src/features/column-pinning/columnPinningFeature.utils.ts +111 -91
- package/src/features/column-resizing/columnResizingFeature.types.ts +9 -9
- package/src/features/column-resizing/columnResizingFeature.utils.ts +28 -19
- package/src/features/column-sizing/columnSizingFeature.types.ts +19 -12
- package/src/features/column-sizing/columnSizingFeature.utils.ts +52 -41
- package/src/features/column-visibility/columnVisibilityFeature.types.ts +16 -13
- package/src/features/column-visibility/columnVisibilityFeature.utils.ts +54 -42
- package/src/features/global-filtering/globalFilteringFeature.types.ts +10 -5
- package/src/features/global-filtering/globalFilteringFeature.utils.ts +20 -14
- package/src/features/row-expanding/rowExpandingFeature.types.ts +16 -15
- package/src/features/row-expanding/rowExpandingFeature.utils.ts +56 -41
- package/src/features/row-pagination/rowPaginationFeature.types.ts +19 -12
- package/src/features/row-pagination/rowPaginationFeature.utils.ts +49 -32
- package/src/features/row-pinning/rowPinningFeature.types.ts +12 -8
- package/src/features/row-pinning/rowPinningFeature.utils.ts +39 -29
- package/src/features/row-selection/rowSelectionFeature.types.ts +30 -24
- package/src/features/row-selection/rowSelectionFeature.utils.ts +89 -69
- package/src/features/row-sorting/rowSortingFeature.types.ts +10 -8
- package/src/features/row-sorting/rowSortingFeature.utils.ts +61 -44
- package/src/fns/aggregationFns.ts +33 -9
- package/src/fns/filterFns.ts +48 -17
- package/src/helpers/columnHelper.ts +9 -4
- package/src/helpers/tableOptions.ts +12 -9
- package/src/types/ColumnDef.ts +38 -0
- package/src/types/TableOptions.ts +15 -0
- package/src/types/TableState.ts +12 -0
|
@@ -4,13 +4,14 @@ const require_buildHeaderGroups = require('../../core/headers/buildHeaderGroups.
|
|
|
4
4
|
|
|
5
5
|
//#region src/features/column-pinning/columnPinningFeature.utils.ts
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Creates the default column pinning state.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
* Both pinning regions start empty. Reset APIs use this value when
|
|
10
|
+
* `defaultState` is `true`.
|
|
10
11
|
*
|
|
11
12
|
* @example
|
|
12
13
|
* ```ts
|
|
13
|
-
* const
|
|
14
|
+
* const pinning = getDefaultColumnPinningState()
|
|
14
15
|
* ```
|
|
15
16
|
*/
|
|
16
17
|
function getDefaultColumnPinningState() {
|
|
@@ -20,9 +21,11 @@ function getDefaultColumnPinningState() {
|
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
+
* Moves this column's leaf column ids into a pinning region.
|
|
24
25
|
*
|
|
25
|
-
*
|
|
26
|
+
* Pinning a group column pins all of its leaves. The leaf ids are first removed
|
|
27
|
+
* from both regions, then appended to the requested `'left'` or `'right'`
|
|
28
|
+
* region. Passing `false` unpins them back to the center.
|
|
26
29
|
*
|
|
27
30
|
* @example
|
|
28
31
|
* ```ts
|
|
@@ -52,26 +55,28 @@ function column_pin(column, position) {
|
|
|
52
55
|
});
|
|
53
56
|
}
|
|
54
57
|
/**
|
|
55
|
-
*
|
|
58
|
+
* Checks whether this column or any of its leaf columns can be pinned.
|
|
56
59
|
*
|
|
57
|
-
*
|
|
60
|
+
* Column-level `enablePinning` and table `enableColumnPinning` both default to
|
|
61
|
+
* `true`; at least one leaf column must allow pinning.
|
|
58
62
|
*
|
|
59
63
|
* @example
|
|
60
64
|
* ```ts
|
|
61
|
-
* const
|
|
65
|
+
* const canPin = column_getCanPin(column)
|
|
62
66
|
* ```
|
|
63
67
|
*/
|
|
64
68
|
function column_getCanPin(column) {
|
|
65
69
|
return column.getLeafColumns().some((leafColumn) => (leafColumn.columnDef.enablePinning ?? true) && (column.table.options.enableColumnPinning ?? true));
|
|
66
70
|
}
|
|
67
71
|
/**
|
|
68
|
-
*
|
|
72
|
+
* Reads this column's current pinning region.
|
|
69
73
|
*
|
|
70
|
-
*
|
|
74
|
+
* Group columns report `'left'` or `'right'` when any leaf column is pinned in
|
|
75
|
+
* that region. Unpinned columns return `false`.
|
|
71
76
|
*
|
|
72
77
|
* @example
|
|
73
78
|
* ```ts
|
|
74
|
-
* const
|
|
79
|
+
* const position = column_getIsPinned(column)
|
|
75
80
|
* ```
|
|
76
81
|
*/
|
|
77
82
|
function column_getIsPinned(column) {
|
|
@@ -83,13 +88,14 @@ function column_getIsPinned(column) {
|
|
|
83
88
|
return isLeft ? "left" : isRight ? "right" : false;
|
|
84
89
|
}
|
|
85
90
|
/**
|
|
86
|
-
*
|
|
91
|
+
* Finds this column's index within its pinned region.
|
|
87
92
|
*
|
|
88
|
-
*
|
|
93
|
+
* Unpinned columns return `0`; pinned columns return their position in
|
|
94
|
+
* `state.columnPinning.left` or `state.columnPinning.right`.
|
|
89
95
|
*
|
|
90
96
|
* @example
|
|
91
97
|
* ```ts
|
|
92
|
-
* const
|
|
98
|
+
* const index = column_getPinnedIndex(column)
|
|
93
99
|
* ```
|
|
94
100
|
*/
|
|
95
101
|
function column_getPinnedIndex(column) {
|
|
@@ -98,13 +104,13 @@ function column_getPinnedIndex(column) {
|
|
|
98
104
|
return position ? ((_column$table$atoms$c2 = column.table.atoms.columnPinning) === null || _column$table$atoms$c2 === void 0 || (_column$table$atoms$c2 = _column$table$atoms$c2.get()) === null || _column$table$atoms$c2 === void 0 ? void 0 : _column$table$atoms$c2[position].indexOf(column.id)) ?? -1 : 0;
|
|
99
105
|
}
|
|
100
106
|
/**
|
|
101
|
-
*
|
|
107
|
+
* Collects visible cells whose columns are not pinned left or right.
|
|
102
108
|
*
|
|
103
|
-
*
|
|
109
|
+
* The result preserves the row's visible-cell order for center columns.
|
|
104
110
|
*
|
|
105
111
|
* @example
|
|
106
112
|
* ```ts
|
|
107
|
-
* const
|
|
113
|
+
* const centerCells = row_getCenterVisibleCells(row)
|
|
108
114
|
* ```
|
|
109
115
|
*/
|
|
110
116
|
function row_getCenterVisibleCells(row) {
|
|
@@ -115,13 +121,14 @@ function row_getCenterVisibleCells(row) {
|
|
|
115
121
|
return allCells.filter((d) => !leftAndRight.includes(d.column.id));
|
|
116
122
|
}
|
|
117
123
|
/**
|
|
118
|
-
*
|
|
124
|
+
* Collects visible cells for columns pinned to the left region.
|
|
119
125
|
*
|
|
120
|
-
*
|
|
126
|
+
* Cells are returned in `state.columnPinning.left` order and are marked with
|
|
127
|
+
* `cell.position = 'left'`.
|
|
121
128
|
*
|
|
122
129
|
* @example
|
|
123
130
|
* ```ts
|
|
124
|
-
* const
|
|
131
|
+
* const leftCells = row_getLeftVisibleCells(row)
|
|
125
132
|
* ```
|
|
126
133
|
*/
|
|
127
134
|
function row_getLeftVisibleCells(row) {
|
|
@@ -140,13 +147,14 @@ function row_getLeftVisibleCells(row) {
|
|
|
140
147
|
return cells;
|
|
141
148
|
}
|
|
142
149
|
/**
|
|
143
|
-
*
|
|
150
|
+
* Collects visible cells for columns pinned to the right region.
|
|
144
151
|
*
|
|
145
|
-
*
|
|
152
|
+
* Cells are returned in `state.columnPinning.right` order and are marked with
|
|
153
|
+
* `cell.position = 'right'`.
|
|
146
154
|
*
|
|
147
155
|
* @example
|
|
148
156
|
* ```ts
|
|
149
|
-
* const
|
|
157
|
+
* const rightCells = row_getRightVisibleCells(row)
|
|
150
158
|
* ```
|
|
151
159
|
*/
|
|
152
160
|
function row_getRightVisibleCells(row) {
|
|
@@ -165,13 +173,14 @@ function row_getRightVisibleCells(row) {
|
|
|
165
173
|
return cells;
|
|
166
174
|
}
|
|
167
175
|
/**
|
|
168
|
-
*
|
|
176
|
+
* Routes a column pinning updater through the table's pinning change handler.
|
|
169
177
|
*
|
|
170
|
-
* The updater
|
|
178
|
+
* The updater may be a next `{ left, right }` state or a function of the
|
|
179
|
+
* previous state, matching the instance `table.setColumnPinning` behavior.
|
|
171
180
|
*
|
|
172
181
|
* @example
|
|
173
182
|
* ```ts
|
|
174
|
-
* table_setColumnPinning(table, (old) => old)
|
|
183
|
+
* table_setColumnPinning(table, (old) => ({ ...old, left: ['select'] }))
|
|
175
184
|
* ```
|
|
176
185
|
*/
|
|
177
186
|
function table_setColumnPinning(table, updater) {
|
|
@@ -179,9 +188,11 @@ function table_setColumnPinning(table, updater) {
|
|
|
179
188
|
(_table$options$onColu = (_table$options = table.options).onColumnPinningChange) === null || _table$options$onColu === void 0 || _table$options$onColu.call(_table$options, updater);
|
|
180
189
|
}
|
|
181
190
|
/**
|
|
182
|
-
* Resets the
|
|
191
|
+
* Resets `columnPinning` to the configured initial state or feature default.
|
|
183
192
|
*
|
|
184
|
-
*
|
|
193
|
+
* With no argument, the reset clones `table.initialState.columnPinning` when it
|
|
194
|
+
* exists. Passing `true` ignores initial state and resets to empty left/right
|
|
195
|
+
* arrays.
|
|
185
196
|
*
|
|
186
197
|
* @example
|
|
187
198
|
* ```ts
|
|
@@ -193,13 +204,14 @@ function table_resetColumnPinning(table, defaultState) {
|
|
|
193
204
|
table_setColumnPinning(table, defaultState ? getDefaultColumnPinningState() : require_utils.cloneState(table.initialState.columnPinning ?? getDefaultColumnPinningState()));
|
|
194
205
|
}
|
|
195
206
|
/**
|
|
196
|
-
*
|
|
207
|
+
* Checks whether any columns are pinned.
|
|
197
208
|
*
|
|
198
|
-
*
|
|
209
|
+
* Omit `position` to check both sides, or pass `'left'`/`'right'` to inspect a
|
|
210
|
+
* single pinning region.
|
|
199
211
|
*
|
|
200
212
|
* @example
|
|
201
213
|
* ```ts
|
|
202
|
-
* const
|
|
214
|
+
* const hasPinnedColumns = table_getIsSomeColumnsPinned(table)
|
|
203
215
|
* ```
|
|
204
216
|
*/
|
|
205
217
|
function table_getIsSomeColumnsPinned(table, position) {
|
|
@@ -209,13 +221,14 @@ function table_getIsSomeColumnsPinned(table, position) {
|
|
|
209
221
|
return Boolean(pinningState === null || pinningState === void 0 ? void 0 : pinningState[position].length);
|
|
210
222
|
}
|
|
211
223
|
/**
|
|
212
|
-
*
|
|
224
|
+
* Builds header groups for visible columns pinned to the left region.
|
|
213
225
|
*
|
|
214
|
-
*
|
|
226
|
+
* The leaf columns are read in `state.columnPinning.left` order and then passed
|
|
227
|
+
* through the same header-group builder as the unpinned table.
|
|
215
228
|
*
|
|
216
229
|
* @example
|
|
217
230
|
* ```ts
|
|
218
|
-
* const
|
|
231
|
+
* const headerGroups = table_getLeftHeaderGroups(table)
|
|
219
232
|
* ```
|
|
220
233
|
*/
|
|
221
234
|
function table_getLeftHeaderGroups(table) {
|
|
@@ -231,13 +244,14 @@ function table_getLeftHeaderGroups(table) {
|
|
|
231
244
|
return require_buildHeaderGroups.buildHeaderGroups(allColumns, orderedLeafColumns, table, "left");
|
|
232
245
|
}
|
|
233
246
|
/**
|
|
234
|
-
*
|
|
247
|
+
* Builds header groups for visible columns pinned to the right region.
|
|
235
248
|
*
|
|
236
|
-
*
|
|
249
|
+
* The leaf columns are read in `state.columnPinning.right` order and then
|
|
250
|
+
* passed through the same header-group builder as the unpinned table.
|
|
237
251
|
*
|
|
238
252
|
* @example
|
|
239
253
|
* ```ts
|
|
240
|
-
* const
|
|
254
|
+
* const headerGroups = table_getRightHeaderGroups(table)
|
|
241
255
|
* ```
|
|
242
256
|
*/
|
|
243
257
|
function table_getRightHeaderGroups(table) {
|
|
@@ -253,13 +267,14 @@ function table_getRightHeaderGroups(table) {
|
|
|
253
267
|
return require_buildHeaderGroups.buildHeaderGroups(allColumns, orderedLeafColumns, table, "right");
|
|
254
268
|
}
|
|
255
269
|
/**
|
|
256
|
-
*
|
|
270
|
+
* Builds header groups for visible columns that are not pinned.
|
|
257
271
|
*
|
|
258
|
-
*
|
|
272
|
+
* Left- and right-pinned column ids are removed from the visible leaf column
|
|
273
|
+
* list before header groups are built for the center region.
|
|
259
274
|
*
|
|
260
275
|
* @example
|
|
261
276
|
* ```ts
|
|
262
|
-
* const
|
|
277
|
+
* const headerGroups = table_getCenterHeaderGroups(table)
|
|
263
278
|
* ```
|
|
264
279
|
*/
|
|
265
280
|
function table_getCenterHeaderGroups(table) {
|
|
@@ -272,52 +287,52 @@ function table_getCenterHeaderGroups(table) {
|
|
|
272
287
|
return require_buildHeaderGroups.buildHeaderGroups(allColumns, leafColumns, table, "center");
|
|
273
288
|
}
|
|
274
289
|
/**
|
|
275
|
-
*
|
|
290
|
+
* Builds footer groups for the left pinned region.
|
|
276
291
|
*
|
|
277
|
-
*
|
|
292
|
+
* Footer groups reuse the left header groups in reverse order.
|
|
278
293
|
*
|
|
279
294
|
* @example
|
|
280
295
|
* ```ts
|
|
281
|
-
* const
|
|
296
|
+
* const footerGroups = table_getLeftFooterGroups(table)
|
|
282
297
|
* ```
|
|
283
298
|
*/
|
|
284
299
|
function table_getLeftFooterGroups(table) {
|
|
285
300
|
return [...require_utils.callMemoOrStaticFn(table, "getLeftHeaderGroups", table_getLeftHeaderGroups)].reverse();
|
|
286
301
|
}
|
|
287
302
|
/**
|
|
288
|
-
*
|
|
303
|
+
* Builds footer groups for the right pinned region.
|
|
289
304
|
*
|
|
290
|
-
*
|
|
305
|
+
* Footer groups reuse the right header groups in reverse order.
|
|
291
306
|
*
|
|
292
307
|
* @example
|
|
293
308
|
* ```ts
|
|
294
|
-
* const
|
|
309
|
+
* const footerGroups = table_getRightFooterGroups(table)
|
|
295
310
|
* ```
|
|
296
311
|
*/
|
|
297
312
|
function table_getRightFooterGroups(table) {
|
|
298
313
|
return [...require_utils.callMemoOrStaticFn(table, "getRightHeaderGroups", table_getRightHeaderGroups)].reverse();
|
|
299
314
|
}
|
|
300
315
|
/**
|
|
301
|
-
*
|
|
316
|
+
* Builds footer groups for the center, unpinned region.
|
|
302
317
|
*
|
|
303
|
-
*
|
|
318
|
+
* Footer groups reuse the center header groups in reverse order.
|
|
304
319
|
*
|
|
305
320
|
* @example
|
|
306
321
|
* ```ts
|
|
307
|
-
* const
|
|
322
|
+
* const footerGroups = table_getCenterFooterGroups(table)
|
|
308
323
|
* ```
|
|
309
324
|
*/
|
|
310
325
|
function table_getCenterFooterGroups(table) {
|
|
311
326
|
return [...require_utils.callMemoOrStaticFn(table, "getCenterHeaderGroups", table_getCenterHeaderGroups)].reverse();
|
|
312
327
|
}
|
|
313
328
|
/**
|
|
314
|
-
*
|
|
329
|
+
* Flattens every header from the left pinned header groups.
|
|
315
330
|
*
|
|
316
|
-
*
|
|
331
|
+
* Parent headers and placeholder headers are included.
|
|
317
332
|
*
|
|
318
333
|
* @example
|
|
319
334
|
* ```ts
|
|
320
|
-
* const
|
|
335
|
+
* const headers = table_getLeftFlatHeaders(table)
|
|
321
336
|
* ```
|
|
322
337
|
*/
|
|
323
338
|
function table_getLeftFlatHeaders(table) {
|
|
@@ -330,13 +345,13 @@ function table_getLeftFlatHeaders(table) {
|
|
|
330
345
|
return result;
|
|
331
346
|
}
|
|
332
347
|
/**
|
|
333
|
-
*
|
|
348
|
+
* Flattens every header from the right pinned header groups.
|
|
334
349
|
*
|
|
335
|
-
*
|
|
350
|
+
* Parent headers and placeholder headers are included.
|
|
336
351
|
*
|
|
337
352
|
* @example
|
|
338
353
|
* ```ts
|
|
339
|
-
* const
|
|
354
|
+
* const headers = table_getRightFlatHeaders(table)
|
|
340
355
|
* ```
|
|
341
356
|
*/
|
|
342
357
|
function table_getRightFlatHeaders(table) {
|
|
@@ -349,13 +364,13 @@ function table_getRightFlatHeaders(table) {
|
|
|
349
364
|
return result;
|
|
350
365
|
}
|
|
351
366
|
/**
|
|
352
|
-
*
|
|
367
|
+
* Flattens every header from the center header groups.
|
|
353
368
|
*
|
|
354
|
-
*
|
|
369
|
+
* Parent headers and placeholder headers are included.
|
|
355
370
|
*
|
|
356
371
|
* @example
|
|
357
372
|
* ```ts
|
|
358
|
-
* const
|
|
373
|
+
* const headers = table_getCenterFlatHeaders(table)
|
|
359
374
|
* ```
|
|
360
375
|
*/
|
|
361
376
|
function table_getCenterFlatHeaders(table) {
|
|
@@ -368,52 +383,53 @@ function table_getCenterFlatHeaders(table) {
|
|
|
368
383
|
return result;
|
|
369
384
|
}
|
|
370
385
|
/**
|
|
371
|
-
*
|
|
386
|
+
* Collects leaf headers for the left pinned region.
|
|
372
387
|
*
|
|
373
|
-
*
|
|
388
|
+
* Parent headers are filtered out from the left flat header list.
|
|
374
389
|
*
|
|
375
390
|
* @example
|
|
376
391
|
* ```ts
|
|
377
|
-
* const
|
|
392
|
+
* const headers = table_getLeftLeafHeaders(table)
|
|
378
393
|
* ```
|
|
379
394
|
*/
|
|
380
395
|
function table_getLeftLeafHeaders(table) {
|
|
381
396
|
return require_utils.callMemoOrStaticFn(table, "getLeftFlatHeaders", table_getLeftFlatHeaders).filter((header) => !header.subHeaders.length);
|
|
382
397
|
}
|
|
383
398
|
/**
|
|
384
|
-
*
|
|
399
|
+
* Collects leaf headers for the right pinned region.
|
|
385
400
|
*
|
|
386
|
-
*
|
|
401
|
+
* Parent headers are filtered out from the right flat header list.
|
|
387
402
|
*
|
|
388
403
|
* @example
|
|
389
404
|
* ```ts
|
|
390
|
-
* const
|
|
405
|
+
* const headers = table_getRightLeafHeaders(table)
|
|
391
406
|
* ```
|
|
392
407
|
*/
|
|
393
408
|
function table_getRightLeafHeaders(table) {
|
|
394
409
|
return require_utils.callMemoOrStaticFn(table, "getRightFlatHeaders", table_getRightFlatHeaders).filter((header) => !header.subHeaders.length);
|
|
395
410
|
}
|
|
396
411
|
/**
|
|
397
|
-
*
|
|
412
|
+
* Collects leaf headers for the center, unpinned region.
|
|
398
413
|
*
|
|
399
|
-
*
|
|
414
|
+
* Parent headers are filtered out from the center flat header list.
|
|
400
415
|
*
|
|
401
416
|
* @example
|
|
402
417
|
* ```ts
|
|
403
|
-
* const
|
|
418
|
+
* const headers = table_getCenterLeafHeaders(table)
|
|
404
419
|
* ```
|
|
405
420
|
*/
|
|
406
421
|
function table_getCenterLeafHeaders(table) {
|
|
407
422
|
return require_utils.callMemoOrStaticFn(table, "getCenterFlatHeaders", table_getCenterFlatHeaders).filter((header) => !header.subHeaders.length);
|
|
408
423
|
}
|
|
409
424
|
/**
|
|
410
|
-
*
|
|
425
|
+
* Resolves leaf columns pinned to the left region.
|
|
411
426
|
*
|
|
412
|
-
*
|
|
427
|
+
* The result follows `state.columnPinning.left` order and skips stale ids that
|
|
428
|
+
* no longer correspond to a leaf column.
|
|
413
429
|
*
|
|
414
430
|
* @example
|
|
415
431
|
* ```ts
|
|
416
|
-
* const
|
|
432
|
+
* const columns = table_getLeftLeafColumns(table)
|
|
417
433
|
* ```
|
|
418
434
|
*/
|
|
419
435
|
function table_getLeftLeafColumns(table) {
|
|
@@ -428,13 +444,14 @@ function table_getLeftLeafColumns(table) {
|
|
|
428
444
|
return result;
|
|
429
445
|
}
|
|
430
446
|
/**
|
|
431
|
-
*
|
|
447
|
+
* Resolves leaf columns pinned to the right region.
|
|
432
448
|
*
|
|
433
|
-
*
|
|
449
|
+
* The result follows `state.columnPinning.right` order and skips stale ids that
|
|
450
|
+
* no longer correspond to a leaf column.
|
|
434
451
|
*
|
|
435
452
|
* @example
|
|
436
453
|
* ```ts
|
|
437
|
-
* const
|
|
454
|
+
* const columns = table_getRightLeafColumns(table)
|
|
438
455
|
* ```
|
|
439
456
|
*/
|
|
440
457
|
function table_getRightLeafColumns(table) {
|
|
@@ -449,13 +466,13 @@ function table_getRightLeafColumns(table) {
|
|
|
449
466
|
return result;
|
|
450
467
|
}
|
|
451
468
|
/**
|
|
452
|
-
*
|
|
469
|
+
* Resolves leaf columns that are not pinned to either side.
|
|
453
470
|
*
|
|
454
|
-
*
|
|
471
|
+
* Left- and right-pinned ids are removed from `table.getAllLeafColumns()`.
|
|
455
472
|
*
|
|
456
473
|
* @example
|
|
457
474
|
* ```ts
|
|
458
|
-
* const
|
|
475
|
+
* const columns = table_getCenterLeafColumns(table)
|
|
459
476
|
* ```
|
|
460
477
|
*/
|
|
461
478
|
function table_getCenterLeafColumns(table) {
|
|
@@ -465,65 +482,68 @@ function table_getCenterLeafColumns(table) {
|
|
|
465
482
|
return table.getAllLeafColumns().filter((d) => !leftAndRight.includes(d.id));
|
|
466
483
|
}
|
|
467
484
|
/**
|
|
468
|
-
*
|
|
485
|
+
* Resolves leaf columns for a requested pinning region.
|
|
469
486
|
*
|
|
470
|
-
*
|
|
487
|
+
* Pass `'left'`, `'center'`, or `'right'` for a partition, or pass `false` to
|
|
488
|
+
* read all leaf columns without partitioning.
|
|
471
489
|
*
|
|
472
490
|
* @example
|
|
473
491
|
* ```ts
|
|
474
|
-
* const
|
|
492
|
+
* const columns = table_getPinnedLeafColumns(table, 'center')
|
|
475
493
|
* ```
|
|
476
494
|
*/
|
|
477
495
|
function table_getPinnedLeafColumns(table, position) {
|
|
478
496
|
return !position ? table.getAllLeafColumns() : position === "left" ? require_utils.callMemoOrStaticFn(table, "getLeftLeafColumns", table_getLeftLeafColumns) : position === "right" ? require_utils.callMemoOrStaticFn(table, "getRightLeafColumns", table_getRightLeafColumns) : require_utils.callMemoOrStaticFn(table, "getCenterLeafColumns", table_getCenterLeafColumns);
|
|
479
497
|
}
|
|
480
498
|
/**
|
|
481
|
-
*
|
|
499
|
+
* Resolves visible leaf columns pinned to the left region.
|
|
482
500
|
*
|
|
483
|
-
*
|
|
501
|
+
* Hidden pinned columns are filtered out after the left pin order is applied.
|
|
484
502
|
*
|
|
485
503
|
* @example
|
|
486
504
|
* ```ts
|
|
487
|
-
* const
|
|
505
|
+
* const columns = table_getLeftVisibleLeafColumns(table)
|
|
488
506
|
* ```
|
|
489
507
|
*/
|
|
490
508
|
function table_getLeftVisibleLeafColumns(table) {
|
|
491
509
|
return require_utils.callMemoOrStaticFn(table, "getLeftLeafColumns", table_getLeftLeafColumns).filter((column) => require_utils.callMemoOrStaticFn(column, "getIsVisible", require_columnVisibilityFeature_utils.column_getIsVisible));
|
|
492
510
|
}
|
|
493
511
|
/**
|
|
494
|
-
*
|
|
512
|
+
* Resolves visible leaf columns pinned to the right region.
|
|
495
513
|
*
|
|
496
|
-
*
|
|
514
|
+
* Hidden pinned columns are filtered out after the right pin order is applied.
|
|
497
515
|
*
|
|
498
516
|
* @example
|
|
499
517
|
* ```ts
|
|
500
|
-
* const
|
|
518
|
+
* const columns = table_getRightVisibleLeafColumns(table)
|
|
501
519
|
* ```
|
|
502
520
|
*/
|
|
503
521
|
function table_getRightVisibleLeafColumns(table) {
|
|
504
522
|
return require_utils.callMemoOrStaticFn(table, "getRightLeafColumns", table_getRightLeafColumns).filter((column) => require_utils.callMemoOrStaticFn(column, "getIsVisible", require_columnVisibilityFeature_utils.column_getIsVisible));
|
|
505
523
|
}
|
|
506
524
|
/**
|
|
507
|
-
*
|
|
525
|
+
* Resolves visible leaf columns that are not pinned.
|
|
508
526
|
*
|
|
509
|
-
* This
|
|
527
|
+
* This is the center partition used by layouts that render pinned columns
|
|
528
|
+
* separately from the scrollable middle region.
|
|
510
529
|
*
|
|
511
530
|
* @example
|
|
512
531
|
* ```ts
|
|
513
|
-
* const
|
|
532
|
+
* const columns = table_getCenterVisibleLeafColumns(table)
|
|
514
533
|
* ```
|
|
515
534
|
*/
|
|
516
535
|
function table_getCenterVisibleLeafColumns(table) {
|
|
517
536
|
return require_utils.callMemoOrStaticFn(table, "getCenterLeafColumns", table_getCenterLeafColumns).filter((column) => require_utils.callMemoOrStaticFn(column, "getIsVisible", require_columnVisibilityFeature_utils.column_getIsVisible));
|
|
518
537
|
}
|
|
519
538
|
/**
|
|
520
|
-
*
|
|
539
|
+
* Resolves visible leaf columns for a requested pinning region.
|
|
521
540
|
*
|
|
522
|
-
*
|
|
541
|
+
* Omit `position` to get all visible leaf columns, or pass `'left'`, `'center'`,
|
|
542
|
+
* or `'right'` to get one partition.
|
|
523
543
|
*
|
|
524
544
|
* @example
|
|
525
545
|
* ```ts
|
|
526
|
-
* const
|
|
546
|
+
* const columns = table_getPinnedVisibleLeafColumns(table, 'left')
|
|
527
547
|
* ```
|
|
528
548
|
*/
|
|
529
549
|
function table_getPinnedVisibleLeafColumns(table, position) {
|