@tanstack/table-core 8.0.0-alpha.53 → 8.0.0-alpha.57
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 +9 -384
- package/build/cjs/core.js.map +1 -1
- package/build/cjs/createTable.js.map +1 -1
- package/build/cjs/features/Cells.js +122 -0
- package/build/cjs/features/Cells.js.map +1 -0
- package/build/cjs/features/ColumnSizing.js +90 -37
- package/build/cjs/features/ColumnSizing.js.map +1 -1
- package/build/cjs/features/Columns.js +216 -0
- package/build/cjs/features/Columns.js.map +1 -0
- package/build/cjs/features/Expanding.js +1 -1
- package/build/cjs/features/Expanding.js.map +1 -1
- package/build/cjs/features/Filters.js +1 -1
- package/build/cjs/features/Filters.js.map +1 -1
- package/build/cjs/features/Grouping.js +1 -1
- package/build/cjs/features/Grouping.js.map +1 -1
- package/build/cjs/features/Headers.js +78 -153
- package/build/cjs/features/Headers.js.map +1 -1
- package/build/cjs/features/Ordering.js +2 -2
- package/build/cjs/features/Ordering.js.map +1 -1
- package/build/cjs/features/Pagination.js +1 -1
- package/build/cjs/features/Pagination.js.map +1 -1
- package/build/cjs/features/Pinning.js +172 -2
- package/build/cjs/features/Pinning.js.map +1 -1
- package/build/cjs/features/RowSelection.js +1 -1
- package/build/cjs/features/RowSelection.js.map +1 -1
- package/build/cjs/features/Rows.js +99 -0
- package/build/cjs/features/Rows.js.map +1 -0
- package/build/cjs/features/Sorting.js +1 -1
- package/build/cjs/features/Sorting.js.map +1 -1
- package/build/cjs/features/Visibility.js +51 -17
- package/build/cjs/features/Visibility.js.map +1 -1
- package/build/cjs/filterFns.js.map +1 -1
- package/build/cjs/sortingFns.js.map +1 -1
- package/build/cjs/utils/filterRowsUtils.js.map +1 -1
- package/build/cjs/utils/getColumnFilteredRowModelSync.js.map +1 -1
- package/build/cjs/utils/getCoreRowModelAsync.js.map +1 -1
- package/build/cjs/utils/getCoreRowModelSync.js.map +1 -1
- package/build/cjs/utils/getExpandedRowModel.js.map +1 -1
- package/build/cjs/utils/getGlobalFilteredRowModelSync.js.map +1 -1
- package/build/cjs/utils/getGroupedRowModel.js.map +1 -1
- package/build/cjs/utils/getPaginationRowModel.js.map +1 -1
- package/build/cjs/utils/getSortedRowModelSync.js.map +1 -1
- package/build/cjs/utils.js +2 -2
- package/build/cjs/utils.js.map +1 -1
- package/build/esm/index.js +879 -693
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +420 -318
- package/build/types/core.d.ts +5 -82
- package/build/types/createTable.d.ts +4 -4
- package/build/types/features/Cells.d.ts +14 -0
- package/build/types/features/ColumnSizing.d.ts +31 -23
- package/build/types/features/Columns.d.ts +54 -0
- package/build/types/features/Expanding.d.ts +6 -6
- package/build/types/features/Filters.d.ts +14 -14
- package/build/types/features/Grouping.d.ts +16 -16
- package/build/types/features/Headers.d.ts +5 -13
- package/build/types/features/Ordering.d.ts +5 -5
- package/build/types/features/Pagination.d.ts +5 -5
- package/build/types/features/Pinning.d.ts +21 -7
- package/build/types/features/RowSelection.d.ts +8 -8
- package/build/types/features/Rows.d.ts +29 -0
- package/build/types/features/Sorting.d.ts +12 -12
- package/build/types/features/Visibility.d.ts +11 -6
- package/build/types/filterFns.d.ts +10 -10
- package/build/types/sortingFns.d.ts +7 -7
- package/build/types/types.d.ts +37 -33
- package/build/types/utils/filterRowsUtils.d.ts +3 -3
- package/build/types/utils/getColumnFilteredRowModelAsync.d.ts +2 -2
- package/build/types/utils/getColumnFilteredRowModelSync.d.ts +2 -2
- package/build/types/utils/getCoreRowModelAsync.d.ts +2 -2
- package/build/types/utils/getCoreRowModelSync.d.ts +2 -2
- package/build/types/utils/getExpandedRowModel.d.ts +3 -3
- package/build/types/utils/getGlobalFilteredRowModelAsync.d.ts +2 -2
- package/build/types/utils/getGlobalFilteredRowModelSync.d.ts +2 -2
- package/build/types/utils/getGroupedRowModel.d.ts +2 -2
- package/build/types/utils/getPaginationRowModel.d.ts +2 -2
- package/build/types/utils/getSortedRowModelAsync.d.ts +4 -4
- package/build/types/utils/getSortedRowModelSync.d.ts +2 -2
- package/build/types/utils.d.ts +0 -1
- package/build/umd/index.development.js +857 -671
- 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 +32 -554
- package/src/createTable.ts +12 -5
- package/src/features/Cells.ts +156 -0
- package/src/features/ColumnSizing.ts +109 -58
- package/src/features/Columns.ts +290 -0
- package/src/features/Expanding.ts +6 -7
- package/src/features/Filters.ts +14 -15
- package/src/features/Grouping.ts +16 -17
- package/src/features/Headers.ts +51 -142
- package/src/features/Ordering.ts +8 -7
- package/src/features/Pagination.ts +5 -6
- package/src/features/Pinning.ts +198 -8
- package/src/features/RowSelection.ts +9 -10
- package/src/features/Rows.ts +151 -0
- package/src/features/Sorting.ts +12 -13
- package/src/features/Visibility.ts +73 -27
- package/src/filterFns.ts +10 -10
- package/src/sortingFns.ts +7 -7
- package/src/types.ts +47 -65
- package/src/utils/filterRowsUtils.ts +3 -3
- package/src/utils/getColumnFilteredRowModelAsync.ts +2 -2
- package/src/utils/getColumnFilteredRowModelSync.ts +2 -2
- package/src/utils/getCoreRowModelAsync.ts +2 -2
- package/src/utils/getCoreRowModelSync.ts +2 -2
- package/src/utils/getExpandedRowModel.ts +3 -3
- package/src/utils/getGlobalFilteredRowModelAsync.ts +2 -2
- package/src/utils/getGlobalFilteredRowModelSync.ts +2 -2
- package/src/utils/getGroupedRowModel.ts +3 -3
- package/src/utils/getPaginationRowModel.ts +2 -2
- package/src/utils/getSortedRowModelAsync.ts +4 -4
- package/src/utils/getSortedRowModelSync.ts +2 -2
- package/src/utils.ts +3 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OnChangeFn, Updater, TableInstance, Column,
|
|
2
|
-
declare type ColumnPinningPosition = false | 'left' | 'right';
|
|
1
|
+
import { OnChangeFn, Updater, TableInstance, Column, TableGenerics, Row, Cell } from '../types';
|
|
2
|
+
export declare type ColumnPinningPosition = false | 'left' | 'right';
|
|
3
3
|
export declare type ColumnPinningState = {
|
|
4
4
|
left?: string[];
|
|
5
5
|
right?: string[];
|
|
@@ -24,7 +24,17 @@ export declare type ColumnPinningColumn = {
|
|
|
24
24
|
getIsPinned: () => ColumnPinningPosition;
|
|
25
25
|
pin: (position: ColumnPinningPosition) => void;
|
|
26
26
|
};
|
|
27
|
-
export declare type
|
|
27
|
+
export declare type ColumnPinningRow<TGenerics extends TableGenerics> = {
|
|
28
|
+
getLeftVisibleCells: () => Cell<TGenerics>[];
|
|
29
|
+
getCenterVisibleCells: () => Cell<TGenerics>[];
|
|
30
|
+
getRightVisibleCells: () => Cell<TGenerics>[];
|
|
31
|
+
};
|
|
32
|
+
export declare type ColumnPinningCell<TGenerics extends TableGenerics> = {
|
|
33
|
+
getLeftVisibleCells: () => Cell<TGenerics>[];
|
|
34
|
+
getCenterVisibleCells: () => Cell<TGenerics>[];
|
|
35
|
+
getRightVisibleCells: () => Cell<TGenerics>[];
|
|
36
|
+
};
|
|
37
|
+
export declare type ColumnPinningInstance<TGenerics extends TableGenerics> = {
|
|
28
38
|
setColumnPinning: (updater: Updater<ColumnPinningState>) => void;
|
|
29
39
|
resetColumnPinning: () => void;
|
|
30
40
|
pinColumn: (columnId: string, position: ColumnPinningPosition) => void;
|
|
@@ -32,11 +42,15 @@ export declare type ColumnPinningInstance<TGenerics extends AnyGenerics> = {
|
|
|
32
42
|
getColumnIsPinned: (columnId: string) => ColumnPinningPosition;
|
|
33
43
|
getColumnPinnedIndex: (columnId: string) => number;
|
|
34
44
|
getIsSomeColumnsPinned: () => boolean;
|
|
45
|
+
getLeftLeafColumns: () => Column<TGenerics>[];
|
|
46
|
+
getRightLeafColumns: () => Column<TGenerics>[];
|
|
47
|
+
getCenterLeafColumns: () => Column<TGenerics>[];
|
|
35
48
|
};
|
|
36
49
|
export declare const Pinning: {
|
|
37
50
|
getInitialState: () => ColumnPinningTableState;
|
|
38
|
-
getDefaultOptions: <TGenerics extends
|
|
39
|
-
createColumn: <TGenerics_1 extends
|
|
40
|
-
|
|
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>;
|
|
41
56
|
};
|
|
42
|
-
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Getter, OnChangeFn,
|
|
1
|
+
import { Getter, OnChangeFn, TableGenerics, PropGetterValue, TableInstance, Row, RowModel, Updater } from '../types';
|
|
2
2
|
export declare type RowSelectionState = Record<string, boolean>;
|
|
3
3
|
export declare type RowSelectionTableState = {
|
|
4
4
|
rowSelection: RowSelectionState;
|
|
5
5
|
};
|
|
6
|
-
export declare type RowSelectionOptions<TGenerics extends
|
|
6
|
+
export declare type RowSelectionOptions<TGenerics extends TableGenerics> = {
|
|
7
7
|
onRowSelectionChange?: OnChangeFn<RowSelectionState>;
|
|
8
8
|
autoResetRowSelection?: boolean;
|
|
9
9
|
enableRowSelection?: boolean | ((row: Row<TGenerics>) => boolean);
|
|
@@ -24,7 +24,7 @@ export declare type RowSelectionRow = {
|
|
|
24
24
|
toggleSelected: (value?: boolean) => void;
|
|
25
25
|
getToggleSelectedProps: <TGetter extends Getter<ToggleRowSelectedProps>>(userProps?: TGetter) => undefined | PropGetterValue<ToggleRowSelectedProps, TGetter>;
|
|
26
26
|
};
|
|
27
|
-
export declare type RowSelectionInstance<TGenerics extends
|
|
27
|
+
export declare type RowSelectionInstance<TGenerics extends TableGenerics> = {
|
|
28
28
|
queueResetRowSelection: () => void;
|
|
29
29
|
getToggleRowSelectedProps: <TGetter extends Getter<ToggleRowSelectedProps>>(rowId: string, userProps?: TGetter) => undefined | PropGetterValue<ToggleRowSelectedProps, TGetter>;
|
|
30
30
|
getToggleAllRowsSelectedProps: <TGetter extends Getter<ToggleRowSelectedProps>>(userProps?: TGetter) => undefined | PropGetterValue<ToggleRowSelectedProps, TGetter>;
|
|
@@ -50,10 +50,10 @@ export declare type RowSelectionInstance<TGenerics extends AnyGenerics> = {
|
|
|
50
50
|
};
|
|
51
51
|
export declare const RowSelection: {
|
|
52
52
|
getInitialState: () => RowSelectionTableState;
|
|
53
|
-
getDefaultOptions: <TGenerics extends
|
|
54
|
-
|
|
55
|
-
createRow: <TGenerics_2 extends
|
|
53
|
+
getDefaultOptions: <TGenerics extends TableGenerics>(instance: TableInstance<TGenerics>) => RowSelectionOptions<TGenerics>;
|
|
54
|
+
createInstance: <TGenerics_1 extends TableGenerics>(instance: TableInstance<TGenerics_1>) => RowSelectionInstance<TGenerics_1>;
|
|
55
|
+
createRow: <TGenerics_2 extends TableGenerics>(row: Row<TGenerics_2>, instance: TableInstance<TGenerics_2>) => RowSelectionRow;
|
|
56
56
|
};
|
|
57
|
-
export declare function selectRowsFn<TGenerics extends
|
|
58
|
-
export declare function isRowSelected<TGenerics extends
|
|
57
|
+
export declare function selectRowsFn<TGenerics extends TableGenerics>(instance: TableInstance<TGenerics>, rowModel: RowModel<TGenerics>): RowModel<TGenerics>;
|
|
58
|
+
export declare function isRowSelected<TGenerics extends TableGenerics>(row: Row<TGenerics>, selection: Record<string, boolean>, instance: TableInstance<TGenerics>): boolean | 'some';
|
|
59
59
|
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TableGenerics, TableInstance, Row, Getter, PropGetterValue, RowProps, RowModel, RowValues, PropGetter } from '../types';
|
|
2
|
+
export declare type CoreRow<TGenerics extends TableGenerics> = {
|
|
3
|
+
id: string;
|
|
4
|
+
index: number;
|
|
5
|
+
original?: TGenerics['Row'];
|
|
6
|
+
depth: number;
|
|
7
|
+
values: RowValues;
|
|
8
|
+
subRows: Row<TGenerics>[];
|
|
9
|
+
getLeafRows: () => Row<TGenerics>[];
|
|
10
|
+
getRowProps: PropGetter<RowProps>;
|
|
11
|
+
originalSubRows?: TGenerics['Row'][];
|
|
12
|
+
};
|
|
13
|
+
export declare type RowsOptions<TGenerics extends TableGenerics> = {
|
|
14
|
+
getCoreRowModel: (instance: TableInstance<TGenerics>) => () => RowModel<TGenerics>;
|
|
15
|
+
getSubRows?: (originalRow: TGenerics['Row'], index: number) => TGenerics['Row'][];
|
|
16
|
+
getRowId?: (originalRow: TGenerics['Row'], index: number, parent?: Row<TGenerics>) => string;
|
|
17
|
+
};
|
|
18
|
+
export declare type RowsInstance<TGenerics extends TableGenerics> = {
|
|
19
|
+
getRowId: (_: TGenerics['Row'], index: number, parent?: Row<TGenerics>) => string;
|
|
20
|
+
createRow: (id: string, original: TGenerics['Row'] | undefined, rowIndex: number, depth: number, values: Record<string, any>) => Row<TGenerics>;
|
|
21
|
+
getCoreRowModel: () => RowModel<TGenerics>;
|
|
22
|
+
_getCoreRowModel?: () => RowModel<TGenerics>;
|
|
23
|
+
getRowModel: () => RowModel<TGenerics>;
|
|
24
|
+
getRow: (id: string) => Row<TGenerics>;
|
|
25
|
+
getRowProps: <TGetter extends Getter<RowProps>>(rowId: string, userProps?: TGetter) => undefined | PropGetterValue<RowProps, TGetter>;
|
|
26
|
+
};
|
|
27
|
+
export declare const Rows: {
|
|
28
|
+
createInstance: <TGenerics extends TableGenerics>(instance: TableInstance<TGenerics>) => RowsInstance<TGenerics>;
|
|
29
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RowModel } from '..';
|
|
2
2
|
import { BuiltInSortingFn } from '../sortingFns';
|
|
3
|
-
import { Column, Getter, OnChangeFn,
|
|
3
|
+
import { Column, Getter, OnChangeFn, TableGenerics, PropGetterValue, TableInstance, Row, Updater } from '../types';
|
|
4
4
|
import { Overwrite } from '../utils';
|
|
5
5
|
export declare type SortDirection = 'asc' | 'desc';
|
|
6
6
|
export declare type ColumnSort = {
|
|
@@ -8,15 +8,15 @@ export declare type ColumnSort = {
|
|
|
8
8
|
desc: boolean;
|
|
9
9
|
};
|
|
10
10
|
export declare type SortingState = ColumnSort[];
|
|
11
|
-
export declare type SortingFn<TGenerics extends
|
|
11
|
+
export declare type SortingFn<TGenerics extends TableGenerics> = {
|
|
12
12
|
(rowA: Row<TGenerics>, rowB: Row<TGenerics>, columnId: string): number;
|
|
13
13
|
};
|
|
14
|
-
export declare type CustomSortingFns<TGenerics extends
|
|
14
|
+
export declare type CustomSortingFns<TGenerics extends TableGenerics> = Record<string, SortingFn<TGenerics>>;
|
|
15
15
|
export declare type SortingTableState = {
|
|
16
16
|
sorting: SortingState;
|
|
17
17
|
};
|
|
18
|
-
export declare type SortingFnOption<TGenerics extends
|
|
19
|
-
export declare type SortingColumnDef<TGenerics extends
|
|
18
|
+
export declare type SortingFnOption<TGenerics extends TableGenerics> = 'auto' | BuiltInSortingFn | keyof TGenerics['SortingFns'] | SortingFn<TGenerics>;
|
|
19
|
+
export declare type SortingColumnDef<TGenerics extends TableGenerics> = {
|
|
20
20
|
sortingFn?: SortingFnOption<Overwrite<TGenerics, {
|
|
21
21
|
Value: any;
|
|
22
22
|
}>>;
|
|
@@ -27,7 +27,7 @@ export declare type SortingColumnDef<TGenerics extends AnyGenerics> = {
|
|
|
27
27
|
invertSorting?: boolean;
|
|
28
28
|
sortUndefined?: false | -1 | 1;
|
|
29
29
|
};
|
|
30
|
-
export declare type SortingColumn<TGenerics extends
|
|
30
|
+
export declare type SortingColumn<TGenerics extends TableGenerics> = {
|
|
31
31
|
sortingFn: SortingFnOption<Overwrite<TGenerics, {
|
|
32
32
|
Value: any;
|
|
33
33
|
}>>;
|
|
@@ -39,7 +39,7 @@ export declare type SortingColumn<TGenerics extends AnyGenerics> = {
|
|
|
39
39
|
toggleSorting: (desc?: boolean, isMulti?: boolean) => void;
|
|
40
40
|
getToggleSortingProps: <TGetter extends Getter<ToggleSortingProps>>(userProps?: TGetter) => undefined | PropGetterValue<ToggleSortingProps, TGetter>;
|
|
41
41
|
};
|
|
42
|
-
export declare type SortingOptions<TGenerics extends
|
|
42
|
+
export declare type SortingOptions<TGenerics extends TableGenerics> = {
|
|
43
43
|
sortingFns?: TGenerics['SortingFns'];
|
|
44
44
|
onSortingChange?: OnChangeFn<SortingState>;
|
|
45
45
|
autoResetSorting?: boolean;
|
|
@@ -56,7 +56,7 @@ export declare type ToggleSortingProps = {
|
|
|
56
56
|
title?: string;
|
|
57
57
|
onClick?: (event: unknown) => void;
|
|
58
58
|
};
|
|
59
|
-
export declare type SortingInstance<TGenerics extends
|
|
59
|
+
export declare type SortingInstance<TGenerics extends TableGenerics> = {
|
|
60
60
|
queueResetSorting: () => void;
|
|
61
61
|
getColumnAutoSortingFn: (columnId: string) => SortingFn<TGenerics> | undefined;
|
|
62
62
|
getColumnAutoSortDir: (columnId: string) => SortDirection;
|
|
@@ -74,9 +74,9 @@ export declare type SortingInstance<TGenerics extends AnyGenerics> = {
|
|
|
74
74
|
_getSortedRowModel?: () => RowModel<TGenerics>;
|
|
75
75
|
};
|
|
76
76
|
export declare const Sorting: {
|
|
77
|
-
getDefaultColumn: <TGenerics extends
|
|
77
|
+
getDefaultColumn: <TGenerics extends TableGenerics>() => SortingColumnDef<TGenerics>;
|
|
78
78
|
getInitialState: () => SortingTableState;
|
|
79
|
-
getDefaultOptions: <TGenerics_1 extends
|
|
80
|
-
createColumn: <TGenerics_2 extends
|
|
81
|
-
|
|
79
|
+
getDefaultOptions: <TGenerics_1 extends TableGenerics>(instance: TableInstance<TGenerics_1>) => SortingOptions<TGenerics_1>;
|
|
80
|
+
createColumn: <TGenerics_2 extends TableGenerics>(column: Column<TGenerics_2>, instance: TableInstance<TGenerics_2>) => SortingColumn<TGenerics_2>;
|
|
81
|
+
createInstance: <TGenerics_3 extends TableGenerics>(instance: TableInstance<TGenerics_3>) => SortingInstance<TGenerics_3>;
|
|
82
82
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Cell, Column, Getter, OnChangeFn,
|
|
1
|
+
import { Cell, Column, Getter, OnChangeFn, TableGenerics, PropGetterValue, TableInstance, Updater, Row } from '../types';
|
|
2
2
|
export declare type VisibilityOptions = {
|
|
3
3
|
onColumnVisibilityChange?: OnChangeFn<VisibilityState>;
|
|
4
4
|
enableHiding?: boolean;
|
|
@@ -10,9 +10,12 @@ export declare type VisibilityState = Record<string, boolean>;
|
|
|
10
10
|
export declare type VisibilityTableState = {
|
|
11
11
|
columnVisibility: VisibilityState;
|
|
12
12
|
};
|
|
13
|
-
export declare type VisibilityInstance<TGenerics extends
|
|
13
|
+
export declare type VisibilityInstance<TGenerics extends TableGenerics> = {
|
|
14
14
|
getVisibleFlatColumns: () => Column<TGenerics>[];
|
|
15
15
|
getVisibleLeafColumns: () => Column<TGenerics>[];
|
|
16
|
+
getLeftVisibleLeafColumns: () => Column<TGenerics>[];
|
|
17
|
+
getRightVisibleLeafColumns: () => Column<TGenerics>[];
|
|
18
|
+
getCenterVisibleLeafColumns: () => Column<TGenerics>[];
|
|
16
19
|
setColumnVisibility: (updater: Updater<VisibilityState>) => void;
|
|
17
20
|
toggleColumnVisibility: (columnId: string, value?: boolean) => void;
|
|
18
21
|
toggleAllColumnsVisible: (value?: boolean) => void;
|
|
@@ -29,7 +32,8 @@ export declare type VisibilityColumnDef = {
|
|
|
29
32
|
defaultCanHide?: boolean;
|
|
30
33
|
defaultIsVisible?: boolean;
|
|
31
34
|
};
|
|
32
|
-
export declare type VisibilityRow<TGenerics extends
|
|
35
|
+
export declare type VisibilityRow<TGenerics extends TableGenerics> = {
|
|
36
|
+
_getAllVisibleCells: () => Cell<TGenerics>[];
|
|
33
37
|
getVisibleCells: () => Cell<TGenerics>[];
|
|
34
38
|
};
|
|
35
39
|
export declare type VisibilityColumn = {
|
|
@@ -40,11 +44,12 @@ export declare type VisibilityColumn = {
|
|
|
40
44
|
};
|
|
41
45
|
export declare const Visibility: {
|
|
42
46
|
getInitialState: () => VisibilityTableState;
|
|
43
|
-
getDefaultOptions: <TGenerics extends
|
|
47
|
+
getDefaultOptions: <TGenerics extends TableGenerics>(instance: TableInstance<TGenerics>) => VisibilityDefaultOptions;
|
|
44
48
|
getDefaultColumn: () => {
|
|
45
49
|
defaultIsVisible: boolean;
|
|
46
50
|
};
|
|
47
|
-
createColumn: <TGenerics_1 extends
|
|
48
|
-
|
|
51
|
+
createColumn: <TGenerics_1 extends TableGenerics>(column: Column<TGenerics_1>, instance: TableInstance<TGenerics_1>) => VisibilityColumn;
|
|
52
|
+
createRow: <TGenerics_2 extends TableGenerics>(row: Row<TGenerics_2>, instance: TableInstance<TGenerics_2>) => VisibilityRow<TGenerics_2>;
|
|
53
|
+
createInstance: <TGenerics_3 extends TableGenerics>(instance: TableInstance<TGenerics_3>) => VisibilityInstance<TGenerics_3>;
|
|
49
54
|
};
|
|
50
55
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TableGenerics, Row } from './types';
|
|
2
2
|
export declare const filterFns: {
|
|
3
3
|
includesString: typeof includesString;
|
|
4
4
|
includesStringSensitive: typeof includesStringSensitive;
|
|
@@ -11,39 +11,39 @@ export declare const filterFns: {
|
|
|
11
11
|
betweenNumberRange: typeof betweenNumberRange;
|
|
12
12
|
};
|
|
13
13
|
export declare type BuiltInFilterFn = keyof typeof filterFns;
|
|
14
|
-
declare function includesString<TGenerics extends
|
|
14
|
+
declare function includesString<TGenerics extends TableGenerics>(rows: Row<TGenerics>[], columnIds: string[], filterValue: unknown): Row<TGenerics>[];
|
|
15
15
|
declare namespace includesString {
|
|
16
16
|
var autoRemove: (val: any) => boolean;
|
|
17
17
|
}
|
|
18
|
-
declare function includesStringSensitive<TGenerics extends
|
|
18
|
+
declare function includesStringSensitive<TGenerics extends TableGenerics>(rows: Row<TGenerics>[], columnIds: string[], filterValue: unknown): Row<TGenerics>[];
|
|
19
19
|
declare namespace includesStringSensitive {
|
|
20
20
|
var autoRemove: (val: any) => boolean;
|
|
21
21
|
}
|
|
22
|
-
declare function equalsString<TGenerics extends
|
|
22
|
+
declare function equalsString<TGenerics extends TableGenerics>(rows: Row<TGenerics>[], columnIds: string[], filterValue: unknown): Row<TGenerics>[];
|
|
23
23
|
declare namespace equalsString {
|
|
24
24
|
var autoRemove: (val: any) => boolean;
|
|
25
25
|
}
|
|
26
|
-
declare function equalsStringSensitive<TGenerics extends
|
|
26
|
+
declare function equalsStringSensitive<TGenerics extends TableGenerics>(rows: Row<TGenerics>[], columnIds: string[], filterValue: unknown): Row<TGenerics>[];
|
|
27
27
|
declare namespace equalsStringSensitive {
|
|
28
28
|
var autoRemove: (val: any) => boolean;
|
|
29
29
|
}
|
|
30
|
-
declare function arrIncludes<TGenerics extends
|
|
30
|
+
declare function arrIncludes<TGenerics extends TableGenerics>(rows: Row<TGenerics>[], columnIds: string[], filterValue: unknown): Row<TGenerics>[];
|
|
31
31
|
declare namespace arrIncludes {
|
|
32
32
|
var autoRemove: (val: any) => boolean;
|
|
33
33
|
}
|
|
34
|
-
declare function arrIncludesAll<TGenerics extends
|
|
34
|
+
declare function arrIncludesAll<TGenerics extends TableGenerics>(rows: Row<TGenerics>[], columnIds: string[], filterValue: unknown[]): Row<TGenerics>[];
|
|
35
35
|
declare namespace arrIncludesAll {
|
|
36
36
|
var autoRemove: (val: any) => boolean;
|
|
37
37
|
}
|
|
38
|
-
declare function equals<TGenerics extends
|
|
38
|
+
declare function equals<TGenerics extends TableGenerics>(rows: Row<TGenerics>[], columnIds: string[], filterValue: unknown): Row<TGenerics>[];
|
|
39
39
|
declare namespace equals {
|
|
40
40
|
var autoRemove: (val: any) => boolean;
|
|
41
41
|
}
|
|
42
|
-
declare function weakEquals<TGenerics extends
|
|
42
|
+
declare function weakEquals<TGenerics extends TableGenerics>(rows: Row<TGenerics>[], columnIds: string[], filterValue: unknown): Row<TGenerics>[];
|
|
43
43
|
declare namespace weakEquals {
|
|
44
44
|
var autoRemove: (val: any) => boolean;
|
|
45
45
|
}
|
|
46
|
-
declare function betweenNumberRange<TGenerics extends
|
|
46
|
+
declare function betweenNumberRange<TGenerics extends TableGenerics>(rows: Row<TGenerics>[], columnIds: string[], filterValue: [unknown, unknown]): Row<TGenerics>[];
|
|
47
47
|
declare namespace betweenNumberRange {
|
|
48
48
|
var autoRemove: (val: any) => boolean;
|
|
49
49
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TableGenerics, Row } from './types';
|
|
2
2
|
export declare const reSplitAlphaNumeric: RegExp;
|
|
3
3
|
export declare const sortingFns: {
|
|
4
4
|
alphanumeric: typeof alphanumeric;
|
|
@@ -9,10 +9,10 @@ export declare const sortingFns: {
|
|
|
9
9
|
basic: typeof basic;
|
|
10
10
|
};
|
|
11
11
|
export declare type BuiltInSortingFn = keyof typeof sortingFns;
|
|
12
|
-
declare function alphanumeric<TGenerics extends
|
|
13
|
-
declare function alphanumericCaseSensitive<TGenerics extends
|
|
14
|
-
declare function text<TGenerics extends
|
|
15
|
-
declare function textCaseSensitive<TGenerics extends
|
|
16
|
-
declare function datetime<TGenerics extends
|
|
17
|
-
declare function basic<TGenerics extends
|
|
12
|
+
declare function alphanumeric<TGenerics extends TableGenerics>(rowA: Row<TGenerics>, rowB: Row<TGenerics>, columnId: string): number;
|
|
13
|
+
declare function alphanumericCaseSensitive<TGenerics extends TableGenerics>(rowA: Row<TGenerics>, rowB: Row<TGenerics>, columnId: string): number;
|
|
14
|
+
declare function text<TGenerics extends TableGenerics>(rowA: Row<TGenerics>, rowB: Row<TGenerics>, columnId: string): 0 | 1 | -1;
|
|
15
|
+
declare function textCaseSensitive<TGenerics extends TableGenerics>(rowA: Row<TGenerics>, rowB: Row<TGenerics>, columnId: string): 0 | 1 | -1;
|
|
16
|
+
declare function datetime<TGenerics extends TableGenerics>(rowA: Row<TGenerics>, rowB: Row<TGenerics>, columnId: string): 0 | 1 | -1;
|
|
17
|
+
declare function basic<TGenerics extends TableGenerics>(rowA: Row<TGenerics>, rowB: Row<TGenerics>, columnId: string): 0 | 1 | -1;
|
|
18
18
|
export {};
|
package/build/types/types.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CoreOptions, CoreTableState, TableCore } from './core';
|
|
2
|
+
import { ColumnsOptions, CoreColumn, CoreColumnDef } from './features/Columns';
|
|
2
3
|
import { VisibilityInstance, VisibilityTableState, VisibilityColumn as ColumnVisibilityColumn, VisibilityOptions, VisibilityColumnDef, VisibilityRow } from './features/Visibility';
|
|
3
4
|
import { ColumnOrderInstance, ColumnOrderOptions, ColumnOrderTableState } from './features/Ordering';
|
|
4
|
-
import { ColumnPinningColumn, ColumnPinningColumnDef, ColumnPinningInstance, ColumnPinningOptions, ColumnPinningTableState } from './features/Pinning';
|
|
5
|
-
import { HeadersInstance
|
|
5
|
+
import { ColumnPinningColumn, ColumnPinningColumnDef, ColumnPinningInstance, ColumnPinningOptions, ColumnPinningRow, ColumnPinningTableState } from './features/Pinning';
|
|
6
|
+
import { HeadersInstance } from './features/Headers';
|
|
6
7
|
import { FiltersColumn, FiltersColumnDef, FiltersInstance, FiltersOptions, FiltersTableState } from './features/Filters';
|
|
7
8
|
import { SortingColumn, SortingColumnDef, SortingInstance, SortingOptions, SortingTableState } from './features/Sorting';
|
|
8
9
|
import { GroupingCell, GroupingColumn, GroupingColumnDef, GroupingInstance, GroupingOptions, GroupingRow, GroupingTableState } from './features/Grouping';
|
|
@@ -11,51 +12,51 @@ import { Overwrite } from './utils';
|
|
|
11
12
|
import { ColumnSizingColumn, ColumnSizingColumnDef, ColumnSizingHeader, ColumnSizingInstance, ColumnSizingOptions, ColumnSizingTableState } from './features/ColumnSizing';
|
|
12
13
|
import { PaginationInstance, PaginationOptions, PaginationTableState } from './features/Pagination';
|
|
13
14
|
import { RowSelectionInstance, RowSelectionOptions, RowSelectionRow, RowSelectionTableState } from './features/RowSelection';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
import { ColumnsInstance } from './features/Columns';
|
|
16
|
+
import { CellsInstance, CellsRow } from './features/Cells';
|
|
17
|
+
import { CoreRow, RowsInstance, RowsOptions } from './features/Rows';
|
|
18
|
+
export declare type Updater<T> = T | ((old: T) => T);
|
|
19
|
+
export declare type OnChangeFn<T> = (updaterOrValue: Updater<T>) => void;
|
|
20
|
+
export declare type TableGenerics = {
|
|
21
|
+
Row?: any;
|
|
22
|
+
Value?: any;
|
|
23
|
+
FilterFns?: any;
|
|
24
|
+
SortingFns?: any;
|
|
25
|
+
AggregationFns?: any;
|
|
26
|
+
Render?: any;
|
|
27
|
+
ColumnMeta?: any;
|
|
28
|
+
TableMeta?: any;
|
|
23
29
|
};
|
|
24
30
|
export declare type AnyRender = (Comp: any, props: any) => any;
|
|
25
|
-
export declare type UseRenderer<TGenerics extends
|
|
26
|
-
export declare type PartialGenerics = Partial<DefaultGenerics>;
|
|
27
|
-
export declare type AnyGenerics = {
|
|
28
|
-
[TKey in keyof PartialGenerics]?: any;
|
|
29
|
-
};
|
|
31
|
+
export declare type UseRenderer<TGenerics extends TableGenerics> = TGenerics['Render'] extends (...args: any) => any ? TGenerics['Render'] : any;
|
|
30
32
|
export declare type TableFeature = {
|
|
31
33
|
getDefaultOptions?: (instance: any) => any;
|
|
32
34
|
getInitialState?: () => any;
|
|
33
|
-
|
|
35
|
+
createInstance?: (instance: any) => any;
|
|
34
36
|
getDefaultColumn?: () => any;
|
|
35
37
|
createColumn?: (column: any, instance: any) => any;
|
|
38
|
+
createHeader?: (column: any, instance: any) => any;
|
|
36
39
|
createCell?: (cell: any, column: any, row: any, instance: any) => any;
|
|
37
40
|
createRow?: (row: any, instance: any) => any;
|
|
38
41
|
};
|
|
39
|
-
export declare type TableInstance<TGenerics extends
|
|
40
|
-
export declare type Options<TGenerics extends
|
|
41
|
-
export declare type Updater<T> = T | ((old: T) => T);
|
|
42
|
-
export declare type OnChangeFn<T> = (updaterOrValue: Updater<T>) => void;
|
|
42
|
+
export declare type TableInstance<TGenerics extends TableGenerics> = TableCore<TGenerics> & ColumnsInstance<TGenerics> & RowsInstance<TGenerics> & CellsInstance<TGenerics> & VisibilityInstance<TGenerics> & ColumnOrderInstance<TGenerics> & ColumnPinningInstance<TGenerics> & HeadersInstance<TGenerics> & FiltersInstance<TGenerics> & SortingInstance<TGenerics> & GroupingInstance<TGenerics> & ColumnSizingInstance<TGenerics> & ExpandedInstance<TGenerics> & PaginationInstance<TGenerics> & RowSelectionInstance<TGenerics>;
|
|
43
|
+
export declare type Options<TGenerics extends TableGenerics> = CoreOptions<TGenerics> & ColumnsOptions<TGenerics> & RowsOptions<TGenerics> & VisibilityOptions & ColumnOrderOptions & ColumnPinningOptions & FiltersOptions<TGenerics> & SortingOptions<TGenerics> & GroupingOptions<TGenerics> & ExpandedOptions<TGenerics> & ColumnSizingOptions & PaginationOptions<TGenerics> & RowSelectionOptions<TGenerics>;
|
|
43
44
|
export declare type TableState = CoreTableState & VisibilityTableState & ColumnOrderTableState & ColumnPinningTableState & FiltersTableState & SortingTableState & ExpandedTableState & GroupingTableState & ColumnSizingTableState & PaginationTableState & RowSelectionTableState;
|
|
44
|
-
export declare type Row<TGenerics extends
|
|
45
|
+
export declare type Row<TGenerics extends TableGenerics> = CoreRow<TGenerics> & CellsRow<TGenerics> & VisibilityRow<TGenerics> & ColumnPinningRow<TGenerics> & GroupingRow & RowSelectionRow & ExpandedRow;
|
|
45
46
|
export declare type RowValues = {
|
|
46
47
|
[key: string]: any;
|
|
47
48
|
};
|
|
48
|
-
export declare type RowModel<TGenerics extends
|
|
49
|
+
export declare type RowModel<TGenerics extends TableGenerics> = {
|
|
49
50
|
rows: Row<TGenerics>[];
|
|
50
51
|
flatRows: Row<TGenerics>[];
|
|
51
52
|
rowsById: Record<string, Row<TGenerics>>;
|
|
52
53
|
};
|
|
53
54
|
export declare type AccessorFn<TData> = (originalRow: TData, index: number) => any;
|
|
54
|
-
export declare type Renderable<TGenerics extends
|
|
55
|
-
export declare type ColumnDef<TGenerics extends
|
|
56
|
-
export declare type Column<TGenerics extends
|
|
57
|
-
export declare type Cell<TGenerics extends
|
|
58
|
-
export declare type CoreCell<TGenerics extends
|
|
55
|
+
export declare type Renderable<TGenerics extends TableGenerics, TProps> = string | ((props: TProps) => ReturnType<UseRenderer<TGenerics>>);
|
|
56
|
+
export declare type ColumnDef<TGenerics extends TableGenerics> = CoreColumnDef<TGenerics> & VisibilityColumnDef & ColumnPinningColumnDef & FiltersColumnDef<TGenerics> & SortingColumnDef<TGenerics> & GroupingColumnDef<TGenerics> & ColumnSizingColumnDef;
|
|
57
|
+
export declare type Column<TGenerics extends TableGenerics> = ColumnDef<TGenerics> & CoreColumn<TGenerics> & ColumnVisibilityColumn & ColumnPinningColumn & FiltersColumn<TGenerics> & SortingColumn<TGenerics> & GroupingColumn<TGenerics> & ColumnSizingColumn<TGenerics>;
|
|
58
|
+
export declare type Cell<TGenerics extends TableGenerics> = CoreCell<TGenerics> & GroupingCell<TGenerics>;
|
|
59
|
+
export declare type CoreCell<TGenerics extends TableGenerics> = {
|
|
59
60
|
id: string;
|
|
60
61
|
rowId: string;
|
|
61
62
|
columnId: string;
|
|
@@ -65,12 +66,15 @@ export declare type CoreCell<TGenerics extends AnyGenerics> = {
|
|
|
65
66
|
getCellProps: PropGetter<CellProps>;
|
|
66
67
|
renderCell: () => string | null | ReturnType<UseRenderer<TGenerics>>;
|
|
67
68
|
};
|
|
68
|
-
export declare type Header<TGenerics extends
|
|
69
|
-
export declare type CoreHeader<TGenerics extends
|
|
69
|
+
export declare type Header<TGenerics extends TableGenerics> = CoreHeader<TGenerics> & ColumnSizingHeader<TGenerics>;
|
|
70
|
+
export declare type CoreHeader<TGenerics extends TableGenerics> = {
|
|
70
71
|
id: string;
|
|
72
|
+
index: number;
|
|
71
73
|
depth: number;
|
|
72
74
|
column: Column<TGenerics>;
|
|
73
|
-
|
|
75
|
+
getStart: () => number;
|
|
76
|
+
getSize: () => number;
|
|
77
|
+
headerGroup: HeaderGroup<TGenerics>;
|
|
74
78
|
subHeaders: Header<TGenerics>[];
|
|
75
79
|
colSpan?: number;
|
|
76
80
|
rowSpan?: number;
|
|
@@ -86,7 +90,7 @@ export declare type CoreHeader<TGenerics extends AnyGenerics> = {
|
|
|
86
90
|
renderPlaceholder?: boolean;
|
|
87
91
|
}) => string | null | ReturnType<UseRenderer<TGenerics>>;
|
|
88
92
|
};
|
|
89
|
-
export declare type HeaderGroup<TGenerics extends
|
|
93
|
+
export declare type HeaderGroup<TGenerics extends TableGenerics> = {
|
|
90
94
|
id: string;
|
|
91
95
|
depth: number;
|
|
92
96
|
headers: Header<TGenerics>[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function filterRowModelFromLeafs<TGenerics extends
|
|
3
|
-
export declare function filterRowModelFromRoot<TGenerics extends
|
|
1
|
+
import { TableGenerics, Row, RowModel, TableInstance } from '../types';
|
|
2
|
+
export declare function filterRowModelFromLeafs<TGenerics extends TableGenerics>(rowsToFilter: Row<TGenerics>[], filterRows: (rowsToFilter: Row<TGenerics>[], depth: number) => Row<TGenerics>[], instance: TableInstance<TGenerics>): RowModel<TGenerics>;
|
|
3
|
+
export declare function filterRowModelFromRoot<TGenerics extends TableGenerics>(rowsToFilter: Row<TGenerics>[], filterRows: (rowsToFilter: Row<TGenerics>[], depth: number) => Row<TGenerics>[], instance: TableInstance<TGenerics>): RowModel<TGenerics>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TableInstance, RowModel,
|
|
2
|
-
export declare function getColumnFilteredRowModelAsync<TGenerics extends
|
|
1
|
+
import { TableInstance, RowModel, TableGenerics } from '../types';
|
|
2
|
+
export declare function getColumnFilteredRowModelAsync<TGenerics extends TableGenerics>(opts?: {
|
|
3
3
|
initialSync?: boolean;
|
|
4
4
|
}): (instance: TableInstance<TGenerics>) => () => RowModel<TGenerics>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { TableInstance, RowModel,
|
|
2
|
-
export declare function getColumnFilteredRowModelSync<TGenerics extends
|
|
1
|
+
import { TableInstance, RowModel, TableGenerics } from '../types';
|
|
2
|
+
export declare function getColumnFilteredRowModelSync<TGenerics extends TableGenerics>(): (instance: TableInstance<TGenerics>) => () => RowModel<TGenerics>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TableInstance, RowModel,
|
|
2
|
-
export declare function getCoreRowModelAsync<TGenerics extends
|
|
1
|
+
import { TableInstance, RowModel, TableGenerics } from '../types';
|
|
2
|
+
export declare function getCoreRowModelAsync<TGenerics extends TableGenerics>(opts?: {
|
|
3
3
|
initialSync: boolean;
|
|
4
4
|
}): (instance: TableInstance<TGenerics>) => () => RowModel<TGenerics>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { TableInstance, RowModel,
|
|
2
|
-
export declare function getCoreRowModelSync<TGenerics extends
|
|
1
|
+
import { TableInstance, RowModel, TableGenerics } from '../types';
|
|
2
|
+
export declare function getCoreRowModelSync<TGenerics extends TableGenerics>(): (instance: TableInstance<TGenerics>) => () => RowModel<TGenerics>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TableInstance, Row, RowModel,
|
|
2
|
-
export declare function getExpandedRowModel<TGenerics extends
|
|
3
|
-
export declare function expandRows<TGenerics extends
|
|
1
|
+
import { TableInstance, Row, RowModel, TableGenerics } from '../types';
|
|
2
|
+
export declare function getExpandedRowModel<TGenerics extends TableGenerics>(): (instance: TableInstance<TGenerics>) => () => RowModel<TGenerics>;
|
|
3
|
+
export declare function expandRows<TGenerics extends TableGenerics>(rowModel: RowModel<TGenerics>, instance: TableInstance<TGenerics>): {
|
|
4
4
|
rows: Row<TGenerics>[];
|
|
5
5
|
flatRows: Row<TGenerics>[];
|
|
6
6
|
rowsById: Record<string, Row<TGenerics>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TableInstance, RowModel,
|
|
2
|
-
export declare function getGlobalFilteredRowModelAsync<TGenerics extends
|
|
1
|
+
import { TableInstance, RowModel, TableGenerics } from '../types';
|
|
2
|
+
export declare function getGlobalFilteredRowModelAsync<TGenerics extends TableGenerics>(opts?: {
|
|
3
3
|
initialSync?: boolean;
|
|
4
4
|
}): (instance: TableInstance<TGenerics>) => () => RowModel<TGenerics>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { TableInstance, RowModel,
|
|
2
|
-
export declare function getGlobalFilteredRowModelSync<TGenerics extends
|
|
1
|
+
import { TableInstance, RowModel, TableGenerics } from '../types';
|
|
2
|
+
export declare function getGlobalFilteredRowModelSync<TGenerics extends TableGenerics>(): (instance: TableInstance<TGenerics>) => () => RowModel<TGenerics>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { TableInstance, RowModel,
|
|
2
|
-
export declare function getGroupedRowModelSync<TGenerics extends
|
|
1
|
+
import { TableInstance, RowModel, TableGenerics } from '../types';
|
|
2
|
+
export declare function getGroupedRowModelSync<TGenerics extends TableGenerics>(): (instance: TableInstance<TGenerics>) => () => RowModel<TGenerics>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TableInstance, RowModel,
|
|
2
|
-
export declare function getPaginationRowModel<TGenerics extends
|
|
1
|
+
import { TableInstance, RowModel, TableGenerics } from '../types';
|
|
2
|
+
export declare function getPaginationRowModel<TGenerics extends TableGenerics>(opts?: {
|
|
3
3
|
initialSync: boolean;
|
|
4
4
|
}): (instance: TableInstance<TGenerics>) => () => RowModel<TGenerics>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { TableInstance, Row, RowModel,
|
|
2
|
-
export declare function getSortedRowModelSync<TGenerics extends
|
|
1
|
+
import { TableInstance, Row, RowModel, TableGenerics } from '../types';
|
|
2
|
+
export declare function getSortedRowModelSync<TGenerics extends TableGenerics>(opts?: {
|
|
3
3
|
initialSync?: boolean;
|
|
4
4
|
}): (instance: TableInstance<TGenerics>) => () => RowModel<TGenerics>;
|
|
5
|
-
declare type Sorter<TGenerics extends
|
|
5
|
+
declare type Sorter<TGenerics extends TableGenerics> = {
|
|
6
6
|
id: string;
|
|
7
7
|
compare: (a: Row<TGenerics>, b: Row<TGenerics>) => number;
|
|
8
8
|
desc?: boolean;
|
|
9
9
|
sortUndefined?: false | -1 | 1;
|
|
10
10
|
invertSorting?: boolean;
|
|
11
11
|
};
|
|
12
|
-
export declare function quicksort<TGenerics extends
|
|
12
|
+
export declare function quicksort<TGenerics extends TableGenerics>(rows: Row<TGenerics>[], sorters: Sorter<TGenerics>[]): Row<TGenerics>[];
|
|
13
13
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { TableInstance, RowModel,
|
|
2
|
-
export declare function getSortedRowModelSync<TGenerics extends
|
|
1
|
+
import { TableInstance, RowModel, TableGenerics } from '../types';
|
|
2
|
+
export declare function getSortedRowModelSync<TGenerics extends TableGenerics>(): (instance: TableInstance<TGenerics>) => () => RowModel<TGenerics>;
|
package/build/types/utils.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export declare type Overwrite<T, U extends {
|
|
|
6
6
|
[TKey in keyof T]?: any;
|
|
7
7
|
}> = Omit<T, keyof U> & U;
|
|
8
8
|
export declare type IfDefined<T, N> = 0 extends 1 & T ? N : T extends {} ? T : N;
|
|
9
|
-
export declare type DataUpdateFunction<T> = (input: T) => T;
|
|
10
9
|
export declare function functionalUpdate<T>(updater: Updater<T>, input: T): T;
|
|
11
10
|
export declare function noop(): void;
|
|
12
11
|
export declare function getBatchGroups<T>(arr: T[], count: number): {
|