@bigbinary/neetoui 5.2.20 → 5.2.22
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/formik.cjs.js +4 -3
- package/formik.cjs.js.map +1 -1
- package/formik.js +4 -3
- package/formik.js.map +1 -1
- package/index.cjs.js +2813 -181
- package/index.cjs.js.map +1 -1
- package/index.css +1 -1
- package/index.d.ts +11 -0
- package/index.js +2815 -184
- package/index.js.map +1 -1
- package/layouts.cjs.js.map +1 -1
- package/layouts.js.map +1 -1
- package/package.json +2 -1
package/index.cjs.js
CHANGED
|
@@ -2216,9 +2216,9 @@ const MotionContext = React$5.createContext({});
|
|
|
2216
2216
|
*/
|
|
2217
2217
|
const PresenceContext = React$5.createContext(null);
|
|
2218
2218
|
|
|
2219
|
-
const isBrowser$
|
|
2219
|
+
const isBrowser$9 = typeof document !== "undefined";
|
|
2220
2220
|
|
|
2221
|
-
const useIsomorphicLayoutEffect$
|
|
2221
|
+
const useIsomorphicLayoutEffect$3 = isBrowser$9 ? React$5.useLayoutEffect : React$5.useEffect;
|
|
2222
2222
|
|
|
2223
2223
|
const LazyContext = React$5.createContext({ strict: false });
|
|
2224
2224
|
|
|
@@ -2253,7 +2253,7 @@ function useVisualElement(Component, visualState, props, createVisualElement) {
|
|
|
2253
2253
|
* was present on initial render - it will be deleted after this.
|
|
2254
2254
|
*/
|
|
2255
2255
|
const canHandoff = React$5.useRef(Boolean(window.HandoffAppearAnimations));
|
|
2256
|
-
useIsomorphicLayoutEffect$
|
|
2256
|
+
useIsomorphicLayoutEffect$3(() => {
|
|
2257
2257
|
if (!visualElement)
|
|
2258
2258
|
return;
|
|
2259
2259
|
visualElement.render();
|
|
@@ -2444,7 +2444,7 @@ function createMotionComponent({ preloadedFeatures, createVisualElement, useRend
|
|
|
2444
2444
|
const { isStatic } = configAndProps;
|
|
2445
2445
|
const context = useCreateMotionContext(props);
|
|
2446
2446
|
const visualState = useVisualState(props, isStatic);
|
|
2447
|
-
if (!isStatic && isBrowser$
|
|
2447
|
+
if (!isStatic && isBrowser$9) {
|
|
2448
2448
|
/**
|
|
2449
2449
|
* Create a VisualElement for this component. A VisualElement provides a common
|
|
2450
2450
|
* interface to renderer-specific APIs (ie DOM/Three.js etc) as well as
|
|
@@ -2709,12 +2709,12 @@ const sanitize = (v) => Math.round(v * 100000) / 100000;
|
|
|
2709
2709
|
const floatRegex = /(-)?([\d]*\.?[\d])+/g;
|
|
2710
2710
|
const colorRegex = /(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi;
|
|
2711
2711
|
const singleColorRegex = /^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;
|
|
2712
|
-
function isString$
|
|
2712
|
+
function isString$4(v) {
|
|
2713
2713
|
return typeof v === "string";
|
|
2714
2714
|
}
|
|
2715
2715
|
|
|
2716
2716
|
const createUnitType = (unit) => ({
|
|
2717
|
-
test: (v) => isString$
|
|
2717
|
+
test: (v) => isString$4(v) && v.endsWith(unit) && v.split(" ").length === 1,
|
|
2718
2718
|
parse: parseFloat,
|
|
2719
2719
|
transform: (v) => `${v}${unit}`,
|
|
2720
2720
|
});
|
|
@@ -4247,11 +4247,11 @@ const easingDefinitionToFunction = (definition) => {
|
|
|
4247
4247
|
* but false if a number or multiple colors
|
|
4248
4248
|
*/
|
|
4249
4249
|
const isColorString = (type, testProp) => (v) => {
|
|
4250
|
-
return Boolean((isString$
|
|
4250
|
+
return Boolean((isString$4(v) && singleColorRegex.test(v) && v.startsWith(type)) ||
|
|
4251
4251
|
(testProp && Object.prototype.hasOwnProperty.call(v, testProp)));
|
|
4252
4252
|
};
|
|
4253
4253
|
const splitColor = (aName, bName, cName) => (v) => {
|
|
4254
|
-
if (!isString$
|
|
4254
|
+
if (!isString$4(v))
|
|
4255
4255
|
return v;
|
|
4256
4256
|
const [a, b, c, alpha] = v.match(floatRegex);
|
|
4257
4257
|
return {
|
|
@@ -4347,7 +4347,7 @@ const color = {
|
|
|
4347
4347
|
}
|
|
4348
4348
|
},
|
|
4349
4349
|
transform: (v) => {
|
|
4350
|
-
return isString$
|
|
4350
|
+
return isString$4(v)
|
|
4351
4351
|
? v
|
|
4352
4352
|
: v.hasOwnProperty("red")
|
|
4353
4353
|
? rgba.transform(v)
|
|
@@ -4453,7 +4453,7 @@ const mixColor = (from, to) => {
|
|
|
4453
4453
|
function test(v) {
|
|
4454
4454
|
var _a, _b;
|
|
4455
4455
|
return (isNaN(v) &&
|
|
4456
|
-
isString$
|
|
4456
|
+
isString$4(v) &&
|
|
4457
4457
|
(((_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) || 0) +
|
|
4458
4458
|
(((_b = v.match(colorRegex)) === null || _b === void 0 ? void 0 : _b.length) || 0) >
|
|
4459
4459
|
0);
|
|
@@ -4766,7 +4766,7 @@ function calcGeneratorVelocity(resolveValue, t, current) {
|
|
|
4766
4766
|
return velocityPerSecond(current - resolveValue(prevT), t - prevT);
|
|
4767
4767
|
}
|
|
4768
4768
|
|
|
4769
|
-
const safeMin = 0.001;
|
|
4769
|
+
const safeMin$1 = 0.001;
|
|
4770
4770
|
const minDuration = 0.01;
|
|
4771
4771
|
const maxDuration$1 = 10.0;
|
|
4772
4772
|
const minDamping = 0.05;
|
|
@@ -4791,7 +4791,7 @@ function findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1, })
|
|
|
4791
4791
|
const a = exponentialDecay - velocity;
|
|
4792
4792
|
const b = calcAngularFreq(undampedFreq, dampingRatio);
|
|
4793
4793
|
const c = Math.exp(-delta);
|
|
4794
|
-
return safeMin - (a / b) * c;
|
|
4794
|
+
return safeMin$1 - (a / b) * c;
|
|
4795
4795
|
};
|
|
4796
4796
|
derivative = (undampedFreq) => {
|
|
4797
4797
|
const exponentialDecay = undampedFreq * dampingRatio;
|
|
@@ -4800,7 +4800,7 @@ function findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1, })
|
|
|
4800
4800
|
const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;
|
|
4801
4801
|
const f = Math.exp(-delta);
|
|
4802
4802
|
const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);
|
|
4803
|
-
const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;
|
|
4803
|
+
const factor = -envelope(undampedFreq) + safeMin$1 > 0 ? -1 : 1;
|
|
4804
4804
|
return (factor * ((d - e) * f)) / g;
|
|
4805
4805
|
};
|
|
4806
4806
|
}
|
|
@@ -4811,7 +4811,7 @@ function findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1, })
|
|
|
4811
4811
|
envelope = (undampedFreq) => {
|
|
4812
4812
|
const a = Math.exp(-undampedFreq * duration);
|
|
4813
4813
|
const b = (undampedFreq - velocity) * duration + 1;
|
|
4814
|
-
return -safeMin + a * b;
|
|
4814
|
+
return -safeMin$1 + a * b;
|
|
4815
4815
|
};
|
|
4816
4816
|
derivative = (undampedFreq) => {
|
|
4817
4817
|
const a = Math.exp(-undampedFreq * duration);
|
|
@@ -10336,7 +10336,7 @@ const checkAndConvertChangedValueTypes = (visualElement, target, origin = {}, tr
|
|
|
10336
10336
|
// Reapply original values
|
|
10337
10337
|
visualElement.render();
|
|
10338
10338
|
// Restore scroll position
|
|
10339
|
-
if (isBrowser$
|
|
10339
|
+
if (isBrowser$9 && scrollY !== null) {
|
|
10340
10340
|
window.scrollTo({ top: scrollY });
|
|
10341
10341
|
}
|
|
10342
10342
|
return { target: convertedTarget, transitionEnd };
|
|
@@ -10375,7 +10375,7 @@ const hasReducedMotionListener = { current: false };
|
|
|
10375
10375
|
|
|
10376
10376
|
function initPrefersReducedMotion() {
|
|
10377
10377
|
hasReducedMotionListener.current = true;
|
|
10378
|
-
if (!isBrowser$
|
|
10378
|
+
if (!isBrowser$9)
|
|
10379
10379
|
return;
|
|
10380
10380
|
if (window.matchMedia) {
|
|
10381
10381
|
const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)");
|
|
@@ -11061,7 +11061,7 @@ const motion = /*@__PURE__*/ createMotionProxy((Component, config) => createDomM
|
|
|
11061
11061
|
|
|
11062
11062
|
function useIsMounted() {
|
|
11063
11063
|
const isMounted = React$5.useRef(false);
|
|
11064
|
-
useIsomorphicLayoutEffect$
|
|
11064
|
+
useIsomorphicLayoutEffect$3(() => {
|
|
11065
11065
|
isMounted.current = true;
|
|
11066
11066
|
return () => {
|
|
11067
11067
|
isMounted.current = false;
|
|
@@ -11271,7 +11271,7 @@ const AnimatePresence = ({ children, custom, initial = true, onExitComplete, exi
|
|
|
11271
11271
|
// If this is the initial component render, just deal with logic surrounding whether
|
|
11272
11272
|
// we play onMount animations or not.
|
|
11273
11273
|
const isInitialRender = React$5.useRef(true);
|
|
11274
|
-
useIsomorphicLayoutEffect$
|
|
11274
|
+
useIsomorphicLayoutEffect$3(() => {
|
|
11275
11275
|
isInitialRender.current = false;
|
|
11276
11276
|
updateChildLookup(filteredChildren, allChildren);
|
|
11277
11277
|
presentChildren.current = childrenToRender;
|
|
@@ -11375,14 +11375,14 @@ function _objectWithoutProperties$1(source, excluded) {
|
|
|
11375
11375
|
return target;
|
|
11376
11376
|
}
|
|
11377
11377
|
|
|
11378
|
-
var _excluded$
|
|
11378
|
+
var _excluded$I = ["open", "children", "className"];
|
|
11379
11379
|
var Collapse = function Collapse(_ref) {
|
|
11380
11380
|
var _ref$open = _ref.open,
|
|
11381
11381
|
open = _ref$open === void 0 ? false : _ref$open,
|
|
11382
11382
|
children = _ref.children,
|
|
11383
11383
|
_ref$className = _ref.className,
|
|
11384
11384
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
11385
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
11385
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$I);
|
|
11386
11386
|
return /*#__PURE__*/React__default["default"].createElement(AnimatePresence, null, open && /*#__PURE__*/React__default["default"].createElement(motion.div, _extends$4({
|
|
11387
11387
|
animate: {
|
|
11388
11388
|
opacity: 1,
|
|
@@ -11601,10 +11601,11 @@ var getScrollbarWidth = function getScrollbarWidth() {
|
|
|
11601
11601
|
return scrollbarWidth;
|
|
11602
11602
|
};
|
|
11603
11603
|
var noop$2 = function noop() {};
|
|
11604
|
-
var hyphenize = function hyphenize(
|
|
11604
|
+
var hyphenize = function hyphenize(input) {
|
|
11605
11605
|
var fallbackString = "nui";
|
|
11606
|
-
if (
|
|
11607
|
-
|
|
11606
|
+
if (typeof input === "number") return String(input);
|
|
11607
|
+
if (input && typeof input === "string" && input.replace) {
|
|
11608
|
+
return input.replace(/[\s_]/g, "-").replace(/([a-z])([A-Z])/g, "$1-$2").replace(/-+/g, "-").toLowerCase();
|
|
11608
11609
|
}
|
|
11609
11610
|
return fallbackString;
|
|
11610
11611
|
};
|
|
@@ -11700,10 +11701,10 @@ var ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES = {
|
|
|
11700
11701
|
controlItemBgHover: "rgb(var(--neeto-ui-gray-100))"
|
|
11701
11702
|
};
|
|
11702
11703
|
|
|
11703
|
-
var _excluded$
|
|
11704
|
+
var _excluded$H = ["children"];
|
|
11704
11705
|
var Portal$1 = function Portal(_ref, ref) {
|
|
11705
11706
|
var children = _ref.children,
|
|
11706
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
11707
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$H);
|
|
11707
11708
|
return /*#__PURE__*/React__default["default"].createElement("div", _extends$4({
|
|
11708
11709
|
"data-cy": "neeto-backdrop",
|
|
11709
11710
|
"data-testid": "neeto-backdrop",
|
|
@@ -13848,8 +13849,8 @@ function bindGlobalEventListeners() {
|
|
|
13848
13849
|
window.addEventListener('blur', onWindowBlur);
|
|
13849
13850
|
}
|
|
13850
13851
|
|
|
13851
|
-
var isBrowser$
|
|
13852
|
-
var isIE11 = isBrowser$
|
|
13852
|
+
var isBrowser$8 = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
13853
|
+
var isIE11 = isBrowser$8 ? // @ts-ignore
|
|
13853
13854
|
!!window.msCrypto : false;
|
|
13854
13855
|
|
|
13855
13856
|
var pluginProps = {
|
|
@@ -15299,7 +15300,7 @@ function _objectWithoutPropertiesLoose$4(source, excluded) {
|
|
|
15299
15300
|
return target;
|
|
15300
15301
|
}
|
|
15301
15302
|
|
|
15302
|
-
var isBrowser$
|
|
15303
|
+
var isBrowser$7 = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
15303
15304
|
function preserveRef(ref, node) {
|
|
15304
15305
|
if (ref) {
|
|
15305
15306
|
if (typeof ref === 'function') {
|
|
@@ -15312,7 +15313,7 @@ function preserveRef(ref, node) {
|
|
|
15312
15313
|
}
|
|
15313
15314
|
}
|
|
15314
15315
|
function ssrSafeCreateDiv() {
|
|
15315
|
-
return isBrowser$
|
|
15316
|
+
return isBrowser$7 && document.createElement('div');
|
|
15316
15317
|
}
|
|
15317
15318
|
function toDataAttributes(attrs) {
|
|
15318
15319
|
var dataAttrs = {
|
|
@@ -15375,7 +15376,7 @@ function deepPreserveProps(instanceProps, componentProps) {
|
|
|
15375
15376
|
});
|
|
15376
15377
|
}
|
|
15377
15378
|
|
|
15378
|
-
var useIsomorphicLayoutEffect$
|
|
15379
|
+
var useIsomorphicLayoutEffect$2 = isBrowser$7 ? React$5.useLayoutEffect : React$5.useEffect;
|
|
15379
15380
|
function useMutableBox(initialValue) {
|
|
15380
15381
|
// Using refs instead of state as it's recommended to not store imperative
|
|
15381
15382
|
// values in state due to memory problems in React(?)
|
|
@@ -15514,7 +15515,7 @@ function TippyGenerator(tippy) {
|
|
|
15514
15515
|
|
|
15515
15516
|
var deps = [reference].concat(children ? [children.type] : []); // CREATE
|
|
15516
15517
|
|
|
15517
|
-
useIsomorphicLayoutEffect$
|
|
15518
|
+
useIsomorphicLayoutEffect$2(function () {
|
|
15518
15519
|
var element = reference;
|
|
15519
15520
|
|
|
15520
15521
|
if (reference && reference.hasOwnProperty('current')) {
|
|
@@ -15549,7 +15550,7 @@ function TippyGenerator(tippy) {
|
|
|
15549
15550
|
};
|
|
15550
15551
|
}, deps); // UPDATE
|
|
15551
15552
|
|
|
15552
|
-
useIsomorphicLayoutEffect$
|
|
15553
|
+
useIsomorphicLayoutEffect$2(function () {
|
|
15553
15554
|
var _instance$popperInsta;
|
|
15554
15555
|
|
|
15555
15556
|
// Prevent this effect from running on 1st render
|
|
@@ -15585,7 +15586,7 @@ function TippyGenerator(tippy) {
|
|
|
15585
15586
|
});
|
|
15586
15587
|
}
|
|
15587
15588
|
});
|
|
15588
|
-
useIsomorphicLayoutEffect$
|
|
15589
|
+
useIsomorphicLayoutEffect$2(function () {
|
|
15589
15590
|
var _instance$props$poppe;
|
|
15590
15591
|
|
|
15591
15592
|
if (!render) {
|
|
@@ -15657,7 +15658,7 @@ var index$1 = /*#__PURE__*/forwardRef( /*#__PURE__*/TippyGenerator(tippy));
|
|
|
15657
15658
|
|
|
15658
15659
|
var ARROW = "<svg width='12' height='6' viewBox='0 0 10 5' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M10 5H0.926697L3.95208 1.63847C4.74227 0.760478 6.11722 0.754951 6.91445 1.62656L10 5Z' /></svg>";
|
|
15659
15660
|
|
|
15660
|
-
var _excluded$
|
|
15661
|
+
var _excluded$G = ["content", "children", "theme", "disabled", "position", "interactive", "hideAfter", "hideOnTargetExit"];
|
|
15661
15662
|
var Tooltip = function Tooltip(_ref) {
|
|
15662
15663
|
var content = _ref.content,
|
|
15663
15664
|
children = _ref.children,
|
|
@@ -15673,7 +15674,7 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
15673
15674
|
hideAfter = _ref$hideAfter === void 0 ? -1 : _ref$hideAfter,
|
|
15674
15675
|
_ref$hideOnTargetExit = _ref.hideOnTargetExit,
|
|
15675
15676
|
hideOnTargetExit = _ref$hideOnTargetExit === void 0 ? false : _ref$hideOnTargetExit,
|
|
15676
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
15677
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$G);
|
|
15677
15678
|
var _useState = React$5.useState(null),
|
|
15678
15679
|
_useState2 = _slicedToArray$2(_useState, 2),
|
|
15679
15680
|
instance = _useState2[0],
|
|
@@ -15720,7 +15721,7 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
15720
15721
|
}, localProps, otherProps), /*#__PURE__*/React__default["default"].isValidElement(children) ? children : /*#__PURE__*/React__default["default"].createElement("span", null, children));
|
|
15721
15722
|
};
|
|
15722
15723
|
|
|
15723
|
-
var _excluded$
|
|
15724
|
+
var _excluded$F = ["icon", "iconPosition", "iconSize", "label", "loading", "onClick", "to", "type", "style", "fullWidth", "className", "disabled", "size", "href", "tooltipProps", "children"];
|
|
15724
15725
|
var BUTTON_STYLES = {
|
|
15725
15726
|
primary: "primary",
|
|
15726
15727
|
secondary: "secondary",
|
|
@@ -15775,7 +15776,7 @@ var Button = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, r
|
|
|
15775
15776
|
_ref$tooltipProps = _ref.tooltipProps,
|
|
15776
15777
|
tooltipProps = _ref$tooltipProps === void 0 ? null : _ref$tooltipProps,
|
|
15777
15778
|
children = _ref.children,
|
|
15778
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
15779
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$F);
|
|
15779
15780
|
var Parent = motion.button;
|
|
15780
15781
|
var elementSpecificProps = {
|
|
15781
15782
|
type: type
|
|
@@ -15865,33 +15866,33 @@ var Button = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, r
|
|
|
15865
15866
|
});
|
|
15866
15867
|
Button.displayName = "Button";
|
|
15867
15868
|
|
|
15868
|
-
var Divider = function Divider(props) {
|
|
15869
|
+
var Divider$1 = function Divider(props) {
|
|
15869
15870
|
return /*#__PURE__*/React__default["default"].createElement("li", _extends$4({
|
|
15870
15871
|
className: "neeto-ui-dropdown__popup-divider"
|
|
15871
15872
|
}, props));
|
|
15872
15873
|
};
|
|
15873
15874
|
|
|
15874
|
-
var _excluded$
|
|
15875
|
+
var _excluded$E = ["children", "className"];
|
|
15875
15876
|
var Menu$2 = function Menu(_ref) {
|
|
15876
15877
|
var children = _ref.children,
|
|
15877
15878
|
className = _ref.className,
|
|
15878
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
15879
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$E);
|
|
15879
15880
|
return /*#__PURE__*/React__default["default"].createElement("ul", _extends$4({
|
|
15880
15881
|
className: classnames$1("neeto-ui-dropdown__popup-menu", className)
|
|
15881
15882
|
}, otherProps), children);
|
|
15882
15883
|
};
|
|
15883
15884
|
|
|
15884
|
-
var _excluded$
|
|
15885
|
+
var _excluded$D = ["children", "className"];
|
|
15885
15886
|
var MenuItem = function MenuItem(_ref) {
|
|
15886
15887
|
var children = _ref.children,
|
|
15887
15888
|
className = _ref.className,
|
|
15888
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
15889
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$D);
|
|
15889
15890
|
return /*#__PURE__*/React__default["default"].createElement("li", _extends$4({
|
|
15890
15891
|
className: classnames$1("neeto-ui-dropdown__popup-menu-item", className)
|
|
15891
15892
|
}, otherProps), children);
|
|
15892
15893
|
};
|
|
15893
15894
|
|
|
15894
|
-
var _excluded$
|
|
15895
|
+
var _excluded$C = ["children", "className", "isActive", "isDisabled", "style", "prefix", "suffix", "type", "to", "href"];
|
|
15895
15896
|
var ITEM_BTN_STYLES = {
|
|
15896
15897
|
"default": "default",
|
|
15897
15898
|
danger: "danger"
|
|
@@ -15916,7 +15917,7 @@ var MenuItemButton = function MenuItemButton(_ref) {
|
|
|
15916
15917
|
to = _ref$to === void 0 ? "" : _ref$to,
|
|
15917
15918
|
_ref$href = _ref.href,
|
|
15918
15919
|
href = _ref$href === void 0 ? "" : _ref$href,
|
|
15919
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
15920
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$C);
|
|
15920
15921
|
var Parent, elementSpecificProps;
|
|
15921
15922
|
if (to) {
|
|
15922
15923
|
Parent = reactRouterDom.Link;
|
|
@@ -15950,7 +15951,7 @@ var MenuItemButton = function MenuItemButton(_ref) {
|
|
|
15950
15951
|
|
|
15951
15952
|
MenuItem.Button = MenuItemButton;
|
|
15952
15953
|
|
|
15953
|
-
var _excluded$
|
|
15954
|
+
var _excluded$B = ["style", "size"],
|
|
15954
15955
|
_excluded2$4 = ["icon", "label", "isOpen", "onClose", "dropdownProps", "position", "children", "className", "buttonStyle", "buttonSize", "buttonProps", "customTarget", "disabled", "closeOnEsc", "closeOnSelect", "closeOnOutsideClick", "dropdownModifiers", "trigger", "strategy", "onClick"],
|
|
15955
15956
|
_excluded3 = ["classNames"];
|
|
15956
15957
|
var BTN_STYLES$1 = {
|
|
@@ -16032,7 +16033,7 @@ var Dropdown = function Dropdown(_ref2) {
|
|
|
16032
16033
|
_ref2$buttonProps2 = _ref2$buttonProps === void 0 ? {} : _ref2$buttonProps,
|
|
16033
16034
|
style = _ref2$buttonProps2.style,
|
|
16034
16035
|
size = _ref2$buttonProps2.size,
|
|
16035
|
-
buttonProps = _objectWithoutProperties$1(_ref2$buttonProps2, _excluded$
|
|
16036
|
+
buttonProps = _objectWithoutProperties$1(_ref2$buttonProps2, _excluded$B),
|
|
16036
16037
|
customTarget = _ref2.customTarget,
|
|
16037
16038
|
_ref2$disabled = _ref2.disabled,
|
|
16038
16039
|
disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
|
|
@@ -16123,9 +16124,9 @@ var Dropdown = function Dropdown(_ref2) {
|
|
|
16123
16124
|
};
|
|
16124
16125
|
Dropdown.Menu = Menu$2;
|
|
16125
16126
|
Dropdown.MenuItem = MenuItem;
|
|
16126
|
-
Dropdown.Divider = Divider;
|
|
16127
|
+
Dropdown.Divider = Divider$1;
|
|
16127
16128
|
|
|
16128
|
-
var _excluded$
|
|
16129
|
+
var _excluded$A = ["style", "size"];
|
|
16129
16130
|
var BTN_STYLES = {
|
|
16130
16131
|
primary: "primary",
|
|
16131
16132
|
secondary: "secondary"
|
|
@@ -16150,7 +16151,7 @@ var ActionDropdown = function ActionDropdown(_ref) {
|
|
|
16150
16151
|
_ref$buttonProps2 = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
|
|
16151
16152
|
style = _ref$buttonProps2.style,
|
|
16152
16153
|
size = _ref$buttonProps2.size,
|
|
16153
|
-
buttonProps = _objectWithoutProperties$1(_ref$buttonProps2, _excluded$
|
|
16154
|
+
buttonProps = _objectWithoutProperties$1(_ref$buttonProps2, _excluded$A),
|
|
16154
16155
|
_ref$dropdownProps = _ref.dropdownProps,
|
|
16155
16156
|
dropdownProps = _ref$dropdownProps === void 0 ? {} : _ref$dropdownProps,
|
|
16156
16157
|
_ref$className = _ref.className,
|
|
@@ -18573,7 +18574,7 @@ var Footer$1 = function Footer(_ref) {
|
|
|
18573
18574
|
}, children);
|
|
18574
18575
|
};
|
|
18575
18576
|
|
|
18576
|
-
var _excluded$
|
|
18577
|
+
var _excluded$z = ["style", "weight", "lineHeight", "component", "children", "textTransform", "className"];
|
|
18577
18578
|
var FONT_WEIGHTS = {
|
|
18578
18579
|
thin: "thin",
|
|
18579
18580
|
extralight: "extralight",
|
|
@@ -18661,7 +18662,7 @@ var Typography = /*#__PURE__*/React__default["default"].forwardRef(function (_re
|
|
|
18661
18662
|
textTransform = _ref.textTransform,
|
|
18662
18663
|
_ref$className = _ref.className,
|
|
18663
18664
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
18664
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
18665
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$z);
|
|
18665
18666
|
var Component = component ? COMPONENTS[component] : style ? DEFAULT_COMPONENTS[style] : "p";
|
|
18666
18667
|
return /*#__PURE__*/React__default["default"].createElement(Component, _extends$4({
|
|
18667
18668
|
ref: ref,
|
|
@@ -18724,7 +18725,7 @@ var Header$1 = function Header(_ref) {
|
|
|
18724
18725
|
}, description)));
|
|
18725
18726
|
};
|
|
18726
18727
|
|
|
18727
|
-
var _excluded$
|
|
18728
|
+
var _excluded$y = ["size", "isOpen", "onClose", "children", "finalFocusRef", "initialFocusRef", "className", "closeOnEsc", "closeButton", "backdropClassName", "blockScrollOnMount", "closeOnOutsideClick"];
|
|
18728
18729
|
var SIZES$7 = {
|
|
18729
18730
|
small: "small",
|
|
18730
18731
|
medium: "medium",
|
|
@@ -18753,7 +18754,7 @@ var Modal = function Modal(_ref) {
|
|
|
18753
18754
|
blockScrollOnMount = _ref$blockScrollOnMou === void 0 ? true : _ref$blockScrollOnMou,
|
|
18754
18755
|
_ref$closeOnOutsideCl = _ref.closeOnOutsideClick,
|
|
18755
18756
|
closeOnOutsideClick = _ref$closeOnOutsideCl === void 0 ? true : _ref$closeOnOutsideCl,
|
|
18756
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
18757
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$y);
|
|
18757
18758
|
var _useState = React$5.useState(false),
|
|
18758
18759
|
_useState2 = _slicedToArray$2(_useState, 2),
|
|
18759
18760
|
hasTransitionCompleted = _useState2[0],
|
|
@@ -18917,7 +18918,7 @@ var FallbackAvatar = /*@__PURE__*/getDefaultExportFromCjs(build.exports);
|
|
|
18917
18918
|
var COLOR_PALLETE = ["#ffb5a7", "#fcd5ce", "#f8edeb", "#f9dcc4", "#fec89a"];
|
|
18918
18919
|
var AVATAR_VARIANT = "beam";
|
|
18919
18920
|
|
|
18920
|
-
var _excluded$
|
|
18921
|
+
var _excluded$x = ["size", "user", "status", "onClick", "className", "showTooltip", "tooltipProps"];
|
|
18921
18922
|
var SIZE = {
|
|
18922
18923
|
small: 24,
|
|
18923
18924
|
medium: 32,
|
|
@@ -18939,7 +18940,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
18939
18940
|
showTooltip = _ref$showTooltip === void 0 ? false : _ref$showTooltip,
|
|
18940
18941
|
_ref$tooltipProps = _ref.tooltipProps,
|
|
18941
18942
|
tooltipProps = _ref$tooltipProps === void 0 ? {} : _ref$tooltipProps,
|
|
18942
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
18943
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$x);
|
|
18943
18944
|
var _useState = React$5.useState(false),
|
|
18944
18945
|
_useState2 = _slicedToArray$2(_useState, 2),
|
|
18945
18946
|
isLoadingFailed = _useState2[0],
|
|
@@ -18998,7 +18999,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
18998
18999
|
})));
|
|
18999
19000
|
};
|
|
19000
19001
|
|
|
19001
|
-
var _excluded$
|
|
19002
|
+
var _excluded$w = ["icon", "style", "className", "children"];
|
|
19002
19003
|
var STYLES$2 = {
|
|
19003
19004
|
info: "info",
|
|
19004
19005
|
warning: "warning",
|
|
@@ -19013,7 +19014,7 @@ var Callout = function Callout(_ref) {
|
|
|
19013
19014
|
_ref$className = _ref.className,
|
|
19014
19015
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
19015
19016
|
children = _ref.children,
|
|
19016
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
19017
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$w);
|
|
19017
19018
|
var Icon = icon;
|
|
19018
19019
|
return /*#__PURE__*/React__default["default"].createElement("div", _extends$4({
|
|
19019
19020
|
className: classnames$1("neeto-ui-callout", _defineProperty$7({
|
|
@@ -19059,7 +19060,7 @@ function canUseDOM$1() {
|
|
|
19059
19060
|
* @param deps
|
|
19060
19061
|
*/
|
|
19061
19062
|
|
|
19062
|
-
var useIsomorphicLayoutEffect = /*#__PURE__*/canUseDOM$1() ? React$5.useLayoutEffect : React$5.useEffect;
|
|
19063
|
+
var useIsomorphicLayoutEffect$1 = /*#__PURE__*/canUseDOM$1() ? React$5.useLayoutEffect : React$5.useEffect;
|
|
19063
19064
|
|
|
19064
19065
|
/*
|
|
19065
19066
|
* Welcome to @reach/auto-id!
|
|
@@ -19146,7 +19147,7 @@ function useId(idFromProps) {
|
|
|
19146
19147
|
id = _React$useState[0],
|
|
19147
19148
|
setId = _React$useState[1];
|
|
19148
19149
|
|
|
19149
|
-
useIsomorphicLayoutEffect(function () {
|
|
19150
|
+
useIsomorphicLayoutEffect$1(function () {
|
|
19150
19151
|
if (id === null) {
|
|
19151
19152
|
/*
|
|
19152
19153
|
* Patch the ID after render. We do this in `useLayoutEffect` to avoid any
|
|
@@ -19171,7 +19172,7 @@ function useId(idFromProps) {
|
|
|
19171
19172
|
return id != null ? String(id) : undefined;
|
|
19172
19173
|
}
|
|
19173
19174
|
|
|
19174
|
-
var _excluded$
|
|
19175
|
+
var _excluded$v = ["children", "className", "required", "helpIconProps"],
|
|
19175
19176
|
_excluded2$3 = ["onClick", "icon", "tooltipProps", "className"];
|
|
19176
19177
|
var Label = function Label(_ref) {
|
|
19177
19178
|
var children = _ref.children,
|
|
@@ -19181,7 +19182,7 @@ var Label = function Label(_ref) {
|
|
|
19181
19182
|
required = _ref$required === void 0 ? false : _ref$required,
|
|
19182
19183
|
_ref$helpIconProps = _ref.helpIconProps,
|
|
19183
19184
|
helpIconProps = _ref$helpIconProps === void 0 ? null : _ref$helpIconProps,
|
|
19184
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
19185
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$v);
|
|
19185
19186
|
var _ref2 = helpIconProps || {},
|
|
19186
19187
|
onClick = _ref2.onClick,
|
|
19187
19188
|
icon = _ref2.icon,
|
|
@@ -19203,7 +19204,7 @@ var Label = function Label(_ref) {
|
|
|
19203
19204
|
}, otherHelpIconProps)))));
|
|
19204
19205
|
};
|
|
19205
19206
|
|
|
19206
|
-
var _excluded$
|
|
19207
|
+
var _excluded$u = ["label", "error", "className", "required", "labelProps", "children"];
|
|
19207
19208
|
var Checkbox = /*#__PURE__*/React$5.forwardRef(function (_ref, ref) {
|
|
19208
19209
|
var _ref$label = _ref.label,
|
|
19209
19210
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
@@ -19215,7 +19216,7 @@ var Checkbox = /*#__PURE__*/React$5.forwardRef(function (_ref, ref) {
|
|
|
19215
19216
|
required = _ref$required === void 0 ? false : _ref$required,
|
|
19216
19217
|
labelProps = _ref.labelProps,
|
|
19217
19218
|
children = _ref.children,
|
|
19218
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
19219
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$u);
|
|
19219
19220
|
var id = useId(otherProps.id);
|
|
19220
19221
|
var errorId = "error_".concat(id);
|
|
19221
19222
|
var renderLabel = label || children;
|
|
@@ -21003,8 +21004,8 @@ var ColorPicker = function ColorPicker(_ref) {
|
|
|
21003
21004
|
}, /*#__PURE__*/React__default["default"].createElement(Palette, colorPaletteProps))));
|
|
21004
21005
|
};
|
|
21005
21006
|
|
|
21006
|
-
var _excluded$
|
|
21007
|
-
var INPUT_SIZES$
|
|
21007
|
+
var _excluded$t = ["className", "label", "size", "dropdownClassName", "popupClassName", "dateFormat", "timeFormat", "onChange", "onOk", "picker", "showTime", "type", "nakedInput", "error", "defaultValue", "value", "labelProps", "required"];
|
|
21008
|
+
var INPUT_SIZES$2 = {
|
|
21008
21009
|
small: "small",
|
|
21009
21010
|
medium: "medium",
|
|
21010
21011
|
large: "large"
|
|
@@ -21029,7 +21030,7 @@ var DatePicker = /*#__PURE__*/React$5.forwardRef(function (_ref2, ref) {
|
|
|
21029
21030
|
_ref2$label = _ref2.label,
|
|
21030
21031
|
label = _ref2$label === void 0 ? "" : _ref2$label,
|
|
21031
21032
|
_ref2$size = _ref2.size,
|
|
21032
|
-
size = _ref2$size === void 0 ? INPUT_SIZES$
|
|
21033
|
+
size = _ref2$size === void 0 ? INPUT_SIZES$2.medium : _ref2$size,
|
|
21033
21034
|
_ref2$dropdownClassNa = _ref2.dropdownClassName,
|
|
21034
21035
|
dropdownClassName = _ref2$dropdownClassNa === void 0 ? "" : _ref2$dropdownClassNa,
|
|
21035
21036
|
_ref2$popupClassName = _ref2.popupClassName,
|
|
@@ -21057,7 +21058,7 @@ var DatePicker = /*#__PURE__*/React$5.forwardRef(function (_ref2, ref) {
|
|
|
21057
21058
|
labelProps = _ref2.labelProps,
|
|
21058
21059
|
_ref2$required = _ref2.required,
|
|
21059
21060
|
required = _ref2$required === void 0 ? false : _ref2$required,
|
|
21060
|
-
otherProps = _objectWithoutProperties$1(_ref2, _excluded$
|
|
21061
|
+
otherProps = _objectWithoutProperties$1(_ref2, _excluded$t);
|
|
21061
21062
|
var id = useId(otherProps.id);
|
|
21062
21063
|
var datePickerRef = useSyncedRef(ref);
|
|
21063
21064
|
var Component = datePickerTypes[type === null || type === void 0 ? void 0 : type.toLowerCase()];
|
|
@@ -21117,13 +21118,13 @@ var DatePicker = /*#__PURE__*/React$5.forwardRef(function (_ref2, ref) {
|
|
|
21117
21118
|
});
|
|
21118
21119
|
DatePicker.displayName = "DatePicker";
|
|
21119
21120
|
|
|
21120
|
-
var _excluded$
|
|
21121
|
+
var _excluded$s = ["size", "type", "label", "error", "suffix", "prefix", "disabled", "helpText", "className", "nakedInput", "contentSize", "required", "maxLength", "unlimitedChars", "labelProps", "rejectCharsRegex", "onBlur", "disableTrimOnBlur"];
|
|
21121
21122
|
var SIZES$5 = {
|
|
21122
21123
|
small: "small",
|
|
21123
21124
|
medium: "medium",
|
|
21124
21125
|
large: "large"
|
|
21125
21126
|
};
|
|
21126
|
-
var Input$
|
|
21127
|
+
var Input$3 = /*#__PURE__*/React$5.forwardRef(function (_ref, ref) {
|
|
21127
21128
|
var _ref2, _otherProps$value, _classnames;
|
|
21128
21129
|
var _ref$size = _ref.size,
|
|
21129
21130
|
size = _ref$size === void 0 ? SIZES$5.medium : _ref$size,
|
|
@@ -21157,7 +21158,7 @@ var Input$2 = /*#__PURE__*/React$5.forwardRef(function (_ref, ref) {
|
|
|
21157
21158
|
onBlur = _ref.onBlur,
|
|
21158
21159
|
_ref$disableTrimOnBlu = _ref.disableTrimOnBlur,
|
|
21159
21160
|
disableTrimOnBlur = _ref$disableTrimOnBlu === void 0 ? false : _ref$disableTrimOnBlu,
|
|
21160
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
21161
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$s);
|
|
21161
21162
|
var _useState = React$5.useState(otherProps.value),
|
|
21162
21163
|
_useState2 = _slicedToArray$2(_useState, 2),
|
|
21163
21164
|
valueInternal = _useState2[0],
|
|
@@ -21241,14 +21242,14 @@ var Input$2 = /*#__PURE__*/React$5.forwardRef(function (_ref, ref) {
|
|
|
21241
21242
|
style: "body3"
|
|
21242
21243
|
}, helpText));
|
|
21243
21244
|
});
|
|
21244
|
-
Input$
|
|
21245
|
+
Input$3.displayName = "Input";
|
|
21245
21246
|
|
|
21246
|
-
var _excluded$
|
|
21247
|
+
var _excluded$r = ["keyName", "className", "tooltipProps"];
|
|
21247
21248
|
var Kbd = function Kbd(_ref) {
|
|
21248
21249
|
var keyName = _ref.keyName,
|
|
21249
21250
|
className = _ref.className,
|
|
21250
21251
|
tooltipProps = _ref.tooltipProps,
|
|
21251
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
21252
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$r);
|
|
21252
21253
|
return /*#__PURE__*/React__default["default"].createElement(Tooltip, _extends$4({
|
|
21253
21254
|
disabled: !tooltipProps
|
|
21254
21255
|
}, tooltipProps), /*#__PURE__*/React__default["default"].createElement("span", _extends$4({
|
|
@@ -22210,7 +22211,7 @@ var weakMemoize = function weakMemoize(func) {
|
|
|
22210
22211
|
};
|
|
22211
22212
|
};
|
|
22212
22213
|
|
|
22213
|
-
function memoize(fn) {
|
|
22214
|
+
function memoize$1(fn) {
|
|
22214
22215
|
var cache = Object.create(null);
|
|
22215
22216
|
return function (arg) {
|
|
22216
22217
|
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
|
@@ -22555,9 +22556,9 @@ var prefixer = function prefixer(element, index, children, callback) {
|
|
|
22555
22556
|
}
|
|
22556
22557
|
};
|
|
22557
22558
|
|
|
22558
|
-
var isBrowser$
|
|
22559
|
-
var getServerStylisCache = isBrowser$
|
|
22560
|
-
return memoize(function () {
|
|
22559
|
+
var isBrowser$6 = typeof document !== 'undefined';
|
|
22560
|
+
var getServerStylisCache = isBrowser$6 ? undefined : weakMemoize(function () {
|
|
22561
|
+
return memoize$1(function () {
|
|
22561
22562
|
var cache = {};
|
|
22562
22563
|
return function (name) {
|
|
22563
22564
|
return cache[name];
|
|
@@ -22569,7 +22570,7 @@ var defaultStylisPlugins = [prefixer];
|
|
|
22569
22570
|
var createCache = function createCache(options) {
|
|
22570
22571
|
var key = options.key;
|
|
22571
22572
|
|
|
22572
|
-
if (isBrowser$
|
|
22573
|
+
if (isBrowser$6 && key === 'css') {
|
|
22573
22574
|
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
|
|
22574
22575
|
// document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
|
|
22575
22576
|
// note this very very intentionally targets all style elements regardless of the key to ensure
|
|
@@ -22598,7 +22599,7 @@ var createCache = function createCache(options) {
|
|
|
22598
22599
|
var container;
|
|
22599
22600
|
var nodesToHydrate = [];
|
|
22600
22601
|
|
|
22601
|
-
if (isBrowser$
|
|
22602
|
+
if (isBrowser$6) {
|
|
22602
22603
|
container = options.container || document.head;
|
|
22603
22604
|
Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
|
|
22604
22605
|
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
|
|
@@ -22617,7 +22618,7 @@ var createCache = function createCache(options) {
|
|
|
22617
22618
|
|
|
22618
22619
|
var omnipresentPlugins = [compat, removeLabel];
|
|
22619
22620
|
|
|
22620
|
-
if (isBrowser$
|
|
22621
|
+
if (isBrowser$6) {
|
|
22621
22622
|
var currentSheet;
|
|
22622
22623
|
var finalizingPlugins = [stringify$2, rulesheet(function (rule) {
|
|
22623
22624
|
currentSheet.insert(rule);
|
|
@@ -22721,11 +22722,11 @@ var reactIs_production_min = {};
|
|
|
22721
22722
|
* LICENSE file in the root directory of this source tree.
|
|
22722
22723
|
*/
|
|
22723
22724
|
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k$1=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
|
22724
|
-
Symbol.for("react.suspense_list"):60120,r$
|
|
22725
|
-
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k$1:case n:case t:case r$
|
|
22725
|
+
Symbol.for("react.suspense_list"):60120,r$3=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w$1=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
|
22726
|
+
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k$1:case n:case t:case r$3:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k$1;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r$3;reactIs_production_min.Portal=d;
|
|
22726
22727
|
reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k$1};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
|
|
22727
|
-
reactIs_production_min.isMemo=function(a){return z(a)===r$
|
|
22728
|
-
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r$
|
|
22728
|
+
reactIs_production_min.isMemo=function(a){return z(a)===r$3};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
|
|
22729
|
+
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r$3||a.$$typeof===h||a.$$typeof===k$1||a.$$typeof===n||a.$$typeof===w$1||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
|
|
22729
22730
|
|
|
22730
22731
|
(function (module) {
|
|
22731
22732
|
|
|
@@ -22754,7 +22755,7 @@ var TYPE_STATICS = {};
|
|
|
22754
22755
|
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
|
22755
22756
|
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
|
22756
22757
|
|
|
22757
|
-
var isBrowser$
|
|
22758
|
+
var isBrowser$5 = typeof document !== 'undefined';
|
|
22758
22759
|
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
|
22759
22760
|
var rawClassName = '';
|
|
22760
22761
|
classNames.split(' ').forEach(function (className) {
|
|
@@ -22778,7 +22779,7 @@ var registerStyles = function registerStyles(cache, serialized, isStringTag) {
|
|
|
22778
22779
|
// in node since emotion-server relies on whether a style is in
|
|
22779
22780
|
// the registered cache to know whether a style is global or not
|
|
22780
22781
|
// also, note that this check will be dead code eliminated in the browser
|
|
22781
|
-
isBrowser$
|
|
22782
|
+
isBrowser$5 === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
|
|
22782
22783
|
cache.registered[className] = serialized.styles;
|
|
22783
22784
|
}
|
|
22784
22785
|
};
|
|
@@ -22793,14 +22794,14 @@ var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
|
|
22793
22794
|
do {
|
|
22794
22795
|
var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
|
|
22795
22796
|
|
|
22796
|
-
if (!isBrowser$
|
|
22797
|
+
if (!isBrowser$5 && maybeStyles !== undefined) {
|
|
22797
22798
|
stylesForSSR += maybeStyles;
|
|
22798
22799
|
}
|
|
22799
22800
|
|
|
22800
22801
|
current = current.next;
|
|
22801
22802
|
} while (current !== undefined);
|
|
22802
22803
|
|
|
22803
|
-
if (!isBrowser$
|
|
22804
|
+
if (!isBrowser$5 && stylesForSSR.length !== 0) {
|
|
22804
22805
|
return stylesForSSR;
|
|
22805
22806
|
}
|
|
22806
22807
|
}
|
|
@@ -22920,7 +22921,7 @@ var isProcessableValue = function isProcessableValue(value) {
|
|
|
22920
22921
|
return value != null && typeof value !== 'boolean';
|
|
22921
22922
|
};
|
|
22922
22923
|
|
|
22923
|
-
var processStyleName = /* #__PURE__ */memoize(function (styleName) {
|
|
22924
|
+
var processStyleName = /* #__PURE__ */memoize$1(function (styleName) {
|
|
22924
22925
|
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
|
|
22925
22926
|
});
|
|
22926
22927
|
|
|
@@ -23129,17 +23130,17 @@ var serializeStyles = function serializeStyles(args, registered, mergedProps) {
|
|
|
23129
23130
|
};
|
|
23130
23131
|
};
|
|
23131
23132
|
|
|
23132
|
-
var isBrowser$
|
|
23133
|
+
var isBrowser$4 = typeof document !== 'undefined';
|
|
23133
23134
|
|
|
23134
23135
|
var syncFallback = function syncFallback(create) {
|
|
23135
23136
|
return create();
|
|
23136
23137
|
};
|
|
23137
23138
|
|
|
23138
23139
|
var useInsertionEffect = React__namespace['useInsertion' + 'Effect'] ? React__namespace['useInsertion' + 'Effect'] : false;
|
|
23139
|
-
var useInsertionEffectAlwaysWithSyncFallback = !isBrowser$
|
|
23140
|
+
var useInsertionEffectAlwaysWithSyncFallback = !isBrowser$4 ? syncFallback : useInsertionEffect || syncFallback;
|
|
23140
23141
|
|
|
23141
|
-
var isBrowser = typeof document !== 'undefined';
|
|
23142
|
-
var hasOwnProperty$
|
|
23142
|
+
var isBrowser$3 = typeof document !== 'undefined';
|
|
23143
|
+
var hasOwnProperty$2 = {}.hasOwnProperty;
|
|
23143
23144
|
|
|
23144
23145
|
var EmotionCacheContext = /* #__PURE__ */React$5.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
23145
23146
|
// because this module is primarily intended for the browser and node
|
|
@@ -23162,7 +23163,7 @@ var withEmotionCache = function withEmotionCache(func) {
|
|
|
23162
23163
|
});
|
|
23163
23164
|
};
|
|
23164
23165
|
|
|
23165
|
-
if (!isBrowser) {
|
|
23166
|
+
if (!isBrowser$3) {
|
|
23166
23167
|
withEmotionCache = function withEmotionCache(func) {
|
|
23167
23168
|
return function (props) {
|
|
23168
23169
|
var cache = React$5.useContext(EmotionCacheContext);
|
|
@@ -23194,7 +23195,7 @@ var createEmotionProps = function createEmotionProps(type, props) {
|
|
|
23194
23195
|
var newProps = {};
|
|
23195
23196
|
|
|
23196
23197
|
for (var key in props) {
|
|
23197
|
-
if (hasOwnProperty$
|
|
23198
|
+
if (hasOwnProperty$2.call(props, key)) {
|
|
23198
23199
|
newProps[key] = props[key];
|
|
23199
23200
|
}
|
|
23200
23201
|
}
|
|
@@ -23213,7 +23214,7 @@ var Insertion$1 = function Insertion(_ref) {
|
|
|
23213
23214
|
return insertStyles(cache, serialized, isStringTag);
|
|
23214
23215
|
});
|
|
23215
23216
|
|
|
23216
|
-
if (!isBrowser && rules !== undefined) {
|
|
23217
|
+
if (!isBrowser$3 && rules !== undefined) {
|
|
23217
23218
|
var _ref2;
|
|
23218
23219
|
|
|
23219
23220
|
var serializedNames = serialized.name;
|
|
@@ -23257,7 +23258,7 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
|
|
|
23257
23258
|
var newProps = {};
|
|
23258
23259
|
|
|
23259
23260
|
for (var key in props) {
|
|
23260
|
-
if (hasOwnProperty$
|
|
23261
|
+
if (hasOwnProperty$2.call(props, key) && key !== 'css' && key !== typePropName && ("production" === 'production' )) {
|
|
23261
23262
|
newProps[key] = props[key];
|
|
23262
23263
|
}
|
|
23263
23264
|
}
|
|
@@ -23274,7 +23275,7 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
|
|
|
23274
23275
|
var jsx = function jsx(type, props) {
|
|
23275
23276
|
var args = arguments;
|
|
23276
23277
|
|
|
23277
|
-
if (props == null || !hasOwnProperty$
|
|
23278
|
+
if (props == null || !hasOwnProperty$2.call(props, 'css')) {
|
|
23278
23279
|
// $FlowFixMe
|
|
23279
23280
|
return React$5.createElement.apply(undefined, args);
|
|
23280
23281
|
}
|
|
@@ -23382,17 +23383,17 @@ var Insertion = function Insertion(_ref) {
|
|
|
23382
23383
|
for (var i = 0; i < serializedArr.length; i++) {
|
|
23383
23384
|
var res = insertStyles(cache, serializedArr[i], false);
|
|
23384
23385
|
|
|
23385
|
-
if (!isBrowser && res !== undefined) {
|
|
23386
|
+
if (!isBrowser$3 && res !== undefined) {
|
|
23386
23387
|
rules += res;
|
|
23387
23388
|
}
|
|
23388
23389
|
}
|
|
23389
23390
|
|
|
23390
|
-
if (!isBrowser) {
|
|
23391
|
+
if (!isBrowser$3) {
|
|
23391
23392
|
return rules;
|
|
23392
23393
|
}
|
|
23393
23394
|
});
|
|
23394
23395
|
|
|
23395
|
-
if (!isBrowser && rules.length !== 0) {
|
|
23396
|
+
if (!isBrowser$3 && rules.length !== 0) {
|
|
23396
23397
|
var _ref2;
|
|
23397
23398
|
|
|
23398
23399
|
return /*#__PURE__*/React$5.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedArr.map(function (serialized) {
|
|
@@ -24868,7 +24869,7 @@ var GroupHeading = function GroupHeading(props) {
|
|
|
24868
24869
|
}, innerProps));
|
|
24869
24870
|
};
|
|
24870
24871
|
|
|
24871
|
-
var _excluded$
|
|
24872
|
+
var _excluded$q = ["innerRef", "isDisabled", "isHidden", "inputClassName"];
|
|
24872
24873
|
var inputCSS = function inputCSS(_ref) {
|
|
24873
24874
|
var isDisabled = _ref.isDisabled,
|
|
24874
24875
|
value = _ref.value,
|
|
@@ -24915,7 +24916,7 @@ var inputStyle = function inputStyle(isHidden) {
|
|
|
24915
24916
|
width: '100%'
|
|
24916
24917
|
}, spacingStyle);
|
|
24917
24918
|
};
|
|
24918
|
-
var Input$
|
|
24919
|
+
var Input$2 = function Input(props) {
|
|
24919
24920
|
var className = props.className,
|
|
24920
24921
|
cx = props.cx,
|
|
24921
24922
|
getStyles = props.getStyles,
|
|
@@ -24925,7 +24926,7 @@ var Input$1 = function Input(props) {
|
|
|
24925
24926
|
isDisabled = _cleanCommonProps.isDisabled,
|
|
24926
24927
|
isHidden = _cleanCommonProps.isHidden,
|
|
24927
24928
|
inputClassName = _cleanCommonProps.inputClassName,
|
|
24928
|
-
innerProps = _objectWithoutProperties(_cleanCommonProps, _excluded$
|
|
24929
|
+
innerProps = _objectWithoutProperties(_cleanCommonProps, _excluded$q);
|
|
24929
24930
|
return jsx("div", {
|
|
24930
24931
|
className: cx({
|
|
24931
24932
|
'input-container': true
|
|
@@ -25171,7 +25172,7 @@ var components = {
|
|
|
25171
25172
|
GroupHeading: GroupHeading,
|
|
25172
25173
|
IndicatorsContainer: IndicatorsContainer,
|
|
25173
25174
|
IndicatorSeparator: IndicatorSeparator,
|
|
25174
|
-
Input: Input$
|
|
25175
|
+
Input: Input$2,
|
|
25175
25176
|
LoadingIndicator: LoadingIndicator,
|
|
25176
25177
|
Menu: Menu$1,
|
|
25177
25178
|
MenuList: MenuList$1,
|
|
@@ -25748,10 +25749,10 @@ var createFilter = function createFilter(config) {
|
|
|
25748
25749
|
};
|
|
25749
25750
|
};
|
|
25750
25751
|
|
|
25751
|
-
var _excluded$
|
|
25752
|
+
var _excluded$p = ["innerRef"];
|
|
25752
25753
|
function DummyInput(_ref) {
|
|
25753
25754
|
var innerRef = _ref.innerRef,
|
|
25754
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
25755
|
+
props = _objectWithoutProperties(_ref, _excluded$p);
|
|
25755
25756
|
// Remove animation props not meant for HTML elements
|
|
25756
25757
|
var filteredProps = removeProps(props, 'onExited', 'in', 'enter', 'exit', 'appear');
|
|
25757
25758
|
return jsx("input", _extends$2({
|
|
@@ -27747,7 +27748,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
27747
27748
|
}(React$5.Component);
|
|
27748
27749
|
Select$1.defaultProps = defaultProps;
|
|
27749
27750
|
|
|
27750
|
-
var _excluded$
|
|
27751
|
+
var _excluded$o = ["defaultInputValue", "defaultMenuIsOpen", "defaultValue", "inputValue", "menuIsOpen", "onChange", "onInputChange", "onMenuClose", "onMenuOpen", "value"];
|
|
27751
27752
|
function useStateManager(_ref) {
|
|
27752
27753
|
var _ref$defaultInputValu = _ref.defaultInputValue,
|
|
27753
27754
|
defaultInputValue = _ref$defaultInputValu === void 0 ? '' : _ref$defaultInputValu,
|
|
@@ -27762,7 +27763,7 @@ function useStateManager(_ref) {
|
|
|
27762
27763
|
propsOnMenuClose = _ref.onMenuClose,
|
|
27763
27764
|
propsOnMenuOpen = _ref.onMenuOpen,
|
|
27764
27765
|
propsValue = _ref.value,
|
|
27765
|
-
restSelectProps = _objectWithoutProperties(_ref, _excluded$
|
|
27766
|
+
restSelectProps = _objectWithoutProperties(_ref, _excluded$o);
|
|
27766
27767
|
var _useState = React$5.useState(propsInputValue !== undefined ? propsInputValue : defaultInputValue),
|
|
27767
27768
|
_useState2 = _slicedToArray$1(_useState, 2),
|
|
27768
27769
|
stateInputValue = _useState2[0],
|
|
@@ -27814,7 +27815,7 @@ function useStateManager(_ref) {
|
|
|
27814
27815
|
});
|
|
27815
27816
|
}
|
|
27816
27817
|
|
|
27817
|
-
var _excluded$
|
|
27818
|
+
var _excluded$n = ["allowCreateWhileLoading", "createOptionPosition", "formatCreateLabel", "isValidNewOption", "getNewOptionData", "onCreateOption", "options", "onChange"];
|
|
27818
27819
|
var compareOption = function compareOption() {
|
|
27819
27820
|
var inputValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
27820
27821
|
var option = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -27858,7 +27859,7 @@ function useCreatable(_ref) {
|
|
|
27858
27859
|
_ref$options = _ref.options,
|
|
27859
27860
|
propsOptions = _ref$options === void 0 ? [] : _ref$options,
|
|
27860
27861
|
propsOnChange = _ref.onChange,
|
|
27861
|
-
restSelectProps = _objectWithoutProperties(_ref, _excluded$
|
|
27862
|
+
restSelectProps = _objectWithoutProperties(_ref, _excluded$n);
|
|
27862
27863
|
var _restSelectProps$getO = restSelectProps.getOptionValue,
|
|
27863
27864
|
getOptionValue$1$1 = _restSelectProps$getO === void 0 ? getOptionValue$1 : _restSelectProps$getO,
|
|
27864
27865
|
_restSelectProps$getO2 = restSelectProps.getOptionLabel,
|
|
@@ -27921,7 +27922,7 @@ var StateManagedSelect = /*#__PURE__*/React$5.forwardRef(function (props, ref) {
|
|
|
27921
27922
|
}, baseSelectProps));
|
|
27922
27923
|
});
|
|
27923
27924
|
|
|
27924
|
-
var _excluded$
|
|
27925
|
+
var _excluded$m = ["style", "indicatorStyle", "label", "icon", "className", "onClose", "disabled", "size", "type", "children"];
|
|
27925
27926
|
var SIZES$4 = {
|
|
27926
27927
|
small: "small",
|
|
27927
27928
|
large: "large"
|
|
@@ -27957,7 +27958,7 @@ var Tag = /*#__PURE__*/React$5.forwardRef(function (_ref, ref) {
|
|
|
27957
27958
|
_ref$type = _ref.type,
|
|
27958
27959
|
type = _ref$type === void 0 ? TYPES.outline : _ref$type,
|
|
27959
27960
|
children = _ref.children,
|
|
27960
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
27961
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$m);
|
|
27961
27962
|
var Icon = typeof icon === "string" ? function () {
|
|
27962
27963
|
return /*#__PURE__*/React__default["default"].createElement("i", {
|
|
27963
27964
|
className: icon
|
|
@@ -28000,7 +28001,7 @@ var Tag = /*#__PURE__*/React$5.forwardRef(function (_ref, ref) {
|
|
|
28000
28001
|
});
|
|
28001
28002
|
Tag.displayName = "Tag";
|
|
28002
28003
|
|
|
28003
|
-
var _excluded$
|
|
28004
|
+
var _excluded$l = ["children"],
|
|
28004
28005
|
_excluded2$2 = ["children"];
|
|
28005
28006
|
function ownKeys$e(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; }
|
|
28006
28007
|
function _objectSpread$e(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$e(Object(source), !0).forEach(function (key) { _defineProperty$7(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$e(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -28016,7 +28017,7 @@ var STYLES = {
|
|
|
28016
28017
|
};
|
|
28017
28018
|
var CustomControl = function CustomControl(_ref) {
|
|
28018
28019
|
var children = _ref.children,
|
|
28019
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
28020
|
+
props = _objectWithoutProperties$1(_ref, _excluded$l);
|
|
28020
28021
|
var prefix = props.selectProps.prefix;
|
|
28021
28022
|
return /*#__PURE__*/React__default["default"].createElement(components.Control, props, prefix && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
28022
28023
|
className: "neeto-ui-email-input__prefix"
|
|
@@ -28067,7 +28068,7 @@ var SelectContainer = function SelectContainer(props) {
|
|
|
28067
28068
|
innerProps: _objectSpread$e(_objectSpread$e({}, props.innerProps), {}, _defineProperty$7({}, "data-cy", "multi-email-select-container"))
|
|
28068
28069
|
}));
|
|
28069
28070
|
};
|
|
28070
|
-
var Input = function Input(props) {
|
|
28071
|
+
var Input$1 = function Input(props) {
|
|
28071
28072
|
return /*#__PURE__*/React__default["default"].createElement(components.Input, _extends$4({}, props, {
|
|
28072
28073
|
"data-cy": "email-select-input-field"
|
|
28073
28074
|
}));
|
|
@@ -28092,7 +28093,7 @@ var CUSTOM_COMPONENTS = {
|
|
|
28092
28093
|
ValueContainer: CustomValueContainer,
|
|
28093
28094
|
ClearIndicator: CustomClearIndicator,
|
|
28094
28095
|
SelectContainer: SelectContainer,
|
|
28095
|
-
Input: Input
|
|
28096
|
+
Input: Input$1
|
|
28096
28097
|
};
|
|
28097
28098
|
|
|
28098
28099
|
var formatEmailInputOptions = function formatEmailInputOptions(label) {
|
|
@@ -28121,7 +28122,7 @@ var renderDefaultText = function renderDefaultText(count) {
|
|
|
28121
28122
|
return count === 1 ? "email" : "emails";
|
|
28122
28123
|
};
|
|
28123
28124
|
|
|
28124
|
-
var _excluded$
|
|
28125
|
+
var _excluded$k = ["label", "placeholder", "helpText", "value", "onChange", "error", "onBlur", "filterInvalidEmails", "counter", "disabled", "maxHeight", "required", "labelProps", "visibleEmailsCount"];
|
|
28125
28126
|
function ownKeys$d(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; }
|
|
28126
28127
|
function _objectSpread$d(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$d(Object(source), !0).forEach(function (key) { _defineProperty$7(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$d(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
28127
28128
|
var MultiEmailInput = /*#__PURE__*/React$5.forwardRef(function (_ref, ref) {
|
|
@@ -28150,7 +28151,7 @@ var MultiEmailInput = /*#__PURE__*/React$5.forwardRef(function (_ref, ref) {
|
|
|
28150
28151
|
labelProps = _ref.labelProps,
|
|
28151
28152
|
_ref$visibleEmailsCou = _ref.visibleEmailsCount,
|
|
28152
28153
|
visibleEmailsCount = _ref$visibleEmailsCou === void 0 ? 3 : _ref$visibleEmailsCou,
|
|
28153
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
28154
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$k);
|
|
28154
28155
|
var _useState = React$5.useState(""),
|
|
28155
28156
|
_useState2 = _slicedToArray$2(_useState, 2),
|
|
28156
28157
|
inputValue = _useState2[0],
|
|
@@ -28287,7 +28288,7 @@ var renderImage = function renderImage(image) {
|
|
|
28287
28288
|
}) : image;
|
|
28288
28289
|
};
|
|
28289
28290
|
|
|
28290
|
-
var _excluded$
|
|
28291
|
+
var _excluded$j = ["image", "title", "description", "helpText", "className", "primaryButtonProps", "secondaryButtonProps", "buttonSeparatorText"];
|
|
28291
28292
|
var NoData = function NoData(_ref) {
|
|
28292
28293
|
var _ref$image = _ref.image,
|
|
28293
28294
|
image = _ref$image === void 0 ? null : _ref$image,
|
|
@@ -28305,7 +28306,7 @@ var NoData = function NoData(_ref) {
|
|
|
28305
28306
|
secondaryButtonProps = _ref$secondaryButtonP === void 0 ? {} : _ref$secondaryButtonP,
|
|
28306
28307
|
_ref$buttonSeparatorT = _ref.buttonSeparatorText,
|
|
28307
28308
|
buttonSeparatorText = _ref$buttonSeparatorT === void 0 ? "" : _ref$buttonSeparatorT,
|
|
28308
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
28309
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$j);
|
|
28309
28310
|
var hasPrimaryButtonProps = !isEmpty(primaryButtonProps);
|
|
28310
28311
|
var hasSecondaryButtonProps = !isEmpty(secondaryButtonProps);
|
|
28311
28312
|
var hasButtonSeparatorText = !isEmpty(buttonSeparatorText);
|
|
@@ -28521,7 +28522,7 @@ var getHeaderHeight = function getHeaderHeight(paneWrapper) {
|
|
|
28521
28522
|
return header ? header.offsetHeight : DEFAULT_PANE_HEADER_HEIGHT;
|
|
28522
28523
|
};
|
|
28523
28524
|
|
|
28524
|
-
var _excluded$
|
|
28525
|
+
var _excluded$i = ["size", "isOpen", "onClose", "children", "className", "closeOnEsc", "closeButton", "backdropClassName", "closeOnOutsideClick", "initialFocusRef", "finalFocusRef"];
|
|
28525
28526
|
var SIZES$3 = {
|
|
28526
28527
|
small: "small",
|
|
28527
28528
|
large: "large"
|
|
@@ -28546,7 +28547,7 @@ var Pane = function Pane(_ref) {
|
|
|
28546
28547
|
closeOnOutsideClick = _ref$closeOnOutsideCl === void 0 ? true : _ref$closeOnOutsideCl,
|
|
28547
28548
|
initialFocusRef = _ref.initialFocusRef,
|
|
28548
28549
|
finalFocusRef = _ref.finalFocusRef,
|
|
28549
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
28550
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$i);
|
|
28550
28551
|
var _useState = React$5.useState(false),
|
|
28551
28552
|
_useState2 = _slicedToArray$2(_useState, 2),
|
|
28552
28553
|
hasTransitionCompleted = _useState2[0],
|
|
@@ -28631,12 +28632,12 @@ var Title = function Title(_ref) {
|
|
|
28631
28632
|
}, children);
|
|
28632
28633
|
};
|
|
28633
28634
|
|
|
28634
|
-
var _excluded$
|
|
28635
|
+
var _excluded$h = ["children", "theme"];
|
|
28635
28636
|
var Popover = function Popover(_ref) {
|
|
28636
28637
|
var children = _ref.children,
|
|
28637
28638
|
_ref$theme = _ref.theme,
|
|
28638
28639
|
theme = _ref$theme === void 0 ? "light" : _ref$theme,
|
|
28639
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
28640
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$h);
|
|
28640
28641
|
return /*#__PURE__*/React__default["default"].createElement(Tooltip, _extends$4({
|
|
28641
28642
|
interactive: true,
|
|
28642
28643
|
arrow: false,
|
|
@@ -28647,7 +28648,7 @@ var Popover = function Popover(_ref) {
|
|
|
28647
28648
|
};
|
|
28648
28649
|
Popover.Title = Title;
|
|
28649
28650
|
|
|
28650
|
-
var _excluded$
|
|
28651
|
+
var _excluded$g = ["name", "label", "className", "labelProps"];
|
|
28651
28652
|
var Item$1 = function Item(_ref) {
|
|
28652
28653
|
var _ref$name = _ref.name,
|
|
28653
28654
|
name = _ref$name === void 0 ? "" : _ref$name,
|
|
@@ -28656,7 +28657,7 @@ var Item$1 = function Item(_ref) {
|
|
|
28656
28657
|
_ref$className = _ref.className,
|
|
28657
28658
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
28658
28659
|
labelProps = _ref.labelProps,
|
|
28659
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
28660
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$g);
|
|
28660
28661
|
var id = useId(otherProps.id);
|
|
28661
28662
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
28662
28663
|
className: classnames$1(["neeto-ui-radio__item", className])
|
|
@@ -28672,7 +28673,7 @@ var Item$1 = function Item(_ref) {
|
|
|
28672
28673
|
};
|
|
28673
28674
|
Item$1.displayName = "Radio.Item";
|
|
28674
28675
|
|
|
28675
|
-
var _excluded$
|
|
28676
|
+
var _excluded$f = ["label", "children", "stacked", "className", "containerClassName", "error", "onChange", "labelProps"];
|
|
28676
28677
|
function ownKeys$c(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; }
|
|
28677
28678
|
function _objectSpread$c(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$c(Object(source), !0).forEach(function (key) { _defineProperty$7(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$c(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
28678
28679
|
var Radio = function Radio(_ref) {
|
|
@@ -28689,7 +28690,7 @@ var Radio = function Radio(_ref) {
|
|
|
28689
28690
|
error = _ref$error === void 0 ? "" : _ref$error,
|
|
28690
28691
|
onChange = _ref.onChange,
|
|
28691
28692
|
labelProps = _ref.labelProps,
|
|
28692
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
28693
|
+
props = _objectWithoutProperties$1(_ref, _excluded$f);
|
|
28693
28694
|
var _useState = React$5.useState(""),
|
|
28694
28695
|
_useState2 = _slicedToArray$2(_useState, 2),
|
|
28695
28696
|
internalValue = _useState2[0],
|
|
@@ -28723,7 +28724,7 @@ var Radio = function Radio(_ref) {
|
|
|
28723
28724
|
};
|
|
28724
28725
|
Radio.Item = Item$1;
|
|
28725
28726
|
|
|
28726
|
-
var _excluded$
|
|
28727
|
+
var _excluded$e = ["defaultOptions", "cacheOptions", "loadOptions", "options", "isLoading", "onInputChange", "filterOption"];
|
|
28727
28728
|
function useAsync(_ref) {
|
|
28728
28729
|
var _ref$defaultOptions = _ref.defaultOptions,
|
|
28729
28730
|
propsDefaultOptions = _ref$defaultOptions === void 0 ? false : _ref$defaultOptions,
|
|
@@ -28736,7 +28737,7 @@ function useAsync(_ref) {
|
|
|
28736
28737
|
propsOnInputChange = _ref.onInputChange,
|
|
28737
28738
|
_ref$filterOption = _ref.filterOption,
|
|
28738
28739
|
filterOption = _ref$filterOption === void 0 ? null : _ref$filterOption,
|
|
28739
|
-
restSelectProps = _objectWithoutProperties(_ref, _excluded$
|
|
28740
|
+
restSelectProps = _objectWithoutProperties(_ref, _excluded$e);
|
|
28740
28741
|
var propsInputValue = restSelectProps.inputValue;
|
|
28741
28742
|
var lastRequest = React$5.useRef(undefined);
|
|
28742
28743
|
var mounted = React$5.useRef(false);
|
|
@@ -28895,7 +28896,7 @@ var Spinner = function Spinner(_ref) {
|
|
|
28895
28896
|
}));
|
|
28896
28897
|
};
|
|
28897
28898
|
|
|
28898
|
-
var _excluded$
|
|
28899
|
+
var _excluded$d = ["size", "label", "required", "error", "helpText", "className", "innerRef", "isCreateable", "strategy", "id", "labelProps", "value", "defaultValue", "components", "optionRemapping"];
|
|
28899
28900
|
function ownKeys$b(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; }
|
|
28900
28901
|
function _objectSpread$b(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$b(Object(source), !0).forEach(function (key) { _defineProperty$7(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$b(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
28901
28902
|
var SIZES$2 = {
|
|
@@ -29022,7 +29023,7 @@ var Select = function Select(_ref) {
|
|
|
29022
29023
|
componentOverrides = _ref.components,
|
|
29023
29024
|
_ref$optionRemapping = _ref.optionRemapping,
|
|
29024
29025
|
optionRemapping = _ref$optionRemapping === void 0 ? {} : _ref$optionRemapping,
|
|
29025
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
29026
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$d);
|
|
29026
29027
|
var inputId = useId(id);
|
|
29027
29028
|
var Parent = StateManagedSelect;
|
|
29028
29029
|
if (isCreateable) {
|
|
@@ -29111,7 +29112,7 @@ var Select = function Select(_ref) {
|
|
|
29111
29112
|
|
|
29112
29113
|
var NEETO_UI_PRIMARY_500 = "#4558f9";
|
|
29113
29114
|
|
|
29114
|
-
var _excluded$
|
|
29115
|
+
var _excluded$c = ["min", "max", "defaultValue", "onChange", "value", "label", "required", "labelProps", "error", "helpText"];
|
|
29115
29116
|
function ownKeys$a(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; }
|
|
29116
29117
|
function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$a(Object(source), !0).forEach(function (key) { _defineProperty$7(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$a(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29117
29118
|
var Slider = function Slider(_ref) {
|
|
@@ -29132,7 +29133,7 @@ var Slider = function Slider(_ref) {
|
|
|
29132
29133
|
labelProps = _ref$labelProps === void 0 ? {} : _ref$labelProps,
|
|
29133
29134
|
error = _ref.error,
|
|
29134
29135
|
helpText = _ref.helpText,
|
|
29135
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
29136
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$c);
|
|
29136
29137
|
var _id = React$5.useId();
|
|
29137
29138
|
var id = otherProps.id || _id;
|
|
29138
29139
|
var errorId = "error_".concat(id);
|
|
@@ -29195,7 +29196,7 @@ var Slider = function Slider(_ref) {
|
|
|
29195
29196
|
}, helpText)));
|
|
29196
29197
|
};
|
|
29197
29198
|
|
|
29198
|
-
var _excluded$
|
|
29199
|
+
var _excluded$b = ["label", "required", "className", "error", "onChange", "labelProps", "children"];
|
|
29199
29200
|
var Switch = /*#__PURE__*/React$5.forwardRef(function (_ref, ref) {
|
|
29200
29201
|
var _ref$label = _ref.label,
|
|
29201
29202
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
@@ -29209,7 +29210,7 @@ var Switch = /*#__PURE__*/React$5.forwardRef(function (_ref, ref) {
|
|
|
29209
29210
|
onChange = _ref$onChange === void 0 ? noop$2 : _ref$onChange,
|
|
29210
29211
|
labelProps = _ref.labelProps,
|
|
29211
29212
|
children = _ref.children,
|
|
29212
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
29213
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$b);
|
|
29213
29214
|
var id = useId(otherProps.id);
|
|
29214
29215
|
var errorId = "error_".concat(id);
|
|
29215
29216
|
var checked = otherProps.checked,
|
|
@@ -29255,7 +29256,7 @@ var Switch = /*#__PURE__*/React$5.forwardRef(function (_ref, ref) {
|
|
|
29255
29256
|
});
|
|
29256
29257
|
Switch.displayName = "Switch";
|
|
29257
29258
|
|
|
29258
|
-
var _excluded$
|
|
29259
|
+
var _excluded$a = ["active", "className", "children", "icon", "onClick", "activeClassName"];
|
|
29259
29260
|
function ownKeys$9(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; }
|
|
29260
29261
|
function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$9(Object(source), !0).forEach(function (key) { _defineProperty$7(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$9(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29261
29262
|
var Item = function Item(_ref) {
|
|
@@ -29269,7 +29270,7 @@ var Item = function Item(_ref) {
|
|
|
29269
29270
|
onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
29270
29271
|
_ref$activeClassName = _ref.activeClassName,
|
|
29271
29272
|
activeClassName = _ref$activeClassName === void 0 ? "" : _ref$activeClassName,
|
|
29272
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
29273
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$a);
|
|
29273
29274
|
var Icon = typeof icon === "string" ? function () {
|
|
29274
29275
|
return /*#__PURE__*/React__default["default"].createElement("i", {
|
|
29275
29276
|
className: icon,
|
|
@@ -29293,7 +29294,7 @@ var Item = function Item(_ref) {
|
|
|
29293
29294
|
};
|
|
29294
29295
|
Item.displayName = "Tab.Item";
|
|
29295
29296
|
|
|
29296
|
-
var _excluded$
|
|
29297
|
+
var _excluded$9 = ["size", "noUnderline", "children", "className"];
|
|
29297
29298
|
var SIZES$1 = {
|
|
29298
29299
|
large: "large",
|
|
29299
29300
|
small: "small"
|
|
@@ -29306,7 +29307,7 @@ var Tab = function Tab(_ref) {
|
|
|
29306
29307
|
children = _ref.children,
|
|
29307
29308
|
_ref$className = _ref.className,
|
|
29308
29309
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
29309
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
29310
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$9);
|
|
29310
29311
|
return /*#__PURE__*/React__default["default"].createElement("div", _extends$4({
|
|
29311
29312
|
"data-cy": "tab-container",
|
|
29312
29313
|
className: classnames$1({
|
|
@@ -29373,9 +29374,9 @@ var _isObject = function (it) {
|
|
|
29373
29374
|
return typeof it === 'object' ? it !== null : typeof it === 'function';
|
|
29374
29375
|
};
|
|
29375
29376
|
|
|
29376
|
-
var isObject$
|
|
29377
|
+
var isObject$5 = _isObject;
|
|
29377
29378
|
var _anObject = function (it) {
|
|
29378
|
-
if (!isObject$
|
|
29379
|
+
if (!isObject$5(it)) throw TypeError(it + ' is not an object!');
|
|
29379
29380
|
return it;
|
|
29380
29381
|
};
|
|
29381
29382
|
|
|
@@ -29421,15 +29422,15 @@ var _ie8DomDefine = !require_descriptors() && !_fails(function () {
|
|
|
29421
29422
|
});
|
|
29422
29423
|
|
|
29423
29424
|
// 7.1.1 ToPrimitive(input [, PreferredType])
|
|
29424
|
-
var isObject$
|
|
29425
|
+
var isObject$4 = _isObject;
|
|
29425
29426
|
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
|
|
29426
29427
|
// and the second argument - flag - preferred type is a string
|
|
29427
29428
|
var _toPrimitive = function (it, S) {
|
|
29428
|
-
if (!isObject$
|
|
29429
|
+
if (!isObject$4(it)) return it;
|
|
29429
29430
|
var fn, val;
|
|
29430
|
-
if (S && typeof (fn = it.toString) == 'function' && !isObject$
|
|
29431
|
-
if (typeof (fn = it.valueOf) == 'function' && !isObject$
|
|
29432
|
-
if (!S && typeof (fn = it.toString) == 'function' && !isObject$
|
|
29431
|
+
if (S && typeof (fn = it.toString) == 'function' && !isObject$4(val = fn.call(it))) return val;
|
|
29432
|
+
if (typeof (fn = it.valueOf) == 'function' && !isObject$4(val = fn.call(it))) return val;
|
|
29433
|
+
if (!S && typeof (fn = it.toString) == 'function' && !isObject$4(val = fn.call(it))) return val;
|
|
29433
29434
|
throw TypeError("Can't convert object to primitive value");
|
|
29434
29435
|
};
|
|
29435
29436
|
|
|
@@ -29475,9 +29476,9 @@ var _hide = require_descriptors() ? function (object, key, value) {
|
|
|
29475
29476
|
return object;
|
|
29476
29477
|
};
|
|
29477
29478
|
|
|
29478
|
-
var hasOwnProperty = {}.hasOwnProperty;
|
|
29479
|
+
var hasOwnProperty$1 = {}.hasOwnProperty;
|
|
29479
29480
|
var _has = function (it, key) {
|
|
29480
|
-
return hasOwnProperty.call(it, key);
|
|
29481
|
+
return hasOwnProperty$1.call(it, key);
|
|
29481
29482
|
};
|
|
29482
29483
|
|
|
29483
29484
|
var global$5 = _global.exports;
|
|
@@ -30049,7 +30050,7 @@ var symbol$1 = {exports: {}};
|
|
|
30049
30050
|
var _meta = {exports: {}};
|
|
30050
30051
|
|
|
30051
30052
|
var META$1 = _uid('meta');
|
|
30052
|
-
var isObject$
|
|
30053
|
+
var isObject$3 = _isObject;
|
|
30053
30054
|
var has$6 = _has;
|
|
30054
30055
|
var setDesc = require_objectDp().f;
|
|
30055
30056
|
var id = 0;
|
|
@@ -30067,7 +30068,7 @@ var setMeta = function (it) {
|
|
|
30067
30068
|
};
|
|
30068
30069
|
var fastKey = function (it, create) {
|
|
30069
30070
|
// return primitive with prefix
|
|
30070
|
-
if (!isObject$
|
|
30071
|
+
if (!isObject$3(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
|
30071
30072
|
if (!has$6(it, META$1)) {
|
|
30072
30073
|
// can't set metadata to uncaught frozen object
|
|
30073
30074
|
if (!isExtensible(it)) return 'F';
|
|
@@ -30224,7 +30225,7 @@ var wksDefine = _wksDefine;
|
|
|
30224
30225
|
var enumKeys = _enumKeys;
|
|
30225
30226
|
var isArray$4 = _isArray;
|
|
30226
30227
|
var anObject = _anObject;
|
|
30227
|
-
var isObject$
|
|
30228
|
+
var isObject$2 = _isObject;
|
|
30228
30229
|
var toObject$1 = _toObject;
|
|
30229
30230
|
var toIObject$1 = _toIobject;
|
|
30230
30231
|
var toPrimitive = _toPrimitive;
|
|
@@ -30434,7 +30435,7 @@ $JSON && $export$3($export$3.S + $export$3.F * (!USE_NATIVE || $fails(function (
|
|
|
30434
30435
|
var replacer, $replacer;
|
|
30435
30436
|
while (arguments.length > i) args.push(arguments[i++]);
|
|
30436
30437
|
$replacer = replacer = args[1];
|
|
30437
|
-
if (!isObject$
|
|
30438
|
+
if (!isObject$2(replacer) && it === undefined || isSymbol$1(it)) return; // IE8 returns string on undefined
|
|
30438
30439
|
if (!isArray$4(replacer)) replacer = function (key, value) {
|
|
30439
30440
|
if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
|
|
30440
30441
|
if (!isSymbol$1(value)) return value;
|
|
@@ -31122,12 +31123,12 @@ var cjs = {exports: {}};
|
|
|
31122
31123
|
|
|
31123
31124
|
var Draggable$1 = {};
|
|
31124
31125
|
|
|
31125
|
-
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
31126
|
+
function r$2(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r$2(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx$2(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r$2(e))&&(n&&(n+=" "),n+=t);return n}
|
|
31126
31127
|
|
|
31127
31128
|
var clsx_m = /*#__PURE__*/Object.freeze({
|
|
31128
31129
|
__proto__: null,
|
|
31129
|
-
clsx: clsx,
|
|
31130
|
-
'default': clsx
|
|
31130
|
+
clsx: clsx$2,
|
|
31131
|
+
'default': clsx$2
|
|
31131
31132
|
});
|
|
31132
31133
|
|
|
31133
31134
|
var require$$3 = /*@__PURE__*/getAugmentedNamespace(clsx_m);
|
|
@@ -31142,7 +31143,7 @@ Object.defineProperty(shims, "__esModule", {
|
|
|
31142
31143
|
shims.dontSetMe = dontSetMe;
|
|
31143
31144
|
shims.findInArray = findInArray;
|
|
31144
31145
|
shims.int = int;
|
|
31145
|
-
shims.isFunction = isFunction$
|
|
31146
|
+
shims.isFunction = isFunction$2;
|
|
31146
31147
|
shims.isNum = isNum;
|
|
31147
31148
|
|
|
31148
31149
|
// @credits https://gist.github.com/rogozhnikoff/a43cfed27c41e4e68cdc
|
|
@@ -31158,7 +31159,7 @@ function findInArray(array
|
|
|
31158
31159
|
}
|
|
31159
31160
|
}
|
|
31160
31161
|
|
|
31161
|
-
function isFunction$
|
|
31162
|
+
function isFunction$2(func
|
|
31162
31163
|
/*: any*/
|
|
31163
31164
|
)
|
|
31164
31165
|
/*: boolean %checks*/
|
|
@@ -33047,7 +33048,7 @@ var _utils = utils$3;
|
|
|
33047
33048
|
|
|
33048
33049
|
var _propTypes$1 = propTypes;
|
|
33049
33050
|
|
|
33050
|
-
var _excluded$
|
|
33051
|
+
var _excluded$8 = ["children", "className", "draggableOpts", "width", "height", "handle", "handleSize", "lockAspectRatio", "axis", "minConstraints", "maxConstraints", "onResize", "onResizeStop", "onResizeStart", "resizeHandles", "transformScale"];
|
|
33051
33052
|
|
|
33052
33053
|
function _getRequireWildcardCache$1(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache$1 = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33053
33054
|
|
|
@@ -33280,7 +33281,7 @@ var Resizable$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
33280
33281
|
_this$props2.onResizeStart;
|
|
33281
33282
|
var resizeHandles = _this$props2.resizeHandles;
|
|
33282
33283
|
_this$props2.transformScale;
|
|
33283
|
-
var p = _objectWithoutPropertiesLoose$1(_this$props2, _excluded$
|
|
33284
|
+
var p = _objectWithoutPropertiesLoose$1(_this$props2, _excluded$8); // What we're doing here is getting the child of this element, and cloning it with this element's props.
|
|
33284
33285
|
// We are then defining its children as:
|
|
33285
33286
|
// 1. Its original children (resizable's child's children), and
|
|
33286
33287
|
// 2. One or more draggable handles.
|
|
@@ -33332,7 +33333,7 @@ var _Resizable = _interopRequireDefault$3(Resizable$2);
|
|
|
33332
33333
|
|
|
33333
33334
|
var _propTypes2 = propTypes;
|
|
33334
33335
|
|
|
33335
|
-
var _excluded$
|
|
33336
|
+
var _excluded$7 = ["handle", "handleSize", "onResize", "onResizeStart", "onResizeStop", "draggableOpts", "minConstraints", "maxConstraints", "lockAspectRatio", "axis", "width", "height", "resizeHandles", "style", "transformScale"];
|
|
33336
33337
|
|
|
33337
33338
|
function _interopRequireDefault$3(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33338
33339
|
|
|
@@ -33425,7 +33426,7 @@ var ResizableBox = /*#__PURE__*/function (_React$Component) {
|
|
|
33425
33426
|
var resizeHandles = _this$props.resizeHandles,
|
|
33426
33427
|
style = _this$props.style,
|
|
33427
33428
|
transformScale = _this$props.transformScale,
|
|
33428
|
-
props = _objectWithoutPropertiesLoose(_this$props, _excluded$
|
|
33429
|
+
props = _objectWithoutPropertiesLoose(_this$props, _excluded$7);
|
|
33429
33430
|
|
|
33430
33431
|
return /*#__PURE__*/React$2.createElement(_Resizable.default, {
|
|
33431
33432
|
axis: axis,
|
|
@@ -33465,14 +33466,14 @@ reactResizable.exports = function() {
|
|
|
33465
33466
|
var Resizable = reactResizable.exports.Resizable = Resizable$2.default;
|
|
33466
33467
|
reactResizable.exports.ResizableBox = ResizableBox$1.default;
|
|
33467
33468
|
|
|
33468
|
-
var _excluded$
|
|
33469
|
+
var _excluded$6 = ["onResize", "width", "onResizeStop", "className"],
|
|
33469
33470
|
_excluded2$1 = ["onResize", "width", "onResizeStop"];
|
|
33470
33471
|
var HeaderCell = function HeaderCell(props) {
|
|
33471
33472
|
var onResize = props.onResize,
|
|
33472
33473
|
width = props.width,
|
|
33473
33474
|
onResizeStop = props.onResizeStop,
|
|
33474
33475
|
className = props.className,
|
|
33475
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
33476
|
+
restProps = _objectWithoutProperties$1(props, _excluded$6);
|
|
33476
33477
|
if (!width) {
|
|
33477
33478
|
return /*#__PURE__*/React__default["default"].createElement("th", _extends$4({}, restProps, {
|
|
33478
33479
|
className: "drag-handler"
|
|
@@ -34138,7 +34139,7 @@ var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
|
|
|
34138
34139
|
var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
|
|
34139
34140
|
var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
|
|
34140
34141
|
var booleanValueOf = Boolean.prototype.valueOf;
|
|
34141
|
-
var objectToString = Object.prototype.toString;
|
|
34142
|
+
var objectToString$1 = Object.prototype.toString;
|
|
34142
34143
|
var functionToString = Function.prototype.toString;
|
|
34143
34144
|
var $match = String.prototype.match;
|
|
34144
34145
|
var $slice = String.prototype.slice;
|
|
@@ -34357,7 +34358,7 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
|
|
|
34357
34358
|
if (isBoolean(obj)) {
|
|
34358
34359
|
return markBoxed(booleanValueOf.call(obj));
|
|
34359
34360
|
}
|
|
34360
|
-
if (isString$
|
|
34361
|
+
if (isString$3(obj)) {
|
|
34361
34362
|
return markBoxed(inspect(String(obj)));
|
|
34362
34363
|
}
|
|
34363
34364
|
if (!isDate(obj) && !isRegExp$2(obj)) {
|
|
@@ -34389,7 +34390,7 @@ function isArray$3(obj) { return toStr(obj) === '[object Array]' && (!toStringTa
|
|
|
34389
34390
|
function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
34390
34391
|
function isRegExp$2(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
34391
34392
|
function isError$1(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
34392
|
-
function isString$
|
|
34393
|
+
function isString$3(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
34393
34394
|
function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
34394
34395
|
function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
34395
34396
|
|
|
@@ -34428,7 +34429,7 @@ function has$3(obj, key) {
|
|
|
34428
34429
|
}
|
|
34429
34430
|
|
|
34430
34431
|
function toStr(obj) {
|
|
34431
|
-
return objectToString.call(obj);
|
|
34432
|
+
return objectToString$1.call(obj);
|
|
34432
34433
|
}
|
|
34433
34434
|
|
|
34434
34435
|
function nameOf(f) {
|
|
@@ -35722,7 +35723,7 @@ var useTableSort = function useTableSort() {
|
|
|
35722
35723
|
};
|
|
35723
35724
|
};
|
|
35724
35725
|
|
|
35725
|
-
var _excluded$
|
|
35726
|
+
var _excluded$5 = ["allowRowClick", "enableColumnResize", "enableColumnReorder", "className", "columnData", "currentPageNumber", "defaultPageSize", "handlePageChange", "loading", "onRowClick", "onRowSelect", "rowData", "totalCount", "selectedRowKeys", "fixedHeight", "paginationProps", "scroll", "rowSelection", "shouldDynamicallyRenderRowSize", "bordered", "onColumnUpdate", "components", "preserveTableStateInQuery"];
|
|
35726
35727
|
function ownKeys$2(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; }
|
|
35727
35728
|
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty$7(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
35728
35729
|
var TABLE_PAGINATION_HEIGHT = 64;
|
|
@@ -35771,7 +35772,7 @@ var Table = function Table(_ref) {
|
|
|
35771
35772
|
components = _ref$components === void 0 ? {} : _ref$components,
|
|
35772
35773
|
_ref$preserveTableSta = _ref.preserveTableStateInQuery,
|
|
35773
35774
|
preserveTableStateInQuery = _ref$preserveTableSta === void 0 ? false : _ref$preserveTableSta,
|
|
35774
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
35775
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$5);
|
|
35775
35776
|
var _useState = React$5.useState(null),
|
|
35776
35777
|
_useState2 = _slicedToArray$2(_useState, 2),
|
|
35777
35778
|
containerHeight = _useState2[0],
|
|
@@ -35969,7 +35970,7 @@ var Table = function Table(_ref) {
|
|
|
35969
35970
|
return renderTable();
|
|
35970
35971
|
};
|
|
35971
35972
|
|
|
35972
|
-
var _excluded$
|
|
35973
|
+
var _excluded$4 = ["size", "rows", "disabled", "required", "nakedTextarea", "helpText", "error", "label", "className", "maxLength", "unlimitedChars", "labelProps"];
|
|
35973
35974
|
var SIZES = {
|
|
35974
35975
|
small: "small",
|
|
35975
35976
|
medium: "medium",
|
|
@@ -35999,7 +36000,7 @@ var Textarea = /*#__PURE__*/React$5.forwardRef(function (_ref, ref) {
|
|
|
35999
36000
|
_ref$unlimitedChars = _ref.unlimitedChars,
|
|
36000
36001
|
unlimitedChars = _ref$unlimitedChars === void 0 ? false : _ref$unlimitedChars,
|
|
36001
36002
|
labelProps = _ref.labelProps,
|
|
36002
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
36003
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$4);
|
|
36003
36004
|
var _useState = React$5.useState(""),
|
|
36004
36005
|
_useState2 = _slicedToArray$2(_useState, 2),
|
|
36005
36006
|
valueInternal = _useState2[0],
|
|
@@ -36073,8 +36074,8 @@ var TIME_PICKER_TYPES = {
|
|
|
36073
36074
|
time: _DatePicker__default["default"]
|
|
36074
36075
|
};
|
|
36075
36076
|
|
|
36076
|
-
var _excluded$
|
|
36077
|
-
var INPUT_SIZES = {
|
|
36077
|
+
var _excluded$3 = ["className", "label", "size", "dropdownClassName", "popupClassName", "format", "interval", "onChange", "type", "nakedInput", "disabled", "error", "defaultValue", "value", "labelProps", "required"];
|
|
36078
|
+
var INPUT_SIZES$1 = {
|
|
36078
36079
|
small: "small",
|
|
36079
36080
|
medium: "medium",
|
|
36080
36081
|
large: "large"
|
|
@@ -36084,13 +36085,13 @@ var TIME_PICKER_INTERVAL = {
|
|
|
36084
36085
|
minuteStep: 1,
|
|
36085
36086
|
secondStep: 1
|
|
36086
36087
|
};
|
|
36087
|
-
var TimePicker = /*#__PURE__*/React$5.forwardRef(function (_ref, ref) {
|
|
36088
|
+
var TimePicker$1 = /*#__PURE__*/React$5.forwardRef(function (_ref, ref) {
|
|
36088
36089
|
var _ref$className = _ref.className,
|
|
36089
36090
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
36090
36091
|
_ref$label = _ref.label,
|
|
36091
36092
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
36092
36093
|
_ref$size = _ref.size,
|
|
36093
|
-
size = _ref$size === void 0 ? INPUT_SIZES.medium : _ref$size,
|
|
36094
|
+
size = _ref$size === void 0 ? INPUT_SIZES$1.medium : _ref$size,
|
|
36094
36095
|
_ref$dropdownClassNam = _ref.dropdownClassName,
|
|
36095
36096
|
dropdownClassName = _ref$dropdownClassNam === void 0 ? "" : _ref$dropdownClassNam,
|
|
36096
36097
|
_ref$popupClassName = _ref.popupClassName,
|
|
@@ -36114,7 +36115,7 @@ var TimePicker = /*#__PURE__*/React$5.forwardRef(function (_ref, ref) {
|
|
|
36114
36115
|
labelProps = _ref.labelProps,
|
|
36115
36116
|
_ref$required = _ref.required,
|
|
36116
36117
|
required = _ref$required === void 0 ? false : _ref$required,
|
|
36117
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
36118
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$3);
|
|
36118
36119
|
var id = useId(otherProps.id);
|
|
36119
36120
|
var timePickerRef = useSyncedRef(ref);
|
|
36120
36121
|
var Component = TIME_PICKER_TYPES[type.toLowerCase()];
|
|
@@ -36187,7 +36188,2637 @@ var TimePicker = /*#__PURE__*/React$5.forwardRef(function (_ref, ref) {
|
|
|
36187
36188
|
id: errorId
|
|
36188
36189
|
}, error));
|
|
36189
36190
|
});
|
|
36190
|
-
TimePicker.displayName = "TimePicker";
|
|
36191
|
+
TimePicker$1.displayName = "TimePicker";
|
|
36192
|
+
|
|
36193
|
+
var customParseFormat$1 = {exports: {}};
|
|
36194
|
+
|
|
36195
|
+
(function (module, exports) {
|
|
36196
|
+
!function(e,t){module.exports=t();}(commonjsGlobal,(function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d\d/,r=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return (e=+e)+(e>68?1900:2e3)};var a=function(e){return function(t){this[e]=+t;}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e);}],h=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},u=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},d={A:[i,function(e){this.afternoon=u(e,!1);}],a:[i,function(e){this.afternoon=u(e,!0);}],S:[/\d/,function(e){this.milliseconds=100*+e;}],SS:[n,function(e){this.milliseconds=10*+e;}],SSS:[/\d{3}/,function(e){this.milliseconds=+e;}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[i,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r);}],M:[r,a("month")],MM:[n,a("month")],MMM:[i,function(e){var t=h("months"),n=(h("monthsShort")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n;}],MMMM:[i,function(e){var t=h("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t;}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(e){this.year=s(e);}],YYYY:[/\d{4}/,a("year")],Z:f,ZZ:f};function c(n){var r,i;r=n,i=o&&o.formats;for(var s=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),a=s.length,f=0;f<a;f+=1){var h=s[f],u=d[h],c=u&&u[0],l=u&&u[1];s[f]=l?{regex:c,parser:l}:h.replace(/^\[|\]$/g,"");}return function(e){for(var t={},n=0,r=0;n<a;n+=1){var i=s[n];if("string"==typeof i)r+=i.length;else {var o=i.regex,f=i.parser,h=e.slice(r),u=o.exec(h)[0];f.call(t,u),e=e.replace(u,"");}}return function(e){var t=e.afternoon;if(void 0!==t){var n=e.hours;t?n<12&&(e.hours+=12):12===n&&(e.hours=0),delete e.afternoon;}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,s=e.args;this.$u=r;var a=s[1];if("string"==typeof a){var f=!0===s[2],h=!0===s[3],u=f||h,d=s[2];h&&(d=s[2]),o=this.$locale(),!f&&d&&(o=n.Ls[d]),this.$d=function(e,t,n){try{if(["x","X"].indexOf(t)>-1)return new Date(("X"===t?1e3:1)*e);var r=c(t)(e),i=r.year,o=r.month,s=r.day,a=r.hours,f=r.minutes,h=r.seconds,u=r.milliseconds,d=r.zone,l=new Date,m=s||(i||o?1:l.getDate()),M=i||l.getFullYear(),Y=0;i&&!o||(Y=o>0?o-1:l.getMonth());var p=a||0,v=f||0,D=h||0,g=u||0;return d?new Date(Date.UTC(M,Y,m,p,v,D,g+60*d.offset*1e3)):n?new Date(Date.UTC(M,Y,m,p,v,D,g)):new Date(M,Y,m,p,v,D,g)}catch(e){return new Date("")}}(t,a,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(a)&&(this.$d=new Date("")),o={};}else if(a instanceof Array)for(var l=a.length,m=1;m<=l;m+=1){s[1]=a[m-1];var M=n.apply(this,s);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}m===l&&(this.$d=new Date(""));}else i.call(this,e);};}}));
|
|
36197
|
+
} (customParseFormat$1));
|
|
36198
|
+
|
|
36199
|
+
var customParseFormat = customParseFormat$1.exports;
|
|
36200
|
+
|
|
36201
|
+
var __spreadArray$2 = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
|
36202
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
36203
|
+
if (ar || !(i in from)) {
|
|
36204
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
36205
|
+
ar[i] = from[i];
|
|
36206
|
+
}
|
|
36207
|
+
}
|
|
36208
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
36209
|
+
};
|
|
36210
|
+
// As defined on the list of supported events: https://reactjs.org/docs/events.html
|
|
36211
|
+
var clipboardEvents = ['onCopy', 'onCut', 'onPaste'];
|
|
36212
|
+
var compositionEvents = [
|
|
36213
|
+
'onCompositionEnd',
|
|
36214
|
+
'onCompositionStart',
|
|
36215
|
+
'onCompositionUpdate',
|
|
36216
|
+
];
|
|
36217
|
+
var focusEvents = ['onFocus', 'onBlur'];
|
|
36218
|
+
var formEvents = ['onInput', 'onInvalid', 'onReset', 'onSubmit'];
|
|
36219
|
+
var imageEvents = ['onLoad', 'onError'];
|
|
36220
|
+
var keyboardEvents = ['onKeyDown', 'onKeyPress', 'onKeyUp'];
|
|
36221
|
+
var mediaEvents = [
|
|
36222
|
+
'onAbort',
|
|
36223
|
+
'onCanPlay',
|
|
36224
|
+
'onCanPlayThrough',
|
|
36225
|
+
'onDurationChange',
|
|
36226
|
+
'onEmptied',
|
|
36227
|
+
'onEncrypted',
|
|
36228
|
+
'onEnded',
|
|
36229
|
+
'onError',
|
|
36230
|
+
'onLoadedData',
|
|
36231
|
+
'onLoadedMetadata',
|
|
36232
|
+
'onLoadStart',
|
|
36233
|
+
'onPause',
|
|
36234
|
+
'onPlay',
|
|
36235
|
+
'onPlaying',
|
|
36236
|
+
'onProgress',
|
|
36237
|
+
'onRateChange',
|
|
36238
|
+
'onSeeked',
|
|
36239
|
+
'onSeeking',
|
|
36240
|
+
'onStalled',
|
|
36241
|
+
'onSuspend',
|
|
36242
|
+
'onTimeUpdate',
|
|
36243
|
+
'onVolumeChange',
|
|
36244
|
+
'onWaiting',
|
|
36245
|
+
];
|
|
36246
|
+
var mouseEvents = [
|
|
36247
|
+
'onClick',
|
|
36248
|
+
'onContextMenu',
|
|
36249
|
+
'onDoubleClick',
|
|
36250
|
+
'onMouseDown',
|
|
36251
|
+
'onMouseEnter',
|
|
36252
|
+
'onMouseLeave',
|
|
36253
|
+
'onMouseMove',
|
|
36254
|
+
'onMouseOut',
|
|
36255
|
+
'onMouseOver',
|
|
36256
|
+
'onMouseUp',
|
|
36257
|
+
];
|
|
36258
|
+
var dragEvents = [
|
|
36259
|
+
'onDrag',
|
|
36260
|
+
'onDragEnd',
|
|
36261
|
+
'onDragEnter',
|
|
36262
|
+
'onDragExit',
|
|
36263
|
+
'onDragLeave',
|
|
36264
|
+
'onDragOver',
|
|
36265
|
+
'onDragStart',
|
|
36266
|
+
'onDrop',
|
|
36267
|
+
];
|
|
36268
|
+
var selectionEvents = ['onSelect'];
|
|
36269
|
+
var touchEvents = ['onTouchCancel', 'onTouchEnd', 'onTouchMove', 'onTouchStart'];
|
|
36270
|
+
var pointerEvents = [
|
|
36271
|
+
'onPointerDown',
|
|
36272
|
+
'onPointerMove',
|
|
36273
|
+
'onPointerUp',
|
|
36274
|
+
'onPointerCancel',
|
|
36275
|
+
'onGotPointerCapture',
|
|
36276
|
+
'onLostPointerCapture',
|
|
36277
|
+
'onPointerEnter',
|
|
36278
|
+
'onPointerLeave',
|
|
36279
|
+
'onPointerOver',
|
|
36280
|
+
'onPointerOut',
|
|
36281
|
+
];
|
|
36282
|
+
var uiEvents = ['onScroll'];
|
|
36283
|
+
var wheelEvents = ['onWheel'];
|
|
36284
|
+
var animationEvents = [
|
|
36285
|
+
'onAnimationStart',
|
|
36286
|
+
'onAnimationEnd',
|
|
36287
|
+
'onAnimationIteration',
|
|
36288
|
+
];
|
|
36289
|
+
var transitionEvents = ['onTransitionEnd'];
|
|
36290
|
+
var otherEvents = ['onToggle'];
|
|
36291
|
+
var changeEvents = ['onChange'];
|
|
36292
|
+
var allEvents = __spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2(__spreadArray$2([], clipboardEvents, true), compositionEvents, true), focusEvents, true), formEvents, true), imageEvents, true), keyboardEvents, true), mediaEvents, true), mouseEvents, true), dragEvents, true), selectionEvents, true), touchEvents, true), pointerEvents, true), uiEvents, true), wheelEvents, true), animationEvents, true), transitionEvents, true), changeEvents, true), otherEvents, true);
|
|
36293
|
+
/**
|
|
36294
|
+
* Returns an object with on-event callback props curried with provided args.
|
|
36295
|
+
* @param {Object} props Props passed to a component.
|
|
36296
|
+
* @param {Function=} getArgs A function that returns argument(s) on-event callbacks
|
|
36297
|
+
* shall be curried with.
|
|
36298
|
+
*/
|
|
36299
|
+
function makeEventProps(props, getArgs) {
|
|
36300
|
+
var eventProps = {};
|
|
36301
|
+
allEvents.forEach(function (eventName) {
|
|
36302
|
+
var eventHandler = props[eventName];
|
|
36303
|
+
if (!eventHandler) {
|
|
36304
|
+
return;
|
|
36305
|
+
}
|
|
36306
|
+
if (getArgs) {
|
|
36307
|
+
eventProps[eventName] = (function (event) {
|
|
36308
|
+
return eventHandler(event, getArgs(eventName));
|
|
36309
|
+
});
|
|
36310
|
+
}
|
|
36311
|
+
else {
|
|
36312
|
+
eventProps[eventName] = eventHandler;
|
|
36313
|
+
}
|
|
36314
|
+
});
|
|
36315
|
+
return eventProps;
|
|
36316
|
+
}
|
|
36317
|
+
|
|
36318
|
+
function r$1(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r$1(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx$1(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r$1(e))&&(n&&(n+=" "),n+=t);return n}
|
|
36319
|
+
|
|
36320
|
+
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
36321
|
+
|
|
36322
|
+
/**
|
|
36323
|
+
* Utils
|
|
36324
|
+
*/
|
|
36325
|
+
/**
|
|
36326
|
+
* Gets hours from a given date.
|
|
36327
|
+
*
|
|
36328
|
+
* @param {Date | string} date Date to get hours from
|
|
36329
|
+
* @returns {number} Hours
|
|
36330
|
+
*/
|
|
36331
|
+
function getHours(date) {
|
|
36332
|
+
if (date instanceof Date) {
|
|
36333
|
+
return date.getHours();
|
|
36334
|
+
}
|
|
36335
|
+
if (typeof date === 'string') {
|
|
36336
|
+
var datePieces = date.split(':');
|
|
36337
|
+
if (datePieces.length >= 2) {
|
|
36338
|
+
var hoursString = datePieces[0];
|
|
36339
|
+
if (hoursString) {
|
|
36340
|
+
var hours = parseInt(hoursString, 10);
|
|
36341
|
+
if (!isNaN(hours)) {
|
|
36342
|
+
return hours;
|
|
36343
|
+
}
|
|
36344
|
+
}
|
|
36345
|
+
}
|
|
36346
|
+
}
|
|
36347
|
+
throw new Error("Failed to get hours from date: ".concat(date, "."));
|
|
36348
|
+
}
|
|
36349
|
+
/**
|
|
36350
|
+
* Gets minutes from a given date.
|
|
36351
|
+
*
|
|
36352
|
+
* @param {Date | string} date Date to get minutes from
|
|
36353
|
+
* @returns {number} Minutes
|
|
36354
|
+
*/
|
|
36355
|
+
function getMinutes(date) {
|
|
36356
|
+
if (date instanceof Date) {
|
|
36357
|
+
return date.getMinutes();
|
|
36358
|
+
}
|
|
36359
|
+
if (typeof date === 'string') {
|
|
36360
|
+
var datePieces = date.split(':');
|
|
36361
|
+
if (datePieces.length >= 2) {
|
|
36362
|
+
var minutesString = datePieces[1] || '0';
|
|
36363
|
+
var minutes = parseInt(minutesString, 10);
|
|
36364
|
+
if (!isNaN(minutes)) {
|
|
36365
|
+
return minutes;
|
|
36366
|
+
}
|
|
36367
|
+
}
|
|
36368
|
+
}
|
|
36369
|
+
throw new Error("Failed to get minutes from date: ".concat(date, "."));
|
|
36370
|
+
}
|
|
36371
|
+
/**
|
|
36372
|
+
* Gets seconds from a given date.
|
|
36373
|
+
*
|
|
36374
|
+
* @param {Date | string} date Date to get seconds from
|
|
36375
|
+
* @returns {number} Seconds
|
|
36376
|
+
*/
|
|
36377
|
+
function getSeconds(date) {
|
|
36378
|
+
if (date instanceof Date) {
|
|
36379
|
+
return date.getSeconds();
|
|
36380
|
+
}
|
|
36381
|
+
if (typeof date === 'string') {
|
|
36382
|
+
var datePieces = date.split(':');
|
|
36383
|
+
if (datePieces.length >= 2) {
|
|
36384
|
+
var secondsWithMillisecondsString = datePieces[2] || '0';
|
|
36385
|
+
var seconds = parseInt(secondsWithMillisecondsString, 10);
|
|
36386
|
+
if (!isNaN(seconds)) {
|
|
36387
|
+
return seconds;
|
|
36388
|
+
}
|
|
36389
|
+
}
|
|
36390
|
+
}
|
|
36391
|
+
throw new Error("Failed to get seconds from date: ".concat(date, "."));
|
|
36392
|
+
}
|
|
36393
|
+
/**
|
|
36394
|
+
* Gets milliseconds from a given date.
|
|
36395
|
+
*
|
|
36396
|
+
* @param {Date | string} date Date to get milliseconds from
|
|
36397
|
+
* @returns {number} Milliseconds
|
|
36398
|
+
*/
|
|
36399
|
+
function getMilliseconds(date) {
|
|
36400
|
+
if (date instanceof Date) {
|
|
36401
|
+
return date.getMilliseconds();
|
|
36402
|
+
}
|
|
36403
|
+
if (typeof date === 'string') {
|
|
36404
|
+
var datePieces = date.split(':');
|
|
36405
|
+
if (datePieces.length >= 2) {
|
|
36406
|
+
var secondsWithMillisecondsString = datePieces[2] || '0';
|
|
36407
|
+
var millisecondsString = secondsWithMillisecondsString.split('.')[1] || '0';
|
|
36408
|
+
var milliseconds = parseInt(millisecondsString, 10);
|
|
36409
|
+
if (!isNaN(milliseconds)) {
|
|
36410
|
+
return milliseconds;
|
|
36411
|
+
}
|
|
36412
|
+
}
|
|
36413
|
+
}
|
|
36414
|
+
throw new Error("Failed to get seconds from date: ".concat(date, "."));
|
|
36415
|
+
}
|
|
36416
|
+
function padStart(num, val) {
|
|
36417
|
+
if (val === void 0) { val = 2; }
|
|
36418
|
+
var numStr = "".concat(num);
|
|
36419
|
+
if (numStr.length >= val) {
|
|
36420
|
+
return num;
|
|
36421
|
+
}
|
|
36422
|
+
return "0000".concat(numStr).slice(-val);
|
|
36423
|
+
}
|
|
36424
|
+
/**
|
|
36425
|
+
* Returns local hours and minutes (hh:mm).
|
|
36426
|
+
*
|
|
36427
|
+
* @param {Date | string} date Date to get hours and minutes from
|
|
36428
|
+
* @returns {string} Local hours and minutes
|
|
36429
|
+
*/
|
|
36430
|
+
function getHoursMinutes(date) {
|
|
36431
|
+
var hours = padStart(getHours(date));
|
|
36432
|
+
var minutes = padStart(getMinutes(date));
|
|
36433
|
+
return "".concat(hours, ":").concat(minutes);
|
|
36434
|
+
}
|
|
36435
|
+
/**
|
|
36436
|
+
* Returns local hours, minutes and seconds (hh:mm:ss).
|
|
36437
|
+
*
|
|
36438
|
+
* @param {Date | string} date Date to get hours, minutes and seconds from
|
|
36439
|
+
* @returns {string} Local hours, minutes and seconds
|
|
36440
|
+
*/
|
|
36441
|
+
function getHoursMinutesSeconds(date) {
|
|
36442
|
+
var hours = padStart(getHours(date));
|
|
36443
|
+
var minutes = padStart(getMinutes(date));
|
|
36444
|
+
var seconds = padStart(getSeconds(date));
|
|
36445
|
+
return "".concat(hours, ":").concat(minutes, ":").concat(seconds);
|
|
36446
|
+
}
|
|
36447
|
+
|
|
36448
|
+
function Hand(_a) {
|
|
36449
|
+
var _b = _a.angle, angle = _b === void 0 ? 0 : _b, name = _a.name, _c = _a.length, length = _c === void 0 ? 100 : _c, _d = _a.oppositeLength, oppositeLength = _d === void 0 ? 10 : _d, _e = _a.width, width = _e === void 0 ? 1 : _e;
|
|
36450
|
+
return (React__default["default"].createElement("div", { className: "react-clock__hand react-clock__".concat(name, "-hand"), style: {
|
|
36451
|
+
transform: "rotate(".concat(angle, "deg)"),
|
|
36452
|
+
} },
|
|
36453
|
+
React__default["default"].createElement("div", { className: "react-clock__hand__body react-clock__".concat(name, "-hand__body"), style: {
|
|
36454
|
+
width: "".concat(width, "px"),
|
|
36455
|
+
top: "".concat(50 - length / 2, "%"),
|
|
36456
|
+
bottom: "".concat(50 - oppositeLength / 2, "%"),
|
|
36457
|
+
} })));
|
|
36458
|
+
}
|
|
36459
|
+
|
|
36460
|
+
function Mark(_a) {
|
|
36461
|
+
var _b = _a.angle, angle = _b === void 0 ? 0 : _b, _c = _a.length, length = _c === void 0 ? 10 : _c, name = _a.name, _d = _a.width, width = _d === void 0 ? 1 : _d, number = _a.number;
|
|
36462
|
+
return (React__default["default"].createElement("div", { className: "react-clock__mark react-clock__".concat(name, "-mark"), style: {
|
|
36463
|
+
transform: "rotate(".concat(angle, "deg)"),
|
|
36464
|
+
} },
|
|
36465
|
+
React__default["default"].createElement("div", { className: "react-clock__mark__body react-clock__".concat(name, "-mark__body"), style: {
|
|
36466
|
+
width: "".concat(width, "px"),
|
|
36467
|
+
top: 0,
|
|
36468
|
+
bottom: "".concat(100 - length / 2, "%"),
|
|
36469
|
+
} }),
|
|
36470
|
+
number ? (React__default["default"].createElement("div", { className: "react-clock__mark__number", style: {
|
|
36471
|
+
transform: "rotate(-".concat(angle, "deg)"),
|
|
36472
|
+
top: "".concat(length / 2, "%"),
|
|
36473
|
+
} }, number)) : null));
|
|
36474
|
+
}
|
|
36475
|
+
|
|
36476
|
+
var __assign$8 = (undefined && undefined.__assign) || function () {
|
|
36477
|
+
__assign$8 = Object.assign || function(t) {
|
|
36478
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
36479
|
+
s = arguments[i];
|
|
36480
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
36481
|
+
t[p] = s[p];
|
|
36482
|
+
}
|
|
36483
|
+
return t;
|
|
36484
|
+
};
|
|
36485
|
+
return __assign$8.apply(this, arguments);
|
|
36486
|
+
};
|
|
36487
|
+
var MinuteMark = React$5.memo(function MinuteMark(props) {
|
|
36488
|
+
return React__default["default"].createElement(Mark, __assign$8({}, props));
|
|
36489
|
+
});
|
|
36490
|
+
|
|
36491
|
+
/**
|
|
36492
|
+
* lodash (Custom Build) <https://lodash.com/>
|
|
36493
|
+
* Build: `lodash modularize exports="npm" -o ./`
|
|
36494
|
+
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
|
36495
|
+
* Released under MIT license <https://lodash.com/license>
|
|
36496
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
36497
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
36498
|
+
*/
|
|
36499
|
+
|
|
36500
|
+
/** Used as the `TypeError` message for "Functions" methods. */
|
|
36501
|
+
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
36502
|
+
|
|
36503
|
+
/** Used to stand-in for `undefined` hash values. */
|
|
36504
|
+
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
36505
|
+
|
|
36506
|
+
/** `Object#toString` result references. */
|
|
36507
|
+
var funcTag = '[object Function]',
|
|
36508
|
+
genTag = '[object GeneratorFunction]';
|
|
36509
|
+
|
|
36510
|
+
/**
|
|
36511
|
+
* Used to match `RegExp`
|
|
36512
|
+
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
36513
|
+
*/
|
|
36514
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
36515
|
+
|
|
36516
|
+
/** Used to detect host constructors (Safari). */
|
|
36517
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
36518
|
+
|
|
36519
|
+
/** Detect free variable `global` from Node.js. */
|
|
36520
|
+
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
36521
|
+
|
|
36522
|
+
/** Detect free variable `self`. */
|
|
36523
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
36524
|
+
|
|
36525
|
+
/** Used as a reference to the global object. */
|
|
36526
|
+
var root = freeGlobal || freeSelf || Function('return this')();
|
|
36527
|
+
|
|
36528
|
+
/**
|
|
36529
|
+
* Gets the value at `key` of `object`.
|
|
36530
|
+
*
|
|
36531
|
+
* @private
|
|
36532
|
+
* @param {Object} [object] The object to query.
|
|
36533
|
+
* @param {string} key The key of the property to get.
|
|
36534
|
+
* @returns {*} Returns the property value.
|
|
36535
|
+
*/
|
|
36536
|
+
function getValue(object, key) {
|
|
36537
|
+
return object == null ? undefined : object[key];
|
|
36538
|
+
}
|
|
36539
|
+
|
|
36540
|
+
/**
|
|
36541
|
+
* Checks if `value` is a host object in IE < 9.
|
|
36542
|
+
*
|
|
36543
|
+
* @private
|
|
36544
|
+
* @param {*} value The value to check.
|
|
36545
|
+
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
|
|
36546
|
+
*/
|
|
36547
|
+
function isHostObject(value) {
|
|
36548
|
+
// Many host objects are `Object` objects that can coerce to strings
|
|
36549
|
+
// despite having improperly defined `toString` methods.
|
|
36550
|
+
var result = false;
|
|
36551
|
+
if (value != null && typeof value.toString != 'function') {
|
|
36552
|
+
try {
|
|
36553
|
+
result = !!(value + '');
|
|
36554
|
+
} catch (e) {}
|
|
36555
|
+
}
|
|
36556
|
+
return result;
|
|
36557
|
+
}
|
|
36558
|
+
|
|
36559
|
+
/** Used for built-in method references. */
|
|
36560
|
+
var arrayProto = Array.prototype,
|
|
36561
|
+
funcProto = Function.prototype,
|
|
36562
|
+
objectProto = Object.prototype;
|
|
36563
|
+
|
|
36564
|
+
/** Used to detect overreaching core-js shims. */
|
|
36565
|
+
var coreJsData = root['__core-js_shared__'];
|
|
36566
|
+
|
|
36567
|
+
/** Used to detect methods masquerading as native. */
|
|
36568
|
+
var maskSrcKey = (function() {
|
|
36569
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
|
36570
|
+
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
36571
|
+
}());
|
|
36572
|
+
|
|
36573
|
+
/** Used to resolve the decompiled source of functions. */
|
|
36574
|
+
var funcToString = funcProto.toString;
|
|
36575
|
+
|
|
36576
|
+
/** Used to check objects for own properties. */
|
|
36577
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
36578
|
+
|
|
36579
|
+
/**
|
|
36580
|
+
* Used to resolve the
|
|
36581
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
36582
|
+
* of values.
|
|
36583
|
+
*/
|
|
36584
|
+
var objectToString = objectProto.toString;
|
|
36585
|
+
|
|
36586
|
+
/** Used to detect if a method is native. */
|
|
36587
|
+
var reIsNative = RegExp('^' +
|
|
36588
|
+
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
|
|
36589
|
+
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
36590
|
+
);
|
|
36591
|
+
|
|
36592
|
+
/** Built-in value references. */
|
|
36593
|
+
var splice = arrayProto.splice;
|
|
36594
|
+
|
|
36595
|
+
/* Built-in method references that are verified to be native. */
|
|
36596
|
+
var Map$1 = getNative(root, 'Map'),
|
|
36597
|
+
nativeCreate = getNative(Object, 'create');
|
|
36598
|
+
|
|
36599
|
+
/**
|
|
36600
|
+
* Creates a hash object.
|
|
36601
|
+
*
|
|
36602
|
+
* @private
|
|
36603
|
+
* @constructor
|
|
36604
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
36605
|
+
*/
|
|
36606
|
+
function Hash(entries) {
|
|
36607
|
+
var index = -1,
|
|
36608
|
+
length = entries ? entries.length : 0;
|
|
36609
|
+
|
|
36610
|
+
this.clear();
|
|
36611
|
+
while (++index < length) {
|
|
36612
|
+
var entry = entries[index];
|
|
36613
|
+
this.set(entry[0], entry[1]);
|
|
36614
|
+
}
|
|
36615
|
+
}
|
|
36616
|
+
|
|
36617
|
+
/**
|
|
36618
|
+
* Removes all key-value entries from the hash.
|
|
36619
|
+
*
|
|
36620
|
+
* @private
|
|
36621
|
+
* @name clear
|
|
36622
|
+
* @memberOf Hash
|
|
36623
|
+
*/
|
|
36624
|
+
function hashClear() {
|
|
36625
|
+
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
36626
|
+
}
|
|
36627
|
+
|
|
36628
|
+
/**
|
|
36629
|
+
* Removes `key` and its value from the hash.
|
|
36630
|
+
*
|
|
36631
|
+
* @private
|
|
36632
|
+
* @name delete
|
|
36633
|
+
* @memberOf Hash
|
|
36634
|
+
* @param {Object} hash The hash to modify.
|
|
36635
|
+
* @param {string} key The key of the value to remove.
|
|
36636
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
36637
|
+
*/
|
|
36638
|
+
function hashDelete(key) {
|
|
36639
|
+
return this.has(key) && delete this.__data__[key];
|
|
36640
|
+
}
|
|
36641
|
+
|
|
36642
|
+
/**
|
|
36643
|
+
* Gets the hash value for `key`.
|
|
36644
|
+
*
|
|
36645
|
+
* @private
|
|
36646
|
+
* @name get
|
|
36647
|
+
* @memberOf Hash
|
|
36648
|
+
* @param {string} key The key of the value to get.
|
|
36649
|
+
* @returns {*} Returns the entry value.
|
|
36650
|
+
*/
|
|
36651
|
+
function hashGet(key) {
|
|
36652
|
+
var data = this.__data__;
|
|
36653
|
+
if (nativeCreate) {
|
|
36654
|
+
var result = data[key];
|
|
36655
|
+
return result === HASH_UNDEFINED ? undefined : result;
|
|
36656
|
+
}
|
|
36657
|
+
return hasOwnProperty.call(data, key) ? data[key] : undefined;
|
|
36658
|
+
}
|
|
36659
|
+
|
|
36660
|
+
/**
|
|
36661
|
+
* Checks if a hash value for `key` exists.
|
|
36662
|
+
*
|
|
36663
|
+
* @private
|
|
36664
|
+
* @name has
|
|
36665
|
+
* @memberOf Hash
|
|
36666
|
+
* @param {string} key The key of the entry to check.
|
|
36667
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
36668
|
+
*/
|
|
36669
|
+
function hashHas(key) {
|
|
36670
|
+
var data = this.__data__;
|
|
36671
|
+
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
|
|
36672
|
+
}
|
|
36673
|
+
|
|
36674
|
+
/**
|
|
36675
|
+
* Sets the hash `key` to `value`.
|
|
36676
|
+
*
|
|
36677
|
+
* @private
|
|
36678
|
+
* @name set
|
|
36679
|
+
* @memberOf Hash
|
|
36680
|
+
* @param {string} key The key of the value to set.
|
|
36681
|
+
* @param {*} value The value to set.
|
|
36682
|
+
* @returns {Object} Returns the hash instance.
|
|
36683
|
+
*/
|
|
36684
|
+
function hashSet(key, value) {
|
|
36685
|
+
var data = this.__data__;
|
|
36686
|
+
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
36687
|
+
return this;
|
|
36688
|
+
}
|
|
36689
|
+
|
|
36690
|
+
// Add methods to `Hash`.
|
|
36691
|
+
Hash.prototype.clear = hashClear;
|
|
36692
|
+
Hash.prototype['delete'] = hashDelete;
|
|
36693
|
+
Hash.prototype.get = hashGet;
|
|
36694
|
+
Hash.prototype.has = hashHas;
|
|
36695
|
+
Hash.prototype.set = hashSet;
|
|
36696
|
+
|
|
36697
|
+
/**
|
|
36698
|
+
* Creates an list cache object.
|
|
36699
|
+
*
|
|
36700
|
+
* @private
|
|
36701
|
+
* @constructor
|
|
36702
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
36703
|
+
*/
|
|
36704
|
+
function ListCache(entries) {
|
|
36705
|
+
var index = -1,
|
|
36706
|
+
length = entries ? entries.length : 0;
|
|
36707
|
+
|
|
36708
|
+
this.clear();
|
|
36709
|
+
while (++index < length) {
|
|
36710
|
+
var entry = entries[index];
|
|
36711
|
+
this.set(entry[0], entry[1]);
|
|
36712
|
+
}
|
|
36713
|
+
}
|
|
36714
|
+
|
|
36715
|
+
/**
|
|
36716
|
+
* Removes all key-value entries from the list cache.
|
|
36717
|
+
*
|
|
36718
|
+
* @private
|
|
36719
|
+
* @name clear
|
|
36720
|
+
* @memberOf ListCache
|
|
36721
|
+
*/
|
|
36722
|
+
function listCacheClear() {
|
|
36723
|
+
this.__data__ = [];
|
|
36724
|
+
}
|
|
36725
|
+
|
|
36726
|
+
/**
|
|
36727
|
+
* Removes `key` and its value from the list cache.
|
|
36728
|
+
*
|
|
36729
|
+
* @private
|
|
36730
|
+
* @name delete
|
|
36731
|
+
* @memberOf ListCache
|
|
36732
|
+
* @param {string} key The key of the value to remove.
|
|
36733
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
36734
|
+
*/
|
|
36735
|
+
function listCacheDelete(key) {
|
|
36736
|
+
var data = this.__data__,
|
|
36737
|
+
index = assocIndexOf(data, key);
|
|
36738
|
+
|
|
36739
|
+
if (index < 0) {
|
|
36740
|
+
return false;
|
|
36741
|
+
}
|
|
36742
|
+
var lastIndex = data.length - 1;
|
|
36743
|
+
if (index == lastIndex) {
|
|
36744
|
+
data.pop();
|
|
36745
|
+
} else {
|
|
36746
|
+
splice.call(data, index, 1);
|
|
36747
|
+
}
|
|
36748
|
+
return true;
|
|
36749
|
+
}
|
|
36750
|
+
|
|
36751
|
+
/**
|
|
36752
|
+
* Gets the list cache value for `key`.
|
|
36753
|
+
*
|
|
36754
|
+
* @private
|
|
36755
|
+
* @name get
|
|
36756
|
+
* @memberOf ListCache
|
|
36757
|
+
* @param {string} key The key of the value to get.
|
|
36758
|
+
* @returns {*} Returns the entry value.
|
|
36759
|
+
*/
|
|
36760
|
+
function listCacheGet(key) {
|
|
36761
|
+
var data = this.__data__,
|
|
36762
|
+
index = assocIndexOf(data, key);
|
|
36763
|
+
|
|
36764
|
+
return index < 0 ? undefined : data[index][1];
|
|
36765
|
+
}
|
|
36766
|
+
|
|
36767
|
+
/**
|
|
36768
|
+
* Checks if a list cache value for `key` exists.
|
|
36769
|
+
*
|
|
36770
|
+
* @private
|
|
36771
|
+
* @name has
|
|
36772
|
+
* @memberOf ListCache
|
|
36773
|
+
* @param {string} key The key of the entry to check.
|
|
36774
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
36775
|
+
*/
|
|
36776
|
+
function listCacheHas(key) {
|
|
36777
|
+
return assocIndexOf(this.__data__, key) > -1;
|
|
36778
|
+
}
|
|
36779
|
+
|
|
36780
|
+
/**
|
|
36781
|
+
* Sets the list cache `key` to `value`.
|
|
36782
|
+
*
|
|
36783
|
+
* @private
|
|
36784
|
+
* @name set
|
|
36785
|
+
* @memberOf ListCache
|
|
36786
|
+
* @param {string} key The key of the value to set.
|
|
36787
|
+
* @param {*} value The value to set.
|
|
36788
|
+
* @returns {Object} Returns the list cache instance.
|
|
36789
|
+
*/
|
|
36790
|
+
function listCacheSet(key, value) {
|
|
36791
|
+
var data = this.__data__,
|
|
36792
|
+
index = assocIndexOf(data, key);
|
|
36793
|
+
|
|
36794
|
+
if (index < 0) {
|
|
36795
|
+
data.push([key, value]);
|
|
36796
|
+
} else {
|
|
36797
|
+
data[index][1] = value;
|
|
36798
|
+
}
|
|
36799
|
+
return this;
|
|
36800
|
+
}
|
|
36801
|
+
|
|
36802
|
+
// Add methods to `ListCache`.
|
|
36803
|
+
ListCache.prototype.clear = listCacheClear;
|
|
36804
|
+
ListCache.prototype['delete'] = listCacheDelete;
|
|
36805
|
+
ListCache.prototype.get = listCacheGet;
|
|
36806
|
+
ListCache.prototype.has = listCacheHas;
|
|
36807
|
+
ListCache.prototype.set = listCacheSet;
|
|
36808
|
+
|
|
36809
|
+
/**
|
|
36810
|
+
* Creates a map cache object to store key-value pairs.
|
|
36811
|
+
*
|
|
36812
|
+
* @private
|
|
36813
|
+
* @constructor
|
|
36814
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
36815
|
+
*/
|
|
36816
|
+
function MapCache(entries) {
|
|
36817
|
+
var index = -1,
|
|
36818
|
+
length = entries ? entries.length : 0;
|
|
36819
|
+
|
|
36820
|
+
this.clear();
|
|
36821
|
+
while (++index < length) {
|
|
36822
|
+
var entry = entries[index];
|
|
36823
|
+
this.set(entry[0], entry[1]);
|
|
36824
|
+
}
|
|
36825
|
+
}
|
|
36826
|
+
|
|
36827
|
+
/**
|
|
36828
|
+
* Removes all key-value entries from the map.
|
|
36829
|
+
*
|
|
36830
|
+
* @private
|
|
36831
|
+
* @name clear
|
|
36832
|
+
* @memberOf MapCache
|
|
36833
|
+
*/
|
|
36834
|
+
function mapCacheClear() {
|
|
36835
|
+
this.__data__ = {
|
|
36836
|
+
'hash': new Hash,
|
|
36837
|
+
'map': new (Map$1 || ListCache),
|
|
36838
|
+
'string': new Hash
|
|
36839
|
+
};
|
|
36840
|
+
}
|
|
36841
|
+
|
|
36842
|
+
/**
|
|
36843
|
+
* Removes `key` and its value from the map.
|
|
36844
|
+
*
|
|
36845
|
+
* @private
|
|
36846
|
+
* @name delete
|
|
36847
|
+
* @memberOf MapCache
|
|
36848
|
+
* @param {string} key The key of the value to remove.
|
|
36849
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
36850
|
+
*/
|
|
36851
|
+
function mapCacheDelete(key) {
|
|
36852
|
+
return getMapData(this, key)['delete'](key);
|
|
36853
|
+
}
|
|
36854
|
+
|
|
36855
|
+
/**
|
|
36856
|
+
* Gets the map value for `key`.
|
|
36857
|
+
*
|
|
36858
|
+
* @private
|
|
36859
|
+
* @name get
|
|
36860
|
+
* @memberOf MapCache
|
|
36861
|
+
* @param {string} key The key of the value to get.
|
|
36862
|
+
* @returns {*} Returns the entry value.
|
|
36863
|
+
*/
|
|
36864
|
+
function mapCacheGet(key) {
|
|
36865
|
+
return getMapData(this, key).get(key);
|
|
36866
|
+
}
|
|
36867
|
+
|
|
36868
|
+
/**
|
|
36869
|
+
* Checks if a map value for `key` exists.
|
|
36870
|
+
*
|
|
36871
|
+
* @private
|
|
36872
|
+
* @name has
|
|
36873
|
+
* @memberOf MapCache
|
|
36874
|
+
* @param {string} key The key of the entry to check.
|
|
36875
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
36876
|
+
*/
|
|
36877
|
+
function mapCacheHas(key) {
|
|
36878
|
+
return getMapData(this, key).has(key);
|
|
36879
|
+
}
|
|
36880
|
+
|
|
36881
|
+
/**
|
|
36882
|
+
* Sets the map `key` to `value`.
|
|
36883
|
+
*
|
|
36884
|
+
* @private
|
|
36885
|
+
* @name set
|
|
36886
|
+
* @memberOf MapCache
|
|
36887
|
+
* @param {string} key The key of the value to set.
|
|
36888
|
+
* @param {*} value The value to set.
|
|
36889
|
+
* @returns {Object} Returns the map cache instance.
|
|
36890
|
+
*/
|
|
36891
|
+
function mapCacheSet(key, value) {
|
|
36892
|
+
getMapData(this, key).set(key, value);
|
|
36893
|
+
return this;
|
|
36894
|
+
}
|
|
36895
|
+
|
|
36896
|
+
// Add methods to `MapCache`.
|
|
36897
|
+
MapCache.prototype.clear = mapCacheClear;
|
|
36898
|
+
MapCache.prototype['delete'] = mapCacheDelete;
|
|
36899
|
+
MapCache.prototype.get = mapCacheGet;
|
|
36900
|
+
MapCache.prototype.has = mapCacheHas;
|
|
36901
|
+
MapCache.prototype.set = mapCacheSet;
|
|
36902
|
+
|
|
36903
|
+
/**
|
|
36904
|
+
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
36905
|
+
*
|
|
36906
|
+
* @private
|
|
36907
|
+
* @param {Array} array The array to inspect.
|
|
36908
|
+
* @param {*} key The key to search for.
|
|
36909
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
36910
|
+
*/
|
|
36911
|
+
function assocIndexOf(array, key) {
|
|
36912
|
+
var length = array.length;
|
|
36913
|
+
while (length--) {
|
|
36914
|
+
if (eq(array[length][0], key)) {
|
|
36915
|
+
return length;
|
|
36916
|
+
}
|
|
36917
|
+
}
|
|
36918
|
+
return -1;
|
|
36919
|
+
}
|
|
36920
|
+
|
|
36921
|
+
/**
|
|
36922
|
+
* The base implementation of `_.isNative` without bad shim checks.
|
|
36923
|
+
*
|
|
36924
|
+
* @private
|
|
36925
|
+
* @param {*} value The value to check.
|
|
36926
|
+
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
36927
|
+
* else `false`.
|
|
36928
|
+
*/
|
|
36929
|
+
function baseIsNative(value) {
|
|
36930
|
+
if (!isObject$1(value) || isMasked(value)) {
|
|
36931
|
+
return false;
|
|
36932
|
+
}
|
|
36933
|
+
var pattern = (isFunction$1(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
|
|
36934
|
+
return pattern.test(toSource(value));
|
|
36935
|
+
}
|
|
36936
|
+
|
|
36937
|
+
/**
|
|
36938
|
+
* Gets the data for `map`.
|
|
36939
|
+
*
|
|
36940
|
+
* @private
|
|
36941
|
+
* @param {Object} map The map to query.
|
|
36942
|
+
* @param {string} key The reference key.
|
|
36943
|
+
* @returns {*} Returns the map data.
|
|
36944
|
+
*/
|
|
36945
|
+
function getMapData(map, key) {
|
|
36946
|
+
var data = map.__data__;
|
|
36947
|
+
return isKeyable(key)
|
|
36948
|
+
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
36949
|
+
: data.map;
|
|
36950
|
+
}
|
|
36951
|
+
|
|
36952
|
+
/**
|
|
36953
|
+
* Gets the native function at `key` of `object`.
|
|
36954
|
+
*
|
|
36955
|
+
* @private
|
|
36956
|
+
* @param {Object} object The object to query.
|
|
36957
|
+
* @param {string} key The key of the method to get.
|
|
36958
|
+
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
36959
|
+
*/
|
|
36960
|
+
function getNative(object, key) {
|
|
36961
|
+
var value = getValue(object, key);
|
|
36962
|
+
return baseIsNative(value) ? value : undefined;
|
|
36963
|
+
}
|
|
36964
|
+
|
|
36965
|
+
/**
|
|
36966
|
+
* Checks if `value` is suitable for use as unique object key.
|
|
36967
|
+
*
|
|
36968
|
+
* @private
|
|
36969
|
+
* @param {*} value The value to check.
|
|
36970
|
+
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
36971
|
+
*/
|
|
36972
|
+
function isKeyable(value) {
|
|
36973
|
+
var type = typeof value;
|
|
36974
|
+
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
36975
|
+
? (value !== '__proto__')
|
|
36976
|
+
: (value === null);
|
|
36977
|
+
}
|
|
36978
|
+
|
|
36979
|
+
/**
|
|
36980
|
+
* Checks if `func` has its source masked.
|
|
36981
|
+
*
|
|
36982
|
+
* @private
|
|
36983
|
+
* @param {Function} func The function to check.
|
|
36984
|
+
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
36985
|
+
*/
|
|
36986
|
+
function isMasked(func) {
|
|
36987
|
+
return !!maskSrcKey && (maskSrcKey in func);
|
|
36988
|
+
}
|
|
36989
|
+
|
|
36990
|
+
/**
|
|
36991
|
+
* Converts `func` to its source code.
|
|
36992
|
+
*
|
|
36993
|
+
* @private
|
|
36994
|
+
* @param {Function} func The function to process.
|
|
36995
|
+
* @returns {string} Returns the source code.
|
|
36996
|
+
*/
|
|
36997
|
+
function toSource(func) {
|
|
36998
|
+
if (func != null) {
|
|
36999
|
+
try {
|
|
37000
|
+
return funcToString.call(func);
|
|
37001
|
+
} catch (e) {}
|
|
37002
|
+
try {
|
|
37003
|
+
return (func + '');
|
|
37004
|
+
} catch (e) {}
|
|
37005
|
+
}
|
|
37006
|
+
return '';
|
|
37007
|
+
}
|
|
37008
|
+
|
|
37009
|
+
/**
|
|
37010
|
+
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
37011
|
+
* provided, it determines the cache key for storing the result based on the
|
|
37012
|
+
* arguments provided to the memoized function. By default, the first argument
|
|
37013
|
+
* provided to the memoized function is used as the map cache key. The `func`
|
|
37014
|
+
* is invoked with the `this` binding of the memoized function.
|
|
37015
|
+
*
|
|
37016
|
+
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
37017
|
+
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
37018
|
+
* constructor with one whose instances implement the
|
|
37019
|
+
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
37020
|
+
* method interface of `delete`, `get`, `has`, and `set`.
|
|
37021
|
+
*
|
|
37022
|
+
* @static
|
|
37023
|
+
* @memberOf _
|
|
37024
|
+
* @since 0.1.0
|
|
37025
|
+
* @category Function
|
|
37026
|
+
* @param {Function} func The function to have its output memoized.
|
|
37027
|
+
* @param {Function} [resolver] The function to resolve the cache key.
|
|
37028
|
+
* @returns {Function} Returns the new memoized function.
|
|
37029
|
+
* @example
|
|
37030
|
+
*
|
|
37031
|
+
* var object = { 'a': 1, 'b': 2 };
|
|
37032
|
+
* var other = { 'c': 3, 'd': 4 };
|
|
37033
|
+
*
|
|
37034
|
+
* var values = _.memoize(_.values);
|
|
37035
|
+
* values(object);
|
|
37036
|
+
* // => [1, 2]
|
|
37037
|
+
*
|
|
37038
|
+
* values(other);
|
|
37039
|
+
* // => [3, 4]
|
|
37040
|
+
*
|
|
37041
|
+
* object.a = 2;
|
|
37042
|
+
* values(object);
|
|
37043
|
+
* // => [1, 2]
|
|
37044
|
+
*
|
|
37045
|
+
* // Modify the result cache.
|
|
37046
|
+
* values.cache.set(object, ['a', 'b']);
|
|
37047
|
+
* values(object);
|
|
37048
|
+
* // => ['a', 'b']
|
|
37049
|
+
*
|
|
37050
|
+
* // Replace `_.memoize.Cache`.
|
|
37051
|
+
* _.memoize.Cache = WeakMap;
|
|
37052
|
+
*/
|
|
37053
|
+
function memoize(func, resolver) {
|
|
37054
|
+
if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
|
|
37055
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
37056
|
+
}
|
|
37057
|
+
var memoized = function() {
|
|
37058
|
+
var args = arguments,
|
|
37059
|
+
key = resolver ? resolver.apply(this, args) : args[0],
|
|
37060
|
+
cache = memoized.cache;
|
|
37061
|
+
|
|
37062
|
+
if (cache.has(key)) {
|
|
37063
|
+
return cache.get(key);
|
|
37064
|
+
}
|
|
37065
|
+
var result = func.apply(this, args);
|
|
37066
|
+
memoized.cache = cache.set(key, result);
|
|
37067
|
+
return result;
|
|
37068
|
+
};
|
|
37069
|
+
memoized.cache = new (memoize.Cache || MapCache);
|
|
37070
|
+
return memoized;
|
|
37071
|
+
}
|
|
37072
|
+
|
|
37073
|
+
// Assign cache to `_.memoize`.
|
|
37074
|
+
memoize.Cache = MapCache;
|
|
37075
|
+
|
|
37076
|
+
/**
|
|
37077
|
+
* Performs a
|
|
37078
|
+
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
37079
|
+
* comparison between two values to determine if they are equivalent.
|
|
37080
|
+
*
|
|
37081
|
+
* @static
|
|
37082
|
+
* @memberOf _
|
|
37083
|
+
* @since 4.0.0
|
|
37084
|
+
* @category Lang
|
|
37085
|
+
* @param {*} value The value to compare.
|
|
37086
|
+
* @param {*} other The other value to compare.
|
|
37087
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
37088
|
+
* @example
|
|
37089
|
+
*
|
|
37090
|
+
* var object = { 'a': 1 };
|
|
37091
|
+
* var other = { 'a': 1 };
|
|
37092
|
+
*
|
|
37093
|
+
* _.eq(object, object);
|
|
37094
|
+
* // => true
|
|
37095
|
+
*
|
|
37096
|
+
* _.eq(object, other);
|
|
37097
|
+
* // => false
|
|
37098
|
+
*
|
|
37099
|
+
* _.eq('a', 'a');
|
|
37100
|
+
* // => true
|
|
37101
|
+
*
|
|
37102
|
+
* _.eq('a', Object('a'));
|
|
37103
|
+
* // => false
|
|
37104
|
+
*
|
|
37105
|
+
* _.eq(NaN, NaN);
|
|
37106
|
+
* // => true
|
|
37107
|
+
*/
|
|
37108
|
+
function eq(value, other) {
|
|
37109
|
+
return value === other || (value !== value && other !== other);
|
|
37110
|
+
}
|
|
37111
|
+
|
|
37112
|
+
/**
|
|
37113
|
+
* Checks if `value` is classified as a `Function` object.
|
|
37114
|
+
*
|
|
37115
|
+
* @static
|
|
37116
|
+
* @memberOf _
|
|
37117
|
+
* @since 0.1.0
|
|
37118
|
+
* @category Lang
|
|
37119
|
+
* @param {*} value The value to check.
|
|
37120
|
+
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
37121
|
+
* @example
|
|
37122
|
+
*
|
|
37123
|
+
* _.isFunction(_);
|
|
37124
|
+
* // => true
|
|
37125
|
+
*
|
|
37126
|
+
* _.isFunction(/abc/);
|
|
37127
|
+
* // => false
|
|
37128
|
+
*/
|
|
37129
|
+
function isFunction$1(value) {
|
|
37130
|
+
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
37131
|
+
// in Safari 8-9 which returns 'object' for typed array and other constructors.
|
|
37132
|
+
var tag = isObject$1(value) ? objectToString.call(value) : '';
|
|
37133
|
+
return tag == funcTag || tag == genTag;
|
|
37134
|
+
}
|
|
37135
|
+
|
|
37136
|
+
/**
|
|
37137
|
+
* Checks if `value` is the
|
|
37138
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
37139
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
37140
|
+
*
|
|
37141
|
+
* @static
|
|
37142
|
+
* @memberOf _
|
|
37143
|
+
* @since 0.1.0
|
|
37144
|
+
* @category Lang
|
|
37145
|
+
* @param {*} value The value to check.
|
|
37146
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
37147
|
+
* @example
|
|
37148
|
+
*
|
|
37149
|
+
* _.isObject({});
|
|
37150
|
+
* // => true
|
|
37151
|
+
*
|
|
37152
|
+
* _.isObject([1, 2, 3]);
|
|
37153
|
+
* // => true
|
|
37154
|
+
*
|
|
37155
|
+
* _.isObject(_.noop);
|
|
37156
|
+
* // => true
|
|
37157
|
+
*
|
|
37158
|
+
* _.isObject(null);
|
|
37159
|
+
* // => false
|
|
37160
|
+
*/
|
|
37161
|
+
function isObject$1(value) {
|
|
37162
|
+
var type = typeof value;
|
|
37163
|
+
return !!value && (type == 'object' || type == 'function');
|
|
37164
|
+
}
|
|
37165
|
+
|
|
37166
|
+
var lodash_memoize = memoize;
|
|
37167
|
+
|
|
37168
|
+
function resolver(options) {
|
|
37169
|
+
return JSON.stringify(options);
|
|
37170
|
+
}
|
|
37171
|
+
function isString$2(el) {
|
|
37172
|
+
return typeof el === 'string';
|
|
37173
|
+
}
|
|
37174
|
+
function isUnique(el, index, arr) {
|
|
37175
|
+
return arr.indexOf(el) === index;
|
|
37176
|
+
}
|
|
37177
|
+
function isAllLowerCase(el) {
|
|
37178
|
+
return el.toLowerCase() === el;
|
|
37179
|
+
}
|
|
37180
|
+
function fixCommas(el) {
|
|
37181
|
+
return el.indexOf(',') === -1 ? el : el.split(',');
|
|
37182
|
+
}
|
|
37183
|
+
function normalizeLocale(locale) {
|
|
37184
|
+
if (!locale) {
|
|
37185
|
+
return locale;
|
|
37186
|
+
}
|
|
37187
|
+
if (locale === 'C' || locale === 'posix' || locale === 'POSIX') {
|
|
37188
|
+
return 'en-US';
|
|
37189
|
+
}
|
|
37190
|
+
// If there's a dot (.) in the locale, it's likely in the format of "en-US.UTF-8", so we only take the first part
|
|
37191
|
+
if (locale.indexOf('.') !== -1) {
|
|
37192
|
+
var _a = locale.split('.')[0], actualLocale = _a === void 0 ? '' : _a;
|
|
37193
|
+
return normalizeLocale(actualLocale);
|
|
37194
|
+
}
|
|
37195
|
+
// If there's an at sign (@) in the locale, it's likely in the format of "en-US@posix", so we only take the first part
|
|
37196
|
+
if (locale.indexOf('@') !== -1) {
|
|
37197
|
+
var _b = locale.split('@')[0], actualLocale = _b === void 0 ? '' : _b;
|
|
37198
|
+
return normalizeLocale(actualLocale);
|
|
37199
|
+
}
|
|
37200
|
+
// If there's a dash (-) in the locale and it's not all lower case, it's already in the format of "en-US", so we return it
|
|
37201
|
+
if (locale.indexOf('-') === -1 || !isAllLowerCase(locale)) {
|
|
37202
|
+
return locale;
|
|
37203
|
+
}
|
|
37204
|
+
var _c = locale.split('-'), splitEl1 = _c[0], _d = _c[1], splitEl2 = _d === void 0 ? '' : _d;
|
|
37205
|
+
return "".concat(splitEl1, "-").concat(splitEl2.toUpperCase());
|
|
37206
|
+
}
|
|
37207
|
+
function getUserLocalesInternal(_a) {
|
|
37208
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.useFallbackLocale, useFallbackLocale = _c === void 0 ? true : _c, _d = _b.fallbackLocale, fallbackLocale = _d === void 0 ? 'en-US' : _d;
|
|
37209
|
+
var languageList = [];
|
|
37210
|
+
if (typeof navigator !== 'undefined') {
|
|
37211
|
+
var rawLanguages = navigator.languages || [];
|
|
37212
|
+
var languages = [];
|
|
37213
|
+
for (var _i = 0, rawLanguages_1 = rawLanguages; _i < rawLanguages_1.length; _i++) {
|
|
37214
|
+
var rawLanguagesItem = rawLanguages_1[_i];
|
|
37215
|
+
languages = languages.concat(fixCommas(rawLanguagesItem));
|
|
37216
|
+
}
|
|
37217
|
+
var rawLanguage = navigator.language;
|
|
37218
|
+
var language = rawLanguage ? fixCommas(rawLanguage) : rawLanguage;
|
|
37219
|
+
languageList = languageList.concat(languages, language);
|
|
37220
|
+
}
|
|
37221
|
+
if (useFallbackLocale) {
|
|
37222
|
+
languageList.push(fallbackLocale);
|
|
37223
|
+
}
|
|
37224
|
+
return languageList.filter(isString$2).map(normalizeLocale).filter(isUnique);
|
|
37225
|
+
}
|
|
37226
|
+
var getUserLocales = lodash_memoize(getUserLocalesInternal, resolver);
|
|
37227
|
+
function getUserLocaleInternal(options) {
|
|
37228
|
+
return getUserLocales(options)[0] || null;
|
|
37229
|
+
}
|
|
37230
|
+
var getUserLocale = lodash_memoize(getUserLocaleInternal, resolver);
|
|
37231
|
+
|
|
37232
|
+
function formatHour(locale, hour) {
|
|
37233
|
+
return hour.toLocaleString(locale || getUserLocale() || undefined);
|
|
37234
|
+
}
|
|
37235
|
+
|
|
37236
|
+
var __assign$7 = (undefined && undefined.__assign) || function () {
|
|
37237
|
+
__assign$7 = Object.assign || function(t) {
|
|
37238
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
37239
|
+
s = arguments[i];
|
|
37240
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
37241
|
+
t[p] = s[p];
|
|
37242
|
+
}
|
|
37243
|
+
return t;
|
|
37244
|
+
};
|
|
37245
|
+
return __assign$7.apply(this, arguments);
|
|
37246
|
+
};
|
|
37247
|
+
var __rest$6 = (undefined && undefined.__rest) || function (s, e) {
|
|
37248
|
+
var t = {};
|
|
37249
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
37250
|
+
t[p] = s[p];
|
|
37251
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
37252
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
37253
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
37254
|
+
t[p[i]] = s[p[i]];
|
|
37255
|
+
}
|
|
37256
|
+
return t;
|
|
37257
|
+
};
|
|
37258
|
+
var HourMark = React$5.memo(function HourMark(_a) {
|
|
37259
|
+
var _b = _a.formatHour, formatHour$1 = _b === void 0 ? formatHour : _b, locale = _a.locale, number = _a.number, otherProps = __rest$6(_a, ["formatHour", "locale", "number"]);
|
|
37260
|
+
return React__default["default"].createElement(Mark, __assign$7({ number: number ? formatHour$1(locale, number) : null }, otherProps));
|
|
37261
|
+
});
|
|
37262
|
+
|
|
37263
|
+
function isNumberBetween(min, max) {
|
|
37264
|
+
return function (props, propName, componentName) {
|
|
37265
|
+
var _a = props, _b = propName, value = _a[_b];
|
|
37266
|
+
if (typeof value !== 'undefined') {
|
|
37267
|
+
if (typeof value !== 'number') {
|
|
37268
|
+
return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof value, "` supplied to `").concat(componentName, "`, expected `number`."));
|
|
37269
|
+
}
|
|
37270
|
+
if (value < min || value > max) {
|
|
37271
|
+
return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof value, "` supplied to `").concat(componentName, "`, length must be between ").concat(min, " and ").concat(max, "."));
|
|
37272
|
+
}
|
|
37273
|
+
}
|
|
37274
|
+
// Everything is fine
|
|
37275
|
+
return null;
|
|
37276
|
+
};
|
|
37277
|
+
}
|
|
37278
|
+
var isHandLength = isNumberBetween(0, 100);
|
|
37279
|
+
var isOppositeHandLength = isNumberBetween(-100, 100);
|
|
37280
|
+
var isHandWidth = function isHandWidth(props, propName, componentName) {
|
|
37281
|
+
var _a = props, _b = propName, width = _a[_b];
|
|
37282
|
+
if (typeof width !== 'undefined') {
|
|
37283
|
+
if (typeof width !== 'number') {
|
|
37284
|
+
return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof width, "` supplied to `").concat(componentName, "`, expected `number`."));
|
|
37285
|
+
}
|
|
37286
|
+
if (width < 0) {
|
|
37287
|
+
return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof width, "` supplied to `").concat(componentName, "`, width must be greater or equal to 0."));
|
|
37288
|
+
}
|
|
37289
|
+
}
|
|
37290
|
+
// Everything is fine
|
|
37291
|
+
return null;
|
|
37292
|
+
};
|
|
37293
|
+
var isMarkLength = isHandLength;
|
|
37294
|
+
var isMarkWidth = isHandWidth;
|
|
37295
|
+
|
|
37296
|
+
var Clock = function Clock(_a) {
|
|
37297
|
+
var className = _a.className, formatHour = _a.formatHour, _b = _a.hourHandLength, hourHandLength = _b === void 0 ? 50 : _b, hourHandOppositeLength = _a.hourHandOppositeLength, _c = _a.hourHandWidth, hourHandWidth = _c === void 0 ? 4 : _c, _d = _a.hourMarksLength, hourMarksLength = _d === void 0 ? 10 : _d, _e = _a.hourMarksWidth, hourMarksWidth = _e === void 0 ? 3 : _e, locale = _a.locale, _f = _a.minuteHandLength, minuteHandLength = _f === void 0 ? 70 : _f, minuteHandOppositeLength = _a.minuteHandOppositeLength, _g = _a.minuteHandWidth, minuteHandWidth = _g === void 0 ? 2 : _g, _h = _a.minuteMarksLength, minuteMarksLength = _h === void 0 ? 6 : _h, _j = _a.minuteMarksWidth, minuteMarksWidth = _j === void 0 ? 1 : _j, _k = _a.renderHourMarks, renderHourMarks = _k === void 0 ? true : _k, _l = _a.renderMinuteHand, renderMinuteHand = _l === void 0 ? true : _l, _m = _a.renderMinuteMarks, renderMinuteMarks = _m === void 0 ? true : _m, renderNumbers = _a.renderNumbers, _o = _a.renderSecondHand, renderSecondHand = _o === void 0 ? true : _o, _p = _a.secondHandLength, secondHandLength = _p === void 0 ? 90 : _p, secondHandOppositeLength = _a.secondHandOppositeLength, _q = _a.secondHandWidth, secondHandWidth = _q === void 0 ? 1 : _q, _r = _a.size, size = _r === void 0 ? 150 : _r, useMillisecondPrecision = _a.useMillisecondPrecision, value = _a.value;
|
|
37298
|
+
function renderMinuteMarksFn() {
|
|
37299
|
+
if (!renderMinuteMarks) {
|
|
37300
|
+
return null;
|
|
37301
|
+
}
|
|
37302
|
+
var minuteMarks = [];
|
|
37303
|
+
for (var i = 1; i <= 60; i += 1) {
|
|
37304
|
+
var isHourMark = renderHourMarks && !(i % 5);
|
|
37305
|
+
if (!isHourMark) {
|
|
37306
|
+
minuteMarks.push(React__default["default"].createElement(MinuteMark, { key: "minute_".concat(i), angle: i * 6, length: minuteMarksLength, name: "minute", width: minuteMarksWidth }));
|
|
37307
|
+
}
|
|
37308
|
+
}
|
|
37309
|
+
return minuteMarks;
|
|
37310
|
+
}
|
|
37311
|
+
function renderHourMarksFn() {
|
|
37312
|
+
if (!renderHourMarks) {
|
|
37313
|
+
return null;
|
|
37314
|
+
}
|
|
37315
|
+
var hourMarks = [];
|
|
37316
|
+
for (var i = 1; i <= 12; i += 1) {
|
|
37317
|
+
hourMarks.push(React__default["default"].createElement(HourMark, { key: "hour_".concat(i), angle: i * 30, formatHour: formatHour, length: hourMarksLength, locale: locale, name: "hour", number: renderNumbers ? i : undefined, width: hourMarksWidth }));
|
|
37318
|
+
}
|
|
37319
|
+
return hourMarks;
|
|
37320
|
+
}
|
|
37321
|
+
function renderFace() {
|
|
37322
|
+
return (React__default["default"].createElement("div", { className: "react-clock__face" },
|
|
37323
|
+
renderMinuteMarksFn(),
|
|
37324
|
+
renderHourMarksFn()));
|
|
37325
|
+
}
|
|
37326
|
+
function renderHourHandFn() {
|
|
37327
|
+
var angle = value
|
|
37328
|
+
? getHours(value) * 30 +
|
|
37329
|
+
getMinutes(value) / 2 +
|
|
37330
|
+
getSeconds(value) / 120 +
|
|
37331
|
+
(useMillisecondPrecision ? getMilliseconds(value) / 120000 : 0)
|
|
37332
|
+
: 0;
|
|
37333
|
+
return (React__default["default"].createElement(Hand, { angle: angle, length: hourHandLength, name: "hour", oppositeLength: hourHandOppositeLength, width: hourHandWidth }));
|
|
37334
|
+
}
|
|
37335
|
+
function renderMinuteHandFn() {
|
|
37336
|
+
if (!renderMinuteHand) {
|
|
37337
|
+
return null;
|
|
37338
|
+
}
|
|
37339
|
+
var angle = value
|
|
37340
|
+
? getHours(value) * 360 +
|
|
37341
|
+
getMinutes(value) * 6 +
|
|
37342
|
+
getSeconds(value) / 10 +
|
|
37343
|
+
(useMillisecondPrecision ? getMilliseconds(value) / 10000 : 0)
|
|
37344
|
+
: 0;
|
|
37345
|
+
return (React__default["default"].createElement(Hand, { angle: angle, length: minuteHandLength, name: "minute", oppositeLength: minuteHandOppositeLength, width: minuteHandWidth }));
|
|
37346
|
+
}
|
|
37347
|
+
function renderSecondHandFn() {
|
|
37348
|
+
if (!renderSecondHand) {
|
|
37349
|
+
return null;
|
|
37350
|
+
}
|
|
37351
|
+
var angle = value
|
|
37352
|
+
? getMinutes(value) * 360 +
|
|
37353
|
+
getSeconds(value) * 6 +
|
|
37354
|
+
(useMillisecondPrecision ? getMilliseconds(value) * 0.006 : 0)
|
|
37355
|
+
: 0;
|
|
37356
|
+
return (React__default["default"].createElement(Hand, { angle: angle, length: secondHandLength, name: "second", oppositeLength: secondHandOppositeLength, width: secondHandWidth }));
|
|
37357
|
+
}
|
|
37358
|
+
return (React__default["default"].createElement("time", { className: clsx('react-clock', className), dateTime: value instanceof Date ? value.toISOString() : value || undefined, style: {
|
|
37359
|
+
width: size,
|
|
37360
|
+
height: size,
|
|
37361
|
+
} },
|
|
37362
|
+
renderFace(),
|
|
37363
|
+
renderHourHandFn(),
|
|
37364
|
+
renderMinuteHandFn(),
|
|
37365
|
+
renderSecondHandFn()));
|
|
37366
|
+
};
|
|
37367
|
+
Clock.propTypes = {
|
|
37368
|
+
className: propTypes$1.exports.oneOfType([propTypes$1.exports.string, propTypes$1.exports.arrayOf(propTypes$1.exports.string)]),
|
|
37369
|
+
formatHour: propTypes$1.exports.func,
|
|
37370
|
+
hourHandLength: isHandLength,
|
|
37371
|
+
hourHandOppositeLength: isOppositeHandLength,
|
|
37372
|
+
hourHandWidth: isHandWidth,
|
|
37373
|
+
hourMarksLength: isMarkLength,
|
|
37374
|
+
hourMarksWidth: isMarkWidth,
|
|
37375
|
+
locale: propTypes$1.exports.string,
|
|
37376
|
+
minuteHandLength: isHandLength,
|
|
37377
|
+
minuteHandOppositeLength: isOppositeHandLength,
|
|
37378
|
+
minuteHandWidth: isHandWidth,
|
|
37379
|
+
minuteMarksLength: isMarkLength,
|
|
37380
|
+
minuteMarksWidth: isMarkWidth,
|
|
37381
|
+
renderHourMarks: propTypes$1.exports.bool,
|
|
37382
|
+
renderMinuteHand: propTypes$1.exports.bool,
|
|
37383
|
+
renderMinuteMarks: propTypes$1.exports.bool,
|
|
37384
|
+
renderNumbers: propTypes$1.exports.bool,
|
|
37385
|
+
renderSecondHand: propTypes$1.exports.bool,
|
|
37386
|
+
secondHandLength: isHandLength,
|
|
37387
|
+
secondHandOppositeLength: isOppositeHandLength,
|
|
37388
|
+
secondHandWidth: isHandWidth,
|
|
37389
|
+
size: propTypes$1.exports.oneOfType([propTypes$1.exports.number, propTypes$1.exports.string]),
|
|
37390
|
+
value: propTypes$1.exports.oneOfType([propTypes$1.exports.string, propTypes$1.exports.instanceOf(Date)]),
|
|
37391
|
+
};
|
|
37392
|
+
|
|
37393
|
+
function getRect(element) {
|
|
37394
|
+
return element.getBoundingClientRect();
|
|
37395
|
+
}
|
|
37396
|
+
function detectElementOverflow(element, container) {
|
|
37397
|
+
return {
|
|
37398
|
+
get collidedTop() {
|
|
37399
|
+
return getRect(element).top < getRect(container).top;
|
|
37400
|
+
},
|
|
37401
|
+
get collidedBottom() {
|
|
37402
|
+
return getRect(element).bottom > getRect(container).bottom;
|
|
37403
|
+
},
|
|
37404
|
+
get collidedLeft() {
|
|
37405
|
+
return getRect(element).left < getRect(container).left;
|
|
37406
|
+
},
|
|
37407
|
+
get collidedRight() {
|
|
37408
|
+
return getRect(element).right > getRect(container).right;
|
|
37409
|
+
},
|
|
37410
|
+
get overflowTop() {
|
|
37411
|
+
return getRect(container).top - getRect(element).top;
|
|
37412
|
+
},
|
|
37413
|
+
get overflowBottom() {
|
|
37414
|
+
return getRect(element).bottom - getRect(container).bottom;
|
|
37415
|
+
},
|
|
37416
|
+
get overflowLeft() {
|
|
37417
|
+
return getRect(container).left - getRect(element).left;
|
|
37418
|
+
},
|
|
37419
|
+
get overflowRight() {
|
|
37420
|
+
return getRect(element).right - getRect(container).right;
|
|
37421
|
+
},
|
|
37422
|
+
};
|
|
37423
|
+
}
|
|
37424
|
+
|
|
37425
|
+
var __extends = (undefined && undefined.__extends) || (function () {
|
|
37426
|
+
var extendStatics = function (d, b) {
|
|
37427
|
+
extendStatics = Object.setPrototypeOf ||
|
|
37428
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
37429
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
37430
|
+
return extendStatics(d, b);
|
|
37431
|
+
};
|
|
37432
|
+
return function (d, b) {
|
|
37433
|
+
if (typeof b !== "function" && b !== null)
|
|
37434
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
37435
|
+
extendStatics(d, b);
|
|
37436
|
+
function __() { this.constructor = d; }
|
|
37437
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
37438
|
+
};
|
|
37439
|
+
})();
|
|
37440
|
+
var __assign$6 = (undefined && undefined.__assign) || function () {
|
|
37441
|
+
__assign$6 = Object.assign || function(t) {
|
|
37442
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
37443
|
+
s = arguments[i];
|
|
37444
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
37445
|
+
t[p] = s[p];
|
|
37446
|
+
}
|
|
37447
|
+
return t;
|
|
37448
|
+
};
|
|
37449
|
+
return __assign$6.apply(this, arguments);
|
|
37450
|
+
};
|
|
37451
|
+
var __rest$5 = (undefined && undefined.__rest) || function (s, e) {
|
|
37452
|
+
var t = {};
|
|
37453
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
37454
|
+
t[p] = s[p];
|
|
37455
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
37456
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
37457
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
37458
|
+
t[p[i]] = s[p[i]];
|
|
37459
|
+
}
|
|
37460
|
+
return t;
|
|
37461
|
+
};
|
|
37462
|
+
var isBrowser$2 = typeof document !== 'undefined';
|
|
37463
|
+
var isDisplayContentsSupported = isBrowser$2 && 'CSS' in window && 'supports' in window.CSS && CSS.supports('display', 'contents');
|
|
37464
|
+
var isMutationObserverSupported = isBrowser$2 && 'MutationObserver' in window;
|
|
37465
|
+
function capitalize(string) {
|
|
37466
|
+
return (string.charAt(0).toUpperCase() + string.slice(1));
|
|
37467
|
+
}
|
|
37468
|
+
function findScrollContainer(element) {
|
|
37469
|
+
var parent = element.parentElement;
|
|
37470
|
+
while (parent) {
|
|
37471
|
+
var overflow = window.getComputedStyle(parent).overflow;
|
|
37472
|
+
if (overflow.split(' ').every(function (o) { return o === 'auto' || o === 'scroll'; })) {
|
|
37473
|
+
return parent;
|
|
37474
|
+
}
|
|
37475
|
+
parent = parent.parentElement;
|
|
37476
|
+
}
|
|
37477
|
+
return document.documentElement;
|
|
37478
|
+
}
|
|
37479
|
+
function alignAxis(_a) {
|
|
37480
|
+
var axis = _a.axis, container = _a.container, element = _a.element, invertAxis = _a.invertAxis, scrollContainer = _a.scrollContainer, secondary = _a.secondary, spacing = _a.spacing;
|
|
37481
|
+
var style = window.getComputedStyle(element);
|
|
37482
|
+
var parent = container.parentElement;
|
|
37483
|
+
if (!parent) {
|
|
37484
|
+
return;
|
|
37485
|
+
}
|
|
37486
|
+
var scrollContainerCollisions = detectElementOverflow(parent, scrollContainer);
|
|
37487
|
+
var documentCollisions = detectElementOverflow(parent, document.documentElement);
|
|
37488
|
+
var isX = axis === 'x';
|
|
37489
|
+
var startProperty = isX ? 'left' : 'top';
|
|
37490
|
+
var endProperty = isX ? 'right' : 'bottom';
|
|
37491
|
+
var sizeProperty = isX ? 'width' : 'height';
|
|
37492
|
+
var overflowStartProperty = "overflow".concat(capitalize(startProperty));
|
|
37493
|
+
var overflowEndProperty = "overflow".concat(capitalize(endProperty));
|
|
37494
|
+
var scrollProperty = "scroll".concat(capitalize(startProperty));
|
|
37495
|
+
var uppercasedSizeProperty = capitalize(sizeProperty);
|
|
37496
|
+
var offsetSizeProperty = "offset".concat(uppercasedSizeProperty);
|
|
37497
|
+
var clientSizeProperty = "client".concat(uppercasedSizeProperty);
|
|
37498
|
+
var minSizeProperty = "min-".concat(sizeProperty);
|
|
37499
|
+
var scrollbarWidth = scrollContainer[offsetSizeProperty] - scrollContainer[clientSizeProperty];
|
|
37500
|
+
var startSpacing = typeof spacing === 'object' ? spacing[startProperty] : spacing;
|
|
37501
|
+
var availableStartSpace = -Math.max(scrollContainerCollisions[overflowStartProperty], documentCollisions[overflowStartProperty] + document.documentElement[scrollProperty]) - startSpacing;
|
|
37502
|
+
var endSpacing = typeof spacing === 'object' ? spacing[endProperty] : spacing;
|
|
37503
|
+
var availableEndSpace = -Math.max(scrollContainerCollisions[overflowEndProperty], documentCollisions[overflowEndProperty] - document.documentElement[scrollProperty]) -
|
|
37504
|
+
endSpacing -
|
|
37505
|
+
scrollbarWidth;
|
|
37506
|
+
if (secondary) {
|
|
37507
|
+
availableStartSpace += parent[clientSizeProperty];
|
|
37508
|
+
availableEndSpace += parent[clientSizeProperty];
|
|
37509
|
+
}
|
|
37510
|
+
var offsetSize = element[offsetSizeProperty];
|
|
37511
|
+
function displayStart() {
|
|
37512
|
+
element.style[startProperty] = 'auto';
|
|
37513
|
+
element.style[endProperty] = secondary ? '0' : '100%';
|
|
37514
|
+
}
|
|
37515
|
+
function displayEnd() {
|
|
37516
|
+
element.style[startProperty] = secondary ? '0' : '100%';
|
|
37517
|
+
element.style[endProperty] = 'auto';
|
|
37518
|
+
}
|
|
37519
|
+
function displayIfFits(availableSpace, display) {
|
|
37520
|
+
var fits = offsetSize <= availableSpace;
|
|
37521
|
+
if (fits) {
|
|
37522
|
+
display();
|
|
37523
|
+
}
|
|
37524
|
+
return fits;
|
|
37525
|
+
}
|
|
37526
|
+
function displayStartIfFits() {
|
|
37527
|
+
return displayIfFits(availableStartSpace, displayStart);
|
|
37528
|
+
}
|
|
37529
|
+
function displayEndIfFits() {
|
|
37530
|
+
return displayIfFits(availableEndSpace, displayEnd);
|
|
37531
|
+
}
|
|
37532
|
+
function displayWhereverShrinkedFits() {
|
|
37533
|
+
var moreSpaceStart = availableStartSpace > availableEndSpace;
|
|
37534
|
+
var rawMinSize = style.getPropertyValue(minSizeProperty);
|
|
37535
|
+
var minSize = rawMinSize ? parseInt(rawMinSize, 10) : null;
|
|
37536
|
+
function shrinkToSize(size) {
|
|
37537
|
+
var newSize = Math.max(size, minSize || 0);
|
|
37538
|
+
element.style[sizeProperty] = "".concat(newSize, "px");
|
|
37539
|
+
}
|
|
37540
|
+
if (moreSpaceStart) {
|
|
37541
|
+
shrinkToSize(availableStartSpace);
|
|
37542
|
+
displayStart();
|
|
37543
|
+
}
|
|
37544
|
+
else {
|
|
37545
|
+
shrinkToSize(availableEndSpace);
|
|
37546
|
+
displayEnd();
|
|
37547
|
+
}
|
|
37548
|
+
}
|
|
37549
|
+
var fits;
|
|
37550
|
+
if (invertAxis) {
|
|
37551
|
+
fits = displayStartIfFits() || displayEndIfFits();
|
|
37552
|
+
}
|
|
37553
|
+
else {
|
|
37554
|
+
fits = displayEndIfFits() || displayStartIfFits();
|
|
37555
|
+
}
|
|
37556
|
+
if (!fits) {
|
|
37557
|
+
displayWhereverShrinkedFits();
|
|
37558
|
+
}
|
|
37559
|
+
}
|
|
37560
|
+
function alignMainAxis(args) {
|
|
37561
|
+
alignAxis(args);
|
|
37562
|
+
}
|
|
37563
|
+
function alignSecondaryAxis(args) {
|
|
37564
|
+
alignAxis(__assign$6(__assign$6({}, args), { axis: args.axis === 'x' ? 'y' : 'x', secondary: true }));
|
|
37565
|
+
}
|
|
37566
|
+
function alignBothAxis(args) {
|
|
37567
|
+
var invertAxis = args.invertAxis, invertSecondaryAxis = args.invertSecondaryAxis, commonArgs = __rest$5(args, ["invertAxis", "invertSecondaryAxis"]);
|
|
37568
|
+
alignMainAxis(__assign$6(__assign$6({}, commonArgs), { invertAxis: invertAxis }));
|
|
37569
|
+
alignSecondaryAxis(__assign$6(__assign$6({}, commonArgs), { invertAxis: invertSecondaryAxis }));
|
|
37570
|
+
}
|
|
37571
|
+
var Fit = /** @class */ (function (_super) {
|
|
37572
|
+
__extends(Fit, _super);
|
|
37573
|
+
function Fit() {
|
|
37574
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
37575
|
+
_this.fit = function () {
|
|
37576
|
+
var _a = _this, scrollContainer = _a.scrollContainer, container = _a.container, element = _a.element;
|
|
37577
|
+
if (!scrollContainer || !container || !element) {
|
|
37578
|
+
return;
|
|
37579
|
+
}
|
|
37580
|
+
var elementWidth = element.clientWidth;
|
|
37581
|
+
var elementHeight = element.clientHeight;
|
|
37582
|
+
// No need to recalculate - already did that for current dimensions
|
|
37583
|
+
if (_this.elementWidth === elementWidth && _this.elementHeight === elementHeight) {
|
|
37584
|
+
return;
|
|
37585
|
+
}
|
|
37586
|
+
// Save the dimensions so that we know we don't need to repeat the function if unchanged
|
|
37587
|
+
_this.elementWidth = elementWidth;
|
|
37588
|
+
_this.elementHeight = elementHeight;
|
|
37589
|
+
var parent = container.parentElement;
|
|
37590
|
+
// Container was unmounted
|
|
37591
|
+
if (!parent) {
|
|
37592
|
+
return;
|
|
37593
|
+
}
|
|
37594
|
+
/**
|
|
37595
|
+
* We need to ensure that <Fit />'s child has a absolute position. Otherwise,
|
|
37596
|
+
* we wouldn't be able to place the child in the correct position.
|
|
37597
|
+
*/
|
|
37598
|
+
var style = window.getComputedStyle(element);
|
|
37599
|
+
var position = style.position;
|
|
37600
|
+
if (position !== 'absolute') {
|
|
37601
|
+
element.style.position = 'absolute';
|
|
37602
|
+
}
|
|
37603
|
+
/**
|
|
37604
|
+
* We need to ensure that <Fit />'s parent has a relative or absolute position. Otherwise,
|
|
37605
|
+
* we wouldn't be able to place the child in the correct position.
|
|
37606
|
+
*/
|
|
37607
|
+
var parentStyle = window.getComputedStyle(parent);
|
|
37608
|
+
var parentPosition = parentStyle.position;
|
|
37609
|
+
if (parentPosition !== 'relative' && parentPosition !== 'absolute') {
|
|
37610
|
+
parent.style.position = 'relative';
|
|
37611
|
+
}
|
|
37612
|
+
var _b = _this.props, invertAxis = _b.invertAxis, invertSecondaryAxis = _b.invertSecondaryAxis, _c = _b.mainAxis, mainAxis = _c === void 0 ? 'y' : _c, _d = _b.spacing, spacing = _d === void 0 ? 8 : _d;
|
|
37613
|
+
alignBothAxis({
|
|
37614
|
+
axis: mainAxis,
|
|
37615
|
+
container: container,
|
|
37616
|
+
element: element,
|
|
37617
|
+
invertAxis: invertAxis,
|
|
37618
|
+
invertSecondaryAxis: invertSecondaryAxis,
|
|
37619
|
+
scrollContainer: scrollContainer,
|
|
37620
|
+
spacing: spacing,
|
|
37621
|
+
});
|
|
37622
|
+
};
|
|
37623
|
+
return _this;
|
|
37624
|
+
}
|
|
37625
|
+
Fit.prototype.componentDidMount = function () {
|
|
37626
|
+
var _this = this;
|
|
37627
|
+
if (!isDisplayContentsSupported) {
|
|
37628
|
+
// eslint-disable-next-line react/no-find-dom-node
|
|
37629
|
+
var element = ReactDOM.findDOMNode(this);
|
|
37630
|
+
if (!element || !(element instanceof HTMLElement)) {
|
|
37631
|
+
return;
|
|
37632
|
+
}
|
|
37633
|
+
this.container = element;
|
|
37634
|
+
this.element = element;
|
|
37635
|
+
this.scrollContainer = findScrollContainer(element);
|
|
37636
|
+
}
|
|
37637
|
+
this.fit();
|
|
37638
|
+
var onMutation = function () {
|
|
37639
|
+
_this.fit();
|
|
37640
|
+
};
|
|
37641
|
+
if (isMutationObserverSupported && this.element) {
|
|
37642
|
+
var mutationObserver = new MutationObserver(onMutation);
|
|
37643
|
+
mutationObserver.observe(this.element, {
|
|
37644
|
+
attributes: true,
|
|
37645
|
+
attributeFilter: ['class', 'style'],
|
|
37646
|
+
});
|
|
37647
|
+
}
|
|
37648
|
+
};
|
|
37649
|
+
Fit.prototype.render = function () {
|
|
37650
|
+
var _this = this;
|
|
37651
|
+
var children = this.props.children;
|
|
37652
|
+
var child = React__default["default"].Children.only(children);
|
|
37653
|
+
if (isDisplayContentsSupported) {
|
|
37654
|
+
return (React__default["default"].createElement("span", { ref: function (container) {
|
|
37655
|
+
_this.container = container;
|
|
37656
|
+
var element = container && container.firstElementChild;
|
|
37657
|
+
if (!element || !(element instanceof HTMLElement)) {
|
|
37658
|
+
return;
|
|
37659
|
+
}
|
|
37660
|
+
_this.element = element;
|
|
37661
|
+
_this.scrollContainer = findScrollContainer(element);
|
|
37662
|
+
}, style: { display: 'contents' } }, child));
|
|
37663
|
+
}
|
|
37664
|
+
return child;
|
|
37665
|
+
};
|
|
37666
|
+
Fit.propTypes = {
|
|
37667
|
+
children: propTypes$1.exports.node.isRequired,
|
|
37668
|
+
invertAxis: propTypes$1.exports.bool,
|
|
37669
|
+
invertSecondaryAxis: propTypes$1.exports.bool,
|
|
37670
|
+
mainAxis: propTypes$1.exports.oneOf(['x', 'y']),
|
|
37671
|
+
spacing: propTypes$1.exports.oneOfType([
|
|
37672
|
+
propTypes$1.exports.number,
|
|
37673
|
+
propTypes$1.exports.shape({
|
|
37674
|
+
bottom: propTypes$1.exports.number.isRequired,
|
|
37675
|
+
left: propTypes$1.exports.number.isRequired,
|
|
37676
|
+
right: propTypes$1.exports.number.isRequired,
|
|
37677
|
+
top: propTypes$1.exports.number.isRequired,
|
|
37678
|
+
}),
|
|
37679
|
+
]),
|
|
37680
|
+
};
|
|
37681
|
+
return Fit;
|
|
37682
|
+
}(React$5.Component));
|
|
37683
|
+
|
|
37684
|
+
function Divider(_a) {
|
|
37685
|
+
var children = _a.children;
|
|
37686
|
+
return React__default["default"].createElement("span", { className: "react-time-picker__inputGroup__divider" }, children);
|
|
37687
|
+
}
|
|
37688
|
+
|
|
37689
|
+
var allowedVariants = ['normal', 'small-caps'];
|
|
37690
|
+
/**
|
|
37691
|
+
* Gets font CSS shorthand property given element.
|
|
37692
|
+
*
|
|
37693
|
+
* @param {HTMLElement} element Element to get font CSS shorthand property from
|
|
37694
|
+
*/
|
|
37695
|
+
function getFontShorthand(element) {
|
|
37696
|
+
if (!element) {
|
|
37697
|
+
return '';
|
|
37698
|
+
}
|
|
37699
|
+
var style = window.getComputedStyle(element);
|
|
37700
|
+
if (style.font) {
|
|
37701
|
+
return style.font;
|
|
37702
|
+
}
|
|
37703
|
+
var isFontDefined = style.fontFamily !== '';
|
|
37704
|
+
if (!isFontDefined) {
|
|
37705
|
+
return '';
|
|
37706
|
+
}
|
|
37707
|
+
var fontVariant = allowedVariants.includes(style.fontVariant) ? style.fontVariant : 'normal';
|
|
37708
|
+
return "".concat(style.fontStyle, " ").concat(fontVariant, " ").concat(style.fontWeight, " ").concat(style.fontSize, " / ").concat(style.lineHeight, " ").concat(style.fontFamily);
|
|
37709
|
+
}
|
|
37710
|
+
var cachedCanvas;
|
|
37711
|
+
/**
|
|
37712
|
+
* Measures text width given text and font CSS shorthand.
|
|
37713
|
+
*
|
|
37714
|
+
* @param {string} text Text to measure
|
|
37715
|
+
* @param {string} font Font to use when measuring the text
|
|
37716
|
+
*/
|
|
37717
|
+
function measureText(text, font) {
|
|
37718
|
+
var canvas = cachedCanvas || (cachedCanvas = document.createElement('canvas'));
|
|
37719
|
+
var context = canvas.getContext('2d');
|
|
37720
|
+
// Context type not supported
|
|
37721
|
+
if (!context) {
|
|
37722
|
+
return null;
|
|
37723
|
+
}
|
|
37724
|
+
context.font = font;
|
|
37725
|
+
var width = context.measureText(text).width;
|
|
37726
|
+
return Math.ceil(width);
|
|
37727
|
+
}
|
|
37728
|
+
/**
|
|
37729
|
+
* Updates input element width to fit its content given input element
|
|
37730
|
+
* @param {HTMLInputElement} element
|
|
37731
|
+
*/
|
|
37732
|
+
function updateInputWidth(element) {
|
|
37733
|
+
if (typeof document === 'undefined' || !element) {
|
|
37734
|
+
return null;
|
|
37735
|
+
}
|
|
37736
|
+
var font = getFontShorthand(element);
|
|
37737
|
+
var text = element.value || element.placeholder;
|
|
37738
|
+
var width = measureText(text, font);
|
|
37739
|
+
if (width === null) {
|
|
37740
|
+
return null;
|
|
37741
|
+
}
|
|
37742
|
+
element.style.width = "".concat(width, "px");
|
|
37743
|
+
return width;
|
|
37744
|
+
}
|
|
37745
|
+
|
|
37746
|
+
var isBrowser$1 = typeof document !== 'undefined';
|
|
37747
|
+
var useIsomorphicLayoutEffect = isBrowser$1 ? React$5.useLayoutEffect : React$5.useEffect;
|
|
37748
|
+
var isIEOrEdgeLegacy = isBrowser$1 && /(MSIE|Trident\/|Edge\/)/.test(navigator.userAgent);
|
|
37749
|
+
var isFirefox = isBrowser$1 && /Firefox/.test(navigator.userAgent);
|
|
37750
|
+
function onFocus(event) {
|
|
37751
|
+
var target = event.target;
|
|
37752
|
+
if (isIEOrEdgeLegacy) {
|
|
37753
|
+
requestAnimationFrame(function () { return target.select(); });
|
|
37754
|
+
}
|
|
37755
|
+
else {
|
|
37756
|
+
target.select();
|
|
37757
|
+
}
|
|
37758
|
+
}
|
|
37759
|
+
function updateInputWidthOnLoad(element) {
|
|
37760
|
+
if (document.readyState === 'complete') {
|
|
37761
|
+
return;
|
|
37762
|
+
}
|
|
37763
|
+
function onLoad() {
|
|
37764
|
+
updateInputWidth(element);
|
|
37765
|
+
}
|
|
37766
|
+
window.addEventListener('load', onLoad);
|
|
37767
|
+
}
|
|
37768
|
+
function updateInputWidthOnFontLoad(element) {
|
|
37769
|
+
if (!document.fonts) {
|
|
37770
|
+
return;
|
|
37771
|
+
}
|
|
37772
|
+
var font = getFontShorthand(element);
|
|
37773
|
+
if (!font) {
|
|
37774
|
+
return;
|
|
37775
|
+
}
|
|
37776
|
+
var isFontLoaded = document.fonts.check(font);
|
|
37777
|
+
if (isFontLoaded) {
|
|
37778
|
+
return;
|
|
37779
|
+
}
|
|
37780
|
+
function onLoadingDone() {
|
|
37781
|
+
updateInputWidth(element);
|
|
37782
|
+
}
|
|
37783
|
+
document.fonts.addEventListener('loadingdone', onLoadingDone);
|
|
37784
|
+
}
|
|
37785
|
+
function getSelectionString(input) {
|
|
37786
|
+
/**
|
|
37787
|
+
* window.getSelection().toString() returns empty string in IE11 and Firefox,
|
|
37788
|
+
* so alternatives come first.
|
|
37789
|
+
*/
|
|
37790
|
+
if (input &&
|
|
37791
|
+
'selectionStart' in input &&
|
|
37792
|
+
input.selectionStart !== null &&
|
|
37793
|
+
'selectionEnd' in input &&
|
|
37794
|
+
input.selectionEnd !== null) {
|
|
37795
|
+
return input.value.slice(input.selectionStart, input.selectionEnd);
|
|
37796
|
+
}
|
|
37797
|
+
if ('getSelection' in window) {
|
|
37798
|
+
var selection = window.getSelection();
|
|
37799
|
+
return selection && selection.toString();
|
|
37800
|
+
}
|
|
37801
|
+
return null;
|
|
37802
|
+
}
|
|
37803
|
+
function makeOnKeyPress(maxLength) {
|
|
37804
|
+
if (maxLength === null) {
|
|
37805
|
+
return undefined;
|
|
37806
|
+
}
|
|
37807
|
+
/**
|
|
37808
|
+
* Prevents keystrokes that would not produce a number or when value after keystroke would
|
|
37809
|
+
* exceed maxLength.
|
|
37810
|
+
*/
|
|
37811
|
+
return function onKeyPress(event) {
|
|
37812
|
+
if (isFirefox) {
|
|
37813
|
+
// See https://github.com/wojtekmaj/react-time-picker/issues/92
|
|
37814
|
+
return;
|
|
37815
|
+
}
|
|
37816
|
+
var key = event.key, input = event.target;
|
|
37817
|
+
var value = input.value;
|
|
37818
|
+
var isNumberKey = key.length === 1 && /\d/.test(key);
|
|
37819
|
+
var selection = getSelectionString(input);
|
|
37820
|
+
if (!isNumberKey || !(selection || value.length < maxLength)) {
|
|
37821
|
+
event.preventDefault();
|
|
37822
|
+
}
|
|
37823
|
+
};
|
|
37824
|
+
}
|
|
37825
|
+
function Input(_a) {
|
|
37826
|
+
var ariaLabel = _a.ariaLabel, autoFocus = _a.autoFocus, className = _a.className, disabled = _a.disabled, inputRef = _a.inputRef, max = _a.max, min = _a.min, name = _a.name, nameForClass = _a.nameForClass, onChange = _a.onChange, onKeyDown = _a.onKeyDown, onKeyUp = _a.onKeyUp, _b = _a.placeholder, placeholder = _b === void 0 ? '--' : _b, required = _a.required, showLeadingZeros = _a.showLeadingZeros, step = _a.step, value = _a.value;
|
|
37827
|
+
useIsomorphicLayoutEffect(function () {
|
|
37828
|
+
if (!inputRef || !inputRef.current) {
|
|
37829
|
+
return;
|
|
37830
|
+
}
|
|
37831
|
+
updateInputWidth(inputRef.current);
|
|
37832
|
+
updateInputWidthOnLoad(inputRef.current);
|
|
37833
|
+
updateInputWidthOnFontLoad(inputRef.current);
|
|
37834
|
+
}, [inputRef, value]);
|
|
37835
|
+
var hasLeadingZero = showLeadingZeros &&
|
|
37836
|
+
value &&
|
|
37837
|
+
Number(value) < 10 &&
|
|
37838
|
+
(value === '0' || !value.toString().startsWith('0'));
|
|
37839
|
+
var maxLength = max ? max.toString().length : null;
|
|
37840
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
37841
|
+
hasLeadingZero ? React__default["default"].createElement("span", { className: "".concat(className, "__leadingZero") }, "0") : null,
|
|
37842
|
+
React__default["default"].createElement("input", { "aria-label": ariaLabel, autoComplete: "off", autoFocus: autoFocus, className: clsx$1("".concat(className, "__input"), "".concat(className, "__").concat(nameForClass || name), hasLeadingZero && "".concat(className, "__input--hasLeadingZero")), "data-input": "true", disabled: disabled, inputMode: "numeric", max: max, min: min, name: name, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onKeyPress: makeOnKeyPress(maxLength), onKeyUp: function (event) {
|
|
37843
|
+
updateInputWidth(event.target);
|
|
37844
|
+
if (onKeyUp) {
|
|
37845
|
+
onKeyUp(event);
|
|
37846
|
+
}
|
|
37847
|
+
}, placeholder: placeholder, ref: inputRef, required: required, step: step, type: "number", value: value !== null ? value : '' })));
|
|
37848
|
+
}
|
|
37849
|
+
|
|
37850
|
+
function convert12to24(hour12, amPm) {
|
|
37851
|
+
var hour24 = Number(hour12);
|
|
37852
|
+
if (amPm === 'am' && hour24 === 12) {
|
|
37853
|
+
hour24 = 0;
|
|
37854
|
+
}
|
|
37855
|
+
else if (amPm === 'pm' && hour24 < 12) {
|
|
37856
|
+
hour24 += 12;
|
|
37857
|
+
}
|
|
37858
|
+
return hour24;
|
|
37859
|
+
}
|
|
37860
|
+
function convert24to12(hour24) {
|
|
37861
|
+
var hour12 = Number(hour24) % 12 || 12;
|
|
37862
|
+
return [hour12, Number(hour24) < 12 ? 'am' : 'pm'];
|
|
37863
|
+
}
|
|
37864
|
+
|
|
37865
|
+
var formatterCache = new Map();
|
|
37866
|
+
function getFormatter(options) {
|
|
37867
|
+
return function formatter(locale, date) {
|
|
37868
|
+
var localeWithDefault = locale || getUserLocale();
|
|
37869
|
+
if (!formatterCache.has(localeWithDefault)) {
|
|
37870
|
+
formatterCache.set(localeWithDefault, new Map());
|
|
37871
|
+
}
|
|
37872
|
+
var formatterCacheLocale = formatterCache.get(localeWithDefault);
|
|
37873
|
+
if (!formatterCacheLocale.has(options)) {
|
|
37874
|
+
formatterCacheLocale.set(options, new Intl.DateTimeFormat(localeWithDefault || undefined, options).format);
|
|
37875
|
+
}
|
|
37876
|
+
return formatterCacheLocale.get(options)(date);
|
|
37877
|
+
};
|
|
37878
|
+
}
|
|
37879
|
+
var numberFormatterCache = new Map();
|
|
37880
|
+
function getNumberFormatter(options) {
|
|
37881
|
+
return function (locale, number) {
|
|
37882
|
+
var localeWithDefault = locale || getUserLocale();
|
|
37883
|
+
if (!numberFormatterCache.has(localeWithDefault)) {
|
|
37884
|
+
numberFormatterCache.set(localeWithDefault, new Map());
|
|
37885
|
+
}
|
|
37886
|
+
var numberFormatterCacheLocale = numberFormatterCache.get(localeWithDefault);
|
|
37887
|
+
if (!numberFormatterCacheLocale.has(options)) {
|
|
37888
|
+
numberFormatterCacheLocale.set(options, new Intl.NumberFormat(localeWithDefault || undefined, options).format);
|
|
37889
|
+
}
|
|
37890
|
+
return numberFormatterCacheLocale.get(options)(number);
|
|
37891
|
+
};
|
|
37892
|
+
}
|
|
37893
|
+
|
|
37894
|
+
var nines = ['9', '٩'];
|
|
37895
|
+
var ninesRegExp = new RegExp("[".concat(nines.join(''), "]"));
|
|
37896
|
+
var amPmFormatter = getFormatter({ hour: 'numeric' });
|
|
37897
|
+
function getAmPmLabels(locale) {
|
|
37898
|
+
var amString = amPmFormatter(locale, new Date(2017, 0, 1, 9));
|
|
37899
|
+
var pmString = amPmFormatter(locale, new Date(2017, 0, 1, 21));
|
|
37900
|
+
var _a = amString.split(ninesRegExp), am1 = _a[0], am2 = _a[1];
|
|
37901
|
+
var _b = pmString.split(ninesRegExp), pm1 = _b[0], pm2 = _b[1];
|
|
37902
|
+
if (pm2 !== undefined) {
|
|
37903
|
+
// If pm2 is undefined, nine was not found in pmString - this locale is not using 12-hour time
|
|
37904
|
+
if (am1 !== pm1) {
|
|
37905
|
+
return [am1, pm1].map(function (el) { return el.trim(); });
|
|
37906
|
+
}
|
|
37907
|
+
if (am2 !== pm2) {
|
|
37908
|
+
return [am2, pm2].map(function (el) { return el.trim(); });
|
|
37909
|
+
}
|
|
37910
|
+
}
|
|
37911
|
+
// Fallback
|
|
37912
|
+
return ['AM', 'PM'];
|
|
37913
|
+
}
|
|
37914
|
+
function isValidNumber(num) {
|
|
37915
|
+
return num !== null && num !== false && !Number.isNaN(Number(num));
|
|
37916
|
+
}
|
|
37917
|
+
function safeMin() {
|
|
37918
|
+
var args = [];
|
|
37919
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
37920
|
+
args[_i] = arguments[_i];
|
|
37921
|
+
}
|
|
37922
|
+
return Math.min.apply(Math, args.filter(isValidNumber));
|
|
37923
|
+
}
|
|
37924
|
+
function safeMax() {
|
|
37925
|
+
var args = [];
|
|
37926
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
37927
|
+
args[_i] = arguments[_i];
|
|
37928
|
+
}
|
|
37929
|
+
return Math.max.apply(Math, args.filter(isValidNumber));
|
|
37930
|
+
}
|
|
37931
|
+
|
|
37932
|
+
var __assign$5 = (undefined && undefined.__assign) || function () {
|
|
37933
|
+
__assign$5 = Object.assign || function(t) {
|
|
37934
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
37935
|
+
s = arguments[i];
|
|
37936
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
37937
|
+
t[p] = s[p];
|
|
37938
|
+
}
|
|
37939
|
+
return t;
|
|
37940
|
+
};
|
|
37941
|
+
return __assign$5.apply(this, arguments);
|
|
37942
|
+
};
|
|
37943
|
+
var __rest$4 = (undefined && undefined.__rest) || function (s, e) {
|
|
37944
|
+
var t = {};
|
|
37945
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
37946
|
+
t[p] = s[p];
|
|
37947
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
37948
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
37949
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
37950
|
+
t[p[i]] = s[p[i]];
|
|
37951
|
+
}
|
|
37952
|
+
return t;
|
|
37953
|
+
};
|
|
37954
|
+
function Hour12Input(_a) {
|
|
37955
|
+
var amPm = _a.amPm, maxTime = _a.maxTime, minTime = _a.minTime, value = _a.value, otherProps = __rest$4(_a, ["amPm", "maxTime", "minTime", "value"]);
|
|
37956
|
+
var maxHour = safeMin(12, maxTime &&
|
|
37957
|
+
(function () {
|
|
37958
|
+
var _a = convert24to12(getHours(maxTime)), maxHourResult = _a[0], maxAmPm = _a[1];
|
|
37959
|
+
if (maxAmPm !== amPm) {
|
|
37960
|
+
// pm is always after am, so we should ignore validation
|
|
37961
|
+
return null;
|
|
37962
|
+
}
|
|
37963
|
+
return maxHourResult;
|
|
37964
|
+
})());
|
|
37965
|
+
var minHour = safeMax(1, minTime &&
|
|
37966
|
+
(function () {
|
|
37967
|
+
var _a = convert24to12(getHours(minTime)), minHourResult = _a[0], minAmPm = _a[1];
|
|
37968
|
+
if (
|
|
37969
|
+
// pm is always after am, so we should ignore validation
|
|
37970
|
+
minAmPm !== amPm ||
|
|
37971
|
+
// If minHour is 12 am/pm, user should be able to enter 12, 1, ..., 11.
|
|
37972
|
+
minHourResult === 12) {
|
|
37973
|
+
return null;
|
|
37974
|
+
}
|
|
37975
|
+
return minHourResult;
|
|
37976
|
+
})());
|
|
37977
|
+
var value12 = value ? convert24to12(value)[0].toString() : '';
|
|
37978
|
+
return (React__default["default"].createElement(Input, __assign$5({ max: maxHour, min: minHour, name: "hour12", nameForClass: "hour", value: value12 }, otherProps)));
|
|
37979
|
+
}
|
|
37980
|
+
|
|
37981
|
+
var __assign$4 = (undefined && undefined.__assign) || function () {
|
|
37982
|
+
__assign$4 = Object.assign || function(t) {
|
|
37983
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
37984
|
+
s = arguments[i];
|
|
37985
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
37986
|
+
t[p] = s[p];
|
|
37987
|
+
}
|
|
37988
|
+
return t;
|
|
37989
|
+
};
|
|
37990
|
+
return __assign$4.apply(this, arguments);
|
|
37991
|
+
};
|
|
37992
|
+
var __rest$3 = (undefined && undefined.__rest) || function (s, e) {
|
|
37993
|
+
var t = {};
|
|
37994
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
37995
|
+
t[p] = s[p];
|
|
37996
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
37997
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
37998
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
37999
|
+
t[p[i]] = s[p[i]];
|
|
38000
|
+
}
|
|
38001
|
+
return t;
|
|
38002
|
+
};
|
|
38003
|
+
function Hour24Input(_a) {
|
|
38004
|
+
var maxTime = _a.maxTime, minTime = _a.minTime, otherProps = __rest$3(_a, ["maxTime", "minTime"]);
|
|
38005
|
+
var maxHour = safeMin(23, maxTime && getHours(maxTime));
|
|
38006
|
+
var minHour = safeMax(0, minTime && getHours(minTime));
|
|
38007
|
+
return React__default["default"].createElement(Input, __assign$4({ max: maxHour, min: minHour, name: "hour24", nameForClass: "hour" }, otherProps));
|
|
38008
|
+
}
|
|
38009
|
+
|
|
38010
|
+
var __assign$3 = (undefined && undefined.__assign) || function () {
|
|
38011
|
+
__assign$3 = Object.assign || function(t) {
|
|
38012
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
38013
|
+
s = arguments[i];
|
|
38014
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
38015
|
+
t[p] = s[p];
|
|
38016
|
+
}
|
|
38017
|
+
return t;
|
|
38018
|
+
};
|
|
38019
|
+
return __assign$3.apply(this, arguments);
|
|
38020
|
+
};
|
|
38021
|
+
var __rest$2 = (undefined && undefined.__rest) || function (s, e) {
|
|
38022
|
+
var t = {};
|
|
38023
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
38024
|
+
t[p] = s[p];
|
|
38025
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
38026
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
38027
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
38028
|
+
t[p[i]] = s[p[i]];
|
|
38029
|
+
}
|
|
38030
|
+
return t;
|
|
38031
|
+
};
|
|
38032
|
+
function MinuteInput(_a) {
|
|
38033
|
+
var hour = _a.hour, maxTime = _a.maxTime, minTime = _a.minTime, _b = _a.showLeadingZeros, showLeadingZeros = _b === void 0 ? true : _b, otherProps = __rest$2(_a, ["hour", "maxTime", "minTime", "showLeadingZeros"]);
|
|
38034
|
+
function isSameHour(date) {
|
|
38035
|
+
return hour === getHours(date).toString();
|
|
38036
|
+
}
|
|
38037
|
+
var maxMinute = safeMin(59, maxTime && isSameHour(maxTime) && getMinutes(maxTime));
|
|
38038
|
+
var minMinute = safeMax(0, minTime && isSameHour(minTime) && getMinutes(minTime));
|
|
38039
|
+
return (React__default["default"].createElement(Input, __assign$3({ max: maxMinute, min: minMinute, name: "minute", showLeadingZeros: showLeadingZeros }, otherProps)));
|
|
38040
|
+
}
|
|
38041
|
+
|
|
38042
|
+
var __assign$2 = (undefined && undefined.__assign) || function () {
|
|
38043
|
+
__assign$2 = Object.assign || function(t) {
|
|
38044
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
38045
|
+
s = arguments[i];
|
|
38046
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
38047
|
+
t[p] = s[p];
|
|
38048
|
+
}
|
|
38049
|
+
return t;
|
|
38050
|
+
};
|
|
38051
|
+
return __assign$2.apply(this, arguments);
|
|
38052
|
+
};
|
|
38053
|
+
var __rest$1 = (undefined && undefined.__rest) || function (s, e) {
|
|
38054
|
+
var t = {};
|
|
38055
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
38056
|
+
t[p] = s[p];
|
|
38057
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
38058
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
38059
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
38060
|
+
t[p[i]] = s[p[i]];
|
|
38061
|
+
}
|
|
38062
|
+
return t;
|
|
38063
|
+
};
|
|
38064
|
+
function SecondInput(_a) {
|
|
38065
|
+
var hour = _a.hour, maxTime = _a.maxTime, minTime = _a.minTime, minute = _a.minute, _b = _a.showLeadingZeros, showLeadingZeros = _b === void 0 ? true : _b, otherProps = __rest$1(_a, ["hour", "maxTime", "minTime", "minute", "showLeadingZeros"]);
|
|
38066
|
+
function isSameMinute(date) {
|
|
38067
|
+
return hour === getHours(date).toString() && minute === getMinutes(date).toString();
|
|
38068
|
+
}
|
|
38069
|
+
var maxSecond = safeMin(59, maxTime && isSameMinute(maxTime) && getSeconds(maxTime));
|
|
38070
|
+
var minSecond = safeMax(0, minTime && isSameMinute(minTime) && getSeconds(minTime));
|
|
38071
|
+
return (React__default["default"].createElement(Input, __assign$2({ max: maxSecond, min: minSecond, name: "second", showLeadingZeros: showLeadingZeros }, otherProps)));
|
|
38072
|
+
}
|
|
38073
|
+
|
|
38074
|
+
function NativeInput(_a) {
|
|
38075
|
+
var ariaLabel = _a.ariaLabel, disabled = _a.disabled, maxTime = _a.maxTime, minTime = _a.minTime, name = _a.name, onChange = _a.onChange, required = _a.required, value = _a.value, valueType = _a.valueType;
|
|
38076
|
+
var nativeValueParser = (function () {
|
|
38077
|
+
switch (valueType) {
|
|
38078
|
+
case 'hour':
|
|
38079
|
+
return function (receivedValue) { return "".concat(getHours(receivedValue), ":00"); };
|
|
38080
|
+
case 'minute':
|
|
38081
|
+
return getHoursMinutes;
|
|
38082
|
+
case 'second':
|
|
38083
|
+
return getHoursMinutesSeconds;
|
|
38084
|
+
default:
|
|
38085
|
+
throw new Error('Invalid valueType');
|
|
38086
|
+
}
|
|
38087
|
+
})();
|
|
38088
|
+
var step = (function () {
|
|
38089
|
+
switch (valueType) {
|
|
38090
|
+
case 'hour':
|
|
38091
|
+
return 3600;
|
|
38092
|
+
case 'minute':
|
|
38093
|
+
return 60;
|
|
38094
|
+
case 'second':
|
|
38095
|
+
return 1;
|
|
38096
|
+
default:
|
|
38097
|
+
throw new Error('Invalid valueType');
|
|
38098
|
+
}
|
|
38099
|
+
})();
|
|
38100
|
+
function stopPropagation(event) {
|
|
38101
|
+
event.stopPropagation();
|
|
38102
|
+
}
|
|
38103
|
+
return (React__default["default"].createElement("input", { "aria-label": ariaLabel, disabled: disabled, hidden: true, max: maxTime ? nativeValueParser(maxTime) : undefined, min: minTime ? nativeValueParser(minTime) : undefined, name: name, onChange: onChange, onFocus: stopPropagation, required: required, step: step, style: {
|
|
38104
|
+
visibility: 'hidden',
|
|
38105
|
+
position: 'absolute',
|
|
38106
|
+
zIndex: '-999',
|
|
38107
|
+
}, type: "time", value: value ? nativeValueParser(value) : '' }));
|
|
38108
|
+
}
|
|
38109
|
+
|
|
38110
|
+
function AmPm(_a) {
|
|
38111
|
+
var ariaLabel = _a.ariaLabel, autoFocus = _a.autoFocus, className = _a.className, disabled = _a.disabled, inputRef = _a.inputRef, locale = _a.locale, maxTime = _a.maxTime, minTime = _a.minTime, onChange = _a.onChange, onKeyDown = _a.onKeyDown, required = _a.required, value = _a.value;
|
|
38112
|
+
var amDisabled = minTime ? convert24to12(getHours(minTime))[1] === 'pm' : false;
|
|
38113
|
+
var pmDisabled = maxTime ? convert24to12(getHours(maxTime))[1] === 'am' : false;
|
|
38114
|
+
var name = 'amPm';
|
|
38115
|
+
var _b = getAmPmLabels(locale), amLabel = _b[0], pmLabel = _b[1];
|
|
38116
|
+
return (React__default["default"].createElement("select", { "aria-label": ariaLabel, autoFocus: autoFocus, className: clsx$1("".concat(className, "__input"), "".concat(className, "__").concat(name)), "data-input": "true", "data-select": "true", disabled: disabled, name: name, onChange: onChange, onKeyDown: onKeyDown, ref: inputRef, required: required, value: value !== null ? value : '' },
|
|
38117
|
+
!value && React__default["default"].createElement("option", { value: "" }, "--"),
|
|
38118
|
+
React__default["default"].createElement("option", { disabled: amDisabled, value: "am" }, amLabel),
|
|
38119
|
+
React__default["default"].createElement("option", { disabled: pmDisabled, value: "pm" }, pmLabel)));
|
|
38120
|
+
}
|
|
38121
|
+
|
|
38122
|
+
var __assign$1 = (undefined && undefined.__assign) || function () {
|
|
38123
|
+
__assign$1 = Object.assign || function(t) {
|
|
38124
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
38125
|
+
s = arguments[i];
|
|
38126
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
38127
|
+
t[p] = s[p];
|
|
38128
|
+
}
|
|
38129
|
+
return t;
|
|
38130
|
+
};
|
|
38131
|
+
return __assign$1.apply(this, arguments);
|
|
38132
|
+
};
|
|
38133
|
+
var __spreadArray$1 = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
|
38134
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
38135
|
+
if (ar || !(i in from)) {
|
|
38136
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
38137
|
+
ar[i] = from[i];
|
|
38138
|
+
}
|
|
38139
|
+
}
|
|
38140
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
38141
|
+
};
|
|
38142
|
+
var getFormatterOptionsCache = {};
|
|
38143
|
+
var allViews$2 = ['hour', 'minute', 'second'];
|
|
38144
|
+
function isInternalInput(element) {
|
|
38145
|
+
return element.dataset.input === 'true';
|
|
38146
|
+
}
|
|
38147
|
+
function findInput(element, property) {
|
|
38148
|
+
var nextElement = element;
|
|
38149
|
+
do {
|
|
38150
|
+
nextElement = nextElement[property];
|
|
38151
|
+
} while (nextElement && !isInternalInput(nextElement));
|
|
38152
|
+
return nextElement;
|
|
38153
|
+
}
|
|
38154
|
+
function focus(element) {
|
|
38155
|
+
if (element) {
|
|
38156
|
+
element.focus();
|
|
38157
|
+
}
|
|
38158
|
+
}
|
|
38159
|
+
function renderCustomInputs(placeholder, elementFunctions, allowMultipleInstances) {
|
|
38160
|
+
var usedFunctions = [];
|
|
38161
|
+
var pattern = new RegExp(Object.keys(elementFunctions)
|
|
38162
|
+
.map(function (el) { return "".concat(el, "+"); })
|
|
38163
|
+
.join('|'), 'g');
|
|
38164
|
+
var matches = placeholder.match(pattern);
|
|
38165
|
+
return placeholder.split(pattern).reduce(function (arr, element, index) {
|
|
38166
|
+
var divider = element && (
|
|
38167
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
38168
|
+
React__default["default"].createElement(Divider, { key: "separator_".concat(index) }, element));
|
|
38169
|
+
var res = __spreadArray$1(__spreadArray$1([], arr, true), [divider], false);
|
|
38170
|
+
var currentMatch = matches && matches[index];
|
|
38171
|
+
if (currentMatch) {
|
|
38172
|
+
var renderFunction = elementFunctions[currentMatch] ||
|
|
38173
|
+
elementFunctions[Object.keys(elementFunctions).find(function (elementFunction) {
|
|
38174
|
+
return currentMatch.match(elementFunction);
|
|
38175
|
+
})];
|
|
38176
|
+
if (!renderFunction) {
|
|
38177
|
+
return res;
|
|
38178
|
+
}
|
|
38179
|
+
if (!allowMultipleInstances && usedFunctions.includes(renderFunction)) {
|
|
38180
|
+
res.push(currentMatch);
|
|
38181
|
+
}
|
|
38182
|
+
else {
|
|
38183
|
+
res.push(renderFunction(currentMatch, index));
|
|
38184
|
+
usedFunctions.push(renderFunction);
|
|
38185
|
+
}
|
|
38186
|
+
}
|
|
38187
|
+
return res;
|
|
38188
|
+
}, []);
|
|
38189
|
+
}
|
|
38190
|
+
var formatNumber = getNumberFormatter({ useGrouping: false });
|
|
38191
|
+
function TimeInput(_a) {
|
|
38192
|
+
var amPmAriaLabel = _a.amPmAriaLabel, autoFocus = _a.autoFocus, className = _a.className, disabled = _a.disabled, format = _a.format, hourAriaLabel = _a.hourAriaLabel, hourPlaceholder = _a.hourPlaceholder, _b = _a.isClockOpen, isClockOpenProps = _b === void 0 ? null : _b, locale = _a.locale, _c = _a.maxDetail, maxDetail = _c === void 0 ? 'minute' : _c, maxTime = _a.maxTime, minTime = _a.minTime, minuteAriaLabel = _a.minuteAriaLabel, minutePlaceholder = _a.minutePlaceholder, _d = _a.name, name = _d === void 0 ? 'time' : _d, nativeInputAriaLabel = _a.nativeInputAriaLabel, onChangeProps = _a.onChange, onInvalidChange = _a.onInvalidChange, required = _a.required, secondAriaLabel = _a.secondAriaLabel, secondPlaceholder = _a.secondPlaceholder, valueProps = _a.value;
|
|
38193
|
+
var _e = React$5.useState(null), amPm = _e[0], setAmPm = _e[1];
|
|
38194
|
+
var _f = React$5.useState(null), hour = _f[0], setHour = _f[1];
|
|
38195
|
+
var _g = React$5.useState(null), minute = _g[0], setMinute = _g[1];
|
|
38196
|
+
var _h = React$5.useState(null), second = _h[0], setSecond = _h[1];
|
|
38197
|
+
var _j = React$5.useState(null), value = _j[0], setValue = _j[1];
|
|
38198
|
+
var amPmInput = React$5.useRef(null);
|
|
38199
|
+
var hour12Input = React$5.useRef(null);
|
|
38200
|
+
var hour24Input = React$5.useRef(null);
|
|
38201
|
+
var minuteInput = React$5.useRef(null);
|
|
38202
|
+
var secondInput = React$5.useRef(null);
|
|
38203
|
+
var _k = React$5.useState(isClockOpenProps), isClockOpen = _k[0], setIsClockOpen = _k[1];
|
|
38204
|
+
var lastPressedKey = React$5.useRef();
|
|
38205
|
+
React$5.useEffect(function () {
|
|
38206
|
+
setIsClockOpen(isClockOpenProps);
|
|
38207
|
+
}, [isClockOpenProps]);
|
|
38208
|
+
React$5.useEffect(function () {
|
|
38209
|
+
var nextValue = valueProps;
|
|
38210
|
+
if (nextValue) {
|
|
38211
|
+
setAmPm(convert24to12(getHours(nextValue))[1]);
|
|
38212
|
+
setHour(getHours(nextValue).toString());
|
|
38213
|
+
setMinute(getMinutes(nextValue).toString());
|
|
38214
|
+
setSecond(getSeconds(nextValue).toString());
|
|
38215
|
+
setValue(nextValue);
|
|
38216
|
+
}
|
|
38217
|
+
else {
|
|
38218
|
+
setAmPm(null);
|
|
38219
|
+
setHour(null);
|
|
38220
|
+
setMinute(null);
|
|
38221
|
+
setSecond(null);
|
|
38222
|
+
setValue(null);
|
|
38223
|
+
}
|
|
38224
|
+
}, [
|
|
38225
|
+
valueProps,
|
|
38226
|
+
minTime,
|
|
38227
|
+
maxTime,
|
|
38228
|
+
maxDetail,
|
|
38229
|
+
// Toggling clock visibility resets values
|
|
38230
|
+
isClockOpen,
|
|
38231
|
+
]);
|
|
38232
|
+
var valueType = maxDetail;
|
|
38233
|
+
var formatTime = (function () {
|
|
38234
|
+
var level = allViews$2.indexOf(maxDetail);
|
|
38235
|
+
var formatterOptions = getFormatterOptionsCache[level] ||
|
|
38236
|
+
(function () {
|
|
38237
|
+
var options = { hour: 'numeric' };
|
|
38238
|
+
if (level >= 1) {
|
|
38239
|
+
options.minute = 'numeric';
|
|
38240
|
+
}
|
|
38241
|
+
if (level >= 2) {
|
|
38242
|
+
options.second = 'numeric';
|
|
38243
|
+
}
|
|
38244
|
+
getFormatterOptionsCache[level] = options;
|
|
38245
|
+
return options;
|
|
38246
|
+
})();
|
|
38247
|
+
return getFormatter(formatterOptions);
|
|
38248
|
+
})();
|
|
38249
|
+
/**
|
|
38250
|
+
* Gets current value in a desired format.
|
|
38251
|
+
*/
|
|
38252
|
+
function getProcessedValue(value) {
|
|
38253
|
+
var processFunction = (function () {
|
|
38254
|
+
switch (valueType) {
|
|
38255
|
+
case 'hour':
|
|
38256
|
+
case 'minute':
|
|
38257
|
+
return getHoursMinutes;
|
|
38258
|
+
case 'second':
|
|
38259
|
+
return getHoursMinutesSeconds;
|
|
38260
|
+
default:
|
|
38261
|
+
throw new Error('Invalid valueType');
|
|
38262
|
+
}
|
|
38263
|
+
})();
|
|
38264
|
+
return processFunction(value);
|
|
38265
|
+
}
|
|
38266
|
+
var placeholder = format ||
|
|
38267
|
+
(function () {
|
|
38268
|
+
var hour24 = 21;
|
|
38269
|
+
var hour12 = 9;
|
|
38270
|
+
var minute = 13;
|
|
38271
|
+
var second = 14;
|
|
38272
|
+
var date = new Date(2017, 0, 1, hour24, minute, second);
|
|
38273
|
+
return formatTime(locale, date)
|
|
38274
|
+
.replace(formatNumber(locale, hour12), 'h')
|
|
38275
|
+
.replace(formatNumber(locale, hour24), 'H')
|
|
38276
|
+
.replace(formatNumber(locale, minute), 'mm')
|
|
38277
|
+
.replace(formatNumber(locale, second), 'ss')
|
|
38278
|
+
.replace(new RegExp(getAmPmLabels(locale).join('|')), 'a');
|
|
38279
|
+
})();
|
|
38280
|
+
var divider = (function () {
|
|
38281
|
+
var dividers = placeholder.match(/[^0-9a-z]/i);
|
|
38282
|
+
return dividers ? dividers[0] : null;
|
|
38283
|
+
})();
|
|
38284
|
+
function onClick(event) {
|
|
38285
|
+
if (event.target === event.currentTarget) {
|
|
38286
|
+
// Wrapper was directly clicked
|
|
38287
|
+
var firstInput = event.target.children[1];
|
|
38288
|
+
focus(firstInput);
|
|
38289
|
+
}
|
|
38290
|
+
}
|
|
38291
|
+
function onKeyDown(event) {
|
|
38292
|
+
lastPressedKey.current = event.key;
|
|
38293
|
+
switch (event.key) {
|
|
38294
|
+
case 'ArrowLeft':
|
|
38295
|
+
case 'ArrowRight':
|
|
38296
|
+
case divider: {
|
|
38297
|
+
event.preventDefault();
|
|
38298
|
+
var input = event.target;
|
|
38299
|
+
var property = event.key === 'ArrowLeft' ? 'previousElementSibling' : 'nextElementSibling';
|
|
38300
|
+
var nextInput = findInput(input, property);
|
|
38301
|
+
focus(nextInput);
|
|
38302
|
+
break;
|
|
38303
|
+
}
|
|
38304
|
+
}
|
|
38305
|
+
}
|
|
38306
|
+
function onKeyUp(event) {
|
|
38307
|
+
var key = event.key, input = event.target;
|
|
38308
|
+
var isLastPressedKey = lastPressedKey.current === key;
|
|
38309
|
+
if (!isLastPressedKey) {
|
|
38310
|
+
return;
|
|
38311
|
+
}
|
|
38312
|
+
var isNumberKey = !isNaN(Number(key));
|
|
38313
|
+
if (!isNumberKey) {
|
|
38314
|
+
return;
|
|
38315
|
+
}
|
|
38316
|
+
var max = input.getAttribute('max');
|
|
38317
|
+
if (!max) {
|
|
38318
|
+
return;
|
|
38319
|
+
}
|
|
38320
|
+
var value = input.value;
|
|
38321
|
+
/**
|
|
38322
|
+
* Given 1, the smallest possible number the user could type by adding another digit is 10.
|
|
38323
|
+
* 10 would be a valid value given max = 12, so we won't jump to the next input.
|
|
38324
|
+
* However, given 2, smallers possible number would be 20, and thus keeping the focus in
|
|
38325
|
+
* this field doesn't make sense.
|
|
38326
|
+
*/
|
|
38327
|
+
if (Number(value) * 10 > Number(max) || value.length >= max.length) {
|
|
38328
|
+
var property = 'nextElementSibling';
|
|
38329
|
+
var nextInput = findInput(input, property);
|
|
38330
|
+
focus(nextInput);
|
|
38331
|
+
}
|
|
38332
|
+
}
|
|
38333
|
+
/**
|
|
38334
|
+
* Called after internal onChange. Checks input validity. If all fields are valid,
|
|
38335
|
+
* calls props.onChange.
|
|
38336
|
+
*/
|
|
38337
|
+
function onChangeExternal() {
|
|
38338
|
+
if (!onChangeProps) {
|
|
38339
|
+
return;
|
|
38340
|
+
}
|
|
38341
|
+
function filterBoolean(value) {
|
|
38342
|
+
return Boolean(value);
|
|
38343
|
+
}
|
|
38344
|
+
var formElements = [
|
|
38345
|
+
amPmInput.current,
|
|
38346
|
+
hour12Input.current,
|
|
38347
|
+
hour24Input.current,
|
|
38348
|
+
minuteInput.current,
|
|
38349
|
+
secondInput.current,
|
|
38350
|
+
].filter(filterBoolean);
|
|
38351
|
+
var formElementsWithoutSelect = formElements.slice(1);
|
|
38352
|
+
var values = {};
|
|
38353
|
+
formElements.forEach(function (formElement) {
|
|
38354
|
+
values[formElement.name] =
|
|
38355
|
+
formElement.type === 'number'
|
|
38356
|
+
? 'valueAsNumber' in formElement
|
|
38357
|
+
? formElement.valueAsNumber
|
|
38358
|
+
: Number(formElement.value)
|
|
38359
|
+
: formElement.value;
|
|
38360
|
+
});
|
|
38361
|
+
var isEveryValueEmpty = formElementsWithoutSelect.every(function (formElement) { return !formElement.value; });
|
|
38362
|
+
if (isEveryValueEmpty) {
|
|
38363
|
+
onChangeProps(null, false);
|
|
38364
|
+
return;
|
|
38365
|
+
}
|
|
38366
|
+
var isEveryValueFilled = formElements.every(function (formElement) { return formElement.value; });
|
|
38367
|
+
var isEveryValueValid = formElements.every(function (formElement) { return formElement.validity.valid; });
|
|
38368
|
+
if (isEveryValueFilled && isEveryValueValid) {
|
|
38369
|
+
var hour_1 = Number(values.hour24 ||
|
|
38370
|
+
(values.hour12 && values.amPm && convert12to24(values.hour12, values.amPm)) ||
|
|
38371
|
+
0);
|
|
38372
|
+
var minute_1 = Number(values.minute || 0);
|
|
38373
|
+
var second_1 = Number(values.second || 0);
|
|
38374
|
+
var padStart = function (num) { return "0".concat(num).slice(-2); };
|
|
38375
|
+
var proposedValue = "".concat(padStart(hour_1), ":").concat(padStart(minute_1), ":").concat(padStart(second_1));
|
|
38376
|
+
var processedValue = getProcessedValue(proposedValue);
|
|
38377
|
+
onChangeProps(processedValue, false);
|
|
38378
|
+
return;
|
|
38379
|
+
}
|
|
38380
|
+
if (!onInvalidChange) {
|
|
38381
|
+
return;
|
|
38382
|
+
}
|
|
38383
|
+
onInvalidChange();
|
|
38384
|
+
}
|
|
38385
|
+
/**
|
|
38386
|
+
* Called when non-native date input is changed.
|
|
38387
|
+
*/
|
|
38388
|
+
function onChange(event) {
|
|
38389
|
+
var _a = event.target, name = _a.name, value = _a.value;
|
|
38390
|
+
switch (name) {
|
|
38391
|
+
case 'amPm':
|
|
38392
|
+
setAmPm(value);
|
|
38393
|
+
break;
|
|
38394
|
+
case 'hour12':
|
|
38395
|
+
setHour(value ? convert12to24(value, amPm || 'am').toString() : '');
|
|
38396
|
+
break;
|
|
38397
|
+
case 'hour24':
|
|
38398
|
+
setHour(value);
|
|
38399
|
+
break;
|
|
38400
|
+
case 'minute':
|
|
38401
|
+
setMinute(value);
|
|
38402
|
+
break;
|
|
38403
|
+
case 'second':
|
|
38404
|
+
setSecond(value);
|
|
38405
|
+
break;
|
|
38406
|
+
}
|
|
38407
|
+
onChangeExternal();
|
|
38408
|
+
}
|
|
38409
|
+
/**
|
|
38410
|
+
* Called when native date input is changed.
|
|
38411
|
+
*/
|
|
38412
|
+
function onChangeNative(event) {
|
|
38413
|
+
var value = event.target.value;
|
|
38414
|
+
if (!onChangeProps) {
|
|
38415
|
+
return;
|
|
38416
|
+
}
|
|
38417
|
+
var processedValue = value || null;
|
|
38418
|
+
onChangeProps(processedValue, false);
|
|
38419
|
+
}
|
|
38420
|
+
var commonInputProps = {
|
|
38421
|
+
className: className,
|
|
38422
|
+
disabled: disabled,
|
|
38423
|
+
maxTime: maxTime,
|
|
38424
|
+
minTime: minTime,
|
|
38425
|
+
onChange: onChange,
|
|
38426
|
+
onKeyDown: onKeyDown,
|
|
38427
|
+
onKeyUp: onKeyUp,
|
|
38428
|
+
// This is only for showing validity when editing
|
|
38429
|
+
required: Boolean(required || isClockOpen),
|
|
38430
|
+
};
|
|
38431
|
+
function renderHour12(currentMatch, index) {
|
|
38432
|
+
if (currentMatch && currentMatch.length > 2) {
|
|
38433
|
+
throw new Error("Unsupported token: ".concat(currentMatch));
|
|
38434
|
+
}
|
|
38435
|
+
var showLeadingZeros = currentMatch ? currentMatch.length === 2 : false;
|
|
38436
|
+
return (React__default["default"].createElement(Hour12Input, __assign$1({ key: "hour12" }, commonInputProps, { amPm: amPm, ariaLabel: hourAriaLabel,
|
|
38437
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
38438
|
+
autoFocus: index === 0 && autoFocus, inputRef: hour12Input, placeholder: hourPlaceholder, showLeadingZeros: showLeadingZeros, value: hour })));
|
|
38439
|
+
}
|
|
38440
|
+
function renderHour24(currentMatch, index) {
|
|
38441
|
+
if (currentMatch && currentMatch.length > 2) {
|
|
38442
|
+
throw new Error("Unsupported token: ".concat(currentMatch));
|
|
38443
|
+
}
|
|
38444
|
+
var showLeadingZeros = currentMatch ? currentMatch.length === 2 : false;
|
|
38445
|
+
return (React__default["default"].createElement(Hour24Input, __assign$1({ key: "hour24" }, commonInputProps, { ariaLabel: hourAriaLabel,
|
|
38446
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
38447
|
+
autoFocus: index === 0 && autoFocus, inputRef: hour24Input, placeholder: hourPlaceholder, showLeadingZeros: showLeadingZeros, value: hour })));
|
|
38448
|
+
}
|
|
38449
|
+
function renderHour(currentMatch, index) {
|
|
38450
|
+
if (/h/.test(currentMatch)) {
|
|
38451
|
+
return renderHour12(currentMatch, index);
|
|
38452
|
+
}
|
|
38453
|
+
return renderHour24(currentMatch, index);
|
|
38454
|
+
}
|
|
38455
|
+
function renderMinute(currentMatch, index) {
|
|
38456
|
+
if (currentMatch && currentMatch.length > 2) {
|
|
38457
|
+
throw new Error("Unsupported token: ".concat(currentMatch));
|
|
38458
|
+
}
|
|
38459
|
+
var showLeadingZeros = currentMatch ? currentMatch.length === 2 : false;
|
|
38460
|
+
return (React__default["default"].createElement(MinuteInput, __assign$1({ key: "minute" }, commonInputProps, { ariaLabel: minuteAriaLabel,
|
|
38461
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
38462
|
+
autoFocus: index === 0 && autoFocus, hour: hour, inputRef: minuteInput, placeholder: minutePlaceholder, showLeadingZeros: showLeadingZeros, value: minute })));
|
|
38463
|
+
}
|
|
38464
|
+
function renderSecond(currentMatch, index) {
|
|
38465
|
+
if (currentMatch && currentMatch.length > 2) {
|
|
38466
|
+
throw new Error("Unsupported token: ".concat(currentMatch));
|
|
38467
|
+
}
|
|
38468
|
+
var showLeadingZeros = currentMatch ? currentMatch.length === 2 : true;
|
|
38469
|
+
return (React__default["default"].createElement(SecondInput, __assign$1({ key: "second" }, commonInputProps, { ariaLabel: secondAriaLabel,
|
|
38470
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
38471
|
+
autoFocus: index === 0 && autoFocus, hour: hour, inputRef: secondInput, minute: minute, placeholder: secondPlaceholder, showLeadingZeros: showLeadingZeros, value: second })));
|
|
38472
|
+
}
|
|
38473
|
+
function renderAmPm(currentMatch, index) {
|
|
38474
|
+
return (React__default["default"].createElement(AmPm, __assign$1({ key: "ampm" }, commonInputProps, { ariaLabel: amPmAriaLabel,
|
|
38475
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
38476
|
+
autoFocus: index === 0 && autoFocus, inputRef: amPmInput, locale: locale, onChange: onChange, value: amPm })));
|
|
38477
|
+
}
|
|
38478
|
+
function renderCustomInputsInternal() {
|
|
38479
|
+
var elementFunctions = {
|
|
38480
|
+
h: renderHour,
|
|
38481
|
+
H: renderHour,
|
|
38482
|
+
m: renderMinute,
|
|
38483
|
+
s: renderSecond,
|
|
38484
|
+
a: renderAmPm,
|
|
38485
|
+
};
|
|
38486
|
+
var allowMultipleInstances = typeof format !== 'undefined';
|
|
38487
|
+
return renderCustomInputs(placeholder, elementFunctions, allowMultipleInstances);
|
|
38488
|
+
}
|
|
38489
|
+
function renderNativeInput() {
|
|
38490
|
+
return (React__default["default"].createElement(NativeInput, { key: "time", ariaLabel: nativeInputAriaLabel, disabled: disabled, maxTime: maxTime, minTime: minTime, name: name, onChange: onChangeNative, required: required, value: value, valueType: valueType }));
|
|
38491
|
+
}
|
|
38492
|
+
return (
|
|
38493
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
38494
|
+
React__default["default"].createElement("div", { className: className, onClick: onClick },
|
|
38495
|
+
renderNativeInput(),
|
|
38496
|
+
renderCustomInputsInternal()));
|
|
38497
|
+
}
|
|
38498
|
+
|
|
38499
|
+
var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
|
38500
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
38501
|
+
if (ar || !(i in from)) {
|
|
38502
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
38503
|
+
ar[i] = from[i];
|
|
38504
|
+
}
|
|
38505
|
+
}
|
|
38506
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
38507
|
+
};
|
|
38508
|
+
var allViews$1 = ['hour', 'minute', 'second'];
|
|
38509
|
+
var allValueTypes = __spreadArray([], allViews$1, true);
|
|
38510
|
+
var hourOptionalSecondsRegExp = /^(([0-1])?[0-9]|2[0-3]):[0-5][0-9](:([0-5][0-9]))?$/;
|
|
38511
|
+
var isTime = function isTime(props, propName, componentName) {
|
|
38512
|
+
var _a = props, _b = propName, time = _a[_b];
|
|
38513
|
+
if (time) {
|
|
38514
|
+
if (typeof time !== 'string' || !hourOptionalSecondsRegExp.test(time)) {
|
|
38515
|
+
return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof time, "` supplied to `").concat(componentName, "`, expected time in HH:mm(:ss) format."));
|
|
38516
|
+
}
|
|
38517
|
+
}
|
|
38518
|
+
// Everything is fine
|
|
38519
|
+
return null;
|
|
38520
|
+
};
|
|
38521
|
+
propTypes$1.exports.oneOf(allValueTypes);
|
|
38522
|
+
propTypes$1.exports.oneOfType([
|
|
38523
|
+
propTypes$1.exports.func,
|
|
38524
|
+
propTypes$1.exports.exact({
|
|
38525
|
+
current: propTypes$1.exports.any,
|
|
38526
|
+
}),
|
|
38527
|
+
]);
|
|
38528
|
+
var rangeOf = function (type) {
|
|
38529
|
+
return propTypes$1.exports.arrayOf(type);
|
|
38530
|
+
};
|
|
38531
|
+
|
|
38532
|
+
var __assign = (undefined && undefined.__assign) || function () {
|
|
38533
|
+
__assign = Object.assign || function(t) {
|
|
38534
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
38535
|
+
s = arguments[i];
|
|
38536
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
38537
|
+
t[p] = s[p];
|
|
38538
|
+
}
|
|
38539
|
+
return t;
|
|
38540
|
+
};
|
|
38541
|
+
return __assign.apply(this, arguments);
|
|
38542
|
+
};
|
|
38543
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
38544
|
+
var t = {};
|
|
38545
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
38546
|
+
t[p] = s[p];
|
|
38547
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
38548
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
38549
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
38550
|
+
t[p[i]] = s[p[i]];
|
|
38551
|
+
}
|
|
38552
|
+
return t;
|
|
38553
|
+
};
|
|
38554
|
+
var isBrowser = typeof document !== 'undefined';
|
|
38555
|
+
var baseClassName = 'react-time-picker';
|
|
38556
|
+
var outsideActionEvents = ['mousedown', 'focusin', 'touchstart'];
|
|
38557
|
+
var allViews = ['hour', 'minute', 'second'];
|
|
38558
|
+
var iconProps = {
|
|
38559
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
38560
|
+
width: 19,
|
|
38561
|
+
height: 19,
|
|
38562
|
+
viewBox: '0 0 19 19',
|
|
38563
|
+
stroke: 'black',
|
|
38564
|
+
strokeWidth: 2,
|
|
38565
|
+
};
|
|
38566
|
+
var ClockIcon = (React__default["default"].createElement("svg", __assign({}, iconProps, { className: "".concat(baseClassName, "__clock-button__icon ").concat(baseClassName, "__button__icon"), fill: "none" }),
|
|
38567
|
+
React__default["default"].createElement("circle", { cx: "9.5", cy: "9.5", r: "7.5" }),
|
|
38568
|
+
React__default["default"].createElement("path", { d: "M9.5 4.5 v5 h4" })));
|
|
38569
|
+
var ClearIcon = (React__default["default"].createElement("svg", __assign({}, iconProps, { className: "".concat(baseClassName, "__clear-button__icon ").concat(baseClassName, "__button__icon") }),
|
|
38570
|
+
React__default["default"].createElement("line", { x1: "4", x2: "15", y1: "4", y2: "15" }),
|
|
38571
|
+
React__default["default"].createElement("line", { x1: "15", x2: "4", y1: "4", y2: "15" })));
|
|
38572
|
+
var TimePicker = function TimePicker(props) {
|
|
38573
|
+
var amPmAriaLabel = props.amPmAriaLabel, autoFocus = props.autoFocus, className = props.className, clearAriaLabel = props.clearAriaLabel, _a = props.clearIcon, clearIcon = _a === void 0 ? ClearIcon : _a, clockAriaLabel = props.clockAriaLabel, _b = props.clockIcon, clockIcon = _b === void 0 ? ClockIcon : _b, _c = props.closeClock, shouldCloseClockOnSelect = _c === void 0 ? true : _c, dataTestid = props["data-testid"], hourAriaLabel = props.hourAriaLabel, hourPlaceholder = props.hourPlaceholder, disableClock = props.disableClock, disabled = props.disabled, format = props.format, id = props.id, _d = props.isOpen, isOpenProps = _d === void 0 ? null : _d, locale = props.locale, maxTime = props.maxTime, _e = props.maxDetail, maxDetail = _e === void 0 ? 'minute' : _e, minTime = props.minTime, minuteAriaLabel = props.minuteAriaLabel, minutePlaceholder = props.minutePlaceholder, _f = props.name, name = _f === void 0 ? 'time' : _f, nativeInputAriaLabel = props.nativeInputAriaLabel, onClockClose = props.onClockClose, onClockOpen = props.onClockOpen, onChangeProps = props.onChange, onFocusProps = props.onFocus, onInvalidChange = props.onInvalidChange, _g = props.openClockOnFocus, openClockOnFocus = _g === void 0 ? true : _g, required = props.required, value = props.value, secondAriaLabel = props.secondAriaLabel, secondPlaceholder = props.secondPlaceholder, shouldCloseClock = props.shouldCloseClock, shouldOpenClock = props.shouldOpenClock, otherProps = __rest(props, ["amPmAriaLabel", "autoFocus", "className", "clearAriaLabel", "clearIcon", "clockAriaLabel", "clockIcon", "closeClock", 'data-testid', "hourAriaLabel", "hourPlaceholder", "disableClock", "disabled", "format", "id", "isOpen", "locale", "maxTime", "maxDetail", "minTime", "minuteAriaLabel", "minutePlaceholder", "name", "nativeInputAriaLabel", "onClockClose", "onClockOpen", "onChange", "onFocus", "onInvalidChange", "openClockOnFocus", "required", "value", "secondAriaLabel", "secondPlaceholder", "shouldCloseClock", "shouldOpenClock"]);
|
|
38574
|
+
var _h = React$5.useState(isOpenProps), isOpen = _h[0], setIsOpen = _h[1];
|
|
38575
|
+
var wrapper = React$5.useRef(null);
|
|
38576
|
+
var clockWrapper = React$5.useRef(null);
|
|
38577
|
+
React$5.useEffect(function () {
|
|
38578
|
+
setIsOpen(isOpenProps);
|
|
38579
|
+
}, [isOpenProps]);
|
|
38580
|
+
function openClock(_a) {
|
|
38581
|
+
var reason = _a.reason;
|
|
38582
|
+
if (shouldOpenClock) {
|
|
38583
|
+
if (!shouldOpenClock({ reason: reason })) {
|
|
38584
|
+
return;
|
|
38585
|
+
}
|
|
38586
|
+
}
|
|
38587
|
+
setIsOpen(true);
|
|
38588
|
+
if (onClockOpen) {
|
|
38589
|
+
onClockOpen();
|
|
38590
|
+
}
|
|
38591
|
+
}
|
|
38592
|
+
var closeClock = React$5.useCallback(function (_a) {
|
|
38593
|
+
var reason = _a.reason;
|
|
38594
|
+
if (shouldCloseClock) {
|
|
38595
|
+
if (!shouldCloseClock({ reason: reason })) {
|
|
38596
|
+
return;
|
|
38597
|
+
}
|
|
38598
|
+
}
|
|
38599
|
+
setIsOpen(false);
|
|
38600
|
+
if (onClockClose) {
|
|
38601
|
+
onClockClose();
|
|
38602
|
+
}
|
|
38603
|
+
}, [onClockClose, shouldCloseClock]);
|
|
38604
|
+
function toggleClock() {
|
|
38605
|
+
if (isOpen) {
|
|
38606
|
+
closeClock({ reason: 'buttonClick' });
|
|
38607
|
+
}
|
|
38608
|
+
else {
|
|
38609
|
+
openClock({ reason: 'buttonClick' });
|
|
38610
|
+
}
|
|
38611
|
+
}
|
|
38612
|
+
function onChange(value, shouldCloseClock) {
|
|
38613
|
+
if (shouldCloseClock === void 0) { shouldCloseClock = shouldCloseClockOnSelect; }
|
|
38614
|
+
if (shouldCloseClock) {
|
|
38615
|
+
closeClock({ reason: 'select' });
|
|
38616
|
+
}
|
|
38617
|
+
if (onChangeProps) {
|
|
38618
|
+
onChangeProps(value);
|
|
38619
|
+
}
|
|
38620
|
+
}
|
|
38621
|
+
function onFocus(event) {
|
|
38622
|
+
if (onFocusProps) {
|
|
38623
|
+
onFocusProps(event);
|
|
38624
|
+
}
|
|
38625
|
+
if (
|
|
38626
|
+
// Internet Explorer still fires onFocus on disabled elements
|
|
38627
|
+
disabled ||
|
|
38628
|
+
isOpen ||
|
|
38629
|
+
!openClockOnFocus ||
|
|
38630
|
+
event.target.dataset.select === 'true') {
|
|
38631
|
+
return;
|
|
38632
|
+
}
|
|
38633
|
+
openClock({ reason: 'focus' });
|
|
38634
|
+
}
|
|
38635
|
+
var onKeyDown = React$5.useCallback(function (event) {
|
|
38636
|
+
if (event.key === 'Escape') {
|
|
38637
|
+
closeClock({ reason: 'escape' });
|
|
38638
|
+
}
|
|
38639
|
+
}, [closeClock]);
|
|
38640
|
+
function clear() {
|
|
38641
|
+
onChange(null);
|
|
38642
|
+
}
|
|
38643
|
+
function stopPropagation(event) {
|
|
38644
|
+
event.stopPropagation();
|
|
38645
|
+
}
|
|
38646
|
+
var onOutsideAction = React$5.useCallback(function (event) {
|
|
38647
|
+
var wrapperEl = wrapper.current;
|
|
38648
|
+
var clockWrapperEl = clockWrapper.current;
|
|
38649
|
+
// Try event.composedPath first to handle clicks inside a Shadow DOM.
|
|
38650
|
+
var target = ('composedPath' in event ? event.composedPath()[0] : event.target);
|
|
38651
|
+
if (target &&
|
|
38652
|
+
wrapperEl &&
|
|
38653
|
+
!wrapperEl.contains(target) &&
|
|
38654
|
+
(!clockWrapperEl || !clockWrapperEl.contains(target))) {
|
|
38655
|
+
closeClock({ reason: 'outsideAction' });
|
|
38656
|
+
}
|
|
38657
|
+
}, [clockWrapper, closeClock, wrapper]);
|
|
38658
|
+
var handleOutsideActionListeners = React$5.useCallback(function (shouldListen) {
|
|
38659
|
+
if (shouldListen === void 0) { shouldListen = isOpen; }
|
|
38660
|
+
outsideActionEvents.forEach(function (event) {
|
|
38661
|
+
if (shouldListen) {
|
|
38662
|
+
document.addEventListener(event, onOutsideAction);
|
|
38663
|
+
}
|
|
38664
|
+
else {
|
|
38665
|
+
document.removeEventListener(event, onOutsideAction);
|
|
38666
|
+
}
|
|
38667
|
+
});
|
|
38668
|
+
if (shouldListen) {
|
|
38669
|
+
document.addEventListener('keydown', onKeyDown);
|
|
38670
|
+
}
|
|
38671
|
+
else {
|
|
38672
|
+
document.removeEventListener('keydown', onKeyDown);
|
|
38673
|
+
}
|
|
38674
|
+
}, [isOpen, onOutsideAction, onKeyDown]);
|
|
38675
|
+
React$5.useEffect(function () {
|
|
38676
|
+
handleOutsideActionListeners();
|
|
38677
|
+
return function () {
|
|
38678
|
+
handleOutsideActionListeners(false);
|
|
38679
|
+
};
|
|
38680
|
+
}, [handleOutsideActionListeners]);
|
|
38681
|
+
function renderInputs() {
|
|
38682
|
+
var valueFrom = (Array.isArray(value) ? value : [value])[0];
|
|
38683
|
+
var ariaLabelProps = {
|
|
38684
|
+
amPmAriaLabel: amPmAriaLabel,
|
|
38685
|
+
hourAriaLabel: hourAriaLabel,
|
|
38686
|
+
minuteAriaLabel: minuteAriaLabel,
|
|
38687
|
+
nativeInputAriaLabel: nativeInputAriaLabel,
|
|
38688
|
+
secondAriaLabel: secondAriaLabel,
|
|
38689
|
+
};
|
|
38690
|
+
var placeholderProps = {
|
|
38691
|
+
hourPlaceholder: hourPlaceholder,
|
|
38692
|
+
minutePlaceholder: minutePlaceholder,
|
|
38693
|
+
secondPlaceholder: secondPlaceholder,
|
|
38694
|
+
};
|
|
38695
|
+
return (React__default["default"].createElement("div", { className: "".concat(baseClassName, "__wrapper") },
|
|
38696
|
+
React__default["default"].createElement(TimeInput, __assign({}, ariaLabelProps, placeholderProps, {
|
|
38697
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
38698
|
+
autoFocus: autoFocus, className: "".concat(baseClassName, "__inputGroup"), disabled: disabled, format: format, isClockOpen: isOpen, locale: locale, maxDetail: maxDetail, maxTime: maxTime, minTime: minTime, name: name, onChange: onChange, onInvalidChange: onInvalidChange, required: required, value: valueFrom })),
|
|
38699
|
+
clearIcon !== null && (React__default["default"].createElement("button", { "aria-label": clearAriaLabel, className: "".concat(baseClassName, "__clear-button ").concat(baseClassName, "__button"), disabled: disabled, onClick: clear, onFocus: stopPropagation, type: "button" }, typeof clearIcon === 'function' ? React__default["default"].createElement(clearIcon) : clearIcon)),
|
|
38700
|
+
clockIcon !== null && !disableClock && (React__default["default"].createElement("button", { "aria-label": clockAriaLabel, className: "".concat(baseClassName, "__clock-button ").concat(baseClassName, "__button"), disabled: disabled, onClick: toggleClock, onFocus: stopPropagation, type: "button" }, typeof clockIcon === 'function' ? React__default["default"].createElement(clockIcon) : clockIcon))));
|
|
38701
|
+
}
|
|
38702
|
+
function renderClock() {
|
|
38703
|
+
if (isOpen === null || disableClock) {
|
|
38704
|
+
return null;
|
|
38705
|
+
}
|
|
38706
|
+
var clockClassName = props.clockClassName; props.className; // Unused, here to exclude it from clockProps
|
|
38707
|
+
props.onChange; // Unused, here to exclude it from clockProps
|
|
38708
|
+
var portalContainer = props.portalContainer, value = props.value, clockProps = __rest(props, ["clockClassName", "className", "onChange", "portalContainer", "value"]);
|
|
38709
|
+
var className = "".concat(baseClassName, "__clock");
|
|
38710
|
+
var classNames = clsx$1(className, "".concat(className, "--").concat(isOpen ? 'open' : 'closed'));
|
|
38711
|
+
var valueFrom = (Array.isArray(value) ? value : [value])[0];
|
|
38712
|
+
var clock = React__default["default"].createElement(Clock, __assign({ className: clockClassName, value: valueFrom }, clockProps));
|
|
38713
|
+
return portalContainer ? (ReactDOM.createPortal(React__default["default"].createElement("div", { ref: clockWrapper, className: classNames }, clock), portalContainer)) : (React__default["default"].createElement(Fit, null,
|
|
38714
|
+
React__default["default"].createElement("div", { ref: function (ref) {
|
|
38715
|
+
if (ref && !isOpen) {
|
|
38716
|
+
ref.removeAttribute('style');
|
|
38717
|
+
}
|
|
38718
|
+
}, className: classNames }, clock)));
|
|
38719
|
+
}
|
|
38720
|
+
var eventProps = React$5.useMemo(function () { return makeEventProps(otherProps); }, [otherProps]);
|
|
38721
|
+
return (React__default["default"].createElement("div", __assign({ className: clsx$1(baseClassName, "".concat(baseClassName, "--").concat(isOpen ? 'open' : 'closed'), "".concat(baseClassName, "--").concat(disabled ? 'disabled' : 'enabled'), className), "data-testid": dataTestid, id: id }, eventProps, { onFocus: onFocus, ref: wrapper }),
|
|
38722
|
+
renderInputs(),
|
|
38723
|
+
renderClock()));
|
|
38724
|
+
};
|
|
38725
|
+
var isValue = propTypes$1.exports.oneOfType([isTime, propTypes$1.exports.instanceOf(Date)]);
|
|
38726
|
+
var isValueOrValueArray = propTypes$1.exports.oneOfType([isValue, rangeOf(isValue)]);
|
|
38727
|
+
TimePicker.propTypes = {
|
|
38728
|
+
amPmAriaLabel: propTypes$1.exports.string,
|
|
38729
|
+
autoFocus: propTypes$1.exports.bool,
|
|
38730
|
+
className: propTypes$1.exports.oneOfType([propTypes$1.exports.string, propTypes$1.exports.arrayOf(propTypes$1.exports.string)]),
|
|
38731
|
+
clearAriaLabel: propTypes$1.exports.string,
|
|
38732
|
+
clearIcon: propTypes$1.exports.oneOfType([propTypes$1.exports.node, propTypes$1.exports.func]),
|
|
38733
|
+
clockAriaLabel: propTypes$1.exports.string,
|
|
38734
|
+
clockClassName: propTypes$1.exports.oneOfType([propTypes$1.exports.string, propTypes$1.exports.arrayOf(propTypes$1.exports.string)]),
|
|
38735
|
+
clockIcon: propTypes$1.exports.oneOfType([propTypes$1.exports.node, propTypes$1.exports.func]),
|
|
38736
|
+
closeClock: propTypes$1.exports.bool,
|
|
38737
|
+
'data-testid': propTypes$1.exports.string,
|
|
38738
|
+
disableClock: propTypes$1.exports.bool,
|
|
38739
|
+
disabled: propTypes$1.exports.bool,
|
|
38740
|
+
format: propTypes$1.exports.string,
|
|
38741
|
+
hourAriaLabel: propTypes$1.exports.string,
|
|
38742
|
+
hourPlaceholder: propTypes$1.exports.string,
|
|
38743
|
+
id: propTypes$1.exports.string,
|
|
38744
|
+
isOpen: propTypes$1.exports.bool,
|
|
38745
|
+
locale: propTypes$1.exports.string,
|
|
38746
|
+
maxDetail: propTypes$1.exports.oneOf(allViews),
|
|
38747
|
+
maxTime: isTime,
|
|
38748
|
+
minTime: isTime,
|
|
38749
|
+
minuteAriaLabel: propTypes$1.exports.string,
|
|
38750
|
+
minutePlaceholder: propTypes$1.exports.string,
|
|
38751
|
+
name: propTypes$1.exports.string,
|
|
38752
|
+
nativeInputAriaLabel: propTypes$1.exports.string,
|
|
38753
|
+
onChange: propTypes$1.exports.func,
|
|
38754
|
+
onClockClose: propTypes$1.exports.func,
|
|
38755
|
+
onClockOpen: propTypes$1.exports.func,
|
|
38756
|
+
onFocus: propTypes$1.exports.func,
|
|
38757
|
+
openClockOnFocus: propTypes$1.exports.bool,
|
|
38758
|
+
required: propTypes$1.exports.bool,
|
|
38759
|
+
secondAriaLabel: propTypes$1.exports.string,
|
|
38760
|
+
secondPlaceholder: propTypes$1.exports.string,
|
|
38761
|
+
value: isValueOrValueArray,
|
|
38762
|
+
};
|
|
38763
|
+
if (isBrowser) {
|
|
38764
|
+
TimePicker.propTypes.portalContainer = propTypes$1.exports.instanceOf(HTMLElement);
|
|
38765
|
+
}
|
|
38766
|
+
|
|
38767
|
+
var _excluded$2 = ["className", "label", "labelProps", "size", "nakedInput", "required", "value", "onChange", "error"];
|
|
38768
|
+
dayjs.extend(customParseFormat);
|
|
38769
|
+
var INPUT_SIZES = {
|
|
38770
|
+
small: "small",
|
|
38771
|
+
medium: "medium",
|
|
38772
|
+
large: "large"
|
|
38773
|
+
};
|
|
38774
|
+
var TimePickerInput = function TimePickerInput(_ref) {
|
|
38775
|
+
var _convertToDayjsObject, _extends2;
|
|
38776
|
+
var _ref$className = _ref.className,
|
|
38777
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
38778
|
+
label = _ref.label,
|
|
38779
|
+
labelProps = _ref.labelProps,
|
|
38780
|
+
_ref$size = _ref.size,
|
|
38781
|
+
size = _ref$size === void 0 ? INPUT_SIZES.medium : _ref$size,
|
|
38782
|
+
_ref$nakedInput = _ref.nakedInput,
|
|
38783
|
+
nakedInput = _ref$nakedInput === void 0 ? false : _ref$nakedInput,
|
|
38784
|
+
_ref$required = _ref.required,
|
|
38785
|
+
required = _ref$required === void 0 ? false : _ref$required,
|
|
38786
|
+
value = _ref.value,
|
|
38787
|
+
onChange = _ref.onChange,
|
|
38788
|
+
_ref$error = _ref.error,
|
|
38789
|
+
error = _ref$error === void 0 ? "" : _ref$error,
|
|
38790
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$2);
|
|
38791
|
+
var _id = React$5.useId();
|
|
38792
|
+
var id = otherProps.id || _id;
|
|
38793
|
+
var errorId = "error_".concat(id);
|
|
38794
|
+
var handleChange = function handleChange(value) {
|
|
38795
|
+
var date = dayjs(value, "HH:mm:ss");
|
|
38796
|
+
onChange(date, value);
|
|
38797
|
+
};
|
|
38798
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
38799
|
+
className: "neeto-ui-input__wrapper"
|
|
38800
|
+
}, label && /*#__PURE__*/React__default["default"].createElement(Label, _extends$4({
|
|
38801
|
+
required: required
|
|
38802
|
+
}, labelProps), label), /*#__PURE__*/React__default["default"].createElement(TimePicker, _extends$4((_extends2 = {
|
|
38803
|
+
className: classnames$1("neeto-ui-time-picker", [className], {
|
|
38804
|
+
"neeto-ui-time-picker--small": size === "small",
|
|
38805
|
+
"neeto-ui-time-picker--medium": size === "medium",
|
|
38806
|
+
"neeto-ui-time-picker--large": size === "large",
|
|
38807
|
+
"neeto-ui-time-picker--disabled": otherProps.disabled,
|
|
38808
|
+
"neeto-ui-time-picker--naked": nakedInput,
|
|
38809
|
+
"neeto-ui-time-picker--error": !!error
|
|
38810
|
+
}),
|
|
38811
|
+
value: value,
|
|
38812
|
+
id: id,
|
|
38813
|
+
disableClock: true,
|
|
38814
|
+
clearIcon: null
|
|
38815
|
+
}, _defineProperty$7(_extends2, "value", (_convertToDayjsObject = convertToDayjsObjects(value)) === null || _convertToDayjsObject === void 0 ? void 0 : _convertToDayjsObject.toDate()), _defineProperty$7(_extends2, "onChange", handleChange), _extends2), otherProps)), !!error && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
38816
|
+
className: "neeto-ui-input__error",
|
|
38817
|
+
"data-cy": "".concat(hyphenize(label), "-input-error"),
|
|
38818
|
+
id: errorId
|
|
38819
|
+
}, error));
|
|
38820
|
+
};
|
|
38821
|
+
TimePickerInput.displayName = "TimePicker";
|
|
36191
38822
|
|
|
36192
38823
|
var dist = {};
|
|
36193
38824
|
|
|
@@ -39098,7 +41729,7 @@ exports.Checkbox = Checkbox;
|
|
|
39098
41729
|
exports.ColorPicker = ColorPicker;
|
|
39099
41730
|
exports.DatePicker = DatePicker;
|
|
39100
41731
|
exports.Dropdown = Dropdown;
|
|
39101
|
-
exports.Input = Input$
|
|
41732
|
+
exports.Input = Input$3;
|
|
39102
41733
|
exports.Kbd = Kbd;
|
|
39103
41734
|
exports.Label = Label;
|
|
39104
41735
|
exports.Modal = Modal;
|
|
@@ -39116,7 +41747,8 @@ exports.Tab = Tab;
|
|
|
39116
41747
|
exports.Table = Table;
|
|
39117
41748
|
exports.Tag = Tag;
|
|
39118
41749
|
exports.Textarea = Textarea;
|
|
39119
|
-
exports.TimePicker = TimePicker;
|
|
41750
|
+
exports.TimePicker = TimePicker$1;
|
|
41751
|
+
exports.TimePickerInput = TimePickerInput;
|
|
39120
41752
|
exports.Toastr = Toastr;
|
|
39121
41753
|
exports.Tooltip = Tooltip;
|
|
39122
41754
|
exports.TreeSelect = TreeSelect;
|