@tanstack/table-core 9.0.0-alpha.47 → 9.0.0-alpha.49
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 +29 -20
- 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 +29 -20
- 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 +62 -45
- 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 +62 -45
- 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 +29 -21
- 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 +62 -45
- 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
|
@@ -22,13 +22,14 @@ import type {
|
|
|
22
22
|
// State
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Creates the default column pinning state.
|
|
26
26
|
*
|
|
27
|
-
*
|
|
27
|
+
* Both pinning regions start empty. Reset APIs use this value when
|
|
28
|
+
* `defaultState` is `true`.
|
|
28
29
|
*
|
|
29
30
|
* @example
|
|
30
31
|
* ```ts
|
|
31
|
-
* const
|
|
32
|
+
* const pinning = getDefaultColumnPinningState()
|
|
32
33
|
* ```
|
|
33
34
|
*/
|
|
34
35
|
export function getDefaultColumnPinningState(): ColumnPinningState {
|
|
@@ -41,9 +42,11 @@ export function getDefaultColumnPinningState(): ColumnPinningState {
|
|
|
41
42
|
// Column APIs
|
|
42
43
|
|
|
43
44
|
/**
|
|
44
|
-
*
|
|
45
|
+
* Moves this column's leaf column ids into a pinning region.
|
|
45
46
|
*
|
|
46
|
-
*
|
|
47
|
+
* Pinning a group column pins all of its leaves. The leaf ids are first removed
|
|
48
|
+
* from both regions, then appended to the requested `'left'` or `'right'`
|
|
49
|
+
* region. Passing `false` unpins them back to the center.
|
|
47
50
|
*
|
|
48
51
|
* @example
|
|
49
52
|
* ```ts
|
|
@@ -92,13 +95,14 @@ export function column_pin<
|
|
|
92
95
|
}
|
|
93
96
|
|
|
94
97
|
/**
|
|
95
|
-
*
|
|
98
|
+
* Checks whether this column or any of its leaf columns can be pinned.
|
|
96
99
|
*
|
|
97
|
-
*
|
|
100
|
+
* Column-level `enablePinning` and table `enableColumnPinning` both default to
|
|
101
|
+
* `true`; at least one leaf column must allow pinning.
|
|
98
102
|
*
|
|
99
103
|
* @example
|
|
100
104
|
* ```ts
|
|
101
|
-
* const
|
|
105
|
+
* const canPin = column_getCanPin(column)
|
|
102
106
|
* ```
|
|
103
107
|
*/
|
|
104
108
|
export function column_getCanPin<
|
|
@@ -118,13 +122,14 @@ export function column_getCanPin<
|
|
|
118
122
|
}
|
|
119
123
|
|
|
120
124
|
/**
|
|
121
|
-
*
|
|
125
|
+
* Reads this column's current pinning region.
|
|
122
126
|
*
|
|
123
|
-
*
|
|
127
|
+
* Group columns report `'left'` or `'right'` when any leaf column is pinned in
|
|
128
|
+
* that region. Unpinned columns return `false`.
|
|
124
129
|
*
|
|
125
130
|
* @example
|
|
126
131
|
* ```ts
|
|
127
|
-
* const
|
|
132
|
+
* const position = column_getIsPinned(column)
|
|
128
133
|
* ```
|
|
129
134
|
*/
|
|
130
135
|
export function column_getIsPinned<
|
|
@@ -146,13 +151,14 @@ export function column_getIsPinned<
|
|
|
146
151
|
}
|
|
147
152
|
|
|
148
153
|
/**
|
|
149
|
-
*
|
|
154
|
+
* Finds this column's index within its pinned region.
|
|
150
155
|
*
|
|
151
|
-
*
|
|
156
|
+
* Unpinned columns return `0`; pinned columns return their position in
|
|
157
|
+
* `state.columnPinning.left` or `state.columnPinning.right`.
|
|
152
158
|
*
|
|
153
159
|
* @example
|
|
154
160
|
* ```ts
|
|
155
|
-
* const
|
|
161
|
+
* const index = column_getPinnedIndex(column)
|
|
156
162
|
* ```
|
|
157
163
|
*/
|
|
158
164
|
export function column_getPinnedIndex<
|
|
@@ -171,13 +177,13 @@ export function column_getPinnedIndex<
|
|
|
171
177
|
// Row APIs
|
|
172
178
|
|
|
173
179
|
/**
|
|
174
|
-
*
|
|
180
|
+
* Collects visible cells whose columns are not pinned left or right.
|
|
175
181
|
*
|
|
176
|
-
*
|
|
182
|
+
* The result preserves the row's visible-cell order for center columns.
|
|
177
183
|
*
|
|
178
184
|
* @example
|
|
179
185
|
* ```ts
|
|
180
|
-
* const
|
|
186
|
+
* const centerCells = row_getCenterVisibleCells(row)
|
|
181
187
|
* ```
|
|
182
188
|
*/
|
|
183
189
|
export function row_getCenterVisibleCells<
|
|
@@ -196,13 +202,14 @@ export function row_getCenterVisibleCells<
|
|
|
196
202
|
}
|
|
197
203
|
|
|
198
204
|
/**
|
|
199
|
-
*
|
|
205
|
+
* Collects visible cells for columns pinned to the left region.
|
|
200
206
|
*
|
|
201
|
-
*
|
|
207
|
+
* Cells are returned in `state.columnPinning.left` order and are marked with
|
|
208
|
+
* `cell.position = 'left'`.
|
|
202
209
|
*
|
|
203
210
|
* @example
|
|
204
211
|
* ```ts
|
|
205
|
-
* const
|
|
212
|
+
* const leftCells = row_getLeftVisibleCells(row)
|
|
206
213
|
* ```
|
|
207
214
|
*/
|
|
208
215
|
export function row_getLeftVisibleCells<
|
|
@@ -231,13 +238,14 @@ export function row_getLeftVisibleCells<
|
|
|
231
238
|
}
|
|
232
239
|
|
|
233
240
|
/**
|
|
234
|
-
*
|
|
241
|
+
* Collects visible cells for columns pinned to the right region.
|
|
235
242
|
*
|
|
236
|
-
*
|
|
243
|
+
* Cells are returned in `state.columnPinning.right` order and are marked with
|
|
244
|
+
* `cell.position = 'right'`.
|
|
237
245
|
*
|
|
238
246
|
* @example
|
|
239
247
|
* ```ts
|
|
240
|
-
* const
|
|
248
|
+
* const rightCells = row_getRightVisibleCells(row)
|
|
241
249
|
* ```
|
|
242
250
|
*/
|
|
243
251
|
export function row_getRightVisibleCells<
|
|
@@ -268,13 +276,14 @@ export function row_getRightVisibleCells<
|
|
|
268
276
|
// Table APIs
|
|
269
277
|
|
|
270
278
|
/**
|
|
271
|
-
*
|
|
279
|
+
* Routes a column pinning updater through the table's pinning change handler.
|
|
272
280
|
*
|
|
273
|
-
* The updater
|
|
281
|
+
* The updater may be a next `{ left, right }` state or a function of the
|
|
282
|
+
* previous state, matching the instance `table.setColumnPinning` behavior.
|
|
274
283
|
*
|
|
275
284
|
* @example
|
|
276
285
|
* ```ts
|
|
277
|
-
* table_setColumnPinning(table, (old) => old)
|
|
286
|
+
* table_setColumnPinning(table, (old) => ({ ...old, left: ['select'] }))
|
|
278
287
|
* ```
|
|
279
288
|
*/
|
|
280
289
|
export function table_setColumnPinning<
|
|
@@ -288,9 +297,11 @@ export function table_setColumnPinning<
|
|
|
288
297
|
}
|
|
289
298
|
|
|
290
299
|
/**
|
|
291
|
-
* Resets the
|
|
300
|
+
* Resets `columnPinning` to the configured initial state or feature default.
|
|
292
301
|
*
|
|
293
|
-
*
|
|
302
|
+
* With no argument, the reset clones `table.initialState.columnPinning` when it
|
|
303
|
+
* exists. Passing `true` ignores initial state and resets to empty left/right
|
|
304
|
+
* arrays.
|
|
294
305
|
*
|
|
295
306
|
* @example
|
|
296
307
|
* ```ts
|
|
@@ -313,13 +324,14 @@ export function table_resetColumnPinning<
|
|
|
313
324
|
}
|
|
314
325
|
|
|
315
326
|
/**
|
|
316
|
-
*
|
|
327
|
+
* Checks whether any columns are pinned.
|
|
317
328
|
*
|
|
318
|
-
*
|
|
329
|
+
* Omit `position` to check both sides, or pass `'left'`/`'right'` to inspect a
|
|
330
|
+
* single pinning region.
|
|
319
331
|
*
|
|
320
332
|
* @example
|
|
321
333
|
* ```ts
|
|
322
|
-
* const
|
|
334
|
+
* const hasPinnedColumns = table_getIsSomeColumnsPinned(table)
|
|
323
335
|
* ```
|
|
324
336
|
*/
|
|
325
337
|
export function table_getIsSomeColumnsPinned<
|
|
@@ -337,13 +349,14 @@ export function table_getIsSomeColumnsPinned<
|
|
|
337
349
|
// header groups
|
|
338
350
|
|
|
339
351
|
/**
|
|
340
|
-
*
|
|
352
|
+
* Builds header groups for visible columns pinned to the left region.
|
|
341
353
|
*
|
|
342
|
-
*
|
|
354
|
+
* The leaf columns are read in `state.columnPinning.left` order and then passed
|
|
355
|
+
* through the same header-group builder as the unpinned table.
|
|
343
356
|
*
|
|
344
357
|
* @example
|
|
345
358
|
* ```ts
|
|
346
|
-
* const
|
|
359
|
+
* const headerGroups = table_getLeftHeaderGroups(table)
|
|
347
360
|
* ```
|
|
348
361
|
*/
|
|
349
362
|
export function table_getLeftHeaderGroups<
|
|
@@ -374,13 +387,14 @@ export function table_getLeftHeaderGroups<
|
|
|
374
387
|
}
|
|
375
388
|
|
|
376
389
|
/**
|
|
377
|
-
*
|
|
390
|
+
* Builds header groups for visible columns pinned to the right region.
|
|
378
391
|
*
|
|
379
|
-
*
|
|
392
|
+
* The leaf columns are read in `state.columnPinning.right` order and then
|
|
393
|
+
* passed through the same header-group builder as the unpinned table.
|
|
380
394
|
*
|
|
381
395
|
* @example
|
|
382
396
|
* ```ts
|
|
383
|
-
* const
|
|
397
|
+
* const headerGroups = table_getRightHeaderGroups(table)
|
|
384
398
|
* ```
|
|
385
399
|
*/
|
|
386
400
|
export function table_getRightHeaderGroups<
|
|
@@ -411,13 +425,14 @@ export function table_getRightHeaderGroups<
|
|
|
411
425
|
}
|
|
412
426
|
|
|
413
427
|
/**
|
|
414
|
-
*
|
|
428
|
+
* Builds header groups for visible columns that are not pinned.
|
|
415
429
|
*
|
|
416
|
-
*
|
|
430
|
+
* Left- and right-pinned column ids are removed from the visible leaf column
|
|
431
|
+
* list before header groups are built for the center region.
|
|
417
432
|
*
|
|
418
433
|
* @example
|
|
419
434
|
* ```ts
|
|
420
|
-
* const
|
|
435
|
+
* const headerGroups = table_getCenterHeaderGroups(table)
|
|
421
436
|
* ```
|
|
422
437
|
*/
|
|
423
438
|
export function table_getCenterHeaderGroups<
|
|
@@ -445,13 +460,13 @@ export function table_getCenterHeaderGroups<
|
|
|
445
460
|
// footer groups
|
|
446
461
|
|
|
447
462
|
/**
|
|
448
|
-
*
|
|
463
|
+
* Builds footer groups for the left pinned region.
|
|
449
464
|
*
|
|
450
|
-
*
|
|
465
|
+
* Footer groups reuse the left header groups in reverse order.
|
|
451
466
|
*
|
|
452
467
|
* @example
|
|
453
468
|
* ```ts
|
|
454
|
-
* const
|
|
469
|
+
* const footerGroups = table_getLeftFooterGroups(table)
|
|
455
470
|
* ```
|
|
456
471
|
*/
|
|
457
472
|
export function table_getLeftFooterGroups<
|
|
@@ -467,13 +482,13 @@ export function table_getLeftFooterGroups<
|
|
|
467
482
|
}
|
|
468
483
|
|
|
469
484
|
/**
|
|
470
|
-
*
|
|
485
|
+
* Builds footer groups for the right pinned region.
|
|
471
486
|
*
|
|
472
|
-
*
|
|
487
|
+
* Footer groups reuse the right header groups in reverse order.
|
|
473
488
|
*
|
|
474
489
|
* @example
|
|
475
490
|
* ```ts
|
|
476
|
-
* const
|
|
491
|
+
* const footerGroups = table_getRightFooterGroups(table)
|
|
477
492
|
* ```
|
|
478
493
|
*/
|
|
479
494
|
export function table_getRightFooterGroups<
|
|
@@ -489,13 +504,13 @@ export function table_getRightFooterGroups<
|
|
|
489
504
|
}
|
|
490
505
|
|
|
491
506
|
/**
|
|
492
|
-
*
|
|
507
|
+
* Builds footer groups for the center, unpinned region.
|
|
493
508
|
*
|
|
494
|
-
*
|
|
509
|
+
* Footer groups reuse the center header groups in reverse order.
|
|
495
510
|
*
|
|
496
511
|
* @example
|
|
497
512
|
* ```ts
|
|
498
|
-
* const
|
|
513
|
+
* const footerGroups = table_getCenterFooterGroups(table)
|
|
499
514
|
* ```
|
|
500
515
|
*/
|
|
501
516
|
export function table_getCenterFooterGroups<
|
|
@@ -513,13 +528,13 @@ export function table_getCenterFooterGroups<
|
|
|
513
528
|
// flat headers
|
|
514
529
|
|
|
515
530
|
/**
|
|
516
|
-
*
|
|
531
|
+
* Flattens every header from the left pinned header groups.
|
|
517
532
|
*
|
|
518
|
-
*
|
|
533
|
+
* Parent headers and placeholder headers are included.
|
|
519
534
|
*
|
|
520
535
|
* @example
|
|
521
536
|
* ```ts
|
|
522
|
-
* const
|
|
537
|
+
* const headers = table_getLeftFlatHeaders(table)
|
|
523
538
|
* ```
|
|
524
539
|
*/
|
|
525
540
|
export function table_getLeftFlatHeaders<
|
|
@@ -542,13 +557,13 @@ export function table_getLeftFlatHeaders<
|
|
|
542
557
|
}
|
|
543
558
|
|
|
544
559
|
/**
|
|
545
|
-
*
|
|
560
|
+
* Flattens every header from the right pinned header groups.
|
|
546
561
|
*
|
|
547
|
-
*
|
|
562
|
+
* Parent headers and placeholder headers are included.
|
|
548
563
|
*
|
|
549
564
|
* @example
|
|
550
565
|
* ```ts
|
|
551
|
-
* const
|
|
566
|
+
* const headers = table_getRightFlatHeaders(table)
|
|
552
567
|
* ```
|
|
553
568
|
*/
|
|
554
569
|
export function table_getRightFlatHeaders<
|
|
@@ -571,13 +586,13 @@ export function table_getRightFlatHeaders<
|
|
|
571
586
|
}
|
|
572
587
|
|
|
573
588
|
/**
|
|
574
|
-
*
|
|
589
|
+
* Flattens every header from the center header groups.
|
|
575
590
|
*
|
|
576
|
-
*
|
|
591
|
+
* Parent headers and placeholder headers are included.
|
|
577
592
|
*
|
|
578
593
|
* @example
|
|
579
594
|
* ```ts
|
|
580
|
-
* const
|
|
595
|
+
* const headers = table_getCenterFlatHeaders(table)
|
|
581
596
|
* ```
|
|
582
597
|
*/
|
|
583
598
|
export function table_getCenterFlatHeaders<
|
|
@@ -602,13 +617,13 @@ export function table_getCenterFlatHeaders<
|
|
|
602
617
|
// leaf headers
|
|
603
618
|
|
|
604
619
|
/**
|
|
605
|
-
*
|
|
620
|
+
* Collects leaf headers for the left pinned region.
|
|
606
621
|
*
|
|
607
|
-
*
|
|
622
|
+
* Parent headers are filtered out from the left flat header list.
|
|
608
623
|
*
|
|
609
624
|
* @example
|
|
610
625
|
* ```ts
|
|
611
|
-
* const
|
|
626
|
+
* const headers = table_getLeftLeafHeaders(table)
|
|
612
627
|
* ```
|
|
613
628
|
*/
|
|
614
629
|
export function table_getLeftLeafHeaders<
|
|
@@ -623,13 +638,13 @@ export function table_getLeftLeafHeaders<
|
|
|
623
638
|
}
|
|
624
639
|
|
|
625
640
|
/**
|
|
626
|
-
*
|
|
641
|
+
* Collects leaf headers for the right pinned region.
|
|
627
642
|
*
|
|
628
|
-
*
|
|
643
|
+
* Parent headers are filtered out from the right flat header list.
|
|
629
644
|
*
|
|
630
645
|
* @example
|
|
631
646
|
* ```ts
|
|
632
|
-
* const
|
|
647
|
+
* const headers = table_getRightLeafHeaders(table)
|
|
633
648
|
* ```
|
|
634
649
|
*/
|
|
635
650
|
export function table_getRightLeafHeaders<
|
|
@@ -644,13 +659,13 @@ export function table_getRightLeafHeaders<
|
|
|
644
659
|
}
|
|
645
660
|
|
|
646
661
|
/**
|
|
647
|
-
*
|
|
662
|
+
* Collects leaf headers for the center, unpinned region.
|
|
648
663
|
*
|
|
649
|
-
*
|
|
664
|
+
* Parent headers are filtered out from the center flat header list.
|
|
650
665
|
*
|
|
651
666
|
* @example
|
|
652
667
|
* ```ts
|
|
653
|
-
* const
|
|
668
|
+
* const headers = table_getCenterLeafHeaders(table)
|
|
654
669
|
* ```
|
|
655
670
|
*/
|
|
656
671
|
export function table_getCenterLeafHeaders<
|
|
@@ -667,13 +682,14 @@ export function table_getCenterLeafHeaders<
|
|
|
667
682
|
// leaf columns
|
|
668
683
|
|
|
669
684
|
/**
|
|
670
|
-
*
|
|
685
|
+
* Resolves leaf columns pinned to the left region.
|
|
671
686
|
*
|
|
672
|
-
*
|
|
687
|
+
* The result follows `state.columnPinning.left` order and skips stale ids that
|
|
688
|
+
* no longer correspond to a leaf column.
|
|
673
689
|
*
|
|
674
690
|
* @example
|
|
675
691
|
* ```ts
|
|
676
|
-
* const
|
|
692
|
+
* const columns = table_getLeftLeafColumns(table)
|
|
677
693
|
* ```
|
|
678
694
|
*/
|
|
679
695
|
export function table_getLeftLeafColumns<
|
|
@@ -692,13 +708,14 @@ export function table_getLeftLeafColumns<
|
|
|
692
708
|
}
|
|
693
709
|
|
|
694
710
|
/**
|
|
695
|
-
*
|
|
711
|
+
* Resolves leaf columns pinned to the right region.
|
|
696
712
|
*
|
|
697
|
-
*
|
|
713
|
+
* The result follows `state.columnPinning.right` order and skips stale ids that
|
|
714
|
+
* no longer correspond to a leaf column.
|
|
698
715
|
*
|
|
699
716
|
* @example
|
|
700
717
|
* ```ts
|
|
701
|
-
* const
|
|
718
|
+
* const columns = table_getRightLeafColumns(table)
|
|
702
719
|
* ```
|
|
703
720
|
*/
|
|
704
721
|
export function table_getRightLeafColumns<
|
|
@@ -717,13 +734,13 @@ export function table_getRightLeafColumns<
|
|
|
717
734
|
}
|
|
718
735
|
|
|
719
736
|
/**
|
|
720
|
-
*
|
|
737
|
+
* Resolves leaf columns that are not pinned to either side.
|
|
721
738
|
*
|
|
722
|
-
*
|
|
739
|
+
* Left- and right-pinned ids are removed from `table.getAllLeafColumns()`.
|
|
723
740
|
*
|
|
724
741
|
* @example
|
|
725
742
|
* ```ts
|
|
726
|
-
* const
|
|
743
|
+
* const columns = table_getCenterLeafColumns(table)
|
|
727
744
|
* ```
|
|
728
745
|
*/
|
|
729
746
|
export function table_getCenterLeafColumns<
|
|
@@ -737,13 +754,14 @@ export function table_getCenterLeafColumns<
|
|
|
737
754
|
}
|
|
738
755
|
|
|
739
756
|
/**
|
|
740
|
-
*
|
|
757
|
+
* Resolves leaf columns for a requested pinning region.
|
|
741
758
|
*
|
|
742
|
-
*
|
|
759
|
+
* Pass `'left'`, `'center'`, or `'right'` for a partition, or pass `false` to
|
|
760
|
+
* read all leaf columns without partitioning.
|
|
743
761
|
*
|
|
744
762
|
* @example
|
|
745
763
|
* ```ts
|
|
746
|
-
* const
|
|
764
|
+
* const columns = table_getPinnedLeafColumns(table, 'center')
|
|
747
765
|
* ```
|
|
748
766
|
*/
|
|
749
767
|
export function table_getPinnedLeafColumns<
|
|
@@ -777,13 +795,13 @@ export function table_getPinnedLeafColumns<
|
|
|
777
795
|
// visible leaf columns
|
|
778
796
|
|
|
779
797
|
/**
|
|
780
|
-
*
|
|
798
|
+
* Resolves visible leaf columns pinned to the left region.
|
|
781
799
|
*
|
|
782
|
-
*
|
|
800
|
+
* Hidden pinned columns are filtered out after the left pin order is applied.
|
|
783
801
|
*
|
|
784
802
|
* @example
|
|
785
803
|
* ```ts
|
|
786
|
-
* const
|
|
804
|
+
* const columns = table_getLeftVisibleLeafColumns(table)
|
|
787
805
|
* ```
|
|
788
806
|
*/
|
|
789
807
|
export function table_getLeftVisibleLeafColumns<
|
|
@@ -800,13 +818,13 @@ export function table_getLeftVisibleLeafColumns<
|
|
|
800
818
|
}
|
|
801
819
|
|
|
802
820
|
/**
|
|
803
|
-
*
|
|
821
|
+
* Resolves visible leaf columns pinned to the right region.
|
|
804
822
|
*
|
|
805
|
-
*
|
|
823
|
+
* Hidden pinned columns are filtered out after the right pin order is applied.
|
|
806
824
|
*
|
|
807
825
|
* @example
|
|
808
826
|
* ```ts
|
|
809
|
-
* const
|
|
827
|
+
* const columns = table_getRightVisibleLeafColumns(table)
|
|
810
828
|
* ```
|
|
811
829
|
*/
|
|
812
830
|
export function table_getRightVisibleLeafColumns<
|
|
@@ -823,13 +841,14 @@ export function table_getRightVisibleLeafColumns<
|
|
|
823
841
|
}
|
|
824
842
|
|
|
825
843
|
/**
|
|
826
|
-
*
|
|
844
|
+
* Resolves visible leaf columns that are not pinned.
|
|
827
845
|
*
|
|
828
|
-
* This
|
|
846
|
+
* This is the center partition used by layouts that render pinned columns
|
|
847
|
+
* separately from the scrollable middle region.
|
|
829
848
|
*
|
|
830
849
|
* @example
|
|
831
850
|
* ```ts
|
|
832
|
-
* const
|
|
851
|
+
* const columns = table_getCenterVisibleLeafColumns(table)
|
|
833
852
|
* ```
|
|
834
853
|
*/
|
|
835
854
|
export function table_getCenterVisibleLeafColumns<
|
|
@@ -846,13 +865,14 @@ export function table_getCenterVisibleLeafColumns<
|
|
|
846
865
|
}
|
|
847
866
|
|
|
848
867
|
/**
|
|
849
|
-
*
|
|
868
|
+
* Resolves visible leaf columns for a requested pinning region.
|
|
850
869
|
*
|
|
851
|
-
*
|
|
870
|
+
* Omit `position` to get all visible leaf columns, or pass `'left'`, `'center'`,
|
|
871
|
+
* or `'right'` to get one partition.
|
|
852
872
|
*
|
|
853
873
|
* @example
|
|
854
874
|
* ```ts
|
|
855
|
-
* const
|
|
875
|
+
* const columns = table_getPinnedVisibleLeafColumns(table, 'left')
|
|
856
876
|
* ```
|
|
857
877
|
*/
|
|
858
878
|
export function table_getPinnedVisibleLeafColumns<
|
|
@@ -47,12 +47,13 @@ export type ColumnResizingDefaultOptions = Pick<
|
|
|
47
47
|
|
|
48
48
|
export interface Table_ColumnResizing {
|
|
49
49
|
/**
|
|
50
|
-
* Resets
|
|
51
|
-
*
|
|
50
|
+
* Resets `columnResizing` to `initialState.columnResizing`.
|
|
51
|
+
*
|
|
52
|
+
* Pass `true` to ignore initial state and reset to the no-drag default state.
|
|
52
53
|
*/
|
|
53
54
|
resetHeaderSizeInfo: (defaultState?: boolean) => void
|
|
54
55
|
/**
|
|
55
|
-
*
|
|
56
|
+
* Updates transient resize interaction state with a next state or updater function.
|
|
56
57
|
*
|
|
57
58
|
* The lowercase `c` in this API name matches the current generated v9 table
|
|
58
59
|
* API for the `columnResizing` state slice.
|
|
@@ -69,21 +70,20 @@ export interface ColumnDef_ColumnResizing {
|
|
|
69
70
|
|
|
70
71
|
export interface Column_ColumnResizing {
|
|
71
72
|
/**
|
|
72
|
-
*
|
|
73
|
+
* Checks whether this column can start a resize interaction.
|
|
73
74
|
*/
|
|
74
75
|
getCanResize: () => boolean
|
|
75
76
|
/**
|
|
76
|
-
*
|
|
77
|
+
* Checks whether this column is the active resize target.
|
|
77
78
|
*/
|
|
78
79
|
getIsResizing: () => boolean
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
export interface Header_ColumnResizing {
|
|
82
83
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* The dragging and release events are automatically handled for you.
|
|
84
|
+
* Creates the `onMouseDown`/`onTouchStart` handler for a resize handle.
|
|
85
|
+
*
|
|
86
|
+
* Dragging and release listeners are installed and cleaned up automatically.
|
|
87
87
|
*/
|
|
88
88
|
getResizeHandler: (context?: Document) => (event: unknown) => void
|
|
89
89
|
}
|