@tanstack/table-core 9.0.0-beta.2 → 9.0.0-beta.7
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/dist/core/cells/coreCellsFeature.cjs +11 -20
- package/dist/core/cells/coreCellsFeature.cjs.map +1 -1
- package/dist/core/cells/coreCellsFeature.d.cts +4 -12
- package/dist/core/cells/coreCellsFeature.d.ts +4 -12
- package/dist/core/cells/coreCellsFeature.js +12 -20
- package/dist/core/cells/coreCellsFeature.js.map +1 -1
- package/dist/core/columns/coreColumnsFeature.cjs +59 -68
- package/dist/core/columns/coreColumnsFeature.cjs.map +1 -1
- package/dist/core/columns/coreColumnsFeature.d.cts +4 -12
- package/dist/core/columns/coreColumnsFeature.d.ts +4 -12
- package/dist/core/columns/coreColumnsFeature.js +60 -68
- package/dist/core/columns/coreColumnsFeature.js.map +1 -1
- package/dist/core/headers/buildHeaderGroups.cjs.map +1 -1
- package/dist/core/headers/buildHeaderGroups.js.map +1 -1
- package/dist/core/headers/coreHeadersFeature.cjs +44 -53
- package/dist/core/headers/coreHeadersFeature.cjs.map +1 -1
- package/dist/core/headers/coreHeadersFeature.d.cts +4 -12
- package/dist/core/headers/coreHeadersFeature.d.ts +4 -12
- package/dist/core/headers/coreHeadersFeature.js +45 -53
- package/dist/core/headers/coreHeadersFeature.js.map +1 -1
- package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
- package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.cjs +17 -26
- package/dist/core/row-models/coreRowModelsFeature.cjs.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.d.cts +4 -12
- package/dist/core/row-models/coreRowModelsFeature.d.ts +4 -12
- package/dist/core/row-models/coreRowModelsFeature.js +18 -26
- package/dist/core/row-models/coreRowModelsFeature.js.map +1 -1
- package/dist/core/row-models/coreRowModelsFeature.types.d.cts +3 -5
- package/dist/core/row-models/coreRowModelsFeature.types.d.ts +3 -5
- package/dist/core/row-models/createCoreRowModel.cjs.map +1 -1
- package/dist/core/row-models/createCoreRowModel.js.map +1 -1
- package/dist/core/rows/coreRowsFeature.cjs +27 -36
- package/dist/core/rows/coreRowsFeature.cjs.map +1 -1
- package/dist/core/rows/coreRowsFeature.d.cts +4 -12
- package/dist/core/rows/coreRowsFeature.d.ts +4 -12
- package/dist/core/rows/coreRowsFeature.js +28 -36
- package/dist/core/rows/coreRowsFeature.js.map +1 -1
- package/dist/core/table/constructTable.cjs +2 -2
- package/dist/core/table/constructTable.cjs.map +1 -1
- package/dist/core/table/constructTable.js +2 -2
- package/dist/core/table/constructTable.js.map +1 -1
- package/dist/core/table/coreTablesFeature.cjs +7 -16
- package/dist/core/table/coreTablesFeature.cjs.map +1 -1
- package/dist/core/table/coreTablesFeature.d.cts +4 -12
- package/dist/core/table/coreTablesFeature.d.ts +4 -12
- package/dist/core/table/coreTablesFeature.js +8 -16
- package/dist/core/table/coreTablesFeature.js.map +1 -1
- package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
- package/dist/core/table/coreTablesFeature.utils.js.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.cjs +49 -61
- package/dist/features/column-faceting/columnFacetingFeature.cjs.map +1 -1
- package/dist/features/column-faceting/columnFacetingFeature.d.cts +4 -15
- package/dist/features/column-faceting/columnFacetingFeature.d.ts +4 -15
- package/dist/features/column-faceting/columnFacetingFeature.js +50 -61
- package/dist/features/column-faceting/columnFacetingFeature.js.map +1 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.cjs.map +1 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.js.map +1 -1
- package/dist/features/column-faceting/createFacetedRowModel.cjs.map +1 -1
- package/dist/features/column-faceting/createFacetedRowModel.js.map +1 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.cjs.map +1 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.js.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.cjs +40 -53
- package/dist/features/column-filtering/columnFilteringFeature.cjs.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.d.cts +4 -16
- package/dist/features/column-filtering/columnFilteringFeature.d.ts +4 -16
- package/dist/features/column-filtering/columnFilteringFeature.js +41 -53
- package/dist/features/column-filtering/columnFilteringFeature.js.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +3 -3
- package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +3 -3
- package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.cts +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.ts +1 -1
- package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +1 -1
- package/dist/features/column-filtering/createFilteredRowModel.cjs.map +1 -1
- package/dist/features/column-filtering/createFilteredRowModel.d.cts +1 -1
- package/dist/features/column-filtering/createFilteredRowModel.d.ts +1 -1
- package/dist/features/column-filtering/createFilteredRowModel.js.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.cjs +57 -69
- package/dist/features/column-grouping/columnGroupingFeature.cjs.map +1 -1
- package/dist/features/column-grouping/columnGroupingFeature.d.cts +4 -15
- package/dist/features/column-grouping/columnGroupingFeature.d.ts +4 -15
- package/dist/features/column-grouping/columnGroupingFeature.js +58 -69
- package/dist/features/column-grouping/columnGroupingFeature.js.map +1 -1
- package/dist/features/column-grouping/createGroupedRowModel.cjs.map +1 -1
- package/dist/features/column-grouping/createGroupedRowModel.js.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.cjs +47 -59
- package/dist/features/column-ordering/columnOrderingFeature.cjs.map +1 -1
- package/dist/features/column-ordering/columnOrderingFeature.d.cts +4 -15
- package/dist/features/column-ordering/columnOrderingFeature.d.ts +4 -15
- package/dist/features/column-ordering/columnOrderingFeature.js +48 -59
- package/dist/features/column-ordering/columnOrderingFeature.js.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.cjs +209 -221
- package/dist/features/column-pinning/columnPinningFeature.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.d.cts +4 -15
- package/dist/features/column-pinning/columnPinningFeature.d.ts +4 -15
- package/dist/features/column-pinning/columnPinningFeature.js +210 -221
- package/dist/features/column-pinning/columnPinningFeature.js.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
- package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +12 -12
- package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +12 -12
- package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.cjs +31 -43
- package/dist/features/column-resizing/columnResizingFeature.cjs.map +1 -1
- package/dist/features/column-resizing/columnResizingFeature.d.cts +4 -15
- package/dist/features/column-resizing/columnResizingFeature.d.ts +4 -15
- package/dist/features/column-resizing/columnResizingFeature.js +32 -43
- package/dist/features/column-resizing/columnResizingFeature.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.cjs +112 -125
- package/dist/features/column-sizing/columnSizingFeature.cjs.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.d.cts +4 -16
- package/dist/features/column-sizing/columnSizingFeature.d.ts +4 -16
- package/dist/features/column-sizing/columnSizingFeature.js +113 -125
- package/dist/features/column-sizing/columnSizingFeature.js.map +1 -1
- package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +3 -3
- package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +3 -3
- package/dist/features/column-visibility/columnVisibilityFeature.cjs +83 -95
- package/dist/features/column-visibility/columnVisibilityFeature.cjs.map +1 -1
- package/dist/features/column-visibility/columnVisibilityFeature.d.cts +4 -15
- package/dist/features/column-visibility/columnVisibilityFeature.d.ts +4 -15
- package/dist/features/column-visibility/columnVisibilityFeature.js +84 -95
- package/dist/features/column-visibility/columnVisibilityFeature.js.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.cjs +31 -43
- package/dist/features/global-filtering/globalFilteringFeature.cjs.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.d.cts +4 -15
- package/dist/features/global-filtering/globalFilteringFeature.d.ts +4 -15
- package/dist/features/global-filtering/globalFilteringFeature.js +32 -43
- package/dist/features/global-filtering/globalFilteringFeature.js.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -1
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.cts +4 -2
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.ts +4 -2
- package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +1 -1
- package/dist/features/row-expanding/createExpandedRowModel.cjs.map +1 -1
- package/dist/features/row-expanding/createExpandedRowModel.js.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.cjs +37 -49
- package/dist/features/row-expanding/rowExpandingFeature.cjs.map +1 -1
- package/dist/features/row-expanding/rowExpandingFeature.d.cts +4 -15
- package/dist/features/row-expanding/rowExpandingFeature.d.ts +4 -15
- package/dist/features/row-expanding/rowExpandingFeature.js +38 -49
- package/dist/features/row-expanding/rowExpandingFeature.js.map +1 -1
- package/dist/features/row-pagination/createPaginatedRowModel.cjs.map +1 -1
- package/dist/features/row-pagination/createPaginatedRowModel.js.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.cjs +35 -47
- package/dist/features/row-pagination/rowPaginationFeature.cjs.map +1 -1
- package/dist/features/row-pagination/rowPaginationFeature.d.cts +4 -15
- package/dist/features/row-pagination/rowPaginationFeature.d.ts +4 -15
- package/dist/features/row-pagination/rowPaginationFeature.js +36 -47
- package/dist/features/row-pagination/rowPaginationFeature.js.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.cjs +55 -67
- package/dist/features/row-pinning/rowPinningFeature.cjs.map +1 -1
- package/dist/features/row-pinning/rowPinningFeature.d.cts +4 -15
- package/dist/features/row-pinning/rowPinningFeature.d.ts +4 -15
- package/dist/features/row-pinning/rowPinningFeature.js +56 -67
- package/dist/features/row-pinning/rowPinningFeature.js.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.cjs +65 -77
- package/dist/features/row-selection/rowSelectionFeature.cjs.map +1 -1
- package/dist/features/row-selection/rowSelectionFeature.d.cts +4 -15
- package/dist/features/row-selection/rowSelectionFeature.d.ts +4 -15
- package/dist/features/row-selection/rowSelectionFeature.js +66 -77
- package/dist/features/row-selection/rowSelectionFeature.js.map +1 -1
- package/dist/features/row-sorting/createSortedRowModel.cjs.map +1 -1
- package/dist/features/row-sorting/createSortedRowModel.js.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.cjs +45 -57
- package/dist/features/row-sorting/rowSortingFeature.cjs.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.d.cts +4 -15
- package/dist/features/row-sorting/rowSortingFeature.d.ts +4 -15
- package/dist/features/row-sorting/rowSortingFeature.js +46 -57
- package/dist/features/row-sorting/rowSortingFeature.js.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs +8 -5
- package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +1 -1
- package/dist/features/row-sorting/rowSortingFeature.utils.js +8 -5
- package/dist/features/row-sorting/rowSortingFeature.utils.js.map +1 -1
- package/dist/fns/aggregationFns.cjs +18 -18
- package/dist/fns/aggregationFns.cjs.map +1 -1
- package/dist/fns/aggregationFns.d.cts +21 -19
- package/dist/fns/aggregationFns.d.ts +21 -19
- package/dist/fns/aggregationFns.js +18 -18
- package/dist/fns/aggregationFns.js.map +1 -1
- package/dist/fns/filterFns.cjs +51 -65
- package/dist/fns/filterFns.cjs.map +1 -1
- package/dist/fns/filterFns.d.cts +82 -28
- package/dist/fns/filterFns.d.ts +82 -28
- package/dist/fns/filterFns.js +51 -65
- package/dist/fns/filterFns.js.map +1 -1
- package/dist/fns/sortFns.cjs +18 -6
- package/dist/fns/sortFns.cjs.map +1 -1
- package/dist/fns/sortFns.d.cts +15 -13
- package/dist/fns/sortFns.d.ts +15 -13
- package/dist/fns/sortFns.js +18 -6
- package/dist/fns/sortFns.js.map +1 -1
- package/dist/index.cjs +0 -20
- package/dist/index.d.cts +34 -34
- package/dist/index.d.ts +34 -34
- package/dist/index.js +21 -21
- package/dist/types/Cell.d.cts +3 -8
- package/dist/types/Cell.d.ts +3 -8
- package/dist/types/Column.d.cts +3 -8
- package/dist/types/Column.d.ts +3 -8
- package/dist/types/ColumnDef.d.cts +3 -8
- package/dist/types/ColumnDef.d.ts +3 -8
- package/dist/types/Header.d.cts +3 -8
- package/dist/types/Header.d.ts +3 -8
- package/dist/types/HeaderGroup.d.cts +3 -8
- package/dist/types/HeaderGroup.d.ts +3 -8
- package/dist/types/Row.d.cts +3 -8
- package/dist/types/Row.d.ts +3 -8
- package/dist/types/RowModel.d.cts +4 -10
- package/dist/types/RowModel.d.ts +4 -10
- package/dist/types/RowModelFns.d.cts +3 -8
- package/dist/types/RowModelFns.d.ts +3 -8
- package/dist/types/Table.d.cts +3 -8
- package/dist/types/Table.d.ts +3 -8
- package/dist/types/TableFeatures.d.cts +13 -39
- package/dist/types/TableFeatures.d.ts +13 -39
- package/dist/types/TableOptions.d.cts +3 -4
- package/dist/types/TableOptions.d.ts +3 -4
- package/dist/types/TableState.d.cts +5 -10
- package/dist/types/TableState.d.ts +5 -10
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/core/cells/coreCellsFeature.ts +17 -39
- package/src/core/columns/coreColumnsFeature.ts +56 -83
- package/src/core/headers/buildHeaderGroups.ts +1 -1
- package/src/core/headers/coreHeadersFeature.ts +42 -64
- package/src/core/headers/coreHeadersFeature.utils.ts +1 -1
- package/src/core/row-models/coreRowModelsFeature.ts +43 -64
- package/src/core/row-models/coreRowModelsFeature.types.ts +2 -6
- package/src/core/row-models/createCoreRowModel.ts +1 -1
- package/src/core/rows/coreRowsFeature.ts +45 -72
- package/src/core/table/constructTable.ts +10 -7
- package/src/core/table/coreTablesFeature.ts +13 -35
- package/src/core/table/coreTablesFeature.utils.ts +1 -1
- package/src/features/column-faceting/columnFacetingFeature.ts +71 -102
- package/src/features/column-faceting/createFacetedMinMaxValues.ts +1 -1
- package/src/features/column-faceting/createFacetedRowModel.ts +1 -1
- package/src/features/column-faceting/createFacetedUniqueValues.ts +1 -1
- package/src/features/column-filtering/columnFilteringFeature.ts +60 -103
- package/src/features/column-filtering/columnFilteringFeature.types.ts +3 -3
- package/src/features/column-filtering/columnFilteringFeature.utils.ts +4 -4
- package/src/features/column-filtering/createFilteredRowModel.ts +2 -2
- package/src/features/column-grouping/columnGroupingFeature.ts +82 -126
- package/src/features/column-grouping/createGroupedRowModel.ts +1 -1
- package/src/features/column-ordering/columnOrderingFeature.ts +52 -84
- package/src/features/column-pinning/columnPinningFeature.ts +268 -304
- package/src/features/column-pinning/columnPinningFeature.utils.ts +5 -5
- package/src/features/column-resizing/columnResizingFeature.ts +44 -78
- package/src/features/column-sizing/columnSizingFeature.ts +115 -152
- package/src/features/column-visibility/columnVisibilityFeature.ts +92 -129
- package/src/features/global-filtering/globalFilteringFeature.ts +45 -79
- package/src/features/global-filtering/globalFilteringFeature.utils.ts +4 -2
- package/src/features/row-expanding/createExpandedRowModel.ts +1 -1
- package/src/features/row-expanding/rowExpandingFeature.ts +65 -101
- package/src/features/row-pagination/createPaginatedRowModel.ts +1 -1
- package/src/features/row-pagination/rowPaginationFeature.ts +69 -103
- package/src/features/row-pinning/rowPinningFeature.ts +72 -104
- package/src/features/row-selection/rowSelectionFeature.ts +103 -135
- package/src/features/row-sorting/createSortedRowModel.ts +1 -1
- package/src/features/row-sorting/rowSortingFeature.ts +73 -114
- package/src/features/row-sorting/rowSortingFeature.utils.ts +8 -6
- package/src/fns/aggregationFns.ts +26 -42
- package/src/fns/filterFns.ts +231 -264
- package/src/fns/sortFns.ts +51 -29
- package/src/types/Cell.ts +3 -19
- package/src/types/Column.ts +2 -18
- package/src/types/ColumnDef.ts +2 -18
- package/src/types/Header.ts +2 -18
- package/src/types/HeaderGroup.ts +2 -13
- package/src/types/Row.ts +2 -17
- package/src/types/RowModel.ts +3 -25
- package/src/types/RowModelFns.ts +2 -17
- package/src/types/Table.ts +2 -17
- package/src/types/TableFeatures.ts +51 -112
- package/src/types/TableOptions.ts +1 -12
- package/src/types/TableState.ts +4 -30
- package/src/utils.ts +5 -4
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TableFeature, TableFeatures } from "../../types/TableFeatures.js";
|
|
1
|
+
import { TableFeature } from "../../types/TableFeatures.js";
|
|
3
2
|
|
|
4
3
|
//#region src/features/column-visibility/columnVisibilityFeature.d.ts
|
|
5
|
-
interface ColumnVisibilityFeatureConstructors<TFeatures extends TableFeatures, TData extends RowData> {}
|
|
6
4
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
|
|
5
|
+
* Feature that adds column visibility state and APIs for hiding and showing columns.
|
|
10
6
|
*/
|
|
11
|
-
declare
|
|
12
|
-
/**
|
|
13
|
-
* The stock column visibility feature.
|
|
14
|
-
*
|
|
15
|
-
* Register this feature to add column visibility state and APIs for deriving
|
|
16
|
-
* visible columns and visible row cells.
|
|
17
|
-
*/
|
|
18
|
-
declare const columnVisibilityFeature: TableFeature<ColumnVisibilityFeatureConstructors<TableFeatures, RowData>>;
|
|
7
|
+
declare const columnVisibilityFeature: TableFeature;
|
|
19
8
|
//#endregion
|
|
20
|
-
export {
|
|
9
|
+
export { columnVisibilityFeature };
|
|
21
10
|
//# sourceMappingURL=columnVisibilityFeature.d.ts.map
|
|
@@ -3,103 +3,92 @@ import { column_getCanHide, column_getIsVisible, column_getToggleVisibilityHandl
|
|
|
3
3
|
|
|
4
4
|
//#region src/features/column-visibility/columnVisibilityFeature.ts
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
|
|
6
|
+
* Feature that adds column visibility state and APIs for hiding and showing columns.
|
|
9
7
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
column_getCanHide: { fn: (column) => column_getCanHide(column) },
|
|
35
|
-
column_getToggleVisibilityHandler: { fn: (column) => column_getToggleVisibilityHandler(column) },
|
|
36
|
-
column_toggleVisibility: { fn: (column, visible) => column_toggleVisibility(column, visible) }
|
|
37
|
-
});
|
|
38
|
-
},
|
|
39
|
-
assignRowPrototype: (prototype, table) => {
|
|
40
|
-
assignPrototypeAPIs("columnVisibilityFeature", prototype, table, {
|
|
41
|
-
row_getVisibleCells: {
|
|
42
|
-
fn: (row) => row_getVisibleCells(row),
|
|
43
|
-
memoDeps: (row) => {
|
|
44
|
-
var _table$atoms$columnPi, _table$atoms$columnVi2;
|
|
45
|
-
return [
|
|
46
|
-
row.getAllCells(),
|
|
47
|
-
(_table$atoms$columnPi = table.atoms.columnPinning) === null || _table$atoms$columnPi === void 0 ? void 0 : _table$atoms$columnPi.get(),
|
|
48
|
-
(_table$atoms$columnVi2 = table.atoms.columnVisibility) === null || _table$atoms$columnVi2 === void 0 ? void 0 : _table$atoms$columnVi2.get()
|
|
49
|
-
];
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
row_getVisibleCellsByColumnId: {
|
|
53
|
-
fn: (row) => row_getVisibleCellsByColumnId(row),
|
|
54
|
-
memoDeps: (row) => {
|
|
55
|
-
var _table$atoms$columnVi3;
|
|
56
|
-
return [row.getAllCells(), (_table$atoms$columnVi3 = table.atoms.columnVisibility) === null || _table$atoms$columnVi3 === void 0 ? void 0 : _table$atoms$columnVi3.get()];
|
|
57
|
-
}
|
|
8
|
+
const columnVisibilityFeature = {
|
|
9
|
+
getInitialState: (initialState) => {
|
|
10
|
+
return {
|
|
11
|
+
columnVisibility: getDefaultColumnVisibilityState(),
|
|
12
|
+
...initialState
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
getDefaultTableOptions: (table) => {
|
|
16
|
+
return { onColumnVisibilityChange: makeStateUpdater("columnVisibility", table) };
|
|
17
|
+
},
|
|
18
|
+
assignColumnPrototype: (prototype, table) => {
|
|
19
|
+
assignPrototypeAPIs("columnVisibilityFeature", prototype, table, {
|
|
20
|
+
column_getIsVisible: {
|
|
21
|
+
fn: (column) => column_getIsVisible(column),
|
|
22
|
+
memoDeps: (column) => {
|
|
23
|
+
var _table$atoms$columnVi;
|
|
24
|
+
return [
|
|
25
|
+
table.options.columns,
|
|
26
|
+
(_table$atoms$columnVi = table.atoms.columnVisibility) === null || _table$atoms$columnVi === void 0 ? void 0 : _table$atoms$columnVi.get(),
|
|
27
|
+
column.columns
|
|
28
|
+
];
|
|
58
29
|
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
30
|
+
},
|
|
31
|
+
column_getCanHide: { fn: (column) => column_getCanHide(column) },
|
|
32
|
+
column_getToggleVisibilityHandler: { fn: (column) => column_getToggleVisibilityHandler(column) },
|
|
33
|
+
column_toggleVisibility: { fn: (column, visible) => column_toggleVisibility(column, visible) }
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
assignRowPrototype: (prototype, table) => {
|
|
37
|
+
assignPrototypeAPIs("columnVisibilityFeature", prototype, table, {
|
|
38
|
+
row_getVisibleCells: {
|
|
39
|
+
fn: (row) => row_getVisibleCells(row),
|
|
40
|
+
memoDeps: (row) => {
|
|
41
|
+
var _table$atoms$columnPi, _table$atoms$columnVi2;
|
|
42
|
+
return [
|
|
43
|
+
row.getAllCells(),
|
|
44
|
+
(_table$atoms$columnPi = table.atoms.columnPinning) === null || _table$atoms$columnPi === void 0 ? void 0 : _table$atoms$columnPi.get(),
|
|
45
|
+
(_table$atoms$columnVi2 = table.atoms.columnVisibility) === null || _table$atoms$columnVi2 === void 0 ? void 0 : _table$atoms$columnVi2.get()
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
row_getVisibleCellsByColumnId: {
|
|
50
|
+
fn: (row) => row_getVisibleCellsByColumnId(row),
|
|
51
|
+
memoDeps: (row) => {
|
|
52
|
+
var _table$atoms$columnVi3;
|
|
53
|
+
return [row.getAllCells(), (_table$atoms$columnVi3 = table.atoms.columnVisibility) === null || _table$atoms$columnVi3 === void 0 ? void 0 : _table$atoms$columnVi3.get()];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
constructTableAPIs: (table) => {
|
|
59
|
+
assignTableAPIs("columnVisibilityFeature", table, {
|
|
60
|
+
table_getVisibleFlatColumns: {
|
|
61
|
+
fn: () => table_getVisibleFlatColumns(table),
|
|
62
|
+
memoDeps: () => {
|
|
63
|
+
var _table$atoms$columnVi4, _table$atoms$columnOr;
|
|
64
|
+
return [
|
|
65
|
+
(_table$atoms$columnVi4 = table.atoms.columnVisibility) === null || _table$atoms$columnVi4 === void 0 ? void 0 : _table$atoms$columnVi4.get(),
|
|
66
|
+
(_table$atoms$columnOr = table.atoms.columnOrder) === null || _table$atoms$columnOr === void 0 ? void 0 : _table$atoms$columnOr.get(),
|
|
67
|
+
table.options.columns
|
|
68
|
+
];
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
table_getVisibleLeafColumns: {
|
|
72
|
+
fn: () => table_getVisibleLeafColumns(table),
|
|
73
|
+
memoDeps: () => {
|
|
74
|
+
var _table$atoms$columnVi5, _table$atoms$columnOr2;
|
|
75
|
+
return [
|
|
76
|
+
(_table$atoms$columnVi5 = table.atoms.columnVisibility) === null || _table$atoms$columnVi5 === void 0 ? void 0 : _table$atoms$columnVi5.get(),
|
|
77
|
+
(_table$atoms$columnOr2 = table.atoms.columnOrder) === null || _table$atoms$columnOr2 === void 0 ? void 0 : _table$atoms$columnOr2.get(),
|
|
78
|
+
table.options.columns
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
table_setColumnVisibility: { fn: (updater) => table_setColumnVisibility(table, updater) },
|
|
83
|
+
table_resetColumnVisibility: { fn: (defaultState) => table_resetColumnVisibility(table, defaultState) },
|
|
84
|
+
table_toggleAllColumnsVisible: { fn: (value) => table_toggleAllColumnsVisible(table, value) },
|
|
85
|
+
table_getIsAllColumnsVisible: { fn: () => table_getIsAllColumnsVisible(table) },
|
|
86
|
+
table_getIsSomeColumnsVisible: { fn: () => table_getIsSomeColumnsVisible(table) },
|
|
87
|
+
table_getToggleAllColumnsVisibilityHandler: { fn: () => table_getToggleAllColumnsVisibilityHandler(table) }
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
};
|
|
102
91
|
|
|
103
92
|
//#endregion
|
|
104
|
-
export { columnVisibilityFeature
|
|
93
|
+
export { columnVisibilityFeature };
|
|
105
94
|
//# sourceMappingURL=columnVisibilityFeature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columnVisibilityFeature.js","names":[],"sources":["../../../src/features/column-visibility/columnVisibilityFeature.ts"],"sourcesContent":["import {\n assignPrototypeAPIs,\n assignTableAPIs,\n makeStateUpdater,\n} from '../../utils'\nimport {\n column_getCanHide,\n column_getIsVisible,\n column_getToggleVisibilityHandler,\n column_toggleVisibility,\n getDefaultColumnVisibilityState,\n row_getVisibleCells,\n row_getVisibleCellsByColumnId,\n table_getIsAllColumnsVisible,\n table_getIsSomeColumnsVisible,\n table_getToggleAllColumnsVisibilityHandler,\n table_getVisibleFlatColumns,\n table_getVisibleLeafColumns,\n table_resetColumnVisibility,\n table_setColumnVisibility,\n table_toggleAllColumnsVisible,\n} from './columnVisibilityFeature.utils'\nimport type {
|
|
1
|
+
{"version":3,"file":"columnVisibilityFeature.js","names":[],"sources":["../../../src/features/column-visibility/columnVisibilityFeature.ts"],"sourcesContent":["import {\n assignPrototypeAPIs,\n assignTableAPIs,\n makeStateUpdater,\n} from '../../utils'\nimport {\n column_getCanHide,\n column_getIsVisible,\n column_getToggleVisibilityHandler,\n column_toggleVisibility,\n getDefaultColumnVisibilityState,\n row_getVisibleCells,\n row_getVisibleCellsByColumnId,\n table_getIsAllColumnsVisible,\n table_getIsSomeColumnsVisible,\n table_getToggleAllColumnsVisibilityHandler,\n table_getVisibleFlatColumns,\n table_getVisibleLeafColumns,\n table_resetColumnVisibility,\n table_setColumnVisibility,\n table_toggleAllColumnsVisible,\n} from './columnVisibilityFeature.utils'\nimport type { TableFeature } from '../../types/TableFeatures'\n\n/**\n * Feature that adds column visibility state and APIs for hiding and showing columns.\n */\nexport const columnVisibilityFeature: TableFeature = {\n getInitialState: (initialState) => {\n return {\n columnVisibility: getDefaultColumnVisibilityState(),\n ...initialState,\n }\n },\n\n getDefaultTableOptions: (table) => {\n return {\n onColumnVisibilityChange: makeStateUpdater('columnVisibility', table),\n }\n },\n\n assignColumnPrototype: (prototype, table) => {\n assignPrototypeAPIs('columnVisibilityFeature', prototype, table, {\n column_getIsVisible: {\n fn: (column) => column_getIsVisible(column),\n memoDeps: (column) => [\n table.options.columns,\n table.atoms.columnVisibility?.get(),\n column.columns,\n ],\n },\n column_getCanHide: {\n fn: (column) => column_getCanHide(column),\n },\n column_getToggleVisibilityHandler: {\n fn: (column) => column_getToggleVisibilityHandler(column),\n },\n column_toggleVisibility: {\n fn: (column, visible) => column_toggleVisibility(column, visible),\n },\n })\n },\n\n assignRowPrototype: (prototype, table) => {\n assignPrototypeAPIs('columnVisibilityFeature', prototype, table, {\n row_getVisibleCells: {\n fn: (row) => row_getVisibleCells(row),\n memoDeps: (row) => [\n row.getAllCells(),\n table.atoms.columnPinning?.get(),\n table.atoms.columnVisibility?.get(),\n ],\n },\n row_getVisibleCellsByColumnId: {\n fn: (row) => row_getVisibleCellsByColumnId(row),\n memoDeps: (row) => [\n row.getAllCells(),\n table.atoms.columnVisibility?.get(),\n ],\n },\n })\n },\n\n constructTableAPIs: (table) => {\n assignTableAPIs('columnVisibilityFeature', table, {\n table_getVisibleFlatColumns: {\n fn: () => table_getVisibleFlatColumns(table),\n memoDeps: () => [\n table.atoms.columnVisibility?.get(),\n table.atoms.columnOrder?.get(),\n table.options.columns,\n ],\n },\n table_getVisibleLeafColumns: {\n fn: () => table_getVisibleLeafColumns(table),\n memoDeps: () => [\n table.atoms.columnVisibility?.get(),\n table.atoms.columnOrder?.get(),\n table.options.columns,\n ],\n },\n table_setColumnVisibility: {\n fn: (updater) => table_setColumnVisibility(table, updater),\n },\n table_resetColumnVisibility: {\n fn: (defaultState) => table_resetColumnVisibility(table, defaultState),\n },\n table_toggleAllColumnsVisible: {\n fn: (value) => table_toggleAllColumnsVisible(table, value),\n },\n table_getIsAllColumnsVisible: {\n fn: () => table_getIsAllColumnsVisible(table),\n },\n table_getIsSomeColumnsVisible: {\n fn: () => table_getIsSomeColumnsVisible(table),\n },\n table_getToggleAllColumnsVisibilityHandler: {\n fn: () => table_getToggleAllColumnsVisibilityHandler(table),\n },\n })\n },\n}\n"],"mappings":";;;;;;;AA2BA,MAAa,0BAAwC;CACnD,kBAAkB,iBAAiB;EACjC,OAAO;GACL,kBAAkB,gCAAgC;GAClD,GAAG;EACL;CACF;CAEA,yBAAyB,UAAU;EACjC,OAAO,EACL,0BAA0B,iBAAiB,oBAAoB,KAAK,EACtE;CACF;CAEA,wBAAwB,WAAW,UAAU;EAC3C,oBAAoB,2BAA2B,WAAW,OAAO;GAC/D,qBAAqB;IACnB,KAAK,WAAW,oBAAoB,MAAM;IAC1C,WAAW,WAAW;;;MACpB,MAAM,QAAQ;+BACd,MAAM,MAAM,gGAAkB,IAAI;MAClC,OAAO;KACT;;GACF;GACA,mBAAmB,EACjB,KAAK,WAAW,kBAAkB,MAAM,EAC1C;GACA,mCAAmC,EACjC,KAAK,WAAW,kCAAkC,MAAM,EAC1D;GACA,yBAAyB,EACvB,KAAK,QAAQ,YAAY,wBAAwB,QAAQ,OAAO,EAClE;EACF,CAAC;CACH;CAEA,qBAAqB,WAAW,UAAU;EACxC,oBAAoB,2BAA2B,WAAW,OAAO;GAC/D,qBAAqB;IACnB,KAAK,QAAQ,oBAAoB,GAAG;IACpC,WAAW,QAAQ;;;MACjB,IAAI,YAAY;+BAChB,MAAM,MAAM,6FAAe,IAAI;gCAC/B,MAAM,MAAM,kGAAkB,IAAI;KACpC;;GACF;GACA,+BAA+B;IAC7B,KAAK,QAAQ,8BAA8B,GAAG;IAC9C,WAAW,QAAQ;;aACjB,IAAI,YAAY,6BAChB,MAAM,MAAM,kGAAkB,IAAI,CACpC;;GACF;EACF,CAAC;CACH;CAEA,qBAAqB,UAAU;EAC7B,gBAAgB,2BAA2B,OAAO;GAChD,6BAA6B;IAC3B,UAAU,4BAA4B,KAAK;IAC3C,gBAAgB;;;gCACd,MAAM,MAAM,kGAAkB,IAAI;+BAClC,MAAM,MAAM,2FAAa,IAAI;MAC7B,MAAM,QAAQ;KAChB;;GACF;GACA,6BAA6B;IAC3B,UAAU,4BAA4B,KAAK;IAC3C,gBAAgB;;;gCACd,MAAM,MAAM,kGAAkB,IAAI;gCAClC,MAAM,MAAM,6FAAa,IAAI;MAC7B,MAAM,QAAQ;KAChB;;GACF;GACA,2BAA2B,EACzB,KAAK,YAAY,0BAA0B,OAAO,OAAO,EAC3D;GACA,6BAA6B,EAC3B,KAAK,iBAAiB,4BAA4B,OAAO,YAAY,EACvE;GACA,+BAA+B,EAC7B,KAAK,UAAU,8BAA8B,OAAO,KAAK,EAC3D;GACA,8BAA8B,EAC5B,UAAU,6BAA6B,KAAK,EAC9C;GACA,+BAA+B,EAC7B,UAAU,8BAA8B,KAAK,EAC/C;GACA,4CAA4C,EAC1C,UAAU,2CAA2C,KAAK,EAC5D;EACF,CAAC;CACH;AACF"}
|
|
@@ -3,51 +3,39 @@ const require_globalFilteringFeature_utils = require('./globalFilteringFeature.u
|
|
|
3
3
|
|
|
4
4
|
//#region src/features/global-filtering/globalFilteringFeature.ts
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
|
|
6
|
+
* Feature that adds global filtering state, defaults, and global filter APIs.
|
|
9
7
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* The stock global filtering feature.
|
|
44
|
-
*
|
|
45
|
-
* Register this feature with column filtering support to add global filter
|
|
46
|
-
* state, global filter function resolution, and column eligibility APIs.
|
|
47
|
-
*/
|
|
48
|
-
const globalFilteringFeature = constructGlobalFilteringFeature();
|
|
8
|
+
const globalFilteringFeature = {
|
|
9
|
+
getInitialState: (initialState) => {
|
|
10
|
+
return {
|
|
11
|
+
globalFilter: void 0,
|
|
12
|
+
...initialState
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
getDefaultTableOptions: (table) => {
|
|
16
|
+
return {
|
|
17
|
+
onGlobalFilterChange: require_utils.makeStateUpdater("globalFilter", table),
|
|
18
|
+
globalFilterFn: "auto",
|
|
19
|
+
getColumnCanGlobalFilter: (column) => {
|
|
20
|
+
var _table$getCoreRowMode;
|
|
21
|
+
const value = (_table$getCoreRowMode = table.getCoreRowModel().flatRows[0]) === null || _table$getCoreRowMode === void 0 || (_table$getCoreRowMode = _table$getCoreRowMode.getAllCellsByColumnId()[column.id]) === null || _table$getCoreRowMode === void 0 ? void 0 : _table$getCoreRowMode.getValue();
|
|
22
|
+
return typeof value === "string" || typeof value === "number";
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
assignColumnPrototype: (prototype, table) => {
|
|
27
|
+
require_utils.assignPrototypeAPIs("globalFilteringFeature", prototype, table, { column_getCanGlobalFilter: { fn: (column) => require_globalFilteringFeature_utils.column_getCanGlobalFilter(column) } });
|
|
28
|
+
},
|
|
29
|
+
constructTableAPIs: (table) => {
|
|
30
|
+
require_utils.assignTableAPIs("globalFilteringFeature", table, {
|
|
31
|
+
table_getGlobalAutoFilterFn: { fn: () => require_globalFilteringFeature_utils.table_getGlobalAutoFilterFn() },
|
|
32
|
+
table_getGlobalFilterFn: { fn: () => require_globalFilteringFeature_utils.table_getGlobalFilterFn(table) },
|
|
33
|
+
table_setGlobalFilter: { fn: (updater) => require_globalFilteringFeature_utils.table_setGlobalFilter(table, updater) },
|
|
34
|
+
table_resetGlobalFilter: { fn: (defaultState) => require_globalFilteringFeature_utils.table_resetGlobalFilter(table, defaultState) }
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
};
|
|
49
38
|
|
|
50
39
|
//#endregion
|
|
51
|
-
exports.constructGlobalFilteringFeature = constructGlobalFilteringFeature;
|
|
52
40
|
exports.globalFilteringFeature = globalFilteringFeature;
|
|
53
41
|
//# sourceMappingURL=globalFilteringFeature.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalFilteringFeature.cjs","names":["makeStateUpdater","column_getCanGlobalFilter","table_getGlobalAutoFilterFn","table_getGlobalFilterFn","table_setGlobalFilter","table_resetGlobalFilter"],"sources":["../../../src/features/global-filtering/globalFilteringFeature.ts"],"sourcesContent":["import {\n assignPrototypeAPIs,\n assignTableAPIs,\n makeStateUpdater,\n} from '../../utils'\nimport {\n column_getCanGlobalFilter,\n table_getGlobalAutoFilterFn,\n table_getGlobalFilterFn,\n table_resetGlobalFilter,\n table_setGlobalFilter,\n} from './globalFilteringFeature.utils'\nimport type {
|
|
1
|
+
{"version":3,"file":"globalFilteringFeature.cjs","names":["makeStateUpdater","column_getCanGlobalFilter","table_getGlobalAutoFilterFn","table_getGlobalFilterFn","table_setGlobalFilter","table_resetGlobalFilter"],"sources":["../../../src/features/global-filtering/globalFilteringFeature.ts"],"sourcesContent":["import {\n assignPrototypeAPIs,\n assignTableAPIs,\n makeStateUpdater,\n} from '../../utils'\nimport {\n column_getCanGlobalFilter,\n table_getGlobalAutoFilterFn,\n table_getGlobalFilterFn,\n table_resetGlobalFilter,\n table_setGlobalFilter,\n} from './globalFilteringFeature.utils'\nimport type { TableFeature } from '../../types/TableFeatures'\n\n/**\n * Feature that adds global filtering state, defaults, and global filter APIs.\n */\nexport const globalFilteringFeature: TableFeature = {\n getInitialState: (initialState) => {\n return {\n globalFilter: undefined,\n ...initialState,\n }\n },\n\n getDefaultTableOptions: (table) => {\n return {\n onGlobalFilterChange: makeStateUpdater('globalFilter', table),\n globalFilterFn: 'auto',\n getColumnCanGlobalFilter: (column) => {\n const value = table\n .getCoreRowModel()\n .flatRows[0]?.getAllCellsByColumnId()\n [column.id]?.getValue()\n\n return typeof value === 'string' || typeof value === 'number'\n },\n }\n },\n\n assignColumnPrototype: (prototype, table) => {\n assignPrototypeAPIs('globalFilteringFeature', prototype, table, {\n column_getCanGlobalFilter: {\n fn: (column) => column_getCanGlobalFilter(column),\n },\n })\n },\n\n constructTableAPIs: (table) => {\n assignTableAPIs('globalFilteringFeature', table, {\n table_getGlobalAutoFilterFn: {\n fn: () => table_getGlobalAutoFilterFn(),\n },\n table_getGlobalFilterFn: {\n fn: () => table_getGlobalFilterFn(table),\n },\n table_setGlobalFilter: {\n fn: (updater) => table_setGlobalFilter(table, updater),\n },\n table_resetGlobalFilter: {\n fn: (defaultState) => table_resetGlobalFilter(table, defaultState),\n },\n })\n },\n}\n"],"mappings":";;;;;;;AAiBA,MAAa,yBAAuC;CAClD,kBAAkB,iBAAiB;EACjC,OAAO;GACL,cAAc;GACd,GAAG;EACL;CACF;CAEA,yBAAyB,UAAU;EACjC,OAAO;GACL,sBAAsBA,+BAAiB,gBAAgB,KAAK;GAC5D,gBAAgB;GAChB,2BAA2B,WAAW;;IACpC,MAAM,iCAAQ,MACX,gBAAgB,CAAC,CACjB,SAAS,mGAAI,sBAAsB,CAAC,CACpC,OAAO,mFAAK,SAAS;IAExB,OAAO,OAAO,UAAU,YAAY,OAAO,UAAU;GACvD;EACF;CACF;CAEA,wBAAwB,WAAW,UAAU;EAC3C,kCAAoB,0BAA0B,WAAW,OAAO,EAC9D,2BAA2B,EACzB,KAAK,WAAWC,+DAA0B,MAAM,EAClD,EACF,CAAC;CACH;CAEA,qBAAqB,UAAU;EAC7B,8BAAgB,0BAA0B,OAAO;GAC/C,6BAA6B,EAC3B,UAAUC,iEAA4B,EACxC;GACA,yBAAyB,EACvB,UAAUC,6DAAwB,KAAK,EACzC;GACA,uBAAuB,EACrB,KAAK,YAAYC,2DAAsB,OAAO,OAAO,EACvD;GACA,yBAAyB,EACvB,KAAK,iBAAiBC,6DAAwB,OAAO,YAAY,EACnE;EACF,CAAC;CACH;AACF"}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TableFeature, TableFeatures } from "../../types/TableFeatures.cjs";
|
|
1
|
+
import { TableFeature } from "../../types/TableFeatures.cjs";
|
|
3
2
|
|
|
4
3
|
//#region src/features/global-filtering/globalFilteringFeature.d.ts
|
|
5
|
-
interface GlobalFilteringFeatureConstructors<TFeatures extends TableFeatures, TData extends RowData> {}
|
|
6
4
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
|
|
5
|
+
* Feature that adds global filtering state, defaults, and global filter APIs.
|
|
10
6
|
*/
|
|
11
|
-
declare
|
|
12
|
-
/**
|
|
13
|
-
* The stock global filtering feature.
|
|
14
|
-
*
|
|
15
|
-
* Register this feature with column filtering support to add global filter
|
|
16
|
-
* state, global filter function resolution, and column eligibility APIs.
|
|
17
|
-
*/
|
|
18
|
-
declare const globalFilteringFeature: TableFeature<GlobalFilteringFeatureConstructors<TableFeatures, RowData>>;
|
|
7
|
+
declare const globalFilteringFeature: TableFeature;
|
|
19
8
|
//#endregion
|
|
20
|
-
export {
|
|
9
|
+
export { globalFilteringFeature };
|
|
21
10
|
//# sourceMappingURL=globalFilteringFeature.d.cts.map
|
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TableFeature, TableFeatures } from "../../types/TableFeatures.js";
|
|
1
|
+
import { TableFeature } from "../../types/TableFeatures.js";
|
|
3
2
|
|
|
4
3
|
//#region src/features/global-filtering/globalFilteringFeature.d.ts
|
|
5
|
-
interface GlobalFilteringFeatureConstructors<TFeatures extends TableFeatures, TData extends RowData> {}
|
|
6
4
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
|
|
5
|
+
* Feature that adds global filtering state, defaults, and global filter APIs.
|
|
10
6
|
*/
|
|
11
|
-
declare
|
|
12
|
-
/**
|
|
13
|
-
* The stock global filtering feature.
|
|
14
|
-
*
|
|
15
|
-
* Register this feature with column filtering support to add global filter
|
|
16
|
-
* state, global filter function resolution, and column eligibility APIs.
|
|
17
|
-
*/
|
|
18
|
-
declare const globalFilteringFeature: TableFeature<GlobalFilteringFeatureConstructors<TableFeatures, RowData>>;
|
|
7
|
+
declare const globalFilteringFeature: TableFeature;
|
|
19
8
|
//#endregion
|
|
20
|
-
export {
|
|
9
|
+
export { globalFilteringFeature };
|
|
21
10
|
//# sourceMappingURL=globalFilteringFeature.d.ts.map
|
|
@@ -3,50 +3,39 @@ import { column_getCanGlobalFilter, table_getGlobalAutoFilterFn, table_getGlobal
|
|
|
3
3
|
|
|
4
4
|
//#region src/features/global-filtering/globalFilteringFeature.ts
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
|
|
6
|
+
* Feature that adds global filtering state, defaults, and global filter APIs.
|
|
9
7
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* The stock global filtering feature.
|
|
44
|
-
*
|
|
45
|
-
* Register this feature with column filtering support to add global filter
|
|
46
|
-
* state, global filter function resolution, and column eligibility APIs.
|
|
47
|
-
*/
|
|
48
|
-
const globalFilteringFeature = constructGlobalFilteringFeature();
|
|
8
|
+
const globalFilteringFeature = {
|
|
9
|
+
getInitialState: (initialState) => {
|
|
10
|
+
return {
|
|
11
|
+
globalFilter: void 0,
|
|
12
|
+
...initialState
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
getDefaultTableOptions: (table) => {
|
|
16
|
+
return {
|
|
17
|
+
onGlobalFilterChange: makeStateUpdater("globalFilter", table),
|
|
18
|
+
globalFilterFn: "auto",
|
|
19
|
+
getColumnCanGlobalFilter: (column) => {
|
|
20
|
+
var _table$getCoreRowMode;
|
|
21
|
+
const value = (_table$getCoreRowMode = table.getCoreRowModel().flatRows[0]) === null || _table$getCoreRowMode === void 0 || (_table$getCoreRowMode = _table$getCoreRowMode.getAllCellsByColumnId()[column.id]) === null || _table$getCoreRowMode === void 0 ? void 0 : _table$getCoreRowMode.getValue();
|
|
22
|
+
return typeof value === "string" || typeof value === "number";
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
assignColumnPrototype: (prototype, table) => {
|
|
27
|
+
assignPrototypeAPIs("globalFilteringFeature", prototype, table, { column_getCanGlobalFilter: { fn: (column) => column_getCanGlobalFilter(column) } });
|
|
28
|
+
},
|
|
29
|
+
constructTableAPIs: (table) => {
|
|
30
|
+
assignTableAPIs("globalFilteringFeature", table, {
|
|
31
|
+
table_getGlobalAutoFilterFn: { fn: () => table_getGlobalAutoFilterFn() },
|
|
32
|
+
table_getGlobalFilterFn: { fn: () => table_getGlobalFilterFn(table) },
|
|
33
|
+
table_setGlobalFilter: { fn: (updater) => table_setGlobalFilter(table, updater) },
|
|
34
|
+
table_resetGlobalFilter: { fn: (defaultState) => table_resetGlobalFilter(table, defaultState) }
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
};
|
|
49
38
|
|
|
50
39
|
//#endregion
|
|
51
|
-
export {
|
|
40
|
+
export { globalFilteringFeature };
|
|
52
41
|
//# sourceMappingURL=globalFilteringFeature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalFilteringFeature.js","names":[],"sources":["../../../src/features/global-filtering/globalFilteringFeature.ts"],"sourcesContent":["import {\n assignPrototypeAPIs,\n assignTableAPIs,\n makeStateUpdater,\n} from '../../utils'\nimport {\n column_getCanGlobalFilter,\n table_getGlobalAutoFilterFn,\n table_getGlobalFilterFn,\n table_resetGlobalFilter,\n table_setGlobalFilter,\n} from './globalFilteringFeature.utils'\nimport type {
|
|
1
|
+
{"version":3,"file":"globalFilteringFeature.js","names":[],"sources":["../../../src/features/global-filtering/globalFilteringFeature.ts"],"sourcesContent":["import {\n assignPrototypeAPIs,\n assignTableAPIs,\n makeStateUpdater,\n} from '../../utils'\nimport {\n column_getCanGlobalFilter,\n table_getGlobalAutoFilterFn,\n table_getGlobalFilterFn,\n table_resetGlobalFilter,\n table_setGlobalFilter,\n} from './globalFilteringFeature.utils'\nimport type { TableFeature } from '../../types/TableFeatures'\n\n/**\n * Feature that adds global filtering state, defaults, and global filter APIs.\n */\nexport const globalFilteringFeature: TableFeature = {\n getInitialState: (initialState) => {\n return {\n globalFilter: undefined,\n ...initialState,\n }\n },\n\n getDefaultTableOptions: (table) => {\n return {\n onGlobalFilterChange: makeStateUpdater('globalFilter', table),\n globalFilterFn: 'auto',\n getColumnCanGlobalFilter: (column) => {\n const value = table\n .getCoreRowModel()\n .flatRows[0]?.getAllCellsByColumnId()\n [column.id]?.getValue()\n\n return typeof value === 'string' || typeof value === 'number'\n },\n }\n },\n\n assignColumnPrototype: (prototype, table) => {\n assignPrototypeAPIs('globalFilteringFeature', prototype, table, {\n column_getCanGlobalFilter: {\n fn: (column) => column_getCanGlobalFilter(column),\n },\n })\n },\n\n constructTableAPIs: (table) => {\n assignTableAPIs('globalFilteringFeature', table, {\n table_getGlobalAutoFilterFn: {\n fn: () => table_getGlobalAutoFilterFn(),\n },\n table_getGlobalFilterFn: {\n fn: () => table_getGlobalFilterFn(table),\n },\n table_setGlobalFilter: {\n fn: (updater) => table_setGlobalFilter(table, updater),\n },\n table_resetGlobalFilter: {\n fn: (defaultState) => table_resetGlobalFilter(table, defaultState),\n },\n })\n },\n}\n"],"mappings":";;;;;;;AAiBA,MAAa,yBAAuC;CAClD,kBAAkB,iBAAiB;EACjC,OAAO;GACL,cAAc;GACd,GAAG;EACL;CACF;CAEA,yBAAyB,UAAU;EACjC,OAAO;GACL,sBAAsB,iBAAiB,gBAAgB,KAAK;GAC5D,gBAAgB;GAChB,2BAA2B,WAAW;;IACpC,MAAM,iCAAQ,MACX,gBAAgB,CAAC,CACjB,SAAS,mGAAI,sBAAsB,CAAC,CACpC,OAAO,mFAAK,SAAS;IAExB,OAAO,OAAO,UAAU,YAAY,OAAO,UAAU;GACvD;EACF;CACF;CAEA,wBAAwB,WAAW,UAAU;EAC3C,oBAAoB,0BAA0B,WAAW,OAAO,EAC9D,2BAA2B,EACzB,KAAK,WAAW,0BAA0B,MAAM,EAClD,EACF,CAAC;CACH;CAEA,qBAAqB,UAAU;EAC7B,gBAAgB,0BAA0B,OAAO;GAC/C,6BAA6B,EAC3B,UAAU,4BAA4B,EACxC;GACA,yBAAyB,EACvB,UAAU,wBAAwB,KAAK,EACzC;GACA,uBAAuB,EACrB,KAAK,YAAY,sBAAsB,OAAO,OAAO,EACvD;GACA,yBAAyB,EACvB,KAAK,iBAAiB,wBAAwB,OAAO,YAAY,EACnE;EACF,CAAC;CACH;AACF"}
|
|
@@ -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 * 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,
|
|
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, RowData>> | undefined =\n table._rowModelFns.filterFns\n\n const filterFn = isFunction(globalFilterFn)\n ? globalFilterFn\n : globalFilterFn === 'auto'\n ? table_getGlobalAutoFilterFn()\n : filterFns?.[globalFilterFn as string]\n\n return filterFn as FilterFn<TFeatures, TData> | undefined\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,MAAM,MAAK,SAC5D,CAAC,CAAC,OAAO;AAEb;;;;;;;;;;;;AAaA,SAAgB,8BAA8B;CAC5C,OAAOA;AACT;;;;;;;;;;;;;AAcA,SAAgB,wBAId,OACqE;CACrE,MAAM,EAAkB,mBAAmB,MAAM;CACjD,MAAM,YACJ,MAAM,aAAa;CAQrB,OANiBC,yBAAW,cAAc,IACtC,iBACA,mBAAmB,SACjB,4BAA4B,0DAC5B,UAAY;AAGpB;;;;;;;;;;;;AAaA,SAAgB,sBAGd,OAAyC,SAAc;;CACvD,iDAAM,SAAQ,iHAAuB,OAAO;AAC9C;;;;;;;;;;;;;AAcA,SAAgB,wBAGd,OAAyC,cAAwB;CACjE,sBACE,OACA,eAAe,SAAYC,yBAAW,MAAM,aAAa,YAAY,CACvE;AACF"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CellData, RowData } from "../../types/type-utils.cjs";
|
|
2
2
|
import { FilterFn } from "../column-filtering/columnFilteringFeature.types.cjs";
|
|
3
3
|
import { Column_Internal } from "../../types/Column.cjs";
|
|
4
|
+
import { Row } from "../../types/Row.cjs";
|
|
4
5
|
import { TableFeatures } from "../../types/TableFeatures.cjs";
|
|
5
6
|
import { Table_Internal } from "../../types/Table.cjs";
|
|
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.
|
|
@@ -28,7 +28,9 @@ declare function column_getCanGlobalFilter<TFeatures extends TableFeatures, TDat
|
|
|
28
28
|
* const filterFn = table_getGlobalAutoFilterFn()
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
|
-
declare function table_getGlobalAutoFilterFn():
|
|
31
|
+
declare function table_getGlobalAutoFilterFn(): (<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string, filterValue: unknown) => boolean) & {
|
|
32
|
+
autoRemove: (val: any) => boolean;
|
|
33
|
+
};
|
|
32
34
|
/**
|
|
33
35
|
* Resolves the filter function used for global filtering.
|
|
34
36
|
*
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CellData, RowData } from "../../types/type-utils.js";
|
|
2
2
|
import { FilterFn } from "../column-filtering/columnFilteringFeature.types.js";
|
|
3
3
|
import { Column_Internal } from "../../types/Column.js";
|
|
4
|
+
import { Row } from "../../types/Row.js";
|
|
4
5
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
5
6
|
import { Table_Internal } from "../../types/Table.js";
|
|
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.
|
|
@@ -28,7 +28,9 @@ declare function column_getCanGlobalFilter<TFeatures extends TableFeatures, TDat
|
|
|
28
28
|
* const filterFn = table_getGlobalAutoFilterFn()
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
|
-
declare function table_getGlobalAutoFilterFn():
|
|
31
|
+
declare function table_getGlobalAutoFilterFn(): (<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string, filterValue: unknown) => boolean) & {
|
|
32
|
+
autoRemove: (val: any) => boolean;
|
|
33
|
+
};
|
|
32
34
|
/**
|
|
33
35
|
* Resolves the filter function used for global filtering.
|
|
34
36
|
*
|