@elliemae/ds-utilities 3.0.0-next.2 → 3.0.0-next.6
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 +35 -0
- package/dist/cjs/capitalize.js.map +7 -0
- package/dist/cjs/compose.js +45 -0
- package/dist/cjs/compose.js.map +7 -0
- package/dist/cjs/getComponentFromProps.js +57 -0
- package/dist/cjs/getComponentFromProps.js.map +7 -0
- package/dist/cjs/hooks/index.js +75 -0
- package/dist/cjs/hooks/index.js.map +7 -0
- package/dist/cjs/hooks/useCallbackAfterRender.js +45 -0
- package/dist/cjs/hooks/useCallbackAfterRender.js.map +7 -0
- package/dist/cjs/hooks/useCancellableDelayedCallback.js +51 -0
- package/dist/cjs/hooks/useCancellableDelayedCallback.js.map +7 -0
- package/dist/cjs/hooks/useDerivedStateFromProps.js +67 -0
- package/dist/cjs/hooks/useDerivedStateFromProps.js.map +7 -0
- package/dist/cjs/hooks/useExecutionTimer.js +50 -0
- package/dist/cjs/hooks/useExecutionTimer.js.map +7 -0
- package/dist/cjs/hooks/useExpandState.js +137 -0
- package/dist/cjs/hooks/useExpandState.js.map +7 -0
- package/dist/cjs/hooks/useFocusTrap.js +49 -0
- package/dist/cjs/hooks/useFocusTrap.js.map +7 -0
- package/dist/cjs/hooks/useHotkeys.js +45 -0
- package/dist/cjs/hooks/useHotkeys.js.map +7 -0
- package/dist/cjs/hooks/useHoverHandlersDelay.js +58 -0
- package/dist/cjs/hooks/useHoverHandlersDelay.js.map +7 -0
- package/dist/cjs/hooks/useIsShowingEllipsis.js +58 -0
- package/dist/cjs/hooks/useIsShowingEllipsis.js.map +7 -0
- package/dist/cjs/hooks/useOnElementResize.js +55 -0
- package/dist/cjs/hooks/useOnElementResize.js.map +7 -0
- package/dist/cjs/hooks/useParentElement.js +43 -0
- package/dist/cjs/hooks/useParentElement.js.map +7 -0
- package/dist/cjs/hooks/usePrevious.js +44 -0
- package/dist/cjs/hooks/usePrevious.js.map +7 -0
- package/dist/cjs/hooks/useResizeObserver.js +60 -0
- package/dist/cjs/hooks/useResizeObserver.js.map +7 -0
- package/dist/cjs/hooks/useSetRef.js +42 -0
- package/dist/cjs/hooks/useSetRef.js.map +7 -0
- package/dist/cjs/hooks/useShouldRecalculate.js +44 -0
- package/dist/cjs/hooks/useShouldRecalculate.js.map +7 -0
- package/dist/cjs/hooks/useWindowScrollerList.js +83 -0
- package/dist/cjs/hooks/useWindowScrollerList.js.map +7 -0
- package/dist/cjs/hooks/useWindowSize.js +57 -0
- package/dist/cjs/hooks/useWindowSize.js.map +7 -0
- package/dist/cjs/index.js +148 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/onClickHandlerForNonInteractiveElements.js +49 -0
- package/dist/cjs/onClickHandlerForNonInteractiveElements.js.map +7 -0
- package/dist/cjs/operators.js +68 -0
- package/dist/cjs/operators.js.map +7 -0
- package/dist/cjs/platform.js +37 -0
- package/dist/cjs/platform.js.map +7 -0
- package/dist/cjs/reactTypesUtility.js +58 -0
- package/dist/cjs/reactTypesUtility.js.map +7 -0
- package/dist/cjs/scrollingTimer.js +46 -0
- package/dist/cjs/scrollingTimer.js.map +7 -0
- package/dist/cjs/system.js +60 -0
- package/dist/cjs/system.js.map +7 -0
- package/dist/cjs/timeUtils.js +43 -0
- package/dist/cjs/timeUtils.js.map +7 -0
- package/dist/cjs/utils.js +143 -0
- package/dist/cjs/utils.js.map +7 -0
- package/dist/cjs/validations.js +57 -0
- package/dist/cjs/validations.js.map +7 -0
- package/dist/esm/capitalize.js +6 -0
- package/dist/esm/capitalize.js.map +7 -0
- package/dist/esm/compose.js +16 -0
- package/dist/esm/compose.js.map +7 -0
- package/dist/esm/getComponentFromProps.js +30 -0
- package/dist/esm/getComponentFromProps.js.map +7 -0
- package/dist/esm/hooks/index.js +46 -0
- package/dist/esm/hooks/index.js.map +7 -0
- package/dist/esm/hooks/useCallbackAfterRender.js +16 -0
- package/dist/esm/hooks/useCallbackAfterRender.js.map +7 -0
- package/dist/esm/hooks/useCancellableDelayedCallback.js +22 -0
- package/dist/esm/hooks/useCancellableDelayedCallback.js.map +7 -0
- package/dist/esm/hooks/useDerivedStateFromProps.js +38 -0
- package/dist/esm/hooks/useDerivedStateFromProps.js.map +7 -0
- package/dist/esm/hooks/useExecutionTimer.js +21 -0
- package/dist/esm/hooks/useExecutionTimer.js.map +7 -0
- package/dist/esm/hooks/useExpandState.js +110 -0
- package/dist/esm/hooks/useExpandState.js.map +7 -0
- package/dist/esm/hooks/useFocusTrap.js +20 -0
- package/dist/esm/hooks/useFocusTrap.js.map +7 -0
- package/dist/esm/hooks/useHotkeys.js +16 -0
- package/dist/esm/hooks/useHotkeys.js.map +7 -0
- package/{esm → dist/esm}/hooks/useHoverHandlersDelay.js +15 -12
- package/dist/esm/hooks/useHoverHandlersDelay.js.map +7 -0
- package/dist/esm/hooks/useIsShowingEllipsis.js +29 -0
- package/dist/esm/hooks/useIsShowingEllipsis.js.map +7 -0
- package/dist/esm/hooks/useOnElementResize.js +26 -0
- package/dist/esm/hooks/useOnElementResize.js.map +7 -0
- package/dist/esm/hooks/useParentElement.js +14 -0
- package/dist/esm/hooks/useParentElement.js.map +7 -0
- package/dist/esm/hooks/usePrevious.js +15 -0
- package/dist/esm/hooks/usePrevious.js.map +7 -0
- package/dist/esm/hooks/useResizeObserver.js +31 -0
- package/dist/esm/hooks/useResizeObserver.js.map +7 -0
- package/dist/esm/hooks/useSetRef.js +13 -0
- package/dist/esm/hooks/useSetRef.js.map +7 -0
- package/dist/esm/hooks/useShouldRecalculate.js +15 -0
- package/dist/esm/hooks/useShouldRecalculate.js.map +7 -0
- package/{esm → dist/esm}/hooks/useWindowScrollerList.js +20 -29
- package/dist/esm/hooks/useWindowScrollerList.js.map +7 -0
- package/dist/esm/hooks/useWindowSize.js +28 -0
- package/dist/esm/hooks/useWindowSize.js.map +7 -0
- package/dist/esm/index.js +210 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/onClickHandlerForNonInteractiveElements.js +20 -0
- package/dist/esm/onClickHandlerForNonInteractiveElements.js.map +7 -0
- package/dist/esm/operators.js +39 -0
- package/dist/esm/operators.js.map +7 -0
- package/dist/esm/platform.js +8 -0
- package/dist/esm/platform.js.map +7 -0
- package/dist/esm/reactTypesUtility.js +29 -0
- package/dist/esm/reactTypesUtility.js.map +7 -0
- package/dist/esm/scrollingTimer.js +17 -0
- package/dist/esm/scrollingTimer.js.map +7 -0
- package/dist/esm/system.js +31 -0
- package/dist/esm/system.js.map +7 -0
- package/dist/esm/timeUtils.js +14 -0
- package/dist/esm/timeUtils.js.map +7 -0
- package/dist/esm/utils.js +154 -0
- package/dist/esm/utils.js.map +7 -0
- package/dist/esm/validations.js +28 -0
- package/dist/esm/validations.js.map +7 -0
- package/package.json +82 -69
- package/cjs/capitalize.js +0 -7
- package/cjs/compose.js +0 -38
- package/cjs/getComponentFromProps.js +0 -30
- package/cjs/hooks/index.js +0 -61
- package/cjs/hooks/useCancellableDelayedCallback.js +0 -26
- package/cjs/hooks/useDerivedStateFromProps.js +0 -56
- package/cjs/hooks/useExecutionTimer.js +0 -31
- package/cjs/hooks/useExpandState.js +0 -133
- package/cjs/hooks/useHotkeys.js +0 -25
- package/cjs/hooks/useHoverHandlersDelay.js +0 -28
- package/cjs/hooks/useOnElementResize.js +0 -37
- package/cjs/hooks/useParentElement.js +0 -16
- package/cjs/hooks/usePrevious.js +0 -13
- package/cjs/hooks/useResizeObserver.js +0 -33
- package/cjs/hooks/useSetRef.js +0 -15
- package/cjs/hooks/useShouldRecalculate.js +0 -17
- package/cjs/hooks/useWindowScrollerList.js +0 -65
- package/cjs/hooks/useWindowSize.js +0 -27
- package/cjs/index.js +0 -266
- package/cjs/onClickHandlerForNonInteractiveElements.js +0 -22
- package/cjs/operators.js +0 -63
- package/cjs/platform.js +0 -9
- package/cjs/reactTypesUtility.js +0 -35
- package/cjs/scrollingTimer.js +0 -24
- package/cjs/system.js +0 -43
- package/cjs/timeUtils.js +0 -25
- package/cjs/utils.js +0 -263
- package/cjs/validations.js +0 -44
- package/esm/capitalize.js +0 -3
- package/esm/compose.js +0 -34
- package/esm/getComponentFromProps.js +0 -23
- package/esm/hooks/index.js +0 -18
- package/esm/hooks/useCancellableDelayedCallback.js +0 -24
- package/esm/hooks/useDerivedStateFromProps.js +0 -54
- package/esm/hooks/useExecutionTimer.js +0 -29
- package/esm/hooks/useExpandState.js +0 -127
- package/esm/hooks/useHotkeys.js +0 -19
- package/esm/hooks/useOnElementResize.js +0 -33
- package/esm/hooks/useParentElement.js +0 -12
- package/esm/hooks/usePrevious.js +0 -11
- package/esm/hooks/useResizeObserver.js +0 -26
- package/esm/hooks/useSetRef.js +0 -11
- package/esm/hooks/useShouldRecalculate.js +0 -15
- package/esm/hooks/useWindowSize.js +0 -25
- package/esm/index.js +0 -31
- package/esm/onClickHandlerForNonInteractiveElements.js +0 -20
- package/esm/operators.js +0 -46
- package/esm/platform.js +0 -4
- package/esm/reactTypesUtility.js +0 -22
- package/esm/scrollingTimer.js +0 -20
- package/esm/system.js +0 -37
- package/esm/timeUtils.js +0 -20
- package/esm/utils.js +0 -99
- package/esm/validations.js +0 -38
- package/types/capitalize.d.ts +0 -1
- package/types/compose.d.ts +0 -11
- package/types/getComponentFromProps.d.ts +0 -2
- package/types/hooks/index.d.ts +0 -18
- package/types/hooks/useCancellableDelayedCallback.d.ts +0 -1
- package/types/hooks/useDerivedStateFromProps.d.ts +0 -1
- package/types/hooks/useExecutionTimer.d.ts +0 -1
- package/types/hooks/useExpandState.d.ts +0 -22
- package/types/hooks/useHotkeys.d.ts +0 -5
- package/types/hooks/useHoverHandlersDelay.d.ts +0 -9
- package/types/hooks/useOnElementResize.d.ts +0 -2
- package/types/hooks/useParentElement.d.ts +0 -1
- package/types/hooks/usePrevious.d.ts +0 -2
- package/types/hooks/useResizeObserver.d.ts +0 -2
- package/types/hooks/useSetRef.d.ts +0 -2
- package/types/hooks/useShouldRecalculate.d.ts +0 -1
- package/types/hooks/useWindowScrollerList.d.ts +0 -4
- package/types/hooks/useWindowSize.d.ts +0 -1
- package/types/index.d.ts +0 -13
- package/types/onClickHandlerForNonInteractiveElements.d.ts +0 -12
- package/types/operators.d.ts +0 -31
- package/types/platform.d.ts +0 -2
- package/types/reactTypesUtility.d.ts +0 -6
- package/types/scrollingTimer.d.ts +0 -1
- package/types/system.d.ts +0 -3
- package/types/timeUtils.d.ts +0 -7
- package/types/utils.d.ts +0 -23
- package/types/validations.d.ts +0 -23
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
function getScrollOffset() {
|
|
4
|
-
let element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
5
|
-
scrollTop: 0,
|
|
6
|
-
scrollLeft: 0
|
|
7
|
-
};
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
function getScrollOffset(element = { scrollTop: 0, scrollLeft: 0 }) {
|
|
8
4
|
return {
|
|
9
5
|
top: element.scrollTop,
|
|
10
6
|
left: element.scrollLeft
|
|
11
7
|
};
|
|
12
8
|
}
|
|
13
|
-
|
|
14
9
|
function getPositionOffset(listEl, scrollableEl) {
|
|
15
10
|
const scrollOffset = getScrollOffset(scrollableEl);
|
|
16
11
|
const elementRect = listEl.getBoundingClientRect();
|
|
@@ -20,44 +15,40 @@ function getPositionOffset(listEl, scrollableEl) {
|
|
|
20
15
|
left: elementRect.left + scrollOffset.top - containerRect.left
|
|
21
16
|
};
|
|
22
17
|
}
|
|
23
|
-
|
|
24
18
|
function isParent(parentNode, childNode) {
|
|
25
19
|
return childNode.parentNode === parentNode || childNode.parentNode && isParent(parentNode, childNode.parentNode);
|
|
26
20
|
}
|
|
27
|
-
|
|
28
|
-
function useWindowScrollerList(_ref) {
|
|
29
|
-
let {
|
|
30
|
-
listInstance,
|
|
31
|
-
outerListRef
|
|
32
|
-
} = _ref;
|
|
21
|
+
const useWindowScrollerList = ({ listInstance, outerListRef }) => {
|
|
33
22
|
const scrollableParent = useRef();
|
|
34
23
|
const listOffset = useRef();
|
|
35
|
-
|
|
36
24
|
const getElementOffset = () => {
|
|
37
25
|
listOffset.current = getPositionOffset(outerListRef.current, scrollableParent.current);
|
|
38
26
|
};
|
|
39
|
-
|
|
40
|
-
const handleScroll = e => {
|
|
27
|
+
const handleScroll = (e) => {
|
|
41
28
|
if (!scrollableParent.current) {
|
|
42
29
|
const containerTarget = e.target === document ? document.body : e.target;
|
|
43
30
|
scrollableParent.current = isParent(containerTarget, outerListRef.current) && containerTarget;
|
|
44
31
|
}
|
|
45
|
-
|
|
46
|
-
|
|
32
|
+
if (!scrollableParent.current)
|
|
33
|
+
return;
|
|
47
34
|
getElementOffset();
|
|
48
35
|
const scrollOffset = getScrollOffset(scrollableParent.current);
|
|
49
36
|
const scrollTop = Math.max(0, scrollOffset.top - listOffset.current.top);
|
|
50
|
-
if (listInstance.current)
|
|
37
|
+
if (listInstance.current)
|
|
38
|
+
listInstance.current.scrollTo(scrollTop);
|
|
51
39
|
};
|
|
52
|
-
|
|
53
40
|
useEffect(() => {
|
|
54
|
-
window.addEventListener(
|
|
55
|
-
window.addEventListener(
|
|
41
|
+
window.addEventListener("scroll", handleScroll, true);
|
|
42
|
+
window.addEventListener("resize", getElementOffset, true);
|
|
56
43
|
return () => {
|
|
57
|
-
window.removeEventListener(
|
|
58
|
-
window.removeEventListener(
|
|
44
|
+
window.removeEventListener("scroll", handleScroll, true);
|
|
45
|
+
window.removeEventListener("resize", getElementOffset, true);
|
|
59
46
|
};
|
|
60
47
|
}, []);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export {
|
|
48
|
+
};
|
|
49
|
+
var useWindowScrollerList_default = useWindowScrollerList;
|
|
50
|
+
export {
|
|
51
|
+
useWindowScrollerList_default as default,
|
|
52
|
+
useWindowScrollerList
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=useWindowScrollerList.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useWindowScrollerList.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useEffect, useRef } from 'react';\n\nfunction getScrollOffset(element = { scrollTop: 0, scrollLeft: 0 }) {\n return {\n top: element.scrollTop,\n left: element.scrollLeft,\n };\n}\n\nfunction getPositionOffset(listEl, scrollableEl) {\n const scrollOffset = getScrollOffset(scrollableEl);\n const elementRect = listEl.getBoundingClientRect();\n const containerRect = scrollableEl.getBoundingClientRect();\n return {\n top: elementRect.top + scrollOffset.top - containerRect.top,\n left: elementRect.left + scrollOffset.top - containerRect.left,\n };\n}\n\nfunction isParent(parentNode, childNode) {\n return (\n childNode.parentNode === parentNode ||\n (childNode.parentNode && isParent(parentNode, childNode.parentNode))\n );\n}\n\nexport const useWindowScrollerList = ({ listInstance, outerListRef }) => {\n const scrollableParent = useRef();\n const listOffset = useRef();\n\n const getElementOffset = () => {\n listOffset.current = getPositionOffset(\n outerListRef.current,\n scrollableParent.current,\n );\n };\n\n const handleScroll = e => {\n if (!scrollableParent.current) {\n const containerTarget = e.target === document ? document.body : e.target;\n scrollableParent.current =\n isParent(containerTarget, outerListRef.current) && containerTarget;\n }\n\n if (!scrollableParent.current) return;\n\n getElementOffset();\n\n const scrollOffset = getScrollOffset(scrollableParent.current);\n const scrollTop = Math.max(0, scrollOffset.top - listOffset.current.top);\n if (listInstance.current) listInstance.current.scrollTo(scrollTop);\n };\n\n useEffect(() => {\n window.addEventListener('scroll', handleScroll, true);\n window.addEventListener('resize', getElementOffset, true);\n return () => {\n window.removeEventListener('scroll', handleScroll, true);\n window.removeEventListener('resize', getElementOffset, true);\n };\n }, []);\n};\n\nexport default useWindowScrollerList;"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEA,yBAAyB,UAAU,EAAE,WAAW,GAAG,YAAY,KAAK;AAClE,SAAO;AAAA,IACL,KAAK,QAAQ;AAAA,IACb,MAAM,QAAQ;AAAA;AAAA;AAIlB,2BAA2B,QAAQ,cAAc;AAC/C,QAAM,eAAe,gBAAgB;AACrC,QAAM,cAAc,OAAO;AAC3B,QAAM,gBAAgB,aAAa;AACnC,SAAO;AAAA,IACL,KAAK,YAAY,MAAM,aAAa,MAAM,cAAc;AAAA,IACxD,MAAM,YAAY,OAAO,aAAa,MAAM,cAAc;AAAA;AAAA;AAI9D,kBAAkB,YAAY,WAAW;AACvC,SACE,UAAU,eAAe,cACxB,UAAU,cAAc,SAAS,YAAY,UAAU;AAAA;AAIrD,MAAM,wBAAwB,CAAC,EAAE,cAAc,mBAAmB;AACvE,QAAM,mBAAmB;AACzB,QAAM,aAAa;AAEnB,QAAM,mBAAmB,MAAM;AAC7B,eAAW,UAAU,kBACnB,aAAa,SACb,iBAAiB;AAAA;AAIrB,QAAM,eAAe,OAAK;AACxB,QAAI,CAAC,iBAAiB,SAAS;AAC7B,YAAM,kBAAkB,EAAE,WAAW,WAAW,SAAS,OAAO,EAAE;AAClE,uBAAiB,UACf,SAAS,iBAAiB,aAAa,YAAY;AAAA;AAGvD,QAAI,CAAC,iBAAiB;AAAS;AAE/B;AAEA,UAAM,eAAe,gBAAgB,iBAAiB;AACtD,UAAM,YAAY,KAAK,IAAI,GAAG,aAAa,MAAM,WAAW,QAAQ;AACpE,QAAI,aAAa;AAAS,mBAAa,QAAQ,SAAS;AAAA;AAG1D,YAAU,MAAM;AACd,WAAO,iBAAiB,UAAU,cAAc;AAChD,WAAO,iBAAiB,UAAU,kBAAkB;AACpD,WAAO,MAAM;AACX,aAAO,oBAAoB,UAAU,cAAc;AACnD,aAAO,oBAAoB,UAAU,kBAAkB;AAAA;AAAA,KAExD;AAAA;AAGL,IAAO,gCAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useLayoutEffect, useState } from "react";
|
|
3
|
+
const useWindowSize = () => {
|
|
4
|
+
const [size, setSize] = useState([0, 0]);
|
|
5
|
+
useLayoutEffect(() => {
|
|
6
|
+
if (!window)
|
|
7
|
+
return false;
|
|
8
|
+
function updateSize() {
|
|
9
|
+
setSize([window.innerWidth, window.innerHeight]);
|
|
10
|
+
}
|
|
11
|
+
window.addEventListener("resize", updateSize);
|
|
12
|
+
window.addEventListener("orientationchange", updateSize);
|
|
13
|
+
updateSize();
|
|
14
|
+
return () => {
|
|
15
|
+
window.removeEventListener("resize", updateSize);
|
|
16
|
+
window.removeEventListener("orientationchange", updateSize);
|
|
17
|
+
};
|
|
18
|
+
}, []);
|
|
19
|
+
if (!window)
|
|
20
|
+
return false;
|
|
21
|
+
return size;
|
|
22
|
+
};
|
|
23
|
+
var useWindowSize_default = useWindowSize;
|
|
24
|
+
export {
|
|
25
|
+
useWindowSize_default as default,
|
|
26
|
+
useWindowSize
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=useWindowSize.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useWindowSize.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useLayoutEffect, useState } from 'react';\n\nexport const useWindowSize = () => {\n const [size, setSize] = useState([0, 0]);\n useLayoutEffect(() => {\n if (!window) return false;\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 false;\n return size;\n};\n\nexport default useWindowSize;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEO,MAAM,gBAAgB,MAAM;AACjC,QAAM,CAAC,MAAM,WAAW,SAAS,CAAC,GAAG;AACrC,kBAAgB,MAAM;AACpB,QAAI,CAAC;AAAQ,aAAO;AACpB,0BAAsB;AACpB,cAAQ,CAAC,OAAO,YAAY,OAAO;AAAA;AAErC,WAAO,iBAAiB,UAAU;AAClC,WAAO,iBAAiB,qBAAqB;AAC7C;AACA,WAAO,MAAM;AACX,aAAO,oBAAoB,UAAU;AACrC,aAAO,oBAAoB,qBAAqB;AAAA;AAAA,KAEjD;AACH,MAAI,CAAC;AAAQ,WAAO;AACpB,SAAO;AAAA;AAGT,IAAO,wBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { default as default2 } from "./getComponentFromProps";
|
|
3
|
+
import { default as default3 } from "./onClickHandlerForNonInteractiveElements";
|
|
4
|
+
import { capitalize } from "./capitalize";
|
|
5
|
+
import {
|
|
6
|
+
checkNotEmpty,
|
|
7
|
+
checkEmpty,
|
|
8
|
+
greaterThan,
|
|
9
|
+
validDate,
|
|
10
|
+
equal,
|
|
11
|
+
notEqual,
|
|
12
|
+
isNull,
|
|
13
|
+
isNotNull,
|
|
14
|
+
isIn,
|
|
15
|
+
isNotIn,
|
|
16
|
+
greaterThanOrEquals,
|
|
17
|
+
lessThanOrEquals,
|
|
18
|
+
startsWith,
|
|
19
|
+
contains
|
|
20
|
+
} from "./operators";
|
|
21
|
+
import {
|
|
22
|
+
cx,
|
|
23
|
+
runAll,
|
|
24
|
+
hashArray,
|
|
25
|
+
safeCall,
|
|
26
|
+
removeUndefinedProperties,
|
|
27
|
+
isObject,
|
|
28
|
+
curry,
|
|
29
|
+
arrayMove,
|
|
30
|
+
uniq,
|
|
31
|
+
filter,
|
|
32
|
+
uniqBy,
|
|
33
|
+
groupBy,
|
|
34
|
+
property,
|
|
35
|
+
get,
|
|
36
|
+
set,
|
|
37
|
+
cloneDeep,
|
|
38
|
+
debounce,
|
|
39
|
+
findIndex,
|
|
40
|
+
isEmpty,
|
|
41
|
+
isString,
|
|
42
|
+
isEqual,
|
|
43
|
+
maxBy,
|
|
44
|
+
meanBy,
|
|
45
|
+
noop,
|
|
46
|
+
omit,
|
|
47
|
+
orderBy,
|
|
48
|
+
pull,
|
|
49
|
+
sortBy,
|
|
50
|
+
sumBy,
|
|
51
|
+
transform,
|
|
52
|
+
isFunction,
|
|
53
|
+
range,
|
|
54
|
+
parseInt,
|
|
55
|
+
padStart,
|
|
56
|
+
isNaN,
|
|
57
|
+
values,
|
|
58
|
+
throttle,
|
|
59
|
+
toggleInObject,
|
|
60
|
+
toggleInArray,
|
|
61
|
+
pick,
|
|
62
|
+
pickBy,
|
|
63
|
+
differenceBy,
|
|
64
|
+
differenceWith,
|
|
65
|
+
addOrRemove,
|
|
66
|
+
isEqualWith,
|
|
67
|
+
isBoolean
|
|
68
|
+
} from "./utils";
|
|
69
|
+
import { setRef, mergeRefs, logger } from "./system";
|
|
70
|
+
import {
|
|
71
|
+
useMeasure,
|
|
72
|
+
useForceUpdate,
|
|
73
|
+
useOnClickOutside,
|
|
74
|
+
useUncontrolled,
|
|
75
|
+
useExecutionTimer,
|
|
76
|
+
useExpandState,
|
|
77
|
+
useHotkeys,
|
|
78
|
+
useHoverHandlersDelay,
|
|
79
|
+
useResizeObserver,
|
|
80
|
+
useShouldRecalculate,
|
|
81
|
+
useWindowScrollerList,
|
|
82
|
+
useWindowSize,
|
|
83
|
+
usePrevious,
|
|
84
|
+
useCancellableDelayedCallback,
|
|
85
|
+
useDerivedStateFromProps,
|
|
86
|
+
useSetRef,
|
|
87
|
+
useParentElement,
|
|
88
|
+
useOnElementResize,
|
|
89
|
+
useIsShowingEllipsis,
|
|
90
|
+
useCallbackAfterRender,
|
|
91
|
+
useFocusTrap
|
|
92
|
+
} from "./hooks";
|
|
93
|
+
import { getVisibleTimeByFormat, addLeadingZeros } from "./timeUtils";
|
|
94
|
+
import { compose } from "./compose";
|
|
95
|
+
import { DOCUMENT, WINDOW } from "./platform";
|
|
96
|
+
import {
|
|
97
|
+
isClassComponent,
|
|
98
|
+
isFunctionComponent,
|
|
99
|
+
isReactComponent,
|
|
100
|
+
isElement,
|
|
101
|
+
isDOMTypeElement,
|
|
102
|
+
isCompositeTypeElement
|
|
103
|
+
} from "./reactTypesUtility";
|
|
104
|
+
import { resetTimer } from "./scrollingTimer";
|
|
105
|
+
import { isRequired, isGreaterThan, isValidDate } from "./validations";
|
|
106
|
+
export {
|
|
107
|
+
DOCUMENT,
|
|
108
|
+
WINDOW,
|
|
109
|
+
addLeadingZeros,
|
|
110
|
+
addOrRemove,
|
|
111
|
+
arrayMove,
|
|
112
|
+
capitalize,
|
|
113
|
+
checkEmpty,
|
|
114
|
+
checkNotEmpty,
|
|
115
|
+
cloneDeep,
|
|
116
|
+
compose,
|
|
117
|
+
contains,
|
|
118
|
+
curry,
|
|
119
|
+
cx,
|
|
120
|
+
debounce,
|
|
121
|
+
differenceBy,
|
|
122
|
+
differenceWith,
|
|
123
|
+
equal,
|
|
124
|
+
filter,
|
|
125
|
+
findIndex,
|
|
126
|
+
get,
|
|
127
|
+
default2 as getComponentFromProps,
|
|
128
|
+
getVisibleTimeByFormat,
|
|
129
|
+
greaterThan,
|
|
130
|
+
greaterThanOrEquals,
|
|
131
|
+
groupBy,
|
|
132
|
+
hashArray,
|
|
133
|
+
isBoolean,
|
|
134
|
+
isClassComponent,
|
|
135
|
+
isCompositeTypeElement,
|
|
136
|
+
isDOMTypeElement,
|
|
137
|
+
isElement,
|
|
138
|
+
isEmpty,
|
|
139
|
+
isEqual,
|
|
140
|
+
isEqualWith,
|
|
141
|
+
isFunction,
|
|
142
|
+
isFunctionComponent,
|
|
143
|
+
isGreaterThan,
|
|
144
|
+
isIn,
|
|
145
|
+
isNaN,
|
|
146
|
+
isNotIn,
|
|
147
|
+
isNotNull,
|
|
148
|
+
isNull,
|
|
149
|
+
isObject,
|
|
150
|
+
isReactComponent,
|
|
151
|
+
isRequired,
|
|
152
|
+
isString,
|
|
153
|
+
isValidDate,
|
|
154
|
+
lessThanOrEquals,
|
|
155
|
+
logger,
|
|
156
|
+
maxBy,
|
|
157
|
+
meanBy,
|
|
158
|
+
mergeRefs,
|
|
159
|
+
noop,
|
|
160
|
+
notEqual,
|
|
161
|
+
omit,
|
|
162
|
+
default3 as onClickHandlerForNonInteractiveElements,
|
|
163
|
+
orderBy,
|
|
164
|
+
padStart,
|
|
165
|
+
parseInt,
|
|
166
|
+
pick,
|
|
167
|
+
pickBy,
|
|
168
|
+
property,
|
|
169
|
+
pull,
|
|
170
|
+
range,
|
|
171
|
+
removeUndefinedProperties,
|
|
172
|
+
resetTimer,
|
|
173
|
+
runAll,
|
|
174
|
+
safeCall,
|
|
175
|
+
set,
|
|
176
|
+
setRef,
|
|
177
|
+
sortBy,
|
|
178
|
+
startsWith,
|
|
179
|
+
sumBy,
|
|
180
|
+
throttle,
|
|
181
|
+
toggleInArray,
|
|
182
|
+
toggleInObject,
|
|
183
|
+
transform,
|
|
184
|
+
uniq,
|
|
185
|
+
uniqBy,
|
|
186
|
+
useCallbackAfterRender,
|
|
187
|
+
useCancellableDelayedCallback,
|
|
188
|
+
useDerivedStateFromProps,
|
|
189
|
+
useExecutionTimer,
|
|
190
|
+
useExpandState,
|
|
191
|
+
useFocusTrap,
|
|
192
|
+
useForceUpdate,
|
|
193
|
+
useHotkeys,
|
|
194
|
+
useHoverHandlersDelay,
|
|
195
|
+
useIsShowingEllipsis,
|
|
196
|
+
useMeasure,
|
|
197
|
+
useOnClickOutside,
|
|
198
|
+
useOnElementResize,
|
|
199
|
+
useParentElement,
|
|
200
|
+
usePrevious,
|
|
201
|
+
useResizeObserver,
|
|
202
|
+
useSetRef,
|
|
203
|
+
useShouldRecalculate,
|
|
204
|
+
useUncontrolled,
|
|
205
|
+
useWindowScrollerList,
|
|
206
|
+
useWindowSize,
|
|
207
|
+
validDate,
|
|
208
|
+
values
|
|
209
|
+
};
|
|
210
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { default as getComponentFromProps } from './getComponentFromProps';\nexport { default as onClickHandlerForNonInteractiveElements } from './onClickHandlerForNonInteractiveElements';\nexport { capitalize } from './capitalize';\nexport {\n checkNotEmpty,\n checkEmpty,\n greaterThan,\n validDate,\n equal,\n notEqual,\n isNull,\n isNotNull,\n isIn,\n isNotIn,\n greaterThanOrEquals,\n lessThanOrEquals,\n startsWith,\n contains,\n} from './operators';\nexport {\n cx,\n runAll,\n hashArray,\n safeCall,\n removeUndefinedProperties,\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} from './utils';\nexport { setRef, mergeRefs, logger } from './system';\nexport {\n useMeasure,\n useForceUpdate,\n useOnClickOutside,\n useUncontrolled,\n useExecutionTimer,\n useExpandState,\n useHotkeys,\n useHoverHandlersDelay,\n useResizeObserver,\n useShouldRecalculate,\n useWindowScrollerList,\n useWindowSize,\n usePrevious,\n useCancellableDelayedCallback,\n useDerivedStateFromProps,\n useSetRef,\n useParentElement,\n useOnElementResize,\n useIsShowingEllipsis,\n useCallbackAfterRender,\n useFocusTrap,\n} from './hooks';\nexport { getVisibleTimeByFormat, addLeadingZeros } from './timeUtils';\nexport { compose } from './compose';\nexport { DOCUMENT, WINDOW } from './platform';\nexport {\n isClassComponent,\n isFunctionComponent,\n isReactComponent,\n isElement,\n isDOMTypeElement,\n isCompositeTypeElement,\n} from './reactTypesUtility';\nexport { resetTimer } from './scrollingTimer';\nexport { isRequired, isGreaterThan, isValidDate } from './validations';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA;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;AAgDA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AACA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const onClickHandlerForNonInteractiveElements = (onClickHandler) => ({
|
|
3
|
+
role: "button",
|
|
4
|
+
tabIndex: "0",
|
|
5
|
+
onClick: onClickHandler,
|
|
6
|
+
onKeyPress: (event) => {
|
|
7
|
+
event.stopPropagation();
|
|
8
|
+
const { keycode, key } = event;
|
|
9
|
+
if (key === "Enter")
|
|
10
|
+
onClickHandler(event);
|
|
11
|
+
else if (keycode === 13)
|
|
12
|
+
onClickHandler(event);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
var onClickHandlerForNonInteractiveElements_default = onClickHandlerForNonInteractiveElements;
|
|
16
|
+
export {
|
|
17
|
+
onClickHandlerForNonInteractiveElements_default as default,
|
|
18
|
+
onClickHandlerForNonInteractiveElements
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=onClickHandlerForNonInteractiveElements.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/onClickHandlerForNonInteractiveElements.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/**\n * onClickHandler: callback\n *\n * @param onClickHandler\n */\nexport const onClickHandlerForNonInteractiveElements = onClickHandler => ({\n role: 'button',\n tabIndex: '0',\n onClick: onClickHandler,\n onKeyPress: event => {\n event.stopPropagation();\n const { keycode, key } = event;\n if (key === 'Enter') onClickHandler(event);\n else if (keycode === 13) onClickHandler(event);\n },\n});\n\nexport default onClickHandlerForNonInteractiveElements;\n"],
|
|
5
|
+
"mappings": "AAAA;ACKO,MAAM,0CAA0C,oBAAmB;AAAA,EACxE,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY,WAAS;AACnB,UAAM;AACN,UAAM,EAAE,SAAS,QAAQ;AACzB,QAAI,QAAQ;AAAS,qBAAe;AAAA,aAC3B,YAAY;AAAI,qBAAe;AAAA;AAAA;AAI5C,IAAO,kDAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { isEmpty } from "lodash";
|
|
3
|
+
const checkNotEmpty = (value) => value === "" || value === void 0 || value == [] || value === null || isEmpty(value);
|
|
4
|
+
const checkEmpty = (value) => !isEmpty(value);
|
|
5
|
+
const greaterThan = (value, comparator) => value > comparator;
|
|
6
|
+
const validDate = (value) => {
|
|
7
|
+
const dateValidationRegex = /^\d{1,2}\/\d{1,2}\/\d{4}$/;
|
|
8
|
+
if (!dateValidationRegex.test(value))
|
|
9
|
+
return false;
|
|
10
|
+
const [m, d, y] = value.split("/").map((n) => Number(n));
|
|
11
|
+
return m === Number(new Date(y, m - 1, d).getMonth()) + 1 && d === Number(new Date(y, m - 1, d).getDate());
|
|
12
|
+
};
|
|
13
|
+
const equal = (a, b) => a === b;
|
|
14
|
+
const notEqual = (a, b) => !equal(a, b);
|
|
15
|
+
const isNull = (a) => checkNotEmpty(a);
|
|
16
|
+
const isNotNull = (a) => !isNull(a);
|
|
17
|
+
const isIn = (a, b) => b.indexOf(a) > -1;
|
|
18
|
+
const isNotIn = (a, b) => !isIn(a, b);
|
|
19
|
+
const greaterThanOrEquals = (value, comparator) => value >= comparator;
|
|
20
|
+
const lessThanOrEquals = (value, comparator) => value <= comparator;
|
|
21
|
+
const startsWith = (value, comparator) => String(value).startsWith(comparator);
|
|
22
|
+
const contains = (value, comparator) => String(value).includes(comparator);
|
|
23
|
+
export {
|
|
24
|
+
checkEmpty,
|
|
25
|
+
checkNotEmpty,
|
|
26
|
+
contains,
|
|
27
|
+
equal,
|
|
28
|
+
greaterThan,
|
|
29
|
+
greaterThanOrEquals,
|
|
30
|
+
isIn,
|
|
31
|
+
isNotIn,
|
|
32
|
+
isNotNull,
|
|
33
|
+
isNull,
|
|
34
|
+
lessThanOrEquals,
|
|
35
|
+
notEqual,
|
|
36
|
+
startsWith,
|
|
37
|
+
validDate
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=operators.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/operators.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { isEmpty } from 'lodash';\n/**\n * Check if the value is null undefined ''\n *\n * @param value\n */\nexport const checkNotEmpty = (value) =>\n value === '' || value === undefined || value == [] || value === null || isEmpty(value);\n\nexport const checkEmpty = (value) => !isEmpty(value)\n/**\n * @param value: number\n * @param comparator: number\n * @param value\n * @param comparator\n */\nexport const greaterThan = (value, comparator) => value > comparator;\n\n/**\n * Check if a valid date with format MM/DD/YYYY\n *\n * @param {*} value: string\n * @param value\n */\nexport const validDate = (value) => {\n const dateValidationRegex = /^\\d{1,2}\\/\\d{1,2}\\/\\d{4}$/;\n if (!dateValidationRegex.test(value)) return false;\n const [m, d, y] = value.split('/').map((n) => Number(n));\n return (\n m === Number(new Date(y, m - 1, d).getMonth()) + 1 &&\n d === Number(new Date(y, m - 1, d).getDate())\n );\n};\n\nexport const equal = (a, b) => a === b;\n\nexport const notEqual = (a, b) => !equal(a, b);\n\nexport const isNull = (a) => checkNotEmpty(a);\n\nexport const isNotNull = (a) => !isNull(a);\n\nexport const isIn = (a, b) => b.indexOf(a) > -1;\n\nexport const isNotIn = (a, b) => !isIn(a, b);\n\nexport const greaterThanOrEquals = (value, comparator) => value >= comparator;\nexport const lessThanOrEquals = (value, comparator) => value <= comparator;\nexport const startsWith = (value, comparator) =>\n String(value).startsWith(comparator);\nexport const contains = (value, comparator) =>\n String(value).includes(comparator);\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAMO,MAAM,gBAAgB,CAAC,UAC5B,UAAU,MAAM,UAAU,UAAa,SAAS,MAAM,UAAU,QAAQ,QAAQ;AAE3E,MAAM,aAAa,CAAC,UAAU,CAAC,QAAQ;AAOvC,MAAM,cAAc,CAAC,OAAO,eAAe,QAAQ;AAQnD,MAAM,YAAY,CAAC,UAAU;AAClC,QAAM,sBAAsB;AAC5B,MAAI,CAAC,oBAAoB,KAAK;AAAQ,WAAO;AAC7C,QAAM,CAAC,GAAG,GAAG,KAAK,MAAM,MAAM,KAAK,IAAI,CAAC,MAAM,OAAO;AACrD,SACE,MAAM,OAAO,IAAI,KAAK,GAAG,IAAI,GAAG,GAAG,cAAc,KACjD,MAAM,OAAO,IAAI,KAAK,GAAG,IAAI,GAAG,GAAG;AAAA;AAIhC,MAAM,QAAQ,CAAC,GAAG,MAAM,MAAM;AAE9B,MAAM,WAAW,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG;AAErC,MAAM,SAAS,CAAC,MAAM,cAAc;AAEpC,MAAM,YAAY,CAAC,MAAM,CAAC,OAAO;AAEjC,MAAM,OAAO,CAAC,GAAG,MAAM,EAAE,QAAQ,KAAK;AAEtC,MAAM,UAAU,CAAC,GAAG,MAAM,CAAC,KAAK,GAAG;AAEnC,MAAM,sBAAsB,CAAC,OAAO,eAAe,SAAS;AAC5D,MAAM,mBAAmB,CAAC,OAAO,eAAe,SAAS;AACzD,MAAM,aAAa,CAAC,OAAO,eAChC,OAAO,OAAO,WAAW;AACpB,MAAM,WAAW,CAAC,OAAO,eAC9B,OAAO,OAAO,SAAS;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/platform.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DOCUMENT = typeof document !== 'undefined' ? document : null;\nexport const WINDOW = typeof window !== 'undefined' ? window : null;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,WAAW,OAAO,aAAa,cAAc,WAAW;AAC9D,MAAM,SAAS,OAAO,WAAW,cAAc,SAAS;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
function isClassComponent(component) {
|
|
4
|
+
return !!(typeof component === "function" && !!component.prototype.isReactComponent);
|
|
5
|
+
}
|
|
6
|
+
function isFunctionComponent(component) {
|
|
7
|
+
return typeof component === "function" && String(component).includes("return React.createElement");
|
|
8
|
+
}
|
|
9
|
+
function isReactComponent(component) {
|
|
10
|
+
return !!(isClassComponent(component) || isFunctionComponent(component));
|
|
11
|
+
}
|
|
12
|
+
function isElement(element) {
|
|
13
|
+
return React2.isValidElement(element);
|
|
14
|
+
}
|
|
15
|
+
function isDOMTypeElement(element) {
|
|
16
|
+
return isElement(element) && typeof element.type === "string";
|
|
17
|
+
}
|
|
18
|
+
function isCompositeTypeElement(element) {
|
|
19
|
+
return isElement(element) && typeof element.type === "function";
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
isClassComponent,
|
|
23
|
+
isCompositeTypeElement,
|
|
24
|
+
isDOMTypeElement,
|
|
25
|
+
isElement,
|
|
26
|
+
isFunctionComponent,
|
|
27
|
+
isReactComponent
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=reactTypesUtility.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/reactTypesUtility.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\n\nexport function isClassComponent(component) {\n return !!(typeof component === 'function' && !!component.prototype.isReactComponent);\n}\n\nexport function isFunctionComponent(component) {\n return typeof component === 'function' && String(component).includes('return React.createElement');\n}\n\nexport function isReactComponent(component) {\n return !!(isClassComponent(component) || isFunctionComponent(component));\n}\n\nexport function isElement(element) {\n return React.isValidElement(element);\n}\n\nexport function isDOMTypeElement(element) {\n return isElement(element) && typeof element.type === 'string';\n}\n\nexport function isCompositeTypeElement(element) {\n return isElement(element) && typeof element.type === 'function';\n}\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEO,0BAA0B,WAAW;AAC1C,SAAO,CAAC,CAAE,QAAO,cAAc,cAAc,CAAC,CAAC,UAAU,UAAU;AAAA;AAG9D,6BAA6B,WAAW;AAC7C,SAAO,OAAO,cAAc,cAAc,OAAO,WAAW,SAAS;AAAA;AAGhE,0BAA0B,WAAW;AAC1C,SAAO,CAAC,CAAE,kBAAiB,cAAc,oBAAoB;AAAA;AAGxD,mBAAmB,SAAS;AACjC,SAAO,OAAM,eAAe;AAAA;AAGvB,0BAA0B,SAAS;AACxC,SAAO,UAAU,YAAY,OAAO,QAAQ,SAAS;AAAA;AAGhD,gCAAgC,SAAS;AAC9C,SAAO,UAAU,YAAY,OAAO,QAAQ,SAAS;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const resetTimer = (func) => {
|
|
3
|
+
let timeout;
|
|
4
|
+
return function(...args) {
|
|
5
|
+
const context = this;
|
|
6
|
+
const lastCall = () => {
|
|
7
|
+
timeout = null;
|
|
8
|
+
func.apply(context, args);
|
|
9
|
+
};
|
|
10
|
+
clearTimeout(timeout);
|
|
11
|
+
timeout = setTimeout(lastCall, 300);
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
resetTimer
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=scrollingTimer.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/scrollingTimer.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const resetTimer = (func) => {\n let timeout;\n return function(...args) {\n const context = this;\n\n const lastCall = () => {\n timeout = null;\n func.apply(context, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(lastCall, 300);\n };\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,aAAa,CAAC,SAAS;AAClC,MAAI;AACJ,SAAO,YAAY,MAAM;AACvB,UAAM,UAAU;AAEhB,UAAM,WAAW,MAAM;AACrB,gBAAU;AACV,WAAK,MAAM,SAAS;AAAA;AAGtB,iBAAa;AACb,cAAU,WAAW,UAAU;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { isFunction } from "./utils";
|
|
3
|
+
const setRef = (ref, value) => {
|
|
4
|
+
if (isFunction(ref)) {
|
|
5
|
+
ref(value);
|
|
6
|
+
} else if (ref) {
|
|
7
|
+
ref.current = value;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
function mergeRefs(...refs) {
|
|
11
|
+
return (node) => {
|
|
12
|
+
if (!node)
|
|
13
|
+
return;
|
|
14
|
+
refs.forEach((ref) => {
|
|
15
|
+
if (isFunction(ref)) {
|
|
16
|
+
ref(node);
|
|
17
|
+
} else if (ref) {
|
|
18
|
+
ref.current = node;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function logger(...args) {
|
|
24
|
+
console.log(...args);
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
logger,
|
|
28
|
+
mergeRefs,
|
|
29
|
+
setRef
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=system.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/system.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { isFunction } from './utils';\n\nexport const setRef = (ref, value) => {\n if (isFunction(ref)) {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n};\n\nexport function mergeRefs(...refs) {\n return (node) => {\n if (!node) return;\n refs.forEach((ref) => {\n if (isFunction(ref)) {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n });\n };\n}\n\nexport function logger(...args) {\n // eslint-disable-next-line no-console\n console.log(...args);\n}\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEO,MAAM,SAAS,CAAC,KAAK,UAAU;AACpC,MAAI,WAAW,MAAM;AACnB,QAAI;AAAA,aACK,KAAK;AACd,QAAI,UAAU;AAAA;AAAA;AAIX,sBAAsB,MAAM;AACjC,SAAO,CAAC,SAAS;AACf,QAAI,CAAC;AAAM;AACX,SAAK,QAAQ,CAAC,QAAQ;AACpB,UAAI,WAAW,MAAM;AACnB,YAAI;AAAA,iBACK,KAAK;AACd,YAAI,UAAU;AAAA;AAAA;AAAA;AAAA;AAMf,mBAAmB,MAAM;AAE9B,UAAQ,IAAI,GAAG;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { padStart } from "./utils";
|
|
3
|
+
const getVisibleTimeByFormat = (format) => ({
|
|
4
|
+
showHours: format.indexOf("H") > -1 || format.indexOf("h") > -1 || format.indexOf("k") > -1,
|
|
5
|
+
showMinutes: format.indexOf("m") > -1,
|
|
6
|
+
showSeconds: format.indexOf("s") > -1,
|
|
7
|
+
use12Hours: format.indexOf("A") > -1 || format.indexOf("h") > -1 || format.indexOf("a") > -1
|
|
8
|
+
});
|
|
9
|
+
const addLeadingZeros = (count) => (number) => padStart(String(number), count, "0");
|
|
10
|
+
export {
|
|
11
|
+
addLeadingZeros,
|
|
12
|
+
getVisibleTimeByFormat
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=timeUtils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/timeUtils.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { padStart } from './utils';\n\nexport const getVisibleTimeByFormat = format => ({\n showHours:\n format.indexOf('H') > -1 ||\n format.indexOf('h') > -1 ||\n format.indexOf('k') > -1,\n showMinutes: format.indexOf('m') > -1,\n showSeconds: format.indexOf('s') > -1,\n use12Hours:\n format.indexOf('A') > -1 ||\n format.indexOf('h') > -1 ||\n format.indexOf('a') > -1,\n});\n\nexport const addLeadingZeros = count => number =>\n padStart(String(number), count, '0');\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEO,MAAM,yBAAyB,YAAW;AAAA,EAC/C,WACE,OAAO,QAAQ,OAAO,MACtB,OAAO,QAAQ,OAAO,MACtB,OAAO,QAAQ,OAAO;AAAA,EACxB,aAAa,OAAO,QAAQ,OAAO;AAAA,EACnC,aAAa,OAAO,QAAQ,OAAO;AAAA,EACnC,YACE,OAAO,QAAQ,OAAO,MACtB,OAAO,QAAQ,OAAO,MACtB,OAAO,QAAQ,OAAO;AAAA;AAGnB,MAAM,kBAAkB,WAAS,YACtC,SAAS,OAAO,SAAS,OAAO;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|