@tanstack/table-core 8.3.4 → 8.4.0
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/build/cjs/columnHelper.js +2 -1
- package/build/cjs/columnHelper.js.map +1 -1
- package/build/cjs/core/cell.js.map +1 -1
- package/build/cjs/index.js +2 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/utils.js.map +1 -1
- package/build/esm/index.js +3 -2
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +314 -308
- package/build/types/index.d.ts +5 -4
- package/build/umd/index.development.js +3 -1
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/columnHelper.ts +8 -1
- package/src/core/cell.ts +1 -5
- package/src/index.ts +1 -0
- package/src/types.ts +0 -2
- package/src/utils.ts +5 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/table-core",
|
|
3
3
|
"author": "Tanner Linsley",
|
|
4
|
-
"version": "8.
|
|
4
|
+
"version": "8.4.0",
|
|
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/columnHelper.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AccessorFn, ColumnDef, RowData } from './types'
|
|
2
|
-
import { DeepKeys, DeepValue } from './utils'
|
|
2
|
+
import { DeepKeys, DeepValue, RequiredKeys } from './utils'
|
|
3
3
|
|
|
4
4
|
// type Person = {
|
|
5
5
|
// firstName: string
|
|
@@ -53,6 +53,12 @@ export type ColumnHelper<TData extends RowData> = {
|
|
|
53
53
|
accessor: TAccessor,
|
|
54
54
|
column: Omit<ColumnDef<TData, TValue>, 'accessorKey'>
|
|
55
55
|
) => ColumnDef<TData, TValue>
|
|
56
|
+
display: (
|
|
57
|
+
column: RequiredKeys<
|
|
58
|
+
Omit<ColumnDef<TData, unknown>, 'accessorKey' | 'accessorFn'>,
|
|
59
|
+
'id'
|
|
60
|
+
>
|
|
61
|
+
) => ColumnDef<TData, unknown>
|
|
56
62
|
}
|
|
57
63
|
|
|
58
64
|
export function createColumnHelper<
|
|
@@ -70,5 +76,6 @@ export function createColumnHelper<
|
|
|
70
76
|
accessorKey: accessor,
|
|
71
77
|
}
|
|
72
78
|
},
|
|
79
|
+
display: column => column as ColumnDef<TData, unknown>,
|
|
73
80
|
}
|
|
74
81
|
}
|
package/src/core/cell.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { RowData, Cell, Column, Row, Table } from '../types'
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
type NoInfer<T> = [T][T extends any ? 0 : never]
|
|
5
|
-
|
|
6
|
-
type Getter<TValue> = <TTValue = TValue>() => NoInfer<TTValue>
|
|
2
|
+
import { Getter } from '../utils'
|
|
7
3
|
|
|
8
4
|
export type CellContext<TData extends RowData, TValue> = {
|
|
9
5
|
table: Table<TData>
|
package/src/index.ts
CHANGED
package/src/types.ts
CHANGED
package/src/utils.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TableState, Updater } from './types'
|
|
2
2
|
|
|
3
3
|
export type PartialKeys<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>
|
|
4
4
|
export type RequiredKeys<T, K extends keyof T> = Omit<T, K> &
|
|
@@ -65,6 +65,10 @@ export type DeepValue<T, TProp> = T extends Record<string | number, any>
|
|
|
65
65
|
: T[TProp & string]
|
|
66
66
|
: never
|
|
67
67
|
|
|
68
|
+
export type NoInfer<T> = [T][T extends any ? 0 : never]
|
|
69
|
+
|
|
70
|
+
export type Getter<TValue> = <TTValue = TValue>() => NoInfer<TTValue>
|
|
71
|
+
|
|
68
72
|
///
|
|
69
73
|
|
|
70
74
|
export function functionalUpdate<T>(updater: Updater<T>, input: T): T {
|