material-react-table 0.13.1 → 0.14.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/README.md +9 -5
- package/dist/MaterialReactTable.d.ts +50 -39
- package/dist/material-react-table.cjs.development.js +137 -110
- 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 +137 -110
- package/dist/material-react-table.esm.js.map +1 -1
- package/dist/toolbar/MRT_TablePagination.d.ts +1 -0
- package/dist/toolbar/MRT_ToolbarTop.d.ts +0 -1
- package/dist/utils.d.ts +5 -2
- package/package.json +3 -3
- package/src/MaterialReactTable.tsx +60 -40
- package/src/buttons/MRT_ExpandAllButton.tsx +8 -0
- package/src/buttons/MRT_ExpandButton.tsx +8 -0
- package/src/inputs/MRT_SearchTextField.tsx +8 -11
- package/src/inputs/MRT_SelectCheckbox.tsx +14 -5
- package/src/menus/MRT_ShowHideColumnsMenu.tsx +8 -1
- package/src/table/MRT_TableRoot.tsx +16 -43
- package/src/toolbar/MRT_TablePagination.tsx +10 -2
- package/src/toolbar/MRT_ToolbarBottom.tsx +21 -18
- package/src/toolbar/MRT_ToolbarInternalButtons.tsx +1 -1
- package/src/toolbar/MRT_ToolbarTop.tsx +18 -15
- package/src/utils.ts +33 -1
package/README.md
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
# Material React Table
|
|
2
2
|
|
|
3
|
-
<a href="https://bundlephobia.com/result?p=material-react-table" target="
|
|
4
|
-
<img alt="" src="https://badgen.net/bundlephobia/minzip/material-react-table" />
|
|
3
|
+
<a href="https://bundlephobia.com/result?p=material-react-table" target="_blank_">
|
|
4
|
+
<img alt="" src="https://badgen.net/bundlephobia/minzip/material-react-table@latest" />
|
|
5
5
|
</a>
|
|
6
6
|
|
|
7
|
-
<a href="https://npmjs.com/package/material-react-table" target="
|
|
7
|
+
<a href="https://npmjs.com/package/material-react-table" target="_blank_">
|
|
8
8
|
<img alt="" src="https://img.shields.io/npm/dm/material-react-table.svg" />
|
|
9
9
|
</a>
|
|
10
10
|
|
|
11
|
+
<a href="https://github.com/KevinVandy/material-react-table" target="_blank_">
|
|
12
|
+
<img alt="" src="https://img.shields.io/github/stars/KevinVandy/material-react-table.svg?style=social&label=Star" />
|
|
13
|
+
</a>
|
|
14
|
+
|
|
11
15
|
> This Project is based on `@tanstack/react-table` v8, which itself is still in beta, so therefore this package is also still in alpha/beta
|
|
12
16
|
|
|
13
17
|
- A fully featured Material UI V5 implementation of Tanstack React Table v8 (beta)
|
|
@@ -46,7 +50,7 @@ _All features can easily be enabled/disabled_
|
|
|
46
50
|
- [x] Filtering and multiple built-in filter modes
|
|
47
51
|
- [x] Full Screen mode
|
|
48
52
|
- [x] Global Filtering (Search across all columns, rank by best match)
|
|
49
|
-
- [x]
|
|
53
|
+
- [x] Header Groups & Footers
|
|
50
54
|
- [x] Localization (i18n) support
|
|
51
55
|
- [x] Manage your own state
|
|
52
56
|
- [x] Pagination (supports client-side and server-side)
|
|
@@ -58,7 +62,7 @@ _All features can easily be enabled/disabled_
|
|
|
58
62
|
- [x] Sorting
|
|
59
63
|
- [x] Theming (Respects your Material UI Theme)
|
|
60
64
|
- [x] Toolbars (Add your own action buttons)
|
|
61
|
-
- [x] Tree Data / Expanding
|
|
65
|
+
- [x] Tree Data / Expanding Sub-rows
|
|
62
66
|
- [x] Virtualization (react-virtual)
|
|
63
67
|
|
|
64
68
|
### Installation
|
|
@@ -106,31 +106,31 @@ export declare type MRT_ColumnDef<D extends Record<string, any> = {}> = Omit<Col
|
|
|
106
106
|
header: string;
|
|
107
107
|
id: keyof D | string;
|
|
108
108
|
muiTableBodyCellCopyButtonProps?: ButtonProps | (({ instance, cell, }: {
|
|
109
|
-
instance: MRT_TableInstance
|
|
109
|
+
instance: MRT_TableInstance<D>;
|
|
110
110
|
cell: MRT_Cell<D>;
|
|
111
111
|
}) => ButtonProps);
|
|
112
112
|
muiTableBodyCellEditTextFieldProps?: TextFieldProps | (({ instance, cell, }: {
|
|
113
|
-
instance: MRT_TableInstance
|
|
113
|
+
instance: MRT_TableInstance<D>;
|
|
114
114
|
cell: MRT_Cell<D>;
|
|
115
115
|
}) => TextFieldProps);
|
|
116
116
|
muiTableBodyCellProps?: TableCellProps | (({ instance, cell, }: {
|
|
117
|
-
instance: MRT_TableInstance
|
|
117
|
+
instance: MRT_TableInstance<D>;
|
|
118
118
|
cell: MRT_Cell<D>;
|
|
119
119
|
}) => TableCellProps);
|
|
120
120
|
muiTableFooterCellProps?: TableCellProps | (({ instance, column, }: {
|
|
121
|
-
instance: MRT_TableInstance
|
|
121
|
+
instance: MRT_TableInstance<D>;
|
|
122
122
|
column: MRT_Column<D>;
|
|
123
123
|
}) => TableCellProps);
|
|
124
124
|
muiTableHeadCellColumnActionsButtonProps?: IconButtonProps | (({ instance, column, }: {
|
|
125
|
-
instance: MRT_TableInstance
|
|
125
|
+
instance: MRT_TableInstance<D>;
|
|
126
126
|
column: MRT_Column<D>;
|
|
127
127
|
}) => IconButtonProps);
|
|
128
128
|
muiTableHeadCellFilterTextFieldProps?: TextFieldProps | (({ instance, column, }: {
|
|
129
|
-
instance: MRT_TableInstance
|
|
129
|
+
instance: MRT_TableInstance<D>;
|
|
130
130
|
column: MRT_Column<D>;
|
|
131
131
|
}) => TextFieldProps);
|
|
132
132
|
muiTableHeadCellProps?: TableCellProps | (({ instance, column, }: {
|
|
133
|
-
instance: MRT_TableInstance
|
|
133
|
+
instance: MRT_TableInstance<D>;
|
|
134
134
|
column: MRT_Column<D>;
|
|
135
135
|
}) => TableCellProps);
|
|
136
136
|
onCellEditBlur?: ({ cell, event, instance, }: {
|
|
@@ -206,94 +206,103 @@ export declare type MaterialReactTableProps<D extends Record<string, any> = {}>
|
|
|
206
206
|
enabledGlobalFilterOptions?: (MRT_FILTER_OPTION | string)[] | null;
|
|
207
207
|
icons?: Partial<MRT_Icons>;
|
|
208
208
|
localization?: Partial<MRT_Localization>;
|
|
209
|
+
muiExpandAllButtonProps?: IconButtonProps | (({ instance }: {
|
|
210
|
+
instance: MRT_TableInstance<D>;
|
|
211
|
+
}) => IconButtonProps);
|
|
212
|
+
muiExpandButtonProps?: IconButtonProps | (({ instance, }: {
|
|
213
|
+
instance: MRT_TableInstance<D>;
|
|
214
|
+
row: MRT_Row<D>;
|
|
215
|
+
}) => IconButtonProps);
|
|
209
216
|
muiLinearProgressProps?: LinearProgressProps | (({ instance, }: {
|
|
210
|
-
instance: MRT_TableInstance
|
|
217
|
+
instance: MRT_TableInstance<D>;
|
|
211
218
|
}) => LinearProgressProps);
|
|
212
219
|
muiSearchTextFieldProps?: TextFieldProps | (({ instance }: {
|
|
213
|
-
instance: MRT_TableInstance
|
|
220
|
+
instance: MRT_TableInstance<D>;
|
|
214
221
|
}) => TextFieldProps);
|
|
215
|
-
|
|
216
|
-
instance: MRT_TableInstance
|
|
217
|
-
|
|
218
|
-
|
|
222
|
+
muiSelectAllCheckboxProps?: CheckboxProps | (({ instance }: {
|
|
223
|
+
instance: MRT_TableInstance<D>;
|
|
224
|
+
}) => CheckboxProps);
|
|
225
|
+
muiSelectCheckboxProps?: CheckboxProps | (({ instance, row, }: {
|
|
226
|
+
instance: MRT_TableInstance<D>;
|
|
227
|
+
row: MRT_Row<D>;
|
|
219
228
|
}) => CheckboxProps);
|
|
220
229
|
muiTableBodyCellCopyButtonProps?: ButtonProps | (({ instance, cell, }: {
|
|
221
|
-
instance: MRT_TableInstance
|
|
230
|
+
instance: MRT_TableInstance<D>;
|
|
222
231
|
cell: MRT_Cell<D>;
|
|
223
232
|
}) => ButtonProps);
|
|
224
233
|
muiTableBodyCellEditTextFieldProps?: TextFieldProps | (({ instance, cell, }: {
|
|
225
|
-
instance: MRT_TableInstance
|
|
234
|
+
instance: MRT_TableInstance<D>;
|
|
226
235
|
cell: MRT_Cell<D>;
|
|
227
236
|
}) => TextFieldProps);
|
|
228
237
|
muiTableBodyCellProps?: TableCellProps | (({ instance, cell, }: {
|
|
229
|
-
instance: MRT_TableInstance
|
|
238
|
+
instance: MRT_TableInstance<D>;
|
|
230
239
|
cell: MRT_Cell<D>;
|
|
231
240
|
}) => TableCellProps);
|
|
232
241
|
muiTableBodyCellSkeletonProps?: SkeletonProps | (({ instance, cell, }: {
|
|
233
|
-
instance: MRT_TableInstance
|
|
242
|
+
instance: MRT_TableInstance<D>;
|
|
234
243
|
cell: MRT_Cell<D>;
|
|
235
244
|
}) => SkeletonProps);
|
|
236
245
|
muiTableBodyProps?: TableBodyProps | (({ instance }: {
|
|
237
|
-
instance: MRT_TableInstance
|
|
246
|
+
instance: MRT_TableInstance<D>;
|
|
238
247
|
}) => TableBodyProps);
|
|
239
248
|
muiTableBodyRowProps?: TableRowProps | (({ instance, row, }: {
|
|
240
|
-
instance: MRT_TableInstance
|
|
249
|
+
instance: MRT_TableInstance<D>;
|
|
241
250
|
row: MRT_Row<D>;
|
|
242
251
|
}) => TableRowProps);
|
|
243
252
|
muiTableContainerProps?: TableContainerProps | (({ instance, }: {
|
|
244
|
-
instance: MRT_TableInstance
|
|
253
|
+
instance: MRT_TableInstance<D>;
|
|
245
254
|
}) => TableContainerProps);
|
|
246
255
|
muiTableDetailPanelProps?: TableCellProps | (({ instance, row, }: {
|
|
247
|
-
instance: MRT_TableInstance
|
|
256
|
+
instance: MRT_TableInstance<D>;
|
|
248
257
|
row: MRT_Row<D>;
|
|
249
258
|
}) => TableCellProps);
|
|
250
259
|
muiTableFooterCellProps?: TableCellProps | (({ instance, column, }: {
|
|
251
|
-
instance: MRT_TableInstance
|
|
260
|
+
instance: MRT_TableInstance<D>;
|
|
252
261
|
column: MRT_Column<D>;
|
|
253
262
|
}) => TableCellProps);
|
|
254
|
-
muiTableFooterProps?: TableFooterProps | (({ instance }: {
|
|
255
|
-
instance: MRT_TableInstance
|
|
263
|
+
muiTableFooterProps?: TableFooterProps | (({ instance, }: {
|
|
264
|
+
instance: MRT_TableInstance<D>;
|
|
256
265
|
}) => TableFooterProps);
|
|
257
266
|
muiTableFooterRowProps?: TableRowProps | (({ instance, footerGroup, }: {
|
|
258
|
-
instance: MRT_TableInstance
|
|
267
|
+
instance: MRT_TableInstance<D>;
|
|
259
268
|
footerGroup: MRT_HeaderGroup<D>;
|
|
260
269
|
}) => TableRowProps);
|
|
261
270
|
muiTableHeadCellColumnActionsButtonProps?: IconButtonProps | (({ instance, column, }: {
|
|
262
|
-
instance: MRT_TableInstance
|
|
271
|
+
instance: MRT_TableInstance<D>;
|
|
263
272
|
column: MRT_Column<D>;
|
|
264
273
|
}) => IconButtonProps);
|
|
265
274
|
muiTableHeadCellFilterTextFieldProps?: TextFieldProps | (({ instance, column, }: {
|
|
266
|
-
instance: MRT_TableInstance
|
|
275
|
+
instance: MRT_TableInstance<D>;
|
|
267
276
|
column: MRT_Column<D>;
|
|
268
277
|
}) => TextFieldProps);
|
|
269
278
|
muiTableHeadCellProps?: TableCellProps | (({ instance, column, }: {
|
|
270
|
-
instance: MRT_TableInstance
|
|
279
|
+
instance: MRT_TableInstance<D>;
|
|
271
280
|
column: MRT_Column<D>;
|
|
272
281
|
}) => TableCellProps);
|
|
273
282
|
muiTableHeadProps?: TableHeadProps | (({ instance }: {
|
|
274
|
-
instance: MRT_TableInstance
|
|
283
|
+
instance: MRT_TableInstance<D>;
|
|
275
284
|
}) => TableHeadProps);
|
|
276
285
|
muiTableHeadRowProps?: TableRowProps | (({ instance, headerGroup, }: {
|
|
277
|
-
instance: MRT_TableInstance
|
|
286
|
+
instance: MRT_TableInstance<D>;
|
|
278
287
|
headerGroup: MRT_HeaderGroup<D>;
|
|
279
288
|
}) => TableRowProps);
|
|
280
289
|
muiTablePaginationProps?: Partial<TablePaginationProps> | (({ instance, }: {
|
|
281
|
-
instance: MRT_TableInstance
|
|
290
|
+
instance: MRT_TableInstance<D>;
|
|
282
291
|
}) => Partial<TablePaginationProps>);
|
|
283
292
|
muiTablePaperProps?: PaperProps | (({ instance }: {
|
|
284
|
-
instance: MRT_TableInstance
|
|
293
|
+
instance: MRT_TableInstance<D>;
|
|
285
294
|
}) => PaperProps);
|
|
286
295
|
muiTableProps?: TableProps | (({ instance }: {
|
|
287
|
-
instance: MRT_TableInstance
|
|
296
|
+
instance: MRT_TableInstance<D>;
|
|
288
297
|
}) => TableProps);
|
|
289
298
|
muiTableToolbarAlertBannerProps?: AlertProps | (({ instance }: {
|
|
290
|
-
instance: MRT_TableInstance
|
|
299
|
+
instance: MRT_TableInstance<D>;
|
|
291
300
|
}) => AlertProps);
|
|
292
301
|
muiTableToolbarBottomProps?: ToolbarProps | (({ instance }: {
|
|
293
|
-
instance: MRT_TableInstance
|
|
302
|
+
instance: MRT_TableInstance<D>;
|
|
294
303
|
}) => ToolbarProps);
|
|
295
304
|
muiTableToolbarTopProps?: ToolbarProps | (({ instance }: {
|
|
296
|
-
instance: MRT_TableInstance
|
|
305
|
+
instance: MRT_TableInstance<D>;
|
|
297
306
|
}) => ToolbarProps);
|
|
298
307
|
onCellClick?: ({ cell, event, instance, }: {
|
|
299
308
|
cell: MRT_Cell<D>;
|
|
@@ -399,7 +408,6 @@ export declare type MaterialReactTableProps<D extends Record<string, any> = {}>
|
|
|
399
408
|
positionActionsColumn?: 'first' | 'last';
|
|
400
409
|
positionGlobalFilter?: 'left' | 'right';
|
|
401
410
|
positionPagination?: 'bottom' | 'top' | 'both';
|
|
402
|
-
positionToolbarActions?: 'bottom' | 'top';
|
|
403
411
|
positionToolbarAlertBanner?: 'bottom' | 'top';
|
|
404
412
|
renderDetailPanel?: ({ row, instance, }: {
|
|
405
413
|
row: MRT_Row<D>;
|
|
@@ -414,7 +422,10 @@ export declare type MaterialReactTableProps<D extends Record<string, any> = {}>
|
|
|
414
422
|
row: MRT_Row<D>;
|
|
415
423
|
instance: MRT_TableInstance<D>;
|
|
416
424
|
}) => ReactNode;
|
|
417
|
-
|
|
425
|
+
renderToolbarBottomCustomActions?: ({ instance, }: {
|
|
426
|
+
instance: MRT_TableInstance<D>;
|
|
427
|
+
}) => ReactNode;
|
|
428
|
+
renderToolbarTopCustomActions?: ({ instance, }: {
|
|
418
429
|
instance: MRT_TableInstance<D>;
|
|
419
430
|
}) => ReactNode;
|
|
420
431
|
renderToolbarInternalActions?: ({ instance, MRT_ToggleGlobalFilterButton, MRT_ToggleFiltersButton, MRT_ShowHideColumnsButton, MRT_ToggleDensePaddingButton, MRT_FullScreenToggleButton, }: {
|
|
@@ -440,5 +451,5 @@ export declare type MaterialReactTableProps<D extends Record<string, any> = {}>
|
|
|
440
451
|
tableId?: string;
|
|
441
452
|
virtualizerProps?: VirtualizerOptions<HTMLDivElement>;
|
|
442
453
|
};
|
|
443
|
-
declare const _default: <D extends Record<string, any> = {}>({ autoResetExpanded, columnResizeMode, defaultColumn, editingMode, enableColumnActions, enableColumnFilters, enableColumnOrdering, enableColumnResizing, enableDensityToggle, enableExpandAll, enableFilters, enableFullScreenToggle, enableGlobalFilter, enableGrouping, enableHiding, enableMultiRowSelection, enablePagination, enablePinning, enableSelectAll, enableSorting, enableStickyHeader, enableTableFooter, enableTableHead, enableToolbarBottom, enableToolbarInternalActions, enableToolbarTop, icons, localization, persistentStateMode, positionActionsColumn,
|
|
454
|
+
declare const _default: <D extends Record<string, any> = {}>({ autoResetExpanded, columnResizeMode, defaultColumn, editingMode, enableColumnActions, enableColumnFilters, enableColumnOrdering, enableColumnResizing, enableDensityToggle, enableExpandAll, enableFilters, enableFullScreenToggle, enableGlobalFilter, enableGrouping, enableHiding, enableMultiRowSelection, enablePagination, enablePinning, enableRowSelection, enableSelectAll, enableSorting, enableStickyHeader, enableTableFooter, enableTableHead, enableToolbarBottom, enableToolbarInternalActions, enableToolbarTop, icons, localization, persistentStateMode, positionActionsColumn, positionGlobalFilter, positionPagination, positionToolbarAlertBanner, rowNumberMode, selectAllMode, ...rest }: MaterialReactTableProps<D>) => JSX.Element;
|
|
444
455
|
export default _default;
|