schummar-table 0.5.0-beta-3 → 0.5.0-beta-6
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/dist/cjs/index.js +400 -1927
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/mui4Theme.js +9 -7
- package/dist/cjs/mui4Theme.js.map +1 -1
- package/dist/cjs/mui5Theme.js +10 -8
- package/dist/cjs/mui5Theme.js.map +1 -1
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/tableTheme.js +104 -1446
- package/dist/cjs/tableTheme.js.map +1 -1
- package/dist/es/index.js +225 -1750
- package/dist/es/index.js.map +1 -1
- package/dist/es/mui4Theme.js +3 -1
- package/dist/es/mui4Theme.js.map +1 -1
- package/dist/es/mui5Theme.js +3 -1
- package/dist/es/mui5Theme.js.map +1 -1
- package/dist/es/tableTheme.js +35 -1370
- package/dist/es/tableTheme.js.map +1 -1
- package/dist/types/components/row.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/misc/helpers.d.ts +1 -0
- package/dist/types/types.d.ts +7 -7
- package/package.json +19 -12
package/dist/cjs/index.js
CHANGED
|
@@ -6,18 +6,18 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
8
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __spreadValues = (
|
|
10
|
-
for (var prop in
|
|
11
|
-
if (__hasOwnProp.call(
|
|
12
|
-
__defNormalProp(
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
13
|
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(
|
|
15
|
-
if (__propIsEnum.call(
|
|
16
|
-
__defNormalProp(
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
17
|
}
|
|
18
|
-
return
|
|
18
|
+
return a;
|
|
19
19
|
};
|
|
20
|
-
var __spreadProps = (
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
21
|
var __objRest = (source, exclude) => {
|
|
22
22
|
var target = {};
|
|
23
23
|
for (var prop in source)
|
|
@@ -32,518 +32,14 @@ var __objRest = (source, exclude) => {
|
|
|
32
32
|
};
|
|
33
33
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
34
|
exports[Symbol.toStringTag] = "Module";
|
|
35
|
-
var
|
|
35
|
+
var react = require("react");
|
|
36
|
+
var dayzed = require("dayzed");
|
|
36
37
|
var tableTheme = require("./tableTheme.js");
|
|
38
|
+
var jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
39
|
+
var immer = require("immer");
|
|
40
|
+
var react$1 = require("schummar-state/react");
|
|
41
|
+
require("@emotion/react");
|
|
37
42
|
require("react-dom");
|
|
38
|
-
function _interopDefaultLegacy(e2) {
|
|
39
|
-
return e2 && typeof e2 === "object" && "default" in e2 ? e2 : { "default": e2 };
|
|
40
|
-
}
|
|
41
|
-
var require$$0__default = /* @__PURE__ */ _interopDefaultLegacy(require$$0);
|
|
42
|
-
var propTypes = { exports: {} };
|
|
43
|
-
var ReactPropTypesSecret$1 = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
44
|
-
var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
|
|
45
|
-
var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
|
46
|
-
function emptyFunction() {
|
|
47
|
-
}
|
|
48
|
-
function emptyFunctionWithReset() {
|
|
49
|
-
}
|
|
50
|
-
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
51
|
-
var factoryWithThrowingShims = function() {
|
|
52
|
-
function shim2(props, propName, componentName, location, propFullName, secret) {
|
|
53
|
-
if (secret === ReactPropTypesSecret) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
var err = new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");
|
|
57
|
-
err.name = "Invariant Violation";
|
|
58
|
-
throw err;
|
|
59
|
-
}
|
|
60
|
-
shim2.isRequired = shim2;
|
|
61
|
-
function getShim() {
|
|
62
|
-
return shim2;
|
|
63
|
-
}
|
|
64
|
-
var ReactPropTypes = {
|
|
65
|
-
array: shim2,
|
|
66
|
-
bigint: shim2,
|
|
67
|
-
bool: shim2,
|
|
68
|
-
func: shim2,
|
|
69
|
-
number: shim2,
|
|
70
|
-
object: shim2,
|
|
71
|
-
string: shim2,
|
|
72
|
-
symbol: shim2,
|
|
73
|
-
any: shim2,
|
|
74
|
-
arrayOf: getShim,
|
|
75
|
-
element: shim2,
|
|
76
|
-
elementType: shim2,
|
|
77
|
-
instanceOf: getShim,
|
|
78
|
-
node: shim2,
|
|
79
|
-
objectOf: getShim,
|
|
80
|
-
oneOf: getShim,
|
|
81
|
-
oneOfType: getShim,
|
|
82
|
-
shape: getShim,
|
|
83
|
-
exact: getShim,
|
|
84
|
-
checkPropTypes: emptyFunctionWithReset,
|
|
85
|
-
resetWarningCache: emptyFunction
|
|
86
|
-
};
|
|
87
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
88
|
-
return ReactPropTypes;
|
|
89
|
-
};
|
|
90
|
-
{
|
|
91
|
-
propTypes.exports = factoryWithThrowingShims();
|
|
92
|
-
}
|
|
93
|
-
var PropTypes = propTypes.exports;
|
|
94
|
-
function _extends() {
|
|
95
|
-
_extends = Object.assign || function(target) {
|
|
96
|
-
for (var i2 = 1; i2 < arguments.length; i2++) {
|
|
97
|
-
var source = arguments[i2];
|
|
98
|
-
for (var key in source) {
|
|
99
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
100
|
-
target[key] = source[key];
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return target;
|
|
105
|
-
};
|
|
106
|
-
return _extends.apply(this, arguments);
|
|
107
|
-
}
|
|
108
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
109
|
-
if (source == null)
|
|
110
|
-
return {};
|
|
111
|
-
var target = {};
|
|
112
|
-
var sourceKeys = Object.keys(source);
|
|
113
|
-
var key, i2;
|
|
114
|
-
for (i2 = 0; i2 < sourceKeys.length; i2++) {
|
|
115
|
-
key = sourceKeys[i2];
|
|
116
|
-
if (excluded.indexOf(key) >= 0)
|
|
117
|
-
continue;
|
|
118
|
-
target[key] = source[key];
|
|
119
|
-
}
|
|
120
|
-
return target;
|
|
121
|
-
}
|
|
122
|
-
function toInteger(dirtyNumber) {
|
|
123
|
-
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
|
124
|
-
return NaN;
|
|
125
|
-
}
|
|
126
|
-
var number = Number(dirtyNumber);
|
|
127
|
-
if (isNaN(number)) {
|
|
128
|
-
return number;
|
|
129
|
-
}
|
|
130
|
-
return number < 0 ? Math.ceil(number) : Math.floor(number);
|
|
131
|
-
}
|
|
132
|
-
function toDate(argument) {
|
|
133
|
-
if (arguments.length < 1) {
|
|
134
|
-
throw new TypeError("1 argument required, but only " + arguments.length + " present");
|
|
135
|
-
}
|
|
136
|
-
var argStr = Object.prototype.toString.call(argument);
|
|
137
|
-
if (argument instanceof Date || typeof argument === "object" && argStr === "[object Date]") {
|
|
138
|
-
return new Date(argument.getTime());
|
|
139
|
-
} else if (typeof argument === "number" || argStr === "[object Number]") {
|
|
140
|
-
return new Date(argument);
|
|
141
|
-
} else {
|
|
142
|
-
if ((typeof argument === "string" || argStr === "[object String]") && typeof console !== "undefined") {
|
|
143
|
-
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule");
|
|
144
|
-
console.warn(new Error().stack);
|
|
145
|
-
}
|
|
146
|
-
return new Date(NaN);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
function addDays(dirtyDate, dirtyAmount) {
|
|
150
|
-
if (arguments.length < 2) {
|
|
151
|
-
throw new TypeError("2 arguments required, but only " + arguments.length + " present");
|
|
152
|
-
}
|
|
153
|
-
var date = toDate(dirtyDate);
|
|
154
|
-
var amount = toInteger(dirtyAmount);
|
|
155
|
-
date.setDate(date.getDate() + amount);
|
|
156
|
-
return date;
|
|
157
|
-
}
|
|
158
|
-
function isBefore(dirtyDate, dirtyDateToCompare) {
|
|
159
|
-
if (arguments.length < 2) {
|
|
160
|
-
throw new TypeError("2 arguments required, but only " + arguments.length + " present");
|
|
161
|
-
}
|
|
162
|
-
var date = toDate(dirtyDate);
|
|
163
|
-
var dateToCompare = toDate(dirtyDateToCompare);
|
|
164
|
-
return date.getTime() < dateToCompare.getTime();
|
|
165
|
-
}
|
|
166
|
-
function startOfDay$1(dirtyDate) {
|
|
167
|
-
if (arguments.length < 1) {
|
|
168
|
-
throw new TypeError("1 argument required, but only " + arguments.length + " present");
|
|
169
|
-
}
|
|
170
|
-
var date = toDate(dirtyDate);
|
|
171
|
-
date.setHours(0, 0, 0, 0);
|
|
172
|
-
return date;
|
|
173
|
-
}
|
|
174
|
-
function isSameDay(dirtyDateLeft, dirtyDateRight) {
|
|
175
|
-
if (arguments.length < 2) {
|
|
176
|
-
throw new TypeError("2 arguments required, but only " + arguments.length + " present");
|
|
177
|
-
}
|
|
178
|
-
var dateLeftStartOfDay = startOfDay$1(dirtyDateLeft);
|
|
179
|
-
var dateRightStartOfDay = startOfDay$1(dirtyDateRight);
|
|
180
|
-
return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime();
|
|
181
|
-
}
|
|
182
|
-
function isToday(dirtyDate) {
|
|
183
|
-
if (arguments.length < 1) {
|
|
184
|
-
throw new TypeError("1 argument required, but only " + arguments.length + " present");
|
|
185
|
-
}
|
|
186
|
-
return isSameDay(dirtyDate, Date.now());
|
|
187
|
-
}
|
|
188
|
-
function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) {
|
|
189
|
-
if (arguments.length < 2) {
|
|
190
|
-
throw new TypeError("2 arguments required, but only " + arguments.length + " present");
|
|
191
|
-
}
|
|
192
|
-
var dateLeft = toDate(dirtyDateLeft);
|
|
193
|
-
var dateRight = toDate(dirtyDateRight);
|
|
194
|
-
var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();
|
|
195
|
-
var monthDiff = dateLeft.getMonth() - dateRight.getMonth();
|
|
196
|
-
return yearDiff * 12 + monthDiff;
|
|
197
|
-
}
|
|
198
|
-
function composeEventHandlers() {
|
|
199
|
-
for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
200
|
-
fns[_key] = arguments[_key];
|
|
201
|
-
}
|
|
202
|
-
return function(event) {
|
|
203
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
204
|
-
args[_key2 - 1] = arguments[_key2];
|
|
205
|
-
}
|
|
206
|
-
return fns.some(function(fn2) {
|
|
207
|
-
fn2 && fn2.apply(void 0, [event].concat(args));
|
|
208
|
-
return event.defaultPrevented;
|
|
209
|
-
});
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
function requiredProp(fnName, propName) {
|
|
213
|
-
throw new Error('The property "' + propName + '" is required in "' + fnName + '"');
|
|
214
|
-
}
|
|
215
|
-
function subtractMonth(_ref) {
|
|
216
|
-
var calendars = _ref.calendars, offset = _ref.offset, minDate = _ref.minDate;
|
|
217
|
-
if (offset > 1 && minDate) {
|
|
218
|
-
var firstDayOfMonth = calendars[0].firstDayOfMonth;
|
|
219
|
-
var diffInMonths = differenceInCalendarMonths(firstDayOfMonth, minDate);
|
|
220
|
-
if (diffInMonths < offset) {
|
|
221
|
-
offset = diffInMonths;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
return offset;
|
|
225
|
-
}
|
|
226
|
-
function addMonth(_ref2) {
|
|
227
|
-
var calendars = _ref2.calendars, offset = _ref2.offset, maxDate = _ref2.maxDate;
|
|
228
|
-
if (offset > 1 && maxDate) {
|
|
229
|
-
var lastDayOfMonth = calendars[calendars.length - 1].lastDayOfMonth;
|
|
230
|
-
var diffInMonths = differenceInCalendarMonths(maxDate, lastDayOfMonth);
|
|
231
|
-
if (diffInMonths < offset) {
|
|
232
|
-
offset = diffInMonths;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
return offset;
|
|
236
|
-
}
|
|
237
|
-
function isBackDisabled(_ref3) {
|
|
238
|
-
var calendars = _ref3.calendars, minDate = _ref3.minDate;
|
|
239
|
-
if (!minDate) {
|
|
240
|
-
return false;
|
|
241
|
-
}
|
|
242
|
-
var firstDayOfMonth = calendars[0].firstDayOfMonth;
|
|
243
|
-
var firstDayOfMonthMinusOne = addDays(firstDayOfMonth, -1);
|
|
244
|
-
if (isBefore(firstDayOfMonthMinusOne, minDate)) {
|
|
245
|
-
return true;
|
|
246
|
-
}
|
|
247
|
-
return false;
|
|
248
|
-
}
|
|
249
|
-
function isForwardDisabled(_ref4) {
|
|
250
|
-
var calendars = _ref4.calendars, maxDate = _ref4.maxDate;
|
|
251
|
-
if (!maxDate) {
|
|
252
|
-
return false;
|
|
253
|
-
}
|
|
254
|
-
var lastDayOfMonth = calendars[calendars.length - 1].lastDayOfMonth;
|
|
255
|
-
var lastDayOfMonthPlusOne = addDays(lastDayOfMonth, 1);
|
|
256
|
-
if (isBefore(maxDate, lastDayOfMonthPlusOne)) {
|
|
257
|
-
return true;
|
|
258
|
-
}
|
|
259
|
-
return false;
|
|
260
|
-
}
|
|
261
|
-
function getCalendars(_ref5) {
|
|
262
|
-
var date = _ref5.date, selected = _ref5.selected, monthsToDisplay = _ref5.monthsToDisplay, offset = _ref5.offset, minDate = _ref5.minDate, maxDate = _ref5.maxDate, firstDayOfWeek = _ref5.firstDayOfWeek, showOutsideDays = _ref5.showOutsideDays;
|
|
263
|
-
var months2 = [];
|
|
264
|
-
var startDate = getStartDate(date, minDate, maxDate);
|
|
265
|
-
for (var i2 = 0; i2 < monthsToDisplay; i2++) {
|
|
266
|
-
var calendarDates = getMonths({
|
|
267
|
-
month: startDate.getMonth() + i2 + offset,
|
|
268
|
-
year: startDate.getFullYear(),
|
|
269
|
-
selectedDates: selected,
|
|
270
|
-
minDate,
|
|
271
|
-
maxDate,
|
|
272
|
-
firstDayOfWeek,
|
|
273
|
-
showOutsideDays
|
|
274
|
-
});
|
|
275
|
-
months2.push(calendarDates);
|
|
276
|
-
}
|
|
277
|
-
return months2;
|
|
278
|
-
}
|
|
279
|
-
function getStartDate(date, minDate, maxDate) {
|
|
280
|
-
var startDate = startOfDay$1(date);
|
|
281
|
-
if (minDate) {
|
|
282
|
-
var minDateNormalized = startOfDay$1(minDate);
|
|
283
|
-
if (isBefore(startDate, minDateNormalized)) {
|
|
284
|
-
startDate = minDateNormalized;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
if (maxDate) {
|
|
288
|
-
var maxDateNormalized = startOfDay$1(maxDate);
|
|
289
|
-
if (isBefore(maxDateNormalized, startDate)) {
|
|
290
|
-
startDate = maxDateNormalized;
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
return startDate;
|
|
294
|
-
}
|
|
295
|
-
function getMonths(_ref6) {
|
|
296
|
-
var month = _ref6.month, year = _ref6.year, selectedDates = _ref6.selectedDates, minDate = _ref6.minDate, maxDate = _ref6.maxDate, firstDayOfWeek = _ref6.firstDayOfWeek, showOutsideDays = _ref6.showOutsideDays;
|
|
297
|
-
var daysMonthYear = getNumDaysMonthYear(month, year);
|
|
298
|
-
var daysInMonth = daysMonthYear.daysInMonth;
|
|
299
|
-
month = daysMonthYear.month;
|
|
300
|
-
year = daysMonthYear.year;
|
|
301
|
-
var dates = [];
|
|
302
|
-
for (var day = 1; day <= daysInMonth; day++) {
|
|
303
|
-
var date = new Date(year, month, day);
|
|
304
|
-
var dateObj = {
|
|
305
|
-
date,
|
|
306
|
-
selected: isSelected(selectedDates, date),
|
|
307
|
-
selectable: isSelectable(minDate, maxDate, date),
|
|
308
|
-
today: isToday(date),
|
|
309
|
-
prevMonth: false,
|
|
310
|
-
nextMonth: false
|
|
311
|
-
};
|
|
312
|
-
dates.push(dateObj);
|
|
313
|
-
}
|
|
314
|
-
var firstDayOfMonth = new Date(year, month, 1);
|
|
315
|
-
var lastDayOfMonth = new Date(year, month, daysInMonth);
|
|
316
|
-
var frontWeekBuffer = fillFrontWeek({
|
|
317
|
-
firstDayOfMonth,
|
|
318
|
-
minDate,
|
|
319
|
-
maxDate,
|
|
320
|
-
selectedDates,
|
|
321
|
-
firstDayOfWeek,
|
|
322
|
-
showOutsideDays
|
|
323
|
-
});
|
|
324
|
-
var backWeekBuffer = fillBackWeek({
|
|
325
|
-
lastDayOfMonth,
|
|
326
|
-
minDate,
|
|
327
|
-
maxDate,
|
|
328
|
-
selectedDates,
|
|
329
|
-
firstDayOfWeek,
|
|
330
|
-
showOutsideDays
|
|
331
|
-
});
|
|
332
|
-
dates.unshift.apply(dates, frontWeekBuffer);
|
|
333
|
-
dates.push.apply(dates, backWeekBuffer);
|
|
334
|
-
var weeks = getWeeks(dates);
|
|
335
|
-
return {
|
|
336
|
-
firstDayOfMonth,
|
|
337
|
-
lastDayOfMonth,
|
|
338
|
-
month,
|
|
339
|
-
year,
|
|
340
|
-
weeks
|
|
341
|
-
};
|
|
342
|
-
}
|
|
343
|
-
function fillFrontWeek(_ref7) {
|
|
344
|
-
var firstDayOfMonth = _ref7.firstDayOfMonth, minDate = _ref7.minDate, maxDate = _ref7.maxDate, selectedDates = _ref7.selectedDates, firstDayOfWeek = _ref7.firstDayOfWeek, showOutsideDays = _ref7.showOutsideDays;
|
|
345
|
-
var dates = [];
|
|
346
|
-
var firstDay = (firstDayOfMonth.getDay() + 7 - firstDayOfWeek) % 7;
|
|
347
|
-
if (showOutsideDays) {
|
|
348
|
-
var lastDayOfPrevMonth = addDays(firstDayOfMonth, -1);
|
|
349
|
-
var prevDate = lastDayOfPrevMonth.getDate();
|
|
350
|
-
var prevDateMonth = lastDayOfPrevMonth.getMonth();
|
|
351
|
-
var prevDateYear = lastDayOfPrevMonth.getFullYear();
|
|
352
|
-
var counter = 0;
|
|
353
|
-
while (counter < firstDay) {
|
|
354
|
-
var date = new Date(prevDateYear, prevDateMonth, prevDate - counter);
|
|
355
|
-
var dateObj = {
|
|
356
|
-
date,
|
|
357
|
-
selected: isSelected(selectedDates, date),
|
|
358
|
-
selectable: isSelectable(minDate, maxDate, date),
|
|
359
|
-
today: false,
|
|
360
|
-
prevMonth: true,
|
|
361
|
-
nextMonth: false
|
|
362
|
-
};
|
|
363
|
-
dates.unshift(dateObj);
|
|
364
|
-
counter++;
|
|
365
|
-
}
|
|
366
|
-
} else {
|
|
367
|
-
while (firstDay > 0) {
|
|
368
|
-
dates.unshift("");
|
|
369
|
-
firstDay--;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
return dates;
|
|
373
|
-
}
|
|
374
|
-
function fillBackWeek(_ref8) {
|
|
375
|
-
var lastDayOfMonth = _ref8.lastDayOfMonth, minDate = _ref8.minDate, maxDate = _ref8.maxDate, selectedDates = _ref8.selectedDates, firstDayOfWeek = _ref8.firstDayOfWeek, showOutsideDays = _ref8.showOutsideDays;
|
|
376
|
-
var dates = [];
|
|
377
|
-
var lastDay = (lastDayOfMonth.getDay() + 7 - firstDayOfWeek) % 7;
|
|
378
|
-
if (showOutsideDays) {
|
|
379
|
-
var firstDayOfNextMonth = addDays(lastDayOfMonth, 1);
|
|
380
|
-
var nextDateMonth = firstDayOfNextMonth.getMonth();
|
|
381
|
-
var nextDateYear = firstDayOfNextMonth.getFullYear();
|
|
382
|
-
var counter = 0;
|
|
383
|
-
while (counter < 6 - lastDay) {
|
|
384
|
-
var date = new Date(nextDateYear, nextDateMonth, 1 + counter);
|
|
385
|
-
var dateObj = {
|
|
386
|
-
date,
|
|
387
|
-
selected: isSelected(selectedDates, date),
|
|
388
|
-
selectable: isSelectable(minDate, maxDate, date),
|
|
389
|
-
today: false,
|
|
390
|
-
prevMonth: false,
|
|
391
|
-
nextMonth: true
|
|
392
|
-
};
|
|
393
|
-
dates.push(dateObj);
|
|
394
|
-
counter++;
|
|
395
|
-
}
|
|
396
|
-
} else {
|
|
397
|
-
while (lastDay < 6) {
|
|
398
|
-
dates.push("");
|
|
399
|
-
lastDay++;
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
return dates;
|
|
403
|
-
}
|
|
404
|
-
function getNumDaysMonthYear(month, year) {
|
|
405
|
-
var normalizedMonthYear = new Date(year, month, 1);
|
|
406
|
-
month = normalizedMonthYear.getMonth();
|
|
407
|
-
year = normalizedMonthYear.getFullYear();
|
|
408
|
-
var daysInMonth = 32 - new Date(year, month, 32).getDate();
|
|
409
|
-
return {
|
|
410
|
-
daysInMonth,
|
|
411
|
-
month,
|
|
412
|
-
year
|
|
413
|
-
};
|
|
414
|
-
}
|
|
415
|
-
function getWeeks(dates) {
|
|
416
|
-
var weeksLength = Math.ceil(dates.length / 7);
|
|
417
|
-
var weeks = [];
|
|
418
|
-
for (var i2 = 0; i2 < weeksLength; i2++) {
|
|
419
|
-
weeks[i2] = [];
|
|
420
|
-
for (var x2 = 0; x2 < 7; x2++) {
|
|
421
|
-
weeks[i2].push(dates[i2 * 7 + x2]);
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
return weeks;
|
|
425
|
-
}
|
|
426
|
-
function isSelected(selectedDates, date) {
|
|
427
|
-
selectedDates = Array.isArray(selectedDates) ? selectedDates : [selectedDates];
|
|
428
|
-
return selectedDates.some(function(selectedDate) {
|
|
429
|
-
if (selectedDate instanceof Date && startOfDay$1(selectedDate).getTime() === startOfDay$1(date).getTime()) {
|
|
430
|
-
return true;
|
|
431
|
-
}
|
|
432
|
-
return false;
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
function isSelectable(minDate, maxDate, date) {
|
|
436
|
-
if (minDate && isBefore(date, minDate) || maxDate && isBefore(maxDate, date)) {
|
|
437
|
-
return false;
|
|
438
|
-
}
|
|
439
|
-
return true;
|
|
440
|
-
}
|
|
441
|
-
function isOffsetControlled(propOffset) {
|
|
442
|
-
return propOffset !== void 0;
|
|
443
|
-
}
|
|
444
|
-
function getOffset(prop, state) {
|
|
445
|
-
return isOffsetControlled(prop) ? prop : state;
|
|
446
|
-
}
|
|
447
|
-
function getDateProps(onDateSelected, _temp) {
|
|
448
|
-
var _ref = _temp === void 0 ? {} : _temp, onClick = _ref.onClick, _ref$dateObj = _ref.dateObj, dateObj = _ref$dateObj === void 0 ? requiredProp("getDateProps", "dateObj") : _ref$dateObj, rest = _objectWithoutPropertiesLoose(_ref, ["onClick", "dateObj"]);
|
|
449
|
-
return _extends({
|
|
450
|
-
onClick: composeEventHandlers(onClick, function(event) {
|
|
451
|
-
onDateSelected(dateObj, event);
|
|
452
|
-
}),
|
|
453
|
-
disabled: !dateObj.selectable,
|
|
454
|
-
"aria-label": dateObj.date.toDateString(),
|
|
455
|
-
"aria-pressed": dateObj.selected,
|
|
456
|
-
role: "button"
|
|
457
|
-
}, rest);
|
|
458
|
-
}
|
|
459
|
-
function getBackProps(_ref2, _temp2) {
|
|
460
|
-
var minDate = _ref2.minDate, offsetMonth = _ref2.offsetMonth, handleOffsetChanged = _ref2.handleOffsetChanged;
|
|
461
|
-
var _ref3 = _temp2 === void 0 ? {} : _temp2, onClick = _ref3.onClick, _ref3$offset = _ref3.offset, offset = _ref3$offset === void 0 ? 1 : _ref3$offset, _ref3$calendars = _ref3.calendars, calendars = _ref3$calendars === void 0 ? requiredProp("getBackProps", "calendars") : _ref3$calendars, rest = _objectWithoutPropertiesLoose(_ref3, ["onClick", "offset", "calendars"]);
|
|
462
|
-
return _extends({
|
|
463
|
-
onClick: composeEventHandlers(onClick, function() {
|
|
464
|
-
handleOffsetChanged(offsetMonth - subtractMonth({
|
|
465
|
-
calendars,
|
|
466
|
-
offset,
|
|
467
|
-
minDate
|
|
468
|
-
}));
|
|
469
|
-
}),
|
|
470
|
-
disabled: isBackDisabled({
|
|
471
|
-
calendars,
|
|
472
|
-
offset,
|
|
473
|
-
minDate
|
|
474
|
-
}),
|
|
475
|
-
"aria-label": "Go back " + offset + " month" + (offset === 1 ? "" : "s")
|
|
476
|
-
}, rest);
|
|
477
|
-
}
|
|
478
|
-
function getForwardProps(_ref4, _temp3) {
|
|
479
|
-
var maxDate = _ref4.maxDate, offsetMonth = _ref4.offsetMonth, handleOffsetChanged = _ref4.handleOffsetChanged;
|
|
480
|
-
var _ref5 = _temp3 === void 0 ? {} : _temp3, onClick = _ref5.onClick, _ref5$offset = _ref5.offset, offset = _ref5$offset === void 0 ? 1 : _ref5$offset, _ref5$calendars = _ref5.calendars, calendars = _ref5$calendars === void 0 ? requiredProp("getForwardProps", "calendars") : _ref5$calendars, rest = _objectWithoutPropertiesLoose(_ref5, ["onClick", "offset", "calendars"]);
|
|
481
|
-
return _extends({
|
|
482
|
-
onClick: composeEventHandlers(onClick, function() {
|
|
483
|
-
handleOffsetChanged(offsetMonth + addMonth({
|
|
484
|
-
calendars,
|
|
485
|
-
offset,
|
|
486
|
-
maxDate
|
|
487
|
-
}));
|
|
488
|
-
}),
|
|
489
|
-
disabled: isForwardDisabled({
|
|
490
|
-
calendars,
|
|
491
|
-
offset,
|
|
492
|
-
maxDate
|
|
493
|
-
}),
|
|
494
|
-
"aria-label": "Go forward " + offset + " month" + (offset === 1 ? "" : "s")
|
|
495
|
-
}, rest);
|
|
496
|
-
}
|
|
497
|
-
function useDayzed(_ref6) {
|
|
498
|
-
var _ref6$date = _ref6.date, date = _ref6$date === void 0 ? new Date() : _ref6$date, maxDate = _ref6.maxDate, minDate = _ref6.minDate, _ref6$monthsToDisplay = _ref6.monthsToDisplay, monthsToDisplay = _ref6$monthsToDisplay === void 0 ? 1 : _ref6$monthsToDisplay, _ref6$firstDayOfWeek = _ref6.firstDayOfWeek, firstDayOfWeek = _ref6$firstDayOfWeek === void 0 ? 0 : _ref6$firstDayOfWeek, _ref6$showOutsideDays = _ref6.showOutsideDays, showOutsideDays = _ref6$showOutsideDays === void 0 ? false : _ref6$showOutsideDays, offset = _ref6.offset, onDateSelected = _ref6.onDateSelected, _ref6$onOffsetChanged = _ref6.onOffsetChanged, onOffsetChanged = _ref6$onOffsetChanged === void 0 ? function() {
|
|
499
|
-
} : _ref6$onOffsetChanged, selected = _ref6.selected;
|
|
500
|
-
var _useState = require$$0.useState(0), stateOffset = _useState[0], setStateOffset = _useState[1];
|
|
501
|
-
var offsetMonth = getOffset(offset, stateOffset);
|
|
502
|
-
function handleOffsetChanged(newOffset) {
|
|
503
|
-
if (!isOffsetControlled(offset)) {
|
|
504
|
-
setStateOffset(newOffset);
|
|
505
|
-
}
|
|
506
|
-
onOffsetChanged(newOffset);
|
|
507
|
-
}
|
|
508
|
-
var calendars = getCalendars({
|
|
509
|
-
date,
|
|
510
|
-
selected,
|
|
511
|
-
monthsToDisplay,
|
|
512
|
-
minDate,
|
|
513
|
-
maxDate,
|
|
514
|
-
offset: offsetMonth,
|
|
515
|
-
firstDayOfWeek,
|
|
516
|
-
showOutsideDays
|
|
517
|
-
});
|
|
518
|
-
return {
|
|
519
|
-
calendars,
|
|
520
|
-
getDateProps: getDateProps.bind(null, onDateSelected),
|
|
521
|
-
getBackProps: getBackProps.bind(null, {
|
|
522
|
-
minDate,
|
|
523
|
-
offsetMonth,
|
|
524
|
-
handleOffsetChanged
|
|
525
|
-
}),
|
|
526
|
-
getForwardProps: getForwardProps.bind(null, {
|
|
527
|
-
maxDate,
|
|
528
|
-
offsetMonth,
|
|
529
|
-
handleOffsetChanged
|
|
530
|
-
})
|
|
531
|
-
};
|
|
532
|
-
}
|
|
533
|
-
({
|
|
534
|
-
render: PropTypes.func,
|
|
535
|
-
children: PropTypes.func,
|
|
536
|
-
date: PropTypes.instanceOf(Date),
|
|
537
|
-
maxDate: PropTypes.instanceOf(Date),
|
|
538
|
-
minDate: PropTypes.instanceOf(Date),
|
|
539
|
-
monthsToDisplay: PropTypes.number,
|
|
540
|
-
firstDayOfWeek: PropTypes.number,
|
|
541
|
-
showOutsideDays: PropTypes.bool,
|
|
542
|
-
offset: PropTypes.number,
|
|
543
|
-
onDateSelected: PropTypes.func.isRequired,
|
|
544
|
-
onOffsetChanged: PropTypes.func,
|
|
545
|
-
selected: PropTypes.oneOfType([PropTypes.arrayOf(Date), PropTypes.instanceOf(Date)])
|
|
546
|
-
});
|
|
547
43
|
function useCssVariables() {
|
|
548
44
|
const table = useTableContext();
|
|
549
45
|
return table.useState((state) => ({
|
|
@@ -558,8 +54,8 @@ function useCssVariables() {
|
|
|
558
54
|
}
|
|
559
55
|
const weekDays = [0, 1, 2, 3, 4, 5, 6];
|
|
560
56
|
const months = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
561
|
-
const startOfDay = (
|
|
562
|
-
const endOfDay = (
|
|
57
|
+
const startOfDay = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
58
|
+
const endOfDay = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate() + 1, 0, 0, 0, -1);
|
|
563
59
|
const today = () => {
|
|
564
60
|
const today2 = startOfDay(new Date());
|
|
565
61
|
return {
|
|
@@ -567,23 +63,23 @@ const today = () => {
|
|
|
567
63
|
max: today2
|
|
568
64
|
};
|
|
569
65
|
};
|
|
570
|
-
function dateIntersect(
|
|
571
|
-
if (
|
|
572
|
-
|
|
573
|
-
min:
|
|
574
|
-
max:
|
|
66
|
+
function dateIntersect(a, b) {
|
|
67
|
+
if (a instanceof Date) {
|
|
68
|
+
a = {
|
|
69
|
+
min: a,
|
|
70
|
+
max: a
|
|
575
71
|
};
|
|
576
72
|
}
|
|
577
|
-
if (
|
|
578
|
-
|
|
579
|
-
min:
|
|
580
|
-
max:
|
|
73
|
+
if (b instanceof Date) {
|
|
74
|
+
b = {
|
|
75
|
+
min: b,
|
|
76
|
+
max: b
|
|
581
77
|
};
|
|
582
78
|
}
|
|
583
|
-
if (!(
|
|
79
|
+
if (!(a == null ? void 0 : a.min) || !a.max || !(b == null ? void 0 : b.min) || !b.max) {
|
|
584
80
|
return false;
|
|
585
81
|
}
|
|
586
|
-
return !(endOfDay(
|
|
82
|
+
return !(endOfDay(a.max) < startOfDay(b.min) || startOfDay(a.min) > endOfDay(b.max));
|
|
587
83
|
}
|
|
588
84
|
function DatePicker({
|
|
589
85
|
value,
|
|
@@ -600,18 +96,18 @@ function DatePicker({
|
|
|
600
96
|
ChevronRight
|
|
601
97
|
}
|
|
602
98
|
} = useTheme();
|
|
603
|
-
const [baseDate] =
|
|
604
|
-
const [dateInView, setDateInView] =
|
|
605
|
-
const [currentMin, setCurrentMin] =
|
|
606
|
-
const [hovered, setHovered] =
|
|
99
|
+
const [baseDate] = react.useState(new Date());
|
|
100
|
+
const [dateInView, setDateInView] = react.useState(baseDate);
|
|
101
|
+
const [currentMin, setCurrentMin] = react.useState();
|
|
102
|
+
const [hovered, setHovered] = react.useState();
|
|
607
103
|
const min = currentMin != null ? currentMin : value instanceof Date ? value : value == null ? void 0 : value.min;
|
|
608
104
|
const max = currentMin ? void 0 : value instanceof Date ? value : value == null ? void 0 : value.max;
|
|
609
105
|
const {
|
|
610
106
|
calendars,
|
|
611
|
-
getBackProps
|
|
612
|
-
getForwardProps
|
|
613
|
-
getDateProps
|
|
614
|
-
} = useDayzed({
|
|
107
|
+
getBackProps,
|
|
108
|
+
getForwardProps,
|
|
109
|
+
getDateProps
|
|
110
|
+
} = dayzed.useDayzed({
|
|
615
111
|
onDateSelected: () => void 0,
|
|
616
112
|
firstDayOfWeek,
|
|
617
113
|
showOutsideDays: true,
|
|
@@ -619,7 +115,7 @@ function DatePicker({
|
|
|
619
115
|
onOffsetChanged: (offset) => setDateInView(new Date(dateInView.getFullYear(), dateInView.getMonth() + offset)),
|
|
620
116
|
offset: 0
|
|
621
117
|
});
|
|
622
|
-
const formatWeekday =
|
|
118
|
+
const formatWeekday = react.useMemo(() => {
|
|
623
119
|
const {
|
|
624
120
|
format
|
|
625
121
|
} = new Intl.DateTimeFormat(locale, {
|
|
@@ -627,14 +123,14 @@ function DatePicker({
|
|
|
627
123
|
});
|
|
628
124
|
return (weekDay) => format(new Date(Date.UTC(2021, 5, weekDay)));
|
|
629
125
|
}, [locale]);
|
|
630
|
-
|
|
631
|
-
return
|
|
126
|
+
react.useEffect(() => setDateInView(value === null ? new Date() : value instanceof Date ? value : value.max), [value]);
|
|
127
|
+
return jsxRuntime.jsx("div", {
|
|
632
128
|
children: calendars.map(({
|
|
633
129
|
month,
|
|
634
130
|
year,
|
|
635
131
|
weeks
|
|
636
|
-
}) =>
|
|
637
|
-
children: [
|
|
132
|
+
}) => jsxRuntime.jsxs("div", {
|
|
133
|
+
children: [jsxRuntime.jsxs("div", {
|
|
638
134
|
css: {
|
|
639
135
|
margin: "calc(var(--spacing) * 4) 0",
|
|
640
136
|
display: "grid",
|
|
@@ -642,38 +138,38 @@ function DatePicker({
|
|
|
642
138
|
justifyContent: "space-between",
|
|
643
139
|
alignItems: "center"
|
|
644
140
|
},
|
|
645
|
-
children: [
|
|
141
|
+
children: [jsxRuntime.jsx(IconButton, __spreadProps(__spreadValues({}, getBackProps({
|
|
646
142
|
calendars
|
|
647
143
|
})), {
|
|
648
|
-
children:
|
|
144
|
+
children: jsxRuntime.jsx(ChevronRight, {
|
|
649
145
|
css: {
|
|
650
146
|
transform: "rotate3d(0, 0, 1, 180deg)"
|
|
651
147
|
}
|
|
652
148
|
})
|
|
653
|
-
})),
|
|
149
|
+
})), jsxRuntime.jsxs("div", {
|
|
654
150
|
css: {
|
|
655
151
|
display: "flex"
|
|
656
152
|
},
|
|
657
|
-
children: [
|
|
153
|
+
children: [jsxRuntime.jsx(MonthSelector, {
|
|
658
154
|
value: month,
|
|
659
155
|
onChange: (month2) => setDateInView(new Date(year, month2)),
|
|
660
156
|
locale
|
|
661
|
-
}),
|
|
157
|
+
}), jsxRuntime.jsx(YearSelector, {
|
|
662
158
|
value: year,
|
|
663
159
|
onChange: (year2) => setDateInView(new Date(year2, month))
|
|
664
160
|
})]
|
|
665
|
-
}),
|
|
161
|
+
}), jsxRuntime.jsx(IconButton, __spreadProps(__spreadValues({}, getForwardProps({
|
|
666
162
|
calendars
|
|
667
163
|
})), {
|
|
668
|
-
children:
|
|
164
|
+
children: jsxRuntime.jsx(ChevronRight, {})
|
|
669
165
|
}))]
|
|
670
|
-
}),
|
|
166
|
+
}), jsxRuntime.jsxs("div", {
|
|
671
167
|
css: {
|
|
672
168
|
display: "grid",
|
|
673
169
|
gridTemplateColumns: "repeat(7, max-content)",
|
|
674
170
|
fontWeight: "bold"
|
|
675
171
|
},
|
|
676
|
-
children: [weekDays.map((_v, weekDay) =>
|
|
172
|
+
children: [weekDays.map((_v, weekDay) => jsxRuntime.jsx("div", {
|
|
677
173
|
css: {
|
|
678
174
|
justifySelf: "center",
|
|
679
175
|
marginBottom: "var(--spacing)"
|
|
@@ -681,7 +177,7 @@ function DatePicker({
|
|
|
681
177
|
children: formatWeekday(weekDay)
|
|
682
178
|
}, weekDay)), weeks.map((week, index) => week.map((dateObj, dayIndex) => {
|
|
683
179
|
if (!dateObj) {
|
|
684
|
-
return
|
|
180
|
+
return jsxRuntime.jsx("div", {});
|
|
685
181
|
}
|
|
686
182
|
const {
|
|
687
183
|
prevMonth,
|
|
@@ -700,7 +196,7 @@ function DatePicker({
|
|
|
700
196
|
min: hovered,
|
|
701
197
|
max: min
|
|
702
198
|
}));
|
|
703
|
-
return
|
|
199
|
+
return jsxRuntime.jsx("button", __spreadProps(__spreadValues({
|
|
704
200
|
css: [{
|
|
705
201
|
padding: 10,
|
|
706
202
|
border: "1px solid transparent",
|
|
@@ -717,7 +213,7 @@ function DatePicker({
|
|
|
717
213
|
background: "var(--primaryLight)",
|
|
718
214
|
color: "var(--primaryContrastText)"
|
|
719
215
|
}]
|
|
720
|
-
},
|
|
216
|
+
}, getDateProps({
|
|
721
217
|
dateObj
|
|
722
218
|
})), {
|
|
723
219
|
onClick: () => {
|
|
@@ -761,8 +257,8 @@ function MonthSelector({
|
|
|
761
257
|
}
|
|
762
258
|
} = useTheme();
|
|
763
259
|
const cssVariables = useCssVariables();
|
|
764
|
-
const [anchor, setAnchor] =
|
|
765
|
-
const formatMonth =
|
|
260
|
+
const [anchor, setAnchor] = react.useState();
|
|
261
|
+
const formatMonth = react.useMemo(() => {
|
|
766
262
|
const {
|
|
767
263
|
format
|
|
768
264
|
} = new Intl.DateTimeFormat(locale, {
|
|
@@ -770,27 +266,27 @@ function MonthSelector({
|
|
|
770
266
|
});
|
|
771
267
|
return (month) => format(new Date(2021, month));
|
|
772
268
|
}, [locale]);
|
|
773
|
-
return
|
|
774
|
-
children: [
|
|
269
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
270
|
+
children: [jsxRuntime.jsx("button", {
|
|
775
271
|
css: {
|
|
776
272
|
border: "none",
|
|
777
273
|
background: "transparent",
|
|
778
274
|
fontSize: "inherit",
|
|
779
275
|
cursor: "pointer"
|
|
780
276
|
},
|
|
781
|
-
onClick: (
|
|
277
|
+
onClick: (e) => setAnchor(e.currentTarget),
|
|
782
278
|
children: formatMonth(value)
|
|
783
|
-
}),
|
|
279
|
+
}), jsxRuntime.jsx(Popover, {
|
|
784
280
|
open: !!anchor,
|
|
785
281
|
anchorEl: anchor != null ? anchor : null,
|
|
786
282
|
onClose: () => setAnchor(void 0),
|
|
787
283
|
align: "center",
|
|
788
284
|
css: cssVariables,
|
|
789
|
-
children:
|
|
285
|
+
children: jsxRuntime.jsx("div", {
|
|
790
286
|
css: {
|
|
791
287
|
display: "grid"
|
|
792
288
|
},
|
|
793
|
-
children: months.map((month) =>
|
|
289
|
+
children: months.map((month) => jsxRuntime.jsx("button", {
|
|
794
290
|
css: [{
|
|
795
291
|
padding: "var(--spacing)",
|
|
796
292
|
border: "none",
|
|
@@ -813,12 +309,12 @@ function YearSelector({
|
|
|
813
309
|
onChange,
|
|
814
310
|
locale
|
|
815
311
|
}) {
|
|
816
|
-
const [input, setInput] =
|
|
312
|
+
const [input, setInput] = react.useState();
|
|
817
313
|
function apply() {
|
|
818
314
|
onChange(Number(input));
|
|
819
315
|
setInput(void 0);
|
|
820
316
|
}
|
|
821
|
-
const formatYear =
|
|
317
|
+
const formatYear = react.useMemo(() => {
|
|
822
318
|
const {
|
|
823
319
|
format
|
|
824
320
|
} = new Intl.DateTimeFormat(locale, {
|
|
@@ -827,46 +323,46 @@ function YearSelector({
|
|
|
827
323
|
return (year) => format(new Date(year, 0, 1));
|
|
828
324
|
}, [locale]);
|
|
829
325
|
if (input === void 0) {
|
|
830
|
-
return
|
|
326
|
+
return jsxRuntime.jsx("div", {
|
|
831
327
|
onClick: () => setInput(String(value)),
|
|
832
328
|
children: formatYear(value)
|
|
833
329
|
});
|
|
834
330
|
}
|
|
835
|
-
return
|
|
331
|
+
return jsxRuntime.jsx("input", {
|
|
836
332
|
css: {
|
|
837
333
|
width: "4ch"
|
|
838
334
|
},
|
|
839
335
|
value: input,
|
|
840
|
-
onChange: (
|
|
841
|
-
if (
|
|
842
|
-
setInput(
|
|
336
|
+
onChange: (e) => {
|
|
337
|
+
if (e.target.value.match(/^\d{0,4}$/)) {
|
|
338
|
+
setInput(e.target.value);
|
|
843
339
|
}
|
|
844
340
|
},
|
|
845
341
|
onBlur: apply,
|
|
846
|
-
onKeyPress: (
|
|
342
|
+
onKeyPress: (e) => e.key === "Enter" && apply()
|
|
847
343
|
});
|
|
848
344
|
}
|
|
849
|
-
function convertDate(
|
|
850
|
-
if (
|
|
851
|
-
return
|
|
852
|
-
if (typeof
|
|
853
|
-
return new Date(
|
|
345
|
+
function convertDate(x) {
|
|
346
|
+
if (x instanceof Date)
|
|
347
|
+
return x;
|
|
348
|
+
if (typeof x === "number" || typeof x === "string")
|
|
349
|
+
return new Date(x);
|
|
854
350
|
return null;
|
|
855
351
|
}
|
|
856
|
-
function convertDateOrRange(
|
|
857
|
-
if (
|
|
352
|
+
function convertDateOrRange(x) {
|
|
353
|
+
if (x instanceof Object && "min" in x && "max" in x) {
|
|
858
354
|
const range = {
|
|
859
|
-
min: convertDate(
|
|
860
|
-
max: convertDate(
|
|
355
|
+
min: convertDate(x.min),
|
|
356
|
+
max: convertDate(x.max)
|
|
861
357
|
};
|
|
862
358
|
return range.min && range.max ? range : null;
|
|
863
359
|
}
|
|
864
|
-
return convertDate(
|
|
360
|
+
return convertDate(x);
|
|
865
361
|
}
|
|
866
|
-
function convertDateOrArray(
|
|
867
|
-
if (
|
|
868
|
-
return
|
|
869
|
-
return convertDateOrRange(
|
|
362
|
+
function convertDateOrArray(x) {
|
|
363
|
+
if (x instanceof Array)
|
|
364
|
+
return x.map(convertDateOrRange).filter(Boolean);
|
|
365
|
+
return convertDateOrRange(x);
|
|
870
366
|
}
|
|
871
367
|
function DateFilter(_a) {
|
|
872
368
|
var _b = _a, {
|
|
@@ -899,7 +395,7 @@ function DateFilter(_a) {
|
|
|
899
395
|
return dateIntersect(filterValue, value2);
|
|
900
396
|
}
|
|
901
397
|
}));
|
|
902
|
-
const formatDate =
|
|
398
|
+
const formatDate = react.useMemo(() => {
|
|
903
399
|
const {
|
|
904
400
|
format
|
|
905
401
|
} = new Intl.DateTimeFormat(locale, {
|
|
@@ -907,14 +403,14 @@ function DateFilter(_a) {
|
|
|
907
403
|
});
|
|
908
404
|
return format;
|
|
909
405
|
}, [locale]);
|
|
910
|
-
return
|
|
406
|
+
return jsxRuntime.jsxs("div", {
|
|
911
407
|
css: {
|
|
912
408
|
padding: "calc(var(--spacing) * 2)",
|
|
913
409
|
display: "grid",
|
|
914
410
|
gap: "var(--spacing)",
|
|
915
411
|
justifyItems: "center"
|
|
916
412
|
},
|
|
917
|
-
children: [
|
|
413
|
+
children: [jsxRuntime.jsxs("div", {
|
|
918
414
|
css: {
|
|
919
415
|
marginBottom: "var(--spacing)",
|
|
920
416
|
display: "grid",
|
|
@@ -923,28 +419,28 @@ function DateFilter(_a) {
|
|
|
923
419
|
justifyContent: "space-between",
|
|
924
420
|
alignItems: "center"
|
|
925
421
|
},
|
|
926
|
-
children: [
|
|
422
|
+
children: [jsxRuntime.jsx("div", {
|
|
927
423
|
css: {
|
|
928
424
|
minWidth: "22ch"
|
|
929
425
|
},
|
|
930
426
|
children: !value ? text.dateFilter : value instanceof Date ? formatDate(value) : [formatDate(value.min), formatDate(value.max)].join(" - ")
|
|
931
|
-
}),
|
|
427
|
+
}), jsxRuntime.jsxs("div", {
|
|
932
428
|
css: {
|
|
933
429
|
display: "grid",
|
|
934
430
|
gridAutoFlow: "column",
|
|
935
431
|
gap: "var(--spacing)"
|
|
936
432
|
},
|
|
937
|
-
children: [
|
|
433
|
+
children: [jsxRuntime.jsx(Button, {
|
|
938
434
|
variant: "contained",
|
|
939
435
|
onClick: () => onChange(today()),
|
|
940
436
|
children: text.today
|
|
941
|
-
}),
|
|
437
|
+
}), jsxRuntime.jsx(Button, {
|
|
942
438
|
variant: "contained",
|
|
943
439
|
onClick: () => onChange(null),
|
|
944
440
|
children: text.reset
|
|
945
441
|
})]
|
|
946
442
|
})]
|
|
947
|
-
}),
|
|
443
|
+
}), jsxRuntime.jsx(DatePicker, {
|
|
948
444
|
rangeSelect: !singleSelect,
|
|
949
445
|
value,
|
|
950
446
|
onChange,
|
|
@@ -958,13 +454,13 @@ const flatMap = (arr, flatMap2) => {
|
|
|
958
454
|
};
|
|
959
455
|
const orderBy = (arr, selectors = [], direction = []) => {
|
|
960
456
|
if (selectors.length === 0)
|
|
961
|
-
selectors = [(
|
|
962
|
-
return [...arr].sort((
|
|
457
|
+
selectors = [(t) => t];
|
|
458
|
+
return [...arr].sort((a, b) => {
|
|
963
459
|
var _a, _b;
|
|
964
|
-
for (let
|
|
965
|
-
const _a2 = (_a = selectors[
|
|
966
|
-
const _b2 = (_b = selectors[
|
|
967
|
-
const dir = direction[
|
|
460
|
+
for (let i = 0; i < selectors.length; i++) {
|
|
461
|
+
const _a2 = (_a = selectors[i]) == null ? void 0 : _a.call(selectors, a);
|
|
462
|
+
const _b2 = (_b = selectors[i]) == null ? void 0 : _b.call(selectors, b);
|
|
463
|
+
const dir = direction[i] === "desc" ? -1 : 1;
|
|
968
464
|
if (_a2 > _b2)
|
|
969
465
|
return dir;
|
|
970
466
|
if (_a2 < _b2)
|
|
@@ -975,15 +471,15 @@ const orderBy = (arr, selectors = [], direction = []) => {
|
|
|
975
471
|
};
|
|
976
472
|
const uniq = (arr) => {
|
|
977
473
|
const set = /* @__PURE__ */ new Set();
|
|
978
|
-
for (const
|
|
979
|
-
set.add(
|
|
980
|
-
return
|
|
474
|
+
for (const t of arr)
|
|
475
|
+
set.add(t);
|
|
476
|
+
return Array.from(set);
|
|
981
477
|
};
|
|
982
|
-
const intersect = (
|
|
478
|
+
const intersect = (a, b) => {
|
|
983
479
|
const result = /* @__PURE__ */ new Set();
|
|
984
|
-
for (const
|
|
985
|
-
if (
|
|
986
|
-
result.add(
|
|
480
|
+
for (const x of a)
|
|
481
|
+
if (b.has(x))
|
|
482
|
+
result.add(x);
|
|
987
483
|
return result;
|
|
988
484
|
};
|
|
989
485
|
const getAncestors = (activeItemsById, ...items) => {
|
|
@@ -1011,24 +507,31 @@ const getDescendants = (...items) => {
|
|
|
1011
507
|
items.forEach(find);
|
|
1012
508
|
return result;
|
|
1013
509
|
};
|
|
1014
|
-
const asString = (
|
|
1015
|
-
if (
|
|
1016
|
-
return
|
|
1017
|
-
if (
|
|
1018
|
-
return JSON.stringify(
|
|
1019
|
-
return String(
|
|
510
|
+
const asString = (x) => {
|
|
511
|
+
if (x instanceof Array)
|
|
512
|
+
return x.map(asString).join(", ");
|
|
513
|
+
if (x instanceof Object)
|
|
514
|
+
return JSON.stringify(x);
|
|
515
|
+
return String(x != null ? x : "");
|
|
1020
516
|
};
|
|
1021
|
-
const asStringOrArray = (
|
|
1022
|
-
if (
|
|
1023
|
-
return
|
|
1024
|
-
return asString(
|
|
517
|
+
const asStringOrArray = (x) => {
|
|
518
|
+
if (x instanceof Array)
|
|
519
|
+
return x.map(asString);
|
|
520
|
+
return asString(x);
|
|
1025
521
|
};
|
|
1026
|
-
const castArray = (
|
|
522
|
+
const castArray = (a) => a instanceof Array ? a : [a];
|
|
523
|
+
const cx = (...classNames) => classNames.flatMap((entry) => {
|
|
524
|
+
if (!entry)
|
|
525
|
+
return [];
|
|
526
|
+
if (typeof entry === "string")
|
|
527
|
+
return [entry];
|
|
528
|
+
return Object.entries(entry).filter(([, predicate]) => predicate).map(([className]) => className);
|
|
529
|
+
}).join(" ");
|
|
1027
530
|
function FormControlLabel({
|
|
1028
531
|
control,
|
|
1029
532
|
label
|
|
1030
533
|
}) {
|
|
1031
|
-
return
|
|
534
|
+
return jsxRuntime.jsxs("label", {
|
|
1032
535
|
css: {
|
|
1033
536
|
display: "flex",
|
|
1034
537
|
alignItems: "center",
|
|
@@ -1038,7 +541,7 @@ function FormControlLabel({
|
|
|
1038
541
|
cursor: "pointer"
|
|
1039
542
|
}
|
|
1040
543
|
},
|
|
1041
|
-
children: [control,
|
|
544
|
+
children: [control, jsxRuntime.jsx("span", {
|
|
1042
545
|
css: {
|
|
1043
546
|
marginLeft: "var(--spacing)"
|
|
1044
547
|
},
|
|
@@ -1068,8 +571,8 @@ class Queue {
|
|
|
1068
571
|
try {
|
|
1069
572
|
const result = await next.job();
|
|
1070
573
|
next.resolve(result);
|
|
1071
|
-
} catch (
|
|
1072
|
-
next.reject(
|
|
574
|
+
} catch (e) {
|
|
575
|
+
next.reject(e);
|
|
1073
576
|
}
|
|
1074
577
|
}
|
|
1075
578
|
this.isRunning = false;
|
|
@@ -1091,7 +594,7 @@ function stringify(value) {
|
|
|
1091
594
|
return value2.map(prepare);
|
|
1092
595
|
}
|
|
1093
596
|
if (value2 instanceof Object) {
|
|
1094
|
-
return Object.fromEntries(Object.entries(value2).map(([
|
|
597
|
+
return Object.fromEntries(Object.entries(value2).map(([k, v]) => [k, prepare(v)]));
|
|
1095
598
|
}
|
|
1096
599
|
return value2;
|
|
1097
600
|
}
|
|
@@ -1113,8 +616,8 @@ function parse(value) {
|
|
|
1113
616
|
}
|
|
1114
617
|
function useTableStateStorage() {
|
|
1115
618
|
const table = useTableContext();
|
|
1116
|
-
const [isHydrated, setIsHydrated] =
|
|
1117
|
-
|
|
619
|
+
const [isHydrated, setIsHydrated] = react.useState(false);
|
|
620
|
+
react.useEffect(() => {
|
|
1118
621
|
const { persist } = table.getState().props;
|
|
1119
622
|
if (!persist) {
|
|
1120
623
|
setIsHydrated(true);
|
|
@@ -1149,8 +652,8 @@ function useTableStateStorage() {
|
|
|
1149
652
|
}
|
|
1150
653
|
}
|
|
1151
654
|
});
|
|
1152
|
-
} catch (
|
|
1153
|
-
console.error("Failed to load table state:",
|
|
655
|
+
} catch (e) {
|
|
656
|
+
console.error("Failed to load table state:", e);
|
|
1154
657
|
} finally {
|
|
1155
658
|
setIsHydrated(true);
|
|
1156
659
|
}
|
|
@@ -1159,10 +662,10 @@ function useTableStateStorage() {
|
|
|
1159
662
|
isCanceled = true;
|
|
1160
663
|
};
|
|
1161
664
|
}, []);
|
|
1162
|
-
|
|
665
|
+
react.useEffect(() => {
|
|
1163
666
|
if (!isHydrated)
|
|
1164
667
|
return;
|
|
1165
|
-
const
|
|
668
|
+
const q = new Queue();
|
|
1166
669
|
return table.subscribe((state) => {
|
|
1167
670
|
var _a, _b;
|
|
1168
671
|
if (!state.props.persist)
|
|
@@ -1190,1063 +693,15 @@ function useTableStateStorage() {
|
|
|
1190
693
|
return;
|
|
1191
694
|
const { storage, id, data } = props;
|
|
1192
695
|
(_b = (_a = table.getState().props).debug) == null ? void 0 : _b.call(_a, "save", data, stringify(data));
|
|
1193
|
-
|
|
696
|
+
q.run(async () => {
|
|
1194
697
|
await storage.setItem(`${id}_state`, stringify(data));
|
|
1195
698
|
}, true);
|
|
1196
699
|
}, { throttle: 1e3 });
|
|
1197
700
|
}, [isHydrated]);
|
|
1198
701
|
return isHydrated;
|
|
1199
702
|
}
|
|
1200
|
-
function n$2(n2) {
|
|
1201
|
-
for (var r2 = arguments.length, t2 = Array(r2 > 1 ? r2 - 1 : 0), e2 = 1; e2 < r2; e2++)
|
|
1202
|
-
t2[e2 - 1] = arguments[e2];
|
|
1203
|
-
throw Error("[Immer] minified error nr: " + n2 + (t2.length ? " " + t2.map(function(n3) {
|
|
1204
|
-
return "'" + n3 + "'";
|
|
1205
|
-
}).join(",") : "") + ". Find the full error at: https://bit.ly/3cXEKWf");
|
|
1206
|
-
}
|
|
1207
|
-
function r$2(n2) {
|
|
1208
|
-
return !!n2 && !!n2[Q];
|
|
1209
|
-
}
|
|
1210
|
-
function t$2(n2) {
|
|
1211
|
-
return !!n2 && (function(n3) {
|
|
1212
|
-
if (!n3 || typeof n3 != "object")
|
|
1213
|
-
return false;
|
|
1214
|
-
var r2 = Object.getPrototypeOf(n3);
|
|
1215
|
-
if (r2 === null)
|
|
1216
|
-
return true;
|
|
1217
|
-
var t2 = Object.hasOwnProperty.call(r2, "constructor") && r2.constructor;
|
|
1218
|
-
return t2 === Object || typeof t2 == "function" && Function.toString.call(t2) === Z;
|
|
1219
|
-
}(n2) || Array.isArray(n2) || !!n2[L] || !!n2.constructor[L] || s(n2) || v$1(n2));
|
|
1220
|
-
}
|
|
1221
|
-
function i(n2, r2, t2) {
|
|
1222
|
-
t2 === void 0 && (t2 = false), o(n2) === 0 ? (t2 ? Object.keys : nn)(n2).forEach(function(e2) {
|
|
1223
|
-
t2 && typeof e2 == "symbol" || r2(e2, n2[e2], n2);
|
|
1224
|
-
}) : n2.forEach(function(t3, e2) {
|
|
1225
|
-
return r2(e2, t3, n2);
|
|
1226
|
-
});
|
|
1227
|
-
}
|
|
1228
|
-
function o(n2) {
|
|
1229
|
-
var r2 = n2[Q];
|
|
1230
|
-
return r2 ? r2.i > 3 ? r2.i - 4 : r2.i : Array.isArray(n2) ? 1 : s(n2) ? 2 : v$1(n2) ? 3 : 0;
|
|
1231
|
-
}
|
|
1232
|
-
function u$2(n2, r2) {
|
|
1233
|
-
return o(n2) === 2 ? n2.has(r2) : Object.prototype.hasOwnProperty.call(n2, r2);
|
|
1234
|
-
}
|
|
1235
|
-
function a(n2, r2) {
|
|
1236
|
-
return o(n2) === 2 ? n2.get(r2) : n2[r2];
|
|
1237
|
-
}
|
|
1238
|
-
function f(n2, r2, t2) {
|
|
1239
|
-
var e2 = o(n2);
|
|
1240
|
-
e2 === 2 ? n2.set(r2, t2) : e2 === 3 ? (n2.delete(r2), n2.add(t2)) : n2[r2] = t2;
|
|
1241
|
-
}
|
|
1242
|
-
function c(n2, r2) {
|
|
1243
|
-
return n2 === r2 ? n2 !== 0 || 1 / n2 == 1 / r2 : n2 != n2 && r2 != r2;
|
|
1244
|
-
}
|
|
1245
|
-
function s(n2) {
|
|
1246
|
-
return X && n2 instanceof Map;
|
|
1247
|
-
}
|
|
1248
|
-
function v$1(n2) {
|
|
1249
|
-
return q$2 && n2 instanceof Set;
|
|
1250
|
-
}
|
|
1251
|
-
function p$2(n2) {
|
|
1252
|
-
return n2.o || n2.t;
|
|
1253
|
-
}
|
|
1254
|
-
function l$1(n2) {
|
|
1255
|
-
if (Array.isArray(n2))
|
|
1256
|
-
return Array.prototype.slice.call(n2);
|
|
1257
|
-
var r2 = rn(n2);
|
|
1258
|
-
delete r2[Q];
|
|
1259
|
-
for (var t2 = nn(r2), e2 = 0; e2 < t2.length; e2++) {
|
|
1260
|
-
var i2 = t2[e2], o2 = r2[i2];
|
|
1261
|
-
o2.writable === false && (o2.writable = true, o2.configurable = true), (o2.get || o2.set) && (r2[i2] = { configurable: true, writable: true, enumerable: o2.enumerable, value: n2[i2] });
|
|
1262
|
-
}
|
|
1263
|
-
return Object.create(Object.getPrototypeOf(n2), r2);
|
|
1264
|
-
}
|
|
1265
|
-
function d(n2, e2) {
|
|
1266
|
-
return e2 === void 0 && (e2 = false), y(n2) || r$2(n2) || !t$2(n2) ? n2 : (o(n2) > 1 && (n2.set = n2.add = n2.clear = n2.delete = h$2), Object.freeze(n2), e2 && i(n2, function(n3, r2) {
|
|
1267
|
-
return d(r2, true);
|
|
1268
|
-
}, true), n2);
|
|
1269
|
-
}
|
|
1270
|
-
function h$2() {
|
|
1271
|
-
n$2(2);
|
|
1272
|
-
}
|
|
1273
|
-
function y(n2) {
|
|
1274
|
-
return n2 == null || typeof n2 != "object" || Object.isFrozen(n2);
|
|
1275
|
-
}
|
|
1276
|
-
function b(r2) {
|
|
1277
|
-
var t2 = tn[r2];
|
|
1278
|
-
return t2 || n$2(18, r2), t2;
|
|
1279
|
-
}
|
|
1280
|
-
function m$1(n2, r2) {
|
|
1281
|
-
tn[n2] || (tn[n2] = r2);
|
|
1282
|
-
}
|
|
1283
|
-
function _() {
|
|
1284
|
-
return U;
|
|
1285
|
-
}
|
|
1286
|
-
function j(n2, r2) {
|
|
1287
|
-
r2 && (b("Patches"), n2.u = [], n2.s = [], n2.v = r2);
|
|
1288
|
-
}
|
|
1289
|
-
function O(n2) {
|
|
1290
|
-
g(n2), n2.p.forEach(S), n2.p = null;
|
|
1291
|
-
}
|
|
1292
|
-
function g(n2) {
|
|
1293
|
-
n2 === U && (U = n2.l);
|
|
1294
|
-
}
|
|
1295
|
-
function w$1(n2) {
|
|
1296
|
-
return U = { p: [], l: U, h: n2, m: true, _: 0 };
|
|
1297
|
-
}
|
|
1298
|
-
function S(n2) {
|
|
1299
|
-
var r2 = n2[Q];
|
|
1300
|
-
r2.i === 0 || r2.i === 1 ? r2.j() : r2.O = true;
|
|
1301
|
-
}
|
|
1302
|
-
function P(r2, e2) {
|
|
1303
|
-
e2._ = e2.p.length;
|
|
1304
|
-
var i2 = e2.p[0], o2 = r2 !== void 0 && r2 !== i2;
|
|
1305
|
-
return e2.h.g || b("ES5").S(e2, r2, o2), o2 ? (i2[Q].P && (O(e2), n$2(4)), t$2(r2) && (r2 = M(e2, r2), e2.l || x(e2, r2)), e2.u && b("Patches").M(i2[Q].t, r2, e2.u, e2.s)) : r2 = M(e2, i2, []), O(e2), e2.u && e2.v(e2.u, e2.s), r2 !== H ? r2 : void 0;
|
|
1306
|
-
}
|
|
1307
|
-
function M(n2, r2, t2) {
|
|
1308
|
-
if (y(r2))
|
|
1309
|
-
return r2;
|
|
1310
|
-
var e2 = r2[Q];
|
|
1311
|
-
if (!e2)
|
|
1312
|
-
return i(r2, function(i2, o3) {
|
|
1313
|
-
return A(n2, e2, r2, i2, o3, t2);
|
|
1314
|
-
}, true), r2;
|
|
1315
|
-
if (e2.A !== n2)
|
|
1316
|
-
return r2;
|
|
1317
|
-
if (!e2.P)
|
|
1318
|
-
return x(n2, e2.t, true), e2.t;
|
|
1319
|
-
if (!e2.I) {
|
|
1320
|
-
e2.I = true, e2.A._--;
|
|
1321
|
-
var o2 = e2.i === 4 || e2.i === 5 ? e2.o = l$1(e2.k) : e2.o;
|
|
1322
|
-
i(e2.i === 3 ? new Set(o2) : o2, function(r3, i2) {
|
|
1323
|
-
return A(n2, e2, o2, r3, i2, t2);
|
|
1324
|
-
}), x(n2, o2, false), t2 && n2.u && b("Patches").R(e2, t2, n2.u, n2.s);
|
|
1325
|
-
}
|
|
1326
|
-
return e2.o;
|
|
1327
|
-
}
|
|
1328
|
-
function A(e2, i2, o2, a2, c2, s2) {
|
|
1329
|
-
if (r$2(c2)) {
|
|
1330
|
-
var v2 = M(e2, c2, s2 && i2 && i2.i !== 3 && !u$2(i2.D, a2) ? s2.concat(a2) : void 0);
|
|
1331
|
-
if (f(o2, a2, v2), !r$2(v2))
|
|
1332
|
-
return;
|
|
1333
|
-
e2.m = false;
|
|
1334
|
-
}
|
|
1335
|
-
if (t$2(c2) && !y(c2)) {
|
|
1336
|
-
if (!e2.h.F && e2._ < 1)
|
|
1337
|
-
return;
|
|
1338
|
-
M(e2, c2), i2 && i2.A.l || x(e2, c2);
|
|
1339
|
-
}
|
|
1340
|
-
}
|
|
1341
|
-
function x(n2, r2, t2) {
|
|
1342
|
-
t2 === void 0 && (t2 = false), n2.h.F && n2.m && d(r2, t2);
|
|
1343
|
-
}
|
|
1344
|
-
function z(n2, r2) {
|
|
1345
|
-
var t2 = n2[Q];
|
|
1346
|
-
return (t2 ? p$2(t2) : n2)[r2];
|
|
1347
|
-
}
|
|
1348
|
-
function I(n2, r2) {
|
|
1349
|
-
if (r2 in n2)
|
|
1350
|
-
for (var t2 = Object.getPrototypeOf(n2); t2; ) {
|
|
1351
|
-
var e2 = Object.getOwnPropertyDescriptor(t2, r2);
|
|
1352
|
-
if (e2)
|
|
1353
|
-
return e2;
|
|
1354
|
-
t2 = Object.getPrototypeOf(t2);
|
|
1355
|
-
}
|
|
1356
|
-
}
|
|
1357
|
-
function k$1(n2) {
|
|
1358
|
-
n2.P || (n2.P = true, n2.l && k$1(n2.l));
|
|
1359
|
-
}
|
|
1360
|
-
function E(n2) {
|
|
1361
|
-
n2.o || (n2.o = l$1(n2.t));
|
|
1362
|
-
}
|
|
1363
|
-
function R(n2, r2, t2) {
|
|
1364
|
-
var e2 = s(r2) ? b("MapSet").N(r2, t2) : v$1(r2) ? b("MapSet").T(r2, t2) : n2.g ? function(n3, r3) {
|
|
1365
|
-
var t3 = Array.isArray(n3), e3 = { i: t3 ? 1 : 0, A: r3 ? r3.A : _(), P: false, I: false, D: {}, l: r3, t: n3, k: null, o: null, j: null, C: false }, i2 = e3, o2 = en;
|
|
1366
|
-
t3 && (i2 = [e3], o2 = on);
|
|
1367
|
-
var u2 = Proxy.revocable(i2, o2), a2 = u2.revoke, f2 = u2.proxy;
|
|
1368
|
-
return e3.k = f2, e3.j = a2, f2;
|
|
1369
|
-
}(r2, t2) : b("ES5").J(r2, t2);
|
|
1370
|
-
return (t2 ? t2.A : _()).p.push(e2), e2;
|
|
1371
|
-
}
|
|
1372
|
-
function D(e2) {
|
|
1373
|
-
return r$2(e2) || n$2(22, e2), function n2(r2) {
|
|
1374
|
-
if (!t$2(r2))
|
|
1375
|
-
return r2;
|
|
1376
|
-
var e3, u2 = r2[Q], c2 = o(r2);
|
|
1377
|
-
if (u2) {
|
|
1378
|
-
if (!u2.P && (u2.i < 4 || !b("ES5").K(u2)))
|
|
1379
|
-
return u2.t;
|
|
1380
|
-
u2.I = true, e3 = F(r2, c2), u2.I = false;
|
|
1381
|
-
} else
|
|
1382
|
-
e3 = F(r2, c2);
|
|
1383
|
-
return i(e3, function(r3, t2) {
|
|
1384
|
-
u2 && a(u2.t, r3) === t2 || f(e3, r3, n2(t2));
|
|
1385
|
-
}), c2 === 3 ? new Set(e3) : e3;
|
|
1386
|
-
}(e2);
|
|
1387
|
-
}
|
|
1388
|
-
function F(n2, r2) {
|
|
1389
|
-
switch (r2) {
|
|
1390
|
-
case 2:
|
|
1391
|
-
return new Map(n2);
|
|
1392
|
-
case 3:
|
|
1393
|
-
return Array.from(n2);
|
|
1394
|
-
}
|
|
1395
|
-
return l$1(n2);
|
|
1396
|
-
}
|
|
1397
|
-
function T() {
|
|
1398
|
-
function e2(n2) {
|
|
1399
|
-
if (!t$2(n2))
|
|
1400
|
-
return n2;
|
|
1401
|
-
if (Array.isArray(n2))
|
|
1402
|
-
return n2.map(e2);
|
|
1403
|
-
if (s(n2))
|
|
1404
|
-
return new Map(Array.from(n2.entries()).map(function(n3) {
|
|
1405
|
-
return [n3[0], e2(n3[1])];
|
|
1406
|
-
}));
|
|
1407
|
-
if (v$1(n2))
|
|
1408
|
-
return new Set(Array.from(n2).map(e2));
|
|
1409
|
-
var r2 = Object.create(Object.getPrototypeOf(n2));
|
|
1410
|
-
for (var i2 in n2)
|
|
1411
|
-
r2[i2] = e2(n2[i2]);
|
|
1412
|
-
return u$2(n2, L) && (r2[L] = n2[L]), r2;
|
|
1413
|
-
}
|
|
1414
|
-
function f2(n2) {
|
|
1415
|
-
return r$2(n2) ? e2(n2) : n2;
|
|
1416
|
-
}
|
|
1417
|
-
var c2 = "add";
|
|
1418
|
-
m$1("Patches", { $: function(r2, t2) {
|
|
1419
|
-
return t2.forEach(function(t3) {
|
|
1420
|
-
for (var i2 = t3.path, u2 = t3.op, f3 = r2, s2 = 0; s2 < i2.length - 1; s2++) {
|
|
1421
|
-
var v2 = o(f3), p2 = "" + i2[s2];
|
|
1422
|
-
v2 !== 0 && v2 !== 1 || p2 !== "__proto__" && p2 !== "constructor" || n$2(24), typeof f3 == "function" && p2 === "prototype" && n$2(24), typeof (f3 = a(f3, p2)) != "object" && n$2(15, i2.join("/"));
|
|
1423
|
-
}
|
|
1424
|
-
var l2 = o(f3), d2 = e2(t3.value), h2 = i2[i2.length - 1];
|
|
1425
|
-
switch (u2) {
|
|
1426
|
-
case "replace":
|
|
1427
|
-
switch (l2) {
|
|
1428
|
-
case 2:
|
|
1429
|
-
return f3.set(h2, d2);
|
|
1430
|
-
case 3:
|
|
1431
|
-
n$2(16);
|
|
1432
|
-
default:
|
|
1433
|
-
return f3[h2] = d2;
|
|
1434
|
-
}
|
|
1435
|
-
case c2:
|
|
1436
|
-
switch (l2) {
|
|
1437
|
-
case 1:
|
|
1438
|
-
return h2 === "-" ? f3.push(d2) : f3.splice(h2, 0, d2);
|
|
1439
|
-
case 2:
|
|
1440
|
-
return f3.set(h2, d2);
|
|
1441
|
-
case 3:
|
|
1442
|
-
return f3.add(d2);
|
|
1443
|
-
default:
|
|
1444
|
-
return f3[h2] = d2;
|
|
1445
|
-
}
|
|
1446
|
-
case "remove":
|
|
1447
|
-
switch (l2) {
|
|
1448
|
-
case 1:
|
|
1449
|
-
return f3.splice(h2, 1);
|
|
1450
|
-
case 2:
|
|
1451
|
-
return f3.delete(h2);
|
|
1452
|
-
case 3:
|
|
1453
|
-
return f3.delete(t3.value);
|
|
1454
|
-
default:
|
|
1455
|
-
return delete f3[h2];
|
|
1456
|
-
}
|
|
1457
|
-
default:
|
|
1458
|
-
n$2(17, u2);
|
|
1459
|
-
}
|
|
1460
|
-
}), r2;
|
|
1461
|
-
}, R: function(n2, r2, t2, e3) {
|
|
1462
|
-
switch (n2.i) {
|
|
1463
|
-
case 0:
|
|
1464
|
-
case 4:
|
|
1465
|
-
case 2:
|
|
1466
|
-
return function(n3, r3, t3, e4) {
|
|
1467
|
-
var o2 = n3.t, s2 = n3.o;
|
|
1468
|
-
i(n3.D, function(n4, i2) {
|
|
1469
|
-
var v2 = a(o2, n4), p2 = a(s2, n4), l2 = i2 ? u$2(o2, n4) ? "replace" : c2 : "remove";
|
|
1470
|
-
if (v2 !== p2 || l2 !== "replace") {
|
|
1471
|
-
var d2 = r3.concat(n4);
|
|
1472
|
-
t3.push(l2 === "remove" ? { op: l2, path: d2 } : { op: l2, path: d2, value: p2 }), e4.push(l2 === c2 ? { op: "remove", path: d2 } : l2 === "remove" ? { op: c2, path: d2, value: f2(v2) } : { op: "replace", path: d2, value: f2(v2) });
|
|
1473
|
-
}
|
|
1474
|
-
});
|
|
1475
|
-
}(n2, r2, t2, e3);
|
|
1476
|
-
case 5:
|
|
1477
|
-
case 1:
|
|
1478
|
-
return function(n3, r3, t3, e4) {
|
|
1479
|
-
var i2 = n3.t, o2 = n3.D, u2 = n3.o;
|
|
1480
|
-
if (u2.length < i2.length) {
|
|
1481
|
-
var a2 = [u2, i2];
|
|
1482
|
-
i2 = a2[0], u2 = a2[1];
|
|
1483
|
-
var s2 = [e4, t3];
|
|
1484
|
-
t3 = s2[0], e4 = s2[1];
|
|
1485
|
-
}
|
|
1486
|
-
for (var v2 = 0; v2 < i2.length; v2++)
|
|
1487
|
-
if (o2[v2] && u2[v2] !== i2[v2]) {
|
|
1488
|
-
var p2 = r3.concat([v2]);
|
|
1489
|
-
t3.push({ op: "replace", path: p2, value: f2(u2[v2]) }), e4.push({ op: "replace", path: p2, value: f2(i2[v2]) });
|
|
1490
|
-
}
|
|
1491
|
-
for (var l2 = i2.length; l2 < u2.length; l2++) {
|
|
1492
|
-
var d2 = r3.concat([l2]);
|
|
1493
|
-
t3.push({ op: c2, path: d2, value: f2(u2[l2]) });
|
|
1494
|
-
}
|
|
1495
|
-
i2.length < u2.length && e4.push({ op: "replace", path: r3.concat(["length"]), value: i2.length });
|
|
1496
|
-
}(n2, r2, t2, e3);
|
|
1497
|
-
case 3:
|
|
1498
|
-
return function(n3, r3, t3, e4) {
|
|
1499
|
-
var i2 = n3.t, o2 = n3.o, u2 = 0;
|
|
1500
|
-
i2.forEach(function(n4) {
|
|
1501
|
-
if (!o2.has(n4)) {
|
|
1502
|
-
var i3 = r3.concat([u2]);
|
|
1503
|
-
t3.push({ op: "remove", path: i3, value: n4 }), e4.unshift({ op: c2, path: i3, value: n4 });
|
|
1504
|
-
}
|
|
1505
|
-
u2++;
|
|
1506
|
-
}), u2 = 0, o2.forEach(function(n4) {
|
|
1507
|
-
if (!i2.has(n4)) {
|
|
1508
|
-
var o3 = r3.concat([u2]);
|
|
1509
|
-
t3.push({ op: c2, path: o3, value: n4 }), e4.unshift({ op: "remove", path: o3, value: n4 });
|
|
1510
|
-
}
|
|
1511
|
-
u2++;
|
|
1512
|
-
});
|
|
1513
|
-
}(n2, r2, t2, e3);
|
|
1514
|
-
}
|
|
1515
|
-
}, M: function(n2, r2, t2, e3) {
|
|
1516
|
-
t2.push({ op: "replace", path: [], value: r2 === H ? void 0 : r2 }), e3.push({ op: "replace", path: [], value: n2 });
|
|
1517
|
-
} });
|
|
1518
|
-
}
|
|
1519
|
-
function C() {
|
|
1520
|
-
function r2(n2, r3) {
|
|
1521
|
-
function t2() {
|
|
1522
|
-
this.constructor = n2;
|
|
1523
|
-
}
|
|
1524
|
-
a2(n2, r3), n2.prototype = (t2.prototype = r3.prototype, new t2());
|
|
1525
|
-
}
|
|
1526
|
-
function e2(n2) {
|
|
1527
|
-
n2.o || (n2.D = /* @__PURE__ */ new Map(), n2.o = new Map(n2.t));
|
|
1528
|
-
}
|
|
1529
|
-
function o2(n2) {
|
|
1530
|
-
n2.o || (n2.o = /* @__PURE__ */ new Set(), n2.t.forEach(function(r3) {
|
|
1531
|
-
if (t$2(r3)) {
|
|
1532
|
-
var e3 = R(n2.A.h, r3, n2);
|
|
1533
|
-
n2.p.set(r3, e3), n2.o.add(e3);
|
|
1534
|
-
} else
|
|
1535
|
-
n2.o.add(r3);
|
|
1536
|
-
}));
|
|
1537
|
-
}
|
|
1538
|
-
function u2(r3) {
|
|
1539
|
-
r3.O && n$2(3, JSON.stringify(p$2(r3)));
|
|
1540
|
-
}
|
|
1541
|
-
var a2 = function(n2, r3) {
|
|
1542
|
-
return (a2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n3, r4) {
|
|
1543
|
-
n3.__proto__ = r4;
|
|
1544
|
-
} || function(n3, r4) {
|
|
1545
|
-
for (var t2 in r4)
|
|
1546
|
-
r4.hasOwnProperty(t2) && (n3[t2] = r4[t2]);
|
|
1547
|
-
})(n2, r3);
|
|
1548
|
-
}, f2 = function() {
|
|
1549
|
-
function n2(n3, r3) {
|
|
1550
|
-
return this[Q] = { i: 2, l: r3, A: r3 ? r3.A : _(), P: false, I: false, o: void 0, D: void 0, t: n3, k: this, C: false, O: false }, this;
|
|
1551
|
-
}
|
|
1552
|
-
r2(n2, Map);
|
|
1553
|
-
var o3 = n2.prototype;
|
|
1554
|
-
return Object.defineProperty(o3, "size", { get: function() {
|
|
1555
|
-
return p$2(this[Q]).size;
|
|
1556
|
-
} }), o3.has = function(n3) {
|
|
1557
|
-
return p$2(this[Q]).has(n3);
|
|
1558
|
-
}, o3.set = function(n3, r3) {
|
|
1559
|
-
var t2 = this[Q];
|
|
1560
|
-
return u2(t2), p$2(t2).has(n3) && p$2(t2).get(n3) === r3 || (e2(t2), k$1(t2), t2.D.set(n3, true), t2.o.set(n3, r3), t2.D.set(n3, true)), this;
|
|
1561
|
-
}, o3.delete = function(n3) {
|
|
1562
|
-
if (!this.has(n3))
|
|
1563
|
-
return false;
|
|
1564
|
-
var r3 = this[Q];
|
|
1565
|
-
return u2(r3), e2(r3), k$1(r3), r3.t.has(n3) ? r3.D.set(n3, false) : r3.D.delete(n3), r3.o.delete(n3), true;
|
|
1566
|
-
}, o3.clear = function() {
|
|
1567
|
-
var n3 = this[Q];
|
|
1568
|
-
u2(n3), p$2(n3).size && (e2(n3), k$1(n3), n3.D = /* @__PURE__ */ new Map(), i(n3.t, function(r3) {
|
|
1569
|
-
n3.D.set(r3, false);
|
|
1570
|
-
}), n3.o.clear());
|
|
1571
|
-
}, o3.forEach = function(n3, r3) {
|
|
1572
|
-
var t2 = this;
|
|
1573
|
-
p$2(this[Q]).forEach(function(e3, i2) {
|
|
1574
|
-
n3.call(r3, t2.get(i2), i2, t2);
|
|
1575
|
-
});
|
|
1576
|
-
}, o3.get = function(n3) {
|
|
1577
|
-
var r3 = this[Q];
|
|
1578
|
-
u2(r3);
|
|
1579
|
-
var i2 = p$2(r3).get(n3);
|
|
1580
|
-
if (r3.I || !t$2(i2))
|
|
1581
|
-
return i2;
|
|
1582
|
-
if (i2 !== r3.t.get(n3))
|
|
1583
|
-
return i2;
|
|
1584
|
-
var o4 = R(r3.A.h, i2, r3);
|
|
1585
|
-
return e2(r3), r3.o.set(n3, o4), o4;
|
|
1586
|
-
}, o3.keys = function() {
|
|
1587
|
-
return p$2(this[Q]).keys();
|
|
1588
|
-
}, o3.values = function() {
|
|
1589
|
-
var n3, r3 = this, t2 = this.keys();
|
|
1590
|
-
return (n3 = {})[V] = function() {
|
|
1591
|
-
return r3.values();
|
|
1592
|
-
}, n3.next = function() {
|
|
1593
|
-
var n4 = t2.next();
|
|
1594
|
-
return n4.done ? n4 : { done: false, value: r3.get(n4.value) };
|
|
1595
|
-
}, n3;
|
|
1596
|
-
}, o3.entries = function() {
|
|
1597
|
-
var n3, r3 = this, t2 = this.keys();
|
|
1598
|
-
return (n3 = {})[V] = function() {
|
|
1599
|
-
return r3.entries();
|
|
1600
|
-
}, n3.next = function() {
|
|
1601
|
-
var n4 = t2.next();
|
|
1602
|
-
if (n4.done)
|
|
1603
|
-
return n4;
|
|
1604
|
-
var e3 = r3.get(n4.value);
|
|
1605
|
-
return { done: false, value: [n4.value, e3] };
|
|
1606
|
-
}, n3;
|
|
1607
|
-
}, o3[V] = function() {
|
|
1608
|
-
return this.entries();
|
|
1609
|
-
}, n2;
|
|
1610
|
-
}(), c2 = function() {
|
|
1611
|
-
function n2(n3, r3) {
|
|
1612
|
-
return this[Q] = { i: 3, l: r3, A: r3 ? r3.A : _(), P: false, I: false, o: void 0, t: n3, k: this, p: /* @__PURE__ */ new Map(), O: false, C: false }, this;
|
|
1613
|
-
}
|
|
1614
|
-
r2(n2, Set);
|
|
1615
|
-
var t2 = n2.prototype;
|
|
1616
|
-
return Object.defineProperty(t2, "size", { get: function() {
|
|
1617
|
-
return p$2(this[Q]).size;
|
|
1618
|
-
} }), t2.has = function(n3) {
|
|
1619
|
-
var r3 = this[Q];
|
|
1620
|
-
return u2(r3), r3.o ? !!r3.o.has(n3) || !(!r3.p.has(n3) || !r3.o.has(r3.p.get(n3))) : r3.t.has(n3);
|
|
1621
|
-
}, t2.add = function(n3) {
|
|
1622
|
-
var r3 = this[Q];
|
|
1623
|
-
return u2(r3), this.has(n3) || (o2(r3), k$1(r3), r3.o.add(n3)), this;
|
|
1624
|
-
}, t2.delete = function(n3) {
|
|
1625
|
-
if (!this.has(n3))
|
|
1626
|
-
return false;
|
|
1627
|
-
var r3 = this[Q];
|
|
1628
|
-
return u2(r3), o2(r3), k$1(r3), r3.o.delete(n3) || !!r3.p.has(n3) && r3.o.delete(r3.p.get(n3));
|
|
1629
|
-
}, t2.clear = function() {
|
|
1630
|
-
var n3 = this[Q];
|
|
1631
|
-
u2(n3), p$2(n3).size && (o2(n3), k$1(n3), n3.o.clear());
|
|
1632
|
-
}, t2.values = function() {
|
|
1633
|
-
var n3 = this[Q];
|
|
1634
|
-
return u2(n3), o2(n3), n3.o.values();
|
|
1635
|
-
}, t2.entries = function() {
|
|
1636
|
-
var n3 = this[Q];
|
|
1637
|
-
return u2(n3), o2(n3), n3.o.entries();
|
|
1638
|
-
}, t2.keys = function() {
|
|
1639
|
-
return this.values();
|
|
1640
|
-
}, t2[V] = function() {
|
|
1641
|
-
return this.values();
|
|
1642
|
-
}, t2.forEach = function(n3, r3) {
|
|
1643
|
-
for (var t3 = this.values(), e3 = t3.next(); !e3.done; )
|
|
1644
|
-
n3.call(r3, e3.value, e3.value, this), e3 = t3.next();
|
|
1645
|
-
}, n2;
|
|
1646
|
-
}();
|
|
1647
|
-
m$1("MapSet", { N: function(n2, r3) {
|
|
1648
|
-
return new f2(n2, r3);
|
|
1649
|
-
}, T: function(n2, r3) {
|
|
1650
|
-
return new c2(n2, r3);
|
|
1651
|
-
} });
|
|
1652
|
-
}
|
|
1653
|
-
function K(n2) {
|
|
1654
|
-
return n2;
|
|
1655
|
-
}
|
|
1656
|
-
var G, U, W = typeof Symbol != "undefined" && typeof Symbol("x") == "symbol", X = typeof Map != "undefined", q$2 = typeof Set != "undefined", B = typeof Proxy != "undefined" && Proxy.revocable !== void 0 && typeof Reflect != "undefined", H = W ? Symbol.for("immer-nothing") : ((G = {})["immer-nothing"] = true, G), L = W ? Symbol.for("immer-draftable") : "__$immer_draftable", Q = W ? Symbol.for("immer-state") : "__$immer_state", V = typeof Symbol != "undefined" && Symbol.iterator || "@@iterator", Z = "" + Object.prototype.constructor, nn = typeof Reflect != "undefined" && Reflect.ownKeys ? Reflect.ownKeys : Object.getOwnPropertySymbols !== void 0 ? function(n2) {
|
|
1657
|
-
return Object.getOwnPropertyNames(n2).concat(Object.getOwnPropertySymbols(n2));
|
|
1658
|
-
} : Object.getOwnPropertyNames, rn = Object.getOwnPropertyDescriptors || function(n2) {
|
|
1659
|
-
var r2 = {};
|
|
1660
|
-
return nn(n2).forEach(function(t2) {
|
|
1661
|
-
r2[t2] = Object.getOwnPropertyDescriptor(n2, t2);
|
|
1662
|
-
}), r2;
|
|
1663
|
-
}, tn = {}, en = { get: function(n2, r2) {
|
|
1664
|
-
if (r2 === Q)
|
|
1665
|
-
return n2;
|
|
1666
|
-
var e2 = p$2(n2);
|
|
1667
|
-
if (!u$2(e2, r2))
|
|
1668
|
-
return function(n3, r3, t2) {
|
|
1669
|
-
var e3, i3 = I(r3, t2);
|
|
1670
|
-
return i3 ? "value" in i3 ? i3.value : (e3 = i3.get) === null || e3 === void 0 ? void 0 : e3.call(n3.k) : void 0;
|
|
1671
|
-
}(n2, e2, r2);
|
|
1672
|
-
var i2 = e2[r2];
|
|
1673
|
-
return n2.I || !t$2(i2) ? i2 : i2 === z(n2.t, r2) ? (E(n2), n2.o[r2] = R(n2.A.h, i2, n2)) : i2;
|
|
1674
|
-
}, has: function(n2, r2) {
|
|
1675
|
-
return r2 in p$2(n2);
|
|
1676
|
-
}, ownKeys: function(n2) {
|
|
1677
|
-
return Reflect.ownKeys(p$2(n2));
|
|
1678
|
-
}, set: function(n2, r2, t2) {
|
|
1679
|
-
var e2 = I(p$2(n2), r2);
|
|
1680
|
-
if (e2 == null ? void 0 : e2.set)
|
|
1681
|
-
return e2.set.call(n2.k, t2), true;
|
|
1682
|
-
if (!n2.P) {
|
|
1683
|
-
var i2 = z(p$2(n2), r2), o2 = i2 == null ? void 0 : i2[Q];
|
|
1684
|
-
if (o2 && o2.t === t2)
|
|
1685
|
-
return n2.o[r2] = t2, n2.D[r2] = false, true;
|
|
1686
|
-
if (c(t2, i2) && (t2 !== void 0 || u$2(n2.t, r2)))
|
|
1687
|
-
return true;
|
|
1688
|
-
E(n2), k$1(n2);
|
|
1689
|
-
}
|
|
1690
|
-
return n2.o[r2] === t2 && typeof t2 != "number" && (t2 !== void 0 || r2 in n2.o) || (n2.o[r2] = t2, n2.D[r2] = true, true);
|
|
1691
|
-
}, deleteProperty: function(n2, r2) {
|
|
1692
|
-
return z(n2.t, r2) !== void 0 || r2 in n2.t ? (n2.D[r2] = false, E(n2), k$1(n2)) : delete n2.D[r2], n2.o && delete n2.o[r2], true;
|
|
1693
|
-
}, getOwnPropertyDescriptor: function(n2, r2) {
|
|
1694
|
-
var t2 = p$2(n2), e2 = Reflect.getOwnPropertyDescriptor(t2, r2);
|
|
1695
|
-
return e2 ? { writable: true, configurable: n2.i !== 1 || r2 !== "length", enumerable: e2.enumerable, value: t2[r2] } : e2;
|
|
1696
|
-
}, defineProperty: function() {
|
|
1697
|
-
n$2(11);
|
|
1698
|
-
}, getPrototypeOf: function(n2) {
|
|
1699
|
-
return Object.getPrototypeOf(n2.t);
|
|
1700
|
-
}, setPrototypeOf: function() {
|
|
1701
|
-
n$2(12);
|
|
1702
|
-
} }, on = {};
|
|
1703
|
-
i(en, function(n2, r2) {
|
|
1704
|
-
on[n2] = function() {
|
|
1705
|
-
return arguments[0] = arguments[0][0], r2.apply(this, arguments);
|
|
1706
|
-
};
|
|
1707
|
-
}), on.deleteProperty = function(r2, t2) {
|
|
1708
|
-
return on.set.call(this, r2, t2, void 0);
|
|
1709
|
-
}, on.set = function(r2, t2, e2) {
|
|
1710
|
-
return en.set.call(this, r2[0], t2, e2, r2[0]);
|
|
1711
|
-
};
|
|
1712
|
-
var un = function() {
|
|
1713
|
-
function e2(r2) {
|
|
1714
|
-
var e3 = this;
|
|
1715
|
-
this.g = B, this.F = true, this.produce = function(r3, i3, o2) {
|
|
1716
|
-
if (typeof r3 == "function" && typeof i3 != "function") {
|
|
1717
|
-
var u2 = i3;
|
|
1718
|
-
i3 = r3;
|
|
1719
|
-
var a2 = e3;
|
|
1720
|
-
return function(n2) {
|
|
1721
|
-
var r4 = this;
|
|
1722
|
-
n2 === void 0 && (n2 = u2);
|
|
1723
|
-
for (var t2 = arguments.length, e4 = Array(t2 > 1 ? t2 - 1 : 0), o3 = 1; o3 < t2; o3++)
|
|
1724
|
-
e4[o3 - 1] = arguments[o3];
|
|
1725
|
-
return a2.produce(n2, function(n3) {
|
|
1726
|
-
var t3;
|
|
1727
|
-
return (t3 = i3).call.apply(t3, [r4, n3].concat(e4));
|
|
1728
|
-
});
|
|
1729
|
-
};
|
|
1730
|
-
}
|
|
1731
|
-
var f2;
|
|
1732
|
-
if (typeof i3 != "function" && n$2(6), o2 !== void 0 && typeof o2 != "function" && n$2(7), t$2(r3)) {
|
|
1733
|
-
var c2 = w$1(e3), s2 = R(e3, r3, void 0), v2 = true;
|
|
1734
|
-
try {
|
|
1735
|
-
f2 = i3(s2), v2 = false;
|
|
1736
|
-
} finally {
|
|
1737
|
-
v2 ? O(c2) : g(c2);
|
|
1738
|
-
}
|
|
1739
|
-
return typeof Promise != "undefined" && f2 instanceof Promise ? f2.then(function(n2) {
|
|
1740
|
-
return j(c2, o2), P(n2, c2);
|
|
1741
|
-
}, function(n2) {
|
|
1742
|
-
throw O(c2), n2;
|
|
1743
|
-
}) : (j(c2, o2), P(f2, c2));
|
|
1744
|
-
}
|
|
1745
|
-
if (!r3 || typeof r3 != "object") {
|
|
1746
|
-
if ((f2 = i3(r3)) === void 0 && (f2 = r3), f2 === H && (f2 = void 0), e3.F && d(f2, true), o2) {
|
|
1747
|
-
var p2 = [], l2 = [];
|
|
1748
|
-
b("Patches").M(r3, f2, p2, l2), o2(p2, l2);
|
|
1749
|
-
}
|
|
1750
|
-
return f2;
|
|
1751
|
-
}
|
|
1752
|
-
n$2(21, r3);
|
|
1753
|
-
}, this.produceWithPatches = function(n2, r3) {
|
|
1754
|
-
if (typeof n2 == "function")
|
|
1755
|
-
return function(r4) {
|
|
1756
|
-
for (var t3 = arguments.length, i4 = Array(t3 > 1 ? t3 - 1 : 0), o3 = 1; o3 < t3; o3++)
|
|
1757
|
-
i4[o3 - 1] = arguments[o3];
|
|
1758
|
-
return e3.produceWithPatches(r4, function(r5) {
|
|
1759
|
-
return n2.apply(void 0, [r5].concat(i4));
|
|
1760
|
-
});
|
|
1761
|
-
};
|
|
1762
|
-
var t2, i3, o2 = e3.produce(n2, r3, function(n3, r4) {
|
|
1763
|
-
t2 = n3, i3 = r4;
|
|
1764
|
-
});
|
|
1765
|
-
return typeof Promise != "undefined" && o2 instanceof Promise ? o2.then(function(n3) {
|
|
1766
|
-
return [n3, t2, i3];
|
|
1767
|
-
}) : [o2, t2, i3];
|
|
1768
|
-
}, typeof (r2 == null ? void 0 : r2.useProxies) == "boolean" && this.setUseProxies(r2.useProxies), typeof (r2 == null ? void 0 : r2.autoFreeze) == "boolean" && this.setAutoFreeze(r2.autoFreeze);
|
|
1769
|
-
}
|
|
1770
|
-
var i2 = e2.prototype;
|
|
1771
|
-
return i2.createDraft = function(e3) {
|
|
1772
|
-
t$2(e3) || n$2(8), r$2(e3) && (e3 = D(e3));
|
|
1773
|
-
var i3 = w$1(this), o2 = R(this, e3, void 0);
|
|
1774
|
-
return o2[Q].C = true, g(i3), o2;
|
|
1775
|
-
}, i2.finishDraft = function(r2, t2) {
|
|
1776
|
-
var e3 = r2 && r2[Q];
|
|
1777
|
-
var i3 = e3.A;
|
|
1778
|
-
return j(i3, t2), P(void 0, i3);
|
|
1779
|
-
}, i2.setAutoFreeze = function(n2) {
|
|
1780
|
-
this.F = n2;
|
|
1781
|
-
}, i2.setUseProxies = function(r2) {
|
|
1782
|
-
r2 && !B && n$2(20), this.g = r2;
|
|
1783
|
-
}, i2.applyPatches = function(n2, t2) {
|
|
1784
|
-
var e3;
|
|
1785
|
-
for (e3 = t2.length - 1; e3 >= 0; e3--) {
|
|
1786
|
-
var i3 = t2[e3];
|
|
1787
|
-
if (i3.path.length === 0 && i3.op === "replace") {
|
|
1788
|
-
n2 = i3.value;
|
|
1789
|
-
break;
|
|
1790
|
-
}
|
|
1791
|
-
}
|
|
1792
|
-
e3 > -1 && (t2 = t2.slice(e3 + 1));
|
|
1793
|
-
var o2 = b("Patches").$;
|
|
1794
|
-
return r$2(n2) ? o2(n2, t2) : this.produce(n2, function(n3) {
|
|
1795
|
-
return o2(n3, t2);
|
|
1796
|
-
});
|
|
1797
|
-
}, e2;
|
|
1798
|
-
}(), an = new un(), fn = an.produce;
|
|
1799
|
-
an.produceWithPatches.bind(an);
|
|
1800
|
-
an.setAutoFreeze.bind(an);
|
|
1801
|
-
an.setUseProxies.bind(an);
|
|
1802
|
-
var pn = an.applyPatches.bind(an);
|
|
1803
|
-
an.createDraft.bind(an);
|
|
1804
|
-
an.finishDraft.bind(an);
|
|
1805
|
-
var react = function equal(a2, b2) {
|
|
1806
|
-
if (a2 === b2)
|
|
1807
|
-
return true;
|
|
1808
|
-
if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") {
|
|
1809
|
-
if (a2.constructor !== b2.constructor)
|
|
1810
|
-
return false;
|
|
1811
|
-
var length, i2, keys;
|
|
1812
|
-
if (Array.isArray(a2)) {
|
|
1813
|
-
length = a2.length;
|
|
1814
|
-
if (length != b2.length)
|
|
1815
|
-
return false;
|
|
1816
|
-
for (i2 = length; i2-- !== 0; )
|
|
1817
|
-
if (!equal(a2[i2], b2[i2]))
|
|
1818
|
-
return false;
|
|
1819
|
-
return true;
|
|
1820
|
-
}
|
|
1821
|
-
if (a2 instanceof Map && b2 instanceof Map) {
|
|
1822
|
-
if (a2.size !== b2.size)
|
|
1823
|
-
return false;
|
|
1824
|
-
for (i2 of a2.entries())
|
|
1825
|
-
if (!b2.has(i2[0]))
|
|
1826
|
-
return false;
|
|
1827
|
-
for (i2 of a2.entries())
|
|
1828
|
-
if (!equal(i2[1], b2.get(i2[0])))
|
|
1829
|
-
return false;
|
|
1830
|
-
return true;
|
|
1831
|
-
}
|
|
1832
|
-
if (a2 instanceof Set && b2 instanceof Set) {
|
|
1833
|
-
if (a2.size !== b2.size)
|
|
1834
|
-
return false;
|
|
1835
|
-
for (i2 of a2.entries())
|
|
1836
|
-
if (!b2.has(i2[0]))
|
|
1837
|
-
return false;
|
|
1838
|
-
return true;
|
|
1839
|
-
}
|
|
1840
|
-
if (ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) {
|
|
1841
|
-
length = a2.length;
|
|
1842
|
-
if (length != b2.length)
|
|
1843
|
-
return false;
|
|
1844
|
-
for (i2 = length; i2-- !== 0; )
|
|
1845
|
-
if (a2[i2] !== b2[i2])
|
|
1846
|
-
return false;
|
|
1847
|
-
return true;
|
|
1848
|
-
}
|
|
1849
|
-
if (a2.constructor === RegExp)
|
|
1850
|
-
return a2.source === b2.source && a2.flags === b2.flags;
|
|
1851
|
-
if (a2.valueOf !== Object.prototype.valueOf)
|
|
1852
|
-
return a2.valueOf() === b2.valueOf();
|
|
1853
|
-
if (a2.toString !== Object.prototype.toString)
|
|
1854
|
-
return a2.toString() === b2.toString();
|
|
1855
|
-
keys = Object.keys(a2);
|
|
1856
|
-
length = keys.length;
|
|
1857
|
-
if (length !== Object.keys(b2).length)
|
|
1858
|
-
return false;
|
|
1859
|
-
for (i2 = length; i2-- !== 0; )
|
|
1860
|
-
if (!Object.prototype.hasOwnProperty.call(b2, keys[i2]))
|
|
1861
|
-
return false;
|
|
1862
|
-
for (i2 = length; i2-- !== 0; ) {
|
|
1863
|
-
var key = keys[i2];
|
|
1864
|
-
if (key === "_owner" && a2.$$typeof) {
|
|
1865
|
-
continue;
|
|
1866
|
-
}
|
|
1867
|
-
if (!equal(a2[key], b2[key]))
|
|
1868
|
-
return false;
|
|
1869
|
-
}
|
|
1870
|
-
return true;
|
|
1871
|
-
}
|
|
1872
|
-
return a2 !== a2 && b2 !== b2;
|
|
1873
|
-
};
|
|
1874
|
-
function createSelector(stringSelector) {
|
|
1875
|
-
const parts = stringSelector.split(".");
|
|
1876
|
-
return (state) => parts.reduce((v2, p2) => v2 instanceof Object && p2 in v2 ? v2[p2] : void 0, state);
|
|
1877
|
-
}
|
|
1878
|
-
function setWithSelector(state, stringSelector, value) {
|
|
1879
|
-
const parts = stringSelector.split(".");
|
|
1880
|
-
const prefix = parts.slice(0, -1);
|
|
1881
|
-
const last = parts[parts.length - 1];
|
|
1882
|
-
for (const part of prefix) {
|
|
1883
|
-
if (state instanceof Object && part in state) {
|
|
1884
|
-
state = state[part];
|
|
1885
|
-
} else {
|
|
1886
|
-
throw Error(`Could not set ${stringSelector} because path ${stringSelector} doesn't exist`);
|
|
1887
|
-
}
|
|
1888
|
-
}
|
|
1889
|
-
if (state instanceof Object) {
|
|
1890
|
-
state[last] = value;
|
|
1891
|
-
} else {
|
|
1892
|
-
throw Error(`Could not set ${stringSelector} because path ${stringSelector} doesn't exist`);
|
|
1893
|
-
}
|
|
1894
|
-
}
|
|
1895
|
-
function throttle$1(fn2, ms) {
|
|
1896
|
-
let last = 0;
|
|
1897
|
-
let lastArgs;
|
|
1898
|
-
let timeout;
|
|
1899
|
-
function run() {
|
|
1900
|
-
const args = lastArgs;
|
|
1901
|
-
last = Date.now();
|
|
1902
|
-
lastArgs = void 0;
|
|
1903
|
-
timeout = void 0;
|
|
1904
|
-
fn2(...args);
|
|
1905
|
-
}
|
|
1906
|
-
return function(...args) {
|
|
1907
|
-
const now = Date.now();
|
|
1908
|
-
lastArgs = args;
|
|
1909
|
-
if (timeout)
|
|
1910
|
-
;
|
|
1911
|
-
else if (now < last + ms) {
|
|
1912
|
-
timeout = setTimeout(run, last + ms - now);
|
|
1913
|
-
} else {
|
|
1914
|
-
run();
|
|
1915
|
-
}
|
|
1916
|
-
};
|
|
1917
|
-
}
|
|
1918
|
-
const RESTART_UPDATE = Symbol("RESTART_UPDATE");
|
|
1919
|
-
class Store$1 {
|
|
1920
|
-
constructor(state, { log = (...data) => console.error(...data) } = {}) {
|
|
1921
|
-
this.state = state;
|
|
1922
|
-
this.subscriptions = /* @__PURE__ */ new Set();
|
|
1923
|
-
this.batchCounter = 0;
|
|
1924
|
-
this.reactions = /* @__PURE__ */ new Set();
|
|
1925
|
-
this.patches = new Array();
|
|
1926
|
-
d(state, true);
|
|
1927
|
-
C();
|
|
1928
|
-
T();
|
|
1929
|
-
this.options = {
|
|
1930
|
-
log
|
|
1931
|
-
};
|
|
1932
|
-
}
|
|
1933
|
-
getState() {
|
|
1934
|
-
return this.state;
|
|
1935
|
-
}
|
|
1936
|
-
update(update) {
|
|
1937
|
-
this.state = fn(this.state, (draft) => update(draft, this.state), (patches) => this.patches.push(...patches));
|
|
1938
|
-
this.notify();
|
|
1939
|
-
}
|
|
1940
|
-
set(state) {
|
|
1941
|
-
this.state = fn(this.state, () => state, (patches) => this.patches.push(...patches));
|
|
1942
|
-
this.notify();
|
|
1943
|
-
}
|
|
1944
|
-
applyPatches(patches) {
|
|
1945
|
-
this.state = pn(this.state, patches);
|
|
1946
|
-
this.patches.push(...patches);
|
|
1947
|
-
this.notify();
|
|
1948
|
-
}
|
|
1949
|
-
batchUpdates(fn2) {
|
|
1950
|
-
try {
|
|
1951
|
-
this.batchCounter++;
|
|
1952
|
-
fn2();
|
|
1953
|
-
} finally {
|
|
1954
|
-
this.batchCounter--;
|
|
1955
|
-
if (this.batchCounter === 0) {
|
|
1956
|
-
this.notify();
|
|
1957
|
-
}
|
|
1958
|
-
}
|
|
1959
|
-
}
|
|
1960
|
-
subscribe(...args) {
|
|
1961
|
-
let selector, listener, options;
|
|
1962
|
-
if (args[1] instanceof Function) {
|
|
1963
|
-
[selector, listener, options] = args;
|
|
1964
|
-
if (typeof selector === "string") {
|
|
1965
|
-
selector = createSelector(selector);
|
|
1966
|
-
}
|
|
1967
|
-
} else {
|
|
1968
|
-
[selector, listener, options] = [(x2) => x2, ...args];
|
|
1969
|
-
}
|
|
1970
|
-
const { runNow = true, throttle: throttle2 = 0, compare = react } = options !== null && options !== void 0 ? options : {};
|
|
1971
|
-
const throttledListener = throttle2 ? throttle$1(listener, throttle2) : listener;
|
|
1972
|
-
let value = selector(this.state);
|
|
1973
|
-
const internalListener = (state, _patches, init) => {
|
|
1974
|
-
try {
|
|
1975
|
-
this.lock = "subscription";
|
|
1976
|
-
const oldValue = value;
|
|
1977
|
-
value = selector(state);
|
|
1978
|
-
if (!init && compare(value, oldValue))
|
|
1979
|
-
return;
|
|
1980
|
-
(init ? listener : throttledListener)(value, oldValue, this.state);
|
|
1981
|
-
} catch (e2) {
|
|
1982
|
-
this.options.log("Failed to execute listener:", e2);
|
|
1983
|
-
} finally {
|
|
1984
|
-
delete this.lock;
|
|
1985
|
-
}
|
|
1986
|
-
};
|
|
1987
|
-
this.subscriptions.add(internalListener);
|
|
1988
|
-
if (runNow)
|
|
1989
|
-
internalListener(this.state, [], true);
|
|
1990
|
-
return () => {
|
|
1991
|
-
this.subscriptions.delete(internalListener);
|
|
1992
|
-
};
|
|
1993
|
-
}
|
|
1994
|
-
addReaction(...args) {
|
|
1995
|
-
let selector, reaction, options;
|
|
1996
|
-
if (args[1] instanceof Function) {
|
|
1997
|
-
[selector, reaction, options] = args;
|
|
1998
|
-
if (typeof selector === "string") {
|
|
1999
|
-
selector = createSelector(selector);
|
|
2000
|
-
}
|
|
2001
|
-
} else {
|
|
2002
|
-
[selector, reaction, options] = [(x2) => x2, ...args];
|
|
2003
|
-
}
|
|
2004
|
-
const { runNow = true, compare = react } = options !== null && options !== void 0 ? options : {};
|
|
2005
|
-
let value = selector(this.state);
|
|
2006
|
-
const internalListener = (init) => {
|
|
2007
|
-
let hasChanged = false;
|
|
2008
|
-
try {
|
|
2009
|
-
this.lock = "reaction";
|
|
2010
|
-
const oldValue = value;
|
|
2011
|
-
value = selector(this.state);
|
|
2012
|
-
if (!init && compare(value, oldValue))
|
|
2013
|
-
return;
|
|
2014
|
-
this.state = fn(this.state, (draft) => reaction(value, draft, this.state, oldValue), (patches) => {
|
|
2015
|
-
hasChanged = true;
|
|
2016
|
-
this.patches.push(...patches);
|
|
2017
|
-
});
|
|
2018
|
-
} catch (e2) {
|
|
2019
|
-
this.options.log("Failed to execute reaction:", e2);
|
|
2020
|
-
} finally {
|
|
2021
|
-
delete this.lock;
|
|
2022
|
-
}
|
|
2023
|
-
if (hasChanged && !init)
|
|
2024
|
-
throw RESTART_UPDATE;
|
|
2025
|
-
if (hasChanged && init)
|
|
2026
|
-
this.notify();
|
|
2027
|
-
};
|
|
2028
|
-
this.reactions.add(internalListener);
|
|
2029
|
-
if (runNow)
|
|
2030
|
-
internalListener(true);
|
|
2031
|
-
return () => {
|
|
2032
|
-
this.reactions.delete(internalListener);
|
|
2033
|
-
};
|
|
2034
|
-
}
|
|
2035
|
-
subscribePatches(listener) {
|
|
2036
|
-
const internalListener = (_state, patches) => {
|
|
2037
|
-
try {
|
|
2038
|
-
listener(patches);
|
|
2039
|
-
} catch (e2) {
|
|
2040
|
-
this.options.log("Failed to execute patch listener:", e2);
|
|
2041
|
-
}
|
|
2042
|
-
};
|
|
2043
|
-
this.subscriptions.add(internalListener);
|
|
2044
|
-
return () => {
|
|
2045
|
-
this.subscriptions.delete(internalListener);
|
|
2046
|
-
};
|
|
2047
|
-
}
|
|
2048
|
-
checkLock() {
|
|
2049
|
-
if (this.lock === "reaction") {
|
|
2050
|
-
throw Error("You cannot call update from within a reaction. Use the passed draft instead.");
|
|
2051
|
-
} else if (this.lock === "subscription") {
|
|
2052
|
-
throw Error("You cannot call update from within a subscription.");
|
|
2053
|
-
}
|
|
2054
|
-
}
|
|
2055
|
-
notify() {
|
|
2056
|
-
if (this.batchCounter > 0 || this.patches.length === 0)
|
|
2057
|
-
return;
|
|
2058
|
-
try {
|
|
2059
|
-
for (const reaction of this.reactions) {
|
|
2060
|
-
reaction();
|
|
2061
|
-
}
|
|
2062
|
-
} catch (e2) {
|
|
2063
|
-
return this.notify();
|
|
2064
|
-
}
|
|
2065
|
-
const patches = this.patches;
|
|
2066
|
-
this.patches = [];
|
|
2067
|
-
this.batchUpdates(() => {
|
|
2068
|
-
for (const subscription of this.subscriptions) {
|
|
2069
|
-
subscription(this.state, patches);
|
|
2070
|
-
}
|
|
2071
|
-
});
|
|
2072
|
-
}
|
|
2073
|
-
}
|
|
2074
|
-
var withSelector = { exports: {} };
|
|
2075
|
-
var withSelector_production_min = {};
|
|
2076
|
-
var shim = { exports: {} };
|
|
2077
|
-
var useSyncExternalStoreShim_production_min = {};
|
|
2078
|
-
/**
|
|
2079
|
-
* @license React
|
|
2080
|
-
* use-sync-external-store-shim.production.min.js
|
|
2081
|
-
*
|
|
2082
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
2083
|
-
*
|
|
2084
|
-
* This source code is licensed under the MIT license found in the
|
|
2085
|
-
* LICENSE file in the root directory of this source tree.
|
|
2086
|
-
*/
|
|
2087
|
-
var e = require$$0__default["default"];
|
|
2088
|
-
function h$1(a2, b2) {
|
|
2089
|
-
return a2 === b2 && (a2 !== 0 || 1 / a2 === 1 / b2) || a2 !== a2 && b2 !== b2;
|
|
2090
|
-
}
|
|
2091
|
-
var k = typeof Object.is === "function" ? Object.is : h$1, l = e.useState, m = e.useEffect, n$1 = e.useLayoutEffect, p$1 = e.useDebugValue;
|
|
2092
|
-
function q$1(a2, b2) {
|
|
2093
|
-
var d2 = b2(), f2 = l({ inst: { value: d2, getSnapshot: b2 } }), c2 = f2[0].inst, g2 = f2[1];
|
|
2094
|
-
n$1(function() {
|
|
2095
|
-
c2.value = d2;
|
|
2096
|
-
c2.getSnapshot = b2;
|
|
2097
|
-
r$1(c2) && g2({ inst: c2 });
|
|
2098
|
-
}, [a2, d2, b2]);
|
|
2099
|
-
m(function() {
|
|
2100
|
-
r$1(c2) && g2({ inst: c2 });
|
|
2101
|
-
return a2(function() {
|
|
2102
|
-
r$1(c2) && g2({ inst: c2 });
|
|
2103
|
-
});
|
|
2104
|
-
}, [a2]);
|
|
2105
|
-
p$1(d2);
|
|
2106
|
-
return d2;
|
|
2107
|
-
}
|
|
2108
|
-
function r$1(a2) {
|
|
2109
|
-
var b2 = a2.getSnapshot;
|
|
2110
|
-
a2 = a2.value;
|
|
2111
|
-
try {
|
|
2112
|
-
var d2 = b2();
|
|
2113
|
-
return !k(a2, d2);
|
|
2114
|
-
} catch (f2) {
|
|
2115
|
-
return true;
|
|
2116
|
-
}
|
|
2117
|
-
}
|
|
2118
|
-
function t$1(a2, b2) {
|
|
2119
|
-
return b2();
|
|
2120
|
-
}
|
|
2121
|
-
var u$1 = typeof window === "undefined" || typeof window.document === "undefined" || typeof window.document.createElement === "undefined" ? t$1 : q$1;
|
|
2122
|
-
useSyncExternalStoreShim_production_min.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : u$1;
|
|
2123
|
-
{
|
|
2124
|
-
shim.exports = useSyncExternalStoreShim_production_min;
|
|
2125
|
-
}
|
|
2126
|
-
/**
|
|
2127
|
-
* @license React
|
|
2128
|
-
* use-sync-external-store-shim/with-selector.production.min.js
|
|
2129
|
-
*
|
|
2130
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
2131
|
-
*
|
|
2132
|
-
* This source code is licensed under the MIT license found in the
|
|
2133
|
-
* LICENSE file in the root directory of this source tree.
|
|
2134
|
-
*/
|
|
2135
|
-
var h = require$$0__default["default"], n = shim.exports;
|
|
2136
|
-
function p(a2, b2) {
|
|
2137
|
-
return a2 === b2 && (a2 !== 0 || 1 / a2 === 1 / b2) || a2 !== a2 && b2 !== b2;
|
|
2138
|
-
}
|
|
2139
|
-
var q = typeof Object.is === "function" ? Object.is : p, r = n.useSyncExternalStore, t = h.useRef, u = h.useEffect, v = h.useMemo, w = h.useDebugValue;
|
|
2140
|
-
withSelector_production_min.useSyncExternalStoreWithSelector = function(a2, b2, e2, l2, g2) {
|
|
2141
|
-
var c2 = t(null);
|
|
2142
|
-
if (c2.current === null) {
|
|
2143
|
-
var f2 = { hasValue: false, value: null };
|
|
2144
|
-
c2.current = f2;
|
|
2145
|
-
} else
|
|
2146
|
-
f2 = c2.current;
|
|
2147
|
-
c2 = v(function() {
|
|
2148
|
-
function a3(a4) {
|
|
2149
|
-
if (!c3) {
|
|
2150
|
-
c3 = true;
|
|
2151
|
-
d3 = a4;
|
|
2152
|
-
a4 = l2(a4);
|
|
2153
|
-
if (g2 !== void 0 && f2.hasValue) {
|
|
2154
|
-
var b3 = f2.value;
|
|
2155
|
-
if (g2(b3, a4))
|
|
2156
|
-
return k2 = b3;
|
|
2157
|
-
}
|
|
2158
|
-
return k2 = a4;
|
|
2159
|
-
}
|
|
2160
|
-
b3 = k2;
|
|
2161
|
-
if (q(d3, a4))
|
|
2162
|
-
return b3;
|
|
2163
|
-
var e3 = l2(a4);
|
|
2164
|
-
if (g2 !== void 0 && g2(b3, e3))
|
|
2165
|
-
return b3;
|
|
2166
|
-
d3 = a4;
|
|
2167
|
-
return k2 = e3;
|
|
2168
|
-
}
|
|
2169
|
-
var c3 = false, d3, k2, m2 = e2 === void 0 ? null : e2;
|
|
2170
|
-
return [function() {
|
|
2171
|
-
return a3(b2());
|
|
2172
|
-
}, m2 === null ? void 0 : function() {
|
|
2173
|
-
return a3(m2());
|
|
2174
|
-
}];
|
|
2175
|
-
}, [b2, e2, l2, g2]);
|
|
2176
|
-
var d2 = r(a2, c2[0], c2[1]);
|
|
2177
|
-
u(function() {
|
|
2178
|
-
f2.hasValue = true;
|
|
2179
|
-
f2.value = d2;
|
|
2180
|
-
}, [d2]);
|
|
2181
|
-
w(d2);
|
|
2182
|
-
return d2;
|
|
2183
|
-
};
|
|
2184
|
-
{
|
|
2185
|
-
withSelector.exports = withSelector_production_min;
|
|
2186
|
-
}
|
|
2187
|
-
function useStoreState(store, ...args) {
|
|
2188
|
-
var _a, _b, _c, _d;
|
|
2189
|
-
let selector, options;
|
|
2190
|
-
if (args[0] instanceof Function) {
|
|
2191
|
-
selector = args[0];
|
|
2192
|
-
options = (_a = args[1]) !== null && _a !== void 0 ? _a : {};
|
|
2193
|
-
} else if (typeof args[0] === "string") {
|
|
2194
|
-
selector = createSelector(args[0]);
|
|
2195
|
-
options = (_b = args[1]) !== null && _b !== void 0 ? _b : {};
|
|
2196
|
-
} else {
|
|
2197
|
-
selector = (x2) => x2;
|
|
2198
|
-
options = (_c = args[0]) !== null && _c !== void 0 ? _c : {};
|
|
2199
|
-
}
|
|
2200
|
-
const subscribe = require$$0.useCallback((listener) => {
|
|
2201
|
-
return store.subscribe((x2) => x2, listener, {
|
|
2202
|
-
throttle: options.throttle,
|
|
2203
|
-
runNow: false,
|
|
2204
|
-
compare: (a2, b2) => a2 === b2
|
|
2205
|
-
});
|
|
2206
|
-
}, [store, options.throttle]);
|
|
2207
|
-
const value = withSelector.exports.useSyncExternalStoreWithSelector(subscribe, () => store.getState(), void 0, selector, (_d = options.compare) !== null && _d !== void 0 ? _d : react);
|
|
2208
|
-
require$$0.useDebugValue(value);
|
|
2209
|
-
return value;
|
|
2210
|
-
}
|
|
2211
|
-
function useStoreProp(store, selector) {
|
|
2212
|
-
const value = useStoreState(store, selector);
|
|
2213
|
-
const update = (value2) => store.update((state) => setWithSelector(state, selector, value2));
|
|
2214
|
-
return [value, update];
|
|
2215
|
-
}
|
|
2216
|
-
class Store extends Store$1 {
|
|
2217
|
-
useState(...args) {
|
|
2218
|
-
return useStoreState(this, ...args);
|
|
2219
|
-
}
|
|
2220
|
-
useProp(selector) {
|
|
2221
|
-
return useStoreProp(this, selector);
|
|
2222
|
-
}
|
|
2223
|
-
}
|
|
2224
|
-
class StoreScope {
|
|
2225
|
-
constructor(defaultValue) {
|
|
2226
|
-
this.defaultValue = defaultValue;
|
|
2227
|
-
this.Provider = ({ children, store }) => {
|
|
2228
|
-
const _store = require$$0.useMemo(() => store !== null && store !== void 0 ? store : new Store(this.defaultValue), [store]);
|
|
2229
|
-
return tableTheme.jsx$1(this.context.Provider, Object.assign({ value: _store }, { children }), void 0);
|
|
2230
|
-
};
|
|
2231
|
-
this.withScope = (Component) => {
|
|
2232
|
-
return (args) => tableTheme.jsx$1(this.Provider, { children: tableTheme.jsx$1(Component, Object.assign({}, args), void 0) }, void 0);
|
|
2233
|
-
};
|
|
2234
|
-
this.context = require$$0.createContext(new Store(defaultValue));
|
|
2235
|
-
}
|
|
2236
|
-
useStore() {
|
|
2237
|
-
return require$$0.useContext(this.context);
|
|
2238
|
-
}
|
|
2239
|
-
useState(...args) {
|
|
2240
|
-
const store = this.useStore();
|
|
2241
|
-
return useStoreState(store, ...args);
|
|
2242
|
-
}
|
|
2243
|
-
useProp(selector) {
|
|
2244
|
-
const store = this.useStore();
|
|
2245
|
-
return useStoreProp(store, selector);
|
|
2246
|
-
}
|
|
2247
|
-
}
|
|
2248
703
|
function calcItems(state) {
|
|
2249
|
-
|
|
704
|
+
react.useEffect(() => state.addReaction((state2) => [
|
|
2250
705
|
state2.props.items,
|
|
2251
706
|
state2.props.id,
|
|
2252
707
|
state2.props.parentId,
|
|
@@ -2273,7 +728,7 @@ function calcItems(state) {
|
|
|
2273
728
|
const sortBy = column.sortBy instanceof Array ? column.sortBy : [column.sortBy];
|
|
2274
729
|
return sortBy.map((sortBy2) => ({ selector: (item) => sortBy2(column.value(item), item), direction: sort2.direction }));
|
|
2275
730
|
}).filter(Boolean);
|
|
2276
|
-
sorted = orderBy(tableItems, selectors.map((
|
|
731
|
+
sorted = orderBy(tableItems, selectors.map((x) => x.selector), selectors.map((x) => x.direction));
|
|
2277
732
|
}
|
|
2278
733
|
const lookup = /* @__PURE__ */ new Map();
|
|
2279
734
|
for (const item of sorted) {
|
|
@@ -2306,12 +761,12 @@ function calcItems(state) {
|
|
|
2306
761
|
const filterValue = filterValues.get(column.id);
|
|
2307
762
|
if (filterValue === void 0 || !filter.isActive(filterValue))
|
|
2308
763
|
return true;
|
|
2309
|
-
const filterBy = (_a = filter.filterBy) != null ? _a : (
|
|
764
|
+
const filterBy = (_a = filter.filterBy) != null ? _a : (x) => x;
|
|
2310
765
|
const value = filterBy(column.value(item), item);
|
|
2311
766
|
return castArray(value).some((value2) => filter.test(filterValue, value2));
|
|
2312
767
|
}));
|
|
2313
768
|
if (isActive && item.parentId !== void 0) {
|
|
2314
|
-
if (revealFiltered &&
|
|
769
|
+
if (revealFiltered && Array.from(filters.entries()).some(([id2, filter]) => {
|
|
2315
770
|
const filterValue = filterValues.get(id2);
|
|
2316
771
|
return !!filter && filterValue !== void 0 && filter.isActive(filterValue);
|
|
2317
772
|
})) {
|
|
@@ -2329,10 +784,10 @@ function calcItems(state) {
|
|
|
2329
784
|
}
|
|
2330
785
|
return isActive;
|
|
2331
786
|
}).reverse();
|
|
2332
|
-
draft.items =
|
|
2333
|
-
draft.itemsById =
|
|
2334
|
-
draft.activeItems =
|
|
2335
|
-
draft.activeItemsById =
|
|
787
|
+
draft.items = immer.castDraft(allItems);
|
|
788
|
+
draft.itemsById = immer.castDraft(allItemsById);
|
|
789
|
+
draft.activeItems = immer.castDraft(activeItems);
|
|
790
|
+
draft.activeItemsById = immer.castDraft(activeItemsById);
|
|
2336
791
|
if (expandedChanged) {
|
|
2337
792
|
setTimeout(() => {
|
|
2338
793
|
var _a, _b;
|
|
@@ -2343,8 +798,8 @@ function calcItems(state) {
|
|
|
2343
798
|
}
|
|
2344
799
|
const noopParentId = () => void 0;
|
|
2345
800
|
function calcProps(props) {
|
|
2346
|
-
const columnCache =
|
|
2347
|
-
return
|
|
801
|
+
const columnCache = react.useRef(/* @__PURE__ */ new Map());
|
|
802
|
+
return react.useMemo(() => {
|
|
2348
803
|
var _c, _d, _e, _f, _g, _h;
|
|
2349
804
|
let id;
|
|
2350
805
|
if (props.id instanceof Function) {
|
|
@@ -2373,7 +828,7 @@ function calcProps(props) {
|
|
|
2373
828
|
header = null,
|
|
2374
829
|
renderCell = asString,
|
|
2375
830
|
exportCell = asString,
|
|
2376
|
-
sortBy = (
|
|
831
|
+
sortBy = (v) => typeof v === "number" || v instanceof Date ? v : String(v),
|
|
2377
832
|
dependencies = []
|
|
2378
833
|
} = _b, props2 = __objRest(_b, [
|
|
2379
834
|
"id",
|
|
@@ -2386,7 +841,7 @@ function calcProps(props) {
|
|
|
2386
841
|
var _a2;
|
|
2387
842
|
const [depsInCache, columnInCache] = (_a2 = columnCache.current.get(id2 != null ? id2 : index)) != null ? _a2 : [];
|
|
2388
843
|
let column;
|
|
2389
|
-
if (depsInCache && columnInCache && depsInCache.length === dependencies.length && depsInCache.every((
|
|
844
|
+
if (depsInCache && columnInCache && depsInCache.length === dependencies.length && depsInCache.every((x, i) => dependencies[i] === x)) {
|
|
2390
845
|
column = columnInCache;
|
|
2391
846
|
} else {
|
|
2392
847
|
column = __spreadValues({
|
|
@@ -2430,11 +885,11 @@ function calcProps(props) {
|
|
|
2430
885
|
}, [props]);
|
|
2431
886
|
}
|
|
2432
887
|
function cleanupState(state) {
|
|
2433
|
-
|
|
888
|
+
react.useEffect(() => state.addReaction((state2) => [state2.props.columns, state2.itemsById, state2.activeItemsById, state2.activeColumns], ([columns, itemsById, activeItemsById, activeColumns], draft) => {
|
|
2434
889
|
var _a, _b, _c, _d, _e, _f;
|
|
2435
890
|
const columnIds = new Set(columns.map((column) => column.id));
|
|
2436
891
|
const activeColumnIds = new Set(activeColumns.map((column) => column.id));
|
|
2437
|
-
const newSort = draft.sort.filter((
|
|
892
|
+
const newSort = draft.sort.filter((s) => activeColumnIds.has(s.columnId));
|
|
2438
893
|
if (newSort.length < draft.sort.length) {
|
|
2439
894
|
draft.sort = newSort;
|
|
2440
895
|
(_b = (_a = draft.props).onSortChange) == null ? void 0 : _b.call(_a, newSort);
|
|
@@ -2457,7 +912,7 @@ function cleanupState(state) {
|
|
|
2457
912
|
}
|
|
2458
913
|
for (const id of draft.columnOrder) {
|
|
2459
914
|
if (!columnIds.has(id))
|
|
2460
|
-
draft.columnOrder = draft.columnOrder.filter((
|
|
915
|
+
draft.columnOrder = draft.columnOrder.filter((x) => x !== id);
|
|
2461
916
|
}
|
|
2462
917
|
if (draft.props.items) {
|
|
2463
918
|
const newSelection = intersect(draft.selection, activeItemsById);
|
|
@@ -2474,12 +929,12 @@ function cleanupState(state) {
|
|
|
2474
929
|
}, { runNow: true }), [state]);
|
|
2475
930
|
}
|
|
2476
931
|
function filterColumns(state) {
|
|
2477
|
-
|
|
932
|
+
react.useEffect(() => state.addReaction((state2) => [state2.props.columns, state2.hiddenColumns, state2.columnOrder], ([columns, hiddenColumns, columnOrder], draft) => {
|
|
2478
933
|
draft.activeColumns = orderBy(columns.filter((column) => !hiddenColumns.has(column.id)), [(column) => columnOrder.indexOf(column.id)]);
|
|
2479
934
|
}, { runNow: true }), [state]);
|
|
2480
935
|
}
|
|
2481
936
|
function syncSelections(state) {
|
|
2482
|
-
|
|
937
|
+
react.useEffect(() => state.addReaction((state2) => [state2.props.selectSyncChildren, state2.selection, state2.activeItems], ([selectSyncChildren, selection, activeItems], state2) => {
|
|
2483
938
|
var _a, _b;
|
|
2484
939
|
if (!selectSyncChildren)
|
|
2485
940
|
return;
|
|
@@ -2498,9 +953,9 @@ function syncSelections(state) {
|
|
|
2498
953
|
function useTableState(_props) {
|
|
2499
954
|
const props = calcProps(_props);
|
|
2500
955
|
const theme = tableTheme.useTableTheme(props);
|
|
2501
|
-
const state =
|
|
956
|
+
const state = react.useMemo(() => {
|
|
2502
957
|
var _a, _b, _c, _d;
|
|
2503
|
-
return new Store({
|
|
958
|
+
return new react$1.Store({
|
|
2504
959
|
props,
|
|
2505
960
|
theme,
|
|
2506
961
|
sort: (_a = props.defaultSort) != null ? _a : [],
|
|
@@ -2525,9 +980,9 @@ function useTableState(_props) {
|
|
|
2525
980
|
calcItems(state);
|
|
2526
981
|
syncSelections(state);
|
|
2527
982
|
cleanupState(state);
|
|
2528
|
-
|
|
983
|
+
react.useEffect(() => {
|
|
2529
984
|
state.update((state2) => {
|
|
2530
|
-
state2.props =
|
|
985
|
+
state2.props = immer.castDraft(props);
|
|
2531
986
|
if (props.sort)
|
|
2532
987
|
state2.sort = props.sort;
|
|
2533
988
|
if (props.selection)
|
|
@@ -2547,23 +1002,23 @@ function useTableState(_props) {
|
|
|
2547
1002
|
}, [state, props]);
|
|
2548
1003
|
return state;
|
|
2549
1004
|
}
|
|
2550
|
-
const ColumnHeaderContext = new StoreScope({
|
|
1005
|
+
const ColumnHeaderContext = new react$1.StoreScope({
|
|
2551
1006
|
items: /* @__PURE__ */ new Map()
|
|
2552
1007
|
});
|
|
2553
1008
|
function ColumnHeader(props) {
|
|
2554
|
-
const ref =
|
|
1009
|
+
const ref = react.useRef(null);
|
|
2555
1010
|
const columnId = useColumnContext();
|
|
2556
1011
|
const table = useTableContext();
|
|
2557
1012
|
const enabled = table.useState("props.enableColumnReorder");
|
|
2558
1013
|
const store = ColumnHeaderContext.useStore();
|
|
2559
|
-
const draggingStart =
|
|
2560
|
-
const clone =
|
|
2561
|
-
|
|
1014
|
+
const draggingStart = react.useRef();
|
|
1015
|
+
const clone = react.useRef();
|
|
1016
|
+
react.useEffect(() => {
|
|
2562
1017
|
const div = ref.current;
|
|
2563
1018
|
if (!div)
|
|
2564
1019
|
return;
|
|
2565
1020
|
store.update((state) => {
|
|
2566
|
-
state.items.set(columnId,
|
|
1021
|
+
state.items.set(columnId, immer.castDraft(div));
|
|
2567
1022
|
});
|
|
2568
1023
|
return () => {
|
|
2569
1024
|
store.update((state) => {
|
|
@@ -2590,22 +1045,22 @@ function ColumnHeader(props) {
|
|
|
2590
1045
|
});
|
|
2591
1046
|
return targetIndex === -1 ? otherCols.length : targetIndex;
|
|
2592
1047
|
}
|
|
2593
|
-
function onPointerDown(
|
|
1048
|
+
function onPointerDown(e) {
|
|
2594
1049
|
const div = ref.current;
|
|
2595
1050
|
if (!div)
|
|
2596
1051
|
return;
|
|
2597
1052
|
draggingStart.current = {
|
|
2598
|
-
mouseX:
|
|
1053
|
+
mouseX: e.clientX,
|
|
2599
1054
|
bounds: div.getBoundingClientRect()
|
|
2600
1055
|
};
|
|
2601
1056
|
}
|
|
2602
|
-
function onPointerMove(
|
|
1057
|
+
function onPointerMove(e) {
|
|
2603
1058
|
table.update((state) => {
|
|
2604
1059
|
const div = ref.current;
|
|
2605
|
-
if (!div || draggingStart.current === void 0 || Math.abs(
|
|
1060
|
+
if (!div || draggingStart.current === void 0 || Math.abs(e.clientX - draggingStart.current.mouseX) < 5)
|
|
2606
1061
|
return;
|
|
2607
|
-
|
|
2608
|
-
div.setPointerCapture(
|
|
1062
|
+
e.stopPropagation();
|
|
1063
|
+
div.setPointerCapture(e.pointerId);
|
|
2609
1064
|
if (!clone.current) {
|
|
2610
1065
|
clone.current = div.cloneNode(true);
|
|
2611
1066
|
document.body.append(clone.current);
|
|
@@ -2624,9 +1079,9 @@ function ColumnHeader(props) {
|
|
|
2624
1079
|
});
|
|
2625
1080
|
div.style.color = "rgba(0, 0, 0, 0.2)";
|
|
2626
1081
|
}
|
|
2627
|
-
clone.current.style.left = `${draggingStart.current.bounds.left +
|
|
1082
|
+
clone.current.style.left = `${draggingStart.current.bounds.left + e.clientX - draggingStart.current.mouseX}px`;
|
|
2628
1083
|
const index = state.columnOrder.indexOf(columnId);
|
|
2629
|
-
const targetIndex = calcTargetIndex(div.offsetLeft +
|
|
1084
|
+
const targetIndex = calcTargetIndex(div.offsetLeft + e.clientX - draggingStart.current.mouseX);
|
|
2630
1085
|
const columns = table.getState().columnOrder.map((id, index2) => {
|
|
2631
1086
|
var _a, _b;
|
|
2632
1087
|
return {
|
|
@@ -2635,35 +1090,35 @@ function ColumnHeader(props) {
|
|
|
2635
1090
|
width: (_b = (_a = store.getState().items.get(id)) == null ? void 0 : _a.offsetWidth) != null ? _b : 0
|
|
2636
1091
|
};
|
|
2637
1092
|
});
|
|
2638
|
-
state.columnOrder.forEach((id,
|
|
1093
|
+
state.columnOrder.forEach((id, i) => {
|
|
2639
1094
|
let offset = 0;
|
|
2640
|
-
if (
|
|
1095
|
+
if (i === index) {
|
|
2641
1096
|
if (targetIndex > index) {
|
|
2642
1097
|
offset = columns.slice(index + 1, targetIndex + 1).reduce((sum, col) => sum + col.width, 0);
|
|
2643
1098
|
} else if (targetIndex < index) {
|
|
2644
1099
|
offset = -columns.slice(targetIndex, index).reduce((sum, col) => sum + col.width, 0);
|
|
2645
1100
|
}
|
|
2646
|
-
} else if (
|
|
1101
|
+
} else if (i >= targetIndex && i < index) {
|
|
2647
1102
|
offset = div.offsetWidth;
|
|
2648
|
-
} else if (
|
|
1103
|
+
} else if (i > index && i <= targetIndex) {
|
|
2649
1104
|
offset = -div.offsetWidth;
|
|
2650
1105
|
}
|
|
2651
1106
|
state.columnStyleOverride.set(id, {
|
|
2652
1107
|
transition: "transform 500ms",
|
|
2653
1108
|
transform: `translate3d(${offset}px, 0, 0)`,
|
|
2654
|
-
zIndex:
|
|
1109
|
+
zIndex: i === index ? 1 : void 0
|
|
2655
1110
|
});
|
|
2656
1111
|
});
|
|
2657
1112
|
});
|
|
2658
1113
|
}
|
|
2659
|
-
function onPointerUp(
|
|
1114
|
+
function onPointerUp(e) {
|
|
2660
1115
|
table.update((state) => {
|
|
2661
1116
|
var _a;
|
|
2662
1117
|
const div = ref.current;
|
|
2663
1118
|
if (!div || draggingStart.current === void 0)
|
|
2664
1119
|
return;
|
|
2665
1120
|
const index = state.columnOrder.indexOf(columnId);
|
|
2666
|
-
const targetIndex = calcTargetIndex(div.offsetLeft +
|
|
1121
|
+
const targetIndex = calcTargetIndex(div.offsetLeft + e.clientX - draggingStart.current.mouseX);
|
|
2667
1122
|
state.columnOrder.splice(index, 1);
|
|
2668
1123
|
state.columnOrder.splice(targetIndex, 0, columnId);
|
|
2669
1124
|
(_a = clone.current) == null ? void 0 : _a.remove();
|
|
@@ -2673,7 +1128,7 @@ function ColumnHeader(props) {
|
|
|
2673
1128
|
clone.current = void 0;
|
|
2674
1129
|
});
|
|
2675
1130
|
}
|
|
2676
|
-
return
|
|
1131
|
+
return jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, props), {
|
|
2677
1132
|
css: {
|
|
2678
1133
|
position: "relative",
|
|
2679
1134
|
userSelect: "none"
|
|
@@ -2701,7 +1156,7 @@ function ColumnSelection() {
|
|
|
2701
1156
|
const table = useTableContext();
|
|
2702
1157
|
const columns = table.useState("props.columns");
|
|
2703
1158
|
const hiddenColumns = table.useState("hiddenColumns");
|
|
2704
|
-
const [anchorEl, setAnchorEl] =
|
|
1159
|
+
const [anchorEl, setAnchorEl] = react.useState(null);
|
|
2705
1160
|
const toggle2 = (column) => {
|
|
2706
1161
|
const {
|
|
2707
1162
|
props: {
|
|
@@ -2721,27 +1176,27 @@ function ColumnSelection() {
|
|
|
2721
1176
|
}
|
|
2722
1177
|
onHiddenColumnsChange == null ? void 0 : onHiddenColumnsChange(newValue);
|
|
2723
1178
|
};
|
|
2724
|
-
return
|
|
2725
|
-
children: [
|
|
2726
|
-
onClick: (
|
|
2727
|
-
children:
|
|
2728
|
-
}),
|
|
1179
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1180
|
+
children: [jsxRuntime.jsx(IconButton, {
|
|
1181
|
+
onClick: (e) => setAnchorEl(anchorEl ? null : e.currentTarget),
|
|
1182
|
+
children: jsxRuntime.jsx(Settings, {})
|
|
1183
|
+
}), jsxRuntime.jsx(Popover, {
|
|
2729
1184
|
anchorEl,
|
|
2730
1185
|
open: !!anchorEl,
|
|
2731
1186
|
onClose: () => setAnchorEl(null),
|
|
2732
1187
|
css: cssVariables,
|
|
2733
|
-
children:
|
|
1188
|
+
children: jsxRuntime.jsxs("div", {
|
|
2734
1189
|
css: {
|
|
2735
1190
|
padding: `calc(var(--spacing) * 2)`,
|
|
2736
1191
|
display: "grid"
|
|
2737
1192
|
},
|
|
2738
|
-
children: [
|
|
1193
|
+
children: [jsxRuntime.jsx("div", {
|
|
2739
1194
|
css: {
|
|
2740
1195
|
marginBottom: "var(--spacing)"
|
|
2741
1196
|
},
|
|
2742
1197
|
children: text.selectColumns
|
|
2743
|
-
}), columns.map((column) =>
|
|
2744
|
-
control:
|
|
1198
|
+
}), columns.map((column) => jsxRuntime.jsx(FormControlLabel, {
|
|
1199
|
+
control: jsxRuntime.jsx(Checkbox, {
|
|
2745
1200
|
checked: !hiddenColumns.has(column.id),
|
|
2746
1201
|
onChange: () => toggle2(column),
|
|
2747
1202
|
disabled: column.cannotHide
|
|
@@ -2756,7 +1211,7 @@ function csvExport(data, { sepPrefix, separator = ",", quote = '"', eol = "\n" }
|
|
|
2756
1211
|
const cells = data.map((line) => line.map((value) => {
|
|
2757
1212
|
if (typeof value === "number")
|
|
2758
1213
|
return String(value);
|
|
2759
|
-
if (![separator, quote, eol].some((
|
|
1214
|
+
if (![separator, quote, eol].some((c) => value.includes(c)))
|
|
2760
1215
|
return value;
|
|
2761
1216
|
const clean = value.replace(new RegExp(quote, "g"), `${quote}${quote}`);
|
|
2762
1217
|
return `${quote}${clean}${quote}`;
|
|
@@ -2779,7 +1234,7 @@ function Export() {
|
|
|
2779
1234
|
text
|
|
2780
1235
|
} = useTheme();
|
|
2781
1236
|
const cssVariables = useCssVariables();
|
|
2782
|
-
const [anchor, setAnchor] =
|
|
1237
|
+
const [anchor, setAnchor] = react.useState(null);
|
|
2783
1238
|
const generate = (options) => {
|
|
2784
1239
|
const {
|
|
2785
1240
|
activeColumns,
|
|
@@ -2792,23 +1247,23 @@ function Export() {
|
|
|
2792
1247
|
navigator.clipboard.writeText(generate(table.getState().props.enableExport.copy));
|
|
2793
1248
|
};
|
|
2794
1249
|
const download = () => {
|
|
2795
|
-
const
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
document.body.appendChild(
|
|
2799
|
-
|
|
2800
|
-
document.body.removeChild(
|
|
1250
|
+
const a = document.createElement("a");
|
|
1251
|
+
a.href = "data:text/csv;charset=utf-8," + encodeURIComponent(generate(table.getState().props.enableExport.download));
|
|
1252
|
+
a.download = "export.csv";
|
|
1253
|
+
document.body.appendChild(a);
|
|
1254
|
+
a.click();
|
|
1255
|
+
document.body.removeChild(a);
|
|
2801
1256
|
};
|
|
2802
|
-
return
|
|
2803
|
-
children: [
|
|
2804
|
-
onClick: (
|
|
2805
|
-
children:
|
|
2806
|
-
}),
|
|
1257
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1258
|
+
children: [jsxRuntime.jsx(IconButton, {
|
|
1259
|
+
onClick: (e) => setAnchor(anchor ? null : e.currentTarget),
|
|
1260
|
+
children: jsxRuntime.jsx(Export2, {})
|
|
1261
|
+
}), jsxRuntime.jsx(Popover, {
|
|
2807
1262
|
open: !!anchor,
|
|
2808
1263
|
onClose: () => setAnchor(null),
|
|
2809
1264
|
anchorEl: anchor,
|
|
2810
1265
|
css: cssVariables,
|
|
2811
|
-
children:
|
|
1266
|
+
children: jsxRuntime.jsxs("div", {
|
|
2812
1267
|
css: {
|
|
2813
1268
|
padding: `calc(var(--spacing) * 2)`,
|
|
2814
1269
|
display: "grid",
|
|
@@ -2818,17 +1273,17 @@ function Export() {
|
|
|
2818
1273
|
justifyContent: "start"
|
|
2819
1274
|
}
|
|
2820
1275
|
},
|
|
2821
|
-
children: [
|
|
1276
|
+
children: [jsxRuntime.jsx("div", {
|
|
2822
1277
|
css: {
|
|
2823
1278
|
marginBottom: "var(--spacing)"
|
|
2824
1279
|
},
|
|
2825
1280
|
children: text.exportTitle
|
|
2826
|
-
}),
|
|
2827
|
-
startIcon:
|
|
1281
|
+
}), jsxRuntime.jsx(Button, {
|
|
1282
|
+
startIcon: jsxRuntime.jsx(Clipboard, {}),
|
|
2828
1283
|
onClick: copy,
|
|
2829
1284
|
children: text.exportCopy
|
|
2830
|
-
}),
|
|
2831
|
-
startIcon:
|
|
1285
|
+
}), jsxRuntime.jsx(Button, {
|
|
1286
|
+
startIcon: jsxRuntime.jsx(Export2, {}),
|
|
2832
1287
|
onClick: download,
|
|
2833
1288
|
children: text.exportDownload
|
|
2834
1289
|
})]
|
|
@@ -2854,7 +1309,7 @@ function FilterControl() {
|
|
|
2854
1309
|
}
|
|
2855
1310
|
} = useTheme();
|
|
2856
1311
|
const cssVariables = useCssVariables();
|
|
2857
|
-
const [anchor, setAnchor] =
|
|
1312
|
+
const [anchor, setAnchor] = react.useState(null);
|
|
2858
1313
|
const isActive = table.useState((state) => {
|
|
2859
1314
|
const filter2 = state.filters.get(columnId);
|
|
2860
1315
|
const filterValue = state.filterValues.get(columnId);
|
|
@@ -2866,22 +1321,22 @@ function FilterControl() {
|
|
|
2866
1321
|
});
|
|
2867
1322
|
if (!filter)
|
|
2868
1323
|
return null;
|
|
2869
|
-
return
|
|
2870
|
-
children: [
|
|
2871
|
-
onClick: (
|
|
1324
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1325
|
+
children: [jsxRuntime.jsx(IconButton, {
|
|
1326
|
+
onClick: (e) => setAnchor(e.currentTarget),
|
|
2872
1327
|
css: [isActive && {
|
|
2873
1328
|
color: "white !important",
|
|
2874
1329
|
backgroundColor: "var(--primaryMain) !important"
|
|
2875
1330
|
}],
|
|
2876
|
-
children: isActive ?
|
|
2877
|
-
}),
|
|
2878
|
-
onPointerDown: (
|
|
2879
|
-
|
|
1331
|
+
children: isActive ? jsxRuntime.jsx(FilterList, {}) : jsxRuntime.jsx(ArrowDropDown, {})
|
|
1332
|
+
}), jsxRuntime.jsx("div", {
|
|
1333
|
+
onPointerDown: (e) => {
|
|
1334
|
+
e.stopPropagation();
|
|
2880
1335
|
},
|
|
2881
|
-
onPointerMove: (
|
|
2882
|
-
|
|
1336
|
+
onPointerMove: (e) => {
|
|
1337
|
+
e.stopPropagation();
|
|
2883
1338
|
},
|
|
2884
|
-
children:
|
|
1339
|
+
children: jsxRuntime.jsx(Popover, {
|
|
2885
1340
|
open: true,
|
|
2886
1341
|
hidden: !anchor,
|
|
2887
1342
|
onClose: () => setAnchor(null),
|
|
@@ -2896,37 +1351,37 @@ function ResizeHandle() {
|
|
|
2896
1351
|
const table = useTableContext();
|
|
2897
1352
|
const columnId = useColumnContext();
|
|
2898
1353
|
const enabled = table.useState("props.enableColumnResize");
|
|
2899
|
-
function onPointerDown(
|
|
2900
|
-
|
|
2901
|
-
const div =
|
|
2902
|
-
div.setPointerCapture(
|
|
2903
|
-
}
|
|
2904
|
-
function onPointerMove(
|
|
2905
|
-
|
|
2906
|
-
const div =
|
|
2907
|
-
if (!div.hasPointerCapture(
|
|
1354
|
+
function onPointerDown(e) {
|
|
1355
|
+
e.stopPropagation();
|
|
1356
|
+
const div = e.target;
|
|
1357
|
+
div.setPointerCapture(e.pointerId);
|
|
1358
|
+
}
|
|
1359
|
+
function onPointerMove(e) {
|
|
1360
|
+
e.stopPropagation();
|
|
1361
|
+
const div = e.target;
|
|
1362
|
+
if (!div.hasPointerCapture(e.pointerId))
|
|
2908
1363
|
return;
|
|
2909
1364
|
const parent = div.parentElement;
|
|
2910
|
-
const width = Math.max(
|
|
1365
|
+
const width = Math.max(e.clientX - parent.getBoundingClientRect().left + 5, 50);
|
|
2911
1366
|
table.update((state) => {
|
|
2912
1367
|
state.columnWidths.set(columnId, `${width}px`);
|
|
2913
1368
|
});
|
|
2914
1369
|
}
|
|
2915
|
-
function onPointerUp(
|
|
2916
|
-
|
|
2917
|
-
const div =
|
|
2918
|
-
div.releasePointerCapture(
|
|
1370
|
+
function onPointerUp(e) {
|
|
1371
|
+
e.stopPropagation();
|
|
1372
|
+
const div = e.target;
|
|
1373
|
+
div.releasePointerCapture(e.pointerId);
|
|
2919
1374
|
}
|
|
2920
|
-
function onDoubleClick(
|
|
1375
|
+
function onDoubleClick(e) {
|
|
2921
1376
|
table.update((state) => {
|
|
2922
|
-
if (
|
|
1377
|
+
if (e.getModifierState("Control")) {
|
|
2923
1378
|
state.columnWidths.delete(columnId);
|
|
2924
1379
|
} else {
|
|
2925
1380
|
state.columnWidths.set(columnId, "max-content");
|
|
2926
1381
|
}
|
|
2927
1382
|
});
|
|
2928
1383
|
}
|
|
2929
|
-
return
|
|
1384
|
+
return jsxRuntime.jsx("div", {
|
|
2930
1385
|
css: {
|
|
2931
1386
|
alignSelf: "stretch",
|
|
2932
1387
|
padding: "0 5px",
|
|
@@ -2947,7 +1402,7 @@ function ResizeHandle() {
|
|
|
2947
1402
|
onDoubleClick: enabled ? onDoubleClick : void 0
|
|
2948
1403
|
});
|
|
2949
1404
|
}
|
|
2950
|
-
const Cell =
|
|
1405
|
+
const Cell = react.memo(function Cell2({
|
|
2951
1406
|
itemId,
|
|
2952
1407
|
rowIndex
|
|
2953
1408
|
}) {
|
|
@@ -2955,7 +1410,7 @@ const Cell = require$$0.memo(function Cell2({
|
|
|
2955
1410
|
const table = useTableContext();
|
|
2956
1411
|
const columnId = useColumnContext();
|
|
2957
1412
|
const {
|
|
2958
|
-
|
|
1413
|
+
classes
|
|
2959
1414
|
} = useTheme();
|
|
2960
1415
|
const column = table.useState((state) => state.activeColumns.find((column2) => column2.id === columnId));
|
|
2961
1416
|
const item = table.useState((state) => state.activeItemsById.get(itemId));
|
|
@@ -2965,12 +1420,14 @@ const Cell = require$$0.memo(function Cell2({
|
|
|
2965
1420
|
if (!column || !item)
|
|
2966
1421
|
return null;
|
|
2967
1422
|
(_b = (_a = table.getState().props).debugRender) == null ? void 0 : _b.call(_a, "render cell", itemId, columnId);
|
|
2968
|
-
const classNames = [...calcClassNames(
|
|
1423
|
+
const classNames = [...calcClassNames(classes, item, rowIndex), ...calcClassNames(column == null ? void 0 : column.classes, item, rowIndex)];
|
|
2969
1424
|
const content = column.renderCell(column.value(item), item);
|
|
2970
|
-
return
|
|
1425
|
+
return jsxRuntime.jsx("div", {
|
|
1426
|
+
className: cx(...classNames),
|
|
2971
1427
|
css: [tableTheme.defaultClasses.cell, classNames, columnStyleOverride],
|
|
2972
|
-
children: typeof content === "string" ?
|
|
1428
|
+
children: typeof content === "string" ? jsxRuntime.jsx("span", {
|
|
2973
1429
|
css: tableTheme.defaultClasses.text,
|
|
1430
|
+
title: content,
|
|
2974
1431
|
children: content
|
|
2975
1432
|
}) : content
|
|
2976
1433
|
});
|
|
@@ -3024,21 +1481,21 @@ function ExpandControl({
|
|
|
3024
1481
|
}
|
|
3025
1482
|
}
|
|
3026
1483
|
if (isExpanded && hasDeferredChildren && !hasChildren) {
|
|
3027
|
-
return
|
|
1484
|
+
return jsxRuntime.jsx(Spinner, {
|
|
3028
1485
|
css: {
|
|
3029
1486
|
margin: "0 var(--spacing)"
|
|
3030
1487
|
}
|
|
3031
1488
|
});
|
|
3032
1489
|
}
|
|
3033
|
-
return
|
|
1490
|
+
return jsxRuntime.jsx(IconButton, {
|
|
3034
1491
|
onClick: toggle2,
|
|
3035
|
-
children:
|
|
1492
|
+
children: jsxRuntime.jsx("span", {
|
|
3036
1493
|
css: {
|
|
3037
1494
|
display: "inline-flex",
|
|
3038
1495
|
transition: "all 300ms",
|
|
3039
1496
|
transform: isExpanded ? "rotate3d(0, 0, 1, 90deg)" : "rotate3d(0, 0, 1, 0deg)"
|
|
3040
1497
|
},
|
|
3041
|
-
children:
|
|
1498
|
+
children: jsxRuntime.jsx(ChevronRight, {})
|
|
3042
1499
|
})
|
|
3043
1500
|
});
|
|
3044
1501
|
}
|
|
@@ -3051,12 +1508,12 @@ function SelectComponent({
|
|
|
3051
1508
|
Checkbox
|
|
3052
1509
|
}
|
|
3053
1510
|
} = useTheme();
|
|
3054
|
-
const
|
|
3055
|
-
const itemIds = itemId ? [itemId] :
|
|
1511
|
+
const isSelected = table.useState((state) => {
|
|
1512
|
+
const itemIds = itemId ? [itemId] : Array.from(state.activeItemsById.keys());
|
|
3056
1513
|
return state.activeItemsById.size > 0 && itemIds.every((itemId2) => state.selection.has(itemId2));
|
|
3057
1514
|
});
|
|
3058
|
-
function toggle2(
|
|
3059
|
-
const mouseEvent =
|
|
1515
|
+
function toggle2(e) {
|
|
1516
|
+
const mouseEvent = e.nativeEvent;
|
|
3060
1517
|
const {
|
|
3061
1518
|
activeItems,
|
|
3062
1519
|
activeItemsById,
|
|
@@ -3070,21 +1527,21 @@ function SelectComponent({
|
|
|
3070
1527
|
} = table.getState();
|
|
3071
1528
|
let range;
|
|
3072
1529
|
if (mouseEvent.shiftKey && itemId) {
|
|
3073
|
-
const
|
|
3074
|
-
const
|
|
3075
|
-
range = activeItems.slice(Math.min(
|
|
1530
|
+
const a = lastSelectedId ? activeItems.findIndex((i) => lastSelectedId === i.id) : 0;
|
|
1531
|
+
const b = activeItems.findIndex((item) => item.id === itemId);
|
|
1532
|
+
range = activeItems.slice(Math.min(a, b), Math.max(a, b) + 1);
|
|
3076
1533
|
} else {
|
|
3077
1534
|
const item = itemId ? activeItemsById.get(itemId) : void 0;
|
|
3078
1535
|
range = item ? [item] : activeItems;
|
|
3079
1536
|
}
|
|
3080
1537
|
const newSelection = new Set(selection);
|
|
3081
1538
|
for (const item of range) {
|
|
3082
|
-
if (
|
|
1539
|
+
if (isSelected)
|
|
3083
1540
|
newSelection.delete(item.id);
|
|
3084
1541
|
else
|
|
3085
1542
|
newSelection.add(item.id);
|
|
3086
1543
|
}
|
|
3087
|
-
if (selectSyncChildren &&
|
|
1544
|
+
if (selectSyncChildren && isSelected) {
|
|
3088
1545
|
for (const ancestor of getAncestors(activeItemsById, ...range)) {
|
|
3089
1546
|
newSelection.delete(ancestor);
|
|
3090
1547
|
}
|
|
@@ -3102,25 +1559,25 @@ function SelectComponent({
|
|
|
3102
1559
|
state.lastSelectedId = itemId;
|
|
3103
1560
|
});
|
|
3104
1561
|
}
|
|
3105
|
-
return
|
|
1562
|
+
return jsxRuntime.jsx(Checkbox, {
|
|
3106
1563
|
css: {
|
|
3107
1564
|
justifySelf: "start",
|
|
3108
1565
|
color: "inherit"
|
|
3109
1566
|
},
|
|
3110
|
-
checked:
|
|
1567
|
+
checked: isSelected,
|
|
3111
1568
|
onChange: toggle2
|
|
3112
1569
|
});
|
|
3113
1570
|
}
|
|
3114
|
-
function calcClassNames(
|
|
3115
|
-
return [(
|
|
1571
|
+
function calcClassNames(classes, item, index) {
|
|
1572
|
+
return [(classes == null ? void 0 : classes.cell) instanceof Function ? classes.cell(item, index) : classes == null ? void 0 : classes.cell, index % 2 === 0 && (classes == null ? void 0 : classes.evenCell), index % 2 === 1 && (classes == null ? void 0 : classes.oddCell)];
|
|
3116
1573
|
}
|
|
3117
|
-
const Row =
|
|
1574
|
+
const Row = react.memo(function Row2({
|
|
3118
1575
|
itemId,
|
|
3119
1576
|
rowIndex
|
|
3120
1577
|
}) {
|
|
3121
1578
|
var _a, _b;
|
|
3122
1579
|
const table = useTableContext();
|
|
3123
|
-
const divRef =
|
|
1580
|
+
const divRef = react.useRef(null);
|
|
3124
1581
|
const {
|
|
3125
1582
|
className,
|
|
3126
1583
|
indent,
|
|
@@ -3134,7 +1591,7 @@ const Row = require$$0.memo(function Row2({
|
|
|
3134
1591
|
const item = state.activeItemsById.get(itemId);
|
|
3135
1592
|
const index = !item ? -1 : state.activeItems.indexOf(item);
|
|
3136
1593
|
return {
|
|
3137
|
-
className: calcClassNames(state.props.
|
|
1594
|
+
className: cx(...calcClassNames(state.props.classes, item, index)),
|
|
3138
1595
|
indent: item ? getAncestors(state.activeItemsById, item).size : 0,
|
|
3139
1596
|
hasChildren: !!(item == null ? void 0 : item.children.length),
|
|
3140
1597
|
hasDeferredChildren: item && ((_b2 = (_a2 = state.props).hasDeferredChildren) == null ? void 0 : _b2.call(_a2, item)),
|
|
@@ -3143,45 +1600,48 @@ const Row = require$$0.memo(function Row2({
|
|
|
3143
1600
|
rowAction: state.props.rowAction instanceof Function ? item ? state.props.rowAction(item, index) : null : state.props.rowAction
|
|
3144
1601
|
};
|
|
3145
1602
|
});
|
|
3146
|
-
|
|
1603
|
+
react.useEffect(() => {
|
|
3147
1604
|
const div = divRef.current;
|
|
3148
1605
|
if (!div)
|
|
3149
1606
|
return;
|
|
3150
|
-
const
|
|
1607
|
+
const o = new ResizeObserver(() => {
|
|
3151
1608
|
if (!document.contains(div))
|
|
3152
1609
|
return;
|
|
3153
1610
|
table.update((state) => {
|
|
3154
1611
|
state.rowHeights.set(itemId, div.offsetHeight);
|
|
3155
1612
|
});
|
|
3156
1613
|
});
|
|
3157
|
-
|
|
3158
|
-
return () =>
|
|
1614
|
+
o.observe(div);
|
|
1615
|
+
return () => o.disconnect();
|
|
3159
1616
|
}, [divRef.current]);
|
|
3160
1617
|
(_b = (_a = table.getState().props).debugRender) == null ? void 0 : _b.call(_a, "render row", itemId);
|
|
3161
|
-
return
|
|
3162
|
-
children: [
|
|
3163
|
-
|
|
1618
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1619
|
+
children: [jsxRuntime.jsx("div", {
|
|
1620
|
+
className,
|
|
1621
|
+
css: [tableTheme.defaultClasses.cellFill],
|
|
3164
1622
|
ref: divRef
|
|
3165
|
-
}),
|
|
3166
|
-
|
|
3167
|
-
|
|
1623
|
+
}), jsxRuntime.jsxs("div", {
|
|
1624
|
+
className,
|
|
1625
|
+
css: [tableTheme.defaultClasses.cell, tableTheme.defaultClasses.firstCell],
|
|
1626
|
+
children: [jsxRuntime.jsx("div", {
|
|
3168
1627
|
css: {
|
|
3169
1628
|
width: indent * 20
|
|
3170
1629
|
}
|
|
3171
|
-
}), enableSelection &&
|
|
1630
|
+
}), enableSelection && jsxRuntime.jsx(SelectComponent, {
|
|
3172
1631
|
itemId
|
|
3173
|
-
}), (hasChildren || hasDeferredChildren) &&
|
|
1632
|
+
}), (hasChildren || hasDeferredChildren) && jsxRuntime.jsx(ExpandControl, {
|
|
3174
1633
|
itemId,
|
|
3175
1634
|
hasDeferredChildren
|
|
3176
1635
|
}), rowAction]
|
|
3177
|
-
}), columnIds.map((columnId) =>
|
|
1636
|
+
}), columnIds.map((columnId) => jsxRuntime.jsx(ColumnContext.Provider, {
|
|
3178
1637
|
value: columnId,
|
|
3179
|
-
children:
|
|
1638
|
+
children: jsxRuntime.jsx(Cell, {
|
|
3180
1639
|
itemId,
|
|
3181
1640
|
rowIndex
|
|
3182
1641
|
})
|
|
3183
|
-
}, columnId)),
|
|
3184
|
-
|
|
1642
|
+
}, columnId)), jsxRuntime.jsx("div", {
|
|
1643
|
+
className,
|
|
1644
|
+
css: [tableTheme.defaultClasses.cellFill]
|
|
3185
1645
|
})]
|
|
3186
1646
|
});
|
|
3187
1647
|
});
|
|
@@ -3203,13 +1663,13 @@ function SortComponent({
|
|
|
3203
1663
|
index
|
|
3204
1664
|
} = table.useState((state) => {
|
|
3205
1665
|
var _a, _b;
|
|
3206
|
-
const index2 = (_a = state.sort.findIndex((
|
|
1666
|
+
const index2 = (_a = state.sort.findIndex((s) => s.columnId === columnId)) != null ? _a : -1;
|
|
3207
1667
|
return {
|
|
3208
1668
|
direction: (_b = state.sort[index2]) == null ? void 0 : _b.direction,
|
|
3209
1669
|
index: index2 >= 0 && state.sort.length > 1 ? index2 + 1 : void 0
|
|
3210
1670
|
};
|
|
3211
1671
|
});
|
|
3212
|
-
function toggle2(
|
|
1672
|
+
function toggle2(e) {
|
|
3213
1673
|
const {
|
|
3214
1674
|
props: {
|
|
3215
1675
|
sort: controlledSort,
|
|
@@ -3217,7 +1677,7 @@ function SortComponent({
|
|
|
3217
1677
|
}
|
|
3218
1678
|
} = table.getState();
|
|
3219
1679
|
const newDirection = direction === "asc" ? "desc" : "asc";
|
|
3220
|
-
const newSort = (
|
|
1680
|
+
const newSort = (e.getModifierState("Control") ? table.getState().sort.filter((s) => s.columnId !== columnId) : []).concat({
|
|
3221
1681
|
columnId,
|
|
3222
1682
|
direction: newDirection
|
|
3223
1683
|
});
|
|
@@ -3228,7 +1688,7 @@ function SortComponent({
|
|
|
3228
1688
|
});
|
|
3229
1689
|
}
|
|
3230
1690
|
}
|
|
3231
|
-
return
|
|
1691
|
+
return jsxRuntime.jsxs("div", {
|
|
3232
1692
|
css: {
|
|
3233
1693
|
userSelect: "none",
|
|
3234
1694
|
display: "grid",
|
|
@@ -3241,11 +1701,11 @@ function SortComponent({
|
|
|
3241
1701
|
}
|
|
3242
1702
|
},
|
|
3243
1703
|
onClick: toggle2,
|
|
3244
|
-
children: [
|
|
1704
|
+
children: [jsxRuntime.jsx("div", {
|
|
3245
1705
|
children
|
|
3246
|
-
}),
|
|
1706
|
+
}), jsxRuntime.jsx(Badge, {
|
|
3247
1707
|
badgeContent: index,
|
|
3248
|
-
children:
|
|
1708
|
+
children: jsxRuntime.jsx("span", {
|
|
3249
1709
|
css: [{
|
|
3250
1710
|
transition: "all 300ms",
|
|
3251
1711
|
fontSize: "0.8em"
|
|
@@ -3254,12 +1714,12 @@ function SortComponent({
|
|
|
3254
1714
|
}, direction === "desc" && {
|
|
3255
1715
|
transform: "rotate3d(0, 0, 1, 180deg)"
|
|
3256
1716
|
}],
|
|
3257
|
-
children:
|
|
1717
|
+
children: jsxRuntime.jsx(ArrowUpward, {})
|
|
3258
1718
|
})
|
|
3259
1719
|
})]
|
|
3260
1720
|
});
|
|
3261
1721
|
}
|
|
3262
|
-
function throttle(
|
|
1722
|
+
function throttle(fn, ms) {
|
|
3263
1723
|
let last = 0;
|
|
3264
1724
|
let lastArgs;
|
|
3265
1725
|
let timeout;
|
|
@@ -3268,7 +1728,7 @@ function throttle(fn2, ms) {
|
|
|
3268
1728
|
last = Date.now();
|
|
3269
1729
|
lastArgs = void 0;
|
|
3270
1730
|
timeout = void 0;
|
|
3271
|
-
|
|
1731
|
+
fn(...args);
|
|
3272
1732
|
}
|
|
3273
1733
|
return Object.assign(function(...args) {
|
|
3274
1734
|
const now = Date.now();
|
|
@@ -3288,9 +1748,9 @@ function throttle(fn2, ms) {
|
|
|
3288
1748
|
}
|
|
3289
1749
|
});
|
|
3290
1750
|
}
|
|
3291
|
-
const onAncestorScroll = (
|
|
3292
|
-
const find = (
|
|
3293
|
-
const ancestors = find(
|
|
1751
|
+
const onAncestorScroll = (x, onScroll) => {
|
|
1752
|
+
const find = (x2) => x2.parentElement ? [x2.parentElement, ...find(x2.parentElement)] : [document];
|
|
1753
|
+
const ancestors = find(x);
|
|
3294
1754
|
for (const ancestor of ancestors) {
|
|
3295
1755
|
ancestor.addEventListener("scroll", onScroll);
|
|
3296
1756
|
}
|
|
@@ -3300,19 +1760,19 @@ const onAncestorScroll = (x2, onScroll) => {
|
|
|
3300
1760
|
}
|
|
3301
1761
|
};
|
|
3302
1762
|
};
|
|
3303
|
-
const findScrollRoot = (
|
|
3304
|
-
const parent =
|
|
1763
|
+
const findScrollRoot = (x) => {
|
|
1764
|
+
const parent = x.parentElement;
|
|
3305
1765
|
if (!parent)
|
|
3306
1766
|
return document.documentElement;
|
|
3307
1767
|
if (parent.scrollHeight > parent.clientHeight)
|
|
3308
1768
|
return parent;
|
|
3309
1769
|
return findScrollRoot(parent);
|
|
3310
1770
|
};
|
|
3311
|
-
const relativeOffset = (
|
|
3312
|
-
if (
|
|
3313
|
-
return
|
|
3314
|
-
if (
|
|
3315
|
-
return relativeOffset(
|
|
1771
|
+
const relativeOffset = (x, y) => {
|
|
1772
|
+
if (x.offsetParent === y.offsetParent || !x.offsetParent)
|
|
1773
|
+
return x.offsetTop - y.offsetTop;
|
|
1774
|
+
if (x.offsetParent instanceof HTMLElement)
|
|
1775
|
+
return relativeOffset(x.offsetParent, y) + x.offsetTop;
|
|
3316
1776
|
return 0;
|
|
3317
1777
|
};
|
|
3318
1778
|
function Virtualized(_c) {
|
|
@@ -3326,8 +1786,8 @@ function Virtualized(_c) {
|
|
|
3326
1786
|
var _a, _b, _c2, _d2;
|
|
3327
1787
|
const table = useTableContext();
|
|
3328
1788
|
const virtual = table.useState("props.virtual");
|
|
3329
|
-
const probeRef =
|
|
3330
|
-
const [, setCounter] =
|
|
1789
|
+
const probeRef = react.useRef(null);
|
|
1790
|
+
const [, setCounter] = react.useState(0);
|
|
3331
1791
|
const {
|
|
3332
1792
|
itemIds = [],
|
|
3333
1793
|
from = 0,
|
|
@@ -3354,26 +1814,26 @@ function Virtualized(_c) {
|
|
|
3354
1814
|
let totalHeight = 0;
|
|
3355
1815
|
const rowHeights = itemIds2.map((itemId, index) => {
|
|
3356
1816
|
var _a3, _b2;
|
|
3357
|
-
const
|
|
3358
|
-
totalHeight +=
|
|
3359
|
-
return
|
|
1817
|
+
const h = (_b2 = (_a3 = rowHeight != null ? rowHeight : state.rowHeights.get(itemId)) != null ? _a3 : initalRowHeight) != null ? _b2 : index === 0 ? 100 : totalHeight / index;
|
|
1818
|
+
totalHeight += h;
|
|
1819
|
+
return h;
|
|
3360
1820
|
});
|
|
3361
1821
|
const probeOffset = relativeOffset(probeRef.current, root);
|
|
3362
1822
|
const headerHeight = probeRef.current.offsetTop;
|
|
3363
1823
|
const topOfTable = root.scrollTop - probeOffset + headerHeight;
|
|
3364
1824
|
const bottomOfTable = topOfTable + root.clientHeight - headerHeight;
|
|
3365
1825
|
let from2 = 0, to2 = itemIds2.length, before2 = 0, after2 = 0;
|
|
3366
|
-
for (const
|
|
3367
|
-
if (before2 +
|
|
1826
|
+
for (const h of rowHeights) {
|
|
1827
|
+
if (before2 + h > topOfTable - (overscanTop != null ? overscanTop : overscan))
|
|
3368
1828
|
break;
|
|
3369
1829
|
from2++;
|
|
3370
|
-
before2 +=
|
|
1830
|
+
before2 += h;
|
|
3371
1831
|
}
|
|
3372
|
-
for (const
|
|
3373
|
-
if (after2 +
|
|
1832
|
+
for (const h of rowHeights.reverse()) {
|
|
1833
|
+
if (after2 + h > totalHeight - bottomOfTable - (overscanBottom != null ? overscanBottom : overscan))
|
|
3374
1834
|
break;
|
|
3375
1835
|
to2--;
|
|
3376
|
-
after2 +=
|
|
1836
|
+
after2 += h;
|
|
3377
1837
|
}
|
|
3378
1838
|
return {
|
|
3379
1839
|
itemIds: itemIds2.slice(from2, to2),
|
|
@@ -3384,21 +1844,21 @@ function Virtualized(_c) {
|
|
|
3384
1844
|
};
|
|
3385
1845
|
});
|
|
3386
1846
|
const throttleScroll = (_b = (_a = typeof virtual === "boolean" ? void 0 : virtual) == null ? void 0 : _a.throttleScroll) != null ? _b : 500;
|
|
3387
|
-
const incCounter =
|
|
3388
|
-
|
|
1847
|
+
const incCounter = react.useMemo(() => throttle(() => setCounter((c) => c + 1), throttleScroll), [throttleScroll]);
|
|
1848
|
+
react.useEffect(() => {
|
|
3389
1849
|
if (!virtual || !probeRef.current)
|
|
3390
1850
|
return;
|
|
3391
1851
|
return onAncestorScroll(probeRef.current, incCounter);
|
|
3392
1852
|
}, [probeRef.current, incCounter]);
|
|
3393
1853
|
(_d2 = (_c2 = table.getState().props).debugRender) == null ? void 0 : _d2.call(_c2, `Virtualalized render ${from} to ${to}`);
|
|
3394
|
-
return
|
|
3395
|
-
children: [header, virtual &&
|
|
1854
|
+
return jsxRuntime.jsxs("div", __spreadProps(__spreadValues({}, props), {
|
|
1855
|
+
children: [header, virtual && jsxRuntime.jsx("div", {
|
|
3396
1856
|
style: {
|
|
3397
1857
|
gridColumn: "1 / -1",
|
|
3398
1858
|
height: before
|
|
3399
1859
|
},
|
|
3400
1860
|
ref: probeRef
|
|
3401
|
-
}), children(itemIds, from), virtual &&
|
|
1861
|
+
}), children(itemIds, from), virtual && jsxRuntime.jsx("div", {
|
|
3402
1862
|
style: {
|
|
3403
1863
|
gridColumn: "1 / -1",
|
|
3404
1864
|
height: after
|
|
@@ -3406,16 +1866,16 @@ function Virtualized(_c) {
|
|
|
3406
1866
|
})]
|
|
3407
1867
|
}));
|
|
3408
1868
|
}
|
|
3409
|
-
const TableContext =
|
|
3410
|
-
const ColumnContext =
|
|
1869
|
+
const TableContext = react.createContext(null);
|
|
1870
|
+
const ColumnContext = react.createContext(null);
|
|
3411
1871
|
function useTableContext() {
|
|
3412
|
-
const value =
|
|
1872
|
+
const value = react.useContext(TableContext);
|
|
3413
1873
|
if (!value)
|
|
3414
1874
|
throw Error("No table context available");
|
|
3415
1875
|
return value;
|
|
3416
1876
|
}
|
|
3417
1877
|
function useColumnContext() {
|
|
3418
|
-
const value =
|
|
1878
|
+
const value = react.useContext(ColumnContext);
|
|
3419
1879
|
if (value === null)
|
|
3420
1880
|
throw Error("No column context available");
|
|
3421
1881
|
return value;
|
|
@@ -3424,9 +1884,9 @@ function Table(props) {
|
|
|
3424
1884
|
var _a, _b;
|
|
3425
1885
|
const table = useTableState(props);
|
|
3426
1886
|
(_b = (_a = table.getState().props).debugRender) == null ? void 0 : _b.call(_a, "render table");
|
|
3427
|
-
return
|
|
1887
|
+
return jsxRuntime.jsx(TableContext.Provider, {
|
|
3428
1888
|
value: table,
|
|
3429
|
-
children:
|
|
1889
|
+
children: jsxRuntime.jsx(TableLoadingState, {})
|
|
3430
1890
|
});
|
|
3431
1891
|
}
|
|
3432
1892
|
function TableLoadingState() {
|
|
@@ -3434,20 +1894,20 @@ function TableLoadingState() {
|
|
|
3434
1894
|
text
|
|
3435
1895
|
} = useTheme();
|
|
3436
1896
|
const isHydrated = useTableStateStorage();
|
|
3437
|
-
const [showLoading, setShowLoading] =
|
|
3438
|
-
|
|
1897
|
+
const [showLoading, setShowLoading] = react.useState(false);
|
|
1898
|
+
react.useEffect(() => {
|
|
3439
1899
|
const handle = setTimeout(() => setShowLoading(true), 500);
|
|
3440
1900
|
return () => clearTimeout(handle);
|
|
3441
1901
|
});
|
|
3442
|
-
return
|
|
3443
|
-
children: [!isHydrated && showLoading &&
|
|
1902
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1903
|
+
children: [!isHydrated && showLoading && jsxRuntime.jsx("div", {
|
|
3444
1904
|
children: text.loading
|
|
3445
|
-
}),
|
|
1905
|
+
}), jsxRuntime.jsx(TableInner, {
|
|
3446
1906
|
hidden: !isHydrated
|
|
3447
1907
|
})]
|
|
3448
1908
|
});
|
|
3449
1909
|
}
|
|
3450
|
-
const TableInner =
|
|
1910
|
+
const TableInner = react.memo(function TableInner2({
|
|
3451
1911
|
hidden
|
|
3452
1912
|
}) {
|
|
3453
1913
|
var _a, _b;
|
|
@@ -3456,7 +1916,7 @@ const TableInner = require$$0.memo(function TableInner2({
|
|
|
3456
1916
|
const activeColumns = table.useState((state) => state.activeColumns.map((column) => ({
|
|
3457
1917
|
id: column.id,
|
|
3458
1918
|
width: column.width,
|
|
3459
|
-
|
|
1919
|
+
classes: column.classes,
|
|
3460
1920
|
header: column.header
|
|
3461
1921
|
})));
|
|
3462
1922
|
const columnWidths = table.useState("columnWidths", {
|
|
@@ -3466,15 +1926,16 @@ const TableInner = require$$0.memo(function TableInner2({
|
|
|
3466
1926
|
throttle: 16
|
|
3467
1927
|
});
|
|
3468
1928
|
const defaultWidth = table.useState("props.defaultWidth");
|
|
3469
|
-
const
|
|
1929
|
+
const classes = table.useState("props.classes");
|
|
3470
1930
|
const stickyHeader = table.useState("props.stickyHeader");
|
|
3471
1931
|
const enableSelection = table.useState("props.enableSelection");
|
|
3472
1932
|
const enableColumnSelection = table.useState("props.enableColumnSelection");
|
|
3473
1933
|
const enableExport = table.useState((state) => !!state.props.enableExport.copy || !!state.props.enableExport.download);
|
|
3474
1934
|
const cssVariables = useCssVariables();
|
|
3475
1935
|
(_b = (_a = table.getState().props).debugRender) == null ? void 0 : _b.call(_a, "render table inner");
|
|
3476
|
-
return
|
|
3477
|
-
|
|
1936
|
+
return jsxRuntime.jsx(Virtualized, {
|
|
1937
|
+
className: `${classes == null ? void 0 : classes.table}`,
|
|
1938
|
+
css: [cssVariables, tableTheme.defaultClasses.table, {
|
|
3478
1939
|
gridTemplateColumns: [
|
|
3479
1940
|
fullWidth === "right" || fullWidth === true ? "auto" : "0",
|
|
3480
1941
|
"max-content",
|
|
@@ -3487,34 +1948,38 @@ const TableInner = require$$0.memo(function TableInner2({
|
|
|
3487
1948
|
}, hidden && {
|
|
3488
1949
|
visibility: "hidden"
|
|
3489
1950
|
}],
|
|
3490
|
-
header:
|
|
3491
|
-
children: [
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
1951
|
+
header: jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1952
|
+
children: [jsxRuntime.jsx("div", {
|
|
1953
|
+
className: classes == null ? void 0 : classes.headerCell,
|
|
1954
|
+
css: [tableTheme.defaultClasses.headerFill, stickyHeader && tableTheme.defaultClasses.sticky]
|
|
1955
|
+
}), jsxRuntime.jsxs("div", {
|
|
1956
|
+
className: classes == null ? void 0 : classes.headerCell,
|
|
1957
|
+
css: [tableTheme.defaultClasses.headerCell, stickyHeader && tableTheme.defaultClasses.sticky],
|
|
1958
|
+
children: [enableSelection && jsxRuntime.jsx(SelectComponent, {}), enableColumnSelection && jsxRuntime.jsx(ColumnSelection, {}), enableExport && jsxRuntime.jsx(Export, {})]
|
|
1959
|
+
}), jsxRuntime.jsx(ColumnHeaderContext.Provider, {
|
|
3497
1960
|
children: activeColumns.map((column) => {
|
|
3498
1961
|
var _a2;
|
|
3499
|
-
return
|
|
1962
|
+
return jsxRuntime.jsx(ColumnContext.Provider, {
|
|
3500
1963
|
value: column.id,
|
|
3501
|
-
children:
|
|
3502
|
-
|
|
3503
|
-
|
|
1964
|
+
children: jsxRuntime.jsxs(ColumnHeader, {
|
|
1965
|
+
className: cx(classes == null ? void 0 : classes.headerCell, (_a2 = column.classes) == null ? void 0 : _a2.headerCell),
|
|
1966
|
+
css: [tableTheme.defaultClasses.headerCell, columnStyleOverride.get(column.id), stickyHeader && tableTheme.defaultClasses.sticky],
|
|
1967
|
+
children: [jsxRuntime.jsx(FilterControl, {}), jsxRuntime.jsx(SortComponent, {
|
|
3504
1968
|
children: column.header
|
|
3505
|
-
}),
|
|
1969
|
+
}), jsxRuntime.jsx("div", {
|
|
3506
1970
|
css: {
|
|
3507
1971
|
flex: 1
|
|
3508
1972
|
}
|
|
3509
|
-
}),
|
|
1973
|
+
}), jsxRuntime.jsx(ResizeHandle, {})]
|
|
3510
1974
|
}, column.id)
|
|
3511
1975
|
}, column.id);
|
|
3512
1976
|
})
|
|
3513
|
-
}),
|
|
3514
|
-
|
|
1977
|
+
}), jsxRuntime.jsx("div", {
|
|
1978
|
+
className: classes == null ? void 0 : classes.headerCell,
|
|
1979
|
+
css: [tableTheme.defaultClasses.headerFill, stickyHeader && tableTheme.defaultClasses.sticky]
|
|
3515
1980
|
})]
|
|
3516
1981
|
}),
|
|
3517
|
-
children: (itemIds, startIndex) => itemIds.map((itemId, index) =>
|
|
1982
|
+
children: (itemIds, startIndex) => itemIds.map((itemId, index) => jsxRuntime.jsx(Row, {
|
|
3518
1983
|
itemId,
|
|
3519
1984
|
rowIndex: startIndex + index
|
|
3520
1985
|
}, itemId))
|
|
@@ -3563,10 +2028,10 @@ function SelectFilter(_e) {
|
|
|
3563
2028
|
const column = state.activeColumns.find((column2) => column2.id === columnId);
|
|
3564
2029
|
if (!column)
|
|
3565
2030
|
return [];
|
|
3566
|
-
const filterBy = (_a = props.filterBy) != null ? _a : (
|
|
2031
|
+
const filterBy = (_a = props.filterBy) != null ? _a : (x) => x;
|
|
3567
2032
|
return uniq(flatMap(state.items, (item) => castArray(filterBy(column.value(item), item))));
|
|
3568
2033
|
});
|
|
3569
|
-
const [query, setQuery] =
|
|
2034
|
+
const [query, setQuery] = react.useState("");
|
|
3570
2035
|
const filtered = options.filter((option) => !query || stringValue(option).toLowerCase().includes(query.toLowerCase()));
|
|
3571
2036
|
const {
|
|
3572
2037
|
value = /* @__PURE__ */ new Set(),
|
|
@@ -3580,13 +2045,13 @@ function SelectFilter(_e) {
|
|
|
3580
2045
|
return filterValue.has(value2);
|
|
3581
2046
|
}
|
|
3582
2047
|
}));
|
|
3583
|
-
return
|
|
2048
|
+
return jsxRuntime.jsxs("div", {
|
|
3584
2049
|
css: {
|
|
3585
2050
|
padding: "calc(var(--spacing) * 2)",
|
|
3586
2051
|
display: "grid",
|
|
3587
2052
|
gap: "var(--spacing)"
|
|
3588
2053
|
},
|
|
3589
|
-
children: [
|
|
2054
|
+
children: [jsxRuntime.jsxs("div", {
|
|
3590
2055
|
css: {
|
|
3591
2056
|
marginBottom: "var(--spacing)",
|
|
3592
2057
|
display: "grid",
|
|
@@ -3595,31 +2060,37 @@ function SelectFilter(_e) {
|
|
|
3595
2060
|
justifyContent: "space-between",
|
|
3596
2061
|
alignItems: "center"
|
|
3597
2062
|
},
|
|
3598
|
-
children: [
|
|
2063
|
+
children: [jsxRuntime.jsx("div", {
|
|
3599
2064
|
children: text.selectFilter
|
|
3600
|
-
}),
|
|
2065
|
+
}), jsxRuntime.jsx(Button, {
|
|
3601
2066
|
variant: "contained",
|
|
3602
2067
|
onClick: () => onChange(/* @__PURE__ */ new Set()),
|
|
3603
2068
|
disabled: value.size === 0,
|
|
3604
2069
|
children: text.reset
|
|
3605
2070
|
})]
|
|
3606
|
-
}),
|
|
2071
|
+
}), jsxRuntime.jsx(TextField, {
|
|
3607
2072
|
value: query,
|
|
3608
|
-
onChange: (
|
|
3609
|
-
endIcon:
|
|
2073
|
+
onChange: (e) => setQuery(e.target.value),
|
|
2074
|
+
endIcon: jsxRuntime.jsx(IconButton, {
|
|
3610
2075
|
onClick: () => setQuery(""),
|
|
3611
|
-
children: !query ?
|
|
2076
|
+
children: !query ? jsxRuntime.jsx(Search, {}) : jsxRuntime.jsx(Clear, {})
|
|
3612
2077
|
}),
|
|
3613
2078
|
css: {
|
|
3614
2079
|
marginBottom: "var(--spacing)"
|
|
3615
2080
|
}
|
|
3616
|
-
}),
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
}
|
|
3621
|
-
|
|
3622
|
-
|
|
2081
|
+
}), jsxRuntime.jsx("div", {
|
|
2082
|
+
css: {
|
|
2083
|
+
maxHeight: "20em",
|
|
2084
|
+
overflowY: "auto"
|
|
2085
|
+
},
|
|
2086
|
+
children: filtered.map((option, index) => jsxRuntime.jsx(FormControlLabel, {
|
|
2087
|
+
control: jsxRuntime.jsx(Checkbox, {
|
|
2088
|
+
checked: value.has(option),
|
|
2089
|
+
onChange: () => onChange(toggle(value, option, singleSelect))
|
|
2090
|
+
}),
|
|
2091
|
+
label: render(option)
|
|
2092
|
+
}, index))
|
|
2093
|
+
}), filtered.length === 0 && jsxRuntime.jsx("span", {
|
|
3623
2094
|
css: {
|
|
3624
2095
|
textAlign: "center"
|
|
3625
2096
|
},
|
|
@@ -3627,14 +2098,14 @@ function SelectFilter(_e) {
|
|
|
3627
2098
|
})]
|
|
3628
2099
|
});
|
|
3629
2100
|
}
|
|
3630
|
-
function debounce(
|
|
2101
|
+
function debounce(fn, ms) {
|
|
3631
2102
|
let lastArgs;
|
|
3632
2103
|
let timeout;
|
|
3633
2104
|
function run() {
|
|
3634
2105
|
const args = lastArgs;
|
|
3635
2106
|
lastArgs = void 0;
|
|
3636
2107
|
timeout = void 0;
|
|
3637
|
-
|
|
2108
|
+
fn(...args);
|
|
3638
2109
|
}
|
|
3639
2110
|
return Object.assign(function(...args) {
|
|
3640
2111
|
lastArgs = args;
|
|
@@ -3655,16 +2126,16 @@ function useFilter(impl) {
|
|
|
3655
2126
|
var _a;
|
|
3656
2127
|
const table = useTableContext();
|
|
3657
2128
|
const columnId = useColumnContext();
|
|
3658
|
-
|
|
2129
|
+
react.useEffect(() => {
|
|
3659
2130
|
table.update((state) => {
|
|
3660
2131
|
if (impl.defaultValue !== void 0) {
|
|
3661
2132
|
state.filterValues.set(columnId, impl.defaultValue);
|
|
3662
2133
|
}
|
|
3663
2134
|
});
|
|
3664
2135
|
}, []);
|
|
3665
|
-
|
|
2136
|
+
react.useEffect(() => {
|
|
3666
2137
|
table.update((state) => {
|
|
3667
|
-
state.filters.set(columnId,
|
|
2138
|
+
state.filters.set(columnId, immer.castDraft(impl));
|
|
3668
2139
|
if (impl.value !== void 0) {
|
|
3669
2140
|
state.filterValues.set(columnId, impl.value);
|
|
3670
2141
|
}
|
|
@@ -3676,12 +2147,12 @@ function useFilter(impl) {
|
|
|
3676
2147
|
};
|
|
3677
2148
|
}, [table, columnId, ...(_a = impl.dependencies) != null ? _a : [impl]]);
|
|
3678
2149
|
const value = table.useState((state) => state.filterValues.get(columnId));
|
|
3679
|
-
const [dirtyValue, setDirtyValue] =
|
|
3680
|
-
const implRef =
|
|
3681
|
-
|
|
2150
|
+
const [dirtyValue, setDirtyValue] = react.useState();
|
|
2151
|
+
const implRef = react.useRef(impl);
|
|
2152
|
+
react.useLayoutEffect(() => {
|
|
3682
2153
|
implRef.current = impl;
|
|
3683
2154
|
});
|
|
3684
|
-
const delayedUpdate =
|
|
2155
|
+
const delayedUpdate = react.useMemo(() => debounce((value2) => {
|
|
3685
2156
|
const { value: controlledValue, onChange: onChange2 } = implRef.current;
|
|
3686
2157
|
if (controlledValue === void 0) {
|
|
3687
2158
|
table.update((state) => {
|
|
@@ -3694,7 +2165,7 @@ function useFilter(impl) {
|
|
|
3694
2165
|
setDirtyValue(value2);
|
|
3695
2166
|
delayedUpdate(value2);
|
|
3696
2167
|
}
|
|
3697
|
-
|
|
2168
|
+
react.useEffect(() => delayedUpdate.flush(), [delayedUpdate]);
|
|
3698
2169
|
return {
|
|
3699
2170
|
value: dirtyValue != null ? dirtyValue : value,
|
|
3700
2171
|
onChange
|
|
@@ -3706,12 +2177,12 @@ const textMatch = (text, query) => {
|
|
|
3706
2177
|
return query.split(/\s+/).every((part) => termMatch(text, part));
|
|
3707
2178
|
};
|
|
3708
2179
|
const termMatch = (text, query) => {
|
|
3709
|
-
let
|
|
2180
|
+
let i = 0;
|
|
3710
2181
|
outer:
|
|
3711
2182
|
for (const char of query) {
|
|
3712
|
-
for (;
|
|
3713
|
-
if (text[
|
|
3714
|
-
|
|
2183
|
+
for (; i < text.length; i++) {
|
|
2184
|
+
if (text[i] === char) {
|
|
2185
|
+
i++;
|
|
3715
2186
|
continue outer;
|
|
3716
2187
|
}
|
|
3717
2188
|
}
|
|
@@ -3752,13 +2223,13 @@ function TextFilter(_g) {
|
|
|
3752
2223
|
return compare(value2, filterValue);
|
|
3753
2224
|
}
|
|
3754
2225
|
}));
|
|
3755
|
-
return
|
|
2226
|
+
return jsxRuntime.jsxs("div", {
|
|
3756
2227
|
css: {
|
|
3757
2228
|
padding: `calc(var(--spacing) * 2)`,
|
|
3758
2229
|
display: "grid",
|
|
3759
2230
|
gap: "var(--spacing)"
|
|
3760
2231
|
},
|
|
3761
|
-
children: [
|
|
2232
|
+
children: [jsxRuntime.jsxs("div", {
|
|
3762
2233
|
css: {
|
|
3763
2234
|
marginBottom: "var(--spacing)",
|
|
3764
2235
|
display: "grid",
|
|
@@ -3767,26 +2238,28 @@ function TextFilter(_g) {
|
|
|
3767
2238
|
justifyContent: "space-between",
|
|
3768
2239
|
alignItems: "center"
|
|
3769
2240
|
},
|
|
3770
|
-
children: [
|
|
2241
|
+
children: [jsxRuntime.jsx("div", {
|
|
3771
2242
|
children: text.textFilter
|
|
3772
|
-
}),
|
|
2243
|
+
}), jsxRuntime.jsx(Button, {
|
|
3773
2244
|
variant: "contained",
|
|
3774
2245
|
onClick: () => onChange(""),
|
|
3775
2246
|
disabled: !value,
|
|
3776
2247
|
children: text.reset
|
|
3777
2248
|
})]
|
|
3778
|
-
}),
|
|
2249
|
+
}), jsxRuntime.jsx(TextField, {
|
|
3779
2250
|
value,
|
|
3780
|
-
onChange: (
|
|
3781
|
-
endIcon:
|
|
2251
|
+
onChange: (e) => onChange(e.target.value),
|
|
2252
|
+
endIcon: jsxRuntime.jsx(IconButton, {
|
|
3782
2253
|
onClick: () => onChange(""),
|
|
3783
|
-
children: !value ?
|
|
2254
|
+
children: !value ? jsxRuntime.jsx(Search, {}) : jsxRuntime.jsx(Clear, {})
|
|
3784
2255
|
})
|
|
3785
2256
|
})]
|
|
3786
2257
|
});
|
|
3787
2258
|
}
|
|
3788
2259
|
exports.TableThemeContext = tableTheme.TableThemeContext;
|
|
2260
|
+
exports.TableThemeProvider = tableTheme.TableThemeProvider;
|
|
3789
2261
|
exports.configureTableTheme = tableTheme.configureTableTheme;
|
|
2262
|
+
exports.mergeThemes = tableTheme.mergeThemes;
|
|
3790
2263
|
exports.ColumnContext = ColumnContext;
|
|
3791
2264
|
exports.DateFilter = DateFilter;
|
|
3792
2265
|
exports.SelectFilter = SelectFilter;
|