@bigbinary/neetoui 5.2.20 → 5.2.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/formik.cjs.js +4 -3
- package/formik.cjs.js.map +1 -1
- package/formik.js +4 -3
- package/formik.js.map +1 -1
- package/index.cjs.js +2813 -181
- package/index.cjs.js.map +1 -1
- package/index.css +1 -1
- package/index.d.ts +11 -0
- package/index.js +2815 -184
- package/index.js.map +1 -1
- package/layouts.cjs.js.map +1 -1
- package/layouts.js.map +1 -1
- package/package.json +2 -1
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React$5 from 'react';
|
|
2
|
-
import React__default, { createContext, useLayoutEffect, useEffect, useContext, useRef, useInsertionEffect as useInsertionEffect$1, useCallback, useMemo, forwardRef as forwardRef$1, createElement, useId as useId$1, useState, cloneElement as cloneElement$1, Children, isValidElement, useSyncExternalStore, Fragment, Component } from 'react';
|
|
3
|
-
import { Right, Down, Close, Info, Focus, Left, Calendar, Check, MenuHorizontal, Clock, CheckCircle, Warning, CloseCircle } from '@bigbinary/neeto-icons';
|
|
2
|
+
import React__default, { createContext, useLayoutEffect, useEffect, useContext, useRef, useInsertionEffect as useInsertionEffect$1, useCallback, useMemo, forwardRef as forwardRef$1, createElement, useId as useId$1, useState, cloneElement as cloneElement$1, Children, isValidElement, useSyncExternalStore, Fragment, Component, memo as memo$1 } from 'react';
|
|
3
|
+
import { Right, Down, Close, Info, Focus, Left, Calendar, Check, MenuHorizontal, Clock as Clock$1, CheckCircle, Warning, CloseCircle } from '@bigbinary/neeto-icons';
|
|
4
4
|
import { Link, NavLink, useHistory } from 'react-router-dom';
|
|
5
|
-
import ReactDOM, { createPortal } from 'react-dom';
|
|
5
|
+
import ReactDOM, { createPortal, findDOMNode as findDOMNode$1 } from 'react-dom';
|
|
6
6
|
import _DatePicker from 'antd/lib/date-picker';
|
|
7
7
|
import _ConfigProvider from 'antd/lib/config-provider';
|
|
8
8
|
import _Slider from 'antd/lib/slider';
|
|
@@ -2183,9 +2183,9 @@ const MotionContext = createContext({});
|
|
|
2183
2183
|
*/
|
|
2184
2184
|
const PresenceContext = createContext(null);
|
|
2185
2185
|
|
|
2186
|
-
const isBrowser$
|
|
2186
|
+
const isBrowser$9 = typeof document !== "undefined";
|
|
2187
2187
|
|
|
2188
|
-
const useIsomorphicLayoutEffect$
|
|
2188
|
+
const useIsomorphicLayoutEffect$3 = isBrowser$9 ? useLayoutEffect : useEffect;
|
|
2189
2189
|
|
|
2190
2190
|
const LazyContext = createContext({ strict: false });
|
|
2191
2191
|
|
|
@@ -2220,7 +2220,7 @@ function useVisualElement(Component, visualState, props, createVisualElement) {
|
|
|
2220
2220
|
* was present on initial render - it will be deleted after this.
|
|
2221
2221
|
*/
|
|
2222
2222
|
const canHandoff = useRef(Boolean(window.HandoffAppearAnimations));
|
|
2223
|
-
useIsomorphicLayoutEffect$
|
|
2223
|
+
useIsomorphicLayoutEffect$3(() => {
|
|
2224
2224
|
if (!visualElement)
|
|
2225
2225
|
return;
|
|
2226
2226
|
visualElement.render();
|
|
@@ -2411,7 +2411,7 @@ function createMotionComponent({ preloadedFeatures, createVisualElement, useRend
|
|
|
2411
2411
|
const { isStatic } = configAndProps;
|
|
2412
2412
|
const context = useCreateMotionContext(props);
|
|
2413
2413
|
const visualState = useVisualState(props, isStatic);
|
|
2414
|
-
if (!isStatic && isBrowser$
|
|
2414
|
+
if (!isStatic && isBrowser$9) {
|
|
2415
2415
|
/**
|
|
2416
2416
|
* Create a VisualElement for this component. A VisualElement provides a common
|
|
2417
2417
|
* interface to renderer-specific APIs (ie DOM/Three.js etc) as well as
|
|
@@ -2676,12 +2676,12 @@ const sanitize = (v) => Math.round(v * 100000) / 100000;
|
|
|
2676
2676
|
const floatRegex = /(-)?([\d]*\.?[\d])+/g;
|
|
2677
2677
|
const colorRegex = /(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi;
|
|
2678
2678
|
const singleColorRegex = /^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;
|
|
2679
|
-
function isString$
|
|
2679
|
+
function isString$4(v) {
|
|
2680
2680
|
return typeof v === "string";
|
|
2681
2681
|
}
|
|
2682
2682
|
|
|
2683
2683
|
const createUnitType = (unit) => ({
|
|
2684
|
-
test: (v) => isString$
|
|
2684
|
+
test: (v) => isString$4(v) && v.endsWith(unit) && v.split(" ").length === 1,
|
|
2685
2685
|
parse: parseFloat,
|
|
2686
2686
|
transform: (v) => `${v}${unit}`,
|
|
2687
2687
|
});
|
|
@@ -4214,11 +4214,11 @@ const easingDefinitionToFunction = (definition) => {
|
|
|
4214
4214
|
* but false if a number or multiple colors
|
|
4215
4215
|
*/
|
|
4216
4216
|
const isColorString = (type, testProp) => (v) => {
|
|
4217
|
-
return Boolean((isString$
|
|
4217
|
+
return Boolean((isString$4(v) && singleColorRegex.test(v) && v.startsWith(type)) ||
|
|
4218
4218
|
(testProp && Object.prototype.hasOwnProperty.call(v, testProp)));
|
|
4219
4219
|
};
|
|
4220
4220
|
const splitColor = (aName, bName, cName) => (v) => {
|
|
4221
|
-
if (!isString$
|
|
4221
|
+
if (!isString$4(v))
|
|
4222
4222
|
return v;
|
|
4223
4223
|
const [a, b, c, alpha] = v.match(floatRegex);
|
|
4224
4224
|
return {
|
|
@@ -4314,7 +4314,7 @@ const color = {
|
|
|
4314
4314
|
}
|
|
4315
4315
|
},
|
|
4316
4316
|
transform: (v) => {
|
|
4317
|
-
return isString$
|
|
4317
|
+
return isString$4(v)
|
|
4318
4318
|
? v
|
|
4319
4319
|
: v.hasOwnProperty("red")
|
|
4320
4320
|
? rgba.transform(v)
|
|
@@ -4420,7 +4420,7 @@ const mixColor = (from, to) => {
|
|
|
4420
4420
|
function test(v) {
|
|
4421
4421
|
var _a, _b;
|
|
4422
4422
|
return (isNaN(v) &&
|
|
4423
|
-
isString$
|
|
4423
|
+
isString$4(v) &&
|
|
4424
4424
|
(((_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) || 0) +
|
|
4425
4425
|
(((_b = v.match(colorRegex)) === null || _b === void 0 ? void 0 : _b.length) || 0) >
|
|
4426
4426
|
0);
|
|
@@ -4733,7 +4733,7 @@ function calcGeneratorVelocity(resolveValue, t, current) {
|
|
|
4733
4733
|
return velocityPerSecond(current - resolveValue(prevT), t - prevT);
|
|
4734
4734
|
}
|
|
4735
4735
|
|
|
4736
|
-
const safeMin = 0.001;
|
|
4736
|
+
const safeMin$1 = 0.001;
|
|
4737
4737
|
const minDuration = 0.01;
|
|
4738
4738
|
const maxDuration$1 = 10.0;
|
|
4739
4739
|
const minDamping = 0.05;
|
|
@@ -4758,7 +4758,7 @@ function findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1, })
|
|
|
4758
4758
|
const a = exponentialDecay - velocity;
|
|
4759
4759
|
const b = calcAngularFreq(undampedFreq, dampingRatio);
|
|
4760
4760
|
const c = Math.exp(-delta);
|
|
4761
|
-
return safeMin - (a / b) * c;
|
|
4761
|
+
return safeMin$1 - (a / b) * c;
|
|
4762
4762
|
};
|
|
4763
4763
|
derivative = (undampedFreq) => {
|
|
4764
4764
|
const exponentialDecay = undampedFreq * dampingRatio;
|
|
@@ -4767,7 +4767,7 @@ function findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1, })
|
|
|
4767
4767
|
const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;
|
|
4768
4768
|
const f = Math.exp(-delta);
|
|
4769
4769
|
const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);
|
|
4770
|
-
const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;
|
|
4770
|
+
const factor = -envelope(undampedFreq) + safeMin$1 > 0 ? -1 : 1;
|
|
4771
4771
|
return (factor * ((d - e) * f)) / g;
|
|
4772
4772
|
};
|
|
4773
4773
|
}
|
|
@@ -4778,7 +4778,7 @@ function findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1, })
|
|
|
4778
4778
|
envelope = (undampedFreq) => {
|
|
4779
4779
|
const a = Math.exp(-undampedFreq * duration);
|
|
4780
4780
|
const b = (undampedFreq - velocity) * duration + 1;
|
|
4781
|
-
return -safeMin + a * b;
|
|
4781
|
+
return -safeMin$1 + a * b;
|
|
4782
4782
|
};
|
|
4783
4783
|
derivative = (undampedFreq) => {
|
|
4784
4784
|
const a = Math.exp(-undampedFreq * duration);
|
|
@@ -10303,7 +10303,7 @@ const checkAndConvertChangedValueTypes = (visualElement, target, origin = {}, tr
|
|
|
10303
10303
|
// Reapply original values
|
|
10304
10304
|
visualElement.render();
|
|
10305
10305
|
// Restore scroll position
|
|
10306
|
-
if (isBrowser$
|
|
10306
|
+
if (isBrowser$9 && scrollY !== null) {
|
|
10307
10307
|
window.scrollTo({ top: scrollY });
|
|
10308
10308
|
}
|
|
10309
10309
|
return { target: convertedTarget, transitionEnd };
|
|
@@ -10342,7 +10342,7 @@ const hasReducedMotionListener = { current: false };
|
|
|
10342
10342
|
|
|
10343
10343
|
function initPrefersReducedMotion() {
|
|
10344
10344
|
hasReducedMotionListener.current = true;
|
|
10345
|
-
if (!isBrowser$
|
|
10345
|
+
if (!isBrowser$9)
|
|
10346
10346
|
return;
|
|
10347
10347
|
if (window.matchMedia) {
|
|
10348
10348
|
const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)");
|
|
@@ -11028,7 +11028,7 @@ const motion = /*@__PURE__*/ createMotionProxy((Component, config) => createDomM
|
|
|
11028
11028
|
|
|
11029
11029
|
function useIsMounted() {
|
|
11030
11030
|
const isMounted = useRef(false);
|
|
11031
|
-
useIsomorphicLayoutEffect$
|
|
11031
|
+
useIsomorphicLayoutEffect$3(() => {
|
|
11032
11032
|
isMounted.current = true;
|
|
11033
11033
|
return () => {
|
|
11034
11034
|
isMounted.current = false;
|
|
@@ -11238,7 +11238,7 @@ const AnimatePresence = ({ children, custom, initial = true, onExitComplete, exi
|
|
|
11238
11238
|
// If this is the initial component render, just deal with logic surrounding whether
|
|
11239
11239
|
// we play onMount animations or not.
|
|
11240
11240
|
const isInitialRender = useRef(true);
|
|
11241
|
-
useIsomorphicLayoutEffect$
|
|
11241
|
+
useIsomorphicLayoutEffect$3(() => {
|
|
11242
11242
|
isInitialRender.current = false;
|
|
11243
11243
|
updateChildLookup(filteredChildren, allChildren);
|
|
11244
11244
|
presentChildren.current = childrenToRender;
|
|
@@ -11342,14 +11342,14 @@ function _objectWithoutProperties$1(source, excluded) {
|
|
|
11342
11342
|
return target;
|
|
11343
11343
|
}
|
|
11344
11344
|
|
|
11345
|
-
var _excluded$
|
|
11345
|
+
var _excluded$I = ["open", "children", "className"];
|
|
11346
11346
|
var Collapse = function Collapse(_ref) {
|
|
11347
11347
|
var _ref$open = _ref.open,
|
|
11348
11348
|
open = _ref$open === void 0 ? false : _ref$open,
|
|
11349
11349
|
children = _ref.children,
|
|
11350
11350
|
_ref$className = _ref.className,
|
|
11351
11351
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
11352
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
11352
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$I);
|
|
11353
11353
|
return /*#__PURE__*/React__default.createElement(AnimatePresence, null, open && /*#__PURE__*/React__default.createElement(motion.div, _extends$4({
|
|
11354
11354
|
animate: {
|
|
11355
11355
|
opacity: 1,
|
|
@@ -11568,10 +11568,11 @@ var getScrollbarWidth = function getScrollbarWidth() {
|
|
|
11568
11568
|
return scrollbarWidth;
|
|
11569
11569
|
};
|
|
11570
11570
|
var noop$2 = function noop() {};
|
|
11571
|
-
var hyphenize = function hyphenize(
|
|
11571
|
+
var hyphenize = function hyphenize(input) {
|
|
11572
11572
|
var fallbackString = "nui";
|
|
11573
|
-
if (
|
|
11574
|
-
|
|
11573
|
+
if (typeof input === "number") return String(input);
|
|
11574
|
+
if (input && typeof input === "string" && input.replace) {
|
|
11575
|
+
return input.replace(/[\s_]/g, "-").replace(/([a-z])([A-Z])/g, "$1-$2").replace(/-+/g, "-").toLowerCase();
|
|
11575
11576
|
}
|
|
11576
11577
|
return fallbackString;
|
|
11577
11578
|
};
|
|
@@ -11667,10 +11668,10 @@ var ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES = {
|
|
|
11667
11668
|
controlItemBgHover: "rgb(var(--neeto-ui-gray-100))"
|
|
11668
11669
|
};
|
|
11669
11670
|
|
|
11670
|
-
var _excluded$
|
|
11671
|
+
var _excluded$H = ["children"];
|
|
11671
11672
|
var Portal$1 = function Portal(_ref, ref) {
|
|
11672
11673
|
var children = _ref.children,
|
|
11673
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
11674
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$H);
|
|
11674
11675
|
return /*#__PURE__*/React__default.createElement("div", _extends$4({
|
|
11675
11676
|
"data-cy": "neeto-backdrop",
|
|
11676
11677
|
"data-testid": "neeto-backdrop",
|
|
@@ -13815,8 +13816,8 @@ function bindGlobalEventListeners() {
|
|
|
13815
13816
|
window.addEventListener('blur', onWindowBlur);
|
|
13816
13817
|
}
|
|
13817
13818
|
|
|
13818
|
-
var isBrowser$
|
|
13819
|
-
var isIE11 = isBrowser$
|
|
13819
|
+
var isBrowser$8 = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
13820
|
+
var isIE11 = isBrowser$8 ? // @ts-ignore
|
|
13820
13821
|
!!window.msCrypto : false;
|
|
13821
13822
|
|
|
13822
13823
|
var pluginProps = {
|
|
@@ -15266,7 +15267,7 @@ function _objectWithoutPropertiesLoose$4(source, excluded) {
|
|
|
15266
15267
|
return target;
|
|
15267
15268
|
}
|
|
15268
15269
|
|
|
15269
|
-
var isBrowser$
|
|
15270
|
+
var isBrowser$7 = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
15270
15271
|
function preserveRef(ref, node) {
|
|
15271
15272
|
if (ref) {
|
|
15272
15273
|
if (typeof ref === 'function') {
|
|
@@ -15279,7 +15280,7 @@ function preserveRef(ref, node) {
|
|
|
15279
15280
|
}
|
|
15280
15281
|
}
|
|
15281
15282
|
function ssrSafeCreateDiv() {
|
|
15282
|
-
return isBrowser$
|
|
15283
|
+
return isBrowser$7 && document.createElement('div');
|
|
15283
15284
|
}
|
|
15284
15285
|
function toDataAttributes(attrs) {
|
|
15285
15286
|
var dataAttrs = {
|
|
@@ -15342,7 +15343,7 @@ function deepPreserveProps(instanceProps, componentProps) {
|
|
|
15342
15343
|
});
|
|
15343
15344
|
}
|
|
15344
15345
|
|
|
15345
|
-
var useIsomorphicLayoutEffect$
|
|
15346
|
+
var useIsomorphicLayoutEffect$2 = isBrowser$7 ? useLayoutEffect : useEffect;
|
|
15346
15347
|
function useMutableBox(initialValue) {
|
|
15347
15348
|
// Using refs instead of state as it's recommended to not store imperative
|
|
15348
15349
|
// values in state due to memory problems in React(?)
|
|
@@ -15481,7 +15482,7 @@ function TippyGenerator(tippy) {
|
|
|
15481
15482
|
|
|
15482
15483
|
var deps = [reference].concat(children ? [children.type] : []); // CREATE
|
|
15483
15484
|
|
|
15484
|
-
useIsomorphicLayoutEffect$
|
|
15485
|
+
useIsomorphicLayoutEffect$2(function () {
|
|
15485
15486
|
var element = reference;
|
|
15486
15487
|
|
|
15487
15488
|
if (reference && reference.hasOwnProperty('current')) {
|
|
@@ -15516,7 +15517,7 @@ function TippyGenerator(tippy) {
|
|
|
15516
15517
|
};
|
|
15517
15518
|
}, deps); // UPDATE
|
|
15518
15519
|
|
|
15519
|
-
useIsomorphicLayoutEffect$
|
|
15520
|
+
useIsomorphicLayoutEffect$2(function () {
|
|
15520
15521
|
var _instance$popperInsta;
|
|
15521
15522
|
|
|
15522
15523
|
// Prevent this effect from running on 1st render
|
|
@@ -15552,7 +15553,7 @@ function TippyGenerator(tippy) {
|
|
|
15552
15553
|
});
|
|
15553
15554
|
}
|
|
15554
15555
|
});
|
|
15555
|
-
useIsomorphicLayoutEffect$
|
|
15556
|
+
useIsomorphicLayoutEffect$2(function () {
|
|
15556
15557
|
var _instance$props$poppe;
|
|
15557
15558
|
|
|
15558
15559
|
if (!render) {
|
|
@@ -15624,7 +15625,7 @@ var index$1 = /*#__PURE__*/forwardRef( /*#__PURE__*/TippyGenerator(tippy));
|
|
|
15624
15625
|
|
|
15625
15626
|
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>";
|
|
15626
15627
|
|
|
15627
|
-
var _excluded$
|
|
15628
|
+
var _excluded$G = ["content", "children", "theme", "disabled", "position", "interactive", "hideAfter", "hideOnTargetExit"];
|
|
15628
15629
|
var Tooltip = function Tooltip(_ref) {
|
|
15629
15630
|
var content = _ref.content,
|
|
15630
15631
|
children = _ref.children,
|
|
@@ -15640,7 +15641,7 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
15640
15641
|
hideAfter = _ref$hideAfter === void 0 ? -1 : _ref$hideAfter,
|
|
15641
15642
|
_ref$hideOnTargetExit = _ref.hideOnTargetExit,
|
|
15642
15643
|
hideOnTargetExit = _ref$hideOnTargetExit === void 0 ? false : _ref$hideOnTargetExit,
|
|
15643
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
15644
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$G);
|
|
15644
15645
|
var _useState = useState(null),
|
|
15645
15646
|
_useState2 = _slicedToArray$2(_useState, 2),
|
|
15646
15647
|
instance = _useState2[0],
|
|
@@ -15687,7 +15688,7 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
15687
15688
|
}, localProps, otherProps), /*#__PURE__*/React__default.isValidElement(children) ? children : /*#__PURE__*/React__default.createElement("span", null, children));
|
|
15688
15689
|
};
|
|
15689
15690
|
|
|
15690
|
-
var _excluded$
|
|
15691
|
+
var _excluded$F = ["icon", "iconPosition", "iconSize", "label", "loading", "onClick", "to", "type", "style", "fullWidth", "className", "disabled", "size", "href", "tooltipProps", "children"];
|
|
15691
15692
|
var BUTTON_STYLES = {
|
|
15692
15693
|
primary: "primary",
|
|
15693
15694
|
secondary: "secondary",
|
|
@@ -15742,7 +15743,7 @@ var Button = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
15742
15743
|
_ref$tooltipProps = _ref.tooltipProps,
|
|
15743
15744
|
tooltipProps = _ref$tooltipProps === void 0 ? null : _ref$tooltipProps,
|
|
15744
15745
|
children = _ref.children,
|
|
15745
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
15746
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$F);
|
|
15746
15747
|
var Parent = motion.button;
|
|
15747
15748
|
var elementSpecificProps = {
|
|
15748
15749
|
type: type
|
|
@@ -15832,33 +15833,33 @@ var Button = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
15832
15833
|
});
|
|
15833
15834
|
Button.displayName = "Button";
|
|
15834
15835
|
|
|
15835
|
-
var Divider = function Divider(props) {
|
|
15836
|
+
var Divider$1 = function Divider(props) {
|
|
15836
15837
|
return /*#__PURE__*/React__default.createElement("li", _extends$4({
|
|
15837
15838
|
className: "neeto-ui-dropdown__popup-divider"
|
|
15838
15839
|
}, props));
|
|
15839
15840
|
};
|
|
15840
15841
|
|
|
15841
|
-
var _excluded$
|
|
15842
|
+
var _excluded$E = ["children", "className"];
|
|
15842
15843
|
var Menu$2 = function Menu(_ref) {
|
|
15843
15844
|
var children = _ref.children,
|
|
15844
15845
|
className = _ref.className,
|
|
15845
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
15846
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$E);
|
|
15846
15847
|
return /*#__PURE__*/React__default.createElement("ul", _extends$4({
|
|
15847
15848
|
className: classnames$1("neeto-ui-dropdown__popup-menu", className)
|
|
15848
15849
|
}, otherProps), children);
|
|
15849
15850
|
};
|
|
15850
15851
|
|
|
15851
|
-
var _excluded$
|
|
15852
|
+
var _excluded$D = ["children", "className"];
|
|
15852
15853
|
var MenuItem = function MenuItem(_ref) {
|
|
15853
15854
|
var children = _ref.children,
|
|
15854
15855
|
className = _ref.className,
|
|
15855
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
15856
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$D);
|
|
15856
15857
|
return /*#__PURE__*/React__default.createElement("li", _extends$4({
|
|
15857
15858
|
className: classnames$1("neeto-ui-dropdown__popup-menu-item", className)
|
|
15858
15859
|
}, otherProps), children);
|
|
15859
15860
|
};
|
|
15860
15861
|
|
|
15861
|
-
var _excluded$
|
|
15862
|
+
var _excluded$C = ["children", "className", "isActive", "isDisabled", "style", "prefix", "suffix", "type", "to", "href"];
|
|
15862
15863
|
var ITEM_BTN_STYLES = {
|
|
15863
15864
|
"default": "default",
|
|
15864
15865
|
danger: "danger"
|
|
@@ -15883,7 +15884,7 @@ var MenuItemButton = function MenuItemButton(_ref) {
|
|
|
15883
15884
|
to = _ref$to === void 0 ? "" : _ref$to,
|
|
15884
15885
|
_ref$href = _ref.href,
|
|
15885
15886
|
href = _ref$href === void 0 ? "" : _ref$href,
|
|
15886
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
15887
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$C);
|
|
15887
15888
|
var Parent, elementSpecificProps;
|
|
15888
15889
|
if (to) {
|
|
15889
15890
|
Parent = Link;
|
|
@@ -15917,7 +15918,7 @@ var MenuItemButton = function MenuItemButton(_ref) {
|
|
|
15917
15918
|
|
|
15918
15919
|
MenuItem.Button = MenuItemButton;
|
|
15919
15920
|
|
|
15920
|
-
var _excluded$
|
|
15921
|
+
var _excluded$B = ["style", "size"],
|
|
15921
15922
|
_excluded2$4 = ["icon", "label", "isOpen", "onClose", "dropdownProps", "position", "children", "className", "buttonStyle", "buttonSize", "buttonProps", "customTarget", "disabled", "closeOnEsc", "closeOnSelect", "closeOnOutsideClick", "dropdownModifiers", "trigger", "strategy", "onClick"],
|
|
15922
15923
|
_excluded3 = ["classNames"];
|
|
15923
15924
|
var BTN_STYLES$1 = {
|
|
@@ -15999,7 +16000,7 @@ var Dropdown = function Dropdown(_ref2) {
|
|
|
15999
16000
|
_ref2$buttonProps2 = _ref2$buttonProps === void 0 ? {} : _ref2$buttonProps,
|
|
16000
16001
|
style = _ref2$buttonProps2.style,
|
|
16001
16002
|
size = _ref2$buttonProps2.size,
|
|
16002
|
-
buttonProps = _objectWithoutProperties$1(_ref2$buttonProps2, _excluded$
|
|
16003
|
+
buttonProps = _objectWithoutProperties$1(_ref2$buttonProps2, _excluded$B),
|
|
16003
16004
|
customTarget = _ref2.customTarget,
|
|
16004
16005
|
_ref2$disabled = _ref2.disabled,
|
|
16005
16006
|
disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
|
|
@@ -16090,9 +16091,9 @@ var Dropdown = function Dropdown(_ref2) {
|
|
|
16090
16091
|
};
|
|
16091
16092
|
Dropdown.Menu = Menu$2;
|
|
16092
16093
|
Dropdown.MenuItem = MenuItem;
|
|
16093
|
-
Dropdown.Divider = Divider;
|
|
16094
|
+
Dropdown.Divider = Divider$1;
|
|
16094
16095
|
|
|
16095
|
-
var _excluded$
|
|
16096
|
+
var _excluded$A = ["style", "size"];
|
|
16096
16097
|
var BTN_STYLES = {
|
|
16097
16098
|
primary: "primary",
|
|
16098
16099
|
secondary: "secondary"
|
|
@@ -16117,7 +16118,7 @@ var ActionDropdown = function ActionDropdown(_ref) {
|
|
|
16117
16118
|
_ref$buttonProps2 = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
|
|
16118
16119
|
style = _ref$buttonProps2.style,
|
|
16119
16120
|
size = _ref$buttonProps2.size,
|
|
16120
|
-
buttonProps = _objectWithoutProperties$1(_ref$buttonProps2, _excluded$
|
|
16121
|
+
buttonProps = _objectWithoutProperties$1(_ref$buttonProps2, _excluded$A),
|
|
16121
16122
|
_ref$dropdownProps = _ref.dropdownProps,
|
|
16122
16123
|
dropdownProps = _ref$dropdownProps === void 0 ? {} : _ref$dropdownProps,
|
|
16123
16124
|
_ref$className = _ref.className,
|
|
@@ -18540,7 +18541,7 @@ var Footer$1 = function Footer(_ref) {
|
|
|
18540
18541
|
}, children);
|
|
18541
18542
|
};
|
|
18542
18543
|
|
|
18543
|
-
var _excluded$
|
|
18544
|
+
var _excluded$z = ["style", "weight", "lineHeight", "component", "children", "textTransform", "className"];
|
|
18544
18545
|
var FONT_WEIGHTS = {
|
|
18545
18546
|
thin: "thin",
|
|
18546
18547
|
extralight: "extralight",
|
|
@@ -18628,7 +18629,7 @@ var Typography = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
18628
18629
|
textTransform = _ref.textTransform,
|
|
18629
18630
|
_ref$className = _ref.className,
|
|
18630
18631
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
18631
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
18632
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$z);
|
|
18632
18633
|
var Component = component ? COMPONENTS[component] : style ? DEFAULT_COMPONENTS[style] : "p";
|
|
18633
18634
|
return /*#__PURE__*/React__default.createElement(Component, _extends$4({
|
|
18634
18635
|
ref: ref,
|
|
@@ -18691,7 +18692,7 @@ var Header$1 = function Header(_ref) {
|
|
|
18691
18692
|
}, description)));
|
|
18692
18693
|
};
|
|
18693
18694
|
|
|
18694
|
-
var _excluded$
|
|
18695
|
+
var _excluded$y = ["size", "isOpen", "onClose", "children", "finalFocusRef", "initialFocusRef", "className", "closeOnEsc", "closeButton", "backdropClassName", "blockScrollOnMount", "closeOnOutsideClick"];
|
|
18695
18696
|
var SIZES$7 = {
|
|
18696
18697
|
small: "small",
|
|
18697
18698
|
medium: "medium",
|
|
@@ -18720,7 +18721,7 @@ var Modal = function Modal(_ref) {
|
|
|
18720
18721
|
blockScrollOnMount = _ref$blockScrollOnMou === void 0 ? true : _ref$blockScrollOnMou,
|
|
18721
18722
|
_ref$closeOnOutsideCl = _ref.closeOnOutsideClick,
|
|
18722
18723
|
closeOnOutsideClick = _ref$closeOnOutsideCl === void 0 ? true : _ref$closeOnOutsideCl,
|
|
18723
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
18724
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$y);
|
|
18724
18725
|
var _useState = useState(false),
|
|
18725
18726
|
_useState2 = _slicedToArray$2(_useState, 2),
|
|
18726
18727
|
hasTransitionCompleted = _useState2[0],
|
|
@@ -18884,7 +18885,7 @@ var FallbackAvatar = /*@__PURE__*/getDefaultExportFromCjs(build.exports);
|
|
|
18884
18885
|
var COLOR_PALLETE = ["#ffb5a7", "#fcd5ce", "#f8edeb", "#f9dcc4", "#fec89a"];
|
|
18885
18886
|
var AVATAR_VARIANT = "beam";
|
|
18886
18887
|
|
|
18887
|
-
var _excluded$
|
|
18888
|
+
var _excluded$x = ["size", "user", "status", "onClick", "className", "showTooltip", "tooltipProps"];
|
|
18888
18889
|
var SIZE = {
|
|
18889
18890
|
small: 24,
|
|
18890
18891
|
medium: 32,
|
|
@@ -18906,7 +18907,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
18906
18907
|
showTooltip = _ref$showTooltip === void 0 ? false : _ref$showTooltip,
|
|
18907
18908
|
_ref$tooltipProps = _ref.tooltipProps,
|
|
18908
18909
|
tooltipProps = _ref$tooltipProps === void 0 ? {} : _ref$tooltipProps,
|
|
18909
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
18910
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$x);
|
|
18910
18911
|
var _useState = useState(false),
|
|
18911
18912
|
_useState2 = _slicedToArray$2(_useState, 2),
|
|
18912
18913
|
isLoadingFailed = _useState2[0],
|
|
@@ -18965,7 +18966,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
18965
18966
|
})));
|
|
18966
18967
|
};
|
|
18967
18968
|
|
|
18968
|
-
var _excluded$
|
|
18969
|
+
var _excluded$w = ["icon", "style", "className", "children"];
|
|
18969
18970
|
var STYLES$2 = {
|
|
18970
18971
|
info: "info",
|
|
18971
18972
|
warning: "warning",
|
|
@@ -18980,7 +18981,7 @@ var Callout = function Callout(_ref) {
|
|
|
18980
18981
|
_ref$className = _ref.className,
|
|
18981
18982
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
18982
18983
|
children = _ref.children,
|
|
18983
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
18984
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$w);
|
|
18984
18985
|
var Icon = icon;
|
|
18985
18986
|
return /*#__PURE__*/React__default.createElement("div", _extends$4({
|
|
18986
18987
|
className: classnames$1("neeto-ui-callout", _defineProperty$7({
|
|
@@ -19026,7 +19027,7 @@ function canUseDOM$1() {
|
|
|
19026
19027
|
* @param deps
|
|
19027
19028
|
*/
|
|
19028
19029
|
|
|
19029
|
-
var useIsomorphicLayoutEffect = /*#__PURE__*/canUseDOM$1() ? useLayoutEffect : useEffect;
|
|
19030
|
+
var useIsomorphicLayoutEffect$1 = /*#__PURE__*/canUseDOM$1() ? useLayoutEffect : useEffect;
|
|
19030
19031
|
|
|
19031
19032
|
/*
|
|
19032
19033
|
* Welcome to @reach/auto-id!
|
|
@@ -19113,7 +19114,7 @@ function useId(idFromProps) {
|
|
|
19113
19114
|
id = _React$useState[0],
|
|
19114
19115
|
setId = _React$useState[1];
|
|
19115
19116
|
|
|
19116
|
-
useIsomorphicLayoutEffect(function () {
|
|
19117
|
+
useIsomorphicLayoutEffect$1(function () {
|
|
19117
19118
|
if (id === null) {
|
|
19118
19119
|
/*
|
|
19119
19120
|
* Patch the ID after render. We do this in `useLayoutEffect` to avoid any
|
|
@@ -19138,7 +19139,7 @@ function useId(idFromProps) {
|
|
|
19138
19139
|
return id != null ? String(id) : undefined;
|
|
19139
19140
|
}
|
|
19140
19141
|
|
|
19141
|
-
var _excluded$
|
|
19142
|
+
var _excluded$v = ["children", "className", "required", "helpIconProps"],
|
|
19142
19143
|
_excluded2$3 = ["onClick", "icon", "tooltipProps", "className"];
|
|
19143
19144
|
var Label = function Label(_ref) {
|
|
19144
19145
|
var children = _ref.children,
|
|
@@ -19148,7 +19149,7 @@ var Label = function Label(_ref) {
|
|
|
19148
19149
|
required = _ref$required === void 0 ? false : _ref$required,
|
|
19149
19150
|
_ref$helpIconProps = _ref.helpIconProps,
|
|
19150
19151
|
helpIconProps = _ref$helpIconProps === void 0 ? null : _ref$helpIconProps,
|
|
19151
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
19152
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$v);
|
|
19152
19153
|
var _ref2 = helpIconProps || {},
|
|
19153
19154
|
onClick = _ref2.onClick,
|
|
19154
19155
|
icon = _ref2.icon,
|
|
@@ -19170,7 +19171,7 @@ var Label = function Label(_ref) {
|
|
|
19170
19171
|
}, otherHelpIconProps)))));
|
|
19171
19172
|
};
|
|
19172
19173
|
|
|
19173
|
-
var _excluded$
|
|
19174
|
+
var _excluded$u = ["label", "error", "className", "required", "labelProps", "children"];
|
|
19174
19175
|
var Checkbox = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
|
|
19175
19176
|
var _ref$label = _ref.label,
|
|
19176
19177
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
@@ -19182,7 +19183,7 @@ var Checkbox = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
|
|
|
19182
19183
|
required = _ref$required === void 0 ? false : _ref$required,
|
|
19183
19184
|
labelProps = _ref.labelProps,
|
|
19184
19185
|
children = _ref.children,
|
|
19185
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
19186
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$u);
|
|
19186
19187
|
var id = useId(otherProps.id);
|
|
19187
19188
|
var errorId = "error_".concat(id);
|
|
19188
19189
|
var renderLabel = label || children;
|
|
@@ -20970,8 +20971,8 @@ var ColorPicker = function ColorPicker(_ref) {
|
|
|
20970
20971
|
}, /*#__PURE__*/React__default.createElement(Palette, colorPaletteProps))));
|
|
20971
20972
|
};
|
|
20972
20973
|
|
|
20973
|
-
var _excluded$
|
|
20974
|
-
var INPUT_SIZES$
|
|
20974
|
+
var _excluded$t = ["className", "label", "size", "dropdownClassName", "popupClassName", "dateFormat", "timeFormat", "onChange", "onOk", "picker", "showTime", "type", "nakedInput", "error", "defaultValue", "value", "labelProps", "required"];
|
|
20975
|
+
var INPUT_SIZES$2 = {
|
|
20975
20976
|
small: "small",
|
|
20976
20977
|
medium: "medium",
|
|
20977
20978
|
large: "large"
|
|
@@ -20996,7 +20997,7 @@ var DatePicker = /*#__PURE__*/forwardRef$1(function (_ref2, ref) {
|
|
|
20996
20997
|
_ref2$label = _ref2.label,
|
|
20997
20998
|
label = _ref2$label === void 0 ? "" : _ref2$label,
|
|
20998
20999
|
_ref2$size = _ref2.size,
|
|
20999
|
-
size = _ref2$size === void 0 ? INPUT_SIZES$
|
|
21000
|
+
size = _ref2$size === void 0 ? INPUT_SIZES$2.medium : _ref2$size,
|
|
21000
21001
|
_ref2$dropdownClassNa = _ref2.dropdownClassName,
|
|
21001
21002
|
dropdownClassName = _ref2$dropdownClassNa === void 0 ? "" : _ref2$dropdownClassNa,
|
|
21002
21003
|
_ref2$popupClassName = _ref2.popupClassName,
|
|
@@ -21024,7 +21025,7 @@ var DatePicker = /*#__PURE__*/forwardRef$1(function (_ref2, ref) {
|
|
|
21024
21025
|
labelProps = _ref2.labelProps,
|
|
21025
21026
|
_ref2$required = _ref2.required,
|
|
21026
21027
|
required = _ref2$required === void 0 ? false : _ref2$required,
|
|
21027
|
-
otherProps = _objectWithoutProperties$1(_ref2, _excluded$
|
|
21028
|
+
otherProps = _objectWithoutProperties$1(_ref2, _excluded$t);
|
|
21028
21029
|
var id = useId(otherProps.id);
|
|
21029
21030
|
var datePickerRef = useSyncedRef(ref);
|
|
21030
21031
|
var Component = datePickerTypes[type === null || type === void 0 ? void 0 : type.toLowerCase()];
|
|
@@ -21084,13 +21085,13 @@ var DatePicker = /*#__PURE__*/forwardRef$1(function (_ref2, ref) {
|
|
|
21084
21085
|
});
|
|
21085
21086
|
DatePicker.displayName = "DatePicker";
|
|
21086
21087
|
|
|
21087
|
-
var _excluded$
|
|
21088
|
+
var _excluded$s = ["size", "type", "label", "error", "suffix", "prefix", "disabled", "helpText", "className", "nakedInput", "contentSize", "required", "maxLength", "unlimitedChars", "labelProps", "rejectCharsRegex", "onBlur", "disableTrimOnBlur"];
|
|
21088
21089
|
var SIZES$5 = {
|
|
21089
21090
|
small: "small",
|
|
21090
21091
|
medium: "medium",
|
|
21091
21092
|
large: "large"
|
|
21092
21093
|
};
|
|
21093
|
-
var Input$
|
|
21094
|
+
var Input$3 = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
|
|
21094
21095
|
var _ref2, _otherProps$value, _classnames;
|
|
21095
21096
|
var _ref$size = _ref.size,
|
|
21096
21097
|
size = _ref$size === void 0 ? SIZES$5.medium : _ref$size,
|
|
@@ -21124,7 +21125,7 @@ var Input$2 = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
|
|
|
21124
21125
|
onBlur = _ref.onBlur,
|
|
21125
21126
|
_ref$disableTrimOnBlu = _ref.disableTrimOnBlur,
|
|
21126
21127
|
disableTrimOnBlur = _ref$disableTrimOnBlu === void 0 ? false : _ref$disableTrimOnBlu,
|
|
21127
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
21128
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$s);
|
|
21128
21129
|
var _useState = useState(otherProps.value),
|
|
21129
21130
|
_useState2 = _slicedToArray$2(_useState, 2),
|
|
21130
21131
|
valueInternal = _useState2[0],
|
|
@@ -21208,14 +21209,14 @@ var Input$2 = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
|
|
|
21208
21209
|
style: "body3"
|
|
21209
21210
|
}, helpText));
|
|
21210
21211
|
});
|
|
21211
|
-
Input$
|
|
21212
|
+
Input$3.displayName = "Input";
|
|
21212
21213
|
|
|
21213
|
-
var _excluded$
|
|
21214
|
+
var _excluded$r = ["keyName", "className", "tooltipProps"];
|
|
21214
21215
|
var Kbd = function Kbd(_ref) {
|
|
21215
21216
|
var keyName = _ref.keyName,
|
|
21216
21217
|
className = _ref.className,
|
|
21217
21218
|
tooltipProps = _ref.tooltipProps,
|
|
21218
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
21219
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$r);
|
|
21219
21220
|
return /*#__PURE__*/React__default.createElement(Tooltip, _extends$4({
|
|
21220
21221
|
disabled: !tooltipProps
|
|
21221
21222
|
}, tooltipProps), /*#__PURE__*/React__default.createElement("span", _extends$4({
|
|
@@ -22177,7 +22178,7 @@ var weakMemoize = function weakMemoize(func) {
|
|
|
22177
22178
|
};
|
|
22178
22179
|
};
|
|
22179
22180
|
|
|
22180
|
-
function memoize(fn) {
|
|
22181
|
+
function memoize$1(fn) {
|
|
22181
22182
|
var cache = Object.create(null);
|
|
22182
22183
|
return function (arg) {
|
|
22183
22184
|
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
|
@@ -22522,9 +22523,9 @@ var prefixer = function prefixer(element, index, children, callback) {
|
|
|
22522
22523
|
}
|
|
22523
22524
|
};
|
|
22524
22525
|
|
|
22525
|
-
var isBrowser$
|
|
22526
|
-
var getServerStylisCache = isBrowser$
|
|
22527
|
-
return memoize(function () {
|
|
22526
|
+
var isBrowser$6 = typeof document !== 'undefined';
|
|
22527
|
+
var getServerStylisCache = isBrowser$6 ? undefined : weakMemoize(function () {
|
|
22528
|
+
return memoize$1(function () {
|
|
22528
22529
|
var cache = {};
|
|
22529
22530
|
return function (name) {
|
|
22530
22531
|
return cache[name];
|
|
@@ -22536,7 +22537,7 @@ var defaultStylisPlugins = [prefixer];
|
|
|
22536
22537
|
var createCache = function createCache(options) {
|
|
22537
22538
|
var key = options.key;
|
|
22538
22539
|
|
|
22539
|
-
if (isBrowser$
|
|
22540
|
+
if (isBrowser$6 && key === 'css') {
|
|
22540
22541
|
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
|
|
22541
22542
|
// document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
|
|
22542
22543
|
// note this very very intentionally targets all style elements regardless of the key to ensure
|
|
@@ -22565,7 +22566,7 @@ var createCache = function createCache(options) {
|
|
|
22565
22566
|
var container;
|
|
22566
22567
|
var nodesToHydrate = [];
|
|
22567
22568
|
|
|
22568
|
-
if (isBrowser$
|
|
22569
|
+
if (isBrowser$6) {
|
|
22569
22570
|
container = options.container || document.head;
|
|
22570
22571
|
Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
|
|
22571
22572
|
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
|
|
@@ -22584,7 +22585,7 @@ var createCache = function createCache(options) {
|
|
|
22584
22585
|
|
|
22585
22586
|
var omnipresentPlugins = [compat, removeLabel];
|
|
22586
22587
|
|
|
22587
|
-
if (isBrowser$
|
|
22588
|
+
if (isBrowser$6) {
|
|
22588
22589
|
var currentSheet;
|
|
22589
22590
|
var finalizingPlugins = [stringify$2, rulesheet(function (rule) {
|
|
22590
22591
|
currentSheet.insert(rule);
|
|
@@ -22688,11 +22689,11 @@ var reactIs_production_min = {};
|
|
|
22688
22689
|
* LICENSE file in the root directory of this source tree.
|
|
22689
22690
|
*/
|
|
22690
22691
|
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?
|
|
22691
|
-
Symbol.for("react.suspense_list"):60120,r$
|
|
22692
|
-
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$
|
|
22692
|
+
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;
|
|
22693
|
+
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;
|
|
22693
22694
|
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};
|
|
22694
|
-
reactIs_production_min.isMemo=function(a){return z(a)===r$
|
|
22695
|
-
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$
|
|
22695
|
+
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};
|
|
22696
|
+
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;
|
|
22696
22697
|
|
|
22697
22698
|
(function (module) {
|
|
22698
22699
|
|
|
@@ -22721,7 +22722,7 @@ var TYPE_STATICS = {};
|
|
|
22721
22722
|
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
|
22722
22723
|
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
|
22723
22724
|
|
|
22724
|
-
var isBrowser$
|
|
22725
|
+
var isBrowser$5 = typeof document !== 'undefined';
|
|
22725
22726
|
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
|
22726
22727
|
var rawClassName = '';
|
|
22727
22728
|
classNames.split(' ').forEach(function (className) {
|
|
@@ -22745,7 +22746,7 @@ var registerStyles = function registerStyles(cache, serialized, isStringTag) {
|
|
|
22745
22746
|
// in node since emotion-server relies on whether a style is in
|
|
22746
22747
|
// the registered cache to know whether a style is global or not
|
|
22747
22748
|
// also, note that this check will be dead code eliminated in the browser
|
|
22748
|
-
isBrowser$
|
|
22749
|
+
isBrowser$5 === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
|
|
22749
22750
|
cache.registered[className] = serialized.styles;
|
|
22750
22751
|
}
|
|
22751
22752
|
};
|
|
@@ -22760,14 +22761,14 @@ var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
|
|
22760
22761
|
do {
|
|
22761
22762
|
var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
|
|
22762
22763
|
|
|
22763
|
-
if (!isBrowser$
|
|
22764
|
+
if (!isBrowser$5 && maybeStyles !== undefined) {
|
|
22764
22765
|
stylesForSSR += maybeStyles;
|
|
22765
22766
|
}
|
|
22766
22767
|
|
|
22767
22768
|
current = current.next;
|
|
22768
22769
|
} while (current !== undefined);
|
|
22769
22770
|
|
|
22770
|
-
if (!isBrowser$
|
|
22771
|
+
if (!isBrowser$5 && stylesForSSR.length !== 0) {
|
|
22771
22772
|
return stylesForSSR;
|
|
22772
22773
|
}
|
|
22773
22774
|
}
|
|
@@ -22887,7 +22888,7 @@ var isProcessableValue = function isProcessableValue(value) {
|
|
|
22887
22888
|
return value != null && typeof value !== 'boolean';
|
|
22888
22889
|
};
|
|
22889
22890
|
|
|
22890
|
-
var processStyleName = /* #__PURE__ */memoize(function (styleName) {
|
|
22891
|
+
var processStyleName = /* #__PURE__ */memoize$1(function (styleName) {
|
|
22891
22892
|
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
|
|
22892
22893
|
});
|
|
22893
22894
|
|
|
@@ -23096,17 +23097,17 @@ var serializeStyles = function serializeStyles(args, registered, mergedProps) {
|
|
|
23096
23097
|
};
|
|
23097
23098
|
};
|
|
23098
23099
|
|
|
23099
|
-
var isBrowser$
|
|
23100
|
+
var isBrowser$4 = typeof document !== 'undefined';
|
|
23100
23101
|
|
|
23101
23102
|
var syncFallback = function syncFallback(create) {
|
|
23102
23103
|
return create();
|
|
23103
23104
|
};
|
|
23104
23105
|
|
|
23105
23106
|
var useInsertionEffect = React$5['useInsertion' + 'Effect'] ? React$5['useInsertion' + 'Effect'] : false;
|
|
23106
|
-
var useInsertionEffectAlwaysWithSyncFallback = !isBrowser$
|
|
23107
|
+
var useInsertionEffectAlwaysWithSyncFallback = !isBrowser$4 ? syncFallback : useInsertionEffect || syncFallback;
|
|
23107
23108
|
|
|
23108
|
-
var isBrowser = typeof document !== 'undefined';
|
|
23109
|
-
var hasOwnProperty$
|
|
23109
|
+
var isBrowser$3 = typeof document !== 'undefined';
|
|
23110
|
+
var hasOwnProperty$2 = {}.hasOwnProperty;
|
|
23110
23111
|
|
|
23111
23112
|
var EmotionCacheContext = /* #__PURE__ */createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
23112
23113
|
// because this module is primarily intended for the browser and node
|
|
@@ -23129,7 +23130,7 @@ var withEmotionCache = function withEmotionCache(func) {
|
|
|
23129
23130
|
});
|
|
23130
23131
|
};
|
|
23131
23132
|
|
|
23132
|
-
if (!isBrowser) {
|
|
23133
|
+
if (!isBrowser$3) {
|
|
23133
23134
|
withEmotionCache = function withEmotionCache(func) {
|
|
23134
23135
|
return function (props) {
|
|
23135
23136
|
var cache = useContext(EmotionCacheContext);
|
|
@@ -23161,7 +23162,7 @@ var createEmotionProps = function createEmotionProps(type, props) {
|
|
|
23161
23162
|
var newProps = {};
|
|
23162
23163
|
|
|
23163
23164
|
for (var key in props) {
|
|
23164
|
-
if (hasOwnProperty$
|
|
23165
|
+
if (hasOwnProperty$2.call(props, key)) {
|
|
23165
23166
|
newProps[key] = props[key];
|
|
23166
23167
|
}
|
|
23167
23168
|
}
|
|
@@ -23180,7 +23181,7 @@ var Insertion$1 = function Insertion(_ref) {
|
|
|
23180
23181
|
return insertStyles(cache, serialized, isStringTag);
|
|
23181
23182
|
});
|
|
23182
23183
|
|
|
23183
|
-
if (!isBrowser && rules !== undefined) {
|
|
23184
|
+
if (!isBrowser$3 && rules !== undefined) {
|
|
23184
23185
|
var _ref2;
|
|
23185
23186
|
|
|
23186
23187
|
var serializedNames = serialized.name;
|
|
@@ -23224,7 +23225,7 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
|
|
|
23224
23225
|
var newProps = {};
|
|
23225
23226
|
|
|
23226
23227
|
for (var key in props) {
|
|
23227
|
-
if (hasOwnProperty$
|
|
23228
|
+
if (hasOwnProperty$2.call(props, key) && key !== 'css' && key !== typePropName && ("production" === 'production' )) {
|
|
23228
23229
|
newProps[key] = props[key];
|
|
23229
23230
|
}
|
|
23230
23231
|
}
|
|
@@ -23241,7 +23242,7 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
|
|
|
23241
23242
|
var jsx = function jsx(type, props) {
|
|
23242
23243
|
var args = arguments;
|
|
23243
23244
|
|
|
23244
|
-
if (props == null || !hasOwnProperty$
|
|
23245
|
+
if (props == null || !hasOwnProperty$2.call(props, 'css')) {
|
|
23245
23246
|
// $FlowFixMe
|
|
23246
23247
|
return createElement.apply(undefined, args);
|
|
23247
23248
|
}
|
|
@@ -23349,17 +23350,17 @@ var Insertion = function Insertion(_ref) {
|
|
|
23349
23350
|
for (var i = 0; i < serializedArr.length; i++) {
|
|
23350
23351
|
var res = insertStyles(cache, serializedArr[i], false);
|
|
23351
23352
|
|
|
23352
|
-
if (!isBrowser && res !== undefined) {
|
|
23353
|
+
if (!isBrowser$3 && res !== undefined) {
|
|
23353
23354
|
rules += res;
|
|
23354
23355
|
}
|
|
23355
23356
|
}
|
|
23356
23357
|
|
|
23357
|
-
if (!isBrowser) {
|
|
23358
|
+
if (!isBrowser$3) {
|
|
23358
23359
|
return rules;
|
|
23359
23360
|
}
|
|
23360
23361
|
});
|
|
23361
23362
|
|
|
23362
|
-
if (!isBrowser && rules.length !== 0) {
|
|
23363
|
+
if (!isBrowser$3 && rules.length !== 0) {
|
|
23363
23364
|
var _ref2;
|
|
23364
23365
|
|
|
23365
23366
|
return /*#__PURE__*/createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedArr.map(function (serialized) {
|
|
@@ -24835,7 +24836,7 @@ var GroupHeading = function GroupHeading(props) {
|
|
|
24835
24836
|
}, innerProps));
|
|
24836
24837
|
};
|
|
24837
24838
|
|
|
24838
|
-
var _excluded$
|
|
24839
|
+
var _excluded$q = ["innerRef", "isDisabled", "isHidden", "inputClassName"];
|
|
24839
24840
|
var inputCSS = function inputCSS(_ref) {
|
|
24840
24841
|
var isDisabled = _ref.isDisabled,
|
|
24841
24842
|
value = _ref.value,
|
|
@@ -24882,7 +24883,7 @@ var inputStyle = function inputStyle(isHidden) {
|
|
|
24882
24883
|
width: '100%'
|
|
24883
24884
|
}, spacingStyle);
|
|
24884
24885
|
};
|
|
24885
|
-
var Input$
|
|
24886
|
+
var Input$2 = function Input(props) {
|
|
24886
24887
|
var className = props.className,
|
|
24887
24888
|
cx = props.cx,
|
|
24888
24889
|
getStyles = props.getStyles,
|
|
@@ -24892,7 +24893,7 @@ var Input$1 = function Input(props) {
|
|
|
24892
24893
|
isDisabled = _cleanCommonProps.isDisabled,
|
|
24893
24894
|
isHidden = _cleanCommonProps.isHidden,
|
|
24894
24895
|
inputClassName = _cleanCommonProps.inputClassName,
|
|
24895
|
-
innerProps = _objectWithoutProperties(_cleanCommonProps, _excluded$
|
|
24896
|
+
innerProps = _objectWithoutProperties(_cleanCommonProps, _excluded$q);
|
|
24896
24897
|
return jsx("div", {
|
|
24897
24898
|
className: cx({
|
|
24898
24899
|
'input-container': true
|
|
@@ -25138,7 +25139,7 @@ var components = {
|
|
|
25138
25139
|
GroupHeading: GroupHeading,
|
|
25139
25140
|
IndicatorsContainer: IndicatorsContainer,
|
|
25140
25141
|
IndicatorSeparator: IndicatorSeparator,
|
|
25141
|
-
Input: Input$
|
|
25142
|
+
Input: Input$2,
|
|
25142
25143
|
LoadingIndicator: LoadingIndicator,
|
|
25143
25144
|
Menu: Menu$1,
|
|
25144
25145
|
MenuList: MenuList$1,
|
|
@@ -25715,10 +25716,10 @@ var createFilter = function createFilter(config) {
|
|
|
25715
25716
|
};
|
|
25716
25717
|
};
|
|
25717
25718
|
|
|
25718
|
-
var _excluded$
|
|
25719
|
+
var _excluded$p = ["innerRef"];
|
|
25719
25720
|
function DummyInput(_ref) {
|
|
25720
25721
|
var innerRef = _ref.innerRef,
|
|
25721
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
25722
|
+
props = _objectWithoutProperties(_ref, _excluded$p);
|
|
25722
25723
|
// Remove animation props not meant for HTML elements
|
|
25723
25724
|
var filteredProps = removeProps(props, 'onExited', 'in', 'enter', 'exit', 'appear');
|
|
25724
25725
|
return jsx("input", _extends$2({
|
|
@@ -27714,7 +27715,7 @@ var Select$1 = /*#__PURE__*/function (_Component) {
|
|
|
27714
27715
|
}(Component);
|
|
27715
27716
|
Select$1.defaultProps = defaultProps;
|
|
27716
27717
|
|
|
27717
|
-
var _excluded$
|
|
27718
|
+
var _excluded$o = ["defaultInputValue", "defaultMenuIsOpen", "defaultValue", "inputValue", "menuIsOpen", "onChange", "onInputChange", "onMenuClose", "onMenuOpen", "value"];
|
|
27718
27719
|
function useStateManager(_ref) {
|
|
27719
27720
|
var _ref$defaultInputValu = _ref.defaultInputValue,
|
|
27720
27721
|
defaultInputValue = _ref$defaultInputValu === void 0 ? '' : _ref$defaultInputValu,
|
|
@@ -27729,7 +27730,7 @@ function useStateManager(_ref) {
|
|
|
27729
27730
|
propsOnMenuClose = _ref.onMenuClose,
|
|
27730
27731
|
propsOnMenuOpen = _ref.onMenuOpen,
|
|
27731
27732
|
propsValue = _ref.value,
|
|
27732
|
-
restSelectProps = _objectWithoutProperties(_ref, _excluded$
|
|
27733
|
+
restSelectProps = _objectWithoutProperties(_ref, _excluded$o);
|
|
27733
27734
|
var _useState = useState(propsInputValue !== undefined ? propsInputValue : defaultInputValue),
|
|
27734
27735
|
_useState2 = _slicedToArray$1(_useState, 2),
|
|
27735
27736
|
stateInputValue = _useState2[0],
|
|
@@ -27781,7 +27782,7 @@ function useStateManager(_ref) {
|
|
|
27781
27782
|
});
|
|
27782
27783
|
}
|
|
27783
27784
|
|
|
27784
|
-
var _excluded$
|
|
27785
|
+
var _excluded$n = ["allowCreateWhileLoading", "createOptionPosition", "formatCreateLabel", "isValidNewOption", "getNewOptionData", "onCreateOption", "options", "onChange"];
|
|
27785
27786
|
var compareOption = function compareOption() {
|
|
27786
27787
|
var inputValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
27787
27788
|
var option = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -27825,7 +27826,7 @@ function useCreatable(_ref) {
|
|
|
27825
27826
|
_ref$options = _ref.options,
|
|
27826
27827
|
propsOptions = _ref$options === void 0 ? [] : _ref$options,
|
|
27827
27828
|
propsOnChange = _ref.onChange,
|
|
27828
|
-
restSelectProps = _objectWithoutProperties(_ref, _excluded$
|
|
27829
|
+
restSelectProps = _objectWithoutProperties(_ref, _excluded$n);
|
|
27829
27830
|
var _restSelectProps$getO = restSelectProps.getOptionValue,
|
|
27830
27831
|
getOptionValue$1$1 = _restSelectProps$getO === void 0 ? getOptionValue$1 : _restSelectProps$getO,
|
|
27831
27832
|
_restSelectProps$getO2 = restSelectProps.getOptionLabel,
|
|
@@ -27888,7 +27889,7 @@ var StateManagedSelect = /*#__PURE__*/forwardRef$1(function (props, ref) {
|
|
|
27888
27889
|
}, baseSelectProps));
|
|
27889
27890
|
});
|
|
27890
27891
|
|
|
27891
|
-
var _excluded$
|
|
27892
|
+
var _excluded$m = ["style", "indicatorStyle", "label", "icon", "className", "onClose", "disabled", "size", "type", "children"];
|
|
27892
27893
|
var SIZES$4 = {
|
|
27893
27894
|
small: "small",
|
|
27894
27895
|
large: "large"
|
|
@@ -27924,7 +27925,7 @@ var Tag = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
|
|
|
27924
27925
|
_ref$type = _ref.type,
|
|
27925
27926
|
type = _ref$type === void 0 ? TYPES.outline : _ref$type,
|
|
27926
27927
|
children = _ref.children,
|
|
27927
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
27928
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$m);
|
|
27928
27929
|
var Icon = typeof icon === "string" ? function () {
|
|
27929
27930
|
return /*#__PURE__*/React__default.createElement("i", {
|
|
27930
27931
|
className: icon
|
|
@@ -27967,7 +27968,7 @@ var Tag = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
|
|
|
27967
27968
|
});
|
|
27968
27969
|
Tag.displayName = "Tag";
|
|
27969
27970
|
|
|
27970
|
-
var _excluded$
|
|
27971
|
+
var _excluded$l = ["children"],
|
|
27971
27972
|
_excluded2$2 = ["children"];
|
|
27972
27973
|
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; }
|
|
27973
27974
|
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; }
|
|
@@ -27983,7 +27984,7 @@ var STYLES = {
|
|
|
27983
27984
|
};
|
|
27984
27985
|
var CustomControl = function CustomControl(_ref) {
|
|
27985
27986
|
var children = _ref.children,
|
|
27986
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
27987
|
+
props = _objectWithoutProperties$1(_ref, _excluded$l);
|
|
27987
27988
|
var prefix = props.selectProps.prefix;
|
|
27988
27989
|
return /*#__PURE__*/React__default.createElement(components.Control, props, prefix && /*#__PURE__*/React__default.createElement("div", {
|
|
27989
27990
|
className: "neeto-ui-email-input__prefix"
|
|
@@ -28034,7 +28035,7 @@ var SelectContainer = function SelectContainer(props) {
|
|
|
28034
28035
|
innerProps: _objectSpread$e(_objectSpread$e({}, props.innerProps), {}, _defineProperty$7({}, "data-cy", "multi-email-select-container"))
|
|
28035
28036
|
}));
|
|
28036
28037
|
};
|
|
28037
|
-
var Input = function Input(props) {
|
|
28038
|
+
var Input$1 = function Input(props) {
|
|
28038
28039
|
return /*#__PURE__*/React__default.createElement(components.Input, _extends$4({}, props, {
|
|
28039
28040
|
"data-cy": "email-select-input-field"
|
|
28040
28041
|
}));
|
|
@@ -28059,7 +28060,7 @@ var CUSTOM_COMPONENTS = {
|
|
|
28059
28060
|
ValueContainer: CustomValueContainer,
|
|
28060
28061
|
ClearIndicator: CustomClearIndicator,
|
|
28061
28062
|
SelectContainer: SelectContainer,
|
|
28062
|
-
Input: Input
|
|
28063
|
+
Input: Input$1
|
|
28063
28064
|
};
|
|
28064
28065
|
|
|
28065
28066
|
var formatEmailInputOptions = function formatEmailInputOptions(label) {
|
|
@@ -28088,7 +28089,7 @@ var renderDefaultText = function renderDefaultText(count) {
|
|
|
28088
28089
|
return count === 1 ? "email" : "emails";
|
|
28089
28090
|
};
|
|
28090
28091
|
|
|
28091
|
-
var _excluded$
|
|
28092
|
+
var _excluded$k = ["label", "placeholder", "helpText", "value", "onChange", "error", "onBlur", "filterInvalidEmails", "counter", "disabled", "maxHeight", "required", "labelProps", "visibleEmailsCount"];
|
|
28092
28093
|
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; }
|
|
28093
28094
|
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; }
|
|
28094
28095
|
var MultiEmailInput = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
|
|
@@ -28117,7 +28118,7 @@ var MultiEmailInput = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
|
|
|
28117
28118
|
labelProps = _ref.labelProps,
|
|
28118
28119
|
_ref$visibleEmailsCou = _ref.visibleEmailsCount,
|
|
28119
28120
|
visibleEmailsCount = _ref$visibleEmailsCou === void 0 ? 3 : _ref$visibleEmailsCou,
|
|
28120
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
28121
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$k);
|
|
28121
28122
|
var _useState = useState(""),
|
|
28122
28123
|
_useState2 = _slicedToArray$2(_useState, 2),
|
|
28123
28124
|
inputValue = _useState2[0],
|
|
@@ -28254,7 +28255,7 @@ var renderImage = function renderImage(image) {
|
|
|
28254
28255
|
}) : image;
|
|
28255
28256
|
};
|
|
28256
28257
|
|
|
28257
|
-
var _excluded$
|
|
28258
|
+
var _excluded$j = ["image", "title", "description", "helpText", "className", "primaryButtonProps", "secondaryButtonProps", "buttonSeparatorText"];
|
|
28258
28259
|
var NoData = function NoData(_ref) {
|
|
28259
28260
|
var _ref$image = _ref.image,
|
|
28260
28261
|
image = _ref$image === void 0 ? null : _ref$image,
|
|
@@ -28272,7 +28273,7 @@ var NoData = function NoData(_ref) {
|
|
|
28272
28273
|
secondaryButtonProps = _ref$secondaryButtonP === void 0 ? {} : _ref$secondaryButtonP,
|
|
28273
28274
|
_ref$buttonSeparatorT = _ref.buttonSeparatorText,
|
|
28274
28275
|
buttonSeparatorText = _ref$buttonSeparatorT === void 0 ? "" : _ref$buttonSeparatorT,
|
|
28275
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
28276
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$j);
|
|
28276
28277
|
var hasPrimaryButtonProps = !isEmpty(primaryButtonProps);
|
|
28277
28278
|
var hasSecondaryButtonProps = !isEmpty(secondaryButtonProps);
|
|
28278
28279
|
var hasButtonSeparatorText = !isEmpty(buttonSeparatorText);
|
|
@@ -28488,7 +28489,7 @@ var getHeaderHeight = function getHeaderHeight(paneWrapper) {
|
|
|
28488
28489
|
return header ? header.offsetHeight : DEFAULT_PANE_HEADER_HEIGHT;
|
|
28489
28490
|
};
|
|
28490
28491
|
|
|
28491
|
-
var _excluded$
|
|
28492
|
+
var _excluded$i = ["size", "isOpen", "onClose", "children", "className", "closeOnEsc", "closeButton", "backdropClassName", "closeOnOutsideClick", "initialFocusRef", "finalFocusRef"];
|
|
28492
28493
|
var SIZES$3 = {
|
|
28493
28494
|
small: "small",
|
|
28494
28495
|
large: "large"
|
|
@@ -28513,7 +28514,7 @@ var Pane = function Pane(_ref) {
|
|
|
28513
28514
|
closeOnOutsideClick = _ref$closeOnOutsideCl === void 0 ? true : _ref$closeOnOutsideCl,
|
|
28514
28515
|
initialFocusRef = _ref.initialFocusRef,
|
|
28515
28516
|
finalFocusRef = _ref.finalFocusRef,
|
|
28516
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
28517
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$i);
|
|
28517
28518
|
var _useState = useState(false),
|
|
28518
28519
|
_useState2 = _slicedToArray$2(_useState, 2),
|
|
28519
28520
|
hasTransitionCompleted = _useState2[0],
|
|
@@ -28598,12 +28599,12 @@ var Title = function Title(_ref) {
|
|
|
28598
28599
|
}, children);
|
|
28599
28600
|
};
|
|
28600
28601
|
|
|
28601
|
-
var _excluded$
|
|
28602
|
+
var _excluded$h = ["children", "theme"];
|
|
28602
28603
|
var Popover = function Popover(_ref) {
|
|
28603
28604
|
var children = _ref.children,
|
|
28604
28605
|
_ref$theme = _ref.theme,
|
|
28605
28606
|
theme = _ref$theme === void 0 ? "light" : _ref$theme,
|
|
28606
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
28607
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$h);
|
|
28607
28608
|
return /*#__PURE__*/React__default.createElement(Tooltip, _extends$4({
|
|
28608
28609
|
interactive: true,
|
|
28609
28610
|
arrow: false,
|
|
@@ -28614,7 +28615,7 @@ var Popover = function Popover(_ref) {
|
|
|
28614
28615
|
};
|
|
28615
28616
|
Popover.Title = Title;
|
|
28616
28617
|
|
|
28617
|
-
var _excluded$
|
|
28618
|
+
var _excluded$g = ["name", "label", "className", "labelProps"];
|
|
28618
28619
|
var Item$1 = function Item(_ref) {
|
|
28619
28620
|
var _ref$name = _ref.name,
|
|
28620
28621
|
name = _ref$name === void 0 ? "" : _ref$name,
|
|
@@ -28623,7 +28624,7 @@ var Item$1 = function Item(_ref) {
|
|
|
28623
28624
|
_ref$className = _ref.className,
|
|
28624
28625
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
28625
28626
|
labelProps = _ref.labelProps,
|
|
28626
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
28627
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$g);
|
|
28627
28628
|
var id = useId(otherProps.id);
|
|
28628
28629
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
28629
28630
|
className: classnames$1(["neeto-ui-radio__item", className])
|
|
@@ -28639,7 +28640,7 @@ var Item$1 = function Item(_ref) {
|
|
|
28639
28640
|
};
|
|
28640
28641
|
Item$1.displayName = "Radio.Item";
|
|
28641
28642
|
|
|
28642
|
-
var _excluded$
|
|
28643
|
+
var _excluded$f = ["label", "children", "stacked", "className", "containerClassName", "error", "onChange", "labelProps"];
|
|
28643
28644
|
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; }
|
|
28644
28645
|
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; }
|
|
28645
28646
|
var Radio = function Radio(_ref) {
|
|
@@ -28656,7 +28657,7 @@ var Radio = function Radio(_ref) {
|
|
|
28656
28657
|
error = _ref$error === void 0 ? "" : _ref$error,
|
|
28657
28658
|
onChange = _ref.onChange,
|
|
28658
28659
|
labelProps = _ref.labelProps,
|
|
28659
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
28660
|
+
props = _objectWithoutProperties$1(_ref, _excluded$f);
|
|
28660
28661
|
var _useState = useState(""),
|
|
28661
28662
|
_useState2 = _slicedToArray$2(_useState, 2),
|
|
28662
28663
|
internalValue = _useState2[0],
|
|
@@ -28690,7 +28691,7 @@ var Radio = function Radio(_ref) {
|
|
|
28690
28691
|
};
|
|
28691
28692
|
Radio.Item = Item$1;
|
|
28692
28693
|
|
|
28693
|
-
var _excluded$
|
|
28694
|
+
var _excluded$e = ["defaultOptions", "cacheOptions", "loadOptions", "options", "isLoading", "onInputChange", "filterOption"];
|
|
28694
28695
|
function useAsync(_ref) {
|
|
28695
28696
|
var _ref$defaultOptions = _ref.defaultOptions,
|
|
28696
28697
|
propsDefaultOptions = _ref$defaultOptions === void 0 ? false : _ref$defaultOptions,
|
|
@@ -28703,7 +28704,7 @@ function useAsync(_ref) {
|
|
|
28703
28704
|
propsOnInputChange = _ref.onInputChange,
|
|
28704
28705
|
_ref$filterOption = _ref.filterOption,
|
|
28705
28706
|
filterOption = _ref$filterOption === void 0 ? null : _ref$filterOption,
|
|
28706
|
-
restSelectProps = _objectWithoutProperties(_ref, _excluded$
|
|
28707
|
+
restSelectProps = _objectWithoutProperties(_ref, _excluded$e);
|
|
28707
28708
|
var propsInputValue = restSelectProps.inputValue;
|
|
28708
28709
|
var lastRequest = useRef(undefined);
|
|
28709
28710
|
var mounted = useRef(false);
|
|
@@ -28862,7 +28863,7 @@ var Spinner = function Spinner(_ref) {
|
|
|
28862
28863
|
}));
|
|
28863
28864
|
};
|
|
28864
28865
|
|
|
28865
|
-
var _excluded$
|
|
28866
|
+
var _excluded$d = ["size", "label", "required", "error", "helpText", "className", "innerRef", "isCreateable", "strategy", "id", "labelProps", "value", "defaultValue", "components", "optionRemapping"];
|
|
28866
28867
|
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; }
|
|
28867
28868
|
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; }
|
|
28868
28869
|
var SIZES$2 = {
|
|
@@ -28989,7 +28990,7 @@ var Select = function Select(_ref) {
|
|
|
28989
28990
|
componentOverrides = _ref.components,
|
|
28990
28991
|
_ref$optionRemapping = _ref.optionRemapping,
|
|
28991
28992
|
optionRemapping = _ref$optionRemapping === void 0 ? {} : _ref$optionRemapping,
|
|
28992
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
28993
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$d);
|
|
28993
28994
|
var inputId = useId(id);
|
|
28994
28995
|
var Parent = StateManagedSelect;
|
|
28995
28996
|
if (isCreateable) {
|
|
@@ -29078,7 +29079,7 @@ var Select = function Select(_ref) {
|
|
|
29078
29079
|
|
|
29079
29080
|
var NEETO_UI_PRIMARY_500 = "#4558f9";
|
|
29080
29081
|
|
|
29081
|
-
var _excluded$
|
|
29082
|
+
var _excluded$c = ["min", "max", "defaultValue", "onChange", "value", "label", "required", "labelProps", "error", "helpText"];
|
|
29082
29083
|
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; }
|
|
29083
29084
|
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; }
|
|
29084
29085
|
var Slider = function Slider(_ref) {
|
|
@@ -29099,7 +29100,7 @@ var Slider = function Slider(_ref) {
|
|
|
29099
29100
|
labelProps = _ref$labelProps === void 0 ? {} : _ref$labelProps,
|
|
29100
29101
|
error = _ref.error,
|
|
29101
29102
|
helpText = _ref.helpText,
|
|
29102
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
29103
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$c);
|
|
29103
29104
|
var _id = useId$1();
|
|
29104
29105
|
var id = otherProps.id || _id;
|
|
29105
29106
|
var errorId = "error_".concat(id);
|
|
@@ -29162,7 +29163,7 @@ var Slider = function Slider(_ref) {
|
|
|
29162
29163
|
}, helpText)));
|
|
29163
29164
|
};
|
|
29164
29165
|
|
|
29165
|
-
var _excluded$
|
|
29166
|
+
var _excluded$b = ["label", "required", "className", "error", "onChange", "labelProps", "children"];
|
|
29166
29167
|
var Switch = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
|
|
29167
29168
|
var _ref$label = _ref.label,
|
|
29168
29169
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
@@ -29176,7 +29177,7 @@ var Switch = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
|
|
|
29176
29177
|
onChange = _ref$onChange === void 0 ? noop$2 : _ref$onChange,
|
|
29177
29178
|
labelProps = _ref.labelProps,
|
|
29178
29179
|
children = _ref.children,
|
|
29179
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
29180
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$b);
|
|
29180
29181
|
var id = useId(otherProps.id);
|
|
29181
29182
|
var errorId = "error_".concat(id);
|
|
29182
29183
|
var checked = otherProps.checked,
|
|
@@ -29222,7 +29223,7 @@ var Switch = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
|
|
|
29222
29223
|
});
|
|
29223
29224
|
Switch.displayName = "Switch";
|
|
29224
29225
|
|
|
29225
|
-
var _excluded$
|
|
29226
|
+
var _excluded$a = ["active", "className", "children", "icon", "onClick", "activeClassName"];
|
|
29226
29227
|
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; }
|
|
29227
29228
|
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; }
|
|
29228
29229
|
var Item = function Item(_ref) {
|
|
@@ -29236,7 +29237,7 @@ var Item = function Item(_ref) {
|
|
|
29236
29237
|
onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
29237
29238
|
_ref$activeClassName = _ref.activeClassName,
|
|
29238
29239
|
activeClassName = _ref$activeClassName === void 0 ? "" : _ref$activeClassName,
|
|
29239
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
29240
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$a);
|
|
29240
29241
|
var Icon = typeof icon === "string" ? function () {
|
|
29241
29242
|
return /*#__PURE__*/React__default.createElement("i", {
|
|
29242
29243
|
className: icon,
|
|
@@ -29260,7 +29261,7 @@ var Item = function Item(_ref) {
|
|
|
29260
29261
|
};
|
|
29261
29262
|
Item.displayName = "Tab.Item";
|
|
29262
29263
|
|
|
29263
|
-
var _excluded$
|
|
29264
|
+
var _excluded$9 = ["size", "noUnderline", "children", "className"];
|
|
29264
29265
|
var SIZES$1 = {
|
|
29265
29266
|
large: "large",
|
|
29266
29267
|
small: "small"
|
|
@@ -29273,7 +29274,7 @@ var Tab = function Tab(_ref) {
|
|
|
29273
29274
|
children = _ref.children,
|
|
29274
29275
|
_ref$className = _ref.className,
|
|
29275
29276
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
29276
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
29277
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$9);
|
|
29277
29278
|
return /*#__PURE__*/React__default.createElement("div", _extends$4({
|
|
29278
29279
|
"data-cy": "tab-container",
|
|
29279
29280
|
className: classnames$1({
|
|
@@ -29340,9 +29341,9 @@ var _isObject = function (it) {
|
|
|
29340
29341
|
return typeof it === 'object' ? it !== null : typeof it === 'function';
|
|
29341
29342
|
};
|
|
29342
29343
|
|
|
29343
|
-
var isObject$
|
|
29344
|
+
var isObject$5 = _isObject;
|
|
29344
29345
|
var _anObject = function (it) {
|
|
29345
|
-
if (!isObject$
|
|
29346
|
+
if (!isObject$5(it)) throw TypeError(it + ' is not an object!');
|
|
29346
29347
|
return it;
|
|
29347
29348
|
};
|
|
29348
29349
|
|
|
@@ -29388,15 +29389,15 @@ var _ie8DomDefine = !require_descriptors() && !_fails(function () {
|
|
|
29388
29389
|
});
|
|
29389
29390
|
|
|
29390
29391
|
// 7.1.1 ToPrimitive(input [, PreferredType])
|
|
29391
|
-
var isObject$
|
|
29392
|
+
var isObject$4 = _isObject;
|
|
29392
29393
|
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
|
|
29393
29394
|
// and the second argument - flag - preferred type is a string
|
|
29394
29395
|
var _toPrimitive = function (it, S) {
|
|
29395
|
-
if (!isObject$
|
|
29396
|
+
if (!isObject$4(it)) return it;
|
|
29396
29397
|
var fn, val;
|
|
29397
|
-
if (S && typeof (fn = it.toString) == 'function' && !isObject$
|
|
29398
|
-
if (typeof (fn = it.valueOf) == 'function' && !isObject$
|
|
29399
|
-
if (!S && typeof (fn = it.toString) == 'function' && !isObject$
|
|
29398
|
+
if (S && typeof (fn = it.toString) == 'function' && !isObject$4(val = fn.call(it))) return val;
|
|
29399
|
+
if (typeof (fn = it.valueOf) == 'function' && !isObject$4(val = fn.call(it))) return val;
|
|
29400
|
+
if (!S && typeof (fn = it.toString) == 'function' && !isObject$4(val = fn.call(it))) return val;
|
|
29400
29401
|
throw TypeError("Can't convert object to primitive value");
|
|
29401
29402
|
};
|
|
29402
29403
|
|
|
@@ -29442,9 +29443,9 @@ var _hide = require_descriptors() ? function (object, key, value) {
|
|
|
29442
29443
|
return object;
|
|
29443
29444
|
};
|
|
29444
29445
|
|
|
29445
|
-
var hasOwnProperty = {}.hasOwnProperty;
|
|
29446
|
+
var hasOwnProperty$1 = {}.hasOwnProperty;
|
|
29446
29447
|
var _has = function (it, key) {
|
|
29447
|
-
return hasOwnProperty.call(it, key);
|
|
29448
|
+
return hasOwnProperty$1.call(it, key);
|
|
29448
29449
|
};
|
|
29449
29450
|
|
|
29450
29451
|
var global$5 = _global.exports;
|
|
@@ -30016,7 +30017,7 @@ var symbol$1 = {exports: {}};
|
|
|
30016
30017
|
var _meta = {exports: {}};
|
|
30017
30018
|
|
|
30018
30019
|
var META$1 = _uid('meta');
|
|
30019
|
-
var isObject$
|
|
30020
|
+
var isObject$3 = _isObject;
|
|
30020
30021
|
var has$6 = _has;
|
|
30021
30022
|
var setDesc = require_objectDp().f;
|
|
30022
30023
|
var id = 0;
|
|
@@ -30034,7 +30035,7 @@ var setMeta = function (it) {
|
|
|
30034
30035
|
};
|
|
30035
30036
|
var fastKey = function (it, create) {
|
|
30036
30037
|
// return primitive with prefix
|
|
30037
|
-
if (!isObject$
|
|
30038
|
+
if (!isObject$3(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
|
30038
30039
|
if (!has$6(it, META$1)) {
|
|
30039
30040
|
// can't set metadata to uncaught frozen object
|
|
30040
30041
|
if (!isExtensible(it)) return 'F';
|
|
@@ -30191,7 +30192,7 @@ var wksDefine = _wksDefine;
|
|
|
30191
30192
|
var enumKeys = _enumKeys;
|
|
30192
30193
|
var isArray$4 = _isArray;
|
|
30193
30194
|
var anObject = _anObject;
|
|
30194
|
-
var isObject$
|
|
30195
|
+
var isObject$2 = _isObject;
|
|
30195
30196
|
var toObject$1 = _toObject;
|
|
30196
30197
|
var toIObject$1 = _toIobject;
|
|
30197
30198
|
var toPrimitive = _toPrimitive;
|
|
@@ -30401,7 +30402,7 @@ $JSON && $export$3($export$3.S + $export$3.F * (!USE_NATIVE || $fails(function (
|
|
|
30401
30402
|
var replacer, $replacer;
|
|
30402
30403
|
while (arguments.length > i) args.push(arguments[i++]);
|
|
30403
30404
|
$replacer = replacer = args[1];
|
|
30404
|
-
if (!isObject$
|
|
30405
|
+
if (!isObject$2(replacer) && it === undefined || isSymbol$1(it)) return; // IE8 returns string on undefined
|
|
30405
30406
|
if (!isArray$4(replacer)) replacer = function (key, value) {
|
|
30406
30407
|
if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
|
|
30407
30408
|
if (!isSymbol$1(value)) return value;
|
|
@@ -31089,12 +31090,12 @@ var cjs = {exports: {}};
|
|
|
31089
31090
|
|
|
31090
31091
|
var Draggable$1 = {};
|
|
31091
31092
|
|
|
31092
|
-
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}
|
|
31093
|
+
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}
|
|
31093
31094
|
|
|
31094
31095
|
var clsx_m = /*#__PURE__*/Object.freeze({
|
|
31095
31096
|
__proto__: null,
|
|
31096
|
-
clsx: clsx,
|
|
31097
|
-
'default': clsx
|
|
31097
|
+
clsx: clsx$2,
|
|
31098
|
+
'default': clsx$2
|
|
31098
31099
|
});
|
|
31099
31100
|
|
|
31100
31101
|
var require$$3 = /*@__PURE__*/getAugmentedNamespace(clsx_m);
|
|
@@ -31109,7 +31110,7 @@ Object.defineProperty(shims, "__esModule", {
|
|
|
31109
31110
|
shims.dontSetMe = dontSetMe;
|
|
31110
31111
|
shims.findInArray = findInArray;
|
|
31111
31112
|
shims.int = int;
|
|
31112
|
-
shims.isFunction = isFunction$
|
|
31113
|
+
shims.isFunction = isFunction$2;
|
|
31113
31114
|
shims.isNum = isNum;
|
|
31114
31115
|
|
|
31115
31116
|
// @credits https://gist.github.com/rogozhnikoff/a43cfed27c41e4e68cdc
|
|
@@ -31125,7 +31126,7 @@ function findInArray(array
|
|
|
31125
31126
|
}
|
|
31126
31127
|
}
|
|
31127
31128
|
|
|
31128
|
-
function isFunction$
|
|
31129
|
+
function isFunction$2(func
|
|
31129
31130
|
/*: any*/
|
|
31130
31131
|
)
|
|
31131
31132
|
/*: boolean %checks*/
|
|
@@ -33014,7 +33015,7 @@ var _utils = utils$3;
|
|
|
33014
33015
|
|
|
33015
33016
|
var _propTypes$1 = propTypes;
|
|
33016
33017
|
|
|
33017
|
-
var _excluded$
|
|
33018
|
+
var _excluded$8 = ["children", "className", "draggableOpts", "width", "height", "handle", "handleSize", "lockAspectRatio", "axis", "minConstraints", "maxConstraints", "onResize", "onResizeStop", "onResizeStart", "resizeHandles", "transformScale"];
|
|
33018
33019
|
|
|
33019
33020
|
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); }
|
|
33020
33021
|
|
|
@@ -33247,7 +33248,7 @@ var Resizable$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
33247
33248
|
_this$props2.onResizeStart;
|
|
33248
33249
|
var resizeHandles = _this$props2.resizeHandles;
|
|
33249
33250
|
_this$props2.transformScale;
|
|
33250
|
-
var p = _objectWithoutPropertiesLoose$1(_this$props2, _excluded$
|
|
33251
|
+
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.
|
|
33251
33252
|
// We are then defining its children as:
|
|
33252
33253
|
// 1. Its original children (resizable's child's children), and
|
|
33253
33254
|
// 2. One or more draggable handles.
|
|
@@ -33299,7 +33300,7 @@ var _Resizable = _interopRequireDefault$3(Resizable$2);
|
|
|
33299
33300
|
|
|
33300
33301
|
var _propTypes2 = propTypes;
|
|
33301
33302
|
|
|
33302
|
-
var _excluded$
|
|
33303
|
+
var _excluded$7 = ["handle", "handleSize", "onResize", "onResizeStart", "onResizeStop", "draggableOpts", "minConstraints", "maxConstraints", "lockAspectRatio", "axis", "width", "height", "resizeHandles", "style", "transformScale"];
|
|
33303
33304
|
|
|
33304
33305
|
function _interopRequireDefault$3(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33305
33306
|
|
|
@@ -33392,7 +33393,7 @@ var ResizableBox = /*#__PURE__*/function (_React$Component) {
|
|
|
33392
33393
|
var resizeHandles = _this$props.resizeHandles,
|
|
33393
33394
|
style = _this$props.style,
|
|
33394
33395
|
transformScale = _this$props.transformScale,
|
|
33395
|
-
props = _objectWithoutPropertiesLoose(_this$props, _excluded$
|
|
33396
|
+
props = _objectWithoutPropertiesLoose(_this$props, _excluded$7);
|
|
33396
33397
|
|
|
33397
33398
|
return /*#__PURE__*/React$2.createElement(_Resizable.default, {
|
|
33398
33399
|
axis: axis,
|
|
@@ -33432,14 +33433,14 @@ reactResizable.exports = function() {
|
|
|
33432
33433
|
var Resizable = reactResizable.exports.Resizable = Resizable$2.default;
|
|
33433
33434
|
reactResizable.exports.ResizableBox = ResizableBox$1.default;
|
|
33434
33435
|
|
|
33435
|
-
var _excluded$
|
|
33436
|
+
var _excluded$6 = ["onResize", "width", "onResizeStop", "className"],
|
|
33436
33437
|
_excluded2$1 = ["onResize", "width", "onResizeStop"];
|
|
33437
33438
|
var HeaderCell = function HeaderCell(props) {
|
|
33438
33439
|
var onResize = props.onResize,
|
|
33439
33440
|
width = props.width,
|
|
33440
33441
|
onResizeStop = props.onResizeStop,
|
|
33441
33442
|
className = props.className,
|
|
33442
|
-
restProps = _objectWithoutProperties$1(props, _excluded$
|
|
33443
|
+
restProps = _objectWithoutProperties$1(props, _excluded$6);
|
|
33443
33444
|
if (!width) {
|
|
33444
33445
|
return /*#__PURE__*/React__default.createElement("th", _extends$4({}, restProps, {
|
|
33445
33446
|
className: "drag-handler"
|
|
@@ -34105,7 +34106,7 @@ var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
|
|
|
34105
34106
|
var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
|
|
34106
34107
|
var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
|
|
34107
34108
|
var booleanValueOf = Boolean.prototype.valueOf;
|
|
34108
|
-
var objectToString = Object.prototype.toString;
|
|
34109
|
+
var objectToString$1 = Object.prototype.toString;
|
|
34109
34110
|
var functionToString = Function.prototype.toString;
|
|
34110
34111
|
var $match = String.prototype.match;
|
|
34111
34112
|
var $slice = String.prototype.slice;
|
|
@@ -34324,7 +34325,7 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
|
|
|
34324
34325
|
if (isBoolean(obj)) {
|
|
34325
34326
|
return markBoxed(booleanValueOf.call(obj));
|
|
34326
34327
|
}
|
|
34327
|
-
if (isString$
|
|
34328
|
+
if (isString$3(obj)) {
|
|
34328
34329
|
return markBoxed(inspect(String(obj)));
|
|
34329
34330
|
}
|
|
34330
34331
|
if (!isDate(obj) && !isRegExp$2(obj)) {
|
|
@@ -34356,7 +34357,7 @@ function isArray$3(obj) { return toStr(obj) === '[object Array]' && (!toStringTa
|
|
|
34356
34357
|
function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
34357
34358
|
function isRegExp$2(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
34358
34359
|
function isError$1(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
34359
|
-
function isString$
|
|
34360
|
+
function isString$3(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
34360
34361
|
function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
34361
34362
|
function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
34362
34363
|
|
|
@@ -34395,7 +34396,7 @@ function has$3(obj, key) {
|
|
|
34395
34396
|
}
|
|
34396
34397
|
|
|
34397
34398
|
function toStr(obj) {
|
|
34398
|
-
return objectToString.call(obj);
|
|
34399
|
+
return objectToString$1.call(obj);
|
|
34399
34400
|
}
|
|
34400
34401
|
|
|
34401
34402
|
function nameOf(f) {
|
|
@@ -35689,7 +35690,7 @@ var useTableSort = function useTableSort() {
|
|
|
35689
35690
|
};
|
|
35690
35691
|
};
|
|
35691
35692
|
|
|
35692
|
-
var _excluded$
|
|
35693
|
+
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"];
|
|
35693
35694
|
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; }
|
|
35694
35695
|
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; }
|
|
35695
35696
|
var TABLE_PAGINATION_HEIGHT = 64;
|
|
@@ -35738,7 +35739,7 @@ var Table = function Table(_ref) {
|
|
|
35738
35739
|
components = _ref$components === void 0 ? {} : _ref$components,
|
|
35739
35740
|
_ref$preserveTableSta = _ref.preserveTableStateInQuery,
|
|
35740
35741
|
preserveTableStateInQuery = _ref$preserveTableSta === void 0 ? false : _ref$preserveTableSta,
|
|
35741
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
35742
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$5);
|
|
35742
35743
|
var _useState = useState(null),
|
|
35743
35744
|
_useState2 = _slicedToArray$2(_useState, 2),
|
|
35744
35745
|
containerHeight = _useState2[0],
|
|
@@ -35936,7 +35937,7 @@ var Table = function Table(_ref) {
|
|
|
35936
35937
|
return renderTable();
|
|
35937
35938
|
};
|
|
35938
35939
|
|
|
35939
|
-
var _excluded$
|
|
35940
|
+
var _excluded$4 = ["size", "rows", "disabled", "required", "nakedTextarea", "helpText", "error", "label", "className", "maxLength", "unlimitedChars", "labelProps"];
|
|
35940
35941
|
var SIZES = {
|
|
35941
35942
|
small: "small",
|
|
35942
35943
|
medium: "medium",
|
|
@@ -35966,7 +35967,7 @@ var Textarea = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
|
|
|
35966
35967
|
_ref$unlimitedChars = _ref.unlimitedChars,
|
|
35967
35968
|
unlimitedChars = _ref$unlimitedChars === void 0 ? false : _ref$unlimitedChars,
|
|
35968
35969
|
labelProps = _ref.labelProps,
|
|
35969
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
35970
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$4);
|
|
35970
35971
|
var _useState = useState(""),
|
|
35971
35972
|
_useState2 = _slicedToArray$2(_useState, 2),
|
|
35972
35973
|
valueInternal = _useState2[0],
|
|
@@ -36040,8 +36041,8 @@ var TIME_PICKER_TYPES = {
|
|
|
36040
36041
|
time: _DatePicker
|
|
36041
36042
|
};
|
|
36042
36043
|
|
|
36043
|
-
var _excluded$
|
|
36044
|
-
var INPUT_SIZES = {
|
|
36044
|
+
var _excluded$3 = ["className", "label", "size", "dropdownClassName", "popupClassName", "format", "interval", "onChange", "type", "nakedInput", "disabled", "error", "defaultValue", "value", "labelProps", "required"];
|
|
36045
|
+
var INPUT_SIZES$1 = {
|
|
36045
36046
|
small: "small",
|
|
36046
36047
|
medium: "medium",
|
|
36047
36048
|
large: "large"
|
|
@@ -36051,13 +36052,13 @@ var TIME_PICKER_INTERVAL = {
|
|
|
36051
36052
|
minuteStep: 1,
|
|
36052
36053
|
secondStep: 1
|
|
36053
36054
|
};
|
|
36054
|
-
var TimePicker = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
|
|
36055
|
+
var TimePicker$1 = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
|
|
36055
36056
|
var _ref$className = _ref.className,
|
|
36056
36057
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
36057
36058
|
_ref$label = _ref.label,
|
|
36058
36059
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
36059
36060
|
_ref$size = _ref.size,
|
|
36060
|
-
size = _ref$size === void 0 ? INPUT_SIZES.medium : _ref$size,
|
|
36061
|
+
size = _ref$size === void 0 ? INPUT_SIZES$1.medium : _ref$size,
|
|
36061
36062
|
_ref$dropdownClassNam = _ref.dropdownClassName,
|
|
36062
36063
|
dropdownClassName = _ref$dropdownClassNam === void 0 ? "" : _ref$dropdownClassNam,
|
|
36063
36064
|
_ref$popupClassName = _ref.popupClassName,
|
|
@@ -36081,7 +36082,7 @@ var TimePicker = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
|
|
|
36081
36082
|
labelProps = _ref.labelProps,
|
|
36082
36083
|
_ref$required = _ref.required,
|
|
36083
36084
|
required = _ref$required === void 0 ? false : _ref$required,
|
|
36084
|
-
otherProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
36085
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$3);
|
|
36085
36086
|
var id = useId(otherProps.id);
|
|
36086
36087
|
var timePickerRef = useSyncedRef(ref);
|
|
36087
36088
|
var Component = TIME_PICKER_TYPES[type.toLowerCase()];
|
|
@@ -36144,7 +36145,7 @@ var TimePicker = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
|
|
|
36144
36145
|
mode: undefined,
|
|
36145
36146
|
panelRender: panelRender,
|
|
36146
36147
|
picker: "time",
|
|
36147
|
-
suffixIcon: /*#__PURE__*/React__default.createElement(Clock, {
|
|
36148
|
+
suffixIcon: /*#__PURE__*/React__default.createElement(Clock$1, {
|
|
36148
36149
|
size: 16
|
|
36149
36150
|
}),
|
|
36150
36151
|
value: convertToDayjsObjects(value)
|
|
@@ -36154,7 +36155,2637 @@ var TimePicker = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
|
|
|
36154
36155
|
id: errorId
|
|
36155
36156
|
}, error));
|
|
36156
36157
|
});
|
|
36157
|
-
TimePicker.displayName = "TimePicker";
|
|
36158
|
+
TimePicker$1.displayName = "TimePicker";
|
|
36159
|
+
|
|
36160
|
+
var customParseFormat$1 = {exports: {}};
|
|
36161
|
+
|
|
36162
|
+
(function (module, exports) {
|
|
36163
|
+
!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);};}}));
|
|
36164
|
+
} (customParseFormat$1));
|
|
36165
|
+
|
|
36166
|
+
var customParseFormat = customParseFormat$1.exports;
|
|
36167
|
+
|
|
36168
|
+
var __spreadArray$2 = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
|
36169
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
36170
|
+
if (ar || !(i in from)) {
|
|
36171
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
36172
|
+
ar[i] = from[i];
|
|
36173
|
+
}
|
|
36174
|
+
}
|
|
36175
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
36176
|
+
};
|
|
36177
|
+
// As defined on the list of supported events: https://reactjs.org/docs/events.html
|
|
36178
|
+
var clipboardEvents = ['onCopy', 'onCut', 'onPaste'];
|
|
36179
|
+
var compositionEvents = [
|
|
36180
|
+
'onCompositionEnd',
|
|
36181
|
+
'onCompositionStart',
|
|
36182
|
+
'onCompositionUpdate',
|
|
36183
|
+
];
|
|
36184
|
+
var focusEvents = ['onFocus', 'onBlur'];
|
|
36185
|
+
var formEvents = ['onInput', 'onInvalid', 'onReset', 'onSubmit'];
|
|
36186
|
+
var imageEvents = ['onLoad', 'onError'];
|
|
36187
|
+
var keyboardEvents = ['onKeyDown', 'onKeyPress', 'onKeyUp'];
|
|
36188
|
+
var mediaEvents = [
|
|
36189
|
+
'onAbort',
|
|
36190
|
+
'onCanPlay',
|
|
36191
|
+
'onCanPlayThrough',
|
|
36192
|
+
'onDurationChange',
|
|
36193
|
+
'onEmptied',
|
|
36194
|
+
'onEncrypted',
|
|
36195
|
+
'onEnded',
|
|
36196
|
+
'onError',
|
|
36197
|
+
'onLoadedData',
|
|
36198
|
+
'onLoadedMetadata',
|
|
36199
|
+
'onLoadStart',
|
|
36200
|
+
'onPause',
|
|
36201
|
+
'onPlay',
|
|
36202
|
+
'onPlaying',
|
|
36203
|
+
'onProgress',
|
|
36204
|
+
'onRateChange',
|
|
36205
|
+
'onSeeked',
|
|
36206
|
+
'onSeeking',
|
|
36207
|
+
'onStalled',
|
|
36208
|
+
'onSuspend',
|
|
36209
|
+
'onTimeUpdate',
|
|
36210
|
+
'onVolumeChange',
|
|
36211
|
+
'onWaiting',
|
|
36212
|
+
];
|
|
36213
|
+
var mouseEvents = [
|
|
36214
|
+
'onClick',
|
|
36215
|
+
'onContextMenu',
|
|
36216
|
+
'onDoubleClick',
|
|
36217
|
+
'onMouseDown',
|
|
36218
|
+
'onMouseEnter',
|
|
36219
|
+
'onMouseLeave',
|
|
36220
|
+
'onMouseMove',
|
|
36221
|
+
'onMouseOut',
|
|
36222
|
+
'onMouseOver',
|
|
36223
|
+
'onMouseUp',
|
|
36224
|
+
];
|
|
36225
|
+
var dragEvents = [
|
|
36226
|
+
'onDrag',
|
|
36227
|
+
'onDragEnd',
|
|
36228
|
+
'onDragEnter',
|
|
36229
|
+
'onDragExit',
|
|
36230
|
+
'onDragLeave',
|
|
36231
|
+
'onDragOver',
|
|
36232
|
+
'onDragStart',
|
|
36233
|
+
'onDrop',
|
|
36234
|
+
];
|
|
36235
|
+
var selectionEvents = ['onSelect'];
|
|
36236
|
+
var touchEvents = ['onTouchCancel', 'onTouchEnd', 'onTouchMove', 'onTouchStart'];
|
|
36237
|
+
var pointerEvents = [
|
|
36238
|
+
'onPointerDown',
|
|
36239
|
+
'onPointerMove',
|
|
36240
|
+
'onPointerUp',
|
|
36241
|
+
'onPointerCancel',
|
|
36242
|
+
'onGotPointerCapture',
|
|
36243
|
+
'onLostPointerCapture',
|
|
36244
|
+
'onPointerEnter',
|
|
36245
|
+
'onPointerLeave',
|
|
36246
|
+
'onPointerOver',
|
|
36247
|
+
'onPointerOut',
|
|
36248
|
+
];
|
|
36249
|
+
var uiEvents = ['onScroll'];
|
|
36250
|
+
var wheelEvents = ['onWheel'];
|
|
36251
|
+
var animationEvents = [
|
|
36252
|
+
'onAnimationStart',
|
|
36253
|
+
'onAnimationEnd',
|
|
36254
|
+
'onAnimationIteration',
|
|
36255
|
+
];
|
|
36256
|
+
var transitionEvents = ['onTransitionEnd'];
|
|
36257
|
+
var otherEvents = ['onToggle'];
|
|
36258
|
+
var changeEvents = ['onChange'];
|
|
36259
|
+
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);
|
|
36260
|
+
/**
|
|
36261
|
+
* Returns an object with on-event callback props curried with provided args.
|
|
36262
|
+
* @param {Object} props Props passed to a component.
|
|
36263
|
+
* @param {Function=} getArgs A function that returns argument(s) on-event callbacks
|
|
36264
|
+
* shall be curried with.
|
|
36265
|
+
*/
|
|
36266
|
+
function makeEventProps(props, getArgs) {
|
|
36267
|
+
var eventProps = {};
|
|
36268
|
+
allEvents.forEach(function (eventName) {
|
|
36269
|
+
var eventHandler = props[eventName];
|
|
36270
|
+
if (!eventHandler) {
|
|
36271
|
+
return;
|
|
36272
|
+
}
|
|
36273
|
+
if (getArgs) {
|
|
36274
|
+
eventProps[eventName] = (function (event) {
|
|
36275
|
+
return eventHandler(event, getArgs(eventName));
|
|
36276
|
+
});
|
|
36277
|
+
}
|
|
36278
|
+
else {
|
|
36279
|
+
eventProps[eventName] = eventHandler;
|
|
36280
|
+
}
|
|
36281
|
+
});
|
|
36282
|
+
return eventProps;
|
|
36283
|
+
}
|
|
36284
|
+
|
|
36285
|
+
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}
|
|
36286
|
+
|
|
36287
|
+
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}
|
|
36288
|
+
|
|
36289
|
+
/**
|
|
36290
|
+
* Utils
|
|
36291
|
+
*/
|
|
36292
|
+
/**
|
|
36293
|
+
* Gets hours from a given date.
|
|
36294
|
+
*
|
|
36295
|
+
* @param {Date | string} date Date to get hours from
|
|
36296
|
+
* @returns {number} Hours
|
|
36297
|
+
*/
|
|
36298
|
+
function getHours(date) {
|
|
36299
|
+
if (date instanceof Date) {
|
|
36300
|
+
return date.getHours();
|
|
36301
|
+
}
|
|
36302
|
+
if (typeof date === 'string') {
|
|
36303
|
+
var datePieces = date.split(':');
|
|
36304
|
+
if (datePieces.length >= 2) {
|
|
36305
|
+
var hoursString = datePieces[0];
|
|
36306
|
+
if (hoursString) {
|
|
36307
|
+
var hours = parseInt(hoursString, 10);
|
|
36308
|
+
if (!isNaN(hours)) {
|
|
36309
|
+
return hours;
|
|
36310
|
+
}
|
|
36311
|
+
}
|
|
36312
|
+
}
|
|
36313
|
+
}
|
|
36314
|
+
throw new Error("Failed to get hours from date: ".concat(date, "."));
|
|
36315
|
+
}
|
|
36316
|
+
/**
|
|
36317
|
+
* Gets minutes from a given date.
|
|
36318
|
+
*
|
|
36319
|
+
* @param {Date | string} date Date to get minutes from
|
|
36320
|
+
* @returns {number} Minutes
|
|
36321
|
+
*/
|
|
36322
|
+
function getMinutes(date) {
|
|
36323
|
+
if (date instanceof Date) {
|
|
36324
|
+
return date.getMinutes();
|
|
36325
|
+
}
|
|
36326
|
+
if (typeof date === 'string') {
|
|
36327
|
+
var datePieces = date.split(':');
|
|
36328
|
+
if (datePieces.length >= 2) {
|
|
36329
|
+
var minutesString = datePieces[1] || '0';
|
|
36330
|
+
var minutes = parseInt(minutesString, 10);
|
|
36331
|
+
if (!isNaN(minutes)) {
|
|
36332
|
+
return minutes;
|
|
36333
|
+
}
|
|
36334
|
+
}
|
|
36335
|
+
}
|
|
36336
|
+
throw new Error("Failed to get minutes from date: ".concat(date, "."));
|
|
36337
|
+
}
|
|
36338
|
+
/**
|
|
36339
|
+
* Gets seconds from a given date.
|
|
36340
|
+
*
|
|
36341
|
+
* @param {Date | string} date Date to get seconds from
|
|
36342
|
+
* @returns {number} Seconds
|
|
36343
|
+
*/
|
|
36344
|
+
function getSeconds(date) {
|
|
36345
|
+
if (date instanceof Date) {
|
|
36346
|
+
return date.getSeconds();
|
|
36347
|
+
}
|
|
36348
|
+
if (typeof date === 'string') {
|
|
36349
|
+
var datePieces = date.split(':');
|
|
36350
|
+
if (datePieces.length >= 2) {
|
|
36351
|
+
var secondsWithMillisecondsString = datePieces[2] || '0';
|
|
36352
|
+
var seconds = parseInt(secondsWithMillisecondsString, 10);
|
|
36353
|
+
if (!isNaN(seconds)) {
|
|
36354
|
+
return seconds;
|
|
36355
|
+
}
|
|
36356
|
+
}
|
|
36357
|
+
}
|
|
36358
|
+
throw new Error("Failed to get seconds from date: ".concat(date, "."));
|
|
36359
|
+
}
|
|
36360
|
+
/**
|
|
36361
|
+
* Gets milliseconds from a given date.
|
|
36362
|
+
*
|
|
36363
|
+
* @param {Date | string} date Date to get milliseconds from
|
|
36364
|
+
* @returns {number} Milliseconds
|
|
36365
|
+
*/
|
|
36366
|
+
function getMilliseconds(date) {
|
|
36367
|
+
if (date instanceof Date) {
|
|
36368
|
+
return date.getMilliseconds();
|
|
36369
|
+
}
|
|
36370
|
+
if (typeof date === 'string') {
|
|
36371
|
+
var datePieces = date.split(':');
|
|
36372
|
+
if (datePieces.length >= 2) {
|
|
36373
|
+
var secondsWithMillisecondsString = datePieces[2] || '0';
|
|
36374
|
+
var millisecondsString = secondsWithMillisecondsString.split('.')[1] || '0';
|
|
36375
|
+
var milliseconds = parseInt(millisecondsString, 10);
|
|
36376
|
+
if (!isNaN(milliseconds)) {
|
|
36377
|
+
return milliseconds;
|
|
36378
|
+
}
|
|
36379
|
+
}
|
|
36380
|
+
}
|
|
36381
|
+
throw new Error("Failed to get seconds from date: ".concat(date, "."));
|
|
36382
|
+
}
|
|
36383
|
+
function padStart(num, val) {
|
|
36384
|
+
if (val === void 0) { val = 2; }
|
|
36385
|
+
var numStr = "".concat(num);
|
|
36386
|
+
if (numStr.length >= val) {
|
|
36387
|
+
return num;
|
|
36388
|
+
}
|
|
36389
|
+
return "0000".concat(numStr).slice(-val);
|
|
36390
|
+
}
|
|
36391
|
+
/**
|
|
36392
|
+
* Returns local hours and minutes (hh:mm).
|
|
36393
|
+
*
|
|
36394
|
+
* @param {Date | string} date Date to get hours and minutes from
|
|
36395
|
+
* @returns {string} Local hours and minutes
|
|
36396
|
+
*/
|
|
36397
|
+
function getHoursMinutes(date) {
|
|
36398
|
+
var hours = padStart(getHours(date));
|
|
36399
|
+
var minutes = padStart(getMinutes(date));
|
|
36400
|
+
return "".concat(hours, ":").concat(minutes);
|
|
36401
|
+
}
|
|
36402
|
+
/**
|
|
36403
|
+
* Returns local hours, minutes and seconds (hh:mm:ss).
|
|
36404
|
+
*
|
|
36405
|
+
* @param {Date | string} date Date to get hours, minutes and seconds from
|
|
36406
|
+
* @returns {string} Local hours, minutes and seconds
|
|
36407
|
+
*/
|
|
36408
|
+
function getHoursMinutesSeconds(date) {
|
|
36409
|
+
var hours = padStart(getHours(date));
|
|
36410
|
+
var minutes = padStart(getMinutes(date));
|
|
36411
|
+
var seconds = padStart(getSeconds(date));
|
|
36412
|
+
return "".concat(hours, ":").concat(minutes, ":").concat(seconds);
|
|
36413
|
+
}
|
|
36414
|
+
|
|
36415
|
+
function Hand(_a) {
|
|
36416
|
+
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;
|
|
36417
|
+
return (React__default.createElement("div", { className: "react-clock__hand react-clock__".concat(name, "-hand"), style: {
|
|
36418
|
+
transform: "rotate(".concat(angle, "deg)"),
|
|
36419
|
+
} },
|
|
36420
|
+
React__default.createElement("div", { className: "react-clock__hand__body react-clock__".concat(name, "-hand__body"), style: {
|
|
36421
|
+
width: "".concat(width, "px"),
|
|
36422
|
+
top: "".concat(50 - length / 2, "%"),
|
|
36423
|
+
bottom: "".concat(50 - oppositeLength / 2, "%"),
|
|
36424
|
+
} })));
|
|
36425
|
+
}
|
|
36426
|
+
|
|
36427
|
+
function Mark(_a) {
|
|
36428
|
+
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;
|
|
36429
|
+
return (React__default.createElement("div", { className: "react-clock__mark react-clock__".concat(name, "-mark"), style: {
|
|
36430
|
+
transform: "rotate(".concat(angle, "deg)"),
|
|
36431
|
+
} },
|
|
36432
|
+
React__default.createElement("div", { className: "react-clock__mark__body react-clock__".concat(name, "-mark__body"), style: {
|
|
36433
|
+
width: "".concat(width, "px"),
|
|
36434
|
+
top: 0,
|
|
36435
|
+
bottom: "".concat(100 - length / 2, "%"),
|
|
36436
|
+
} }),
|
|
36437
|
+
number ? (React__default.createElement("div", { className: "react-clock__mark__number", style: {
|
|
36438
|
+
transform: "rotate(-".concat(angle, "deg)"),
|
|
36439
|
+
top: "".concat(length / 2, "%"),
|
|
36440
|
+
} }, number)) : null));
|
|
36441
|
+
}
|
|
36442
|
+
|
|
36443
|
+
var __assign$8 = (undefined && undefined.__assign) || function () {
|
|
36444
|
+
__assign$8 = Object.assign || function(t) {
|
|
36445
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
36446
|
+
s = arguments[i];
|
|
36447
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
36448
|
+
t[p] = s[p];
|
|
36449
|
+
}
|
|
36450
|
+
return t;
|
|
36451
|
+
};
|
|
36452
|
+
return __assign$8.apply(this, arguments);
|
|
36453
|
+
};
|
|
36454
|
+
var MinuteMark = memo$1(function MinuteMark(props) {
|
|
36455
|
+
return React__default.createElement(Mark, __assign$8({}, props));
|
|
36456
|
+
});
|
|
36457
|
+
|
|
36458
|
+
/**
|
|
36459
|
+
* lodash (Custom Build) <https://lodash.com/>
|
|
36460
|
+
* Build: `lodash modularize exports="npm" -o ./`
|
|
36461
|
+
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
|
36462
|
+
* Released under MIT license <https://lodash.com/license>
|
|
36463
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
36464
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
36465
|
+
*/
|
|
36466
|
+
|
|
36467
|
+
/** Used as the `TypeError` message for "Functions" methods. */
|
|
36468
|
+
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
36469
|
+
|
|
36470
|
+
/** Used to stand-in for `undefined` hash values. */
|
|
36471
|
+
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
36472
|
+
|
|
36473
|
+
/** `Object#toString` result references. */
|
|
36474
|
+
var funcTag = '[object Function]',
|
|
36475
|
+
genTag = '[object GeneratorFunction]';
|
|
36476
|
+
|
|
36477
|
+
/**
|
|
36478
|
+
* Used to match `RegExp`
|
|
36479
|
+
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
36480
|
+
*/
|
|
36481
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
36482
|
+
|
|
36483
|
+
/** Used to detect host constructors (Safari). */
|
|
36484
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
36485
|
+
|
|
36486
|
+
/** Detect free variable `global` from Node.js. */
|
|
36487
|
+
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
36488
|
+
|
|
36489
|
+
/** Detect free variable `self`. */
|
|
36490
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
36491
|
+
|
|
36492
|
+
/** Used as a reference to the global object. */
|
|
36493
|
+
var root = freeGlobal || freeSelf || Function('return this')();
|
|
36494
|
+
|
|
36495
|
+
/**
|
|
36496
|
+
* Gets the value at `key` of `object`.
|
|
36497
|
+
*
|
|
36498
|
+
* @private
|
|
36499
|
+
* @param {Object} [object] The object to query.
|
|
36500
|
+
* @param {string} key The key of the property to get.
|
|
36501
|
+
* @returns {*} Returns the property value.
|
|
36502
|
+
*/
|
|
36503
|
+
function getValue(object, key) {
|
|
36504
|
+
return object == null ? undefined : object[key];
|
|
36505
|
+
}
|
|
36506
|
+
|
|
36507
|
+
/**
|
|
36508
|
+
* Checks if `value` is a host object in IE < 9.
|
|
36509
|
+
*
|
|
36510
|
+
* @private
|
|
36511
|
+
* @param {*} value The value to check.
|
|
36512
|
+
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
|
|
36513
|
+
*/
|
|
36514
|
+
function isHostObject(value) {
|
|
36515
|
+
// Many host objects are `Object` objects that can coerce to strings
|
|
36516
|
+
// despite having improperly defined `toString` methods.
|
|
36517
|
+
var result = false;
|
|
36518
|
+
if (value != null && typeof value.toString != 'function') {
|
|
36519
|
+
try {
|
|
36520
|
+
result = !!(value + '');
|
|
36521
|
+
} catch (e) {}
|
|
36522
|
+
}
|
|
36523
|
+
return result;
|
|
36524
|
+
}
|
|
36525
|
+
|
|
36526
|
+
/** Used for built-in method references. */
|
|
36527
|
+
var arrayProto = Array.prototype,
|
|
36528
|
+
funcProto = Function.prototype,
|
|
36529
|
+
objectProto = Object.prototype;
|
|
36530
|
+
|
|
36531
|
+
/** Used to detect overreaching core-js shims. */
|
|
36532
|
+
var coreJsData = root['__core-js_shared__'];
|
|
36533
|
+
|
|
36534
|
+
/** Used to detect methods masquerading as native. */
|
|
36535
|
+
var maskSrcKey = (function() {
|
|
36536
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
|
36537
|
+
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
36538
|
+
}());
|
|
36539
|
+
|
|
36540
|
+
/** Used to resolve the decompiled source of functions. */
|
|
36541
|
+
var funcToString = funcProto.toString;
|
|
36542
|
+
|
|
36543
|
+
/** Used to check objects for own properties. */
|
|
36544
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
36545
|
+
|
|
36546
|
+
/**
|
|
36547
|
+
* Used to resolve the
|
|
36548
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
36549
|
+
* of values.
|
|
36550
|
+
*/
|
|
36551
|
+
var objectToString = objectProto.toString;
|
|
36552
|
+
|
|
36553
|
+
/** Used to detect if a method is native. */
|
|
36554
|
+
var reIsNative = RegExp('^' +
|
|
36555
|
+
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
|
|
36556
|
+
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
36557
|
+
);
|
|
36558
|
+
|
|
36559
|
+
/** Built-in value references. */
|
|
36560
|
+
var splice = arrayProto.splice;
|
|
36561
|
+
|
|
36562
|
+
/* Built-in method references that are verified to be native. */
|
|
36563
|
+
var Map$1 = getNative(root, 'Map'),
|
|
36564
|
+
nativeCreate = getNative(Object, 'create');
|
|
36565
|
+
|
|
36566
|
+
/**
|
|
36567
|
+
* Creates a hash object.
|
|
36568
|
+
*
|
|
36569
|
+
* @private
|
|
36570
|
+
* @constructor
|
|
36571
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
36572
|
+
*/
|
|
36573
|
+
function Hash(entries) {
|
|
36574
|
+
var index = -1,
|
|
36575
|
+
length = entries ? entries.length : 0;
|
|
36576
|
+
|
|
36577
|
+
this.clear();
|
|
36578
|
+
while (++index < length) {
|
|
36579
|
+
var entry = entries[index];
|
|
36580
|
+
this.set(entry[0], entry[1]);
|
|
36581
|
+
}
|
|
36582
|
+
}
|
|
36583
|
+
|
|
36584
|
+
/**
|
|
36585
|
+
* Removes all key-value entries from the hash.
|
|
36586
|
+
*
|
|
36587
|
+
* @private
|
|
36588
|
+
* @name clear
|
|
36589
|
+
* @memberOf Hash
|
|
36590
|
+
*/
|
|
36591
|
+
function hashClear() {
|
|
36592
|
+
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
36593
|
+
}
|
|
36594
|
+
|
|
36595
|
+
/**
|
|
36596
|
+
* Removes `key` and its value from the hash.
|
|
36597
|
+
*
|
|
36598
|
+
* @private
|
|
36599
|
+
* @name delete
|
|
36600
|
+
* @memberOf Hash
|
|
36601
|
+
* @param {Object} hash The hash to modify.
|
|
36602
|
+
* @param {string} key The key of the value to remove.
|
|
36603
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
36604
|
+
*/
|
|
36605
|
+
function hashDelete(key) {
|
|
36606
|
+
return this.has(key) && delete this.__data__[key];
|
|
36607
|
+
}
|
|
36608
|
+
|
|
36609
|
+
/**
|
|
36610
|
+
* Gets the hash value for `key`.
|
|
36611
|
+
*
|
|
36612
|
+
* @private
|
|
36613
|
+
* @name get
|
|
36614
|
+
* @memberOf Hash
|
|
36615
|
+
* @param {string} key The key of the value to get.
|
|
36616
|
+
* @returns {*} Returns the entry value.
|
|
36617
|
+
*/
|
|
36618
|
+
function hashGet(key) {
|
|
36619
|
+
var data = this.__data__;
|
|
36620
|
+
if (nativeCreate) {
|
|
36621
|
+
var result = data[key];
|
|
36622
|
+
return result === HASH_UNDEFINED ? undefined : result;
|
|
36623
|
+
}
|
|
36624
|
+
return hasOwnProperty.call(data, key) ? data[key] : undefined;
|
|
36625
|
+
}
|
|
36626
|
+
|
|
36627
|
+
/**
|
|
36628
|
+
* Checks if a hash value for `key` exists.
|
|
36629
|
+
*
|
|
36630
|
+
* @private
|
|
36631
|
+
* @name has
|
|
36632
|
+
* @memberOf Hash
|
|
36633
|
+
* @param {string} key The key of the entry to check.
|
|
36634
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
36635
|
+
*/
|
|
36636
|
+
function hashHas(key) {
|
|
36637
|
+
var data = this.__data__;
|
|
36638
|
+
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
|
|
36639
|
+
}
|
|
36640
|
+
|
|
36641
|
+
/**
|
|
36642
|
+
* Sets the hash `key` to `value`.
|
|
36643
|
+
*
|
|
36644
|
+
* @private
|
|
36645
|
+
* @name set
|
|
36646
|
+
* @memberOf Hash
|
|
36647
|
+
* @param {string} key The key of the value to set.
|
|
36648
|
+
* @param {*} value The value to set.
|
|
36649
|
+
* @returns {Object} Returns the hash instance.
|
|
36650
|
+
*/
|
|
36651
|
+
function hashSet(key, value) {
|
|
36652
|
+
var data = this.__data__;
|
|
36653
|
+
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
36654
|
+
return this;
|
|
36655
|
+
}
|
|
36656
|
+
|
|
36657
|
+
// Add methods to `Hash`.
|
|
36658
|
+
Hash.prototype.clear = hashClear;
|
|
36659
|
+
Hash.prototype['delete'] = hashDelete;
|
|
36660
|
+
Hash.prototype.get = hashGet;
|
|
36661
|
+
Hash.prototype.has = hashHas;
|
|
36662
|
+
Hash.prototype.set = hashSet;
|
|
36663
|
+
|
|
36664
|
+
/**
|
|
36665
|
+
* Creates an list cache object.
|
|
36666
|
+
*
|
|
36667
|
+
* @private
|
|
36668
|
+
* @constructor
|
|
36669
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
36670
|
+
*/
|
|
36671
|
+
function ListCache(entries) {
|
|
36672
|
+
var index = -1,
|
|
36673
|
+
length = entries ? entries.length : 0;
|
|
36674
|
+
|
|
36675
|
+
this.clear();
|
|
36676
|
+
while (++index < length) {
|
|
36677
|
+
var entry = entries[index];
|
|
36678
|
+
this.set(entry[0], entry[1]);
|
|
36679
|
+
}
|
|
36680
|
+
}
|
|
36681
|
+
|
|
36682
|
+
/**
|
|
36683
|
+
* Removes all key-value entries from the list cache.
|
|
36684
|
+
*
|
|
36685
|
+
* @private
|
|
36686
|
+
* @name clear
|
|
36687
|
+
* @memberOf ListCache
|
|
36688
|
+
*/
|
|
36689
|
+
function listCacheClear() {
|
|
36690
|
+
this.__data__ = [];
|
|
36691
|
+
}
|
|
36692
|
+
|
|
36693
|
+
/**
|
|
36694
|
+
* Removes `key` and its value from the list cache.
|
|
36695
|
+
*
|
|
36696
|
+
* @private
|
|
36697
|
+
* @name delete
|
|
36698
|
+
* @memberOf ListCache
|
|
36699
|
+
* @param {string} key The key of the value to remove.
|
|
36700
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
36701
|
+
*/
|
|
36702
|
+
function listCacheDelete(key) {
|
|
36703
|
+
var data = this.__data__,
|
|
36704
|
+
index = assocIndexOf(data, key);
|
|
36705
|
+
|
|
36706
|
+
if (index < 0) {
|
|
36707
|
+
return false;
|
|
36708
|
+
}
|
|
36709
|
+
var lastIndex = data.length - 1;
|
|
36710
|
+
if (index == lastIndex) {
|
|
36711
|
+
data.pop();
|
|
36712
|
+
} else {
|
|
36713
|
+
splice.call(data, index, 1);
|
|
36714
|
+
}
|
|
36715
|
+
return true;
|
|
36716
|
+
}
|
|
36717
|
+
|
|
36718
|
+
/**
|
|
36719
|
+
* Gets the list cache value for `key`.
|
|
36720
|
+
*
|
|
36721
|
+
* @private
|
|
36722
|
+
* @name get
|
|
36723
|
+
* @memberOf ListCache
|
|
36724
|
+
* @param {string} key The key of the value to get.
|
|
36725
|
+
* @returns {*} Returns the entry value.
|
|
36726
|
+
*/
|
|
36727
|
+
function listCacheGet(key) {
|
|
36728
|
+
var data = this.__data__,
|
|
36729
|
+
index = assocIndexOf(data, key);
|
|
36730
|
+
|
|
36731
|
+
return index < 0 ? undefined : data[index][1];
|
|
36732
|
+
}
|
|
36733
|
+
|
|
36734
|
+
/**
|
|
36735
|
+
* Checks if a list cache value for `key` exists.
|
|
36736
|
+
*
|
|
36737
|
+
* @private
|
|
36738
|
+
* @name has
|
|
36739
|
+
* @memberOf ListCache
|
|
36740
|
+
* @param {string} key The key of the entry to check.
|
|
36741
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
36742
|
+
*/
|
|
36743
|
+
function listCacheHas(key) {
|
|
36744
|
+
return assocIndexOf(this.__data__, key) > -1;
|
|
36745
|
+
}
|
|
36746
|
+
|
|
36747
|
+
/**
|
|
36748
|
+
* Sets the list cache `key` to `value`.
|
|
36749
|
+
*
|
|
36750
|
+
* @private
|
|
36751
|
+
* @name set
|
|
36752
|
+
* @memberOf ListCache
|
|
36753
|
+
* @param {string} key The key of the value to set.
|
|
36754
|
+
* @param {*} value The value to set.
|
|
36755
|
+
* @returns {Object} Returns the list cache instance.
|
|
36756
|
+
*/
|
|
36757
|
+
function listCacheSet(key, value) {
|
|
36758
|
+
var data = this.__data__,
|
|
36759
|
+
index = assocIndexOf(data, key);
|
|
36760
|
+
|
|
36761
|
+
if (index < 0) {
|
|
36762
|
+
data.push([key, value]);
|
|
36763
|
+
} else {
|
|
36764
|
+
data[index][1] = value;
|
|
36765
|
+
}
|
|
36766
|
+
return this;
|
|
36767
|
+
}
|
|
36768
|
+
|
|
36769
|
+
// Add methods to `ListCache`.
|
|
36770
|
+
ListCache.prototype.clear = listCacheClear;
|
|
36771
|
+
ListCache.prototype['delete'] = listCacheDelete;
|
|
36772
|
+
ListCache.prototype.get = listCacheGet;
|
|
36773
|
+
ListCache.prototype.has = listCacheHas;
|
|
36774
|
+
ListCache.prototype.set = listCacheSet;
|
|
36775
|
+
|
|
36776
|
+
/**
|
|
36777
|
+
* Creates a map cache object to store key-value pairs.
|
|
36778
|
+
*
|
|
36779
|
+
* @private
|
|
36780
|
+
* @constructor
|
|
36781
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
36782
|
+
*/
|
|
36783
|
+
function MapCache(entries) {
|
|
36784
|
+
var index = -1,
|
|
36785
|
+
length = entries ? entries.length : 0;
|
|
36786
|
+
|
|
36787
|
+
this.clear();
|
|
36788
|
+
while (++index < length) {
|
|
36789
|
+
var entry = entries[index];
|
|
36790
|
+
this.set(entry[0], entry[1]);
|
|
36791
|
+
}
|
|
36792
|
+
}
|
|
36793
|
+
|
|
36794
|
+
/**
|
|
36795
|
+
* Removes all key-value entries from the map.
|
|
36796
|
+
*
|
|
36797
|
+
* @private
|
|
36798
|
+
* @name clear
|
|
36799
|
+
* @memberOf MapCache
|
|
36800
|
+
*/
|
|
36801
|
+
function mapCacheClear() {
|
|
36802
|
+
this.__data__ = {
|
|
36803
|
+
'hash': new Hash,
|
|
36804
|
+
'map': new (Map$1 || ListCache),
|
|
36805
|
+
'string': new Hash
|
|
36806
|
+
};
|
|
36807
|
+
}
|
|
36808
|
+
|
|
36809
|
+
/**
|
|
36810
|
+
* Removes `key` and its value from the map.
|
|
36811
|
+
*
|
|
36812
|
+
* @private
|
|
36813
|
+
* @name delete
|
|
36814
|
+
* @memberOf MapCache
|
|
36815
|
+
* @param {string} key The key of the value to remove.
|
|
36816
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
36817
|
+
*/
|
|
36818
|
+
function mapCacheDelete(key) {
|
|
36819
|
+
return getMapData(this, key)['delete'](key);
|
|
36820
|
+
}
|
|
36821
|
+
|
|
36822
|
+
/**
|
|
36823
|
+
* Gets the map value for `key`.
|
|
36824
|
+
*
|
|
36825
|
+
* @private
|
|
36826
|
+
* @name get
|
|
36827
|
+
* @memberOf MapCache
|
|
36828
|
+
* @param {string} key The key of the value to get.
|
|
36829
|
+
* @returns {*} Returns the entry value.
|
|
36830
|
+
*/
|
|
36831
|
+
function mapCacheGet(key) {
|
|
36832
|
+
return getMapData(this, key).get(key);
|
|
36833
|
+
}
|
|
36834
|
+
|
|
36835
|
+
/**
|
|
36836
|
+
* Checks if a map value for `key` exists.
|
|
36837
|
+
*
|
|
36838
|
+
* @private
|
|
36839
|
+
* @name has
|
|
36840
|
+
* @memberOf MapCache
|
|
36841
|
+
* @param {string} key The key of the entry to check.
|
|
36842
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
36843
|
+
*/
|
|
36844
|
+
function mapCacheHas(key) {
|
|
36845
|
+
return getMapData(this, key).has(key);
|
|
36846
|
+
}
|
|
36847
|
+
|
|
36848
|
+
/**
|
|
36849
|
+
* Sets the map `key` to `value`.
|
|
36850
|
+
*
|
|
36851
|
+
* @private
|
|
36852
|
+
* @name set
|
|
36853
|
+
* @memberOf MapCache
|
|
36854
|
+
* @param {string} key The key of the value to set.
|
|
36855
|
+
* @param {*} value The value to set.
|
|
36856
|
+
* @returns {Object} Returns the map cache instance.
|
|
36857
|
+
*/
|
|
36858
|
+
function mapCacheSet(key, value) {
|
|
36859
|
+
getMapData(this, key).set(key, value);
|
|
36860
|
+
return this;
|
|
36861
|
+
}
|
|
36862
|
+
|
|
36863
|
+
// Add methods to `MapCache`.
|
|
36864
|
+
MapCache.prototype.clear = mapCacheClear;
|
|
36865
|
+
MapCache.prototype['delete'] = mapCacheDelete;
|
|
36866
|
+
MapCache.prototype.get = mapCacheGet;
|
|
36867
|
+
MapCache.prototype.has = mapCacheHas;
|
|
36868
|
+
MapCache.prototype.set = mapCacheSet;
|
|
36869
|
+
|
|
36870
|
+
/**
|
|
36871
|
+
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
36872
|
+
*
|
|
36873
|
+
* @private
|
|
36874
|
+
* @param {Array} array The array to inspect.
|
|
36875
|
+
* @param {*} key The key to search for.
|
|
36876
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
36877
|
+
*/
|
|
36878
|
+
function assocIndexOf(array, key) {
|
|
36879
|
+
var length = array.length;
|
|
36880
|
+
while (length--) {
|
|
36881
|
+
if (eq(array[length][0], key)) {
|
|
36882
|
+
return length;
|
|
36883
|
+
}
|
|
36884
|
+
}
|
|
36885
|
+
return -1;
|
|
36886
|
+
}
|
|
36887
|
+
|
|
36888
|
+
/**
|
|
36889
|
+
* The base implementation of `_.isNative` without bad shim checks.
|
|
36890
|
+
*
|
|
36891
|
+
* @private
|
|
36892
|
+
* @param {*} value The value to check.
|
|
36893
|
+
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
36894
|
+
* else `false`.
|
|
36895
|
+
*/
|
|
36896
|
+
function baseIsNative(value) {
|
|
36897
|
+
if (!isObject$1(value) || isMasked(value)) {
|
|
36898
|
+
return false;
|
|
36899
|
+
}
|
|
36900
|
+
var pattern = (isFunction$1(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
|
|
36901
|
+
return pattern.test(toSource(value));
|
|
36902
|
+
}
|
|
36903
|
+
|
|
36904
|
+
/**
|
|
36905
|
+
* Gets the data for `map`.
|
|
36906
|
+
*
|
|
36907
|
+
* @private
|
|
36908
|
+
* @param {Object} map The map to query.
|
|
36909
|
+
* @param {string} key The reference key.
|
|
36910
|
+
* @returns {*} Returns the map data.
|
|
36911
|
+
*/
|
|
36912
|
+
function getMapData(map, key) {
|
|
36913
|
+
var data = map.__data__;
|
|
36914
|
+
return isKeyable(key)
|
|
36915
|
+
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
36916
|
+
: data.map;
|
|
36917
|
+
}
|
|
36918
|
+
|
|
36919
|
+
/**
|
|
36920
|
+
* Gets the native function at `key` of `object`.
|
|
36921
|
+
*
|
|
36922
|
+
* @private
|
|
36923
|
+
* @param {Object} object The object to query.
|
|
36924
|
+
* @param {string} key The key of the method to get.
|
|
36925
|
+
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
36926
|
+
*/
|
|
36927
|
+
function getNative(object, key) {
|
|
36928
|
+
var value = getValue(object, key);
|
|
36929
|
+
return baseIsNative(value) ? value : undefined;
|
|
36930
|
+
}
|
|
36931
|
+
|
|
36932
|
+
/**
|
|
36933
|
+
* Checks if `value` is suitable for use as unique object key.
|
|
36934
|
+
*
|
|
36935
|
+
* @private
|
|
36936
|
+
* @param {*} value The value to check.
|
|
36937
|
+
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
36938
|
+
*/
|
|
36939
|
+
function isKeyable(value) {
|
|
36940
|
+
var type = typeof value;
|
|
36941
|
+
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
36942
|
+
? (value !== '__proto__')
|
|
36943
|
+
: (value === null);
|
|
36944
|
+
}
|
|
36945
|
+
|
|
36946
|
+
/**
|
|
36947
|
+
* Checks if `func` has its source masked.
|
|
36948
|
+
*
|
|
36949
|
+
* @private
|
|
36950
|
+
* @param {Function} func The function to check.
|
|
36951
|
+
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
36952
|
+
*/
|
|
36953
|
+
function isMasked(func) {
|
|
36954
|
+
return !!maskSrcKey && (maskSrcKey in func);
|
|
36955
|
+
}
|
|
36956
|
+
|
|
36957
|
+
/**
|
|
36958
|
+
* Converts `func` to its source code.
|
|
36959
|
+
*
|
|
36960
|
+
* @private
|
|
36961
|
+
* @param {Function} func The function to process.
|
|
36962
|
+
* @returns {string} Returns the source code.
|
|
36963
|
+
*/
|
|
36964
|
+
function toSource(func) {
|
|
36965
|
+
if (func != null) {
|
|
36966
|
+
try {
|
|
36967
|
+
return funcToString.call(func);
|
|
36968
|
+
} catch (e) {}
|
|
36969
|
+
try {
|
|
36970
|
+
return (func + '');
|
|
36971
|
+
} catch (e) {}
|
|
36972
|
+
}
|
|
36973
|
+
return '';
|
|
36974
|
+
}
|
|
36975
|
+
|
|
36976
|
+
/**
|
|
36977
|
+
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
36978
|
+
* provided, it determines the cache key for storing the result based on the
|
|
36979
|
+
* arguments provided to the memoized function. By default, the first argument
|
|
36980
|
+
* provided to the memoized function is used as the map cache key. The `func`
|
|
36981
|
+
* is invoked with the `this` binding of the memoized function.
|
|
36982
|
+
*
|
|
36983
|
+
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
36984
|
+
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
36985
|
+
* constructor with one whose instances implement the
|
|
36986
|
+
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
36987
|
+
* method interface of `delete`, `get`, `has`, and `set`.
|
|
36988
|
+
*
|
|
36989
|
+
* @static
|
|
36990
|
+
* @memberOf _
|
|
36991
|
+
* @since 0.1.0
|
|
36992
|
+
* @category Function
|
|
36993
|
+
* @param {Function} func The function to have its output memoized.
|
|
36994
|
+
* @param {Function} [resolver] The function to resolve the cache key.
|
|
36995
|
+
* @returns {Function} Returns the new memoized function.
|
|
36996
|
+
* @example
|
|
36997
|
+
*
|
|
36998
|
+
* var object = { 'a': 1, 'b': 2 };
|
|
36999
|
+
* var other = { 'c': 3, 'd': 4 };
|
|
37000
|
+
*
|
|
37001
|
+
* var values = _.memoize(_.values);
|
|
37002
|
+
* values(object);
|
|
37003
|
+
* // => [1, 2]
|
|
37004
|
+
*
|
|
37005
|
+
* values(other);
|
|
37006
|
+
* // => [3, 4]
|
|
37007
|
+
*
|
|
37008
|
+
* object.a = 2;
|
|
37009
|
+
* values(object);
|
|
37010
|
+
* // => [1, 2]
|
|
37011
|
+
*
|
|
37012
|
+
* // Modify the result cache.
|
|
37013
|
+
* values.cache.set(object, ['a', 'b']);
|
|
37014
|
+
* values(object);
|
|
37015
|
+
* // => ['a', 'b']
|
|
37016
|
+
*
|
|
37017
|
+
* // Replace `_.memoize.Cache`.
|
|
37018
|
+
* _.memoize.Cache = WeakMap;
|
|
37019
|
+
*/
|
|
37020
|
+
function memoize(func, resolver) {
|
|
37021
|
+
if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
|
|
37022
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
37023
|
+
}
|
|
37024
|
+
var memoized = function() {
|
|
37025
|
+
var args = arguments,
|
|
37026
|
+
key = resolver ? resolver.apply(this, args) : args[0],
|
|
37027
|
+
cache = memoized.cache;
|
|
37028
|
+
|
|
37029
|
+
if (cache.has(key)) {
|
|
37030
|
+
return cache.get(key);
|
|
37031
|
+
}
|
|
37032
|
+
var result = func.apply(this, args);
|
|
37033
|
+
memoized.cache = cache.set(key, result);
|
|
37034
|
+
return result;
|
|
37035
|
+
};
|
|
37036
|
+
memoized.cache = new (memoize.Cache || MapCache);
|
|
37037
|
+
return memoized;
|
|
37038
|
+
}
|
|
37039
|
+
|
|
37040
|
+
// Assign cache to `_.memoize`.
|
|
37041
|
+
memoize.Cache = MapCache;
|
|
37042
|
+
|
|
37043
|
+
/**
|
|
37044
|
+
* Performs a
|
|
37045
|
+
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
37046
|
+
* comparison between two values to determine if they are equivalent.
|
|
37047
|
+
*
|
|
37048
|
+
* @static
|
|
37049
|
+
* @memberOf _
|
|
37050
|
+
* @since 4.0.0
|
|
37051
|
+
* @category Lang
|
|
37052
|
+
* @param {*} value The value to compare.
|
|
37053
|
+
* @param {*} other The other value to compare.
|
|
37054
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
37055
|
+
* @example
|
|
37056
|
+
*
|
|
37057
|
+
* var object = { 'a': 1 };
|
|
37058
|
+
* var other = { 'a': 1 };
|
|
37059
|
+
*
|
|
37060
|
+
* _.eq(object, object);
|
|
37061
|
+
* // => true
|
|
37062
|
+
*
|
|
37063
|
+
* _.eq(object, other);
|
|
37064
|
+
* // => false
|
|
37065
|
+
*
|
|
37066
|
+
* _.eq('a', 'a');
|
|
37067
|
+
* // => true
|
|
37068
|
+
*
|
|
37069
|
+
* _.eq('a', Object('a'));
|
|
37070
|
+
* // => false
|
|
37071
|
+
*
|
|
37072
|
+
* _.eq(NaN, NaN);
|
|
37073
|
+
* // => true
|
|
37074
|
+
*/
|
|
37075
|
+
function eq(value, other) {
|
|
37076
|
+
return value === other || (value !== value && other !== other);
|
|
37077
|
+
}
|
|
37078
|
+
|
|
37079
|
+
/**
|
|
37080
|
+
* Checks if `value` is classified as a `Function` object.
|
|
37081
|
+
*
|
|
37082
|
+
* @static
|
|
37083
|
+
* @memberOf _
|
|
37084
|
+
* @since 0.1.0
|
|
37085
|
+
* @category Lang
|
|
37086
|
+
* @param {*} value The value to check.
|
|
37087
|
+
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
37088
|
+
* @example
|
|
37089
|
+
*
|
|
37090
|
+
* _.isFunction(_);
|
|
37091
|
+
* // => true
|
|
37092
|
+
*
|
|
37093
|
+
* _.isFunction(/abc/);
|
|
37094
|
+
* // => false
|
|
37095
|
+
*/
|
|
37096
|
+
function isFunction$1(value) {
|
|
37097
|
+
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
37098
|
+
// in Safari 8-9 which returns 'object' for typed array and other constructors.
|
|
37099
|
+
var tag = isObject$1(value) ? objectToString.call(value) : '';
|
|
37100
|
+
return tag == funcTag || tag == genTag;
|
|
37101
|
+
}
|
|
37102
|
+
|
|
37103
|
+
/**
|
|
37104
|
+
* Checks if `value` is the
|
|
37105
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
37106
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
37107
|
+
*
|
|
37108
|
+
* @static
|
|
37109
|
+
* @memberOf _
|
|
37110
|
+
* @since 0.1.0
|
|
37111
|
+
* @category Lang
|
|
37112
|
+
* @param {*} value The value to check.
|
|
37113
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
37114
|
+
* @example
|
|
37115
|
+
*
|
|
37116
|
+
* _.isObject({});
|
|
37117
|
+
* // => true
|
|
37118
|
+
*
|
|
37119
|
+
* _.isObject([1, 2, 3]);
|
|
37120
|
+
* // => true
|
|
37121
|
+
*
|
|
37122
|
+
* _.isObject(_.noop);
|
|
37123
|
+
* // => true
|
|
37124
|
+
*
|
|
37125
|
+
* _.isObject(null);
|
|
37126
|
+
* // => false
|
|
37127
|
+
*/
|
|
37128
|
+
function isObject$1(value) {
|
|
37129
|
+
var type = typeof value;
|
|
37130
|
+
return !!value && (type == 'object' || type == 'function');
|
|
37131
|
+
}
|
|
37132
|
+
|
|
37133
|
+
var lodash_memoize = memoize;
|
|
37134
|
+
|
|
37135
|
+
function resolver(options) {
|
|
37136
|
+
return JSON.stringify(options);
|
|
37137
|
+
}
|
|
37138
|
+
function isString$2(el) {
|
|
37139
|
+
return typeof el === 'string';
|
|
37140
|
+
}
|
|
37141
|
+
function isUnique(el, index, arr) {
|
|
37142
|
+
return arr.indexOf(el) === index;
|
|
37143
|
+
}
|
|
37144
|
+
function isAllLowerCase(el) {
|
|
37145
|
+
return el.toLowerCase() === el;
|
|
37146
|
+
}
|
|
37147
|
+
function fixCommas(el) {
|
|
37148
|
+
return el.indexOf(',') === -1 ? el : el.split(',');
|
|
37149
|
+
}
|
|
37150
|
+
function normalizeLocale(locale) {
|
|
37151
|
+
if (!locale) {
|
|
37152
|
+
return locale;
|
|
37153
|
+
}
|
|
37154
|
+
if (locale === 'C' || locale === 'posix' || locale === 'POSIX') {
|
|
37155
|
+
return 'en-US';
|
|
37156
|
+
}
|
|
37157
|
+
// 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
|
|
37158
|
+
if (locale.indexOf('.') !== -1) {
|
|
37159
|
+
var _a = locale.split('.')[0], actualLocale = _a === void 0 ? '' : _a;
|
|
37160
|
+
return normalizeLocale(actualLocale);
|
|
37161
|
+
}
|
|
37162
|
+
// 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
|
|
37163
|
+
if (locale.indexOf('@') !== -1) {
|
|
37164
|
+
var _b = locale.split('@')[0], actualLocale = _b === void 0 ? '' : _b;
|
|
37165
|
+
return normalizeLocale(actualLocale);
|
|
37166
|
+
}
|
|
37167
|
+
// 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
|
|
37168
|
+
if (locale.indexOf('-') === -1 || !isAllLowerCase(locale)) {
|
|
37169
|
+
return locale;
|
|
37170
|
+
}
|
|
37171
|
+
var _c = locale.split('-'), splitEl1 = _c[0], _d = _c[1], splitEl2 = _d === void 0 ? '' : _d;
|
|
37172
|
+
return "".concat(splitEl1, "-").concat(splitEl2.toUpperCase());
|
|
37173
|
+
}
|
|
37174
|
+
function getUserLocalesInternal(_a) {
|
|
37175
|
+
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;
|
|
37176
|
+
var languageList = [];
|
|
37177
|
+
if (typeof navigator !== 'undefined') {
|
|
37178
|
+
var rawLanguages = navigator.languages || [];
|
|
37179
|
+
var languages = [];
|
|
37180
|
+
for (var _i = 0, rawLanguages_1 = rawLanguages; _i < rawLanguages_1.length; _i++) {
|
|
37181
|
+
var rawLanguagesItem = rawLanguages_1[_i];
|
|
37182
|
+
languages = languages.concat(fixCommas(rawLanguagesItem));
|
|
37183
|
+
}
|
|
37184
|
+
var rawLanguage = navigator.language;
|
|
37185
|
+
var language = rawLanguage ? fixCommas(rawLanguage) : rawLanguage;
|
|
37186
|
+
languageList = languageList.concat(languages, language);
|
|
37187
|
+
}
|
|
37188
|
+
if (useFallbackLocale) {
|
|
37189
|
+
languageList.push(fallbackLocale);
|
|
37190
|
+
}
|
|
37191
|
+
return languageList.filter(isString$2).map(normalizeLocale).filter(isUnique);
|
|
37192
|
+
}
|
|
37193
|
+
var getUserLocales = lodash_memoize(getUserLocalesInternal, resolver);
|
|
37194
|
+
function getUserLocaleInternal(options) {
|
|
37195
|
+
return getUserLocales(options)[0] || null;
|
|
37196
|
+
}
|
|
37197
|
+
var getUserLocale = lodash_memoize(getUserLocaleInternal, resolver);
|
|
37198
|
+
|
|
37199
|
+
function formatHour(locale, hour) {
|
|
37200
|
+
return hour.toLocaleString(locale || getUserLocale() || undefined);
|
|
37201
|
+
}
|
|
37202
|
+
|
|
37203
|
+
var __assign$7 = (undefined && undefined.__assign) || function () {
|
|
37204
|
+
__assign$7 = Object.assign || function(t) {
|
|
37205
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
37206
|
+
s = arguments[i];
|
|
37207
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
37208
|
+
t[p] = s[p];
|
|
37209
|
+
}
|
|
37210
|
+
return t;
|
|
37211
|
+
};
|
|
37212
|
+
return __assign$7.apply(this, arguments);
|
|
37213
|
+
};
|
|
37214
|
+
var __rest$6 = (undefined && undefined.__rest) || function (s, e) {
|
|
37215
|
+
var t = {};
|
|
37216
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
37217
|
+
t[p] = s[p];
|
|
37218
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
37219
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
37220
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
37221
|
+
t[p[i]] = s[p[i]];
|
|
37222
|
+
}
|
|
37223
|
+
return t;
|
|
37224
|
+
};
|
|
37225
|
+
var HourMark = memo$1(function HourMark(_a) {
|
|
37226
|
+
var _b = _a.formatHour, formatHour$1 = _b === void 0 ? formatHour : _b, locale = _a.locale, number = _a.number, otherProps = __rest$6(_a, ["formatHour", "locale", "number"]);
|
|
37227
|
+
return React__default.createElement(Mark, __assign$7({ number: number ? formatHour$1(locale, number) : null }, otherProps));
|
|
37228
|
+
});
|
|
37229
|
+
|
|
37230
|
+
function isNumberBetween(min, max) {
|
|
37231
|
+
return function (props, propName, componentName) {
|
|
37232
|
+
var _a = props, _b = propName, value = _a[_b];
|
|
37233
|
+
if (typeof value !== 'undefined') {
|
|
37234
|
+
if (typeof value !== 'number') {
|
|
37235
|
+
return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof value, "` supplied to `").concat(componentName, "`, expected `number`."));
|
|
37236
|
+
}
|
|
37237
|
+
if (value < min || value > max) {
|
|
37238
|
+
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, "."));
|
|
37239
|
+
}
|
|
37240
|
+
}
|
|
37241
|
+
// Everything is fine
|
|
37242
|
+
return null;
|
|
37243
|
+
};
|
|
37244
|
+
}
|
|
37245
|
+
var isHandLength = isNumberBetween(0, 100);
|
|
37246
|
+
var isOppositeHandLength = isNumberBetween(-100, 100);
|
|
37247
|
+
var isHandWidth = function isHandWidth(props, propName, componentName) {
|
|
37248
|
+
var _a = props, _b = propName, width = _a[_b];
|
|
37249
|
+
if (typeof width !== 'undefined') {
|
|
37250
|
+
if (typeof width !== 'number') {
|
|
37251
|
+
return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof width, "` supplied to `").concat(componentName, "`, expected `number`."));
|
|
37252
|
+
}
|
|
37253
|
+
if (width < 0) {
|
|
37254
|
+
return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof width, "` supplied to `").concat(componentName, "`, width must be greater or equal to 0."));
|
|
37255
|
+
}
|
|
37256
|
+
}
|
|
37257
|
+
// Everything is fine
|
|
37258
|
+
return null;
|
|
37259
|
+
};
|
|
37260
|
+
var isMarkLength = isHandLength;
|
|
37261
|
+
var isMarkWidth = isHandWidth;
|
|
37262
|
+
|
|
37263
|
+
var Clock = function Clock(_a) {
|
|
37264
|
+
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;
|
|
37265
|
+
function renderMinuteMarksFn() {
|
|
37266
|
+
if (!renderMinuteMarks) {
|
|
37267
|
+
return null;
|
|
37268
|
+
}
|
|
37269
|
+
var minuteMarks = [];
|
|
37270
|
+
for (var i = 1; i <= 60; i += 1) {
|
|
37271
|
+
var isHourMark = renderHourMarks && !(i % 5);
|
|
37272
|
+
if (!isHourMark) {
|
|
37273
|
+
minuteMarks.push(React__default.createElement(MinuteMark, { key: "minute_".concat(i), angle: i * 6, length: minuteMarksLength, name: "minute", width: minuteMarksWidth }));
|
|
37274
|
+
}
|
|
37275
|
+
}
|
|
37276
|
+
return minuteMarks;
|
|
37277
|
+
}
|
|
37278
|
+
function renderHourMarksFn() {
|
|
37279
|
+
if (!renderHourMarks) {
|
|
37280
|
+
return null;
|
|
37281
|
+
}
|
|
37282
|
+
var hourMarks = [];
|
|
37283
|
+
for (var i = 1; i <= 12; i += 1) {
|
|
37284
|
+
hourMarks.push(React__default.createElement(HourMark, { key: "hour_".concat(i), angle: i * 30, formatHour: formatHour, length: hourMarksLength, locale: locale, name: "hour", number: renderNumbers ? i : undefined, width: hourMarksWidth }));
|
|
37285
|
+
}
|
|
37286
|
+
return hourMarks;
|
|
37287
|
+
}
|
|
37288
|
+
function renderFace() {
|
|
37289
|
+
return (React__default.createElement("div", { className: "react-clock__face" },
|
|
37290
|
+
renderMinuteMarksFn(),
|
|
37291
|
+
renderHourMarksFn()));
|
|
37292
|
+
}
|
|
37293
|
+
function renderHourHandFn() {
|
|
37294
|
+
var angle = value
|
|
37295
|
+
? getHours(value) * 30 +
|
|
37296
|
+
getMinutes(value) / 2 +
|
|
37297
|
+
getSeconds(value) / 120 +
|
|
37298
|
+
(useMillisecondPrecision ? getMilliseconds(value) / 120000 : 0)
|
|
37299
|
+
: 0;
|
|
37300
|
+
return (React__default.createElement(Hand, { angle: angle, length: hourHandLength, name: "hour", oppositeLength: hourHandOppositeLength, width: hourHandWidth }));
|
|
37301
|
+
}
|
|
37302
|
+
function renderMinuteHandFn() {
|
|
37303
|
+
if (!renderMinuteHand) {
|
|
37304
|
+
return null;
|
|
37305
|
+
}
|
|
37306
|
+
var angle = value
|
|
37307
|
+
? getHours(value) * 360 +
|
|
37308
|
+
getMinutes(value) * 6 +
|
|
37309
|
+
getSeconds(value) / 10 +
|
|
37310
|
+
(useMillisecondPrecision ? getMilliseconds(value) / 10000 : 0)
|
|
37311
|
+
: 0;
|
|
37312
|
+
return (React__default.createElement(Hand, { angle: angle, length: minuteHandLength, name: "minute", oppositeLength: minuteHandOppositeLength, width: minuteHandWidth }));
|
|
37313
|
+
}
|
|
37314
|
+
function renderSecondHandFn() {
|
|
37315
|
+
if (!renderSecondHand) {
|
|
37316
|
+
return null;
|
|
37317
|
+
}
|
|
37318
|
+
var angle = value
|
|
37319
|
+
? getMinutes(value) * 360 +
|
|
37320
|
+
getSeconds(value) * 6 +
|
|
37321
|
+
(useMillisecondPrecision ? getMilliseconds(value) * 0.006 : 0)
|
|
37322
|
+
: 0;
|
|
37323
|
+
return (React__default.createElement(Hand, { angle: angle, length: secondHandLength, name: "second", oppositeLength: secondHandOppositeLength, width: secondHandWidth }));
|
|
37324
|
+
}
|
|
37325
|
+
return (React__default.createElement("time", { className: clsx('react-clock', className), dateTime: value instanceof Date ? value.toISOString() : value || undefined, style: {
|
|
37326
|
+
width: size,
|
|
37327
|
+
height: size,
|
|
37328
|
+
} },
|
|
37329
|
+
renderFace(),
|
|
37330
|
+
renderHourHandFn(),
|
|
37331
|
+
renderMinuteHandFn(),
|
|
37332
|
+
renderSecondHandFn()));
|
|
37333
|
+
};
|
|
37334
|
+
Clock.propTypes = {
|
|
37335
|
+
className: propTypes$1.exports.oneOfType([propTypes$1.exports.string, propTypes$1.exports.arrayOf(propTypes$1.exports.string)]),
|
|
37336
|
+
formatHour: propTypes$1.exports.func,
|
|
37337
|
+
hourHandLength: isHandLength,
|
|
37338
|
+
hourHandOppositeLength: isOppositeHandLength,
|
|
37339
|
+
hourHandWidth: isHandWidth,
|
|
37340
|
+
hourMarksLength: isMarkLength,
|
|
37341
|
+
hourMarksWidth: isMarkWidth,
|
|
37342
|
+
locale: propTypes$1.exports.string,
|
|
37343
|
+
minuteHandLength: isHandLength,
|
|
37344
|
+
minuteHandOppositeLength: isOppositeHandLength,
|
|
37345
|
+
minuteHandWidth: isHandWidth,
|
|
37346
|
+
minuteMarksLength: isMarkLength,
|
|
37347
|
+
minuteMarksWidth: isMarkWidth,
|
|
37348
|
+
renderHourMarks: propTypes$1.exports.bool,
|
|
37349
|
+
renderMinuteHand: propTypes$1.exports.bool,
|
|
37350
|
+
renderMinuteMarks: propTypes$1.exports.bool,
|
|
37351
|
+
renderNumbers: propTypes$1.exports.bool,
|
|
37352
|
+
renderSecondHand: propTypes$1.exports.bool,
|
|
37353
|
+
secondHandLength: isHandLength,
|
|
37354
|
+
secondHandOppositeLength: isOppositeHandLength,
|
|
37355
|
+
secondHandWidth: isHandWidth,
|
|
37356
|
+
size: propTypes$1.exports.oneOfType([propTypes$1.exports.number, propTypes$1.exports.string]),
|
|
37357
|
+
value: propTypes$1.exports.oneOfType([propTypes$1.exports.string, propTypes$1.exports.instanceOf(Date)]),
|
|
37358
|
+
};
|
|
37359
|
+
|
|
37360
|
+
function getRect(element) {
|
|
37361
|
+
return element.getBoundingClientRect();
|
|
37362
|
+
}
|
|
37363
|
+
function detectElementOverflow(element, container) {
|
|
37364
|
+
return {
|
|
37365
|
+
get collidedTop() {
|
|
37366
|
+
return getRect(element).top < getRect(container).top;
|
|
37367
|
+
},
|
|
37368
|
+
get collidedBottom() {
|
|
37369
|
+
return getRect(element).bottom > getRect(container).bottom;
|
|
37370
|
+
},
|
|
37371
|
+
get collidedLeft() {
|
|
37372
|
+
return getRect(element).left < getRect(container).left;
|
|
37373
|
+
},
|
|
37374
|
+
get collidedRight() {
|
|
37375
|
+
return getRect(element).right > getRect(container).right;
|
|
37376
|
+
},
|
|
37377
|
+
get overflowTop() {
|
|
37378
|
+
return getRect(container).top - getRect(element).top;
|
|
37379
|
+
},
|
|
37380
|
+
get overflowBottom() {
|
|
37381
|
+
return getRect(element).bottom - getRect(container).bottom;
|
|
37382
|
+
},
|
|
37383
|
+
get overflowLeft() {
|
|
37384
|
+
return getRect(container).left - getRect(element).left;
|
|
37385
|
+
},
|
|
37386
|
+
get overflowRight() {
|
|
37387
|
+
return getRect(element).right - getRect(container).right;
|
|
37388
|
+
},
|
|
37389
|
+
};
|
|
37390
|
+
}
|
|
37391
|
+
|
|
37392
|
+
var __extends = (undefined && undefined.__extends) || (function () {
|
|
37393
|
+
var extendStatics = function (d, b) {
|
|
37394
|
+
extendStatics = Object.setPrototypeOf ||
|
|
37395
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
37396
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
37397
|
+
return extendStatics(d, b);
|
|
37398
|
+
};
|
|
37399
|
+
return function (d, b) {
|
|
37400
|
+
if (typeof b !== "function" && b !== null)
|
|
37401
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
37402
|
+
extendStatics(d, b);
|
|
37403
|
+
function __() { this.constructor = d; }
|
|
37404
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
37405
|
+
};
|
|
37406
|
+
})();
|
|
37407
|
+
var __assign$6 = (undefined && undefined.__assign) || function () {
|
|
37408
|
+
__assign$6 = Object.assign || function(t) {
|
|
37409
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
37410
|
+
s = arguments[i];
|
|
37411
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
37412
|
+
t[p] = s[p];
|
|
37413
|
+
}
|
|
37414
|
+
return t;
|
|
37415
|
+
};
|
|
37416
|
+
return __assign$6.apply(this, arguments);
|
|
37417
|
+
};
|
|
37418
|
+
var __rest$5 = (undefined && undefined.__rest) || function (s, e) {
|
|
37419
|
+
var t = {};
|
|
37420
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
37421
|
+
t[p] = s[p];
|
|
37422
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
37423
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
37424
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
37425
|
+
t[p[i]] = s[p[i]];
|
|
37426
|
+
}
|
|
37427
|
+
return t;
|
|
37428
|
+
};
|
|
37429
|
+
var isBrowser$2 = typeof document !== 'undefined';
|
|
37430
|
+
var isDisplayContentsSupported = isBrowser$2 && 'CSS' in window && 'supports' in window.CSS && CSS.supports('display', 'contents');
|
|
37431
|
+
var isMutationObserverSupported = isBrowser$2 && 'MutationObserver' in window;
|
|
37432
|
+
function capitalize(string) {
|
|
37433
|
+
return (string.charAt(0).toUpperCase() + string.slice(1));
|
|
37434
|
+
}
|
|
37435
|
+
function findScrollContainer(element) {
|
|
37436
|
+
var parent = element.parentElement;
|
|
37437
|
+
while (parent) {
|
|
37438
|
+
var overflow = window.getComputedStyle(parent).overflow;
|
|
37439
|
+
if (overflow.split(' ').every(function (o) { return o === 'auto' || o === 'scroll'; })) {
|
|
37440
|
+
return parent;
|
|
37441
|
+
}
|
|
37442
|
+
parent = parent.parentElement;
|
|
37443
|
+
}
|
|
37444
|
+
return document.documentElement;
|
|
37445
|
+
}
|
|
37446
|
+
function alignAxis(_a) {
|
|
37447
|
+
var axis = _a.axis, container = _a.container, element = _a.element, invertAxis = _a.invertAxis, scrollContainer = _a.scrollContainer, secondary = _a.secondary, spacing = _a.spacing;
|
|
37448
|
+
var style = window.getComputedStyle(element);
|
|
37449
|
+
var parent = container.parentElement;
|
|
37450
|
+
if (!parent) {
|
|
37451
|
+
return;
|
|
37452
|
+
}
|
|
37453
|
+
var scrollContainerCollisions = detectElementOverflow(parent, scrollContainer);
|
|
37454
|
+
var documentCollisions = detectElementOverflow(parent, document.documentElement);
|
|
37455
|
+
var isX = axis === 'x';
|
|
37456
|
+
var startProperty = isX ? 'left' : 'top';
|
|
37457
|
+
var endProperty = isX ? 'right' : 'bottom';
|
|
37458
|
+
var sizeProperty = isX ? 'width' : 'height';
|
|
37459
|
+
var overflowStartProperty = "overflow".concat(capitalize(startProperty));
|
|
37460
|
+
var overflowEndProperty = "overflow".concat(capitalize(endProperty));
|
|
37461
|
+
var scrollProperty = "scroll".concat(capitalize(startProperty));
|
|
37462
|
+
var uppercasedSizeProperty = capitalize(sizeProperty);
|
|
37463
|
+
var offsetSizeProperty = "offset".concat(uppercasedSizeProperty);
|
|
37464
|
+
var clientSizeProperty = "client".concat(uppercasedSizeProperty);
|
|
37465
|
+
var minSizeProperty = "min-".concat(sizeProperty);
|
|
37466
|
+
var scrollbarWidth = scrollContainer[offsetSizeProperty] - scrollContainer[clientSizeProperty];
|
|
37467
|
+
var startSpacing = typeof spacing === 'object' ? spacing[startProperty] : spacing;
|
|
37468
|
+
var availableStartSpace = -Math.max(scrollContainerCollisions[overflowStartProperty], documentCollisions[overflowStartProperty] + document.documentElement[scrollProperty]) - startSpacing;
|
|
37469
|
+
var endSpacing = typeof spacing === 'object' ? spacing[endProperty] : spacing;
|
|
37470
|
+
var availableEndSpace = -Math.max(scrollContainerCollisions[overflowEndProperty], documentCollisions[overflowEndProperty] - document.documentElement[scrollProperty]) -
|
|
37471
|
+
endSpacing -
|
|
37472
|
+
scrollbarWidth;
|
|
37473
|
+
if (secondary) {
|
|
37474
|
+
availableStartSpace += parent[clientSizeProperty];
|
|
37475
|
+
availableEndSpace += parent[clientSizeProperty];
|
|
37476
|
+
}
|
|
37477
|
+
var offsetSize = element[offsetSizeProperty];
|
|
37478
|
+
function displayStart() {
|
|
37479
|
+
element.style[startProperty] = 'auto';
|
|
37480
|
+
element.style[endProperty] = secondary ? '0' : '100%';
|
|
37481
|
+
}
|
|
37482
|
+
function displayEnd() {
|
|
37483
|
+
element.style[startProperty] = secondary ? '0' : '100%';
|
|
37484
|
+
element.style[endProperty] = 'auto';
|
|
37485
|
+
}
|
|
37486
|
+
function displayIfFits(availableSpace, display) {
|
|
37487
|
+
var fits = offsetSize <= availableSpace;
|
|
37488
|
+
if (fits) {
|
|
37489
|
+
display();
|
|
37490
|
+
}
|
|
37491
|
+
return fits;
|
|
37492
|
+
}
|
|
37493
|
+
function displayStartIfFits() {
|
|
37494
|
+
return displayIfFits(availableStartSpace, displayStart);
|
|
37495
|
+
}
|
|
37496
|
+
function displayEndIfFits() {
|
|
37497
|
+
return displayIfFits(availableEndSpace, displayEnd);
|
|
37498
|
+
}
|
|
37499
|
+
function displayWhereverShrinkedFits() {
|
|
37500
|
+
var moreSpaceStart = availableStartSpace > availableEndSpace;
|
|
37501
|
+
var rawMinSize = style.getPropertyValue(minSizeProperty);
|
|
37502
|
+
var minSize = rawMinSize ? parseInt(rawMinSize, 10) : null;
|
|
37503
|
+
function shrinkToSize(size) {
|
|
37504
|
+
var newSize = Math.max(size, minSize || 0);
|
|
37505
|
+
element.style[sizeProperty] = "".concat(newSize, "px");
|
|
37506
|
+
}
|
|
37507
|
+
if (moreSpaceStart) {
|
|
37508
|
+
shrinkToSize(availableStartSpace);
|
|
37509
|
+
displayStart();
|
|
37510
|
+
}
|
|
37511
|
+
else {
|
|
37512
|
+
shrinkToSize(availableEndSpace);
|
|
37513
|
+
displayEnd();
|
|
37514
|
+
}
|
|
37515
|
+
}
|
|
37516
|
+
var fits;
|
|
37517
|
+
if (invertAxis) {
|
|
37518
|
+
fits = displayStartIfFits() || displayEndIfFits();
|
|
37519
|
+
}
|
|
37520
|
+
else {
|
|
37521
|
+
fits = displayEndIfFits() || displayStartIfFits();
|
|
37522
|
+
}
|
|
37523
|
+
if (!fits) {
|
|
37524
|
+
displayWhereverShrinkedFits();
|
|
37525
|
+
}
|
|
37526
|
+
}
|
|
37527
|
+
function alignMainAxis(args) {
|
|
37528
|
+
alignAxis(args);
|
|
37529
|
+
}
|
|
37530
|
+
function alignSecondaryAxis(args) {
|
|
37531
|
+
alignAxis(__assign$6(__assign$6({}, args), { axis: args.axis === 'x' ? 'y' : 'x', secondary: true }));
|
|
37532
|
+
}
|
|
37533
|
+
function alignBothAxis(args) {
|
|
37534
|
+
var invertAxis = args.invertAxis, invertSecondaryAxis = args.invertSecondaryAxis, commonArgs = __rest$5(args, ["invertAxis", "invertSecondaryAxis"]);
|
|
37535
|
+
alignMainAxis(__assign$6(__assign$6({}, commonArgs), { invertAxis: invertAxis }));
|
|
37536
|
+
alignSecondaryAxis(__assign$6(__assign$6({}, commonArgs), { invertAxis: invertSecondaryAxis }));
|
|
37537
|
+
}
|
|
37538
|
+
var Fit = /** @class */ (function (_super) {
|
|
37539
|
+
__extends(Fit, _super);
|
|
37540
|
+
function Fit() {
|
|
37541
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
37542
|
+
_this.fit = function () {
|
|
37543
|
+
var _a = _this, scrollContainer = _a.scrollContainer, container = _a.container, element = _a.element;
|
|
37544
|
+
if (!scrollContainer || !container || !element) {
|
|
37545
|
+
return;
|
|
37546
|
+
}
|
|
37547
|
+
var elementWidth = element.clientWidth;
|
|
37548
|
+
var elementHeight = element.clientHeight;
|
|
37549
|
+
// No need to recalculate - already did that for current dimensions
|
|
37550
|
+
if (_this.elementWidth === elementWidth && _this.elementHeight === elementHeight) {
|
|
37551
|
+
return;
|
|
37552
|
+
}
|
|
37553
|
+
// Save the dimensions so that we know we don't need to repeat the function if unchanged
|
|
37554
|
+
_this.elementWidth = elementWidth;
|
|
37555
|
+
_this.elementHeight = elementHeight;
|
|
37556
|
+
var parent = container.parentElement;
|
|
37557
|
+
// Container was unmounted
|
|
37558
|
+
if (!parent) {
|
|
37559
|
+
return;
|
|
37560
|
+
}
|
|
37561
|
+
/**
|
|
37562
|
+
* We need to ensure that <Fit />'s child has a absolute position. Otherwise,
|
|
37563
|
+
* we wouldn't be able to place the child in the correct position.
|
|
37564
|
+
*/
|
|
37565
|
+
var style = window.getComputedStyle(element);
|
|
37566
|
+
var position = style.position;
|
|
37567
|
+
if (position !== 'absolute') {
|
|
37568
|
+
element.style.position = 'absolute';
|
|
37569
|
+
}
|
|
37570
|
+
/**
|
|
37571
|
+
* We need to ensure that <Fit />'s parent has a relative or absolute position. Otherwise,
|
|
37572
|
+
* we wouldn't be able to place the child in the correct position.
|
|
37573
|
+
*/
|
|
37574
|
+
var parentStyle = window.getComputedStyle(parent);
|
|
37575
|
+
var parentPosition = parentStyle.position;
|
|
37576
|
+
if (parentPosition !== 'relative' && parentPosition !== 'absolute') {
|
|
37577
|
+
parent.style.position = 'relative';
|
|
37578
|
+
}
|
|
37579
|
+
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;
|
|
37580
|
+
alignBothAxis({
|
|
37581
|
+
axis: mainAxis,
|
|
37582
|
+
container: container,
|
|
37583
|
+
element: element,
|
|
37584
|
+
invertAxis: invertAxis,
|
|
37585
|
+
invertSecondaryAxis: invertSecondaryAxis,
|
|
37586
|
+
scrollContainer: scrollContainer,
|
|
37587
|
+
spacing: spacing,
|
|
37588
|
+
});
|
|
37589
|
+
};
|
|
37590
|
+
return _this;
|
|
37591
|
+
}
|
|
37592
|
+
Fit.prototype.componentDidMount = function () {
|
|
37593
|
+
var _this = this;
|
|
37594
|
+
if (!isDisplayContentsSupported) {
|
|
37595
|
+
// eslint-disable-next-line react/no-find-dom-node
|
|
37596
|
+
var element = findDOMNode$1(this);
|
|
37597
|
+
if (!element || !(element instanceof HTMLElement)) {
|
|
37598
|
+
return;
|
|
37599
|
+
}
|
|
37600
|
+
this.container = element;
|
|
37601
|
+
this.element = element;
|
|
37602
|
+
this.scrollContainer = findScrollContainer(element);
|
|
37603
|
+
}
|
|
37604
|
+
this.fit();
|
|
37605
|
+
var onMutation = function () {
|
|
37606
|
+
_this.fit();
|
|
37607
|
+
};
|
|
37608
|
+
if (isMutationObserverSupported && this.element) {
|
|
37609
|
+
var mutationObserver = new MutationObserver(onMutation);
|
|
37610
|
+
mutationObserver.observe(this.element, {
|
|
37611
|
+
attributes: true,
|
|
37612
|
+
attributeFilter: ['class', 'style'],
|
|
37613
|
+
});
|
|
37614
|
+
}
|
|
37615
|
+
};
|
|
37616
|
+
Fit.prototype.render = function () {
|
|
37617
|
+
var _this = this;
|
|
37618
|
+
var children = this.props.children;
|
|
37619
|
+
var child = React__default.Children.only(children);
|
|
37620
|
+
if (isDisplayContentsSupported) {
|
|
37621
|
+
return (React__default.createElement("span", { ref: function (container) {
|
|
37622
|
+
_this.container = container;
|
|
37623
|
+
var element = container && container.firstElementChild;
|
|
37624
|
+
if (!element || !(element instanceof HTMLElement)) {
|
|
37625
|
+
return;
|
|
37626
|
+
}
|
|
37627
|
+
_this.element = element;
|
|
37628
|
+
_this.scrollContainer = findScrollContainer(element);
|
|
37629
|
+
}, style: { display: 'contents' } }, child));
|
|
37630
|
+
}
|
|
37631
|
+
return child;
|
|
37632
|
+
};
|
|
37633
|
+
Fit.propTypes = {
|
|
37634
|
+
children: propTypes$1.exports.node.isRequired,
|
|
37635
|
+
invertAxis: propTypes$1.exports.bool,
|
|
37636
|
+
invertSecondaryAxis: propTypes$1.exports.bool,
|
|
37637
|
+
mainAxis: propTypes$1.exports.oneOf(['x', 'y']),
|
|
37638
|
+
spacing: propTypes$1.exports.oneOfType([
|
|
37639
|
+
propTypes$1.exports.number,
|
|
37640
|
+
propTypes$1.exports.shape({
|
|
37641
|
+
bottom: propTypes$1.exports.number.isRequired,
|
|
37642
|
+
left: propTypes$1.exports.number.isRequired,
|
|
37643
|
+
right: propTypes$1.exports.number.isRequired,
|
|
37644
|
+
top: propTypes$1.exports.number.isRequired,
|
|
37645
|
+
}),
|
|
37646
|
+
]),
|
|
37647
|
+
};
|
|
37648
|
+
return Fit;
|
|
37649
|
+
}(Component));
|
|
37650
|
+
|
|
37651
|
+
function Divider(_a) {
|
|
37652
|
+
var children = _a.children;
|
|
37653
|
+
return React__default.createElement("span", { className: "react-time-picker__inputGroup__divider" }, children);
|
|
37654
|
+
}
|
|
37655
|
+
|
|
37656
|
+
var allowedVariants = ['normal', 'small-caps'];
|
|
37657
|
+
/**
|
|
37658
|
+
* Gets font CSS shorthand property given element.
|
|
37659
|
+
*
|
|
37660
|
+
* @param {HTMLElement} element Element to get font CSS shorthand property from
|
|
37661
|
+
*/
|
|
37662
|
+
function getFontShorthand(element) {
|
|
37663
|
+
if (!element) {
|
|
37664
|
+
return '';
|
|
37665
|
+
}
|
|
37666
|
+
var style = window.getComputedStyle(element);
|
|
37667
|
+
if (style.font) {
|
|
37668
|
+
return style.font;
|
|
37669
|
+
}
|
|
37670
|
+
var isFontDefined = style.fontFamily !== '';
|
|
37671
|
+
if (!isFontDefined) {
|
|
37672
|
+
return '';
|
|
37673
|
+
}
|
|
37674
|
+
var fontVariant = allowedVariants.includes(style.fontVariant) ? style.fontVariant : 'normal';
|
|
37675
|
+
return "".concat(style.fontStyle, " ").concat(fontVariant, " ").concat(style.fontWeight, " ").concat(style.fontSize, " / ").concat(style.lineHeight, " ").concat(style.fontFamily);
|
|
37676
|
+
}
|
|
37677
|
+
var cachedCanvas;
|
|
37678
|
+
/**
|
|
37679
|
+
* Measures text width given text and font CSS shorthand.
|
|
37680
|
+
*
|
|
37681
|
+
* @param {string} text Text to measure
|
|
37682
|
+
* @param {string} font Font to use when measuring the text
|
|
37683
|
+
*/
|
|
37684
|
+
function measureText(text, font) {
|
|
37685
|
+
var canvas = cachedCanvas || (cachedCanvas = document.createElement('canvas'));
|
|
37686
|
+
var context = canvas.getContext('2d');
|
|
37687
|
+
// Context type not supported
|
|
37688
|
+
if (!context) {
|
|
37689
|
+
return null;
|
|
37690
|
+
}
|
|
37691
|
+
context.font = font;
|
|
37692
|
+
var width = context.measureText(text).width;
|
|
37693
|
+
return Math.ceil(width);
|
|
37694
|
+
}
|
|
37695
|
+
/**
|
|
37696
|
+
* Updates input element width to fit its content given input element
|
|
37697
|
+
* @param {HTMLInputElement} element
|
|
37698
|
+
*/
|
|
37699
|
+
function updateInputWidth(element) {
|
|
37700
|
+
if (typeof document === 'undefined' || !element) {
|
|
37701
|
+
return null;
|
|
37702
|
+
}
|
|
37703
|
+
var font = getFontShorthand(element);
|
|
37704
|
+
var text = element.value || element.placeholder;
|
|
37705
|
+
var width = measureText(text, font);
|
|
37706
|
+
if (width === null) {
|
|
37707
|
+
return null;
|
|
37708
|
+
}
|
|
37709
|
+
element.style.width = "".concat(width, "px");
|
|
37710
|
+
return width;
|
|
37711
|
+
}
|
|
37712
|
+
|
|
37713
|
+
var isBrowser$1 = typeof document !== 'undefined';
|
|
37714
|
+
var useIsomorphicLayoutEffect = isBrowser$1 ? useLayoutEffect : useEffect;
|
|
37715
|
+
var isIEOrEdgeLegacy = isBrowser$1 && /(MSIE|Trident\/|Edge\/)/.test(navigator.userAgent);
|
|
37716
|
+
var isFirefox = isBrowser$1 && /Firefox/.test(navigator.userAgent);
|
|
37717
|
+
function onFocus(event) {
|
|
37718
|
+
var target = event.target;
|
|
37719
|
+
if (isIEOrEdgeLegacy) {
|
|
37720
|
+
requestAnimationFrame(function () { return target.select(); });
|
|
37721
|
+
}
|
|
37722
|
+
else {
|
|
37723
|
+
target.select();
|
|
37724
|
+
}
|
|
37725
|
+
}
|
|
37726
|
+
function updateInputWidthOnLoad(element) {
|
|
37727
|
+
if (document.readyState === 'complete') {
|
|
37728
|
+
return;
|
|
37729
|
+
}
|
|
37730
|
+
function onLoad() {
|
|
37731
|
+
updateInputWidth(element);
|
|
37732
|
+
}
|
|
37733
|
+
window.addEventListener('load', onLoad);
|
|
37734
|
+
}
|
|
37735
|
+
function updateInputWidthOnFontLoad(element) {
|
|
37736
|
+
if (!document.fonts) {
|
|
37737
|
+
return;
|
|
37738
|
+
}
|
|
37739
|
+
var font = getFontShorthand(element);
|
|
37740
|
+
if (!font) {
|
|
37741
|
+
return;
|
|
37742
|
+
}
|
|
37743
|
+
var isFontLoaded = document.fonts.check(font);
|
|
37744
|
+
if (isFontLoaded) {
|
|
37745
|
+
return;
|
|
37746
|
+
}
|
|
37747
|
+
function onLoadingDone() {
|
|
37748
|
+
updateInputWidth(element);
|
|
37749
|
+
}
|
|
37750
|
+
document.fonts.addEventListener('loadingdone', onLoadingDone);
|
|
37751
|
+
}
|
|
37752
|
+
function getSelectionString(input) {
|
|
37753
|
+
/**
|
|
37754
|
+
* window.getSelection().toString() returns empty string in IE11 and Firefox,
|
|
37755
|
+
* so alternatives come first.
|
|
37756
|
+
*/
|
|
37757
|
+
if (input &&
|
|
37758
|
+
'selectionStart' in input &&
|
|
37759
|
+
input.selectionStart !== null &&
|
|
37760
|
+
'selectionEnd' in input &&
|
|
37761
|
+
input.selectionEnd !== null) {
|
|
37762
|
+
return input.value.slice(input.selectionStart, input.selectionEnd);
|
|
37763
|
+
}
|
|
37764
|
+
if ('getSelection' in window) {
|
|
37765
|
+
var selection = window.getSelection();
|
|
37766
|
+
return selection && selection.toString();
|
|
37767
|
+
}
|
|
37768
|
+
return null;
|
|
37769
|
+
}
|
|
37770
|
+
function makeOnKeyPress(maxLength) {
|
|
37771
|
+
if (maxLength === null) {
|
|
37772
|
+
return undefined;
|
|
37773
|
+
}
|
|
37774
|
+
/**
|
|
37775
|
+
* Prevents keystrokes that would not produce a number or when value after keystroke would
|
|
37776
|
+
* exceed maxLength.
|
|
37777
|
+
*/
|
|
37778
|
+
return function onKeyPress(event) {
|
|
37779
|
+
if (isFirefox) {
|
|
37780
|
+
// See https://github.com/wojtekmaj/react-time-picker/issues/92
|
|
37781
|
+
return;
|
|
37782
|
+
}
|
|
37783
|
+
var key = event.key, input = event.target;
|
|
37784
|
+
var value = input.value;
|
|
37785
|
+
var isNumberKey = key.length === 1 && /\d/.test(key);
|
|
37786
|
+
var selection = getSelectionString(input);
|
|
37787
|
+
if (!isNumberKey || !(selection || value.length < maxLength)) {
|
|
37788
|
+
event.preventDefault();
|
|
37789
|
+
}
|
|
37790
|
+
};
|
|
37791
|
+
}
|
|
37792
|
+
function Input(_a) {
|
|
37793
|
+
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;
|
|
37794
|
+
useIsomorphicLayoutEffect(function () {
|
|
37795
|
+
if (!inputRef || !inputRef.current) {
|
|
37796
|
+
return;
|
|
37797
|
+
}
|
|
37798
|
+
updateInputWidth(inputRef.current);
|
|
37799
|
+
updateInputWidthOnLoad(inputRef.current);
|
|
37800
|
+
updateInputWidthOnFontLoad(inputRef.current);
|
|
37801
|
+
}, [inputRef, value]);
|
|
37802
|
+
var hasLeadingZero = showLeadingZeros &&
|
|
37803
|
+
value &&
|
|
37804
|
+
Number(value) < 10 &&
|
|
37805
|
+
(value === '0' || !value.toString().startsWith('0'));
|
|
37806
|
+
var maxLength = max ? max.toString().length : null;
|
|
37807
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
37808
|
+
hasLeadingZero ? React__default.createElement("span", { className: "".concat(className, "__leadingZero") }, "0") : null,
|
|
37809
|
+
React__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) {
|
|
37810
|
+
updateInputWidth(event.target);
|
|
37811
|
+
if (onKeyUp) {
|
|
37812
|
+
onKeyUp(event);
|
|
37813
|
+
}
|
|
37814
|
+
}, placeholder: placeholder, ref: inputRef, required: required, step: step, type: "number", value: value !== null ? value : '' })));
|
|
37815
|
+
}
|
|
37816
|
+
|
|
37817
|
+
function convert12to24(hour12, amPm) {
|
|
37818
|
+
var hour24 = Number(hour12);
|
|
37819
|
+
if (amPm === 'am' && hour24 === 12) {
|
|
37820
|
+
hour24 = 0;
|
|
37821
|
+
}
|
|
37822
|
+
else if (amPm === 'pm' && hour24 < 12) {
|
|
37823
|
+
hour24 += 12;
|
|
37824
|
+
}
|
|
37825
|
+
return hour24;
|
|
37826
|
+
}
|
|
37827
|
+
function convert24to12(hour24) {
|
|
37828
|
+
var hour12 = Number(hour24) % 12 || 12;
|
|
37829
|
+
return [hour12, Number(hour24) < 12 ? 'am' : 'pm'];
|
|
37830
|
+
}
|
|
37831
|
+
|
|
37832
|
+
var formatterCache = new Map();
|
|
37833
|
+
function getFormatter(options) {
|
|
37834
|
+
return function formatter(locale, date) {
|
|
37835
|
+
var localeWithDefault = locale || getUserLocale();
|
|
37836
|
+
if (!formatterCache.has(localeWithDefault)) {
|
|
37837
|
+
formatterCache.set(localeWithDefault, new Map());
|
|
37838
|
+
}
|
|
37839
|
+
var formatterCacheLocale = formatterCache.get(localeWithDefault);
|
|
37840
|
+
if (!formatterCacheLocale.has(options)) {
|
|
37841
|
+
formatterCacheLocale.set(options, new Intl.DateTimeFormat(localeWithDefault || undefined, options).format);
|
|
37842
|
+
}
|
|
37843
|
+
return formatterCacheLocale.get(options)(date);
|
|
37844
|
+
};
|
|
37845
|
+
}
|
|
37846
|
+
var numberFormatterCache = new Map();
|
|
37847
|
+
function getNumberFormatter(options) {
|
|
37848
|
+
return function (locale, number) {
|
|
37849
|
+
var localeWithDefault = locale || getUserLocale();
|
|
37850
|
+
if (!numberFormatterCache.has(localeWithDefault)) {
|
|
37851
|
+
numberFormatterCache.set(localeWithDefault, new Map());
|
|
37852
|
+
}
|
|
37853
|
+
var numberFormatterCacheLocale = numberFormatterCache.get(localeWithDefault);
|
|
37854
|
+
if (!numberFormatterCacheLocale.has(options)) {
|
|
37855
|
+
numberFormatterCacheLocale.set(options, new Intl.NumberFormat(localeWithDefault || undefined, options).format);
|
|
37856
|
+
}
|
|
37857
|
+
return numberFormatterCacheLocale.get(options)(number);
|
|
37858
|
+
};
|
|
37859
|
+
}
|
|
37860
|
+
|
|
37861
|
+
var nines = ['9', '٩'];
|
|
37862
|
+
var ninesRegExp = new RegExp("[".concat(nines.join(''), "]"));
|
|
37863
|
+
var amPmFormatter = getFormatter({ hour: 'numeric' });
|
|
37864
|
+
function getAmPmLabels(locale) {
|
|
37865
|
+
var amString = amPmFormatter(locale, new Date(2017, 0, 1, 9));
|
|
37866
|
+
var pmString = amPmFormatter(locale, new Date(2017, 0, 1, 21));
|
|
37867
|
+
var _a = amString.split(ninesRegExp), am1 = _a[0], am2 = _a[1];
|
|
37868
|
+
var _b = pmString.split(ninesRegExp), pm1 = _b[0], pm2 = _b[1];
|
|
37869
|
+
if (pm2 !== undefined) {
|
|
37870
|
+
// If pm2 is undefined, nine was not found in pmString - this locale is not using 12-hour time
|
|
37871
|
+
if (am1 !== pm1) {
|
|
37872
|
+
return [am1, pm1].map(function (el) { return el.trim(); });
|
|
37873
|
+
}
|
|
37874
|
+
if (am2 !== pm2) {
|
|
37875
|
+
return [am2, pm2].map(function (el) { return el.trim(); });
|
|
37876
|
+
}
|
|
37877
|
+
}
|
|
37878
|
+
// Fallback
|
|
37879
|
+
return ['AM', 'PM'];
|
|
37880
|
+
}
|
|
37881
|
+
function isValidNumber(num) {
|
|
37882
|
+
return num !== null && num !== false && !Number.isNaN(Number(num));
|
|
37883
|
+
}
|
|
37884
|
+
function safeMin() {
|
|
37885
|
+
var args = [];
|
|
37886
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
37887
|
+
args[_i] = arguments[_i];
|
|
37888
|
+
}
|
|
37889
|
+
return Math.min.apply(Math, args.filter(isValidNumber));
|
|
37890
|
+
}
|
|
37891
|
+
function safeMax() {
|
|
37892
|
+
var args = [];
|
|
37893
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
37894
|
+
args[_i] = arguments[_i];
|
|
37895
|
+
}
|
|
37896
|
+
return Math.max.apply(Math, args.filter(isValidNumber));
|
|
37897
|
+
}
|
|
37898
|
+
|
|
37899
|
+
var __assign$5 = (undefined && undefined.__assign) || function () {
|
|
37900
|
+
__assign$5 = Object.assign || function(t) {
|
|
37901
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
37902
|
+
s = arguments[i];
|
|
37903
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
37904
|
+
t[p] = s[p];
|
|
37905
|
+
}
|
|
37906
|
+
return t;
|
|
37907
|
+
};
|
|
37908
|
+
return __assign$5.apply(this, arguments);
|
|
37909
|
+
};
|
|
37910
|
+
var __rest$4 = (undefined && undefined.__rest) || function (s, e) {
|
|
37911
|
+
var t = {};
|
|
37912
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
37913
|
+
t[p] = s[p];
|
|
37914
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
37915
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
37916
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
37917
|
+
t[p[i]] = s[p[i]];
|
|
37918
|
+
}
|
|
37919
|
+
return t;
|
|
37920
|
+
};
|
|
37921
|
+
function Hour12Input(_a) {
|
|
37922
|
+
var amPm = _a.amPm, maxTime = _a.maxTime, minTime = _a.minTime, value = _a.value, otherProps = __rest$4(_a, ["amPm", "maxTime", "minTime", "value"]);
|
|
37923
|
+
var maxHour = safeMin(12, maxTime &&
|
|
37924
|
+
(function () {
|
|
37925
|
+
var _a = convert24to12(getHours(maxTime)), maxHourResult = _a[0], maxAmPm = _a[1];
|
|
37926
|
+
if (maxAmPm !== amPm) {
|
|
37927
|
+
// pm is always after am, so we should ignore validation
|
|
37928
|
+
return null;
|
|
37929
|
+
}
|
|
37930
|
+
return maxHourResult;
|
|
37931
|
+
})());
|
|
37932
|
+
var minHour = safeMax(1, minTime &&
|
|
37933
|
+
(function () {
|
|
37934
|
+
var _a = convert24to12(getHours(minTime)), minHourResult = _a[0], minAmPm = _a[1];
|
|
37935
|
+
if (
|
|
37936
|
+
// pm is always after am, so we should ignore validation
|
|
37937
|
+
minAmPm !== amPm ||
|
|
37938
|
+
// If minHour is 12 am/pm, user should be able to enter 12, 1, ..., 11.
|
|
37939
|
+
minHourResult === 12) {
|
|
37940
|
+
return null;
|
|
37941
|
+
}
|
|
37942
|
+
return minHourResult;
|
|
37943
|
+
})());
|
|
37944
|
+
var value12 = value ? convert24to12(value)[0].toString() : '';
|
|
37945
|
+
return (React__default.createElement(Input, __assign$5({ max: maxHour, min: minHour, name: "hour12", nameForClass: "hour", value: value12 }, otherProps)));
|
|
37946
|
+
}
|
|
37947
|
+
|
|
37948
|
+
var __assign$4 = (undefined && undefined.__assign) || function () {
|
|
37949
|
+
__assign$4 = Object.assign || function(t) {
|
|
37950
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
37951
|
+
s = arguments[i];
|
|
37952
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
37953
|
+
t[p] = s[p];
|
|
37954
|
+
}
|
|
37955
|
+
return t;
|
|
37956
|
+
};
|
|
37957
|
+
return __assign$4.apply(this, arguments);
|
|
37958
|
+
};
|
|
37959
|
+
var __rest$3 = (undefined && undefined.__rest) || function (s, e) {
|
|
37960
|
+
var t = {};
|
|
37961
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
37962
|
+
t[p] = s[p];
|
|
37963
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
37964
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
37965
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
37966
|
+
t[p[i]] = s[p[i]];
|
|
37967
|
+
}
|
|
37968
|
+
return t;
|
|
37969
|
+
};
|
|
37970
|
+
function Hour24Input(_a) {
|
|
37971
|
+
var maxTime = _a.maxTime, minTime = _a.minTime, otherProps = __rest$3(_a, ["maxTime", "minTime"]);
|
|
37972
|
+
var maxHour = safeMin(23, maxTime && getHours(maxTime));
|
|
37973
|
+
var minHour = safeMax(0, minTime && getHours(minTime));
|
|
37974
|
+
return React__default.createElement(Input, __assign$4({ max: maxHour, min: minHour, name: "hour24", nameForClass: "hour" }, otherProps));
|
|
37975
|
+
}
|
|
37976
|
+
|
|
37977
|
+
var __assign$3 = (undefined && undefined.__assign) || function () {
|
|
37978
|
+
__assign$3 = Object.assign || function(t) {
|
|
37979
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
37980
|
+
s = arguments[i];
|
|
37981
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
37982
|
+
t[p] = s[p];
|
|
37983
|
+
}
|
|
37984
|
+
return t;
|
|
37985
|
+
};
|
|
37986
|
+
return __assign$3.apply(this, arguments);
|
|
37987
|
+
};
|
|
37988
|
+
var __rest$2 = (undefined && undefined.__rest) || function (s, e) {
|
|
37989
|
+
var t = {};
|
|
37990
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
37991
|
+
t[p] = s[p];
|
|
37992
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
37993
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
37994
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
37995
|
+
t[p[i]] = s[p[i]];
|
|
37996
|
+
}
|
|
37997
|
+
return t;
|
|
37998
|
+
};
|
|
37999
|
+
function MinuteInput(_a) {
|
|
38000
|
+
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"]);
|
|
38001
|
+
function isSameHour(date) {
|
|
38002
|
+
return hour === getHours(date).toString();
|
|
38003
|
+
}
|
|
38004
|
+
var maxMinute = safeMin(59, maxTime && isSameHour(maxTime) && getMinutes(maxTime));
|
|
38005
|
+
var minMinute = safeMax(0, minTime && isSameHour(minTime) && getMinutes(minTime));
|
|
38006
|
+
return (React__default.createElement(Input, __assign$3({ max: maxMinute, min: minMinute, name: "minute", showLeadingZeros: showLeadingZeros }, otherProps)));
|
|
38007
|
+
}
|
|
38008
|
+
|
|
38009
|
+
var __assign$2 = (undefined && undefined.__assign) || function () {
|
|
38010
|
+
__assign$2 = 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$2.apply(this, arguments);
|
|
38019
|
+
};
|
|
38020
|
+
var __rest$1 = (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 SecondInput(_a) {
|
|
38032
|
+
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"]);
|
|
38033
|
+
function isSameMinute(date) {
|
|
38034
|
+
return hour === getHours(date).toString() && minute === getMinutes(date).toString();
|
|
38035
|
+
}
|
|
38036
|
+
var maxSecond = safeMin(59, maxTime && isSameMinute(maxTime) && getSeconds(maxTime));
|
|
38037
|
+
var minSecond = safeMax(0, minTime && isSameMinute(minTime) && getSeconds(minTime));
|
|
38038
|
+
return (React__default.createElement(Input, __assign$2({ max: maxSecond, min: minSecond, name: "second", showLeadingZeros: showLeadingZeros }, otherProps)));
|
|
38039
|
+
}
|
|
38040
|
+
|
|
38041
|
+
function NativeInput(_a) {
|
|
38042
|
+
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;
|
|
38043
|
+
var nativeValueParser = (function () {
|
|
38044
|
+
switch (valueType) {
|
|
38045
|
+
case 'hour':
|
|
38046
|
+
return function (receivedValue) { return "".concat(getHours(receivedValue), ":00"); };
|
|
38047
|
+
case 'minute':
|
|
38048
|
+
return getHoursMinutes;
|
|
38049
|
+
case 'second':
|
|
38050
|
+
return getHoursMinutesSeconds;
|
|
38051
|
+
default:
|
|
38052
|
+
throw new Error('Invalid valueType');
|
|
38053
|
+
}
|
|
38054
|
+
})();
|
|
38055
|
+
var step = (function () {
|
|
38056
|
+
switch (valueType) {
|
|
38057
|
+
case 'hour':
|
|
38058
|
+
return 3600;
|
|
38059
|
+
case 'minute':
|
|
38060
|
+
return 60;
|
|
38061
|
+
case 'second':
|
|
38062
|
+
return 1;
|
|
38063
|
+
default:
|
|
38064
|
+
throw new Error('Invalid valueType');
|
|
38065
|
+
}
|
|
38066
|
+
})();
|
|
38067
|
+
function stopPropagation(event) {
|
|
38068
|
+
event.stopPropagation();
|
|
38069
|
+
}
|
|
38070
|
+
return (React__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: {
|
|
38071
|
+
visibility: 'hidden',
|
|
38072
|
+
position: 'absolute',
|
|
38073
|
+
zIndex: '-999',
|
|
38074
|
+
}, type: "time", value: value ? nativeValueParser(value) : '' }));
|
|
38075
|
+
}
|
|
38076
|
+
|
|
38077
|
+
function AmPm(_a) {
|
|
38078
|
+
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;
|
|
38079
|
+
var amDisabled = minTime ? convert24to12(getHours(minTime))[1] === 'pm' : false;
|
|
38080
|
+
var pmDisabled = maxTime ? convert24to12(getHours(maxTime))[1] === 'am' : false;
|
|
38081
|
+
var name = 'amPm';
|
|
38082
|
+
var _b = getAmPmLabels(locale), amLabel = _b[0], pmLabel = _b[1];
|
|
38083
|
+
return (React__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 : '' },
|
|
38084
|
+
!value && React__default.createElement("option", { value: "" }, "--"),
|
|
38085
|
+
React__default.createElement("option", { disabled: amDisabled, value: "am" }, amLabel),
|
|
38086
|
+
React__default.createElement("option", { disabled: pmDisabled, value: "pm" }, pmLabel)));
|
|
38087
|
+
}
|
|
38088
|
+
|
|
38089
|
+
var __assign$1 = (undefined && undefined.__assign) || function () {
|
|
38090
|
+
__assign$1 = Object.assign || function(t) {
|
|
38091
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
38092
|
+
s = arguments[i];
|
|
38093
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
38094
|
+
t[p] = s[p];
|
|
38095
|
+
}
|
|
38096
|
+
return t;
|
|
38097
|
+
};
|
|
38098
|
+
return __assign$1.apply(this, arguments);
|
|
38099
|
+
};
|
|
38100
|
+
var __spreadArray$1 = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
|
38101
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
38102
|
+
if (ar || !(i in from)) {
|
|
38103
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
38104
|
+
ar[i] = from[i];
|
|
38105
|
+
}
|
|
38106
|
+
}
|
|
38107
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
38108
|
+
};
|
|
38109
|
+
var getFormatterOptionsCache = {};
|
|
38110
|
+
var allViews$2 = ['hour', 'minute', 'second'];
|
|
38111
|
+
function isInternalInput(element) {
|
|
38112
|
+
return element.dataset.input === 'true';
|
|
38113
|
+
}
|
|
38114
|
+
function findInput(element, property) {
|
|
38115
|
+
var nextElement = element;
|
|
38116
|
+
do {
|
|
38117
|
+
nextElement = nextElement[property];
|
|
38118
|
+
} while (nextElement && !isInternalInput(nextElement));
|
|
38119
|
+
return nextElement;
|
|
38120
|
+
}
|
|
38121
|
+
function focus(element) {
|
|
38122
|
+
if (element) {
|
|
38123
|
+
element.focus();
|
|
38124
|
+
}
|
|
38125
|
+
}
|
|
38126
|
+
function renderCustomInputs(placeholder, elementFunctions, allowMultipleInstances) {
|
|
38127
|
+
var usedFunctions = [];
|
|
38128
|
+
var pattern = new RegExp(Object.keys(elementFunctions)
|
|
38129
|
+
.map(function (el) { return "".concat(el, "+"); })
|
|
38130
|
+
.join('|'), 'g');
|
|
38131
|
+
var matches = placeholder.match(pattern);
|
|
38132
|
+
return placeholder.split(pattern).reduce(function (arr, element, index) {
|
|
38133
|
+
var divider = element && (
|
|
38134
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
38135
|
+
React__default.createElement(Divider, { key: "separator_".concat(index) }, element));
|
|
38136
|
+
var res = __spreadArray$1(__spreadArray$1([], arr, true), [divider], false);
|
|
38137
|
+
var currentMatch = matches && matches[index];
|
|
38138
|
+
if (currentMatch) {
|
|
38139
|
+
var renderFunction = elementFunctions[currentMatch] ||
|
|
38140
|
+
elementFunctions[Object.keys(elementFunctions).find(function (elementFunction) {
|
|
38141
|
+
return currentMatch.match(elementFunction);
|
|
38142
|
+
})];
|
|
38143
|
+
if (!renderFunction) {
|
|
38144
|
+
return res;
|
|
38145
|
+
}
|
|
38146
|
+
if (!allowMultipleInstances && usedFunctions.includes(renderFunction)) {
|
|
38147
|
+
res.push(currentMatch);
|
|
38148
|
+
}
|
|
38149
|
+
else {
|
|
38150
|
+
res.push(renderFunction(currentMatch, index));
|
|
38151
|
+
usedFunctions.push(renderFunction);
|
|
38152
|
+
}
|
|
38153
|
+
}
|
|
38154
|
+
return res;
|
|
38155
|
+
}, []);
|
|
38156
|
+
}
|
|
38157
|
+
var formatNumber = getNumberFormatter({ useGrouping: false });
|
|
38158
|
+
function TimeInput(_a) {
|
|
38159
|
+
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;
|
|
38160
|
+
var _e = useState(null), amPm = _e[0], setAmPm = _e[1];
|
|
38161
|
+
var _f = useState(null), hour = _f[0], setHour = _f[1];
|
|
38162
|
+
var _g = useState(null), minute = _g[0], setMinute = _g[1];
|
|
38163
|
+
var _h = useState(null), second = _h[0], setSecond = _h[1];
|
|
38164
|
+
var _j = useState(null), value = _j[0], setValue = _j[1];
|
|
38165
|
+
var amPmInput = useRef(null);
|
|
38166
|
+
var hour12Input = useRef(null);
|
|
38167
|
+
var hour24Input = useRef(null);
|
|
38168
|
+
var minuteInput = useRef(null);
|
|
38169
|
+
var secondInput = useRef(null);
|
|
38170
|
+
var _k = useState(isClockOpenProps), isClockOpen = _k[0], setIsClockOpen = _k[1];
|
|
38171
|
+
var lastPressedKey = useRef();
|
|
38172
|
+
useEffect(function () {
|
|
38173
|
+
setIsClockOpen(isClockOpenProps);
|
|
38174
|
+
}, [isClockOpenProps]);
|
|
38175
|
+
useEffect(function () {
|
|
38176
|
+
var nextValue = valueProps;
|
|
38177
|
+
if (nextValue) {
|
|
38178
|
+
setAmPm(convert24to12(getHours(nextValue))[1]);
|
|
38179
|
+
setHour(getHours(nextValue).toString());
|
|
38180
|
+
setMinute(getMinutes(nextValue).toString());
|
|
38181
|
+
setSecond(getSeconds(nextValue).toString());
|
|
38182
|
+
setValue(nextValue);
|
|
38183
|
+
}
|
|
38184
|
+
else {
|
|
38185
|
+
setAmPm(null);
|
|
38186
|
+
setHour(null);
|
|
38187
|
+
setMinute(null);
|
|
38188
|
+
setSecond(null);
|
|
38189
|
+
setValue(null);
|
|
38190
|
+
}
|
|
38191
|
+
}, [
|
|
38192
|
+
valueProps,
|
|
38193
|
+
minTime,
|
|
38194
|
+
maxTime,
|
|
38195
|
+
maxDetail,
|
|
38196
|
+
// Toggling clock visibility resets values
|
|
38197
|
+
isClockOpen,
|
|
38198
|
+
]);
|
|
38199
|
+
var valueType = maxDetail;
|
|
38200
|
+
var formatTime = (function () {
|
|
38201
|
+
var level = allViews$2.indexOf(maxDetail);
|
|
38202
|
+
var formatterOptions = getFormatterOptionsCache[level] ||
|
|
38203
|
+
(function () {
|
|
38204
|
+
var options = { hour: 'numeric' };
|
|
38205
|
+
if (level >= 1) {
|
|
38206
|
+
options.minute = 'numeric';
|
|
38207
|
+
}
|
|
38208
|
+
if (level >= 2) {
|
|
38209
|
+
options.second = 'numeric';
|
|
38210
|
+
}
|
|
38211
|
+
getFormatterOptionsCache[level] = options;
|
|
38212
|
+
return options;
|
|
38213
|
+
})();
|
|
38214
|
+
return getFormatter(formatterOptions);
|
|
38215
|
+
})();
|
|
38216
|
+
/**
|
|
38217
|
+
* Gets current value in a desired format.
|
|
38218
|
+
*/
|
|
38219
|
+
function getProcessedValue(value) {
|
|
38220
|
+
var processFunction = (function () {
|
|
38221
|
+
switch (valueType) {
|
|
38222
|
+
case 'hour':
|
|
38223
|
+
case 'minute':
|
|
38224
|
+
return getHoursMinutes;
|
|
38225
|
+
case 'second':
|
|
38226
|
+
return getHoursMinutesSeconds;
|
|
38227
|
+
default:
|
|
38228
|
+
throw new Error('Invalid valueType');
|
|
38229
|
+
}
|
|
38230
|
+
})();
|
|
38231
|
+
return processFunction(value);
|
|
38232
|
+
}
|
|
38233
|
+
var placeholder = format ||
|
|
38234
|
+
(function () {
|
|
38235
|
+
var hour24 = 21;
|
|
38236
|
+
var hour12 = 9;
|
|
38237
|
+
var minute = 13;
|
|
38238
|
+
var second = 14;
|
|
38239
|
+
var date = new Date(2017, 0, 1, hour24, minute, second);
|
|
38240
|
+
return formatTime(locale, date)
|
|
38241
|
+
.replace(formatNumber(locale, hour12), 'h')
|
|
38242
|
+
.replace(formatNumber(locale, hour24), 'H')
|
|
38243
|
+
.replace(formatNumber(locale, minute), 'mm')
|
|
38244
|
+
.replace(formatNumber(locale, second), 'ss')
|
|
38245
|
+
.replace(new RegExp(getAmPmLabels(locale).join('|')), 'a');
|
|
38246
|
+
})();
|
|
38247
|
+
var divider = (function () {
|
|
38248
|
+
var dividers = placeholder.match(/[^0-9a-z]/i);
|
|
38249
|
+
return dividers ? dividers[0] : null;
|
|
38250
|
+
})();
|
|
38251
|
+
function onClick(event) {
|
|
38252
|
+
if (event.target === event.currentTarget) {
|
|
38253
|
+
// Wrapper was directly clicked
|
|
38254
|
+
var firstInput = event.target.children[1];
|
|
38255
|
+
focus(firstInput);
|
|
38256
|
+
}
|
|
38257
|
+
}
|
|
38258
|
+
function onKeyDown(event) {
|
|
38259
|
+
lastPressedKey.current = event.key;
|
|
38260
|
+
switch (event.key) {
|
|
38261
|
+
case 'ArrowLeft':
|
|
38262
|
+
case 'ArrowRight':
|
|
38263
|
+
case divider: {
|
|
38264
|
+
event.preventDefault();
|
|
38265
|
+
var input = event.target;
|
|
38266
|
+
var property = event.key === 'ArrowLeft' ? 'previousElementSibling' : 'nextElementSibling';
|
|
38267
|
+
var nextInput = findInput(input, property);
|
|
38268
|
+
focus(nextInput);
|
|
38269
|
+
break;
|
|
38270
|
+
}
|
|
38271
|
+
}
|
|
38272
|
+
}
|
|
38273
|
+
function onKeyUp(event) {
|
|
38274
|
+
var key = event.key, input = event.target;
|
|
38275
|
+
var isLastPressedKey = lastPressedKey.current === key;
|
|
38276
|
+
if (!isLastPressedKey) {
|
|
38277
|
+
return;
|
|
38278
|
+
}
|
|
38279
|
+
var isNumberKey = !isNaN(Number(key));
|
|
38280
|
+
if (!isNumberKey) {
|
|
38281
|
+
return;
|
|
38282
|
+
}
|
|
38283
|
+
var max = input.getAttribute('max');
|
|
38284
|
+
if (!max) {
|
|
38285
|
+
return;
|
|
38286
|
+
}
|
|
38287
|
+
var value = input.value;
|
|
38288
|
+
/**
|
|
38289
|
+
* Given 1, the smallest possible number the user could type by adding another digit is 10.
|
|
38290
|
+
* 10 would be a valid value given max = 12, so we won't jump to the next input.
|
|
38291
|
+
* However, given 2, smallers possible number would be 20, and thus keeping the focus in
|
|
38292
|
+
* this field doesn't make sense.
|
|
38293
|
+
*/
|
|
38294
|
+
if (Number(value) * 10 > Number(max) || value.length >= max.length) {
|
|
38295
|
+
var property = 'nextElementSibling';
|
|
38296
|
+
var nextInput = findInput(input, property);
|
|
38297
|
+
focus(nextInput);
|
|
38298
|
+
}
|
|
38299
|
+
}
|
|
38300
|
+
/**
|
|
38301
|
+
* Called after internal onChange. Checks input validity. If all fields are valid,
|
|
38302
|
+
* calls props.onChange.
|
|
38303
|
+
*/
|
|
38304
|
+
function onChangeExternal() {
|
|
38305
|
+
if (!onChangeProps) {
|
|
38306
|
+
return;
|
|
38307
|
+
}
|
|
38308
|
+
function filterBoolean(value) {
|
|
38309
|
+
return Boolean(value);
|
|
38310
|
+
}
|
|
38311
|
+
var formElements = [
|
|
38312
|
+
amPmInput.current,
|
|
38313
|
+
hour12Input.current,
|
|
38314
|
+
hour24Input.current,
|
|
38315
|
+
minuteInput.current,
|
|
38316
|
+
secondInput.current,
|
|
38317
|
+
].filter(filterBoolean);
|
|
38318
|
+
var formElementsWithoutSelect = formElements.slice(1);
|
|
38319
|
+
var values = {};
|
|
38320
|
+
formElements.forEach(function (formElement) {
|
|
38321
|
+
values[formElement.name] =
|
|
38322
|
+
formElement.type === 'number'
|
|
38323
|
+
? 'valueAsNumber' in formElement
|
|
38324
|
+
? formElement.valueAsNumber
|
|
38325
|
+
: Number(formElement.value)
|
|
38326
|
+
: formElement.value;
|
|
38327
|
+
});
|
|
38328
|
+
var isEveryValueEmpty = formElementsWithoutSelect.every(function (formElement) { return !formElement.value; });
|
|
38329
|
+
if (isEveryValueEmpty) {
|
|
38330
|
+
onChangeProps(null, false);
|
|
38331
|
+
return;
|
|
38332
|
+
}
|
|
38333
|
+
var isEveryValueFilled = formElements.every(function (formElement) { return formElement.value; });
|
|
38334
|
+
var isEveryValueValid = formElements.every(function (formElement) { return formElement.validity.valid; });
|
|
38335
|
+
if (isEveryValueFilled && isEveryValueValid) {
|
|
38336
|
+
var hour_1 = Number(values.hour24 ||
|
|
38337
|
+
(values.hour12 && values.amPm && convert12to24(values.hour12, values.amPm)) ||
|
|
38338
|
+
0);
|
|
38339
|
+
var minute_1 = Number(values.minute || 0);
|
|
38340
|
+
var second_1 = Number(values.second || 0);
|
|
38341
|
+
var padStart = function (num) { return "0".concat(num).slice(-2); };
|
|
38342
|
+
var proposedValue = "".concat(padStart(hour_1), ":").concat(padStart(minute_1), ":").concat(padStart(second_1));
|
|
38343
|
+
var processedValue = getProcessedValue(proposedValue);
|
|
38344
|
+
onChangeProps(processedValue, false);
|
|
38345
|
+
return;
|
|
38346
|
+
}
|
|
38347
|
+
if (!onInvalidChange) {
|
|
38348
|
+
return;
|
|
38349
|
+
}
|
|
38350
|
+
onInvalidChange();
|
|
38351
|
+
}
|
|
38352
|
+
/**
|
|
38353
|
+
* Called when non-native date input is changed.
|
|
38354
|
+
*/
|
|
38355
|
+
function onChange(event) {
|
|
38356
|
+
var _a = event.target, name = _a.name, value = _a.value;
|
|
38357
|
+
switch (name) {
|
|
38358
|
+
case 'amPm':
|
|
38359
|
+
setAmPm(value);
|
|
38360
|
+
break;
|
|
38361
|
+
case 'hour12':
|
|
38362
|
+
setHour(value ? convert12to24(value, amPm || 'am').toString() : '');
|
|
38363
|
+
break;
|
|
38364
|
+
case 'hour24':
|
|
38365
|
+
setHour(value);
|
|
38366
|
+
break;
|
|
38367
|
+
case 'minute':
|
|
38368
|
+
setMinute(value);
|
|
38369
|
+
break;
|
|
38370
|
+
case 'second':
|
|
38371
|
+
setSecond(value);
|
|
38372
|
+
break;
|
|
38373
|
+
}
|
|
38374
|
+
onChangeExternal();
|
|
38375
|
+
}
|
|
38376
|
+
/**
|
|
38377
|
+
* Called when native date input is changed.
|
|
38378
|
+
*/
|
|
38379
|
+
function onChangeNative(event) {
|
|
38380
|
+
var value = event.target.value;
|
|
38381
|
+
if (!onChangeProps) {
|
|
38382
|
+
return;
|
|
38383
|
+
}
|
|
38384
|
+
var processedValue = value || null;
|
|
38385
|
+
onChangeProps(processedValue, false);
|
|
38386
|
+
}
|
|
38387
|
+
var commonInputProps = {
|
|
38388
|
+
className: className,
|
|
38389
|
+
disabled: disabled,
|
|
38390
|
+
maxTime: maxTime,
|
|
38391
|
+
minTime: minTime,
|
|
38392
|
+
onChange: onChange,
|
|
38393
|
+
onKeyDown: onKeyDown,
|
|
38394
|
+
onKeyUp: onKeyUp,
|
|
38395
|
+
// This is only for showing validity when editing
|
|
38396
|
+
required: Boolean(required || isClockOpen),
|
|
38397
|
+
};
|
|
38398
|
+
function renderHour12(currentMatch, index) {
|
|
38399
|
+
if (currentMatch && currentMatch.length > 2) {
|
|
38400
|
+
throw new Error("Unsupported token: ".concat(currentMatch));
|
|
38401
|
+
}
|
|
38402
|
+
var showLeadingZeros = currentMatch ? currentMatch.length === 2 : false;
|
|
38403
|
+
return (React__default.createElement(Hour12Input, __assign$1({ key: "hour12" }, commonInputProps, { amPm: amPm, ariaLabel: hourAriaLabel,
|
|
38404
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
38405
|
+
autoFocus: index === 0 && autoFocus, inputRef: hour12Input, placeholder: hourPlaceholder, showLeadingZeros: showLeadingZeros, value: hour })));
|
|
38406
|
+
}
|
|
38407
|
+
function renderHour24(currentMatch, index) {
|
|
38408
|
+
if (currentMatch && currentMatch.length > 2) {
|
|
38409
|
+
throw new Error("Unsupported token: ".concat(currentMatch));
|
|
38410
|
+
}
|
|
38411
|
+
var showLeadingZeros = currentMatch ? currentMatch.length === 2 : false;
|
|
38412
|
+
return (React__default.createElement(Hour24Input, __assign$1({ key: "hour24" }, commonInputProps, { ariaLabel: hourAriaLabel,
|
|
38413
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
38414
|
+
autoFocus: index === 0 && autoFocus, inputRef: hour24Input, placeholder: hourPlaceholder, showLeadingZeros: showLeadingZeros, value: hour })));
|
|
38415
|
+
}
|
|
38416
|
+
function renderHour(currentMatch, index) {
|
|
38417
|
+
if (/h/.test(currentMatch)) {
|
|
38418
|
+
return renderHour12(currentMatch, index);
|
|
38419
|
+
}
|
|
38420
|
+
return renderHour24(currentMatch, index);
|
|
38421
|
+
}
|
|
38422
|
+
function renderMinute(currentMatch, index) {
|
|
38423
|
+
if (currentMatch && currentMatch.length > 2) {
|
|
38424
|
+
throw new Error("Unsupported token: ".concat(currentMatch));
|
|
38425
|
+
}
|
|
38426
|
+
var showLeadingZeros = currentMatch ? currentMatch.length === 2 : false;
|
|
38427
|
+
return (React__default.createElement(MinuteInput, __assign$1({ key: "minute" }, commonInputProps, { ariaLabel: minuteAriaLabel,
|
|
38428
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
38429
|
+
autoFocus: index === 0 && autoFocus, hour: hour, inputRef: minuteInput, placeholder: minutePlaceholder, showLeadingZeros: showLeadingZeros, value: minute })));
|
|
38430
|
+
}
|
|
38431
|
+
function renderSecond(currentMatch, index) {
|
|
38432
|
+
if (currentMatch && currentMatch.length > 2) {
|
|
38433
|
+
throw new Error("Unsupported token: ".concat(currentMatch));
|
|
38434
|
+
}
|
|
38435
|
+
var showLeadingZeros = currentMatch ? currentMatch.length === 2 : true;
|
|
38436
|
+
return (React__default.createElement(SecondInput, __assign$1({ key: "second" }, commonInputProps, { ariaLabel: secondAriaLabel,
|
|
38437
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
38438
|
+
autoFocus: index === 0 && autoFocus, hour: hour, inputRef: secondInput, minute: minute, placeholder: secondPlaceholder, showLeadingZeros: showLeadingZeros, value: second })));
|
|
38439
|
+
}
|
|
38440
|
+
function renderAmPm(currentMatch, index) {
|
|
38441
|
+
return (React__default.createElement(AmPm, __assign$1({ key: "ampm" }, commonInputProps, { ariaLabel: amPmAriaLabel,
|
|
38442
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
38443
|
+
autoFocus: index === 0 && autoFocus, inputRef: amPmInput, locale: locale, onChange: onChange, value: amPm })));
|
|
38444
|
+
}
|
|
38445
|
+
function renderCustomInputsInternal() {
|
|
38446
|
+
var elementFunctions = {
|
|
38447
|
+
h: renderHour,
|
|
38448
|
+
H: renderHour,
|
|
38449
|
+
m: renderMinute,
|
|
38450
|
+
s: renderSecond,
|
|
38451
|
+
a: renderAmPm,
|
|
38452
|
+
};
|
|
38453
|
+
var allowMultipleInstances = typeof format !== 'undefined';
|
|
38454
|
+
return renderCustomInputs(placeholder, elementFunctions, allowMultipleInstances);
|
|
38455
|
+
}
|
|
38456
|
+
function renderNativeInput() {
|
|
38457
|
+
return (React__default.createElement(NativeInput, { key: "time", ariaLabel: nativeInputAriaLabel, disabled: disabled, maxTime: maxTime, minTime: minTime, name: name, onChange: onChangeNative, required: required, value: value, valueType: valueType }));
|
|
38458
|
+
}
|
|
38459
|
+
return (
|
|
38460
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
38461
|
+
React__default.createElement("div", { className: className, onClick: onClick },
|
|
38462
|
+
renderNativeInput(),
|
|
38463
|
+
renderCustomInputsInternal()));
|
|
38464
|
+
}
|
|
38465
|
+
|
|
38466
|
+
var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
|
38467
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
38468
|
+
if (ar || !(i in from)) {
|
|
38469
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
38470
|
+
ar[i] = from[i];
|
|
38471
|
+
}
|
|
38472
|
+
}
|
|
38473
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
38474
|
+
};
|
|
38475
|
+
var allViews$1 = ['hour', 'minute', 'second'];
|
|
38476
|
+
var allValueTypes = __spreadArray([], allViews$1, true);
|
|
38477
|
+
var hourOptionalSecondsRegExp = /^(([0-1])?[0-9]|2[0-3]):[0-5][0-9](:([0-5][0-9]))?$/;
|
|
38478
|
+
var isTime = function isTime(props, propName, componentName) {
|
|
38479
|
+
var _a = props, _b = propName, time = _a[_b];
|
|
38480
|
+
if (time) {
|
|
38481
|
+
if (typeof time !== 'string' || !hourOptionalSecondsRegExp.test(time)) {
|
|
38482
|
+
return new Error("Invalid prop `".concat(propName, "` of type `").concat(typeof time, "` supplied to `").concat(componentName, "`, expected time in HH:mm(:ss) format."));
|
|
38483
|
+
}
|
|
38484
|
+
}
|
|
38485
|
+
// Everything is fine
|
|
38486
|
+
return null;
|
|
38487
|
+
};
|
|
38488
|
+
propTypes$1.exports.oneOf(allValueTypes);
|
|
38489
|
+
propTypes$1.exports.oneOfType([
|
|
38490
|
+
propTypes$1.exports.func,
|
|
38491
|
+
propTypes$1.exports.exact({
|
|
38492
|
+
current: propTypes$1.exports.any,
|
|
38493
|
+
}),
|
|
38494
|
+
]);
|
|
38495
|
+
var rangeOf = function (type) {
|
|
38496
|
+
return propTypes$1.exports.arrayOf(type);
|
|
38497
|
+
};
|
|
38498
|
+
|
|
38499
|
+
var __assign = (undefined && undefined.__assign) || function () {
|
|
38500
|
+
__assign = Object.assign || function(t) {
|
|
38501
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
38502
|
+
s = arguments[i];
|
|
38503
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
38504
|
+
t[p] = s[p];
|
|
38505
|
+
}
|
|
38506
|
+
return t;
|
|
38507
|
+
};
|
|
38508
|
+
return __assign.apply(this, arguments);
|
|
38509
|
+
};
|
|
38510
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
38511
|
+
var t = {};
|
|
38512
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
38513
|
+
t[p] = s[p];
|
|
38514
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
38515
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
38516
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
38517
|
+
t[p[i]] = s[p[i]];
|
|
38518
|
+
}
|
|
38519
|
+
return t;
|
|
38520
|
+
};
|
|
38521
|
+
var isBrowser = typeof document !== 'undefined';
|
|
38522
|
+
var baseClassName = 'react-time-picker';
|
|
38523
|
+
var outsideActionEvents = ['mousedown', 'focusin', 'touchstart'];
|
|
38524
|
+
var allViews = ['hour', 'minute', 'second'];
|
|
38525
|
+
var iconProps = {
|
|
38526
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
38527
|
+
width: 19,
|
|
38528
|
+
height: 19,
|
|
38529
|
+
viewBox: '0 0 19 19',
|
|
38530
|
+
stroke: 'black',
|
|
38531
|
+
strokeWidth: 2,
|
|
38532
|
+
};
|
|
38533
|
+
var ClockIcon = (React__default.createElement("svg", __assign({}, iconProps, { className: "".concat(baseClassName, "__clock-button__icon ").concat(baseClassName, "__button__icon"), fill: "none" }),
|
|
38534
|
+
React__default.createElement("circle", { cx: "9.5", cy: "9.5", r: "7.5" }),
|
|
38535
|
+
React__default.createElement("path", { d: "M9.5 4.5 v5 h4" })));
|
|
38536
|
+
var ClearIcon = (React__default.createElement("svg", __assign({}, iconProps, { className: "".concat(baseClassName, "__clear-button__icon ").concat(baseClassName, "__button__icon") }),
|
|
38537
|
+
React__default.createElement("line", { x1: "4", x2: "15", y1: "4", y2: "15" }),
|
|
38538
|
+
React__default.createElement("line", { x1: "15", x2: "4", y1: "4", y2: "15" })));
|
|
38539
|
+
var TimePicker = function TimePicker(props) {
|
|
38540
|
+
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"]);
|
|
38541
|
+
var _h = useState(isOpenProps), isOpen = _h[0], setIsOpen = _h[1];
|
|
38542
|
+
var wrapper = useRef(null);
|
|
38543
|
+
var clockWrapper = useRef(null);
|
|
38544
|
+
useEffect(function () {
|
|
38545
|
+
setIsOpen(isOpenProps);
|
|
38546
|
+
}, [isOpenProps]);
|
|
38547
|
+
function openClock(_a) {
|
|
38548
|
+
var reason = _a.reason;
|
|
38549
|
+
if (shouldOpenClock) {
|
|
38550
|
+
if (!shouldOpenClock({ reason: reason })) {
|
|
38551
|
+
return;
|
|
38552
|
+
}
|
|
38553
|
+
}
|
|
38554
|
+
setIsOpen(true);
|
|
38555
|
+
if (onClockOpen) {
|
|
38556
|
+
onClockOpen();
|
|
38557
|
+
}
|
|
38558
|
+
}
|
|
38559
|
+
var closeClock = useCallback(function (_a) {
|
|
38560
|
+
var reason = _a.reason;
|
|
38561
|
+
if (shouldCloseClock) {
|
|
38562
|
+
if (!shouldCloseClock({ reason: reason })) {
|
|
38563
|
+
return;
|
|
38564
|
+
}
|
|
38565
|
+
}
|
|
38566
|
+
setIsOpen(false);
|
|
38567
|
+
if (onClockClose) {
|
|
38568
|
+
onClockClose();
|
|
38569
|
+
}
|
|
38570
|
+
}, [onClockClose, shouldCloseClock]);
|
|
38571
|
+
function toggleClock() {
|
|
38572
|
+
if (isOpen) {
|
|
38573
|
+
closeClock({ reason: 'buttonClick' });
|
|
38574
|
+
}
|
|
38575
|
+
else {
|
|
38576
|
+
openClock({ reason: 'buttonClick' });
|
|
38577
|
+
}
|
|
38578
|
+
}
|
|
38579
|
+
function onChange(value, shouldCloseClock) {
|
|
38580
|
+
if (shouldCloseClock === void 0) { shouldCloseClock = shouldCloseClockOnSelect; }
|
|
38581
|
+
if (shouldCloseClock) {
|
|
38582
|
+
closeClock({ reason: 'select' });
|
|
38583
|
+
}
|
|
38584
|
+
if (onChangeProps) {
|
|
38585
|
+
onChangeProps(value);
|
|
38586
|
+
}
|
|
38587
|
+
}
|
|
38588
|
+
function onFocus(event) {
|
|
38589
|
+
if (onFocusProps) {
|
|
38590
|
+
onFocusProps(event);
|
|
38591
|
+
}
|
|
38592
|
+
if (
|
|
38593
|
+
// Internet Explorer still fires onFocus on disabled elements
|
|
38594
|
+
disabled ||
|
|
38595
|
+
isOpen ||
|
|
38596
|
+
!openClockOnFocus ||
|
|
38597
|
+
event.target.dataset.select === 'true') {
|
|
38598
|
+
return;
|
|
38599
|
+
}
|
|
38600
|
+
openClock({ reason: 'focus' });
|
|
38601
|
+
}
|
|
38602
|
+
var onKeyDown = useCallback(function (event) {
|
|
38603
|
+
if (event.key === 'Escape') {
|
|
38604
|
+
closeClock({ reason: 'escape' });
|
|
38605
|
+
}
|
|
38606
|
+
}, [closeClock]);
|
|
38607
|
+
function clear() {
|
|
38608
|
+
onChange(null);
|
|
38609
|
+
}
|
|
38610
|
+
function stopPropagation(event) {
|
|
38611
|
+
event.stopPropagation();
|
|
38612
|
+
}
|
|
38613
|
+
var onOutsideAction = useCallback(function (event) {
|
|
38614
|
+
var wrapperEl = wrapper.current;
|
|
38615
|
+
var clockWrapperEl = clockWrapper.current;
|
|
38616
|
+
// Try event.composedPath first to handle clicks inside a Shadow DOM.
|
|
38617
|
+
var target = ('composedPath' in event ? event.composedPath()[0] : event.target);
|
|
38618
|
+
if (target &&
|
|
38619
|
+
wrapperEl &&
|
|
38620
|
+
!wrapperEl.contains(target) &&
|
|
38621
|
+
(!clockWrapperEl || !clockWrapperEl.contains(target))) {
|
|
38622
|
+
closeClock({ reason: 'outsideAction' });
|
|
38623
|
+
}
|
|
38624
|
+
}, [clockWrapper, closeClock, wrapper]);
|
|
38625
|
+
var handleOutsideActionListeners = useCallback(function (shouldListen) {
|
|
38626
|
+
if (shouldListen === void 0) { shouldListen = isOpen; }
|
|
38627
|
+
outsideActionEvents.forEach(function (event) {
|
|
38628
|
+
if (shouldListen) {
|
|
38629
|
+
document.addEventListener(event, onOutsideAction);
|
|
38630
|
+
}
|
|
38631
|
+
else {
|
|
38632
|
+
document.removeEventListener(event, onOutsideAction);
|
|
38633
|
+
}
|
|
38634
|
+
});
|
|
38635
|
+
if (shouldListen) {
|
|
38636
|
+
document.addEventListener('keydown', onKeyDown);
|
|
38637
|
+
}
|
|
38638
|
+
else {
|
|
38639
|
+
document.removeEventListener('keydown', onKeyDown);
|
|
38640
|
+
}
|
|
38641
|
+
}, [isOpen, onOutsideAction, onKeyDown]);
|
|
38642
|
+
useEffect(function () {
|
|
38643
|
+
handleOutsideActionListeners();
|
|
38644
|
+
return function () {
|
|
38645
|
+
handleOutsideActionListeners(false);
|
|
38646
|
+
};
|
|
38647
|
+
}, [handleOutsideActionListeners]);
|
|
38648
|
+
function renderInputs() {
|
|
38649
|
+
var valueFrom = (Array.isArray(value) ? value : [value])[0];
|
|
38650
|
+
var ariaLabelProps = {
|
|
38651
|
+
amPmAriaLabel: amPmAriaLabel,
|
|
38652
|
+
hourAriaLabel: hourAriaLabel,
|
|
38653
|
+
minuteAriaLabel: minuteAriaLabel,
|
|
38654
|
+
nativeInputAriaLabel: nativeInputAriaLabel,
|
|
38655
|
+
secondAriaLabel: secondAriaLabel,
|
|
38656
|
+
};
|
|
38657
|
+
var placeholderProps = {
|
|
38658
|
+
hourPlaceholder: hourPlaceholder,
|
|
38659
|
+
minutePlaceholder: minutePlaceholder,
|
|
38660
|
+
secondPlaceholder: secondPlaceholder,
|
|
38661
|
+
};
|
|
38662
|
+
return (React__default.createElement("div", { className: "".concat(baseClassName, "__wrapper") },
|
|
38663
|
+
React__default.createElement(TimeInput, __assign({}, ariaLabelProps, placeholderProps, {
|
|
38664
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
38665
|
+
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 })),
|
|
38666
|
+
clearIcon !== null && (React__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.createElement(clearIcon) : clearIcon)),
|
|
38667
|
+
clockIcon !== null && !disableClock && (React__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.createElement(clockIcon) : clockIcon))));
|
|
38668
|
+
}
|
|
38669
|
+
function renderClock() {
|
|
38670
|
+
if (isOpen === null || disableClock) {
|
|
38671
|
+
return null;
|
|
38672
|
+
}
|
|
38673
|
+
var clockClassName = props.clockClassName; props.className; // Unused, here to exclude it from clockProps
|
|
38674
|
+
props.onChange; // Unused, here to exclude it from clockProps
|
|
38675
|
+
var portalContainer = props.portalContainer, value = props.value, clockProps = __rest(props, ["clockClassName", "className", "onChange", "portalContainer", "value"]);
|
|
38676
|
+
var className = "".concat(baseClassName, "__clock");
|
|
38677
|
+
var classNames = clsx$1(className, "".concat(className, "--").concat(isOpen ? 'open' : 'closed'));
|
|
38678
|
+
var valueFrom = (Array.isArray(value) ? value : [value])[0];
|
|
38679
|
+
var clock = React__default.createElement(Clock, __assign({ className: clockClassName, value: valueFrom }, clockProps));
|
|
38680
|
+
return portalContainer ? (createPortal(React__default.createElement("div", { ref: clockWrapper, className: classNames }, clock), portalContainer)) : (React__default.createElement(Fit, null,
|
|
38681
|
+
React__default.createElement("div", { ref: function (ref) {
|
|
38682
|
+
if (ref && !isOpen) {
|
|
38683
|
+
ref.removeAttribute('style');
|
|
38684
|
+
}
|
|
38685
|
+
}, className: classNames }, clock)));
|
|
38686
|
+
}
|
|
38687
|
+
var eventProps = useMemo(function () { return makeEventProps(otherProps); }, [otherProps]);
|
|
38688
|
+
return (React__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 }),
|
|
38689
|
+
renderInputs(),
|
|
38690
|
+
renderClock()));
|
|
38691
|
+
};
|
|
38692
|
+
var isValue = propTypes$1.exports.oneOfType([isTime, propTypes$1.exports.instanceOf(Date)]);
|
|
38693
|
+
var isValueOrValueArray = propTypes$1.exports.oneOfType([isValue, rangeOf(isValue)]);
|
|
38694
|
+
TimePicker.propTypes = {
|
|
38695
|
+
amPmAriaLabel: propTypes$1.exports.string,
|
|
38696
|
+
autoFocus: propTypes$1.exports.bool,
|
|
38697
|
+
className: propTypes$1.exports.oneOfType([propTypes$1.exports.string, propTypes$1.exports.arrayOf(propTypes$1.exports.string)]),
|
|
38698
|
+
clearAriaLabel: propTypes$1.exports.string,
|
|
38699
|
+
clearIcon: propTypes$1.exports.oneOfType([propTypes$1.exports.node, propTypes$1.exports.func]),
|
|
38700
|
+
clockAriaLabel: propTypes$1.exports.string,
|
|
38701
|
+
clockClassName: propTypes$1.exports.oneOfType([propTypes$1.exports.string, propTypes$1.exports.arrayOf(propTypes$1.exports.string)]),
|
|
38702
|
+
clockIcon: propTypes$1.exports.oneOfType([propTypes$1.exports.node, propTypes$1.exports.func]),
|
|
38703
|
+
closeClock: propTypes$1.exports.bool,
|
|
38704
|
+
'data-testid': propTypes$1.exports.string,
|
|
38705
|
+
disableClock: propTypes$1.exports.bool,
|
|
38706
|
+
disabled: propTypes$1.exports.bool,
|
|
38707
|
+
format: propTypes$1.exports.string,
|
|
38708
|
+
hourAriaLabel: propTypes$1.exports.string,
|
|
38709
|
+
hourPlaceholder: propTypes$1.exports.string,
|
|
38710
|
+
id: propTypes$1.exports.string,
|
|
38711
|
+
isOpen: propTypes$1.exports.bool,
|
|
38712
|
+
locale: propTypes$1.exports.string,
|
|
38713
|
+
maxDetail: propTypes$1.exports.oneOf(allViews),
|
|
38714
|
+
maxTime: isTime,
|
|
38715
|
+
minTime: isTime,
|
|
38716
|
+
minuteAriaLabel: propTypes$1.exports.string,
|
|
38717
|
+
minutePlaceholder: propTypes$1.exports.string,
|
|
38718
|
+
name: propTypes$1.exports.string,
|
|
38719
|
+
nativeInputAriaLabel: propTypes$1.exports.string,
|
|
38720
|
+
onChange: propTypes$1.exports.func,
|
|
38721
|
+
onClockClose: propTypes$1.exports.func,
|
|
38722
|
+
onClockOpen: propTypes$1.exports.func,
|
|
38723
|
+
onFocus: propTypes$1.exports.func,
|
|
38724
|
+
openClockOnFocus: propTypes$1.exports.bool,
|
|
38725
|
+
required: propTypes$1.exports.bool,
|
|
38726
|
+
secondAriaLabel: propTypes$1.exports.string,
|
|
38727
|
+
secondPlaceholder: propTypes$1.exports.string,
|
|
38728
|
+
value: isValueOrValueArray,
|
|
38729
|
+
};
|
|
38730
|
+
if (isBrowser) {
|
|
38731
|
+
TimePicker.propTypes.portalContainer = propTypes$1.exports.instanceOf(HTMLElement);
|
|
38732
|
+
}
|
|
38733
|
+
|
|
38734
|
+
var _excluded$2 = ["className", "label", "labelProps", "size", "nakedInput", "required", "value", "onChange", "error"];
|
|
38735
|
+
dayjs.extend(customParseFormat);
|
|
38736
|
+
var INPUT_SIZES = {
|
|
38737
|
+
small: "small",
|
|
38738
|
+
medium: "medium",
|
|
38739
|
+
large: "large"
|
|
38740
|
+
};
|
|
38741
|
+
var TimePickerInput = function TimePickerInput(_ref) {
|
|
38742
|
+
var _convertToDayjsObject, _extends2;
|
|
38743
|
+
var _ref$className = _ref.className,
|
|
38744
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
38745
|
+
label = _ref.label,
|
|
38746
|
+
labelProps = _ref.labelProps,
|
|
38747
|
+
_ref$size = _ref.size,
|
|
38748
|
+
size = _ref$size === void 0 ? INPUT_SIZES.medium : _ref$size,
|
|
38749
|
+
_ref$nakedInput = _ref.nakedInput,
|
|
38750
|
+
nakedInput = _ref$nakedInput === void 0 ? false : _ref$nakedInput,
|
|
38751
|
+
_ref$required = _ref.required,
|
|
38752
|
+
required = _ref$required === void 0 ? false : _ref$required,
|
|
38753
|
+
value = _ref.value,
|
|
38754
|
+
onChange = _ref.onChange,
|
|
38755
|
+
_ref$error = _ref.error,
|
|
38756
|
+
error = _ref$error === void 0 ? "" : _ref$error,
|
|
38757
|
+
otherProps = _objectWithoutProperties$1(_ref, _excluded$2);
|
|
38758
|
+
var _id = useId$1();
|
|
38759
|
+
var id = otherProps.id || _id;
|
|
38760
|
+
var errorId = "error_".concat(id);
|
|
38761
|
+
var handleChange = function handleChange(value) {
|
|
38762
|
+
var date = dayjs(value, "HH:mm:ss");
|
|
38763
|
+
onChange(date, value);
|
|
38764
|
+
};
|
|
38765
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
38766
|
+
className: "neeto-ui-input__wrapper"
|
|
38767
|
+
}, label && /*#__PURE__*/React__default.createElement(Label, _extends$4({
|
|
38768
|
+
required: required
|
|
38769
|
+
}, labelProps), label), /*#__PURE__*/React__default.createElement(TimePicker, _extends$4((_extends2 = {
|
|
38770
|
+
className: classnames$1("neeto-ui-time-picker", [className], {
|
|
38771
|
+
"neeto-ui-time-picker--small": size === "small",
|
|
38772
|
+
"neeto-ui-time-picker--medium": size === "medium",
|
|
38773
|
+
"neeto-ui-time-picker--large": size === "large",
|
|
38774
|
+
"neeto-ui-time-picker--disabled": otherProps.disabled,
|
|
38775
|
+
"neeto-ui-time-picker--naked": nakedInput,
|
|
38776
|
+
"neeto-ui-time-picker--error": !!error
|
|
38777
|
+
}),
|
|
38778
|
+
value: value,
|
|
38779
|
+
id: id,
|
|
38780
|
+
disableClock: true,
|
|
38781
|
+
clearIcon: null
|
|
38782
|
+
}, _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.createElement("p", {
|
|
38783
|
+
className: "neeto-ui-input__error",
|
|
38784
|
+
"data-cy": "".concat(hyphenize(label), "-input-error"),
|
|
38785
|
+
id: errorId
|
|
38786
|
+
}, error));
|
|
38787
|
+
};
|
|
38788
|
+
TimePickerInput.displayName = "TimePicker";
|
|
36158
38789
|
|
|
36159
38790
|
var dist = {};
|
|
36160
38791
|
|
|
@@ -39055,5 +41686,5 @@ var TreeSelect = /*#__PURE__*/forwardRef$1(function (_ref, ref) {
|
|
|
39055
41686
|
});
|
|
39056
41687
|
TreeSelect.displayName = "TreeSelect";
|
|
39057
41688
|
|
|
39058
|
-
export { Accordion, ActionDropdown, Alert, Avatar, Button, Callout, Checkbox, ColorPicker, DatePicker, Dropdown, Input$
|
|
41689
|
+
export { Accordion, ActionDropdown, Alert, Avatar, Button, Callout, Checkbox, ColorPicker, DatePicker, Dropdown, Input$3 as Input, Kbd, Label, Modal, MultiEmailInput, NoData, Pagination, Pane, Popover, Radio, Select, Slider, Spinner, Switch, Tab, Table, Tag, Textarea, TimePicker$1 as TimePicker, TimePickerInput, Toastr, Tooltip, TreeSelect, Typography };
|
|
39059
41690
|
//# sourceMappingURL=index.js.map
|