@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.
Files changed (100) hide show
  1. package/README.md +1 -0
  2. package/dist/core/headers/buildHeaderGroups.cjs.map +1 -1
  3. package/dist/core/headers/buildHeaderGroups.d.cts +1 -1
  4. package/dist/core/headers/buildHeaderGroups.d.ts +1 -1
  5. package/dist/core/headers/buildHeaderGroups.js.map +1 -1
  6. package/dist/core/headers/coreHeadersFeature.utils.cjs +7 -7
  7. package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
  8. package/dist/core/headers/coreHeadersFeature.utils.js +7 -7
  9. package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
  10. package/dist/core/table/coreTablesFeature.utils.cjs +1 -1
  11. package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
  12. package/dist/core/table/coreTablesFeature.utils.js +1 -1
  13. package/dist/core/table/coreTablesFeature.utils.js.map +1 -1
  14. package/dist/features/column-ordering/columnOrderingFeature.types.d.cts +5 -5
  15. package/dist/features/column-ordering/columnOrderingFeature.types.d.ts +5 -5
  16. package/dist/features/column-ordering/columnOrderingFeature.utils.cjs +6 -6
  17. package/dist/features/column-ordering/columnOrderingFeature.utils.cjs.map +1 -1
  18. package/dist/features/column-ordering/columnOrderingFeature.utils.d.cts +3 -3
  19. package/dist/features/column-ordering/columnOrderingFeature.utils.d.ts +3 -3
  20. package/dist/features/column-ordering/columnOrderingFeature.utils.js +6 -6
  21. package/dist/features/column-ordering/columnOrderingFeature.utils.js.map +1 -1
  22. package/dist/features/column-pinning/columnPinningFeature.cjs +44 -39
  23. package/dist/features/column-pinning/columnPinningFeature.cjs.map +1 -1
  24. package/dist/features/column-pinning/columnPinningFeature.d.cts +6 -1
  25. package/dist/features/column-pinning/columnPinningFeature.d.ts +6 -1
  26. package/dist/features/column-pinning/columnPinningFeature.js +45 -40
  27. package/dist/features/column-pinning/columnPinningFeature.js.map +1 -1
  28. package/dist/features/column-pinning/columnPinningFeature.types.d.cts +49 -38
  29. package/dist/features/column-pinning/columnPinningFeature.types.d.ts +49 -38
  30. package/dist/features/column-pinning/columnPinningFeature.utils.cjs +154 -146
  31. package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
  32. package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +81 -73
  33. package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +81 -73
  34. package/dist/features/column-pinning/columnPinningFeature.utils.js +141 -133
  35. package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
  36. package/dist/features/column-sizing/columnSizingFeature.cjs +4 -4
  37. package/dist/features/column-sizing/columnSizingFeature.cjs.map +1 -1
  38. package/dist/features/column-sizing/columnSizingFeature.js +5 -5
  39. package/dist/features/column-sizing/columnSizingFeature.js.map +1 -1
  40. package/dist/features/column-sizing/columnSizingFeature.types.d.cts +18 -12
  41. package/dist/features/column-sizing/columnSizingFeature.types.d.ts +18 -12
  42. package/dist/features/column-sizing/columnSizingFeature.utils.cjs +24 -20
  43. package/dist/features/column-sizing/columnSizingFeature.utils.cjs.map +1 -1
  44. package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +18 -14
  45. package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +18 -14
  46. package/dist/features/column-sizing/columnSizingFeature.utils.js +24 -20
  47. package/dist/features/column-sizing/columnSizingFeature.utils.js.map +1 -1
  48. package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs +16 -16
  49. package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs.map +1 -1
  50. package/dist/features/column-visibility/columnVisibilityFeature.utils.d.cts +3 -3
  51. package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +3 -3
  52. package/dist/features/column-visibility/columnVisibilityFeature.utils.js +16 -16
  53. package/dist/features/column-visibility/columnVisibilityFeature.utils.js.map +1 -1
  54. package/dist/static-functions.cjs +16 -16
  55. package/dist/static-functions.d.cts +3 -3
  56. package/dist/static-functions.d.ts +3 -3
  57. package/dist/static-functions.js +3 -3
  58. package/package.json +1 -1
  59. package/skills/api-not-found/SKILL.md +113 -0
  60. package/skills/client-vs-server/SKILL.md +164 -0
  61. package/skills/column-faceting/SKILL.md +91 -0
  62. package/skills/column-filtering/SKILL.md +82 -0
  63. package/skills/column-ordering/SKILL.md +75 -0
  64. package/skills/column-pinning/SKILL.md +89 -0
  65. package/skills/column-resizing/SKILL.md +91 -0
  66. package/skills/column-sizing/SKILL.md +72 -0
  67. package/skills/column-visibility/SKILL.md +75 -0
  68. package/skills/core/SKILL.md +140 -0
  69. package/skills/custom-features/SKILL.md +207 -0
  70. package/skills/expanding/SKILL.md +80 -0
  71. package/skills/global-filtering/SKILL.md +84 -0
  72. package/skills/grouping/SKILL.md +50 -394
  73. package/skills/migrate-v8-to-v9/SKILL.md +230 -390
  74. package/skills/pagination/SKILL.md +35 -344
  75. package/skills/row-pinning/SKILL.md +47 -238
  76. package/skills/row-selection/SKILL.md +39 -351
  77. package/skills/sorting/SKILL.md +35 -299
  78. package/skills/table-features/SKILL.md +153 -0
  79. package/skills/typescript/SKILL.md +126 -0
  80. package/src/core/headers/buildHeaderGroups.ts +1 -1
  81. package/src/core/headers/coreHeadersFeature.utils.ts +7 -7
  82. package/src/core/table/coreTablesFeature.utils.ts +1 -1
  83. package/src/features/column-ordering/columnOrderingFeature.types.ts +5 -5
  84. package/src/features/column-ordering/columnOrderingFeature.utils.ts +9 -9
  85. package/src/features/column-pinning/columnPinningFeature.ts +64 -59
  86. package/src/features/column-pinning/columnPinningFeature.types.ts +49 -38
  87. package/src/features/column-pinning/columnPinningFeature.utils.ts +163 -155
  88. package/src/features/column-sizing/columnSizingFeature.ts +6 -6
  89. package/src/features/column-sizing/columnSizingFeature.types.ts +18 -12
  90. package/src/features/column-sizing/columnSizingFeature.utils.ts +31 -27
  91. package/src/features/column-visibility/columnVisibilityFeature.utils.ts +15 -15
  92. package/skills/column-definitions/SKILL.md +0 -330
  93. package/skills/column-layout/SKILL.md +0 -326
  94. package/skills/column-layout/references/subsystems.md +0 -220
  95. package/skills/customizing-feature-behavior/SKILL.md +0 -423
  96. package/skills/filtering/SKILL.md +0 -375
  97. package/skills/filtering/references/faceting-and-fuzzy.md +0 -218
  98. package/skills/row-expanding/SKILL.md +0 -356
  99. package/skills/setup/SKILL.md +0 -390
  100. 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
