material-react-table 2.0.0-beta.2 → 2.0.0-beta.4
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 +417 -410
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/body/MRT_TableBody.d.ts +4 -3
- package/dist/cjs/types/body/MRT_TableBodyCell.d.ts +5 -5
- package/dist/cjs/types/body/MRT_TableBodyRowGrabHandle.d.ts +3 -2
- package/dist/cjs/types/body/MRT_TableBodyRowPinButton.d.ts +3 -2
- package/dist/cjs/types/body/MRT_TableDetailPanel.d.ts +3 -2
- package/dist/cjs/types/buttons/MRT_ColumnPinningButtons.d.ts +3 -2
- package/dist/cjs/types/buttons/MRT_CopyButton.d.ts +3 -4
- package/dist/cjs/types/buttons/MRT_EditActionButtons.d.ts +3 -2
- package/dist/cjs/types/buttons/MRT_ExpandAllButton.d.ts +3 -2
- package/dist/cjs/types/buttons/MRT_ExpandButton.d.ts +2 -1
- package/dist/cjs/types/buttons/MRT_GrabHandleButton.d.ts +2 -2
- package/dist/cjs/types/buttons/MRT_RowPinButton.d.ts +3 -2
- package/dist/cjs/types/buttons/MRT_ToggleRowActionMenuButton.d.ts +3 -2
- package/dist/cjs/types/footer/MRT_TableFooter.d.ts +3 -2
- package/dist/cjs/types/footer/MRT_TableFooterCell.d.ts +3 -2
- package/dist/cjs/types/footer/MRT_TableFooterRow.d.ts +3 -2
- package/dist/cjs/types/head/MRT_TableHead.d.ts +3 -2
- package/dist/cjs/types/head/MRT_TableHeadCell.d.ts +3 -2
- package/dist/cjs/types/head/MRT_TableHeadCellColumnActionsButton.d.ts +3 -2
- package/dist/cjs/types/head/MRT_TableHeadCellFilterContainer.d.ts +3 -2
- package/dist/cjs/types/head/MRT_TableHeadCellFilterLabel.d.ts +3 -2
- package/dist/cjs/types/head/MRT_TableHeadCellGrabHandle.d.ts +3 -2
- package/dist/cjs/types/head/MRT_TableHeadCellResizeHandle.d.ts +3 -2
- package/dist/cjs/types/head/MRT_TableHeadCellSortLabel.d.ts +3 -2
- package/dist/cjs/types/head/MRT_TableHeadRow.d.ts +3 -2
- package/dist/cjs/types/inputs/MRT_EditCellTextField.d.ts +3 -2
- package/dist/cjs/types/inputs/MRT_FilterCheckbox.d.ts +3 -2
- package/dist/cjs/types/inputs/MRT_FilterRangeFields.d.ts +3 -2
- package/dist/cjs/types/inputs/MRT_FilterRangeSlider.d.ts +3 -2
- package/dist/cjs/types/inputs/MRT_FilterTextField.d.ts +3 -2
- package/dist/cjs/types/inputs/MRT_GlobalFilterTextField.d.ts +3 -2
- package/dist/cjs/types/inputs/MRT_SelectCheckbox.d.ts +3 -2
- package/dist/cjs/types/menus/MRT_ColumnActionMenu.d.ts +3 -2
- package/dist/cjs/types/menus/MRT_FilterOptionMenu.d.ts +3 -2
- package/dist/cjs/types/menus/MRT_RowActionMenu.d.ts +3 -2
- package/dist/cjs/types/menus/MRT_ShowHideColumnsMenu.d.ts +3 -2
- package/dist/cjs/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +3 -2
- package/dist/cjs/types/modals/MRT_EditRowModal.d.ts +3 -2
- package/dist/cjs/types/table/MRT_Table.d.ts +3 -2
- package/dist/cjs/types/table/MRT_TableContainer.d.ts +3 -2
- package/dist/cjs/types/table/MRT_TableLoadingOverlay.d.ts +7 -0
- package/dist/cjs/types/table/MRT_TablePaper.d.ts +3 -2
- package/dist/cjs/types/table/index.d.ts +1 -0
- package/dist/cjs/types/toolbar/MRT_BottomToolbar.d.ts +3 -2
- package/dist/cjs/types/toolbar/MRT_LinearProgressBar.d.ts +3 -2
- package/dist/cjs/types/toolbar/MRT_TablePagination.d.ts +6 -2
- package/dist/cjs/types/toolbar/MRT_ToolbarAlertBanner.d.ts +3 -2
- package/dist/cjs/types/toolbar/MRT_ToolbarDropZone.d.ts +3 -2
- package/dist/cjs/types/toolbar/MRT_ToolbarInternalButtons.d.ts +3 -2
- package/dist/cjs/types/toolbar/MRT_TopToolbar.d.ts +1 -2
- package/dist/cjs/types/types.d.ts +3 -3
- package/dist/esm/material-react-table.esm.js +415 -408
- package/dist/esm/material-react-table.esm.js.map +1 -1
- package/dist/esm/types/body/MRT_TableBody.d.ts +4 -3
- package/dist/esm/types/body/MRT_TableBodyCell.d.ts +5 -5
- package/dist/esm/types/body/MRT_TableBodyRowGrabHandle.d.ts +3 -2
- package/dist/esm/types/body/MRT_TableBodyRowPinButton.d.ts +3 -2
- package/dist/esm/types/body/MRT_TableDetailPanel.d.ts +3 -2
- package/dist/esm/types/buttons/MRT_ColumnPinningButtons.d.ts +3 -2
- package/dist/esm/types/buttons/MRT_CopyButton.d.ts +3 -4
- package/dist/esm/types/buttons/MRT_EditActionButtons.d.ts +3 -2
- package/dist/esm/types/buttons/MRT_ExpandAllButton.d.ts +3 -2
- package/dist/esm/types/buttons/MRT_ExpandButton.d.ts +2 -1
- package/dist/esm/types/buttons/MRT_GrabHandleButton.d.ts +2 -2
- package/dist/esm/types/buttons/MRT_RowPinButton.d.ts +3 -2
- package/dist/esm/types/buttons/MRT_ToggleRowActionMenuButton.d.ts +3 -2
- package/dist/esm/types/footer/MRT_TableFooter.d.ts +3 -2
- package/dist/esm/types/footer/MRT_TableFooterCell.d.ts +3 -2
- package/dist/esm/types/footer/MRT_TableFooterRow.d.ts +3 -2
- package/dist/esm/types/head/MRT_TableHead.d.ts +3 -2
- package/dist/esm/types/head/MRT_TableHeadCell.d.ts +3 -2
- package/dist/esm/types/head/MRT_TableHeadCellColumnActionsButton.d.ts +3 -2
- package/dist/esm/types/head/MRT_TableHeadCellFilterContainer.d.ts +3 -2
- package/dist/esm/types/head/MRT_TableHeadCellFilterLabel.d.ts +3 -2
- package/dist/esm/types/head/MRT_TableHeadCellGrabHandle.d.ts +3 -2
- package/dist/esm/types/head/MRT_TableHeadCellResizeHandle.d.ts +3 -2
- package/dist/esm/types/head/MRT_TableHeadCellSortLabel.d.ts +3 -2
- package/dist/esm/types/head/MRT_TableHeadRow.d.ts +3 -2
- package/dist/esm/types/inputs/MRT_EditCellTextField.d.ts +3 -2
- package/dist/esm/types/inputs/MRT_FilterCheckbox.d.ts +3 -2
- package/dist/esm/types/inputs/MRT_FilterRangeFields.d.ts +3 -2
- package/dist/esm/types/inputs/MRT_FilterRangeSlider.d.ts +3 -2
- package/dist/esm/types/inputs/MRT_FilterTextField.d.ts +3 -2
- package/dist/esm/types/inputs/MRT_GlobalFilterTextField.d.ts +3 -2
- package/dist/esm/types/inputs/MRT_SelectCheckbox.d.ts +3 -2
- package/dist/esm/types/menus/MRT_ColumnActionMenu.d.ts +3 -2
- package/dist/esm/types/menus/MRT_FilterOptionMenu.d.ts +3 -2
- package/dist/esm/types/menus/MRT_RowActionMenu.d.ts +3 -2
- package/dist/esm/types/menus/MRT_ShowHideColumnsMenu.d.ts +3 -2
- package/dist/esm/types/menus/MRT_ShowHideColumnsMenuItems.d.ts +3 -2
- package/dist/esm/types/modals/MRT_EditRowModal.d.ts +3 -2
- package/dist/esm/types/table/MRT_Table.d.ts +3 -2
- package/dist/esm/types/table/MRT_TableContainer.d.ts +3 -2
- package/dist/esm/types/table/MRT_TableLoadingOverlay.d.ts +7 -0
- package/dist/esm/types/table/MRT_TablePaper.d.ts +3 -2
- package/dist/esm/types/table/index.d.ts +1 -0
- package/dist/esm/types/toolbar/MRT_BottomToolbar.d.ts +3 -2
- package/dist/esm/types/toolbar/MRT_LinearProgressBar.d.ts +3 -2
- package/dist/esm/types/toolbar/MRT_TablePagination.d.ts +6 -2
- package/dist/esm/types/toolbar/MRT_ToolbarAlertBanner.d.ts +3 -2
- package/dist/esm/types/toolbar/MRT_ToolbarDropZone.d.ts +3 -2
- package/dist/esm/types/toolbar/MRT_ToolbarInternalButtons.d.ts +3 -2
- package/dist/esm/types/toolbar/MRT_TopToolbar.d.ts +1 -2
- package/dist/esm/types/types.d.ts +3 -3
- package/dist/index.d.ts +130 -119
- package/package.json +1 -1
- package/src/body/MRT_TableBody.tsx +8 -4
- package/src/body/MRT_TableBodyCell.tsx +60 -61
- package/src/body/MRT_TableBodyRow.tsx +3 -3
- package/src/body/MRT_TableBodyRowGrabHandle.tsx +10 -5
- package/src/body/MRT_TableBodyRowPinButton.tsx +12 -5
- package/src/body/MRT_TableDetailPanel.tsx +11 -7
- package/src/buttons/MRT_ColumnPinningButtons.tsx +12 -3
- package/src/buttons/MRT_CopyButton.tsx +6 -8
- package/src/buttons/MRT_EditActionButtons.tsx +9 -3
- package/src/buttons/MRT_ExpandAllButton.tsx +9 -5
- package/src/buttons/MRT_ExpandButton.tsx +2 -2
- package/src/buttons/MRT_GrabHandleButton.tsx +8 -5
- package/src/buttons/MRT_RowPinButton.tsx +8 -4
- package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +7 -3
- package/src/column.utils.ts +1 -1
- package/src/footer/MRT_TableFooter.tsx +9 -5
- package/src/footer/MRT_TableFooterCell.tsx +12 -12
- package/src/footer/MRT_TableFooterRow.tsx +10 -6
- package/src/head/MRT_TableHead.tsx +8 -4
- package/src/head/MRT_TableHeadCell.tsx +93 -84
- package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +5 -3
- package/src/head/MRT_TableHeadCellFilterContainer.tsx +4 -2
- package/src/head/MRT_TableHeadCellFilterLabel.tsx +8 -4
- package/src/head/MRT_TableHeadCellGrabHandle.tsx +4 -1
- package/src/head/MRT_TableHeadCellResizeHandle.tsx +7 -4
- package/src/head/MRT_TableHeadCellSortLabel.tsx +28 -12
- package/src/head/MRT_TableHeadRow.tsx +10 -6
- package/src/hooks/useMRT_DisplayColumns.tsx +2 -1
- package/src/inputs/MRT_EditCellTextField.tsx +16 -2
- package/src/inputs/MRT_FilterCheckbox.tsx +4 -2
- package/src/inputs/MRT_FilterRangeFields.tsx +13 -3
- package/src/inputs/MRT_FilterRangeSlider.tsx +4 -2
- package/src/inputs/MRT_FilterTextField.tsx +3 -1
- package/src/inputs/MRT_GlobalFilterTextField.tsx +9 -5
- package/src/inputs/MRT_SelectCheckbox.tsx +8 -4
- package/src/menus/MRT_ColumnActionMenu.tsx +4 -2
- package/src/menus/MRT_FilterOptionMenu.tsx +4 -2
- package/src/menus/MRT_RowActionMenu.tsx +4 -2
- package/src/menus/MRT_ShowHideColumnsMenu.tsx +4 -2
- package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +6 -3
- package/src/modals/MRT_EditRowModal.tsx +5 -3
- package/src/table/MRT_Table.tsx +25 -31
- package/src/table/MRT_TableContainer.tsx +15 -44
- package/src/table/MRT_TableLoadingOverlay.tsx +53 -0
- package/src/table/MRT_TablePaper.tsx +7 -3
- package/src/table/index.ts +1 -0
- package/src/toolbar/MRT_BottomToolbar.tsx +9 -7
- package/src/toolbar/MRT_LinearProgressBar.tsx +14 -8
- package/src/toolbar/MRT_TablePagination.tsx +18 -8
- package/src/toolbar/MRT_ToolbarAlertBanner.tsx +9 -5
- package/src/toolbar/MRT_ToolbarDropZone.tsx +6 -2
- package/src/toolbar/MRT_ToolbarInternalButtons.tsx +8 -4
- package/src/toolbar/MRT_TopToolbar.tsx +5 -8
- package/src/types.ts +5 -5
package/dist/cjs/index.js
CHANGED
|
@@ -5,17 +5,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var Paper = require('@mui/material/Paper');
|
|
7
7
|
var react = require('react');
|
|
8
|
-
var Box = require('@mui/material/Box');
|
|
9
|
-
var CircularProgress = require('@mui/material/CircularProgress');
|
|
10
8
|
var TableContainer = require('@mui/material/TableContainer');
|
|
11
|
-
var styles = require('@mui/material/styles');
|
|
12
9
|
var reactVirtual = require('@tanstack/react-virtual');
|
|
13
10
|
var Table = require('@mui/material/Table');
|
|
14
11
|
var TableBody = require('@mui/material/TableBody');
|
|
15
12
|
var Typography = require('@mui/material/Typography');
|
|
16
13
|
var TableRow = require('@mui/material/TableRow');
|
|
14
|
+
var styles = require('@mui/material/styles');
|
|
17
15
|
var Skeleton = require('@mui/material/Skeleton');
|
|
18
16
|
var TableCell = require('@mui/material/TableCell');
|
|
17
|
+
var Box = require('@mui/material/Box');
|
|
19
18
|
var highlightWords = require('highlight-words');
|
|
20
19
|
var IconButton = require('@mui/material/IconButton');
|
|
21
20
|
var Tooltip = require('@mui/material/Tooltip');
|
|
@@ -44,7 +43,6 @@ var Popover = require('@mui/material/Popover');
|
|
|
44
43
|
var Divider = require('@mui/material/Divider');
|
|
45
44
|
var Badge = require('@mui/material/Badge');
|
|
46
45
|
var TableSortLabel = require('@mui/material/TableSortLabel');
|
|
47
|
-
var Toolbar = require('@mui/material/Toolbar');
|
|
48
46
|
var useMediaQuery = require('@mui/material/useMediaQuery');
|
|
49
47
|
var LinearProgress = require('@mui/material/LinearProgress');
|
|
50
48
|
var InputLabel = require('@mui/material/InputLabel');
|
|
@@ -56,6 +54,7 @@ var AlertTitle = require('@mui/material/AlertTitle');
|
|
|
56
54
|
var Radio = require('@mui/material/Radio');
|
|
57
55
|
var Fade = require('@mui/material/Fade');
|
|
58
56
|
var Switch = require('@mui/material/Switch');
|
|
57
|
+
var CircularProgress = require('@mui/material/CircularProgress');
|
|
59
58
|
var Dialog = require('@mui/material/Dialog');
|
|
60
59
|
var DialogActions = require('@mui/material/DialogActions');
|
|
61
60
|
var DialogContent = require('@mui/material/DialogContent');
|
|
@@ -97,8 +96,6 @@ var VisibilityOffIcon = require('@mui/icons-material/VisibilityOff');
|
|
|
97
96
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
98
97
|
|
|
99
98
|
var Paper__default = /*#__PURE__*/_interopDefaultLegacy(Paper);
|
|
100
|
-
var Box__default = /*#__PURE__*/_interopDefaultLegacy(Box);
|
|
101
|
-
var CircularProgress__default = /*#__PURE__*/_interopDefaultLegacy(CircularProgress);
|
|
102
99
|
var TableContainer__default = /*#__PURE__*/_interopDefaultLegacy(TableContainer);
|
|
103
100
|
var Table__default = /*#__PURE__*/_interopDefaultLegacy(Table);
|
|
104
101
|
var TableBody__default = /*#__PURE__*/_interopDefaultLegacy(TableBody);
|
|
@@ -106,6 +103,7 @@ var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
|
|
|
106
103
|
var TableRow__default = /*#__PURE__*/_interopDefaultLegacy(TableRow);
|
|
107
104
|
var Skeleton__default = /*#__PURE__*/_interopDefaultLegacy(Skeleton);
|
|
108
105
|
var TableCell__default = /*#__PURE__*/_interopDefaultLegacy(TableCell);
|
|
106
|
+
var Box__default = /*#__PURE__*/_interopDefaultLegacy(Box);
|
|
109
107
|
var highlightWords__default = /*#__PURE__*/_interopDefaultLegacy(highlightWords);
|
|
110
108
|
var IconButton__default = /*#__PURE__*/_interopDefaultLegacy(IconButton);
|
|
111
109
|
var Tooltip__default = /*#__PURE__*/_interopDefaultLegacy(Tooltip);
|
|
@@ -130,7 +128,6 @@ var Popover__default = /*#__PURE__*/_interopDefaultLegacy(Popover);
|
|
|
130
128
|
var Divider__default = /*#__PURE__*/_interopDefaultLegacy(Divider);
|
|
131
129
|
var Badge__default = /*#__PURE__*/_interopDefaultLegacy(Badge);
|
|
132
130
|
var TableSortLabel__default = /*#__PURE__*/_interopDefaultLegacy(TableSortLabel);
|
|
133
|
-
var Toolbar__default = /*#__PURE__*/_interopDefaultLegacy(Toolbar);
|
|
134
131
|
var useMediaQuery__default = /*#__PURE__*/_interopDefaultLegacy(useMediaQuery);
|
|
135
132
|
var LinearProgress__default = /*#__PURE__*/_interopDefaultLegacy(LinearProgress);
|
|
136
133
|
var InputLabel__default = /*#__PURE__*/_interopDefaultLegacy(InputLabel);
|
|
@@ -142,6 +139,7 @@ var AlertTitle__default = /*#__PURE__*/_interopDefaultLegacy(AlertTitle);
|
|
|
142
139
|
var Radio__default = /*#__PURE__*/_interopDefaultLegacy(Radio);
|
|
143
140
|
var Fade__default = /*#__PURE__*/_interopDefaultLegacy(Fade);
|
|
144
141
|
var Switch__default = /*#__PURE__*/_interopDefaultLegacy(Switch);
|
|
142
|
+
var CircularProgress__default = /*#__PURE__*/_interopDefaultLegacy(CircularProgress);
|
|
145
143
|
var Dialog__default = /*#__PURE__*/_interopDefaultLegacy(Dialog);
|
|
146
144
|
var DialogActions__default = /*#__PURE__*/_interopDefaultLegacy(DialogActions);
|
|
147
145
|
var DialogContent__default = /*#__PURE__*/_interopDefaultLegacy(DialogContent);
|
|
@@ -180,6 +178,33 @@ var SyncAltIcon__default = /*#__PURE__*/_interopDefaultLegacy(SyncAltIcon);
|
|
|
180
178
|
var ViewColumnIcon__default = /*#__PURE__*/_interopDefaultLegacy(ViewColumnIcon);
|
|
181
179
|
var VisibilityOffIcon__default = /*#__PURE__*/_interopDefaultLegacy(VisibilityOffIcon);
|
|
182
180
|
|
|
181
|
+
/******************************************************************************
|
|
182
|
+
Copyright (c) Microsoft Corporation.
|
|
183
|
+
|
|
184
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
185
|
+
purpose with or without fee is hereby granted.
|
|
186
|
+
|
|
187
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
188
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
189
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
190
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
191
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
192
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
193
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
194
|
+
***************************************************************************** */
|
|
195
|
+
function __rest(s, e) {
|
|
196
|
+
var t = {};
|
|
197
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
198
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
199
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
200
|
+
}
|
|
201
|
+
return t;
|
|
202
|
+
}
|
|
203
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
204
|
+
var e = new Error(message);
|
|
205
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
206
|
+
};
|
|
207
|
+
|
|
183
208
|
const allowedTypes = ['string', 'number'];
|
|
184
209
|
const MRT_TableBodyCellValue = ({ cell, table, }) => {
|
|
185
210
|
var _a, _b, _c;
|
|
@@ -340,7 +365,6 @@ const getLeadingDisplayColumnIds = (props) => {
|
|
|
340
365
|
'mrt-row-expand',
|
|
341
366
|
props.enableRowSelection && 'mrt-row-select',
|
|
342
367
|
props.enableRowNumbers && 'mrt-row-numbers',
|
|
343
|
-
props.layoutMode === 'grid-no-grow' && 'mrt-row-spacer',
|
|
344
368
|
].filter(Boolean);
|
|
345
369
|
};
|
|
346
370
|
const getTrailingDisplayColumnIds = (props) => {
|
|
@@ -354,6 +378,7 @@ const getTrailingDisplayColumnIds = (props) => {
|
|
|
354
378
|
props.positionExpandColumn === 'last' &&
|
|
355
379
|
showExpandColumn(props) &&
|
|
356
380
|
'mrt-row-expand',
|
|
381
|
+
props.layoutMode === 'grid-no-grow' && 'mrt-row-spacer',
|
|
357
382
|
].filter(Boolean);
|
|
358
383
|
};
|
|
359
384
|
const getDefaultColumnOrderIds = (props) => {
|
|
@@ -507,27 +532,30 @@ function createMRTColumnHelper() {
|
|
|
507
532
|
};
|
|
508
533
|
}
|
|
509
534
|
|
|
510
|
-
const MRT_GrabHandleButton = (
|
|
511
|
-
var
|
|
535
|
+
const MRT_GrabHandleButton = (_a) => {
|
|
536
|
+
var _b;
|
|
537
|
+
var { iconButtonProps, location, onDragEnd, onDragStart, table } = _a, rest = __rest(_a, ["iconButtonProps", "location", "onDragEnd", "onDragStart", "table"]);
|
|
512
538
|
const { options: { icons: { DragHandleIcon }, localization, }, } = table;
|
|
513
|
-
|
|
539
|
+
const _iconButtonProps = Object.assign(Object.assign({}, iconButtonProps), rest);
|
|
540
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (_b = _iconButtonProps === null || _iconButtonProps === void 0 ? void 0 : _iconButtonProps.title) !== null && _b !== void 0 ? _b : localization.move, children: jsxRuntime.jsx(IconButton__default["default"], Object.assign({ disableRipple: true, draggable: "true", size: "small" }, _iconButtonProps, { onClick: (e) => {
|
|
514
541
|
var _a;
|
|
515
542
|
e.stopPropagation();
|
|
516
|
-
(_a =
|
|
543
|
+
(_a = _iconButtonProps === null || _iconButtonProps === void 0 ? void 0 : _iconButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(_iconButtonProps, e);
|
|
517
544
|
}, onDragEnd: onDragEnd, onDragStart: onDragStart, sx: (theme) => (Object.assign({ '&:active': {
|
|
518
545
|
cursor: 'grabbing',
|
|
519
546
|
}, '&:hover': {
|
|
520
547
|
backgroundColor: 'transparent',
|
|
521
548
|
opacity: 1,
|
|
522
|
-
}, cursor: 'grab', m: '0 -0.1rem', opacity: location === 'row' ? 1 : 0.3, p: '2px', transition: 'all 150ms ease-in-out' }, parseFromValuesOrFunc(
|
|
549
|
+
}, cursor: 'grab', m: '0 -0.1rem', opacity: location === 'row' ? 1 : 0.3, p: '2px', transition: 'all 150ms ease-in-out' }, parseFromValuesOrFunc(_iconButtonProps === null || _iconButtonProps === void 0 ? void 0 : _iconButtonProps.sx, theme))), title: undefined, children: jsxRuntime.jsx(DragHandleIcon, {}) })) }));
|
|
523
550
|
};
|
|
524
551
|
|
|
525
|
-
const MRT_TableBodyRowGrabHandle = (
|
|
552
|
+
const MRT_TableBodyRowGrabHandle = (_a) => {
|
|
553
|
+
var { row, rowRef, table } = _a, rest = __rest(_a, ["row", "rowRef", "table"]);
|
|
526
554
|
const { options: { muiRowDragHandleProps }, } = table;
|
|
527
|
-
const iconButtonProps = parseFromValuesOrFunc(muiRowDragHandleProps, {
|
|
555
|
+
const iconButtonProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiRowDragHandleProps, {
|
|
528
556
|
row,
|
|
529
557
|
table,
|
|
530
|
-
});
|
|
558
|
+
})), rest);
|
|
531
559
|
const handleDragStart = (event) => {
|
|
532
560
|
var _a;
|
|
533
561
|
(_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.onDragStart) === null || _a === void 0 ? void 0 : _a.call(iconButtonProps, event);
|
|
@@ -543,8 +571,9 @@ const MRT_TableBodyRowGrabHandle = ({ row, rowRef, table, }) => {
|
|
|
543
571
|
return (jsxRuntime.jsx(MRT_GrabHandleButton, { iconButtonProps: iconButtonProps, location: "row", onDragEnd: handleDragEnd, onDragStart: handleDragStart, table: table }));
|
|
544
572
|
};
|
|
545
573
|
|
|
546
|
-
const MRT_CopyButton = (
|
|
547
|
-
var
|
|
574
|
+
const MRT_CopyButton = (_a) => {
|
|
575
|
+
var _b;
|
|
576
|
+
var { cell, table } = _a, rest = __rest(_a, ["cell", "table"]);
|
|
548
577
|
const { options: { localization, muiCopyButtonProps }, } = table;
|
|
549
578
|
const { column, row } = cell;
|
|
550
579
|
const { columnDef } = column;
|
|
@@ -555,7 +584,7 @@ const MRT_CopyButton = ({ cell, children, table, }) => {
|
|
|
555
584
|
setCopied(true);
|
|
556
585
|
setTimeout(() => setCopied(false), 4000);
|
|
557
586
|
};
|
|
558
|
-
const buttonProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiCopyButtonProps, {
|
|
587
|
+
const buttonProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiCopyButtonProps, {
|
|
559
588
|
cell,
|
|
560
589
|
column,
|
|
561
590
|
row,
|
|
@@ -565,12 +594,13 @@ const MRT_CopyButton = ({ cell, children, table, }) => {
|
|
|
565
594
|
column,
|
|
566
595
|
row,
|
|
567
596
|
table,
|
|
568
|
-
}));
|
|
569
|
-
return (jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (
|
|
597
|
+
})), rest);
|
|
598
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (_b = buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.title) !== null && _b !== void 0 ? _b : (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' }, parseFromValuesOrFunc(buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.sx, theme))), title: undefined })) }));
|
|
570
599
|
};
|
|
571
600
|
|
|
572
|
-
const MRT_EditCellTextField = (
|
|
573
|
-
var
|
|
601
|
+
const MRT_EditCellTextField = (_a) => {
|
|
602
|
+
var _b, _c, _d, _e;
|
|
603
|
+
var { cell, table } = _a, rest = __rest(_a, ["cell", "table"]);
|
|
574
604
|
const { getState, options: { createDisplayMode, editDisplayMode, muiEditTextFieldProps }, refs: { editInputRefs }, setCreatingRow, setEditingCell, setEditingRow, } = table;
|
|
575
605
|
const { column, row } = cell;
|
|
576
606
|
const { columnDef } = column;
|
|
@@ -579,7 +609,7 @@ const MRT_EditCellTextField = ({ cell, table, }) => {
|
|
|
579
609
|
const isEditing = (editingRow === null || editingRow === void 0 ? void 0 : editingRow.id) === row.id;
|
|
580
610
|
const isSelectEdit = columnDef.editVariant === 'select';
|
|
581
611
|
const [value, setValue] = react.useState(() => cell.getValue());
|
|
582
|
-
const textFieldProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiEditTextFieldProps, {
|
|
612
|
+
const textFieldProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiEditTextFieldProps, {
|
|
583
613
|
cell,
|
|
584
614
|
column,
|
|
585
615
|
row,
|
|
@@ -589,7 +619,7 @@ const MRT_EditCellTextField = ({ cell, table, }) => {
|
|
|
589
619
|
column,
|
|
590
620
|
row,
|
|
591
621
|
table,
|
|
592
|
-
}));
|
|
622
|
+
})), rest);
|
|
593
623
|
const saveInputValueToRowCache = (newValue) => {
|
|
594
624
|
//@ts-ignore
|
|
595
625
|
row._valuesCache[column.id] = newValue;
|
|
@@ -622,7 +652,7 @@ const MRT_EditCellTextField = ({ cell, table, }) => {
|
|
|
622
652
|
}
|
|
623
653
|
};
|
|
624
654
|
if (columnDef.Edit) {
|
|
625
|
-
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: (
|
|
655
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: (_b = columnDef.Edit) === null || _b === void 0 ? void 0 : _b.call(columnDef, { cell, column, row, table }) });
|
|
626
656
|
}
|
|
627
657
|
return (jsxRuntime.jsx(TextField__default["default"], Object.assign({ disabled: parseFromValuesOrFunc(columnDef.enableEditing, row) === false, fullWidth: true, inputRef: (inputRef) => {
|
|
628
658
|
if (inputRef) {
|
|
@@ -631,15 +661,18 @@ const MRT_EditCellTextField = ({ cell, table, }) => {
|
|
|
631
661
|
textFieldProps.inputRef = inputRef;
|
|
632
662
|
}
|
|
633
663
|
}
|
|
634
|
-
}, label:
|
|
664
|
+
}, label: ['custom', 'modal'].includes((isCreating ? createDisplayMode : editDisplayMode))
|
|
635
665
|
? columnDef.header
|
|
636
666
|
: undefined, margin: "none", name: column.id, placeholder: !['custom', 'modal'].includes((isCreating ? createDisplayMode : editDisplayMode))
|
|
637
667
|
? columnDef.header
|
|
638
|
-
: undefined, select: isSelectEdit, value: value, variant: "standard" }, textFieldProps, { InputProps: Object.assign({ disableUnderline: editDisplayMode === 'table' }, textFieldProps.InputProps),
|
|
668
|
+
: undefined, select: isSelectEdit, size: "small", value: value, variant: "standard" }, textFieldProps, { InputProps: Object.assign(Object.assign({ disableUnderline: editDisplayMode === 'table' }, textFieldProps.InputProps), { sx: (theme) => {
|
|
669
|
+
var _a;
|
|
670
|
+
return (Object.assign({ mb: 0 }, parseFromValuesOrFunc((_a = textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.InputProps) === null || _a === void 0 ? void 0 : _a.sx, theme)));
|
|
671
|
+
} }), inputProps: Object.assign({ autoComplete: 'new-password', sx: Object.assign({ p: 0 }, (_c = textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.inputProps) === null || _c === void 0 ? void 0 : _c.sx) }, textFieldProps.inputProps), onBlur: handleBlur, onChange: handleChange, onClick: (e) => {
|
|
639
672
|
var _a;
|
|
640
673
|
e.stopPropagation();
|
|
641
674
|
(_a = textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.onClick) === null || _a === void 0 ? void 0 : _a.call(textFieldProps, e);
|
|
642
|
-
}, onKeyDown: handleEnterKeyDown, children: (
|
|
675
|
+
}, onKeyDown: handleEnterKeyDown, children: (_d = textFieldProps.children) !== null && _d !== void 0 ? _d : (_e = columnDef === null || columnDef === void 0 ? void 0 : columnDef.editSelectOptions) === null || _e === void 0 ? void 0 : _e.map((option) => {
|
|
643
676
|
let value;
|
|
644
677
|
let text;
|
|
645
678
|
if (typeof option !== 'object') {
|
|
@@ -659,25 +692,17 @@ const MRT_EditCellTextField = ({ cell, table, }) => {
|
|
|
659
692
|
}) })));
|
|
660
693
|
};
|
|
661
694
|
|
|
662
|
-
const MRT_TableBodyCell = (
|
|
663
|
-
var
|
|
695
|
+
const MRT_TableBodyCell = (_a) => {
|
|
696
|
+
var _b, _c, _d, _e, _f;
|
|
697
|
+
var { cell, measureElement, numRows, rowIndex, rowRef, table, virtualIndex } = _a, rest = __rest(_a, ["cell", "measureElement", "numRows", "rowIndex", "rowRef", "table", "virtualIndex"]);
|
|
664
698
|
const theme = styles.useTheme();
|
|
665
699
|
const { getState, options: { createDisplayMode, editDisplayMode, enableClickToCopy, enableColumnOrdering, enableEditing, enableGrouping, enableRowNumbers, layoutMode, muiSkeletonProps, muiTableBodyCellProps, rowNumberMode, }, refs: { editInputRefs }, setEditingCell, setHoveredColumn, } = table;
|
|
666
700
|
const { columnSizingInfo, creatingRow, density, draggingColumn, draggingRow, editingCell, editingRow, hoveredColumn, hoveredRow, isLoading, showSkeletons, } = getState();
|
|
667
701
|
const { column, row } = cell;
|
|
668
702
|
const { columnDef } = column;
|
|
669
703
|
const { columnDefType } = columnDef;
|
|
670
|
-
const
|
|
671
|
-
|
|
672
|
-
column,
|
|
673
|
-
row,
|
|
674
|
-
table,
|
|
675
|
-
})), parseFromValuesOrFunc(columnDef.muiTableBodyCellProps, {
|
|
676
|
-
cell,
|
|
677
|
-
column,
|
|
678
|
-
row,
|
|
679
|
-
table,
|
|
680
|
-
}));
|
|
704
|
+
const args = { cell, column, row, table };
|
|
705
|
+
const tableCellProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableBodyCellProps, args)), parseFromValuesOrFunc(columnDef.muiTableBodyCellProps, args)), rest);
|
|
681
706
|
const skeletonProps = parseFromValuesOrFunc(muiSkeletonProps, {
|
|
682
707
|
cell,
|
|
683
708
|
column,
|
|
@@ -773,12 +798,12 @@ const MRT_TableBodyCell = ({ cell, measureElement, numRows, rowIndex, rowRef, ta
|
|
|
773
798
|
setHoveredColumn(columnDef.enableColumnOrdering !== false ? column : null);
|
|
774
799
|
}
|
|
775
800
|
};
|
|
776
|
-
return (jsxRuntime.jsx(TableCell__default["default"], Object.assign({ "data-index":
|
|
801
|
+
return (jsxRuntime.jsx(TableCell__default["default"], Object.assign({ "data-index": virtualIndex, ref: (node) => {
|
|
777
802
|
if (node) {
|
|
778
803
|
measureElement === null || measureElement === void 0 ? void 0 : measureElement(node);
|
|
779
804
|
}
|
|
780
805
|
} }, tableCellProps, { onDoubleClick: handleDoubleClick, onDragEnter: handleDragEnter, sx: (theme) => (Object.assign(Object.assign({ '&:hover': {
|
|
781
|
-
outline: ['cell', 'table'].includes(editDisplayMode !== null && editDisplayMode !== void 0 ? editDisplayMode : '')
|
|
806
|
+
outline: ['cell', 'table'].includes(editDisplayMode !== null && editDisplayMode !== void 0 ? editDisplayMode : '') && isEditable
|
|
782
807
|
? `1px solid ${theme.palette.text.secondary}`
|
|
783
808
|
: undefined,
|
|
784
809
|
outlineOffset: '-1px',
|
|
@@ -807,23 +832,24 @@ const MRT_TableBodyCell = ({ cell, measureElement, numRows, rowIndex, rowRef, ta
|
|
|
807
832
|
table,
|
|
808
833
|
tableCellProps,
|
|
809
834
|
theme,
|
|
810
|
-
})), draggingBorders)), children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [cell.getIsPlaceholder() ? ((
|
|
835
|
+
})), draggingBorders)), children: (_b = tableCellProps.children) !== null && _b !== void 0 ? _b : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [cell.getIsPlaceholder() ? ((_d = (_c = columnDef.PlaceholderCell) === null || _c === void 0 ? void 0 : _c.call(columnDef, { cell, column, row, table })) !== null && _d !== void 0 ? _d : null) : showSkeletons !== false && (isLoading || showSkeletons) ? (jsxRuntime.jsx(Skeleton__default["default"], Object.assign({ animation: "wave", height: 20, width: skeletonWidth }, skeletonProps))) : enableRowNumbers &&
|
|
811
836
|
rowNumberMode === 'static' &&
|
|
812
837
|
column.id === 'mrt-row-numbers' ? (rowIndex + 1) : column.id === 'mrt-row-drag' ? (jsxRuntime.jsx(MRT_TableBodyRowGrabHandle, { row: row, rowRef: rowRef, table: table })) : columnDefType === 'display' &&
|
|
813
838
|
(column.id === 'mrt-row-select' ||
|
|
814
839
|
column.id === 'mrt-row-expand' ||
|
|
815
|
-
!row.getIsGrouped()) ? ((
|
|
840
|
+
!row.getIsGrouped()) ? ((_e = columnDef.Cell) === null || _e === void 0 ? void 0 : _e.call(columnDef, {
|
|
816
841
|
cell,
|
|
817
842
|
column,
|
|
818
843
|
renderedCellValue: cell.renderValue(),
|
|
819
844
|
row,
|
|
820
845
|
table,
|
|
821
846
|
})) : isCreating || isEditing ? (jsxRuntime.jsx(MRT_EditCellTextField, { cell: cell, table: table })) : (enableClickToCopy || columnDef.enableClickToCopy) &&
|
|
822
|
-
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: [" (", (
|
|
847
|
+
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: [" (", (_f = row.subRows) === null || _f === void 0 ? void 0 : _f.length, ")"] }))] })) })));
|
|
823
848
|
};
|
|
824
849
|
const Memo_MRT_TableBodyCell = react.memo(MRT_TableBodyCell, (prev, next) => next.cell === prev.cell);
|
|
825
850
|
|
|
826
|
-
const MRT_TableDetailPanel = (
|
|
851
|
+
const MRT_TableDetailPanel = (_a) => {
|
|
852
|
+
var { parentRowRef, row, rowIndex, table, virtualRow } = _a, rest = __rest(_a, ["parentRowRef", "row", "rowIndex", "table", "virtualRow"]);
|
|
827
853
|
const { getState, getVisibleLeafColumns, options: { layoutMode, muiDetailPanelProps, muiTableBodyRowProps, renderDetailPanel, }, } = table;
|
|
828
854
|
const { isLoading } = getState();
|
|
829
855
|
const tableRowProps = parseFromValuesOrFunc(muiTableBodyRowProps, {
|
|
@@ -832,10 +858,10 @@ const MRT_TableDetailPanel = ({ parentRowRef, row, rowIndex, table, virtualRow,
|
|
|
832
858
|
staticRowIndex: rowIndex,
|
|
833
859
|
table,
|
|
834
860
|
});
|
|
835
|
-
const tableCellProps = parseFromValuesOrFunc(muiDetailPanelProps, {
|
|
861
|
+
const tableCellProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiDetailPanelProps, {
|
|
836
862
|
row,
|
|
837
863
|
table,
|
|
838
|
-
});
|
|
864
|
+
})), rest);
|
|
839
865
|
return (jsxRuntime.jsx(TableRow__default["default"], Object.assign({ className: "Mui-TableBodyCell-DetailPanel" }, tableRowProps, { sx: (theme) => {
|
|
840
866
|
var _a, _b;
|
|
841
867
|
return (Object.assign({ display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'flex' : undefined, position: virtualRow ? 'absolute' : undefined, top: virtualRow
|
|
@@ -845,7 +871,7 @@ const MRT_TableDetailPanel = ({ parentRowRef, row, rowIndex, table, virtualRow,
|
|
|
845
871
|
: undefined, width: '100%', zIndex: virtualRow ? 2 : undefined }, parseFromValuesOrFunc(tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx, theme)));
|
|
846
872
|
}, children: jsxRuntime.jsx(TableCell__default["default"], Object.assign({ className: "Mui-TableBodyCell-DetailPanel", colSpan: getVisibleLeafColumns().length }, tableCellProps, { sx: (theme) => (Object.assign({ backgroundColor: virtualRow
|
|
847
873
|
? styles.lighten(theme.palette.background.default, 0.05)
|
|
848
|
-
: undefined, borderBottom: !row.getIsExpanded() ? 'none' : undefined, display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'flex' :
|
|
874
|
+
: undefined, borderBottom: !row.getIsExpanded() ? 'none' : undefined, display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'flex' : undefined, py: row.getIsExpanded() ? '1rem' : 0, transition: 'all 150ms ease-in-out', width: `${table.getTotalSize()}px` }, parseFromValuesOrFunc(tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx, theme))), children: renderDetailPanel && (jsxRuntime.jsx(Collapse__default["default"], { in: row.getIsExpanded(), mountOnEnter: true, unmountOnExit: true, children: !isLoading && renderDetailPanel({ row, table }) })) })) })));
|
|
849
875
|
};
|
|
850
876
|
|
|
851
877
|
const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, pinnedRowIds, row, rowIndex, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, virtualRow, }) => {
|
|
@@ -904,7 +930,7 @@ const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, pinnedRo
|
|
|
904
930
|
? `${bottomPinnedIndex * rowHeight +
|
|
905
931
|
(enableStickyFooter ? tableFooterHeight - 1 : 0)}px`
|
|
906
932
|
: undefined, boxSizing: 'border-box', display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'flex' : undefined, opacity: isPinned
|
|
907
|
-
? 0.
|
|
933
|
+
? 0.97
|
|
908
934
|
: (draggingRow === null || draggingRow === void 0 ? void 0 : draggingRow.id) === row.id || (hoveredRow === null || hoveredRow === void 0 ? void 0 : hoveredRow.id) === row.id
|
|
909
935
|
? 0.5
|
|
910
936
|
: 1, position: virtualRow
|
|
@@ -935,8 +961,8 @@ const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, pinnedRo
|
|
|
935
961
|
rowIndex,
|
|
936
962
|
rowRef,
|
|
937
963
|
table,
|
|
938
|
-
|
|
939
|
-
? cellOrVirtualCell
|
|
964
|
+
virtualIndex: columnVirtualizer
|
|
965
|
+
? cellOrVirtualCell.index
|
|
940
966
|
: undefined,
|
|
941
967
|
};
|
|
942
968
|
return cell ? (memoMode === 'cells' &&
|
|
@@ -963,18 +989,19 @@ const MRT_SortingFns = Object.assign(Object.assign({}, reactTable.sortingFns), {
|
|
|
963
989
|
const rankGlobalFuzzy = (rowA, rowB) => Math.max(...Object.values(rowB.columnFiltersMeta).map((v) => v.rank)) -
|
|
964
990
|
Math.max(...Object.values(rowA.columnFiltersMeta).map((v) => v.rank));
|
|
965
991
|
|
|
966
|
-
const MRT_TableBody = (
|
|
967
|
-
var
|
|
992
|
+
const MRT_TableBody = (_a) => {
|
|
993
|
+
var _b, _c, _d, _e, _f, _g;
|
|
994
|
+
var { columnVirtualizer, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight } = _a, rest = __rest(_a, ["columnVirtualizer", "table", "virtualColumns", "virtualPaddingLeft", "virtualPaddingRight"]);
|
|
968
995
|
const { getBottomRows, getCenterRows, getIsSomeRowsPinned, getPrePaginationRowModel, getRowModel, getState, getTopRows, options: { createDisplayMode, enableGlobalFilterRankedResults, enablePagination, enableRowPinning, enableRowVirtualization, enableStickyFooter, enableStickyHeader, layoutMode, localization, manualExpanding, manualFiltering, manualGrouping, manualPagination, manualSorting, memoMode, muiTableBodyProps, renderEmptyRowsFallback, rowPinningDisplayMode, rowVirtualizerInstanceRef, rowVirtualizerOptions, }, refs: { tableContainerRef, tableFooterRef, tableHeadRef, tablePaperRef }, } = table;
|
|
969
996
|
const { columnFilters, creatingRow, density, draggingRow, expanded, globalFilter, isFullScreen, pagination, rowPinning, sorting, } = getState();
|
|
970
|
-
const tableBodyProps = parseFromValuesOrFunc(muiTableBodyProps, { table });
|
|
997
|
+
const tableBodyProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableBodyProps, { table })), rest);
|
|
971
998
|
const rowVirtualizerProps = parseFromValuesOrFunc(rowVirtualizerOptions, {
|
|
972
999
|
table,
|
|
973
1000
|
});
|
|
974
1001
|
const tableHeadHeight = ((enableStickyHeader || isFullScreen) &&
|
|
975
|
-
((
|
|
1002
|
+
((_b = tableHeadRef.current) === null || _b === void 0 ? void 0 : _b.clientHeight)) ||
|
|
976
1003
|
0;
|
|
977
|
-
const tableFooterHeight = (enableStickyFooter && ((
|
|
1004
|
+
const tableFooterHeight = (enableStickyFooter && ((_c = tableFooterRef.current) === null || _c === void 0 ? void 0 : _c.clientHeight)) || 0;
|
|
978
1005
|
const shouldRankRows = react.useMemo(() => getCanRankRows(table) &&
|
|
979
1006
|
!Object.values(sorting).some(Boolean) &&
|
|
980
1007
|
globalFilter, [
|
|
@@ -1051,16 +1078,16 @@ const MRT_TableBody = ({ columnVirtualizer, table, virtualColumns, virtualPaddin
|
|
|
1051
1078
|
return memoMode === 'rows' ? (jsxRuntime.jsx(Memo_MRT_TableBodyRow, Object.assign({}, props), row.id)) : (jsxRuntime.jsx(MRT_TableBodyRow, Object.assign({}, props), row.id));
|
|
1052
1079
|
}) }))), jsxRuntime.jsxs(TableBody__default["default"], Object.assign({}, tableBodyProps, { sx: (theme) => (Object.assign({ display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined, height: rowVirtualizer
|
|
1053
1080
|
? `${rowVirtualizer.getTotalSize()}px`
|
|
1054
|
-
: 'inherit', minHeight: !rows.length ? '100px' : undefined, position: 'relative' }, parseFromValuesOrFunc(tableBodyProps === null || tableBodyProps === void 0 ? void 0 : tableBodyProps.sx, theme))), children: [creatingRow && createDisplayMode === 'row' && (jsxRuntime.jsx(MRT_TableBodyRow, { row: creatingRow, rowIndex: -1, table: table })), (
|
|
1081
|
+
: 'inherit', minHeight: !rows.length ? '100px' : undefined, position: 'relative' }, parseFromValuesOrFunc(tableBodyProps === null || tableBodyProps === void 0 ? void 0 : tableBodyProps.sx, theme))), children: [creatingRow && createDisplayMode === 'row' && (jsxRuntime.jsx(MRT_TableBodyRow, { row: creatingRow, rowIndex: -1, table: table })), (_d = tableBodyProps === null || tableBodyProps === void 0 ? void 0 : tableBodyProps.children) !== null && _d !== void 0 ? _d : (!rows.length ? (jsxRuntime.jsx("tr", { style: {
|
|
1055
1082
|
display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined,
|
|
1056
1083
|
}, children: jsxRuntime.jsx("td", { colSpan: table.getVisibleLeafColumns().length, style: {
|
|
1057
1084
|
display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid'))
|
|
1058
1085
|
? 'grid'
|
|
1059
|
-
:
|
|
1060
|
-
}, children: (
|
|
1086
|
+
: undefined,
|
|
1087
|
+
}, children: (_e = renderEmptyRowsFallback === null || renderEmptyRowsFallback === void 0 ? void 0 : renderEmptyRowsFallback({ table })) !== null && _e !== void 0 ? _e : (jsxRuntime.jsx(Typography__default["default"], { sx: {
|
|
1061
1088
|
color: 'text.secondary',
|
|
1062
1089
|
fontStyle: 'italic',
|
|
1063
|
-
maxWidth: `min(100vw, ${(
|
|
1090
|
+
maxWidth: `min(100vw, ${(_g = (_f = tablePaperRef.current) === null || _f === void 0 ? void 0 : _f.clientWidth) !== null && _g !== void 0 ? _g : 360}px)`,
|
|
1064
1091
|
py: '2rem',
|
|
1065
1092
|
textAlign: 'center',
|
|
1066
1093
|
width: '100%',
|
|
@@ -1104,18 +1131,17 @@ const MRT_TableBody = ({ columnVirtualizer, table, virtualColumns, virtualPaddin
|
|
|
1104
1131
|
};
|
|
1105
1132
|
const Memo_MRT_TableBody = react.memo(MRT_TableBody, (prev, next) => prev.table.options.data === next.table.options.data);
|
|
1106
1133
|
|
|
1107
|
-
const MRT_TableFooterCell = (
|
|
1108
|
-
var
|
|
1134
|
+
const MRT_TableFooterCell = (_a) => {
|
|
1135
|
+
var _b, _c, _d;
|
|
1136
|
+
var { footer, table } = _a, rest = __rest(_a, ["footer", "table"]);
|
|
1109
1137
|
const { getState, options: { layoutMode, muiTableFooterCellProps }, } = table;
|
|
1110
1138
|
const { density } = getState();
|
|
1111
1139
|
const { column } = footer;
|
|
1112
1140
|
const { columnDef } = column;
|
|
1113
1141
|
const { columnDefType } = columnDef;
|
|
1114
|
-
const
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
}));
|
|
1118
|
-
return (jsxRuntime.jsx(TableCell__default["default"], Object.assign({ align: columnDefType === 'group' ? 'center' : 'left', colSpan: footer.colSpan, variant: "head" }, tableCellProps, { sx: (theme) => (Object.assign({ display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : 'table-cell', fontWeight: 'bold', justifyContent: columnDefType === 'group' ? 'center' : undefined, p: density === 'compact'
|
|
1142
|
+
const args = { column, table };
|
|
1143
|
+
const tableCellProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableFooterCellProps, args)), parseFromValuesOrFunc(columnDef.muiTableFooterCellProps, args)), rest);
|
|
1144
|
+
return (jsxRuntime.jsx(TableCell__default["default"], Object.assign({ align: columnDefType === 'group' ? 'center' : 'left', colSpan: footer.colSpan, variant: "head" }, tableCellProps, { sx: (theme) => (Object.assign(Object.assign({ display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined, fontWeight: 'bold', justifyContent: columnDefType === 'group' ? 'center' : undefined, p: density === 'compact'
|
|
1119
1145
|
? '0.5rem'
|
|
1120
1146
|
: density === 'comfortable'
|
|
1121
1147
|
? '1rem'
|
|
@@ -1124,27 +1150,28 @@ const MRT_TableFooterCell = ({ footer, table, }) => {
|
|
|
1124
1150
|
table,
|
|
1125
1151
|
tableCellProps,
|
|
1126
1152
|
theme,
|
|
1127
|
-
}))), children:
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1153
|
+
})), parseFromValuesOrFunc(tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.sx, theme))), children: (_b = tableCellProps.children) !== null && _b !== void 0 ? _b : (footer.isPlaceholder
|
|
1154
|
+
? null
|
|
1155
|
+
: (_d = (_c = parseFromValuesOrFunc(columnDef.Footer, {
|
|
1156
|
+
column,
|
|
1157
|
+
footer,
|
|
1158
|
+
table,
|
|
1159
|
+
})) !== null && _c !== void 0 ? _c : columnDef.footer) !== null && _d !== void 0 ? _d : null) })));
|
|
1134
1160
|
};
|
|
1135
1161
|
|
|
1136
|
-
const MRT_TableFooterRow = (
|
|
1137
|
-
var
|
|
1162
|
+
const MRT_TableFooterRow = (_a) => {
|
|
1163
|
+
var _b;
|
|
1164
|
+
var { footerGroup, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight } = _a, rest = __rest(_a, ["footerGroup", "table", "virtualColumns", "virtualPaddingLeft", "virtualPaddingRight"]);
|
|
1138
1165
|
const { options: { layoutMode, muiTableFooterRowProps }, } = table;
|
|
1139
1166
|
// if no content in row, skip row
|
|
1140
|
-
if (!((
|
|
1167
|
+
if (!((_b = footerGroup.headers) === null || _b === void 0 ? void 0 : _b.some((header) => (typeof header.column.columnDef.footer === 'string' &&
|
|
1141
1168
|
!!header.column.columnDef.footer) ||
|
|
1142
1169
|
header.column.columnDef.Footer)))
|
|
1143
1170
|
return null;
|
|
1144
|
-
const tableRowProps = parseFromValuesOrFunc(muiTableFooterRowProps, {
|
|
1171
|
+
const tableRowProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableFooterRowProps, {
|
|
1145
1172
|
footerGroup,
|
|
1146
1173
|
table,
|
|
1147
|
-
});
|
|
1174
|
+
})), rest);
|
|
1148
1175
|
return (jsxRuntime.jsxs(TableRow__default["default"], Object.assign({}, tableRowProps, { sx: (theme) => (Object.assign({ backgroundColor: styles.lighten(theme.palette.background.default, 0.05), display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'flex' : undefined, width: '100%' }, parseFromValuesOrFunc(tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx, theme))), children: [virtualPaddingLeft ? (jsxRuntime.jsx("th", { style: { display: 'flex', width: virtualPaddingLeft } })) : null, (virtualColumns !== null && virtualColumns !== void 0 ? virtualColumns : footerGroup.headers).map((footerOrVirtualFooter) => {
|
|
1149
1176
|
const footer = virtualColumns
|
|
1150
1177
|
? footerGroup.headers[footerOrVirtualFooter.index]
|
|
@@ -1153,12 +1180,13 @@ const MRT_TableFooterRow = ({ footerGroup, table, virtualColumns, virtualPadding
|
|
|
1153
1180
|
}), virtualPaddingRight ? (jsxRuntime.jsx("th", { style: { display: 'flex', width: virtualPaddingRight } })) : null] })));
|
|
1154
1181
|
};
|
|
1155
1182
|
|
|
1156
|
-
const MRT_TableFooter = (
|
|
1183
|
+
const MRT_TableFooter = (_a) => {
|
|
1184
|
+
var { table, virtualColumns, virtualPaddingLeft, virtualPaddingRight } = _a, rest = __rest(_a, ["table", "virtualColumns", "virtualPaddingLeft", "virtualPaddingRight"]);
|
|
1157
1185
|
const { getFooterGroups, getState, options: { enableStickyFooter, layoutMode, muiTableFooterProps }, refs: { tableFooterRef }, } = table;
|
|
1158
1186
|
const { isFullScreen } = getState();
|
|
1159
|
-
const tableFooterProps = parseFromValuesOrFunc(muiTableFooterProps, {
|
|
1187
|
+
const tableFooterProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableFooterProps, {
|
|
1160
1188
|
table,
|
|
1161
|
-
});
|
|
1189
|
+
})), rest);
|
|
1162
1190
|
const stickFooter = (isFullScreen || enableStickyFooter) && enableStickyFooter !== false;
|
|
1163
1191
|
return (jsxRuntime.jsx(TableFooter__default["default"], Object.assign({}, tableFooterProps, { ref: (ref) => {
|
|
1164
1192
|
tableFooterRef.current = ref;
|
|
@@ -1263,14 +1291,15 @@ const rangeModes = ['between', 'betweenInclusive', 'inNumberRange'];
|
|
|
1263
1291
|
const emptyModes = ['empty', 'notEmpty'];
|
|
1264
1292
|
const arrModes = ['arrIncludesSome', 'arrIncludesAll', 'arrIncludes'];
|
|
1265
1293
|
const rangeVariants = ['range-slider', 'date-range', 'range'];
|
|
1266
|
-
const MRT_FilterOptionMenu = (
|
|
1267
|
-
var
|
|
1294
|
+
const MRT_FilterOptionMenu = (_a) => {
|
|
1295
|
+
var _b, _c, _d, _e;
|
|
1296
|
+
var { anchorEl, header, onSelect, setAnchorEl, setFilterValue, table } = _a, rest = __rest(_a, ["anchorEl", "header", "onSelect", "setAnchorEl", "setFilterValue", "table"]);
|
|
1268
1297
|
const { getState, options: { columnFilterModeOptions, globalFilterModeOptions, localization, renderColumnFilterModeMenuItems, renderGlobalFilterModeMenuItems, }, setColumnFilterFns, setGlobalFilterFn, } = table;
|
|
1269
1298
|
const { density, globalFilterFn } = getState();
|
|
1270
1299
|
const { column } = header !== null && header !== void 0 ? header : {};
|
|
1271
1300
|
const { columnDef } = column !== null && column !== void 0 ? column : {};
|
|
1272
1301
|
const currentFilterValue = column === null || column === void 0 ? void 0 : column.getFilterValue();
|
|
1273
|
-
let allowedColumnFilterOptions = (
|
|
1302
|
+
let allowedColumnFilterOptions = (_b = columnDef === null || columnDef === void 0 ? void 0 : columnDef.columnFilterModeOptions) !== null && _b !== void 0 ? _b : columnFilterModeOptions;
|
|
1274
1303
|
if (rangeVariants.includes(columnDef === null || columnDef === void 0 ? void 0 : columnDef.filterVariant)) {
|
|
1275
1304
|
allowedColumnFilterOptions = [
|
|
1276
1305
|
...rangeModes,
|
|
@@ -1344,15 +1373,15 @@ const MRT_FilterOptionMenu = ({ anchorEl, header, onSelect, setAnchorEl, setFilt
|
|
|
1344
1373
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect();
|
|
1345
1374
|
};
|
|
1346
1375
|
const filterOption = !!header && columnDef ? columnDef._filterFn : globalFilterFn;
|
|
1347
|
-
return (jsxRuntime.jsx(Menu__default["default"], { MenuListProps: {
|
|
1376
|
+
return (jsxRuntime.jsx(Menu__default["default"], Object.assign({ MenuListProps: {
|
|
1348
1377
|
dense: density === 'compact',
|
|
1349
|
-
}, anchorEl: anchorEl, anchorOrigin: { horizontal: 'right', vertical: 'center' }, onClose: () => setAnchorEl(null), open: !!anchorEl, children: (
|
|
1350
|
-
? (
|
|
1378
|
+
}, anchorEl: anchorEl, anchorOrigin: { horizontal: 'right', vertical: 'center' }, onClose: () => setAnchorEl(null), open: !!anchorEl }, rest, { children: (_e = (header && column && columnDef
|
|
1379
|
+
? (_d = (_c = columnDef.renderColumnFilterModeMenuItems) === null || _c === void 0 ? void 0 : _c.call(columnDef, {
|
|
1351
1380
|
column: column,
|
|
1352
1381
|
internalFilterOptions,
|
|
1353
1382
|
onSelectFilterMode: handleSelectFilterMode,
|
|
1354
1383
|
table,
|
|
1355
|
-
})) !== null &&
|
|
1384
|
+
})) !== null && _d !== void 0 ? _d : renderColumnFilterModeMenuItems === null || renderColumnFilterModeMenuItems === void 0 ? void 0 : renderColumnFilterModeMenuItems({
|
|
1356
1385
|
column: column,
|
|
1357
1386
|
internalFilterOptions,
|
|
1358
1387
|
onSelectFilterMode: handleSelectFilterMode,
|
|
@@ -1362,13 +1391,13 @@ const MRT_FilterOptionMenu = ({ anchorEl, header, onSelect, setAnchorEl, setFilt
|
|
|
1362
1391
|
internalFilterOptions,
|
|
1363
1392
|
onSelectFilterMode: handleSelectFilterMode,
|
|
1364
1393
|
table,
|
|
1365
|
-
}))) !== null &&
|
|
1394
|
+
}))) !== null && _e !== void 0 ? _e : internalFilterOptions.map(({ divider, label, option, symbol }, index) => (jsxRuntime.jsxs(MenuItem__default["default"], { divider: divider, onClick: () => handleSelectFilterMode(option), selected: option === filterOption, sx: {
|
|
1366
1395
|
alignItems: 'center',
|
|
1367
1396
|
display: 'flex',
|
|
1368
1397
|
gap: '2ch',
|
|
1369
1398
|
my: 0,
|
|
1370
1399
|
py: '6px',
|
|
1371
|
-
}, value: option, children: [jsxRuntime.jsx(Box__default["default"], { sx: { fontSize: '1.25rem', width: '2ch' }, children: symbol }), label] }, index))) }));
|
|
1400
|
+
}, value: option, children: [jsxRuntime.jsx(Box__default["default"], { sx: { fontSize: '1.25rem', width: '2ch' }, children: symbol }), label] }, index))) })));
|
|
1372
1401
|
};
|
|
1373
1402
|
|
|
1374
1403
|
const commonMenuItemStyles = {
|
|
@@ -1381,8 +1410,9 @@ const commonListItemStyles = {
|
|
|
1381
1410
|
alignItems: 'center',
|
|
1382
1411
|
display: 'flex',
|
|
1383
1412
|
};
|
|
1384
|
-
const MRT_ColumnActionMenu = (
|
|
1385
|
-
var
|
|
1413
|
+
const MRT_ColumnActionMenu = (_a) => {
|
|
1414
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
1415
|
+
var { anchorEl, header, setAnchorEl, table } = _a, rest = __rest(_a, ["anchorEl", "header", "setAnchorEl", "table"]);
|
|
1386
1416
|
const { getState, options: { columnFilterDisplayMode, columnFilterModeOptions, enableColumnFilterModes, enableColumnFilters, enableColumnPinning, enableColumnResizing, enableGrouping, enableHiding, enableSorting, enableSortingRemoval, icons: { ArrowRightIcon, ClearAllIcon, DynamicFeedIcon, FilterListIcon, FilterListOffIcon, PushPinIcon, RestartAltIcon, SortIcon, ViewColumnIcon, VisibilityOffIcon, }, localization, renderColumnActionsMenuItems, }, refs: { filterInputRefs }, setColumnOrder, setColumnSizingInfo, setShowColumnFilters, toggleAllColumnsVisible, } = table;
|
|
1387
1417
|
const { column } = header;
|
|
1388
1418
|
const { columnDef } = column;
|
|
@@ -1437,7 +1467,7 @@ const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
|
|
|
1437
1467
|
setFilterMenuAnchorEl(event.currentTarget);
|
|
1438
1468
|
};
|
|
1439
1469
|
const isSelectFilter = !!columnDef.filterSelectOptions;
|
|
1440
|
-
const allowedColumnFilterOptions = (
|
|
1470
|
+
const allowedColumnFilterOptions = (_b = columnDef === null || columnDef === void 0 ? void 0 : columnDef.columnFilterModeOptions) !== null && _b !== void 0 ? _b : columnFilterModeOptions;
|
|
1441
1471
|
const showFilterModeSubMenu = enableColumnFilterModes &&
|
|
1442
1472
|
columnDef.enableColumnFilterModes !== false &&
|
|
1443
1473
|
!isSelectFilter &&
|
|
@@ -1447,8 +1477,8 @@ const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
|
|
|
1447
1477
|
...(enableSorting && column.getCanSort()
|
|
1448
1478
|
? [
|
|
1449
1479
|
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)),
|
|
1450
|
-
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)' } }) }), (
|
|
1451
|
-
jsxRuntime.jsx(MenuItem__default["default"], { disabled: column.getIsSorted() === 'desc', divider: enableColumnFilters || enableGrouping || enableHiding, onClick: handleSortDesc, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(SortIcon, {}) }), (
|
|
1480
|
+
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)' } }) }), (_c = localization.sortByColumnAsc) === null || _c === void 0 ? void 0 : _c.replace('{column}', String(columnDef.header))] }) }, 1),
|
|
1481
|
+
jsxRuntime.jsx(MenuItem__default["default"], { disabled: column.getIsSorted() === 'desc', divider: enableColumnFilters || enableGrouping || enableHiding, onClick: handleSortDesc, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(SortIcon, {}) }), (_d = localization.sortByColumnDesc) === null || _d === void 0 ? void 0 : _d.replace('{column}', String(columnDef.header))] }) }, 2),
|
|
1452
1482
|
]
|
|
1453
1483
|
: []),
|
|
1454
1484
|
...(enableColumnFilters && column.getCanFilter()
|
|
@@ -1458,13 +1488,13 @@ const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
|
|
|
1458
1488
|
!columnFilterValue.filter((value) => value).length), onClick: handleClearFilter, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(FilterListOffIcon, {}) }), localization.clearFilter] }) }, 3),
|
|
1459
1489
|
columnFilterDisplayMode === 'subheader' && (jsxRuntime.jsxs(MenuItem__default["default"], { disabled: showColumnFilters && !enableColumnFilterModes, divider: enableGrouping || enableHiding, onClick: showColumnFilters
|
|
1460
1490
|
? handleOpenFilterModeMenu
|
|
1461
|
-
: handleFilterByColumn, sx: commonMenuItemStyles, children: [jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(FilterListIcon, {}) }), (
|
|
1491
|
+
: handleFilterByColumn, sx: commonMenuItemStyles, children: [jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(FilterListIcon, {}) }), (_e = localization.filterByColumn) === null || _e === void 0 ? void 0 : _e.replace('{column}', String(columnDef.header))] }), showFilterModeSubMenu && (jsxRuntime.jsx(IconButton__default["default"], { onClick: handleOpenFilterModeMenu, onMouseEnter: handleOpenFilterModeMenu, size: "small", sx: { p: 0 }, children: jsxRuntime.jsx(ArrowRightIcon, {}) }))] }, 4)),
|
|
1462
1492
|
showFilterModeSubMenu && (jsxRuntime.jsx(MRT_FilterOptionMenu, { anchorEl: filterMenuAnchorEl, header: header, onSelect: handleFilterByColumn, setAnchorEl: setFilterMenuAnchorEl, table: table }, 5)),
|
|
1463
1493
|
].filter(Boolean)
|
|
1464
1494
|
: []),
|
|
1465
1495
|
...(enableGrouping && column.getCanGroup()
|
|
1466
1496
|
? [
|
|
1467
|
-
jsxRuntime.jsx(MenuItem__default["default"], { divider: enableColumnPinning, onClick: handleGroupByColumn, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(DynamicFeedIcon, {}) }), (
|
|
1497
|
+
jsxRuntime.jsx(MenuItem__default["default"], { divider: enableColumnPinning, onClick: handleGroupByColumn, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(DynamicFeedIcon, {}) }), (_f = localization[column.getIsGrouped() ? 'ungroupByColumn' : 'groupByColumn']) === null || _f === void 0 ? void 0 : _f.replace('{column}', String(columnDef.header))] }) }, 6),
|
|
1468
1498
|
]
|
|
1469
1499
|
: []),
|
|
1470
1500
|
...(enableColumnPinning && column.getCanPin()
|
|
@@ -1481,29 +1511,30 @@ const MRT_ColumnActionMenu = ({ anchorEl, header, setAnchorEl, table, }) => {
|
|
|
1481
1511
|
: []),
|
|
1482
1512
|
...(enableHiding
|
|
1483
1513
|
? [
|
|
1484
|
-
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, {}) }), (
|
|
1514
|
+
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, {}) }), (_g = localization.hideColumn) === null || _g === void 0 ? void 0 : _g.replace('{column}', String(columnDef.header))] }) }, 11),
|
|
1485
1515
|
jsxRuntime.jsx(MenuItem__default["default"], { disabled: !Object.values(columnVisibility).filter((visible) => !visible)
|
|
1486
|
-
.length, onClick: handleShowAllColumns, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(ViewColumnIcon, {}) }), (
|
|
1516
|
+
.length, onClick: handleShowAllColumns, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(ViewColumnIcon, {}) }), (_h = localization.showAllColumns) === null || _h === void 0 ? void 0 : _h.replace('{column}', String(columnDef.header))] }) }, 12),
|
|
1487
1517
|
]
|
|
1488
1518
|
: []),
|
|
1489
1519
|
].filter(Boolean);
|
|
1490
|
-
return (jsxRuntime.jsx(Menu__default["default"], { MenuListProps: {
|
|
1520
|
+
return (jsxRuntime.jsx(Menu__default["default"], Object.assign({ MenuListProps: {
|
|
1491
1521
|
dense: density === 'compact',
|
|
1492
|
-
}, anchorEl: anchorEl, onClose: () => setAnchorEl(null), open: !!anchorEl, children: (
|
|
1522
|
+
}, anchorEl: anchorEl, onClose: () => setAnchorEl(null), open: !!anchorEl }, rest, { children: (_l = (_k = (_j = columnDef.renderColumnActionsMenuItems) === null || _j === void 0 ? void 0 : _j.call(columnDef, {
|
|
1493
1523
|
closeMenu: () => setAnchorEl(null),
|
|
1494
1524
|
column,
|
|
1495
1525
|
internalColumnMenuItems,
|
|
1496
1526
|
table,
|
|
1497
|
-
})) !== null &&
|
|
1527
|
+
})) !== null && _k !== void 0 ? _k : renderColumnActionsMenuItems === null || renderColumnActionsMenuItems === void 0 ? void 0 : renderColumnActionsMenuItems({
|
|
1498
1528
|
closeMenu: () => setAnchorEl(null),
|
|
1499
1529
|
column,
|
|
1500
1530
|
internalColumnMenuItems,
|
|
1501
1531
|
table,
|
|
1502
|
-
})) !== null &&
|
|
1532
|
+
})) !== null && _l !== void 0 ? _l : internalColumnMenuItems })));
|
|
1503
1533
|
};
|
|
1504
1534
|
|
|
1505
|
-
const MRT_TableHeadCellColumnActionsButton = (
|
|
1506
|
-
var
|
|
1535
|
+
const MRT_TableHeadCellColumnActionsButton = (_a) => {
|
|
1536
|
+
var _b;
|
|
1537
|
+
var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
|
|
1507
1538
|
const { options: { columnFilterDisplayMode, icons: { MoreVertIcon }, localization, muiColumnActionsButtonProps, }, } = table;
|
|
1508
1539
|
const { column } = header;
|
|
1509
1540
|
const { columnDef } = column;
|
|
@@ -1513,32 +1544,33 @@ const MRT_TableHeadCellColumnActionsButton = ({ header, table, }) => {
|
|
|
1513
1544
|
event.preventDefault();
|
|
1514
1545
|
setAnchorEl(event.currentTarget);
|
|
1515
1546
|
};
|
|
1516
|
-
const iconButtonProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiColumnActionsButtonProps, {
|
|
1547
|
+
const iconButtonProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiColumnActionsButtonProps, {
|
|
1517
1548
|
column,
|
|
1518
1549
|
table,
|
|
1519
1550
|
})), parseFromValuesOrFunc(columnDef.muiColumnActionsButtonProps, {
|
|
1520
1551
|
column,
|
|
1521
1552
|
table,
|
|
1522
|
-
}));
|
|
1523
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (
|
|
1553
|
+
})), rest);
|
|
1554
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, placement: "top", title: (_b = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _b !== void 0 ? _b : localization.columnActions, children: jsxRuntime.jsx(IconButton__default["default"], Object.assign({ "aria-label": localization.columnActions, onClick: handleClick, size: "small" }, iconButtonProps, { sx: (theme) => (Object.assign({ '&:hover': {
|
|
1524
1555
|
opacity: 1,
|
|
1525
|
-
}, height: '2rem', m: '-4px', opacity: 0.3, transform: `scale(0.
|
|
1556
|
+
}, height: '2rem', m: '-4px', opacity: 0.3, transform: `scale(0.8) ${columnFilterDisplayMode !== 'popover' ? 'translateX(-4px)' : ''}`, transition: 'opacity 150ms', width: '2rem' }, parseFromValuesOrFunc(iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx, theme))), title: undefined, children: jsxRuntime.jsx(MoreVertIcon, {}) })) }), anchorEl && (jsxRuntime.jsx(MRT_ColumnActionMenu, { anchorEl: anchorEl, header: header, setAnchorEl: setAnchorEl, table: table }))] }));
|
|
1526
1557
|
};
|
|
1527
1558
|
|
|
1528
|
-
const MRT_FilterCheckbox = (
|
|
1529
|
-
var
|
|
1559
|
+
const MRT_FilterCheckbox = (_a) => {
|
|
1560
|
+
var _b, _c, _d;
|
|
1561
|
+
var { column, table } = _a, rest = __rest(_a, ["column", "table"]);
|
|
1530
1562
|
const { getState, options: { localization, muiFilterCheckboxProps }, } = table;
|
|
1531
1563
|
const { density } = getState();
|
|
1532
1564
|
const { columnDef } = column;
|
|
1533
|
-
const checkboxProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterCheckboxProps, {
|
|
1565
|
+
const checkboxProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterCheckboxProps, {
|
|
1534
1566
|
column,
|
|
1535
1567
|
table,
|
|
1536
1568
|
})), parseFromValuesOrFunc(columnDef.muiFilterCheckboxProps, {
|
|
1537
1569
|
column,
|
|
1538
1570
|
table,
|
|
1539
|
-
}));
|
|
1540
|
-
const filterLabel = (
|
|
1541
|
-
return (jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: (
|
|
1571
|
+
})), rest);
|
|
1572
|
+
const filterLabel = (_b = localization.filterByColumn) === null || _b === void 0 ? void 0 : _b.replace('{column}', columnDef.header);
|
|
1573
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: (_c = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.title) !== null && _c !== void 0 ? _c : filterLabel, children: jsxRuntime.jsx(FormControlLabel__default["default"], { control: jsxRuntime.jsx(Checkbox__default["default"], Object.assign({ checked: column.getFilterValue() === 'true', color: column.getFilterValue() === undefined ? 'default' : 'primary', indeterminate: column.getFilterValue() === undefined, size: density === 'compact' ? 'small' : 'medium' }, checkboxProps, { onChange: (e, checked) => {
|
|
1542
1574
|
var _a;
|
|
1543
1575
|
column.setFilterValue(column.getFilterValue() === undefined
|
|
1544
1576
|
? 'true'
|
|
@@ -1550,19 +1582,20 @@ const MRT_FilterCheckbox = ({ column, table, }) => {
|
|
|
1550
1582
|
var _a;
|
|
1551
1583
|
e.stopPropagation();
|
|
1552
1584
|
(_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.onClick) === null || _a === void 0 ? void 0 : _a.call(checkboxProps, e);
|
|
1553
|
-
}, sx: (theme) => (Object.assign({ height: '2.5rem', width: '2.5rem' }, parseFromValuesOrFunc(checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx, theme))) })), disableTypography: true, label: (
|
|
1585
|
+
}, sx: (theme) => (Object.assign({ height: '2.5rem', width: '2.5rem' }, parseFromValuesOrFunc(checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx, theme))) })), disableTypography: true, label: (_d = checkboxProps.title) !== null && _d !== void 0 ? _d : filterLabel, sx: { color: 'text.secondary', fontWeight: 'normal', mt: '-4px' }, title: undefined }) }));
|
|
1554
1586
|
};
|
|
1555
1587
|
|
|
1556
|
-
const MRT_FilterTextField = (
|
|
1557
|
-
var
|
|
1588
|
+
const MRT_FilterTextField = (_a) => {
|
|
1589
|
+
var _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
1590
|
+
var { header, rangeFilterIndex, table } = _a, rest = __rest(_a, ["header", "rangeFilterIndex", "table"]);
|
|
1558
1591
|
const { options: { columnFilterModeOptions, enableColumnFilterModes, icons: { CloseIcon, FilterListIcon }, localization, manualFiltering, muiFilterAutocompleteProps, muiFilterDatePickerProps, muiFilterTextFieldProps, }, refs: { filterInputRefs }, setColumnFilterFns, } = table;
|
|
1559
1592
|
const { column } = header;
|
|
1560
1593
|
const { columnDef } = column;
|
|
1561
1594
|
const { filterVariant } = columnDef;
|
|
1562
|
-
const textFieldProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterTextFieldProps, { column, table })), parseFromValuesOrFunc(columnDef.muiFilterTextFieldProps, {
|
|
1595
|
+
const textFieldProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterTextFieldProps, { column, table })), parseFromValuesOrFunc(columnDef.muiFilterTextFieldProps, {
|
|
1563
1596
|
column,
|
|
1564
1597
|
table,
|
|
1565
|
-
}));
|
|
1598
|
+
})), rest);
|
|
1566
1599
|
const autocompleteProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterAutocompleteProps, { column, table })), parseFromValuesOrFunc(columnDef.muiFilterAutocompleteProps, {
|
|
1567
1600
|
column,
|
|
1568
1601
|
table,
|
|
@@ -1581,17 +1614,17 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1581
1614
|
const currentFilterOption = columnDef._filterFn;
|
|
1582
1615
|
const filterChipLabel = ['empty', 'notEmpty'].includes(currentFilterOption)
|
|
1583
1616
|
? //@ts-ignore
|
|
1584
|
-
localization[`filter${((
|
|
1617
|
+
localization[`filter${((_c = (_b = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt) === null || _b === void 0 ? void 0 : _b.call(currentFilterOption, 0)) === null || _c === void 0 ? void 0 : _c.toUpperCase()) +
|
|
1585
1618
|
(currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.slice(1))}`]
|
|
1586
1619
|
: '';
|
|
1587
1620
|
const filterPlaceholder = !isRangeFilter
|
|
1588
|
-
? (
|
|
1621
|
+
? (_d = textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.placeholder) !== null && _d !== void 0 ? _d : (_f = localization.filterByColumn) === null || _f === void 0 ? void 0 : _f.replace('{column}', String(columnDef.header))
|
|
1589
1622
|
: rangeFilterIndex === 0
|
|
1590
1623
|
? localization.min
|
|
1591
1624
|
: rangeFilterIndex === 1
|
|
1592
1625
|
? localization.max
|
|
1593
1626
|
: '';
|
|
1594
|
-
const allowedColumnFilterOptions = (
|
|
1627
|
+
const allowedColumnFilterOptions = (_g = columnDef === null || columnDef === void 0 ? void 0 : columnDef.columnFilterModeOptions) !== null && _g !== void 0 ? _g : columnFilterModeOptions;
|
|
1595
1628
|
const showChangeModeButton = enableColumnFilterModes &&
|
|
1596
1629
|
columnDef.enableColumnFilterModes !== false &&
|
|
1597
1630
|
!rangeFilterIndex &&
|
|
@@ -1679,7 +1712,7 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1679
1712
|
isMounted.current = true;
|
|
1680
1713
|
}, [column.getFilterValue()]);
|
|
1681
1714
|
if (columnDef.Filter) {
|
|
1682
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: (
|
|
1715
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: (_h = columnDef.Filter) === null || _h === void 0 ? void 0 : _h.call(columnDef, { column, header, rangeFilterIndex, table }) }));
|
|
1683
1716
|
}
|
|
1684
1717
|
const dropdownOptions = react.useMemo(() => {
|
|
1685
1718
|
var _a;
|
|
@@ -1695,7 +1728,7 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1695
1728
|
isMultiSelectFilter,
|
|
1696
1729
|
isSelectFilter,
|
|
1697
1730
|
]);
|
|
1698
|
-
const endAdornment = !isAutocompleteFilter && !isDateFilter && !filterChipLabel ? (jsxRuntime.jsx(InputAdornment__default["default"], { position: "end", sx: { mr: isSelectFilter || isMultiSelectFilter ? '20px' : undefined }, children: jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, placement: "right", title: (
|
|
1731
|
+
const endAdornment = !isAutocompleteFilter && !isDateFilter && !filterChipLabel ? (jsxRuntime.jsx(InputAdornment__default["default"], { position: "end", sx: { mr: isSelectFilter || isMultiSelectFilter ? '20px' : undefined }, children: jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, placement: "right", title: (_j = localization.clearFilter) !== null && _j !== void 0 ? _j : '', children: jsxRuntime.jsx("span", { children: jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.clearFilter, disabled: !((_k = filterValue === null || filterValue === void 0 ? void 0 : filterValue.toString()) === null || _k === void 0 ? void 0 : _k.length), onClick: handleClear, size: "small", sx: {
|
|
1699
1732
|
height: '2rem',
|
|
1700
1733
|
transform: 'scale(0.9)',
|
|
1701
1734
|
width: '2rem',
|
|
@@ -1711,7 +1744,7 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1711
1744
|
? { endAdornment, startAdornment }
|
|
1712
1745
|
: { startAdornment }, fullWidth: true, helperText: showChangeModeButton ? (jsxRuntime.jsx("label", { children: localization.filterMode.replace('{filterType}',
|
|
1713
1746
|
// @ts-ignore
|
|
1714
|
-
localization[`filter${((
|
|
1747
|
+
localization[`filter${((_l = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt(0)) === null || _l === void 0 ? void 0 : _l.toUpperCase()) +
|
|
1715
1748
|
(currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.slice(1))}`]) })) : null, inputProps: {
|
|
1716
1749
|
autoComplete: 'new-password',
|
|
1717
1750
|
disabled: !!filterChipLabel,
|
|
@@ -1740,8 +1773,8 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1740
1773
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [isDateFilter ? (jsxRuntime.jsx(DatePicker.DatePicker, Object.assign({ onChange: (newDate) => {
|
|
1741
1774
|
handleChange(newDate);
|
|
1742
1775
|
}, value: filterValue || null }, datePickerProps, { slotProps: {
|
|
1743
|
-
field: Object.assign({ clearable: true, onClear: () => handleClear() }, (
|
|
1744
|
-
textField: Object.assign(Object.assign({}, commonTextFieldProps), (
|
|
1776
|
+
field: Object.assign({ clearable: true, onClear: () => handleClear() }, (_m = datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.slotProps) === null || _m === void 0 ? void 0 : _m.field),
|
|
1777
|
+
textField: Object.assign(Object.assign({}, commonTextFieldProps), (_o = datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.slotProps) === null || _o === void 0 ? void 0 : _o.textField),
|
|
1745
1778
|
} }))) : isAutocompleteFilter ? (jsxRuntime.jsx(Autocomplete__default["default"], Object.assign({ freeSolo: true, getOptionLabel: (option) => option, onChange: (_e, newValue) => handleChange(newValue), options: dropdownOptions !== null && dropdownOptions !== void 0 ? dropdownOptions : [] }, autocompleteProps, { renderInput: (builtinTextFieldProps) => {
|
|
1746
1779
|
var _a;
|
|
1747
1780
|
return (jsxRuntime.jsx(TextField__default["default"], Object.assign({}, builtinTextFieldProps, commonTextFieldProps, { InputProps: Object.assign(Object.assign({}, builtinTextFieldProps.InputProps), { startAdornment: (_a = commonTextFieldProps === null || commonTextFieldProps === void 0 ? void 0 : commonTextFieldProps.InputProps) === null || _a === void 0 ? void 0 : _a.startAdornment }), inputProps: Object.assign(Object.assign({}, builtinTextFieldProps.inputProps), commonTextFieldProps === null || commonTextFieldProps === void 0 ? void 0 : commonTextFieldProps.inputProps), onChange: handleTextFieldChange })));
|
|
@@ -1761,7 +1794,7 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1761
1794
|
}, onChange: handleTextFieldChange, select: isSelectFilter || isMultiSelectFilter }, commonTextFieldProps, { value: filterValue !== null && filterValue !== void 0 ? filterValue : '', children: (isSelectFilter || isMultiSelectFilter) && [
|
|
1762
1795
|
jsxRuntime.jsx(MenuItem__default["default"], { disabled: true, divider: true, hidden: true, value: "", children: jsxRuntime.jsx(Box__default["default"], { sx: { opacity: 0.5 }, children: filterPlaceholder }) }, "p"),
|
|
1763
1796
|
...[
|
|
1764
|
-
(
|
|
1797
|
+
(_p = textFieldProps.children) !== null && _p !== void 0 ? _p : dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map((option, index) => {
|
|
1765
1798
|
var _a;
|
|
1766
1799
|
if (!option)
|
|
1767
1800
|
return '';
|
|
@@ -1787,21 +1820,23 @@ const MRT_FilterTextField = ({ header, rangeFilterIndex, table, }) => {
|
|
|
1787
1820
|
] }))), jsxRuntime.jsx(MRT_FilterOptionMenu, { anchorEl: anchorEl, header: header, setAnchorEl: setAnchorEl, setFilterValue: setFilterValue, table: table })] }));
|
|
1788
1821
|
};
|
|
1789
1822
|
|
|
1790
|
-
const MRT_FilterRangeFields = (
|
|
1791
|
-
|
|
1823
|
+
const MRT_FilterRangeFields = (_a) => {
|
|
1824
|
+
var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
|
|
1825
|
+
return (jsxRuntime.jsxs(Box__default["default"], Object.assign({}, rest, { sx: (theme) => (Object.assign({ display: 'grid', gap: '1rem', gridTemplateColumns: '1fr 1fr' }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: [jsxRuntime.jsx(MRT_FilterTextField, { header: header, rangeFilterIndex: 0, table: table }), jsxRuntime.jsx(MRT_FilterTextField, { header: header, rangeFilterIndex: 1, table: table })] })));
|
|
1792
1826
|
};
|
|
1793
1827
|
|
|
1794
|
-
const MRT_FilterRangeSlider = (
|
|
1795
|
-
var
|
|
1828
|
+
const MRT_FilterRangeSlider = (_a) => {
|
|
1829
|
+
var _b, _c;
|
|
1830
|
+
var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
|
|
1796
1831
|
const { options: { enableColumnFilterModes, localization, muiFilterSliderProps }, refs: { filterInputRefs }, } = table;
|
|
1797
1832
|
const { column } = header;
|
|
1798
1833
|
const { columnDef } = column;
|
|
1799
1834
|
const currentFilterOption = columnDef._filterFn;
|
|
1800
1835
|
const showChangeModeButton = enableColumnFilterModes && columnDef.enableColumnFilterModes !== false;
|
|
1801
|
-
const sliderProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterSliderProps, { column, table })), parseFromValuesOrFunc(columnDef.muiFilterSliderProps, { column, table }));
|
|
1836
|
+
const sliderProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiFilterSliderProps, { column, table })), parseFromValuesOrFunc(columnDef.muiFilterSliderProps, { column, table })), rest);
|
|
1802
1837
|
let [min, max] = sliderProps.min !== undefined && sliderProps.max !== undefined
|
|
1803
1838
|
? [sliderProps.min, sliderProps.max]
|
|
1804
|
-
: (
|
|
1839
|
+
: (_b = column.getFacetedMinMaxValues()) !== null && _b !== void 0 ? _b : [0, 1];
|
|
1805
1840
|
//fix potential TanStack Table bugs where min or max is an array
|
|
1806
1841
|
if (Array.isArray(min))
|
|
1807
1842
|
min = min[0];
|
|
@@ -1858,22 +1893,24 @@ const MRT_FilterRangeSlider = ({ header, table, }) => {
|
|
|
1858
1893
|
whiteSpace: 'nowrap',
|
|
1859
1894
|
}, children: localization.filterMode.replace('{filterType}',
|
|
1860
1895
|
// @ts-ignore
|
|
1861
|
-
localization[`filter${((
|
|
1896
|
+
localization[`filter${((_c = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt(0)) === null || _c === void 0 ? void 0 : _c.toUpperCase()) +
|
|
1862
1897
|
(currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.slice(1))}`]) })) : null] }));
|
|
1863
1898
|
};
|
|
1864
1899
|
|
|
1865
|
-
const MRT_TableHeadCellFilterContainer = (
|
|
1866
|
-
var
|
|
1900
|
+
const MRT_TableHeadCellFilterContainer = (_a) => {
|
|
1901
|
+
var _b;
|
|
1902
|
+
var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
|
|
1867
1903
|
const { getState, options: { columnFilterDisplayMode }, } = table;
|
|
1868
1904
|
const { showColumnFilters } = getState();
|
|
1869
1905
|
const { column } = header;
|
|
1870
1906
|
const { columnDef } = column;
|
|
1871
|
-
return (jsxRuntime.jsx(Collapse__default["default"], { in: showColumnFilters || columnFilterDisplayMode === 'popover', 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 })) : ((
|
|
1872
|
-
['between', 'betweenInclusive', 'inNumberRange'].includes(columnDef._filterFn) ? (jsxRuntime.jsx(MRT_FilterRangeFields, { header: header, table: table })) : (jsxRuntime.jsx(MRT_FilterTextField, { header: header, table: table })) }));
|
|
1907
|
+
return (jsxRuntime.jsx(Collapse__default["default"], Object.assign({ in: showColumnFilters || columnFilterDisplayMode === 'popover', mountOnEnter: true, unmountOnExit: true }, rest, { children: columnDef.filterVariant === 'checkbox' ? (jsxRuntime.jsx(MRT_FilterCheckbox, { column: column, table: table })) : columnDef.filterVariant === 'range-slider' ? (jsxRuntime.jsx(MRT_FilterRangeSlider, { header: header, table: table })) : ((_b = columnDef.filterVariant) === null || _b === void 0 ? void 0 : _b.includes('range')) ||
|
|
1908
|
+
['between', 'betweenInclusive', 'inNumberRange'].includes(columnDef._filterFn) ? (jsxRuntime.jsx(MRT_FilterRangeFields, { header: header, table: table })) : (jsxRuntime.jsx(MRT_FilterTextField, { header: header, table: table })) })));
|
|
1873
1909
|
};
|
|
1874
1910
|
|
|
1875
|
-
const MRT_TableHeadCellFilterLabel = (
|
|
1876
|
-
var
|
|
1911
|
+
const MRT_TableHeadCellFilterLabel = (_a) => {
|
|
1912
|
+
var _b, _c, _d;
|
|
1913
|
+
var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
|
|
1877
1914
|
const { options: { columnFilterDisplayMode, icons: { FilterAltIcon }, localization, }, refs: { filterInputRefs }, setShowColumnFilters, } = table;
|
|
1878
1915
|
const { column } = header;
|
|
1879
1916
|
const { columnDef } = column;
|
|
@@ -1881,16 +1918,16 @@ const MRT_TableHeadCellFilterLabel = ({ header, table, }) => {
|
|
|
1881
1918
|
const [anchorEl, setAnchorEl] = react.useState(null);
|
|
1882
1919
|
const isFilterActive = (Array.isArray(filterValue) && filterValue.some(Boolean)) ||
|
|
1883
1920
|
(!!filterValue && !Array.isArray(filterValue));
|
|
1884
|
-
const isRangeFilter = ((
|
|
1921
|
+
const isRangeFilter = ((_b = columnDef.filterVariant) === null || _b === void 0 ? void 0 : _b.includes('range')) ||
|
|
1885
1922
|
['between', 'betweenInclusive', 'inNumberRange'].includes(columnDef._filterFn);
|
|
1886
1923
|
const currentFilterOption = columnDef._filterFn;
|
|
1887
1924
|
const filterTooltip = columnFilterDisplayMode === 'popover' && !isFilterActive
|
|
1888
|
-
? (
|
|
1925
|
+
? (_c = localization.filterByColumn) === null || _c === void 0 ? void 0 : _c.replace('{column}', String(columnDef.header))
|
|
1889
1926
|
: localization.filteringByColumn
|
|
1890
1927
|
.replace('{column}', String(columnDef.header))
|
|
1891
1928
|
.replace('{filterType}', currentFilterOption
|
|
1892
1929
|
? // @ts-ignore
|
|
1893
|
-
localization[`filter${((
|
|
1930
|
+
localization[`filter${((_d = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt(0)) === null || _d === void 0 ? void 0 : _d.toUpperCase()) +
|
|
1894
1931
|
(currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.slice(1))}`]
|
|
1895
1932
|
: '')
|
|
1896
1933
|
.replace('{filterValue}', `"${Array.isArray(filterValue)
|
|
@@ -1900,7 +1937,7 @@ const MRT_TableHeadCellFilterLabel = ({ header, table, }) => {
|
|
|
1900
1937
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Grow__default["default"], { in: columnFilterDisplayMode === 'popover' ||
|
|
1901
1938
|
(!!filterValue && !isRangeFilter) ||
|
|
1902
1939
|
(isRangeFilter && // @ts-ignore
|
|
1903
|
-
(!!(filterValue === null || filterValue === void 0 ? void 0 : filterValue[0]) || !!(filterValue === null || filterValue === void 0 ? void 0 : filterValue[1]))), unmountOnExit: true, 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) => {
|
|
1940
|
+
(!!(filterValue === null || filterValue === void 0 ? void 0 : filterValue[0]) || !!(filterValue === null || filterValue === void 0 ? void 0 : filterValue[1]))), unmountOnExit: true, 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"], Object.assign({ disableRipple: true, onClick: (event) => {
|
|
1904
1941
|
if (columnFilterDisplayMode === 'popover') {
|
|
1905
1942
|
setAnchorEl(event.currentTarget);
|
|
1906
1943
|
}
|
|
@@ -1913,15 +1950,7 @@ const MRT_TableHeadCellFilterLabel = ({ header, table, }) => {
|
|
|
1913
1950
|
(_b = filterInputRefs.current[`${column.id}-0`]) === null || _b === void 0 ? void 0 : _b.select();
|
|
1914
1951
|
});
|
|
1915
1952
|
event.stopPropagation();
|
|
1916
|
-
}, size: "small", sx: {
|
|
1917
|
-
height: '16px',
|
|
1918
|
-
ml: '4px',
|
|
1919
|
-
opacity: isFilterActive ? 1 : 0.3,
|
|
1920
|
-
p: '8px',
|
|
1921
|
-
transform: 'scale(0.75)',
|
|
1922
|
-
transition: 'all 150ms ease-in-out',
|
|
1923
|
-
width: '16px',
|
|
1924
|
-
}, children: jsxRuntime.jsx(FilterAltIcon, {}) }) }) }) }), jsxRuntime.jsx(Popover__default["default"], { anchorEl: anchorEl, anchorOrigin: {
|
|
1953
|
+
}, size: "small" }, rest, { sx: (theme) => (Object.assign({ height: '16px', ml: '4px', opacity: isFilterActive ? 1 : 0.3, p: '8px', transform: 'scale(0.75)', transition: 'all 150ms ease-in-out', width: '16px' }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: jsxRuntime.jsx(FilterAltIcon, {}) })) }) }) }), jsxRuntime.jsx(Popover__default["default"], { anchorEl: anchorEl, anchorOrigin: {
|
|
1925
1954
|
horizontal: 'center',
|
|
1926
1955
|
vertical: 'top',
|
|
1927
1956
|
}, onClick: (event) => event.stopPropagation(), onClose: (event) => {
|
|
@@ -1934,14 +1963,15 @@ const MRT_TableHeadCellFilterLabel = ({ header, table, }) => {
|
|
|
1934
1963
|
}, children: jsxRuntime.jsx(Box__default["default"], { sx: { p: '1rem' }, children: jsxRuntime.jsx(MRT_TableHeadCellFilterContainer, { header: header, table: table }) }) })] }));
|
|
1935
1964
|
};
|
|
1936
1965
|
|
|
1937
|
-
const MRT_TableHeadCellGrabHandle = (
|
|
1966
|
+
const MRT_TableHeadCellGrabHandle = (_a) => {
|
|
1967
|
+
var { column, table, tableHeadCellRef } = _a, rest = __rest(_a, ["column", "table", "tableHeadCellRef"]);
|
|
1938
1968
|
const { getState, options: { enableColumnOrdering, muiColumnDragHandleProps }, setColumnOrder, setDraggingColumn, setHoveredColumn, } = table;
|
|
1939
1969
|
const { columnDef } = column;
|
|
1940
1970
|
const { columnOrder, draggingColumn, hoveredColumn } = getState();
|
|
1941
|
-
const iconButtonProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiColumnDragHandleProps, { column, table })), parseFromValuesOrFunc(columnDef.muiColumnDragHandleProps, {
|
|
1971
|
+
const iconButtonProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiColumnDragHandleProps, { column, table })), parseFromValuesOrFunc(columnDef.muiColumnDragHandleProps, {
|
|
1942
1972
|
column,
|
|
1943
1973
|
table,
|
|
1944
|
-
}));
|
|
1974
|
+
})), rest);
|
|
1945
1975
|
const handleDragStart = (event) => {
|
|
1946
1976
|
var _a;
|
|
1947
1977
|
(_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.onDragStart) === null || _a === void 0 ? void 0 : _a.call(iconButtonProps, event);
|
|
@@ -1965,8 +1995,9 @@ const MRT_TableHeadCellGrabHandle = ({ column, table, tableHeadCellRef, }) => {
|
|
|
1965
1995
|
return (jsxRuntime.jsx(MRT_GrabHandleButton, { iconButtonProps: iconButtonProps, onDragEnd: handleDragEnd, onDragStart: handleDragStart, table: table }));
|
|
1966
1996
|
};
|
|
1967
1997
|
|
|
1968
|
-
const MRT_TableHeadCellResizeHandle = (
|
|
1969
|
-
var
|
|
1998
|
+
const MRT_TableHeadCellResizeHandle = (_a) => {
|
|
1999
|
+
var _b;
|
|
2000
|
+
var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
|
|
1970
2001
|
const { getState, options: { columnResizeMode }, setColumnSizingInfo, } = table;
|
|
1971
2002
|
const { density } = getState();
|
|
1972
2003
|
const { column } = header;
|
|
@@ -1975,7 +2006,7 @@ const MRT_TableHeadCellResizeHandle = ({ header, table, }) => {
|
|
|
1975
2006
|
column.resetSize();
|
|
1976
2007
|
}, onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), style: {
|
|
1977
2008
|
transform: column.getIsResizing() && columnResizeMode === 'onEnd'
|
|
1978
|
-
? `translateX(${(
|
|
2009
|
+
? `translateX(${(_b = getState().columnSizingInfo.deltaOffset) !== null && _b !== void 0 ? _b : 0}px)`
|
|
1979
2010
|
: undefined,
|
|
1980
2011
|
}, sx: (theme) => ({
|
|
1981
2012
|
'&:active > hr': {
|
|
@@ -1991,58 +2022,53 @@ const MRT_TableHeadCellResizeHandle = ({ header, table, }) => {
|
|
|
1991
2022
|
position: 'absolute',
|
|
1992
2023
|
px: '4px',
|
|
1993
2024
|
right: '0',
|
|
1994
|
-
}), children: jsxRuntime.jsx(Divider__default["default"], { className: "Mui-TableHeadCell-ResizeHandle-Divider", flexItem: true, orientation: "vertical", sx: {
|
|
1995
|
-
borderRadius: '2px',
|
|
1996
|
-
borderWidth: '2px',
|
|
1997
|
-
height: '24px',
|
|
1998
|
-
touchAction: 'none',
|
|
1999
|
-
transition: column.getIsResizing()
|
|
2025
|
+
}), children: jsxRuntime.jsx(Divider__default["default"], { className: "Mui-TableHeadCell-ResizeHandle-Divider", flexItem: true, orientation: "vertical", sx: (theme) => (Object.assign({ borderRadius: '2px', borderWidth: '2px', height: '24px', touchAction: 'none', transition: column.getIsResizing()
|
|
2000
2026
|
? undefined
|
|
2001
|
-
: 'all 150ms ease-in-out',
|
|
2002
|
-
userSelect: 'none',
|
|
2003
|
-
zIndex: 4,
|
|
2004
|
-
} }) }));
|
|
2027
|
+
: 'all 150ms ease-in-out', userSelect: 'none', zIndex: 4 }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))) }) }));
|
|
2005
2028
|
};
|
|
2006
2029
|
|
|
2007
|
-
const MRT_TableHeadCellSortLabel = (
|
|
2030
|
+
const MRT_TableHeadCellSortLabel = (_a) => {
|
|
2031
|
+
var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
|
|
2008
2032
|
const { getState, options: { icons: { ArrowDownwardIcon, SyncAltIcon }, localization, }, } = table;
|
|
2009
2033
|
const { column } = header;
|
|
2010
2034
|
const { columnDef } = column;
|
|
2011
|
-
const { sorting } = getState();
|
|
2035
|
+
const { isLoading, showSkeletons, sorting } = getState();
|
|
2012
2036
|
const isSorted = !!column.getIsSorted();
|
|
2013
|
-
const sortTooltip =
|
|
2014
|
-
?
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
:
|
|
2020
|
-
|
|
2037
|
+
const sortTooltip = isLoading || showSkeletons
|
|
2038
|
+
? ''
|
|
2039
|
+
: column.getIsSorted()
|
|
2040
|
+
? column.getIsSorted() === 'desc'
|
|
2041
|
+
? localization.sortedByColumnDesc.replace('{column}', columnDef.header)
|
|
2042
|
+
: localization.sortedByColumnAsc.replace('{column}', columnDef.header)
|
|
2043
|
+
: column.getNextSortingOrder() === 'desc'
|
|
2044
|
+
? localization.sortByColumnDesc.replace('{column}', columnDef.header)
|
|
2045
|
+
: localization.sortByColumnAsc.replace('{column}', columnDef.header);
|
|
2046
|
+
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"], Object.assign({ IconComponent: !isSorted
|
|
2021
2047
|
? (props) => (jsxRuntime.jsx(SyncAltIcon, Object.assign({}, props, { style: { transform: 'rotate(-90deg) scaleX(0.8)' } })))
|
|
2022
2048
|
: ArrowDownwardIcon, active: true, "aria-label": sortTooltip, direction: isSorted ? column.getIsSorted() : undefined, onClick: (e) => {
|
|
2023
2049
|
var _a;
|
|
2024
2050
|
e.stopPropagation();
|
|
2025
2051
|
(_a = header.column.getToggleSortingHandler()) === null || _a === void 0 ? void 0 : _a(e);
|
|
2026
|
-
}, sx: {
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
width: '3ch',
|
|
2031
|
-
} }) }) }));
|
|
2052
|
+
} }, rest, { sx: (theme) => (Object.assign({ '.MuiTableSortLabel-icon': {
|
|
2053
|
+
color: `${theme.palette.mode === 'dark'
|
|
2054
|
+
? theme.palette.text.primary
|
|
2055
|
+
: theme.palette.text.secondary} !important`,
|
|
2056
|
+
}, flex: '0 0', opacity: isSorted ? 1 : 0.3, transition: 'all 150ms ease-in-out', width: '3ch' }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))) })) }) }));
|
|
2032
2057
|
};
|
|
2033
2058
|
|
|
2034
|
-
const MRT_TableHeadCell = (
|
|
2035
|
-
var
|
|
2059
|
+
const MRT_TableHeadCell = (_a) => {
|
|
2060
|
+
var _b, _c, _d, _f, _g, _h;
|
|
2061
|
+
var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
|
|
2036
2062
|
const theme = styles.useTheme();
|
|
2037
2063
|
const { getState, options: { columnFilterDisplayMode, enableColumnActions, enableColumnDragging, enableColumnOrdering, enableGrouping, enableMultiSort, layoutMode, muiTableHeadCellProps, }, refs: { tableHeadCellRefs }, setHoveredColumn, } = table;
|
|
2038
2064
|
const { columnSizingInfo, density, draggingColumn, grouping, hoveredColumn, showColumnFilters, } = getState();
|
|
2039
2065
|
const { column } = header;
|
|
2040
2066
|
const { columnDef } = column;
|
|
2041
2067
|
const { columnDefType } = columnDef;
|
|
2042
|
-
const tableCellProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableHeadCellProps, { column, table })), parseFromValuesOrFunc(columnDef.muiTableHeadCellProps, {
|
|
2068
|
+
const tableCellProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableHeadCellProps, { column, table })), parseFromValuesOrFunc(columnDef.muiTableHeadCellProps, {
|
|
2043
2069
|
column,
|
|
2044
2070
|
table,
|
|
2045
|
-
}));
|
|
2071
|
+
})), rest);
|
|
2046
2072
|
const showColumnActions = (enableColumnActions || columnDef.enableColumnActions) &&
|
|
2047
2073
|
columnDef.enableColumnActions !== false;
|
|
2048
2074
|
const showDragHandle = enableColumnDragging !== false &&
|
|
@@ -2091,11 +2117,11 @@ const MRT_TableHeadCell = ({ header, table, }) => {
|
|
|
2091
2117
|
setHoveredColumn(columnDef.enableColumnOrdering !== false ? column : null);
|
|
2092
2118
|
}
|
|
2093
2119
|
};
|
|
2094
|
-
const headerElement = (
|
|
2120
|
+
const headerElement = (_b = parseFromValuesOrFunc(columnDef.Header, {
|
|
2095
2121
|
column,
|
|
2096
2122
|
header,
|
|
2097
2123
|
table,
|
|
2098
|
-
})) !== null &&
|
|
2124
|
+
})) !== null && _b !== void 0 ? _b : columnDef.header;
|
|
2099
2125
|
return (jsxRuntime.jsxs(TableCell__default["default"], Object.assign({ align: columnDefType === 'group' ? 'center' : 'left', colSpan: header.colSpan, onDragEnter: handleDragEnter, ref: (node) => {
|
|
2100
2126
|
if (node) {
|
|
2101
2127
|
tableHeadCellRefs.current[column.id] = node;
|
|
@@ -2130,47 +2156,53 @@ const MRT_TableHeadCell = ({ header, table, }) => {
|
|
|
2130
2156
|
table,
|
|
2131
2157
|
tableCellProps,
|
|
2132
2158
|
theme,
|
|
2133
|
-
})), draggingBorders)), children: [header.isPlaceholder
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
? '
|
|
2139
|
-
:
|
|
2140
|
-
? '
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
:
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
?
|
|
2154
|
-
: undefined,
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2159
|
+
})), draggingBorders)), children: [header.isPlaceholder
|
|
2160
|
+
? null
|
|
2161
|
+
: (_c = tableCellProps.children) !== null && _c !== void 0 ? _c : (jsxRuntime.jsxs(Box__default["default"], { className: "Mui-TableHeadCell-Content", sx: {
|
|
2162
|
+
alignItems: 'center',
|
|
2163
|
+
display: 'flex',
|
|
2164
|
+
flexDirection: (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'right' ? 'row-reverse' : 'row',
|
|
2165
|
+
justifyContent: columnDefType === 'group' ||
|
|
2166
|
+
(tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'center'
|
|
2167
|
+
? 'center'
|
|
2168
|
+
: column.getCanResize()
|
|
2169
|
+
? 'space-between'
|
|
2170
|
+
: 'flex-start',
|
|
2171
|
+
position: 'relative',
|
|
2172
|
+
width: '100%',
|
|
2173
|
+
}, children: [jsxRuntime.jsxs(Box__default["default"], { className: "Mui-TableHeadCell-Content-Labels", onClick: column.getToggleSortingHandler(), sx: {
|
|
2174
|
+
alignItems: 'center',
|
|
2175
|
+
cursor: column.getCanSort() && columnDefType !== 'group'
|
|
2176
|
+
? 'pointer'
|
|
2177
|
+
: undefined,
|
|
2178
|
+
display: 'flex',
|
|
2179
|
+
flexDirection: (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'right' ? 'row-reverse' : 'row',
|
|
2180
|
+
overflow: columnDefType === 'data' ? 'hidden' : undefined,
|
|
2181
|
+
pl: (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'center'
|
|
2182
|
+
? `${headerPL}rem`
|
|
2183
|
+
: undefined,
|
|
2184
|
+
}, children: [jsxRuntime.jsx(Box__default["default"], { className: "Mui-TableHeadCell-Content-Wrapper", sx: {
|
|
2185
|
+
'&:hover': {
|
|
2186
|
+
textOverflow: 'clip',
|
|
2187
|
+
},
|
|
2188
|
+
minWidth: `${Math.min((_f = (_d = columnDef.header) === null || _d === void 0 ? void 0 : _d.length) !== null && _f !== void 0 ? _f : 0, 4)}ch`,
|
|
2189
|
+
overflow: columnDefType === 'data' ? 'hidden' : undefined,
|
|
2190
|
+
textOverflow: 'ellipsis',
|
|
2191
|
+
whiteSpace: ((_h = (_g = columnDef.header) === null || _g === void 0 ? void 0 : _g.length) !== null && _h !== void 0 ? _h : 0) < 20
|
|
2192
|
+
? 'nowrap'
|
|
2193
|
+
: 'normal',
|
|
2194
|
+
}, title: columnDefType === 'data' ? columnDef.header : undefined, children: headerElement }), column.getCanFilter() && (jsxRuntime.jsx(MRT_TableHeadCellFilterLabel, { header: header, table: table })), column.getCanSort() && (jsxRuntime.jsx(MRT_TableHeadCellSortLabel, { header: header, table: table, tableCellProps: tableCellProps }))] }), 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: {
|
|
2195
|
+
current: tableHeadCellRefs.current[column.id],
|
|
2196
|
+
} })), showColumnActions && (jsxRuntime.jsx(MRT_TableHeadCellColumnActionsButton, { header: header, table: table }))] })), column.getCanResize() && (jsxRuntime.jsx(MRT_TableHeadCellResizeHandle, { header: header, table: table }))] })), columnFilterDisplayMode === 'subheader' && column.getCanFilter() && (jsxRuntime.jsx(MRT_TableHeadCellFilterContainer, { header: header, table: table }))] })));
|
|
2197
|
+
};
|
|
2198
|
+
|
|
2199
|
+
const MRT_TableHeadRow = (_a) => {
|
|
2200
|
+
var { headerGroup, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight } = _a, rest = __rest(_a, ["headerGroup", "table", "virtualColumns", "virtualPaddingLeft", "virtualPaddingRight"]);
|
|
2169
2201
|
const { options: { layoutMode, muiTableHeadRowProps }, } = table;
|
|
2170
|
-
const tableRowProps = parseFromValuesOrFunc(muiTableHeadRowProps, {
|
|
2202
|
+
const tableRowProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableHeadRowProps, {
|
|
2171
2203
|
headerGroup,
|
|
2172
2204
|
table,
|
|
2173
|
-
});
|
|
2205
|
+
})), { rest });
|
|
2174
2206
|
return (jsxRuntime.jsxs(TableRow__default["default"], Object.assign({}, tableRowProps, { sx: (theme) => (Object.assign({ backgroundColor: styles.lighten(theme.palette.background.default, 0.05), boxShadow: `4px 0 8px ${styles.alpha(theme.palette.common.black, 0.1)}`, display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'flex' : undefined, top: 0 }, parseFromValuesOrFunc(tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx, theme))), children: [virtualPaddingLeft ? (jsxRuntime.jsx("th", { style: { display: 'flex', width: virtualPaddingLeft } })) : null, (virtualColumns !== null && virtualColumns !== void 0 ? virtualColumns : headerGroup.headers).map((headerOrVirtualHeader) => {
|
|
2175
2207
|
const header = virtualColumns
|
|
2176
2208
|
? headerGroup.headers[headerOrVirtualHeader.index]
|
|
@@ -2179,14 +2211,15 @@ const MRT_TableHeadRow = ({ headerGroup, table, virtualColumns, virtualPaddingLe
|
|
|
2179
2211
|
}), virtualPaddingRight ? (jsxRuntime.jsx("th", { style: { display: 'flex', width: virtualPaddingRight } })) : null] })));
|
|
2180
2212
|
};
|
|
2181
2213
|
|
|
2182
|
-
const MRT_LinearProgressBar = (
|
|
2214
|
+
const MRT_LinearProgressBar = (_a) => {
|
|
2215
|
+
var { isTopToolbar, table } = _a, rest = __rest(_a, ["isTopToolbar", "table"]);
|
|
2183
2216
|
const { getState, options: { muiLinearProgressProps }, } = table;
|
|
2184
|
-
const { showProgressBars } = getState();
|
|
2185
|
-
const linearProgressProps = parseFromValuesOrFunc(muiLinearProgressProps, {
|
|
2217
|
+
const { isSaving, showProgressBars } = getState();
|
|
2218
|
+
const linearProgressProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiLinearProgressProps, {
|
|
2186
2219
|
isTopToolbar,
|
|
2187
2220
|
table,
|
|
2188
|
-
});
|
|
2189
|
-
return (jsxRuntime.jsx(Collapse__default["default"], { in: showProgressBars, mountOnEnter: true, sx: {
|
|
2221
|
+
})), rest);
|
|
2222
|
+
return (jsxRuntime.jsx(Collapse__default["default"], { in: showProgressBars !== false && (showProgressBars || isSaving), mountOnEnter: true, sx: {
|
|
2190
2223
|
bottom: isTopToolbar ? 0 : undefined,
|
|
2191
2224
|
position: 'absolute',
|
|
2192
2225
|
top: !isTopToolbar ? 0 : undefined,
|
|
@@ -2194,46 +2227,20 @@ const MRT_LinearProgressBar = ({ isTopToolbar, table, }) => {
|
|
|
2194
2227
|
}, unmountOnExit: true, children: jsxRuntime.jsx(LinearProgress__default["default"], Object.assign({ "aria-busy": "true", "aria-label": "Loading", sx: { position: 'relative' } }, linearProgressProps)) }));
|
|
2195
2228
|
};
|
|
2196
2229
|
|
|
2197
|
-
/******************************************************************************
|
|
2198
|
-
Copyright (c) Microsoft Corporation.
|
|
2199
|
-
|
|
2200
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
2201
|
-
purpose with or without fee is hereby granted.
|
|
2202
|
-
|
|
2203
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
2204
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
2205
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
2206
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
2207
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
2208
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2209
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
2210
|
-
***************************************************************************** */
|
|
2211
|
-
function __rest(s, e) {
|
|
2212
|
-
var t = {};
|
|
2213
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
2214
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
2215
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
2216
|
-
}
|
|
2217
|
-
return t;
|
|
2218
|
-
}
|
|
2219
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
2220
|
-
var e = new Error(message);
|
|
2221
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
2222
|
-
};
|
|
2223
|
-
|
|
2224
2230
|
const defaultRowsPerPage = [5, 10, 15, 20, 25, 30, 50, 100];
|
|
2225
|
-
const MRT_TablePagination = (
|
|
2231
|
+
const MRT_TablePagination = (_a) => {
|
|
2232
|
+
var { position = 'bottom', table } = _a, rest = __rest(_a, ["position", "table"]);
|
|
2226
2233
|
const { getPrePaginationRowModel, getState, options: { enableToolbarInternalActions, icons: { ChevronLeftIcon, ChevronRightIcon, FirstPageIcon, LastPageIcon }, localization, muiPaginationProps, paginationDisplayMode, rowCount, }, setPageIndex, setPageSize, } = table;
|
|
2227
2234
|
const { pagination: { pageIndex = 0, pageSize = 10 }, showGlobalFilter, } = getState();
|
|
2228
|
-
const paginationProps = parseFromValuesOrFunc(muiPaginationProps, {
|
|
2235
|
+
const paginationProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiPaginationProps, {
|
|
2229
2236
|
table,
|
|
2230
|
-
});
|
|
2237
|
+
})), rest);
|
|
2231
2238
|
const totalRowCount = rowCount !== null && rowCount !== void 0 ? rowCount : getPrePaginationRowModel().rows.length;
|
|
2232
2239
|
const numberOfPages = Math.ceil(totalRowCount / pageSize);
|
|
2233
2240
|
const showFirstLastPageButtons = numberOfPages > 2;
|
|
2234
2241
|
const firstRowIndex = pageIndex * pageSize;
|
|
2235
2242
|
const lastRowIndex = Math.min(pageIndex * pageSize + pageSize, totalRowCount);
|
|
2236
|
-
const
|
|
2243
|
+
const _b = paginationProps !== null && paginationProps !== void 0 ? paginationProps : {}, { rowsPerPageOptions = defaultRowsPerPage, showFirstButton = showFirstLastPageButtons, showLastButton = showFirstLastPageButtons, showRowsPerPage = true } = _b, _rest = __rest(_b, ["rowsPerPageOptions", "showFirstButton", "showLastButton", "showRowsPerPage"]);
|
|
2237
2244
|
return (jsxRuntime.jsxs(Box__default["default"], { sx: {
|
|
2238
2245
|
alignItems: 'center',
|
|
2239
2246
|
display: 'flex',
|
|
@@ -2247,7 +2254,7 @@ const MRT_TablePagination = ({ position = 'bottom', table, }) => {
|
|
|
2247
2254
|
? '3rem'
|
|
2248
2255
|
: undefined,
|
|
2249
2256
|
position: 'relative',
|
|
2250
|
-
px: '
|
|
2257
|
+
px: '8px',
|
|
2251
2258
|
py: '12px',
|
|
2252
2259
|
zIndex: 2,
|
|
2253
2260
|
}, children: [showRowsPerPage && (jsxRuntime.jsxs(Box__default["default"], { sx: { alignItems: 'center', display: 'flex', gap: '8px' }, children: [jsxRuntime.jsx(InputLabel__default["default"], { htmlFor: "mrt-rows-per-page", sx: { mb: 0 }, children: localization.rowsPerPage }), jsxRuntime.jsx(Select__default["default"], { disableUnderline: true, id: "mrt-rows-per-page", inputProps: { 'aria-label': localization.rowsPerPage }, label: localization.rowsPerPage, onChange: (event) => setPageSize(+event.target.value), sx: { mb: 0 }, value: pageSize, variant: "standard", children: rowsPerPageOptions.map((value) => (jsxRuntime.jsx(MenuItem__default["default"], { sx: { m: 0 }, value: value, children: value }, value))) })] })), paginationDisplayMode === 'pages' ? (jsxRuntime.jsx(Pagination__default["default"], Object.assign({ count: numberOfPages, onChange: (_e, newPageIndex) => setPageIndex(newPageIndex - 1), page: pageIndex + 1, renderItem: (item) => (jsxRuntime.jsx(PaginationItem__default["default"], Object.assign({ slots: {
|
|
@@ -2255,16 +2262,17 @@ const MRT_TablePagination = ({ position = 'bottom', table, }) => {
|
|
|
2255
2262
|
last: LastPageIcon,
|
|
2256
2263
|
next: ChevronRightIcon,
|
|
2257
2264
|
previous: ChevronLeftIcon,
|
|
2258
|
-
} }, item))), showFirstButton: showFirstButton, showLastButton: showLastButton },
|
|
2265
|
+
} }, item))), showFirstButton: showFirstButton, showLastButton: showLastButton }, _rest))) : paginationDisplayMode === 'default' ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography__default["default"], { align: "center", sx: { mb: 0, minWidth: '8ch', mx: '4px' }, variant: "body2", children: `${lastRowIndex === 0 ? 0 : (firstRowIndex + 1).toLocaleString()}-${lastRowIndex.toLocaleString()} ${localization.of} ${totalRowCount.toLocaleString()}` }), jsxRuntime.jsxs(Box__default["default"], { gap: "xs", children: [showFirstButton && (jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.goToFirstPage, disabled: pageIndex <= 0, onClick: () => setPageIndex(0), size: "small", children: jsxRuntime.jsx(FirstPageIcon, {}) })), jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.goToPreviousPage, disabled: pageIndex <= 0, onClick: () => setPageIndex(pageIndex - 1), size: "small", children: jsxRuntime.jsx(ChevronLeftIcon, {}) }), jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.goToNextPage, disabled: lastRowIndex >= totalRowCount, onClick: () => setPageIndex(pageIndex + 1), size: "small", children: jsxRuntime.jsx(ChevronRightIcon, {}) }), showLastButton && (jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.goToLastPage, disabled: lastRowIndex >= totalRowCount, onClick: () => setPageIndex(numberOfPages - 1), size: "small", children: jsxRuntime.jsx(LastPageIcon, {}) }))] })] })) : null] }));
|
|
2259
2266
|
};
|
|
2260
2267
|
|
|
2261
|
-
const MRT_GlobalFilterTextField = (
|
|
2262
|
-
var
|
|
2268
|
+
const MRT_GlobalFilterTextField = (_a) => {
|
|
2269
|
+
var _b;
|
|
2270
|
+
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
2263
2271
|
const { getState, options: { enableGlobalFilterModes, icons: { CloseIcon, SearchIcon }, localization, manualFiltering, muiSearchTextFieldProps, }, refs: { searchInputRef }, setGlobalFilter, } = table;
|
|
2264
2272
|
const { globalFilter, showGlobalFilter } = getState();
|
|
2265
|
-
const textFieldProps = parseFromValuesOrFunc(muiSearchTextFieldProps, {
|
|
2273
|
+
const textFieldProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiSearchTextFieldProps, {
|
|
2266
2274
|
table,
|
|
2267
|
-
});
|
|
2275
|
+
})), rest);
|
|
2268
2276
|
const isMounted = react.useRef(false);
|
|
2269
2277
|
const [anchorEl, setAnchorEl] = react.useState(null);
|
|
2270
2278
|
const [searchValue, setSearchValue] = react.useState(globalFilter !== null && globalFilter !== void 0 ? globalFilter : '');
|
|
@@ -2295,7 +2303,7 @@ const MRT_GlobalFilterTextField = ({ table, }) => {
|
|
|
2295
2303
|
isMounted.current = true;
|
|
2296
2304
|
}, [globalFilter]);
|
|
2297
2305
|
return (jsxRuntime.jsxs(Collapse__default["default"], { in: showGlobalFilter, mountOnEnter: true, orientation: "horizontal", unmountOnExit: true, children: [jsxRuntime.jsx(TextField__default["default"], Object.assign({ InputProps: {
|
|
2298
|
-
endAdornment: (jsxRuntime.jsx(InputAdornment__default["default"], { position: "end", children: jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, title: (
|
|
2306
|
+
endAdornment: (jsxRuntime.jsx(InputAdornment__default["default"], { position: "end", children: jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, title: (_b = localization.clearSearch) !== null && _b !== void 0 ? _b : '', 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, {}) }) }) }) })),
|
|
2299
2307
|
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' } })),
|
|
2300
2308
|
}, onChange: handleChange, placeholder: localization.search, value: searchValue !== null && searchValue !== void 0 ? searchValue : '', variant: "standard" }, textFieldProps, { inputRef: (inputRef) => {
|
|
2301
2309
|
searchInputRef.current = inputRef;
|
|
@@ -2305,13 +2313,14 @@ const MRT_GlobalFilterTextField = ({ table, }) => {
|
|
|
2305
2313
|
} })), jsxRuntime.jsx(MRT_FilterOptionMenu, { anchorEl: anchorEl, onSelect: handleClear, setAnchorEl: setAnchorEl, table: table })] }));
|
|
2306
2314
|
};
|
|
2307
2315
|
|
|
2308
|
-
const MRT_SelectCheckbox = (
|
|
2309
|
-
var
|
|
2316
|
+
const MRT_SelectCheckbox = (_a) => {
|
|
2317
|
+
var _b;
|
|
2318
|
+
var { row, selectAll, table } = _a, rest = __rest(_a, ["row", "selectAll", "table"]);
|
|
2310
2319
|
const { getState, options: { enableMultiRowSelection, enableRowPinning, localization, muiSelectAllCheckboxProps, muiSelectCheckboxProps, rowPinningDisplayMode, selectAllMode, }, } = table;
|
|
2311
2320
|
const { density, isLoading } = getState();
|
|
2312
|
-
const checkboxProps = !row
|
|
2321
|
+
const checkboxProps = Object.assign(Object.assign({}, (!row
|
|
2313
2322
|
? parseFromValuesOrFunc(muiSelectAllCheckboxProps, { table })
|
|
2314
|
-
: parseFromValuesOrFunc(muiSelectCheckboxProps, { row, table });
|
|
2323
|
+
: parseFromValuesOrFunc(muiSelectCheckboxProps, { row, table }))), rest);
|
|
2315
2324
|
const allRowsSelected = selectAll
|
|
2316
2325
|
? selectAllMode === 'page'
|
|
2317
2326
|
? table.getIsAllPageRowsSelected()
|
|
@@ -2345,25 +2354,26 @@ const MRT_SelectCheckbox = ({ row, selectAll, table, }) => {
|
|
|
2345
2354
|
e.stopPropagation();
|
|
2346
2355
|
(_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.onClick) === null || _a === void 0 ? void 0 : _a.call(checkboxProps, e);
|
|
2347
2356
|
}, sx: (theme) => (Object.assign({ height: density === 'compact' ? '1.75rem' : '2.5rem', m: density !== 'compact' ? '-0.4rem' : undefined, width: density === 'compact' ? '1.75rem' : '2.5rem', zIndex: 0 }, parseFromValuesOrFunc(checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.sx, theme))), title: undefined });
|
|
2348
|
-
return (jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: (
|
|
2357
|
+
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 : (selectAll
|
|
2349
2358
|
? localization.toggleSelectAll
|
|
2350
2359
|
: localization.toggleSelectRow), children: enableMultiRowSelection === false ? (jsxRuntime.jsx(Radio__default["default"], Object.assign({}, commonProps))) : (jsxRuntime.jsx(Checkbox__default["default"], Object.assign({ indeterminate: selectAll
|
|
2351
2360
|
? table.getIsSomeRowsSelected() && !allRowsSelected
|
|
2352
2361
|
: row === null || row === void 0 ? void 0 : row.getIsSomeSelected() }, commonProps))) }));
|
|
2353
2362
|
};
|
|
2354
2363
|
|
|
2355
|
-
const MRT_ToolbarAlertBanner = (
|
|
2356
|
-
var
|
|
2364
|
+
const MRT_ToolbarAlertBanner = (_a) => {
|
|
2365
|
+
var _b, _c, _d;
|
|
2366
|
+
var { stackAlertBanner, table } = _a, rest = __rest(_a, ["stackAlertBanner", "table"]);
|
|
2357
2367
|
const { getPrePaginationRowModel, getSelectedRowModel, getState, options: { enableRowSelection, enableSelectAll, localization, muiToolbarAlertBannerChipProps, muiToolbarAlertBannerProps, positionToolbarAlertBanner, renderToolbarAlertBannerContent, rowCount, }, refs: { tablePaperRef }, } = table;
|
|
2358
2368
|
const { density, grouping, showAlertBanner } = getState();
|
|
2359
|
-
const alertProps = parseFromValuesOrFunc(muiToolbarAlertBannerProps, {
|
|
2369
|
+
const alertProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiToolbarAlertBannerProps, {
|
|
2360
2370
|
table,
|
|
2361
|
-
});
|
|
2371
|
+
})), rest);
|
|
2362
2372
|
const chipProps = parseFromValuesOrFunc(muiToolbarAlertBannerChipProps, {
|
|
2363
2373
|
table,
|
|
2364
2374
|
});
|
|
2365
2375
|
const selectedAlert = getSelectedRowModel().rows.length > 0
|
|
2366
|
-
? (
|
|
2376
|
+
? (_c = (_b = localization.selectedCountOfRowCountRowsSelected) === null || _b === void 0 ? void 0 : _b.replace('{selectedCount}', getSelectedRowModel().rows.length.toString())) === null || _c === void 0 ? void 0 : _c.replace('{rowCount}', (rowCount !== null && rowCount !== void 0 ? rowCount : getPrePaginationRowModel().rows.length).toString())
|
|
2367
2377
|
: null;
|
|
2368
2378
|
const groupedAlert = 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;
|
|
2369
2379
|
return (jsxRuntime.jsx(Collapse__default["default"], { in: showAlertBanner || !!selectedAlert || !!groupedAlert, timeout: stackAlertBanner ? 200 : 0, children: jsxRuntime.jsx(Alert__default["default"], Object.assign({ color: "info", icon: false }, alertProps, { sx: (theme) => {
|
|
@@ -2376,11 +2386,11 @@ const MRT_ToolbarAlertBanner = ({ stackAlertBanner, table, }) => {
|
|
|
2376
2386
|
: positionToolbarAlertBanner === 'bottom'
|
|
2377
2387
|
? '-1rem'
|
|
2378
2388
|
: undefined, p: 0, position: 'relative', right: 0, top: 0, width: '100%', zIndex: 2 }, parseFromValuesOrFunc(alertProps === null || alertProps === void 0 ? void 0 : alertProps.sx, theme)));
|
|
2379
|
-
}, children: (
|
|
2389
|
+
}, children: (_d = renderToolbarAlertBannerContent === null || renderToolbarAlertBannerContent === void 0 ? void 0 : renderToolbarAlertBannerContent({
|
|
2380
2390
|
groupedAlert,
|
|
2381
2391
|
selectedAlert,
|
|
2382
2392
|
table,
|
|
2383
|
-
})) !== null &&
|
|
2393
|
+
})) !== null && _d !== void 0 ? _d : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [(alertProps === null || alertProps === void 0 ? void 0 : alertProps.title) && jsxRuntime.jsx(AlertTitle__default["default"], { children: alertProps.title }), jsxRuntime.jsxs(Stack__default["default"], { sx: {
|
|
2384
2394
|
p: positionToolbarAlertBanner !== 'head-overlay'
|
|
2385
2395
|
? '0.5rem 1rem'
|
|
2386
2396
|
: density === 'spacious'
|
|
@@ -2393,8 +2403,9 @@ const MRT_ToolbarAlertBanner = ({ stackAlertBanner, table, }) => {
|
|
|
2393
2403
|
positionToolbarAlertBanner === 'head-overlay' && (jsxRuntime.jsx(MRT_SelectCheckbox, { selectAll: true, table: table })), ' ', selectedAlert] }), selectedAlert && groupedAlert && jsxRuntime.jsx("br", {}), groupedAlert] })] })) })) }));
|
|
2394
2404
|
};
|
|
2395
2405
|
|
|
2396
|
-
const MRT_ToolbarDropZone = (
|
|
2397
|
-
var
|
|
2406
|
+
const MRT_ToolbarDropZone = (_a) => {
|
|
2407
|
+
var _b, _c;
|
|
2408
|
+
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
2398
2409
|
const { getState, options: { enableGrouping, localization }, setHoveredColumn, setShowToolbarDropZone, } = table;
|
|
2399
2410
|
const { draggingColumn, grouping, hoveredColumn, showToolbarDropZone } = getState();
|
|
2400
2411
|
const handleDragEnter = (_event) => {
|
|
@@ -2409,35 +2420,25 @@ const MRT_ToolbarDropZone = ({ table, }) => {
|
|
|
2409
2420
|
!grouping.includes(draggingColumn.id));
|
|
2410
2421
|
}
|
|
2411
2422
|
}, [enableGrouping, draggingColumn, grouping]);
|
|
2412
|
-
return (jsxRuntime.jsx(Fade__default["default"], { in: showToolbarDropZone, children: jsxRuntime.jsx(Box__default["default"], { className: "Mui-ToolbarDropZone", onDragEnter: handleDragEnter, sx: (theme) => ({
|
|
2413
|
-
alignItems: 'center',
|
|
2414
|
-
backdropFilter: 'blur(4px)',
|
|
2415
|
-
backgroundColor: styles.alpha(theme.palette.info.main, (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === 'drop-zone' ? 0.2 : 0.1),
|
|
2416
|
-
border: `dashed ${theme.palette.info.main} 2px`,
|
|
2417
|
-
boxSizing: 'border-box',
|
|
2418
|
-
display: 'flex',
|
|
2419
|
-
height: '100%',
|
|
2420
|
-
justifyContent: 'center',
|
|
2421
|
-
position: 'absolute',
|
|
2422
|
-
width: '100%',
|
|
2423
|
-
zIndex: 4,
|
|
2424
|
-
}), 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 : '') }) }) }));
|
|
2423
|
+
return (jsxRuntime.jsx(Fade__default["default"], { in: showToolbarDropZone, children: jsxRuntime.jsx(Box__default["default"], Object.assign({ className: "Mui-ToolbarDropZone", onDragEnter: handleDragEnter }, rest, { sx: (theme) => (Object.assign({ alignItems: 'center', backdropFilter: 'blur(4px)', backgroundColor: styles.alpha(theme.palette.info.main, (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === 'drop-zone' ? 0.2 : 0.1), border: `dashed ${theme.palette.info.main} 2px`, boxSizing: 'border-box', display: 'flex', height: '100%', justifyContent: 'center', position: 'absolute', width: '100%', zIndex: 4 }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: jsxRuntime.jsx(Typography__default["default"], { fontStyle: "italic", children: localization.dropToGroupBy.replace('{column}', (_c = (_b = draggingColumn === null || draggingColumn === void 0 ? void 0 : draggingColumn.columnDef) === null || _b === void 0 ? void 0 : _b.header) !== null && _c !== void 0 ? _c : '') }) })) }));
|
|
2425
2424
|
};
|
|
2426
2425
|
|
|
2427
|
-
const MRT_ColumnPinningButtons = (
|
|
2426
|
+
const MRT_ColumnPinningButtons = (_a) => {
|
|
2427
|
+
var { column, table } = _a, rest = __rest(_a, ["column", "table"]);
|
|
2428
2428
|
const { options: { icons: { PushPinIcon }, localization, }, } = table;
|
|
2429
2429
|
const handlePinColumn = (pinDirection) => {
|
|
2430
2430
|
column.pin(pinDirection);
|
|
2431
2431
|
};
|
|
2432
|
-
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: {
|
|
2432
|
+
return (jsxRuntime.jsx(Box__default["default"], Object.assign({}, rest, { sx: (theme) => (Object.assign({ minWidth: '70px', textAlign: 'center' }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), 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: {
|
|
2433
2433
|
transform: 'rotate(90deg)',
|
|
2434
2434
|
} }) }) }), 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: {
|
|
2435
2435
|
transform: 'rotate(-90deg)',
|
|
2436
|
-
} }) }) })] })) }));
|
|
2436
|
+
} }) }) })] })) })));
|
|
2437
2437
|
};
|
|
2438
2438
|
|
|
2439
|
-
const MRT_ShowHideColumnsMenuItems = (
|
|
2440
|
-
var
|
|
2439
|
+
const MRT_ShowHideColumnsMenuItems = (_a) => {
|
|
2440
|
+
var _b;
|
|
2441
|
+
var { allColumns, column, hoveredColumn, setHoveredColumn, table } = _a, rest = __rest(_a, ["allColumns", "column", "hoveredColumn", "setHoveredColumn", "table"]);
|
|
2441
2442
|
const { getState, options: { enableColumnOrdering, enableColumnPinning, enableHiding, localization, }, setColumnOrder, } = table;
|
|
2442
2443
|
const { columnOrder } = getState();
|
|
2443
2444
|
const { columnDef } = column;
|
|
@@ -2474,20 +2475,11 @@ const MRT_ShowHideColumnsMenuItems = ({ allColumns, column, hoveredColumn, setHo
|
|
|
2474
2475
|
setHoveredColumn(column);
|
|
2475
2476
|
}
|
|
2476
2477
|
};
|
|
2477
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MenuItem__default["default"], { disableRipple: true, onDragEnter: handleDragEnter, ref: menuItemRef, sx: (theme) => ({
|
|
2478
|
-
alignItems: 'center',
|
|
2479
|
-
justifyContent: 'flex-start',
|
|
2480
|
-
my: 0,
|
|
2481
|
-
opacity: isDragging ? 0.5 : 1,
|
|
2482
|
-
outline: isDragging
|
|
2478
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MenuItem__default["default"], Object.assign({ disableRipple: true, onDragEnter: handleDragEnter, ref: menuItemRef }, rest, { sx: (theme) => (Object.assign({ alignItems: 'center', justifyContent: 'flex-start', my: 0, opacity: isDragging ? 0.5 : 1, outline: isDragging
|
|
2483
2479
|
? `2px dashed ${theme.palette.divider}`
|
|
2484
2480
|
: (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === column.id
|
|
2485
2481
|
? `2px dashed ${theme.palette.primary.main}`
|
|
2486
|
-
: 'none',
|
|
2487
|
-
outlineOffset: '-2px',
|
|
2488
|
-
pl: `${(column.depth + 0.5) * 2}rem`,
|
|
2489
|
-
py: '6px',
|
|
2490
|
-
}), children: jsxRuntime.jsxs(Box__default["default"], { sx: {
|
|
2482
|
+
: 'none', outlineOffset: '-2px', pl: `${(column.depth + 0.5) * 2}rem`, py: '6px' }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: jsxRuntime.jsxs(Box__default["default"], { sx: {
|
|
2491
2483
|
display: 'flex',
|
|
2492
2484
|
flexWrap: 'nowrap',
|
|
2493
2485
|
gap: '8px',
|
|
@@ -2502,10 +2494,11 @@ const MRT_ShowHideColumnsMenuItems = ({ allColumns, column, hoveredColumn, setHo
|
|
|
2502
2494
|
opacity: columnDefType !== 'display' ? 1 : 0.5,
|
|
2503
2495
|
},
|
|
2504
2496
|
},
|
|
2505
|
-
}, 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 }))] }) }), (
|
|
2497
|
+
}, 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 }))] }) })), (_b = column.columns) === null || _b === void 0 ? void 0 : _b.map((c, i) => (jsxRuntime.jsx(MRT_ShowHideColumnsMenuItems, { allColumns: allColumns, column: c, hoveredColumn: hoveredColumn, setHoveredColumn: setHoveredColumn, table: table }, `${i}-${c.id}`)))] }));
|
|
2506
2498
|
};
|
|
2507
2499
|
|
|
2508
|
-
const MRT_ShowHideColumnsMenu = (
|
|
2500
|
+
const MRT_ShowHideColumnsMenu = (_a) => {
|
|
2501
|
+
var { anchorEl, setAnchorEl, table } = _a, rest = __rest(_a, ["anchorEl", "setAnchorEl", "table"]);
|
|
2509
2502
|
const { getAllColumns, getAllLeafColumns, getCenterLeafColumns, getIsAllColumnsVisible, getIsSomeColumnsPinned, getIsSomeColumnsVisible, getLeftLeafColumns, getRightLeafColumns, getState, options: { enableColumnOrdering, enableColumnPinning, enableHiding, localization, }, toggleAllColumnsVisible, } = table;
|
|
2510
2503
|
const { columnOrder, columnPinning, density } = getState();
|
|
2511
2504
|
const hideAllColumns = () => {
|
|
@@ -2533,14 +2526,14 @@ const MRT_ShowHideColumnsMenu = ({ anchorEl, setAnchorEl, table, }) => {
|
|
|
2533
2526
|
getRightLeafColumns(),
|
|
2534
2527
|
]);
|
|
2535
2528
|
const [hoveredColumn, setHoveredColumn] = react.useState(null);
|
|
2536
|
-
return (jsxRuntime.jsxs(Menu__default["default"], { MenuListProps: {
|
|
2529
|
+
return (jsxRuntime.jsxs(Menu__default["default"], Object.assign({ MenuListProps: {
|
|
2537
2530
|
dense: density === 'compact',
|
|
2538
|
-
}, anchorEl: anchorEl, onClose: () => setAnchorEl(null), open: !!anchorEl, children: [jsxRuntime.jsxs(Box__default["default"], { sx: {
|
|
2531
|
+
}, anchorEl: anchorEl, onClose: () => setAnchorEl(null), open: !!anchorEl }, rest, { children: [jsxRuntime.jsxs(Box__default["default"], { sx: {
|
|
2539
2532
|
display: 'flex',
|
|
2540
2533
|
justifyContent: 'space-between',
|
|
2541
2534
|
p: '0.5rem',
|
|
2542
2535
|
pt: 0,
|
|
2543
|
-
}, 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 })), enableColumnPinning && (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}`)))] }));
|
|
2536
|
+
}, 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 })), enableColumnPinning && (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}`)))] })));
|
|
2544
2537
|
};
|
|
2545
2538
|
|
|
2546
2539
|
const MRT_ShowHideColumnsButton = (_a) => {
|
|
@@ -2606,31 +2599,27 @@ const MRT_ToggleGlobalFilterButton = (_a) => {
|
|
|
2606
2599
|
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, {}) })) }));
|
|
2607
2600
|
};
|
|
2608
2601
|
|
|
2609
|
-
const MRT_ToolbarInternalButtons = (
|
|
2610
|
-
var
|
|
2602
|
+
const MRT_ToolbarInternalButtons = (_a) => {
|
|
2603
|
+
var _b;
|
|
2604
|
+
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
2611
2605
|
const { options: { columnFilterDisplayMode, enableColumnFilters, enableColumnOrdering, enableColumnPinning, enableDensityToggle, enableFilters, enableFullScreenToggle, enableGlobalFilter, enableHiding, initialState, renderToolbarInternalActions, }, } = table;
|
|
2612
|
-
return (jsxRuntime.jsx(Box__default["default"], { sx: {
|
|
2613
|
-
alignItems: 'center',
|
|
2614
|
-
display: 'flex',
|
|
2615
|
-
zIndex: 3,
|
|
2616
|
-
}, children: (_a = renderToolbarInternalActions === null || renderToolbarInternalActions === void 0 ? void 0 : renderToolbarInternalActions({
|
|
2606
|
+
return (jsxRuntime.jsx(Box__default["default"], Object.assign({}, rest, { sx: (theme) => (Object.assign({ alignItems: 'center', display: 'flex', zIndex: 3 }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: (_b = renderToolbarInternalActions === null || renderToolbarInternalActions === void 0 ? void 0 : renderToolbarInternalActions({
|
|
2617
2607
|
table,
|
|
2618
|
-
})) !== null &&
|
|
2608
|
+
})) !== null && _b !== void 0 ? _b : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [enableFilters &&
|
|
2619
2609
|
enableGlobalFilter &&
|
|
2620
2610
|
!(initialState === null || initialState === void 0 ? void 0 : initialState.showGlobalFilter) && (jsxRuntime.jsx(MRT_ToggleGlobalFilterButton, { table: table })), enableFilters &&
|
|
2621
2611
|
enableColumnFilters &&
|
|
2622
|
-
columnFilterDisplayMode !== 'popover' && (jsxRuntime.jsx(MRT_ToggleFiltersButton, { table: table })), (enableHiding || enableColumnOrdering || enableColumnPinning) && (jsxRuntime.jsx(MRT_ShowHideColumnsButton, { table: table })), enableDensityToggle && (jsxRuntime.jsx(MRT_ToggleDensePaddingButton, { table: table })), enableFullScreenToggle && (jsxRuntime.jsx(MRT_ToggleFullScreenButton, { table: table }))] })) }));
|
|
2612
|
+
columnFilterDisplayMode !== 'popover' && (jsxRuntime.jsx(MRT_ToggleFiltersButton, { table: table })), (enableHiding || enableColumnOrdering || enableColumnPinning) && (jsxRuntime.jsx(MRT_ShowHideColumnsButton, { table: table })), enableDensityToggle && (jsxRuntime.jsx(MRT_ToggleDensePaddingButton, { table: table })), enableFullScreenToggle && (jsxRuntime.jsx(MRT_ToggleFullScreenButton, { table: table }))] })) })));
|
|
2623
2613
|
};
|
|
2624
2614
|
|
|
2625
2615
|
const commonToolbarStyles = ({ theme }) => ({
|
|
2626
2616
|
alignItems: 'flex-start',
|
|
2627
2617
|
backgroundColor: styles.lighten(theme.palette.background.default, 0.05),
|
|
2628
|
-
backgroundImage: 'none',
|
|
2629
2618
|
display: 'grid',
|
|
2630
2619
|
flexWrap: 'wrap-reverse',
|
|
2631
2620
|
minHeight: '3.5rem',
|
|
2632
2621
|
overflow: 'hidden',
|
|
2633
|
-
|
|
2622
|
+
position: 'relative',
|
|
2634
2623
|
transition: 'all 150ms ease-in-out',
|
|
2635
2624
|
zIndex: 1,
|
|
2636
2625
|
});
|
|
@@ -2641,13 +2630,13 @@ const MRT_TopToolbar = ({ table, }) => {
|
|
|
2641
2630
|
const isMobile = useMediaQuery__default["default"]('(max-width:720px)');
|
|
2642
2631
|
const toolbarProps = parseFromValuesOrFunc(muiTopToolbarProps, { table });
|
|
2643
2632
|
const stackAlertBanner = isMobile || !!renderTopToolbarCustomActions || showGlobalFilter;
|
|
2644
|
-
return (jsxRuntime.jsxs(
|
|
2633
|
+
return (jsxRuntime.jsxs(Box__default["default"], Object.assign({}, toolbarProps, { ref: (ref) => {
|
|
2645
2634
|
topToolbarRef.current = ref;
|
|
2646
2635
|
if (toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.ref) {
|
|
2647
2636
|
// @ts-ignore
|
|
2648
2637
|
toolbarProps.ref.current = ref;
|
|
2649
2638
|
}
|
|
2650
|
-
}, sx: (theme) => (Object.assign(Object.assign({ position: isFullScreen ? 'sticky' :
|
|
2639
|
+
}, sx: (theme) => (Object.assign(Object.assign(Object.assign({}, commonToolbarStyles({ theme })), { position: isFullScreen ? 'sticky' : 'relative', top: isFullScreen ? '0' : undefined }), parseFromValuesOrFunc(toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx, theme))), 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: {
|
|
2651
2640
|
alignItems: 'flex-start',
|
|
2652
2641
|
boxSizing: 'border-box',
|
|
2653
2642
|
display: 'flex',
|
|
@@ -2666,13 +2655,14 @@ const MRT_TopToolbar = ({ table, }) => {
|
|
|
2666
2655
|
['both', 'top'].includes(positionPagination !== null && positionPagination !== void 0 ? positionPagination : '') && (jsxRuntime.jsx(MRT_TablePagination, { position: "top", table: table })), jsxRuntime.jsx(MRT_LinearProgressBar, { isTopToolbar: true, table: table })] })));
|
|
2667
2656
|
};
|
|
2668
2657
|
|
|
2669
|
-
const MRT_BottomToolbar = (
|
|
2658
|
+
const MRT_BottomToolbar = (_a) => {
|
|
2659
|
+
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
2670
2660
|
const { getState, options: { enablePagination, muiBottomToolbarProps, positionPagination, positionToolbarAlertBanner, positionToolbarDropZone, renderBottomToolbarCustomActions, }, refs: { bottomToolbarRef }, } = table;
|
|
2671
2661
|
const { isFullScreen } = getState();
|
|
2672
2662
|
const isMobile = useMediaQuery__default["default"]('(max-width:720px)');
|
|
2673
|
-
const toolbarProps = parseFromValuesOrFunc(muiBottomToolbarProps, { table });
|
|
2663
|
+
const toolbarProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiBottomToolbarProps, { table })), rest);
|
|
2674
2664
|
const stackAlertBanner = isMobile || !!renderBottomToolbarCustomActions;
|
|
2675
|
-
return (jsxRuntime.jsxs(
|
|
2665
|
+
return (jsxRuntime.jsxs(Box__default["default"], Object.assign({}, toolbarProps, { ref: (node) => {
|
|
2676
2666
|
if (node) {
|
|
2677
2667
|
bottomToolbarRef.current = node;
|
|
2678
2668
|
if (toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.ref) {
|
|
@@ -2697,10 +2687,11 @@ const MRT_BottomToolbar = ({ table, }) => {
|
|
|
2697
2687
|
['both', 'bottom'].includes(positionPagination !== null && positionPagination !== void 0 ? positionPagination : '') && (jsxRuntime.jsx(MRT_TablePagination, { position: "bottom", table: table })) })] })] })));
|
|
2698
2688
|
};
|
|
2699
2689
|
|
|
2700
|
-
const MRT_TableHead = (
|
|
2690
|
+
const MRT_TableHead = (_a) => {
|
|
2691
|
+
var { table, virtualColumns, virtualPaddingLeft, virtualPaddingRight } = _a, rest = __rest(_a, ["table", "virtualColumns", "virtualPaddingLeft", "virtualPaddingRight"]);
|
|
2701
2692
|
const { getHeaderGroups, getSelectedRowModel, getState, options: { enableStickyHeader, layoutMode, muiTableHeadProps, positionToolbarAlertBanner, }, refs: { tableHeadRef }, } = table;
|
|
2702
2693
|
const { isFullScreen, showAlertBanner } = getState();
|
|
2703
|
-
const tableHeadProps = parseFromValuesOrFunc(muiTableHeadProps, { table });
|
|
2694
|
+
const tableHeadProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableHeadProps, { table })), rest);
|
|
2704
2695
|
const stickyHeader = enableStickyHeader || isFullScreen;
|
|
2705
2696
|
return (jsxRuntime.jsx(TableHead__default["default"], Object.assign({}, tableHeadProps, { ref: (ref) => {
|
|
2706
2697
|
tableHeadRef.current = ref;
|
|
@@ -2712,16 +2703,17 @@ const MRT_TableHead = ({ table, virtualColumns, virtualPaddingLeft, virtualPaddi
|
|
|
2712
2703
|
(showAlertBanner || getSelectedRowModel().rows.length > 0) ? (jsxRuntime.jsx("tr", { style: {
|
|
2713
2704
|
display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined,
|
|
2714
2705
|
}, children: jsxRuntime.jsx("th", { colSpan: table.getVisibleLeafColumns().length, style: {
|
|
2715
|
-
display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' :
|
|
2706
|
+
display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined,
|
|
2716
2707
|
padding: 0,
|
|
2717
2708
|
}, children: jsxRuntime.jsx(MRT_ToolbarAlertBanner, { table: table }) }) })) : (getHeaderGroups().map((headerGroup) => (jsxRuntime.jsx(MRT_TableHeadRow, { headerGroup: headerGroup, table: table, virtualColumns: virtualColumns, virtualPaddingLeft: virtualPaddingLeft, virtualPaddingRight: virtualPaddingRight }, headerGroup.id)))) })));
|
|
2718
2709
|
};
|
|
2719
2710
|
|
|
2720
|
-
const MRT_Table = (
|
|
2721
|
-
var
|
|
2722
|
-
|
|
2711
|
+
const MRT_Table = (_a) => {
|
|
2712
|
+
var _b, _c, _d, _e;
|
|
2713
|
+
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
2714
|
+
const { getFlatHeaders, getState, options: { columnVirtualizerInstanceRef, columnVirtualizerOptions, columns, enableColumnPinning, enableColumnVirtualization, enableStickyHeader, enableTableFooter, enableTableHead, layoutMode, memoMode, muiTableProps, }, refs: { tableContainerRef }, } = table;
|
|
2723
2715
|
const { columnPinning, columnSizing, columnSizingInfo, columnVisibility, draggingColumn, isFullScreen, } = getState();
|
|
2724
|
-
const tableProps = parseFromValuesOrFunc(muiTableProps, { table });
|
|
2716
|
+
const tableProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableProps, { table })), rest);
|
|
2725
2717
|
const columnVirtualizerProps = parseFromValuesOrFunc(columnVirtualizerOptions, { table });
|
|
2726
2718
|
const columnSizeVars = react.useMemo(() => {
|
|
2727
2719
|
const headers = getFlatHeaders();
|
|
@@ -2776,10 +2768,10 @@ const MRT_Table = ({ table, }) => {
|
|
|
2776
2768
|
let virtualPaddingLeft;
|
|
2777
2769
|
let virtualPaddingRight;
|
|
2778
2770
|
if (columnVirtualizer && (virtualColumns === null || virtualColumns === void 0 ? void 0 : virtualColumns.length)) {
|
|
2779
|
-
virtualPaddingLeft = (
|
|
2771
|
+
virtualPaddingLeft = (_c = (_b = virtualColumns[leftPinnedIndexes.length]) === null || _b === void 0 ? void 0 : _b.start) !== null && _c !== void 0 ? _c : 0;
|
|
2780
2772
|
virtualPaddingRight =
|
|
2781
2773
|
columnVirtualizer.getTotalSize() -
|
|
2782
|
-
((
|
|
2774
|
+
((_e = (_d = virtualColumns[virtualColumns.length - 1 - rightPinnedIndexes.length]) === null || _d === void 0 ? void 0 : _d.end) !== null && _e !== void 0 ? _e : 0);
|
|
2783
2775
|
}
|
|
2784
2776
|
const props = {
|
|
2785
2777
|
table,
|
|
@@ -2787,12 +2779,31 @@ const MRT_Table = ({ table, }) => {
|
|
|
2787
2779
|
virtualPaddingLeft,
|
|
2788
2780
|
virtualPaddingRight,
|
|
2789
2781
|
};
|
|
2790
|
-
return (jsxRuntime.
|
|
2791
|
-
|
|
2792
|
-
|
|
2782
|
+
return (jsxRuntime.jsxs(Table__default["default"], Object.assign({ stickyHeader: enableStickyHeader || isFullScreen }, tableProps, { style: Object.assign(Object.assign({}, columnSizeVars), tableProps === null || tableProps === void 0 ? void 0 : tableProps.style), sx: (theme) => (Object.assign({ borderCollapse: 'separate', display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined }, parseFromValuesOrFunc(tableProps === null || tableProps === void 0 ? void 0 : tableProps.sx, theme))), 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))] })));
|
|
2783
|
+
};
|
|
2784
|
+
|
|
2785
|
+
const MRT_TableLoadingOverlay = (_a) => {
|
|
2786
|
+
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
2787
|
+
const { options: { localization, muiCircularProgressProps }, } = table;
|
|
2788
|
+
const circularProgressProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiCircularProgressProps, { table })), rest);
|
|
2789
|
+
return (jsxRuntime.jsx(Box__default["default"], { sx: (theme) => ({
|
|
2790
|
+
alignItems: 'center',
|
|
2791
|
+
backgroundColor: styles.alpha(styles.lighten(theme.palette.background.paper, 0.05), 0.5),
|
|
2792
|
+
bottom: 0,
|
|
2793
|
+
display: 'flex',
|
|
2794
|
+
justifyContent: 'center',
|
|
2795
|
+
left: 0,
|
|
2796
|
+
maxHeight: '100vh',
|
|
2797
|
+
position: 'absolute',
|
|
2798
|
+
right: 0,
|
|
2799
|
+
top: 0,
|
|
2800
|
+
width: '100%',
|
|
2801
|
+
zIndex: 2,
|
|
2802
|
+
}), children: jsxRuntime.jsx(CircularProgress__default["default"], Object.assign({ "aria-label": localization.noRecordsToDisplay, id: "mrt-progress" }, circularProgressProps)) }));
|
|
2793
2803
|
};
|
|
2794
2804
|
|
|
2795
|
-
const MRT_EditActionButtons = (
|
|
2805
|
+
const MRT_EditActionButtons = (_a) => {
|
|
2806
|
+
var { row, table, variant = 'icon' } = _a, rest = __rest(_a, ["row", "table", "variant"]);
|
|
2796
2807
|
const { getState, options: { icons: { CancelIcon, SaveIcon }, localization, onCreatingRowCancel, onCreatingRowSave, onEditingRowCancel, onEditingRowSave, }, refs: { editInputRefs }, setCreatingRow, setEditingRow, } = table;
|
|
2797
2808
|
const { creatingRow, editingRow, isSaving } = getState();
|
|
2798
2809
|
const isCreating = (creatingRow === null || creatingRow === void 0 ? void 0 : creatingRow.id) === row.id;
|
|
@@ -2835,16 +2846,17 @@ const MRT_EditActionButtons = ({ row, table, variant = 'icon', }) => {
|
|
|
2835
2846
|
});
|
|
2836
2847
|
}
|
|
2837
2848
|
};
|
|
2838
|
-
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: handleSubmitRow, children: isSaving ? jsxRuntime.jsx(CircularProgress__default["default"], { size: 18 }) : jsxRuntime.jsx(SaveIcon, {}) }) })] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Button__default["default"], { onClick: handleCancel, sx: { minWidth: '100px' }, children: localization.cancel }), jsxRuntime.jsxs(Button__default["default"], { onClick: handleSubmitRow, sx: { minWidth: '100px' }, variant: "contained", children: [isSaving && jsxRuntime.jsx(CircularProgress__default["default"], { color: "inherit", size: 18 }), localization.save] })] })) }));
|
|
2849
|
+
return (jsxRuntime.jsx(Box__default["default"], { onClick: (e) => e.stopPropagation(), sx: (theme) => (Object.assign({ display: 'flex', gap: '0.75rem' }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), 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: handleSubmitRow, children: isSaving ? jsxRuntime.jsx(CircularProgress__default["default"], { size: 18 }) : jsxRuntime.jsx(SaveIcon, {}) }) })] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Button__default["default"], { onClick: handleCancel, sx: { minWidth: '100px' }, children: localization.cancel }), jsxRuntime.jsxs(Button__default["default"], { onClick: handleSubmitRow, sx: { minWidth: '100px' }, variant: "contained", children: [isSaving && jsxRuntime.jsx(CircularProgress__default["default"], { color: "inherit", size: 18 }), localization.save] })] })) }));
|
|
2839
2850
|
};
|
|
2840
2851
|
|
|
2841
|
-
const MRT_EditRowModal = (
|
|
2842
|
-
var
|
|
2852
|
+
const MRT_EditRowModal = (_a) => {
|
|
2853
|
+
var _b;
|
|
2854
|
+
var { open, table } = _a, rest = __rest(_a, ["open", "table"]);
|
|
2843
2855
|
const { getState, options: { localization, muiCreateRowModalProps, muiEditRowModalProps, onCreatingRowCancel, onEditingRowCancel, renderCreateRowModalContent, renderEditRowModalContent, }, setCreatingRow, setEditingRow, } = table;
|
|
2844
2856
|
const { creatingRow, editingRow } = getState();
|
|
2845
2857
|
const row = (creatingRow !== null && creatingRow !== void 0 ? creatingRow : editingRow);
|
|
2846
|
-
const dialogProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiEditRowModalProps, { row, table })), (creatingRow &&
|
|
2847
|
-
parseFromValuesOrFunc(muiCreateRowModalProps, { row, table })));
|
|
2858
|
+
const dialogProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiEditRowModalProps, { row, table })), (creatingRow &&
|
|
2859
|
+
parseFromValuesOrFunc(muiCreateRowModalProps, { row, table }))), rest);
|
|
2848
2860
|
const internalEditComponents = row
|
|
2849
2861
|
.getAllCells()
|
|
2850
2862
|
.filter((cell) => cell.column.columnDef.columnDefType === 'data')
|
|
@@ -2861,7 +2873,7 @@ const MRT_EditRowModal = ({ open, table, }) => {
|
|
|
2861
2873
|
}
|
|
2862
2874
|
row._valuesCache = {}; //reset values cache
|
|
2863
2875
|
(_a = dialogProps.onClose) === null || _a === void 0 ? void 0 : _a.call(dialogProps, event, reason);
|
|
2864
|
-
}, open: open }, dialogProps, { children: (
|
|
2876
|
+
}, open: open }, dialogProps, { children: (_b = ((creatingRow &&
|
|
2865
2877
|
(renderCreateRowModalContent === null || renderCreateRowModalContent === void 0 ? void 0 : renderCreateRowModalContent({
|
|
2866
2878
|
internalEditComponents,
|
|
2867
2879
|
row,
|
|
@@ -2871,23 +2883,23 @@ const MRT_EditRowModal = ({ open, table, }) => {
|
|
|
2871
2883
|
internalEditComponents,
|
|
2872
2884
|
row,
|
|
2873
2885
|
table,
|
|
2874
|
-
})))) !== null &&
|
|
2875
|
-
gap: '
|
|
2886
|
+
})))) !== null && _b !== void 0 ? _b : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(DialogTitle__default["default"], { sx: { 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: {
|
|
2887
|
+
gap: '32px',
|
|
2876
2888
|
paddingTop: '16px',
|
|
2877
2889
|
width: '100%',
|
|
2878
2890
|
}, children: internalEditComponents }) }) }), jsxRuntime.jsx(DialogActions__default["default"], { sx: { p: '1.25rem' }, children: jsxRuntime.jsx(MRT_EditActionButtons, { row: row, table: table, variant: "text" }) })] })) })));
|
|
2879
2891
|
};
|
|
2880
2892
|
|
|
2881
2893
|
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? react.useLayoutEffect : react.useEffect;
|
|
2882
|
-
const MRT_TableContainer = (
|
|
2883
|
-
|
|
2894
|
+
const MRT_TableContainer = (_a) => {
|
|
2895
|
+
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
2896
|
+
const { getState, options: { createDisplayMode, editDisplayMode, enableStickyHeader, muiTableContainerProps, }, refs: { bottomToolbarRef, tableContainerRef, topToolbarRef }, } = table;
|
|
2884
2897
|
const { creatingRow, editingRow, isFullScreen, isLoading, showLoadingOverlay, } = getState();
|
|
2885
|
-
const loading = (isLoading || showLoadingOverlay)
|
|
2898
|
+
const loading = showLoadingOverlay !== false && (isLoading || showLoadingOverlay);
|
|
2886
2899
|
const [totalToolbarHeight, setTotalToolbarHeight] = react.useState(0);
|
|
2887
|
-
const tableContainerProps = parseFromValuesOrFunc(muiTableContainerProps, {
|
|
2900
|
+
const tableContainerProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableContainerProps, {
|
|
2888
2901
|
table,
|
|
2889
|
-
});
|
|
2890
|
-
const circularProgressProps = parseFromValuesOrFunc(muiCircularProgressProps, { table });
|
|
2902
|
+
})), rest);
|
|
2891
2903
|
useIsomorphicLayoutEffect(() => {
|
|
2892
2904
|
var _a, _b, _c, _d;
|
|
2893
2905
|
const topToolbarHeight = typeof document !== 'undefined'
|
|
@@ -2900,7 +2912,7 @@ const MRT_TableContainer = ({ table, }) => {
|
|
|
2900
2912
|
});
|
|
2901
2913
|
const createModalOpen = createDisplayMode === 'modal' && creatingRow;
|
|
2902
2914
|
const editModalOpen = editDisplayMode === 'modal' && editingRow;
|
|
2903
|
-
return (jsxRuntime.jsxs(TableContainer__default["default"], Object.assign({ "aria-busy": loading, "aria-describedby":
|
|
2915
|
+
return (jsxRuntime.jsxs(TableContainer__default["default"], Object.assign({ "aria-busy": loading, "aria-describedby": loading ? 'mrt-progress' : undefined }, tableContainerProps, { ref: (node) => {
|
|
2904
2916
|
if (node) {
|
|
2905
2917
|
tableContainerRef.current = node;
|
|
2906
2918
|
if (tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.ref) {
|
|
@@ -2912,27 +2924,15 @@ const MRT_TableContainer = ({ table, }) => {
|
|
|
2912
2924
|
? `calc(100vh - ${totalToolbarHeight}px)`
|
|
2913
2925
|
: undefined }, tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.style), sx: (theme) => (Object.assign({ maxHeight: enableStickyHeader
|
|
2914
2926
|
? `clamp(350px, calc(100vh - ${totalToolbarHeight}px), 9999px)`
|
|
2915
|
-
: undefined, maxWidth: '100%', overflow: 'auto', position: 'relative' }, parseFromValuesOrFunc(tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.sx, theme))), children: [loading ? (jsxRuntime.jsx(
|
|
2916
|
-
alignItems: 'center',
|
|
2917
|
-
backgroundColor: styles.alpha(styles.lighten(theme.palette.background.paper, 0.05), 0.5),
|
|
2918
|
-
bottom: 0,
|
|
2919
|
-
display: 'flex',
|
|
2920
|
-
justifyContent: 'center',
|
|
2921
|
-
left: 0,
|
|
2922
|
-
maxHeight: '100vh',
|
|
2923
|
-
position: 'absolute',
|
|
2924
|
-
right: 0,
|
|
2925
|
-
top: 0,
|
|
2926
|
-
width: '100%',
|
|
2927
|
-
zIndex: 2,
|
|
2928
|
-
}), children: jsxRuntime.jsx(CircularProgress__default["default"], Object.assign({ "aria-label": localization.noRecordsToDisplay, id: "mrt-progress" }, circularProgressProps)) })) : null, jsxRuntime.jsx(MRT_Table, { table: table }), (createModalOpen || editModalOpen) && (jsxRuntime.jsx(MRT_EditRowModal, { open: true, table: table }))] })));
|
|
2927
|
+
: undefined, maxWidth: '100%', overflow: 'auto', position: 'relative' }, parseFromValuesOrFunc(tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.sx, theme))), children: [loading ? jsxRuntime.jsx(MRT_TableLoadingOverlay, { table: table }) : null, jsxRuntime.jsx(MRT_Table, { table: table }), (createModalOpen || editModalOpen) && (jsxRuntime.jsx(MRT_EditRowModal, { open: true, table: table }))] })));
|
|
2929
2928
|
};
|
|
2930
2929
|
|
|
2931
|
-
const MRT_TablePaper = (
|
|
2932
|
-
var
|
|
2930
|
+
const MRT_TablePaper = (_a) => {
|
|
2931
|
+
var _b, _c;
|
|
2932
|
+
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
2933
2933
|
const { getState, options: { enableBottomToolbar, enableTopToolbar, muiTablePaperProps, renderBottomToolbar, renderTopToolbar, }, refs: { tablePaperRef }, } = table;
|
|
2934
2934
|
const { isFullScreen } = getState();
|
|
2935
|
-
const tablePaperProps = parseFromValuesOrFunc(muiTablePaperProps, { table });
|
|
2935
|
+
const tablePaperProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTablePaperProps, { table })), rest);
|
|
2936
2936
|
return (jsxRuntime.jsxs(Paper__default["default"], Object.assign({ elevation: 2 }, tablePaperProps, { ref: (ref) => {
|
|
2937
2937
|
tablePaperRef.current = ref;
|
|
2938
2938
|
if (tablePaperProps === null || tablePaperProps === void 0 ? void 0 : tablePaperProps.ref) {
|
|
@@ -2955,11 +2955,12 @@ const MRT_TablePaper = ({ table, }) => {
|
|
|
2955
2955
|
zIndex: 9999,
|
|
2956
2956
|
}
|
|
2957
2957
|
: {})), tablePaperProps === null || tablePaperProps === void 0 ? void 0 : tablePaperProps.style), sx: (theme) => (Object.assign({ overflow: 'hidden', transition: 'all 100ms ease-in-out' }, parseFromValuesOrFunc(tablePaperProps === null || tablePaperProps === void 0 ? void 0 : tablePaperProps.sx, theme))), children: [enableTopToolbar &&
|
|
2958
|
-
((
|
|
2959
|
-
((
|
|
2958
|
+
((_b = parseFromValuesOrFunc(renderTopToolbar, { table })) !== null && _b !== void 0 ? _b : (jsxRuntime.jsx(MRT_TopToolbar, { table: table }))), jsxRuntime.jsx(MRT_TableContainer, { table: table }), enableBottomToolbar &&
|
|
2959
|
+
((_c = parseFromValuesOrFunc(renderBottomToolbar, { table })) !== null && _c !== void 0 ? _c : (jsxRuntime.jsx(MRT_BottomToolbar, { table: table })))] })));
|
|
2960
2960
|
};
|
|
2961
2961
|
|
|
2962
|
-
const MRT_RowPinButton = (
|
|
2962
|
+
const MRT_RowPinButton = (_a) => {
|
|
2963
|
+
var { pinningPosition, row, table } = _a, rest = __rest(_a, ["pinningPosition", "row", "table"]);
|
|
2963
2964
|
const { options: { icons: { CloseIcon, PushPinIcon }, localization, rowPinningDisplayMode, }, } = table;
|
|
2964
2965
|
const isPinned = row.getIsPinned();
|
|
2965
2966
|
const [tooltipOpened, setTooltipOpened] = react.useState(false);
|
|
@@ -2968,42 +2969,43 @@ const MRT_RowPinButton = ({ pinningPosition, row, table, }) => {
|
|
|
2968
2969
|
event.stopPropagation();
|
|
2969
2970
|
row.pin(isPinned ? false : pinningPosition);
|
|
2970
2971
|
};
|
|
2971
|
-
return (jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, open: tooltipOpened, title: isPinned ? localization.unpin : localization.pin, children: jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.pin, onClick: handleTogglePin, onMouseEnter: () => setTooltipOpened(true), onMouseLeave: () => setTooltipOpened(false), size: "small", sx: {
|
|
2972
|
-
height: '24px',
|
|
2973
|
-
width: '24px',
|
|
2974
|
-
}, children: isPinned ? (jsxRuntime.jsx(CloseIcon, {})) : (jsxRuntime.jsx(PushPinIcon, { fontSize: "small", style: {
|
|
2972
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, open: tooltipOpened, title: isPinned ? localization.unpin : localization.pin, children: jsxRuntime.jsx(IconButton__default["default"], Object.assign({ "aria-label": localization.pin, onClick: handleTogglePin, onMouseEnter: () => setTooltipOpened(true), onMouseLeave: () => setTooltipOpened(false), size: "small" }, rest, { sx: (theme) => (Object.assign({ height: '24px', width: '24px' }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))), children: isPinned ? (jsxRuntime.jsx(CloseIcon, {})) : (jsxRuntime.jsx(PushPinIcon, { fontSize: "small", style: {
|
|
2975
2973
|
transform: `rotate(${rowPinningDisplayMode === 'sticky'
|
|
2976
2974
|
? 135
|
|
2977
2975
|
: pinningPosition === 'top'
|
|
2978
2976
|
? 180
|
|
2979
2977
|
: 0}deg)`,
|
|
2980
|
-
} })) }) }));
|
|
2978
|
+
} })) })) }));
|
|
2981
2979
|
};
|
|
2982
2980
|
|
|
2983
|
-
const MRT_TableBodyRowPinButton = (
|
|
2981
|
+
const MRT_TableBodyRowPinButton = (_a) => {
|
|
2982
|
+
var { row, table } = _a, rest = __rest(_a, ["row", "table"]);
|
|
2984
2983
|
const { getState, options: { enableRowPinning, rowPinningDisplayMode }, } = table;
|
|
2985
2984
|
const { density } = getState();
|
|
2986
2985
|
const canPin = parseFromValuesOrFunc(enableRowPinning, row);
|
|
2987
2986
|
if (!canPin)
|
|
2988
2987
|
return null;
|
|
2988
|
+
const rowPinButtonProps = Object.assign({ row,
|
|
2989
|
+
table }, rest);
|
|
2989
2990
|
if (rowPinningDisplayMode === 'top-and-bottom' && !row.getIsPinned()) {
|
|
2990
2991
|
return (jsxRuntime.jsxs(Box__default["default"], { sx: {
|
|
2991
2992
|
display: 'flex',
|
|
2992
2993
|
flexDirection: density === 'compact' ? 'row' : 'column',
|
|
2993
|
-
}, children: [jsxRuntime.jsx(MRT_RowPinButton, { pinningPosition: "top"
|
|
2994
|
+
}, children: [jsxRuntime.jsx(MRT_RowPinButton, Object.assign({ pinningPosition: "top" }, rowPinButtonProps)), jsxRuntime.jsx(MRT_RowPinButton, Object.assign({ pinningPosition: "bottom" }, rowPinButtonProps))] }));
|
|
2994
2995
|
}
|
|
2995
|
-
return (jsxRuntime.jsx(MRT_RowPinButton, { pinningPosition: rowPinningDisplayMode === 'bottom' ? 'bottom' : 'top'
|
|
2996
|
+
return (jsxRuntime.jsx(MRT_RowPinButton, Object.assign({ pinningPosition: rowPinningDisplayMode === 'bottom' ? 'bottom' : 'top' }, rowPinButtonProps)));
|
|
2996
2997
|
};
|
|
2997
2998
|
|
|
2998
|
-
const MRT_ExpandAllButton = (
|
|
2999
|
-
var
|
|
2999
|
+
const MRT_ExpandAllButton = (_a) => {
|
|
3000
|
+
var _b, _c;
|
|
3001
|
+
var { table } = _a, rest = __rest(_a, ["table"]);
|
|
3000
3002
|
const { getCanSomeRowsExpand, getIsAllRowsExpanded, getIsSomeRowsExpanded, getState, options: { icons: { KeyboardDoubleArrowDownIcon }, localization, muiExpandAllButtonProps, renderDetailPanel, }, toggleAllRowsExpanded, } = table;
|
|
3001
3003
|
const { density, isLoading } = getState();
|
|
3002
|
-
const iconButtonProps = parseFromValuesOrFunc(muiExpandAllButtonProps, {
|
|
3004
|
+
const iconButtonProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiExpandAllButtonProps, {
|
|
3003
3005
|
table,
|
|
3004
|
-
});
|
|
3006
|
+
})), rest);
|
|
3005
3007
|
const isAllRowsExpanded = getIsAllRowsExpanded();
|
|
3006
|
-
return (jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: (
|
|
3008
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, enterDelay: 1000, enterNextDelay: 1000, title: (_b = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _b !== void 0 ? _b : (isAllRowsExpanded ? localization.collapseAll : 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', mt: density !== 'compact' ? '-0.25rem' : undefined, width: density === 'compact' ? '1.75rem' : '2.25rem' }, parseFromValuesOrFunc(iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx, theme))), title: undefined, children: (_c = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.children) !== null && _c !== void 0 ? _c : (jsxRuntime.jsx(KeyboardDoubleArrowDownIcon, { style: {
|
|
3007
3009
|
transform: `rotate(${isAllRowsExpanded ? -180 : getIsSomeRowsExpanded() ? -90 : 0}deg)`,
|
|
3008
3010
|
transition: 'transform 150ms',
|
|
3009
3011
|
} })) })) }) }));
|
|
@@ -3031,16 +3033,17 @@ const MRT_ExpandButton = ({ row, table, }) => {
|
|
|
3031
3033
|
} })) })) }) }));
|
|
3032
3034
|
};
|
|
3033
3035
|
|
|
3034
|
-
const MRT_RowActionMenu = (
|
|
3036
|
+
const MRT_RowActionMenu = (_a) => {
|
|
3037
|
+
var { anchorEl, handleEdit, row, setAnchorEl, table } = _a, rest = __rest(_a, ["anchorEl", "handleEdit", "row", "setAnchorEl", "table"]);
|
|
3035
3038
|
const { getState, options: { enableEditing, icons: { EditIcon }, localization, renderRowActionMenuItems, }, } = table;
|
|
3036
3039
|
const { density } = getState();
|
|
3037
|
-
return (jsxRuntime.jsxs(Menu__default["default"], { MenuListProps: {
|
|
3040
|
+
return (jsxRuntime.jsxs(Menu__default["default"], Object.assign({ MenuListProps: {
|
|
3038
3041
|
dense: density === 'compact',
|
|
3039
|
-
}, anchorEl: anchorEl, onClick: (event) => event.stopPropagation(), onClose: () => setAnchorEl(null), open: !!anchorEl, children: [parseFromValuesOrFunc(enableEditing, row) && (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({
|
|
3042
|
+
}, anchorEl: anchorEl, onClick: (event) => event.stopPropagation(), onClose: () => setAnchorEl(null), open: !!anchorEl }, rest, { children: [parseFromValuesOrFunc(enableEditing, row) && (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({
|
|
3040
3043
|
closeMenu: () => setAnchorEl(null),
|
|
3041
3044
|
row,
|
|
3042
3045
|
table,
|
|
3043
|
-
})] }));
|
|
3046
|
+
})] })));
|
|
3044
3047
|
};
|
|
3045
3048
|
|
|
3046
3049
|
const commonIconButtonStyles = {
|
|
@@ -3053,7 +3056,8 @@ const commonIconButtonStyles = {
|
|
|
3053
3056
|
transition: 'opacity 150ms',
|
|
3054
3057
|
width: '2rem',
|
|
3055
3058
|
};
|
|
3056
|
-
const MRT_ToggleRowActionMenuButton = (
|
|
3059
|
+
const MRT_ToggleRowActionMenuButton = (_a) => {
|
|
3060
|
+
var { cell, row, table } = _a, rest = __rest(_a, ["cell", "row", "table"]);
|
|
3057
3061
|
const { getState, options: { createDisplayMode, editDisplayMode, enableEditing, icons: { EditIcon, MoreHorizIcon }, localization, renderRowActionMenuItems, renderRowActions, }, setEditingRow, } = table;
|
|
3058
3062
|
const { creatingRow, editingRow } = getState();
|
|
3059
3063
|
const isCreating = (creatingRow === null || creatingRow === void 0 ? void 0 : creatingRow.id) === row.id;
|
|
@@ -3072,10 +3076,12 @@ const MRT_ToggleRowActionMenuButton = ({ cell, row, table, }) => {
|
|
|
3072
3076
|
setAnchorEl(null);
|
|
3073
3077
|
};
|
|
3074
3078
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: renderRowActions && !showEditActionButtons ? (renderRowActions({ cell, row, table })) : showEditActionButtons ? (jsxRuntime.jsx(MRT_EditActionButtons, { row: row, table: table })) : !renderRowActionMenuItems &&
|
|
3075
|
-
parseFromValuesOrFunc(enableEditing, row)
|
|
3079
|
+
parseFromValuesOrFunc(enableEditing, row) &&
|
|
3080
|
+
['modal', 'row'].includes(editDisplayMode) ? (jsxRuntime.jsx(Tooltip__default["default"], { arrow: true, placement: "right", title: localization.edit, children: jsxRuntime.jsx(IconButton__default["default"], Object.assign({ "aria-label": localization.edit, onClick: handleStartEditMode, sx: commonIconButtonStyles }, rest, { 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"], Object.assign({ "aria-label": localization.rowActions, onClick: handleOpenRowActionMenu, size: "small", sx: commonIconButtonStyles }, rest, { children: jsxRuntime.jsx(MoreHorizIcon, {}) })) }), jsxRuntime.jsx(MRT_RowActionMenu, { anchorEl: anchorEl, handleEdit: handleStartEditMode, row: row, setAnchorEl: setAnchorEl, table: table })] })) : null }));
|
|
3076
3081
|
};
|
|
3077
3082
|
|
|
3078
3083
|
const blankColProps = {
|
|
3084
|
+
children: null,
|
|
3079
3085
|
sx: {
|
|
3080
3086
|
flex: '1 0 auto',
|
|
3081
3087
|
minWidth: 0,
|
|
@@ -3104,7 +3110,7 @@ const useMRT_DisplayColumns = ({ columnOrder, creatingRow, grouping, tableOption
|
|
|
3104
3110
|
((_x = (_w = tableOptions.state) === null || _w === void 0 ? void 0 : _w.columnOrder) !== null && _x !== void 0 ? _x : columnOrder).includes('mrt-row-spacer') && {
|
|
3105
3111
|
columnDefType: 'display',
|
|
3106
3112
|
header: '',
|
|
3107
|
-
id: 'spacer',
|
|
3113
|
+
id: 'mrt-row-spacer',
|
|
3108
3114
|
muiTableBodyCellProps: blankColProps,
|
|
3109
3115
|
muiTableFooterCellProps: blankColProps,
|
|
3110
3116
|
muiTableHeadCellProps: blankColProps,
|
|
@@ -3740,6 +3746,7 @@ exports.MRT_TableHeadCellGrabHandle = MRT_TableHeadCellGrabHandle;
|
|
|
3740
3746
|
exports.MRT_TableHeadCellResizeHandle = MRT_TableHeadCellResizeHandle;
|
|
3741
3747
|
exports.MRT_TableHeadCellSortLabel = MRT_TableHeadCellSortLabel;
|
|
3742
3748
|
exports.MRT_TableHeadRow = MRT_TableHeadRow;
|
|
3749
|
+
exports.MRT_TableLoadingOverlay = MRT_TableLoadingOverlay;
|
|
3743
3750
|
exports.MRT_TablePagination = MRT_TablePagination;
|
|
3744
3751
|
exports.MRT_TablePaper = MRT_TablePaper;
|
|
3745
3752
|
exports.MRT_ToggleDensePaddingButton = MRT_ToggleDensePaddingButton;
|