@tanstack/react-table 8.0.0-alpha.2 → 8.0.0-alpha.5
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 +85 -52
- package/build/cjs/core.js.map +1 -1
- package/build/cjs/createTable.js +11 -6
- package/build/cjs/createTable.js.map +1 -1
- package/build/cjs/features/ColumnSizing.js +2 -16
- package/build/cjs/features/ColumnSizing.js.map +1 -1
- package/build/cjs/features/Expanding.js +23 -2
- package/build/cjs/features/Expanding.js.map +1 -1
- package/build/cjs/features/Filters.js +54 -5
- package/build/cjs/features/Filters.js.map +1 -1
- package/build/cjs/features/Grouping.js +23 -2
- package/build/cjs/features/Grouping.js.map +1 -1
- package/build/cjs/features/Headers.js +87 -24
- package/build/cjs/features/Headers.js.map +1 -1
- package/build/cjs/features/Ordering.js +4 -1
- package/build/cjs/features/Ordering.js.map +1 -1
- package/build/cjs/features/Pagination.js +198 -0
- package/build/cjs/features/Pagination.js.map +1 -0
- package/build/cjs/features/Pinning.js +0 -14
- package/build/cjs/features/Pinning.js.map +1 -1
- package/build/cjs/features/RowSelection.js +541 -0
- package/build/cjs/features/RowSelection.js.map +1 -0
- package/build/cjs/features/Sorting.js +76 -18
- package/build/cjs/features/Sorting.js.map +1 -1
- package/build/cjs/features/Visibility.js +8 -2
- package/build/cjs/features/Visibility.js.map +1 -1
- package/build/cjs/index.js +2 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/sortTypes.js +1 -0
- package/build/cjs/sortTypes.js.map +1 -1
- package/build/cjs/utils/columnFilterRowsFn.js +3 -2
- package/build/cjs/utils/columnFilterRowsFn.js.map +1 -1
- package/build/cjs/utils/expandRowsFn.js +2 -2
- package/build/cjs/utils/expandRowsFn.js.map +1 -1
- package/build/cjs/utils/globalFilterRowsFn.js +3 -2
- package/build/cjs/utils/globalFilterRowsFn.js.map +1 -1
- package/build/cjs/utils/groupRowsFn.js +4 -3
- package/build/cjs/utils/groupRowsFn.js.map +1 -1
- package/build/cjs/utils/paginateRowsFn.js +44 -0
- package/build/cjs/utils/paginateRowsFn.js.map +1 -0
- package/build/cjs/utils/sortRowsFn.js +3 -2
- package/build/cjs/utils/sortRowsFn.js.map +1 -1
- package/build/cjs/utils.js +6 -3
- package/build/cjs/utils.js.map +1 -1
- package/build/esm/index.js +2626 -1571
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +350 -248
- package/build/types/core.d.ts +10 -25
- package/build/types/createTable.d.ts +21 -4
- package/build/types/features/ColumnSizing.d.ts +4 -10
- package/build/types/features/Expanding.d.ts +2 -1
- package/build/types/features/Filters.d.ts +7 -2
- package/build/types/features/Grouping.d.ts +2 -2
- package/build/types/features/Ordering.d.ts +1 -1
- package/build/types/features/Pagination.d.ts +44 -0
- package/build/types/features/Pinning.d.ts +3 -3
- package/build/types/features/RowSelection.d.ts +66 -0
- package/build/types/features/Sorting.d.ts +5 -2
- package/build/types/index.d.ts +2 -1
- package/build/types/sortTypes.d.ts +1 -0
- package/build/types/types.d.ts +9 -6
- package/build/types/utils/columnFilterRowsFn.d.ts +2 -2
- package/build/types/utils/expandRowsFn.d.ts +2 -2
- package/build/types/utils/globalFilterRowsFn.d.ts +2 -2
- package/build/types/utils/groupRowsFn.d.ts +2 -2
- package/build/types/utils/paginateRowsFn.d.ts +2 -0
- package/build/types/utils/sortRowsFn.d.ts +2 -2
- package/build/types/utils.d.ts +5 -1
- package/build/umd/index.development.js +2626 -1570
- 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.tsx +222 -273
- package/src/createTable.tsx +69 -9
- package/src/features/ColumnSizing.ts +8 -37
- package/src/features/Expanding.ts +27 -11
- package/src/features/Filters.ts +74 -19
- package/src/features/Grouping.ts +27 -12
- package/src/features/Headers.ts +26 -58
- package/src/features/Ordering.ts +2 -3
- package/src/features/Pagination.ts +327 -0
- package/src/features/Pinning.ts +3 -16
- package/src/features/RowSelection.ts +831 -0
- package/src/features/Sorting.ts +82 -22
- package/src/features/Visibility.ts +2 -4
- package/src/index.tsx +2 -1
- package/src/sortTypes.ts +1 -1
- package/src/types.ts +25 -8
- package/src/utils/columnFilterRowsFn.ts +5 -12
- package/src/utils/expandRowsFn.ts +2 -5
- package/src/utils/globalFilterRowsFn.ts +3 -10
- package/src/utils/groupRowsFn.ts +3 -5
- package/src/utils/paginateRowsFn.ts +34 -0
- package/src/utils/sortRowsFn.ts +5 -5
- package/src/utils.tsx +12 -4
- package/src/features/withPagination.oldts +0 -208
- package/src/features/withRowSelection.oldts +0 -467
package/build/types/core.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare type CoreOptions<TData, TValue, TFilterFns, TSortingFns, TAggrega
|
|
|
11
11
|
getSubRows?: (originalRow: TData, index: number) => TData[];
|
|
12
12
|
getRowId?: (originalRow: TData, index: number, parent?: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>) => string;
|
|
13
13
|
onStateChange?: (newState: TableState) => void;
|
|
14
|
+
autoResetAll?: boolean;
|
|
14
15
|
};
|
|
15
16
|
export declare type TableCore<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
16
17
|
rerender: () => void;
|
|
@@ -66,46 +67,30 @@ export declare type CoreRow<TData, TValue, TFilterFns, TSortingFns, TAggregation
|
|
|
66
67
|
getAllCells: () => Cell<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[];
|
|
67
68
|
getAllCellsByColumnId: () => Record<string, Cell<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>>;
|
|
68
69
|
};
|
|
69
|
-
export declare type CoreColumnDef<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> =
|
|
70
|
-
accessorFn: AccessorFn<TData>;
|
|
70
|
+
export declare type CoreColumnDef<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
71
71
|
id: string;
|
|
72
|
-
accessorKey?:
|
|
73
|
-
|
|
74
|
-
header: Header<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
75
|
-
column: Column<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
76
|
-
}>;
|
|
77
|
-
} | {
|
|
78
|
-
accessorKey: string & keyof TData;
|
|
79
|
-
id?: string;
|
|
80
|
-
accessorFn?: never;
|
|
81
|
-
header?: string | Renderable<{
|
|
82
|
-
header: Header<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
83
|
-
column: Column<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
84
|
-
}>;
|
|
85
|
-
} | {
|
|
86
|
-
id: string;
|
|
87
|
-
accessorKey?: never;
|
|
88
|
-
accessorFn?: never;
|
|
72
|
+
accessorKey?: string & keyof TData;
|
|
73
|
+
accessorFn?: AccessorFn<TData>;
|
|
89
74
|
header?: string | Renderable<{
|
|
75
|
+
instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
90
76
|
header: Header<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
91
77
|
column: Column<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
92
78
|
}>;
|
|
93
|
-
} | {
|
|
94
|
-
|
|
95
|
-
id?: string;
|
|
96
|
-
accessorKey?: never;
|
|
97
|
-
accessorFn?: never;
|
|
98
|
-
}) & {
|
|
79
|
+
} & // instance: ReactTable< // | Renderable<{ // | string // header?: // accessorKey?: never // id: string // accessorFn: AccessorFn<TData> // | {
|
|
80
|
+
{
|
|
99
81
|
__generated: true;
|
|
100
82
|
width?: number;
|
|
101
83
|
minWidth?: number;
|
|
102
84
|
maxWidth?: number;
|
|
103
85
|
columns?: ColumnDef<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[];
|
|
104
86
|
footer?: Renderable<{
|
|
87
|
+
instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
105
88
|
header: Header<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
106
89
|
column: Column<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
107
90
|
}>;
|
|
108
91
|
cell?: Renderable<{
|
|
92
|
+
instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
93
|
+
row: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
109
94
|
column: Column<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
110
95
|
cell: Cell<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
111
96
|
value: TValue;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Cell, Column, Row } from '.';
|
|
2
|
-
import { ReactTable, ColumnDef, AccessorFn, Options } from './types';
|
|
2
|
+
import { ReactTable, ColumnDef, AccessorFn, Options, Renderable, Header } from './types';
|
|
3
3
|
import { Overwrite } from './utils';
|
|
4
|
-
declare type TableHelper<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
4
|
+
export declare type TableHelper<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
5
5
|
RowType<TTData>(): TableHelper<TTData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
6
6
|
FilterFns: <TTFilterFns>(filterFns: TTFilterFns) => TableHelper<TData, TValue, TTFilterFns, TSortingFns, TAggregationFns>;
|
|
7
7
|
SortingFns: <TTSortingFns>(sortingFns: TTSortingFns) => TableHelper<TData, TValue, TFilterFns, TTSortingFns, TAggregationFns>;
|
|
@@ -11,8 +11,25 @@ declare type TableHelper<TData, TValue, TFilterFns, TSortingFns, TAggregationFns
|
|
|
11
11
|
__generated?: never;
|
|
12
12
|
accessorFn?: never;
|
|
13
13
|
accessorKey?: never;
|
|
14
|
+
header: string;
|
|
15
|
+
id?: string;
|
|
16
|
+
} | {
|
|
17
|
+
__generated?: never;
|
|
18
|
+
accessorFn?: never;
|
|
19
|
+
accessorKey?: never;
|
|
20
|
+
id: string;
|
|
21
|
+
header?: string | Renderable<{
|
|
22
|
+
instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
23
|
+
header: Header<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
24
|
+
column: Column<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
25
|
+
}>;
|
|
26
|
+
}>) => ColumnDef<TData, unknown, TFilterFns, TSortingFns, TAggregationFns>;
|
|
27
|
+
createDisplayColumn: (column: Overwrite<ColumnDef<TData, unknown, TFilterFns, TSortingFns, TAggregationFns>, {
|
|
28
|
+
__generated?: never;
|
|
29
|
+
accessorFn?: never;
|
|
30
|
+
accessorKey?: never;
|
|
14
31
|
}>) => ColumnDef<TData, unknown, TFilterFns, TSortingFns, TAggregationFns>;
|
|
15
|
-
|
|
32
|
+
createDataColumn: <TAccessor extends AccessorFn<TData> | keyof TData>(accessor: TAccessor, column: TAccessor extends (...args: any[]) => any ? Overwrite<ColumnDef<TData, ReturnType<TAccessor>, TFilterFns, TSortingFns, TAggregationFns>, {
|
|
16
33
|
__generated?: never;
|
|
17
34
|
accessorFn?: never;
|
|
18
35
|
accessorKey?: never;
|
|
@@ -21,6 +38,7 @@ declare type TableHelper<TData, TValue, TFilterFns, TSortingFns, TAggregationFns
|
|
|
21
38
|
__generated?: never;
|
|
22
39
|
accessorFn?: never;
|
|
23
40
|
accessorKey?: never;
|
|
41
|
+
id?: string;
|
|
24
42
|
}> : never) => ColumnDef<TData, TAccessor extends (...args: any[]) => any ? ReturnType<TAccessor> : TAccessor extends keyof TData ? TData[TAccessor] : never, TFilterFns, TSortingFns, TAggregationFns>;
|
|
25
43
|
useTable: <TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(options: Options<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>) => ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
26
44
|
types: {
|
|
@@ -32,4 +50,3 @@ declare type TableHelper<TData, TValue, TFilterFns, TSortingFns, TAggregationFns
|
|
|
32
50
|
};
|
|
33
51
|
};
|
|
34
52
|
export declare function createTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(): TableHelper<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
35
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MouseEvent as ReactMouseEvent, TouchEvent as ReactTouchEvent } from 'react';
|
|
2
|
-
import { Column, Getter,
|
|
2
|
+
import { Column, Getter, OnChangeFn, PropGetterValue, ReactTable, Updater } from '../types';
|
|
3
3
|
export declare type ColumnSizing = Record<string, number>;
|
|
4
4
|
export declare type ColumnSizingInfoState = {
|
|
5
5
|
startOffset: null | number;
|
|
@@ -25,7 +25,7 @@ export declare type ColumnSizingDefaultOptions = {
|
|
|
25
25
|
onColumnSizingChange: OnChangeFn<ColumnSizing>;
|
|
26
26
|
onColumnSizingInfoChange: OnChangeFn<ColumnSizingInfoState>;
|
|
27
27
|
};
|
|
28
|
-
export declare type
|
|
28
|
+
export declare type ColumnResizerProps = {
|
|
29
29
|
title?: string;
|
|
30
30
|
onMouseDown?: (e: ReactMouseEvent) => void;
|
|
31
31
|
onTouchStart?: (e: ReactTouchEvent) => void;
|
|
@@ -41,7 +41,7 @@ export declare type ColumnSizingInstance<TData, TValue, TFilterFns, TSortingFns,
|
|
|
41
41
|
resetHeaderSizeInfo: () => void;
|
|
42
42
|
getColumnCanResize: (columnId: string) => boolean;
|
|
43
43
|
getHeaderCanResize: (headerId: string) => boolean;
|
|
44
|
-
|
|
44
|
+
getColumnResizerProps: <TGetter extends Getter<ColumnResizerProps>>(columnId: string, userProps?: TGetter) => undefined | PropGetterValue<ColumnResizerProps, TGetter>;
|
|
45
45
|
getColumnIsResizing: (columnId: string) => boolean;
|
|
46
46
|
getHeaderIsResizing: (headerId: string) => boolean;
|
|
47
47
|
};
|
|
@@ -52,12 +52,7 @@ export declare type ColumnSizingColumnDef = {
|
|
|
52
52
|
export declare type ColumnSizingColumn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
53
53
|
getCanResize: () => boolean;
|
|
54
54
|
getIsResizing: () => boolean;
|
|
55
|
-
|
|
56
|
-
};
|
|
57
|
-
export declare type ColumnSizingHeader<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
58
|
-
getCanResize: () => boolean;
|
|
59
|
-
getIsResizing: () => boolean;
|
|
60
|
-
getResizerProps: <TGetter extends Getter<HeaderResizerProps>>(userProps?: TGetter) => undefined | PropGetterValue<HeaderResizerProps, TGetter>;
|
|
55
|
+
getResizerProps: <TGetter extends Getter<ColumnResizerProps>>(userProps?: TGetter) => undefined | PropGetterValue<ColumnResizerProps, TGetter>;
|
|
61
56
|
resetSize: () => void;
|
|
62
57
|
};
|
|
63
58
|
export declare const defaultColumnSizing: {
|
|
@@ -69,5 +64,4 @@ export declare function getInitialState(): ColumnSizingTableState;
|
|
|
69
64
|
export declare function getDefaultOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>): ColumnSizingDefaultOptions;
|
|
70
65
|
export declare function getInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>): ColumnSizingInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
71
66
|
export declare function createColumn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(column: Column<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>): ColumnSizingColumn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
72
|
-
export declare function createHeader<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(header: Header<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>): ColumnSizingHeader<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
73
67
|
export declare function passiveEventSupported(): boolean;
|
|
@@ -16,7 +16,7 @@ export declare type ExpandedOptions<TData, TValue, TFilterFns, TSortingFns, TAgg
|
|
|
16
16
|
onExpandedChange?: OnChangeFn<ExpandedState>;
|
|
17
17
|
autoResetExpanded?: boolean;
|
|
18
18
|
enableExpanded?: boolean;
|
|
19
|
-
expandRowsFn?: (instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>,
|
|
19
|
+
expandRowsFn?: (instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, rowModel: RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>) => RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
20
20
|
expandSubRows?: boolean;
|
|
21
21
|
defaultCanExpand?: boolean;
|
|
22
22
|
getIsRowExpanded?: (row: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>) => boolean;
|
|
@@ -28,6 +28,7 @@ export declare type ToggleExpandedProps = {
|
|
|
28
28
|
onClick?: (event: MouseEvent | TouchEvent) => void;
|
|
29
29
|
};
|
|
30
30
|
export declare type ExpandedInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
31
|
+
_notifyExpandedReset: () => void;
|
|
31
32
|
setExpanded: (updater: Updater<ExpandedState>) => void;
|
|
32
33
|
toggleRowExpanded: (rowId: string, expanded?: boolean) => void;
|
|
33
34
|
toggleAllRowsExpanded: (expanded?: boolean) => void;
|
|
@@ -45,16 +45,17 @@ export declare type FiltersOptions<TData, TValue, TFilterFns, TSortingFns, TAggr
|
|
|
45
45
|
onColumnFiltersChange?: OnChangeFn<ColumnFiltersState>;
|
|
46
46
|
autoResetColumnFilters?: boolean;
|
|
47
47
|
enableColumnFilters?: boolean;
|
|
48
|
-
columnFilterRowsFn?: (instance: ReactTable<any, any, any, any, any>,
|
|
48
|
+
columnFilterRowsFn?: (instance: ReactTable<any, any, any, any, any>, coreRowModel: RowModel<any, any, any, any, any>) => RowModel<any, any, any, any, any>;
|
|
49
49
|
globalFilterType?: FilterType<TFilterFns>;
|
|
50
50
|
onGlobalFilterChange?: OnChangeFn<any>;
|
|
51
51
|
enableGlobalFilters?: boolean;
|
|
52
52
|
autoResetGlobalFilter?: boolean;
|
|
53
53
|
enableGlobalFilter?: boolean;
|
|
54
|
-
globalFilterRowsFn?: (instance: ReactTable<any, any, any, any, any>,
|
|
54
|
+
globalFilterRowsFn?: (instance: ReactTable<any, any, any, any, any>, rowModel: RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>) => RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
55
55
|
getColumnCanGlobalFilterFn?: (column: Column<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>) => boolean;
|
|
56
56
|
};
|
|
57
57
|
export declare type FiltersInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
58
|
+
_notifyFiltersReset: () => void;
|
|
58
59
|
getColumnAutoFilterFn: (columnId: string) => FilterFn<any, any, any, any, any> | undefined;
|
|
59
60
|
getColumnFilterFn: (columnId: string) => FilterFn<any, any, any, any, any> | undefined;
|
|
60
61
|
setColumnFilters: (updater: Updater<ColumnFiltersState>) => void;
|
|
@@ -66,6 +67,10 @@ export declare type FiltersInstance<TData, TValue, TFilterFns, TSortingFns, TAgg
|
|
|
66
67
|
getColumnFilterValue: (columnId: string) => unknown;
|
|
67
68
|
getColumnFilterIndex: (columnId: string) => number;
|
|
68
69
|
getColumnFilteredRowModel: () => RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
70
|
+
getPreFilteredRowModel: () => RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
71
|
+
getPreFilteredRows: () => Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[];
|
|
72
|
+
getPreFilteredFlatRows: () => Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[];
|
|
73
|
+
getPreFilteredRowsById: () => Record<string, Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>>;
|
|
69
74
|
getPreColumnFilteredRows: () => Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[];
|
|
70
75
|
getPreColumnFilteredFlatRows: () => Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[];
|
|
71
76
|
getPreColumnFilteredRowsById: () => Record<string, Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>>;
|
|
@@ -14,7 +14,6 @@ export declare type GroupingColumnDef<TAggregationFns> = {
|
|
|
14
14
|
renderAggregatedCell?: () => React.ReactNode;
|
|
15
15
|
enableGrouping?: boolean;
|
|
16
16
|
defaultCanGroup?: boolean;
|
|
17
|
-
getCanGroup?: unknown;
|
|
18
17
|
};
|
|
19
18
|
export declare type GroupingColumn<_TData, _TValue, _TFilterFns, _TSortingFns, TAggregationFns> = {
|
|
20
19
|
aggregationType?: AggregationType<TAggregationFns>;
|
|
@@ -45,7 +44,7 @@ export declare type GroupingOptions<TData, TValue, TFilterFns, TSortingFns, TAgg
|
|
|
45
44
|
autoResetGrouping?: boolean;
|
|
46
45
|
enableGrouping?: boolean;
|
|
47
46
|
enableGroupingRemoval?: boolean;
|
|
48
|
-
groupRowsFn?: (instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>,
|
|
47
|
+
groupRowsFn?: (instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, rowModel: RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>) => RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
49
48
|
groupedColumnMode?: false | 'reorder' | 'remove';
|
|
50
49
|
};
|
|
51
50
|
export declare type GroupingColumnMode = false | 'reorder' | 'remove';
|
|
@@ -54,6 +53,7 @@ export declare type ToggleGroupingProps = {
|
|
|
54
53
|
onClick?: (event: MouseEvent | TouchEvent) => void;
|
|
55
54
|
};
|
|
56
55
|
export declare type GroupingInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
56
|
+
_notifyGroupingReset: () => void;
|
|
57
57
|
getColumnAutoAggregationFn: (columnId: string) => AggregationFn | undefined;
|
|
58
58
|
getColumnAggregationFn: (columnId: string) => AggregationFn | undefined;
|
|
59
59
|
setGrouping: (updater: Updater<GroupingState>) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactTable, OnChangeFn, Updater, Column } from '../types';
|
|
2
2
|
export declare type ColumnOrderState = string[];
|
|
3
3
|
export declare type ColumnOrderTableState = {
|
|
4
|
-
columnOrder:
|
|
4
|
+
columnOrder: ColumnOrderState;
|
|
5
5
|
};
|
|
6
6
|
export declare type ColumnOrderOptions = {
|
|
7
7
|
onColumnOrderChange?: OnChangeFn<ColumnOrderState>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { OnChangeFn, ReactTable, Row, RowModel, Updater } from '../types';
|
|
2
|
+
export declare type PageCount = undefined | null | number;
|
|
3
|
+
export declare type PaginationState = {
|
|
4
|
+
pageIndex: number;
|
|
5
|
+
pageSize: number;
|
|
6
|
+
pageCount?: PageCount;
|
|
7
|
+
};
|
|
8
|
+
export declare type PaginationTableState = {
|
|
9
|
+
pagination: PaginationState;
|
|
10
|
+
};
|
|
11
|
+
export declare type PaginationOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
12
|
+
onPaginationChange?: OnChangeFn<PaginationState>;
|
|
13
|
+
autoResetPageIndex?: boolean;
|
|
14
|
+
paginateRowsFn?: (instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, rowModel: RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>) => RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
15
|
+
};
|
|
16
|
+
export declare type PaginationDefaultOptions = {
|
|
17
|
+
onPaginationChange: OnChangeFn<PaginationState>;
|
|
18
|
+
autoResetPageIndex: boolean;
|
|
19
|
+
};
|
|
20
|
+
export declare type PaginationInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
21
|
+
_notifyPageIndexReset: () => void;
|
|
22
|
+
setPagination: (updater: Updater<PaginationState>) => void;
|
|
23
|
+
resetPagination: () => void;
|
|
24
|
+
setPageIndex: (updater: Updater<number>) => void;
|
|
25
|
+
resetPageIndex: () => void;
|
|
26
|
+
setPageSize: (updater: Updater<number>) => void;
|
|
27
|
+
resetPageSize: () => void;
|
|
28
|
+
setPageCount: (updater: Updater<PageCount>) => void;
|
|
29
|
+
getPageOptions: () => number[];
|
|
30
|
+
getCanPreviousPage: () => boolean;
|
|
31
|
+
getCanNextPage: () => boolean;
|
|
32
|
+
previousPage: () => void;
|
|
33
|
+
nextPage: () => void;
|
|
34
|
+
getPaginationRowModel: () => RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
35
|
+
getPrePaginationRows: () => Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[];
|
|
36
|
+
getPrePaginationFlatRows: () => Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[];
|
|
37
|
+
getPrePaginationRowsById: () => Record<string, Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>>;
|
|
38
|
+
getPaginationRows: () => Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[];
|
|
39
|
+
getPaginationFlatRows: () => Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[];
|
|
40
|
+
getPaginationRowsById: () => Record<string, Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>>;
|
|
41
|
+
};
|
|
42
|
+
export declare function getInitialState(): PaginationTableState;
|
|
43
|
+
export declare function getDefaultOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>): PaginationDefaultOptions;
|
|
44
|
+
export declare function getInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>): PaginationInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OnChangeFn, Updater, ReactTable, Column } from '../types';
|
|
2
|
-
declare type ColumnPinningPosition =
|
|
2
|
+
declare type ColumnPinningPosition = false | 'left' | 'right';
|
|
3
3
|
export declare type ColumnPinningState = {
|
|
4
4
|
left?: string[];
|
|
5
5
|
right?: string[];
|
|
@@ -21,7 +21,7 @@ export declare type ColumnPinningColumnDef = {
|
|
|
21
21
|
export declare type ColumnPinningColumn = {
|
|
22
22
|
getCanPin: () => boolean;
|
|
23
23
|
getPinnedIndex: () => number;
|
|
24
|
-
getIsPinned: () =>
|
|
24
|
+
getIsPinned: () => ColumnPinningPosition;
|
|
25
25
|
pin: (position: ColumnPinningPosition) => void;
|
|
26
26
|
};
|
|
27
27
|
export declare type ColumnPinningInstance<_TData, _TValue, _TFilterFns, _TSortingFns, _TAggregationFns> = {
|
|
@@ -29,7 +29,7 @@ export declare type ColumnPinningInstance<_TData, _TValue, _TFilterFns, _TSortin
|
|
|
29
29
|
resetColumnPinning: () => void;
|
|
30
30
|
pinColumn: (columnId: string, position: ColumnPinningPosition) => void;
|
|
31
31
|
getColumnCanPin: (columnId: string) => boolean;
|
|
32
|
-
getColumnIsPinned: (columnId: string) =>
|
|
32
|
+
getColumnIsPinned: (columnId: string) => ColumnPinningPosition;
|
|
33
33
|
getColumnPinnedIndex: (columnId: string) => number;
|
|
34
34
|
};
|
|
35
35
|
export declare function getInitialState(): ColumnPinningTableState;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { MouseEvent, TouchEvent } from 'react';
|
|
2
|
+
import { Getter, OnChangeFn, PropGetterValue, ReactTable, Row, RowModel, Updater } from '../types';
|
|
3
|
+
export declare type RowSelectionState = Record<string, boolean>;
|
|
4
|
+
export declare type RowSelectionTableState = {
|
|
5
|
+
rowSelection: RowSelectionState;
|
|
6
|
+
};
|
|
7
|
+
export declare type RowSelectionOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
8
|
+
onRowSelectionChange?: OnChangeFn<RowSelectionState>;
|
|
9
|
+
autoResetRowSelection?: boolean;
|
|
10
|
+
enableRowSelection?: boolean | ((row: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>) => boolean);
|
|
11
|
+
enableMultiRowSelection?: boolean | ((row: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>) => boolean);
|
|
12
|
+
enableSubRowSelection?: boolean | ((row: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>) => boolean);
|
|
13
|
+
};
|
|
14
|
+
declare type ToggleRowSelectedProps = {
|
|
15
|
+
onChange?: (e: MouseEvent | TouchEvent) => void;
|
|
16
|
+
checked?: boolean;
|
|
17
|
+
title?: string;
|
|
18
|
+
indeterminate?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export declare type RowSelectionRow = {
|
|
21
|
+
getIsSelected: () => boolean;
|
|
22
|
+
getIsSomeSelected: () => boolean;
|
|
23
|
+
getCanSelect: () => boolean;
|
|
24
|
+
getCanMultiSelect: () => boolean;
|
|
25
|
+
toggleSelected: (value?: boolean) => void;
|
|
26
|
+
getToggleSelectedProps: <TGetter extends Getter<ToggleRowSelectedProps>>(userProps?: TGetter) => undefined | PropGetterValue<ToggleRowSelectedProps, TGetter>;
|
|
27
|
+
};
|
|
28
|
+
export declare type RowSelectionInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
29
|
+
_notifyRowSelectionReset: () => void;
|
|
30
|
+
getToggleRowSelectedProps: <TGetter extends Getter<ToggleRowSelectedProps>>(rowId: string, userProps?: TGetter) => undefined | PropGetterValue<ToggleRowSelectedProps, TGetter>;
|
|
31
|
+
getToggleAllRowsSelectedProps: <TGetter extends Getter<ToggleRowSelectedProps>>(userProps?: TGetter) => undefined | PropGetterValue<ToggleRowSelectedProps, TGetter>;
|
|
32
|
+
getToggleAllPageRowsSelectedProps: <TGetter extends Getter<ToggleRowSelectedProps>>(userProps?: TGetter) => undefined | PropGetterValue<ToggleRowSelectedProps, TGetter>;
|
|
33
|
+
setRowSelection: (updater: Updater<RowSelectionState>) => void;
|
|
34
|
+
resetRowSelection: () => void;
|
|
35
|
+
toggleRowSelected: (rowId: string, value?: boolean) => void;
|
|
36
|
+
getRowCanSelect: (rowId: string) => boolean;
|
|
37
|
+
getRowCanSelectSubRows: (rowId: string) => boolean;
|
|
38
|
+
getRowCanMultiSelect: (rowId: string) => boolean;
|
|
39
|
+
getRowIsSelected: (rowId: string) => boolean;
|
|
40
|
+
getRowIsSomeSelected: (rowId: string) => boolean;
|
|
41
|
+
getIsAllRowsSelected: () => boolean;
|
|
42
|
+
getIsAllPageRowsSelected: () => boolean;
|
|
43
|
+
getIsSomeRowsSelected: () => boolean;
|
|
44
|
+
getIsSomePageRowsSelected: () => boolean;
|
|
45
|
+
toggleAllRowsSelected: (value: boolean) => void;
|
|
46
|
+
toggleAllPageRowsSelected: (value: boolean) => void;
|
|
47
|
+
getSelectedRowModel: () => RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
48
|
+
getSelectedRows: () => Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[];
|
|
49
|
+
getSelectedFlatRows: () => Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[];
|
|
50
|
+
getSelectedRowsById: () => Record<string, Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>>;
|
|
51
|
+
getFilteredSelectedRowModel: () => RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
52
|
+
getFilteredSelectedRows: () => Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[];
|
|
53
|
+
getFilteredSelectedFlatRows: () => Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[];
|
|
54
|
+
getFilteredSelectedRowsById: () => Record<string, Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>>;
|
|
55
|
+
getGroupedSelectedRowModel: () => RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
56
|
+
getGroupedSelectedRows: () => Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[];
|
|
57
|
+
getGroupedSelectedFlatRows: () => Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[];
|
|
58
|
+
getGroupedSelectedRowsById: () => Record<string, Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>>;
|
|
59
|
+
};
|
|
60
|
+
export declare function getInitialState(): RowSelectionTableState;
|
|
61
|
+
export declare function getDefaultOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>): RowSelectionOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
62
|
+
export declare function getInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>): RowSelectionInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
63
|
+
export declare function createRow<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(row: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>): RowSelectionRow;
|
|
64
|
+
export declare function selectRowsFn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, rowModel: RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>): RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
65
|
+
export declare function isRowSelected<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(row: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, selection: Record<string, boolean>, instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>): boolean | 'some';
|
|
66
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import { MouseEvent, TouchEvent } from 'react';
|
|
|
2
2
|
import { RowModel } from '..';
|
|
3
3
|
import { BuiltInSortType } from '../sortTypes';
|
|
4
4
|
import { Column, Getter, OnChangeFn, PropGetterValue, ReactTable, Row, Updater } from '../types';
|
|
5
|
+
export declare type SortDirection = 'asc' | 'desc';
|
|
5
6
|
export declare type ColumnSort = {
|
|
6
7
|
id: string;
|
|
7
8
|
desc: boolean;
|
|
@@ -28,7 +29,7 @@ export declare type SortingColumn<_TData, _TValue, TFilterFns, _TSortingFns, _TA
|
|
|
28
29
|
getCanSort: () => boolean;
|
|
29
30
|
getCanMultiSort: () => boolean;
|
|
30
31
|
getSortIndex: () => number;
|
|
31
|
-
getIsSorted: () => false |
|
|
32
|
+
getIsSorted: () => false | SortDirection;
|
|
32
33
|
toggleSorting: (desc?: boolean, isMulti?: boolean) => void;
|
|
33
34
|
getToggleSortingProps: <TGetter extends Getter<ToggleSortingProps>>(userProps?: TGetter) => undefined | PropGetterValue<ToggleSortingProps, TGetter>;
|
|
34
35
|
};
|
|
@@ -41,7 +42,7 @@ export declare type SortingOptions<TData, TValue, TFilterFns, TSortingFns, TAggr
|
|
|
41
42
|
enableMultiRemove?: boolean;
|
|
42
43
|
enableMultiSort?: boolean;
|
|
43
44
|
sortDescFirst?: boolean;
|
|
44
|
-
sortRowsFn?: (instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>,
|
|
45
|
+
sortRowsFn?: (instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, rowModel: RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>) => RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
45
46
|
maxMultiSortColCount?: number;
|
|
46
47
|
isMultiSortEvent?: (e: MouseEvent | TouchEvent) => boolean;
|
|
47
48
|
};
|
|
@@ -50,7 +51,9 @@ export declare type ToggleSortingProps = {
|
|
|
50
51
|
onClick?: (event: MouseEvent | TouchEvent) => void;
|
|
51
52
|
};
|
|
52
53
|
export declare type SortingInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
54
|
+
_notifySortingReset: () => void;
|
|
53
55
|
getColumnAutoSortingFn: (columnId: string) => SortingFn<any, any, any, any, any> | undefined;
|
|
56
|
+
getColumnAutoSortDir: (columnId: string) => SortDirection;
|
|
54
57
|
getColumnSortingFn: (columnId: string) => SortingFn<any, any, any, any, any> | undefined;
|
|
55
58
|
setSorting: (updater: Updater<SortingState>) => void;
|
|
56
59
|
toggleColumnSorting: (columnId: string, desc?: boolean, multi?: boolean) => void;
|
package/build/types/index.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ export * from './utils/globalFilterRowsFn';
|
|
|
4
4
|
export * from './utils/sortRowsFn';
|
|
5
5
|
export * from './utils/groupRowsFn';
|
|
6
6
|
export * from './utils/expandRowsFn';
|
|
7
|
-
export
|
|
7
|
+
export * from './utils/paginateRowsFn';
|
|
8
|
+
export * from './createTable';
|
package/build/types/types.d.ts
CHANGED
|
@@ -9,14 +9,16 @@ import { SortingColumn, SortingColumnDef, SortingInstance, SortingOptions, Sorti
|
|
|
9
9
|
import { GroupingColumn, GroupingColumnDef, GroupingInstance, GroupingOptions, GroupingRow, GroupingTableState } from './features/Grouping';
|
|
10
10
|
import { ExpandedInstance, ExpandedOptions, ExpandedTableState } from './features/Expanding';
|
|
11
11
|
import { Overwrite } from './utils';
|
|
12
|
-
import { ColumnSizingColumn, ColumnSizingColumnDef,
|
|
13
|
-
|
|
12
|
+
import { ColumnSizingColumn, ColumnSizingColumnDef, ColumnSizingInstance, ColumnSizingOptions, ColumnSizingTableState } from './features/ColumnSizing';
|
|
13
|
+
import { PaginationInstance, PaginationOptions, PaginationTableState } from './features/Pagination';
|
|
14
|
+
import { RowSelectionInstance, RowSelectionOptions, RowSelectionRow, RowSelectionTableState } from './features/RowSelection';
|
|
15
|
+
export declare type ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = TableCore<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & VisibilityInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & ColumnOrderInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & ColumnPinningInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & HeadersInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & FiltersInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & SortingInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & GroupingInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & ColumnSizingInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & ExpandedInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & PaginationInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & RowSelectionInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
14
16
|
export declare type Renderable<TProps> = React.ReactNode | React.FunctionComponent<TProps> | React.Component<TProps>;
|
|
15
|
-
export declare type Options<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = CoreOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & VisibilityOptions & ColumnOrderOptions & ColumnPinningOptions & FiltersOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & SortingOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & GroupingOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & ExpandedOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & ColumnSizingOptions
|
|
17
|
+
export declare type Options<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = CoreOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & VisibilityOptions & ColumnOrderOptions & ColumnPinningOptions & FiltersOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & SortingOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & GroupingOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & ExpandedOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & ColumnSizingOptions & PaginationOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & RowSelectionOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
16
18
|
export declare type Updater<T> = T | ((old: T) => T);
|
|
17
19
|
export declare type OnChangeFn<T> = (updaterOrValue: Updater<T>, value: T) => void;
|
|
18
|
-
export declare type TableState = VisibilityTableState & ColumnOrderTableState & ColumnPinningTableState & FiltersTableState & SortingTableState & ExpandedTableState & GroupingTableState & ColumnSizingTableState;
|
|
19
|
-
export declare type Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = CoreRow<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & VisibilityRow<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & HeadersRow<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & GroupingRow;
|
|
20
|
+
export declare type TableState = VisibilityTableState & ColumnOrderTableState & ColumnPinningTableState & FiltersTableState & SortingTableState & ExpandedTableState & GroupingTableState & ColumnSizingTableState & PaginationTableState & RowSelectionTableState;
|
|
21
|
+
export declare type Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = CoreRow<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & VisibilityRow<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & HeadersRow<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & GroupingRow & RowSelectionRow;
|
|
20
22
|
export declare type RowValues = {
|
|
21
23
|
[key: string]: any;
|
|
22
24
|
};
|
|
@@ -38,7 +40,7 @@ export declare type Cell<TData, TValue, TFilterFns, TSortingFns, TAggregationFns
|
|
|
38
40
|
getCellProps: PropGetter<CellProps>;
|
|
39
41
|
renderCell: () => React.ReactNode;
|
|
40
42
|
};
|
|
41
|
-
export declare type Header<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = CoreHeader<TData, TValue, TFilterFns, TSortingFns, TAggregationFns
|
|
43
|
+
export declare type Header<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = CoreHeader<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
42
44
|
export declare type CoreHeader<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
43
45
|
id: string;
|
|
44
46
|
depth: number;
|
|
@@ -118,6 +120,7 @@ export declare type CellProps = {
|
|
|
118
120
|
key: string;
|
|
119
121
|
role: string;
|
|
120
122
|
};
|
|
123
|
+
export declare type Listener<TArgs extends [...any]> = (...args: [...TArgs]) => void;
|
|
121
124
|
export declare type PropGetter<TBase> = <TGetter extends Getter<TBase>>(userProps?: TGetter) => PropGetterValue<TBase, TGetter>;
|
|
122
125
|
export declare type Getter<TInitial> = ((initial: TInitial) => object) | object | undefined;
|
|
123
126
|
export declare type PropGetterValue<TBase, TGetter> = TGetter extends undefined ? TBase : TGetter extends (...args: any[]) => infer TReturn ? Overwrite<TBase, TReturn> : TGetter extends object ? Overwrite<TBase, TGetter> : never;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
1
|
+
import { ReactTable, RowModel } from '../types';
|
|
2
|
+
export declare function columnFilterRowsFn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, rowModel: RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>): RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
1
|
+
import { ReactTable, RowModel } from '../types';
|
|
2
|
+
export declare function expandRowsFn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, sortedRowModel: RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>): RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
1
|
+
import { ReactTable, RowModel } from '../types';
|
|
2
|
+
export declare function globalFilterRowsFn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, rowModel: RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>): RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
1
|
+
import { ReactTable, RowModel } from '../types';
|
|
2
|
+
export declare function groupRowsFn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, sortedRowModel: RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>): RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { ReactTable, RowModel } from '../types';
|
|
2
|
+
export declare function paginateRowsFn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, rowModel: RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>): RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
1
|
+
import { ReactTable, RowModel } from '../types';
|
|
2
|
+
export declare function sortRowsFn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, rowModel: RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>): RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
package/build/types/utils.d.ts
CHANGED
|
@@ -17,7 +17,11 @@ export declare function isFunction<T extends AnyFunction>(d: any): d is T;
|
|
|
17
17
|
export declare function flattenBy<TNode>(arr: TNode[], getChildren: (item: TNode) => TNode[]): TNode[];
|
|
18
18
|
declare type PropGetterImpl = <TBaseProps, TGetter extends Getter<TBaseProps>>(initial: TBaseProps, userProps?: TGetter) => PropGetterValue<TBaseProps, TGetter>;
|
|
19
19
|
export declare const propGetter: PropGetterImpl;
|
|
20
|
-
export declare function memo<TDeps extends readonly any[], TResult>(getDeps: () => [...TDeps], fn: (...args: NoInfer<[...TDeps]>) => TResult,
|
|
20
|
+
export declare function memo<TDeps extends readonly any[], TResult>(getDeps: () => [...TDeps], fn: (...args: NoInfer<[...TDeps]>) => TResult, opts: {
|
|
21
|
+
key: string;
|
|
22
|
+
debug?: boolean;
|
|
23
|
+
onChange?: (result: TResult, previousResult?: TResult) => void;
|
|
24
|
+
}): () => TResult;
|
|
21
25
|
export declare function isPlainObject(o: any): o is Object;
|
|
22
26
|
export declare type Render = typeof flexRender;
|
|
23
27
|
export declare function flexRender<TProps extends {}>(Comp: Renderable<TProps>, props: TProps): React.ReactNode;
|