@tanstack/table-core 8.0.0-alpha.74 → 8.0.0-alpha.79
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/cjs/features/ColumnSizing.js +1 -1
- package/build/cjs/features/ColumnSizing.js.map +1 -1
- package/build/cjs/features/Headers.js +12 -6
- package/build/cjs/features/Headers.js.map +1 -1
- package/build/esm/index.js +13 -7
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +297 -297
- package/build/umd/index.development.js +13 -7
- 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 +2 -2
- package/src/features/ColumnSizing.ts +1 -1
- package/src/features/Headers.ts +33 -10
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/table-core",
|
|
3
3
|
"author": "Tanner Linsley",
|
|
4
|
-
"version": "8.0.0-alpha.
|
|
4
|
+
"version": "8.0.0-alpha.79",
|
|
5
5
|
"description": "Hooks for building lightweight, fast and extendable datagrids for React",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/tanstack/react-table#readme",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"module": "build/esm/index.js",
|
|
28
28
|
"main": "build/cjs/index.js",
|
|
29
|
-
"browser": "build/umd/index.production.
|
|
29
|
+
"browser": "build/umd/index.production.js",
|
|
30
30
|
"types": "build/types/index.d.ts",
|
|
31
31
|
"sideEffects": false,
|
|
32
32
|
"engines": {
|
package/src/features/Headers.ts
CHANGED
|
@@ -121,15 +121,20 @@ export const Headers = {
|
|
|
121
121
|
instance.getState().columnPinning.right,
|
|
122
122
|
],
|
|
123
123
|
(allColumns, leafColumns, left, right) => {
|
|
124
|
-
const leftColumns =
|
|
125
|
-
left
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
const leftColumns =
|
|
125
|
+
left
|
|
126
|
+
?.map(columnId => leafColumns.find(d => d.id === columnId)!)
|
|
127
|
+
.filter(Boolean) ?? []
|
|
128
|
+
|
|
129
|
+
const rightColumns =
|
|
130
|
+
right
|
|
131
|
+
?.map(columnId => leafColumns.find(d => d.id === columnId)!)
|
|
132
|
+
.filter(Boolean) ?? []
|
|
133
|
+
|
|
130
134
|
const centerColumns = leafColumns.filter(
|
|
131
135
|
column => !left?.includes(column.id) && !right?.includes(column.id)
|
|
132
136
|
)
|
|
137
|
+
|
|
133
138
|
const headerGroups = buildHeaderGroups(
|
|
134
139
|
allColumns,
|
|
135
140
|
[...leftColumns, ...centerColumns, ...rightColumns],
|
|
@@ -173,8 +178,17 @@ export const Headers = {
|
|
|
173
178
|
instance.getState().columnPinning.left,
|
|
174
179
|
],
|
|
175
180
|
(allColumns, leafColumns, left) => {
|
|
176
|
-
|
|
177
|
-
|
|
181
|
+
const orderedLeafColumns =
|
|
182
|
+
left
|
|
183
|
+
?.map(columnId => leafColumns.find(d => d.id === columnId)!)
|
|
184
|
+
.filter(Boolean) ?? []
|
|
185
|
+
|
|
186
|
+
return buildHeaderGroups(
|
|
187
|
+
allColumns,
|
|
188
|
+
orderedLeafColumns,
|
|
189
|
+
instance,
|
|
190
|
+
'left'
|
|
191
|
+
)
|
|
178
192
|
},
|
|
179
193
|
{
|
|
180
194
|
key: process.env.NODE_ENV === 'development' && 'getLeftHeaderGroups',
|
|
@@ -190,8 +204,17 @@ export const Headers = {
|
|
|
190
204
|
instance.getState().columnPinning.right,
|
|
191
205
|
],
|
|
192
206
|
(allColumns, leafColumns, right) => {
|
|
193
|
-
|
|
194
|
-
|
|
207
|
+
const orderedLeafColumns =
|
|
208
|
+
right
|
|
209
|
+
?.map(columnId => leafColumns.find(d => d.id === columnId)!)
|
|
210
|
+
.filter(Boolean) ?? []
|
|
211
|
+
|
|
212
|
+
return buildHeaderGroups(
|
|
213
|
+
allColumns,
|
|
214
|
+
orderedLeafColumns,
|
|
215
|
+
instance,
|
|
216
|
+
'right'
|
|
217
|
+
)
|
|
195
218
|
},
|
|
196
219
|
{
|
|
197
220
|
key: process.env.NODE_ENV === 'development' && 'getRightHeaderGroups',
|