@elliemae/ds-utilities 2.2.0-alpha.4 → 3.0.0-next.2
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/cjs/capitalize.js +7 -35
- package/cjs/compose.js +32 -39
- package/cjs/getComponentFromProps.js +29 -47
- package/cjs/hooks/index.js +60 -68
- package/cjs/hooks/useCancellableDelayedCallback.js +18 -43
- package/cjs/hooks/useDerivedStateFromProps.js +36 -47
- package/cjs/hooks/useExecutionTimer.js +24 -43
- package/cjs/hooks/useExpandState.js +82 -69
- package/cjs/hooks/useHotkeys.js +24 -44
- package/cjs/hooks/useHoverHandlersDelay.js +18 -48
- package/cjs/hooks/useOnElementResize.js +27 -44
- package/cjs/hooks/useParentElement.js +13 -40
- package/cjs/hooks/usePrevious.js +10 -41
- package/cjs/hooks/useResizeObserver.js +25 -52
- package/cjs/hooks/useSetRef.js +11 -38
- package/cjs/hooks/useShouldRecalculate.js +14 -41
- package/cjs/hooks/useWindowScrollerList.js +33 -51
- package/cjs/hooks/useWindowSize.js +19 -49
- package/cjs/index.js +266 -145
- package/cjs/onClickHandlerForNonInteractiveElements.js +19 -46
- package/cjs/operators.js +51 -56
- package/cjs/platform.js +9 -37
- package/cjs/reactTypesUtility.js +22 -45
- package/cjs/scrollingTimer.js +15 -37
- package/cjs/system.js +30 -47
- package/cjs/timeUtils.js +24 -42
- package/cjs/utils.js +237 -101
- package/cjs/validations.js +35 -48
- package/esm/capitalize.js +3 -6
- package/esm/compose.js +29 -11
- package/esm/getComponentFromProps.js +22 -18
- package/esm/hooks/index.js +18 -40
- package/esm/hooks/useCancellableDelayedCallback.js +14 -12
- package/esm/hooks/useDerivedStateFromProps.js +31 -15
- package/esm/hooks/useExecutionTimer.js +20 -12
- package/esm/hooks/useExpandState.js +72 -36
- package/esm/hooks/useHotkeys.js +14 -11
- package/esm/hooks/useHoverHandlersDelay.js +12 -15
- package/esm/hooks/useOnElementResize.js +20 -12
- package/esm/hooks/useParentElement.js +7 -9
- package/esm/hooks/usePrevious.js +6 -10
- package/esm/hooks/useResizeObserver.js +15 -20
- package/esm/hooks/useSetRef.js +6 -8
- package/esm/hooks/useShouldRecalculate.js +11 -11
- package/esm/hooks/useWindowScrollerList.js +29 -20
- package/esm/hooks/useWindowSize.js +15 -18
- package/esm/index.js +31 -204
- package/esm/onClickHandlerForNonInteractiveElements.js +17 -17
- package/esm/operators.js +34 -27
- package/esm/platform.js +4 -8
- package/esm/reactTypesUtility.js +9 -16
- package/esm/scrollingTimer.js +11 -8
- package/esm/system.js +22 -16
- package/esm/timeUtils.js +19 -13
- package/esm/utils.js +72 -109
- package/esm/validations.js +28 -18
- package/package.json +1 -1
- package/types/compose.d.ts +1 -2
- package/types/getComponentFromProps.d.ts +1 -2
- package/types/hooks/index.d.ts +14 -14
- package/types/hooks/useCancellableDelayedCallback.d.ts +1 -2
- package/types/hooks/useDerivedStateFromProps.d.ts +1 -2
- package/types/hooks/useExecutionTimer.d.ts +1 -2
- package/types/hooks/useExpandState.d.ts +2 -3
- package/types/hooks/useHotkeys.d.ts +2 -3
- package/types/hooks/useHoverHandlersDelay.d.ts +2 -3
- package/types/hooks/usePrevious.d.ts +1 -1
- package/types/hooks/useResizeObserver.d.ts +1 -2
- package/types/hooks/useShouldRecalculate.d.ts +1 -2
- package/types/hooks/useWindowScrollerList.d.ts +2 -3
- package/types/hooks/useWindowSize.d.ts +1 -2
- package/types/index.d.ts +11 -11
- package/types/onClickHandlerForNonInteractiveElements.d.ts +7 -7
- package/types/scrollingTimer.d.ts +1 -1
- package/cjs/capitalize.js.map +0 -7
- package/cjs/compose.js.map +0 -7
- package/cjs/getComponentFromProps.js.map +0 -7
- package/cjs/hooks/index.js.map +0 -7
- package/cjs/hooks/useCancellableDelayedCallback.js.map +0 -7
- package/cjs/hooks/useDerivedStateFromProps.js.map +0 -7
- package/cjs/hooks/useExecutionTimer.js.map +0 -7
- package/cjs/hooks/useExpandState.js.map +0 -7
- package/cjs/hooks/useHotkeys.js.map +0 -7
- package/cjs/hooks/useHoverHandlersDelay.js.map +0 -7
- package/cjs/hooks/useOnElementResize.js.map +0 -7
- package/cjs/hooks/useParentElement.js.map +0 -7
- package/cjs/hooks/usePrevious.js.map +0 -7
- package/cjs/hooks/useResizeObserver.js.map +0 -7
- package/cjs/hooks/useSetRef.js.map +0 -7
- package/cjs/hooks/useShouldRecalculate.js.map +0 -7
- package/cjs/hooks/useWindowScrollerList.js.map +0 -7
- package/cjs/hooks/useWindowSize.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/onClickHandlerForNonInteractiveElements.js.map +0 -7
- package/cjs/operators.js.map +0 -7
- package/cjs/platform.js.map +0 -7
- package/cjs/reactTypesUtility.js.map +0 -7
- package/cjs/scrollingTimer.js.map +0 -7
- package/cjs/system.js.map +0 -7
- package/cjs/timeUtils.js.map +0 -7
- package/cjs/utils.js.map +0 -7
- package/cjs/validations.js.map +0 -7
- package/esm/capitalize.js.map +0 -7
- package/esm/compose.js.map +0 -7
- package/esm/getComponentFromProps.js.map +0 -7
- package/esm/hooks/index.js.map +0 -7
- package/esm/hooks/useCancellableDelayedCallback.js.map +0 -7
- package/esm/hooks/useDerivedStateFromProps.js.map +0 -7
- package/esm/hooks/useExecutionTimer.js.map +0 -7
- package/esm/hooks/useExpandState.js.map +0 -7
- package/esm/hooks/useHotkeys.js.map +0 -7
- package/esm/hooks/useHoverHandlersDelay.js.map +0 -7
- package/esm/hooks/useOnElementResize.js.map +0 -7
- package/esm/hooks/useParentElement.js.map +0 -7
- package/esm/hooks/usePrevious.js.map +0 -7
- package/esm/hooks/useResizeObserver.js.map +0 -7
- package/esm/hooks/useSetRef.js.map +0 -7
- package/esm/hooks/useShouldRecalculate.js.map +0 -7
- package/esm/hooks/useWindowScrollerList.js.map +0 -7
- package/esm/hooks/useWindowSize.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/onClickHandlerForNonInteractiveElements.js.map +0 -7
- package/esm/operators.js.map +0 -7
- package/esm/platform.js.map +0 -7
- package/esm/reactTypesUtility.js.map +0 -7
- package/esm/scrollingTimer.js.map +0 -7
- package/esm/system.js.map +0 -7
- package/esm/timeUtils.js.map +0 -7
- package/esm/utils.js.map +0 -7
- package/esm/validations.js.map +0 -7
package/cjs/platform.js
CHANGED
|
@@ -1,37 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var platform_exports = {};
|
|
29
|
-
__export(platform_exports, {
|
|
30
|
-
DOCUMENT: () => DOCUMENT,
|
|
31
|
-
WINDOW: () => WINDOW
|
|
32
|
-
});
|
|
33
|
-
var React = __toESM(require("react"));
|
|
34
|
-
const DOCUMENT = typeof document !== "undefined" ? document : null;
|
|
35
|
-
const WINDOW = typeof window !== "undefined" ? window : null;
|
|
36
|
-
module.exports = __toCommonJS(platform_exports);
|
|
37
|
-
//# sourceMappingURL=platform.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const DOCUMENT = typeof document !== 'undefined' ? document : null;
|
|
6
|
+
const WINDOW = typeof window !== 'undefined' ? window : null;
|
|
7
|
+
|
|
8
|
+
exports.DOCUMENT = DOCUMENT;
|
|
9
|
+
exports.WINDOW = WINDOW;
|
package/cjs/reactTypesUtility.js
CHANGED
|
@@ -1,58 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var reactTypesUtility_exports = {};
|
|
29
|
-
__export(reactTypesUtility_exports, {
|
|
30
|
-
isClassComponent: () => isClassComponent,
|
|
31
|
-
isCompositeTypeElement: () => isCompositeTypeElement,
|
|
32
|
-
isDOMTypeElement: () => isDOMTypeElement,
|
|
33
|
-
isElement: () => isElement,
|
|
34
|
-
isFunctionComponent: () => isFunctionComponent,
|
|
35
|
-
isReactComponent: () => isReactComponent
|
|
36
|
-
});
|
|
37
|
-
var React = __toESM(require("react"));
|
|
38
|
-
var import_react = __toESM(require("react"));
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
|
+
|
|
39
11
|
function isClassComponent(component) {
|
|
40
|
-
return !!(typeof component ===
|
|
12
|
+
return !!(typeof component === 'function' && !!component.prototype.isReactComponent);
|
|
41
13
|
}
|
|
42
14
|
function isFunctionComponent(component) {
|
|
43
|
-
return typeof component ===
|
|
15
|
+
return typeof component === 'function' && String(component).includes('return React.createElement');
|
|
44
16
|
}
|
|
45
17
|
function isReactComponent(component) {
|
|
46
18
|
return !!(isClassComponent(component) || isFunctionComponent(component));
|
|
47
19
|
}
|
|
48
20
|
function isElement(element) {
|
|
49
|
-
return
|
|
21
|
+
return /*#__PURE__*/React__default["default"].isValidElement(element);
|
|
50
22
|
}
|
|
51
23
|
function isDOMTypeElement(element) {
|
|
52
|
-
return isElement(element) && typeof element.type ===
|
|
24
|
+
return isElement(element) && typeof element.type === 'string';
|
|
53
25
|
}
|
|
54
26
|
function isCompositeTypeElement(element) {
|
|
55
|
-
return isElement(element) && typeof element.type ===
|
|
27
|
+
return isElement(element) && typeof element.type === 'function';
|
|
56
28
|
}
|
|
57
|
-
|
|
58
|
-
|
|
29
|
+
|
|
30
|
+
exports.isClassComponent = isClassComponent;
|
|
31
|
+
exports.isCompositeTypeElement = isCompositeTypeElement;
|
|
32
|
+
exports.isDOMTypeElement = isDOMTypeElement;
|
|
33
|
+
exports.isElement = isElement;
|
|
34
|
+
exports.isFunctionComponent = isFunctionComponent;
|
|
35
|
+
exports.isReactComponent = isReactComponent;
|
package/cjs/scrollingTimer.js
CHANGED
|
@@ -1,46 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var scrollingTimer_exports = {};
|
|
29
|
-
__export(scrollingTimer_exports, {
|
|
30
|
-
resetTimer: () => resetTimer
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
const resetTimer = (func) => {
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
function resetTimer(func) {
|
|
34
6
|
let timeout;
|
|
35
|
-
return function(
|
|
7
|
+
return function () {
|
|
8
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
9
|
+
args[_key] = arguments[_key];
|
|
10
|
+
}
|
|
11
|
+
|
|
36
12
|
const context = this;
|
|
13
|
+
|
|
37
14
|
const lastCall = () => {
|
|
38
15
|
timeout = null;
|
|
39
16
|
func.apply(context, args);
|
|
40
17
|
};
|
|
18
|
+
|
|
41
19
|
clearTimeout(timeout);
|
|
42
20
|
timeout = setTimeout(lastCall, 300);
|
|
43
21
|
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
exports.resetTimer = resetTimer;
|
package/cjs/system.js
CHANGED
|
@@ -1,51 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var system_exports = {};
|
|
29
|
-
__export(system_exports, {
|
|
30
|
-
logger: () => logger,
|
|
31
|
-
mergeRefs: () => mergeRefs,
|
|
32
|
-
setRef: () => setRef
|
|
33
|
-
});
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_utils = require("./utils");
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
8
|
+
require('@babel/runtime/helpers/defineProperty');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.reduce.js');
|
|
11
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
12
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
14
|
+
var lodash = require('lodash');
|
|
15
|
+
|
|
36
16
|
const setRef = (ref, value) => {
|
|
37
|
-
if (
|
|
17
|
+
if (lodash.isFunction(ref)) {
|
|
38
18
|
ref(value);
|
|
39
19
|
} else if (ref) {
|
|
40
20
|
ref.current = value;
|
|
41
21
|
}
|
|
42
22
|
};
|
|
43
|
-
function mergeRefs(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
23
|
+
function mergeRefs() {
|
|
24
|
+
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
25
|
+
refs[_key] = arguments[_key];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return node => {
|
|
29
|
+
if (!node) return;
|
|
30
|
+
refs.forEach(ref => {
|
|
31
|
+
if (lodash.isFunction(ref)) {
|
|
49
32
|
ref(node);
|
|
50
33
|
} else if (ref) {
|
|
51
34
|
ref.current = node;
|
|
@@ -53,8 +36,8 @@ function mergeRefs(...refs) {
|
|
|
53
36
|
});
|
|
54
37
|
};
|
|
55
38
|
}
|
|
56
|
-
function logger(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
39
|
+
function logger() {}
|
|
40
|
+
|
|
41
|
+
exports.logger = logger;
|
|
42
|
+
exports.mergeRefs = mergeRefs;
|
|
43
|
+
exports.setRef = setRef;
|
package/cjs/timeUtils.js
CHANGED
|
@@ -1,43 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var timeUtils_exports = {};
|
|
29
|
-
__export(timeUtils_exports, {
|
|
30
|
-
addLeadingZeros: () => addLeadingZeros,
|
|
31
|
-
getVisibleTimeByFormat: () => getVisibleTimeByFormat
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.reduce.js');
|
|
9
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
10
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
12
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
14
|
+
var lodash = require('lodash');
|
|
15
|
+
|
|
16
|
+
const getVisibleTimeByFormat = format => ({
|
|
17
|
+
showHours: format.indexOf('H') > -1 || format.indexOf('h') > -1 || format.indexOf('k') > -1,
|
|
18
|
+
showMinutes: format.indexOf('m') > -1,
|
|
19
|
+
showSeconds: format.indexOf('s') > -1,
|
|
20
|
+
use12Hours: format.indexOf('A') > -1 || format.indexOf('h') > -1 || format.indexOf('a') > -1
|
|
32
21
|
});
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
showMinutes: format.indexOf("m") > -1,
|
|
38
|
-
showSeconds: format.indexOf("s") > -1,
|
|
39
|
-
use12Hours: format.indexOf("A") > -1 || format.indexOf("h") > -1 || format.indexOf("a") > -1
|
|
40
|
-
});
|
|
41
|
-
const addLeadingZeros = (count) => (number) => (0, import_utils.padStart)(String(number), count, "0");
|
|
42
|
-
module.exports = __toCommonJS(timeUtils_exports);
|
|
43
|
-
//# sourceMappingURL=timeUtils.js.map
|
|
22
|
+
const addLeadingZeros = count => number => lodash.padStart(String(number), count, '0');
|
|
23
|
+
|
|
24
|
+
exports.addLeadingZeros = addLeadingZeros;
|
|
25
|
+
exports.getVisibleTimeByFormat = getVisibleTimeByFormat;
|