@tanstack/table-core 8.5.9 → 8.5.12

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.5.9",
4
+ "version": "8.5.12",
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
@@ -1,5 +1,5 @@
1
1
  import { RowData, Cell, Column, Row, Table } from '../types'
2
- import { Getter } from '../utils'
2
+ import { Getter, memo } from '../utils'
3
3
 
4
4
  export type CellContext<TData extends RowData, TValue> = {
5
5
  table: Table<TData>
@@ -34,14 +34,21 @@ export function createCell<TData extends RowData, TValue>(
34
34
  column,
35
35
  getValue: () => row.getValue(columnId),
36
36
  renderValue: getRenderValue,
37
- getContext: () => ({
38
- table,
39
- column,
40
- row,
41
- cell: cell as Cell<TData, TValue>,
42
- getValue: cell.getValue,
43
- renderValue: cell.renderValue,
44
- }),
37
+ getContext: memo(
38
+ () => [table, column, row, cell],
39
+ (table, column, row, cell) => ({
40
+ table,
41
+ column,
42
+ row,
43
+ cell: cell as Cell<TData, TValue>,
44
+ getValue: cell.getValue,
45
+ renderValue: cell.renderValue,
46
+ }),
47
+ {
48
+ key: process.env.NODE_ENV === 'development' && 'cell.getContext',
49
+ debug: () => table.options.debugAll,
50
+ }
51
+ ),
45
52
  }
46
53
 
47
54
  table._features.forEach(feature => {
package/src/types.ts CHANGED
@@ -242,7 +242,7 @@ export type AccessorKeyColumnDef<TData extends RowData, TValue = unknown> = {
242
242
  id?: string
243
243
  } & Partial<ColumnIdentifiers<TData, TValue>> &
244
244
  ColumnDefBase<TData, TValue> & {
245
- accessorKey: DeepKeys<TData>
245
+ accessorKey: string | keyof TData
246
246
  }
247
247
 
248
248
  export type AccessorColumnDef<TData extends RowData, TValue = unknown> =
@@ -21,7 +21,6 @@ export function getExpandedRowModel<TData extends RowData>(): (
21
21
 
22
22
  if (!paginateExpandedRows) {
23
23
  // Only expand rows at this point if they are being paginated
24
- console.log(rowModel.rows)
25
24
  return rowModel
26
25
  }
27
26
 
@@ -42,8 +42,6 @@ export function getPaginationRowModel<TData extends RowData>(opts?: {
42
42
  }
43
43
  }
44
44
 
45
- console.log(paginatedRowModel.rows)
46
-
47
45
  paginatedRowModel.flatRows = []
48
46
 
49
47
  const handleRow = (row: Row<TData>) => {