@tanstack/table-core 9.0.0-beta.37 → 9.0.0-beta.42
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 +1 -0
- package/dist/core/headers/buildHeaderGroups.cjs.map +1 -1
- package/dist/core/headers/buildHeaderGroups.d.cts +1 -1
- package/dist/core/headers/buildHeaderGroups.d.ts +1 -1
- package/dist/core/headers/buildHeaderGroups.js.map +1 -1
- package/dist/core/headers/coreHeadersFeature.utils.cjs +7 -7
- package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
- package/dist/core/headers/coreHeadersFeature.utils.js +7 -7
- package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
- package/dist/core/table/coreTablesFeature.utils.cjs +1 -1
- package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
- package/dist/core/table/coreTablesFeature.utils.js +1 -1
- package/dist/core/table/coreTablesFeature.utils.js.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.types.d.cts +5 -5
- package/dist/features/column-ordering/columnOrderingFeature.types.d.ts +5 -5
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs +6 -6
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.cts +3 -3
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.ts +3 -3
- package/dist/features/column-ordering/columnOrderingFeature.utils.js +6 -6
- package/dist/features/column-ordering/columnOrderingFeature.utils.js.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.cjs +44 -39
- package/dist/features/column-pinning/columnPinningFeature.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.d.cts +6 -1
- package/dist/features/column-pinning/columnPinningFeature.d.ts +6 -1
- package/dist/features/column-pinning/columnPinningFeature.js +45 -40
- package/dist/features/column-pinning/columnPinningFeature.js.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.types.d.cts +49 -38
- package/dist/features/column-pinning/columnPinningFeature.types.d.ts +49 -38
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs +154 -146
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +81 -73
- package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +81 -73
- package/dist/features/column-pinning/columnPinningFeature.utils.js +141 -133
- package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.cjs +4 -4
- package/dist/features/column-sizing/columnSizingFeature.cjs.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.js +5 -5
- package/dist/features/column-sizing/columnSizingFeature.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.types.d.cts +18 -12
- package/dist/features/column-sizing/columnSizingFeature.types.d.ts +18 -12
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs +24 -20
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +18 -14
- package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +18 -14
- package/dist/features/column-sizing/columnSizingFeature.utils.js +24 -20
- package/dist/features/column-sizing/columnSizingFeature.utils.js.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs +16 -16
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.cts +3 -3
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +3 -3
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js +16 -16
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js.map +1 -1
- package/dist/static-functions.cjs +16 -16
- package/dist/static-functions.d.cts +3 -3
- package/dist/static-functions.d.ts +3 -3
- package/dist/static-functions.js +3 -3
- package/package.json +1 -1
- package/skills/api-not-found/SKILL.md +113 -0
- package/skills/client-vs-server/SKILL.md +164 -0
- package/skills/column-faceting/SKILL.md +91 -0
- package/skills/column-filtering/SKILL.md +82 -0
- package/skills/column-ordering/SKILL.md +75 -0
- package/skills/column-pinning/SKILL.md +89 -0
- package/skills/column-resizing/SKILL.md +91 -0
- package/skills/column-sizing/SKILL.md +72 -0
- package/skills/column-visibility/SKILL.md +75 -0
- package/skills/core/SKILL.md +140 -0
- package/skills/custom-features/SKILL.md +207 -0
- package/skills/expanding/SKILL.md +80 -0
- package/skills/global-filtering/SKILL.md +84 -0
- package/skills/grouping/SKILL.md +50 -394
- package/skills/migrate-v8-to-v9/SKILL.md +230 -390
- package/skills/pagination/SKILL.md +35 -344
- package/skills/row-pinning/SKILL.md +47 -238
- package/skills/row-selection/SKILL.md +39 -351
- package/skills/sorting/SKILL.md +35 -299
- package/skills/table-features/SKILL.md +153 -0
- package/skills/typescript/SKILL.md +126 -0
- package/src/core/headers/buildHeaderGroups.ts +1 -1
- package/src/core/headers/coreHeadersFeature.utils.ts +7 -7
- package/src/core/table/coreTablesFeature.utils.ts +1 -1
- package/src/features/column-ordering/columnOrderingFeature.types.ts +5 -5
- package/src/features/column-ordering/columnOrderingFeature.utils.ts +9 -9
- package/src/features/column-pinning/columnPinningFeature.ts +64 -59
- package/src/features/column-pinning/columnPinningFeature.types.ts +49 -38
- package/src/features/column-pinning/columnPinningFeature.utils.ts +163 -155
- package/src/features/column-sizing/columnSizingFeature.ts +6 -6
- package/src/features/column-sizing/columnSizingFeature.types.ts +18 -12
- package/src/features/column-sizing/columnSizingFeature.utils.ts +31 -27
- package/src/features/column-visibility/columnVisibilityFeature.utils.ts +15 -15
- package/skills/column-definitions/SKILL.md +0 -330
- package/skills/column-layout/SKILL.md +0 -326
- package/skills/column-layout/references/subsystems.md +0 -220
- package/skills/customizing-feature-behavior/SKILL.md +0 -423
- package/skills/filtering/SKILL.md +0 -375
- package/skills/filtering/references/faceting-and-fuzzy.md +0 -218
- package/skills/row-expanding/SKILL.md +0 -356
- package/skills/setup/SKILL.md +0 -390
- package/skills/state-management/SKILL.md +0 -403
|
@@ -16,20 +16,24 @@ const require_buildHeaderGroups = require('../../core/headers/buildHeaderGroups.
|
|
|
16
16
|
*/
|
|
17
17
|
function getDefaultColumnPinningState() {
|
|
18
18
|
return {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
start: [],
|
|
20
|
+
end: []
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Moves this column's leaf column ids into a pinning region.
|
|
25
25
|
*
|
|
26
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 `'
|
|
27
|
+
* from both regions, then appended to the requested `'start'` or `'end'`
|
|
28
28
|
* region. Passing `false` unpins them back to the center.
|
|
29
29
|
*
|
|
30
|
+
* `start` and `end` are logical positions. In LTR languages/layouts, `start`
|
|
31
|
+
* usually corresponds to left and `end` to right. In RTL languages/layouts,
|
|
32
|
+
* `start` usually corresponds to right and `end` to left.
|
|
33
|
+
*
|
|
30
34
|
* @example
|
|
31
35
|
* ```ts
|
|
32
|
-
* column_pin(column, '
|
|
36
|
+
* column_pin(column, 'start')
|
|
33
37
|
* ```
|
|
34
38
|
*/
|
|
35
39
|
function column_pin(column, position) {
|
|
@@ -40,17 +44,17 @@ function column_pin(column, position) {
|
|
|
40
44
|
if (id) columnIds.push(id);
|
|
41
45
|
}
|
|
42
46
|
table_setColumnPinning(column.table, (old) => {
|
|
43
|
-
if (position === "
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
if (position === "end") return {
|
|
48
|
+
start: old.start.filter((d) => !columnIds.includes(d)),
|
|
49
|
+
end: [...old.end.filter((d) => !columnIds.includes(d)), ...columnIds]
|
|
46
50
|
};
|
|
47
|
-
if (position === "
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
if (position === "start") return {
|
|
52
|
+
start: [...old.start.filter((d) => !columnIds.includes(d)), ...columnIds],
|
|
53
|
+
end: old.end.filter((d) => !columnIds.includes(d))
|
|
50
54
|
};
|
|
51
55
|
return {
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
start: old.start.filter((d) => !columnIds.includes(d)),
|
|
57
|
+
end: old.end.filter((d) => !columnIds.includes(d))
|
|
54
58
|
};
|
|
55
59
|
});
|
|
56
60
|
}
|
|
@@ -71,9 +75,13 @@ function column_getCanPin(column) {
|
|
|
71
75
|
/**
|
|
72
76
|
* Reads this column's current pinning region.
|
|
73
77
|
*
|
|
74
|
-
* Group columns report `'
|
|
78
|
+
* Group columns report `'start'` or `'end'` when any leaf column is pinned in
|
|
75
79
|
* that region. Unpinned columns return `false`.
|
|
76
80
|
*
|
|
81
|
+
* `start` and `end` are logical positions. In LTR languages/layouts, `start`
|
|
82
|
+
* usually corresponds to left and `end` to right. In RTL languages/layouts,
|
|
83
|
+
* `start` usually corresponds to right and `end` to left.
|
|
84
|
+
*
|
|
77
85
|
* @example
|
|
78
86
|
* ```ts
|
|
79
87
|
* const position = column_getIsPinned(column)
|
|
@@ -81,16 +89,16 @@ function column_getCanPin(column) {
|
|
|
81
89
|
*/
|
|
82
90
|
function column_getIsPinned(column) {
|
|
83
91
|
const leafColumns = column.getLeafColumns();
|
|
84
|
-
const {
|
|
85
|
-
for (let i = 0; i < leafColumns.length; i++) if (
|
|
86
|
-
for (let i = 0; i < leafColumns.length; i++) if (
|
|
92
|
+
const { start, end } = column.table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
|
|
93
|
+
for (let i = 0; i < leafColumns.length; i++) if (start.includes(leafColumns[i].id)) return "start";
|
|
94
|
+
for (let i = 0; i < leafColumns.length; i++) if (end.includes(leafColumns[i].id)) return "end";
|
|
87
95
|
return false;
|
|
88
96
|
}
|
|
89
97
|
/**
|
|
90
98
|
* Finds this column's index within its pinned region.
|
|
91
99
|
*
|
|
92
100
|
* Unpinned columns return `0`; pinned columns return their position in
|
|
93
|
-
* `state.columnPinning.
|
|
101
|
+
* `state.columnPinning.start` or `state.columnPinning.end`.
|
|
94
102
|
*
|
|
95
103
|
* @example
|
|
96
104
|
* ```ts
|
|
@@ -102,7 +110,7 @@ function column_getPinnedIndex(column) {
|
|
|
102
110
|
return position ? column.table.atoms.columnPinning?.get()?.[position].indexOf(column.id) ?? -1 : 0;
|
|
103
111
|
}
|
|
104
112
|
/**
|
|
105
|
-
* Collects visible cells whose columns are not pinned
|
|
113
|
+
* Collects visible cells whose columns are not pinned start or end.
|
|
106
114
|
*
|
|
107
115
|
* The result preserves the row's visible-cell order for center columns.
|
|
108
116
|
*
|
|
@@ -113,56 +121,56 @@ function column_getPinnedIndex(column) {
|
|
|
113
121
|
*/
|
|
114
122
|
function row_getCenterVisibleCells(row) {
|
|
115
123
|
const allCells = require_utils.callMemoOrStaticFn(row, "getVisibleCells", require_columnVisibilityFeature_utils.row_getVisibleCells);
|
|
116
|
-
const {
|
|
117
|
-
if (!
|
|
118
|
-
const
|
|
119
|
-
return allCells.filter((d) => !
|
|
124
|
+
const { start, end } = row.table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
|
|
125
|
+
if (!start.length && !end.length) return allCells;
|
|
126
|
+
const startAndEnd = [...start, ...end];
|
|
127
|
+
return allCells.filter((d) => !startAndEnd.includes(d.column.id));
|
|
120
128
|
}
|
|
121
129
|
/**
|
|
122
|
-
* Collects visible cells for columns pinned to the
|
|
130
|
+
* Collects visible cells for columns pinned to the start region.
|
|
123
131
|
*
|
|
124
|
-
* Cells are returned in `state.columnPinning.
|
|
125
|
-
* `cell.position = '
|
|
132
|
+
* Cells are returned in `state.columnPinning.start` order and are marked with
|
|
133
|
+
* `cell.position = 'start'`.
|
|
126
134
|
*
|
|
127
135
|
* @example
|
|
128
136
|
* ```ts
|
|
129
|
-
* const
|
|
137
|
+
* const startCells = row_getStartVisibleCells(row)
|
|
130
138
|
* ```
|
|
131
139
|
*/
|
|
132
|
-
function
|
|
133
|
-
const {
|
|
134
|
-
if (!
|
|
140
|
+
function row_getStartVisibleCells(row) {
|
|
141
|
+
const { start } = row.table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
|
|
142
|
+
if (!start.length) return [];
|
|
135
143
|
const allVisibleCells = require_utils.callMemoOrStaticFn(row, "getVisibleCellsByColumnId", require_columnVisibilityFeature_utils.row_getVisibleCellsByColumnId);
|
|
136
144
|
const cells = [];
|
|
137
|
-
for (let i = 0; i <
|
|
138
|
-
const cell = allVisibleCells[
|
|
145
|
+
for (let i = 0; i < start.length; i++) {
|
|
146
|
+
const cell = allVisibleCells[start[i]];
|
|
139
147
|
if (cell) {
|
|
140
|
-
cell.position = "
|
|
148
|
+
cell.position = "start";
|
|
141
149
|
cells.push(cell);
|
|
142
150
|
}
|
|
143
151
|
}
|
|
144
152
|
return cells;
|
|
145
153
|
}
|
|
146
154
|
/**
|
|
147
|
-
* Collects visible cells for columns pinned to the
|
|
155
|
+
* Collects visible cells for columns pinned to the end region.
|
|
148
156
|
*
|
|
149
|
-
* Cells are returned in `state.columnPinning.
|
|
150
|
-
* `cell.position = '
|
|
157
|
+
* Cells are returned in `state.columnPinning.end` order and are marked with
|
|
158
|
+
* `cell.position = 'end'`.
|
|
151
159
|
*
|
|
152
160
|
* @example
|
|
153
161
|
* ```ts
|
|
154
|
-
* const
|
|
162
|
+
* const endCells = row_getEndVisibleCells(row)
|
|
155
163
|
* ```
|
|
156
164
|
*/
|
|
157
|
-
function
|
|
158
|
-
const {
|
|
159
|
-
if (!
|
|
165
|
+
function row_getEndVisibleCells(row) {
|
|
166
|
+
const { end } = row.table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
|
|
167
|
+
if (!end.length) return [];
|
|
160
168
|
const allVisibleCells = require_utils.callMemoOrStaticFn(row, "getVisibleCellsByColumnId", require_columnVisibilityFeature_utils.row_getVisibleCellsByColumnId);
|
|
161
169
|
const cells = [];
|
|
162
|
-
for (let i = 0; i <
|
|
163
|
-
const cell = allVisibleCells[
|
|
170
|
+
for (let i = 0; i < end.length; i++) {
|
|
171
|
+
const cell = allVisibleCells[end[i]];
|
|
164
172
|
if (cell) {
|
|
165
|
-
cell.position = "
|
|
173
|
+
cell.position = "end";
|
|
166
174
|
cells.push(cell);
|
|
167
175
|
}
|
|
168
176
|
}
|
|
@@ -171,12 +179,12 @@ function row_getRightVisibleCells(row) {
|
|
|
171
179
|
/**
|
|
172
180
|
* Routes a column pinning updater through the table's pinning change handler.
|
|
173
181
|
*
|
|
174
|
-
* The updater may be a next `{
|
|
182
|
+
* The updater may be a next `{ start, end }` state or a function of the
|
|
175
183
|
* previous state, matching the instance `table.setColumnPinning` behavior.
|
|
176
184
|
*
|
|
177
185
|
* @example
|
|
178
186
|
* ```ts
|
|
179
|
-
* table_setColumnPinning(table, (old) => ({ ...old,
|
|
187
|
+
* table_setColumnPinning(table, (old) => ({ ...old, start: ['select'] }))
|
|
180
188
|
* ```
|
|
181
189
|
*/
|
|
182
190
|
function table_setColumnPinning(table, updater) {
|
|
@@ -186,7 +194,7 @@ function table_setColumnPinning(table, updater) {
|
|
|
186
194
|
* Resets `columnPinning` to the configured initial state or feature default.
|
|
187
195
|
*
|
|
188
196
|
* With no argument, the reset clones `table.initialState.columnPinning` when it
|
|
189
|
-
* exists. Passing `true` ignores initial state and resets to empty
|
|
197
|
+
* exists. Passing `true` ignores initial state and resets to empty start/end
|
|
190
198
|
* arrays.
|
|
191
199
|
*
|
|
192
200
|
* @example
|
|
@@ -201,7 +209,7 @@ function table_resetColumnPinning(table, defaultState) {
|
|
|
201
209
|
/**
|
|
202
210
|
* Checks whether any columns are pinned.
|
|
203
211
|
*
|
|
204
|
-
* Omit `position` to check both sides, or pass `'
|
|
212
|
+
* Omit `position` to check both sides, or pass `'start'`/`'end'` to inspect a
|
|
205
213
|
* single pinning region.
|
|
206
214
|
*
|
|
207
215
|
* @example
|
|
@@ -211,57 +219,57 @@ function table_resetColumnPinning(table, defaultState) {
|
|
|
211
219
|
*/
|
|
212
220
|
function table_getIsSomeColumnsPinned(table, position) {
|
|
213
221
|
const pinningState = table.atoms.columnPinning?.get();
|
|
214
|
-
if (!position) return Boolean(pinningState?.
|
|
222
|
+
if (!position) return Boolean(pinningState?.start.length || pinningState?.end.length);
|
|
215
223
|
return Boolean(pinningState?.[position].length);
|
|
216
224
|
}
|
|
217
225
|
/**
|
|
218
|
-
* Builds header groups for visible columns pinned to the
|
|
226
|
+
* Builds header groups for visible columns pinned to the start region.
|
|
219
227
|
*
|
|
220
|
-
* The leaf columns are read in `state.columnPinning.
|
|
228
|
+
* The leaf columns are read in `state.columnPinning.start` order and then passed
|
|
221
229
|
* through the same header-group builder as the unpinned table.
|
|
222
230
|
*
|
|
223
231
|
* @example
|
|
224
232
|
* ```ts
|
|
225
|
-
* const headerGroups =
|
|
233
|
+
* const headerGroups = table_getStartHeaderGroups(table)
|
|
226
234
|
* ```
|
|
227
235
|
*/
|
|
228
|
-
function
|
|
236
|
+
function table_getStartHeaderGroups(table) {
|
|
229
237
|
const allColumns = table.getAllColumns();
|
|
230
238
|
const leafColumnsById = table.getAllLeafColumnsById();
|
|
231
|
-
const {
|
|
239
|
+
const { start } = table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
|
|
232
240
|
const orderedLeafColumns = [];
|
|
233
|
-
for (let i = 0; i <
|
|
234
|
-
const column = leafColumnsById[
|
|
241
|
+
for (let i = 0; i < start.length; i++) {
|
|
242
|
+
const column = leafColumnsById[start[i]];
|
|
235
243
|
if (column && require_utils.callMemoOrStaticFn(column, "getIsVisible", require_columnVisibilityFeature_utils.column_getIsVisible)) orderedLeafColumns.push(column);
|
|
236
244
|
}
|
|
237
|
-
return require_buildHeaderGroups.buildHeaderGroups(allColumns, orderedLeafColumns, table, "
|
|
245
|
+
return require_buildHeaderGroups.buildHeaderGroups(allColumns, orderedLeafColumns, table, "start");
|
|
238
246
|
}
|
|
239
247
|
/**
|
|
240
|
-
* Builds header groups for visible columns pinned to the
|
|
248
|
+
* Builds header groups for visible columns pinned to the end region.
|
|
241
249
|
*
|
|
242
|
-
* The leaf columns are read in `state.columnPinning.
|
|
250
|
+
* The leaf columns are read in `state.columnPinning.end` order and then
|
|
243
251
|
* passed through the same header-group builder as the unpinned table.
|
|
244
252
|
*
|
|
245
253
|
* @example
|
|
246
254
|
* ```ts
|
|
247
|
-
* const headerGroups =
|
|
255
|
+
* const headerGroups = table_getEndHeaderGroups(table)
|
|
248
256
|
* ```
|
|
249
257
|
*/
|
|
250
|
-
function
|
|
258
|
+
function table_getEndHeaderGroups(table) {
|
|
251
259
|
const allColumns = table.getAllColumns();
|
|
252
260
|
const leafColumnsById = table.getAllLeafColumnsById();
|
|
253
|
-
const {
|
|
261
|
+
const { end } = table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
|
|
254
262
|
const orderedLeafColumns = [];
|
|
255
|
-
for (let i = 0; i <
|
|
256
|
-
const column = leafColumnsById[
|
|
263
|
+
for (let i = 0; i < end.length; i++) {
|
|
264
|
+
const column = leafColumnsById[end[i]];
|
|
257
265
|
if (column && require_utils.callMemoOrStaticFn(column, "getIsVisible", require_columnVisibilityFeature_utils.column_getIsVisible)) orderedLeafColumns.push(column);
|
|
258
266
|
}
|
|
259
|
-
return require_buildHeaderGroups.buildHeaderGroups(allColumns, orderedLeafColumns, table, "
|
|
267
|
+
return require_buildHeaderGroups.buildHeaderGroups(allColumns, orderedLeafColumns, table, "end");
|
|
260
268
|
}
|
|
261
269
|
/**
|
|
262
270
|
* Builds header groups for visible columns that are not pinned.
|
|
263
271
|
*
|
|
264
|
-
*
|
|
272
|
+
* Start- and end-pinned column ids are removed from the visible leaf column
|
|
265
273
|
* list before header groups are built for the center region.
|
|
266
274
|
*
|
|
267
275
|
* @example
|
|
@@ -272,38 +280,38 @@ function table_getRightHeaderGroups(table) {
|
|
|
272
280
|
function table_getCenterHeaderGroups(table) {
|
|
273
281
|
const allColumns = table.getAllColumns();
|
|
274
282
|
let leafColumns = require_utils.callMemoOrStaticFn(table, "getVisibleLeafColumns", require_columnVisibilityFeature_utils.table_getVisibleLeafColumns);
|
|
275
|
-
const {
|
|
276
|
-
if (
|
|
277
|
-
const
|
|
278
|
-
leafColumns = leafColumns.filter((column) => !
|
|
283
|
+
const { start, end } = table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
|
|
284
|
+
if (start.length || end.length) {
|
|
285
|
+
const startAndEnd = [...start, ...end];
|
|
286
|
+
leafColumns = leafColumns.filter((column) => !startAndEnd.includes(column.id));
|
|
279
287
|
}
|
|
280
288
|
return require_buildHeaderGroups.buildHeaderGroups(allColumns, leafColumns, table, "center");
|
|
281
289
|
}
|
|
282
290
|
/**
|
|
283
|
-
* Builds footer groups for the
|
|
291
|
+
* Builds footer groups for the start pinned region.
|
|
284
292
|
*
|
|
285
|
-
* Footer groups reuse the
|
|
293
|
+
* Footer groups reuse the start header groups in reverse order.
|
|
286
294
|
*
|
|
287
295
|
* @example
|
|
288
296
|
* ```ts
|
|
289
|
-
* const footerGroups =
|
|
297
|
+
* const footerGroups = table_getStartFooterGroups(table)
|
|
290
298
|
* ```
|
|
291
299
|
*/
|
|
292
|
-
function
|
|
293
|
-
return [...require_utils.callMemoOrStaticFn(table, "
|
|
300
|
+
function table_getStartFooterGroups(table) {
|
|
301
|
+
return [...require_utils.callMemoOrStaticFn(table, "getStartHeaderGroups", table_getStartHeaderGroups)].reverse();
|
|
294
302
|
}
|
|
295
303
|
/**
|
|
296
|
-
* Builds footer groups for the
|
|
304
|
+
* Builds footer groups for the end pinned region.
|
|
297
305
|
*
|
|
298
|
-
* Footer groups reuse the
|
|
306
|
+
* Footer groups reuse the end header groups in reverse order.
|
|
299
307
|
*
|
|
300
308
|
* @example
|
|
301
309
|
* ```ts
|
|
302
|
-
* const footerGroups =
|
|
310
|
+
* const footerGroups = table_getEndFooterGroups(table)
|
|
303
311
|
* ```
|
|
304
312
|
*/
|
|
305
|
-
function
|
|
306
|
-
return [...require_utils.callMemoOrStaticFn(table, "
|
|
313
|
+
function table_getEndFooterGroups(table) {
|
|
314
|
+
return [...require_utils.callMemoOrStaticFn(table, "getEndHeaderGroups", table_getEndHeaderGroups)].reverse();
|
|
307
315
|
}
|
|
308
316
|
/**
|
|
309
317
|
* Builds footer groups for the center, unpinned region.
|
|
@@ -319,17 +327,17 @@ function table_getCenterFooterGroups(table) {
|
|
|
319
327
|
return [...require_utils.callMemoOrStaticFn(table, "getCenterHeaderGroups", table_getCenterHeaderGroups)].reverse();
|
|
320
328
|
}
|
|
321
329
|
/**
|
|
322
|
-
* Flattens every header from the
|
|
330
|
+
* Flattens every header from the start pinned header groups.
|
|
323
331
|
*
|
|
324
332
|
* Parent headers and placeholder headers are included.
|
|
325
333
|
*
|
|
326
334
|
* @example
|
|
327
335
|
* ```ts
|
|
328
|
-
* const headers =
|
|
336
|
+
* const headers = table_getStartFlatHeaders(table)
|
|
329
337
|
* ```
|
|
330
338
|
*/
|
|
331
|
-
function
|
|
332
|
-
const leftHeaderGroups = require_utils.callMemoOrStaticFn(table, "
|
|
339
|
+
function table_getStartFlatHeaders(table) {
|
|
340
|
+
const leftHeaderGroups = require_utils.callMemoOrStaticFn(table, "getStartHeaderGroups", table_getStartHeaderGroups);
|
|
333
341
|
const result = [];
|
|
334
342
|
for (let i = 0; i < leftHeaderGroups.length; i++) {
|
|
335
343
|
const headers = leftHeaderGroups[i].headers;
|
|
@@ -338,17 +346,17 @@ function table_getLeftFlatHeaders(table) {
|
|
|
338
346
|
return result;
|
|
339
347
|
}
|
|
340
348
|
/**
|
|
341
|
-
* Flattens every header from the
|
|
349
|
+
* Flattens every header from the end pinned header groups.
|
|
342
350
|
*
|
|
343
351
|
* Parent headers and placeholder headers are included.
|
|
344
352
|
*
|
|
345
353
|
* @example
|
|
346
354
|
* ```ts
|
|
347
|
-
* const headers =
|
|
355
|
+
* const headers = table_getEndFlatHeaders(table)
|
|
348
356
|
* ```
|
|
349
357
|
*/
|
|
350
|
-
function
|
|
351
|
-
const rightHeaderGroups = require_utils.callMemoOrStaticFn(table, "
|
|
358
|
+
function table_getEndFlatHeaders(table) {
|
|
359
|
+
const rightHeaderGroups = require_utils.callMemoOrStaticFn(table, "getEndHeaderGroups", table_getEndHeaderGroups);
|
|
352
360
|
const result = [];
|
|
353
361
|
for (let i = 0; i < rightHeaderGroups.length; i++) {
|
|
354
362
|
const headers = rightHeaderGroups[i].headers;
|
|
@@ -376,30 +384,30 @@ function table_getCenterFlatHeaders(table) {
|
|
|
376
384
|
return result;
|
|
377
385
|
}
|
|
378
386
|
/**
|
|
379
|
-
* Collects leaf headers for the
|
|
387
|
+
* Collects leaf headers for the start pinned region.
|
|
380
388
|
*
|
|
381
|
-
* Parent headers are filtered out from the
|
|
389
|
+
* Parent headers are filtered out from the start flat header list.
|
|
382
390
|
*
|
|
383
391
|
* @example
|
|
384
392
|
* ```ts
|
|
385
|
-
* const headers =
|
|
393
|
+
* const headers = table_getStartLeafHeaders(table)
|
|
386
394
|
* ```
|
|
387
395
|
*/
|
|
388
|
-
function
|
|
389
|
-
return require_utils.callMemoOrStaticFn(table, "
|
|
396
|
+
function table_getStartLeafHeaders(table) {
|
|
397
|
+
return require_utils.callMemoOrStaticFn(table, "getStartFlatHeaders", table_getStartFlatHeaders).filter((header) => !header.subHeaders.length);
|
|
390
398
|
}
|
|
391
399
|
/**
|
|
392
|
-
* Collects leaf headers for the
|
|
400
|
+
* Collects leaf headers for the end pinned region.
|
|
393
401
|
*
|
|
394
|
-
* Parent headers are filtered out from the
|
|
402
|
+
* Parent headers are filtered out from the end flat header list.
|
|
395
403
|
*
|
|
396
404
|
* @example
|
|
397
405
|
* ```ts
|
|
398
|
-
* const headers =
|
|
406
|
+
* const headers = table_getEndLeafHeaders(table)
|
|
399
407
|
* ```
|
|
400
408
|
*/
|
|
401
|
-
function
|
|
402
|
-
return require_utils.callMemoOrStaticFn(table, "
|
|
409
|
+
function table_getEndLeafHeaders(table) {
|
|
410
|
+
return require_utils.callMemoOrStaticFn(table, "getEndFlatHeaders", table_getEndFlatHeaders).filter((header) => !header.subHeaders.length);
|
|
403
411
|
}
|
|
404
412
|
/**
|
|
405
413
|
* Collects leaf headers for the center, unpinned region.
|
|
@@ -415,51 +423,51 @@ function table_getCenterLeafHeaders(table) {
|
|
|
415
423
|
return require_utils.callMemoOrStaticFn(table, "getCenterFlatHeaders", table_getCenterFlatHeaders).filter((header) => !header.subHeaders.length);
|
|
416
424
|
}
|
|
417
425
|
/**
|
|
418
|
-
* Resolves leaf columns pinned to the
|
|
426
|
+
* Resolves leaf columns pinned to the start region.
|
|
419
427
|
*
|
|
420
|
-
* The result follows `state.columnPinning.
|
|
428
|
+
* The result follows `state.columnPinning.start` order and skips stale ids that
|
|
421
429
|
* no longer correspond to a leaf column.
|
|
422
430
|
*
|
|
423
431
|
* @example
|
|
424
432
|
* ```ts
|
|
425
|
-
* const columns =
|
|
433
|
+
* const columns = table_getStartLeafColumns(table)
|
|
426
434
|
* ```
|
|
427
435
|
*/
|
|
428
|
-
function
|
|
429
|
-
const {
|
|
436
|
+
function table_getStartLeafColumns(table) {
|
|
437
|
+
const { start } = table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
|
|
430
438
|
const leafColumnsById = table.getAllLeafColumnsById();
|
|
431
439
|
const result = [];
|
|
432
|
-
for (let i = 0; i <
|
|
433
|
-
const column = leafColumnsById[
|
|
440
|
+
for (let i = 0; i < start.length; i++) {
|
|
441
|
+
const column = leafColumnsById[start[i]];
|
|
434
442
|
if (column) result.push(column);
|
|
435
443
|
}
|
|
436
444
|
return result;
|
|
437
445
|
}
|
|
438
446
|
/**
|
|
439
|
-
* Resolves leaf columns pinned to the
|
|
447
|
+
* Resolves leaf columns pinned to the end region.
|
|
440
448
|
*
|
|
441
|
-
* The result follows `state.columnPinning.
|
|
449
|
+
* The result follows `state.columnPinning.end` order and skips stale ids that
|
|
442
450
|
* no longer correspond to a leaf column.
|
|
443
451
|
*
|
|
444
452
|
* @example
|
|
445
453
|
* ```ts
|
|
446
|
-
* const columns =
|
|
454
|
+
* const columns = table_getEndLeafColumns(table)
|
|
447
455
|
* ```
|
|
448
456
|
*/
|
|
449
|
-
function
|
|
450
|
-
const {
|
|
457
|
+
function table_getEndLeafColumns(table) {
|
|
458
|
+
const { end } = table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
|
|
451
459
|
const leafColumnsById = table.getAllLeafColumnsById();
|
|
452
460
|
const result = [];
|
|
453
|
-
for (let i = 0; i <
|
|
454
|
-
const column = leafColumnsById[
|
|
461
|
+
for (let i = 0; i < end.length; i++) {
|
|
462
|
+
const column = leafColumnsById[end[i]];
|
|
455
463
|
if (column) result.push(column);
|
|
456
464
|
}
|
|
457
465
|
return result;
|
|
458
466
|
}
|
|
459
467
|
/**
|
|
460
|
-
* Resolves leaf columns that are not pinned to either side.
|
|
468
|
+
* Resolves leaf columns that are not pinned to either logical side.
|
|
461
469
|
*
|
|
462
|
-
*
|
|
470
|
+
* Start- and end-pinned ids are removed from `table.getAllLeafColumns()`.
|
|
463
471
|
*
|
|
464
472
|
* @example
|
|
465
473
|
* ```ts
|
|
@@ -467,15 +475,15 @@ function table_getRightLeafColumns(table) {
|
|
|
467
475
|
* ```
|
|
468
476
|
*/
|
|
469
477
|
function table_getCenterLeafColumns(table) {
|
|
470
|
-
const {
|
|
471
|
-
if (!
|
|
472
|
-
const
|
|
473
|
-
return table.getAllLeafColumns().filter((d) => !
|
|
478
|
+
const { start, end } = table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
|
|
479
|
+
if (!start.length && !end.length) return table.getAllLeafColumns();
|
|
480
|
+
const startAndEnd = [...start, ...end];
|
|
481
|
+
return table.getAllLeafColumns().filter((d) => !startAndEnd.includes(d.id));
|
|
474
482
|
}
|
|
475
483
|
/**
|
|
476
484
|
* Resolves leaf columns for a requested pinning region.
|
|
477
485
|
*
|
|
478
|
-
* Pass `'
|
|
486
|
+
* Pass `'start'`, `'center'`, or `'end'` for a partition, or pass `false` to
|
|
479
487
|
* read all leaf columns without partitioning.
|
|
480
488
|
*
|
|
481
489
|
* @example
|
|
@@ -484,33 +492,33 @@ function table_getCenterLeafColumns(table) {
|
|
|
484
492
|
* ```
|
|
485
493
|
*/
|
|
486
494
|
function table_getPinnedLeafColumns(table, position) {
|
|
487
|
-
return !position ? table.getAllLeafColumns() : position === "
|
|
495
|
+
return !position ? table.getAllLeafColumns() : position === "start" ? require_utils.callMemoOrStaticFn(table, "getStartLeafColumns", table_getStartLeafColumns) : position === "end" ? require_utils.callMemoOrStaticFn(table, "getEndLeafColumns", table_getEndLeafColumns) : require_utils.callMemoOrStaticFn(table, "getCenterLeafColumns", table_getCenterLeafColumns);
|
|
488
496
|
}
|
|
489
497
|
/**
|
|
490
|
-
* Resolves visible leaf columns pinned to the
|
|
498
|
+
* Resolves visible leaf columns pinned to the start region.
|
|
491
499
|
*
|
|
492
|
-
* Hidden pinned columns are filtered out after the
|
|
500
|
+
* Hidden pinned columns are filtered out after the start pin order is applied.
|
|
493
501
|
*
|
|
494
502
|
* @example
|
|
495
503
|
* ```ts
|
|
496
|
-
* const columns =
|
|
504
|
+
* const columns = table_getStartVisibleLeafColumns(table)
|
|
497
505
|
* ```
|
|
498
506
|
*/
|
|
499
|
-
function
|
|
500
|
-
return require_utils.callMemoOrStaticFn(table, "
|
|
507
|
+
function table_getStartVisibleLeafColumns(table) {
|
|
508
|
+
return require_utils.callMemoOrStaticFn(table, "getStartLeafColumns", table_getStartLeafColumns).filter((column) => require_utils.callMemoOrStaticFn(column, "getIsVisible", require_columnVisibilityFeature_utils.column_getIsVisible));
|
|
501
509
|
}
|
|
502
510
|
/**
|
|
503
|
-
* Resolves visible leaf columns pinned to the
|
|
511
|
+
* Resolves visible leaf columns pinned to the end region.
|
|
504
512
|
*
|
|
505
|
-
* Hidden pinned columns are filtered out after the
|
|
513
|
+
* Hidden pinned columns are filtered out after the end pin order is applied.
|
|
506
514
|
*
|
|
507
515
|
* @example
|
|
508
516
|
* ```ts
|
|
509
|
-
* const columns =
|
|
517
|
+
* const columns = table_getEndVisibleLeafColumns(table)
|
|
510
518
|
* ```
|
|
511
519
|
*/
|
|
512
|
-
function
|
|
513
|
-
return require_utils.callMemoOrStaticFn(table, "
|
|
520
|
+
function table_getEndVisibleLeafColumns(table) {
|
|
521
|
+
return require_utils.callMemoOrStaticFn(table, "getEndLeafColumns", table_getEndLeafColumns).filter((column) => require_utils.callMemoOrStaticFn(column, "getIsVisible", require_columnVisibilityFeature_utils.column_getIsVisible));
|
|
514
522
|
}
|
|
515
523
|
/**
|
|
516
524
|
* Resolves visible leaf columns that are not pinned.
|
|
@@ -529,16 +537,16 @@ function table_getCenterVisibleLeafColumns(table) {
|
|
|
529
537
|
/**
|
|
530
538
|
* Resolves visible leaf columns for a requested pinning region.
|
|
531
539
|
*
|
|
532
|
-
* Omit `position` to get all visible leaf columns, or pass `'
|
|
533
|
-
* or `'
|
|
540
|
+
* Omit `position` to get all visible leaf columns, or pass `'start'`, `'center'`,
|
|
541
|
+
* or `'end'` to get one partition.
|
|
534
542
|
*
|
|
535
543
|
* @example
|
|
536
544
|
* ```ts
|
|
537
|
-
* const columns = table_getPinnedVisibleLeafColumns(table, '
|
|
545
|
+
* const columns = table_getPinnedVisibleLeafColumns(table, 'start')
|
|
538
546
|
* ```
|
|
539
547
|
*/
|
|
540
548
|
function table_getPinnedVisibleLeafColumns(table, position) {
|
|
541
|
-
return !position ? require_utils.callMemoOrStaticFn(table, "getVisibleLeafColumns", require_columnVisibilityFeature_utils.table_getVisibleLeafColumns) : position === "
|
|
549
|
+
return !position ? require_utils.callMemoOrStaticFn(table, "getVisibleLeafColumns", require_columnVisibilityFeature_utils.table_getVisibleLeafColumns) : position === "start" ? require_utils.callMemoOrStaticFn(table, "getStartVisibleLeafColumns", table_getStartVisibleLeafColumns) : position === "end" ? require_utils.callMemoOrStaticFn(table, "getEndVisibleLeafColumns", table_getEndVisibleLeafColumns) : require_utils.callMemoOrStaticFn(table, "getCenterVisibleLeafColumns", table_getCenterVisibleLeafColumns);
|
|
542
550
|
}
|
|
543
551
|
|
|
544
552
|
//#endregion
|
|
@@ -548,29 +556,29 @@ exports.column_getPinnedIndex = column_getPinnedIndex;
|
|
|
548
556
|
exports.column_pin = column_pin;
|
|
549
557
|
exports.getDefaultColumnPinningState = getDefaultColumnPinningState;
|
|
550
558
|
exports.row_getCenterVisibleCells = row_getCenterVisibleCells;
|
|
551
|
-
exports.
|
|
552
|
-
exports.
|
|
559
|
+
exports.row_getEndVisibleCells = row_getEndVisibleCells;
|
|
560
|
+
exports.row_getStartVisibleCells = row_getStartVisibleCells;
|
|
553
561
|
exports.table_getCenterFlatHeaders = table_getCenterFlatHeaders;
|
|
554
562
|
exports.table_getCenterFooterGroups = table_getCenterFooterGroups;
|
|
555
563
|
exports.table_getCenterHeaderGroups = table_getCenterHeaderGroups;
|
|
556
564
|
exports.table_getCenterLeafColumns = table_getCenterLeafColumns;
|
|
557
565
|
exports.table_getCenterLeafHeaders = table_getCenterLeafHeaders;
|
|
558
566
|
exports.table_getCenterVisibleLeafColumns = table_getCenterVisibleLeafColumns;
|
|
567
|
+
exports.table_getEndFlatHeaders = table_getEndFlatHeaders;
|
|
568
|
+
exports.table_getEndFooterGroups = table_getEndFooterGroups;
|
|
569
|
+
exports.table_getEndHeaderGroups = table_getEndHeaderGroups;
|
|
570
|
+
exports.table_getEndLeafColumns = table_getEndLeafColumns;
|
|
571
|
+
exports.table_getEndLeafHeaders = table_getEndLeafHeaders;
|
|
572
|
+
exports.table_getEndVisibleLeafColumns = table_getEndVisibleLeafColumns;
|
|
559
573
|
exports.table_getIsSomeColumnsPinned = table_getIsSomeColumnsPinned;
|
|
560
|
-
exports.table_getLeftFlatHeaders = table_getLeftFlatHeaders;
|
|
561
|
-
exports.table_getLeftFooterGroups = table_getLeftFooterGroups;
|
|
562
|
-
exports.table_getLeftHeaderGroups = table_getLeftHeaderGroups;
|
|
563
|
-
exports.table_getLeftLeafColumns = table_getLeftLeafColumns;
|
|
564
|
-
exports.table_getLeftLeafHeaders = table_getLeftLeafHeaders;
|
|
565
|
-
exports.table_getLeftVisibleLeafColumns = table_getLeftVisibleLeafColumns;
|
|
566
574
|
exports.table_getPinnedLeafColumns = table_getPinnedLeafColumns;
|
|
567
575
|
exports.table_getPinnedVisibleLeafColumns = table_getPinnedVisibleLeafColumns;
|
|
568
|
-
exports.
|
|
569
|
-
exports.
|
|
570
|
-
exports.
|
|
571
|
-
exports.
|
|
572
|
-
exports.
|
|
573
|
-
exports.
|
|
576
|
+
exports.table_getStartFlatHeaders = table_getStartFlatHeaders;
|
|
577
|
+
exports.table_getStartFooterGroups = table_getStartFooterGroups;
|
|
578
|
+
exports.table_getStartHeaderGroups = table_getStartHeaderGroups;
|
|
579
|
+
exports.table_getStartLeafColumns = table_getStartLeafColumns;
|
|
580
|
+
exports.table_getStartLeafHeaders = table_getStartLeafHeaders;
|
|
581
|
+
exports.table_getStartVisibleLeafColumns = table_getStartVisibleLeafColumns;
|
|
574
582
|
exports.table_resetColumnPinning = table_resetColumnPinning;
|
|
575
583
|
exports.table_setColumnPinning = table_setColumnPinning;
|
|
576
584
|
//# sourceMappingURL=columnPinningFeature.utils.cjs.map
|