@tanstack/table-core 8.2.0 → 8.2.1

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.2.0",
4
+ "version": "8.2.1",
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",
@@ -105,7 +105,7 @@ export function createColumn<TData extends RowData, TValue>(
105
105
  if (resolvedColumnDef.accessorFn) {
106
106
  accessorFn = resolvedColumnDef.accessorFn
107
107
  } else if (resolvedColumnDef.accessorKey) {
108
- accessorFn = (originalRow?: TData) =>
108
+ accessorFn = (originalRow: TData) =>
109
109
  (originalRow as any)[resolvedColumnDef.accessorKey]
110
110
  }
111
111
 
package/src/core/row.ts CHANGED
@@ -5,7 +5,7 @@ import { createCell } from './cell'
5
5
  export type CoreRow<TData extends RowData> = {
6
6
  id: string
7
7
  index: number
8
- original?: TData
8
+ original: TData
9
9
  depth: number
10
10
  _valuesCache: Record<string, unknown>
11
11
  getValue: <TValue>(columnId: string) => TValue
@@ -20,7 +20,7 @@ export type CoreRow<TData extends RowData> = {
20
20
  export const createRow = <TData extends RowData>(
21
21
  table: Table<TData>,
22
22
  id: string,
23
- original: TData | undefined,
23
+ original: TData,
24
24
  rowIndex: number,
25
25
  depth: number,
26
26
  subRows?: Row<TData>[]
@@ -40,7 +40,7 @@ export function getCoreRowModel<TData extends RowData>(): (
40
40
  const row = createRow(
41
41
  table,
42
42
  table._getRowId(originalRows[i]!, i, parent),
43
- originalRows[i],
43
+ originalRows[i]!,
44
44
  i,
45
45
  depth
46
46
  )
@@ -55,7 +55,13 @@ export function getGroupedRowModel<TData extends RowData>(): (
55
55
  ? flattenBy(groupedRows, row => row.subRows)
56
56
  : groupedRows
57
57
 
58
- const row = createRow(table, id, undefined, index, depth)
58
+ const row = createRow(
59
+ table,
60
+ id,
61
+ leafRows[0]!.original,
62
+ index,
63
+ depth
64
+ )
59
65
 
60
66
  Object.assign(row, {
61
67
  groupingColumnId: columnId,