@tanstack/table-core 8.0.0-alpha.63 → 8.0.0-alpha.64
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/build/cjs/core.js +7 -3
- package/build/cjs/core.js.map +1 -1
- package/build/cjs/features/ColumnSizing.js +3 -3
- package/build/cjs/features/ColumnSizing.js.map +1 -1
- package/build/cjs/features/Expanding.js +3 -3
- package/build/cjs/features/Expanding.js.map +1 -1
- package/build/cjs/features/Filters.js +10 -8
- package/build/cjs/features/Filters.js.map +1 -1
- package/build/cjs/features/Grouping.js +24 -22
- package/build/cjs/features/Grouping.js.map +1 -1
- package/build/cjs/features/Ordering.js +5 -4
- package/build/cjs/features/Ordering.js.map +1 -1
- package/build/cjs/features/Pagination.js +4 -4
- package/build/cjs/features/Pagination.js.map +1 -1
- package/build/cjs/features/Pinning.js +11 -72
- package/build/cjs/features/Pinning.js.map +1 -1
- package/build/cjs/features/RowSelection.js +3 -3
- package/build/cjs/features/RowSelection.js.map +1 -1
- package/build/cjs/features/Sorting.js +5 -5
- package/build/cjs/features/Sorting.js.map +1 -1
- package/build/cjs/features/Visibility.js +3 -3
- package/build/cjs/features/Visibility.js.map +1 -1
- package/build/cjs/index.js +1 -0
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.js +75 -131
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +357 -339
- package/build/types/features/Expanding.d.ts +2 -7
- package/build/types/features/Filters.d.ts +3 -14
- package/build/types/features/Grouping.d.ts +3 -11
- package/build/types/features/Ordering.d.ts +2 -6
- package/build/types/features/Pinning.d.ts +2 -15
- package/build/types/features/RowSelection.d.ts +3 -8
- package/build/types/features/Sorting.d.ts +2 -8
- package/build/types/features/Visibility.d.ts +2 -11
- package/build/umd/index.development.js +75 -130
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/core.ts +5 -4
- package/src/features/ColumnSizing.ts +2 -1
- package/src/features/Expanding.ts +4 -2
- package/src/features/Filters.ts +16 -24
- package/src/features/Grouping.ts +23 -21
- package/src/features/Ordering.ts +6 -8
- package/src/features/Pagination.ts +3 -2
- package/src/features/Pinning.ts +6 -74
- package/src/features/RowSelection.ts +5 -3
- package/src/features/Sorting.ts +9 -7
- package/src/features/Visibility.ts +4 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RowModel } from '..';
|
|
2
|
-
import { OnChangeFn, TableGenerics, TableInstance, Row, Updater } from '../types';
|
|
2
|
+
import { OnChangeFn, TableGenerics, TableInstance, Row, Updater, TableFeature } from '../types';
|
|
3
3
|
export declare type ExpandedStateList = Record<string, boolean>;
|
|
4
4
|
export declare type ExpandedState = true | Record<string, boolean>;
|
|
5
5
|
export declare type ExpandedTableState = {
|
|
@@ -41,9 +41,4 @@ export declare type ExpandedInstance<TGenerics extends TableGenerics> = {
|
|
|
41
41
|
_getExpandedRowModel?: () => RowModel<TGenerics>;
|
|
42
42
|
getPreExpandedRowModel: () => RowModel<TGenerics>;
|
|
43
43
|
};
|
|
44
|
-
export declare const Expanding:
|
|
45
|
-
getInitialState: () => ExpandedTableState;
|
|
46
|
-
getDefaultOptions: <TGenerics extends TableGenerics>(instance: TableInstance<TGenerics>) => ExpandedOptions<TGenerics>;
|
|
47
|
-
createInstance: <TGenerics_1 extends TableGenerics>(instance: TableInstance<TGenerics_1>) => ExpandedInstance<TGenerics_1>;
|
|
48
|
-
createRow: <TGenerics_2 extends TableGenerics>(row: Row<TGenerics_2>, instance: TableInstance<TGenerics_2>) => ExpandedRow;
|
|
49
|
-
};
|
|
44
|
+
export declare const Expanding: TableFeature;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RowModel } from '..';
|
|
2
2
|
import { BuiltInFilterFn } from '../filterFns';
|
|
3
|
-
import { Column, OnChangeFn, TableGenerics, TableInstance, Row, Updater } from '../types';
|
|
3
|
+
import { Column, OnChangeFn, TableGenerics, TableInstance, Row, Updater, TableFeature } from '../types';
|
|
4
4
|
import { Overwrite } from '../utils';
|
|
5
5
|
export declare type FiltersTableState = {
|
|
6
6
|
columnFilters: ColumnFiltersState;
|
|
@@ -24,12 +24,8 @@ export declare type FiltersColumnDef<TGenerics extends TableGenerics> = {
|
|
|
24
24
|
filterFn?: FilterFnOption<Overwrite<TGenerics, {
|
|
25
25
|
Value: any;
|
|
26
26
|
}>>;
|
|
27
|
-
enableAllFilters?: boolean;
|
|
28
27
|
enableColumnFilter?: boolean;
|
|
29
28
|
enableGlobalFilter?: boolean;
|
|
30
|
-
defaultCanFilter?: boolean;
|
|
31
|
-
defaultCanColumnFilter?: boolean;
|
|
32
|
-
defaultCanGlobalFilter?: boolean;
|
|
33
29
|
};
|
|
34
30
|
export declare type FiltersColumn<TGenerics extends TableGenerics> = {
|
|
35
31
|
filterFn: FilterFnOption<Overwrite<TGenerics, {
|
|
@@ -48,7 +44,6 @@ export declare type FiltersColumn<TGenerics extends TableGenerics> = {
|
|
|
48
44
|
export declare type FiltersOptions<TGenerics extends TableGenerics> = {
|
|
49
45
|
filterFromLeafRows?: boolean;
|
|
50
46
|
filterFns?: TGenerics['FilterFns'];
|
|
51
|
-
enableFilters?: boolean;
|
|
52
47
|
manualColumnFiltering?: boolean;
|
|
53
48
|
onColumnFiltersChange?: OnChangeFn<ColumnFiltersState>;
|
|
54
49
|
enableColumnFilters?: boolean;
|
|
@@ -58,7 +53,7 @@ export declare type FiltersOptions<TGenerics extends TableGenerics> = {
|
|
|
58
53
|
onGlobalFilterChange?: OnChangeFn<any>;
|
|
59
54
|
enableGlobalFilter?: boolean;
|
|
60
55
|
getGlobalFilteredRowModel?: (instance: TableInstance<TGenerics>) => () => RowModel<TGenerics>;
|
|
61
|
-
|
|
56
|
+
getColumnCanGlobalFilter?: (column: Column<TGenerics>) => boolean;
|
|
62
57
|
};
|
|
63
58
|
export declare type FiltersInstance<TGenerics extends TableGenerics> = {
|
|
64
59
|
getColumnAutoFilterFn: (columnId: string) => FilterFn<TGenerics> | undefined;
|
|
@@ -82,11 +77,5 @@ export declare type FiltersInstance<TGenerics extends TableGenerics> = {
|
|
|
82
77
|
getGlobalFilteredRowModel: () => RowModel<TGenerics>;
|
|
83
78
|
_getGlobalFilteredRowModel?: () => RowModel<TGenerics>;
|
|
84
79
|
};
|
|
85
|
-
export declare const Filters:
|
|
86
|
-
getDefaultColumn: <TGenerics extends TableGenerics>() => FiltersColumnDef<TGenerics>;
|
|
87
|
-
getInitialState: () => FiltersTableState;
|
|
88
|
-
getDefaultOptions: <TGenerics_1 extends TableGenerics>(instance: TableInstance<TGenerics_1>) => FiltersOptions<TGenerics_1>;
|
|
89
|
-
createColumn: <TGenerics_2 extends TableGenerics>(column: Column<TGenerics_2>, instance: TableInstance<TGenerics_2>) => FiltersColumn<TGenerics_2>;
|
|
90
|
-
createInstance: <TGenerics_3 extends TableGenerics>(instance: TableInstance<TGenerics_3>) => FiltersInstance<TGenerics_3>;
|
|
91
|
-
};
|
|
80
|
+
export declare const Filters: TableFeature;
|
|
92
81
|
export declare function shouldAutoRemoveFilter<TGenerics extends TableGenerics>(filterFn?: FilterFn<TGenerics>, value?: any, column?: Column<TGenerics>): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RowModel } from '..';
|
|
2
2
|
import { BuiltInAggregationFn } from '../aggregationFns';
|
|
3
|
-
import { Cell, Column, OnChangeFn, TableInstance, Row, Updater, Renderable, TableGenerics } from '../types';
|
|
3
|
+
import { Cell, Column, OnChangeFn, TableInstance, Row, Updater, Renderable, TableGenerics, TableFeature } from '../types';
|
|
4
4
|
import { Overwrite } from '../utils';
|
|
5
5
|
export declare type GroupingState = string[];
|
|
6
6
|
export declare type AggregationFn<TGenerics extends TableGenerics> = (getLeafValues: () => TGenerics['Row'][], getChildValues: () => TGenerics['Row'][]) => any;
|
|
@@ -74,13 +74,5 @@ export declare type GroupingInstance<TGenerics extends TableGenerics> = {
|
|
|
74
74
|
getGroupedRowModel: () => RowModel<TGenerics>;
|
|
75
75
|
_getGroupedRowModel?: () => RowModel<TGenerics>;
|
|
76
76
|
};
|
|
77
|
-
export declare const Grouping:
|
|
78
|
-
|
|
79
|
-
getInitialState: () => GroupingTableState;
|
|
80
|
-
getDefaultOptions: <TGenerics_1 extends TableGenerics>(instance: TableInstance<TGenerics_1>) => GroupingOptions<TGenerics_1>;
|
|
81
|
-
createColumn: <TGenerics_2 extends TableGenerics>(column: Column<TGenerics_2>, instance: TableInstance<TGenerics_2>) => GroupingColumn<TGenerics_2>;
|
|
82
|
-
createInstance: <TGenerics_3 extends TableGenerics>(instance: TableInstance<TGenerics_3>) => GroupingInstance<TGenerics_3>;
|
|
83
|
-
createRow: <TGenerics_4 extends TableGenerics>(row: Row<TGenerics_4>, instance: TableInstance<TGenerics_4>) => GroupingRow;
|
|
84
|
-
createCell: <TGenerics_5 extends TableGenerics>(cell: Cell<TGenerics_5>, column: Column<TGenerics_5>, row: Row<TGenerics_5>, instance: TableInstance<TGenerics_5>) => GroupingCell<TGenerics_5>;
|
|
85
|
-
orderColumns: <TGenerics_6 extends TableGenerics>(leafColumns: Column<TGenerics_6>[], grouping: string[], groupedColumnMode?: GroupingColumnMode) => Column<TGenerics_6>[];
|
|
86
|
-
};
|
|
77
|
+
export declare const Grouping: TableFeature;
|
|
78
|
+
export declare function orderColumns<TGenerics extends TableGenerics>(leafColumns: Column<TGenerics>[], grouping: string[], groupedColumnMode?: GroupingColumnMode): Column<TGenerics>[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnChangeFn, Updater, Column, TableGenerics, TableFeature } from '../types';
|
|
2
2
|
export declare type ColumnOrderTableState = {
|
|
3
3
|
columnOrder: ColumnOrderState;
|
|
4
4
|
};
|
|
@@ -14,8 +14,4 @@ export declare type ColumnOrderInstance<TGenerics extends TableGenerics> = {
|
|
|
14
14
|
resetColumnOrder: () => void;
|
|
15
15
|
_getOrderColumnsFn: () => (columns: Column<TGenerics>[]) => Column<TGenerics>[];
|
|
16
16
|
};
|
|
17
|
-
export declare const Ordering:
|
|
18
|
-
getInitialState: () => ColumnOrderTableState;
|
|
19
|
-
getDefaultOptions: <TGenerics extends TableGenerics>(instance: TableInstance<TGenerics>) => ColumnOrderDefaultOptions;
|
|
20
|
-
createInstance: <TGenerics_1 extends TableGenerics>(instance: TableInstance<TGenerics_1>) => ColumnOrderInstance<TGenerics_1>;
|
|
21
|
-
};
|
|
17
|
+
export declare const Ordering: TableFeature;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnChangeFn, Updater,
|
|
1
|
+
import { OnChangeFn, Updater, Column, TableGenerics, Cell, TableFeature } from '../types';
|
|
2
2
|
export declare type ColumnPinningPosition = false | 'left' | 'right';
|
|
3
3
|
export declare type ColumnPinningState = {
|
|
4
4
|
left?: string[];
|
|
@@ -16,7 +16,6 @@ export declare type ColumnPinningDefaultOptions = {
|
|
|
16
16
|
};
|
|
17
17
|
export declare type ColumnPinningColumnDef = {
|
|
18
18
|
enablePinning?: boolean;
|
|
19
|
-
defaultCanPin?: boolean;
|
|
20
19
|
};
|
|
21
20
|
export declare type ColumnPinningColumn = {
|
|
22
21
|
getCanPin: () => boolean;
|
|
@@ -29,11 +28,6 @@ export declare type ColumnPinningRow<TGenerics extends TableGenerics> = {
|
|
|
29
28
|
getCenterVisibleCells: () => Cell<TGenerics>[];
|
|
30
29
|
getRightVisibleCells: () => Cell<TGenerics>[];
|
|
31
30
|
};
|
|
32
|
-
export declare type ColumnPinningCell<TGenerics extends TableGenerics> = {
|
|
33
|
-
getLeftVisibleCells: () => Cell<TGenerics>[];
|
|
34
|
-
getCenterVisibleCells: () => Cell<TGenerics>[];
|
|
35
|
-
getRightVisibleCells: () => Cell<TGenerics>[];
|
|
36
|
-
};
|
|
37
31
|
export declare type ColumnPinningInstance<TGenerics extends TableGenerics> = {
|
|
38
32
|
setColumnPinning: (updater: Updater<ColumnPinningState>) => void;
|
|
39
33
|
resetColumnPinning: () => void;
|
|
@@ -46,11 +40,4 @@ export declare type ColumnPinningInstance<TGenerics extends TableGenerics> = {
|
|
|
46
40
|
getRightLeafColumns: () => Column<TGenerics>[];
|
|
47
41
|
getCenterLeafColumns: () => Column<TGenerics>[];
|
|
48
42
|
};
|
|
49
|
-
export declare const Pinning:
|
|
50
|
-
getInitialState: () => ColumnPinningTableState;
|
|
51
|
-
getDefaultOptions: <TGenerics extends TableGenerics>(instance: TableInstance<TGenerics>) => ColumnPinningDefaultOptions;
|
|
52
|
-
createColumn: <TGenerics_1 extends TableGenerics>(column: Column<TGenerics_1>, instance: TableInstance<TGenerics_1>) => ColumnPinningColumn;
|
|
53
|
-
createRow: <TGenerics_2 extends TableGenerics>(row: Row<TGenerics_2>, instance: TableInstance<TGenerics_2>) => ColumnPinningRow<TGenerics_2>;
|
|
54
|
-
createCell: <TGenerics_3 extends TableGenerics>(cell: Cell<TGenerics_3>, instance: TableInstance<TGenerics_3>) => ColumnPinningCell<TGenerics_3>;
|
|
55
|
-
createInstance: <TGenerics_4 extends TableGenerics>(instance: TableInstance<TGenerics_4>) => ColumnPinningInstance<TGenerics_4>;
|
|
56
|
-
};
|
|
43
|
+
export declare const Pinning: TableFeature;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { OnChangeFn, TableGenerics, TableInstance, Row, RowModel, Updater } from '../types';
|
|
1
|
+
import { OnChangeFn, TableGenerics, TableInstance, Row, RowModel, Updater, TableFeature } from '../types';
|
|
2
2
|
export declare type RowSelectionState = Record<string, boolean>;
|
|
3
3
|
export declare type RowSelectionTableState = {
|
|
4
4
|
rowSelection: RowSelectionState;
|
|
5
5
|
};
|
|
6
6
|
export declare type RowSelectionOptions<TGenerics extends TableGenerics> = {
|
|
7
|
-
onRowSelectionChange?: OnChangeFn<RowSelectionState>;
|
|
8
7
|
enableRowSelection?: boolean | ((row: Row<TGenerics>) => boolean);
|
|
9
8
|
enableMultiRowSelection?: boolean | ((row: Row<TGenerics>) => boolean);
|
|
10
9
|
enableSubRowSelection?: boolean | ((row: Row<TGenerics>) => boolean);
|
|
10
|
+
onRowSelectionChange?: OnChangeFn<RowSelectionState>;
|
|
11
11
|
};
|
|
12
12
|
export declare type RowSelectionRow = {
|
|
13
13
|
getIsSelected: () => boolean;
|
|
@@ -40,11 +40,6 @@ export declare type RowSelectionInstance<TGenerics extends TableGenerics> = {
|
|
|
40
40
|
getFilteredSelectedRowModel: () => RowModel<TGenerics>;
|
|
41
41
|
getGroupedSelectedRowModel: () => RowModel<TGenerics>;
|
|
42
42
|
};
|
|
43
|
-
export declare const RowSelection:
|
|
44
|
-
getInitialState: () => RowSelectionTableState;
|
|
45
|
-
getDefaultOptions: <TGenerics extends TableGenerics>(instance: TableInstance<TGenerics>) => RowSelectionOptions<TGenerics>;
|
|
46
|
-
createInstance: <TGenerics_1 extends TableGenerics>(instance: TableInstance<TGenerics_1>) => RowSelectionInstance<TGenerics_1>;
|
|
47
|
-
createRow: <TGenerics_2 extends TableGenerics>(row: Row<TGenerics_2>, instance: TableInstance<TGenerics_2>) => RowSelectionRow;
|
|
48
|
-
};
|
|
43
|
+
export declare const RowSelection: TableFeature;
|
|
49
44
|
export declare function selectRowsFn<TGenerics extends TableGenerics>(instance: TableInstance<TGenerics>, rowModel: RowModel<TGenerics>): RowModel<TGenerics>;
|
|
50
45
|
export declare function isRowSelected<TGenerics extends TableGenerics>(row: Row<TGenerics>, selection: Record<string, boolean>, instance: TableInstance<TGenerics>): boolean | 'some';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RowModel } from '..';
|
|
2
2
|
import { BuiltInSortingFn } from '../sortingFns';
|
|
3
|
-
import {
|
|
3
|
+
import { OnChangeFn, TableGenerics, TableInstance, Row, Updater, TableFeature } from '../types';
|
|
4
4
|
import { Overwrite } from '../utils';
|
|
5
5
|
export declare type SortDirection = 'asc' | 'desc';
|
|
6
6
|
export declare type ColumnSort = {
|
|
@@ -68,10 +68,4 @@ export declare type SortingInstance<TGenerics extends TableGenerics> = {
|
|
|
68
68
|
getSortedRowModel: () => RowModel<TGenerics>;
|
|
69
69
|
_getSortedRowModel?: () => RowModel<TGenerics>;
|
|
70
70
|
};
|
|
71
|
-
export declare const Sorting:
|
|
72
|
-
getDefaultColumn: <TGenerics extends TableGenerics>() => SortingColumnDef<TGenerics>;
|
|
73
|
-
getInitialState: () => SortingTableState;
|
|
74
|
-
getDefaultOptions: <TGenerics_1 extends TableGenerics>(instance: TableInstance<TGenerics_1>) => SortingOptions<TGenerics_1>;
|
|
75
|
-
createColumn: <TGenerics_2 extends TableGenerics>(column: Column<TGenerics_2>, instance: TableInstance<TGenerics_2>) => SortingColumn<TGenerics_2>;
|
|
76
|
-
createInstance: <TGenerics_3 extends TableGenerics>(instance: TableInstance<TGenerics_3>) => SortingInstance<TGenerics_3>;
|
|
77
|
-
};
|
|
71
|
+
export declare const Sorting: TableFeature;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Cell, Column, OnChangeFn, TableGenerics,
|
|
1
|
+
import { Cell, Column, OnChangeFn, TableGenerics, Updater, TableFeature } from '../types';
|
|
2
2
|
export declare type VisibilityOptions = {
|
|
3
3
|
onColumnVisibilityChange?: OnChangeFn<VisibilityState>;
|
|
4
4
|
enableHiding?: boolean;
|
|
@@ -40,13 +40,4 @@ export declare type VisibilityColumn = {
|
|
|
40
40
|
toggleVisibility: (value?: boolean) => void;
|
|
41
41
|
getToggleVisibilityHandler: () => (event: unknown) => void;
|
|
42
42
|
};
|
|
43
|
-
export declare const Visibility:
|
|
44
|
-
getInitialState: () => VisibilityTableState;
|
|
45
|
-
getDefaultOptions: <TGenerics extends TableGenerics>(instance: TableInstance<TGenerics>) => VisibilityDefaultOptions;
|
|
46
|
-
getDefaultColumn: () => {
|
|
47
|
-
defaultIsVisible: boolean;
|
|
48
|
-
};
|
|
49
|
-
createColumn: <TGenerics_1 extends TableGenerics>(column: Column<TGenerics_1>, instance: TableInstance<TGenerics_1>) => VisibilityColumn;
|
|
50
|
-
createRow: <TGenerics_2 extends TableGenerics>(row: Row<TGenerics_2>, instance: TableInstance<TGenerics_2>) => VisibilityRow<TGenerics_2>;
|
|
51
|
-
createInstance: <TGenerics_3 extends TableGenerics>(instance: TableInstance<TGenerics_3>) => VisibilityInstance<TGenerics_3>;
|
|
52
|
-
};
|
|
43
|
+
export declare const Visibility: TableFeature;
|
|
@@ -706,8 +706,8 @@
|
|
|
706
706
|
getDefaultColumn: function getDefaultColumn() {
|
|
707
707
|
return defaultColumnSizing;
|
|
708
708
|
},
|
|
709
|
-
getInitialState: function getInitialState() {
|
|
710
|
-
return {
|
|
709
|
+
getInitialState: function getInitialState(state) {
|
|
710
|
+
return _extends({
|
|
711
711
|
columnSizing: {},
|
|
712
712
|
columnSizingInfo: {
|
|
713
713
|
startOffset: null,
|
|
@@ -717,7 +717,7 @@
|
|
|
717
717
|
isResizingColumn: false,
|
|
718
718
|
columnSizingStart: []
|
|
719
719
|
}
|
|
720
|
-
};
|
|
720
|
+
}, state);
|
|
721
721
|
},
|
|
722
722
|
getDefaultOptions: function getDefaultOptions(instance) {
|
|
723
723
|
return {
|
|
@@ -1050,10 +1050,10 @@
|
|
|
1050
1050
|
|
|
1051
1051
|
//
|
|
1052
1052
|
var Expanding = {
|
|
1053
|
-
getInitialState: function getInitialState() {
|
|
1054
|
-
return {
|
|
1053
|
+
getInitialState: function getInitialState(state) {
|
|
1054
|
+
return _extends({
|
|
1055
1055
|
expanded: {}
|
|
1056
|
-
};
|
|
1056
|
+
}, state);
|
|
1057
1057
|
},
|
|
1058
1058
|
getDefaultOptions: function getDefaultOptions(instance) {
|
|
1059
1059
|
return {
|
|
@@ -1428,13 +1428,13 @@
|
|
|
1428
1428
|
filterFn: 'auto'
|
|
1429
1429
|
};
|
|
1430
1430
|
},
|
|
1431
|
-
getInitialState: function getInitialState() {
|
|
1432
|
-
return {
|
|
1431
|
+
getInitialState: function getInitialState(state) {
|
|
1432
|
+
return _extends({
|
|
1433
1433
|
columnFilters: [],
|
|
1434
1434
|
globalFilter: undefined,
|
|
1435
1435
|
columnFiltersProgress: 1,
|
|
1436
1436
|
globalFilterProgress: 1
|
|
1437
|
-
};
|
|
1437
|
+
}, state);
|
|
1438
1438
|
},
|
|
1439
1439
|
getDefaultOptions: function getDefaultOptions(instance) {
|
|
1440
1440
|
return {
|
|
@@ -1442,7 +1442,7 @@
|
|
|
1442
1442
|
onGlobalFilterChange: makeStateUpdater('globalFilter', instance),
|
|
1443
1443
|
filterFromLeafRows: true,
|
|
1444
1444
|
globalFilterFn: 'auto',
|
|
1445
|
-
|
|
1445
|
+
getColumnCanGlobalFilter: function getColumnCanGlobalFilter(column) {
|
|
1446
1446
|
var _instance$getCoreRowM, _instance$getCoreRowM2;
|
|
1447
1447
|
|
|
1448
1448
|
var value = (_instance$getCoreRowM = instance.getCoreRowModel().flatRows[0]) == null ? void 0 : (_instance$getCoreRowM2 = _instance$getCoreRowM.getAllCellsByColumnId()[column.id]) == null ? void 0 : _instance$getCoreRowM2.value;
|
|
@@ -1571,6 +1571,7 @@
|
|
|
1571
1571
|
var _instance$options = instance.options,
|
|
1572
1572
|
userFilterFns = _instance$options.filterFns,
|
|
1573
1573
|
globalFilterFn = _instance$options.globalFilterFn;
|
|
1574
|
+
debugger;
|
|
1574
1575
|
return isFunction(globalFilterFn) ? globalFilterFn : globalFilterFn === 'auto' ? instance.getGlobalAutoFilterFn() : (_ref2 = userFilterFns == null ? void 0 : userFilterFns[globalFilterFn]) != null ? _ref2 : filterFns[globalFilterFn];
|
|
1575
1576
|
},
|
|
1576
1577
|
setColumnFilters: function setColumnFilters(updater) {
|
|
@@ -1605,7 +1606,7 @@
|
|
|
1605
1606
|
instance.setGlobalFilter(instance.initialState.globalFilter);
|
|
1606
1607
|
},
|
|
1607
1608
|
getColumnCanColumnFilter: function getColumnCanColumnFilter(columnId) {
|
|
1608
|
-
var
|
|
1609
|
+
var _column$enableColumnF, _instance$options$ena;
|
|
1609
1610
|
|
|
1610
1611
|
var column = instance.getColumn(columnId);
|
|
1611
1612
|
|
|
@@ -1613,10 +1614,10 @@
|
|
|
1613
1614
|
throw new Error();
|
|
1614
1615
|
}
|
|
1615
1616
|
|
|
1616
|
-
return (
|
|
1617
|
+
return ((_column$enableColumnF = column.enableColumnFilter) != null ? _column$enableColumnF : true) && ((_instance$options$ena = instance.options.enableColumnFilters) != null ? _instance$options$ena : true) && !!column.accessorFn;
|
|
1617
1618
|
},
|
|
1618
1619
|
getColumnCanGlobalFilter: function getColumnCanGlobalFilter(columnId) {
|
|
1619
|
-
var
|
|
1620
|
+
var _column$enableGlobalF, _instance$options$ena2, _instance$options$get;
|
|
1620
1621
|
|
|
1621
1622
|
var column = instance.getColumn(columnId);
|
|
1622
1623
|
|
|
@@ -1624,7 +1625,7 @@
|
|
|
1624
1625
|
throw new Error();
|
|
1625
1626
|
}
|
|
1626
1627
|
|
|
1627
|
-
return (
|
|
1628
|
+
return ((_column$enableGlobalF = column.enableGlobalFilter) != null ? _column$enableGlobalF : true) && ((_instance$options$ena2 = instance.options.enableGlobalFilter) != null ? _instance$options$ena2 : true) && ((_instance$options$get = instance.options.getColumnCanGlobalFilter == null ? void 0 : instance.options.getColumnCanGlobalFilter(column)) != null ? _instance$options$get : true) && !!column.accessorFn;
|
|
1628
1629
|
},
|
|
1629
1630
|
getColumnIsFiltered: function getColumnIsFiltered(columnId) {
|
|
1630
1631
|
return instance.getColumnFilterIndex(columnId) > -1;
|
|
@@ -1855,10 +1856,10 @@
|
|
|
1855
1856
|
aggregationFn: 'auto'
|
|
1856
1857
|
};
|
|
1857
1858
|
},
|
|
1858
|
-
getInitialState: function getInitialState() {
|
|
1859
|
-
return {
|
|
1859
|
+
getInitialState: function getInitialState(state) {
|
|
1860
|
+
return _extends({
|
|
1860
1861
|
grouping: []
|
|
1861
|
-
};
|
|
1862
|
+
}, state);
|
|
1862
1863
|
},
|
|
1863
1864
|
getDefaultOptions: function getDefaultOptions(instance) {
|
|
1864
1865
|
return {
|
|
@@ -2017,35 +2018,35 @@
|
|
|
2017
2018
|
}) : null;
|
|
2018
2019
|
}
|
|
2019
2020
|
};
|
|
2020
|
-
}
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
var nonGroupingColumns = leafColumns.filter(function (col) {
|
|
2027
|
-
return !grouping.includes(col.id);
|
|
2028
|
-
});
|
|
2021
|
+
}
|
|
2022
|
+
};
|
|
2023
|
+
function orderColumns(leafColumns, grouping, groupedColumnMode) {
|
|
2024
|
+
if (!(grouping != null && grouping.length) || !groupedColumnMode) {
|
|
2025
|
+
return leafColumns;
|
|
2026
|
+
}
|
|
2029
2027
|
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2028
|
+
var nonGroupingColumns = leafColumns.filter(function (col) {
|
|
2029
|
+
return !grouping.includes(col.id);
|
|
2030
|
+
});
|
|
2033
2031
|
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
return col.id === g;
|
|
2037
|
-
});
|
|
2038
|
-
}).filter(Boolean);
|
|
2039
|
-
return [].concat(groupingColumns, nonGroupingColumns);
|
|
2032
|
+
if (groupedColumnMode === 'remove') {
|
|
2033
|
+
return nonGroupingColumns;
|
|
2040
2034
|
}
|
|
2041
|
-
|
|
2035
|
+
|
|
2036
|
+
var groupingColumns = grouping.map(function (g) {
|
|
2037
|
+
return leafColumns.find(function (col) {
|
|
2038
|
+
return col.id === g;
|
|
2039
|
+
});
|
|
2040
|
+
}).filter(Boolean);
|
|
2041
|
+
return [].concat(groupingColumns, nonGroupingColumns);
|
|
2042
|
+
}
|
|
2042
2043
|
|
|
2043
2044
|
//
|
|
2044
2045
|
var Ordering = {
|
|
2045
|
-
getInitialState: function getInitialState() {
|
|
2046
|
-
return {
|
|
2046
|
+
getInitialState: function getInitialState(state) {
|
|
2047
|
+
return _extends({
|
|
2047
2048
|
columnOrder: []
|
|
2048
|
-
};
|
|
2049
|
+
}, state);
|
|
2049
2050
|
},
|
|
2050
2051
|
getDefaultOptions: function getDefaultOptions(instance) {
|
|
2051
2052
|
return {
|
|
@@ -2097,7 +2098,7 @@
|
|
|
2097
2098
|
orderedColumns = [].concat(orderedColumns, columnsCopy);
|
|
2098
2099
|
}
|
|
2099
2100
|
|
|
2100
|
-
return
|
|
2101
|
+
return orderColumns(orderedColumns, grouping, groupedColumnMode);
|
|
2101
2102
|
};
|
|
2102
2103
|
}, {
|
|
2103
2104
|
key: 'getOrderColumnsFn' // debug: () => instance.options.debugAll ?? instance.options.debugTable,
|
|
@@ -2109,14 +2110,14 @@
|
|
|
2109
2110
|
|
|
2110
2111
|
//
|
|
2111
2112
|
var Pagination = {
|
|
2112
|
-
getInitialState: function getInitialState(
|
|
2113
|
-
return {
|
|
2113
|
+
getInitialState: function getInitialState(state) {
|
|
2114
|
+
return _extends({}, state, {
|
|
2114
2115
|
pagination: _extends({
|
|
2115
2116
|
pageCount: -1,
|
|
2116
2117
|
pageIndex: 0,
|
|
2117
2118
|
pageSize: 10
|
|
2118
|
-
},
|
|
2119
|
-
};
|
|
2119
|
+
}, state == null ? void 0 : state.pagination)
|
|
2120
|
+
});
|
|
2120
2121
|
},
|
|
2121
2122
|
getDefaultOptions: function getDefaultOptions(instance) {
|
|
2122
2123
|
return {
|
|
@@ -2276,13 +2277,13 @@
|
|
|
2276
2277
|
|
|
2277
2278
|
//
|
|
2278
2279
|
var Pinning = {
|
|
2279
|
-
getInitialState: function getInitialState() {
|
|
2280
|
-
return {
|
|
2280
|
+
getInitialState: function getInitialState(state) {
|
|
2281
|
+
return _extends({
|
|
2281
2282
|
columnPinning: {
|
|
2282
2283
|
left: [],
|
|
2283
2284
|
right: []
|
|
2284
2285
|
}
|
|
2285
|
-
};
|
|
2286
|
+
}, state);
|
|
2286
2287
|
},
|
|
2287
2288
|
getDefaultOptions: function getDefaultOptions(instance) {
|
|
2288
2289
|
return {
|
|
@@ -2366,67 +2367,6 @@
|
|
|
2366
2367
|
})
|
|
2367
2368
|
};
|
|
2368
2369
|
},
|
|
2369
|
-
createCell: function createCell(cell, instance) {
|
|
2370
|
-
return {
|
|
2371
|
-
getCenterVisibleCells: memo(function () {
|
|
2372
|
-
return [cell.row._getAllVisibleCells(), instance.getState().columnPinning.left, instance.getState().columnPinning.right];
|
|
2373
|
-
}, function (allCells, left, right) {
|
|
2374
|
-
var leftAndRight = [].concat(left != null ? left : [], right != null ? right : []);
|
|
2375
|
-
return allCells.filter(function (d) {
|
|
2376
|
-
return !leftAndRight.includes(d.columnId);
|
|
2377
|
-
});
|
|
2378
|
-
}, {
|
|
2379
|
-
key: 'row.getCenterVisibleCells',
|
|
2380
|
-
debug: function debug() {
|
|
2381
|
-
var _instance$options$deb4;
|
|
2382
|
-
|
|
2383
|
-
return (_instance$options$deb4 = instance.options.debugAll) != null ? _instance$options$deb4 : instance.options.debugRows;
|
|
2384
|
-
}
|
|
2385
|
-
}),
|
|
2386
|
-
getLeftVisibleCells: memo(function () {
|
|
2387
|
-
return [cell.row._getAllVisibleCells(), instance.getState().columnPinning.left,,];
|
|
2388
|
-
}, function (allCells, left) {
|
|
2389
|
-
var cells = (left != null ? left : []).map(function (columnId) {
|
|
2390
|
-
return allCells.find(function (cell) {
|
|
2391
|
-
return cell.columnId === columnId;
|
|
2392
|
-
});
|
|
2393
|
-
}).filter(Boolean).map(function (d) {
|
|
2394
|
-
return _extends({}, d, {
|
|
2395
|
-
position: 'left'
|
|
2396
|
-
});
|
|
2397
|
-
});
|
|
2398
|
-
return cells;
|
|
2399
|
-
}, {
|
|
2400
|
-
key: 'row.getLeftVisibleCells',
|
|
2401
|
-
debug: function debug() {
|
|
2402
|
-
var _instance$options$deb5;
|
|
2403
|
-
|
|
2404
|
-
return (_instance$options$deb5 = instance.options.debugAll) != null ? _instance$options$deb5 : instance.options.debugRows;
|
|
2405
|
-
}
|
|
2406
|
-
}),
|
|
2407
|
-
getRightVisibleCells: memo(function () {
|
|
2408
|
-
return [cell.row._getAllVisibleCells(), instance.getState().columnPinning.right];
|
|
2409
|
-
}, function (allCells, right) {
|
|
2410
|
-
var cells = (right != null ? right : []).map(function (columnId) {
|
|
2411
|
-
return allCells.find(function (cell) {
|
|
2412
|
-
return cell.columnId === columnId;
|
|
2413
|
-
});
|
|
2414
|
-
}).filter(Boolean).map(function (d) {
|
|
2415
|
-
return _extends({}, d, {
|
|
2416
|
-
position: 'left'
|
|
2417
|
-
});
|
|
2418
|
-
});
|
|
2419
|
-
return cells;
|
|
2420
|
-
}, {
|
|
2421
|
-
key: 'row.getRightVisibleCells',
|
|
2422
|
-
debug: function debug() {
|
|
2423
|
-
var _instance$options$deb6;
|
|
2424
|
-
|
|
2425
|
-
return (_instance$options$deb6 = instance.options.debugAll) != null ? _instance$options$deb6 : instance.options.debugRows;
|
|
2426
|
-
}
|
|
2427
|
-
})
|
|
2428
|
-
};
|
|
2429
|
-
},
|
|
2430
2370
|
createInstance: function createInstance(instance) {
|
|
2431
2371
|
return {
|
|
2432
2372
|
setColumnPinning: function setColumnPinning(updater) {
|
|
@@ -2490,9 +2430,9 @@
|
|
|
2490
2430
|
|
|
2491
2431
|
var leafColumns = column.getLeafColumns();
|
|
2492
2432
|
return leafColumns.some(function (d) {
|
|
2493
|
-
var
|
|
2433
|
+
var _d$enablePinning, _instance$options$ena;
|
|
2494
2434
|
|
|
2495
|
-
return (
|
|
2435
|
+
return ((_d$enablePinning = d.enablePinning) != null ? _d$enablePinning : true) && ((_instance$options$ena = instance.options.enablePinning) != null ? _instance$options$ena : true);
|
|
2496
2436
|
});
|
|
2497
2437
|
},
|
|
2498
2438
|
getColumnIsPinned: function getColumnIsPinned(columnId) {
|
|
@@ -2539,9 +2479,9 @@
|
|
|
2539
2479
|
}, {
|
|
2540
2480
|
key: 'getLeftLeafColumns',
|
|
2541
2481
|
debug: function debug() {
|
|
2542
|
-
var _instance$options$
|
|
2482
|
+
var _instance$options$deb4;
|
|
2543
2483
|
|
|
2544
|
-
return (_instance$options$
|
|
2484
|
+
return (_instance$options$deb4 = instance.options.debugAll) != null ? _instance$options$deb4 : instance.options.debugColumns;
|
|
2545
2485
|
}
|
|
2546
2486
|
}),
|
|
2547
2487
|
getRightLeafColumns: memo(function () {
|
|
@@ -2555,9 +2495,9 @@
|
|
|
2555
2495
|
}, {
|
|
2556
2496
|
key: 'getRightLeafColumns',
|
|
2557
2497
|
debug: function debug() {
|
|
2558
|
-
var _instance$options$
|
|
2498
|
+
var _instance$options$deb5;
|
|
2559
2499
|
|
|
2560
|
-
return (_instance$options$
|
|
2500
|
+
return (_instance$options$deb5 = instance.options.debugAll) != null ? _instance$options$deb5 : instance.options.debugColumns;
|
|
2561
2501
|
}
|
|
2562
2502
|
}),
|
|
2563
2503
|
getCenterLeafColumns: memo(function () {
|
|
@@ -2570,9 +2510,9 @@
|
|
|
2570
2510
|
}, {
|
|
2571
2511
|
key: 'getCenterLeafColumns',
|
|
2572
2512
|
debug: function debug() {
|
|
2573
|
-
var _instance$options$
|
|
2513
|
+
var _instance$options$deb6;
|
|
2574
2514
|
|
|
2575
|
-
return (_instance$options$
|
|
2515
|
+
return (_instance$options$deb6 = instance.options.debugAll) != null ? _instance$options$deb6 : instance.options.debugColumns;
|
|
2576
2516
|
}
|
|
2577
2517
|
})
|
|
2578
2518
|
};
|
|
@@ -2581,10 +2521,10 @@
|
|
|
2581
2521
|
|
|
2582
2522
|
//
|
|
2583
2523
|
var RowSelection = {
|
|
2584
|
-
getInitialState: function getInitialState() {
|
|
2585
|
-
return {
|
|
2524
|
+
getInitialState: function getInitialState(state) {
|
|
2525
|
+
return _extends({
|
|
2586
2526
|
rowSelection: {}
|
|
2587
|
-
};
|
|
2527
|
+
}, state);
|
|
2588
2528
|
},
|
|
2589
2529
|
getDefaultOptions: function getDefaultOptions(instance) {
|
|
2590
2530
|
return {
|
|
@@ -3132,16 +3072,16 @@
|
|
|
3132
3072
|
|
|
3133
3073
|
//
|
|
3134
3074
|
var Sorting = {
|
|
3075
|
+
getInitialState: function getInitialState(state) {
|
|
3076
|
+
return _extends({
|
|
3077
|
+
sorting: []
|
|
3078
|
+
}, state);
|
|
3079
|
+
},
|
|
3135
3080
|
getDefaultColumn: function getDefaultColumn() {
|
|
3136
3081
|
return {
|
|
3137
3082
|
sortingFn: 'auto'
|
|
3138
3083
|
};
|
|
3139
3084
|
},
|
|
3140
|
-
getInitialState: function getInitialState() {
|
|
3141
|
-
return {
|
|
3142
|
-
sorting: []
|
|
3143
|
-
};
|
|
3144
|
-
},
|
|
3145
3085
|
getDefaultOptions: function getDefaultOptions(instance) {
|
|
3146
3086
|
return {
|
|
3147
3087
|
onSortingChange: makeStateUpdater('sorting', instance),
|
|
@@ -3409,10 +3349,10 @@
|
|
|
3409
3349
|
|
|
3410
3350
|
//
|
|
3411
3351
|
var Visibility = {
|
|
3412
|
-
getInitialState: function getInitialState() {
|
|
3413
|
-
return {
|
|
3352
|
+
getInitialState: function getInitialState(state) {
|
|
3353
|
+
return _extends({
|
|
3414
3354
|
columnVisibility: {}
|
|
3415
|
-
};
|
|
3355
|
+
}, state);
|
|
3416
3356
|
},
|
|
3417
3357
|
getDefaultOptions: function getDefaultOptions(instance) {
|
|
3418
3358
|
return {
|
|
@@ -4078,9 +4018,13 @@
|
|
|
4078
4018
|
coreProgress: 1
|
|
4079
4019
|
};
|
|
4080
4020
|
|
|
4081
|
-
var initialState = _extends({}, coreInitialState, (_options$initialState = options.initialState) != null ? _options$initialState : {}
|
|
4082
|
-
|
|
4083
|
-
|
|
4021
|
+
var initialState = _extends({}, coreInitialState, (_options$initialState = options.initialState) != null ? _options$initialState : {});
|
|
4022
|
+
|
|
4023
|
+
instance._features.forEach(function (feature) {
|
|
4024
|
+
var _feature$getInitialSt;
|
|
4025
|
+
|
|
4026
|
+
initialState = (_feature$getInitialSt = feature.getInitialState == null ? void 0 : feature.getInitialState(initialState)) != null ? _feature$getInitialSt : initialState;
|
|
4027
|
+
});
|
|
4084
4028
|
|
|
4085
4029
|
var queued = [];
|
|
4086
4030
|
var queuedTimeout = false;
|
|
@@ -5038,6 +4982,7 @@
|
|
|
5038
4982
|
exports.makeStateUpdater = makeStateUpdater;
|
|
5039
4983
|
exports.memo = memo;
|
|
5040
4984
|
exports.noop = noop;
|
|
4985
|
+
exports.orderColumns = orderColumns;
|
|
5041
4986
|
exports.passiveEventSupported = passiveEventSupported;
|
|
5042
4987
|
exports.selectRowsFn = selectRowsFn;
|
|
5043
4988
|
exports.shouldAutoRemoveFilter = shouldAutoRemoveFilter;
|