material-react-table 0.20.0 → 0.22.1
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/README.md +90 -18
- package/dist/MaterialReactTable.d.ts +160 -153
- package/dist/body/MRT_TableBody.d.ts +3 -2
- package/dist/body/MRT_TableBodyCell.d.ts +3 -2
- package/dist/body/MRT_TableBodyRow.d.ts +3 -2
- package/dist/buttons/MRT_GrabHandleButton.d.ts +3 -2
- package/dist/filtersFns.d.ts +22 -22
- package/dist/head/MRT_TableHead.d.ts +4 -2
- package/dist/head/MRT_TableHeadCell.d.ts +4 -6
- package/dist/head/MRT_TableHeadRow.d.ts +4 -2
- package/dist/material-react-table.cjs.development.js +197 -4479
- package/dist/material-react-table.cjs.development.js.map +1 -1
- package/dist/material-react-table.cjs.production.min.js +1 -1
- package/dist/material-react-table.cjs.production.min.js.map +1 -1
- package/dist/material-react-table.esm.js +149 -148
- package/dist/material-react-table.esm.js.map +1 -1
- package/dist/menus/MRT_ShowHideColumnsMenuItems.d.ts +3 -1
- package/dist/sortingFns.d.ts +2 -2
- package/dist/table/MRT_TableRoot.d.ts +1 -1
- package/dist/utils.d.ts +7 -7
- package/package.json +7 -9
- package/src/MaterialReactTable.tsx +191 -176
- package/src/body/MRT_TableBody.tsx +17 -12
- package/src/body/MRT_TableBodyCell.tsx +15 -17
- package/src/body/MRT_TableBodyRow.tsx +10 -3
- package/src/buttons/MRT_GrabHandleButton.tsx +12 -5
- package/src/filtersFns.ts +22 -22
- package/src/head/MRT_TableHead.tsx +11 -3
- package/src/head/MRT_TableHeadCell.tsx +49 -20
- package/src/head/MRT_TableHeadRow.tsx +25 -20
- package/src/menus/MRT_ShowHideColumnsMenu.tsx +6 -1
- package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +54 -27
- package/src/sortingFns.ts +6 -6
- package/src/table/MRT_Table.tsx +17 -4
- package/src/table/MRT_TableContainer.tsx +1 -1
- package/src/table/MRT_TablePaper.tsx +21 -25
- package/src/table/MRT_TableRoot.tsx +9 -10
- package/src/utils.ts +28 -22
- package/dist/head/MRT_DraggableTableHeadCell.d.ts +0 -8
- package/src/head/MRT_DraggableTableHeadCell.tsx +0 -43
|
@@ -1,42 +1,43 @@
|
|
|
1
1
|
import { ChangeEvent, Dispatch, FC, FocusEvent, ReactNode, SetStateAction } from 'react';
|
|
2
2
|
import { AlertProps, ButtonProps, CheckboxProps, IconButtonProps, LinearProgressProps, PaperProps, SkeletonProps, TableBodyProps, TableCellProps, TableContainerProps, TableFooterProps, TableHeadProps, TablePaginationProps, TableProps, TableRowProps, TextFieldProps, ToolbarProps } from '@mui/material';
|
|
3
3
|
import { Cell, Column, ColumnDef, FilterFn, Header, HeaderGroup, OnChangeFn, Row, SortingFn, Table, TableOptions, TableState } from '@tanstack/react-table';
|
|
4
|
+
import { Options as VirtualizerOptions } from 'react-virtual';
|
|
4
5
|
import { MRT_Localization } from './localization';
|
|
5
6
|
import { MRT_Icons } from './icons';
|
|
6
7
|
import { MRT_FilterFns } from './filtersFns';
|
|
7
8
|
import { MRT_SortingFns } from './sortingFns';
|
|
8
9
|
declare type LiteralUnion<T extends U, U = string> = T | (U & Record<never, never>);
|
|
9
|
-
export declare type MRT_TableOptions<
|
|
10
|
-
columns: MRT_ColumnDef<
|
|
11
|
-
data:
|
|
12
|
-
expandRowsFn?: (dataRow:
|
|
13
|
-
initialState?: Partial<MRT_TableState<
|
|
14
|
-
state?: Partial<MRT_TableState<
|
|
10
|
+
export declare type MRT_TableOptions<TData extends Record<string, any> = {}> = Partial<Omit<TableOptions<TData>, 'columns' | 'data' | 'initialState' | 'state' | 'expandRowsFn'>> & {
|
|
11
|
+
columns: MRT_ColumnDef<TData>[];
|
|
12
|
+
data: TData[];
|
|
13
|
+
expandRowsFn?: (dataRow: TData) => TData[];
|
|
14
|
+
initialState?: Partial<MRT_TableState<TData>>;
|
|
15
|
+
state?: Partial<MRT_TableState<TData>>;
|
|
15
16
|
};
|
|
16
|
-
export interface MRT_RowModel<
|
|
17
|
-
flatRows: MRT_Row<
|
|
18
|
-
rows: MRT_Row<
|
|
17
|
+
export interface MRT_RowModel<TData extends Record<string, any> = {}> {
|
|
18
|
+
flatRows: MRT_Row<TData>[];
|
|
19
|
+
rows: MRT_Row<TData>[];
|
|
19
20
|
rowsById: {
|
|
20
|
-
[key: string]: MRT_Row<
|
|
21
|
+
[key: string]: MRT_Row<TData>;
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
|
-
export declare type MRT_TableInstance<
|
|
24
|
-
getAllColumns: () => MRT_Column<
|
|
25
|
-
getAllFlatColumns: () => MRT_Column<
|
|
26
|
-
getAllLeafColumns: () => MRT_Column<
|
|
27
|
-
getCenterLeafColumns: () => MRT_Column<
|
|
28
|
-
getColumn: (columnId: string) => MRT_Column<
|
|
29
|
-
getExpandedRowModel: () => MRT_RowModel<
|
|
30
|
-
getFlatHeaders: () => MRT_Header<
|
|
31
|
-
getLeftLeafColumns: () => MRT_Column<
|
|
32
|
-
getPaginationRowModel: () => MRT_RowModel<
|
|
33
|
-
getPreFilteredRowModel: () => MRT_RowModel<
|
|
34
|
-
getPrePaginationRowModel: () => MRT_RowModel<
|
|
35
|
-
getRightLeafColumns: () => MRT_Column<
|
|
36
|
-
getRowModel: () => MRT_RowModel<
|
|
37
|
-
getSelectedRowModel: () => MRT_RowModel<
|
|
38
|
-
getState: () => MRT_TableState<
|
|
39
|
-
options: MaterialReactTableProps<
|
|
24
|
+
export declare type MRT_TableInstance<TData extends Record<string, any> = {}> = Omit<Table<TData>, 'getAllColumns' | 'getAllFlatColumns' | 'getAllLeafColumns' | 'getCenterLeafColumns' | 'getColumn' | 'getExpandedRowModel' | 'getFlatHeaders' | 'getLeftLeafColumns' | 'getPaginationRowModel' | 'getPreFilteredRowModel' | 'getPrePaginationRowModel' | 'getRightLeafColumns' | 'getRowModel' | 'getSelectedRowModel' | 'getState' | 'options'> & {
|
|
25
|
+
getAllColumns: () => MRT_Column<TData>[];
|
|
26
|
+
getAllFlatColumns: () => MRT_Column<TData>[];
|
|
27
|
+
getAllLeafColumns: () => MRT_Column<TData>[];
|
|
28
|
+
getCenterLeafColumns: () => MRT_Column<TData>[];
|
|
29
|
+
getColumn: (columnId: string) => MRT_Column<TData>;
|
|
30
|
+
getExpandedRowModel: () => MRT_RowModel<TData>;
|
|
31
|
+
getFlatHeaders: () => MRT_Header<TData>[];
|
|
32
|
+
getLeftLeafColumns: () => MRT_Column<TData>[];
|
|
33
|
+
getPaginationRowModel: () => MRT_RowModel<TData>;
|
|
34
|
+
getPreFilteredRowModel: () => MRT_RowModel<TData>;
|
|
35
|
+
getPrePaginationRowModel: () => MRT_RowModel<TData>;
|
|
36
|
+
getRightLeafColumns: () => MRT_Column<TData>[];
|
|
37
|
+
getRowModel: () => MRT_RowModel<TData>;
|
|
38
|
+
getSelectedRowModel: () => MRT_RowModel<TData>;
|
|
39
|
+
getState: () => MRT_TableState<TData>;
|
|
40
|
+
options: MaterialReactTableProps<TData> & {
|
|
40
41
|
icons: MRT_Icons;
|
|
41
42
|
tableId: string;
|
|
42
43
|
localization: MRT_Localization;
|
|
@@ -53,9 +54,9 @@ export declare type MRT_TableInstance<D extends Record<string, any> = {}> = Omit
|
|
|
53
54
|
setShowFilters: Dispatch<SetStateAction<boolean>>;
|
|
54
55
|
setShowGlobalFilter: Dispatch<SetStateAction<boolean>>;
|
|
55
56
|
};
|
|
56
|
-
export declare type MRT_TableState<
|
|
57
|
-
currentEditingCell: MRT_Cell<
|
|
58
|
-
currentEditingRow: MRT_Row<
|
|
57
|
+
export declare type MRT_TableState<TData extends Record<string, any> = {}> = TableState & {
|
|
58
|
+
currentEditingCell: MRT_Cell<TData> | null;
|
|
59
|
+
currentEditingRow: MRT_Row<TData> | null;
|
|
59
60
|
currentFilterFns: Record<string, MRT_FilterOption>;
|
|
60
61
|
currentGlobalFilterFn: Record<string, MRT_FilterOption>;
|
|
61
62
|
density: 'comfortable' | 'compact' | 'spacious';
|
|
@@ -67,30 +68,30 @@ export declare type MRT_TableState<D extends Record<string, any> = {}> = TableSt
|
|
|
67
68
|
showProgressBars: boolean;
|
|
68
69
|
showSkeletons: boolean;
|
|
69
70
|
};
|
|
70
|
-
export declare type MRT_ColumnDef<
|
|
71
|
+
export declare type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit<ColumnDef<TData>, 'accessorFn' | 'accessorKey' | 'aggregatedCell' | 'cell' | 'columns' | 'filterFn' | 'footer' | 'header' | 'id' | 'sortingFn'> & {
|
|
71
72
|
AggregatedCell?: ({ cell, table, }: {
|
|
72
|
-
cell: MRT_Cell<
|
|
73
|
-
table: MRT_TableInstance<
|
|
73
|
+
cell: MRT_Cell<TData>;
|
|
74
|
+
table: MRT_TableInstance<TData>;
|
|
74
75
|
}) => ReactNode;
|
|
75
76
|
Cell?: ({ cell, table, }: {
|
|
76
|
-
cell: MRT_Cell<
|
|
77
|
-
table: MRT_TableInstance<
|
|
77
|
+
cell: MRT_Cell<TData>;
|
|
78
|
+
table: MRT_TableInstance<TData>;
|
|
78
79
|
}) => ReactNode;
|
|
79
80
|
Edit?: ({ cell, table, }: {
|
|
80
|
-
cell: MRT_Cell<
|
|
81
|
-
table: MRT_TableInstance<
|
|
81
|
+
cell: MRT_Cell<TData>;
|
|
82
|
+
table: MRT_TableInstance<TData>;
|
|
82
83
|
}) => ReactNode;
|
|
83
84
|
Filter?: ({ header, table, }: {
|
|
84
|
-
header: MRT_Header<
|
|
85
|
-
table: MRT_TableInstance<
|
|
85
|
+
header: MRT_Header<TData>;
|
|
86
|
+
table: MRT_TableInstance<TData>;
|
|
86
87
|
}) => ReactNode;
|
|
87
88
|
Footer?: ReactNode | (({ footer, table, }: {
|
|
88
|
-
footer: MRT_Header<
|
|
89
|
-
table: MRT_TableInstance<
|
|
89
|
+
footer: MRT_Header<TData>;
|
|
90
|
+
table: MRT_TableInstance<TData>;
|
|
90
91
|
}) => ReactNode);
|
|
91
92
|
Header?: ReactNode | (({ header, table, }: {
|
|
92
|
-
header: MRT_Header<
|
|
93
|
-
table: MRT_TableInstance<
|
|
93
|
+
header: MRT_Header<TData>;
|
|
94
|
+
table: MRT_TableInstance<TData>;
|
|
94
95
|
}) => ReactNode);
|
|
95
96
|
/**
|
|
96
97
|
* Either an `accessorKey` or a combination of an `accessorFn` and `id` are required for a data column definition.
|
|
@@ -98,14 +99,14 @@ export declare type MRT_ColumnDef<D extends Record<string, any> = {}> = Omit<Col
|
|
|
98
99
|
*
|
|
99
100
|
* @example accessorFn: (row) => row.username
|
|
100
101
|
*/
|
|
101
|
-
accessorFn?: (row:
|
|
102
|
+
accessorFn?: (row: TData) => any;
|
|
102
103
|
/**
|
|
103
104
|
* Either an `accessorKey` or a combination of an `accessorFn` and `id` are required for a data column definition.
|
|
104
105
|
* Specify which key in the row this column should use to access the correct data.
|
|
105
106
|
*
|
|
106
107
|
* @example accessorKey: 'username'
|
|
107
108
|
*/
|
|
108
|
-
accessorKey?: LiteralUnion<string & keyof
|
|
109
|
+
accessorKey?: LiteralUnion<string & keyof TData>;
|
|
109
110
|
/**
|
|
110
111
|
* Specify what type of column this is. Either `data`, `display`, or `group`. Defaults to `data`.
|
|
111
112
|
* Leave this blank if you are just creating a normal data column.
|
|
@@ -115,19 +116,25 @@ export declare type MRT_ColumnDef<D extends Record<string, any> = {}> = Omit<Col
|
|
|
115
116
|
* @example columnDefType: 'display'
|
|
116
117
|
*/
|
|
117
118
|
columnDefType?: 'data' | 'display' | 'group';
|
|
118
|
-
columns?: MRT_ColumnDef<
|
|
119
|
+
columns?: MRT_ColumnDef<TData>[];
|
|
119
120
|
enableClickToCopy?: boolean;
|
|
120
121
|
enableColumnActions?: boolean;
|
|
121
122
|
enableColumnFilterChangeMode?: boolean;
|
|
122
123
|
enableColumnOrdering?: boolean;
|
|
123
124
|
enableEditing?: boolean;
|
|
124
125
|
enabledColumnFilterOptions?: MRT_FilterOption[] | null;
|
|
125
|
-
filterFn?: MRT_FilterFn<
|
|
126
|
+
filterFn?: MRT_FilterFn<TData>;
|
|
126
127
|
filterSelectOptions?: (string | {
|
|
127
128
|
text: string;
|
|
128
129
|
value: string;
|
|
129
130
|
})[];
|
|
131
|
+
/**
|
|
132
|
+
* footer must be a string. If you want custom JSX to render the footer, you can also specify a `Footer` option. (Capital F)
|
|
133
|
+
*/
|
|
130
134
|
footer?: string;
|
|
135
|
+
/**
|
|
136
|
+
* header must be a string. If you want custom JSX to render the header, you can also specify a `Header` option. (Capital H)
|
|
137
|
+
*/
|
|
131
138
|
header: string;
|
|
132
139
|
/**
|
|
133
140
|
* Either an `accessorKey` or a combination of an `accessorFn` and `id` are required for a data column definition.
|
|
@@ -138,79 +145,79 @@ export declare type MRT_ColumnDef<D extends Record<string, any> = {}> = Omit<Col
|
|
|
138
145
|
*
|
|
139
146
|
* @default gets set to the same value as `accessorKey` by default
|
|
140
147
|
*/
|
|
141
|
-
id?: LiteralUnion<string & keyof
|
|
148
|
+
id?: LiteralUnion<string & keyof TData>;
|
|
142
149
|
muiTableBodyCellCopyButtonProps?: ButtonProps | (({ table, cell, }: {
|
|
143
|
-
table: MRT_TableInstance<
|
|
144
|
-
cell: MRT_Cell<
|
|
150
|
+
table: MRT_TableInstance<TData>;
|
|
151
|
+
cell: MRT_Cell<TData>;
|
|
145
152
|
}) => ButtonProps);
|
|
146
153
|
muiTableBodyCellEditTextFieldProps?: TextFieldProps | (({ table, cell, }: {
|
|
147
|
-
table: MRT_TableInstance<
|
|
148
|
-
cell: MRT_Cell<
|
|
154
|
+
table: MRT_TableInstance<TData>;
|
|
155
|
+
cell: MRT_Cell<TData>;
|
|
149
156
|
}) => TextFieldProps);
|
|
150
157
|
muiTableBodyCellProps?: TableCellProps | (({ table, cell, }: {
|
|
151
|
-
table: MRT_TableInstance<
|
|
152
|
-
cell: MRT_Cell<
|
|
158
|
+
table: MRT_TableInstance<TData>;
|
|
159
|
+
cell: MRT_Cell<TData>;
|
|
153
160
|
}) => TableCellProps);
|
|
154
161
|
muiTableFooterCellProps?: TableCellProps | (({ table, column, }: {
|
|
155
|
-
table: MRT_TableInstance<
|
|
156
|
-
column: MRT_Column<
|
|
162
|
+
table: MRT_TableInstance<TData>;
|
|
163
|
+
column: MRT_Column<TData>;
|
|
157
164
|
}) => TableCellProps);
|
|
158
165
|
muiTableHeadCellColumnActionsButtonProps?: IconButtonProps | (({ table, column, }: {
|
|
159
|
-
table: MRT_TableInstance<
|
|
160
|
-
column: MRT_Column<
|
|
166
|
+
table: MRT_TableInstance<TData>;
|
|
167
|
+
column: MRT_Column<TData>;
|
|
161
168
|
}) => IconButtonProps);
|
|
162
169
|
muiTableHeadCellFilterTextFieldProps?: TextFieldProps | (({ table, column, }: {
|
|
163
|
-
table: MRT_TableInstance<
|
|
164
|
-
column: MRT_Column<
|
|
170
|
+
table: MRT_TableInstance<TData>;
|
|
171
|
+
column: MRT_Column<TData>;
|
|
165
172
|
}) => TextFieldProps);
|
|
166
173
|
muiTableHeadCellProps?: TableCellProps | (({ table, column, }: {
|
|
167
|
-
table: MRT_TableInstance<
|
|
168
|
-
column: MRT_Column<
|
|
174
|
+
table: MRT_TableInstance<TData>;
|
|
175
|
+
column: MRT_Column<TData>;
|
|
169
176
|
}) => TableCellProps);
|
|
170
177
|
onCellEditBlur?: ({ cell, event, table, }: {
|
|
171
178
|
event: FocusEvent<HTMLInputElement>;
|
|
172
|
-
cell: MRT_Cell<
|
|
173
|
-
table: MRT_TableInstance<
|
|
179
|
+
cell: MRT_Cell<TData>;
|
|
180
|
+
table: MRT_TableInstance<TData>;
|
|
174
181
|
}) => void;
|
|
175
182
|
onCellEditChange?: ({ cell, event, table, }: {
|
|
176
183
|
event: ChangeEvent<HTMLInputElement>;
|
|
177
|
-
cell: MRT_Cell<
|
|
178
|
-
table: MRT_TableInstance<
|
|
184
|
+
cell: MRT_Cell<TData>;
|
|
185
|
+
table: MRT_TableInstance<TData>;
|
|
179
186
|
}) => void;
|
|
180
187
|
sortingFn?: MRT_SortingFn;
|
|
181
188
|
};
|
|
182
|
-
export declare type MRT_DefinedColumnDef<
|
|
189
|
+
export declare type MRT_DefinedColumnDef<TData extends Record<string, any> = {}> = Omit<MRT_ColumnDef<TData>, 'id'> & {
|
|
183
190
|
id: string;
|
|
184
191
|
};
|
|
185
|
-
export declare type MRT_Column<
|
|
186
|
-
columnDef: MRT_DefinedColumnDef<
|
|
187
|
-
columns?: MRT_Column<
|
|
188
|
-
filterFn?: MRT_FilterFn<
|
|
192
|
+
export declare type MRT_Column<TData extends Record<string, any> = {}> = Omit<Column<TData>, 'header' | 'footer' | 'columns' | 'columnDef' | 'filterFn'> & {
|
|
193
|
+
columnDef: MRT_DefinedColumnDef<TData>;
|
|
194
|
+
columns?: MRT_Column<TData>[];
|
|
195
|
+
filterFn?: MRT_FilterFn<TData>;
|
|
189
196
|
footer: string;
|
|
190
197
|
header: string;
|
|
191
198
|
};
|
|
192
|
-
export declare type MRT_Header<
|
|
193
|
-
column: MRT_Column<
|
|
199
|
+
export declare type MRT_Header<TData extends Record<string, any> = {}> = Omit<Header<TData>, 'column'> & {
|
|
200
|
+
column: MRT_Column<TData>;
|
|
194
201
|
};
|
|
195
|
-
export declare type MRT_HeaderGroup<
|
|
196
|
-
headers: MRT_Header<
|
|
202
|
+
export declare type MRT_HeaderGroup<TData extends Record<string, any> = {}> = Omit<HeaderGroup<TData>, 'headers'> & {
|
|
203
|
+
headers: MRT_Header<TData>[];
|
|
197
204
|
};
|
|
198
|
-
export declare type MRT_Row<
|
|
199
|
-
getAllCells: () => MRT_Cell<
|
|
200
|
-
getVisibleCells: () => MRT_Cell<
|
|
201
|
-
subRows?: MRT_Row<
|
|
202
|
-
original:
|
|
203
|
-
_valuesCache?:
|
|
205
|
+
export declare type MRT_Row<TData extends Record<string, any> = {}> = Omit<Row<TData>, 'getVisibleCells' | 'getAllCells' | 'subRows' | 'original' | '_valuesCache'> & {
|
|
206
|
+
getAllCells: () => MRT_Cell<TData>[];
|
|
207
|
+
getVisibleCells: () => MRT_Cell<TData>[];
|
|
208
|
+
subRows?: MRT_Row<TData>[];
|
|
209
|
+
original: TData;
|
|
210
|
+
_valuesCache?: TData;
|
|
204
211
|
};
|
|
205
|
-
export declare type MRT_Cell<
|
|
206
|
-
column: MRT_Column<
|
|
207
|
-
row: MRT_Row<
|
|
212
|
+
export declare type MRT_Cell<TData extends Record<string, any> = {}> = Omit<Cell<TData>, 'column' | 'row'> & {
|
|
213
|
+
column: MRT_Column<TData>;
|
|
214
|
+
row: MRT_Row<TData>;
|
|
208
215
|
};
|
|
209
216
|
export declare type MRT_SortingOption = keyof typeof MRT_SortingFns;
|
|
210
|
-
export declare type MRT_SortingFn<
|
|
217
|
+
export declare type MRT_SortingFn<TData extends Record<string, any> = {}> = SortingFn<TData> | MRT_SortingOption;
|
|
211
218
|
export declare type MRT_FilterOption = keyof typeof MRT_FilterFns;
|
|
212
|
-
export declare type MRT_FilterFn<
|
|
213
|
-
export declare type MaterialReactTableProps<
|
|
219
|
+
export declare type MRT_FilterFn<TData extends Record<string, any> = {}> = FilterFn<TData> | MRT_FilterOption;
|
|
220
|
+
export declare type MaterialReactTableProps<TData extends Record<string, any> = {}> = MRT_TableOptions<TData> & {
|
|
214
221
|
editingMode?: 'table' | 'row' | 'cell';
|
|
215
222
|
enableClickToCopy?: boolean;
|
|
216
223
|
enableColumnActions?: boolean;
|
|
@@ -238,112 +245,112 @@ export declare type MaterialReactTableProps<D extends Record<string, any> = {}>
|
|
|
238
245
|
icons?: Partial<MRT_Icons>;
|
|
239
246
|
localization?: Partial<MRT_Localization>;
|
|
240
247
|
muiExpandAllButtonProps?: IconButtonProps | (({ table }: {
|
|
241
|
-
table: MRT_TableInstance<
|
|
248
|
+
table: MRT_TableInstance<TData>;
|
|
242
249
|
}) => IconButtonProps);
|
|
243
250
|
muiExpandButtonProps?: IconButtonProps | (({ table, }: {
|
|
244
|
-
table: MRT_TableInstance<
|
|
245
|
-
row: MRT_Row<
|
|
251
|
+
table: MRT_TableInstance<TData>;
|
|
252
|
+
row: MRT_Row<TData>;
|
|
246
253
|
}) => IconButtonProps);
|
|
247
|
-
muiLinearProgressProps?: LinearProgressProps | (({ table }: {
|
|
248
|
-
table: MRT_TableInstance<
|
|
254
|
+
muiLinearProgressProps?: LinearProgressProps | (({ table, }: {
|
|
255
|
+
table: MRT_TableInstance<TData>;
|
|
249
256
|
}) => LinearProgressProps);
|
|
250
257
|
muiSearchTextFieldProps?: TextFieldProps | (({ table }: {
|
|
251
|
-
table: MRT_TableInstance<
|
|
258
|
+
table: MRT_TableInstance<TData>;
|
|
252
259
|
}) => TextFieldProps);
|
|
253
260
|
muiSelectAllCheckboxProps?: CheckboxProps | (({ table }: {
|
|
254
|
-
table: MRT_TableInstance<
|
|
261
|
+
table: MRT_TableInstance<TData>;
|
|
255
262
|
}) => CheckboxProps);
|
|
256
263
|
muiSelectCheckboxProps?: CheckboxProps | (({ table, row, }: {
|
|
257
|
-
table: MRT_TableInstance<
|
|
258
|
-
row: MRT_Row<
|
|
264
|
+
table: MRT_TableInstance<TData>;
|
|
265
|
+
row: MRT_Row<TData>;
|
|
259
266
|
}) => CheckboxProps);
|
|
260
267
|
muiTableBodyCellCopyButtonProps?: ButtonProps | (({ table, cell, }: {
|
|
261
|
-
table: MRT_TableInstance<
|
|
262
|
-
cell: MRT_Cell<
|
|
268
|
+
table: MRT_TableInstance<TData>;
|
|
269
|
+
cell: MRT_Cell<TData>;
|
|
263
270
|
}) => ButtonProps);
|
|
264
271
|
muiTableBodyCellEditTextFieldProps?: TextFieldProps | (({ table, cell, }: {
|
|
265
|
-
table: MRT_TableInstance<
|
|
266
|
-
cell: MRT_Cell<
|
|
272
|
+
table: MRT_TableInstance<TData>;
|
|
273
|
+
cell: MRT_Cell<TData>;
|
|
267
274
|
}) => TextFieldProps);
|
|
268
275
|
muiTableBodyCellProps?: TableCellProps | (({ table, cell, }: {
|
|
269
|
-
table: MRT_TableInstance<
|
|
270
|
-
cell: MRT_Cell<
|
|
276
|
+
table: MRT_TableInstance<TData>;
|
|
277
|
+
cell: MRT_Cell<TData>;
|
|
271
278
|
}) => TableCellProps);
|
|
272
279
|
muiTableBodyCellSkeletonProps?: SkeletonProps | (({ table, cell, }: {
|
|
273
|
-
table: MRT_TableInstance<
|
|
274
|
-
cell: MRT_Cell<
|
|
280
|
+
table: MRT_TableInstance<TData>;
|
|
281
|
+
cell: MRT_Cell<TData>;
|
|
275
282
|
}) => SkeletonProps);
|
|
276
283
|
muiTableBodyProps?: TableBodyProps | (({ table }: {
|
|
277
|
-
table: MRT_TableInstance<
|
|
284
|
+
table: MRT_TableInstance<TData>;
|
|
278
285
|
}) => TableBodyProps);
|
|
279
286
|
muiTableBodyRowProps?: TableRowProps | (({ table, row, }: {
|
|
280
|
-
table: MRT_TableInstance<
|
|
281
|
-
row: MRT_Row<
|
|
287
|
+
table: MRT_TableInstance<TData>;
|
|
288
|
+
row: MRT_Row<TData>;
|
|
282
289
|
}) => TableRowProps);
|
|
283
|
-
muiTableContainerProps?: TableContainerProps | (({ table }: {
|
|
284
|
-
table: MRT_TableInstance<
|
|
290
|
+
muiTableContainerProps?: TableContainerProps | (({ table, }: {
|
|
291
|
+
table: MRT_TableInstance<TData>;
|
|
285
292
|
}) => TableContainerProps);
|
|
286
293
|
muiTableDetailPanelProps?: TableCellProps | (({ table, row, }: {
|
|
287
|
-
table: MRT_TableInstance<
|
|
288
|
-
row: MRT_Row<
|
|
294
|
+
table: MRT_TableInstance<TData>;
|
|
295
|
+
row: MRT_Row<TData>;
|
|
289
296
|
}) => TableCellProps);
|
|
290
297
|
muiTableFooterCellProps?: TableCellProps | (({ table, column, }: {
|
|
291
|
-
table: MRT_TableInstance<
|
|
292
|
-
column: MRT_Column<
|
|
298
|
+
table: MRT_TableInstance<TData>;
|
|
299
|
+
column: MRT_Column<TData>;
|
|
293
300
|
}) => TableCellProps);
|
|
294
301
|
muiTableFooterProps?: TableFooterProps | (({ table }: {
|
|
295
|
-
table: MRT_TableInstance<
|
|
302
|
+
table: MRT_TableInstance<TData>;
|
|
296
303
|
}) => TableFooterProps);
|
|
297
304
|
muiTableFooterRowProps?: TableRowProps | (({ table, footerGroup, }: {
|
|
298
|
-
table: MRT_TableInstance<
|
|
299
|
-
footerGroup: MRT_HeaderGroup<
|
|
305
|
+
table: MRT_TableInstance<TData>;
|
|
306
|
+
footerGroup: MRT_HeaderGroup<TData>;
|
|
300
307
|
}) => TableRowProps);
|
|
301
308
|
muiTableHeadCellColumnActionsButtonProps?: IconButtonProps | (({ table, column, }: {
|
|
302
|
-
table: MRT_TableInstance<
|
|
303
|
-
column: MRT_Column<
|
|
309
|
+
table: MRT_TableInstance<TData>;
|
|
310
|
+
column: MRT_Column<TData>;
|
|
304
311
|
}) => IconButtonProps);
|
|
305
312
|
muiTableHeadCellFilterTextFieldProps?: TextFieldProps | (({ table, column, }: {
|
|
306
|
-
table: MRT_TableInstance<
|
|
307
|
-
column: MRT_Column<
|
|
313
|
+
table: MRT_TableInstance<TData>;
|
|
314
|
+
column: MRT_Column<TData>;
|
|
308
315
|
}) => TextFieldProps);
|
|
309
316
|
muiTableHeadCellProps?: TableCellProps | (({ table, column, }: {
|
|
310
|
-
table: MRT_TableInstance<
|
|
311
|
-
column: MRT_Column<
|
|
317
|
+
table: MRT_TableInstance<TData>;
|
|
318
|
+
column: MRT_Column<TData>;
|
|
312
319
|
}) => TableCellProps);
|
|
313
320
|
muiTableHeadProps?: TableHeadProps | (({ table }: {
|
|
314
|
-
table: MRT_TableInstance<
|
|
321
|
+
table: MRT_TableInstance<TData>;
|
|
315
322
|
}) => TableHeadProps);
|
|
316
323
|
muiTableHeadRowProps?: TableRowProps | (({ table, headerGroup, }: {
|
|
317
|
-
table: MRT_TableInstance<
|
|
318
|
-
headerGroup: MRT_HeaderGroup<
|
|
324
|
+
table: MRT_TableInstance<TData>;
|
|
325
|
+
headerGroup: MRT_HeaderGroup<TData>;
|
|
319
326
|
}) => TableRowProps);
|
|
320
327
|
muiTablePaginationProps?: Partial<TablePaginationProps> | (({ table, }: {
|
|
321
|
-
table: MRT_TableInstance<
|
|
328
|
+
table: MRT_TableInstance<TData>;
|
|
322
329
|
}) => Partial<TablePaginationProps>);
|
|
323
330
|
muiTablePaperProps?: PaperProps | (({ table }: {
|
|
324
|
-
table: MRT_TableInstance<
|
|
331
|
+
table: MRT_TableInstance<TData>;
|
|
325
332
|
}) => PaperProps);
|
|
326
333
|
muiTableProps?: TableProps | (({ table }: {
|
|
327
|
-
table: MRT_TableInstance<
|
|
334
|
+
table: MRT_TableInstance<TData>;
|
|
328
335
|
}) => TableProps);
|
|
329
336
|
muiTableToolbarAlertBannerProps?: AlertProps | (({ table }: {
|
|
330
|
-
table: MRT_TableInstance<
|
|
337
|
+
table: MRT_TableInstance<TData>;
|
|
331
338
|
}) => AlertProps);
|
|
332
339
|
muiTableToolbarBottomProps?: ToolbarProps | (({ table }: {
|
|
333
|
-
table: MRT_TableInstance<
|
|
340
|
+
table: MRT_TableInstance<TData>;
|
|
334
341
|
}) => ToolbarProps);
|
|
335
342
|
muiTableToolbarTopProps?: ToolbarProps | (({ table }: {
|
|
336
|
-
table: MRT_TableInstance<
|
|
343
|
+
table: MRT_TableInstance<TData>;
|
|
337
344
|
}) => ToolbarProps);
|
|
338
345
|
onCellEditBlur?: ({ cell, event, table, }: {
|
|
339
346
|
event: FocusEvent<HTMLInputElement>;
|
|
340
|
-
cell: MRT_Cell<
|
|
341
|
-
table: MRT_TableInstance<
|
|
347
|
+
cell: MRT_Cell<TData>;
|
|
348
|
+
table: MRT_TableInstance<TData>;
|
|
342
349
|
}) => void;
|
|
343
350
|
onCellEditChange?: ({ cell, event, table, }: {
|
|
344
351
|
event: ChangeEvent<HTMLInputElement>;
|
|
345
|
-
cell: MRT_Cell<
|
|
346
|
-
table: MRT_TableInstance<
|
|
352
|
+
cell: MRT_Cell<TData>;
|
|
353
|
+
table: MRT_TableInstance<TData>;
|
|
347
354
|
}) => void;
|
|
348
355
|
onCurrentEditingCellChange?: OnChangeFn<MRT_Cell>;
|
|
349
356
|
onCurrentEditingRowChange?: OnChangeFn<MRT_Row>;
|
|
@@ -352,8 +359,8 @@ export declare type MaterialReactTableProps<D extends Record<string, any> = {}>
|
|
|
352
359
|
}>;
|
|
353
360
|
onCurrentGlobalFilterFnChange?: OnChangeFn<MRT_FilterOption>;
|
|
354
361
|
onEditRowSubmit?: ({ row, table, }: {
|
|
355
|
-
row: MRT_Row<
|
|
356
|
-
table: MRT_TableInstance<
|
|
362
|
+
row: MRT_Row<TData>;
|
|
363
|
+
table: MRT_TableInstance<TData>;
|
|
357
364
|
}) => Promise<void> | void;
|
|
358
365
|
onDensityChange?: OnChangeFn<boolean>;
|
|
359
366
|
onIsFullScreenChange?: OnChangeFn<boolean>;
|
|
@@ -365,47 +372,47 @@ export declare type MaterialReactTableProps<D extends Record<string, any> = {}>
|
|
|
365
372
|
positionPagination?: 'bottom' | 'top' | 'both';
|
|
366
373
|
positionToolbarAlertBanner?: 'bottom' | 'top';
|
|
367
374
|
renderDetailPanel?: ({ row, table, }: {
|
|
368
|
-
row: MRT_Row<
|
|
369
|
-
table: MRT_TableInstance<
|
|
375
|
+
row: MRT_Row<TData>;
|
|
376
|
+
table: MRT_TableInstance<TData>;
|
|
370
377
|
}) => ReactNode;
|
|
371
378
|
renderRowActionMenuItems?: ({ closeMenu, row, table, }: {
|
|
372
379
|
closeMenu: () => void;
|
|
373
|
-
row: MRT_Row<
|
|
374
|
-
table: MRT_TableInstance<
|
|
380
|
+
row: MRT_Row<TData>;
|
|
381
|
+
table: MRT_TableInstance<TData>;
|
|
375
382
|
}) => ReactNode[];
|
|
376
383
|
renderRowActions?: ({ row, table, }: {
|
|
377
|
-
row: MRT_Row<
|
|
378
|
-
table: MRT_TableInstance<
|
|
384
|
+
row: MRT_Row<TData>;
|
|
385
|
+
table: MRT_TableInstance<TData>;
|
|
379
386
|
}) => ReactNode;
|
|
380
387
|
renderToolbarBottomCustomActions?: ({ table, }: {
|
|
381
|
-
table: MRT_TableInstance<
|
|
388
|
+
table: MRT_TableInstance<TData>;
|
|
382
389
|
}) => ReactNode;
|
|
383
390
|
renderToolbarTopCustomActions?: ({ table, }: {
|
|
384
|
-
table: MRT_TableInstance<
|
|
391
|
+
table: MRT_TableInstance<TData>;
|
|
385
392
|
}) => ReactNode;
|
|
386
393
|
renderToolbarInternalActions?: ({ table, MRT_ToggleGlobalFilterButton, MRT_ToggleFiltersButton, MRT_ShowHideColumnsButton, MRT_ToggleDensePaddingButton, MRT_FullScreenToggleButton, }: {
|
|
387
|
-
table: MRT_TableInstance<
|
|
394
|
+
table: MRT_TableInstance<TData>;
|
|
388
395
|
MRT_ToggleGlobalFilterButton: FC<IconButtonProps & {
|
|
389
|
-
table: MRT_TableInstance<
|
|
396
|
+
table: MRT_TableInstance<TData>;
|
|
390
397
|
}>;
|
|
391
398
|
MRT_ToggleFiltersButton: FC<IconButtonProps & {
|
|
392
|
-
table: MRT_TableInstance<
|
|
399
|
+
table: MRT_TableInstance<TData>;
|
|
393
400
|
}>;
|
|
394
401
|
MRT_ShowHideColumnsButton: FC<IconButtonProps & {
|
|
395
|
-
table: MRT_TableInstance<
|
|
402
|
+
table: MRT_TableInstance<TData>;
|
|
396
403
|
}>;
|
|
397
404
|
MRT_ToggleDensePaddingButton: FC<IconButtonProps & {
|
|
398
|
-
table: MRT_TableInstance<
|
|
405
|
+
table: MRT_TableInstance<TData>;
|
|
399
406
|
}>;
|
|
400
407
|
MRT_FullScreenToggleButton: FC<IconButtonProps & {
|
|
401
|
-
table: MRT_TableInstance<
|
|
408
|
+
table: MRT_TableInstance<TData>;
|
|
402
409
|
}>;
|
|
403
410
|
}) => ReactNode;
|
|
404
411
|
rowCount?: number;
|
|
405
412
|
rowNumberMode?: 'original' | 'static';
|
|
406
413
|
selectAllMode?: 'all' | 'page';
|
|
407
414
|
tableId?: string;
|
|
408
|
-
virtualizerProps?:
|
|
415
|
+
virtualizerProps?: Partial<VirtualizerOptions<HTMLDivElement>>;
|
|
409
416
|
};
|
|
410
|
-
declare const _default: <
|
|
417
|
+
declare const _default: <TData extends Record<string, any> = {}>({ autoResetExpanded, columnResizeMode, defaultColumn, editingMode, enableColumnActions, enableColumnFilterChangeMode, enableColumnFilters, enableColumnOrdering, enableColumnResizing, enableDensityToggle, enableExpandAll, enableFilters, enableFullScreenToggle, enableGlobalFilter, enableGlobalFilterChangeMode, enableGlobalFilterRankedResults, enableGrouping, enableHiding, enableMultiRowSelection, enableMultiSort, enablePagination, enablePinning, enableRowSelection, enableSelectAll, enableSorting, enableStickyHeader, enableTableFooter, enableTableHead, enableToolbarBottom, enableToolbarInternalActions, enableToolbarTop, icons, localization, positionActionsColumn, positionGlobalFilter, positionPagination, positionToolbarAlertBanner, rowNumberMode, selectAllMode, ...rest }: MaterialReactTableProps<TData>) => JSX.Element;
|
|
411
418
|
export default _default;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { FC, RefObject } from 'react';
|
|
2
|
-
import type { MRT_TableInstance } from '..';
|
|
1
|
+
import { Dispatch, FC, RefObject, SetStateAction } from 'react';
|
|
2
|
+
import type { MRT_Column, MRT_TableInstance } from '..';
|
|
3
3
|
interface Props {
|
|
4
4
|
table: MRT_TableInstance;
|
|
5
|
+
setCurrentHoveredColumn: Dispatch<SetStateAction<MRT_Column | null>>;
|
|
5
6
|
tableContainerRef: RefObject<HTMLDivElement>;
|
|
6
7
|
}
|
|
7
8
|
export declare const MRT_TableBody: FC<Props>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import type { MRT_Cell, MRT_TableInstance } from '..';
|
|
1
|
+
import { Dispatch, FC, SetStateAction } from 'react';
|
|
2
|
+
import type { MRT_Cell, MRT_Column, MRT_TableInstance } from '..';
|
|
3
3
|
interface Props {
|
|
4
4
|
cell: MRT_Cell;
|
|
5
5
|
enableHover?: boolean;
|
|
6
6
|
rowIndex: number;
|
|
7
|
+
setCurrentHoveredColumn: Dispatch<SetStateAction<MRT_Column | null>>;
|
|
7
8
|
table: MRT_TableInstance;
|
|
8
9
|
}
|
|
9
10
|
export declare const MRT_TableBodyCell: FC<Props>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import type { MRT_Row, MRT_TableInstance } from '..';
|
|
1
|
+
import { Dispatch, FC, SetStateAction } from 'react';
|
|
2
|
+
import type { MRT_Column, MRT_Row, MRT_TableInstance } from '..';
|
|
3
3
|
interface Props {
|
|
4
4
|
row: MRT_Row;
|
|
5
5
|
rowIndex: number;
|
|
6
|
+
setCurrentHoveredColumn: Dispatch<SetStateAction<MRT_Column | null>>;
|
|
6
7
|
table: MRT_TableInstance;
|
|
7
8
|
}
|
|
8
9
|
export declare const MRT_TableBodyRow: FC<Props>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DragEventHandler, FC } from 'react';
|
|
2
2
|
import { MRT_TableInstance } from '..';
|
|
3
3
|
interface Props {
|
|
4
|
-
|
|
4
|
+
handleDragStart: DragEventHandler<HTMLButtonElement>;
|
|
5
|
+
handleDragEnd: DragEventHandler<HTMLButtonElement>;
|
|
5
6
|
table: MRT_TableInstance;
|
|
6
7
|
}
|
|
7
8
|
export declare const MRT_GrabHandleButton: FC<Props>;
|