@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
|
@@ -12,13 +12,14 @@ import type {
|
|
|
12
12
|
// State Utils
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Creates the default row pinning state.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
17
|
+
* Both pinning regions start empty. Reset APIs use this value when
|
|
18
|
+
* `defaultState` is `true`.
|
|
18
19
|
*
|
|
19
20
|
* @example
|
|
20
21
|
* ```ts
|
|
21
|
-
* const
|
|
22
|
+
* const pinning = getDefaultRowPinningState()
|
|
22
23
|
* ```
|
|
23
24
|
*/
|
|
24
25
|
export function getDefaultRowPinningState(): RowPinningState {
|
|
@@ -29,13 +30,14 @@ export function getDefaultRowPinningState(): RowPinningState {
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
|
-
*
|
|
33
|
+
* Routes a row pinning updater through the table's row-pinning change handler.
|
|
33
34
|
*
|
|
34
|
-
* The updater
|
|
35
|
+
* The updater may be a next `{ top, bottom }` state or a function of the
|
|
36
|
+
* previous state, matching the instance `table.setRowPinning` behavior.
|
|
35
37
|
*
|
|
36
38
|
* @example
|
|
37
39
|
* ```ts
|
|
38
|
-
* table_setRowPinning(table, (old) => old)
|
|
40
|
+
* table_setRowPinning(table, (old) => ({ ...old, top: [rowId] }))
|
|
39
41
|
* ```
|
|
40
42
|
*/
|
|
41
43
|
export function table_setRowPinning<
|
|
@@ -49,9 +51,11 @@ export function table_setRowPinning<
|
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
/**
|
|
52
|
-
* Resets the
|
|
54
|
+
* Resets `rowPinning` to the configured initial state or feature default.
|
|
53
55
|
*
|
|
54
|
-
*
|
|
56
|
+
* With no argument, the reset clones `table.initialState.rowPinning` when it
|
|
57
|
+
* exists. Passing `true` ignores initial state and resets to empty top/bottom
|
|
58
|
+
* arrays.
|
|
55
59
|
*
|
|
56
60
|
* @example
|
|
57
61
|
* ```ts
|
|
@@ -76,13 +80,14 @@ export function table_resetRowPinning<
|
|
|
76
80
|
// Table Utils
|
|
77
81
|
|
|
78
82
|
/**
|
|
79
|
-
*
|
|
83
|
+
* Checks whether any rows are pinned.
|
|
80
84
|
*
|
|
81
|
-
*
|
|
85
|
+
* Omit `position` to check both regions, or pass `'top'`/`'bottom'` to inspect
|
|
86
|
+
* one region.
|
|
82
87
|
*
|
|
83
88
|
* @example
|
|
84
89
|
* ```ts
|
|
85
|
-
* const
|
|
90
|
+
* const hasPinnedRows = table_getIsSomeRowsPinned(table)
|
|
86
91
|
* ```
|
|
87
92
|
*/
|
|
88
93
|
export function table_getIsSomeRowsPinned<
|
|
@@ -134,13 +139,14 @@ function table_getPinnedRows<
|
|
|
134
139
|
}
|
|
135
140
|
|
|
136
141
|
/**
|
|
137
|
-
*
|
|
142
|
+
* Resolves the visible rows pinned to the top region.
|
|
138
143
|
*
|
|
139
|
-
*
|
|
144
|
+
* The result follows `state.rowPinning.top` order and marks each row with
|
|
145
|
+
* `position = 'top'`.
|
|
140
146
|
*
|
|
141
147
|
* @example
|
|
142
148
|
* ```ts
|
|
143
|
-
* const
|
|
149
|
+
* const rows = table_getTopRows(table)
|
|
144
150
|
* ```
|
|
145
151
|
*/
|
|
146
152
|
export function table_getTopRows<
|
|
@@ -151,13 +157,14 @@ export function table_getTopRows<
|
|
|
151
157
|
}
|
|
152
158
|
|
|
153
159
|
/**
|
|
154
|
-
*
|
|
160
|
+
* Resolves the visible rows pinned to the bottom region.
|
|
155
161
|
*
|
|
156
|
-
*
|
|
162
|
+
* The result follows `state.rowPinning.bottom` order and marks each row with
|
|
163
|
+
* `position = 'bottom'`.
|
|
157
164
|
*
|
|
158
165
|
* @example
|
|
159
166
|
* ```ts
|
|
160
|
-
* const
|
|
167
|
+
* const rows = table_getBottomRows(table)
|
|
161
168
|
* ```
|
|
162
169
|
*/
|
|
163
170
|
export function table_getBottomRows<
|
|
@@ -168,13 +175,14 @@ export function table_getBottomRows<
|
|
|
168
175
|
}
|
|
169
176
|
|
|
170
177
|
/**
|
|
171
|
-
*
|
|
178
|
+
* Resolves rows that are not pinned to top or bottom.
|
|
172
179
|
*
|
|
173
|
-
*
|
|
180
|
+
* The current row model is filtered by `state.rowPinning.top` and
|
|
181
|
+
* `state.rowPinning.bottom`.
|
|
174
182
|
*
|
|
175
183
|
* @example
|
|
176
184
|
* ```ts
|
|
177
|
-
* const
|
|
185
|
+
* const rows = table_getCenterRows(table)
|
|
178
186
|
* ```
|
|
179
187
|
*/
|
|
180
188
|
export function table_getCenterRows<
|
|
@@ -192,13 +200,14 @@ export function table_getCenterRows<
|
|
|
192
200
|
// Row Utils
|
|
193
201
|
|
|
194
202
|
/**
|
|
195
|
-
*
|
|
203
|
+
* Checks whether this row can be pinned.
|
|
196
204
|
*
|
|
197
|
-
*
|
|
205
|
+
* `options.enableRowPinning` may be a boolean or a row predicate; it defaults
|
|
206
|
+
* to `true`.
|
|
198
207
|
*
|
|
199
208
|
* @example
|
|
200
209
|
* ```ts
|
|
201
|
-
* const
|
|
210
|
+
* const canPin = row_getCanPin(row)
|
|
202
211
|
* ```
|
|
203
212
|
*/
|
|
204
213
|
export function row_getCanPin<
|
|
@@ -213,13 +222,14 @@ export function row_getCanPin<
|
|
|
213
222
|
}
|
|
214
223
|
|
|
215
224
|
/**
|
|
216
|
-
*
|
|
225
|
+
* Reads this row's current pinning region.
|
|
217
226
|
*
|
|
218
|
-
*
|
|
227
|
+
* Rows listed in `state.rowPinning.top` return `'top'`, rows listed in
|
|
228
|
+
* `bottom` return `'bottom'`, and unpinned rows return `false`.
|
|
219
229
|
*
|
|
220
230
|
* @example
|
|
221
231
|
* ```ts
|
|
222
|
-
* const
|
|
232
|
+
* const position = row_getIsPinned(row)
|
|
223
233
|
* ```
|
|
224
234
|
*/
|
|
225
235
|
export function row_getIsPinned<
|
|
@@ -237,13 +247,13 @@ export function row_getIsPinned<
|
|
|
237
247
|
}
|
|
238
248
|
|
|
239
249
|
/**
|
|
240
|
-
*
|
|
250
|
+
* Finds this row's visible index within its pinned region.
|
|
241
251
|
*
|
|
242
|
-
*
|
|
252
|
+
* Unpinned rows return `-1`.
|
|
243
253
|
*
|
|
244
254
|
* @example
|
|
245
255
|
* ```ts
|
|
246
|
-
* const
|
|
256
|
+
* const index = row_getPinnedIndex(row)
|
|
247
257
|
* ```
|
|
248
258
|
*/
|
|
249
259
|
export function row_getPinnedIndex<
|
|
@@ -14,18 +14,22 @@ export interface TableOptions_RowSelection<
|
|
|
14
14
|
TData extends RowData,
|
|
15
15
|
> {
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* Allows rows to be selected alongside other rows.
|
|
18
|
+
*
|
|
19
|
+
* Provide a predicate to decide per row. Defaults to `true`.
|
|
19
20
|
*/
|
|
20
21
|
enableMultiRowSelection?: boolean | ((row: Row<TFeatures, TData>) => boolean)
|
|
21
22
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
23
|
+
* Allows rows to be selected.
|
|
24
|
+
*
|
|
25
|
+
* Provide a predicate to decide per row. Defaults to `true`.
|
|
24
26
|
*/
|
|
25
27
|
enableRowSelection?: boolean | ((row: Row<TFeatures, TData>) => boolean)
|
|
26
28
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
+
* Controls whether selecting a parent row also selects its subRows.
|
|
30
|
+
*
|
|
31
|
+
* Provide a predicate to decide per row. This is most useful with expanding or
|
|
32
|
+
* grouping features and defaults to `true`.
|
|
29
33
|
*/
|
|
30
34
|
enableSubRowSelection?: boolean | ((row: Row<TFeatures, TData>) => boolean)
|
|
31
35
|
/**
|
|
@@ -49,31 +53,31 @@ export interface TableOptions_RowSelection<
|
|
|
49
53
|
|
|
50
54
|
export interface Row_RowSelection {
|
|
51
55
|
/**
|
|
52
|
-
*
|
|
56
|
+
* Checks whether this row can be selected alongside other rows.
|
|
53
57
|
*/
|
|
54
58
|
getCanMultiSelect: () => boolean
|
|
55
59
|
/**
|
|
56
|
-
*
|
|
60
|
+
* Checks whether this row can currently be selected.
|
|
57
61
|
*/
|
|
58
62
|
getCanSelect: () => boolean
|
|
59
63
|
/**
|
|
60
|
-
*
|
|
64
|
+
* Checks whether selecting this row should also select its subRows.
|
|
61
65
|
*/
|
|
62
66
|
getCanSelectSubRows: () => boolean
|
|
63
67
|
/**
|
|
64
|
-
*
|
|
68
|
+
* Checks whether all selectable descendants are selected.
|
|
65
69
|
*/
|
|
66
70
|
getIsAllSubRowsSelected: () => boolean
|
|
67
71
|
/**
|
|
68
|
-
*
|
|
72
|
+
* Checks whether this row id is selected.
|
|
69
73
|
*/
|
|
70
74
|
getIsSelected: () => boolean
|
|
71
75
|
/**
|
|
72
|
-
*
|
|
76
|
+
* Checks whether some selectable descendants are selected.
|
|
73
77
|
*/
|
|
74
78
|
getIsSomeSelected: () => boolean
|
|
75
79
|
/**
|
|
76
|
-
*
|
|
80
|
+
* Creates a checkbox-style handler that toggles this row's selected state.
|
|
77
81
|
*/
|
|
78
82
|
getToggleSelectedHandler: () => (event: unknown) => void
|
|
79
83
|
/**
|
|
@@ -87,27 +91,27 @@ export interface Table_RowSelection<
|
|
|
87
91
|
TData extends RowData,
|
|
88
92
|
> {
|
|
89
93
|
/**
|
|
90
|
-
*
|
|
94
|
+
* Builds a selected-row model from rows after filtering.
|
|
91
95
|
*/
|
|
92
96
|
getFilteredSelectedRowModel: () => RowModel<TFeatures, TData>
|
|
93
97
|
/**
|
|
94
|
-
*
|
|
98
|
+
* Builds a selected-row model from rows after grouping.
|
|
95
99
|
*/
|
|
96
100
|
getGroupedSelectedRowModel: () => RowModel<TFeatures, TData>
|
|
97
101
|
/**
|
|
98
|
-
*
|
|
102
|
+
* Checks whether every selectable row on the current page is selected.
|
|
99
103
|
*/
|
|
100
104
|
getIsAllPageRowsSelected: () => boolean
|
|
101
105
|
/**
|
|
102
|
-
*
|
|
106
|
+
* Checks whether every selectable filtered row is selected.
|
|
103
107
|
*/
|
|
104
108
|
getIsAllRowsSelected: () => boolean
|
|
105
109
|
/**
|
|
106
|
-
*
|
|
110
|
+
* Checks whether the current page has a partial row selection.
|
|
107
111
|
*/
|
|
108
112
|
getIsSomePageRowsSelected: () => boolean
|
|
109
113
|
/**
|
|
110
|
-
*
|
|
114
|
+
* Checks whether filtered rows have a partial row selection.
|
|
111
115
|
*/
|
|
112
116
|
getIsSomeRowsSelected: () => boolean
|
|
113
117
|
/**
|
|
@@ -115,23 +119,25 @@ export interface Table_RowSelection<
|
|
|
115
119
|
*/
|
|
116
120
|
getPreSelectedRowModel: () => RowModel<TFeatures, TData>
|
|
117
121
|
/**
|
|
118
|
-
*
|
|
122
|
+
* Builds a selected-row model from the core row model.
|
|
119
123
|
*/
|
|
120
124
|
getSelectedRowModel: () => RowModel<TFeatures, TData>
|
|
121
125
|
/**
|
|
122
|
-
*
|
|
126
|
+
* Creates a checkbox-style handler that toggles all current-page rows.
|
|
123
127
|
*/
|
|
124
128
|
getToggleAllPageRowsSelectedHandler: () => (event: unknown) => void
|
|
125
129
|
/**
|
|
126
|
-
*
|
|
130
|
+
* Creates a checkbox-style handler that toggles all selectable rows.
|
|
127
131
|
*/
|
|
128
132
|
getToggleAllRowsSelectedHandler: () => (event: unknown) => void
|
|
129
133
|
/**
|
|
130
|
-
* Resets
|
|
134
|
+
* Resets `rowSelection` to `initialState.rowSelection`.
|
|
135
|
+
*
|
|
136
|
+
* Pass `true` to ignore initial state and reset to `{}`.
|
|
131
137
|
*/
|
|
132
138
|
resetRowSelection: (defaultState?: boolean) => void
|
|
133
139
|
/**
|
|
134
|
-
*
|
|
140
|
+
* Updates row selection state with a next map or updater function.
|
|
135
141
|
*/
|
|
136
142
|
setRowSelection: (updater: Updater<RowSelectionState>) => void
|
|
137
143
|
/**
|