material-react-table 1.12.0 → 1.13.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 +264 -161
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/MaterialReactTable.d.ts +1 -1
- package/dist/cjs/types/inputs/MRT_FilterRangeSlider.d.ts +7 -0
- package/dist/cjs/types/types.d.ts +12 -2
- package/dist/esm/material-react-table.esm.js +268 -167
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/types/MaterialReactTable.d.ts +1 -1
- package/dist/esm/types/inputs/MRT_FilterRangeSlider.d.ts +7 -0
- package/dist/esm/types/types.d.ts +12 -2
- package/dist/index.d.ts +14 -10
- package/locales/cs.esm.js +89 -91
- package/locales/cs.js +89 -91
- package/locales/da.esm.js +89 -90
- package/locales/da.js +89 -90
- package/locales/de.esm.js +89 -90
- package/locales/de.js +89 -90
- package/locales/en.esm.js +89 -90
- package/locales/en.js +89 -90
- package/locales/es.esm.js +89 -90
- package/locales/es.js +89 -90
- package/locales/fa.esm.js +89 -90
- package/locales/fa.js +89 -90
- package/locales/fi.esm.js +89 -91
- package/locales/fi.js +89 -91
- package/locales/fr.esm.js +89 -90
- package/locales/fr.js +89 -90
- package/locales/hu.esm.js +89 -90
- package/locales/hu.js +89 -90
- package/locales/id.esm.js +89 -91
- package/locales/id.js +89 -91
- package/locales/it.esm.js +89 -90
- package/locales/it.js +89 -90
- package/locales/ja.esm.js +89 -90
- package/locales/ja.js +89 -90
- package/locales/nl.esm.js +89 -90
- package/locales/nl.js +89 -90
- package/locales/pl.esm.js +89 -90
- package/locales/pl.js +89 -90
- package/locales/pt-BR.esm.js +89 -90
- package/locales/pt-BR.js +89 -90
- package/locales/pt.esm.js +89 -90
- package/locales/pt.js +89 -90
- package/locales/ro.esm.js +89 -90
- package/locales/ro.js +89 -90
- package/locales/ru.esm.js +89 -90
- package/locales/ru.js +89 -90
- package/locales/sk.esm.js +89 -91
- package/locales/sk.js +89 -91
- package/locales/sr-Cyrl-RS.esm.js +89 -90
- package/locales/sr-Cyrl-RS.js +89 -90
- package/locales/sr-Latn-RS.esm.js +89 -90
- package/locales/sr-Latn-RS.js +89 -90
- package/locales/sv.esm.js +89 -90
- package/locales/sv.js +89 -90
- package/locales/tr.esm.js +89 -90
- package/locales/tr.js +89 -90
- package/locales/uk.esm.js +89 -90
- package/locales/uk.js +89 -90
- package/locales/vi.esm.js +89 -90
- package/locales/vi.js +89 -90
- package/locales/zh-Hans.esm.js +89 -89
- package/locales/zh-Hans.js +89 -89
- package/locales/zh-Hant.esm.js +89 -89
- package/locales/zh-Hant.js +89 -89
- package/package.json +23 -23
- package/src/MaterialReactTable.tsx +2 -0
- package/src/body/MRT_TableBody.tsx +2 -3
- package/src/body/MRT_TableBodyRow.tsx +2 -3
- package/src/column.utils.ts +5 -1
- package/src/head/MRT_TableHeadCellFilterContainer.tsx +4 -1
- package/src/inputs/MRT_FilterRangeFields.tsx +1 -1
- package/src/inputs/MRT_FilterRangeSlider.tsx +134 -0
- package/src/inputs/MRT_FilterTextField.tsx +24 -3
- package/src/menus/MRT_FilterOptionMenu.tsx +8 -1
- package/src/table/MRT_TableRoot.tsx +28 -6
- package/src/types.ts +22 -2
package/dist/cjs/index.js
CHANGED
@@ -69,6 +69,7 @@ var Table = require('@mui/material/Table');
|
|
69
69
|
var TableHead = require('@mui/material/TableHead');
|
70
70
|
var TableRow = require('@mui/material/TableRow');
|
71
71
|
var TableCell = require('@mui/material/TableCell');
|
72
|
+
var material = require('@mui/material');
|
72
73
|
var Badge = require('@mui/material/Badge');
|
73
74
|
var TableSortLabel = require('@mui/material/TableSortLabel');
|
74
75
|
var TableBody = require('@mui/material/TableBody');
|
@@ -153,19 +154,19 @@ var DialogContent__default = /*#__PURE__*/_interopDefaultLegacy(DialogContent);
|
|
153
154
|
var DialogTitle__default = /*#__PURE__*/_interopDefaultLegacy(DialogTitle);
|
154
155
|
var Stack__default = /*#__PURE__*/_interopDefaultLegacy(Stack);
|
155
156
|
|
156
|
-
/******************************************************************************
|
157
|
-
Copyright (c) Microsoft Corporation.
|
158
|
-
|
159
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
160
|
-
purpose with or without fee is hereby granted.
|
161
|
-
|
162
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
163
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
164
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
165
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
166
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
167
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
168
|
-
PERFORMANCE OF THIS SOFTWARE.
|
157
|
+
/******************************************************************************
|
158
|
+
Copyright (c) Microsoft Corporation.
|
159
|
+
|
160
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
161
|
+
purpose with or without fee is hereby granted.
|
162
|
+
|
163
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
164
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
165
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
166
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
167
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
168
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
169
|
+
PERFORMANCE OF THIS SOFTWARE.
|
169
170
|
***************************************************************************** */
|
170
171
|
function __rest(s, e) {
|
171
172
|
var t = {};
|
@@ -391,7 +392,8 @@ const getDefaultColumnOrderIds = (props) => {
|
|
391
392
|
const getDefaultColumnFilterFn = (columnDef) => {
|
392
393
|
if (columnDef.filterVariant === 'multi-select')
|
393
394
|
return 'arrIncludesSome';
|
394
|
-
if (columnDef.filterVariant === 'range'
|
395
|
+
if (columnDef.filterVariant === 'range' ||
|
396
|
+
columnDef.filterVariant === 'range-slider')
|
395
397
|
return 'betweenInclusive';
|
396
398
|
if (columnDef.filterVariant === 'select' ||
|
397
399
|
columnDef.filterVariant === 'checkbox')
|
@@ -611,14 +613,14 @@ const MRT_ExpandAllButton = ({ table }) => {
|
|
611
613
|
? muiExpandAllButtonProps({ table })
|
612
614
|
: muiExpandAllButtonProps;
|
613
615
|
const isAllRowsExpanded = getIsAllRowsExpanded();
|
614
|
-
return (jsxRuntime.jsx(Tooltip__default["default"],
|
616
|
+
return (jsxRuntime.jsx(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 : isAllRowsExpanded)
|
615
617
|
? localization.collapseAll
|
616
|
-
: localization.expandAll
|
618
|
+
: localization.expandAll, children: jsxRuntime.jsx("span", { children: jsxRuntime.jsx(IconButton__default["default"], Object.assign({ "aria-label": localization.expandAll, disabled: isLoading || (!renderDetailPanel && !getCanSomeRowsExpand()), onClick: () => toggleAllRowsExpanded(!isAllRowsExpanded) }, 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
|
617
619
|
? iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx(theme)
|
618
|
-
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined
|
620
|
+
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined, children: (_b = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.children) !== null && _b !== void 0 ? _b : (jsxRuntime.jsx(KeyboardDoubleArrowDownIcon, { style: {
|
619
621
|
transform: `rotate(${isAllRowsExpanded ? -180 : getIsSomeRowsExpanded() ? -90 : 0}deg)`,
|
620
622
|
transition: 'transform 150ms',
|
621
|
-
} })) })) }) }))
|
623
|
+
} })) })) }) }));
|
622
624
|
};
|
623
625
|
|
624
626
|
const MRT_ExpandButton = ({ row, table, }) => {
|
@@ -636,14 +638,14 @@ const MRT_ExpandButton = ({ row, table, }) => {
|
|
636
638
|
row.toggleExpanded();
|
637
639
|
(_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(iconButtonProps, event);
|
638
640
|
};
|
639
|
-
return (jsxRuntime.jsx(Tooltip__default["default"],
|
641
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, disableHoverListener: !canExpand && !renderDetailPanel, enterDelay: 1000, enterNextDelay: 1000, title: ((_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : isExpanded)
|
640
642
|
? localization.collapse
|
641
|
-
: localization.expand
|
643
|
+
: localization.expand, children: jsxRuntime.jsx("span", { children: jsxRuntime.jsx(IconButton__default["default"], Object.assign({ "aria-label": localization.expand, disabled: !canExpand && !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
|
642
644
|
? iconButtonProps.sx(theme)
|
643
|
-
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined
|
645
|
+
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined, children: (_b = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.children) !== null && _b !== void 0 ? _b : (jsxRuntime.jsx(ExpandMoreIcon, { style: {
|
644
646
|
transform: `rotate(${!canExpand && !renderDetailPanel ? -90 : isExpanded ? -180 : 0}deg)`,
|
645
647
|
transition: 'transform 150ms',
|
646
|
-
} })) })) }) }))
|
648
|
+
} })) })) }) }));
|
647
649
|
};
|
648
650
|
|
649
651
|
const mrtFilterOptions = (localization) => [
|
@@ -742,7 +744,13 @@ const MRT_FilterOptionMenu = ({ anchorEl, header, onSelect, setAnchorEl, setFilt
|
|
742
744
|
const { column } = header !== null && header !== void 0 ? header : {};
|
743
745
|
const { columnDef } = column !== null && column !== void 0 ? column : {};
|
744
746
|
const currentFilterValue = column === null || column === void 0 ? void 0 : column.getFilterValue();
|
745
|
-
|
747
|
+
let allowedColumnFilterOptions = (_a = columnDef === null || columnDef === void 0 ? void 0 : columnDef.columnFilterModeOptions) !== null && _a !== void 0 ? _a : columnFilterModeOptions;
|
748
|
+
if ((columnDef === null || columnDef === void 0 ? void 0 : columnDef.filterVariant) === 'range-slider') {
|
749
|
+
allowedColumnFilterOptions = [
|
750
|
+
...rangeModes,
|
751
|
+
...(allowedColumnFilterOptions !== null && allowedColumnFilterOptions !== void 0 ? allowedColumnFilterOptions : []),
|
752
|
+
].filter((option) => rangeModes.includes(option));
|
753
|
+
}
|
746
754
|
const internalFilterOptions = react.useMemo(() => mrtFilterOptions(localization).filter((filterOption) => columnDef
|
747
755
|
? allowedColumnFilterOptions === undefined ||
|
748
756
|
(allowedColumnFilterOptions === null || allowedColumnFilterOptions === void 0 ? void 0 : allowedColumnFilterOptions.includes(filterOption.option))
|
@@ -810,9 +818,9 @@ const MRT_FilterOptionMenu = ({ anchorEl, header, onSelect, setAnchorEl, setFilt
|
|
810
818
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect();
|
811
819
|
};
|
812
820
|
const filterOption = !!header && columnDef ? columnDef._filterFn : globalFilterFn;
|
813
|
-
return (jsxRuntime.jsx(Menu__default["default"],
|
821
|
+
return (jsxRuntime.jsx(Menu__default["default"], { anchorEl: anchorEl, anchorOrigin: { vertical: 'center', horizontal: 'right' }, onClose: () => setAnchorEl(null), open: !!anchorEl, MenuListProps: {
|
814
822
|
dense: density === 'compact',
|
815
|
-
}
|
823
|
+
}, children: (_d = (header && column && columnDef
|
816
824
|
? (_c = (_b = columnDef.renderColumnFilterModeMenuItems) === null || _b === void 0 ? void 0 : _b.call(columnDef, {
|
817
825
|
column: column,
|
818
826
|
internalFilterOptions,
|
@@ -828,13 +836,13 @@ const MRT_FilterOptionMenu = ({ anchorEl, header, onSelect, setAnchorEl, setFilt
|
|
828
836
|
internalFilterOptions,
|
829
837
|
onSelectFilterMode: handleSelectFilterMode,
|
830
838
|
table,
|
831
|
-
}))) !== null && _d !== void 0 ? _d : internalFilterOptions.map(({ option, label, divider, symbol }, index) => (jsxRuntime.jsxs(MenuItem__default["default"],
|
839
|
+
}))) !== null && _d !== void 0 ? _d : internalFilterOptions.map(({ option, label, divider, symbol }, index) => (jsxRuntime.jsxs(MenuItem__default["default"], { divider: divider, onClick: () => handleSelectFilterMode(option), selected: option === filterOption, sx: {
|
832
840
|
alignItems: 'center',
|
833
841
|
display: 'flex',
|
834
842
|
gap: '2ch',
|
835
843
|
my: 0,
|
836
844
|
py: '6px',
|
837
|
-
}, value: option
|
845
|
+
}, value: option, children: [jsxRuntime.jsx(Box__default["default"], { sx: { fontSize: '1.25rem', width: '2ch' }, children: symbol }), label] }, index))) }));
|
838
846
|
};
|
839
847
|
|
840
848
|
const commonMenuItemStyles = {
|
@@ -908,9 +916,9 @@ const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
|
|
908
916
|
!isSelectFilter &&
|
909
917
|
(allowedColumnFilterOptions === undefined ||
|
910
918
|
!!(allowedColumnFilterOptions === null || allowedColumnFilterOptions === void 0 ? void 0 : allowedColumnFilterOptions.length));
|
911
|
-
return (jsxRuntime.jsxs(Menu__default["default"],
|
919
|
+
return (jsxRuntime.jsxs(Menu__default["default"], { anchorEl: anchorEl, open: !!anchorEl, onClose: () => setAnchorEl(null), MenuListProps: {
|
912
920
|
dense: density === 'compact',
|
913
|
-
}
|
921
|
+
}, children: [(_d = (_c = (_b = columnDef.renderColumnActionsMenuItems) === null || _b === void 0 ? void 0 : _b.call(columnDef, {
|
914
922
|
closeMenu: () => setAnchorEl(null),
|
915
923
|
column,
|
916
924
|
table,
|
@@ -921,47 +929,47 @@ const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
|
|
921
929
|
})) !== null && _d !== void 0 ? _d : (enableSorting &&
|
922
930
|
column.getCanSort() &&
|
923
931
|
[
|
924
|
-
enableSortingRemoval !== false && (jsxRuntime.jsx(MenuItem__default["default"],
|
925
|
-
jsxRuntime.jsx(MenuItem__default["default"],
|
926
|
-
jsxRuntime.jsx(MenuItem__default["default"],
|
932
|
+
enableSortingRemoval !== false && (jsxRuntime.jsx(MenuItem__default["default"], { disabled: !column.getIsSorted(), onClick: handleClearSort, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(ClearAllIcon, {}) }), localization.clearSort] }) }, 0)),
|
933
|
+
jsxRuntime.jsx(MenuItem__default["default"], { disabled: column.getIsSorted() === 'asc', onClick: handleSortAsc, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(SortIcon, { style: { transform: 'rotate(180deg) scaleX(-1)' } }) }), (_e = localization.sortByColumnAsc) === null || _e === void 0 ? void 0 : _e.replace('{column}', String(columnDef.header))] }) }, 1),
|
934
|
+
jsxRuntime.jsx(MenuItem__default["default"], { divider: enableColumnFilters || enableGrouping || enableHiding, disabled: column.getIsSorted() === 'desc', onClick: handleSortDesc, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(SortIcon, {}) }), (_f = localization.sortByColumnDesc) === null || _f === void 0 ? void 0 : _f.replace('{column}', String(columnDef.header))] }) }, 2),
|
927
935
|
].filter(Boolean)), enableColumnFilters &&
|
928
936
|
column.getCanFilter() &&
|
929
937
|
[
|
930
|
-
jsxRuntime.jsx(MenuItem__default["default"],
|
931
|
-
jsxRuntime.jsxs(MenuItem__default["default"],
|
938
|
+
jsxRuntime.jsx(MenuItem__default["default"], { disabled: !column.getFilterValue(), onClick: handleClearFilter, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(FilterListOffIcon, {}) }), localization.clearFilter] }) }, 0),
|
939
|
+
jsxRuntime.jsxs(MenuItem__default["default"], { disabled: showColumnFilters && !enableColumnFilterModes, divider: enableGrouping || enableHiding, onClick: showColumnFilters
|
932
940
|
? handleOpenFilterModeMenu
|
933
|
-
: handleFilterByColumn, sx: commonMenuItemStyles
|
941
|
+
: handleFilterByColumn, sx: commonMenuItemStyles, children: [jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(FilterListIcon, {}) }), (_g = localization.filterByColumn) === null || _g === void 0 ? void 0 : _g.replace('{column}', String(columnDef.header))] }), showFilterModeSubMenu && (jsxRuntime.jsx(IconButton__default["default"], { onClick: handleOpenFilterModeMenu, onMouseEnter: handleOpenFilterModeMenu, size: "small", sx: { p: 0 }, children: jsxRuntime.jsx(ArrowRightIcon, {}) }))] }, 1),
|
934
942
|
showFilterModeSubMenu && (jsxRuntime.jsx(MRT_FilterOptionMenu, { anchorEl: filterMenuAnchorEl, header: header, onSelect: handleFilterByColumn, setAnchorEl: setFilterMenuAnchorEl, table: table }, 2)),
|
935
943
|
].filter(Boolean), enableGrouping &&
|
936
944
|
column.getCanGroup() && [
|
937
|
-
jsxRuntime.jsx(MenuItem__default["default"],
|
945
|
+
jsxRuntime.jsx(MenuItem__default["default"], { divider: enablePinning, onClick: handleGroupByColumn, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(DynamicFeedIcon, {}) }), (_h = localization[column.getIsGrouped() ? 'ungroupByColumn' : 'groupByColumn']) === null || _h === void 0 ? void 0 : _h.replace('{column}', String(columnDef.header))] }) }, 0),
|
938
946
|
], enablePinning &&
|
939
947
|
column.getCanPin() && [
|
940
|
-
jsxRuntime.jsx(MenuItem__default["default"],
|
941
|
-
jsxRuntime.jsx(MenuItem__default["default"],
|
942
|
-
jsxRuntime.jsx(MenuItem__default["default"],
|
948
|
+
jsxRuntime.jsx(MenuItem__default["default"], { disabled: column.getIsPinned() === 'left' || !column.getCanPin(), onClick: () => handlePinColumn('left'), sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(PushPinIcon, { style: { transform: 'rotate(90deg)' } }) }), localization.pinToLeft] }) }, 0),
|
949
|
+
jsxRuntime.jsx(MenuItem__default["default"], { disabled: column.getIsPinned() === 'right' || !column.getCanPin(), onClick: () => handlePinColumn('right'), sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(PushPinIcon, { style: { transform: 'rotate(-90deg)' } }) }), localization.pinToRight] }) }, 1),
|
950
|
+
jsxRuntime.jsx(MenuItem__default["default"], { disabled: !column.getIsPinned(), divider: enableHiding, onClick: () => handlePinColumn(false), sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(PushPinIcon, {}) }), localization.unpin] }) }, 2),
|
943
951
|
], enableColumnResizing &&
|
944
952
|
column.getCanResize() && [
|
945
|
-
jsxRuntime.jsx(MenuItem__default["default"],
|
953
|
+
jsxRuntime.jsx(MenuItem__default["default"], { disabled: !columnSizing[column.id], onClick: handleResetColumnSize, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(RestartAltIcon, {}) }), localization.resetColumnSize] }) }, 0),
|
946
954
|
], enableHiding && [
|
947
|
-
jsxRuntime.jsx(MenuItem__default["default"],
|
948
|
-
jsxRuntime.jsx(MenuItem__default["default"],
|
949
|
-
.length, onClick: handleShowAllColumns, sx: commonMenuItemStyles
|
950
|
-
]] }))
|
955
|
+
jsxRuntime.jsx(MenuItem__default["default"], { disabled: !column.getCanHide(), onClick: handleHideColumn, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(VisibilityOffIcon, {}) }), (_j = localization.hideColumn) === null || _j === void 0 ? void 0 : _j.replace('{column}', String(columnDef.header))] }) }, 0),
|
956
|
+
jsxRuntime.jsx(MenuItem__default["default"], { disabled: !Object.values(columnVisibility).filter((visible) => !visible)
|
957
|
+
.length, onClick: handleShowAllColumns, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(ViewColumnIcon, {}) }), (_k = localization.showAllColumns) === null || _k === void 0 ? void 0 : _k.replace('{column}', String(columnDef.header))] }) }, 1),
|
958
|
+
]] }));
|
951
959
|
};
|
952
960
|
|
953
961
|
const MRT_RowActionMenu = ({ anchorEl, handleEdit, row, setAnchorEl, table, }) => {
|
954
962
|
const { getState, options: { icons: { EditIcon }, enableEditing, localization, renderRowActionMenuItems, }, } = table;
|
955
963
|
const { density } = getState();
|
956
|
-
return (jsxRuntime.jsxs(Menu__default["default"],
|
964
|
+
return (jsxRuntime.jsxs(Menu__default["default"], { anchorEl: anchorEl, open: !!anchorEl, onClick: (event) => event.stopPropagation(), onClose: () => setAnchorEl(null), MenuListProps: {
|
957
965
|
dense: density === 'compact',
|
958
|
-
}
|
966
|
+
}, children: [enableEditing instanceof Function
|
959
967
|
? enableEditing(row)
|
960
|
-
: enableEditing && (jsxRuntime.jsx(MenuItem__default["default"],
|
968
|
+
: enableEditing && (jsxRuntime.jsx(MenuItem__default["default"], { onClick: handleEdit, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(EditIcon, {}) }), localization.edit] }) })), renderRowActionMenuItems === null || renderRowActionMenuItems === void 0 ? void 0 : renderRowActionMenuItems({
|
961
969
|
row,
|
962
970
|
table,
|
963
971
|
closeMenu: () => setAnchorEl(null),
|
964
|
-
})] }))
|
972
|
+
})] }));
|
965
973
|
};
|
966
974
|
|
967
975
|
const MRT_EditActionButtons = ({ row, table, variant = 'icon', }) => {
|
@@ -988,7 +996,7 @@ const MRT_EditActionButtons = ({ row, table, variant = 'icon', }) => {
|
|
988
996
|
values: (_b = editingRow === null || editingRow === void 0 ? void 0 : editingRow._valuesCache) !== null && _b !== void 0 ? _b : Object.assign({}, row.original),
|
989
997
|
});
|
990
998
|
};
|
991
|
-
return (jsxRuntime.jsx(Box__default["default"],
|
999
|
+
return (jsxRuntime.jsx(Box__default["default"], { onClick: (e) => e.stopPropagation(), sx: { display: 'flex', gap: '0.75rem' }, children: variant === 'icon' ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, title: localization.cancel, children: jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.cancel, onClick: handleCancel, children: jsxRuntime.jsx(CancelIcon, {}) }) }), jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, title: localization.save, children: jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.save, color: "info", onClick: handleSave, children: jsxRuntime.jsx(SaveIcon, {}) }) })] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Button__default["default"], { onClick: handleCancel, children: localization.cancel }), jsxRuntime.jsx(Button__default["default"], { onClick: handleSave, variant: "contained", children: localization.save })] })) }));
|
992
1000
|
};
|
993
1001
|
|
994
1002
|
const commonIconButtonStyles = {
|
@@ -1018,7 +1026,7 @@ const MRT_ToggleRowActionMenuButton = ({ cell, row, table, }) => {
|
|
1018
1026
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: renderRowActions ? (renderRowActions({ cell, row, table })) : row.id === (editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) && editingMode === 'row' ? (jsxRuntime.jsx(MRT_EditActionButtons, { row: row, table: table })) : !renderRowActionMenuItems &&
|
1019
1027
|
(enableEditing instanceof Function
|
1020
1028
|
? enableEditing(row)
|
1021
|
-
: enableEditing) ? (jsxRuntime.jsx(Tooltip__default["default"],
|
1029
|
+
: enableEditing) ? (jsxRuntime.jsx(Tooltip__default["default"], { placement: "right", arrow: true, title: localization.edit, children: jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.edit, sx: commonIconButtonStyles, onClick: handleStartEditMode, children: jsxRuntime.jsx(EditIcon, {}) }) })) : renderRowActionMenuItems ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: localization.rowActions, children: jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.rowActions, onClick: handleOpenRowActionMenu, size: "small", sx: commonIconButtonStyles, children: jsxRuntime.jsx(MoreHorizIcon, {}) }) }), jsxRuntime.jsx(MRT_RowActionMenu, { anchorEl: anchorEl, handleEdit: handleStartEditMode, row: row, setAnchorEl: setAnchorEl, table: table })] })) : null }));
|
1022
1030
|
};
|
1023
1031
|
|
1024
1032
|
const MRT_SelectCheckbox = ({ row, selectAll, table }) => {
|
@@ -1052,11 +1060,11 @@ const MRT_SelectCheckbox = ({ row, selectAll, table }) => {
|
|
1052
1060
|
}, 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
|
1053
1061
|
? checkboxProps.sx(theme)
|
1054
1062
|
: checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx))), title: undefined });
|
1055
|
-
return (jsxRuntime.jsx(Tooltip__default["default"],
|
1063
|
+
return (jsxRuntime.jsx(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
|
1056
1064
|
? localization.toggleSelectAll
|
1057
|
-
: localization.toggleSelectRow)
|
1065
|
+
: localization.toggleSelectRow), children: enableMultiRowSelection === false ? (jsxRuntime.jsx(Radio__default["default"], Object.assign({}, commonProps))) : (jsxRuntime.jsx(Checkbox__default["default"], Object.assign({ indeterminate: selectAll
|
1058
1066
|
? table.getIsSomeRowsSelected() && !allRowsSelected
|
1059
|
-
: row === null || row === void 0 ? void 0 : row.getIsSomeSelected() }, commonProps))) }))
|
1067
|
+
: row === null || row === void 0 ? void 0 : row.getIsSomeSelected() }, commonProps))) }));
|
1060
1068
|
};
|
1061
1069
|
|
1062
1070
|
const MRT_GlobalFilterTextField = ({ table, }) => {
|
@@ -1095,15 +1103,15 @@ const MRT_GlobalFilterTextField = ({ table, }) => {
|
|
1095
1103
|
}
|
1096
1104
|
isMounted.current = true;
|
1097
1105
|
}, [globalFilter]);
|
1098
|
-
return (jsxRuntime.jsxs(Collapse__default["default"],
|
1099
|
-
startAdornment: enableGlobalFilterModes ? (jsxRuntime.jsx(InputAdornment__default["default"],
|
1100
|
-
endAdornment: (jsxRuntime.jsx(InputAdornment__default["default"],
|
1106
|
+
return (jsxRuntime.jsxs(Collapse__default["default"], { in: showGlobalFilter, orientation: "horizontal", unmountOnExit: true, mountOnEnter: true, children: [jsxRuntime.jsx(TextField__default["default"], Object.assign({ placeholder: localization.search, onChange: handleChange, value: searchValue !== null && searchValue !== void 0 ? searchValue : '', variant: "standard", InputProps: {
|
1107
|
+
startAdornment: enableGlobalFilterModes ? (jsxRuntime.jsx(InputAdornment__default["default"], { position: "start", children: jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, title: localization.changeSearchMode, children: jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.changeSearchMode, onClick: handleGlobalFilterMenuOpen, size: "small", sx: { height: '1.75rem', width: '1.75rem' }, children: jsxRuntime.jsx(SearchIcon, {}) }) }) })) : (jsxRuntime.jsx(SearchIcon, { style: { marginRight: '4px' } })),
|
1108
|
+
endAdornment: (jsxRuntime.jsx(InputAdornment__default["default"], { position: "end", children: jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, title: (_a = localization.clearSearch) !== null && _a !== void 0 ? _a : '', children: jsxRuntime.jsx("span", { children: jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.clearSearch, disabled: !(searchValue === null || searchValue === void 0 ? void 0 : searchValue.length), onClick: handleClear, size: "small", children: jsxRuntime.jsx(CloseIcon, {}) }) }) }) })),
|
1101
1109
|
} }, textFieldProps, { inputRef: (inputRef) => {
|
1102
1110
|
searchInputRef.current = inputRef;
|
1103
1111
|
if (textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.inputRef) {
|
1104
1112
|
textFieldProps.inputRef = inputRef;
|
1105
1113
|
}
|
1106
|
-
} })), jsxRuntime.jsx(MRT_FilterOptionMenu, { anchorEl: anchorEl, setAnchorEl: setAnchorEl, table: table, onSelect: handleClear })] }))
|
1114
|
+
} })), jsxRuntime.jsx(MRT_FilterOptionMenu, { anchorEl: anchorEl, setAnchorEl: setAnchorEl, table: table, onSelect: handleClear })] }));
|
1107
1115
|
};
|
1108
1116
|
|
1109
1117
|
const MRT_LinearProgressBar = ({ isTopToolbar, table, }) => {
|
@@ -1112,12 +1120,12 @@ const MRT_LinearProgressBar = ({ isTopToolbar, table, }) => {
|
|
1112
1120
|
const linearProgressProps = muiLinearProgressProps instanceof Function
|
1113
1121
|
? muiLinearProgressProps({ isTopToolbar, table })
|
1114
1122
|
: muiLinearProgressProps;
|
1115
|
-
return (jsxRuntime.jsx(Collapse__default["default"],
|
1123
|
+
return (jsxRuntime.jsx(Collapse__default["default"], { in: isLoading || showProgressBars, mountOnEnter: true, unmountOnExit: true, sx: {
|
1116
1124
|
bottom: isTopToolbar ? 0 : undefined,
|
1117
1125
|
position: 'absolute',
|
1118
1126
|
top: !isTopToolbar ? 0 : undefined,
|
1119
1127
|
width: '100%',
|
1120
|
-
}
|
1128
|
+
}, children: jsxRuntime.jsx(LinearProgress__default["default"], Object.assign({ "aria-label": "Loading", "aria-busy": "true", sx: { position: 'relative' } }, linearProgressProps)) }));
|
1121
1129
|
};
|
1122
1130
|
|
1123
1131
|
const MRT_TablePagination = ({ table, position = 'bottom', }) => {
|
@@ -1173,13 +1181,13 @@ const MRT_ToolbarAlertBanner = ({ stackAlertBanner, table, }) => {
|
|
1173
1181
|
? (_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())
|
1174
1182
|
: null;
|
1175
1183
|
const groupedByMessage = grouping.length > 0 ? (jsxRuntime.jsxs("span", { children: [localization.groupedBy, ' ', grouping.map((columnId, index) => (jsxRuntime.jsxs(react.Fragment, { children: [index > 0 ? localization.thenBy : '', jsxRuntime.jsx(Chip__default["default"], Object.assign({ label: table.getColumn(columnId).columnDef.header, onDelete: () => table.getColumn(columnId).toggleGrouping() }, chipProps))] }, `${index}-${columnId}`)))] })) : null;
|
1176
|
-
return (jsxRuntime.jsx(Collapse__default["default"],
|
1184
|
+
return (jsxRuntime.jsx(Collapse__default["default"], { in: showAlertBanner || !!selectMessage || !!groupedByMessage, timeout: stackAlertBanner ? 200 : 0, children: jsxRuntime.jsxs(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
|
1177
1185
|
? 0
|
1178
1186
|
: positionToolbarAlertBanner === 'bottom'
|
1179
1187
|
? '-1rem'
|
1180
1188
|
: undefined, right: 0, top: 0, width: '100%', zIndex: 2 }, ((alertProps === null || alertProps === void 0 ? void 0 : alertProps.sx) instanceof Function
|
1181
1189
|
? alertProps.sx(theme)
|
1182
|
-
: alertProps === null || alertProps === void 0 ? void 0 : alertProps.sx)))
|
1190
|
+
: alertProps === null || alertProps === void 0 ? void 0 : alertProps.sx))), children: [(alertProps === null || alertProps === void 0 ? void 0 : alertProps.title) && jsxRuntime.jsx(AlertTitle__default["default"], { children: alertProps.title }), jsxRuntime.jsxs(Box__default["default"], { sx: { p: '0.5rem 1rem' }, children: [alertProps === null || alertProps === void 0 ? void 0 : alertProps.children, (alertProps === null || alertProps === void 0 ? void 0 : alertProps.children) && (selectMessage || groupedByMessage) && (jsxRuntime.jsx("br", {})), selectMessage, selectMessage && groupedByMessage && jsxRuntime.jsx("br", {}), groupedByMessage] })] })) }));
|
1183
1191
|
};
|
1184
1192
|
|
1185
1193
|
const MRT_FullScreenToggleButton = (_a) => {
|
@@ -1190,7 +1198,7 @@ const MRT_FullScreenToggleButton = (_a) => {
|
|
1190
1198
|
const handleToggleFullScreen = () => {
|
1191
1199
|
setIsFullScreen(!isFullScreen);
|
1192
1200
|
};
|
1193
|
-
return (jsxRuntime.jsx(Tooltip__default["default"],
|
1201
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.toggleFullScreen, children: jsxRuntime.jsx(IconButton__default["default"], Object.assign({ "aria-label": localization.showHideFilters, onClick: handleToggleFullScreen }, rest, { title: undefined, children: isFullScreen ? jsxRuntime.jsx(FullscreenExitIcon, {}) : jsxRuntime.jsx(FullscreenIcon, {}) })) }));
|
1194
1202
|
};
|
1195
1203
|
|
1196
1204
|
const MRT_ColumnPinningButtons = ({ column, table, }) => {
|
@@ -1198,17 +1206,17 @@ const MRT_ColumnPinningButtons = ({ column, table, }) => {
|
|
1198
1206
|
const handlePinColumn = (pinDirection) => {
|
1199
1207
|
column.pin(pinDirection);
|
1200
1208
|
};
|
1201
|
-
return (jsxRuntime.jsx(Box__default["default"],
|
1209
|
+
return (jsxRuntime.jsx(Box__default["default"], { sx: { minWidth: '70px', textAlign: 'center' }, children: column.getIsPinned() ? (jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, title: localization.unpin, children: jsxRuntime.jsx(IconButton__default["default"], { onClick: () => handlePinColumn(false), size: "small", children: jsxRuntime.jsx(PushPinIcon, {}) }) })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, title: localization.pinToLeft, children: jsxRuntime.jsx(IconButton__default["default"], { onClick: () => handlePinColumn('left'), size: "small", children: jsxRuntime.jsx(PushPinIcon, { style: {
|
1202
1210
|
transform: 'rotate(90deg)',
|
1203
|
-
} }) })
|
1211
|
+
} }) }) }), jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, title: localization.pinToRight, children: jsxRuntime.jsx(IconButton__default["default"], { onClick: () => handlePinColumn('right'), size: "small", children: jsxRuntime.jsx(PushPinIcon, { style: {
|
1204
1212
|
transform: 'rotate(-90deg)',
|
1205
|
-
} }) })
|
1213
|
+
} }) }) })] })) }));
|
1206
1214
|
};
|
1207
1215
|
|
1208
1216
|
const MRT_GrabHandleButton = ({ iconButtonProps, onDragEnd, onDragStart, table, }) => {
|
1209
1217
|
var _a;
|
1210
1218
|
const { options: { icons: { DragHandleIcon }, localization, }, } = table;
|
1211
|
-
return (jsxRuntime.jsx(Tooltip__default["default"],
|
1219
|
+
return (jsxRuntime.jsx(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, children: jsxRuntime.jsx(IconButton__default["default"], Object.assign({ disableRipple: true, draggable: "true", size: "small" }, iconButtonProps, { onClick: (e) => {
|
1212
1220
|
var _a;
|
1213
1221
|
e.stopPropagation();
|
1214
1222
|
(_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(iconButtonProps, e);
|
@@ -1219,7 +1227,7 @@ const MRT_GrabHandleButton = ({ iconButtonProps, onDragEnd, onDragStart, table,
|
|
1219
1227
|
cursor: 'grabbing',
|
1220
1228
|
} }, ((iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx) instanceof Function
|
1221
1229
|
? iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx(theme)
|
1222
|
-
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined
|
1230
|
+
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined, children: jsxRuntime.jsx(DragHandleIcon, {}) })) }));
|
1223
1231
|
};
|
1224
1232
|
|
1225
1233
|
const MRT_ShowHideColumnsMenuItems = ({ allColumns, hoveredColumn, setHoveredColumn, column, table, }) => {
|
@@ -1260,7 +1268,7 @@ const MRT_ShowHideColumnsMenuItems = ({ allColumns, hoveredColumn, setHoveredCol
|
|
1260
1268
|
setHoveredColumn(column);
|
1261
1269
|
}
|
1262
1270
|
};
|
1263
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MenuItem__default["default"],
|
1271
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MenuItem__default["default"], { disableRipple: true, ref: menuItemRef, onDragEnter: handleDragEnter, sx: (theme) => ({
|
1264
1272
|
alignItems: 'center',
|
1265
1273
|
justifyContent: 'flex-start',
|
1266
1274
|
my: 0,
|
@@ -1273,11 +1281,11 @@ const MRT_ShowHideColumnsMenuItems = ({ allColumns, hoveredColumn, setHoveredCol
|
|
1273
1281
|
: 'none',
|
1274
1282
|
pl: `${(column.depth + 0.5) * 2}rem`,
|
1275
1283
|
py: '6px',
|
1276
|
-
})
|
1284
|
+
}), children: jsxRuntime.jsxs(Box__default["default"], { sx: {
|
1277
1285
|
display: 'flex',
|
1278
1286
|
flexWrap: 'nowrap',
|
1279
1287
|
gap: '8px',
|
1280
|
-
}
|
1288
|
+
}, children: [columnDefType !== 'group' &&
|
1281
1289
|
enableColumnOrdering &&
|
1282
1290
|
!allColumns.some((col) => col.columnDef.columnDefType === 'group') &&
|
1283
1291
|
(columnDef.enableColumnOrdering !== false ? (jsxRuntime.jsx(MRT_GrabHandleButton, { onDragEnd: handleDragEnd, onDragStart: handleDragStart, table: table })) : (jsxRuntime.jsx(Box__default["default"], { sx: { width: '28px' } }))), enablePinning &&
|
@@ -1288,7 +1296,7 @@ const MRT_ShowHideColumnsMenuItems = ({ allColumns, hoveredColumn, setHoveredCol
|
|
1288
1296
|
opacity: columnDefType !== 'display' ? 1 : 0.5,
|
1289
1297
|
},
|
1290
1298
|
},
|
1291
|
-
}, checked: switchChecked, control: jsxRuntime.jsx(Tooltip__default["default"],
|
1299
|
+
}, checked: switchChecked, control: jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: localization.toggleVisibility, children: jsxRuntime.jsx(Switch__default["default"], {}) }), disabled: !column.getCanHide(), label: columnDef.header, onChange: () => handleToggleColumnHidden(column) })) : (jsxRuntime.jsx(Typography__default["default"], { sx: { alignSelf: 'center' }, children: columnDef.header }))] }) }), (_a = column.columns) === null || _a === void 0 ? void 0 : _a.map((c, i) => (jsxRuntime.jsx(MRT_ShowHideColumnsMenuItems, { allColumns: allColumns, column: c, hoveredColumn: hoveredColumn, setHoveredColumn: setHoveredColumn, table: table }, `${i}-${c.id}`)))] }));
|
1292
1300
|
};
|
1293
1301
|
|
1294
1302
|
const MRT_ShowHideColumnsMenu = ({ anchorEl, setAnchorEl, table, }) => {
|
@@ -1319,14 +1327,14 @@ const MRT_ShowHideColumnsMenu = ({ anchorEl, setAnchorEl, table, }) => {
|
|
1319
1327
|
getRightLeafColumns(),
|
1320
1328
|
]);
|
1321
1329
|
const [hoveredColumn, setHoveredColumn] = react.useState(null);
|
1322
|
-
return (jsxRuntime.jsxs(Menu__default["default"],
|
1330
|
+
return (jsxRuntime.jsxs(Menu__default["default"], { anchorEl: anchorEl, open: !!anchorEl, onClose: () => setAnchorEl(null), MenuListProps: {
|
1323
1331
|
dense: density === 'compact',
|
1324
|
-
}
|
1332
|
+
}, children: [jsxRuntime.jsxs(Box__default["default"], { sx: {
|
1325
1333
|
display: 'flex',
|
1326
1334
|
justifyContent: 'space-between',
|
1327
1335
|
p: '0.5rem',
|
1328
1336
|
pt: 0,
|
1329
|
-
}
|
1337
|
+
}, children: [enableHiding && (jsxRuntime.jsx(Button__default["default"], { disabled: !getIsSomeColumnsVisible(), onClick: hideAllColumns, children: localization.hideAll })), enableColumnOrdering && (jsxRuntime.jsx(Button__default["default"], { onClick: () => table.setColumnOrder(getDefaultColumnOrderIds(table.options)), children: localization.resetOrder })), enablePinning && (jsxRuntime.jsx(Button__default["default"], { disabled: !getIsSomeColumnsPinned(), onClick: () => table.resetColumnPinning(true), children: localization.unpinAll })), enableHiding && (jsxRuntime.jsx(Button__default["default"], { disabled: getIsAllColumnsVisible(), onClick: () => toggleAllColumnsVisible(true), children: localization.showAll }))] }), jsxRuntime.jsx(Divider__default["default"], {}), allColumns.map((column, index) => (jsxRuntime.jsx(MRT_ShowHideColumnsMenuItems, { allColumns: allColumns, column: column, hoveredColumn: hoveredColumn, setHoveredColumn: setHoveredColumn, table: table }, `${index}-${column.id}`)))] }));
|
1330
1338
|
};
|
1331
1339
|
|
1332
1340
|
const MRT_ShowHideColumnsButton = (_a) => {
|
@@ -1337,7 +1345,7 @@ const MRT_ShowHideColumnsButton = (_a) => {
|
|
1337
1345
|
const handleClick = (event) => {
|
1338
1346
|
setAnchorEl(event.currentTarget);
|
1339
1347
|
};
|
1340
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip__default["default"],
|
1348
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideColumns, children: jsxRuntime.jsx(IconButton__default["default"], Object.assign({ "aria-label": localization.showHideColumns, onClick: handleClick }, rest, { title: undefined, children: jsxRuntime.jsx(ViewColumnIcon, {}) })) }), anchorEl && (jsxRuntime.jsx(MRT_ShowHideColumnsMenu, { anchorEl: anchorEl, setAnchorEl: setAnchorEl, table: table }))] }));
|
1341
1349
|
};
|
1342
1350
|
|
1343
1351
|
const MRT_ToggleDensePaddingButton = (_a) => {
|
@@ -1353,7 +1361,7 @@ const MRT_ToggleDensePaddingButton = (_a) => {
|
|
1353
1361
|
: 'comfortable';
|
1354
1362
|
setDensity(nextDensity);
|
1355
1363
|
};
|
1356
|
-
return (jsxRuntime.jsx(Tooltip__default["default"],
|
1364
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.toggleDensity, children: jsxRuntime.jsx(IconButton__default["default"], Object.assign({ "aria-label": localization.toggleDensity, onClick: handleToggleDensePadding }, rest, { title: undefined, children: density === 'compact' ? (jsxRuntime.jsx(DensitySmallIcon, {})) : density === 'comfortable' ? (jsxRuntime.jsx(DensityMediumIcon, {})) : (jsxRuntime.jsx(DensityLargeIcon, {})) })) }));
|
1357
1365
|
};
|
1358
1366
|
|
1359
1367
|
const MRT_ToggleFiltersButton = (_a) => {
|
@@ -1364,7 +1372,7 @@ const MRT_ToggleFiltersButton = (_a) => {
|
|
1364
1372
|
const handleToggleShowFilters = () => {
|
1365
1373
|
setShowColumnFilters(!showColumnFilters);
|
1366
1374
|
};
|
1367
|
-
return (jsxRuntime.jsx(Tooltip__default["default"],
|
1375
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideFilters, children: jsxRuntime.jsx(IconButton__default["default"], Object.assign({ "aria-label": localization.showHideFilters, onClick: handleToggleShowFilters }, rest, { title: undefined, children: showColumnFilters ? jsxRuntime.jsx(FilterListOffIcon, {}) : jsxRuntime.jsx(FilterListIcon, {}) })) }));
|
1368
1376
|
};
|
1369
1377
|
|
1370
1378
|
const MRT_ToggleGlobalFilterButton = (_a) => {
|
@@ -1376,21 +1384,21 @@ const MRT_ToggleGlobalFilterButton = (_a) => {
|
|
1376
1384
|
setShowGlobalFilter(!showGlobalFilter);
|
1377
1385
|
queueMicrotask(() => { var _a; return (_a = searchInputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); });
|
1378
1386
|
};
|
1379
|
-
return (jsxRuntime.jsx(Tooltip__default["default"],
|
1387
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideSearch, children: jsxRuntime.jsx(IconButton__default["default"], Object.assign({ "aria-label": (_c = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _c !== void 0 ? _c : localization.showHideSearch, disabled: !!globalFilter, onClick: handleToggleSearch }, rest, { title: undefined, children: showGlobalFilter ? jsxRuntime.jsx(SearchOffIcon, {}) : jsxRuntime.jsx(SearchIcon, {}) })) }));
|
1380
1388
|
};
|
1381
1389
|
|
1382
1390
|
const MRT_ToolbarInternalButtons = ({ table, }) => {
|
1383
1391
|
var _a;
|
1384
1392
|
const { options: { enableColumnFilters, enableColumnOrdering, enableDensityToggle, enableFilters, enableFullScreenToggle, enableGlobalFilter, enableHiding, enablePinning, initialState, renderToolbarInternalActions, }, } = table;
|
1385
|
-
return (jsxRuntime.jsx(Box__default["default"],
|
1393
|
+
return (jsxRuntime.jsx(Box__default["default"], { sx: {
|
1386
1394
|
alignItems: 'center',
|
1387
1395
|
display: 'flex',
|
1388
1396
|
zIndex: 3,
|
1389
|
-
}
|
1397
|
+
}, children: (_a = renderToolbarInternalActions === null || renderToolbarInternalActions === void 0 ? void 0 : renderToolbarInternalActions({
|
1390
1398
|
table,
|
1391
1399
|
})) !== null && _a !== void 0 ? _a : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [enableFilters &&
|
1392
1400
|
enableGlobalFilter &&
|
1393
|
-
!(initialState === null || initialState === void 0 ? void 0 : initialState.showGlobalFilter) && (jsxRuntime.jsx(MRT_ToggleGlobalFilterButton, { table: table })), enableFilters && enableColumnFilters && (jsxRuntime.jsx(MRT_ToggleFiltersButton, { table: table })), (enableHiding || enableColumnOrdering || enablePinning) && (jsxRuntime.jsx(MRT_ShowHideColumnsButton, { table: table })), enableDensityToggle && (jsxRuntime.jsx(MRT_ToggleDensePaddingButton, { table: table })), enableFullScreenToggle && (jsxRuntime.jsx(MRT_FullScreenToggleButton, { table: table }))] })) }))
|
1401
|
+
!(initialState === null || initialState === void 0 ? void 0 : initialState.showGlobalFilter) && (jsxRuntime.jsx(MRT_ToggleGlobalFilterButton, { table: table })), enableFilters && enableColumnFilters && (jsxRuntime.jsx(MRT_ToggleFiltersButton, { table: table })), (enableHiding || enableColumnOrdering || enablePinning) && (jsxRuntime.jsx(MRT_ShowHideColumnsButton, { table: table })), enableDensityToggle && (jsxRuntime.jsx(MRT_ToggleDensePaddingButton, { table: table })), enableFullScreenToggle && (jsxRuntime.jsx(MRT_FullScreenToggleButton, { table: table }))] })) }));
|
1394
1402
|
};
|
1395
1403
|
|
1396
1404
|
const MRT_ToolbarDropZone = ({ table, }) => {
|
@@ -1409,7 +1417,7 @@ const MRT_ToolbarDropZone = ({ table, }) => {
|
|
1409
1417
|
!grouping.includes(draggingColumn.id));
|
1410
1418
|
}
|
1411
1419
|
}, [enableGrouping, draggingColumn, grouping]);
|
1412
|
-
return (jsxRuntime.jsx(Fade__default["default"],
|
1420
|
+
return (jsxRuntime.jsx(Fade__default["default"], { in: showToolbarDropZone, children: jsxRuntime.jsx(Box__default["default"], { className: "Mui-ToolbarDropZone", sx: (theme) => ({
|
1413
1421
|
alignItems: 'center',
|
1414
1422
|
backgroundColor: styles.alpha(theme.palette.info.main, (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === 'drop-zone' ? 0.2 : 0.1),
|
1415
1423
|
backdropFilter: 'blur(4px)',
|
@@ -1421,7 +1429,7 @@ const MRT_ToolbarDropZone = ({ table, }) => {
|
|
1421
1429
|
position: 'absolute',
|
1422
1430
|
width: '100%',
|
1423
1431
|
zIndex: 4,
|
1424
|
-
}), onDragEnter: handleDragEnter
|
1432
|
+
}), onDragEnter: handleDragEnter, children: jsxRuntime.jsx(Typography__default["default"], { fontStyle: "italic", children: 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 : '') }) }) }));
|
1425
1433
|
};
|
1426
1434
|
|
1427
1435
|
const commonToolbarStyles = ({ theme }) => ({
|
@@ -1453,7 +1461,7 @@ const MRT_TopToolbar = ({ table, }) => {
|
|
1453
1461
|
}
|
1454
1462
|
}, 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
|
1455
1463
|
? toolbarProps.sx(theme)
|
1456
|
-
: toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx)))
|
1464
|
+
: toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx))), children: [positionToolbarAlertBanner === 'top' && (jsxRuntime.jsx(MRT_ToolbarAlertBanner, { stackAlertBanner: stackAlertBanner, table: table })), ['both', 'top'].includes(positionToolbarDropZone !== null && positionToolbarDropZone !== void 0 ? positionToolbarDropZone : '') && (jsxRuntime.jsx(MRT_ToolbarDropZone, { table: table })), jsxRuntime.jsxs(Box__default["default"], { sx: {
|
1457
1465
|
alignItems: 'flex-start',
|
1458
1466
|
boxSizing: 'border-box',
|
1459
1467
|
display: 'flex',
|
@@ -1463,12 +1471,12 @@ const MRT_TopToolbar = ({ table, }) => {
|
|
1463
1471
|
right: 0,
|
1464
1472
|
top: 0,
|
1465
1473
|
width: '100%',
|
1466
|
-
}
|
1474
|
+
}, children: [enableGlobalFilter && positionGlobalFilter === 'left' && (jsxRuntime.jsx(MRT_GlobalFilterTextField, { table: table })), (_a = renderTopToolbarCustomActions === null || renderTopToolbarCustomActions === void 0 ? void 0 : renderTopToolbarCustomActions({ table })) !== null && _a !== void 0 ? _a : jsxRuntime.jsx("span", {}), enableToolbarInternalActions ? (jsxRuntime.jsxs(Box__default["default"], { sx: {
|
1467
1475
|
display: 'flex',
|
1468
1476
|
flexWrap: 'wrap-reverse',
|
1469
1477
|
justifyContent: 'flex-end',
|
1470
|
-
}
|
1471
|
-
positionGlobalFilter === 'right' && (jsxRuntime.jsx(MRT_GlobalFilterTextField, { table: table })))] })
|
1478
|
+
}, children: [enableGlobalFilter && positionGlobalFilter === 'right' && (jsxRuntime.jsx(MRT_GlobalFilterTextField, { table: table })), jsxRuntime.jsx(MRT_ToolbarInternalButtons, { table: table })] })) : (enableGlobalFilter &&
|
1479
|
+
positionGlobalFilter === 'right' && (jsxRuntime.jsx(MRT_GlobalFilterTextField, { table: table })))] }), enablePagination &&
|
1472
1480
|
['top', 'both'].includes(positionPagination !== null && positionPagination !== void 0 ? positionPagination : '') && (jsxRuntime.jsx(MRT_TablePagination, { table: table, position: "top" })), jsxRuntime.jsx(MRT_LinearProgressBar, { isTopToolbar: true, table: table })] })));
|
1473
1481
|
};
|
1474
1482
|
|
@@ -1490,21 +1498,21 @@ const MRT_BottomToolbar = ({ table, }) => {
|
|
1490
1498
|
}
|
1491
1499
|
}, 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
|
1492
1500
|
? toolbarProps.sx(theme)
|
1493
|
-
: toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx)))
|
1501
|
+
: toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx))), children: [jsxRuntime.jsx(MRT_LinearProgressBar, { isTopToolbar: false, table: table }), positionToolbarAlertBanner === 'bottom' && (jsxRuntime.jsx(MRT_ToolbarAlertBanner, { stackAlertBanner: stackAlertBanner, table: table })), ['both', 'bottom'].includes(positionToolbarDropZone !== null && positionToolbarDropZone !== void 0 ? positionToolbarDropZone : '') && (jsxRuntime.jsx(MRT_ToolbarDropZone, { table: table })), jsxRuntime.jsxs(Box__default["default"], { sx: {
|
1494
1502
|
alignItems: 'center',
|
1495
1503
|
boxSizing: 'border-box',
|
1496
1504
|
display: 'flex',
|
1497
1505
|
justifyContent: 'space-between',
|
1498
1506
|
p: '0.5rem',
|
1499
1507
|
width: '100%',
|
1500
|
-
}
|
1508
|
+
}, children: [renderBottomToolbarCustomActions ? (renderBottomToolbarCustomActions({ table })) : (jsxRuntime.jsx("span", {})), jsxRuntime.jsx(Box__default["default"], { sx: {
|
1501
1509
|
display: 'flex',
|
1502
1510
|
justifyContent: 'flex-end',
|
1503
1511
|
position: stackAlertBanner ? 'relative' : 'absolute',
|
1504
1512
|
right: 0,
|
1505
1513
|
top: 0,
|
1506
|
-
}
|
1507
|
-
['bottom', 'both'].includes(positionPagination !== null && positionPagination !== void 0 ? positionPagination : '') && (jsxRuntime.jsx(MRT_TablePagination, { table: table, position: "bottom" })) })
|
1514
|
+
}, children: enablePagination &&
|
1515
|
+
['bottom', 'both'].includes(positionPagination !== null && positionPagination !== void 0 ? positionPagination : '') && (jsxRuntime.jsx(MRT_TablePagination, { table: table, position: "bottom" })) })] })] })));
|
1508
1516
|
};
|
1509
1517
|
|
1510
1518
|
const MRT_TableHeadCellColumnActionsButton = ({ header, table, }) => {
|
@@ -1528,15 +1536,15 @@ const MRT_TableHeadCellColumnActionsButton = ({ header, table, }) => {
|
|
1528
1536
|
})
|
1529
1537
|
: columnDef.muiTableHeadCellColumnActionsButtonProps;
|
1530
1538
|
const iconButtonProps = Object.assign(Object.assign({}, mTableHeadCellColumnActionsButtonProps), mcTableHeadCellColumnActionsButtonProps);
|
1531
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip__default["default"],
|
1539
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(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, children: jsxRuntime.jsx(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) translateX(-4px)', transition: 'opacity 150ms', width: '2rem', '&:hover': {
|
1532
1540
|
opacity: 1,
|
1533
1541
|
} }, ((iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx) instanceof Function
|
1534
1542
|
? iconButtonProps.sx(theme)
|
1535
|
-
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined
|
1543
|
+
: iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx))), title: undefined, children: jsxRuntime.jsx(MoreVertIcon, {}) })) }), anchorEl && (jsxRuntime.jsx(MRT_ColumnActionMenu, { anchorEl: anchorEl, header: header, setAnchorEl: setAnchorEl, table: table }))] }));
|
1536
1544
|
};
|
1537
1545
|
|
1538
1546
|
const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
1539
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
1547
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
1540
1548
|
const { options: { enableColumnFilterModes, columnFilterModeOptions, icons: { FilterListIcon, CloseIcon }, localization, manualFiltering, muiTableHeadCellFilterTextFieldProps, }, refs: { filterInputRefs }, setColumnFilterFns, } = table;
|
1541
1549
|
const { column } = header;
|
1542
1550
|
const { columnDef } = column;
|
@@ -1579,6 +1587,18 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
1579
1587
|
!rangeFilterIndex &&
|
1580
1588
|
(allowedColumnFilterOptions === undefined ||
|
1581
1589
|
!!(allowedColumnFilterOptions === null || allowedColumnFilterOptions === void 0 ? void 0 : allowedColumnFilterOptions.length));
|
1590
|
+
const facetedUniqueValues = column.getFacetedUniqueValues();
|
1591
|
+
const filterSelectOptions = react.useMemo(() => {
|
1592
|
+
var _a;
|
1593
|
+
return (_a = columnDef.filterSelectOptions) !== null && _a !== void 0 ? _a : ((isSelectFilter || isMultiSelectFilter) && facetedUniqueValues
|
1594
|
+
? Array.from(facetedUniqueValues.keys()).sort((a, b) => a.localeCompare(b))
|
1595
|
+
: undefined);
|
1596
|
+
}, [
|
1597
|
+
columnDef.filterSelectOptions,
|
1598
|
+
facetedUniqueValues,
|
1599
|
+
isMultiSelectFilter,
|
1600
|
+
isSelectFilter,
|
1601
|
+
]);
|
1582
1602
|
const [anchorEl, setAnchorEl] = react.useState(null);
|
1583
1603
|
const [filterValue, setFilterValue] = react.useState(() => {
|
1584
1604
|
var _a, _b;
|
@@ -1676,24 +1696,23 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
1676
1696
|
}, margin: "none", placeholder: filterChipLabel || isSelectFilter || isMultiSelectFilter
|
1677
1697
|
? undefined
|
1678
1698
|
: filterPlaceholder, onChange: handleChange, onClick: (e) => e.stopPropagation(), select: isSelectFilter || isMultiSelectFilter, value: filterValue !== null && filterValue !== void 0 ? filterValue : '', variant: "standard", InputProps: {
|
1679
|
-
startAdornment: showChangeModeButton ? (jsxRuntime.jsxs(InputAdornment__default["default"],
|
1680
|
-
endAdornment: !filterChipLabel && (jsxRuntime.jsx(InputAdornment__default["default"],
|
1699
|
+
startAdornment: showChangeModeButton ? (jsxRuntime.jsxs(InputAdornment__default["default"], { position: "start", children: [jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, title: localization.changeFilterMode, children: jsxRuntime.jsx("span", { children: jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.changeFilterMode, onClick: handleFilterMenuOpen, size: "small", sx: { height: '1.75rem', width: '1.75rem' }, children: jsxRuntime.jsx(FilterListIcon, {}) }) }) }), filterChipLabel && (jsxRuntime.jsx(Chip__default["default"], { onDelete: handleClearEmptyFilterChip, label: filterChipLabel }))] })) : null,
|
1700
|
+
endAdornment: !filterChipLabel && (jsxRuntime.jsx(InputAdornment__default["default"], { position: "end", children: jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, placement: "right", title: (_h = localization.clearFilter) !== null && _h !== void 0 ? _h : '', children: jsxRuntime.jsx("span", { children: jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.clearFilter, disabled: !((_j = filterValue === null || filterValue === void 0 ? void 0 : filterValue.toString()) === null || _j === void 0 ? void 0 : _j.length), onClick: handleClear, size: "small", sx: {
|
1681
1701
|
height: '1.75rem',
|
1682
1702
|
width: '1.75rem',
|
1683
|
-
}
|
1703
|
+
}, children: jsxRuntime.jsx(CloseIcon, {}) }) }) }) })),
|
1684
1704
|
}, SelectProps: {
|
1685
1705
|
displayEmpty: true,
|
1686
1706
|
multiple: isMultiSelectFilter,
|
1687
1707
|
renderValue: isMultiSelectFilter
|
1688
|
-
? (selected) => !(selected === null || selected === void 0 ? void 0 : selected.length) ? (jsxRuntime.jsx(Box__default["default"],
|
1689
|
-
|
1690
|
-
const selectedValue = (_a = columnDef.filterSelectOptions) === null || _a === void 0 ? void 0 : _a.find((option) => option instanceof Object
|
1708
|
+
? (selected) => !(selected === null || selected === void 0 ? void 0 : selected.length) ? (jsxRuntime.jsx(Box__default["default"], { sx: { opacity: 0.5 }, children: filterPlaceholder })) : (jsxRuntime.jsx(Box__default["default"], { sx: { display: 'flex', flexWrap: 'wrap', gap: '2px' }, children: selected === null || selected === void 0 ? void 0 : selected.map((value) => {
|
1709
|
+
const selectedValue = filterSelectOptions === null || filterSelectOptions === void 0 ? void 0 : filterSelectOptions.find((option) => option instanceof Object
|
1691
1710
|
? option.value === value
|
1692
1711
|
: option === value);
|
1693
1712
|
return (jsxRuntime.jsx(Chip__default["default"], { label: selectedValue instanceof Object
|
1694
1713
|
? selectedValue.text
|
1695
1714
|
: selectedValue }, value));
|
1696
|
-
}) }))
|
1715
|
+
}) }))
|
1697
1716
|
: undefined,
|
1698
1717
|
} }, textFieldProps, { inputRef: (inputRef) => {
|
1699
1718
|
filterInputRefs.current[`${column.id}-${rangeFilterIndex !== null && rangeFilterIndex !== void 0 ? rangeFilterIndex : 0}`] =
|
@@ -1709,7 +1728,7 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
1709
1728
|
mr: '1.5rem',
|
1710
1729
|
} }, ((textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.sx) instanceof Function
|
1711
1730
|
? textFieldProps.sx(theme)
|
1712
|
-
: textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.sx)))
|
1731
|
+
: textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.sx))), children: [(isSelectFilter || isMultiSelectFilter) && (jsxRuntime.jsx(MenuItem__default["default"], { divider: true, disabled: true, hidden: true, value: "", children: jsxRuntime.jsx(Box__default["default"], { sx: { opacity: 0.5 }, children: filterPlaceholder }) })), (_k = textFieldProps.children) !== null && _k !== void 0 ? _k : filterSelectOptions === null || filterSelectOptions === void 0 ? void 0 : filterSelectOptions.map((option) => {
|
1713
1732
|
var _a;
|
1714
1733
|
let value;
|
1715
1734
|
let text;
|
@@ -1721,17 +1740,18 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
1721
1740
|
value = option.value;
|
1722
1741
|
text = option.text;
|
1723
1742
|
}
|
1724
|
-
return (jsxRuntime.jsxs(MenuItem__default["default"],
|
1743
|
+
return (jsxRuntime.jsxs(MenuItem__default["default"], { sx: {
|
1725
1744
|
display: 'flex',
|
1726
1745
|
m: 0,
|
1727
1746
|
alignItems: 'center',
|
1728
1747
|
gap: '0.5rem',
|
1729
|
-
}, value: value
|
1748
|
+
}, value: value, children: [isMultiSelectFilter && (jsxRuntime.jsx(Checkbox__default["default"], { checked: ((_a = column.getFilterValue()) !== null && _a !== void 0 ? _a : []).includes(value), sx: { mr: '0.5rem' } })), text, ' ', !columnDef.filterSelectOptions &&
|
1749
|
+
`(${facetedUniqueValues.get(value)})`] }, value));
|
1730
1750
|
})] })), jsxRuntime.jsx(MRT_FilterOptionMenu, { anchorEl: anchorEl, header: header, setAnchorEl: setAnchorEl, table: table, setFilterValue: setFilterValue })] }));
|
1731
1751
|
};
|
1732
1752
|
|
1733
1753
|
const MRT_FilterRangeFields = ({ header, table }) => {
|
1734
|
-
return (jsxRuntime.jsxs(Box__default["default"],
|
1754
|
+
return (jsxRuntime.jsxs(Box__default["default"], { sx: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '1rem' }, children: [jsxRuntime.jsx(MRT_FilterTextField, { header: header, rangeFilterIndex: 0, table: table }), jsxRuntime.jsx(MRT_FilterTextField, { header: header, rangeFilterIndex: 1, table: table })] }));
|
1735
1755
|
};
|
1736
1756
|
|
1737
1757
|
const MRT_FilterCheckbox = ({ column, table }) => {
|
@@ -1753,7 +1773,7 @@ const MRT_FilterCheckbox = ({ column, table }) => {
|
|
1753
1773
|
: columnDef.muiTableHeadCellFilterCheckboxProps;
|
1754
1774
|
const checkboxProps = Object.assign(Object.assign({}, mTableHeadCellFilterCheckboxProps), mcTableHeadCellFilterCheckboxProps);
|
1755
1775
|
const filterLabel = (_a = localization.filterByColumn) === null || _a === void 0 ? void 0 : _a.replace('{column}', columnDef.header);
|
1756
|
-
return (jsxRuntime.jsx(Tooltip__default["default"],
|
1776
|
+
return (jsxRuntime.jsx(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, children: jsxRuntime.jsx(FormControlLabel__default["default"], { control: jsxRuntime.jsx(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) => {
|
1757
1777
|
var _a;
|
1758
1778
|
e.stopPropagation();
|
1759
1779
|
(_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.onClick) === null || _a === void 0 ? void 0 : _a.call(checkboxProps, e);
|
@@ -1767,7 +1787,80 @@ const MRT_FilterCheckbox = ({ column, table }) => {
|
|
1767
1787
|
(_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.onChange) === null || _a === void 0 ? void 0 : _a.call(checkboxProps, e, checked);
|
1768
1788
|
}, sx: (theme) => (Object.assign({ height: '2.5rem', width: '2.5rem' }, ((checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx) instanceof Function
|
1769
1789
|
? checkboxProps.sx(theme)
|
1770
|
-
: checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx))) })), disableTypography: true, label: (_c = checkboxProps.title) !== null && _c !== void 0 ? _c : filterLabel, sx: { color: 'text.secondary', mt: '-4px', fontWeight: 'normal' }, title: undefined }) }))
|
1790
|
+
: checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx))) })), disableTypography: true, label: (_c = checkboxProps.title) !== null && _c !== void 0 ? _c : filterLabel, sx: { color: 'text.secondary', mt: '-4px', fontWeight: 'normal' }, title: undefined }) }));
|
1791
|
+
};
|
1792
|
+
|
1793
|
+
const MRT_FilterRangeSlider = ({ header, table }) => {
|
1794
|
+
var _a, _b;
|
1795
|
+
const { options: { localization, muiTableHeadCellFilterSliderProps, enableColumnFilterModes, }, refs: { filterInputRefs }, } = table;
|
1796
|
+
const { column } = header;
|
1797
|
+
const { columnDef } = column;
|
1798
|
+
const currentFilterOption = columnDef._filterFn;
|
1799
|
+
const showChangeModeButton = enableColumnFilterModes && columnDef.enableColumnFilterModes !== false;
|
1800
|
+
const mTableHeadCellFilterTextFieldProps = muiTableHeadCellFilterSliderProps instanceof Function
|
1801
|
+
? muiTableHeadCellFilterSliderProps({
|
1802
|
+
column,
|
1803
|
+
table,
|
1804
|
+
})
|
1805
|
+
: muiTableHeadCellFilterSliderProps;
|
1806
|
+
const mcTableHeadCellFilterTextFieldProps = columnDef.muiTableHeadCellFilterSliderProps instanceof Function
|
1807
|
+
? columnDef.muiTableHeadCellFilterSliderProps({
|
1808
|
+
column,
|
1809
|
+
table,
|
1810
|
+
})
|
1811
|
+
: columnDef.muiTableHeadCellFilterSliderProps;
|
1812
|
+
const sliderProps = Object.assign(Object.assign({}, mTableHeadCellFilterTextFieldProps), mcTableHeadCellFilterTextFieldProps);
|
1813
|
+
const [min, max] = sliderProps.min !== undefined && sliderProps.max !== undefined
|
1814
|
+
? [sliderProps.min, sliderProps.max]
|
1815
|
+
: (_a = column.getFacetedMinMaxValues()) !== null && _a !== void 0 ? _a : [0, 0];
|
1816
|
+
const [filterValues, setFilterValues] = react.useState([min, max]);
|
1817
|
+
const columnFilterValue = column.getFilterValue();
|
1818
|
+
const isMounted = react.useRef(false);
|
1819
|
+
react.useEffect(() => {
|
1820
|
+
if (isMounted.current) {
|
1821
|
+
if (columnFilterValue === undefined) {
|
1822
|
+
setFilterValues([min, max]);
|
1823
|
+
}
|
1824
|
+
else if (Array.isArray(columnFilterValue)) {
|
1825
|
+
if (columnFilterValue[0] <= min && columnFilterValue[1] >= max) {
|
1826
|
+
column.setFilterValue(undefined);
|
1827
|
+
}
|
1828
|
+
else {
|
1829
|
+
setFilterValues(columnFilterValue);
|
1830
|
+
}
|
1831
|
+
}
|
1832
|
+
}
|
1833
|
+
isMounted.current = true;
|
1834
|
+
}, [column.getFilterValue()]);
|
1835
|
+
return (jsxRuntime.jsxs(material.Stack, { children: [jsxRuntime.jsx(material.Slider, Object.assign({ disableSwap: true, min: min, max: max, onChange: (_event, value) => {
|
1836
|
+
setFilterValues(value);
|
1837
|
+
}, onChangeCommitted: (_event, value) => {
|
1838
|
+
column.setFilterValue(value);
|
1839
|
+
}, value: filterValues, valueLabelDisplay: "auto" }, sliderProps, { slotProps: {
|
1840
|
+
input: {
|
1841
|
+
ref: (node) => {
|
1842
|
+
var _a, _b;
|
1843
|
+
if (node) {
|
1844
|
+
filterInputRefs.current[`${column.id}-0`] = node;
|
1845
|
+
// @ts-ignore
|
1846
|
+
if ((_b = (_a = sliderProps === null || sliderProps === void 0 ? void 0 : sliderProps.slotProps) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.ref) {
|
1847
|
+
//@ts-ignore
|
1848
|
+
sliderProps.slotProps.input.ref = node;
|
1849
|
+
}
|
1850
|
+
}
|
1851
|
+
},
|
1852
|
+
},
|
1853
|
+
}, sx: (theme) => (Object.assign({ m: 'auto', mt: !showChangeModeButton ? '10px' : '6px', px: '4px', width: 'calc(100% - 8px)' }, ((sliderProps === null || sliderProps === void 0 ? void 0 : sliderProps.sx) instanceof Function
|
1854
|
+
? sliderProps.sx(theme)
|
1855
|
+
: sliderProps === null || sliderProps === void 0 ? void 0 : sliderProps.sx))) })), showChangeModeButton ? (jsxRuntime.jsx(material.FormHelperText, { sx: {
|
1856
|
+
m: '-3px -6px',
|
1857
|
+
fontSize: '0.75rem',
|
1858
|
+
lineHeight: '0.8rem',
|
1859
|
+
whiteSpace: 'nowrap',
|
1860
|
+
}, children: localization.filterMode.replace('{filterType}',
|
1861
|
+
// @ts-ignore
|
1862
|
+
localization[`filter${((_b = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt(0)) === null || _b === void 0 ? void 0 : _b.toUpperCase()) +
|
1863
|
+
(currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.slice(1))}`]) })) : null] }));
|
1771
1864
|
};
|
1772
1865
|
|
1773
1866
|
const MRT_TableHeadCellFilterContainer = ({ header, table }) => {
|
@@ -1775,8 +1868,8 @@ const MRT_TableHeadCellFilterContainer = ({ header, table }) => {
|
|
1775
1868
|
const { showColumnFilters } = getState();
|
1776
1869
|
const { column } = header;
|
1777
1870
|
const { columnDef } = column;
|
1778
|
-
return (jsxRuntime.jsx(Collapse__default["default"],
|
1779
|
-
['between', 'betweenInclusive', 'inNumberRange'].includes(columnDef._filterFn) ? (jsxRuntime.jsx(MRT_FilterRangeFields, { header: header, table: table })) : (jsxRuntime.jsx(MRT_FilterTextField, { header: header, table: table })) }))
|
1871
|
+
return (jsxRuntime.jsx(Collapse__default["default"], { in: showColumnFilters, mountOnEnter: true, unmountOnExit: true, children: columnDef.filterVariant === 'checkbox' ? (jsxRuntime.jsx(MRT_FilterCheckbox, { column: column, table: table })) : columnDef.filterVariant === 'range-slider' ? (jsxRuntime.jsx(MRT_FilterRangeSlider, { header: header, table: table })) : columnDef.filterVariant === 'range' ||
|
1872
|
+
['between', 'betweenInclusive', 'inNumberRange'].includes(columnDef._filterFn) ? (jsxRuntime.jsx(MRT_FilterRangeFields, { header: header, table: table })) : (jsxRuntime.jsx(MRT_FilterTextField, { header: header, table: table })) }));
|
1780
1873
|
};
|
1781
1874
|
|
1782
1875
|
const MRT_TableHeadCellFilterLabel = ({ header, table }) => {
|
@@ -1797,9 +1890,9 @@ const MRT_TableHeadCellFilterLabel = ({ header, table }) => {
|
|
1797
1890
|
? column.getFilterValue().join(`" ${isRangeFilter ? localization.and : localization.or} "`)
|
1798
1891
|
: column.getFilterValue()}"`)
|
1799
1892
|
.replace('" "', '');
|
1800
|
-
return (jsxRuntime.jsx(Grow__default["default"],
|
1893
|
+
return (jsxRuntime.jsx(Grow__default["default"], { unmountOnExit: true, in: (!!column.getFilterValue() && !isRangeFilter) ||
|
1801
1894
|
(isRangeFilter && // @ts-ignore
|
1802
|
-
(!!((_b = column.getFilterValue()) === null || _b === void 0 ? void 0 : _b[0]) || !!((_c = column.getFilterValue()) === null || _c === void 0 ? void 0 : _c[1])))
|
1895
|
+
(!!((_b = column.getFilterValue()) === null || _b === void 0 ? void 0 : _b[0]) || !!((_c = column.getFilterValue()) === null || _c === void 0 ? void 0 : _c[1]))), children: jsxRuntime.jsx(Box__default["default"], { component: "span", sx: { flex: '0 0' }, children: jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, placement: "top", title: filterTooltip, children: jsxRuntime.jsx(IconButton__default["default"], { disableRipple: true, onClick: (event) => {
|
1803
1896
|
setShowColumnFilters(true);
|
1804
1897
|
queueMicrotask(() => {
|
1805
1898
|
var _a, _b;
|
@@ -1814,7 +1907,7 @@ const MRT_TableHeadCellFilterLabel = ({ header, table }) => {
|
|
1814
1907
|
p: '2px',
|
1815
1908
|
transform: 'scale(0.66)',
|
1816
1909
|
width: '12px',
|
1817
|
-
}
|
1910
|
+
}, children: jsxRuntime.jsx(FilterAltIcon, {}) }) }) }) }));
|
1818
1911
|
};
|
1819
1912
|
|
1820
1913
|
const MRT_TableHeadCellGrabHandle = ({ column, table, tableHeadCellRef, }) => {
|
@@ -1856,7 +1949,7 @@ const MRT_TableHeadCellResizeHandle = ({ header, table }) => {
|
|
1856
1949
|
const { getState, options: { columnResizeMode }, setColumnSizingInfo, } = table;
|
1857
1950
|
const { density } = getState();
|
1858
1951
|
const { column } = header;
|
1859
|
-
return (jsxRuntime.jsx(Box__default["default"],
|
1952
|
+
return (jsxRuntime.jsx(Box__default["default"], { className: "Mui-TableHeadCell-ResizeHandle-Wrapper", onDoubleClick: () => {
|
1860
1953
|
setColumnSizingInfo((old) => (Object.assign(Object.assign({}, old), { isResizingColumn: false })));
|
1861
1954
|
column.resetSize();
|
1862
1955
|
}, onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), sx: (theme) => ({
|
@@ -1873,7 +1966,7 @@ const MRT_TableHeadCellResizeHandle = ({ header, table }) => {
|
|
1873
1966
|
transform: column.getIsResizing() && columnResizeMode === 'onEnd'
|
1874
1967
|
? `translateX(${(_a = getState().columnSizingInfo.deltaOffset) !== null && _a !== void 0 ? _a : 0}px)`
|
1875
1968
|
: undefined,
|
1876
|
-
}
|
1969
|
+
}, children: jsxRuntime.jsx(Divider__default["default"], { className: "Mui-TableHeadCell-ResizeHandle-Divider", flexItem: true, orientation: "vertical", sx: {
|
1877
1970
|
borderRadius: '2px',
|
1878
1971
|
borderWidth: '2px',
|
1879
1972
|
height: '24px',
|
@@ -1883,7 +1976,7 @@ const MRT_TableHeadCellResizeHandle = ({ header, table }) => {
|
|
1883
1976
|
: 'all 150ms ease-in-out',
|
1884
1977
|
userSelect: 'none',
|
1885
1978
|
zIndex: 4,
|
1886
|
-
} }) }))
|
1979
|
+
} }) }));
|
1887
1980
|
};
|
1888
1981
|
|
1889
1982
|
const MRT_TableHeadCellSortLabel = ({ header, table, tableCellProps, }) => {
|
@@ -1896,7 +1989,7 @@ const MRT_TableHeadCellSortLabel = ({ header, table, tableCellProps, }) => {
|
|
1896
1989
|
? localization.sortedByColumnDesc.replace('{column}', columnDef.header)
|
1897
1990
|
: localization.sortedByColumnAsc.replace('{column}', columnDef.header)
|
1898
1991
|
: localization.unsorted;
|
1899
|
-
return (jsxRuntime.jsx(Tooltip__default["default"],
|
1992
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, placement: "top", title: sortTooltip, children: jsxRuntime.jsx(Badge__default["default"], { badgeContent: sorting.length > 1 ? column.getSortIndex() + 1 : 0, overlap: "circular", children: jsxRuntime.jsx(TableSortLabel__default["default"], { "aria-label": sortTooltip, active: !!column.getIsSorted(), direction: column.getIsSorted()
|
1900
1993
|
? column.getIsSorted()
|
1901
1994
|
: undefined, sx: {
|
1902
1995
|
flex: '0 0',
|
@@ -1908,7 +2001,7 @@ const MRT_TableHeadCellSortLabel = ({ header, table, tableCellProps, }) => {
|
|
1908
2001
|
var _a;
|
1909
2002
|
e.stopPropagation();
|
1910
2003
|
(_a = header.column.getToggleSortingHandler()) === null || _a === void 0 ? void 0 : _a(e);
|
1911
|
-
} }) })
|
2004
|
+
} }) }) }));
|
1912
2005
|
};
|
1913
2006
|
|
1914
2007
|
const MRT_TableHeadCell = ({ header, table }) => {
|
@@ -2002,7 +2095,7 @@ const MRT_TableHeadCell = ({ header, table }) => {
|
|
2002
2095
|
table,
|
2003
2096
|
tableCellProps,
|
2004
2097
|
theme,
|
2005
|
-
})), draggingBorders))
|
2098
|
+
})), draggingBorders)), children: [header.isPlaceholder ? null : (jsxRuntime.jsxs(Box__default["default"], { className: "Mui-TableHeadCell-Content", sx: {
|
2006
2099
|
alignItems: 'center',
|
2007
2100
|
display: 'flex',
|
2008
2101
|
flexDirection: (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'right' ? 'row-reverse' : 'row',
|
@@ -2013,7 +2106,7 @@ const MRT_TableHeadCell = ({ header, table }) => {
|
|
2013
2106
|
: 'flex-start',
|
2014
2107
|
position: 'relative',
|
2015
2108
|
width: '100%',
|
2016
|
-
}
|
2109
|
+
}, children: [jsxRuntime.jsxs(Box__default["default"], { className: "Mui-TableHeadCell-Content-Labels", onClick: column.getToggleSortingHandler(), sx: {
|
2017
2110
|
alignItems: 'center',
|
2018
2111
|
cursor: column.getCanSort() && columnDefType !== 'group'
|
2019
2112
|
? 'pointer'
|
@@ -2024,7 +2117,7 @@ const MRT_TableHeadCell = ({ header, table }) => {
|
|
2024
2117
|
pl: (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'center'
|
2025
2118
|
? `${headerPL}rem`
|
2026
2119
|
: undefined,
|
2027
|
-
}
|
2120
|
+
}, children: [jsxRuntime.jsx(Box__default["default"], { className: "Mui-TableHeadCell-Content-Wrapper", sx: {
|
2028
2121
|
minWidth: `${Math.min((_d = (_c = columnDef.header) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0, 5)}ch`,
|
2029
2122
|
overflow: columnDefType === 'data' ? 'hidden' : undefined,
|
2030
2123
|
textOverflow: 'ellipsis',
|
@@ -2032,9 +2125,9 @@ const MRT_TableHeadCell = ({ header, table }) => {
|
|
2032
2125
|
'&:hover': {
|
2033
2126
|
textOverflow: 'clip',
|
2034
2127
|
},
|
2035
|
-
}, title: columnDefType === 'data' ? columnDef.header : undefined
|
2128
|
+
}, title: columnDefType === 'data' ? columnDef.header : undefined, children: headerElement }), column.getCanSort() && (jsxRuntime.jsx(MRT_TableHeadCellSortLabel, { header: header, table: table, tableCellProps: tableCellProps })), column.getCanFilter() && (jsxRuntime.jsx(MRT_TableHeadCellFilterLabel, { header: header, table: table }))] }), columnDefType !== 'group' && (jsxRuntime.jsxs(Box__default["default"], { className: "Mui-TableHeadCell-Content-Actions", sx: { whiteSpace: 'nowrap' }, children: [showDragHandle && (jsxRuntime.jsx(MRT_TableHeadCellGrabHandle, { column: column, table: table, tableHeadCellRef: {
|
2036
2129
|
current: tableHeadCellRefs.current[column.id],
|
2037
|
-
} })), showColumnActions && (jsxRuntime.jsx(MRT_TableHeadCellColumnActionsButton, { header: header, table: table }))] }))
|
2130
|
+
} })), showColumnActions && (jsxRuntime.jsx(MRT_TableHeadCellColumnActionsButton, { header: header, table: table }))] })), column.getCanResize() && (jsxRuntime.jsx(MRT_TableHeadCellResizeHandle, { header: header, table: table }))] })), column.getCanFilter() && (jsxRuntime.jsx(MRT_TableHeadCellFilterContainer, { header: header, table: table }))] })));
|
2038
2131
|
};
|
2039
2132
|
|
2040
2133
|
const MRT_TableHeadRow = ({ headerGroup, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, }) => {
|
@@ -2044,7 +2137,7 @@ const MRT_TableHeadRow = ({ headerGroup, table, virtualColumns, virtualPaddingLe
|
|
2044
2137
|
: muiTableHeadRowProps;
|
2045
2138
|
return (jsxRuntime.jsxs(TableRow__default["default"], Object.assign({}, tableRowProps, { sx: (theme) => (Object.assign({ backgroundColor: styles.lighten(theme.palette.background.default, 0.04), boxShadow: `4px 0 8px ${styles.alpha(theme.palette.common.black, 0.1)}`, display: layoutMode === 'grid' ? 'flex' : 'table-row', top: 0 }, ((tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx) instanceof Function
|
2046
2139
|
? tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx(theme)
|
2047
|
-
: tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx)))
|
2140
|
+
: tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx))), children: [virtualPaddingLeft ? (jsxRuntime.jsx("th", { style: { display: 'flex', width: virtualPaddingLeft } })) : null, (virtualColumns !== null && virtualColumns !== void 0 ? virtualColumns : headerGroup.headers).map((headerOrVirtualHeader) => {
|
2048
2141
|
const header = virtualColumns
|
2049
2142
|
? headerGroup.headers[headerOrVirtualHeader.index]
|
2050
2143
|
: headerOrVirtualHeader;
|
@@ -2061,7 +2154,7 @@ const MRT_TableHead = ({ table, virtualColumns, virtualPaddingLeft, virtualPaddi
|
|
2061
2154
|
const stickyHeader = enableStickyHeader || isFullScreen;
|
2062
2155
|
return (jsxRuntime.jsx(TableHead__default["default"], Object.assign({}, tableHeadProps, { sx: (theme) => (Object.assign({ display: layoutMode === 'grid' ? 'grid' : 'table-row-group', opacity: 0.97, position: stickyHeader ? 'sticky' : 'relative', top: stickyHeader && layoutMode === 'grid' ? 0 : undefined, zIndex: stickyHeader ? 2 : undefined }, ((tableHeadProps === null || tableHeadProps === void 0 ? void 0 : tableHeadProps.sx) instanceof Function
|
2063
2156
|
? tableHeadProps === null || tableHeadProps === void 0 ? void 0 : tableHeadProps.sx(theme)
|
2064
|
-
: tableHeadProps === null || tableHeadProps === void 0 ? void 0 : tableHeadProps.sx)))
|
2157
|
+
: tableHeadProps === null || tableHeadProps === void 0 ? void 0 : tableHeadProps.sx))), children: getHeaderGroups().map((headerGroup) => (jsxRuntime.jsx(MRT_TableHeadRow, { headerGroup: headerGroup, table: table, virtualColumns: virtualColumns, virtualPaddingLeft: virtualPaddingLeft, virtualPaddingRight: virtualPaddingRight }, headerGroup.id))) })));
|
2065
2158
|
};
|
2066
2159
|
|
2067
2160
|
const MRT_EditCellTextField = ({ cell, showLabel, table, }) => {
|
@@ -2126,7 +2219,7 @@ const MRT_EditCellTextField = ({ cell, showLabel, table, }) => {
|
|
2126
2219
|
var _a;
|
2127
2220
|
e.stopPropagation();
|
2128
2221
|
(_a = textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.onClick) === null || _a === void 0 ? void 0 : _a.call(textFieldProps, e);
|
2129
|
-
}, onBlur: handleBlur, onChange: handleChange, onKeyDown: handleEnterKeyDown
|
2222
|
+
}, onBlur: handleBlur, onChange: handleChange, onKeyDown: handleEnterKeyDown, children: (_b = textFieldProps.children) !== null && _b !== void 0 ? _b : (_c = columnDef === null || columnDef === void 0 ? void 0 : columnDef.editSelectOptions) === null || _c === void 0 ? void 0 : _c.map((option) => {
|
2130
2223
|
let value;
|
2131
2224
|
let text;
|
2132
2225
|
if (typeof option !== 'object') {
|
@@ -2137,12 +2230,12 @@ const MRT_EditCellTextField = ({ cell, showLabel, table, }) => {
|
|
2137
2230
|
value = option.value;
|
2138
2231
|
text = option.text;
|
2139
2232
|
}
|
2140
|
-
return (jsxRuntime.jsx(MenuItem__default["default"],
|
2233
|
+
return (jsxRuntime.jsx(MenuItem__default["default"], { sx: {
|
2141
2234
|
display: 'flex',
|
2142
2235
|
m: 0,
|
2143
2236
|
alignItems: 'center',
|
2144
2237
|
gap: '0.5rem',
|
2145
|
-
}, value: value
|
2238
|
+
}, value: value, children: text }, value));
|
2146
2239
|
}) })));
|
2147
2240
|
};
|
2148
2241
|
|
@@ -2170,9 +2263,9 @@ const MRT_CopyButton = ({ cell, children, table, }) => {
|
|
2170
2263
|
})
|
2171
2264
|
: columnDef.muiTableBodyCellCopyButtonProps;
|
2172
2265
|
const buttonProps = Object.assign(Object.assign({}, mTableBodyCellCopyButtonProps), mcTableBodyCellCopyButtonProps);
|
2173
|
-
return (jsxRuntime.jsx(Tooltip__default["default"],
|
2266
|
+
return (jsxRuntime.jsx(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), children: jsxRuntime.jsx(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
|
2174
2267
|
? buttonProps.sx(theme)
|
2175
|
-
: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.sx))), title: undefined
|
2268
|
+
: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.sx))), title: undefined, children: children })) }));
|
2176
2269
|
};
|
2177
2270
|
|
2178
2271
|
const MRT_TableBodyRowGrabHandle = ({ cell, rowRef, table }) => {
|
@@ -2241,7 +2334,7 @@ const MRT_TableBodyCellValue = ({ cell, table }) => {
|
|
2241
2334
|
matchExactly: (filterValue ? columnDef._filterFn : globalFilterFn) !== 'fuzzy',
|
2242
2335
|
});
|
2243
2336
|
if ((chunks === null || chunks === void 0 ? void 0 : chunks.length) > 1 || ((_b = chunks === null || chunks === void 0 ? void 0 : chunks[0]) === null || _b === void 0 ? void 0 : _b.match)) {
|
2244
|
-
renderedCellValue = (jsxRuntime.jsx("span",
|
2337
|
+
renderedCellValue = (jsxRuntime.jsx("span", { "aria-label": renderedCellValue, role: "note", children: (_c = chunks === null || chunks === void 0 ? void 0 : chunks.map(({ key, match, text }) => (jsxRuntime.jsx(Box__default["default"], { "aria-hidden": "true", component: "span", sx: match
|
2245
2338
|
? {
|
2246
2339
|
backgroundColor: (theme) => theme.palette.mode === 'dark'
|
2247
2340
|
? styles.darken(theme.palette.warning.dark, 0.25)
|
@@ -2250,7 +2343,7 @@ const MRT_TableBodyCellValue = ({ cell, table }) => {
|
|
2250
2343
|
color: (theme) => theme.palette.mode === 'dark' ? 'white' : 'black',
|
2251
2344
|
padding: '2px 1px',
|
2252
2345
|
}
|
2253
|
-
: undefined
|
2346
|
+
: undefined, children: text }, key)))) !== null && _c !== void 0 ? _c : renderedCellValue }));
|
2254
2347
|
}
|
2255
2348
|
}
|
2256
2349
|
if (columnDef.Cell && !isGroupedValue) {
|
@@ -2389,7 +2482,7 @@ const MRT_TableBodyCell = ({ cell, measureElement, numRows, rowIndex, rowRef, ta
|
|
2389
2482
|
table,
|
2390
2483
|
theme,
|
2391
2484
|
tableCellProps,
|
2392
|
-
})), draggingBorders))
|
2485
|
+
})), draggingBorders)), children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [cell.getIsPlaceholder() ? ((_b = (_a = columnDef.PlaceholderCell) === null || _a === void 0 ? void 0 : _a.call(columnDef, { cell, column, row, table })) !== null && _b !== void 0 ? _b : null) : isLoading || showSkeletons ? (jsxRuntime.jsx(Skeleton__default["default"], Object.assign({ animation: "wave", height: 20, width: skeletonWidth }, skeletonProps))) : enableRowNumbers &&
|
2393
2486
|
rowNumberMode === 'static' &&
|
2394
2487
|
column.id === 'mrt-row-numbers' ? (rowIndex + 1) : column.id === 'mrt-row-drag' ? (jsxRuntime.jsx(MRT_TableBodyRowGrabHandle, { cell: cell, rowRef: rowRef, table: table })) : columnDefType === 'display' &&
|
2395
2488
|
(column.id === 'mrt-row-select' ||
|
@@ -2401,7 +2494,7 @@ const MRT_TableBodyCell = ({ cell, measureElement, numRows, rowIndex, rowRef, ta
|
|
2401
2494
|
row,
|
2402
2495
|
table,
|
2403
2496
|
})) : isEditing ? (jsxRuntime.jsx(MRT_EditCellTextField, { cell: cell, table: table })) : (enableClickToCopy || columnDef.enableClickToCopy) &&
|
2404
|
-
columnDef.enableClickToCopy !== false ? (jsxRuntime.jsx(MRT_CopyButton,
|
2497
|
+
columnDef.enableClickToCopy !== false ? (jsxRuntime.jsx(MRT_CopyButton, { cell: cell, table: table, children: jsxRuntime.jsx(MRT_TableBodyCellValue, { cell: cell, table: table }) })) : (jsxRuntime.jsx(MRT_TableBodyCellValue, { cell: cell, table: table })), cell.getIsGrouped() && !columnDef.GroupedCell && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [" (", (_d = row.subRows) === null || _d === void 0 ? void 0 : _d.length, ")"] }))] }) })));
|
2405
2498
|
};
|
2406
2499
|
const Memo_MRT_TableBodyCell = react.memo(MRT_TableBodyCell, (prev, next) => next.cell === prev.cell);
|
2407
2500
|
|
@@ -2428,11 +2521,11 @@ const MRT_TableDetailPanel = ({ parentRowRef, row, rowIndex, table, virtualRow,
|
|
2428
2521
|
: undefined, width: '100%', zIndex: virtualRow ? 2 : undefined }, ((tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx) instanceof Function
|
2429
2522
|
? tableRowProps.sx(theme)
|
2430
2523
|
: tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx)));
|
2431
|
-
}
|
2524
|
+
}, children: jsxRuntime.jsx(TableCell__default["default"], Object.assign({ className: "Mui-TableBodyCell-DetailPanel", colSpan: getVisibleLeafColumns().length }, tableCellProps, { sx: (theme) => (Object.assign({ backgroundColor: virtualRow
|
2432
2525
|
? styles.lighten(theme.palette.background.default, 0.06)
|
2433
2526
|
: undefined, borderBottom: !row.getIsExpanded() ? 'none' : undefined, display: layoutMode === 'grid' ? 'flex' : 'table-cell', 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
|
2434
2527
|
? tableCellProps.sx(theme)
|
2435
|
-
: tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx)))
|
2528
|
+
: tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx))), children: renderDetailPanel && (jsxRuntime.jsx(Collapse__default["default"], { in: row.getIsExpanded(), mountOnEnter: true, unmountOnExit: true, children: !isLoading && renderDetailPanel({ row, table }) })) })) })));
|
2436
2529
|
};
|
2437
2530
|
|
2438
2531
|
const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, row, rowIndex, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, virtualRow, }) => {
|
@@ -2464,13 +2557,12 @@ const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, row, row
|
|
2464
2557
|
? tableRowProps.sx(theme)
|
2465
2558
|
: tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx))), style: Object.assign({ transform: virtualRow
|
2466
2559
|
? `translateY(${virtualRow === null || virtualRow === void 0 ? void 0 : virtualRow.start}px)`
|
2467
|
-
: undefined }, tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.style)
|
2560
|
+
: undefined }, tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.style), children: [virtualPaddingLeft ? (jsxRuntime.jsx("td", { style: { display: 'flex', width: virtualPaddingLeft } })) : null, (virtualColumns !== null && virtualColumns !== void 0 ? virtualColumns : row.getVisibleCells()).map((cellOrVirtualCell) => {
|
2468
2561
|
const cell = columnVirtualizer
|
2469
2562
|
? row.getVisibleCells()[cellOrVirtualCell.index]
|
2470
2563
|
: cellOrVirtualCell;
|
2471
2564
|
const props = {
|
2472
2565
|
cell,
|
2473
|
-
key: cell.id,
|
2474
2566
|
measureElement: columnVirtualizer === null || columnVirtualizer === void 0 ? void 0 : columnVirtualizer.measureElement,
|
2475
2567
|
numRows,
|
2476
2568
|
rowIndex,
|
@@ -2485,7 +2577,7 @@ const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, row, row
|
|
2485
2577
|
!draggingColumn &&
|
2486
2578
|
!draggingRow &&
|
2487
2579
|
(editingCell === null || editingCell === void 0 ? void 0 : editingCell.id) !== cell.id &&
|
2488
|
-
(editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) !== row.id ? (jsxRuntime.jsx(Memo_MRT_TableBodyCell, Object.assign({}, props))) : (jsxRuntime.jsx(MRT_TableBodyCell, Object.assign({}, props)));
|
2580
|
+
(editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) !== row.id ? (jsxRuntime.jsx(Memo_MRT_TableBodyCell, Object.assign({}, props), cell.id)) : (jsxRuntime.jsx(MRT_TableBodyCell, Object.assign({}, props), cell.id));
|
2489
2581
|
}), virtualPaddingRight ? (jsxRuntime.jsx("td", { style: { display: 'flex', width: virtualPaddingRight } })) : null] })), renderDetailPanel && !row.getIsGrouped() && (jsxRuntime.jsx(MRT_TableDetailPanel, { parentRowRef: rowRef, row: row, rowIndex: rowIndex, table: table, virtualRow: virtualRow }))] }));
|
2490
2582
|
};
|
2491
2583
|
const Memo_MRT_TableBodyRow = react.memo(MRT_TableBodyRow, (prev, next) => prev.row === next.row && prev.rowIndex === next.rowIndex);
|
@@ -2557,24 +2649,23 @@ const MRT_TableBody = ({ columnVirtualizer, table, virtualColumns, virtualPaddin
|
|
2557
2649
|
? `${rowVirtualizer.getTotalSize()}px`
|
2558
2650
|
: 'inherit', minHeight: !rows.length ? '100px' : undefined, position: 'relative' }, ((tableBodyProps === null || tableBodyProps === void 0 ? void 0 : tableBodyProps.sx) instanceof Function
|
2559
2651
|
? tableBodyProps === null || tableBodyProps === void 0 ? void 0 : tableBodyProps.sx(theme)
|
2560
|
-
: tableBodyProps === null || tableBodyProps === void 0 ? void 0 : tableBodyProps.sx)))
|
2652
|
+
: tableBodyProps === null || tableBodyProps === void 0 ? void 0 : tableBodyProps.sx))), children: (_a = tableBodyProps === null || tableBodyProps === void 0 ? void 0 : tableBodyProps.children) !== null && _a !== void 0 ? _a : (!rows.length ? (jsxRuntime.jsx("tr", { style: { display: layoutMode === 'grid' ? 'grid' : 'table-row' }, children: jsxRuntime.jsx("td", { colSpan: table.getVisibleLeafColumns().length, style: {
|
2561
2653
|
display: layoutMode === 'grid' ? 'grid' : 'table-cell',
|
2562
|
-
}
|
2654
|
+
}, children: (_b = renderEmptyRowsFallback === null || renderEmptyRowsFallback === void 0 ? void 0 : renderEmptyRowsFallback({ table })) !== null && _b !== void 0 ? _b : (jsxRuntime.jsx(Typography__default["default"], { sx: {
|
2563
2655
|
color: 'text.secondary',
|
2564
2656
|
fontStyle: 'italic',
|
2565
2657
|
maxWidth: `min(100vw, ${(_d = (_c = tablePaperRef.current) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 360}px)`,
|
2566
2658
|
py: '2rem',
|
2567
2659
|
textAlign: 'center',
|
2568
2660
|
width: '100%',
|
2569
|
-
}
|
2661
|
+
}, children: globalFilter || columnFilters.length
|
2570
2662
|
? localization.noResultsFound
|
2571
|
-
: localization.noRecordsToDisplay }))
|
2663
|
+
: localization.noRecordsToDisplay })) }) })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: (virtualRows !== null && virtualRows !== void 0 ? virtualRows : rows).map((rowOrVirtualRow, rowIndex) => {
|
2572
2664
|
const row = rowVirtualizer
|
2573
2665
|
? rows[rowOrVirtualRow.index]
|
2574
2666
|
: rowOrVirtualRow;
|
2575
2667
|
const props = {
|
2576
2668
|
columnVirtualizer,
|
2577
|
-
key: row.id,
|
2578
2669
|
measureElement: rowVirtualizer === null || rowVirtualizer === void 0 ? void 0 : rowVirtualizer.measureElement,
|
2579
2670
|
numRows: rows.length,
|
2580
2671
|
row,
|
@@ -2587,7 +2678,7 @@ const MRT_TableBody = ({ columnVirtualizer, table, virtualColumns, virtualPaddin
|
|
2587
2678
|
? rowOrVirtualRow
|
2588
2679
|
: undefined,
|
2589
2680
|
};
|
2590
|
-
return memoMode === 'rows' ? (jsxRuntime.jsx(Memo_MRT_TableBodyRow, Object.assign({}, props))) : (jsxRuntime.jsx(MRT_TableBodyRow, Object.assign({}, props)));
|
2681
|
+
return memoMode === 'rows' ? (jsxRuntime.jsx(Memo_MRT_TableBodyRow, Object.assign({}, props), row.id)) : (jsxRuntime.jsx(MRT_TableBodyRow, Object.assign({}, props), row.id));
|
2591
2682
|
}) }))) })));
|
2592
2683
|
};
|
2593
2684
|
const Memo_MRT_TableBody = react.memo(MRT_TableBody, (prev, next) => prev.table.options.data === next.table.options.data);
|
@@ -2615,7 +2706,7 @@ const MRT_TableFooterCell = ({ footer, table }) => {
|
|
2615
2706
|
table,
|
2616
2707
|
theme,
|
2617
2708
|
tableCellProps,
|
2618
|
-
})))
|
2709
|
+
}))), children: jsxRuntime.jsx(jsxRuntime.Fragment, { children: footer.isPlaceholder
|
2619
2710
|
? null
|
2620
2711
|
: (_c = (_b = (columnDef.Footer instanceof Function
|
2621
2712
|
? (_a = columnDef.Footer) === null || _a === void 0 ? void 0 : _a.call(columnDef, {
|
@@ -2639,7 +2730,7 @@ const MRT_TableFooterRow = ({ footerGroup, table, virtualColumns, virtualPadding
|
|
2639
2730
|
: muiTableFooterRowProps;
|
2640
2731
|
return (jsxRuntime.jsxs(TableRow__default["default"], Object.assign({}, tableRowProps, { sx: (theme) => (Object.assign({ backgroundColor: styles.lighten(theme.palette.background.default, 0.04), display: layoutMode === 'grid' ? 'flex' : 'table-row', width: '100%' }, ((tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx) instanceof Function
|
2641
2732
|
? tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx(theme)
|
2642
|
-
: tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx)))
|
2733
|
+
: tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx))), children: [virtualPaddingLeft ? (jsxRuntime.jsx("th", { style: { display: 'flex', width: virtualPaddingLeft } })) : null, (virtualColumns !== null && virtualColumns !== void 0 ? virtualColumns : footerGroup.headers).map((footerOrVirtualFooter) => {
|
2643
2734
|
const footer = virtualColumns
|
2644
2735
|
? footerGroup.headers[footerOrVirtualFooter.index]
|
2645
2736
|
: footerOrVirtualFooter;
|
@@ -2660,7 +2751,7 @@ const MRT_TableFooter = ({ table, virtualColumns, virtualPaddingLeft, virtualPad
|
|
2660
2751
|
: `1px solid ${theme.palette.grey[700]}`
|
2661
2752
|
: undefined, position: stickFooter ? 'sticky' : undefined, zIndex: stickFooter ? 1 : undefined }, ((tableFooterProps === null || tableFooterProps === void 0 ? void 0 : tableFooterProps.sx) instanceof Function
|
2662
2753
|
? tableFooterProps === null || tableFooterProps === void 0 ? void 0 : tableFooterProps.sx(theme)
|
2663
|
-
: tableFooterProps === null || tableFooterProps === void 0 ? void 0 : tableFooterProps.sx)))
|
2754
|
+
: tableFooterProps === null || tableFooterProps === void 0 ? void 0 : tableFooterProps.sx))), children: getFooterGroups().map((footerGroup) => (jsxRuntime.jsx(MRT_TableFooterRow, { footerGroup: footerGroup, table: table, virtualColumns: virtualColumns, virtualPaddingLeft: virtualPaddingLeft, virtualPaddingRight: virtualPaddingRight }, footerGroup.id))) })));
|
2664
2755
|
};
|
2665
2756
|
|
2666
2757
|
const MRT_Table = ({ table }) => {
|
@@ -2733,7 +2824,7 @@ const MRT_Table = ({ table }) => {
|
|
2733
2824
|
};
|
2734
2825
|
return (jsxRuntime.jsxs(Table__default["default"], Object.assign({ stickyHeader: enableStickyHeader || isFullScreen }, tableProps, { sx: (theme) => (Object.assign({ borderCollapse: 'separate', display: layoutMode === 'grid' ? 'grid' : 'table', tableLayout: layoutMode !== 'grid' && enableColumnResizing ? 'fixed' : undefined }, ((tableProps === null || tableProps === void 0 ? void 0 : tableProps.sx) instanceof Function
|
2735
2826
|
? tableProps.sx(theme)
|
2736
|
-
: tableProps === null || tableProps === void 0 ? void 0 : tableProps.sx))), style: Object.assign(Object.assign({}, columnSizeVars), tableProps === null || tableProps === void 0 ? void 0 : tableProps.style)
|
2827
|
+
: tableProps === null || tableProps === void 0 ? void 0 : tableProps.sx))), style: Object.assign(Object.assign({}, columnSizeVars), tableProps === null || tableProps === void 0 ? void 0 : tableProps.style), children: [enableTableHead && jsxRuntime.jsx(MRT_TableHead, Object.assign({}, props)), memoMode === 'table-body' || columnSizingInfo.isResizingColumn ? (jsxRuntime.jsx(Memo_MRT_TableBody, Object.assign({ columnVirtualizer: columnVirtualizer }, props))) : (jsxRuntime.jsx(MRT_TableBody, Object.assign({ columnVirtualizer: columnVirtualizer }, props))), enableTableFooter && jsxRuntime.jsx(MRT_TableFooter, Object.assign({}, props))] })));
|
2737
2828
|
};
|
2738
2829
|
|
2739
2830
|
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? react.useLayoutEffect : react.useEffect;
|
@@ -2768,7 +2859,7 @@ const MRT_TableContainer = ({ table }) => {
|
|
2768
2859
|
? tableContainerProps.sx(theme)
|
2769
2860
|
: tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.sx))), style: Object.assign({ maxHeight: isFullScreen
|
2770
2861
|
? `calc(100vh - ${totalToolbarHeight}px)`
|
2771
|
-
: undefined }, tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.style)
|
2862
|
+
: undefined }, tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.style), children: jsxRuntime.jsx(MRT_Table, { table: table }) })));
|
2772
2863
|
};
|
2773
2864
|
|
2774
2865
|
const MRT_TablePaper = ({ table }) => {
|
@@ -2794,7 +2885,7 @@ const MRT_TablePaper = ({ table }) => {
|
|
2794
2885
|
padding: 0,
|
2795
2886
|
width: '100vw',
|
2796
2887
|
}
|
2797
|
-
: {}))
|
2888
|
+
: {})), children: [enableTopToolbar &&
|
2798
2889
|
(renderTopToolbar instanceof Function
|
2799
2890
|
? renderTopToolbar({ table })
|
2800
2891
|
: renderTopToolbar !== null && renderTopToolbar !== void 0 ? renderTopToolbar : jsxRuntime.jsx(MRT_TopToolbar, { table: table })), jsxRuntime.jsx(MRT_TableContainer, { table: table }), enableBottomToolbar &&
|
@@ -2805,15 +2896,15 @@ const MRT_TablePaper = ({ table }) => {
|
|
2805
2896
|
|
2806
2897
|
const MRT_EditRowModal = ({ open, row, table, }) => {
|
2807
2898
|
const { options: { localization }, } = table;
|
2808
|
-
return (jsxRuntime.jsxs(Dialog__default["default"],
|
2899
|
+
return (jsxRuntime.jsxs(Dialog__default["default"], { open: open, children: [jsxRuntime.jsx(DialogTitle__default["default"], { textAlign: "center", children: localization.edit }), jsxRuntime.jsx(DialogContent__default["default"], { children: jsxRuntime.jsx("form", { onSubmit: (e) => e.preventDefault(), children: jsxRuntime.jsx(Stack__default["default"], { sx: {
|
2809
2900
|
gap: '1.5rem',
|
2810
2901
|
minWidth: { xs: '300px', sm: '360px', md: '400px' },
|
2811
2902
|
pt: '1rem',
|
2812
2903
|
width: '100%',
|
2813
|
-
}
|
2904
|
+
}, children: row
|
2814
2905
|
.getAllCells()
|
2815
2906
|
.filter((cell) => cell.column.columnDef.columnDefType === 'data')
|
2816
|
-
.map((cell) => (jsxRuntime.jsx(MRT_EditCellTextField, { cell: cell, showLabel: true, table: table }, cell.id))) })
|
2907
|
+
.map((cell) => (jsxRuntime.jsx(MRT_EditCellTextField, { cell: cell, showLabel: true, table: table }, cell.id))) }) }) }), jsxRuntime.jsx(DialogActions__default["default"], { sx: { p: '1.25rem' }, children: jsxRuntime.jsx(MRT_EditActionButtons, { row: row, table: table, variant: "text" }) })] }));
|
2817
2908
|
};
|
2818
2909
|
|
2819
2910
|
const MRT_TableRoot = (props) => {
|
@@ -2927,7 +3018,23 @@ const MRT_TableRoot = (props) => {
|
|
2927
3018
|
: props.data;
|
2928
3019
|
}, [props.data, (_v = props.state) === null || _v === void 0 ? void 0 : _v.isLoading, (_w = props.state) === null || _w === void 0 ? void 0 : _w.showSkeletons]);
|
2929
3020
|
//@ts-ignore
|
2930
|
-
const table = Object.assign(Object.assign({}, reactTable.useReactTable(Object.assign(Object.assign({ getCoreRowModel: reactTable.getCoreRowModel(), getExpandedRowModel:
|
3021
|
+
const table = Object.assign(Object.assign({}, reactTable.useReactTable(Object.assign(Object.assign({ getCoreRowModel: reactTable.getCoreRowModel(), getExpandedRowModel: props.enableExpanding || props.enableGrouping
|
3022
|
+
? reactTable.getExpandedRowModel()
|
3023
|
+
: undefined, getFacetedMinMaxValues: props.enableFacetedValues
|
3024
|
+
? reactTable.getFacetedMinMaxValues()
|
3025
|
+
: undefined, getFacetedRowModel: props.enableFacetedValues
|
3026
|
+
? reactTable.getFacetedRowModel()
|
3027
|
+
: undefined, getFacetedUniqueValues: props.enableFacetedValues
|
3028
|
+
? reactTable.getFacetedUniqueValues()
|
3029
|
+
: undefined, getFilteredRowModel: props.enableColumnFilters ||
|
3030
|
+
props.enableGlobalFilter ||
|
3031
|
+
props.enableFilters
|
3032
|
+
? reactTable.getFilteredRowModel()
|
3033
|
+
: undefined, getGroupedRowModel: props.enableGrouping
|
3034
|
+
? reactTable.getGroupedRowModel()
|
3035
|
+
: undefined, getPaginationRowModel: props.enablePagination
|
3036
|
+
? reactTable.getPaginationRowModel()
|
3037
|
+
: undefined, getSortedRowModel: props.enableSorting ? reactTable.getSortedRowModel() : undefined, onColumnOrderChange: setColumnOrder, onGroupingChange: setGrouping, getSubRows: (row) => row === null || row === void 0 ? void 0 : row.subRows }, props), {
|
2931
3038
|
//@ts-ignore
|
2932
3039
|
columns: columnDefs, data, globalFilterFn: (_y = (_x = props.filterFns) === null || _x === void 0 ? void 0 : _x[globalFilterFn]) !== null && _y !== void 0 ? _y : (_z = props.filterFns) === null || _z === void 0 ? void 0 : _z.fuzzy, initialState, state: Object.assign({ columnFilterFns,
|
2933
3040
|
columnOrder,
|
@@ -2988,12 +3095,12 @@ const MRT_TableRoot = (props) => {
|
|
2988
3095
|
table.setPageIndex(Math.floor(totalRowCount / pageSize));
|
2989
3096
|
}
|
2990
3097
|
}, [props.rowCount, table.getPrePaginationRowModel().rows.length]);
|
2991
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Dialog__default["default"],
|
3098
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Dialog__default["default"], { PaperComponent: Box__default["default"], TransitionComponent: !props.enableRowVirtualization ? Grow__default["default"] : undefined, disablePortal: true, fullScreen: true, keepMounted: false, onClose: () => table.setIsFullScreen(false), open: table.getState().isFullScreen, transitionDuration: 400, children: jsxRuntime.jsx(MRT_TablePaper, { table: table }) }), !table.getState().isFullScreen && (jsxRuntime.jsx(MRT_TablePaper, { table: table })), editingRow && props.editingMode === 'modal' && (jsxRuntime.jsx(MRT_EditRowModal, { row: editingRow, table: table, open: true }))] }));
|
2992
3099
|
};
|
2993
3100
|
|
2994
3101
|
const MaterialReactTable = (_a) => {
|
2995
3102
|
var _b;
|
2996
|
-
var { aggregationFns, autoResetExpanded = false, columnResizeMode = 'onChange', defaultColumn, defaultDisplayColumn, editingMode = 'modal', enableBottomToolbar = true, enableColumnActions = true, enableColumnFilters = true, enableColumnOrdering = false, enableColumnResizing = false, enableDensityToggle = true, enableExpandAll = true, enableFilterMatchHighlighting = true, enableFilters = true, enableFullScreenToggle = true, enableGlobalFilter = true, enableGlobalFilterRankedResults = true, enableGrouping = false, enableHiding = true, enableMultiRowSelection = true, enableMultiSort = true, enablePagination = true, enablePinning = false, enableRowSelection = false, enableSelectAll = true, enableSorting = true, enableStickyHeader = false, enableTableFooter = true, enableTableHead = true, enableToolbarInternalActions = true, enableTopToolbar = true, filterFns, icons, layoutMode = 'semantic', localization, manualFiltering, manualGrouping, manualPagination, manualSorting, positionActionsColumn = 'first', positionExpandColumn = 'first', positionGlobalFilter = 'right', positionPagination = 'bottom', positionToolbarAlertBanner = 'top', positionToolbarDropZone = 'top', rowNumberMode = 'original', selectAllMode = 'page', sortingFns } = _a, rest = __rest(_a, ["aggregationFns", "autoResetExpanded", "columnResizeMode", "defaultColumn", "defaultDisplayColumn", "editingMode", "enableBottomToolbar", "enableColumnActions", "enableColumnFilters", "enableColumnOrdering", "enableColumnResizing", "enableDensityToggle", "enableExpandAll", "enableFilterMatchHighlighting", "enableFilters", "enableFullScreenToggle", "enableGlobalFilter", "enableGlobalFilterRankedResults", "enableGrouping", "enableHiding", "enableMultiRowSelection", "enableMultiSort", "enablePagination", "enablePinning", "enableRowSelection", "enableSelectAll", "enableSorting", "enableStickyHeader", "enableTableFooter", "enableTableHead", "enableToolbarInternalActions", "enableTopToolbar", "filterFns", "icons", "layoutMode", "localization", "manualFiltering", "manualGrouping", "manualPagination", "manualSorting", "positionActionsColumn", "positionExpandColumn", "positionGlobalFilter", "positionPagination", "positionToolbarAlertBanner", "positionToolbarDropZone", "rowNumberMode", "selectAllMode", "sortingFns"]);
|
3103
|
+
var { aggregationFns, autoResetExpanded = false, columnResizeMode = 'onChange', defaultColumn, defaultDisplayColumn, editingMode = 'modal', enableBottomToolbar = true, enableColumnActions = true, enableColumnFilters = true, enableColumnOrdering = false, enableColumnResizing = false, enableDensityToggle = true, enableExpandAll = true, enableExpanding, enableFilterMatchHighlighting = true, enableFilters = true, enableFullScreenToggle = true, enableGlobalFilter = true, enableGlobalFilterRankedResults = true, enableGrouping = false, enableHiding = true, enableMultiRowSelection = true, enableMultiSort = true, enablePagination = true, enablePinning = false, enableRowSelection = false, enableSelectAll = true, enableSorting = true, enableStickyHeader = false, enableTableFooter = true, enableTableHead = true, enableToolbarInternalActions = true, enableTopToolbar = true, filterFns, icons, layoutMode = 'semantic', localization, manualFiltering, manualGrouping, manualPagination, manualSorting, positionActionsColumn = 'first', positionExpandColumn = 'first', positionGlobalFilter = 'right', positionPagination = 'bottom', positionToolbarAlertBanner = 'top', positionToolbarDropZone = 'top', rowNumberMode = 'original', selectAllMode = 'page', sortingFns } = _a, rest = __rest(_a, ["aggregationFns", "autoResetExpanded", "columnResizeMode", "defaultColumn", "defaultDisplayColumn", "editingMode", "enableBottomToolbar", "enableColumnActions", "enableColumnFilters", "enableColumnOrdering", "enableColumnResizing", "enableDensityToggle", "enableExpandAll", "enableExpanding", "enableFilterMatchHighlighting", "enableFilters", "enableFullScreenToggle", "enableGlobalFilter", "enableGlobalFilterRankedResults", "enableGrouping", "enableHiding", "enableMultiRowSelection", "enableMultiSort", "enablePagination", "enablePinning", "enableRowSelection", "enableSelectAll", "enableSorting", "enableStickyHeader", "enableTableFooter", "enableTableHead", "enableToolbarInternalActions", "enableTopToolbar", "filterFns", "icons", "layoutMode", "localization", "manualFiltering", "manualGrouping", "manualPagination", "manualSorting", "positionActionsColumn", "positionExpandColumn", "positionGlobalFilter", "positionPagination", "positionToolbarAlertBanner", "positionToolbarDropZone", "rowNumberMode", "selectAllMode", "sortingFns"]);
|
2997
3104
|
const _icons = react.useMemo(() => (Object.assign(Object.assign({}, MRT_Default_Icons), icons)), [icons]);
|
2998
3105
|
const _localization = react.useMemo(() => (Object.assign(Object.assign({}, MRT_Localization_EN), localization)), [localization]);
|
2999
3106
|
const _aggregationFns = react.useMemo(() => (Object.assign(Object.assign({}, MRT_AggregationFns), aggregationFns)), []);
|
@@ -3016,7 +3123,7 @@ const MaterialReactTable = (_a) => {
|
|
3016
3123
|
manualPagination = true;
|
3017
3124
|
manualSorting = true;
|
3018
3125
|
}
|
3019
|
-
return (jsxRuntime.jsx(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, enableFilterMatchHighlighting: enableFilterMatchHighlighting, 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, layoutMode: layoutMode, localization: _localization, manualFiltering: manualFiltering, manualGrouping: manualGrouping, manualPagination: manualPagination, manualSorting: manualSorting, positionActionsColumn: positionActionsColumn, positionExpandColumn: positionExpandColumn, positionGlobalFilter: positionGlobalFilter, positionPagination: positionPagination, positionToolbarAlertBanner: positionToolbarAlertBanner, positionToolbarDropZone: positionToolbarDropZone, rowNumberMode: rowNumberMode, selectAllMode: selectAllMode, sortingFns: _sortingFns }, rest)));
|
3126
|
+
return (jsxRuntime.jsx(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, enableExpanding: enableExpanding, enableFilterMatchHighlighting: enableFilterMatchHighlighting, 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, layoutMode: layoutMode, localization: _localization, manualFiltering: manualFiltering, manualGrouping: manualGrouping, manualPagination: manualPagination, manualSorting: manualSorting, positionActionsColumn: positionActionsColumn, positionExpandColumn: positionExpandColumn, positionGlobalFilter: positionGlobalFilter, positionPagination: positionPagination, positionToolbarAlertBanner: positionToolbarAlertBanner, positionToolbarDropZone: positionToolbarDropZone, rowNumberMode: rowNumberMode, selectAllMode: selectAllMode, sortingFns: _sortingFns }, rest)));
|
3020
3127
|
};
|
3021
3128
|
|
3022
3129
|
exports.MRT_AggregationFns = MRT_AggregationFns;
|
@@ -3042,9 +3149,5 @@ exports.MRT_ToolbarDropZone = MRT_ToolbarDropZone;
|
|
3042
3149
|
exports.MRT_ToolbarInternalButtons = MRT_ToolbarInternalButtons;
|
3043
3150
|
exports.MRT_TopToolbar = MRT_TopToolbar;
|
3044
3151
|
exports.MaterialReactTable = MaterialReactTable;
|
3045
|
-
|
3046
|
-
/**
|
3047
|
-
* @deprecated Use `import { MaterialReactTable } from 'material-react-table';` instead
|
3048
|
-
*/
|
3049
3152
|
exports["default"] = MaterialReactTable;
|
3050
3153
|
//# sourceMappingURL=index.js.map
|