@tanstack/table-core 8.19.2 → 9.0.0-alpha.10
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/cjs/aggregationFns.cjs +94 -0
- package/dist/cjs/aggregationFns.cjs.map +1 -0
- package/dist/cjs/aggregationFns.d.cts +14 -0
- package/dist/cjs/columnHelper.cjs +19 -0
- package/dist/cjs/columnHelper.cjs.map +1 -0
- package/dist/cjs/columnHelper.d.cts +9 -0
- package/dist/cjs/core/cell.cjs +38 -0
- package/dist/cjs/core/cell.cjs.map +1 -0
- package/dist/cjs/core/cell.d.cts +50 -0
- package/dist/cjs/core/column.cjs +81 -0
- package/dist/cjs/core/column.cjs.map +1 -0
- package/dist/cjs/core/column.d.cts +56 -0
- package/dist/cjs/core/headers.cjs +310 -0
- package/dist/cjs/core/headers.cjs.map +1 -0
- package/dist/cjs/core/headers.d.cts +195 -0
- package/dist/cjs/core/row.cjs +92 -0
- package/dist/cjs/core/row.cjs.map +1 -0
- package/dist/cjs/core/row.d.cts +92 -0
- package/dist/cjs/core/table.cjs +232 -0
- package/dist/cjs/core/table.cjs.map +1 -0
- package/dist/cjs/core/table.d.cts +229 -0
- package/dist/cjs/features/ColumnFaceting.cjs +29 -0
- package/dist/cjs/features/ColumnFaceting.cjs.map +1 -0
- package/dist/cjs/features/ColumnFaceting.d.cts +35 -0
- package/dist/cjs/features/ColumnFiltering.cjs +137 -0
- package/dist/cjs/features/ColumnFiltering.cjs.map +1 -0
- package/dist/cjs/features/ColumnFiltering.d.cts +195 -0
- package/dist/cjs/features/ColumnGrouping.cjs +133 -0
- package/dist/cjs/features/ColumnGrouping.cjs.map +1 -0
- package/dist/cjs/features/ColumnGrouping.d.cts +202 -0
- package/dist/cjs/features/ColumnOrdering.cjs +76 -0
- package/dist/cjs/features/ColumnOrdering.cjs.map +1 -0
- package/dist/cjs/features/ColumnOrdering.d.cts +54 -0
- package/dist/cjs/features/ColumnPinning.cjs +145 -0
- package/dist/cjs/features/ColumnPinning.cjs.map +1 -0
- package/dist/cjs/features/ColumnPinning.d.cts +127 -0
- package/dist/cjs/features/ColumnSizing.cjs +307 -0
- package/dist/cjs/features/ColumnSizing.cjs.map +1 -0
- package/dist/cjs/features/ColumnSizing.d.cts +194 -0
- package/dist/cjs/features/ColumnVisibility.cjs +144 -0
- package/dist/cjs/features/ColumnVisibility.cjs.map +1 -0
- package/dist/cjs/features/ColumnVisibility.d.cts +130 -0
- package/dist/cjs/features/GlobalFaceting.cjs +29 -0
- package/dist/cjs/features/GlobalFaceting.cjs.map +1 -0
- package/dist/cjs/features/GlobalFaceting.d.cts +27 -0
- package/dist/cjs/features/GlobalFiltering.cjs +50 -0
- package/dist/cjs/features/GlobalFiltering.cjs.map +1 -0
- package/dist/cjs/features/GlobalFiltering.d.cts +80 -0
- package/dist/cjs/features/RowExpanding.cjs +152 -0
- package/dist/cjs/features/RowExpanding.cjs.map +1 -0
- package/dist/cjs/features/RowExpanding.d.cts +155 -0
- package/dist/cjs/features/RowPagination.cjs +161 -0
- package/dist/cjs/features/RowPagination.cjs.map +1 -0
- package/dist/cjs/features/RowPagination.d.cts +166 -0
- package/dist/cjs/features/RowPinning.cjs +132 -0
- package/dist/cjs/features/RowPinning.cjs.map +1 -0
- package/dist/cjs/features/RowPinning.d.cts +99 -0
- package/dist/cjs/features/RowSelection.cjs +296 -0
- package/dist/cjs/features/RowSelection.cjs.map +1 -0
- package/dist/cjs/features/RowSelection.d.cts +177 -0
- package/dist/cjs/features/RowSorting.cjs +200 -0
- package/dist/cjs/features/RowSorting.cjs.map +1 -0
- package/dist/cjs/features/RowSorting.d.cts +238 -0
- package/dist/cjs/filterFns.cjs +88 -0
- package/dist/cjs/filterFns.cjs.map +1 -0
- package/dist/cjs/filterFns.d.cts +14 -0
- package/{build/lib/index.js → dist/cjs/index.cjs} +41 -53
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/index.d.cts +34 -0
- package/{build/lib/sortingFns.js → dist/cjs/sortingFns.cjs} +23 -52
- package/dist/cjs/sortingFns.cjs.map +1 -0
- package/dist/cjs/sortingFns.d.cts +12 -0
- package/dist/cjs/types.d.cts +120 -0
- package/{build/lib/utils/filterRowsUtils.js → dist/cjs/utils/filterRowsUtils.cjs} +34 -46
- package/dist/cjs/utils/filterRowsUtils.cjs.map +1 -0
- package/dist/cjs/utils/filterRowsUtils.d.cts +3 -0
- package/dist/cjs/utils/getCoreRowModel.cjs +54 -0
- package/dist/cjs/utils/getCoreRowModel.cjs.map +1 -0
- package/dist/cjs/utils/getCoreRowModel.d.cts +3 -0
- package/dist/cjs/utils/getExpandedRowModel.cjs +41 -0
- package/dist/cjs/utils/getExpandedRowModel.cjs.map +1 -0
- package/dist/cjs/utils/getExpandedRowModel.d.cts +8 -0
- package/dist/cjs/utils/getFacetedMinMaxValues.cjs +35 -0
- package/dist/cjs/utils/getFacetedMinMaxValues.cjs.map +1 -0
- package/dist/cjs/utils/getFacetedMinMaxValues.d.cts +3 -0
- package/dist/cjs/utils/getFacetedRowModel.cjs +35 -0
- package/dist/cjs/utils/getFacetedRowModel.cjs.map +1 -0
- package/dist/cjs/utils/getFacetedRowModel.d.cts +3 -0
- package/dist/cjs/utils/getFacetedUniqueValues.cjs +37 -0
- package/dist/cjs/utils/getFacetedUniqueValues.cjs.map +1 -0
- package/dist/cjs/utils/getFacetedUniqueValues.d.cts +3 -0
- package/dist/cjs/utils/getFilteredRowModel.cjs +116 -0
- package/dist/cjs/utils/getFilteredRowModel.cjs.map +1 -0
- package/dist/cjs/utils/getFilteredRowModel.d.cts +3 -0
- package/dist/cjs/utils/getGroupedRowModel.cjs +118 -0
- package/dist/cjs/utils/getGroupedRowModel.cjs.map +1 -0
- package/dist/cjs/utils/getGroupedRowModel.d.cts +3 -0
- package/dist/cjs/utils/getPaginationRowModel.cjs +49 -0
- package/dist/cjs/utils/getPaginationRowModel.cjs.map +1 -0
- package/dist/cjs/utils/getPaginationRowModel.d.cts +5 -0
- package/dist/cjs/utils/getSortedRowModel.cjs +88 -0
- package/dist/cjs/utils/getSortedRowModel.cjs.map +1 -0
- package/dist/cjs/utils/getSortedRowModel.d.cts +3 -0
- package/{build/lib/utils.js → dist/cjs/utils.cjs} +26 -39
- package/dist/cjs/utils.cjs.map +1 -0
- package/dist/cjs/utils.d.cts +39 -0
- package/{build/lib → dist/esm}/aggregationFns.d.ts +2 -1
- package/dist/esm/aggregationFns.js +94 -0
- package/dist/esm/aggregationFns.js.map +1 -0
- package/{build/lib → dist/esm}/columnHelper.d.ts +3 -2
- package/dist/esm/columnHelper.js +19 -0
- package/{build/lib → dist/esm}/columnHelper.js.map +1 -1
- package/{build/lib → dist/esm}/core/cell.d.ts +2 -1
- package/dist/esm/core/cell.js +38 -0
- package/dist/esm/core/cell.js.map +1 -0
- package/{build/lib → dist/esm}/core/column.d.ts +2 -1
- package/dist/esm/core/column.js +81 -0
- package/dist/esm/core/column.js.map +1 -0
- package/{build/lib → dist/esm}/core/headers.d.ts +1 -0
- package/dist/esm/core/headers.js +310 -0
- package/dist/esm/core/headers.js.map +1 -0
- package/{build/lib → dist/esm}/core/row.d.ts +2 -1
- package/dist/esm/core/row.js +92 -0
- package/dist/esm/core/row.js.map +1 -0
- package/{build/lib → dist/esm}/core/table.d.ts +10 -1
- package/dist/esm/core/table.js +232 -0
- package/dist/esm/core/table.js.map +1 -0
- package/{build/lib → dist/esm}/features/ColumnFaceting.d.ts +1 -0
- package/{build/lib → dist/esm}/features/ColumnFaceting.js +6 -19
- package/{build/lib → dist/esm}/features/ColumnFaceting.js.map +1 -1
- package/{build/lib → dist/esm}/features/ColumnFiltering.d.ts +1 -0
- package/dist/esm/features/ColumnFiltering.js +137 -0
- package/dist/esm/features/ColumnFiltering.js.map +1 -0
- package/{build/lib → dist/esm}/features/ColumnGrouping.d.ts +1 -0
- package/dist/esm/features/ColumnGrouping.js +133 -0
- package/dist/esm/features/ColumnGrouping.js.map +1 -0
- package/{build/lib → dist/esm}/features/ColumnOrdering.d.ts +1 -0
- package/dist/esm/features/ColumnOrdering.js +76 -0
- package/dist/esm/features/ColumnOrdering.js.map +1 -0
- package/{build/lib → dist/esm}/features/ColumnPinning.d.ts +1 -0
- package/dist/esm/features/ColumnPinning.js +145 -0
- package/dist/esm/features/ColumnPinning.js.map +1 -0
- package/{build/lib → dist/esm}/features/ColumnSizing.d.ts +2 -1
- package/dist/esm/features/ColumnSizing.js +307 -0
- package/dist/esm/features/ColumnSizing.js.map +1 -0
- package/{build/lib → dist/esm}/features/ColumnVisibility.d.ts +1 -0
- package/dist/esm/features/ColumnVisibility.js +144 -0
- package/dist/esm/features/ColumnVisibility.js.map +1 -0
- package/{build/lib → dist/esm}/features/GlobalFaceting.d.ts +1 -0
- package/{build/lib → dist/esm}/features/GlobalFaceting.js +8 -21
- package/dist/esm/features/GlobalFaceting.js.map +1 -0
- package/{build/lib → dist/esm}/features/GlobalFiltering.d.ts +1 -0
- package/dist/esm/features/GlobalFiltering.js +50 -0
- package/dist/esm/features/GlobalFiltering.js.map +1 -0
- package/{build/lib → dist/esm}/features/RowExpanding.d.ts +1 -0
- package/{build/lib → dist/esm}/features/RowExpanding.js +37 -58
- package/dist/esm/features/RowExpanding.js.map +1 -0
- package/{build/lib → dist/esm}/features/RowPagination.d.ts +1 -0
- package/dist/esm/features/RowPagination.js +161 -0
- package/dist/esm/features/RowPagination.js.map +1 -0
- package/{build/lib → dist/esm}/features/RowPinning.d.ts +1 -0
- package/dist/esm/features/RowPinning.js +132 -0
- package/dist/esm/features/RowPinning.js.map +1 -0
- package/{build/lib → dist/esm}/features/RowSelection.d.ts +1 -0
- package/dist/esm/features/RowSelection.js +296 -0
- package/dist/esm/features/RowSelection.js.map +1 -0
- package/{build/lib → dist/esm}/features/RowSorting.d.ts +1 -0
- package/dist/esm/features/RowSorting.js +200 -0
- package/dist/esm/features/RowSorting.js.map +1 -0
- package/{build/lib → dist/esm}/filterFns.d.ts +2 -1
- package/dist/esm/filterFns.js +88 -0
- package/dist/esm/filterFns.js.map +1 -0
- package/dist/esm/index.d.ts +34 -0
- package/dist/esm/index.js +88 -0
- package/dist/esm/index.js.map +1 -0
- package/{build/lib → dist/esm}/sortingFns.d.ts +2 -1
- package/dist/esm/sortingFns.js +91 -0
- package/dist/esm/sortingFns.js.map +1 -0
- package/{build/lib → dist/esm}/types.d.ts +29 -28
- package/{build/lib → dist/esm}/utils/filterRowsUtils.d.ts +1 -0
- package/dist/esm/utils/filterRowsUtils.js +99 -0
- package/dist/esm/utils/filterRowsUtils.js.map +1 -0
- package/{build/lib → dist/esm}/utils/getCoreRowModel.d.ts +1 -0
- package/dist/esm/utils/getCoreRowModel.js +54 -0
- package/dist/esm/utils/getCoreRowModel.js.map +1 -0
- package/{build/lib → dist/esm}/utils/getExpandedRowModel.d.ts +1 -0
- package/dist/esm/utils/getExpandedRowModel.js +41 -0
- package/dist/esm/utils/getExpandedRowModel.js.map +1 -0
- package/{build/lib → dist/esm}/utils/getFacetedMinMaxValues.d.ts +1 -0
- package/dist/esm/utils/getFacetedMinMaxValues.js +35 -0
- package/dist/esm/utils/getFacetedMinMaxValues.js.map +1 -0
- package/{build/lib → dist/esm}/utils/getFacetedRowModel.d.ts +1 -0
- package/dist/esm/utils/getFacetedRowModel.js +35 -0
- package/{build/lib → dist/esm}/utils/getFacetedRowModel.js.map +1 -1
- package/{build/lib → dist/esm}/utils/getFacetedUniqueValues.d.ts +1 -0
- package/dist/esm/utils/getFacetedUniqueValues.js +37 -0
- package/dist/esm/utils/getFacetedUniqueValues.js.map +1 -0
- package/{build/lib → dist/esm}/utils/getFilteredRowModel.d.ts +1 -0
- package/dist/esm/utils/getFilteredRowModel.js +116 -0
- package/{build/lib → dist/esm}/utils/getFilteredRowModel.js.map +1 -1
- package/{build/lib → dist/esm}/utils/getGroupedRowModel.d.ts +1 -0
- package/dist/esm/utils/getGroupedRowModel.js +118 -0
- package/dist/esm/utils/getGroupedRowModel.js.map +1 -0
- package/{build/lib → dist/esm}/utils/getPaginationRowModel.d.ts +1 -0
- package/dist/esm/utils/getPaginationRowModel.js +49 -0
- package/dist/esm/utils/getPaginationRowModel.js.map +1 -0
- package/{build/lib → dist/esm}/utils/getSortedRowModel.d.ts +1 -0
- package/dist/esm/utils/getSortedRowModel.js +88 -0
- package/{build/lib → dist/esm}/utils/getSortedRowModel.js.map +1 -1
- package/{build/lib → dist/esm}/utils.d.ts +2 -1
- package/dist/esm/utils.js +98 -0
- package/{build/lib → dist/esm}/utils.js.map +1 -1
- package/package.json +14 -10
- package/src/core/cell.ts +2 -2
- package/src/core/column.ts +2 -2
- package/src/core/headers.ts +5 -5
- package/src/core/row.ts +4 -4
- package/src/core/table.ts +43 -7
- package/src/features/ColumnFaceting.ts +1 -1
- package/src/features/ColumnFiltering.ts +6 -6
- package/src/features/ColumnGrouping.ts +7 -7
- package/src/features/ColumnOrdering.ts +4 -4
- package/src/features/ColumnPinning.ts +5 -5
- package/src/features/ColumnSizing.ts +6 -6
- package/src/features/ColumnVisibility.ts +5 -5
- package/src/features/GlobalFaceting.ts +1 -1
- package/src/features/GlobalFiltering.ts +4 -4
- package/src/features/RowExpanding.ts +4 -4
- package/src/features/RowPagination.ts +3 -3
- package/src/features/RowPinning.ts +4 -4
- package/src/features/RowSelection.ts +4 -4
- package/src/features/RowSorting.ts +5 -5
- package/src/types.ts +8 -8
- package/src/utils/filterRowsUtils.ts +3 -3
- package/src/utils/getCoreRowModel.ts +2 -2
- package/src/utils/getGroupedRowModel.ts +2 -2
- package/build/lib/aggregationFns.js +0 -108
- package/build/lib/aggregationFns.js.map +0 -1
- package/build/lib/columnHelper.js +0 -71
- package/build/lib/core/cell.js +0 -42
- package/build/lib/core/cell.js.map +0 -1
- package/build/lib/core/column.js +0 -80
- package/build/lib/core/column.js.map +0 -1
- package/build/lib/core/headers.js +0 -270
- package/build/lib/core/headers.js.map +0 -1
- package/build/lib/core/row.js +0 -89
- package/build/lib/core/row.js.map +0 -1
- package/build/lib/core/table.js +0 -212
- package/build/lib/core/table.js.map +0 -1
- package/build/lib/features/ColumnFiltering.js +0 -151
- package/build/lib/features/ColumnFiltering.js.map +0 -1
- package/build/lib/features/ColumnGrouping.js +0 -142
- package/build/lib/features/ColumnGrouping.js.map +0 -1
- package/build/lib/features/ColumnOrdering.js +0 -84
- package/build/lib/features/ColumnOrdering.js.map +0 -1
- package/build/lib/features/ColumnPinning.js +0 -130
- package/build/lib/features/ColumnPinning.js.map +0 -1
- package/build/lib/features/ColumnSizing.js +0 -270
- package/build/lib/features/ColumnSizing.js.map +0 -1
- package/build/lib/features/ColumnVisibility.js +0 -99
- package/build/lib/features/ColumnVisibility.js.map +0 -1
- package/build/lib/features/GlobalFaceting.js.map +0 -1
- package/build/lib/features/GlobalFiltering.js +0 -63
- package/build/lib/features/GlobalFiltering.js.map +0 -1
- package/build/lib/features/RowExpanding.js.map +0 -1
- package/build/lib/features/RowPagination.js +0 -169
- package/build/lib/features/RowPagination.js.map +0 -1
- package/build/lib/features/RowPinning.js +0 -145
- package/build/lib/features/RowPinning.js.map +0 -1
- package/build/lib/features/RowSelection.js +0 -391
- package/build/lib/features/RowSelection.js.map +0 -1
- package/build/lib/features/RowSorting.js +0 -226
- package/build/lib/features/RowSorting.js.map +0 -1
- package/build/lib/filterFns.js +0 -96
- package/build/lib/filterFns.js.map +0 -1
- package/build/lib/index.d.ts +0 -34
- package/build/lib/index.esm.js +0 -3522
- package/build/lib/index.esm.js.map +0 -1
- package/build/lib/index.js.map +0 -1
- package/build/lib/index.mjs +0 -3522
- package/build/lib/index.mjs.map +0 -1
- package/build/lib/sortingFns.js.map +0 -1
- package/build/lib/utils/filterRowsUtils.js.map +0 -1
- package/build/lib/utils/getCoreRowModel.js +0 -65
- package/build/lib/utils/getCoreRowModel.js.map +0 -1
- package/build/lib/utils/getExpandedRowModel.js +0 -46
- package/build/lib/utils/getExpandedRowModel.js.map +0 -1
- package/build/lib/utils/getFacetedMinMaxValues.js +0 -43
- package/build/lib/utils/getFacetedMinMaxValues.js.map +0 -1
- package/build/lib/utils/getFacetedRowModel.js +0 -36
- package/build/lib/utils/getFacetedUniqueValues.js +0 -39
- package/build/lib/utils/getFacetedUniqueValues.js.map +0 -1
- package/build/lib/utils/getFilteredRowModel.js +0 -111
- package/build/lib/utils/getGroupedRowModel.js +0 -150
- package/build/lib/utils/getGroupedRowModel.js.map +0 -1
- package/build/lib/utils/getPaginationRowModel.js +0 -60
- package/build/lib/utils/getPaginationRowModel.js.map +0 -1
- package/build/lib/utils/getSortedRowModel.js +0 -102
- package/build/umd/index.development.js +0 -3578
- package/build/umd/index.development.js.map +0 -1
- package/build/umd/index.production.js +0 -12
- package/build/umd/index.production.js.map +0 -1
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { RequiredKeys } from '../utils';
|
|
2
|
+
import { Updater, TableOptionsResolved, TableState, Table, InitialTableState, Row, Column, RowModel, ColumnDef, TableOptions, RowData, TableMeta, TableFeature } from '../types';
|
|
3
|
+
|
|
4
|
+
export interface CoreTableState {
|
|
5
|
+
}
|
|
6
|
+
export interface CoreOptions<TData extends RowData> {
|
|
7
|
+
/**
|
|
8
|
+
* An array of extra features that you can add to the table instance.
|
|
9
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#_features)
|
|
10
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
11
|
+
*/
|
|
12
|
+
_features?: TableFeature[];
|
|
13
|
+
/**
|
|
14
|
+
* Set this option to override any of the `autoReset...` feature options.
|
|
15
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#autoresetall)
|
|
16
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
17
|
+
*/
|
|
18
|
+
autoResetAll?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The array of column defs to use for the table.
|
|
21
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#columns)
|
|
22
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
23
|
+
*/
|
|
24
|
+
columns: ColumnDef<TData, any>[];
|
|
25
|
+
/**
|
|
26
|
+
* The data for the table to display. This array should match the type you provided to `table.setRowType<...>`. Columns can access this data via string/index or a functional accessor. When the `data` option changes reference, the table will reprocess the data.
|
|
27
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#data)
|
|
28
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
29
|
+
*/
|
|
30
|
+
data: TData[];
|
|
31
|
+
/**
|
|
32
|
+
* Set this option to `true` to output all debugging information to the console.
|
|
33
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#debugall)
|
|
34
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
35
|
+
*/
|
|
36
|
+
debugAll?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Set this option to `true` to output cell debugging information to the console.
|
|
39
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#debugcells]
|
|
40
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
41
|
+
*/
|
|
42
|
+
debugCells?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Set this option to `true` to output column debugging information to the console.
|
|
45
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#debugcolumns)
|
|
46
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
47
|
+
*/
|
|
48
|
+
debugColumns?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Set this option to `true` to output header debugging information to the console.
|
|
51
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#debugheaders)
|
|
52
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
53
|
+
*/
|
|
54
|
+
debugHeaders?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Set this option to `true` to output row debugging information to the console.
|
|
57
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#debugrows)
|
|
58
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
59
|
+
*/
|
|
60
|
+
debugRows?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Set this option to `true` to output table debugging information to the console.
|
|
63
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#debugtable)
|
|
64
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
65
|
+
*/
|
|
66
|
+
debugTable?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Default column options to use for all column defs supplied to the table.
|
|
69
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#defaultcolumn)
|
|
70
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
71
|
+
*/
|
|
72
|
+
defaultColumn?: Partial<ColumnDef<TData, unknown>>;
|
|
73
|
+
/**
|
|
74
|
+
* This required option is a factory for a function that computes and returns the core row model for the table.
|
|
75
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getcorerowmodel)
|
|
76
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
77
|
+
*/
|
|
78
|
+
getCoreRowModel: (table: Table<any>) => () => RowModel<any>;
|
|
79
|
+
/**
|
|
80
|
+
* This optional function is used to derive a unique ID for any given row. If not provided the rows index is used (nested rows join together with `.` using their grandparents' index eg. `index.index.index`). If you need to identify individual rows that are originating from any server-side operations, it's suggested you use this function to return an ID that makes sense regardless of network IO/ambiguity eg. a userId, taskId, database ID field, etc.
|
|
81
|
+
* @example getRowId: row => row.userId
|
|
82
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getrowid)
|
|
83
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
84
|
+
*/
|
|
85
|
+
getRowId?: (originalRow: TData, index: number, parent?: Row<TData>) => string;
|
|
86
|
+
/**
|
|
87
|
+
* This optional function is used to access the sub rows for any given row. If you are using nested rows, you will need to use this function to return the sub rows object (or undefined) from the row.
|
|
88
|
+
* @example getSubRows: row => row.subRows
|
|
89
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getsubrows)
|
|
90
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
91
|
+
*/
|
|
92
|
+
getSubRows?: (originalRow: TData, index: number) => undefined | TData[];
|
|
93
|
+
/**
|
|
94
|
+
* Use this option to optionally pass initial state to the table. This state will be used when resetting various table states either automatically by the table (eg. `options.autoResetPageIndex`) or via functions like `table.resetRowSelection()`. Most reset function allow you optionally pass a flag to reset to a blank/default state instead of the initial state.
|
|
95
|
+
*
|
|
96
|
+
* Table state will not be reset when this object changes, which also means that the initial state object does not need to be stable.
|
|
97
|
+
*
|
|
98
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#initialstate)
|
|
99
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
100
|
+
*/
|
|
101
|
+
initialState?: InitialTableState;
|
|
102
|
+
/**
|
|
103
|
+
* This option is used to optionally implement the merging of table options.
|
|
104
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#mergeoptions)
|
|
105
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
106
|
+
*/
|
|
107
|
+
mergeOptions?: (defaultOptions: TableOptions<TData>, options: Partial<TableOptions<TData>>) => TableOptions<TData>;
|
|
108
|
+
/**
|
|
109
|
+
* You can pass any object to `options.meta` and access it anywhere the `table` is available via `table.options.meta`.
|
|
110
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#meta)
|
|
111
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
112
|
+
*/
|
|
113
|
+
meta?: TableMeta<TData>;
|
|
114
|
+
/**
|
|
115
|
+
* The `onStateChange` option can be used to optionally listen to state changes within the table.
|
|
116
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#onstatechange)
|
|
117
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
118
|
+
*/
|
|
119
|
+
onStateChange: (updater: Updater<TableState>) => void;
|
|
120
|
+
/**
|
|
121
|
+
* Value used when the desired value is not found in the data.
|
|
122
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#renderfallbackvalue)
|
|
123
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
124
|
+
*/
|
|
125
|
+
renderFallbackValue: any;
|
|
126
|
+
/**
|
|
127
|
+
* The `state` option can be used to optionally _control_ part or all of the table state. The state you pass here will merge with and overwrite the internal automatically-managed state to produce the final state for the table. You can also listen to state changes via the `onStateChange` option.
|
|
128
|
+
* > Note: Any state passed in here will override both the internal state and any other `initialState` you provide.
|
|
129
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#state)
|
|
130
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
131
|
+
*/
|
|
132
|
+
state: Partial<TableState>;
|
|
133
|
+
}
|
|
134
|
+
export declare function tableOptions<TData extends RowData = any>(options: Omit<TableOptions<TData>, 'columns'>): Omit<TableOptions<TData>, 'columns'>;
|
|
135
|
+
export declare function tableOptions<TData extends RowData = any>(options: Omit<TableOptions<TData>, 'data'>): Omit<TableOptions<TData>, 'data'>;
|
|
136
|
+
export declare function tableOptions<TData extends RowData = any>(options: Omit<TableOptions<TData>, 'getCoreRowModel'>): Omit<TableOptions<TData>, 'getCoreRowModel'>;
|
|
137
|
+
export declare function tableOptions<TData extends RowData = any>(options: Omit<TableOptions<TData>, 'data' | 'columns'>): Omit<TableOptions<TData>, 'data' | 'columns'>;
|
|
138
|
+
export declare function tableOptions<TData extends RowData = any>(options: Omit<TableOptions<TData>, 'getCoreRowModel' | 'columns'>): Omit<TableOptions<TData>, 'getCoreRowModel' | 'columns'>;
|
|
139
|
+
export declare function tableOptions<TData extends RowData = any>(options: Omit<TableOptions<TData>, 'data' | 'getCoreRowModel'>): Omit<TableOptions<TData>, 'data' | 'getCoreRowModel'>;
|
|
140
|
+
export declare function tableOptions<TData extends RowData = any>(options: Omit<TableOptions<TData>, 'data' | 'columns' | 'getCoreRowModel'>): Omit<TableOptions<TData>, 'data' | 'columns' | 'getCoreRowModel'>;
|
|
141
|
+
export declare function tableOptions<TData extends RowData = any>(options: TableOptions<TData>): TableOptions<TData>;
|
|
142
|
+
export interface CoreInstance<TData extends RowData> {
|
|
143
|
+
_features: readonly TableFeature[];
|
|
144
|
+
_getAllFlatColumnsById: () => Record<string, Column<TData, unknown>>;
|
|
145
|
+
_getColumnDefs: () => ColumnDef<TData, unknown>[];
|
|
146
|
+
_getCoreRowModel?: () => RowModel<TData>;
|
|
147
|
+
_getDefaultColumnDef: () => Partial<ColumnDef<TData, unknown>>;
|
|
148
|
+
_getRowId: (_: TData, index: number, parent?: Row<TData>) => string;
|
|
149
|
+
_queue: (cb: () => void) => void;
|
|
150
|
+
/**
|
|
151
|
+
* Returns all columns in the table in their normalized and nested hierarchy.
|
|
152
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getallcolumns)
|
|
153
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
154
|
+
*/
|
|
155
|
+
getAllColumns: () => Column<TData, unknown>[];
|
|
156
|
+
/**
|
|
157
|
+
* Returns all columns in the table flattened to a single level.
|
|
158
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getallflatcolumns)
|
|
159
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
160
|
+
*/
|
|
161
|
+
getAllFlatColumns: () => Column<TData, unknown>[];
|
|
162
|
+
/**
|
|
163
|
+
* Returns all leaf-node columns in the table flattened to a single level. This does not include parent columns.
|
|
164
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getallleafcolumns)
|
|
165
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
166
|
+
*/
|
|
167
|
+
getAllLeafColumns: () => Column<TData, unknown>[];
|
|
168
|
+
/**
|
|
169
|
+
* Returns a single column by its ID.
|
|
170
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getcolumn)
|
|
171
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
172
|
+
*/
|
|
173
|
+
getColumn: (columnId: string) => Column<TData, unknown> | undefined;
|
|
174
|
+
/**
|
|
175
|
+
* Returns the core row model before any processing has been applied.
|
|
176
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getcorerowmodel)
|
|
177
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
178
|
+
*/
|
|
179
|
+
getCoreRowModel: () => RowModel<TData>;
|
|
180
|
+
/**
|
|
181
|
+
* Returns the row with the given ID.
|
|
182
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getrow)
|
|
183
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
184
|
+
*/
|
|
185
|
+
getRow: (id: string, searchAll?: boolean) => Row<TData>;
|
|
186
|
+
/**
|
|
187
|
+
* Returns the final model after all processing from other used features has been applied. This is the row model that is most commonly used for rendering.
|
|
188
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getrowmodel)
|
|
189
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
190
|
+
*/
|
|
191
|
+
getRowModel: () => RowModel<TData>;
|
|
192
|
+
/**
|
|
193
|
+
* Call this function to get the table's current state. It's recommended to use this function and its state, especially when managing the table state manually. It is the exact same state used internally by the table for every feature and function it provides.
|
|
194
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getstate)
|
|
195
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
196
|
+
*/
|
|
197
|
+
getState: () => TableState;
|
|
198
|
+
/**
|
|
199
|
+
* This is the resolved initial state of the table.
|
|
200
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#initialstate)
|
|
201
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
202
|
+
*/
|
|
203
|
+
initialState: TableState;
|
|
204
|
+
/**
|
|
205
|
+
* A read-only reference to the table's current options.
|
|
206
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#options)
|
|
207
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
208
|
+
*/
|
|
209
|
+
options: RequiredKeys<TableOptionsResolved<TData>, 'state'>;
|
|
210
|
+
/**
|
|
211
|
+
* Call this function to reset the table state to the initial state.
|
|
212
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#reset)
|
|
213
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
214
|
+
*/
|
|
215
|
+
reset: () => void;
|
|
216
|
+
/**
|
|
217
|
+
* This function can be used to update the table options.
|
|
218
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#setoptions)
|
|
219
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
220
|
+
*/
|
|
221
|
+
setOptions: (newOptions: Updater<TableOptionsResolved<TData>>) => void;
|
|
222
|
+
/**
|
|
223
|
+
* Call this function to update the table state.
|
|
224
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#setstate)
|
|
225
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
|
|
226
|
+
*/
|
|
227
|
+
setState: (updater: Updater<TableState>) => void;
|
|
228
|
+
}
|
|
229
|
+
export declare function _createTable<TData extends RowData>(options: TableOptionsResolved<TData>): Table<TData>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const ColumnFaceting = {
|
|
4
|
+
_createColumn: (column, table) => {
|
|
5
|
+
column._getFacetedRowModel = table.options.getFacetedRowModel && table.options.getFacetedRowModel(table, column.id);
|
|
6
|
+
column.getFacetedRowModel = () => {
|
|
7
|
+
if (!column._getFacetedRowModel) {
|
|
8
|
+
return table.getPreFilteredRowModel();
|
|
9
|
+
}
|
|
10
|
+
return column._getFacetedRowModel();
|
|
11
|
+
};
|
|
12
|
+
column._getFacetedUniqueValues = table.options.getFacetedUniqueValues && table.options.getFacetedUniqueValues(table, column.id);
|
|
13
|
+
column.getFacetedUniqueValues = () => {
|
|
14
|
+
if (!column._getFacetedUniqueValues) {
|
|
15
|
+
return /* @__PURE__ */ new Map();
|
|
16
|
+
}
|
|
17
|
+
return column._getFacetedUniqueValues();
|
|
18
|
+
};
|
|
19
|
+
column._getFacetedMinMaxValues = table.options.getFacetedMinMaxValues && table.options.getFacetedMinMaxValues(table, column.id);
|
|
20
|
+
column.getFacetedMinMaxValues = () => {
|
|
21
|
+
if (!column._getFacetedMinMaxValues) {
|
|
22
|
+
return void 0;
|
|
23
|
+
}
|
|
24
|
+
return column._getFacetedMinMaxValues();
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.ColumnFaceting = ColumnFaceting;
|
|
29
|
+
//# sourceMappingURL=ColumnFaceting.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColumnFaceting.cjs","sources":["../../../src/features/ColumnFaceting.ts"],"sourcesContent":["import { RowModel } from '..'\nimport { Column, RowData, Table, TableFeature } from '../types'\n\nexport interface FacetedColumn<TData extends RowData> {\n _getFacetedMinMaxValues?: () => undefined | [number, number]\n _getFacetedRowModel?: () => RowModel<TData>\n _getFacetedUniqueValues?: () => Map<any, number>\n /**\n * A function that **computes and returns** a min/max tuple derived from `column.getFacetedRowModel`. Useful for displaying faceted result values.\n * > ⚠️ Requires that you pass a valid `getFacetedMinMaxValues` function to `options.getFacetedMinMaxValues`. A default implementation is provided via the exported `getFacetedMinMaxValues` function.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-faceting#getfacetedminmaxvalues)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-faceting)\n */\n getFacetedMinMaxValues: () => undefined | [number, number]\n /**\n * Returns the row model with all other column filters applied, excluding its own filter. Useful for displaying faceted result counts.\n * > ⚠️ Requires that you pass a valid `getFacetedRowModel` function to `options.facetedRowModel`. A default implementation is provided via the exported `getFacetedRowModel` function.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-faceting#getfacetedrowmodel)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-faceting)\n */\n getFacetedRowModel: () => RowModel<TData>\n /**\n * A function that **computes and returns** a `Map` of unique values and their occurrences derived from `column.getFacetedRowModel`. Useful for displaying faceted result values.\n * > ⚠️ Requires that you pass a valid `getFacetedUniqueValues` function to `options.getFacetedUniqueValues`. A default implementation is provided via the exported `getFacetedUniqueValues` function.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-faceting#getfaceteduniquevalues)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-faceting)\n */\n getFacetedUniqueValues: () => Map<any, number>\n}\n\nexport interface FacetedOptions<TData extends RowData> {\n getFacetedMinMaxValues?: (\n table: Table<TData>,\n columnId: string\n ) => () => undefined | [number, number]\n getFacetedRowModel?: (\n table: Table<TData>,\n columnId: string\n ) => () => RowModel<TData>\n getFacetedUniqueValues?: (\n table: Table<TData>,\n columnId: string\n ) => () => Map<any, number>\n}\n\n//\n\nexport const ColumnFaceting: TableFeature = {\n _createColumn: <TData extends RowData>(\n column: Column<TData, unknown>,\n table: Table<TData>\n ): void => {\n column._getFacetedRowModel =\n table.options.getFacetedRowModel &&\n table.options.getFacetedRowModel(table, column.id)\n column.getFacetedRowModel = () => {\n if (!column._getFacetedRowModel) {\n return table.getPreFilteredRowModel()\n }\n\n return column._getFacetedRowModel()\n }\n column._getFacetedUniqueValues =\n table.options.getFacetedUniqueValues &&\n table.options.getFacetedUniqueValues(table, column.id)\n column.getFacetedUniqueValues = () => {\n if (!column._getFacetedUniqueValues) {\n return new Map()\n }\n\n return column._getFacetedUniqueValues()\n }\n column._getFacetedMinMaxValues =\n table.options.getFacetedMinMaxValues &&\n table.options.getFacetedMinMaxValues(table, column.id)\n column.getFacetedMinMaxValues = () => {\n if (!column._getFacetedMinMaxValues) {\n return undefined\n }\n\n return column._getFacetedMinMaxValues()\n }\n },\n}\n"],"names":[],"mappings":";;AA+CO,MAAM,iBAA+B;AAAA,EAC1C,eAAe,CACb,QACA,UACS;AACF,WAAA,sBACL,MAAM,QAAQ,sBACd,MAAM,QAAQ,mBAAmB,OAAO,OAAO,EAAE;AACnD,WAAO,qBAAqB,MAAM;AAC5B,UAAA,CAAC,OAAO,qBAAqB;AAC/B,eAAO,MAAM;MACf;AAEA,aAAO,OAAO;IAAoB;AAE7B,WAAA,0BACL,MAAM,QAAQ,0BACd,MAAM,QAAQ,uBAAuB,OAAO,OAAO,EAAE;AACvD,WAAO,yBAAyB,MAAM;AAChC,UAAA,CAAC,OAAO,yBAAyB;AACnC,mCAAW,IAAI;AAAA,MACjB;AAEA,aAAO,OAAO;IAAwB;AAEjC,WAAA,0BACL,MAAM,QAAQ,0BACd,MAAM,QAAQ,uBAAuB,OAAO,OAAO,EAAE;AACvD,WAAO,yBAAyB,MAAM;AAChC,UAAA,CAAC,OAAO,yBAAyB;AAC5B,eAAA;AAAA,MACT;AAEA,aAAO,OAAO;IAAwB;AAAA,EAE1C;AACF;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { RowModel } from '..';
|
|
2
|
+
import { RowData, Table, TableFeature } from '../types';
|
|
3
|
+
|
|
4
|
+
export interface FacetedColumn<TData extends RowData> {
|
|
5
|
+
_getFacetedMinMaxValues?: () => undefined | [number, number];
|
|
6
|
+
_getFacetedRowModel?: () => RowModel<TData>;
|
|
7
|
+
_getFacetedUniqueValues?: () => Map<any, number>;
|
|
8
|
+
/**
|
|
9
|
+
* A function that **computes and returns** a min/max tuple derived from `column.getFacetedRowModel`. Useful for displaying faceted result values.
|
|
10
|
+
* > ⚠️ Requires that you pass a valid `getFacetedMinMaxValues` function to `options.getFacetedMinMaxValues`. A default implementation is provided via the exported `getFacetedMinMaxValues` function.
|
|
11
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-faceting#getfacetedminmaxvalues)
|
|
12
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-faceting)
|
|
13
|
+
*/
|
|
14
|
+
getFacetedMinMaxValues: () => undefined | [number, number];
|
|
15
|
+
/**
|
|
16
|
+
* Returns the row model with all other column filters applied, excluding its own filter. Useful for displaying faceted result counts.
|
|
17
|
+
* > ⚠️ Requires that you pass a valid `getFacetedRowModel` function to `options.facetedRowModel`. A default implementation is provided via the exported `getFacetedRowModel` function.
|
|
18
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-faceting#getfacetedrowmodel)
|
|
19
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-faceting)
|
|
20
|
+
*/
|
|
21
|
+
getFacetedRowModel: () => RowModel<TData>;
|
|
22
|
+
/**
|
|
23
|
+
* A function that **computes and returns** a `Map` of unique values and their occurrences derived from `column.getFacetedRowModel`. Useful for displaying faceted result values.
|
|
24
|
+
* > ⚠️ Requires that you pass a valid `getFacetedUniqueValues` function to `options.getFacetedUniqueValues`. A default implementation is provided via the exported `getFacetedUniqueValues` function.
|
|
25
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-faceting#getfaceteduniquevalues)
|
|
26
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-faceting)
|
|
27
|
+
*/
|
|
28
|
+
getFacetedUniqueValues: () => Map<any, number>;
|
|
29
|
+
}
|
|
30
|
+
export interface FacetedOptions<TData extends RowData> {
|
|
31
|
+
getFacetedMinMaxValues?: (table: Table<TData>, columnId: string) => () => undefined | [number, number];
|
|
32
|
+
getFacetedRowModel?: (table: Table<TData>, columnId: string) => () => RowModel<TData>;
|
|
33
|
+
getFacetedUniqueValues?: (table: Table<TData>, columnId: string) => () => Map<any, number>;
|
|
34
|
+
}
|
|
35
|
+
export declare const ColumnFaceting: TableFeature;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const filterFns = require("../filterFns.cjs");
|
|
4
|
+
const utils = require("../utils.cjs");
|
|
5
|
+
const ColumnFiltering = {
|
|
6
|
+
_getDefaultColumnDef: () => {
|
|
7
|
+
return {
|
|
8
|
+
filterFn: "auto"
|
|
9
|
+
};
|
|
10
|
+
},
|
|
11
|
+
_getInitialState: (state) => {
|
|
12
|
+
return {
|
|
13
|
+
columnFilters: [],
|
|
14
|
+
...state
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
_getDefaultOptions: (table) => {
|
|
18
|
+
return {
|
|
19
|
+
onColumnFiltersChange: utils.makeStateUpdater("columnFilters", table),
|
|
20
|
+
filterFromLeafRows: false,
|
|
21
|
+
maxLeafRowFilterDepth: 100
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
_createColumn: (column, table) => {
|
|
25
|
+
column.getAutoFilterFn = () => {
|
|
26
|
+
const firstRow = table.getCoreRowModel().flatRows[0];
|
|
27
|
+
const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
|
|
28
|
+
if (typeof value === "string") {
|
|
29
|
+
return filterFns.filterFns.includesString;
|
|
30
|
+
}
|
|
31
|
+
if (typeof value === "number") {
|
|
32
|
+
return filterFns.filterFns.inNumberRange;
|
|
33
|
+
}
|
|
34
|
+
if (typeof value === "boolean") {
|
|
35
|
+
return filterFns.filterFns.equals;
|
|
36
|
+
}
|
|
37
|
+
if (value !== null && typeof value === "object") {
|
|
38
|
+
return filterFns.filterFns.equals;
|
|
39
|
+
}
|
|
40
|
+
if (Array.isArray(value)) {
|
|
41
|
+
return filterFns.filterFns.arrIncludes;
|
|
42
|
+
}
|
|
43
|
+
return filterFns.filterFns.weakEquals;
|
|
44
|
+
};
|
|
45
|
+
column.getFilterFn = () => {
|
|
46
|
+
var _a;
|
|
47
|
+
return utils.isFunction(column.columnDef.filterFn) ? column.columnDef.filterFn : column.columnDef.filterFn === "auto" ? column.getAutoFilterFn() : (
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
((_a = table.options.filterFns) == null ? void 0 : _a[column.columnDef.filterFn]) ?? filterFns.filterFns[column.columnDef.filterFn]
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
column.getCanFilter = () => {
|
|
53
|
+
return (column.columnDef.enableColumnFilter ?? true) && (table.options.enableColumnFilters ?? true) && (table.options.enableFilters ?? true) && !!column.accessorFn;
|
|
54
|
+
};
|
|
55
|
+
column.getIsFiltered = () => column.getFilterIndex() > -1;
|
|
56
|
+
column.getFilterValue = () => {
|
|
57
|
+
var _a, _b;
|
|
58
|
+
return (_b = (_a = table.getState().columnFilters) == null ? void 0 : _a.find((d) => d.id === column.id)) == null ? void 0 : _b.value;
|
|
59
|
+
};
|
|
60
|
+
column.getFilterIndex = () => {
|
|
61
|
+
var _a;
|
|
62
|
+
return ((_a = table.getState().columnFilters) == null ? void 0 : _a.findIndex((d) => d.id === column.id)) ?? -1;
|
|
63
|
+
};
|
|
64
|
+
column.setFilterValue = (value) => {
|
|
65
|
+
table.setColumnFilters((old) => {
|
|
66
|
+
const filterFn = column.getFilterFn();
|
|
67
|
+
const previousFilter = old == null ? void 0 : old.find((d) => d.id === column.id);
|
|
68
|
+
const newFilter = utils.functionalUpdate(
|
|
69
|
+
value,
|
|
70
|
+
previousFilter ? previousFilter.value : void 0
|
|
71
|
+
);
|
|
72
|
+
if (shouldAutoRemoveFilter(filterFn, newFilter, column)) {
|
|
73
|
+
return (old == null ? void 0 : old.filter((d) => d.id !== column.id)) ?? [];
|
|
74
|
+
}
|
|
75
|
+
const newFilterObj = { id: column.id, value: newFilter };
|
|
76
|
+
if (previousFilter) {
|
|
77
|
+
return (old == null ? void 0 : old.map((d) => {
|
|
78
|
+
if (d.id === column.id) {
|
|
79
|
+
return newFilterObj;
|
|
80
|
+
}
|
|
81
|
+
return d;
|
|
82
|
+
})) ?? [];
|
|
83
|
+
}
|
|
84
|
+
if (old == null ? void 0 : old.length) {
|
|
85
|
+
return [...old, newFilterObj];
|
|
86
|
+
}
|
|
87
|
+
return [newFilterObj];
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
_createRow: (row, _table) => {
|
|
92
|
+
row.columnFilters = {};
|
|
93
|
+
row.columnFiltersMeta = {};
|
|
94
|
+
},
|
|
95
|
+
_createTable: (table) => {
|
|
96
|
+
table.setColumnFilters = (updater) => {
|
|
97
|
+
var _a, _b;
|
|
98
|
+
const leafColumns = table.getAllLeafColumns();
|
|
99
|
+
const updateFn = (old) => {
|
|
100
|
+
var _a2;
|
|
101
|
+
return (_a2 = utils.functionalUpdate(updater, old)) == null ? void 0 : _a2.filter((filter) => {
|
|
102
|
+
const column = leafColumns.find((d) => d.id === filter.id);
|
|
103
|
+
if (column) {
|
|
104
|
+
const filterFn = column.getFilterFn();
|
|
105
|
+
if (shouldAutoRemoveFilter(filterFn, filter.value, column)) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return true;
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
(_b = (_a = table.options).onColumnFiltersChange) == null ? void 0 : _b.call(_a, updateFn);
|
|
113
|
+
};
|
|
114
|
+
table.resetColumnFilters = (defaultState) => {
|
|
115
|
+
var _a;
|
|
116
|
+
table.setColumnFilters(
|
|
117
|
+
defaultState ? [] : ((_a = table.initialState) == null ? void 0 : _a.columnFilters) ?? []
|
|
118
|
+
);
|
|
119
|
+
};
|
|
120
|
+
table.getPreFilteredRowModel = () => table.getCoreRowModel();
|
|
121
|
+
table.getFilteredRowModel = () => {
|
|
122
|
+
if (!table._getFilteredRowModel && table.options.getFilteredRowModel) {
|
|
123
|
+
table._getFilteredRowModel = table.options.getFilteredRowModel(table);
|
|
124
|
+
}
|
|
125
|
+
if (table.options.manualFiltering || !table._getFilteredRowModel) {
|
|
126
|
+
return table.getPreFilteredRowModel();
|
|
127
|
+
}
|
|
128
|
+
return table._getFilteredRowModel();
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
function shouldAutoRemoveFilter(filterFn, value, column) {
|
|
133
|
+
return (filterFn && filterFn.autoRemove ? filterFn.autoRemove(value, column) : false) || typeof value === "undefined" || typeof value === "string" && !value;
|
|
134
|
+
}
|
|
135
|
+
exports.ColumnFiltering = ColumnFiltering;
|
|
136
|
+
exports.shouldAutoRemoveFilter = shouldAutoRemoveFilter;
|
|
137
|
+
//# sourceMappingURL=ColumnFiltering.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColumnFiltering.cjs","sources":["../../../src/features/ColumnFiltering.ts"],"sourcesContent":["import { RowModel } from '..'\nimport { BuiltInFilterFn, filterFns } from '../filterFns'\nimport {\n Column,\n FilterFns,\n FilterMeta,\n OnChangeFn,\n Row,\n RowData,\n Table,\n TableFeature,\n Updater,\n} from '../types'\nimport { functionalUpdate, isFunction, makeStateUpdater } from '../utils'\n\nexport interface ColumnFiltersTableState {\n columnFilters: ColumnFiltersState\n}\n\nexport type ColumnFiltersState = ColumnFilter[]\n\nexport interface ColumnFilter {\n id: string\n value: unknown\n}\n\nexport interface ResolvedColumnFilter<TData extends RowData> {\n filterFn: FilterFn<TData>\n id: string\n resolvedValue: unknown\n}\n\nexport interface FilterFn<TData extends RowData> {\n (\n row: Row<TData>,\n columnId: string,\n filterValue: any,\n addMeta: (meta: FilterMeta) => void\n ): boolean\n autoRemove?: ColumnFilterAutoRemoveTestFn<TData>\n resolveFilterValue?: TransformFilterValueFn<TData>\n}\n\nexport type TransformFilterValueFn<TData extends RowData> = (\n value: any,\n column?: Column<TData, unknown>\n) => unknown\n\nexport type ColumnFilterAutoRemoveTestFn<TData extends RowData> = (\n value: any,\n column?: Column<TData, unknown>\n) => boolean\n\nexport type CustomFilterFns<TData extends RowData> = Record<\n string,\n FilterFn<TData>\n>\n\nexport type FilterFnOption<TData extends RowData> =\n | 'auto'\n | BuiltInFilterFn\n | keyof FilterFns\n | FilterFn<TData>\n\nexport interface ColumnFiltersColumnDef<TData extends RowData> {\n /**\n * Enables/disables the **column** filter for this column.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#enablecolumnfilter)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n enableColumnFilter?: boolean\n /**\n * The filter function to use with this column. Can be the name of a built-in filter function or a custom filter function.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#filterfn)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n filterFn?: FilterFnOption<TData>\n}\n\nexport interface ColumnFiltersColumn<TData extends RowData> {\n /**\n * Returns an automatically calculated filter function for the column based off of the columns first known value.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#getautofilterfn)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n getAutoFilterFn: () => FilterFn<TData> | undefined\n /**\n * Returns whether or not the column can be **column** filtered.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#getcanfilter)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n getCanFilter: () => boolean\n /**\n * Returns the filter function (either user-defined or automatic, depending on configuration) for the columnId specified.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#getfilterfn)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n getFilterFn: () => FilterFn<TData> | undefined\n /**\n * Returns the index (including `-1`) of the column filter in the table's `state.columnFilters` array.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#getfilterindex)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n getFilterIndex: () => number\n /**\n * Returns the current filter value for the column.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#getfiltervalue)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n getFilterValue: () => unknown\n /**\n * Returns whether or not the column is currently filtered.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#getisfiltered)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n getIsFiltered: () => boolean\n /**\n * A function that sets the current filter value for the column. You can pass it a value or an updater function for immutability-safe operations on existing values.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#setfiltervalue)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n setFilterValue: (updater: Updater<any>) => void\n}\n\nexport interface ColumnFiltersRow<TData extends RowData> {\n /**\n * The column filters map for the row. This object tracks whether a row is passing/failing specific filters by their column ID.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#columnfilters)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n columnFilters: Record<string, boolean>\n /**\n * The column filters meta map for the row. This object tracks any filter meta for a row as optionally provided during the filtering process.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#columnfiltersmeta)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n columnFiltersMeta: Record<string, FilterMeta>\n}\n\ninterface ColumnFiltersOptionsBase<TData extends RowData> {\n /**\n * Enables/disables **column** filtering for all columns.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#enablecolumnfilters)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n enableColumnFilters?: boolean\n /**\n * Enables/disables all filtering for the table.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#enablefilters)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n enableFilters?: boolean\n /**\n * By default, filtering is done from parent rows down (so if a parent row is filtered out, all of its children will be filtered out as well). Setting this option to `true` will cause filtering to be done from leaf rows up (which means parent rows will be included so long as one of their child or grand-child rows is also included).\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#filterfromleafrows)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n filterFromLeafRows?: boolean\n /**\n * If provided, this function is called **once** per table and should return a **new function** which will calculate and return the row model for the table when it's filtered.\n * - For server-side filtering, this function is unnecessary and can be ignored since the server should already return the filtered row model.\n * - For client-side filtering, this function is required. A default implementation is provided via any table adapter's `{ getFilteredRowModel }` export.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#getfilteredrowmodel)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n getFilteredRowModel?: (table: Table<any>) => () => RowModel<any>\n /**\n * Disables the `getFilteredRowModel` from being used to filter data. This may be useful if your table needs to dynamically support both client-side and server-side filtering.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#manualfiltering)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n manualFiltering?: boolean\n /**\n * By default, filtering is done for all rows (max depth of 100), no matter if they are root level parent rows or the child leaf rows of a parent row. Setting this option to `0` will cause filtering to only be applied to the root level parent rows, with all sub-rows remaining unfiltered. Similarly, setting this option to `1` will cause filtering to only be applied to child leaf rows 1 level deep, and so on.\n\n * This is useful for situations where you want a row's entire child hierarchy to be visible regardless of the applied filter.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#maxleafrowfilterdepth)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n maxLeafRowFilterDepth?: number\n /**\n * If provided, this function will be called with an `updaterFn` when `state.columnFilters` changes. This overrides the default internal state management, so you will need to persist the state change either fully or partially outside of the table.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#oncolumnfilterschange)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n onColumnFiltersChange?: OnChangeFn<ColumnFiltersState>\n}\n\ntype ResolvedFilterFns = keyof FilterFns extends never\n ? {\n filterFns?: Record<string, FilterFn<any>>\n }\n : {\n filterFns: Record<keyof FilterFns, FilterFn<any>>\n }\n\nexport interface ColumnFiltersOptions<TData extends RowData>\n extends ColumnFiltersOptionsBase<TData>,\n ResolvedFilterFns {}\n\nexport interface ColumnFiltersInstance<TData extends RowData> {\n _getFilteredRowModel?: () => RowModel<TData>\n /**\n * Returns the row model for the table after **column** filtering has been applied.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#getfilteredrowmodel)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n getFilteredRowModel: () => RowModel<TData>\n /**\n * Returns the row model for the table before any **column** filtering has been applied.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#getprefilteredrowmodel)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n getPreFilteredRowModel: () => RowModel<TData>\n /**\n * Resets the **columnFilters** state to `initialState.columnFilters`, or `true` can be passed to force a default blank state reset to `[]`.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#resetcolumnfilters)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n resetColumnFilters: (defaultState?: boolean) => void\n /**\n * Resets the **globalFilter** state to `initialState.globalFilter`, or `true` can be passed to force a default blank state reset to `undefined`.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#resetglobalfilter)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n resetGlobalFilter: (defaultState?: boolean) => void\n /**\n * Sets or updates the `state.columnFilters` state.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#setcolumnfilters)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n setColumnFilters: (updater: Updater<ColumnFiltersState>) => void\n /**\n * Sets or updates the `state.globalFilter` state.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#setglobalfilter)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)\n */\n setGlobalFilter: (updater: Updater<any>) => void\n}\n\n//\n\nexport const ColumnFiltering: TableFeature = {\n _getDefaultColumnDef: <\n TData extends RowData,\n >(): ColumnFiltersColumnDef<TData> => {\n return {\n filterFn: 'auto',\n }\n },\n\n _getInitialState: (state): ColumnFiltersTableState => {\n return {\n columnFilters: [],\n ...state,\n }\n },\n\n _getDefaultOptions: <TData extends RowData>(\n table: Table<TData>\n ): ColumnFiltersOptions<TData> => {\n return {\n onColumnFiltersChange: makeStateUpdater('columnFilters', table),\n filterFromLeafRows: false,\n maxLeafRowFilterDepth: 100,\n } as ColumnFiltersOptions<TData>\n },\n\n _createColumn: <TData extends RowData>(\n column: Column<TData, unknown>,\n table: Table<TData>\n ): void => {\n column.getAutoFilterFn = () => {\n const firstRow = table.getCoreRowModel().flatRows[0]\n\n const value = firstRow?.getValue(column.id)\n\n if (typeof value === 'string') {\n return filterFns.includesString\n }\n\n if (typeof value === 'number') {\n return filterFns.inNumberRange\n }\n\n if (typeof value === 'boolean') {\n return filterFns.equals\n }\n\n if (value !== null && typeof value === 'object') {\n return filterFns.equals\n }\n\n if (Array.isArray(value)) {\n return filterFns.arrIncludes\n }\n\n return filterFns.weakEquals\n }\n column.getFilterFn = () => {\n return isFunction(column.columnDef.filterFn)\n ? column.columnDef.filterFn\n : column.columnDef.filterFn === 'auto'\n ? column.getAutoFilterFn()\n : // @ts-ignore\n table.options.filterFns?.[column.columnDef.filterFn as string] ??\n filterFns[column.columnDef.filterFn as BuiltInFilterFn]\n }\n column.getCanFilter = () => {\n return (\n (column.columnDef.enableColumnFilter ?? true) &&\n (table.options.enableColumnFilters ?? true) &&\n (table.options.enableFilters ?? true) &&\n !!column.accessorFn\n )\n }\n\n column.getIsFiltered = () => column.getFilterIndex() > -1\n\n column.getFilterValue = () =>\n table.getState().columnFilters?.find(d => d.id === column.id)?.value\n\n column.getFilterIndex = () =>\n table.getState().columnFilters?.findIndex(d => d.id === column.id) ?? -1\n\n column.setFilterValue = value => {\n table.setColumnFilters(old => {\n const filterFn = column.getFilterFn()\n const previousFilter = old?.find(d => d.id === column.id)\n\n const newFilter = functionalUpdate(\n value,\n previousFilter ? previousFilter.value : undefined\n )\n\n //\n if (\n shouldAutoRemoveFilter(filterFn as FilterFn<TData>, newFilter, column)\n ) {\n return old?.filter(d => d.id !== column.id) ?? []\n }\n\n const newFilterObj = { id: column.id, value: newFilter }\n\n if (previousFilter) {\n return (\n old?.map(d => {\n if (d.id === column.id) {\n return newFilterObj\n }\n return d\n }) ?? []\n )\n }\n\n if (old?.length) {\n return [...old, newFilterObj]\n }\n\n return [newFilterObj]\n })\n }\n },\n\n _createRow: <TData extends RowData>(\n row: Row<TData>,\n _table: Table<TData>\n ): void => {\n row.columnFilters = {}\n row.columnFiltersMeta = {}\n },\n\n _createTable: <TData extends RowData>(table: Table<TData>): void => {\n table.setColumnFilters = (updater: Updater<ColumnFiltersState>) => {\n const leafColumns = table.getAllLeafColumns()\n\n const updateFn = (old: ColumnFiltersState) => {\n return functionalUpdate(updater, old)?.filter(filter => {\n const column = leafColumns.find(d => d.id === filter.id)\n\n if (column) {\n const filterFn = column.getFilterFn()\n\n if (shouldAutoRemoveFilter(filterFn, filter.value, column)) {\n return false\n }\n }\n\n return true\n })\n }\n\n table.options.onColumnFiltersChange?.(updateFn)\n }\n\n table.resetColumnFilters = defaultState => {\n table.setColumnFilters(\n defaultState ? [] : table.initialState?.columnFilters ?? []\n )\n }\n\n table.getPreFilteredRowModel = () => table.getCoreRowModel()\n table.getFilteredRowModel = () => {\n if (!table._getFilteredRowModel && table.options.getFilteredRowModel) {\n table._getFilteredRowModel = table.options.getFilteredRowModel(table)\n }\n\n if (table.options.manualFiltering || !table._getFilteredRowModel) {\n return table.getPreFilteredRowModel()\n }\n\n return table._getFilteredRowModel()\n }\n },\n}\n\nexport function shouldAutoRemoveFilter<TData extends RowData>(\n filterFn?: FilterFn<TData>,\n value?: any,\n column?: Column<TData, unknown>\n) {\n return (\n (filterFn && filterFn.autoRemove\n ? filterFn.autoRemove(value, column)\n : false) ||\n typeof value === 'undefined' ||\n (typeof value === 'string' && !value)\n )\n}\n"],"names":["makeStateUpdater","filterFns","isFunction","functionalUpdate"],"mappings":";;;;AAkPO,MAAM,kBAAgC;AAAA,EAC3C,sBAAsB,MAEgB;AAC7B,WAAA;AAAA,MACL,UAAU;AAAA,IAAA;AAAA,EAEd;AAAA,EAEA,kBAAkB,CAAC,UAAmC;AAC7C,WAAA;AAAA,MACL,eAAe,CAAC;AAAA,MAChB,GAAG;AAAA,IAAA;AAAA,EAEP;AAAA,EAEA,oBAAoB,CAClB,UACgC;AACzB,WAAA;AAAA,MACL,uBAAuBA,MAAAA,iBAAiB,iBAAiB,KAAK;AAAA,MAC9D,oBAAoB;AAAA,MACpB,uBAAuB;AAAA,IAAA;AAAA,EAE3B;AAAA,EAEA,eAAe,CACb,QACA,UACS;AACT,WAAO,kBAAkB,MAAM;AAC7B,YAAM,WAAW,MAAM,gBAAgB,EAAE,SAAS,CAAC;AAEnD,YAAM,QAAQ,qCAAU,SAAS,OAAO;AAEpC,UAAA,OAAO,UAAU,UAAU;AAC7B,eAAOC,UAAAA,UAAU;AAAA,MACnB;AAEI,UAAA,OAAO,UAAU,UAAU;AAC7B,eAAOA,UAAAA,UAAU;AAAA,MACnB;AAEI,UAAA,OAAO,UAAU,WAAW;AAC9B,eAAOA,UAAAA,UAAU;AAAA,MACnB;AAEA,UAAI,UAAU,QAAQ,OAAO,UAAU,UAAU;AAC/C,eAAOA,UAAAA,UAAU;AAAA,MACnB;AAEI,UAAA,MAAM,QAAQ,KAAK,GAAG;AACxB,eAAOA,UAAAA,UAAU;AAAA,MACnB;AAEA,aAAOA,UAAAA,UAAU;AAAA,IAAA;AAEnB,WAAO,cAAc,MAAM;;AACzB,aAAOC,MAAW,WAAA,OAAO,UAAU,QAAQ,IACvC,OAAO,UAAU,WACjB,OAAO,UAAU,aAAa,SAC5B,OAAO,gBAAgB;AAAA;AAAA,UAEvB,WAAM,QAAQ,cAAd,mBAA0B,OAAO,UAAU,cAC3CD,oBAAU,OAAO,UAAU,QAA2B;AAAA;AAAA,IAAA;AAE9D,WAAO,eAAe,MAAM;AAC1B,cACG,OAAO,UAAU,sBAAsB,UACvC,MAAM,QAAQ,uBAAuB,UACrC,MAAM,QAAQ,iBAAiB,SAChC,CAAC,CAAC,OAAO;AAAA,IAAA;AAIb,WAAO,gBAAgB,MAAM,OAAO,eAAmB,IAAA;AAEvD,WAAO,iBAAiB,MAAA;;AACtB,+BAAM,SAAA,EAAW,kBAAjB,mBAAgC,KAAK,CAAA,MAAK,EAAE,OAAO,OAAO,QAA1D,mBAA+D;AAAA;AAEjE,WAAO,iBAAiB,MACtB;;AAAA,0BAAM,SAAW,EAAA,kBAAjB,mBAAgC,UAAU,CAAA,MAAK,EAAE,OAAO,OAAO,QAAO;AAAA;AAExE,WAAO,iBAAiB,CAAS,UAAA;AAC/B,YAAM,iBAAiB,CAAO,QAAA;AACtB,cAAA,WAAW,OAAO;AACxB,cAAM,iBAAiB,2BAAK,KAAK,OAAK,EAAE,OAAO,OAAO;AAEtD,cAAM,YAAYE,MAAA;AAAA,UAChB;AAAA,UACA,iBAAiB,eAAe,QAAQ;AAAA,QAAA;AAI1C,YACE,uBAAuB,UAA6B,WAAW,MAAM,GACrE;AACO,kBAAA,2BAAK,OAAO,CAAK,MAAA,EAAE,OAAO,OAAO,QAAO;QACjD;AAEA,cAAM,eAAe,EAAE,IAAI,OAAO,IAAI,OAAO;AAE7C,YAAI,gBAAgB;AAEhB,kBAAA,2BAAK,IAAI,CAAK,MAAA;AACR,gBAAA,EAAE,OAAO,OAAO,IAAI;AACf,qBAAA;AAAA,YACT;AACO,mBAAA;AAAA,UACR,OAAK,CAAA;AAAA,QAEV;AAEA,YAAI,2BAAK,QAAQ;AACR,iBAAA,CAAC,GAAG,KAAK,YAAY;AAAA,QAC9B;AAEA,eAAO,CAAC,YAAY;AAAA,MAAA,CACrB;AAAA,IAAA;AAAA,EAEL;AAAA,EAEA,YAAY,CACV,KACA,WACS;AACT,QAAI,gBAAgB;AACpB,QAAI,oBAAoB;EAC1B;AAAA,EAEA,cAAc,CAAwB,UAA8B;AAC5D,UAAA,mBAAmB,CAAC,YAAyC;;AAC3D,YAAA,cAAc,MAAM;AAEpB,YAAA,WAAW,CAAC,QAA4B;;AAC5C,gBAAOA,MAAAA,MAAAA,iBAAiB,SAAS,GAAG,MAA7BA,gBAAAA,IAAgC,OAAO,CAAU,WAAA;AACtD,gBAAM,SAAS,YAAY,KAAK,OAAK,EAAE,OAAO,OAAO,EAAE;AAEvD,cAAI,QAAQ;AACJ,kBAAA,WAAW,OAAO;AAExB,gBAAI,uBAAuB,UAAU,OAAO,OAAO,MAAM,GAAG;AACnD,qBAAA;AAAA,YACT;AAAA,UACF;AAEO,iBAAA;AAAA,QAAA;AAAA,MACR;AAGG,wBAAA,SAAQ,0BAAR,4BAAgC;AAAA,IAAQ;AAGhD,UAAM,qBAAqB,CAAgB,iBAAA;;AACnC,YAAA;AAAA,QACJ,eAAe,CAAA,MAAK,WAAM,iBAAN,mBAAoB,kBAAiB,CAAC;AAAA,MAAA;AAAA,IAC5D;AAGI,UAAA,yBAAyB,MAAM,MAAM,gBAAgB;AAC3D,UAAM,sBAAsB,MAAM;AAChC,UAAI,CAAC,MAAM,wBAAwB,MAAM,QAAQ,qBAAqB;AACpE,cAAM,uBAAuB,MAAM,QAAQ,oBAAoB,KAAK;AAAA,MACtE;AAEA,UAAI,MAAM,QAAQ,mBAAmB,CAAC,MAAM,sBAAsB;AAChE,eAAO,MAAM;MACf;AAEA,aAAO,MAAM;IAAqB;AAAA,EAEtC;AACF;AAEgB,SAAA,uBACd,UACA,OACA,QACA;AACA,UACG,YAAY,SAAS,aAClB,SAAS,WAAW,OAAO,MAAM,IACjC,UACJ,OAAO,UAAU,eAChB,OAAO,UAAU,YAAY,CAAC;AAEnC;;;"}
|