@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
|
@@ -3,13 +3,14 @@ const require_filterFns = require('../../fns/filterFns.cjs');
|
|
|
3
3
|
|
|
4
4
|
//#region src/features/global-filtering/globalFilteringFeature.utils.ts
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Checks whether this accessor column participates in global filtering.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* The column must have an accessor and pass column-level, table-level, and
|
|
9
|
+
* optional `getColumnCanGlobalFilter` checks.
|
|
9
10
|
*
|
|
10
11
|
* @example
|
|
11
12
|
* ```ts
|
|
12
|
-
* const
|
|
13
|
+
* const canGlobalFilter = column_getCanGlobalFilter(column)
|
|
13
14
|
* ```
|
|
14
15
|
*/
|
|
15
16
|
function column_getCanGlobalFilter(column) {
|
|
@@ -17,26 +18,29 @@ function column_getCanGlobalFilter(column) {
|
|
|
17
18
|
return (column.columnDef.enableGlobalFilter ?? true) && (column.table.options.enableGlobalFilter ?? true) && (column.table.options.enableFilters ?? true) && (((_column$table$options = (_column$table$options2 = column.table.options).getColumnCanGlobalFilter) === null || _column$table$options === void 0 ? void 0 : _column$table$options.call(_column$table$options2, column)) ?? true) && !!column.accessorFn;
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
+
* Provides the built-in automatic global filter function.
|
|
21
22
|
*
|
|
22
|
-
*
|
|
23
|
+
* Global filtering defaults to `includesString`, which gives search-box style
|
|
24
|
+
* matching across globally filterable columns.
|
|
23
25
|
*
|
|
24
26
|
* @example
|
|
25
27
|
* ```ts
|
|
26
|
-
* const
|
|
28
|
+
* const filterFn = table_getGlobalAutoFilterFn()
|
|
27
29
|
* ```
|
|
28
30
|
*/
|
|
29
31
|
function table_getGlobalAutoFilterFn() {
|
|
30
32
|
return require_filterFns.filterFn_includesString;
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
|
-
*
|
|
35
|
+
* Resolves the filter function used for global filtering.
|
|
34
36
|
*
|
|
35
|
-
*
|
|
37
|
+
* Function-valued `options.globalFilterFn` is returned directly, `'auto'`
|
|
38
|
+
* delegates to `table_getGlobalAutoFilterFn`, and string values are looked up in
|
|
39
|
+
* the table's filter function registry.
|
|
36
40
|
*
|
|
37
41
|
* @example
|
|
38
42
|
* ```ts
|
|
39
|
-
* const
|
|
43
|
+
* const filterFn = table_getGlobalFilterFn(table)
|
|
40
44
|
* ```
|
|
41
45
|
*/
|
|
42
46
|
function table_getGlobalFilterFn(table) {
|
|
@@ -45,13 +49,14 @@ function table_getGlobalFilterFn(table) {
|
|
|
45
49
|
return require_utils.isFunction(globalFilterFn) ? globalFilterFn : globalFilterFn === "auto" ? table_getGlobalAutoFilterFn() : filterFns === null || filterFns === void 0 ? void 0 : filterFns[globalFilterFn];
|
|
46
50
|
}
|
|
47
51
|
/**
|
|
48
|
-
*
|
|
52
|
+
* Routes a global filter updater through the table's global filter handler.
|
|
49
53
|
*
|
|
50
|
-
* The updater
|
|
54
|
+
* The updater may be a next value or a function of the previous value, matching
|
|
55
|
+
* the instance `table.setGlobalFilter` behavior.
|
|
51
56
|
*
|
|
52
57
|
* @example
|
|
53
58
|
* ```ts
|
|
54
|
-
* table_setGlobalFilter(table,
|
|
59
|
+
* table_setGlobalFilter(table, 'search text')
|
|
55
60
|
* ```
|
|
56
61
|
*/
|
|
57
62
|
function table_setGlobalFilter(table, updater) {
|
|
@@ -59,9 +64,10 @@ function table_setGlobalFilter(table, updater) {
|
|
|
59
64
|
(_table$options$onGlob = (_table$options = table.options).onGlobalFilterChange) === null || _table$options$onGlob === void 0 || _table$options$onGlob.call(_table$options, updater);
|
|
60
65
|
}
|
|
61
66
|
/**
|
|
62
|
-
* Resets the
|
|
67
|
+
* Resets `globalFilter` to the configured initial state or feature default.
|
|
63
68
|
*
|
|
64
|
-
*
|
|
69
|
+
* With no argument, the reset clones `table.initialState.globalFilter`. Passing
|
|
70
|
+
* `true` ignores initial state and resets to `undefined`.
|
|
65
71
|
*
|
|
66
72
|
* @example
|
|
67
73
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalFilteringFeature.utils.cjs","names":["filterFn_includesString","isFunction","cloneState"],"sources":["../../../src/features/global-filtering/globalFilteringFeature.utils.ts"],"sourcesContent":["import { filterFn_includesString } from '../../fns/filterFns'\nimport { cloneState, isFunction } from '../../utils'\nimport type { Column_Internal } from '../../types/Column'\nimport type { FilterFn } from '../column-filtering/columnFilteringFeature.types'\nimport type { CellData, RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"globalFilteringFeature.utils.cjs","names":["filterFn_includesString","isFunction","cloneState"],"sources":["../../../src/features/global-filtering/globalFilteringFeature.utils.ts"],"sourcesContent":["import { filterFn_includesString } from '../../fns/filterFns'\nimport { cloneState, isFunction } from '../../utils'\nimport type { Column_Internal } from '../../types/Column'\nimport type { FilterFn } from '../column-filtering/columnFilteringFeature.types'\nimport type { CellData, RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\n\n/**\n * Checks whether this accessor column participates in global filtering.\n *\n * The column must have an accessor and pass column-level, table-level, and\n * optional `getColumnCanGlobalFilter` checks.\n *\n * @example\n * ```ts\n * const canGlobalFilter = column_getCanGlobalFilter(column)\n * ```\n */\nexport function column_getCanGlobalFilter<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(column: Column_Internal<TFeatures, TData, TValue>): boolean {\n return (\n (column.columnDef.enableGlobalFilter ?? true) &&\n (column.table.options.enableGlobalFilter ?? true) &&\n (column.table.options.enableFilters ?? true) &&\n (column.table.options.getColumnCanGlobalFilter?.(column) ?? true) &&\n !!column.accessorFn\n )\n}\n\n/**\n * Provides the built-in automatic global filter function.\n *\n * Global filtering defaults to `includesString`, which gives search-box style\n * matching across globally filterable columns.\n *\n * @example\n * ```ts\n * const filterFn = table_getGlobalAutoFilterFn()\n * ```\n */\nexport function table_getGlobalAutoFilterFn() {\n return filterFn_includesString\n}\n\n/**\n * Resolves the filter function used for global filtering.\n *\n * Function-valued `options.globalFilterFn` is returned directly, `'auto'`\n * delegates to `table_getGlobalAutoFilterFn`, and string values are looked up in\n * the table's filter function registry.\n *\n * @example\n * ```ts\n * const filterFn = table_getGlobalFilterFn(table)\n * ```\n */\nexport function table_getGlobalFilterFn<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n): FilterFn<TFeatures, TData> | FilterFn<TFeatures, TData> | undefined {\n const { globalFilterFn: globalFilterFn } = table.options\n const filterFns: Record<string, FilterFn<TFeatures, TData>> | undefined =\n table._rowModelFns.filterFns\n\n return isFunction(globalFilterFn)\n ? globalFilterFn\n : globalFilterFn === 'auto'\n ? table_getGlobalAutoFilterFn()\n : filterFns?.[globalFilterFn as string]\n}\n\n/**\n * Routes a global filter updater through the table's global filter handler.\n *\n * The updater may be a next value or a function of the previous value, matching\n * the instance `table.setGlobalFilter` behavior.\n *\n * @example\n * ```ts\n * table_setGlobalFilter(table, 'search text')\n * ```\n */\nexport function table_setGlobalFilter<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, updater: any) {\n table.options.onGlobalFilterChange?.(updater)\n}\n\n/**\n * Resets `globalFilter` to the configured initial state or feature default.\n *\n * With no argument, the reset clones `table.initialState.globalFilter`. Passing\n * `true` ignores initial state and resets to `undefined`.\n *\n * @example\n * ```ts\n * table_resetGlobalFilter(table)\n * table_resetGlobalFilter(table, true)\n * ```\n */\nexport function table_resetGlobalFilter<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {\n table_setGlobalFilter(\n table,\n defaultState ? undefined : cloneState(table.initialState.globalFilter),\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,SAAgB,0BAId,QAA4D;;CAC5D,QACG,OAAO,UAAU,sBAAsB,UACvC,OAAO,MAAM,QAAQ,sBAAsB,UAC3C,OAAO,MAAM,QAAQ,iBAAiB,8DACtC,OAAO,MAAM,SAAQ,qIAA2B,OAAO,KAAI,SAC5D,CAAC,CAAC,OAAO;;;;;;;;;;;;;AAeb,SAAgB,8BAA8B;CAC5C,OAAOA;;;;;;;;;;;;;;AAeT,SAAgB,wBAId,OACqE;CACrE,MAAM,EAAkB,mBAAmB,MAAM;CACjD,MAAM,YACJ,MAAM,aAAa;CAErB,OAAOC,yBAAW,eAAe,GAC7B,iBACA,mBAAmB,SACjB,6BAA6B,yDAC7B,UAAY;;;;;;;;;;;;;AAcpB,SAAgB,sBAGd,OAAyC,SAAc;;CACvD,iDAAM,SAAQ,iHAAuB,QAAQ;;;;;;;;;;;;;;AAe/C,SAAgB,wBAGd,OAAyC,cAAwB;CACjE,sBACE,OACA,eAAe,SAAYC,yBAAW,MAAM,aAAa,aAAa,CACvE"}
|
|
@@ -6,53 +6,59 @@ import { Table_Internal } from "../../types/Table.cjs";
|
|
|
6
6
|
|
|
7
7
|
//#region src/features/global-filtering/globalFilteringFeature.utils.d.ts
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Checks whether this accessor column participates in global filtering.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
11
|
+
* The column must have an accessor and pass column-level, table-level, and
|
|
12
|
+
* optional `getColumnCanGlobalFilter` checks.
|
|
12
13
|
*
|
|
13
14
|
* @example
|
|
14
15
|
* ```ts
|
|
15
|
-
* const
|
|
16
|
+
* const canGlobalFilter = column_getCanGlobalFilter(column)
|
|
16
17
|
* ```
|
|
17
18
|
*/
|
|
18
19
|
declare function column_getCanGlobalFilter<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(column: Column_Internal<TFeatures, TData, TValue>): boolean;
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
+
* Provides the built-in automatic global filter function.
|
|
21
22
|
*
|
|
22
|
-
*
|
|
23
|
+
* Global filtering defaults to `includesString`, which gives search-box style
|
|
24
|
+
* matching across globally filterable columns.
|
|
23
25
|
*
|
|
24
26
|
* @example
|
|
25
27
|
* ```ts
|
|
26
|
-
* const
|
|
28
|
+
* const filterFn = table_getGlobalAutoFilterFn()
|
|
27
29
|
* ```
|
|
28
30
|
*/
|
|
29
31
|
declare function table_getGlobalAutoFilterFn(): FilterFn<any, any>;
|
|
30
32
|
/**
|
|
31
|
-
*
|
|
33
|
+
* Resolves the filter function used for global filtering.
|
|
32
34
|
*
|
|
33
|
-
*
|
|
35
|
+
* Function-valued `options.globalFilterFn` is returned directly, `'auto'`
|
|
36
|
+
* delegates to `table_getGlobalAutoFilterFn`, and string values are looked up in
|
|
37
|
+
* the table's filter function registry.
|
|
34
38
|
*
|
|
35
39
|
* @example
|
|
36
40
|
* ```ts
|
|
37
|
-
* const
|
|
41
|
+
* const filterFn = table_getGlobalFilterFn(table)
|
|
38
42
|
* ```
|
|
39
43
|
*/
|
|
40
44
|
declare function table_getGlobalFilterFn<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): FilterFn<TFeatures, TData> | FilterFn<TFeatures, TData> | undefined;
|
|
41
45
|
/**
|
|
42
|
-
*
|
|
46
|
+
* Routes a global filter updater through the table's global filter handler.
|
|
43
47
|
*
|
|
44
|
-
* The updater
|
|
48
|
+
* The updater may be a next value or a function of the previous value, matching
|
|
49
|
+
* the instance `table.setGlobalFilter` behavior.
|
|
45
50
|
*
|
|
46
51
|
* @example
|
|
47
52
|
* ```ts
|
|
48
|
-
* table_setGlobalFilter(table,
|
|
53
|
+
* table_setGlobalFilter(table, 'search text')
|
|
49
54
|
* ```
|
|
50
55
|
*/
|
|
51
56
|
declare function table_setGlobalFilter<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, updater: any): void;
|
|
52
57
|
/**
|
|
53
|
-
* Resets the
|
|
58
|
+
* Resets `globalFilter` to the configured initial state or feature default.
|
|
54
59
|
*
|
|
55
|
-
*
|
|
60
|
+
* With no argument, the reset clones `table.initialState.globalFilter`. Passing
|
|
61
|
+
* `true` ignores initial state and resets to `undefined`.
|
|
56
62
|
*
|
|
57
63
|
* @example
|
|
58
64
|
* ```ts
|
|
@@ -6,53 +6,59 @@ import { Table_Internal } from "../../types/Table.js";
|
|
|
6
6
|
|
|
7
7
|
//#region src/features/global-filtering/globalFilteringFeature.utils.d.ts
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Checks whether this accessor column participates in global filtering.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
11
|
+
* The column must have an accessor and pass column-level, table-level, and
|
|
12
|
+
* optional `getColumnCanGlobalFilter` checks.
|
|
12
13
|
*
|
|
13
14
|
* @example
|
|
14
15
|
* ```ts
|
|
15
|
-
* const
|
|
16
|
+
* const canGlobalFilter = column_getCanGlobalFilter(column)
|
|
16
17
|
* ```
|
|
17
18
|
*/
|
|
18
19
|
declare function column_getCanGlobalFilter<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(column: Column_Internal<TFeatures, TData, TValue>): boolean;
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
+
* Provides the built-in automatic global filter function.
|
|
21
22
|
*
|
|
22
|
-
*
|
|
23
|
+
* Global filtering defaults to `includesString`, which gives search-box style
|
|
24
|
+
* matching across globally filterable columns.
|
|
23
25
|
*
|
|
24
26
|
* @example
|
|
25
27
|
* ```ts
|
|
26
|
-
* const
|
|
28
|
+
* const filterFn = table_getGlobalAutoFilterFn()
|
|
27
29
|
* ```
|
|
28
30
|
*/
|
|
29
31
|
declare function table_getGlobalAutoFilterFn(): FilterFn<any, any>;
|
|
30
32
|
/**
|
|
31
|
-
*
|
|
33
|
+
* Resolves the filter function used for global filtering.
|
|
32
34
|
*
|
|
33
|
-
*
|
|
35
|
+
* Function-valued `options.globalFilterFn` is returned directly, `'auto'`
|
|
36
|
+
* delegates to `table_getGlobalAutoFilterFn`, and string values are looked up in
|
|
37
|
+
* the table's filter function registry.
|
|
34
38
|
*
|
|
35
39
|
* @example
|
|
36
40
|
* ```ts
|
|
37
|
-
* const
|
|
41
|
+
* const filterFn = table_getGlobalFilterFn(table)
|
|
38
42
|
* ```
|
|
39
43
|
*/
|
|
40
44
|
declare function table_getGlobalFilterFn<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): FilterFn<TFeatures, TData> | FilterFn<TFeatures, TData> | undefined;
|
|
41
45
|
/**
|
|
42
|
-
*
|
|
46
|
+
* Routes a global filter updater through the table's global filter handler.
|
|
43
47
|
*
|
|
44
|
-
* The updater
|
|
48
|
+
* The updater may be a next value or a function of the previous value, matching
|
|
49
|
+
* the instance `table.setGlobalFilter` behavior.
|
|
45
50
|
*
|
|
46
51
|
* @example
|
|
47
52
|
* ```ts
|
|
48
|
-
* table_setGlobalFilter(table,
|
|
53
|
+
* table_setGlobalFilter(table, 'search text')
|
|
49
54
|
* ```
|
|
50
55
|
*/
|
|
51
56
|
declare function table_setGlobalFilter<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, updater: any): void;
|
|
52
57
|
/**
|
|
53
|
-
* Resets the
|
|
58
|
+
* Resets `globalFilter` to the configured initial state or feature default.
|
|
54
59
|
*
|
|
55
|
-
*
|
|
60
|
+
* With no argument, the reset clones `table.initialState.globalFilter`. Passing
|
|
61
|
+
* `true` ignores initial state and resets to `undefined`.
|
|
56
62
|
*
|
|
57
63
|
* @example
|
|
58
64
|
* ```ts
|
|
@@ -3,13 +3,14 @@ import { filterFn_includesString } from "../../fns/filterFns.js";
|
|
|
3
3
|
|
|
4
4
|
//#region src/features/global-filtering/globalFilteringFeature.utils.ts
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Checks whether this accessor column participates in global filtering.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* The column must have an accessor and pass column-level, table-level, and
|
|
9
|
+
* optional `getColumnCanGlobalFilter` checks.
|
|
9
10
|
*
|
|
10
11
|
* @example
|
|
11
12
|
* ```ts
|
|
12
|
-
* const
|
|
13
|
+
* const canGlobalFilter = column_getCanGlobalFilter(column)
|
|
13
14
|
* ```
|
|
14
15
|
*/
|
|
15
16
|
function column_getCanGlobalFilter(column) {
|
|
@@ -17,26 +18,29 @@ function column_getCanGlobalFilter(column) {
|
|
|
17
18
|
return (column.columnDef.enableGlobalFilter ?? true) && (column.table.options.enableGlobalFilter ?? true) && (column.table.options.enableFilters ?? true) && (((_column$table$options = (_column$table$options2 = column.table.options).getColumnCanGlobalFilter) === null || _column$table$options === void 0 ? void 0 : _column$table$options.call(_column$table$options2, column)) ?? true) && !!column.accessorFn;
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
+
* Provides the built-in automatic global filter function.
|
|
21
22
|
*
|
|
22
|
-
*
|
|
23
|
+
* Global filtering defaults to `includesString`, which gives search-box style
|
|
24
|
+
* matching across globally filterable columns.
|
|
23
25
|
*
|
|
24
26
|
* @example
|
|
25
27
|
* ```ts
|
|
26
|
-
* const
|
|
28
|
+
* const filterFn = table_getGlobalAutoFilterFn()
|
|
27
29
|
* ```
|
|
28
30
|
*/
|
|
29
31
|
function table_getGlobalAutoFilterFn() {
|
|
30
32
|
return filterFn_includesString;
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
|
-
*
|
|
35
|
+
* Resolves the filter function used for global filtering.
|
|
34
36
|
*
|
|
35
|
-
*
|
|
37
|
+
* Function-valued `options.globalFilterFn` is returned directly, `'auto'`
|
|
38
|
+
* delegates to `table_getGlobalAutoFilterFn`, and string values are looked up in
|
|
39
|
+
* the table's filter function registry.
|
|
36
40
|
*
|
|
37
41
|
* @example
|
|
38
42
|
* ```ts
|
|
39
|
-
* const
|
|
43
|
+
* const filterFn = table_getGlobalFilterFn(table)
|
|
40
44
|
* ```
|
|
41
45
|
*/
|
|
42
46
|
function table_getGlobalFilterFn(table) {
|
|
@@ -45,13 +49,14 @@ function table_getGlobalFilterFn(table) {
|
|
|
45
49
|
return isFunction(globalFilterFn) ? globalFilterFn : globalFilterFn === "auto" ? table_getGlobalAutoFilterFn() : filterFns === null || filterFns === void 0 ? void 0 : filterFns[globalFilterFn];
|
|
46
50
|
}
|
|
47
51
|
/**
|
|
48
|
-
*
|
|
52
|
+
* Routes a global filter updater through the table's global filter handler.
|
|
49
53
|
*
|
|
50
|
-
* The updater
|
|
54
|
+
* The updater may be a next value or a function of the previous value, matching
|
|
55
|
+
* the instance `table.setGlobalFilter` behavior.
|
|
51
56
|
*
|
|
52
57
|
* @example
|
|
53
58
|
* ```ts
|
|
54
|
-
* table_setGlobalFilter(table,
|
|
59
|
+
* table_setGlobalFilter(table, 'search text')
|
|
55
60
|
* ```
|
|
56
61
|
*/
|
|
57
62
|
function table_setGlobalFilter(table, updater) {
|
|
@@ -59,9 +64,10 @@ function table_setGlobalFilter(table, updater) {
|
|
|
59
64
|
(_table$options$onGlob = (_table$options = table.options).onGlobalFilterChange) === null || _table$options$onGlob === void 0 || _table$options$onGlob.call(_table$options, updater);
|
|
60
65
|
}
|
|
61
66
|
/**
|
|
62
|
-
* Resets the
|
|
67
|
+
* Resets `globalFilter` to the configured initial state or feature default.
|
|
63
68
|
*
|
|
64
|
-
*
|
|
69
|
+
* With no argument, the reset clones `table.initialState.globalFilter`. Passing
|
|
70
|
+
* `true` ignores initial state and resets to `undefined`.
|
|
65
71
|
*
|
|
66
72
|
* @example
|
|
67
73
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalFilteringFeature.utils.js","names":[],"sources":["../../../src/features/global-filtering/globalFilteringFeature.utils.ts"],"sourcesContent":["import { filterFn_includesString } from '../../fns/filterFns'\nimport { cloneState, isFunction } from '../../utils'\nimport type { Column_Internal } from '../../types/Column'\nimport type { FilterFn } from '../column-filtering/columnFilteringFeature.types'\nimport type { CellData, RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"globalFilteringFeature.utils.js","names":[],"sources":["../../../src/features/global-filtering/globalFilteringFeature.utils.ts"],"sourcesContent":["import { filterFn_includesString } from '../../fns/filterFns'\nimport { cloneState, isFunction } from '../../utils'\nimport type { Column_Internal } from '../../types/Column'\nimport type { FilterFn } from '../column-filtering/columnFilteringFeature.types'\nimport type { CellData, RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\n\n/**\n * Checks whether this accessor column participates in global filtering.\n *\n * The column must have an accessor and pass column-level, table-level, and\n * optional `getColumnCanGlobalFilter` checks.\n *\n * @example\n * ```ts\n * const canGlobalFilter = column_getCanGlobalFilter(column)\n * ```\n */\nexport function column_getCanGlobalFilter<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(column: Column_Internal<TFeatures, TData, TValue>): boolean {\n return (\n (column.columnDef.enableGlobalFilter ?? true) &&\n (column.table.options.enableGlobalFilter ?? true) &&\n (column.table.options.enableFilters ?? true) &&\n (column.table.options.getColumnCanGlobalFilter?.(column) ?? true) &&\n !!column.accessorFn\n )\n}\n\n/**\n * Provides the built-in automatic global filter function.\n *\n * Global filtering defaults to `includesString`, which gives search-box style\n * matching across globally filterable columns.\n *\n * @example\n * ```ts\n * const filterFn = table_getGlobalAutoFilterFn()\n * ```\n */\nexport function table_getGlobalAutoFilterFn() {\n return filterFn_includesString\n}\n\n/**\n * Resolves the filter function used for global filtering.\n *\n * Function-valued `options.globalFilterFn` is returned directly, `'auto'`\n * delegates to `table_getGlobalAutoFilterFn`, and string values are looked up in\n * the table's filter function registry.\n *\n * @example\n * ```ts\n * const filterFn = table_getGlobalFilterFn(table)\n * ```\n */\nexport function table_getGlobalFilterFn<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n): FilterFn<TFeatures, TData> | FilterFn<TFeatures, TData> | undefined {\n const { globalFilterFn: globalFilterFn } = table.options\n const filterFns: Record<string, FilterFn<TFeatures, TData>> | undefined =\n table._rowModelFns.filterFns\n\n return isFunction(globalFilterFn)\n ? globalFilterFn\n : globalFilterFn === 'auto'\n ? table_getGlobalAutoFilterFn()\n : filterFns?.[globalFilterFn as string]\n}\n\n/**\n * Routes a global filter updater through the table's global filter handler.\n *\n * The updater may be a next value or a function of the previous value, matching\n * the instance `table.setGlobalFilter` behavior.\n *\n * @example\n * ```ts\n * table_setGlobalFilter(table, 'search text')\n * ```\n */\nexport function table_setGlobalFilter<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, updater: any) {\n table.options.onGlobalFilterChange?.(updater)\n}\n\n/**\n * Resets `globalFilter` to the configured initial state or feature default.\n *\n * With no argument, the reset clones `table.initialState.globalFilter`. Passing\n * `true` ignores initial state and resets to `undefined`.\n *\n * @example\n * ```ts\n * table_resetGlobalFilter(table)\n * table_resetGlobalFilter(table, true)\n * ```\n */\nexport function table_resetGlobalFilter<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {\n table_setGlobalFilter(\n table,\n defaultState ? undefined : cloneState(table.initialState.globalFilter),\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,SAAgB,0BAId,QAA4D;;CAC5D,QACG,OAAO,UAAU,sBAAsB,UACvC,OAAO,MAAM,QAAQ,sBAAsB,UAC3C,OAAO,MAAM,QAAQ,iBAAiB,8DACtC,OAAO,MAAM,SAAQ,qIAA2B,OAAO,KAAI,SAC5D,CAAC,CAAC,OAAO;;;;;;;;;;;;;AAeb,SAAgB,8BAA8B;CAC5C,OAAO;;;;;;;;;;;;;;AAeT,SAAgB,wBAId,OACqE;CACrE,MAAM,EAAkB,mBAAmB,MAAM;CACjD,MAAM,YACJ,MAAM,aAAa;CAErB,OAAO,WAAW,eAAe,GAC7B,iBACA,mBAAmB,SACjB,6BAA6B,yDAC7B,UAAY;;;;;;;;;;;;;AAcpB,SAAgB,sBAGd,OAAyC,SAAc;;CACvD,iDAAM,SAAQ,iHAAuB,QAAQ;;;;;;;;;;;;;;AAe/C,SAAgB,wBAGd,OAAyC,cAAwB;CACjE,sBACE,OACA,eAAe,SAAY,WAAW,MAAM,aAAa,aAAa,CACvE"}
|
|
@@ -12,19 +12,19 @@ interface TableState_RowExpanding {
|
|
|
12
12
|
}
|
|
13
13
|
interface Row_RowExpanding {
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Checks whether this row can be expanded.
|
|
16
16
|
*/
|
|
17
17
|
getCanExpand: () => boolean;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Checks whether every ancestor of this row is expanded.
|
|
20
20
|
*/
|
|
21
21
|
getIsAllParentsExpanded: () => boolean;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Checks whether this row is currently expanded.
|
|
24
24
|
*/
|
|
25
25
|
getIsExpanded: () => boolean;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* Creates a handler that toggles this row's expanded state.
|
|
28
28
|
*/
|
|
29
29
|
getToggleExpandedHandler: () => () => void;
|
|
30
30
|
/**
|
|
@@ -38,7 +38,7 @@ interface TableOptions_RowExpanding<TFeatures extends TableFeatures, TData exten
|
|
|
38
38
|
*/
|
|
39
39
|
autoResetExpanded?: boolean;
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
41
|
+
* Allows rows with subRows to be expanded.
|
|
42
42
|
*/
|
|
43
43
|
enableExpanding?: boolean;
|
|
44
44
|
/**
|
|
@@ -67,32 +67,33 @@ interface TableOptions_RowExpanding<TFeatures extends TableFeatures, TData exten
|
|
|
67
67
|
interface Table_RowExpanding<TFeatures extends TableFeatures, TData extends RowData> {
|
|
68
68
|
autoResetExpanded: () => void;
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
70
|
+
* Checks whether at least one row can be expanded.
|
|
71
71
|
*/
|
|
72
72
|
getCanSomeRowsExpand: () => boolean;
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
74
|
+
* Computes the deepest expanded row id depth.
|
|
75
75
|
*/
|
|
76
76
|
getExpandedDepth: () => number;
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
78
|
+
* Checks whether all rows in the current row model are expanded.
|
|
79
79
|
*/
|
|
80
80
|
getIsAllRowsExpanded: () => boolean;
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
82
|
+
* Checks whether any row is currently expanded.
|
|
83
83
|
*/
|
|
84
84
|
getIsSomeRowsExpanded: () => boolean;
|
|
85
85
|
/**
|
|
86
|
-
*
|
|
86
|
+
* Creates a handler that toggles all rows expanded.
|
|
87
87
|
*/
|
|
88
88
|
getToggleAllRowsExpandedHandler: () => (event: unknown) => void;
|
|
89
89
|
/**
|
|
90
|
-
* Resets expanded
|
|
91
|
-
*
|
|
90
|
+
* Resets `expanded` to `initialState.expanded`.
|
|
91
|
+
*
|
|
92
|
+
* Pass `true` to ignore initial state and reset to `{}`.
|
|
92
93
|
*/
|
|
93
94
|
resetExpanded: (defaultState?: boolean) => void;
|
|
94
95
|
/**
|
|
95
|
-
*
|
|
96
|
+
* Updates expanded state with `true`, a row-id map, or an updater function.
|
|
96
97
|
*/
|
|
97
98
|
setExpanded: (updater: Updater<ExpandedState>) => void;
|
|
98
99
|
/**
|
|
@@ -102,11 +103,11 @@ interface Table_RowExpanding<TFeatures extends TableFeatures, TData extends RowD
|
|
|
102
103
|
}
|
|
103
104
|
interface Table_RowModels_Expanded<TFeatures extends TableFeatures, TData extends RowData> {
|
|
104
105
|
/**
|
|
105
|
-
*
|
|
106
|
+
* Resolves the row model after expanded rows have been flattened into view.
|
|
106
107
|
*/
|
|
107
108
|
getExpandedRowModel: () => RowModel<TFeatures, TData>;
|
|
108
109
|
/**
|
|
109
|
-
*
|
|
110
|
+
* Reads the row model immediately before expansion.
|
|
110
111
|
*/
|
|
111
112
|
getPreExpandedRowModel: () => RowModel<TFeatures, TData>;
|
|
112
113
|
}
|
|
@@ -12,19 +12,19 @@ interface TableState_RowExpanding {
|
|
|
12
12
|
}
|
|
13
13
|
interface Row_RowExpanding {
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Checks whether this row can be expanded.
|
|
16
16
|
*/
|
|
17
17
|
getCanExpand: () => boolean;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Checks whether every ancestor of this row is expanded.
|
|
20
20
|
*/
|
|
21
21
|
getIsAllParentsExpanded: () => boolean;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Checks whether this row is currently expanded.
|
|
24
24
|
*/
|
|
25
25
|
getIsExpanded: () => boolean;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* Creates a handler that toggles this row's expanded state.
|
|
28
28
|
*/
|
|
29
29
|
getToggleExpandedHandler: () => () => void;
|
|
30
30
|
/**
|
|
@@ -38,7 +38,7 @@ interface TableOptions_RowExpanding<TFeatures extends TableFeatures, TData exten
|
|
|
38
38
|
*/
|
|
39
39
|
autoResetExpanded?: boolean;
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
41
|
+
* Allows rows with subRows to be expanded.
|
|
42
42
|
*/
|
|
43
43
|
enableExpanding?: boolean;
|
|
44
44
|
/**
|
|
@@ -67,32 +67,33 @@ interface TableOptions_RowExpanding<TFeatures extends TableFeatures, TData exten
|
|
|
67
67
|
interface Table_RowExpanding<TFeatures extends TableFeatures, TData extends RowData> {
|
|
68
68
|
autoResetExpanded: () => void;
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
70
|
+
* Checks whether at least one row can be expanded.
|
|
71
71
|
*/
|
|
72
72
|
getCanSomeRowsExpand: () => boolean;
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
74
|
+
* Computes the deepest expanded row id depth.
|
|
75
75
|
*/
|
|
76
76
|
getExpandedDepth: () => number;
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
78
|
+
* Checks whether all rows in the current row model are expanded.
|
|
79
79
|
*/
|
|
80
80
|
getIsAllRowsExpanded: () => boolean;
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
82
|
+
* Checks whether any row is currently expanded.
|
|
83
83
|
*/
|
|
84
84
|
getIsSomeRowsExpanded: () => boolean;
|
|
85
85
|
/**
|
|
86
|
-
*
|
|
86
|
+
* Creates a handler that toggles all rows expanded.
|
|
87
87
|
*/
|
|
88
88
|
getToggleAllRowsExpandedHandler: () => (event: unknown) => void;
|
|
89
89
|
/**
|
|
90
|
-
* Resets expanded
|
|
91
|
-
*
|
|
90
|
+
* Resets `expanded` to `initialState.expanded`.
|
|
91
|
+
*
|
|
92
|
+
* Pass `true` to ignore initial state and reset to `{}`.
|
|
92
93
|
*/
|
|
93
94
|
resetExpanded: (defaultState?: boolean) => void;
|
|
94
95
|
/**
|
|
95
|
-
*
|
|
96
|
+
* Updates expanded state with `true`, a row-id map, or an updater function.
|
|
96
97
|
*/
|
|
97
98
|
setExpanded: (updater: Updater<ExpandedState>) => void;
|
|
98
99
|
/**
|
|
@@ -102,11 +103,11 @@ interface Table_RowExpanding<TFeatures extends TableFeatures, TData extends RowD
|
|
|
102
103
|
}
|
|
103
104
|
interface Table_RowModels_Expanded<TFeatures extends TableFeatures, TData extends RowData> {
|
|
104
105
|
/**
|
|
105
|
-
*
|
|
106
|
+
* Resolves the row model after expanded rows have been flattened into view.
|
|
106
107
|
*/
|
|
107
108
|
getExpandedRowModel: () => RowModel<TFeatures, TData>;
|
|
108
109
|
/**
|
|
109
|
-
*
|
|
110
|
+
* Reads the row model immediately before expansion.
|
|
110
111
|
*/
|
|
111
112
|
getPreExpandedRowModel: () => RowModel<TFeatures, TData>;
|
|
112
113
|
}
|