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