@elliemae/ds-utilities 3.0.0-next.7 → 3.0.0-next.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/capitalize.js +9 -16
- package/dist/cjs/capitalize.js.map +1 -1
- package/dist/cjs/compose.js +9 -16
- package/dist/cjs/compose.js.map +2 -2
- package/dist/cjs/deprecated/deprecatedMsg.js +28 -0
- package/dist/cjs/deprecated/deprecatedMsg.js.map +7 -0
- package/dist/cjs/deprecated/index.js +27 -0
- package/dist/cjs/deprecated/index.js.map +7 -0
- package/dist/cjs/deprecated/reactTypesUtility.js +53 -0
- package/dist/cjs/deprecated/reactTypesUtility.js.map +7 -0
- package/dist/cjs/deprecated/scrollingTimer.js +41 -0
- package/dist/cjs/deprecated/scrollingTimer.js.map +7 -0
- package/dist/cjs/deprecated/useParentElement.js +36 -0
- package/dist/cjs/deprecated/useParentElement.js.map +7 -0
- package/dist/cjs/deprecated/useSetRef.js +37 -0
- package/dist/cjs/deprecated/useSetRef.js.map +7 -0
- package/dist/cjs/deprecated/useUncontrolled.js +33 -0
- package/dist/cjs/deprecated/useUncontrolled.js.map +7 -0
- package/dist/cjs/{hooks → deprecated}/useWindowSize.js +15 -18
- package/dist/cjs/deprecated/useWindowSize.js.map +7 -0
- package/dist/cjs/getComponentFromProps.js +10 -17
- package/dist/cjs/getComponentFromProps.js.map +2 -2
- package/dist/cjs/hooks/index.js +13 -25
- package/dist/cjs/hooks/index.js.map +2 -2
- package/dist/cjs/hooks/useCallbackAfterRender.js +12 -18
- package/dist/cjs/hooks/useCallbackAfterRender.js.map +2 -2
- package/dist/cjs/hooks/useCancellableDelayedCallback.js +9 -16
- package/dist/cjs/hooks/useCancellableDelayedCallback.js.map +2 -2
- package/dist/cjs/hooks/useDerivedStateFromProps.js +9 -16
- package/dist/cjs/hooks/useDerivedStateFromProps.js.map +2 -2
- package/dist/cjs/hooks/useExecutionTimer.js +13 -18
- package/dist/cjs/hooks/useExecutionTimer.js.map +2 -2
- package/dist/cjs/hooks/useExpandState.js +9 -16
- package/dist/cjs/hooks/useExpandState.js.map +2 -2
- package/dist/cjs/hooks/useFocusTrap.js +76 -28
- package/dist/cjs/hooks/useFocusTrap.js.map +2 -2
- package/dist/cjs/hooks/useHotkeys.js +10 -17
- package/dist/cjs/hooks/useHotkeys.js.map +2 -2
- package/dist/cjs/hooks/useHoverHandlersDelay.js +15 -20
- package/dist/cjs/hooks/useHoverHandlersDelay.js.map +2 -2
- package/dist/cjs/hooks/useIsMobile.js +50 -0
- package/dist/cjs/hooks/useIsMobile.js.map +7 -0
- package/dist/cjs/hooks/useIsShowingEllipsis.js +9 -16
- package/dist/cjs/hooks/useIsShowingEllipsis.js.map +1 -1
- package/dist/cjs/hooks/useOnElementResize.js +9 -16
- package/dist/cjs/hooks/useOnElementResize.js.map +1 -1
- package/dist/cjs/hooks/usePrevious.js +9 -16
- package/dist/cjs/hooks/usePrevious.js.map +2 -2
- package/dist/cjs/hooks/useResizeObserver.js +12 -19
- package/dist/cjs/hooks/useResizeObserver.js.map +2 -2
- package/dist/cjs/hooks/useShouldRecalculate.js +9 -16
- package/dist/cjs/hooks/useShouldRecalculate.js.map +2 -2
- package/dist/cjs/hooks/useWindowScrollerList.js +20 -25
- package/dist/cjs/hooks/useWindowScrollerList.js.map +2 -2
- package/dist/cjs/index.js +17 -27
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/objectUtilities.js +46 -0
- package/dist/cjs/objectUtilities.js.map +7 -0
- package/dist/cjs/onClickHandlerForNonInteractiveElements.js +11 -18
- package/dist/cjs/onClickHandlerForNonInteractiveElements.js.map +2 -2
- package/dist/cjs/operators.js +9 -16
- package/dist/cjs/operators.js.map +2 -2
- package/dist/cjs/platform.js +9 -16
- package/dist/cjs/platform.js.map +1 -1
- package/dist/cjs/props-helpers/defaultProps/index.js +22 -0
- package/dist/cjs/props-helpers/defaultProps/index.js.map +7 -0
- package/dist/cjs/props-helpers/defaultProps/useMemoMergePropsWithDefault.js +55 -0
- package/dist/cjs/props-helpers/defaultProps/useMemoMergePropsWithDefault.js.map +7 -0
- package/dist/cjs/props-helpers/getProps/index.js +30 -0
- package/dist/cjs/props-helpers/getProps/index.js.map +7 -0
- package/dist/cjs/props-helpers/globalProps/constants.js +390 -0
- package/dist/cjs/props-helpers/globalProps/constants.js.map +7 -0
- package/dist/cjs/props-helpers/globalProps/getGlobalAttributes.js +45 -0
- package/dist/cjs/props-helpers/globalProps/getGlobalAttributes.js.map +7 -0
- package/dist/cjs/props-helpers/globalProps/globalAttributesPropTypes.js +391 -0
- package/dist/cjs/props-helpers/globalProps/globalAttributesPropTypes.js.map +7 -0
- package/dist/cjs/props-helpers/globalProps/index.js +24 -0
- package/dist/cjs/props-helpers/globalProps/index.js.map +7 -0
- package/dist/cjs/props-helpers/globalProps/useGetGlobalAttributes.js +33 -0
- package/dist/cjs/props-helpers/globalProps/useGetGlobalAttributes.js.map +7 -0
- package/dist/cjs/props-helpers/index.js +28 -0
- package/dist/cjs/props-helpers/index.js.map +7 -0
- package/dist/cjs/props-helpers/propTypes/PropTypes.js +144 -0
- package/dist/cjs/props-helpers/propTypes/PropTypes.js.map +7 -0
- package/dist/cjs/props-helpers/propTypes/customPropTypes.js +31 -0
- package/dist/cjs/props-helpers/propTypes/customPropTypes.js.map +7 -0
- package/dist/cjs/props-helpers/propTypes/describe.js +74 -0
- package/dist/cjs/props-helpers/propTypes/describe.js.map +7 -0
- package/dist/cjs/props-helpers/propTypes/describeConversions.js +89 -0
- package/dist/cjs/props-helpers/propTypes/describeConversions.js.map +7 -0
- package/dist/cjs/props-helpers/propTypes/describeGuards.js +42 -0
- package/dist/cjs/props-helpers/propTypes/describeGuards.js.map +7 -0
- package/dist/cjs/props-helpers/propTypes/index.js +30 -0
- package/dist/cjs/props-helpers/propTypes/index.js.map +7 -0
- package/dist/cjs/props-helpers/propTypes/toTypescript.js +147 -0
- package/dist/cjs/props-helpers/propTypes/toTypescript.js.map +7 -0
- package/dist/cjs/props-helpers/propTypes/types.js +20 -0
- package/dist/cjs/props-helpers/propTypes/types.js.map +7 -0
- package/dist/cjs/props-helpers/tests/globalProps/TestComponent.js +47 -0
- package/dist/cjs/props-helpers/tests/globalProps/TestComponent.js.map +7 -0
- package/dist/cjs/props-helpers/tests/validation/test.schema.js +62 -0
- package/dist/cjs/props-helpers/tests/validation/test.schema.js.map +7 -0
- package/dist/cjs/props-helpers/tests/xstyledProps/TestComponent.js +53 -0
- package/dist/cjs/props-helpers/tests/xstyledProps/TestComponent.js.map +7 -0
- package/dist/cjs/props-helpers/useDeprecateComponent/index.js +33 -0
- package/dist/cjs/props-helpers/useDeprecateComponent/index.js.map +7 -0
- package/dist/cjs/props-helpers/validation/errorTemplates.js +41 -0
- package/dist/cjs/props-helpers/validation/errorTemplates.js.map +7 -0
- package/dist/cjs/props-helpers/validation/index.js +23 -0
- package/dist/cjs/props-helpers/validation/index.js.map +7 -0
- package/dist/cjs/props-helpers/validation/typescriptGuards.js +76 -0
- package/dist/cjs/props-helpers/validation/typescriptGuards.js.map +7 -0
- package/dist/cjs/props-helpers/validation/typescriptParsers.js +69 -0
- package/dist/cjs/props-helpers/validation/typescriptParsers.js.map +7 -0
- package/dist/cjs/props-helpers/validation/typescriptValidator.js +170 -0
- package/dist/cjs/props-helpers/validation/typescriptValidator.js.map +7 -0
- package/dist/cjs/props-helpers/xstyledProps/constants.js +81 -0
- package/dist/cjs/props-helpers/xstyledProps/constants.js.map +7 -0
- package/dist/cjs/props-helpers/xstyledProps/index.js +23 -0
- package/dist/cjs/props-helpers/xstyledProps/index.js.map +7 -0
- package/dist/cjs/props-helpers/xstyledProps/useGetXstyledProps.js +41 -0
- package/dist/cjs/props-helpers/xstyledProps/useGetXstyledProps.js.map +7 -0
- package/dist/cjs/props-helpers/xstyledProps/xstyledPropTypes.js +94 -0
- package/dist/cjs/props-helpers/xstyledProps/xstyledPropTypes.js.map +7 -0
- package/dist/cjs/reactTypesUtility.js +12 -40
- package/dist/cjs/reactTypesUtility.js.map +2 -2
- package/dist/cjs/system.js +14 -26
- package/dist/cjs/system.js.map +2 -2
- package/dist/cjs/timeUtils.js +9 -16
- package/dist/cjs/timeUtils.js.map +2 -2
- package/dist/cjs/utils.js +15 -19
- package/dist/cjs/utils.js.map +2 -2
- package/dist/cjs/validations.js +13 -22
- package/dist/cjs/validations.js.map +2 -2
- package/dist/esm/capitalize.js.map +1 -1
- package/dist/esm/compose.js.map +2 -2
- package/dist/esm/deprecated/deprecatedMsg.js +6 -0
- package/dist/esm/deprecated/deprecatedMsg.js.map +7 -0
- package/dist/esm/deprecated/index.js +8 -0
- package/dist/esm/deprecated/index.js.map +7 -0
- package/dist/esm/deprecated/reactTypesUtility.js +31 -0
- package/dist/esm/deprecated/reactTypesUtility.js.map +7 -0
- package/dist/esm/{scrollingTimer.js → deprecated/scrollingTimer.js} +5 -3
- package/dist/esm/deprecated/scrollingTimer.js.map +7 -0
- package/dist/esm/{hooks → deprecated}/useParentElement.js +0 -0
- package/dist/esm/deprecated/useParentElement.js.map +7 -0
- package/dist/esm/{hooks → deprecated}/useSetRef.js +2 -0
- package/dist/esm/deprecated/useSetRef.js.map +7 -0
- package/dist/esm/deprecated/useUncontrolled.js +11 -0
- package/dist/esm/deprecated/useUncontrolled.js.map +7 -0
- package/dist/esm/{hooks → deprecated}/useWindowSize.js +6 -2
- package/dist/esm/deprecated/useWindowSize.js.map +7 -0
- package/dist/esm/getComponentFromProps.js +1 -1
- package/dist/esm/getComponentFromProps.js.map +2 -2
- package/dist/esm/hooks/index.js +5 -10
- package/dist/esm/hooks/index.js.map +2 -2
- package/dist/esm/hooks/useCallbackAfterRender.js +4 -3
- package/dist/esm/hooks/useCallbackAfterRender.js.map +2 -2
- package/dist/esm/hooks/useCancellableDelayedCallback.js.map +2 -2
- package/dist/esm/hooks/useDerivedStateFromProps.js.map +2 -2
- package/dist/esm/hooks/useExecutionTimer.js +4 -2
- package/dist/esm/hooks/useExecutionTimer.js.map +2 -2
- package/dist/esm/hooks/useExpandState.js.map +2 -2
- package/dist/esm/hooks/useFocusTrap.js +68 -13
- package/dist/esm/hooks/useFocusTrap.js.map +2 -2
- package/dist/esm/hooks/useHotkeys.js +1 -1
- package/dist/esm/hooks/useHotkeys.js.map +2 -2
- package/dist/esm/hooks/useHoverHandlersDelay.js +6 -4
- package/dist/esm/hooks/useHoverHandlersDelay.js.map +2 -2
- package/dist/esm/hooks/useIsMobile.js +28 -0
- package/dist/esm/hooks/useIsMobile.js.map +7 -0
- package/dist/esm/hooks/useIsShowingEllipsis.js.map +1 -1
- package/dist/esm/hooks/useOnElementResize.js.map +1 -1
- package/dist/esm/hooks/usePrevious.js.map +2 -2
- package/dist/esm/hooks/useResizeObserver.js +4 -4
- package/dist/esm/hooks/useResizeObserver.js.map +2 -2
- package/dist/esm/hooks/useShouldRecalculate.js.map +2 -2
- package/dist/esm/hooks/useWindowScrollerList.js +12 -10
- package/dist/esm/hooks/useWindowScrollerList.js.map +2 -2
- package/dist/esm/index.js +11 -24
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/objectUtilities.js +24 -0
- package/dist/esm/objectUtilities.js.map +7 -0
- package/dist/esm/onClickHandlerForNonInteractiveElements.js +2 -2
- package/dist/esm/onClickHandlerForNonInteractiveElements.js.map +2 -2
- package/dist/esm/operators.js.map +2 -2
- package/dist/esm/props-helpers/defaultProps/index.js +3 -0
- package/dist/esm/props-helpers/defaultProps/index.js.map +7 -0
- package/dist/esm/props-helpers/defaultProps/useMemoMergePropsWithDefault.js +35 -0
- package/dist/esm/props-helpers/defaultProps/useMemoMergePropsWithDefault.js.map +7 -0
- package/dist/esm/props-helpers/getProps/index.js +8 -0
- package/dist/esm/props-helpers/getProps/index.js.map +7 -0
- package/dist/esm/props-helpers/globalProps/constants.js +368 -0
- package/dist/esm/props-helpers/globalProps/constants.js.map +7 -0
- package/dist/esm/props-helpers/globalProps/getGlobalAttributes.js +23 -0
- package/dist/esm/props-helpers/globalProps/getGlobalAttributes.js.map +7 -0
- package/dist/esm/props-helpers/globalProps/globalAttributesPropTypes.js +369 -0
- package/dist/esm/props-helpers/globalProps/globalAttributesPropTypes.js.map +7 -0
- package/dist/esm/props-helpers/globalProps/index.js +5 -0
- package/dist/esm/props-helpers/globalProps/index.js.map +7 -0
- package/dist/esm/props-helpers/globalProps/useGetGlobalAttributes.js +11 -0
- package/dist/esm/props-helpers/globalProps/useGetGlobalAttributes.js.map +7 -0
- package/dist/esm/props-helpers/index.js +9 -0
- package/dist/esm/props-helpers/index.js.map +7 -0
- package/dist/esm/props-helpers/propTypes/PropTypes.js +124 -0
- package/dist/esm/props-helpers/propTypes/PropTypes.js.map +7 -0
- package/dist/esm/props-helpers/propTypes/customPropTypes.js +9 -0
- package/dist/esm/props-helpers/propTypes/customPropTypes.js.map +7 -0
- package/dist/esm/props-helpers/propTypes/describe.js +52 -0
- package/dist/esm/props-helpers/propTypes/describe.js.map +7 -0
- package/dist/esm/props-helpers/propTypes/describeConversions.js +76 -0
- package/dist/esm/props-helpers/propTypes/describeConversions.js.map +7 -0
- package/dist/esm/props-helpers/propTypes/describeGuards.js +20 -0
- package/dist/esm/props-helpers/propTypes/describeGuards.js.map +7 -0
- package/dist/esm/props-helpers/propTypes/index.js +8 -0
- package/dist/esm/props-helpers/propTypes/index.js.map +7 -0
- package/dist/esm/props-helpers/propTypes/toTypescript.js +127 -0
- package/dist/esm/props-helpers/propTypes/toTypescript.js.map +7 -0
- package/dist/esm/props-helpers/propTypes/types.js +2 -0
- package/dist/esm/props-helpers/propTypes/types.js.map +7 -0
- package/dist/esm/props-helpers/tests/globalProps/TestComponent.js +27 -0
- package/dist/esm/props-helpers/tests/globalProps/TestComponent.js.map +7 -0
- package/dist/esm/props-helpers/tests/validation/test.schema.js +40 -0
- package/dist/esm/props-helpers/tests/validation/test.schema.js.map +7 -0
- package/dist/esm/props-helpers/tests/xstyledProps/TestComponent.js +33 -0
- package/dist/esm/props-helpers/tests/xstyledProps/TestComponent.js.map +7 -0
- package/dist/esm/props-helpers/useDeprecateComponent/index.js +11 -0
- package/dist/esm/props-helpers/useDeprecateComponent/index.js.map +7 -0
- package/dist/esm/props-helpers/validation/errorTemplates.js +19 -0
- package/dist/esm/props-helpers/validation/errorTemplates.js.map +7 -0
- package/dist/esm/props-helpers/validation/index.js +4 -0
- package/dist/esm/props-helpers/validation/index.js.map +7 -0
- package/dist/esm/props-helpers/validation/typescriptGuards.js +54 -0
- package/dist/esm/props-helpers/validation/typescriptGuards.js.map +7 -0
- package/dist/esm/props-helpers/validation/typescriptParsers.js +47 -0
- package/dist/esm/props-helpers/validation/typescriptParsers.js.map +7 -0
- package/dist/esm/props-helpers/validation/typescriptValidator.js +159 -0
- package/dist/esm/props-helpers/validation/typescriptValidator.js.map +7 -0
- package/dist/esm/props-helpers/xstyledProps/constants.js +59 -0
- package/dist/esm/props-helpers/xstyledProps/constants.js.map +7 -0
- package/dist/esm/props-helpers/xstyledProps/index.js +4 -0
- package/dist/esm/props-helpers/xstyledProps/index.js.map +7 -0
- package/dist/esm/props-helpers/xstyledProps/useGetXstyledProps.js +19 -0
- package/dist/esm/props-helpers/xstyledProps/useGetXstyledProps.js.map +7 -0
- package/dist/esm/props-helpers/xstyledProps/xstyledPropTypes.js +72 -0
- package/dist/esm/props-helpers/xstyledProps/xstyledPropTypes.js.map +7 -0
- package/dist/esm/reactTypesUtility.js +3 -24
- package/dist/esm/reactTypesUtility.js.map +2 -2
- package/dist/esm/system.js +5 -10
- package/dist/esm/system.js.map +2 -2
- package/dist/esm/timeUtils.js.map +2 -2
- package/dist/esm/utils.js +6 -3
- package/dist/esm/utils.js.map +2 -2
- package/dist/esm/validations.js +4 -6
- package/dist/esm/validations.js.map +2 -2
- package/package.json +10 -9
- package/dist/cjs/hooks/useParentElement.js +0 -43
- package/dist/cjs/hooks/useParentElement.js.map +0 -7
- package/dist/cjs/hooks/useSetRef.js +0 -42
- package/dist/cjs/hooks/useSetRef.js.map +0 -7
- package/dist/cjs/hooks/useWindowSize.js.map +0 -7
- package/dist/cjs/scrollingTimer.js +0 -46
- package/dist/cjs/scrollingTimer.js.map +0 -7
- package/dist/esm/hooks/useParentElement.js.map +0 -7
- package/dist/esm/hooks/useSetRef.js.map +0 -7
- package/dist/esm/hooks/useWindowSize.js.map +0 -7
- package/dist/esm/scrollingTimer.js.map +0 -7
package/dist/cjs/system.js
CHANGED
|
@@ -4,33 +4,27 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
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);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var system_exports = {};
|
|
29
22
|
__export(system_exports, {
|
|
30
23
|
logger: () => logger,
|
|
31
24
|
mergeRefs: () => mergeRefs,
|
|
32
25
|
setRef: () => setRef
|
|
33
26
|
});
|
|
27
|
+
module.exports = __toCommonJS(system_exports);
|
|
34
28
|
var React = __toESM(require("react"));
|
|
35
29
|
var import_utils = require("./utils");
|
|
36
30
|
const setRef = (ref, value) => {
|
|
@@ -40,21 +34,15 @@ const setRef = (ref, value) => {
|
|
|
40
34
|
ref.current = value;
|
|
41
35
|
}
|
|
42
36
|
};
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
const mergeRefs = (...refs) => {
|
|
38
|
+
const mergeRefsFunc = (node) => {
|
|
45
39
|
if (!node)
|
|
46
40
|
return;
|
|
47
|
-
refs.forEach((ref) =>
|
|
48
|
-
if ((0, import_utils.isFunction)(ref)) {
|
|
49
|
-
ref(node);
|
|
50
|
-
} else if (ref) {
|
|
51
|
-
ref.current = node;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
41
|
+
refs.forEach((ref) => setRef(ref, node));
|
|
54
42
|
};
|
|
55
|
-
|
|
43
|
+
return mergeRefsFunc;
|
|
44
|
+
};
|
|
56
45
|
function logger(...args) {
|
|
57
46
|
console.log(...args);
|
|
58
47
|
}
|
|
59
|
-
module.exports = __toCommonJS(system_exports);
|
|
60
48
|
//# sourceMappingURL=system.js.map
|
package/dist/cjs/system.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/system.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { isFunction } from './utils';\n\nexport const setRef = (ref
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { isFunction } from './utils';\n\ntype AnyRef<T extends HTMLElement> = React.MutableRefObject<T> | ((_ref: T) => void);\n\nexport const setRef = <T extends HTMLElement>(ref: AnyRef<T>, value: T) => {\n if (isFunction(ref)) {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n};\n\nexport const mergeRefs = <T extends HTMLElement>(...refs: AnyRef<T>[]) => {\n const mergeRefsFunc = (node: T) => {\n if (!node) return;\n refs.forEach((ref) => setRef(ref, node));\n };\n return mergeRefsFunc;\n};\n\nexport function logger(...args: unknown[]) {\n // eslint-disable-next-line no-console\n console.log(...args);\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA2B;AAIpB,MAAM,SAAS,CAAwB,KAAgB,UAAa;AACzE,MAAI,6BAAW,GAAG,GAAG;AACnB,QAAI,KAAK;AAAA,EACX,WAAW,KAAK;AACd,QAAI,UAAU;AAAA,EAChB;AACF;AAEO,MAAM,YAAY,IAA2B,SAAsB;AACxE,QAAM,gBAAgB,CAAC,SAAY;AACjC,QAAI,CAAC;AAAM;AACX,SAAK,QAAQ,CAAC,QAAQ,OAAO,KAAK,IAAI,CAAC;AAAA,EACzC;AACA,SAAO;AACT;AAEO,mBAAmB,MAAiB;AAEzC,UAAQ,IAAI,GAAG,IAAI;AACrB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/timeUtils.js
CHANGED
|
@@ -4,32 +4,26 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
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);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var timeUtils_exports = {};
|
|
29
22
|
__export(timeUtils_exports, {
|
|
30
23
|
addLeadingZeros: () => addLeadingZeros,
|
|
31
24
|
getVisibleTimeByFormat: () => getVisibleTimeByFormat
|
|
32
25
|
});
|
|
26
|
+
module.exports = __toCommonJS(timeUtils_exports);
|
|
33
27
|
var React = __toESM(require("react"));
|
|
34
28
|
var import_utils = require("./utils");
|
|
35
29
|
const getVisibleTimeByFormat = (format) => ({
|
|
@@ -39,5 +33,4 @@ const getVisibleTimeByFormat = (format) => ({
|
|
|
39
33
|
use12Hours: format.indexOf("A") > -1 || format.indexOf("h") > -1 || format.indexOf("a") > -1
|
|
40
34
|
});
|
|
41
35
|
const addLeadingZeros = (count) => (number) => (0, import_utils.padStart)(String(number), count, "0");
|
|
42
|
-
module.exports = __toCommonJS(timeUtils_exports);
|
|
43
36
|
//# sourceMappingURL=timeUtils.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/timeUtils.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { padStart } from './utils';\n\nexport const getVisibleTimeByFormat = format => ({\n showHours
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { padStart } from './utils';\n\nexport const getVisibleTimeByFormat = (format: string) => ({\n showHours: format.indexOf('H') > -1 || format.indexOf('h') > -1 || format.indexOf('k') > -1,\n showMinutes: format.indexOf('m') > -1,\n showSeconds: format.indexOf('s') > -1,\n use12Hours: format.indexOf('A') > -1 || format.indexOf('h') > -1 || format.indexOf('a') > -1,\n});\n\nexport const addLeadingZeros = (count: number) => (number: number) => padStart(String(number), count, '0');\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAyB;AAElB,MAAM,yBAAyB,CAAC,WAAoB;AAAA,EACzD,WAAW,OAAO,QAAQ,GAAG,IAAI,MAAM,OAAO,QAAQ,GAAG,IAAI,MAAM,OAAO,QAAQ,GAAG,IAAI;AAAA,EACzF,aAAa,OAAO,QAAQ,GAAG,IAAI;AAAA,EACnC,aAAa,OAAO,QAAQ,GAAG,IAAI;AAAA,EACnC,YAAY,OAAO,QAAQ,GAAG,IAAI,MAAM,OAAO,QAAQ,GAAG,IAAI,MAAM,OAAO,QAAQ,GAAG,IAAI;AAC5F;AAEO,MAAM,kBAAkB,CAAC,UAAkB,CAAC,WAAmB,2BAAS,OAAO,MAAM,GAAG,OAAO,GAAG;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/utils.js
CHANGED
|
@@ -21,27 +21,20 @@ var __spreadValues = (a, b) => {
|
|
|
21
21
|
return a;
|
|
22
22
|
};
|
|
23
23
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
25
24
|
var __export = (target, all) => {
|
|
26
25
|
for (var name in all)
|
|
27
26
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
28
27
|
};
|
|
29
|
-
var
|
|
30
|
-
if (
|
|
31
|
-
for (let key of __getOwnPropNames(
|
|
32
|
-
if (!__hasOwnProp.call(
|
|
33
|
-
__defProp(
|
|
28
|
+
var __copyProps = (to, from, except, desc) => {
|
|
29
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
+
for (let key of __getOwnPropNames(from))
|
|
31
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
32
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
34
33
|
}
|
|
35
|
-
return
|
|
34
|
+
return to;
|
|
36
35
|
};
|
|
37
|
-
var __toESM = (
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
41
|
-
return (module2, temp) => {
|
|
42
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
43
|
-
};
|
|
44
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
36
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
37
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
45
38
|
var utils_exports = {};
|
|
46
39
|
__export(utils_exports, {
|
|
47
40
|
addOrRemove: () => addOrRemove,
|
|
@@ -92,6 +85,7 @@ __export(utils_exports, {
|
|
|
92
85
|
uniqBy: () => import_lodash.uniqBy,
|
|
93
86
|
values: () => import_lodash.values
|
|
94
87
|
});
|
|
88
|
+
module.exports = __toCommonJS(utils_exports);
|
|
95
89
|
var React = __toESM(require("react"));
|
|
96
90
|
var import_lodash = require("lodash");
|
|
97
91
|
const cx = (...classnames) => classnames.reduce((result, cn) => `${result} ${cn || ""}`, "");
|
|
@@ -124,9 +118,12 @@ function runAll(...fns) {
|
|
|
124
118
|
});
|
|
125
119
|
}
|
|
126
120
|
function hashArray(arr, fieldName) {
|
|
127
|
-
return arr.reduce((result, item) =>
|
|
128
|
-
|
|
129
|
-
|
|
121
|
+
return arr.reduce((result, item) => {
|
|
122
|
+
const newKey = fieldName && typeof item === "object" ? item[fieldName] : item;
|
|
123
|
+
return __spreadProps(__spreadValues({}, result), {
|
|
124
|
+
[newKey]: true
|
|
125
|
+
});
|
|
126
|
+
}, {});
|
|
130
127
|
}
|
|
131
128
|
function safeCall(fun, ...args) {
|
|
132
129
|
if ((0, import_lodash.isFunction)(fun)) {
|
|
@@ -139,5 +136,4 @@ const removeUndefinedProperties = (obj) => {
|
|
|
139
136
|
return cleanObject;
|
|
140
137
|
};
|
|
141
138
|
var utils_default = {};
|
|
142
|
-
module.exports = __toCommonJS(utils_exports);
|
|
143
139
|
//# sourceMappingURL=utils.js.map
|
package/dist/cjs/utils.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable no-param-reassign */\n/* eslint-disable max-lines */\n/**\n * commonly used functions\n * Add a level of indirection to lodash so we can replace\n * it if desired, while keeping function names the same\n */\n// TODO: Import individual packages vs referencing all of lodash\nimport {\n cloneDeep,\n filter,\n debounce,\n findIndex,\n isEmpty,\n isString,\n isEqual,\n noop,\n omit,\n orderBy,\n pull,\n sumBy,\n maxBy,\n meanBy,\n sortBy,\n transform,\n isFunction,\n uniq,\n uniqBy,\n groupBy,\n property,\n get,\n set,\n range,\n parseInt,\n padStart,\n isNaN,\n values,\n throttle,\n pick,\n pickBy,\n differenceBy,\n differenceWith,\n isEqualWith,\n curry,\n isObject,\n isBoolean,\n} from 'lodash';\n\n/**\n * Concatenates classNames from arguments\n *\n * @param {...any} classnames\n */\nexport const cx = (...classnames) => classnames.reduce((result, cn) => `${result} ${cn || ''}`, '');\n\n// if entry exists, remove it, if not, add it\nconst toggleInObject = (obj, key, value)
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable no-param-reassign */\n/* eslint-disable max-lines */\n/**\n * commonly used functions\n * Add a level of indirection to lodash so we can replace\n * it if desired, while keeping function names the same\n */\n// TODO: Import individual packages vs referencing all of lodash\nimport {\n cloneDeep,\n filter,\n debounce,\n findIndex,\n isEmpty,\n isString,\n isEqual,\n noop,\n omit,\n orderBy,\n pull,\n sumBy,\n maxBy,\n meanBy,\n sortBy,\n transform,\n isFunction,\n uniq,\n uniqBy,\n groupBy,\n property,\n get,\n set,\n range,\n parseInt,\n padStart,\n isNaN,\n values,\n throttle,\n pick,\n pickBy,\n differenceBy,\n differenceWith,\n isEqualWith,\n curry,\n isObject,\n isBoolean,\n} from 'lodash';\n\ntype UnknownFunctionT = (...args: unknown[]) => unknown;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype ValidKeys = string | number | symbol;\n\n/**\n * Concatenates classNames from arguments\n *\n * @param {...any} classnames classnames you want to join\n * @returns {string} All classnames string concatenated\n */\nexport const cx = (...classnames: string[]): string => classnames.reduce((result, cn) => `${result} ${cn || ''}`, '');\n\n// if entry exists, remove it, if not, add it\nconst toggleInObject = (obj: Record<string, unknown>, key: string, value: unknown) =>\n obj[key] !== undefined ? omit(obj, [key]) : { ...obj, [key]: value };\n\nconst toggleInArray = (array: unknown[], value: unknown) => (array.indexOf(value) === -1 ? [value] : []);\n\nconst arrayMoveMutate = (array: unknown[], from: number, to: number) => {\n array.splice(to < 0 ? array.length + to : to, 0, array.splice(from, 1)[0]);\n};\n\nconst arrayMove = <T,>(array: T[], from: number, to: number): T[] => {\n array = array.slice();\n arrayMoveMutate(array, from, to);\n return array;\n};\n\nconst accessorDefault = <T,>(item: T): T => item;\n\nconst addOrRemove = <T,>(array: T[], item: T, accessor = accessorDefault): T[] => {\n const index = array.findIndex((iItem) => accessor(iItem) === accessor(item));\n\n if (index !== -1) {\n const nextArray = cloneDeep(array);\n nextArray.splice(index, 1);\n return nextArray;\n }\n\n return [...array, item];\n};\n\nexport function runAll(...fns: (UnknownFunctionT | UnknownFunctionT[])[]) {\n return (...args: unknown[]) =>\n fns.forEach((fn) => {\n if (Array.isArray(fn)) runAll(fn);\n if (isFunction(fn)) fn(...args);\n });\n}\n\nexport function hashArray(arr: (ValidKeys | Record<string, ValidKeys>)[], fieldName?: string) {\n return arr.reduce<Record<ValidKeys, boolean>>((result, item) => {\n const newKey: ValidKeys = fieldName && typeof item === 'object' ? item[fieldName] : (item as ValidKeys);\n return {\n ...result,\n [newKey]: true,\n };\n }, {});\n}\n\nexport function safeCall(fun: unknown, ...args: unknown[]) {\n if (isFunction(fun)) {\n fun(...args);\n }\n}\n\nexport const removeUndefinedProperties = (obj: Record<string, unknown>) => {\n const cleanObject = { ...obj };\n Object.keys(obj).forEach((key) => cleanObject[key] === undefined && delete cleanObject[key]);\n return cleanObject;\n};\n\nexport default {};\nexport {\n isObject,\n curry,\n arrayMove,\n uniq,\n filter,\n uniqBy,\n groupBy,\n property,\n get,\n set,\n cloneDeep,\n debounce,\n findIndex,\n isEmpty,\n isString,\n isEqual,\n maxBy,\n meanBy,\n noop,\n omit,\n orderBy,\n pull,\n sortBy,\n sumBy,\n transform,\n isFunction,\n range,\n parseInt,\n padStart,\n isNaN,\n values,\n throttle,\n toggleInObject,\n toggleInArray,\n pick,\n pickBy,\n differenceBy,\n differenceWith,\n addOrRemove,\n isEqualWith,\n isBoolean,\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADQvB,oBAsCO;AAYA,MAAM,KAAK,IAAI,eAAiC,WAAW,OAAO,CAAC,QAAQ,OAAO,GAAG,UAAU,MAAM,MAAM,EAAE;AAGpH,MAAM,iBAAiB,CAAC,KAA8B,KAAa,UACjE,IAAI,SAAS,SAAY,wBAAK,KAAK,CAAC,GAAG,CAAC,IAAI,iCAAK,MAAL,GAAW,MAAM,MAAM;AAErE,MAAM,gBAAgB,CAAC,OAAkB,UAAoB,MAAM,QAAQ,KAAK,MAAM,KAAK,CAAC,KAAK,IAAI,CAAC;AAEtG,MAAM,kBAAkB,CAAC,OAAkB,MAAc,OAAe;AACtE,QAAM,OAAO,KAAK,IAAI,MAAM,SAAS,KAAK,IAAI,GAAG,MAAM,OAAO,MAAM,CAAC,EAAE,EAAE;AAC3E;AAEA,MAAM,YAAY,CAAK,OAAY,MAAc,OAAoB;AACnE,UAAQ,MAAM,MAAM;AACpB,kBAAgB,OAAO,MAAM,EAAE;AAC/B,SAAO;AACT;AAEA,MAAM,kBAAkB,CAAK,SAAe;AAE5C,MAAM,cAAc,CAAK,OAAY,MAAS,WAAW,oBAAyB;AAChF,QAAM,QAAQ,MAAM,UAAU,CAAC,UAAU,SAAS,KAAK,MAAM,SAAS,IAAI,CAAC;AAE3E,MAAI,UAAU,IAAI;AAChB,UAAM,YAAY,6BAAU,KAAK;AACjC,cAAU,OAAO,OAAO,CAAC;AACzB,WAAO;AAAA,EACT;AAEA,SAAO,CAAC,GAAG,OAAO,IAAI;AACxB;AAEO,mBAAmB,KAAgD;AACxE,SAAO,IAAI,SACT,IAAI,QAAQ,CAAC,OAAO;AAClB,QAAI,MAAM,QAAQ,EAAE;AAAG,aAAO,EAAE;AAChC,QAAI,8BAAW,EAAE;AAAG,SAAG,GAAG,IAAI;AAAA,EAChC,CAAC;AACL;AAEO,mBAAmB,KAAgD,WAAoB;AAC5F,SAAO,IAAI,OAAmC,CAAC,QAAQ,SAAS;AAC9D,UAAM,SAAoB,aAAa,OAAO,SAAS,WAAW,KAAK,aAAc;AACrF,WAAO,iCACF,SADE;AAAA,OAEJ,SAAS;AAAA,IACZ;AAAA,EACF,GAAG,CAAC,CAAC;AACP;AAEO,kBAAkB,QAAiB,MAAiB;AACzD,MAAI,8BAAW,GAAG,GAAG;AACnB,QAAI,GAAG,IAAI;AAAA,EACb;AACF;AAEO,MAAM,4BAA4B,CAAC,QAAiC;AACzE,QAAM,cAAc,mBAAK;AACzB,SAAO,KAAK,GAAG,EAAE,QAAQ,CAAC,QAAQ,YAAY,SAAS,UAAa,OAAO,YAAY,IAAI;AAC3F,SAAO;AACT;AAEA,IAAO,gBAAQ,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/validations.js
CHANGED
|
@@ -4,33 +4,27 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
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);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var validations_exports = {};
|
|
29
22
|
__export(validations_exports, {
|
|
30
23
|
isGreaterThan: () => isGreaterThan,
|
|
31
24
|
isRequired: () => isRequired,
|
|
32
25
|
isValidDate: () => isValidDate
|
|
33
26
|
});
|
|
27
|
+
module.exports = __toCommonJS(validations_exports);
|
|
34
28
|
var React = __toESM(require("react"));
|
|
35
29
|
var import_operators = require("./operators");
|
|
36
30
|
const isRequired = ({ value, help = "Field is Required" }) => ({
|
|
@@ -38,20 +32,17 @@ const isRequired = ({ value, help = "Field is Required" }) => ({
|
|
|
38
32
|
error: (0, import_operators.checkNotEmpty)(value)
|
|
39
33
|
});
|
|
40
34
|
const isGreaterThan = ({ value, help, comparator = 0 }) => {
|
|
41
|
-
|
|
42
|
-
help = `Max value ${comparator}`;
|
|
35
|
+
const helpMessage = help ?? `Max value ${comparator}`;
|
|
43
36
|
return {
|
|
44
|
-
payload:
|
|
37
|
+
payload: helpMessage,
|
|
45
38
|
error: (0, import_operators.greaterThan)(value, comparator)
|
|
46
39
|
};
|
|
47
40
|
};
|
|
48
41
|
const isValidDate = ({ value, help, format = "MM/DD/AAA" }) => {
|
|
49
|
-
|
|
50
|
-
help = `Valid Date is required ${format}`;
|
|
42
|
+
const helpMessage = help ?? `Valid Date is required ${format}`;
|
|
51
43
|
return {
|
|
52
|
-
payload:
|
|
44
|
+
payload: helpMessage,
|
|
53
45
|
error: !(0, import_operators.validDate)(value)
|
|
54
46
|
};
|
|
55
47
|
};
|
|
56
|
-
module.exports = __toCommonJS(validations_exports);
|
|
57
48
|
//# sourceMappingURL=validations.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/validations.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { checkNotEmpty, greaterThan, validDate } from './operators';\n\nexport const isRequired = ({ value, help = 'Field is Required' }) => ({\n payload: help,\n error: checkNotEmpty(value),\n});\n\nexport const isGreaterThan = ({ value, help, comparator = 0 }) => {\n
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { checkNotEmpty, greaterThan, validDate } from './operators';\n\ninterface IsRequiredArg {\n value: unknown;\n help?: string;\n}\n\ninterface IsGreaterThanArg {\n value: number;\n help?: string;\n comparator?: number;\n}\n\ninterface IsValidDateArg {\n value: string;\n help?: string;\n format?: string;\n}\n\nexport const isRequired = ({ value, help = 'Field is Required' }: IsRequiredArg) => ({\n payload: help,\n error: checkNotEmpty(value),\n});\n\nexport const isGreaterThan = ({ value, help, comparator = 0 }: IsGreaterThanArg) => {\n const helpMessage = help ?? `Max value ${comparator}`;\n return {\n payload: helpMessage,\n error: greaterThan(value, comparator),\n };\n};\n\nexport const isValidDate = ({ value, help, format = 'MM/DD/AAA' }: IsValidDateArg) => {\n const helpMessage = help ?? `Valid Date is required ${format}`;\n return {\n payload: helpMessage,\n error: !validDate(value),\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAsD;AAmB/C,MAAM,aAAa,CAAC,EAAE,OAAO,OAAO,0BAA0C;AAAA,EACnF,SAAS;AAAA,EACT,OAAO,oCAAc,KAAK;AAC5B;AAEO,MAAM,gBAAgB,CAAC,EAAE,OAAO,MAAM,aAAa,QAA0B;AAClF,QAAM,cAAc,QAAQ,aAAa;AACzC,SAAO;AAAA,IACL,SAAS;AAAA,IACT,OAAO,kCAAY,OAAO,UAAU;AAAA,EACtC;AACF;AAEO,MAAM,cAAc,CAAC,EAAE,OAAO,MAAM,SAAS,kBAAkC;AACpF,QAAM,cAAc,QAAQ,0BAA0B;AACtD,SAAO;AAAA,IACL,SAAS;AAAA,IACT,OAAO,CAAC,gCAAU,KAAK;AAAA,EACzB;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/capitalize.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const capitalize = (string: string): string => string.charAt(0).toUpperCase() + string.slice(1);\n"],
|
|
5
|
-
"mappings": "AAAA;ACAO,MAAM,aAAa,CAAC,WAA2B,OAAO,OAAO,
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,aAAa,CAAC,WAA2B,OAAO,OAAO,CAAC,EAAE,YAAY,IAAI,OAAO,MAAM,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/compose.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/compose.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function. [From redux v4.0.5]\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\n\nexport const compose = (...funcs) => {\n if (funcs.length === 0) {\n return (arg) => arg;\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce((a, b)
|
|
5
|
-
"mappings": "AAAA;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function. [From redux v4.0.5]\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\n\ntype UnknownFunctionT = (...args: unknown[]) => unknown;\n\nexport const compose = (...funcs: UnknownFunctionT[]): UnknownFunctionT => {\n if (funcs.length === 0) {\n return (arg) => arg;\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(\n (a, b) =>\n (...args) =>\n a(b(...args)),\n );\n};\n\nexport default compose;\n"],
|
|
5
|
+
"mappings": "AAAA;ACaO,MAAM,UAAU,IAAI,UAAgD;AACzE,MAAI,MAAM,WAAW,GAAG;AACtB,WAAO,CAAC,QAAQ;AAAA,EAClB;AAEA,MAAI,MAAM,WAAW,GAAG;AACtB,WAAO,MAAM;AAAA,EACf;AAEA,SAAO,MAAM,OACX,CAAC,GAAG,MACF,IAAI,SACF,EAAE,EAAE,GAAG,IAAI,CAAC,CAClB;AACF;AAEA,IAAO,kBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/deprecatedMsg.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const deprecatedMsg = 'is going to be deprecated, please consider removing it from your project';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,gBAAgB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export * from "./reactTypesUtility";
|
|
3
|
+
export * from "./scrollingTimer";
|
|
4
|
+
export * from "./useParentElement";
|
|
5
|
+
export * from "./useSetRef";
|
|
6
|
+
export * from "./useUncontrolled";
|
|
7
|
+
export * from "./useWindowSize";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/index.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './reactTypesUtility';\nexport * from './scrollingTimer';\nexport * from './useParentElement';\nexport * from './useSetRef';\nexport * from './useUncontrolled';\nexport * from './useWindowSize';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { deprecatedMsg } from "./deprecatedMsg";
|
|
4
|
+
function isClassComponent(component) {
|
|
5
|
+
console.warn(`isClassComponent ${deprecatedMsg}`);
|
|
6
|
+
return !!(typeof component === "function" && !!component.prototype.isReactComponent);
|
|
7
|
+
}
|
|
8
|
+
function isFunctionComponent(component) {
|
|
9
|
+
console.warn(`isFunctionComponent ${deprecatedMsg}`);
|
|
10
|
+
return typeof component === "function" && String(component).includes("return React.createElement");
|
|
11
|
+
}
|
|
12
|
+
function isReactComponent(component) {
|
|
13
|
+
console.warn(`isReactComponent ${deprecatedMsg}`);
|
|
14
|
+
return !!(isClassComponent(component) || isFunctionComponent(component));
|
|
15
|
+
}
|
|
16
|
+
function isElement(element) {
|
|
17
|
+
console.warn(`isElement ${deprecatedMsg}`);
|
|
18
|
+
return React2.isValidElement(element);
|
|
19
|
+
}
|
|
20
|
+
function isCompositeTypeElement(element) {
|
|
21
|
+
console.warn(`isCompositeTypeElement ${deprecatedMsg}`);
|
|
22
|
+
return isElement(element) && typeof element?.type === "function";
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
isClassComponent,
|
|
26
|
+
isCompositeTypeElement,
|
|
27
|
+
isElement,
|
|
28
|
+
isFunctionComponent,
|
|
29
|
+
isReactComponent
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=reactTypesUtility.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/reactTypesUtility.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-console */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport React from 'react';\nimport { deprecatedMsg } from './deprecatedMsg';\n\nexport function isClassComponent(component: any) {\n console.warn(`isClassComponent ${deprecatedMsg}`);\n return !!(typeof component === 'function' && !!component.prototype.isReactComponent);\n}\n\nexport function isFunctionComponent(component: any) {\n console.warn(`isFunctionComponent ${deprecatedMsg}`);\n return typeof component === 'function' && String(component).includes('return React.createElement');\n}\n\nexport function isReactComponent(component: any) {\n console.warn(`isReactComponent ${deprecatedMsg}`);\n return !!(isClassComponent(component) || isFunctionComponent(component));\n}\n\nexport function isElement(element: Record<string, unknown> | null | undefined) {\n console.warn(`isElement ${deprecatedMsg}`);\n return React.isValidElement(element);\n}\n\nexport function isCompositeTypeElement(element: Record<string, unknown> | null | undefined) {\n console.warn(`isCompositeTypeElement ${deprecatedMsg}`);\n return isElement(element) && typeof element?.type === 'function';\n}\n"],
|
|
5
|
+
"mappings": "AAAA;ACGA;AACA;AAEO,0BAA0B,WAAgB;AAC/C,UAAQ,KAAK,oBAAoB,eAAe;AAChD,SAAO,CAAC,CAAE,QAAO,cAAc,cAAc,CAAC,CAAC,UAAU,UAAU;AACrE;AAEO,6BAA6B,WAAgB;AAClD,UAAQ,KAAK,uBAAuB,eAAe;AACnD,SAAO,OAAO,cAAc,cAAc,OAAO,SAAS,EAAE,SAAS,4BAA4B;AACnG;AAEO,0BAA0B,WAAgB;AAC/C,UAAQ,KAAK,oBAAoB,eAAe;AAChD,SAAO,CAAC,CAAE,kBAAiB,SAAS,KAAK,oBAAoB,SAAS;AACxE;AAEO,mBAAmB,SAAqD;AAC7E,UAAQ,KAAK,aAAa,eAAe;AACzC,SAAO,OAAM,eAAe,OAAO;AACrC;AAEO,gCAAgC,SAAqD;AAC1F,UAAQ,KAAK,0BAA0B,eAAe;AACtD,SAAO,UAAU,OAAO,KAAK,OAAO,SAAS,SAAS;AACxD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { deprecatedMsg } from "./deprecatedMsg";
|
|
2
3
|
const resetTimer = (func) => {
|
|
4
|
+
console.warn(`resetTimer ${deprecatedMsg}`);
|
|
3
5
|
let timeout;
|
|
4
6
|
return function(...args) {
|
|
5
|
-
const context = this;
|
|
6
7
|
const lastCall = () => {
|
|
7
8
|
timeout = null;
|
|
8
|
-
func.apply(
|
|
9
|
+
func.apply(this, args);
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
+
if (timeout)
|
|
12
|
+
clearTimeout(timeout);
|
|
11
13
|
timeout = setTimeout(lastCall, 300);
|
|
12
14
|
};
|
|
13
15
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/scrollingTimer.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-console */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable func-names */\nimport { deprecatedMsg } from './deprecatedMsg';\n\nexport const resetTimer = (func: (...args: unknown[]) => unknown) => {\n console.warn(`resetTimer ${deprecatedMsg}`);\n let timeout: NodeJS.Timeout | null;\n return function (this: any, ...args: unknown[]) {\n const lastCall = () => {\n timeout = null;\n func.apply(this, args);\n };\n\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(lastCall, 300);\n };\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACGA;AAEO,MAAM,aAAa,CAAC,SAA0C;AACnE,UAAQ,KAAK,cAAc,eAAe;AAC1C,MAAI;AACJ,SAAO,YAAwB,MAAiB;AAC9C,UAAM,WAAW,MAAM;AACrB,gBAAU;AACV,WAAK,MAAM,MAAM,IAAI;AAAA,IACvB;AAEA,QAAI;AAAS,mBAAa,OAAO;AACjC,cAAU,WAAW,UAAU,GAAG;AAAA,EACpC;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/useParentElement.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useEffect, useState } from 'react';\n\nexport const useParentElement = (ref: React.RefObject<HTMLElement>) => {\n const [parent, setParent] = useState<ParentNode | null>(ref.current);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => {\n if (ref.current) setParent(ref.current.parentNode);\n });\n return parent;\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEO,MAAM,mBAAmB,CAAC,QAAsC;AACrE,QAAM,CAAC,QAAQ,aAAa,SAA4B,IAAI,OAAO;AAGnE,YAAU,MAAM;AACd,QAAI,IAAI;AAAS,gBAAU,IAAI,QAAQ,UAAU;AAAA,EACnD,CAAC;AACD,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useCallback, useRef } from "react";
|
|
3
|
+
import { deprecatedMsg } from "./deprecatedMsg";
|
|
3
4
|
const useSetRef = (initial) => {
|
|
5
|
+
console.warn(`useSetRef ${deprecatedMsg}`);
|
|
4
6
|
const ref = useRef(initial);
|
|
5
7
|
const setRef = useCallback((node) => {
|
|
6
8
|
ref.current = node;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/useSetRef.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-console */\nimport { useCallback, useRef } from 'react';\nimport { deprecatedMsg } from './deprecatedMsg';\n\nexport const useSetRef = (initial: unknown) => {\n console.warn(`useSetRef ${deprecatedMsg}`);\n const ref = useRef(initial);\n const setRef = useCallback((node) => {\n ref.current = node;\n }, []);\n return [ref, setRef];\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AAEO,MAAM,YAAY,CAAC,YAAqB;AAC7C,UAAQ,KAAK,aAAa,eAAe;AACzC,QAAM,MAAM,OAAO,OAAO;AAC1B,QAAM,SAAS,YAAY,CAAC,SAAS;AACnC,QAAI,UAAU;AAAA,EAChB,GAAG,CAAC,CAAC;AACL,SAAO,CAAC,KAAK,MAAM;AACrB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useUncontrolled as useUncontrolledImplementation } from "uncontrollable";
|
|
3
|
+
import { deprecatedMsg } from "./deprecatedMsg";
|
|
4
|
+
const useUncontrolled = (...args) => {
|
|
5
|
+
console.warn(`useUncontrolled ${deprecatedMsg}`);
|
|
6
|
+
return useUncontrolledImplementation(...args);
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
useUncontrolled
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=useUncontrolled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/useUncontrolled.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-console */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useUncontrolled as useUncontrolledImplementation } from 'uncontrollable';\nimport { deprecatedMsg } from './deprecatedMsg';\n\nexport const useUncontrolled = (...args: any[]) => {\n console.warn(`useUncontrolled ${deprecatedMsg}`);\n return useUncontrolledImplementation(...args);\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACKA;AACA;AAEO,MAAM,kBAAkB,IAAI,SAAgB;AACjD,UAAQ,KAAK,mBAAmB,eAAe;AAC/C,SAAO,8BAA8B,GAAG,IAAI;AAC9C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useLayoutEffect, useState } from "react";
|
|
3
|
+
import { deprecatedMsg } from "./deprecatedMsg";
|
|
4
|
+
const noop = () => {
|
|
5
|
+
};
|
|
3
6
|
const useWindowSize = () => {
|
|
7
|
+
console.warn(`useWindowSize ${deprecatedMsg}`);
|
|
4
8
|
const [size, setSize] = useState([0, 0]);
|
|
5
9
|
useLayoutEffect(() => {
|
|
6
10
|
if (!window)
|
|
7
|
-
return
|
|
11
|
+
return noop;
|
|
8
12
|
function updateSize() {
|
|
9
13
|
setSize([window.innerWidth, window.innerHeight]);
|
|
10
14
|
}
|
|
@@ -17,7 +21,7 @@ const useWindowSize = () => {
|
|
|
17
21
|
};
|
|
18
22
|
}, []);
|
|
19
23
|
if (!window)
|
|
20
|
-
return
|
|
24
|
+
return noop;
|
|
21
25
|
return size;
|
|
22
26
|
};
|
|
23
27
|
var useWindowSize_default = useWindowSize;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/useWindowSize.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-console */\nimport { useLayoutEffect, useState } from 'react';\nimport { deprecatedMsg } from './deprecatedMsg';\n\nconst noop = () => {};\n\nexport const useWindowSize = () => {\n console.warn(`useWindowSize ${deprecatedMsg}`);\n const [size, setSize] = useState([0, 0]);\n useLayoutEffect(() => {\n if (!window) return noop;\n function updateSize() {\n setSize([window.innerWidth, window.innerHeight]);\n }\n window.addEventListener('resize', updateSize);\n window.addEventListener('orientationchange', updateSize);\n updateSize();\n return () => {\n window.removeEventListener('resize', updateSize);\n window.removeEventListener('orientationchange', updateSize);\n };\n }, []);\n if (!window) return noop;\n return size;\n};\n\nexport default useWindowSize;\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AAEA,MAAM,OAAO,MAAM;AAAC;AAEb,MAAM,gBAAgB,MAAM;AACjC,UAAQ,KAAK,iBAAiB,eAAe;AAC7C,QAAM,CAAC,MAAM,WAAW,SAAS,CAAC,GAAG,CAAC,CAAC;AACvC,kBAAgB,MAAM;AACpB,QAAI,CAAC;AAAQ,aAAO;AACpB,0BAAsB;AACpB,cAAQ,CAAC,OAAO,YAAY,OAAO,WAAW,CAAC;AAAA,IACjD;AACA,WAAO,iBAAiB,UAAU,UAAU;AAC5C,WAAO,iBAAiB,qBAAqB,UAAU;AACvD,eAAW;AACX,WAAO,MAAM;AACX,aAAO,oBAAoB,UAAU,UAAU;AAC/C,aAAO,oBAAoB,qBAAqB,UAAU;AAAA,IAC5D;AAAA,EACF,GAAG,CAAC,CAAC;AACL,MAAI,CAAC;AAAQ,WAAO;AACpB,SAAO;AACT;AAEA,IAAO,wBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -19,7 +19,7 @@ import React2 from "react";
|
|
|
19
19
|
const getComponentFromProps = (Component, props, children = []) => {
|
|
20
20
|
if (!Component)
|
|
21
21
|
return null;
|
|
22
|
-
const componentChildren = Component.props ? Array.isArray(Component.props.children) ? Component.props.children : [Component.props.children] : null;
|
|
22
|
+
const componentChildren = typeof Component !== "function" && Component.props ? Array.isArray(Component.props.children) ? Component.props.children : [Component.props.children] : null;
|
|
23
23
|
return typeof Component === "function" ? /* @__PURE__ */ React2.createElement(Component, __spreadValues({}, props), children) : React2.cloneElement(Component, __spreadValues(__spreadValues({}, Component.props), props), componentChildren ? [...componentChildren, ...children] : [...children]);
|
|
24
24
|
};
|
|
25
25
|
var getComponentFromProps_default = getComponentFromProps;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/getComponentFromProps.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-nested-ternary */\nimport React from 'react';\n\nexport const getComponentFromProps = (Component
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACCA;AAEO,MAAM,wBAAwB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-nested-ternary */\nimport React, { PropsWithChildren } from 'react';\n\nexport const getComponentFromProps = (\n Component: React.ReactElement<PropsWithChildren<unknown>> | React.ComponentType<unknown>,\n props: Record<string, unknown>,\n children = [],\n) => {\n if (!Component) return null;\n const componentChildren =\n typeof Component !== 'function' && Component.props\n ? Array.isArray(Component.props.children)\n ? Component.props.children\n : [Component.props.children]\n : null;\n return typeof Component === 'function' ? (\n <Component {...props}>{children}</Component>\n ) : (\n React.cloneElement(\n Component,\n {\n ...Component.props,\n ...props,\n },\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n componentChildren ? [...componentChildren, ...children] : [...children],\n )\n );\n};\n\nexport default getComponentFromProps;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACCA;AAEO,MAAM,wBAAwB,CACnC,WACA,OACA,WAAW,CAAC,MACT;AACH,MAAI,CAAC;AAAW,WAAO;AACvB,QAAM,oBACJ,OAAO,cAAc,cAAc,UAAU,QACzC,MAAM,QAAQ,UAAU,MAAM,QAAQ,IACpC,UAAU,MAAM,WAChB,CAAC,UAAU,MAAM,QAAQ,IAC3B;AACN,SAAO,OAAO,cAAc,aAC1B,qCAAC,8BAAc,QAAQ,QAAS,IAEhC,OAAM,aACJ,WACA,kCACK,UAAU,QACV,QAGL,oBAAoB,CAAC,GAAG,mBAAmB,GAAG,QAAQ,IAAI,CAAC,GAAG,QAAQ,CACxE;AAEJ;AAEA,IAAO,gCAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|