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