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