@tanstack/table-core 8.1.0 → 8.1.4
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/utils.js +2 -2
- package/build/cjs/utils.js.map +1 -1
- package/build/esm/index.js +2 -2
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +301 -301
- package/build/types/index.d.ts +2 -2
- package/build/umd/index.development.js +2 -2
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/types.ts +1 -1
- package/src/utils.ts +6 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/table-core",
|
|
3
3
|
"author": "Tanner Linsley",
|
|
4
|
-
"version": "8.1.
|
|
4
|
+
"version": "8.1.4",
|
|
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/types.ts
CHANGED
|
@@ -172,7 +172,7 @@ export type AccessorFn<TData extends RowData> = (
|
|
|
172
172
|
|
|
173
173
|
export type ColumnDefTemplate<TProps extends object> =
|
|
174
174
|
| string
|
|
175
|
-
| ((props: TProps) =>
|
|
175
|
+
| ((props: TProps) => any)
|
|
176
176
|
|
|
177
177
|
export type ColumnDef<TData extends RowData> = CoreColumnDef<TData> &
|
|
178
178
|
VisibilityColumnDef &
|
package/src/utils.ts
CHANGED
|
@@ -27,9 +27,12 @@ export function noop() {
|
|
|
27
27
|
//
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export function makeStateUpdater
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
export function makeStateUpdater<K extends keyof TableState>(
|
|
31
|
+
key: K,
|
|
32
|
+
instance: unknown
|
|
33
|
+
) {
|
|
34
|
+
return (updater: Updater<TableState[K]>) => {
|
|
35
|
+
;(instance as any).setState(<TTableState>(old: TTableState) => {
|
|
33
36
|
return {
|
|
34
37
|
...old,
|
|
35
38
|
[key]: functionalUpdate(updater, (old as any)[key]),
|