@fluentui/react-utilities 9.7.1 → 9.7.3
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/.swcrc +30 -0
- package/CHANGELOG.json +49 -1
- package/CHANGELOG.md +23 -2
- package/dist/index.d.ts +16 -4
- package/lib/compose/getSlots.js +3 -3
- package/lib/compose/getSlots.js.map +1 -1
- package/lib/compose/index.js.map +1 -1
- package/lib/compose/isResolvedShorthand.js.map +1 -1
- package/lib/compose/resolveShorthand.js.map +1 -1
- package/lib/compose/types.js +1 -1
- package/lib/compose/types.js.map +1 -1
- package/lib/events/index.js.map +1 -1
- package/lib/events/mouseTouchHelpers.js +1 -0
- package/lib/events/mouseTouchHelpers.js.map +1 -1
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useControllableState.js.map +1 -1
- package/lib/hooks/useEventCallback.js.map +1 -1
- package/lib/hooks/useFirstMount.js.map +1 -1
- package/lib/hooks/useForceUpdate.js.map +1 -1
- package/lib/hooks/useId.js.map +1 -1
- package/lib/hooks/useIsomorphicLayoutEffect.js +1 -2
- package/lib/hooks/useIsomorphicLayoutEffect.js.map +1 -1
- package/lib/hooks/useMergedRefs.js.map +1 -1
- package/lib/hooks/useOnClickOutside.js +16 -9
- package/lib/hooks/useOnClickOutside.js.map +1 -1
- package/lib/hooks/useOnScrollOutside.js +3 -1
- package/lib/hooks/useOnScrollOutside.js.map +1 -1
- package/lib/hooks/usePrevious.js.map +1 -1
- package/lib/hooks/useScrollbarWidth.js.map +1 -1
- package/lib/hooks/useTimeout.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/ssr/SSRContext.js +2 -2
- package/lib/ssr/SSRContext.js.map +1 -1
- package/lib/ssr/canUseDOM.js +1 -2
- package/lib/ssr/canUseDOM.js.map +1 -1
- package/lib/ssr/index.js.map +1 -1
- package/lib/trigger/applyTriggerPropsToChildren.js.map +1 -1
- package/lib/trigger/getTriggerChild.js.map +1 -1
- package/lib/trigger/index.js.map +1 -1
- package/lib/trigger/isFluentTrigger.js +1 -0
- package/lib/trigger/isFluentTrigger.js.map +1 -1
- package/lib/trigger/types.js +1 -1
- package/lib/trigger/types.js.map +1 -1
- package/lib/utils/clamp.js +1 -2
- package/lib/utils/clamp.js.map +1 -1
- package/lib/utils/getNativeElementProps.js +2 -2
- package/lib/utils/getNativeElementProps.js.map +1 -1
- package/lib/utils/getRTLSafeKey.js +1 -2
- package/lib/utils/getRTLSafeKey.js.map +1 -1
- package/lib/utils/getReactCallbackName.js +1 -0
- package/lib/utils/getReactCallbackName.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/isHTMLElement.js +12 -7
- package/lib/utils/isHTMLElement.js.map +1 -1
- package/lib/utils/isInteractiveHTMLElement.js.map +1 -1
- package/lib/utils/mergeCallbacks.js +1 -2
- package/lib/utils/mergeCallbacks.js.map +1 -1
- package/lib/utils/omit.js +1 -2
- package/lib/utils/omit.js.map +1 -1
- package/lib/utils/properties.js +24 -51
- package/lib/utils/properties.js.map +1 -1
- package/lib-commonjs/compose/getSlots.js +48 -55
- package/lib-commonjs/compose/getSlots.js.map +1 -1
- package/lib-commonjs/compose/index.js +8 -7
- package/lib-commonjs/compose/index.js.map +1 -1
- package/lib-commonjs/compose/isResolvedShorthand.js +9 -37
- package/lib-commonjs/compose/isResolvedShorthand.js.map +1 -1
- package/lib-commonjs/compose/resolveShorthand.js +25 -32
- package/lib-commonjs/compose/resolveShorthand.js.map +1 -1
- package/lib-commonjs/compose/types.js +5 -2
- package/lib-commonjs/compose/types.js.map +1 -1
- package/lib-commonjs/events/index.js +5 -4
- package/lib-commonjs/events/index.js.map +1 -1
- package/lib-commonjs/events/mouseTouchHelpers.js +40 -37
- package/lib-commonjs/events/mouseTouchHelpers.js.map +1 -1
- package/lib-commonjs/hooks/index.js +16 -15
- package/lib-commonjs/hooks/index.js.map +1 -1
- package/lib-commonjs/hooks/useControllableState.js +63 -64
- package/lib-commonjs/hooks/useControllableState.js.map +1 -1
- package/lib-commonjs/hooks/useEventCallback.js +25 -31
- package/lib-commonjs/hooks/useEventCallback.js.map +1 -1
- package/lib-commonjs/hooks/useFirstMount.js +15 -23
- package/lib-commonjs/hooks/useFirstMount.js.map +1 -1
- package/lib-commonjs/hooks/useForceUpdate.js +9 -11
- package/lib-commonjs/hooks/useForceUpdate.js.map +1 -1
- package/lib-commonjs/hooks/useId.js +47 -46
- package/lib-commonjs/hooks/useId.js.map +1 -1
- package/lib-commonjs/hooks/useIsomorphicLayoutEffect.js +10 -16
- package/lib-commonjs/hooks/useIsomorphicLayoutEffect.js.map +1 -1
- package/lib-commonjs/hooks/useMergedRefs.js +25 -27
- package/lib-commonjs/hooks/useMergedRefs.js.map +1 -1
- package/lib-commonjs/hooks/useOnClickOutside.js +118 -114
- package/lib-commonjs/hooks/useOnClickOutside.js.map +1 -1
- package/lib-commonjs/hooks/useOnScrollOutside.js +35 -36
- package/lib-commonjs/hooks/useOnScrollOutside.js.map +1 -1
- package/lib-commonjs/hooks/usePrevious.js +17 -15
- package/lib-commonjs/hooks/usePrevious.js.map +1 -1
- package/lib-commonjs/hooks/useScrollbarWidth.js +32 -32
- package/lib-commonjs/hooks/useScrollbarWidth.js.map +1 -1
- package/lib-commonjs/hooks/useTimeout.js +30 -30
- package/lib-commonjs/hooks/useTimeout.js.map +1 -1
- package/lib-commonjs/index.js +52 -214
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/ssr/SSRContext.js +57 -59
- package/lib-commonjs/ssr/SSRContext.js.map +1 -1
- package/lib-commonjs/ssr/canUseDOM.js +12 -12
- package/lib-commonjs/ssr/canUseDOM.js.map +1 -1
- package/lib-commonjs/ssr/index.js +6 -5
- package/lib-commonjs/ssr/index.js.map +1 -1
- package/lib-commonjs/trigger/applyTriggerPropsToChildren.js +29 -31
- package/lib-commonjs/trigger/applyTriggerPropsToChildren.js.map +1 -1
- package/lib-commonjs/trigger/getTriggerChild.js +16 -36
- package/lib-commonjs/trigger/getTriggerChild.js.map +1 -1
- package/lib-commonjs/trigger/index.js +8 -7
- package/lib-commonjs/trigger/index.js.map +1 -1
- package/lib-commonjs/trigger/isFluentTrigger.js +10 -11
- package/lib-commonjs/trigger/isFluentTrigger.js.map +1 -1
- package/lib-commonjs/trigger/types.js +5 -2
- package/lib-commonjs/trigger/types.js.map +1 -1
- package/lib-commonjs/utils/clamp.js +10 -9
- package/lib-commonjs/utils/clamp.js.map +1 -1
- package/lib-commonjs/utils/getNativeElementProps.js +54 -61
- package/lib-commonjs/utils/getNativeElementProps.js.map +1 -1
- package/lib-commonjs/utils/getRTLSafeKey.js +22 -21
- package/lib-commonjs/utils/getRTLSafeKey.js.map +1 -1
- package/lib-commonjs/utils/getReactCallbackName.js +24 -24
- package/lib-commonjs/utils/getReactCallbackName.js.map +1 -1
- package/lib-commonjs/utils/index.js +12 -11
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/isHTMLElement.js +22 -15
- package/lib-commonjs/utils/isHTMLElement.js.map +1 -1
- package/lib-commonjs/utils/isInteractiveHTMLElement.js +20 -24
- package/lib-commonjs/utils/isInteractiveHTMLElement.js.map +1 -1
- package/lib-commonjs/utils/mergeCallbacks.js +14 -13
- package/lib-commonjs/utils/mergeCallbacks.js.map +1 -1
- package/lib-commonjs/utils/omit.js +18 -17
- package/lib-commonjs/utils/omit.js.map +1 -1
- package/lib-commonjs/utils/properties.js +327 -223
- package/lib-commonjs/utils/properties.js.map +1 -1
- package/package.json +5 -4
- package/lib-amd/compose/getSlots.js +0 -58
- package/lib-amd/compose/getSlots.js.map +0 -1
- package/lib-amd/compose/index.js +0 -9
- package/lib-amd/compose/index.js.map +0 -1
- package/lib-amd/compose/isResolvedShorthand.js +0 -40
- package/lib-amd/compose/isResolvedShorthand.js.map +0 -1
- package/lib-amd/compose/resolveShorthand.js +0 -27
- package/lib-amd/compose/resolveShorthand.js.map +0 -1
- package/lib-amd/compose/types.js +0 -5
- package/lib-amd/compose/types.js.map +0 -1
- package/lib-amd/events/index.js +0 -6
- package/lib-amd/events/index.js.map +0 -1
- package/lib-amd/events/mouseTouchHelpers.js +0 -39
- package/lib-amd/events/mouseTouchHelpers.js.map +0 -1
- package/lib-amd/hooks/index.js +0 -17
- package/lib-amd/hooks/index.js.map +0 -1
- package/lib-amd/hooks/useControllableState.js +0 -81
- package/lib-amd/hooks/useControllableState.js.map +0 -1
- package/lib-amd/hooks/useEventCallback.js +0 -36
- package/lib-amd/hooks/useEventCallback.js.map +0 -1
- package/lib-amd/hooks/useFirstMount.js +0 -26
- package/lib-amd/hooks/useFirstMount.js.map +0 -1
- package/lib-amd/hooks/useForceUpdate.js +0 -14
- package/lib-amd/hooks/useForceUpdate.js.map +0 -1
- package/lib-amd/hooks/useId.js +0 -54
- package/lib-amd/hooks/useId.js.map +0 -1
- package/lib-amd/hooks/useIsomorphicLayoutEffect.js +0 -17
- package/lib-amd/hooks/useIsomorphicLayoutEffect.js.map +0 -1
- package/lib-amd/hooks/useMergedRefs.js +0 -34
- package/lib-amd/hooks/useMergedRefs.js.map +0 -1
- package/lib-amd/hooks/useOnClickOutside.js +0 -114
- package/lib-amd/hooks/useOnClickOutside.js.map +0 -1
- package/lib-amd/hooks/useOnScrollOutside.js +0 -31
- package/lib-amd/hooks/useOnScrollOutside.js.map +0 -1
- package/lib-amd/hooks/usePrevious.js +0 -17
- package/lib-amd/hooks/usePrevious.js.map +0 -1
- package/lib-amd/hooks/useScrollbarWidth.js +0 -32
- package/lib-amd/hooks/useScrollbarWidth.js.map +0 -1
- package/lib-amd/hooks/useTimeout.js +0 -33
- package/lib-amd/hooks/useTimeout.js.map +0 -1
- package/lib-amd/index.js +0 -40
- package/lib-amd/index.js.map +0 -1
- package/lib-amd/ssr/SSRContext.js +0 -69
- package/lib-amd/ssr/SSRContext.js.map +0 -1
- package/lib-amd/ssr/canUseDOM.js +0 -16
- package/lib-amd/ssr/canUseDOM.js.map +0 -1
- package/lib-amd/ssr/index.js +0 -7
- package/lib-amd/ssr/index.js.map +0 -1
- package/lib-amd/trigger/applyTriggerPropsToChildren.js +0 -40
- package/lib-amd/trigger/applyTriggerPropsToChildren.js.map +0 -1
- package/lib-amd/trigger/getTriggerChild.js +0 -40
- package/lib-amd/trigger/getTriggerChild.js.map +0 -1
- package/lib-amd/trigger/index.js +0 -9
- package/lib-amd/trigger/index.js.map +0 -1
- package/lib-amd/trigger/isFluentTrigger.js +0 -15
- package/lib-amd/trigger/isFluentTrigger.js.map +0 -1
- package/lib-amd/trigger/types.js +0 -5
- package/lib-amd/trigger/types.js.map +0 -1
- package/lib-amd/utils/clamp.js +0 -16
- package/lib-amd/utils/clamp.js.map +0 -1
- package/lib-amd/utils/getNativeElementProps.js +0 -64
- package/lib-amd/utils/getNativeElementProps.js.map +0 -1
- package/lib-amd/utils/getRTLSafeKey.js +0 -24
- package/lib-amd/utils/getRTLSafeKey.js.map +0 -1
- package/lib-amd/utils/index.js +0 -13
- package/lib-amd/utils/index.js.map +0 -1
- package/lib-amd/utils/isHTMLElement.js +0 -22
- package/lib-amd/utils/isHTMLElement.js.map +0 -1
- package/lib-amd/utils/isInteractiveHTMLElement.js +0 -25
- package/lib-amd/utils/isInteractiveHTMLElement.js.map +0 -1
- package/lib-amd/utils/mergeCallbacks.js +0 -40
- package/lib-amd/utils/mergeCallbacks.js.map +0 -1
- package/lib-amd/utils/omit.js +0 -31
- package/lib-amd/utils/omit.js.map +0 -1
- package/lib-amd/utils/properties.js +0 -450
- package/lib-amd/utils/properties.js.map +0 -1
@@ -1,56 +1,57 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
function _export(target, all) {
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
7
|
+
enumerable: true,
|
8
|
+
get: all[name]
|
9
|
+
});
|
10
|
+
}
|
11
|
+
_export(exports, {
|
12
|
+
IdPrefixProvider: ()=>IdPrefixProvider,
|
13
|
+
resetIdsForTests: ()=>resetIdsForTests,
|
14
|
+
useId: ()=>useId
|
5
15
|
});
|
6
|
-
|
7
|
-
const
|
8
|
-
const
|
9
|
-
const IdPrefixContext = /*#__PURE__*/
|
10
|
-
|
11
|
-
* Allows to define a prefix that will be used for all IDs generated by useId() hook. It's useful to avoid collisions
|
12
|
-
* between different bundles.
|
13
|
-
*/
|
14
|
-
exports.IdPrefixProvider = IdPrefixContext.Provider;
|
16
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
17
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
18
|
+
const _index = require("../ssr/index");
|
19
|
+
const IdPrefixContext = /*#__PURE__*/ _react.createContext(undefined);
|
20
|
+
const IdPrefixProvider = IdPrefixContext.Provider;
|
15
21
|
function useIdPrefix() {
|
16
|
-
|
22
|
+
return _react.useContext(IdPrefixContext) || '';
|
17
23
|
}
|
18
|
-
/**
|
19
|
-
* Resets generated IDs, should be used only in tests.
|
20
|
-
*/
|
21
24
|
function resetIdsForTests() {
|
22
|
-
|
25
|
+
_index.defaultSSRContextValue.current = 0;
|
23
26
|
}
|
24
|
-
exports.resetIdsForTests = resetIdsForTests;
|
25
|
-
/**
|
26
|
-
* Hook to generate a unique ID.
|
27
|
-
*
|
28
|
-
* @param prefix - Optional prefix for the ID. Defaults to 'fui-'.
|
29
|
-
* @param providedId - Optional id provided by a parent component. Defaults to the provided value if present,
|
30
|
-
* without conditioning the hook call
|
31
|
-
* @returns The ID
|
32
|
-
*/
|
33
27
|
function useId(prefix = 'fui-', providedId) {
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
// the version of React being used. This is safe to ignore.
|
47
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
48
|
-
return React.useMemo(() => {
|
49
|
-
if (providedId) {
|
50
|
-
return providedId;
|
28
|
+
const contextValue = (0, _index.useSSRContext)();
|
29
|
+
const idPrefix = useIdPrefix();
|
30
|
+
// Checking if useId is available on React, if it is, we use it to generate the id. String concatenation is used to
|
31
|
+
// prevent bundlers from complaining with older versions of React.
|
32
|
+
const _useId = _react['use' + 'Id'];
|
33
|
+
if (_useId) {
|
34
|
+
const generatedId = _useId();
|
35
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
36
|
+
const escapedId = _react.useMemo(()=>generatedId.replace(/:/g, ''), [
|
37
|
+
generatedId
|
38
|
+
]);
|
39
|
+
return providedId || `${idPrefix}${prefix}${escapedId}`;
|
51
40
|
}
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
41
|
+
// Hooks appear to be running conditionally, but they will always run in the same order since it's based on
|
42
|
+
// the version of React being used. This is safe to ignore.
|
43
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
44
|
+
return _react.useMemo(()=>{
|
45
|
+
if (providedId) {
|
46
|
+
return providedId;
|
47
|
+
}
|
48
|
+
return `${idPrefix}${prefix}${++contextValue.current}`;
|
49
|
+
}, [
|
50
|
+
idPrefix,
|
51
|
+
prefix,
|
52
|
+
providedId,
|
53
|
+
contextValue
|
54
|
+
]);
|
55
|
+
} //# sourceMappingURL=useId.js.map
|
56
|
+
|
56
57
|
//# sourceMappingURL=useId.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/hooks/useId.js"],"sourcesContent":["import * as React from 'react';\nimport { defaultSSRContextValue, useSSRContext } from '../ssr/index';\nconst IdPrefixContext = /*#__PURE__*/React.createContext(undefined);\n/**\n * Allows to define a prefix that will be used for all IDs generated by useId() hook. It's useful to avoid collisions\n * between different bundles.\n */\nexport const IdPrefixProvider = IdPrefixContext.Provider;\nfunction useIdPrefix() {\n return React.useContext(IdPrefixContext) || '';\n}\n/**\n * Resets generated IDs, should be used only in tests.\n */\nexport function resetIdsForTests() {\n defaultSSRContextValue.current = 0;\n}\n/**\n * Hook to generate a unique ID.\n *\n * @param prefix - Optional prefix for the ID. Defaults to 'fui-'.\n * @param providedId - Optional id provided by a parent component. Defaults to the provided value if present,\n * without conditioning the hook call\n * @returns The ID\n */\nexport function useId(prefix = 'fui-', providedId) {\n const contextValue = useSSRContext();\n const idPrefix = useIdPrefix();\n // Checking if useId is available on React, if it is, we use it to generate the id. String concatenation is used to\n // prevent bundlers from complaining with older versions of React.\n const _useId = React['use' + 'Id'];\n if (_useId) {\n const generatedId = _useId();\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const escapedId = React.useMemo(() => generatedId.replace(/:/g, ''), [generatedId]);\n return providedId || `${idPrefix}${prefix}${escapedId}`;\n }\n // Hooks appear to be running conditionally, but they will always run in the same order since it's based on\n // the version of React being used. This is safe to ignore.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return React.useMemo(() => {\n if (providedId) {\n return providedId;\n }\n return `${idPrefix}${prefix}${++contextValue.current}`;\n }, [idPrefix, prefix, providedId, contextValue]);\n}\n//# sourceMappingURL=useId.js.map"],"names":["IdPrefixProvider","resetIdsForTests","useId","IdPrefixContext","React","createContext","undefined","Provider","useIdPrefix","useContext","defaultSSRContextValue","current","prefix","providedId","contextValue","useSSRContext","idPrefix","_useId","generatedId","escapedId","useMemo","replace"],"mappings":";;;;;;;;;;;IAOaA,gBAAgB,MAAhBA;IAOGC,gBAAgB,MAAhBA;IAWAC,KAAK,MAALA;;;6DAzBO;uBAC+B;AACtD,MAAMC,kBAAkB,WAAW,GAAEC,OAAMC,aAAa,CAACC;AAKlD,MAAMN,mBAAmBG,gBAAgBI,QAAQ;AACxD,SAASC,cAAc;IACrB,OAAOJ,OAAMK,UAAU,CAACN,oBAAoB;AAC9C;AAIO,SAASF,mBAAmB;IACjCS,6BAAsB,CAACC,OAAO,GAAG;AACnC;AASO,SAAST,MAAMU,SAAS,MAAM,EAAEC,UAAU,EAAE;IACjD,MAAMC,eAAeC,IAAAA,oBAAa;IAClC,MAAMC,WAAWR;IACjB,mHAAmH;IACnH,kEAAkE;IAClE,MAAMS,SAASb,MAAK,CAAC,QAAQ,KAAK;IAClC,IAAIa,QAAQ;QACV,MAAMC,cAAcD;QACpB,sDAAsD;QACtD,MAAME,YAAYf,OAAMgB,OAAO,CAAC,IAAMF,YAAYG,OAAO,CAAC,MAAM,KAAK;YAACH;SAAY;QAClF,OAAOL,cAAc,CAAC,EAAEG,SAAS,EAAEJ,OAAO,EAAEO,UAAU,CAAC;IACzD,CAAC;IACD,2GAA2G;IAC3G,2DAA2D;IAC3D,sDAAsD;IACtD,OAAOf,OAAMgB,OAAO,CAAC,IAAM;QACzB,IAAIP,YAAY;YACd,OAAOA;QACT,CAAC;QACD,OAAO,CAAC,EAAEG,SAAS,EAAEJ,OAAO,EAAE,EAAEE,aAAaH,OAAO,CAAC,CAAC;IACxD,GAAG;QAACK;QAAUJ;QAAQC;QAAYC;KAAa;AACjD,EACA,iCAAiC"}
|
@@ -1,20 +1,14 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "useIsomorphicLayoutEffect", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>useIsomorphicLayoutEffect
|
5
8
|
});
|
6
|
-
|
7
|
-
const
|
8
|
-
const
|
9
|
-
|
10
|
-
|
11
|
-
* useEffect on the server (no-op) and useLayoutEffect in the browser. We occasionally need useLayoutEffect to
|
12
|
-
* ensure we don't get a render flash for certain operations, but we may also need affected components to render on
|
13
|
-
* the server.
|
14
|
-
*
|
15
|
-
* https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
|
16
|
-
* https://github.com/reduxjs/react-redux/blob/master/src/utils/useIsomorphicLayoutEffect.js
|
17
|
-
*/
|
18
|
-
// eslint-disable-next-line no-restricted-properties
|
19
|
-
exports.useIsomorphicLayoutEffect = /*#__PURE__*/index_1.canUseDOM() ? React.useLayoutEffect : React.useEffect;
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
11
|
+
const _index = require("../ssr/index");
|
12
|
+
const useIsomorphicLayoutEffect = /*#__PURE__*/ (0, _index.canUseDOM)() ? _react.useLayoutEffect : _react.useEffect; //# sourceMappingURL=useIsomorphicLayoutEffect.js.map
|
13
|
+
|
20
14
|
//# sourceMappingURL=useIsomorphicLayoutEffect.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/hooks/useIsomorphicLayoutEffect.js"],"sourcesContent":["import * as React from 'react';\nimport { canUseDOM } from '../ssr/index';\n/**\n * React currently throws a warning when using useLayoutEffect on the server. To get around it, we can conditionally\n * useEffect on the server (no-op) and useLayoutEffect in the browser. We occasionally need useLayoutEffect to\n * ensure we don't get a render flash for certain operations, but we may also need affected components to render on\n * the server.\n *\n * https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85\n * https://github.com/reduxjs/react-redux/blob/master/src/utils/useIsomorphicLayoutEffect.js\n */ // eslint-disable-next-line no-restricted-properties\nexport const useIsomorphicLayoutEffect = /*#__PURE__*/canUseDOM() ? React.useLayoutEffect : React.useEffect;\n//# sourceMappingURL=useIsomorphicLayoutEffect.js.map"],"names":["useIsomorphicLayoutEffect","canUseDOM","React","useLayoutEffect","useEffect"],"mappings":";;;;+BAWaA;;aAAAA;;;6DAXU;uBACG;AAUnB,MAAMA,4BAA4B,WAAW,GAAEC,IAAAA,gBAAS,MAAKC,OAAMC,eAAe,GAAGD,OAAME,SAAS,EAC3G,qDAAqD"}
|
@@ -1,32 +1,30 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "useMergedRefs", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>useMergedRefs
|
5
8
|
});
|
6
|
-
|
7
|
-
const
|
8
|
-
/**
|
9
|
-
* React hook to merge multiple React refs (either MutableRefObjects or ref callbacks) into a single ref callback that
|
10
|
-
* updates all provided refs
|
11
|
-
* @param refs - Refs to collectively update with one ref value.
|
12
|
-
* @returns A function with an attached "current" prop, so that it can be treated like a RefObject.
|
13
|
-
*/
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
14
11
|
function useMergedRefs(...refs) {
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
12
|
+
const mergedCallback = _react.useCallback((value)=>{
|
13
|
+
// Update the "current" prop hanging on the function.
|
14
|
+
mergedCallback.current = value;
|
15
|
+
for (const ref of refs){
|
16
|
+
if (typeof ref === 'function') {
|
17
|
+
ref(value);
|
18
|
+
} else if (ref) {
|
19
|
+
// work around the immutability of the React.Ref type
|
20
|
+
ref.current = value;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}, // eslint-disable-next-line react-hooks/exhaustive-deps -- already exhaustive
|
24
|
+
[
|
25
|
+
...refs
|
26
|
+
]);
|
27
|
+
return mergedCallback;
|
28
|
+
} //# sourceMappingURL=useMergedRefs.js.map
|
29
|
+
|
32
30
|
//# sourceMappingURL=useMergedRefs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/hooks/useMergedRefs.js"],"sourcesContent":["import * as React from 'react';\n/**\n * React hook to merge multiple React refs (either MutableRefObjects or ref callbacks) into a single ref callback that\n * updates all provided refs\n * @param refs - Refs to collectively update with one ref value.\n * @returns A function with an attached \"current\" prop, so that it can be treated like a RefObject.\n */\nexport function useMergedRefs(...refs) {\n const mergedCallback = React.useCallback(value => {\n // Update the \"current\" prop hanging on the function.\n mergedCallback.current = value;\n for (const ref of refs) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n // work around the immutability of the React.Ref type\n ref.current = value;\n }\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps -- already exhaustive\n [...refs]);\n return mergedCallback;\n}\n//# sourceMappingURL=useMergedRefs.js.map"],"names":["useMergedRefs","refs","mergedCallback","React","useCallback","value","current","ref"],"mappings":";;;;+BAOgBA;;aAAAA;;;6DAPO;AAOhB,SAASA,cAAc,GAAGC,IAAI,EAAE;IACrC,MAAMC,iBAAiBC,OAAMC,WAAW,CAACC,CAAAA,QAAS;QAChD,qDAAqD;QACrDH,eAAeI,OAAO,GAAGD;QACzB,KAAK,MAAME,OAAON,KAAM;YACtB,IAAI,OAAOM,QAAQ,YAAY;gBAC7BA,IAAIF;YACN,OAAO,IAAIE,KAAK;gBACd,qDAAqD;gBACrDA,IAAID,OAAO,GAAGD;YAChB,CAAC;QACH;IACF,GACA,6EAA6E;IAC7E;WAAIJ;KAAK;IACT,OAAOC;AACT,EACA,yCAAyC"}
|
@@ -1,76 +1,75 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
5
4
|
});
|
6
|
-
exports
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
const useOnClickOutside = options
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
5
|
+
Object.defineProperty(exports, "useOnClickOutside", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>useOnClickOutside
|
8
|
+
});
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
11
|
+
const _useEventCallback = require("./useEventCallback");
|
12
|
+
const useOnClickOutside = (options)=>{
|
13
|
+
const { refs , callback , element , disabled , contains: containsProp } = options;
|
14
|
+
const timeoutId = _react.useRef(undefined);
|
15
|
+
useIFrameFocus(options);
|
16
|
+
const listener = (0, _useEventCallback.useEventCallback)((ev)=>{
|
17
|
+
const contains = containsProp || ((parent, child)=>{
|
18
|
+
return !!(parent === null || parent === void 0 ? void 0 : parent.contains(child));
|
19
|
+
});
|
20
|
+
const isOutside = refs.every((ref)=>!contains(ref.current || null, ev.target));
|
21
|
+
if (isOutside && !disabled) {
|
22
|
+
callback(ev);
|
23
|
+
}
|
24
|
+
});
|
25
|
+
_react.useEffect(()=>{
|
26
|
+
// Store the current event to avoid triggering handlers immediately
|
27
|
+
// Note this depends on a deprecated but extremely well supported quirk of the web platform
|
28
|
+
// https://github.com/facebook/react/issues/20074
|
29
|
+
let currentEvent = getWindowEvent(window);
|
30
|
+
const conditionalHandler = (event)=>{
|
31
|
+
// Skip if this event is the same as the one running when we added the handlers
|
32
|
+
if (event === currentEvent) {
|
33
|
+
currentEvent = undefined;
|
34
|
+
return;
|
35
|
+
}
|
36
|
+
listener(event);
|
37
|
+
};
|
38
|
+
if (!disabled) {
|
39
|
+
// use capture phase because React can update DOM before the event bubbles to the document
|
40
|
+
element === null || element === void 0 ? void 0 : element.addEventListener('click', conditionalHandler, true);
|
41
|
+
element === null || element === void 0 ? void 0 : element.addEventListener('touchstart', conditionalHandler, true);
|
42
|
+
element === null || element === void 0 ? void 0 : element.addEventListener('contextmenu', conditionalHandler, true);
|
43
|
+
}
|
44
|
+
// Garbage collect this event after it's no longer useful to avoid memory leaks
|
45
|
+
timeoutId.current = window.setTimeout(()=>{
|
46
|
+
currentEvent = undefined;
|
47
|
+
}, 1);
|
48
|
+
return ()=>{
|
49
|
+
element === null || element === void 0 ? void 0 : element.removeEventListener('click', conditionalHandler, true);
|
50
|
+
element === null || element === void 0 ? void 0 : element.removeEventListener('touchstart', conditionalHandler, true);
|
51
|
+
element === null || element === void 0 ? void 0 : element.removeEventListener('contextmenu', conditionalHandler, true);
|
52
|
+
clearTimeout(timeoutId.current);
|
53
|
+
currentEvent = undefined;
|
54
|
+
};
|
55
|
+
}, [
|
56
|
+
listener,
|
57
|
+
element,
|
58
|
+
disabled
|
59
|
+
]);
|
61
60
|
};
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
61
|
+
const getWindowEvent = (target)=>{
|
62
|
+
if (target) {
|
63
|
+
var _target_ownerDocument, _target_ownerDocument_defaultView;
|
64
|
+
if (typeof target.window === 'object' && target.window === target) {
|
65
|
+
// eslint-disable-next-line deprecation/deprecation
|
66
|
+
return target.event;
|
67
|
+
}
|
68
|
+
var _target_ownerDocument_defaultView_event;
|
69
|
+
// eslint-disable-next-line deprecation/deprecation
|
70
|
+
return (_target_ownerDocument_defaultView_event = (_target_ownerDocument = target.ownerDocument) === null || _target_ownerDocument === void 0 ? void 0 : (_target_ownerDocument_defaultView = _target_ownerDocument.defaultView) === null || _target_ownerDocument_defaultView === void 0 ? void 0 : _target_ownerDocument_defaultView.event) !== null && _target_ownerDocument_defaultView_event !== void 0 ? _target_ownerDocument_defaultView_event : undefined;
|
69
71
|
}
|
70
|
-
|
71
|
-
return (_c = (_b = (_a = target.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView) === null || _b === void 0 ? void 0 : _b.event) !== null && _c !== void 0 ? _c : undefined;
|
72
|
-
}
|
73
|
-
return undefined;
|
72
|
+
return undefined;
|
74
73
|
};
|
75
74
|
const FUI_FRAME_EVENT = 'fuiframefocus';
|
76
75
|
/**
|
@@ -82,51 +81,56 @@ const FUI_FRAME_EVENT = 'fuiframefocus';
|
|
82
81
|
*
|
83
82
|
* Polls the value of `document.activeElement`. If it is an iframe, then dispatch
|
84
83
|
* a custom DOM event. When the custom event is received call the provided callback
|
85
|
-
*/
|
86
|
-
const
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
const contains = containsProp || ((parent, child) => !!(parent === null || parent === void 0 ? void 0 : parent.contains(child)));
|
98
|
-
const isOutside = refs.every(ref => !contains(ref.current || null, e.target));
|
99
|
-
if (isOutside && !disabled) {
|
100
|
-
callback(e);
|
101
|
-
}
|
102
|
-
});
|
103
|
-
// Adds listener to the custom iframe focus event
|
104
|
-
React.useEffect(() => {
|
105
|
-
if (!disabled) {
|
106
|
-
targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.addEventListener(FUI_FRAME_EVENT, listener, true);
|
107
|
-
return () => {
|
108
|
-
targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.removeEventListener(FUI_FRAME_EVENT, listener, true);
|
109
|
-
};
|
110
|
-
}
|
111
|
-
}, [targetDocument, disabled, listener]);
|
112
|
-
// Starts polling for the active element
|
113
|
-
React.useEffect(() => {
|
114
|
-
var _a;
|
115
|
-
if (!disabled) {
|
116
|
-
timeoutRef.current = (_a = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView) === null || _a === void 0 ? void 0 : _a.setInterval(() => {
|
117
|
-
const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
|
118
|
-
if ((activeElement === null || activeElement === void 0 ? void 0 : activeElement.tagName) === 'IFRAME' || (activeElement === null || activeElement === void 0 ? void 0 : activeElement.tagName) === 'WEBVIEW') {
|
119
|
-
const event = new CustomEvent(FUI_FRAME_EVENT, {
|
120
|
-
bubbles: true
|
121
|
-
});
|
122
|
-
activeElement.dispatchEvent(event);
|
84
|
+
*/ const useIFrameFocus = (options)=>{
|
85
|
+
const { disabled , element: targetDocument , callback , contains: containsProp = (parent, child)=>{
|
86
|
+
return !!(parent === null || parent === void 0 ? void 0 : parent.contains(child));
|
87
|
+
} , pollDuration =1000 , refs } = options;
|
88
|
+
const timeoutRef = _react.useRef();
|
89
|
+
const listener = (0, _useEventCallback.useEventCallback)((e)=>{
|
90
|
+
const contains = containsProp || ((parent, child)=>{
|
91
|
+
return !!(parent === null || parent === void 0 ? void 0 : parent.contains(child));
|
92
|
+
});
|
93
|
+
const isOutside = refs.every((ref)=>!contains(ref.current || null, e.target));
|
94
|
+
if (isOutside && !disabled) {
|
95
|
+
callback(e);
|
123
96
|
}
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
};
|
97
|
+
});
|
98
|
+
// Adds listener to the custom iframe focus event
|
99
|
+
_react.useEffect(()=>{
|
100
|
+
if (!disabled) {
|
101
|
+
targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.addEventListener(FUI_FRAME_EVENT, listener, true);
|
102
|
+
return ()=>{
|
103
|
+
targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.removeEventListener(FUI_FRAME_EVENT, listener, true);
|
104
|
+
};
|
105
|
+
}
|
106
|
+
}, [
|
107
|
+
targetDocument,
|
108
|
+
disabled,
|
109
|
+
listener
|
110
|
+
]);
|
111
|
+
// Starts polling for the active element
|
112
|
+
_react.useEffect(()=>{
|
113
|
+
if (!disabled) {
|
114
|
+
var _targetDocument_defaultView;
|
115
|
+
timeoutRef.current = targetDocument === null || targetDocument === void 0 ? void 0 : (_targetDocument_defaultView = targetDocument.defaultView) === null || _targetDocument_defaultView === void 0 ? void 0 : _targetDocument_defaultView.setInterval(()=>{
|
116
|
+
const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
|
117
|
+
if ((activeElement === null || activeElement === void 0 ? void 0 : activeElement.tagName) === 'IFRAME' || (activeElement === null || activeElement === void 0 ? void 0 : activeElement.tagName) === 'WEBVIEW') {
|
118
|
+
const event = new CustomEvent(FUI_FRAME_EVENT, {
|
119
|
+
bubbles: true
|
120
|
+
});
|
121
|
+
activeElement.dispatchEvent(event);
|
122
|
+
}
|
123
|
+
}, pollDuration);
|
124
|
+
}
|
125
|
+
return ()=>{
|
126
|
+
var _targetDocument_defaultView;
|
127
|
+
targetDocument === null || targetDocument === void 0 ? void 0 : (_targetDocument_defaultView = targetDocument.defaultView) === null || _targetDocument_defaultView === void 0 ? void 0 : _targetDocument_defaultView.clearTimeout(timeoutRef.current);
|
128
|
+
};
|
129
|
+
}, [
|
130
|
+
targetDocument,
|
131
|
+
disabled,
|
132
|
+
pollDuration
|
133
|
+
]);
|
134
|
+
}; //# sourceMappingURL=useOnClickOutside.js.map
|
135
|
+
|
132
136
|
//# sourceMappingURL=useOnClickOutside.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","require","useEventCallback_1","useOnClickOutside","options","refs","callback","element","disabled","contains","containsProp","timeoutId","useRef","undefined","useIFrameFocus","listener","useEventCallback","ev","parent","child","isOutside","every","ref","current","target","useEffect","currentEvent","getWindowEvent","window","conditionalHandler","event","addEventListener","setTimeout","removeEventListener","clearTimeout","exports","_c","_b","_a","ownerDocument","defaultView","FUI_FRAME_EVENT","targetDocument","pollDuration","timeoutRef","e","setInterval","activeElement","tagName","CustomEvent","bubbles","dispatchEvent"],"sources":["../src/packages/react-components/react-utilities/src/hooks/useOnClickOutside.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from './useEventCallback';\n\n/**\n * @internal\n */\nexport type UseOnClickOrScrollOutsideOptions = {\n /**\n * The element to listen for the click event\n */\n element: Document | undefined;\n /**\n * Refs to elements that check if the click is outside\n */\n refs: React.MutableRefObject<HTMLElement | undefined | null>[];\n\n /**\n * By default uses element.contains, but custom contain function can be provided\n * @param parentRef - provided parent ref\n * @param child - event target element\n */\n contains?(parent: HTMLElement | null, child: HTMLElement): boolean;\n\n /**\n * Disables event listeners\n */\n disabled?: boolean;\n\n /**\n * Called if the click is outside the element refs\n */\n callback: (ev: MouseEvent | TouchEvent) => void;\n};\n\n/**\n * @internal\n * Utility to perform checks where a click/touch event was made outside a component\n */\nexport const useOnClickOutside = (options: UseOnClickOrScrollOutsideOptions) => {\n const { refs, callback, element, disabled, contains: containsProp } = options;\n const timeoutId = React.useRef<number | undefined>(undefined);\n useIFrameFocus(options);\n\n const listener = useEventCallback((ev: MouseEvent | TouchEvent) => {\n const contains: UseOnClickOrScrollOutsideOptions['contains'] =\n containsProp || ((parent, child) => !!parent?.contains(child));\n\n const isOutside = refs.every(ref => !contains(ref.current || null, ev.target as HTMLElement));\n if (isOutside && !disabled) {\n callback(ev);\n }\n });\n\n React.useEffect(() => {\n // Store the current event to avoid triggering handlers immediately\n // Note this depends on a deprecated but extremely well supported quirk of the web platform\n // https://github.com/facebook/react/issues/20074\n let currentEvent = getWindowEvent(window);\n\n const conditionalHandler = (event: MouseEvent | TouchEvent) => {\n // Skip if this event is the same as the one running when we added the handlers\n if (event === currentEvent) {\n currentEvent = undefined;\n return;\n }\n\n listener(event);\n };\n\n if (!disabled) {\n // use capture phase because React can update DOM before the event bubbles to the document\n element?.addEventListener('click', conditionalHandler, true);\n element?.addEventListener('touchstart', conditionalHandler, true);\n element?.addEventListener('contextmenu', conditionalHandler, true);\n }\n\n // Garbage collect this event after it's no longer useful to avoid memory leaks\n timeoutId.current = window.setTimeout(() => {\n currentEvent = undefined;\n }, 1);\n\n return () => {\n element?.removeEventListener('click', conditionalHandler, true);\n element?.removeEventListener('touchstart', conditionalHandler, true);\n element?.removeEventListener('contextmenu', conditionalHandler, true);\n\n clearTimeout(timeoutId.current);\n currentEvent = undefined;\n };\n }, [listener, element, disabled]);\n};\n\nconst getWindowEvent = (target: Node | Window): Event | undefined => {\n if (target) {\n if (typeof (target as Window).window === 'object' && (target as Window).window === target) {\n // eslint-disable-next-line deprecation/deprecation\n return target.event;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n return (target as Node).ownerDocument?.defaultView?.event ?? undefined;\n }\n\n return undefined;\n};\n\nconst FUI_FRAME_EVENT = 'fuiframefocus';\n\ninterface UseIFrameFocusOptions extends UseOnClickOrScrollOutsideOptions {\n /**\n * Millisecond duration to poll\n */\n pollDuration?: number;\n}\n\n/**\n * Since click events do not propagate past iframes, we use focus to detect if a\n * click has happened inside an iframe, since the only ways of focusing inside an\n * iframe are:\n * - clicking inside\n * - tabbing inside\n *\n * Polls the value of `document.activeElement`. If it is an iframe, then dispatch\n * a custom DOM event. When the custom event is received call the provided callback\n */\nconst useIFrameFocus = (options: UseIFrameFocusOptions) => {\n const {\n disabled,\n element: targetDocument,\n callback,\n contains: containsProp = (parent, child) => !!parent?.contains(child),\n pollDuration = 1000,\n refs,\n } = options;\n const timeoutRef = React.useRef<number>();\n\n const listener = useEventCallback((e: Event) => {\n const contains = containsProp || ((parent, child) => !!parent?.contains(child));\n\n const isOutside = refs.every(ref => !contains(ref.current || null, e.target as HTMLElement));\n if (isOutside && !disabled) {\n callback(e as MouseEvent);\n }\n });\n\n // Adds listener to the custom iframe focus event\n React.useEffect(() => {\n if (!disabled) {\n targetDocument?.addEventListener(FUI_FRAME_EVENT, listener, true);\n return () => {\n targetDocument?.removeEventListener(FUI_FRAME_EVENT, listener, true);\n };\n }\n }, [targetDocument, disabled, listener]);\n\n // Starts polling for the active element\n React.useEffect(() => {\n if (!disabled) {\n timeoutRef.current = targetDocument?.defaultView?.setInterval(() => {\n const activeElement = targetDocument?.activeElement;\n if (activeElement?.tagName === 'IFRAME' || activeElement?.tagName === 'WEBVIEW') {\n const event = new CustomEvent(FUI_FRAME_EVENT, { bubbles: true });\n activeElement.dispatchEvent(event);\n }\n }, pollDuration);\n }\n return () => {\n targetDocument?.defaultView?.clearTimeout(timeoutRef.current);\n };\n }, [targetDocument, disabled, pollDuration]);\n};\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,kBAAA,gBAAAD,OAAA;AAiCA;;;;AAIO,MAAME,iBAAiB,GAAIC,OAAyC,IAAI;EAC7E,MAAM;IAAEC,IAAI;IAAEC,QAAQ;IAAEC,OAAO;IAAEC,QAAQ;IAAEC,QAAQ,EAAEC;EAAY,CAAE,GAAGN,OAAO;EAC7E,MAAMO,SAAS,GAAGX,KAAK,CAACY,MAAM,CAAqBC,SAAS,CAAC;EAC7DC,cAAc,CAACV,OAAO,CAAC;EAEvB,MAAMW,QAAQ,GAAGb,kBAAA,CAAAc,gBAAgB,CAAEC,EAA2B,IAAI;IAChE,MAAMR,QAAQ,GACZC,YAAY,KAAK,CAACQ,MAAM,EAAEC,KAAK,KAAK,CAAC,EAACD,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAET,QAAQ,CAACU,KAAK,CAAC,EAAC;IAEhE,MAAMC,SAAS,GAAGf,IAAI,CAACgB,KAAK,CAACC,GAAG,IAAI,CAACb,QAAQ,CAACa,GAAG,CAACC,OAAO,IAAI,IAAI,EAAEN,EAAE,CAACO,MAAqB,CAAC,CAAC;IAC7F,IAAIJ,SAAS,IAAI,CAACZ,QAAQ,EAAE;MAC1BF,QAAQ,CAACW,EAAE,CAAC;;EAEhB,CAAC,CAAC;EAEFjB,KAAK,CAACyB,SAAS,CAAC,MAAK;IACnB;IACA;IACA;IACA,IAAIC,YAAY,GAAGC,cAAc,CAACC,MAAM,CAAC;IAEzC,MAAMC,kBAAkB,GAAIC,KAA8B,IAAI;MAC5D;MACA,IAAIA,KAAK,KAAKJ,YAAY,EAAE;QAC1BA,YAAY,GAAGb,SAAS;QACxB;;MAGFE,QAAQ,CAACe,K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../../lib/hooks/useOnClickOutside.js"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from './useEventCallback';\n/**\n * @internal\n * Utility to perform checks where a click/touch event was made outside a component\n */\nexport const useOnClickOutside = options => {\n const {\n refs,\n callback,\n element,\n disabled,\n contains: containsProp\n } = options;\n const timeoutId = React.useRef(undefined);\n useIFrameFocus(options);\n const listener = useEventCallback(ev => {\n const contains = containsProp || ((parent, child) => {\n return !!(parent === null || parent === void 0 ? void 0 : parent.contains(child));\n });\n const isOutside = refs.every(ref => !contains(ref.current || null, ev.target));\n if (isOutside && !disabled) {\n callback(ev);\n }\n });\n React.useEffect(() => {\n // Store the current event to avoid triggering handlers immediately\n // Note this depends on a deprecated but extremely well supported quirk of the web platform\n // https://github.com/facebook/react/issues/20074\n let currentEvent = getWindowEvent(window);\n const conditionalHandler = event => {\n // Skip if this event is the same as the one running when we added the handlers\n if (event === currentEvent) {\n currentEvent = undefined;\n return;\n }\n listener(event);\n };\n if (!disabled) {\n // use capture phase because React can update DOM before the event bubbles to the document\n element === null || element === void 0 ? void 0 : element.addEventListener('click', conditionalHandler, true);\n element === null || element === void 0 ? void 0 : element.addEventListener('touchstart', conditionalHandler, true);\n element === null || element === void 0 ? void 0 : element.addEventListener('contextmenu', conditionalHandler, true);\n }\n // Garbage collect this event after it's no longer useful to avoid memory leaks\n timeoutId.current = window.setTimeout(() => {\n currentEvent = undefined;\n }, 1);\n return () => {\n element === null || element === void 0 ? void 0 : element.removeEventListener('click', conditionalHandler, true);\n element === null || element === void 0 ? void 0 : element.removeEventListener('touchstart', conditionalHandler, true);\n element === null || element === void 0 ? void 0 : element.removeEventListener('contextmenu', conditionalHandler, true);\n clearTimeout(timeoutId.current);\n currentEvent = undefined;\n };\n }, [listener, element, disabled]);\n};\nconst getWindowEvent = target => {\n if (target) {\n var _target_ownerDocument, _target_ownerDocument_defaultView;\n if (typeof target.window === 'object' && target.window === target) {\n // eslint-disable-next-line deprecation/deprecation\n return target.event;\n }\n var _target_ownerDocument_defaultView_event;\n // eslint-disable-next-line deprecation/deprecation\n return (_target_ownerDocument_defaultView_event = (_target_ownerDocument = target.ownerDocument) === null || _target_ownerDocument === void 0 ? void 0 : (_target_ownerDocument_defaultView = _target_ownerDocument.defaultView) === null || _target_ownerDocument_defaultView === void 0 ? void 0 : _target_ownerDocument_defaultView.event) !== null && _target_ownerDocument_defaultView_event !== void 0 ? _target_ownerDocument_defaultView_event : undefined;\n }\n return undefined;\n};\nconst FUI_FRAME_EVENT = 'fuiframefocus';\n/**\n * Since click events do not propagate past iframes, we use focus to detect if a\n * click has happened inside an iframe, since the only ways of focusing inside an\n * iframe are:\n * - clicking inside\n * - tabbing inside\n *\n * Polls the value of `document.activeElement`. If it is an iframe, then dispatch\n * a custom DOM event. When the custom event is received call the provided callback\n */\nconst useIFrameFocus = options => {\n const {\n disabled,\n element: targetDocument,\n callback,\n contains: containsProp = (parent, child) => {\n return !!(parent === null || parent === void 0 ? void 0 : parent.contains(child));\n },\n pollDuration = 1000,\n refs\n } = options;\n const timeoutRef = React.useRef();\n const listener = useEventCallback(e => {\n const contains = containsProp || ((parent, child) => {\n return !!(parent === null || parent === void 0 ? void 0 : parent.contains(child));\n });\n const isOutside = refs.every(ref => !contains(ref.current || null, e.target));\n if (isOutside && !disabled) {\n callback(e);\n }\n });\n // Adds listener to the custom iframe focus event\n React.useEffect(() => {\n if (!disabled) {\n targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.addEventListener(FUI_FRAME_EVENT, listener, true);\n return () => {\n targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.removeEventListener(FUI_FRAME_EVENT, listener, true);\n };\n }\n }, [targetDocument, disabled, listener]);\n // Starts polling for the active element\n React.useEffect(() => {\n if (!disabled) {\n var _targetDocument_defaultView;\n timeoutRef.current = targetDocument === null || targetDocument === void 0 ? void 0 : (_targetDocument_defaultView = targetDocument.defaultView) === null || _targetDocument_defaultView === void 0 ? void 0 : _targetDocument_defaultView.setInterval(() => {\n const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;\n if ((activeElement === null || activeElement === void 0 ? void 0 : activeElement.tagName) === 'IFRAME' || (activeElement === null || activeElement === void 0 ? void 0 : activeElement.tagName) === 'WEBVIEW') {\n const event = new CustomEvent(FUI_FRAME_EVENT, {\n bubbles: true\n });\n activeElement.dispatchEvent(event);\n }\n }, pollDuration);\n }\n return () => {\n var _targetDocument_defaultView;\n targetDocument === null || targetDocument === void 0 ? void 0 : (_targetDocument_defaultView = targetDocument.defaultView) === null || _targetDocument_defaultView === void 0 ? void 0 : _targetDocument_defaultView.clearTimeout(timeoutRef.current);\n };\n }, [targetDocument, disabled, pollDuration]);\n};\n//# sourceMappingURL=useOnClickOutside.js.map"],"names":["useOnClickOutside","options","refs","callback","element","disabled","contains","containsProp","timeoutId","React","useRef","undefined","useIFrameFocus","listener","useEventCallback","ev","parent","child","isOutside","every","ref","current","target","useEffect","currentEvent","getWindowEvent","window","conditionalHandler","event","addEventListener","setTimeout","removeEventListener","clearTimeout","_target_ownerDocument","_target_ownerDocument_defaultView","_target_ownerDocument_defaultView_event","ownerDocument","defaultView","FUI_FRAME_EVENT","targetDocument","pollDuration","timeoutRef","e","_targetDocument_defaultView","setInterval","activeElement","tagName","CustomEvent","bubbles","dispatchEvent"],"mappings":";;;;+BAMaA;;aAAAA;;;6DANU;kCACU;AAK1B,MAAMA,oBAAoBC,CAAAA,UAAW;IAC1C,MAAM,EACJC,KAAI,EACJC,SAAQ,EACRC,QAAO,EACPC,SAAQ,EACRC,UAAUC,aAAY,EACvB,GAAGN;IACJ,MAAMO,YAAYC,OAAMC,MAAM,CAACC;IAC/BC,eAAeX;IACf,MAAMY,WAAWC,IAAAA,kCAAgB,EAACC,CAAAA,KAAM;QACtC,MAAMT,WAAWC,gBAAiB,CAAA,CAACS,QAAQC,QAAU;YACnD,OAAO,CAAC,CAAED,CAAAA,WAAW,IAAI,IAAIA,WAAW,KAAK,IAAI,KAAK,IAAIA,OAAOV,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