@typeolymp/ui-components 1.16.6 → 1.17.0
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/build/components/atoms/Icon/index.d.ts +1 -1
- package/build/components/molecules/FileUpload/index.d.ts +13 -0
- package/build/components/molecules/FileUpload/stories.d.ts +13 -0
- package/build/components/molecules/FileUpload/styles.d.ts +1 -0
- package/build/index.d.ts +3 -2
- package/build/index.es.js +2814 -107
- package/build/index.es.js.map +1 -1
- package/build/index.js +2813 -105
- package/build/index.js.map +1 -1
- package/build/{lib → utils}/translations/index.d.ts +1 -1
- package/build/utils/types/TranslationType.d.ts +11 -0
- package/package.json +5 -3
- package/build/components/atoms/Input/translations.d.ts +0 -11
- package/build/components/molecules/Key/translations.d.ts +0 -5
- package/build/components/molecules/PasswordInputField/translations.d.ts +0 -11
- package/build/components/molecules/Tabs/styles.d.ts +0 -2
- package/build/lib/types/TranslationType.d.ts +0 -7
- /package/build/{lib → utils}/enums.d.ts +0 -0
- /package/build/{lib → utils}/helpers.d.ts +0 -0
- /package/build/{lib → utils}/theme/index.d.ts +0 -0
- /package/build/{lib → utils}/theme/types.d.ts +0 -0
package/build/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as jsx$1, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
2
2
|
import * as React$3 from 'react';
|
|
3
|
-
import React__default, { useLayoutEffect, useContext, forwardRef, createElement, createContext, Fragment, useRef, useState, useEffect, useImperativeHandle } from 'react';
|
|
3
|
+
import React__default, { useLayoutEffect, useContext, forwardRef, createElement, createContext, Fragment, useRef, useState, useEffect, useMemo, useReducer, useCallback, useImperativeHandle } from 'react';
|
|
4
4
|
import styled, { keyframes as keyframes$1 } from 'styled-components';
|
|
5
5
|
|
|
6
6
|
var theme = {
|
|
@@ -223,6 +223,23 @@ function __generator(thisArg, body) {
|
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
+
function __read(o, n) {
|
|
227
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
228
|
+
if (!m) return o;
|
|
229
|
+
var i = m.call(o), r, ar = [], e;
|
|
230
|
+
try {
|
|
231
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
232
|
+
}
|
|
233
|
+
catch (error) { e = { error: error }; }
|
|
234
|
+
finally {
|
|
235
|
+
try {
|
|
236
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
237
|
+
}
|
|
238
|
+
finally { if (e) throw e.error; }
|
|
239
|
+
}
|
|
240
|
+
return ar;
|
|
241
|
+
}
|
|
242
|
+
|
|
226
243
|
function __spreadArray(to, from, pack) {
|
|
227
244
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
228
245
|
if (ar || !(i in from)) {
|
|
@@ -436,7 +453,7 @@ var from = String.fromCharCode;
|
|
|
436
453
|
* @param {object}
|
|
437
454
|
* @return {object}
|
|
438
455
|
*/
|
|
439
|
-
var assign = Object.assign;
|
|
456
|
+
var assign$1 = Object.assign;
|
|
440
457
|
|
|
441
458
|
/**
|
|
442
459
|
* @param {string} value
|
|
@@ -562,7 +579,7 @@ function node$1 (value, root, parent, type, props, children, length) {
|
|
|
562
579
|
* @return {object}
|
|
563
580
|
*/
|
|
564
581
|
function copy (root, props) {
|
|
565
|
-
return assign(node$1('', null, null, '', null, null, 0), root, {length: -root.length}, props)
|
|
582
|
+
return assign$1(node$1('', null, null, '', null, null, 0), root, {length: -root.length}, props)
|
|
566
583
|
}
|
|
567
584
|
|
|
568
585
|
/**
|
|
@@ -1951,7 +1968,7 @@ function getStatics(component) {
|
|
|
1951
1968
|
|
|
1952
1969
|
var defineProperty = Object.defineProperty;
|
|
1953
1970
|
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
|
1954
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
1971
|
+
var getOwnPropertySymbols$1 = Object.getOwnPropertySymbols;
|
|
1955
1972
|
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
1956
1973
|
var getPrototypeOf = Object.getPrototypeOf;
|
|
1957
1974
|
var objectPrototype = Object.prototype;
|
|
@@ -1968,8 +1985,8 @@ function hoistNonReactStatics$2(targetComponent, sourceComponent, blacklist) {
|
|
|
1968
1985
|
|
|
1969
1986
|
var keys = getOwnPropertyNames(sourceComponent);
|
|
1970
1987
|
|
|
1971
|
-
if (getOwnPropertySymbols) {
|
|
1972
|
-
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
|
1988
|
+
if (getOwnPropertySymbols$1) {
|
|
1989
|
+
keys = keys.concat(getOwnPropertySymbols$1(sourceComponent));
|
|
1973
1990
|
}
|
|
1974
1991
|
|
|
1975
1992
|
var targetStatics = getStatics(targetComponent);
|
|
@@ -2481,7 +2498,7 @@ var useInsertionEffectAlwaysWithSyncFallback = !isBrowser$2 ? syncFallback : use
|
|
|
2481
2498
|
var useInsertionEffectWithLayoutFallback = useInsertionEffect || useLayoutEffect;
|
|
2482
2499
|
|
|
2483
2500
|
var isBrowser$1 = typeof document !== 'undefined';
|
|
2484
|
-
var hasOwnProperty = {}.hasOwnProperty;
|
|
2501
|
+
var hasOwnProperty$1 = {}.hasOwnProperty;
|
|
2485
2502
|
|
|
2486
2503
|
var EmotionCacheContext = /* #__PURE__ */createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
2487
2504
|
// because this module is primarily intended for the browser and node
|
|
@@ -2650,7 +2667,7 @@ var createEmotionProps = function createEmotionProps(type, props) {
|
|
|
2650
2667
|
var newProps = {};
|
|
2651
2668
|
|
|
2652
2669
|
for (var key in props) {
|
|
2653
|
-
if (hasOwnProperty.call(props, key)) {
|
|
2670
|
+
if (hasOwnProperty$1.call(props, key)) {
|
|
2654
2671
|
newProps[key] = props[key];
|
|
2655
2672
|
}
|
|
2656
2673
|
}
|
|
@@ -2727,7 +2744,7 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
|
|
|
2727
2744
|
var newProps = {};
|
|
2728
2745
|
|
|
2729
2746
|
for (var key in props) {
|
|
2730
|
-
if (hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName)) {
|
|
2747
|
+
if (hasOwnProperty$1.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName)) {
|
|
2731
2748
|
newProps[key] = props[key];
|
|
2732
2749
|
}
|
|
2733
2750
|
}
|
|
@@ -2866,7 +2883,7 @@ var pkg = {
|
|
|
2866
2883
|
var jsx = function jsx(type, props) {
|
|
2867
2884
|
var args = arguments;
|
|
2868
2885
|
|
|
2869
|
-
if (props == null || !hasOwnProperty.call(props, 'css')) {
|
|
2886
|
+
if (props == null || !hasOwnProperty$1.call(props, 'css')) {
|
|
2870
2887
|
// $FlowFixMe
|
|
2871
2888
|
return createElement.apply(undefined, args);
|
|
2872
2889
|
}
|
|
@@ -3414,7 +3431,7 @@ Object.defineProperty(BeatLoader, "__esModule", { value: true });
|
|
|
3414
3431
|
var React$2 = __importStar$2(React__default);
|
|
3415
3432
|
var react_1 = require$$1;
|
|
3416
3433
|
var helpers_1 = helpers$1;
|
|
3417
|
-
var beat = react_1.keyframes(templateObject_1$
|
|
3434
|
+
var beat = react_1.keyframes(templateObject_1$U || (templateObject_1$U = __makeTemplateObject(["\n 50% {transform: scale(0.75);opacity: 0.2}\n 100% {transform: scale(1);opacity: 1}\n"], ["\n 50% {transform: scale(0.75);opacity: 0.2}\n 100% {transform: scale(1);opacity: 1}\n"])));
|
|
3418
3435
|
var Loader = /** @class */ (function (_super) {
|
|
3419
3436
|
__extends$1(Loader, _super);
|
|
3420
3437
|
function Loader() {
|
|
@@ -3435,10 +3452,10 @@ var Loader = /** @class */ (function (_super) {
|
|
|
3435
3452
|
Loader.defaultProps = helpers_1.sizeMarginDefaults(15);
|
|
3436
3453
|
return Loader;
|
|
3437
3454
|
}(React$2.PureComponent));
|
|
3438
|
-
var _default = BeatLoader.default = Loader;
|
|
3439
|
-
var templateObject_1$
|
|
3455
|
+
var _default$1 = BeatLoader.default = Loader;
|
|
3456
|
+
var templateObject_1$U, templateObject_2$z;
|
|
3440
3457
|
|
|
3441
|
-
var StyledButton = styled.button(templateObject_1$
|
|
3458
|
+
var StyledButton = styled.button(templateObject_1$T || (templateObject_1$T = __makeTemplateObject$1(["\n width: ", ";\n height: ", ";\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding: 13px 20px 16px;\n background-color: ", ";\n box-shadow: ", ";\n\n border: ", ";\n border-radius: 6px;\n box-sizing: border-box;\n text-decoration: none;\n cursor: pointer;\n\n span {\n color: ", ";\n font-family: ", ";\n font-style: normal;\n font-weight: bold;\n font-size: ", ";\n }\n\n :hover {\n opacity: 0.85;\n }\n\n :active {\n box-shadow: none;\n margin-top: ", ";\n height: ", ";\n }\n"], ["\n width: ", ";\n height: ", ";\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding: 13px 20px 16px;\n background-color: ", ";\n box-shadow: ", ";\n\n border: ", ";\n border-radius: 6px;\n box-sizing: border-box;\n text-decoration: none;\n cursor: pointer;\n\n span {\n color: ", ";\n font-family: ", ";\n font-style: normal;\n font-weight: bold;\n font-size: ", ";\n }\n\n :hover {\n opacity: 0.85;\n }\n\n :active {\n box-shadow: none;\n margin-top: ", ";\n height: ", ";\n }\n"])), function (_a) {
|
|
3442
3459
|
var fluid = _a.fluid;
|
|
3443
3460
|
return (fluid ? "100%" : "fit-content");
|
|
3444
3461
|
}, function (_a) {
|
|
@@ -3519,7 +3536,7 @@ var LoaderWrapper = styled.div(templateObject_4$8 || (templateObject_4$8 = __mak
|
|
|
3519
3536
|
var size = _a.size;
|
|
3520
3537
|
return (size === "small" ? "3px" : "");
|
|
3521
3538
|
});
|
|
3522
|
-
var templateObject_1$
|
|
3539
|
+
var templateObject_1$T, templateObject_2$y, templateObject_3$c, templateObject_4$8;
|
|
3523
3540
|
|
|
3524
3541
|
var Button = forwardRef(function (_a, ref) {
|
|
3525
3542
|
var label = _a.label, color = _a.color, size = _a.size, fluid = _a.fluid, disabled = _a.disabled, type = _a.type, tabIndex = _a.tabIndex, href = _a.href, asAnchor = _a.asAnchor, props = __rest(_a, ["label", "color", "size", "fluid", "disabled", "type", "tabIndex", "href", "asAnchor"]);
|
|
@@ -3547,7 +3564,7 @@ var Button = forwardRef(function (_a, ref) {
|
|
|
3547
3564
|
var width = ((_b = buttonRef.current) === null || _b === void 0 ? void 0 : _b.clientWidth) - 40;
|
|
3548
3565
|
if (dark)
|
|
3549
3566
|
width = width + 4;
|
|
3550
|
-
return (jsx$1(LoaderWrapper, __assign$2({ width: width, size: size }, { children: jsx$1(_default, { size: 10, color: dark
|
|
3567
|
+
return (jsx$1(LoaderWrapper, __assign$2({ width: width, size: size }, { children: jsx$1(_default$1, { size: 10, color: dark
|
|
3551
3568
|
? theme.colors.lightGray.darker
|
|
3552
3569
|
: theme.colors.lightGray.light, speedMultiplier: 0.5 }) })));
|
|
3553
3570
|
};
|
|
@@ -3559,7 +3576,7 @@ var Button = forwardRef(function (_a, ref) {
|
|
|
3559
3576
|
return (jsx$1(StyledButton, __assign$2({ color: color, size: size, fluid: fluid, type: type, tabIndex: tabIndex, as: as, href: href, ref: ref ? ref : buttonRef, onClick: onClick }, { children: isLoading ? jsx$1(Loader, {}) : jsx$1("span", { children: label }) })));
|
|
3560
3577
|
});
|
|
3561
3578
|
|
|
3562
|
-
var StyledCheckbox = styled.div(templateObject_1$
|
|
3579
|
+
var StyledCheckbox = styled.div(templateObject_1$S || (templateObject_1$S = __makeTemplateObject$1(["\n min-height: 25px;\n max-height: 25px;\n min-width: 25px;\n max-width: 25px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n cursor: ", ";\n background-color: ", ";\n\n svg {\n margin-left: -1px;\n fill: ", ";\n }\n\n input {\n display: none;\n }\n\n :focus {\n outline: 0;\n border-color: ", ";\n box-shadow: ", ";\n }\n"], ["\n min-height: 25px;\n max-height: 25px;\n min-width: 25px;\n max-width: 25px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n cursor: ", ";\n background-color: ", ";\n\n svg {\n margin-left: -1px;\n fill: ", ";\n }\n\n input {\n display: none;\n }\n\n :focus {\n outline: 0;\n border-color: ", ";\n box-shadow: ", ";\n }\n"])), function (_a) {
|
|
3563
3580
|
var checked = _a.checked, disabled = _a.disabled;
|
|
3564
3581
|
if (disabled)
|
|
3565
3582
|
return theme.colors.lightGray.darker;
|
|
@@ -3580,7 +3597,7 @@ var StyledCheckbox = styled.div(templateObject_1$R || (templateObject_1$R = __ma
|
|
|
3580
3597
|
return theme.colors.green.base;
|
|
3581
3598
|
return theme.colors.lightGray.darker;
|
|
3582
3599
|
}, theme.colors.blue.dark, "0 0 0 1px ".concat(theme.colors.blue.dark));
|
|
3583
|
-
var templateObject_1$
|
|
3600
|
+
var templateObject_1$S;
|
|
3584
3601
|
|
|
3585
3602
|
var Checkbox = function (props) {
|
|
3586
3603
|
var _a;
|
|
@@ -3613,7 +3630,7 @@ var Checkbox = function (props) {
|
|
|
3613
3630
|
return (jsxs(StyledCheckbox, __assign$2({ checked: checked, disabled: props.disabled, tabIndex: 0, onClick: toggle, onBlur: props.onBlur, onKeyPress: function (e) { return (e.key === "Enter" ? toggle() : null); }, ref: wrapperRef }, { children: [checked && (jsx$1("svg", __assign$2({ width: 16, height: 12, viewBox: "0 0 16 12", fill: "none" }, { children: jsx$1("path", { d: "M12.61.563l-6.585 6.6L3.439 4.57a1.997 1.997 0 00-3.374.885c-.183.7.026 1.446.546 1.949l4 4.008a1.997 1.997 0 002.828 0l8-8.017a2.007 2.007 0 00-.025-2.809 1.997 1.997 0 00-2.803-.024z" }) }))), jsx$1("input", { type: "checkbox", disabled: !!props.disabled, id: props.id, name: props.name, value: props.value, ref: inputRef })] })));
|
|
3614
3631
|
};
|
|
3615
3632
|
|
|
3616
|
-
var Wrapper$a = styled.div(templateObject_1$
|
|
3633
|
+
var Wrapper$a = styled.div(templateObject_1$R || (templateObject_1$R = __makeTemplateObject$1(["\n width: ", ";\n height: ", ";\n"], ["\n width: ", ";\n height: ", ";\n"])), function (_a) {
|
|
3617
3634
|
var size = _a.size;
|
|
3618
3635
|
switch (size) {
|
|
3619
3636
|
case "small":
|
|
@@ -3636,7 +3653,7 @@ var Wrapper$a = styled.div(templateObject_1$Q || (templateObject_1$Q = __makeTem
|
|
|
3636
3653
|
return "27px";
|
|
3637
3654
|
}
|
|
3638
3655
|
});
|
|
3639
|
-
var templateObject_1$
|
|
3656
|
+
var templateObject_1$R;
|
|
3640
3657
|
|
|
3641
3658
|
var parsers = {};
|
|
3642
3659
|
|
|
@@ -3644,6 +3661,48 @@ var getCountryByLocale$1 = {};
|
|
|
3644
3661
|
|
|
3645
3662
|
var enums = {};
|
|
3646
3663
|
|
|
3664
|
+
var AccountType = {};
|
|
3665
|
+
|
|
3666
|
+
(function (exports) {
|
|
3667
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3668
|
+
exports.AccountType = void 0;
|
|
3669
|
+
(function (AccountType) {
|
|
3670
|
+
AccountType["STUDENT"] = "student";
|
|
3671
|
+
AccountType["PARENT"] = "parent";
|
|
3672
|
+
AccountType["TUTOR"] = "tutor";
|
|
3673
|
+
})(exports.AccountType || (exports.AccountType = {}));
|
|
3674
|
+
|
|
3675
|
+
}(AccountType));
|
|
3676
|
+
|
|
3677
|
+
var AchievementType = {};
|
|
3678
|
+
|
|
3679
|
+
(function (exports) {
|
|
3680
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3681
|
+
exports.AchievementType = void 0;
|
|
3682
|
+
(function (AchievementType) {
|
|
3683
|
+
AchievementType["PRACTICE_TIME"] = "practiceTime";
|
|
3684
|
+
AchievementType["PRACTICE_STREAK"] = "practiceStreak";
|
|
3685
|
+
AchievementType["MEDALS"] = "medals";
|
|
3686
|
+
})(exports.AchievementType || (exports.AchievementType = {}));
|
|
3687
|
+
|
|
3688
|
+
}(AchievementType));
|
|
3689
|
+
|
|
3690
|
+
var ChartDataType = {};
|
|
3691
|
+
|
|
3692
|
+
(function (exports) {
|
|
3693
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3694
|
+
exports.ChartDataType = void 0;
|
|
3695
|
+
(function (ChartDataType) {
|
|
3696
|
+
ChartDataType["PROGRESS"] = "progress";
|
|
3697
|
+
ChartDataType["TIME_PRACTISED"] = "timePractised";
|
|
3698
|
+
ChartDataType["RESULTS"] = "results";
|
|
3699
|
+
ChartDataType["HITS"] = "hits";
|
|
3700
|
+
ChartDataType["KPM"] = "kpm";
|
|
3701
|
+
ChartDataType["ACCURACY"] = "accuracy";
|
|
3702
|
+
})(exports.ChartDataType || (exports.ChartDataType = {}));
|
|
3703
|
+
|
|
3704
|
+
}(ChartDataType));
|
|
3705
|
+
|
|
3647
3706
|
var Color = {};
|
|
3648
3707
|
|
|
3649
3708
|
(function (exports) {
|
|
@@ -3687,6 +3746,69 @@ exports.CourseTranslation = void 0;
|
|
|
3687
3746
|
|
|
3688
3747
|
}(CourseTranslation));
|
|
3689
3748
|
|
|
3749
|
+
var Currency = {};
|
|
3750
|
+
|
|
3751
|
+
(function (exports) {
|
|
3752
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3753
|
+
exports.Currency = void 0;
|
|
3754
|
+
(function (Currency) {
|
|
3755
|
+
Currency["EUR"] = "EUR";
|
|
3756
|
+
Currency["GBP"] = "GBP";
|
|
3757
|
+
Currency["USD"] = "USD";
|
|
3758
|
+
})(exports.Currency || (exports.Currency = {}));
|
|
3759
|
+
|
|
3760
|
+
}(Currency));
|
|
3761
|
+
|
|
3762
|
+
var ExerciseType = {};
|
|
3763
|
+
|
|
3764
|
+
(function (exports) {
|
|
3765
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3766
|
+
exports.ExerciseType = void 0;
|
|
3767
|
+
(function (ExerciseType) {
|
|
3768
|
+
ExerciseType["KEYS"] = "keys";
|
|
3769
|
+
ExerciseType["DRILLS"] = "drills";
|
|
3770
|
+
ExerciseType["WORDS"] = "words";
|
|
3771
|
+
ExerciseType["TEXT"] = "text";
|
|
3772
|
+
})(exports.ExerciseType || (exports.ExerciseType = {}));
|
|
3773
|
+
|
|
3774
|
+
}(ExerciseType));
|
|
3775
|
+
|
|
3776
|
+
var HttpStatus = {};
|
|
3777
|
+
|
|
3778
|
+
(function (exports) {
|
|
3779
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3780
|
+
exports.HttpStatusText = exports.HttpStatusCode = void 0;
|
|
3781
|
+
(function (HttpStatusCode) {
|
|
3782
|
+
// 2xx Success
|
|
3783
|
+
HttpStatusCode[HttpStatusCode["OK"] = 200] = "OK";
|
|
3784
|
+
HttpStatusCode[HttpStatusCode["CREATED"] = 201] = "CREATED";
|
|
3785
|
+
// 4xx Client Errors
|
|
3786
|
+
HttpStatusCode[HttpStatusCode["BAD_REQUEST"] = 400] = "BAD_REQUEST";
|
|
3787
|
+
HttpStatusCode[HttpStatusCode["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
|
|
3788
|
+
HttpStatusCode[HttpStatusCode["FORBIDDEN"] = 403] = "FORBIDDEN";
|
|
3789
|
+
HttpStatusCode[HttpStatusCode["NOT_FOUND"] = 404] = "NOT_FOUND";
|
|
3790
|
+
HttpStatusCode[HttpStatusCode["CONFLICT"] = 409] = "CONFLICT";
|
|
3791
|
+
// 5xx Server Errors
|
|
3792
|
+
HttpStatusCode[HttpStatusCode["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
|
|
3793
|
+
HttpStatusCode[HttpStatusCode["NOT_IMPLEMENTED"] = 501] = "NOT_IMPLEMENTED";
|
|
3794
|
+
})(exports.HttpStatusCode || (exports.HttpStatusCode = {}));
|
|
3795
|
+
(function (HttpStatusText) {
|
|
3796
|
+
// 2xx Success
|
|
3797
|
+
HttpStatusText["OK"] = "OK";
|
|
3798
|
+
HttpStatusText["CREATED"] = "Created";
|
|
3799
|
+
// 4xx Client Errors
|
|
3800
|
+
HttpStatusText["BAD_REQUEST"] = "Bad Request";
|
|
3801
|
+
HttpStatusText["UNAUTHORIZED"] = "Unauthorized";
|
|
3802
|
+
HttpStatusText["FORBIDDEN"] = "Forbidden";
|
|
3803
|
+
HttpStatusText["NOT_FOUND"] = "Not Found";
|
|
3804
|
+
HttpStatusText["CONFLICT"] = "Conflict";
|
|
3805
|
+
// 5xx Server Errors
|
|
3806
|
+
HttpStatusText["INTERNAL_SERVER_ERROR"] = "Internal Server Error";
|
|
3807
|
+
HttpStatusText["NOT_IMPLEMENTED"] = "Not Implemented";
|
|
3808
|
+
})(exports.HttpStatusText || (exports.HttpStatusText = {}));
|
|
3809
|
+
|
|
3810
|
+
}(HttpStatus));
|
|
3811
|
+
|
|
3690
3812
|
var KeyboardLayout = {};
|
|
3691
3813
|
|
|
3692
3814
|
(function (exports) {
|
|
@@ -3720,6 +3842,32 @@ exports.Locale = void 0;
|
|
|
3720
3842
|
|
|
3721
3843
|
}(Locale));
|
|
3722
3844
|
|
|
3845
|
+
var Medal$1 = {};
|
|
3846
|
+
|
|
3847
|
+
(function (exports) {
|
|
3848
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3849
|
+
exports.Medal = void 0;
|
|
3850
|
+
(function (Medal) {
|
|
3851
|
+
Medal["GOLD"] = "gold";
|
|
3852
|
+
Medal["SILVER"] = "silver";
|
|
3853
|
+
Medal["BRONZE"] = "bronze";
|
|
3854
|
+
})(exports.Medal || (exports.Medal = {}));
|
|
3855
|
+
|
|
3856
|
+
}(Medal$1));
|
|
3857
|
+
|
|
3858
|
+
var NodeEnv = {};
|
|
3859
|
+
|
|
3860
|
+
(function (exports) {
|
|
3861
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3862
|
+
exports.NodeEnv = void 0;
|
|
3863
|
+
(function (NodeEnv) {
|
|
3864
|
+
NodeEnv["TEST"] = "test";
|
|
3865
|
+
NodeEnv["DEVELOPMENT"] = "development";
|
|
3866
|
+
NodeEnv["PRODUCTION"] = "production";
|
|
3867
|
+
})(exports.NodeEnv || (exports.NodeEnv = {}));
|
|
3868
|
+
|
|
3869
|
+
}(NodeEnv));
|
|
3870
|
+
|
|
3723
3871
|
var Plan = {};
|
|
3724
3872
|
|
|
3725
3873
|
(function (exports) {
|
|
@@ -3751,19 +3899,6 @@ exports.TextTopic = void 0;
|
|
|
3751
3899
|
|
|
3752
3900
|
}(TextTopic));
|
|
3753
3901
|
|
|
3754
|
-
var Medal$1 = {};
|
|
3755
|
-
|
|
3756
|
-
(function (exports) {
|
|
3757
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3758
|
-
exports.Medal = void 0;
|
|
3759
|
-
(function (Medal) {
|
|
3760
|
-
Medal["GOLD"] = "gold";
|
|
3761
|
-
Medal["SILVER"] = "silver";
|
|
3762
|
-
Medal["BRONZE"] = "bronze";
|
|
3763
|
-
})(exports.Medal || (exports.Medal = {}));
|
|
3764
|
-
|
|
3765
|
-
}(Medal$1));
|
|
3766
|
-
|
|
3767
3902
|
(function (exports) {
|
|
3768
3903
|
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3769
3904
|
if (k2 === undefined) k2 = k;
|
|
@@ -3780,14 +3915,21 @@ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m
|
|
|
3780
3915
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
3781
3916
|
};
|
|
3782
3917
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3918
|
+
__exportStar(AccountType, exports);
|
|
3919
|
+
__exportStar(AchievementType, exports);
|
|
3920
|
+
__exportStar(ChartDataType, exports);
|
|
3783
3921
|
__exportStar(Color, exports);
|
|
3784
3922
|
__exportStar(Country, exports);
|
|
3785
3923
|
__exportStar(CourseTranslation, exports);
|
|
3924
|
+
__exportStar(Currency, exports);
|
|
3925
|
+
__exportStar(ExerciseType, exports);
|
|
3926
|
+
__exportStar(HttpStatus, exports);
|
|
3786
3927
|
__exportStar(KeyboardLayout, exports);
|
|
3787
3928
|
__exportStar(Locale, exports);
|
|
3929
|
+
__exportStar(Medal$1, exports);
|
|
3930
|
+
__exportStar(NodeEnv, exports);
|
|
3788
3931
|
__exportStar(Plan, exports);
|
|
3789
3932
|
__exportStar(TextTopic, exports);
|
|
3790
|
-
__exportStar(Medal$1, exports);
|
|
3791
3933
|
|
|
3792
3934
|
}(enums));
|
|
3793
3935
|
|
|
@@ -3907,7 +4049,7 @@ var flags = {
|
|
|
3907
4049
|
};
|
|
3908
4050
|
var Flag = function (props) { return (jsx$1(Wrapper$a, __assign$2({}, props, { children: flags[parsers.getCountryCodeByLocale(props.locale)] }))); };
|
|
3909
4051
|
|
|
3910
|
-
var StyledHeading = styled.span(templateObject_1$
|
|
4052
|
+
var StyledHeading = styled.span(templateObject_1$Q || (templateObject_1$Q = __makeTemplateObject$1(["\n font-family: ", ";\n font-size: ", ";\n font-weight: 700;\n font-style: normal;\n line-height: ", ";\n letter-spacing: ", ";\n margin: 0;\n color: ", ";\n text-align: ", ";\n"], ["\n font-family: ", ";\n font-size: ", ";\n font-weight: 700;\n font-style: normal;\n line-height: ", ";\n letter-spacing: ", ";\n margin: 0;\n color: ", ";\n text-align: ", ";\n"])), theme.fonts.heading, function (_a) {
|
|
3911
4053
|
var type = _a.type;
|
|
3912
4054
|
return theme.heading[type].fontSize;
|
|
3913
4055
|
}, function (_a) {
|
|
@@ -3931,14 +4073,14 @@ var StyledHeading = styled.span(templateObject_1$P || (templateObject_1$P = __ma
|
|
|
3931
4073
|
var align = _a.align;
|
|
3932
4074
|
return align;
|
|
3933
4075
|
});
|
|
3934
|
-
var templateObject_1$
|
|
4076
|
+
var templateObject_1$Q;
|
|
3935
4077
|
|
|
3936
4078
|
var Heading = function (props) {
|
|
3937
4079
|
var element = !!props.as ? props.as : props.type;
|
|
3938
4080
|
return (jsx$1(StyledHeading, __assign$2({}, props, { as: element }, { children: props.children })));
|
|
3939
4081
|
};
|
|
3940
4082
|
|
|
3941
|
-
var Wrapper$9 = styled.div(templateObject_1$
|
|
4083
|
+
var Wrapper$9 = styled.div(templateObject_1$P || (templateObject_1$P = __makeTemplateObject$1(["\n width: ", ";\n height: ", ";\n\n > svg {\n fill: ", ";\n\n :hover {\n cursor: ", ";\n fill: ", ";\n }\n }\n"], ["\n width: ", ";\n height: ", ";\n\n > svg {\n fill: ", ";\n\n :hover {\n cursor: ", ";\n fill: ", ";\n }\n }\n"])), function (_a) {
|
|
3942
4084
|
var size = _a.size;
|
|
3943
4085
|
return theme.icon[size] || theme.icon.medium;
|
|
3944
4086
|
}, function (_a) {
|
|
@@ -3971,7 +4113,9 @@ var Wrapper$9 = styled.div(templateObject_1$O || (templateObject_1$O = __makeTem
|
|
|
3971
4113
|
var onClick = _a.onClick;
|
|
3972
4114
|
return (onClick ? "pointer" : "default");
|
|
3973
4115
|
}, function (_a) {
|
|
3974
|
-
var color = _a.color;
|
|
4116
|
+
var color = _a.color, onClick = _a.onClick;
|
|
4117
|
+
if (!onClick)
|
|
4118
|
+
return;
|
|
3975
4119
|
switch (color) {
|
|
3976
4120
|
default:
|
|
3977
4121
|
case "gray":
|
|
@@ -3994,7 +4138,7 @@ var Wrapper$9 = styled.div(templateObject_1$O || (templateObject_1$O = __makeTem
|
|
|
3994
4138
|
return theme.colors.lightGray.base;
|
|
3995
4139
|
}
|
|
3996
4140
|
});
|
|
3997
|
-
var templateObject_1$
|
|
4141
|
+
var templateObject_1$P;
|
|
3998
4142
|
|
|
3999
4143
|
var icons = {
|
|
4000
4144
|
check: (jsx$1("path", { d: "M16.6107 6.5626L10.0247 13.1623L7.43866 10.5709C6.9365 10.0499 6.19289 9.841 5.49363 10.0244C4.79436 10.2078 4.24826 10.7551 4.06523 11.4558C3.8822 12.1565 4.09071 12.9017 4.61063 13.4049L8.61067 17.4132C9.39168 18.1956 10.6577 18.1956 11.4387 17.4132L19.4388 9.3965C20.1967 8.6101 20.1859 7.36009 19.4144 6.58701C18.6429 5.81393 17.3955 5.80307 16.6107 6.5626Z" })),
|
|
@@ -4025,10 +4169,11 @@ var icons = {
|
|
|
4025
4169
|
thunder: (jsx$1("path", { d: "M20.3 8.7h-6.9l.6-7.6c0-.3-.1-.6-.3-.8-.2-.2-.5-.3-.7-.3-.3 0-.6.2-.7.4L2.9 13.6c-.1.2-.2.4-.2.7 0 .2.1.5.3.6.2.2.4.2.7.2h7.1l-.7 7.8c0 .2 0 .4.2.6.1.2.3.3.5.4l.2.1c.3 0 .6-.2.8-.5L21 10.2c.1-.2.2-.4.2-.7 0-.2-.1-.5-.3-.6-.1-.1-.4-.2-.6-.2z" })),
|
|
4026
4170
|
fire: (jsx$1("path", { d: "M17.3 9.2c-.7-.6-1.3-1.2-1.8-1.9C12.4 3.3 14 0 14 0 8.3 2.4 7 6.2 7 9c0 0 .1 1.7.8 3.5.2.6-.2 1.2-.8 1.3-.4.1-.8-.2-1-.6-.3-.7-.8-1.8-.6-2.6-.9 1.2-1.5 2.8-1.7 4.4-.3 4.2 2.6 8 6.7 8.8 4.8 1 9.3-2.3 10-7.1.3-2.9-.9-5.7-3.1-7.5z" })),
|
|
4027
4171
|
control: (jsx$1("path", { d: "M1.4 5.3h2.4c.5 1.6 2 2.8 3.8 2.8 1.8 0 3.3-1.2 3.8-2.8h11.2c.7 0 1.2-.5 1.2-1.2s-.5-1.2-1.2-1.2H11.5C10.9 1.2 9.4 0 7.6 0 5.8 0 4.3 1.2 3.8 2.8H1.4C.7 2.8.2 3.3.2 4s.5 1.3 1.2 1.3zm6.2-2.8c.9 0 1.6.7 1.6 1.6s-.7 1.6-1.6 1.6S6 5 6 4.1c0-.9.7-1.6 1.6-1.6zM22.6 10.8h-2.4c-.5-1.6-2-2.8-3.8-2.8-1.8 0-3.3 1.2-3.8 2.8H1.4c-.7 0-1.2.5-1.2 1.2s.5 1.2 1.2 1.2h11.2c.5 1.6 2 2.8 3.8 2.8 1.8 0 3.3-1.2 3.8-2.8h2.4c.7 0 1.2-.5 1.2-1.2.1-.7-.5-1.2-1.2-1.2zm-6.2 2.8c-.9 0-1.6-.7-1.6-1.6 0-.9.7-1.6 1.6-1.6.9 0 1.6.7 1.6 1.6 0 .9-.7 1.6-1.6 1.6zM22.6 18.7H11.5c-.5-1.6-2-2.8-3.8-2.8-1.8 0-3.3 1.2-3.8 2.8H1.4c-.7 0-1.2.5-1.2 1.2s.5 1.2 1.2 1.2h2.4c.5 1.6 2 2.8 3.8 2.8 1.8 0 3.3-1.2 3.8-2.8h11.2c.7 0 1.2-.5 1.2-1.2s-.5-1.2-1.2-1.2zm-15 2.8c-.9 0-1.6-.7-1.6-1.6 0-.9.7-1.6 1.6-1.6.9 0 1.6.7 1.6 1.6 0 .9-.7 1.6-1.6 1.6z" })),
|
|
4172
|
+
file: (jsxs(Fragment$1, { children: [jsx$1("path", { d: "M6 2.75C4.75736 2.75 3.75 3.75736 3.75 5V19C3.75 20.2426 4.75736 21.25 6 21.25H18C19.2426 21.25 20.25 20.2426 20.25 19V9.08615C20.25 8.55979 20.0655 8.05009 19.7285 7.64574L16.3234 3.55959C15.8959 3.0466 15.2626 2.75 14.5949 2.75H6ZM2.25 5C2.25 2.92893 3.92893 1.25 6 1.25H14.5949C15.7078 1.25 16.7632 1.74434 17.4757 2.59931L20.8808 6.68546C21.4424 7.35939 21.75 8.20889 21.75 9.08615V19C21.75 21.0711 20.0711 22.75 18 22.75H6C3.92893 22.75 2.25 21.0711 2.25 19V5Z" }), jsx$1("path", { d: "M15 1.75C15.4142 1.75 15.75 2.08579 15.75 2.5V6C15.75 7.24264 16.7574 8.25 18 8.25H20.5C20.9142 8.25 21.25 8.58579 21.25 9C21.25 9.41421 20.9142 9.75 20.5 9.75H18C15.9289 9.75 14.25 8.07107 14.25 6V2.5C14.25 2.08579 14.5858 1.75 15 1.75Z" })] })),
|
|
4028
4173
|
};
|
|
4029
4174
|
var Icon = function (props) { return (jsx$1(Wrapper$9, __assign$2({}, props, { children: jsx$1("svg", __assign$2({ viewBox: "0 0 24 24", fill: "none" }, { children: icons[props.type] })) }))); };
|
|
4030
4175
|
|
|
4031
|
-
var Wrapper$8 = styled.div(templateObject_1$
|
|
4176
|
+
var Wrapper$8 = styled.div(templateObject_1$O || (templateObject_1$O = __makeTemplateObject$1(["\n > svg {\n height: ", ";\n }\n"], ["\n > svg {\n height: ", ";\n }\n"])), function (_a) {
|
|
4032
4177
|
var size = _a.size;
|
|
4033
4178
|
switch (size) {
|
|
4034
4179
|
case "tiny":
|
|
@@ -4042,7 +4187,7 @@ var Wrapper$8 = styled.div(templateObject_1$N || (templateObject_1$N = __makeTem
|
|
|
4042
4187
|
return "118px";
|
|
4043
4188
|
}
|
|
4044
4189
|
});
|
|
4045
|
-
var templateObject_1$
|
|
4190
|
+
var templateObject_1$O;
|
|
4046
4191
|
|
|
4047
4192
|
var illustrations = {
|
|
4048
4193
|
keyboard: (jsxs("svg", __assign$2({ viewBox: "0 0 32.9 20.8" }, { children: [jsx$1("path", { d: "M31.5 1H1.4C.6 1 0 1.6 0 2.4v17.1c0 .8.6 1.4 1.4 1.4h30.1c.8 0 1.4-.6 1.4-1.4V2.4c0-.8-.6-1.4-1.4-1.4z", fill: "#829190" }), jsx$1("path", { d: "M31.5 0H1.4C.6 0 0 .6 0 1.4v17.1c0 .8.6 1.4 1.4 1.4h30.1c.8 0 1.4-.6 1.4-1.4V1.4c0-.8-.6-1.4-1.4-1.4z", fill: "#99adac" }), jsx$1("path", { d: "M27.1 14.2H5.7c-.3 0-.5.2-.5.5v3.4c0 .3.2.5.5.5h21.4c.3 0 .5-.2.5-.5v-3.4c-.1-.3-.3-.5-.5-.5zM8.4 8.6H2.1c-.3 0-.5.2-.5.4v3.4c0 .3.2.5.5.5h6.3c.3 0 .5-.2.5-.5V9c0-.2-.2-.4-.5-.4zM13.8 8.6h-3.3c-.3 0-.5.2-.5.4v3.4c0 .3.2.5.5.5h3.3c.3 0 .5-.2.5-.5V9c-.1-.2-.3-.4-.5-.4zM5.4 3.3H2.1c-.3 0-.5.2-.5.5v3.4c0 .3.2.5.5.5h3.3c.3 0 .5-.2.5-.5V3.8c-.1-.3-.3-.5-.5-.5zM10.5 3.3H7.2c-.3 0-.5.2-.5.5v3.4c0 .3.2.5.5.5h3.3c.3 0 .5-.2.5-.5V3.8c-.1-.3-.3-.5-.5-.5zM15.5 3.3h-3.3c-.3 0-.5.2-.5.5v3.4c0 .3.2.5.5.5h3.3c.3 0 .5-.2.5-.5V3.8c0-.3-.2-.5-.5-.5zM20.6 3.3h-3.3c-.3 0-.5.2-.5.5v3.4c0 .3.2.5.5.5h3.3c.3 0 .5-.2.5-.5V3.8c0-.3-.2-.5-.5-.5zM25.7 3.3h-3.3c-.3 0-.5.2-.5.5v3.4c0 .3.2.5.5.5h3.3c.3 0 .5-.2.5-.5V3.8c0-.3-.2-.5-.5-.5zM30.8 3.3h-3.3c-.3 0-.5.2-.5.5v3.4c0 .3.2.5.5.5h3.3c.3 0 .5-.2.5-.5V3.8c0-.3-.2-.5-.5-.5zM18.9 8.6h-3.3c-.3 0-.5.2-.5.5v3.4c0 .3.2.5.5.5h3.3c.3 0 .5-.2.5-.5V9c-.1-.2-.3-.4-.5-.4zM23.9 8.6h-3.3c-.3 0-.5.2-.5.5v3.4c0 .3.2.5.5.5h3.3c.3 0 .5-.2.5-.5V9.1c0-.3-.2-.5-.5-.5zM30.7 8.6h-4.9c-.3 0-.5.2-.5.5v3.4c0 .3.2.5.5.5h4.9c.3 0 .5-.2.5-.5V9.1c0-.3-.2-.5-.5-.5z", fill: "#899a99" }), jsx$1("path", { d: "M27.1 13.7H5.7c-.3 0-.5.2-.5.5v3.4c0 .3.2.5.5.5h21.4c.3 0 .5-.2.5-.5v-3.4c-.1-.3-.3-.5-.5-.5zM8.4 8.1H2.1c-.3 0-.5.2-.5.5V12c0 .3.2.5.5.5h6.3c.3 0 .5-.2.5-.5V8.6c0-.3-.2-.5-.5-.5zM13.8 8.1h-3.3c-.3 0-.5.2-.5.5V12c0 .3.2.5.5.5h3.3c.3 0 .5-.2.5-.5V8.6c-.1-.3-.3-.5-.5-.5z", fill: "#eeeded" }), jsx$1("path", { d: "M5.4 2.8H2.1c-.3 0-.5.2-.5.5v3.4c0 .3.2.5.5.5h3.3c.3 0 .5-.2.5-.5V3.3c-.1-.3-.3-.5-.5-.5z", fill: "#e62944" }), jsx$1("path", { d: "M10.5 2.8H7.2c-.3 0-.5.2-.5.5v3.4c0 .3.2.5.5.5h3.3c.3 0 .5-.2.5-.5V3.3c-.1-.3-.3-.5-.5-.5zM15.5 2.8h-3.3c-.3 0-.5.2-.5.5v3.4c0 .3.2.5.5.5h3.3c.3 0 .5-.2.5-.5V3.3c0-.3-.2-.5-.5-.5zM20.6 2.8h-3.3c-.3 0-.5.2-.5.5v3.4c0 .3.2.5.5.5h3.3c.3 0 .5-.2.5-.5V3.3c0-.3-.2-.5-.5-.5zM25.7 2.8h-3.3c-.2 0-.4.2-.4.5v3.4c0 .3.2.5.5.5h3.3c.3 0 .5-.2.5-.5V3.3c-.1-.3-.3-.5-.6-.5zM30.8 2.8h-3.3c-.3 0-.5.2-.5.5v3.4c0 .3.2.5.5.5h3.3c.3 0 .5-.2.5-.5V3.3c0-.3-.2-.5-.5-.5zM18.9 8.1h-3.3c-.3 0-.5.2-.5.5V12c0 .3.2.5.5.5h3.3c.3 0 .5-.2.5-.5V8.6c-.1-.3-.3-.5-.5-.5zM23.9 8.1h-3.3c-.3 0-.5.2-.5.5V12c0 .3.2.5.5.5h3.3c.3 0 .5-.2.5-.5V8.6c0-.3-.2-.5-.5-.5zM30.7 8.1h-4.9c-.3 0-.5.2-.5.5V12c0 .3.2.5.5.5h4.9c.3 0 .5-.2.5-.5V8.6c0-.3-.2-.5-.5-.5z", fill: "#eeeded" })] }))),
|
|
@@ -4063,7 +4208,7 @@ var illustrations = {
|
|
|
4063
4208
|
};
|
|
4064
4209
|
var Illustration = function (props) { return (jsx$1(Wrapper$8, __assign$2({}, props, { children: illustrations[props.type] }))); };
|
|
4065
4210
|
|
|
4066
|
-
var StyledParagraph = styled.p(templateObject_1$
|
|
4211
|
+
var StyledParagraph = styled.p(templateObject_1$N || (templateObject_1$N = __makeTemplateObject$1(["\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n font-style: normal;\n line-height: ", ";\n color: ", ";\n margin: 0;\n text-align: ", ";\n text-transform: ", ";\n"], ["\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n font-style: normal;\n line-height: ", ";\n color: ", ";\n margin: 0;\n text-align: ", ";\n text-transform: ", ";\n"])), theme.fonts.paragraph, function (_a) {
|
|
4067
4212
|
var size = _a.size;
|
|
4068
4213
|
return size ? theme.paragraph[size].fontSize : theme.paragraph.medium.fontSize;
|
|
4069
4214
|
}, function (_a) {
|
|
@@ -4098,9 +4243,9 @@ var StyledParagraph = styled.p(templateObject_1$M || (templateObject_1$M = __mak
|
|
|
4098
4243
|
var transform = _a.transform;
|
|
4099
4244
|
return transform;
|
|
4100
4245
|
});
|
|
4101
|
-
var templateObject_1$
|
|
4246
|
+
var templateObject_1$N;
|
|
4102
4247
|
|
|
4103
|
-
var Container$
|
|
4248
|
+
var Container$n = styled.div(templateObject_1$M || (templateObject_1$M = __makeTemplateObject$1(["\n width: 100%;\n"], ["\n width: 100%;\n"])));
|
|
4104
4249
|
var InputIconWrapper = styled.div(templateObject_2$x || (templateObject_2$x = __makeTemplateObject$1(["\n position: relative;\n width: 100%;\n\n input {\n padding-right: 43px;\n }\n\n input[type=\"date\"] {\n color: ", ";\n }\n\n div {\n position: absolute;\n height: 24px;\n right: 12px;\n top: 14px;\n }\n\n svg {\n cursor: ", ";\n }\n"], ["\n position: relative;\n width: 100%;\n\n input {\n padding-right: 43px;\n }\n\n input[type=\"date\"] {\n color: ", ";\n }\n\n div {\n position: absolute;\n height: 24px;\n right: 12px;\n top: 14px;\n }\n\n svg {\n cursor: ", ";\n }\n"])), function (_a) {
|
|
4105
4250
|
var isChanged = _a.isChanged;
|
|
4106
4251
|
return !isChanged ? theme.colors.lightGray.darker : "";
|
|
@@ -4127,7 +4272,7 @@ var Helper = styled(StyledParagraph)(templateObject_6$3 || (templateObject_6$3 =
|
|
|
4127
4272
|
var isOk = _a.isOk;
|
|
4128
4273
|
return isOk ? theme.colors.green.base : theme.colors.darkGray.light;
|
|
4129
4274
|
}, fadeIn);
|
|
4130
|
-
var templateObject_1$
|
|
4275
|
+
var templateObject_1$M, templateObject_2$x, templateObject_3$b, templateObject_4$7, templateObject_5$3, templateObject_6$3;
|
|
4131
4276
|
|
|
4132
4277
|
var expressions = {};
|
|
4133
4278
|
|
|
@@ -4223,24 +4368,30 @@ __exportStar(isStrongPassword$1, exports);
|
|
|
4223
4368
|
}(expressions));
|
|
4224
4369
|
|
|
4225
4370
|
var password_helper_capital_letter = "Minimaal 1 hoofdletter";
|
|
4226
|
-
var password_helper_number = "Minimaal 1
|
|
4371
|
+
var password_helper_number = "Minimaal 1 cijfer";
|
|
4227
4372
|
var password_helper_special_character = "Minimaal 1 leesteken";
|
|
4228
4373
|
var password_helper_password_length = "Minimaal 8 karakters";
|
|
4374
|
+
var or = "of";
|
|
4229
4375
|
var nl_NL = {
|
|
4230
4376
|
password_helper_capital_letter: password_helper_capital_letter,
|
|
4231
4377
|
password_helper_number: password_helper_number,
|
|
4232
4378
|
password_helper_special_character: password_helper_special_character,
|
|
4233
|
-
password_helper_password_length: password_helper_password_length
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4379
|
+
password_helper_password_length: password_helper_password_length,
|
|
4380
|
+
"Drag file(s) here...": "Bestand(en) hierheen slepen...",
|
|
4381
|
+
or: or,
|
|
4382
|
+
"Select file(s)": "Bestand(en) kiezen",
|
|
4383
|
+
"Upload file(s)...": "Bestand(en) uploaden...",
|
|
4384
|
+
"File type not allowed": "Bestandstype niet toegestaan"
|
|
4385
|
+
};
|
|
4386
|
+
|
|
4387
|
+
var _a;
|
|
4388
|
+
// import en_GB from "./en-gb.json";
|
|
4389
|
+
// import fr_FR from "./fr-fr.json";
|
|
4390
|
+
// import de_DE from "./de-de.json";
|
|
4391
|
+
var translations = (_a = {},
|
|
4392
|
+
_a[enums.Locale.NL_NL] = nl_NL,
|
|
4393
|
+
_a[enums.Locale.NL_BE] = nl_NL,
|
|
4394
|
+
_a);
|
|
4244
4395
|
|
|
4245
4396
|
var PasswordInput = function (props) {
|
|
4246
4397
|
var _a = useState(props.defaultValue || ""), value = _a[0], setValue = _a[1];
|
|
@@ -4258,7 +4409,7 @@ var PasswordInput = function (props) {
|
|
|
4258
4409
|
if (props.onKeyPress)
|
|
4259
4410
|
props.onKeyPress(e);
|
|
4260
4411
|
};
|
|
4261
|
-
return (jsxs(Container$
|
|
4412
|
+
return (jsxs(Container$n, { children: [jsxs(InputIconWrapper, __assign$2({ disabled: props.disabled }, { children: [jsx$1(Icon, { type: isVisible ? "eyeInvisible" : "eye", color: "gray", size: "small", onClick: toggle }), jsx$1(StyledInput, __assign$2({ type: isVisible ? "text" : "password" }, props, { onChange: onChange, onKeyPress: onKeyPress }))] })), props.helperLocale && value.length ? (jsxs(HelperContainer, { children: [jsxs(Helper, __assign$2({ isOk: expressions.hasCapitalLetter(value) }, { children: ["\u2022 ", translations[props.helperLocale].password_helper_capital_letter] })), jsxs(Helper, __assign$2({ isOk: expressions.hasNumber(value) }, { children: ["\u2022 ", translations[props.helperLocale].password_helper_number] })), jsxs(Helper, __assign$2({ isOk: expressions.hasSpecialCharacter(value) }, { children: ["\u2022 ", translations[props.helperLocale].password_helper_special_character] })), jsxs(Helper, __assign$2({ isOk: value.length >= 8 }, { children: ["\u2022 ", translations[props.helperLocale].password_helper_password_length] }))] })) : null] }));
|
|
4262
4413
|
};
|
|
4263
4414
|
|
|
4264
4415
|
function requiredArgs(required, args) {
|
|
@@ -4592,7 +4743,7 @@ Input.Date = DateInput;
|
|
|
4592
4743
|
|
|
4593
4744
|
var Logo = function (props) { return (jsxs("svg", __assign$2({ width: 396, height: 66, viewBox: "0 0 662.8 118.1", fill: "none", xmlSpace: "preserve" }, props, { children: [jsxs("g", { children: [jsx$1("path", { d: "M61.6 23.5c-.4-.5-.9-1.1-1.3-1.5l-4.9-4.8L42 4c-1.3-1.3-2.8-2.3-4.5-3-1.7-.7-3.5-1-5.3-1-1.8 0-3.6.4-5.3 1-1.7.7-3.2 1.7-4.5 3L4.1 22C1.5 24.6 0 28 0 31.7c0 3.6 1.5 7.1 4.1 9.7l18.3 18c2.6 2.6 6.2 4 9.8 4 3.7 0 7.2-1.4 9.8-4l13.4-13.2-4.9-4.8c-.5-.5-.9-1-1.3-1.5L35.7 53.1c-.5.5-1 .8-1.6 1.1-.6.2-1.3.4-1.9.4-.7 0-1.3-.1-1.9-.4-.6-.2-1.2-.6-1.6-1.1l-18.3-18c-.9-.9-1.5-2.2-1.5-3.5 0-1.3.5-2.5 1.5-3.5l18.3-18c.5-.5 1-.8 1.6-1.1.6-.2 1.3-.4 1.9-.4.7 0 1.3.1 1.9.4.6.2 1.2.6 1.6 1.1l13.5 13.3 4.8 4.7c.5.4.8 1 1.1 1.6.2.6.4 1.2.4 1.9v.1c0 1.3.5 2.5 1.5 3.4l4.8 4.7c1.8-2.4 2.7-5.2 2.7-8.1-.1-3-1.1-5.8-2.9-8.2z", fill: "#e62743" }), jsx$1("path", { d: "M153.3 22L135 4c-1.3-1.3-2.8-2.3-4.5-3-1.7-.7-3.5-1-5.3-1-1.8 0-3.6.4-5.3 1-1.7.7-3.2 1.7-4.5 3L102 17.2 97.1 22c-.5.5-.9 1-1.3 1.5-1.8 2.4-2.8 5.2-2.8 8.2 0 2.9 1 5.8 2.7 8.1l4.8-4.7c.9-.9 1.4-2.1 1.5-3.4 0-.6.1-1.3.4-1.9.2-.6.6-1.1 1.1-1.6l4.8-4.7 13.5-13.3c.5-.5 1-.8 1.6-1.1.6-.2 1.2-.4 1.9-.4s1.3.1 1.9.4c.6.2 1.1.6 1.6 1.1l18.3 18c.5.5.8 1 1.1 1.6.3.6.4 1.2.4 1.9 0 .6-.1 1.3-.4 1.9-.3.6-.6 1.1-1.1 1.6l-18.3 18c-.5.5-1 .8-1.6 1.1-.6.2-1.2.4-1.9.4s-1.3-.1-1.9-.4c-.6-.2-1.1-.6-1.6-1.1l-13.5-13.3c-.4.5-.8 1.1-1.3 1.5l-4.9 4.8 13.4 13.2c1.3 1.3 2.8 2.3 4.5 3 1.7.7 3.5 1 5.3 1 1.8 0 3.6-.4 5.3-1 1.7-.7 3.2-1.7 4.5-3l18.3-18c1.3-1.3 2.3-2.8 3-4.5.7-1.7 1.1-3.5 1.1-5.3 0-1.8-.4-3.6-1.1-5.3-.8-1.5-1.8-3-3.1-4.3z", fill: "#53b476" }), jsx$1("path", { d: "M61.9 23.3l-.3.3c-.4-.5-.9-1.1-1.3-1.5l-4.9-4.8L68.8 4c1.3-1.3 2.8-2.3 4.5-3 1.7-.7 3.5-1 5.3-1s3.6.4 5.3 1c1.7.7 3.2 1.7 4.5 3l13.4 13.1-4.7 4.9c-.5.5-.9 1-1.3 1.5L82.2 10.2c-.5-.5-1-.8-1.6-1.1-.6-.2-1.3-.4-1.9-.4-.7 0-1.3.1-1.9.4-.6.2-1.2.6-1.6 1.1L61.9 23.3zm41.5 4.9l4.8-4.7c1.8 2.4 2.7 5.2 2.7 8.2 0 2.9-1 5.8-2.7 8.2-.4.5-.8 1.1-1.3 1.5l-4.9 4.8-13.5 13.2c-2.6 2.6-6.2 4-9.8 4s-7.2-1.4-9.8-4L55.4 46.1l-4.9-4.8c-.5-.5-.9-1-1.3-1.5-1.8-2.4-2.7-5.2-2.7-8.1 0-2.9 1-5.8 2.7-8.1l4.8 4.7c.5.4.8 1 1.1 1.6.2.6.4 1.2.4 1.9v.1c0 1.3.5 2.5 1.5 3.4l4.8 4.7 13.5 13.3c.5.5 1 .8 1.6 1.1s1.3.4 1.9.4 1.3-.1 1.9-.4 1.2-.6 1.6-1.1L95.8 40l4.8-4.7c.9-.9 1.4-2.1 1.5-3.4 0-.6.1-1.3.4-1.9 0-.8.4-1.3.9-1.8z", fillRule: "evenodd", clipRule: "evenodd", fill: "#ffd800" }), jsx$1("path", { d: "M130 76.6l-18.3-18c-2.6-2.6-6.2-4-9.8-4-3.7 0-7.2 1.4-9.8 4L78.7 71.9l-4.9 4.8c-.5.5-.9 1-1.3 1.5-1.8 2.4-2.7 5.2-2.7 8.1 0 2.9 1 5.8 2.7 8.1l4.8-4.7c.9-.9 1.4-2.1 1.5-3.4 0-1.3.5-2.5 1.5-3.4l4.8-4.7 13.5-13.3c.9-.9 2.2-1.4 3.5-1.4 1.3 0 2.6.5 3.5 1.4l18.3 18c.9.9 1.5 2.2 1.5 3.5 0 1.3-.5 2.5-1.5 3.5l-18.3 18c-.9.9-2.2 1.4-3.5 1.4-1.3 0-2.6-.5-3.5-1.4L84.9 94.5c-.4.6-.8 1.1-1.3 1.5l-4.9 4.8L92.1 114c2.6 2.6 6.2 4 9.8 4 3.7 0 7.2-1.4 9.8-4L130 96c1.3-1.3 2.3-2.8 3-4.5.7-1.7 1.1-3.5 1.1-5.3 0-1.8-.4-3.6-1.1-5.3-.6-1.5-1.7-3-3-4.3z", fill: "#8c5ca2" }), jsx$1("path", { d: "M84.9 78.2l-4.8 4.7c-.9.9-1.4 2.1-1.5 3.4 0 1.3-.5 2.5-1.5 3.4l-4.8 4.7-13.5 13.3c-.9.9-2.2 1.4-3.5 1.4s-2.6-.5-3.5-1.4l-18.3-18c-.9-.9-1.4-2.2-1.4-3.5s.5-2.5 1.4-3.5l18.3-18c.9-.9 2.2-1.4 3.5-1.4s2.6.5 3.5 1.4L72.3 78c.4-.5.8-1.1 1.3-1.5l4.9-4.8-13.3-13c-2.6-2.6-6.2-4-9.8-4-3.7 0-7.2 1.4-9.8 4l-18.3 18c-2.6 2.6-4.1 6.1-4.1 9.7s1.5 7.1 4.1 9.7l18.3 18c2.6 2.6 6.2 4 9.8 4 3.7 0 7.2-1.4 9.8-4l13.4-13.2 4.9-4.8c.5-.5.9-1 1.3-1.5 1.8-2.4 2.7-5.2 2.7-8.1.1-3.1-.9-5.9-2.6-8.3z", fill: "#3da9e1" })] }), jsxs("g", __assign$2({ fill: "#23292f" }, { children: [jsx$1("path", { d: "M236.6 21.5c-1.1-1-2.4-1.5-3.9-1.5h-40.2c-1.6 0-2.9.5-3.9 1.4-1.1.9-1.6 2.2-1.6 3.8 0 1.6.5 2.8 1.6 3.8s2.4 1.5 3.9 1.5h14.2V78c0 1.6.5 2.9 1.6 3.9 1.1 1.1 2.5 1.6 4.2 1.6 1.8 0 3.2-.5 4.3-1.6 1.1-1.1 1.7-2.4 1.7-3.9V30.4h14.2c1.6 0 2.9-.5 3.9-1.4 1.1-.9 1.6-2.2 1.6-3.8 0-1.5-.5-2.8-1.6-3.7z" }), jsx$1("path", { d: "M270.6 36.6c-1-1.1-2.3-1.6-3.9-1.6s-2.9.5-3.9 1.6-1.5 2.4-1.5 3.9v23.2c0 2.3-.4 4.2-1.2 5.8-.8 1.6-1.9 2.8-3.4 3.6-1.5.8-3.2 1.2-5.3 1.2-3.1 0-5.5-.8-7.2-2.4-1.7-1.6-2.6-4.4-2.6-8.3V40.5c0-1.6-.5-2.9-1.5-3.9-1-1.1-2.3-1.6-3.9-1.6s-2.9.5-3.9 1.6-1.5 2.4-1.5 3.9V67c0 3.4.7 6.4 2 9 1.3 2.6 3.2 4.7 5.6 6.2 2.4 1.5 5.2 2.2 8.4 2.2 2.7 0 5.1-.3 7.3-1 2.1-.7 3.9-1.6 5.5-2.9.7-.6 1.3-1.3 1.9-2v1c0 3.1-.5 5.5-1.4 7.3-.9 1.8-2.3 3.1-4.2 3.8-1.8.8-4.2 1.1-6.9 1.1-2.1 0-3.9-.3-5.4-1-1.6-.6-2.8-1.1-3.8-1.4-1.3-.5-2.6-.4-3.8.2-1.2.6-2.1 1.8-2.6 3.6-.4 1.3-.3 2.6.4 3.8.7 1.2 1.9 2.2 3.8 2.9 1.4.6 3.2 1.1 5.3 1.4 2.2.3 4.2.5 6.2.5 4.4 0 8.3-.7 11.8-2.2 3.5-1.4 6.3-3.8 8.4-7.1 2.1-3.3 3.1-7.7 3.1-13.3V40.5c-.3-1.6-.8-2.9-1.8-3.9zM327.5 46.1c-2-3.7-4.6-6.7-8-8.8-3.4-2.1-7.1-3.2-11.4-3.2-2.1 0-4.1.4-6 1.1-1.9.7-3.6 1.6-5 2.8-1.3 1-2.4 2-3.2 3.1v-.5c0-1.6-.5-2.9-1.5-3.9-1-1.1-2.3-1.6-3.9-1.6s-2.9.5-3.9 1.6-1.5 2.4-1.5 3.9v55.6c0 1.6.5 3 1.5 4s2.3 1.5 3.9 1.5 2.9-.5 3.9-1.6 1.5-2.4 1.5-3.9V78.3c.6.6 1.4 1.3 2.2 1.9 1.6 1.2 3.5 2.2 5.6 3 2.1.8 4.4 1.2 6.8 1.2 4.1 0 7.8-1.1 11.1-3.2s5.9-5.1 7.9-8.9c2-3.8 2.9-8.1 2.9-13.1s-1-9.3-2.9-13.1zm-9.2 20.8c-1.1 2.3-2.7 4.2-4.6 5.5-2 1.3-4.3 2-6.9 2s-5-.7-7-2-3.6-3.2-4.7-5.5-1.7-4.9-1.7-7.8c0-2.9.6-5.5 1.7-7.8s2.7-4.1 4.7-5.4c2-1.3 4.3-2 7-2s5 .7 6.9 2c2 1.3 3.5 3.1 4.6 5.4 1.1 2.3 1.7 4.8 1.7 7.8 0 2.9-.6 5.5-1.7 7.8zM380.4 61.6c1.1-.9 1.7-2.1 1.7-3.5 0-3.3-.6-6.3-1.9-9.2-1.2-2.9-2.9-5.5-5-7.7s-4.5-3.9-7.3-5.2c-2.8-1.3-5.7-1.9-8.7-1.9-4 0-7.8 1-11.3 3.1-3.6 2.1-6.5 5-8.7 8.8-2.2 3.8-3.3 8.5-3.3 13.9 0 4.7 1 8.8 3 12.5 2 3.7 4.9 6.6 8.7 8.7 3.8 2.1 8.2 3.2 13.4 3.2 3 0 6-.5 8.8-1.5 2.8-1 5-2.2 6.6-3.5 1.7-1.3 2.5-2.8 2.5-4.4 0-1.2-.4-2.3-1.3-3.2-.9-.9-2-1.4-3.3-1.4-1 0-2 .3-3.1.8-.7.4-1.4.8-2.2 1.3-.8.5-1.9 1-3.2 1.3-1.3.4-3.1.5-5.3.5-2.4 0-4.7-.6-6.8-1.8-2.1-1.2-3.9-2.9-5.3-5.2-.8-1.3-1.3-2.8-1.7-4.5h29.9c1.4.3 2.7-.2 3.8-1.1zM350 47.2c1.1-1.1 2.5-2 4.1-2.4 1.6-.5 3.3-.7 5.1-.7 1.9 0 3.6.4 5.3 1.2 1.7.8 3.1 1.9 4.2 3.3s1.7 3 1.9 4.7v.6h-23.7c.1-.7.3-1.5.5-2.1.5-1.9 1.5-3.4 2.6-4.6zM447.3 39.1c-1.5-3.9-3.6-7.4-6.4-10.4-2.8-3-6-5.3-9.8-7-3.8-1.7-7.9-2.5-12.4-2.5s-8.6.8-12.3 2.5c-3.7 1.7-7 4-9.7 7-2.8 3-4.9 6.5-6.4 10.4-1.5 3.9-2.3 8.2-2.3 12.7s.8 8.8 2.3 12.7c1.5 3.9 3.6 7.4 6.4 10.4 2.7 3 6 5.3 9.7 7 3.7 1.7 7.9 2.5 12.3 2.5 4.5 0 8.6-.8 12.4-2.5 3.8-1.7 7-4 9.8-7 2.8-3 4.9-6.5 6.4-10.4 1.5-3.9 2.3-8.2 2.3-12.7-.1-4.6-.8-8.8-2.3-12.7zm-12 23.7c-1.6 3.3-3.9 5.9-6.7 7.8-2.8 1.9-6.1 2.9-9.9 2.9-3.7 0-7-1-9.9-2.9-2.8-1.9-5.1-4.5-6.7-7.8-1.6-3.3-2.4-7-2.4-11 0-4.1.8-7.8 2.4-11.1 1.6-3.3 3.8-5.9 6.7-7.8 2.8-1.9 6.1-2.9 9.9-2.9 3.7 0 7 1 9.9 2.9 2.8 1.9 5.1 4.5 6.7 7.8 1.6 3.3 2.4 7 2.4 11 .1 4.1-.8 7.8-2.4 11.1zM468.4 18c-1-1.1-2.3-1.6-3.9-1.6s-2.9.5-3.9 1.6c-1.1 1.1-1.6 2.4-1.6 3.9v56c0 1.6.5 2.9 1.5 3.9 1 1.1 2.3 1.6 3.8 1.6 1.6 0 2.9-.5 3.9-1.6 1.1-1.1 1.6-2.4 1.6-3.9v-56c.1-1.5-.4-2.9-1.4-3.9zM520.2 36.6c-1-1.1-2.3-1.6-3.9-1.6s-2.9.5-3.9 1.6-1.5 2.4-1.5 3.9v23.2c0 2.3-.4 4.2-1.2 5.8-.8 1.6-1.9 2.8-3.4 3.6-1.4.8-3.2 1.2-5.3 1.2-3.1 0-5.5-.8-7.2-2.4-1.7-1.6-2.6-4.4-2.6-8.3V40.5c0-1.6-.5-2.9-1.5-3.9-1-1.1-2.3-1.6-3.9-1.6s-2.9.5-3.9 1.6-1.5 2.4-1.5 3.9V67c0 3.4.7 6.4 2 9 1.3 2.6 3.2 4.7 5.6 6.2 2.4 1.5 5.2 2.2 8.4 2.2 2.7 0 5.1-.3 7.3-1 2.1-.7 3.9-1.6 5.5-2.9.7-.6 1.3-1.3 1.9-2v1c0 3.1-.5 5.5-1.4 7.3-.9 1.8-2.3 3.1-4.2 3.8-1.8.8-4.2 1.1-6.9 1.1-2.1 0-3.9-.3-5.4-1-1.6-.6-2.8-1.1-3.8-1.4-1.3-.5-2.6-.4-3.8.2-1.2.6-2.1 1.8-2.6 3.6-.4 1.3-.3 2.6.4 3.8.7 1.2 1.9 2.2 3.8 2.9 1.4.6 3.2 1.1 5.3 1.4 2.2.3 4.2.5 6.2.5 4.4 0 8.3-.7 11.8-2.2 3.5-1.4 6.3-3.8 8.4-7.1 2.1-3.3 3.1-7.7 3.1-13.3V40.5c-.2-1.6-.7-2.9-1.8-3.9zM603.2 44.4c-.8-3.1-2.4-5.6-4.7-7.5s-5.6-2.8-9.9-2.8c-2.7 0-5.1.6-7.2 1.7-2.1 1.1-4 2.5-5.5 4.1-1.4 1.5-2.5 2.9-3.2 4.2-.8-2.6-2.1-4.7-3.9-6.5-2.3-2.3-5.9-3.5-10.7-3.5-2 0-3.8.3-5.5 1-1.7.6-3.2 1.5-4.6 2.5-1.4 1-2.6 2.1-3.5 3.3l-.9 1.2v-1.5c0-1.6-.5-2.9-1.5-3.9-1-1.1-2.3-1.6-3.9-1.6s-2.9.5-3.9 1.6-1.5 2.4-1.5 3.9V78c0 1.6.5 2.9 1.5 3.9 1 1.1 2.3 1.6 3.9 1.6s2.9-.5 3.9-1.6 1.5-2.4 1.5-3.9V54.7c0-2 .4-3.8 1.2-5.4.8-1.6 2-2.9 3.7-3.9 1.6-1 3.6-1.4 5.9-1.4 2.4 0 4.2.5 5.4 1.4 1.3 1 2.1 2.3 2.6 3.9s.7 3.4.7 5.4v23.2c0 1.6.5 2.9 1.5 3.9 1 1.1 2.3 1.6 3.9 1.6s2.9-.5 3.9-1.6 1.5-2.4 1.5-3.9V54.7c0-2 .4-3.8 1.2-5.4.8-1.6 2-2.9 3.7-3.9 1.6-1 3.6-1.4 5.9-1.4 2.4 0 4.2.5 5.4 1.4 1.3 1 2.1 2.3 2.6 3.9s.7 3.4.7 5.4v23.2c0 1.6.5 2.9 1.5 3.9 1 1.1 2.3 1.6 3.9 1.6s2.9-.5 3.9-1.6 1.5-2.4 1.5-3.9V54.7c.3-3.8-.2-7.2-1-10.3zM659.8 46.1c-2-3.7-4.6-6.7-8-8.8-3.4-2.1-7.1-3.2-11.4-3.2-2.1 0-4.1.4-6 1.1-1.9.7-3.6 1.6-5 2.8-1.3 1-2.4 2-3.2 3.1v-.5c0-1.6-.5-2.9-1.5-3.9-1-1.1-2.3-1.6-3.9-1.6s-2.9.5-3.9 1.6-1.5 2.4-1.5 3.9v55.6c0 1.6.5 3 1.5 4s2.3 1.5 3.9 1.5 2.9-.5 3.9-1.6 1.5-2.4 1.5-3.9V78.3c.6.6 1.4 1.3 2.2 1.9 1.6 1.2 3.5 2.2 5.6 3s4.4 1.2 6.8 1.2c4.1 0 7.8-1.1 11.1-3.2s5.9-5.1 7.9-8.9c2-3.8 2.9-8.1 2.9-13.1.1-5-.9-9.3-2.9-13.1zm-9.1 20.8c-1.1 2.3-2.7 4.2-4.6 5.5-2 1.3-4.3 2-6.9 2s-5-.7-7-2-3.5-3.2-4.7-5.5c-1.1-2.3-1.7-4.9-1.7-7.8 0-2.9.6-5.5 1.7-7.8s2.7-4.1 4.7-5.4c2-1.3 4.3-2 7-2s5 .7 6.9 2c2 1.3 3.5 3.1 4.6 5.4 1.1 2.3 1.7 4.8 1.7 7.8-.1 2.9-.6 5.5-1.7 7.8z" })] }))] }))); };
|
|
4594
4745
|
|
|
4595
|
-
var Wrapper$7 = styled.div(templateObject_1$
|
|
4746
|
+
var Wrapper$7 = styled.div(templateObject_1$L || (templateObject_1$L = __makeTemplateObject$1(["\n width: ", ";\n"], ["\n width: ", ";\n"])), function (_a) {
|
|
4596
4747
|
var size = _a.size;
|
|
4597
4748
|
switch (size) {
|
|
4598
4749
|
default:
|
|
@@ -4602,7 +4753,7 @@ var Wrapper$7 = styled.div(templateObject_1$K || (templateObject_1$K = __makeTem
|
|
|
4602
4753
|
return "116px";
|
|
4603
4754
|
}
|
|
4604
4755
|
});
|
|
4605
|
-
var templateObject_1$
|
|
4756
|
+
var templateObject_1$L;
|
|
4606
4757
|
|
|
4607
4758
|
var medals = {
|
|
4608
4759
|
small: {
|
|
@@ -4618,7 +4769,7 @@ var medals = {
|
|
|
4618
4769
|
};
|
|
4619
4770
|
var Medal = function (props) { return (jsx$1(Wrapper$7, __assign$2({}, props, { children: medals[props.size || "small"][props.type] }))); };
|
|
4620
4771
|
|
|
4621
|
-
var Wrapper$6 = styled.div(templateObject_1$
|
|
4772
|
+
var Wrapper$6 = styled.div(templateObject_1$K || (templateObject_1$K = __makeTemplateObject$1(["\n width: fit-content;\n display: flex;\n\n button:first-child {\n border-radius: 6px 0 0 6px;\n border-width: 2px 1px 2px 2px;\n }\n\n button:last-child {\n border-radius: 0 6px 6px 0;\n border-width: 2px 2px 2px 1px;\n }\n\n button {\n width: ", ";\n }\n"], ["\n width: fit-content;\n display: flex;\n\n button:first-child {\n border-radius: 6px 0 0 6px;\n border-width: 2px 1px 2px 2px;\n }\n\n button:last-child {\n border-radius: 0 6px 6px 0;\n border-width: 2px 2px 2px 1px;\n }\n\n button {\n width: ", ";\n }\n"])), function (_a) {
|
|
4622
4773
|
var disabled = _a.disabled;
|
|
4623
4774
|
return (disabled ? "49.5px" : "");
|
|
4624
4775
|
});
|
|
@@ -4635,7 +4786,7 @@ var StyledInputNumber = styled.input(templateObject_2$w || (templateObject_2$w =
|
|
|
4635
4786
|
var disabled = _a.disabled;
|
|
4636
4787
|
return disabled ? theme.colors.darkGray.light : theme.colors.darkGray.base;
|
|
4637
4788
|
}, theme.colors.blue.dark, "0 0 0 1px ".concat(theme.colors.blue.dark));
|
|
4638
|
-
var templateObject_1$
|
|
4789
|
+
var templateObject_1$K, templateObject_2$w;
|
|
4639
4790
|
|
|
4640
4791
|
var Number$1 = function (props) {
|
|
4641
4792
|
var inputRef = useRef(null);
|
|
@@ -4674,7 +4825,7 @@ var Number$1 = function (props) {
|
|
|
4674
4825
|
|
|
4675
4826
|
var Paragraph = function (props) { return (jsx$1(StyledParagraph, __assign$2({}, props, { children: props.children }))); };
|
|
4676
4827
|
|
|
4677
|
-
var StyledRadio = styled.div(templateObject_1$
|
|
4828
|
+
var StyledRadio = styled.div(templateObject_1$J || (templateObject_1$J = __makeTemplateObject$1(["\n min-height: 25px;\n max-height: 25px;\n min-width: 25px;\n max-width: 25px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 14px;\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n cursor: ", ";\n background-color: ", ";\n\n svg {\n margin-left: -1px;\n fill: ", ";\n }\n\n input {\n display: none;\n }\n\n :after {\n content: \"\";\n width: 15px;\n height: 15px;\n border-radius: 50%;\n background-color: ", ";\n position: absolute;\n }\n\n :focus {\n outline: 0;\n border-color: ", ";\n box-shadow: ", ";\n }\n"], ["\n min-height: 25px;\n max-height: 25px;\n min-width: 25px;\n max-width: 25px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 14px;\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n cursor: ", ";\n background-color: ", ";\n\n svg {\n margin-left: -1px;\n fill: ", ";\n }\n\n input {\n display: none;\n }\n\n :after {\n content: \"\";\n width: 15px;\n height: 15px;\n border-radius: 50%;\n background-color: ", ";\n position: absolute;\n }\n\n :focus {\n outline: 0;\n border-color: ", ";\n box-shadow: ", ";\n }\n"])), function (_a) {
|
|
4678
4829
|
var checked = _a.checked, disabled = _a.disabled;
|
|
4679
4830
|
if (disabled)
|
|
4680
4831
|
return theme.colors.lightGray.darker;
|
|
@@ -4702,7 +4853,7 @@ var StyledRadio = styled.div(templateObject_1$I || (templateObject_1$I = __makeT
|
|
|
4702
4853
|
return theme.colors.green.base;
|
|
4703
4854
|
return "";
|
|
4704
4855
|
}, theme.colors.blue.dark, "0 0 0 1px ".concat(theme.colors.blue.dark));
|
|
4705
|
-
var templateObject_1$
|
|
4856
|
+
var templateObject_1$J;
|
|
4706
4857
|
|
|
4707
4858
|
var Radio = function (props) {
|
|
4708
4859
|
var _a, _b;
|
|
@@ -4734,7 +4885,7 @@ var Radio = function (props) {
|
|
|
4734
4885
|
return (jsx$1(StyledRadio, __assign$2({ checked: checked, disabled: props.disabled, tabIndex: 0, onClick: toggle, onBlur: props.onBlur, onKeyPress: function (e) { return (e.key === "Enter" ? toggle() : null); }, ref: wrapperRef }, { children: jsx$1("input", { type: "radio", disabled: !!props.disabled, id: props.id, name: props.name, value: props.value, ref: inputRef }) })));
|
|
4735
4886
|
};
|
|
4736
4887
|
|
|
4737
|
-
var StyledRange = styled.div(templateObject_1$
|
|
4888
|
+
var StyledRange = styled.div(templateObject_1$I || (templateObject_1$I = __makeTemplateObject$1(["\n input {\n appearance: none;\n width: 100%;\n height: 11px;\n border: ", ";\n border-radius: 8px;\n position: relative;\n background: ", ";\n\n ::-webkit-slider-thumb {\n appearance: none;\n width: 24px;\n height: 24px;\n background-color: ", ";\n border: ", ";\n border-radius: 50%;\n cursor: ", ";\n }\n }\n"], ["\n input {\n appearance: none;\n width: 100%;\n height: 11px;\n border: ", ";\n border-radius: 8px;\n position: relative;\n background: ", ";\n\n ::-webkit-slider-thumb {\n appearance: none;\n width: 24px;\n height: 24px;\n background-color: ", ";\n border: ", ";\n border-radius: 50%;\n cursor: ", ";\n }\n }\n"])), function () { return "2px solid ".concat(theme.colors.lightGray.dark); }, function (_a) {
|
|
4738
4889
|
var value = _a.value, disabled = _a.disabled;
|
|
4739
4890
|
return "linear-gradient(90deg,\n ".concat(disabled ? theme.colors.lightGray.darker : theme.colors.green.base, " 0%,\n ").concat(disabled ? theme.colors.lightGray.darker : theme.colors.green.base, " ").concat(value, "%,\n ").concat(theme.colors.lightGray.dark, " ").concat(value, "%,\n ").concat(theme.colors.lightGray.dark, " 100%\n )");
|
|
4740
4891
|
}, function () { return theme.colors.lightGray.light; }, function (_a) {
|
|
@@ -4744,7 +4895,7 @@ var StyledRange = styled.div(templateObject_1$H || (templateObject_1$H = __makeT
|
|
|
4744
4895
|
var disabled = _a.disabled;
|
|
4745
4896
|
return disabled ? "not-allowed" : "pointer";
|
|
4746
4897
|
});
|
|
4747
|
-
var templateObject_1$
|
|
4898
|
+
var templateObject_1$I;
|
|
4748
4899
|
|
|
4749
4900
|
var Range = function (props) {
|
|
4750
4901
|
var _a;
|
|
@@ -4773,7 +4924,7 @@ var Range = function (props) {
|
|
|
4773
4924
|
return (jsx$1(StyledRange, __assign$2({ value: value, disabled: props.disabled }, { children: jsx$1("input", { type: "range", disabled: !!props.disabled, id: props.id, min: props.min || 0, max: props.max || 100, ref: rangeRef, defaultValue: props.defaultValue, onChange: onChange, onBlur: props.onBlur }) })));
|
|
4774
4925
|
};
|
|
4775
4926
|
|
|
4776
|
-
var Wrapper$5 = styled.div(templateObject_1$
|
|
4927
|
+
var Wrapper$5 = styled.div(templateObject_1$H || (templateObject_1$H = __makeTemplateObject$1(["\n position: relative;\n\n div {\n pointer-events: none;\n position: absolute;\n height: 24px;\n right: 12px;\n top: 14px;\n }\n\n svg {\n cursor: ", ";\n }\n"], ["\n position: relative;\n\n div {\n pointer-events: none;\n position: absolute;\n height: 24px;\n right: 12px;\n top: 14px;\n }\n\n svg {\n cursor: ", ";\n }\n"])), function (_a) {
|
|
4777
4928
|
var disabled = _a.disabled;
|
|
4778
4929
|
return (disabled ? "not-allowed" : "pointer");
|
|
4779
4930
|
});
|
|
@@ -4790,7 +4941,7 @@ var StyledSelect = styled.select(templateObject_2$v || (templateObject_2$v = __m
|
|
|
4790
4941
|
var isChanged = _a.isChanged;
|
|
4791
4942
|
return isChanged ? theme.colors.darkGray.base : theme.colors.lightGray.darker;
|
|
4792
4943
|
}, theme.colors.blue.dark, "0 0 0 1px ".concat(theme.colors.blue.dark));
|
|
4793
|
-
var templateObject_1$
|
|
4944
|
+
var templateObject_1$H, templateObject_2$v;
|
|
4794
4945
|
|
|
4795
4946
|
var Select = function (props) {
|
|
4796
4947
|
var _a;
|
|
@@ -4812,18 +4963,18 @@ var Select = function (props) {
|
|
|
4812
4963
|
return (jsxs(Wrapper$5, { children: [jsx$1(Icon, { type: "chevronDown", color: "gray", size: "small" }), jsxs(StyledSelect, __assign$2({}, props, { onChange: onChange, isChanged: isChanged || props.defaultValue, ref: inputRef }, { children: [props.placeholder && jsx$1("option", __assign$2({ hidden: true }, { children: props.placeholder })), props.children] }))] }));
|
|
4813
4964
|
};
|
|
4814
4965
|
|
|
4815
|
-
var StyledSpacer = styled.div(templateObject_1$
|
|
4966
|
+
var StyledSpacer = styled.div(templateObject_1$G || (templateObject_1$G = __makeTemplateObject$1(["\n width: ", ";\n height: ", ";\n"], ["\n width: ", ";\n height: ", ";\n"])), function (_a) {
|
|
4816
4967
|
var horizontal = _a.horizontal;
|
|
4817
4968
|
return (horizontal ? "".concat(horizontal, "px") : "");
|
|
4818
4969
|
}, function (_a) {
|
|
4819
4970
|
var vertical = _a.vertical;
|
|
4820
4971
|
return (vertical ? "".concat(vertical, "px") : "");
|
|
4821
4972
|
});
|
|
4822
|
-
var templateObject_1$
|
|
4973
|
+
var templateObject_1$G;
|
|
4823
4974
|
|
|
4824
4975
|
var Spacer = function (props) { return (jsx$1(StyledSpacer, __assign$2({}, props))); };
|
|
4825
4976
|
|
|
4826
|
-
var StyledSubheading = styled.p(templateObject_1$
|
|
4977
|
+
var StyledSubheading = styled.p(templateObject_1$F || (templateObject_1$F = __makeTemplateObject$1(["\n font-family: ", ";\n font-style: normal;\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n text-align: ", ";\n margin: 0;\n color: ", ";\n"], ["\n font-family: ", ";\n font-style: normal;\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n text-align: ", ";\n margin: 0;\n color: ", ";\n"])), theme.fonts.paragraph, function (_a) {
|
|
4827
4978
|
var size = _a.size;
|
|
4828
4979
|
return size ? theme.subheading[size].fontSize : theme.subheading.medium.fontSize;
|
|
4829
4980
|
}, function (_a) {
|
|
@@ -4851,18 +5002,18 @@ var StyledSubheading = styled.p(templateObject_1$E || (templateObject_1$E = __ma
|
|
|
4851
5002
|
return theme.colors.darkGray.dark;
|
|
4852
5003
|
}
|
|
4853
5004
|
});
|
|
4854
|
-
var templateObject_1$
|
|
5005
|
+
var templateObject_1$F;
|
|
4855
5006
|
|
|
4856
5007
|
var Subheading = function (props) { return (jsx$1(StyledSubheading, __assign$2({}, props, { children: props.children }))); };
|
|
4857
5008
|
|
|
4858
|
-
var Container$
|
|
4859
|
-
var templateObject_1$
|
|
5009
|
+
var Container$m = styled.div(templateObject_1$E || (templateObject_1$E = __makeTemplateObject$1(["\n padding: 7px 10px;\n background-color: ", ";\n box-shadow: 0 2px 0 ", ";\n border: 1px solid ", ";\n border-radius: 4px;\n box-sizing: border-box;\n text-decoration: none;\n\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n font-style: normal;\n color: ", ";\n"], ["\n padding: 7px 10px;\n background-color: ", ";\n box-shadow: 0 2px 0 ", ";\n border: 1px solid ", ";\n border-radius: 4px;\n box-sizing: border-box;\n text-decoration: none;\n\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n font-style: normal;\n color: ", ";\n"])), theme.colors.lightGray.base, theme.colors.lightGray.darker, theme.colors.lightGray.darker, theme.fonts.paragraph, theme.subheading.small.fontSize, theme.subheading.small.fontWeight, theme.colors.darkGray.light);
|
|
5010
|
+
var templateObject_1$E;
|
|
4860
5011
|
|
|
4861
5012
|
var Tag = function (props) {
|
|
4862
|
-
return jsx$1(Container$
|
|
5013
|
+
return jsx$1(Container$m, { children: props.children });
|
|
4863
5014
|
};
|
|
4864
5015
|
|
|
4865
|
-
var Container$
|
|
5016
|
+
var Container$l = styled.div(templateObject_1$D || (templateObject_1$D = __makeTemplateObject$1(["\n width: 46px;\n min-width: 46px;\n max-width: 46px;\n height: 27px;\n min-height: 27px;\n max-height: 27px;\n border-radius: 14px;\n cursor: ", ";\n position: relative;\n background-color: ", ";\n\n :after {\n content: \"\";\n width: 21px;\n height: 21px;\n border-radius: 50%;\n position: absolute;\n top: 3px;\n right: ", ";\n left: ", ";\n background-color: ", ";\n }\n\n input {\n display: none;\n }\n\n :focus {\n outline: 0;\n border-color: ", ";\n box-shadow: ", ";\n }\n"], ["\n width: 46px;\n min-width: 46px;\n max-width: 46px;\n height: 27px;\n min-height: 27px;\n max-height: 27px;\n border-radius: 14px;\n cursor: ", ";\n position: relative;\n background-color: ", ";\n\n :after {\n content: \"\";\n width: 21px;\n height: 21px;\n border-radius: 50%;\n position: absolute;\n top: 3px;\n right: ", ";\n left: ", ";\n background-color: ", ";\n }\n\n input {\n display: none;\n }\n\n :focus {\n outline: 0;\n border-color: ", ";\n box-shadow: ", ";\n }\n"])), function (_a) {
|
|
4866
5017
|
var disabled = _a.disabled;
|
|
4867
5018
|
return (disabled ? "not-allowed" : "pointer");
|
|
4868
5019
|
}, function (_a) {
|
|
@@ -4880,7 +5031,7 @@ var Container$k = styled.div(templateObject_1$C || (templateObject_1$C = __makeT
|
|
|
4880
5031
|
var disabled = _a.disabled;
|
|
4881
5032
|
return disabled ? theme.colors.lightGray.darker : theme.colors.lightGray.light;
|
|
4882
5033
|
}, theme.colors.blue.dark, "0 0 0 1px ".concat(theme.colors.blue.dark));
|
|
4883
|
-
var templateObject_1$
|
|
5034
|
+
var templateObject_1$D;
|
|
4884
5035
|
|
|
4885
5036
|
var Toggle = function (props) {
|
|
4886
5037
|
var _a;
|
|
@@ -4908,10 +5059,10 @@ var Toggle = function (props) {
|
|
|
4908
5059
|
props.onChange(newValue);
|
|
4909
5060
|
}
|
|
4910
5061
|
};
|
|
4911
|
-
return (jsx$1(Container$
|
|
5062
|
+
return (jsx$1(Container$l, __assign$2({ checked: checked, disabled: props.disabled, tabIndex: 0, onClick: toggle, onBlur: props.onBlur, onKeyPress: function (e) { return (e.key === "Enter" ? toggle() : null); }, ref: containerRef }, { children: jsx$1("input", { type: "checkbox", disabled: !!props.disabled, id: props.id, name: props.name, ref: inputRef }) })));
|
|
4912
5063
|
};
|
|
4913
5064
|
|
|
4914
|
-
var Wrapper$4 = styled.div(templateObject_1$
|
|
5065
|
+
var Wrapper$4 = styled.div(templateObject_1$C || (templateObject_1$C = __makeTemplateObject$1(["\n display: flex;\n align-items: flex-end;\n\n > svg {\n height: ", ";\n }\n"], ["\n display: flex;\n align-items: flex-end;\n\n > svg {\n height: ", ";\n }\n"])), function (_a) {
|
|
4915
5066
|
var level = _a.level;
|
|
4916
5067
|
switch (level) {
|
|
4917
5068
|
case 1:
|
|
@@ -4922,7 +5073,7 @@ var Wrapper$4 = styled.div(templateObject_1$B || (templateObject_1$B = __makeTem
|
|
|
4922
5073
|
return "70px";
|
|
4923
5074
|
}
|
|
4924
5075
|
});
|
|
4925
|
-
var templateObject_1$
|
|
5076
|
+
var templateObject_1$C;
|
|
4926
5077
|
|
|
4927
5078
|
var trophies = {
|
|
4928
5079
|
1: {
|
|
@@ -4958,7 +5109,7 @@ var trophies = {
|
|
|
4958
5109
|
};
|
|
4959
5110
|
var Trophy = function (props) { return (jsx$1(Wrapper$4, __assign$2({}, props, { children: trophies[props.variant][props.level] }))); };
|
|
4960
5111
|
|
|
4961
|
-
var Container$
|
|
5112
|
+
var Container$k = styled.div(templateObject_1$B || (templateObject_1$B = __makeTemplateObject$1(["\n min-height: 44px;\n padding: 10px;\n background-color: ", ";\n box-sizing: border-box;\n border-radius: 4px;\n display: flex;\n align-items: center;\n gap: 10px;\n\n > div:first-child {\n min-width: 24px;\n min-height: 24px;\n }\n\n p {\n color: ", ";\n }\n"], ["\n min-height: 44px;\n padding: 10px;\n background-color: ", ";\n box-sizing: border-box;\n border-radius: 4px;\n display: flex;\n align-items: center;\n gap: 10px;\n\n > div:first-child {\n min-width: 24px;\n min-height: 24px;\n }\n\n p {\n color: ", ";\n }\n"])), function (_a) {
|
|
4962
5113
|
var type = _a.type;
|
|
4963
5114
|
switch (type) {
|
|
4964
5115
|
case "success":
|
|
@@ -4975,11 +5126,11 @@ var Container$j = styled.div(templateObject_1$A || (templateObject_1$A = __makeT
|
|
|
4975
5126
|
return theme.colors.red.base;
|
|
4976
5127
|
}
|
|
4977
5128
|
});
|
|
4978
|
-
var templateObject_1$
|
|
5129
|
+
var templateObject_1$B;
|
|
4979
5130
|
|
|
4980
|
-
var Alert = function (props) { return (jsxs(Container$
|
|
5131
|
+
var Alert = function (props) { return (jsxs(Container$k, __assign$2({}, props, { children: [jsx$1(Icon, { size: "small", type: props.type === "success" ? "check" : "warning", color: props.type === "success" ? "green" : "red" }), jsx$1(Paragraph, { children: props.message })] }))); };
|
|
4981
5132
|
|
|
4982
|
-
var StyledCard = styled.div(templateObject_1$
|
|
5133
|
+
var StyledCard = styled.div(templateObject_1$A || (templateObject_1$A = __makeTemplateObject$1(["\n background-color: ", ";\n border: ", ";\n box-shadow: 0px 4px 0px rgba(0, 0, 0, 20%);\n border-radius: 6px;\n overflow: hidden;\n position: relative;\n\n ", "\n"], ["\n background-color: ", ";\n border: ", ";\n box-shadow: 0px 4px 0px rgba(0, 0, 0, 20%);\n border-radius: 6px;\n overflow: hidden;\n position: relative;\n\n ", "\n"])), theme.colors.lightGray.light, function (_a) {
|
|
4983
5134
|
var bordered = _a.bordered;
|
|
4984
5135
|
return bordered ? "1px solid ".concat(theme.colors.lightGray.dark) : "none";
|
|
4985
5136
|
}, function (_a) {
|
|
@@ -4996,7 +5147,7 @@ var Ellipse = styled.div(templateObject_2$u || (templateObject_2$u = __makeTempl
|
|
|
4996
5147
|
return color ? theme.colors[color].light : "";
|
|
4997
5148
|
});
|
|
4998
5149
|
var Content = styled.div(templateObject_3$a || (templateObject_3$a = __makeTemplateObject$1(["\n height: 100%;\n padding: 15px;\n position: inherit;\n top: 0;\n left: 0;\n"], ["\n height: 100%;\n padding: 15px;\n position: inherit;\n top: 0;\n left: 0;\n"])));
|
|
4999
|
-
var templateObject_1$
|
|
5150
|
+
var templateObject_1$A, templateObject_2$u, templateObject_3$a;
|
|
5000
5151
|
|
|
5001
5152
|
var Card = function (props) { return (jsxs(StyledCard, __assign$2({}, props, { children: [props.ellipse && jsx$1(Ellipse, { color: props.ellipse }), jsx$1(Content, { children: props.children })] }))); };
|
|
5002
5153
|
|
|
@@ -10144,15 +10295,15 @@ possibleStandardNamesOptimized$1.possibleStandardNames = {
|
|
|
10144
10295
|
|
|
10145
10296
|
Object.defineProperty(lib, '__esModule', { value: true });
|
|
10146
10297
|
|
|
10147
|
-
function _slicedToArray(arr, i) {
|
|
10148
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
10298
|
+
function _slicedToArray$2(arr, i) {
|
|
10299
|
+
return _arrayWithHoles$2(arr) || _iterableToArrayLimit$2(arr, i) || _unsupportedIterableToArray$2(arr, i) || _nonIterableRest$2();
|
|
10149
10300
|
}
|
|
10150
10301
|
|
|
10151
|
-
function _arrayWithHoles(arr) {
|
|
10302
|
+
function _arrayWithHoles$2(arr) {
|
|
10152
10303
|
if (Array.isArray(arr)) return arr;
|
|
10153
10304
|
}
|
|
10154
10305
|
|
|
10155
|
-
function _iterableToArrayLimit(arr, i) {
|
|
10306
|
+
function _iterableToArrayLimit$2(arr, i) {
|
|
10156
10307
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
10157
10308
|
|
|
10158
10309
|
if (_i == null) return;
|
|
@@ -10182,16 +10333,16 @@ function _iterableToArrayLimit(arr, i) {
|
|
|
10182
10333
|
return _arr;
|
|
10183
10334
|
}
|
|
10184
10335
|
|
|
10185
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
10336
|
+
function _unsupportedIterableToArray$2(o, minLen) {
|
|
10186
10337
|
if (!o) return;
|
|
10187
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
10338
|
+
if (typeof o === "string") return _arrayLikeToArray$2(o, minLen);
|
|
10188
10339
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
10189
10340
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
10190
10341
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
10191
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
10342
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen);
|
|
10192
10343
|
}
|
|
10193
10344
|
|
|
10194
|
-
function _arrayLikeToArray(arr, len) {
|
|
10345
|
+
function _arrayLikeToArray$2(arr, len) {
|
|
10195
10346
|
if (len == null || len > arr.length) len = arr.length;
|
|
10196
10347
|
|
|
10197
10348
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
@@ -10199,7 +10350,7 @@ function _arrayLikeToArray(arr, len) {
|
|
|
10199
10350
|
return arr2;
|
|
10200
10351
|
}
|
|
10201
10352
|
|
|
10202
|
-
function _nonIterableRest() {
|
|
10353
|
+
function _nonIterableRest$2() {
|
|
10203
10354
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
10204
10355
|
}
|
|
10205
10356
|
|
|
@@ -10263,7 +10414,7 @@ reservedProps.forEach(function (name) {
|
|
|
10263
10414
|
// This is a mapping from React prop names to the attribute names.
|
|
10264
10415
|
|
|
10265
10416
|
[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
|
|
10266
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
10417
|
+
var _ref2 = _slicedToArray$2(_ref, 2),
|
|
10267
10418
|
name = _ref2[0],
|
|
10268
10419
|
attributeName = _ref2[1];
|
|
10269
10420
|
|
|
@@ -11245,14 +11396,14 @@ htmlReactParser.Element;
|
|
|
11245
11396
|
htmlReactParser.ProcessingInstruction;
|
|
11246
11397
|
htmlReactParser.Text;
|
|
11247
11398
|
|
|
11248
|
-
var Fieldset$1 = styled.fieldset(templateObject_1$
|
|
11399
|
+
var Fieldset$1 = styled.fieldset(templateObject_1$z || (templateObject_1$z = __makeTemplateObject$1(["\n border: 0;\n margin: 0;\n padding: 0;\n"], ["\n border: 0;\n margin: 0;\n padding: 0;\n"])));
|
|
11249
11400
|
var CheckboxContainer = styled.div(templateObject_2$t || (templateObject_2$t = __makeTemplateObject$1(["\n margin-top: 5px;\n"], ["\n margin-top: 5px;\n"])));
|
|
11250
11401
|
var CheckboxWrapper = styled.div(templateObject_3$9 || (templateObject_3$9 = __makeTemplateObject$1(["\n display: flex;\n align-items: center;\n\n > div:first-child {\n margin-right: 10px;\n }\n\n :not(:last-child) {\n margin-bottom: 20px;\n }\n"], ["\n display: flex;\n align-items: center;\n\n > div:first-child {\n margin-right: 10px;\n }\n\n :not(:last-child) {\n margin-bottom: 20px;\n }\n"])));
|
|
11251
11402
|
var Label$9 = styled(StyledParagraph)(templateObject_4$6 || (templateObject_4$6 = __makeTemplateObject$1(["\n font-weight: ", ";\n color: ", ";\n display: flex;\n flex-wrap: wrap;\n gap: 0 6px;\n align-items: center;\n cursor: pointer;\n\n a {\n color: ", ";\n }\n"], ["\n font-weight: ", ";\n color: ", ";\n display: flex;\n flex-wrap: wrap;\n gap: 0 6px;\n align-items: center;\n cursor: pointer;\n\n a {\n color: ", ";\n }\n"])), function (_a) {
|
|
11252
11403
|
var weight = _a.weight;
|
|
11253
11404
|
return weight || 500;
|
|
11254
11405
|
}, theme.colors.darkGray.base, theme.colors.blue.base);
|
|
11255
|
-
var templateObject_1$
|
|
11406
|
+
var templateObject_1$z, templateObject_2$t, templateObject_3$9, templateObject_4$6;
|
|
11256
11407
|
|
|
11257
11408
|
var Checkboxes = function (props) {
|
|
11258
11409
|
var _a = useState(props.defaultValue || []), values = _a[0], setValues = _a[1];
|
|
@@ -11275,12 +11426,12 @@ var Checkboxes = function (props) {
|
|
|
11275
11426
|
}) })] }));
|
|
11276
11427
|
};
|
|
11277
11428
|
|
|
11278
|
-
var Container$
|
|
11429
|
+
var Container$j = styled.div(templateObject_1$y || (templateObject_1$y = __makeTemplateObject$1(["\n width: 100%;\n background-color: ", ";\n box-shadow: 0px 4px 0px rgba(0, 0, 0, 20%);\n border-radius: 6px;\n padding: 10px 20px;\n"], ["\n width: 100%;\n background-color: ", ";\n box-shadow: 0px 4px 0px rgba(0, 0, 0, 20%);\n border-radius: 6px;\n padding: 10px 20px;\n"])), theme.colors.lightGray.light);
|
|
11279
11430
|
var Item = styled.div(templateObject_2$s || (templateObject_2$s = __makeTemplateObject$1(["\n padding: 10px 0;\n cursor: pointer;\n\n > div:first-child {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 5px;\n }\n\n p, > div:last-child {\n display: ", ";\n margin: 0;\n }\n\n :not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n"], ["\n padding: 10px 0;\n cursor: pointer;\n\n > div:first-child {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 5px;\n }\n\n p, > div:last-child {\n display: ", ";\n margin: 0;\n }\n\n :not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n"])), function (_a) {
|
|
11280
11431
|
var isOpen = _a.isOpen;
|
|
11281
11432
|
return (isOpen ? "" : "none");
|
|
11282
11433
|
}, theme.colors.lightGray.dark);
|
|
11283
|
-
var templateObject_1$
|
|
11434
|
+
var templateObject_1$y, templateObject_2$s;
|
|
11284
11435
|
|
|
11285
11436
|
var Collapse = function (props) {
|
|
11286
11437
|
var _a = useState([]), openItems = _a[0], setOpenItems = _a[1];
|
|
@@ -11292,18 +11443,18 @@ var Collapse = function (props) {
|
|
|
11292
11443
|
setOpenItems(function (prevState) { return __spreadArray(__spreadArray([], prevState, true), [index], false); });
|
|
11293
11444
|
}
|
|
11294
11445
|
};
|
|
11295
|
-
return (jsx$1(Container$
|
|
11446
|
+
return (jsx$1(Container$j, __assign$2({}, props, { children: props.items.map(function (item, index) {
|
|
11296
11447
|
var isOpen = openItems.includes(index);
|
|
11297
11448
|
return (jsxs(Item, __assign$2({ isOpen: isOpen, onClick: function () { return onClickItem(index, isOpen); } }, { children: [jsxs("div", { children: [jsx$1(Heading, __assign$2({ type: "h6" }, { children: item.title })), jsx$1(Icon, { type: isOpen ? "chevronUp" : "chevronDown", color: "blue" })] }), jsx$1(Paragraph, __assign$2({ weight: "regular", as: typeof item.content !== "string" ? "div" : undefined }, { children: item.content }))] }), "".concat(item.title, "-").concat(index)));
|
|
11298
11449
|
}) })));
|
|
11299
11450
|
};
|
|
11300
11451
|
|
|
11301
|
-
var Wrapper$3 = styled.div(templateObject_1$
|
|
11452
|
+
var Wrapper$3 = styled.div(templateObject_1$x || (templateObject_1$x = __makeTemplateObject$1(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
11302
11453
|
var Value = styled.div(templateObject_2$r || (templateObject_2$r = __makeTemplateObject$1(["\n width: 40px;\n height: 32px;\n background-color: ", ";\n border-radius: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0 6px;\n\n h5 {\n color: ", ";\n }\n\n :first-child {\n margin-left: 0;\n }\n"], ["\n width: 40px;\n height: 32px;\n background-color: ", ";\n border-radius: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0 6px;\n\n h5 {\n color: ", ";\n }\n\n :first-child {\n margin-left: 0;\n }\n"])), function (_a) {
|
|
11303
11454
|
var contrast = _a.contrast;
|
|
11304
11455
|
return contrast ? theme.colors.lightGray.dark : theme.colors.lightGray.light;
|
|
11305
11456
|
}, theme.colors.darkGray.base);
|
|
11306
|
-
var templateObject_1$
|
|
11457
|
+
var templateObject_1$x, templateObject_2$r;
|
|
11307
11458
|
|
|
11308
11459
|
var Countdown = function (_a) {
|
|
11309
11460
|
var till = _a.till, contrast = _a.contrast;
|
|
@@ -11330,9 +11481,9 @@ var Countdown = function (_a) {
|
|
|
11330
11481
|
return (jsxs(Wrapper$3, { children: [jsx$1(Value, __assign$2({ contrast: contrast }, { children: jsx$1(Heading, __assign$2({ type: "h5" }, { children: HH })) })), jsx$1(Heading, __assign$2({ type: "h5", color: color }, { children: ":" })), jsx$1(Value, __assign$2({ contrast: contrast }, { children: jsx$1(Heading, __assign$2({ type: "h5" }, { children: MM })) })), jsx$1(Heading, __assign$2({ type: "h5", color: color }, { children: ":" })), jsx$1(Value, __assign$2({ contrast: contrast }, { children: jsx$1(Heading, __assign$2({ type: "h5" }, { children: SS })) }))] }));
|
|
11331
11482
|
};
|
|
11332
11483
|
|
|
11333
|
-
var Container$
|
|
11484
|
+
var Container$i = styled.div(templateObject_1$w || (templateObject_1$w = __makeTemplateObject$1(["\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n flex-wrap: wrap;\n"], ["\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n flex-wrap: wrap;\n"])));
|
|
11334
11485
|
var Label$8 = styled(StyledParagraph)(templateObject_2$q || (templateObject_2$q = __makeTemplateObject$1(["\n font-weight: 500;\n color: ", ";\n"], ["\n font-weight: 500;\n color: ", ";\n"])), theme.colors.darkGray.base);
|
|
11335
|
-
var templateObject_1$
|
|
11486
|
+
var templateObject_1$w, templateObject_2$q;
|
|
11336
11487
|
|
|
11337
11488
|
var DateInputField = function (props) {
|
|
11338
11489
|
var onChange = function (value) {
|
|
@@ -11343,7 +11494,2563 @@ var DateInputField = function (props) {
|
|
|
11343
11494
|
if (props.onBlur)
|
|
11344
11495
|
props.onBlur(props.name);
|
|
11345
11496
|
};
|
|
11346
|
-
return (jsxs(Container$
|
|
11497
|
+
return (jsxs(Container$i, { children: [jsx$1(Label$8, __assign$2({ as: "label", htmlFor: props.name }, { children: props.label })), jsx$1(Spacer, { vertical: 5 }), jsx$1(Input.Date, { defaultValue: props.defaultValue, min: props.min, max: props.max, autoComplete: props.autoComplete, autoFocus: props.autoFocus, disabled: props.disabled, id: props.name, onChange: onChange, onBlur: onBlur })] }));
|
|
11498
|
+
};
|
|
11499
|
+
|
|
11500
|
+
var propTypes = {exports: {}};
|
|
11501
|
+
|
|
11502
|
+
/*
|
|
11503
|
+
object-assign
|
|
11504
|
+
(c) Sindre Sorhus
|
|
11505
|
+
@license MIT
|
|
11506
|
+
*/
|
|
11507
|
+
/* eslint-disable no-unused-vars */
|
|
11508
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
11509
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
11510
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
11511
|
+
|
|
11512
|
+
function toObject(val) {
|
|
11513
|
+
if (val === null || val === undefined) {
|
|
11514
|
+
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
11515
|
+
}
|
|
11516
|
+
|
|
11517
|
+
return Object(val);
|
|
11518
|
+
}
|
|
11519
|
+
|
|
11520
|
+
function shouldUseNative() {
|
|
11521
|
+
try {
|
|
11522
|
+
if (!Object.assign) {
|
|
11523
|
+
return false;
|
|
11524
|
+
}
|
|
11525
|
+
|
|
11526
|
+
// Detect buggy property enumeration order in older V8 versions.
|
|
11527
|
+
|
|
11528
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
11529
|
+
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
11530
|
+
test1[5] = 'de';
|
|
11531
|
+
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
11532
|
+
return false;
|
|
11533
|
+
}
|
|
11534
|
+
|
|
11535
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
11536
|
+
var test2 = {};
|
|
11537
|
+
for (var i = 0; i < 10; i++) {
|
|
11538
|
+
test2['_' + String.fromCharCode(i)] = i;
|
|
11539
|
+
}
|
|
11540
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
11541
|
+
return test2[n];
|
|
11542
|
+
});
|
|
11543
|
+
if (order2.join('') !== '0123456789') {
|
|
11544
|
+
return false;
|
|
11545
|
+
}
|
|
11546
|
+
|
|
11547
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
11548
|
+
var test3 = {};
|
|
11549
|
+
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
11550
|
+
test3[letter] = letter;
|
|
11551
|
+
});
|
|
11552
|
+
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
11553
|
+
'abcdefghijklmnopqrst') {
|
|
11554
|
+
return false;
|
|
11555
|
+
}
|
|
11556
|
+
|
|
11557
|
+
return true;
|
|
11558
|
+
} catch (err) {
|
|
11559
|
+
// We don't expect any of the above to throw, but better to be safe.
|
|
11560
|
+
return false;
|
|
11561
|
+
}
|
|
11562
|
+
}
|
|
11563
|
+
|
|
11564
|
+
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
11565
|
+
var from;
|
|
11566
|
+
var to = toObject(target);
|
|
11567
|
+
var symbols;
|
|
11568
|
+
|
|
11569
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
11570
|
+
from = Object(arguments[s]);
|
|
11571
|
+
|
|
11572
|
+
for (var key in from) {
|
|
11573
|
+
if (hasOwnProperty.call(from, key)) {
|
|
11574
|
+
to[key] = from[key];
|
|
11575
|
+
}
|
|
11576
|
+
}
|
|
11577
|
+
|
|
11578
|
+
if (getOwnPropertySymbols) {
|
|
11579
|
+
symbols = getOwnPropertySymbols(from);
|
|
11580
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
11581
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
11582
|
+
to[symbols[i]] = from[symbols[i]];
|
|
11583
|
+
}
|
|
11584
|
+
}
|
|
11585
|
+
}
|
|
11586
|
+
}
|
|
11587
|
+
|
|
11588
|
+
return to;
|
|
11589
|
+
};
|
|
11590
|
+
|
|
11591
|
+
/**
|
|
11592
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
11593
|
+
*
|
|
11594
|
+
* This source code is licensed under the MIT license found in the
|
|
11595
|
+
* LICENSE file in the root directory of this source tree.
|
|
11596
|
+
*/
|
|
11597
|
+
|
|
11598
|
+
var ReactPropTypesSecret$3 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
11599
|
+
|
|
11600
|
+
var ReactPropTypesSecret_1 = ReactPropTypesSecret$3;
|
|
11601
|
+
|
|
11602
|
+
var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
11603
|
+
|
|
11604
|
+
/**
|
|
11605
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
11606
|
+
*
|
|
11607
|
+
* This source code is licensed under the MIT license found in the
|
|
11608
|
+
* LICENSE file in the root directory of this source tree.
|
|
11609
|
+
*/
|
|
11610
|
+
|
|
11611
|
+
var printWarning$1 = function() {};
|
|
11612
|
+
|
|
11613
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
11614
|
+
var ReactPropTypesSecret$2 = ReactPropTypesSecret_1;
|
|
11615
|
+
var loggedTypeFailures = {};
|
|
11616
|
+
var has$1 = has$2;
|
|
11617
|
+
|
|
11618
|
+
printWarning$1 = function(text) {
|
|
11619
|
+
var message = 'Warning: ' + text;
|
|
11620
|
+
if (typeof console !== 'undefined') {
|
|
11621
|
+
console.error(message);
|
|
11622
|
+
}
|
|
11623
|
+
try {
|
|
11624
|
+
// --- Welcome to debugging React ---
|
|
11625
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
11626
|
+
// to find the callsite that caused this warning to fire.
|
|
11627
|
+
throw new Error(message);
|
|
11628
|
+
} catch (x) { /**/ }
|
|
11629
|
+
};
|
|
11630
|
+
}
|
|
11631
|
+
|
|
11632
|
+
/**
|
|
11633
|
+
* Assert that the values match with the type specs.
|
|
11634
|
+
* Error messages are memorized and will only be shown once.
|
|
11635
|
+
*
|
|
11636
|
+
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
11637
|
+
* @param {object} values Runtime values that need to be type-checked
|
|
11638
|
+
* @param {string} location e.g. "prop", "context", "child context"
|
|
11639
|
+
* @param {string} componentName Name of the component for error messages.
|
|
11640
|
+
* @param {?Function} getStack Returns the component stack.
|
|
11641
|
+
* @private
|
|
11642
|
+
*/
|
|
11643
|
+
function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
|
|
11644
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
11645
|
+
for (var typeSpecName in typeSpecs) {
|
|
11646
|
+
if (has$1(typeSpecs, typeSpecName)) {
|
|
11647
|
+
var error;
|
|
11648
|
+
// Prop type validation may throw. In case they do, we don't want to
|
|
11649
|
+
// fail the render phase where it didn't fail before. So we log it.
|
|
11650
|
+
// After these have been cleaned up, we'll let them throw.
|
|
11651
|
+
try {
|
|
11652
|
+
// This is intentionally an invariant that gets caught. It's the same
|
|
11653
|
+
// behavior as without this statement except with a better message.
|
|
11654
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
11655
|
+
var err = Error(
|
|
11656
|
+
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
11657
|
+
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
|
|
11658
|
+
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
11659
|
+
);
|
|
11660
|
+
err.name = 'Invariant Violation';
|
|
11661
|
+
throw err;
|
|
11662
|
+
}
|
|
11663
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$2);
|
|
11664
|
+
} catch (ex) {
|
|
11665
|
+
error = ex;
|
|
11666
|
+
}
|
|
11667
|
+
if (error && !(error instanceof Error)) {
|
|
11668
|
+
printWarning$1(
|
|
11669
|
+
(componentName || 'React class') + ': type specification of ' +
|
|
11670
|
+
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
|
11671
|
+
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
|
11672
|
+
'You may have forgotten to pass an argument to the type checker ' +
|
|
11673
|
+
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
|
11674
|
+
'shape all require an argument).'
|
|
11675
|
+
);
|
|
11676
|
+
}
|
|
11677
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
11678
|
+
// Only monitor this failure once because there tends to be a lot of the
|
|
11679
|
+
// same error.
|
|
11680
|
+
loggedTypeFailures[error.message] = true;
|
|
11681
|
+
|
|
11682
|
+
var stack = getStack ? getStack() : '';
|
|
11683
|
+
|
|
11684
|
+
printWarning$1(
|
|
11685
|
+
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
|
11686
|
+
);
|
|
11687
|
+
}
|
|
11688
|
+
}
|
|
11689
|
+
}
|
|
11690
|
+
}
|
|
11691
|
+
}
|
|
11692
|
+
|
|
11693
|
+
/**
|
|
11694
|
+
* Resets warning cache when testing.
|
|
11695
|
+
*
|
|
11696
|
+
* @private
|
|
11697
|
+
*/
|
|
11698
|
+
checkPropTypes$1.resetWarningCache = function() {
|
|
11699
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
11700
|
+
loggedTypeFailures = {};
|
|
11701
|
+
}
|
|
11702
|
+
};
|
|
11703
|
+
|
|
11704
|
+
var checkPropTypes_1 = checkPropTypes$1;
|
|
11705
|
+
|
|
11706
|
+
/**
|
|
11707
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
11708
|
+
*
|
|
11709
|
+
* This source code is licensed under the MIT license found in the
|
|
11710
|
+
* LICENSE file in the root directory of this source tree.
|
|
11711
|
+
*/
|
|
11712
|
+
|
|
11713
|
+
var ReactIs$1 = reactIs$1.exports;
|
|
11714
|
+
var assign = objectAssign;
|
|
11715
|
+
|
|
11716
|
+
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
|
|
11717
|
+
var has = has$2;
|
|
11718
|
+
var checkPropTypes = checkPropTypes_1;
|
|
11719
|
+
|
|
11720
|
+
var printWarning = function() {};
|
|
11721
|
+
|
|
11722
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
11723
|
+
printWarning = function(text) {
|
|
11724
|
+
var message = 'Warning: ' + text;
|
|
11725
|
+
if (typeof console !== 'undefined') {
|
|
11726
|
+
console.error(message);
|
|
11727
|
+
}
|
|
11728
|
+
try {
|
|
11729
|
+
// --- Welcome to debugging React ---
|
|
11730
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
11731
|
+
// to find the callsite that caused this warning to fire.
|
|
11732
|
+
throw new Error(message);
|
|
11733
|
+
} catch (x) {}
|
|
11734
|
+
};
|
|
11735
|
+
}
|
|
11736
|
+
|
|
11737
|
+
function emptyFunctionThatReturnsNull() {
|
|
11738
|
+
return null;
|
|
11739
|
+
}
|
|
11740
|
+
|
|
11741
|
+
var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
11742
|
+
/* global Symbol */
|
|
11743
|
+
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
11744
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
11745
|
+
|
|
11746
|
+
/**
|
|
11747
|
+
* Returns the iterator method function contained on the iterable object.
|
|
11748
|
+
*
|
|
11749
|
+
* Be sure to invoke the function with the iterable as context:
|
|
11750
|
+
*
|
|
11751
|
+
* var iteratorFn = getIteratorFn(myIterable);
|
|
11752
|
+
* if (iteratorFn) {
|
|
11753
|
+
* var iterator = iteratorFn.call(myIterable);
|
|
11754
|
+
* ...
|
|
11755
|
+
* }
|
|
11756
|
+
*
|
|
11757
|
+
* @param {?object} maybeIterable
|
|
11758
|
+
* @return {?function}
|
|
11759
|
+
*/
|
|
11760
|
+
function getIteratorFn(maybeIterable) {
|
|
11761
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
11762
|
+
if (typeof iteratorFn === 'function') {
|
|
11763
|
+
return iteratorFn;
|
|
11764
|
+
}
|
|
11765
|
+
}
|
|
11766
|
+
|
|
11767
|
+
/**
|
|
11768
|
+
* Collection of methods that allow declaration and validation of props that are
|
|
11769
|
+
* supplied to React components. Example usage:
|
|
11770
|
+
*
|
|
11771
|
+
* var Props = require('ReactPropTypes');
|
|
11772
|
+
* var MyArticle = React.createClass({
|
|
11773
|
+
* propTypes: {
|
|
11774
|
+
* // An optional string prop named "description".
|
|
11775
|
+
* description: Props.string,
|
|
11776
|
+
*
|
|
11777
|
+
* // A required enum prop named "category".
|
|
11778
|
+
* category: Props.oneOf(['News','Photos']).isRequired,
|
|
11779
|
+
*
|
|
11780
|
+
* // A prop named "dialog" that requires an instance of Dialog.
|
|
11781
|
+
* dialog: Props.instanceOf(Dialog).isRequired
|
|
11782
|
+
* },
|
|
11783
|
+
* render: function() { ... }
|
|
11784
|
+
* });
|
|
11785
|
+
*
|
|
11786
|
+
* A more formal specification of how these methods are used:
|
|
11787
|
+
*
|
|
11788
|
+
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
|
11789
|
+
* decl := ReactPropTypes.{type}(.isRequired)?
|
|
11790
|
+
*
|
|
11791
|
+
* Each and every declaration produces a function with the same signature. This
|
|
11792
|
+
* allows the creation of custom validation functions. For example:
|
|
11793
|
+
*
|
|
11794
|
+
* var MyLink = React.createClass({
|
|
11795
|
+
* propTypes: {
|
|
11796
|
+
* // An optional string or URI prop named "href".
|
|
11797
|
+
* href: function(props, propName, componentName) {
|
|
11798
|
+
* var propValue = props[propName];
|
|
11799
|
+
* if (propValue != null && typeof propValue !== 'string' &&
|
|
11800
|
+
* !(propValue instanceof URI)) {
|
|
11801
|
+
* return new Error(
|
|
11802
|
+
* 'Expected a string or an URI for ' + propName + ' in ' +
|
|
11803
|
+
* componentName
|
|
11804
|
+
* );
|
|
11805
|
+
* }
|
|
11806
|
+
* }
|
|
11807
|
+
* },
|
|
11808
|
+
* render: function() {...}
|
|
11809
|
+
* });
|
|
11810
|
+
*
|
|
11811
|
+
* @internal
|
|
11812
|
+
*/
|
|
11813
|
+
|
|
11814
|
+
var ANONYMOUS = '<<anonymous>>';
|
|
11815
|
+
|
|
11816
|
+
// Important!
|
|
11817
|
+
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
11818
|
+
var ReactPropTypes = {
|
|
11819
|
+
array: createPrimitiveTypeChecker('array'),
|
|
11820
|
+
bigint: createPrimitiveTypeChecker('bigint'),
|
|
11821
|
+
bool: createPrimitiveTypeChecker('boolean'),
|
|
11822
|
+
func: createPrimitiveTypeChecker('function'),
|
|
11823
|
+
number: createPrimitiveTypeChecker('number'),
|
|
11824
|
+
object: createPrimitiveTypeChecker('object'),
|
|
11825
|
+
string: createPrimitiveTypeChecker('string'),
|
|
11826
|
+
symbol: createPrimitiveTypeChecker('symbol'),
|
|
11827
|
+
|
|
11828
|
+
any: createAnyTypeChecker(),
|
|
11829
|
+
arrayOf: createArrayOfTypeChecker,
|
|
11830
|
+
element: createElementTypeChecker(),
|
|
11831
|
+
elementType: createElementTypeTypeChecker(),
|
|
11832
|
+
instanceOf: createInstanceTypeChecker,
|
|
11833
|
+
node: createNodeChecker(),
|
|
11834
|
+
objectOf: createObjectOfTypeChecker,
|
|
11835
|
+
oneOf: createEnumTypeChecker,
|
|
11836
|
+
oneOfType: createUnionTypeChecker,
|
|
11837
|
+
shape: createShapeTypeChecker,
|
|
11838
|
+
exact: createStrictShapeTypeChecker,
|
|
11839
|
+
};
|
|
11840
|
+
|
|
11841
|
+
/**
|
|
11842
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
11843
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
11844
|
+
*/
|
|
11845
|
+
/*eslint-disable no-self-compare*/
|
|
11846
|
+
function is(x, y) {
|
|
11847
|
+
// SameValue algorithm
|
|
11848
|
+
if (x === y) {
|
|
11849
|
+
// Steps 1-5, 7-10
|
|
11850
|
+
// Steps 6.b-6.e: +0 != -0
|
|
11851
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
11852
|
+
} else {
|
|
11853
|
+
// Step 6.a: NaN == NaN
|
|
11854
|
+
return x !== x && y !== y;
|
|
11855
|
+
}
|
|
11856
|
+
}
|
|
11857
|
+
/*eslint-enable no-self-compare*/
|
|
11858
|
+
|
|
11859
|
+
/**
|
|
11860
|
+
* We use an Error-like object for backward compatibility as people may call
|
|
11861
|
+
* PropTypes directly and inspect their output. However, we don't use real
|
|
11862
|
+
* Errors anymore. We don't inspect their stack anyway, and creating them
|
|
11863
|
+
* is prohibitively expensive if they are created too often, such as what
|
|
11864
|
+
* happens in oneOfType() for any type before the one that matched.
|
|
11865
|
+
*/
|
|
11866
|
+
function PropTypeError(message, data) {
|
|
11867
|
+
this.message = message;
|
|
11868
|
+
this.data = data && typeof data === 'object' ? data: {};
|
|
11869
|
+
this.stack = '';
|
|
11870
|
+
}
|
|
11871
|
+
// Make `instanceof Error` still work for returned errors.
|
|
11872
|
+
PropTypeError.prototype = Error.prototype;
|
|
11873
|
+
|
|
11874
|
+
function createChainableTypeChecker(validate) {
|
|
11875
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
11876
|
+
var manualPropTypeCallCache = {};
|
|
11877
|
+
var manualPropTypeWarningCount = 0;
|
|
11878
|
+
}
|
|
11879
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
11880
|
+
componentName = componentName || ANONYMOUS;
|
|
11881
|
+
propFullName = propFullName || propName;
|
|
11882
|
+
|
|
11883
|
+
if (secret !== ReactPropTypesSecret$1) {
|
|
11884
|
+
if (throwOnDirectAccess) {
|
|
11885
|
+
// New behavior only for users of `prop-types` package
|
|
11886
|
+
var err = new Error(
|
|
11887
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
11888
|
+
'Use `PropTypes.checkPropTypes()` to call them. ' +
|
|
11889
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
11890
|
+
);
|
|
11891
|
+
err.name = 'Invariant Violation';
|
|
11892
|
+
throw err;
|
|
11893
|
+
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
|
11894
|
+
// Old behavior for people using React.PropTypes
|
|
11895
|
+
var cacheKey = componentName + ':' + propName;
|
|
11896
|
+
if (
|
|
11897
|
+
!manualPropTypeCallCache[cacheKey] &&
|
|
11898
|
+
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
11899
|
+
manualPropTypeWarningCount < 3
|
|
11900
|
+
) {
|
|
11901
|
+
printWarning(
|
|
11902
|
+
'You are manually calling a React.PropTypes validation ' +
|
|
11903
|
+
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
11904
|
+
'and will throw in the standalone `prop-types` package. ' +
|
|
11905
|
+
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
11906
|
+
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
11907
|
+
);
|
|
11908
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
11909
|
+
manualPropTypeWarningCount++;
|
|
11910
|
+
}
|
|
11911
|
+
}
|
|
11912
|
+
}
|
|
11913
|
+
if (props[propName] == null) {
|
|
11914
|
+
if (isRequired) {
|
|
11915
|
+
if (props[propName] === null) {
|
|
11916
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
11917
|
+
}
|
|
11918
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
11919
|
+
}
|
|
11920
|
+
return null;
|
|
11921
|
+
} else {
|
|
11922
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
11923
|
+
}
|
|
11924
|
+
}
|
|
11925
|
+
|
|
11926
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
11927
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
11928
|
+
|
|
11929
|
+
return chainedCheckType;
|
|
11930
|
+
}
|
|
11931
|
+
|
|
11932
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
11933
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
11934
|
+
var propValue = props[propName];
|
|
11935
|
+
var propType = getPropType(propValue);
|
|
11936
|
+
if (propType !== expectedType) {
|
|
11937
|
+
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
11938
|
+
// check, but we can offer a more precise error message here rather than
|
|
11939
|
+
// 'of type `object`'.
|
|
11940
|
+
var preciseType = getPreciseType(propValue);
|
|
11941
|
+
|
|
11942
|
+
return new PropTypeError(
|
|
11943
|
+
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
11944
|
+
{expectedType: expectedType}
|
|
11945
|
+
);
|
|
11946
|
+
}
|
|
11947
|
+
return null;
|
|
11948
|
+
}
|
|
11949
|
+
return createChainableTypeChecker(validate);
|
|
11950
|
+
}
|
|
11951
|
+
|
|
11952
|
+
function createAnyTypeChecker() {
|
|
11953
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
11954
|
+
}
|
|
11955
|
+
|
|
11956
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
11957
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
11958
|
+
if (typeof typeChecker !== 'function') {
|
|
11959
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
11960
|
+
}
|
|
11961
|
+
var propValue = props[propName];
|
|
11962
|
+
if (!Array.isArray(propValue)) {
|
|
11963
|
+
var propType = getPropType(propValue);
|
|
11964
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
11965
|
+
}
|
|
11966
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
11967
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret$1);
|
|
11968
|
+
if (error instanceof Error) {
|
|
11969
|
+
return error;
|
|
11970
|
+
}
|
|
11971
|
+
}
|
|
11972
|
+
return null;
|
|
11973
|
+
}
|
|
11974
|
+
return createChainableTypeChecker(validate);
|
|
11975
|
+
}
|
|
11976
|
+
|
|
11977
|
+
function createElementTypeChecker() {
|
|
11978
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
11979
|
+
var propValue = props[propName];
|
|
11980
|
+
if (!isValidElement(propValue)) {
|
|
11981
|
+
var propType = getPropType(propValue);
|
|
11982
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
11983
|
+
}
|
|
11984
|
+
return null;
|
|
11985
|
+
}
|
|
11986
|
+
return createChainableTypeChecker(validate);
|
|
11987
|
+
}
|
|
11988
|
+
|
|
11989
|
+
function createElementTypeTypeChecker() {
|
|
11990
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
11991
|
+
var propValue = props[propName];
|
|
11992
|
+
if (!ReactIs$1.isValidElementType(propValue)) {
|
|
11993
|
+
var propType = getPropType(propValue);
|
|
11994
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
11995
|
+
}
|
|
11996
|
+
return null;
|
|
11997
|
+
}
|
|
11998
|
+
return createChainableTypeChecker(validate);
|
|
11999
|
+
}
|
|
12000
|
+
|
|
12001
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
12002
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
12003
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
12004
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
12005
|
+
var actualClassName = getClassName(props[propName]);
|
|
12006
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
12007
|
+
}
|
|
12008
|
+
return null;
|
|
12009
|
+
}
|
|
12010
|
+
return createChainableTypeChecker(validate);
|
|
12011
|
+
}
|
|
12012
|
+
|
|
12013
|
+
function createEnumTypeChecker(expectedValues) {
|
|
12014
|
+
if (!Array.isArray(expectedValues)) {
|
|
12015
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
12016
|
+
if (arguments.length > 1) {
|
|
12017
|
+
printWarning(
|
|
12018
|
+
'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
|
|
12019
|
+
'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
|
|
12020
|
+
);
|
|
12021
|
+
} else {
|
|
12022
|
+
printWarning('Invalid argument supplied to oneOf, expected an array.');
|
|
12023
|
+
}
|
|
12024
|
+
}
|
|
12025
|
+
return emptyFunctionThatReturnsNull;
|
|
12026
|
+
}
|
|
12027
|
+
|
|
12028
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
12029
|
+
var propValue = props[propName];
|
|
12030
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
12031
|
+
if (is(propValue, expectedValues[i])) {
|
|
12032
|
+
return null;
|
|
12033
|
+
}
|
|
12034
|
+
}
|
|
12035
|
+
|
|
12036
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
12037
|
+
var type = getPreciseType(value);
|
|
12038
|
+
if (type === 'symbol') {
|
|
12039
|
+
return String(value);
|
|
12040
|
+
}
|
|
12041
|
+
return value;
|
|
12042
|
+
});
|
|
12043
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
12044
|
+
}
|
|
12045
|
+
return createChainableTypeChecker(validate);
|
|
12046
|
+
}
|
|
12047
|
+
|
|
12048
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
12049
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
12050
|
+
if (typeof typeChecker !== 'function') {
|
|
12051
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
12052
|
+
}
|
|
12053
|
+
var propValue = props[propName];
|
|
12054
|
+
var propType = getPropType(propValue);
|
|
12055
|
+
if (propType !== 'object') {
|
|
12056
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
12057
|
+
}
|
|
12058
|
+
for (var key in propValue) {
|
|
12059
|
+
if (has(propValue, key)) {
|
|
12060
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
12061
|
+
if (error instanceof Error) {
|
|
12062
|
+
return error;
|
|
12063
|
+
}
|
|
12064
|
+
}
|
|
12065
|
+
}
|
|
12066
|
+
return null;
|
|
12067
|
+
}
|
|
12068
|
+
return createChainableTypeChecker(validate);
|
|
12069
|
+
}
|
|
12070
|
+
|
|
12071
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
12072
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
12073
|
+
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
12074
|
+
return emptyFunctionThatReturnsNull;
|
|
12075
|
+
}
|
|
12076
|
+
|
|
12077
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
12078
|
+
var checker = arrayOfTypeCheckers[i];
|
|
12079
|
+
if (typeof checker !== 'function') {
|
|
12080
|
+
printWarning(
|
|
12081
|
+
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
|
12082
|
+
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
|
|
12083
|
+
);
|
|
12084
|
+
return emptyFunctionThatReturnsNull;
|
|
12085
|
+
}
|
|
12086
|
+
}
|
|
12087
|
+
|
|
12088
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
12089
|
+
var expectedTypes = [];
|
|
12090
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
12091
|
+
var checker = arrayOfTypeCheckers[i];
|
|
12092
|
+
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1);
|
|
12093
|
+
if (checkerResult == null) {
|
|
12094
|
+
return null;
|
|
12095
|
+
}
|
|
12096
|
+
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
12097
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
12098
|
+
}
|
|
12099
|
+
}
|
|
12100
|
+
var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
|
|
12101
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
12102
|
+
}
|
|
12103
|
+
return createChainableTypeChecker(validate);
|
|
12104
|
+
}
|
|
12105
|
+
|
|
12106
|
+
function createNodeChecker() {
|
|
12107
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
12108
|
+
if (!isNode(props[propName])) {
|
|
12109
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
12110
|
+
}
|
|
12111
|
+
return null;
|
|
12112
|
+
}
|
|
12113
|
+
return createChainableTypeChecker(validate);
|
|
12114
|
+
}
|
|
12115
|
+
|
|
12116
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
12117
|
+
return new PropTypeError(
|
|
12118
|
+
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
12119
|
+
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
12120
|
+
);
|
|
12121
|
+
}
|
|
12122
|
+
|
|
12123
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
12124
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
12125
|
+
var propValue = props[propName];
|
|
12126
|
+
var propType = getPropType(propValue);
|
|
12127
|
+
if (propType !== 'object') {
|
|
12128
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
12129
|
+
}
|
|
12130
|
+
for (var key in shapeTypes) {
|
|
12131
|
+
var checker = shapeTypes[key];
|
|
12132
|
+
if (typeof checker !== 'function') {
|
|
12133
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
12134
|
+
}
|
|
12135
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
12136
|
+
if (error) {
|
|
12137
|
+
return error;
|
|
12138
|
+
}
|
|
12139
|
+
}
|
|
12140
|
+
return null;
|
|
12141
|
+
}
|
|
12142
|
+
return createChainableTypeChecker(validate);
|
|
12143
|
+
}
|
|
12144
|
+
|
|
12145
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
12146
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
12147
|
+
var propValue = props[propName];
|
|
12148
|
+
var propType = getPropType(propValue);
|
|
12149
|
+
if (propType !== 'object') {
|
|
12150
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
12151
|
+
}
|
|
12152
|
+
// We need to check all keys in case some are required but missing from props.
|
|
12153
|
+
var allKeys = assign({}, props[propName], shapeTypes);
|
|
12154
|
+
for (var key in allKeys) {
|
|
12155
|
+
var checker = shapeTypes[key];
|
|
12156
|
+
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
12157
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
12158
|
+
}
|
|
12159
|
+
if (!checker) {
|
|
12160
|
+
return new PropTypeError(
|
|
12161
|
+
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
12162
|
+
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
12163
|
+
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
12164
|
+
);
|
|
12165
|
+
}
|
|
12166
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
12167
|
+
if (error) {
|
|
12168
|
+
return error;
|
|
12169
|
+
}
|
|
12170
|
+
}
|
|
12171
|
+
return null;
|
|
12172
|
+
}
|
|
12173
|
+
|
|
12174
|
+
return createChainableTypeChecker(validate);
|
|
12175
|
+
}
|
|
12176
|
+
|
|
12177
|
+
function isNode(propValue) {
|
|
12178
|
+
switch (typeof propValue) {
|
|
12179
|
+
case 'number':
|
|
12180
|
+
case 'string':
|
|
12181
|
+
case 'undefined':
|
|
12182
|
+
return true;
|
|
12183
|
+
case 'boolean':
|
|
12184
|
+
return !propValue;
|
|
12185
|
+
case 'object':
|
|
12186
|
+
if (Array.isArray(propValue)) {
|
|
12187
|
+
return propValue.every(isNode);
|
|
12188
|
+
}
|
|
12189
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
12190
|
+
return true;
|
|
12191
|
+
}
|
|
12192
|
+
|
|
12193
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
12194
|
+
if (iteratorFn) {
|
|
12195
|
+
var iterator = iteratorFn.call(propValue);
|
|
12196
|
+
var step;
|
|
12197
|
+
if (iteratorFn !== propValue.entries) {
|
|
12198
|
+
while (!(step = iterator.next()).done) {
|
|
12199
|
+
if (!isNode(step.value)) {
|
|
12200
|
+
return false;
|
|
12201
|
+
}
|
|
12202
|
+
}
|
|
12203
|
+
} else {
|
|
12204
|
+
// Iterator will provide entry [k,v] tuples rather than values.
|
|
12205
|
+
while (!(step = iterator.next()).done) {
|
|
12206
|
+
var entry = step.value;
|
|
12207
|
+
if (entry) {
|
|
12208
|
+
if (!isNode(entry[1])) {
|
|
12209
|
+
return false;
|
|
12210
|
+
}
|
|
12211
|
+
}
|
|
12212
|
+
}
|
|
12213
|
+
}
|
|
12214
|
+
} else {
|
|
12215
|
+
return false;
|
|
12216
|
+
}
|
|
12217
|
+
|
|
12218
|
+
return true;
|
|
12219
|
+
default:
|
|
12220
|
+
return false;
|
|
12221
|
+
}
|
|
12222
|
+
}
|
|
12223
|
+
|
|
12224
|
+
function isSymbol(propType, propValue) {
|
|
12225
|
+
// Native Symbol.
|
|
12226
|
+
if (propType === 'symbol') {
|
|
12227
|
+
return true;
|
|
12228
|
+
}
|
|
12229
|
+
|
|
12230
|
+
// falsy value can't be a Symbol
|
|
12231
|
+
if (!propValue) {
|
|
12232
|
+
return false;
|
|
12233
|
+
}
|
|
12234
|
+
|
|
12235
|
+
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
12236
|
+
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
12237
|
+
return true;
|
|
12238
|
+
}
|
|
12239
|
+
|
|
12240
|
+
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
12241
|
+
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
12242
|
+
return true;
|
|
12243
|
+
}
|
|
12244
|
+
|
|
12245
|
+
return false;
|
|
12246
|
+
}
|
|
12247
|
+
|
|
12248
|
+
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
12249
|
+
function getPropType(propValue) {
|
|
12250
|
+
var propType = typeof propValue;
|
|
12251
|
+
if (Array.isArray(propValue)) {
|
|
12252
|
+
return 'array';
|
|
12253
|
+
}
|
|
12254
|
+
if (propValue instanceof RegExp) {
|
|
12255
|
+
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
12256
|
+
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
12257
|
+
// passes PropTypes.object.
|
|
12258
|
+
return 'object';
|
|
12259
|
+
}
|
|
12260
|
+
if (isSymbol(propType, propValue)) {
|
|
12261
|
+
return 'symbol';
|
|
12262
|
+
}
|
|
12263
|
+
return propType;
|
|
12264
|
+
}
|
|
12265
|
+
|
|
12266
|
+
// This handles more types than `getPropType`. Only used for error messages.
|
|
12267
|
+
// See `createPrimitiveTypeChecker`.
|
|
12268
|
+
function getPreciseType(propValue) {
|
|
12269
|
+
if (typeof propValue === 'undefined' || propValue === null) {
|
|
12270
|
+
return '' + propValue;
|
|
12271
|
+
}
|
|
12272
|
+
var propType = getPropType(propValue);
|
|
12273
|
+
if (propType === 'object') {
|
|
12274
|
+
if (propValue instanceof Date) {
|
|
12275
|
+
return 'date';
|
|
12276
|
+
} else if (propValue instanceof RegExp) {
|
|
12277
|
+
return 'regexp';
|
|
12278
|
+
}
|
|
12279
|
+
}
|
|
12280
|
+
return propType;
|
|
12281
|
+
}
|
|
12282
|
+
|
|
12283
|
+
// Returns a string that is postfixed to a warning about an invalid type.
|
|
12284
|
+
// For example, "undefined" or "of type array"
|
|
12285
|
+
function getPostfixForTypeWarning(value) {
|
|
12286
|
+
var type = getPreciseType(value);
|
|
12287
|
+
switch (type) {
|
|
12288
|
+
case 'array':
|
|
12289
|
+
case 'object':
|
|
12290
|
+
return 'an ' + type;
|
|
12291
|
+
case 'boolean':
|
|
12292
|
+
case 'date':
|
|
12293
|
+
case 'regexp':
|
|
12294
|
+
return 'a ' + type;
|
|
12295
|
+
default:
|
|
12296
|
+
return type;
|
|
12297
|
+
}
|
|
12298
|
+
}
|
|
12299
|
+
|
|
12300
|
+
// Returns class name of the object, if any.
|
|
12301
|
+
function getClassName(propValue) {
|
|
12302
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
12303
|
+
return ANONYMOUS;
|
|
12304
|
+
}
|
|
12305
|
+
return propValue.constructor.name;
|
|
12306
|
+
}
|
|
12307
|
+
|
|
12308
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
12309
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
12310
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
12311
|
+
|
|
12312
|
+
return ReactPropTypes;
|
|
12313
|
+
};
|
|
12314
|
+
|
|
12315
|
+
/**
|
|
12316
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
12317
|
+
*
|
|
12318
|
+
* This source code is licensed under the MIT license found in the
|
|
12319
|
+
* LICENSE file in the root directory of this source tree.
|
|
12320
|
+
*/
|
|
12321
|
+
|
|
12322
|
+
var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
|
12323
|
+
|
|
12324
|
+
function emptyFunction() {}
|
|
12325
|
+
function emptyFunctionWithReset() {}
|
|
12326
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
12327
|
+
|
|
12328
|
+
var factoryWithThrowingShims = function() {
|
|
12329
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
12330
|
+
if (secret === ReactPropTypesSecret) {
|
|
12331
|
+
// It is still safe when called from React.
|
|
12332
|
+
return;
|
|
12333
|
+
}
|
|
12334
|
+
var err = new Error(
|
|
12335
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
12336
|
+
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
12337
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
12338
|
+
);
|
|
12339
|
+
err.name = 'Invariant Violation';
|
|
12340
|
+
throw err;
|
|
12341
|
+
} shim.isRequired = shim;
|
|
12342
|
+
function getShim() {
|
|
12343
|
+
return shim;
|
|
12344
|
+
} // Important!
|
|
12345
|
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
12346
|
+
var ReactPropTypes = {
|
|
12347
|
+
array: shim,
|
|
12348
|
+
bigint: shim,
|
|
12349
|
+
bool: shim,
|
|
12350
|
+
func: shim,
|
|
12351
|
+
number: shim,
|
|
12352
|
+
object: shim,
|
|
12353
|
+
string: shim,
|
|
12354
|
+
symbol: shim,
|
|
12355
|
+
|
|
12356
|
+
any: shim,
|
|
12357
|
+
arrayOf: getShim,
|
|
12358
|
+
element: shim,
|
|
12359
|
+
elementType: shim,
|
|
12360
|
+
instanceOf: getShim,
|
|
12361
|
+
node: shim,
|
|
12362
|
+
objectOf: getShim,
|
|
12363
|
+
oneOf: getShim,
|
|
12364
|
+
oneOfType: getShim,
|
|
12365
|
+
shape: getShim,
|
|
12366
|
+
exact: getShim,
|
|
12367
|
+
|
|
12368
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
12369
|
+
resetWarningCache: emptyFunction
|
|
12370
|
+
};
|
|
12371
|
+
|
|
12372
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
12373
|
+
|
|
12374
|
+
return ReactPropTypes;
|
|
12375
|
+
};
|
|
12376
|
+
|
|
12377
|
+
/**
|
|
12378
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
12379
|
+
*
|
|
12380
|
+
* This source code is licensed under the MIT license found in the
|
|
12381
|
+
* LICENSE file in the root directory of this source tree.
|
|
12382
|
+
*/
|
|
12383
|
+
|
|
12384
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
12385
|
+
var ReactIs = reactIs$1.exports;
|
|
12386
|
+
|
|
12387
|
+
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
12388
|
+
// http://fb.me/prop-types-in-prod
|
|
12389
|
+
var throwOnDirectAccess = true;
|
|
12390
|
+
propTypes.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess);
|
|
12391
|
+
} else {
|
|
12392
|
+
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
12393
|
+
// http://fb.me/prop-types-in-prod
|
|
12394
|
+
propTypes.exports = factoryWithThrowingShims();
|
|
12395
|
+
}
|
|
12396
|
+
|
|
12397
|
+
var PropTypes = propTypes.exports;
|
|
12398
|
+
|
|
12399
|
+
var COMMON_MIME_TYPES = new Map([
|
|
12400
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
|
|
12401
|
+
['aac', 'audio/aac'],
|
|
12402
|
+
['abw', 'application/x-abiword'],
|
|
12403
|
+
['arc', 'application/x-freearc'],
|
|
12404
|
+
['avif', 'image/avif'],
|
|
12405
|
+
['avi', 'video/x-msvideo'],
|
|
12406
|
+
['azw', 'application/vnd.amazon.ebook'],
|
|
12407
|
+
['bin', 'application/octet-stream'],
|
|
12408
|
+
['bmp', 'image/bmp'],
|
|
12409
|
+
['bz', 'application/x-bzip'],
|
|
12410
|
+
['bz2', 'application/x-bzip2'],
|
|
12411
|
+
['cda', 'application/x-cdf'],
|
|
12412
|
+
['csh', 'application/x-csh'],
|
|
12413
|
+
['css', 'text/css'],
|
|
12414
|
+
['csv', 'text/csv'],
|
|
12415
|
+
['doc', 'application/msword'],
|
|
12416
|
+
['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],
|
|
12417
|
+
['eot', 'application/vnd.ms-fontobject'],
|
|
12418
|
+
['epub', 'application/epub+zip'],
|
|
12419
|
+
['gz', 'application/gzip'],
|
|
12420
|
+
['gif', 'image/gif'],
|
|
12421
|
+
['heic', 'image/heic'],
|
|
12422
|
+
['heif', 'image/heif'],
|
|
12423
|
+
['htm', 'text/html'],
|
|
12424
|
+
['html', 'text/html'],
|
|
12425
|
+
['ico', 'image/vnd.microsoft.icon'],
|
|
12426
|
+
['ics', 'text/calendar'],
|
|
12427
|
+
['jar', 'application/java-archive'],
|
|
12428
|
+
['jpeg', 'image/jpeg'],
|
|
12429
|
+
['jpg', 'image/jpeg'],
|
|
12430
|
+
['js', 'text/javascript'],
|
|
12431
|
+
['json', 'application/json'],
|
|
12432
|
+
['jsonld', 'application/ld+json'],
|
|
12433
|
+
['mid', 'audio/midi'],
|
|
12434
|
+
['midi', 'audio/midi'],
|
|
12435
|
+
['mjs', 'text/javascript'],
|
|
12436
|
+
['mp3', 'audio/mpeg'],
|
|
12437
|
+
['mp4', 'video/mp4'],
|
|
12438
|
+
['mpeg', 'video/mpeg'],
|
|
12439
|
+
['mpkg', 'application/vnd.apple.installer+xml'],
|
|
12440
|
+
['odp', 'application/vnd.oasis.opendocument.presentation'],
|
|
12441
|
+
['ods', 'application/vnd.oasis.opendocument.spreadsheet'],
|
|
12442
|
+
['odt', 'application/vnd.oasis.opendocument.text'],
|
|
12443
|
+
['oga', 'audio/ogg'],
|
|
12444
|
+
['ogv', 'video/ogg'],
|
|
12445
|
+
['ogx', 'application/ogg'],
|
|
12446
|
+
['opus', 'audio/opus'],
|
|
12447
|
+
['otf', 'font/otf'],
|
|
12448
|
+
['png', 'image/png'],
|
|
12449
|
+
['pdf', 'application/pdf'],
|
|
12450
|
+
['php', 'application/x-httpd-php'],
|
|
12451
|
+
['ppt', 'application/vnd.ms-powerpoint'],
|
|
12452
|
+
['pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'],
|
|
12453
|
+
['rar', 'application/vnd.rar'],
|
|
12454
|
+
['rtf', 'application/rtf'],
|
|
12455
|
+
['sh', 'application/x-sh'],
|
|
12456
|
+
['svg', 'image/svg+xml'],
|
|
12457
|
+
['swf', 'application/x-shockwave-flash'],
|
|
12458
|
+
['tar', 'application/x-tar'],
|
|
12459
|
+
['tif', 'image/tiff'],
|
|
12460
|
+
['tiff', 'image/tiff'],
|
|
12461
|
+
['ts', 'video/mp2t'],
|
|
12462
|
+
['ttf', 'font/ttf'],
|
|
12463
|
+
['txt', 'text/plain'],
|
|
12464
|
+
['vsd', 'application/vnd.visio'],
|
|
12465
|
+
['wav', 'audio/wav'],
|
|
12466
|
+
['weba', 'audio/webm'],
|
|
12467
|
+
['webm', 'video/webm'],
|
|
12468
|
+
['webp', 'image/webp'],
|
|
12469
|
+
['woff', 'font/woff'],
|
|
12470
|
+
['woff2', 'font/woff2'],
|
|
12471
|
+
['xhtml', 'application/xhtml+xml'],
|
|
12472
|
+
['xls', 'application/vnd.ms-excel'],
|
|
12473
|
+
['xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],
|
|
12474
|
+
['xml', 'application/xml'],
|
|
12475
|
+
['xul', 'application/vnd.mozilla.xul+xml'],
|
|
12476
|
+
['zip', 'application/zip'],
|
|
12477
|
+
['7z', 'application/x-7z-compressed'],
|
|
12478
|
+
// Others
|
|
12479
|
+
['mkv', 'video/x-matroska'],
|
|
12480
|
+
['mov', 'video/quicktime'],
|
|
12481
|
+
['msg', 'application/vnd.ms-outlook']
|
|
12482
|
+
]);
|
|
12483
|
+
function toFileWithPath(file, path) {
|
|
12484
|
+
var f = withMimeType(file);
|
|
12485
|
+
if (typeof f.path !== 'string') { // on electron, path is already set to the absolute path
|
|
12486
|
+
var webkitRelativePath = file.webkitRelativePath;
|
|
12487
|
+
Object.defineProperty(f, 'path', {
|
|
12488
|
+
value: typeof path === 'string'
|
|
12489
|
+
? path
|
|
12490
|
+
// If <input webkitdirectory> is set,
|
|
12491
|
+
// the File will have a {webkitRelativePath} property
|
|
12492
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory
|
|
12493
|
+
: typeof webkitRelativePath === 'string' && webkitRelativePath.length > 0
|
|
12494
|
+
? webkitRelativePath
|
|
12495
|
+
: file.name,
|
|
12496
|
+
writable: false,
|
|
12497
|
+
configurable: false,
|
|
12498
|
+
enumerable: true
|
|
12499
|
+
});
|
|
12500
|
+
}
|
|
12501
|
+
return f;
|
|
12502
|
+
}
|
|
12503
|
+
function withMimeType(file) {
|
|
12504
|
+
var name = file.name;
|
|
12505
|
+
var hasExtension = name && name.lastIndexOf('.') !== -1;
|
|
12506
|
+
if (hasExtension && !file.type) {
|
|
12507
|
+
var ext = name.split('.')
|
|
12508
|
+
.pop().toLowerCase();
|
|
12509
|
+
var type = COMMON_MIME_TYPES.get(ext);
|
|
12510
|
+
if (type) {
|
|
12511
|
+
Object.defineProperty(file, 'type', {
|
|
12512
|
+
value: type,
|
|
12513
|
+
writable: false,
|
|
12514
|
+
configurable: false,
|
|
12515
|
+
enumerable: true
|
|
12516
|
+
});
|
|
12517
|
+
}
|
|
12518
|
+
}
|
|
12519
|
+
return file;
|
|
12520
|
+
}
|
|
12521
|
+
|
|
12522
|
+
var FILES_TO_IGNORE = [
|
|
12523
|
+
// Thumbnail cache files for macOS and Windows
|
|
12524
|
+
'.DS_Store',
|
|
12525
|
+
'Thumbs.db' // Windows
|
|
12526
|
+
];
|
|
12527
|
+
/**
|
|
12528
|
+
* Convert a DragEvent's DataTrasfer object to a list of File objects
|
|
12529
|
+
* NOTE: If some of the items are folders,
|
|
12530
|
+
* everything will be flattened and placed in the same list but the paths will be kept as a {path} property.
|
|
12531
|
+
*
|
|
12532
|
+
* EXPERIMENTAL: A list of https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle objects can also be passed as an arg
|
|
12533
|
+
* and a list of File objects will be returned.
|
|
12534
|
+
*
|
|
12535
|
+
* @param evt
|
|
12536
|
+
*/
|
|
12537
|
+
function fromEvent(evt) {
|
|
12538
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
12539
|
+
return __generator(this, function (_a) {
|
|
12540
|
+
if (isObject(evt) && isDataTransfer(evt.dataTransfer)) {
|
|
12541
|
+
return [2 /*return*/, getDataTransferFiles(evt.dataTransfer, evt.type)];
|
|
12542
|
+
}
|
|
12543
|
+
else if (isChangeEvt(evt)) {
|
|
12544
|
+
return [2 /*return*/, getInputFiles(evt)];
|
|
12545
|
+
}
|
|
12546
|
+
else if (Array.isArray(evt) && evt.every(function (item) { return 'getFile' in item && typeof item.getFile === 'function'; })) {
|
|
12547
|
+
return [2 /*return*/, getFsHandleFiles(evt)];
|
|
12548
|
+
}
|
|
12549
|
+
return [2 /*return*/, []];
|
|
12550
|
+
});
|
|
12551
|
+
});
|
|
12552
|
+
}
|
|
12553
|
+
function isDataTransfer(value) {
|
|
12554
|
+
return isObject(value);
|
|
12555
|
+
}
|
|
12556
|
+
function isChangeEvt(value) {
|
|
12557
|
+
return isObject(value) && isObject(value.target);
|
|
12558
|
+
}
|
|
12559
|
+
function isObject(v) {
|
|
12560
|
+
return typeof v === 'object' && v !== null;
|
|
12561
|
+
}
|
|
12562
|
+
function getInputFiles(evt) {
|
|
12563
|
+
return fromList(evt.target.files).map(function (file) { return toFileWithPath(file); });
|
|
12564
|
+
}
|
|
12565
|
+
// Ee expect each handle to be https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle
|
|
12566
|
+
function getFsHandleFiles(handles) {
|
|
12567
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
12568
|
+
var files;
|
|
12569
|
+
return __generator(this, function (_a) {
|
|
12570
|
+
switch (_a.label) {
|
|
12571
|
+
case 0: return [4 /*yield*/, Promise.all(handles.map(function (h) { return h.getFile(); }))];
|
|
12572
|
+
case 1:
|
|
12573
|
+
files = _a.sent();
|
|
12574
|
+
return [2 /*return*/, files.map(function (file) { return toFileWithPath(file); })];
|
|
12575
|
+
}
|
|
12576
|
+
});
|
|
12577
|
+
});
|
|
12578
|
+
}
|
|
12579
|
+
function getDataTransferFiles(dt, type) {
|
|
12580
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
12581
|
+
var items, files;
|
|
12582
|
+
return __generator(this, function (_a) {
|
|
12583
|
+
switch (_a.label) {
|
|
12584
|
+
case 0:
|
|
12585
|
+
if (!dt.items) return [3 /*break*/, 2];
|
|
12586
|
+
items = fromList(dt.items)
|
|
12587
|
+
.filter(function (item) { return item.kind === 'file'; });
|
|
12588
|
+
// According to https://html.spec.whatwg.org/multipage/dnd.html#dndevents,
|
|
12589
|
+
// only 'dragstart' and 'drop' has access to the data (source node)
|
|
12590
|
+
if (type !== 'drop') {
|
|
12591
|
+
return [2 /*return*/, items];
|
|
12592
|
+
}
|
|
12593
|
+
return [4 /*yield*/, Promise.all(items.map(toFilePromises))];
|
|
12594
|
+
case 1:
|
|
12595
|
+
files = _a.sent();
|
|
12596
|
+
return [2 /*return*/, noIgnoredFiles(flatten(files))];
|
|
12597
|
+
case 2: return [2 /*return*/, noIgnoredFiles(fromList(dt.files)
|
|
12598
|
+
.map(function (file) { return toFileWithPath(file); }))];
|
|
12599
|
+
}
|
|
12600
|
+
});
|
|
12601
|
+
});
|
|
12602
|
+
}
|
|
12603
|
+
function noIgnoredFiles(files) {
|
|
12604
|
+
return files.filter(function (file) { return FILES_TO_IGNORE.indexOf(file.name) === -1; });
|
|
12605
|
+
}
|
|
12606
|
+
// IE11 does not support Array.from()
|
|
12607
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from#Browser_compatibility
|
|
12608
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/FileList
|
|
12609
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList
|
|
12610
|
+
function fromList(items) {
|
|
12611
|
+
if (items === null) {
|
|
12612
|
+
return [];
|
|
12613
|
+
}
|
|
12614
|
+
var files = [];
|
|
12615
|
+
// tslint:disable: prefer-for-of
|
|
12616
|
+
for (var i = 0; i < items.length; i++) {
|
|
12617
|
+
var file = items[i];
|
|
12618
|
+
files.push(file);
|
|
12619
|
+
}
|
|
12620
|
+
return files;
|
|
12621
|
+
}
|
|
12622
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem
|
|
12623
|
+
function toFilePromises(item) {
|
|
12624
|
+
if (typeof item.webkitGetAsEntry !== 'function') {
|
|
12625
|
+
return fromDataTransferItem(item);
|
|
12626
|
+
}
|
|
12627
|
+
var entry = item.webkitGetAsEntry();
|
|
12628
|
+
// Safari supports dropping an image node from a different window and can be retrieved using
|
|
12629
|
+
// the DataTransferItem.getAsFile() API
|
|
12630
|
+
// NOTE: FileSystemEntry.file() throws if trying to get the file
|
|
12631
|
+
if (entry && entry.isDirectory) {
|
|
12632
|
+
return fromDirEntry(entry);
|
|
12633
|
+
}
|
|
12634
|
+
return fromDataTransferItem(item);
|
|
12635
|
+
}
|
|
12636
|
+
function flatten(items) {
|
|
12637
|
+
return items.reduce(function (acc, files) { return __spreadArray(__spreadArray([], __read(acc), false), __read((Array.isArray(files) ? flatten(files) : [files])), false); }, []);
|
|
12638
|
+
}
|
|
12639
|
+
function fromDataTransferItem(item) {
|
|
12640
|
+
var file = item.getAsFile();
|
|
12641
|
+
if (!file) {
|
|
12642
|
+
return Promise.reject("".concat(item, " is not a File"));
|
|
12643
|
+
}
|
|
12644
|
+
var fwp = toFileWithPath(file);
|
|
12645
|
+
return Promise.resolve(fwp);
|
|
12646
|
+
}
|
|
12647
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemEntry
|
|
12648
|
+
function fromEntry(entry) {
|
|
12649
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
12650
|
+
return __generator(this, function (_a) {
|
|
12651
|
+
return [2 /*return*/, entry.isDirectory ? fromDirEntry(entry) : fromFileEntry(entry)];
|
|
12652
|
+
});
|
|
12653
|
+
});
|
|
12654
|
+
}
|
|
12655
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry
|
|
12656
|
+
function fromDirEntry(entry) {
|
|
12657
|
+
var reader = entry.createReader();
|
|
12658
|
+
return new Promise(function (resolve, reject) {
|
|
12659
|
+
var entries = [];
|
|
12660
|
+
function readEntries() {
|
|
12661
|
+
var _this = this;
|
|
12662
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry/createReader
|
|
12663
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryReader/readEntries
|
|
12664
|
+
reader.readEntries(function (batch) { return __awaiter(_this, void 0, void 0, function () {
|
|
12665
|
+
var files, err_1, items;
|
|
12666
|
+
return __generator(this, function (_a) {
|
|
12667
|
+
switch (_a.label) {
|
|
12668
|
+
case 0:
|
|
12669
|
+
if (!!batch.length) return [3 /*break*/, 5];
|
|
12670
|
+
_a.label = 1;
|
|
12671
|
+
case 1:
|
|
12672
|
+
_a.trys.push([1, 3, , 4]);
|
|
12673
|
+
return [4 /*yield*/, Promise.all(entries)];
|
|
12674
|
+
case 2:
|
|
12675
|
+
files = _a.sent();
|
|
12676
|
+
resolve(files);
|
|
12677
|
+
return [3 /*break*/, 4];
|
|
12678
|
+
case 3:
|
|
12679
|
+
err_1 = _a.sent();
|
|
12680
|
+
reject(err_1);
|
|
12681
|
+
return [3 /*break*/, 4];
|
|
12682
|
+
case 4: return [3 /*break*/, 6];
|
|
12683
|
+
case 5:
|
|
12684
|
+
items = Promise.all(batch.map(fromEntry));
|
|
12685
|
+
entries.push(items);
|
|
12686
|
+
// Continue reading
|
|
12687
|
+
readEntries();
|
|
12688
|
+
_a.label = 6;
|
|
12689
|
+
case 6: return [2 /*return*/];
|
|
12690
|
+
}
|
|
12691
|
+
});
|
|
12692
|
+
}); }, function (err) {
|
|
12693
|
+
reject(err);
|
|
12694
|
+
});
|
|
12695
|
+
}
|
|
12696
|
+
readEntries();
|
|
12697
|
+
});
|
|
12698
|
+
}
|
|
12699
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileEntry
|
|
12700
|
+
function fromFileEntry(entry) {
|
|
12701
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
12702
|
+
return __generator(this, function (_a) {
|
|
12703
|
+
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
12704
|
+
entry.file(function (file) {
|
|
12705
|
+
var fwp = toFileWithPath(file, entry.fullPath);
|
|
12706
|
+
resolve(fwp);
|
|
12707
|
+
}, function (err) {
|
|
12708
|
+
reject(err);
|
|
12709
|
+
});
|
|
12710
|
+
})];
|
|
12711
|
+
});
|
|
12712
|
+
});
|
|
12713
|
+
}
|
|
12714
|
+
|
|
12715
|
+
var _default = function (file, acceptedFiles) {
|
|
12716
|
+
if (file && acceptedFiles) {
|
|
12717
|
+
var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(',');
|
|
12718
|
+
var fileName = file.name || '';
|
|
12719
|
+
var mimeType = (file.type || '').toLowerCase();
|
|
12720
|
+
var baseMimeType = mimeType.replace(/\/.*$/, '');
|
|
12721
|
+
return acceptedFilesArray.some(function (type) {
|
|
12722
|
+
var validType = type.trim().toLowerCase();
|
|
12723
|
+
|
|
12724
|
+
if (validType.charAt(0) === '.') {
|
|
12725
|
+
return fileName.toLowerCase().endsWith(validType);
|
|
12726
|
+
} else if (validType.endsWith('/*')) {
|
|
12727
|
+
// This is something like a image/* mime type
|
|
12728
|
+
return baseMimeType === validType.replace(/\/.*$/, '');
|
|
12729
|
+
}
|
|
12730
|
+
|
|
12731
|
+
return mimeType === validType;
|
|
12732
|
+
});
|
|
12733
|
+
}
|
|
12734
|
+
|
|
12735
|
+
return true;
|
|
12736
|
+
};
|
|
12737
|
+
|
|
12738
|
+
function _toConsumableArray$1(arr) { return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread$1(); }
|
|
12739
|
+
|
|
12740
|
+
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."); }
|
|
12741
|
+
|
|
12742
|
+
function _iterableToArray$1(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
12743
|
+
|
|
12744
|
+
function _arrayWithoutHoles$1(arr) { if (Array.isArray(arr)) return _arrayLikeToArray$1(arr); }
|
|
12745
|
+
|
|
12746
|
+
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; }
|
|
12747
|
+
|
|
12748
|
+
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; }
|
|
12749
|
+
|
|
12750
|
+
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; }
|
|
12751
|
+
|
|
12752
|
+
function _slicedToArray$1(arr, i) { return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest$1(); }
|
|
12753
|
+
|
|
12754
|
+
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."); }
|
|
12755
|
+
|
|
12756
|
+
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); }
|
|
12757
|
+
|
|
12758
|
+
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; }
|
|
12759
|
+
|
|
12760
|
+
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; }
|
|
12761
|
+
|
|
12762
|
+
function _arrayWithHoles$1(arr) { if (Array.isArray(arr)) return arr; }
|
|
12763
|
+
|
|
12764
|
+
var FILE_INVALID_TYPE = "file-invalid-type";
|
|
12765
|
+
var FILE_TOO_LARGE = "file-too-large";
|
|
12766
|
+
var FILE_TOO_SMALL = "file-too-small";
|
|
12767
|
+
var TOO_MANY_FILES = "too-many-files";
|
|
12768
|
+
|
|
12769
|
+
var getInvalidTypeRejectionErr = function getInvalidTypeRejectionErr(accept) {
|
|
12770
|
+
accept = Array.isArray(accept) && accept.length === 1 ? accept[0] : accept;
|
|
12771
|
+
var messageSuffix = Array.isArray(accept) ? "one of ".concat(accept.join(", ")) : accept;
|
|
12772
|
+
return {
|
|
12773
|
+
code: FILE_INVALID_TYPE,
|
|
12774
|
+
message: "File type must be ".concat(messageSuffix)
|
|
12775
|
+
};
|
|
12776
|
+
};
|
|
12777
|
+
var getTooLargeRejectionErr = function getTooLargeRejectionErr(maxSize) {
|
|
12778
|
+
return {
|
|
12779
|
+
code: FILE_TOO_LARGE,
|
|
12780
|
+
message: "File is larger than ".concat(maxSize, " ").concat(maxSize === 1 ? "byte" : "bytes")
|
|
12781
|
+
};
|
|
12782
|
+
};
|
|
12783
|
+
var getTooSmallRejectionErr = function getTooSmallRejectionErr(minSize) {
|
|
12784
|
+
return {
|
|
12785
|
+
code: FILE_TOO_SMALL,
|
|
12786
|
+
message: "File is smaller than ".concat(minSize, " ").concat(minSize === 1 ? "byte" : "bytes")
|
|
12787
|
+
};
|
|
12788
|
+
};
|
|
12789
|
+
var TOO_MANY_FILES_REJECTION = {
|
|
12790
|
+
code: TOO_MANY_FILES,
|
|
12791
|
+
message: "Too many files"
|
|
12792
|
+
}; // Firefox versions prior to 53 return a bogus MIME type for every file drag, so dragovers with
|
|
12793
|
+
// that MIME type will always be accepted
|
|
12794
|
+
|
|
12795
|
+
function fileAccepted(file, accept) {
|
|
12796
|
+
var isAcceptable = file.type === "application/x-moz-file" || _default(file, accept);
|
|
12797
|
+
return [isAcceptable, isAcceptable ? null : getInvalidTypeRejectionErr(accept)];
|
|
12798
|
+
}
|
|
12799
|
+
function fileMatchSize(file, minSize, maxSize) {
|
|
12800
|
+
if (isDefined(file.size)) {
|
|
12801
|
+
if (isDefined(minSize) && isDefined(maxSize)) {
|
|
12802
|
+
if (file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];
|
|
12803
|
+
if (file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];
|
|
12804
|
+
} else if (isDefined(minSize) && file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];else if (isDefined(maxSize) && file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];
|
|
12805
|
+
}
|
|
12806
|
+
|
|
12807
|
+
return [true, null];
|
|
12808
|
+
}
|
|
12809
|
+
|
|
12810
|
+
function isDefined(value) {
|
|
12811
|
+
return value !== undefined && value !== null;
|
|
12812
|
+
}
|
|
12813
|
+
/**
|
|
12814
|
+
*
|
|
12815
|
+
* @param {object} options
|
|
12816
|
+
* @param {File[]} options.files
|
|
12817
|
+
* @param {string|string[]} [options.accept]
|
|
12818
|
+
* @param {number} [options.minSize]
|
|
12819
|
+
* @param {number} [options.maxSize]
|
|
12820
|
+
* @param {boolean} [options.multiple]
|
|
12821
|
+
* @param {number} [options.maxFiles]
|
|
12822
|
+
* @param {(f: File) => FileError|FileError[]|null} [options.validator]
|
|
12823
|
+
* @returns
|
|
12824
|
+
*/
|
|
12825
|
+
|
|
12826
|
+
|
|
12827
|
+
function allFilesAccepted(_ref) {
|
|
12828
|
+
var files = _ref.files,
|
|
12829
|
+
accept = _ref.accept,
|
|
12830
|
+
minSize = _ref.minSize,
|
|
12831
|
+
maxSize = _ref.maxSize,
|
|
12832
|
+
multiple = _ref.multiple,
|
|
12833
|
+
maxFiles = _ref.maxFiles,
|
|
12834
|
+
validator = _ref.validator;
|
|
12835
|
+
|
|
12836
|
+
if (!multiple && files.length > 1 || multiple && maxFiles >= 1 && files.length > maxFiles) {
|
|
12837
|
+
return false;
|
|
12838
|
+
}
|
|
12839
|
+
|
|
12840
|
+
return files.every(function (file) {
|
|
12841
|
+
var _fileAccepted = fileAccepted(file, accept),
|
|
12842
|
+
_fileAccepted2 = _slicedToArray$1(_fileAccepted, 1),
|
|
12843
|
+
accepted = _fileAccepted2[0];
|
|
12844
|
+
|
|
12845
|
+
var _fileMatchSize = fileMatchSize(file, minSize, maxSize),
|
|
12846
|
+
_fileMatchSize2 = _slicedToArray$1(_fileMatchSize, 1),
|
|
12847
|
+
sizeMatch = _fileMatchSize2[0];
|
|
12848
|
+
|
|
12849
|
+
var customErrors = validator ? validator(file) : null;
|
|
12850
|
+
return accepted && sizeMatch && !customErrors;
|
|
12851
|
+
});
|
|
12852
|
+
} // React's synthetic events has event.isPropagationStopped,
|
|
12853
|
+
// but to remain compatibility with other libs (Preact) fall back
|
|
12854
|
+
// to check event.cancelBubble
|
|
12855
|
+
|
|
12856
|
+
function isPropagationStopped(event) {
|
|
12857
|
+
if (typeof event.isPropagationStopped === "function") {
|
|
12858
|
+
return event.isPropagationStopped();
|
|
12859
|
+
} else if (typeof event.cancelBubble !== "undefined") {
|
|
12860
|
+
return event.cancelBubble;
|
|
12861
|
+
}
|
|
12862
|
+
|
|
12863
|
+
return false;
|
|
12864
|
+
}
|
|
12865
|
+
function isEvtWithFiles(event) {
|
|
12866
|
+
if (!event.dataTransfer) {
|
|
12867
|
+
return !!event.target && !!event.target.files;
|
|
12868
|
+
} // https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/types
|
|
12869
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types#file
|
|
12870
|
+
|
|
12871
|
+
|
|
12872
|
+
return Array.prototype.some.call(event.dataTransfer.types, function (type) {
|
|
12873
|
+
return type === "Files" || type === "application/x-moz-file";
|
|
12874
|
+
});
|
|
12875
|
+
}
|
|
12876
|
+
|
|
12877
|
+
function onDocumentDragOver(event) {
|
|
12878
|
+
event.preventDefault();
|
|
12879
|
+
}
|
|
12880
|
+
|
|
12881
|
+
function isIe(userAgent) {
|
|
12882
|
+
return userAgent.indexOf("MSIE") !== -1 || userAgent.indexOf("Trident/") !== -1;
|
|
12883
|
+
}
|
|
12884
|
+
|
|
12885
|
+
function isEdge(userAgent) {
|
|
12886
|
+
return userAgent.indexOf("Edge/") !== -1;
|
|
12887
|
+
}
|
|
12888
|
+
|
|
12889
|
+
function isIeOrEdge() {
|
|
12890
|
+
var userAgent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.navigator.userAgent;
|
|
12891
|
+
return isIe(userAgent) || isEdge(userAgent);
|
|
12892
|
+
}
|
|
12893
|
+
/**
|
|
12894
|
+
* This is intended to be used to compose event handlers
|
|
12895
|
+
* They are executed in order until one of them calls `event.isPropagationStopped()`.
|
|
12896
|
+
* Note that the check is done on the first invoke too,
|
|
12897
|
+
* meaning that if propagation was stopped before invoking the fns,
|
|
12898
|
+
* no handlers will be executed.
|
|
12899
|
+
*
|
|
12900
|
+
* @param {Function} fns the event hanlder functions
|
|
12901
|
+
* @return {Function} the event handler to add to an element
|
|
12902
|
+
*/
|
|
12903
|
+
|
|
12904
|
+
function composeEventHandlers() {
|
|
12905
|
+
for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
12906
|
+
fns[_key] = arguments[_key];
|
|
12907
|
+
}
|
|
12908
|
+
|
|
12909
|
+
return function (event) {
|
|
12910
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
12911
|
+
args[_key2 - 1] = arguments[_key2];
|
|
12912
|
+
}
|
|
12913
|
+
|
|
12914
|
+
return fns.some(function (fn) {
|
|
12915
|
+
if (!isPropagationStopped(event) && fn) {
|
|
12916
|
+
fn.apply(void 0, [event].concat(args));
|
|
12917
|
+
}
|
|
12918
|
+
|
|
12919
|
+
return isPropagationStopped(event);
|
|
12920
|
+
});
|
|
12921
|
+
};
|
|
12922
|
+
}
|
|
12923
|
+
/**
|
|
12924
|
+
* canUseFileSystemAccessAPI checks if the [File System Access API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API)
|
|
12925
|
+
* is supported by the browser.
|
|
12926
|
+
* @returns {boolean}
|
|
12927
|
+
*/
|
|
12928
|
+
|
|
12929
|
+
function canUseFileSystemAccessAPI() {
|
|
12930
|
+
return "showOpenFilePicker" in window;
|
|
12931
|
+
}
|
|
12932
|
+
/**
|
|
12933
|
+
* Convert the `{accept}` dropzone prop to the
|
|
12934
|
+
* `{types}` option for https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker
|
|
12935
|
+
*
|
|
12936
|
+
* @param {AcceptProp} accept
|
|
12937
|
+
* @returns {{accept: string[]}[]}
|
|
12938
|
+
*/
|
|
12939
|
+
|
|
12940
|
+
function pickerOptionsFromAccept(accept) {
|
|
12941
|
+
if (isDefined(accept)) {
|
|
12942
|
+
var acceptForPicker = Object.entries(accept).filter(function (_ref2) {
|
|
12943
|
+
var _ref3 = _slicedToArray$1(_ref2, 2),
|
|
12944
|
+
mimeType = _ref3[0],
|
|
12945
|
+
ext = _ref3[1];
|
|
12946
|
+
|
|
12947
|
+
var ok = true;
|
|
12948
|
+
|
|
12949
|
+
if (!isMIMEType(mimeType)) {
|
|
12950
|
+
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."));
|
|
12951
|
+
ok = false;
|
|
12952
|
+
}
|
|
12953
|
+
|
|
12954
|
+
if (!Array.isArray(ext) || !ext.every(isExt)) {
|
|
12955
|
+
console.warn("Skipped \"".concat(mimeType, "\" because an invalid file extension was provided."));
|
|
12956
|
+
ok = false;
|
|
12957
|
+
}
|
|
12958
|
+
|
|
12959
|
+
return ok;
|
|
12960
|
+
}).reduce(function (agg, _ref4) {
|
|
12961
|
+
var _ref5 = _slicedToArray$1(_ref4, 2),
|
|
12962
|
+
mimeType = _ref5[0],
|
|
12963
|
+
ext = _ref5[1];
|
|
12964
|
+
|
|
12965
|
+
return _objectSpread$1(_objectSpread$1({}, agg), {}, _defineProperty$1({}, mimeType, ext));
|
|
12966
|
+
}, {});
|
|
12967
|
+
return [{
|
|
12968
|
+
// description is required due to https://crbug.com/1264708
|
|
12969
|
+
description: "Files",
|
|
12970
|
+
accept: acceptForPicker
|
|
12971
|
+
}];
|
|
12972
|
+
}
|
|
12973
|
+
|
|
12974
|
+
return accept;
|
|
12975
|
+
}
|
|
12976
|
+
/**
|
|
12977
|
+
* Convert the `{accept}` dropzone prop to an array of MIME types/extensions.
|
|
12978
|
+
* @param {AcceptProp} accept
|
|
12979
|
+
* @returns {string}
|
|
12980
|
+
*/
|
|
12981
|
+
|
|
12982
|
+
function acceptPropAsAcceptAttr(accept) {
|
|
12983
|
+
if (isDefined(accept)) {
|
|
12984
|
+
return Object.entries(accept).reduce(function (a, _ref6) {
|
|
12985
|
+
var _ref7 = _slicedToArray$1(_ref6, 2),
|
|
12986
|
+
mimeType = _ref7[0],
|
|
12987
|
+
ext = _ref7[1];
|
|
12988
|
+
|
|
12989
|
+
return [].concat(_toConsumableArray$1(a), [mimeType], _toConsumableArray$1(ext));
|
|
12990
|
+
}, []) // Silently discard invalid entries as pickerOptionsFromAccept warns about these
|
|
12991
|
+
.filter(function (v) {
|
|
12992
|
+
return isMIMEType(v) || isExt(v);
|
|
12993
|
+
}).join(",");
|
|
12994
|
+
}
|
|
12995
|
+
|
|
12996
|
+
return undefined;
|
|
12997
|
+
}
|
|
12998
|
+
/**
|
|
12999
|
+
* Check if v is an exception caused by aborting a request (e.g window.showOpenFilePicker()).
|
|
13000
|
+
*
|
|
13001
|
+
* See https://developer.mozilla.org/en-US/docs/Web/API/DOMException.
|
|
13002
|
+
* @param {any} v
|
|
13003
|
+
* @returns {boolean} True if v is an abort exception.
|
|
13004
|
+
*/
|
|
13005
|
+
|
|
13006
|
+
function isAbort(v) {
|
|
13007
|
+
return v instanceof DOMException && (v.name === "AbortError" || v.code === v.ABORT_ERR);
|
|
13008
|
+
}
|
|
13009
|
+
/**
|
|
13010
|
+
* Check if v is a security error.
|
|
13011
|
+
*
|
|
13012
|
+
* See https://developer.mozilla.org/en-US/docs/Web/API/DOMException.
|
|
13013
|
+
* @param {any} v
|
|
13014
|
+
* @returns {boolean} True if v is a security error.
|
|
13015
|
+
*/
|
|
13016
|
+
|
|
13017
|
+
function isSecurityError(v) {
|
|
13018
|
+
return v instanceof DOMException && (v.name === "SecurityError" || v.code === v.SECURITY_ERR);
|
|
13019
|
+
}
|
|
13020
|
+
/**
|
|
13021
|
+
* Check if v is a MIME type string.
|
|
13022
|
+
*
|
|
13023
|
+
* See accepted format: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers.
|
|
13024
|
+
*
|
|
13025
|
+
* @param {string} v
|
|
13026
|
+
*/
|
|
13027
|
+
|
|
13028
|
+
function isMIMEType(v) {
|
|
13029
|
+
return v === "audio/*" || v === "video/*" || v === "image/*" || v === "text/*" || /\w+\/[-+.\w]+/g.test(v);
|
|
13030
|
+
}
|
|
13031
|
+
/**
|
|
13032
|
+
* Check if v is a file extension.
|
|
13033
|
+
* @param {string} v
|
|
13034
|
+
*/
|
|
13035
|
+
|
|
13036
|
+
function isExt(v) {
|
|
13037
|
+
return /^.*\.[\w]+$/.test(v);
|
|
13038
|
+
}
|
|
13039
|
+
/**
|
|
13040
|
+
* @typedef {Object.<string, string[]>} AcceptProp
|
|
13041
|
+
*/
|
|
13042
|
+
|
|
13043
|
+
/**
|
|
13044
|
+
* @typedef {object} FileError
|
|
13045
|
+
* @property {string} message
|
|
13046
|
+
* @property {ErrorCode|string} code
|
|
13047
|
+
*/
|
|
13048
|
+
|
|
13049
|
+
/**
|
|
13050
|
+
* @typedef {"file-invalid-type"|"file-too-large"|"file-too-small"|"too-many-files"} ErrorCode
|
|
13051
|
+
*/
|
|
13052
|
+
|
|
13053
|
+
var _excluded = ["children"],
|
|
13054
|
+
_excluded2 = ["open"],
|
|
13055
|
+
_excluded3 = ["refKey", "role", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"],
|
|
13056
|
+
_excluded4 = ["refKey", "onChange", "onClick"];
|
|
13057
|
+
|
|
13058
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
13059
|
+
|
|
13060
|
+
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."); }
|
|
13061
|
+
|
|
13062
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
13063
|
+
|
|
13064
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
13065
|
+
|
|
13066
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13067
|
+
|
|
13068
|
+
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."); }
|
|
13069
|
+
|
|
13070
|
+
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); }
|
|
13071
|
+
|
|
13072
|
+
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; }
|
|
13073
|
+
|
|
13074
|
+
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; }
|
|
13075
|
+
|
|
13076
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13077
|
+
|
|
13078
|
+
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; }
|
|
13079
|
+
|
|
13080
|
+
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; }
|
|
13081
|
+
|
|
13082
|
+
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; }
|
|
13083
|
+
|
|
13084
|
+
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; }
|
|
13085
|
+
|
|
13086
|
+
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; }
|
|
13087
|
+
/**
|
|
13088
|
+
* Convenience wrapper component for the `useDropzone` hook
|
|
13089
|
+
*
|
|
13090
|
+
* ```jsx
|
|
13091
|
+
* <Dropzone>
|
|
13092
|
+
* {({getRootProps, getInputProps}) => (
|
|
13093
|
+
* <div {...getRootProps()}>
|
|
13094
|
+
* <input {...getInputProps()} />
|
|
13095
|
+
* <p>Drag 'n' drop some files here, or click to select files</p>
|
|
13096
|
+
* </div>
|
|
13097
|
+
* )}
|
|
13098
|
+
* </Dropzone>
|
|
13099
|
+
* ```
|
|
13100
|
+
*/
|
|
13101
|
+
|
|
13102
|
+
var Dropzone = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
13103
|
+
var children = _ref.children,
|
|
13104
|
+
params = _objectWithoutProperties(_ref, _excluded);
|
|
13105
|
+
|
|
13106
|
+
var _useDropzone = useDropzone(params),
|
|
13107
|
+
open = _useDropzone.open,
|
|
13108
|
+
props = _objectWithoutProperties(_useDropzone, _excluded2);
|
|
13109
|
+
|
|
13110
|
+
useImperativeHandle(ref, function () {
|
|
13111
|
+
return {
|
|
13112
|
+
open: open
|
|
13113
|
+
};
|
|
13114
|
+
}, [open]); // TODO: Figure out why react-styleguidist cannot create docs if we don't return a jsx element
|
|
13115
|
+
|
|
13116
|
+
return /*#__PURE__*/React__default.createElement(Fragment, null, children(_objectSpread(_objectSpread({}, props), {}, {
|
|
13117
|
+
open: open
|
|
13118
|
+
})));
|
|
13119
|
+
});
|
|
13120
|
+
Dropzone.displayName = "Dropzone"; // Add default props for react-docgen
|
|
13121
|
+
|
|
13122
|
+
var defaultProps = {
|
|
13123
|
+
disabled: false,
|
|
13124
|
+
getFilesFromEvent: fromEvent,
|
|
13125
|
+
maxSize: Infinity,
|
|
13126
|
+
minSize: 0,
|
|
13127
|
+
multiple: true,
|
|
13128
|
+
maxFiles: 0,
|
|
13129
|
+
preventDropOnDocument: true,
|
|
13130
|
+
noClick: false,
|
|
13131
|
+
noKeyboard: false,
|
|
13132
|
+
noDrag: false,
|
|
13133
|
+
noDragEventsBubbling: false,
|
|
13134
|
+
validator: null,
|
|
13135
|
+
useFsAccessApi: true,
|
|
13136
|
+
autoFocus: false
|
|
13137
|
+
};
|
|
13138
|
+
Dropzone.defaultProps = defaultProps;
|
|
13139
|
+
Dropzone.propTypes = {
|
|
13140
|
+
/**
|
|
13141
|
+
* Render function that exposes the dropzone state and prop getter fns
|
|
13142
|
+
*
|
|
13143
|
+
* @param {object} params
|
|
13144
|
+
* @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render
|
|
13145
|
+
* @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render
|
|
13146
|
+
* @param {Function} params.open Open the native file selection dialog
|
|
13147
|
+
* @param {boolean} params.isFocused Dropzone area is in focus
|
|
13148
|
+
* @param {boolean} params.isFileDialogActive File dialog is opened
|
|
13149
|
+
* @param {boolean} params.isDragActive Active drag is in progress
|
|
13150
|
+
* @param {boolean} params.isDragAccept Dragged files are accepted
|
|
13151
|
+
* @param {boolean} params.isDragReject Some dragged files are rejected
|
|
13152
|
+
* @param {File[]} params.acceptedFiles Accepted files
|
|
13153
|
+
* @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected
|
|
13154
|
+
*/
|
|
13155
|
+
children: PropTypes.func,
|
|
13156
|
+
|
|
13157
|
+
/**
|
|
13158
|
+
* Set accepted file types.
|
|
13159
|
+
* Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.
|
|
13160
|
+
* Keep in mind that mime type determination is not reliable across platforms. CSV files,
|
|
13161
|
+
* for example, are reported as text/plain under macOS but as application/vnd.ms-excel under
|
|
13162
|
+
* Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).
|
|
13163
|
+
*/
|
|
13164
|
+
accept: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)),
|
|
13165
|
+
|
|
13166
|
+
/**
|
|
13167
|
+
* Allow drag 'n' drop (or selection from the file dialog) of multiple files
|
|
13168
|
+
*/
|
|
13169
|
+
multiple: PropTypes.bool,
|
|
13170
|
+
|
|
13171
|
+
/**
|
|
13172
|
+
* If false, allow dropped items to take over the current browser window
|
|
13173
|
+
*/
|
|
13174
|
+
preventDropOnDocument: PropTypes.bool,
|
|
13175
|
+
|
|
13176
|
+
/**
|
|
13177
|
+
* If true, disables click to open the native file selection dialog
|
|
13178
|
+
*/
|
|
13179
|
+
noClick: PropTypes.bool,
|
|
13180
|
+
|
|
13181
|
+
/**
|
|
13182
|
+
* If true, disables SPACE/ENTER to open the native file selection dialog.
|
|
13183
|
+
* Note that it also stops tracking the focus state.
|
|
13184
|
+
*/
|
|
13185
|
+
noKeyboard: PropTypes.bool,
|
|
13186
|
+
|
|
13187
|
+
/**
|
|
13188
|
+
* If true, disables drag 'n' drop
|
|
13189
|
+
*/
|
|
13190
|
+
noDrag: PropTypes.bool,
|
|
13191
|
+
|
|
13192
|
+
/**
|
|
13193
|
+
* If true, stops drag event propagation to parents
|
|
13194
|
+
*/
|
|
13195
|
+
noDragEventsBubbling: PropTypes.bool,
|
|
13196
|
+
|
|
13197
|
+
/**
|
|
13198
|
+
* Minimum file size (in bytes)
|
|
13199
|
+
*/
|
|
13200
|
+
minSize: PropTypes.number,
|
|
13201
|
+
|
|
13202
|
+
/**
|
|
13203
|
+
* Maximum file size (in bytes)
|
|
13204
|
+
*/
|
|
13205
|
+
maxSize: PropTypes.number,
|
|
13206
|
+
|
|
13207
|
+
/**
|
|
13208
|
+
* Maximum accepted number of files
|
|
13209
|
+
* The default value is 0 which means there is no limitation to how many files are accepted.
|
|
13210
|
+
*/
|
|
13211
|
+
maxFiles: PropTypes.number,
|
|
13212
|
+
|
|
13213
|
+
/**
|
|
13214
|
+
* Enable/disable the dropzone
|
|
13215
|
+
*/
|
|
13216
|
+
disabled: PropTypes.bool,
|
|
13217
|
+
|
|
13218
|
+
/**
|
|
13219
|
+
* Use this to provide a custom file aggregator
|
|
13220
|
+
*
|
|
13221
|
+
* @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)
|
|
13222
|
+
*/
|
|
13223
|
+
getFilesFromEvent: PropTypes.func,
|
|
13224
|
+
|
|
13225
|
+
/**
|
|
13226
|
+
* Cb for when closing the file dialog with no selection
|
|
13227
|
+
*/
|
|
13228
|
+
onFileDialogCancel: PropTypes.func,
|
|
13229
|
+
|
|
13230
|
+
/**
|
|
13231
|
+
* Cb for when opening the file dialog
|
|
13232
|
+
*/
|
|
13233
|
+
onFileDialogOpen: PropTypes.func,
|
|
13234
|
+
|
|
13235
|
+
/**
|
|
13236
|
+
* Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API
|
|
13237
|
+
* to open the file picker instead of using an `<input type="file">` click event.
|
|
13238
|
+
*/
|
|
13239
|
+
useFsAccessApi: PropTypes.bool,
|
|
13240
|
+
|
|
13241
|
+
/**
|
|
13242
|
+
* Set to true to focus the root element on render
|
|
13243
|
+
*/
|
|
13244
|
+
autoFocus: PropTypes.bool,
|
|
13245
|
+
|
|
13246
|
+
/**
|
|
13247
|
+
* Cb for when the `dragenter` event occurs.
|
|
13248
|
+
*
|
|
13249
|
+
* @param {DragEvent} event
|
|
13250
|
+
*/
|
|
13251
|
+
onDragEnter: PropTypes.func,
|
|
13252
|
+
|
|
13253
|
+
/**
|
|
13254
|
+
* Cb for when the `dragleave` event occurs
|
|
13255
|
+
*
|
|
13256
|
+
* @param {DragEvent} event
|
|
13257
|
+
*/
|
|
13258
|
+
onDragLeave: PropTypes.func,
|
|
13259
|
+
|
|
13260
|
+
/**
|
|
13261
|
+
* Cb for when the `dragover` event occurs
|
|
13262
|
+
*
|
|
13263
|
+
* @param {DragEvent} event
|
|
13264
|
+
*/
|
|
13265
|
+
onDragOver: PropTypes.func,
|
|
13266
|
+
|
|
13267
|
+
/**
|
|
13268
|
+
* Cb for when the `drop` event occurs.
|
|
13269
|
+
* Note that this callback is invoked after the `getFilesFromEvent` callback is done.
|
|
13270
|
+
*
|
|
13271
|
+
* Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.
|
|
13272
|
+
* `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.
|
|
13273
|
+
* If `multiple` is set to false and additional files are dropped,
|
|
13274
|
+
* all files besides the first will be rejected.
|
|
13275
|
+
* Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.
|
|
13276
|
+
*
|
|
13277
|
+
* Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.
|
|
13278
|
+
* If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.
|
|
13279
|
+
*
|
|
13280
|
+
* `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.
|
|
13281
|
+
* For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:
|
|
13282
|
+
*
|
|
13283
|
+
* ```js
|
|
13284
|
+
* function onDrop(acceptedFiles) {
|
|
13285
|
+
* const req = request.post('/upload')
|
|
13286
|
+
* acceptedFiles.forEach(file => {
|
|
13287
|
+
* req.attach(file.name, file)
|
|
13288
|
+
* })
|
|
13289
|
+
* req.end(callback)
|
|
13290
|
+
* }
|
|
13291
|
+
* ```
|
|
13292
|
+
*
|
|
13293
|
+
* @param {File[]} acceptedFiles
|
|
13294
|
+
* @param {FileRejection[]} fileRejections
|
|
13295
|
+
* @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)
|
|
13296
|
+
*/
|
|
13297
|
+
onDrop: PropTypes.func,
|
|
13298
|
+
|
|
13299
|
+
/**
|
|
13300
|
+
* Cb for when the `drop` event occurs.
|
|
13301
|
+
* Note that if no files are accepted, this callback is not invoked.
|
|
13302
|
+
*
|
|
13303
|
+
* @param {File[]} files
|
|
13304
|
+
* @param {(DragEvent|Event)} event
|
|
13305
|
+
*/
|
|
13306
|
+
onDropAccepted: PropTypes.func,
|
|
13307
|
+
|
|
13308
|
+
/**
|
|
13309
|
+
* Cb for when the `drop` event occurs.
|
|
13310
|
+
* Note that if no files are rejected, this callback is not invoked.
|
|
13311
|
+
*
|
|
13312
|
+
* @param {FileRejection[]} fileRejections
|
|
13313
|
+
* @param {(DragEvent|Event)} event
|
|
13314
|
+
*/
|
|
13315
|
+
onDropRejected: PropTypes.func,
|
|
13316
|
+
|
|
13317
|
+
/**
|
|
13318
|
+
* Cb for when there's some error from any of the promises.
|
|
13319
|
+
*
|
|
13320
|
+
* @param {Error} error
|
|
13321
|
+
*/
|
|
13322
|
+
onError: PropTypes.func,
|
|
13323
|
+
|
|
13324
|
+
/**
|
|
13325
|
+
* Custom validation function. It must return null if there's no errors.
|
|
13326
|
+
* @param {File} file
|
|
13327
|
+
* @returns {FileError|FileError[]|null}
|
|
13328
|
+
*/
|
|
13329
|
+
validator: PropTypes.func
|
|
13330
|
+
};
|
|
13331
|
+
/**
|
|
13332
|
+
* A function that is invoked for the `dragenter`,
|
|
13333
|
+
* `dragover` and `dragleave` events.
|
|
13334
|
+
* It is not invoked if the items are not files (such as link, text, etc.).
|
|
13335
|
+
*
|
|
13336
|
+
* @callback dragCb
|
|
13337
|
+
* @param {DragEvent} event
|
|
13338
|
+
*/
|
|
13339
|
+
|
|
13340
|
+
/**
|
|
13341
|
+
* A function that is invoked for the `drop` or input change event.
|
|
13342
|
+
* It is not invoked if the items are not files (such as link, text, etc.).
|
|
13343
|
+
*
|
|
13344
|
+
* @callback dropCb
|
|
13345
|
+
* @param {File[]} acceptedFiles List of accepted files
|
|
13346
|
+
* @param {FileRejection[]} fileRejections List of rejected files and why they were rejected
|
|
13347
|
+
* @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)
|
|
13348
|
+
*/
|
|
13349
|
+
|
|
13350
|
+
/**
|
|
13351
|
+
* A function that is invoked for the `drop` or input change event.
|
|
13352
|
+
* It is not invoked if the items are files (such as link, text, etc.).
|
|
13353
|
+
*
|
|
13354
|
+
* @callback dropAcceptedCb
|
|
13355
|
+
* @param {File[]} files List of accepted files that meet the given criteria
|
|
13356
|
+
* (`accept`, `multiple`, `minSize`, `maxSize`)
|
|
13357
|
+
* @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)
|
|
13358
|
+
*/
|
|
13359
|
+
|
|
13360
|
+
/**
|
|
13361
|
+
* A function that is invoked for the `drop` or input change event.
|
|
13362
|
+
*
|
|
13363
|
+
* @callback dropRejectedCb
|
|
13364
|
+
* @param {File[]} files List of rejected files that do not meet the given criteria
|
|
13365
|
+
* (`accept`, `multiple`, `minSize`, `maxSize`)
|
|
13366
|
+
* @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)
|
|
13367
|
+
*/
|
|
13368
|
+
|
|
13369
|
+
/**
|
|
13370
|
+
* A function that is used aggregate files,
|
|
13371
|
+
* in a asynchronous fashion, from drag or input change events.
|
|
13372
|
+
*
|
|
13373
|
+
* @callback getFilesFromEvent
|
|
13374
|
+
* @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)
|
|
13375
|
+
* @returns {(File[]|Promise<File[]>)}
|
|
13376
|
+
*/
|
|
13377
|
+
|
|
13378
|
+
/**
|
|
13379
|
+
* An object with the current dropzone state.
|
|
13380
|
+
*
|
|
13381
|
+
* @typedef {object} DropzoneState
|
|
13382
|
+
* @property {boolean} isFocused Dropzone area is in focus
|
|
13383
|
+
* @property {boolean} isFileDialogActive File dialog is opened
|
|
13384
|
+
* @property {boolean} isDragActive Active drag is in progress
|
|
13385
|
+
* @property {boolean} isDragAccept Dragged files are accepted
|
|
13386
|
+
* @property {boolean} isDragReject Some dragged files are rejected
|
|
13387
|
+
* @property {File[]} acceptedFiles Accepted files
|
|
13388
|
+
* @property {FileRejection[]} fileRejections Rejected files and why they were rejected
|
|
13389
|
+
*/
|
|
13390
|
+
|
|
13391
|
+
/**
|
|
13392
|
+
* An object with the dropzone methods.
|
|
13393
|
+
*
|
|
13394
|
+
* @typedef {object} DropzoneMethods
|
|
13395
|
+
* @property {Function} getRootProps Returns the props you should apply to the root drop container you render
|
|
13396
|
+
* @property {Function} getInputProps Returns the props you should apply to hidden file input you render
|
|
13397
|
+
* @property {Function} open Open the native file selection dialog
|
|
13398
|
+
*/
|
|
13399
|
+
|
|
13400
|
+
var initialState = {
|
|
13401
|
+
isFocused: false,
|
|
13402
|
+
isFileDialogActive: false,
|
|
13403
|
+
isDragActive: false,
|
|
13404
|
+
isDragAccept: false,
|
|
13405
|
+
isDragReject: false,
|
|
13406
|
+
acceptedFiles: [],
|
|
13407
|
+
fileRejections: []
|
|
13408
|
+
};
|
|
13409
|
+
/**
|
|
13410
|
+
* A React hook that creates a drag 'n' drop area.
|
|
13411
|
+
*
|
|
13412
|
+
* ```jsx
|
|
13413
|
+
* function MyDropzone(props) {
|
|
13414
|
+
* const {getRootProps, getInputProps} = useDropzone({
|
|
13415
|
+
* onDrop: acceptedFiles => {
|
|
13416
|
+
* // do something with the File objects, e.g. upload to some server
|
|
13417
|
+
* }
|
|
13418
|
+
* });
|
|
13419
|
+
* return (
|
|
13420
|
+
* <div {...getRootProps()}>
|
|
13421
|
+
* <input {...getInputProps()} />
|
|
13422
|
+
* <p>Drag and drop some files here, or click to select files</p>
|
|
13423
|
+
* </div>
|
|
13424
|
+
* )
|
|
13425
|
+
* }
|
|
13426
|
+
* ```
|
|
13427
|
+
*
|
|
13428
|
+
* @function useDropzone
|
|
13429
|
+
*
|
|
13430
|
+
* @param {object} props
|
|
13431
|
+
* @param {import("./utils").AcceptProp} [props.accept] Set accepted file types.
|
|
13432
|
+
* Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.
|
|
13433
|
+
* Keep in mind that mime type determination is not reliable across platforms. CSV files,
|
|
13434
|
+
* for example, are reported as text/plain under macOS but as application/vnd.ms-excel under
|
|
13435
|
+
* Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).
|
|
13436
|
+
* @param {boolean} [props.multiple=true] Allow drag 'n' drop (or selection from the file dialog) of multiple files
|
|
13437
|
+
* @param {boolean} [props.preventDropOnDocument=true] If false, allow dropped items to take over the current browser window
|
|
13438
|
+
* @param {boolean} [props.noClick=false] If true, disables click to open the native file selection dialog
|
|
13439
|
+
* @param {boolean} [props.noKeyboard=false] If true, disables SPACE/ENTER to open the native file selection dialog.
|
|
13440
|
+
* Note that it also stops tracking the focus state.
|
|
13441
|
+
* @param {boolean} [props.noDrag=false] If true, disables drag 'n' drop
|
|
13442
|
+
* @param {boolean} [props.noDragEventsBubbling=false] If true, stops drag event propagation to parents
|
|
13443
|
+
* @param {number} [props.minSize=0] Minimum file size (in bytes)
|
|
13444
|
+
* @param {number} [props.maxSize=Infinity] Maximum file size (in bytes)
|
|
13445
|
+
* @param {boolean} [props.disabled=false] Enable/disable the dropzone
|
|
13446
|
+
* @param {getFilesFromEvent} [props.getFilesFromEvent] Use this to provide a custom file aggregator
|
|
13447
|
+
* @param {Function} [props.onFileDialogCancel] Cb for when closing the file dialog with no selection
|
|
13448
|
+
* @param {boolean} [props.useFsAccessApi] Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API
|
|
13449
|
+
* to open the file picker instead of using an `<input type="file">` click event.
|
|
13450
|
+
* @param {boolean} autoFocus Set to true to auto focus the root element.
|
|
13451
|
+
* @param {Function} [props.onFileDialogOpen] Cb for when opening the file dialog
|
|
13452
|
+
* @param {dragCb} [props.onDragEnter] Cb for when the `dragenter` event occurs.
|
|
13453
|
+
* @param {dragCb} [props.onDragLeave] Cb for when the `dragleave` event occurs
|
|
13454
|
+
* @param {dragCb} [props.onDragOver] Cb for when the `dragover` event occurs
|
|
13455
|
+
* @param {dropCb} [props.onDrop] Cb for when the `drop` event occurs.
|
|
13456
|
+
* Note that this callback is invoked after the `getFilesFromEvent` callback is done.
|
|
13457
|
+
*
|
|
13458
|
+
* Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.
|
|
13459
|
+
* `accept` must be an object with keys as a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) and the value an array of file extensions (optional).
|
|
13460
|
+
* If `multiple` is set to false and additional files are dropped,
|
|
13461
|
+
* all files besides the first will be rejected.
|
|
13462
|
+
* Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.
|
|
13463
|
+
*
|
|
13464
|
+
* Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.
|
|
13465
|
+
* If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.
|
|
13466
|
+
*
|
|
13467
|
+
* `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.
|
|
13468
|
+
* For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:
|
|
13469
|
+
*
|
|
13470
|
+
* ```js
|
|
13471
|
+
* function onDrop(acceptedFiles) {
|
|
13472
|
+
* const req = request.post('/upload')
|
|
13473
|
+
* acceptedFiles.forEach(file => {
|
|
13474
|
+
* req.attach(file.name, file)
|
|
13475
|
+
* })
|
|
13476
|
+
* req.end(callback)
|
|
13477
|
+
* }
|
|
13478
|
+
* ```
|
|
13479
|
+
* @param {dropAcceptedCb} [props.onDropAccepted]
|
|
13480
|
+
* @param {dropRejectedCb} [props.onDropRejected]
|
|
13481
|
+
* @param {(error: Error) => void} [props.onError]
|
|
13482
|
+
*
|
|
13483
|
+
* @returns {DropzoneState & DropzoneMethods}
|
|
13484
|
+
*/
|
|
13485
|
+
|
|
13486
|
+
function useDropzone() {
|
|
13487
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
13488
|
+
|
|
13489
|
+
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
13490
|
+
accept = _defaultProps$props.accept,
|
|
13491
|
+
disabled = _defaultProps$props.disabled,
|
|
13492
|
+
getFilesFromEvent = _defaultProps$props.getFilesFromEvent,
|
|
13493
|
+
maxSize = _defaultProps$props.maxSize,
|
|
13494
|
+
minSize = _defaultProps$props.minSize,
|
|
13495
|
+
multiple = _defaultProps$props.multiple,
|
|
13496
|
+
maxFiles = _defaultProps$props.maxFiles,
|
|
13497
|
+
onDragEnter = _defaultProps$props.onDragEnter,
|
|
13498
|
+
onDragLeave = _defaultProps$props.onDragLeave,
|
|
13499
|
+
onDragOver = _defaultProps$props.onDragOver,
|
|
13500
|
+
onDrop = _defaultProps$props.onDrop,
|
|
13501
|
+
onDropAccepted = _defaultProps$props.onDropAccepted,
|
|
13502
|
+
onDropRejected = _defaultProps$props.onDropRejected,
|
|
13503
|
+
onFileDialogCancel = _defaultProps$props.onFileDialogCancel,
|
|
13504
|
+
onFileDialogOpen = _defaultProps$props.onFileDialogOpen,
|
|
13505
|
+
useFsAccessApi = _defaultProps$props.useFsAccessApi,
|
|
13506
|
+
autoFocus = _defaultProps$props.autoFocus,
|
|
13507
|
+
preventDropOnDocument = _defaultProps$props.preventDropOnDocument,
|
|
13508
|
+
noClick = _defaultProps$props.noClick,
|
|
13509
|
+
noKeyboard = _defaultProps$props.noKeyboard,
|
|
13510
|
+
noDrag = _defaultProps$props.noDrag,
|
|
13511
|
+
noDragEventsBubbling = _defaultProps$props.noDragEventsBubbling,
|
|
13512
|
+
onError = _defaultProps$props.onError,
|
|
13513
|
+
validator = _defaultProps$props.validator;
|
|
13514
|
+
|
|
13515
|
+
var acceptAttr = useMemo(function () {
|
|
13516
|
+
return acceptPropAsAcceptAttr(accept);
|
|
13517
|
+
}, [accept]);
|
|
13518
|
+
var pickerTypes = useMemo(function () {
|
|
13519
|
+
return pickerOptionsFromAccept(accept);
|
|
13520
|
+
}, [accept]);
|
|
13521
|
+
var onFileDialogOpenCb = useMemo(function () {
|
|
13522
|
+
return typeof onFileDialogOpen === "function" ? onFileDialogOpen : noop;
|
|
13523
|
+
}, [onFileDialogOpen]);
|
|
13524
|
+
var onFileDialogCancelCb = useMemo(function () {
|
|
13525
|
+
return typeof onFileDialogCancel === "function" ? onFileDialogCancel : noop;
|
|
13526
|
+
}, [onFileDialogCancel]);
|
|
13527
|
+
/**
|
|
13528
|
+
* @constant
|
|
13529
|
+
* @type {React.MutableRefObject<HTMLElement>}
|
|
13530
|
+
*/
|
|
13531
|
+
|
|
13532
|
+
var rootRef = useRef(null);
|
|
13533
|
+
var inputRef = useRef(null);
|
|
13534
|
+
|
|
13535
|
+
var _useReducer = useReducer(reducer, initialState),
|
|
13536
|
+
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
13537
|
+
state = _useReducer2[0],
|
|
13538
|
+
dispatch = _useReducer2[1];
|
|
13539
|
+
|
|
13540
|
+
var isFocused = state.isFocused,
|
|
13541
|
+
isFileDialogActive = state.isFileDialogActive;
|
|
13542
|
+
var fsAccessApiWorksRef = useRef(typeof window !== "undefined" && window.isSecureContext && useFsAccessApi && canUseFileSystemAccessAPI()); // Update file dialog active state when the window is focused on
|
|
13543
|
+
|
|
13544
|
+
var onWindowFocus = function onWindowFocus() {
|
|
13545
|
+
// Execute the timeout only if the file dialog is opened in the browser
|
|
13546
|
+
if (!fsAccessApiWorksRef.current && isFileDialogActive) {
|
|
13547
|
+
setTimeout(function () {
|
|
13548
|
+
if (inputRef.current) {
|
|
13549
|
+
var files = inputRef.current.files;
|
|
13550
|
+
|
|
13551
|
+
if (!files.length) {
|
|
13552
|
+
dispatch({
|
|
13553
|
+
type: "closeDialog"
|
|
13554
|
+
});
|
|
13555
|
+
onFileDialogCancelCb();
|
|
13556
|
+
}
|
|
13557
|
+
}
|
|
13558
|
+
}, 300);
|
|
13559
|
+
}
|
|
13560
|
+
};
|
|
13561
|
+
|
|
13562
|
+
useEffect(function () {
|
|
13563
|
+
window.addEventListener("focus", onWindowFocus, false);
|
|
13564
|
+
return function () {
|
|
13565
|
+
window.removeEventListener("focus", onWindowFocus, false);
|
|
13566
|
+
};
|
|
13567
|
+
}, [inputRef, isFileDialogActive, onFileDialogCancelCb, fsAccessApiWorksRef]);
|
|
13568
|
+
var dragTargetsRef = useRef([]);
|
|
13569
|
+
|
|
13570
|
+
var onDocumentDrop = function onDocumentDrop(event) {
|
|
13571
|
+
if (rootRef.current && rootRef.current.contains(event.target)) {
|
|
13572
|
+
// If we intercepted an event for our instance, let it propagate down to the instance's onDrop handler
|
|
13573
|
+
return;
|
|
13574
|
+
}
|
|
13575
|
+
|
|
13576
|
+
event.preventDefault();
|
|
13577
|
+
dragTargetsRef.current = [];
|
|
13578
|
+
};
|
|
13579
|
+
|
|
13580
|
+
useEffect(function () {
|
|
13581
|
+
if (preventDropOnDocument) {
|
|
13582
|
+
document.addEventListener("dragover", onDocumentDragOver, false);
|
|
13583
|
+
document.addEventListener("drop", onDocumentDrop, false);
|
|
13584
|
+
}
|
|
13585
|
+
|
|
13586
|
+
return function () {
|
|
13587
|
+
if (preventDropOnDocument) {
|
|
13588
|
+
document.removeEventListener("dragover", onDocumentDragOver);
|
|
13589
|
+
document.removeEventListener("drop", onDocumentDrop);
|
|
13590
|
+
}
|
|
13591
|
+
};
|
|
13592
|
+
}, [rootRef, preventDropOnDocument]); // Auto focus the root when autoFocus is true
|
|
13593
|
+
|
|
13594
|
+
useEffect(function () {
|
|
13595
|
+
if (!disabled && autoFocus && rootRef.current) {
|
|
13596
|
+
rootRef.current.focus();
|
|
13597
|
+
}
|
|
13598
|
+
|
|
13599
|
+
return function () {};
|
|
13600
|
+
}, [rootRef, autoFocus, disabled]);
|
|
13601
|
+
var onErrCb = useCallback(function (e) {
|
|
13602
|
+
if (onError) {
|
|
13603
|
+
onError(e);
|
|
13604
|
+
} else {
|
|
13605
|
+
// Let the user know something's gone wrong if they haven't provided the onError cb.
|
|
13606
|
+
console.error(e);
|
|
13607
|
+
}
|
|
13608
|
+
}, [onError]);
|
|
13609
|
+
var onDragEnterCb = useCallback(function (event) {
|
|
13610
|
+
event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done
|
|
13611
|
+
|
|
13612
|
+
event.persist();
|
|
13613
|
+
stopPropagation(event);
|
|
13614
|
+
dragTargetsRef.current = [].concat(_toConsumableArray(dragTargetsRef.current), [event.target]);
|
|
13615
|
+
|
|
13616
|
+
if (isEvtWithFiles(event)) {
|
|
13617
|
+
Promise.resolve(getFilesFromEvent(event)).then(function (files) {
|
|
13618
|
+
if (isPropagationStopped(event) && !noDragEventsBubbling) {
|
|
13619
|
+
return;
|
|
13620
|
+
}
|
|
13621
|
+
|
|
13622
|
+
var fileCount = files.length;
|
|
13623
|
+
var isDragAccept = fileCount > 0 && allFilesAccepted({
|
|
13624
|
+
files: files,
|
|
13625
|
+
accept: acceptAttr,
|
|
13626
|
+
minSize: minSize,
|
|
13627
|
+
maxSize: maxSize,
|
|
13628
|
+
multiple: multiple,
|
|
13629
|
+
maxFiles: maxFiles,
|
|
13630
|
+
validator: validator
|
|
13631
|
+
});
|
|
13632
|
+
var isDragReject = fileCount > 0 && !isDragAccept;
|
|
13633
|
+
dispatch({
|
|
13634
|
+
isDragAccept: isDragAccept,
|
|
13635
|
+
isDragReject: isDragReject,
|
|
13636
|
+
isDragActive: true,
|
|
13637
|
+
type: "setDraggedFiles"
|
|
13638
|
+
});
|
|
13639
|
+
|
|
13640
|
+
if (onDragEnter) {
|
|
13641
|
+
onDragEnter(event);
|
|
13642
|
+
}
|
|
13643
|
+
}).catch(function (e) {
|
|
13644
|
+
return onErrCb(e);
|
|
13645
|
+
});
|
|
13646
|
+
}
|
|
13647
|
+
}, [getFilesFromEvent, onDragEnter, onErrCb, noDragEventsBubbling, acceptAttr, minSize, maxSize, multiple, maxFiles, validator]);
|
|
13648
|
+
var onDragOverCb = useCallback(function (event) {
|
|
13649
|
+
event.preventDefault();
|
|
13650
|
+
event.persist();
|
|
13651
|
+
stopPropagation(event);
|
|
13652
|
+
var hasFiles = isEvtWithFiles(event);
|
|
13653
|
+
|
|
13654
|
+
if (hasFiles && event.dataTransfer) {
|
|
13655
|
+
try {
|
|
13656
|
+
event.dataTransfer.dropEffect = "copy";
|
|
13657
|
+
} catch (_unused) {}
|
|
13658
|
+
/* eslint-disable-line no-empty */
|
|
13659
|
+
|
|
13660
|
+
}
|
|
13661
|
+
|
|
13662
|
+
if (hasFiles && onDragOver) {
|
|
13663
|
+
onDragOver(event);
|
|
13664
|
+
}
|
|
13665
|
+
|
|
13666
|
+
return false;
|
|
13667
|
+
}, [onDragOver, noDragEventsBubbling]);
|
|
13668
|
+
var onDragLeaveCb = useCallback(function (event) {
|
|
13669
|
+
event.preventDefault();
|
|
13670
|
+
event.persist();
|
|
13671
|
+
stopPropagation(event); // Only deactivate once the dropzone and all children have been left
|
|
13672
|
+
|
|
13673
|
+
var targets = dragTargetsRef.current.filter(function (target) {
|
|
13674
|
+
return rootRef.current && rootRef.current.contains(target);
|
|
13675
|
+
}); // Make sure to remove a target present multiple times only once
|
|
13676
|
+
// (Firefox may fire dragenter/dragleave multiple times on the same element)
|
|
13677
|
+
|
|
13678
|
+
var targetIdx = targets.indexOf(event.target);
|
|
13679
|
+
|
|
13680
|
+
if (targetIdx !== -1) {
|
|
13681
|
+
targets.splice(targetIdx, 1);
|
|
13682
|
+
}
|
|
13683
|
+
|
|
13684
|
+
dragTargetsRef.current = targets;
|
|
13685
|
+
|
|
13686
|
+
if (targets.length > 0) {
|
|
13687
|
+
return;
|
|
13688
|
+
}
|
|
13689
|
+
|
|
13690
|
+
dispatch({
|
|
13691
|
+
type: "setDraggedFiles",
|
|
13692
|
+
isDragActive: false,
|
|
13693
|
+
isDragAccept: false,
|
|
13694
|
+
isDragReject: false
|
|
13695
|
+
});
|
|
13696
|
+
|
|
13697
|
+
if (isEvtWithFiles(event) && onDragLeave) {
|
|
13698
|
+
onDragLeave(event);
|
|
13699
|
+
}
|
|
13700
|
+
}, [rootRef, onDragLeave, noDragEventsBubbling]);
|
|
13701
|
+
var setFiles = useCallback(function (files, event) {
|
|
13702
|
+
var acceptedFiles = [];
|
|
13703
|
+
var fileRejections = [];
|
|
13704
|
+
files.forEach(function (file) {
|
|
13705
|
+
var _fileAccepted = fileAccepted(file, acceptAttr),
|
|
13706
|
+
_fileAccepted2 = _slicedToArray(_fileAccepted, 2),
|
|
13707
|
+
accepted = _fileAccepted2[0],
|
|
13708
|
+
acceptError = _fileAccepted2[1];
|
|
13709
|
+
|
|
13710
|
+
var _fileMatchSize = fileMatchSize(file, minSize, maxSize),
|
|
13711
|
+
_fileMatchSize2 = _slicedToArray(_fileMatchSize, 2),
|
|
13712
|
+
sizeMatch = _fileMatchSize2[0],
|
|
13713
|
+
sizeError = _fileMatchSize2[1];
|
|
13714
|
+
|
|
13715
|
+
var customErrors = validator ? validator(file) : null;
|
|
13716
|
+
|
|
13717
|
+
if (accepted && sizeMatch && !customErrors) {
|
|
13718
|
+
acceptedFiles.push(file);
|
|
13719
|
+
} else {
|
|
13720
|
+
var errors = [acceptError, sizeError];
|
|
13721
|
+
|
|
13722
|
+
if (customErrors) {
|
|
13723
|
+
errors = errors.concat(customErrors);
|
|
13724
|
+
}
|
|
13725
|
+
|
|
13726
|
+
fileRejections.push({
|
|
13727
|
+
file: file,
|
|
13728
|
+
errors: errors.filter(function (e) {
|
|
13729
|
+
return e;
|
|
13730
|
+
})
|
|
13731
|
+
});
|
|
13732
|
+
}
|
|
13733
|
+
});
|
|
13734
|
+
|
|
13735
|
+
if (!multiple && acceptedFiles.length > 1 || multiple && maxFiles >= 1 && acceptedFiles.length > maxFiles) {
|
|
13736
|
+
// Reject everything and empty accepted files
|
|
13737
|
+
acceptedFiles.forEach(function (file) {
|
|
13738
|
+
fileRejections.push({
|
|
13739
|
+
file: file,
|
|
13740
|
+
errors: [TOO_MANY_FILES_REJECTION]
|
|
13741
|
+
});
|
|
13742
|
+
});
|
|
13743
|
+
acceptedFiles.splice(0);
|
|
13744
|
+
}
|
|
13745
|
+
|
|
13746
|
+
dispatch({
|
|
13747
|
+
acceptedFiles: acceptedFiles,
|
|
13748
|
+
fileRejections: fileRejections,
|
|
13749
|
+
type: "setFiles"
|
|
13750
|
+
});
|
|
13751
|
+
|
|
13752
|
+
if (onDrop) {
|
|
13753
|
+
onDrop(acceptedFiles, fileRejections, event);
|
|
13754
|
+
}
|
|
13755
|
+
|
|
13756
|
+
if (fileRejections.length > 0 && onDropRejected) {
|
|
13757
|
+
onDropRejected(fileRejections, event);
|
|
13758
|
+
}
|
|
13759
|
+
|
|
13760
|
+
if (acceptedFiles.length > 0 && onDropAccepted) {
|
|
13761
|
+
onDropAccepted(acceptedFiles, event);
|
|
13762
|
+
}
|
|
13763
|
+
}, [dispatch, multiple, acceptAttr, minSize, maxSize, maxFiles, onDrop, onDropAccepted, onDropRejected, validator]);
|
|
13764
|
+
var onDropCb = useCallback(function (event) {
|
|
13765
|
+
event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done
|
|
13766
|
+
|
|
13767
|
+
event.persist();
|
|
13768
|
+
stopPropagation(event);
|
|
13769
|
+
dragTargetsRef.current = [];
|
|
13770
|
+
|
|
13771
|
+
if (isEvtWithFiles(event)) {
|
|
13772
|
+
Promise.resolve(getFilesFromEvent(event)).then(function (files) {
|
|
13773
|
+
if (isPropagationStopped(event) && !noDragEventsBubbling) {
|
|
13774
|
+
return;
|
|
13775
|
+
}
|
|
13776
|
+
|
|
13777
|
+
setFiles(files, event);
|
|
13778
|
+
}).catch(function (e) {
|
|
13779
|
+
return onErrCb(e);
|
|
13780
|
+
});
|
|
13781
|
+
}
|
|
13782
|
+
|
|
13783
|
+
dispatch({
|
|
13784
|
+
type: "reset"
|
|
13785
|
+
});
|
|
13786
|
+
}, [getFilesFromEvent, setFiles, onErrCb, noDragEventsBubbling]); // Fn for opening the file dialog programmatically
|
|
13787
|
+
|
|
13788
|
+
var openFileDialog = useCallback(function () {
|
|
13789
|
+
// No point to use FS access APIs if context is not secure
|
|
13790
|
+
// https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts#feature_detection
|
|
13791
|
+
if (fsAccessApiWorksRef.current) {
|
|
13792
|
+
dispatch({
|
|
13793
|
+
type: "openDialog"
|
|
13794
|
+
});
|
|
13795
|
+
onFileDialogOpenCb(); // https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker
|
|
13796
|
+
|
|
13797
|
+
var opts = {
|
|
13798
|
+
multiple: multiple,
|
|
13799
|
+
types: pickerTypes
|
|
13800
|
+
};
|
|
13801
|
+
window.showOpenFilePicker(opts).then(function (handles) {
|
|
13802
|
+
return getFilesFromEvent(handles);
|
|
13803
|
+
}).then(function (files) {
|
|
13804
|
+
setFiles(files, null);
|
|
13805
|
+
dispatch({
|
|
13806
|
+
type: "closeDialog"
|
|
13807
|
+
});
|
|
13808
|
+
}).catch(function (e) {
|
|
13809
|
+
// AbortError means the user canceled
|
|
13810
|
+
if (isAbort(e)) {
|
|
13811
|
+
onFileDialogCancelCb(e);
|
|
13812
|
+
dispatch({
|
|
13813
|
+
type: "closeDialog"
|
|
13814
|
+
});
|
|
13815
|
+
} else if (isSecurityError(e)) {
|
|
13816
|
+
fsAccessApiWorksRef.current = false; // CORS, so cannot use this API
|
|
13817
|
+
// Try using the input
|
|
13818
|
+
|
|
13819
|
+
if (inputRef.current) {
|
|
13820
|
+
inputRef.current.value = null;
|
|
13821
|
+
inputRef.current.click();
|
|
13822
|
+
} else {
|
|
13823
|
+
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."));
|
|
13824
|
+
}
|
|
13825
|
+
} else {
|
|
13826
|
+
onErrCb(e);
|
|
13827
|
+
}
|
|
13828
|
+
});
|
|
13829
|
+
return;
|
|
13830
|
+
}
|
|
13831
|
+
|
|
13832
|
+
if (inputRef.current) {
|
|
13833
|
+
dispatch({
|
|
13834
|
+
type: "openDialog"
|
|
13835
|
+
});
|
|
13836
|
+
onFileDialogOpenCb();
|
|
13837
|
+
inputRef.current.value = null;
|
|
13838
|
+
inputRef.current.click();
|
|
13839
|
+
}
|
|
13840
|
+
}, [dispatch, onFileDialogOpenCb, onFileDialogCancelCb, useFsAccessApi, setFiles, onErrCb, pickerTypes, multiple]); // Cb to open the file dialog when SPACE/ENTER occurs on the dropzone
|
|
13841
|
+
|
|
13842
|
+
var onKeyDownCb = useCallback(function (event) {
|
|
13843
|
+
// Ignore keyboard events bubbling up the DOM tree
|
|
13844
|
+
if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) {
|
|
13845
|
+
return;
|
|
13846
|
+
}
|
|
13847
|
+
|
|
13848
|
+
if (event.key === " " || event.key === "Enter" || event.keyCode === 32 || event.keyCode === 13) {
|
|
13849
|
+
event.preventDefault();
|
|
13850
|
+
openFileDialog();
|
|
13851
|
+
}
|
|
13852
|
+
}, [rootRef, openFileDialog]); // Update focus state for the dropzone
|
|
13853
|
+
|
|
13854
|
+
var onFocusCb = useCallback(function () {
|
|
13855
|
+
dispatch({
|
|
13856
|
+
type: "focus"
|
|
13857
|
+
});
|
|
13858
|
+
}, []);
|
|
13859
|
+
var onBlurCb = useCallback(function () {
|
|
13860
|
+
dispatch({
|
|
13861
|
+
type: "blur"
|
|
13862
|
+
});
|
|
13863
|
+
}, []); // Cb to open the file dialog when click occurs on the dropzone
|
|
13864
|
+
|
|
13865
|
+
var onClickCb = useCallback(function () {
|
|
13866
|
+
if (noClick) {
|
|
13867
|
+
return;
|
|
13868
|
+
} // In IE11/Edge the file-browser dialog is blocking, therefore, use setTimeout()
|
|
13869
|
+
// to ensure React can handle state changes
|
|
13870
|
+
// See: https://github.com/react-dropzone/react-dropzone/issues/450
|
|
13871
|
+
|
|
13872
|
+
|
|
13873
|
+
if (isIeOrEdge()) {
|
|
13874
|
+
setTimeout(openFileDialog, 0);
|
|
13875
|
+
} else {
|
|
13876
|
+
openFileDialog();
|
|
13877
|
+
}
|
|
13878
|
+
}, [noClick, openFileDialog]);
|
|
13879
|
+
|
|
13880
|
+
var composeHandler = function composeHandler(fn) {
|
|
13881
|
+
return disabled ? null : fn;
|
|
13882
|
+
};
|
|
13883
|
+
|
|
13884
|
+
var composeKeyboardHandler = function composeKeyboardHandler(fn) {
|
|
13885
|
+
return noKeyboard ? null : composeHandler(fn);
|
|
13886
|
+
};
|
|
13887
|
+
|
|
13888
|
+
var composeDragHandler = function composeDragHandler(fn) {
|
|
13889
|
+
return noDrag ? null : composeHandler(fn);
|
|
13890
|
+
};
|
|
13891
|
+
|
|
13892
|
+
var stopPropagation = function stopPropagation(event) {
|
|
13893
|
+
if (noDragEventsBubbling) {
|
|
13894
|
+
event.stopPropagation();
|
|
13895
|
+
}
|
|
13896
|
+
};
|
|
13897
|
+
|
|
13898
|
+
var getRootProps = useMemo(function () {
|
|
13899
|
+
return function () {
|
|
13900
|
+
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
13901
|
+
_ref2$refKey = _ref2.refKey,
|
|
13902
|
+
refKey = _ref2$refKey === void 0 ? "ref" : _ref2$refKey,
|
|
13903
|
+
role = _ref2.role,
|
|
13904
|
+
onKeyDown = _ref2.onKeyDown,
|
|
13905
|
+
onFocus = _ref2.onFocus,
|
|
13906
|
+
onBlur = _ref2.onBlur,
|
|
13907
|
+
onClick = _ref2.onClick,
|
|
13908
|
+
onDragEnter = _ref2.onDragEnter,
|
|
13909
|
+
onDragOver = _ref2.onDragOver,
|
|
13910
|
+
onDragLeave = _ref2.onDragLeave,
|
|
13911
|
+
onDrop = _ref2.onDrop,
|
|
13912
|
+
rest = _objectWithoutProperties(_ref2, _excluded3);
|
|
13913
|
+
|
|
13914
|
+
return _objectSpread(_objectSpread(_defineProperty({
|
|
13915
|
+
onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),
|
|
13916
|
+
onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),
|
|
13917
|
+
onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),
|
|
13918
|
+
onClick: composeHandler(composeEventHandlers(onClick, onClickCb)),
|
|
13919
|
+
onDragEnter: composeDragHandler(composeEventHandlers(onDragEnter, onDragEnterCb)),
|
|
13920
|
+
onDragOver: composeDragHandler(composeEventHandlers(onDragOver, onDragOverCb)),
|
|
13921
|
+
onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave, onDragLeaveCb)),
|
|
13922
|
+
onDrop: composeDragHandler(composeEventHandlers(onDrop, onDropCb)),
|
|
13923
|
+
role: typeof role === "string" && role !== "" ? role : "presentation"
|
|
13924
|
+
}, refKey, rootRef), !disabled && !noKeyboard ? {
|
|
13925
|
+
tabIndex: 0
|
|
13926
|
+
} : {}), rest);
|
|
13927
|
+
};
|
|
13928
|
+
}, [rootRef, onKeyDownCb, onFocusCb, onBlurCb, onClickCb, onDragEnterCb, onDragOverCb, onDragLeaveCb, onDropCb, noKeyboard, noDrag, disabled]);
|
|
13929
|
+
var onInputElementClick = useCallback(function (event) {
|
|
13930
|
+
event.stopPropagation();
|
|
13931
|
+
}, []);
|
|
13932
|
+
var getInputProps = useMemo(function () {
|
|
13933
|
+
return function () {
|
|
13934
|
+
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
13935
|
+
_ref3$refKey = _ref3.refKey,
|
|
13936
|
+
refKey = _ref3$refKey === void 0 ? "ref" : _ref3$refKey,
|
|
13937
|
+
onChange = _ref3.onChange,
|
|
13938
|
+
onClick = _ref3.onClick,
|
|
13939
|
+
rest = _objectWithoutProperties(_ref3, _excluded4);
|
|
13940
|
+
|
|
13941
|
+
var inputProps = _defineProperty({
|
|
13942
|
+
accept: acceptAttr,
|
|
13943
|
+
multiple: multiple,
|
|
13944
|
+
type: "file",
|
|
13945
|
+
style: {
|
|
13946
|
+
display: "none"
|
|
13947
|
+
},
|
|
13948
|
+
onChange: composeHandler(composeEventHandlers(onChange, onDropCb)),
|
|
13949
|
+
onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)),
|
|
13950
|
+
tabIndex: -1
|
|
13951
|
+
}, refKey, inputRef);
|
|
13952
|
+
|
|
13953
|
+
return _objectSpread(_objectSpread({}, inputProps), rest);
|
|
13954
|
+
};
|
|
13955
|
+
}, [inputRef, accept, multiple, onDropCb, disabled]);
|
|
13956
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
13957
|
+
isFocused: isFocused && !disabled,
|
|
13958
|
+
getRootProps: getRootProps,
|
|
13959
|
+
getInputProps: getInputProps,
|
|
13960
|
+
rootRef: rootRef,
|
|
13961
|
+
inputRef: inputRef,
|
|
13962
|
+
open: composeHandler(openFileDialog)
|
|
13963
|
+
});
|
|
13964
|
+
}
|
|
13965
|
+
/**
|
|
13966
|
+
* @param {DropzoneState} state
|
|
13967
|
+
* @param {{type: string} & DropzoneState} action
|
|
13968
|
+
* @returns {DropzoneState}
|
|
13969
|
+
*/
|
|
13970
|
+
|
|
13971
|
+
function reducer(state, action) {
|
|
13972
|
+
/* istanbul ignore next */
|
|
13973
|
+
switch (action.type) {
|
|
13974
|
+
case "focus":
|
|
13975
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
13976
|
+
isFocused: true
|
|
13977
|
+
});
|
|
13978
|
+
|
|
13979
|
+
case "blur":
|
|
13980
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
13981
|
+
isFocused: false
|
|
13982
|
+
});
|
|
13983
|
+
|
|
13984
|
+
case "openDialog":
|
|
13985
|
+
return _objectSpread(_objectSpread({}, initialState), {}, {
|
|
13986
|
+
isFileDialogActive: true
|
|
13987
|
+
});
|
|
13988
|
+
|
|
13989
|
+
case "closeDialog":
|
|
13990
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
13991
|
+
isFileDialogActive: false
|
|
13992
|
+
});
|
|
13993
|
+
|
|
13994
|
+
case "setDraggedFiles":
|
|
13995
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
13996
|
+
isDragActive: action.isDragActive,
|
|
13997
|
+
isDragAccept: action.isDragAccept,
|
|
13998
|
+
isDragReject: action.isDragReject
|
|
13999
|
+
});
|
|
14000
|
+
|
|
14001
|
+
case "setFiles":
|
|
14002
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
14003
|
+
acceptedFiles: action.acceptedFiles,
|
|
14004
|
+
fileRejections: action.fileRejections
|
|
14005
|
+
});
|
|
14006
|
+
|
|
14007
|
+
case "reset":
|
|
14008
|
+
return _objectSpread({}, initialState);
|
|
14009
|
+
|
|
14010
|
+
default:
|
|
14011
|
+
return state;
|
|
14012
|
+
}
|
|
14013
|
+
}
|
|
14014
|
+
|
|
14015
|
+
function noop() {}
|
|
14016
|
+
|
|
14017
|
+
var Container$h = styled.div(templateObject_1$v || (templateObject_1$v = __makeTemplateObject$1(["\n width: 100%;\n min-height: 250px;\n border-width: 2px;\n border-style: dashed;\n border-color: ", ";\n box-sizing: border-box;\n border-radius: 4px;\n background-color: ", ";\n padding: 25px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"], ["\n width: 100%;\n min-height: 250px;\n border-width: 2px;\n border-style: dashed;\n border-color: ", ";\n box-sizing: border-box;\n border-radius: 4px;\n background-color: ", ";\n padding: 25px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"])), function (_a) {
|
|
14018
|
+
_a.isDragActive; var isDragAccept = _a.isDragAccept, isDragReject = _a.isDragReject;
|
|
14019
|
+
// if (isDragActive) return theme.colors.blue.base;
|
|
14020
|
+
if (isDragAccept)
|
|
14021
|
+
return theme.colors.green.base;
|
|
14022
|
+
else if (isDragReject)
|
|
14023
|
+
return theme.colors.red.base;
|
|
14024
|
+
else
|
|
14025
|
+
return theme.colors.lightGray.darker;
|
|
14026
|
+
}, function (_a) {
|
|
14027
|
+
_a.isDragActive; var isDragAccept = _a.isDragAccept, isDragReject = _a.isDragReject;
|
|
14028
|
+
// if (isDragActive) return `${theme.colors.blue.light}25`;
|
|
14029
|
+
if (isDragAccept)
|
|
14030
|
+
return "".concat(theme.colors.green.light, "25");
|
|
14031
|
+
else if (isDragReject)
|
|
14032
|
+
return "".concat(theme.colors.red.light, "25");
|
|
14033
|
+
else
|
|
14034
|
+
return theme.colors.lightGray.base;
|
|
14035
|
+
});
|
|
14036
|
+
var templateObject_1$v;
|
|
14037
|
+
|
|
14038
|
+
var FileUpload = function (_a) {
|
|
14039
|
+
var locale = _a.locale, accept = _a.accept, onDrop = _a.onDrop;
|
|
14040
|
+
var _b = useDropzone({
|
|
14041
|
+
onDrop: onDrop,
|
|
14042
|
+
accept: accept,
|
|
14043
|
+
// Max file size: 2MB
|
|
14044
|
+
maxSize: 1048576 * 2,
|
|
14045
|
+
minSize: 0,
|
|
14046
|
+
// Max number of files: 1
|
|
14047
|
+
maxFiles: 1,
|
|
14048
|
+
}), getRootProps = _b.getRootProps, getInputProps = _b.getInputProps, isDragActive = _b.isDragActive, isDragAccept = _b.isDragAccept, isDragReject = _b.isDragReject;
|
|
14049
|
+
return (jsx$1(Fragment$1, { children: jsxs(Container$h, __assign$2({}, getRootProps({
|
|
14050
|
+
isDragActive: isDragActive,
|
|
14051
|
+
isDragAccept: isDragAccept,
|
|
14052
|
+
isDragReject: isDragReject,
|
|
14053
|
+
}), { children: [jsx$1("input", __assign$2({}, getInputProps())), jsx$1(Icon, { type: "file", size: "large" }), jsx$1(Spacer, { vertical: 15 }), !isDragActive && (jsxs(Fragment$1, { children: [jsx$1(Heading, __assign$2({ type: "h6" }, { children: translations[locale]["Drag file(s) here..."] })), jsx$1(Spacer, { vertical: 5 }), jsx$1(Paragraph, { children: translations[locale]["or"] }), jsx$1(Spacer, { vertical: 10 }), jsx$1(Button, { label: translations[locale]["Select file(s)"], size: "small" })] })), isDragActive && !isDragReject && (jsx$1(Heading, __assign$2({ type: "h6" }, { children: translations[locale]["Upload file(s)..."] }))), isDragReject && (jsx$1(Heading, __assign$2({ type: "h6" }, { children: translations[locale]["File type not allowed"] })))] })) }));
|
|
11347
14054
|
};
|
|
11348
14055
|
|
|
11349
14056
|
var StyledIconButton = styled(StyledButton)(templateObject_1$u || (templateObject_1$u = __makeTemplateObject$1(["\n min-width: ", ";\n max-width: ", ";\n min-height: ", ";\n max-height: ", ";\n padding: 2px 0 0 0;\n\n > div:first-child {\n margin-top: -2px;\n }\n\n :active {\n min-height: ", ";\n max-height: ", ";\n margin-top: 2px;\n }\n"], ["\n min-width: ", ";\n max-width: ", ";\n min-height: ", ";\n max-height: ", ";\n padding: 2px 0 0 0;\n\n > div:first-child {\n margin-top: -2px;\n }\n\n :active {\n min-height: ", ";\n max-height: ", ";\n margin-top: 2px;\n }\n"])), function (_a) {
|
|
@@ -11486,7 +14193,7 @@ var Container$e = styled.div(templateObject_1$q || (templateObject_1$q = __makeT
|
|
|
11486
14193
|
});
|
|
11487
14194
|
var templateObject_1$q;
|
|
11488
14195
|
|
|
11489
|
-
var Loading = function (props) { return (jsxs(Container$e, __assign$2({}, props, { children: [jsx$1(_default, { color: theme.colors[props.color].base, speedMultiplier: 0.5 }), props.text && (jsxs(Fragment$1, { children: [jsx$1(Spacer, { vertical: 20 }), jsx$1(Heading, __assign$2({ type: "h6", color: props.textColor || "black" }, { children: props.text }))] }))] }))); };
|
|
14196
|
+
var Loading = function (props) { return (jsxs(Container$e, __assign$2({}, props, { children: [jsx$1(_default$1, { color: theme.colors[props.color].base, speedMultiplier: 0.5 }), props.text && (jsxs(Fragment$1, { children: [jsx$1(Spacer, { vertical: 20 }), jsx$1(Heading, __assign$2({ type: "h6", color: props.textColor || "black" }, { children: props.text }))] }))] }))); };
|
|
11490
14197
|
|
|
11491
14198
|
var Container$d = styled.div(templateObject_1$p || (templateObject_1$p = __makeTemplateObject$1(["\n padding: 15px;\n background-color: ", ";\n border-radius: 6px 6px 0 0;\n position: relative;\n cursor: pointer;\n"], ["\n padding: 15px;\n background-color: ", ";\n border-radius: 6px 6px 0 0;\n position: relative;\n cursor: pointer;\n"])), function (_a) {
|
|
11492
14199
|
var dropdownIsVisible = _a.dropdownIsVisible, color = _a.color;
|
|
@@ -12485,5 +15192,5 @@ var Transfer = function (props) {
|
|
|
12485
15192
|
}) }) }, selectedTargetKeys)] }))] }));
|
|
12486
15193
|
};
|
|
12487
15194
|
|
|
12488
|
-
export { Alert, Button, Card, Checkbox, Checkboxes, Collapse, Countdown, DateInputField, Flag, Form, Heading, Icon, IconButton, Illustration, Input, InputField, Key$1 as Key, Keyboard, Link, Loading, LocaleSelect, Logo, Medal, Medals, Modal, Notification, Number$1 as Number, NumberField, Paragraph, PasswordInputField, Popup, ProgressBar, Radio, RadioGroup, Range, Result, Select, SelectField, Spacer, Steps, Subheading, Table, Tabs, Tag, Toggle, ToggleField, Tooltip, Transfer, Trophy, theme };
|
|
15195
|
+
export { Alert, Button, Card, Checkbox, Checkboxes, Collapse, Countdown, DateInputField, FileUpload, Flag, Form, Heading, Icon, IconButton, Illustration, Input, InputField, Key$1 as Key, Keyboard, Link, Loading, LocaleSelect, Logo, Medal, Medals, Modal, Notification, Number$1 as Number, NumberField, Paragraph, PasswordInputField, Popup, ProgressBar, Radio, RadioGroup, Range, Result, Select, SelectField, Spacer, Steps, Subheading, Table, Tabs, Tag, Toggle, ToggleField, Tooltip, Transfer, Trophy, theme };
|
|
12489
15196
|
//# sourceMappingURL=index.es.js.map
|