@tanstack/react-table 8.0.0-alpha.1 → 8.0.0-alpha.4
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 +118 -59
- 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 +317 -0
- package/build/cjs/features/ColumnSizing.js.map +1 -0
- 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 +88 -22
- 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 +1613 -225
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +363 -217
- package/build/types/core.d.ts +14 -25
- package/build/types/createTable.d.ts +21 -3
- package/build/types/features/ColumnSizing.d.ts +67 -0
- 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 +1 -0
- package/build/types/sortTypes.d.ts +5 -4
- package/build/types/types.d.ts +13 -8
- 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 +7 -3
- package/build/umd/index.development.js +1613 -224
- 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 +252 -265
- package/src/createTable.tsx +69 -9
- package/src/features/ColumnSizing.ts +453 -0
- package/src/features/Expanding.ts +27 -11
- package/src/features/Filters.ts +75 -20
- package/src/features/Grouping.ts +27 -12
- package/src/features/Headers.ts +55 -50
- 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 +1 -0
- package/src/sortTypes.ts +1 -1
- package/src/types.ts +55 -9
- 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 +20 -6
- package/src/features/withColumnResizing.oldts +0 -281
- 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;
|
|
@@ -48,6 +49,10 @@ export declare type TableCore<TData, TValue, TFilterFns, TSortingFns, TAggregati
|
|
|
48
49
|
getTableBodyProps: PropGetter<TableBodyProps>;
|
|
49
50
|
getRowProps: <TGetter extends Getter<RowProps>>(rowId: string, userProps?: TGetter) => undefined | PropGetterValue<RowProps, TGetter>;
|
|
50
51
|
getCellProps: <TGetter extends Getter<CellProps>>(rowId: string, columnId: string, userProps?: TGetter) => undefined | PropGetterValue<CellProps, TGetter>;
|
|
52
|
+
getTableWidth: () => number;
|
|
53
|
+
getLeftTableWidth: () => number;
|
|
54
|
+
getCenterTableWidth: () => number;
|
|
55
|
+
getRightTableWidth: () => number;
|
|
51
56
|
};
|
|
52
57
|
export declare type CoreRow<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
53
58
|
id: string;
|
|
@@ -62,46 +67,30 @@ export declare type CoreRow<TData, TValue, TFilterFns, TSortingFns, TAggregation
|
|
|
62
67
|
getAllCells: () => Cell<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[];
|
|
63
68
|
getAllCellsByColumnId: () => Record<string, Cell<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>>;
|
|
64
69
|
};
|
|
65
|
-
export declare type CoreColumnDef<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> =
|
|
66
|
-
accessorFn: AccessorFn<TData>;
|
|
70
|
+
export declare type CoreColumnDef<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
67
71
|
id: string;
|
|
68
|
-
accessorKey?:
|
|
69
|
-
|
|
70
|
-
header: Header<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
71
|
-
column: Column<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
72
|
-
}>;
|
|
73
|
-
} | {
|
|
74
|
-
accessorKey: string & keyof TData;
|
|
75
|
-
id?: string;
|
|
76
|
-
accessorFn?: never;
|
|
77
|
-
header?: string | Renderable<{
|
|
78
|
-
header: Header<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
79
|
-
column: Column<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
80
|
-
}>;
|
|
81
|
-
} | {
|
|
82
|
-
id: string;
|
|
83
|
-
accessorKey?: never;
|
|
84
|
-
accessorFn?: never;
|
|
72
|
+
accessorKey?: string & keyof TData;
|
|
73
|
+
accessorFn?: AccessorFn<TData>;
|
|
85
74
|
header?: string | Renderable<{
|
|
75
|
+
instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
86
76
|
header: Header<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
87
77
|
column: Column<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
88
78
|
}>;
|
|
89
|
-
} | {
|
|
90
|
-
|
|
91
|
-
id?: string;
|
|
92
|
-
accessorKey?: never;
|
|
93
|
-
accessorFn?: never;
|
|
94
|
-
}) & {
|
|
79
|
+
} & // instance: ReactTable< // | Renderable<{ // | string // header?: // accessorKey?: never // id: string // accessorFn: AccessorFn<TData> // | {
|
|
80
|
+
{
|
|
95
81
|
__generated: true;
|
|
96
82
|
width?: number;
|
|
97
83
|
minWidth?: number;
|
|
98
84
|
maxWidth?: number;
|
|
99
85
|
columns?: ColumnDef<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>[];
|
|
100
86
|
footer?: Renderable<{
|
|
87
|
+
instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
101
88
|
header: Header<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
102
89
|
column: Column<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
103
90
|
}>;
|
|
104
91
|
cell?: Renderable<{
|
|
92
|
+
instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
93
|
+
row: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
105
94
|
column: Column<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
106
95
|
cell: Cell<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
107
96
|
value: TValue;
|
|
@@ -1,8 +1,8 @@
|
|
|
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
4
|
declare type TableHelper<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
5
|
-
RowType
|
|
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>;
|
|
8
8
|
AggregationFns: <TTAggregationFns>(aggregationFns: TTAggregationFns) => TableHelper<TData, TValue, TFilterFns, TSortingFns, TTAggregationFns>;
|
|
@@ -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: {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { MouseEvent as ReactMouseEvent, TouchEvent as ReactTouchEvent } from 'react';
|
|
2
|
+
import { Column, Getter, OnChangeFn, PropGetterValue, ReactTable, Updater } from '../types';
|
|
3
|
+
export declare type ColumnSizing = Record<string, number>;
|
|
4
|
+
export declare type ColumnSizingInfoState = {
|
|
5
|
+
startOffset: null | number;
|
|
6
|
+
startSize: null | number;
|
|
7
|
+
deltaOffset: null | number;
|
|
8
|
+
deltaPercentage: null | number;
|
|
9
|
+
isResizingColumn: false | string;
|
|
10
|
+
columnSizingStart: [string, number][];
|
|
11
|
+
};
|
|
12
|
+
export declare type ColumnSizingTableState = {
|
|
13
|
+
columnSizing: ColumnSizing;
|
|
14
|
+
columnSizingInfo: ColumnSizingInfoState;
|
|
15
|
+
};
|
|
16
|
+
export declare type ColumnResizeMode = 'onChange' | 'onEnd';
|
|
17
|
+
export declare type ColumnSizingOptions = {
|
|
18
|
+
enableColumnResizing?: boolean;
|
|
19
|
+
columnResizeMode?: ColumnResizeMode;
|
|
20
|
+
onColumnSizingChange?: OnChangeFn<ColumnSizing>;
|
|
21
|
+
onColumnSizingInfoChange?: OnChangeFn<ColumnSizingInfoState>;
|
|
22
|
+
};
|
|
23
|
+
export declare type ColumnSizingDefaultOptions = {
|
|
24
|
+
columnResizeMode: ColumnResizeMode;
|
|
25
|
+
onColumnSizingChange: OnChangeFn<ColumnSizing>;
|
|
26
|
+
onColumnSizingInfoChange: OnChangeFn<ColumnSizingInfoState>;
|
|
27
|
+
};
|
|
28
|
+
export declare type ColumnResizerProps = {
|
|
29
|
+
title?: string;
|
|
30
|
+
onMouseDown?: (e: ReactMouseEvent) => void;
|
|
31
|
+
onTouchStart?: (e: ReactTouchEvent) => void;
|
|
32
|
+
draggable?: boolean;
|
|
33
|
+
role?: string;
|
|
34
|
+
};
|
|
35
|
+
export declare type ColumnSizingInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
36
|
+
setColumnSizing: (updater: Updater<ColumnSizing>) => void;
|
|
37
|
+
setColumnSizingInfo: (updater: Updater<ColumnSizingInfoState>) => void;
|
|
38
|
+
resetColumnSizing: () => void;
|
|
39
|
+
resetColumnSize: (columnId: string) => void;
|
|
40
|
+
resetHeaderSize: (headerId: string) => void;
|
|
41
|
+
resetHeaderSizeInfo: () => void;
|
|
42
|
+
getColumnCanResize: (columnId: string) => boolean;
|
|
43
|
+
getHeaderCanResize: (headerId: string) => boolean;
|
|
44
|
+
getColumnResizerProps: <TGetter extends Getter<ColumnResizerProps>>(columnId: string, userProps?: TGetter) => undefined | PropGetterValue<ColumnResizerProps, TGetter>;
|
|
45
|
+
getColumnIsResizing: (columnId: string) => boolean;
|
|
46
|
+
getHeaderIsResizing: (headerId: string) => boolean;
|
|
47
|
+
};
|
|
48
|
+
export declare type ColumnSizingColumnDef = {
|
|
49
|
+
enableResizing?: boolean;
|
|
50
|
+
defaultCanResize?: boolean;
|
|
51
|
+
};
|
|
52
|
+
export declare type ColumnSizingColumn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
53
|
+
getCanResize: () => boolean;
|
|
54
|
+
getIsResizing: () => boolean;
|
|
55
|
+
getResizerProps: <TGetter extends Getter<ColumnResizerProps>>(userProps?: TGetter) => undefined | PropGetterValue<ColumnResizerProps, TGetter>;
|
|
56
|
+
resetSize: () => void;
|
|
57
|
+
};
|
|
58
|
+
export declare const defaultColumnSizing: {
|
|
59
|
+
width: number;
|
|
60
|
+
minWidth: number;
|
|
61
|
+
maxWidth: number;
|
|
62
|
+
};
|
|
63
|
+
export declare function getInitialState(): ColumnSizingTableState;
|
|
64
|
+
export declare function getDefaultOptions<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>): ColumnSizingDefaultOptions;
|
|
65
|
+
export declare function getInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(instance: ReactTable<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>): ColumnSizingInstance<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
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>;
|
|
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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Row } from './types';
|
|
2
|
+
export declare const reSplitAlphaNumeric: RegExp;
|
|
2
3
|
export declare const sortTypes: {
|
|
3
4
|
alphanumeric: typeof alphanumeric;
|
|
4
5
|
alphanumericCaseSensitive: typeof alphanumericCaseSensitive;
|
|
@@ -10,8 +11,8 @@ export declare const sortTypes: {
|
|
|
10
11
|
export declare type BuiltInSortType = keyof typeof sortTypes;
|
|
11
12
|
declare function alphanumeric<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(rowA: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, rowB: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, columnId: string): number;
|
|
12
13
|
declare function alphanumericCaseSensitive<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(rowA: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, rowB: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, columnId: string): number;
|
|
13
|
-
declare function text<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(rowA: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, rowB: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, columnId: string):
|
|
14
|
-
declare function textCaseSensitive<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(rowA: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, rowB: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, columnId: string):
|
|
15
|
-
declare function datetime<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(rowA: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, rowB: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, columnId: string):
|
|
16
|
-
declare function basic<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(rowA: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, rowB: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, columnId: string):
|
|
14
|
+
declare function text<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(rowA: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, rowB: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, columnId: string): 1 | 0 | -1;
|
|
15
|
+
declare function textCaseSensitive<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(rowA: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, rowB: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, columnId: string): 1 | 0 | -1;
|
|
16
|
+
declare function datetime<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(rowA: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, rowB: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, columnId: string): 1 | 0 | -1;
|
|
17
|
+
declare function basic<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>(rowA: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, rowB: Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>, columnId: string): 1 | 0 | -1;
|
|
17
18
|
export {};
|
package/build/types/types.d.ts
CHANGED
|
@@ -9,13 +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
|
-
|
|
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>;
|
|
13
16
|
export declare type Renderable<TProps> = React.ReactNode | React.FunctionComponent<TProps> | React.Component<TProps>;
|
|
14
|
-
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>;
|
|
15
|
-
export declare type Updater<T> = T | ((old
|
|
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>;
|
|
18
|
+
export declare type Updater<T> = T | ((old: T) => T);
|
|
16
19
|
export declare type OnChangeFn<T> = (updaterOrValue: Updater<T>, value: T) => void;
|
|
17
|
-
export declare type TableState = VisibilityTableState & ColumnOrderTableState & ColumnPinningTableState & FiltersTableState & SortingTableState & ExpandedTableState & GroupingTableState;
|
|
18
|
-
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;
|
|
19
22
|
export declare type RowValues = {
|
|
20
23
|
[key: string]: any;
|
|
21
24
|
};
|
|
@@ -25,8 +28,8 @@ export declare type RowModel<TData, TValue, TFilterFns, TSortingFns, TAggregatio
|
|
|
25
28
|
rowsById: Record<string, Row<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>>;
|
|
26
29
|
};
|
|
27
30
|
export declare type AccessorFn<TData> = (originalRow: TData, index: number) => any;
|
|
28
|
-
export declare type ColumnDef<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = CoreColumnDef<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & VisibilityColumnDef & ColumnPinningColumnDef & FiltersColumnDef<TFilterFns> & SortingColumnDef<TSortingFns> & GroupingColumnDef<TAggregationFns
|
|
29
|
-
export declare type Column<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = ColumnDef<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & CoreColumn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & ColumnVisibilityColumn & ColumnPinningColumn & FiltersColumn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & SortingColumn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & GroupingColumn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
31
|
+
export declare type ColumnDef<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = CoreColumnDef<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & VisibilityColumnDef & ColumnPinningColumnDef & FiltersColumnDef<TFilterFns> & SortingColumnDef<TSortingFns> & GroupingColumnDef<TAggregationFns> & ColumnSizingColumnDef;
|
|
32
|
+
export declare type Column<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = ColumnDef<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & CoreColumn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & ColumnVisibilityColumn & ColumnPinningColumn & FiltersColumn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & SortingColumn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & GroupingColumn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> & ColumnSizingColumn<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
30
33
|
export declare type Cell<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
31
34
|
id: string;
|
|
32
35
|
rowId: string;
|
|
@@ -37,7 +40,8 @@ export declare type Cell<TData, TValue, TFilterFns, TSortingFns, TAggregationFns
|
|
|
37
40
|
getCellProps: PropGetter<CellProps>;
|
|
38
41
|
renderCell: () => React.ReactNode;
|
|
39
42
|
};
|
|
40
|
-
export declare type Header<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> =
|
|
43
|
+
export declare type Header<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = CoreHeader<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
44
|
+
export declare type CoreHeader<TData, TValue, TFilterFns, TSortingFns, TAggregationFns> = {
|
|
41
45
|
id: string;
|
|
42
46
|
depth: number;
|
|
43
47
|
column: Column<TData, TValue, TFilterFns, TSortingFns, TAggregationFns>;
|
|
@@ -116,6 +120,7 @@ export declare type CellProps = {
|
|
|
116
120
|
key: string;
|
|
117
121
|
role: string;
|
|
118
122
|
};
|
|
123
|
+
export declare type Listener<TArgs extends [...any]> = (...args: [...TArgs]) => void;
|
|
119
124
|
export declare type PropGetter<TBase> = <TGetter extends Getter<TBase>>(userProps?: TGetter) => PropGetterValue<TBase, TGetter>;
|
|
120
125
|
export declare type Getter<TInitial> = ((initial: TInitial) => object) | object | undefined;
|
|
121
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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Getter, NoInfer, PropGetterValue, Renderable } from './types';
|
|
2
|
+
import { Getter, NoInfer, PropGetterValue, Renderable, TableState } from './types';
|
|
3
3
|
export declare type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
4
4
|
export declare type PartialKeys<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
5
5
|
export declare type RequiredKeys<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
|
@@ -8,7 +8,7 @@ export declare type DataUpdateFunction<TInput, TOutput> = (input: TInput) => TOu
|
|
|
8
8
|
export declare type Updater<TInput, TOutput> = TOutput | DataUpdateFunction<TInput, TOutput>;
|
|
9
9
|
export declare function functionalUpdate<TInput, TOutput = TInput>(updater: Updater<TInput, TOutput>, input: TInput): TOutput;
|
|
10
10
|
export declare function noop(): void;
|
|
11
|
-
export declare function makeStateUpdater(key:
|
|
11
|
+
export declare function makeStateUpdater(key: keyof TableState, instance: unknown): (updater: Updater<any, any>) => void;
|
|
12
12
|
export declare const safeUseLayoutEffect: typeof React.useLayoutEffect;
|
|
13
13
|
export declare function useMountedLayoutEffect(fn: any, deps: any[]): void;
|
|
14
14
|
export declare function useGetLatest<T>(obj: T): () => T;
|
|
@@ -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;
|