@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
|
@@ -5,13 +5,14 @@ import type { Table_Internal } from '../../types/Table'
|
|
|
5
5
|
import type { Column_Internal } from '../../types/Column'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Computes min and max numeric facet values for one column.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* The configured `facetedMinMaxValues` row-model factory owns the calculation.
|
|
11
|
+
* If no factory is registered, the result is `undefined`.
|
|
11
12
|
*
|
|
12
13
|
* @example
|
|
13
14
|
* ```ts
|
|
14
|
-
* const
|
|
15
|
+
* const range = column_getFacetedMinMaxValues(column, table)
|
|
15
16
|
* ```
|
|
16
17
|
*/
|
|
17
18
|
export function column_getFacetedMinMaxValues<
|
|
@@ -29,13 +30,15 @@ export function column_getFacetedMinMaxValues<
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
|
-
*
|
|
33
|
+
* Computes the row model used to derive one column's facet values.
|
|
33
34
|
*
|
|
34
|
-
*
|
|
35
|
+
* The faceted row model normally applies every other active filter while
|
|
36
|
+
* excluding this column's own filter. If no factory is registered, the
|
|
37
|
+
* pre-filtered row model is returned.
|
|
35
38
|
*
|
|
36
39
|
* @example
|
|
37
40
|
* ```ts
|
|
38
|
-
* const
|
|
41
|
+
* const rows = column_getFacetedRowModel(column, table)
|
|
39
42
|
* ```
|
|
40
43
|
*/
|
|
41
44
|
export function column_getFacetedRowModel<
|
|
@@ -53,13 +56,14 @@ export function column_getFacetedRowModel<
|
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
/**
|
|
56
|
-
*
|
|
59
|
+
* Computes unique facet values and their occurrence counts for one column.
|
|
57
60
|
*
|
|
58
|
-
*
|
|
61
|
+
* The configured `facetedUniqueValues` row-model factory owns the calculation.
|
|
62
|
+
* If no factory is registered, an empty `Map` is returned.
|
|
59
63
|
*
|
|
60
64
|
* @example
|
|
61
65
|
* ```ts
|
|
62
|
-
* const
|
|
66
|
+
* const values = column_getFacetedUniqueValues(column, table)
|
|
63
67
|
* ```
|
|
64
68
|
*/
|
|
65
69
|
export function column_getFacetedUniqueValues<
|
|
@@ -77,13 +81,14 @@ export function column_getFacetedUniqueValues<
|
|
|
77
81
|
}
|
|
78
82
|
|
|
79
83
|
/**
|
|
80
|
-
*
|
|
84
|
+
* Computes min and max numeric facet values for the global filter context.
|
|
81
85
|
*
|
|
82
|
-
*
|
|
86
|
+
* The global context is requested with the internal `__global__` column id. If
|
|
87
|
+
* no factory is registered, the result is `undefined`.
|
|
83
88
|
*
|
|
84
89
|
* @example
|
|
85
90
|
* ```ts
|
|
86
|
-
* const
|
|
91
|
+
* const range = table_getGlobalFacetedMinMaxValues(table)
|
|
87
92
|
* ```
|
|
88
93
|
*/
|
|
89
94
|
export function table_getGlobalFacetedMinMaxValues<
|
|
@@ -97,13 +102,15 @@ export function table_getGlobalFacetedMinMaxValues<
|
|
|
97
102
|
}
|
|
98
103
|
|
|
99
104
|
/**
|
|
100
|
-
*
|
|
105
|
+
* Computes the row model used to derive global facet values.
|
|
101
106
|
*
|
|
102
|
-
*
|
|
107
|
+
* The global context is requested with the internal `__global__` column id. If
|
|
108
|
+
* no faceted row-model factory is registered, the pre-filtered row model is
|
|
109
|
+
* returned.
|
|
103
110
|
*
|
|
104
111
|
* @example
|
|
105
112
|
* ```ts
|
|
106
|
-
* const
|
|
113
|
+
* const rows = table_getGlobalFacetedRowModel(table)
|
|
107
114
|
* ```
|
|
108
115
|
*/
|
|
109
116
|
export function table_getGlobalFacetedRowModel<
|
|
@@ -117,13 +124,14 @@ export function table_getGlobalFacetedRowModel<
|
|
|
117
124
|
}
|
|
118
125
|
|
|
119
126
|
/**
|
|
120
|
-
*
|
|
127
|
+
* Computes unique values and occurrence counts for the global filter context.
|
|
121
128
|
*
|
|
122
|
-
*
|
|
129
|
+
* The global context is requested with the internal `__global__` column id. If
|
|
130
|
+
* no factory is registered, an empty `Map` is returned.
|
|
123
131
|
*
|
|
124
132
|
* @example
|
|
125
133
|
* ```ts
|
|
126
|
-
* const
|
|
134
|
+
* const values = table_getGlobalFacetedUniqueValues(table)
|
|
127
135
|
* ```
|
|
128
136
|
*/
|
|
129
137
|
export function table_getGlobalFacetedUniqueValues<
|
|
@@ -83,7 +83,10 @@ export interface ColumnDef_ColumnFiltering<
|
|
|
83
83
|
TData extends RowData,
|
|
84
84
|
> {
|
|
85
85
|
/**
|
|
86
|
-
* Enables
|
|
86
|
+
* Enables this column to participate in column-specific filtering.
|
|
87
|
+
*
|
|
88
|
+
* Defaults to `true`; table-level `enableColumnFilters` and `enableFilters`
|
|
89
|
+
* must also allow filtering.
|
|
87
90
|
*/
|
|
88
91
|
enableColumnFilter?: boolean
|
|
89
92
|
/**
|
|
@@ -101,7 +104,7 @@ export interface Column_ColumnFiltering<
|
|
|
101
104
|
*/
|
|
102
105
|
getAutoFilterFn: () => FilterFn<TFeatures, TData>
|
|
103
106
|
/**
|
|
104
|
-
*
|
|
107
|
+
* Checks whether this accessor column can currently be column-filtered.
|
|
105
108
|
*/
|
|
106
109
|
getCanFilter: () => boolean
|
|
107
110
|
/**
|
|
@@ -113,15 +116,18 @@ export interface Column_ColumnFiltering<
|
|
|
113
116
|
*/
|
|
114
117
|
getFilterIndex: () => number
|
|
115
118
|
/**
|
|
116
|
-
*
|
|
119
|
+
* Reads this column's current value from `state.columnFilters`.
|
|
117
120
|
*/
|
|
118
121
|
getFilterValue: () => unknown
|
|
119
122
|
/**
|
|
120
|
-
*
|
|
123
|
+
* Checks whether this column has an active entry in `state.columnFilters`.
|
|
121
124
|
*/
|
|
122
125
|
getIsFiltered: () => boolean
|
|
123
126
|
/**
|
|
124
|
-
*
|
|
127
|
+
* Adds, updates, or removes this column's filter value.
|
|
128
|
+
*
|
|
129
|
+
* Updater functions receive the previous filter value. Values that satisfy
|
|
130
|
+
* the filter function's `autoRemove` rule are removed from filter state.
|
|
125
131
|
*/
|
|
126
132
|
setFilterValue: (updater: Updater<any>) => void
|
|
127
133
|
}
|
|
@@ -145,11 +151,13 @@ export interface TableOptions_ColumnFiltering<
|
|
|
145
151
|
TData extends RowData,
|
|
146
152
|
> {
|
|
147
153
|
/**
|
|
148
|
-
* Enables
|
|
154
|
+
* Enables column-specific filtering for all columns that also allow it.
|
|
149
155
|
*/
|
|
150
156
|
enableColumnFilters?: boolean
|
|
151
157
|
/**
|
|
152
|
-
* Enables
|
|
158
|
+
* Enables all filtering features for the table.
|
|
159
|
+
*
|
|
160
|
+
* Set this to `false` to disable both column filtering and global filtering.
|
|
153
161
|
*/
|
|
154
162
|
enableFilters?: boolean
|
|
155
163
|
/**
|
|
@@ -176,11 +184,13 @@ export interface TableOptions_ColumnFiltering<
|
|
|
176
184
|
|
|
177
185
|
export interface Table_ColumnFiltering {
|
|
178
186
|
/**
|
|
179
|
-
* Resets
|
|
187
|
+
* Resets `columnFilters` to `initialState.columnFilters`.
|
|
188
|
+
*
|
|
189
|
+
* Pass `true` to ignore initial state and reset to `[]`.
|
|
180
190
|
*/
|
|
181
191
|
resetColumnFilters: (defaultState?: boolean) => void
|
|
182
192
|
/**
|
|
183
|
-
*
|
|
193
|
+
* Updates column filter state with a next array or updater function.
|
|
184
194
|
*/
|
|
185
195
|
setColumnFilters: (updater: Updater<ColumnFiltersState>) => void
|
|
186
196
|
}
|
|
@@ -190,11 +200,11 @@ export interface Table_RowModels_Filtered<
|
|
|
190
200
|
TData extends RowData,
|
|
191
201
|
> {
|
|
192
202
|
/**
|
|
193
|
-
*
|
|
203
|
+
* Resolves the row model after column and global filters have been applied.
|
|
194
204
|
*/
|
|
195
205
|
getFilteredRowModel: () => RowModel<TFeatures, TData>
|
|
196
206
|
/**
|
|
197
|
-
*
|
|
207
|
+
* Reads the row model immediately before filtering.
|
|
198
208
|
*/
|
|
199
209
|
getPreFilteredRowModel: () => RowModel<TFeatures, TData>
|
|
200
210
|
}
|
|
@@ -9,13 +9,14 @@ import type {
|
|
|
9
9
|
} from './columnFilteringFeature.types'
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Creates the default column filter state.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
* The feature default is an empty array, meaning no column filters are active.
|
|
15
|
+
* Reset APIs use this value when `defaultState` is `true`.
|
|
15
16
|
*
|
|
16
17
|
* @example
|
|
17
18
|
* ```ts
|
|
18
|
-
* const
|
|
19
|
+
* const filters = getDefaultColumnFiltersState()
|
|
19
20
|
* ```
|
|
20
21
|
*/
|
|
21
22
|
export function getDefaultColumnFiltersState(): ColumnFiltersState {
|
|
@@ -23,13 +24,15 @@ export function getDefaultColumnFiltersState(): ColumnFiltersState {
|
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
|
-
*
|
|
27
|
+
* Chooses a built-in filter function from the column's first core row value.
|
|
27
28
|
*
|
|
28
|
-
*
|
|
29
|
+
* Strings use `includesString`, numbers use `inNumberRange`, booleans and
|
|
30
|
+
* objects use `equals`, arrays use `arrIncludes`, and unknown values fall back
|
|
31
|
+
* to `weakEquals`.
|
|
29
32
|
*
|
|
30
33
|
* @example
|
|
31
34
|
* ```ts
|
|
32
|
-
* const
|
|
35
|
+
* const filterFn = column_getAutoFilterFn(column)
|
|
33
36
|
* ```
|
|
34
37
|
*/
|
|
35
38
|
export function column_getAutoFilterFn<
|
|
@@ -68,13 +71,15 @@ export function column_getAutoFilterFn<
|
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
/**
|
|
71
|
-
*
|
|
74
|
+
* Resolves the filter function configured for a column.
|
|
72
75
|
*
|
|
73
|
-
*
|
|
76
|
+
* Function-valued `columnDef.filterFn` is returned directly, `'auto'` delegates
|
|
77
|
+
* to `column_getAutoFilterFn`, and string values are looked up in the table's
|
|
78
|
+
* filter function registry.
|
|
74
79
|
*
|
|
75
80
|
* @example
|
|
76
81
|
* ```ts
|
|
77
|
-
* const
|
|
82
|
+
* const filterFn = column_getFilterFn(column)
|
|
78
83
|
* ```
|
|
79
84
|
*/
|
|
80
85
|
export function column_getFilterFn<
|
|
@@ -103,13 +108,14 @@ export function column_getFilterFn<
|
|
|
103
108
|
}
|
|
104
109
|
|
|
105
110
|
/**
|
|
106
|
-
*
|
|
111
|
+
* Checks whether column filtering is enabled for this accessor column.
|
|
107
112
|
*
|
|
108
|
-
*
|
|
113
|
+
* The column must have an accessor and filtering must be enabled by the column
|
|
114
|
+
* definition, `enableColumnFilters`, and the table-wide `enableFilters` option.
|
|
109
115
|
*
|
|
110
116
|
* @example
|
|
111
117
|
* ```ts
|
|
112
|
-
* const
|
|
118
|
+
* const canFilter = column_getCanFilter(column)
|
|
113
119
|
* ```
|
|
114
120
|
*/
|
|
115
121
|
export function column_getCanFilter<
|
|
@@ -126,13 +132,14 @@ export function column_getCanFilter<
|
|
|
126
132
|
}
|
|
127
133
|
|
|
128
134
|
/**
|
|
129
|
-
*
|
|
135
|
+
* Checks whether this column currently has an entry in `state.columnFilters`.
|
|
130
136
|
*
|
|
131
|
-
* This
|
|
137
|
+
* This only reflects filter state presence; it does not indicate whether the
|
|
138
|
+
* filter removes any rows.
|
|
132
139
|
*
|
|
133
140
|
* @example
|
|
134
141
|
* ```ts
|
|
135
|
-
* const
|
|
142
|
+
* const isFiltered = column_getIsFiltered(column)
|
|
136
143
|
* ```
|
|
137
144
|
*/
|
|
138
145
|
export function column_getIsFiltered<
|
|
@@ -144,9 +151,9 @@ export function column_getIsFiltered<
|
|
|
144
151
|
}
|
|
145
152
|
|
|
146
153
|
/**
|
|
147
|
-
*
|
|
154
|
+
* Reads this column's current filter value from `state.columnFilters`.
|
|
148
155
|
*
|
|
149
|
-
*
|
|
156
|
+
* Missing filter entries return `undefined`.
|
|
150
157
|
*
|
|
151
158
|
* @example
|
|
152
159
|
* ```ts
|
|
@@ -164,13 +171,13 @@ export function column_getFilterValue<
|
|
|
164
171
|
}
|
|
165
172
|
|
|
166
173
|
/**
|
|
167
|
-
*
|
|
174
|
+
* Finds this column's position in the ordered `state.columnFilters` array.
|
|
168
175
|
*
|
|
169
|
-
*
|
|
176
|
+
* The result is `-1` when the column has no active filter.
|
|
170
177
|
*
|
|
171
178
|
* @example
|
|
172
179
|
* ```ts
|
|
173
|
-
* const
|
|
180
|
+
* const index = column_getFilterIndex(column)
|
|
174
181
|
* ```
|
|
175
182
|
*/
|
|
176
183
|
export function column_getFilterIndex<
|
|
@@ -186,13 +193,14 @@ export function column_getFilterIndex<
|
|
|
186
193
|
}
|
|
187
194
|
|
|
188
195
|
/**
|
|
189
|
-
*
|
|
196
|
+
* Adds, updates, or removes this column's filter value.
|
|
190
197
|
*
|
|
191
|
-
*
|
|
198
|
+
* The incoming value may be an updater. After resolution, `autoRemove` rules
|
|
199
|
+
* decide whether the filter should be removed instead of stored.
|
|
192
200
|
*
|
|
193
201
|
* @example
|
|
194
202
|
* ```ts
|
|
195
|
-
* column_setFilterValue(column, (old) => old)
|
|
203
|
+
* column_setFilterValue(column, (old) => String(old ?? '').trim())
|
|
196
204
|
* ```
|
|
197
205
|
*/
|
|
198
206
|
export function column_setFilterValue<
|
|
@@ -233,13 +241,15 @@ export function column_setFilterValue<
|
|
|
233
241
|
}
|
|
234
242
|
|
|
235
243
|
/**
|
|
236
|
-
*
|
|
244
|
+
* Routes a column filter updater through the table's filter change handler.
|
|
237
245
|
*
|
|
238
|
-
* The
|
|
246
|
+
* The resolved filters are cleaned before they are emitted: filters for known
|
|
247
|
+
* columns are removed when their filter function says the value should be
|
|
248
|
+
* auto-removed.
|
|
239
249
|
*
|
|
240
250
|
* @example
|
|
241
251
|
* ```ts
|
|
242
|
-
* table_setColumnFilters(table, (old) => old)
|
|
252
|
+
* table_setColumnFilters(table, (old) => old.filter((filter) => filter.id !== 'age'))
|
|
243
253
|
* ```
|
|
244
254
|
*/
|
|
245
255
|
export function table_setColumnFilters<
|
|
@@ -271,9 +281,10 @@ export function table_setColumnFilters<
|
|
|
271
281
|
}
|
|
272
282
|
|
|
273
283
|
/**
|
|
274
|
-
* Resets the
|
|
284
|
+
* Resets `columnFilters` to the configured initial state or feature default.
|
|
275
285
|
*
|
|
276
|
-
*
|
|
286
|
+
* With no argument, the reset clones `table.initialState.columnFilters` when it
|
|
287
|
+
* exists. Passing `true` ignores initial state and resets to `[]`.
|
|
277
288
|
*
|
|
278
289
|
* @example
|
|
279
290
|
* ```ts
|
|
@@ -66,7 +66,9 @@ export interface ColumnDef_ColumnGrouping<
|
|
|
66
66
|
*/
|
|
67
67
|
aggregationFn?: AggregationFnOption<TFeatures, TData>
|
|
68
68
|
/**
|
|
69
|
-
*
|
|
69
|
+
* Allows this column to be added to grouping state.
|
|
70
|
+
*
|
|
71
|
+
* Defaults to `true`; table-level `enableGrouping` must also allow grouping.
|
|
70
72
|
*/
|
|
71
73
|
enableGrouping?: boolean
|
|
72
74
|
/**
|
|
@@ -88,15 +90,15 @@ export interface Column_ColumnGrouping<
|
|
|
88
90
|
*/
|
|
89
91
|
getAutoAggregationFn: () => AggregationFn<TFeatures, TData> | undefined
|
|
90
92
|
/**
|
|
91
|
-
*
|
|
93
|
+
* Checks whether this column can currently be grouped.
|
|
92
94
|
*/
|
|
93
95
|
getCanGroup: () => boolean
|
|
94
96
|
/**
|
|
95
|
-
*
|
|
97
|
+
* Finds this column's position in the ordered grouping state.
|
|
96
98
|
*/
|
|
97
99
|
getGroupedIndex: () => number
|
|
98
100
|
/**
|
|
99
|
-
*
|
|
101
|
+
* Checks whether this column id is present in grouping state.
|
|
100
102
|
*/
|
|
101
103
|
getIsGrouped: () => boolean
|
|
102
104
|
/**
|
|
@@ -112,11 +114,11 @@ export interface Column_ColumnGrouping<
|
|
|
112
114
|
export interface Row_ColumnGrouping {
|
|
113
115
|
_groupingValuesCache: Record<string, any>
|
|
114
116
|
/**
|
|
115
|
-
*
|
|
117
|
+
* Reads the value used to group this row for a column id.
|
|
116
118
|
*/
|
|
117
119
|
getGroupingValue: (columnId: string) => unknown
|
|
118
120
|
/**
|
|
119
|
-
*
|
|
121
|
+
* Checks whether this row represents a grouped row.
|
|
120
122
|
*/
|
|
121
123
|
getIsGrouped: () => boolean
|
|
122
124
|
/**
|
|
@@ -131,15 +133,15 @@ export interface Row_ColumnGrouping {
|
|
|
131
133
|
|
|
132
134
|
export interface Cell_ColumnGrouping {
|
|
133
135
|
/**
|
|
134
|
-
*
|
|
136
|
+
* Checks whether this cell should render an aggregated value.
|
|
135
137
|
*/
|
|
136
138
|
getIsAggregated: () => boolean
|
|
137
139
|
/**
|
|
138
|
-
*
|
|
140
|
+
* Checks whether this cell represents the active grouping column.
|
|
139
141
|
*/
|
|
140
142
|
getIsGrouped: () => boolean
|
|
141
143
|
/**
|
|
142
|
-
*
|
|
144
|
+
* Checks whether this cell is hidden as a grouping placeholder.
|
|
143
145
|
*/
|
|
144
146
|
getIsPlaceholder: () => boolean
|
|
145
147
|
}
|
|
@@ -151,7 +153,7 @@ export interface ColumnDefaultOptions {
|
|
|
151
153
|
|
|
152
154
|
export interface TableOptions_ColumnGrouping {
|
|
153
155
|
/**
|
|
154
|
-
*
|
|
156
|
+
* Allows columns to be grouped for this table.
|
|
155
157
|
*/
|
|
156
158
|
enableGrouping?: boolean
|
|
157
159
|
/**
|
|
@@ -177,11 +179,13 @@ export interface Table_ColumnGrouping<
|
|
|
177
179
|
TData extends RowData,
|
|
178
180
|
> {
|
|
179
181
|
/**
|
|
180
|
-
* Resets
|
|
182
|
+
* Resets `grouping` to `initialState.grouping`.
|
|
183
|
+
*
|
|
184
|
+
* Pass `true` to ignore initial state and reset to `[]`.
|
|
181
185
|
*/
|
|
182
186
|
resetGrouping: (defaultState?: boolean) => void
|
|
183
187
|
/**
|
|
184
|
-
*
|
|
188
|
+
* Updates grouping state with a next ordered id array or updater function.
|
|
185
189
|
*/
|
|
186
190
|
setGrouping: (updater: Updater<GroupingState>) => void
|
|
187
191
|
}
|
|
@@ -191,11 +195,11 @@ export interface Table_RowModels_Grouped<
|
|
|
191
195
|
TData extends RowData,
|
|
192
196
|
> {
|
|
193
197
|
/**
|
|
194
|
-
*
|
|
198
|
+
* Resolves the row model after grouping and aggregation have been applied.
|
|
195
199
|
*/
|
|
196
200
|
getGroupedRowModel: () => RowModel<TFeatures, TData>
|
|
197
201
|
/**
|
|
198
|
-
*
|
|
202
|
+
* Reads the row model immediately before grouping.
|
|
199
203
|
*/
|
|
200
204
|
getPreGroupedRowModel: () => RowModel<TFeatures, TData>
|
|
201
205
|
}
|