material-react-table 1.3.0-beta.1 → 1.3.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/cjs/index.js +419 -343
- package/dist/cjs/index.js.map +1 -1
- package/locales/cs.js +2 -0
- package/locales/cs.js.map +1 -1
- package/locales/de.js +2 -0
- package/locales/de.js.map +1 -1
- package/locales/en.js +2 -0
- package/locales/en.js.map +1 -1
- package/locales/es.js +2 -0
- package/locales/es.js.map +1 -1
- package/locales/it.js +2 -0
- package/locales/it.js.map +1 -1
- package/locales/ja.js +2 -0
- package/locales/ja.js.map +1 -1
- package/locales/pl.js +2 -0
- package/locales/pl.js.map +1 -1
- package/locales/pt-BR.js +2 -0
- package/locales/pt-BR.js.map +1 -1
- package/locales/ru.js +2 -0
- package/locales/ru.js.map +1 -1
- package/package.json +7 -7
package/dist/cjs/index.js
CHANGED
|
@@ -80,6 +80,82 @@ var DialogContent = require('@mui/material/DialogContent');
|
|
|
80
80
|
var DialogTitle = require('@mui/material/DialogTitle');
|
|
81
81
|
var Stack = require('@mui/material/Stack');
|
|
82
82
|
|
|
83
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
84
|
+
|
|
85
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
86
|
+
var ArrowDownwardIcon__default = /*#__PURE__*/_interopDefaultLegacy(ArrowDownwardIcon);
|
|
87
|
+
var ArrowRightIcon__default = /*#__PURE__*/_interopDefaultLegacy(ArrowRightIcon);
|
|
88
|
+
var CancelIcon__default = /*#__PURE__*/_interopDefaultLegacy(CancelIcon);
|
|
89
|
+
var CheckBoxIcon__default = /*#__PURE__*/_interopDefaultLegacy(CheckBoxIcon);
|
|
90
|
+
var ClearAllIcon__default = /*#__PURE__*/_interopDefaultLegacy(ClearAllIcon);
|
|
91
|
+
var CloseIcon__default = /*#__PURE__*/_interopDefaultLegacy(CloseIcon);
|
|
92
|
+
var DensityLargeIcon__default = /*#__PURE__*/_interopDefaultLegacy(DensityLargeIcon);
|
|
93
|
+
var DensityMediumIcon__default = /*#__PURE__*/_interopDefaultLegacy(DensityMediumIcon);
|
|
94
|
+
var DensitySmallIcon__default = /*#__PURE__*/_interopDefaultLegacy(DensitySmallIcon);
|
|
95
|
+
var DragHandleIcon__default = /*#__PURE__*/_interopDefaultLegacy(DragHandleIcon);
|
|
96
|
+
var DynamicFeedIcon__default = /*#__PURE__*/_interopDefaultLegacy(DynamicFeedIcon);
|
|
97
|
+
var EditIcon__default = /*#__PURE__*/_interopDefaultLegacy(EditIcon);
|
|
98
|
+
var ExpandLessIcon__default = /*#__PURE__*/_interopDefaultLegacy(ExpandLessIcon);
|
|
99
|
+
var ExpandMoreIcon__default = /*#__PURE__*/_interopDefaultLegacy(ExpandMoreIcon);
|
|
100
|
+
var FilterAltIcon__default = /*#__PURE__*/_interopDefaultLegacy(FilterAltIcon);
|
|
101
|
+
var FilterAltOffIcon__default = /*#__PURE__*/_interopDefaultLegacy(FilterAltOffIcon);
|
|
102
|
+
var FilterListIcon__default = /*#__PURE__*/_interopDefaultLegacy(FilterListIcon);
|
|
103
|
+
var FilterListOffIcon__default = /*#__PURE__*/_interopDefaultLegacy(FilterListOffIcon);
|
|
104
|
+
var FullscreenExitIcon__default = /*#__PURE__*/_interopDefaultLegacy(FullscreenExitIcon);
|
|
105
|
+
var FullscreenIcon__default = /*#__PURE__*/_interopDefaultLegacy(FullscreenIcon);
|
|
106
|
+
var KeyboardDoubleArrowDownIcon__default = /*#__PURE__*/_interopDefaultLegacy(KeyboardDoubleArrowDownIcon);
|
|
107
|
+
var MoreHorizIcon__default = /*#__PURE__*/_interopDefaultLegacy(MoreHorizIcon);
|
|
108
|
+
var MoreVertIcon__default = /*#__PURE__*/_interopDefaultLegacy(MoreVertIcon);
|
|
109
|
+
var PushPinIcon__default = /*#__PURE__*/_interopDefaultLegacy(PushPinIcon);
|
|
110
|
+
var RestartAltIcon__default = /*#__PURE__*/_interopDefaultLegacy(RestartAltIcon);
|
|
111
|
+
var SaveIcon__default = /*#__PURE__*/_interopDefaultLegacy(SaveIcon);
|
|
112
|
+
var SearchIcon__default = /*#__PURE__*/_interopDefaultLegacy(SearchIcon);
|
|
113
|
+
var SearchOffIcon__default = /*#__PURE__*/_interopDefaultLegacy(SearchOffIcon);
|
|
114
|
+
var SortIcon__default = /*#__PURE__*/_interopDefaultLegacy(SortIcon);
|
|
115
|
+
var ViewColumnIcon__default = /*#__PURE__*/_interopDefaultLegacy(ViewColumnIcon);
|
|
116
|
+
var VisibilityOffIcon__default = /*#__PURE__*/_interopDefaultLegacy(VisibilityOffIcon);
|
|
117
|
+
var Box__default = /*#__PURE__*/_interopDefaultLegacy(Box);
|
|
118
|
+
var Dialog__default = /*#__PURE__*/_interopDefaultLegacy(Dialog);
|
|
119
|
+
var Grow__default = /*#__PURE__*/_interopDefaultLegacy(Grow);
|
|
120
|
+
var IconButton__default = /*#__PURE__*/_interopDefaultLegacy(IconButton);
|
|
121
|
+
var Tooltip__default = /*#__PURE__*/_interopDefaultLegacy(Tooltip);
|
|
122
|
+
var ListItemIcon__default = /*#__PURE__*/_interopDefaultLegacy(ListItemIcon);
|
|
123
|
+
var Menu__default = /*#__PURE__*/_interopDefaultLegacy(Menu);
|
|
124
|
+
var MenuItem__default = /*#__PURE__*/_interopDefaultLegacy(MenuItem);
|
|
125
|
+
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
126
|
+
var Divider__default = /*#__PURE__*/_interopDefaultLegacy(Divider);
|
|
127
|
+
var FormControlLabel__default = /*#__PURE__*/_interopDefaultLegacy(FormControlLabel);
|
|
128
|
+
var Switch__default = /*#__PURE__*/_interopDefaultLegacy(Switch);
|
|
129
|
+
var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
|
|
130
|
+
var Checkbox__default = /*#__PURE__*/_interopDefaultLegacy(Checkbox);
|
|
131
|
+
var Radio__default = /*#__PURE__*/_interopDefaultLegacy(Radio);
|
|
132
|
+
var Paper__default = /*#__PURE__*/_interopDefaultLegacy(Paper);
|
|
133
|
+
var Toolbar__default = /*#__PURE__*/_interopDefaultLegacy(Toolbar);
|
|
134
|
+
var useMediaQuery__default = /*#__PURE__*/_interopDefaultLegacy(useMediaQuery);
|
|
135
|
+
var Collapse__default = /*#__PURE__*/_interopDefaultLegacy(Collapse);
|
|
136
|
+
var InputAdornment__default = /*#__PURE__*/_interopDefaultLegacy(InputAdornment);
|
|
137
|
+
var TextField__default = /*#__PURE__*/_interopDefaultLegacy(TextField);
|
|
138
|
+
var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
|
|
139
|
+
var LinearProgress__default = /*#__PURE__*/_interopDefaultLegacy(LinearProgress);
|
|
140
|
+
var TablePagination__default = /*#__PURE__*/_interopDefaultLegacy(TablePagination);
|
|
141
|
+
var Alert__default = /*#__PURE__*/_interopDefaultLegacy(Alert);
|
|
142
|
+
var AlertTitle__default = /*#__PURE__*/_interopDefaultLegacy(AlertTitle);
|
|
143
|
+
var Chip__default = /*#__PURE__*/_interopDefaultLegacy(Chip);
|
|
144
|
+
var Fade__default = /*#__PURE__*/_interopDefaultLegacy(Fade);
|
|
145
|
+
var TableContainer__default = /*#__PURE__*/_interopDefaultLegacy(TableContainer);
|
|
146
|
+
var Table__default = /*#__PURE__*/_interopDefaultLegacy(Table);
|
|
147
|
+
var TableHead__default = /*#__PURE__*/_interopDefaultLegacy(TableHead);
|
|
148
|
+
var TableRow__default = /*#__PURE__*/_interopDefaultLegacy(TableRow);
|
|
149
|
+
var TableCell__default = /*#__PURE__*/_interopDefaultLegacy(TableCell);
|
|
150
|
+
var TableSortLabel__default = /*#__PURE__*/_interopDefaultLegacy(TableSortLabel);
|
|
151
|
+
var TableBody__default = /*#__PURE__*/_interopDefaultLegacy(TableBody);
|
|
152
|
+
var Skeleton__default = /*#__PURE__*/_interopDefaultLegacy(Skeleton);
|
|
153
|
+
var TableFooter__default = /*#__PURE__*/_interopDefaultLegacy(TableFooter);
|
|
154
|
+
var DialogActions__default = /*#__PURE__*/_interopDefaultLegacy(DialogActions);
|
|
155
|
+
var DialogContent__default = /*#__PURE__*/_interopDefaultLegacy(DialogContent);
|
|
156
|
+
var DialogTitle__default = /*#__PURE__*/_interopDefaultLegacy(DialogTitle);
|
|
157
|
+
var Stack__default = /*#__PURE__*/_interopDefaultLegacy(Stack);
|
|
158
|
+
|
|
83
159
|
/******************************************************************************
|
|
84
160
|
Copyright (c) Microsoft Corporation.
|
|
85
161
|
|
|
@@ -362,37 +438,37 @@ const MRT_FilterFns = Object.assign(Object.assign({}, reactTable.filterFns), { b
|
|
|
362
438
|
startsWith });
|
|
363
439
|
|
|
364
440
|
const MRT_Default_Icons = {
|
|
365
|
-
ArrowDownwardIcon,
|
|
366
|
-
ArrowRightIcon,
|
|
367
|
-
CancelIcon,
|
|
368
|
-
CheckBoxIcon,
|
|
369
|
-
ClearAllIcon,
|
|
370
|
-
CloseIcon,
|
|
371
|
-
DensityLargeIcon,
|
|
372
|
-
DensityMediumIcon,
|
|
373
|
-
DensitySmallIcon,
|
|
374
|
-
DragHandleIcon,
|
|
375
|
-
DynamicFeedIcon,
|
|
376
|
-
EditIcon,
|
|
377
|
-
ExpandLessIcon,
|
|
378
|
-
ExpandMoreIcon,
|
|
379
|
-
FilterAltIcon,
|
|
380
|
-
FilterAltOffIcon,
|
|
381
|
-
FilterListIcon,
|
|
382
|
-
FilterListOffIcon,
|
|
383
|
-
FullscreenExitIcon,
|
|
384
|
-
FullscreenIcon,
|
|
385
|
-
KeyboardDoubleArrowDownIcon,
|
|
386
|
-
MoreHorizIcon,
|
|
387
|
-
MoreVertIcon,
|
|
388
|
-
PushPinIcon,
|
|
389
|
-
RestartAltIcon,
|
|
390
|
-
SaveIcon,
|
|
391
|
-
SearchIcon,
|
|
392
|
-
SearchOffIcon,
|
|
393
|
-
SortIcon,
|
|
394
|
-
ViewColumnIcon,
|
|
395
|
-
VisibilityOffIcon,
|
|
441
|
+
ArrowDownwardIcon: ArrowDownwardIcon__default["default"],
|
|
442
|
+
ArrowRightIcon: ArrowRightIcon__default["default"],
|
|
443
|
+
CancelIcon: CancelIcon__default["default"],
|
|
444
|
+
CheckBoxIcon: CheckBoxIcon__default["default"],
|
|
445
|
+
ClearAllIcon: ClearAllIcon__default["default"],
|
|
446
|
+
CloseIcon: CloseIcon__default["default"],
|
|
447
|
+
DensityLargeIcon: DensityLargeIcon__default["default"],
|
|
448
|
+
DensityMediumIcon: DensityMediumIcon__default["default"],
|
|
449
|
+
DensitySmallIcon: DensitySmallIcon__default["default"],
|
|
450
|
+
DragHandleIcon: DragHandleIcon__default["default"],
|
|
451
|
+
DynamicFeedIcon: DynamicFeedIcon__default["default"],
|
|
452
|
+
EditIcon: EditIcon__default["default"],
|
|
453
|
+
ExpandLessIcon: ExpandLessIcon__default["default"],
|
|
454
|
+
ExpandMoreIcon: ExpandMoreIcon__default["default"],
|
|
455
|
+
FilterAltIcon: FilterAltIcon__default["default"],
|
|
456
|
+
FilterAltOffIcon: FilterAltOffIcon__default["default"],
|
|
457
|
+
FilterListIcon: FilterListIcon__default["default"],
|
|
458
|
+
FilterListOffIcon: FilterListOffIcon__default["default"],
|
|
459
|
+
FullscreenExitIcon: FullscreenExitIcon__default["default"],
|
|
460
|
+
FullscreenIcon: FullscreenIcon__default["default"],
|
|
461
|
+
KeyboardDoubleArrowDownIcon: KeyboardDoubleArrowDownIcon__default["default"],
|
|
462
|
+
MoreHorizIcon: MoreHorizIcon__default["default"],
|
|
463
|
+
MoreVertIcon: MoreVertIcon__default["default"],
|
|
464
|
+
PushPinIcon: PushPinIcon__default["default"],
|
|
465
|
+
RestartAltIcon: RestartAltIcon__default["default"],
|
|
466
|
+
SaveIcon: SaveIcon__default["default"],
|
|
467
|
+
SearchIcon: SearchIcon__default["default"],
|
|
468
|
+
SearchOffIcon: SearchOffIcon__default["default"],
|
|
469
|
+
SortIcon: SortIcon__default["default"],
|
|
470
|
+
ViewColumnIcon: ViewColumnIcon__default["default"],
|
|
471
|
+
VisibilityOffIcon: VisibilityOffIcon__default["default"],
|
|
396
472
|
};
|
|
397
473
|
|
|
398
474
|
const fuzzy = (rowA, rowB, columnId) => {
|
|
@@ -416,12 +492,12 @@ const MRT_ExpandAllButton = ({ table }) => {
|
|
|
416
492
|
const iconButtonProps = muiExpandAllButtonProps instanceof Function
|
|
417
493
|
? muiExpandAllButtonProps({ table })
|
|
418
494
|
: muiExpandAllButtonProps;
|
|
419
|
-
return (
|
|
420
|
-
|
|
421
|
-
|
|
495
|
+
return (React__default["default"].createElement(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : localization.expandAll },
|
|
496
|
+
React__default["default"].createElement("span", null,
|
|
497
|
+
React__default["default"].createElement(IconButton__default["default"], Object.assign({ "aria-label": localization.expandAll, disabled: isLoading || (!renderDetailPanel && !getCanSomeRowsExpand()), onClick: () => toggleAllRowsExpanded(!getIsAllRowsExpanded()) }, iconButtonProps, { sx: (theme) => (Object.assign({ height: density === 'compact' ? '1.75rem' : '2.25rem', width: density === 'compact' ? '1.75rem' : '2.25rem', mt: density !== 'compact' ? '-0.25rem' : undefined }, ((iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx) instanceof Function
|
|
422
498
|
? iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx(theme)
|
|
423
499
|
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined }),
|
|
424
|
-
|
|
500
|
+
React__default["default"].createElement(KeyboardDoubleArrowDownIcon, { style: {
|
|
425
501
|
transform: `rotate(${getIsAllRowsExpanded()
|
|
426
502
|
? -180
|
|
427
503
|
: getIsSomeRowsExpanded()
|
|
@@ -444,12 +520,12 @@ const MRT_ExpandButton = ({ row, table }) => {
|
|
|
444
520
|
row.toggleExpanded();
|
|
445
521
|
(_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(iconButtonProps, event);
|
|
446
522
|
};
|
|
447
|
-
return (
|
|
448
|
-
|
|
449
|
-
|
|
523
|
+
return (React__default["default"].createElement(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : localization.expand },
|
|
524
|
+
React__default["default"].createElement("span", null,
|
|
525
|
+
React__default["default"].createElement(IconButton__default["default"], Object.assign({ "aria-label": localization.expand, disabled: !row.getCanExpand() && !renderDetailPanel }, iconButtonProps, { onClick: handleToggleExpand, sx: (theme) => (Object.assign({ height: density === 'compact' ? '1.75rem' : '2.25rem', width: density === 'compact' ? '1.75rem' : '2.25rem' }, ((iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx) instanceof Function
|
|
450
526
|
? iconButtonProps.sx(theme)
|
|
451
527
|
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined }),
|
|
452
|
-
|
|
528
|
+
React__default["default"].createElement(ExpandMoreIcon, { style: {
|
|
453
529
|
transform: `rotate(${!row.getCanExpand() && !renderDetailPanel
|
|
454
530
|
? -90
|
|
455
531
|
: row.getIsExpanded()
|
|
@@ -586,7 +662,7 @@ const MRT_FilterOptionMenu = ({ anchorEl, header, onSelect, setAnchorEl, setFilt
|
|
|
586
662
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect();
|
|
587
663
|
};
|
|
588
664
|
const filterOption = !!header && columnDef ? columnDef._filterFn : globalFilterFn;
|
|
589
|
-
return (
|
|
665
|
+
return (React__default["default"].createElement(Menu__default["default"], { anchorEl: anchorEl, anchorOrigin: { vertical: 'center', horizontal: 'right' }, onClose: () => setAnchorEl(null), open: !!anchorEl, MenuListProps: {
|
|
590
666
|
dense: density === 'compact',
|
|
591
667
|
} }, (_d = (header && column && columnDef
|
|
592
668
|
? (_c = (_b = columnDef.renderColumnFilterModeMenuItems) === null || _b === void 0 ? void 0 : _b.call(columnDef, {
|
|
@@ -604,14 +680,14 @@ const MRT_FilterOptionMenu = ({ anchorEl, header, onSelect, setAnchorEl, setFilt
|
|
|
604
680
|
internalFilterOptions,
|
|
605
681
|
onSelectFilterMode: handleSelectFilterMode,
|
|
606
682
|
table,
|
|
607
|
-
}))) !== null && _d !== void 0 ? _d : internalFilterOptions.map(({ option, label, divider, symbol }, index) => (
|
|
683
|
+
}))) !== null && _d !== void 0 ? _d : internalFilterOptions.map(({ option, label, divider, symbol }, index) => (React__default["default"].createElement(MenuItem__default["default"], { divider: divider, key: index, onClick: () => handleSelectFilterMode(option), selected: option === filterOption, sx: {
|
|
608
684
|
alignItems: 'center',
|
|
609
685
|
display: 'flex',
|
|
610
686
|
gap: '2ch',
|
|
611
687
|
my: 0,
|
|
612
688
|
py: '6px',
|
|
613
689
|
}, value: option },
|
|
614
|
-
|
|
690
|
+
React__default["default"].createElement(Box__default["default"], { sx: { fontSize: '1.25rem', width: '2ch' } }, symbol),
|
|
615
691
|
label)))));
|
|
616
692
|
};
|
|
617
693
|
|
|
@@ -620,17 +696,17 @@ const MRT_ColumnPinningButtons = ({ column, table, }) => {
|
|
|
620
696
|
const handlePinColumn = (pinDirection) => {
|
|
621
697
|
column.pin(pinDirection);
|
|
622
698
|
};
|
|
623
|
-
return (
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
699
|
+
return (React__default["default"].createElement(Box__default["default"], { sx: { minWidth: '70px', textAlign: 'center' } }, column.getIsPinned() ? (React__default["default"].createElement(Tooltip__default["default"], { arrow: true, title: localization.unpin },
|
|
700
|
+
React__default["default"].createElement(IconButton__default["default"], { onClick: () => handlePinColumn(false), size: "small" },
|
|
701
|
+
React__default["default"].createElement(PushPinIcon, null)))) : (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
702
|
+
React__default["default"].createElement(Tooltip__default["default"], { arrow: true, title: localization.pinToLeft },
|
|
703
|
+
React__default["default"].createElement(IconButton__default["default"], { onClick: () => handlePinColumn('left'), size: "small" },
|
|
704
|
+
React__default["default"].createElement(PushPinIcon, { style: {
|
|
629
705
|
transform: 'rotate(90deg)',
|
|
630
706
|
} }))),
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
707
|
+
React__default["default"].createElement(Tooltip__default["default"], { arrow: true, title: localization.pinToRight },
|
|
708
|
+
React__default["default"].createElement(IconButton__default["default"], { onClick: () => handlePinColumn('right'), size: "small" },
|
|
709
|
+
React__default["default"].createElement(PushPinIcon, { style: {
|
|
634
710
|
transform: 'rotate(-90deg)',
|
|
635
711
|
} })))))));
|
|
636
712
|
};
|
|
@@ -638,8 +714,8 @@ const MRT_ColumnPinningButtons = ({ column, table, }) => {
|
|
|
638
714
|
const MRT_GrabHandleButton = ({ iconButtonProps, onDragEnd, onDragStart, table, }) => {
|
|
639
715
|
var _a;
|
|
640
716
|
const { options: { icons: { DragHandleIcon }, localization, }, } = table;
|
|
641
|
-
return (
|
|
642
|
-
|
|
717
|
+
return (React__default["default"].createElement(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : localization.move },
|
|
718
|
+
React__default["default"].createElement(IconButton__default["default"], Object.assign({ disableRipple: true, draggable: "true", size: "small" }, iconButtonProps, { onClick: (e) => {
|
|
643
719
|
var _a;
|
|
644
720
|
e.stopPropagation();
|
|
645
721
|
(_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(iconButtonProps, e);
|
|
@@ -651,7 +727,7 @@ const MRT_GrabHandleButton = ({ iconButtonProps, onDragEnd, onDragStart, table,
|
|
|
651
727
|
} }, ((iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx) instanceof Function
|
|
652
728
|
? iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx(theme)
|
|
653
729
|
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined }),
|
|
654
|
-
|
|
730
|
+
React__default["default"].createElement(DragHandleIcon, null))));
|
|
655
731
|
};
|
|
656
732
|
|
|
657
733
|
const MRT_ShowHideColumnsMenuItems = ({ allColumns, hoveredColumn, setHoveredColumn, column, isSubMenu, table, }) => {
|
|
@@ -692,8 +768,8 @@ const MRT_ShowHideColumnsMenuItems = ({ allColumns, hoveredColumn, setHoveredCol
|
|
|
692
768
|
setHoveredColumn(column);
|
|
693
769
|
}
|
|
694
770
|
};
|
|
695
|
-
return (
|
|
696
|
-
|
|
771
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
772
|
+
React__default["default"].createElement(MenuItem__default["default"], { disableRipple: true, ref: menuItemRef, onDragEnter: handleDragEnter, sx: (theme) => ({
|
|
697
773
|
alignItems: 'center',
|
|
698
774
|
justifyContent: 'flex-start',
|
|
699
775
|
my: 0,
|
|
@@ -706,7 +782,7 @@ const MRT_ShowHideColumnsMenuItems = ({ allColumns, hoveredColumn, setHoveredCol
|
|
|
706
782
|
pl: `${(column.depth + 0.5) * 2}rem`,
|
|
707
783
|
py: '6px',
|
|
708
784
|
}) },
|
|
709
|
-
|
|
785
|
+
React__default["default"].createElement(Box__default["default"], { sx: {
|
|
710
786
|
display: 'flex',
|
|
711
787
|
flexWrap: 'nowrap',
|
|
712
788
|
gap: '8px',
|
|
@@ -715,22 +791,22 @@ const MRT_ShowHideColumnsMenuItems = ({ allColumns, hoveredColumn, setHoveredCol
|
|
|
715
791
|
columnDefType !== 'group' &&
|
|
716
792
|
enableColumnOrdering &&
|
|
717
793
|
!allColumns.some((col) => col.columnDef.columnDefType === 'group') &&
|
|
718
|
-
(columnDef.enableColumnOrdering !== false ? (
|
|
794
|
+
(columnDef.enableColumnOrdering !== false ? (React__default["default"].createElement(MRT_GrabHandleButton, { onDragEnd: handleDragEnd, onDragStart: handleDragStart, table: table })) : (React__default["default"].createElement(Box__default["default"], { sx: { width: '28px' } }))),
|
|
719
795
|
!isSubMenu &&
|
|
720
796
|
enablePinning &&
|
|
721
|
-
(column.getCanPin() ? (
|
|
722
|
-
enableHiding ? (
|
|
797
|
+
(column.getCanPin() ? (React__default["default"].createElement(MRT_ColumnPinningButtons, { column: column, table: table })) : (React__default["default"].createElement(Box__default["default"], { sx: { width: '70px' } }))),
|
|
798
|
+
enableHiding ? (React__default["default"].createElement(FormControlLabel__default["default"], { componentsProps: {
|
|
723
799
|
typography: {
|
|
724
800
|
sx: {
|
|
725
801
|
mb: 0,
|
|
726
802
|
opacity: columnDefType !== 'display' ? 1 : 0.5,
|
|
727
803
|
},
|
|
728
804
|
},
|
|
729
|
-
}, checked: switchChecked, control:
|
|
730
|
-
|
|
805
|
+
}, checked: switchChecked, control: React__default["default"].createElement(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: localization.toggleVisibility },
|
|
806
|
+
React__default["default"].createElement(Switch__default["default"], null)), disabled: (isSubMenu && switchChecked) ||
|
|
731
807
|
!column.getCanHide() ||
|
|
732
|
-
column.getIsGrouped(), label: columnDef.header, onChange: () => handleToggleColumnHidden(column) })) : (
|
|
733
|
-
_a.map((c, i) => (
|
|
808
|
+
column.getIsGrouped(), label: columnDef.header, onChange: () => handleToggleColumnHidden(column) })) : (React__default["default"].createElement(Typography__default["default"], { sx: { alignSelf: 'center' } }, columnDef.header)))), (_a = column.columns) === null || _a === void 0 ? void 0 :
|
|
809
|
+
_a.map((c, i) => (React__default["default"].createElement(MRT_ShowHideColumnsMenuItems, { allColumns: allColumns, column: c, hoveredColumn: hoveredColumn, isSubMenu: isSubMenu, key: `${i}-${c.id}`, setHoveredColumn: setHoveredColumn, table: table })))));
|
|
734
810
|
};
|
|
735
811
|
|
|
736
812
|
const MRT_ShowHideColumnsMenu = ({ anchorEl, isSubMenu, setAnchorEl, table, }) => {
|
|
@@ -761,21 +837,21 @@ const MRT_ShowHideColumnsMenu = ({ anchorEl, isSubMenu, setAnchorEl, table, }) =
|
|
|
761
837
|
getRightLeafColumns(),
|
|
762
838
|
]);
|
|
763
839
|
const [hoveredColumn, setHoveredColumn] = React.useState(null);
|
|
764
|
-
return (
|
|
840
|
+
return (React__default["default"].createElement(Menu__default["default"], { anchorEl: anchorEl, open: !!anchorEl, onClose: () => setAnchorEl(null), MenuListProps: {
|
|
765
841
|
dense: density === 'compact',
|
|
766
842
|
} },
|
|
767
|
-
|
|
843
|
+
React__default["default"].createElement(Box__default["default"], { sx: {
|
|
768
844
|
display: 'flex',
|
|
769
845
|
justifyContent: isSubMenu ? 'center' : 'space-between',
|
|
770
846
|
p: '0.5rem',
|
|
771
847
|
pt: 0,
|
|
772
848
|
} },
|
|
773
|
-
!isSubMenu && (
|
|
774
|
-
!isSubMenu && enableColumnOrdering && (
|
|
775
|
-
!isSubMenu && enablePinning && (
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
allColumns.map((column, index) => (
|
|
849
|
+
!isSubMenu && (React__default["default"].createElement(Button__default["default"], { disabled: !getIsSomeColumnsVisible(), onClick: hideAllColumns }, localization.hideAll)),
|
|
850
|
+
!isSubMenu && enableColumnOrdering && (React__default["default"].createElement(Button__default["default"], { onClick: () => table.setColumnOrder(getDefaultColumnOrderIds(table.options)) }, localization.resetOrder)),
|
|
851
|
+
!isSubMenu && enablePinning && (React__default["default"].createElement(Button__default["default"], { disabled: !getIsSomeColumnsPinned(), onClick: () => table.resetColumnPinning(true) }, localization.unpinAll)),
|
|
852
|
+
React__default["default"].createElement(Button__default["default"], { disabled: getIsAllColumnsVisible(), onClick: () => toggleAllColumnsVisible(true) }, localization.showAll)),
|
|
853
|
+
React__default["default"].createElement(Divider__default["default"], null),
|
|
854
|
+
allColumns.map((column, index) => (React__default["default"].createElement(MRT_ShowHideColumnsMenuItems, { allColumns: allColumns, column: column, hoveredColumn: hoveredColumn, isSubMenu: isSubMenu, key: `${index}-${column.id}`, setHoveredColumn: setHoveredColumn, table: table })))));
|
|
779
855
|
};
|
|
780
856
|
|
|
781
857
|
const commonMenuItemStyles = {
|
|
@@ -853,7 +929,7 @@ const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
|
|
|
853
929
|
!isSelectFilter &&
|
|
854
930
|
(allowedColumnFilterOptions === undefined ||
|
|
855
931
|
!!(allowedColumnFilterOptions === null || allowedColumnFilterOptions === void 0 ? void 0 : allowedColumnFilterOptions.length));
|
|
856
|
-
return (
|
|
932
|
+
return (React__default["default"].createElement(Menu__default["default"], { anchorEl: anchorEl, open: !!anchorEl, onClose: () => setAnchorEl(null), MenuListProps: {
|
|
857
933
|
dense: density === 'compact',
|
|
858
934
|
} }, (_d = (_c = (_b = columnDef.renderColumnActionsMenuItems) === null || _b === void 0 ? void 0 : _b.call(columnDef, {
|
|
859
935
|
closeMenu: () => setAnchorEl(null),
|
|
@@ -865,101 +941,101 @@ const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
|
|
|
865
941
|
table,
|
|
866
942
|
})) !== null && _d !== void 0 ? _d : (enableSorting &&
|
|
867
943
|
column.getCanSort() && [
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
944
|
+
React__default["default"].createElement(MenuItem__default["default"], { disabled: !column.getIsSorted(), key: 0, onClick: handleClearSort, sx: commonMenuItemStyles },
|
|
945
|
+
React__default["default"].createElement(Box__default["default"], { sx: commonListItemStyles },
|
|
946
|
+
React__default["default"].createElement(ListItemIcon__default["default"], null,
|
|
947
|
+
React__default["default"].createElement(ClearAllIcon, null)),
|
|
872
948
|
localization.clearSort)),
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
949
|
+
React__default["default"].createElement(MenuItem__default["default"], { disabled: column.getIsSorted() === 'asc', key: 1, onClick: handleSortAsc, sx: commonMenuItemStyles },
|
|
950
|
+
React__default["default"].createElement(Box__default["default"], { sx: commonListItemStyles },
|
|
951
|
+
React__default["default"].createElement(ListItemIcon__default["default"], null,
|
|
952
|
+
React__default["default"].createElement(SortIcon, { style: { transform: 'rotate(180deg) scaleX(-1)' } })), (_e = localization.sortByColumnAsc) === null || _e === void 0 ? void 0 :
|
|
877
953
|
_e.replace('{column}', String(columnDef.header)))),
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
954
|
+
React__default["default"].createElement(MenuItem__default["default"], { divider: enableColumnFilters || enableGrouping || enableHiding, key: 2, disabled: column.getIsSorted() === 'desc', onClick: handleSortDesc, sx: commonMenuItemStyles },
|
|
955
|
+
React__default["default"].createElement(Box__default["default"], { sx: commonListItemStyles },
|
|
956
|
+
React__default["default"].createElement(ListItemIcon__default["default"], null,
|
|
957
|
+
React__default["default"].createElement(SortIcon, null)), (_f = localization.sortByColumnDesc) === null || _f === void 0 ? void 0 :
|
|
882
958
|
_f.replace('{column}', String(columnDef.header)))),
|
|
883
959
|
]),
|
|
884
960
|
enableColumnFilters &&
|
|
885
961
|
column.getCanFilter() &&
|
|
886
962
|
[
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
963
|
+
React__default["default"].createElement(MenuItem__default["default"], { disabled: !column.getFilterValue(), key: 0, onClick: handleClearFilter, sx: commonMenuItemStyles },
|
|
964
|
+
React__default["default"].createElement(Box__default["default"], { sx: commonListItemStyles },
|
|
965
|
+
React__default["default"].createElement(ListItemIcon__default["default"], null,
|
|
966
|
+
React__default["default"].createElement(FilterListOffIcon, null)),
|
|
891
967
|
localization.clearFilter)),
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
968
|
+
React__default["default"].createElement(MenuItem__default["default"], { divider: enableGrouping || enableHiding, key: 1, onClick: handleFilterByColumn, sx: commonMenuItemStyles },
|
|
969
|
+
React__default["default"].createElement(Box__default["default"], { sx: commonListItemStyles },
|
|
970
|
+
React__default["default"].createElement(ListItemIcon__default["default"], null,
|
|
971
|
+
React__default["default"].createElement(FilterListIcon, null)), (_g = localization.filterByColumn) === null || _g === void 0 ? void 0 :
|
|
896
972
|
_g.replace('{column}', String(columnDef.header))),
|
|
897
|
-
showFilterModeSubMenu && (
|
|
898
|
-
|
|
899
|
-
showFilterModeSubMenu && (
|
|
973
|
+
showFilterModeSubMenu && (React__default["default"].createElement(IconButton__default["default"], { onClick: handleOpenFilterModeMenu, onMouseEnter: handleOpenFilterModeMenu, size: "small", sx: { p: 0 } },
|
|
974
|
+
React__default["default"].createElement(ArrowRightIcon, null)))),
|
|
975
|
+
showFilterModeSubMenu && (React__default["default"].createElement(MRT_FilterOptionMenu, { anchorEl: filterMenuAnchorEl, header: header, key: 2, onSelect: handleFilterByColumn, setAnchorEl: setFilterMenuAnchorEl, table: table })),
|
|
900
976
|
].filter(Boolean),
|
|
901
977
|
enableGrouping &&
|
|
902
978
|
column.getCanGroup() && [
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
979
|
+
React__default["default"].createElement(MenuItem__default["default"], { divider: enablePinning, key: 0, onClick: handleGroupByColumn, sx: commonMenuItemStyles },
|
|
980
|
+
React__default["default"].createElement(Box__default["default"], { sx: commonListItemStyles },
|
|
981
|
+
React__default["default"].createElement(ListItemIcon__default["default"], null,
|
|
982
|
+
React__default["default"].createElement(DynamicFeedIcon, null)), (_h = localization[column.getIsGrouped() ? 'ungroupByColumn' : 'groupByColumn']) === null || _h === void 0 ? void 0 :
|
|
907
983
|
_h.replace('{column}', String(columnDef.header)))),
|
|
908
984
|
],
|
|
909
985
|
enablePinning &&
|
|
910
986
|
column.getCanPin() && [
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
987
|
+
React__default["default"].createElement(MenuItem__default["default"], { disabled: column.getIsPinned() === 'left' || !column.getCanPin(), key: 0, onClick: () => handlePinColumn('left'), sx: commonMenuItemStyles },
|
|
988
|
+
React__default["default"].createElement(Box__default["default"], { sx: commonListItemStyles },
|
|
989
|
+
React__default["default"].createElement(ListItemIcon__default["default"], null,
|
|
990
|
+
React__default["default"].createElement(PushPinIcon, { style: { transform: 'rotate(90deg)' } })),
|
|
915
991
|
localization.pinToLeft)),
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
992
|
+
React__default["default"].createElement(MenuItem__default["default"], { disabled: column.getIsPinned() === 'right' || !column.getCanPin(), key: 1, onClick: () => handlePinColumn('right'), sx: commonMenuItemStyles },
|
|
993
|
+
React__default["default"].createElement(Box__default["default"], { sx: commonListItemStyles },
|
|
994
|
+
React__default["default"].createElement(ListItemIcon__default["default"], null,
|
|
995
|
+
React__default["default"].createElement(PushPinIcon, { style: { transform: 'rotate(-90deg)' } })),
|
|
920
996
|
localization.pinToRight)),
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
997
|
+
React__default["default"].createElement(MenuItem__default["default"], { disabled: !column.getIsPinned(), divider: enableHiding, key: 2, onClick: () => handlePinColumn(false), sx: commonMenuItemStyles },
|
|
998
|
+
React__default["default"].createElement(Box__default["default"], { sx: commonListItemStyles },
|
|
999
|
+
React__default["default"].createElement(ListItemIcon__default["default"], null,
|
|
1000
|
+
React__default["default"].createElement(PushPinIcon, null)),
|
|
925
1001
|
localization.unpin)),
|
|
926
1002
|
],
|
|
927
1003
|
enableColumnResizing &&
|
|
928
1004
|
column.getCanResize() && [
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
1005
|
+
React__default["default"].createElement(MenuItem__default["default"], { disabled: !columnSizing[column.id], key: 0, onClick: handleResetColumnSize, sx: commonMenuItemStyles },
|
|
1006
|
+
React__default["default"].createElement(Box__default["default"], { sx: commonListItemStyles },
|
|
1007
|
+
React__default["default"].createElement(ListItemIcon__default["default"], null,
|
|
1008
|
+
React__default["default"].createElement(RestartAltIcon, null)),
|
|
933
1009
|
localization.resetColumnSize)),
|
|
934
1010
|
],
|
|
935
1011
|
enableHiding && [
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
1012
|
+
React__default["default"].createElement(MenuItem__default["default"], { disabled: columnDef.enableHiding === false, key: 0, onClick: handleHideColumn, sx: commonMenuItemStyles },
|
|
1013
|
+
React__default["default"].createElement(Box__default["default"], { sx: commonListItemStyles },
|
|
1014
|
+
React__default["default"].createElement(ListItemIcon__default["default"], null,
|
|
1015
|
+
React__default["default"].createElement(VisibilityOffIcon, null)), (_j = localization.hideColumn) === null || _j === void 0 ? void 0 :
|
|
940
1016
|
_j.replace('{column}', String(columnDef.header)))),
|
|
941
|
-
|
|
1017
|
+
React__default["default"].createElement(MenuItem__default["default"], { disabled: !Object.values(columnVisibility).filter((visible) => !visible)
|
|
942
1018
|
.length, key: 1, onClick: handleShowAllColumns, sx: commonMenuItemStyles },
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
1019
|
+
React__default["default"].createElement(Box__default["default"], { sx: commonListItemStyles },
|
|
1020
|
+
React__default["default"].createElement(ListItemIcon__default["default"], null,
|
|
1021
|
+
React__default["default"].createElement(ViewColumnIcon, null)), (_k = localization.showAllColumns) === null || _k === void 0 ? void 0 :
|
|
946
1022
|
_k.replace('{column}', String(columnDef.header))),
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
1023
|
+
React__default["default"].createElement(IconButton__default["default"], { onClick: handleOpenShowHideColumnsMenu, onMouseEnter: handleOpenShowHideColumnsMenu, size: "small", sx: { p: 0 } },
|
|
1024
|
+
React__default["default"].createElement(ArrowRightIcon, null))),
|
|
1025
|
+
React__default["default"].createElement(MRT_ShowHideColumnsMenu, { anchorEl: showHideColumnsMenuAnchorEl, isSubMenu: true, key: 2, setAnchorEl: setShowHideColumnsMenuAnchorEl, table: table }),
|
|
950
1026
|
]));
|
|
951
1027
|
};
|
|
952
1028
|
|
|
953
1029
|
const MRT_RowActionMenu = ({ anchorEl, handleEdit, row, setAnchorEl, table, }) => {
|
|
954
1030
|
const { getState, options: { icons: { EditIcon }, enableEditing, localization, renderRowActionMenuItems, }, } = table;
|
|
955
1031
|
const { density } = getState();
|
|
956
|
-
return (
|
|
1032
|
+
return (React__default["default"].createElement(Menu__default["default"], { anchorEl: anchorEl, open: !!anchorEl, onClose: () => setAnchorEl(null), MenuListProps: {
|
|
957
1033
|
dense: density === 'compact',
|
|
958
1034
|
} },
|
|
959
|
-
enableEditing && (
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
1035
|
+
enableEditing && (React__default["default"].createElement(MenuItem__default["default"], { onClick: handleEdit, sx: commonMenuItemStyles },
|
|
1036
|
+
React__default["default"].createElement(Box__default["default"], { sx: commonListItemStyles },
|
|
1037
|
+
React__default["default"].createElement(ListItemIcon__default["default"], null,
|
|
1038
|
+
React__default["default"].createElement(EditIcon, null)),
|
|
963
1039
|
localization.edit))), renderRowActionMenuItems === null || renderRowActionMenuItems === void 0 ? void 0 :
|
|
964
1040
|
renderRowActionMenuItems({
|
|
965
1041
|
row,
|
|
@@ -989,15 +1065,15 @@ const MRT_EditActionButtons = ({ row, table, variant = 'icon', }) => {
|
|
|
989
1065
|
values: (_b = editingRow === null || editingRow === void 0 ? void 0 : editingRow._valuesCache) !== null && _b !== void 0 ? _b : Object.assign({}, row.original),
|
|
990
1066
|
});
|
|
991
1067
|
};
|
|
992
|
-
return (
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1068
|
+
return (React__default["default"].createElement(Box__default["default"], { onClick: (e) => e.stopPropagation(), sx: { display: 'flex', gap: '0.75rem' } }, variant === 'icon' ? (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1069
|
+
React__default["default"].createElement(Tooltip__default["default"], { arrow: true, title: localization.cancel },
|
|
1070
|
+
React__default["default"].createElement(IconButton__default["default"], { "aria-label": localization.cancel, onClick: handleCancel },
|
|
1071
|
+
React__default["default"].createElement(CancelIcon, null))),
|
|
1072
|
+
React__default["default"].createElement(Tooltip__default["default"], { arrow: true, title: localization.save },
|
|
1073
|
+
React__default["default"].createElement(IconButton__default["default"], { "aria-label": localization.save, color: "info", onClick: handleSave },
|
|
1074
|
+
React__default["default"].createElement(SaveIcon, null))))) : (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1075
|
+
React__default["default"].createElement(Button__default["default"], { onClick: handleCancel }, localization.cancel),
|
|
1076
|
+
React__default["default"].createElement(Button__default["default"], { onClick: handleSave, variant: "contained" }, localization.save)))));
|
|
1001
1077
|
};
|
|
1002
1078
|
|
|
1003
1079
|
const commonIconButtonStyles = {
|
|
@@ -1024,13 +1100,13 @@ const MRT_ToggleRowActionMenuButton = ({ cell, row, table, }) => {
|
|
|
1024
1100
|
setEditingRow(Object.assign({}, row));
|
|
1025
1101
|
setAnchorEl(null);
|
|
1026
1102
|
};
|
|
1027
|
-
return (
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1103
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null, renderRowActions ? (React__default["default"].createElement(React__default["default"].Fragment, null, renderRowActions({ cell, row, table }))) : row.id === (editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) && editingMode === 'row' ? (React__default["default"].createElement(MRT_EditActionButtons, { row: row, table: table })) : !renderRowActionMenuItems && enableEditing ? (React__default["default"].createElement(Tooltip__default["default"], { placement: "right", arrow: true, title: localization.edit },
|
|
1104
|
+
React__default["default"].createElement(IconButton__default["default"], { "aria-label": localization.edit, sx: commonIconButtonStyles, onClick: handleStartEditMode },
|
|
1105
|
+
React__default["default"].createElement(EditIcon, null)))) : renderRowActionMenuItems ? (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1106
|
+
React__default["default"].createElement(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: localization.rowActions },
|
|
1107
|
+
React__default["default"].createElement(IconButton__default["default"], { "aria-label": localization.rowActions, onClick: handleOpenRowActionMenu, size: "small", sx: commonIconButtonStyles },
|
|
1108
|
+
React__default["default"].createElement(MoreHorizIcon, null))),
|
|
1109
|
+
React__default["default"].createElement(MRT_RowActionMenu, { anchorEl: anchorEl, handleEdit: handleStartEditMode, row: row, setAnchorEl: setAnchorEl, table: table }))) : null));
|
|
1034
1110
|
};
|
|
1035
1111
|
|
|
1036
1112
|
const MRT_SelectCheckbox = ({ row, selectAll, table }) => {
|
|
@@ -1063,9 +1139,9 @@ const MRT_SelectCheckbox = ({ row, selectAll, table }) => {
|
|
|
1063
1139
|
}, sx: (theme) => (Object.assign({ height: density === 'compact' ? '1.75rem' : '2.5rem', width: density === 'compact' ? '1.75rem' : '2.5rem', m: density !== 'compact' ? '-0.4rem' : undefined }, ((checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx) instanceof Function
|
|
1064
1140
|
? checkboxProps.sx(theme)
|
|
1065
1141
|
: checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx))), title: undefined });
|
|
1066
|
-
return (
|
|
1142
|
+
return (React__default["default"].createElement(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: (_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.title) !== null && _a !== void 0 ? _a : (selectAll
|
|
1067
1143
|
? localization.toggleSelectAll
|
|
1068
|
-
: localization.toggleSelectRow) }, enableMultiRowSelection === false ? (
|
|
1144
|
+
: localization.toggleSelectRow) }, enableMultiRowSelection === false ? (React__default["default"].createElement(Radio__default["default"], Object.assign({}, commonProps))) : (React__default["default"].createElement(Checkbox__default["default"], Object.assign({ indeterminate: selectAll
|
|
1069
1145
|
? table.getIsSomeRowsSelected() &&
|
|
1070
1146
|
!(selectAllMode === 'page'
|
|
1071
1147
|
? table.getIsAllPageRowsSelected()
|
|
@@ -1082,7 +1158,7 @@ const MRT_GlobalFilterTextField = ({ table, }) => {
|
|
|
1082
1158
|
: muiSearchTextFieldProps;
|
|
1083
1159
|
const [anchorEl, setAnchorEl] = React.useState(null);
|
|
1084
1160
|
const [searchValue, setSearchValue] = React.useState(globalFilter !== null && globalFilter !== void 0 ? globalFilter : '');
|
|
1085
|
-
const handleChangeDebounced = React.useCallback(
|
|
1161
|
+
const handleChangeDebounced = React.useCallback(debounce__default["default"]((event) => {
|
|
1086
1162
|
var _a;
|
|
1087
1163
|
setGlobalFilter((_a = event.target.value) !== null && _a !== void 0 ? _a : undefined);
|
|
1088
1164
|
}, manualFiltering ? 500 : 250), []);
|
|
@@ -1102,24 +1178,24 @@ const MRT_GlobalFilterTextField = ({ table, }) => {
|
|
|
1102
1178
|
handleClear();
|
|
1103
1179
|
}
|
|
1104
1180
|
}, [globalFilter]);
|
|
1105
|
-
return (
|
|
1106
|
-
|
|
1107
|
-
startAdornment: enableGlobalFilterModes ? (
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
endAdornment: (
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1181
|
+
return (React__default["default"].createElement(Collapse__default["default"], { in: showGlobalFilter, orientation: "horizontal", unmountOnExit: true, mountOnEnter: true },
|
|
1182
|
+
React__default["default"].createElement(TextField__default["default"], Object.assign({ placeholder: localization.search, onChange: handleChange, value: searchValue !== null && searchValue !== void 0 ? searchValue : '', variant: "standard", InputProps: {
|
|
1183
|
+
startAdornment: enableGlobalFilterModes ? (React__default["default"].createElement(InputAdornment__default["default"], { position: "start" },
|
|
1184
|
+
React__default["default"].createElement(Tooltip__default["default"], { arrow: true, title: localization.changeSearchMode },
|
|
1185
|
+
React__default["default"].createElement(IconButton__default["default"], { "aria-label": localization.changeSearchMode, onClick: handleGlobalFilterMenuOpen, size: "small", sx: { height: '1.75rem', width: '1.75rem' } },
|
|
1186
|
+
React__default["default"].createElement(SearchIcon, null))))) : (React__default["default"].createElement(SearchIcon, { style: { marginRight: '4px' } })),
|
|
1187
|
+
endAdornment: (React__default["default"].createElement(InputAdornment__default["default"], { position: "end" },
|
|
1188
|
+
React__default["default"].createElement(Tooltip__default["default"], { arrow: true, title: (_a = localization.clearSearch) !== null && _a !== void 0 ? _a : '' },
|
|
1189
|
+
React__default["default"].createElement("span", null,
|
|
1190
|
+
React__default["default"].createElement(IconButton__default["default"], { "aria-label": localization.clearSearch, disabled: !(searchValue === null || searchValue === void 0 ? void 0 : searchValue.length), onClick: handleClear, size: "small" },
|
|
1191
|
+
React__default["default"].createElement(CloseIcon, null)))))),
|
|
1116
1192
|
} }, textFieldProps, { inputRef: (inputRef) => {
|
|
1117
1193
|
searchInputRef.current = inputRef;
|
|
1118
1194
|
if (textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.inputRef) {
|
|
1119
1195
|
textFieldProps.inputRef = inputRef;
|
|
1120
1196
|
}
|
|
1121
1197
|
} })),
|
|
1122
|
-
|
|
1198
|
+
React__default["default"].createElement(MRT_FilterOptionMenu, { anchorEl: anchorEl, setAnchorEl: setAnchorEl, table: table, onSelect: handleClear })));
|
|
1123
1199
|
};
|
|
1124
1200
|
|
|
1125
1201
|
const MRT_LinearProgressBar = ({ isTopToolbar, table }) => {
|
|
@@ -1128,13 +1204,13 @@ const MRT_LinearProgressBar = ({ isTopToolbar, table }) => {
|
|
|
1128
1204
|
const linearProgressProps = muiLinearProgressProps instanceof Function
|
|
1129
1205
|
? muiLinearProgressProps({ isTopToolbar, table })
|
|
1130
1206
|
: muiLinearProgressProps;
|
|
1131
|
-
return (
|
|
1207
|
+
return (React__default["default"].createElement(Collapse__default["default"], { in: isLoading || showProgressBars, mountOnEnter: true, unmountOnExit: true, sx: {
|
|
1132
1208
|
bottom: isTopToolbar ? 0 : undefined,
|
|
1133
1209
|
position: 'absolute',
|
|
1134
1210
|
top: !isTopToolbar ? 0 : undefined,
|
|
1135
1211
|
width: '100%',
|
|
1136
1212
|
} },
|
|
1137
|
-
|
|
1213
|
+
React__default["default"].createElement(LinearProgress__default["default"], Object.assign({ "aria-label": "Loading", "aria-busy": "true", sx: { position: 'relative' } }, linearProgressProps))));
|
|
1138
1214
|
};
|
|
1139
1215
|
|
|
1140
1216
|
const MRT_TablePagination = ({ table, position, }) => {
|
|
@@ -1148,7 +1224,7 @@ const MRT_TablePagination = ({ table, position, }) => {
|
|
|
1148
1224
|
const handleChangeRowsPerPage = (event) => {
|
|
1149
1225
|
setPageSize(+event.target.value);
|
|
1150
1226
|
};
|
|
1151
|
-
return (
|
|
1227
|
+
return (React__default["default"].createElement(TablePagination__default["default"], Object.assign({ component: "div", count: totalRowCount, getItemAriaLabel: (type) => type === 'first'
|
|
1152
1228
|
? localization.goToFirstPage
|
|
1153
1229
|
: type === 'last'
|
|
1154
1230
|
? localization.goToLastPage
|
|
@@ -1189,26 +1265,26 @@ const MRT_ToolbarAlertBanner = ({ stackAlertBanner, table, }) => {
|
|
|
1189
1265
|
const selectMessage = getSelectedRowModel().rows.length > 0
|
|
1190
1266
|
? (_b = (_a = localization.selectedCountOfRowCountRowsSelected) === null || _a === void 0 ? void 0 : _a.replace('{selectedCount}', getSelectedRowModel().rows.length.toString())) === null || _b === void 0 ? void 0 : _b.replace('{rowCount}', (rowCount !== null && rowCount !== void 0 ? rowCount : getPrePaginationRowModel().rows.length).toString())
|
|
1191
1267
|
: null;
|
|
1192
|
-
const groupedByMessage = grouping.length > 0 ? (
|
|
1268
|
+
const groupedByMessage = grouping.length > 0 ? (React__default["default"].createElement("span", null,
|
|
1193
1269
|
localization.groupedBy,
|
|
1194
1270
|
' ',
|
|
1195
|
-
grouping.map((columnId, index) => (
|
|
1271
|
+
grouping.map((columnId, index) => (React__default["default"].createElement(React.Fragment, { key: `${index}-${columnId}` },
|
|
1196
1272
|
index > 0 ? localization.thenBy : '',
|
|
1197
|
-
|
|
1198
|
-
return (
|
|
1199
|
-
|
|
1273
|
+
React__default["default"].createElement(Chip__default["default"], Object.assign({ label: table.getColumn(columnId).columnDef.header, onDelete: () => table.getColumn(columnId).toggleGrouping() }, chipProps))))))) : null;
|
|
1274
|
+
return (React__default["default"].createElement(Collapse__default["default"], { in: showAlertBanner || !!selectMessage || !!groupedByMessage, timeout: stackAlertBanner ? 200 : 0 },
|
|
1275
|
+
React__default["default"].createElement(Alert__default["default"], Object.assign({ color: "info", icon: false }, alertProps, { sx: (theme) => (Object.assign({ borderRadius: 0, fontSize: '1rem', left: 0, p: 0, position: 'relative', mb: stackAlertBanner
|
|
1200
1276
|
? 0
|
|
1201
1277
|
: positionToolbarAlertBanner === 'bottom'
|
|
1202
1278
|
? '-1rem'
|
|
1203
1279
|
: undefined, right: 0, top: 0, width: '100%', zIndex: 2 }, ((alertProps === null || alertProps === void 0 ? void 0 : alertProps.sx) instanceof Function
|
|
1204
1280
|
? alertProps.sx(theme)
|
|
1205
1281
|
: alertProps === null || alertProps === void 0 ? void 0 : alertProps.sx))) }),
|
|
1206
|
-
(alertProps === null || alertProps === void 0 ? void 0 : alertProps.title) &&
|
|
1207
|
-
|
|
1282
|
+
(alertProps === null || alertProps === void 0 ? void 0 : alertProps.title) && React__default["default"].createElement(AlertTitle__default["default"], null, alertProps.title),
|
|
1283
|
+
React__default["default"].createElement(Box__default["default"], { sx: { p: '0.5rem 1rem' } }, alertProps === null || alertProps === void 0 ? void 0 :
|
|
1208
1284
|
alertProps.children,
|
|
1209
|
-
(alertProps === null || alertProps === void 0 ? void 0 : alertProps.children) && (selectMessage || groupedByMessage) && (
|
|
1285
|
+
(alertProps === null || alertProps === void 0 ? void 0 : alertProps.children) && (selectMessage || groupedByMessage) && (React__default["default"].createElement("br", null)),
|
|
1210
1286
|
selectMessage,
|
|
1211
|
-
selectMessage && groupedByMessage &&
|
|
1287
|
+
selectMessage && groupedByMessage && React__default["default"].createElement("br", null),
|
|
1212
1288
|
groupedByMessage))));
|
|
1213
1289
|
};
|
|
1214
1290
|
|
|
@@ -1220,8 +1296,8 @@ const MRT_FullScreenToggleButton = (_a) => {
|
|
|
1220
1296
|
const handleToggleFullScreen = () => {
|
|
1221
1297
|
setIsFullScreen(!isFullScreen);
|
|
1222
1298
|
};
|
|
1223
|
-
return (
|
|
1224
|
-
|
|
1299
|
+
return (React__default["default"].createElement(Tooltip__default["default"], { arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.toggleFullScreen },
|
|
1300
|
+
React__default["default"].createElement(IconButton__default["default"], Object.assign({ "aria-label": localization.showHideFilters, onClick: handleToggleFullScreen }, rest, { title: undefined }), isFullScreen ? React__default["default"].createElement(FullscreenExitIcon, null) : React__default["default"].createElement(FullscreenIcon, null))));
|
|
1225
1301
|
};
|
|
1226
1302
|
|
|
1227
1303
|
const MRT_ShowHideColumnsButton = (_a) => {
|
|
@@ -1232,11 +1308,11 @@ const MRT_ShowHideColumnsButton = (_a) => {
|
|
|
1232
1308
|
const handleClick = (event) => {
|
|
1233
1309
|
setAnchorEl(event.currentTarget);
|
|
1234
1310
|
};
|
|
1235
|
-
return (
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1311
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1312
|
+
React__default["default"].createElement(Tooltip__default["default"], { arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideColumns },
|
|
1313
|
+
React__default["default"].createElement(IconButton__default["default"], Object.assign({ "aria-label": localization.showHideColumns, onClick: handleClick }, rest, { title: undefined }),
|
|
1314
|
+
React__default["default"].createElement(ViewColumnIcon, null))),
|
|
1315
|
+
React__default["default"].createElement(MRT_ShowHideColumnsMenu, { anchorEl: anchorEl, setAnchorEl: setAnchorEl, table: table })));
|
|
1240
1316
|
};
|
|
1241
1317
|
|
|
1242
1318
|
const MRT_ToggleDensePaddingButton = (_a) => {
|
|
@@ -1252,8 +1328,8 @@ const MRT_ToggleDensePaddingButton = (_a) => {
|
|
|
1252
1328
|
: 'comfortable';
|
|
1253
1329
|
setDensity(nextDensity);
|
|
1254
1330
|
};
|
|
1255
|
-
return (
|
|
1256
|
-
|
|
1331
|
+
return (React__default["default"].createElement(Tooltip__default["default"], { arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.toggleDensity },
|
|
1332
|
+
React__default["default"].createElement(IconButton__default["default"], Object.assign({ "aria-label": localization.toggleDensity, onClick: handleToggleDensePadding }, rest, { title: undefined }), density === 'compact' ? (React__default["default"].createElement(DensitySmallIcon, null)) : density === 'comfortable' ? (React__default["default"].createElement(DensityMediumIcon, null)) : (React__default["default"].createElement(DensityLargeIcon, null)))));
|
|
1257
1333
|
};
|
|
1258
1334
|
|
|
1259
1335
|
const MRT_ToggleFiltersButton = (_a) => {
|
|
@@ -1264,8 +1340,8 @@ const MRT_ToggleFiltersButton = (_a) => {
|
|
|
1264
1340
|
const handleToggleShowFilters = () => {
|
|
1265
1341
|
setShowFilters(!showColumnFilters);
|
|
1266
1342
|
};
|
|
1267
|
-
return (
|
|
1268
|
-
|
|
1343
|
+
return (React__default["default"].createElement(Tooltip__default["default"], { arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideFilters },
|
|
1344
|
+
React__default["default"].createElement(IconButton__default["default"], Object.assign({ "aria-label": localization.showHideFilters, onClick: handleToggleShowFilters }, rest, { title: undefined }), showColumnFilters ? React__default["default"].createElement(FilterListOffIcon, null) : React__default["default"].createElement(FilterListIcon, null))));
|
|
1269
1345
|
};
|
|
1270
1346
|
|
|
1271
1347
|
const MRT_ToggleGlobalFilterButton = (_a) => {
|
|
@@ -1277,27 +1353,27 @@ const MRT_ToggleGlobalFilterButton = (_a) => {
|
|
|
1277
1353
|
setShowGlobalFilter(!showGlobalFilter);
|
|
1278
1354
|
queueMicrotask(() => { var _a; return (_a = searchInputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); });
|
|
1279
1355
|
};
|
|
1280
|
-
return (
|
|
1281
|
-
|
|
1356
|
+
return (React__default["default"].createElement(Tooltip__default["default"], { arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideSearch },
|
|
1357
|
+
React__default["default"].createElement(IconButton__default["default"], Object.assign({ disabled: !!globalFilter, onClick: handleToggleSearch }, rest, { title: undefined }), showGlobalFilter ? React__default["default"].createElement(SearchOffIcon, null) : React__default["default"].createElement(SearchIcon, null))));
|
|
1282
1358
|
};
|
|
1283
1359
|
|
|
1284
1360
|
const MRT_ToolbarInternalButtons = ({ table, }) => {
|
|
1285
1361
|
var _a;
|
|
1286
1362
|
const { options: { enableColumnFilters, enableColumnOrdering, enableDensityToggle, enableFilters, enableFullScreenToggle, enableGlobalFilter, enableHiding, enablePinning, initialState, renderToolbarInternalActions, }, } = table;
|
|
1287
|
-
return (
|
|
1363
|
+
return (React__default["default"].createElement(Box__default["default"], { sx: {
|
|
1288
1364
|
alignItems: 'center',
|
|
1289
1365
|
display: 'flex',
|
|
1290
1366
|
zIndex: 3,
|
|
1291
1367
|
} }, (_a = renderToolbarInternalActions === null || renderToolbarInternalActions === void 0 ? void 0 : renderToolbarInternalActions({
|
|
1292
1368
|
table,
|
|
1293
|
-
})) !== null && _a !== void 0 ? _a : (
|
|
1369
|
+
})) !== null && _a !== void 0 ? _a : (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1294
1370
|
enableFilters &&
|
|
1295
1371
|
enableGlobalFilter &&
|
|
1296
|
-
!(initialState === null || initialState === void 0 ? void 0 : initialState.showGlobalFilter) && (
|
|
1297
|
-
enableFilters && enableColumnFilters && (
|
|
1298
|
-
(enableHiding || enableColumnOrdering || enablePinning) && (
|
|
1299
|
-
enableDensityToggle && (
|
|
1300
|
-
enableFullScreenToggle && (
|
|
1372
|
+
!(initialState === null || initialState === void 0 ? void 0 : initialState.showGlobalFilter) && (React__default["default"].createElement(MRT_ToggleGlobalFilterButton, { table: table })),
|
|
1373
|
+
enableFilters && enableColumnFilters && (React__default["default"].createElement(MRT_ToggleFiltersButton, { table: table })),
|
|
1374
|
+
(enableHiding || enableColumnOrdering || enablePinning) && (React__default["default"].createElement(MRT_ShowHideColumnsButton, { table: table })),
|
|
1375
|
+
enableDensityToggle && (React__default["default"].createElement(MRT_ToggleDensePaddingButton, { table: table })),
|
|
1376
|
+
enableFullScreenToggle && (React__default["default"].createElement(MRT_FullScreenToggleButton, { table: table }))))));
|
|
1301
1377
|
};
|
|
1302
1378
|
|
|
1303
1379
|
const MRT_ToolbarDropZone = ({ table }) => {
|
|
@@ -1307,10 +1383,10 @@ const MRT_ToolbarDropZone = ({ table }) => {
|
|
|
1307
1383
|
const handleDragEnter = (_event) => {
|
|
1308
1384
|
setHoveredColumn({ id: 'drop-zone' });
|
|
1309
1385
|
};
|
|
1310
|
-
return (
|
|
1386
|
+
return (React__default["default"].createElement(Fade__default["default"], { unmountOnExit: true, mountOnEnter: true, in: !!enableGrouping &&
|
|
1311
1387
|
!!draggingColumn &&
|
|
1312
1388
|
!grouping.includes(draggingColumn.id) },
|
|
1313
|
-
|
|
1389
|
+
React__default["default"].createElement(Box__default["default"], { sx: (theme) => ({
|
|
1314
1390
|
alignItems: 'center',
|
|
1315
1391
|
backgroundColor: styles.alpha(theme.palette.info.main, (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === 'drop-zone' ? 0.2 : 0.1),
|
|
1316
1392
|
border: `dashed ${theme.palette.info.main} 2px`,
|
|
@@ -1321,7 +1397,7 @@ const MRT_ToolbarDropZone = ({ table }) => {
|
|
|
1321
1397
|
width: 'calc(100% - 4px)',
|
|
1322
1398
|
zIndex: 2,
|
|
1323
1399
|
}), onDragEnter: handleDragEnter },
|
|
1324
|
-
|
|
1400
|
+
React__default["default"].createElement(Typography__default["default"], null, localization.dropToGroupBy.replace('{column}', (_b = (_a = draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.columnDef) === null || _a === void 0 ? void 0 : _a.header) !== null && _b !== void 0 ? _b : '')))));
|
|
1325
1401
|
};
|
|
1326
1402
|
|
|
1327
1403
|
const commonToolbarStyles = ({ theme }) => ({
|
|
@@ -1340,12 +1416,12 @@ const MRT_TopToolbar = ({ table }) => {
|
|
|
1340
1416
|
var _a;
|
|
1341
1417
|
const { getState, options: { enableGlobalFilter, enablePagination, enableToolbarInternalActions, muiTopToolbarProps, positionGlobalFilter, positionPagination, positionToolbarAlertBanner, positionToolbarDropZone, renderTopToolbarCustomActions, }, refs: { topToolbarRef }, } = table;
|
|
1342
1418
|
const { isFullScreen, showGlobalFilter } = getState();
|
|
1343
|
-
const isMobile =
|
|
1419
|
+
const isMobile = useMediaQuery__default["default"]('(max-width:720px)');
|
|
1344
1420
|
const toolbarProps = muiTopToolbarProps instanceof Function
|
|
1345
1421
|
? muiTopToolbarProps({ table })
|
|
1346
1422
|
: muiTopToolbarProps;
|
|
1347
1423
|
const stackAlertBanner = isMobile || !!renderTopToolbarCustomActions || showGlobalFilter;
|
|
1348
|
-
return (
|
|
1424
|
+
return (React__default["default"].createElement(Toolbar__default["default"], Object.assign({ variant: "dense" }, toolbarProps, { ref: (ref) => {
|
|
1349
1425
|
topToolbarRef.current = ref;
|
|
1350
1426
|
if (toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.ref) {
|
|
1351
1427
|
// @ts-ignore
|
|
@@ -1354,9 +1430,9 @@ const MRT_TopToolbar = ({ table }) => {
|
|
|
1354
1430
|
}, sx: (theme) => (Object.assign(Object.assign({ position: isFullScreen ? 'sticky' : undefined, top: isFullScreen ? '0' : undefined }, commonToolbarStyles({ theme })), ((toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx) instanceof Function
|
|
1355
1431
|
? toolbarProps.sx(theme)
|
|
1356
1432
|
: toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx))) }),
|
|
1357
|
-
positionToolbarAlertBanner === 'top' && (
|
|
1358
|
-
['both', 'top'].includes(positionToolbarDropZone !== null && positionToolbarDropZone !== void 0 ? positionToolbarDropZone : '') && (
|
|
1359
|
-
|
|
1433
|
+
positionToolbarAlertBanner === 'top' && (React__default["default"].createElement(MRT_ToolbarAlertBanner, { stackAlertBanner: stackAlertBanner, table: table })),
|
|
1434
|
+
['both', 'top'].includes(positionToolbarDropZone !== null && positionToolbarDropZone !== void 0 ? positionToolbarDropZone : '') && (React__default["default"].createElement(MRT_ToolbarDropZone, { table: table })),
|
|
1435
|
+
React__default["default"].createElement(Box__default["default"], { sx: {
|
|
1360
1436
|
alignItems: 'flex-start',
|
|
1361
1437
|
boxSizing: 'border-box',
|
|
1362
1438
|
display: 'flex',
|
|
@@ -1367,29 +1443,29 @@ const MRT_TopToolbar = ({ table }) => {
|
|
|
1367
1443
|
top: 0,
|
|
1368
1444
|
width: '100%',
|
|
1369
1445
|
} },
|
|
1370
|
-
enableGlobalFilter && positionGlobalFilter === 'left' && (
|
|
1371
|
-
enableToolbarInternalActions ? (
|
|
1446
|
+
enableGlobalFilter && positionGlobalFilter === 'left' && (React__default["default"].createElement(MRT_GlobalFilterTextField, { table: table })), (_a = renderTopToolbarCustomActions === null || renderTopToolbarCustomActions === void 0 ? void 0 : renderTopToolbarCustomActions({ table })) !== null && _a !== void 0 ? _a : React__default["default"].createElement("span", null),
|
|
1447
|
+
enableToolbarInternalActions ? (React__default["default"].createElement(Box__default["default"], { sx: {
|
|
1372
1448
|
display: 'flex',
|
|
1373
1449
|
flexWrap: 'wrap-reverse',
|
|
1374
1450
|
justifyContent: 'flex-end',
|
|
1375
1451
|
} },
|
|
1376
|
-
enableGlobalFilter && positionGlobalFilter === 'right' && (
|
|
1377
|
-
|
|
1378
|
-
positionGlobalFilter === 'right' && (
|
|
1452
|
+
enableGlobalFilter && positionGlobalFilter === 'right' && (React__default["default"].createElement(MRT_GlobalFilterTextField, { table: table })),
|
|
1453
|
+
React__default["default"].createElement(MRT_ToolbarInternalButtons, { table: table }))) : (enableGlobalFilter &&
|
|
1454
|
+
positionGlobalFilter === 'right' && (React__default["default"].createElement(MRT_GlobalFilterTextField, { table: table })))),
|
|
1379
1455
|
enablePagination &&
|
|
1380
|
-
['top', 'both'].includes(positionPagination !== null && positionPagination !== void 0 ? positionPagination : '') && (
|
|
1381
|
-
|
|
1456
|
+
['top', 'both'].includes(positionPagination !== null && positionPagination !== void 0 ? positionPagination : '') && (React__default["default"].createElement(MRT_TablePagination, { table: table, position: "top" })),
|
|
1457
|
+
React__default["default"].createElement(MRT_LinearProgressBar, { isTopToolbar: true, table: table })));
|
|
1382
1458
|
};
|
|
1383
1459
|
|
|
1384
1460
|
const MRT_BottomToolbar = ({ table }) => {
|
|
1385
1461
|
const { getState, options: { enablePagination, muiBottomToolbarProps, positionPagination, positionToolbarAlertBanner, positionToolbarDropZone, renderBottomToolbarCustomActions, }, refs: { bottomToolbarRef }, } = table;
|
|
1386
1462
|
const { isFullScreen } = getState();
|
|
1387
|
-
const isMobile =
|
|
1463
|
+
const isMobile = useMediaQuery__default["default"]('(max-width:720px)');
|
|
1388
1464
|
const toolbarProps = muiBottomToolbarProps instanceof Function
|
|
1389
1465
|
? muiBottomToolbarProps({ table })
|
|
1390
1466
|
: muiBottomToolbarProps;
|
|
1391
1467
|
const stackAlertBanner = isMobile || !!renderBottomToolbarCustomActions;
|
|
1392
|
-
return (
|
|
1468
|
+
return (React__default["default"].createElement(Toolbar__default["default"], Object.assign({ variant: "dense" }, toolbarProps, { ref: (ref) => {
|
|
1393
1469
|
bottomToolbarRef.current = ref;
|
|
1394
1470
|
if (toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.ref) {
|
|
1395
1471
|
// @ts-ignore
|
|
@@ -1398,10 +1474,10 @@ const MRT_BottomToolbar = ({ table }) => {
|
|
|
1398
1474
|
}, sx: (theme) => (Object.assign(Object.assign(Object.assign({}, commonToolbarStyles({ theme })), { bottom: isFullScreen ? '0' : undefined, boxShadow: `0 1px 2px -1px ${styles.alpha(theme.palette.common.black, 0.1)} inset`, left: 0, position: isFullScreen ? 'fixed' : 'relative', right: 0 }), ((toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx) instanceof Function
|
|
1399
1475
|
? toolbarProps.sx(theme)
|
|
1400
1476
|
: toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx))) }),
|
|
1401
|
-
|
|
1402
|
-
positionToolbarAlertBanner === 'bottom' && (
|
|
1403
|
-
['both', 'bottom'].includes(positionToolbarDropZone !== null && positionToolbarDropZone !== void 0 ? positionToolbarDropZone : '') && (
|
|
1404
|
-
|
|
1477
|
+
React__default["default"].createElement(MRT_LinearProgressBar, { isTopToolbar: false, table: table }),
|
|
1478
|
+
positionToolbarAlertBanner === 'bottom' && (React__default["default"].createElement(MRT_ToolbarAlertBanner, { stackAlertBanner: stackAlertBanner, table: table })),
|
|
1479
|
+
['both', 'bottom'].includes(positionToolbarDropZone !== null && positionToolbarDropZone !== void 0 ? positionToolbarDropZone : '') && (React__default["default"].createElement(MRT_ToolbarDropZone, { table: table })),
|
|
1480
|
+
React__default["default"].createElement(Box__default["default"], { sx: {
|
|
1405
1481
|
alignItems: 'center',
|
|
1406
1482
|
boxSizing: 'border-box',
|
|
1407
1483
|
display: 'flex',
|
|
@@ -1409,15 +1485,15 @@ const MRT_BottomToolbar = ({ table }) => {
|
|
|
1409
1485
|
p: '0.5rem',
|
|
1410
1486
|
width: '100%',
|
|
1411
1487
|
} },
|
|
1412
|
-
renderBottomToolbarCustomActions ? (renderBottomToolbarCustomActions({ table })) : (
|
|
1413
|
-
|
|
1488
|
+
renderBottomToolbarCustomActions ? (renderBottomToolbarCustomActions({ table })) : (React__default["default"].createElement("span", null)),
|
|
1489
|
+
React__default["default"].createElement(Box__default["default"], { sx: {
|
|
1414
1490
|
display: 'flex',
|
|
1415
1491
|
justifyContent: 'flex-end',
|
|
1416
1492
|
position: stackAlertBanner ? 'relative' : 'absolute',
|
|
1417
1493
|
right: 0,
|
|
1418
1494
|
top: 0,
|
|
1419
1495
|
} }, enablePagination &&
|
|
1420
|
-
['bottom', 'both'].includes(positionPagination !== null && positionPagination !== void 0 ? positionPagination : '') && (
|
|
1496
|
+
['bottom', 'both'].includes(positionPagination !== null && positionPagination !== void 0 ? positionPagination : '') && (React__default["default"].createElement(MRT_TablePagination, { table: table, position: "bottom" }))))));
|
|
1421
1497
|
};
|
|
1422
1498
|
|
|
1423
1499
|
const MRT_TableHeadCellColumnActionsButton = ({ header, table, }) => {
|
|
@@ -1441,15 +1517,15 @@ const MRT_TableHeadCellColumnActionsButton = ({ header, table, }) => {
|
|
|
1441
1517
|
})
|
|
1442
1518
|
: columnDef.muiTableHeadCellColumnActionsButtonProps;
|
|
1443
1519
|
const iconButtonProps = Object.assign(Object.assign({}, mTableHeadCellColumnActionsButtonProps), mcTableHeadCellColumnActionsButtonProps);
|
|
1444
|
-
return (
|
|
1445
|
-
|
|
1446
|
-
|
|
1520
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1521
|
+
React__default["default"].createElement(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : localization.columnActions },
|
|
1522
|
+
React__default["default"].createElement(IconButton__default["default"], Object.assign({ "aria-label": localization.columnActions, onClick: handleClick, size: "small" }, iconButtonProps, { sx: (theme) => (Object.assign({ height: '2rem', m: '-8px -4px', opacity: 0.5, transform: 'scale(0.85)', transition: 'opacity 150ms', width: '2rem', '&:hover': {
|
|
1447
1523
|
opacity: 1,
|
|
1448
1524
|
} }, ((iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx) instanceof Function
|
|
1449
1525
|
? iconButtonProps.sx(theme)
|
|
1450
1526
|
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined }),
|
|
1451
|
-
|
|
1452
|
-
anchorEl && (
|
|
1527
|
+
React__default["default"].createElement(MoreVertIcon, null))),
|
|
1528
|
+
anchorEl && (React__default["default"].createElement(MRT_ColumnActionMenu, { anchorEl: anchorEl, header: header, setAnchorEl: setAnchorEl, table: table }))));
|
|
1453
1529
|
};
|
|
1454
1530
|
|
|
1455
1531
|
const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
@@ -1505,7 +1581,7 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1505
1581
|
? ((_a = column.getFilterValue()) === null || _a === void 0 ? void 0 : _a[rangeFilterIndex]) || []
|
|
1506
1582
|
: (_b = column.getFilterValue()) !== null && _b !== void 0 ? _b : '';
|
|
1507
1583
|
});
|
|
1508
|
-
const handleChangeDebounced = React.useCallback(
|
|
1584
|
+
const handleChangeDebounced = React.useCallback(debounce__default["default"]((event) => {
|
|
1509
1585
|
const value = textFieldProps.type === 'date'
|
|
1510
1586
|
? event.target.valueAsDate
|
|
1511
1587
|
: textFieldProps.type === 'number'
|
|
@@ -1558,17 +1634,17 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1558
1634
|
}
|
|
1559
1635
|
}, [column.getFilterValue()]);
|
|
1560
1636
|
if (columnDef.Filter) {
|
|
1561
|
-
return (
|
|
1637
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null, (_e = columnDef.Filter) === null || _e === void 0 ? void 0 : _e.call(columnDef, { column, header, rangeFilterIndex, table })));
|
|
1562
1638
|
}
|
|
1563
|
-
return (
|
|
1564
|
-
|
|
1639
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1640
|
+
React__default["default"].createElement(TextField__default["default"], Object.assign({ fullWidth: true, inputProps: {
|
|
1565
1641
|
disabled: !!filterChipLabel,
|
|
1566
1642
|
sx: {
|
|
1567
1643
|
textOverflow: 'ellipsis',
|
|
1568
1644
|
width: filterChipLabel ? 0 : undefined,
|
|
1569
1645
|
},
|
|
1570
1646
|
title: filterPlaceholder,
|
|
1571
|
-
}, helperText: showChangeModeButton ? (
|
|
1647
|
+
}, helperText: showChangeModeButton ? (React__default["default"].createElement("label", null, localization.filterMode.replace('{filterType}',
|
|
1572
1648
|
// @ts-ignore
|
|
1573
1649
|
localization[`filter${((_f = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt(0)) === null || _f === void 0 ? void 0 : _f.toUpperCase()) +
|
|
1574
1650
|
(currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.slice(1))}`]))) : null, FormHelperTextProps: {
|
|
@@ -1580,30 +1656,30 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1580
1656
|
}, margin: "none", placeholder: filterChipLabel || isSelectFilter || isMultiSelectFilter
|
|
1581
1657
|
? undefined
|
|
1582
1658
|
: filterPlaceholder, onChange: handleChange, onClick: (e) => e.stopPropagation(), select: isSelectFilter || isMultiSelectFilter, value: filterValue, variant: "standard", InputProps: {
|
|
1583
|
-
startAdornment: showChangeModeButton ? (
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
filterChipLabel && (
|
|
1589
|
-
endAdornment: !filterChipLabel && (
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1659
|
+
startAdornment: showChangeModeButton ? (React__default["default"].createElement(InputAdornment__default["default"], { position: "start" },
|
|
1660
|
+
React__default["default"].createElement(Tooltip__default["default"], { arrow: true, title: localization.changeFilterMode },
|
|
1661
|
+
React__default["default"].createElement("span", null,
|
|
1662
|
+
React__default["default"].createElement(IconButton__default["default"], { "aria-label": localization.changeFilterMode, onClick: handleFilterMenuOpen, size: "small", sx: { height: '1.75rem', width: '1.75rem' } },
|
|
1663
|
+
React__default["default"].createElement(FilterListIcon, null)))),
|
|
1664
|
+
filterChipLabel && (React__default["default"].createElement(Chip__default["default"], { onDelete: handleClearEmptyFilterChip, label: filterChipLabel })))) : null,
|
|
1665
|
+
endAdornment: !filterChipLabel && (React__default["default"].createElement(InputAdornment__default["default"], { position: "end" },
|
|
1666
|
+
React__default["default"].createElement(Tooltip__default["default"], { arrow: true, placement: "right", title: (_g = localization.clearFilter) !== null && _g !== void 0 ? _g : '' },
|
|
1667
|
+
React__default["default"].createElement("span", null,
|
|
1668
|
+
React__default["default"].createElement(IconButton__default["default"], { "aria-label": localization.clearFilter, disabled: !(filterValue === null || filterValue === void 0 ? void 0 : filterValue.length), onClick: handleClear, size: "small", sx: {
|
|
1593
1669
|
height: '1.75rem',
|
|
1594
1670
|
width: '1.75rem',
|
|
1595
1671
|
} },
|
|
1596
|
-
|
|
1672
|
+
React__default["default"].createElement(CloseIcon, null)))))),
|
|
1597
1673
|
}, SelectProps: {
|
|
1598
1674
|
displayEmpty: true,
|
|
1599
1675
|
multiple: isMultiSelectFilter,
|
|
1600
1676
|
renderValue: isMultiSelectFilter
|
|
1601
|
-
? (selected) => !(selected === null || selected === void 0 ? void 0 : selected.length) ? (
|
|
1677
|
+
? (selected) => !(selected === null || selected === void 0 ? void 0 : selected.length) ? (React__default["default"].createElement(Box__default["default"], { sx: { opacity: 0.5 } }, filterPlaceholder)) : (React__default["default"].createElement(Box__default["default"], { sx: { display: 'flex', flexWrap: 'wrap', gap: '2px' } }, selected === null || selected === void 0 ? void 0 : selected.map((value) => {
|
|
1602
1678
|
var _a;
|
|
1603
1679
|
const selectedValue = (_a = columnDef.filterSelectOptions) === null || _a === void 0 ? void 0 : _a.find((option) => option instanceof Object
|
|
1604
1680
|
? option.value === value
|
|
1605
1681
|
: option === value);
|
|
1606
|
-
return (
|
|
1682
|
+
return (React__default["default"].createElement(Chip__default["default"], { key: value, label: selectedValue instanceof Object
|
|
1607
1683
|
? selectedValue.text
|
|
1608
1684
|
: selectedValue }));
|
|
1609
1685
|
})))
|
|
@@ -1623,8 +1699,8 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1623
1699
|
} }, ((textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.sx) instanceof Function
|
|
1624
1700
|
? textFieldProps.sx(theme)
|
|
1625
1701
|
: textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.sx))) }),
|
|
1626
|
-
(isSelectFilter || isMultiSelectFilter) && (
|
|
1627
|
-
|
|
1702
|
+
(isSelectFilter || isMultiSelectFilter) && (React__default["default"].createElement(MenuItem__default["default"], { divider: true, disabled: true, hidden: true, value: "" },
|
|
1703
|
+
React__default["default"].createElement(Box__default["default"], { sx: { opacity: 0.5 } }, filterPlaceholder))), (_h = columnDef === null || columnDef === void 0 ? void 0 : columnDef.filterSelectOptions) === null || _h === void 0 ? void 0 :
|
|
1628
1704
|
_h.map((option) => {
|
|
1629
1705
|
var _a;
|
|
1630
1706
|
let value;
|
|
@@ -1637,22 +1713,22 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1637
1713
|
value = option.value;
|
|
1638
1714
|
text = option.text;
|
|
1639
1715
|
}
|
|
1640
|
-
return (
|
|
1716
|
+
return (React__default["default"].createElement(MenuItem__default["default"], { key: value, sx: {
|
|
1641
1717
|
display: 'flex',
|
|
1642
1718
|
m: 0,
|
|
1643
1719
|
alignItems: 'center',
|
|
1644
1720
|
gap: '0.5rem',
|
|
1645
1721
|
}, value: value },
|
|
1646
|
-
isMultiSelectFilter && (
|
|
1722
|
+
isMultiSelectFilter && (React__default["default"].createElement(Checkbox__default["default"], { checked: ((_a = column.getFilterValue()) !== null && _a !== void 0 ? _a : []).includes(value), sx: { mr: '0.5rem' } })),
|
|
1647
1723
|
text));
|
|
1648
1724
|
})),
|
|
1649
|
-
|
|
1725
|
+
React__default["default"].createElement(MRT_FilterOptionMenu, { anchorEl: anchorEl, header: header, setAnchorEl: setAnchorEl, table: table, setFilterValue: setFilterValue })));
|
|
1650
1726
|
};
|
|
1651
1727
|
|
|
1652
1728
|
const MRT_FilterRangeFields = ({ header, table }) => {
|
|
1653
|
-
return (
|
|
1654
|
-
|
|
1655
|
-
|
|
1729
|
+
return (React__default["default"].createElement(Box__default["default"], { sx: { display: 'grid', gridTemplateColumns: '6fr 6fr', gap: '1rem' } },
|
|
1730
|
+
React__default["default"].createElement(MRT_FilterTextField, { header: header, rangeFilterIndex: 0, table: table }),
|
|
1731
|
+
React__default["default"].createElement(MRT_FilterTextField, { header: header, rangeFilterIndex: 1, table: table })));
|
|
1656
1732
|
};
|
|
1657
1733
|
|
|
1658
1734
|
const MRT_FilterCheckbox = ({ column, table }) => {
|
|
@@ -1674,8 +1750,8 @@ const MRT_FilterCheckbox = ({ column, table }) => {
|
|
|
1674
1750
|
: columnDef.muiTableHeadCellFilterCheckboxProps;
|
|
1675
1751
|
const checkboxProps = Object.assign(Object.assign({}, mTableHeadCellFilterCheckboxProps), mcTableHeadCellFilterCheckboxProps);
|
|
1676
1752
|
const filterLabel = (_a = localization.filterByColumn) === null || _a === void 0 ? void 0 : _a.replace('{column}', columnDef.header);
|
|
1677
|
-
return (
|
|
1678
|
-
|
|
1753
|
+
return (React__default["default"].createElement(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: (_b = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.title) !== null && _b !== void 0 ? _b : filterLabel },
|
|
1754
|
+
React__default["default"].createElement(FormControlLabel__default["default"], { control: React__default["default"].createElement(Checkbox__default["default"], Object.assign({ checked: column.getFilterValue() === 'true', indeterminate: column.getFilterValue() === undefined, color: column.getFilterValue() === undefined ? 'default' : 'primary', size: density === 'compact' ? 'small' : 'medium' }, checkboxProps, { onClick: (e) => {
|
|
1679
1755
|
var _a;
|
|
1680
1756
|
e.stopPropagation();
|
|
1681
1757
|
(_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.onClick) === null || _a === void 0 ? void 0 : _a.call(checkboxProps, e);
|
|
@@ -1697,8 +1773,8 @@ const MRT_TableHeadCellFilterContainer = ({ header, table, }) => {
|
|
|
1697
1773
|
const { showColumnFilters } = getState();
|
|
1698
1774
|
const { column } = header;
|
|
1699
1775
|
const { columnDef } = column;
|
|
1700
|
-
return (
|
|
1701
|
-
['between', 'betweenInclusive', 'inNumberRange'].includes(columnDef._filterFn) ? (
|
|
1776
|
+
return (React__default["default"].createElement(Collapse__default["default"], { in: showColumnFilters, mountOnEnter: true, unmountOnExit: true }, columnDef.filterVariant === 'checkbox' ? (React__default["default"].createElement(MRT_FilterCheckbox, { column: column, table: table })) : columnDef.filterVariant === 'range' ||
|
|
1777
|
+
['between', 'betweenInclusive', 'inNumberRange'].includes(columnDef._filterFn) ? (React__default["default"].createElement(MRT_FilterRangeFields, { header: header, table: table })) : (React__default["default"].createElement(MRT_FilterTextField, { header: header, table: table }))));
|
|
1702
1778
|
};
|
|
1703
1779
|
|
|
1704
1780
|
const MRT_TableHeadCellFilterLabel = ({ header, table }) => {
|
|
@@ -1719,12 +1795,12 @@ const MRT_TableHeadCellFilterLabel = ({ header, table }) => {
|
|
|
1719
1795
|
? column.getFilterValue().join(`" ${isRangeFilter ? localization.and : localization.or} "`)
|
|
1720
1796
|
: column.getFilterValue()}"`)
|
|
1721
1797
|
.replace('" "', '');
|
|
1722
|
-
return (
|
|
1798
|
+
return (React__default["default"].createElement(Grow__default["default"], { unmountOnExit: true, in: (!!column.getFilterValue() && !isRangeFilter) ||
|
|
1723
1799
|
(isRangeFilter && // @ts-ignore
|
|
1724
1800
|
(!!((_b = column.getFilterValue()) === null || _b === void 0 ? void 0 : _b[0]) || !!((_c = column.getFilterValue()) === null || _c === void 0 ? void 0 : _c[1]))) },
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1801
|
+
React__default["default"].createElement(Box__default["default"], { component: "span", sx: { flex: '0 0' } },
|
|
1802
|
+
React__default["default"].createElement(Tooltip__default["default"], { arrow: true, placement: "top", title: filterTooltip },
|
|
1803
|
+
React__default["default"].createElement(IconButton__default["default"], { disableRipple: true, onClick: (event) => {
|
|
1728
1804
|
event.stopPropagation();
|
|
1729
1805
|
}, size: "small", sx: {
|
|
1730
1806
|
height: '12px',
|
|
@@ -1734,7 +1810,7 @@ const MRT_TableHeadCellFilterLabel = ({ header, table }) => {
|
|
|
1734
1810
|
transform: 'scale(0.66)',
|
|
1735
1811
|
width: '12px',
|
|
1736
1812
|
} },
|
|
1737
|
-
|
|
1813
|
+
React__default["default"].createElement(FilterAltIcon, null))))));
|
|
1738
1814
|
};
|
|
1739
1815
|
|
|
1740
1816
|
const MRT_TableHeadCellGrabHandle = ({ column, table, tableHeadCellRef, }) => {
|
|
@@ -1768,7 +1844,7 @@ const MRT_TableHeadCellGrabHandle = ({ column, table, tableHeadCellRef, }) => {
|
|
|
1768
1844
|
setDraggingColumn(null);
|
|
1769
1845
|
setHoveredColumn(null);
|
|
1770
1846
|
};
|
|
1771
|
-
return (
|
|
1847
|
+
return (React__default["default"].createElement(MRT_GrabHandleButton, { iconButtonProps: iconButtonProps, onDragStart: handleDragStart, onDragEnd: handleDragEnd, table: table }));
|
|
1772
1848
|
};
|
|
1773
1849
|
|
|
1774
1850
|
const MRT_TableHeadCellResizeHandle = ({ header, table }) => {
|
|
@@ -1778,7 +1854,7 @@ const MRT_TableHeadCellResizeHandle = ({ header, table }) => {
|
|
|
1778
1854
|
const { column } = header;
|
|
1779
1855
|
const { columnDef } = column;
|
|
1780
1856
|
const { columnDefType } = columnDef;
|
|
1781
|
-
return (
|
|
1857
|
+
return (React__default["default"].createElement(Box__default["default"], { onDoubleClick: () => column.resetSize(), onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), sx: (theme) => ({
|
|
1782
1858
|
cursor: 'col-resize',
|
|
1783
1859
|
mr: density === 'compact' ? '-0.5rem' : '-1rem',
|
|
1784
1860
|
position: 'absolute',
|
|
@@ -1794,7 +1870,7 @@ const MRT_TableHeadCellResizeHandle = ({ header, table }) => {
|
|
|
1794
1870
|
(columnResizeMode === 'onChange' ? 16 : 1)}px)`
|
|
1795
1871
|
: undefined,
|
|
1796
1872
|
} },
|
|
1797
|
-
|
|
1873
|
+
React__default["default"].createElement(Divider__default["default"], { flexItem: true, orientation: "vertical", sx: {
|
|
1798
1874
|
borderRadius: '2px',
|
|
1799
1875
|
borderWidth: '2px',
|
|
1800
1876
|
height: showColumnFilters && columnDefType === 'data' ? '3.5rem' : '1.5rem',
|
|
@@ -1816,8 +1892,8 @@ const MRT_TableHeadCellSortLabel = ({ header, table, tableCellProps, }) => {
|
|
|
1816
1892
|
? localization.sortedByColumnDesc.replace('{column}', columnDef.header)
|
|
1817
1893
|
: localization.sortedByColumnAsc.replace('{column}', columnDef.header)
|
|
1818
1894
|
: localization.unsorted;
|
|
1819
|
-
return (
|
|
1820
|
-
|
|
1895
|
+
return (React__default["default"].createElement(Tooltip__default["default"], { arrow: true, placement: "top", title: sortTooltip },
|
|
1896
|
+
React__default["default"].createElement(TableSortLabel__default["default"], { "aria-label": sortTooltip, active: !!column.getIsSorted(), direction: column.getIsSorted()
|
|
1821
1897
|
? column.getIsSorted()
|
|
1822
1898
|
: undefined, sx: {
|
|
1823
1899
|
flex: '0 0',
|
|
@@ -1889,7 +1965,7 @@ const MRT_TableHeadCell = ({ header, table }) => {
|
|
|
1889
1965
|
table,
|
|
1890
1966
|
})
|
|
1891
1967
|
: (_b = columnDef === null || columnDef === void 0 ? void 0 : columnDef.Header) !== null && _b !== void 0 ? _b : columnDef.header;
|
|
1892
|
-
return (
|
|
1968
|
+
return (React__default["default"].createElement(TableCell__default["default"], Object.assign({ align: columnDefType === 'group' ? 'center' : 'left', colSpan: header.colSpan, onDragEnter: handleDragEnter, ref: (node) => {
|
|
1893
1969
|
if (node) {
|
|
1894
1970
|
tableHeadCellRefs.current[column.id] = node;
|
|
1895
1971
|
}
|
|
@@ -1920,7 +1996,7 @@ const MRT_TableHeadCell = ({ header, table }) => {
|
|
|
1920
1996
|
tableCellProps,
|
|
1921
1997
|
theme,
|
|
1922
1998
|
})), draggingBorders)) }),
|
|
1923
|
-
header.isPlaceholder ? null : (
|
|
1999
|
+
header.isPlaceholder ? null : (React__default["default"].createElement(Box__default["default"], { className: "Mui-TableHeadCell-Content", sx: {
|
|
1924
2000
|
alignItems: 'flex-start',
|
|
1925
2001
|
display: 'flex',
|
|
1926
2002
|
flexDirection: (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'right' ? 'row-reverse' : 'row',
|
|
@@ -1932,7 +2008,7 @@ const MRT_TableHeadCell = ({ header, table }) => {
|
|
|
1932
2008
|
position: 'relative',
|
|
1933
2009
|
width: '100%',
|
|
1934
2010
|
} },
|
|
1935
|
-
|
|
2011
|
+
React__default["default"].createElement(Box__default["default"], { className: "Mui-TableHeadCell-Content-Labels", onClick: column.getToggleSortingHandler(), sx: {
|
|
1936
2012
|
alignItems: 'center',
|
|
1937
2013
|
cursor: column.getCanSort() && columnDefType !== 'group'
|
|
1938
2014
|
? 'pointer'
|
|
@@ -1944,20 +2020,20 @@ const MRT_TableHeadCell = ({ header, table }) => {
|
|
|
1944
2020
|
? `${headerPL}rem`
|
|
1945
2021
|
: undefined,
|
|
1946
2022
|
} },
|
|
1947
|
-
|
|
2023
|
+
React__default["default"].createElement(Box__default["default"], { className: "Mui-TableHeadCell-Content-Wrapper", sx: {
|
|
1948
2024
|
overflow: columnDefType === 'data' ? 'hidden' : undefined,
|
|
1949
2025
|
textOverflow: 'ellipsis',
|
|
1950
2026
|
whiteSpace: ((_d = (_c = columnDef.header) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) < 20 ? 'nowrap' : 'normal',
|
|
1951
2027
|
}, title: columnDefType === 'data' ? columnDef.header : undefined }, headerElement),
|
|
1952
|
-
column.getCanSort() && (
|
|
1953
|
-
column.getCanFilter() && (
|
|
1954
|
-
columnDefType !== 'group' && (
|
|
1955
|
-
showDragHandle && (
|
|
2028
|
+
column.getCanSort() && (React__default["default"].createElement(MRT_TableHeadCellSortLabel, { header: header, table: table, tableCellProps: tableCellProps })),
|
|
2029
|
+
column.getCanFilter() && (React__default["default"].createElement(MRT_TableHeadCellFilterLabel, { header: header, table: table }))),
|
|
2030
|
+
columnDefType !== 'group' && (React__default["default"].createElement(Box__default["default"], { className: "Mui-TableHeadCell-Content-Actions", sx: { whiteSpace: 'nowrap' } },
|
|
2031
|
+
showDragHandle && (React__default["default"].createElement(MRT_TableHeadCellGrabHandle, { column: column, table: table, tableHeadCellRef: {
|
|
1956
2032
|
current: tableHeadCellRefs.current[column.id],
|
|
1957
2033
|
} })),
|
|
1958
|
-
showColumnActions && (
|
|
1959
|
-
column.getCanResize() && (
|
|
1960
|
-
column.getCanFilter() && (
|
|
2034
|
+
showColumnActions && (React__default["default"].createElement(MRT_TableHeadCellColumnActionsButton, { header: header, table: table })))),
|
|
2035
|
+
column.getCanResize() && (React__default["default"].createElement(MRT_TableHeadCellResizeHandle, { header: header, table: table })))),
|
|
2036
|
+
column.getCanFilter() && (React__default["default"].createElement(MRT_TableHeadCellFilterContainer, { header: header, table: table }))));
|
|
1961
2037
|
};
|
|
1962
2038
|
|
|
1963
2039
|
const MRT_TableHeadRow = ({ headerGroup, table }) => {
|
|
@@ -1965,9 +2041,9 @@ const MRT_TableHeadRow = ({ headerGroup, table }) => {
|
|
|
1965
2041
|
const tableRowProps = muiTableHeadRowProps instanceof Function
|
|
1966
2042
|
? muiTableHeadRowProps({ headerGroup, table })
|
|
1967
2043
|
: muiTableHeadRowProps;
|
|
1968
|
-
return (
|
|
2044
|
+
return (React__default["default"].createElement(TableRow__default["default"], Object.assign({}, tableRowProps, { sx: (theme) => (Object.assign({ boxShadow: `4px 0 8px ${styles.alpha(theme.palette.common.black, 0.1)}`, backgroundColor: styles.lighten(theme.palette.background.default, 0.04) }, ((tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx) instanceof Function
|
|
1969
2045
|
? tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx(theme)
|
|
1970
|
-
: tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx))) }), headerGroup.headers.map((header, index) => (
|
|
2046
|
+
: tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx))) }), headerGroup.headers.map((header, index) => (React__default["default"].createElement(MRT_TableHeadCell, { header: header, key: header.id || index, table: table })))));
|
|
1971
2047
|
};
|
|
1972
2048
|
|
|
1973
2049
|
const MRT_TableHead = ({ table }) => {
|
|
@@ -1977,9 +2053,9 @@ const MRT_TableHead = ({ table }) => {
|
|
|
1977
2053
|
? muiTableHeadProps({ table })
|
|
1978
2054
|
: muiTableHeadProps;
|
|
1979
2055
|
const stickyHeader = enableStickyHeader || enableRowVirtualization || isFullScreen;
|
|
1980
|
-
return (
|
|
2056
|
+
return (React__default["default"].createElement(TableHead__default["default"], Object.assign({}, tableHeadProps, { sx: (theme) => (Object.assign({ opacity: 0.97, position: stickyHeader ? 'sticky' : undefined, zIndex: stickyHeader ? 2 : undefined }, ((tableHeadProps === null || tableHeadProps === void 0 ? void 0 : tableHeadProps.sx) instanceof Function
|
|
1981
2057
|
? tableHeadProps === null || tableHeadProps === void 0 ? void 0 : tableHeadProps.sx(theme)
|
|
1982
|
-
: tableHeadProps === null || tableHeadProps === void 0 ? void 0 : tableHeadProps.sx))) }), getHeaderGroups().map((headerGroup) => (
|
|
2058
|
+
: tableHeadProps === null || tableHeadProps === void 0 ? void 0 : tableHeadProps.sx))) }), getHeaderGroups().map((headerGroup) => (React__default["default"].createElement(MRT_TableHeadRow, { headerGroup: headerGroup, key: headerGroup.id, table: table })))));
|
|
1983
2059
|
};
|
|
1984
2060
|
|
|
1985
2061
|
const MRT_EditCellTextField = ({ cell, showLabel, table, }) => {
|
|
@@ -2028,9 +2104,9 @@ const MRT_EditCellTextField = ({ cell, showLabel, table, }) => {
|
|
|
2028
2104
|
}
|
|
2029
2105
|
};
|
|
2030
2106
|
if (columnDef.Edit) {
|
|
2031
|
-
return
|
|
2107
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null, (_a = columnDef.Edit) === null || _a === void 0 ? void 0 : _a.call(columnDef, { cell, column, row, table }));
|
|
2032
2108
|
}
|
|
2033
|
-
return (
|
|
2109
|
+
return (React__default["default"].createElement(TextField__default["default"], Object.assign({ disabled: columnDef.enableEditing === false, fullWidth: true, inputRef: (inputRef) => {
|
|
2034
2110
|
if (inputRef) {
|
|
2035
2111
|
editInputRefs.current[column.id] = inputRef;
|
|
2036
2112
|
if (textFieldProps.inputRef) {
|
|
@@ -2068,8 +2144,8 @@ const MRT_CopyButton = ({ cell, children, table, }) => {
|
|
|
2068
2144
|
})
|
|
2069
2145
|
: columnDef.muiTableBodyCellCopyButtonProps;
|
|
2070
2146
|
const buttonProps = Object.assign(Object.assign({}, mTableBodyCellCopyButtonProps), mcTableBodyCellCopyButtonProps);
|
|
2071
|
-
return (
|
|
2072
|
-
|
|
2147
|
+
return (React__default["default"].createElement(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (_a = buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.title) !== null && _a !== void 0 ? _a : (copied ? localization.copiedToClipboard : localization.clickToCopy) },
|
|
2148
|
+
React__default["default"].createElement(Button__default["default"], Object.assign({ onClick: (e) => handleCopy(e, cell.getValue()), size: "small", type: "button", variant: "text" }, buttonProps, { sx: (theme) => (Object.assign({ backgroundColor: 'transparent', border: 'none', color: 'inherit', cursor: 'copy', fontFamily: 'inherit', fontSize: 'inherit', letterSpacing: 'inherit', m: '-0.25rem', minWidth: 'unset', textAlign: 'inherit', textTransform: 'inherit' }, ((buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.sx) instanceof Function
|
|
2073
2149
|
? buttonProps.sx(theme)
|
|
2074
2150
|
: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.sx))), title: undefined }), children)));
|
|
2075
2151
|
};
|
|
@@ -2092,14 +2168,14 @@ const MRT_TableBodyRowGrabHandle = ({ cell, rowRef, table, }) => {
|
|
|
2092
2168
|
table.setDraggingRow(null);
|
|
2093
2169
|
table.setHoveredRow(null);
|
|
2094
2170
|
};
|
|
2095
|
-
return (
|
|
2171
|
+
return (React__default["default"].createElement(MRT_GrabHandleButton, { iconButtonProps: iconButtonProps, onDragStart: handleDragStart, onDragEnd: handleDragEnd, table: table }));
|
|
2096
2172
|
};
|
|
2097
2173
|
|
|
2098
2174
|
const MRT_TableBodyCellValue = ({ cell, table }) => {
|
|
2099
2175
|
var _a, _b;
|
|
2100
2176
|
const { column, row } = cell;
|
|
2101
2177
|
const { columnDef } = column;
|
|
2102
|
-
return (
|
|
2178
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null, cell.getIsAggregated() && columnDef.AggregatedCell
|
|
2103
2179
|
? columnDef.AggregatedCell({
|
|
2104
2180
|
cell,
|
|
2105
2181
|
column,
|
|
@@ -2189,7 +2265,7 @@ const MRT_TableBodyCell = ({ cell, enableHover, numRows, rowIndex, rowRef, table
|
|
|
2189
2265
|
setHoveredColumn(columnDef.enableColumnOrdering !== false ? column : null);
|
|
2190
2266
|
}
|
|
2191
2267
|
};
|
|
2192
|
-
return (
|
|
2268
|
+
return (React__default["default"].createElement(TableCell__default["default"], Object.assign({}, tableCellProps, { onDragEnter: handleDragEnter, onDoubleClick: handleDoubleClick, sx: (theme) => (Object.assign(Object.assign({ cursor: isEditable && editingMode === 'cell' ? 'pointer' : 'inherit', overflow: 'hidden', p: density === 'compact'
|
|
2193
2269
|
? columnDefType === 'display'
|
|
2194
2270
|
? '0 0.5rem'
|
|
2195
2271
|
: '0.5rem'
|
|
@@ -2216,15 +2292,15 @@ const MRT_TableBodyCell = ({ cell, enableHover, numRows, rowIndex, rowRef, table
|
|
|
2216
2292
|
: `${styles.darken(theme.palette.background.default, 0.1)} !important`
|
|
2217
2293
|
: undefined,
|
|
2218
2294
|
} }, getCommonCellStyles({ column, table, theme, tableCellProps })), draggingBorders)) }),
|
|
2219
|
-
|
|
2295
|
+
React__default["default"].createElement(React__default["default"].Fragment, null, cell.getIsPlaceholder() ? null : isLoading || showSkeletons ? (React__default["default"].createElement(Skeleton__default["default"], Object.assign({ animation: "wave", height: 20, width: skeletonWidth }, skeletonProps))) : enableRowNumbers &&
|
|
2220
2296
|
rowNumberMode === 'static' &&
|
|
2221
|
-
column.id === 'mrt-row-numbers' ? (rowIndex + 1) : column.id === 'mrt-row-drag' ? (
|
|
2297
|
+
column.id === 'mrt-row-numbers' ? (rowIndex + 1) : column.id === 'mrt-row-drag' ? (React__default["default"].createElement(MRT_TableBodyRowGrabHandle, { cell: cell, rowRef: rowRef, table: table })) : columnDefType === 'display' &&
|
|
2222
2298
|
(column.id === 'mrt-row-select' ||
|
|
2223
2299
|
column.id === 'mrt-row-expand' ||
|
|
2224
|
-
!row.getIsGrouped()) ? ((_a = columnDef.Cell) === null || _a === void 0 ? void 0 : _a.call(columnDef, { cell, column, row, table })) : isEditing ? (
|
|
2225
|
-
columnDef.enableClickToCopy !== false ? (
|
|
2226
|
-
|
|
2227
|
-
cell.getIsGrouped() && !columnDef.GroupedCell && (
|
|
2300
|
+
!row.getIsGrouped()) ? ((_a = columnDef.Cell) === null || _a === void 0 ? void 0 : _a.call(columnDef, { cell, column, row, table })) : isEditing ? (React__default["default"].createElement(MRT_EditCellTextField, { cell: cell, table: table })) : (enableClickToCopy || columnDef.enableClickToCopy) &&
|
|
2301
|
+
columnDef.enableClickToCopy !== false ? (React__default["default"].createElement(MRT_CopyButton, { cell: cell, table: table },
|
|
2302
|
+
React__default["default"].createElement(MRT_TableBodyCellValue, { cell: cell, table: table }))) : (React__default["default"].createElement(MRT_TableBodyCellValue, { cell: cell, table: table }))),
|
|
2303
|
+
cell.getIsGrouped() && !columnDef.GroupedCell && (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
2228
2304
|
" (", (_b = row.subRows) === null || _b === void 0 ? void 0 :
|
|
2229
2305
|
_b.length,
|
|
2230
2306
|
")"))));
|
|
@@ -2240,10 +2316,10 @@ const MRT_TableDetailPanel = ({ row, table }) => {
|
|
|
2240
2316
|
const tableCellProps = muiTableDetailPanelProps instanceof Function
|
|
2241
2317
|
? muiTableDetailPanelProps({ row, table })
|
|
2242
2318
|
: muiTableDetailPanelProps;
|
|
2243
|
-
return (
|
|
2244
|
-
|
|
2319
|
+
return (React__default["default"].createElement(TableRow__default["default"], Object.assign({}, tableRowProps),
|
|
2320
|
+
React__default["default"].createElement(TableCell__default["default"], Object.assign({ colSpan: getVisibleLeafColumns().length }, tableCellProps, { sx: (theme) => (Object.assign({ borderBottom: !row.getIsExpanded() ? 'none' : undefined, pb: row.getIsExpanded() ? '1rem' : 0, pt: row.getIsExpanded() ? '1rem' : 0, transition: 'all 150ms ease-in-out', width: `${table.getTotalSize()}px` }, ((tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx) instanceof Function
|
|
2245
2321
|
? tableCellProps.sx(theme)
|
|
2246
|
-
: tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx))) }), renderDetailPanel && (
|
|
2322
|
+
: tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx))) }), renderDetailPanel && (React__default["default"].createElement(Collapse__default["default"], { in: row.getIsExpanded(), mountOnEnter: true, unmountOnExit: true }, !isLoading && renderDetailPanel({ row, table }))))));
|
|
2247
2323
|
};
|
|
2248
2324
|
|
|
2249
2325
|
const MRT_TableBodyRow = ({ numRows, row, rowIndex, table, virtualRow, }) => {
|
|
@@ -2269,8 +2345,8 @@ const MRT_TableBodyRow = ({ numRows, row, rowIndex, table, virtualRow, }) => {
|
|
|
2269
2345
|
border: draggingBorder,
|
|
2270
2346
|
}
|
|
2271
2347
|
: undefined;
|
|
2272
|
-
return (
|
|
2273
|
-
|
|
2348
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
2349
|
+
React__default["default"].createElement(TableRow__default["default"], Object.assign({ onDragEnter: handleDragEnter, hover: true, selected: row.getIsSelected(), ref: (node) => {
|
|
2274
2350
|
rowRef.current = node;
|
|
2275
2351
|
if (virtualRow === null || virtualRow === void 0 ? void 0 : virtualRow.measureRef) {
|
|
2276
2352
|
virtualRow.measureRef = node;
|
|
@@ -2298,9 +2374,9 @@ const MRT_TableBodyRow = ({ numRows, row, rowIndex, table, virtualRow, }) => {
|
|
|
2298
2374
|
!draggingColumn &&
|
|
2299
2375
|
!draggingRow &&
|
|
2300
2376
|
(editingCell === null || editingCell === void 0 ? void 0 : editingCell.id) !== cell.id &&
|
|
2301
|
-
(editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) !== row.id ? (
|
|
2377
|
+
(editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) !== row.id ? (React__default["default"].createElement(Memo_MRT_TableBodyCell, Object.assign({}, props))) : (React__default["default"].createElement(MRT_TableBodyCell, Object.assign({}, props)));
|
|
2302
2378
|
})),
|
|
2303
|
-
renderDetailPanel && !row.getIsGrouped() && (
|
|
2379
|
+
renderDetailPanel && !row.getIsGrouped() && (React__default["default"].createElement(MRT_TableDetailPanel, { row: row, table: table }))));
|
|
2304
2380
|
};
|
|
2305
2381
|
const Memo_MRT_TableBodyRow = React.memo(MRT_TableBodyRow, (prev, next) => prev.row === next.row);
|
|
2306
2382
|
|
|
@@ -2372,9 +2448,9 @@ const MRT_TableBody = ({ table }) => {
|
|
|
2372
2448
|
// ? virtualizer.getTotalSize() - virtualRows[virtualRows.length - 1].end
|
|
2373
2449
|
// : 0;
|
|
2374
2450
|
// }
|
|
2375
|
-
return (
|
|
2376
|
-
|
|
2377
|
-
|
|
2451
|
+
return (React__default["default"].createElement(TableBody__default["default"], Object.assign({}, tableBodyProps), !rows.length ? (React__default["default"].createElement("tr", null,
|
|
2452
|
+
React__default["default"].createElement("td", { colSpan: table.getVisibleLeafColumns().length },
|
|
2453
|
+
React__default["default"].createElement(Typography__default["default"], { sx: {
|
|
2378
2454
|
color: 'text.secondary',
|
|
2379
2455
|
fontStyle: 'italic',
|
|
2380
2456
|
maxWidth: `min(100vw, ${(_a = tablePaperRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth}px)`,
|
|
@@ -2383,9 +2459,9 @@ const MRT_TableBody = ({ table }) => {
|
|
|
2383
2459
|
width: '100%',
|
|
2384
2460
|
} }, globalFilter || columnFilters.length
|
|
2385
2461
|
? localization.noResultsFound
|
|
2386
|
-
: localization.noRecordsToDisplay)))) : (
|
|
2387
|
-
enableRowVirtualization && paddingTop > 0 && (
|
|
2388
|
-
|
|
2462
|
+
: localization.noRecordsToDisplay)))) : (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
2463
|
+
enableRowVirtualization && paddingTop > 0 && (React__default["default"].createElement("tr", null,
|
|
2464
|
+
React__default["default"].createElement("td", { style: { height: `${paddingTop}px` } }))),
|
|
2389
2465
|
(enableRowVirtualization ? virtualRows : rows).map((rowOrVirtualRow, rowIndex) => {
|
|
2390
2466
|
const row = enableRowVirtualization
|
|
2391
2467
|
? rows[rowOrVirtualRow.index]
|
|
@@ -2400,10 +2476,10 @@ const MRT_TableBody = ({ table }) => {
|
|
|
2400
2476
|
table,
|
|
2401
2477
|
virtualRow: enableRowVirtualization ? rowOrVirtualRow : null,
|
|
2402
2478
|
};
|
|
2403
|
-
return memoMode === 'rows' ? (
|
|
2479
|
+
return memoMode === 'rows' ? (React__default["default"].createElement(Memo_MRT_TableBodyRow, Object.assign({}, props))) : (React__default["default"].createElement(MRT_TableBodyRow, Object.assign({}, props)));
|
|
2404
2480
|
}),
|
|
2405
|
-
enableRowVirtualization && paddingBottom > 0 && (
|
|
2406
|
-
|
|
2481
|
+
enableRowVirtualization && paddingBottom > 0 && (React__default["default"].createElement("tr", null,
|
|
2482
|
+
React__default["default"].createElement("td", { style: { height: `${paddingBottom}px` } })))))));
|
|
2407
2483
|
};
|
|
2408
2484
|
const Memo_MRT_TableBody = React.memo(MRT_TableBody, (prev, next) => prev.table.options.data === next.table.options.data);
|
|
2409
2485
|
|
|
@@ -2421,12 +2497,12 @@ const MRT_TableFooterCell = ({ footer, table }) => {
|
|
|
2421
2497
|
? columnDef.muiTableFooterCellProps({ column, table })
|
|
2422
2498
|
: columnDef.muiTableFooterCellProps;
|
|
2423
2499
|
const tableCellProps = Object.assign(Object.assign({}, mTableFooterCellProps), mcTableFooterCellProps);
|
|
2424
|
-
return (
|
|
2500
|
+
return (React__default["default"].createElement(TableCell__default["default"], Object.assign({ align: columnDefType === 'group' ? 'center' : 'left', colSpan: footer.colSpan, variant: "head" }, tableCellProps, { sx: (theme) => (Object.assign({ fontWeight: 'bold', p: density === 'compact'
|
|
2425
2501
|
? '0.5rem'
|
|
2426
2502
|
: density === 'comfortable'
|
|
2427
2503
|
? '1rem'
|
|
2428
2504
|
: '1.5rem', verticalAlign: 'top', zIndex: column.getIsPinned() && columnDefType !== 'group' ? 2 : 1 }, getCommonCellStyles({ column, table, theme, tableCellProps }))) }),
|
|
2429
|
-
|
|
2505
|
+
React__default["default"].createElement(React__default["default"].Fragment, null, footer.isPlaceholder
|
|
2430
2506
|
? null
|
|
2431
2507
|
: (_c = (_b = (columnDef.Footer instanceof Function
|
|
2432
2508
|
? (_a = columnDef.Footer) === null || _a === void 0 ? void 0 : _a.call(columnDef, {
|
|
@@ -2448,7 +2524,7 @@ const MRT_TableFooterRow = ({ footerGroup, table }) => {
|
|
|
2448
2524
|
const tableRowProps = muiTableFooterRowProps instanceof Function
|
|
2449
2525
|
? muiTableFooterRowProps({ footerGroup, table })
|
|
2450
2526
|
: muiTableFooterRowProps;
|
|
2451
|
-
return (
|
|
2527
|
+
return (React__default["default"].createElement(TableRow__default["default"], Object.assign({}, tableRowProps), footerGroup.headers.map((footer) => (React__default["default"].createElement(MRT_TableFooterCell, { footer: footer, key: footer.id, table: table })))));
|
|
2452
2528
|
};
|
|
2453
2529
|
|
|
2454
2530
|
const MRT_TableFooter = ({ table }) => {
|
|
@@ -2458,13 +2534,13 @@ const MRT_TableFooter = ({ table }) => {
|
|
|
2458
2534
|
? muiTableFooterProps({ table })
|
|
2459
2535
|
: muiTableFooterProps;
|
|
2460
2536
|
const stickFooter = (isFullScreen || enableStickyFooter) && enableStickyFooter !== false;
|
|
2461
|
-
return (
|
|
2537
|
+
return (React__default["default"].createElement(TableFooter__default["default"], Object.assign({}, tableFooterProps, { sx: (theme) => (Object.assign({ backgroundColor: styles.lighten(theme.palette.background.default, 0.06), bottom: stickFooter ? 0 : undefined, opacity: stickFooter ? 0.97 : undefined, outline: stickFooter
|
|
2462
2538
|
? theme.palette.mode === 'light'
|
|
2463
2539
|
? `1px solid ${theme.palette.grey[300]}`
|
|
2464
2540
|
: `1px solid ${theme.palette.grey[700]}`
|
|
2465
2541
|
: undefined, position: stickFooter ? 'sticky' : undefined }, ((tableFooterProps === null || tableFooterProps === void 0 ? void 0 : tableFooterProps.sx) instanceof Function
|
|
2466
2542
|
? tableFooterProps === null || tableFooterProps === void 0 ? void 0 : tableFooterProps.sx(theme)
|
|
2467
|
-
: tableFooterProps === null || tableFooterProps === void 0 ? void 0 : tableFooterProps.sx))) }), getFooterGroups().map((footerGroup) => (
|
|
2543
|
+
: tableFooterProps === null || tableFooterProps === void 0 ? void 0 : tableFooterProps.sx))) }), getFooterGroups().map((footerGroup) => (React__default["default"].createElement(MRT_TableFooterRow, { footerGroup: footerGroup, key: footerGroup.id, table: table })))));
|
|
2468
2544
|
};
|
|
2469
2545
|
|
|
2470
2546
|
const MRT_Table = ({ table }) => {
|
|
@@ -2473,12 +2549,12 @@ const MRT_Table = ({ table }) => {
|
|
|
2473
2549
|
const tableProps = muiTableProps instanceof Function
|
|
2474
2550
|
? muiTableProps({ table })
|
|
2475
2551
|
: muiTableProps;
|
|
2476
|
-
return (
|
|
2552
|
+
return (React__default["default"].createElement(Table__default["default"], Object.assign({ stickyHeader: enableStickyHeader || enableRowVirtualization || isFullScreen }, tableProps, { sx: (theme) => (Object.assign({ tableLayout: enableColumnResizing || enableRowVirtualization ? 'fixed' : 'auto' }, ((tableProps === null || tableProps === void 0 ? void 0 : tableProps.sx) instanceof Function
|
|
2477
2553
|
? tableProps.sx(theme)
|
|
2478
2554
|
: tableProps === null || tableProps === void 0 ? void 0 : tableProps.sx))) }),
|
|
2479
|
-
enableTableHead &&
|
|
2480
|
-
memoMode === 'table-body' ? (
|
|
2481
|
-
enableTableFooter &&
|
|
2555
|
+
enableTableHead && React__default["default"].createElement(MRT_TableHead, { table: table }),
|
|
2556
|
+
memoMode === 'table-body' ? (React__default["default"].createElement(Memo_MRT_TableBody, { table: table })) : (React__default["default"].createElement(MRT_TableBody, { table: table })),
|
|
2557
|
+
enableTableFooter && React__default["default"].createElement(MRT_TableFooter, { table: table })));
|
|
2482
2558
|
};
|
|
2483
2559
|
|
|
2484
2560
|
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
@@ -2499,7 +2575,7 @@ const MRT_TableContainer = ({ table }) => {
|
|
|
2499
2575
|
: 0;
|
|
2500
2576
|
setTotalToolbarHeight(topToolbarHeight + bottomToolbarHeight);
|
|
2501
2577
|
});
|
|
2502
|
-
return (
|
|
2578
|
+
return (React__default["default"].createElement(TableContainer__default["default"], Object.assign({}, tableContainerProps, { ref: (ref) => {
|
|
2503
2579
|
tableContainerRef.current = ref;
|
|
2504
2580
|
if (tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.ref) {
|
|
2505
2581
|
//@ts-ignore
|
|
@@ -2512,7 +2588,7 @@ const MRT_TableContainer = ({ table }) => {
|
|
|
2512
2588
|
: tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.sx))), style: Object.assign({ maxHeight: isFullScreen
|
|
2513
2589
|
? `calc(100vh - ${totalToolbarHeight}px)`
|
|
2514
2590
|
: undefined }, tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.style) }),
|
|
2515
|
-
|
|
2591
|
+
React__default["default"].createElement(MRT_Table, { table: table })));
|
|
2516
2592
|
};
|
|
2517
2593
|
|
|
2518
2594
|
const MRT_TablePaper = ({ table }) => {
|
|
@@ -2521,7 +2597,7 @@ const MRT_TablePaper = ({ table }) => {
|
|
|
2521
2597
|
const tablePaperProps = muiTablePaperProps instanceof Function
|
|
2522
2598
|
? muiTablePaperProps({ table })
|
|
2523
2599
|
: muiTablePaperProps;
|
|
2524
|
-
return (
|
|
2600
|
+
return (React__default["default"].createElement(Paper__default["default"], Object.assign({ elevation: 2 }, tablePaperProps, { ref: (ref) => {
|
|
2525
2601
|
tablePaperRef.current = ref;
|
|
2526
2602
|
if (tablePaperProps === null || tablePaperProps === void 0 ? void 0 : tablePaperProps.ref) {
|
|
2527
2603
|
//@ts-ignore
|
|
@@ -2542,21 +2618,21 @@ const MRT_TablePaper = ({ table }) => {
|
|
|
2542
2618
|
enableTopToolbar &&
|
|
2543
2619
|
(renderTopToolbar instanceof Function
|
|
2544
2620
|
? renderTopToolbar({ table })
|
|
2545
|
-
: renderTopToolbar !== null && renderTopToolbar !== void 0 ? renderTopToolbar :
|
|
2546
|
-
|
|
2621
|
+
: renderTopToolbar !== null && renderTopToolbar !== void 0 ? renderTopToolbar : React__default["default"].createElement(MRT_TopToolbar, { table: table })),
|
|
2622
|
+
React__default["default"].createElement(MRT_TableContainer, { table: table }),
|
|
2547
2623
|
enableBottomToolbar &&
|
|
2548
2624
|
(renderBottomToolbar instanceof Function
|
|
2549
2625
|
? renderBottomToolbar({ table })
|
|
2550
|
-
: renderBottomToolbar !== null && renderBottomToolbar !== void 0 ? renderBottomToolbar :
|
|
2626
|
+
: renderBottomToolbar !== null && renderBottomToolbar !== void 0 ? renderBottomToolbar : React__default["default"].createElement(MRT_BottomToolbar, { table: table }))));
|
|
2551
2627
|
};
|
|
2552
2628
|
|
|
2553
2629
|
const MRT_EditRowModal = ({ open, row, table, }) => {
|
|
2554
2630
|
const { options: { localization }, } = table;
|
|
2555
|
-
return (
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2631
|
+
return (React__default["default"].createElement(Dialog__default["default"], { open: open },
|
|
2632
|
+
React__default["default"].createElement(DialogTitle__default["default"], { textAlign: "center" }, localization.edit),
|
|
2633
|
+
React__default["default"].createElement(DialogContent__default["default"], null,
|
|
2634
|
+
React__default["default"].createElement("form", { onSubmit: (e) => e.preventDefault() },
|
|
2635
|
+
React__default["default"].createElement(Stack__default["default"], { sx: {
|
|
2560
2636
|
gap: '1.5rem',
|
|
2561
2637
|
minWidth: { xs: '300px', sm: '360px', md: '400px' },
|
|
2562
2638
|
pt: '1rem',
|
|
@@ -2564,9 +2640,9 @@ const MRT_EditRowModal = ({ open, row, table, }) => {
|
|
|
2564
2640
|
} }, row
|
|
2565
2641
|
.getAllCells()
|
|
2566
2642
|
.filter((cell) => cell.column.columnDef.columnDefType === 'data')
|
|
2567
|
-
.map((cell) => (
|
|
2568
|
-
|
|
2569
|
-
|
|
2643
|
+
.map((cell) => (React__default["default"].createElement(MRT_EditCellTextField, { cell: cell, key: cell.id, showLabel: true, table: table })))))),
|
|
2644
|
+
React__default["default"].createElement(DialogActions__default["default"], { sx: { p: '1.25rem' } },
|
|
2645
|
+
React__default["default"].createElement(MRT_EditActionButtons, { row: row, table: table, variant: "text" }))));
|
|
2570
2646
|
};
|
|
2571
2647
|
|
|
2572
2648
|
const MRT_TableRoot = (props) => {
|
|
@@ -2613,13 +2689,13 @@ const MRT_TableRoot = (props) => {
|
|
|
2613
2689
|
var _a, _b, _c, _d, _e;
|
|
2614
2690
|
return [
|
|
2615
2691
|
columnOrder.includes('mrt-row-drag') && Object.assign(Object.assign(Object.assign({ header: props.localization.move, size: 60 }, props.defaultDisplayColumn), (_a = props.displayColumnDefOptions) === null || _a === void 0 ? void 0 : _a['mrt-row-drag']), { id: 'mrt-row-drag' }),
|
|
2616
|
-
columnOrder.includes('mrt-row-actions') && Object.assign(Object.assign(Object.assign({ Cell: ({ cell, row }) => (
|
|
2692
|
+
columnOrder.includes('mrt-row-actions') && Object.assign(Object.assign(Object.assign({ Cell: ({ cell, row }) => (React__default["default"].createElement(MRT_ToggleRowActionMenuButton, { cell: cell, row: row, table: table })), header: props.localization.actions, size: 70 }, props.defaultDisplayColumn), (_b = props.displayColumnDefOptions) === null || _b === void 0 ? void 0 : _b['mrt-row-actions']), { id: 'mrt-row-actions' }),
|
|
2617
2693
|
columnOrder.includes('mrt-row-expand') &&
|
|
2618
|
-
showExpandColumn(props, grouping) && Object.assign(Object.assign(Object.assign({ Cell: ({ row }) => (
|
|
2619
|
-
? () =>
|
|
2694
|
+
showExpandColumn(props, grouping) && Object.assign(Object.assign(Object.assign({ Cell: ({ row }) => (React__default["default"].createElement(MRT_ExpandButton, { row: row, table: table })), Header: props.enableExpandAll
|
|
2695
|
+
? () => React__default["default"].createElement(MRT_ExpandAllButton, { table: table })
|
|
2620
2696
|
: null, header: props.localization.expand, size: 60 }, props.defaultDisplayColumn), (_c = props.displayColumnDefOptions) === null || _c === void 0 ? void 0 : _c['mrt-row-expand']), { id: 'mrt-row-expand' }),
|
|
2621
|
-
columnOrder.includes('mrt-row-select') && Object.assign(Object.assign(Object.assign({ Cell: ({ row }) => (
|
|
2622
|
-
? () =>
|
|
2697
|
+
columnOrder.includes('mrt-row-select') && Object.assign(Object.assign(Object.assign({ Cell: ({ row }) => (React__default["default"].createElement(MRT_SelectCheckbox, { row: row, table: table })), Header: props.enableSelectAll && props.enableMultiRowSelection
|
|
2698
|
+
? () => React__default["default"].createElement(MRT_SelectCheckbox, { selectAll: true, table: table })
|
|
2623
2699
|
: null, header: props.localization.select, size: 60 }, props.defaultDisplayColumn), (_d = props.displayColumnDefOptions) === null || _d === void 0 ? void 0 : _d['mrt-row-select']), { id: 'mrt-row-select' }),
|
|
2624
2700
|
columnOrder.includes('mrt-row-numbers') && Object.assign(Object.assign(Object.assign({ Cell: ({ row }) => row.index + 1, Header: () => props.localization.rowNumber, header: props.localization.rowNumbers, size: 60 }, props.defaultDisplayColumn), (_e = props.displayColumnDefOptions) === null || _e === void 0 ? void 0 : _e['mrt-row-numbers']), { id: 'mrt-row-numbers' }),
|
|
2625
2701
|
].filter(Boolean);
|
|
@@ -2723,11 +2799,11 @@ const MRT_TableRoot = (props) => {
|
|
|
2723
2799
|
}
|
|
2724
2800
|
}
|
|
2725
2801
|
}, [table.getState().isFullScreen]);
|
|
2726
|
-
return (
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
!table.getState().isFullScreen && (
|
|
2730
|
-
editingRow && props.editingMode === 'modal' && (
|
|
2802
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
2803
|
+
React__default["default"].createElement(Dialog__default["default"], { PaperComponent: Box__default["default"], TransitionComponent: Grow__default["default"], disablePortal: true, fullScreen: true, keepMounted: false, onClose: () => table.setIsFullScreen(false), open: table.getState().isFullScreen, transitionDuration: 400 },
|
|
2804
|
+
React__default["default"].createElement(MRT_TablePaper, { table: table })),
|
|
2805
|
+
!table.getState().isFullScreen && (React__default["default"].createElement(MRT_TablePaper, { table: table })),
|
|
2806
|
+
editingRow && props.editingMode === 'modal' && (React__default["default"].createElement(MRT_EditRowModal, { row: editingRow, table: table, open: true }))));
|
|
2731
2807
|
};
|
|
2732
2808
|
|
|
2733
2809
|
const MRT_Localization_EN = {
|
|
@@ -2829,7 +2905,7 @@ const MaterialReactTable = (_a) => {
|
|
|
2829
2905
|
const _sortingFns = React.useMemo(() => (Object.assign(Object.assign({}, MRT_SortingFns), sortingFns)), []);
|
|
2830
2906
|
const _defaultColumn = React.useMemo(() => (Object.assign(Object.assign({}, MRT_DefaultColumn), defaultColumn)), []);
|
|
2831
2907
|
const _defaultDisplayColumn = React.useMemo(() => (Object.assign(Object.assign({}, MRT_DefaultDisplayColumn), defaultDisplayColumn)), []);
|
|
2832
|
-
return (
|
|
2908
|
+
return (React__default["default"].createElement(MRT_TableRoot, Object.assign({ aggregationFns: _aggregationFns, autoResetExpanded: autoResetExpanded, columnResizeMode: columnResizeMode, defaultColumn: _defaultColumn, defaultDisplayColumn: _defaultDisplayColumn, editingMode: editingMode, enableBottomToolbar: enableBottomToolbar, enableColumnActions: enableColumnActions, enableColumnFilters: enableColumnFilters, enableColumnOrdering: enableColumnOrdering, enableColumnResizing: enableColumnResizing, enableDensityToggle: enableDensityToggle, enableExpandAll: enableExpandAll, enableFilters: enableFilters, enableFullScreenToggle: enableFullScreenToggle, enableGlobalFilter: enableGlobalFilter, enableGlobalFilterRankedResults: enableGlobalFilterRankedResults, enableGrouping: enableGrouping, enableHiding: enableHiding, enableMultiRowSelection: enableMultiRowSelection, enableMultiSort: enableMultiSort, enablePagination: enablePagination, enablePinning: enablePinning, enableRowSelection: enableRowSelection, enableSelectAll: enableSelectAll, enableSorting: enableSorting, enableStickyHeader: enableStickyHeader, enableTableFooter: enableTableFooter, enableTableHead: enableTableHead, enableToolbarInternalActions: enableToolbarInternalActions, enableTopToolbar: enableTopToolbar, filterFns: _filterFns, icons: _icons, localization: _localization, positionActionsColumn: positionActionsColumn, positionExpandColumn: positionExpandColumn, positionGlobalFilter: positionGlobalFilter, positionPagination: positionPagination, positionToolbarAlertBanner: positionToolbarAlertBanner, positionToolbarDropZone: positionToolbarDropZone, rowNumberMode: rowNumberMode, selectAllMode: selectAllMode, sortingFns: _sortingFns }, rest)));
|
|
2833
2909
|
};
|
|
2834
2910
|
|
|
2835
2911
|
exports.MRT_CopyButton = MRT_CopyButton;
|
|
@@ -2842,5 +2918,5 @@ exports.MRT_ToggleDensePaddingButton = MRT_ToggleDensePaddingButton;
|
|
|
2842
2918
|
exports.MRT_ToggleFiltersButton = MRT_ToggleFiltersButton;
|
|
2843
2919
|
exports.MRT_ToggleGlobalFilterButton = MRT_ToggleGlobalFilterButton;
|
|
2844
2920
|
exports.MRT_ToolbarInternalButtons = MRT_ToolbarInternalButtons;
|
|
2845
|
-
exports
|
|
2921
|
+
exports["default"] = MaterialReactTable;
|
|
2846
2922
|
//# sourceMappingURL=index.js.map
|