material-react-table 0.7.0-alpha.1 → 0.7.0-alpha.10
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 +29 -19
- package/dist/MaterialReactTable.d.ts +203 -61
- package/dist/buttons/MRT_CopyButton.d.ts +1 -2
- package/dist/localization.d.ts +1 -0
- package/dist/material-react-table.cjs.development.js +303 -956
- 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 +303 -956
- package/dist/material-react-table.esm.js.map +1 -1
- package/dist/utils.d.ts +1 -1
- package/package.json +4 -4
- package/src/MaterialReactTable.tsx +380 -128
- package/src/body/MRT_TableBody.tsx +1 -1
- package/src/body/MRT_TableBodyCell.tsx +9 -6
- package/src/body/MRT_TableBodyRow.tsx +2 -2
- package/src/body/MRT_TableDetailPanel.tsx +6 -4
- package/src/buttons/MRT_CopyButton.tsx +3 -4
- package/src/buttons/MRT_EditActionButtons.tsx +5 -3
- package/src/buttons/MRT_ExpandButton.tsx +1 -1
- package/src/buttons/MRT_ToggleColumnActionMenuButton.tsx +5 -2
- package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +6 -6
- package/src/buttons/MRT_ToggleSearchButton.tsx +6 -1
- package/src/footer/MRT_TableFooter.tsx +1 -1
- package/src/footer/MRT_TableFooterCell.tsx +2 -2
- package/src/footer/MRT_TableFooterRow.tsx +1 -1
- package/src/head/MRT_TableHead.tsx +1 -1
- package/src/head/MRT_TableHeadCell.tsx +22 -29
- package/src/head/MRT_TableHeadRow.tsx +1 -1
- package/src/inputs/MRT_EditCellTextField.tsx +30 -14
- package/src/inputs/MRT_FilterTextField.tsx +2 -2
- package/src/inputs/MRT_SearchTextField.tsx +8 -3
- package/src/inputs/MRT_SelectCheckbox.tsx +9 -7
- package/src/localization.ts +2 -1
- package/src/menus/MRT_RowActionMenu.tsx +7 -5
- package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +4 -5
- package/src/table/MRT_Table.tsx +1 -1
- package/src/table/MRT_TableContainer.tsx +16 -20
- package/src/table/MRT_TablePaper.tsx +9 -5
- package/src/table/MRT_TableRoot.tsx +11 -8
- package/src/toolbar/MRT_LinearProgressBar.tsx +1 -1
- package/src/toolbar/MRT_TablePagination.tsx +6 -2
- package/src/toolbar/MRT_ToolbarAlertBanner.tsx +2 -1
- package/src/toolbar/MRT_ToolbarBottom.tsx +1 -1
- package/src/toolbar/MRT_ToolbarInternalButtons.tsx +5 -4
- package/src/toolbar/MRT_ToolbarTop.tsx +2 -2
package/README.md
CHANGED
|
@@ -1,47 +1,57 @@
|
|
|
1
1
|
# Material React Table
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
3
|
+
> This Project is based on react-table v8, which itself is still in alpha, and therefore this package is also still in alpha
|
|
4
|
+
|
|
5
|
+
- A fully featured Material UI v5 implementation of react-table v8 (alpha)
|
|
6
|
+
- Inspired by material-table and the MUI X DataGrid
|
|
7
|
+
- Written from the ground up in TypeScript, Material UI, and React Table
|
|
8
|
+
- All internal Material UI components are easily customizable
|
|
6
9
|
|
|
7
10
|
## This project is in alpha, but feel free to install and explore
|
|
8
11
|
|
|
9
|
-
View the docs (alpha) site
|
|
12
|
+
View the [docs (alpha) site](https://www.material-react-table.com/)
|
|
10
13
|
|
|
11
|
-
View additional storybook examples
|
|
14
|
+
View additional [storybook examples](https://www.material-react-table.dev/)
|
|
12
15
|
|
|
13
|
-
View the source code and open issues
|
|
16
|
+
View the [github source code](https://github.com/KevinVandy/material-react-table) and [github open issues](https://github.com/KevinVandy/material-react-table/issues)
|
|
14
17
|
|
|
15
|
-
Join the discord
|
|
18
|
+
Join the [discord](https://discord.gg/5wqyRx6fnm) server to join in on the development discussion
|
|
16
19
|
|
|
17
20
|
<br />
|
|
18
21
|
|
|
19
|
-
### Features (Still In Active Development)
|
|
22
|
+
### Features (Some Still In Active Development)
|
|
20
23
|
|
|
21
|
-
- [
|
|
22
|
-
- [ ] Column Resizing (in dev)
|
|
23
|
-
- [x] Cell Editing
|
|
24
|
+
- [x] Click To Copy Cell Values
|
|
24
25
|
- [x] Column Actions
|
|
25
26
|
- [x] Column Hiding
|
|
26
|
-
- [x]
|
|
27
|
+
- [x] Column Grouping (Group By and Aggregates)
|
|
28
|
+
- [ ] Column Ordering (react-dnd planned)
|
|
29
|
+
- [x] Column Pinning
|
|
30
|
+
- [x] Column Resizing (work in progress)
|
|
31
|
+
- [x] Custom Icons
|
|
32
|
+
- [x] Custom Styling and internal Mui Components
|
|
33
|
+
- [x] Data Editing
|
|
27
34
|
- [x] Dense Padding Toggle
|
|
28
|
-
- [x] Localization
|
|
29
35
|
- [x] Filtering
|
|
30
|
-
- [x]
|
|
36
|
+
- [x] Fullscreen
|
|
37
|
+
- [ ] Global Search (broken in react-table v8 :( ))
|
|
31
38
|
- [x] HeaderGroups
|
|
32
|
-
- [x]
|
|
39
|
+
- [x] Localization i18n
|
|
40
|
+
- [x] Pagination (supports client-side and server-side)
|
|
33
41
|
- [x] Row Actions
|
|
34
|
-
- [x] Selection
|
|
42
|
+
- [x] Row Selection
|
|
43
|
+
- [x] SSR compatible
|
|
35
44
|
- [x] Sorting
|
|
36
45
|
- [x] Toolbars
|
|
37
|
-
- [x] Tree Data
|
|
46
|
+
- [x] Tree Data / Expanding Subrows
|
|
47
|
+
- [ ] Virtualization (planned)
|
|
38
48
|
|
|
39
49
|
### Installation
|
|
40
50
|
|
|
41
|
-
1. Install Peer Dependencies (
|
|
51
|
+
1. Install Peer Dependencies (Material UI v5)
|
|
42
52
|
|
|
43
53
|
```bash
|
|
44
|
-
npm install @mui/material @mui/icons-material @emotion/react @emotion/styled
|
|
54
|
+
npm install @mui/material @mui/icons-material @emotion/react @emotion/styled
|
|
45
55
|
```
|
|
46
56
|
|
|
47
57
|
2. Install material-react-table
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ChangeEvent, Dispatch, FC, MouseEvent, ReactNode, SetStateAction } from 'react';
|
|
1
|
+
import { ChangeEvent, Dispatch, FC, FocusEvent, MouseEvent, 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, DefaultGenerics, FilterType, Header, HeaderGroup, Options, Overwrite, PaginationState, Row, TableInstance, TableState } from '@tanstack/react-table';
|
|
3
|
+
import { Cell, Column, ColumnDef, DefaultGenerics, FilterType, Header, HeaderGroup, Options, Overwrite, PaginationState, Row, TableInstance, TableState, VisibilityState } from '@tanstack/react-table';
|
|
4
4
|
import { MRT_Localization } from './localization';
|
|
5
5
|
import { MRT_Icons } from './icons';
|
|
6
6
|
import { MRT_FILTER_TYPE } from './enums';
|
|
@@ -23,11 +23,11 @@ export declare type MRT_TableInstance<D extends Record<string, any> = {}> = Omit
|
|
|
23
23
|
}>>, 'getAllColumns' | 'getAllLeafColumns' | 'getExpandedRowModel' | 'getPaginationRowModel' | 'getPrePaginationRowModel' | 'getRowModel' | 'getSelectedRowModel' | 'getState' | 'options'> & {
|
|
24
24
|
getAllColumns: () => MRT_ColumnInstance<D>[];
|
|
25
25
|
getAllLeafColumns: () => MRT_ColumnInstance<D>[];
|
|
26
|
-
getExpandedRowModel: () => MRT_RowModel
|
|
27
|
-
getPaginationRowModel: () => MRT_RowModel
|
|
28
|
-
getPrePaginationRowModel: () => MRT_RowModel
|
|
29
|
-
getRowModel: () => MRT_RowModel
|
|
30
|
-
getSelectedRowModel: () => MRT_RowModel
|
|
26
|
+
getExpandedRowModel: () => MRT_RowModel<D>;
|
|
27
|
+
getPaginationRowModel: () => MRT_RowModel<D>;
|
|
28
|
+
getPrePaginationRowModel: () => MRT_RowModel<D>;
|
|
29
|
+
getRowModel: () => MRT_RowModel<D>;
|
|
30
|
+
getSelectedRowModel: () => MRT_RowModel<D>;
|
|
31
31
|
getState: () => MRT_TableState<D>;
|
|
32
32
|
options: MaterialReactTableProps<D> & {
|
|
33
33
|
icons: MRT_Icons;
|
|
@@ -58,10 +58,9 @@ export declare type MRT_TableState<D extends Record<string, any> = {}> = Omit<Ta
|
|
|
58
58
|
pagination: Partial<PaginationState>;
|
|
59
59
|
};
|
|
60
60
|
export declare type MRT_ColumnInterface<D extends Record<string, any> = {}> = Omit<ColumnDef<D>, 'header' | 'footer' | 'columns'> & {
|
|
61
|
-
Edit?: ({ cell, tableInstance,
|
|
61
|
+
Edit?: ({ cell, tableInstance, }: {
|
|
62
62
|
cell: MRT_Cell<D>;
|
|
63
63
|
tableInstance: MRT_TableInstance<D>;
|
|
64
|
-
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
65
64
|
}) => ReactNode;
|
|
66
65
|
Filter?: ({ header, tableInstance, }: {
|
|
67
66
|
header: MRT_Header<D>;
|
|
@@ -84,8 +83,6 @@ export declare type MRT_ColumnInterface<D extends Record<string, any> = {}> = Om
|
|
|
84
83
|
enableClickToCopy?: boolean;
|
|
85
84
|
enableColumnActions?: boolean;
|
|
86
85
|
enableEditing?: boolean;
|
|
87
|
-
enableColumnFilters?: boolean;
|
|
88
|
-
enableHiding?: boolean;
|
|
89
86
|
enabledFilterTypes?: (MRT_FILTER_TYPE | string)[];
|
|
90
87
|
filter?: MRT_FilterType | string | FilterType<D>;
|
|
91
88
|
filterSelectOptions?: (string | {
|
|
@@ -94,15 +91,48 @@ export declare type MRT_ColumnInterface<D extends Record<string, any> = {}> = Om
|
|
|
94
91
|
})[];
|
|
95
92
|
footer?: string;
|
|
96
93
|
header: string;
|
|
97
|
-
muiTableBodyCellCopyButtonProps?: ButtonProps | ((cell
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
94
|
+
muiTableBodyCellCopyButtonProps?: ButtonProps | (({ tableInstance, cell, }: {
|
|
95
|
+
tableInstance: MRT_TableInstance;
|
|
96
|
+
cell: MRT_Cell<D>;
|
|
97
|
+
}) => ButtonProps);
|
|
98
|
+
muiTableBodyCellEditTextFieldProps?: TextFieldProps | (({ tableInstance, cell, }: {
|
|
99
|
+
tableInstance: MRT_TableInstance;
|
|
100
|
+
cell: MRT_Cell<D>;
|
|
101
|
+
}) => TextFieldProps);
|
|
102
|
+
muiTableBodyCellProps?: TableCellProps | (({ tableInstance, cell, }: {
|
|
103
|
+
tableInstance: MRT_TableInstance;
|
|
104
|
+
cell: MRT_Cell<D>;
|
|
105
|
+
}) => TableCellProps);
|
|
106
|
+
muiTableFooterCellProps?: TableCellProps | (({ tableInstance, column, }: {
|
|
107
|
+
tableInstance: MRT_TableInstance;
|
|
108
|
+
column: MRT_ColumnInstance<D>;
|
|
109
|
+
}) => TableCellProps);
|
|
110
|
+
muiTableHeadCellColumnActionsButtonProps?: IconButtonProps | (({ tableInstance, column, }: {
|
|
111
|
+
tableInstance: MRT_TableInstance;
|
|
112
|
+
column: MRT_ColumnInstance<D>;
|
|
113
|
+
}) => IconButtonProps);
|
|
114
|
+
muiTableHeadCellFilterTextFieldProps?: TextFieldProps | (({ tableInstance, column, }: {
|
|
115
|
+
tableInstance: MRT_TableInstance;
|
|
116
|
+
column: MRT_ColumnInstance<D>;
|
|
117
|
+
}) => TextFieldProps);
|
|
118
|
+
muiTableHeadCellProps?: TableCellProps | (({ tableInstance, column, }: {
|
|
119
|
+
tableInstance: MRT_TableInstance;
|
|
120
|
+
column: MRT_ColumnInstance<D>;
|
|
121
|
+
}) => TableCellProps);
|
|
122
|
+
onCellEditBlur?: ({ cell, event, tableInstance, }: {
|
|
123
|
+
event: FocusEvent<HTMLInputElement>;
|
|
124
|
+
cell: MRT_Cell<D>;
|
|
125
|
+
tableInstance: MRT_TableInstance<D>;
|
|
126
|
+
}) => void;
|
|
127
|
+
onCellEditChange?: ({ cell, event, tableInstance, }: {
|
|
128
|
+
event: ChangeEvent<HTMLInputElement>;
|
|
129
|
+
cell: MRT_Cell<D>;
|
|
130
|
+
tableInstance: MRT_TableInstance<D>;
|
|
131
|
+
}) => void;
|
|
132
|
+
onColumnFilterValueChange?: ({ event, filterValue, }: {
|
|
133
|
+
event: ChangeEvent<HTMLInputElement>;
|
|
134
|
+
filterValue: any;
|
|
135
|
+
}) => void;
|
|
106
136
|
};
|
|
107
137
|
export declare type MRT_ColumnInstance<D extends Record<string, any> = {}> = Omit<Column<D>, 'header' | 'footer' | 'columns'> & MRT_ColumnInterface<D> & {
|
|
108
138
|
columns?: MRT_ColumnInstance<D>[];
|
|
@@ -137,7 +167,7 @@ export declare type MaterialReactTableProps<D extends Record<string, any> = {}>
|
|
|
137
167
|
enablePagination?: boolean;
|
|
138
168
|
enableRowActions?: boolean;
|
|
139
169
|
enableStickyHeader?: boolean;
|
|
140
|
-
|
|
170
|
+
enableEditing?: boolean;
|
|
141
171
|
enableRowNumbers?: boolean;
|
|
142
172
|
enableSelectAll?: boolean;
|
|
143
173
|
enabledGlobalFilterTypes?: (MRT_FILTER_TYPE | string)[];
|
|
@@ -154,49 +184,161 @@ export declare type MaterialReactTableProps<D extends Record<string, any> = {}>
|
|
|
154
184
|
isReloading?: boolean;
|
|
155
185
|
isLoading?: boolean;
|
|
156
186
|
localization?: Partial<MRT_Localization>;
|
|
157
|
-
muiLinearProgressProps?: LinearProgressProps | ((tableInstance:
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
187
|
+
muiLinearProgressProps?: LinearProgressProps | (({ tableInstance, }: {
|
|
188
|
+
tableInstance: MRT_TableInstance;
|
|
189
|
+
}) => LinearProgressProps);
|
|
190
|
+
muiSearchTextFieldProps?: TextFieldProps | (({ tableInstance, }: {
|
|
191
|
+
tableInstance: MRT_TableInstance;
|
|
192
|
+
}) => TextFieldProps);
|
|
193
|
+
muiSelectCheckboxProps?: CheckboxProps | (({ tableInstance, isSelectAll, row, }: {
|
|
194
|
+
tableInstance: MRT_TableInstance;
|
|
195
|
+
isSelectAll: boolean;
|
|
196
|
+
row?: MRT_Row<D>;
|
|
197
|
+
}) => CheckboxProps);
|
|
198
|
+
muiTableBodyCellCopyButtonProps?: ButtonProps | (({ tableInstance, cell, }: {
|
|
199
|
+
tableInstance: MRT_TableInstance;
|
|
200
|
+
cell: MRT_Cell<D>;
|
|
201
|
+
}) => ButtonProps);
|
|
202
|
+
muiTableBodyCellEditTextFieldProps?: TextFieldProps | (({ tableInstance, cell, }: {
|
|
203
|
+
tableInstance: MRT_TableInstance;
|
|
204
|
+
cell: MRT_Cell<D>;
|
|
205
|
+
}) => TextFieldProps);
|
|
206
|
+
muiTableBodyCellProps?: TableCellProps | (({ tableInstance, cell, }: {
|
|
207
|
+
tableInstance: MRT_TableInstance;
|
|
208
|
+
cell: MRT_Cell<D>;
|
|
209
|
+
}) => TableCellProps);
|
|
210
|
+
muiTableBodyCellSkeletonProps?: SkeletonProps | (({ tableInstance, cell, }: {
|
|
211
|
+
tableInstance: MRT_TableInstance;
|
|
212
|
+
cell: MRT_Cell<D>;
|
|
213
|
+
}) => SkeletonProps);
|
|
214
|
+
muiTableBodyProps?: TableBodyProps | (({ tableInstance, }: {
|
|
215
|
+
tableInstance: MRT_TableInstance;
|
|
216
|
+
}) => TableBodyProps);
|
|
217
|
+
muiTableBodyRowProps?: TableRowProps | (({ tableInstance, row, }: {
|
|
218
|
+
tableInstance: MRT_TableInstance;
|
|
219
|
+
row: MRT_Row<D>;
|
|
220
|
+
}) => TableRowProps);
|
|
221
|
+
muiTableContainerProps?: TableContainerProps | (({ tableInstance, }: {
|
|
222
|
+
tableInstance: MRT_TableInstance;
|
|
223
|
+
}) => TableContainerProps);
|
|
224
|
+
muiTableDetailPanelProps?: TableCellProps | (({ tableInstance, row, }: {
|
|
225
|
+
tableInstance: MRT_TableInstance;
|
|
226
|
+
row: MRT_Row<D>;
|
|
227
|
+
}) => TableCellProps);
|
|
228
|
+
muiTableFooterCellProps?: TableCellProps | (({ tableInstance, column, }: {
|
|
229
|
+
tableInstance: MRT_TableInstance;
|
|
230
|
+
column: MRT_ColumnInstance<D>;
|
|
231
|
+
}) => TableCellProps);
|
|
232
|
+
muiTableFooterProps?: TableFooterProps | (({ tableInstance, }: {
|
|
233
|
+
tableInstance: MRT_TableInstance;
|
|
234
|
+
}) => TableFooterProps);
|
|
235
|
+
muiTableFooterRowProps?: TableRowProps | (({ tableInstance, footerGroup, }: {
|
|
236
|
+
tableInstance: MRT_TableInstance;
|
|
237
|
+
footerGroup: MRT_HeaderGroup<D>;
|
|
238
|
+
}) => TableRowProps);
|
|
239
|
+
muiTableHeadCellColumnActionsButtonProps?: IconButtonProps | (({ tableInstance, column, }: {
|
|
240
|
+
tableInstance: MRT_TableInstance;
|
|
241
|
+
column: MRT_ColumnInstance<D>;
|
|
242
|
+
}) => IconButtonProps);
|
|
243
|
+
muiTableHeadCellFilterTextFieldProps?: TextFieldProps | (({ tableInstance, column, }: {
|
|
244
|
+
tableInstance: MRT_TableInstance;
|
|
245
|
+
column: MRT_ColumnInstance<D>;
|
|
246
|
+
}) => TextFieldProps);
|
|
247
|
+
muiTableHeadCellProps?: TableCellProps | (({ tableInstance, column, }: {
|
|
248
|
+
tableInstance: MRT_TableInstance;
|
|
249
|
+
column: MRT_ColumnInstance<D>;
|
|
250
|
+
}) => TableCellProps);
|
|
251
|
+
muiTableHeadProps?: TableHeadProps | (({ tableInstance, }: {
|
|
252
|
+
tableInstance: MRT_TableInstance;
|
|
253
|
+
}) => TableHeadProps);
|
|
254
|
+
muiTableHeadRowProps?: TableRowProps | (({ tableInstance, headerGroup, }: {
|
|
255
|
+
tableInstance: MRT_TableInstance;
|
|
256
|
+
headerGroup: MRT_HeaderGroup<D>;
|
|
257
|
+
}) => TableRowProps);
|
|
258
|
+
muiTablePaperProps?: PaperProps | (({ tableInstance, }: {
|
|
259
|
+
tableInstance: MRT_TableInstance;
|
|
260
|
+
}) => PaperProps);
|
|
261
|
+
muiTablePaginationProps?: Partial<TablePaginationProps> | (({ tableInstance, }: {
|
|
262
|
+
tableInstance: MRT_TableInstance;
|
|
263
|
+
}) => Partial<TablePaginationProps>);
|
|
264
|
+
muiTableProps?: TableProps | (({ tableInstance, }: {
|
|
265
|
+
tableInstance: MRT_TableInstance;
|
|
266
|
+
}) => TableProps);
|
|
267
|
+
muiTableToolbarAlertBannerProps?: AlertProps | (({ tableInstance, }: {
|
|
268
|
+
tableInstance: MRT_TableInstance;
|
|
269
|
+
}) => AlertProps);
|
|
270
|
+
muiTableToolbarBottomProps?: ToolbarProps | (({ tableInstance, }: {
|
|
271
|
+
tableInstance: MRT_TableInstance;
|
|
272
|
+
}) => ToolbarProps);
|
|
273
|
+
muiTableToolbarTopProps?: ToolbarProps | (({ tableInstance, }: {
|
|
274
|
+
tableInstance: MRT_TableInstance;
|
|
275
|
+
}) => ToolbarProps);
|
|
276
|
+
onCellClick?: ({ cell, event, tableInstance, }: {
|
|
277
|
+
cell: MRT_Cell<D>;
|
|
278
|
+
tableInstance: MRT_TableInstance<D>;
|
|
279
|
+
event: MouseEvent<HTMLTableCellElement>;
|
|
280
|
+
}) => void;
|
|
281
|
+
onColumnHide?: ({ column, columnVisibility, tableInstance, }: {
|
|
282
|
+
column: MRT_ColumnInstance<D>;
|
|
283
|
+
columnVisibility: VisibilityState;
|
|
284
|
+
tableInstance: MRT_TableInstance<D>;
|
|
285
|
+
}) => void;
|
|
286
|
+
onDetailPanelClick?: ({ event, row, tableInstance, }: {
|
|
287
|
+
event: MouseEvent<HTMLTableCellElement>;
|
|
288
|
+
row: MRT_Row<D>;
|
|
289
|
+
tableInstance: MRT_TableInstance<D>;
|
|
290
|
+
}) => void;
|
|
291
|
+
onGlobalFilterChange?: ({ event, tableInstance, }: {
|
|
292
|
+
event: ChangeEvent<HTMLInputElement>;
|
|
293
|
+
tableInstance: MRT_TableInstance<D>;
|
|
294
|
+
}) => void;
|
|
295
|
+
onRowClick?: ({ event, row, tableInstance, }: {
|
|
296
|
+
event: MouseEvent<HTMLTableRowElement>;
|
|
297
|
+
row: MRT_Row<D>;
|
|
298
|
+
tableInstance: MRT_TableInstance<D>;
|
|
299
|
+
}) => void;
|
|
300
|
+
onEditSubmit?: ({ row, tableInstance, }: {
|
|
301
|
+
row: MRT_Row<D>;
|
|
302
|
+
tableInstance: MRT_TableInstance<D>;
|
|
303
|
+
}) => Promise<void> | void;
|
|
304
|
+
onRowExpandChange?: ({ event, row, }: {
|
|
305
|
+
event: MouseEvent<HTMLButtonElement>;
|
|
306
|
+
row: MRT_Row<D>;
|
|
307
|
+
tableInstance: MRT_TableInstance<D>;
|
|
308
|
+
}) => void;
|
|
309
|
+
onSelectAllChange?: ({ event, selectedRows, tableInstance, }: {
|
|
310
|
+
event: ChangeEvent;
|
|
311
|
+
selectedRows: MRT_Row<D>[];
|
|
312
|
+
tableInstance: MRT_TableInstance<D>;
|
|
313
|
+
}) => void;
|
|
314
|
+
onSelectChange?: ({ event, row, selectedRows, tableInstance, }: {
|
|
315
|
+
event: ChangeEvent;
|
|
316
|
+
row: MRT_Row<D>;
|
|
317
|
+
selectedRows: MRT_Row<D>[];
|
|
318
|
+
tableInstance: MRT_TableInstance<D>;
|
|
319
|
+
}) => void;
|
|
191
320
|
positionActionsColumn?: 'first' | 'last';
|
|
192
321
|
positionPagination?: 'bottom' | 'top' | 'both';
|
|
193
322
|
positionToolbarActions?: 'bottom' | 'top';
|
|
194
323
|
positionToolbarAlertBanner?: 'bottom' | 'top';
|
|
195
|
-
renderDetailPanel?: (row
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
324
|
+
renderDetailPanel?: ({ row, tableInstance, }: {
|
|
325
|
+
row: MRT_Row<D>;
|
|
326
|
+
tableInstance: MRT_TableInstance<D>;
|
|
327
|
+
}) => ReactNode;
|
|
328
|
+
renderRowActionMenuItems?: ({ closeMenu, row, tableInstance, }: {
|
|
329
|
+
closeMenu: () => void;
|
|
330
|
+
row: MRT_Row<D>;
|
|
331
|
+
tableInstance: MRT_TableInstance<D>;
|
|
332
|
+
}) => ReactNode[];
|
|
333
|
+
renderRowActions?: ({ row, tableInstance, }: {
|
|
334
|
+
row: MRT_Row<D>;
|
|
335
|
+
tableInstance: MRT_TableInstance<D>;
|
|
336
|
+
}) => ReactNode;
|
|
337
|
+
renderToolbarCustomActions?: ({ tableInstance, }: {
|
|
338
|
+
tableInstance: MRT_TableInstance<D>;
|
|
339
|
+
}) => ReactNode;
|
|
340
|
+
renderToolbarInternalActions?: ({ tableInstance, MRT_ToggleSearchButton, MRT_ToggleFiltersButton, MRT_ShowHideColumnsButton, MRT_ToggleDensePaddingButton, MRT_FullScreenToggleButton, }: {
|
|
341
|
+
tableInstance: MRT_TableInstance<D>;
|
|
200
342
|
MRT_ToggleSearchButton: FC<IconButtonProps & {
|
|
201
343
|
tableInstance: MRT_TableInstance<D>;
|
|
202
344
|
}>;
|
|
@@ -214,5 +356,5 @@ export declare type MaterialReactTableProps<D extends Record<string, any> = {}>
|
|
|
214
356
|
}>;
|
|
215
357
|
}) => ReactNode;
|
|
216
358
|
};
|
|
217
|
-
declare const _default: <D extends Record<string, any> = {}>({ enableColumnActions, enableColumnFilters, enableDensePaddingToggle, enableExpandAll, enableFullScreenToggle, enableGlobalFilter, enableHiding, enablePagination, enableSelectAll, enableSorting, enableStickyHeader,
|
|
359
|
+
declare const _default: <D extends Record<string, any> = {}>({ enableColumnActions, enableColumnFilters, enableDensePaddingToggle, enableExpandAll, enableFullScreenToggle, enableGlobalFilter, enableHiding, enablePagination, enableSelectAll, enableSorting, enableStickyHeader, icons, localization, positionActionsColumn, positionPagination, positionToolbarActions, positionToolbarAlertBanner, ...rest }: MaterialReactTableProps<D>) => JSX.Element;
|
|
218
360
|
export default _default;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { FC
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
import { MRT_Cell, MRT_TableInstance } from '..';
|
|
3
3
|
interface Props {
|
|
4
4
|
cell: MRT_Cell;
|
|
5
|
-
children: ReactNode;
|
|
6
5
|
tableInstance: MRT_TableInstance;
|
|
7
6
|
}
|
|
8
7
|
export declare const MRT_CopyButton: FC<Props>;
|