@elliemae/ds-global-header 3.70.0-next.1 → 3.70.0-next.11
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/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js +17 -21
- package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js.map +2 -2
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js +18 -22
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js.map +2 -2
- package/package.json +12 -12
- package/dist/cjs/hooks/useOnClickOutside.js +0 -60
- package/dist/cjs/hooks/useOnClickOutside.js.map +0 -7
- package/dist/esm/hooks/useOnClickOutside.js +0 -30
- package/dist/esm/hooks/useOnClickOutside.js.map +0 -7
- package/dist/types/hooks/useOnClickOutside.d.ts +0 -1
|
@@ -39,7 +39,6 @@ var import_react = require("react");
|
|
|
39
39
|
var import_constants = require("../../../../constants/index.js");
|
|
40
40
|
var import_styles = require("../../../styles.js");
|
|
41
41
|
var import_PopupMenuContent = require("./menuContent/PopupMenuContent.js");
|
|
42
|
-
var import_useOnClickOutside = require("../../../../hooks/useOnClickOutside.js");
|
|
43
42
|
const PopupMenu = ({
|
|
44
43
|
Icon,
|
|
45
44
|
onClick,
|
|
@@ -48,12 +47,6 @@ const PopupMenu = ({
|
|
|
48
47
|
ownerProps,
|
|
49
48
|
...otherProps
|
|
50
49
|
}) => {
|
|
51
|
-
const { arrowStyles, floatingStyles, isOpen, refs, context, showTooltip, hideTooltip } = (0, import_ds_floating_context.useFloatingContext)({
|
|
52
|
-
externallyControlledIsOpen: componentProps.isOpen,
|
|
53
|
-
placement: "bottom",
|
|
54
|
-
withoutAnimation: true,
|
|
55
|
-
withoutPortal: true
|
|
56
|
-
});
|
|
57
50
|
const {
|
|
58
51
|
onClickOutside = () => null,
|
|
59
52
|
onKeyPress,
|
|
@@ -62,7 +55,22 @@ const PopupMenu = ({
|
|
|
62
55
|
options,
|
|
63
56
|
closeOnClick
|
|
64
57
|
} = componentProps;
|
|
65
|
-
const
|
|
58
|
+
const { arrowStyles, floatingStyles, isOpen, refs, context, showTooltip, hideTooltip } = (0, import_ds_floating_context.useFloatingContext)({
|
|
59
|
+
externallyControlledIsOpen: componentProps.isOpen,
|
|
60
|
+
placement: "bottom",
|
|
61
|
+
withoutAnimation: true,
|
|
62
|
+
withoutPortal: true,
|
|
63
|
+
// The hook auto-excludes clicks inside the floating element and the reference, so the
|
|
64
|
+
// outside boundary is now { reference, floating } — no boundary <div> needed.
|
|
65
|
+
// Gated internally on `isOpen`, so it only fires while open.
|
|
66
|
+
onClickOutside: (event) => {
|
|
67
|
+
onClickOutside(event);
|
|
68
|
+
if (userIsOpen === void 0) {
|
|
69
|
+
hideTooltip();
|
|
70
|
+
refs.reference?.focus();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
66
74
|
const handleOnKeyDown = (0, import_react.useCallback)(
|
|
67
75
|
(e) => {
|
|
68
76
|
if (e.code === "ArrowDown") {
|
|
@@ -88,18 +96,6 @@ const PopupMenu = ({
|
|
|
88
96
|
const handleItemClick = (0, import_react.useCallback)(() => {
|
|
89
97
|
if (closeOnClick && userIsOpen === void 0) handleOnClose();
|
|
90
98
|
}, [closeOnClick, handleOnClose, userIsOpen]);
|
|
91
|
-
const handleOutside = (0, import_react.useCallback)(
|
|
92
|
-
(event) => {
|
|
93
|
-
onClickOutside(event);
|
|
94
|
-
const actuallyOpen = userIsOpen ?? isOpen;
|
|
95
|
-
if (!actuallyOpen) return;
|
|
96
|
-
if (userIsOpen === void 0) {
|
|
97
|
-
handleOnClose();
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
[handleOnClose, isOpen, onClickOutside, userIsOpen]
|
|
101
|
-
);
|
|
102
|
-
(0, import_useOnClickOutside.useOnClickOutside)(userIsOpen ?? isOpen ? boundaryRef.current : null, handleOutside);
|
|
103
99
|
const handleRefs = (0, import_react.useCallback)(
|
|
104
100
|
(ref) => {
|
|
105
101
|
setRef(ref);
|
|
@@ -107,7 +103,7 @@ const PopupMenu = ({
|
|
|
107
103
|
},
|
|
108
104
|
[refs, setRef]
|
|
109
105
|
);
|
|
110
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
111
107
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
112
108
|
import_styles.StyledButton,
|
|
113
109
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.tsx", "../../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useFloatingContext, PopoverArrow, FloatingWrapper } from '@elliemae/ds-floating-context';\nimport { useGetGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport React, { useCallback
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import { useFloatingContext, PopoverArrow, FloatingWrapper } from '@elliemae/ds-floating-context';\nimport { useGetGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport React, { useCallback } from 'react';\nimport { GLOBAL_HEADER_DATA_TESTID } from '../../../../constants/index.js';\nimport type { DSGlobalHeaderT } from '../../../../react-desc-prop-types.js';\nimport { StyledButton } from '../../../styles.js';\nimport { PopupMenuContent } from './menuContent/PopupMenuContent.js';\n\nexport const PopupMenu = ({\n Icon,\n onClick,\n setRef,\n componentProps,\n ownerProps,\n ...otherProps\n}: DSGlobalHeaderT.PopupProps): JSX.Element => {\n const {\n onClickOutside = () => null,\n onKeyPress,\n popupOnKeyPress,\n isOpen: userIsOpen,\n options,\n closeOnClick,\n } = componentProps;\n\n // We need to declare the floating context before we can reference its hideTooltip in\n // handleOutside; but handleOutside is passed into the same hook call. We resolve this by\n // pulling hideTooltip / refs.reference via the latest-ref pattern of the hook itself \u2014\n // see comments on `onClickOutside` below.\n const { arrowStyles, floatingStyles, isOpen, refs, context, showTooltip, hideTooltip } = useFloatingContext({\n externallyControlledIsOpen: componentProps.isOpen,\n placement: 'bottom',\n withoutAnimation: true,\n withoutPortal: true,\n // The hook auto-excludes clicks inside the floating element and the reference, so the\n // outside boundary is now { reference, floating } \u2014 no boundary <div> needed.\n // Gated internally on `isOpen`, so it only fires while open.\n onClickOutside: (event) => {\n onClickOutside(event);\n if (userIsOpen === undefined) {\n hideTooltip();\n (refs.reference as HTMLElement)?.focus();\n }\n },\n });\n\n const handleOnKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.code === 'ArrowDown') {\n showTooltip();\n }\n if (onKeyPress) onKeyPress(e);\n },\n [onKeyPress, showTooltip],\n );\n\n const handleOnClose = useCallback(() => {\n if (userIsOpen === undefined) {\n hideTooltip();\n }\n (refs.reference as HTMLElement)?.focus();\n }, [hideTooltip, refs.reference, userIsOpen]);\n\n const handleTriggerOnClick = useCallback(\n (e: React.MouseEvent) => {\n if (userIsOpen === undefined) showTooltip();\n if (onClick) onClick(e);\n },\n [onClick, userIsOpen, showTooltip],\n );\n\n const handleItemClick = useCallback(() => {\n if (closeOnClick && userIsOpen === undefined) handleOnClose();\n }, [closeOnClick, handleOnClose, userIsOpen]);\n\n const handleRefs = useCallback(\n (ref: HTMLButtonElement) => {\n setRef(ref);\n refs.setReference(ref);\n },\n [refs, setRef],\n );\n return (\n <div>\n <StyledButton\n onClick={handleTriggerOnClick}\n onKeyDown={handleOnKeyDown}\n innerRef={handleRefs}\n data-testid={GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM_BUTTON}\n aria-haspopup\n aria-expanded={userIsOpen ?? isOpen}\n {...useGetGlobalAttributes(otherProps)}\n type=\"button\"\n {...ownerProps}\n >\n {Icon && <Icon size=\"m\" />}\n </StyledButton>\n\n {refs.reference ? (\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={userIsOpen ?? isOpen}\n floatingStyles={floatingStyles}\n context={context}\n >\n <PopupMenuContent\n options={options}\n onItemClick={handleItemClick}\n onClose={handleOnClose}\n setIsOpen={hideTooltip}\n popupOnKeyPress={popupOnKeyPress}\n ownerProps={ownerProps}\n />\n <PopoverArrow {...arrowStyles} />\n </FloatingWrapper>\n ) : null}\n </div>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD+FN;AA/FjB,iCAAkE;AAClE,8BAAuC;AACvC,mBAAmC;AACnC,uBAA0C;AAE1C,oBAA6B;AAC7B,8BAAiC;AAE1B,MAAM,YAAY,CAAC;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAA+C;AAC7C,QAAM;AAAA,IACJ,iBAAiB,MAAM;AAAA,IACvB;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,IAAI;AAMJ,QAAM,EAAE,aAAa,gBAAgB,QAAQ,MAAM,SAAS,aAAa,YAAY,QAAI,+CAAmB;AAAA,IAC1G,4BAA4B,eAAe;AAAA,IAC3C,WAAW;AAAA,IACX,kBAAkB;AAAA,IAClB,eAAe;AAAA;AAAA;AAAA;AAAA,IAIf,gBAAgB,CAAC,UAAU;AACzB,qBAAe,KAAK;AACpB,UAAI,eAAe,QAAW;AAC5B,oBAAY;AACZ,QAAC,KAAK,WAA2B,MAAM;AAAA,MACzC;AAAA,IACF;AAAA,EACF,CAAC;AAED,QAAM,sBAAkB;AAAA,IACtB,CAAC,MAA2B;AAC1B,UAAI,EAAE,SAAS,aAAa;AAC1B,oBAAY;AAAA,MACd;AACA,UAAI,WAA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,2CAAc,GAAG,aAAa;AAAA;AAAA;AAAA,IACjC,IACE;AAAA,KACN;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,11 +2,10 @@ import * as React from "react";
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useFloatingContext, PopoverArrow, FloatingWrapper } from "@elliemae/ds-floating-context";
|
|
4
4
|
import { useGetGlobalAttributes } from "@elliemae/ds-props-helpers";
|
|
5
|
-
import { useCallback
|
|
5
|
+
import { useCallback } from "react";
|
|
6
6
|
import { GLOBAL_HEADER_DATA_TESTID } from "../../../../constants/index.js";
|
|
7
7
|
import { StyledButton } from "../../../styles.js";
|
|
8
8
|
import { PopupMenuContent } from "./menuContent/PopupMenuContent.js";
|
|
9
|
-
import { useOnClickOutside } from "../../../../hooks/useOnClickOutside.js";
|
|
10
9
|
const PopupMenu = ({
|
|
11
10
|
Icon,
|
|
12
11
|
onClick,
|
|
@@ -15,12 +14,6 @@ const PopupMenu = ({
|
|
|
15
14
|
ownerProps,
|
|
16
15
|
...otherProps
|
|
17
16
|
}) => {
|
|
18
|
-
const { arrowStyles, floatingStyles, isOpen, refs, context, showTooltip, hideTooltip } = useFloatingContext({
|
|
19
|
-
externallyControlledIsOpen: componentProps.isOpen,
|
|
20
|
-
placement: "bottom",
|
|
21
|
-
withoutAnimation: true,
|
|
22
|
-
withoutPortal: true
|
|
23
|
-
});
|
|
24
17
|
const {
|
|
25
18
|
onClickOutside = () => null,
|
|
26
19
|
onKeyPress,
|
|
@@ -29,7 +22,22 @@ const PopupMenu = ({
|
|
|
29
22
|
options,
|
|
30
23
|
closeOnClick
|
|
31
24
|
} = componentProps;
|
|
32
|
-
const
|
|
25
|
+
const { arrowStyles, floatingStyles, isOpen, refs, context, showTooltip, hideTooltip } = useFloatingContext({
|
|
26
|
+
externallyControlledIsOpen: componentProps.isOpen,
|
|
27
|
+
placement: "bottom",
|
|
28
|
+
withoutAnimation: true,
|
|
29
|
+
withoutPortal: true,
|
|
30
|
+
// The hook auto-excludes clicks inside the floating element and the reference, so the
|
|
31
|
+
// outside boundary is now { reference, floating } — no boundary <div> needed.
|
|
32
|
+
// Gated internally on `isOpen`, so it only fires while open.
|
|
33
|
+
onClickOutside: (event) => {
|
|
34
|
+
onClickOutside(event);
|
|
35
|
+
if (userIsOpen === void 0) {
|
|
36
|
+
hideTooltip();
|
|
37
|
+
refs.reference?.focus();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
33
41
|
const handleOnKeyDown = useCallback(
|
|
34
42
|
(e) => {
|
|
35
43
|
if (e.code === "ArrowDown") {
|
|
@@ -55,18 +63,6 @@ const PopupMenu = ({
|
|
|
55
63
|
const handleItemClick = useCallback(() => {
|
|
56
64
|
if (closeOnClick && userIsOpen === void 0) handleOnClose();
|
|
57
65
|
}, [closeOnClick, handleOnClose, userIsOpen]);
|
|
58
|
-
const handleOutside = useCallback(
|
|
59
|
-
(event) => {
|
|
60
|
-
onClickOutside(event);
|
|
61
|
-
const actuallyOpen = userIsOpen ?? isOpen;
|
|
62
|
-
if (!actuallyOpen) return;
|
|
63
|
-
if (userIsOpen === void 0) {
|
|
64
|
-
handleOnClose();
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
[handleOnClose, isOpen, onClickOutside, userIsOpen]
|
|
68
|
-
);
|
|
69
|
-
useOnClickOutside(userIsOpen ?? isOpen ? boundaryRef.current : null, handleOutside);
|
|
70
66
|
const handleRefs = useCallback(
|
|
71
67
|
(ref) => {
|
|
72
68
|
setRef(ref);
|
|
@@ -74,7 +70,7 @@ const PopupMenu = ({
|
|
|
74
70
|
},
|
|
75
71
|
[refs, setRef]
|
|
76
72
|
);
|
|
77
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
73
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
78
74
|
/* @__PURE__ */ jsx(
|
|
79
75
|
StyledButton,
|
|
80
76
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useFloatingContext, PopoverArrow, FloatingWrapper } from '@elliemae/ds-floating-context';\nimport { useGetGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport React, { useCallback
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useFloatingContext, PopoverArrow, FloatingWrapper } from '@elliemae/ds-floating-context';\nimport { useGetGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport React, { useCallback } from 'react';\nimport { GLOBAL_HEADER_DATA_TESTID } from '../../../../constants/index.js';\nimport type { DSGlobalHeaderT } from '../../../../react-desc-prop-types.js';\nimport { StyledButton } from '../../../styles.js';\nimport { PopupMenuContent } from './menuContent/PopupMenuContent.js';\n\nexport const PopupMenu = ({\n Icon,\n onClick,\n setRef,\n componentProps,\n ownerProps,\n ...otherProps\n}: DSGlobalHeaderT.PopupProps): JSX.Element => {\n const {\n onClickOutside = () => null,\n onKeyPress,\n popupOnKeyPress,\n isOpen: userIsOpen,\n options,\n closeOnClick,\n } = componentProps;\n\n // We need to declare the floating context before we can reference its hideTooltip in\n // handleOutside; but handleOutside is passed into the same hook call. We resolve this by\n // pulling hideTooltip / refs.reference via the latest-ref pattern of the hook itself \u2014\n // see comments on `onClickOutside` below.\n const { arrowStyles, floatingStyles, isOpen, refs, context, showTooltip, hideTooltip } = useFloatingContext({\n externallyControlledIsOpen: componentProps.isOpen,\n placement: 'bottom',\n withoutAnimation: true,\n withoutPortal: true,\n // The hook auto-excludes clicks inside the floating element and the reference, so the\n // outside boundary is now { reference, floating } \u2014 no boundary <div> needed.\n // Gated internally on `isOpen`, so it only fires while open.\n onClickOutside: (event) => {\n onClickOutside(event);\n if (userIsOpen === undefined) {\n hideTooltip();\n (refs.reference as HTMLElement)?.focus();\n }\n },\n });\n\n const handleOnKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.code === 'ArrowDown') {\n showTooltip();\n }\n if (onKeyPress) onKeyPress(e);\n },\n [onKeyPress, showTooltip],\n );\n\n const handleOnClose = useCallback(() => {\n if (userIsOpen === undefined) {\n hideTooltip();\n }\n (refs.reference as HTMLElement)?.focus();\n }, [hideTooltip, refs.reference, userIsOpen]);\n\n const handleTriggerOnClick = useCallback(\n (e: React.MouseEvent) => {\n if (userIsOpen === undefined) showTooltip();\n if (onClick) onClick(e);\n },\n [onClick, userIsOpen, showTooltip],\n );\n\n const handleItemClick = useCallback(() => {\n if (closeOnClick && userIsOpen === undefined) handleOnClose();\n }, [closeOnClick, handleOnClose, userIsOpen]);\n\n const handleRefs = useCallback(\n (ref: HTMLButtonElement) => {\n setRef(ref);\n refs.setReference(ref);\n },\n [refs, setRef],\n );\n return (\n <div>\n <StyledButton\n onClick={handleTriggerOnClick}\n onKeyDown={handleOnKeyDown}\n innerRef={handleRefs}\n data-testid={GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM_BUTTON}\n aria-haspopup\n aria-expanded={userIsOpen ?? isOpen}\n {...useGetGlobalAttributes(otherProps)}\n type=\"button\"\n {...ownerProps}\n >\n {Icon && <Icon size=\"m\" />}\n </StyledButton>\n\n {refs.reference ? (\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={userIsOpen ?? isOpen}\n floatingStyles={floatingStyles}\n context={context}\n >\n <PopupMenuContent\n options={options}\n onItemClick={handleItemClick}\n onClose={handleOnClose}\n setIsOpen={hideTooltip}\n popupOnKeyPress={popupOnKeyPress}\n ownerProps={ownerProps}\n />\n <PopoverArrow {...arrowStyles} />\n </FloatingWrapper>\n ) : null}\n </div>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC+FN,cAIT,YAJS;AA/F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AEA,QAAM,kBAAkB,YAAY,MAAM;AACxC,QAAI,gBAAgB,eAAe,OAAW,eAAc;AAAA,EAC9D,GAAG,CAAC,cAAc,eAAe,UAAU,CAAC;AAE5C,QAAM,aAAa;AAAA,IACjB,CAAC,QAA2B;AAC1B,aAAO,GAAG;AACV,WAAK,aAAa,GAAG;AAAA,IACvB;AAAA,IACA,CAAC,MAAM,MAAM;AAAA,EACf;AACA,SACE,qBAAC,SACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT,WAAW;AAAA,QACX,UAAU;AAAA,QACV,eAAa,0BAA0B;AAAA,QACvC,iBAAa;AAAA,QACb,iBAAe,cAAc;AAAA,QAC5B,GAAG,uBAAuB,UAAU;AAAA,QACrC,MAAK;AAAA,QACJ,GAAG;AAAA,QAEH,kBAAQ,oBAAC,QAAK,MAAK,KAAI;AAAA;AAAA,IAC1B;AAAA,IAEC,KAAK,YACJ;AAAA,MAAC;AAAA;AAAA,QACC,UAAU,KAAK;AAAA,QACf,QAAQ,cAAc;AAAA,QACtB;AAAA,QACA;AAAA,QAEA;AAAA;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA,aAAa;AAAA,cACb,SAAS;AAAA,cACT,WAAW;AAAA,cACX;AAAA,cACA;AAAA;AAAA,UACF;AAAA,UACA,oBAAC,gBAAc,GAAG,aAAa;AAAA;AAAA;AAAA,IACjC,IACE;AAAA,KACN;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-global-header",
|
|
3
|
-
"version": "3.70.0-next.
|
|
3
|
+
"version": "3.70.0-next.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Global Header",
|
|
6
6
|
"files": [
|
|
@@ -37,21 +37,21 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"uid": "^2.0.2",
|
|
40
|
-
"@elliemae/ds-button-v2": "3.70.0-next.
|
|
41
|
-
"@elliemae/ds-
|
|
42
|
-
"@elliemae/ds-
|
|
43
|
-
"@elliemae/ds-
|
|
44
|
-
"@elliemae/ds-
|
|
45
|
-
"@elliemae/ds-
|
|
46
|
-
"@elliemae/ds-
|
|
47
|
-
"@elliemae/ds-icons": "3.70.0-next.
|
|
48
|
-
"@elliemae/ds-
|
|
40
|
+
"@elliemae/ds-button-v2": "3.70.0-next.11",
|
|
41
|
+
"@elliemae/ds-floating-context": "3.70.0-next.11",
|
|
42
|
+
"@elliemae/ds-form-input-text": "3.70.0-next.11",
|
|
43
|
+
"@elliemae/ds-app-picker": "3.70.0-next.11",
|
|
44
|
+
"@elliemae/ds-props-helpers": "3.70.0-next.11",
|
|
45
|
+
"@elliemae/ds-grid": "3.70.0-next.11",
|
|
46
|
+
"@elliemae/ds-system": "3.70.0-next.11",
|
|
47
|
+
"@elliemae/ds-icons": "3.70.0-next.11",
|
|
48
|
+
"@elliemae/ds-hooks-fontsize-media": "3.70.0-next.11"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"jest": "^30.0.0",
|
|
52
52
|
"styled-components": "~5.3.9",
|
|
53
|
-
"@elliemae/ds-monorepo-devops": "3.70.0-next.
|
|
54
|
-
"@elliemae/ds-test-utils": "3.70.0-next.
|
|
53
|
+
"@elliemae/ds-monorepo-devops": "3.70.0-next.11",
|
|
54
|
+
"@elliemae/ds-test-utils": "3.70.0-next.11"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"lodash-es": "^4.17.21",
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var useOnClickOutside_exports = {};
|
|
30
|
-
__export(useOnClickOutside_exports, {
|
|
31
|
-
useOnClickOutside: () => useOnClickOutside
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(useOnClickOutside_exports);
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_react = __toESM(require("react"));
|
|
36
|
-
function useOnClickOutside(ref, cb) {
|
|
37
|
-
const cbRef = import_react.default.useRef(cb);
|
|
38
|
-
(0, import_react.useEffect)(() => {
|
|
39
|
-
cbRef.current = cb;
|
|
40
|
-
}, [cb]);
|
|
41
|
-
(0, import_react.useEffect)(() => {
|
|
42
|
-
if (!ref) {
|
|
43
|
-
return () => {
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
const listener = (event) => {
|
|
47
|
-
const target = event.target;
|
|
48
|
-
if (!target) return;
|
|
49
|
-
if (ref.contains(target)) return;
|
|
50
|
-
cbRef.current(event);
|
|
51
|
-
};
|
|
52
|
-
document.addEventListener("mousedown", listener, true);
|
|
53
|
-
document.addEventListener("touchstart", listener, true);
|
|
54
|
-
return () => {
|
|
55
|
-
document.removeEventListener("mousedown", listener, true);
|
|
56
|
-
document.removeEventListener("touchstart", listener, true);
|
|
57
|
-
};
|
|
58
|
-
}, [ref]);
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=useOnClickOutside.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useOnClickOutside.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useEffect } from 'react';\n\nexport function useOnClickOutside<T extends Node>(ref: T | null, cb: (event: Event) => void): void {\n const cbRef = React.useRef(cb);\n\n useEffect(() => {\n cbRef.current = cb;\n }, [cb]);\n\n useEffect(() => {\n if (!ref) {\n return () => {};\n }\n\n const listener = (event: MouseEvent | TouchEvent) => {\n const target = event.target as Node | null;\n if (!target) return;\n\n if (ref.contains(target)) return;\n\n cbRef.current(event);\n };\n\n document.addEventListener('mousedown', listener, true);\n document.addEventListener('touchstart', listener, true);\n\n return () => {\n document.removeEventListener('mousedown', listener, true);\n document.removeEventListener('touchstart', listener, true);\n };\n }, [ref]);\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAiC;AAE1B,SAAS,kBAAkC,KAAe,IAAkC;AACjG,QAAM,QAAQ,aAAAA,QAAM,OAAO,EAAE;AAE7B,8BAAU,MAAM;AACd,UAAM,UAAU;AAAA,EAClB,GAAG,CAAC,EAAE,CAAC;AAEP,8BAAU,MAAM;AACd,QAAI,CAAC,KAAK;AACR,aAAO,MAAM;AAAA,MAAC;AAAA,IAChB;AAEA,UAAM,WAAW,CAAC,UAAmC;AACnD,YAAM,SAAS,MAAM;AACrB,UAAI,CAAC,OAAQ;AAEb,UAAI,IAAI,SAAS,MAAM,EAAG;AAE1B,YAAM,QAAQ,KAAK;AAAA,IACrB;AAEA,aAAS,iBAAiB,aAAa,UAAU,IAAI;AACrD,aAAS,iBAAiB,cAAc,UAAU,IAAI;AAEtD,WAAO,MAAM;AACX,eAAS,oBAAoB,aAAa,UAAU,IAAI;AACxD,eAAS,oBAAoB,cAAc,UAAU,IAAI;AAAA,IAC3D;AAAA,EACF,GAAG,CAAC,GAAG,CAAC;AACV;",
|
|
6
|
-
"names": ["React"]
|
|
7
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import React2, { useEffect } from "react";
|
|
3
|
-
function useOnClickOutside(ref, cb) {
|
|
4
|
-
const cbRef = React2.useRef(cb);
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
cbRef.current = cb;
|
|
7
|
-
}, [cb]);
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
if (!ref) {
|
|
10
|
-
return () => {
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
const listener = (event) => {
|
|
14
|
-
const target = event.target;
|
|
15
|
-
if (!target) return;
|
|
16
|
-
if (ref.contains(target)) return;
|
|
17
|
-
cbRef.current(event);
|
|
18
|
-
};
|
|
19
|
-
document.addEventListener("mousedown", listener, true);
|
|
20
|
-
document.addEventListener("touchstart", listener, true);
|
|
21
|
-
return () => {
|
|
22
|
-
document.removeEventListener("mousedown", listener, true);
|
|
23
|
-
document.removeEventListener("touchstart", listener, true);
|
|
24
|
-
};
|
|
25
|
-
}, [ref]);
|
|
26
|
-
}
|
|
27
|
-
export {
|
|
28
|
-
useOnClickOutside
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=useOnClickOutside.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useOnClickOutside.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useEffect } from 'react';\n\nexport function useOnClickOutside<T extends Node>(ref: T | null, cb: (event: Event) => void): void {\n const cbRef = React.useRef(cb);\n\n useEffect(() => {\n cbRef.current = cb;\n }, [cb]);\n\n useEffect(() => {\n if (!ref) {\n return () => {};\n }\n\n const listener = (event: MouseEvent | TouchEvent) => {\n const target = event.target as Node | null;\n if (!target) return;\n\n if (ref.contains(target)) return;\n\n cbRef.current(event);\n };\n\n document.addEventListener('mousedown', listener, true);\n document.addEventListener('touchstart', listener, true);\n\n return () => {\n document.removeEventListener('mousedown', listener, true);\n document.removeEventListener('touchstart', listener, true);\n };\n }, [ref]);\n}\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,UAAS,iBAAiB;AAE1B,SAAS,kBAAkC,KAAe,IAAkC;AACjG,QAAM,QAAQA,OAAM,OAAO,EAAE;AAE7B,YAAU,MAAM;AACd,UAAM,UAAU;AAAA,EAClB,GAAG,CAAC,EAAE,CAAC;AAEP,YAAU,MAAM;AACd,QAAI,CAAC,KAAK;AACR,aAAO,MAAM;AAAA,MAAC;AAAA,IAChB;AAEA,UAAM,WAAW,CAAC,UAAmC;AACnD,YAAM,SAAS,MAAM;AACrB,UAAI,CAAC,OAAQ;AAEb,UAAI,IAAI,SAAS,MAAM,EAAG;AAE1B,YAAM,QAAQ,KAAK;AAAA,IACrB;AAEA,aAAS,iBAAiB,aAAa,UAAU,IAAI;AACrD,aAAS,iBAAiB,cAAc,UAAU,IAAI;AAEtD,WAAO,MAAM;AACX,eAAS,oBAAoB,aAAa,UAAU,IAAI;AACxD,eAAS,oBAAoB,cAAc,UAAU,IAAI;AAAA,IAC3D;AAAA,EACF,GAAG,CAAC,GAAG,CAAC;AACV;",
|
|
6
|
-
"names": ["React"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useOnClickOutside<T extends Node>(ref: T | null, cb: (event: Event) => void): void;
|