@tanstack/table-core 8.5.10 → 8.5.13

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.10",
4
+ "version": "8.5.13",
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 => {
@@ -202,7 +202,7 @@ export const Pinning: TableFeature = {
202
202
  columnId => allCells.find(cell => cell.column.id === columnId)!
203
203
  )
204
204
  .filter(Boolean)
205
- .map(d => ({ ...d, position: 'left' } as Cell<TData, unknown>))
205
+ .map(d => ({ ...d, position: 'right' } as Cell<TData, unknown>))
206
206
 
207
207
  return cells
208
208
  },
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> =