@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
|
@@ -13,13 +13,14 @@ import type { Header_Header } from './coreHeadersFeature.types'
|
|
|
13
13
|
import type { Column } from '../../types/Column'
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Walks a header tree and collects all descendant leaf headers.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
18
|
+
* The header itself is included after its descendants, matching the recursive
|
|
19
|
+
* shape used by nested header groups.
|
|
19
20
|
*
|
|
20
21
|
* @example
|
|
21
22
|
* ```ts
|
|
22
|
-
* const
|
|
23
|
+
* const leafHeaders = header_getLeafHeaders(header)
|
|
23
24
|
* ```
|
|
24
25
|
*/
|
|
25
26
|
export function header_getLeafHeaders<
|
|
@@ -42,13 +43,13 @@ export function header_getLeafHeaders<
|
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
/**
|
|
45
|
-
*
|
|
46
|
+
* Builds the render context passed to a column's `header` or `footer` template.
|
|
46
47
|
*
|
|
47
|
-
*
|
|
48
|
+
* The context contains the header, its column, and the owning table instance.
|
|
48
49
|
*
|
|
49
50
|
* @example
|
|
50
51
|
* ```ts
|
|
51
|
-
* const
|
|
52
|
+
* const context = header_getContext(header)
|
|
52
53
|
* ```
|
|
53
54
|
*/
|
|
54
55
|
export function header_getContext<
|
|
@@ -64,13 +65,14 @@ export function header_getContext<
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
/**
|
|
67
|
-
*
|
|
68
|
+
* Builds visible header groups for the current column tree.
|
|
68
69
|
*
|
|
69
|
-
*
|
|
70
|
+
* Column visibility and pinning are applied before groups are built. When no
|
|
71
|
+
* columns are pinned, the fast path skips pin partitioning.
|
|
70
72
|
*
|
|
71
73
|
* @example
|
|
72
74
|
* ```ts
|
|
73
|
-
* const
|
|
75
|
+
* const headerGroups = table_getHeaderGroups(table)
|
|
74
76
|
* ```
|
|
75
77
|
*/
|
|
76
78
|
export function table_getHeaderGroups<
|
|
@@ -127,13 +129,14 @@ export function table_getHeaderGroups<
|
|
|
127
129
|
}
|
|
128
130
|
|
|
129
131
|
/**
|
|
130
|
-
*
|
|
132
|
+
* Builds footer groups by reversing the current header groups.
|
|
131
133
|
*
|
|
132
|
-
*
|
|
134
|
+
* Footer rendering uses the same header objects and grouping structure, but
|
|
135
|
+
* renders them from leaf level back toward the root.
|
|
133
136
|
*
|
|
134
137
|
* @example
|
|
135
138
|
* ```ts
|
|
136
|
-
* const
|
|
139
|
+
* const footerGroups = table_getFooterGroups(table)
|
|
137
140
|
* ```
|
|
138
141
|
*/
|
|
139
142
|
export function table_getFooterGroups<
|
|
@@ -145,13 +148,14 @@ export function table_getFooterGroups<
|
|
|
145
148
|
}
|
|
146
149
|
|
|
147
150
|
/**
|
|
148
|
-
*
|
|
151
|
+
* Flattens every header from every header group into one array.
|
|
149
152
|
*
|
|
150
|
-
*
|
|
153
|
+
* The result includes parent headers and placeholder headers, in header-group
|
|
154
|
+
* order from top to bottom.
|
|
151
155
|
*
|
|
152
156
|
* @example
|
|
153
157
|
* ```ts
|
|
154
|
-
* const
|
|
158
|
+
* const flatHeaders = table_getFlatHeaders(table)
|
|
155
159
|
* ```
|
|
156
160
|
*/
|
|
157
161
|
export function table_getFlatHeaders<
|
|
@@ -170,13 +174,14 @@ export function table_getFlatHeaders<
|
|
|
170
174
|
}
|
|
171
175
|
|
|
172
176
|
/**
|
|
173
|
-
*
|
|
177
|
+
* Collects only the leaf headers from the current header tree.
|
|
174
178
|
*
|
|
175
|
-
*
|
|
179
|
+
* Parent/group headers are skipped, making the result suitable for rendering
|
|
180
|
+
* one header per visible leaf column.
|
|
176
181
|
*
|
|
177
182
|
* @example
|
|
178
183
|
* ```ts
|
|
179
|
-
* const
|
|
184
|
+
* const leafHeaders = table_getLeafHeaders(table)
|
|
180
185
|
* ```
|
|
181
186
|
*/
|
|
182
187
|
export function table_getLeafHeaders<
|
|
@@ -5,13 +5,14 @@ import type { RowData } from '../../types/type-utils'
|
|
|
5
5
|
import type { RowModel } from './coreRowModelsFeature.types'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Resolves the table's unmodified core row model.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* The factory is created once per table, either from `options._rowModels.coreRowModel`
|
|
11
|
+
* or the built-in `createCoreRowModel()`, then reused for later calls.
|
|
11
12
|
*
|
|
12
13
|
* @example
|
|
13
14
|
* ```ts
|
|
14
|
-
* const
|
|
15
|
+
* const coreRows = table_getCoreRowModel(table)
|
|
15
16
|
* ```
|
|
16
17
|
*/
|
|
17
18
|
export function table_getCoreRowModel<
|
|
@@ -28,13 +29,14 @@ export function table_getCoreRowModel<
|
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
|
-
*
|
|
32
|
+
* Reads the row model immediately before column/global filtering.
|
|
32
33
|
*
|
|
33
|
-
*
|
|
34
|
+
* Filtering is the first derived row-model stage, so this currently aliases
|
|
35
|
+
* `table.getCoreRowModel()`.
|
|
34
36
|
*
|
|
35
37
|
* @example
|
|
36
38
|
* ```ts
|
|
37
|
-
* const
|
|
39
|
+
* const rowsBeforeFiltering = table_getPreFilteredRowModel(table)
|
|
38
40
|
* ```
|
|
39
41
|
*/
|
|
40
42
|
export function table_getPreFilteredRowModel<
|
|
@@ -45,13 +47,15 @@ export function table_getPreFilteredRowModel<
|
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
/**
|
|
48
|
-
*
|
|
50
|
+
* Resolves the row model after column and global filtering.
|
|
49
51
|
*
|
|
50
|
-
*
|
|
52
|
+
* When `manualFiltering` is enabled, or no filtered row-model factory was
|
|
53
|
+
* registered, this returns the pre-filtered row model because filtering is
|
|
54
|
+
* expected to happen outside the table.
|
|
51
55
|
*
|
|
52
56
|
* @example
|
|
53
57
|
* ```ts
|
|
54
|
-
* const
|
|
58
|
+
* const filteredRows = table_getFilteredRowModel(table)
|
|
55
59
|
* ```
|
|
56
60
|
*/
|
|
57
61
|
export function table_getFilteredRowModel<
|
|
@@ -71,13 +75,13 @@ export function table_getFilteredRowModel<
|
|
|
71
75
|
}
|
|
72
76
|
|
|
73
77
|
/**
|
|
74
|
-
*
|
|
78
|
+
* Reads the row model immediately before grouping.
|
|
75
79
|
*
|
|
76
|
-
*
|
|
80
|
+
* Grouping runs after filtering, so this aliases `table.getFilteredRowModel()`.
|
|
77
81
|
*
|
|
78
82
|
* @example
|
|
79
83
|
* ```ts
|
|
80
|
-
* const
|
|
84
|
+
* const rowsBeforeGrouping = table_getPreGroupedRowModel(table)
|
|
81
85
|
* ```
|
|
82
86
|
*/
|
|
83
87
|
export function table_getPreGroupedRowModel<
|
|
@@ -88,13 +92,14 @@ export function table_getPreGroupedRowModel<
|
|
|
88
92
|
}
|
|
89
93
|
|
|
90
94
|
/**
|
|
91
|
-
*
|
|
95
|
+
* Resolves the row model after grouping has produced grouped and aggregated rows.
|
|
92
96
|
*
|
|
93
|
-
*
|
|
97
|
+
* When `manualGrouping` is enabled, or no grouped row-model factory was
|
|
98
|
+
* registered, this returns the pre-grouped row model unchanged.
|
|
94
99
|
*
|
|
95
100
|
* @example
|
|
96
101
|
* ```ts
|
|
97
|
-
* const
|
|
102
|
+
* const groupedRows = table_getGroupedRowModel(table)
|
|
98
103
|
* ```
|
|
99
104
|
*/
|
|
100
105
|
export function table_getGroupedRowModel<
|
|
@@ -114,13 +119,13 @@ export function table_getGroupedRowModel<
|
|
|
114
119
|
}
|
|
115
120
|
|
|
116
121
|
/**
|
|
117
|
-
*
|
|
122
|
+
* Reads the row model immediately before sorting.
|
|
118
123
|
*
|
|
119
|
-
*
|
|
124
|
+
* Sorting runs after grouping, so this aliases `table.getGroupedRowModel()`.
|
|
120
125
|
*
|
|
121
126
|
* @example
|
|
122
127
|
* ```ts
|
|
123
|
-
* const
|
|
128
|
+
* const rowsBeforeSorting = table_getPreSortedRowModel(table)
|
|
124
129
|
* ```
|
|
125
130
|
*/
|
|
126
131
|
export function table_getPreSortedRowModel<
|
|
@@ -131,13 +136,15 @@ export function table_getPreSortedRowModel<
|
|
|
131
136
|
}
|
|
132
137
|
|
|
133
138
|
/**
|
|
134
|
-
*
|
|
139
|
+
* Resolves the row model after sorting has been applied.
|
|
135
140
|
*
|
|
136
|
-
*
|
|
141
|
+
* When `manualSorting` is enabled, or no sorted row-model factory was
|
|
142
|
+
* registered, this returns the pre-sorted row model because sorted data is
|
|
143
|
+
* expected to be supplied by the caller.
|
|
137
144
|
*
|
|
138
145
|
* @example
|
|
139
146
|
* ```ts
|
|
140
|
-
* const
|
|
147
|
+
* const sortedRows = table_getSortedRowModel(table)
|
|
141
148
|
* ```
|
|
142
149
|
*/
|
|
143
150
|
export function table_getSortedRowModel<
|
|
@@ -157,13 +164,13 @@ export function table_getSortedRowModel<
|
|
|
157
164
|
}
|
|
158
165
|
|
|
159
166
|
/**
|
|
160
|
-
*
|
|
167
|
+
* Reads the row model immediately before row expansion.
|
|
161
168
|
*
|
|
162
|
-
*
|
|
169
|
+
* Expansion runs after sorting, so this aliases `table.getSortedRowModel()`.
|
|
163
170
|
*
|
|
164
171
|
* @example
|
|
165
172
|
* ```ts
|
|
166
|
-
* const
|
|
173
|
+
* const rowsBeforeExpansion = table_getPreExpandedRowModel(table)
|
|
167
174
|
* ```
|
|
168
175
|
*/
|
|
169
176
|
export function table_getPreExpandedRowModel<
|
|
@@ -174,13 +181,14 @@ export function table_getPreExpandedRowModel<
|
|
|
174
181
|
}
|
|
175
182
|
|
|
176
183
|
/**
|
|
177
|
-
*
|
|
184
|
+
* Resolves the row model after expanded rows have been flattened into view.
|
|
178
185
|
*
|
|
179
|
-
*
|
|
186
|
+
* When `manualExpanding` is enabled, or no expanded row-model factory was
|
|
187
|
+
* registered, this returns the pre-expanded row model unchanged.
|
|
180
188
|
*
|
|
181
189
|
* @example
|
|
182
190
|
* ```ts
|
|
183
|
-
* const
|
|
191
|
+
* const expandedRows = table_getExpandedRowModel(table)
|
|
184
192
|
* ```
|
|
185
193
|
*/
|
|
186
194
|
export function table_getExpandedRowModel<
|
|
@@ -200,13 +208,14 @@ export function table_getExpandedRowModel<
|
|
|
200
208
|
}
|
|
201
209
|
|
|
202
210
|
/**
|
|
203
|
-
*
|
|
211
|
+
* Reads the row model immediately before pagination.
|
|
204
212
|
*
|
|
205
|
-
*
|
|
213
|
+
* Pagination is the final built-in row-model stage, so this aliases
|
|
214
|
+
* `table.getExpandedRowModel()`.
|
|
206
215
|
*
|
|
207
216
|
* @example
|
|
208
217
|
* ```ts
|
|
209
|
-
* const
|
|
218
|
+
* const rowsBeforePagination = table_getPrePaginatedRowModel(table)
|
|
210
219
|
* ```
|
|
211
220
|
*/
|
|
212
221
|
export function table_getPrePaginatedRowModel<
|
|
@@ -217,13 +226,15 @@ export function table_getPrePaginatedRowModel<
|
|
|
217
226
|
}
|
|
218
227
|
|
|
219
228
|
/**
|
|
220
|
-
*
|
|
229
|
+
* Resolves the row model after pagination has sliced rows for the current page.
|
|
221
230
|
*
|
|
222
|
-
*
|
|
231
|
+
* When `manualPagination` is enabled, or no paginated row-model factory was
|
|
232
|
+
* registered, this returns the pre-paginated row model because pagination is
|
|
233
|
+
* expected to happen before data reaches the table.
|
|
223
234
|
*
|
|
224
235
|
* @example
|
|
225
236
|
* ```ts
|
|
226
|
-
* const
|
|
237
|
+
* const pageRows = table_getPaginatedRowModel(table)
|
|
227
238
|
* ```
|
|
228
239
|
*/
|
|
229
240
|
export function table_getPaginatedRowModel<
|
|
@@ -243,13 +254,14 @@ export function table_getPaginatedRowModel<
|
|
|
243
254
|
}
|
|
244
255
|
|
|
245
256
|
/**
|
|
246
|
-
*
|
|
257
|
+
* Resolves the final row model consumed by renderers.
|
|
247
258
|
*
|
|
248
|
-
* This
|
|
259
|
+
* This is the end of the built-in row-model pipeline: core -> filtering ->
|
|
260
|
+
* grouping -> sorting -> expanding -> pagination.
|
|
249
261
|
*
|
|
250
262
|
* @example
|
|
251
263
|
* ```ts
|
|
252
|
-
* const
|
|
264
|
+
* const visibleRows = table_getRowModel(table)
|
|
253
265
|
* ```
|
|
254
266
|
*/
|
|
255
267
|
export function table_getRowModel<
|
|
@@ -49,11 +49,11 @@ export interface Row_Row<
|
|
|
49
49
|
TData extends RowData,
|
|
50
50
|
> extends Row_CoreProperties<TFeatures, TData> {
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* Builds a lookup of this row's cells keyed by leaf column id.
|
|
53
53
|
*/
|
|
54
54
|
getAllCellsByColumnId: () => Record<string, Cell<TFeatures, TData, unknown>>
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
56
|
+
* Builds one cell for each leaf column, including cells for hidden columns.
|
|
57
57
|
*/
|
|
58
58
|
getAllCells: () => Array<Cell<TFeatures, TData, unknown>>
|
|
59
59
|
/**
|
|
@@ -69,11 +69,11 @@ export interface Row_Row<
|
|
|
69
69
|
*/
|
|
70
70
|
getParentRows: () => Array<Row<TFeatures, TData>>
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
72
|
+
* Reads the values this row contributes to faceting/grouping for a column.
|
|
73
73
|
*/
|
|
74
74
|
getUniqueValues: <TValue>(columnId: string) => Array<TValue>
|
|
75
75
|
/**
|
|
76
|
-
*
|
|
76
|
+
* Reads this row's accessor value for a column id and caches the result.
|
|
77
77
|
*/
|
|
78
78
|
getValue: <TValue>(columnId: string) => TValue
|
|
79
79
|
/**
|
|
@@ -7,13 +7,14 @@ import type { Row } from '../../types/Row'
|
|
|
7
7
|
import type { Cell } from '../../types/Cell'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Reads and caches this row's value for a column.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
12
|
+
* The value is produced by the column accessor. Missing columns or display
|
|
13
|
+
* columns without an accessor return `undefined`.
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
15
16
|
* ```ts
|
|
16
|
-
* const
|
|
17
|
+
* const firstName = row_getValue(row, 'firstName')
|
|
17
18
|
* ```
|
|
18
19
|
*/
|
|
19
20
|
export function row_getValue<
|
|
@@ -36,13 +37,14 @@ export function row_getValue<
|
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
/**
|
|
39
|
-
*
|
|
40
|
+
* Reads and caches the values used by faceting/grouping for a column.
|
|
40
41
|
*
|
|
41
|
-
*
|
|
42
|
+
* If the column defines `getUniqueValues`, that result is used. Otherwise the
|
|
43
|
+
* row's accessor value is wrapped in a single-item array.
|
|
42
44
|
*
|
|
43
45
|
* @example
|
|
44
46
|
* ```ts
|
|
45
|
-
* const
|
|
47
|
+
* const values = row_getUniqueValues(row, 'tags')
|
|
46
48
|
* ```
|
|
47
49
|
*/
|
|
48
50
|
export function row_getUniqueValues<
|
|
@@ -80,7 +82,7 @@ export function row_getUniqueValues<
|
|
|
80
82
|
*
|
|
81
83
|
* @example
|
|
82
84
|
* ```ts
|
|
83
|
-
* const value = row_renderValue(row)
|
|
85
|
+
* const value = row_renderValue(row, 'firstName')
|
|
84
86
|
* ```
|
|
85
87
|
*/
|
|
86
88
|
export function row_renderValue<
|
|
@@ -91,13 +93,13 @@ export function row_renderValue<
|
|
|
91
93
|
}
|
|
92
94
|
|
|
93
95
|
/**
|
|
94
|
-
*
|
|
96
|
+
* Flattens this row's descendant tree into leaf rows.
|
|
95
97
|
*
|
|
96
|
-
*
|
|
98
|
+
* The row itself is not included; only nested `subRows` are walked.
|
|
97
99
|
*
|
|
98
100
|
* @example
|
|
99
101
|
* ```ts
|
|
100
|
-
* const
|
|
102
|
+
* const descendants = row_getLeafRows(row)
|
|
101
103
|
* ```
|
|
102
104
|
*/
|
|
103
105
|
export function row_getLeafRows<
|
|
@@ -108,13 +110,14 @@ export function row_getLeafRows<
|
|
|
108
110
|
}
|
|
109
111
|
|
|
110
112
|
/**
|
|
111
|
-
*
|
|
113
|
+
* Looks up this row's direct parent, if it has one.
|
|
112
114
|
*
|
|
113
|
-
*
|
|
115
|
+
* Parent lookup searches the pre-pagination row model so parent relationships
|
|
116
|
+
* are available even when the parent is not on the current page.
|
|
114
117
|
*
|
|
115
118
|
* @example
|
|
116
119
|
* ```ts
|
|
117
|
-
* const
|
|
120
|
+
* const parent = row_getParentRow(row)
|
|
118
121
|
* ```
|
|
119
122
|
*/
|
|
120
123
|
export function row_getParentRow<
|
|
@@ -125,13 +128,13 @@ export function row_getParentRow<
|
|
|
125
128
|
}
|
|
126
129
|
|
|
127
130
|
/**
|
|
128
|
-
*
|
|
131
|
+
* Collects this row's ancestor chain from root to direct parent.
|
|
129
132
|
*
|
|
130
|
-
*
|
|
133
|
+
* The current row is not included. Rows without a parent return an empty array.
|
|
131
134
|
*
|
|
132
135
|
* @example
|
|
133
136
|
* ```ts
|
|
134
|
-
* const
|
|
137
|
+
* const ancestors = row_getParentRows(row)
|
|
135
138
|
* ```
|
|
136
139
|
*/
|
|
137
140
|
export function row_getParentRows<
|
|
@@ -151,13 +154,14 @@ export function row_getParentRows<
|
|
|
151
154
|
}
|
|
152
155
|
|
|
153
156
|
/**
|
|
154
|
-
*
|
|
157
|
+
* Constructs one cell for each leaf column in this row.
|
|
155
158
|
*
|
|
156
|
-
*
|
|
159
|
+
* The result follows `table.getAllLeafColumns()` order and includes hidden
|
|
160
|
+
* columns; visibility-specific APIs filter this list later.
|
|
157
161
|
*
|
|
158
162
|
* @example
|
|
159
163
|
* ```ts
|
|
160
|
-
* const
|
|
164
|
+
* const cells = row_getAllCells(row)
|
|
161
165
|
* ```
|
|
162
166
|
*/
|
|
163
167
|
export function row_getAllCells<
|
|
@@ -175,13 +179,13 @@ export function row_getAllCells<
|
|
|
175
179
|
}
|
|
176
180
|
|
|
177
181
|
/**
|
|
178
|
-
*
|
|
182
|
+
* Builds a lookup map of this row's cells keyed by column id.
|
|
179
183
|
*
|
|
180
|
-
* This is the static implementation behind
|
|
184
|
+
* This is the static implementation behind `row.getAllCellsByColumnId()`.
|
|
181
185
|
*
|
|
182
186
|
* @example
|
|
183
187
|
* ```ts
|
|
184
|
-
* const
|
|
188
|
+
* const cellsById = row_getAllCellsByColumnId(row)
|
|
185
189
|
* ```
|
|
186
190
|
*/
|
|
187
191
|
export function row_getAllCellsByColumnId<
|
|
@@ -198,13 +202,14 @@ export function row_getAllCellsByColumnId<
|
|
|
198
202
|
}
|
|
199
203
|
|
|
200
204
|
/**
|
|
201
|
-
*
|
|
205
|
+
* Resolves the stable id for a row.
|
|
202
206
|
*
|
|
203
|
-
*
|
|
207
|
+
* `options.getRowId` wins when provided. Otherwise root rows use their index
|
|
208
|
+
* and child rows append their index to the parent id, such as `0.2`.
|
|
204
209
|
*
|
|
205
210
|
* @example
|
|
206
211
|
* ```ts
|
|
207
|
-
* const
|
|
212
|
+
* const id = table_getRowId(originalRow, table, index, parentRow)
|
|
208
213
|
* ```
|
|
209
214
|
*/
|
|
210
215
|
export function table_getRowId<
|
|
@@ -223,13 +228,14 @@ export function table_getRowId<
|
|
|
223
228
|
}
|
|
224
229
|
|
|
225
230
|
/**
|
|
226
|
-
*
|
|
231
|
+
* Looks up a row by id from the current or full row model.
|
|
227
232
|
*
|
|
228
|
-
*
|
|
233
|
+
* By default this searches `table.getRowModel()`. Passing `searchAll` searches
|
|
234
|
+
* the pre-pagination model first, then falls back to the core model.
|
|
229
235
|
*
|
|
230
236
|
* @example
|
|
231
237
|
* ```ts
|
|
232
|
-
* const
|
|
238
|
+
* const row = table_getRow(table, rowId, true)
|
|
233
239
|
* ```
|
|
234
240
|
*/
|
|
235
241
|
export function table_getRow<
|
|
@@ -66,11 +66,15 @@ export interface TableOptions_Table<
|
|
|
66
66
|
TData extends RowData,
|
|
67
67
|
> {
|
|
68
68
|
/**
|
|
69
|
-
* The
|
|
69
|
+
* The feature modules registered on this table instance.
|
|
70
|
+
*
|
|
71
|
+
* Feature registration controls which state slices, options, and prototype
|
|
72
|
+
* APIs are available.
|
|
70
73
|
*/
|
|
71
74
|
readonly _features: TFeatures
|
|
72
75
|
/**
|
|
73
|
-
*
|
|
76
|
+
* Row model factories used by features such as filtering, grouping, sorting,
|
|
77
|
+
* expansion, and pagination.
|
|
74
78
|
*/
|
|
75
79
|
readonly _rowModels?: CreateRowModels_All<TFeatures, TData>
|
|
76
80
|
/**
|
|
@@ -12,7 +12,7 @@ import type { TableOptions } from '../../types/TableOptions'
|
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```ts
|
|
15
|
-
*
|
|
15
|
+
* table_syncExternalStateToBaseAtoms(table)
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
18
|
export function table_syncExternalStateToBaseAtoms<
|
|
@@ -72,7 +72,7 @@ export function table_reset<
|
|
|
72
72
|
*
|
|
73
73
|
* @example
|
|
74
74
|
* ```ts
|
|
75
|
-
* const
|
|
75
|
+
* const options = table_mergeOptions(table, nextOptions)
|
|
76
76
|
* ```
|
|
77
77
|
*/
|
|
78
78
|
export function table_mergeOptions<
|
|
@@ -8,15 +8,18 @@ export interface Column_ColumnFaceting<
|
|
|
8
8
|
TData extends RowData,
|
|
9
9
|
> {
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Computes min/max numeric facet values for this column.
|
|
12
12
|
*/
|
|
13
13
|
getFacetedMinMaxValues: () => undefined | [number, number]
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Computes the row model used to derive this column's facet values.
|
|
16
|
+
*
|
|
17
|
+
* Other column filters are applied, while this column's own filter is
|
|
18
|
+
* excluded.
|
|
16
19
|
*/
|
|
17
20
|
getFacetedRowModel: () => RowModel<TFeatures, TData>
|
|
18
21
|
/**
|
|
19
|
-
*
|
|
22
|
+
* Computes unique facet values and occurrence counts for this column.
|
|
20
23
|
*/
|
|
21
24
|
getFacetedUniqueValues: () => Map<any, number>
|
|
22
25
|
}
|
|
@@ -26,18 +29,21 @@ export interface Table_RowModels_Faceted<
|
|
|
26
29
|
TData extends RowData,
|
|
27
30
|
> {
|
|
28
31
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
32
|
+
* Computes min/max numeric facet values for the active faceting context.
|
|
33
|
+
*
|
|
34
|
+
* Requires a `facetedMinMaxValues` row-model factory in `_rowModels`.
|
|
31
35
|
*/
|
|
32
36
|
getFacetedMinMaxValues: () => undefined | [number, number]
|
|
33
37
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
38
|
+
* Computes the row model used to derive facet values.
|
|
39
|
+
*
|
|
40
|
+
* Requires a `facetedRowModel` row-model factory in `_rowModels`.
|
|
36
41
|
*/
|
|
37
42
|
getFacetedRowModel: () => RowModel<TFeatures, TData>
|
|
38
43
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
44
|
+
* Computes unique facet values and occurrence counts.
|
|
45
|
+
*
|
|
46
|
+
* Requires a `facetedUniqueValues` row-model factory in `_rowModels`.
|
|
41
47
|
*/
|
|
42
48
|
getFacetedUniqueValues: () => Map<any, number>
|
|
43
49
|
}
|
|
@@ -93,7 +99,7 @@ export interface Table_ColumnFaceting<
|
|
|
93
99
|
*/
|
|
94
100
|
getGlobalFacetedMinMaxValues: () => undefined | [number, number]
|
|
95
101
|
/**
|
|
96
|
-
*
|
|
102
|
+
* Computes the row model used to derive global facet values.
|
|
97
103
|
*/
|
|
98
104
|
getGlobalFacetedRowModel: () => RowModel<TFeatures, TData>
|
|
99
105
|
/**
|