@tanstack/table-core 8.9.7 → 8.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/core/cell.js +1 -1
- package/build/lib/core/cell.js.map +1 -1
- package/build/lib/core/column.js +3 -3
- package/build/lib/core/column.js.map +1 -1
- package/build/lib/core/headers.js +182 -181
- package/build/lib/core/headers.js.map +1 -1
- package/build/lib/core/row.js +1 -1
- package/build/lib/core/row.js.map +1 -1
- package/build/lib/core/table.js +4 -3
- package/build/lib/core/table.js.map +1 -1
- package/build/lib/features/ColumnSizing.js +173 -179
- package/build/lib/features/ColumnSizing.js.map +1 -1
- package/build/lib/features/Expanding.js +119 -123
- package/build/lib/features/Expanding.js.map +1 -1
- package/build/lib/features/Filters.js +157 -165
- package/build/lib/features/Filters.js.map +1 -1
- package/build/lib/features/Grouping.js +71 -79
- package/build/lib/features/Grouping.js.map +1 -1
- package/build/lib/features/Ordering.js +32 -34
- package/build/lib/features/Ordering.js.map +1 -1
- package/build/lib/features/Pagination.js +112 -114
- package/build/lib/features/Pagination.js.map +1 -1
- package/build/lib/features/Pinning.js +120 -126
- package/build/lib/features/Pinning.js.map +1 -1
- package/build/lib/features/RowSelection.js +245 -247
- package/build/lib/features/RowSelection.js.map +1 -1
- package/build/lib/features/Sorting.js +163 -167
- package/build/lib/features/Sorting.js.map +1 -1
- package/build/lib/features/Visibility.js +60 -66
- package/build/lib/features/Visibility.js.map +1 -1
- package/build/lib/index.esm.js +1469 -1515
- package/build/lib/index.esm.js.map +1 -1
- package/build/lib/index.mjs +1469 -1515
- package/build/lib/index.mjs.map +1 -1
- package/build/lib/utils.d.ts +2 -2
- package/build/lib/utils.js.map +1 -1
- package/build/umd/index.development.js +1469 -1515
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/core/cell.ts +5 -8
- package/src/core/column.ts +3 -3
- package/src/core/headers.ts +264 -280
- package/src/core/row.ts +1 -1
- package/src/core/table.ts +4 -3
- package/src/features/ColumnSizing.ts +220 -231
- package/src/features/Expanding.ts +132 -140
- package/src/features/Filters.ts +193 -206
- package/src/features/Grouping.ts +94 -110
- package/src/features/Ordering.ts +48 -51
- package/src/features/Pagination.ts +150 -154
- package/src/features/Pinning.ts +158 -178
- package/src/features/RowSelection.ts +280 -286
- package/src/features/Sorting.ts +196 -206
- package/src/features/Visibility.ts +98 -107
- package/src/utils.ts +11 -5
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/table-core",
|
|
3
3
|
"author": "Tanner Linsley",
|
|
4
|
-
"version": "8.9.
|
|
4
|
+
"version": "8.9.9",
|
|
5
5
|
"description": "Headless UI for building powerful tables & datagrids for TS/JS.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/tanstack/table#readme",
|
package/src/core/cell.ts
CHANGED
|
@@ -52,14 +52,11 @@ export function createCell<TData extends RowData, TValue>(
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
table._features.forEach(feature => {
|
|
55
|
-
|
|
56
|
-
cell,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
row as Row<TData>,
|
|
61
|
-
table
|
|
62
|
-
)
|
|
55
|
+
feature.createCell?.(
|
|
56
|
+
cell as Cell<TData, TValue>,
|
|
57
|
+
column,
|
|
58
|
+
row as Row<TData>,
|
|
59
|
+
table
|
|
63
60
|
)
|
|
64
61
|
}, {})
|
|
65
62
|
|
package/src/core/column.ts
CHANGED
|
@@ -119,9 +119,9 @@ export function createColumn<TData extends RowData, TValue>(
|
|
|
119
119
|
),
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
122
|
+
for (const feature of table._features) {
|
|
123
|
+
feature.createColumn?.(column, table)
|
|
124
|
+
}
|
|
125
125
|
|
|
126
126
|
// Yes, we have to convert table to uknown, because we know more than the compiler here.
|
|
127
127
|
return column as Column<TData, TValue>
|
package/src/core/headers.ts
CHANGED
|
@@ -99,292 +99,276 @@ function createHeader<TData extends RowData, TValue>(
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
table._features.forEach(feature => {
|
|
102
|
-
|
|
102
|
+
feature.createHeader?.(header, table)
|
|
103
103
|
})
|
|
104
104
|
|
|
105
105
|
return header as Header<TData, TValue>
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
export const Headers: TableFeature = {
|
|
109
|
-
createTable: <TData extends RowData>(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
()
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
)
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
()
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
),
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
),
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
return [
|
|
373
|
-
...(left[0]?.headers ?? []),
|
|
374
|
-
...(center[0]?.headers ?? []),
|
|
375
|
-
...(right[0]?.headers ?? []),
|
|
376
|
-
]
|
|
377
|
-
.map(header => {
|
|
378
|
-
return header.getLeafHeaders()
|
|
379
|
-
})
|
|
380
|
-
.flat()
|
|
381
|
-
},
|
|
382
|
-
{
|
|
383
|
-
key: process.env.NODE_ENV === 'development' && 'getLeafHeaders',
|
|
384
|
-
debug: () => table.options.debugAll ?? table.options.debugHeaders,
|
|
385
|
-
}
|
|
386
|
-
),
|
|
387
|
-
}
|
|
109
|
+
createTable: <TData extends RowData>(table: Table<TData>): void => {
|
|
110
|
+
// Header Groups
|
|
111
|
+
|
|
112
|
+
table.getHeaderGroups = memo(
|
|
113
|
+
() => [
|
|
114
|
+
table.getAllColumns(),
|
|
115
|
+
table.getVisibleLeafColumns(),
|
|
116
|
+
table.getState().columnPinning.left,
|
|
117
|
+
table.getState().columnPinning.right,
|
|
118
|
+
],
|
|
119
|
+
(allColumns, leafColumns, left, right) => {
|
|
120
|
+
const leftColumns =
|
|
121
|
+
left
|
|
122
|
+
?.map(columnId => leafColumns.find(d => d.id === columnId)!)
|
|
123
|
+
.filter(Boolean) ?? []
|
|
124
|
+
|
|
125
|
+
const rightColumns =
|
|
126
|
+
right
|
|
127
|
+
?.map(columnId => leafColumns.find(d => d.id === columnId)!)
|
|
128
|
+
.filter(Boolean) ?? []
|
|
129
|
+
|
|
130
|
+
const centerColumns = leafColumns.filter(
|
|
131
|
+
column => !left?.includes(column.id) && !right?.includes(column.id)
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
const headerGroups = buildHeaderGroups(
|
|
135
|
+
allColumns,
|
|
136
|
+
[...leftColumns, ...centerColumns, ...rightColumns],
|
|
137
|
+
table
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
return headerGroups
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
key: process.env.NODE_ENV === 'development' && 'getHeaderGroups',
|
|
144
|
+
debug: () => table.options.debugAll ?? table.options.debugHeaders,
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
table.getCenterHeaderGroups = memo(
|
|
149
|
+
() => [
|
|
150
|
+
table.getAllColumns(),
|
|
151
|
+
table.getVisibleLeafColumns(),
|
|
152
|
+
table.getState().columnPinning.left,
|
|
153
|
+
table.getState().columnPinning.right,
|
|
154
|
+
],
|
|
155
|
+
(allColumns, leafColumns, left, right) => {
|
|
156
|
+
leafColumns = leafColumns.filter(
|
|
157
|
+
column => !left?.includes(column.id) && !right?.includes(column.id)
|
|
158
|
+
)
|
|
159
|
+
return buildHeaderGroups(allColumns, leafColumns, table, 'center')
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
key: process.env.NODE_ENV === 'development' && 'getCenterHeaderGroups',
|
|
163
|
+
debug: () => table.options.debugAll ?? table.options.debugHeaders,
|
|
164
|
+
}
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
table.getLeftHeaderGroups = memo(
|
|
168
|
+
() => [
|
|
169
|
+
table.getAllColumns(),
|
|
170
|
+
table.getVisibleLeafColumns(),
|
|
171
|
+
table.getState().columnPinning.left,
|
|
172
|
+
],
|
|
173
|
+
(allColumns, leafColumns, left) => {
|
|
174
|
+
const orderedLeafColumns =
|
|
175
|
+
left
|
|
176
|
+
?.map(columnId => leafColumns.find(d => d.id === columnId)!)
|
|
177
|
+
.filter(Boolean) ?? []
|
|
178
|
+
|
|
179
|
+
return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'left')
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
key: process.env.NODE_ENV === 'development' && 'getLeftHeaderGroups',
|
|
183
|
+
debug: () => table.options.debugAll ?? table.options.debugHeaders,
|
|
184
|
+
}
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
table.getRightHeaderGroups = memo(
|
|
188
|
+
() => [
|
|
189
|
+
table.getAllColumns(),
|
|
190
|
+
table.getVisibleLeafColumns(),
|
|
191
|
+
table.getState().columnPinning.right,
|
|
192
|
+
],
|
|
193
|
+
(allColumns, leafColumns, right) => {
|
|
194
|
+
const orderedLeafColumns =
|
|
195
|
+
right
|
|
196
|
+
?.map(columnId => leafColumns.find(d => d.id === columnId)!)
|
|
197
|
+
.filter(Boolean) ?? []
|
|
198
|
+
|
|
199
|
+
return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'right')
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
key: process.env.NODE_ENV === 'development' && 'getRightHeaderGroups',
|
|
203
|
+
debug: () => table.options.debugAll ?? table.options.debugHeaders,
|
|
204
|
+
}
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
// Footer Groups
|
|
208
|
+
|
|
209
|
+
table.getFooterGroups = memo(
|
|
210
|
+
() => [table.getHeaderGroups()],
|
|
211
|
+
headerGroups => {
|
|
212
|
+
return [...headerGroups].reverse()
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
key: process.env.NODE_ENV === 'development' && 'getFooterGroups',
|
|
216
|
+
debug: () => table.options.debugAll ?? table.options.debugHeaders,
|
|
217
|
+
}
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
table.getLeftFooterGroups = memo(
|
|
221
|
+
() => [table.getLeftHeaderGroups()],
|
|
222
|
+
headerGroups => {
|
|
223
|
+
return [...headerGroups].reverse()
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
key: process.env.NODE_ENV === 'development' && 'getLeftFooterGroups',
|
|
227
|
+
debug: () => table.options.debugAll ?? table.options.debugHeaders,
|
|
228
|
+
}
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
table.getCenterFooterGroups = memo(
|
|
232
|
+
() => [table.getCenterHeaderGroups()],
|
|
233
|
+
headerGroups => {
|
|
234
|
+
return [...headerGroups].reverse()
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
key: process.env.NODE_ENV === 'development' && 'getCenterFooterGroups',
|
|
238
|
+
debug: () => table.options.debugAll ?? table.options.debugHeaders,
|
|
239
|
+
}
|
|
240
|
+
)
|
|
241
|
+
|
|
242
|
+
table.getRightFooterGroups = memo(
|
|
243
|
+
() => [table.getRightHeaderGroups()],
|
|
244
|
+
headerGroups => {
|
|
245
|
+
return [...headerGroups].reverse()
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
key: process.env.NODE_ENV === 'development' && 'getRightFooterGroups',
|
|
249
|
+
debug: () => table.options.debugAll ?? table.options.debugHeaders,
|
|
250
|
+
}
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
// Flat Headers
|
|
254
|
+
|
|
255
|
+
table.getFlatHeaders = memo(
|
|
256
|
+
() => [table.getHeaderGroups()],
|
|
257
|
+
headerGroups => {
|
|
258
|
+
return headerGroups
|
|
259
|
+
.map(headerGroup => {
|
|
260
|
+
return headerGroup.headers
|
|
261
|
+
})
|
|
262
|
+
.flat()
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
key: process.env.NODE_ENV === 'development' && 'getFlatHeaders',
|
|
266
|
+
debug: () => table.options.debugAll ?? table.options.debugHeaders,
|
|
267
|
+
}
|
|
268
|
+
)
|
|
269
|
+
|
|
270
|
+
table.getLeftFlatHeaders = memo(
|
|
271
|
+
() => [table.getLeftHeaderGroups()],
|
|
272
|
+
left => {
|
|
273
|
+
return left
|
|
274
|
+
.map(headerGroup => {
|
|
275
|
+
return headerGroup.headers
|
|
276
|
+
})
|
|
277
|
+
.flat()
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
key: process.env.NODE_ENV === 'development' && 'getLeftFlatHeaders',
|
|
281
|
+
debug: () => table.options.debugAll ?? table.options.debugHeaders,
|
|
282
|
+
}
|
|
283
|
+
)
|
|
284
|
+
|
|
285
|
+
table.getCenterFlatHeaders = memo(
|
|
286
|
+
() => [table.getCenterHeaderGroups()],
|
|
287
|
+
left => {
|
|
288
|
+
return left
|
|
289
|
+
.map(headerGroup => {
|
|
290
|
+
return headerGroup.headers
|
|
291
|
+
})
|
|
292
|
+
.flat()
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
key: process.env.NODE_ENV === 'development' && 'getCenterFlatHeaders',
|
|
296
|
+
debug: () => table.options.debugAll ?? table.options.debugHeaders,
|
|
297
|
+
}
|
|
298
|
+
)
|
|
299
|
+
|
|
300
|
+
table.getRightFlatHeaders = memo(
|
|
301
|
+
() => [table.getRightHeaderGroups()],
|
|
302
|
+
left => {
|
|
303
|
+
return left
|
|
304
|
+
.map(headerGroup => {
|
|
305
|
+
return headerGroup.headers
|
|
306
|
+
})
|
|
307
|
+
.flat()
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
key: process.env.NODE_ENV === 'development' && 'getRightFlatHeaders',
|
|
311
|
+
debug: () => table.options.debugAll ?? table.options.debugHeaders,
|
|
312
|
+
}
|
|
313
|
+
)
|
|
314
|
+
|
|
315
|
+
// Leaf Headers
|
|
316
|
+
|
|
317
|
+
table.getCenterLeafHeaders = memo(
|
|
318
|
+
() => [table.getCenterFlatHeaders()],
|
|
319
|
+
flatHeaders => {
|
|
320
|
+
return flatHeaders.filter(header => !header.subHeaders?.length)
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
key: process.env.NODE_ENV === 'development' && 'getCenterLeafHeaders',
|
|
324
|
+
debug: () => table.options.debugAll ?? table.options.debugHeaders,
|
|
325
|
+
}
|
|
326
|
+
)
|
|
327
|
+
|
|
328
|
+
table.getLeftLeafHeaders = memo(
|
|
329
|
+
() => [table.getLeftFlatHeaders()],
|
|
330
|
+
flatHeaders => {
|
|
331
|
+
return flatHeaders.filter(header => !header.subHeaders?.length)
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
key: process.env.NODE_ENV === 'development' && 'getLeftLeafHeaders',
|
|
335
|
+
debug: () => table.options.debugAll ?? table.options.debugHeaders,
|
|
336
|
+
}
|
|
337
|
+
)
|
|
338
|
+
|
|
339
|
+
table.getRightLeafHeaders = memo(
|
|
340
|
+
() => [table.getRightFlatHeaders()],
|
|
341
|
+
flatHeaders => {
|
|
342
|
+
return flatHeaders.filter(header => !header.subHeaders?.length)
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
key: process.env.NODE_ENV === 'development' && 'getRightLeafHeaders',
|
|
346
|
+
debug: () => table.options.debugAll ?? table.options.debugHeaders,
|
|
347
|
+
}
|
|
348
|
+
)
|
|
349
|
+
|
|
350
|
+
table.getLeafHeaders = memo(
|
|
351
|
+
() => [
|
|
352
|
+
table.getLeftHeaderGroups(),
|
|
353
|
+
table.getCenterHeaderGroups(),
|
|
354
|
+
table.getRightHeaderGroups(),
|
|
355
|
+
],
|
|
356
|
+
(left, center, right) => {
|
|
357
|
+
return [
|
|
358
|
+
...(left[0]?.headers ?? []),
|
|
359
|
+
...(center[0]?.headers ?? []),
|
|
360
|
+
...(right[0]?.headers ?? []),
|
|
361
|
+
]
|
|
362
|
+
.map(header => {
|
|
363
|
+
return header.getLeafHeaders()
|
|
364
|
+
})
|
|
365
|
+
.flat()
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
key: process.env.NODE_ENV === 'development' && 'getLeafHeaders',
|
|
369
|
+
debug: () => table.options.debugAll ?? table.options.debugHeaders,
|
|
370
|
+
}
|
|
371
|
+
)
|
|
388
372
|
},
|
|
389
373
|
}
|
|
390
374
|
|
package/src/core/row.ts
CHANGED
|
@@ -127,7 +127,7 @@ export const createRow = <TData extends RowData>(
|
|
|
127
127
|
|
|
128
128
|
for (let i = 0; i < table._features.length; i++) {
|
|
129
129
|
const feature = table._features[i]
|
|
130
|
-
|
|
130
|
+
feature?.createRow?.(row, table)
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
return row as Row<TData>
|
package/src/core/table.ts
CHANGED
|
@@ -347,9 +347,10 @@ export function createTable<TData extends RowData>(
|
|
|
347
347
|
|
|
348
348
|
Object.assign(table, coreInstance)
|
|
349
349
|
|
|
350
|
-
table._features.
|
|
351
|
-
|
|
352
|
-
|
|
350
|
+
for (let index = 0; index < table._features.length; index++) {
|
|
351
|
+
const feature = table._features[index]
|
|
352
|
+
feature?.createTable?.(table)
|
|
353
|
+
}
|
|
353
354
|
|
|
354
355
|
return table
|
|
355
356
|
}
|