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