@tanstack/table-core 8.0.0-alpha.74 → 8.0.0-alpha.76

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/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.74",
4
+ "version": "8.0.0-alpha.76",
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.min.js",
29
+ "browser": "build/umd/index.production.js",
30
30
  "types": "build/types/index.d.ts",
31
31
  "sideEffects": false,
32
32
  "engines": {
@@ -173,8 +173,17 @@ export const Headers = {
173
173
  instance.getState().columnPinning.left,
174
174
  ],
175
175
  (allColumns, leafColumns, left) => {
176
- leafColumns = leafColumns.filter(column => left?.includes(column.id))
177
- return buildHeaderGroups(allColumns, leafColumns, instance, 'left')
176
+ const orderedLeafColumns =
177
+ left
178
+ ?.map(columnId => leafColumns.find(d => d.id === columnId)!)
179
+ .filter(Boolean) ?? []
180
+
181
+ return buildHeaderGroups(
182
+ allColumns,
183
+ orderedLeafColumns,
184
+ instance,
185
+ 'left'
186
+ )
178
187
  },
179
188
  {
180
189
  key: process.env.NODE_ENV === 'development' && 'getLeftHeaderGroups',
@@ -190,8 +199,17 @@ export const Headers = {
190
199
  instance.getState().columnPinning.right,
191
200
  ],
192
201
  (allColumns, leafColumns, right) => {
193
- leafColumns = leafColumns.filter(column => right?.includes(column.id))
194
- return buildHeaderGroups(allColumns, leafColumns, instance, 'right')
202
+ const orderedLeafColumns =
203
+ right
204
+ ?.map(columnId => leafColumns.find(d => d.id === columnId)!)
205
+ .filter(Boolean) ?? []
206
+
207
+ return buildHeaderGroups(
208
+ allColumns,
209
+ orderedLeafColumns,
210
+ instance,
211
+ 'right'
212
+ )
195
213
  },
196
214
  {
197
215
  key: process.env.NODE_ENV === 'development' && 'getRightHeaderGroups',