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