material-react-table 2.0.0-beta.8 → 2.0.0-rc.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +36 -27
- package/dist/index.d.ts +54 -5
- package/dist/{esm/material-react-table.esm.js → index.esm.js} +79 -83
- package/dist/index.esm.js.map +1 -0
- package/dist/{cjs/index.js → index.js} +298 -208
- package/dist/index.js.map +1 -0
- package/locales/ar/index.js +2 -0
- package/locales/ar/package.json +3 -11
- package/locales/az/index.js +2 -0
- package/locales/az/package.json +3 -11
- package/locales/bg/index.js +2 -0
- package/locales/bg/package.json +3 -11
- package/locales/cs/index.js +2 -0
- package/locales/cs/package.json +3 -11
- package/locales/da/index.js +2 -0
- package/locales/da/package.json +3 -11
- package/locales/de/index.js +2 -0
- package/locales/de/package.json +3 -11
- package/locales/en/index.js +2 -0
- package/locales/en/package.json +3 -11
- package/locales/es/index.js +2 -0
- package/locales/es/package.json +3 -11
- package/locales/et/index.js +2 -0
- package/locales/et/package.json +3 -11
- package/locales/fa/index.js +2 -0
- package/locales/fa/package.json +3 -11
- package/locales/fi/index.js +2 -0
- package/locales/fi/package.json +3 -11
- package/locales/fr/index.js +2 -0
- package/locales/fr/package.json +3 -11
- package/locales/hu/index.js +2 -0
- package/locales/hu/package.json +3 -11
- package/locales/hy/index.js +2 -0
- package/locales/hy/package.json +3 -11
- package/locales/id/index.js +2 -0
- package/locales/id/package.json +3 -11
- package/locales/it/index.js +2 -0
- package/locales/it/package.json +3 -11
- package/locales/ja/index.js +2 -0
- package/locales/ja/package.json +3 -11
- package/locales/ko/index.js +2 -0
- package/locales/ko/package.json +3 -11
- package/locales/nl/index.js +2 -0
- package/locales/nl/package.json +3 -11
- package/locales/no/index.js +2 -0
- package/locales/no/package.json +3 -11
- package/locales/np/index.js +2 -0
- package/locales/np/package.json +3 -11
- package/locales/pl/index.js +2 -0
- package/locales/pl/package.json +3 -11
- package/locales/pt/index.js +2 -0
- package/locales/pt/package.json +3 -11
- package/locales/pt-BR/index.js +2 -0
- package/locales/pt-BR/package.json +3 -11
- package/locales/ro/index.js +2 -0
- package/locales/ro/package.json +3 -11
- package/locales/ru/index.js +2 -0
- package/locales/ru/package.json +3 -11
- package/locales/sk/index.js +2 -0
- package/locales/sk/package.json +3 -11
- package/locales/sr-Cyrl-RS/index.js +2 -0
- package/locales/sr-Cyrl-RS/package.json +3 -11
- package/locales/sr-Latn-RS/index.js +2 -0
- package/locales/sr-Latn-RS/package.json +3 -11
- package/locales/sv/index.js +2 -0
- package/locales/sv/package.json +3 -11
- package/locales/tr/index.js +2 -0
- package/locales/tr/package.json +3 -11
- package/locales/uk/index.js +2 -0
- package/locales/uk/package.json +3 -11
- package/locales/vi/index.js +2 -0
- package/locales/vi/package.json +3 -11
- package/locales/zh-Hans/index.esm.js +18 -18
- package/locales/zh-Hans/index.js +20 -18
- package/locales/zh-Hans/package.json +3 -11
- package/locales/zh-Hant/index.js +2 -0
- package/locales/zh-Hant/package.json +3 -11
- package/package.json +25 -36
- package/src/body/MRT_TableBodyCell.tsx +2 -2
- package/src/buttons/MRT_ColumnPinningButtons.tsx +3 -3
- package/src/buttons/MRT_CopyButton.tsx +0 -1
- package/src/buttons/MRT_EditActionButtons.tsx +2 -2
- package/src/buttons/MRT_ExpandAllButton.tsx +0 -1
- package/src/buttons/MRT_ExpandButton.tsx +0 -1
- package/src/buttons/MRT_GrabHandleButton.tsx +0 -1
- package/src/buttons/MRT_RowPinButton.tsx +0 -1
- package/src/buttons/MRT_ShowHideColumnsButton.tsx +1 -1
- package/src/buttons/MRT_ToggleDensePaddingButton.tsx +1 -1
- package/src/buttons/MRT_ToggleFiltersButton.tsx +1 -1
- package/src/buttons/MRT_ToggleFullScreenButton.tsx +0 -1
- package/src/buttons/MRT_ToggleGlobalFilterButton.tsx +1 -1
- package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +1 -2
- package/src/column.utils.ts +17 -0
- package/src/head/MRT_TableHeadCellColumnActionsButton.tsx +0 -1
- package/src/head/MRT_TableHeadCellFilterLabel.tsx +1 -1
- package/src/head/MRT_TableHeadCellSortLabel.tsx +1 -1
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useMRT_TableOptions.ts +2 -2
- package/src/index.ts +1 -0
- package/src/inputs/MRT_EditCellTextField.tsx +20 -30
- package/src/inputs/MRT_FilterCheckbox.tsx +0 -1
- package/src/inputs/MRT_FilterTextField.tsx +41 -53
- package/src/inputs/MRT_GlobalFilterTextField.tsx +2 -2
- package/src/inputs/MRT_SelectCheckbox.tsx +0 -1
- package/src/locales/zh-Hans.ts +18 -18
- package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +0 -1
- package/src/table/MRT_TablePaper.tsx +6 -6
- package/src/types.ts +23 -4
- package/dist/cjs/index.js.map +0 -1
- package/dist/esm/material-react-table.esm.js.map +0 -1
- package/locales/ar.js +0 -93
- package/locales/az.js +0 -93
- package/locales/bg.js +0 -93
- package/locales/cs.js +0 -93
- package/locales/da.js +0 -93
- package/locales/de.js +0 -93
- package/locales/en.js +0 -93
- package/locales/es.js +0 -93
- package/locales/et.js +0 -93
- package/locales/fa.js +0 -93
- package/locales/fi.js +0 -93
- package/locales/fr.js +0 -93
- package/locales/hu.js +0 -93
- package/locales/hy.js +0 -93
- package/locales/id.js +0 -93
- package/locales/it.js +0 -93
- package/locales/ja.js +0 -93
- package/locales/ko.js +0 -93
- package/locales/nl.js +0 -93
- package/locales/no.js +0 -93
- package/locales/np.js +0 -93
- package/locales/pl.js +0 -93
- package/locales/pt-BR.js +0 -93
- package/locales/pt.js +0 -93
- package/locales/ro.js +0 -93
- package/locales/ru.js +0 -93
- package/locales/sk.js +0 -93
- package/locales/sr-Cyrl-RS.js +0 -93
- package/locales/sr-Latn-RS.js +0 -93
- package/locales/sv.js +0 -93
- package/locales/tr.js +0 -93
- package/locales/uk.js +0 -93
- package/locales/vi.js +0 -93
- package/locales/zh-Hans.js +0 -93
- package/locales/zh-Hant.js +0 -93
@@ -1,5 +1,7 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
3
5
|
var jsxRuntime = require('react/jsx-runtime');
|
4
6
|
var Paper = require('@mui/material/Paper');
|
5
7
|
var react = require('react');
|
@@ -92,6 +94,91 @@ var SyncAltIcon = require('@mui/icons-material/SyncAlt');
|
|
92
94
|
var ViewColumnIcon = require('@mui/icons-material/ViewColumn');
|
93
95
|
var VisibilityOffIcon = require('@mui/icons-material/VisibilityOff');
|
94
96
|
|
97
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
98
|
+
|
99
|
+
var Paper__default = /*#__PURE__*/_interopDefaultLegacy(Paper);
|
100
|
+
var TableContainer__default = /*#__PURE__*/_interopDefaultLegacy(TableContainer);
|
101
|
+
var Table__default = /*#__PURE__*/_interopDefaultLegacy(Table);
|
102
|
+
var TableBody__default = /*#__PURE__*/_interopDefaultLegacy(TableBody);
|
103
|
+
var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
|
104
|
+
var TableRow__default = /*#__PURE__*/_interopDefaultLegacy(TableRow);
|
105
|
+
var Skeleton__default = /*#__PURE__*/_interopDefaultLegacy(Skeleton);
|
106
|
+
var TableCell__default = /*#__PURE__*/_interopDefaultLegacy(TableCell);
|
107
|
+
var Box__default = /*#__PURE__*/_interopDefaultLegacy(Box);
|
108
|
+
var highlightWords__default = /*#__PURE__*/_interopDefaultLegacy(highlightWords);
|
109
|
+
var IconButton__default = /*#__PURE__*/_interopDefaultLegacy(IconButton);
|
110
|
+
var Tooltip__default = /*#__PURE__*/_interopDefaultLegacy(Tooltip);
|
111
|
+
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
112
|
+
var MenuItem__default = /*#__PURE__*/_interopDefaultLegacy(MenuItem);
|
113
|
+
var TextField__default = /*#__PURE__*/_interopDefaultLegacy(TextField);
|
114
|
+
var Collapse__default = /*#__PURE__*/_interopDefaultLegacy(Collapse);
|
115
|
+
var TableFooter__default = /*#__PURE__*/_interopDefaultLegacy(TableFooter);
|
116
|
+
var TableHead__default = /*#__PURE__*/_interopDefaultLegacy(TableHead);
|
117
|
+
var ListItemIcon__default = /*#__PURE__*/_interopDefaultLegacy(ListItemIcon);
|
118
|
+
var Menu__default = /*#__PURE__*/_interopDefaultLegacy(Menu);
|
119
|
+
var Checkbox__default = /*#__PURE__*/_interopDefaultLegacy(Checkbox);
|
120
|
+
var FormControlLabel__default = /*#__PURE__*/_interopDefaultLegacy(FormControlLabel);
|
121
|
+
var Autocomplete__default = /*#__PURE__*/_interopDefaultLegacy(Autocomplete);
|
122
|
+
var Chip__default = /*#__PURE__*/_interopDefaultLegacy(Chip);
|
123
|
+
var InputAdornment__default = /*#__PURE__*/_interopDefaultLegacy(InputAdornment);
|
124
|
+
var FormHelperText__default = /*#__PURE__*/_interopDefaultLegacy(FormHelperText);
|
125
|
+
var Slider__default = /*#__PURE__*/_interopDefaultLegacy(Slider);
|
126
|
+
var Stack__default = /*#__PURE__*/_interopDefaultLegacy(Stack);
|
127
|
+
var Grow__default = /*#__PURE__*/_interopDefaultLegacy(Grow);
|
128
|
+
var Popover__default = /*#__PURE__*/_interopDefaultLegacy(Popover);
|
129
|
+
var Divider__default = /*#__PURE__*/_interopDefaultLegacy(Divider);
|
130
|
+
var Badge__default = /*#__PURE__*/_interopDefaultLegacy(Badge);
|
131
|
+
var TableSortLabel__default = /*#__PURE__*/_interopDefaultLegacy(TableSortLabel);
|
132
|
+
var useMediaQuery__default = /*#__PURE__*/_interopDefaultLegacy(useMediaQuery);
|
133
|
+
var LinearProgress__default = /*#__PURE__*/_interopDefaultLegacy(LinearProgress);
|
134
|
+
var InputLabel__default = /*#__PURE__*/_interopDefaultLegacy(InputLabel);
|
135
|
+
var Pagination__default = /*#__PURE__*/_interopDefaultLegacy(Pagination);
|
136
|
+
var PaginationItem__default = /*#__PURE__*/_interopDefaultLegacy(PaginationItem);
|
137
|
+
var Select__default = /*#__PURE__*/_interopDefaultLegacy(Select);
|
138
|
+
var Alert__default = /*#__PURE__*/_interopDefaultLegacy(Alert);
|
139
|
+
var AlertTitle__default = /*#__PURE__*/_interopDefaultLegacy(AlertTitle);
|
140
|
+
var Radio__default = /*#__PURE__*/_interopDefaultLegacy(Radio);
|
141
|
+
var Fade__default = /*#__PURE__*/_interopDefaultLegacy(Fade);
|
142
|
+
var Switch__default = /*#__PURE__*/_interopDefaultLegacy(Switch);
|
143
|
+
var CircularProgress__default = /*#__PURE__*/_interopDefaultLegacy(CircularProgress);
|
144
|
+
var Dialog__default = /*#__PURE__*/_interopDefaultLegacy(Dialog);
|
145
|
+
var DialogActions__default = /*#__PURE__*/_interopDefaultLegacy(DialogActions);
|
146
|
+
var DialogContent__default = /*#__PURE__*/_interopDefaultLegacy(DialogContent);
|
147
|
+
var DialogTitle__default = /*#__PURE__*/_interopDefaultLegacy(DialogTitle);
|
148
|
+
var ArrowDownwardIcon__default = /*#__PURE__*/_interopDefaultLegacy(ArrowDownwardIcon);
|
149
|
+
var ArrowRightIcon__default = /*#__PURE__*/_interopDefaultLegacy(ArrowRightIcon);
|
150
|
+
var CancelIcon__default = /*#__PURE__*/_interopDefaultLegacy(CancelIcon);
|
151
|
+
var ChevronLeftIcon__default = /*#__PURE__*/_interopDefaultLegacy(ChevronLeftIcon);
|
152
|
+
var ChevronRightIcon__default = /*#__PURE__*/_interopDefaultLegacy(ChevronRightIcon);
|
153
|
+
var ClearAllIcon__default = /*#__PURE__*/_interopDefaultLegacy(ClearAllIcon);
|
154
|
+
var CloseIcon__default = /*#__PURE__*/_interopDefaultLegacy(CloseIcon);
|
155
|
+
var DensityLargeIcon__default = /*#__PURE__*/_interopDefaultLegacy(DensityLargeIcon);
|
156
|
+
var DensityMediumIcon__default = /*#__PURE__*/_interopDefaultLegacy(DensityMediumIcon);
|
157
|
+
var DensitySmallIcon__default = /*#__PURE__*/_interopDefaultLegacy(DensitySmallIcon);
|
158
|
+
var DragHandleIcon__default = /*#__PURE__*/_interopDefaultLegacy(DragHandleIcon);
|
159
|
+
var DynamicFeedIcon__default = /*#__PURE__*/_interopDefaultLegacy(DynamicFeedIcon);
|
160
|
+
var EditIcon__default = /*#__PURE__*/_interopDefaultLegacy(EditIcon);
|
161
|
+
var ExpandMoreIcon__default = /*#__PURE__*/_interopDefaultLegacy(ExpandMoreIcon);
|
162
|
+
var FilterAltIcon__default = /*#__PURE__*/_interopDefaultLegacy(FilterAltIcon);
|
163
|
+
var FilterListIcon__default = /*#__PURE__*/_interopDefaultLegacy(FilterListIcon);
|
164
|
+
var FilterListOffIcon__default = /*#__PURE__*/_interopDefaultLegacy(FilterListOffIcon);
|
165
|
+
var FirstPageIcon__default = /*#__PURE__*/_interopDefaultLegacy(FirstPageIcon);
|
166
|
+
var FullscreenIcon__default = /*#__PURE__*/_interopDefaultLegacy(FullscreenIcon);
|
167
|
+
var FullscreenExitIcon__default = /*#__PURE__*/_interopDefaultLegacy(FullscreenExitIcon);
|
168
|
+
var KeyboardDoubleArrowDownIcon__default = /*#__PURE__*/_interopDefaultLegacy(KeyboardDoubleArrowDownIcon);
|
169
|
+
var LastPageIcon__default = /*#__PURE__*/_interopDefaultLegacy(LastPageIcon);
|
170
|
+
var MoreHorizIcon__default = /*#__PURE__*/_interopDefaultLegacy(MoreHorizIcon);
|
171
|
+
var MoreVertIcon__default = /*#__PURE__*/_interopDefaultLegacy(MoreVertIcon);
|
172
|
+
var PushPinIcon__default = /*#__PURE__*/_interopDefaultLegacy(PushPinIcon);
|
173
|
+
var RestartAltIcon__default = /*#__PURE__*/_interopDefaultLegacy(RestartAltIcon);
|
174
|
+
var SaveIcon__default = /*#__PURE__*/_interopDefaultLegacy(SaveIcon);
|
175
|
+
var SearchIcon__default = /*#__PURE__*/_interopDefaultLegacy(SearchIcon);
|
176
|
+
var SearchOffIcon__default = /*#__PURE__*/_interopDefaultLegacy(SearchOffIcon);
|
177
|
+
var SortIcon__default = /*#__PURE__*/_interopDefaultLegacy(SortIcon);
|
178
|
+
var SyncAltIcon__default = /*#__PURE__*/_interopDefaultLegacy(SyncAltIcon);
|
179
|
+
var ViewColumnIcon__default = /*#__PURE__*/_interopDefaultLegacy(ViewColumnIcon);
|
180
|
+
var VisibilityOffIcon__default = /*#__PURE__*/_interopDefaultLegacy(VisibilityOffIcon);
|
181
|
+
|
95
182
|
/******************************************************************************
|
96
183
|
Copyright (c) Microsoft Corporation.
|
97
184
|
|
@@ -105,20 +192,23 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
105
192
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
106
193
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
107
194
|
PERFORMANCE OF THIS SOFTWARE.
|
108
|
-
***************************************************************************** */
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
}
|
119
|
-
|
120
|
-
|
121
|
-
|
195
|
+
***************************************************************************** */
|
196
|
+
|
197
|
+
function __rest(s, e) {
|
198
|
+
var t = {};
|
199
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
200
|
+
t[p] = s[p];
|
201
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
202
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
203
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
204
|
+
t[p[i]] = s[p[i]];
|
205
|
+
}
|
206
|
+
return t;
|
207
|
+
}
|
208
|
+
|
209
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
210
|
+
var e = new Error(message);
|
211
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
122
212
|
};
|
123
213
|
|
124
214
|
const getColumnId = (columnDef) => { var _a, _b, _c, _d; return (_d = (_a = columnDef.id) !== null && _a !== void 0 ? _a : (_c = (_b = columnDef.accessorKey) === null || _b === void 0 ? void 0 : _b.toString) === null || _c === void 0 ? void 0 : _c.call(_b)) !== null && _d !== void 0 ? _d : columnDef.header; };
|
@@ -314,6 +404,22 @@ function createMRTColumnHelper() {
|
|
314
404
|
group: (column) => column,
|
315
405
|
};
|
316
406
|
}
|
407
|
+
const getValueAndLabel = (option) => {
|
408
|
+
var _a, _b, _c;
|
409
|
+
let label = '';
|
410
|
+
let value = '';
|
411
|
+
if (option) {
|
412
|
+
if (typeof option !== 'object') {
|
413
|
+
label = option;
|
414
|
+
value = option;
|
415
|
+
}
|
416
|
+
else {
|
417
|
+
label = (_b = (_a = option.label) !== null && _a !== void 0 ? _a : option.text) !== null && _b !== void 0 ? _b : option.value;
|
418
|
+
value = (_c = option.value) !== null && _c !== void 0 ? _c : label;
|
419
|
+
}
|
420
|
+
}
|
421
|
+
return { label, value };
|
422
|
+
};
|
317
423
|
|
318
424
|
const parseCSSVarId = (id) => id.replace(/[^a-zA-Z0-9]/g, '_');
|
319
425
|
const getMRTTheme = (table, theme) => (Object.assign({ baseBackgroundColor: theme.palette.mode === 'dark'
|
@@ -415,13 +521,13 @@ const MRT_TableBodyCellValue = ({ cell, table, }) => {
|
|
415
521
|
(globalFilter &&
|
416
522
|
allowedTypes.includes(typeof globalFilter) &&
|
417
523
|
column.getCanGlobalFilter()))) {
|
418
|
-
const chunks =
|
524
|
+
const chunks = highlightWords__default["default"] === null || highlightWords__default["default"] === void 0 ? void 0 : highlightWords__default["default"]({
|
419
525
|
matchExactly: (filterValue ? columnDef._filterFn : globalFilterFn) !== 'fuzzy',
|
420
526
|
query: ((_a = filterValue !== null && filterValue !== void 0 ? filterValue : globalFilter) !== null && _a !== void 0 ? _a : '').toString(),
|
421
527
|
text: renderedCellValue === null || renderedCellValue === void 0 ? void 0 : renderedCellValue.toString(),
|
422
528
|
});
|
423
529
|
if ((chunks === null || chunks === void 0 ? void 0 : chunks.length) > 1 || ((_b = chunks === null || chunks === void 0 ? void 0 : chunks[0]) === null || _b === void 0 ? void 0 : _b.match)) {
|
424
|
-
renderedCellValue = (jsxRuntime.jsx("span", { "aria-label": renderedCellValue, role: "note", children: (_c = chunks === null || chunks === void 0 ? void 0 : chunks.map(({ key, match, text }) => (jsxRuntime.jsx(
|
530
|
+
renderedCellValue = (jsxRuntime.jsx("span", { "aria-label": renderedCellValue, role: "note", children: (_c = chunks === null || chunks === void 0 ? void 0 : chunks.map(({ key, match, text }) => (jsxRuntime.jsx(Box__default["default"], { "aria-hidden": "true", component: "span", sx: match
|
425
531
|
? {
|
426
532
|
backgroundColor: (theme) => getMRTTheme(table, theme).matchHighlightColor,
|
427
533
|
borderRadius: '2px',
|
@@ -450,7 +556,7 @@ const MRT_GrabHandleButton = (_a) => {
|
|
450
556
|
var { iconButtonProps, location, onDragEnd, onDragStart, table } = _a, rest = __rest(_a, ["iconButtonProps", "location", "onDragEnd", "onDragStart", "table"]);
|
451
557
|
const { options: { icons: { DragHandleIcon }, localization, }, } = table;
|
452
558
|
const _iconButtonProps = Object.assign(Object.assign({}, iconButtonProps), rest);
|
453
|
-
return (jsxRuntime.jsx(
|
559
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { 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) => {
|
454
560
|
var _a;
|
455
561
|
e.stopPropagation();
|
456
562
|
(_a = _iconButtonProps === null || _iconButtonProps === void 0 ? void 0 : _iconButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(_iconButtonProps, e);
|
@@ -508,7 +614,7 @@ const MRT_CopyButton = (_a) => {
|
|
508
614
|
row,
|
509
615
|
table,
|
510
616
|
})), rest);
|
511
|
-
return (jsxRuntime.jsx(
|
617
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { 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 })) }));
|
512
618
|
};
|
513
619
|
|
514
620
|
const MRT_EditCellTextField = (_a) => {
|
@@ -537,10 +643,10 @@ const MRT_EditCellTextField = (_a) => {
|
|
537
643
|
//@ts-ignore
|
538
644
|
row._valuesCache[column.id] = newValue;
|
539
645
|
if (isCreating) {
|
540
|
-
setCreatingRow(
|
646
|
+
setCreatingRow(row);
|
541
647
|
}
|
542
648
|
else if (isEditing) {
|
543
|
-
setEditingRow(
|
649
|
+
setEditingRow(row);
|
544
650
|
}
|
545
651
|
};
|
546
652
|
const handleChange = (event) => {
|
@@ -567,7 +673,7 @@ const MRT_EditCellTextField = (_a) => {
|
|
567
673
|
if (columnDef.Edit) {
|
568
674
|
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: (_b = columnDef.Edit) === null || _b === void 0 ? void 0 : _b.call(columnDef, { cell, column, row, table }) });
|
569
675
|
}
|
570
|
-
return (jsxRuntime.jsx(
|
676
|
+
return (jsxRuntime.jsx(TextField__default["default"], Object.assign({ disabled: parseFromValuesOrFunc(columnDef.enableEditing, row) === false, fullWidth: true, inputRef: (inputRef) => {
|
571
677
|
if (inputRef) {
|
572
678
|
editInputRefs.current[column.id] = inputRef;
|
573
679
|
if (textFieldProps.inputRef) {
|
@@ -586,22 +692,13 @@ const MRT_EditCellTextField = (_a) => {
|
|
586
692
|
e.stopPropagation();
|
587
693
|
(_a = textFieldProps === null || textFieldProps === void 0 ? void 0 : textFieldProps.onClick) === null || _a === void 0 ? void 0 : _a.call(textFieldProps, e);
|
588
694
|
}, onKeyDown: handleEnterKeyDown, children: (_c = textFieldProps.children) !== null && _c !== void 0 ? _c : (_d = columnDef === null || columnDef === void 0 ? void 0 : columnDef.editSelectOptions) === null || _d === void 0 ? void 0 : _d.map((option) => {
|
589
|
-
|
590
|
-
|
591
|
-
if (typeof option !== 'object') {
|
592
|
-
value = option;
|
593
|
-
text = option;
|
594
|
-
}
|
595
|
-
else {
|
596
|
-
value = option.value;
|
597
|
-
text = option.text;
|
598
|
-
}
|
599
|
-
return (jsxRuntime.jsx(MenuItem, { sx: {
|
695
|
+
const { label, value } = getValueAndLabel(option);
|
696
|
+
return (jsxRuntime.jsx(MenuItem__default["default"], { sx: {
|
600
697
|
alignItems: 'center',
|
601
698
|
display: 'flex',
|
602
699
|
gap: '0.5rem',
|
603
700
|
m: 0,
|
604
|
-
}, value: value, children:
|
701
|
+
}, value: value, children: label }, value));
|
605
702
|
}) })));
|
606
703
|
};
|
607
704
|
|
@@ -609,7 +706,7 @@ const MRT_TableBodyCell = (_a) => {
|
|
609
706
|
var _b, _c, _d, _e, _f;
|
610
707
|
var { cell, measureElement, numRows, rowIndex, rowRef, table, virtualIndex } = _a, rest = __rest(_a, ["cell", "measureElement", "numRows", "rowIndex", "rowRef", "table", "virtualIndex"]);
|
611
708
|
const theme = styles.useTheme();
|
612
|
-
const { getState, options: { createDisplayMode, editDisplayMode, enableClickToCopy, enableColumnOrdering, enableEditing, enableGrouping, enableRowNumbers, layoutMode, muiSkeletonProps, muiTableBodyCellProps,
|
709
|
+
const { getState, options: { createDisplayMode, editDisplayMode, enableClickToCopy, enableColumnOrdering, enableEditing, enableGrouping, enableRowNumbers, layoutMode, muiSkeletonProps, muiTableBodyCellProps, rowNumberDisplayMode, }, refs: { editInputRefs }, setEditingCell, setHoveredColumn, } = table;
|
613
710
|
const { columnSizingInfo, creatingRow, density, draggingColumn, draggingRow, editingCell, editingRow, hoveredColumn, hoveredRow, isLoading, showSkeletons, } = getState();
|
614
711
|
const { column, row } = cell;
|
615
712
|
const { columnDef } = column;
|
@@ -712,7 +809,7 @@ const MRT_TableBodyCell = (_a) => {
|
|
712
809
|
setHoveredColumn(columnDef.enableColumnOrdering !== false ? column : null);
|
713
810
|
}
|
714
811
|
};
|
715
|
-
return (jsxRuntime.jsx(
|
812
|
+
return (jsxRuntime.jsx(TableCell__default["default"], Object.assign({ "data-index": virtualIndex, ref: (node) => {
|
716
813
|
if (node) {
|
717
814
|
measureElement === null || measureElement === void 0 ? void 0 : measureElement(node);
|
718
815
|
}
|
@@ -746,8 +843,8 @@ const MRT_TableBodyCell = (_a) => {
|
|
746
843
|
table,
|
747
844
|
tableCellProps,
|
748
845
|
theme,
|
749
|
-
})), 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(
|
750
|
-
|
846
|
+
})), 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 &&
|
847
|
+
rowNumberDisplayMode === 'static' &&
|
751
848
|
column.id === 'mrt-row-numbers' ? (rowIndex + 1) : column.id === 'mrt-row-drag' ? (jsxRuntime.jsx(MRT_TableBodyRowGrabHandle, { row: row, rowRef: rowRef, table: table })) : columnDefType === 'display' &&
|
752
849
|
(column.id === 'mrt-row-select' ||
|
753
850
|
column.id === 'mrt-row-expand' ||
|
@@ -776,16 +873,16 @@ const MRT_TableDetailPanel = (_a) => {
|
|
776
873
|
row,
|
777
874
|
table,
|
778
875
|
})), rest);
|
779
|
-
return (jsxRuntime.jsx(
|
876
|
+
return (jsxRuntime.jsx(TableRow__default["default"], Object.assign({ className: "Mui-TableBodyCell-DetailPanel" }, tableRowProps, { sx: (theme) => {
|
780
877
|
var _a, _b;
|
781
878
|
return (Object.assign({ display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'flex' : undefined, position: virtualRow ? 'absolute' : undefined, top: virtualRow
|
782
879
|
? `${(_b = (_a = parentRowRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.height}px`
|
783
880
|
: undefined, transform: virtualRow
|
784
881
|
? `translateY(${virtualRow === null || virtualRow === void 0 ? void 0 : virtualRow.start}px)`
|
785
882
|
: undefined, width: '100%', zIndex: virtualRow ? 2 : undefined }, parseFromValuesOrFunc(tableRowProps === null || tableRowProps === void 0 ? void 0 : tableRowProps.sx, theme)));
|
786
|
-
}, children: jsxRuntime.jsx(
|
883
|
+
}, children: jsxRuntime.jsx(TableCell__default["default"], Object.assign({ className: "Mui-TableBodyCell-DetailPanel", colSpan: getVisibleLeafColumns().length }, tableCellProps, { sx: (theme) => (Object.assign({ backgroundColor: virtualRow
|
787
884
|
? getMRTTheme(table, theme).baseBackgroundColor
|
788
|
-
: 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(
|
885
|
+
: 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 }) })) })) })));
|
789
886
|
};
|
790
887
|
|
791
888
|
const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, pinnedRowIds, row, rowIndex, table, virtualColumns, virtualPaddingLeft, virtualPaddingRight, virtualRow, }) => {
|
@@ -826,7 +923,7 @@ const MRT_TableBodyRow = ({ columnVirtualizer, measureElement, numRows, pinnedRo
|
|
826
923
|
};
|
827
924
|
const rowRef = react.useRef(null);
|
828
925
|
const { baseBackgroundColor, pinnedRowBackgroundColor, selectedRowBackgroundColor, } = getMRTTheme(table, theme);
|
829
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(
|
926
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(TableRow__default["default"], Object.assign({ "data-index": virtualRow === null || virtualRow === void 0 ? void 0 : virtualRow.index, "data-pinned": !!isPinned || undefined, "data-selected": row.getIsSelected() || undefined, onDragEnter: handleDragEnter, ref: (node) => {
|
830
927
|
if (node) {
|
831
928
|
rowRef.current = node;
|
832
929
|
measureElement === null || measureElement === void 0 ? void 0 : measureElement(node);
|
@@ -978,7 +1075,7 @@ const MRT_TableBody = (_a) => {
|
|
978
1075
|
? rowVirtualizer.getVirtualItems()
|
979
1076
|
: undefined;
|
980
1077
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!(rowPinningDisplayMode === null || rowPinningDisplayMode === void 0 ? void 0 : rowPinningDisplayMode.includes('sticky')) &&
|
981
|
-
getIsSomeRowsPinned('top') && (jsxRuntime.jsx(
|
1078
|
+
getIsSomeRowsPinned('top') && (jsxRuntime.jsx(TableBody__default["default"], Object.assign({}, tableBodyProps, { sx: (theme) => (Object.assign({ display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined, position: 'sticky', top: tableHeadHeight - 1, zIndex: 1 }, parseFromValuesOrFunc(tableBodyProps === null || tableBodyProps === void 0 ? void 0 : tableBodyProps.sx, theme))), children: getTopRows().map((row, rowIndex) => {
|
982
1079
|
const props = {
|
983
1080
|
columnVirtualizer,
|
984
1081
|
measureElement: rowVirtualizer === null || rowVirtualizer === void 0 ? void 0 : rowVirtualizer.measureElement,
|
@@ -991,13 +1088,13 @@ const MRT_TableBody = (_a) => {
|
|
991
1088
|
virtualPaddingRight,
|
992
1089
|
};
|
993
1090
|
return memoMode === 'rows' ? (jsxRuntime.jsx(Memo_MRT_TableBodyRow, Object.assign({}, props), row.id)) : (jsxRuntime.jsx(MRT_TableBodyRow, Object.assign({}, props), row.id));
|
994
|
-
}) }))), jsxRuntime.jsxs(
|
1091
|
+
}) }))), 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
|
995
1092
|
? `${rowVirtualizer.getTotalSize()}px`
|
996
1093
|
: '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: {
|
997
1094
|
display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined,
|
998
1095
|
}, children: jsxRuntime.jsx("td", { colSpan: table.getVisibleLeafColumns().length, style: {
|
999
1096
|
display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined,
|
1000
|
-
}, children: (_e = renderEmptyRowsFallback === null || renderEmptyRowsFallback === void 0 ? void 0 : renderEmptyRowsFallback({ table })) !== null && _e !== void 0 ? _e : (jsxRuntime.jsx(
|
1097
|
+
}, children: (_e = renderEmptyRowsFallback === null || renderEmptyRowsFallback === void 0 ? void 0 : renderEmptyRowsFallback({ table })) !== null && _e !== void 0 ? _e : (jsxRuntime.jsx(Typography__default["default"], { sx: {
|
1001
1098
|
color: 'text.secondary',
|
1002
1099
|
fontStyle: 'italic',
|
1003
1100
|
maxWidth: `min(100vw, ${(_g = (_f = tablePaperRef.current) === null || _f === void 0 ? void 0 : _f.clientWidth) !== null && _g !== void 0 ? _g : 360}px)`,
|
@@ -1027,7 +1124,7 @@ const MRT_TableBody = (_a) => {
|
|
1027
1124
|
};
|
1028
1125
|
return memoMode === 'rows' ? (jsxRuntime.jsx(Memo_MRT_TableBodyRow, Object.assign({}, props), row.id)) : (jsxRuntime.jsx(MRT_TableBodyRow, Object.assign({}, props), row.id));
|
1029
1126
|
}) })))] })), !(rowPinningDisplayMode === null || rowPinningDisplayMode === void 0 ? void 0 : rowPinningDisplayMode.includes('sticky')) &&
|
1030
|
-
getIsSomeRowsPinned('bottom') && (jsxRuntime.jsx(
|
1127
|
+
getIsSomeRowsPinned('bottom') && (jsxRuntime.jsx(TableBody__default["default"], Object.assign({}, tableBodyProps, { sx: (theme) => (Object.assign({ bottom: tableFooterHeight - 1, display: (layoutMode === null || layoutMode === void 0 ? void 0 : layoutMode.startsWith('grid')) ? 'grid' : undefined, position: 'sticky', zIndex: 1 }, parseFromValuesOrFunc(tableBodyProps === null || tableBodyProps === void 0 ? void 0 : tableBodyProps.sx, theme))), children: getBottomRows().map((row, rowIndex) => {
|
1031
1128
|
const props = {
|
1032
1129
|
columnVirtualizer,
|
1033
1130
|
measureElement: rowVirtualizer === null || rowVirtualizer === void 0 ? void 0 : rowVirtualizer.measureElement,
|
@@ -1054,7 +1151,7 @@ const MRT_TableFooterCell = (_a) => {
|
|
1054
1151
|
const { columnDefType } = columnDef;
|
1055
1152
|
const args = { column, table };
|
1056
1153
|
const tableCellProps = Object.assign(Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableFooterCellProps, args)), parseFromValuesOrFunc(columnDef.muiTableFooterCellProps, args)), rest);
|
1057
|
-
return (jsxRuntime.jsx(
|
1154
|
+
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'
|
1058
1155
|
? '0.5rem'
|
1059
1156
|
: density === 'comfortable'
|
1060
1157
|
? '1rem'
|
@@ -1085,7 +1182,7 @@ const MRT_TableFooterRow = (_a) => {
|
|
1085
1182
|
footerGroup,
|
1086
1183
|
table,
|
1087
1184
|
})), rest);
|
1088
|
-
return (jsxRuntime.jsxs(
|
1185
|
+
return (jsxRuntime.jsxs(TableRow__default["default"], Object.assign({}, tableRowProps, { sx: (theme) => (Object.assign({ backgroundColor: getMRTTheme(table, theme).baseBackgroundColor, 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) => {
|
1089
1186
|
const footer = virtualColumns
|
1090
1187
|
? footerGroup.headers[footerOrVirtualFooter.index]
|
1091
1188
|
: footerOrVirtualFooter;
|
@@ -1101,7 +1198,7 @@ const MRT_TableFooter = (_a) => {
|
|
1101
1198
|
table,
|
1102
1199
|
})), rest);
|
1103
1200
|
const stickFooter = (isFullScreen || enableStickyFooter) && enableStickyFooter !== false;
|
1104
|
-
return (jsxRuntime.jsx(
|
1201
|
+
return (jsxRuntime.jsx(TableFooter__default["default"], Object.assign({}, tableFooterProps, { ref: (ref) => {
|
1105
1202
|
tableFooterRef.current = ref;
|
1106
1203
|
if (tableFooterProps === null || tableFooterProps === void 0 ? void 0 : tableFooterProps.ref) {
|
1107
1204
|
// @ts-ignore
|
@@ -1286,7 +1383,7 @@ const MRT_FilterOptionMenu = (_a) => {
|
|
1286
1383
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect();
|
1287
1384
|
};
|
1288
1385
|
const filterOption = !!header && columnDef ? columnDef._filterFn : globalFilterFn;
|
1289
|
-
return (jsxRuntime.jsx(
|
1386
|
+
return (jsxRuntime.jsx(Menu__default["default"], Object.assign({ MenuListProps: {
|
1290
1387
|
dense: density === 'compact',
|
1291
1388
|
}, anchorEl: anchorEl, anchorOrigin: { horizontal: 'right', vertical: 'center' }, onClose: () => setAnchorEl(null), open: !!anchorEl }, rest, { children: (_e = (header && column && columnDef
|
1292
1389
|
? (_d = (_c = columnDef.renderColumnFilterModeMenuItems) === null || _c === void 0 ? void 0 : _c.call(columnDef, {
|
@@ -1304,13 +1401,13 @@ const MRT_FilterOptionMenu = (_a) => {
|
|
1304
1401
|
internalFilterOptions,
|
1305
1402
|
onSelectFilterMode: handleSelectFilterMode,
|
1306
1403
|
table,
|
1307
|
-
}))) !== null && _e !== void 0 ? _e : internalFilterOptions.map(({ divider, label, option, symbol }, index) => (jsxRuntime.jsxs(
|
1404
|
+
}))) !== 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: {
|
1308
1405
|
alignItems: 'center',
|
1309
1406
|
display: 'flex',
|
1310
1407
|
gap: '2ch',
|
1311
1408
|
my: 0,
|
1312
1409
|
py: '6px',
|
1313
|
-
}, value: option, children: [jsxRuntime.jsx(
|
1410
|
+
}, value: option, children: [jsxRuntime.jsx(Box__default["default"], { sx: { fontSize: '1.25rem', width: '2ch' }, children: symbol }), label] }, index))) })));
|
1314
1411
|
};
|
1315
1412
|
|
1316
1413
|
const commonMenuItemStyles = {
|
@@ -1389,48 +1486,48 @@ const MRT_ColumnActionMenu = (_a) => {
|
|
1389
1486
|
const internalColumnMenuItems = [
|
1390
1487
|
...(enableSorting && column.getCanSort()
|
1391
1488
|
? [
|
1392
|
-
enableSortingRemoval !== false && (jsxRuntime.jsx(
|
1393
|
-
jsxRuntime.jsx(
|
1394
|
-
jsxRuntime.jsx(
|
1489
|
+
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)),
|
1490
|
+
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),
|
1491
|
+
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),
|
1395
1492
|
]
|
1396
1493
|
: []),
|
1397
1494
|
...(enableColumnFilters && column.getCanFilter()
|
1398
1495
|
? [
|
1399
|
-
jsxRuntime.jsx(
|
1496
|
+
jsxRuntime.jsx(MenuItem__default["default"], { disabled: !columnFilterValue ||
|
1400
1497
|
(Array.isArray(columnFilterValue) &&
|
1401
|
-
!columnFilterValue.filter((value) => value).length), onClick: handleClearFilter, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(
|
1402
|
-
columnFilterDisplayMode === 'subheader' && (jsxRuntime.jsxs(
|
1498
|
+
!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),
|
1499
|
+
columnFilterDisplayMode === 'subheader' && (jsxRuntime.jsxs(MenuItem__default["default"], { disabled: showColumnFilters && !enableColumnFilterModes, divider: enableGrouping || enableHiding, onClick: showColumnFilters
|
1403
1500
|
? handleOpenFilterModeMenu
|
1404
|
-
: handleFilterByColumn, sx: commonMenuItemStyles, children: [jsxRuntime.jsxs(
|
1501
|
+
: 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)),
|
1405
1502
|
showFilterModeSubMenu && (jsxRuntime.jsx(MRT_FilterOptionMenu, { anchorEl: filterMenuAnchorEl, header: header, onSelect: handleFilterByColumn, setAnchorEl: setFilterMenuAnchorEl, table: table }, 5)),
|
1406
1503
|
].filter(Boolean)
|
1407
1504
|
: []),
|
1408
1505
|
...(enableGrouping && column.getCanGroup()
|
1409
1506
|
? [
|
1410
|
-
jsxRuntime.jsx(
|
1507
|
+
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),
|
1411
1508
|
]
|
1412
1509
|
: []),
|
1413
1510
|
...(enableColumnPinning && column.getCanPin()
|
1414
1511
|
? [
|
1415
|
-
jsxRuntime.jsx(
|
1416
|
-
jsxRuntime.jsx(
|
1417
|
-
jsxRuntime.jsx(
|
1512
|
+
jsxRuntime.jsx(MenuItem__default["default"], { disabled: column.getIsPinned() === 'left' || !column.getCanPin(), onClick: () => handlePinColumn('left'), sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(PushPinIcon, { style: { transform: 'rotate(90deg)' } }) }), localization.pinToLeft] }) }, 7),
|
1513
|
+
jsxRuntime.jsx(MenuItem__default["default"], { disabled: column.getIsPinned() === 'right' || !column.getCanPin(), onClick: () => handlePinColumn('right'), sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(PushPinIcon, { style: { transform: 'rotate(-90deg)' } }) }), localization.pinToRight] }) }, 8),
|
1514
|
+
jsxRuntime.jsx(MenuItem__default["default"], { disabled: !column.getIsPinned(), divider: enableHiding, onClick: () => handlePinColumn(false), sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(PushPinIcon, {}) }), localization.unpin] }) }, 9),
|
1418
1515
|
]
|
1419
1516
|
: []),
|
1420
1517
|
...(enableColumnResizing && column.getCanResize()
|
1421
1518
|
? [
|
1422
|
-
jsxRuntime.jsx(
|
1519
|
+
jsxRuntime.jsx(MenuItem__default["default"], { disabled: !columnSizing[column.id], onClick: handleResetColumnSize, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(Box__default["default"], { sx: commonListItemStyles, children: [jsxRuntime.jsx(ListItemIcon__default["default"], { children: jsxRuntime.jsx(RestartAltIcon, {}) }), localization.resetColumnSize] }) }, 10),
|
1423
1520
|
]
|
1424
1521
|
: []),
|
1425
1522
|
...(enableHiding
|
1426
1523
|
? [
|
1427
|
-
jsxRuntime.jsx(
|
1428
|
-
jsxRuntime.jsx(
|
1429
|
-
.length, onClick: handleShowAllColumns, sx: commonMenuItemStyles, children: jsxRuntime.jsxs(
|
1524
|
+
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),
|
1525
|
+
jsxRuntime.jsx(MenuItem__default["default"], { disabled: !Object.values(columnVisibility).filter((visible) => !visible)
|
1526
|
+
.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),
|
1430
1527
|
]
|
1431
1528
|
: []),
|
1432
1529
|
].filter(Boolean);
|
1433
|
-
return (jsxRuntime.jsx(
|
1530
|
+
return (jsxRuntime.jsx(Menu__default["default"], Object.assign({ MenuListProps: {
|
1434
1531
|
dense: density === 'compact',
|
1435
1532
|
}, anchorEl: anchorEl, onClose: () => setAnchorEl(null), open: !!anchorEl }, rest, { children: (_l = (_k = (_j = columnDef.renderColumnActionsMenuItems) === null || _j === void 0 ? void 0 : _j.call(columnDef, {
|
1436
1533
|
closeMenu: () => setAnchorEl(null),
|
@@ -1464,7 +1561,7 @@ const MRT_TableHeadCellColumnActionsButton = (_a) => {
|
|
1464
1561
|
column,
|
1465
1562
|
table,
|
1466
1563
|
})), rest);
|
1467
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(
|
1564
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip__default["default"], { 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': {
|
1468
1565
|
opacity: 1,
|
1469
1566
|
}, height: '2rem', m: '-8px -4px', opacity: 0.3, transition: 'all 150ms', width: '2rem' }, parseFromValuesOrFunc(iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx, theme))), title: undefined, children: jsxRuntime.jsx(MoreVertIcon, { style: { transform: 'scale(0.9)' } }) })) }), anchorEl && (jsxRuntime.jsx(MRT_ColumnActionMenu, { anchorEl: anchorEl, header: header, setAnchorEl: setAnchorEl, table: table }))] }));
|
1470
1567
|
};
|
@@ -1483,7 +1580,7 @@ const MRT_FilterCheckbox = (_a) => {
|
|
1483
1580
|
table,
|
1484
1581
|
})), rest);
|
1485
1582
|
const filterLabel = (_b = localization.filterByColumn) === null || _b === void 0 ? void 0 : _b.replace('{column}', columnDef.header);
|
1486
|
-
return (jsxRuntime.jsx(
|
1583
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { 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) => {
|
1487
1584
|
var _a;
|
1488
1585
|
column.setFilterValue(column.getFilterValue() === undefined
|
1489
1586
|
? 'true'
|
@@ -1499,7 +1596,7 @@ const MRT_FilterCheckbox = (_a) => {
|
|
1499
1596
|
};
|
1500
1597
|
|
1501
1598
|
const MRT_FilterTextField = (_a) => {
|
1502
|
-
var _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
1599
|
+
var _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
1503
1600
|
var { header, rangeFilterIndex, table } = _a, rest = __rest(_a, ["header", "rangeFilterIndex", "table"]);
|
1504
1601
|
const { options: { columnFilterModeOptions, enableColumnFilterModes, icons: { CloseIcon, FilterListIcon }, localization, manualFiltering, muiFilterAutocompleteProps, muiFilterDatePickerProps, muiFilterTextFieldProps, }, refs: { filterInputRefs }, setColumnFilterFns, } = table;
|
1505
1602
|
const { column } = header;
|
@@ -1641,12 +1738,12 @@ const MRT_FilterTextField = (_a) => {
|
|
1641
1738
|
isMultiSelectFilter,
|
1642
1739
|
isSelectFilter,
|
1643
1740
|
]);
|
1644
|
-
const endAdornment = !isAutocompleteFilter && !isDateFilter && !filterChipLabel ? (jsxRuntime.jsx(
|
1741
|
+
const endAdornment = !isAutocompleteFilter && !isDateFilter && !filterChipLabel ? (jsxRuntime.jsx(InputAdornment__default["default"], { position: "end", sx: { mr: isSelectFilter || isMultiSelectFilter ? '20px' : undefined }, children: jsxRuntime.jsx(Tooltip__default["default"], { 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: {
|
1645
1742
|
height: '2rem',
|
1646
1743
|
transform: 'scale(0.9)',
|
1647
1744
|
width: '2rem',
|
1648
1745
|
}, children: jsxRuntime.jsx(CloseIcon, {}) }) }) }) })) : null;
|
1649
|
-
const startAdornment = showChangeModeButton ? (jsxRuntime.jsxs(
|
1746
|
+
const startAdornment = showChangeModeButton ? (jsxRuntime.jsxs(InputAdornment__default["default"], { position: "start", children: [jsxRuntime.jsx(Tooltip__default["default"], { title: localization.changeFilterMode, children: jsxRuntime.jsx("span", { children: jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.changeFilterMode, onClick: handleFilterMenuOpen, size: "small", sx: { height: '1.75rem', width: '1.75rem' }, children: jsxRuntime.jsx(FilterListIcon, {}) }) }) }), filterChipLabel && (jsxRuntime.jsx(Chip__default["default"], { label: filterChipLabel, onDelete: handleClearEmptyFilterChip }))] })) : null;
|
1650
1747
|
const commonTextFieldProps = Object.assign(Object.assign({ FormHelperTextProps: {
|
1651
1748
|
sx: {
|
1652
1749
|
fontSize: '0.75rem',
|
@@ -1659,6 +1756,7 @@ const MRT_FilterTextField = (_a) => {
|
|
1659
1756
|
// @ts-ignore
|
1660
1757
|
localization[`filter${((_l = currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.charAt(0)) === null || _l === void 0 ? void 0 : _l.toUpperCase()) +
|
1661
1758
|
(currentFilterOption === null || currentFilterOption === void 0 ? void 0 : currentFilterOption.slice(1))}`]) })) : null, inputProps: {
|
1759
|
+
'aria-label': filterPlaceholder,
|
1662
1760
|
autoComplete: 'new-password',
|
1663
1761
|
disabled: !!filterChipLabel,
|
1664
1762
|
sx: {
|
@@ -1688,45 +1786,30 @@ const MRT_FilterTextField = (_a) => {
|
|
1688
1786
|
}, value: filterValue || null }, datePickerProps, { slotProps: {
|
1689
1787
|
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),
|
1690
1788
|
textField: Object.assign(Object.assign({}, commonTextFieldProps), (_o = datePickerProps === null || datePickerProps === void 0 ? void 0 : datePickerProps.slotProps) === null || _o === void 0 ? void 0 : _o.textField),
|
1691
|
-
} }))) : isAutocompleteFilter ? (jsxRuntime.jsx(
|
1789
|
+
} }))) : isAutocompleteFilter ? (jsxRuntime.jsx(Autocomplete__default["default"], Object.assign({ freeSolo: true, getOptionLabel: (option) => getValueAndLabel(option).label, onChange: (_e, newValue) => handleChange(getValueAndLabel(newValue).value), options: (_p = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map((option) => getValueAndLabel(option))) !== null && _p !== void 0 ? _p : [] }, autocompleteProps, { renderInput: (builtinTextFieldProps) => {
|
1692
1790
|
var _a;
|
1693
|
-
return (jsxRuntime.jsx(
|
1694
|
-
}, value: filterValue }))) : (jsxRuntime.jsx(
|
1791
|
+
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 })));
|
1792
|
+
}, value: filterValue }))) : (jsxRuntime.jsx(TextField__default["default"], Object.assign({ SelectProps: {
|
1695
1793
|
displayEmpty: true,
|
1696
1794
|
multiple: isMultiSelectFilter,
|
1697
1795
|
renderValue: isMultiSelectFilter
|
1698
|
-
? (selected) => !(selected === null || selected === void 0 ? void 0 : selected.length) ? (jsxRuntime.jsx(
|
1699
|
-
const selectedValue = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.find((option) => option
|
1700
|
-
|
1701
|
-
: option === value);
|
1702
|
-
return (jsxRuntime.jsx(Chip, { label: selectedValue instanceof Object
|
1703
|
-
? selectedValue.text
|
1704
|
-
: selectedValue }, value));
|
1796
|
+
? (selected) => !(selected === null || selected === void 0 ? void 0 : selected.length) ? (jsxRuntime.jsx(Box__default["default"], { sx: { opacity: 0.5 }, children: filterPlaceholder })) : (jsxRuntime.jsx(Box__default["default"], { sx: { display: 'flex', flexWrap: 'wrap', gap: '2px' }, children: selected === null || selected === void 0 ? void 0 : selected.map((value) => {
|
1797
|
+
const selectedValue = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.find((option) => getValueAndLabel(option).value === value);
|
1798
|
+
return (jsxRuntime.jsx(Chip__default["default"], { label: getValueAndLabel(selectedValue).label }, value));
|
1705
1799
|
}) }))
|
1706
1800
|
: undefined,
|
1707
1801
|
}, onChange: handleTextFieldChange, select: isSelectFilter || isMultiSelectFilter }, commonTextFieldProps, { value: filterValue !== null && filterValue !== void 0 ? filterValue : '', children: (isSelectFilter || isMultiSelectFilter) && [
|
1708
|
-
jsxRuntime.jsx(
|
1802
|
+
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"),
|
1709
1803
|
...[
|
1710
|
-
(
|
1804
|
+
(_q = textFieldProps.children) !== null && _q !== void 0 ? _q : dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions.map((option, index) => {
|
1711
1805
|
var _a;
|
1712
|
-
|
1713
|
-
|
1714
|
-
let value;
|
1715
|
-
let text;
|
1716
|
-
if (typeof option !== 'object') {
|
1717
|
-
value = option;
|
1718
|
-
text = option;
|
1719
|
-
}
|
1720
|
-
else {
|
1721
|
-
value = option.value;
|
1722
|
-
text = option.text;
|
1723
|
-
}
|
1724
|
-
return (jsxRuntime.jsxs(MenuItem, { sx: {
|
1806
|
+
const { label, value } = getValueAndLabel(option);
|
1807
|
+
return (jsxRuntime.jsxs(MenuItem__default["default"], { sx: {
|
1725
1808
|
alignItems: 'center',
|
1726
1809
|
display: 'flex',
|
1727
1810
|
gap: '0.5rem',
|
1728
1811
|
m: 0,
|
1729
|
-
}, value: value, children: [isMultiSelectFilter && (jsxRuntime.jsx(
|
1812
|
+
}, value: value, children: [isMultiSelectFilter && (jsxRuntime.jsx(Checkbox__default["default"], { checked: ((_a = column.getFilterValue()) !== null && _a !== void 0 ? _a : []).includes(value), sx: { mr: '0.5rem' } })), label, ' ', !columnDef.filterSelectOptions &&
|
1730
1813
|
`(${facetedUniqueValues.get(value)})`] }, `${index}-${value}`));
|
1731
1814
|
}),
|
1732
1815
|
],
|
@@ -1735,7 +1818,7 @@ const MRT_FilterTextField = (_a) => {
|
|
1735
1818
|
|
1736
1819
|
const MRT_FilterRangeFields = (_a) => {
|
1737
1820
|
var { header, table } = _a, rest = __rest(_a, ["header", "table"]);
|
1738
|
-
return (jsxRuntime.jsxs(
|
1821
|
+
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 })] })));
|
1739
1822
|
};
|
1740
1823
|
|
1741
1824
|
const MRT_FilterRangeSlider = (_a) => {
|
@@ -1773,7 +1856,7 @@ const MRT_FilterRangeSlider = (_a) => {
|
|
1773
1856
|
}
|
1774
1857
|
isMounted.current = true;
|
1775
1858
|
}, [columnFilterValue, min, max]);
|
1776
|
-
return (jsxRuntime.jsxs(
|
1859
|
+
return (jsxRuntime.jsxs(Stack__default["default"], { children: [jsxRuntime.jsx(Slider__default["default"], Object.assign({ disableSwap: true, max: max, min: min, onChange: (_event, values) => {
|
1777
1860
|
setFilterValues(values);
|
1778
1861
|
}, onChangeCommitted: (_event, value) => {
|
1779
1862
|
if (Array.isArray(value)) {
|
@@ -1799,7 +1882,7 @@ const MRT_FilterRangeSlider = (_a) => {
|
|
1799
1882
|
}
|
1800
1883
|
},
|
1801
1884
|
},
|
1802
|
-
}, sx: (theme) => (Object.assign({ m: 'auto', mt: !showChangeModeButton ? '10px' : '6px', px: '4px', width: 'calc(100% - 8px)' }, parseFromValuesOrFunc(sliderProps === null || sliderProps === void 0 ? void 0 : sliderProps.sx, theme))) })), showChangeModeButton ? (jsxRuntime.jsx(
|
1885
|
+
}, sx: (theme) => (Object.assign({ m: 'auto', mt: !showChangeModeButton ? '10px' : '6px', px: '4px', width: 'calc(100% - 8px)' }, parseFromValuesOrFunc(sliderProps === null || sliderProps === void 0 ? void 0 : sliderProps.sx, theme))) })), showChangeModeButton ? (jsxRuntime.jsx(FormHelperText__default["default"], { sx: {
|
1803
1886
|
fontSize: '0.75rem',
|
1804
1887
|
lineHeight: '0.8rem',
|
1805
1888
|
m: '-3px -6px',
|
@@ -1817,7 +1900,7 @@ const MRT_TableHeadCellFilterContainer = (_a) => {
|
|
1817
1900
|
const { showColumnFilters } = getState();
|
1818
1901
|
const { column } = header;
|
1819
1902
|
const { columnDef } = column;
|
1820
|
-
return (jsxRuntime.jsx(
|
1903
|
+
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')) ||
|
1821
1904
|
['between', 'betweenInclusive', 'inNumberRange'].includes(columnDef._filterFn) ? (jsxRuntime.jsx(MRT_FilterRangeFields, { header: header, table: table })) : (jsxRuntime.jsx(MRT_FilterTextField, { header: header, table: table })) })));
|
1822
1905
|
};
|
1823
1906
|
|
@@ -1847,10 +1930,10 @@ const MRT_TableHeadCellFilterLabel = (_a) => {
|
|
1847
1930
|
? filterValue.join(`" ${isRangeFilter ? localization.and : localization.or} "`)
|
1848
1931
|
: filterValue}"`)
|
1849
1932
|
.replace('" "', '');
|
1850
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(
|
1933
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Grow__default["default"], { in: columnFilterDisplayMode === 'popover' ||
|
1851
1934
|
(!!filterValue && !isRangeFilter) ||
|
1852
1935
|
(isRangeFilter && // @ts-ignore
|
1853
|
-
(!!(filterValue === null || filterValue === void 0 ? void 0 : filterValue[0]) || !!(filterValue === null || filterValue === void 0 ? void 0 : filterValue[1]))), unmountOnExit: true, children: jsxRuntime.jsx(
|
1936
|
+
(!!(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"], { placement: "top", title: filterTooltip, children: jsxRuntime.jsx(IconButton__default["default"], Object.assign({ disableRipple: true, onClick: (event) => {
|
1854
1937
|
if (columnFilterDisplayMode === 'popover') {
|
1855
1938
|
setAnchorEl(event.currentTarget);
|
1856
1939
|
}
|
@@ -1863,7 +1946,7 @@ const MRT_TableHeadCellFilterLabel = (_a) => {
|
|
1863
1946
|
(_b = filterInputRefs.current[`${column.id}-0`]) === null || _b === void 0 ? void 0 : _b.select();
|
1864
1947
|
});
|
1865
1948
|
event.stopPropagation();
|
1866
|
-
}, 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(
|
1949
|
+
}, 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: {
|
1867
1950
|
horizontal: 'center',
|
1868
1951
|
vertical: 'top',
|
1869
1952
|
}, onClick: (event) => event.stopPropagation(), onClose: (event) => {
|
@@ -1873,7 +1956,7 @@ const MRT_TableHeadCellFilterLabel = (_a) => {
|
|
1873
1956
|
}, onKeyDown: (event) => event.key === 'Enter' && setAnchorEl(null), open: !!anchorEl, transformOrigin: {
|
1874
1957
|
horizontal: 'center',
|
1875
1958
|
vertical: 'bottom',
|
1876
|
-
}, children: jsxRuntime.jsx(
|
1959
|
+
}, children: jsxRuntime.jsx(Box__default["default"], { sx: { p: '1rem' }, children: jsxRuntime.jsx(MRT_TableHeadCellFilterContainer, { header: header, table: table }) }) })] }));
|
1877
1960
|
};
|
1878
1961
|
|
1879
1962
|
const MRT_TableHeadCellGrabHandle = (_a) => {
|
@@ -1914,7 +1997,7 @@ const MRT_TableHeadCellResizeHandle = (_a) => {
|
|
1914
1997
|
const { getState, options: { columnResizeMode }, setColumnSizingInfo, } = table;
|
1915
1998
|
const { density } = getState();
|
1916
1999
|
const { column } = header;
|
1917
|
-
return (jsxRuntime.jsx(
|
2000
|
+
return (jsxRuntime.jsx(Box__default["default"], { className: "Mui-TableHeadCell-ResizeHandle-Wrapper", onDoubleClick: () => {
|
1918
2001
|
setColumnSizingInfo((old) => (Object.assign(Object.assign({}, old), { isResizingColumn: false })));
|
1919
2002
|
column.resetSize();
|
1920
2003
|
}, onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), style: {
|
@@ -1935,7 +2018,7 @@ const MRT_TableHeadCellResizeHandle = (_a) => {
|
|
1935
2018
|
position: 'absolute',
|
1936
2019
|
px: '4px',
|
1937
2020
|
right: column.columnDef.columnDefType === 'display' ? '4px' : '0',
|
1938
|
-
}), children: jsxRuntime.jsx(
|
2021
|
+
}), 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()
|
1939
2022
|
? undefined
|
1940
2023
|
: 'all 150ms ease-in-out', userSelect: 'none', zIndex: 4 }, parseFromValuesOrFunc(rest === null || rest === void 0 ? void 0 : rest.sx, theme))) }) }));
|
1941
2024
|
};
|
@@ -1956,7 +2039,7 @@ const MRT_TableHeadCellSortLabel = (_a) => {
|
|
1956
2039
|
: column.getNextSortingOrder() === 'desc'
|
1957
2040
|
? localization.sortByColumnDesc.replace('{column}', columnDef.header)
|
1958
2041
|
: localization.sortByColumnAsc.replace('{column}', columnDef.header);
|
1959
|
-
return (jsxRuntime.jsx(
|
2042
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { 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
|
1960
2043
|
? (props) => (jsxRuntime.jsx(SyncAltIcon, Object.assign({}, props, { style: {
|
1961
2044
|
transform: 'rotate(-90deg) scaleX(0.9) translateX(-1px)',
|
1962
2045
|
} })))
|
@@ -2038,7 +2121,7 @@ const MRT_TableHeadCell = (_a) => {
|
|
2038
2121
|
header,
|
2039
2122
|
table,
|
2040
2123
|
})) !== null && _b !== void 0 ? _b : columnDef.header;
|
2041
|
-
return (jsxRuntime.jsxs(
|
2124
|
+
return (jsxRuntime.jsxs(TableCell__default["default"], Object.assign({ align: columnDefType === 'group' ? 'center' : 'left', colSpan: header.colSpan, onDragEnter: handleDragEnter, ref: (node) => {
|
2042
2125
|
if (node) {
|
2043
2126
|
tableHeadCellRefs.current[column.id] = node;
|
2044
2127
|
}
|
@@ -2074,7 +2157,7 @@ const MRT_TableHeadCell = (_a) => {
|
|
2074
2157
|
theme,
|
2075
2158
|
})), draggingBorders)), children: [header.isPlaceholder
|
2076
2159
|
? null
|
2077
|
-
: (_c = tableCellProps.children) !== null && _c !== void 0 ? _c : (jsxRuntime.jsxs(
|
2160
|
+
: (_c = tableCellProps.children) !== null && _c !== void 0 ? _c : (jsxRuntime.jsxs(Box__default["default"], { className: "Mui-TableHeadCell-Content", sx: {
|
2078
2161
|
alignItems: 'center',
|
2079
2162
|
display: 'flex',
|
2080
2163
|
flexDirection: (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'right' ? 'row-reverse' : 'row',
|
@@ -2086,7 +2169,7 @@ const MRT_TableHeadCell = (_a) => {
|
|
2086
2169
|
: 'flex-start',
|
2087
2170
|
position: 'relative',
|
2088
2171
|
width: '100%',
|
2089
|
-
}, children: [jsxRuntime.jsxs(
|
2172
|
+
}, children: [jsxRuntime.jsxs(Box__default["default"], { className: "Mui-TableHeadCell-Content-Labels", onClick: column.getToggleSortingHandler(), sx: {
|
2090
2173
|
alignItems: 'center',
|
2091
2174
|
cursor: column.getCanSort() && columnDefType !== 'group'
|
2092
2175
|
? 'pointer'
|
@@ -2097,7 +2180,7 @@ const MRT_TableHeadCell = (_a) => {
|
|
2097
2180
|
pl: (tableCellProps === null || tableCellProps === void 0 ? void 0 : tableCellProps.align) === 'center'
|
2098
2181
|
? `${headerPL}rem`
|
2099
2182
|
: undefined,
|
2100
|
-
}, children: [jsxRuntime.jsx(
|
2183
|
+
}, children: [jsxRuntime.jsx(Box__default["default"], { className: "Mui-TableHeadCell-Content-Wrapper", sx: {
|
2101
2184
|
'&:hover': {
|
2102
2185
|
textOverflow: 'clip',
|
2103
2186
|
},
|
@@ -2107,7 +2190,7 @@ const MRT_TableHeadCell = (_a) => {
|
|
2107
2190
|
whiteSpace: ((_h = (_g = columnDef.header) === null || _g === void 0 ? void 0 : _g.length) !== null && _h !== void 0 ? _h : 0) < 20
|
2108
2191
|
? 'nowrap'
|
2109
2192
|
: 'normal',
|
2110
|
-
}, 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 }))] }), columnDefType !== 'group' && (jsxRuntime.jsxs(
|
2193
|
+
}, 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 }))] }), 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: {
|
2111
2194
|
current: tableHeadCellRefs.current[column.id],
|
2112
2195
|
} })), 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 }))] })));
|
2113
2196
|
};
|
@@ -2119,7 +2202,7 @@ const MRT_TableHeadRow = (_a) => {
|
|
2119
2202
|
headerGroup,
|
2120
2203
|
table,
|
2121
2204
|
})), { rest });
|
2122
|
-
return (jsxRuntime.jsxs(
|
2205
|
+
return (jsxRuntime.jsxs(TableRow__default["default"], Object.assign({}, tableRowProps, { sx: (theme) => (Object.assign({ backgroundColor: getMRTTheme(table, theme).baseBackgroundColor, boxShadow: `4px 0 8px ${material.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) => {
|
2123
2206
|
const header = virtualColumns
|
2124
2207
|
? headerGroup.headers[headerOrVirtualHeader.index]
|
2125
2208
|
: headerOrVirtualHeader;
|
@@ -2135,12 +2218,12 @@ const MRT_LinearProgressBar = (_a) => {
|
|
2135
2218
|
isTopToolbar,
|
2136
2219
|
table,
|
2137
2220
|
})), rest);
|
2138
|
-
return (jsxRuntime.jsx(
|
2221
|
+
return (jsxRuntime.jsx(Collapse__default["default"], { in: showProgressBars !== false && (showProgressBars || isSaving), mountOnEnter: true, sx: {
|
2139
2222
|
bottom: isTopToolbar ? 0 : undefined,
|
2140
2223
|
position: 'absolute',
|
2141
2224
|
top: !isTopToolbar ? 0 : undefined,
|
2142
2225
|
width: '100%',
|
2143
|
-
}, unmountOnExit: true, children: jsxRuntime.jsx(
|
2226
|
+
}, unmountOnExit: true, children: jsxRuntime.jsx(LinearProgress__default["default"], Object.assign({ "aria-busy": "true", "aria-label": "Loading", sx: { position: 'relative' } }, linearProgressProps)) }));
|
2144
2227
|
};
|
2145
2228
|
|
2146
2229
|
const defaultRowsPerPage = [5, 10, 15, 20, 25, 30, 50, 100];
|
@@ -2157,7 +2240,7 @@ const MRT_TablePagination = (_a) => {
|
|
2157
2240
|
const firstRowIndex = pageIndex * pageSize;
|
2158
2241
|
const lastRowIndex = Math.min(pageIndex * pageSize + pageSize, totalRowCount);
|
2159
2242
|
const _b = paginationProps !== null && paginationProps !== void 0 ? paginationProps : {}, { rowsPerPageOptions = defaultRowsPerPage, showFirstButton = showFirstLastPageButtons, showLastButton = showFirstLastPageButtons, showRowsPerPage = true } = _b, _rest = __rest(_b, ["rowsPerPageOptions", "showFirstButton", "showLastButton", "showRowsPerPage"]);
|
2160
|
-
return (jsxRuntime.jsxs(
|
2243
|
+
return (jsxRuntime.jsxs(Box__default["default"], { sx: {
|
2161
2244
|
alignItems: 'center',
|
2162
2245
|
display: 'flex',
|
2163
2246
|
flexWrap: 'wrap',
|
@@ -2173,12 +2256,12 @@ const MRT_TablePagination = (_a) => {
|
|
2173
2256
|
px: '8px',
|
2174
2257
|
py: '12px',
|
2175
2258
|
zIndex: 2,
|
2176
|
-
}, children: [showRowsPerPage && (jsxRuntime.jsxs(
|
2259
|
+
}, 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: {
|
2177
2260
|
first: FirstPageIcon,
|
2178
2261
|
last: LastPageIcon,
|
2179
2262
|
next: ChevronRightIcon,
|
2180
2263
|
previous: ChevronLeftIcon,
|
2181
|
-
} }, item))), showFirstButton: showFirstButton, showLastButton: showLastButton }, _rest))) : paginationDisplayMode === 'default' ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(
|
2264
|
+
} }, 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] }));
|
2182
2265
|
};
|
2183
2266
|
|
2184
2267
|
const MRT_GlobalFilterTextField = (_a) => {
|
@@ -2218,7 +2301,7 @@ const MRT_GlobalFilterTextField = (_a) => {
|
|
2218
2301
|
}
|
2219
2302
|
isMounted.current = true;
|
2220
2303
|
}, [globalFilter]);
|
2221
|
-
return (jsxRuntime.jsxs(
|
2304
|
+
return (jsxRuntime.jsxs(Collapse__default["default"], { in: showGlobalFilter, mountOnEnter: true, orientation: "horizontal", unmountOnExit: true, children: [jsxRuntime.jsx(TextField__default["default"], Object.assign({ InputProps: Object.assign(Object.assign({ endAdornment: (jsxRuntime.jsx(InputAdornment__default["default"], { position: "end", children: jsxRuntime.jsx(Tooltip__default["default"], { 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, {}) }) }) }) })), startAdornment: enableGlobalFilterModes ? (jsxRuntime.jsx(InputAdornment__default["default"], { position: "start", children: jsxRuntime.jsx(Tooltip__default["default"], { 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' } })) }, textFieldProps.InputProps), { sx: (theme) => {
|
2222
2305
|
var _a;
|
2223
2306
|
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)));
|
2224
2307
|
} }), inputProps: Object.assign({ autoComplete: 'new-password' }, textFieldProps.inputProps), onChange: handleChange, placeholder: localization.search, size: "small", value: searchValue !== null && searchValue !== void 0 ? searchValue : '', variant: "outlined" }, textFieldProps, { inputRef: (inputRef) => {
|
@@ -2270,9 +2353,9 @@ const MRT_SelectCheckbox = (_a) => {
|
|
2270
2353
|
e.stopPropagation();
|
2271
2354
|
(_a = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.onClick) === null || _a === void 0 ? void 0 : _a.call(checkboxProps, e);
|
2272
2355
|
}, 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 });
|
2273
|
-
return (jsxRuntime.jsx(
|
2356
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { enterDelay: 1000, enterNextDelay: 1000, title: (_b = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.title) !== null && _b !== void 0 ? _b : (selectAll
|
2274
2357
|
? localization.toggleSelectAll
|
2275
|
-
: localization.toggleSelectRow), children: enableMultiRowSelection === false ? (jsxRuntime.jsx(
|
2358
|
+
: localization.toggleSelectRow), children: enableMultiRowSelection === false ? (jsxRuntime.jsx(Radio__default["default"], Object.assign({}, commonProps))) : (jsxRuntime.jsx(Checkbox__default["default"], Object.assign({ indeterminate: selectAll
|
2276
2359
|
? table.getIsSomeRowsSelected() && !allRowsSelected
|
2277
2360
|
: row === null || row === void 0 ? void 0 : row.getIsSomeSelected() }, commonProps))) }));
|
2278
2361
|
};
|
@@ -2291,8 +2374,8 @@ const MRT_ToolbarAlertBanner = (_a) => {
|
|
2291
2374
|
const selectedAlert = getSelectedRowModel().rows.length > 0
|
2292
2375
|
? (_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())
|
2293
2376
|
: null;
|
2294
|
-
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(
|
2295
|
-
return (jsxRuntime.jsx(
|
2377
|
+
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;
|
2378
|
+
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) => {
|
2296
2379
|
var _a, _b;
|
2297
2380
|
return (Object.assign({ '& .MuiAlert-message': {
|
2298
2381
|
maxWidth: `calc(${(_b = (_a = tablePaperRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 360}px - 1rem)`,
|
@@ -2306,7 +2389,7 @@ const MRT_ToolbarAlertBanner = (_a) => {
|
|
2306
2389
|
groupedAlert,
|
2307
2390
|
selectedAlert,
|
2308
2391
|
table,
|
2309
|
-
})) !== null && _d !== void 0 ? _d : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [(alertProps === null || alertProps === void 0 ? void 0 : alertProps.title) && jsxRuntime.jsx(
|
2392
|
+
})) !== 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: {
|
2310
2393
|
p: positionToolbarAlertBanner !== 'head-overlay'
|
2311
2394
|
? '0.5rem 1rem'
|
2312
2395
|
: density === 'spacious'
|
@@ -2314,7 +2397,7 @@ const MRT_ToolbarAlertBanner = (_a) => {
|
|
2314
2397
|
: density === 'comfortable'
|
2315
2398
|
? '0.5rem 0.75rem'
|
2316
2399
|
: '0.25rem 0.5rem',
|
2317
|
-
}, children: [alertProps === null || alertProps === void 0 ? void 0 : alertProps.children, (alertProps === null || alertProps === void 0 ? void 0 : alertProps.children) && (selectedAlert || groupedAlert) && (jsxRuntime.jsx("br", {})), jsxRuntime.jsxs(
|
2400
|
+
}, children: [alertProps === null || alertProps === void 0 ? void 0 : alertProps.children, (alertProps === null || alertProps === void 0 ? void 0 : alertProps.children) && (selectedAlert || groupedAlert) && (jsxRuntime.jsx("br", {})), jsxRuntime.jsxs(Box__default["default"], { sx: { display: 'flex' }, children: [enableRowSelection &&
|
2318
2401
|
enableSelectAll &&
|
2319
2402
|
positionToolbarAlertBanner === 'head-overlay' && (jsxRuntime.jsx(MRT_SelectCheckbox, { selectAll: true, table: table })), ' ', selectedAlert] }), selectedAlert && groupedAlert && jsxRuntime.jsx("br", {}), groupedAlert] })] })) })) }));
|
2320
2403
|
};
|
@@ -2336,17 +2419,17 @@ const MRT_ToolbarDropZone = (_a) => {
|
|
2336
2419
|
!grouping.includes(draggingColumn.id));
|
2337
2420
|
}
|
2338
2421
|
}, [enableGrouping, draggingColumn, grouping]);
|
2339
|
-
return (jsxRuntime.jsx(
|
2422
|
+
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 : '') }) })) }));
|
2340
2423
|
};
|
2341
2424
|
|
2342
2425
|
const MRT_BottomToolbar = (_a) => {
|
2343
2426
|
var { table } = _a, rest = __rest(_a, ["table"]);
|
2344
2427
|
const { getState, options: { enablePagination, muiBottomToolbarProps, positionPagination, positionToolbarAlertBanner, positionToolbarDropZone, renderBottomToolbarCustomActions, }, refs: { bottomToolbarRef }, } = table;
|
2345
2428
|
const { isFullScreen } = getState();
|
2346
|
-
const isMobile =
|
2429
|
+
const isMobile = useMediaQuery__default["default"]('(max-width:720px)');
|
2347
2430
|
const toolbarProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiBottomToolbarProps, { table })), rest);
|
2348
2431
|
const stackAlertBanner = isMobile || !!renderBottomToolbarCustomActions;
|
2349
|
-
return (jsxRuntime.jsxs(
|
2432
|
+
return (jsxRuntime.jsxs(Box__default["default"], Object.assign({}, toolbarProps, { ref: (node) => {
|
2350
2433
|
if (node) {
|
2351
2434
|
bottomToolbarRef.current = node;
|
2352
2435
|
if (toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.ref) {
|
@@ -2354,14 +2437,14 @@ const MRT_BottomToolbar = (_a) => {
|
|
2354
2437
|
toolbarProps.ref.current = node;
|
2355
2438
|
}
|
2356
2439
|
}
|
2357
|
-
}, sx: (theme) => (Object.assign(Object.assign(Object.assign({}, getCommonToolbarStyles({ table, theme })), { bottom: isFullScreen ? '0' : undefined, boxShadow: `0 1px 2px -1px ${material.alpha(theme.palette.grey[700], 0.5)} inset`, left: 0, position: isFullScreen ? 'fixed' : 'relative', right: 0 }), parseFromValuesOrFunc(toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx, theme))), children: [jsxRuntime.jsx(MRT_LinearProgressBar, { isTopToolbar: false, table: table }), positionToolbarAlertBanner === 'bottom' && (jsxRuntime.jsx(MRT_ToolbarAlertBanner, { stackAlertBanner: stackAlertBanner, table: table })), ['both', 'bottom'].includes(positionToolbarDropZone !== null && positionToolbarDropZone !== void 0 ? positionToolbarDropZone : '') && (jsxRuntime.jsx(MRT_ToolbarDropZone, { table: table })), jsxRuntime.jsxs(
|
2440
|
+
}, sx: (theme) => (Object.assign(Object.assign(Object.assign({}, getCommonToolbarStyles({ table, theme })), { bottom: isFullScreen ? '0' : undefined, boxShadow: `0 1px 2px -1px ${material.alpha(theme.palette.grey[700], 0.5)} inset`, left: 0, position: isFullScreen ? 'fixed' : 'relative', right: 0 }), parseFromValuesOrFunc(toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.sx, theme))), children: [jsxRuntime.jsx(MRT_LinearProgressBar, { isTopToolbar: false, table: table }), positionToolbarAlertBanner === 'bottom' && (jsxRuntime.jsx(MRT_ToolbarAlertBanner, { stackAlertBanner: stackAlertBanner, table: table })), ['both', 'bottom'].includes(positionToolbarDropZone !== null && positionToolbarDropZone !== void 0 ? positionToolbarDropZone : '') && (jsxRuntime.jsx(MRT_ToolbarDropZone, { table: table })), jsxRuntime.jsxs(Box__default["default"], { sx: {
|
2358
2441
|
alignItems: 'center',
|
2359
2442
|
boxSizing: 'border-box',
|
2360
2443
|
display: 'flex',
|
2361
2444
|
justifyContent: 'space-between',
|
2362
2445
|
p: '0.5rem',
|
2363
2446
|
width: '100%',
|
2364
|
-
}, children: [renderBottomToolbarCustomActions ? (renderBottomToolbarCustomActions({ table })) : (jsxRuntime.jsx("span", {})), jsxRuntime.jsx(
|
2447
|
+
}, children: [renderBottomToolbarCustomActions ? (renderBottomToolbarCustomActions({ table })) : (jsxRuntime.jsx("span", {})), jsxRuntime.jsx(Box__default["default"], { sx: {
|
2365
2448
|
display: 'flex',
|
2366
2449
|
justifyContent: 'flex-end',
|
2367
2450
|
position: stackAlertBanner ? 'relative' : 'absolute',
|
@@ -2377,9 +2460,9 @@ const MRT_ColumnPinningButtons = (_a) => {
|
|
2377
2460
|
const handlePinColumn = (pinDirection) => {
|
2378
2461
|
column.pin(pinDirection);
|
2379
2462
|
};
|
2380
|
-
return (jsxRuntime.jsx(
|
2463
|
+
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"], { 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"], { title: localization.pinToLeft, children: jsxRuntime.jsx(IconButton__default["default"], { onClick: () => handlePinColumn('left'), size: "small", children: jsxRuntime.jsx(PushPinIcon, { style: {
|
2381
2464
|
transform: 'rotate(90deg)',
|
2382
|
-
} }) }) }), jsxRuntime.jsx(
|
2465
|
+
} }) }) }), jsxRuntime.jsx(Tooltip__default["default"], { title: localization.pinToRight, children: jsxRuntime.jsx(IconButton__default["default"], { onClick: () => handlePinColumn('right'), size: "small", children: jsxRuntime.jsx(PushPinIcon, { style: {
|
2383
2466
|
transform: 'rotate(-90deg)',
|
2384
2467
|
} }) }) })] })) })));
|
2385
2468
|
};
|
@@ -2425,26 +2508,26 @@ const MRT_ShowHideColumnsMenuItems = (_a) => {
|
|
2425
2508
|
};
|
2426
2509
|
if (!columnDef.header)
|
2427
2510
|
return null;
|
2428
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(
|
2511
|
+
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
|
2429
2512
|
? `2px dashed ${theme.palette.grey[500]}`
|
2430
2513
|
: (hoveredColumn === null || hoveredColumn === void 0 ? void 0 : hoveredColumn.id) === column.id
|
2431
2514
|
? `2px dashed ${getMRTTheme(table, theme).draggingBorderColor}`
|
2432
|
-
: '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(
|
2515
|
+
: '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: {
|
2433
2516
|
display: 'flex',
|
2434
2517
|
flexWrap: 'nowrap',
|
2435
2518
|
gap: '8px',
|
2436
2519
|
}, children: [columnDefType !== 'group' &&
|
2437
2520
|
enableColumnOrdering &&
|
2438
2521
|
!allColumns.some((col) => col.columnDef.columnDefType === 'group') &&
|
2439
|
-
(columnDef.enableColumnOrdering !== false ? (jsxRuntime.jsx(MRT_GrabHandleButton, { onDragEnd: handleDragEnd, onDragStart: handleDragStart, table: table })) : (jsxRuntime.jsx(
|
2440
|
-
(column.getCanPin() ? (jsxRuntime.jsx(MRT_ColumnPinningButtons, { column: column, table: table })) : (jsxRuntime.jsx(
|
2522
|
+
(columnDef.enableColumnOrdering !== false ? (jsxRuntime.jsx(MRT_GrabHandleButton, { onDragEnd: handleDragEnd, onDragStart: handleDragStart, table: table })) : (jsxRuntime.jsx(Box__default["default"], { sx: { width: '28px' } }))), enableColumnPinning &&
|
2523
|
+
(column.getCanPin() ? (jsxRuntime.jsx(MRT_ColumnPinningButtons, { column: column, table: table })) : (jsxRuntime.jsx(Box__default["default"], { sx: { width: '70px' } }))), enableHiding ? (jsxRuntime.jsx(FormControlLabel__default["default"], { checked: switchChecked, componentsProps: {
|
2441
2524
|
typography: {
|
2442
2525
|
sx: {
|
2443
2526
|
mb: 0,
|
2444
2527
|
opacity: columnDefType !== 'display' ? 1 : 0.5,
|
2445
2528
|
},
|
2446
2529
|
},
|
2447
|
-
}, control: jsxRuntime.jsx(
|
2530
|
+
}, control: jsxRuntime.jsx(Tooltip__default["default"], { 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}`)))] }));
|
2448
2531
|
};
|
2449
2532
|
|
2450
2533
|
const MRT_ShowHideColumnsMenu = (_a) => {
|
@@ -2476,14 +2559,14 @@ const MRT_ShowHideColumnsMenu = (_a) => {
|
|
2476
2559
|
getRightLeafColumns(),
|
2477
2560
|
]);
|
2478
2561
|
const [hoveredColumn, setHoveredColumn] = react.useState(null);
|
2479
|
-
return (jsxRuntime.jsxs(
|
2562
|
+
return (jsxRuntime.jsxs(Menu__default["default"], Object.assign({ MenuListProps: {
|
2480
2563
|
dense: density === 'compact',
|
2481
|
-
}, anchorEl: anchorEl, onClose: () => setAnchorEl(null), open: !!anchorEl }, rest, { children: [jsxRuntime.jsxs(
|
2564
|
+
}, anchorEl: anchorEl, onClose: () => setAnchorEl(null), open: !!anchorEl }, rest, { children: [jsxRuntime.jsxs(Box__default["default"], { sx: {
|
2482
2565
|
display: 'flex',
|
2483
2566
|
justifyContent: 'space-between',
|
2484
2567
|
p: '0.5rem',
|
2485
2568
|
pt: 0,
|
2486
|
-
}, children: [enableHiding && (jsxRuntime.jsx(
|
2569
|
+
}, 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}`)))] })));
|
2487
2570
|
};
|
2488
2571
|
|
2489
2572
|
const MRT_ShowHideColumnsButton = (_a) => {
|
@@ -2494,7 +2577,7 @@ const MRT_ShowHideColumnsButton = (_a) => {
|
|
2494
2577
|
const handleClick = (event) => {
|
2495
2578
|
setAnchorEl(event.currentTarget);
|
2496
2579
|
};
|
2497
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(
|
2580
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip__default["default"], { title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideColumns, children: jsxRuntime.jsx(IconButton__default["default"], Object.assign({ "aria-label": localization.showHideColumns, onClick: handleClick }, rest, { title: undefined, children: jsxRuntime.jsx(ViewColumnIcon, {}) })) }), anchorEl && (jsxRuntime.jsx(MRT_ShowHideColumnsMenu, { anchorEl: anchorEl, setAnchorEl: setAnchorEl, table: table }))] }));
|
2498
2581
|
};
|
2499
2582
|
|
2500
2583
|
const MRT_ToggleDensePaddingButton = (_a) => {
|
@@ -2510,7 +2593,7 @@ const MRT_ToggleDensePaddingButton = (_a) => {
|
|
2510
2593
|
: 'comfortable';
|
2511
2594
|
setDensity(nextDensity);
|
2512
2595
|
};
|
2513
|
-
return (jsxRuntime.jsx(
|
2596
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.toggleDensity, children: jsxRuntime.jsx(IconButton__default["default"], Object.assign({ "aria-label": localization.toggleDensity, onClick: handleToggleDensePadding }, rest, { title: undefined, children: density === 'compact' ? (jsxRuntime.jsx(DensitySmallIcon, {})) : density === 'comfortable' ? (jsxRuntime.jsx(DensityMediumIcon, {})) : (jsxRuntime.jsx(DensityLargeIcon, {})) })) }));
|
2514
2597
|
};
|
2515
2598
|
|
2516
2599
|
const MRT_ToggleFiltersButton = (_a) => {
|
@@ -2521,7 +2604,7 @@ const MRT_ToggleFiltersButton = (_a) => {
|
|
2521
2604
|
const handleToggleShowFilters = () => {
|
2522
2605
|
setShowColumnFilters(!showColumnFilters);
|
2523
2606
|
};
|
2524
|
-
return (jsxRuntime.jsx(
|
2607
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.showHideFilters, children: jsxRuntime.jsx(IconButton__default["default"], Object.assign({ "aria-label": localization.showHideFilters, onClick: handleToggleShowFilters }, rest, { title: undefined, children: showColumnFilters ? jsxRuntime.jsx(FilterListOffIcon, {}) : jsxRuntime.jsx(FilterListIcon, {}) })) }));
|
2525
2608
|
};
|
2526
2609
|
|
2527
2610
|
const MRT_ToggleFullScreenButton = (_a) => {
|
@@ -2534,7 +2617,7 @@ const MRT_ToggleFullScreenButton = (_a) => {
|
|
2534
2617
|
setTooltipOpened(false);
|
2535
2618
|
setIsFullScreen(!isFullScreen);
|
2536
2619
|
};
|
2537
|
-
return (jsxRuntime.jsx(
|
2620
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { open: tooltipOpened, title: (_b = rest === null || rest === void 0 ? void 0 : rest.title) !== null && _b !== void 0 ? _b : localization.toggleFullScreen, children: jsxRuntime.jsx(IconButton__default["default"], Object.assign({ "aria-label": localization.toggleFullScreen, onClick: handleToggleFullScreen, onMouseEnter: () => setTooltipOpened(true), onMouseLeave: () => setTooltipOpened(false) }, rest, { title: undefined, children: isFullScreen ? jsxRuntime.jsx(FullscreenExitIcon, {}) : jsxRuntime.jsx(FullscreenIcon, {}) })) }));
|
2538
2621
|
};
|
2539
2622
|
|
2540
2623
|
const MRT_ToggleGlobalFilterButton = (_a) => {
|
@@ -2546,14 +2629,14 @@ const MRT_ToggleGlobalFilterButton = (_a) => {
|
|
2546
2629
|
setShowGlobalFilter(!showGlobalFilter);
|
2547
2630
|
queueMicrotask(() => { var _a; return (_a = searchInputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); });
|
2548
2631
|
};
|
2549
|
-
return (jsxRuntime.jsx(
|
2632
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { 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, {}) })) }));
|
2550
2633
|
};
|
2551
2634
|
|
2552
2635
|
const MRT_ToolbarInternalButtons = (_a) => {
|
2553
2636
|
var _b;
|
2554
2637
|
var { table } = _a, rest = __rest(_a, ["table"]);
|
2555
2638
|
const { options: { columnFilterDisplayMode, enableColumnFilters, enableColumnOrdering, enableColumnPinning, enableDensityToggle, enableFilters, enableFullScreenToggle, enableGlobalFilter, enableHiding, initialState, renderToolbarInternalActions, }, } = table;
|
2556
|
-
return (jsxRuntime.jsx(
|
2639
|
+
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({
|
2557
2640
|
table,
|
2558
2641
|
})) !== null && _b !== void 0 ? _b : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [enableFilters &&
|
2559
2642
|
enableGlobalFilter &&
|
@@ -2566,16 +2649,16 @@ const MRT_TopToolbar = ({ table, }) => {
|
|
2566
2649
|
var _a;
|
2567
2650
|
const { getState, options: { enableGlobalFilter, enablePagination, enableToolbarInternalActions, muiTopToolbarProps, positionGlobalFilter, positionPagination, positionToolbarAlertBanner, positionToolbarDropZone, renderTopToolbarCustomActions, }, refs: { topToolbarRef }, } = table;
|
2568
2651
|
const { isFullScreen, showGlobalFilter } = getState();
|
2569
|
-
const isMobile =
|
2652
|
+
const isMobile = useMediaQuery__default["default"]('(max-width:720px)');
|
2570
2653
|
const toolbarProps = parseFromValuesOrFunc(muiTopToolbarProps, { table });
|
2571
2654
|
const stackAlertBanner = isMobile || !!renderTopToolbarCustomActions || showGlobalFilter;
|
2572
|
-
return (jsxRuntime.jsxs(
|
2655
|
+
return (jsxRuntime.jsxs(Box__default["default"], Object.assign({}, toolbarProps, { ref: (ref) => {
|
2573
2656
|
topToolbarRef.current = ref;
|
2574
2657
|
if (toolbarProps === null || toolbarProps === void 0 ? void 0 : toolbarProps.ref) {
|
2575
2658
|
// @ts-ignore
|
2576
2659
|
toolbarProps.ref.current = ref;
|
2577
2660
|
}
|
2578
|
-
}, sx: (theme) => (Object.assign(Object.assign(Object.assign({}, getCommonToolbarStyles({ table, 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(
|
2661
|
+
}, sx: (theme) => (Object.assign(Object.assign(Object.assign({}, getCommonToolbarStyles({ table, 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: {
|
2579
2662
|
alignItems: 'flex-start',
|
2580
2663
|
boxSizing: 'border-box',
|
2581
2664
|
display: 'flex',
|
@@ -2586,7 +2669,7 @@ const MRT_TopToolbar = ({ table, }) => {
|
|
2586
2669
|
right: 0,
|
2587
2670
|
top: 0,
|
2588
2671
|
width: '100%',
|
2589
|
-
}, children: [enableGlobalFilter && positionGlobalFilter === 'left' && (jsxRuntime.jsx(MRT_GlobalFilterTextField, { table: table })), (_a = renderTopToolbarCustomActions === null || renderTopToolbarCustomActions === void 0 ? void 0 : renderTopToolbarCustomActions({ table })) !== null && _a !== void 0 ? _a : jsxRuntime.jsx("span", {}), enableToolbarInternalActions ? (jsxRuntime.jsxs(
|
2672
|
+
}, children: [enableGlobalFilter && positionGlobalFilter === 'left' && (jsxRuntime.jsx(MRT_GlobalFilterTextField, { table: table })), (_a = renderTopToolbarCustomActions === null || renderTopToolbarCustomActions === void 0 ? void 0 : renderTopToolbarCustomActions({ table })) !== null && _a !== void 0 ? _a : jsxRuntime.jsx("span", {}), enableToolbarInternalActions ? (jsxRuntime.jsxs(Box__default["default"], { sx: {
|
2590
2673
|
alignItems: 'center',
|
2591
2674
|
display: 'flex',
|
2592
2675
|
flexWrap: 'wrap-reverse',
|
@@ -2603,7 +2686,7 @@ const MRT_TableHead = (_a) => {
|
|
2603
2686
|
const { isFullScreen, showAlertBanner } = getState();
|
2604
2687
|
const tableHeadProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTableHeadProps, { table })), rest);
|
2605
2688
|
const stickyHeader = enableStickyHeader || isFullScreen;
|
2606
|
-
return (jsxRuntime.jsx(
|
2689
|
+
return (jsxRuntime.jsx(TableHead__default["default"], Object.assign({}, tableHeadProps, { ref: (ref) => {
|
2607
2690
|
tableHeadRef.current = ref;
|
2608
2691
|
if (tableHeadProps === null || tableHeadProps === void 0 ? void 0 : tableHeadProps.ref) {
|
2609
2692
|
// @ts-ignore
|
@@ -2689,14 +2772,14 @@ const MRT_Table = (_a) => {
|
|
2689
2772
|
virtualPaddingLeft,
|
2690
2773
|
virtualPaddingRight,
|
2691
2774
|
};
|
2692
|
-
return (jsxRuntime.jsxs(
|
2775
|
+
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))] })));
|
2693
2776
|
};
|
2694
2777
|
|
2695
2778
|
const MRT_TableLoadingOverlay = (_a) => {
|
2696
2779
|
var { table } = _a, rest = __rest(_a, ["table"]);
|
2697
2780
|
const { options: { localization, muiCircularProgressProps }, } = table;
|
2698
2781
|
const circularProgressProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiCircularProgressProps, { table })), rest);
|
2699
|
-
return (jsxRuntime.jsx(
|
2782
|
+
return (jsxRuntime.jsx(Box__default["default"], { sx: (theme) => ({
|
2700
2783
|
alignItems: 'center',
|
2701
2784
|
backgroundColor: styles.alpha(getMRTTheme(table, theme).baseBackgroundColor, 0.5),
|
2702
2785
|
bottom: 0,
|
@@ -2709,7 +2792,7 @@ const MRT_TableLoadingOverlay = (_a) => {
|
|
2709
2792
|
top: 0,
|
2710
2793
|
width: '100%',
|
2711
2794
|
zIndex: 2,
|
2712
|
-
}), children: jsxRuntime.jsx(
|
2795
|
+
}), children: jsxRuntime.jsx(CircularProgress__default["default"], Object.assign({ "aria-label": localization.noRecordsToDisplay, id: "mrt-progress" }, circularProgressProps)) }));
|
2713
2796
|
};
|
2714
2797
|
|
2715
2798
|
const MRT_EditActionButtons = (_a) => {
|
@@ -2756,7 +2839,7 @@ const MRT_EditActionButtons = (_a) => {
|
|
2756
2839
|
});
|
2757
2840
|
}
|
2758
2841
|
};
|
2759
|
-
return (jsxRuntime.jsx(
|
2842
|
+
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"], { title: localization.cancel, children: jsxRuntime.jsx(IconButton__default["default"], { "aria-label": localization.cancel, onClick: handleCancel, children: jsxRuntime.jsx(CancelIcon, {}) }) }), jsxRuntime.jsx(Tooltip__default["default"], { 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] })] })) }));
|
2760
2843
|
};
|
2761
2844
|
|
2762
2845
|
const MRT_EditRowModal = (_a) => {
|
@@ -2771,7 +2854,7 @@ const MRT_EditRowModal = (_a) => {
|
|
2771
2854
|
.getAllCells()
|
2772
2855
|
.filter((cell) => cell.column.columnDef.columnDefType === 'data')
|
2773
2856
|
.map((cell) => (jsxRuntime.jsx(MRT_EditCellTextField, { cell: cell, table: table }, cell.id)));
|
2774
|
-
return (jsxRuntime.jsx(
|
2857
|
+
return (jsxRuntime.jsx(Dialog__default["default"], Object.assign({ fullWidth: true, maxWidth: "xs", onClose: (event, reason) => {
|
2775
2858
|
var _a;
|
2776
2859
|
if (creatingRow) {
|
2777
2860
|
onCreatingRowCancel === null || onCreatingRowCancel === void 0 ? void 0 : onCreatingRowCancel({ row, table });
|
@@ -2793,11 +2876,11 @@ const MRT_EditRowModal = (_a) => {
|
|
2793
2876
|
internalEditComponents,
|
2794
2877
|
row,
|
2795
2878
|
table,
|
2796
|
-
})))) !== null && _b !== void 0 ? _b : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(
|
2879
|
+
})))) !== 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: {
|
2797
2880
|
gap: '32px',
|
2798
2881
|
paddingTop: '16px',
|
2799
2882
|
width: '100%',
|
2800
|
-
}, children: internalEditComponents }) }) }), jsxRuntime.jsx(
|
2883
|
+
}, children: internalEditComponents }) }) }), jsxRuntime.jsx(DialogActions__default["default"], { sx: { p: '1.25rem' }, children: jsxRuntime.jsx(MRT_EditActionButtons, { row: row, table: table, variant: "text" }) })] })) })));
|
2801
2884
|
};
|
2802
2885
|
|
2803
2886
|
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? react.useLayoutEffect : react.useEffect;
|
@@ -2822,7 +2905,7 @@ const MRT_TableContainer = (_a) => {
|
|
2822
2905
|
});
|
2823
2906
|
const createModalOpen = createDisplayMode === 'modal' && creatingRow;
|
2824
2907
|
const editModalOpen = editDisplayMode === 'modal' && editingRow;
|
2825
|
-
return (jsxRuntime.jsxs(
|
2908
|
+
return (jsxRuntime.jsxs(TableContainer__default["default"], Object.assign({ "aria-busy": loading, "aria-describedby": loading ? 'mrt-progress' : undefined }, tableContainerProps, { ref: (node) => {
|
2826
2909
|
if (node) {
|
2827
2910
|
tableContainerRef.current = node;
|
2828
2911
|
if (tableContainerProps === null || tableContainerProps === void 0 ? void 0 : tableContainerProps.ref) {
|
@@ -2842,12 +2925,12 @@ const MRT_TablePaper = (_a) => {
|
|
2842
2925
|
var { table } = _a, rest = __rest(_a, ["table"]);
|
2843
2926
|
const { getState, options: { enableBottomToolbar, enableTopToolbar, muiTablePaperProps, renderBottomToolbar, renderTopToolbar, }, refs: { tablePaperRef }, } = table;
|
2844
2927
|
const { isFullScreen } = getState();
|
2845
|
-
const
|
2846
|
-
return (jsxRuntime.jsxs(
|
2928
|
+
const paperProps = Object.assign(Object.assign({}, parseFromValuesOrFunc(muiTablePaperProps, { table })), rest);
|
2929
|
+
return (jsxRuntime.jsxs(Paper__default["default"], Object.assign({ elevation: 2 }, paperProps, { ref: (ref) => {
|
2847
2930
|
tablePaperRef.current = ref;
|
2848
|
-
if (
|
2931
|
+
if (paperProps === null || paperProps === void 0 ? void 0 : paperProps.ref) {
|
2849
2932
|
//@ts-ignore
|
2850
|
-
|
2933
|
+
paperProps.ref.current = ref;
|
2851
2934
|
}
|
2852
2935
|
}, style: Object.assign(Object.assign({}, (isFullScreen
|
2853
2936
|
? {
|
@@ -2864,7 +2947,7 @@ const MRT_TablePaper = (_a) => {
|
|
2864
2947
|
width: '100vw',
|
2865
2948
|
zIndex: 999,
|
2866
2949
|
}
|
2867
|
-
: {})),
|
2950
|
+
: {})), paperProps === null || paperProps === void 0 ? void 0 : paperProps.style), sx: (theme) => (Object.assign({ backgroundColor: getMRTTheme(table, theme).baseBackgroundColor, backgroundImage: 'unset', overflow: 'hidden', transition: 'all 100ms ease-in-out' }, parseFromValuesOrFunc(paperProps === null || paperProps === void 0 ? void 0 : paperProps.sx, theme))), children: [enableTopToolbar &&
|
2868
2951
|
((_b = parseFromValuesOrFunc(renderTopToolbar, { table })) !== null && _b !== void 0 ? _b : (jsxRuntime.jsx(MRT_TopToolbar, { table: table }))), jsxRuntime.jsx(MRT_TableContainer, { table: table }), enableBottomToolbar &&
|
2869
2952
|
((_c = parseFromValuesOrFunc(renderBottomToolbar, { table })) !== null && _c !== void 0 ? _c : (jsxRuntime.jsx(MRT_BottomToolbar, { table: table })))] })));
|
2870
2953
|
};
|
@@ -2879,7 +2962,7 @@ const MRT_RowPinButton = (_a) => {
|
|
2879
2962
|
event.stopPropagation();
|
2880
2963
|
row.pin(isPinned ? false : pinningPosition);
|
2881
2964
|
};
|
2882
|
-
return (jsxRuntime.jsx(
|
2965
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { 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: {
|
2883
2966
|
transform: `rotate(${rowPinningDisplayMode === 'sticky'
|
2884
2967
|
? 135
|
2885
2968
|
: pinningPosition === 'top'
|
@@ -2898,7 +2981,7 @@ const MRT_TableBodyRowPinButton = (_a) => {
|
|
2898
2981
|
const rowPinButtonProps = Object.assign({ row,
|
2899
2982
|
table }, rest);
|
2900
2983
|
if (rowPinningDisplayMode === 'top-and-bottom' && !row.getIsPinned()) {
|
2901
|
-
return (jsxRuntime.jsxs(
|
2984
|
+
return (jsxRuntime.jsxs(Box__default["default"], { sx: {
|
2902
2985
|
display: 'flex',
|
2903
2986
|
flexDirection: density === 'compact' ? 'row' : 'column',
|
2904
2987
|
}, children: [jsxRuntime.jsx(MRT_RowPinButton, Object.assign({ pinningPosition: "top" }, rowPinButtonProps)), jsxRuntime.jsx(MRT_RowPinButton, Object.assign({ pinningPosition: "bottom" }, rowPinButtonProps))] }));
|
@@ -2915,7 +2998,7 @@ const MRT_ExpandAllButton = (_a) => {
|
|
2915
2998
|
table,
|
2916
2999
|
})), rest);
|
2917
3000
|
const isAllRowsExpanded = getIsAllRowsExpanded();
|
2918
|
-
return (jsxRuntime.jsx(
|
3001
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { 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: {
|
2919
3002
|
transform: `rotate(${isAllRowsExpanded ? -180 : getIsSomeRowsExpanded() ? -90 : 0}deg)`,
|
2920
3003
|
transition: 'transform 150ms',
|
2921
3004
|
} })) })) }) }));
|
@@ -2937,7 +3020,7 @@ const MRT_ExpandButton = ({ row, table, }) => {
|
|
2937
3020
|
row.toggleExpanded();
|
2938
3021
|
(_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(iconButtonProps, event);
|
2939
3022
|
};
|
2940
|
-
return (jsxRuntime.jsx(
|
3023
|
+
return (jsxRuntime.jsx(Tooltip__default["default"], { disableHoverListener: !canExpand && !renderDetailPanel, enterDelay: 1000, enterNextDelay: 1000, title: (_a = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.title) !== null && _a !== void 0 ? _a : (isExpanded ? localization.collapse : localization.expand), children: jsxRuntime.jsx("span", { children: jsxRuntime.jsx(IconButton__default["default"], Object.assign({ "aria-label": localization.expand, disabled: !canExpand && !renderDetailPanel }, iconButtonProps, { onClick: handleToggleExpand, sx: (theme) => (Object.assign({ height: density === 'compact' ? '1.75rem' : '2.25rem', opacity: !canExpand && !renderDetailPanel ? 0.3 : 1, width: density === 'compact' ? '1.75rem' : '2.25rem' }, parseFromValuesOrFunc(iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.sx, theme))), title: undefined, children: (_b = iconButtonProps === null || iconButtonProps === void 0 ? void 0 : iconButtonProps.children) !== null && _b !== void 0 ? _b : (jsxRuntime.jsx(ExpandMoreIcon, { style: {
|
2941
3024
|
transform: `rotate(${!canExpand && !renderDetailPanel ? -90 : isExpanded ? -180 : 0}deg)`,
|
2942
3025
|
transition: 'transform 150ms',
|
2943
3026
|
} })) })) }) }));
|
@@ -2947,9 +3030,9 @@ const MRT_RowActionMenu = (_a) => {
|
|
2947
3030
|
var { anchorEl, handleEdit, row, setAnchorEl, table } = _a, rest = __rest(_a, ["anchorEl", "handleEdit", "row", "setAnchorEl", "table"]);
|
2948
3031
|
const { getState, options: { enableEditing, icons: { EditIcon }, localization, renderRowActionMenuItems, }, } = table;
|
2949
3032
|
const { density } = getState();
|
2950
|
-
return (jsxRuntime.jsxs(
|
3033
|
+
return (jsxRuntime.jsxs(Menu__default["default"], Object.assign({ MenuListProps: {
|
2951
3034
|
dense: density === 'compact',
|
2952
|
-
}, anchorEl: anchorEl, onClick: (event) => event.stopPropagation(), onClose: () => setAnchorEl(null), open: !!anchorEl }, rest, { children: [parseFromValuesOrFunc(enableEditing, row) && (jsxRuntime.jsx(
|
3035
|
+
}, 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({
|
2953
3036
|
closeMenu: () => setAnchorEl(null),
|
2954
3037
|
row,
|
2955
3038
|
table,
|
@@ -2987,7 +3070,7 @@ const MRT_ToggleRowActionMenuButton = (_a) => {
|
|
2987
3070
|
};
|
2988
3071
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: renderRowActions && !showEditActionButtons ? (renderRowActions({ cell, row, table })) : showEditActionButtons ? (jsxRuntime.jsx(MRT_EditActionButtons, { row: row, table: table })) : !renderRowActionMenuItems &&
|
2989
3072
|
parseFromValuesOrFunc(enableEditing, row) &&
|
2990
|
-
['modal', 'row'].includes(editDisplayMode) ? (jsxRuntime.jsx(
|
3073
|
+
['modal', 'row'].includes(editDisplayMode) ? (jsxRuntime.jsx(Tooltip__default["default"], { 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"], { 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 }));
|
2991
3074
|
};
|
2992
3075
|
|
2993
3076
|
const MRT_AggregationFns = Object.assign({}, reactTable.aggregationFns);
|
@@ -3077,39 +3160,39 @@ const MRT_FilterFns = Object.assign(Object.assign({}, reactTable.filterFns), { b
|
|
3077
3160
|
startsWith });
|
3078
3161
|
|
3079
3162
|
const MRT_Default_Icons = {
|
3080
|
-
ArrowDownwardIcon,
|
3081
|
-
ArrowRightIcon,
|
3082
|
-
CancelIcon,
|
3083
|
-
ChevronLeftIcon,
|
3084
|
-
ChevronRightIcon,
|
3085
|
-
ClearAllIcon,
|
3086
|
-
CloseIcon,
|
3087
|
-
DensityLargeIcon,
|
3088
|
-
DensityMediumIcon,
|
3089
|
-
DensitySmallIcon,
|
3090
|
-
DragHandleIcon,
|
3091
|
-
DynamicFeedIcon,
|
3092
|
-
EditIcon,
|
3093
|
-
ExpandMoreIcon,
|
3094
|
-
FilterAltIcon,
|
3095
|
-
FilterListIcon,
|
3096
|
-
FilterListOffIcon,
|
3097
|
-
FirstPageIcon,
|
3098
|
-
FullscreenExitIcon,
|
3099
|
-
FullscreenIcon,
|
3100
|
-
KeyboardDoubleArrowDownIcon,
|
3101
|
-
LastPageIcon,
|
3102
|
-
MoreHorizIcon,
|
3103
|
-
MoreVertIcon,
|
3104
|
-
PushPinIcon,
|
3105
|
-
RestartAltIcon,
|
3106
|
-
SaveIcon,
|
3107
|
-
SearchIcon,
|
3108
|
-
SearchOffIcon,
|
3109
|
-
SortIcon,
|
3110
|
-
SyncAltIcon,
|
3111
|
-
ViewColumnIcon,
|
3112
|
-
VisibilityOffIcon,
|
3163
|
+
ArrowDownwardIcon: ArrowDownwardIcon__default["default"],
|
3164
|
+
ArrowRightIcon: ArrowRightIcon__default["default"],
|
3165
|
+
CancelIcon: CancelIcon__default["default"],
|
3166
|
+
ChevronLeftIcon: ChevronLeftIcon__default["default"],
|
3167
|
+
ChevronRightIcon: ChevronRightIcon__default["default"],
|
3168
|
+
ClearAllIcon: ClearAllIcon__default["default"],
|
3169
|
+
CloseIcon: CloseIcon__default["default"],
|
3170
|
+
DensityLargeIcon: DensityLargeIcon__default["default"],
|
3171
|
+
DensityMediumIcon: DensityMediumIcon__default["default"],
|
3172
|
+
DensitySmallIcon: DensitySmallIcon__default["default"],
|
3173
|
+
DragHandleIcon: DragHandleIcon__default["default"],
|
3174
|
+
DynamicFeedIcon: DynamicFeedIcon__default["default"],
|
3175
|
+
EditIcon: EditIcon__default["default"],
|
3176
|
+
ExpandMoreIcon: ExpandMoreIcon__default["default"],
|
3177
|
+
FilterAltIcon: FilterAltIcon__default["default"],
|
3178
|
+
FilterListIcon: FilterListIcon__default["default"],
|
3179
|
+
FilterListOffIcon: FilterListOffIcon__default["default"],
|
3180
|
+
FirstPageIcon: FirstPageIcon__default["default"],
|
3181
|
+
FullscreenExitIcon: FullscreenExitIcon__default["default"],
|
3182
|
+
FullscreenIcon: FullscreenIcon__default["default"],
|
3183
|
+
KeyboardDoubleArrowDownIcon: KeyboardDoubleArrowDownIcon__default["default"],
|
3184
|
+
LastPageIcon: LastPageIcon__default["default"],
|
3185
|
+
MoreHorizIcon: MoreHorizIcon__default["default"],
|
3186
|
+
MoreVertIcon: MoreVertIcon__default["default"],
|
3187
|
+
PushPinIcon: PushPinIcon__default["default"],
|
3188
|
+
RestartAltIcon: RestartAltIcon__default["default"],
|
3189
|
+
SaveIcon: SaveIcon__default["default"],
|
3190
|
+
SearchIcon: SearchIcon__default["default"],
|
3191
|
+
SearchOffIcon: SearchOffIcon__default["default"],
|
3192
|
+
SortIcon: SortIcon__default["default"],
|
3193
|
+
SyncAltIcon: SyncAltIcon__default["default"],
|
3194
|
+
ViewColumnIcon: ViewColumnIcon__default["default"],
|
3195
|
+
VisibilityOffIcon: VisibilityOffIcon__default["default"],
|
3113
3196
|
};
|
3114
3197
|
|
3115
3198
|
const MRT_Localization_EN = {
|
@@ -3226,7 +3309,7 @@ const MRT_DefaultDisplayColumn = {
|
|
3226
3309
|
};
|
3227
3310
|
const useMRT_TableOptions = (_a) => {
|
3228
3311
|
var _b;
|
3229
|
-
var { aggregationFns, autoResetExpanded = false, columnFilterDisplayMode = 'subheader', columnResizeMode = 'onChange', createDisplayMode = 'modal', defaultColumn, defaultDisplayColumn, editDisplayMode = 'modal', enableBottomToolbar = true, enableColumnActions = true, enableColumnFilters = true, enableColumnOrdering = false, enableColumnPinning = false, enableColumnResizing = false, enableDensityToggle = true, enableExpandAll = true, enableExpanding, enableFilterMatchHighlighting = true, enableFilters = true, enableFullScreenToggle = true, enableGlobalFilter = true, enableGlobalFilterRankedResults = true, enableGrouping = false, enableHiding = true, enableMultiRowSelection = true, enableMultiSort = true, enablePagination = true, enableRowPinning = false, enableRowSelection = false, enableSelectAll = true, enableSorting = true, enableStickyHeader = false, enableTableFooter = true, enableTableHead = true, enableToolbarInternalActions = true, enableTopToolbar = true, filterFns, icons, layoutMode = 'semantic', localization, manualFiltering, manualGrouping, manualPagination, manualSorting, paginationDisplayMode = 'default', positionActionsColumn = 'first', positionExpandColumn = 'first', positionGlobalFilter = 'right', positionPagination = 'bottom', positionToolbarAlertBanner = 'top', positionToolbarDropZone = 'top',
|
3312
|
+
var { aggregationFns, autoResetExpanded = false, columnFilterDisplayMode = 'subheader', columnResizeMode = 'onChange', createDisplayMode = 'modal', defaultColumn, defaultDisplayColumn, editDisplayMode = 'modal', enableBottomToolbar = true, enableColumnActions = true, enableColumnFilters = true, enableColumnOrdering = false, enableColumnPinning = false, enableColumnResizing = false, enableDensityToggle = true, enableExpandAll = true, enableExpanding, enableFilterMatchHighlighting = true, enableFilters = true, enableFullScreenToggle = true, enableGlobalFilter = true, enableGlobalFilterRankedResults = true, enableGrouping = false, enableHiding = true, enableMultiRowSelection = true, enableMultiSort = true, enablePagination = true, enableRowPinning = false, enableRowSelection = false, enableSelectAll = true, enableSorting = true, enableStickyHeader = false, enableTableFooter = true, enableTableHead = true, enableToolbarInternalActions = true, enableTopToolbar = true, filterFns, icons, layoutMode = 'semantic', localization, manualFiltering, manualGrouping, manualPagination, manualSorting, paginationDisplayMode = 'default', positionActionsColumn = 'first', positionExpandColumn = 'first', positionGlobalFilter = 'right', positionPagination = 'bottom', positionToolbarAlertBanner = 'top', positionToolbarDropZone = 'top', rowNumberDisplayMode = 'static', rowPinningDisplayMode = 'sticky', selectAllMode = 'page', sortingFns } = _a, rest = __rest(_a, ["aggregationFns", "autoResetExpanded", "columnFilterDisplayMode", "columnResizeMode", "createDisplayMode", "defaultColumn", "defaultDisplayColumn", "editDisplayMode", "enableBottomToolbar", "enableColumnActions", "enableColumnFilters", "enableColumnOrdering", "enableColumnPinning", "enableColumnResizing", "enableDensityToggle", "enableExpandAll", "enableExpanding", "enableFilterMatchHighlighting", "enableFilters", "enableFullScreenToggle", "enableGlobalFilter", "enableGlobalFilterRankedResults", "enableGrouping", "enableHiding", "enableMultiRowSelection", "enableMultiSort", "enablePagination", "enableRowPinning", "enableRowSelection", "enableSelectAll", "enableSorting", "enableStickyHeader", "enableTableFooter", "enableTableHead", "enableToolbarInternalActions", "enableTopToolbar", "filterFns", "icons", "layoutMode", "localization", "manualFiltering", "manualGrouping", "manualPagination", "manualSorting", "paginationDisplayMode", "positionActionsColumn", "positionExpandColumn", "positionGlobalFilter", "positionPagination", "positionToolbarAlertBanner", "positionToolbarDropZone", "rowNumberDisplayMode", "rowPinningDisplayMode", "selectAllMode", "sortingFns"]);
|
3230
3313
|
const _icons = react.useMemo(() => (Object.assign(Object.assign({}, MRT_Default_Icons), icons)), [icons]);
|
3231
3314
|
const _localization = react.useMemo(() => (Object.assign(Object.assign({}, MRT_Localization_EN), localization)), [localization]);
|
3232
3315
|
const _aggregationFns = react.useMemo(() => (Object.assign(Object.assign({}, MRT_AggregationFns), aggregationFns)), []);
|
@@ -3296,7 +3379,7 @@ const useMRT_TableOptions = (_a) => {
|
|
3296
3379
|
positionPagination,
|
3297
3380
|
positionToolbarAlertBanner,
|
3298
3381
|
positionToolbarDropZone,
|
3299
|
-
|
3382
|
+
rowNumberDisplayMode,
|
3300
3383
|
rowPinningDisplayMode,
|
3301
3384
|
selectAllMode, sortingFns: _sortingFns }, rest);
|
3302
3385
|
};
|
@@ -3621,6 +3704,8 @@ exports.MRT_BottomToolbar = MRT_BottomToolbar;
|
|
3621
3704
|
exports.MRT_ColumnActionMenu = MRT_ColumnActionMenu;
|
3622
3705
|
exports.MRT_ColumnPinningButtons = MRT_ColumnPinningButtons;
|
3623
3706
|
exports.MRT_CopyButton = MRT_CopyButton;
|
3707
|
+
exports.MRT_DefaultColumn = MRT_DefaultColumn;
|
3708
|
+
exports.MRT_DefaultDisplayColumn = MRT_DefaultDisplayColumn;
|
3624
3709
|
exports.MRT_EditActionButtons = MRT_EditActionButtons;
|
3625
3710
|
exports.MRT_EditCellTextField = MRT_EditCellTextField;
|
3626
3711
|
exports.MRT_EditRowModal = MRT_EditRowModal;
|
@@ -3700,6 +3785,7 @@ exports.getLeadingDisplayColumnIds = getLeadingDisplayColumnIds;
|
|
3700
3785
|
exports.getMRTTheme = getMRTTheme;
|
3701
3786
|
exports.getTotalRight = getTotalRight;
|
3702
3787
|
exports.getTrailingDisplayColumnIds = getTrailingDisplayColumnIds;
|
3788
|
+
exports.getValueAndLabel = getValueAndLabel;
|
3703
3789
|
exports.mrtFilterOptions = mrtFilterOptions;
|
3704
3790
|
exports.parseCSSVarId = parseCSSVarId;
|
3705
3791
|
exports.parseFromValuesOrFunc = parseFromValuesOrFunc;
|
@@ -3707,5 +3793,9 @@ exports.prepareColumns = prepareColumns;
|
|
3707
3793
|
exports.rankGlobalFuzzy = rankGlobalFuzzy;
|
3708
3794
|
exports.reorderColumn = reorderColumn;
|
3709
3795
|
exports.showExpandColumn = showExpandColumn;
|
3796
|
+
exports.useMRT_DisplayColumns = useMRT_DisplayColumns;
|
3797
|
+
exports.useMRT_Effects = useMRT_Effects;
|
3798
|
+
exports.useMRT_TableInstance = useMRT_TableInstance;
|
3799
|
+
exports.useMRT_TableOptions = useMRT_TableOptions;
|
3710
3800
|
exports.useMaterialReactTable = useMaterialReactTable;
|
3711
3801
|
//# sourceMappingURL=index.js.map
|