material-react-table 0.18.0 → 0.19.0
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/dist/MaterialReactTable.d.ts +169 -133
- package/dist/body/MRT_TableBody.d.ts +1 -1
- package/dist/body/MRT_TableBodyCell.d.ts +1 -1
- package/dist/body/MRT_TableBodyRow.d.ts +1 -1
- package/dist/body/MRT_TableDetailPanel.d.ts +1 -1
- package/dist/buttons/MRT_ColumnPinningButtons.d.ts +1 -1
- package/dist/buttons/MRT_CopyButton.d.ts +1 -1
- package/dist/buttons/MRT_EditActionButtons.d.ts +1 -1
- package/dist/buttons/MRT_ExpandAllButton.d.ts +1 -1
- package/dist/buttons/MRT_ExpandButton.d.ts +1 -1
- package/dist/buttons/MRT_FullScreenToggleButton.d.ts +1 -1
- package/dist/buttons/MRT_GrabHandleButton.d.ts +1 -1
- package/dist/buttons/MRT_ShowHideColumnsButton.d.ts +1 -1
- package/dist/buttons/MRT_ToggleDensePaddingButton.d.ts +1 -1
- package/dist/buttons/MRT_ToggleFiltersButton.d.ts +1 -1
- package/dist/buttons/MRT_ToggleGlobalFilterButton.d.ts +1 -1
- package/dist/buttons/MRT_ToggleRowActionMenuButton.d.ts +1 -1
- package/dist/filtersFns.d.ts +31 -23
- package/dist/footer/MRT_TableFooter.d.ts +1 -1
- package/dist/footer/MRT_TableFooterCell.d.ts +1 -1
- package/dist/footer/MRT_TableFooterRow.d.ts +1 -1
- package/dist/head/MRT_DraggableTableHeadCell.d.ts +1 -1
- package/dist/head/MRT_TableHead.d.ts +1 -1
- package/dist/head/MRT_TableHeadCell.d.ts +1 -1
- package/dist/head/MRT_TableHeadCellColumnActionsButton.d.ts +1 -1
- package/dist/head/MRT_TableHeadCellFilterContainer.d.ts +1 -1
- package/dist/head/MRT_TableHeadCellFilterLabel.d.ts +1 -1
- package/dist/head/MRT_TableHeadCellResizeHandle.d.ts +1 -1
- package/dist/head/MRT_TableHeadCellSortLabel.d.ts +1 -1
- package/dist/head/MRT_TableHeadRow.d.ts +1 -1
- package/dist/inputs/MRT_EditCellTextField.d.ts +1 -1
- package/dist/inputs/MRT_FilterRangeFields.d.ts +1 -1
- package/dist/inputs/MRT_FilterTextField.d.ts +1 -1
- package/dist/inputs/MRT_GlobalFilterTextField.d.ts +1 -1
- package/dist/inputs/MRT_SelectCheckbox.d.ts +1 -1
- package/dist/material-react-table.cjs.development.js +760 -759
- 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 +762 -761
- package/dist/material-react-table.esm.js.map +1 -1
- package/dist/menus/MRT_ColumnActionMenu.d.ts +1 -1
- package/dist/menus/MRT_FilterOptionMenu.d.ts +1 -1
- package/dist/menus/MRT_RowActionMenu.d.ts +1 -1
- package/dist/menus/MRT_ShowHideColumnsMenu.d.ts +1 -1
- package/dist/menus/MRT_ShowHideColumnsMenuItems.d.ts +1 -1
- package/dist/sortingFns.d.ts +10 -3
- package/dist/table/MRT_Table.d.ts +1 -1
- package/dist/table/MRT_TableContainer.d.ts +1 -1
- package/dist/table/MRT_TablePaper.d.ts +1 -1
- package/dist/toolbar/MRT_LinearProgressBar.d.ts +1 -1
- package/dist/toolbar/MRT_TablePagination.d.ts +1 -1
- package/dist/toolbar/MRT_ToolbarAlertBanner.d.ts +1 -1
- package/dist/toolbar/MRT_ToolbarBottom.d.ts +1 -1
- package/dist/toolbar/MRT_ToolbarInternalButtons.d.ts +1 -1
- package/dist/toolbar/MRT_ToolbarTop.d.ts +1 -1
- package/dist/utils.d.ts +10 -16
- package/package.json +4 -4
- package/src/MaterialReactTable.tsx +167 -156
- package/src/body/MRT_TableBody.tsx +5 -6
- package/src/body/MRT_TableBodyCell.tsx +18 -27
- package/src/body/MRT_TableBodyRow.tsx +7 -7
- package/src/body/MRT_TableDetailPanel.tsx +7 -7
- package/src/buttons/MRT_ColumnPinningButtons.tsx +3 -3
- package/src/buttons/MRT_CopyButton.tsx +5 -7
- package/src/buttons/MRT_EditActionButtons.tsx +4 -5
- package/src/buttons/MRT_ExpandAllButton.tsx +4 -5
- package/src/buttons/MRT_ExpandButton.tsx +4 -5
- package/src/buttons/MRT_FullScreenToggleButton.tsx +3 -7
- package/src/buttons/MRT_GrabHandleButton.tsx +39 -41
- package/src/buttons/MRT_ShowHideColumnsButton.tsx +4 -4
- package/src/buttons/MRT_ToggleDensePaddingButton.tsx +3 -7
- package/src/buttons/MRT_ToggleFiltersButton.tsx +3 -4
- package/src/buttons/MRT_ToggleGlobalFilterButton.tsx +4 -8
- package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +6 -6
- package/src/filtersFns.ts +24 -23
- package/src/footer/MRT_TableFooter.tsx +5 -6
- package/src/footer/MRT_TableFooterCell.tsx +8 -11
- package/src/footer/MRT_TableFooterRow.tsx +5 -9
- package/src/head/MRT_DraggableTableHeadCell.tsx +4 -6
- package/src/head/MRT_TableHead.tsx +5 -5
- package/src/head/MRT_TableHeadCell.tsx +18 -29
- package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +6 -8
- package/src/head/MRT_TableHeadCellFilterContainer.tsx +5 -7
- package/src/head/MRT_TableHeadCellFilterLabel.tsx +13 -19
- package/src/head/MRT_TableHeadCellResizeHandle.tsx +12 -11
- package/src/head/MRT_TableHeadCellSortLabel.tsx +3 -5
- package/src/head/MRT_TableHeadRow.tsx +6 -6
- package/src/inputs/MRT_EditCellTextField.tsx +12 -14
- package/src/inputs/MRT_FilterRangeFields.tsx +4 -4
- package/src/inputs/MRT_FilterTextField.tsx +27 -38
- package/src/inputs/MRT_GlobalFilterTextField.tsx +5 -6
- package/src/inputs/MRT_SelectCheckbox.tsx +9 -12
- package/src/menus/MRT_ColumnActionMenu.tsx +5 -9
- package/src/menus/MRT_FilterOptionMenu.tsx +16 -48
- package/src/menus/MRT_RowActionMenu.tsx +4 -5
- package/src/menus/MRT_ShowHideColumnsMenu.tsx +8 -9
- package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +11 -10
- package/src/sortingFns.ts +11 -3
- package/src/table/MRT_Table.tsx +7 -11
- package/src/table/MRT_TableContainer.tsx +5 -6
- package/src/table/MRT_TablePaper.tsx +7 -8
- package/src/table/MRT_TableRoot.tsx +118 -132
- package/src/toolbar/MRT_LinearProgressBar.tsx +4 -5
- package/src/toolbar/MRT_TablePagination.tsx +7 -9
- package/src/toolbar/MRT_ToolbarAlertBanner.tsx +13 -9
- package/src/toolbar/MRT_ToolbarBottom.tsx +8 -9
- package/src/toolbar/MRT_ToolbarInternalButtons.tsx +10 -10
- package/src/toolbar/MRT_ToolbarTop.tsx +11 -11
- package/src/utils.ts +56 -50
|
@@ -1,10 +1,13 @@
|
|
|
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
|
-
import { Cell, Column, ColumnDef, FilterFn,
|
|
3
|
+
import { Cell, Column, ColumnDef, FilterFn, Header, HeaderGroup, OnChangeFn, Row, SortingFn, Table, TableOptions, TableState } from '@tanstack/react-table';
|
|
4
4
|
import { Options as VirtualizerOptions } from 'react-virtual';
|
|
5
5
|
import { MRT_Localization } from './localization';
|
|
6
6
|
import { MRT_Icons } from './icons';
|
|
7
|
-
|
|
7
|
+
import { MRT_FilterFns } from './filtersFns';
|
|
8
|
+
import { MRT_SortingFns } from './sortingFns';
|
|
9
|
+
declare type LiteralUnion<T extends U, U = string> = T | (U & Record<never, never>);
|
|
10
|
+
export declare type MRT_TableOptions<D extends Record<string, any> = {}> = Partial<Omit<TableOptions<D>, 'columns' | 'data' | 'initialState' | 'state' | 'expandRowsFn'>> & {
|
|
8
11
|
columns: MRT_ColumnDef<D>[];
|
|
9
12
|
data: D[];
|
|
10
13
|
expandRowsFn?: (dataRow: D) => D[];
|
|
@@ -18,9 +21,7 @@ export interface MRT_RowModel<D extends Record<string, any> = {}> {
|
|
|
18
21
|
[key: string]: MRT_Row<D>;
|
|
19
22
|
};
|
|
20
23
|
}
|
|
21
|
-
export declare type MRT_TableInstance<D extends Record<string, any> = {}> = Omit<
|
|
22
|
-
Row: D;
|
|
23
|
-
}>>, 'getAllColumns' | 'getAllFlatColumns' | 'getAllLeafColumns' | 'getCenterLeafColumns' | 'getColumn' | 'getExpandedRowModel' | 'getFlatHeaders' | 'getLeftLeafColumns' | 'getPaginationRowModel' | 'getPreFilteredRowModel' | 'getPrePaginationRowModel' | 'getRightLeafColumns' | 'getRowModel' | 'getSelectedRowModel' | 'getState' | 'options'> & {
|
|
24
|
+
export declare type MRT_TableInstance<D extends Record<string, any> = {}> = Omit<Table<D>, 'getAllColumns' | 'getAllFlatColumns' | 'getAllLeafColumns' | 'getCenterLeafColumns' | 'getColumn' | 'getExpandedRowModel' | 'getFlatHeaders' | 'getLeftLeafColumns' | 'getPaginationRowModel' | 'getPreFilteredRowModel' | 'getPrePaginationRowModel' | 'getRightLeafColumns' | 'getRowModel' | 'getSelectedRowModel' | 'getState' | 'options'> & {
|
|
24
25
|
getAllColumns: () => MRT_Column<D>[];
|
|
25
26
|
getAllFlatColumns: () => MRT_Column<D>[];
|
|
26
27
|
getAllLeafColumns: () => MRT_Column<D>[];
|
|
@@ -44,9 +45,9 @@ export declare type MRT_TableInstance<D extends Record<string, any> = {}> = Omit
|
|
|
44
45
|
setCurrentEditingCell: Dispatch<SetStateAction<MRT_Cell | null>>;
|
|
45
46
|
setCurrentEditingRow: Dispatch<SetStateAction<MRT_Row | null>>;
|
|
46
47
|
setCurrentFilterFns: Dispatch<SetStateAction<{
|
|
47
|
-
[key: string]:
|
|
48
|
+
[key: string]: MRT_FilterOption;
|
|
48
49
|
}>>;
|
|
49
|
-
setCurrentGlobalFilterFn: Dispatch<SetStateAction<
|
|
50
|
+
setCurrentGlobalFilterFn: Dispatch<SetStateAction<MRT_FilterOption>>;
|
|
50
51
|
setDensity: Dispatch<SetStateAction<'comfortable' | 'compact' | 'spacious'>>;
|
|
51
52
|
setIsFullScreen: Dispatch<SetStateAction<boolean>>;
|
|
52
53
|
setShowAlertBanner: Dispatch<SetStateAction<boolean>>;
|
|
@@ -56,8 +57,8 @@ export declare type MRT_TableInstance<D extends Record<string, any> = {}> = Omit
|
|
|
56
57
|
export declare type MRT_TableState<D extends Record<string, any> = {}> = TableState & {
|
|
57
58
|
currentEditingCell: MRT_Cell<D> | null;
|
|
58
59
|
currentEditingRow: MRT_Row<D> | null;
|
|
59
|
-
currentFilterFns: Record<string,
|
|
60
|
-
currentGlobalFilterFn: Record<string,
|
|
60
|
+
currentFilterFns: Record<string, MRT_FilterOption>;
|
|
61
|
+
currentGlobalFilterFn: Record<string, MRT_FilterOption>;
|
|
61
62
|
density: 'comfortable' | 'compact' | 'spacious';
|
|
62
63
|
isLoading: boolean;
|
|
63
64
|
isFullScreen: boolean;
|
|
@@ -67,92 +68,127 @@ 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<D extends Record<string, any> = {}> = Omit<ColumnDef<D>, 'accessorFn' | 'aggregatedCell' | 'cell' | 'columns' | 'filterFn' | 'footer' | 'header' | 'sortingFn'> & {
|
|
71
|
-
AggregatedCell?: ({ cell,
|
|
71
|
+
export declare type MRT_ColumnDef<D extends Record<string, any> = {}> = Omit<ColumnDef<D>, 'accessorFn' | 'accessorKey' | 'aggregatedCell' | 'cell' | 'columns' | 'filterFn' | 'footer' | 'header' | 'id' | 'sortingFn'> & {
|
|
72
|
+
AggregatedCell?: ({ cell, table, }: {
|
|
72
73
|
cell: MRT_Cell<D>;
|
|
73
|
-
|
|
74
|
+
table: MRT_TableInstance<D>;
|
|
74
75
|
}) => ReactNode;
|
|
75
|
-
Cell?: ({ cell,
|
|
76
|
+
Cell?: ({ cell, table, }: {
|
|
76
77
|
cell: MRT_Cell<D>;
|
|
77
|
-
|
|
78
|
+
table: MRT_TableInstance<D>;
|
|
78
79
|
}) => ReactNode;
|
|
79
|
-
Edit?: ({ cell,
|
|
80
|
+
Edit?: ({ cell, table, }: {
|
|
80
81
|
cell: MRT_Cell<D>;
|
|
81
|
-
|
|
82
|
+
table: MRT_TableInstance<D>;
|
|
82
83
|
}) => ReactNode;
|
|
83
|
-
Filter?: ({ header,
|
|
84
|
+
Filter?: ({ header, table, }: {
|
|
84
85
|
header: MRT_Header<D>;
|
|
85
|
-
|
|
86
|
+
table: MRT_TableInstance<D>;
|
|
86
87
|
}) => ReactNode;
|
|
87
|
-
Footer?: ReactNode | (({ footer,
|
|
88
|
+
Footer?: ReactNode | (({ footer, table, }: {
|
|
88
89
|
footer: MRT_Header<D>;
|
|
89
|
-
|
|
90
|
+
table: MRT_TableInstance<D>;
|
|
90
91
|
}) => ReactNode);
|
|
91
|
-
Header?: ReactNode | (({ header,
|
|
92
|
+
Header?: ReactNode | (({ header, table, }: {
|
|
92
93
|
header: MRT_Header<D>;
|
|
93
|
-
|
|
94
|
+
table: MRT_TableInstance<D>;
|
|
94
95
|
}) => ReactNode);
|
|
96
|
+
/**
|
|
97
|
+
* Either an `accessorKey` or a combination of an `accessorFn` and `id` are required for a data column definition.
|
|
98
|
+
* Specify a function here to point to the correct property in the data object.
|
|
99
|
+
*
|
|
100
|
+
* @example accessorFn: (row) => row.username
|
|
101
|
+
*/
|
|
95
102
|
accessorFn?: (row: D) => any;
|
|
103
|
+
/**
|
|
104
|
+
* Either an `accessorKey` or a combination of an `accessorFn` and `id` are required for a data column definition.
|
|
105
|
+
* Specify which key in the row this column should use to access the correct data.
|
|
106
|
+
*
|
|
107
|
+
* @example accessorKey: 'username'
|
|
108
|
+
*/
|
|
109
|
+
accessorKey?: LiteralUnion<string & keyof D>;
|
|
110
|
+
/**
|
|
111
|
+
* Specify what type of column this is. Either `data`, `display`, or `group`. Defaults to `data`.
|
|
112
|
+
* Leave this blank if you are just creating a normal data column.
|
|
113
|
+
*
|
|
114
|
+
* @default 'data'
|
|
115
|
+
*
|
|
116
|
+
* @example columnDefType: 'display'
|
|
117
|
+
*/
|
|
118
|
+
columnDefType?: 'data' | 'display' | 'group';
|
|
96
119
|
columns?: MRT_ColumnDef<D>[];
|
|
97
120
|
enableClickToCopy?: boolean;
|
|
98
121
|
enableColumnActions?: boolean;
|
|
99
122
|
enableColumnFilterChangeMode?: boolean;
|
|
100
123
|
enableColumnOrdering?: boolean;
|
|
101
124
|
enableEditing?: boolean;
|
|
102
|
-
enabledColumnFilterOptions?:
|
|
103
|
-
filterFn?: MRT_FilterFn
|
|
125
|
+
enabledColumnFilterOptions?: MRT_FilterOption[] | null;
|
|
126
|
+
filterFn?: MRT_FilterFn<D>;
|
|
104
127
|
filterSelectOptions?: (string | {
|
|
105
128
|
text: string;
|
|
106
129
|
value: string;
|
|
107
130
|
})[];
|
|
108
131
|
footer?: string;
|
|
109
132
|
header: string;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
133
|
+
/**
|
|
134
|
+
* Either an `accessorKey` or a combination of an `accessorFn` and `id` are required for a data column definition.
|
|
135
|
+
*
|
|
136
|
+
* If you have also specified an `accessorFn`, MRT still needs to have a valid `id` to be able to identify the column uniquely.
|
|
137
|
+
*
|
|
138
|
+
* `id` defaults to the `accessorKey` or `header` if not specified.
|
|
139
|
+
*
|
|
140
|
+
* @default gets set to the same value as `accessorKey` by default
|
|
141
|
+
*/
|
|
142
|
+
id?: LiteralUnion<string & keyof D>;
|
|
143
|
+
muiTableBodyCellCopyButtonProps?: ButtonProps | (({ table, cell, }: {
|
|
144
|
+
table: MRT_TableInstance<D>;
|
|
113
145
|
cell: MRT_Cell<D>;
|
|
114
146
|
}) => ButtonProps);
|
|
115
|
-
muiTableBodyCellEditTextFieldProps?: TextFieldProps | (({
|
|
116
|
-
|
|
147
|
+
muiTableBodyCellEditTextFieldProps?: TextFieldProps | (({ table, cell, }: {
|
|
148
|
+
table: MRT_TableInstance<D>;
|
|
117
149
|
cell: MRT_Cell<D>;
|
|
118
150
|
}) => TextFieldProps);
|
|
119
|
-
muiTableBodyCellProps?: TableCellProps | (({
|
|
120
|
-
|
|
151
|
+
muiTableBodyCellProps?: TableCellProps | (({ table, cell, }: {
|
|
152
|
+
table: MRT_TableInstance<D>;
|
|
121
153
|
cell: MRT_Cell<D>;
|
|
122
154
|
}) => TableCellProps);
|
|
123
|
-
muiTableFooterCellProps?: TableCellProps | (({
|
|
124
|
-
|
|
155
|
+
muiTableFooterCellProps?: TableCellProps | (({ table, column, }: {
|
|
156
|
+
table: MRT_TableInstance<D>;
|
|
125
157
|
column: MRT_Column<D>;
|
|
126
158
|
}) => TableCellProps);
|
|
127
|
-
muiTableHeadCellColumnActionsButtonProps?: IconButtonProps | (({
|
|
128
|
-
|
|
159
|
+
muiTableHeadCellColumnActionsButtonProps?: IconButtonProps | (({ table, column, }: {
|
|
160
|
+
table: MRT_TableInstance<D>;
|
|
129
161
|
column: MRT_Column<D>;
|
|
130
162
|
}) => IconButtonProps);
|
|
131
|
-
muiTableHeadCellFilterTextFieldProps?: TextFieldProps | (({
|
|
132
|
-
|
|
163
|
+
muiTableHeadCellFilterTextFieldProps?: TextFieldProps | (({ table, column, }: {
|
|
164
|
+
table: MRT_TableInstance<D>;
|
|
133
165
|
column: MRT_Column<D>;
|
|
134
166
|
}) => TextFieldProps);
|
|
135
|
-
muiTableHeadCellProps?: TableCellProps | (({
|
|
136
|
-
|
|
167
|
+
muiTableHeadCellProps?: TableCellProps | (({ table, column, }: {
|
|
168
|
+
table: MRT_TableInstance<D>;
|
|
137
169
|
column: MRT_Column<D>;
|
|
138
170
|
}) => TableCellProps);
|
|
139
|
-
onCellEditBlur?: ({ cell, event,
|
|
171
|
+
onCellEditBlur?: ({ cell, event, table, }: {
|
|
140
172
|
event: FocusEvent<HTMLInputElement>;
|
|
141
173
|
cell: MRT_Cell<D>;
|
|
142
|
-
|
|
174
|
+
table: MRT_TableInstance<D>;
|
|
143
175
|
}) => void;
|
|
144
|
-
onCellEditChange?: ({ cell, event,
|
|
176
|
+
onCellEditChange?: ({ cell, event, table, }: {
|
|
145
177
|
event: ChangeEvent<HTMLInputElement>;
|
|
146
178
|
cell: MRT_Cell<D>;
|
|
147
|
-
|
|
179
|
+
table: MRT_TableInstance<D>;
|
|
148
180
|
}) => void;
|
|
149
181
|
sortingFn?: MRT_SortingFn;
|
|
150
182
|
};
|
|
151
|
-
export declare type
|
|
183
|
+
export declare type MRT_DefinedColumnDef<D extends Record<string, any> = {}> = Omit<MRT_ColumnDef<D>, 'id'> & {
|
|
184
|
+
id: string;
|
|
185
|
+
};
|
|
186
|
+
export declare type MRT_Column<D extends Record<string, any> = {}> = Omit<Column<D>, 'header' | 'footer' | 'columns' | 'columnDef' | 'filterFn'> & {
|
|
187
|
+
columnDef: MRT_DefinedColumnDef<D>;
|
|
152
188
|
columns?: MRT_Column<D>[];
|
|
153
|
-
|
|
154
|
-
header: string;
|
|
189
|
+
filterFn?: MRT_FilterFn<D>;
|
|
155
190
|
footer: string;
|
|
191
|
+
header: string;
|
|
156
192
|
};
|
|
157
193
|
export declare type MRT_Header<D extends Record<string, any> = {}> = Omit<Header<D>, 'column'> & {
|
|
158
194
|
column: MRT_Column<D>;
|
|
@@ -171,10 +207,10 @@ export declare type MRT_Cell<D extends Record<string, any> = {}> = Omit<Cell<D>,
|
|
|
171
207
|
column: MRT_Column<D>;
|
|
172
208
|
row: MRT_Row<D>;
|
|
173
209
|
};
|
|
174
|
-
export declare type MRT_SortingOption =
|
|
175
|
-
export declare type MRT_SortingFn = SortingFn<
|
|
176
|
-
export declare type
|
|
177
|
-
export declare type MRT_FilterFn = FilterFn<
|
|
210
|
+
export declare type MRT_SortingOption = keyof typeof MRT_SortingFns;
|
|
211
|
+
export declare type MRT_SortingFn<D extends Record<string, any> = {}> = SortingFn<D> | MRT_SortingOption;
|
|
212
|
+
export declare type MRT_FilterOption = keyof typeof MRT_FilterFns;
|
|
213
|
+
export declare type MRT_FilterFn<D extends Record<string, any> = {}> = FilterFn<D> | MRT_FilterOption;
|
|
178
214
|
export declare type MaterialReactTableProps<D extends Record<string, any> = {}> = MRT_TableOptions<D> & {
|
|
179
215
|
editingMode?: 'table' | 'row' | 'cell';
|
|
180
216
|
enableClickToCopy?: boolean;
|
|
@@ -198,127 +234,127 @@ export declare type MaterialReactTableProps<D extends Record<string, any> = {}>
|
|
|
198
234
|
enableToolbarBottom?: boolean;
|
|
199
235
|
enableToolbarInternalActions?: boolean;
|
|
200
236
|
enableToolbarTop?: boolean;
|
|
201
|
-
enabledColumnFilterOptions?: (
|
|
202
|
-
enabledGlobalFilterOptions?: (
|
|
237
|
+
enabledColumnFilterOptions?: (MRT_FilterOption | string)[] | null;
|
|
238
|
+
enabledGlobalFilterOptions?: (MRT_FilterOption | string)[] | null;
|
|
203
239
|
icons?: Partial<MRT_Icons>;
|
|
204
240
|
localization?: Partial<MRT_Localization>;
|
|
205
|
-
muiExpandAllButtonProps?: IconButtonProps | (({
|
|
206
|
-
|
|
241
|
+
muiExpandAllButtonProps?: IconButtonProps | (({ table }: {
|
|
242
|
+
table: MRT_TableInstance<D>;
|
|
207
243
|
}) => IconButtonProps);
|
|
208
|
-
muiExpandButtonProps?: IconButtonProps | (({
|
|
209
|
-
|
|
244
|
+
muiExpandButtonProps?: IconButtonProps | (({ table, }: {
|
|
245
|
+
table: MRT_TableInstance<D>;
|
|
210
246
|
row: MRT_Row<D>;
|
|
211
247
|
}) => IconButtonProps);
|
|
212
|
-
muiLinearProgressProps?: LinearProgressProps | (({
|
|
213
|
-
|
|
248
|
+
muiLinearProgressProps?: LinearProgressProps | (({ table }: {
|
|
249
|
+
table: MRT_TableInstance<D>;
|
|
214
250
|
}) => LinearProgressProps);
|
|
215
|
-
muiSearchTextFieldProps?: TextFieldProps | (({
|
|
216
|
-
|
|
251
|
+
muiSearchTextFieldProps?: TextFieldProps | (({ table }: {
|
|
252
|
+
table: MRT_TableInstance<D>;
|
|
217
253
|
}) => TextFieldProps);
|
|
218
|
-
muiSelectAllCheckboxProps?: CheckboxProps | (({
|
|
219
|
-
|
|
254
|
+
muiSelectAllCheckboxProps?: CheckboxProps | (({ table }: {
|
|
255
|
+
table: MRT_TableInstance<D>;
|
|
220
256
|
}) => CheckboxProps);
|
|
221
|
-
muiSelectCheckboxProps?: CheckboxProps | (({
|
|
222
|
-
|
|
257
|
+
muiSelectCheckboxProps?: CheckboxProps | (({ table, row, }: {
|
|
258
|
+
table: MRT_TableInstance<D>;
|
|
223
259
|
row: MRT_Row<D>;
|
|
224
260
|
}) => CheckboxProps);
|
|
225
|
-
muiTableBodyCellCopyButtonProps?: ButtonProps | (({
|
|
226
|
-
|
|
261
|
+
muiTableBodyCellCopyButtonProps?: ButtonProps | (({ table, cell, }: {
|
|
262
|
+
table: MRT_TableInstance<D>;
|
|
227
263
|
cell: MRT_Cell<D>;
|
|
228
264
|
}) => ButtonProps);
|
|
229
|
-
muiTableBodyCellEditTextFieldProps?: TextFieldProps | (({
|
|
230
|
-
|
|
265
|
+
muiTableBodyCellEditTextFieldProps?: TextFieldProps | (({ table, cell, }: {
|
|
266
|
+
table: MRT_TableInstance<D>;
|
|
231
267
|
cell: MRT_Cell<D>;
|
|
232
268
|
}) => TextFieldProps);
|
|
233
|
-
muiTableBodyCellProps?: TableCellProps | (({
|
|
234
|
-
|
|
269
|
+
muiTableBodyCellProps?: TableCellProps | (({ table, cell, }: {
|
|
270
|
+
table: MRT_TableInstance<D>;
|
|
235
271
|
cell: MRT_Cell<D>;
|
|
236
272
|
}) => TableCellProps);
|
|
237
|
-
muiTableBodyCellSkeletonProps?: SkeletonProps | (({
|
|
238
|
-
|
|
273
|
+
muiTableBodyCellSkeletonProps?: SkeletonProps | (({ table, cell, }: {
|
|
274
|
+
table: MRT_TableInstance<D>;
|
|
239
275
|
cell: MRT_Cell<D>;
|
|
240
276
|
}) => SkeletonProps);
|
|
241
|
-
muiTableBodyProps?: TableBodyProps | (({
|
|
242
|
-
|
|
277
|
+
muiTableBodyProps?: TableBodyProps | (({ table }: {
|
|
278
|
+
table: MRT_TableInstance<D>;
|
|
243
279
|
}) => TableBodyProps);
|
|
244
|
-
muiTableBodyRowProps?: TableRowProps | (({
|
|
245
|
-
|
|
280
|
+
muiTableBodyRowProps?: TableRowProps | (({ table, row, }: {
|
|
281
|
+
table: MRT_TableInstance<D>;
|
|
246
282
|
row: MRT_Row<D>;
|
|
247
283
|
}) => TableRowProps);
|
|
248
|
-
muiTableContainerProps?: TableContainerProps | (({
|
|
249
|
-
|
|
284
|
+
muiTableContainerProps?: TableContainerProps | (({ table }: {
|
|
285
|
+
table: MRT_TableInstance<D>;
|
|
250
286
|
}) => TableContainerProps);
|
|
251
|
-
muiTableDetailPanelProps?: TableCellProps | (({
|
|
252
|
-
|
|
287
|
+
muiTableDetailPanelProps?: TableCellProps | (({ table, row, }: {
|
|
288
|
+
table: MRT_TableInstance<D>;
|
|
253
289
|
row: MRT_Row<D>;
|
|
254
290
|
}) => TableCellProps);
|
|
255
|
-
muiTableFooterCellProps?: TableCellProps | (({
|
|
256
|
-
|
|
291
|
+
muiTableFooterCellProps?: TableCellProps | (({ table, column, }: {
|
|
292
|
+
table: MRT_TableInstance<D>;
|
|
257
293
|
column: MRT_Column<D>;
|
|
258
294
|
}) => TableCellProps);
|
|
259
|
-
muiTableFooterProps?: TableFooterProps | (({
|
|
260
|
-
|
|
295
|
+
muiTableFooterProps?: TableFooterProps | (({ table }: {
|
|
296
|
+
table: MRT_TableInstance<D>;
|
|
261
297
|
}) => TableFooterProps);
|
|
262
|
-
muiTableFooterRowProps?: TableRowProps | (({
|
|
263
|
-
|
|
298
|
+
muiTableFooterRowProps?: TableRowProps | (({ table, footerGroup, }: {
|
|
299
|
+
table: MRT_TableInstance<D>;
|
|
264
300
|
footerGroup: MRT_HeaderGroup<D>;
|
|
265
301
|
}) => TableRowProps);
|
|
266
|
-
muiTableHeadCellColumnActionsButtonProps?: IconButtonProps | (({
|
|
267
|
-
|
|
302
|
+
muiTableHeadCellColumnActionsButtonProps?: IconButtonProps | (({ table, column, }: {
|
|
303
|
+
table: MRT_TableInstance<D>;
|
|
268
304
|
column: MRT_Column<D>;
|
|
269
305
|
}) => IconButtonProps);
|
|
270
|
-
muiTableHeadCellFilterTextFieldProps?: TextFieldProps | (({
|
|
271
|
-
|
|
306
|
+
muiTableHeadCellFilterTextFieldProps?: TextFieldProps | (({ table, column, }: {
|
|
307
|
+
table: MRT_TableInstance<D>;
|
|
272
308
|
column: MRT_Column<D>;
|
|
273
309
|
}) => TextFieldProps);
|
|
274
|
-
muiTableHeadCellProps?: TableCellProps | (({
|
|
275
|
-
|
|
310
|
+
muiTableHeadCellProps?: TableCellProps | (({ table, column, }: {
|
|
311
|
+
table: MRT_TableInstance<D>;
|
|
276
312
|
column: MRT_Column<D>;
|
|
277
313
|
}) => TableCellProps);
|
|
278
|
-
muiTableHeadProps?: TableHeadProps | (({
|
|
279
|
-
|
|
314
|
+
muiTableHeadProps?: TableHeadProps | (({ table }: {
|
|
315
|
+
table: MRT_TableInstance<D>;
|
|
280
316
|
}) => TableHeadProps);
|
|
281
|
-
muiTableHeadRowProps?: TableRowProps | (({
|
|
282
|
-
|
|
317
|
+
muiTableHeadRowProps?: TableRowProps | (({ table, headerGroup, }: {
|
|
318
|
+
table: MRT_TableInstance<D>;
|
|
283
319
|
headerGroup: MRT_HeaderGroup<D>;
|
|
284
320
|
}) => TableRowProps);
|
|
285
|
-
muiTablePaginationProps?: Partial<TablePaginationProps> | (({
|
|
286
|
-
|
|
321
|
+
muiTablePaginationProps?: Partial<TablePaginationProps> | (({ table, }: {
|
|
322
|
+
table: MRT_TableInstance<D>;
|
|
287
323
|
}) => Partial<TablePaginationProps>);
|
|
288
|
-
muiTablePaperProps?: PaperProps | (({
|
|
289
|
-
|
|
324
|
+
muiTablePaperProps?: PaperProps | (({ table }: {
|
|
325
|
+
table: MRT_TableInstance<D>;
|
|
290
326
|
}) => PaperProps);
|
|
291
|
-
muiTableProps?: TableProps | (({
|
|
292
|
-
|
|
327
|
+
muiTableProps?: TableProps | (({ table }: {
|
|
328
|
+
table: MRT_TableInstance<D>;
|
|
293
329
|
}) => TableProps);
|
|
294
|
-
muiTableToolbarAlertBannerProps?: AlertProps | (({
|
|
295
|
-
|
|
330
|
+
muiTableToolbarAlertBannerProps?: AlertProps | (({ table }: {
|
|
331
|
+
table: MRT_TableInstance<D>;
|
|
296
332
|
}) => AlertProps);
|
|
297
|
-
muiTableToolbarBottomProps?: ToolbarProps | (({
|
|
298
|
-
|
|
333
|
+
muiTableToolbarBottomProps?: ToolbarProps | (({ table }: {
|
|
334
|
+
table: MRT_TableInstance<D>;
|
|
299
335
|
}) => ToolbarProps);
|
|
300
|
-
muiTableToolbarTopProps?: ToolbarProps | (({
|
|
301
|
-
|
|
336
|
+
muiTableToolbarTopProps?: ToolbarProps | (({ table }: {
|
|
337
|
+
table: MRT_TableInstance<D>;
|
|
302
338
|
}) => ToolbarProps);
|
|
303
|
-
onCellEditBlur?: ({ cell, event,
|
|
339
|
+
onCellEditBlur?: ({ cell, event, table, }: {
|
|
304
340
|
event: FocusEvent<HTMLInputElement>;
|
|
305
341
|
cell: MRT_Cell<D>;
|
|
306
|
-
|
|
342
|
+
table: MRT_TableInstance<D>;
|
|
307
343
|
}) => void;
|
|
308
|
-
onCellEditChange?: ({ cell, event,
|
|
344
|
+
onCellEditChange?: ({ cell, event, table, }: {
|
|
309
345
|
event: ChangeEvent<HTMLInputElement>;
|
|
310
346
|
cell: MRT_Cell<D>;
|
|
311
|
-
|
|
347
|
+
table: MRT_TableInstance<D>;
|
|
312
348
|
}) => void;
|
|
313
349
|
onCurrentEditingCellChange?: OnChangeFn<MRT_Cell>;
|
|
314
350
|
onCurrentEditingRowChange?: OnChangeFn<MRT_Row>;
|
|
315
351
|
onCurrentFilterFnsChange?: OnChangeFn<{
|
|
316
|
-
[key: string]:
|
|
352
|
+
[key: string]: MRT_FilterOption;
|
|
317
353
|
}>;
|
|
318
|
-
onCurrentGlobalFilterFnChange?: OnChangeFn<
|
|
319
|
-
onEditRowSubmit?: ({ row,
|
|
354
|
+
onCurrentGlobalFilterFnChange?: OnChangeFn<MRT_FilterOption>;
|
|
355
|
+
onEditRowSubmit?: ({ row, table, }: {
|
|
320
356
|
row: MRT_Row<D>;
|
|
321
|
-
|
|
357
|
+
table: MRT_TableInstance<D>;
|
|
322
358
|
}) => Promise<void> | void;
|
|
323
359
|
onDensityChange?: OnChangeFn<boolean>;
|
|
324
360
|
onIsFullScreenChange?: OnChangeFn<boolean>;
|
|
@@ -329,41 +365,41 @@ export declare type MaterialReactTableProps<D extends Record<string, any> = {}>
|
|
|
329
365
|
positionGlobalFilter?: 'left' | 'right';
|
|
330
366
|
positionPagination?: 'bottom' | 'top' | 'both';
|
|
331
367
|
positionToolbarAlertBanner?: 'bottom' | 'top';
|
|
332
|
-
renderDetailPanel?: ({ row,
|
|
368
|
+
renderDetailPanel?: ({ row, table, }: {
|
|
333
369
|
row: MRT_Row<D>;
|
|
334
|
-
|
|
370
|
+
table: MRT_TableInstance<D>;
|
|
335
371
|
}) => ReactNode;
|
|
336
|
-
renderRowActionMenuItems?: ({ closeMenu, row,
|
|
372
|
+
renderRowActionMenuItems?: ({ closeMenu, row, table, }: {
|
|
337
373
|
closeMenu: () => void;
|
|
338
374
|
row: MRT_Row<D>;
|
|
339
|
-
|
|
375
|
+
table: MRT_TableInstance<D>;
|
|
340
376
|
}) => ReactNode[];
|
|
341
|
-
renderRowActions?: ({ row,
|
|
377
|
+
renderRowActions?: ({ row, table, }: {
|
|
342
378
|
row: MRT_Row<D>;
|
|
343
|
-
|
|
379
|
+
table: MRT_TableInstance<D>;
|
|
344
380
|
}) => ReactNode;
|
|
345
|
-
renderToolbarBottomCustomActions?: ({
|
|
346
|
-
|
|
381
|
+
renderToolbarBottomCustomActions?: ({ table, }: {
|
|
382
|
+
table: MRT_TableInstance<D>;
|
|
347
383
|
}) => ReactNode;
|
|
348
|
-
renderToolbarTopCustomActions?: ({
|
|
349
|
-
|
|
384
|
+
renderToolbarTopCustomActions?: ({ table, }: {
|
|
385
|
+
table: MRT_TableInstance<D>;
|
|
350
386
|
}) => ReactNode;
|
|
351
|
-
renderToolbarInternalActions?: ({
|
|
352
|
-
|
|
387
|
+
renderToolbarInternalActions?: ({ table, MRT_ToggleGlobalFilterButton, MRT_ToggleFiltersButton, MRT_ShowHideColumnsButton, MRT_ToggleDensePaddingButton, MRT_FullScreenToggleButton, }: {
|
|
388
|
+
table: MRT_TableInstance<D>;
|
|
353
389
|
MRT_ToggleGlobalFilterButton: FC<IconButtonProps & {
|
|
354
|
-
|
|
390
|
+
table: MRT_TableInstance<D>;
|
|
355
391
|
}>;
|
|
356
392
|
MRT_ToggleFiltersButton: FC<IconButtonProps & {
|
|
357
|
-
|
|
393
|
+
table: MRT_TableInstance<D>;
|
|
358
394
|
}>;
|
|
359
395
|
MRT_ShowHideColumnsButton: FC<IconButtonProps & {
|
|
360
|
-
|
|
396
|
+
table: MRT_TableInstance<D>;
|
|
361
397
|
}>;
|
|
362
398
|
MRT_ToggleDensePaddingButton: FC<IconButtonProps & {
|
|
363
|
-
|
|
399
|
+
table: MRT_TableInstance<D>;
|
|
364
400
|
}>;
|
|
365
401
|
MRT_FullScreenToggleButton: FC<IconButtonProps & {
|
|
366
|
-
|
|
402
|
+
table: MRT_TableInstance<D>;
|
|
367
403
|
}>;
|
|
368
404
|
}) => ReactNode;
|
|
369
405
|
rowCount?: number;
|
|
@@ -2,7 +2,7 @@ import { FC } from 'react';
|
|
|
2
2
|
import { IconButtonProps } from '@mui/material';
|
|
3
3
|
import { MRT_TableInstance } from '..';
|
|
4
4
|
interface Props extends IconButtonProps {
|
|
5
|
-
|
|
5
|
+
table: MRT_TableInstance;
|
|
6
6
|
}
|
|
7
7
|
export declare const MRT_FullScreenToggleButton: FC<Props>;
|
|
8
8
|
export {};
|
|
@@ -2,7 +2,7 @@ import { FC } from 'react';
|
|
|
2
2
|
import { IconButtonProps } from '@mui/material';
|
|
3
3
|
import { MRT_TableInstance } from '..';
|
|
4
4
|
interface Props extends IconButtonProps {
|
|
5
|
-
|
|
5
|
+
table: MRT_TableInstance;
|
|
6
6
|
}
|
|
7
7
|
export declare const MRT_ShowHideColumnsButton: FC<Props>;
|
|
8
8
|
export {};
|
|
@@ -2,7 +2,7 @@ import { FC } from 'react';
|
|
|
2
2
|
import { IconButtonProps } from '@mui/material';
|
|
3
3
|
import { MRT_TableInstance } from '..';
|
|
4
4
|
interface Props extends IconButtonProps {
|
|
5
|
-
|
|
5
|
+
table: MRT_TableInstance;
|
|
6
6
|
}
|
|
7
7
|
export declare const MRT_ToggleDensePaddingButton: FC<Props>;
|
|
8
8
|
export {};
|
|
@@ -2,7 +2,7 @@ import { FC } from 'react';
|
|
|
2
2
|
import { IconButtonProps } from '@mui/material';
|
|
3
3
|
import { MRT_TableInstance } from '..';
|
|
4
4
|
interface Props extends IconButtonProps {
|
|
5
|
-
|
|
5
|
+
table: MRT_TableInstance;
|
|
6
6
|
}
|
|
7
7
|
export declare const MRT_ToggleFiltersButton: FC<Props>;
|
|
8
8
|
export {};
|
|
@@ -2,7 +2,7 @@ import { FC } from 'react';
|
|
|
2
2
|
import { IconButtonProps } from '@mui/material';
|
|
3
3
|
import { MRT_TableInstance } from '..';
|
|
4
4
|
interface Props extends IconButtonProps {
|
|
5
|
-
|
|
5
|
+
table: MRT_TableInstance;
|
|
6
6
|
}
|
|
7
7
|
export declare const MRT_ToggleGlobalFilterButton: FC<Props>;
|
|
8
8
|
export {};
|