material-react-table 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MaterialReactTable.d.ts +46 -44
- package/dist/buttons/MRT_EditActionButtons.d.ts +7 -0
- package/dist/buttons/MRT_ToggleFiltersButton.d.ts +4 -0
- package/dist/buttons/MRT_ToggleRowActionMenuButton.d.ts +7 -0
- package/dist/head/MRT_TableHeadCell.d.ts +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/inputs/MRT_DensePaddingSwitch.d.ts +5 -0
- package/dist/material-react-table.cjs.development.js +1459 -412
- package/dist/material-react-table.cjs.development.js.map +1 -1
- package/dist/material-react-table.cjs.production.min.js +1 -1
- package/dist/material-react-table.cjs.production.min.js.map +1 -1
- package/dist/material-react-table.esm.js +1474 -427
- package/dist/material-react-table.esm.js.map +1 -1
- package/dist/menus/MRT_RowActionMenu.d.ts +9 -0
- package/dist/{footer → toolbar}/MRT_TablePagination.d.ts +0 -0
- package/dist/toolbar/MRT_ToolbarBottom.d.ts +5 -0
- package/dist/toolbar/MRT_ToolbarButtons.d.ts +5 -0
- package/dist/toolbar/{MRT_Toolbar.d.ts → MRT_ToolbarTop.d.ts} +1 -1
- package/dist/useMaterialReactTable.d.ts +7 -1
- package/dist/utils/localization.d.ts +22 -14
- package/package.json +15 -13
- package/src/MaterialReactTable.tsx +117 -100
- package/src/body/MRT_TableBody.tsx +26 -27
- package/src/body/MRT_TableBodyCell.tsx +17 -6
- package/src/body/MRT_TableBodyRow.tsx +39 -23
- package/src/body/MRT_TableDetailPanel.tsx +38 -14
- package/src/buttons/MRT_EditActionButtons.tsx +51 -0
- package/src/buttons/MRT_ExpandAllButton.tsx +9 -4
- package/src/buttons/MRT_ExpandButton.tsx +12 -6
- package/src/buttons/MRT_ShowHideColumnsButton.tsx +12 -12
- package/src/buttons/MRT_ToggleColumnActionMenuButton.tsx +1 -1
- package/src/buttons/MRT_ToggleFiltersButton.tsx +23 -0
- package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +65 -0
- package/src/footer/MRT_TableFooter.tsx +2 -17
- package/src/footer/MRT_TableFooterCell.tsx +18 -7
- package/src/footer/MRT_TableFooterRow.tsx +28 -14
- package/src/head/MRT_TableHead.tsx +6 -18
- package/src/head/MRT_TableHeadCell.tsx +37 -17
- package/src/head/MRT_TableHeadRow.tsx +42 -14
- package/src/index.tsx +2 -5
- package/src/inputs/MRT_DensePaddingSwitch.tsx +21 -0
- package/src/inputs/MRT_FilterTextField.tsx +5 -0
- package/src/inputs/MRT_SearchTextField.tsx +4 -4
- package/src/inputs/MRT_SelectAllCheckbox.tsx +11 -3
- package/src/inputs/MRT_SelectCheckbox.tsx +9 -2
- package/src/menus/MRT_ColumnActionMenu.tsx +29 -24
- package/src/menus/MRT_RowActionMenu.tsx +52 -0
- package/src/menus/MRT_ShowHideColumnsMenu.tsx +2 -2
- package/src/table/MRT_Table.tsx +13 -4
- package/src/table/MRT_TableContainer.tsx +9 -5
- package/src/table/MRT_TableSpacerCell.tsx +17 -1
- package/src/toolbar/MRT_TablePagination.tsx +37 -0
- package/src/toolbar/MRT_ToolbarBottom.tsx +58 -0
- package/src/toolbar/MRT_ToolbarButtons.tsx +27 -0
- package/src/toolbar/MRT_ToolbarTop.tsx +81 -0
- package/src/useMaterialReactTable.tsx +36 -32
- package/src/utils/localization.ts +32 -16
- package/dist/utils/overrideWarnings.d.ts +0 -1
- package/src/footer/MRT_TablePagination.tsx +0 -42
- package/src/toolbar/MRT_Toolbar.tsx +0 -39
- package/src/utils/overrideWarnings.ts +0 -41
|
@@ -16,9 +16,50 @@ var SortIcon = _interopDefault(require('@mui/icons-material/Sort'));
|
|
|
16
16
|
var VisibilityOffIcon = _interopDefault(require('@mui/icons-material/VisibilityOff'));
|
|
17
17
|
var DynamicFeedIcon = _interopDefault(require('@mui/icons-material/DynamicFeed'));
|
|
18
18
|
var ArrowRightIcon = _interopDefault(require('@mui/icons-material/KeyboardDoubleArrowDown'));
|
|
19
|
-
var ViewColumnIcon = _interopDefault(require('@mui/icons-material/ViewColumn'));
|
|
20
19
|
var ExpandMoreIcon = _interopDefault(require('@mui/icons-material/ExpandMore'));
|
|
20
|
+
var MoreHorizIcon = _interopDefault(require('@mui/icons-material/MoreHoriz'));
|
|
21
|
+
var EditIcon = _interopDefault(require('@mui/icons-material/Edit'));
|
|
22
|
+
var SaveIcon = _interopDefault(require('@mui/icons-material/Save'));
|
|
23
|
+
var CancelIcon = _interopDefault(require('@mui/icons-material/Cancel'));
|
|
21
24
|
var SearchIcon = _interopDefault(require('@mui/icons-material/Search'));
|
|
25
|
+
var FilterListOffIcon = _interopDefault(require('@mui/icons-material/FilterListOff'));
|
|
26
|
+
var ViewColumnIcon = _interopDefault(require('@mui/icons-material/ViewColumn'));
|
|
27
|
+
|
|
28
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
29
|
+
try {
|
|
30
|
+
var info = gen[key](arg);
|
|
31
|
+
var value = info.value;
|
|
32
|
+
} catch (error) {
|
|
33
|
+
reject(error);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (info.done) {
|
|
38
|
+
resolve(value);
|
|
39
|
+
} else {
|
|
40
|
+
Promise.resolve(value).then(_next, _throw);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function _asyncToGenerator(fn) {
|
|
45
|
+
return function () {
|
|
46
|
+
var self = this,
|
|
47
|
+
args = arguments;
|
|
48
|
+
return new Promise(function (resolve, reject) {
|
|
49
|
+
var gen = fn.apply(self, args);
|
|
50
|
+
|
|
51
|
+
function _next(value) {
|
|
52
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function _throw(err) {
|
|
56
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
_next(undefined);
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
}
|
|
22
63
|
|
|
23
64
|
function _extends() {
|
|
24
65
|
_extends = Object.assign || function (target) {
|
|
@@ -83,97 +124,44 @@ var useMRTCalcs = function useMRTCalcs(_ref) {
|
|
|
83
124
|
};
|
|
84
125
|
};
|
|
85
126
|
|
|
86
|
-
var showoverrideWarnings = function showoverrideWarnings(props) {
|
|
87
|
-
if (props.overrideTableBodyCellComponent) {
|
|
88
|
-
showWarning('TableCell', 'props');
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if (props.overrideTableBodyComponent) {
|
|
92
|
-
showWarning('TableBody', 'tableBodyProps');
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if (props.overrideTableBodyRowComponent) {
|
|
96
|
-
showWarning('TableRow', 'props');
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (props.overrideTableDetailPanelComponent) {
|
|
100
|
-
showWarning('Detail Panel', 'tableDetailPanelProps');
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
if (props.overrideTableFooterComponent) {
|
|
104
|
-
showWarning('TableFooter', 'tableFooterProps');
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (props.overrideTableFooterCellComponent) {
|
|
108
|
-
showWarning('TableCell', 'props');
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (props.overrideTableFooterRowComponent) {
|
|
112
|
-
showWarning('TableRow', 'props');
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (props.overrideTableHeadComponent) {
|
|
116
|
-
showWarning('TableHead', 'tableHeadProps');
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
if (props.overrideTableHeadRowComponent) {
|
|
120
|
-
showWarning('TableRow', 'props');
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
if (props.overrideTablePaginationComponent) {
|
|
124
|
-
showWarning('', 'props');
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
if (props.overrideTableToolbarComponent) {
|
|
128
|
-
showWarning('TableBodyCell', 'props');
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
var showWarning = function showWarning(componentName, propsName) {
|
|
133
|
-
console.warn("Caution.\nYou are overriding the built-in Mui " + componentName + " Component in material-react-table.\n\nYou should only use this as a last resort!\n\nConsider customizing the Mui " + componentName + " Component instead with " + propsName + ".");
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
var _excluded = ["children", "columns", "data", "defaultColumn", "getRowId", "getSubRows", "initialState", "stateReducer", "surpressoverrideWarnings"];
|
|
137
|
-
|
|
138
127
|
var MaterialReactTableContext = /*#__PURE__*/function () {
|
|
139
128
|
return React.createContext({});
|
|
140
129
|
}();
|
|
141
130
|
|
|
142
|
-
var MaterialReactTableProvider = function MaterialReactTableProvider(
|
|
143
|
-
var
|
|
144
|
-
columns = _ref.columns,
|
|
145
|
-
data = _ref.data,
|
|
146
|
-
defaultColumn = _ref.defaultColumn,
|
|
147
|
-
getRowId = _ref.getRowId,
|
|
148
|
-
getSubRows = _ref.getSubRows,
|
|
149
|
-
initialState = _ref.initialState,
|
|
150
|
-
stateReducer = _ref.stateReducer,
|
|
151
|
-
surpressoverrideWarnings = _ref.surpressoverrideWarnings,
|
|
152
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
131
|
+
var MaterialReactTableProvider = function MaterialReactTableProvider(props) {
|
|
132
|
+
var _props$defaultShowFil, _props$defaultDensePa;
|
|
153
133
|
|
|
154
|
-
var
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
defaultColumn: defaultColumn,
|
|
158
|
-
getRowId: getRowId,
|
|
159
|
-
getSubRows: getSubRows,
|
|
160
|
-
initialState: initialState,
|
|
161
|
-
stateReducer: stateReducer
|
|
162
|
-
}, reactTable.useFlexLayout, reactTable.useResizeColumns, reactTable.useFilters, reactTable.useGlobalFilter, reactTable.useGroupBy, reactTable.useSortBy, reactTable.useExpanded, reactTable.usePagination, reactTable.useRowSelect);
|
|
134
|
+
var hooks = [reactTable.useResizeColumns, reactTable.useFilters, reactTable.useGlobalFilter, reactTable.useGroupBy, reactTable.useSortBy, reactTable.useExpanded, reactTable.usePagination, reactTable.useRowSelect];
|
|
135
|
+
if (props.enableColumnResizing) hooks.unshift(reactTable.useFlexLayout);
|
|
136
|
+
var tableInstance = reactTable.useTable.apply(void 0, [props].concat(hooks));
|
|
163
137
|
var mrtCalcs = useMRTCalcs({
|
|
164
138
|
tableInstance: tableInstance
|
|
165
139
|
});
|
|
166
140
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
141
|
+
var _useState = React.useState((_props$defaultShowFil = props.defaultShowFilters) != null ? _props$defaultShowFil : false),
|
|
142
|
+
showFilters = _useState[0],
|
|
143
|
+
setShowFilters = _useState[1];
|
|
144
|
+
|
|
145
|
+
var _useState2 = React.useState((_props$defaultDensePa = props.defaultDensePadding) != null ? _props$defaultDensePa : false),
|
|
146
|
+
densePadding = _useState2[0],
|
|
147
|
+
setDensePadding = _useState2[1];
|
|
148
|
+
|
|
149
|
+
var _useState3 = React.useState(null),
|
|
150
|
+
currentEditingRowId = _useState3[0],
|
|
151
|
+
setCurrentEditingRowId = _useState3[1];
|
|
170
152
|
|
|
171
153
|
return React__default.createElement(MaterialReactTableContext.Provider, {
|
|
172
|
-
value: _extends({
|
|
173
|
-
|
|
154
|
+
value: _extends({}, mrtCalcs, props, {
|
|
155
|
+
densePadding: densePadding,
|
|
156
|
+
setDensePadding: setDensePadding,
|
|
157
|
+
setShowFilters: setShowFilters,
|
|
158
|
+
currentEditingRowId: currentEditingRowId,
|
|
159
|
+
setCurrentEditingRowId: setCurrentEditingRowId,
|
|
160
|
+
showFilters: showFilters,
|
|
161
|
+
// @ts-ignore
|
|
174
162
|
tableInstance: tableInstance
|
|
175
|
-
}
|
|
176
|
-
}, children);
|
|
163
|
+
})
|
|
164
|
+
}, props.children);
|
|
177
165
|
};
|
|
178
166
|
var useMaterialReactTable = function useMaterialReactTable() {
|
|
179
167
|
return (//@ts-ignore
|
|
@@ -200,6 +188,13 @@ var MRT_FilterTextfield = function MRT_FilterTextfield(_ref) {
|
|
|
200
188
|
column.setFilter(undefined);
|
|
201
189
|
};
|
|
202
190
|
|
|
191
|
+
if (column.Filter) {
|
|
192
|
+
//@ts-ignore
|
|
193
|
+
return React__default.createElement(React__default.Fragment, null, column.Filter({
|
|
194
|
+
column: column
|
|
195
|
+
}));
|
|
196
|
+
}
|
|
197
|
+
|
|
203
198
|
return React__default.createElement(material.TextField, {
|
|
204
199
|
margin: "dense",
|
|
205
200
|
placeholder: localization == null ? void 0 : localization.filterTextFieldPlaceholder,
|
|
@@ -241,9 +236,9 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
|
|
|
241
236
|
setAnchorEl = _ref.setAnchorEl;
|
|
242
237
|
|
|
243
238
|
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
244
|
-
|
|
239
|
+
disableColumnHiding = _useMaterialReactTabl.disableColumnHiding,
|
|
245
240
|
enableColumnGrouping = _useMaterialReactTabl.enableColumnGrouping,
|
|
246
|
-
|
|
241
|
+
disableSortBy = _useMaterialReactTabl.disableSortBy,
|
|
247
242
|
localization = _useMaterialReactTabl.localization;
|
|
248
243
|
|
|
249
244
|
var handleClearSort = function handleClearSort() {
|
|
@@ -277,7 +272,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
|
|
|
277
272
|
onClose: function onClose() {
|
|
278
273
|
return setAnchorEl(null);
|
|
279
274
|
}
|
|
280
|
-
},
|
|
275
|
+
}, !disableSortBy && column.canSort && [React__default.createElement(MenuItem, {
|
|
281
276
|
key: 1,
|
|
282
277
|
disabled: !column.isSorted,
|
|
283
278
|
onClick: handleClearSort
|
|
@@ -295,7 +290,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
|
|
|
295
290
|
}
|
|
296
291
|
}), ' ', localization == null ? void 0 : localization.columnActionMenuItemSortDesc), React__default.createElement(material.Divider, {
|
|
297
292
|
key: 4
|
|
298
|
-
})],
|
|
293
|
+
})], !disableColumnHiding && React__default.createElement(MenuItem, {
|
|
299
294
|
onClick: handleHideColumn
|
|
300
295
|
}, React__default.createElement(VisibilityOffIcon, null), " ", localization == null ? void 0 : localization.columnActionMenuItemHideColumn), enableColumnGrouping && column.canGroupBy && React__default.createElement(MenuItem, {
|
|
301
296
|
disabled: column.isGrouped,
|
|
@@ -307,7 +302,7 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
|
|
|
307
302
|
};
|
|
308
303
|
|
|
309
304
|
var IconButton = /*#__PURE__*/material.styled(material.IconButton)({
|
|
310
|
-
opacity: 0.
|
|
305
|
+
opacity: 0.5,
|
|
311
306
|
transition: 'opacity 0.2s',
|
|
312
307
|
marginRight: '2px',
|
|
313
308
|
height: '2rem',
|
|
@@ -344,8 +339,9 @@ var MRT_ToggleColumnActionMenuButton = function MRT_ToggleColumnActionMenuButton
|
|
|
344
339
|
}));
|
|
345
340
|
};
|
|
346
341
|
|
|
347
|
-
var
|
|
348
|
-
fontWeight: 'bold'
|
|
342
|
+
var StyledTableHeadCell = /*#__PURE__*/material.styled(material.TableCell)({
|
|
343
|
+
fontWeight: 'bold',
|
|
344
|
+
verticalAlign: 'text-top'
|
|
349
345
|
});
|
|
350
346
|
var TableCellContents = /*#__PURE__*/material.styled('div')({
|
|
351
347
|
display: 'grid'
|
|
@@ -357,7 +353,8 @@ var TableCellText = /*#__PURE__*/material.styled('div')({
|
|
|
357
353
|
});
|
|
358
354
|
var CellFlexItem = /*#__PURE__*/material.styled('span')({
|
|
359
355
|
display: 'flex',
|
|
360
|
-
flexWrap: 'nowrap'
|
|
356
|
+
flexWrap: 'nowrap',
|
|
357
|
+
alignItems: 'center'
|
|
361
358
|
});
|
|
362
359
|
var Divider = /*#__PURE__*/material.styled(material.Divider)({
|
|
363
360
|
borderRightWidth: '2px',
|
|
@@ -365,36 +362,44 @@ var Divider = /*#__PURE__*/material.styled(material.Divider)({
|
|
|
365
362
|
maxHeight: '2rem'
|
|
366
363
|
});
|
|
367
364
|
var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
|
|
368
|
-
var _column$columns$lengt, _column$columns
|
|
365
|
+
var _column$columns$lengt, _column$columns, _mTableHeadCellProps$;
|
|
369
366
|
|
|
370
367
|
var column = _ref.column;
|
|
371
368
|
|
|
372
369
|
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
373
|
-
|
|
374
|
-
|
|
370
|
+
densePadding = _useMaterialReactTabl.densePadding,
|
|
371
|
+
disableColumnActions = _useMaterialReactTabl.disableColumnActions,
|
|
372
|
+
disableFilters = _useMaterialReactTabl.disableFilters,
|
|
375
373
|
enableColumnResizing = _useMaterialReactTabl.enableColumnResizing,
|
|
376
|
-
|
|
377
|
-
|
|
374
|
+
localization = _useMaterialReactTabl.localization,
|
|
375
|
+
muiTableHeadCellProps = _useMaterialReactTabl.muiTableHeadCellProps,
|
|
376
|
+
showFilters = _useMaterialReactTabl.showFilters,
|
|
378
377
|
tableInstance = _useMaterialReactTabl.tableInstance;
|
|
379
378
|
|
|
380
|
-
if (overrideTableHeadCellComponent) {
|
|
381
|
-
return React__default.createElement(React__default.Fragment, null, overrideTableHeadCellComponent(column, tableInstance));
|
|
382
|
-
}
|
|
383
|
-
|
|
384
379
|
var isParentHeader = ((_column$columns$lengt = column == null ? void 0 : (_column$columns = column.columns) == null ? void 0 : _column$columns.length) != null ? _column$columns$lengt : 0) > 0;
|
|
385
|
-
|
|
380
|
+
var mTableHeadCellProps = muiTableHeadCellProps instanceof Function ? muiTableHeadCellProps(column) : muiTableHeadCellProps;
|
|
381
|
+
|
|
382
|
+
var tableCellProps = _extends({}, mTableHeadCellProps, column.getHeaderProps(), {
|
|
383
|
+
style: _extends({
|
|
384
|
+
padding: densePadding ? '0.5rem' : '1rem',
|
|
385
|
+
transition: "all " + (enableColumnResizing ? '10ms' : '0.2s') + " ease-in-out"
|
|
386
|
+
}, column.getHeaderProps().style, (_mTableHeadCellProps$ = mTableHeadCellProps == null ? void 0 : mTableHeadCellProps.style) != null ? _mTableHeadCellProps$ : {})
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
return React__default.createElement(StyledTableHeadCell, Object.assign({
|
|
386
390
|
align: isParentHeader ? 'center' : 'left'
|
|
387
|
-
},
|
|
391
|
+
}, tableCellProps), React__default.createElement(TableCellContents, null, React__default.createElement(TableCellText, {
|
|
388
392
|
style: {
|
|
389
393
|
justifyContent: isParentHeader ? 'center' : undefined
|
|
390
394
|
}
|
|
391
395
|
}, React__default.createElement(CellFlexItem, Object.assign({}, column.getSortByToggleProps()), column.render('Header'), !isParentHeader && column.canSort && React__default.createElement(material.TableSortLabel, {
|
|
396
|
+
"aria-label": column.isSorted ? column.sortDescFirst ? localization == null ? void 0 : localization.columnActionMenuItemClearSort : localization == null ? void 0 : localization.columnActionMenuItemSortDesc : localization == null ? void 0 : localization.columnActionMenuItemSortAsc,
|
|
392
397
|
active: column.isSorted,
|
|
393
398
|
direction: column.isSortedDesc ? 'desc' : 'asc',
|
|
394
399
|
style: {
|
|
395
400
|
margin: 0
|
|
396
401
|
}
|
|
397
|
-
})), React__default.createElement(CellFlexItem, null,
|
|
402
|
+
})), React__default.createElement(CellFlexItem, null, !disableColumnActions && !isParentHeader && React__default.createElement(MRT_ToggleColumnActionMenuButton, {
|
|
398
403
|
column: column
|
|
399
404
|
}), enableColumnResizing && !isParentHeader && React__default.createElement(Divider, Object.assign({
|
|
400
405
|
flexItem: true,
|
|
@@ -402,8 +407,8 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
|
|
|
402
407
|
onDoubleClick: function onDoubleClick() {
|
|
403
408
|
return tableInstance.resetResizing();
|
|
404
409
|
}
|
|
405
|
-
}, column.getResizerProps())))),
|
|
406
|
-
"in":
|
|
410
|
+
}, column.getResizerProps())))), !disableFilters && column.canFilter && React__default.createElement(material.Collapse, {
|
|
411
|
+
"in": showFilters
|
|
407
412
|
}, React__default.createElement(MRT_FilterTextfield, {
|
|
408
413
|
column: column
|
|
409
414
|
}))));
|
|
@@ -412,15 +417,17 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
|
|
|
412
417
|
var MRT_SelectAllCheckbox = function MRT_SelectAllCheckbox() {
|
|
413
418
|
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
414
419
|
tableInstance = _useMaterialReactTabl.tableInstance,
|
|
415
|
-
|
|
420
|
+
disableSelectAll = _useMaterialReactTabl.disableSelectAll,
|
|
421
|
+
densePadding = _useMaterialReactTabl.densePadding;
|
|
416
422
|
|
|
417
423
|
return React__default.createElement(material.TableCell, {
|
|
418
424
|
style: {
|
|
419
425
|
width: '2rem',
|
|
420
|
-
padding: '0.
|
|
426
|
+
padding: densePadding ? '0' : '0.6rem',
|
|
427
|
+
transition: 'all 0.2s ease-in-out'
|
|
421
428
|
},
|
|
422
429
|
variant: "head"
|
|
423
|
-
},
|
|
430
|
+
}, !disableSelectAll ? React__default.createElement(material.Checkbox, Object.assign({
|
|
424
431
|
"aria-label": ""
|
|
425
432
|
}, tableInstance.getToggleAllPageRowsSelectedProps())) : null);
|
|
426
433
|
};
|
|
@@ -430,14 +437,15 @@ var MRT_ExpandAllButton = function MRT_ExpandAllButton() {
|
|
|
430
437
|
tableInstance = _useMaterialReactTabl.tableInstance,
|
|
431
438
|
localization = _useMaterialReactTabl.localization,
|
|
432
439
|
anyRowsExpanded = _useMaterialReactTabl.anyRowsExpanded,
|
|
440
|
+
densePadding = _useMaterialReactTabl.densePadding,
|
|
433
441
|
renderDetailPanel = _useMaterialReactTabl.renderDetailPanel;
|
|
434
442
|
|
|
435
443
|
return React__default.createElement(material.TableCell, Object.assign({
|
|
436
444
|
size: "small"
|
|
437
445
|
}, tableInstance.getToggleAllRowsExpandedProps(), {
|
|
438
446
|
style: {
|
|
439
|
-
padding: '0.5rem',
|
|
440
|
-
|
|
447
|
+
padding: densePadding ? '0' : '0.5rem 0.5rem',
|
|
448
|
+
transition: 'all 0.2s ease-in-out',
|
|
441
449
|
width: (renderDetailPanel ? 2 : tableInstance.expandedDepth + 2) + "rem"
|
|
442
450
|
}
|
|
443
451
|
}), React__default.createElement(material.IconButton, {
|
|
@@ -452,100 +460,41 @@ var MRT_ExpandAllButton = function MRT_ExpandAllButton() {
|
|
|
452
460
|
})));
|
|
453
461
|
};
|
|
454
462
|
|
|
455
|
-
var
|
|
456
|
-
var
|
|
457
|
-
|
|
458
|
-
var column = _ref.column;
|
|
459
|
-
|
|
460
|
-
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
461
|
-
maxColumnDepth = _useMaterialReactTabl.maxColumnDepth;
|
|
463
|
+
var MRT_TableSpacerCell = function MRT_TableSpacerCell(_ref) {
|
|
464
|
+
var _mTableBodyRowProps$s;
|
|
462
465
|
|
|
463
|
-
var
|
|
464
|
-
return React__default.createElement(React__default.Fragment, null, React__default.createElement(material.MenuItem, {
|
|
465
|
-
style: {
|
|
466
|
-
paddingLeft: column.depth + 1 + "rem"
|
|
467
|
-
}
|
|
468
|
-
}, isMaxDepth ? React__default.createElement(material.FormControlLabel, {
|
|
469
|
-
onChange: function onChange() {
|
|
470
|
-
return isMaxDepth && column.toggleHidden();
|
|
471
|
-
},
|
|
472
|
-
label: column.Header,
|
|
473
|
-
checked: column.isVisible,
|
|
474
|
-
control: React__default.createElement(material.Switch, null)
|
|
475
|
-
}) : React__default.createElement(material.Typography, null, column.Header)), (_column$columns = column.columns) == null ? void 0 : _column$columns.map(function (c, i) {
|
|
476
|
-
return React__default.createElement(MRT_ShowHideColumnsMenu, {
|
|
477
|
-
key: i + "-" + c.id,
|
|
478
|
-
column: c
|
|
479
|
-
});
|
|
480
|
-
}));
|
|
481
|
-
};
|
|
466
|
+
var width = _ref.width;
|
|
482
467
|
|
|
483
|
-
var MRT_ShowHideColumnsButton = function MRT_ShowHideColumnsButton() {
|
|
484
468
|
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
485
|
-
|
|
486
|
-
localization = _useMaterialReactTabl.localization;
|
|
487
|
-
|
|
488
|
-
var _useState = React.useState(null),
|
|
489
|
-
anchorEl = _useState[0],
|
|
490
|
-
setAnchorEl = _useState[1];
|
|
491
|
-
|
|
492
|
-
var handleClick = function handleClick(event) {
|
|
493
|
-
setAnchorEl(event.currentTarget);
|
|
494
|
-
};
|
|
469
|
+
muiTableBodyCellProps = _useMaterialReactTabl.muiTableBodyCellProps;
|
|
495
470
|
|
|
496
|
-
|
|
497
|
-
size: "small",
|
|
498
|
-
style: {
|
|
499
|
-
width: '2rem',
|
|
500
|
-
padding: '0.75rem 0'
|
|
501
|
-
}
|
|
502
|
-
}, React__default.createElement(material.IconButton, {
|
|
503
|
-
"aria-label": localization == null ? void 0 : localization.showHideColumnsButtonTitle,
|
|
504
|
-
title: localization == null ? void 0 : localization.showHideColumnsButtonTitle,
|
|
505
|
-
onClick: handleClick,
|
|
506
|
-
size: "small",
|
|
507
|
-
style: {
|
|
508
|
-
margin: '0 0 0 -0.75rem'
|
|
509
|
-
}
|
|
510
|
-
}, React__default.createElement(ViewColumnIcon, null)), React__default.createElement(material.Menu, {
|
|
511
|
-
anchorEl: anchorEl,
|
|
512
|
-
open: !!anchorEl,
|
|
513
|
-
onClose: function onClose() {
|
|
514
|
-
return setAnchorEl(null);
|
|
515
|
-
}
|
|
516
|
-
}, tableInstance.columns.map(function (column, index) {
|
|
517
|
-
return React__default.createElement(MRT_ShowHideColumnsMenu, {
|
|
518
|
-
key: index + "-" + column.id,
|
|
519
|
-
column: column
|
|
520
|
-
});
|
|
521
|
-
})));
|
|
522
|
-
};
|
|
471
|
+
var mTableBodyRowProps = muiTableBodyCellProps instanceof Function ? muiTableBodyCellProps() : muiTableBodyCellProps;
|
|
523
472
|
|
|
524
|
-
var
|
|
525
|
-
|
|
526
|
-
return React__default.createElement(material.TableCell, {
|
|
527
|
-
style: {
|
|
473
|
+
var tableCellProps = _extends({}, mTableBodyRowProps, {
|
|
474
|
+
style: _extends({
|
|
528
475
|
width: width
|
|
529
|
-
}
|
|
476
|
+
}, (_mTableBodyRowProps$s = mTableBodyRowProps == null ? void 0 : mTableBodyRowProps.style) != null ? _mTableBodyRowProps$s : {})
|
|
530
477
|
});
|
|
478
|
+
|
|
479
|
+
return React__default.createElement(material.TableCell, Object.assign({}, tableCellProps));
|
|
531
480
|
};
|
|
532
481
|
|
|
533
482
|
var MRT_TableHeadRow = function MRT_TableHeadRow(_ref) {
|
|
483
|
+
var _mTableHeadRowProps$s;
|
|
484
|
+
|
|
534
485
|
var headerGroup = _ref.headerGroup;
|
|
535
486
|
|
|
536
487
|
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
537
|
-
overrideTableHeadRowComponent = _useMaterialReactTabl.overrideTableHeadRowComponent,
|
|
538
488
|
anyRowsCanExpand = _useMaterialReactTabl.anyRowsCanExpand,
|
|
539
|
-
|
|
540
|
-
|
|
489
|
+
disableExpandAll = _useMaterialReactTabl.disableExpandAll,
|
|
490
|
+
enableRowActions = _useMaterialReactTabl.enableRowActions,
|
|
541
491
|
enableSelection = _useMaterialReactTabl.enableSelection,
|
|
492
|
+
localization = _useMaterialReactTabl.localization,
|
|
493
|
+
muiTableHeadRowProps = _useMaterialReactTabl.muiTableHeadRowProps,
|
|
494
|
+
positionActionsColumn = _useMaterialReactTabl.positionActionsColumn,
|
|
542
495
|
renderDetailPanel = _useMaterialReactTabl.renderDetailPanel,
|
|
543
496
|
tableInstance = _useMaterialReactTabl.tableInstance;
|
|
544
497
|
|
|
545
|
-
if (overrideTableHeadRowComponent) {
|
|
546
|
-
return React__default.createElement(React__default.Fragment, null, overrideTableHeadRowComponent(headerGroup, tableInstance));
|
|
547
|
-
}
|
|
548
|
-
|
|
549
498
|
var isParentHeader = React.useMemo(function () {
|
|
550
499
|
return headerGroup.headers.some(function (h) {
|
|
551
500
|
var _h$columns$length, _h$columns;
|
|
@@ -553,61 +502,31 @@ var MRT_TableHeadRow = function MRT_TableHeadRow(_ref) {
|
|
|
553
502
|
return ((_h$columns$length = (_h$columns = h.columns) == null ? void 0 : _h$columns.length) != null ? _h$columns$length : 0) > 0;
|
|
554
503
|
});
|
|
555
504
|
}, [headerGroup.headers]);
|
|
556
|
-
|
|
505
|
+
var mTableHeadRowProps = muiTableHeadRowProps instanceof Function ? muiTableHeadRowProps(headerGroup) : muiTableHeadRowProps;
|
|
506
|
+
|
|
507
|
+
var tableRowProps = _extends({}, mTableHeadRowProps, headerGroup.getHeaderGroupProps(), {
|
|
508
|
+
style: _extends({}, headerGroup.getHeaderGroupProps().style, (_mTableHeadRowProps$s = mTableHeadRowProps == null ? void 0 : mTableHeadRowProps.style) != null ? _mTableHeadRowProps$s : {})
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
return React__default.createElement(material.TableRow, Object.assign({}, tableRowProps), enableRowActions && positionActionsColumn === 'first' && (isParentHeader ? React__default.createElement(MRT_TableSpacerCell, null) : React__default.createElement(StyledTableHeadCell, null, localization == null ? void 0 : localization.actionsHeadColumnTitle)), anyRowsCanExpand || renderDetailPanel ? !disableExpandAll && !isParentHeader ? React__default.createElement(MRT_ExpandAllButton, null) : React__default.createElement(MRT_TableSpacerCell, {
|
|
557
512
|
width: (renderDetailPanel ? 2 : tableInstance.expandedDepth + 0.5) + "rem"
|
|
558
513
|
}) : null, enableSelection ? !isParentHeader ? React__default.createElement(MRT_SelectAllCheckbox, null) : React__default.createElement(MRT_TableSpacerCell, {
|
|
559
514
|
width: "1rem"
|
|
560
|
-
}) : null, headerGroup.headers.map(function (column
|
|
515
|
+
}) : null, headerGroup.headers.map(function (column) {
|
|
561
516
|
return React__default.createElement(MRT_TableHeadCell, {
|
|
562
|
-
key:
|
|
517
|
+
key: column.getHeaderProps().key,
|
|
563
518
|
column: column
|
|
564
519
|
});
|
|
565
|
-
}),
|
|
566
|
-
};
|
|
567
|
-
|
|
568
|
-
var MRT_TablePagination = function MRT_TablePagination() {
|
|
569
|
-
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
570
|
-
tableInstance = _useMaterialReactTabl.tableInstance,
|
|
571
|
-
tablePaginationProps = _useMaterialReactTabl.tablePaginationProps,
|
|
572
|
-
overrideTablePaginationComponent = _useMaterialReactTabl.overrideTablePaginationComponent;
|
|
573
|
-
|
|
574
|
-
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
575
|
-
tableInstance.setPageSize(+event.target.value);
|
|
576
|
-
tableInstance.gotoPage(0);
|
|
577
|
-
};
|
|
578
|
-
|
|
579
|
-
if (overrideTablePaginationComponent) {
|
|
580
|
-
return React__default.createElement(React__default.Fragment, null, overrideTablePaginationComponent(tableInstance));
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
return React__default.createElement(material.TableRow, null, React__default.createElement(material.TablePagination, Object.assign({
|
|
584
|
-
colSpan: tableInstance.visibleColumns.length + 10,
|
|
585
|
-
count: tableInstance.rows.length,
|
|
586
|
-
onPageChange: function onPageChange(_, newPage) {
|
|
587
|
-
return tableInstance.gotoPage(newPage);
|
|
588
|
-
},
|
|
589
|
-
onRowsPerPageChange: handleChangeRowsPerPage,
|
|
590
|
-
page: tableInstance.state.pageIndex,
|
|
591
|
-
rowsPerPage: tableInstance.state.pageSize,
|
|
592
|
-
showFirstButton: tableInstance.rows.length / tableInstance.state.pageSize > 2,
|
|
593
|
-
showLastButton: tableInstance.rows.length / tableInstance.state.pageSize > 2
|
|
594
|
-
}, tablePaginationProps)));
|
|
520
|
+
}), enableRowActions && positionActionsColumn === 'last' && (isParentHeader ? React__default.createElement(MRT_TableSpacerCell, null) : React__default.createElement(StyledTableHeadCell, null, localization == null ? void 0 : localization.actionsHeadColumnTitle)));
|
|
595
521
|
};
|
|
596
522
|
|
|
597
523
|
var MRT_TableHead = function MRT_TableHead() {
|
|
598
524
|
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
599
|
-
overrideTableHeadComponent = _useMaterialReactTabl.overrideTableHeadComponent,
|
|
600
525
|
tableInstance = _useMaterialReactTabl.tableInstance,
|
|
601
|
-
|
|
602
|
-
enablePagination = _useMaterialReactTabl.enablePagination,
|
|
603
|
-
isFetching = _useMaterialReactTabl.isFetching,
|
|
604
|
-
positionPagination = _useMaterialReactTabl.positionPagination;
|
|
605
|
-
|
|
606
|
-
if (overrideTableHeadComponent) {
|
|
607
|
-
return React__default.createElement(React__default.Fragment, null, overrideTableHeadComponent(tableInstance));
|
|
608
|
-
}
|
|
526
|
+
muiTableHeadProps = _useMaterialReactTabl.muiTableHeadProps;
|
|
609
527
|
|
|
610
|
-
|
|
528
|
+
var tableHeadProps = muiTableHeadProps instanceof Function ? muiTableHeadProps(tableInstance) : muiTableHeadProps;
|
|
529
|
+
return React__default.createElement(material.TableHead, Object.assign({}, tableHeadProps), tableInstance.headerGroups.map(function (headerGroup, index) {
|
|
611
530
|
return React__default.createElement(MRT_TableHeadRow, {
|
|
612
531
|
key: index + "-" + headerGroup.id,
|
|
613
532
|
headerGroup: headerGroup
|
|
@@ -616,47 +535,68 @@ var MRT_TableHead = function MRT_TableHead() {
|
|
|
616
535
|
};
|
|
617
536
|
|
|
618
537
|
var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
|
|
538
|
+
var _mTableCellBodyProps$;
|
|
539
|
+
|
|
619
540
|
var cell = _ref.cell;
|
|
620
541
|
|
|
621
542
|
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
543
|
+
onCellClick = _useMaterialReactTabl.onCellClick,
|
|
544
|
+
muiTableBodyCellProps = _useMaterialReactTabl.muiTableBodyCellProps,
|
|
545
|
+
densePadding = _useMaterialReactTabl.densePadding;
|
|
625
546
|
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
}
|
|
547
|
+
var mTableCellBodyProps = muiTableBodyCellProps instanceof Function ? muiTableBodyCellProps(cell) : muiTableBodyCellProps;
|
|
548
|
+
|
|
549
|
+
var tableCellProps = _extends({}, mTableCellBodyProps, cell.getCellProps(), {
|
|
550
|
+
style: _extends({
|
|
551
|
+
padding: densePadding ? '0.5rem' : '1rem',
|
|
552
|
+
transition: 'all 0.2s ease-in-out'
|
|
553
|
+
}, cell.getCellProps().style, (_mTableCellBodyProps$ = mTableCellBodyProps == null ? void 0 : mTableCellBodyProps.style) != null ? _mTableCellBodyProps$ : {})
|
|
554
|
+
});
|
|
629
555
|
|
|
630
556
|
return React__default.createElement(material.TableCell, Object.assign({
|
|
631
557
|
onClick: function onClick(event) {
|
|
632
558
|
return onCellClick == null ? void 0 : onCellClick(event, cell);
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
}, cell.getCellProps()), cell.isPlaceholder ? null : cell.isAggregated ? cell.render('Aggregated') : cell.isGrouped ? React__default.createElement("span", null, cell.render('Cell'), " (", cell.row.subRows.length, ")") : cell.render('Cell'));
|
|
559
|
+
}
|
|
560
|
+
}, tableCellProps), cell.isPlaceholder ? null : cell.isAggregated ? cell.render('Aggregated') : cell.isGrouped ? React__default.createElement("span", null, cell.render('Cell'), " (", cell.row.subRows.length, ")") : cell.render('Cell'));
|
|
636
561
|
};
|
|
637
562
|
|
|
638
563
|
var MRT_TableDetailPanel = function MRT_TableDetailPanel(_ref) {
|
|
564
|
+
var _mTableBodyRowProps$s;
|
|
565
|
+
|
|
639
566
|
var row = _ref.row;
|
|
640
567
|
|
|
641
568
|
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
642
569
|
tableInstance = _useMaterialReactTabl.tableInstance,
|
|
643
570
|
renderDetailPanel = _useMaterialReactTabl.renderDetailPanel,
|
|
644
|
-
|
|
645
|
-
|
|
571
|
+
muiTableDetailPanelProps = _useMaterialReactTabl.muiTableDetailPanelProps,
|
|
572
|
+
muiTableBodyRowProps = _useMaterialReactTabl.muiTableBodyRowProps,
|
|
573
|
+
onDetailPanelClick = _useMaterialReactTabl.onDetailPanelClick;
|
|
646
574
|
|
|
647
|
-
|
|
648
|
-
return React__default.createElement(React__default.Fragment, null, overrideTableDetailPanelComponent(row, tableInstance));
|
|
649
|
-
}
|
|
575
|
+
var mTableBodyRowProps = muiTableBodyRowProps instanceof Function ? muiTableBodyRowProps(row) : muiTableBodyRowProps;
|
|
650
576
|
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
577
|
+
var tableRowProps = _extends({}, mTableBodyRowProps, row.getToggleRowExpandedProps(), {
|
|
578
|
+
style: _extends({}, row.getToggleRowExpandedProps().style, (_mTableBodyRowProps$s = mTableBodyRowProps == null ? void 0 : mTableBodyRowProps.style) != null ? _mTableBodyRowProps$s : {})
|
|
579
|
+
});
|
|
580
|
+
|
|
581
|
+
var mTableDetailPanelProps = muiTableDetailPanelProps instanceof Function ? muiTableDetailPanelProps(row) : muiTableDetailPanelProps;
|
|
582
|
+
|
|
583
|
+
var tableCellProps = _extends({}, mTableDetailPanelProps, {
|
|
584
|
+
style: _extends({
|
|
654
585
|
borderBottom: !row.isExpanded ? 'none' : undefined,
|
|
655
586
|
paddingBottom: row.isExpanded ? '1rem' : 0,
|
|
656
587
|
paddingTop: row.isExpanded ? '1rem' : 0,
|
|
657
|
-
transition: 'all 0.2s'
|
|
588
|
+
transition: 'all 0.2s ease-in-out'
|
|
589
|
+
}, (mTableDetailPanelProps == null ? void 0 : mTableDetailPanelProps.style) || {})
|
|
590
|
+
});
|
|
591
|
+
|
|
592
|
+
return React__default.createElement(material.TableRow, Object.assign({
|
|
593
|
+
hover: true
|
|
594
|
+
}, tableRowProps), React__default.createElement(material.TableCell, Object.assign({
|
|
595
|
+
colSpan: tableInstance.visibleColumns.length + 10,
|
|
596
|
+
onClick: function onClick(event) {
|
|
597
|
+
return onDetailPanelClick == null ? void 0 : onDetailPanelClick(event, row);
|
|
658
598
|
}
|
|
659
|
-
},
|
|
599
|
+
}, tableCellProps), React__default.createElement(material.Collapse, {
|
|
660
600
|
"in": row.isExpanded
|
|
661
601
|
}, renderDetailPanel == null ? void 0 : renderDetailPanel(row))));
|
|
662
602
|
};
|
|
@@ -667,24 +607,25 @@ var MRT_ExpandButton = function MRT_ExpandButton(_ref) {
|
|
|
667
607
|
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
668
608
|
localization = _useMaterialReactTabl.localization,
|
|
669
609
|
tableInstance = _useMaterialReactTabl.tableInstance,
|
|
610
|
+
densePadding = _useMaterialReactTabl.densePadding,
|
|
670
611
|
renderDetailPanel = _useMaterialReactTabl.renderDetailPanel;
|
|
671
612
|
|
|
672
|
-
return React__default.createElement(material.TableCell,
|
|
673
|
-
size: "small"
|
|
674
|
-
}, row.getToggleRowExpandedProps(), {
|
|
613
|
+
return React__default.createElement(material.TableCell, {
|
|
614
|
+
size: "small",
|
|
675
615
|
style: {
|
|
676
|
-
padding: '0.
|
|
677
|
-
paddingRight: '0',
|
|
616
|
+
padding: densePadding ? '0' : '0.6rem 0',
|
|
678
617
|
paddingLeft: row.depth + 0.5 + "rem",
|
|
618
|
+
transition: 'all 0.2s ease-in-out',
|
|
679
619
|
width: (renderDetailPanel ? 2 : tableInstance.expandedDepth - row.depth + 2) + "rem"
|
|
680
620
|
}
|
|
681
|
-
}
|
|
621
|
+
}, React__default.createElement(material.IconButton, Object.assign({
|
|
622
|
+
disabled: !row.canExpand && !renderDetailPanel,
|
|
682
623
|
"aria-label": localization == null ? void 0 : localization.expandButtonTitle,
|
|
683
624
|
title: localization == null ? void 0 : localization.expandButtonTitle
|
|
684
|
-
}, React__default.createElement(ExpandMoreIcon, {
|
|
685
|
-
fontSize:
|
|
625
|
+
}, row.getToggleRowExpandedProps()), React__default.createElement(ExpandMoreIcon, {
|
|
626
|
+
fontSize: row.canExpand || renderDetailPanel ? 'medium' : 'small',
|
|
686
627
|
style: {
|
|
687
|
-
transform: row.isExpanded ? 'rotate(-180deg)' : 'rotate(0)',
|
|
628
|
+
transform: !row.canExpand && !renderDetailPanel ? 'rotate(-90deg)' : row.isExpanded ? 'rotate(-180deg)' : 'rotate(0)',
|
|
688
629
|
transition: 'transform 0.2s'
|
|
689
630
|
}
|
|
690
631
|
})));
|
|
@@ -695,7 +636,8 @@ var MRT_SelectCheckbox = function MRT_SelectCheckbox(_ref) {
|
|
|
695
636
|
|
|
696
637
|
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
697
638
|
tableInstance = _useMaterialReactTabl.tableInstance,
|
|
698
|
-
onRowSelectChange = _useMaterialReactTabl.onRowSelectChange
|
|
639
|
+
onRowSelectChange = _useMaterialReactTabl.onRowSelectChange,
|
|
640
|
+
densePadding = _useMaterialReactTabl.densePadding;
|
|
699
641
|
|
|
700
642
|
var onSelectChange = function onSelectChange(event) {
|
|
701
643
|
var _row$getToggleRowSele;
|
|
@@ -707,133 +649,1059 @@ var MRT_SelectCheckbox = function MRT_SelectCheckbox(_ref) {
|
|
|
707
649
|
return React__default.createElement(material.TableCell, {
|
|
708
650
|
style: {
|
|
709
651
|
width: '2rem',
|
|
710
|
-
padding: '0.
|
|
652
|
+
padding: densePadding ? '0' : '0.6rem',
|
|
653
|
+
transition: 'all 0.2s ease-in-out'
|
|
711
654
|
}
|
|
712
655
|
}, React__default.createElement(material.Checkbox, Object.assign({}, row.getToggleRowSelectedProps(), {
|
|
713
656
|
onChange: onSelectChange
|
|
714
657
|
})));
|
|
715
658
|
};
|
|
716
659
|
|
|
717
|
-
var
|
|
718
|
-
|
|
660
|
+
var MenuItem$1 = /*#__PURE__*/material.styled(material.MenuItem)({
|
|
661
|
+
display: 'flex',
|
|
662
|
+
gap: '0.75rem'
|
|
663
|
+
});
|
|
664
|
+
var MRT_RowActionMenu = function MRT_RowActionMenu(_ref) {
|
|
665
|
+
var _renderRowActionMenuI;
|
|
666
|
+
|
|
667
|
+
var anchorEl = _ref.anchorEl,
|
|
668
|
+
row = _ref.row,
|
|
669
|
+
setAnchorEl = _ref.setAnchorEl;
|
|
719
670
|
|
|
720
671
|
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
enableColumnHiding = _useMaterialReactTabl.enableColumnHiding,
|
|
726
|
-
onRowClick = _useMaterialReactTabl.onRowClick,
|
|
727
|
-
renderDetailPanel = _useMaterialReactTabl.renderDetailPanel,
|
|
672
|
+
enableRowEditing = _useMaterialReactTabl.enableRowEditing,
|
|
673
|
+
localization = _useMaterialReactTabl.localization,
|
|
674
|
+
renderRowActionMenuItems = _useMaterialReactTabl.renderRowActionMenuItems,
|
|
675
|
+
setCurrentEditingRowId = _useMaterialReactTabl.setCurrentEditingRowId,
|
|
728
676
|
tableInstance = _useMaterialReactTabl.tableInstance;
|
|
729
677
|
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
678
|
+
var handleEdit = function handleEdit() {
|
|
679
|
+
setCurrentEditingRowId(row.id);
|
|
680
|
+
setAnchorEl(null);
|
|
681
|
+
};
|
|
733
682
|
|
|
734
|
-
return React__default.createElement(
|
|
735
|
-
|
|
736
|
-
|
|
683
|
+
return React__default.createElement(material.Menu, {
|
|
684
|
+
anchorEl: anchorEl,
|
|
685
|
+
open: !!anchorEl,
|
|
686
|
+
onClose: function onClose() {
|
|
687
|
+
return setAnchorEl(null);
|
|
737
688
|
}
|
|
738
|
-
},
|
|
739
|
-
|
|
740
|
-
}) :
|
|
741
|
-
|
|
742
|
-
}))
|
|
743
|
-
row: row
|
|
744
|
-
}), row.cells.map(function (cell, index) {
|
|
745
|
-
return React__default.createElement(MRT_TableBodyCell, {
|
|
746
|
-
key: index + "-" + cell.value,
|
|
747
|
-
cell: cell
|
|
748
|
-
});
|
|
749
|
-
}), enableColumnHiding && React__default.createElement(MRT_TableSpacerCell, null)), renderDetailPanel && React__default.createElement(MRT_TableDetailPanel, {
|
|
750
|
-
row: row
|
|
751
|
-
}));
|
|
689
|
+
}, enableRowEditing && React__default.createElement(MenuItem$1, {
|
|
690
|
+
onClick: handleEdit
|
|
691
|
+
}, React__default.createElement(EditIcon, null), " ", localization == null ? void 0 : localization.rowActionMenuItemEdit), (_renderRowActionMenuI = renderRowActionMenuItems == null ? void 0 : renderRowActionMenuItems(row, tableInstance, function () {
|
|
692
|
+
return setAnchorEl(null);
|
|
693
|
+
})) != null ? _renderRowActionMenuI : null);
|
|
752
694
|
};
|
|
753
695
|
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
}
|
|
757
|
-
var CircularProgressWrapper = /*#__PURE__*/material.styled('div')({
|
|
758
|
-
backgroundColor: 'rgba(255, 255, 255, 0.5)',
|
|
759
|
-
display: 'grid',
|
|
760
|
-
height: '100%',
|
|
761
|
-
justifyContent: 'center',
|
|
762
|
-
margin: 'auto',
|
|
763
|
-
paddingTop: '5rem',
|
|
764
|
-
position: 'fixed',
|
|
765
|
-
width: 'calc(100% - 2rem)'
|
|
766
|
-
});
|
|
767
|
-
var MRT_TableBody = function MRT_TableBody() {
|
|
768
|
-
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
769
|
-
tableInstance = _useMaterialReactTabl.tableInstance,
|
|
770
|
-
tableBodyProps = _useMaterialReactTabl.tableBodyProps,
|
|
771
|
-
isLoading = _useMaterialReactTabl.isLoading,
|
|
772
|
-
enablePagination = _useMaterialReactTabl.enablePagination,
|
|
773
|
-
overrideTableBodyComponent = _useMaterialReactTabl.overrideTableBodyComponent;
|
|
696
|
+
function createCommonjsModule(fn, module) {
|
|
697
|
+
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
698
|
+
}
|
|
774
699
|
|
|
775
|
-
|
|
776
|
-
|
|
700
|
+
var runtime_1 = createCommonjsModule(function (module) {
|
|
701
|
+
/**
|
|
702
|
+
* Copyright (c) 2014-present, Facebook, Inc.
|
|
703
|
+
*
|
|
704
|
+
* This source code is licensed under the MIT license found in the
|
|
705
|
+
* LICENSE file in the root directory of this source tree.
|
|
706
|
+
*/
|
|
707
|
+
|
|
708
|
+
var runtime = (function (exports) {
|
|
709
|
+
|
|
710
|
+
var Op = Object.prototype;
|
|
711
|
+
var hasOwn = Op.hasOwnProperty;
|
|
712
|
+
var undefined$1; // More compressible than void 0.
|
|
713
|
+
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
714
|
+
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
715
|
+
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
716
|
+
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
717
|
+
|
|
718
|
+
function define(obj, key, value) {
|
|
719
|
+
Object.defineProperty(obj, key, {
|
|
720
|
+
value: value,
|
|
721
|
+
enumerable: true,
|
|
722
|
+
configurable: true,
|
|
723
|
+
writable: true
|
|
724
|
+
});
|
|
725
|
+
return obj[key];
|
|
726
|
+
}
|
|
727
|
+
try {
|
|
728
|
+
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
729
|
+
define({}, "");
|
|
730
|
+
} catch (err) {
|
|
731
|
+
define = function(obj, key, value) {
|
|
732
|
+
return obj[key] = value;
|
|
733
|
+
};
|
|
777
734
|
}
|
|
778
735
|
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
row: row
|
|
785
|
-
});
|
|
786
|
-
})));
|
|
787
|
-
};
|
|
736
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
737
|
+
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
738
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
739
|
+
var generator = Object.create(protoGenerator.prototype);
|
|
740
|
+
var context = new Context(tryLocsList || []);
|
|
788
741
|
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
var MRT_TableFooterCell = function MRT_TableFooterCell(_ref) {
|
|
793
|
-
var _column$columns$lengt, _column$columns;
|
|
742
|
+
// The ._invoke method unifies the implementations of the .next,
|
|
743
|
+
// .throw, and .return methods.
|
|
744
|
+
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
794
745
|
|
|
795
|
-
|
|
746
|
+
return generator;
|
|
747
|
+
}
|
|
748
|
+
exports.wrap = wrap;
|
|
749
|
+
|
|
750
|
+
// Try/catch helper to minimize deoptimizations. Returns a completion
|
|
751
|
+
// record like context.tryEntries[i].completion. This interface could
|
|
752
|
+
// have been (and was previously) designed to take a closure to be
|
|
753
|
+
// invoked without arguments, but in all the cases we care about we
|
|
754
|
+
// already have an existing method we want to call, so there's no need
|
|
755
|
+
// to create a new function object. We can even get away with assuming
|
|
756
|
+
// the method takes exactly one argument, since that happens to be true
|
|
757
|
+
// in every case, so we don't have to touch the arguments object. The
|
|
758
|
+
// only additional allocation required is the completion record, which
|
|
759
|
+
// has a stable shape and so hopefully should be cheap to allocate.
|
|
760
|
+
function tryCatch(fn, obj, arg) {
|
|
761
|
+
try {
|
|
762
|
+
return { type: "normal", arg: fn.call(obj, arg) };
|
|
763
|
+
} catch (err) {
|
|
764
|
+
return { type: "throw", arg: err };
|
|
765
|
+
}
|
|
766
|
+
}
|
|
796
767
|
|
|
797
|
-
var
|
|
798
|
-
|
|
799
|
-
|
|
768
|
+
var GenStateSuspendedStart = "suspendedStart";
|
|
769
|
+
var GenStateSuspendedYield = "suspendedYield";
|
|
770
|
+
var GenStateExecuting = "executing";
|
|
771
|
+
var GenStateCompleted = "completed";
|
|
772
|
+
|
|
773
|
+
// Returning this object from the innerFn has the same effect as
|
|
774
|
+
// breaking out of the dispatch switch statement.
|
|
775
|
+
var ContinueSentinel = {};
|
|
776
|
+
|
|
777
|
+
// Dummy constructor functions that we use as the .constructor and
|
|
778
|
+
// .constructor.prototype properties for functions that return Generator
|
|
779
|
+
// objects. For full spec compliance, you may wish to configure your
|
|
780
|
+
// minifier not to mangle the names of these two functions.
|
|
781
|
+
function Generator() {}
|
|
782
|
+
function GeneratorFunction() {}
|
|
783
|
+
function GeneratorFunctionPrototype() {}
|
|
784
|
+
|
|
785
|
+
// This is a polyfill for %IteratorPrototype% for environments that
|
|
786
|
+
// don't natively support it.
|
|
787
|
+
var IteratorPrototype = {};
|
|
788
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
789
|
+
return this;
|
|
790
|
+
});
|
|
800
791
|
|
|
801
|
-
|
|
802
|
-
|
|
792
|
+
var getProto = Object.getPrototypeOf;
|
|
793
|
+
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
794
|
+
if (NativeIteratorPrototype &&
|
|
795
|
+
NativeIteratorPrototype !== Op &&
|
|
796
|
+
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
797
|
+
// This environment has a native %IteratorPrototype%; use it instead
|
|
798
|
+
// of the polyfill.
|
|
799
|
+
IteratorPrototype = NativeIteratorPrototype;
|
|
803
800
|
}
|
|
804
801
|
|
|
805
|
-
var
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
802
|
+
var Gp = GeneratorFunctionPrototype.prototype =
|
|
803
|
+
Generator.prototype = Object.create(IteratorPrototype);
|
|
804
|
+
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
|
805
|
+
define(Gp, "constructor", GeneratorFunctionPrototype);
|
|
806
|
+
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
|
807
|
+
GeneratorFunction.displayName = define(
|
|
808
|
+
GeneratorFunctionPrototype,
|
|
809
|
+
toStringTagSymbol,
|
|
810
|
+
"GeneratorFunction"
|
|
811
|
+
);
|
|
811
812
|
|
|
812
|
-
|
|
813
|
-
|
|
813
|
+
// Helper for defining the .next, .throw, and .return methods of the
|
|
814
|
+
// Iterator interface in terms of a single ._invoke method.
|
|
815
|
+
function defineIteratorMethods(prototype) {
|
|
816
|
+
["next", "throw", "return"].forEach(function(method) {
|
|
817
|
+
define(prototype, method, function(arg) {
|
|
818
|
+
return this._invoke(method, arg);
|
|
819
|
+
});
|
|
820
|
+
});
|
|
821
|
+
}
|
|
814
822
|
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
823
|
+
exports.isGeneratorFunction = function(genFun) {
|
|
824
|
+
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
825
|
+
return ctor
|
|
826
|
+
? ctor === GeneratorFunction ||
|
|
827
|
+
// For the native GeneratorFunction constructor, the best we can
|
|
828
|
+
// do is to check its .name property.
|
|
829
|
+
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
|
830
|
+
: false;
|
|
831
|
+
};
|
|
832
|
+
|
|
833
|
+
exports.mark = function(genFun) {
|
|
834
|
+
if (Object.setPrototypeOf) {
|
|
835
|
+
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
836
|
+
} else {
|
|
837
|
+
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
838
|
+
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
|
839
|
+
}
|
|
840
|
+
genFun.prototype = Object.create(Gp);
|
|
841
|
+
return genFun;
|
|
842
|
+
};
|
|
843
|
+
|
|
844
|
+
// Within the body of any async function, `await x` is transformed to
|
|
845
|
+
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
846
|
+
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
847
|
+
// meant to be awaited.
|
|
848
|
+
exports.awrap = function(arg) {
|
|
849
|
+
return { __await: arg };
|
|
850
|
+
};
|
|
851
|
+
|
|
852
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
853
|
+
function invoke(method, arg, resolve, reject) {
|
|
854
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
855
|
+
if (record.type === "throw") {
|
|
856
|
+
reject(record.arg);
|
|
857
|
+
} else {
|
|
858
|
+
var result = record.arg;
|
|
859
|
+
var value = result.value;
|
|
860
|
+
if (value &&
|
|
861
|
+
typeof value === "object" &&
|
|
862
|
+
hasOwn.call(value, "__await")) {
|
|
863
|
+
return PromiseImpl.resolve(value.__await).then(function(value) {
|
|
864
|
+
invoke("next", value, resolve, reject);
|
|
865
|
+
}, function(err) {
|
|
866
|
+
invoke("throw", err, resolve, reject);
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
|
871
|
+
// When a yielded Promise is resolved, its final value becomes
|
|
872
|
+
// the .value of the Promise<{value,done}> result for the
|
|
873
|
+
// current iteration.
|
|
874
|
+
result.value = unwrapped;
|
|
875
|
+
resolve(result);
|
|
876
|
+
}, function(error) {
|
|
877
|
+
// If a rejected Promise was yielded, throw the rejection back
|
|
878
|
+
// into the async generator function so it can be handled there.
|
|
879
|
+
return invoke("throw", error, resolve, reject);
|
|
880
|
+
});
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
var previousPromise;
|
|
885
|
+
|
|
886
|
+
function enqueue(method, arg) {
|
|
887
|
+
function callInvokeWithMethodAndArg() {
|
|
888
|
+
return new PromiseImpl(function(resolve, reject) {
|
|
889
|
+
invoke(method, arg, resolve, reject);
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
return previousPromise =
|
|
894
|
+
// If enqueue has been called before, then we want to wait until
|
|
895
|
+
// all previous Promises have been resolved before calling invoke,
|
|
896
|
+
// so that results are always delivered in the correct order. If
|
|
897
|
+
// enqueue has not been called before, then it is important to
|
|
898
|
+
// call invoke immediately, without waiting on a callback to fire,
|
|
899
|
+
// so that the async generator function has the opportunity to do
|
|
900
|
+
// any necessary setup in a predictable way. This predictability
|
|
901
|
+
// is why the Promise constructor synchronously invokes its
|
|
902
|
+
// executor callback, and why async functions synchronously
|
|
903
|
+
// execute code before the first await. Since we implement simple
|
|
904
|
+
// async functions in terms of async generators, it is especially
|
|
905
|
+
// important to get this right, even though it requires care.
|
|
906
|
+
previousPromise ? previousPromise.then(
|
|
907
|
+
callInvokeWithMethodAndArg,
|
|
908
|
+
// Avoid propagating failures to Promises returned by later
|
|
909
|
+
// invocations of the iterator.
|
|
910
|
+
callInvokeWithMethodAndArg
|
|
911
|
+
) : callInvokeWithMethodAndArg();
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
// Define the unified helper method that is used to implement .next,
|
|
915
|
+
// .throw, and .return (see defineIteratorMethods).
|
|
916
|
+
this._invoke = enqueue;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
defineIteratorMethods(AsyncIterator.prototype);
|
|
920
|
+
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
921
|
+
return this;
|
|
922
|
+
});
|
|
923
|
+
exports.AsyncIterator = AsyncIterator;
|
|
924
|
+
|
|
925
|
+
// Note that simple async functions are implemented on top of
|
|
926
|
+
// AsyncIterator objects; they just return a Promise for the value of
|
|
927
|
+
// the final result produced by the iterator.
|
|
928
|
+
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
929
|
+
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
930
|
+
|
|
931
|
+
var iter = new AsyncIterator(
|
|
932
|
+
wrap(innerFn, outerFn, self, tryLocsList),
|
|
933
|
+
PromiseImpl
|
|
934
|
+
);
|
|
935
|
+
|
|
936
|
+
return exports.isGeneratorFunction(outerFn)
|
|
937
|
+
? iter // If outerFn is a generator, return the full iterator.
|
|
938
|
+
: iter.next().then(function(result) {
|
|
939
|
+
return result.done ? result.value : iter.next();
|
|
940
|
+
});
|
|
941
|
+
};
|
|
942
|
+
|
|
943
|
+
function makeInvokeMethod(innerFn, self, context) {
|
|
944
|
+
var state = GenStateSuspendedStart;
|
|
945
|
+
|
|
946
|
+
return function invoke(method, arg) {
|
|
947
|
+
if (state === GenStateExecuting) {
|
|
948
|
+
throw new Error("Generator is already running");
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
if (state === GenStateCompleted) {
|
|
952
|
+
if (method === "throw") {
|
|
953
|
+
throw arg;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
// Be forgiving, per 25.3.3.3.3 of the spec:
|
|
957
|
+
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
958
|
+
return doneResult();
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
context.method = method;
|
|
962
|
+
context.arg = arg;
|
|
963
|
+
|
|
964
|
+
while (true) {
|
|
965
|
+
var delegate = context.delegate;
|
|
966
|
+
if (delegate) {
|
|
967
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
968
|
+
if (delegateResult) {
|
|
969
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
970
|
+
return delegateResult;
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
if (context.method === "next") {
|
|
975
|
+
// Setting context._sent for legacy support of Babel's
|
|
976
|
+
// function.sent implementation.
|
|
977
|
+
context.sent = context._sent = context.arg;
|
|
978
|
+
|
|
979
|
+
} else if (context.method === "throw") {
|
|
980
|
+
if (state === GenStateSuspendedStart) {
|
|
981
|
+
state = GenStateCompleted;
|
|
982
|
+
throw context.arg;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
context.dispatchException(context.arg);
|
|
986
|
+
|
|
987
|
+
} else if (context.method === "return") {
|
|
988
|
+
context.abrupt("return", context.arg);
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
state = GenStateExecuting;
|
|
992
|
+
|
|
993
|
+
var record = tryCatch(innerFn, self, context);
|
|
994
|
+
if (record.type === "normal") {
|
|
995
|
+
// If an exception is thrown from innerFn, we leave state ===
|
|
996
|
+
// GenStateExecuting and loop back for another invocation.
|
|
997
|
+
state = context.done
|
|
998
|
+
? GenStateCompleted
|
|
999
|
+
: GenStateSuspendedYield;
|
|
1000
|
+
|
|
1001
|
+
if (record.arg === ContinueSentinel) {
|
|
1002
|
+
continue;
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
return {
|
|
1006
|
+
value: record.arg,
|
|
1007
|
+
done: context.done
|
|
1008
|
+
};
|
|
1009
|
+
|
|
1010
|
+
} else if (record.type === "throw") {
|
|
1011
|
+
state = GenStateCompleted;
|
|
1012
|
+
// Dispatch the exception by looping back around to the
|
|
1013
|
+
// context.dispatchException(context.arg) call above.
|
|
1014
|
+
context.method = "throw";
|
|
1015
|
+
context.arg = record.arg;
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
};
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
// Call delegate.iterator[context.method](context.arg) and handle the
|
|
1022
|
+
// result, either by returning a { value, done } result from the
|
|
1023
|
+
// delegate iterator, or by modifying context.method and context.arg,
|
|
1024
|
+
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
1025
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
1026
|
+
var method = delegate.iterator[context.method];
|
|
1027
|
+
if (method === undefined$1) {
|
|
1028
|
+
// A .throw or .return when the delegate iterator has no .throw
|
|
1029
|
+
// method always terminates the yield* loop.
|
|
1030
|
+
context.delegate = null;
|
|
1031
|
+
|
|
1032
|
+
if (context.method === "throw") {
|
|
1033
|
+
// Note: ["return"] must be used for ES3 parsing compatibility.
|
|
1034
|
+
if (delegate.iterator["return"]) {
|
|
1035
|
+
// If the delegate iterator has a return method, give it a
|
|
1036
|
+
// chance to clean up.
|
|
1037
|
+
context.method = "return";
|
|
1038
|
+
context.arg = undefined$1;
|
|
1039
|
+
maybeInvokeDelegate(delegate, context);
|
|
1040
|
+
|
|
1041
|
+
if (context.method === "throw") {
|
|
1042
|
+
// If maybeInvokeDelegate(context) changed context.method from
|
|
1043
|
+
// "return" to "throw", let that override the TypeError below.
|
|
1044
|
+
return ContinueSentinel;
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
context.method = "throw";
|
|
1049
|
+
context.arg = new TypeError(
|
|
1050
|
+
"The iterator does not provide a 'throw' method");
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
return ContinueSentinel;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
1057
|
+
|
|
1058
|
+
if (record.type === "throw") {
|
|
1059
|
+
context.method = "throw";
|
|
1060
|
+
context.arg = record.arg;
|
|
1061
|
+
context.delegate = null;
|
|
1062
|
+
return ContinueSentinel;
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
var info = record.arg;
|
|
1066
|
+
|
|
1067
|
+
if (! info) {
|
|
1068
|
+
context.method = "throw";
|
|
1069
|
+
context.arg = new TypeError("iterator result is not an object");
|
|
1070
|
+
context.delegate = null;
|
|
1071
|
+
return ContinueSentinel;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
if (info.done) {
|
|
1075
|
+
// Assign the result of the finished delegate to the temporary
|
|
1076
|
+
// variable specified by delegate.resultName (see delegateYield).
|
|
1077
|
+
context[delegate.resultName] = info.value;
|
|
1078
|
+
|
|
1079
|
+
// Resume execution at the desired location (see delegateYield).
|
|
1080
|
+
context.next = delegate.nextLoc;
|
|
1081
|
+
|
|
1082
|
+
// If context.method was "throw" but the delegate handled the
|
|
1083
|
+
// exception, let the outer generator proceed normally. If
|
|
1084
|
+
// context.method was "next", forget context.arg since it has been
|
|
1085
|
+
// "consumed" by the delegate iterator. If context.method was
|
|
1086
|
+
// "return", allow the original .return call to continue in the
|
|
1087
|
+
// outer generator.
|
|
1088
|
+
if (context.method !== "return") {
|
|
1089
|
+
context.method = "next";
|
|
1090
|
+
context.arg = undefined$1;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
} else {
|
|
1094
|
+
// Re-yield the result returned by the delegate method.
|
|
1095
|
+
return info;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
// The delegate iterator is finished, so forget it and continue with
|
|
1099
|
+
// the outer generator.
|
|
1100
|
+
context.delegate = null;
|
|
1101
|
+
return ContinueSentinel;
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
// Define Generator.prototype.{next,throw,return} in terms of the
|
|
1105
|
+
// unified ._invoke helper method.
|
|
1106
|
+
defineIteratorMethods(Gp);
|
|
1107
|
+
|
|
1108
|
+
define(Gp, toStringTagSymbol, "Generator");
|
|
1109
|
+
|
|
1110
|
+
// A Generator should always return itself as the iterator object when the
|
|
1111
|
+
// @@iterator function is called on it. Some browsers' implementations of the
|
|
1112
|
+
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
1113
|
+
// object to not be returned from this call. This ensures that doesn't happen.
|
|
1114
|
+
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
1115
|
+
define(Gp, iteratorSymbol, function() {
|
|
1116
|
+
return this;
|
|
1117
|
+
});
|
|
1118
|
+
|
|
1119
|
+
define(Gp, "toString", function() {
|
|
1120
|
+
return "[object Generator]";
|
|
1121
|
+
});
|
|
1122
|
+
|
|
1123
|
+
function pushTryEntry(locs) {
|
|
1124
|
+
var entry = { tryLoc: locs[0] };
|
|
1125
|
+
|
|
1126
|
+
if (1 in locs) {
|
|
1127
|
+
entry.catchLoc = locs[1];
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
if (2 in locs) {
|
|
1131
|
+
entry.finallyLoc = locs[2];
|
|
1132
|
+
entry.afterLoc = locs[3];
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
this.tryEntries.push(entry);
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
function resetTryEntry(entry) {
|
|
1139
|
+
var record = entry.completion || {};
|
|
1140
|
+
record.type = "normal";
|
|
1141
|
+
delete record.arg;
|
|
1142
|
+
entry.completion = record;
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
function Context(tryLocsList) {
|
|
1146
|
+
// The root entry object (effectively a try statement without a catch
|
|
1147
|
+
// or a finally block) gives us a place to store values thrown from
|
|
1148
|
+
// locations where there is no enclosing try statement.
|
|
1149
|
+
this.tryEntries = [{ tryLoc: "root" }];
|
|
1150
|
+
tryLocsList.forEach(pushTryEntry, this);
|
|
1151
|
+
this.reset(true);
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
exports.keys = function(object) {
|
|
1155
|
+
var keys = [];
|
|
1156
|
+
for (var key in object) {
|
|
1157
|
+
keys.push(key);
|
|
1158
|
+
}
|
|
1159
|
+
keys.reverse();
|
|
1160
|
+
|
|
1161
|
+
// Rather than returning an object with a next method, we keep
|
|
1162
|
+
// things simple and return the next function itself.
|
|
1163
|
+
return function next() {
|
|
1164
|
+
while (keys.length) {
|
|
1165
|
+
var key = keys.pop();
|
|
1166
|
+
if (key in object) {
|
|
1167
|
+
next.value = key;
|
|
1168
|
+
next.done = false;
|
|
1169
|
+
return next;
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
// To avoid creating an additional object, we just hang the .value
|
|
1174
|
+
// and .done properties off the next function object itself. This
|
|
1175
|
+
// also ensures that the minifier will not anonymize the function.
|
|
1176
|
+
next.done = true;
|
|
1177
|
+
return next;
|
|
1178
|
+
};
|
|
1179
|
+
};
|
|
1180
|
+
|
|
1181
|
+
function values(iterable) {
|
|
1182
|
+
if (iterable) {
|
|
1183
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
1184
|
+
if (iteratorMethod) {
|
|
1185
|
+
return iteratorMethod.call(iterable);
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
if (typeof iterable.next === "function") {
|
|
1189
|
+
return iterable;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
if (!isNaN(iterable.length)) {
|
|
1193
|
+
var i = -1, next = function next() {
|
|
1194
|
+
while (++i < iterable.length) {
|
|
1195
|
+
if (hasOwn.call(iterable, i)) {
|
|
1196
|
+
next.value = iterable[i];
|
|
1197
|
+
next.done = false;
|
|
1198
|
+
return next;
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
next.value = undefined$1;
|
|
1203
|
+
next.done = true;
|
|
1204
|
+
|
|
1205
|
+
return next;
|
|
1206
|
+
};
|
|
1207
|
+
|
|
1208
|
+
return next.next = next;
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
// Return an iterator with no values.
|
|
1213
|
+
return { next: doneResult };
|
|
1214
|
+
}
|
|
1215
|
+
exports.values = values;
|
|
1216
|
+
|
|
1217
|
+
function doneResult() {
|
|
1218
|
+
return { value: undefined$1, done: true };
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
Context.prototype = {
|
|
1222
|
+
constructor: Context,
|
|
1223
|
+
|
|
1224
|
+
reset: function(skipTempReset) {
|
|
1225
|
+
this.prev = 0;
|
|
1226
|
+
this.next = 0;
|
|
1227
|
+
// Resetting context._sent for legacy support of Babel's
|
|
1228
|
+
// function.sent implementation.
|
|
1229
|
+
this.sent = this._sent = undefined$1;
|
|
1230
|
+
this.done = false;
|
|
1231
|
+
this.delegate = null;
|
|
1232
|
+
|
|
1233
|
+
this.method = "next";
|
|
1234
|
+
this.arg = undefined$1;
|
|
1235
|
+
|
|
1236
|
+
this.tryEntries.forEach(resetTryEntry);
|
|
1237
|
+
|
|
1238
|
+
if (!skipTempReset) {
|
|
1239
|
+
for (var name in this) {
|
|
1240
|
+
// Not sure about the optimal order of these conditions:
|
|
1241
|
+
if (name.charAt(0) === "t" &&
|
|
1242
|
+
hasOwn.call(this, name) &&
|
|
1243
|
+
!isNaN(+name.slice(1))) {
|
|
1244
|
+
this[name] = undefined$1;
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
},
|
|
1249
|
+
|
|
1250
|
+
stop: function() {
|
|
1251
|
+
this.done = true;
|
|
1252
|
+
|
|
1253
|
+
var rootEntry = this.tryEntries[0];
|
|
1254
|
+
var rootRecord = rootEntry.completion;
|
|
1255
|
+
if (rootRecord.type === "throw") {
|
|
1256
|
+
throw rootRecord.arg;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
return this.rval;
|
|
1260
|
+
},
|
|
1261
|
+
|
|
1262
|
+
dispatchException: function(exception) {
|
|
1263
|
+
if (this.done) {
|
|
1264
|
+
throw exception;
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
var context = this;
|
|
1268
|
+
function handle(loc, caught) {
|
|
1269
|
+
record.type = "throw";
|
|
1270
|
+
record.arg = exception;
|
|
1271
|
+
context.next = loc;
|
|
1272
|
+
|
|
1273
|
+
if (caught) {
|
|
1274
|
+
// If the dispatched exception was caught by a catch block,
|
|
1275
|
+
// then let that catch block handle the exception normally.
|
|
1276
|
+
context.method = "next";
|
|
1277
|
+
context.arg = undefined$1;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
return !! caught;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1284
|
+
var entry = this.tryEntries[i];
|
|
1285
|
+
var record = entry.completion;
|
|
1286
|
+
|
|
1287
|
+
if (entry.tryLoc === "root") {
|
|
1288
|
+
// Exception thrown outside of any try block that could handle
|
|
1289
|
+
// it, so set the completion value of the entire function to
|
|
1290
|
+
// throw the exception.
|
|
1291
|
+
return handle("end");
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
if (entry.tryLoc <= this.prev) {
|
|
1295
|
+
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
1296
|
+
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
1297
|
+
|
|
1298
|
+
if (hasCatch && hasFinally) {
|
|
1299
|
+
if (this.prev < entry.catchLoc) {
|
|
1300
|
+
return handle(entry.catchLoc, true);
|
|
1301
|
+
} else if (this.prev < entry.finallyLoc) {
|
|
1302
|
+
return handle(entry.finallyLoc);
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
} else if (hasCatch) {
|
|
1306
|
+
if (this.prev < entry.catchLoc) {
|
|
1307
|
+
return handle(entry.catchLoc, true);
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
} else if (hasFinally) {
|
|
1311
|
+
if (this.prev < entry.finallyLoc) {
|
|
1312
|
+
return handle(entry.finallyLoc);
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
} else {
|
|
1316
|
+
throw new Error("try statement without catch or finally");
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
},
|
|
1321
|
+
|
|
1322
|
+
abrupt: function(type, arg) {
|
|
1323
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1324
|
+
var entry = this.tryEntries[i];
|
|
1325
|
+
if (entry.tryLoc <= this.prev &&
|
|
1326
|
+
hasOwn.call(entry, "finallyLoc") &&
|
|
1327
|
+
this.prev < entry.finallyLoc) {
|
|
1328
|
+
var finallyEntry = entry;
|
|
1329
|
+
break;
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
if (finallyEntry &&
|
|
1334
|
+
(type === "break" ||
|
|
1335
|
+
type === "continue") &&
|
|
1336
|
+
finallyEntry.tryLoc <= arg &&
|
|
1337
|
+
arg <= finallyEntry.finallyLoc) {
|
|
1338
|
+
// Ignore the finally entry if control is not jumping to a
|
|
1339
|
+
// location outside the try/catch block.
|
|
1340
|
+
finallyEntry = null;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
1344
|
+
record.type = type;
|
|
1345
|
+
record.arg = arg;
|
|
1346
|
+
|
|
1347
|
+
if (finallyEntry) {
|
|
1348
|
+
this.method = "next";
|
|
1349
|
+
this.next = finallyEntry.finallyLoc;
|
|
1350
|
+
return ContinueSentinel;
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
return this.complete(record);
|
|
1354
|
+
},
|
|
1355
|
+
|
|
1356
|
+
complete: function(record, afterLoc) {
|
|
1357
|
+
if (record.type === "throw") {
|
|
1358
|
+
throw record.arg;
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
if (record.type === "break" ||
|
|
1362
|
+
record.type === "continue") {
|
|
1363
|
+
this.next = record.arg;
|
|
1364
|
+
} else if (record.type === "return") {
|
|
1365
|
+
this.rval = this.arg = record.arg;
|
|
1366
|
+
this.method = "return";
|
|
1367
|
+
this.next = "end";
|
|
1368
|
+
} else if (record.type === "normal" && afterLoc) {
|
|
1369
|
+
this.next = afterLoc;
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
return ContinueSentinel;
|
|
1373
|
+
},
|
|
1374
|
+
|
|
1375
|
+
finish: function(finallyLoc) {
|
|
1376
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1377
|
+
var entry = this.tryEntries[i];
|
|
1378
|
+
if (entry.finallyLoc === finallyLoc) {
|
|
1379
|
+
this.complete(entry.completion, entry.afterLoc);
|
|
1380
|
+
resetTryEntry(entry);
|
|
1381
|
+
return ContinueSentinel;
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
},
|
|
1385
|
+
|
|
1386
|
+
"catch": function(tryLoc) {
|
|
1387
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1388
|
+
var entry = this.tryEntries[i];
|
|
1389
|
+
if (entry.tryLoc === tryLoc) {
|
|
1390
|
+
var record = entry.completion;
|
|
1391
|
+
if (record.type === "throw") {
|
|
1392
|
+
var thrown = record.arg;
|
|
1393
|
+
resetTryEntry(entry);
|
|
1394
|
+
}
|
|
1395
|
+
return thrown;
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
// The context.catch method must only be called with a location
|
|
1400
|
+
// argument that corresponds to a known catch block.
|
|
1401
|
+
throw new Error("illegal catch attempt");
|
|
1402
|
+
},
|
|
1403
|
+
|
|
1404
|
+
delegateYield: function(iterable, resultName, nextLoc) {
|
|
1405
|
+
this.delegate = {
|
|
1406
|
+
iterator: values(iterable),
|
|
1407
|
+
resultName: resultName,
|
|
1408
|
+
nextLoc: nextLoc
|
|
1409
|
+
};
|
|
1410
|
+
|
|
1411
|
+
if (this.method === "next") {
|
|
1412
|
+
// Deliberately forget the last sent value so that we don't
|
|
1413
|
+
// accidentally pass it on to the delegate.
|
|
1414
|
+
this.arg = undefined$1;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
return ContinueSentinel;
|
|
1418
|
+
}
|
|
1419
|
+
};
|
|
1420
|
+
|
|
1421
|
+
// Regardless of whether this script is executing as a CommonJS module
|
|
1422
|
+
// or not, return the runtime object so that we can declare the variable
|
|
1423
|
+
// regeneratorRuntime in the outer scope, which allows this module to be
|
|
1424
|
+
// injected easily by `bin/regenerator --include-runtime script.js`.
|
|
1425
|
+
return exports;
|
|
1426
|
+
|
|
1427
|
+
}(
|
|
1428
|
+
// If this script is executing as a CommonJS module, use module.exports
|
|
1429
|
+
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
|
1430
|
+
// object. Either way, the resulting object will be used to initialize
|
|
1431
|
+
// the regeneratorRuntime variable at the top of this file.
|
|
1432
|
+
module.exports
|
|
1433
|
+
));
|
|
1434
|
+
|
|
1435
|
+
try {
|
|
1436
|
+
regeneratorRuntime = runtime;
|
|
1437
|
+
} catch (accidentalStrictMode) {
|
|
1438
|
+
// This module should not be running in strict mode, so the above
|
|
1439
|
+
// assignment should always work unless something is misconfigured. Just
|
|
1440
|
+
// in case runtime.js accidentally runs in strict mode, in modern engines
|
|
1441
|
+
// we can explicitly access globalThis. In older engines we can escape
|
|
1442
|
+
// strict mode using a global Function call. This could conceivably fail
|
|
1443
|
+
// if a Content Security Policy forbids using Function, but in that case
|
|
1444
|
+
// the proper solution is to fix the accidental strict mode problem. If
|
|
1445
|
+
// you've misconfigured your bundler to force strict mode and applied a
|
|
1446
|
+
// CSP to forbid Function, and you're not willing to fix either of those
|
|
1447
|
+
// problems, please detail your unique predicament in a GitHub issue.
|
|
1448
|
+
if (typeof globalThis === "object") {
|
|
1449
|
+
globalThis.regeneratorRuntime = runtime;
|
|
1450
|
+
} else {
|
|
1451
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
});
|
|
1455
|
+
|
|
1456
|
+
var EditActionButtonWrappers = /*#__PURE__*/material.styled('div')({
|
|
1457
|
+
display: 'flex',
|
|
1458
|
+
gap: '0.75rem'
|
|
1459
|
+
});
|
|
1460
|
+
var MRT_EditActionButtons = function MRT_EditActionButtons(_ref) {
|
|
1461
|
+
var _localization$rowActi, _localization$rowActi2;
|
|
1462
|
+
|
|
1463
|
+
var row = _ref.row;
|
|
1464
|
+
|
|
1465
|
+
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
1466
|
+
localization = _useMaterialReactTabl.localization,
|
|
1467
|
+
setCurrentEditingRowId = _useMaterialReactTabl.setCurrentEditingRowId,
|
|
1468
|
+
onRowEditSubmit = _useMaterialReactTabl.onRowEditSubmit;
|
|
1469
|
+
|
|
1470
|
+
var handleCancel = function handleCancel() {
|
|
1471
|
+
setCurrentEditingRowId(null);
|
|
1472
|
+
};
|
|
1473
|
+
|
|
1474
|
+
var handleSave = /*#__PURE__*/function () {
|
|
1475
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
1476
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
1477
|
+
while (1) {
|
|
1478
|
+
switch (_context.prev = _context.next) {
|
|
1479
|
+
case 0:
|
|
1480
|
+
setCurrentEditingRowId(null);
|
|
1481
|
+
_context.next = 3;
|
|
1482
|
+
return onRowEditSubmit == null ? void 0 : onRowEditSubmit(row);
|
|
1483
|
+
|
|
1484
|
+
case 3:
|
|
1485
|
+
case "end":
|
|
1486
|
+
return _context.stop();
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
}, _callee);
|
|
1490
|
+
}));
|
|
1491
|
+
|
|
1492
|
+
return function handleSave() {
|
|
1493
|
+
return _ref2.apply(this, arguments);
|
|
1494
|
+
};
|
|
1495
|
+
}();
|
|
1496
|
+
|
|
1497
|
+
return React__default.createElement(EditActionButtonWrappers, null, React__default.createElement(material.Tooltip, {
|
|
1498
|
+
arrow: true,
|
|
1499
|
+
title: (_localization$rowActi = localization == null ? void 0 : localization.rowActionButtonCancel) != null ? _localization$rowActi : ''
|
|
1500
|
+
}, React__default.createElement(material.IconButton, {
|
|
1501
|
+
"aria-label": localization == null ? void 0 : localization.rowActionButtonCancel,
|
|
1502
|
+
onClick: handleCancel
|
|
1503
|
+
}, React__default.createElement(CancelIcon, null))), React__default.createElement(material.Tooltip, {
|
|
1504
|
+
arrow: true,
|
|
1505
|
+
title: (_localization$rowActi2 = localization == null ? void 0 : localization.rowActionButtonSave) != null ? _localization$rowActi2 : ''
|
|
1506
|
+
}, React__default.createElement(material.IconButton, {
|
|
1507
|
+
"aria-label": localization == null ? void 0 : localization.rowActionButtonSave,
|
|
1508
|
+
color: "info",
|
|
1509
|
+
onClick: handleSave
|
|
1510
|
+
}, React__default.createElement(SaveIcon, null))));
|
|
1511
|
+
};
|
|
1512
|
+
|
|
1513
|
+
var IconButton$1 = /*#__PURE__*/material.styled(material.IconButton)({
|
|
1514
|
+
opacity: 0.5,
|
|
1515
|
+
transition: 'opacity 0.2s',
|
|
1516
|
+
marginRight: '2px',
|
|
1517
|
+
height: '2rem',
|
|
1518
|
+
width: '2rem',
|
|
1519
|
+
'&:hover': {
|
|
1520
|
+
opacity: 1
|
|
1521
|
+
}
|
|
1522
|
+
});
|
|
1523
|
+
var MRT_ToggleRowActionMenuButton = function MRT_ToggleRowActionMenuButton(_ref) {
|
|
1524
|
+
var row = _ref.row;
|
|
1525
|
+
|
|
1526
|
+
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
1527
|
+
localization = _useMaterialReactTabl.localization,
|
|
1528
|
+
currentEditingRowId = _useMaterialReactTabl.currentEditingRowId,
|
|
1529
|
+
renderRowActions = _useMaterialReactTabl.renderRowActions,
|
|
1530
|
+
tableInstance = _useMaterialReactTabl.tableInstance;
|
|
1531
|
+
|
|
1532
|
+
var _useState = React.useState(null),
|
|
1533
|
+
anchorEl = _useState[0],
|
|
1534
|
+
setAnchorEl = _useState[1];
|
|
1535
|
+
|
|
1536
|
+
var handleOpenRowActionMenu = function handleOpenRowActionMenu(event) {
|
|
1537
|
+
event.stopPropagation();
|
|
1538
|
+
event.preventDefault();
|
|
1539
|
+
setAnchorEl(event.currentTarget);
|
|
1540
|
+
};
|
|
1541
|
+
|
|
1542
|
+
if (renderRowActions) {
|
|
1543
|
+
return React__default.createElement(React__default.Fragment, null, renderRowActions(row, tableInstance));
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
if (row.id === currentEditingRowId) {
|
|
1547
|
+
return React__default.createElement(MRT_EditActionButtons, {
|
|
1548
|
+
row: row
|
|
1549
|
+
});
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(IconButton$1, {
|
|
1553
|
+
"aria-label": localization == null ? void 0 : localization.rowActionMenuButtonTitle,
|
|
1554
|
+
title: localization == null ? void 0 : localization.rowActionMenuButtonTitle,
|
|
1555
|
+
onClick: handleOpenRowActionMenu,
|
|
1556
|
+
size: "small"
|
|
1557
|
+
}, React__default.createElement(MoreHorizIcon, null)), React__default.createElement(MRT_RowActionMenu, {
|
|
1558
|
+
anchorEl: anchorEl,
|
|
1559
|
+
row: row,
|
|
1560
|
+
setAnchorEl: setAnchorEl
|
|
1561
|
+
}));
|
|
1562
|
+
};
|
|
1563
|
+
|
|
1564
|
+
var MRT_TableBodyRow = function MRT_TableBodyRow(_ref) {
|
|
1565
|
+
var _mTableBodyRowProps$s;
|
|
1566
|
+
|
|
1567
|
+
var row = _ref.row;
|
|
1568
|
+
|
|
1569
|
+
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
1570
|
+
anyRowsCanExpand = _useMaterialReactTabl.anyRowsCanExpand,
|
|
1571
|
+
enableRowActions = _useMaterialReactTabl.enableRowActions,
|
|
1572
|
+
enableSelection = _useMaterialReactTabl.enableSelection,
|
|
1573
|
+
muiTableBodyRowProps = _useMaterialReactTabl.muiTableBodyRowProps,
|
|
1574
|
+
onRowClick = _useMaterialReactTabl.onRowClick,
|
|
1575
|
+
positionActionsColumn = _useMaterialReactTabl.positionActionsColumn,
|
|
1576
|
+
renderDetailPanel = _useMaterialReactTabl.renderDetailPanel;
|
|
1577
|
+
|
|
1578
|
+
var theme = material.useTheme();
|
|
1579
|
+
var mTableBodyRowProps = muiTableBodyRowProps instanceof Function ? muiTableBodyRowProps(row) : muiTableBodyRowProps;
|
|
1580
|
+
|
|
1581
|
+
var tableRowProps = _extends({}, mTableBodyRowProps, row.getRowProps(), {
|
|
1582
|
+
style: _extends({
|
|
1583
|
+
backgroundColor: row.isSelected ? material.alpha(theme.palette.primary.light, 0.1) : 'transparent'
|
|
1584
|
+
}, row.getRowProps().style, (_mTableBodyRowProps$s = mTableBodyRowProps == null ? void 0 : mTableBodyRowProps.style) != null ? _mTableBodyRowProps$s : {})
|
|
1585
|
+
});
|
|
1586
|
+
|
|
1587
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(material.TableRow, Object.assign({
|
|
1588
|
+
hover: true,
|
|
1589
|
+
onClick: function onClick(event) {
|
|
1590
|
+
return onRowClick == null ? void 0 : onRowClick(event, row);
|
|
1591
|
+
}
|
|
1592
|
+
}, tableRowProps), enableRowActions && positionActionsColumn === 'first' && React__default.createElement(material.TableCell, null, React__default.createElement(MRT_ToggleRowActionMenuButton, {
|
|
1593
|
+
row: row
|
|
1594
|
+
})), (anyRowsCanExpand || renderDetailPanel) && React__default.createElement(MRT_ExpandButton, {
|
|
1595
|
+
row: row
|
|
1596
|
+
}), enableSelection && React__default.createElement(MRT_SelectCheckbox, {
|
|
1597
|
+
row: row
|
|
1598
|
+
}), row.cells.map(function (cell) {
|
|
1599
|
+
return React__default.createElement(MRT_TableBodyCell, {
|
|
1600
|
+
key: cell.getCellProps().key,
|
|
1601
|
+
cell: cell
|
|
1602
|
+
});
|
|
1603
|
+
}), enableRowActions && positionActionsColumn === 'last' && React__default.createElement(material.TableCell, null, React__default.createElement(MRT_ToggleRowActionMenuButton, {
|
|
1604
|
+
row: row
|
|
1605
|
+
}))), renderDetailPanel && React__default.createElement(MRT_TableDetailPanel, {
|
|
1606
|
+
row: row
|
|
1607
|
+
}));
|
|
1608
|
+
};
|
|
1609
|
+
|
|
1610
|
+
var TableBody = /*#__PURE__*/material.styled(material.TableBody)({
|
|
1611
|
+
overflowY: 'hidden'
|
|
1612
|
+
});
|
|
1613
|
+
var CircularProgressWrapper = /*#__PURE__*/material.styled('div')(function (_ref) {
|
|
1614
|
+
var theme = _ref.theme;
|
|
1615
|
+
return {
|
|
1616
|
+
backgroundColor: material.alpha(theme.palette.background.paper, 0.5),
|
|
1617
|
+
display: 'grid',
|
|
1618
|
+
height: '100%',
|
|
1619
|
+
justifyContent: 'center',
|
|
1620
|
+
margin: 'auto',
|
|
1621
|
+
paddingTop: '5rem',
|
|
1622
|
+
position: 'fixed',
|
|
1623
|
+
width: 'calc(100% - 2rem)'
|
|
1624
|
+
};
|
|
1625
|
+
});
|
|
1626
|
+
var MRT_TableBody = function MRT_TableBody() {
|
|
1627
|
+
var _muiTableBodyProps$st;
|
|
1628
|
+
|
|
1629
|
+
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
1630
|
+
tableInstance = _useMaterialReactTabl.tableInstance,
|
|
1631
|
+
muiTableBodyProps = _useMaterialReactTabl.muiTableBodyProps,
|
|
1632
|
+
isLoading = _useMaterialReactTabl.isLoading,
|
|
1633
|
+
manualPagination = _useMaterialReactTabl.manualPagination;
|
|
1634
|
+
|
|
1635
|
+
var rows = manualPagination ? tableInstance.rows : tableInstance.page;
|
|
1636
|
+
|
|
1637
|
+
var tableBodyProps = _extends({}, muiTableBodyProps, tableInstance.getTableBodyProps(), {
|
|
1638
|
+
style: _extends({}, tableInstance.getTableBodyProps().style, (_muiTableBodyProps$st = muiTableBodyProps == null ? void 0 : muiTableBodyProps.style) != null ? _muiTableBodyProps$st : {})
|
|
1639
|
+
});
|
|
1640
|
+
|
|
1641
|
+
return React__default.createElement(TableBody, Object.assign({}, tableBodyProps), isLoading && React__default.createElement(CircularProgressWrapper, null, React__default.createElement(material.CircularProgress, null)), rows.map(function (row) {
|
|
1642
|
+
tableInstance.prepareRow(row);
|
|
1643
|
+
return React__default.createElement(MRT_TableBodyRow, {
|
|
1644
|
+
key: row.getRowProps().key,
|
|
1645
|
+
row: row
|
|
1646
|
+
});
|
|
1647
|
+
}));
|
|
1648
|
+
};
|
|
1649
|
+
|
|
1650
|
+
var TableCell = /*#__PURE__*/material.styled(material.TableCell)({
|
|
1651
|
+
fontWeight: 'bold'
|
|
1652
|
+
});
|
|
1653
|
+
var MRT_TableFooterCell = function MRT_TableFooterCell(_ref) {
|
|
1654
|
+
var _column$columns$lengt, _column$columns, _mTableFooterCellProp;
|
|
1655
|
+
|
|
1656
|
+
var column = _ref.column;
|
|
1657
|
+
|
|
1658
|
+
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
1659
|
+
muiTableFooterCellProps = _useMaterialReactTabl.muiTableFooterCellProps,
|
|
1660
|
+
densePadding = _useMaterialReactTabl.densePadding;
|
|
1661
|
+
|
|
1662
|
+
var isParentHeader = ((_column$columns$lengt = column == null ? void 0 : (_column$columns = column.columns) == null ? void 0 : _column$columns.length) != null ? _column$columns$lengt : 0) > 0;
|
|
1663
|
+
var mTableFooterCellProps = muiTableFooterCellProps instanceof Function ? muiTableFooterCellProps(column) : muiTableFooterCellProps;
|
|
1664
|
+
|
|
1665
|
+
var tableCellProps = _extends({}, mTableFooterCellProps, column.getFooterProps(), {
|
|
1666
|
+
style: _extends({
|
|
1667
|
+
padding: densePadding ? '0.5rem' : '1rem',
|
|
1668
|
+
transition: 'all 0.2s ease-in-out'
|
|
1669
|
+
}, column.getFooterProps().style, (_mTableFooterCellProp = mTableFooterCellProps == null ? void 0 : mTableFooterCellProps.style) != null ? _mTableFooterCellProp : {})
|
|
1670
|
+
});
|
|
1671
|
+
|
|
1672
|
+
return React__default.createElement(TableCell, Object.assign({
|
|
1673
|
+
align: isParentHeader ? 'center' : 'left',
|
|
1674
|
+
variant: "head"
|
|
1675
|
+
}, tableCellProps), column.render('Footer'));
|
|
1676
|
+
};
|
|
1677
|
+
|
|
1678
|
+
var MRT_TableFooterRow = function MRT_TableFooterRow(_ref) {
|
|
1679
|
+
var _mTableFooterRowProps;
|
|
1680
|
+
|
|
1681
|
+
var footerGroup = _ref.footerGroup;
|
|
1682
|
+
|
|
1683
|
+
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
1684
|
+
renderDetailPanel = _useMaterialReactTabl.renderDetailPanel,
|
|
1685
|
+
columns = _useMaterialReactTabl.columns,
|
|
1686
|
+
anyRowsCanExpand = _useMaterialReactTabl.anyRowsCanExpand,
|
|
1687
|
+
enableSelection = _useMaterialReactTabl.enableSelection,
|
|
1688
|
+
enableRowActions = _useMaterialReactTabl.enableRowActions,
|
|
1689
|
+
positionActionsColumn = _useMaterialReactTabl.positionActionsColumn,
|
|
821
1690
|
tableInstance = _useMaterialReactTabl.tableInstance,
|
|
822
|
-
|
|
1691
|
+
muiTableFooterRowProps = _useMaterialReactTabl.muiTableFooterRowProps; //if no content in row, skip row
|
|
823
1692
|
|
|
824
1693
|
|
|
825
1694
|
if (!(columns != null && columns.some(function (c) {
|
|
826
1695
|
return c.Footer;
|
|
827
1696
|
}))) return null;
|
|
1697
|
+
var mTableFooterRowProps = muiTableFooterRowProps instanceof Function ? muiTableFooterRowProps(footerGroup) : muiTableFooterRowProps;
|
|
828
1698
|
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
}
|
|
1699
|
+
var tableRowProps = _extends({}, mTableFooterRowProps, footerGroup.getFooterGroupProps(), {
|
|
1700
|
+
style: _extends({}, footerGroup.getFooterGroupProps().style, (_mTableFooterRowProps = mTableFooterRowProps == null ? void 0 : mTableFooterRowProps.style) != null ? _mTableFooterRowProps : {})
|
|
1701
|
+
});
|
|
832
1702
|
|
|
833
|
-
return React__default.createElement(material.TableRow, Object.assign({},
|
|
834
|
-
|
|
835
|
-
width: (renderDetailPanel ? 2 : tableInstance.expandedDepth + 0.5) + "rem"
|
|
836
|
-
}
|
|
1703
|
+
return React__default.createElement(material.TableRow, Object.assign({}, tableRowProps), enableRowActions && positionActionsColumn === 'first' && React__default.createElement(MRT_TableSpacerCell, null), (anyRowsCanExpand || renderDetailPanel) && React__default.createElement(MRT_TableSpacerCell, {
|
|
1704
|
+
width: (renderDetailPanel ? 2 : tableInstance.expandedDepth + 0.5) + "rem"
|
|
837
1705
|
}), enableSelection && React__default.createElement(MRT_TableSpacerCell, {
|
|
838
1706
|
width: "1rem"
|
|
839
1707
|
}), footerGroup.headers.map(function (column, index) {
|
|
@@ -841,37 +1709,36 @@ var MRT_TableFooterRow = function MRT_TableFooterRow(_ref) {
|
|
|
841
1709
|
key: index + "-" + column.id,
|
|
842
1710
|
column: column
|
|
843
1711
|
});
|
|
844
|
-
}),
|
|
1712
|
+
}), enableRowActions && positionActionsColumn === 'last' && React__default.createElement(MRT_TableSpacerCell, null));
|
|
845
1713
|
};
|
|
846
1714
|
|
|
847
1715
|
var MRT_TableFooter = function MRT_TableFooter() {
|
|
848
1716
|
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
849
|
-
|
|
850
|
-
enablePagination = _useMaterialReactTabl.enablePagination,
|
|
851
|
-
positionPagination = _useMaterialReactTabl.positionPagination,
|
|
852
|
-
tableFooterProps = _useMaterialReactTabl.tableFooterProps,
|
|
1717
|
+
muiTableFooterProps = _useMaterialReactTabl.muiTableFooterProps,
|
|
853
1718
|
tableInstance = _useMaterialReactTabl.tableInstance;
|
|
854
1719
|
|
|
855
|
-
|
|
856
|
-
return React__default.createElement(React__default.Fragment, null, overrideTableFooterComponent(tableInstance));
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
return React__default.createElement(material.TableFooter, Object.assign({}, tableFooterProps), tableInstance.footerGroups.map(function (footerGroup, index) {
|
|
1720
|
+
return React__default.createElement(material.TableFooter, Object.assign({}, muiTableFooterProps), tableInstance.footerGroups.map(function (footerGroup, index) {
|
|
860
1721
|
return React__default.createElement(MRT_TableFooterRow, {
|
|
861
1722
|
key: index + "-" + footerGroup.id,
|
|
862
1723
|
footerGroup: footerGroup
|
|
863
1724
|
});
|
|
864
|
-
})
|
|
1725
|
+
}));
|
|
865
1726
|
};
|
|
866
1727
|
|
|
867
1728
|
var MRT_Table = function MRT_Table() {
|
|
1729
|
+
var _muiTableProps$style;
|
|
1730
|
+
|
|
868
1731
|
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
869
1732
|
tableInstance = _useMaterialReactTabl.tableInstance,
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
1733
|
+
muiTableProps = _useMaterialReactTabl.muiTableProps,
|
|
1734
|
+
hideTableHead = _useMaterialReactTabl.hideTableHead,
|
|
1735
|
+
hideTableFooter = _useMaterialReactTabl.hideTableFooter;
|
|
873
1736
|
|
|
874
|
-
|
|
1737
|
+
var tableProps = _extends({}, muiTableProps, tableInstance.getTableProps(), {
|
|
1738
|
+
style: _extends({}, tableInstance.getTableProps().style, (_muiTableProps$style = muiTableProps == null ? void 0 : muiTableProps.style) != null ? _muiTableProps$style : {})
|
|
1739
|
+
});
|
|
1740
|
+
|
|
1741
|
+
return React__default.createElement(material.Table, Object.assign({}, tableProps), !hideTableHead && React__default.createElement(MRT_TableHead, null), React__default.createElement(MRT_TableBody, null), !hideTableFooter && React__default.createElement(MRT_TableFooter, null));
|
|
875
1742
|
};
|
|
876
1743
|
|
|
877
1744
|
var TextField = /*#__PURE__*/material.styled(material.TextField)({
|
|
@@ -880,9 +1747,9 @@ var TextField = /*#__PURE__*/material.styled(material.TextField)({
|
|
|
880
1747
|
var MRT_SearchTextField = function MRT_SearchTextField() {
|
|
881
1748
|
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
882
1749
|
tableInstance = _useMaterialReactTabl.tableInstance,
|
|
883
|
-
|
|
1750
|
+
muiSearchTextFieldProps = _useMaterialReactTabl.muiSearchTextFieldProps,
|
|
884
1751
|
localization = _useMaterialReactTabl.localization,
|
|
885
|
-
|
|
1752
|
+
onGlobalFilterChange = _useMaterialReactTabl.onGlobalFilterChange;
|
|
886
1753
|
|
|
887
1754
|
var _useState = React.useState(''),
|
|
888
1755
|
searchValue = _useState[0],
|
|
@@ -892,7 +1759,7 @@ var MRT_SearchTextField = function MRT_SearchTextField() {
|
|
|
892
1759
|
var _event$target$value;
|
|
893
1760
|
|
|
894
1761
|
tableInstance.setGlobalFilter((_event$target$value = event.target.value) != null ? _event$target$value : undefined);
|
|
895
|
-
|
|
1762
|
+
onGlobalFilterChange == null ? void 0 : onGlobalFilterChange(event);
|
|
896
1763
|
}, 200);
|
|
897
1764
|
|
|
898
1765
|
var handleClear = function handleClear() {
|
|
@@ -926,104 +1793,284 @@ var MRT_SearchTextField = function MRT_SearchTextField() {
|
|
|
926
1793
|
fontSize: "small"
|
|
927
1794
|
})))
|
|
928
1795
|
}
|
|
929
|
-
},
|
|
1796
|
+
}, muiSearchTextFieldProps));
|
|
1797
|
+
};
|
|
1798
|
+
|
|
1799
|
+
var MRT_ToggleFiltersButton = function MRT_ToggleFiltersButton() {
|
|
1800
|
+
var _localization$toggleF;
|
|
1801
|
+
|
|
1802
|
+
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
1803
|
+
localization = _useMaterialReactTabl.localization,
|
|
1804
|
+
setShowFilters = _useMaterialReactTabl.setShowFilters,
|
|
1805
|
+
showFilters = _useMaterialReactTabl.showFilters;
|
|
1806
|
+
|
|
1807
|
+
return React__default.createElement(material.Tooltip, {
|
|
1808
|
+
arrow: true,
|
|
1809
|
+
title: (_localization$toggleF = localization == null ? void 0 : localization.toggleFilterButtonTitle) != null ? _localization$toggleF : ''
|
|
1810
|
+
}, React__default.createElement(material.IconButton, {
|
|
1811
|
+
"aria-label": localization == null ? void 0 : localization.toggleFilterButtonTitle,
|
|
1812
|
+
onClick: function onClick() {
|
|
1813
|
+
return setShowFilters(!showFilters);
|
|
1814
|
+
},
|
|
1815
|
+
size: "small"
|
|
1816
|
+
}, showFilters ? React__default.createElement(FilterListOffIcon, null) : React__default.createElement(FilterIcon, null)));
|
|
1817
|
+
};
|
|
1818
|
+
|
|
1819
|
+
var MRT_ShowHideColumnsMenu = function MRT_ShowHideColumnsMenu(_ref) {
|
|
1820
|
+
var _column$columns;
|
|
1821
|
+
|
|
1822
|
+
var column = _ref.column;
|
|
1823
|
+
|
|
1824
|
+
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
1825
|
+
maxColumnDepth = _useMaterialReactTabl.maxColumnDepth;
|
|
1826
|
+
|
|
1827
|
+
var isMaxDepth = column.depth === maxColumnDepth;
|
|
1828
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(material.MenuItem, {
|
|
1829
|
+
style: {
|
|
1830
|
+
paddingLeft: column.depth + 1 + "rem"
|
|
1831
|
+
}
|
|
1832
|
+
}, isMaxDepth ? React__default.createElement(material.FormControlLabel, {
|
|
1833
|
+
checked: column.isVisible,
|
|
1834
|
+
control: React__default.createElement(material.Switch, null),
|
|
1835
|
+
label: column.Header,
|
|
1836
|
+
onChange: function onChange() {
|
|
1837
|
+
return isMaxDepth && column.toggleHidden();
|
|
1838
|
+
}
|
|
1839
|
+
}) : React__default.createElement(material.Typography, null, column.Header)), (_column$columns = column.columns) == null ? void 0 : _column$columns.map(function (c, i) {
|
|
1840
|
+
return React__default.createElement(MRT_ShowHideColumnsMenu, {
|
|
1841
|
+
key: i + "-" + c.id,
|
|
1842
|
+
column: c
|
|
1843
|
+
});
|
|
1844
|
+
}));
|
|
1845
|
+
};
|
|
1846
|
+
|
|
1847
|
+
var MRT_ShowHideColumnsButton = function MRT_ShowHideColumnsButton() {
|
|
1848
|
+
var _localization$showHid;
|
|
1849
|
+
|
|
1850
|
+
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
1851
|
+
tableInstance = _useMaterialReactTabl.tableInstance,
|
|
1852
|
+
localization = _useMaterialReactTabl.localization;
|
|
1853
|
+
|
|
1854
|
+
var _useState = React.useState(null),
|
|
1855
|
+
anchorEl = _useState[0],
|
|
1856
|
+
setAnchorEl = _useState[1];
|
|
1857
|
+
|
|
1858
|
+
var handleClick = function handleClick(event) {
|
|
1859
|
+
setAnchorEl(event.currentTarget);
|
|
1860
|
+
};
|
|
1861
|
+
|
|
1862
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(material.Tooltip, {
|
|
1863
|
+
arrow: true,
|
|
1864
|
+
title: (_localization$showHid = localization == null ? void 0 : localization.showHideColumnsButtonTitle) != null ? _localization$showHid : ''
|
|
1865
|
+
}, React__default.createElement(material.IconButton, {
|
|
1866
|
+
"aria-label": localization == null ? void 0 : localization.showHideColumnsButtonTitle,
|
|
1867
|
+
onClick: handleClick,
|
|
1868
|
+
size: "small"
|
|
1869
|
+
}, React__default.createElement(ViewColumnIcon, null))), React__default.createElement(material.Menu, {
|
|
1870
|
+
anchorEl: anchorEl,
|
|
1871
|
+
open: !!anchorEl,
|
|
1872
|
+
onClose: function onClose() {
|
|
1873
|
+
return setAnchorEl(null);
|
|
1874
|
+
}
|
|
1875
|
+
}, tableInstance.columns.map(function (column, index) {
|
|
1876
|
+
return React__default.createElement(MRT_ShowHideColumnsMenu, {
|
|
1877
|
+
key: index + "-" + column.id,
|
|
1878
|
+
column: column
|
|
1879
|
+
});
|
|
1880
|
+
})));
|
|
1881
|
+
};
|
|
1882
|
+
|
|
1883
|
+
var MRT_DensePaddingSwitch = function MRT_DensePaddingSwitch() {
|
|
1884
|
+
var _localization$toggleD;
|
|
1885
|
+
|
|
1886
|
+
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
1887
|
+
densePadding = _useMaterialReactTabl.densePadding,
|
|
1888
|
+
setDensePadding = _useMaterialReactTabl.setDensePadding,
|
|
1889
|
+
localization = _useMaterialReactTabl.localization;
|
|
1890
|
+
|
|
1891
|
+
return React__default.createElement(material.Tooltip, {
|
|
1892
|
+
arrow: true,
|
|
1893
|
+
title: (_localization$toggleD = localization == null ? void 0 : localization.toggleDensePaddingSwitchTitle) != null ? _localization$toggleD : ''
|
|
1894
|
+
}, React__default.createElement(material.Switch, {
|
|
1895
|
+
color: "default",
|
|
1896
|
+
checked: densePadding,
|
|
1897
|
+
size: "small",
|
|
1898
|
+
onChange: function onChange() {
|
|
1899
|
+
return setDensePadding(!densePadding);
|
|
1900
|
+
}
|
|
1901
|
+
}));
|
|
1902
|
+
};
|
|
1903
|
+
|
|
1904
|
+
var ToolbarButtonsContainer = /*#__PURE__*/material.styled('div')({
|
|
1905
|
+
display: 'flex',
|
|
1906
|
+
gap: '0.5rem',
|
|
1907
|
+
alignItems: 'center'
|
|
1908
|
+
});
|
|
1909
|
+
var MRT_ToolbarButtons = function MRT_ToolbarButtons() {
|
|
1910
|
+
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
1911
|
+
disableFilters = _useMaterialReactTabl.disableFilters,
|
|
1912
|
+
disableColumnHiding = _useMaterialReactTabl.disableColumnHiding,
|
|
1913
|
+
disableDensePaddingToggle = _useMaterialReactTabl.disableDensePaddingToggle;
|
|
1914
|
+
|
|
1915
|
+
return React__default.createElement(ToolbarButtonsContainer, null, !disableFilters && React__default.createElement(MRT_ToggleFiltersButton, null), !disableColumnHiding && React__default.createElement(MRT_ShowHideColumnsButton, null), !disableDensePaddingToggle && React__default.createElement(MRT_DensePaddingSwitch, null));
|
|
1916
|
+
};
|
|
1917
|
+
|
|
1918
|
+
var MRT_TablePagination = function MRT_TablePagination() {
|
|
1919
|
+
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
1920
|
+
tableInstance = _useMaterialReactTabl.tableInstance,
|
|
1921
|
+
muiTablePaginationProps = _useMaterialReactTabl.muiTablePaginationProps;
|
|
1922
|
+
|
|
1923
|
+
var tablePaginationProps = muiTablePaginationProps instanceof Function ? muiTablePaginationProps(tableInstance) : muiTablePaginationProps;
|
|
1924
|
+
|
|
1925
|
+
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
1926
|
+
tableInstance.setPageSize(+event.target.value);
|
|
1927
|
+
tableInstance.gotoPage(0);
|
|
1928
|
+
};
|
|
1929
|
+
|
|
1930
|
+
return React__default.createElement(material.TablePagination, Object.assign({
|
|
1931
|
+
component: 'div',
|
|
1932
|
+
count: tableInstance.rows.length,
|
|
1933
|
+
onPageChange: function onPageChange(_, newPage) {
|
|
1934
|
+
return tableInstance.gotoPage(newPage);
|
|
1935
|
+
},
|
|
1936
|
+
onRowsPerPageChange: handleChangeRowsPerPage,
|
|
1937
|
+
page: tableInstance.state.pageIndex,
|
|
1938
|
+
rowsPerPage: tableInstance.state.pageSize,
|
|
1939
|
+
showFirstButton: tableInstance.rows.length / tableInstance.state.pageSize > 2,
|
|
1940
|
+
showLastButton: tableInstance.rows.length / tableInstance.state.pageSize > 2
|
|
1941
|
+
}, tablePaginationProps));
|
|
930
1942
|
};
|
|
931
1943
|
|
|
932
1944
|
var Toolbar = /*#__PURE__*/material.styled(material.Toolbar)({
|
|
1945
|
+
display: 'grid'
|
|
1946
|
+
});
|
|
1947
|
+
var ToolbarTopRow = /*#__PURE__*/material.styled('div')({
|
|
933
1948
|
padding: '0.5rem',
|
|
934
1949
|
display: 'flex',
|
|
935
1950
|
justifyContent: 'space-between'
|
|
936
1951
|
});
|
|
937
|
-
var
|
|
1952
|
+
var ToolbarActionsContainer = /*#__PURE__*/material.styled('div')({
|
|
1953
|
+
display: 'flex',
|
|
1954
|
+
gap: '0.5rem'
|
|
1955
|
+
});
|
|
1956
|
+
var MRT_ToolbarTop = function MRT_ToolbarTop() {
|
|
938
1957
|
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
1958
|
+
disableGlobalFilter = _useMaterialReactTabl.disableGlobalFilter,
|
|
1959
|
+
disableColumnHiding = _useMaterialReactTabl.disableColumnHiding,
|
|
1960
|
+
muiTableTitleProps = _useMaterialReactTabl.muiTableTitleProps,
|
|
1961
|
+
disableFilters = _useMaterialReactTabl.disableFilters,
|
|
1962
|
+
manualPagination = _useMaterialReactTabl.manualPagination,
|
|
1963
|
+
positionPagination = _useMaterialReactTabl.positionPagination,
|
|
1964
|
+
muiTableToolbarTopProps = _useMaterialReactTabl.muiTableToolbarTopProps,
|
|
1965
|
+
hideToolbarActions = _useMaterialReactTabl.hideToolbarActions,
|
|
1966
|
+
positionToolbarActions = _useMaterialReactTabl.positionToolbarActions,
|
|
1967
|
+
title = _useMaterialReactTabl.title,
|
|
1968
|
+
tableInstance = _useMaterialReactTabl.tableInstance; // if no features in the toolbar are enabled, don't render anything
|
|
949
1969
|
|
|
950
1970
|
|
|
951
|
-
if (!
|
|
1971
|
+
if (!muiTableToolbarTopProps && !title && disableColumnHiding && disableFilters && disableGlobalFilter) {
|
|
952
1972
|
return null;
|
|
953
1973
|
}
|
|
954
1974
|
|
|
1975
|
+
var toolbarProps = muiTableToolbarTopProps instanceof Function ? muiTableToolbarTopProps(tableInstance) : muiTableToolbarTopProps;
|
|
955
1976
|
return React__default.createElement(Toolbar, Object.assign({
|
|
956
1977
|
variant: "dense"
|
|
957
|
-
},
|
|
1978
|
+
}, toolbarProps), React__default.createElement(ToolbarTopRow, null, title ? React__default.createElement(material.Typography, Object.assign({
|
|
1979
|
+
variant: "h5"
|
|
1980
|
+
}, muiTableTitleProps), title) : React__default.createElement("span", null), React__default.createElement(ToolbarActionsContainer, null, !disableGlobalFilter && React__default.createElement(MRT_SearchTextField, null), !hideToolbarActions && positionToolbarActions === 'top' && React__default.createElement(MRT_ToolbarButtons, null))), React__default.createElement("div", null, !manualPagination && ['top', 'both'].includes(positionPagination != null ? positionPagination : '') && React__default.createElement(MRT_TablePagination, null)));
|
|
1981
|
+
};
|
|
1982
|
+
|
|
1983
|
+
var Toolbar$1 = /*#__PURE__*/material.styled(material.Toolbar)({
|
|
1984
|
+
padding: 0,
|
|
1985
|
+
display: 'flex',
|
|
1986
|
+
justifyContent: 'space-between'
|
|
1987
|
+
});
|
|
1988
|
+
var MRT_ToolbarBottom = function MRT_ToolbarBottom() {
|
|
1989
|
+
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
1990
|
+
disableGlobalFilter = _useMaterialReactTabl.disableGlobalFilter,
|
|
1991
|
+
disableColumnHiding = _useMaterialReactTabl.disableColumnHiding,
|
|
1992
|
+
manualPagination = _useMaterialReactTabl.manualPagination,
|
|
1993
|
+
positionPagination = _useMaterialReactTabl.positionPagination,
|
|
1994
|
+
disableFilters = _useMaterialReactTabl.disableFilters,
|
|
1995
|
+
hideToolbarActions = _useMaterialReactTabl.hideToolbarActions,
|
|
1996
|
+
positionToolbarActions = _useMaterialReactTabl.positionToolbarActions,
|
|
1997
|
+
muiTableToolbarBottomProps = _useMaterialReactTabl.muiTableToolbarBottomProps,
|
|
1998
|
+
title = _useMaterialReactTabl.title,
|
|
1999
|
+
tableInstance = _useMaterialReactTabl.tableInstance; // if no features in the toolbar are enabled, don't render anything
|
|
2000
|
+
|
|
2001
|
+
|
|
2002
|
+
if (!muiTableToolbarBottomProps && !title && disableColumnHiding && disableFilters && disableGlobalFilter) {
|
|
2003
|
+
return null;
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
var toolbarProps = muiTableToolbarBottomProps instanceof Function ? muiTableToolbarBottomProps(tableInstance) : muiTableToolbarBottomProps;
|
|
2007
|
+
return React__default.createElement(Toolbar$1, Object.assign({
|
|
2008
|
+
variant: "dense"
|
|
2009
|
+
}, toolbarProps), !hideToolbarActions && positionToolbarActions === 'bottom' ? React__default.createElement(MRT_ToolbarButtons, null) : React__default.createElement("span", null), !manualPagination && ['bottom', 'both'].includes(positionPagination != null ? positionPagination : '') && React__default.createElement(MRT_TablePagination, null));
|
|
958
2010
|
};
|
|
959
2011
|
|
|
960
2012
|
var MRT_TableContainer = function MRT_TableContainer() {
|
|
961
2013
|
var _useMaterialReactTabl = useMaterialReactTable(),
|
|
962
|
-
|
|
963
|
-
|
|
2014
|
+
muiTableContainerProps = _useMaterialReactTabl.muiTableContainerProps,
|
|
2015
|
+
hideToolbarTop = _useMaterialReactTabl.hideToolbarTop,
|
|
2016
|
+
hideToolbarBottom = _useMaterialReactTabl.hideToolbarBottom,
|
|
2017
|
+
isFetching = _useMaterialReactTabl.isFetching;
|
|
964
2018
|
|
|
965
2019
|
return React__default.createElement(material.TableContainer, Object.assign({
|
|
966
2020
|
component: material.Paper
|
|
967
|
-
},
|
|
2021
|
+
}, muiTableContainerProps), !hideToolbarTop && React__default.createElement(MRT_ToolbarTop, null), isFetching && React__default.createElement(material.LinearProgress, null), React__default.createElement(MRT_Table, null), !hideToolbarBottom && React__default.createElement(MRT_ToolbarBottom, null));
|
|
968
2022
|
};
|
|
969
2023
|
|
|
970
2024
|
var defaultLocalization = {
|
|
2025
|
+
actionsHeadColumnTitle: 'Actions',
|
|
971
2026
|
columnActionMenuButtonTitle: 'Column Actions',
|
|
2027
|
+
columnActionMenuItemClearSort: 'Clear sorting',
|
|
2028
|
+
columnActionMenuItemGroupBy: 'Group by column',
|
|
972
2029
|
columnActionMenuItemHideColumn: 'Hide column',
|
|
973
2030
|
columnActionMenuItemSortAsc: 'Sort ascending',
|
|
974
|
-
columnActionMenuItemClearSort: 'Clear sorting',
|
|
975
2031
|
columnActionMenuItemSortDesc: 'Sort descending',
|
|
976
|
-
columnActionMenuItemGroupBy: 'Group by column',
|
|
977
2032
|
columnActionMenuItemUnGroupBy: 'Ungroup column',
|
|
978
2033
|
expandAllButtonTitle: 'Expand all',
|
|
979
2034
|
expandButtonTitle: 'Expand',
|
|
980
2035
|
filterTextFieldClearButtonTitle: 'Clear filter',
|
|
981
2036
|
filterTextFieldPlaceholder: 'Filter',
|
|
2037
|
+
rowActionMenuButtonTitle: 'Row Actions',
|
|
2038
|
+
rowActionsColumnTitle: 'Actions',
|
|
2039
|
+
rowActionMenuItemEdit: 'Edit',
|
|
2040
|
+
rowActionButtonSave: 'Save',
|
|
2041
|
+
rowActionButtonCancel: 'Cancel',
|
|
982
2042
|
searchTextFieldClearButtonTitle: 'Clear search',
|
|
983
2043
|
searchTextFieldPlaceholder: 'Search',
|
|
984
|
-
showHideColumnsButtonTitle: 'Show/Hide columns'
|
|
2044
|
+
showHideColumnsButtonTitle: 'Show/Hide columns',
|
|
2045
|
+
toggleDensePaddingSwitchTitle: 'Toggle dense padding',
|
|
2046
|
+
toggleFilterButtonTitle: 'Toggle filters'
|
|
985
2047
|
};
|
|
986
2048
|
|
|
987
|
-
var _excluded
|
|
988
|
-
var MaterialReactTable = function
|
|
2049
|
+
var _excluded = ["defaultColumn", "localization", "positionActionsColumn", "positionPagination", "positionToolbarActions"];
|
|
2050
|
+
var MaterialReactTable = (function (_ref) {
|
|
989
2051
|
var _ref$defaultColumn = _ref.defaultColumn,
|
|
990
2052
|
defaultColumn = _ref$defaultColumn === void 0 ? {
|
|
991
2053
|
minWidth: 50,
|
|
992
2054
|
maxWidth: 1000
|
|
993
2055
|
} : _ref$defaultColumn,
|
|
994
|
-
_ref$enablePagination = _ref.enablePagination,
|
|
995
|
-
enablePagination = _ref$enablePagination === void 0 ? true : _ref$enablePagination,
|
|
996
|
-
_ref$enableSorting = _ref.enableSorting,
|
|
997
|
-
enableSorting = _ref$enableSorting === void 0 ? true : _ref$enableSorting,
|
|
998
|
-
_ref$enableSubRowTree = _ref.enableSubRowTree,
|
|
999
|
-
enableSubRowTree = _ref$enableSubRowTree === void 0 ? true : _ref$enableSubRowTree,
|
|
1000
2056
|
_ref$localization = _ref.localization,
|
|
1001
2057
|
localization = _ref$localization === void 0 ? defaultLocalization : _ref$localization,
|
|
2058
|
+
_ref$positionActionsC = _ref.positionActionsColumn,
|
|
2059
|
+
positionActionsColumn = _ref$positionActionsC === void 0 ? 'first' : _ref$positionActionsC,
|
|
1002
2060
|
_ref$positionPaginati = _ref.positionPagination,
|
|
1003
2061
|
positionPagination = _ref$positionPaginati === void 0 ? 'bottom' : _ref$positionPaginati,
|
|
1004
|
-
_ref$
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
showFooter = _ref$showFooter === void 0 ? true : _ref$showFooter,
|
|
1008
|
-
_ref$showHead = _ref.showHead,
|
|
1009
|
-
showHead = _ref$showHead === void 0 ? true : _ref$showHead,
|
|
1010
|
-
_ref$showToolbar = _ref.showToolbar,
|
|
1011
|
-
showToolbar = _ref$showToolbar === void 0 ? true : _ref$showToolbar,
|
|
1012
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
2062
|
+
_ref$positionToolbarA = _ref.positionToolbarActions,
|
|
2063
|
+
positionToolbarActions = _ref$positionToolbarA === void 0 ? 'top' : _ref$positionToolbarA,
|
|
2064
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
1013
2065
|
|
|
1014
2066
|
return React__default.createElement(MaterialReactTableProvider, Object.assign({
|
|
1015
2067
|
defaultColumn: defaultColumn,
|
|
1016
|
-
enablePagination: enablePagination,
|
|
1017
|
-
enableSorting: enableSorting,
|
|
1018
|
-
enableSubRowTree: enableSubRowTree,
|
|
1019
2068
|
localization: _extends({}, defaultLocalization, localization),
|
|
1020
2069
|
positionPagination: positionPagination,
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
showHead: showHead,
|
|
1024
|
-
showToolbar: showToolbar
|
|
2070
|
+
positionActionsColumn: positionActionsColumn,
|
|
2071
|
+
positionToolbarActions: positionToolbarActions
|
|
1025
2072
|
}, rest), React__default.createElement(MRT_TableContainer, null));
|
|
1026
|
-
};
|
|
2073
|
+
});
|
|
1027
2074
|
|
|
1028
2075
|
exports.default = MaterialReactTable;
|
|
1029
2076
|
//# sourceMappingURL=material-react-table.cjs.development.js.map
|