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