@fluentui/react-positioning 0.0.0-nightly-20230830-0414.1 → 0.0.0-nightly-20230901-0414.1
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/CHANGELOG.json +9 -9
- package/CHANGELOG.md +7 -7
- package/lib/createArrowStyles.js +1 -1
- package/lib/createArrowStyles.js.map +1 -1
- package/lib/createPositionManager.js +4 -3
- package/lib/createPositionManager.js.map +1 -1
- package/lib/createSlideStyles.js.map +1 -1
- package/lib/createVirtualElementFromClick.js.map +1 -1
- package/lib/middleware/coverTarget.js +1 -1
- package/lib/middleware/coverTarget.js.map +1 -1
- package/lib/middleware/flip.js +2 -2
- package/lib/middleware/flip.js.map +1 -1
- package/lib/middleware/intersecting.js.map +1 -1
- package/lib/middleware/maxSize.js +7 -9
- package/lib/middleware/maxSize.js.map +1 -1
- package/lib/middleware/offset.js.map +1 -1
- package/lib/middleware/shift.js +1 -1
- package/lib/middleware/shift.js.map +1 -1
- package/lib/usePositioning.js +6 -8
- package/lib/usePositioning.js.map +1 -1
- package/lib/usePositioningMouseTarget.js.map +1 -1
- package/lib/utils/debounce.js.map +1 -1
- package/lib/utils/fromFloatingUIPlacement.js +1 -1
- package/lib/utils/fromFloatingUIPlacement.js.map +1 -1
- package/lib/utils/getBoundary.js +4 -2
- package/lib/utils/getBoundary.js.map +1 -1
- package/lib/utils/getFloatingUIOffset.js +2 -2
- package/lib/utils/getFloatingUIOffset.js.map +1 -1
- package/lib/utils/getReactFiberFromNode.js.map +1 -1
- package/lib/utils/getScrollParent.js +1 -1
- package/lib/utils/getScrollParent.js.map +1 -1
- package/lib/utils/hasAutoFocusFilter.js.map +1 -1
- package/lib/utils/mergeArrowOffset.js.map +1 -1
- package/lib/utils/normalizeAutoSize.js.map +1 -1
- package/lib/utils/parseFloatingUIPlacement.js.map +1 -1
- package/lib/utils/resolvePositioningShorthand.js.map +1 -1
- package/lib/utils/toFloatingUIPadding.js +1 -1
- package/lib/utils/toFloatingUIPadding.js.map +1 -1
- package/lib/utils/toFloatingUIPlacement.js.map +1 -1
- package/lib/utils/toggleScrollListener.js.map +1 -1
- package/lib/utils/useCallbackRef.js.map +1 -1
- package/lib/utils/writeArrowUpdates.js +2 -2
- package/lib/utils/writeArrowUpdates.js.map +1 -1
- package/lib/utils/writeContainerupdates.js +1 -1
- package/lib/utils/writeContainerupdates.js.map +1 -1
- package/lib-commonjs/constants.js +12 -4
- package/lib-commonjs/constants.js.map +1 -1
- package/lib-commonjs/createArrowStyles.js +9 -5
- package/lib-commonjs/createArrowStyles.js.map +1 -1
- package/lib-commonjs/createPositionManager.js +9 -6
- package/lib-commonjs/createPositionManager.js.map +1 -1
- package/lib-commonjs/createSlideStyles.js +6 -4
- package/lib-commonjs/createSlideStyles.js.map +1 -1
- package/lib-commonjs/createVirtualElementFromClick.js +3 -1
- package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
- package/lib-commonjs/index.js +24 -8
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/middleware/coverTarget.js +4 -2
- package/lib-commonjs/middleware/coverTarget.js.map +1 -1
- package/lib-commonjs/middleware/flip.js +5 -3
- package/lib-commonjs/middleware/flip.js.map +1 -1
- package/lib-commonjs/middleware/index.js +7 -7
- package/lib-commonjs/middleware/index.js.map +1 -1
- package/lib-commonjs/middleware/intersecting.js +3 -1
- package/lib-commonjs/middleware/intersecting.js.map +1 -1
- package/lib-commonjs/middleware/maxSize.js +13 -11
- package/lib-commonjs/middleware/maxSize.js.map +1 -1
- package/lib-commonjs/middleware/offset.js +3 -1
- package/lib-commonjs/middleware/offset.js.map +1 -1
- package/lib-commonjs/middleware/shift.js +4 -2
- package/lib-commonjs/middleware/shift.js.map +1 -1
- package/lib-commonjs/types.js +2 -2
- package/lib-commonjs/types.js.map +1 -1
- package/lib-commonjs/usePositioning.js +16 -16
- package/lib-commonjs/usePositioning.js.map +1 -1
- package/lib-commonjs/usePositioningMouseTarget.js +5 -3
- package/lib-commonjs/usePositioningMouseTarget.js.map +1 -1
- package/lib-commonjs/utils/debounce.js +3 -1
- package/lib-commonjs/utils/debounce.js.map +1 -1
- package/lib-commonjs/utils/fromFloatingUIPlacement.js +4 -2
- package/lib-commonjs/utils/fromFloatingUIPlacement.js.map +1 -1
- package/lib-commonjs/utils/getBoundary.js +7 -3
- package/lib-commonjs/utils/getBoundary.js.map +1 -1
- package/lib-commonjs/utils/getFloatingUIOffset.js +5 -3
- package/lib-commonjs/utils/getFloatingUIOffset.js.map +1 -1
- package/lib-commonjs/utils/getReactFiberFromNode.js +5 -3
- package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
- package/lib-commonjs/utils/getScrollParent.js +10 -4
- package/lib-commonjs/utils/getScrollParent.js.map +1 -1
- package/lib-commonjs/utils/hasAutoFocusFilter.js +3 -1
- package/lib-commonjs/utils/hasAutoFocusFilter.js.map +1 -1
- package/lib-commonjs/utils/index.js +17 -17
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/mergeArrowOffset.js +3 -1
- package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
- package/lib-commonjs/utils/normalizeAutoSize.js +3 -1
- package/lib-commonjs/utils/normalizeAutoSize.js.map +1 -1
- package/lib-commonjs/utils/parseFloatingUIPlacement.js +3 -1
- package/lib-commonjs/utils/parseFloatingUIPlacement.js.map +1 -1
- package/lib-commonjs/utils/resolvePositioningShorthand.js +3 -1
- package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
- package/lib-commonjs/utils/toFloatingUIPadding.js +4 -2
- package/lib-commonjs/utils/toFloatingUIPadding.js.map +1 -1
- package/lib-commonjs/utils/toFloatingUIPlacement.js +3 -1
- package/lib-commonjs/utils/toFloatingUIPlacement.js.map +1 -1
- package/lib-commonjs/utils/toggleScrollListener.js +6 -4
- package/lib-commonjs/utils/toggleScrollListener.js.map +1 -1
- package/lib-commonjs/utils/useCallbackRef.js +7 -5
- package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
- package/lib-commonjs/utils/writeArrowUpdates.js +5 -3
- package/lib-commonjs/utils/writeArrowUpdates.js.map +1 -1
- package/lib-commonjs/utils/writeContainerupdates.js +4 -2
- package/lib-commonjs/utils/writeContainerupdates.js.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["getBoundary.js"],"sourcesContent":["import { getScrollParent } from './getScrollParent';\n/**\n * Allows to mimic a behavior from V1 of Popper and accept `window` and `scrollParent` as strings.\n */ export function getBoundary(element, boundary) {\n if (boundary === 'window') {\n return element === null ||
|
|
1
|
+
{"version":3,"sources":["getBoundary.js"],"sourcesContent":["import { getScrollParent } from './getScrollParent';\n/**\n * Allows to mimic a behavior from V1 of Popper and accept `window` and `scrollParent` as strings.\n */ export function getBoundary(element, boundary) {\n if (boundary === 'window') {\n var _element;\n return (_element = element) === null || _element === void 0 ? void 0 : _element.ownerDocument.documentElement;\n }\n if (boundary === 'clippingParents') {\n return 'clippingAncestors';\n }\n if (boundary === 'scrollParent') {\n let boundariesNode = getScrollParent(element);\n if (boundariesNode.nodeName === 'BODY') {\n var _element1;\n boundariesNode = (_element1 = element) === null || _element1 === void 0 ? void 0 : _element1.ownerDocument.documentElement;\n }\n return boundariesNode;\n }\n return boundary;\n}\n"],"names":["getBoundary","element","boundary","_element","ownerDocument","documentElement","boundariesNode","getScrollParent","nodeName","_element1"],"mappings":";;;;+BAGoBA;;;eAAAA;;;iCAHY;AAGrB,SAASA,YAAYC,OAAO,EAAEC,QAAQ;IAC7C,IAAIA,aAAa,UAAU;QACvB,IAAIC;QACJ,OAAO,AAACA,CAAAA,WAAWF,OAAM,MAAO,QAAQE,aAAa,KAAK,IAAI,KAAK,IAAIA,SAASC,aAAa,CAACC,eAAe;IACjH;IACA,IAAIH,aAAa,mBAAmB;QAChC,OAAO;IACX;IACA,IAAIA,aAAa,gBAAgB;QAC7B,IAAII,iBAAiBC,IAAAA,gCAAe,EAACN;QACrC,IAAIK,eAAeE,QAAQ,KAAK,QAAQ;YACpC,IAAIC;YACJH,iBAAiB,AAACG,CAAAA,YAAYR,OAAM,MAAO,QAAQQ,cAAc,KAAK,IAAI,KAAK,IAAIA,UAAUL,aAAa,CAACC,eAAe;QAC9H;QACA,OAAOC;IACX;IACA,OAAOJ;AACX"}
|
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "getFloatingUIOffset", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return getFloatingUIOffset;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
const _fromFloatingUIPlacement = require("./fromFloatingUIPlacement");
|
|
10
12
|
function getFloatingUIOffset(rawOffset) {
|
|
@@ -14,8 +16,8 @@ function getFloatingUIOffset(rawOffset) {
|
|
|
14
16
|
if (typeof rawOffset === 'number' || typeof rawOffset === 'object') {
|
|
15
17
|
return rawOffset;
|
|
16
18
|
}
|
|
17
|
-
return ({ rects: { floating
|
|
18
|
-
const { position
|
|
19
|
+
return ({ rects: { floating, reference }, placement })=>{
|
|
20
|
+
const { position, alignment } = (0, _fromFloatingUIPlacement.fromFloatingUIPlacement)(placement);
|
|
19
21
|
return rawOffset({
|
|
20
22
|
positionedRect: floating,
|
|
21
23
|
targetRect: reference,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["getFloatingUIOffset.js"],"sourcesContent":["import { fromFloatingUIPlacement } from './fromFloatingUIPlacement';\n/**\n * Shim to transform offset values from this library to Floating UI\n * @param rawOffset Offset from this library\n * @returns An offset value compatible with Floating UI\n */ export function getFloatingUIOffset(rawOffset) {\n if (!rawOffset) {\n return rawOffset;\n }\n if (typeof rawOffset === 'number' || typeof rawOffset === 'object') {\n return rawOffset;\n }\n return ({ rects: { floating
|
|
1
|
+
{"version":3,"sources":["getFloatingUIOffset.js"],"sourcesContent":["import { fromFloatingUIPlacement } from './fromFloatingUIPlacement';\n/**\n * Shim to transform offset values from this library to Floating UI\n * @param rawOffset Offset from this library\n * @returns An offset value compatible with Floating UI\n */ export function getFloatingUIOffset(rawOffset) {\n if (!rawOffset) {\n return rawOffset;\n }\n if (typeof rawOffset === 'number' || typeof rawOffset === 'object') {\n return rawOffset;\n }\n return ({ rects: { floating, reference }, placement })=>{\n const { position, alignment } = fromFloatingUIPlacement(placement);\n return rawOffset({\n positionedRect: floating,\n targetRect: reference,\n position,\n alignment\n });\n };\n}\n"],"names":["getFloatingUIOffset","rawOffset","rects","floating","reference","placement","position","alignment","fromFloatingUIPlacement","positionedRect","targetRect"],"mappings":";;;;+BAKoBA;;;eAAAA;;;yCALoB;AAK7B,SAASA,oBAAoBC,SAAS;IAC7C,IAAI,CAACA,WAAW;QACZ,OAAOA;IACX;IACA,IAAI,OAAOA,cAAc,YAAY,OAAOA,cAAc,UAAU;QAChE,OAAOA;IACX;IACA,OAAO,CAAC,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,SAAS,EAAE,EAAEC,SAAS,EAAE;QACjD,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,IAAAA,gDAAuB,EAACH;QACxD,OAAOJ,UAAU;YACbQ,gBAAgBN;YAChBO,YAAYN;YACZE;YACAC;QACJ;IACJ;AACJ"}
|
|
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "getReactFiberFromNode", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return getReactFiberFromNode;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
const _react = /*#__PURE__*/
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
11
13
|
var WorkTag;
|
|
12
14
|
(function(WorkTag) {
|
|
13
15
|
WorkTag[WorkTag["FunctionComponent"] = 0] = "FunctionComponent";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["getReactFiberFromNode.js"],"sourcesContent":["import * as React from 'react';\nvar WorkTag;\n(function(WorkTag) {\n WorkTag[WorkTag[\"FunctionComponent\"] = 0] = \"FunctionComponent\";\n WorkTag[WorkTag[\"ClassComponent\"] = 1] = \"ClassComponent\";\n WorkTag[WorkTag[\"IndeterminateComponent\"] = 2] = \"IndeterminateComponent\";\n WorkTag[WorkTag[\"HostRoot\"] = 3] = \"HostRoot\";\n WorkTag[WorkTag[\"HostPortal\"] = 4] = \"HostPortal\";\n WorkTag[WorkTag[\"HostComponent\"] = 5] = \"HostComponent\";\n WorkTag[WorkTag[\"HostText\"] = 6] = \"HostText\";\n WorkTag[WorkTag[\"Fragment\"] = 7] = \"Fragment\";\n WorkTag[WorkTag[\"Mode\"] = 8] = \"Mode\";\n WorkTag[WorkTag[\"ContextConsumer\"] = 9] = \"ContextConsumer\";\n WorkTag[WorkTag[\"ContextProvider\"] = 10] = \"ContextProvider\";\n WorkTag[WorkTag[\"ForwardRef\"] = 11] = \"ForwardRef\";\n WorkTag[WorkTag[\"Profiler\"] = 12] = \"Profiler\";\n WorkTag[WorkTag[\"SuspenseComponent\"] = 13] = \"SuspenseComponent\";\n WorkTag[WorkTag[\"MemoComponent\"] = 14] = \"MemoComponent\";\n WorkTag[WorkTag[\"SimpleMemoComponent\"] = 15] = \"SimpleMemoComponent\";\n WorkTag[WorkTag[\"LazyComponent\"] = 16] = \"LazyComponent\";\n WorkTag[WorkTag[\"IncompleteClassComponent\"] = 17] = \"IncompleteClassComponent\";\n WorkTag[WorkTag[\"DehydratedFragment\"] = 18] = \"DehydratedFragment\";\n WorkTag[WorkTag[\"SuspenseListComponent\"] = 19] = \"SuspenseListComponent\";\n WorkTag[WorkTag[\"FundamentalComponent\"] = 20] = \"FundamentalComponent\";\n WorkTag[WorkTag[\"ScopeComponent\"] = 21] = \"ScopeComponent\";\n})(WorkTag || (WorkTag = {}));\nexport function getReactFiberFromNode(elm) {\n if (!elm) {\n return null;\n }\n for(const k in elm){\n // React 16 uses \"__reactInternalInstance$\" prefix\n // React 17 uses \"__reactFiber$\" prefix\n // https://github.com/facebook/react/pull/18377\n if (k.indexOf('__reactInternalInstance$') === 0 || k.indexOf('__reactFiber$') === 0) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return elm[k];\n }\n }\n throw new Error('getReactFiber(): Failed to find a React Fiber on a node');\n}\n"],"names":["getReactFiberFromNode","WorkTag","elm","k","indexOf","Error"],"mappings":";;;;+BA0BgBA
|
|
1
|
+
{"version":3,"sources":["getReactFiberFromNode.js"],"sourcesContent":["import * as React from 'react';\nvar WorkTag;\n(function(WorkTag) {\n WorkTag[WorkTag[\"FunctionComponent\"] = 0] = \"FunctionComponent\";\n WorkTag[WorkTag[\"ClassComponent\"] = 1] = \"ClassComponent\";\n WorkTag[WorkTag[\"IndeterminateComponent\"] = 2] = \"IndeterminateComponent\";\n WorkTag[WorkTag[\"HostRoot\"] = 3] = \"HostRoot\";\n WorkTag[WorkTag[\"HostPortal\"] = 4] = \"HostPortal\";\n WorkTag[WorkTag[\"HostComponent\"] = 5] = \"HostComponent\";\n WorkTag[WorkTag[\"HostText\"] = 6] = \"HostText\";\n WorkTag[WorkTag[\"Fragment\"] = 7] = \"Fragment\";\n WorkTag[WorkTag[\"Mode\"] = 8] = \"Mode\";\n WorkTag[WorkTag[\"ContextConsumer\"] = 9] = \"ContextConsumer\";\n WorkTag[WorkTag[\"ContextProvider\"] = 10] = \"ContextProvider\";\n WorkTag[WorkTag[\"ForwardRef\"] = 11] = \"ForwardRef\";\n WorkTag[WorkTag[\"Profiler\"] = 12] = \"Profiler\";\n WorkTag[WorkTag[\"SuspenseComponent\"] = 13] = \"SuspenseComponent\";\n WorkTag[WorkTag[\"MemoComponent\"] = 14] = \"MemoComponent\";\n WorkTag[WorkTag[\"SimpleMemoComponent\"] = 15] = \"SimpleMemoComponent\";\n WorkTag[WorkTag[\"LazyComponent\"] = 16] = \"LazyComponent\";\n WorkTag[WorkTag[\"IncompleteClassComponent\"] = 17] = \"IncompleteClassComponent\";\n WorkTag[WorkTag[\"DehydratedFragment\"] = 18] = \"DehydratedFragment\";\n WorkTag[WorkTag[\"SuspenseListComponent\"] = 19] = \"SuspenseListComponent\";\n WorkTag[WorkTag[\"FundamentalComponent\"] = 20] = \"FundamentalComponent\";\n WorkTag[WorkTag[\"ScopeComponent\"] = 21] = \"ScopeComponent\";\n})(WorkTag || (WorkTag = {}));\nexport function getReactFiberFromNode(elm) {\n if (!elm) {\n return null;\n }\n for(const k in elm){\n // React 16 uses \"__reactInternalInstance$\" prefix\n // React 17 uses \"__reactFiber$\" prefix\n // https://github.com/facebook/react/pull/18377\n if (k.indexOf('__reactInternalInstance$') === 0 || k.indexOf('__reactFiber$') === 0) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return elm[k];\n }\n }\n throw new Error('getReactFiber(): Failed to find a React Fiber on a node');\n}\n"],"names":["getReactFiberFromNode","WorkTag","elm","k","indexOf","Error"],"mappings":";;;;+BA0BgBA;;;eAAAA;;;;iEA1BO;AACvB,IAAIC;AACH,CAAA,SAASA,OAAO;IACbA,OAAO,CAACA,OAAO,CAAC,oBAAoB,GAAG,EAAE,GAAG;IAC5CA,OAAO,CAACA,OAAO,CAAC,iBAAiB,GAAG,EAAE,GAAG;IACzCA,OAAO,CAACA,OAAO,CAAC,yBAAyB,GAAG,EAAE,GAAG;IACjDA,OAAO,CAACA,OAAO,CAAC,WAAW,GAAG,EAAE,GAAG;IACnCA,OAAO,CAACA,OAAO,CAAC,aAAa,GAAG,EAAE,GAAG;IACrCA,OAAO,CAACA,OAAO,CAAC,gBAAgB,GAAG,EAAE,GAAG;IACxCA,OAAO,CAACA,OAAO,CAAC,WAAW,GAAG,EAAE,GAAG;IACnCA,OAAO,CAACA,OAAO,CAAC,WAAW,GAAG,EAAE,GAAG;IACnCA,OAAO,CAACA,OAAO,CAAC,OAAO,GAAG,EAAE,GAAG;IAC/BA,OAAO,CAACA,OAAO,CAAC,kBAAkB,GAAG,EAAE,GAAG;IAC1CA,OAAO,CAACA,OAAO,CAAC,kBAAkB,GAAG,GAAG,GAAG;IAC3CA,OAAO,CAACA,OAAO,CAAC,aAAa,GAAG,GAAG,GAAG;IACtCA,OAAO,CAACA,OAAO,CAAC,WAAW,GAAG,GAAG,GAAG;IACpCA,OAAO,CAACA,OAAO,CAAC,oBAAoB,GAAG,GAAG,GAAG;IAC7CA,OAAO,CAACA,OAAO,CAAC,gBAAgB,GAAG,GAAG,GAAG;IACzCA,OAAO,CAACA,OAAO,CAAC,sBAAsB,GAAG,GAAG,GAAG;IAC/CA,OAAO,CAACA,OAAO,CAAC,gBAAgB,GAAG,GAAG,GAAG;IACzCA,OAAO,CAACA,OAAO,CAAC,2BAA2B,GAAG,GAAG,GAAG;IACpDA,OAAO,CAACA,OAAO,CAAC,qBAAqB,GAAG,GAAG,GAAG;IAC9CA,OAAO,CAACA,OAAO,CAAC,wBAAwB,GAAG,GAAG,GAAG;IACjDA,OAAO,CAACA,OAAO,CAAC,uBAAuB,GAAG,GAAG,GAAG;IAChDA,OAAO,CAACA,OAAO,CAAC,iBAAiB,GAAG,GAAG,GAAG;AAC9C,CAAA,EAAGA,WAAYA,CAAAA,UAAU,CAAC,CAAA;AACnB,SAASD,sBAAsBE,GAAG;IACrC,IAAI,CAACA,KAAK;QACN,OAAO;IACX;IACA,IAAI,MAAMC,KAAKD,IAAI;QACf,kDAAkD;QAClD,uCAAuC;QACvC,+CAA+C;QAC/C,IAAIC,EAAEC,OAAO,CAAC,gCAAgC,KAAKD,EAAEC,OAAO,CAAC,qBAAqB,GAAG;YACjF,6DAA6D;YAC7D,aAAa;YACb,OAAOF,GAAG,CAACC,EAAE;QACjB;IACJ;IACA,MAAM,IAAIE,MAAM;AACpB"}
|
|
@@ -13,9 +13,15 @@ function _export(target, all) {
|
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
_export(exports, {
|
|
16
|
-
getParentNode: ()
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
getParentNode: function() {
|
|
17
|
+
return getParentNode;
|
|
18
|
+
},
|
|
19
|
+
getScrollParent: function() {
|
|
20
|
+
return getScrollParent;
|
|
21
|
+
},
|
|
22
|
+
hasScrollParent: function() {
|
|
23
|
+
return hasScrollParent;
|
|
24
|
+
}
|
|
19
25
|
});
|
|
20
26
|
const getParentNode = (node)=>{
|
|
21
27
|
if (node.nodeName === 'HTML') {
|
|
@@ -49,7 +55,7 @@ const getScrollParent = (node)=>{
|
|
|
49
55
|
return parentNode.body;
|
|
50
56
|
}
|
|
51
57
|
// If any of the overflow props is defined for the node then we return it as the parent
|
|
52
|
-
const { overflow
|
|
58
|
+
const { overflow, overflowX, overflowY } = getStyleComputedProperty(parentNode);
|
|
53
59
|
if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
|
|
54
60
|
return parentNode;
|
|
55
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["getScrollParent.js"],"sourcesContent":["/**\n * Returns the parent node or the host of the node argument.\n * @param node - DOM node.\n * @returns - parent DOM node.\n */ export const getParentNode = (node)=>{\n if (node.nodeName === 'HTML') {\n return node;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return node.parentNode || node.host;\n};\n/**\n * Returns CSS styles of the given node.\n * @param node - DOM node.\n * @returns - CSS styles.\n */ const getStyleComputedProperty = (node)=>{\n var _node_ownerDocument;\n if (node.nodeType !== 1) {\n return {};\n }\n const window = (_node_ownerDocument = node.ownerDocument) === null || _node_ownerDocument === void 0 ? void 0 : _node_ownerDocument.defaultView;\n return window.getComputedStyle(node, null);\n};\n/**\n * Returns the first scrollable parent of the given element.\n * @param node - DOM node.\n * @returns - the first scrollable parent.\n */ export const getScrollParent = (node)=>{\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n const parentNode = node && getParentNode(node);\n // eslint-disable-next-line\n if (!parentNode) return document.body;\n switch(parentNode.nodeName){\n case 'HTML':\n case 'BODY':\n return parentNode.ownerDocument.body;\n case '#document':\n return parentNode.body;\n }\n // If any of the overflow props is defined for the node then we return it as the parent\n const { overflow
|
|
1
|
+
{"version":3,"sources":["getScrollParent.js"],"sourcesContent":["/**\n * Returns the parent node or the host of the node argument.\n * @param node - DOM node.\n * @returns - parent DOM node.\n */ export const getParentNode = (node)=>{\n if (node.nodeName === 'HTML') {\n return node;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return node.parentNode || node.host;\n};\n/**\n * Returns CSS styles of the given node.\n * @param node - DOM node.\n * @returns - CSS styles.\n */ const getStyleComputedProperty = (node)=>{\n var _node_ownerDocument;\n if (node.nodeType !== 1) {\n return {};\n }\n const window = (_node_ownerDocument = node.ownerDocument) === null || _node_ownerDocument === void 0 ? void 0 : _node_ownerDocument.defaultView;\n return window.getComputedStyle(node, null);\n};\n/**\n * Returns the first scrollable parent of the given element.\n * @param node - DOM node.\n * @returns - the first scrollable parent.\n */ export const getScrollParent = (node)=>{\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n const parentNode = node && getParentNode(node);\n // eslint-disable-next-line\n if (!parentNode) return document.body;\n switch(parentNode.nodeName){\n case 'HTML':\n case 'BODY':\n return parentNode.ownerDocument.body;\n case '#document':\n return parentNode.body;\n }\n // If any of the overflow props is defined for the node then we return it as the parent\n const { overflow, overflowX, overflowY } = getStyleComputedProperty(parentNode);\n if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {\n return parentNode;\n }\n return getScrollParent(parentNode);\n};\nexport const hasScrollParent = (node)=>{\n var _scrollParentElement_ownerDocument;\n const scrollParentElement = getScrollParent(node);\n return scrollParentElement ? scrollParentElement !== ((_scrollParentElement_ownerDocument = scrollParentElement.ownerDocument) === null || _scrollParentElement_ownerDocument === void 0 ? void 0 : _scrollParentElement_ownerDocument.body) : false;\n};\n"],"names":["getParentNode","getScrollParent","hasScrollParent","node","nodeName","parentNode","host","getStyleComputedProperty","_node_ownerDocument","nodeType","window","ownerDocument","defaultView","getComputedStyle","document","body","overflow","overflowX","overflowY","test","_scrollParentElement_ownerDocument","scrollParentElement"],"mappings":"AAAA;;;;CAIC;;;;;;;;;;;IAAgBA,aAAa;eAAbA;;IAuBAC,eAAe;eAAfA;;IAmBJC,eAAe;eAAfA;;;AA1CF,MAAMF,gBAAgB,CAACG;IAC9B,IAAIA,KAAKC,QAAQ,KAAK,QAAQ;QAC1B,OAAOD;IACX;IACA,8DAA8D;IAC9D,OAAOA,KAAKE,UAAU,IAAIF,KAAKG,IAAI;AACvC;AACA;;;;CAIC,GAAG,MAAMC,2BAA2B,CAACJ;IAClC,IAAIK;IACJ,IAAIL,KAAKM,QAAQ,KAAK,GAAG;QACrB,OAAO,CAAC;IACZ;IACA,MAAMC,SAAS,AAACF,CAAAA,sBAAsBL,KAAKQ,aAAa,AAAD,MAAO,QAAQH,wBAAwB,KAAK,IAAI,KAAK,IAAIA,oBAAoBI,WAAW;IAC/I,OAAOF,OAAOG,gBAAgB,CAACV,MAAM;AACzC;AAKW,MAAMF,kBAAkB,CAACE;IAChC,iFAAiF;IACjF,MAAME,aAAaF,QAAQH,cAAcG;IACzC,2BAA2B;IAC3B,IAAI,CAACE,YAAY,OAAOS,SAASC,IAAI;IACrC,OAAOV,WAAWD,QAAQ;QACtB,KAAK;QACL,KAAK;YACD,OAAOC,WAAWM,aAAa,CAACI,IAAI;QACxC,KAAK;YACD,OAAOV,WAAWU,IAAI;IAC9B;IACA,uFAAuF;IACvF,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,SAAS,EAAE,GAAGX,yBAAyBF;IACpE,IAAI,wBAAwBc,IAAI,CAACH,WAAWE,YAAYD,YAAY;QAChE,OAAOZ;IACX;IACA,OAAOJ,gBAAgBI;AAC3B;AACO,MAAMH,kBAAkB,CAACC;IAC5B,IAAIiB;IACJ,MAAMC,sBAAsBpB,gBAAgBE;IAC5C,OAAOkB,sBAAsBA,wBAAyB,CAAA,AAACD,CAAAA,qCAAqCC,oBAAoBV,aAAa,AAAD,MAAO,QAAQS,uCAAuC,KAAK,IAAI,KAAK,IAAIA,mCAAmCL,IAAI,AAAD,IAAK;AACnP"}
|
|
@@ -7,7 +7,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
Object.defineProperty(exports, "hasAutofocusFilter", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: ()
|
|
10
|
+
get: function() {
|
|
11
|
+
return hasAutofocusFilter;
|
|
12
|
+
}
|
|
11
13
|
});
|
|
12
14
|
const _getReactFiberFromNode = require("./getReactFiberFromNode");
|
|
13
15
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["hasAutoFocusFilter.js"],"sourcesContent":["//\n// Dev utils to detect if nodes have \"autoFocus\" props.\n//\nimport { getReactFiberFromNode } from './getReactFiberFromNode';\n/**\n * Detects if a passed HTML node has \"autoFocus\" prop on a React's fiber. Is needed as React handles autofocus behavior\n * in React DOM and will not pass \"autoFocus\" to an actual HTML.\n *\n * @param node\n */ function hasAutofocusProp(node) {\n // https://github.com/facebook/react/blob/848bb2426e44606e0a55dfe44c7b3ece33772485/packages/react-dom/src/client/ReactDOMHostConfig.js#L157-L166\n const isAutoFocusableElement = node.nodeName === 'BUTTON' || node.nodeName === 'INPUT' || node.nodeName === 'SELECT' || node.nodeName === 'TEXTAREA';\n if (isAutoFocusableElement) {\n var _getReactFiberFromNode;\n return !!((_getReactFiberFromNode = getReactFiberFromNode(node)) === null || _getReactFiberFromNode === void 0 ? void 0 : _getReactFiberFromNode.pendingProps.autoFocus);\n }\n return false;\n}\nexport function hasAutofocusFilter(node) {\n return hasAutofocusProp(node) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n}\n"],"names":["hasAutofocusFilter","hasAutofocusProp","node","isAutoFocusableElement","nodeName","_getReactFiberFromNode","getReactFiberFromNode","pendingProps","autoFocus","NodeFilter","FILTER_ACCEPT","FILTER_SKIP"],"mappings":"AAAA,EAAE;AACF,uDAAuD;AACvD,EAAE;;;;;+BAgBcA
|
|
1
|
+
{"version":3,"sources":["hasAutoFocusFilter.js"],"sourcesContent":["//\n// Dev utils to detect if nodes have \"autoFocus\" props.\n//\nimport { getReactFiberFromNode } from './getReactFiberFromNode';\n/**\n * Detects if a passed HTML node has \"autoFocus\" prop on a React's fiber. Is needed as React handles autofocus behavior\n * in React DOM and will not pass \"autoFocus\" to an actual HTML.\n *\n * @param node\n */ function hasAutofocusProp(node) {\n // https://github.com/facebook/react/blob/848bb2426e44606e0a55dfe44c7b3ece33772485/packages/react-dom/src/client/ReactDOMHostConfig.js#L157-L166\n const isAutoFocusableElement = node.nodeName === 'BUTTON' || node.nodeName === 'INPUT' || node.nodeName === 'SELECT' || node.nodeName === 'TEXTAREA';\n if (isAutoFocusableElement) {\n var _getReactFiberFromNode;\n return !!((_getReactFiberFromNode = getReactFiberFromNode(node)) === null || _getReactFiberFromNode === void 0 ? void 0 : _getReactFiberFromNode.pendingProps.autoFocus);\n }\n return false;\n}\nexport function hasAutofocusFilter(node) {\n return hasAutofocusProp(node) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n}\n"],"names":["hasAutofocusFilter","hasAutofocusProp","node","isAutoFocusableElement","nodeName","_getReactFiberFromNode","getReactFiberFromNode","pendingProps","autoFocus","NodeFilter","FILTER_ACCEPT","FILTER_SKIP"],"mappings":"AAAA,EAAE;AACF,uDAAuD;AACvD,EAAE;;;;;+BAgBcA;;;eAAAA;;;uCAfsB;AACtC;;;;;CAKC,GAAG,SAASC,iBAAiBC,IAAI;IAC9B,gJAAgJ;IAChJ,MAAMC,yBAAyBD,KAAKE,QAAQ,KAAK,YAAYF,KAAKE,QAAQ,KAAK,WAAWF,KAAKE,QAAQ,KAAK,YAAYF,KAAKE,QAAQ,KAAK;IAC1I,IAAID,wBAAwB;QACxB,IAAIE;QACJ,OAAO,CAAC,CAAE,CAAA,AAACA,CAAAA,0BAAyBC,IAAAA,4CAAqB,EAACJ,KAAI,MAAO,QAAQG,4BAA2B,KAAK,IAAI,KAAK,IAAIA,wBAAuBE,YAAY,CAACC,SAAS,AAAD;IAC1K;IACA,OAAO;AACX;AACO,SAASR,mBAAmBE,IAAI;IACnC,OAAOD,iBAAiBC,QAAQO,WAAWC,aAAa,GAAGD,WAAWE,WAAW;AACrF"}
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
5
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
|
6
|
+
_export_star._(require("./parseFloatingUIPlacement"), exports);
|
|
7
|
+
_export_star._(require("./getBoundary"), exports);
|
|
8
|
+
_export_star._(require("./getReactFiberFromNode"), exports);
|
|
9
|
+
_export_star._(require("./getScrollParent"), exports);
|
|
10
|
+
_export_star._(require("./mergeArrowOffset"), exports);
|
|
11
|
+
_export_star._(require("./toFloatingUIPadding"), exports);
|
|
12
|
+
_export_star._(require("./toFloatingUIPlacement"), exports);
|
|
13
|
+
_export_star._(require("./fromFloatingUIPlacement"), exports);
|
|
14
|
+
_export_star._(require("./resolvePositioningShorthand"), exports);
|
|
15
|
+
_export_star._(require("./useCallbackRef"), exports);
|
|
16
|
+
_export_star._(require("./debounce"), exports);
|
|
17
|
+
_export_star._(require("./toggleScrollListener"), exports);
|
|
18
|
+
_export_star._(require("./hasAutoFocusFilter"), exports);
|
|
19
|
+
_export_star._(require("./writeArrowUpdates"), exports);
|
|
20
|
+
_export_star._(require("./writeContainerupdates"), exports);
|
|
21
|
+
_export_star._(require("./normalizeAutoSize"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './parseFloatingUIPlacement';\nexport * from './getBoundary';\nexport * from './getReactFiberFromNode';\nexport * from './getScrollParent';\nexport * from './mergeArrowOffset';\nexport * from './toFloatingUIPadding';\nexport * from './toFloatingUIPlacement';\nexport * from './fromFloatingUIPlacement';\nexport * from './resolvePositioningShorthand';\nexport * from './useCallbackRef';\nexport * from './debounce';\nexport * from './toggleScrollListener';\nexport * from './hasAutoFocusFilter';\nexport * from './writeArrowUpdates';\nexport * from './writeContainerupdates';\nexport * from './normalizeAutoSize';\n"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './parseFloatingUIPlacement';\nexport * from './getBoundary';\nexport * from './getReactFiberFromNode';\nexport * from './getScrollParent';\nexport * from './mergeArrowOffset';\nexport * from './toFloatingUIPadding';\nexport * from './toFloatingUIPlacement';\nexport * from './fromFloatingUIPlacement';\nexport * from './resolvePositioningShorthand';\nexport * from './useCallbackRef';\nexport * from './debounce';\nexport * from './toggleScrollListener';\nexport * from './hasAutoFocusFilter';\nexport * from './writeArrowUpdates';\nexport * from './writeContainerupdates';\nexport * from './normalizeAutoSize';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA"}
|
|
@@ -12,7 +12,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "mergeArrowOffset", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: ()
|
|
15
|
+
get: function() {
|
|
16
|
+
return mergeArrowOffset;
|
|
17
|
+
}
|
|
16
18
|
});
|
|
17
19
|
function mergeArrowOffset(userOffset, arrowHeight) {
|
|
18
20
|
if (typeof userOffset === 'number') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["mergeArrowOffset.js"],"sourcesContent":["/**\n * Generally when adding an arrow to popper, it's necessary to offset the position of the popper by the\n * height of the arrow. A simple utility to merge a provided offset with an arrow height to return the final offset\n *\n * @internal\n * @param userOffset - The offset provided by the user\n * @param arrowHeight - The height of the arrow in px\n * @returns User offset augmented with arrow height\n */ export function mergeArrowOffset(userOffset, arrowHeight) {\n if (typeof userOffset === 'number') {\n return addArrowOffset(userOffset, arrowHeight);\n }\n if (typeof userOffset === 'object' && userOffset !== null) {\n return addArrowOffset(userOffset, arrowHeight);\n }\n if (typeof userOffset === 'function') {\n return (offsetParams)=>{\n const offset = userOffset(offsetParams);\n return addArrowOffset(offset, arrowHeight);\n };\n }\n return {\n mainAxis: arrowHeight\n };\n}\nconst addArrowOffset = (offset, arrowHeight)=>{\n if (typeof offset === 'number') {\n return {\n mainAxis: offset + arrowHeight\n };\n }\n var _offset_mainAxis;\n return {\n ...offset,\n mainAxis: ((_offset_mainAxis = offset.mainAxis) !== null && _offset_mainAxis !== void 0 ? _offset_mainAxis : 0) + arrowHeight\n };\n};\n"],"names":["mergeArrowOffset","userOffset","arrowHeight","addArrowOffset","offsetParams","offset","mainAxis","_offset_mainAxis"],"mappings":"AAAA;;;;;;;;CAQC;;;;+BAAmBA
|
|
1
|
+
{"version":3,"sources":["mergeArrowOffset.js"],"sourcesContent":["/**\n * Generally when adding an arrow to popper, it's necessary to offset the position of the popper by the\n * height of the arrow. A simple utility to merge a provided offset with an arrow height to return the final offset\n *\n * @internal\n * @param userOffset - The offset provided by the user\n * @param arrowHeight - The height of the arrow in px\n * @returns User offset augmented with arrow height\n */ export function mergeArrowOffset(userOffset, arrowHeight) {\n if (typeof userOffset === 'number') {\n return addArrowOffset(userOffset, arrowHeight);\n }\n if (typeof userOffset === 'object' && userOffset !== null) {\n return addArrowOffset(userOffset, arrowHeight);\n }\n if (typeof userOffset === 'function') {\n return (offsetParams)=>{\n const offset = userOffset(offsetParams);\n return addArrowOffset(offset, arrowHeight);\n };\n }\n return {\n mainAxis: arrowHeight\n };\n}\nconst addArrowOffset = (offset, arrowHeight)=>{\n if (typeof offset === 'number') {\n return {\n mainAxis: offset + arrowHeight\n };\n }\n var _offset_mainAxis;\n return {\n ...offset,\n mainAxis: ((_offset_mainAxis = offset.mainAxis) !== null && _offset_mainAxis !== void 0 ? _offset_mainAxis : 0) + arrowHeight\n };\n};\n"],"names":["mergeArrowOffset","userOffset","arrowHeight","addArrowOffset","offsetParams","offset","mainAxis","_offset_mainAxis"],"mappings":"AAAA;;;;;;;;CAQC;;;;+BAAmBA;;;eAAAA;;;AAAT,SAASA,iBAAiBC,UAAU,EAAEC,WAAW;IACxD,IAAI,OAAOD,eAAe,UAAU;QAChC,OAAOE,eAAeF,YAAYC;IACtC;IACA,IAAI,OAAOD,eAAe,YAAYA,eAAe,MAAM;QACvD,OAAOE,eAAeF,YAAYC;IACtC;IACA,IAAI,OAAOD,eAAe,YAAY;QAClC,OAAO,CAACG;YACJ,MAAMC,SAASJ,WAAWG;YAC1B,OAAOD,eAAeE,QAAQH;QAClC;IACJ;IACA,OAAO;QACHI,UAAUJ;IACd;AACJ;AACA,MAAMC,iBAAiB,CAACE,QAAQH;IAC5B,IAAI,OAAOG,WAAW,UAAU;QAC5B,OAAO;YACHC,UAAUD,SAASH;QACvB;IACJ;IACA,IAAIK;IACJ,OAAO;QACH,GAAGF,MAAM;QACTC,UAAU,AAAC,CAAA,AAACC,CAAAA,mBAAmBF,OAAOC,QAAQ,AAAD,MAAO,QAAQC,qBAAqB,KAAK,IAAIA,mBAAmB,CAAA,IAAKL;IACtH;AACJ"}
|
|
@@ -8,7 +8,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
});
|
|
9
9
|
Object.defineProperty(exports, "normalizeAutoSize", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: ()
|
|
11
|
+
get: function() {
|
|
12
|
+
return normalizeAutoSize;
|
|
13
|
+
}
|
|
12
14
|
});
|
|
13
15
|
const normalizeAutoSize = (autoSize)=>{
|
|
14
16
|
switch(autoSize){
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["normalizeAutoSize.js"],"sourcesContent":["/**\n * AutoSizes contains many options from historic implementation.\n * Now options 'always'/'height-always'/'width-always' are obsolete.\n * This function maps them to true/'height'/'width'\n */ export const normalizeAutoSize = (autoSize)=>{\n switch(autoSize){\n case 'always':\n case true:\n return {\n applyMaxWidth: true,\n applyMaxHeight: true\n };\n case 'width-always':\n case 'width':\n return {\n applyMaxWidth: true,\n applyMaxHeight: false\n };\n case 'height-always':\n case 'height':\n return {\n applyMaxWidth: false,\n applyMaxHeight: true\n };\n default:\n return false;\n }\n};\n"],"names":["normalizeAutoSize","autoSize","applyMaxWidth","applyMaxHeight"],"mappings":"AAAA;;;;CAIC;;;;+BAAgBA
|
|
1
|
+
{"version":3,"sources":["normalizeAutoSize.js"],"sourcesContent":["/**\n * AutoSizes contains many options from historic implementation.\n * Now options 'always'/'height-always'/'width-always' are obsolete.\n * This function maps them to true/'height'/'width'\n */ export const normalizeAutoSize = (autoSize)=>{\n switch(autoSize){\n case 'always':\n case true:\n return {\n applyMaxWidth: true,\n applyMaxHeight: true\n };\n case 'width-always':\n case 'width':\n return {\n applyMaxWidth: true,\n applyMaxHeight: false\n };\n case 'height-always':\n case 'height':\n return {\n applyMaxWidth: false,\n applyMaxHeight: true\n };\n default:\n return false;\n }\n};\n"],"names":["normalizeAutoSize","autoSize","applyMaxWidth","applyMaxHeight"],"mappings":"AAAA;;;;CAIC;;;;+BAAgBA;;;eAAAA;;;AAAN,MAAMA,oBAAoB,CAACC;IAClC,OAAOA;QACH,KAAK;QACL,KAAK;YACD,OAAO;gBACHC,eAAe;gBACfC,gBAAgB;YACpB;QACJ,KAAK;QACL,KAAK;YACD,OAAO;gBACHD,eAAe;gBACfC,gBAAgB;YACpB;QACJ,KAAK;QACL,KAAK;YACD,OAAO;gBACHD,eAAe;gBACfC,gBAAgB;YACpB;QACJ;YACI,OAAO;IACf;AACJ"}
|
|
@@ -9,7 +9,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
Object.defineProperty(exports, "parseFloatingUIPlacement", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: ()
|
|
12
|
+
get: function() {
|
|
13
|
+
return parseFloatingUIPlacement;
|
|
14
|
+
}
|
|
13
15
|
});
|
|
14
16
|
function parseFloatingUIPlacement(placement) {
|
|
15
17
|
const tokens = placement.split('-');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["parseFloatingUIPlacement.js"],"sourcesContent":["/**\n * Parses Floating UI placement and returns the different components\n * @param placement - the floating ui placement (i.e. bottom-start)\n *\n * @returns side and alignment components of the placement\n */ export function parseFloatingUIPlacement(placement) {\n const tokens = placement.split('-');\n return {\n side: tokens[0],\n alignment: tokens[1]\n };\n}\n"],"names":["parseFloatingUIPlacement","placement","tokens","split","side","alignment"],"mappings":"AAAA;;;;;CAKC;;;;+BAAmBA
|
|
1
|
+
{"version":3,"sources":["parseFloatingUIPlacement.js"],"sourcesContent":["/**\n * Parses Floating UI placement and returns the different components\n * @param placement - the floating ui placement (i.e. bottom-start)\n *\n * @returns side and alignment components of the placement\n */ export function parseFloatingUIPlacement(placement) {\n const tokens = placement.split('-');\n return {\n side: tokens[0],\n alignment: tokens[1]\n };\n}\n"],"names":["parseFloatingUIPlacement","placement","tokens","split","side","alignment"],"mappings":"AAAA;;;;;CAKC;;;;+BAAmBA;;;eAAAA;;;AAAT,SAASA,yBAAyBC,SAAS;IAClD,MAAMC,SAASD,UAAUE,KAAK,CAAC;IAC/B,OAAO;QACHC,MAAMF,MAAM,CAAC,EAAE;QACfG,WAAWH,MAAM,CAAC,EAAE;IACxB;AACJ"}
|
|
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "resolvePositioningShorthand", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: ()
|
|
8
|
+
get: function() {
|
|
9
|
+
return resolvePositioningShorthand;
|
|
10
|
+
}
|
|
9
11
|
});
|
|
10
12
|
const shorthandLookup = {
|
|
11
13
|
above: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["resolvePositioningShorthand.js"],"sourcesContent":["// Look up table for shorthand to avoid parsing strings\nconst shorthandLookup = {\n above: {\n position: 'above',\n align: 'center'\n },\n 'above-start': {\n position: 'above',\n align: 'start'\n },\n 'above-end': {\n position: 'above',\n align: 'end'\n },\n below: {\n position: 'below',\n align: 'center'\n },\n 'below-start': {\n position: 'below',\n align: 'start'\n },\n 'below-end': {\n position: 'below',\n align: 'end'\n },\n before: {\n position: 'before',\n align: 'center'\n },\n 'before-top': {\n position: 'before',\n align: 'top'\n },\n 'before-bottom': {\n position: 'before',\n align: 'bottom'\n },\n after: {\n position: 'after',\n align: 'center'\n },\n 'after-top': {\n position: 'after',\n align: 'top'\n },\n 'after-bottom': {\n position: 'after',\n align: 'bottom'\n }\n};\nexport function resolvePositioningShorthand(shorthand) {\n if (shorthand === undefined || shorthand === null) {\n return {};\n }\n if (typeof shorthand === 'string') {\n return shorthandLookup[shorthand];\n }\n return shorthand;\n}\n"],"names":["resolvePositioningShorthand","shorthandLookup","above","position","align","below","before","after","shorthand","undefined"],"mappings":"AAAA,uDAAuD;;;;;+BAmDvCA
|
|
1
|
+
{"version":3,"sources":["resolvePositioningShorthand.js"],"sourcesContent":["// Look up table for shorthand to avoid parsing strings\nconst shorthandLookup = {\n above: {\n position: 'above',\n align: 'center'\n },\n 'above-start': {\n position: 'above',\n align: 'start'\n },\n 'above-end': {\n position: 'above',\n align: 'end'\n },\n below: {\n position: 'below',\n align: 'center'\n },\n 'below-start': {\n position: 'below',\n align: 'start'\n },\n 'below-end': {\n position: 'below',\n align: 'end'\n },\n before: {\n position: 'before',\n align: 'center'\n },\n 'before-top': {\n position: 'before',\n align: 'top'\n },\n 'before-bottom': {\n position: 'before',\n align: 'bottom'\n },\n after: {\n position: 'after',\n align: 'center'\n },\n 'after-top': {\n position: 'after',\n align: 'top'\n },\n 'after-bottom': {\n position: 'after',\n align: 'bottom'\n }\n};\nexport function resolvePositioningShorthand(shorthand) {\n if (shorthand === undefined || shorthand === null) {\n return {};\n }\n if (typeof shorthand === 'string') {\n return shorthandLookup[shorthand];\n }\n return shorthand;\n}\n"],"names":["resolvePositioningShorthand","shorthandLookup","above","position","align","below","before","after","shorthand","undefined"],"mappings":"AAAA,uDAAuD;;;;;+BAmDvCA;;;eAAAA;;;AAlDhB,MAAMC,kBAAkB;IACpBC,OAAO;QACHC,UAAU;QACVC,OAAO;IACX;IACA,eAAe;QACXD,UAAU;QACVC,OAAO;IACX;IACA,aAAa;QACTD,UAAU;QACVC,OAAO;IACX;IACAC,OAAO;QACHF,UAAU;QACVC,OAAO;IACX;IACA,eAAe;QACXD,UAAU;QACVC,OAAO;IACX;IACA,aAAa;QACTD,UAAU;QACVC,OAAO;IACX;IACAE,QAAQ;QACJH,UAAU;QACVC,OAAO;IACX;IACA,cAAc;QACVD,UAAU;QACVC,OAAO;IACX;IACA,iBAAiB;QACbD,UAAU;QACVC,OAAO;IACX;IACAG,OAAO;QACHJ,UAAU;QACVC,OAAO;IACX;IACA,aAAa;QACTD,UAAU;QACVC,OAAO;IACX;IACA,gBAAgB;QACZD,UAAU;QACVC,OAAO;IACX;AACJ;AACO,SAASJ,4BAA4BQ,SAAS;IACjD,IAAIA,cAAcC,aAAaD,cAAc,MAAM;QAC/C,OAAO,CAAC;IACZ;IACA,IAAI,OAAOA,cAAc,UAAU;QAC/B,OAAOP,eAAe,CAACO,UAAU;IACrC;IACA,OAAOA;AACX"}
|
|
@@ -4,13 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "toFloatingUIPadding", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return toFloatingUIPadding;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
function toFloatingUIPadding(padding, isRtl) {
|
|
10
12
|
if (typeof padding === 'number') {
|
|
11
13
|
return padding;
|
|
12
14
|
}
|
|
13
|
-
const { start
|
|
15
|
+
const { start, end, ...verticalPadding } = padding;
|
|
14
16
|
const paddingObject = verticalPadding;
|
|
15
17
|
const left = isRtl ? 'end' : 'start';
|
|
16
18
|
const right = isRtl ? 'start' : 'end';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["toFloatingUIPadding.js"],"sourcesContent":["export function toFloatingUIPadding(padding, isRtl) {\n if (typeof padding === 'number') {\n return padding;\n }\n const { start
|
|
1
|
+
{"version":3,"sources":["toFloatingUIPadding.js"],"sourcesContent":["export function toFloatingUIPadding(padding, isRtl) {\n if (typeof padding === 'number') {\n return padding;\n }\n const { start, end, ...verticalPadding } = padding;\n const paddingObject = verticalPadding;\n const left = isRtl ? 'end' : 'start';\n const right = isRtl ? 'start' : 'end';\n // assign properties explicitly since undefined values are actually handled by floating UI\n // TODO create floating UI issue\n if (padding[left]) {\n paddingObject.left = padding[left];\n }\n if (padding[right]) {\n paddingObject.right = padding[right];\n }\n return paddingObject;\n}\n"],"names":["toFloatingUIPadding","padding","isRtl","start","end","verticalPadding","paddingObject","left","right"],"mappings":";;;;+BAAgBA;;;eAAAA;;;AAAT,SAASA,oBAAoBC,OAAO,EAAEC,KAAK;IAC9C,IAAI,OAAOD,YAAY,UAAU;QAC7B,OAAOA;IACX;IACA,MAAM,EAAEE,KAAK,EAAEC,GAAG,EAAE,GAAGC,iBAAiB,GAAGJ;IAC3C,MAAMK,gBAAgBD;IACtB,MAAME,OAAOL,QAAQ,QAAQ;IAC7B,MAAMM,QAAQN,QAAQ,UAAU;IAChC,0FAA0F;IAC1F,gCAAgC;IAChC,IAAID,OAAO,CAACM,KAAK,EAAE;QACfD,cAAcC,IAAI,GAAGN,OAAO,CAACM,KAAK;IACtC;IACA,IAAIN,OAAO,CAACO,MAAM,EAAE;QAChBF,cAAcE,KAAK,GAAGP,OAAO,CAACO,MAAM;IACxC;IACA,OAAOF;AACX"}
|
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "toFloatingUIPlacement", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return toFloatingUIPlacement;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
const getPositionMap = (rtl)=>({
|
|
10
12
|
above: 'top',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["toFloatingUIPlacement.js"],"sourcesContent":["const getPositionMap = (rtl)=>({\n above: 'top',\n below: 'bottom',\n before: rtl ? 'right' : 'left',\n after: rtl ? 'left' : 'right'\n });\n// Floating UI automatically flips alignment\n// https://github.com/floating-ui/floating-ui/issues/1563\nconst getAlignmentMap = ()=>({\n start: 'start',\n end: 'end',\n top: 'start',\n bottom: 'end',\n center: undefined\n });\nconst shouldAlignToCenter = (p, a)=>{\n const positionedVertically = p === 'above' || p === 'below';\n const alignedVertically = a === 'top' || a === 'bottom';\n return positionedVertically && alignedVertically || !positionedVertically && !alignedVertically;\n};\n/**\n * Maps internal positioning values to Floating UI placement\n * @see positioningHelper.test.ts for expected placement values\n */ export const toFloatingUIPlacement = (align, position, rtl)=>{\n const alignment = shouldAlignToCenter(position, align) ? 'center' : align;\n const computedPosition = position && getPositionMap(rtl)[position];\n const computedAlignment = alignment && getAlignmentMap()[alignment];\n if (computedPosition && computedAlignment) {\n return `${computedPosition}-${computedAlignment}`;\n }\n return computedPosition;\n};\n"],"names":["toFloatingUIPlacement","getPositionMap","rtl","above","below","before","after","getAlignmentMap","start","end","top","bottom","center","undefined","shouldAlignToCenter","p","a","positionedVertically","alignedVertically","align","position","alignment","computedPosition","computedAlignment"],"mappings":";;;;+BAuBiBA
|
|
1
|
+
{"version":3,"sources":["toFloatingUIPlacement.js"],"sourcesContent":["const getPositionMap = (rtl)=>({\n above: 'top',\n below: 'bottom',\n before: rtl ? 'right' : 'left',\n after: rtl ? 'left' : 'right'\n });\n// Floating UI automatically flips alignment\n// https://github.com/floating-ui/floating-ui/issues/1563\nconst getAlignmentMap = ()=>({\n start: 'start',\n end: 'end',\n top: 'start',\n bottom: 'end',\n center: undefined\n });\nconst shouldAlignToCenter = (p, a)=>{\n const positionedVertically = p === 'above' || p === 'below';\n const alignedVertically = a === 'top' || a === 'bottom';\n return positionedVertically && alignedVertically || !positionedVertically && !alignedVertically;\n};\n/**\n * Maps internal positioning values to Floating UI placement\n * @see positioningHelper.test.ts for expected placement values\n */ export const toFloatingUIPlacement = (align, position, rtl)=>{\n const alignment = shouldAlignToCenter(position, align) ? 'center' : align;\n const computedPosition = position && getPositionMap(rtl)[position];\n const computedAlignment = alignment && getAlignmentMap()[alignment];\n if (computedPosition && computedAlignment) {\n return `${computedPosition}-${computedAlignment}`;\n }\n return computedPosition;\n};\n"],"names":["toFloatingUIPlacement","getPositionMap","rtl","above","below","before","after","getAlignmentMap","start","end","top","bottom","center","undefined","shouldAlignToCenter","p","a","positionedVertically","alignedVertically","align","position","alignment","computedPosition","computedAlignment"],"mappings":";;;;+BAuBiBA;;;eAAAA;;;AAvBjB,MAAMC,iBAAiB,CAACC,MAAO,CAAA;QACvBC,OAAO;QACPC,OAAO;QACPC,QAAQH,MAAM,UAAU;QACxBI,OAAOJ,MAAM,SAAS;IAC1B,CAAA;AACJ,4CAA4C;AAC5C,yDAAyD;AACzD,MAAMK,kBAAkB,IAAK,CAAA;QACrBC,OAAO;QACPC,KAAK;QACLC,KAAK;QACLC,QAAQ;QACRC,QAAQC;IACZ,CAAA;AACJ,MAAMC,sBAAsB,CAACC,GAAGC;IAC5B,MAAMC,uBAAuBF,MAAM,WAAWA,MAAM;IACpD,MAAMG,oBAAoBF,MAAM,SAASA,MAAM;IAC/C,OAAOC,wBAAwBC,qBAAqB,CAACD,wBAAwB,CAACC;AAClF;AAIW,MAAMlB,wBAAwB,CAACmB,OAAOC,UAAUlB;IACvD,MAAMmB,YAAYP,oBAAoBM,UAAUD,SAAS,WAAWA;IACpE,MAAMG,mBAAmBF,YAAYnB,eAAeC,IAAI,CAACkB,SAAS;IAClE,MAAMG,oBAAoBF,aAAad,iBAAiB,CAACc,UAAU;IACnE,IAAIC,oBAAoBC,mBAAmB;QACvC,OAAO,CAAC,EAAED,iBAAiB,CAAC,EAAEC,kBAAkB,CAAC;IACrD;IACA,OAAOD;AACX"}
|
|
@@ -4,19 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "toggleScrollListener", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return toggleScrollListener;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
11
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
10
12
|
const _getScrollParent = require("./getScrollParent");
|
|
11
13
|
function toggleScrollListener(next, prev, handler) {
|
|
12
14
|
if (next === prev) {
|
|
13
15
|
return;
|
|
14
16
|
}
|
|
15
|
-
if ((0,
|
|
17
|
+
if ((0, _reactutilities.isHTMLElement)(prev)) {
|
|
16
18
|
const prevScrollParent = (0, _getScrollParent.getScrollParent)(prev);
|
|
17
19
|
prevScrollParent.removeEventListener('scroll', handler);
|
|
18
20
|
}
|
|
19
|
-
if ((0,
|
|
21
|
+
if ((0, _reactutilities.isHTMLElement)(next)) {
|
|
20
22
|
const scrollParent = (0, _getScrollParent.getScrollParent)(next);
|
|
21
23
|
scrollParent.addEventListener('scroll', handler);
|
|
22
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["toggleScrollListener.js"],"sourcesContent":["import { isHTMLElement } from '@fluentui/react-utilities';\nimport { getScrollParent } from './getScrollParent';\n/**\n * Toggles event listeners for scroll parent.\n * Cleans up the event listeners for the previous element and adds them for the new scroll parent.\n * @param next Next element\n * @param prev Previous element\n */ export function toggleScrollListener(next, prev, handler) {\n if (next === prev) {\n return;\n }\n if (isHTMLElement(prev)) {\n const prevScrollParent = getScrollParent(prev);\n prevScrollParent.removeEventListener('scroll', handler);\n }\n if (isHTMLElement(next)) {\n const scrollParent = getScrollParent(next);\n scrollParent.addEventListener('scroll', handler);\n }\n}\n"],"names":["toggleScrollListener","next","prev","handler","isHTMLElement","prevScrollParent","getScrollParent","removeEventListener","scrollParent","addEventListener"],"mappings":";;;;+BAOoBA
|
|
1
|
+
{"version":3,"sources":["toggleScrollListener.js"],"sourcesContent":["import { isHTMLElement } from '@fluentui/react-utilities';\nimport { getScrollParent } from './getScrollParent';\n/**\n * Toggles event listeners for scroll parent.\n * Cleans up the event listeners for the previous element and adds them for the new scroll parent.\n * @param next Next element\n * @param prev Previous element\n */ export function toggleScrollListener(next, prev, handler) {\n if (next === prev) {\n return;\n }\n if (isHTMLElement(prev)) {\n const prevScrollParent = getScrollParent(prev);\n prevScrollParent.removeEventListener('scroll', handler);\n }\n if (isHTMLElement(next)) {\n const scrollParent = getScrollParent(next);\n scrollParent.addEventListener('scroll', handler);\n }\n}\n"],"names":["toggleScrollListener","next","prev","handler","isHTMLElement","prevScrollParent","getScrollParent","removeEventListener","scrollParent","addEventListener"],"mappings":";;;;+BAOoBA;;;eAAAA;;;gCAPU;iCACE;AAMrB,SAASA,qBAAqBC,IAAI,EAAEC,IAAI,EAAEC,OAAO;IACxD,IAAIF,SAASC,MAAM;QACf;IACJ;IACA,IAAIE,IAAAA,6BAAa,EAACF,OAAO;QACrB,MAAMG,mBAAmBC,IAAAA,gCAAe,EAACJ;QACzCG,iBAAiBE,mBAAmB,CAAC,UAAUJ;IACnD;IACA,IAAIC,IAAAA,6BAAa,EAACH,OAAO;QACrB,MAAMO,eAAeF,IAAAA,gCAAe,EAACL;QACrCO,aAAaC,gBAAgB,CAAC,UAAUN;IAC5C;AACJ"}
|
|
@@ -4,11 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "useCallbackRef", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return useCallbackRef;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
const _react = /*#__PURE__*/
|
|
11
|
-
const
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
12
14
|
function useCallbackRef(initialValue, callback, skipInitialResolve) {
|
|
13
15
|
const isFirst = _react.useRef(true);
|
|
14
16
|
const [ref] = _react.useState(()=>({
|
|
@@ -33,7 +35,7 @@ function useCallbackRef(initialValue, callback, skipInitialResolve) {
|
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
}));
|
|
36
|
-
(0,
|
|
38
|
+
(0, _reactutilities.useIsomorphicLayoutEffect)(()=>{
|
|
37
39
|
isFirst.current = false;
|
|
38
40
|
}, []);
|
|
39
41
|
// update callback
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useCallbackRef.js"],"sourcesContent":["import * as React from 'react';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\n/**\n * Creates a MutableRef with ref change callback. Is useful as React.useRef() doesn't notify you when its content\n * changes and mutating the .current property doesn't cause a re-render. An opt-out will be use a callback ref via\n * React.useState(), but it will cause re-renders always.\n *\n * https://reactjs.org/docs/hooks-reference.html#useref\n * https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref\n *\n * @param initialValue - initial ref value\n * @param callback - a callback to run when value changes\n * @param skipInitialResolve - a flag to skip an initial ref report\n *\n * @example\n * const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue);\n * ref.current = 1;\n * // prints 0 -> 1\n */ export function useCallbackRef(initialValue, callback, skipInitialResolve) {\n const isFirst = React.useRef(true);\n const [ref] = React.useState(()=>({\n // value\n value: initialValue,\n // last callback\n callback,\n // \"memoized\" public interface\n facade: {\n get current () {\n return ref.value;\n },\n set current (value){\n const last = ref.value;\n if (last !== value) {\n ref.value = value;\n if (skipInitialResolve && isFirst.current) {\n return;\n }\n ref.callback(value, last);\n }\n }\n }\n }));\n useIsomorphicLayoutEffect(()=>{\n isFirst.current = false;\n }, []);\n // update callback\n ref.callback = callback;\n return ref.facade;\n}\n"],"names":["useCallbackRef","initialValue","callback","skipInitialResolve","isFirst","React","useRef","ref","useState","value","facade","current","last","useIsomorphicLayoutEffect"],"mappings":";;;;+BAkBoBA
|
|
1
|
+
{"version":3,"sources":["useCallbackRef.js"],"sourcesContent":["import * as React from 'react';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\n/**\n * Creates a MutableRef with ref change callback. Is useful as React.useRef() doesn't notify you when its content\n * changes and mutating the .current property doesn't cause a re-render. An opt-out will be use a callback ref via\n * React.useState(), but it will cause re-renders always.\n *\n * https://reactjs.org/docs/hooks-reference.html#useref\n * https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref\n *\n * @param initialValue - initial ref value\n * @param callback - a callback to run when value changes\n * @param skipInitialResolve - a flag to skip an initial ref report\n *\n * @example\n * const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue);\n * ref.current = 1;\n * // prints 0 -> 1\n */ export function useCallbackRef(initialValue, callback, skipInitialResolve) {\n const isFirst = React.useRef(true);\n const [ref] = React.useState(()=>({\n // value\n value: initialValue,\n // last callback\n callback,\n // \"memoized\" public interface\n facade: {\n get current () {\n return ref.value;\n },\n set current (value){\n const last = ref.value;\n if (last !== value) {\n ref.value = value;\n if (skipInitialResolve && isFirst.current) {\n return;\n }\n ref.callback(value, last);\n }\n }\n }\n }));\n useIsomorphicLayoutEffect(()=>{\n isFirst.current = false;\n }, []);\n // update callback\n ref.callback = callback;\n return ref.facade;\n}\n"],"names":["useCallbackRef","initialValue","callback","skipInitialResolve","isFirst","React","useRef","ref","useState","value","facade","current","last","useIsomorphicLayoutEffect"],"mappings":";;;;+BAkBoBA;;;eAAAA;;;;iEAlBG;gCACmB;AAiB/B,SAASA,eAAeC,YAAY,EAAEC,QAAQ,EAAEC,kBAAkB;IACzE,MAAMC,UAAUC,OAAMC,MAAM,CAAC;IAC7B,MAAM,CAACC,IAAI,GAAGF,OAAMG,QAAQ,CAAC,IAAK,CAAA;YAC1B,QAAQ;YACRC,OAAOR;YACP,gBAAgB;YAChBC;YACA,8BAA8B;YAC9BQ,QAAQ;gBACJ,IAAIC,WAAW;oBACX,OAAOJ,IAAIE,KAAK;gBACpB;gBACA,IAAIE,SAASF,MAAM;oBACf,MAAMG,OAAOL,IAAIE,KAAK;oBACtB,IAAIG,SAASH,OAAO;wBAChBF,IAAIE,KAAK,GAAGA;wBACZ,IAAIN,sBAAsBC,QAAQO,OAAO,EAAE;4BACvC;wBACJ;wBACAJ,IAAIL,QAAQ,CAACO,OAAOG;oBACxB;gBACJ;YACJ;QACJ,CAAA;IACJC,IAAAA,yCAAyB,EAAC;QACtBT,QAAQO,OAAO,GAAG;IACtB,GAAG,EAAE;IACL,kBAAkB;IAClBJ,IAAIL,QAAQ,GAAGA;IACf,OAAOK,IAAIG,MAAM;AACrB"}
|
|
@@ -6,14 +6,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
Object.defineProperty(exports, "writeArrowUpdates", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: ()
|
|
9
|
+
get: function() {
|
|
10
|
+
return writeArrowUpdates;
|
|
11
|
+
}
|
|
10
12
|
});
|
|
11
13
|
function writeArrowUpdates(options) {
|
|
12
|
-
const { arrow
|
|
14
|
+
const { arrow, middlewareData } = options;
|
|
13
15
|
if (!middlewareData.arrow || !arrow) {
|
|
14
16
|
return;
|
|
15
17
|
}
|
|
16
|
-
const { x: arrowX
|
|
18
|
+
const { x: arrowX, y: arrowY } = middlewareData.arrow;
|
|
17
19
|
Object.assign(arrow.style, {
|
|
18
20
|
left: `${arrowX}px`,
|
|
19
21
|
top: `${arrowY}px`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["writeArrowUpdates.js"],"sourcesContent":["/**\n * Writes all DOM element updates after position is computed\n */ export function writeArrowUpdates(options) {\n const { arrow
|
|
1
|
+
{"version":3,"sources":["writeArrowUpdates.js"],"sourcesContent":["/**\n * Writes all DOM element updates after position is computed\n */ export function writeArrowUpdates(options) {\n const { arrow, middlewareData } = options;\n if (!middlewareData.arrow || !arrow) {\n return;\n }\n const { x: arrowX, y: arrowY } = middlewareData.arrow;\n Object.assign(arrow.style, {\n left: `${arrowX}px`,\n top: `${arrowY}px`\n });\n}\n"],"names":["writeArrowUpdates","options","arrow","middlewareData","x","arrowX","y","arrowY","Object","assign","style","left","top"],"mappings":"AAAA;;CAEC;;;;+BAAmBA;;;eAAAA;;;AAAT,SAASA,kBAAkBC,OAAO;IACzC,MAAM,EAAEC,KAAK,EAAEC,cAAc,EAAE,GAAGF;IAClC,IAAI,CAACE,eAAeD,KAAK,IAAI,CAACA,OAAO;QACjC;IACJ;IACA,MAAM,EAAEE,GAAGC,MAAM,EAAEC,GAAGC,MAAM,EAAE,GAAGJ,eAAeD,KAAK;IACrDM,OAAOC,MAAM,CAACP,MAAMQ,KAAK,EAAE;QACvBC,MAAM,CAAC,EAAEN,OAAO,EAAE,CAAC;QACnBO,KAAK,CAAC,EAAEL,OAAO,EAAE,CAAC;IACtB;AACJ"}
|
|
@@ -4,12 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "writeContainerUpdates", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return writeContainerUpdates;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
const _constants = require("../constants");
|
|
10
12
|
function writeContainerUpdates(options) {
|
|
11
13
|
var _middlewareData_hide, _middlewareData_hide1, _container_ownerDocument_defaultView;
|
|
12
|
-
const { container
|
|
14
|
+
const { container, placement, middlewareData, strategy, lowPPI, coordinates, useTransform = true } = options;
|
|
13
15
|
if (!container) {
|
|
14
16
|
return;
|
|
15
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["writeContainerupdates.js"],"sourcesContent":["import { DATA_POSITIONING_ESCAPED, DATA_POSITIONING_HIDDEN, DATA_POSITIONING_INTERSECTING, DATA_POSITIONING_PLACEMENT } from '../constants';\n/**\n * Writes all container element position updates after the position is computed\n */ export function writeContainerUpdates(options) {\n var _middlewareData_hide, _middlewareData_hide1, _container_ownerDocument_defaultView;\n const { container
|
|
1
|
+
{"version":3,"sources":["writeContainerupdates.js"],"sourcesContent":["import { DATA_POSITIONING_ESCAPED, DATA_POSITIONING_HIDDEN, DATA_POSITIONING_INTERSECTING, DATA_POSITIONING_PLACEMENT } from '../constants';\n/**\n * Writes all container element position updates after the position is computed\n */ export function writeContainerUpdates(options) {\n var _middlewareData_hide, _middlewareData_hide1, _container_ownerDocument_defaultView;\n const { container, placement, middlewareData, strategy, lowPPI, coordinates, useTransform = true } = options;\n if (!container) {\n return;\n }\n container.setAttribute(DATA_POSITIONING_PLACEMENT, placement);\n container.removeAttribute(DATA_POSITIONING_INTERSECTING);\n if (middlewareData.intersectionObserver.intersecting) {\n container.setAttribute(DATA_POSITIONING_INTERSECTING, '');\n }\n container.removeAttribute(DATA_POSITIONING_ESCAPED);\n if ((_middlewareData_hide = middlewareData.hide) === null || _middlewareData_hide === void 0 ? void 0 : _middlewareData_hide.escaped) {\n container.setAttribute(DATA_POSITIONING_ESCAPED, '');\n }\n container.removeAttribute(DATA_POSITIONING_HIDDEN);\n if ((_middlewareData_hide1 = middlewareData.hide) === null || _middlewareData_hide1 === void 0 ? void 0 : _middlewareData_hide1.referenceHidden) {\n container.setAttribute(DATA_POSITIONING_HIDDEN, '');\n }\n // Round so that the coordinates land on device pixels.\n // This prevents blurriness in cases where the browser doesn't apply pixel snapping, such as when other effects like\n // `backdrop-filter: blur()` are applied to the container, and the browser is zoomed in.\n // See https://github.com/microsoft/fluentui/issues/26764 for more info.\n const devicePixelRatio = ((_container_ownerDocument_defaultView = container.ownerDocument.defaultView) === null || _container_ownerDocument_defaultView === void 0 ? void 0 : _container_ownerDocument_defaultView.devicePixelRatio) || 1;\n const x = Math.round(coordinates.x * devicePixelRatio) / devicePixelRatio;\n const y = Math.round(coordinates.y * devicePixelRatio) / devicePixelRatio;\n Object.assign(container.style, {\n position: strategy\n });\n if (useTransform) {\n Object.assign(container.style, {\n transform: lowPPI ? `translate(${x}px, ${y}px)` : `translate3d(${x}px, ${y}px, 0)`\n });\n return;\n }\n Object.assign(container.style, {\n left: `${x}px`,\n top: `${y}px`\n });\n}\n"],"names":["writeContainerUpdates","options","_middlewareData_hide","_middlewareData_hide1","_container_ownerDocument_defaultView","container","placement","middlewareData","strategy","lowPPI","coordinates","useTransform","setAttribute","DATA_POSITIONING_PLACEMENT","removeAttribute","DATA_POSITIONING_INTERSECTING","intersectionObserver","intersecting","DATA_POSITIONING_ESCAPED","hide","escaped","DATA_POSITIONING_HIDDEN","referenceHidden","devicePixelRatio","ownerDocument","defaultView","x","Math","round","y","Object","assign","style","position","transform","left","top"],"mappings":";;;;+BAGoBA;;;eAAAA;;;2BAHyG;AAGlH,SAASA,sBAAsBC,OAAO;IAC7C,IAAIC,sBAAsBC,uBAAuBC;IACjD,MAAM,EAAEC,SAAS,EAAEC,SAAS,EAAEC,cAAc,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,WAAW,EAAEC,eAAe,IAAI,EAAE,GAAGV;IACrG,IAAI,CAACI,WAAW;QACZ;IACJ;IACAA,UAAUO,YAAY,CAACC,qCAA0B,EAAEP;IACnDD,UAAUS,eAAe,CAACC,wCAA6B;IACvD,IAAIR,eAAeS,oBAAoB,CAACC,YAAY,EAAE;QAClDZ,UAAUO,YAAY,CAACG,wCAA6B,EAAE;IAC1D;IACAV,UAAUS,eAAe,CAACI,mCAAwB;IAClD,IAAI,AAAChB,CAAAA,uBAAuBK,eAAeY,IAAI,AAAD,MAAO,QAAQjB,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBkB,OAAO,EAAE;QAClIf,UAAUO,YAAY,CAACM,mCAAwB,EAAE;IACrD;IACAb,UAAUS,eAAe,CAACO,kCAAuB;IACjD,IAAI,AAAClB,CAAAA,wBAAwBI,eAAeY,IAAI,AAAD,MAAO,QAAQhB,0BAA0B,KAAK,IAAI,KAAK,IAAIA,sBAAsBmB,eAAe,EAAE;QAC7IjB,UAAUO,YAAY,CAACS,kCAAuB,EAAE;IACpD;IACA,uDAAuD;IACvD,oHAAoH;IACpH,wFAAwF;IACxF,wEAAwE;IACxE,MAAME,mBAAmB,AAAC,CAAA,AAACnB,CAAAA,uCAAuCC,UAAUmB,aAAa,CAACC,WAAW,AAAD,MAAO,QAAQrB,yCAAyC,KAAK,IAAI,KAAK,IAAIA,qCAAqCmB,gBAAgB,AAAD,KAAM;IACxO,MAAMG,IAAIC,KAAKC,KAAK,CAAClB,YAAYgB,CAAC,GAAGH,oBAAoBA;IACzD,MAAMM,IAAIF,KAAKC,KAAK,CAAClB,YAAYmB,CAAC,GAAGN,oBAAoBA;IACzDO,OAAOC,MAAM,CAAC1B,UAAU2B,KAAK,EAAE;QAC3BC,UAAUzB;IACd;IACA,IAAIG,cAAc;QACdmB,OAAOC,MAAM,CAAC1B,UAAU2B,KAAK,EAAE;YAC3BE,WAAWzB,SAAS,CAAC,UAAU,EAAEiB,EAAE,IAAI,EAAEG,EAAE,GAAG,CAAC,GAAG,CAAC,YAAY,EAAEH,EAAE,IAAI,EAAEG,EAAE,MAAM,CAAC;QACtF;QACA;IACJ;IACAC,OAAOC,MAAM,CAAC1B,UAAU2B,KAAK,EAAE;QAC3BG,MAAM,CAAC,EAAET,EAAE,EAAE,CAAC;QACdU,KAAK,CAAC,EAAEP,EAAE,EAAE,CAAC;IACjB;AACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-positioning",
|
|
3
|
-
"version": "0.0.0-nightly-
|
|
3
|
+
"version": "0.0.0-nightly-20230901-0414.1",
|
|
4
4
|
"description": "A react wrapper around Popper.js for Fluent UI",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -30,17 +30,17 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@floating-ui/dom": "^1.2.0",
|
|
33
|
-
"@fluentui/react-shared-contexts": "0.0.0-nightly-
|
|
34
|
-
"@fluentui/react-theme": "0.0.0-nightly-
|
|
35
|
-
"@fluentui/react-utilities": "0.0.0-nightly-
|
|
33
|
+
"@fluentui/react-shared-contexts": "0.0.0-nightly-20230901-0414.1",
|
|
34
|
+
"@fluentui/react-theme": "0.0.0-nightly-20230901-0414.1",
|
|
35
|
+
"@fluentui/react-utilities": "0.0.0-nightly-20230901-0414.1",
|
|
36
36
|
"@griffel/react": "^1.5.14",
|
|
37
|
-
"@swc/helpers": "^0.
|
|
37
|
+
"@swc/helpers": "^0.5.1"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@types/react": ">=16.
|
|
41
|
-
"@types/react-dom": ">=16.
|
|
42
|
-
"react": ">=16.
|
|
43
|
-
"react-dom": ">=16.
|
|
40
|
+
"@types/react": ">=16.14.0 <19.0.0",
|
|
41
|
+
"@types/react-dom": ">=16.14.0 <19.0.0",
|
|
42
|
+
"react": ">=16.14.0 <19.0.0",
|
|
43
|
+
"react-dom": ">=16.14.0 <19.0.0"
|
|
44
44
|
},
|
|
45
45
|
"beachball": {},
|
|
46
46
|
"exports": {
|