@tanstack/table-core 8.0.0-alpha.85 → 8.0.0-alpha.86
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/features/Expanding.js +0 -1
- package/build/cjs/features/Expanding.js.map +1 -1
- package/build/cjs/features/Visibility.js +0 -5
- package/build/cjs/features/Visibility.js.map +1 -1
- package/build/cjs/utils/getExpandedRowModel.js +2 -2
- package/build/cjs/utils/getExpandedRowModel.js.map +1 -1
- package/build/cjs/utils/getPaginationRowModel.js +1 -1
- package/build/cjs/utils/getPaginationRowModel.js.map +1 -1
- package/build/esm/index.js +3 -9
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +314 -314
- package/build/types/features/Expanding.d.ts +0 -1
- package/build/types/features/Visibility.d.ts +5 -6
- package/build/umd/index.development.js +3 -9
- 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/features/Expanding.ts +0 -2
- package/src/features/Visibility.ts +7 -16
- package/src/utils/getExpandedRowModel.ts +1 -5
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/table-core",
|
|
3
3
|
"author": "Tanner Linsley",
|
|
4
|
-
"version": "8.0.0-alpha.
|
|
4
|
+
"version": "8.0.0-alpha.86",
|
|
5
5
|
"description": "Hooks for building lightweight, fast and extendable datagrids for React",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/tanstack/react-table#readme",
|
|
@@ -30,7 +30,6 @@ export type ExpandedOptions<TGenerics extends TableGenerics> = {
|
|
|
30
30
|
getExpandedRowModel?: (
|
|
31
31
|
instance: TableInstance<TGenerics>
|
|
32
32
|
) => () => RowModel<TGenerics>
|
|
33
|
-
expandSubRows?: boolean
|
|
34
33
|
getIsRowExpanded?: (row: Row<TGenerics>) => boolean
|
|
35
34
|
getRowCanExpand?: (row: Row<TGenerics>) => boolean
|
|
36
35
|
paginateExpandedRows?: boolean
|
|
@@ -67,7 +66,6 @@ export const Expanding: TableFeature = {
|
|
|
67
66
|
return {
|
|
68
67
|
onExpandedChange: makeStateUpdater('expanded', instance),
|
|
69
68
|
autoResetExpanded: true,
|
|
70
|
-
expandSubRows: true,
|
|
71
69
|
paginateExpandedRows: true,
|
|
72
70
|
}
|
|
73
71
|
},
|
|
@@ -10,6 +10,12 @@ import {
|
|
|
10
10
|
} from '../types'
|
|
11
11
|
import { makeStateUpdater, memo } from '../utils'
|
|
12
12
|
|
|
13
|
+
export type VisibilityState = Record<string, boolean>
|
|
14
|
+
|
|
15
|
+
export type VisibilityTableState = {
|
|
16
|
+
columnVisibility: VisibilityState
|
|
17
|
+
}
|
|
18
|
+
|
|
13
19
|
export type VisibilityOptions = {
|
|
14
20
|
onColumnVisibilityChange?: OnChangeFn<VisibilityState>
|
|
15
21
|
enableHiding?: boolean
|
|
@@ -19,12 +25,6 @@ export type VisibilityDefaultOptions = {
|
|
|
19
25
|
onColumnVisibilityChange: OnChangeFn<VisibilityState>
|
|
20
26
|
}
|
|
21
27
|
|
|
22
|
-
export type VisibilityState = Record<string, boolean>
|
|
23
|
-
|
|
24
|
-
export type VisibilityTableState = {
|
|
25
|
-
columnVisibility: VisibilityState
|
|
26
|
-
}
|
|
27
|
-
|
|
28
28
|
export type VisibilityInstance<TGenerics extends TableGenerics> = {
|
|
29
29
|
getVisibleFlatColumns: () => Column<TGenerics>[]
|
|
30
30
|
getVisibleLeafColumns: () => Column<TGenerics>[]
|
|
@@ -36,14 +36,11 @@ export type VisibilityInstance<TGenerics extends TableGenerics> = {
|
|
|
36
36
|
toggleAllColumnsVisible: (value?: boolean) => void
|
|
37
37
|
getIsAllColumnsVisible: () => boolean
|
|
38
38
|
getIsSomeColumnsVisible: () => boolean
|
|
39
|
-
getToggleAllColumnsVisibilityHandler: () =>
|
|
40
|
-
| undefined
|
|
41
|
-
| ((event: unknown) => void)
|
|
39
|
+
getToggleAllColumnsVisibilityHandler: () => (event: unknown) => void
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
export type VisibilityColumnDef = {
|
|
45
43
|
enableHiding?: boolean
|
|
46
|
-
defaultIsVisible?: boolean
|
|
47
44
|
}
|
|
48
45
|
|
|
49
46
|
export type VisibilityRow<TGenerics extends TableGenerics> = {
|
|
@@ -76,12 +73,6 @@ export const Visibility: TableFeature = {
|
|
|
76
73
|
}
|
|
77
74
|
},
|
|
78
75
|
|
|
79
|
-
getDefaultColumnDef: () => {
|
|
80
|
-
return {
|
|
81
|
-
defaultIsVisible: true,
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
|
|
85
76
|
createColumn: <TGenerics extends TableGenerics>(
|
|
86
77
|
column: Column<TGenerics>,
|
|
87
78
|
instance: TableInstance<TGenerics>
|
|
@@ -39,11 +39,7 @@ export function expandRows<TGenerics extends TableGenerics>(
|
|
|
39
39
|
const handleRow = (row: Row<TGenerics>) => {
|
|
40
40
|
expandedRows.push(row)
|
|
41
41
|
|
|
42
|
-
if (
|
|
43
|
-
instance.options.expandSubRows &&
|
|
44
|
-
row.subRows?.length &&
|
|
45
|
-
row.getIsExpanded()
|
|
46
|
-
) {
|
|
42
|
+
if (row.subRows?.length && row.getIsExpanded()) {
|
|
47
43
|
row.subRows.forEach(handleRow)
|
|
48
44
|
}
|
|
49
45
|
}
|