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

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.76",
4
+ "version": "8.0.0-alpha.80",
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",
@@ -215,7 +215,7 @@ export const ColumnSizing: TableFeature = {
215
215
  }
216
216
  }
217
217
 
218
- const startSize = column.getSize()
218
+ const startSize = header.getSize()
219
219
 
220
220
  const columnSizingStart: [string, number][] = header
221
221
  ? header
@@ -121,15 +121,20 @@ export const Headers = {
121
121
  instance.getState().columnPinning.right,
122
122
  ],
123
123
  (allColumns, leafColumns, left, right) => {
124
- const leftColumns = leafColumns.filter(column =>
125
- left?.includes(column.id)
126
- )
127
- const rightColumns = leafColumns.filter(column =>
128
- right?.includes(column.id)
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],
@@ -85,14 +85,18 @@ export const Rows = {
85
85
  if (row.valuesCache.hasOwnProperty(columnId)) {
86
86
  return row.valuesCache[columnId]
87
87
  }
88
+
88
89
  const column = instance.getColumn(columnId)
90
+
89
91
  if (!column.accessorFn) {
90
- throw new Error()
92
+ return undefined
91
93
  }
94
+
92
95
  row.valuesCache[columnId] = column.accessorFn(
93
96
  row.original,
94
97
  rowIndex
95
98
  )
99
+
96
100
  return row.valuesCache[columnId]
97
101
  },
98
102
  subRows: subRows ?? [],