material-react-table 0.7.0-alpha.1 → 0.7.0-alpha.10
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 +29 -19
- package/dist/MaterialReactTable.d.ts +203 -61
- package/dist/buttons/MRT_CopyButton.d.ts +1 -2
- package/dist/localization.d.ts +1 -0
- package/dist/material-react-table.cjs.development.js +303 -956
- 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 +303 -956
- package/dist/material-react-table.esm.js.map +1 -1
- package/dist/utils.d.ts +1 -1
- package/package.json +4 -4
- package/src/MaterialReactTable.tsx +380 -128
- package/src/body/MRT_TableBody.tsx +1 -1
- package/src/body/MRT_TableBodyCell.tsx +9 -6
- package/src/body/MRT_TableBodyRow.tsx +2 -2
- package/src/body/MRT_TableDetailPanel.tsx +6 -4
- package/src/buttons/MRT_CopyButton.tsx +3 -4
- package/src/buttons/MRT_EditActionButtons.tsx +5 -3
- package/src/buttons/MRT_ExpandButton.tsx +1 -1
- package/src/buttons/MRT_ToggleColumnActionMenuButton.tsx +5 -2
- package/src/buttons/MRT_ToggleRowActionMenuButton.tsx +6 -6
- package/src/buttons/MRT_ToggleSearchButton.tsx +6 -1
- package/src/footer/MRT_TableFooter.tsx +1 -1
- package/src/footer/MRT_TableFooterCell.tsx +2 -2
- package/src/footer/MRT_TableFooterRow.tsx +1 -1
- package/src/head/MRT_TableHead.tsx +1 -1
- package/src/head/MRT_TableHeadCell.tsx +22 -29
- package/src/head/MRT_TableHeadRow.tsx +1 -1
- package/src/inputs/MRT_EditCellTextField.tsx +30 -14
- package/src/inputs/MRT_FilterTextField.tsx +2 -2
- package/src/inputs/MRT_SearchTextField.tsx +8 -3
- package/src/inputs/MRT_SelectCheckbox.tsx +9 -7
- package/src/localization.ts +2 -1
- package/src/menus/MRT_RowActionMenu.tsx +7 -5
- package/src/menus/MRT_ShowHideColumnsMenuItems.tsx +4 -5
- package/src/table/MRT_Table.tsx +1 -1
- package/src/table/MRT_TableContainer.tsx +16 -20
- package/src/table/MRT_TablePaper.tsx +9 -5
- package/src/table/MRT_TableRoot.tsx +11 -8
- package/src/toolbar/MRT_LinearProgressBar.tsx +1 -1
- package/src/toolbar/MRT_TablePagination.tsx +6 -2
- package/src/toolbar/MRT_ToolbarAlertBanner.tsx +2 -1
- package/src/toolbar/MRT_ToolbarBottom.tsx +1 -1
- package/src/toolbar/MRT_ToolbarInternalButtons.tsx +5 -4
- package/src/toolbar/MRT_ToolbarTop.tsx +2 -2
|
@@ -30,42 +30,6 @@ import { createTable, useTable, columnFilterRowsFn, expandRowsFn, globalFilterRo
|
|
|
30
30
|
import { IconButton, Menu, MenuItem, FormControlLabel, Switch, Box, Button, Divider, ListItemIcon, Tooltip, Checkbox, debounce, Collapse, TextField, InputAdornment, TablePagination, useMediaQuery, Chip, Alert, LinearProgress, Toolbar, alpha, TableCell, TableSortLabel, TableRow, TableHead, Skeleton, TableBody, TableFooter, Table, TableContainer, Paper } from '@mui/material';
|
|
31
31
|
import { matchSorter } from 'match-sorter';
|
|
32
32
|
|
|
33
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
34
|
-
try {
|
|
35
|
-
var info = gen[key](arg);
|
|
36
|
-
var value = info.value;
|
|
37
|
-
} catch (error) {
|
|
38
|
-
reject(error);
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (info.done) {
|
|
43
|
-
resolve(value);
|
|
44
|
-
} else {
|
|
45
|
-
Promise.resolve(value).then(_next, _throw);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function _asyncToGenerator(fn) {
|
|
50
|
-
return function () {
|
|
51
|
-
var self = this,
|
|
52
|
-
args = arguments;
|
|
53
|
-
return new Promise(function (resolve, reject) {
|
|
54
|
-
var gen = fn.apply(self, args);
|
|
55
|
-
|
|
56
|
-
function _next(value) {
|
|
57
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function _throw(err) {
|
|
61
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
_next(undefined);
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
33
|
function _extends() {
|
|
70
34
|
_extends = Object.assign || function (target) {
|
|
71
35
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -134,6 +98,7 @@ var MRT_DefaultLocalization_EN = {
|
|
|
134
98
|
pinToLeft: 'Pin to left',
|
|
135
99
|
pinToRight: 'Pin to right',
|
|
136
100
|
rowActions: 'Row Actions',
|
|
101
|
+
rowNumber: '#',
|
|
137
102
|
rowNumbers: 'Row Numbers',
|
|
138
103
|
save: 'Save',
|
|
139
104
|
search: 'Search',
|
|
@@ -233,7 +198,11 @@ var MRT_ExpandButton = function MRT_ExpandButton(_ref) {
|
|
|
233
198
|
|
|
234
199
|
var handleToggleExpand = function handleToggleExpand(event) {
|
|
235
200
|
row.toggleExpanded();
|
|
236
|
-
onRowExpandChange == null ? void 0 : onRowExpandChange(
|
|
201
|
+
onRowExpandChange == null ? void 0 : onRowExpandChange({
|
|
202
|
+
event: event,
|
|
203
|
+
row: row,
|
|
204
|
+
tableInstance: tableInstance
|
|
205
|
+
});
|
|
237
206
|
};
|
|
238
207
|
|
|
239
208
|
return React.createElement(IconButton, {
|
|
@@ -562,11 +531,11 @@ var MRT_ShowHideColumnsMenuItems = function MRT_ShowHideColumnsMenuItems(_ref) {
|
|
|
562
531
|
column.toggleVisibility();
|
|
563
532
|
}
|
|
564
533
|
|
|
565
|
-
onColumnHide == null ? void 0 : onColumnHide(
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
})
|
|
534
|
+
onColumnHide == null ? void 0 : onColumnHide({
|
|
535
|
+
column: column,
|
|
536
|
+
columnVisibility: columnVisibility,
|
|
537
|
+
tableInstance: tableInstance
|
|
538
|
+
});
|
|
570
539
|
};
|
|
571
540
|
|
|
572
541
|
return React.createElement(React.Fragment, null, React.createElement(MenuItem, {
|
|
@@ -936,8 +905,6 @@ var MRT_ColumnActionMenu = function MRT_ColumnActionMenu(_ref) {
|
|
|
936
905
|
};
|
|
937
906
|
|
|
938
907
|
var MRT_RowActionMenu = function MRT_RowActionMenu(_ref) {
|
|
939
|
-
var _renderRowActionMenuI;
|
|
940
|
-
|
|
941
908
|
var anchorEl = _ref.anchorEl,
|
|
942
909
|
handleEdit = _ref.handleEdit,
|
|
943
910
|
row = _ref.row,
|
|
@@ -946,7 +913,7 @@ var MRT_RowActionMenu = function MRT_RowActionMenu(_ref) {
|
|
|
946
913
|
var getState = tableInstance.getState,
|
|
947
914
|
_tableInstance$option = tableInstance.options,
|
|
948
915
|
EditIcon = _tableInstance$option.icons.EditIcon,
|
|
949
|
-
|
|
916
|
+
enableEditing = _tableInstance$option.enableEditing,
|
|
950
917
|
localization = _tableInstance$option.localization,
|
|
951
918
|
renderRowActionMenuItems = _tableInstance$option.renderRowActionMenuItems;
|
|
952
919
|
|
|
@@ -962,775 +929,19 @@ var MRT_RowActionMenu = function MRT_RowActionMenu(_ref) {
|
|
|
962
929
|
MenuListProps: {
|
|
963
930
|
dense: isDensePadding
|
|
964
931
|
}
|
|
965
|
-
},
|
|
932
|
+
}, enableEditing && React.createElement(MenuItem, {
|
|
966
933
|
onClick: handleEdit,
|
|
967
934
|
sx: commonMenuItemStyles$1
|
|
968
935
|
}, React.createElement(Box, {
|
|
969
936
|
sx: commonListItemStyles
|
|
970
|
-
}, React.createElement(ListItemIcon, null, React.createElement(EditIcon, null)), localization.edit)),
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
function createCommonjsModule(fn, module) {
|
|
976
|
-
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
var runtime_1 = createCommonjsModule(function (module) {
|
|
980
|
-
/**
|
|
981
|
-
* Copyright (c) 2014-present, Facebook, Inc.
|
|
982
|
-
*
|
|
983
|
-
* This source code is licensed under the MIT license found in the
|
|
984
|
-
* LICENSE file in the root directory of this source tree.
|
|
985
|
-
*/
|
|
986
|
-
|
|
987
|
-
var runtime = (function (exports) {
|
|
988
|
-
|
|
989
|
-
var Op = Object.prototype;
|
|
990
|
-
var hasOwn = Op.hasOwnProperty;
|
|
991
|
-
var undefined$1; // More compressible than void 0.
|
|
992
|
-
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
993
|
-
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
994
|
-
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
995
|
-
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
996
|
-
|
|
997
|
-
function define(obj, key, value) {
|
|
998
|
-
Object.defineProperty(obj, key, {
|
|
999
|
-
value: value,
|
|
1000
|
-
enumerable: true,
|
|
1001
|
-
configurable: true,
|
|
1002
|
-
writable: true
|
|
1003
|
-
});
|
|
1004
|
-
return obj[key];
|
|
1005
|
-
}
|
|
1006
|
-
try {
|
|
1007
|
-
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
1008
|
-
define({}, "");
|
|
1009
|
-
} catch (err) {
|
|
1010
|
-
define = function(obj, key, value) {
|
|
1011
|
-
return obj[key] = value;
|
|
1012
|
-
};
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
1016
|
-
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
1017
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
1018
|
-
var generator = Object.create(protoGenerator.prototype);
|
|
1019
|
-
var context = new Context(tryLocsList || []);
|
|
1020
|
-
|
|
1021
|
-
// The ._invoke method unifies the implementations of the .next,
|
|
1022
|
-
// .throw, and .return methods.
|
|
1023
|
-
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
1024
|
-
|
|
1025
|
-
return generator;
|
|
1026
|
-
}
|
|
1027
|
-
exports.wrap = wrap;
|
|
1028
|
-
|
|
1029
|
-
// Try/catch helper to minimize deoptimizations. Returns a completion
|
|
1030
|
-
// record like context.tryEntries[i].completion. This interface could
|
|
1031
|
-
// have been (and was previously) designed to take a closure to be
|
|
1032
|
-
// invoked without arguments, but in all the cases we care about we
|
|
1033
|
-
// already have an existing method we want to call, so there's no need
|
|
1034
|
-
// to create a new function object. We can even get away with assuming
|
|
1035
|
-
// the method takes exactly one argument, since that happens to be true
|
|
1036
|
-
// in every case, so we don't have to touch the arguments object. The
|
|
1037
|
-
// only additional allocation required is the completion record, which
|
|
1038
|
-
// has a stable shape and so hopefully should be cheap to allocate.
|
|
1039
|
-
function tryCatch(fn, obj, arg) {
|
|
1040
|
-
try {
|
|
1041
|
-
return { type: "normal", arg: fn.call(obj, arg) };
|
|
1042
|
-
} catch (err) {
|
|
1043
|
-
return { type: "throw", arg: err };
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
var GenStateSuspendedStart = "suspendedStart";
|
|
1048
|
-
var GenStateSuspendedYield = "suspendedYield";
|
|
1049
|
-
var GenStateExecuting = "executing";
|
|
1050
|
-
var GenStateCompleted = "completed";
|
|
1051
|
-
|
|
1052
|
-
// Returning this object from the innerFn has the same effect as
|
|
1053
|
-
// breaking out of the dispatch switch statement.
|
|
1054
|
-
var ContinueSentinel = {};
|
|
1055
|
-
|
|
1056
|
-
// Dummy constructor functions that we use as the .constructor and
|
|
1057
|
-
// .constructor.prototype properties for functions that return Generator
|
|
1058
|
-
// objects. For full spec compliance, you may wish to configure your
|
|
1059
|
-
// minifier not to mangle the names of these two functions.
|
|
1060
|
-
function Generator() {}
|
|
1061
|
-
function GeneratorFunction() {}
|
|
1062
|
-
function GeneratorFunctionPrototype() {}
|
|
1063
|
-
|
|
1064
|
-
// This is a polyfill for %IteratorPrototype% for environments that
|
|
1065
|
-
// don't natively support it.
|
|
1066
|
-
var IteratorPrototype = {};
|
|
1067
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
1068
|
-
return this;
|
|
1069
|
-
});
|
|
1070
|
-
|
|
1071
|
-
var getProto = Object.getPrototypeOf;
|
|
1072
|
-
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
1073
|
-
if (NativeIteratorPrototype &&
|
|
1074
|
-
NativeIteratorPrototype !== Op &&
|
|
1075
|
-
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
1076
|
-
// This environment has a native %IteratorPrototype%; use it instead
|
|
1077
|
-
// of the polyfill.
|
|
1078
|
-
IteratorPrototype = NativeIteratorPrototype;
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
|
-
var Gp = GeneratorFunctionPrototype.prototype =
|
|
1082
|
-
Generator.prototype = Object.create(IteratorPrototype);
|
|
1083
|
-
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
|
1084
|
-
define(Gp, "constructor", GeneratorFunctionPrototype);
|
|
1085
|
-
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
|
1086
|
-
GeneratorFunction.displayName = define(
|
|
1087
|
-
GeneratorFunctionPrototype,
|
|
1088
|
-
toStringTagSymbol,
|
|
1089
|
-
"GeneratorFunction"
|
|
1090
|
-
);
|
|
1091
|
-
|
|
1092
|
-
// Helper for defining the .next, .throw, and .return methods of the
|
|
1093
|
-
// Iterator interface in terms of a single ._invoke method.
|
|
1094
|
-
function defineIteratorMethods(prototype) {
|
|
1095
|
-
["next", "throw", "return"].forEach(function(method) {
|
|
1096
|
-
define(prototype, method, function(arg) {
|
|
1097
|
-
return this._invoke(method, arg);
|
|
1098
|
-
});
|
|
1099
|
-
});
|
|
1100
|
-
}
|
|
1101
|
-
|
|
1102
|
-
exports.isGeneratorFunction = function(genFun) {
|
|
1103
|
-
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
1104
|
-
return ctor
|
|
1105
|
-
? ctor === GeneratorFunction ||
|
|
1106
|
-
// For the native GeneratorFunction constructor, the best we can
|
|
1107
|
-
// do is to check its .name property.
|
|
1108
|
-
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
|
1109
|
-
: false;
|
|
1110
|
-
};
|
|
1111
|
-
|
|
1112
|
-
exports.mark = function(genFun) {
|
|
1113
|
-
if (Object.setPrototypeOf) {
|
|
1114
|
-
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
1115
|
-
} else {
|
|
1116
|
-
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
1117
|
-
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
|
1118
|
-
}
|
|
1119
|
-
genFun.prototype = Object.create(Gp);
|
|
1120
|
-
return genFun;
|
|
1121
|
-
};
|
|
1122
|
-
|
|
1123
|
-
// Within the body of any async function, `await x` is transformed to
|
|
1124
|
-
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
1125
|
-
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
1126
|
-
// meant to be awaited.
|
|
1127
|
-
exports.awrap = function(arg) {
|
|
1128
|
-
return { __await: arg };
|
|
1129
|
-
};
|
|
1130
|
-
|
|
1131
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
1132
|
-
function invoke(method, arg, resolve, reject) {
|
|
1133
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
1134
|
-
if (record.type === "throw") {
|
|
1135
|
-
reject(record.arg);
|
|
1136
|
-
} else {
|
|
1137
|
-
var result = record.arg;
|
|
1138
|
-
var value = result.value;
|
|
1139
|
-
if (value &&
|
|
1140
|
-
typeof value === "object" &&
|
|
1141
|
-
hasOwn.call(value, "__await")) {
|
|
1142
|
-
return PromiseImpl.resolve(value.__await).then(function(value) {
|
|
1143
|
-
invoke("next", value, resolve, reject);
|
|
1144
|
-
}, function(err) {
|
|
1145
|
-
invoke("throw", err, resolve, reject);
|
|
1146
|
-
});
|
|
1147
|
-
}
|
|
1148
|
-
|
|
1149
|
-
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
|
1150
|
-
// When a yielded Promise is resolved, its final value becomes
|
|
1151
|
-
// the .value of the Promise<{value,done}> result for the
|
|
1152
|
-
// current iteration.
|
|
1153
|
-
result.value = unwrapped;
|
|
1154
|
-
resolve(result);
|
|
1155
|
-
}, function(error) {
|
|
1156
|
-
// If a rejected Promise was yielded, throw the rejection back
|
|
1157
|
-
// into the async generator function so it can be handled there.
|
|
1158
|
-
return invoke("throw", error, resolve, reject);
|
|
1159
|
-
});
|
|
1160
|
-
}
|
|
1161
|
-
}
|
|
1162
|
-
|
|
1163
|
-
var previousPromise;
|
|
1164
|
-
|
|
1165
|
-
function enqueue(method, arg) {
|
|
1166
|
-
function callInvokeWithMethodAndArg() {
|
|
1167
|
-
return new PromiseImpl(function(resolve, reject) {
|
|
1168
|
-
invoke(method, arg, resolve, reject);
|
|
1169
|
-
});
|
|
1170
|
-
}
|
|
1171
|
-
|
|
1172
|
-
return previousPromise =
|
|
1173
|
-
// If enqueue has been called before, then we want to wait until
|
|
1174
|
-
// all previous Promises have been resolved before calling invoke,
|
|
1175
|
-
// so that results are always delivered in the correct order. If
|
|
1176
|
-
// enqueue has not been called before, then it is important to
|
|
1177
|
-
// call invoke immediately, without waiting on a callback to fire,
|
|
1178
|
-
// so that the async generator function has the opportunity to do
|
|
1179
|
-
// any necessary setup in a predictable way. This predictability
|
|
1180
|
-
// is why the Promise constructor synchronously invokes its
|
|
1181
|
-
// executor callback, and why async functions synchronously
|
|
1182
|
-
// execute code before the first await. Since we implement simple
|
|
1183
|
-
// async functions in terms of async generators, it is especially
|
|
1184
|
-
// important to get this right, even though it requires care.
|
|
1185
|
-
previousPromise ? previousPromise.then(
|
|
1186
|
-
callInvokeWithMethodAndArg,
|
|
1187
|
-
// Avoid propagating failures to Promises returned by later
|
|
1188
|
-
// invocations of the iterator.
|
|
1189
|
-
callInvokeWithMethodAndArg
|
|
1190
|
-
) : callInvokeWithMethodAndArg();
|
|
1191
|
-
}
|
|
1192
|
-
|
|
1193
|
-
// Define the unified helper method that is used to implement .next,
|
|
1194
|
-
// .throw, and .return (see defineIteratorMethods).
|
|
1195
|
-
this._invoke = enqueue;
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
defineIteratorMethods(AsyncIterator.prototype);
|
|
1199
|
-
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
1200
|
-
return this;
|
|
1201
|
-
});
|
|
1202
|
-
exports.AsyncIterator = AsyncIterator;
|
|
1203
|
-
|
|
1204
|
-
// Note that simple async functions are implemented on top of
|
|
1205
|
-
// AsyncIterator objects; they just return a Promise for the value of
|
|
1206
|
-
// the final result produced by the iterator.
|
|
1207
|
-
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
1208
|
-
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
1209
|
-
|
|
1210
|
-
var iter = new AsyncIterator(
|
|
1211
|
-
wrap(innerFn, outerFn, self, tryLocsList),
|
|
1212
|
-
PromiseImpl
|
|
1213
|
-
);
|
|
1214
|
-
|
|
1215
|
-
return exports.isGeneratorFunction(outerFn)
|
|
1216
|
-
? iter // If outerFn is a generator, return the full iterator.
|
|
1217
|
-
: iter.next().then(function(result) {
|
|
1218
|
-
return result.done ? result.value : iter.next();
|
|
1219
|
-
});
|
|
1220
|
-
};
|
|
1221
|
-
|
|
1222
|
-
function makeInvokeMethod(innerFn, self, context) {
|
|
1223
|
-
var state = GenStateSuspendedStart;
|
|
1224
|
-
|
|
1225
|
-
return function invoke(method, arg) {
|
|
1226
|
-
if (state === GenStateExecuting) {
|
|
1227
|
-
throw new Error("Generator is already running");
|
|
1228
|
-
}
|
|
1229
|
-
|
|
1230
|
-
if (state === GenStateCompleted) {
|
|
1231
|
-
if (method === "throw") {
|
|
1232
|
-
throw arg;
|
|
1233
|
-
}
|
|
1234
|
-
|
|
1235
|
-
// Be forgiving, per 25.3.3.3.3 of the spec:
|
|
1236
|
-
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
1237
|
-
return doneResult();
|
|
1238
|
-
}
|
|
1239
|
-
|
|
1240
|
-
context.method = method;
|
|
1241
|
-
context.arg = arg;
|
|
1242
|
-
|
|
1243
|
-
while (true) {
|
|
1244
|
-
var delegate = context.delegate;
|
|
1245
|
-
if (delegate) {
|
|
1246
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
1247
|
-
if (delegateResult) {
|
|
1248
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
1249
|
-
return delegateResult;
|
|
1250
|
-
}
|
|
1251
|
-
}
|
|
1252
|
-
|
|
1253
|
-
if (context.method === "next") {
|
|
1254
|
-
// Setting context._sent for legacy support of Babel's
|
|
1255
|
-
// function.sent implementation.
|
|
1256
|
-
context.sent = context._sent = context.arg;
|
|
1257
|
-
|
|
1258
|
-
} else if (context.method === "throw") {
|
|
1259
|
-
if (state === GenStateSuspendedStart) {
|
|
1260
|
-
state = GenStateCompleted;
|
|
1261
|
-
throw context.arg;
|
|
1262
|
-
}
|
|
1263
|
-
|
|
1264
|
-
context.dispatchException(context.arg);
|
|
1265
|
-
|
|
1266
|
-
} else if (context.method === "return") {
|
|
1267
|
-
context.abrupt("return", context.arg);
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
state = GenStateExecuting;
|
|
1271
|
-
|
|
1272
|
-
var record = tryCatch(innerFn, self, context);
|
|
1273
|
-
if (record.type === "normal") {
|
|
1274
|
-
// If an exception is thrown from innerFn, we leave state ===
|
|
1275
|
-
// GenStateExecuting and loop back for another invocation.
|
|
1276
|
-
state = context.done
|
|
1277
|
-
? GenStateCompleted
|
|
1278
|
-
: GenStateSuspendedYield;
|
|
1279
|
-
|
|
1280
|
-
if (record.arg === ContinueSentinel) {
|
|
1281
|
-
continue;
|
|
1282
|
-
}
|
|
1283
|
-
|
|
1284
|
-
return {
|
|
1285
|
-
value: record.arg,
|
|
1286
|
-
done: context.done
|
|
1287
|
-
};
|
|
1288
|
-
|
|
1289
|
-
} else if (record.type === "throw") {
|
|
1290
|
-
state = GenStateCompleted;
|
|
1291
|
-
// Dispatch the exception by looping back around to the
|
|
1292
|
-
// context.dispatchException(context.arg) call above.
|
|
1293
|
-
context.method = "throw";
|
|
1294
|
-
context.arg = record.arg;
|
|
1295
|
-
}
|
|
1296
|
-
}
|
|
1297
|
-
};
|
|
1298
|
-
}
|
|
1299
|
-
|
|
1300
|
-
// Call delegate.iterator[context.method](context.arg) and handle the
|
|
1301
|
-
// result, either by returning a { value, done } result from the
|
|
1302
|
-
// delegate iterator, or by modifying context.method and context.arg,
|
|
1303
|
-
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
1304
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
1305
|
-
var method = delegate.iterator[context.method];
|
|
1306
|
-
if (method === undefined$1) {
|
|
1307
|
-
// A .throw or .return when the delegate iterator has no .throw
|
|
1308
|
-
// method always terminates the yield* loop.
|
|
1309
|
-
context.delegate = null;
|
|
1310
|
-
|
|
1311
|
-
if (context.method === "throw") {
|
|
1312
|
-
// Note: ["return"] must be used for ES3 parsing compatibility.
|
|
1313
|
-
if (delegate.iterator["return"]) {
|
|
1314
|
-
// If the delegate iterator has a return method, give it a
|
|
1315
|
-
// chance to clean up.
|
|
1316
|
-
context.method = "return";
|
|
1317
|
-
context.arg = undefined$1;
|
|
1318
|
-
maybeInvokeDelegate(delegate, context);
|
|
1319
|
-
|
|
1320
|
-
if (context.method === "throw") {
|
|
1321
|
-
// If maybeInvokeDelegate(context) changed context.method from
|
|
1322
|
-
// "return" to "throw", let that override the TypeError below.
|
|
1323
|
-
return ContinueSentinel;
|
|
1324
|
-
}
|
|
1325
|
-
}
|
|
1326
|
-
|
|
1327
|
-
context.method = "throw";
|
|
1328
|
-
context.arg = new TypeError(
|
|
1329
|
-
"The iterator does not provide a 'throw' method");
|
|
1330
|
-
}
|
|
1331
|
-
|
|
1332
|
-
return ContinueSentinel;
|
|
1333
|
-
}
|
|
1334
|
-
|
|
1335
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
1336
|
-
|
|
1337
|
-
if (record.type === "throw") {
|
|
1338
|
-
context.method = "throw";
|
|
1339
|
-
context.arg = record.arg;
|
|
1340
|
-
context.delegate = null;
|
|
1341
|
-
return ContinueSentinel;
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
var info = record.arg;
|
|
1345
|
-
|
|
1346
|
-
if (! info) {
|
|
1347
|
-
context.method = "throw";
|
|
1348
|
-
context.arg = new TypeError("iterator result is not an object");
|
|
1349
|
-
context.delegate = null;
|
|
1350
|
-
return ContinueSentinel;
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
|
-
if (info.done) {
|
|
1354
|
-
// Assign the result of the finished delegate to the temporary
|
|
1355
|
-
// variable specified by delegate.resultName (see delegateYield).
|
|
1356
|
-
context[delegate.resultName] = info.value;
|
|
1357
|
-
|
|
1358
|
-
// Resume execution at the desired location (see delegateYield).
|
|
1359
|
-
context.next = delegate.nextLoc;
|
|
1360
|
-
|
|
1361
|
-
// If context.method was "throw" but the delegate handled the
|
|
1362
|
-
// exception, let the outer generator proceed normally. If
|
|
1363
|
-
// context.method was "next", forget context.arg since it has been
|
|
1364
|
-
// "consumed" by the delegate iterator. If context.method was
|
|
1365
|
-
// "return", allow the original .return call to continue in the
|
|
1366
|
-
// outer generator.
|
|
1367
|
-
if (context.method !== "return") {
|
|
1368
|
-
context.method = "next";
|
|
1369
|
-
context.arg = undefined$1;
|
|
1370
|
-
}
|
|
1371
|
-
|
|
1372
|
-
} else {
|
|
1373
|
-
// Re-yield the result returned by the delegate method.
|
|
1374
|
-
return info;
|
|
1375
|
-
}
|
|
1376
|
-
|
|
1377
|
-
// The delegate iterator is finished, so forget it and continue with
|
|
1378
|
-
// the outer generator.
|
|
1379
|
-
context.delegate = null;
|
|
1380
|
-
return ContinueSentinel;
|
|
1381
|
-
}
|
|
1382
|
-
|
|
1383
|
-
// Define Generator.prototype.{next,throw,return} in terms of the
|
|
1384
|
-
// unified ._invoke helper method.
|
|
1385
|
-
defineIteratorMethods(Gp);
|
|
1386
|
-
|
|
1387
|
-
define(Gp, toStringTagSymbol, "Generator");
|
|
1388
|
-
|
|
1389
|
-
// A Generator should always return itself as the iterator object when the
|
|
1390
|
-
// @@iterator function is called on it. Some browsers' implementations of the
|
|
1391
|
-
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
1392
|
-
// object to not be returned from this call. This ensures that doesn't happen.
|
|
1393
|
-
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
1394
|
-
define(Gp, iteratorSymbol, function() {
|
|
1395
|
-
return this;
|
|
1396
|
-
});
|
|
1397
|
-
|
|
1398
|
-
define(Gp, "toString", function() {
|
|
1399
|
-
return "[object Generator]";
|
|
1400
|
-
});
|
|
1401
|
-
|
|
1402
|
-
function pushTryEntry(locs) {
|
|
1403
|
-
var entry = { tryLoc: locs[0] };
|
|
1404
|
-
|
|
1405
|
-
if (1 in locs) {
|
|
1406
|
-
entry.catchLoc = locs[1];
|
|
1407
|
-
}
|
|
1408
|
-
|
|
1409
|
-
if (2 in locs) {
|
|
1410
|
-
entry.finallyLoc = locs[2];
|
|
1411
|
-
entry.afterLoc = locs[3];
|
|
1412
|
-
}
|
|
1413
|
-
|
|
1414
|
-
this.tryEntries.push(entry);
|
|
1415
|
-
}
|
|
1416
|
-
|
|
1417
|
-
function resetTryEntry(entry) {
|
|
1418
|
-
var record = entry.completion || {};
|
|
1419
|
-
record.type = "normal";
|
|
1420
|
-
delete record.arg;
|
|
1421
|
-
entry.completion = record;
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
|
-
function Context(tryLocsList) {
|
|
1425
|
-
// The root entry object (effectively a try statement without a catch
|
|
1426
|
-
// or a finally block) gives us a place to store values thrown from
|
|
1427
|
-
// locations where there is no enclosing try statement.
|
|
1428
|
-
this.tryEntries = [{ tryLoc: "root" }];
|
|
1429
|
-
tryLocsList.forEach(pushTryEntry, this);
|
|
1430
|
-
this.reset(true);
|
|
1431
|
-
}
|
|
1432
|
-
|
|
1433
|
-
exports.keys = function(object) {
|
|
1434
|
-
var keys = [];
|
|
1435
|
-
for (var key in object) {
|
|
1436
|
-
keys.push(key);
|
|
1437
|
-
}
|
|
1438
|
-
keys.reverse();
|
|
1439
|
-
|
|
1440
|
-
// Rather than returning an object with a next method, we keep
|
|
1441
|
-
// things simple and return the next function itself.
|
|
1442
|
-
return function next() {
|
|
1443
|
-
while (keys.length) {
|
|
1444
|
-
var key = keys.pop();
|
|
1445
|
-
if (key in object) {
|
|
1446
|
-
next.value = key;
|
|
1447
|
-
next.done = false;
|
|
1448
|
-
return next;
|
|
1449
|
-
}
|
|
1450
|
-
}
|
|
1451
|
-
|
|
1452
|
-
// To avoid creating an additional object, we just hang the .value
|
|
1453
|
-
// and .done properties off the next function object itself. This
|
|
1454
|
-
// also ensures that the minifier will not anonymize the function.
|
|
1455
|
-
next.done = true;
|
|
1456
|
-
return next;
|
|
1457
|
-
};
|
|
1458
|
-
};
|
|
1459
|
-
|
|
1460
|
-
function values(iterable) {
|
|
1461
|
-
if (iterable) {
|
|
1462
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
1463
|
-
if (iteratorMethod) {
|
|
1464
|
-
return iteratorMethod.call(iterable);
|
|
1465
|
-
}
|
|
1466
|
-
|
|
1467
|
-
if (typeof iterable.next === "function") {
|
|
1468
|
-
return iterable;
|
|
1469
|
-
}
|
|
1470
|
-
|
|
1471
|
-
if (!isNaN(iterable.length)) {
|
|
1472
|
-
var i = -1, next = function next() {
|
|
1473
|
-
while (++i < iterable.length) {
|
|
1474
|
-
if (hasOwn.call(iterable, i)) {
|
|
1475
|
-
next.value = iterable[i];
|
|
1476
|
-
next.done = false;
|
|
1477
|
-
return next;
|
|
1478
|
-
}
|
|
1479
|
-
}
|
|
1480
|
-
|
|
1481
|
-
next.value = undefined$1;
|
|
1482
|
-
next.done = true;
|
|
1483
|
-
|
|
1484
|
-
return next;
|
|
1485
|
-
};
|
|
1486
|
-
|
|
1487
|
-
return next.next = next;
|
|
1488
|
-
}
|
|
1489
|
-
}
|
|
1490
|
-
|
|
1491
|
-
// Return an iterator with no values.
|
|
1492
|
-
return { next: doneResult };
|
|
1493
|
-
}
|
|
1494
|
-
exports.values = values;
|
|
1495
|
-
|
|
1496
|
-
function doneResult() {
|
|
1497
|
-
return { value: undefined$1, done: true };
|
|
1498
|
-
}
|
|
1499
|
-
|
|
1500
|
-
Context.prototype = {
|
|
1501
|
-
constructor: Context,
|
|
1502
|
-
|
|
1503
|
-
reset: function(skipTempReset) {
|
|
1504
|
-
this.prev = 0;
|
|
1505
|
-
this.next = 0;
|
|
1506
|
-
// Resetting context._sent for legacy support of Babel's
|
|
1507
|
-
// function.sent implementation.
|
|
1508
|
-
this.sent = this._sent = undefined$1;
|
|
1509
|
-
this.done = false;
|
|
1510
|
-
this.delegate = null;
|
|
1511
|
-
|
|
1512
|
-
this.method = "next";
|
|
1513
|
-
this.arg = undefined$1;
|
|
1514
|
-
|
|
1515
|
-
this.tryEntries.forEach(resetTryEntry);
|
|
1516
|
-
|
|
1517
|
-
if (!skipTempReset) {
|
|
1518
|
-
for (var name in this) {
|
|
1519
|
-
// Not sure about the optimal order of these conditions:
|
|
1520
|
-
if (name.charAt(0) === "t" &&
|
|
1521
|
-
hasOwn.call(this, name) &&
|
|
1522
|
-
!isNaN(+name.slice(1))) {
|
|
1523
|
-
this[name] = undefined$1;
|
|
1524
|
-
}
|
|
1525
|
-
}
|
|
1526
|
-
}
|
|
1527
|
-
},
|
|
1528
|
-
|
|
1529
|
-
stop: function() {
|
|
1530
|
-
this.done = true;
|
|
1531
|
-
|
|
1532
|
-
var rootEntry = this.tryEntries[0];
|
|
1533
|
-
var rootRecord = rootEntry.completion;
|
|
1534
|
-
if (rootRecord.type === "throw") {
|
|
1535
|
-
throw rootRecord.arg;
|
|
1536
|
-
}
|
|
1537
|
-
|
|
1538
|
-
return this.rval;
|
|
1539
|
-
},
|
|
1540
|
-
|
|
1541
|
-
dispatchException: function(exception) {
|
|
1542
|
-
if (this.done) {
|
|
1543
|
-
throw exception;
|
|
1544
|
-
}
|
|
1545
|
-
|
|
1546
|
-
var context = this;
|
|
1547
|
-
function handle(loc, caught) {
|
|
1548
|
-
record.type = "throw";
|
|
1549
|
-
record.arg = exception;
|
|
1550
|
-
context.next = loc;
|
|
1551
|
-
|
|
1552
|
-
if (caught) {
|
|
1553
|
-
// If the dispatched exception was caught by a catch block,
|
|
1554
|
-
// then let that catch block handle the exception normally.
|
|
1555
|
-
context.method = "next";
|
|
1556
|
-
context.arg = undefined$1;
|
|
1557
|
-
}
|
|
1558
|
-
|
|
1559
|
-
return !! caught;
|
|
1560
|
-
}
|
|
1561
|
-
|
|
1562
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1563
|
-
var entry = this.tryEntries[i];
|
|
1564
|
-
var record = entry.completion;
|
|
1565
|
-
|
|
1566
|
-
if (entry.tryLoc === "root") {
|
|
1567
|
-
// Exception thrown outside of any try block that could handle
|
|
1568
|
-
// it, so set the completion value of the entire function to
|
|
1569
|
-
// throw the exception.
|
|
1570
|
-
return handle("end");
|
|
1571
|
-
}
|
|
1572
|
-
|
|
1573
|
-
if (entry.tryLoc <= this.prev) {
|
|
1574
|
-
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
1575
|
-
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
1576
|
-
|
|
1577
|
-
if (hasCatch && hasFinally) {
|
|
1578
|
-
if (this.prev < entry.catchLoc) {
|
|
1579
|
-
return handle(entry.catchLoc, true);
|
|
1580
|
-
} else if (this.prev < entry.finallyLoc) {
|
|
1581
|
-
return handle(entry.finallyLoc);
|
|
1582
|
-
}
|
|
1583
|
-
|
|
1584
|
-
} else if (hasCatch) {
|
|
1585
|
-
if (this.prev < entry.catchLoc) {
|
|
1586
|
-
return handle(entry.catchLoc, true);
|
|
1587
|
-
}
|
|
1588
|
-
|
|
1589
|
-
} else if (hasFinally) {
|
|
1590
|
-
if (this.prev < entry.finallyLoc) {
|
|
1591
|
-
return handle(entry.finallyLoc);
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
|
-
} else {
|
|
1595
|
-
throw new Error("try statement without catch or finally");
|
|
1596
|
-
}
|
|
1597
|
-
}
|
|
1598
|
-
}
|
|
1599
|
-
},
|
|
1600
|
-
|
|
1601
|
-
abrupt: function(type, arg) {
|
|
1602
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1603
|
-
var entry = this.tryEntries[i];
|
|
1604
|
-
if (entry.tryLoc <= this.prev &&
|
|
1605
|
-
hasOwn.call(entry, "finallyLoc") &&
|
|
1606
|
-
this.prev < entry.finallyLoc) {
|
|
1607
|
-
var finallyEntry = entry;
|
|
1608
|
-
break;
|
|
1609
|
-
}
|
|
1610
|
-
}
|
|
1611
|
-
|
|
1612
|
-
if (finallyEntry &&
|
|
1613
|
-
(type === "break" ||
|
|
1614
|
-
type === "continue") &&
|
|
1615
|
-
finallyEntry.tryLoc <= arg &&
|
|
1616
|
-
arg <= finallyEntry.finallyLoc) {
|
|
1617
|
-
// Ignore the finally entry if control is not jumping to a
|
|
1618
|
-
// location outside the try/catch block.
|
|
1619
|
-
finallyEntry = null;
|
|
1620
|
-
}
|
|
1621
|
-
|
|
1622
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
1623
|
-
record.type = type;
|
|
1624
|
-
record.arg = arg;
|
|
1625
|
-
|
|
1626
|
-
if (finallyEntry) {
|
|
1627
|
-
this.method = "next";
|
|
1628
|
-
this.next = finallyEntry.finallyLoc;
|
|
1629
|
-
return ContinueSentinel;
|
|
1630
|
-
}
|
|
1631
|
-
|
|
1632
|
-
return this.complete(record);
|
|
1633
|
-
},
|
|
1634
|
-
|
|
1635
|
-
complete: function(record, afterLoc) {
|
|
1636
|
-
if (record.type === "throw") {
|
|
1637
|
-
throw record.arg;
|
|
1638
|
-
}
|
|
1639
|
-
|
|
1640
|
-
if (record.type === "break" ||
|
|
1641
|
-
record.type === "continue") {
|
|
1642
|
-
this.next = record.arg;
|
|
1643
|
-
} else if (record.type === "return") {
|
|
1644
|
-
this.rval = this.arg = record.arg;
|
|
1645
|
-
this.method = "return";
|
|
1646
|
-
this.next = "end";
|
|
1647
|
-
} else if (record.type === "normal" && afterLoc) {
|
|
1648
|
-
this.next = afterLoc;
|
|
1649
|
-
}
|
|
1650
|
-
|
|
1651
|
-
return ContinueSentinel;
|
|
1652
|
-
},
|
|
1653
|
-
|
|
1654
|
-
finish: function(finallyLoc) {
|
|
1655
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1656
|
-
var entry = this.tryEntries[i];
|
|
1657
|
-
if (entry.finallyLoc === finallyLoc) {
|
|
1658
|
-
this.complete(entry.completion, entry.afterLoc);
|
|
1659
|
-
resetTryEntry(entry);
|
|
1660
|
-
return ContinueSentinel;
|
|
1661
|
-
}
|
|
1662
|
-
}
|
|
1663
|
-
},
|
|
1664
|
-
|
|
1665
|
-
"catch": function(tryLoc) {
|
|
1666
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1667
|
-
var entry = this.tryEntries[i];
|
|
1668
|
-
if (entry.tryLoc === tryLoc) {
|
|
1669
|
-
var record = entry.completion;
|
|
1670
|
-
if (record.type === "throw") {
|
|
1671
|
-
var thrown = record.arg;
|
|
1672
|
-
resetTryEntry(entry);
|
|
1673
|
-
}
|
|
1674
|
-
return thrown;
|
|
1675
|
-
}
|
|
1676
|
-
}
|
|
1677
|
-
|
|
1678
|
-
// The context.catch method must only be called with a location
|
|
1679
|
-
// argument that corresponds to a known catch block.
|
|
1680
|
-
throw new Error("illegal catch attempt");
|
|
1681
|
-
},
|
|
1682
|
-
|
|
1683
|
-
delegateYield: function(iterable, resultName, nextLoc) {
|
|
1684
|
-
this.delegate = {
|
|
1685
|
-
iterator: values(iterable),
|
|
1686
|
-
resultName: resultName,
|
|
1687
|
-
nextLoc: nextLoc
|
|
1688
|
-
};
|
|
1689
|
-
|
|
1690
|
-
if (this.method === "next") {
|
|
1691
|
-
// Deliberately forget the last sent value so that we don't
|
|
1692
|
-
// accidentally pass it on to the delegate.
|
|
1693
|
-
this.arg = undefined$1;
|
|
1694
|
-
}
|
|
1695
|
-
|
|
1696
|
-
return ContinueSentinel;
|
|
937
|
+
}, React.createElement(ListItemIcon, null, React.createElement(EditIcon, null)), localization.edit)), renderRowActionMenuItems == null ? void 0 : renderRowActionMenuItems({
|
|
938
|
+
row: row,
|
|
939
|
+
tableInstance: tableInstance,
|
|
940
|
+
closeMenu: function closeMenu() {
|
|
941
|
+
return setAnchorEl(null);
|
|
1697
942
|
}
|
|
1698
|
-
};
|
|
1699
|
-
|
|
1700
|
-
// Regardless of whether this script is executing as a CommonJS module
|
|
1701
|
-
// or not, return the runtime object so that we can declare the variable
|
|
1702
|
-
// regeneratorRuntime in the outer scope, which allows this module to be
|
|
1703
|
-
// injected easily by `bin/regenerator --include-runtime script.js`.
|
|
1704
|
-
return exports;
|
|
1705
|
-
|
|
1706
|
-
}(
|
|
1707
|
-
// If this script is executing as a CommonJS module, use module.exports
|
|
1708
|
-
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
|
1709
|
-
// object. Either way, the resulting object will be used to initialize
|
|
1710
|
-
// the regeneratorRuntime variable at the top of this file.
|
|
1711
|
-
module.exports
|
|
1712
|
-
));
|
|
1713
|
-
|
|
1714
|
-
try {
|
|
1715
|
-
regeneratorRuntime = runtime;
|
|
1716
|
-
} catch (accidentalStrictMode) {
|
|
1717
|
-
// This module should not be running in strict mode, so the above
|
|
1718
|
-
// assignment should always work unless something is misconfigured. Just
|
|
1719
|
-
// in case runtime.js accidentally runs in strict mode, in modern engines
|
|
1720
|
-
// we can explicitly access globalThis. In older engines we can escape
|
|
1721
|
-
// strict mode using a global Function call. This could conceivably fail
|
|
1722
|
-
// if a Content Security Policy forbids using Function, but in that case
|
|
1723
|
-
// the proper solution is to fix the accidental strict mode problem. If
|
|
1724
|
-
// you've misconfigured your bundler to force strict mode and applied a
|
|
1725
|
-
// CSP to forbid Function, and you're not willing to fix either of those
|
|
1726
|
-
// problems, please detail your unique predicament in a GitHub issue.
|
|
1727
|
-
if (typeof globalThis === "object") {
|
|
1728
|
-
globalThis.regeneratorRuntime = runtime;
|
|
1729
|
-
} else {
|
|
1730
|
-
Function("r", "regeneratorRuntime = r")(runtime);
|
|
1731
|
-
}
|
|
1732
|
-
}
|
|
1733
|
-
});
|
|
943
|
+
}));
|
|
944
|
+
};
|
|
1734
945
|
|
|
1735
946
|
var MRT_EditActionButtons = function MRT_EditActionButtons(_ref) {
|
|
1736
947
|
var row = _ref.row,
|
|
@@ -1741,9 +952,12 @@ var MRT_EditActionButtons = function MRT_EditActionButtons(_ref) {
|
|
|
1741
952
|
CancelIcon = _tableInstance$option2.CancelIcon,
|
|
1742
953
|
SaveIcon = _tableInstance$option2.SaveIcon,
|
|
1743
954
|
localization = _tableInstance$option.localization,
|
|
1744
|
-
|
|
955
|
+
onEditSubmit = _tableInstance$option.onEditSubmit,
|
|
1745
956
|
setCurrentEditingRow = _tableInstance$option.setCurrentEditingRow;
|
|
1746
957
|
|
|
958
|
+
var _getState = getState(),
|
|
959
|
+
currentEditingRow = _getState.currentEditingRow;
|
|
960
|
+
|
|
1747
961
|
var handleCancel = function handleCancel() {
|
|
1748
962
|
var _row$original;
|
|
1749
963
|
|
|
@@ -1751,32 +965,13 @@ var MRT_EditActionButtons = function MRT_EditActionButtons(_ref) {
|
|
|
1751
965
|
setCurrentEditingRow(null);
|
|
1752
966
|
};
|
|
1753
967
|
|
|
1754
|
-
var handleSave =
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
case 0:
|
|
1762
|
-
_context.next = 2;
|
|
1763
|
-
return onRowEditSubmit == null ? void 0 : onRowEditSubmit((_getState$currentEdit = getState().currentEditingRow) != null ? _getState$currentEdit : row);
|
|
1764
|
-
|
|
1765
|
-
case 2:
|
|
1766
|
-
setCurrentEditingRow(null);
|
|
1767
|
-
|
|
1768
|
-
case 3:
|
|
1769
|
-
case "end":
|
|
1770
|
-
return _context.stop();
|
|
1771
|
-
}
|
|
1772
|
-
}
|
|
1773
|
-
}, _callee);
|
|
1774
|
-
}));
|
|
1775
|
-
|
|
1776
|
-
return function handleSave() {
|
|
1777
|
-
return _ref2.apply(this, arguments);
|
|
1778
|
-
};
|
|
1779
|
-
}();
|
|
968
|
+
var handleSave = function handleSave() {
|
|
969
|
+
onEditSubmit == null ? void 0 : onEditSubmit({
|
|
970
|
+
row: currentEditingRow != null ? currentEditingRow : row,
|
|
971
|
+
tableInstance: tableInstance
|
|
972
|
+
});
|
|
973
|
+
setCurrentEditingRow(null);
|
|
974
|
+
};
|
|
1780
975
|
|
|
1781
976
|
return React.createElement(Box, {
|
|
1782
977
|
sx: {
|
|
@@ -1814,7 +1009,7 @@ var MRT_ToggleRowActionMenuButton = function MRT_ToggleRowActionMenuButton(_ref)
|
|
|
1814
1009
|
tableInstance = _ref.tableInstance;
|
|
1815
1010
|
var getState = tableInstance.getState,
|
|
1816
1011
|
_tableInstance$option = tableInstance.options,
|
|
1817
|
-
|
|
1012
|
+
enableEditing = _tableInstance$option.enableEditing,
|
|
1818
1013
|
_tableInstance$option2 = _tableInstance$option.icons,
|
|
1819
1014
|
EditIcon = _tableInstance$option2.EditIcon,
|
|
1820
1015
|
MoreHorizIcon = _tableInstance$option2.MoreHorizIcon,
|
|
@@ -1836,21 +1031,24 @@ var MRT_ToggleRowActionMenuButton = function MRT_ToggleRowActionMenuButton(_ref)
|
|
|
1836
1031
|
setAnchorEl(event.currentTarget);
|
|
1837
1032
|
};
|
|
1838
1033
|
|
|
1839
|
-
var
|
|
1034
|
+
var handleStartEditMode = function handleStartEditMode() {
|
|
1840
1035
|
setCurrentEditingRow(_extends({}, row));
|
|
1841
1036
|
setAnchorEl(null);
|
|
1842
1037
|
};
|
|
1843
1038
|
|
|
1844
|
-
return React.createElement(React.Fragment, null, renderRowActions ? React.createElement(React.Fragment, null, renderRowActions(
|
|
1039
|
+
return React.createElement(React.Fragment, null, renderRowActions ? React.createElement(React.Fragment, null, renderRowActions({
|
|
1040
|
+
row: row,
|
|
1041
|
+
tableInstance: tableInstance
|
|
1042
|
+
})) : row.id === (currentEditingRow == null ? void 0 : currentEditingRow.id) ? React.createElement(MRT_EditActionButtons, {
|
|
1845
1043
|
row: row,
|
|
1846
1044
|
tableInstance: tableInstance
|
|
1847
|
-
}) : !renderRowActionMenuItems &&
|
|
1045
|
+
}) : !renderRowActionMenuItems && enableEditing ? React.createElement(Tooltip, {
|
|
1848
1046
|
placement: "right",
|
|
1849
1047
|
arrow: true,
|
|
1850
1048
|
title: localization.edit
|
|
1851
1049
|
}, React.createElement(IconButton, {
|
|
1852
1050
|
sx: commonIconButtonStyles,
|
|
1853
|
-
onClick:
|
|
1051
|
+
onClick: handleStartEditMode
|
|
1854
1052
|
}, React.createElement(EditIcon, null))) : renderRowActionMenuItems ? React.createElement(React.Fragment, null, React.createElement(Tooltip, {
|
|
1855
1053
|
arrow: true,
|
|
1856
1054
|
enterDelay: 1000,
|
|
@@ -1863,7 +1061,7 @@ var MRT_ToggleRowActionMenuButton = function MRT_ToggleRowActionMenuButton(_ref)
|
|
|
1863
1061
|
sx: commonIconButtonStyles
|
|
1864
1062
|
}, React.createElement(MoreHorizIcon, null))), React.createElement(MRT_RowActionMenu, {
|
|
1865
1063
|
anchorEl: anchorEl,
|
|
1866
|
-
handleEdit:
|
|
1064
|
+
handleEdit: handleStartEditMode,
|
|
1867
1065
|
row: row,
|
|
1868
1066
|
setAnchorEl: setAnchorEl,
|
|
1869
1067
|
tableInstance: tableInstance
|
|
@@ -1893,18 +1091,31 @@ var MRT_SelectCheckbox = function MRT_SelectCheckbox(_ref) {
|
|
|
1893
1091
|
var _getToggleAllRowsSele;
|
|
1894
1092
|
|
|
1895
1093
|
getToggleAllRowsSelectedProps == null ? void 0 : (_getToggleAllRowsSele = getToggleAllRowsSelectedProps()) == null ? void 0 : _getToggleAllRowsSele.onChange == null ? void 0 : _getToggleAllRowsSele.onChange(event);
|
|
1896
|
-
onSelectAllChange == null ? void 0 : onSelectAllChange(
|
|
1094
|
+
onSelectAllChange == null ? void 0 : onSelectAllChange({
|
|
1095
|
+
event: event,
|
|
1096
|
+
selectedRows: event.target.checked ? getRowModel().flatRows : [],
|
|
1097
|
+
tableInstance: tableInstance
|
|
1098
|
+
});
|
|
1897
1099
|
} else if (row) {
|
|
1898
1100
|
var _row$getToggleSelecte;
|
|
1899
1101
|
|
|
1900
1102
|
row == null ? void 0 : (_row$getToggleSelecte = row.getToggleSelectedProps()) == null ? void 0 : _row$getToggleSelecte.onChange == null ? void 0 : _row$getToggleSelecte.onChange(event);
|
|
1901
|
-
onSelectChange == null ? void 0 : onSelectChange(
|
|
1902
|
-
|
|
1903
|
-
|
|
1103
|
+
onSelectChange == null ? void 0 : onSelectChange({
|
|
1104
|
+
event: event,
|
|
1105
|
+
row: row,
|
|
1106
|
+
selectedRows: event.target.checked ? [].concat(getSelectedRowModel().flatRows, [row]) : getSelectedRowModel().flatRows.filter(function (selectedRow) {
|
|
1107
|
+
return selectedRow.id !== row.id;
|
|
1108
|
+
}),
|
|
1109
|
+
tableInstance: tableInstance
|
|
1110
|
+
});
|
|
1904
1111
|
}
|
|
1905
1112
|
};
|
|
1906
1113
|
|
|
1907
|
-
var mTableBodyRowSelectCheckboxProps = muiSelectCheckboxProps instanceof Function ? muiSelectCheckboxProps(
|
|
1114
|
+
var mTableBodyRowSelectCheckboxProps = muiSelectCheckboxProps instanceof Function ? muiSelectCheckboxProps({
|
|
1115
|
+
isSelectAll: !!selectAll,
|
|
1116
|
+
row: row,
|
|
1117
|
+
tableInstance: tableInstance
|
|
1118
|
+
}) : muiSelectCheckboxProps;
|
|
1908
1119
|
var rtSelectCheckboxProps = selectAll ? getToggleAllRowsSelectedProps() : row == null ? void 0 : row.getToggleSelectedProps();
|
|
1909
1120
|
|
|
1910
1121
|
var checkboxProps = _extends({}, rtSelectCheckboxProps, mTableBodyRowSelectCheckboxProps);
|
|
@@ -1959,7 +1170,10 @@ var MRT_SearchTextField = function MRT_SearchTextField(_ref) {
|
|
|
1959
1170
|
var _event$target$value;
|
|
1960
1171
|
|
|
1961
1172
|
setGlobalFilter((_event$target$value = event.target.value) != null ? _event$target$value : undefined);
|
|
1962
|
-
onGlobalFilterChange == null ? void 0 : onGlobalFilterChange(
|
|
1173
|
+
onGlobalFilterChange == null ? void 0 : onGlobalFilterChange({
|
|
1174
|
+
event: event,
|
|
1175
|
+
tableInstance: tableInstance
|
|
1176
|
+
});
|
|
1963
1177
|
}, 200), []);
|
|
1964
1178
|
|
|
1965
1179
|
var handleGlobalFilterMenuOpen = function handleGlobalFilterMenuOpen(event) {
|
|
@@ -1971,6 +1185,9 @@ var MRT_SearchTextField = function MRT_SearchTextField(_ref) {
|
|
|
1971
1185
|
setGlobalFilter(undefined);
|
|
1972
1186
|
};
|
|
1973
1187
|
|
|
1188
|
+
var textFieldProps = muiSearchTextFieldProps instanceof Function ? muiSearchTextFieldProps({
|
|
1189
|
+
tableInstance: tableInstance
|
|
1190
|
+
}) : muiSearchTextFieldProps;
|
|
1974
1191
|
return React.createElement(Collapse, {
|
|
1975
1192
|
"in": showSearch,
|
|
1976
1193
|
orientation: "horizontal"
|
|
@@ -2012,10 +1229,10 @@ var MRT_SearchTextField = function MRT_SearchTextField(_ref) {
|
|
|
2012
1229
|
fontSize: "small"
|
|
2013
1230
|
})))
|
|
2014
1231
|
}
|
|
2015
|
-
},
|
|
1232
|
+
}, textFieldProps, {
|
|
2016
1233
|
sx: _extends({
|
|
2017
1234
|
justifySelf: 'end'
|
|
2018
|
-
},
|
|
1235
|
+
}, textFieldProps == null ? void 0 : textFieldProps.sx)
|
|
2019
1236
|
})), React.createElement(MRT_FilterTypeMenu, {
|
|
2020
1237
|
anchorEl: anchorEl,
|
|
2021
1238
|
setAnchorEl: setAnchorEl,
|
|
@@ -2156,12 +1373,16 @@ var MRT_ToggleSearchButton = function MRT_ToggleSearchButton(_ref) {
|
|
|
2156
1373
|
var _getState = getState(),
|
|
2157
1374
|
showSearch = _getState.showSearch;
|
|
2158
1375
|
|
|
1376
|
+
var textFieldProps = muiSearchTextFieldProps instanceof Function ? muiSearchTextFieldProps({
|
|
1377
|
+
tableInstance: tableInstance
|
|
1378
|
+
}) : muiSearchTextFieldProps;
|
|
1379
|
+
|
|
2159
1380
|
var handleToggleSearch = function handleToggleSearch() {
|
|
2160
1381
|
setShowSearch(!showSearch);
|
|
2161
1382
|
setTimeout(function () {
|
|
2162
|
-
var _document$getElementB,
|
|
1383
|
+
var _document$getElementB, _textFieldProps$id;
|
|
2163
1384
|
|
|
2164
|
-
return (_document$getElementB = document.getElementById((
|
|
1385
|
+
return (_document$getElementB = document.getElementById((_textFieldProps$id = textFieldProps == null ? void 0 : textFieldProps.id) != null ? _textFieldProps$id : "mrt-" + idPrefix + "-search-text-field")) == null ? void 0 : _document$getElementB.focus();
|
|
2165
1386
|
}, 200);
|
|
2166
1387
|
};
|
|
2167
1388
|
|
|
@@ -2185,12 +1406,13 @@ var MRT_ToolbarInternalButtons = function MRT_ToolbarInternalButtons(_ref) {
|
|
|
2185
1406
|
renderToolbarInternalActions = _tableInstance$option.renderToolbarInternalActions;
|
|
2186
1407
|
|
|
2187
1408
|
if (renderToolbarInternalActions) {
|
|
2188
|
-
return React.createElement(React.Fragment, null, renderToolbarInternalActions(
|
|
2189
|
-
|
|
2190
|
-
MRT_ToggleFiltersButton: MRT_ToggleFiltersButton,
|
|
1409
|
+
return React.createElement(React.Fragment, null, renderToolbarInternalActions({
|
|
1410
|
+
MRT_FullScreenToggleButton: MRT_FullScreenToggleButton,
|
|
2191
1411
|
MRT_ShowHideColumnsButton: MRT_ShowHideColumnsButton,
|
|
2192
1412
|
MRT_ToggleDensePaddingButton: MRT_ToggleDensePaddingButton,
|
|
2193
|
-
|
|
1413
|
+
MRT_ToggleFiltersButton: MRT_ToggleFiltersButton,
|
|
1414
|
+
MRT_ToggleSearchButton: MRT_ToggleSearchButton,
|
|
1415
|
+
tableInstance: tableInstance
|
|
2194
1416
|
}));
|
|
2195
1417
|
}
|
|
2196
1418
|
|
|
@@ -2229,7 +1451,9 @@ var MRT_TablePagination = function MRT_TablePagination(_ref) {
|
|
|
2229
1451
|
_getState$pagination$2 = _getState$pagination.pageIndex,
|
|
2230
1452
|
pageIndex = _getState$pagination$2 === void 0 ? 0 : _getState$pagination$2;
|
|
2231
1453
|
|
|
2232
|
-
var tablePaginationProps = muiTablePaginationProps instanceof Function ? muiTablePaginationProps(
|
|
1454
|
+
var tablePaginationProps = muiTablePaginationProps instanceof Function ? muiTablePaginationProps({
|
|
1455
|
+
tableInstance: tableInstance
|
|
1456
|
+
}) : muiTablePaginationProps;
|
|
2233
1457
|
|
|
2234
1458
|
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
2235
1459
|
setPageSize(+event.target.value);
|
|
@@ -2237,6 +1461,16 @@ var MRT_TablePagination = function MRT_TablePagination(_ref) {
|
|
|
2237
1461
|
|
|
2238
1462
|
var showFirstLastPageButtons = getPrePaginationRowModel().rows.length / pageSize > 2;
|
|
2239
1463
|
return React.createElement(TablePagination, Object.assign({
|
|
1464
|
+
SelectProps: {
|
|
1465
|
+
sx: {
|
|
1466
|
+
m: '0 1rem 0 1ch'
|
|
1467
|
+
},
|
|
1468
|
+
MenuProps: {
|
|
1469
|
+
MenuListProps: {
|
|
1470
|
+
disablePadding: true
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
},
|
|
2240
1474
|
component: "div",
|
|
2241
1475
|
count: getPrePaginationRowModel().rows.length,
|
|
2242
1476
|
onPageChange: function onPageChange(_, newPage) {
|
|
@@ -2245,11 +1479,7 @@ var MRT_TablePagination = function MRT_TablePagination(_ref) {
|
|
|
2245
1479
|
onRowsPerPageChange: handleChangeRowsPerPage,
|
|
2246
1480
|
page: pageIndex,
|
|
2247
1481
|
rowsPerPage: pageSize,
|
|
2248
|
-
|
|
2249
|
-
sx: {
|
|
2250
|
-
m: '0 1rem 0 1ch'
|
|
2251
|
-
}
|
|
2252
|
-
},
|
|
1482
|
+
rowsPerPageOptions: [5, 10, 15, 20, 25, 30, 50, 100],
|
|
2253
1483
|
showFirstButton: showFirstLastPageButtons,
|
|
2254
1484
|
showLastButton: showFirstLastPageButtons
|
|
2255
1485
|
}, tablePaginationProps, {
|
|
@@ -2280,7 +1510,9 @@ var MRT_ToolbarAlertBanner = function MRT_ToolbarAlertBanner(_ref) {
|
|
|
2280
1510
|
grouping = _getState.grouping;
|
|
2281
1511
|
|
|
2282
1512
|
var isMobile = useMediaQuery('(max-width:720px)');
|
|
2283
|
-
var alertProps = muiTableToolbarAlertBannerProps instanceof Function ? muiTableToolbarAlertBannerProps(
|
|
1513
|
+
var alertProps = muiTableToolbarAlertBannerProps instanceof Function ? muiTableToolbarAlertBannerProps({
|
|
1514
|
+
tableInstance: tableInstance
|
|
1515
|
+
}) : muiTableToolbarAlertBannerProps;
|
|
2284
1516
|
var selectMessage = getSelectedRowModel().rows.length > 0 ? (_localization$selecte = localization.selectedCountOfRowCountRowsSelected) == null ? void 0 : (_localization$selecte2 = _localization$selecte.replace('{selectedCount}', getSelectedRowModel().rows.length.toString())) == null ? void 0 : _localization$selecte2.replace('{rowCount}', getPrePaginationRowModel().rows.length.toString()) : null;
|
|
2285
1517
|
var groupedByMessage = grouping.length > 0 ? React.createElement("span", null, localization.groupedBy, ' ', grouping.map(function (columnId, index) {
|
|
2286
1518
|
var _tableInstance$getAll;
|
|
@@ -2320,7 +1552,7 @@ var MRT_ToolbarAlertBanner = function MRT_ToolbarAlertBanner(_ref) {
|
|
|
2320
1552
|
sx: {
|
|
2321
1553
|
p: '0.5rem 1rem'
|
|
2322
1554
|
}
|
|
2323
|
-
}, selectMessage, groupedByMessage)));
|
|
1555
|
+
}, selectMessage, React.createElement("br", null), groupedByMessage)));
|
|
2324
1556
|
};
|
|
2325
1557
|
|
|
2326
1558
|
var MRT_LinearProgressBar = function MRT_LinearProgressBar(_ref) {
|
|
@@ -2329,7 +1561,9 @@ var MRT_LinearProgressBar = function MRT_LinearProgressBar(_ref) {
|
|
|
2329
1561
|
muiLinearProgressProps = _tableInstance$option.muiLinearProgressProps,
|
|
2330
1562
|
isReloading = _tableInstance$option.isReloading,
|
|
2331
1563
|
isLoading = _tableInstance$option.isLoading;
|
|
2332
|
-
var linearProgressProps = muiLinearProgressProps instanceof Function ? muiLinearProgressProps(
|
|
1564
|
+
var linearProgressProps = muiLinearProgressProps instanceof Function ? muiLinearProgressProps({
|
|
1565
|
+
tableInstance: tableInstance
|
|
1566
|
+
}) : muiLinearProgressProps;
|
|
2333
1567
|
return React.createElement(Collapse, {
|
|
2334
1568
|
"in": isReloading || isLoading,
|
|
2335
1569
|
unmountOnExit: true
|
|
@@ -2369,7 +1603,9 @@ var MRT_ToolbarTop = function MRT_ToolbarTop(_ref2) {
|
|
|
2369
1603
|
var _getState = getState(),
|
|
2370
1604
|
isFullScreen = _getState.isFullScreen;
|
|
2371
1605
|
|
|
2372
|
-
var toolbarProps = muiTableToolbarTopProps instanceof Function ? muiTableToolbarTopProps(
|
|
1606
|
+
var toolbarProps = muiTableToolbarTopProps instanceof Function ? muiTableToolbarTopProps({
|
|
1607
|
+
tableInstance: tableInstance
|
|
1608
|
+
}) : muiTableToolbarTopProps;
|
|
2373
1609
|
return React.createElement(Toolbar, Object.assign({
|
|
2374
1610
|
id: "mrt-" + idPrefix + "-toolbar-top",
|
|
2375
1611
|
variant: "dense"
|
|
@@ -2390,7 +1626,9 @@ var MRT_ToolbarTop = function MRT_ToolbarTop(_ref2) {
|
|
|
2390
1626
|
display: 'flex',
|
|
2391
1627
|
justifyContent: 'space-between'
|
|
2392
1628
|
}
|
|
2393
|
-
}, (_renderToolbarCustomA = renderToolbarCustomActions == null ? void 0 : renderToolbarCustomActions(
|
|
1629
|
+
}, (_renderToolbarCustomA = renderToolbarCustomActions == null ? void 0 : renderToolbarCustomActions({
|
|
1630
|
+
tableInstance: tableInstance
|
|
1631
|
+
})) != null ? _renderToolbarCustomA : React.createElement("span", null), React.createElement(Box, {
|
|
2394
1632
|
sx: {
|
|
2395
1633
|
display: 'flex',
|
|
2396
1634
|
gap: '0.5rem',
|
|
@@ -2423,7 +1661,9 @@ var MRT_ToolbarBottom = function MRT_ToolbarBottom(_ref) {
|
|
|
2423
1661
|
var _getState = getState(),
|
|
2424
1662
|
isFullScreen = _getState.isFullScreen;
|
|
2425
1663
|
|
|
2426
|
-
var toolbarProps = muiTableToolbarBottomProps instanceof Function ? muiTableToolbarBottomProps(
|
|
1664
|
+
var toolbarProps = muiTableToolbarBottomProps instanceof Function ? muiTableToolbarBottomProps({
|
|
1665
|
+
tableInstance: tableInstance
|
|
1666
|
+
}) : muiTableToolbarBottomProps;
|
|
2427
1667
|
return React.createElement(Toolbar, Object.assign({
|
|
2428
1668
|
id: "mrt-" + idPrefix + "-toolbar-bottom",
|
|
2429
1669
|
variant: "dense"
|
|
@@ -2477,8 +1717,14 @@ var MRT_FilterTextField = function MRT_FilterTextField(_ref) {
|
|
|
2477
1717
|
anchorEl = _useState[0],
|
|
2478
1718
|
setAnchorEl = _useState[1];
|
|
2479
1719
|
|
|
2480
|
-
var mTableHeadCellFilterTextFieldProps = muiTableHeadCellFilterTextFieldProps instanceof Function ? muiTableHeadCellFilterTextFieldProps(
|
|
2481
|
-
|
|
1720
|
+
var mTableHeadCellFilterTextFieldProps = muiTableHeadCellFilterTextFieldProps instanceof Function ? muiTableHeadCellFilterTextFieldProps({
|
|
1721
|
+
column: column,
|
|
1722
|
+
tableInstance: tableInstance
|
|
1723
|
+
}) : muiTableHeadCellFilterTextFieldProps;
|
|
1724
|
+
var mcTableHeadCellFilterTextFieldProps = column.muiTableHeadCellFilterTextFieldProps instanceof Function ? column.muiTableHeadCellFilterTextFieldProps({
|
|
1725
|
+
column: column,
|
|
1726
|
+
tableInstance: tableInstance
|
|
1727
|
+
}) : column.muiTableHeadCellFilterTextFieldProps;
|
|
2482
1728
|
|
|
2483
1729
|
var textFieldProps = _extends({}, mTableHeadCellFilterTextFieldProps, mcTableHeadCellFilterTextFieldProps);
|
|
2484
1730
|
|
|
@@ -2655,8 +1901,14 @@ var MRT_ToggleColumnActionMenuButton = function MRT_ToggleColumnActionMenuButton
|
|
|
2655
1901
|
setAnchorEl(event.currentTarget);
|
|
2656
1902
|
};
|
|
2657
1903
|
|
|
2658
|
-
var mTableHeadCellColumnActionsButtonProps = muiTableHeadCellColumnActionsButtonProps instanceof Function ? muiTableHeadCellColumnActionsButtonProps(
|
|
2659
|
-
|
|
1904
|
+
var mTableHeadCellColumnActionsButtonProps = muiTableHeadCellColumnActionsButtonProps instanceof Function ? muiTableHeadCellColumnActionsButtonProps({
|
|
1905
|
+
column: column,
|
|
1906
|
+
tableInstance: tableInstance
|
|
1907
|
+
}) : muiTableHeadCellColumnActionsButtonProps;
|
|
1908
|
+
var mcTableHeadCellColumnActionsButtonProps = column.muiTableHeadCellColumnActionsButtonProps instanceof Function ? column.muiTableHeadCellColumnActionsButtonProps({
|
|
1909
|
+
column: column,
|
|
1910
|
+
tableInstance: tableInstance
|
|
1911
|
+
}) : column.muiTableHeadCellColumnActionsButtonProps;
|
|
2660
1912
|
|
|
2661
1913
|
var iconButtonProps = _extends({}, mTableHeadCellColumnActionsButtonProps, mcTableHeadCellColumnActionsButtonProps);
|
|
2662
1914
|
|
|
@@ -2691,7 +1943,7 @@ var MRT_ToggleColumnActionMenuButton = function MRT_ToggleColumnActionMenuButton
|
|
|
2691
1943
|
};
|
|
2692
1944
|
|
|
2693
1945
|
var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
|
|
2694
|
-
var _column$Header;
|
|
1946
|
+
var _getState2, _getState2$currentFil, _column$Header;
|
|
2695
1947
|
|
|
2696
1948
|
var header = _ref.header,
|
|
2697
1949
|
tableInstance = _ref.tableInstance;
|
|
@@ -2712,34 +1964,21 @@ var MRT_TableHeadCell = function MRT_TableHeadCell(_ref) {
|
|
|
2712
1964
|
showFilters = _getState.showFilters;
|
|
2713
1965
|
|
|
2714
1966
|
var column = header.column;
|
|
2715
|
-
var mTableHeadCellProps = muiTableHeadCellProps instanceof Function ? muiTableHeadCellProps(
|
|
2716
|
-
|
|
1967
|
+
var mTableHeadCellProps = muiTableHeadCellProps instanceof Function ? muiTableHeadCellProps({
|
|
1968
|
+
column: column,
|
|
1969
|
+
tableInstance: tableInstance
|
|
1970
|
+
}) : muiTableHeadCellProps;
|
|
1971
|
+
var mcTableHeadCellProps = column.muiTableHeadCellProps instanceof Function ? column.muiTableHeadCellProps({
|
|
1972
|
+
column: column,
|
|
1973
|
+
tableInstance: tableInstance
|
|
1974
|
+
}) : column.muiTableHeadCellProps;
|
|
2717
1975
|
|
|
2718
1976
|
var tableCellProps = _extends({}, header.getHeaderProps(), mTableHeadCellProps, mcTableHeadCellProps);
|
|
2719
1977
|
|
|
2720
|
-
var sortTooltip = !!column.getIsSorted() ? column.getIsSorted() === 'desc' ? localization.clearSort : localization.sortByColumnDesc.replace('{column}', column.header) : localization.sortByColumnAsc.replace('{column}', column.header);
|
|
2721
|
-
|
|
2722
|
-
var filterTooltip = ''
|
|
2723
|
-
|
|
2724
|
-
// .replace('{column}', String(headerString))
|
|
2725
|
-
// .replace(
|
|
2726
|
-
// '{filterType}',
|
|
2727
|
-
// filterType instanceof Function
|
|
2728
|
-
// ? ''
|
|
2729
|
-
// : // @ts-ignore
|
|
2730
|
-
// localization[
|
|
2731
|
-
// `filter${
|
|
2732
|
-
// filterType.charAt(0).toUpperCase() + filterType.slice(1)
|
|
2733
|
-
// }`
|
|
2734
|
-
// ],
|
|
2735
|
-
// )
|
|
2736
|
-
// .replace(
|
|
2737
|
-
// '{filterValue}',
|
|
2738
|
-
// getColumnFilterValue() as string,
|
|
2739
|
-
// )
|
|
2740
|
-
// .replace('" "', '')
|
|
2741
|
-
// : localization.showHideFilters;
|
|
2742
|
-
|
|
1978
|
+
var sortTooltip = !!column.getIsSorted() ? column.getIsSorted() === 'desc' ? localization.clearSort : localization.sortByColumnDesc.replace('{column}', column.header) : localization.sortByColumnAsc.replace('{column}', column.header);
|
|
1979
|
+
var filterType = (_getState2 = getState()) == null ? void 0 : (_getState2$currentFil = _getState2.currentFilterTypes) == null ? void 0 : _getState2$currentFil[header.id];
|
|
1980
|
+
var filterTooltip = !!column.getColumnFilterValue() ? localization.filteringByColumn.replace('{column}', String(column.header)).replace('{filterType}', filterType instanceof Function ? '' : // @ts-ignore
|
|
1981
|
+
localization["filter" + (filterType.charAt(0).toUpperCase() + filterType.slice(1))]).replace('{filterValue}', column.getColumnFilterValue()).replace('" "', '') : localization.showHideFilters;
|
|
2743
1982
|
var headerElement = (_column$Header = column == null ? void 0 : column.Header == null ? void 0 : column.Header({
|
|
2744
1983
|
header: header,
|
|
2745
1984
|
tableInstance: tableInstance
|
|
@@ -2860,7 +2099,10 @@ var MRT_TableHeadRow = function MRT_TableHeadRow(_ref) {
|
|
|
2860
2099
|
var headerGroup = _ref.headerGroup,
|
|
2861
2100
|
tableInstance = _ref.tableInstance;
|
|
2862
2101
|
var muiTableHeadRowProps = tableInstance.options.muiTableHeadRowProps;
|
|
2863
|
-
var mTableHeadRowProps = muiTableHeadRowProps instanceof Function ? muiTableHeadRowProps(
|
|
2102
|
+
var mTableHeadRowProps = muiTableHeadRowProps instanceof Function ? muiTableHeadRowProps({
|
|
2103
|
+
headerGroup: headerGroup,
|
|
2104
|
+
tableInstance: tableInstance
|
|
2105
|
+
}) : muiTableHeadRowProps;
|
|
2864
2106
|
|
|
2865
2107
|
var tableRowProps = _extends({}, headerGroup == null ? void 0 : headerGroup.getHeaderGroupProps(), mTableHeadRowProps);
|
|
2866
2108
|
|
|
@@ -2881,7 +2123,9 @@ var MRT_TableHead = function MRT_TableHead(_ref) {
|
|
|
2881
2123
|
getLeftHeaderGroups = tableInstance.getLeftHeaderGroups,
|
|
2882
2124
|
getRightHeaderGroups = tableInstance.getRightHeaderGroups,
|
|
2883
2125
|
muiTableHeadProps = tableInstance.options.muiTableHeadProps;
|
|
2884
|
-
var tableHeadProps = muiTableHeadProps instanceof Function ? muiTableHeadProps(
|
|
2126
|
+
var tableHeadProps = muiTableHeadProps instanceof Function ? muiTableHeadProps({
|
|
2127
|
+
tableInstance: tableInstance
|
|
2128
|
+
}) : muiTableHeadProps;
|
|
2885
2129
|
var getHeaderGroupsMap = {
|
|
2886
2130
|
center: getCenterHeaderGroups,
|
|
2887
2131
|
left: getLeftHeaderGroups,
|
|
@@ -2901,36 +2145,67 @@ var MRT_EditCellTextField = function MRT_EditCellTextField(_ref) {
|
|
|
2901
2145
|
var cell = _ref.cell,
|
|
2902
2146
|
tableInstance = _ref.tableInstance;
|
|
2903
2147
|
var getState = tableInstance.getState,
|
|
2904
|
-
|
|
2148
|
+
_tableInstance$option = tableInstance.options,
|
|
2149
|
+
enableEditing = _tableInstance$option.enableEditing,
|
|
2150
|
+
muiTableBodyCellEditTextFieldProps = _tableInstance$option.muiTableBodyCellEditTextFieldProps,
|
|
2151
|
+
setCurrentEditingRow = _tableInstance$option.setCurrentEditingRow;
|
|
2152
|
+
|
|
2153
|
+
var _useState = useState(cell.value),
|
|
2154
|
+
value = _useState[0],
|
|
2155
|
+
setValue = _useState[1];
|
|
2156
|
+
|
|
2905
2157
|
var column = cell.column,
|
|
2906
2158
|
row = cell.row;
|
|
2907
2159
|
|
|
2908
2160
|
var handleChange = function handleChange(event) {
|
|
2161
|
+
setValue(event.target.value);
|
|
2162
|
+
column.onCellEditChange == null ? void 0 : column.onCellEditChange({
|
|
2163
|
+
event: event,
|
|
2164
|
+
cell: cell,
|
|
2165
|
+
tableInstance: tableInstance
|
|
2166
|
+
});
|
|
2167
|
+
};
|
|
2168
|
+
|
|
2169
|
+
var handleBlur = function handleBlur(event) {
|
|
2909
2170
|
if (getState().currentEditingRow) {
|
|
2910
|
-
row.values[column.id] =
|
|
2911
|
-
|
|
2912
|
-
// });
|
|
2171
|
+
row.values[column.id] = value;
|
|
2172
|
+
setCurrentEditingRow(_extends({}, getState().currentEditingRow));
|
|
2913
2173
|
}
|
|
2914
2174
|
|
|
2915
|
-
column.
|
|
2175
|
+
column.onCellEditBlur == null ? void 0 : column.onCellEditBlur({
|
|
2176
|
+
event: event,
|
|
2177
|
+
cell: cell,
|
|
2178
|
+
tableInstance: tableInstance
|
|
2179
|
+
});
|
|
2916
2180
|
};
|
|
2917
2181
|
|
|
2918
|
-
var mTableBodyCellEditTextFieldProps = muiTableBodyCellEditTextFieldProps instanceof Function ? muiTableBodyCellEditTextFieldProps(
|
|
2919
|
-
|
|
2182
|
+
var mTableBodyCellEditTextFieldProps = muiTableBodyCellEditTextFieldProps instanceof Function ? muiTableBodyCellEditTextFieldProps({
|
|
2183
|
+
cell: cell,
|
|
2184
|
+
tableInstance: tableInstance
|
|
2185
|
+
}) : muiTableBodyCellEditTextFieldProps;
|
|
2186
|
+
var mcTableBodyCellEditTextFieldProps = column.muiTableBodyCellEditTextFieldProps instanceof Function ? column.muiTableBodyCellEditTextFieldProps({
|
|
2187
|
+
cell: cell,
|
|
2188
|
+
tableInstance: tableInstance
|
|
2189
|
+
}) : column.muiTableBodyCellEditTextFieldProps;
|
|
2920
2190
|
|
|
2921
|
-
var textFieldProps = _extends({}, mTableBodyCellEditTextFieldProps, mcTableBodyCellEditTextFieldProps);
|
|
2922
|
-
// return <>{Edit({ ...textFieldProps, cell })}</>;
|
|
2923
|
-
// }
|
|
2191
|
+
var textFieldProps = _extends({}, mTableBodyCellEditTextFieldProps, mcTableBodyCellEditTextFieldProps);
|
|
2924
2192
|
|
|
2193
|
+
if (enableEditing && column.enableEditing !== false && column.Edit) {
|
|
2194
|
+
return React.createElement(React.Fragment, null, column.Edit == null ? void 0 : column.Edit({
|
|
2195
|
+
cell: cell,
|
|
2196
|
+
tableInstance: tableInstance
|
|
2197
|
+
}));
|
|
2198
|
+
}
|
|
2925
2199
|
|
|
2926
2200
|
return React.createElement(TextField, Object.assign({
|
|
2927
2201
|
margin: "dense",
|
|
2202
|
+
onBlur: handleBlur,
|
|
2928
2203
|
onChange: handleChange,
|
|
2929
2204
|
onClick: function onClick(e) {
|
|
2930
2205
|
return e.stopPropagation();
|
|
2931
2206
|
},
|
|
2932
2207
|
placeholder: column.header,
|
|
2933
|
-
value:
|
|
2208
|
+
value: value,
|
|
2934
2209
|
variant: "standard"
|
|
2935
2210
|
}, textFieldProps));
|
|
2936
2211
|
};
|
|
@@ -2955,8 +2230,14 @@ var MRT_CopyButton = function MRT_CopyButton(_ref) {
|
|
|
2955
2230
|
}, 4000);
|
|
2956
2231
|
};
|
|
2957
2232
|
|
|
2958
|
-
var mTableBodyCellCopyButtonProps = muiTableBodyCellCopyButtonProps instanceof Function ? muiTableBodyCellCopyButtonProps(
|
|
2959
|
-
|
|
2233
|
+
var mTableBodyCellCopyButtonProps = muiTableBodyCellCopyButtonProps instanceof Function ? muiTableBodyCellCopyButtonProps({
|
|
2234
|
+
cell: cell,
|
|
2235
|
+
tableInstance: tableInstance
|
|
2236
|
+
}) : muiTableBodyCellCopyButtonProps;
|
|
2237
|
+
var mcTableBodyCellCopyButtonProps = cell.column.muiTableBodyCellCopyButtonProps instanceof Function ? cell.column.muiTableBodyCellCopyButtonProps({
|
|
2238
|
+
cell: cell,
|
|
2239
|
+
tableInstance: tableInstance
|
|
2240
|
+
}) : cell.column.muiTableBodyCellCopyButtonProps;
|
|
2960
2241
|
|
|
2961
2242
|
var buttonProps = _extends({}, mTableBodyCellCopyButtonProps, mcTableBodyCellCopyButtonProps);
|
|
2962
2243
|
|
|
@@ -2990,7 +2271,7 @@ var MRT_CopyButton = function MRT_CopyButton(_ref) {
|
|
|
2990
2271
|
};
|
|
2991
2272
|
|
|
2992
2273
|
var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
|
|
2993
|
-
var _row$subRows, _row$subRows2;
|
|
2274
|
+
var _cell$column$Cell, _cell$column, _row$subRows, _cell$column$Cell2, _cell$column2, _row$subRows2;
|
|
2994
2275
|
|
|
2995
2276
|
var cell = _ref.cell,
|
|
2996
2277
|
tableInstance = _ref.tableInstance;
|
|
@@ -2999,6 +2280,7 @@ var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
|
|
|
2999
2280
|
_tableInstance$option = tableInstance.options,
|
|
3000
2281
|
enableClickToCopy = _tableInstance$option.enableClickToCopy,
|
|
3001
2282
|
enableColumnPinning = _tableInstance$option.enableColumnPinning,
|
|
2283
|
+
enableEditing = _tableInstance$option.enableEditing,
|
|
3002
2284
|
isLoading = _tableInstance$option.isLoading,
|
|
3003
2285
|
muiTableBodyCellProps = _tableInstance$option.muiTableBodyCellProps,
|
|
3004
2286
|
muiTableBodyCellSkeletonProps = _tableInstance$option.muiTableBodyCellSkeletonProps,
|
|
@@ -3010,8 +2292,14 @@ var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
|
|
|
3010
2292
|
|
|
3011
2293
|
var column = cell.column,
|
|
3012
2294
|
row = cell.row;
|
|
3013
|
-
var mTableCellBodyProps = muiTableBodyCellProps instanceof Function ? muiTableBodyCellProps(
|
|
3014
|
-
|
|
2295
|
+
var mTableCellBodyProps = muiTableBodyCellProps instanceof Function ? muiTableBodyCellProps({
|
|
2296
|
+
cell: cell,
|
|
2297
|
+
tableInstance: tableInstance
|
|
2298
|
+
}) : muiTableBodyCellProps;
|
|
2299
|
+
var mcTableCellBodyProps = column.muiTableBodyCellProps instanceof Function ? column.muiTableBodyCellProps({
|
|
2300
|
+
cell: cell,
|
|
2301
|
+
tableInstance: tableInstance
|
|
2302
|
+
}) : column.muiTableBodyCellProps;
|
|
3015
2303
|
|
|
3016
2304
|
var tableCellProps = _extends({}, cell.getCellProps(), mTableCellBodyProps, mcTableCellBodyProps);
|
|
3017
2305
|
|
|
@@ -3020,7 +2308,11 @@ var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
|
|
|
3020
2308
|
}, [column.columnDefType, column.getWidth()]);
|
|
3021
2309
|
return React.createElement(TableCell, Object.assign({
|
|
3022
2310
|
onClick: function onClick(event) {
|
|
3023
|
-
return onCellClick == null ? void 0 : onCellClick(
|
|
2311
|
+
return onCellClick == null ? void 0 : onCellClick({
|
|
2312
|
+
event: event,
|
|
2313
|
+
cell: cell,
|
|
2314
|
+
tableInstance: tableInstance
|
|
2315
|
+
});
|
|
3024
2316
|
}
|
|
3025
2317
|
}, tableCellProps, {
|
|
3026
2318
|
sx: _extends({
|
|
@@ -3036,13 +2328,19 @@ var MRT_TableBodyCell = function MRT_TableBodyCell(_ref) {
|
|
|
3036
2328
|
}, muiTableBodyCellSkeletonProps)) : column.columnDefType === 'display' ? column.Cell == null ? void 0 : column.Cell({
|
|
3037
2329
|
cell: cell,
|
|
3038
2330
|
tableInstance: tableInstance
|
|
3039
|
-
}) : cell.getIsPlaceholder() || row.getIsGrouped() && column.id !== row.groupingColumnId ? null : cell.getIsAggregated() ? cell.renderAggregatedCell() : column.enableEditing && (currentEditingRow == null ? void 0 : currentEditingRow.id) === row.id ? React.createElement(MRT_EditCellTextField, {
|
|
2331
|
+
}) : cell.getIsPlaceholder() || row.getIsGrouped() && column.id !== row.groupingColumnId ? null : cell.getIsAggregated() ? cell.renderAggregatedCell() : enableEditing && column.enableEditing !== false && (currentEditingRow == null ? void 0 : currentEditingRow.id) === row.id ? React.createElement(MRT_EditCellTextField, {
|
|
3040
2332
|
cell: cell,
|
|
3041
2333
|
tableInstance: tableInstance
|
|
3042
2334
|
}) : (enableClickToCopy || column.enableClickToCopy) && column.enableClickToCopy !== false ? React.createElement(React.Fragment, null, React.createElement(MRT_CopyButton, {
|
|
3043
2335
|
cell: cell,
|
|
3044
2336
|
tableInstance: tableInstance
|
|
3045
|
-
},
|
|
2337
|
+
}, (_cell$column$Cell = (_cell$column = cell.column) == null ? void 0 : _cell$column.Cell == null ? void 0 : _cell$column.Cell({
|
|
2338
|
+
cell: cell,
|
|
2339
|
+
tableInstance: tableInstance
|
|
2340
|
+
})) != null ? _cell$column$Cell : cell.renderCell()), row.getIsGrouped() && React.createElement(React.Fragment, null, " (", (_row$subRows = row.subRows) == null ? void 0 : _row$subRows.length, ")")) : React.createElement(React.Fragment, null, (_cell$column$Cell2 = (_cell$column2 = cell.column) == null ? void 0 : _cell$column2.Cell == null ? void 0 : _cell$column2.Cell({
|
|
2341
|
+
cell: cell,
|
|
2342
|
+
tableInstance: tableInstance
|
|
2343
|
+
})) != null ? _cell$column$Cell2 : cell.renderCell(), row.getIsGrouped() && React.createElement(React.Fragment, null, " (", (_row$subRows2 = row.subRows) == null ? void 0 : _row$subRows2.length, ")")));
|
|
3046
2344
|
};
|
|
3047
2345
|
|
|
3048
2346
|
var MRT_TableDetailPanel = function MRT_TableDetailPanel(_ref) {
|
|
@@ -3054,12 +2352,22 @@ var MRT_TableDetailPanel = function MRT_TableDetailPanel(_ref) {
|
|
|
3054
2352
|
muiTableDetailPanelProps = _tableInstance$option.muiTableDetailPanelProps,
|
|
3055
2353
|
onDetailPanelClick = _tableInstance$option.onDetailPanelClick,
|
|
3056
2354
|
renderDetailPanel = _tableInstance$option.renderDetailPanel;
|
|
3057
|
-
var tableRowProps = muiTableBodyRowProps instanceof Function ? muiTableBodyRowProps(
|
|
3058
|
-
|
|
2355
|
+
var tableRowProps = muiTableBodyRowProps instanceof Function ? muiTableBodyRowProps({
|
|
2356
|
+
row: row,
|
|
2357
|
+
tableInstance: tableInstance
|
|
2358
|
+
}) : muiTableBodyRowProps;
|
|
2359
|
+
var tableCellProps = muiTableDetailPanelProps instanceof Function ? muiTableDetailPanelProps({
|
|
2360
|
+
row: row,
|
|
2361
|
+
tableInstance: tableInstance
|
|
2362
|
+
}) : muiTableDetailPanelProps;
|
|
3059
2363
|
return React.createElement(TableRow, Object.assign({}, tableRowProps), React.createElement(TableCell, Object.assign({
|
|
3060
2364
|
colSpan: getVisibleFlatColumns().length + 10,
|
|
3061
2365
|
onClick: function onClick(event) {
|
|
3062
|
-
return onDetailPanelClick == null ? void 0 : onDetailPanelClick(
|
|
2366
|
+
return onDetailPanelClick == null ? void 0 : onDetailPanelClick({
|
|
2367
|
+
event: event,
|
|
2368
|
+
row: row,
|
|
2369
|
+
tableInstance: tableInstance
|
|
2370
|
+
});
|
|
3063
2371
|
}
|
|
3064
2372
|
}, tableCellProps, {
|
|
3065
2373
|
sx: _extends({
|
|
@@ -3070,7 +2378,10 @@ var MRT_TableDetailPanel = function MRT_TableDetailPanel(_ref) {
|
|
|
3070
2378
|
}, tableCellProps == null ? void 0 : tableCellProps.sx)
|
|
3071
2379
|
}), React.createElement(Collapse, {
|
|
3072
2380
|
"in": row.getIsExpanded()
|
|
3073
|
-
}, renderDetailPanel == null ? void 0 : renderDetailPanel(
|
|
2381
|
+
}, renderDetailPanel == null ? void 0 : renderDetailPanel({
|
|
2382
|
+
row: row,
|
|
2383
|
+
tableInstance: tableInstance
|
|
2384
|
+
}))));
|
|
3074
2385
|
};
|
|
3075
2386
|
|
|
3076
2387
|
var MRT_TableBodyRow = function MRT_TableBodyRow(_ref) {
|
|
@@ -3088,7 +2399,10 @@ var MRT_TableBodyRow = function MRT_TableBodyRow(_ref) {
|
|
|
3088
2399
|
getRightVisibleCells = row.getRightVisibleCells,
|
|
3089
2400
|
getRowProps = row.getRowProps,
|
|
3090
2401
|
getVisibleCells = row.getVisibleCells;
|
|
3091
|
-
var mTableBodyRowProps = muiTableBodyRowProps instanceof Function ? muiTableBodyRowProps(
|
|
2402
|
+
var mTableBodyRowProps = muiTableBodyRowProps instanceof Function ? muiTableBodyRowProps({
|
|
2403
|
+
row: row,
|
|
2404
|
+
tableInstance: tableInstance
|
|
2405
|
+
}) : muiTableBodyRowProps;
|
|
3092
2406
|
|
|
3093
2407
|
var tableRowProps = _extends({}, getRowProps(), mTableBodyRowProps);
|
|
3094
2408
|
|
|
@@ -3101,7 +2415,11 @@ var MRT_TableBodyRow = function MRT_TableBodyRow(_ref) {
|
|
|
3101
2415
|
return React.createElement(React.Fragment, null, React.createElement(TableRow, Object.assign({
|
|
3102
2416
|
hover: true,
|
|
3103
2417
|
onClick: function onClick(event) {
|
|
3104
|
-
return onRowClick == null ? void 0 : onRowClick(
|
|
2418
|
+
return onRowClick == null ? void 0 : onRowClick({
|
|
2419
|
+
event: event,
|
|
2420
|
+
row: row,
|
|
2421
|
+
tableInstance: tableInstance
|
|
2422
|
+
});
|
|
3105
2423
|
},
|
|
3106
2424
|
selected: getIsSelected()
|
|
3107
2425
|
}, tableRowProps), getVisibleCellsMap[pinned]().map(function (cell) {
|
|
@@ -3126,7 +2444,9 @@ var MRT_TableBody = function MRT_TableBody(_ref) {
|
|
|
3126
2444
|
enablePagination = _tableInstance$option.enablePagination,
|
|
3127
2445
|
muiTableBodyProps = _tableInstance$option.muiTableBodyProps;
|
|
3128
2446
|
var rows = enablePagination ? getPaginationRowModel().rows : getPrePaginationRowModel().rows;
|
|
3129
|
-
var mTableBodyProps = muiTableBodyProps instanceof Function ? muiTableBodyProps(
|
|
2447
|
+
var mTableBodyProps = muiTableBodyProps instanceof Function ? muiTableBodyProps({
|
|
2448
|
+
tableInstance: tableInstance
|
|
2449
|
+
}) : muiTableBodyProps;
|
|
3130
2450
|
|
|
3131
2451
|
var tableBodyProps = _extends({}, getTableBodyProps(), mTableBodyProps);
|
|
3132
2452
|
|
|
@@ -3154,8 +2474,14 @@ var MRT_TableFooterCell = function MRT_TableFooterCell(_ref) {
|
|
|
3154
2474
|
isDensePadding = _getState.isDensePadding;
|
|
3155
2475
|
|
|
3156
2476
|
var column = footer.column;
|
|
3157
|
-
var mTableFooterCellProps = muiTableFooterCellProps instanceof Function ? muiTableFooterCellProps(
|
|
3158
|
-
|
|
2477
|
+
var mTableFooterCellProps = muiTableFooterCellProps instanceof Function ? muiTableFooterCellProps({
|
|
2478
|
+
column: column,
|
|
2479
|
+
tableInstance: tableInstance
|
|
2480
|
+
}) : muiTableFooterCellProps;
|
|
2481
|
+
var mcTableFooterCellProps = column.muiTableFooterCellProps instanceof Function ? column.muiTableFooterCellProps({
|
|
2482
|
+
column: column,
|
|
2483
|
+
tableInstance: tableInstance
|
|
2484
|
+
}) : column.muiTableFooterCellProps;
|
|
3159
2485
|
|
|
3160
2486
|
var tableCellProps = _extends({}, footer.getFooterProps(), mTableFooterCellProps, mcTableFooterCellProps);
|
|
3161
2487
|
|
|
@@ -3190,7 +2516,10 @@ var MRT_TableFooterRow = function MRT_TableFooterRow(_ref) {
|
|
|
3190
2516
|
if (!((_footerGroup$headers = footerGroup.headers) != null && _footerGroup$headers.some(function (h) {
|
|
3191
2517
|
return h.column.columnDef.footer || h.column.Footer;
|
|
3192
2518
|
}))) return null;
|
|
3193
|
-
var mTableFooterRowProps = muiTableFooterRowProps instanceof Function ? muiTableFooterRowProps(
|
|
2519
|
+
var mTableFooterRowProps = muiTableFooterRowProps instanceof Function ? muiTableFooterRowProps({
|
|
2520
|
+
footerGroup: footerGroup,
|
|
2521
|
+
tableInstance: tableInstance
|
|
2522
|
+
}) : muiTableFooterRowProps;
|
|
3194
2523
|
|
|
3195
2524
|
var tableRowProps = _extends({}, footerGroup.getFooterGroupProps(), mTableFooterRowProps);
|
|
3196
2525
|
|
|
@@ -3211,7 +2540,9 @@ var MRT_TableFooter = function MRT_TableFooter(_ref) {
|
|
|
3211
2540
|
getLeftFooterGroups = tableInstance.getLeftFooterGroups,
|
|
3212
2541
|
getRightFooterGroups = tableInstance.getRightFooterGroups,
|
|
3213
2542
|
muiTableFooterProps = tableInstance.options.muiTableFooterProps;
|
|
3214
|
-
var tableFooterProps = muiTableFooterProps instanceof Function ? muiTableFooterProps(
|
|
2543
|
+
var tableFooterProps = muiTableFooterProps instanceof Function ? muiTableFooterProps({
|
|
2544
|
+
tableInstance: tableInstance
|
|
2545
|
+
}) : muiTableFooterProps;
|
|
3215
2546
|
var getFooterGroupsMap = {
|
|
3216
2547
|
center: getCenterFooterGroups,
|
|
3217
2548
|
left: getLeftFooterGroups,
|
|
@@ -3236,7 +2567,9 @@ var MRT_Table = function MRT_Table(_ref) {
|
|
|
3236
2567
|
hideTableFooter = _tableInstance$option.hideTableFooter,
|
|
3237
2568
|
hideTableHead = _tableInstance$option.hideTableHead,
|
|
3238
2569
|
muiTableProps = _tableInstance$option.muiTableProps;
|
|
3239
|
-
var mTableProps = muiTableProps instanceof Function ? muiTableProps(
|
|
2570
|
+
var mTableProps = muiTableProps instanceof Function ? muiTableProps({
|
|
2571
|
+
tableInstance: tableInstance
|
|
2572
|
+
}) : muiTableProps;
|
|
3240
2573
|
|
|
3241
2574
|
var tableProps = _extends({}, getTableProps(), mTableProps);
|
|
3242
2575
|
|
|
@@ -3287,7 +2620,9 @@ var MRT_TableContainer = function MRT_TableContainer(_ref2) {
|
|
|
3287
2620
|
totalToolbarHeight = _useState[0],
|
|
3288
2621
|
setTotalToolbarHeight = _useState[1];
|
|
3289
2622
|
|
|
3290
|
-
var tableContainerProps = muiTableContainerProps instanceof Function ? muiTableContainerProps(
|
|
2623
|
+
var tableContainerProps = muiTableContainerProps instanceof Function ? muiTableContainerProps({
|
|
2624
|
+
tableInstance: tableInstance
|
|
2625
|
+
}) : muiTableContainerProps;
|
|
3291
2626
|
useLayoutEffect(function () {
|
|
3292
2627
|
var _document$getElementB, _document, _document$getElementB2, _document$getElementB3, _document2, _document2$getElement;
|
|
3293
2628
|
|
|
@@ -3309,9 +2644,7 @@ var MRT_TableContainer = function MRT_TableContainer(_ref2) {
|
|
|
3309
2644
|
display: 'grid',
|
|
3310
2645
|
gridTemplateColumns: getLeftTableWidth() + "fr " + getCenterTableWidth() + "fr " + getRightTableWidth() + "fr"
|
|
3311
2646
|
}
|
|
3312
|
-
}, React.createElement(Box
|
|
3313
|
-
, {
|
|
3314
|
-
// @ts-ignore
|
|
2647
|
+
}, React.createElement(Box, {
|
|
3315
2648
|
sx: function sx(theme) {
|
|
3316
2649
|
var _columnPinning$left;
|
|
3317
2650
|
|
|
@@ -3324,8 +2657,7 @@ var MRT_TableContainer = function MRT_TableContainer(_ref2) {
|
|
|
3324
2657
|
}, React.createElement(MRT_Table, {
|
|
3325
2658
|
pinned: "left",
|
|
3326
2659
|
tableInstance: tableInstance
|
|
3327
|
-
})), React.createElement(Box
|
|
3328
|
-
, {
|
|
2660
|
+
})), React.createElement(Box, {
|
|
3329
2661
|
sx: function sx(theme) {
|
|
3330
2662
|
return commonBoxStyles({
|
|
3331
2663
|
theme: theme
|
|
@@ -3334,9 +2666,7 @@ var MRT_TableContainer = function MRT_TableContainer(_ref2) {
|
|
|
3334
2666
|
}, React.createElement(MRT_Table, {
|
|
3335
2667
|
pinned: "center",
|
|
3336
2668
|
tableInstance: tableInstance
|
|
3337
|
-
})), React.createElement(Box
|
|
3338
|
-
, {
|
|
3339
|
-
// @ts-ignore
|
|
2669
|
+
})), React.createElement(Box, {
|
|
3340
2670
|
sx: function sx(theme) {
|
|
3341
2671
|
var _columnPinning$right;
|
|
3342
2672
|
|
|
@@ -3375,23 +2705,29 @@ var MRT_TablePaper = function MRT_TablePaper(_ref) {
|
|
|
3375
2705
|
}
|
|
3376
2706
|
}
|
|
3377
2707
|
}, [isFullScreen]);
|
|
3378
|
-
var tablePaperProps = muiTablePaperProps instanceof Function ? muiTablePaperProps(
|
|
2708
|
+
var tablePaperProps = muiTablePaperProps instanceof Function ? muiTablePaperProps({
|
|
2709
|
+
tableInstance: tableInstance
|
|
2710
|
+
}) : muiTablePaperProps;
|
|
3379
2711
|
return React.createElement(Paper, Object.assign({
|
|
3380
2712
|
elevation: 2
|
|
3381
2713
|
}, tablePaperProps, {
|
|
3382
2714
|
sx: _extends({
|
|
3383
|
-
|
|
2715
|
+
transition: 'all 0.2s ease-in-out'
|
|
2716
|
+
}, tablePaperProps == null ? void 0 : tablePaperProps.sx),
|
|
2717
|
+
style: {
|
|
3384
2718
|
height: isFullScreen ? '100%' : undefined,
|
|
3385
2719
|
left: isFullScreen ? '0' : undefined,
|
|
3386
|
-
|
|
2720
|
+
margin: isFullScreen ? '0' : undefined,
|
|
2721
|
+
maxHeight: isFullScreen ? '100%' : undefined,
|
|
2722
|
+
maxWidth: isFullScreen ? '100%' : undefined,
|
|
3387
2723
|
overflowY: !isFullScreen ? 'hidden' : undefined,
|
|
3388
2724
|
position: isFullScreen ? 'fixed' : undefined,
|
|
3389
2725
|
right: isFullScreen ? '0' : undefined,
|
|
3390
2726
|
top: isFullScreen ? '0' : undefined,
|
|
3391
|
-
transition: 'all 0.2s ease-in-out',
|
|
3392
2727
|
width: isFullScreen ? '100vw' : undefined,
|
|
3393
|
-
zIndex: isFullScreen ? 1200 : 1
|
|
3394
|
-
|
|
2728
|
+
zIndex: isFullScreen ? 1200 : 1,
|
|
2729
|
+
bottom: isFullScreen ? '0' : undefined
|
|
2730
|
+
}
|
|
3395
2731
|
}), !hideToolbarTop && React.createElement(MRT_ToolbarTop, {
|
|
3396
2732
|
tableInstance: tableInstance
|
|
3397
2733
|
}), React.createElement(MRT_TableContainer, {
|
|
@@ -3504,9 +2840,9 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
|
|
|
3504
2840
|
return createTable();
|
|
3505
2841
|
}, []);
|
|
3506
2842
|
var displayColumns = useMemo(function () {
|
|
3507
|
-
var _props$localization, _props$localization2, _props$localization3, _props$
|
|
2843
|
+
var _props$localization, _props$localization2, _props$localization3, _props$localization5;
|
|
3508
2844
|
|
|
3509
|
-
return [(props.enableRowActions || props.
|
|
2845
|
+
return [(props.enableRowActions || props.enableEditing) && createDisplayColumn(table, {
|
|
3510
2846
|
Cell: function Cell(_ref3) {
|
|
3511
2847
|
var cell = _ref3.cell;
|
|
3512
2848
|
return React.createElement(MRT_ToggleRowActionMenuButton, {
|
|
@@ -3559,15 +2895,17 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
|
|
|
3559
2895
|
return cell.row.index + 1;
|
|
3560
2896
|
},
|
|
3561
2897
|
Header: function Header() {
|
|
3562
|
-
|
|
2898
|
+
var _props$localization4;
|
|
2899
|
+
|
|
2900
|
+
return (_props$localization4 = props.localization) == null ? void 0 : _props$localization4.rowNumber;
|
|
3563
2901
|
},
|
|
3564
|
-
header: (_props$
|
|
2902
|
+
header: (_props$localization5 = props.localization) == null ? void 0 : _props$localization5.rowNumbers,
|
|
3565
2903
|
id: 'mrt-row-numbers',
|
|
3566
2904
|
maxWidth: 40,
|
|
3567
2905
|
width: 40,
|
|
3568
2906
|
minWidth: 40
|
|
3569
2907
|
})].filter(Boolean);
|
|
3570
|
-
}, [props.enableExpandAll, props.enableExpanded, props.enableRowActions, props.
|
|
2908
|
+
}, [table, props.enableExpandAll, props.enableExpanded, props.enableRowActions, props.enableGrouping, props.enableEditing, props.enableRowNumbers, props.enableRowSelection, props.enableSelectAll, props.localization]);
|
|
3571
2909
|
var columns = useMemo(function () {
|
|
3572
2910
|
return table.createColumns([].concat(displayColumns, props.columns.map(function (column) {
|
|
3573
2911
|
return column.columns ? createGroup(table, column, currentFilterTypes) : createDataColumn(table, column, currentFilterTypes);
|
|
@@ -3584,19 +2922,22 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
|
|
|
3584
2922
|
}, [props.data, props.isLoading]); //@ts-ignore
|
|
3585
2923
|
|
|
3586
2924
|
var tableInstance = useTable(table, _extends({}, props, {
|
|
3587
|
-
//@ts-ignore
|
|
3588
|
-
filterTypes: defaultFilterFNs,
|
|
3589
|
-
globalFilterType: currentGlobalFilterType,
|
|
3590
2925
|
columnFilterRowsFn: columnFilterRowsFn,
|
|
3591
2926
|
columns: columns,
|
|
3592
2927
|
data: data,
|
|
2928
|
+
debugAll: false,
|
|
3593
2929
|
expandRowsFn: expandRowsFn,
|
|
2930
|
+
//@ts-ignore
|
|
2931
|
+
filterTypes: defaultFilterFNs,
|
|
3594
2932
|
getSubRows: (_props$getSubRows = props.getSubRows) != null ? _props$getSubRows : function (originalRow) {
|
|
3595
2933
|
return originalRow.subRows;
|
|
3596
2934
|
},
|
|
3597
2935
|
globalFilterRowsFn: globalFilterRowsFn,
|
|
2936
|
+
globalFilterType: currentGlobalFilterType,
|
|
3598
2937
|
groupRowsFn: groupRowsFn,
|
|
3599
2938
|
idPrefix: idPrefix,
|
|
2939
|
+
//@ts-ignore
|
|
2940
|
+
initialState: props.initialState,
|
|
3600
2941
|
onPaginationChange: function onPaginationChange(updater) {
|
|
3601
2942
|
return setPagination(function (old) {
|
|
3602
2943
|
return functionalUpdate(updater, old);
|
|
@@ -3611,7 +2952,7 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
|
|
|
3611
2952
|
setShowFilters: setShowFilters,
|
|
3612
2953
|
setShowSearch: setShowSearch,
|
|
3613
2954
|
sortRowsFn: sortRowsFn,
|
|
3614
|
-
state: _extends({
|
|
2955
|
+
state: _extends({
|
|
3615
2956
|
currentEditingRow: currentEditingRow,
|
|
3616
2957
|
currentFilterTypes: currentFilterTypes,
|
|
3617
2958
|
currentGlobalFilterType: currentGlobalFilterType,
|
|
@@ -3628,7 +2969,13 @@ var MRT_TableRoot = function MRT_TableRoot(props) {
|
|
|
3628
2969
|
});
|
|
3629
2970
|
};
|
|
3630
2971
|
|
|
3631
|
-
var _excluded$5 = ["enableColumnActions", "enableColumnFilters", "enableDensePaddingToggle", "enableExpandAll", "enableFullScreenToggle", "enableGlobalFilter", "enableHiding", "enablePagination", "enableSelectAll", "enableSorting", "enableStickyHeader", "
|
|
2972
|
+
var _excluded$5 = ["enableColumnActions", "enableColumnFilters", "enableDensePaddingToggle", "enableExpandAll", "enableFullScreenToggle", "enableGlobalFilter", "enableHiding", "enablePagination", "enableSelectAll", "enableSorting", "enableStickyHeader", "icons", "localization", "positionActionsColumn", "positionPagination", "positionToolbarActions", "positionToolbarAlertBanner"];
|
|
2973
|
+
|
|
2974
|
+
global.performance = global.performance || {
|
|
2975
|
+
now: function now() {
|
|
2976
|
+
return new Date().getTime();
|
|
2977
|
+
}
|
|
2978
|
+
};
|
|
3632
2979
|
var MaterialReactTable = (function (_ref) {
|
|
3633
2980
|
var _ref$enableColumnActi = _ref.enableColumnActions,
|
|
3634
2981
|
enableColumnActions = _ref$enableColumnActi === void 0 ? true : _ref$enableColumnActi,
|