@thecb/components 6.0.0-beta.3 → 6.0.0-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1475 -118
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1475 -118
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -1
- package/src/components/atoms/country-dropdown/CountryDropdown.js +1 -0
- package/src/components/atoms/dropdown/Dropdown.js +196 -124
- package/src/components/atoms/form-select/FormSelect.js +4 -2
- package/src/components/atoms/layouts/Box.js +79 -73
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.js +1 -0
package/dist/index.esm.js
CHANGED
|
@@ -6301,7 +6301,7 @@ var _excluded$3 = ["padding", "borderSize", "borderColor", "borderRadius", "boxS
|
|
|
6301
6301
|
completely off screen (only for users of screen readers)
|
|
6302
6302
|
*/
|
|
6303
6303
|
|
|
6304
|
-
var Box = function
|
|
6304
|
+
var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
6305
6305
|
var _ref$padding = _ref.padding,
|
|
6306
6306
|
padding = _ref$padding === void 0 ? "16px" : _ref$padding,
|
|
6307
6307
|
_ref$borderSize = _ref.borderSize,
|
|
@@ -6371,9 +6371,10 @@ var Box = function Box(_ref) {
|
|
|
6371
6371
|
onMouseLeave: onMouseLeave,
|
|
6372
6372
|
onFocus: onFocus,
|
|
6373
6373
|
onBlur: onBlur,
|
|
6374
|
-
onTouchEnd: onTouchEnd
|
|
6375
|
-
|
|
6376
|
-
};
|
|
6374
|
+
onTouchEnd: onTouchEnd,
|
|
6375
|
+
ref: ref
|
|
6376
|
+
}, rest), children && safeChildren(children, /*#__PURE__*/React.createElement(Fragment, null)));
|
|
6377
|
+
});
|
|
6377
6378
|
|
|
6378
6379
|
var CenterWrapper = styled.div.withConfig({
|
|
6379
6380
|
displayName: "Centerstyled__CenterWrapper",
|
|
@@ -19390,6 +19391,1254 @@ var DropdownIcon = function DropdownIcon() {
|
|
|
19390
19391
|
})))));
|
|
19391
19392
|
};
|
|
19392
19393
|
|
|
19394
|
+
var check = function (it) {
|
|
19395
|
+
return it && it.Math == Math && it;
|
|
19396
|
+
};
|
|
19397
|
+
|
|
19398
|
+
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
19399
|
+
var global_1 =
|
|
19400
|
+
// eslint-disable-next-line es-x/no-global-this -- safe
|
|
19401
|
+
check(typeof globalThis == 'object' && globalThis) ||
|
|
19402
|
+
check(typeof window == 'object' && window) ||
|
|
19403
|
+
// eslint-disable-next-line no-restricted-globals -- safe
|
|
19404
|
+
check(typeof self == 'object' && self) ||
|
|
19405
|
+
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
19406
|
+
// eslint-disable-next-line no-new-func -- fallback
|
|
19407
|
+
(function () { return this; })() || Function('return this')();
|
|
19408
|
+
|
|
19409
|
+
var fails = function (exec) {
|
|
19410
|
+
try {
|
|
19411
|
+
return !!exec();
|
|
19412
|
+
} catch (error) {
|
|
19413
|
+
return true;
|
|
19414
|
+
}
|
|
19415
|
+
};
|
|
19416
|
+
|
|
19417
|
+
// Detect IE8's incomplete defineProperty implementation
|
|
19418
|
+
var descriptors = !fails(function () {
|
|
19419
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
|
|
19420
|
+
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
19421
|
+
});
|
|
19422
|
+
|
|
19423
|
+
var functionBindNative = !fails(function () {
|
|
19424
|
+
// eslint-disable-next-line es-x/no-function-prototype-bind -- safe
|
|
19425
|
+
var test = (function () { /* empty */ }).bind();
|
|
19426
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
19427
|
+
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
19428
|
+
});
|
|
19429
|
+
|
|
19430
|
+
var call = Function.prototype.call;
|
|
19431
|
+
|
|
19432
|
+
var functionCall = functionBindNative ? call.bind(call) : function () {
|
|
19433
|
+
return call.apply(call, arguments);
|
|
19434
|
+
};
|
|
19435
|
+
|
|
19436
|
+
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
19437
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
19438
|
+
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
19439
|
+
|
|
19440
|
+
// Nashorn ~ JDK8 bug
|
|
19441
|
+
var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
19442
|
+
|
|
19443
|
+
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
19444
|
+
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
19445
|
+
var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
19446
|
+
var descriptor = getOwnPropertyDescriptor(this, V);
|
|
19447
|
+
return !!descriptor && descriptor.enumerable;
|
|
19448
|
+
} : $propertyIsEnumerable;
|
|
19449
|
+
|
|
19450
|
+
var objectPropertyIsEnumerable = {
|
|
19451
|
+
f: f
|
|
19452
|
+
};
|
|
19453
|
+
|
|
19454
|
+
var createPropertyDescriptor = function (bitmap, value) {
|
|
19455
|
+
return {
|
|
19456
|
+
enumerable: !(bitmap & 1),
|
|
19457
|
+
configurable: !(bitmap & 2),
|
|
19458
|
+
writable: !(bitmap & 4),
|
|
19459
|
+
value: value
|
|
19460
|
+
};
|
|
19461
|
+
};
|
|
19462
|
+
|
|
19463
|
+
var FunctionPrototype = Function.prototype;
|
|
19464
|
+
var bind$1 = FunctionPrototype.bind;
|
|
19465
|
+
var call$1 = FunctionPrototype.call;
|
|
19466
|
+
var uncurryThis = functionBindNative && bind$1.bind(call$1, call$1);
|
|
19467
|
+
|
|
19468
|
+
var functionUncurryThis = functionBindNative ? function (fn) {
|
|
19469
|
+
return fn && uncurryThis(fn);
|
|
19470
|
+
} : function (fn) {
|
|
19471
|
+
return fn && function () {
|
|
19472
|
+
return call$1.apply(fn, arguments);
|
|
19473
|
+
};
|
|
19474
|
+
};
|
|
19475
|
+
|
|
19476
|
+
var toString$2 = functionUncurryThis({}.toString);
|
|
19477
|
+
var stringSlice = functionUncurryThis(''.slice);
|
|
19478
|
+
|
|
19479
|
+
var classofRaw = function (it) {
|
|
19480
|
+
return stringSlice(toString$2(it), 8, -1);
|
|
19481
|
+
};
|
|
19482
|
+
|
|
19483
|
+
var Object$1 = global_1.Object;
|
|
19484
|
+
var split = functionUncurryThis(''.split);
|
|
19485
|
+
|
|
19486
|
+
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
19487
|
+
var indexedObject = fails(function () {
|
|
19488
|
+
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
19489
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
19490
|
+
return !Object$1('z').propertyIsEnumerable(0);
|
|
19491
|
+
}) ? function (it) {
|
|
19492
|
+
return classofRaw(it) == 'String' ? split(it, '') : Object$1(it);
|
|
19493
|
+
} : Object$1;
|
|
19494
|
+
|
|
19495
|
+
var TypeError$1 = global_1.TypeError;
|
|
19496
|
+
|
|
19497
|
+
// `RequireObjectCoercible` abstract operation
|
|
19498
|
+
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
19499
|
+
var requireObjectCoercible = function (it) {
|
|
19500
|
+
if (it == undefined) throw TypeError$1("Can't call method on " + it);
|
|
19501
|
+
return it;
|
|
19502
|
+
};
|
|
19503
|
+
|
|
19504
|
+
// toObject with fallback for non-array-like ES3 strings
|
|
19505
|
+
|
|
19506
|
+
|
|
19507
|
+
|
|
19508
|
+
var toIndexedObject = function (it) {
|
|
19509
|
+
return indexedObject(requireObjectCoercible(it));
|
|
19510
|
+
};
|
|
19511
|
+
|
|
19512
|
+
// `IsCallable` abstract operation
|
|
19513
|
+
// https://tc39.es/ecma262/#sec-iscallable
|
|
19514
|
+
var isCallable = function (argument) {
|
|
19515
|
+
return typeof argument == 'function';
|
|
19516
|
+
};
|
|
19517
|
+
|
|
19518
|
+
var isObject = function (it) {
|
|
19519
|
+
return typeof it == 'object' ? it !== null : isCallable(it);
|
|
19520
|
+
};
|
|
19521
|
+
|
|
19522
|
+
var aFunction = function (argument) {
|
|
19523
|
+
return isCallable(argument) ? argument : undefined;
|
|
19524
|
+
};
|
|
19525
|
+
|
|
19526
|
+
var getBuiltIn = function (namespace, method) {
|
|
19527
|
+
return arguments.length < 2 ? aFunction(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];
|
|
19528
|
+
};
|
|
19529
|
+
|
|
19530
|
+
var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
|
|
19531
|
+
|
|
19532
|
+
var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
|
|
19533
|
+
|
|
19534
|
+
var process$1 = global_1.process;
|
|
19535
|
+
var Deno = global_1.Deno;
|
|
19536
|
+
var versions = process$1 && process$1.versions || Deno && Deno.version;
|
|
19537
|
+
var v8 = versions && versions.v8;
|
|
19538
|
+
var match, version;
|
|
19539
|
+
|
|
19540
|
+
if (v8) {
|
|
19541
|
+
match = v8.split('.');
|
|
19542
|
+
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
19543
|
+
// but their correct versions are not interesting for us
|
|
19544
|
+
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
19545
|
+
}
|
|
19546
|
+
|
|
19547
|
+
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
19548
|
+
// so check `userAgent` even if `.v8` exists, but 0
|
|
19549
|
+
if (!version && engineUserAgent) {
|
|
19550
|
+
match = engineUserAgent.match(/Edge\/(\d+)/);
|
|
19551
|
+
if (!match || match[1] >= 74) {
|
|
19552
|
+
match = engineUserAgent.match(/Chrome\/(\d+)/);
|
|
19553
|
+
if (match) version = +match[1];
|
|
19554
|
+
}
|
|
19555
|
+
}
|
|
19556
|
+
|
|
19557
|
+
var engineV8Version = version;
|
|
19558
|
+
|
|
19559
|
+
/* eslint-disable es-x/no-symbol -- required for testing */
|
|
19560
|
+
|
|
19561
|
+
|
|
19562
|
+
|
|
19563
|
+
// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
|
|
19564
|
+
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
19565
|
+
var symbol = Symbol();
|
|
19566
|
+
// Chrome 38 Symbol has incorrect toString conversion
|
|
19567
|
+
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
19568
|
+
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
19569
|
+
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
19570
|
+
!Symbol.sham && engineV8Version && engineV8Version < 41;
|
|
19571
|
+
});
|
|
19572
|
+
|
|
19573
|
+
/* eslint-disable es-x/no-symbol -- required for testing */
|
|
19574
|
+
|
|
19575
|
+
|
|
19576
|
+
var useSymbolAsUid = nativeSymbol
|
|
19577
|
+
&& !Symbol.sham
|
|
19578
|
+
&& typeof Symbol.iterator == 'symbol';
|
|
19579
|
+
|
|
19580
|
+
var Object$2 = global_1.Object;
|
|
19581
|
+
|
|
19582
|
+
var isSymbol = useSymbolAsUid ? function (it) {
|
|
19583
|
+
return typeof it == 'symbol';
|
|
19584
|
+
} : function (it) {
|
|
19585
|
+
var $Symbol = getBuiltIn('Symbol');
|
|
19586
|
+
return isCallable($Symbol) && objectIsPrototypeOf($Symbol.prototype, Object$2(it));
|
|
19587
|
+
};
|
|
19588
|
+
|
|
19589
|
+
var String$1 = global_1.String;
|
|
19590
|
+
|
|
19591
|
+
var tryToString = function (argument) {
|
|
19592
|
+
try {
|
|
19593
|
+
return String$1(argument);
|
|
19594
|
+
} catch (error) {
|
|
19595
|
+
return 'Object';
|
|
19596
|
+
}
|
|
19597
|
+
};
|
|
19598
|
+
|
|
19599
|
+
var TypeError$2 = global_1.TypeError;
|
|
19600
|
+
|
|
19601
|
+
// `Assert: IsCallable(argument) is true`
|
|
19602
|
+
var aCallable = function (argument) {
|
|
19603
|
+
if (isCallable(argument)) return argument;
|
|
19604
|
+
throw TypeError$2(tryToString(argument) + ' is not a function');
|
|
19605
|
+
};
|
|
19606
|
+
|
|
19607
|
+
// `GetMethod` abstract operation
|
|
19608
|
+
// https://tc39.es/ecma262/#sec-getmethod
|
|
19609
|
+
var getMethod = function (V, P) {
|
|
19610
|
+
var func = V[P];
|
|
19611
|
+
return func == null ? undefined : aCallable(func);
|
|
19612
|
+
};
|
|
19613
|
+
|
|
19614
|
+
var TypeError$3 = global_1.TypeError;
|
|
19615
|
+
|
|
19616
|
+
// `OrdinaryToPrimitive` abstract operation
|
|
19617
|
+
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
19618
|
+
var ordinaryToPrimitive = function (input, pref) {
|
|
19619
|
+
var fn, val;
|
|
19620
|
+
if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
|
|
19621
|
+
if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) return val;
|
|
19622
|
+
if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) return val;
|
|
19623
|
+
throw TypeError$3("Can't convert object to primitive value");
|
|
19624
|
+
};
|
|
19625
|
+
|
|
19626
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- safe
|
|
19627
|
+
var defineProperty = Object.defineProperty;
|
|
19628
|
+
|
|
19629
|
+
var setGlobal = function (key, value) {
|
|
19630
|
+
try {
|
|
19631
|
+
defineProperty(global_1, key, { value: value, configurable: true, writable: true });
|
|
19632
|
+
} catch (error) {
|
|
19633
|
+
global_1[key] = value;
|
|
19634
|
+
} return value;
|
|
19635
|
+
};
|
|
19636
|
+
|
|
19637
|
+
var SHARED = '__core-js_shared__';
|
|
19638
|
+
var store = global_1[SHARED] || setGlobal(SHARED, {});
|
|
19639
|
+
|
|
19640
|
+
var sharedStore = store;
|
|
19641
|
+
|
|
19642
|
+
var shared = createCommonjsModule(function (module) {
|
|
19643
|
+
(module.exports = function (key, value) {
|
|
19644
|
+
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
19645
|
+
})('versions', []).push({
|
|
19646
|
+
version: '3.22.5',
|
|
19647
|
+
mode: 'global',
|
|
19648
|
+
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
19649
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.22.5/LICENSE',
|
|
19650
|
+
source: 'https://github.com/zloirock/core-js'
|
|
19651
|
+
});
|
|
19652
|
+
});
|
|
19653
|
+
|
|
19654
|
+
var Object$3 = global_1.Object;
|
|
19655
|
+
|
|
19656
|
+
// `ToObject` abstract operation
|
|
19657
|
+
// https://tc39.es/ecma262/#sec-toobject
|
|
19658
|
+
var toObject = function (argument) {
|
|
19659
|
+
return Object$3(requireObjectCoercible(argument));
|
|
19660
|
+
};
|
|
19661
|
+
|
|
19662
|
+
var hasOwnProperty = functionUncurryThis({}.hasOwnProperty);
|
|
19663
|
+
|
|
19664
|
+
// `HasOwnProperty` abstract operation
|
|
19665
|
+
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
19666
|
+
// eslint-disable-next-line es-x/no-object-hasown -- safe
|
|
19667
|
+
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
19668
|
+
return hasOwnProperty(toObject(it), key);
|
|
19669
|
+
};
|
|
19670
|
+
|
|
19671
|
+
var id = 0;
|
|
19672
|
+
var postfix = Math.random();
|
|
19673
|
+
var toString$3 = functionUncurryThis(1.0.toString);
|
|
19674
|
+
|
|
19675
|
+
var uid = function (key) {
|
|
19676
|
+
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$3(++id + postfix, 36);
|
|
19677
|
+
};
|
|
19678
|
+
|
|
19679
|
+
var WellKnownSymbolsStore = shared('wks');
|
|
19680
|
+
var Symbol$1 = global_1.Symbol;
|
|
19681
|
+
var symbolFor = Symbol$1 && Symbol$1['for'];
|
|
19682
|
+
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
|
19683
|
+
|
|
19684
|
+
var wellKnownSymbol = function (name) {
|
|
19685
|
+
if (!hasOwnProperty_1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
19686
|
+
var description = 'Symbol.' + name;
|
|
19687
|
+
if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
|
|
19688
|
+
WellKnownSymbolsStore[name] = Symbol$1[name];
|
|
19689
|
+
} else if (useSymbolAsUid && symbolFor) {
|
|
19690
|
+
WellKnownSymbolsStore[name] = symbolFor(description);
|
|
19691
|
+
} else {
|
|
19692
|
+
WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
|
|
19693
|
+
}
|
|
19694
|
+
} return WellKnownSymbolsStore[name];
|
|
19695
|
+
};
|
|
19696
|
+
|
|
19697
|
+
var TypeError$4 = global_1.TypeError;
|
|
19698
|
+
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
|
19699
|
+
|
|
19700
|
+
// `ToPrimitive` abstract operation
|
|
19701
|
+
// https://tc39.es/ecma262/#sec-toprimitive
|
|
19702
|
+
var toPrimitive = function (input, pref) {
|
|
19703
|
+
if (!isObject(input) || isSymbol(input)) return input;
|
|
19704
|
+
var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
|
19705
|
+
var result;
|
|
19706
|
+
if (exoticToPrim) {
|
|
19707
|
+
if (pref === undefined) pref = 'default';
|
|
19708
|
+
result = functionCall(exoticToPrim, input, pref);
|
|
19709
|
+
if (!isObject(result) || isSymbol(result)) return result;
|
|
19710
|
+
throw TypeError$4("Can't convert object to primitive value");
|
|
19711
|
+
}
|
|
19712
|
+
if (pref === undefined) pref = 'number';
|
|
19713
|
+
return ordinaryToPrimitive(input, pref);
|
|
19714
|
+
};
|
|
19715
|
+
|
|
19716
|
+
// `ToPropertyKey` abstract operation
|
|
19717
|
+
// https://tc39.es/ecma262/#sec-topropertykey
|
|
19718
|
+
var toPropertyKey = function (argument) {
|
|
19719
|
+
var key = toPrimitive(argument, 'string');
|
|
19720
|
+
return isSymbol(key) ? key : key + '';
|
|
19721
|
+
};
|
|
19722
|
+
|
|
19723
|
+
var document$1 = global_1.document;
|
|
19724
|
+
// typeof document.createElement is 'object' in old IE
|
|
19725
|
+
var EXISTS = isObject(document$1) && isObject(document$1.createElement);
|
|
19726
|
+
|
|
19727
|
+
var documentCreateElement = function (it) {
|
|
19728
|
+
return EXISTS ? document$1.createElement(it) : {};
|
|
19729
|
+
};
|
|
19730
|
+
|
|
19731
|
+
// Thanks to IE8 for its funny defineProperty
|
|
19732
|
+
var ie8DomDefine = !descriptors && !fails(function () {
|
|
19733
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
|
|
19734
|
+
return Object.defineProperty(documentCreateElement('div'), 'a', {
|
|
19735
|
+
get: function () { return 7; }
|
|
19736
|
+
}).a != 7;
|
|
19737
|
+
});
|
|
19738
|
+
|
|
19739
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
19740
|
+
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
19741
|
+
|
|
19742
|
+
// `Object.getOwnPropertyDescriptor` method
|
|
19743
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
19744
|
+
var f$1 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
|
19745
|
+
O = toIndexedObject(O);
|
|
19746
|
+
P = toPropertyKey(P);
|
|
19747
|
+
if (ie8DomDefine) try {
|
|
19748
|
+
return $getOwnPropertyDescriptor(O, P);
|
|
19749
|
+
} catch (error) { /* empty */ }
|
|
19750
|
+
if (hasOwnProperty_1(O, P)) return createPropertyDescriptor(!functionCall(objectPropertyIsEnumerable.f, O, P), O[P]);
|
|
19751
|
+
};
|
|
19752
|
+
|
|
19753
|
+
var objectGetOwnPropertyDescriptor = {
|
|
19754
|
+
f: f$1
|
|
19755
|
+
};
|
|
19756
|
+
|
|
19757
|
+
// V8 ~ Chrome 36-
|
|
19758
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
19759
|
+
var v8PrototypeDefineBug = descriptors && fails(function () {
|
|
19760
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
|
|
19761
|
+
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
19762
|
+
value: 42,
|
|
19763
|
+
writable: false
|
|
19764
|
+
}).prototype != 42;
|
|
19765
|
+
});
|
|
19766
|
+
|
|
19767
|
+
var String$2 = global_1.String;
|
|
19768
|
+
var TypeError$5 = global_1.TypeError;
|
|
19769
|
+
|
|
19770
|
+
// `Assert: Type(argument) is Object`
|
|
19771
|
+
var anObject = function (argument) {
|
|
19772
|
+
if (isObject(argument)) return argument;
|
|
19773
|
+
throw TypeError$5(String$2(argument) + ' is not an object');
|
|
19774
|
+
};
|
|
19775
|
+
|
|
19776
|
+
var TypeError$6 = global_1.TypeError;
|
|
19777
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- safe
|
|
19778
|
+
var $defineProperty = Object.defineProperty;
|
|
19779
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
19780
|
+
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
19781
|
+
var ENUMERABLE = 'enumerable';
|
|
19782
|
+
var CONFIGURABLE = 'configurable';
|
|
19783
|
+
var WRITABLE = 'writable';
|
|
19784
|
+
|
|
19785
|
+
// `Object.defineProperty` method
|
|
19786
|
+
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
19787
|
+
var f$2 = descriptors ? v8PrototypeDefineBug ? function defineProperty(O, P, Attributes) {
|
|
19788
|
+
anObject(O);
|
|
19789
|
+
P = toPropertyKey(P);
|
|
19790
|
+
anObject(Attributes);
|
|
19791
|
+
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
19792
|
+
var current = $getOwnPropertyDescriptor$1(O, P);
|
|
19793
|
+
if (current && current[WRITABLE]) {
|
|
19794
|
+
O[P] = Attributes.value;
|
|
19795
|
+
Attributes = {
|
|
19796
|
+
configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
|
|
19797
|
+
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
|
19798
|
+
writable: false
|
|
19799
|
+
};
|
|
19800
|
+
}
|
|
19801
|
+
} return $defineProperty(O, P, Attributes);
|
|
19802
|
+
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
|
19803
|
+
anObject(O);
|
|
19804
|
+
P = toPropertyKey(P);
|
|
19805
|
+
anObject(Attributes);
|
|
19806
|
+
if (ie8DomDefine) try {
|
|
19807
|
+
return $defineProperty(O, P, Attributes);
|
|
19808
|
+
} catch (error) { /* empty */ }
|
|
19809
|
+
if ('get' in Attributes || 'set' in Attributes) throw TypeError$6('Accessors not supported');
|
|
19810
|
+
if ('value' in Attributes) O[P] = Attributes.value;
|
|
19811
|
+
return O;
|
|
19812
|
+
};
|
|
19813
|
+
|
|
19814
|
+
var objectDefineProperty = {
|
|
19815
|
+
f: f$2
|
|
19816
|
+
};
|
|
19817
|
+
|
|
19818
|
+
var createNonEnumerableProperty = descriptors ? function (object, key, value) {
|
|
19819
|
+
return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
|
|
19820
|
+
} : function (object, key, value) {
|
|
19821
|
+
object[key] = value;
|
|
19822
|
+
return object;
|
|
19823
|
+
};
|
|
19824
|
+
|
|
19825
|
+
var FunctionPrototype$1 = Function.prototype;
|
|
19826
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
19827
|
+
var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
|
|
19828
|
+
|
|
19829
|
+
var EXISTS$1 = hasOwnProperty_1(FunctionPrototype$1, 'name');
|
|
19830
|
+
// additional protection from minified / mangled / dropped function names
|
|
19831
|
+
var PROPER = EXISTS$1 && (function something() { /* empty */ }).name === 'something';
|
|
19832
|
+
var CONFIGURABLE$1 = EXISTS$1 && (!descriptors || (descriptors && getDescriptor(FunctionPrototype$1, 'name').configurable));
|
|
19833
|
+
|
|
19834
|
+
var functionName = {
|
|
19835
|
+
EXISTS: EXISTS$1,
|
|
19836
|
+
PROPER: PROPER,
|
|
19837
|
+
CONFIGURABLE: CONFIGURABLE$1
|
|
19838
|
+
};
|
|
19839
|
+
|
|
19840
|
+
var functionToString = functionUncurryThis(Function.toString);
|
|
19841
|
+
|
|
19842
|
+
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
19843
|
+
if (!isCallable(sharedStore.inspectSource)) {
|
|
19844
|
+
sharedStore.inspectSource = function (it) {
|
|
19845
|
+
return functionToString(it);
|
|
19846
|
+
};
|
|
19847
|
+
}
|
|
19848
|
+
|
|
19849
|
+
var inspectSource = sharedStore.inspectSource;
|
|
19850
|
+
|
|
19851
|
+
var WeakMap$1 = global_1.WeakMap;
|
|
19852
|
+
|
|
19853
|
+
var nativeWeakMap = isCallable(WeakMap$1) && /native code/.test(inspectSource(WeakMap$1));
|
|
19854
|
+
|
|
19855
|
+
var keys$1 = shared('keys');
|
|
19856
|
+
|
|
19857
|
+
var sharedKey = function (key) {
|
|
19858
|
+
return keys$1[key] || (keys$1[key] = uid(key));
|
|
19859
|
+
};
|
|
19860
|
+
|
|
19861
|
+
var hiddenKeys = {};
|
|
19862
|
+
|
|
19863
|
+
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
19864
|
+
var TypeError$7 = global_1.TypeError;
|
|
19865
|
+
var WeakMap$2 = global_1.WeakMap;
|
|
19866
|
+
var set, get, has;
|
|
19867
|
+
|
|
19868
|
+
var enforce = function (it) {
|
|
19869
|
+
return has(it) ? get(it) : set(it, {});
|
|
19870
|
+
};
|
|
19871
|
+
|
|
19872
|
+
var getterFor = function (TYPE) {
|
|
19873
|
+
return function (it) {
|
|
19874
|
+
var state;
|
|
19875
|
+
if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
|
19876
|
+
throw TypeError$7('Incompatible receiver, ' + TYPE + ' required');
|
|
19877
|
+
} return state;
|
|
19878
|
+
};
|
|
19879
|
+
};
|
|
19880
|
+
|
|
19881
|
+
if (nativeWeakMap || sharedStore.state) {
|
|
19882
|
+
var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$2());
|
|
19883
|
+
var wmget = functionUncurryThis(store$1.get);
|
|
19884
|
+
var wmhas = functionUncurryThis(store$1.has);
|
|
19885
|
+
var wmset = functionUncurryThis(store$1.set);
|
|
19886
|
+
set = function (it, metadata) {
|
|
19887
|
+
if (wmhas(store$1, it)) throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
|
|
19888
|
+
metadata.facade = it;
|
|
19889
|
+
wmset(store$1, it, metadata);
|
|
19890
|
+
return metadata;
|
|
19891
|
+
};
|
|
19892
|
+
get = function (it) {
|
|
19893
|
+
return wmget(store$1, it) || {};
|
|
19894
|
+
};
|
|
19895
|
+
has = function (it) {
|
|
19896
|
+
return wmhas(store$1, it);
|
|
19897
|
+
};
|
|
19898
|
+
} else {
|
|
19899
|
+
var STATE = sharedKey('state');
|
|
19900
|
+
hiddenKeys[STATE] = true;
|
|
19901
|
+
set = function (it, metadata) {
|
|
19902
|
+
if (hasOwnProperty_1(it, STATE)) throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
|
|
19903
|
+
metadata.facade = it;
|
|
19904
|
+
createNonEnumerableProperty(it, STATE, metadata);
|
|
19905
|
+
return metadata;
|
|
19906
|
+
};
|
|
19907
|
+
get = function (it) {
|
|
19908
|
+
return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
|
|
19909
|
+
};
|
|
19910
|
+
has = function (it) {
|
|
19911
|
+
return hasOwnProperty_1(it, STATE);
|
|
19912
|
+
};
|
|
19913
|
+
}
|
|
19914
|
+
|
|
19915
|
+
var internalState = {
|
|
19916
|
+
set: set,
|
|
19917
|
+
get: get,
|
|
19918
|
+
has: has,
|
|
19919
|
+
enforce: enforce,
|
|
19920
|
+
getterFor: getterFor
|
|
19921
|
+
};
|
|
19922
|
+
|
|
19923
|
+
var makeBuiltIn_1 = createCommonjsModule(function (module) {
|
|
19924
|
+
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
|
|
19925
|
+
|
|
19926
|
+
|
|
19927
|
+
|
|
19928
|
+
var enforceInternalState = internalState.enforce;
|
|
19929
|
+
var getInternalState = internalState.get;
|
|
19930
|
+
// eslint-disable-next-line es-x/no-object-defineproperty -- safe
|
|
19931
|
+
var defineProperty = Object.defineProperty;
|
|
19932
|
+
|
|
19933
|
+
var CONFIGURABLE_LENGTH = descriptors && !fails(function () {
|
|
19934
|
+
return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
19935
|
+
});
|
|
19936
|
+
|
|
19937
|
+
var TEMPLATE = String(String).split('String');
|
|
19938
|
+
|
|
19939
|
+
var makeBuiltIn = module.exports = function (value, name, options) {
|
|
19940
|
+
if (String(name).slice(0, 7) === 'Symbol(') {
|
|
19941
|
+
name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
19942
|
+
}
|
|
19943
|
+
if (options && options.getter) name = 'get ' + name;
|
|
19944
|
+
if (options && options.setter) name = 'set ' + name;
|
|
19945
|
+
if (!hasOwnProperty_1(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
|
|
19946
|
+
defineProperty(value, 'name', { value: name, configurable: true });
|
|
19947
|
+
}
|
|
19948
|
+
if (CONFIGURABLE_LENGTH && options && hasOwnProperty_1(options, 'arity') && value.length !== options.arity) {
|
|
19949
|
+
defineProperty(value, 'length', { value: options.arity });
|
|
19950
|
+
}
|
|
19951
|
+
if (options && hasOwnProperty_1(options, 'constructor') && options.constructor) {
|
|
19952
|
+
if (descriptors) try {
|
|
19953
|
+
defineProperty(value, 'prototype', { writable: false });
|
|
19954
|
+
} catch (error) { /* empty */ }
|
|
19955
|
+
} else value.prototype = undefined;
|
|
19956
|
+
var state = enforceInternalState(value);
|
|
19957
|
+
if (!hasOwnProperty_1(state, 'source')) {
|
|
19958
|
+
state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
|
|
19959
|
+
} return value;
|
|
19960
|
+
};
|
|
19961
|
+
|
|
19962
|
+
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
19963
|
+
// eslint-disable-next-line no-extend-native -- required
|
|
19964
|
+
Function.prototype.toString = makeBuiltIn(function toString() {
|
|
19965
|
+
return isCallable(this) && getInternalState(this).source || inspectSource(this);
|
|
19966
|
+
}, 'toString');
|
|
19967
|
+
});
|
|
19968
|
+
|
|
19969
|
+
var defineBuiltIn = function (O, key, value, options) {
|
|
19970
|
+
var unsafe = options ? !!options.unsafe : false;
|
|
19971
|
+
var simple = options ? !!options.enumerable : false;
|
|
19972
|
+
var noTargetGet = options ? !!options.noTargetGet : false;
|
|
19973
|
+
var name = options && options.name !== undefined ? options.name : key;
|
|
19974
|
+
if (isCallable(value)) makeBuiltIn_1(value, name, options);
|
|
19975
|
+
if (O === global_1) {
|
|
19976
|
+
if (simple) O[key] = value;
|
|
19977
|
+
else setGlobal(key, value);
|
|
19978
|
+
return O;
|
|
19979
|
+
} else if (!unsafe) {
|
|
19980
|
+
delete O[key];
|
|
19981
|
+
} else if (!noTargetGet && O[key]) {
|
|
19982
|
+
simple = true;
|
|
19983
|
+
}
|
|
19984
|
+
if (simple) O[key] = value;
|
|
19985
|
+
else createNonEnumerableProperty(O, key, value);
|
|
19986
|
+
return O;
|
|
19987
|
+
};
|
|
19988
|
+
|
|
19989
|
+
var ceil = Math.ceil;
|
|
19990
|
+
var floor = Math.floor;
|
|
19991
|
+
|
|
19992
|
+
// `ToIntegerOrInfinity` abstract operation
|
|
19993
|
+
// https://tc39.es/ecma262/#sec-tointegerorinfinity
|
|
19994
|
+
var toIntegerOrInfinity = function (argument) {
|
|
19995
|
+
var number = +argument;
|
|
19996
|
+
// eslint-disable-next-line no-self-compare -- safe
|
|
19997
|
+
return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
|
|
19998
|
+
};
|
|
19999
|
+
|
|
20000
|
+
var max = Math.max;
|
|
20001
|
+
var min = Math.min;
|
|
20002
|
+
|
|
20003
|
+
// Helper for a popular repeating case of the spec:
|
|
20004
|
+
// Let integer be ? ToInteger(index).
|
|
20005
|
+
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
20006
|
+
var toAbsoluteIndex = function (index, length) {
|
|
20007
|
+
var integer = toIntegerOrInfinity(index);
|
|
20008
|
+
return integer < 0 ? max(integer + length, 0) : min(integer, length);
|
|
20009
|
+
};
|
|
20010
|
+
|
|
20011
|
+
var min$1 = Math.min;
|
|
20012
|
+
|
|
20013
|
+
// `ToLength` abstract operation
|
|
20014
|
+
// https://tc39.es/ecma262/#sec-tolength
|
|
20015
|
+
var toLength = function (argument) {
|
|
20016
|
+
return argument > 0 ? min$1(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
20017
|
+
};
|
|
20018
|
+
|
|
20019
|
+
// `LengthOfArrayLike` abstract operation
|
|
20020
|
+
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
20021
|
+
var lengthOfArrayLike = function (obj) {
|
|
20022
|
+
return toLength(obj.length);
|
|
20023
|
+
};
|
|
20024
|
+
|
|
20025
|
+
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
20026
|
+
var createMethod = function (IS_INCLUDES) {
|
|
20027
|
+
return function ($this, el, fromIndex) {
|
|
20028
|
+
var O = toIndexedObject($this);
|
|
20029
|
+
var length = lengthOfArrayLike(O);
|
|
20030
|
+
var index = toAbsoluteIndex(fromIndex, length);
|
|
20031
|
+
var value;
|
|
20032
|
+
// Array#includes uses SameValueZero equality algorithm
|
|
20033
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
20034
|
+
if (IS_INCLUDES && el != el) while (length > index) {
|
|
20035
|
+
value = O[index++];
|
|
20036
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
20037
|
+
if (value != value) return true;
|
|
20038
|
+
// Array#indexOf ignores holes, Array#includes - not
|
|
20039
|
+
} else for (;length > index; index++) {
|
|
20040
|
+
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
|
20041
|
+
} return !IS_INCLUDES && -1;
|
|
20042
|
+
};
|
|
20043
|
+
};
|
|
20044
|
+
|
|
20045
|
+
var arrayIncludes = {
|
|
20046
|
+
// `Array.prototype.includes` method
|
|
20047
|
+
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
20048
|
+
includes: createMethod(true),
|
|
20049
|
+
// `Array.prototype.indexOf` method
|
|
20050
|
+
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
20051
|
+
indexOf: createMethod(false)
|
|
20052
|
+
};
|
|
20053
|
+
|
|
20054
|
+
var indexOf = arrayIncludes.indexOf;
|
|
20055
|
+
|
|
20056
|
+
|
|
20057
|
+
var push = functionUncurryThis([].push);
|
|
20058
|
+
|
|
20059
|
+
var objectKeysInternal = function (object, names) {
|
|
20060
|
+
var O = toIndexedObject(object);
|
|
20061
|
+
var i = 0;
|
|
20062
|
+
var result = [];
|
|
20063
|
+
var key;
|
|
20064
|
+
for (key in O) !hasOwnProperty_1(hiddenKeys, key) && hasOwnProperty_1(O, key) && push(result, key);
|
|
20065
|
+
// Don't enum bug & hidden keys
|
|
20066
|
+
while (names.length > i) if (hasOwnProperty_1(O, key = names[i++])) {
|
|
20067
|
+
~indexOf(result, key) || push(result, key);
|
|
20068
|
+
}
|
|
20069
|
+
return result;
|
|
20070
|
+
};
|
|
20071
|
+
|
|
20072
|
+
// IE8- don't enum bug keys
|
|
20073
|
+
var enumBugKeys = [
|
|
20074
|
+
'constructor',
|
|
20075
|
+
'hasOwnProperty',
|
|
20076
|
+
'isPrototypeOf',
|
|
20077
|
+
'propertyIsEnumerable',
|
|
20078
|
+
'toLocaleString',
|
|
20079
|
+
'toString',
|
|
20080
|
+
'valueOf'
|
|
20081
|
+
];
|
|
20082
|
+
|
|
20083
|
+
var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
|
|
20084
|
+
|
|
20085
|
+
// `Object.getOwnPropertyNames` method
|
|
20086
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
20087
|
+
// eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
|
|
20088
|
+
var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
20089
|
+
return objectKeysInternal(O, hiddenKeys$1);
|
|
20090
|
+
};
|
|
20091
|
+
|
|
20092
|
+
var objectGetOwnPropertyNames = {
|
|
20093
|
+
f: f$3
|
|
20094
|
+
};
|
|
20095
|
+
|
|
20096
|
+
// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
|
|
20097
|
+
var f$4 = Object.getOwnPropertySymbols;
|
|
20098
|
+
|
|
20099
|
+
var objectGetOwnPropertySymbols = {
|
|
20100
|
+
f: f$4
|
|
20101
|
+
};
|
|
20102
|
+
|
|
20103
|
+
var concat = functionUncurryThis([].concat);
|
|
20104
|
+
|
|
20105
|
+
// all object keys, includes non-enumerable and symbols
|
|
20106
|
+
var ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
20107
|
+
var keys = objectGetOwnPropertyNames.f(anObject(it));
|
|
20108
|
+
var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
|
20109
|
+
return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
|
|
20110
|
+
};
|
|
20111
|
+
|
|
20112
|
+
var copyConstructorProperties = function (target, source, exceptions) {
|
|
20113
|
+
var keys = ownKeys$1(source);
|
|
20114
|
+
var defineProperty = objectDefineProperty.f;
|
|
20115
|
+
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
20116
|
+
for (var i = 0; i < keys.length; i++) {
|
|
20117
|
+
var key = keys[i];
|
|
20118
|
+
if (!hasOwnProperty_1(target, key) && !(exceptions && hasOwnProperty_1(exceptions, key))) {
|
|
20119
|
+
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
20120
|
+
}
|
|
20121
|
+
}
|
|
20122
|
+
};
|
|
20123
|
+
|
|
20124
|
+
var replacement = /#|\.prototype\./;
|
|
20125
|
+
|
|
20126
|
+
var isForced = function (feature, detection) {
|
|
20127
|
+
var value = data[normalize(feature)];
|
|
20128
|
+
return value == POLYFILL ? true
|
|
20129
|
+
: value == NATIVE ? false
|
|
20130
|
+
: isCallable(detection) ? fails(detection)
|
|
20131
|
+
: !!detection;
|
|
20132
|
+
};
|
|
20133
|
+
|
|
20134
|
+
var normalize = isForced.normalize = function (string) {
|
|
20135
|
+
return String(string).replace(replacement, '.').toLowerCase();
|
|
20136
|
+
};
|
|
20137
|
+
|
|
20138
|
+
var data = isForced.data = {};
|
|
20139
|
+
var NATIVE = isForced.NATIVE = 'N';
|
|
20140
|
+
var POLYFILL = isForced.POLYFILL = 'P';
|
|
20141
|
+
|
|
20142
|
+
var isForced_1 = isForced;
|
|
20143
|
+
|
|
20144
|
+
var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
|
20145
|
+
|
|
20146
|
+
|
|
20147
|
+
|
|
20148
|
+
|
|
20149
|
+
|
|
20150
|
+
|
|
20151
|
+
/*
|
|
20152
|
+
options.target - name of the target object
|
|
20153
|
+
options.global - target is the global object
|
|
20154
|
+
options.stat - export as static methods of target
|
|
20155
|
+
options.proto - export as prototype methods of target
|
|
20156
|
+
options.real - real prototype method for the `pure` version
|
|
20157
|
+
options.forced - export even if the native feature is available
|
|
20158
|
+
options.bind - bind methods to the target, required for the `pure` version
|
|
20159
|
+
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
|
20160
|
+
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
|
20161
|
+
options.sham - add a flag to not completely full polyfills
|
|
20162
|
+
options.enumerable - export as enumerable property
|
|
20163
|
+
options.noTargetGet - prevent calling a getter on target
|
|
20164
|
+
options.name - the .name of the function if it does not match the key
|
|
20165
|
+
*/
|
|
20166
|
+
var _export = function (options, source) {
|
|
20167
|
+
var TARGET = options.target;
|
|
20168
|
+
var GLOBAL = options.global;
|
|
20169
|
+
var STATIC = options.stat;
|
|
20170
|
+
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
20171
|
+
if (GLOBAL) {
|
|
20172
|
+
target = global_1;
|
|
20173
|
+
} else if (STATIC) {
|
|
20174
|
+
target = global_1[TARGET] || setGlobal(TARGET, {});
|
|
20175
|
+
} else {
|
|
20176
|
+
target = (global_1[TARGET] || {}).prototype;
|
|
20177
|
+
}
|
|
20178
|
+
if (target) for (key in source) {
|
|
20179
|
+
sourceProperty = source[key];
|
|
20180
|
+
if (options.noTargetGet) {
|
|
20181
|
+
descriptor = getOwnPropertyDescriptor$1(target, key);
|
|
20182
|
+
targetProperty = descriptor && descriptor.value;
|
|
20183
|
+
} else targetProperty = target[key];
|
|
20184
|
+
FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
20185
|
+
// contained in target
|
|
20186
|
+
if (!FORCED && targetProperty !== undefined) {
|
|
20187
|
+
if (typeof sourceProperty == typeof targetProperty) continue;
|
|
20188
|
+
copyConstructorProperties(sourceProperty, targetProperty);
|
|
20189
|
+
}
|
|
20190
|
+
// add a flag to not completely full polyfills
|
|
20191
|
+
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
20192
|
+
createNonEnumerableProperty(sourceProperty, 'sham', true);
|
|
20193
|
+
}
|
|
20194
|
+
defineBuiltIn(target, key, sourceProperty, options);
|
|
20195
|
+
}
|
|
20196
|
+
};
|
|
20197
|
+
|
|
20198
|
+
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
20199
|
+
var test$1 = {};
|
|
20200
|
+
|
|
20201
|
+
test$1[TO_STRING_TAG] = 'z';
|
|
20202
|
+
|
|
20203
|
+
var toStringTagSupport = String(test$1) === '[object z]';
|
|
20204
|
+
|
|
20205
|
+
var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
|
|
20206
|
+
var Object$4 = global_1.Object;
|
|
20207
|
+
|
|
20208
|
+
// ES3 wrong here
|
|
20209
|
+
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
|
20210
|
+
|
|
20211
|
+
// fallback for IE11 Script Access Denied error
|
|
20212
|
+
var tryGet = function (it, key) {
|
|
20213
|
+
try {
|
|
20214
|
+
return it[key];
|
|
20215
|
+
} catch (error) { /* empty */ }
|
|
20216
|
+
};
|
|
20217
|
+
|
|
20218
|
+
// getting tag from ES6+ `Object.prototype.toString`
|
|
20219
|
+
var classof = toStringTagSupport ? classofRaw : function (it) {
|
|
20220
|
+
var O, tag, result;
|
|
20221
|
+
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
20222
|
+
// @@toStringTag case
|
|
20223
|
+
: typeof (tag = tryGet(O = Object$4(it), TO_STRING_TAG$1)) == 'string' ? tag
|
|
20224
|
+
// builtinTag case
|
|
20225
|
+
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
20226
|
+
// ES3 arguments fallback
|
|
20227
|
+
: (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
|
20228
|
+
};
|
|
20229
|
+
|
|
20230
|
+
var String$3 = global_1.String;
|
|
20231
|
+
|
|
20232
|
+
var toString_1 = function (argument) {
|
|
20233
|
+
if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
|
|
20234
|
+
return String$3(argument);
|
|
20235
|
+
};
|
|
20236
|
+
|
|
20237
|
+
var charAt = functionUncurryThis(''.charAt);
|
|
20238
|
+
|
|
20239
|
+
var FORCED = fails(function () {
|
|
20240
|
+
// eslint-disable-next-line es-x/no-array-string-prototype-at -- safe
|
|
20241
|
+
return '𠮷'.at(-2) !== '\uD842';
|
|
20242
|
+
});
|
|
20243
|
+
|
|
20244
|
+
// `String.prototype.at` method
|
|
20245
|
+
// https://github.com/tc39/proposal-relative-indexing-method
|
|
20246
|
+
_export({ target: 'String', proto: true, forced: FORCED }, {
|
|
20247
|
+
at: function at(index) {
|
|
20248
|
+
var S = toString_1(requireObjectCoercible(this));
|
|
20249
|
+
var len = S.length;
|
|
20250
|
+
var relativeIndex = toIntegerOrInfinity(index);
|
|
20251
|
+
var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
|
|
20252
|
+
return (k < 0 || k >= len) ? undefined : charAt(S, k);
|
|
20253
|
+
}
|
|
20254
|
+
});
|
|
20255
|
+
|
|
20256
|
+
// `Object.keys` method
|
|
20257
|
+
// https://tc39.es/ecma262/#sec-object.keys
|
|
20258
|
+
// eslint-disable-next-line es-x/no-object-keys -- safe
|
|
20259
|
+
var objectKeys = Object.keys || function keys(O) {
|
|
20260
|
+
return objectKeysInternal(O, enumBugKeys);
|
|
20261
|
+
};
|
|
20262
|
+
|
|
20263
|
+
// `Object.defineProperties` method
|
|
20264
|
+
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
20265
|
+
// eslint-disable-next-line es-x/no-object-defineproperties -- safe
|
|
20266
|
+
var f$5 = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
20267
|
+
anObject(O);
|
|
20268
|
+
var props = toIndexedObject(Properties);
|
|
20269
|
+
var keys = objectKeys(Properties);
|
|
20270
|
+
var length = keys.length;
|
|
20271
|
+
var index = 0;
|
|
20272
|
+
var key;
|
|
20273
|
+
while (length > index) objectDefineProperty.f(O, key = keys[index++], props[key]);
|
|
20274
|
+
return O;
|
|
20275
|
+
};
|
|
20276
|
+
|
|
20277
|
+
var objectDefineProperties = {
|
|
20278
|
+
f: f$5
|
|
20279
|
+
};
|
|
20280
|
+
|
|
20281
|
+
var html = getBuiltIn('document', 'documentElement');
|
|
20282
|
+
|
|
20283
|
+
/* global ActiveXObject -- old IE, WSH */
|
|
20284
|
+
|
|
20285
|
+
|
|
20286
|
+
|
|
20287
|
+
|
|
20288
|
+
|
|
20289
|
+
|
|
20290
|
+
|
|
20291
|
+
|
|
20292
|
+
var GT = '>';
|
|
20293
|
+
var LT = '<';
|
|
20294
|
+
var PROTOTYPE = 'prototype';
|
|
20295
|
+
var SCRIPT = 'script';
|
|
20296
|
+
var IE_PROTO = sharedKey('IE_PROTO');
|
|
20297
|
+
|
|
20298
|
+
var EmptyConstructor = function () { /* empty */ };
|
|
20299
|
+
|
|
20300
|
+
var scriptTag = function (content) {
|
|
20301
|
+
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
|
20302
|
+
};
|
|
20303
|
+
|
|
20304
|
+
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
|
|
20305
|
+
var NullProtoObjectViaActiveX = function (activeXDocument) {
|
|
20306
|
+
activeXDocument.write(scriptTag(''));
|
|
20307
|
+
activeXDocument.close();
|
|
20308
|
+
var temp = activeXDocument.parentWindow.Object;
|
|
20309
|
+
activeXDocument = null; // avoid memory leak
|
|
20310
|
+
return temp;
|
|
20311
|
+
};
|
|
20312
|
+
|
|
20313
|
+
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
20314
|
+
var NullProtoObjectViaIFrame = function () {
|
|
20315
|
+
// Thrash, waste and sodomy: IE GC bug
|
|
20316
|
+
var iframe = documentCreateElement('iframe');
|
|
20317
|
+
var JS = 'java' + SCRIPT + ':';
|
|
20318
|
+
var iframeDocument;
|
|
20319
|
+
iframe.style.display = 'none';
|
|
20320
|
+
html.appendChild(iframe);
|
|
20321
|
+
// https://github.com/zloirock/core-js/issues/475
|
|
20322
|
+
iframe.src = String(JS);
|
|
20323
|
+
iframeDocument = iframe.contentWindow.document;
|
|
20324
|
+
iframeDocument.open();
|
|
20325
|
+
iframeDocument.write(scriptTag('document.F=Object'));
|
|
20326
|
+
iframeDocument.close();
|
|
20327
|
+
return iframeDocument.F;
|
|
20328
|
+
};
|
|
20329
|
+
|
|
20330
|
+
// Check for document.domain and active x support
|
|
20331
|
+
// No need to use active x approach when document.domain is not set
|
|
20332
|
+
// see https://github.com/es-shims/es5-shim/issues/150
|
|
20333
|
+
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
|
|
20334
|
+
// avoid IE GC bug
|
|
20335
|
+
var activeXDocument;
|
|
20336
|
+
var NullProtoObject = function () {
|
|
20337
|
+
try {
|
|
20338
|
+
activeXDocument = new ActiveXObject('htmlfile');
|
|
20339
|
+
} catch (error) { /* ignore */ }
|
|
20340
|
+
NullProtoObject = typeof document != 'undefined'
|
|
20341
|
+
? document.domain && activeXDocument
|
|
20342
|
+
? NullProtoObjectViaActiveX(activeXDocument) // old IE
|
|
20343
|
+
: NullProtoObjectViaIFrame()
|
|
20344
|
+
: NullProtoObjectViaActiveX(activeXDocument); // WSH
|
|
20345
|
+
var length = enumBugKeys.length;
|
|
20346
|
+
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
|
20347
|
+
return NullProtoObject();
|
|
20348
|
+
};
|
|
20349
|
+
|
|
20350
|
+
hiddenKeys[IE_PROTO] = true;
|
|
20351
|
+
|
|
20352
|
+
// `Object.create` method
|
|
20353
|
+
// https://tc39.es/ecma262/#sec-object.create
|
|
20354
|
+
// eslint-disable-next-line es-x/no-object-create -- safe
|
|
20355
|
+
var objectCreate = Object.create || function create(O, Properties) {
|
|
20356
|
+
var result;
|
|
20357
|
+
if (O !== null) {
|
|
20358
|
+
EmptyConstructor[PROTOTYPE] = anObject(O);
|
|
20359
|
+
result = new EmptyConstructor();
|
|
20360
|
+
EmptyConstructor[PROTOTYPE] = null;
|
|
20361
|
+
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
20362
|
+
result[IE_PROTO] = O;
|
|
20363
|
+
} else result = NullProtoObject();
|
|
20364
|
+
return Properties === undefined ? result : objectDefineProperties.f(result, Properties);
|
|
20365
|
+
};
|
|
20366
|
+
|
|
20367
|
+
var UNSCOPABLES = wellKnownSymbol('unscopables');
|
|
20368
|
+
var ArrayPrototype = Array.prototype;
|
|
20369
|
+
|
|
20370
|
+
// Array.prototype[@@unscopables]
|
|
20371
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
20372
|
+
if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
|
20373
|
+
objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
|
|
20374
|
+
configurable: true,
|
|
20375
|
+
value: objectCreate(null)
|
|
20376
|
+
});
|
|
20377
|
+
}
|
|
20378
|
+
|
|
20379
|
+
// add a key to Array.prototype[@@unscopables]
|
|
20380
|
+
var addToUnscopables = function (key) {
|
|
20381
|
+
ArrayPrototype[UNSCOPABLES][key] = true;
|
|
20382
|
+
};
|
|
20383
|
+
|
|
20384
|
+
// `Array.prototype.at` method
|
|
20385
|
+
// https://github.com/tc39/proposal-relative-indexing-method
|
|
20386
|
+
_export({ target: 'Array', proto: true }, {
|
|
20387
|
+
at: function at(index) {
|
|
20388
|
+
var O = toObject(this);
|
|
20389
|
+
var len = lengthOfArrayLike(O);
|
|
20390
|
+
var relativeIndex = toIntegerOrInfinity(index);
|
|
20391
|
+
var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
|
|
20392
|
+
return (k < 0 || k >= len) ? undefined : O[k];
|
|
20393
|
+
}
|
|
20394
|
+
});
|
|
20395
|
+
|
|
20396
|
+
addToUnscopables('at');
|
|
20397
|
+
|
|
20398
|
+
// eslint-disable-next-line es-x/no-typed-arrays -- safe
|
|
20399
|
+
var arrayBufferNative = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';
|
|
20400
|
+
|
|
20401
|
+
var correctPrototypeGetter = !fails(function () {
|
|
20402
|
+
function F() { /* empty */ }
|
|
20403
|
+
F.prototype.constructor = null;
|
|
20404
|
+
// eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
|
|
20405
|
+
return Object.getPrototypeOf(new F()) !== F.prototype;
|
|
20406
|
+
});
|
|
20407
|
+
|
|
20408
|
+
var IE_PROTO$1 = sharedKey('IE_PROTO');
|
|
20409
|
+
var Object$5 = global_1.Object;
|
|
20410
|
+
var ObjectPrototype = Object$5.prototype;
|
|
20411
|
+
|
|
20412
|
+
// `Object.getPrototypeOf` method
|
|
20413
|
+
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
20414
|
+
var objectGetPrototypeOf = correctPrototypeGetter ? Object$5.getPrototypeOf : function (O) {
|
|
20415
|
+
var object = toObject(O);
|
|
20416
|
+
if (hasOwnProperty_1(object, IE_PROTO$1)) return object[IE_PROTO$1];
|
|
20417
|
+
var constructor = object.constructor;
|
|
20418
|
+
if (isCallable(constructor) && object instanceof constructor) {
|
|
20419
|
+
return constructor.prototype;
|
|
20420
|
+
} return object instanceof Object$5 ? ObjectPrototype : null;
|
|
20421
|
+
};
|
|
20422
|
+
|
|
20423
|
+
var String$4 = global_1.String;
|
|
20424
|
+
var TypeError$8 = global_1.TypeError;
|
|
20425
|
+
|
|
20426
|
+
var aPossiblePrototype = function (argument) {
|
|
20427
|
+
if (typeof argument == 'object' || isCallable(argument)) return argument;
|
|
20428
|
+
throw TypeError$8("Can't set " + String$4(argument) + ' as a prototype');
|
|
20429
|
+
};
|
|
20430
|
+
|
|
20431
|
+
/* eslint-disable no-proto -- safe */
|
|
20432
|
+
|
|
20433
|
+
|
|
20434
|
+
|
|
20435
|
+
|
|
20436
|
+
// `Object.setPrototypeOf` method
|
|
20437
|
+
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
20438
|
+
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
20439
|
+
// eslint-disable-next-line es-x/no-object-setprototypeof -- safe
|
|
20440
|
+
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
20441
|
+
var CORRECT_SETTER = false;
|
|
20442
|
+
var test = {};
|
|
20443
|
+
var setter;
|
|
20444
|
+
try {
|
|
20445
|
+
// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
|
|
20446
|
+
setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
20447
|
+
setter(test, []);
|
|
20448
|
+
CORRECT_SETTER = test instanceof Array;
|
|
20449
|
+
} catch (error) { /* empty */ }
|
|
20450
|
+
return function setPrototypeOf(O, proto) {
|
|
20451
|
+
anObject(O);
|
|
20452
|
+
aPossiblePrototype(proto);
|
|
20453
|
+
if (CORRECT_SETTER) setter(O, proto);
|
|
20454
|
+
else O.__proto__ = proto;
|
|
20455
|
+
return O;
|
|
20456
|
+
};
|
|
20457
|
+
}() : undefined);
|
|
20458
|
+
|
|
20459
|
+
var defineProperty$1 = objectDefineProperty.f;
|
|
20460
|
+
|
|
20461
|
+
|
|
20462
|
+
|
|
20463
|
+
|
|
20464
|
+
|
|
20465
|
+
|
|
20466
|
+
var Int8Array = global_1.Int8Array;
|
|
20467
|
+
var Int8ArrayPrototype = Int8Array && Int8Array.prototype;
|
|
20468
|
+
var Uint8ClampedArray = global_1.Uint8ClampedArray;
|
|
20469
|
+
var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype;
|
|
20470
|
+
var TypedArray = Int8Array && objectGetPrototypeOf(Int8Array);
|
|
20471
|
+
var TypedArrayPrototype = Int8ArrayPrototype && objectGetPrototypeOf(Int8ArrayPrototype);
|
|
20472
|
+
var ObjectPrototype$1 = Object.prototype;
|
|
20473
|
+
var TypeError$9 = global_1.TypeError;
|
|
20474
|
+
|
|
20475
|
+
var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
|
20476
|
+
var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
|
|
20477
|
+
var TYPED_ARRAY_CONSTRUCTOR = uid('TYPED_ARRAY_CONSTRUCTOR');
|
|
20478
|
+
// Fixing native typed arrays in Opera Presto crashes the browser, see #595
|
|
20479
|
+
var NATIVE_ARRAY_BUFFER_VIEWS = arrayBufferNative && !!objectSetPrototypeOf && classof(global_1.opera) !== 'Opera';
|
|
20480
|
+
var TYPED_ARRAY_TAG_REQUIRED = false;
|
|
20481
|
+
var NAME, Constructor, Prototype;
|
|
20482
|
+
|
|
20483
|
+
var TypedArrayConstructorsList = {
|
|
20484
|
+
Int8Array: 1,
|
|
20485
|
+
Uint8Array: 1,
|
|
20486
|
+
Uint8ClampedArray: 1,
|
|
20487
|
+
Int16Array: 2,
|
|
20488
|
+
Uint16Array: 2,
|
|
20489
|
+
Int32Array: 4,
|
|
20490
|
+
Uint32Array: 4,
|
|
20491
|
+
Float32Array: 4,
|
|
20492
|
+
Float64Array: 8
|
|
20493
|
+
};
|
|
20494
|
+
|
|
20495
|
+
var BigIntArrayConstructorsList = {
|
|
20496
|
+
BigInt64Array: 8,
|
|
20497
|
+
BigUint64Array: 8
|
|
20498
|
+
};
|
|
20499
|
+
|
|
20500
|
+
var isView = function isView(it) {
|
|
20501
|
+
if (!isObject(it)) return false;
|
|
20502
|
+
var klass = classof(it);
|
|
20503
|
+
return klass === 'DataView'
|
|
20504
|
+
|| hasOwnProperty_1(TypedArrayConstructorsList, klass)
|
|
20505
|
+
|| hasOwnProperty_1(BigIntArrayConstructorsList, klass);
|
|
20506
|
+
};
|
|
20507
|
+
|
|
20508
|
+
var isTypedArray = function (it) {
|
|
20509
|
+
if (!isObject(it)) return false;
|
|
20510
|
+
var klass = classof(it);
|
|
20511
|
+
return hasOwnProperty_1(TypedArrayConstructorsList, klass)
|
|
20512
|
+
|| hasOwnProperty_1(BigIntArrayConstructorsList, klass);
|
|
20513
|
+
};
|
|
20514
|
+
|
|
20515
|
+
var aTypedArray = function (it) {
|
|
20516
|
+
if (isTypedArray(it)) return it;
|
|
20517
|
+
throw TypeError$9('Target is not a typed array');
|
|
20518
|
+
};
|
|
20519
|
+
|
|
20520
|
+
var aTypedArrayConstructor = function (C) {
|
|
20521
|
+
if (isCallable(C) && (!objectSetPrototypeOf || objectIsPrototypeOf(TypedArray, C))) return C;
|
|
20522
|
+
throw TypeError$9(tryToString(C) + ' is not a typed array constructor');
|
|
20523
|
+
};
|
|
20524
|
+
|
|
20525
|
+
var exportTypedArrayMethod = function (KEY, property, forced, options) {
|
|
20526
|
+
if (!descriptors) return;
|
|
20527
|
+
if (forced) for (var ARRAY in TypedArrayConstructorsList) {
|
|
20528
|
+
var TypedArrayConstructor = global_1[ARRAY];
|
|
20529
|
+
if (TypedArrayConstructor && hasOwnProperty_1(TypedArrayConstructor.prototype, KEY)) try {
|
|
20530
|
+
delete TypedArrayConstructor.prototype[KEY];
|
|
20531
|
+
} catch (error) {
|
|
20532
|
+
// old WebKit bug - some methods are non-configurable
|
|
20533
|
+
try {
|
|
20534
|
+
TypedArrayConstructor.prototype[KEY] = property;
|
|
20535
|
+
} catch (error2) { /* empty */ }
|
|
20536
|
+
}
|
|
20537
|
+
}
|
|
20538
|
+
if (!TypedArrayPrototype[KEY] || forced) {
|
|
20539
|
+
defineBuiltIn(TypedArrayPrototype, KEY, forced ? property
|
|
20540
|
+
: NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property, options);
|
|
20541
|
+
}
|
|
20542
|
+
};
|
|
20543
|
+
|
|
20544
|
+
var exportTypedArrayStaticMethod = function (KEY, property, forced) {
|
|
20545
|
+
var ARRAY, TypedArrayConstructor;
|
|
20546
|
+
if (!descriptors) return;
|
|
20547
|
+
if (objectSetPrototypeOf) {
|
|
20548
|
+
if (forced) for (ARRAY in TypedArrayConstructorsList) {
|
|
20549
|
+
TypedArrayConstructor = global_1[ARRAY];
|
|
20550
|
+
if (TypedArrayConstructor && hasOwnProperty_1(TypedArrayConstructor, KEY)) try {
|
|
20551
|
+
delete TypedArrayConstructor[KEY];
|
|
20552
|
+
} catch (error) { /* empty */ }
|
|
20553
|
+
}
|
|
20554
|
+
if (!TypedArray[KEY] || forced) {
|
|
20555
|
+
// V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable
|
|
20556
|
+
try {
|
|
20557
|
+
return defineBuiltIn(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property);
|
|
20558
|
+
} catch (error) { /* empty */ }
|
|
20559
|
+
} else return;
|
|
20560
|
+
}
|
|
20561
|
+
for (ARRAY in TypedArrayConstructorsList) {
|
|
20562
|
+
TypedArrayConstructor = global_1[ARRAY];
|
|
20563
|
+
if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {
|
|
20564
|
+
defineBuiltIn(TypedArrayConstructor, KEY, property);
|
|
20565
|
+
}
|
|
20566
|
+
}
|
|
20567
|
+
};
|
|
20568
|
+
|
|
20569
|
+
for (NAME in TypedArrayConstructorsList) {
|
|
20570
|
+
Constructor = global_1[NAME];
|
|
20571
|
+
Prototype = Constructor && Constructor.prototype;
|
|
20572
|
+
if (Prototype) createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor);
|
|
20573
|
+
else NATIVE_ARRAY_BUFFER_VIEWS = false;
|
|
20574
|
+
}
|
|
20575
|
+
|
|
20576
|
+
for (NAME in BigIntArrayConstructorsList) {
|
|
20577
|
+
Constructor = global_1[NAME];
|
|
20578
|
+
Prototype = Constructor && Constructor.prototype;
|
|
20579
|
+
if (Prototype) createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor);
|
|
20580
|
+
}
|
|
20581
|
+
|
|
20582
|
+
// WebKit bug - typed arrays constructors prototype is Object.prototype
|
|
20583
|
+
if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) {
|
|
20584
|
+
// eslint-disable-next-line no-shadow -- safe
|
|
20585
|
+
TypedArray = function TypedArray() {
|
|
20586
|
+
throw TypeError$9('Incorrect invocation');
|
|
20587
|
+
};
|
|
20588
|
+
if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
|
|
20589
|
+
if (global_1[NAME]) objectSetPrototypeOf(global_1[NAME], TypedArray);
|
|
20590
|
+
}
|
|
20591
|
+
}
|
|
20592
|
+
|
|
20593
|
+
if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype$1) {
|
|
20594
|
+
TypedArrayPrototype = TypedArray.prototype;
|
|
20595
|
+
if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
|
|
20596
|
+
if (global_1[NAME]) objectSetPrototypeOf(global_1[NAME].prototype, TypedArrayPrototype);
|
|
20597
|
+
}
|
|
20598
|
+
}
|
|
20599
|
+
|
|
20600
|
+
// WebKit bug - one more object in Uint8ClampedArray prototype chain
|
|
20601
|
+
if (NATIVE_ARRAY_BUFFER_VIEWS && objectGetPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {
|
|
20602
|
+
objectSetPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);
|
|
20603
|
+
}
|
|
20604
|
+
|
|
20605
|
+
if (descriptors && !hasOwnProperty_1(TypedArrayPrototype, TO_STRING_TAG$2)) {
|
|
20606
|
+
TYPED_ARRAY_TAG_REQUIRED = true;
|
|
20607
|
+
defineProperty$1(TypedArrayPrototype, TO_STRING_TAG$2, { get: function () {
|
|
20608
|
+
return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;
|
|
20609
|
+
} });
|
|
20610
|
+
for (NAME in TypedArrayConstructorsList) if (global_1[NAME]) {
|
|
20611
|
+
createNonEnumerableProperty(global_1[NAME], TYPED_ARRAY_TAG, NAME);
|
|
20612
|
+
}
|
|
20613
|
+
}
|
|
20614
|
+
|
|
20615
|
+
var arrayBufferViewCore = {
|
|
20616
|
+
NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,
|
|
20617
|
+
TYPED_ARRAY_CONSTRUCTOR: TYPED_ARRAY_CONSTRUCTOR,
|
|
20618
|
+
TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG,
|
|
20619
|
+
aTypedArray: aTypedArray,
|
|
20620
|
+
aTypedArrayConstructor: aTypedArrayConstructor,
|
|
20621
|
+
exportTypedArrayMethod: exportTypedArrayMethod,
|
|
20622
|
+
exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,
|
|
20623
|
+
isView: isView,
|
|
20624
|
+
isTypedArray: isTypedArray,
|
|
20625
|
+
TypedArray: TypedArray,
|
|
20626
|
+
TypedArrayPrototype: TypedArrayPrototype
|
|
20627
|
+
};
|
|
20628
|
+
|
|
20629
|
+
var aTypedArray$1 = arrayBufferViewCore.aTypedArray;
|
|
20630
|
+
var exportTypedArrayMethod$1 = arrayBufferViewCore.exportTypedArrayMethod;
|
|
20631
|
+
|
|
20632
|
+
// `%TypedArray%.prototype.at` method
|
|
20633
|
+
// https://github.com/tc39/proposal-relative-indexing-method
|
|
20634
|
+
exportTypedArrayMethod$1('at', function at(index) {
|
|
20635
|
+
var O = aTypedArray$1(this);
|
|
20636
|
+
var len = lengthOfArrayLike(O);
|
|
20637
|
+
var relativeIndex = toIntegerOrInfinity(index);
|
|
20638
|
+
var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
|
|
20639
|
+
return (k < 0 || k >= len) ? undefined : O[k];
|
|
20640
|
+
});
|
|
20641
|
+
|
|
19393
20642
|
var selectedColor = "".concat(MATISSE_BLUE);
|
|
19394
20643
|
var hoverColor$3 = "".concat(HOVER_LIGHT_BLUE);
|
|
19395
20644
|
var fallbackValues$e = {
|
|
@@ -19400,24 +20649,24 @@ var fallbackValues$e = {
|
|
|
19400
20649
|
var IconWrapper = styled.div.withConfig({
|
|
19401
20650
|
displayName: "Dropdown__IconWrapper",
|
|
19402
20651
|
componentId: "sc-pn6m0h-0"
|
|
19403
|
-
})(["display:flex;flex-direction:column;justify-content:center;transition:transform 0.3s ease;", ""], function (_ref) {
|
|
20652
|
+
})(["position:absolute;display:flex;flex-direction:column;justify-content:center;transition:transform 0.3s ease;", ";top:20px;right:12px;"], function (_ref) {
|
|
19404
20653
|
var open = _ref.open;
|
|
19405
20654
|
return open ? "transform: rotate(-180deg)" : "";
|
|
19406
20655
|
});
|
|
19407
20656
|
var DropdownContentWrapper = styled.div.withConfig({
|
|
19408
20657
|
displayName: "Dropdown__DropdownContentWrapper",
|
|
19409
20658
|
componentId: "sc-pn6m0h-1"
|
|
19410
|
-
})(["transform-origin:0 0;border:1px solid ", ";border-radius:2px;background-color:", ";padding:8px 0 8px;position:absolute;width:", ";min-width:100%;max-height:", ";overflow-y:scroll;z-index:1;box-sizing:border-box;&:focus{outline:none;}"], GREY_CHATEAU, WHITE, function (_ref2) {
|
|
20659
|
+
})(["transform-origin:0 0;border:1px solid ", ";border-radius:2px;background-color:", ";padding:8px 0 8px;position:absolute;width:", ";min-width:100%;max-height:", ";overflow-y:scroll;z-index:1;box-sizing:border-box;&:focus{outline:none;}ul{padding-left:0;}"], GREY_CHATEAU, WHITE, function (_ref2) {
|
|
19411
20660
|
var widthFitOptions = _ref2.widthFitOptions;
|
|
19412
20661
|
return widthFitOptions ? "fit-content" : "100%";
|
|
19413
20662
|
}, function (_ref3) {
|
|
19414
20663
|
var maxHeight = _ref3.maxHeight;
|
|
19415
20664
|
return maxHeight || "400px";
|
|
19416
20665
|
});
|
|
19417
|
-
var DropdownItemWrapper = styled.
|
|
20666
|
+
var DropdownItemWrapper = styled.li.withConfig({
|
|
19418
20667
|
displayName: "Dropdown__DropdownItemWrapper",
|
|
19419
20668
|
componentId: "sc-pn6m0h-2"
|
|
19420
|
-
})(["background-color:", ";text-align:start;border-width:0px;border-color:transparent;box-shadow:none;padding:1rem;box-sizing:border-box;width:100%;cursor:", ";&:hover{background-color:", ";}&:focus{background-color:", ";outline:none;}"], function (_ref4) {
|
|
20669
|
+
})(["background-color:", ";text-align:start;border-width:0px;border-color:transparent;box-shadow:none;padding:1rem;box-sizing:border-box;width:100%;list-style:none;cursor:", ";&:hover{background-color:", ";}&:focus{background-color:", ";outline:none;}"], function (_ref4) {
|
|
19421
20670
|
var selected = _ref4.selected,
|
|
19422
20671
|
themeValues = _ref4.themeValues;
|
|
19423
20672
|
return selected ? themeValues.selectedColor : WHITE;
|
|
@@ -19435,34 +20684,30 @@ var DropdownItemWrapper = styled.div.withConfig({
|
|
|
19435
20684
|
themeValues = _ref7.themeValues;
|
|
19436
20685
|
return selected ? themeValues.selectedColor : disabled ? WHITE : themeValues.hoverColor;
|
|
19437
20686
|
});
|
|
19438
|
-
var SearchInput = styled.input.withConfig({
|
|
19439
|
-
displayName: "Dropdown__SearchInput",
|
|
19440
|
-
componentId: "sc-pn6m0h-3"
|
|
19441
|
-
})(["border:none;background-color:", ";font-size:16px;height:24px;"], function (_ref8) {
|
|
19442
|
-
var themeValues = _ref8.themeValues;
|
|
19443
|
-
return themeValues.hoverColor && themeValues.hoverColor;
|
|
19444
|
-
});
|
|
19445
20687
|
|
|
19446
|
-
var Dropdown = function Dropdown(
|
|
19447
|
-
var placeholder =
|
|
19448
|
-
options =
|
|
19449
|
-
value =
|
|
19450
|
-
isOpen =
|
|
19451
|
-
isError =
|
|
19452
|
-
onSelect =
|
|
19453
|
-
|
|
19454
|
-
disabledValues =
|
|
19455
|
-
|
|
19456
|
-
|
|
19457
|
-
themeValues =
|
|
19458
|
-
maxHeight =
|
|
19459
|
-
|
|
19460
|
-
widthFitOptions =
|
|
19461
|
-
disabled =
|
|
19462
|
-
|
|
19463
|
-
hasTitles =
|
|
19464
|
-
|
|
19465
|
-
autoEraseTypeAhead =
|
|
20688
|
+
var Dropdown = function Dropdown(_ref8) {
|
|
20689
|
+
var placeholder = _ref8.placeholder,
|
|
20690
|
+
options = _ref8.options,
|
|
20691
|
+
value = _ref8.value,
|
|
20692
|
+
isOpen = _ref8.isOpen,
|
|
20693
|
+
isError = _ref8.isError,
|
|
20694
|
+
onSelect = _ref8.onSelect,
|
|
20695
|
+
_ref8$disabledValues = _ref8.disabledValues,
|
|
20696
|
+
disabledValues = _ref8$disabledValues === void 0 ? [] : _ref8$disabledValues,
|
|
20697
|
+
_ref8$onClick = _ref8.onClick,
|
|
20698
|
+
_onClick = _ref8$onClick === void 0 ? noop : _ref8$onClick,
|
|
20699
|
+
themeValues = _ref8.themeValues,
|
|
20700
|
+
maxHeight = _ref8.maxHeight,
|
|
20701
|
+
_ref8$widthFitOptions = _ref8.widthFitOptions,
|
|
20702
|
+
widthFitOptions = _ref8$widthFitOptions === void 0 ? false : _ref8$widthFitOptions,
|
|
20703
|
+
disabled = _ref8.disabled,
|
|
20704
|
+
_ref8$hasTitles = _ref8.hasTitles,
|
|
20705
|
+
hasTitles = _ref8$hasTitles === void 0 ? false : _ref8$hasTitles,
|
|
20706
|
+
_ref8$autoEraseTypeAh = _ref8.autoEraseTypeAhead,
|
|
20707
|
+
autoEraseTypeAhead = _ref8$autoEraseTypeAh === void 0 ? true : _ref8$autoEraseTypeAh,
|
|
20708
|
+
ariaLabelledby = _ref8.ariaLabelledby,
|
|
20709
|
+
_ref8$autocompleteVal = _ref8.autocompleteValue,
|
|
20710
|
+
autocompleteValue = _ref8$autocompleteVal === void 0 ? "" : _ref8$autocompleteVal;
|
|
19466
20711
|
|
|
19467
20712
|
var _useState = useState(""),
|
|
19468
20713
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -19489,6 +20734,21 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19489
20734
|
selectedRef = _useState10[0],
|
|
19490
20735
|
setSelectedRef = _useState10[1];
|
|
19491
20736
|
|
|
20737
|
+
var _useState11 = useState(undefined),
|
|
20738
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
20739
|
+
focusedRef = _useState12[0],
|
|
20740
|
+
setFocusedRef = _useState12[1];
|
|
20741
|
+
|
|
20742
|
+
var _useState13 = useState(false),
|
|
20743
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
20744
|
+
inputChangedByAutofill = _useState14[0],
|
|
20745
|
+
setInputChangedByAutofill = _useState14[1];
|
|
20746
|
+
|
|
20747
|
+
var _useState15 = useState(false),
|
|
20748
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
20749
|
+
focusedByClick = _useState16[0],
|
|
20750
|
+
setFocusedByClick = _useState16[1];
|
|
20751
|
+
|
|
19492
20752
|
if (optionsState !== options) {
|
|
19493
20753
|
setOptionsState(options);
|
|
19494
20754
|
setOptionsChanged(true);
|
|
@@ -19499,15 +20759,16 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19499
20759
|
setOptionsChanged(false);
|
|
19500
20760
|
}
|
|
19501
20761
|
|
|
19502
|
-
var
|
|
19503
|
-
|
|
19504
|
-
timer =
|
|
19505
|
-
setTimer =
|
|
20762
|
+
var _useState17 = useState(null),
|
|
20763
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
20764
|
+
timer = _useState18[0],
|
|
20765
|
+
setTimer = _useState18[1];
|
|
19506
20766
|
|
|
19507
20767
|
var optionRefs = useRef(_toConsumableArray(Array(options.length)).map(function () {
|
|
19508
20768
|
return /*#__PURE__*/createRef();
|
|
19509
20769
|
}));
|
|
19510
20770
|
var dropdownRef = useRef(null);
|
|
20771
|
+
var inputRef = useRef(null);
|
|
19511
20772
|
|
|
19512
20773
|
var getSelection = function getSelection() {
|
|
19513
20774
|
var _options$find;
|
|
@@ -19518,21 +20779,23 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19518
20779
|
};
|
|
19519
20780
|
|
|
19520
20781
|
var onKeyDown = function onKeyDown(e) {
|
|
20782
|
+
console.log("current input value top of keyDown", inputValue);
|
|
19521
20783
|
var key = e.key,
|
|
19522
20784
|
keyCode = e.keyCode;
|
|
19523
20785
|
var focus = document.activeElement;
|
|
19524
20786
|
console.log("dropdown value is", value);
|
|
19525
|
-
console.log("focus is", focus);
|
|
19526
|
-
console.log("option refs are", optionRefs.current);
|
|
19527
20787
|
var optionEl = optionRefs.current.find(function (ref) {
|
|
19528
20788
|
return ref.current === focus;
|
|
19529
20789
|
});
|
|
19530
|
-
console.log("option el is", optionEl);
|
|
19531
20790
|
|
|
19532
20791
|
switch (key) {
|
|
19533
20792
|
case "ArrowDown":
|
|
19534
20793
|
e.preventDefault();
|
|
19535
20794
|
|
|
20795
|
+
if (!isOpen) {
|
|
20796
|
+
_onClick();
|
|
20797
|
+
}
|
|
20798
|
+
|
|
19536
20799
|
if (optionEl) {
|
|
19537
20800
|
if (optionEl.current.nextElementSibling) {
|
|
19538
20801
|
optionEl.current.nextElementSibling.focus();
|
|
@@ -19541,7 +20804,7 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19541
20804
|
break;
|
|
19542
20805
|
}
|
|
19543
20806
|
} else {
|
|
19544
|
-
|
|
20807
|
+
_onClick();
|
|
19545
20808
|
}
|
|
19546
20809
|
|
|
19547
20810
|
break;
|
|
@@ -19557,7 +20820,7 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19557
20820
|
break;
|
|
19558
20821
|
}
|
|
19559
20822
|
} else {
|
|
19560
|
-
|
|
20823
|
+
_onClick();
|
|
19561
20824
|
}
|
|
19562
20825
|
|
|
19563
20826
|
break;
|
|
@@ -19571,27 +20834,68 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19571
20834
|
|
|
19572
20835
|
case "Backspace" :
|
|
19573
20836
|
e.preventDefault();
|
|
19574
|
-
console.log("input value is", inputValue);
|
|
19575
|
-
console.log("new input value will be", inputValue.slice(0, -1));
|
|
19576
20837
|
setInputValue(inputValue.slice(0, -1));
|
|
19577
20838
|
break;
|
|
20839
|
+
|
|
20840
|
+
case "Home":
|
|
20841
|
+
e.preventDefault();
|
|
20842
|
+
optionRefs.current[0].current.focus();
|
|
20843
|
+
break;
|
|
20844
|
+
|
|
20845
|
+
case "End":
|
|
20846
|
+
e.preventDefault();
|
|
20847
|
+
console.log("option refs current", optionRefs.current);
|
|
20848
|
+
optionRefs.current.at(-1).current.focus();
|
|
20849
|
+
break;
|
|
20850
|
+
|
|
20851
|
+
case "Escape":
|
|
20852
|
+
if (isOpen) {
|
|
20853
|
+
_onClick();
|
|
20854
|
+
}
|
|
20855
|
+
|
|
20856
|
+
break;
|
|
19578
20857
|
}
|
|
19579
20858
|
|
|
19580
20859
|
if (keyCode > 64 && keyCode < 91 || keyCode == 32 || keyCode == 189) {
|
|
19581
20860
|
e.preventDefault();
|
|
20861
|
+
console.log("current input value inside keydown if", inputValue);
|
|
19582
20862
|
setInputValue(inputValue + key);
|
|
19583
20863
|
}
|
|
19584
20864
|
};
|
|
19585
20865
|
|
|
20866
|
+
var handleItemSelection = function handleItemSelection(evt, choice, i) {
|
|
20867
|
+
if (disabledValues.includes(choice.value)) {
|
|
20868
|
+
evt.preventDefault();
|
|
20869
|
+
} else {
|
|
20870
|
+
setSelectedRef(optionRefs.current[i]);
|
|
20871
|
+
onSelect(choice.value);
|
|
20872
|
+
|
|
20873
|
+
if (isOpen) {
|
|
20874
|
+
_onClick();
|
|
20875
|
+
}
|
|
20876
|
+
}
|
|
20877
|
+
};
|
|
20878
|
+
|
|
19586
20879
|
useEffect$1(function () {
|
|
19587
|
-
|
|
19588
|
-
console.log("selected refs in isopen useffect", selectedRef);
|
|
19589
|
-
console.log("value in isopen useffect", value);
|
|
20880
|
+
var selectedRefExists = selectedRef !== undefined && selectedRef.current !== null;
|
|
19590
20881
|
|
|
19591
|
-
if (isOpen &&
|
|
20882
|
+
if (isOpen && selectedRefExists && !focusedByClick) {
|
|
20883
|
+
// WAI-ARIA requires the selected option to receive focus
|
|
20884
|
+
selectedRef.current.focus();
|
|
20885
|
+
} else if (isOpen && optionRefs.current[0].current && !focusedByClick) {
|
|
20886
|
+
// If no selected option, first option receives focus
|
|
19592
20887
|
optionRefs.current[0].current.focus();
|
|
19593
20888
|
}
|
|
19594
20889
|
|
|
20890
|
+
if (isOpen && focusedByClick && selectedRefExists) {
|
|
20891
|
+
selectedRef.current.scrollIntoView({
|
|
20892
|
+
behavior: "smooth",
|
|
20893
|
+
block: "nearest",
|
|
20894
|
+
inline: "start"
|
|
20895
|
+
});
|
|
20896
|
+
setFocusedByClick(false);
|
|
20897
|
+
}
|
|
20898
|
+
|
|
19595
20899
|
clearTimeout(timer);
|
|
19596
20900
|
setInputValue("");
|
|
19597
20901
|
}, [isOpen]);
|
|
@@ -19600,7 +20904,7 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19600
20904
|
clearTimeout(timer);
|
|
19601
20905
|
setTimer(setTimeout(function () {
|
|
19602
20906
|
return setInputValue("");
|
|
19603
|
-
},
|
|
20907
|
+
}, 3000));
|
|
19604
20908
|
}
|
|
19605
20909
|
|
|
19606
20910
|
setFilteredOptions(options.filter(function (option) {
|
|
@@ -19608,8 +20912,21 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19608
20912
|
}));
|
|
19609
20913
|
}, [inputValue]);
|
|
19610
20914
|
useEffect$1(function () {
|
|
19611
|
-
if (
|
|
20915
|
+
if (
|
|
20916
|
+
/*
|
|
20917
|
+
Either user has typed a value into input that matches a non-disabled option
|
|
20918
|
+
or
|
|
20919
|
+
user has autofilled or pasted into input a string matching a valid option
|
|
20920
|
+
*/
|
|
20921
|
+
(!isOpen || inputChangedByAutofill) && filteredOptions[0] && !disabledValues.includes(filteredOptions[0].value) && filteredOptions[0].text != placeholder) {
|
|
20922
|
+
setInputChangedByAutofill(false);
|
|
19612
20923
|
onSelect(filteredOptions[0].value);
|
|
20924
|
+
|
|
20925
|
+
if (isOpen) {
|
|
20926
|
+
setTimeout(function () {
|
|
20927
|
+
return _onClick();
|
|
20928
|
+
}, 2000);
|
|
20929
|
+
}
|
|
19613
20930
|
}
|
|
19614
20931
|
|
|
19615
20932
|
if (optionRefs.current[0].current) {
|
|
@@ -19619,73 +20936,109 @@ var Dropdown = function Dropdown(_ref9) {
|
|
|
19619
20936
|
}
|
|
19620
20937
|
}, [filteredOptions]);
|
|
19621
20938
|
return /*#__PURE__*/React.createElement(Box, {
|
|
19622
|
-
onKeyDown: onKeyDown,
|
|
19623
|
-
onClick: onClick,
|
|
19624
20939
|
padding: "0",
|
|
19625
|
-
|
|
19626
|
-
|
|
19627
|
-
"
|
|
19628
|
-
|
|
19629
|
-
|
|
20940
|
+
background: isOpen ? themeValues.hoverColor : WHITE,
|
|
20941
|
+
extraStyles: "position: relative;",
|
|
20942
|
+
minWidth: "100%",
|
|
20943
|
+
onClick: function onClick() {
|
|
20944
|
+
if (!isOpen) {
|
|
20945
|
+
setFocusedByClick(true);
|
|
20946
|
+
|
|
20947
|
+
_onClick();
|
|
20948
|
+
}
|
|
20949
|
+
},
|
|
20950
|
+
onKeyDown: onKeyDown,
|
|
20951
|
+
width: "100%"
|
|
19630
20952
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
19631
|
-
as: "
|
|
20953
|
+
as: "input",
|
|
20954
|
+
"aria-multiline": "false",
|
|
20955
|
+
"aria-autocomplete": "list",
|
|
20956
|
+
"aria-controls": "".concat(ariaLabelledby, "_listbox"),
|
|
20957
|
+
"aria-activedescendant": "focused_option",
|
|
20958
|
+
"aria-owns": "".concat(ariaLabelledby, "_listbox"),
|
|
20959
|
+
"aria-haspopup": "listbox",
|
|
20960
|
+
"aria-labelledby": ariaLabelledby,
|
|
20961
|
+
"aria-expanded": isOpen,
|
|
20962
|
+
autocomplete: autocompleteValue,
|
|
19632
20963
|
background: isOpen ? themeValues.hoverColor : WHITE,
|
|
19633
|
-
|
|
19634
|
-
padding: "12px",
|
|
19635
|
-
hoverStyles: "background-color: ".concat(themeValues.hoverColor, ";"),
|
|
20964
|
+
borderRadius: "2px",
|
|
19636
20965
|
borderSize: "1px",
|
|
19637
20966
|
borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : GREY_CHATEAU,
|
|
19638
|
-
|
|
20967
|
+
extraStyles: disabled && "color: #6e727e;\n background-color: #f7f7f7;\n pointer-events: none;",
|
|
20968
|
+
hoverStyles: "background-color: ".concat(themeValues.hoverColor, ";"),
|
|
20969
|
+
isOpen: isOpen,
|
|
20970
|
+
minHeight: "48px",
|
|
20971
|
+
minWidth: "100%",
|
|
20972
|
+
name: autocompleteValue,
|
|
20973
|
+
onChange: function onChange(e) {
|
|
20974
|
+
console.log("current input value onChange", inputValue);
|
|
20975
|
+
console.log("input change event", e.target);
|
|
20976
|
+
console.log("input change event value", e.target.value); // support autofill and copy/paste
|
|
20977
|
+
|
|
20978
|
+
if (e.target.value !== inputValue) {
|
|
20979
|
+
setInputValue(e.target.value);
|
|
20980
|
+
setInputChangedByAutofill(true);
|
|
20981
|
+
}
|
|
20982
|
+
},
|
|
20983
|
+
padding: "12px",
|
|
20984
|
+
placeholder: getSelection(),
|
|
20985
|
+
ref: inputRef,
|
|
20986
|
+
role: "combobox",
|
|
20987
|
+
themeValues: themeValues,
|
|
20988
|
+
title: hasTitles ? getSelection() : null,
|
|
20989
|
+
type: "text",
|
|
19639
20990
|
tabIndex: 0,
|
|
19640
|
-
dataQa: placeholder,
|
|
19641
|
-
extraStyles: "height: 48px;\n ".concat(disabled && "color: #6e727e;\n background-color: #f7f7f7;\n pointer-events: none;", "\n ")
|
|
19642
|
-
}, /*#__PURE__*/React.createElement(Stack, {
|
|
19643
|
-
direction: "row",
|
|
19644
|
-
bottomItem: 2
|
|
19645
|
-
}, isOpen ? /*#__PURE__*/React.createElement(SearchInput, {
|
|
19646
|
-
"aria-label": inputValue || "Dropdown awaiting search value",
|
|
19647
20991
|
value: inputValue,
|
|
19648
|
-
|
|
19649
|
-
|
|
19650
|
-
})
|
|
19651
|
-
|
|
19652
|
-
|
|
19653
|
-
},
|
|
19654
|
-
open: isOpen
|
|
19655
|
-
}, /*#__PURE__*/React.createElement(DropdownIcon, null)))), isOpen ? /*#__PURE__*/React.createElement(DropdownContentWrapper, {
|
|
20992
|
+
width: "100%",
|
|
20993
|
+
dataQa: placeholder
|
|
20994
|
+
}), /*#__PURE__*/React.createElement(IconWrapper, {
|
|
20995
|
+
open: isOpen,
|
|
20996
|
+
onClick: _onClick
|
|
20997
|
+
}, /*#__PURE__*/React.createElement(DropdownIcon, null)), /*#__PURE__*/React.createElement(Fragment, null, isOpen ? /*#__PURE__*/React.createElement(DropdownContentWrapper, {
|
|
19656
20998
|
maxHeight: maxHeight,
|
|
19657
20999
|
open: isOpen,
|
|
19658
21000
|
ref: dropdownRef,
|
|
19659
21001
|
widthFitOptions: widthFitOptions,
|
|
19660
|
-
tabIndex: 0
|
|
21002
|
+
tabIndex: 0,
|
|
21003
|
+
role: "listbox",
|
|
21004
|
+
id: "".concat(ariaLabelledby, "_listbox")
|
|
19661
21005
|
}, /*#__PURE__*/React.createElement(Stack, {
|
|
19662
|
-
childGap: "0"
|
|
21006
|
+
childGap: "0",
|
|
21007
|
+
as: "ul"
|
|
19663
21008
|
}, filteredOptions.map(function (choice, i) {
|
|
19664
|
-
if (
|
|
21009
|
+
if (choice.value === value && selectedRef !== optionRefs.current[i]) {
|
|
19665
21010
|
setSelectedRef(optionRefs.current[i]);
|
|
19666
21011
|
}
|
|
19667
21012
|
|
|
19668
21013
|
return /*#__PURE__*/React.createElement(DropdownItemWrapper, {
|
|
21014
|
+
id: focusedRef === optionRefs.current[i] ? "focused_option" : choice.value,
|
|
19669
21015
|
key: choice.value,
|
|
19670
21016
|
ref: optionRefs.current[i],
|
|
19671
|
-
as: "button",
|
|
19672
21017
|
tabIndex: -1,
|
|
19673
|
-
onClick:
|
|
19674
|
-
return
|
|
19675
|
-
}
|
|
19676
|
-
|
|
21018
|
+
onClick: function onClick(e) {
|
|
21019
|
+
return handleItemSelection(e, choice, i);
|
|
21020
|
+
},
|
|
21021
|
+
onKeyDown: function onKeyDown(e) {
|
|
21022
|
+
if (e.keyCode === 13) {
|
|
21023
|
+
handleItemSelection(e, choice, i);
|
|
21024
|
+
}
|
|
19677
21025
|
},
|
|
19678
21026
|
selected: choice.value === value,
|
|
21027
|
+
"aria-selected": choice.value === value,
|
|
19679
21028
|
disabled: disabledValues.includes(choice.value),
|
|
19680
21029
|
"data-qa": choice.text,
|
|
19681
21030
|
themeValues: themeValues,
|
|
19682
|
-
title: hasTitles ? choice.text : null
|
|
21031
|
+
title: hasTitles ? choice.text : null,
|
|
21032
|
+
role: "option",
|
|
21033
|
+
onFocus: function onFocus() {
|
|
21034
|
+
return setFocusedRef(optionRefs.current[i]);
|
|
21035
|
+
}
|
|
19683
21036
|
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
19684
21037
|
variant: "p",
|
|
19685
21038
|
color: choice.value === value ? WHITE : disabledValues.includes(choice.value) ? STORM_GREY : MINESHAFT_GREY,
|
|
19686
21039
|
extraStyles: "padding-left: 16px; \n cursor: ".concat(disabledValues.includes(choice.value) ? "default" : "pointer", "; \n white-space: nowrap; \n overflow: hidden; \n text-overflow: ellipsis;")
|
|
19687
21040
|
}, choice.text));
|
|
19688
|
-
}))) : /*#__PURE__*/React.createElement(Fragment, null));
|
|
21041
|
+
}))) : /*#__PURE__*/React.createElement(Fragment, null)));
|
|
19689
21042
|
};
|
|
19690
21043
|
|
|
19691
21044
|
var Dropdown$1 = themeComponent(Dropdown, "Dropdown", fallbackValues$e);
|
|
@@ -19786,7 +21139,8 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
19786
21139
|
disabled = _ref.disabled,
|
|
19787
21140
|
themeValues = _ref.themeValues,
|
|
19788
21141
|
_ref$hasTitles = _ref.hasTitles,
|
|
19789
|
-
hasTitles = _ref$hasTitles === void 0 ? false : _ref$hasTitles
|
|
21142
|
+
hasTitles = _ref$hasTitles === void 0 ? false : _ref$hasTitles,
|
|
21143
|
+
autocompleteValue = _ref.autocompleteValue;
|
|
19790
21144
|
|
|
19791
21145
|
var _useState = useState(false),
|
|
19792
21146
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -19824,7 +21178,7 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
19824
21178
|
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
|
|
19825
21179
|
id: labelTextWhenNoError.replace(/\s+/g, "-")
|
|
19826
21180
|
}, labelTextWhenNoError))), /*#__PURE__*/React.createElement(Dropdown$1, {
|
|
19827
|
-
|
|
21181
|
+
ariaLabelledby: labelTextWhenNoError.replace(/\s+/g, "-"),
|
|
19828
21182
|
maxHeight: dropdownMaxHeight,
|
|
19829
21183
|
hasTitles: hasTitles,
|
|
19830
21184
|
placeholder: options[0] ? options[0].text : "",
|
|
@@ -19841,7 +21195,8 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
19841
21195
|
onClick: function onClick() {
|
|
19842
21196
|
return setOpen(!open);
|
|
19843
21197
|
},
|
|
19844
|
-
disabled: disabled
|
|
21198
|
+
disabled: disabled,
|
|
21199
|
+
autocompleteValue: autocompleteValue
|
|
19845
21200
|
}), /*#__PURE__*/React.createElement(Stack, {
|
|
19846
21201
|
direction: "row",
|
|
19847
21202
|
justify: "space-between"
|
|
@@ -20614,7 +21969,8 @@ var CountryDropdown = function CountryDropdown(_ref) {
|
|
|
20614
21969
|
labelTextWhenNoError: labelTextWhenNoError,
|
|
20615
21970
|
errorMessages: errorMessages,
|
|
20616
21971
|
showErrors: showErrors,
|
|
20617
|
-
onChange: onChange
|
|
21972
|
+
onChange: onChange,
|
|
21973
|
+
autocompleteValue: "country-name"
|
|
20618
21974
|
});
|
|
20619
21975
|
};
|
|
20620
21976
|
|
|
@@ -33030,7 +34386,8 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
|
|
|
33030
34386
|
fieldActions: fieldActions,
|
|
33031
34387
|
labelTextWhenNoError: labelTextWhenNoError,
|
|
33032
34388
|
errorMessages: errorMessages,
|
|
33033
|
-
showErrors: showErrors
|
|
34389
|
+
showErrors: showErrors,
|
|
34390
|
+
autocompleteValue: "address-level1"
|
|
33034
34391
|
});
|
|
33035
34392
|
};
|
|
33036
34393
|
|
|
@@ -33761,20 +35118,20 @@ function isPlainObject(value) {
|
|
|
33761
35118
|
}
|
|
33762
35119
|
var assign = Object.assign || function assign(target, value) {
|
|
33763
35120
|
for (var key in value) {
|
|
33764
|
-
if (has(value, key)) {
|
|
35121
|
+
if (has$1(value, key)) {
|
|
33765
35122
|
target[key] = value[key];
|
|
33766
35123
|
}
|
|
33767
35124
|
}
|
|
33768
35125
|
|
|
33769
35126
|
return target;
|
|
33770
35127
|
};
|
|
33771
|
-
var ownKeys$
|
|
35128
|
+
var ownKeys$2 = typeof Reflect !== "undefined" && Reflect.ownKeys ? Reflect.ownKeys : typeof Object.getOwnPropertySymbols !== "undefined" ? function (obj) { return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj)); } : Object.getOwnPropertyNames;
|
|
33772
35129
|
function shallowCopy(base, invokeGetters) {
|
|
33773
35130
|
if ( invokeGetters === void 0 ) invokeGetters = false;
|
|
33774
35131
|
|
|
33775
35132
|
if (Array.isArray(base)) { return base.slice(); }
|
|
33776
35133
|
var clone = Object.create(Object.getPrototypeOf(base));
|
|
33777
|
-
ownKeys$
|
|
35134
|
+
ownKeys$2(base).forEach(function (key) {
|
|
33778
35135
|
if (key === DRAFT_STATE) {
|
|
33779
35136
|
return; // Never copy over draft state.
|
|
33780
35137
|
}
|
|
@@ -33806,14 +35163,14 @@ function each(value, cb) {
|
|
|
33806
35163
|
if (Array.isArray(value)) {
|
|
33807
35164
|
for (var i = 0; i < value.length; i++) { cb(i, value[i], value); }
|
|
33808
35165
|
} else {
|
|
33809
|
-
ownKeys$
|
|
35166
|
+
ownKeys$2(value).forEach(function (key) { return cb(key, value[key], value); });
|
|
33810
35167
|
}
|
|
33811
35168
|
}
|
|
33812
35169
|
function isEnumerable(base, prop) {
|
|
33813
35170
|
var desc = Object.getOwnPropertyDescriptor(base, prop);
|
|
33814
35171
|
return !!desc && desc.enumerable;
|
|
33815
35172
|
}
|
|
33816
|
-
function has(thing, prop) {
|
|
35173
|
+
function has$1(thing, prop) {
|
|
33817
35174
|
return Object.prototype.hasOwnProperty.call(thing, prop);
|
|
33818
35175
|
}
|
|
33819
35176
|
function is(x, y) {
|
|
@@ -33877,7 +35234,7 @@ function revoke(draft) {
|
|
|
33877
35234
|
|
|
33878
35235
|
// but share them all instead
|
|
33879
35236
|
|
|
33880
|
-
var descriptors = {};
|
|
35237
|
+
var descriptors$1 = {};
|
|
33881
35238
|
function willFinalize(scope, result, isReplaced) {
|
|
33882
35239
|
scope.drafts.forEach(function (draft) {
|
|
33883
35240
|
draft[DRAFT_STATE].finalizing = true;
|
|
@@ -33945,7 +35302,7 @@ function peek(draft, prop) {
|
|
|
33945
35302
|
return draft[prop];
|
|
33946
35303
|
}
|
|
33947
35304
|
|
|
33948
|
-
function get(state, prop) {
|
|
35305
|
+
function get$1(state, prop) {
|
|
33949
35306
|
assertUnrevoked(state);
|
|
33950
35307
|
var value = peek(source(state), prop);
|
|
33951
35308
|
if (state.finalizing) { return value; } // Create a draft if the value is unmodified.
|
|
@@ -33996,17 +35353,17 @@ function clonePotentialDraft(base) {
|
|
|
33996
35353
|
}
|
|
33997
35354
|
|
|
33998
35355
|
function proxyProperty(draft, prop, enumerable) {
|
|
33999
|
-
var desc = descriptors[prop];
|
|
35356
|
+
var desc = descriptors$1[prop];
|
|
34000
35357
|
|
|
34001
35358
|
if (desc) {
|
|
34002
35359
|
desc.enumerable = enumerable;
|
|
34003
35360
|
} else {
|
|
34004
|
-
descriptors[prop] = desc = {
|
|
35361
|
+
descriptors$1[prop] = desc = {
|
|
34005
35362
|
configurable: true,
|
|
34006
35363
|
enumerable: enumerable,
|
|
34007
35364
|
|
|
34008
|
-
get: function get$1() {
|
|
34009
|
-
return get(this[DRAFT_STATE], prop);
|
|
35365
|
+
get: function get$1$1() {
|
|
35366
|
+
return get$1(this[DRAFT_STATE], prop);
|
|
34010
35367
|
},
|
|
34011
35368
|
|
|
34012
35369
|
set: function set$1$1(value) {
|
|
@@ -34052,7 +35409,7 @@ function markChangesRecursively(object) {
|
|
|
34052
35409
|
// Look for added keys.
|
|
34053
35410
|
Object.keys(draft).forEach(function (key) {
|
|
34054
35411
|
// The `undefined` check is a fast path for pre-existing keys.
|
|
34055
|
-
if (base[key] === undefined && !has(base, key)) {
|
|
35412
|
+
if (base[key] === undefined && !has$1(base, key)) {
|
|
34056
35413
|
assigned[key] = true;
|
|
34057
35414
|
markChanged(state);
|
|
34058
35415
|
} else if (!assigned[key]) {
|
|
@@ -34063,7 +35420,7 @@ function markChangesRecursively(object) {
|
|
|
34063
35420
|
|
|
34064
35421
|
Object.keys(base).forEach(function (key) {
|
|
34065
35422
|
// The `undefined` check is a fast path for pre-existing keys.
|
|
34066
|
-
if (draft[key] === undefined && !has(draft, key)) {
|
|
35423
|
+
if (draft[key] === undefined && !has$1(draft, key)) {
|
|
34067
35424
|
assigned[key] = false;
|
|
34068
35425
|
markChanged(state);
|
|
34069
35426
|
}
|
|
@@ -34096,7 +35453,7 @@ function hasObjectChanges(state) {
|
|
|
34096
35453
|
var key = keys[i];
|
|
34097
35454
|
var baseValue = base[key]; // The `undefined` check is a fast path for pre-existing keys.
|
|
34098
35455
|
|
|
34099
|
-
if (baseValue === undefined && !has(base, key)) {
|
|
35456
|
+
if (baseValue === undefined && !has$1(base, key)) {
|
|
34100
35457
|
return true;
|
|
34101
35458
|
} // Once a base key is deleted, future changes go undetected, because its
|
|
34102
35459
|
// descriptor is erased. This branch detects any missed changes.
|
|
@@ -34181,7 +35538,7 @@ function createProxy$1(base, parent) {
|
|
|
34181
35538
|
return proxy;
|
|
34182
35539
|
}
|
|
34183
35540
|
var objectTraps = {
|
|
34184
|
-
get: get$1,
|
|
35541
|
+
get: get$1$1,
|
|
34185
35542
|
|
|
34186
35543
|
has: function has(target, prop) {
|
|
34187
35544
|
return prop in source$1(target);
|
|
@@ -34193,7 +35550,7 @@ var objectTraps = {
|
|
|
34193
35550
|
|
|
34194
35551
|
set: set$1$1,
|
|
34195
35552
|
deleteProperty: deleteProperty,
|
|
34196
|
-
getOwnPropertyDescriptor: getOwnPropertyDescriptor,
|
|
35553
|
+
getOwnPropertyDescriptor: getOwnPropertyDescriptor$2,
|
|
34197
35554
|
|
|
34198
35555
|
defineProperty: function defineProperty() {
|
|
34199
35556
|
throw new Error("Object.defineProperty() cannot be used on an Immer draft"); // prettier-ignore
|
|
@@ -34244,11 +35601,11 @@ function peek$1(draft, prop) {
|
|
|
34244
35601
|
return desc && desc.value;
|
|
34245
35602
|
}
|
|
34246
35603
|
|
|
34247
|
-
function get$1(state, prop) {
|
|
35604
|
+
function get$1$1(state, prop) {
|
|
34248
35605
|
if (prop === DRAFT_STATE) { return state; }
|
|
34249
35606
|
var drafts = state.drafts; // Check for existing draft in unmodified state.
|
|
34250
35607
|
|
|
34251
|
-
if (!state.modified && has(drafts, prop)) {
|
|
35608
|
+
if (!state.modified && has$1(drafts, prop)) {
|
|
34252
35609
|
return drafts[prop];
|
|
34253
35610
|
}
|
|
34254
35611
|
|
|
@@ -34301,7 +35658,7 @@ function deleteProperty(state, prop) {
|
|
|
34301
35658
|
// the same guarantee in ES5 mode.
|
|
34302
35659
|
|
|
34303
35660
|
|
|
34304
|
-
function getOwnPropertyDescriptor(state, prop) {
|
|
35661
|
+
function getOwnPropertyDescriptor$2(state, prop) {
|
|
34305
35662
|
var owner = source$1(state);
|
|
34306
35663
|
var desc = Reflect.getOwnPropertyDescriptor(owner, prop);
|
|
34307
35664
|
|
|
@@ -34720,7 +36077,7 @@ Immer.prototype.finalize = function finalize (draft, path, scope) {
|
|
|
34720
36077
|
var base = state.base;
|
|
34721
36078
|
var copy = state.copy;
|
|
34722
36079
|
each(base, function (prop) {
|
|
34723
|
-
if (!has(copy, prop)) { this$1$1.onDelete(state, prop); }
|
|
36080
|
+
if (!has$1(copy, prop)) { this$1$1.onDelete(state, prop); }
|
|
34724
36081
|
});
|
|
34725
36082
|
}
|
|
34726
36083
|
}
|
|
@@ -34899,7 +36256,7 @@ const createInitialState = formConfig => {
|
|
|
34899
36256
|
};
|
|
34900
36257
|
|
|
34901
36258
|
const SET = "field/SET";
|
|
34902
|
-
const set = fieldName => value => ({
|
|
36259
|
+
const set$2 = fieldName => value => ({
|
|
34903
36260
|
type: SET,
|
|
34904
36261
|
payload: { fieldName, value }
|
|
34905
36262
|
});
|
|
@@ -34979,7 +36336,7 @@ const createMapDispatchToProps = formConfig => {
|
|
|
34979
36336
|
const keys = Object.keys(formConfig);
|
|
34980
36337
|
for (let fieldName of keys) {
|
|
34981
36338
|
dispatchObj.fields[fieldName] = {
|
|
34982
|
-
set: value => dispatch(set(fieldName)(value)),
|
|
36339
|
+
set: value => dispatch(set$2(fieldName)(value)),
|
|
34983
36340
|
addValidator: validator => dispatch(addValidator(fieldName)(validator))
|
|
34984
36341
|
};
|
|
34985
36342
|
}
|
|
@@ -37915,7 +39272,7 @@ var tabbable_1 = tabbable;
|
|
|
37915
39272
|
|
|
37916
39273
|
var immutable = extend;
|
|
37917
39274
|
|
|
37918
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
39275
|
+
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
37919
39276
|
|
|
37920
39277
|
function extend() {
|
|
37921
39278
|
var target = {};
|
|
@@ -37924,7 +39281,7 @@ function extend() {
|
|
|
37924
39281
|
var source = arguments[i];
|
|
37925
39282
|
|
|
37926
39283
|
for (var key in source) {
|
|
37927
|
-
if (hasOwnProperty.call(source, key)) {
|
|
39284
|
+
if (hasOwnProperty$1.call(source, key)) {
|
|
37928
39285
|
target[key] = source[key];
|
|
37929
39286
|
}
|
|
37930
39287
|
}
|