@tanstack/table-core 9.0.0-alpha.47 → 9.0.0-alpha.48
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/README.md +10 -0
- package/dist/core/cells/coreCellsFeature.utils.cjs +11 -8
- package/dist/core/cells/coreCellsFeature.utils.cjs.map +1 -1
- package/dist/core/cells/coreCellsFeature.utils.d.cts +11 -8
- package/dist/core/cells/coreCellsFeature.utils.d.ts +11 -8
- package/dist/core/cells/coreCellsFeature.utils.js +11 -8
- package/dist/core/cells/coreCellsFeature.utils.js.map +1 -1
- package/dist/core/columns/coreColumnsFeature.types.d.cts +7 -6
- package/dist/core/columns/coreColumnsFeature.types.d.ts +7 -6
- package/dist/core/columns/coreColumnsFeature.utils.cjs +37 -27
- package/dist/core/columns/coreColumnsFeature.utils.cjs.map +1 -1
- package/dist/core/columns/coreColumnsFeature.utils.d.cts +37 -27
- package/dist/core/columns/coreColumnsFeature.utils.d.ts +37 -27
- package/dist/core/columns/coreColumnsFeature.utils.js +37 -27
- package/dist/core/columns/coreColumnsFeature.utils.js.map +1 -1
- package/dist/core/headers/coreHeadersFeature.types.d.cts +6 -4
- package/dist/core/headers/coreHeadersFeature.types.d.ts +6 -4
- package/dist/core/headers/coreHeadersFeature.utils.cjs +23 -18
- package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
- package/dist/core/headers/coreHeadersFeature.utils.d.cts +23 -18
- package/dist/core/headers/coreHeadersFeature.utils.d.ts +23 -18
- package/dist/core/headers/coreHeadersFeature.utils.js +23 -18
- package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.utils.cjs +48 -36
- package/dist/core/row-models/coreRowModelsFeature.utils.cjs.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.utils.d.cts +48 -36
- package/dist/core/row-models/coreRowModelsFeature.utils.d.ts +48 -36
- package/dist/core/row-models/coreRowModelsFeature.utils.js +48 -36
- package/dist/core/row-models/coreRowModelsFeature.utils.js.map +1 -1
- package/dist/core/rows/coreRowsFeature.types.d.cts +4 -4
- package/dist/core/rows/coreRowsFeature.types.d.ts +4 -4
- package/dist/core/rows/coreRowsFeature.utils.cjs +34 -28
- package/dist/core/rows/coreRowsFeature.utils.cjs.map +1 -1
- package/dist/core/rows/coreRowsFeature.utils.d.cts +34 -28
- package/dist/core/rows/coreRowsFeature.utils.d.ts +34 -28
- package/dist/core/rows/coreRowsFeature.utils.js +34 -28
- package/dist/core/rows/coreRowsFeature.utils.js.map +1 -1
- package/dist/core/table/coreTablesFeature.types.d.cts +6 -2
- package/dist/core/table/coreTablesFeature.types.d.ts +6 -2
- package/dist/core/table/coreTablesFeature.utils.cjs +2 -2
- package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
- package/dist/core/table/coreTablesFeature.utils.d.cts +2 -2
- package/dist/core/table/coreTablesFeature.utils.d.ts +2 -2
- package/dist/core/table/coreTablesFeature.utils.js +2 -2
- package/dist/core/table/coreTablesFeature.utils.js.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.types.d.cts +16 -10
- package/dist/features/column-faceting/columnFacetingFeature.types.d.ts +16 -10
- package/dist/features/column-faceting/columnFacetingFeature.utils.cjs +26 -18
- package/dist/features/column-faceting/columnFacetingFeature.utils.cjs.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.utils.d.cts +26 -18
- package/dist/features/column-faceting/columnFacetingFeature.utils.d.ts +26 -18
- package/dist/features/column-faceting/columnFacetingFeature.utils.js +26 -18
- package/dist/features/column-faceting/columnFacetingFeature.utils.js.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +21 -11
- package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +21 -11
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs +39 -28
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.cts +39 -28
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.ts +39 -28
- package/dist/features/column-filtering/columnFilteringFeature.utils.js +39 -28
- package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.types.d.cts +18 -14
- package/dist/features/column-grouping/columnGroupingFeature.types.d.ts +18 -14
- package/dist/features/column-grouping/columnGroupingFeature.utils.cjs +55 -43
- package/dist/features/column-grouping/columnGroupingFeature.utils.cjs.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.utils.d.cts +55 -43
- package/dist/features/column-grouping/columnGroupingFeature.utils.d.ts +55 -43
- package/dist/features/column-grouping/columnGroupingFeature.utils.js +55 -43
- package/dist/features/column-grouping/columnGroupingFeature.utils.js.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.types.d.cts +14 -5
- package/dist/features/column-ordering/columnOrderingFeature.types.d.ts +14 -5
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs +30 -23
- package/dist/features/column-ordering/columnOrderingFeature.utils.cjs.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.cts +30 -23
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.ts +30 -23
- package/dist/features/column-ordering/columnOrderingFeature.utils.js +30 -23
- package/dist/features/column-ordering/columnOrderingFeature.utils.js.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.types.d.cts +43 -31
- package/dist/features/column-pinning/columnPinningFeature.types.d.ts +43 -31
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs +111 -91
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +111 -91
- package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +111 -91
- package/dist/features/column-pinning/columnPinningFeature.utils.js +111 -91
- package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.types.d.cts +9 -9
- package/dist/features/column-resizing/columnResizingFeature.types.d.ts +9 -9
- package/dist/features/column-resizing/columnResizingFeature.utils.cjs +28 -19
- package/dist/features/column-resizing/columnResizingFeature.utils.cjs.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.utils.d.cts +28 -19
- package/dist/features/column-resizing/columnResizingFeature.utils.d.ts +28 -19
- package/dist/features/column-resizing/columnResizingFeature.utils.js +28 -19
- package/dist/features/column-resizing/columnResizingFeature.utils.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.types.d.cts +19 -12
- package/dist/features/column-sizing/columnSizingFeature.types.d.ts +19 -12
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs +52 -41
- package/dist/features/column-sizing/columnSizingFeature.utils.cjs.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +52 -41
- package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +52 -41
- package/dist/features/column-sizing/columnSizingFeature.utils.js +52 -41
- package/dist/features/column-sizing/columnSizingFeature.utils.js.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.types.d.cts +16 -13
- package/dist/features/column-visibility/columnVisibilityFeature.types.d.ts +16 -13
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs +54 -42
- package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.cts +54 -42
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +54 -42
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js +54 -42
- package/dist/features/column-visibility/columnVisibilityFeature.utils.js.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.types.d.cts +10 -5
- package/dist/features/global-filtering/globalFilteringFeature.types.d.ts +10 -5
- package/dist/features/global-filtering/globalFilteringFeature.utils.cjs +20 -14
- package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.cts +20 -14
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.ts +20 -14
- package/dist/features/global-filtering/globalFilteringFeature.utils.js +20 -14
- package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.types.d.cts +16 -15
- package/dist/features/row-expanding/rowExpandingFeature.types.d.ts +16 -15
- package/dist/features/row-expanding/rowExpandingFeature.utils.cjs +56 -41
- package/dist/features/row-expanding/rowExpandingFeature.utils.cjs.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.utils.d.cts +56 -41
- package/dist/features/row-expanding/rowExpandingFeature.utils.d.ts +56 -41
- package/dist/features/row-expanding/rowExpandingFeature.utils.js +56 -41
- package/dist/features/row-expanding/rowExpandingFeature.utils.js.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.types.d.cts +19 -12
- package/dist/features/row-pagination/rowPaginationFeature.types.d.ts +19 -12
- package/dist/features/row-pagination/rowPaginationFeature.utils.cjs +49 -32
- package/dist/features/row-pagination/rowPaginationFeature.utils.cjs.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.utils.d.cts +49 -32
- package/dist/features/row-pagination/rowPaginationFeature.utils.d.ts +49 -32
- package/dist/features/row-pagination/rowPaginationFeature.utils.js +49 -32
- package/dist/features/row-pagination/rowPaginationFeature.utils.js.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.types.d.cts +12 -8
- package/dist/features/row-pinning/rowPinningFeature.types.d.ts +12 -8
- package/dist/features/row-pinning/rowPinningFeature.utils.cjs +39 -29
- package/dist/features/row-pinning/rowPinningFeature.utils.cjs.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.utils.d.cts +39 -29
- package/dist/features/row-pinning/rowPinningFeature.utils.d.ts +39 -29
- package/dist/features/row-pinning/rowPinningFeature.utils.js +39 -29
- package/dist/features/row-pinning/rowPinningFeature.utils.js.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.types.d.cts +30 -24
- package/dist/features/row-selection/rowSelectionFeature.types.d.ts +30 -24
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs +89 -69
- package/dist/features/row-selection/rowSelectionFeature.utils.cjs.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.utils.d.cts +89 -69
- package/dist/features/row-selection/rowSelectionFeature.utils.d.ts +89 -69
- package/dist/features/row-selection/rowSelectionFeature.utils.js +89 -69
- package/dist/features/row-selection/rowSelectionFeature.utils.js.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.types.d.cts +10 -8
- package/dist/features/row-sorting/rowSortingFeature.types.d.ts +10 -8
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs +61 -44
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.utils.d.cts +61 -44
- package/dist/features/row-sorting/rowSortingFeature.utils.d.ts +61 -44
- package/dist/features/row-sorting/rowSortingFeature.utils.js +61 -44
- package/dist/features/row-sorting/rowSortingFeature.utils.js.map +1 -1
- package/dist/fns/aggregationFns.cjs +33 -9
- package/dist/fns/aggregationFns.cjs.map +1 -1
- package/dist/fns/aggregationFns.d.cts +33 -9
- package/dist/fns/aggregationFns.d.ts +33 -9
- package/dist/fns/aggregationFns.js +33 -9
- package/dist/fns/aggregationFns.js.map +1 -1
- package/dist/fns/filterFns.cjs +48 -17
- package/dist/fns/filterFns.cjs.map +1 -1
- package/dist/fns/filterFns.d.cts +42 -15
- package/dist/fns/filterFns.d.ts +42 -15
- package/dist/fns/filterFns.js +48 -17
- package/dist/fns/filterFns.js.map +1 -1
- package/dist/helpers/columnHelper.cjs +9 -4
- package/dist/helpers/columnHelper.cjs.map +1 -1
- package/dist/helpers/columnHelper.d.cts +9 -4
- package/dist/helpers/columnHelper.d.ts +9 -4
- package/dist/helpers/columnHelper.js +9 -4
- package/dist/helpers/columnHelper.js.map +1 -1
- package/dist/helpers/tableOptions.cjs.map +1 -1
- package/dist/helpers/tableOptions.d.cts +12 -9
- package/dist/helpers/tableOptions.d.ts +12 -9
- package/dist/helpers/tableOptions.js.map +1 -1
- package/dist/types/ColumnDef.d.cts +38 -0
- package/dist/types/ColumnDef.d.ts +38 -0
- package/dist/types/TableOptions.d.cts +15 -0
- package/dist/types/TableOptions.d.ts +15 -0
- package/dist/types/TableState.d.cts +12 -0
- package/dist/types/TableState.d.ts +12 -0
- package/package.json +5 -3
- package/skills/column-definitions/SKILL.md +333 -0
- package/skills/column-layout/SKILL.md +328 -0
- package/skills/column-layout/references/subsystems.md +220 -0
- package/skills/customizing-feature-behavior/SKILL.md +416 -0
- package/skills/filtering/SKILL.md +357 -0
- package/skills/filtering/references/faceting-and-fuzzy.md +191 -0
- package/skills/grouping/SKILL.md +448 -0
- package/skills/migrate-v8-to-v9/SKILL.md +495 -0
- package/skills/pagination/SKILL.md +385 -0
- package/skills/row-expanding/SKILL.md +348 -0
- package/skills/row-pinning/SKILL.md +269 -0
- package/skills/row-selection/SKILL.md +391 -0
- package/skills/setup/SKILL.md +400 -0
- package/skills/sorting/SKILL.md +344 -0
- package/skills/state-management/SKILL.md +388 -0
- package/src/core/cells/coreCellsFeature.utils.ts +11 -8
- package/src/core/columns/coreColumnsFeature.types.ts +7 -6
- package/src/core/columns/coreColumnsFeature.utils.ts +37 -27
- package/src/core/headers/coreHeadersFeature.types.ts +6 -4
- package/src/core/headers/coreHeadersFeature.utils.ts +23 -18
- package/src/core/row-models/coreRowModelsFeature.utils.ts +48 -36
- package/src/core/rows/coreRowsFeature.types.ts +4 -4
- package/src/core/rows/coreRowsFeature.utils.ts +34 -28
- package/src/core/table/coreTablesFeature.types.ts +6 -2
- package/src/core/table/coreTablesFeature.utils.ts +2 -2
- package/src/features/column-faceting/columnFacetingFeature.types.ts +16 -10
- package/src/features/column-faceting/columnFacetingFeature.utils.ts +26 -18
- package/src/features/column-filtering/columnFilteringFeature.types.ts +21 -11
- package/src/features/column-filtering/columnFilteringFeature.utils.ts +39 -28
- package/src/features/column-grouping/columnGroupingFeature.types.ts +18 -14
- package/src/features/column-grouping/columnGroupingFeature.utils.ts +55 -43
- package/src/features/column-ordering/columnOrderingFeature.types.ts +14 -5
- package/src/features/column-ordering/columnOrderingFeature.utils.ts +30 -23
- package/src/features/column-pinning/columnPinningFeature.types.ts +43 -31
- package/src/features/column-pinning/columnPinningFeature.utils.ts +111 -91
- package/src/features/column-resizing/columnResizingFeature.types.ts +9 -9
- package/src/features/column-resizing/columnResizingFeature.utils.ts +28 -19
- package/src/features/column-sizing/columnSizingFeature.types.ts +19 -12
- package/src/features/column-sizing/columnSizingFeature.utils.ts +52 -41
- package/src/features/column-visibility/columnVisibilityFeature.types.ts +16 -13
- package/src/features/column-visibility/columnVisibilityFeature.utils.ts +54 -42
- package/src/features/global-filtering/globalFilteringFeature.types.ts +10 -5
- package/src/features/global-filtering/globalFilteringFeature.utils.ts +20 -14
- package/src/features/row-expanding/rowExpandingFeature.types.ts +16 -15
- package/src/features/row-expanding/rowExpandingFeature.utils.ts +56 -41
- package/src/features/row-pagination/rowPaginationFeature.types.ts +19 -12
- package/src/features/row-pagination/rowPaginationFeature.utils.ts +49 -32
- package/src/features/row-pinning/rowPinningFeature.types.ts +12 -8
- package/src/features/row-pinning/rowPinningFeature.utils.ts +39 -29
- package/src/features/row-selection/rowSelectionFeature.types.ts +30 -24
- package/src/features/row-selection/rowSelectionFeature.utils.ts +89 -69
- package/src/features/row-sorting/rowSortingFeature.types.ts +10 -8
- package/src/features/row-sorting/rowSortingFeature.utils.ts +61 -44
- package/src/fns/aggregationFns.ts +33 -9
- package/src/fns/filterFns.ts +48 -17
- package/src/helpers/columnHelper.ts +9 -4
- package/src/helpers/tableOptions.ts +12 -9
- package/src/types/ColumnDef.ts +38 -0
- package/src/types/TableOptions.ts +15 -0
- package/src/types/TableState.ts +12 -0
|
@@ -9,13 +9,14 @@ import type { RowSelectionState } from './rowSelectionFeature.types'
|
|
|
9
9
|
// State APIs
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Creates the default row selection state.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
* The feature default is an empty map, meaning no rows are selected. Reset APIs
|
|
15
|
+
* use this value when `defaultState` is `true`.
|
|
15
16
|
*
|
|
16
17
|
* @example
|
|
17
18
|
* ```ts
|
|
18
|
-
* const
|
|
19
|
+
* const selection = getDefaultRowSelectionState()
|
|
19
20
|
* ```
|
|
20
21
|
*/
|
|
21
22
|
export function getDefaultRowSelectionState(): RowSelectionState {
|
|
@@ -23,13 +24,14 @@ export function getDefaultRowSelectionState(): RowSelectionState {
|
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
|
-
*
|
|
27
|
+
* Routes a row selection updater through the table's selection change handler.
|
|
27
28
|
*
|
|
28
|
-
* The updater
|
|
29
|
+
* The updater may be a next selection map or a function of the previous map,
|
|
30
|
+
* matching the instance `table.setRowSelection` behavior.
|
|
29
31
|
*
|
|
30
32
|
* @example
|
|
31
33
|
* ```ts
|
|
32
|
-
* table_setRowSelection(table, (old) => old)
|
|
34
|
+
* table_setRowSelection(table, (old) => ({ ...old, [rowId]: true }))
|
|
33
35
|
* ```
|
|
34
36
|
*/
|
|
35
37
|
export function table_setRowSelection<
|
|
@@ -43,9 +45,10 @@ export function table_setRowSelection<
|
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
/**
|
|
46
|
-
* Resets the
|
|
48
|
+
* Resets `rowSelection` to the configured initial state or feature default.
|
|
47
49
|
*
|
|
48
|
-
*
|
|
50
|
+
* With no argument, the reset clones `table.initialState.rowSelection` when it
|
|
51
|
+
* exists. Passing `true` ignores initial state and resets to `{}`.
|
|
49
52
|
*
|
|
50
53
|
* @example
|
|
51
54
|
* ```ts
|
|
@@ -66,9 +69,10 @@ export function table_resetRowSelection<
|
|
|
66
69
|
// Table APIs
|
|
67
70
|
|
|
68
71
|
/**
|
|
69
|
-
*
|
|
72
|
+
* Selects or deselects every selectable row before grouping.
|
|
70
73
|
*
|
|
71
|
-
*
|
|
74
|
+
* Omitting `value` toggles based on `table_getIsAllRowsSelected(table)`.
|
|
75
|
+
* Deselecting removes matching ids from the existing selection map.
|
|
72
76
|
*
|
|
73
77
|
* @example
|
|
74
78
|
* ```ts
|
|
@@ -107,9 +111,10 @@ export function table_toggleAllRowsSelected<
|
|
|
107
111
|
}
|
|
108
112
|
|
|
109
113
|
/**
|
|
110
|
-
*
|
|
114
|
+
* Selects or deselects every selectable row on the current page.
|
|
111
115
|
*
|
|
112
|
-
*
|
|
116
|
+
* Omitting `value` toggles based on `table_getIsAllPageRowsSelected(table)`.
|
|
117
|
+
* Child rows are included when sub-row selection allows it.
|
|
113
118
|
*
|
|
114
119
|
* @example
|
|
115
120
|
* ```ts
|
|
@@ -137,13 +142,14 @@ export function table_toggleAllPageRowsSelected<
|
|
|
137
142
|
}
|
|
138
143
|
|
|
139
144
|
/**
|
|
140
|
-
*
|
|
145
|
+
* Reads the row model before row selection is projected into selected rows.
|
|
141
146
|
*
|
|
142
|
-
*
|
|
147
|
+
* Selection does not alter the base row pipeline, so this returns the core row
|
|
148
|
+
* model.
|
|
143
149
|
*
|
|
144
150
|
* @example
|
|
145
151
|
* ```ts
|
|
146
|
-
* const
|
|
152
|
+
* const rowsBeforeSelection = table_getPreSelectedRowModel(table)
|
|
147
153
|
* ```
|
|
148
154
|
*/
|
|
149
155
|
export function table_getPreSelectedRowModel<
|
|
@@ -154,13 +160,14 @@ export function table_getPreSelectedRowModel<
|
|
|
154
160
|
}
|
|
155
161
|
|
|
156
162
|
/**
|
|
157
|
-
*
|
|
163
|
+
* Builds a row model containing selected rows from the core row model.
|
|
158
164
|
*
|
|
159
|
-
*
|
|
165
|
+
* If no row ids are selected, an empty row model is returned without walking
|
|
166
|
+
* the rows.
|
|
160
167
|
*
|
|
161
168
|
* @example
|
|
162
169
|
* ```ts
|
|
163
|
-
* const
|
|
170
|
+
* const selectedRows = table_getSelectedRowModel(table)
|
|
164
171
|
* ```
|
|
165
172
|
*/
|
|
166
173
|
export function table_getSelectedRowModel<
|
|
@@ -181,13 +188,14 @@ export function table_getSelectedRowModel<
|
|
|
181
188
|
}
|
|
182
189
|
|
|
183
190
|
/**
|
|
184
|
-
*
|
|
191
|
+
* Builds a row model containing selected rows from the filtered row model.
|
|
185
192
|
*
|
|
186
|
-
*
|
|
193
|
+
* If no row ids are selected, an empty row model is returned without walking
|
|
194
|
+
* the rows.
|
|
187
195
|
*
|
|
188
196
|
* @example
|
|
189
197
|
* ```ts
|
|
190
|
-
* const
|
|
198
|
+
* const selectedRows = table_getFilteredSelectedRowModel(table)
|
|
191
199
|
* ```
|
|
192
200
|
*/
|
|
193
201
|
export function table_getFilteredSelectedRowModel<
|
|
@@ -208,13 +216,14 @@ export function table_getFilteredSelectedRowModel<
|
|
|
208
216
|
}
|
|
209
217
|
|
|
210
218
|
/**
|
|
211
|
-
*
|
|
219
|
+
* Builds a row model containing selected rows from the grouped row model.
|
|
212
220
|
*
|
|
213
|
-
*
|
|
221
|
+
* If no row ids are selected, an empty row model is returned without walking
|
|
222
|
+
* the rows.
|
|
214
223
|
*
|
|
215
224
|
* @example
|
|
216
225
|
* ```ts
|
|
217
|
-
* const
|
|
226
|
+
* const selectedRows = table_getGroupedSelectedRowModel(table)
|
|
218
227
|
* ```
|
|
219
228
|
*/
|
|
220
229
|
export function table_getGroupedSelectedRowModel<
|
|
@@ -235,13 +244,14 @@ export function table_getGroupedSelectedRowModel<
|
|
|
235
244
|
}
|
|
236
245
|
|
|
237
246
|
/**
|
|
238
|
-
*
|
|
247
|
+
* Checks whether every selectable filtered row is selected.
|
|
239
248
|
*
|
|
240
|
-
*
|
|
249
|
+
* The result is false when there are no filtered rows or when selection state is
|
|
250
|
+
* empty.
|
|
241
251
|
*
|
|
242
252
|
* @example
|
|
243
253
|
* ```ts
|
|
244
|
-
* const
|
|
254
|
+
* const allSelected = table_getIsAllRowsSelected(table)
|
|
245
255
|
* ```
|
|
246
256
|
*/
|
|
247
257
|
export function table_getIsAllRowsSelected<
|
|
@@ -269,13 +279,13 @@ export function table_getIsAllRowsSelected<
|
|
|
269
279
|
}
|
|
270
280
|
|
|
271
281
|
/**
|
|
272
|
-
*
|
|
282
|
+
* Checks whether every selectable row on the current page is selected.
|
|
273
283
|
*
|
|
274
|
-
*
|
|
284
|
+
* Non-selectable rows are ignored for this calculation.
|
|
275
285
|
*
|
|
276
286
|
* @example
|
|
277
287
|
* ```ts
|
|
278
|
-
* const
|
|
288
|
+
* const allPageRowsSelected = table_getIsAllPageRowsSelected(table)
|
|
279
289
|
* ```
|
|
280
290
|
*/
|
|
281
291
|
export function table_getIsAllPageRowsSelected<
|
|
@@ -300,13 +310,14 @@ export function table_getIsAllPageRowsSelected<
|
|
|
300
310
|
}
|
|
301
311
|
|
|
302
312
|
/**
|
|
303
|
-
*
|
|
313
|
+
* Checks whether selection is partially applied across filtered rows.
|
|
304
314
|
*
|
|
305
|
-
*
|
|
315
|
+
* The result is true when at least one row id is selected but fewer ids are
|
|
316
|
+
* selected than the current filtered flat row count.
|
|
306
317
|
*
|
|
307
318
|
* @example
|
|
308
319
|
* ```ts
|
|
309
|
-
* const
|
|
320
|
+
* const someRowsSelected = table_getIsSomeRowsSelected(table)
|
|
310
321
|
* ```
|
|
311
322
|
*/
|
|
312
323
|
export function table_getIsSomeRowsSelected<
|
|
@@ -323,13 +334,14 @@ export function table_getIsSomeRowsSelected<
|
|
|
323
334
|
}
|
|
324
335
|
|
|
325
336
|
/**
|
|
326
|
-
*
|
|
337
|
+
* Checks whether the current page has a partial selection.
|
|
327
338
|
*
|
|
328
|
-
* This
|
|
339
|
+
* This is false when all selectable page rows are selected. Otherwise it is true
|
|
340
|
+
* if any selectable page row or descendant is selected.
|
|
329
341
|
*
|
|
330
342
|
* @example
|
|
331
343
|
* ```ts
|
|
332
|
-
* const
|
|
344
|
+
* const somePageRowsSelected = table_getIsSomePageRowsSelected(table)
|
|
333
345
|
* ```
|
|
334
346
|
*/
|
|
335
347
|
export function table_getIsSomePageRowsSelected<
|
|
@@ -345,13 +357,14 @@ export function table_getIsSomePageRowsSelected<
|
|
|
345
357
|
}
|
|
346
358
|
|
|
347
359
|
/**
|
|
348
|
-
*
|
|
360
|
+
* Creates a checkbox-style handler that selects or deselects all rows.
|
|
349
361
|
*
|
|
350
|
-
* The handler
|
|
362
|
+
* The handler reads `event.target.checked`, so it is intended for controls whose
|
|
363
|
+
* checked state means "all rows selected".
|
|
351
364
|
*
|
|
352
365
|
* @example
|
|
353
366
|
* ```ts
|
|
354
|
-
* const
|
|
367
|
+
* const onChange = table_getToggleAllRowsSelectedHandler(table)
|
|
355
368
|
* ```
|
|
356
369
|
*/
|
|
357
370
|
export function table_getToggleAllRowsSelectedHandler<
|
|
@@ -367,13 +380,14 @@ export function table_getToggleAllRowsSelectedHandler<
|
|
|
367
380
|
}
|
|
368
381
|
|
|
369
382
|
/**
|
|
370
|
-
*
|
|
383
|
+
* Creates a checkbox-style handler that selects or deselects current page rows.
|
|
371
384
|
*
|
|
372
|
-
* The handler
|
|
385
|
+
* The handler reads `event.target.checked`, so it is intended for controls whose
|
|
386
|
+
* checked state means "all page rows selected".
|
|
373
387
|
*
|
|
374
388
|
* @example
|
|
375
389
|
* ```ts
|
|
376
|
-
* const
|
|
390
|
+
* const onChange = table_getToggleAllPageRowsSelectedHandler(table)
|
|
377
391
|
* ```
|
|
378
392
|
*/
|
|
379
393
|
export function table_getToggleAllPageRowsSelectedHandler<
|
|
@@ -391,9 +405,10 @@ export function table_getToggleAllPageRowsSelectedHandler<
|
|
|
391
405
|
// Row APIs
|
|
392
406
|
|
|
393
407
|
/**
|
|
394
|
-
*
|
|
408
|
+
* Selects or deselects this row.
|
|
395
409
|
*
|
|
396
|
-
*
|
|
410
|
+
* Omitting `value` toggles the row. Child rows are selected recursively unless
|
|
411
|
+
* `opts.selectChildren` is `false` or sub-row selection is disabled.
|
|
397
412
|
*
|
|
398
413
|
* @example
|
|
399
414
|
* ```ts
|
|
@@ -434,13 +449,13 @@ export function row_toggleSelected<
|
|
|
434
449
|
}
|
|
435
450
|
|
|
436
451
|
/**
|
|
437
|
-
*
|
|
452
|
+
* Checks whether this row id is selected in `state.rowSelection`.
|
|
438
453
|
*
|
|
439
|
-
*
|
|
454
|
+
* Missing row ids are treated as not selected.
|
|
440
455
|
*
|
|
441
456
|
* @example
|
|
442
457
|
* ```ts
|
|
443
|
-
* const
|
|
458
|
+
* const selected = row_getIsSelected(row)
|
|
444
459
|
* ```
|
|
445
460
|
*/
|
|
446
461
|
export function row_getIsSelected<
|
|
@@ -451,13 +466,13 @@ export function row_getIsSelected<
|
|
|
451
466
|
}
|
|
452
467
|
|
|
453
468
|
/**
|
|
454
|
-
*
|
|
469
|
+
* Checks whether some, but not all, selectable descendants are selected.
|
|
455
470
|
*
|
|
456
|
-
* This
|
|
471
|
+
* This supports indeterminate selection UI for parent rows.
|
|
457
472
|
*
|
|
458
473
|
* @example
|
|
459
474
|
* ```ts
|
|
460
|
-
* const
|
|
475
|
+
* const partial = row_getIsSomeSelected(row)
|
|
461
476
|
* ```
|
|
462
477
|
*/
|
|
463
478
|
export function row_getIsSomeSelected<
|
|
@@ -468,13 +483,13 @@ export function row_getIsSomeSelected<
|
|
|
468
483
|
}
|
|
469
484
|
|
|
470
485
|
/**
|
|
471
|
-
*
|
|
486
|
+
* Checks whether all selectable descendants are selected.
|
|
472
487
|
*
|
|
473
|
-
*
|
|
488
|
+
* Rows without selectable descendants return false.
|
|
474
489
|
*
|
|
475
490
|
* @example
|
|
476
491
|
* ```ts
|
|
477
|
-
* const
|
|
492
|
+
* const allChildrenSelected = row_getIsAllSubRowsSelected(row)
|
|
478
493
|
* ```
|
|
479
494
|
*/
|
|
480
495
|
export function row_getIsAllSubRowsSelected<
|
|
@@ -485,13 +500,14 @@ export function row_getIsAllSubRowsSelected<
|
|
|
485
500
|
}
|
|
486
501
|
|
|
487
502
|
/**
|
|
488
|
-
*
|
|
503
|
+
* Checks whether this row can be selected.
|
|
489
504
|
*
|
|
490
|
-
*
|
|
505
|
+
* `options.enableRowSelection` may be a boolean or a row predicate; it defaults
|
|
506
|
+
* to `true`.
|
|
491
507
|
*
|
|
492
508
|
* @example
|
|
493
509
|
* ```ts
|
|
494
|
-
* const
|
|
510
|
+
* const canSelect = row_getCanSelect(row)
|
|
495
511
|
* ```
|
|
496
512
|
*/
|
|
497
513
|
export function row_getCanSelect<
|
|
@@ -507,13 +523,14 @@ export function row_getCanSelect<
|
|
|
507
523
|
}
|
|
508
524
|
|
|
509
525
|
/**
|
|
510
|
-
*
|
|
526
|
+
* Checks whether selecting this row should also select its subRows.
|
|
511
527
|
*
|
|
512
|
-
*
|
|
528
|
+
* `options.enableSubRowSelection` may be a boolean or a row predicate; it
|
|
529
|
+
* defaults to `true`.
|
|
513
530
|
*
|
|
514
531
|
* @example
|
|
515
532
|
* ```ts
|
|
516
|
-
* const
|
|
533
|
+
* const canSelectChildren = row_getCanSelectSubRows(row)
|
|
517
534
|
* ```
|
|
518
535
|
*/
|
|
519
536
|
export function row_getCanSelectSubRows<
|
|
@@ -529,13 +546,14 @@ export function row_getCanSelectSubRows<
|
|
|
529
546
|
}
|
|
530
547
|
|
|
531
548
|
/**
|
|
532
|
-
*
|
|
549
|
+
* Checks whether this row can be selected alongside other rows.
|
|
533
550
|
*
|
|
534
|
-
*
|
|
551
|
+
* `options.enableMultiRowSelection` may be a boolean or a row predicate; it
|
|
552
|
+
* defaults to `true`.
|
|
535
553
|
*
|
|
536
554
|
* @example
|
|
537
555
|
* ```ts
|
|
538
|
-
* const
|
|
556
|
+
* const canMultiSelect = row_getCanMultiSelect(row)
|
|
539
557
|
* ```
|
|
540
558
|
*/
|
|
541
559
|
export function row_getCanMultiSelect<
|
|
@@ -551,13 +569,14 @@ export function row_getCanMultiSelect<
|
|
|
551
569
|
}
|
|
552
570
|
|
|
553
571
|
/**
|
|
554
|
-
*
|
|
572
|
+
* Creates a checkbox-style handler that selects or deselects this row.
|
|
555
573
|
*
|
|
556
|
-
* The handler is
|
|
574
|
+
* The handler is a no-op when the row cannot be selected and reads
|
|
575
|
+
* `event.target.checked`.
|
|
557
576
|
*
|
|
558
577
|
* @example
|
|
559
578
|
* ```ts
|
|
560
|
-
* const
|
|
579
|
+
* const onChange = row_getToggleSelectedHandler(row)
|
|
561
580
|
* ```
|
|
562
581
|
*/
|
|
563
582
|
export function row_getToggleSelectedHandler<
|
|
@@ -608,11 +627,12 @@ const mutateRowIsSelected = <
|
|
|
608
627
|
/**
|
|
609
628
|
* Builds a row model containing rows selected by the current row selection state.
|
|
610
629
|
*
|
|
611
|
-
* The result is derived from the supplied row model, so selected ids absent from
|
|
630
|
+
* The result is derived from the supplied row model, so selected ids absent from
|
|
631
|
+
* that model are not materialized as rows.
|
|
612
632
|
*
|
|
613
633
|
* @example
|
|
614
634
|
* ```ts
|
|
615
|
-
* const selectedRows = selectRowsFn(
|
|
635
|
+
* const selectedRows = selectRowsFn(rowModel)
|
|
616
636
|
* ```
|
|
617
637
|
*/
|
|
618
638
|
export function selectRowsFn<
|
|
@@ -663,7 +683,7 @@ export function selectRowsFn<
|
|
|
663
683
|
*
|
|
664
684
|
* @example
|
|
665
685
|
* ```ts
|
|
666
|
-
* const selected = isRowSelected(row
|
|
686
|
+
* const selected = isRowSelected(row)
|
|
667
687
|
* ```
|
|
668
688
|
*/
|
|
669
689
|
export function isRowSelected<
|
|
@@ -680,7 +700,7 @@ export function isRowSelected<
|
|
|
680
700
|
*
|
|
681
701
|
* @example
|
|
682
702
|
* ```ts
|
|
683
|
-
* const selectedState = isSubRowSelected(row
|
|
703
|
+
* const selectedState = isSubRowSelected(row)
|
|
684
704
|
* ```
|
|
685
705
|
*/
|
|
686
706
|
export function isSubRowSelected<
|
|
@@ -115,7 +115,7 @@ export interface Column_RowSorting<
|
|
|
115
115
|
*/
|
|
116
116
|
getFirstSortDir: () => SortDirection
|
|
117
117
|
/**
|
|
118
|
-
*
|
|
118
|
+
* Reads this column's current sort direction, or `false` when unsorted.
|
|
119
119
|
*/
|
|
120
120
|
getIsSorted: () => false | SortDirection
|
|
121
121
|
/**
|
|
@@ -123,7 +123,7 @@ export interface Column_RowSorting<
|
|
|
123
123
|
*/
|
|
124
124
|
getNextSortingOrder: () => SortDirection | false
|
|
125
125
|
/**
|
|
126
|
-
*
|
|
126
|
+
* Finds this column's position in the ordered sorting state.
|
|
127
127
|
*/
|
|
128
128
|
getSortIndex: () => number
|
|
129
129
|
/**
|
|
@@ -131,7 +131,7 @@ export interface Column_RowSorting<
|
|
|
131
131
|
*/
|
|
132
132
|
getSortFn: () => SortFn<TFeatures, TData>
|
|
133
133
|
/**
|
|
134
|
-
*
|
|
134
|
+
* Creates a header/control handler that toggles this column's sorting state.
|
|
135
135
|
*/
|
|
136
136
|
getToggleSortingHandler: () => undefined | ((event: unknown) => void)
|
|
137
137
|
/**
|
|
@@ -142,7 +142,7 @@ export interface Column_RowSorting<
|
|
|
142
142
|
|
|
143
143
|
export interface TableOptions_RowSorting {
|
|
144
144
|
/**
|
|
145
|
-
*
|
|
145
|
+
* Allows multi-sort toggles to remove a column from sorting state.
|
|
146
146
|
*/
|
|
147
147
|
enableMultiRemove?: boolean
|
|
148
148
|
/**
|
|
@@ -188,11 +188,13 @@ export interface Table_RowSorting<
|
|
|
188
188
|
TData extends RowData,
|
|
189
189
|
> {
|
|
190
190
|
/**
|
|
191
|
-
* Resets
|
|
191
|
+
* Resets `sorting` to `initialState.sorting`.
|
|
192
|
+
*
|
|
193
|
+
* Pass `true` to ignore initial state and reset to `[]`.
|
|
192
194
|
*/
|
|
193
195
|
resetSorting: (defaultState?: boolean) => void
|
|
194
196
|
/**
|
|
195
|
-
*
|
|
197
|
+
* Updates sorting state with a next ordered array or updater function.
|
|
196
198
|
*/
|
|
197
199
|
setSorting: (updater: Updater<SortingState>) => void
|
|
198
200
|
}
|
|
@@ -202,11 +204,11 @@ export interface Table_RowModels_Sorted<
|
|
|
202
204
|
TData extends RowData,
|
|
203
205
|
> {
|
|
204
206
|
/**
|
|
205
|
-
*
|
|
207
|
+
* Reads the row model immediately before sorting.
|
|
206
208
|
*/
|
|
207
209
|
getPreSortedRowModel: () => RowModel<TFeatures, TData>
|
|
208
210
|
/**
|
|
209
|
-
*
|
|
211
|
+
* Resolves the row model after sorting has been applied.
|
|
210
212
|
*/
|
|
211
213
|
getSortedRowModel: () => RowModel<TFeatures, TData>
|
|
212
214
|
}
|