- left: [],
20
- right: []
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 `'left'` or `'right'`
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, 'left')
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 === "right") return {
44
- left: old.left.filter((d) => !columnIds.includes(d)),
45
- right: [...old.right.filter((d) => !columnIds.includes(d)), ...columnIds]
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 === "left") return {
48
- left: [...old.left.filter((d) => !columnIds.includes(d)), ...columnIds],
49
- right: old.right.filter((d) => !columnIds.includes(d))
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
- left: old.left.filter((d) => !columnIds.includes(d)),
53
- right: old.right.filter((d) => !columnIds.includes(d))
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 `'left'` or `'right'` when any leaf column is pinned in
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 { left, right } = column.table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
85
- for (let i = 0; i < leafColumns.length; i++) if (left.includes(leafColumns[i].id)) return "left";
86
- for (let i = 0; i < leafColumns.length; i++) if (right.includes(leafColumns[i].id)) return "right";
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.left` or `state.columnPinning.right`.
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 left or right.
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 { left, right } = row.table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
117
- if (!left.length && !right.length) return allCells;
118
- const leftAndRight = [...left, ...right];
119
- return allCells.filter((d) => !leftAndRight.includes(d.column.id));
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 left region.
130
+ * Collects visible cells for columns pinned to the start region.
123
131
  *
124
- * Cells are returned in `state.columnPinning.left` order and are marked with
125
- * `cell.position = 'left'`.
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 leftCells = row_getLeftVisibleCells(row)
137
+ * const startCells = row_getStartVisibleCells(row)
130
138
  * ```
131
139
  */
132
- function row_getLeftVisibleCells(row) {
133
- const { left } = row.table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
134
- if (!left.length) return [];
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 < left.length; i++) {
138
- const cell = allVisibleCells[left[i]];
145
+ for (let i = 0; i < start.length; i++) {
146
+ const cell = allVisibleCells[start[i]];
139
147
  if (cell) {
140
- cell.position = "left";
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 right region.
155
+ * Collects visible cells for columns pinned to the end region.
148
156
  *
149
- * Cells are returned in `state.columnPinning.right` order and are marked with
150
- * `cell.position = 'right'`.
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 rightCells = row_getRightVisibleCells(row)
162
+ * const endCells = row_getEndVisibleCells(row)
155
163
  * ```
156
164
  */
157
- function row_getRightVisibleCells(row) {
158
- const { right } = row.table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
159
- if (!right.length) return [];
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 < right.length; i++) {
163
- const cell = allVisibleCells[right[i]];
170
+ for (let i = 0; i < end.length; i++) {
171
+ const cell = allVisibleCells[end[i]];
164
172
  if (cell) {
165
- cell.position = "right";
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 `{ left, right }` state or a function of the
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, left: ['select'] }))
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 left/right
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 `'left'`/`'right'` to inspect a
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?.left.length || pinningState?.right.length);
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 left region.
226
+ * Builds header groups for visible columns pinned to the start region.
219
227
  *
220
- * The leaf columns are read in `state.columnPinning.left` order and then passed
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 = table_getLeftHeaderGroups(table)
233
+ * const headerGroups = table_getStartHeaderGroups(table)
226
234
  * ```
227
235
  */
228
- function table_getLeftHeaderGroups(table) {
236
+ function table_getStartHeaderGroups(table) {
229
237
  const allColumns = table.getAllColumns();
230
238
  const leafColumnsById = table.getAllLeafColumnsById();
231
- const { left } = table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
239
+ const { start } = table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
232
240
  const orderedLeafColumns = [];
233
- for (let i = 0; i < left.length; i++) {
234
- const column = leafColumnsById[left[i]];
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, "left");
245
+ return require_buildHeaderGroups.buildHeaderGroups(allColumns, orderedLeafColumns, table, "start");
238
246
  }
239
247
  /**
240
- * Builds header groups for visible columns pinned to the right region.
248
+ * Builds header groups for visible columns pinned to the end region.
241
249
  *
242
- * The leaf columns are read in `state.columnPinning.right` order and then
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 = table_getRightHeaderGroups(table)
255
+ * const headerGroups = table_getEndHeaderGroups(table)
248
256
  * ```
249
257
  */
250
- function table_getRightHeaderGroups(table) {
258
+ function table_getEndHeaderGroups(table) {
251
259
  const allColumns = table.getAllColumns();
252
260
  const leafColumnsById = table.getAllLeafColumnsById();
253
- const { right } = table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
261
+ const { end } = table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
254
262
  const orderedLeafColumns = [];
255
- for (let i = 0; i < right.length; i++) {
256
- const column = leafColumnsById[right[i]];
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, "right");
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
- * Left- and right-pinned column ids are removed from the visible leaf column
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 { left, right } = table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
276
- if (left.length || right.length) {
277
- const leftAndRight = [...left, ...right];
278
- leafColumns = leafColumns.filter((column) => !leftAndRight.includes(column.id));
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 left pinned region.
291
+ * Builds footer groups for the start pinned region.
284
292
  *
285
- * Footer groups reuse the left header groups in reverse order.
293
+ * Footer groups reuse the start header groups in reverse order.
286
294
  *
287
295
  * @example
288
296
  * ```ts
289
- * const footerGroups = table_getLeftFooterGroups(table)
297
+ * const footerGroups = table_getStartFooterGroups(table)
290
298
  * ```
291
299
  */
292
- function table_getLeftFooterGroups(table) {
293
- return [...require_utils.callMemoOrStaticFn(table, "getLeftHeaderGroups", table_getLeftHeaderGroups)].reverse();
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 right pinned region.
304
+ * Builds footer groups for the end pinned region.
297
305
  *
298
- * Footer groups reuse the right header groups in reverse order.
306
+ * Footer groups reuse the end header groups in reverse order.
299
307
  *
300
308
  * @example
301
309
  * ```ts
302
- * const footerGroups = table_getRightFooterGroups(table)
310
+ * const footerGroups = table_getEndFooterGroups(table)
303
311
  * ```
304
312
  */
305
- function table_getRightFooterGroups(table) {
306
- return [...require_utils.callMemoOrStaticFn(table, "getRightHeaderGroups", table_getRightHeaderGroups)].reverse();
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 left pinned header groups.
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 = table_getLeftFlatHeaders(table)
336
+ * const headers = table_getStartFlatHeaders(table)
329
337
  * ```
330
338
  */
331
- function table_getLeftFlatHeaders(table) {
332
- const leftHeaderGroups = require_utils.callMemoOrStaticFn(table, "getLeftHeaderGroups", table_getLeftHeaderGroups);
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 right pinned header groups.
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 = table_getRightFlatHeaders(table)
355
+ * const headers = table_getEndFlatHeaders(table)
348
356
  * ```
349
357
  */
350
- function table_getRightFlatHeaders(table) {
351
- const rightHeaderGroups = require_utils.callMemoOrStaticFn(table, "getRightHeaderGroups", table_getRightHeaderGroups);
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 left pinned region.
387
+ * Collects leaf headers for the start pinned region.
380
388
  *
381
- * Parent headers are filtered out from the left flat header list.
389
+ * Parent headers are filtered out from the start flat header list.
382
390
  *
383
391
  * @example
384
392
  * ```ts
385
- * const headers = table_getLeftLeafHeaders(table)
393
+ * const headers = table_getStartLeafHeaders(table)
386
394
  * ```
387
395
  */
388
- function table_getLeftLeafHeaders(table) {
389
- return require_utils.callMemoOrStaticFn(table, "getLeftFlatHeaders", table_getLeftFlatHeaders).filter((header) => !header.subHeaders.length);
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 right pinned region.
400
+ * Collects leaf headers for the end pinned region.
393
401
  *
394
- * Parent headers are filtered out from the right flat header list.
402
+ * Parent headers are filtered out from the end flat header list.
395
403
  *
396
404
  * @example
397
405
  * ```ts
398
- * const headers = table_getRightLeafHeaders(table)
406
+ * const headers = table_getEndLeafHeaders(table)
399
407
  * ```
400
408
  */
401
- function table_getRightLeafHeaders(table) {
402
- return require_utils.callMemoOrStaticFn(table, "getRightFlatHeaders", table_getRightFlatHeaders).filter((header) => !header.subHeaders.length);
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 left region.
426
+ * Resolves leaf columns pinned to the start region.
419
427
  *
420
- * The result follows `state.columnPinning.left` order and skips stale ids that
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 = table_getLeftLeafColumns(table)
433
+ * const columns = table_getStartLeafColumns(table)
426
434
  * ```
427
435
  */
428
- function table_getLeftLeafColumns(table) {
429
- const { left } = table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
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 < left.length; i++) {
433
- const column = leafColumnsById[left[i]];
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 right region.
447
+ * Resolves leaf columns pinned to the end region.
440
448
  *
441
- * The result follows `state.columnPinning.right` order and skips stale ids that
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 = table_getRightLeafColumns(table)
454
+ * const columns = table_getEndLeafColumns(table)
447
455
  * ```
448
456
  */
449
- function table_getRightLeafColumns(table) {
450
- const { right } = table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
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 < right.length; i++) {
454
- const column = leafColumnsById[right[i]];
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
- * Left- and right-pinned ids are removed from `table.getAllLeafColumns()`.
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 { left, right } = table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
471
- if (!left.length && !right.length) return table.getAllLeafColumns();
472
- const leftAndRight = [...left, ...right];
473
- return table.getAllLeafColumns().filter((d) => !leftAndRight.includes(d.id));
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 `'left'`, `'center'`, or `'right'` for a partition, or pass `false` to
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 === "left" ? require_utils.callMemoOrStaticFn(table, "getLeftLeafColumns", table_getLeftLeafColumns) : position === "right" ? require_utils.callMemoOrStaticFn(table, "getRightLeafColumns", table_getRightLeafColumns) : require_utils.callMemoOrStaticFn(table, "getCenterLeafColumns", table_getCenterLeafColumns);
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 left region.
498
+ * Resolves visible leaf columns pinned to the start region.
491
499
  *
492
- * Hidden pinned columns are filtered out after the left pin order is applied.
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 = table_getLeftVisibleLeafColumns(table)
504
+ * const columns = table_getStartVisibleLeafColumns(table)
497
505
  * ```
498
506
  */
499
- function table_getLeftVisibleLeafColumns(table) {
500
- return require_utils.callMemoOrStaticFn(table, "getLeftLeafColumns", table_getLeftLeafColumns).filter((column) => require_utils.callMemoOrStaticFn(column, "getIsVisible", require_columnVisibilityFeature_utils.column_getIsVisible));
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 right region.
511
+ * Resolves visible leaf columns pinned to the end region.
504
512
  *
505
- * Hidden pinned columns are filtered out after the right pin order is applied.
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 = table_getRightVisibleLeafColumns(table)
517
+ * const columns = table_getEndVisibleLeafColumns(table)
510
518
  * ```
511
519
  */
512
- function table_getRightVisibleLeafColumns(table) {
513
- return require_utils.callMemoOrStaticFn(table, "getRightLeafColumns", table_getRightLeafColumns).filter((column) => require_utils.callMemoOrStaticFn(column, "getIsVisible", require_columnVisibilityFeature_utils.column_getIsVisible));
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 `'left'`, `'center'`,
533
- * or `'right'` to get one partition.
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, 'left')
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 === "left" ? require_utils.callMemoOrStaticFn(table, "getLeftVisibleLeafColumns", table_getLeftVisibleLeafColumns) : position === "right" ? require_utils.callMemoOrStaticFn(table, "getRightVisibleLeafColumns", table_getRightVisibleLeafColumns) : require_utils.callMemoOrStaticFn(table, "getCenterVisibleLeafColumns", table_getCenterVisibleLeafColumns);
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.row_getLeftVisibleCells = row_getLeftVisibleCells;
552
- exports.row_getRightVisibleCells = row_getRightVisibleCells;
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.table_getRightFlatHeaders = table_getRightFlatHeaders;
569
- exports.table_getRightFooterGroups = table_getRightFooterGroups;
570
- exports.table_getRightHeaderGroups = table_getRightHeaderGroups;
571
- exports.table_getRightLeafColumns = table_getRightLeafColumns;
572
- exports.table_getRightLeafHeaders = table_getRightLeafHeaders;
573
- exports.table_getRightVisibleLeafColumns = table_getRightVisibleLeafColumns;
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