@ballistix.digital/react-components 0.4.114 → 0.4.116
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/index.d.ts +93 -47
- package/dist/index.esm.js +2291 -229
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2290 -227
- package/dist/index.js.map +1 -1
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -5
package/dist/index.js
CHANGED
|
@@ -48,6 +48,61 @@ var __assign = function() {
|
|
|
48
48
|
return __assign.apply(this, arguments);
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
52
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
53
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
54
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
55
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
56
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
57
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function __generator(thisArg, body) {
|
|
62
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
63
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
64
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
65
|
+
function step(op) {
|
|
66
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
67
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
68
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
69
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
70
|
+
switch (op[0]) {
|
|
71
|
+
case 0: case 1: t = op; break;
|
|
72
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
73
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
74
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
75
|
+
default:
|
|
76
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
77
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
78
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
79
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
80
|
+
if (t[2]) _.ops.pop();
|
|
81
|
+
_.trys.pop(); continue;
|
|
82
|
+
}
|
|
83
|
+
op = body.call(thisArg, _);
|
|
84
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
85
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function __read(o, n) {
|
|
90
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
91
|
+
if (!m) return o;
|
|
92
|
+
var i = m.call(o), r, ar = [], e;
|
|
93
|
+
try {
|
|
94
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
95
|
+
}
|
|
96
|
+
catch (error) { e = { error: error }; }
|
|
97
|
+
finally {
|
|
98
|
+
try {
|
|
99
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
100
|
+
}
|
|
101
|
+
finally { if (e) throw e.error; }
|
|
102
|
+
}
|
|
103
|
+
return ar;
|
|
104
|
+
}
|
|
105
|
+
|
|
51
106
|
function __spreadArray(to, from, pack) {
|
|
52
107
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
53
108
|
if (ar || !(i in from)) {
|
|
@@ -99,10 +154,10 @@ var deepCopyObject = function (object) {
|
|
|
99
154
|
var AvatarElement = function (props) {
|
|
100
155
|
var src = props.src, placeholder = props.placeholder, children = props.children, url = props.url, _a = props.size, size = _a === void 0 ? 'md' : _a, _b = props.figure, figure = _b === void 0 ? 'block' : _b, status = props.status, isDisabled = props.isDisabled, isLoading = props.isLoading, stylesOverrides = props.styles;
|
|
101
156
|
var handleGenerateStyle = function () {
|
|
102
|
-
var result = deepCopyObject(styles$
|
|
103
|
-
var keys = calculateNestedKeys(styles$
|
|
157
|
+
var result = deepCopyObject(styles$p.base);
|
|
158
|
+
var keys = calculateNestedKeys(styles$p.base);
|
|
104
159
|
keys.forEach(function (key) {
|
|
105
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
160
|
+
lodash.set(result, key, toClassName(lodash.get(styles$p.base, key), size && lodash.get(styles$p[size], key), figure && lodash.get(styles$p[figure], key), status && lodash.get(styles$p[status], key), isDisabled && lodash.get(styles$p.disabled, key), isLoading && lodash.get(styles$p.loading, key), lodash.get(stylesOverrides, key)));
|
|
106
161
|
});
|
|
107
162
|
return result;
|
|
108
163
|
};
|
|
@@ -120,7 +175,7 @@ var AvatarElement = function (props) {
|
|
|
120
175
|
return (jsxRuntime.jsx("a", { href: url, children: jsxRuntime.jsxs("div", { className: "flex items-center", children: [jsxRuntime.jsxs("span", { className: "flex items-center justify-center", children: [jsxRuntime.jsx("div", { className: styles.container, style: { backgroundImage: "url(".concat(src, ")") } }), status && jsxRuntime.jsx("span", { className: styles.indicator })] }), children && jsxRuntime.jsx("div", { className: "ml-3", children: children })] }) }));
|
|
121
176
|
};
|
|
122
177
|
|
|
123
|
-
var base$
|
|
178
|
+
var base$n = {
|
|
124
179
|
loading: 'inline-block relative overflow-hidden bg-gray-50 flex items-center justify-center',
|
|
125
180
|
spinner: 'w-5 h-5 animate-spin text-gray-400',
|
|
126
181
|
empty: 'inline-block relative overflow-hidden bg-gray-50 text-red-400',
|
|
@@ -183,7 +238,7 @@ var rounded$2 = {
|
|
|
183
238
|
placeholder: 'rounded-full',
|
|
184
239
|
container: 'rounded-full',
|
|
185
240
|
};
|
|
186
|
-
var disabled$
|
|
241
|
+
var disabled$7 = {
|
|
187
242
|
container: 'opacity-20 cursor-not-allowed',
|
|
188
243
|
};
|
|
189
244
|
var loading$2 = {
|
|
@@ -198,8 +253,8 @@ var online = {
|
|
|
198
253
|
var blocked = {
|
|
199
254
|
indicator: 'bg-red-400',
|
|
200
255
|
};
|
|
201
|
-
var styles$
|
|
202
|
-
base: base$
|
|
256
|
+
var styles$p = {
|
|
257
|
+
base: base$n,
|
|
203
258
|
xs: xs$4,
|
|
204
259
|
sm: sm$5,
|
|
205
260
|
md: md$4,
|
|
@@ -210,17 +265,17 @@ var styles$o = {
|
|
|
210
265
|
offline: offline,
|
|
211
266
|
online: online,
|
|
212
267
|
blocked: blocked,
|
|
213
|
-
disabled: disabled$
|
|
268
|
+
disabled: disabled$7,
|
|
214
269
|
loading: loading$2,
|
|
215
270
|
};
|
|
216
271
|
|
|
217
272
|
var BadgeElement = function (props) {
|
|
218
273
|
var children = props.children, _a = props.color, color = _a === void 0 ? 'gray' : _a, _b = props.type, type = _b === void 0 ? 'normal' : _b, _c = props.size, size = _c === void 0 ? 'sm' : _c, _d = props.figure, figure = _d === void 0 ? 'block' : _d, isDisabled = props.isDisabled, isLoading = props.isLoading, onClose = props.onClose, stylesOverrides = props.styles;
|
|
219
274
|
var handleGenerateStyle = function () {
|
|
220
|
-
var result = deepCopyObject(styles$
|
|
221
|
-
var keys = calculateNestedKeys(styles$
|
|
275
|
+
var result = deepCopyObject(styles$o.base);
|
|
276
|
+
var keys = calculateNestedKeys(styles$o.base);
|
|
222
277
|
keys.forEach(function (key) {
|
|
223
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
278
|
+
lodash.set(result, key, toClassName(lodash.get(styles$o.base, key), type && lodash.get(styles$o[type], key), color && lodash.get(styles$o[color], key), size && lodash.get(styles$o[size], key), figure && lodash.get(styles$o[figure], key), isDisabled && lodash.get(styles$o.disabled, key), isLoading && lodash.get(styles$o.loading, key), lodash.get(stylesOverrides, key)));
|
|
224
279
|
});
|
|
225
280
|
return result;
|
|
226
281
|
};
|
|
@@ -232,12 +287,12 @@ var BadgeElement = function (props) {
|
|
|
232
287
|
return (jsxRuntime.jsxs("span", { className: styles.container, children: [type === 'indicator' && (jsxRuntime.jsx("svg", { className: styles.indicator, fill: "currentColor", viewBox: "0 0 8 8", children: jsxRuntime.jsx("circle", { cx: 4, cy: 4, r: 3 }) })), children, type === 'close' && (jsxRuntime.jsxs("button", { type: "button", className: styles.button, onClick: onClose, children: [jsxRuntime.jsx("span", { className: "sr-only", children: "Remove large option" }), xIcon] }))] }));
|
|
233
288
|
};
|
|
234
289
|
|
|
235
|
-
var base$
|
|
290
|
+
var base$m = {
|
|
236
291
|
container: 'inline-flex items-center font-medium py-0.5',
|
|
237
292
|
indicator: '',
|
|
238
293
|
button: 'flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justify-center focus:text-white focus:outline-none',
|
|
239
294
|
};
|
|
240
|
-
var normal$
|
|
295
|
+
var normal$6 = {
|
|
241
296
|
container: 'px-2.5',
|
|
242
297
|
};
|
|
243
298
|
var indicator = {
|
|
@@ -309,15 +364,15 @@ var pink = {
|
|
|
309
364
|
indicator: 'text-pink-400',
|
|
310
365
|
button: 'text-pink-400 hover:bg-pink-200 hover:text-pink-500 focus:bg-purple-500',
|
|
311
366
|
};
|
|
312
|
-
var disabled$
|
|
367
|
+
var disabled$6 = {
|
|
313
368
|
container: 'opacity-20 cursor-not-allowed',
|
|
314
369
|
};
|
|
315
370
|
var loading$1 = {
|
|
316
371
|
container: 'cursor-progress',
|
|
317
372
|
};
|
|
318
|
-
var styles$
|
|
319
|
-
base: base$
|
|
320
|
-
normal: normal$
|
|
373
|
+
var styles$o = {
|
|
374
|
+
base: base$m,
|
|
375
|
+
normal: normal$6,
|
|
321
376
|
indicator: indicator,
|
|
322
377
|
close: close,
|
|
323
378
|
primary: primary$1,
|
|
@@ -335,7 +390,7 @@ var styles$n = {
|
|
|
335
390
|
indigo: indigo,
|
|
336
391
|
purple: purple,
|
|
337
392
|
pink: pink,
|
|
338
|
-
disabled: disabled$
|
|
393
|
+
disabled: disabled$6,
|
|
339
394
|
loading: loading$1,
|
|
340
395
|
};
|
|
341
396
|
|
|
@@ -374,10 +429,10 @@ var IconElement = function (props) {
|
|
|
374
429
|
var ButtonElement = function (props) {
|
|
375
430
|
var children = props.children, innerRef = props.innerRef, _a = props.htmlType, htmlType = _a === void 0 ? 'button' : _a, _b = props.type, type = _b === void 0 ? 'primary' : _b, _c = props.size, size = _c === void 0 ? 'md' : _c, _d = props.figure, figure = _d === void 0 ? 'block' : _d, _e = props.status, status = _e === void 0 ? 'idle' : _e, isDisabled = props.isDisabled, stylesOverrides = props.styles, onClick = props.onClick;
|
|
376
431
|
var handleGenerateStyle = function () {
|
|
377
|
-
var result = deepCopyObject(styles$
|
|
378
|
-
var keys = calculateNestedKeys(styles$
|
|
432
|
+
var result = deepCopyObject(styles$n.base);
|
|
433
|
+
var keys = calculateNestedKeys(styles$n.base);
|
|
379
434
|
keys.forEach(function (key) {
|
|
380
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
435
|
+
lodash.set(result, key, toClassName(lodash.get(styles$n.base, key), type && lodash.get(styles$n[type], key), size && lodash.get(styles$n[size], key), figure && lodash.get(styles$n[figure], key), status && lodash.get(styles$n[status], key), isDisabled && lodash.get(styles$n.disabled, key), lodash.get(stylesOverrides, key)));
|
|
381
436
|
});
|
|
382
437
|
return result;
|
|
383
438
|
};
|
|
@@ -385,7 +440,7 @@ var ButtonElement = function (props) {
|
|
|
385
440
|
return (jsxRuntime.jsxs("button", { type: htmlType, className: styles.container, disabled: isDisabled || status !== 'idle', onClick: onClick, ref: innerRef, children: [status === 'idle' && children, status === 'loading' && (jsxRuntime.jsxs("div", { className: styles.content, children: [jsxRuntime.jsx(IconElement, { type: "regular", accessor: "spinner", className: styles.spinner }), jsxRuntime.jsx("div", { children: children })] })), status === 'error' && (jsxRuntime.jsxs("div", { className: styles.content, children: [jsxRuntime.jsx(IconElement, { type: "regular", accessor: "circle-exclamation", className: styles.icon }), jsxRuntime.jsx("div", { children: children })] })), status === 'success' && (jsxRuntime.jsxs("div", { className: styles.content, children: [jsxRuntime.jsx(IconElement, { type: "regular", accessor: "circle-check", className: styles.icon }), jsxRuntime.jsx("div", { children: children })] }))] }));
|
|
386
441
|
};
|
|
387
442
|
|
|
388
|
-
var base$
|
|
443
|
+
var base$l = {
|
|
389
444
|
container: 'inline-flex items-center border border-transparent font-medium focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 duration-300',
|
|
390
445
|
content: 'flex gap-2',
|
|
391
446
|
icon: '',
|
|
@@ -434,11 +489,11 @@ var error = {
|
|
|
434
489
|
container: 'bg-rose-400 hover:bg-rose-500 !text-white duration-300',
|
|
435
490
|
content: 'flex items-center',
|
|
436
491
|
};
|
|
437
|
-
var disabled$
|
|
492
|
+
var disabled$5 = {
|
|
438
493
|
container: '!opacity-20 !cursor-not-allowed',
|
|
439
494
|
};
|
|
440
|
-
var styles$
|
|
441
|
-
base: base$
|
|
495
|
+
var styles$n = {
|
|
496
|
+
base: base$l,
|
|
442
497
|
primary: primary,
|
|
443
498
|
secondary: secondary,
|
|
444
499
|
outline: outline,
|
|
@@ -453,16 +508,16 @@ var styles$m = {
|
|
|
453
508
|
loading: loading,
|
|
454
509
|
success: success,
|
|
455
510
|
error: error,
|
|
456
|
-
disabled: disabled$
|
|
511
|
+
disabled: disabled$5,
|
|
457
512
|
};
|
|
458
513
|
|
|
459
514
|
var ButtonGroupElement = function (props) {
|
|
460
515
|
var children = props.children, stylesOverrides = props.styles;
|
|
461
516
|
var handleGenerateStyle = function () {
|
|
462
|
-
var result = deepCopyObject(styles$
|
|
463
|
-
var keys = calculateNestedKeys(styles$
|
|
517
|
+
var result = deepCopyObject(styles$m.base);
|
|
518
|
+
var keys = calculateNestedKeys(styles$m.base);
|
|
464
519
|
keys.forEach(function (key) {
|
|
465
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
520
|
+
lodash.set(result, key, toClassName(lodash.get(styles$m.base, key), lodash.get(stylesOverrides, key)));
|
|
466
521
|
});
|
|
467
522
|
return result;
|
|
468
523
|
};
|
|
@@ -480,23 +535,23 @@ var ButtonGroupElement = function (props) {
|
|
|
480
535
|
}) }));
|
|
481
536
|
};
|
|
482
537
|
|
|
483
|
-
var base$
|
|
538
|
+
var base$k = {
|
|
484
539
|
container: 'relative z-0 inline-flex shadow-sm rounded-md',
|
|
485
540
|
firstButton: 'relative inline-flex items-center px-4 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500',
|
|
486
541
|
button: '-ml-px relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500',
|
|
487
542
|
lastButton: '-ml-px relative inline-flex items-center px-4 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-primary-500 focus:border-primary-500',
|
|
488
543
|
};
|
|
489
|
-
var styles$
|
|
490
|
-
base: base$
|
|
544
|
+
var styles$m = {
|
|
545
|
+
base: base$k,
|
|
491
546
|
};
|
|
492
547
|
|
|
493
548
|
var Container$3 = function (props) {
|
|
494
549
|
var children = props.children, label = props.label, trigger = props.trigger, _a = props.type, type = _a === void 0 ? 'button' : _a, _b = props.direction, direction = _b === void 0 ? 'bottom-left' : _b, _c = props.isEscapingOverflow, isEscapingOverflow = _c === void 0 ? false : _c, stylesOverrides = props.styles;
|
|
495
550
|
var handleGenerateStyle = function () {
|
|
496
|
-
var result = deepCopyObject(styles$
|
|
497
|
-
var keys = calculateNestedKeys(styles$
|
|
551
|
+
var result = deepCopyObject(styles$l.base);
|
|
552
|
+
var keys = calculateNestedKeys(styles$l.base);
|
|
498
553
|
keys.forEach(function (key) {
|
|
499
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
554
|
+
lodash.set(result, key, toClassName(lodash.get(styles$l.base, key), type && lodash.get(styles$l[type], key), direction && lodash.get(styles$l[direction], key), lodash.get(stylesOverrides, key)));
|
|
500
555
|
});
|
|
501
556
|
return result;
|
|
502
557
|
};
|
|
@@ -509,7 +564,7 @@ var DropdownElement = {
|
|
|
509
564
|
Item: react.Menu.Item,
|
|
510
565
|
};
|
|
511
566
|
|
|
512
|
-
var base$
|
|
567
|
+
var base$j = {
|
|
513
568
|
container: 'inline-block text-left',
|
|
514
569
|
button: 'inline-flex justify-center w-full rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-primary-500',
|
|
515
570
|
compact: 'bg-gray-100 rounded-full flex items-center text-gray-400 hover:text-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-primary-500',
|
|
@@ -530,8 +585,8 @@ var topLeft = {
|
|
|
530
585
|
var topRight = {
|
|
531
586
|
items: 'origin-bottom-left left-0 bottom-0',
|
|
532
587
|
};
|
|
533
|
-
var styles$
|
|
534
|
-
base: base$
|
|
588
|
+
var styles$l = {
|
|
589
|
+
base: base$j,
|
|
535
590
|
button: button,
|
|
536
591
|
compact: compact,
|
|
537
592
|
'bottom-left': bottomLeft,
|
|
@@ -550,10 +605,10 @@ var InputGroupForm = function (props) {
|
|
|
550
605
|
replacement: (_a = {}, _a[(_b = mask$1 === null || mask$1 === void 0 ? void 0 : mask$1.replacementCharacter) !== null && _b !== void 0 ? _b : 'X'] = /\d|\D/, _a),
|
|
551
606
|
});
|
|
552
607
|
var handleGenerateStyle = function () {
|
|
553
|
-
var result = deepCopyObject(styles$
|
|
554
|
-
var keys = calculateNestedKeys(styles$
|
|
608
|
+
var result = deepCopyObject(styles$k.base);
|
|
609
|
+
var keys = calculateNestedKeys(styles$k.base);
|
|
555
610
|
keys.forEach(function (key) {
|
|
556
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
611
|
+
lodash.set(result, key, toClassName(lodash.get(styles$k.base, key), leading !== undefined && lodash.get(styles$k.leading, key), trailing !== undefined && lodash.get(styles$k.trailing, key), type && lodash.get(styles$k[type], key), isTouched === true && !isValid && lodash.get(styles$k.invalid, key), isDisabled && lodash.get(styles$k.disabled, key), lodash.get(stylesOverrides, key)));
|
|
557
612
|
});
|
|
558
613
|
return result;
|
|
559
614
|
};
|
|
@@ -563,7 +618,7 @@ var InputGroupForm = function (props) {
|
|
|
563
618
|
(htmlType !== 'area' && (jsxRuntime.jsx("input", { type: mask$1 !== undefined ? 'text' : htmlType, ref: mask$1 && ref, name: name, id: name, className: toClassName(styles.input, htmlType === 'color' && '!h-10'), placeholder: placeholder, defaultValue: isSolo ? value : undefined, value: isSolo ? undefined : value, min: min, max: max, maxLength: maxLength, disabled: isDisabled, onChange: onChange, onBlur: onBlur }))), htmlType === 'area' && (jsxRuntime.jsx("textarea", { rows: rows, name: name, id: name, className: styles.input, placeholder: placeholder, defaultValue: isSolo ? value : undefined, value: isSolo ? undefined : value, maxLength: maxLength, disabled: isDisabled, onChange: onChange, onBlur: onBlur })), type === 'floored' && (jsxRuntime.jsx("div", { className: "absolute inset-x-0 bottom-0 border-t border-gray-300 peer-focus:border-t-2 peer-focus:border-primary-600", "aria-hidden": "true" })), trailing && isValid && (jsxRuntime.jsx("div", { className: styles.trailing, children: trailing })), isTouched && !isValid && (jsxRuntime.jsx("div", { className: styles.trailing, children: invalidIcon }))] }), jsxRuntime.jsxs("div", { className: styles.foot, children: [description && !(error && isTouched) && (jsxRuntime.jsx("p", { className: styles.description, children: description })), error && isTouched && jsxRuntime.jsx("p", { className: styles.error, children: error })] })] }));
|
|
564
619
|
};
|
|
565
620
|
|
|
566
|
-
var base$
|
|
621
|
+
var base$i = {
|
|
567
622
|
container: '',
|
|
568
623
|
head: 'flex justify-between',
|
|
569
624
|
body: 'relative rounded-md',
|
|
@@ -576,11 +631,11 @@ var base$h = {
|
|
|
576
631
|
description: 'text-gray-400 text-xs mt-1',
|
|
577
632
|
error: 'text-red-500 text-xs ml-5 mt-1',
|
|
578
633
|
};
|
|
579
|
-
var leading$
|
|
634
|
+
var leading$3 = {
|
|
580
635
|
input: 'pl-10',
|
|
581
636
|
};
|
|
582
|
-
var trailing$
|
|
583
|
-
var normal$
|
|
637
|
+
var trailing$3 = {};
|
|
638
|
+
var normal$5 = {
|
|
584
639
|
label: 'leading-6 text-sm mb-2',
|
|
585
640
|
hint: 'leading-6',
|
|
586
641
|
leading: 'pl-3',
|
|
@@ -588,14 +643,14 @@ var normal$4 = {
|
|
|
588
643
|
trailing: 'pr-3',
|
|
589
644
|
description: 'mt-2 text-sm',
|
|
590
645
|
};
|
|
591
|
-
var inset$
|
|
646
|
+
var inset$3 = {
|
|
592
647
|
container: 'rounded-md px-3 pt-2.5 pb-1.5 shadow-sm ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-primary-600',
|
|
593
648
|
label: 'text-xs',
|
|
594
649
|
hint: 'text-xs',
|
|
595
650
|
input: 'border-0 !ring-0 p-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm pl-0',
|
|
596
651
|
description: 'hidden',
|
|
597
652
|
};
|
|
598
|
-
var overlapping$
|
|
653
|
+
var overlapping$3 = {
|
|
599
654
|
container: 'relative',
|
|
600
655
|
head: ' absolute flex justify-between items-center left-0 -top-2 right-0 mx-2 z-10 w-full',
|
|
601
656
|
label: 'inline-block bg-white px-1 text-xs font-medium text-gray-900 ',
|
|
@@ -603,49 +658,49 @@ var overlapping$2 = {
|
|
|
603
658
|
input: 'block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6',
|
|
604
659
|
description: 'hidden',
|
|
605
660
|
};
|
|
606
|
-
var pill$
|
|
661
|
+
var pill$3 = {
|
|
607
662
|
head: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mb-1 pr-6',
|
|
608
663
|
foot: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mt-1 pr-6',
|
|
609
664
|
input: 'block w-full rounded-full border-0 px-4 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6',
|
|
610
665
|
trailing: 'pr-2',
|
|
611
666
|
description: 'text-xs',
|
|
612
667
|
};
|
|
613
|
-
var floored$
|
|
668
|
+
var floored$3 = {
|
|
614
669
|
body: 'relative mt-2',
|
|
615
670
|
label: 'block text-sm font-medium leading-6 text-gray-900',
|
|
616
671
|
input: 'peer block w-full border-0 bg-gray-50 py-1.5 text-gray-900 focus:ring-0 sm:text-sm sm:leading-6 ring-0',
|
|
617
672
|
description: 'text-xs mt-2',
|
|
618
673
|
};
|
|
619
|
-
var invalid$
|
|
674
|
+
var invalid$3 = {
|
|
620
675
|
container: 'ring-red-500',
|
|
621
676
|
input:
|
|
622
677
|
// 'block w-full border border-transparent text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500 sm:leading-6 pr-10',
|
|
623
678
|
'block w-full border border-transparent text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500 pr-10',
|
|
624
679
|
description: 'text-sm text-red-600',
|
|
625
680
|
};
|
|
626
|
-
var disabled$
|
|
681
|
+
var disabled$4 = {
|
|
627
682
|
input: 'block w-full rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-500 disabled:ring-gray-200',
|
|
628
683
|
};
|
|
629
|
-
var styles$
|
|
630
|
-
base: base$
|
|
631
|
-
leading: leading$
|
|
632
|
-
trailing: trailing$
|
|
633
|
-
normal: normal$
|
|
634
|
-
inset: inset$
|
|
635
|
-
overlapping: overlapping$
|
|
636
|
-
pill: pill$
|
|
637
|
-
floored: floored$
|
|
638
|
-
invalid: invalid$
|
|
639
|
-
disabled: disabled$
|
|
684
|
+
var styles$k = {
|
|
685
|
+
base: base$i,
|
|
686
|
+
leading: leading$3,
|
|
687
|
+
trailing: trailing$3,
|
|
688
|
+
normal: normal$5,
|
|
689
|
+
inset: inset$3,
|
|
690
|
+
overlapping: overlapping$3,
|
|
691
|
+
pill: pill$3,
|
|
692
|
+
floored: floored$3,
|
|
693
|
+
invalid: invalid$3,
|
|
694
|
+
disabled: disabled$4,
|
|
640
695
|
};
|
|
641
696
|
|
|
642
697
|
var ContainerLayout = function (props) {
|
|
643
698
|
var children = props.children, _a = props.type, type = _a === void 0 ? 'break' : _a, stylesOverrides = props.styles;
|
|
644
699
|
var handleGenerateStyle = function () {
|
|
645
|
-
var result = deepCopyObject(styles$
|
|
646
|
-
var keys = calculateNestedKeys(styles$
|
|
700
|
+
var result = deepCopyObject(styles$j.base);
|
|
701
|
+
var keys = calculateNestedKeys(styles$j.base);
|
|
647
702
|
keys.forEach(function (key) {
|
|
648
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
703
|
+
lodash.set(result, key, toClassName(lodash.get(styles$j.base, key), type && lodash.get(styles$j[type], key), lodash.get(stylesOverrides, key)));
|
|
649
704
|
});
|
|
650
705
|
return result;
|
|
651
706
|
};
|
|
@@ -668,7 +723,7 @@ var ContainerLayout = function (props) {
|
|
|
668
723
|
return handleGenerateComponent();
|
|
669
724
|
};
|
|
670
725
|
|
|
671
|
-
var base$
|
|
726
|
+
var base$h = {
|
|
672
727
|
container: '',
|
|
673
728
|
content: '',
|
|
674
729
|
};
|
|
@@ -682,8 +737,8 @@ var center$3 = {
|
|
|
682
737
|
var fill$1 = {
|
|
683
738
|
container: 'max-w-7xl mx-auto sm:px-6 lg:px-8',
|
|
684
739
|
};
|
|
685
|
-
var styles$
|
|
686
|
-
base: base$
|
|
740
|
+
var styles$j = {
|
|
741
|
+
base: base$h,
|
|
687
742
|
break: breakStyles,
|
|
688
743
|
center: center$3,
|
|
689
744
|
fill: fill$1,
|
|
@@ -692,10 +747,10 @@ var styles$i = {
|
|
|
692
747
|
var DividerLayout = function (props) {
|
|
693
748
|
var children = props.children, _a = props.type, type = _a === void 0 ? 'left' : _a, stylesOverrides = props.styles;
|
|
694
749
|
var handleGenerateStyle = function () {
|
|
695
|
-
var result = deepCopyObject(styles$
|
|
696
|
-
var keys = calculateNestedKeys(styles$
|
|
750
|
+
var result = deepCopyObject(styles$i.base);
|
|
751
|
+
var keys = calculateNestedKeys(styles$i.base);
|
|
697
752
|
keys.forEach(function (key) {
|
|
698
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
753
|
+
lodash.set(result, key, toClassName(lodash.get(styles$i.base, key), type && lodash.get(styles$i[type], key), lodash.get(stylesOverrides, key)));
|
|
699
754
|
});
|
|
700
755
|
return result;
|
|
701
756
|
};
|
|
@@ -704,7 +759,7 @@ var DividerLayout = function (props) {
|
|
|
704
759
|
return (jsxRuntime.jsxs("div", { className: styles.container, children: [jsxRuntime.jsx("div", { className: styles.head, "aria-hidden": "true", children: jsxRuntime.jsx("div", { className: styles.line }) }), jsxRuntime.jsx("div", { className: styles.body, children: jsxRuntime.jsx("div", { className: styles.content, children: children }) })] }));
|
|
705
760
|
};
|
|
706
761
|
|
|
707
|
-
var base$
|
|
762
|
+
var base$g = {
|
|
708
763
|
container: 'relative',
|
|
709
764
|
head: 'absolute inset-0 flex items-center',
|
|
710
765
|
line: 'w-full border-t border-gray-300',
|
|
@@ -720,8 +775,8 @@ var center$2 = {
|
|
|
720
775
|
var right = {
|
|
721
776
|
body: 'justify-end',
|
|
722
777
|
};
|
|
723
|
-
var styles$
|
|
724
|
-
base: base$
|
|
778
|
+
var styles$i = {
|
|
779
|
+
base: base$g,
|
|
725
780
|
left: left,
|
|
726
781
|
center: center$2,
|
|
727
782
|
right: right,
|
|
@@ -730,10 +785,10 @@ var styles$h = {
|
|
|
730
785
|
var ListContainerLayout = function (props) {
|
|
731
786
|
var children = props.children, _a = props.type, type = _a === void 0 ? 'fill' : _a, stylesOverrides = props.styles;
|
|
732
787
|
var handleGenerateStyle = function () {
|
|
733
|
-
var result = deepCopyObject(styles$
|
|
734
|
-
var keys = calculateNestedKeys(styles$
|
|
788
|
+
var result = deepCopyObject(styles$h.base);
|
|
789
|
+
var keys = calculateNestedKeys(styles$h.base);
|
|
735
790
|
keys.forEach(function (key) {
|
|
736
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
791
|
+
lodash.set(result, key, toClassName(lodash.get(styles$h.base, key), type && lodash.get(styles$h[type], key), lodash.get(stylesOverrides, key)));
|
|
737
792
|
});
|
|
738
793
|
return result;
|
|
739
794
|
};
|
|
@@ -744,7 +799,7 @@ var ListContainerLayout = function (props) {
|
|
|
744
799
|
}) }) }));
|
|
745
800
|
};
|
|
746
801
|
|
|
747
|
-
var base$
|
|
802
|
+
var base$f = {
|
|
748
803
|
container: '',
|
|
749
804
|
list: '',
|
|
750
805
|
item: '',
|
|
@@ -775,8 +830,8 @@ var cardSticky = {
|
|
|
775
830
|
list: 'space-y-3',
|
|
776
831
|
item: 'bg-white shadow overflow-hidden px-4 py-4 sm:px-6 sm:rounded-md',
|
|
777
832
|
};
|
|
778
|
-
var styles$
|
|
779
|
-
base: base$
|
|
833
|
+
var styles$h = {
|
|
834
|
+
base: base$f,
|
|
780
835
|
fill: fill,
|
|
781
836
|
'fill-sticky': fillSticky,
|
|
782
837
|
center: center$1,
|
|
@@ -788,10 +843,10 @@ var styles$g = {
|
|
|
788
843
|
var MediaObjectLayout = function (props) {
|
|
789
844
|
var title = props.title, paragraph = props.paragraph, customFigure = props.figure, _a = props.type, type = _a === void 0 ? 'top' : _a, stylesOverrides = props.styles;
|
|
790
845
|
var handleGenerateStyle = function () {
|
|
791
|
-
var result = deepCopyObject(styles$
|
|
792
|
-
var keys = calculateNestedKeys(styles$
|
|
846
|
+
var result = deepCopyObject(styles$g.base);
|
|
847
|
+
var keys = calculateNestedKeys(styles$g.base);
|
|
793
848
|
keys.forEach(function (key) {
|
|
794
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
849
|
+
lodash.set(result, key, toClassName(lodash.get(styles$g.base, key), type && lodash.get(styles$g[type], key), lodash.get(stylesOverrides, key)));
|
|
795
850
|
});
|
|
796
851
|
return result;
|
|
797
852
|
};
|
|
@@ -809,7 +864,7 @@ var MediaObjectLayout = function (props) {
|
|
|
809
864
|
return (jsxRuntime.jsxs("div", { className: styles.container, children: [jsxRuntime.jsx("div", { className: styles.figure, children: $svg }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("h4", { className: styles.title, children: title }), jsxRuntime.jsx("p", { className: styles.paragraph, children: paragraph })] })] }));
|
|
810
865
|
};
|
|
811
866
|
|
|
812
|
-
var base$
|
|
867
|
+
var base$e = {
|
|
813
868
|
container: '',
|
|
814
869
|
figure: 'mr-4 flex-shrink-0',
|
|
815
870
|
svg: 'h-16 w-16 border border-gray-300 bg-white text-gray-300',
|
|
@@ -864,8 +919,8 @@ var wideReversed = {
|
|
|
864
919
|
figure: 'mb-4 md:mb-0 sm:mr-4 sm:mb-4',
|
|
865
920
|
svg: 'h-32 w-full sm:w-32',
|
|
866
921
|
};
|
|
867
|
-
var styles$
|
|
868
|
-
base: base$
|
|
922
|
+
var styles$g = {
|
|
923
|
+
base: base$e,
|
|
869
924
|
top: top,
|
|
870
925
|
'top-reversed': topReversed,
|
|
871
926
|
center: center,
|
|
@@ -883,10 +938,10 @@ var styles$f = {
|
|
|
883
938
|
var Container$2 = function (props) {
|
|
884
939
|
var children = props.children, _a = props.type, type = _a === void 0 ? 'normal' : _a, stylesOverrides = props.styles;
|
|
885
940
|
var handleGenerateStyle = function () {
|
|
886
|
-
var result = deepCopyObject(styles$
|
|
887
|
-
var keys = calculateNestedKeys(styles$
|
|
941
|
+
var result = deepCopyObject(styles$f.base);
|
|
942
|
+
var keys = calculateNestedKeys(styles$f.base);
|
|
888
943
|
keys.forEach(function (key) {
|
|
889
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
944
|
+
lodash.set(result, key, toClassName(lodash.get(styles$f.base, key), type && lodash.get(styles$f[type], key), lodash.get(stylesOverrides, key)));
|
|
890
945
|
});
|
|
891
946
|
return result;
|
|
892
947
|
};
|
|
@@ -896,10 +951,10 @@ var Container$2 = function (props) {
|
|
|
896
951
|
var Section = function (props) {
|
|
897
952
|
var children = props.children, stylesOverrides = props.styles;
|
|
898
953
|
var handleGenerateStyle = function () {
|
|
899
|
-
var result = deepCopyObject(styles$
|
|
900
|
-
var keys = calculateNestedKeys(styles$
|
|
954
|
+
var result = deepCopyObject(styles$f.base);
|
|
955
|
+
var keys = calculateNestedKeys(styles$f.base);
|
|
901
956
|
keys.forEach(function (key) {
|
|
902
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
957
|
+
lodash.set(result, key, toClassName(lodash.get(styles$f.base, key), lodash.get(stylesOverrides, key)));
|
|
903
958
|
});
|
|
904
959
|
return result;
|
|
905
960
|
};
|
|
@@ -911,19 +966,19 @@ var LayoutPanel = {
|
|
|
911
966
|
Section: Section,
|
|
912
967
|
};
|
|
913
968
|
|
|
914
|
-
var base$
|
|
969
|
+
var base$d = {
|
|
915
970
|
container: 'bg-white overflow-hidden shadow',
|
|
916
971
|
section: 'px-4 py-5 sm:px-6',
|
|
917
972
|
};
|
|
918
|
-
var normal$
|
|
973
|
+
var normal$4 = {
|
|
919
974
|
container: 'rounded-lg',
|
|
920
975
|
};
|
|
921
976
|
var sticky$1 = {
|
|
922
977
|
container: 'sm:rounded-lg',
|
|
923
978
|
};
|
|
924
|
-
var styles$
|
|
925
|
-
base: base$
|
|
926
|
-
normal: normal$
|
|
979
|
+
var styles$f = {
|
|
980
|
+
base: base$d,
|
|
981
|
+
normal: normal$4,
|
|
927
982
|
sticky: sticky$1,
|
|
928
983
|
};
|
|
929
984
|
|
|
@@ -1027,10 +1082,10 @@ var PanelPaginationNavigation = function (props) {
|
|
|
1027
1082
|
}
|
|
1028
1083
|
}, [defaultValue]);
|
|
1029
1084
|
var handleGenerateStyle = function () {
|
|
1030
|
-
var result = deepCopyObject(styles$
|
|
1031
|
-
var keys = calculateNestedKeys(styles$
|
|
1085
|
+
var result = deepCopyObject(styles$e.base);
|
|
1086
|
+
var keys = calculateNestedKeys(styles$e.base);
|
|
1032
1087
|
keys.forEach(function (key) {
|
|
1033
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
1088
|
+
lodash.set(result, key, toClassName(lodash.get(styles$e.base, key), lodash.get(stylesOverrides, key)));
|
|
1034
1089
|
});
|
|
1035
1090
|
return result;
|
|
1036
1091
|
};
|
|
@@ -1070,7 +1125,7 @@ var PanelPaginationNavigation = function (props) {
|
|
|
1070
1125
|
return (jsxRuntime.jsxs("div", { className: styles.container, children: [jsxRuntime.jsxs("div", { className: "flex flex-1 justify-between sm:hidden", children: [jsxRuntime.jsx("button", { className: toClassName(styles.mobile.button, current === min && styles.button.disabled), disabled: current === min, onClick: function () { return handleChangeCurrent(current - 1); }, children: "Previous" }), jsxRuntime.jsx("button", { className: toClassName(styles.mobile.button, current === max && styles.button.disabled), disabled: current === max, onClick: function () { return handleChangeCurrent(current + 1); }, children: "Next" })] }), jsxRuntime.jsxs("div", { className: styles.desktop.container, children: [jsxRuntime.jsx("div", { children: jsxRuntime.jsx("div", { className: "text-sm text-gray-700", children: children && children({ min: min, max: max, current: current }) }) }), jsxRuntime.jsx("div", { children: jsxRuntime.jsxs("nav", { className: styles.desktop.navigation, "aria-label": "Pagination", children: [jsxRuntime.jsxs("button", { className: toClassName(styles.desktop.leftButton, current === min && styles.button.disabled), disabled: current === min, onClick: function () { return handleChangeCurrent(current - 1); }, children: [jsxRuntime.jsx("span", { className: styles.label, children: "Previous" }), jsxRuntime.jsx(solid.ChevronLeftIcon, { className: styles.icon, "aria-hidden": "true" })] }), component, jsxRuntime.jsxs("button", { className: toClassName(styles.desktop.rightButton, current === max && styles.button.disabled), disabled: current === max, onClick: function () { return handleChangeCurrent(current + 1); }, children: [jsxRuntime.jsx("span", { className: styles.label, children: "Next" }), jsxRuntime.jsx(solid.ChevronRightIcon, { className: styles.icon, "aria-hidden": "true" })] })] }) })] })] }));
|
|
1071
1126
|
};
|
|
1072
1127
|
|
|
1073
|
-
var base$
|
|
1128
|
+
var base$c = {
|
|
1074
1129
|
container: 'flex items-center justify-between border-t border-gray-200 bg-white py-3',
|
|
1075
1130
|
mobile: {
|
|
1076
1131
|
container: '',
|
|
@@ -1091,8 +1146,8 @@ var base$b = {
|
|
|
1091
1146
|
label: 'sr-only',
|
|
1092
1147
|
icon: 'w-5 h-5',
|
|
1093
1148
|
};
|
|
1094
|
-
var styles$
|
|
1095
|
-
base: base$
|
|
1149
|
+
var styles$e = {
|
|
1150
|
+
base: base$c,
|
|
1096
1151
|
};
|
|
1097
1152
|
|
|
1098
1153
|
var TableList = function (props) {
|
|
@@ -1100,10 +1155,10 @@ var TableList = function (props) {
|
|
|
1100
1155
|
var id = props.id, columns = props.columns, data = props.data, page = props.page, children = props.children, defaultOrder = props.defaultOrder, defaultVisibility = props.defaultVisibility, _f = props.type, type = _f === void 0 ? 'normal' : _f, isLoading = props.isLoading, _g = props.isStriped, isStriped = _g === void 0 ? false : _g, _h = props.hasStickyHeader, hasStickyHeader = _h === void 0 ? false : _h, _j = props.hasVerticalSeparators, hasVerticalSeparators = _j === void 0 ? false : _j, _k = props.areControlsVisible, areControlsVisible = _k === void 0 ? true : _k, customControls = props.customControls, _l = props.exportFileName, exportFileName = _l === void 0 ? 'table-export' : _l, stylesOverrides = props.styles, onChange = props.onChange, onPaginate = props.onPaginate;
|
|
1101
1156
|
var _m = useExcel(), generate = _m.generate, write = _m.write;
|
|
1102
1157
|
var handleGenerateStyle = function () {
|
|
1103
|
-
var result = deepCopyObject(styles$
|
|
1104
|
-
var keys = calculateNestedKeys(styles$
|
|
1158
|
+
var result = deepCopyObject(styles$d.base);
|
|
1159
|
+
var keys = calculateNestedKeys(styles$d.base);
|
|
1105
1160
|
keys.forEach(function (key) {
|
|
1106
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
1161
|
+
lodash.set(result, key, toClassName(lodash.get(styles$d.base, key), type && lodash.get(styles$d[type], key), hasStickyHeader && lodash.get(styles$d.sticky, key), hasVerticalSeparators && lodash.get(styles$d.separated, key), areControlsVisible && lodash.get(styles$d.controlled, key), lodash.get(stylesOverrides, key)));
|
|
1107
1162
|
});
|
|
1108
1163
|
return result;
|
|
1109
1164
|
};
|
|
@@ -1228,7 +1283,7 @@ var TableList = function (props) {
|
|
|
1228
1283
|
: { container: 'mt-4' }, onChange: onPaginate, children: children })] }) }));
|
|
1229
1284
|
};
|
|
1230
1285
|
|
|
1231
|
-
var base$
|
|
1286
|
+
var base$b = {
|
|
1232
1287
|
container: 'px-4 sm:px-6 lg:px-8',
|
|
1233
1288
|
head: {
|
|
1234
1289
|
container: 'sm:flex sm:items-center',
|
|
@@ -1282,7 +1337,7 @@ var base$a = {
|
|
|
1282
1337
|
},
|
|
1283
1338
|
},
|
|
1284
1339
|
};
|
|
1285
|
-
var normal$
|
|
1340
|
+
var normal$3 = {
|
|
1286
1341
|
body: {
|
|
1287
1342
|
content: 'inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8',
|
|
1288
1343
|
styleWrapper: 'relative',
|
|
@@ -1340,9 +1395,9 @@ var controlled = {
|
|
|
1340
1395
|
container: '!flex',
|
|
1341
1396
|
},
|
|
1342
1397
|
};
|
|
1343
|
-
var styles$
|
|
1344
|
-
base: base$
|
|
1345
|
-
normal: normal$
|
|
1398
|
+
var styles$d = {
|
|
1399
|
+
base: base$b,
|
|
1400
|
+
normal: normal$3,
|
|
1346
1401
|
panel: panel$1,
|
|
1347
1402
|
full: full,
|
|
1348
1403
|
sticky: sticky,
|
|
@@ -1359,10 +1414,10 @@ var TableList2 = function (props) {
|
|
|
1359
1414
|
}), columnVisibility = _d[0], setColumnVisibility = _d[1];
|
|
1360
1415
|
var _e = React.useState([]), columnOrder = _e[0], setColumnOrder = _e[1];
|
|
1361
1416
|
var handleGenerateStyle = function () {
|
|
1362
|
-
var result = deepCopyObject(styles$
|
|
1363
|
-
var keys = calculateNestedKeys(styles$
|
|
1417
|
+
var result = deepCopyObject(styles$c.base);
|
|
1418
|
+
var keys = calculateNestedKeys(styles$c.base);
|
|
1364
1419
|
keys.forEach(function (key) {
|
|
1365
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
1420
|
+
lodash.set(result, key, toClassName(lodash.get(styles$c.base, key),
|
|
1366
1421
|
// type && get(defaultStyles[type], key),
|
|
1367
1422
|
// hasStickyHeader && get(defaultStyles.sticky, key),
|
|
1368
1423
|
// hasVerticalSeparators && get(defaultStyles.separated, key),
|
|
@@ -1454,7 +1509,7 @@ var TableList2 = function (props) {
|
|
|
1454
1509
|
}) }))] }), isLoading && (jsxRuntime.jsx("div", { className: "flex flex-col gap-y-2 w-full pt-5", children: new Array(8).fill(undefined).map(function (index) { return (jsxRuntime.jsxs("div", { className: "flex gap-2", children: [jsxRuntime.jsx("div", { className: "w-20 h-12 rounded-md bg-gray-100 animate-pulse" }), jsxRuntime.jsx("div", { className: "w-full h-12 rounded-md bg-gray-100 animate-pulse" })] }, index)); }) }))] }) }) }) }), jsxRuntime.jsx("div", { className: styles.foot, children: foot && foot(state) })] }));
|
|
1455
1510
|
};
|
|
1456
1511
|
|
|
1457
|
-
var base$
|
|
1512
|
+
var base$a = {
|
|
1458
1513
|
container: '',
|
|
1459
1514
|
head: '',
|
|
1460
1515
|
body: {
|
|
@@ -1489,8 +1544,8 @@ var base$9 = {
|
|
|
1489
1544
|
},
|
|
1490
1545
|
},
|
|
1491
1546
|
};
|
|
1492
|
-
var styles$
|
|
1493
|
-
base: base$
|
|
1547
|
+
var styles$c = {
|
|
1548
|
+
base: base$a,
|
|
1494
1549
|
};
|
|
1495
1550
|
|
|
1496
1551
|
var createColumnHelper = function () {
|
|
@@ -1500,10 +1555,10 @@ var createColumnHelper = function () {
|
|
|
1500
1555
|
var BreadcrumbsNavigation = function (props) {
|
|
1501
1556
|
var _a = props.href, href = _a === void 0 ? '/' : _a, pages = props.pages, _b = props.type, type = _b === void 0 ? 'slashes' : _b, customSeparator = props.separator, stylesOverrides = props.styles;
|
|
1502
1557
|
var handleGenerateStyle = function () {
|
|
1503
|
-
var result = deepCopyObject(styles$
|
|
1504
|
-
var keys = calculateNestedKeys(styles$
|
|
1558
|
+
var result = deepCopyObject(styles$b.base);
|
|
1559
|
+
var keys = calculateNestedKeys(styles$b.base);
|
|
1505
1560
|
keys.forEach(function (key) {
|
|
1506
|
-
set(result, key, toClassName(get(styles$
|
|
1561
|
+
set(result, key, toClassName(get(styles$b.base, key), type && get(styles$b[type], key), get(stylesOverrides, key)));
|
|
1507
1562
|
});
|
|
1508
1563
|
return result;
|
|
1509
1564
|
};
|
|
@@ -1539,7 +1594,7 @@ var BreadcrumbsNavigation = function (props) {
|
|
|
1539
1594
|
return (jsxRuntime.jsx("nav", { className: styles.container, "aria-label": "Breadcrumb", children: jsxRuntime.jsxs("ol", { className: styles.list, children: [jsxRuntime.jsx(HomeLink, {}), pages === null || pages === void 0 ? void 0 : pages.map(function (page) { return jsxRuntime.jsx(PageLink, { page: page }, page.name); })] }) }));
|
|
1540
1595
|
};
|
|
1541
1596
|
|
|
1542
|
-
var base$
|
|
1597
|
+
var base$9 = {
|
|
1543
1598
|
container: 'flex',
|
|
1544
1599
|
list: 'flex',
|
|
1545
1600
|
separator: '',
|
|
@@ -1624,8 +1679,8 @@ var bar = {
|
|
|
1624
1679
|
link: '',
|
|
1625
1680
|
},
|
|
1626
1681
|
};
|
|
1627
|
-
var styles$
|
|
1628
|
-
base: base$
|
|
1682
|
+
var styles$b = {
|
|
1683
|
+
base: base$9,
|
|
1629
1684
|
slashes: slashes,
|
|
1630
1685
|
chevrons: chevrons,
|
|
1631
1686
|
panel: panel,
|
|
@@ -1636,10 +1691,10 @@ var PagePaginationNavigation = function (props) {
|
|
|
1636
1691
|
var _a = props.min, min = _a === void 0 ? 1 : _a, _b = props.max, max = _b === void 0 ? 20 : _b, stylesOverrides = props.styles, onChange = props.onChange;
|
|
1637
1692
|
var _c = React.useState(2), current = _c[0], setCurrent = _c[1];
|
|
1638
1693
|
var handleGenerateStyle = function () {
|
|
1639
|
-
var result = deepCopyObject(styles$
|
|
1640
|
-
var keys = calculateNestedKeys(styles$
|
|
1694
|
+
var result = deepCopyObject(styles$a.base);
|
|
1695
|
+
var keys = calculateNestedKeys(styles$a.base);
|
|
1641
1696
|
keys.forEach(function (key) {
|
|
1642
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
1697
|
+
lodash.set(result, key, toClassName(lodash.get(styles$a.base, key), lodash.get(stylesOverrides, key)));
|
|
1643
1698
|
});
|
|
1644
1699
|
return result;
|
|
1645
1700
|
};
|
|
@@ -1674,7 +1729,7 @@ var PagePaginationNavigation = function (props) {
|
|
|
1674
1729
|
return (jsxRuntime.jsxs("nav", { className: styles.container, children: [jsxRuntime.jsx("div", { className: styles.left.container, children: jsxRuntime.jsxs("button", { className: toClassName(styles.left.button, current === min && styles.button.disabled), disabled: current === min, onClick: function () { return setCurrent(current - 1); }, children: [jsxRuntime.jsx(solid.ArrowLongLeftIcon, { className: styles.left.icon }), "Previous"] }) }), jsxRuntime.jsx("div", { className: styles.center.container, children: component }), jsxRuntime.jsx("div", { className: styles.right.container, children: jsxRuntime.jsxs("button", { className: toClassName(styles.right.button, current === max && styles.button.disabled), disabled: current === max, onClick: function () { return setCurrent(current + 1); }, children: ["Next", jsxRuntime.jsx(solid.ArrowLongRightIcon, { className: styles.right.icon })] }) })] }));
|
|
1675
1730
|
};
|
|
1676
1731
|
|
|
1677
|
-
var base$
|
|
1732
|
+
var base$8 = {
|
|
1678
1733
|
container: 'flex items-center justify-between border-t border-gray-200 px-4 sm:px-0',
|
|
1679
1734
|
left: {
|
|
1680
1735
|
container: '-mt-px flex w-0 flex-1',
|
|
@@ -1696,18 +1751,18 @@ var base$7 = {
|
|
|
1696
1751
|
},
|
|
1697
1752
|
divider: 'inline-flex items-center border-t-2 border-transparent px-4 pt-4 text-sm font-medium text-gray-500',
|
|
1698
1753
|
};
|
|
1699
|
-
var styles$
|
|
1700
|
-
base: base$
|
|
1754
|
+
var styles$a = {
|
|
1755
|
+
base: base$8,
|
|
1701
1756
|
};
|
|
1702
1757
|
|
|
1703
1758
|
var Container$1 = function (props) {
|
|
1704
1759
|
var children = props.children, stylesOverrides = props.styles;
|
|
1705
1760
|
var _a = React.useState(''), active = _a[0], setActive = _a[1];
|
|
1706
1761
|
var handleGenerateStyle = function () {
|
|
1707
|
-
var result = deepCopyObject(styles$
|
|
1708
|
-
var keys = calculateNestedKeys(styles$
|
|
1762
|
+
var result = deepCopyObject(styles$9.base);
|
|
1763
|
+
var keys = calculateNestedKeys(styles$9.base);
|
|
1709
1764
|
keys.forEach(function (key) {
|
|
1710
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
1765
|
+
lodash.set(result, key, toClassName(lodash.get(styles$9.base, key), lodash.get(stylesOverrides, key)));
|
|
1711
1766
|
});
|
|
1712
1767
|
return result;
|
|
1713
1768
|
};
|
|
@@ -1717,10 +1772,10 @@ var Container$1 = function (props) {
|
|
|
1717
1772
|
var List$1 = function (props) {
|
|
1718
1773
|
var name = props.name, children = props.children, active = props.active, setActive = props.setActive, stylesOverrides = props.styles;
|
|
1719
1774
|
var handleGenerateStyle = function () {
|
|
1720
|
-
var result = deepCopyObject(styles$
|
|
1721
|
-
var keys = calculateNestedKeys(styles$
|
|
1775
|
+
var result = deepCopyObject(styles$9.base);
|
|
1776
|
+
var keys = calculateNestedKeys(styles$9.base);
|
|
1722
1777
|
keys.forEach(function (key) {
|
|
1723
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
1778
|
+
lodash.set(result, key, toClassName(lodash.get(styles$9.base, key), lodash.get(stylesOverrides, key)));
|
|
1724
1779
|
});
|
|
1725
1780
|
return result;
|
|
1726
1781
|
};
|
|
@@ -1766,10 +1821,10 @@ var List$1 = function (props) {
|
|
|
1766
1821
|
var Item$1 = function (props) {
|
|
1767
1822
|
var children = props.children, _a = props.as, LinkComponent = _a === void 0 ? 'a' : _a, _b = props.type, type = _b === void 0 ? 'underline' : _b, href = props.href, isCurrent = props.isCurrent, onClick = props.onClick, stylesOverrides = props.styles, isLoading = props.isLoading;
|
|
1768
1823
|
var handleGenerateStyle = function () {
|
|
1769
|
-
var result = deepCopyObject(styles$
|
|
1770
|
-
var keys = calculateNestedKeys(styles$
|
|
1824
|
+
var result = deepCopyObject(styles$9.base);
|
|
1825
|
+
var keys = calculateNestedKeys(styles$9.base);
|
|
1771
1826
|
keys.forEach(function (key) {
|
|
1772
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
1827
|
+
lodash.set(result, key, toClassName(lodash.get(styles$9.base, key), type && lodash.get(styles$9[type], key), lodash.get(stylesOverrides, key)));
|
|
1773
1828
|
});
|
|
1774
1829
|
return result;
|
|
1775
1830
|
};
|
|
@@ -1790,7 +1845,7 @@ var TabNavigation = {
|
|
|
1790
1845
|
View: View$1,
|
|
1791
1846
|
};
|
|
1792
1847
|
|
|
1793
|
-
var base$
|
|
1848
|
+
var base$7 = {
|
|
1794
1849
|
container: '',
|
|
1795
1850
|
list: {
|
|
1796
1851
|
container: '',
|
|
@@ -1827,8 +1882,8 @@ var buttons = {
|
|
|
1827
1882
|
inactive: 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300',
|
|
1828
1883
|
},
|
|
1829
1884
|
};
|
|
1830
|
-
var styles$
|
|
1831
|
-
base: base$
|
|
1885
|
+
var styles$9 = {
|
|
1886
|
+
base: base$7,
|
|
1832
1887
|
underline: underline,
|
|
1833
1888
|
pills: pills,
|
|
1834
1889
|
buttons: buttons,
|
|
@@ -1855,11 +1910,11 @@ var List = function (props) {
|
|
|
1855
1910
|
setActive && setActive(tab === null || tab === void 0 ? void 0 : tab.props.accessor);
|
|
1856
1911
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1857
1912
|
}, []);
|
|
1858
|
-
return (jsxRuntime.jsx("nav", { className: toClassName(styles$
|
|
1913
|
+
return (jsxRuntime.jsx("nav", { className: toClassName(styles$8.list, stylesOverrides === null || stylesOverrides === void 0 ? void 0 : stylesOverrides.list), children: children }));
|
|
1859
1914
|
};
|
|
1860
1915
|
var Item = function (props) {
|
|
1861
1916
|
var children = props.children, href = props.href, isCurrent = props.isCurrent, _a = props.linkComponent, LinkComponent = _a === void 0 ? 'a' : _a, onClick = props.onClick;
|
|
1862
|
-
return (jsxRuntime.jsx(LinkComponent, { href: href, className: toClassName(styles$
|
|
1917
|
+
return (jsxRuntime.jsx(LinkComponent, { href: href, className: toClassName(styles$8.item[isCurrent ? 'active' : 'notActive'], styles$8.item.base), onClick: onClick, children: children }));
|
|
1863
1918
|
};
|
|
1864
1919
|
var View = function (props) {
|
|
1865
1920
|
var children = props.children;
|
|
@@ -1872,7 +1927,7 @@ var VerticalNavigation = {
|
|
|
1872
1927
|
View: View,
|
|
1873
1928
|
};
|
|
1874
1929
|
|
|
1875
|
-
var styles$
|
|
1930
|
+
var styles$8 = {
|
|
1876
1931
|
container: '',
|
|
1877
1932
|
list: 'space-y-1',
|
|
1878
1933
|
item: {
|
|
@@ -1890,10 +1945,10 @@ var ModalOverlay = function (props) {
|
|
|
1890
1945
|
handleClose: function () { return setIsOpen(false); },
|
|
1891
1946
|
}); }, []);
|
|
1892
1947
|
var handleGenerateStyle = function () {
|
|
1893
|
-
var result = deepCopyObject(styles$
|
|
1894
|
-
var keys = calculateNestedKeys(styles$
|
|
1948
|
+
var result = deepCopyObject(styles$7.base);
|
|
1949
|
+
var keys = calculateNestedKeys(styles$7.base);
|
|
1895
1950
|
keys.forEach(function (key) {
|
|
1896
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
1951
|
+
lodash.set(result, key, toClassName(lodash.get(styles$7.base, key), size && lodash.get(styles$7[size], key), lodash.get(stylesOverrides, key)));
|
|
1897
1952
|
});
|
|
1898
1953
|
return result;
|
|
1899
1954
|
};
|
|
@@ -1911,7 +1966,7 @@ var ModalOverlay = function (props) {
|
|
|
1911
1966
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(react.Transition.Root, { show: isOpen, as: React.Fragment, children: jsxRuntime.jsxs(react.Dialog, { as: "div", className: styles.container, onClose: setIsOpen, children: [jsxRuntime.jsx(react.Transition.Child, { as: React.Fragment, enter: styles.background.transition.enter, enterFrom: styles.background.transition.enterFrom, enterTo: styles.background.transition.enterTo, leave: styles.background.transition.leave, leaveFrom: styles.background.transition.leaveFrom, leaveTo: styles.background.transition.leaveTo, children: jsxRuntime.jsx("div", { className: styles.background.container }) }), jsxRuntime.jsx("div", { className: styles.layout.container, children: jsxRuntime.jsx("div", { className: styles.layout.content, children: jsxRuntime.jsx(react.Transition.Child, { as: React.Fragment, enter: styles.panel.transition.enter, enterFrom: styles.panel.transition.enterFrom, enterTo: styles.panel.transition.enterTo, leave: styles.panel.transition.leave, leaveFrom: styles.panel.transition.leaveFrom, leaveTo: styles.panel.transition.leaveTo, children: jsxRuntime.jsx(react.Dialog.Panel, { className: styles.panel.container, children: children(options) }) }) }) })] }) }), trigger && trigger(options)] }));
|
|
1912
1967
|
};
|
|
1913
1968
|
|
|
1914
|
-
var base$
|
|
1969
|
+
var base$6 = {
|
|
1915
1970
|
container: 'relative z-20',
|
|
1916
1971
|
background: {
|
|
1917
1972
|
container: 'fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity',
|
|
@@ -1965,8 +2020,8 @@ var xl$2 = {
|
|
|
1965
2020
|
container: 'sm:max-w-4xl',
|
|
1966
2021
|
},
|
|
1967
2022
|
};
|
|
1968
|
-
var styles$
|
|
1969
|
-
base: base$
|
|
2023
|
+
var styles$7 = {
|
|
2024
|
+
base: base$6,
|
|
1970
2025
|
xs: xs$2,
|
|
1971
2026
|
sm: sm$2,
|
|
1972
2027
|
md: md$2,
|
|
@@ -1977,10 +2032,10 @@ var styles$6 = {
|
|
|
1977
2032
|
var NotificationOverlayContainer = function (_a) {
|
|
1978
2033
|
var children = _a.children, stylesOverrides = _a.styles;
|
|
1979
2034
|
var handleGenerateStyle = function () {
|
|
1980
|
-
var result = deepCopyObject(styles$
|
|
1981
|
-
var keys = calculateNestedKeys(styles$
|
|
2035
|
+
var result = deepCopyObject(styles$6.base);
|
|
2036
|
+
var keys = calculateNestedKeys(styles$6.base);
|
|
1982
2037
|
keys.forEach(function (key) {
|
|
1983
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
2038
|
+
lodash.set(result, key, toClassName(lodash.get(styles$6.base, key), lodash.get(stylesOverrides, key)));
|
|
1984
2039
|
});
|
|
1985
2040
|
return result;
|
|
1986
2041
|
};
|
|
@@ -1995,10 +2050,10 @@ var NotificationOverlayItem = function (props) {
|
|
|
1995
2050
|
onClose: function () { return setIsOpen(false); },
|
|
1996
2051
|
}); }, []);
|
|
1997
2052
|
var handleGenerateStyle = function () {
|
|
1998
|
-
var result = deepCopyObject(styles$
|
|
1999
|
-
var keys = calculateNestedKeys(styles$
|
|
2053
|
+
var result = deepCopyObject(styles$6.base);
|
|
2054
|
+
var keys = calculateNestedKeys(styles$6.base);
|
|
2000
2055
|
keys.forEach(function (key) {
|
|
2001
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
2056
|
+
lodash.set(result, key, toClassName(lodash.get(styles$6.base, key), size && lodash.get(styles$6[size], key), lodash.get(stylesOverrides, key)));
|
|
2002
2057
|
});
|
|
2003
2058
|
return result;
|
|
2004
2059
|
};
|
|
@@ -2010,7 +2065,7 @@ var NotificationOverlay = {
|
|
|
2010
2065
|
Item: NotificationOverlayItem,
|
|
2011
2066
|
};
|
|
2012
2067
|
|
|
2013
|
-
var base$
|
|
2068
|
+
var base$5 = {
|
|
2014
2069
|
container: {
|
|
2015
2070
|
outer: 'pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6 z-30',
|
|
2016
2071
|
inner: 'flex w-full flex-col items-center space-y-4 sm:items-end',
|
|
@@ -2070,8 +2125,8 @@ var xl$1 = {
|
|
|
2070
2125
|
},
|
|
2071
2126
|
},
|
|
2072
2127
|
};
|
|
2073
|
-
var styles$
|
|
2074
|
-
base: base$
|
|
2128
|
+
var styles$6 = {
|
|
2129
|
+
base: base$5,
|
|
2075
2130
|
xs: xs$1,
|
|
2076
2131
|
sm: sm$1,
|
|
2077
2132
|
md: md$1,
|
|
@@ -2087,10 +2142,10 @@ var SlideOverOverlay = function (props) {
|
|
|
2087
2142
|
handleClose: function () { return setIsOpen(false); },
|
|
2088
2143
|
}); }, []);
|
|
2089
2144
|
var handleGenerateStyle = function () {
|
|
2090
|
-
var result = deepCopyObject(styles$
|
|
2091
|
-
var keys = calculateNestedKeys(styles$
|
|
2145
|
+
var result = deepCopyObject(styles$5.base);
|
|
2146
|
+
var keys = calculateNestedKeys(styles$5.base);
|
|
2092
2147
|
keys.forEach(function (key) {
|
|
2093
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
2148
|
+
lodash.set(result, key, toClassName(lodash.get(styles$5.base, key), size && lodash.get(styles$5[size], key), lodash.get(stylesOverrides, key)));
|
|
2094
2149
|
});
|
|
2095
2150
|
return result;
|
|
2096
2151
|
};
|
|
@@ -2098,7 +2153,7 @@ var SlideOverOverlay = function (props) {
|
|
|
2098
2153
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(react.Transition.Root, { show: isOpen, as: React.Fragment, children: jsxRuntime.jsxs(react.Dialog, { as: "div", className: styles.container, onClose: setIsOpen, children: [jsxRuntime.jsx(react.Transition.Child, { as: React.Fragment, enter: styles.background.transition.enter, enterFrom: styles.background.transition.enterFrom, enterTo: styles.background.transition.enterTo, leave: styles.background.transition.leave, leaveFrom: styles.background.transition.leaveFrom, leaveTo: styles.background.transition.leaveTo, children: jsxRuntime.jsx("div", { className: styles.background.container }) }), jsxRuntime.jsx("div", { className: styles.layout.container, children: jsxRuntime.jsx("div", { className: styles.layout.content, children: jsxRuntime.jsx("div", { className: styles.layout.inner, children: jsxRuntime.jsx(react.Transition.Child, { as: React.Fragment, enter: styles.panel.transition.enter, enterFrom: styles.panel.transition.enterFrom, enterTo: styles.panel.transition.enterTo, leave: styles.panel.transition.leave, leaveFrom: styles.panel.transition.leaveFrom, leaveTo: styles.panel.transition.leaveTo, children: jsxRuntime.jsx(react.Dialog.Panel, { className: styles.panel.container, children: children(options) }) }) }) }) })] }) }), trigger && trigger(options)] }));
|
|
2099
2154
|
};
|
|
2100
2155
|
|
|
2101
|
-
var base$
|
|
2156
|
+
var base$4 = {
|
|
2102
2157
|
container: 'relative z-20',
|
|
2103
2158
|
background: {
|
|
2104
2159
|
container: 'fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity',
|
|
@@ -2153,8 +2208,8 @@ var xl = {
|
|
|
2153
2208
|
container: 'sm:max-w-4xl',
|
|
2154
2209
|
},
|
|
2155
2210
|
};
|
|
2156
|
-
var styles$
|
|
2157
|
-
base: base$
|
|
2211
|
+
var styles$5 = {
|
|
2212
|
+
base: base$4,
|
|
2158
2213
|
xs: xs,
|
|
2159
2214
|
sm: sm,
|
|
2160
2215
|
md: md,
|
|
@@ -2175,17 +2230,17 @@ var TableColumnOptionsCustom = function (props) {
|
|
|
2175
2230
|
ids.splice(location, 0, column.id);
|
|
2176
2231
|
setColumnOrder(ids);
|
|
2177
2232
|
}, []);
|
|
2178
|
-
return (jsxRuntime.jsx(DropdownElement.Container, { trigger: trigger, children: jsxRuntime.jsx("div", { className: styles$
|
|
2233
|
+
return (jsxRuntime.jsx(DropdownElement.Container, { trigger: trigger, children: jsxRuntime.jsx("div", { className: styles$4.controls.content, children: table.getAllLeafColumns().map(function (column, index) {
|
|
2179
2234
|
var canSort = column === null || column === void 0 ? void 0 : column.getCanSort();
|
|
2180
|
-
return (jsxRuntime.jsx(DropdownElement.Item, { children: function () { return (jsxRuntime.jsxs("div", { className: toClassName(styles$
|
|
2235
|
+
return (jsxRuntime.jsx(DropdownElement.Item, { children: function () { return (jsxRuntime.jsxs("div", { className: toClassName(styles$4.controls.dropdown.container, !canSort && 'hidden'), children: [jsxRuntime.jsx("input", { className: styles$4.controls.dropdown.input, type: "checkbox", checked: column.getIsVisible(), onChange: column.getToggleVisibilityHandler() }), jsxRuntime.jsx("label", { className: styles$4.controls.dropdown.label, children: column.columnDef.header }), jsxRuntime.jsxs("div", { className: styles$4.controls.dropdown.actions, children: [jsxRuntime.jsx(outline$2.ChevronDownIcon, { className: styles$4.controls.dropdown.upIcon, onClick: function () {
|
|
2181
2236
|
return handleUpdateColumnOrder(table, column, index - 1, setColumnOrder);
|
|
2182
|
-
} }), jsxRuntime.jsx(outline$2.ChevronDownIcon, { className: styles$
|
|
2237
|
+
} }), jsxRuntime.jsx(outline$2.ChevronDownIcon, { className: styles$4.controls.dropdown.downIcon, onClick: function () {
|
|
2183
2238
|
return handleUpdateColumnOrder(table, column, index + 1, setColumnOrder);
|
|
2184
2239
|
} })] })] })); } }, column.id));
|
|
2185
2240
|
}) }) }));
|
|
2186
2241
|
};
|
|
2187
2242
|
|
|
2188
|
-
var styles$
|
|
2243
|
+
var styles$4 = {
|
|
2189
2244
|
container: '',
|
|
2190
2245
|
controls: {
|
|
2191
2246
|
container: 'flex-row justify-between z-10 relative mb-4 gap-2 hidden',
|
|
@@ -2222,10 +2277,10 @@ var SelectMenuForm = function (props) {
|
|
|
2222
2277
|
var _k = React.useState(value !== null && value !== void 0 ? value : null), state = _k[0], setState = _k[1];
|
|
2223
2278
|
var isValid = error === undefined;
|
|
2224
2279
|
var handleGenerateStyle = function () {
|
|
2225
|
-
var result = deepCopyObject(styles$
|
|
2226
|
-
var keys = calculateNestedKeys(styles$
|
|
2280
|
+
var result = deepCopyObject(styles$3.base);
|
|
2281
|
+
var keys = calculateNestedKeys(styles$3.base);
|
|
2227
2282
|
keys.forEach(function (key) {
|
|
2228
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
2283
|
+
lodash.set(result, key, toClassName(lodash.get(styles$3.base, key), lodash.get(styles$3['normal'], key), isTouched === true && !isValid && lodash.get(styles$3.invalid, key), isDisabled && lodash.get(styles$3.disabled, key), lodash.get(stylesOverrides, key)));
|
|
2229
2284
|
});
|
|
2230
2285
|
return result;
|
|
2231
2286
|
};
|
|
@@ -2282,7 +2337,7 @@ var SelectMenuForm = function (props) {
|
|
|
2282
2337
|
} }), !isSolo && (jsxRuntime.jsxs("div", { className: styles.foot, children: [description && !(error && isTouched) && (jsxRuntime.jsx("p", { className: styles.description, children: description })), error && isTouched && (jsxRuntime.jsx("p", { className: styles.error, children: JSON.stringify(error).replaceAll('"', '') }))] }))] })] }));
|
|
2283
2338
|
};
|
|
2284
2339
|
|
|
2285
|
-
var base$
|
|
2340
|
+
var base$3 = {
|
|
2286
2341
|
container: '',
|
|
2287
2342
|
head: 'flex justify-between',
|
|
2288
2343
|
body: 'relative rounded-md',
|
|
@@ -2310,11 +2365,11 @@ var base$2 = {
|
|
|
2310
2365
|
description: 'text-gray-400 text-xs mt-1',
|
|
2311
2366
|
error: 'text-red-500 text-xs ml-5 mt-1',
|
|
2312
2367
|
};
|
|
2313
|
-
var leading$
|
|
2368
|
+
var leading$2 = {
|
|
2314
2369
|
input: 'pl-10',
|
|
2315
2370
|
};
|
|
2316
|
-
var trailing$
|
|
2317
|
-
var normal$
|
|
2371
|
+
var trailing$2 = {};
|
|
2372
|
+
var normal$2 = {
|
|
2318
2373
|
label: 'leading-6 text-sm mb-2',
|
|
2319
2374
|
hint: 'leading-6',
|
|
2320
2375
|
leading: 'pl-3',
|
|
@@ -2322,14 +2377,14 @@ var normal$1 = {
|
|
|
2322
2377
|
trailing: '',
|
|
2323
2378
|
description: 'mt-2 text-sm',
|
|
2324
2379
|
};
|
|
2325
|
-
var inset$
|
|
2380
|
+
var inset$2 = {
|
|
2326
2381
|
container: 'rounded-md px-3 pt-2.5 pb-1.5 shadow-sm ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-primary-600',
|
|
2327
2382
|
label: 'text-xs',
|
|
2328
2383
|
hint: 'text-xs',
|
|
2329
2384
|
input: 'border-0 !ring-0 p-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm pl-0',
|
|
2330
2385
|
description: 'hidden',
|
|
2331
2386
|
};
|
|
2332
|
-
var overlapping$
|
|
2387
|
+
var overlapping$2 = {
|
|
2333
2388
|
container: 'relative',
|
|
2334
2389
|
head: ' absolute flex justify-between items-center left-0 -top-2 right-0 mx-2 z-10 w-full',
|
|
2335
2390
|
label: 'inline-block bg-white px-1 text-xs font-medium text-gray-900 ',
|
|
@@ -2337,40 +2392,40 @@ var overlapping$1 = {
|
|
|
2337
2392
|
input: 'block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6',
|
|
2338
2393
|
description: 'hidden',
|
|
2339
2394
|
};
|
|
2340
|
-
var pill$
|
|
2395
|
+
var pill$2 = {
|
|
2341
2396
|
head: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mb-1 pr-6',
|
|
2342
2397
|
foot: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mt-1 pr-6',
|
|
2343
2398
|
input: 'block w-full rounded-full border-0 px-4 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6',
|
|
2344
2399
|
trailing: 'pr-2',
|
|
2345
2400
|
description: 'text-xs',
|
|
2346
2401
|
};
|
|
2347
|
-
var floored$
|
|
2402
|
+
var floored$2 = {
|
|
2348
2403
|
body: 'relative mt-2',
|
|
2349
2404
|
label: 'block text-sm font-medium leading-6 text-gray-900',
|
|
2350
2405
|
input: 'peer block w-full border-0 bg-gray-50 py-1.5 text-gray-900 focus:ring-0 sm:text-sm sm:leading-6 ring-0',
|
|
2351
2406
|
description: 'text-xs mt-2',
|
|
2352
2407
|
};
|
|
2353
|
-
var invalid$
|
|
2408
|
+
var invalid$2 = {
|
|
2354
2409
|
container: 'ring-red-500',
|
|
2355
2410
|
input:
|
|
2356
2411
|
// 'block w-full border border-transparent text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500 sm:leading-6 pr-10',
|
|
2357
2412
|
'block w-full border border-transparent text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500',
|
|
2358
2413
|
description: 'text-sm text-red-600',
|
|
2359
2414
|
};
|
|
2360
|
-
var disabled$
|
|
2415
|
+
var disabled$3 = {
|
|
2361
2416
|
input: 'block w-full rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 cursor-not-allowed bg-gray-50 text-gray-500 ring-gray-200',
|
|
2362
2417
|
};
|
|
2363
|
-
var styles$
|
|
2364
|
-
base: base$
|
|
2365
|
-
leading: leading$
|
|
2366
|
-
trailing: trailing$
|
|
2367
|
-
normal: normal$
|
|
2368
|
-
inset: inset$
|
|
2369
|
-
overlapping: overlapping$
|
|
2370
|
-
pill: pill$
|
|
2371
|
-
floored: floored$
|
|
2372
|
-
invalid: invalid$
|
|
2373
|
-
disabled: disabled$
|
|
2418
|
+
var styles$3 = {
|
|
2419
|
+
base: base$3,
|
|
2420
|
+
leading: leading$2,
|
|
2421
|
+
trailing: trailing$2,
|
|
2422
|
+
normal: normal$2,
|
|
2423
|
+
inset: inset$2,
|
|
2424
|
+
overlapping: overlapping$2,
|
|
2425
|
+
pill: pill$2,
|
|
2426
|
+
floored: floored$2,
|
|
2427
|
+
invalid: invalid$2,
|
|
2428
|
+
disabled: disabled$3,
|
|
2374
2429
|
};
|
|
2375
2430
|
|
|
2376
2431
|
var DateMenuForm = function (props) {
|
|
@@ -2390,10 +2445,10 @@ var DateMenuForm = function (props) {
|
|
|
2390
2445
|
setIsFocus(false);
|
|
2391
2446
|
};
|
|
2392
2447
|
var handleGenerateStyle = function () {
|
|
2393
|
-
var result = deepCopyObject(styles$
|
|
2394
|
-
var keys = calculateNestedKeys(styles$
|
|
2448
|
+
var result = deepCopyObject(styles$2.base);
|
|
2449
|
+
var keys = calculateNestedKeys(styles$2.base);
|
|
2395
2450
|
keys.forEach(function (key) {
|
|
2396
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
2451
|
+
lodash.set(result, key, toClassName(lodash.get(styles$2.base, key), type && lodash.get(styles$2[type], key), isTouched === true && !isValid && lodash.get(styles$2.invalid, key), isDisabled && lodash.get(styles$2.disabled, key), lodash.get(stylesOverrides, key)));
|
|
2397
2452
|
});
|
|
2398
2453
|
return result;
|
|
2399
2454
|
};
|
|
@@ -2423,7 +2478,7 @@ var DateMenuForm = function (props) {
|
|
|
2423
2478
|
: (_a = error === null || error === void 0 ? void 0 : error.startDate) !== null && _a !== void 0 ? _a : error === null || error === void 0 ? void 0 : error.endDate }))] }))] })] }));
|
|
2424
2479
|
};
|
|
2425
2480
|
|
|
2426
|
-
var base$
|
|
2481
|
+
var base$2 = {
|
|
2427
2482
|
container: '',
|
|
2428
2483
|
head: 'flex justify-between',
|
|
2429
2484
|
body: 'relative rounded-md',
|
|
@@ -2436,11 +2491,11 @@ var base$1 = {
|
|
|
2436
2491
|
description: 'text-gray-400 text-xs mt-1',
|
|
2437
2492
|
error: 'text-red-500 text-xs ml-5 mt-1',
|
|
2438
2493
|
};
|
|
2439
|
-
var leading = {
|
|
2494
|
+
var leading$1 = {
|
|
2440
2495
|
input: 'pl-10',
|
|
2441
2496
|
};
|
|
2442
|
-
var trailing = {};
|
|
2443
|
-
var normal = {
|
|
2497
|
+
var trailing$1 = {};
|
|
2498
|
+
var normal$1 = {
|
|
2444
2499
|
label: 'leading-6 text-sm mb-2',
|
|
2445
2500
|
hint: 'leading-6',
|
|
2446
2501
|
leading: 'pl-3',
|
|
@@ -2448,14 +2503,14 @@ var normal = {
|
|
|
2448
2503
|
trailing: 'pr-3',
|
|
2449
2504
|
description: 'mt-2 text-sm',
|
|
2450
2505
|
};
|
|
2451
|
-
var inset = {
|
|
2506
|
+
var inset$1 = {
|
|
2452
2507
|
container: 'rounded-md px-3 pt-2.5 pb-1.5 shadow-sm ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-primary-600',
|
|
2453
2508
|
label: 'text-xs',
|
|
2454
2509
|
hint: 'text-xs',
|
|
2455
2510
|
input: 'border-0 !ring-0 p-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm pl-0',
|
|
2456
2511
|
description: 'hidden',
|
|
2457
2512
|
};
|
|
2458
|
-
var overlapping = {
|
|
2513
|
+
var overlapping$1 = {
|
|
2459
2514
|
container: 'relative',
|
|
2460
2515
|
head: ' absolute flex justify-between items-center left-0 -top-2 right-0 mx-2 z-10 w-full',
|
|
2461
2516
|
label: 'inline-block bg-white px-1 text-xs font-medium text-gray-900 ',
|
|
@@ -2463,58 +2518,58 @@ var overlapping = {
|
|
|
2463
2518
|
input: 'block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6',
|
|
2464
2519
|
description: 'hidden',
|
|
2465
2520
|
};
|
|
2466
|
-
var pill = {
|
|
2521
|
+
var pill$1 = {
|
|
2467
2522
|
head: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mb-1 pr-6',
|
|
2468
2523
|
foot: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mt-1 pr-6',
|
|
2469
2524
|
input: 'block w-full rounded-full border-0 px-4 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6',
|
|
2470
2525
|
trailing: 'pr-2',
|
|
2471
2526
|
description: 'text-xs',
|
|
2472
2527
|
};
|
|
2473
|
-
var floored = {
|
|
2528
|
+
var floored$1 = {
|
|
2474
2529
|
body: 'relative mt-2',
|
|
2475
2530
|
label: 'block text-sm font-medium leading-6 text-gray-900',
|
|
2476
2531
|
input: 'peer block w-full border-0 bg-gray-50 py-1.5 text-gray-900 focus:ring-0 sm:text-sm sm:leading-6 ring-0',
|
|
2477
2532
|
description: 'text-xs mt-2',
|
|
2478
2533
|
};
|
|
2479
|
-
var invalid = {
|
|
2534
|
+
var invalid$1 = {
|
|
2480
2535
|
container: '!ring-red-500',
|
|
2481
2536
|
input:
|
|
2482
2537
|
// 'block w-full border border-transparent text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500 sm:leading-6 pr-10',
|
|
2483
2538
|
'block w-full border border-transparent text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500 pr-10',
|
|
2484
2539
|
description: 'text-sm text-red-600',
|
|
2485
2540
|
};
|
|
2486
|
-
var disabled$
|
|
2541
|
+
var disabled$2 = {
|
|
2487
2542
|
input: 'block w-full rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-500 disabled:ring-gray-200',
|
|
2488
2543
|
};
|
|
2489
|
-
var styles$
|
|
2490
|
-
base: base$
|
|
2491
|
-
leading: leading,
|
|
2492
|
-
trailing: trailing,
|
|
2493
|
-
normal: normal,
|
|
2494
|
-
inset: inset,
|
|
2495
|
-
overlapping: overlapping,
|
|
2496
|
-
pill: pill,
|
|
2497
|
-
floored: floored,
|
|
2498
|
-
invalid: invalid,
|
|
2499
|
-
disabled: disabled$
|
|
2544
|
+
var styles$2 = {
|
|
2545
|
+
base: base$2,
|
|
2546
|
+
leading: leading$1,
|
|
2547
|
+
trailing: trailing$1,
|
|
2548
|
+
normal: normal$1,
|
|
2549
|
+
inset: inset$1,
|
|
2550
|
+
overlapping: overlapping$1,
|
|
2551
|
+
pill: pill$1,
|
|
2552
|
+
floored: floored$1,
|
|
2553
|
+
invalid: invalid$1,
|
|
2554
|
+
disabled: disabled$2,
|
|
2500
2555
|
};
|
|
2501
2556
|
|
|
2502
2557
|
var CheckboxInputGroupForm = function (props) {
|
|
2503
2558
|
var name = props.name, form = props.form, options = props.options, values = props.values, isDisabled = props.isDisabled, stylesOverrides = props.styles;
|
|
2504
2559
|
var handleGenerateStyle = function () {
|
|
2505
|
-
var result = deepCopyObject(styles.base);
|
|
2506
|
-
var keys = calculateNestedKeys(styles.base);
|
|
2560
|
+
var result = deepCopyObject(styles$1.base);
|
|
2561
|
+
var keys = calculateNestedKeys(styles$1.base);
|
|
2507
2562
|
keys.forEach(function (key) {
|
|
2508
|
-
lodash.set(result, key, toClassName(lodash.get(styles.base, key),
|
|
2563
|
+
lodash.set(result, key, toClassName(lodash.get(styles$1.base, key),
|
|
2509
2564
|
// isTouched === true && !isValid && get(defaultStyles.invalid, key),
|
|
2510
|
-
isDisabled && lodash.get(styles.disabled, key), lodash.get(stylesOverrides, key)));
|
|
2565
|
+
isDisabled && lodash.get(styles$1.disabled, key), lodash.get(stylesOverrides, key)));
|
|
2511
2566
|
});
|
|
2512
2567
|
return result;
|
|
2513
2568
|
};
|
|
2514
|
-
var styles
|
|
2515
|
-
return (jsxRuntime.jsx(formik.FormikProvider, { value: form, children: jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("legend", { className: styles
|
|
2569
|
+
var styles = handleGenerateStyle();
|
|
2570
|
+
return (jsxRuntime.jsx(formik.FormikProvider, { value: form, children: jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("legend", { className: styles.sr, children: name }), jsxRuntime.jsx("div", { className: styles.list, children: jsxRuntime.jsx(formik.FieldArray, { name: name, render: function (_a) {
|
|
2516
2571
|
var remove = _a.remove, push = _a.push;
|
|
2517
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: options === null || options === void 0 ? void 0 : options.map(function (option) { return (jsxRuntime.jsxs("div", { className: styles
|
|
2572
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: options === null || options === void 0 ? void 0 : options.map(function (option) { return (jsxRuntime.jsxs("div", { className: styles.item.container, children: [jsxRuntime.jsx("div", { className: styles.item.head, children: jsxRuntime.jsx("input", { id: option.value, name: option.value, "aria-describedby": "".concat(option.value, "-description"), type: "checkbox", checked: values === null || values === void 0 ? void 0 : values.includes(option.value), className: styles.item.input, disabled: isDisabled, onChange: function (value) {
|
|
2518
2573
|
var isChecked = value.currentTarget.checked;
|
|
2519
2574
|
if (isChecked) {
|
|
2520
2575
|
push(option.value);
|
|
@@ -2522,11 +2577,11 @@ var CheckboxInputGroupForm = function (props) {
|
|
|
2522
2577
|
}
|
|
2523
2578
|
var findIndex = values.findIndex(function (value) { return value === option.value; });
|
|
2524
2579
|
remove(findIndex);
|
|
2525
|
-
} }) }), jsxRuntime.jsxs("div", { className: styles
|
|
2580
|
+
} }) }), jsxRuntime.jsxs("div", { className: styles.item.body, children: [jsxRuntime.jsx("label", { htmlFor: "comments", className: styles.item.label, children: option.title }), option.description && (jsxRuntime.jsx("p", { id: "comments-description", className: styles.item.description, children: option.description }))] })] }, option.value)); }) }));
|
|
2526
2581
|
} }) })] }) }));
|
|
2527
2582
|
};
|
|
2528
2583
|
|
|
2529
|
-
var base = {
|
|
2584
|
+
var base$1 = {
|
|
2530
2585
|
container: '',
|
|
2531
2586
|
sr: 'sr-only',
|
|
2532
2587
|
list: 'space-y-5',
|
|
@@ -2539,13 +2594,2020 @@ var base = {
|
|
|
2539
2594
|
description: 'text-gray-500',
|
|
2540
2595
|
},
|
|
2541
2596
|
};
|
|
2542
|
-
var disabled = {
|
|
2597
|
+
var disabled$1 = {
|
|
2543
2598
|
item: {
|
|
2544
2599
|
input: 'block rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-500 disabled:ring-gray-200',
|
|
2545
2600
|
},
|
|
2546
2601
|
};
|
|
2602
|
+
var styles$1 = {
|
|
2603
|
+
base: base$1,
|
|
2604
|
+
disabled: disabled$1,
|
|
2605
|
+
};
|
|
2606
|
+
|
|
2607
|
+
function getDefaultExportFromCjs (x) {
|
|
2608
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
2609
|
+
}
|
|
2610
|
+
|
|
2611
|
+
var propTypes = {exports: {}};
|
|
2612
|
+
|
|
2613
|
+
var reactIs = {exports: {}};
|
|
2614
|
+
|
|
2615
|
+
var reactIs_production_min = {};
|
|
2616
|
+
|
|
2617
|
+
var hasRequiredReactIs_production_min;
|
|
2618
|
+
function requireReactIs_production_min () {
|
|
2619
|
+
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
2620
|
+
hasRequiredReactIs_production_min = 1;
|
|
2621
|
+
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
|
2622
|
+
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
|
2623
|
+
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
|
|
2624
|
+
reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
|
|
2625
|
+
reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
|
|
2626
|
+
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
|
|
2627
|
+
return reactIs_production_min;
|
|
2628
|
+
}
|
|
2629
|
+
|
|
2630
|
+
var reactIs_development = {};
|
|
2631
|
+
|
|
2632
|
+
var hasRequiredReactIs_development;
|
|
2633
|
+
function requireReactIs_development () {
|
|
2634
|
+
if (hasRequiredReactIs_development) return reactIs_development;
|
|
2635
|
+
hasRequiredReactIs_development = 1;
|
|
2636
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2637
|
+
(function() {
|
|
2638
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
2639
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
2640
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
2641
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
2642
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
2643
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
2644
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
2645
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
|
2646
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
2647
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
2648
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
2649
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
2650
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
2651
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
2652
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
2653
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
2654
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
2655
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
2656
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
2657
|
+
function isValidElementType(type) {
|
|
2658
|
+
return typeof type === 'string' || typeof type === 'function' ||
|
|
2659
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
2660
|
+
}
|
|
2661
|
+
function typeOf(object) {
|
|
2662
|
+
if (typeof object === 'object' && object !== null) {
|
|
2663
|
+
var $$typeof = object.$$typeof;
|
|
2664
|
+
switch ($$typeof) {
|
|
2665
|
+
case REACT_ELEMENT_TYPE:
|
|
2666
|
+
var type = object.type;
|
|
2667
|
+
switch (type) {
|
|
2668
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
2669
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
2670
|
+
case REACT_FRAGMENT_TYPE:
|
|
2671
|
+
case REACT_PROFILER_TYPE:
|
|
2672
|
+
case REACT_STRICT_MODE_TYPE:
|
|
2673
|
+
case REACT_SUSPENSE_TYPE:
|
|
2674
|
+
return type;
|
|
2675
|
+
default:
|
|
2676
|
+
var $$typeofType = type && type.$$typeof;
|
|
2677
|
+
switch ($$typeofType) {
|
|
2678
|
+
case REACT_CONTEXT_TYPE:
|
|
2679
|
+
case REACT_FORWARD_REF_TYPE:
|
|
2680
|
+
case REACT_LAZY_TYPE:
|
|
2681
|
+
case REACT_MEMO_TYPE:
|
|
2682
|
+
case REACT_PROVIDER_TYPE:
|
|
2683
|
+
return $$typeofType;
|
|
2684
|
+
default:
|
|
2685
|
+
return $$typeof;
|
|
2686
|
+
}
|
|
2687
|
+
}
|
|
2688
|
+
case REACT_PORTAL_TYPE:
|
|
2689
|
+
return $$typeof;
|
|
2690
|
+
}
|
|
2691
|
+
}
|
|
2692
|
+
return undefined;
|
|
2693
|
+
}
|
|
2694
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
2695
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
2696
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
2697
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
2698
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
2699
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
2700
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
2701
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
2702
|
+
var Memo = REACT_MEMO_TYPE;
|
|
2703
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
2704
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
2705
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
2706
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
2707
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
2708
|
+
function isAsyncMode(object) {
|
|
2709
|
+
{
|
|
2710
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
2711
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
2712
|
+
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
2716
|
+
}
|
|
2717
|
+
function isConcurrentMode(object) {
|
|
2718
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
2719
|
+
}
|
|
2720
|
+
function isContextConsumer(object) {
|
|
2721
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
2722
|
+
}
|
|
2723
|
+
function isContextProvider(object) {
|
|
2724
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
2725
|
+
}
|
|
2726
|
+
function isElement(object) {
|
|
2727
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
2728
|
+
}
|
|
2729
|
+
function isForwardRef(object) {
|
|
2730
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
2731
|
+
}
|
|
2732
|
+
function isFragment(object) {
|
|
2733
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
2734
|
+
}
|
|
2735
|
+
function isLazy(object) {
|
|
2736
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
2737
|
+
}
|
|
2738
|
+
function isMemo(object) {
|
|
2739
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
2740
|
+
}
|
|
2741
|
+
function isPortal(object) {
|
|
2742
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
2743
|
+
}
|
|
2744
|
+
function isProfiler(object) {
|
|
2745
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
2746
|
+
}
|
|
2747
|
+
function isStrictMode(object) {
|
|
2748
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
2749
|
+
}
|
|
2750
|
+
function isSuspense(object) {
|
|
2751
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
2752
|
+
}
|
|
2753
|
+
reactIs_development.AsyncMode = AsyncMode;
|
|
2754
|
+
reactIs_development.ConcurrentMode = ConcurrentMode;
|
|
2755
|
+
reactIs_development.ContextConsumer = ContextConsumer;
|
|
2756
|
+
reactIs_development.ContextProvider = ContextProvider;
|
|
2757
|
+
reactIs_development.Element = Element;
|
|
2758
|
+
reactIs_development.ForwardRef = ForwardRef;
|
|
2759
|
+
reactIs_development.Fragment = Fragment;
|
|
2760
|
+
reactIs_development.Lazy = Lazy;
|
|
2761
|
+
reactIs_development.Memo = Memo;
|
|
2762
|
+
reactIs_development.Portal = Portal;
|
|
2763
|
+
reactIs_development.Profiler = Profiler;
|
|
2764
|
+
reactIs_development.StrictMode = StrictMode;
|
|
2765
|
+
reactIs_development.Suspense = Suspense;
|
|
2766
|
+
reactIs_development.isAsyncMode = isAsyncMode;
|
|
2767
|
+
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
2768
|
+
reactIs_development.isContextConsumer = isContextConsumer;
|
|
2769
|
+
reactIs_development.isContextProvider = isContextProvider;
|
|
2770
|
+
reactIs_development.isElement = isElement;
|
|
2771
|
+
reactIs_development.isForwardRef = isForwardRef;
|
|
2772
|
+
reactIs_development.isFragment = isFragment;
|
|
2773
|
+
reactIs_development.isLazy = isLazy;
|
|
2774
|
+
reactIs_development.isMemo = isMemo;
|
|
2775
|
+
reactIs_development.isPortal = isPortal;
|
|
2776
|
+
reactIs_development.isProfiler = isProfiler;
|
|
2777
|
+
reactIs_development.isStrictMode = isStrictMode;
|
|
2778
|
+
reactIs_development.isSuspense = isSuspense;
|
|
2779
|
+
reactIs_development.isValidElementType = isValidElementType;
|
|
2780
|
+
reactIs_development.typeOf = typeOf;
|
|
2781
|
+
})();
|
|
2782
|
+
}
|
|
2783
|
+
return reactIs_development;
|
|
2784
|
+
}
|
|
2785
|
+
|
|
2786
|
+
var hasRequiredReactIs;
|
|
2787
|
+
function requireReactIs () {
|
|
2788
|
+
if (hasRequiredReactIs) return reactIs.exports;
|
|
2789
|
+
hasRequiredReactIs = 1;
|
|
2790
|
+
if (process.env.NODE_ENV === 'production') {
|
|
2791
|
+
reactIs.exports = requireReactIs_production_min();
|
|
2792
|
+
} else {
|
|
2793
|
+
reactIs.exports = requireReactIs_development();
|
|
2794
|
+
}
|
|
2795
|
+
return reactIs.exports;
|
|
2796
|
+
}
|
|
2797
|
+
|
|
2798
|
+
var objectAssign;
|
|
2799
|
+
var hasRequiredObjectAssign;
|
|
2800
|
+
function requireObjectAssign () {
|
|
2801
|
+
if (hasRequiredObjectAssign) return objectAssign;
|
|
2802
|
+
hasRequiredObjectAssign = 1;
|
|
2803
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
2804
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2805
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
2806
|
+
function toObject(val) {
|
|
2807
|
+
if (val === null || val === undefined) {
|
|
2808
|
+
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
2809
|
+
}
|
|
2810
|
+
return Object(val);
|
|
2811
|
+
}
|
|
2812
|
+
function shouldUseNative() {
|
|
2813
|
+
try {
|
|
2814
|
+
if (!Object.assign) {
|
|
2815
|
+
return false;
|
|
2816
|
+
}
|
|
2817
|
+
var test1 = new String('abc');
|
|
2818
|
+
test1[5] = 'de';
|
|
2819
|
+
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
2820
|
+
return false;
|
|
2821
|
+
}
|
|
2822
|
+
var test2 = {};
|
|
2823
|
+
for (var i = 0; i < 10; i++) {
|
|
2824
|
+
test2['_' + String.fromCharCode(i)] = i;
|
|
2825
|
+
}
|
|
2826
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
2827
|
+
return test2[n];
|
|
2828
|
+
});
|
|
2829
|
+
if (order2.join('') !== '0123456789') {
|
|
2830
|
+
return false;
|
|
2831
|
+
}
|
|
2832
|
+
var test3 = {};
|
|
2833
|
+
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
2834
|
+
test3[letter] = letter;
|
|
2835
|
+
});
|
|
2836
|
+
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
2837
|
+
'abcdefghijklmnopqrst') {
|
|
2838
|
+
return false;
|
|
2839
|
+
}
|
|
2840
|
+
return true;
|
|
2841
|
+
} catch (err) {
|
|
2842
|
+
return false;
|
|
2843
|
+
}
|
|
2844
|
+
}
|
|
2845
|
+
objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
2846
|
+
var from;
|
|
2847
|
+
var to = toObject(target);
|
|
2848
|
+
var symbols;
|
|
2849
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
2850
|
+
from = Object(arguments[s]);
|
|
2851
|
+
for (var key in from) {
|
|
2852
|
+
if (hasOwnProperty.call(from, key)) {
|
|
2853
|
+
to[key] = from[key];
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2856
|
+
if (getOwnPropertySymbols) {
|
|
2857
|
+
symbols = getOwnPropertySymbols(from);
|
|
2858
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
2859
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
2860
|
+
to[symbols[i]] = from[symbols[i]];
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
}
|
|
2865
|
+
return to;
|
|
2866
|
+
};
|
|
2867
|
+
return objectAssign;
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
var ReactPropTypesSecret_1;
|
|
2871
|
+
var hasRequiredReactPropTypesSecret;
|
|
2872
|
+
function requireReactPropTypesSecret () {
|
|
2873
|
+
if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
|
|
2874
|
+
hasRequiredReactPropTypesSecret = 1;
|
|
2875
|
+
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
2876
|
+
ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
2877
|
+
return ReactPropTypesSecret_1;
|
|
2878
|
+
}
|
|
2879
|
+
|
|
2880
|
+
var has;
|
|
2881
|
+
var hasRequiredHas;
|
|
2882
|
+
function requireHas () {
|
|
2883
|
+
if (hasRequiredHas) return has;
|
|
2884
|
+
hasRequiredHas = 1;
|
|
2885
|
+
has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
2886
|
+
return has;
|
|
2887
|
+
}
|
|
2888
|
+
|
|
2889
|
+
var checkPropTypes_1;
|
|
2890
|
+
var hasRequiredCheckPropTypes;
|
|
2891
|
+
function requireCheckPropTypes () {
|
|
2892
|
+
if (hasRequiredCheckPropTypes) return checkPropTypes_1;
|
|
2893
|
+
hasRequiredCheckPropTypes = 1;
|
|
2894
|
+
var printWarning = function() {};
|
|
2895
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2896
|
+
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
2897
|
+
var loggedTypeFailures = {};
|
|
2898
|
+
var has = requireHas();
|
|
2899
|
+
printWarning = function(text) {
|
|
2900
|
+
var message = 'Warning: ' + text;
|
|
2901
|
+
if (typeof console !== 'undefined') {
|
|
2902
|
+
console.error(message);
|
|
2903
|
+
}
|
|
2904
|
+
try {
|
|
2905
|
+
throw new Error(message);
|
|
2906
|
+
} catch (x) { }
|
|
2907
|
+
};
|
|
2908
|
+
}
|
|
2909
|
+
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
2910
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2911
|
+
for (var typeSpecName in typeSpecs) {
|
|
2912
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
2913
|
+
var error;
|
|
2914
|
+
try {
|
|
2915
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
2916
|
+
var err = Error(
|
|
2917
|
+
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
2918
|
+
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
|
|
2919
|
+
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
2920
|
+
);
|
|
2921
|
+
err.name = 'Invariant Violation';
|
|
2922
|
+
throw err;
|
|
2923
|
+
}
|
|
2924
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
2925
|
+
} catch (ex) {
|
|
2926
|
+
error = ex;
|
|
2927
|
+
}
|
|
2928
|
+
if (error && !(error instanceof Error)) {
|
|
2929
|
+
printWarning(
|
|
2930
|
+
(componentName || 'React class') + ': type specification of ' +
|
|
2931
|
+
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
|
2932
|
+
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
|
2933
|
+
'You may have forgotten to pass an argument to the type checker ' +
|
|
2934
|
+
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
|
2935
|
+
'shape all require an argument).'
|
|
2936
|
+
);
|
|
2937
|
+
}
|
|
2938
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
2939
|
+
loggedTypeFailures[error.message] = true;
|
|
2940
|
+
var stack = getStack ? getStack() : '';
|
|
2941
|
+
printWarning(
|
|
2942
|
+
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
|
2943
|
+
);
|
|
2944
|
+
}
|
|
2945
|
+
}
|
|
2946
|
+
}
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
checkPropTypes.resetWarningCache = function() {
|
|
2950
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2951
|
+
loggedTypeFailures = {};
|
|
2952
|
+
}
|
|
2953
|
+
};
|
|
2954
|
+
checkPropTypes_1 = checkPropTypes;
|
|
2955
|
+
return checkPropTypes_1;
|
|
2956
|
+
}
|
|
2957
|
+
|
|
2958
|
+
var factoryWithTypeCheckers;
|
|
2959
|
+
var hasRequiredFactoryWithTypeCheckers;
|
|
2960
|
+
function requireFactoryWithTypeCheckers () {
|
|
2961
|
+
if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
|
|
2962
|
+
hasRequiredFactoryWithTypeCheckers = 1;
|
|
2963
|
+
var ReactIs = requireReactIs();
|
|
2964
|
+
var assign = requireObjectAssign();
|
|
2965
|
+
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
2966
|
+
var has = requireHas();
|
|
2967
|
+
var checkPropTypes = requireCheckPropTypes();
|
|
2968
|
+
var printWarning = function() {};
|
|
2969
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2970
|
+
printWarning = function(text) {
|
|
2971
|
+
var message = 'Warning: ' + text;
|
|
2972
|
+
if (typeof console !== 'undefined') {
|
|
2973
|
+
console.error(message);
|
|
2974
|
+
}
|
|
2975
|
+
try {
|
|
2976
|
+
throw new Error(message);
|
|
2977
|
+
} catch (x) {}
|
|
2978
|
+
};
|
|
2979
|
+
}
|
|
2980
|
+
function emptyFunctionThatReturnsNull() {
|
|
2981
|
+
return null;
|
|
2982
|
+
}
|
|
2983
|
+
factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
2984
|
+
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
2985
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
2986
|
+
function getIteratorFn(maybeIterable) {
|
|
2987
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
2988
|
+
if (typeof iteratorFn === 'function') {
|
|
2989
|
+
return iteratorFn;
|
|
2990
|
+
}
|
|
2991
|
+
}
|
|
2992
|
+
var ANONYMOUS = '<<anonymous>>';
|
|
2993
|
+
var ReactPropTypes = {
|
|
2994
|
+
array: createPrimitiveTypeChecker('array'),
|
|
2995
|
+
bigint: createPrimitiveTypeChecker('bigint'),
|
|
2996
|
+
bool: createPrimitiveTypeChecker('boolean'),
|
|
2997
|
+
func: createPrimitiveTypeChecker('function'),
|
|
2998
|
+
number: createPrimitiveTypeChecker('number'),
|
|
2999
|
+
object: createPrimitiveTypeChecker('object'),
|
|
3000
|
+
string: createPrimitiveTypeChecker('string'),
|
|
3001
|
+
symbol: createPrimitiveTypeChecker('symbol'),
|
|
3002
|
+
any: createAnyTypeChecker(),
|
|
3003
|
+
arrayOf: createArrayOfTypeChecker,
|
|
3004
|
+
element: createElementTypeChecker(),
|
|
3005
|
+
elementType: createElementTypeTypeChecker(),
|
|
3006
|
+
instanceOf: createInstanceTypeChecker,
|
|
3007
|
+
node: createNodeChecker(),
|
|
3008
|
+
objectOf: createObjectOfTypeChecker,
|
|
3009
|
+
oneOf: createEnumTypeChecker,
|
|
3010
|
+
oneOfType: createUnionTypeChecker,
|
|
3011
|
+
shape: createShapeTypeChecker,
|
|
3012
|
+
exact: createStrictShapeTypeChecker,
|
|
3013
|
+
};
|
|
3014
|
+
function is(x, y) {
|
|
3015
|
+
if (x === y) {
|
|
3016
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
3017
|
+
} else {
|
|
3018
|
+
return x !== x && y !== y;
|
|
3019
|
+
}
|
|
3020
|
+
}
|
|
3021
|
+
function PropTypeError(message, data) {
|
|
3022
|
+
this.message = message;
|
|
3023
|
+
this.data = data && typeof data === 'object' ? data: {};
|
|
3024
|
+
this.stack = '';
|
|
3025
|
+
}
|
|
3026
|
+
PropTypeError.prototype = Error.prototype;
|
|
3027
|
+
function createChainableTypeChecker(validate) {
|
|
3028
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3029
|
+
var manualPropTypeCallCache = {};
|
|
3030
|
+
var manualPropTypeWarningCount = 0;
|
|
3031
|
+
}
|
|
3032
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
3033
|
+
componentName = componentName || ANONYMOUS;
|
|
3034
|
+
propFullName = propFullName || propName;
|
|
3035
|
+
if (secret !== ReactPropTypesSecret) {
|
|
3036
|
+
if (throwOnDirectAccess) {
|
|
3037
|
+
var err = new Error(
|
|
3038
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
3039
|
+
'Use `PropTypes.checkPropTypes()` to call them. ' +
|
|
3040
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
3041
|
+
);
|
|
3042
|
+
err.name = 'Invariant Violation';
|
|
3043
|
+
throw err;
|
|
3044
|
+
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
|
3045
|
+
var cacheKey = componentName + ':' + propName;
|
|
3046
|
+
if (
|
|
3047
|
+
!manualPropTypeCallCache[cacheKey] &&
|
|
3048
|
+
manualPropTypeWarningCount < 3
|
|
3049
|
+
) {
|
|
3050
|
+
printWarning(
|
|
3051
|
+
'You are manually calling a React.PropTypes validation ' +
|
|
3052
|
+
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
3053
|
+
'and will throw in the standalone `prop-types` package. ' +
|
|
3054
|
+
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
3055
|
+
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
3056
|
+
);
|
|
3057
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
3058
|
+
manualPropTypeWarningCount++;
|
|
3059
|
+
}
|
|
3060
|
+
}
|
|
3061
|
+
}
|
|
3062
|
+
if (props[propName] == null) {
|
|
3063
|
+
if (isRequired) {
|
|
3064
|
+
if (props[propName] === null) {
|
|
3065
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
3066
|
+
}
|
|
3067
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
3068
|
+
}
|
|
3069
|
+
return null;
|
|
3070
|
+
} else {
|
|
3071
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
3072
|
+
}
|
|
3073
|
+
}
|
|
3074
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
3075
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
3076
|
+
return chainedCheckType;
|
|
3077
|
+
}
|
|
3078
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
3079
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
3080
|
+
var propValue = props[propName];
|
|
3081
|
+
var propType = getPropType(propValue);
|
|
3082
|
+
if (propType !== expectedType) {
|
|
3083
|
+
var preciseType = getPreciseType(propValue);
|
|
3084
|
+
return new PropTypeError(
|
|
3085
|
+
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
3086
|
+
{expectedType: expectedType}
|
|
3087
|
+
);
|
|
3088
|
+
}
|
|
3089
|
+
return null;
|
|
3090
|
+
}
|
|
3091
|
+
return createChainableTypeChecker(validate);
|
|
3092
|
+
}
|
|
3093
|
+
function createAnyTypeChecker() {
|
|
3094
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
3095
|
+
}
|
|
3096
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
3097
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
3098
|
+
if (typeof typeChecker !== 'function') {
|
|
3099
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
3100
|
+
}
|
|
3101
|
+
var propValue = props[propName];
|
|
3102
|
+
if (!Array.isArray(propValue)) {
|
|
3103
|
+
var propType = getPropType(propValue);
|
|
3104
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
3105
|
+
}
|
|
3106
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
3107
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
|
|
3108
|
+
if (error instanceof Error) {
|
|
3109
|
+
return error;
|
|
3110
|
+
}
|
|
3111
|
+
}
|
|
3112
|
+
return null;
|
|
3113
|
+
}
|
|
3114
|
+
return createChainableTypeChecker(validate);
|
|
3115
|
+
}
|
|
3116
|
+
function createElementTypeChecker() {
|
|
3117
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
3118
|
+
var propValue = props[propName];
|
|
3119
|
+
if (!isValidElement(propValue)) {
|
|
3120
|
+
var propType = getPropType(propValue);
|
|
3121
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
3122
|
+
}
|
|
3123
|
+
return null;
|
|
3124
|
+
}
|
|
3125
|
+
return createChainableTypeChecker(validate);
|
|
3126
|
+
}
|
|
3127
|
+
function createElementTypeTypeChecker() {
|
|
3128
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
3129
|
+
var propValue = props[propName];
|
|
3130
|
+
if (!ReactIs.isValidElementType(propValue)) {
|
|
3131
|
+
var propType = getPropType(propValue);
|
|
3132
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
3133
|
+
}
|
|
3134
|
+
return null;
|
|
3135
|
+
}
|
|
3136
|
+
return createChainableTypeChecker(validate);
|
|
3137
|
+
}
|
|
3138
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
3139
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
3140
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
3141
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
3142
|
+
var actualClassName = getClassName(props[propName]);
|
|
3143
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
3144
|
+
}
|
|
3145
|
+
return null;
|
|
3146
|
+
}
|
|
3147
|
+
return createChainableTypeChecker(validate);
|
|
3148
|
+
}
|
|
3149
|
+
function createEnumTypeChecker(expectedValues) {
|
|
3150
|
+
if (!Array.isArray(expectedValues)) {
|
|
3151
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3152
|
+
if (arguments.length > 1) {
|
|
3153
|
+
printWarning(
|
|
3154
|
+
'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
|
|
3155
|
+
'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
|
|
3156
|
+
);
|
|
3157
|
+
} else {
|
|
3158
|
+
printWarning('Invalid argument supplied to oneOf, expected an array.');
|
|
3159
|
+
}
|
|
3160
|
+
}
|
|
3161
|
+
return emptyFunctionThatReturnsNull;
|
|
3162
|
+
}
|
|
3163
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
3164
|
+
var propValue = props[propName];
|
|
3165
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
3166
|
+
if (is(propValue, expectedValues[i])) {
|
|
3167
|
+
return null;
|
|
3168
|
+
}
|
|
3169
|
+
}
|
|
3170
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
3171
|
+
var type = getPreciseType(value);
|
|
3172
|
+
if (type === 'symbol') {
|
|
3173
|
+
return String(value);
|
|
3174
|
+
}
|
|
3175
|
+
return value;
|
|
3176
|
+
});
|
|
3177
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
3178
|
+
}
|
|
3179
|
+
return createChainableTypeChecker(validate);
|
|
3180
|
+
}
|
|
3181
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
3182
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
3183
|
+
if (typeof typeChecker !== 'function') {
|
|
3184
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
3185
|
+
}
|
|
3186
|
+
var propValue = props[propName];
|
|
3187
|
+
var propType = getPropType(propValue);
|
|
3188
|
+
if (propType !== 'object') {
|
|
3189
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
3190
|
+
}
|
|
3191
|
+
for (var key in propValue) {
|
|
3192
|
+
if (has(propValue, key)) {
|
|
3193
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
3194
|
+
if (error instanceof Error) {
|
|
3195
|
+
return error;
|
|
3196
|
+
}
|
|
3197
|
+
}
|
|
3198
|
+
}
|
|
3199
|
+
return null;
|
|
3200
|
+
}
|
|
3201
|
+
return createChainableTypeChecker(validate);
|
|
3202
|
+
}
|
|
3203
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
3204
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
3205
|
+
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
3206
|
+
return emptyFunctionThatReturnsNull;
|
|
3207
|
+
}
|
|
3208
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
3209
|
+
var checker = arrayOfTypeCheckers[i];
|
|
3210
|
+
if (typeof checker !== 'function') {
|
|
3211
|
+
printWarning(
|
|
3212
|
+
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
|
3213
|
+
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
|
|
3214
|
+
);
|
|
3215
|
+
return emptyFunctionThatReturnsNull;
|
|
3216
|
+
}
|
|
3217
|
+
}
|
|
3218
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
3219
|
+
var expectedTypes = [];
|
|
3220
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
3221
|
+
var checker = arrayOfTypeCheckers[i];
|
|
3222
|
+
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
3223
|
+
if (checkerResult == null) {
|
|
3224
|
+
return null;
|
|
3225
|
+
}
|
|
3226
|
+
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
3227
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
3228
|
+
}
|
|
3229
|
+
}
|
|
3230
|
+
var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
|
|
3231
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
3232
|
+
}
|
|
3233
|
+
return createChainableTypeChecker(validate);
|
|
3234
|
+
}
|
|
3235
|
+
function createNodeChecker() {
|
|
3236
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
3237
|
+
if (!isNode(props[propName])) {
|
|
3238
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
3239
|
+
}
|
|
3240
|
+
return null;
|
|
3241
|
+
}
|
|
3242
|
+
return createChainableTypeChecker(validate);
|
|
3243
|
+
}
|
|
3244
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
3245
|
+
return new PropTypeError(
|
|
3246
|
+
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
3247
|
+
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
3248
|
+
);
|
|
3249
|
+
}
|
|
3250
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
3251
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
3252
|
+
var propValue = props[propName];
|
|
3253
|
+
var propType = getPropType(propValue);
|
|
3254
|
+
if (propType !== 'object') {
|
|
3255
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
3256
|
+
}
|
|
3257
|
+
for (var key in shapeTypes) {
|
|
3258
|
+
var checker = shapeTypes[key];
|
|
3259
|
+
if (typeof checker !== 'function') {
|
|
3260
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
3261
|
+
}
|
|
3262
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
3263
|
+
if (error) {
|
|
3264
|
+
return error;
|
|
3265
|
+
}
|
|
3266
|
+
}
|
|
3267
|
+
return null;
|
|
3268
|
+
}
|
|
3269
|
+
return createChainableTypeChecker(validate);
|
|
3270
|
+
}
|
|
3271
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
3272
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
3273
|
+
var propValue = props[propName];
|
|
3274
|
+
var propType = getPropType(propValue);
|
|
3275
|
+
if (propType !== 'object') {
|
|
3276
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
3277
|
+
}
|
|
3278
|
+
var allKeys = assign({}, props[propName], shapeTypes);
|
|
3279
|
+
for (var key in allKeys) {
|
|
3280
|
+
var checker = shapeTypes[key];
|
|
3281
|
+
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
3282
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
3283
|
+
}
|
|
3284
|
+
if (!checker) {
|
|
3285
|
+
return new PropTypeError(
|
|
3286
|
+
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
3287
|
+
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
3288
|
+
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
3289
|
+
);
|
|
3290
|
+
}
|
|
3291
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
3292
|
+
if (error) {
|
|
3293
|
+
return error;
|
|
3294
|
+
}
|
|
3295
|
+
}
|
|
3296
|
+
return null;
|
|
3297
|
+
}
|
|
3298
|
+
return createChainableTypeChecker(validate);
|
|
3299
|
+
}
|
|
3300
|
+
function isNode(propValue) {
|
|
3301
|
+
switch (typeof propValue) {
|
|
3302
|
+
case 'number':
|
|
3303
|
+
case 'string':
|
|
3304
|
+
case 'undefined':
|
|
3305
|
+
return true;
|
|
3306
|
+
case 'boolean':
|
|
3307
|
+
return !propValue;
|
|
3308
|
+
case 'object':
|
|
3309
|
+
if (Array.isArray(propValue)) {
|
|
3310
|
+
return propValue.every(isNode);
|
|
3311
|
+
}
|
|
3312
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
3313
|
+
return true;
|
|
3314
|
+
}
|
|
3315
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
3316
|
+
if (iteratorFn) {
|
|
3317
|
+
var iterator = iteratorFn.call(propValue);
|
|
3318
|
+
var step;
|
|
3319
|
+
if (iteratorFn !== propValue.entries) {
|
|
3320
|
+
while (!(step = iterator.next()).done) {
|
|
3321
|
+
if (!isNode(step.value)) {
|
|
3322
|
+
return false;
|
|
3323
|
+
}
|
|
3324
|
+
}
|
|
3325
|
+
} else {
|
|
3326
|
+
while (!(step = iterator.next()).done) {
|
|
3327
|
+
var entry = step.value;
|
|
3328
|
+
if (entry) {
|
|
3329
|
+
if (!isNode(entry[1])) {
|
|
3330
|
+
return false;
|
|
3331
|
+
}
|
|
3332
|
+
}
|
|
3333
|
+
}
|
|
3334
|
+
}
|
|
3335
|
+
} else {
|
|
3336
|
+
return false;
|
|
3337
|
+
}
|
|
3338
|
+
return true;
|
|
3339
|
+
default:
|
|
3340
|
+
return false;
|
|
3341
|
+
}
|
|
3342
|
+
}
|
|
3343
|
+
function isSymbol(propType, propValue) {
|
|
3344
|
+
if (propType === 'symbol') {
|
|
3345
|
+
return true;
|
|
3346
|
+
}
|
|
3347
|
+
if (!propValue) {
|
|
3348
|
+
return false;
|
|
3349
|
+
}
|
|
3350
|
+
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
3351
|
+
return true;
|
|
3352
|
+
}
|
|
3353
|
+
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
3354
|
+
return true;
|
|
3355
|
+
}
|
|
3356
|
+
return false;
|
|
3357
|
+
}
|
|
3358
|
+
function getPropType(propValue) {
|
|
3359
|
+
var propType = typeof propValue;
|
|
3360
|
+
if (Array.isArray(propValue)) {
|
|
3361
|
+
return 'array';
|
|
3362
|
+
}
|
|
3363
|
+
if (propValue instanceof RegExp) {
|
|
3364
|
+
return 'object';
|
|
3365
|
+
}
|
|
3366
|
+
if (isSymbol(propType, propValue)) {
|
|
3367
|
+
return 'symbol';
|
|
3368
|
+
}
|
|
3369
|
+
return propType;
|
|
3370
|
+
}
|
|
3371
|
+
function getPreciseType(propValue) {
|
|
3372
|
+
if (typeof propValue === 'undefined' || propValue === null) {
|
|
3373
|
+
return '' + propValue;
|
|
3374
|
+
}
|
|
3375
|
+
var propType = getPropType(propValue);
|
|
3376
|
+
if (propType === 'object') {
|
|
3377
|
+
if (propValue instanceof Date) {
|
|
3378
|
+
return 'date';
|
|
3379
|
+
} else if (propValue instanceof RegExp) {
|
|
3380
|
+
return 'regexp';
|
|
3381
|
+
}
|
|
3382
|
+
}
|
|
3383
|
+
return propType;
|
|
3384
|
+
}
|
|
3385
|
+
function getPostfixForTypeWarning(value) {
|
|
3386
|
+
var type = getPreciseType(value);
|
|
3387
|
+
switch (type) {
|
|
3388
|
+
case 'array':
|
|
3389
|
+
case 'object':
|
|
3390
|
+
return 'an ' + type;
|
|
3391
|
+
case 'boolean':
|
|
3392
|
+
case 'date':
|
|
3393
|
+
case 'regexp':
|
|
3394
|
+
return 'a ' + type;
|
|
3395
|
+
default:
|
|
3396
|
+
return type;
|
|
3397
|
+
}
|
|
3398
|
+
}
|
|
3399
|
+
function getClassName(propValue) {
|
|
3400
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
3401
|
+
return ANONYMOUS;
|
|
3402
|
+
}
|
|
3403
|
+
return propValue.constructor.name;
|
|
3404
|
+
}
|
|
3405
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
3406
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
3407
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
3408
|
+
return ReactPropTypes;
|
|
3409
|
+
};
|
|
3410
|
+
return factoryWithTypeCheckers;
|
|
3411
|
+
}
|
|
3412
|
+
|
|
3413
|
+
var factoryWithThrowingShims;
|
|
3414
|
+
var hasRequiredFactoryWithThrowingShims;
|
|
3415
|
+
function requireFactoryWithThrowingShims () {
|
|
3416
|
+
if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
|
|
3417
|
+
hasRequiredFactoryWithThrowingShims = 1;
|
|
3418
|
+
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
3419
|
+
function emptyFunction() {}
|
|
3420
|
+
function emptyFunctionWithReset() {}
|
|
3421
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
3422
|
+
factoryWithThrowingShims = function() {
|
|
3423
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
3424
|
+
if (secret === ReactPropTypesSecret) {
|
|
3425
|
+
return;
|
|
3426
|
+
}
|
|
3427
|
+
var err = new Error(
|
|
3428
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
3429
|
+
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
3430
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
3431
|
+
);
|
|
3432
|
+
err.name = 'Invariant Violation';
|
|
3433
|
+
throw err;
|
|
3434
|
+
} shim.isRequired = shim;
|
|
3435
|
+
function getShim() {
|
|
3436
|
+
return shim;
|
|
3437
|
+
} var ReactPropTypes = {
|
|
3438
|
+
array: shim,
|
|
3439
|
+
bigint: shim,
|
|
3440
|
+
bool: shim,
|
|
3441
|
+
func: shim,
|
|
3442
|
+
number: shim,
|
|
3443
|
+
object: shim,
|
|
3444
|
+
string: shim,
|
|
3445
|
+
symbol: shim,
|
|
3446
|
+
any: shim,
|
|
3447
|
+
arrayOf: getShim,
|
|
3448
|
+
element: shim,
|
|
3449
|
+
elementType: shim,
|
|
3450
|
+
instanceOf: getShim,
|
|
3451
|
+
node: shim,
|
|
3452
|
+
objectOf: getShim,
|
|
3453
|
+
oneOf: getShim,
|
|
3454
|
+
oneOfType: getShim,
|
|
3455
|
+
shape: getShim,
|
|
3456
|
+
exact: getShim,
|
|
3457
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
3458
|
+
resetWarningCache: emptyFunction
|
|
3459
|
+
};
|
|
3460
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
3461
|
+
return ReactPropTypes;
|
|
3462
|
+
};
|
|
3463
|
+
return factoryWithThrowingShims;
|
|
3464
|
+
}
|
|
3465
|
+
|
|
3466
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3467
|
+
var ReactIs = requireReactIs();
|
|
3468
|
+
var throwOnDirectAccess = true;
|
|
3469
|
+
propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
3470
|
+
} else {
|
|
3471
|
+
propTypes.exports = requireFactoryWithThrowingShims()();
|
|
3472
|
+
}
|
|
3473
|
+
var propTypesExports = propTypes.exports;
|
|
3474
|
+
var PropTypes = getDefaultExportFromCjs(propTypesExports);
|
|
3475
|
+
|
|
3476
|
+
var COMMON_MIME_TYPES = new Map([
|
|
3477
|
+
['aac', 'audio/aac'],
|
|
3478
|
+
['abw', 'application/x-abiword'],
|
|
3479
|
+
['arc', 'application/x-freearc'],
|
|
3480
|
+
['avif', 'image/avif'],
|
|
3481
|
+
['avi', 'video/x-msvideo'],
|
|
3482
|
+
['azw', 'application/vnd.amazon.ebook'],
|
|
3483
|
+
['bin', 'application/octet-stream'],
|
|
3484
|
+
['bmp', 'image/bmp'],
|
|
3485
|
+
['bz', 'application/x-bzip'],
|
|
3486
|
+
['bz2', 'application/x-bzip2'],
|
|
3487
|
+
['cda', 'application/x-cdf'],
|
|
3488
|
+
['csh', 'application/x-csh'],
|
|
3489
|
+
['css', 'text/css'],
|
|
3490
|
+
['csv', 'text/csv'],
|
|
3491
|
+
['doc', 'application/msword'],
|
|
3492
|
+
['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],
|
|
3493
|
+
['eot', 'application/vnd.ms-fontobject'],
|
|
3494
|
+
['epub', 'application/epub+zip'],
|
|
3495
|
+
['gz', 'application/gzip'],
|
|
3496
|
+
['gif', 'image/gif'],
|
|
3497
|
+
['heic', 'image/heic'],
|
|
3498
|
+
['heif', 'image/heif'],
|
|
3499
|
+
['htm', 'text/html'],
|
|
3500
|
+
['html', 'text/html'],
|
|
3501
|
+
['ico', 'image/vnd.microsoft.icon'],
|
|
3502
|
+
['ics', 'text/calendar'],
|
|
3503
|
+
['jar', 'application/java-archive'],
|
|
3504
|
+
['jpeg', 'image/jpeg'],
|
|
3505
|
+
['jpg', 'image/jpeg'],
|
|
3506
|
+
['js', 'text/javascript'],
|
|
3507
|
+
['json', 'application/json'],
|
|
3508
|
+
['jsonld', 'application/ld+json'],
|
|
3509
|
+
['mid', 'audio/midi'],
|
|
3510
|
+
['midi', 'audio/midi'],
|
|
3511
|
+
['mjs', 'text/javascript'],
|
|
3512
|
+
['mp3', 'audio/mpeg'],
|
|
3513
|
+
['mp4', 'video/mp4'],
|
|
3514
|
+
['mpeg', 'video/mpeg'],
|
|
3515
|
+
['mpkg', 'application/vnd.apple.installer+xml'],
|
|
3516
|
+
['odp', 'application/vnd.oasis.opendocument.presentation'],
|
|
3517
|
+
['ods', 'application/vnd.oasis.opendocument.spreadsheet'],
|
|
3518
|
+
['odt', 'application/vnd.oasis.opendocument.text'],
|
|
3519
|
+
['oga', 'audio/ogg'],
|
|
3520
|
+
['ogv', 'video/ogg'],
|
|
3521
|
+
['ogx', 'application/ogg'],
|
|
3522
|
+
['opus', 'audio/opus'],
|
|
3523
|
+
['otf', 'font/otf'],
|
|
3524
|
+
['png', 'image/png'],
|
|
3525
|
+
['pdf', 'application/pdf'],
|
|
3526
|
+
['php', 'application/x-httpd-php'],
|
|
3527
|
+
['ppt', 'application/vnd.ms-powerpoint'],
|
|
3528
|
+
['pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'],
|
|
3529
|
+
['rar', 'application/vnd.rar'],
|
|
3530
|
+
['rtf', 'application/rtf'],
|
|
3531
|
+
['sh', 'application/x-sh'],
|
|
3532
|
+
['svg', 'image/svg+xml'],
|
|
3533
|
+
['swf', 'application/x-shockwave-flash'],
|
|
3534
|
+
['tar', 'application/x-tar'],
|
|
3535
|
+
['tif', 'image/tiff'],
|
|
3536
|
+
['tiff', 'image/tiff'],
|
|
3537
|
+
['ts', 'video/mp2t'],
|
|
3538
|
+
['ttf', 'font/ttf'],
|
|
3539
|
+
['txt', 'text/plain'],
|
|
3540
|
+
['vsd', 'application/vnd.visio'],
|
|
3541
|
+
['wav', 'audio/wav'],
|
|
3542
|
+
['weba', 'audio/webm'],
|
|
3543
|
+
['webm', 'video/webm'],
|
|
3544
|
+
['webp', 'image/webp'],
|
|
3545
|
+
['woff', 'font/woff'],
|
|
3546
|
+
['woff2', 'font/woff2'],
|
|
3547
|
+
['xhtml', 'application/xhtml+xml'],
|
|
3548
|
+
['xls', 'application/vnd.ms-excel'],
|
|
3549
|
+
['xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],
|
|
3550
|
+
['xml', 'application/xml'],
|
|
3551
|
+
['xul', 'application/vnd.mozilla.xul+xml'],
|
|
3552
|
+
['zip', 'application/zip'],
|
|
3553
|
+
['7z', 'application/x-7z-compressed'],
|
|
3554
|
+
['mkv', 'video/x-matroska'],
|
|
3555
|
+
['mov', 'video/quicktime'],
|
|
3556
|
+
['msg', 'application/vnd.ms-outlook']
|
|
3557
|
+
]);
|
|
3558
|
+
function toFileWithPath(file, path) {
|
|
3559
|
+
var f = withMimeType(file);
|
|
3560
|
+
if (typeof f.path !== 'string') {
|
|
3561
|
+
var webkitRelativePath = file.webkitRelativePath;
|
|
3562
|
+
Object.defineProperty(f, 'path', {
|
|
3563
|
+
value: typeof path === 'string'
|
|
3564
|
+
? path
|
|
3565
|
+
: typeof webkitRelativePath === 'string' && webkitRelativePath.length > 0
|
|
3566
|
+
? webkitRelativePath
|
|
3567
|
+
: file.name,
|
|
3568
|
+
writable: false,
|
|
3569
|
+
configurable: false,
|
|
3570
|
+
enumerable: true
|
|
3571
|
+
});
|
|
3572
|
+
}
|
|
3573
|
+
return f;
|
|
3574
|
+
}
|
|
3575
|
+
function withMimeType(file) {
|
|
3576
|
+
var name = file.name;
|
|
3577
|
+
var hasExtension = name && name.lastIndexOf('.') !== -1;
|
|
3578
|
+
if (hasExtension && !file.type) {
|
|
3579
|
+
var ext = name.split('.')
|
|
3580
|
+
.pop().toLowerCase();
|
|
3581
|
+
var type = COMMON_MIME_TYPES.get(ext);
|
|
3582
|
+
if (type) {
|
|
3583
|
+
Object.defineProperty(file, 'type', {
|
|
3584
|
+
value: type,
|
|
3585
|
+
writable: false,
|
|
3586
|
+
configurable: false,
|
|
3587
|
+
enumerable: true
|
|
3588
|
+
});
|
|
3589
|
+
}
|
|
3590
|
+
}
|
|
3591
|
+
return file;
|
|
3592
|
+
}
|
|
3593
|
+
|
|
3594
|
+
var FILES_TO_IGNORE = [
|
|
3595
|
+
'.DS_Store',
|
|
3596
|
+
'Thumbs.db'
|
|
3597
|
+
];
|
|
3598
|
+
function fromEvent(evt) {
|
|
3599
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3600
|
+
return __generator(this, function (_a) {
|
|
3601
|
+
if (isObject(evt) && isDataTransfer(evt.dataTransfer)) {
|
|
3602
|
+
return [2 , getDataTransferFiles(evt.dataTransfer, evt.type)];
|
|
3603
|
+
}
|
|
3604
|
+
else if (isChangeEvt(evt)) {
|
|
3605
|
+
return [2 , getInputFiles(evt)];
|
|
3606
|
+
}
|
|
3607
|
+
else if (Array.isArray(evt) && evt.every(function (item) { return 'getFile' in item && typeof item.getFile === 'function'; })) {
|
|
3608
|
+
return [2 , getFsHandleFiles(evt)];
|
|
3609
|
+
}
|
|
3610
|
+
return [2 , []];
|
|
3611
|
+
});
|
|
3612
|
+
});
|
|
3613
|
+
}
|
|
3614
|
+
function isDataTransfer(value) {
|
|
3615
|
+
return isObject(value);
|
|
3616
|
+
}
|
|
3617
|
+
function isChangeEvt(value) {
|
|
3618
|
+
return isObject(value) && isObject(value.target);
|
|
3619
|
+
}
|
|
3620
|
+
function isObject(v) {
|
|
3621
|
+
return typeof v === 'object' && v !== null;
|
|
3622
|
+
}
|
|
3623
|
+
function getInputFiles(evt) {
|
|
3624
|
+
return fromList(evt.target.files).map(function (file) { return toFileWithPath(file); });
|
|
3625
|
+
}
|
|
3626
|
+
function getFsHandleFiles(handles) {
|
|
3627
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3628
|
+
var files;
|
|
3629
|
+
return __generator(this, function (_a) {
|
|
3630
|
+
switch (_a.label) {
|
|
3631
|
+
case 0: return [4 , Promise.all(handles.map(function (h) { return h.getFile(); }))];
|
|
3632
|
+
case 1:
|
|
3633
|
+
files = _a.sent();
|
|
3634
|
+
return [2 , files.map(function (file) { return toFileWithPath(file); })];
|
|
3635
|
+
}
|
|
3636
|
+
});
|
|
3637
|
+
});
|
|
3638
|
+
}
|
|
3639
|
+
function getDataTransferFiles(dt, type) {
|
|
3640
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3641
|
+
var items, files;
|
|
3642
|
+
return __generator(this, function (_a) {
|
|
3643
|
+
switch (_a.label) {
|
|
3644
|
+
case 0:
|
|
3645
|
+
if (!dt.items) return [3 , 2];
|
|
3646
|
+
items = fromList(dt.items)
|
|
3647
|
+
.filter(function (item) { return item.kind === 'file'; });
|
|
3648
|
+
if (type !== 'drop') {
|
|
3649
|
+
return [2 , items];
|
|
3650
|
+
}
|
|
3651
|
+
return [4 , Promise.all(items.map(toFilePromises))];
|
|
3652
|
+
case 1:
|
|
3653
|
+
files = _a.sent();
|
|
3654
|
+
return [2 , noIgnoredFiles(flatten(files))];
|
|
3655
|
+
case 2: return [2 , noIgnoredFiles(fromList(dt.files)
|
|
3656
|
+
.map(function (file) { return toFileWithPath(file); }))];
|
|
3657
|
+
}
|
|
3658
|
+
});
|
|
3659
|
+
});
|
|
3660
|
+
}
|
|
3661
|
+
function noIgnoredFiles(files) {
|
|
3662
|
+
return files.filter(function (file) { return FILES_TO_IGNORE.indexOf(file.name) === -1; });
|
|
3663
|
+
}
|
|
3664
|
+
function fromList(items) {
|
|
3665
|
+
if (items === null) {
|
|
3666
|
+
return [];
|
|
3667
|
+
}
|
|
3668
|
+
var files = [];
|
|
3669
|
+
for (var i = 0; i < items.length; i++) {
|
|
3670
|
+
var file = items[i];
|
|
3671
|
+
files.push(file);
|
|
3672
|
+
}
|
|
3673
|
+
return files;
|
|
3674
|
+
}
|
|
3675
|
+
function toFilePromises(item) {
|
|
3676
|
+
if (typeof item.webkitGetAsEntry !== 'function') {
|
|
3677
|
+
return fromDataTransferItem(item);
|
|
3678
|
+
}
|
|
3679
|
+
var entry = item.webkitGetAsEntry();
|
|
3680
|
+
if (entry && entry.isDirectory) {
|
|
3681
|
+
return fromDirEntry(entry);
|
|
3682
|
+
}
|
|
3683
|
+
return fromDataTransferItem(item);
|
|
3684
|
+
}
|
|
3685
|
+
function flatten(items) {
|
|
3686
|
+
return items.reduce(function (acc, files) { return __spreadArray(__spreadArray([], __read(acc), false), __read((Array.isArray(files) ? flatten(files) : [files])), false); }, []);
|
|
3687
|
+
}
|
|
3688
|
+
function fromDataTransferItem(item) {
|
|
3689
|
+
var file = item.getAsFile();
|
|
3690
|
+
if (!file) {
|
|
3691
|
+
return Promise.reject("".concat(item, " is not a File"));
|
|
3692
|
+
}
|
|
3693
|
+
var fwp = toFileWithPath(file);
|
|
3694
|
+
return Promise.resolve(fwp);
|
|
3695
|
+
}
|
|
3696
|
+
function fromEntry(entry) {
|
|
3697
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3698
|
+
return __generator(this, function (_a) {
|
|
3699
|
+
return [2 , entry.isDirectory ? fromDirEntry(entry) : fromFileEntry(entry)];
|
|
3700
|
+
});
|
|
3701
|
+
});
|
|
3702
|
+
}
|
|
3703
|
+
function fromDirEntry(entry) {
|
|
3704
|
+
var reader = entry.createReader();
|
|
3705
|
+
return new Promise(function (resolve, reject) {
|
|
3706
|
+
var entries = [];
|
|
3707
|
+
function readEntries() {
|
|
3708
|
+
var _this = this;
|
|
3709
|
+
reader.readEntries(function (batch) { return __awaiter(_this, void 0, void 0, function () {
|
|
3710
|
+
var files, err_1, items;
|
|
3711
|
+
return __generator(this, function (_a) {
|
|
3712
|
+
switch (_a.label) {
|
|
3713
|
+
case 0:
|
|
3714
|
+
if (!!batch.length) return [3 , 5];
|
|
3715
|
+
_a.label = 1;
|
|
3716
|
+
case 1:
|
|
3717
|
+
_a.trys.push([1, 3, , 4]);
|
|
3718
|
+
return [4 , Promise.all(entries)];
|
|
3719
|
+
case 2:
|
|
3720
|
+
files = _a.sent();
|
|
3721
|
+
resolve(files);
|
|
3722
|
+
return [3 , 4];
|
|
3723
|
+
case 3:
|
|
3724
|
+
err_1 = _a.sent();
|
|
3725
|
+
reject(err_1);
|
|
3726
|
+
return [3 , 4];
|
|
3727
|
+
case 4: return [3 , 6];
|
|
3728
|
+
case 5:
|
|
3729
|
+
items = Promise.all(batch.map(fromEntry));
|
|
3730
|
+
entries.push(items);
|
|
3731
|
+
readEntries();
|
|
3732
|
+
_a.label = 6;
|
|
3733
|
+
case 6: return [2 ];
|
|
3734
|
+
}
|
|
3735
|
+
});
|
|
3736
|
+
}); }, function (err) {
|
|
3737
|
+
reject(err);
|
|
3738
|
+
});
|
|
3739
|
+
}
|
|
3740
|
+
readEntries();
|
|
3741
|
+
});
|
|
3742
|
+
}
|
|
3743
|
+
function fromFileEntry(entry) {
|
|
3744
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3745
|
+
return __generator(this, function (_a) {
|
|
3746
|
+
return [2 , new Promise(function (resolve, reject) {
|
|
3747
|
+
entry.file(function (file) {
|
|
3748
|
+
var fwp = toFileWithPath(file, entry.fullPath);
|
|
3749
|
+
resolve(fwp);
|
|
3750
|
+
}, function (err) {
|
|
3751
|
+
reject(err);
|
|
3752
|
+
});
|
|
3753
|
+
})];
|
|
3754
|
+
});
|
|
3755
|
+
});
|
|
3756
|
+
}
|
|
3757
|
+
|
|
3758
|
+
var _default = function (file, acceptedFiles) {
|
|
3759
|
+
if (file && acceptedFiles) {
|
|
3760
|
+
var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(',');
|
|
3761
|
+
var fileName = file.name || '';
|
|
3762
|
+
var mimeType = (file.type || '').toLowerCase();
|
|
3763
|
+
var baseMimeType = mimeType.replace(/\/.*$/, '');
|
|
3764
|
+
return acceptedFilesArray.some(function (type) {
|
|
3765
|
+
var validType = type.trim().toLowerCase();
|
|
3766
|
+
if (validType.charAt(0) === '.') {
|
|
3767
|
+
return fileName.toLowerCase().endsWith(validType);
|
|
3768
|
+
} else if (validType.endsWith('/*')) {
|
|
3769
|
+
return baseMimeType === validType.replace(/\/.*$/, '');
|
|
3770
|
+
}
|
|
3771
|
+
return mimeType === validType;
|
|
3772
|
+
});
|
|
3773
|
+
}
|
|
3774
|
+
return true;
|
|
3775
|
+
};
|
|
3776
|
+
|
|
3777
|
+
function _toConsumableArray$1(arr) { return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread$1(); }
|
|
3778
|
+
function _nonIterableSpread$1() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3779
|
+
function _iterableToArray$1(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
3780
|
+
function _arrayWithoutHoles$1(arr) { if (Array.isArray(arr)) return _arrayLikeToArray$1(arr); }
|
|
3781
|
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3782
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3783
|
+
function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3784
|
+
function _slicedToArray$1(arr, i) { return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest$1(); }
|
|
3785
|
+
function _nonIterableRest$1() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3786
|
+
function _unsupportedIterableToArray$1(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
|
|
3787
|
+
function _arrayLikeToArray$1(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
3788
|
+
function _iterableToArrayLimit$1(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
3789
|
+
function _arrayWithHoles$1(arr) { if (Array.isArray(arr)) return arr; }
|
|
3790
|
+
var FILE_INVALID_TYPE = "file-invalid-type";
|
|
3791
|
+
var FILE_TOO_LARGE = "file-too-large";
|
|
3792
|
+
var FILE_TOO_SMALL = "file-too-small";
|
|
3793
|
+
var TOO_MANY_FILES = "too-many-files";
|
|
3794
|
+
var getInvalidTypeRejectionErr = function getInvalidTypeRejectionErr(accept) {
|
|
3795
|
+
accept = Array.isArray(accept) && accept.length === 1 ? accept[0] : accept;
|
|
3796
|
+
var messageSuffix = Array.isArray(accept) ? "one of ".concat(accept.join(", ")) : accept;
|
|
3797
|
+
return {
|
|
3798
|
+
code: FILE_INVALID_TYPE,
|
|
3799
|
+
message: "File type must be ".concat(messageSuffix)
|
|
3800
|
+
};
|
|
3801
|
+
};
|
|
3802
|
+
var getTooLargeRejectionErr = function getTooLargeRejectionErr(maxSize) {
|
|
3803
|
+
return {
|
|
3804
|
+
code: FILE_TOO_LARGE,
|
|
3805
|
+
message: "File is larger than ".concat(maxSize, " ").concat(maxSize === 1 ? "byte" : "bytes")
|
|
3806
|
+
};
|
|
3807
|
+
};
|
|
3808
|
+
var getTooSmallRejectionErr = function getTooSmallRejectionErr(minSize) {
|
|
3809
|
+
return {
|
|
3810
|
+
code: FILE_TOO_SMALL,
|
|
3811
|
+
message: "File is smaller than ".concat(minSize, " ").concat(minSize === 1 ? "byte" : "bytes")
|
|
3812
|
+
};
|
|
3813
|
+
};
|
|
3814
|
+
var TOO_MANY_FILES_REJECTION = {
|
|
3815
|
+
code: TOO_MANY_FILES,
|
|
3816
|
+
message: "Too many files"
|
|
3817
|
+
};
|
|
3818
|
+
function fileAccepted(file, accept) {
|
|
3819
|
+
var isAcceptable = file.type === "application/x-moz-file" || _default(file, accept);
|
|
3820
|
+
return [isAcceptable, isAcceptable ? null : getInvalidTypeRejectionErr(accept)];
|
|
3821
|
+
}
|
|
3822
|
+
function fileMatchSize(file, minSize, maxSize) {
|
|
3823
|
+
if (isDefined(file.size)) {
|
|
3824
|
+
if (isDefined(minSize) && isDefined(maxSize)) {
|
|
3825
|
+
if (file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];
|
|
3826
|
+
if (file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];
|
|
3827
|
+
} else if (isDefined(minSize) && file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];else if (isDefined(maxSize) && file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];
|
|
3828
|
+
}
|
|
3829
|
+
return [true, null];
|
|
3830
|
+
}
|
|
3831
|
+
function isDefined(value) {
|
|
3832
|
+
return value !== undefined && value !== null;
|
|
3833
|
+
}
|
|
3834
|
+
function allFilesAccepted(_ref) {
|
|
3835
|
+
var files = _ref.files,
|
|
3836
|
+
accept = _ref.accept,
|
|
3837
|
+
minSize = _ref.minSize,
|
|
3838
|
+
maxSize = _ref.maxSize,
|
|
3839
|
+
multiple = _ref.multiple,
|
|
3840
|
+
maxFiles = _ref.maxFiles,
|
|
3841
|
+
validator = _ref.validator;
|
|
3842
|
+
if (!multiple && files.length > 1 || multiple && maxFiles >= 1 && files.length > maxFiles) {
|
|
3843
|
+
return false;
|
|
3844
|
+
}
|
|
3845
|
+
return files.every(function (file) {
|
|
3846
|
+
var _fileAccepted = fileAccepted(file, accept),
|
|
3847
|
+
_fileAccepted2 = _slicedToArray$1(_fileAccepted, 1),
|
|
3848
|
+
accepted = _fileAccepted2[0];
|
|
3849
|
+
var _fileMatchSize = fileMatchSize(file, minSize, maxSize),
|
|
3850
|
+
_fileMatchSize2 = _slicedToArray$1(_fileMatchSize, 1),
|
|
3851
|
+
sizeMatch = _fileMatchSize2[0];
|
|
3852
|
+
var customErrors = validator ? validator(file) : null;
|
|
3853
|
+
return accepted && sizeMatch && !customErrors;
|
|
3854
|
+
});
|
|
3855
|
+
}
|
|
3856
|
+
function isPropagationStopped(event) {
|
|
3857
|
+
if (typeof event.isPropagationStopped === "function") {
|
|
3858
|
+
return event.isPropagationStopped();
|
|
3859
|
+
} else if (typeof event.cancelBubble !== "undefined") {
|
|
3860
|
+
return event.cancelBubble;
|
|
3861
|
+
}
|
|
3862
|
+
return false;
|
|
3863
|
+
}
|
|
3864
|
+
function isEvtWithFiles(event) {
|
|
3865
|
+
if (!event.dataTransfer) {
|
|
3866
|
+
return !!event.target && !!event.target.files;
|
|
3867
|
+
}
|
|
3868
|
+
return Array.prototype.some.call(event.dataTransfer.types, function (type) {
|
|
3869
|
+
return type === "Files" || type === "application/x-moz-file";
|
|
3870
|
+
});
|
|
3871
|
+
}
|
|
3872
|
+
function onDocumentDragOver(event) {
|
|
3873
|
+
event.preventDefault();
|
|
3874
|
+
}
|
|
3875
|
+
function isIe(userAgent) {
|
|
3876
|
+
return userAgent.indexOf("MSIE") !== -1 || userAgent.indexOf("Trident/") !== -1;
|
|
3877
|
+
}
|
|
3878
|
+
function isEdge(userAgent) {
|
|
3879
|
+
return userAgent.indexOf("Edge/") !== -1;
|
|
3880
|
+
}
|
|
3881
|
+
function isIeOrEdge() {
|
|
3882
|
+
var userAgent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.navigator.userAgent;
|
|
3883
|
+
return isIe(userAgent) || isEdge(userAgent);
|
|
3884
|
+
}
|
|
3885
|
+
function composeEventHandlers() {
|
|
3886
|
+
for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3887
|
+
fns[_key] = arguments[_key];
|
|
3888
|
+
}
|
|
3889
|
+
return function (event) {
|
|
3890
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
3891
|
+
args[_key2 - 1] = arguments[_key2];
|
|
3892
|
+
}
|
|
3893
|
+
return fns.some(function (fn) {
|
|
3894
|
+
if (!isPropagationStopped(event) && fn) {
|
|
3895
|
+
fn.apply(void 0, [event].concat(args));
|
|
3896
|
+
}
|
|
3897
|
+
return isPropagationStopped(event);
|
|
3898
|
+
});
|
|
3899
|
+
};
|
|
3900
|
+
}
|
|
3901
|
+
function canUseFileSystemAccessAPI() {
|
|
3902
|
+
return "showOpenFilePicker" in window;
|
|
3903
|
+
}
|
|
3904
|
+
function pickerOptionsFromAccept(accept) {
|
|
3905
|
+
if (isDefined(accept)) {
|
|
3906
|
+
var acceptForPicker = Object.entries(accept).filter(function (_ref2) {
|
|
3907
|
+
var _ref3 = _slicedToArray$1(_ref2, 2),
|
|
3908
|
+
mimeType = _ref3[0],
|
|
3909
|
+
ext = _ref3[1];
|
|
3910
|
+
var ok = true;
|
|
3911
|
+
if (!isMIMEType(mimeType)) {
|
|
3912
|
+
console.warn("Skipped \"".concat(mimeType, "\" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types."));
|
|
3913
|
+
ok = false;
|
|
3914
|
+
}
|
|
3915
|
+
if (!Array.isArray(ext) || !ext.every(isExt)) {
|
|
3916
|
+
console.warn("Skipped \"".concat(mimeType, "\" because an invalid file extension was provided."));
|
|
3917
|
+
ok = false;
|
|
3918
|
+
}
|
|
3919
|
+
return ok;
|
|
3920
|
+
}).reduce(function (agg, _ref4) {
|
|
3921
|
+
var _ref5 = _slicedToArray$1(_ref4, 2),
|
|
3922
|
+
mimeType = _ref5[0],
|
|
3923
|
+
ext = _ref5[1];
|
|
3924
|
+
return _objectSpread$1(_objectSpread$1({}, agg), {}, _defineProperty$1({}, mimeType, ext));
|
|
3925
|
+
}, {});
|
|
3926
|
+
return [{
|
|
3927
|
+
description: "Files",
|
|
3928
|
+
accept: acceptForPicker
|
|
3929
|
+
}];
|
|
3930
|
+
}
|
|
3931
|
+
return accept;
|
|
3932
|
+
}
|
|
3933
|
+
function acceptPropAsAcceptAttr(accept) {
|
|
3934
|
+
if (isDefined(accept)) {
|
|
3935
|
+
return Object.entries(accept).reduce(function (a, _ref6) {
|
|
3936
|
+
var _ref7 = _slicedToArray$1(_ref6, 2),
|
|
3937
|
+
mimeType = _ref7[0],
|
|
3938
|
+
ext = _ref7[1];
|
|
3939
|
+
return [].concat(_toConsumableArray$1(a), [mimeType], _toConsumableArray$1(ext));
|
|
3940
|
+
}, [])
|
|
3941
|
+
.filter(function (v) {
|
|
3942
|
+
return isMIMEType(v) || isExt(v);
|
|
3943
|
+
}).join(",");
|
|
3944
|
+
}
|
|
3945
|
+
return undefined;
|
|
3946
|
+
}
|
|
3947
|
+
function isAbort(v) {
|
|
3948
|
+
return v instanceof DOMException && (v.name === "AbortError" || v.code === v.ABORT_ERR);
|
|
3949
|
+
}
|
|
3950
|
+
function isSecurityError(v) {
|
|
3951
|
+
return v instanceof DOMException && (v.name === "SecurityError" || v.code === v.SECURITY_ERR);
|
|
3952
|
+
}
|
|
3953
|
+
function isMIMEType(v) {
|
|
3954
|
+
return v === "audio/*" || v === "video/*" || v === "image/*" || v === "text/*" || /\w+\/[-+.\w]+/g.test(v);
|
|
3955
|
+
}
|
|
3956
|
+
function isExt(v) {
|
|
3957
|
+
return /^.*\.[\w]+$/.test(v);
|
|
3958
|
+
}
|
|
3959
|
+
|
|
3960
|
+
var _excluded = ["children"],
|
|
3961
|
+
_excluded2 = ["open"],
|
|
3962
|
+
_excluded3 = ["refKey", "role", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"],
|
|
3963
|
+
_excluded4 = ["refKey", "onChange", "onClick"];
|
|
3964
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3965
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3966
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
3967
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
3968
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3969
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3970
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
3971
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
3972
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
3973
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
3974
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3975
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3976
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3977
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
3978
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
3979
|
+
var Dropzone = React.forwardRef(function (_ref, ref) {
|
|
3980
|
+
var children = _ref.children,
|
|
3981
|
+
params = _objectWithoutProperties(_ref, _excluded);
|
|
3982
|
+
var _useDropzone = useDropzone(params),
|
|
3983
|
+
open = _useDropzone.open,
|
|
3984
|
+
props = _objectWithoutProperties(_useDropzone, _excluded2);
|
|
3985
|
+
React.useImperativeHandle(ref, function () {
|
|
3986
|
+
return {
|
|
3987
|
+
open: open
|
|
3988
|
+
};
|
|
3989
|
+
}, [open]);
|
|
3990
|
+
return React.createElement(React.Fragment, null, children(_objectSpread(_objectSpread({}, props), {}, {
|
|
3991
|
+
open: open
|
|
3992
|
+
})));
|
|
3993
|
+
});
|
|
3994
|
+
Dropzone.displayName = "Dropzone";
|
|
3995
|
+
var defaultProps = {
|
|
3996
|
+
disabled: false,
|
|
3997
|
+
getFilesFromEvent: fromEvent,
|
|
3998
|
+
maxSize: Infinity,
|
|
3999
|
+
minSize: 0,
|
|
4000
|
+
multiple: true,
|
|
4001
|
+
maxFiles: 0,
|
|
4002
|
+
preventDropOnDocument: true,
|
|
4003
|
+
noClick: false,
|
|
4004
|
+
noKeyboard: false,
|
|
4005
|
+
noDrag: false,
|
|
4006
|
+
noDragEventsBubbling: false,
|
|
4007
|
+
validator: null,
|
|
4008
|
+
useFsAccessApi: true,
|
|
4009
|
+
autoFocus: false
|
|
4010
|
+
};
|
|
4011
|
+
Dropzone.defaultProps = defaultProps;
|
|
4012
|
+
Dropzone.propTypes = {
|
|
4013
|
+
children: PropTypes.func,
|
|
4014
|
+
accept: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)),
|
|
4015
|
+
multiple: PropTypes.bool,
|
|
4016
|
+
preventDropOnDocument: PropTypes.bool,
|
|
4017
|
+
noClick: PropTypes.bool,
|
|
4018
|
+
noKeyboard: PropTypes.bool,
|
|
4019
|
+
noDrag: PropTypes.bool,
|
|
4020
|
+
noDragEventsBubbling: PropTypes.bool,
|
|
4021
|
+
minSize: PropTypes.number,
|
|
4022
|
+
maxSize: PropTypes.number,
|
|
4023
|
+
maxFiles: PropTypes.number,
|
|
4024
|
+
disabled: PropTypes.bool,
|
|
4025
|
+
getFilesFromEvent: PropTypes.func,
|
|
4026
|
+
onFileDialogCancel: PropTypes.func,
|
|
4027
|
+
onFileDialogOpen: PropTypes.func,
|
|
4028
|
+
useFsAccessApi: PropTypes.bool,
|
|
4029
|
+
autoFocus: PropTypes.bool,
|
|
4030
|
+
onDragEnter: PropTypes.func,
|
|
4031
|
+
onDragLeave: PropTypes.func,
|
|
4032
|
+
onDragOver: PropTypes.func,
|
|
4033
|
+
onDrop: PropTypes.func,
|
|
4034
|
+
onDropAccepted: PropTypes.func,
|
|
4035
|
+
onDropRejected: PropTypes.func,
|
|
4036
|
+
onError: PropTypes.func,
|
|
4037
|
+
validator: PropTypes.func
|
|
4038
|
+
};
|
|
4039
|
+
var initialState = {
|
|
4040
|
+
isFocused: false,
|
|
4041
|
+
isFileDialogActive: false,
|
|
4042
|
+
isDragActive: false,
|
|
4043
|
+
isDragAccept: false,
|
|
4044
|
+
isDragReject: false,
|
|
4045
|
+
acceptedFiles: [],
|
|
4046
|
+
fileRejections: []
|
|
4047
|
+
};
|
|
4048
|
+
function useDropzone() {
|
|
4049
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
4050
|
+
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
4051
|
+
accept = _defaultProps$props.accept,
|
|
4052
|
+
disabled = _defaultProps$props.disabled,
|
|
4053
|
+
getFilesFromEvent = _defaultProps$props.getFilesFromEvent,
|
|
4054
|
+
maxSize = _defaultProps$props.maxSize,
|
|
4055
|
+
minSize = _defaultProps$props.minSize,
|
|
4056
|
+
multiple = _defaultProps$props.multiple,
|
|
4057
|
+
maxFiles = _defaultProps$props.maxFiles,
|
|
4058
|
+
onDragEnter = _defaultProps$props.onDragEnter,
|
|
4059
|
+
onDragLeave = _defaultProps$props.onDragLeave,
|
|
4060
|
+
onDragOver = _defaultProps$props.onDragOver,
|
|
4061
|
+
onDrop = _defaultProps$props.onDrop,
|
|
4062
|
+
onDropAccepted = _defaultProps$props.onDropAccepted,
|
|
4063
|
+
onDropRejected = _defaultProps$props.onDropRejected,
|
|
4064
|
+
onFileDialogCancel = _defaultProps$props.onFileDialogCancel,
|
|
4065
|
+
onFileDialogOpen = _defaultProps$props.onFileDialogOpen,
|
|
4066
|
+
useFsAccessApi = _defaultProps$props.useFsAccessApi,
|
|
4067
|
+
autoFocus = _defaultProps$props.autoFocus,
|
|
4068
|
+
preventDropOnDocument = _defaultProps$props.preventDropOnDocument,
|
|
4069
|
+
noClick = _defaultProps$props.noClick,
|
|
4070
|
+
noKeyboard = _defaultProps$props.noKeyboard,
|
|
4071
|
+
noDrag = _defaultProps$props.noDrag,
|
|
4072
|
+
noDragEventsBubbling = _defaultProps$props.noDragEventsBubbling,
|
|
4073
|
+
onError = _defaultProps$props.onError,
|
|
4074
|
+
validator = _defaultProps$props.validator;
|
|
4075
|
+
var acceptAttr = React.useMemo(function () {
|
|
4076
|
+
return acceptPropAsAcceptAttr(accept);
|
|
4077
|
+
}, [accept]);
|
|
4078
|
+
var pickerTypes = React.useMemo(function () {
|
|
4079
|
+
return pickerOptionsFromAccept(accept);
|
|
4080
|
+
}, [accept]);
|
|
4081
|
+
var onFileDialogOpenCb = React.useMemo(function () {
|
|
4082
|
+
return typeof onFileDialogOpen === "function" ? onFileDialogOpen : noop;
|
|
4083
|
+
}, [onFileDialogOpen]);
|
|
4084
|
+
var onFileDialogCancelCb = React.useMemo(function () {
|
|
4085
|
+
return typeof onFileDialogCancel === "function" ? onFileDialogCancel : noop;
|
|
4086
|
+
}, [onFileDialogCancel]);
|
|
4087
|
+
var rootRef = React.useRef(null);
|
|
4088
|
+
var inputRef = React.useRef(null);
|
|
4089
|
+
var _useReducer = React.useReducer(reducer, initialState),
|
|
4090
|
+
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
4091
|
+
state = _useReducer2[0],
|
|
4092
|
+
dispatch = _useReducer2[1];
|
|
4093
|
+
var isFocused = state.isFocused,
|
|
4094
|
+
isFileDialogActive = state.isFileDialogActive;
|
|
4095
|
+
var fsAccessApiWorksRef = React.useRef(typeof window !== "undefined" && window.isSecureContext && useFsAccessApi && canUseFileSystemAccessAPI());
|
|
4096
|
+
var onWindowFocus = function onWindowFocus() {
|
|
4097
|
+
if (!fsAccessApiWorksRef.current && isFileDialogActive) {
|
|
4098
|
+
setTimeout(function () {
|
|
4099
|
+
if (inputRef.current) {
|
|
4100
|
+
var files = inputRef.current.files;
|
|
4101
|
+
if (!files.length) {
|
|
4102
|
+
dispatch({
|
|
4103
|
+
type: "closeDialog"
|
|
4104
|
+
});
|
|
4105
|
+
onFileDialogCancelCb();
|
|
4106
|
+
}
|
|
4107
|
+
}
|
|
4108
|
+
}, 300);
|
|
4109
|
+
}
|
|
4110
|
+
};
|
|
4111
|
+
React.useEffect(function () {
|
|
4112
|
+
window.addEventListener("focus", onWindowFocus, false);
|
|
4113
|
+
return function () {
|
|
4114
|
+
window.removeEventListener("focus", onWindowFocus, false);
|
|
4115
|
+
};
|
|
4116
|
+
}, [inputRef, isFileDialogActive, onFileDialogCancelCb, fsAccessApiWorksRef]);
|
|
4117
|
+
var dragTargetsRef = React.useRef([]);
|
|
4118
|
+
var onDocumentDrop = function onDocumentDrop(event) {
|
|
4119
|
+
if (rootRef.current && rootRef.current.contains(event.target)) {
|
|
4120
|
+
return;
|
|
4121
|
+
}
|
|
4122
|
+
event.preventDefault();
|
|
4123
|
+
dragTargetsRef.current = [];
|
|
4124
|
+
};
|
|
4125
|
+
React.useEffect(function () {
|
|
4126
|
+
if (preventDropOnDocument) {
|
|
4127
|
+
document.addEventListener("dragover", onDocumentDragOver, false);
|
|
4128
|
+
document.addEventListener("drop", onDocumentDrop, false);
|
|
4129
|
+
}
|
|
4130
|
+
return function () {
|
|
4131
|
+
if (preventDropOnDocument) {
|
|
4132
|
+
document.removeEventListener("dragover", onDocumentDragOver);
|
|
4133
|
+
document.removeEventListener("drop", onDocumentDrop);
|
|
4134
|
+
}
|
|
4135
|
+
};
|
|
4136
|
+
}, [rootRef, preventDropOnDocument]);
|
|
4137
|
+
React.useEffect(function () {
|
|
4138
|
+
if (!disabled && autoFocus && rootRef.current) {
|
|
4139
|
+
rootRef.current.focus();
|
|
4140
|
+
}
|
|
4141
|
+
return function () {};
|
|
4142
|
+
}, [rootRef, autoFocus, disabled]);
|
|
4143
|
+
var onErrCb = React.useCallback(function (e) {
|
|
4144
|
+
if (onError) {
|
|
4145
|
+
onError(e);
|
|
4146
|
+
} else {
|
|
4147
|
+
console.error(e);
|
|
4148
|
+
}
|
|
4149
|
+
}, [onError]);
|
|
4150
|
+
var onDragEnterCb = React.useCallback(function (event) {
|
|
4151
|
+
event.preventDefault();
|
|
4152
|
+
event.persist();
|
|
4153
|
+
stopPropagation(event);
|
|
4154
|
+
dragTargetsRef.current = [].concat(_toConsumableArray(dragTargetsRef.current), [event.target]);
|
|
4155
|
+
if (isEvtWithFiles(event)) {
|
|
4156
|
+
Promise.resolve(getFilesFromEvent(event)).then(function (files) {
|
|
4157
|
+
if (isPropagationStopped(event) && !noDragEventsBubbling) {
|
|
4158
|
+
return;
|
|
4159
|
+
}
|
|
4160
|
+
var fileCount = files.length;
|
|
4161
|
+
var isDragAccept = fileCount > 0 && allFilesAccepted({
|
|
4162
|
+
files: files,
|
|
4163
|
+
accept: acceptAttr,
|
|
4164
|
+
minSize: minSize,
|
|
4165
|
+
maxSize: maxSize,
|
|
4166
|
+
multiple: multiple,
|
|
4167
|
+
maxFiles: maxFiles,
|
|
4168
|
+
validator: validator
|
|
4169
|
+
});
|
|
4170
|
+
var isDragReject = fileCount > 0 && !isDragAccept;
|
|
4171
|
+
dispatch({
|
|
4172
|
+
isDragAccept: isDragAccept,
|
|
4173
|
+
isDragReject: isDragReject,
|
|
4174
|
+
isDragActive: true,
|
|
4175
|
+
type: "setDraggedFiles"
|
|
4176
|
+
});
|
|
4177
|
+
if (onDragEnter) {
|
|
4178
|
+
onDragEnter(event);
|
|
4179
|
+
}
|
|
4180
|
+
}).catch(function (e) {
|
|
4181
|
+
return onErrCb(e);
|
|
4182
|
+
});
|
|
4183
|
+
}
|
|
4184
|
+
}, [getFilesFromEvent, onDragEnter, onErrCb, noDragEventsBubbling, acceptAttr, minSize, maxSize, multiple, maxFiles, validator]);
|
|
4185
|
+
var onDragOverCb = React.useCallback(function (event) {
|
|
4186
|
+
event.preventDefault();
|
|
4187
|
+
event.persist();
|
|
4188
|
+
stopPropagation(event);
|
|
4189
|
+
var hasFiles = isEvtWithFiles(event);
|
|
4190
|
+
if (hasFiles && event.dataTransfer) {
|
|
4191
|
+
try {
|
|
4192
|
+
event.dataTransfer.dropEffect = "copy";
|
|
4193
|
+
} catch (_unused) {}
|
|
4194
|
+
}
|
|
4195
|
+
if (hasFiles && onDragOver) {
|
|
4196
|
+
onDragOver(event);
|
|
4197
|
+
}
|
|
4198
|
+
return false;
|
|
4199
|
+
}, [onDragOver, noDragEventsBubbling]);
|
|
4200
|
+
var onDragLeaveCb = React.useCallback(function (event) {
|
|
4201
|
+
event.preventDefault();
|
|
4202
|
+
event.persist();
|
|
4203
|
+
stopPropagation(event);
|
|
4204
|
+
var targets = dragTargetsRef.current.filter(function (target) {
|
|
4205
|
+
return rootRef.current && rootRef.current.contains(target);
|
|
4206
|
+
});
|
|
4207
|
+
var targetIdx = targets.indexOf(event.target);
|
|
4208
|
+
if (targetIdx !== -1) {
|
|
4209
|
+
targets.splice(targetIdx, 1);
|
|
4210
|
+
}
|
|
4211
|
+
dragTargetsRef.current = targets;
|
|
4212
|
+
if (targets.length > 0) {
|
|
4213
|
+
return;
|
|
4214
|
+
}
|
|
4215
|
+
dispatch({
|
|
4216
|
+
type: "setDraggedFiles",
|
|
4217
|
+
isDragActive: false,
|
|
4218
|
+
isDragAccept: false,
|
|
4219
|
+
isDragReject: false
|
|
4220
|
+
});
|
|
4221
|
+
if (isEvtWithFiles(event) && onDragLeave) {
|
|
4222
|
+
onDragLeave(event);
|
|
4223
|
+
}
|
|
4224
|
+
}, [rootRef, onDragLeave, noDragEventsBubbling]);
|
|
4225
|
+
var setFiles = React.useCallback(function (files, event) {
|
|
4226
|
+
var acceptedFiles = [];
|
|
4227
|
+
var fileRejections = [];
|
|
4228
|
+
files.forEach(function (file) {
|
|
4229
|
+
var _fileAccepted = fileAccepted(file, acceptAttr),
|
|
4230
|
+
_fileAccepted2 = _slicedToArray(_fileAccepted, 2),
|
|
4231
|
+
accepted = _fileAccepted2[0],
|
|
4232
|
+
acceptError = _fileAccepted2[1];
|
|
4233
|
+
var _fileMatchSize = fileMatchSize(file, minSize, maxSize),
|
|
4234
|
+
_fileMatchSize2 = _slicedToArray(_fileMatchSize, 2),
|
|
4235
|
+
sizeMatch = _fileMatchSize2[0],
|
|
4236
|
+
sizeError = _fileMatchSize2[1];
|
|
4237
|
+
var customErrors = validator ? validator(file) : null;
|
|
4238
|
+
if (accepted && sizeMatch && !customErrors) {
|
|
4239
|
+
acceptedFiles.push(file);
|
|
4240
|
+
} else {
|
|
4241
|
+
var errors = [acceptError, sizeError];
|
|
4242
|
+
if (customErrors) {
|
|
4243
|
+
errors = errors.concat(customErrors);
|
|
4244
|
+
}
|
|
4245
|
+
fileRejections.push({
|
|
4246
|
+
file: file,
|
|
4247
|
+
errors: errors.filter(function (e) {
|
|
4248
|
+
return e;
|
|
4249
|
+
})
|
|
4250
|
+
});
|
|
4251
|
+
}
|
|
4252
|
+
});
|
|
4253
|
+
if (!multiple && acceptedFiles.length > 1 || multiple && maxFiles >= 1 && acceptedFiles.length > maxFiles) {
|
|
4254
|
+
acceptedFiles.forEach(function (file) {
|
|
4255
|
+
fileRejections.push({
|
|
4256
|
+
file: file,
|
|
4257
|
+
errors: [TOO_MANY_FILES_REJECTION]
|
|
4258
|
+
});
|
|
4259
|
+
});
|
|
4260
|
+
acceptedFiles.splice(0);
|
|
4261
|
+
}
|
|
4262
|
+
dispatch({
|
|
4263
|
+
acceptedFiles: acceptedFiles,
|
|
4264
|
+
fileRejections: fileRejections,
|
|
4265
|
+
type: "setFiles"
|
|
4266
|
+
});
|
|
4267
|
+
if (onDrop) {
|
|
4268
|
+
onDrop(acceptedFiles, fileRejections, event);
|
|
4269
|
+
}
|
|
4270
|
+
if (fileRejections.length > 0 && onDropRejected) {
|
|
4271
|
+
onDropRejected(fileRejections, event);
|
|
4272
|
+
}
|
|
4273
|
+
if (acceptedFiles.length > 0 && onDropAccepted) {
|
|
4274
|
+
onDropAccepted(acceptedFiles, event);
|
|
4275
|
+
}
|
|
4276
|
+
}, [dispatch, multiple, acceptAttr, minSize, maxSize, maxFiles, onDrop, onDropAccepted, onDropRejected, validator]);
|
|
4277
|
+
var onDropCb = React.useCallback(function (event) {
|
|
4278
|
+
event.preventDefault();
|
|
4279
|
+
event.persist();
|
|
4280
|
+
stopPropagation(event);
|
|
4281
|
+
dragTargetsRef.current = [];
|
|
4282
|
+
if (isEvtWithFiles(event)) {
|
|
4283
|
+
Promise.resolve(getFilesFromEvent(event)).then(function (files) {
|
|
4284
|
+
if (isPropagationStopped(event) && !noDragEventsBubbling) {
|
|
4285
|
+
return;
|
|
4286
|
+
}
|
|
4287
|
+
setFiles(files, event);
|
|
4288
|
+
}).catch(function (e) {
|
|
4289
|
+
return onErrCb(e);
|
|
4290
|
+
});
|
|
4291
|
+
}
|
|
4292
|
+
dispatch({
|
|
4293
|
+
type: "reset"
|
|
4294
|
+
});
|
|
4295
|
+
}, [getFilesFromEvent, setFiles, onErrCb, noDragEventsBubbling]);
|
|
4296
|
+
var openFileDialog = React.useCallback(function () {
|
|
4297
|
+
if (fsAccessApiWorksRef.current) {
|
|
4298
|
+
dispatch({
|
|
4299
|
+
type: "openDialog"
|
|
4300
|
+
});
|
|
4301
|
+
onFileDialogOpenCb();
|
|
4302
|
+
var opts = {
|
|
4303
|
+
multiple: multiple,
|
|
4304
|
+
types: pickerTypes
|
|
4305
|
+
};
|
|
4306
|
+
window.showOpenFilePicker(opts).then(function (handles) {
|
|
4307
|
+
return getFilesFromEvent(handles);
|
|
4308
|
+
}).then(function (files) {
|
|
4309
|
+
setFiles(files, null);
|
|
4310
|
+
dispatch({
|
|
4311
|
+
type: "closeDialog"
|
|
4312
|
+
});
|
|
4313
|
+
}).catch(function (e) {
|
|
4314
|
+
if (isAbort(e)) {
|
|
4315
|
+
onFileDialogCancelCb(e);
|
|
4316
|
+
dispatch({
|
|
4317
|
+
type: "closeDialog"
|
|
4318
|
+
});
|
|
4319
|
+
} else if (isSecurityError(e)) {
|
|
4320
|
+
fsAccessApiWorksRef.current = false;
|
|
4321
|
+
if (inputRef.current) {
|
|
4322
|
+
inputRef.current.value = null;
|
|
4323
|
+
inputRef.current.click();
|
|
4324
|
+
} else {
|
|
4325
|
+
onErrCb(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."));
|
|
4326
|
+
}
|
|
4327
|
+
} else {
|
|
4328
|
+
onErrCb(e);
|
|
4329
|
+
}
|
|
4330
|
+
});
|
|
4331
|
+
return;
|
|
4332
|
+
}
|
|
4333
|
+
if (inputRef.current) {
|
|
4334
|
+
dispatch({
|
|
4335
|
+
type: "openDialog"
|
|
4336
|
+
});
|
|
4337
|
+
onFileDialogOpenCb();
|
|
4338
|
+
inputRef.current.value = null;
|
|
4339
|
+
inputRef.current.click();
|
|
4340
|
+
}
|
|
4341
|
+
}, [dispatch, onFileDialogOpenCb, onFileDialogCancelCb, useFsAccessApi, setFiles, onErrCb, pickerTypes, multiple]);
|
|
4342
|
+
var onKeyDownCb = React.useCallback(function (event) {
|
|
4343
|
+
if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) {
|
|
4344
|
+
return;
|
|
4345
|
+
}
|
|
4346
|
+
if (event.key === " " || event.key === "Enter" || event.keyCode === 32 || event.keyCode === 13) {
|
|
4347
|
+
event.preventDefault();
|
|
4348
|
+
openFileDialog();
|
|
4349
|
+
}
|
|
4350
|
+
}, [rootRef, openFileDialog]);
|
|
4351
|
+
var onFocusCb = React.useCallback(function () {
|
|
4352
|
+
dispatch({
|
|
4353
|
+
type: "focus"
|
|
4354
|
+
});
|
|
4355
|
+
}, []);
|
|
4356
|
+
var onBlurCb = React.useCallback(function () {
|
|
4357
|
+
dispatch({
|
|
4358
|
+
type: "blur"
|
|
4359
|
+
});
|
|
4360
|
+
}, []);
|
|
4361
|
+
var onClickCb = React.useCallback(function () {
|
|
4362
|
+
if (noClick) {
|
|
4363
|
+
return;
|
|
4364
|
+
}
|
|
4365
|
+
if (isIeOrEdge()) {
|
|
4366
|
+
setTimeout(openFileDialog, 0);
|
|
4367
|
+
} else {
|
|
4368
|
+
openFileDialog();
|
|
4369
|
+
}
|
|
4370
|
+
}, [noClick, openFileDialog]);
|
|
4371
|
+
var composeHandler = function composeHandler(fn) {
|
|
4372
|
+
return disabled ? null : fn;
|
|
4373
|
+
};
|
|
4374
|
+
var composeKeyboardHandler = function composeKeyboardHandler(fn) {
|
|
4375
|
+
return noKeyboard ? null : composeHandler(fn);
|
|
4376
|
+
};
|
|
4377
|
+
var composeDragHandler = function composeDragHandler(fn) {
|
|
4378
|
+
return noDrag ? null : composeHandler(fn);
|
|
4379
|
+
};
|
|
4380
|
+
var stopPropagation = function stopPropagation(event) {
|
|
4381
|
+
if (noDragEventsBubbling) {
|
|
4382
|
+
event.stopPropagation();
|
|
4383
|
+
}
|
|
4384
|
+
};
|
|
4385
|
+
var getRootProps = React.useMemo(function () {
|
|
4386
|
+
return function () {
|
|
4387
|
+
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
4388
|
+
_ref2$refKey = _ref2.refKey,
|
|
4389
|
+
refKey = _ref2$refKey === void 0 ? "ref" : _ref2$refKey,
|
|
4390
|
+
role = _ref2.role,
|
|
4391
|
+
onKeyDown = _ref2.onKeyDown,
|
|
4392
|
+
onFocus = _ref2.onFocus,
|
|
4393
|
+
onBlur = _ref2.onBlur,
|
|
4394
|
+
onClick = _ref2.onClick,
|
|
4395
|
+
onDragEnter = _ref2.onDragEnter,
|
|
4396
|
+
onDragOver = _ref2.onDragOver,
|
|
4397
|
+
onDragLeave = _ref2.onDragLeave,
|
|
4398
|
+
onDrop = _ref2.onDrop,
|
|
4399
|
+
rest = _objectWithoutProperties(_ref2, _excluded3);
|
|
4400
|
+
return _objectSpread(_objectSpread(_defineProperty({
|
|
4401
|
+
onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),
|
|
4402
|
+
onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),
|
|
4403
|
+
onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),
|
|
4404
|
+
onClick: composeHandler(composeEventHandlers(onClick, onClickCb)),
|
|
4405
|
+
onDragEnter: composeDragHandler(composeEventHandlers(onDragEnter, onDragEnterCb)),
|
|
4406
|
+
onDragOver: composeDragHandler(composeEventHandlers(onDragOver, onDragOverCb)),
|
|
4407
|
+
onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave, onDragLeaveCb)),
|
|
4408
|
+
onDrop: composeDragHandler(composeEventHandlers(onDrop, onDropCb)),
|
|
4409
|
+
role: typeof role === "string" && role !== "" ? role : "presentation"
|
|
4410
|
+
}, refKey, rootRef), !disabled && !noKeyboard ? {
|
|
4411
|
+
tabIndex: 0
|
|
4412
|
+
} : {}), rest);
|
|
4413
|
+
};
|
|
4414
|
+
}, [rootRef, onKeyDownCb, onFocusCb, onBlurCb, onClickCb, onDragEnterCb, onDragOverCb, onDragLeaveCb, onDropCb, noKeyboard, noDrag, disabled]);
|
|
4415
|
+
var onInputElementClick = React.useCallback(function (event) {
|
|
4416
|
+
event.stopPropagation();
|
|
4417
|
+
}, []);
|
|
4418
|
+
var getInputProps = React.useMemo(function () {
|
|
4419
|
+
return function () {
|
|
4420
|
+
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
4421
|
+
_ref3$refKey = _ref3.refKey,
|
|
4422
|
+
refKey = _ref3$refKey === void 0 ? "ref" : _ref3$refKey,
|
|
4423
|
+
onChange = _ref3.onChange,
|
|
4424
|
+
onClick = _ref3.onClick,
|
|
4425
|
+
rest = _objectWithoutProperties(_ref3, _excluded4);
|
|
4426
|
+
var inputProps = _defineProperty({
|
|
4427
|
+
accept: acceptAttr,
|
|
4428
|
+
multiple: multiple,
|
|
4429
|
+
type: "file",
|
|
4430
|
+
style: {
|
|
4431
|
+
display: "none"
|
|
4432
|
+
},
|
|
4433
|
+
onChange: composeHandler(composeEventHandlers(onChange, onDropCb)),
|
|
4434
|
+
onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)),
|
|
4435
|
+
tabIndex: -1
|
|
4436
|
+
}, refKey, inputRef);
|
|
4437
|
+
return _objectSpread(_objectSpread({}, inputProps), rest);
|
|
4438
|
+
};
|
|
4439
|
+
}, [inputRef, accept, multiple, onDropCb, disabled]);
|
|
4440
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
4441
|
+
isFocused: isFocused && !disabled,
|
|
4442
|
+
getRootProps: getRootProps,
|
|
4443
|
+
getInputProps: getInputProps,
|
|
4444
|
+
rootRef: rootRef,
|
|
4445
|
+
inputRef: inputRef,
|
|
4446
|
+
open: composeHandler(openFileDialog)
|
|
4447
|
+
});
|
|
4448
|
+
}
|
|
4449
|
+
function reducer(state, action) {
|
|
4450
|
+
switch (action.type) {
|
|
4451
|
+
case "focus":
|
|
4452
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
4453
|
+
isFocused: true
|
|
4454
|
+
});
|
|
4455
|
+
case "blur":
|
|
4456
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
4457
|
+
isFocused: false
|
|
4458
|
+
});
|
|
4459
|
+
case "openDialog":
|
|
4460
|
+
return _objectSpread(_objectSpread({}, initialState), {}, {
|
|
4461
|
+
isFileDialogActive: true
|
|
4462
|
+
});
|
|
4463
|
+
case "closeDialog":
|
|
4464
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
4465
|
+
isFileDialogActive: false
|
|
4466
|
+
});
|
|
4467
|
+
case "setDraggedFiles":
|
|
4468
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
4469
|
+
isDragActive: action.isDragActive,
|
|
4470
|
+
isDragAccept: action.isDragAccept,
|
|
4471
|
+
isDragReject: action.isDragReject
|
|
4472
|
+
});
|
|
4473
|
+
case "setFiles":
|
|
4474
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
4475
|
+
acceptedFiles: action.acceptedFiles,
|
|
4476
|
+
fileRejections: action.fileRejections
|
|
4477
|
+
});
|
|
4478
|
+
case "reset":
|
|
4479
|
+
return _objectSpread({}, initialState);
|
|
4480
|
+
default:
|
|
4481
|
+
return state;
|
|
4482
|
+
}
|
|
4483
|
+
}
|
|
4484
|
+
function noop() {}
|
|
4485
|
+
|
|
4486
|
+
var FileInputGroupForm = function (props) {
|
|
4487
|
+
var _a = props.name, name = _a === void 0 ? 'multiple-file-input' : _a, label = props.label, description = props.description, required = props.required, value = props.value, _b = props.max, max = _b === void 0 ? 10 * 1024 * 1024 : _b, error = props.error, isDisabled = props.isDisabled, _c = props.isRequired, isRequired = _c === void 0 ? false : _c, _d = props.isTouched, isTouched = _d === void 0 ? false : _d, children = props.children, onChange = props.onChange, onBlur = props.onBlur, stylesOverrides = props.styles;
|
|
4488
|
+
var isValid = error === undefined;
|
|
4489
|
+
var _e = React.useState(false), isDragging = _e[0], setIsDragging = _e[1];
|
|
4490
|
+
var handleChangeInput = React.useCallback(function (file) {
|
|
4491
|
+
var reader = new FileReader();
|
|
4492
|
+
reader === null || reader === void 0 ? void 0 : reader.readAsDataURL(file);
|
|
4493
|
+
reader.onload = function () {
|
|
4494
|
+
var result = {
|
|
4495
|
+
name: file.name,
|
|
4496
|
+
size: file.size,
|
|
4497
|
+
type: file.type,
|
|
4498
|
+
blob: reader === null || reader === void 0 ? void 0 : reader.result,
|
|
4499
|
+
file: file,
|
|
4500
|
+
};
|
|
4501
|
+
if (max < result.size) {
|
|
4502
|
+
return;
|
|
4503
|
+
}
|
|
4504
|
+
onChange(result);
|
|
4505
|
+
};
|
|
4506
|
+
}, [max, onChange]);
|
|
4507
|
+
var onDrop = React.useCallback(function (files) {
|
|
4508
|
+
setIsDragging(false);
|
|
4509
|
+
handleChangeInput(files[0]);
|
|
4510
|
+
}, [handleChangeInput]);
|
|
4511
|
+
var _f = useDropzone({
|
|
4512
|
+
onDrop: onDrop,
|
|
4513
|
+
multiple: false,
|
|
4514
|
+
onError: function () {
|
|
4515
|
+
// console.log('error');
|
|
4516
|
+
// setFieldError('file', t('component.form.error.multipleFiles') as string);
|
|
4517
|
+
},
|
|
4518
|
+
onDragEnter: function () {
|
|
4519
|
+
setIsDragging(true);
|
|
4520
|
+
},
|
|
4521
|
+
onDragLeave: function () {
|
|
4522
|
+
setIsDragging(false);
|
|
4523
|
+
},
|
|
4524
|
+
}), getRootProps = _f.getRootProps, getInputProps = _f.getInputProps;
|
|
4525
|
+
var handleGenerateStyle = function () {
|
|
4526
|
+
var result = deepCopyObject(styles.base);
|
|
4527
|
+
var keys = calculateNestedKeys(styles.base);
|
|
4528
|
+
keys.forEach(function (key) {
|
|
4529
|
+
lodash.set(result, key, toClassName(lodash.get(styles.base, key), isTouched === true && !isValid && lodash.get(styles.invalid, key), isDisabled && lodash.get(styles.disabled, key), lodash.get(stylesOverrides, key)));
|
|
4530
|
+
});
|
|
4531
|
+
return result;
|
|
4532
|
+
};
|
|
4533
|
+
var styles$1 = handleGenerateStyle();
|
|
4534
|
+
var input = getInputProps();
|
|
4535
|
+
return (jsxRuntime.jsxs("div", { className: styles$1.container, children: [jsxRuntime.jsxs("div", { className: styles$1.head, children: [label && (jsxRuntime.jsx("label", { htmlFor: name, className: styles$1.label, children: label })), !required && !isRequired && typeof label === 'string' && (jsxRuntime.jsx("span", { className: styles$1.hint, children: "Optional" })), required && required({ isRequired: isRequired })] }), jsxRuntime.jsxs("div", __assign({ className: styles$1.body }, getRootProps(), { children: [children && children({ value: value, isDragging: isDragging }), jsxRuntime.jsx("input", { name: name, accept: input.accept, multiple: input.multiple, onChange: input.onChange, ref: input === null || input === void 0 ? void 0 : input.ref, style: input.style, tabIndex: input.tabIndex, type: input.type, onBlur: onBlur })] })), jsxRuntime.jsxs("div", { className: styles$1.foot, children: [description && !(error && isTouched) && (jsxRuntime.jsx("p", { className: styles$1.description, children: description })), error && isTouched && jsxRuntime.jsx("p", { className: styles$1.error, children: error })] })] }));
|
|
4536
|
+
};
|
|
4537
|
+
|
|
4538
|
+
var base = {
|
|
4539
|
+
container: '',
|
|
4540
|
+
head: 'flex justify-between',
|
|
4541
|
+
body: 'relative rounded-md py-2',
|
|
4542
|
+
foot: '',
|
|
4543
|
+
label: 'block font-medium text-gray-900',
|
|
4544
|
+
hint: 'text-xs text-gray-500',
|
|
4545
|
+
leading: 'pointer-events-none absolute inset-y-0 left-0 flex items-center',
|
|
4546
|
+
input: 'block w-full',
|
|
4547
|
+
trailing: 'pointer-events-none absolute inset-y-0 right-0 flex items-center',
|
|
4548
|
+
description: 'text-gray-400 text-xs mt-1',
|
|
4549
|
+
error: 'text-red-500 text-xs mt-1',
|
|
4550
|
+
};
|
|
4551
|
+
var leading = {
|
|
4552
|
+
input: 'pl-10',
|
|
4553
|
+
};
|
|
4554
|
+
var trailing = {};
|
|
4555
|
+
var normal = {
|
|
4556
|
+
label: 'leading-6 text-sm mb-2',
|
|
4557
|
+
hint: 'leading-6',
|
|
4558
|
+
leading: 'pl-3',
|
|
4559
|
+
input: 'rounded-md border-gray-200 shadow-sm focus:border-primary-500 focus:ring-primary-500 sm:text-sm placeholder-gray-300',
|
|
4560
|
+
trailing: 'pr-3',
|
|
4561
|
+
description: 'mt-2 text-sm',
|
|
4562
|
+
};
|
|
4563
|
+
var inset = {
|
|
4564
|
+
container: 'rounded-md px-3 pt-2.5 pb-1.5 shadow-sm ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-primary-600',
|
|
4565
|
+
label: 'text-xs',
|
|
4566
|
+
hint: 'text-xs',
|
|
4567
|
+
input: 'border-0 !ring-0 p-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm pl-0',
|
|
4568
|
+
description: 'hidden',
|
|
4569
|
+
};
|
|
4570
|
+
var overlapping = {
|
|
4571
|
+
container: 'relative',
|
|
4572
|
+
head: ' absolute flex justify-between items-center left-0 -top-2 right-0 mx-2 z-10 w-full',
|
|
4573
|
+
label: 'inline-block bg-white px-1 text-xs font-medium text-gray-900 ',
|
|
4574
|
+
hint: 'text-xs mr-4 bg-white px-1',
|
|
4575
|
+
input: 'block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6',
|
|
4576
|
+
description: 'hidden',
|
|
4577
|
+
};
|
|
4578
|
+
var pill = {
|
|
4579
|
+
head: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mb-1 pr-6',
|
|
4580
|
+
foot: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mt-1 pr-6',
|
|
4581
|
+
input: 'block w-full rounded-full border-0 px-4 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6',
|
|
4582
|
+
trailing: 'pr-2',
|
|
4583
|
+
description: 'text-xs',
|
|
4584
|
+
};
|
|
4585
|
+
var floored = {
|
|
4586
|
+
body: 'relative mt-2',
|
|
4587
|
+
label: 'block text-sm font-medium leading-6 text-gray-900',
|
|
4588
|
+
input: 'peer block w-full border-0 bg-gray-50 py-1.5 text-gray-900 focus:ring-0 sm:text-sm sm:leading-6 ring-0',
|
|
4589
|
+
description: 'text-xs mt-2',
|
|
4590
|
+
};
|
|
4591
|
+
var invalid = {
|
|
4592
|
+
container: 'ring-red-500',
|
|
4593
|
+
input:
|
|
4594
|
+
// 'block w-full border border-transparent text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500 sm:leading-6 pr-10',
|
|
4595
|
+
'block w-full border border-transparent text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500 pr-10',
|
|
4596
|
+
description: 'text-sm text-red-600',
|
|
4597
|
+
};
|
|
4598
|
+
var disabled = {
|
|
4599
|
+
input: 'block w-full rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-500 disabled:ring-gray-200',
|
|
4600
|
+
};
|
|
2547
4601
|
var styles = {
|
|
2548
4602
|
base: base,
|
|
4603
|
+
leading: leading,
|
|
4604
|
+
trailing: trailing,
|
|
4605
|
+
normal: normal,
|
|
4606
|
+
inset: inset,
|
|
4607
|
+
overlapping: overlapping,
|
|
4608
|
+
pill: pill,
|
|
4609
|
+
floored: floored,
|
|
4610
|
+
invalid: invalid,
|
|
2549
4611
|
disabled: disabled,
|
|
2550
4612
|
};
|
|
2551
4613
|
|
|
@@ -2559,6 +4621,7 @@ exports.ContainerLayout = ContainerLayout;
|
|
|
2559
4621
|
exports.DateMenuForm = DateMenuForm;
|
|
2560
4622
|
exports.DividerLayout = DividerLayout;
|
|
2561
4623
|
exports.DropdownElement = DropdownElement;
|
|
4624
|
+
exports.FileInputFormGroup = FileInputGroupForm;
|
|
2562
4625
|
exports.IconElement = IconElement;
|
|
2563
4626
|
exports.InputGroupForm = InputGroupForm;
|
|
2564
4627
|
exports.ListContainerLayout = ListContainerLayout;
|