material-react-table 0.40.3 → 0.40.6
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/cjs/MaterialReactTable.d.ts +14 -2
- package/dist/cjs/index.js +64 -49
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/menus/MRT_FilterOptionMenu.d.ts +1 -1
- package/dist/esm/MaterialReactTable.d.ts +14 -2
- package/dist/esm/material-react-table.esm.js +65 -50
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/menus/MRT_FilterOptionMenu.d.ts +1 -1
- package/dist/index.d.ts +14 -2
- package/package.json +1 -1
- package/src/MaterialReactTable.tsx +25 -3
- package/src/body/MRT_TableBody.tsx +9 -7
- package/src/head/MRT_TableHeadCellFilterLabel.tsx +1 -3
- package/src/inputs/MRT_FilterTextField.tsx +11 -3
- package/src/menus/MRT_ColumnActionMenu.tsx +63 -50
- package/src/menus/MRT_FilterOptionMenu.tsx +9 -3
- package/src/table/MRT_TableRoot.tsx +5 -6
|
@@ -4,7 +4,7 @@ import { MRT_Localization } from '../localization';
|
|
|
4
4
|
export declare const mrtFilterOptions: (localization: MRT_Localization) => MRT_InternalFilterOption[];
|
|
5
5
|
interface Props<TData extends Record<string, any> = {}> {
|
|
6
6
|
anchorEl: HTMLElement | null;
|
|
7
|
-
header?: MRT_Header
|
|
7
|
+
header?: MRT_Header<TData>;
|
|
8
8
|
onSelect?: () => void;
|
|
9
9
|
setAnchorEl: (anchorEl: HTMLElement | null) => void;
|
|
10
10
|
table: MRT_TableInstance<TData>;
|
|
@@ -216,9 +216,16 @@ export declare type MRT_ColumnDef<TData extends Record<string, any> = {}> = Omit
|
|
|
216
216
|
table: MRT_TableInstance<TData>;
|
|
217
217
|
column: MRT_Column<TData>;
|
|
218
218
|
}) => TableCellProps);
|
|
219
|
-
|
|
219
|
+
renderColumnActionsMenuItems?: ({ closeMenu, column, table, }: {
|
|
220
|
+
closeMenu: () => void;
|
|
221
|
+
column: MRT_Column<TData>;
|
|
220
222
|
table: MRT_TableInstance<TData>;
|
|
223
|
+
}) => ReactNode[];
|
|
224
|
+
renderColumnFilterModeMenuItems?: ({ column, internalFilterOptions, onSelectFilterMode, table, }: {
|
|
221
225
|
column: MRT_Column<TData>;
|
|
226
|
+
internalFilterOptions: MRT_InternalFilterOption[];
|
|
227
|
+
onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
|
|
228
|
+
table: MRT_TableInstance<TData>;
|
|
222
229
|
}) => ReactNode[];
|
|
223
230
|
sortingFn?: MRT_SortingFn;
|
|
224
231
|
};
|
|
@@ -470,12 +477,17 @@ export declare type MaterialReactTableProps<TData extends Record<string, any> =
|
|
|
470
477
|
renderBottomToolbarCustomActions?: ({ table, }: {
|
|
471
478
|
table: MRT_TableInstance<TData>;
|
|
472
479
|
}) => ReactNode;
|
|
480
|
+
renderColumnActionsMenuItems?: ({ column, closeMenu, table, }: {
|
|
481
|
+
column: MRT_Column<TData>;
|
|
482
|
+
closeMenu: () => void;
|
|
483
|
+
table: MRT_TableInstance<TData>;
|
|
484
|
+
}) => ReactNode[];
|
|
473
485
|
renderColumnFilterModeMenuItems?: ({ column, internalFilterOptions, onSelectFilterMode, table, }: {
|
|
474
486
|
column: MRT_Column<TData>;
|
|
475
487
|
internalFilterOptions: MRT_InternalFilterOption[];
|
|
476
488
|
onSelectFilterMode: (filterMode: MRT_FilterOption) => void;
|
|
477
489
|
table: MRT_TableInstance<TData>;
|
|
478
|
-
}) => ReactNode;
|
|
490
|
+
}) => ReactNode[];
|
|
479
491
|
renderDetailPanel?: ({ row, table, }: {
|
|
480
492
|
row: MRT_Row<TData>;
|
|
481
493
|
table: MRT_TableInstance<TData>;
|
|
@@ -2,7 +2,7 @@ import React, { useMemo, useRef, useState, useCallback, Fragment, useEffect, use
|
|
|
2
2
|
import { aggregationFns, filterFns, sortingFns, useReactTable, getCoreRowModel, getExpandedRowModel, getFacetedRowModel, getFilteredRowModel, getGroupedRowModel, getPaginationRowModel, getSortedRowModel } from '@tanstack/react-table';
|
|
3
3
|
import { ArrowRight, Cancel, CheckBox, ClearAll, Close, DensityLarge, DensityMedium, DensitySmall, DragHandle, DynamicFeed, Edit, ExpandLess, ExpandMore, FilterAlt, FilterAltOff, FilterList, FilterListOff, FullscreenExit, Fullscreen, KeyboardDoubleArrowDown, MoreHoriz, MoreVert, PushPin, RestartAlt, Save, Search, SearchOff, Sort, ViewColumn, VisibilityOff } from '@mui/icons-material';
|
|
4
4
|
import { rankItem, rankings, compareItems } from '@tanstack/match-sorter-utils';
|
|
5
|
-
import { Tooltip, IconButton, Menu, MenuItem, Box, FormControlLabel, Switch, Typography, Button, Divider, ListItemIcon, Checkbox, debounce, Collapse, TextField, InputAdornment, LinearProgress, TablePagination, Chip, Alert, AlertTitle, Fade, alpha, useMediaQuery, Toolbar, lighten,
|
|
5
|
+
import { Tooltip, IconButton, Menu, MenuItem, Box, FormControlLabel, Switch, Typography, Button, Divider, ListItemIcon, Checkbox, debounce, Collapse, TextField, InputAdornment, LinearProgress, TablePagination, Chip, Alert, AlertTitle, Fade, alpha, useMediaQuery, Toolbar, lighten, Grow, TableSortLabel, useTheme, TableCell, TableRow, TableHead, darken, Skeleton, TableBody, TableFooter, Table, TableContainer, Paper, Dialog, DialogTitle, DialogContent, Stack, DialogActions } from '@mui/material';
|
|
6
6
|
import { useVirtual } from 'react-virtual';
|
|
7
7
|
|
|
8
8
|
/******************************************************************************
|
|
@@ -382,7 +382,7 @@ const mrtFilterOptions = (localization) => [
|
|
|
382
382
|
},
|
|
383
383
|
];
|
|
384
384
|
const MRT_FilterOptionMenu = ({ anchorEl, header, onSelect, setAnchorEl, table, }) => {
|
|
385
|
-
var _a, _b;
|
|
385
|
+
var _a, _b, _c, _d;
|
|
386
386
|
const { getState, options: { enabledGlobalFilterOptions, columnFilterModeOptions, localization, renderColumnFilterModeMenuItems, renderGlobalFilterModeMenuItems, }, setColumnFilterFns, setGlobalFilterFn, } = table;
|
|
387
387
|
const { globalFilterFn, density } = getState();
|
|
388
388
|
const { column } = header !== null && header !== void 0 ? header : {};
|
|
@@ -416,8 +416,13 @@ const MRT_FilterOptionMenu = ({ anchorEl, header, onSelect, setAnchorEl, table,
|
|
|
416
416
|
const filterOption = !!header && columnDef ? columnDef._filterFn : globalFilterFn;
|
|
417
417
|
return (React.createElement(Menu, { anchorEl: anchorEl, anchorOrigin: { vertical: 'center', horizontal: 'right' }, onClose: () => setAnchorEl(null), open: !!anchorEl, MenuListProps: {
|
|
418
418
|
dense: density === 'compact',
|
|
419
|
-
} }, (
|
|
420
|
-
? renderColumnFilterModeMenuItems === null ||
|
|
419
|
+
} }, (_d = (header && column && columnDef
|
|
420
|
+
? (_c = (_b = columnDef.renderColumnFilterModeMenuItems) === null || _b === void 0 ? void 0 : _b.call(columnDef, {
|
|
421
|
+
column: column,
|
|
422
|
+
internalFilterOptions,
|
|
423
|
+
onSelectFilterMode: handleSelectFilterMode,
|
|
424
|
+
table,
|
|
425
|
+
})) !== null && _c !== void 0 ? _c : renderColumnFilterModeMenuItems === null || renderColumnFilterModeMenuItems === void 0 ? void 0 : renderColumnFilterModeMenuItems({
|
|
421
426
|
column: column,
|
|
422
427
|
internalFilterOptions,
|
|
423
428
|
onSelectFilterMode: handleSelectFilterMode,
|
|
@@ -427,7 +432,7 @@ const MRT_FilterOptionMenu = ({ anchorEl, header, onSelect, setAnchorEl, table,
|
|
|
427
432
|
internalFilterOptions,
|
|
428
433
|
onSelectFilterMode: handleSelectFilterMode,
|
|
429
434
|
table,
|
|
430
|
-
}))) !== null &&
|
|
435
|
+
}))) !== null && _d !== void 0 ? _d : internalFilterOptions.map(({ option, label, divider, symbol }, index) => (React.createElement(MenuItem, { divider: divider, key: index, onClick: () => handleSelectFilterMode(option), selected: option === filterOption, sx: {
|
|
431
436
|
alignItems: 'center',
|
|
432
437
|
display: 'flex',
|
|
433
438
|
gap: '2ch',
|
|
@@ -723,8 +728,8 @@ const commonListItemStyles = {
|
|
|
723
728
|
alignItems: 'center',
|
|
724
729
|
};
|
|
725
730
|
const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
|
|
726
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
727
|
-
const { getState, toggleAllColumnsVisible, setColumnOrder, options: { enableColumnFilterModes, enableColumnFilters, enableColumnResizing, enableGrouping, enableHiding, enablePinning, enableSorting,
|
|
731
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
732
|
+
const { getState, toggleAllColumnsVisible, setColumnOrder, options: { columnFilterModeOptions, enableColumnFilterModes, enableColumnFilters, enableColumnResizing, enableGrouping, enableHiding, enablePinning, enableSorting, icons: { ArrowRightIcon, ClearAllIcon, ViewColumnIcon, DynamicFeedIcon, FilterListIcon, FilterListOffIcon, PushPinIcon, SortIcon, RestartAltIcon, VisibilityOffIcon, }, localization, renderColumnActionsMenuItems, }, refs: { filterInputRefs }, setShowFilters, } = table;
|
|
728
733
|
const { column } = header;
|
|
729
734
|
const { columnDef } = column;
|
|
730
735
|
const { columnSizing, columnVisibility, density } = getState();
|
|
@@ -789,25 +794,32 @@ const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
|
|
|
789
794
|
!!(allowedColumnFilterOptions === null || allowedColumnFilterOptions === void 0 ? void 0 : allowedColumnFilterOptions.length));
|
|
790
795
|
return (React.createElement(Menu, { anchorEl: anchorEl, open: !!anchorEl, onClose: () => setAnchorEl(null), MenuListProps: {
|
|
791
796
|
dense: density === 'compact',
|
|
792
|
-
} },
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
797
|
+
} }, (_d = (_c = (_b = columnDef.renderColumnActionsMenuItems) === null || _b === void 0 ? void 0 : _b.call(columnDef, {
|
|
798
|
+
closeMenu: () => setAnchorEl(null),
|
|
799
|
+
column,
|
|
800
|
+
table,
|
|
801
|
+
})) !== null && _c !== void 0 ? _c : renderColumnActionsMenuItems === null || renderColumnActionsMenuItems === void 0 ? void 0 : renderColumnActionsMenuItems({
|
|
802
|
+
closeMenu: () => setAnchorEl(null),
|
|
803
|
+
column,
|
|
804
|
+
table,
|
|
805
|
+
})) !== null && _d !== void 0 ? _d : (enableSorting &&
|
|
806
|
+
column.getCanSort() && [
|
|
807
|
+
React.createElement(MenuItem, { disabled: !column.getIsSorted(), key: 0, onClick: handleClearSort, sx: commonMenuItemStyles },
|
|
808
|
+
React.createElement(Box, { sx: commonListItemStyles },
|
|
809
|
+
React.createElement(ListItemIcon, null,
|
|
810
|
+
React.createElement(ClearAllIcon, null)),
|
|
811
|
+
localization.clearSort)),
|
|
812
|
+
React.createElement(MenuItem, { disabled: column.getIsSorted() === 'asc', key: 1, onClick: handleSortAsc, sx: commonMenuItemStyles },
|
|
813
|
+
React.createElement(Box, { sx: commonListItemStyles },
|
|
814
|
+
React.createElement(ListItemIcon, null,
|
|
815
|
+
React.createElement(SortIcon, { style: { transform: 'rotate(180deg) scaleX(-1)' } })), (_e = localization.sortByColumnAsc) === null || _e === void 0 ? void 0 :
|
|
816
|
+
_e.replace('{column}', String(columnDef.header)))),
|
|
817
|
+
React.createElement(MenuItem, { divider: enableColumnFilters || enableGrouping || enableHiding, key: 2, disabled: column.getIsSorted() === 'desc', onClick: handleSortDesc, sx: commonMenuItemStyles },
|
|
818
|
+
React.createElement(Box, { sx: commonListItemStyles },
|
|
819
|
+
React.createElement(ListItemIcon, null,
|
|
820
|
+
React.createElement(SortIcon, null)), (_f = localization.sortByColumnDesc) === null || _f === void 0 ? void 0 :
|
|
821
|
+
_f.replace('{column}', String(columnDef.header)))),
|
|
822
|
+
]),
|
|
811
823
|
enableColumnFilters &&
|
|
812
824
|
column.getCanFilter() &&
|
|
813
825
|
[
|
|
@@ -819,8 +831,8 @@ const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
|
|
|
819
831
|
React.createElement(MenuItem, { divider: enableGrouping || enableHiding, key: 1, onClick: handleFilterByColumn, sx: commonMenuItemStyles },
|
|
820
832
|
React.createElement(Box, { sx: commonListItemStyles },
|
|
821
833
|
React.createElement(ListItemIcon, null,
|
|
822
|
-
React.createElement(FilterListIcon, null)), (
|
|
823
|
-
|
|
834
|
+
React.createElement(FilterListIcon, null)), (_g = localization.filterByColumn) === null || _g === void 0 ? void 0 :
|
|
835
|
+
_g.replace('{column}', String(columnDef.header))),
|
|
824
836
|
showFilterModeSubMenu && (React.createElement(IconButton, { onClick: handleOpenFilterModeMenu, onMouseEnter: handleOpenFilterModeMenu, size: "small", sx: { p: 0 } },
|
|
825
837
|
React.createElement(ArrowRightIcon, null)))),
|
|
826
838
|
showFilterModeSubMenu && (React.createElement(MRT_FilterOptionMenu, { anchorEl: filterMenuAnchorEl, header: header, key: 2, onSelect: handleFilterByColumn, setAnchorEl: setFilterMenuAnchorEl, table: table })),
|
|
@@ -830,8 +842,8 @@ const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
|
|
|
830
842
|
React.createElement(MenuItem, { divider: enablePinning, key: 0, onClick: handleGroupByColumn, sx: commonMenuItemStyles },
|
|
831
843
|
React.createElement(Box, { sx: commonListItemStyles },
|
|
832
844
|
React.createElement(ListItemIcon, null,
|
|
833
|
-
React.createElement(DynamicFeedIcon, null)), (
|
|
834
|
-
|
|
845
|
+
React.createElement(DynamicFeedIcon, null)), (_h = localization[column.getIsGrouped() ? 'ungroupByColumn' : 'groupByColumn']) === null || _h === void 0 ? void 0 :
|
|
846
|
+
_h.replace('{column}', String(columnDef.header)))),
|
|
835
847
|
],
|
|
836
848
|
enablePinning &&
|
|
837
849
|
column.getCanPin() && [
|
|
@@ -863,14 +875,14 @@ const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
|
|
|
863
875
|
React.createElement(MenuItem, { disabled: columnDef.enableHiding === false, key: 0, onClick: handleHideColumn, sx: commonMenuItemStyles },
|
|
864
876
|
React.createElement(Box, { sx: commonListItemStyles },
|
|
865
877
|
React.createElement(ListItemIcon, null,
|
|
866
|
-
React.createElement(VisibilityOffIcon, null)), (
|
|
867
|
-
|
|
878
|
+
React.createElement(VisibilityOffIcon, null)), (_j = localization.hideColumn) === null || _j === void 0 ? void 0 :
|
|
879
|
+
_j.replace('{column}', String(columnDef.header)))),
|
|
868
880
|
React.createElement(MenuItem, { disabled: !Object.values(columnVisibility).filter((visible) => !visible)
|
|
869
881
|
.length, key: 1, onClick: handleShowAllColumns, sx: commonMenuItemStyles },
|
|
870
882
|
React.createElement(Box, { sx: commonListItemStyles },
|
|
871
883
|
React.createElement(ListItemIcon, null,
|
|
872
|
-
React.createElement(ViewColumnIcon, null)), (
|
|
873
|
-
|
|
884
|
+
React.createElement(ViewColumnIcon, null)), (_k = localization.showAllColumns) === null || _k === void 0 ? void 0 :
|
|
885
|
+
_k.replace('{column}', String(columnDef.header))),
|
|
874
886
|
React.createElement(IconButton, { onClick: handleOpenShowHideColumnsMenu, onMouseEnter: handleOpenShowHideColumnsMenu, size: "small", sx: { p: 0 } },
|
|
875
887
|
React.createElement(ArrowRightIcon, null))),
|
|
876
888
|
React.createElement(MRT_ShowHideColumnsMenu, { anchorEl: showHideColumnsMenuAnchorEl, isSubMenu: true, key: 2, setAnchorEl: setShowHideColumnsMenuAnchorEl, table: table }),
|
|
@@ -1491,9 +1503,14 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1491
1503
|
value = option.value;
|
|
1492
1504
|
text = option.text;
|
|
1493
1505
|
}
|
|
1494
|
-
return (React.createElement(MenuItem, { key: value,
|
|
1506
|
+
return (React.createElement(MenuItem, { key: value, sx: {
|
|
1507
|
+
display: 'flex',
|
|
1508
|
+
m: 0,
|
|
1509
|
+
alignItems: 'center',
|
|
1510
|
+
gap: '0.5rem',
|
|
1511
|
+
}, value: value },
|
|
1495
1512
|
isMultiSelectFilter && (React.createElement(Checkbox, { checked: ((_a = column.getFilterValue()) !== null && _a !== void 0 ? _a : []).includes(value), sx: { mr: '0.5rem' } })),
|
|
1496
|
-
|
|
1513
|
+
text));
|
|
1497
1514
|
})),
|
|
1498
1515
|
React.createElement(MRT_FilterOptionMenu, { anchorEl: anchorEl, header: header, setAnchorEl: setAnchorEl, table: table })));
|
|
1499
1516
|
};
|
|
@@ -1514,8 +1531,7 @@ const MRT_TableHeadCellFilterContainer = ({ header, table, }) => {
|
|
|
1514
1531
|
|
|
1515
1532
|
const MRT_TableHeadCellFilterLabel = ({ header, table }) => {
|
|
1516
1533
|
var _a, _b, _c;
|
|
1517
|
-
const {
|
|
1518
|
-
const { columnFilterFns } = getState();
|
|
1534
|
+
const { options: { icons: { FilterAltIcon }, localization, }, } = table;
|
|
1519
1535
|
const { column } = header;
|
|
1520
1536
|
const { columnDef } = column;
|
|
1521
1537
|
const isRangeFilter = [
|
|
@@ -1523,7 +1539,7 @@ const MRT_TableHeadCellFilterLabel = ({ header, table }) => {
|
|
|
1523
1539
|
'betweenInclusive',
|
|
1524
1540
|
'inNumberRange',
|
|
1525
1541
|
].includes(columnDef._filterFn);
|
|
1526
|
-
const currentFilterOption =
|
|
1542
|
+
const currentFilterOption = columnDef._filterFn;
|
|
1527
1543
|
const filterTooltip = localization.filteringByColumn
|
|
1528
1544
|
.replace('{column}', String(columnDef.header))
|
|
1529
1545
|
.replace('{filterType}',
|
|
@@ -2122,7 +2138,7 @@ const MRT_TableBodyRow = ({ row, rowIndex, table, virtualRow, }) => {
|
|
|
2122
2138
|
};
|
|
2123
2139
|
|
|
2124
2140
|
const MRT_TableBody = ({ table, tableContainerRef }) => {
|
|
2125
|
-
const { getRowModel, getPrePaginationRowModel, getState, options: { enableGlobalFilterRankedResults, enablePagination, enableRowVirtualization,
|
|
2141
|
+
const { getRowModel, getPrePaginationRowModel, getState, options: { enableGlobalFilterRankedResults, enablePagination, enableRowVirtualization, manualFiltering, manualSorting, muiTableBodyProps, virtualizerInstanceRef, virtualizerProps, }, } = table;
|
|
2126
2142
|
const { globalFilter, pagination, sorting } = getState();
|
|
2127
2143
|
const tableBodyProps = muiTableBodyProps instanceof Function
|
|
2128
2144
|
? muiTableBodyProps({ table })
|
|
@@ -2133,6 +2149,8 @@ const MRT_TableBody = ({ table, tableContainerRef }) => {
|
|
|
2133
2149
|
const rows = useMemo(() => {
|
|
2134
2150
|
if (enableGlobalFilterRankedResults &&
|
|
2135
2151
|
globalFilter &&
|
|
2152
|
+
!manualFiltering &&
|
|
2153
|
+
!manualSorting &&
|
|
2136
2154
|
!Object.values(sorting).some(Boolean)) {
|
|
2137
2155
|
const rankedRows = getPrePaginationRowModel().rows.sort((a, b) => rankGlobalFuzzy(a, b));
|
|
2138
2156
|
if (enablePagination) {
|
|
@@ -2153,11 +2171,9 @@ const MRT_TableBody = ({ table, tableContainerRef }) => {
|
|
|
2153
2171
|
const virtualizer = enableRowVirtualization
|
|
2154
2172
|
? useVirtual(Object.assign({ size: rows.length, parentRef: tableContainerRef, overscan: 15 }, vProps))
|
|
2155
2173
|
: {};
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
}
|
|
2160
|
-
}, [virtualizer]);
|
|
2174
|
+
if (virtualizerInstanceRef) {
|
|
2175
|
+
virtualizerInstanceRef.current = virtualizer;
|
|
2176
|
+
}
|
|
2161
2177
|
// const virtualizer: Virtualizer = enableRowVirtualization
|
|
2162
2178
|
// ? useVirtualizer({
|
|
2163
2179
|
// count: rows.length,
|
|
@@ -2407,6 +2423,7 @@ const MRT_TableRoot = (props) => {
|
|
|
2407
2423
|
props.displayColumnDefOptions,
|
|
2408
2424
|
props.editingMode,
|
|
2409
2425
|
props.enableColumnDragging,
|
|
2426
|
+
props.enableColumnFilterModes,
|
|
2410
2427
|
props.enableColumnOrdering,
|
|
2411
2428
|
props.enableEditing,
|
|
2412
2429
|
props.enableExpandAll,
|
|
@@ -2464,11 +2481,9 @@ const MRT_TableRoot = (props) => {
|
|
|
2464
2481
|
tableContainerRef,
|
|
2465
2482
|
topToolbarRef,
|
|
2466
2483
|
}, setColumnFilterFns: (_w = props.onFilterFnsChange) !== null && _w !== void 0 ? _w : setColumnFilterFns, setDensity: (_x = props.onDensityChange) !== null && _x !== void 0 ? _x : setDensity, setDraggingColumn: (_y = props.onDraggingColumnChange) !== null && _y !== void 0 ? _y : setDraggingColumn, setDraggingRow: (_z = props.onDraggingRowChange) !== null && _z !== void 0 ? _z : setDraggingRow, setEditingCell: (_0 = props.onEditingCellChange) !== null && _0 !== void 0 ? _0 : setEditingCell, setEditingRow: (_1 = props.onEditingRowChange) !== null && _1 !== void 0 ? _1 : setEditingRow, setGlobalFilterFn: (_2 = props.onGlobalFilterFnChange) !== null && _2 !== void 0 ? _2 : setGlobalFilterFn, setHoveredColumn: (_3 = props.onHoveredColumnChange) !== null && _3 !== void 0 ? _3 : setHoveredColumn, setHoveredRow: (_4 = props.onHoveredRowChange) !== null && _4 !== void 0 ? _4 : setHoveredRow, setIsFullScreen: (_5 = props.onIsFullScreenChange) !== null && _5 !== void 0 ? _5 : setIsFullScreen, setShowAlertBanner: (_6 = props.onShowAlertBannerChange) !== null && _6 !== void 0 ? _6 : setShowAlertBanner, setShowFilters: (_7 = props.onShowFiltersChange) !== null && _7 !== void 0 ? _7 : setShowFilters, setShowGlobalFilter: (_8 = props.onShowGlobalFilterChange) !== null && _8 !== void 0 ? _8 : setShowGlobalFilter });
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
}
|
|
2471
|
-
}, [table]);
|
|
2484
|
+
if (props.tableInstanceRef) {
|
|
2485
|
+
props.tableInstanceRef.current = table;
|
|
2486
|
+
}
|
|
2472
2487
|
return (React.createElement(React.Fragment, null,
|
|
2473
2488
|
React.createElement(Dialog, { PaperComponent: Box, TransitionComponent: Grow, disablePortal: true, fullScreen: true, keepMounted: false, onClose: () => setIsFullScreen(false), open: isFullScreen, transitionDuration: 400 },
|
|
2474
2489
|
React.createElement(MRT_TablePaper, { table: table })),
|