@fluentui/react-positioning 0.0.0-nightly-20230317-1454.1 → 0.0.0-nightly-20230322-0439.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.
Files changed (92) hide show
  1. package/.swcrc +2 -11
  2. package/CHANGELOG.json +48 -9
  3. package/CHANGELOG.md +20 -7
  4. package/lib/constants.js +4 -4
  5. package/lib/createArrowStyles.js +19 -19
  6. package/lib/createPositionManager.js +13 -13
  7. package/lib/createPositionManager.js.map +1 -1
  8. package/lib/index.js +5 -5
  9. package/lib/middleware/coverTarget.js +6 -6
  10. package/lib/middleware/flip.js +4 -4
  11. package/lib/middleware/index.js +6 -6
  12. package/lib/middleware/intersecting.js +2 -2
  13. package/lib/middleware/maxSize.js +8 -8
  14. package/lib/middleware/offset.js +2 -2
  15. package/lib/middleware/shift.js +5 -5
  16. package/lib/types.js +1 -1
  17. package/lib/usePositioning.js +37 -29
  18. package/lib/usePositioning.js.map +1 -1
  19. package/lib/usePositioningMouseTarget.js +4 -4
  20. package/lib/utils/fromFloatingUIPlacement.js +10 -10
  21. package/lib/utils/getBoundary.js +8 -8
  22. package/lib/utils/getBoundary.js.map +1 -1
  23. package/lib/utils/getFloatingUIOffset.js +2 -2
  24. package/lib/utils/getReactFiberFromNode.js +3 -3
  25. package/lib/utils/getScrollParent.js +8 -6
  26. package/lib/utils/getScrollParent.js.map +1 -1
  27. package/lib/utils/hasAutoFocusFilter.js +4 -3
  28. package/lib/utils/hasAutoFocusFilter.js.map +1 -1
  29. package/lib/utils/index.js +15 -15
  30. package/lib/utils/mergeArrowOffset.js +6 -5
  31. package/lib/utils/mergeArrowOffset.js.map +1 -1
  32. package/lib/utils/parseFloatingUIPlacement.js +1 -1
  33. package/lib/utils/resolvePositioningShorthand.js +33 -33
  34. package/lib/utils/toFloatingUIPadding.js +3 -3
  35. package/lib/utils/toFloatingUIPlacement.js +11 -11
  36. package/lib/utils/toggleScrollListener.js +4 -4
  37. package/lib/utils/useCallbackRef.js +2 -2
  38. package/lib/utils/writeContainerupdates.js +8 -7
  39. package/lib/utils/writeContainerupdates.js.map +1 -1
  40. package/lib-commonjs/constants.js +4 -4
  41. package/lib-commonjs/constants.js.map +1 -1
  42. package/lib-commonjs/createArrowStyles.js +16 -16
  43. package/lib-commonjs/createArrowStyles.js.map +1 -1
  44. package/lib-commonjs/createPositionManager.js +10 -10
  45. package/lib-commonjs/createPositionManager.js.map +1 -1
  46. package/lib-commonjs/index.js.map +1 -1
  47. package/lib-commonjs/middleware/coverTarget.js +5 -5
  48. package/lib-commonjs/middleware/coverTarget.js.map +1 -1
  49. package/lib-commonjs/middleware/flip.js +2 -2
  50. package/lib-commonjs/middleware/flip.js.map +1 -1
  51. package/lib-commonjs/middleware/index.js.map +1 -1
  52. package/lib-commonjs/middleware/intersecting.js +1 -1
  53. package/lib-commonjs/middleware/intersecting.js.map +1 -1
  54. package/lib-commonjs/middleware/maxSize.js +6 -6
  55. package/lib-commonjs/middleware/maxSize.js.map +1 -1
  56. package/lib-commonjs/middleware/offset.js.map +1 -1
  57. package/lib-commonjs/middleware/shift.js +3 -3
  58. package/lib-commonjs/middleware/shift.js.map +1 -1
  59. package/lib-commonjs/types.js.map +1 -1
  60. package/lib-commonjs/usePositioning.js +30 -22
  61. package/lib-commonjs/usePositioning.js.map +1 -1
  62. package/lib-commonjs/usePositioningMouseTarget.js +2 -2
  63. package/lib-commonjs/usePositioningMouseTarget.js.map +1 -1
  64. package/lib-commonjs/utils/fromFloatingUIPlacement.js +9 -9
  65. package/lib-commonjs/utils/fromFloatingUIPlacement.js.map +1 -1
  66. package/lib-commonjs/utils/getBoundary.js +7 -7
  67. package/lib-commonjs/utils/getBoundary.js.map +1 -1
  68. package/lib-commonjs/utils/getFloatingUIOffset.js +1 -1
  69. package/lib-commonjs/utils/getFloatingUIOffset.js.map +1 -1
  70. package/lib-commonjs/utils/getReactFiberFromNode.js +2 -2
  71. package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
  72. package/lib-commonjs/utils/getScrollParent.js +8 -6
  73. package/lib-commonjs/utils/getScrollParent.js.map +1 -1
  74. package/lib-commonjs/utils/hasAutoFocusFilter.js +3 -2
  75. package/lib-commonjs/utils/hasAutoFocusFilter.js.map +1 -1
  76. package/lib-commonjs/utils/index.js.map +1 -1
  77. package/lib-commonjs/utils/mergeArrowOffset.js +6 -5
  78. package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
  79. package/lib-commonjs/utils/parseFloatingUIPlacement.js +1 -1
  80. package/lib-commonjs/utils/parseFloatingUIPlacement.js.map +1 -1
  81. package/lib-commonjs/utils/resolvePositioningShorthand.js +33 -33
  82. package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
  83. package/lib-commonjs/utils/toFloatingUIPadding.js +3 -3
  84. package/lib-commonjs/utils/toFloatingUIPadding.js.map +1 -1
  85. package/lib-commonjs/utils/toFloatingUIPlacement.js +11 -11
  86. package/lib-commonjs/utils/toFloatingUIPlacement.js.map +1 -1
  87. package/lib-commonjs/utils/toggleScrollListener.js +2 -2
  88. package/lib-commonjs/utils/toggleScrollListener.js.map +1 -1
  89. package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
  90. package/lib-commonjs/utils/writeContainerupdates.js +7 -6
  91. package/lib-commonjs/utils/writeContainerupdates.js.map +1 -1
  92. package/package.json +5 -4
@@ -1,5 +1,5 @@
1
1
  export function toFloatingUIPadding(padding, isRtl) {
2
- if (typeof padding === "number") {
2
+ if (typeof padding === 'number') {
3
3
  return padding;
4
4
  }
5
5
  const {
@@ -8,8 +8,8 @@ export function toFloatingUIPadding(padding, isRtl) {
8
8
  ...verticalPadding
9
9
  } = padding;
10
10
  const paddingObject = verticalPadding;
11
- const left = isRtl ? "end" : "start";
12
- const right = isRtl ? "start" : "end";
11
+ const left = isRtl ? 'end' : 'start';
12
+ const right = isRtl ? 'start' : 'end';
13
13
  // assign properties explicitly since undefined values are actually handled by floating UI
14
14
  // TODO create floating UI issue
15
15
  if (padding[left]) {
@@ -1,21 +1,21 @@
1
1
  const getPositionMap = rtl => ({
2
- above: "top",
3
- below: "bottom",
4
- before: rtl ? "right" : "left",
5
- after: rtl ? "left" : "right"
2
+ above: 'top',
3
+ below: 'bottom',
4
+ before: rtl ? 'right' : 'left',
5
+ after: rtl ? 'left' : 'right'
6
6
  });
7
7
  // Floating UI automatically flips alignment
8
8
  // https://github.com/floating-ui/floating-ui/issues/1563
9
9
  const getAlignmentMap = () => ({
10
- start: "start",
11
- end: "end",
12
- top: "start",
13
- bottom: "end",
10
+ start: 'start',
11
+ end: 'end',
12
+ top: 'start',
13
+ bottom: 'end',
14
14
  center: undefined
15
15
  });
16
16
  const shouldAlignToCenter = (p, a) => {
17
- const positionedVertically = p === "above" || p === "below";
18
- const alignedVertically = a === "top" || a === "bottom";
17
+ const positionedVertically = p === 'above' || p === 'below';
18
+ const alignedVertically = a === 'top' || a === 'bottom';
19
19
  return positionedVertically && alignedVertically || !positionedVertically && !alignedVertically;
20
20
  };
21
21
  /**
@@ -23,7 +23,7 @@ const shouldAlignToCenter = (p, a) => {
23
23
  * @see positioningHelper.test.ts for expected placement values
24
24
  */
25
25
  export const toFloatingUIPlacement = (align, position, rtl) => {
26
- const alignment = shouldAlignToCenter(position, align) ? "center" : align;
26
+ const alignment = shouldAlignToCenter(position, align) ? 'center' : align;
27
27
  const computedPosition = position && getPositionMap(rtl)[position];
28
28
  const computedAlignment = alignment && getAlignmentMap()[alignment];
29
29
  if (computedPosition && computedAlignment) {
@@ -1,5 +1,5 @@
1
- import { isHTMLElement } from "@fluentui/react-utilities";
2
- import { getScrollParent } from "./getScrollParent";
1
+ import { isHTMLElement } from '@fluentui/react-utilities';
2
+ import { getScrollParent } from './getScrollParent';
3
3
  /**
4
4
  * Toggles event listeners for scroll parent.
5
5
  * Cleans up the event listeners for the previous element and adds them for the new scroll parent.
@@ -12,11 +12,11 @@ export function toggleScrollListener(next, prev, handler) {
12
12
  }
13
13
  if (isHTMLElement(prev)) {
14
14
  const prevScrollParent = getScrollParent(prev);
15
- prevScrollParent.removeEventListener("scroll", handler);
15
+ prevScrollParent.removeEventListener('scroll', handler);
16
16
  }
17
17
  if (isHTMLElement(next)) {
18
18
  const scrollParent = getScrollParent(next);
19
- scrollParent.addEventListener("scroll", handler);
19
+ scrollParent.addEventListener('scroll', handler);
20
20
  }
21
21
  }
22
22
  //# sourceMappingURL=toggleScrollListener.js.map
@@ -1,5 +1,5 @@
1
- import * as React from "react";
2
- import { useIsomorphicLayoutEffect } from "@fluentui/react-utilities";
1
+ import * as React from 'react';
2
+ import { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';
3
3
  /**
4
4
  * Creates a MutableRef with ref change callback. Is useful as React.useRef() doesn't notify you when its content
5
5
  * changes and mutating the .current property doesn't cause a re-render. An opt-out will be use a callback ref via
@@ -1,8 +1,9 @@
1
- import { DATA_POSITIONING_ESCAPED, DATA_POSITIONING_HIDDEN, DATA_POSITIONING_INTERSECTING, DATA_POSITIONING_PLACEMENT } from "../constants";
1
+ import { DATA_POSITIONING_ESCAPED, DATA_POSITIONING_HIDDEN, DATA_POSITIONING_INTERSECTING, DATA_POSITIONING_PLACEMENT } from '../constants';
2
2
  /**
3
3
  * Writes all container element position updates after the position is computed
4
4
  */
5
5
  export function writeContainerUpdates(options) {
6
+ var _middlewareData_hide, _middlewareData_hide1, _container_ownerDocument_defaultView;
6
7
  const {
7
8
  container,
8
9
  placement,
@@ -17,21 +18,21 @@ export function writeContainerUpdates(options) {
17
18
  container.setAttribute(DATA_POSITIONING_PLACEMENT, placement);
18
19
  container.removeAttribute(DATA_POSITIONING_INTERSECTING);
19
20
  if (middlewareData.intersectionObserver.intersecting) {
20
- container.setAttribute(DATA_POSITIONING_INTERSECTING, "");
21
+ container.setAttribute(DATA_POSITIONING_INTERSECTING, '');
21
22
  }
22
23
  container.removeAttribute(DATA_POSITIONING_ESCAPED);
23
- if (middlewareData.hide?.escaped) {
24
- container.setAttribute(DATA_POSITIONING_ESCAPED, "");
24
+ if ((_middlewareData_hide = middlewareData.hide) === null || _middlewareData_hide === void 0 ? void 0 : _middlewareData_hide.escaped) {
25
+ container.setAttribute(DATA_POSITIONING_ESCAPED, '');
25
26
  }
26
27
  container.removeAttribute(DATA_POSITIONING_HIDDEN);
27
- if (middlewareData.hide?.referenceHidden) {
28
- container.setAttribute(DATA_POSITIONING_HIDDEN, "");
28
+ if ((_middlewareData_hide1 = middlewareData.hide) === null || _middlewareData_hide1 === void 0 ? void 0 : _middlewareData_hide1.referenceHidden) {
29
+ container.setAttribute(DATA_POSITIONING_HIDDEN, '');
29
30
  }
30
31
  // Round so that the coordinates land on device pixels.
31
32
  // This prevents blurriness in cases where the browser doesn't apply pixel snapping, such as when other effects like
32
33
  // `backdrop-filter: blur()` are applied to the container, and the browser is zoomed in.
33
34
  // See https://github.com/microsoft/fluentui/issues/26764 for more info.
34
- const devicePixelRatio = container.ownerDocument.defaultView?.devicePixelRatio || 1;
35
+ const devicePixelRatio = ((_container_ownerDocument_defaultView = container.ownerDocument.defaultView) === null || _container_ownerDocument_defaultView === void 0 ? void 0 : _container_ownerDocument_defaultView.devicePixelRatio) || 1;
35
36
  const x = Math.round(coordinates.x * devicePixelRatio) / devicePixelRatio;
36
37
  const y = Math.round(coordinates.y * devicePixelRatio) / devicePixelRatio;
37
38
  Object.assign(container.style, {
@@ -1 +1 @@
1
- {"version":3,"names":["DATA_POSITIONING_ESCAPED","DATA_POSITIONING_HIDDEN","DATA_POSITIONING_INTERSECTING","DATA_POSITIONING_PLACEMENT","writeContainerUpdates","options","container","placement","middlewareData","strategy","lowPPI","coordinates","setAttribute","removeAttribute","intersectionObserver","intersecting","hide","escaped","referenceHidden","devicePixelRatio","ownerDocument","defaultView","x","Math","round","y","Object","assign","style","transform","position"],"sources":["../../src/utils/writeContainerupdates.ts"],"sourcesContent":["import type { Placement, MiddlewareData, Strategy, Coords } from '@floating-ui/dom';\nimport {\n DATA_POSITIONING_ESCAPED,\n DATA_POSITIONING_HIDDEN,\n DATA_POSITIONING_INTERSECTING,\n DATA_POSITIONING_PLACEMENT,\n} from '../constants';\n\n/**\n * Writes all container element position updates after the position is computed\n */\nexport function writeContainerUpdates(options: {\n container: HTMLElement | null;\n placement: Placement;\n middlewareData: MiddlewareData;\n /**\n * Layer acceleration can disable subpixel rendering which causes slightly\n * blurry text on low PPI displays, so we want to use 2D transforms\n * instead\n */\n lowPPI: boolean;\n strategy: Strategy;\n coordinates: Coords;\n}) {\n const { container, placement, middlewareData, strategy, lowPPI, coordinates } = 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\n container.removeAttribute(DATA_POSITIONING_ESCAPED);\n if (middlewareData.hide?.escaped) {\n container.setAttribute(DATA_POSITIONING_ESCAPED, '');\n }\n\n container.removeAttribute(DATA_POSITIONING_HIDDEN);\n if (middlewareData.hide?.referenceHidden) {\n container.setAttribute(DATA_POSITIONING_HIDDEN, '');\n }\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?.devicePixelRatio || 1;\n const x = Math.round(coordinates.x * devicePixelRatio) / devicePixelRatio;\n const y = Math.round(coordinates.y * devicePixelRatio) / devicePixelRatio;\n\n Object.assign(container.style, {\n transform: lowPPI ? `translate(${x}px, ${y}px)` : `translate3d(${x}px, ${y}px, 0)`,\n position: strategy,\n });\n}\n"],"mappings":"AACA,SACEA,wBAAwB,EACxBC,uBAAuB,EACvBC,6BAA6B,EAC7BC,0BAA0B,QACrB;AAEP;;;AAGA,OAAO,SAASC,sBAAsBC,OAYrC,EAAE;EACD,MAAM;IAAEC,SAAA;IAAWC,SAAA;IAAWC,cAAA;IAAgBC,QAAA;IAAUC,MAAA;IAAQC;EAAW,CAAE,GAAGN,OAAA;EAChF,IAAI,CAACC,SAAA,EAAW;IACd;EACF;EACAA,SAAA,CAAUM,YAAY,CAACT,0BAAA,EAA4BI,SAAA;EACnDD,SAAA,CAAUO,eAAe,CAACX,6BAAA;EAC1B,IAAIM,cAAA,CAAeM,oBAAoB,CAACC,YAAY,EAAE;IACpDT,SAAA,CAAUM,YAAY,CAACV,6BAAA,EAA+B;EACxD;EAEAI,SAAA,CAAUO,eAAe,CAACb,wBAAA;EAC1B,IAAIQ,cAAA,CAAeQ,IAAI,EAAEC,OAAA,EAAS;IAChCX,SAAA,CAAUM,YAAY,CAACZ,wBAAA,EAA0B;EACnD;EAEAM,SAAA,CAAUO,eAAe,CAACZ,uBAAA;EAC1B,IAAIO,cAAA,CAAeQ,IAAI,EAAEE,eAAA,EAAiB;IACxCZ,SAAA,CAAUM,YAAY,CAACX,uBAAA,EAAyB;EAClD;EAEA;EACA;EACA;EACA;EACA,MAAMkB,gBAAA,GAAmBb,SAAA,CAAUc,aAAa,CAACC,WAAW,EAAEF,gBAAA,IAAoB;EAClF,MAAMG,CAAA,GAAIC,IAAA,CAAKC,KAAK,CAACb,WAAA,CAAYW,CAAC,GAAGH,gBAAA,IAAoBA,gBAAA;EACzD,MAAMM,CAAA,GAAIF,IAAA,CAAKC,KAAK,CAACb,WAAA,CAAYc,CAAC,GAAGN,gBAAA,IAAoBA,gBAAA;EAEzDO,MAAA,CAAOC,MAAM,CAACrB,SAAA,CAAUsB,KAAK,EAAE;IAC7BC,SAAA,EAAWnB,MAAA,GAAU,aAAYY,CAAE,OAAMG,CAAE,KAAI,GAAI,eAAcH,CAAE,OAAMG,CAAE,QAAO;IAClFK,QAAA,EAAUrB;EACZ;AACF"}
1
+ {"version":3,"names":["DATA_POSITIONING_ESCAPED","DATA_POSITIONING_HIDDEN","DATA_POSITIONING_INTERSECTING","DATA_POSITIONING_PLACEMENT","writeContainerUpdates","options","_middlewareData_hide","_middlewareData_hide1","_container_ownerDocument_defaultView","container","placement","middlewareData","strategy","lowPPI","coordinates","setAttribute","removeAttribute","intersectionObserver","intersecting","hide","escaped","referenceHidden","devicePixelRatio","ownerDocument","defaultView","x","Math","round","y","Object","assign","style","transform","position"],"sources":["../../src/utils/writeContainerupdates.ts"],"sourcesContent":["import type { Placement, MiddlewareData, Strategy, Coords } from '@floating-ui/dom';\nimport {\n DATA_POSITIONING_ESCAPED,\n DATA_POSITIONING_HIDDEN,\n DATA_POSITIONING_INTERSECTING,\n DATA_POSITIONING_PLACEMENT,\n} from '../constants';\n\n/**\n * Writes all container element position updates after the position is computed\n */\nexport function writeContainerUpdates(options: {\n container: HTMLElement | null;\n placement: Placement;\n middlewareData: MiddlewareData;\n /**\n * Layer acceleration can disable subpixel rendering which causes slightly\n * blurry text on low PPI displays, so we want to use 2D transforms\n * instead\n */\n lowPPI: boolean;\n strategy: Strategy;\n coordinates: Coords;\n}) {\n const { container, placement, middlewareData, strategy, lowPPI, coordinates } = 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\n container.removeAttribute(DATA_POSITIONING_ESCAPED);\n if (middlewareData.hide?.escaped) {\n container.setAttribute(DATA_POSITIONING_ESCAPED, '');\n }\n\n container.removeAttribute(DATA_POSITIONING_HIDDEN);\n if (middlewareData.hide?.referenceHidden) {\n container.setAttribute(DATA_POSITIONING_HIDDEN, '');\n }\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?.devicePixelRatio || 1;\n const x = Math.round(coordinates.x * devicePixelRatio) / devicePixelRatio;\n const y = Math.round(coordinates.y * devicePixelRatio) / devicePixelRatio;\n\n Object.assign(container.style, {\n transform: lowPPI ? `translate(${x}px, ${y}px)` : `translate3d(${x}px, ${y}px, 0)`,\n position: strategy,\n });\n}\n"],"mappings":"AACA,SACEA,wBAAwB,EACxBC,uBAAuB,EACvBC,6BAA6B,EAC7BC,0BAA0B,QACrB;AAEP;;;AAGA,OAAO,SAASC,sBAAsBC,OAYrC,EAAE;MAYGC,oBAAA,EAKAC,qBAAA,EAQqBC,oCAAA;EAxBzB,MAAM;IAAEC,SAAA;IAAWC,SAAA;IAAWC,cAAA;IAAgBC,QAAA;IAAUC,MAAA;IAAQC;EAAW,CAAE,GAAGT,OAAA;EAChF,IAAI,CAACI,SAAA,EAAW;IACd;EACF;EACAA,SAAA,CAAUM,YAAY,CAACZ,0BAAA,EAA4BO,SAAA;EACnDD,SAAA,CAAUO,eAAe,CAACd,6BAAA;EAC1B,IAAIS,cAAA,CAAeM,oBAAoB,CAACC,YAAY,EAAE;IACpDT,SAAA,CAAUM,YAAY,CAACb,6BAAA,EAA+B;EACxD;EAEAO,SAAA,CAAUO,eAAe,CAAChB,wBAAA;EAC1B,IAAI,CAAAM,oBAAA,GAAAK,cAAA,CAAeQ,IAAI,cAAnBb,oBAAA,uBAAAA,oBAAA,CAAqBc,OAAO,EAAE;IAChCX,SAAA,CAAUM,YAAY,CAACf,wBAAA,EAA0B;EACnD;EAEAS,SAAA,CAAUO,eAAe,CAACf,uBAAA;EAC1B,IAAI,CAAAM,qBAAA,GAAAI,cAAA,CAAeQ,IAAI,cAAnBZ,qBAAA,uBAAAA,qBAAA,CAAqBc,eAAe,EAAE;IACxCZ,SAAA,CAAUM,YAAY,CAACd,uBAAA,EAAyB;EAClD;EAEA;EACA;EACA;EACA;EACA,MAAMqB,gBAAA,GAAmB,EAAAd,oCAAA,GAAAC,SAAA,CAAUc,aAAa,CAACC,WAAW,cAAnChB,oCAAA,uBAAAA,oCAAA,CAAqCc,gBAAgB,KAAI;EAClF,MAAMG,CAAA,GAAIC,IAAA,CAAKC,KAAK,CAACb,WAAA,CAAYW,CAAC,GAAGH,gBAAA,IAAoBA,gBAAA;EACzD,MAAMM,CAAA,GAAIF,IAAA,CAAKC,KAAK,CAACb,WAAA,CAAYc,CAAC,GAAGN,gBAAA,IAAoBA,gBAAA;EAEzDO,MAAA,CAAOC,MAAM,CAACrB,SAAA,CAAUsB,KAAK,EAAE;IAC7BC,SAAA,EAAWnB,MAAA,GAAU,aAAYY,CAAE,OAAMG,CAAE,KAAI,GAAI,eAAcH,CAAE,OAAMG,CAAE,QAAO;IAClFK,QAAA,EAAUrB;EACZ;AACF"}
@@ -14,9 +14,9 @@ _export(exports, {
14
14
  DATA_POSITIONING_HIDDEN: ()=>DATA_POSITIONING_HIDDEN,
15
15
  DATA_POSITIONING_PLACEMENT: ()=>DATA_POSITIONING_PLACEMENT
16
16
  });
17
- const DATA_POSITIONING_INTERSECTING = "data-popper-is-intersecting";
18
- const DATA_POSITIONING_ESCAPED = "data-popper-escaped";
19
- const DATA_POSITIONING_HIDDEN = "data-popper-reference-hidden";
20
- const DATA_POSITIONING_PLACEMENT = "data-popper-placement"; //# sourceMappingURL=constants.js.map
17
+ const DATA_POSITIONING_INTERSECTING = 'data-popper-is-intersecting';
18
+ const DATA_POSITIONING_ESCAPED = 'data-popper-escaped';
19
+ const DATA_POSITIONING_HIDDEN = 'data-popper-reference-hidden';
20
+ const DATA_POSITIONING_PLACEMENT = 'data-popper-placement'; //# sourceMappingURL=constants.js.map
21
21
 
22
22
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../lib/constants.js"],"sourcesContent":["export const DATA_POSITIONING_INTERSECTING = \"data-popper-is-intersecting\";\nexport const DATA_POSITIONING_ESCAPED = \"data-popper-escaped\";\nexport const DATA_POSITIONING_HIDDEN = \"data-popper-reference-hidden\";\nexport const DATA_POSITIONING_PLACEMENT = \"data-popper-placement\";\n//# sourceMappingURL=constants.js.map"],"names":["DATA_POSITIONING_INTERSECTING","DATA_POSITIONING_ESCAPED","DATA_POSITIONING_HIDDEN","DATA_POSITIONING_PLACEMENT"],"mappings":";;;;;;;;;;;IAAaA,6BAA6B,MAA7BA;IACAC,wBAAwB,MAAxBA;IACAC,uBAAuB,MAAvBA;IACAC,0BAA0B,MAA1BA;;AAHN,MAAMH,gCAAgC;AACtC,MAAMC,2BAA2B;AACjC,MAAMC,0BAA0B;AAChC,MAAMC,6BAA6B,yBAC1C,qCAAqC"}
1
+ {"version":3,"sources":["../lib/constants.js"],"sourcesContent":["export const DATA_POSITIONING_INTERSECTING = 'data-popper-is-intersecting';\nexport const DATA_POSITIONING_ESCAPED = 'data-popper-escaped';\nexport const DATA_POSITIONING_HIDDEN = 'data-popper-reference-hidden';\nexport const DATA_POSITIONING_PLACEMENT = 'data-popper-placement';\n//# sourceMappingURL=constants.js.map"],"names":["DATA_POSITIONING_INTERSECTING","DATA_POSITIONING_ESCAPED","DATA_POSITIONING_HIDDEN","DATA_POSITIONING_PLACEMENT"],"mappings":";;;;;;;;;;;IAAaA,6BAA6B,MAA7BA;IACAC,wBAAwB,MAAxBA;IACAC,uBAAuB,MAAvBA;IACAC,0BAA0B,MAA1BA;;AAHN,MAAMH,gCAAgC;AACtC,MAAMC,2BAA2B;AACjC,MAAMC,0BAA0B;AAChC,MAAMC,6BAA6B,yBAC1C,qCAAqC"}
@@ -15,42 +15,42 @@ _export(exports, {
15
15
  const _react = require("@griffel/react");
16
16
  const _reactTheme = require("@fluentui/react-theme");
17
17
  function createArrowStyles(options) {
18
- const { arrowHeight , borderWidth ="1px" , borderStyle ="solid" , borderColor =_reactTheme.tokens.colorTransparentStroke } = options;
18
+ const { arrowHeight , borderWidth ='1px' , borderStyle ='solid' , borderColor =_reactTheme.tokens.colorTransparentStroke } = options;
19
19
  return {
20
- position: "absolute",
21
- backgroundColor: "inherit",
22
- visibility: "hidden",
20
+ position: 'absolute',
21
+ backgroundColor: 'inherit',
22
+ visibility: 'hidden',
23
23
  zIndex: -1,
24
24
  ...arrowHeight && createArrowHeightStyles(arrowHeight),
25
- "::before": {
25
+ '::before': {
26
26
  content: '""',
27
- visibility: "visible",
28
- position: "absolute",
29
- boxSizing: "border-box",
30
- width: "inherit",
31
- height: "inherit",
32
- backgroundColor: "inherit",
27
+ visibility: 'visible',
28
+ position: 'absolute',
29
+ boxSizing: 'border-box',
30
+ width: 'inherit',
31
+ height: 'inherit',
32
+ backgroundColor: 'inherit',
33
33
  ..._react.shorthands.borderRight(`${borderWidth} /* @noflip */`, `${borderStyle} /* @noflip */`, `${borderColor} /* @noflip */`),
34
34
  ..._react.shorthands.borderBottom(borderWidth, borderStyle, borderColor),
35
35
  borderBottomRightRadius: _reactTheme.tokens.borderRadiusSmall,
36
- transform: "rotate(var(--angle)) translate(0, 50%) rotate(45deg)"
36
+ transform: 'rotate(var(--angle)) translate(0, 50%) rotate(45deg)'
37
37
  },
38
38
  // Popper sets data-popper-placement on the root element, which is used to align the arrow
39
39
  ':global([data-popper-placement^="top"])': {
40
40
  bottom: `-${borderWidth}`,
41
- "--angle": "0"
41
+ '--angle': '0'
42
42
  },
43
43
  ':global([data-popper-placement^="right"])': {
44
44
  left: `-${borderWidth} /* @noflip */`,
45
- "--angle": "90deg"
45
+ '--angle': '90deg'
46
46
  },
47
47
  ':global([data-popper-placement^="bottom"])': {
48
48
  top: `-${borderWidth}`,
49
- "--angle": "180deg"
49
+ '--angle': '180deg'
50
50
  },
51
51
  ':global([data-popper-placement^="left"])': {
52
52
  right: `-${borderWidth} /* @noflip */`,
53
- "--angle": "270deg"
53
+ '--angle': '270deg'
54
54
  }
55
55
  };
56
56
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../lib/createArrowStyles.js"],"sourcesContent":["import { shorthands } from \"@griffel/react\";\nimport { tokens } from \"@fluentui/react-theme\";\n/**\n * @internal\n * Helper that creates a makeStyles rule for an arrow element.\n * For runtime arrow size toggling simply create extra classnames to apply to the arrow element\n *\n * ```ts\n * makeStyles({\n * arrowWithSize: createArrowStyles({ arrowHeight: 6 }),\n *\n * arrowWithoutSize: createArrowStyles({ arrowHeight: undefined }),\n * mediumArrow: createArrowHeightStyles(4),\n * smallArrow: createArrowHeightStyles(2),\n * })\n * ...\n *\n * state.arrowWithSize.className = styles.arrowWithSize;\n * state.arrowWithoutSize.className = mergeClasses(\n * styles.arrowWithoutSize,\n * state.smallArrow && styles.smallArrow,\n * state.mediumArrow && styles.mediumArrow,\n * )\n * ```\n */\nexport function createArrowStyles(options) {\n const {\n arrowHeight,\n borderWidth = \"1px\",\n borderStyle = \"solid\",\n borderColor = tokens.colorTransparentStroke\n } = options;\n return {\n position: \"absolute\",\n backgroundColor: \"inherit\",\n visibility: \"hidden\",\n zIndex: -1,\n ...(arrowHeight && createArrowHeightStyles(arrowHeight)),\n \"::before\": {\n content: '\"\"',\n visibility: \"visible\",\n position: \"absolute\",\n boxSizing: \"border-box\",\n width: \"inherit\",\n height: \"inherit\",\n backgroundColor: \"inherit\",\n ...shorthands.borderRight(`${borderWidth} /* @noflip */`, `${borderStyle} /* @noflip */`, `${borderColor} /* @noflip */`),\n ...shorthands.borderBottom(borderWidth, borderStyle, borderColor),\n borderBottomRightRadius: tokens.borderRadiusSmall,\n transform: \"rotate(var(--angle)) translate(0, 50%) rotate(45deg)\"\n },\n // Popper sets data-popper-placement on the root element, which is used to align the arrow\n ':global([data-popper-placement^=\"top\"])': {\n bottom: `-${borderWidth}`,\n \"--angle\": \"0\"\n },\n ':global([data-popper-placement^=\"right\"])': {\n left: `-${borderWidth} /* @noflip */`,\n \"--angle\": \"90deg\"\n },\n ':global([data-popper-placement^=\"bottom\"])': {\n top: `-${borderWidth}`,\n \"--angle\": \"180deg\"\n },\n ':global([data-popper-placement^=\"left\"])': {\n right: `-${borderWidth} /* @noflip */`,\n \"--angle\": \"270deg\"\n }\n };\n}\n/**\n * @internal\n * Creates CSS styles to size the arrow created by createArrowStyles to the given height.\n *\n * Use this when you need to create classes for several different arrow sizes. If you only need a\n * constant arrow size, you can pass the `arrowHeight` param to createArrowStyles instead.\n */\nexport function createArrowHeightStyles(arrowHeight) {\n // The arrow is a square rotated 45 degrees to have its bottom and right edges form a right triangle.\n // Multiply the triangle's height by sqrt(2) to get length of its edges.\n const edgeLength = `${1.414 * arrowHeight}px`;\n return {\n width: edgeLength,\n height: edgeLength\n };\n}\n//# sourceMappingURL=createArrowStyles.js.map"],"names":["createArrowStyles","createArrowHeightStyles","options","arrowHeight","borderWidth","borderStyle","borderColor","tokens","colorTransparentStroke","position","backgroundColor","visibility","zIndex","content","boxSizing","width","height","shorthands","borderRight","borderBottom","borderBottomRightRadius","borderRadiusSmall","transform","bottom","left","top","right","edgeLength"],"mappings":";;;;;;;;;;;IAyBgBA,iBAAiB,MAAjBA;IAoDAC,uBAAuB,MAAvBA;;uBA7EW;4BACJ;AAwBhB,SAASD,kBAAkBE,OAAO,EAAE;IACzC,MAAM,EACJC,YAAW,EACXC,aAAc,MAAK,EACnBC,aAAc,QAAO,EACrBC,aAAcC,kBAAM,CAACC,sBAAsB,CAAA,EAC5C,GAAGN;IACJ,OAAO;QACLO,UAAU;QACVC,iBAAiB;QACjBC,YAAY;QACZC,QAAQ,CAAC;QACT,GAAIT,eAAeF,wBAAwBE,YAAY;QACvD,YAAY;YACVU,SAAS;YACTF,YAAY;YACZF,UAAU;YACVK,WAAW;YACXC,OAAO;YACPC,QAAQ;YACRN,iBAAiB;YACjB,GAAGO,iBAAU,CAACC,WAAW,CAAC,CAAC,EAAEd,YAAY,cAAc,CAAC,EAAE,CAAC,EAAEC,YAAY,cAAc,CAAC,EAAE,CAAC,EAAEC,YAAY,cAAc,CAAC,CAAC;YACzH,GAAGW,iBAAU,CAACE,YAAY,CAACf,aAAaC,aAAaC,YAAY;YACjEc,yBAAyBb,kBAAM,CAACc,iBAAiB;YACjDC,WAAW;QACb;QACA,0FAA0F;QAC1F,2CAA2C;YACzCC,QAAQ,CAAC,CAAC,EAAEnB,YAAY,CAAC;YACzB,WAAW;QACb;QACA,6CAA6C;YAC3CoB,MAAM,CAAC,CAAC,EAAEpB,YAAY,cAAc,CAAC;YACrC,WAAW;QACb;QACA,8CAA8C;YAC5CqB,KAAK,CAAC,CAAC,EAAErB,YAAY,CAAC;YACtB,WAAW;QACb;QACA,4CAA4C;YAC1CsB,OAAO,CAAC,CAAC,EAAEtB,YAAY,cAAc,CAAC;YACtC,WAAW;QACb;IACF;AACF;AAQO,SAASH,wBAAwBE,WAAW,EAAE;IACnD,qGAAqG;IACrG,wEAAwE;IACxE,MAAMwB,aAAa,CAAC,EAAE,QAAQxB,YAAY,EAAE,CAAC;IAC7C,OAAO;QACLY,OAAOY;QACPX,QAAQW;IACV;AACF,EACA,6CAA6C"}
1
+ {"version":3,"sources":["../lib/createArrowStyles.js"],"sourcesContent":["import { shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\n/**\n * @internal\n * Helper that creates a makeStyles rule for an arrow element.\n * For runtime arrow size toggling simply create extra classnames to apply to the arrow element\n *\n * ```ts\n * makeStyles({\n * arrowWithSize: createArrowStyles({ arrowHeight: 6 }),\n *\n * arrowWithoutSize: createArrowStyles({ arrowHeight: undefined }),\n * mediumArrow: createArrowHeightStyles(4),\n * smallArrow: createArrowHeightStyles(2),\n * })\n * ...\n *\n * state.arrowWithSize.className = styles.arrowWithSize;\n * state.arrowWithoutSize.className = mergeClasses(\n * styles.arrowWithoutSize,\n * state.smallArrow && styles.smallArrow,\n * state.mediumArrow && styles.mediumArrow,\n * )\n * ```\n */\nexport function createArrowStyles(options) {\n const {\n arrowHeight,\n borderWidth = '1px',\n borderStyle = 'solid',\n borderColor = tokens.colorTransparentStroke\n } = options;\n return {\n position: 'absolute',\n backgroundColor: 'inherit',\n visibility: 'hidden',\n zIndex: -1,\n ...(arrowHeight && createArrowHeightStyles(arrowHeight)),\n '::before': {\n content: '\"\"',\n visibility: 'visible',\n position: 'absolute',\n boxSizing: 'border-box',\n width: 'inherit',\n height: 'inherit',\n backgroundColor: 'inherit',\n ...shorthands.borderRight(`${borderWidth} /* @noflip */`, `${borderStyle} /* @noflip */`, `${borderColor} /* @noflip */`),\n ...shorthands.borderBottom(borderWidth, borderStyle, borderColor),\n borderBottomRightRadius: tokens.borderRadiusSmall,\n transform: 'rotate(var(--angle)) translate(0, 50%) rotate(45deg)'\n },\n // Popper sets data-popper-placement on the root element, which is used to align the arrow\n ':global([data-popper-placement^=\"top\"])': {\n bottom: `-${borderWidth}`,\n '--angle': '0'\n },\n ':global([data-popper-placement^=\"right\"])': {\n left: `-${borderWidth} /* @noflip */`,\n '--angle': '90deg'\n },\n ':global([data-popper-placement^=\"bottom\"])': {\n top: `-${borderWidth}`,\n '--angle': '180deg'\n },\n ':global([data-popper-placement^=\"left\"])': {\n right: `-${borderWidth} /* @noflip */`,\n '--angle': '270deg'\n }\n };\n}\n/**\n * @internal\n * Creates CSS styles to size the arrow created by createArrowStyles to the given height.\n *\n * Use this when you need to create classes for several different arrow sizes. If you only need a\n * constant arrow size, you can pass the `arrowHeight` param to createArrowStyles instead.\n */\nexport function createArrowHeightStyles(arrowHeight) {\n // The arrow is a square rotated 45 degrees to have its bottom and right edges form a right triangle.\n // Multiply the triangle's height by sqrt(2) to get length of its edges.\n const edgeLength = `${1.414 * arrowHeight}px`;\n return {\n width: edgeLength,\n height: edgeLength\n };\n}\n//# sourceMappingURL=createArrowStyles.js.map"],"names":["createArrowStyles","createArrowHeightStyles","options","arrowHeight","borderWidth","borderStyle","borderColor","tokens","colorTransparentStroke","position","backgroundColor","visibility","zIndex","content","boxSizing","width","height","shorthands","borderRight","borderBottom","borderBottomRightRadius","borderRadiusSmall","transform","bottom","left","top","right","edgeLength"],"mappings":";;;;;;;;;;;IAyBgBA,iBAAiB,MAAjBA;IAoDAC,uBAAuB,MAAvBA;;uBA7EW;4BACJ;AAwBhB,SAASD,kBAAkBE,OAAO,EAAE;IACzC,MAAM,EACJC,YAAW,EACXC,aAAc,MAAK,EACnBC,aAAc,QAAO,EACrBC,aAAcC,kBAAM,CAACC,sBAAsB,CAAA,EAC5C,GAAGN;IACJ,OAAO;QACLO,UAAU;QACVC,iBAAiB;QACjBC,YAAY;QACZC,QAAQ,CAAC;QACT,GAAIT,eAAeF,wBAAwBE,YAAY;QACvD,YAAY;YACVU,SAAS;YACTF,YAAY;YACZF,UAAU;YACVK,WAAW;YACXC,OAAO;YACPC,QAAQ;YACRN,iBAAiB;YACjB,GAAGO,iBAAU,CAACC,WAAW,CAAC,CAAC,EAAEd,YAAY,cAAc,CAAC,EAAE,CAAC,EAAEC,YAAY,cAAc,CAAC,EAAE,CAAC,EAAEC,YAAY,cAAc,CAAC,CAAC;YACzH,GAAGW,iBAAU,CAACE,YAAY,CAACf,aAAaC,aAAaC,YAAY;YACjEc,yBAAyBb,kBAAM,CAACc,iBAAiB;YACjDC,WAAW;QACb;QACA,0FAA0F;QAC1F,2CAA2C;YACzCC,QAAQ,CAAC,CAAC,EAAEnB,YAAY,CAAC;YACzB,WAAW;QACb;QACA,6CAA6C;YAC3CoB,MAAM,CAAC,CAAC,EAAEpB,YAAY,cAAc,CAAC;YACrC,WAAW;QACb;QACA,8CAA8C;YAC5CqB,KAAK,CAAC,CAAC,EAAErB,YAAY,CAAC;YACtB,WAAW;QACb;QACA,4CAA4C;YAC1CsB,OAAO,CAAC,CAAC,EAAEtB,YAAY,cAAc,CAAC;YACtC,WAAW;QACb;IACF;AACF;AAQO,SAASH,wBAAwBE,WAAW,EAAE;IACnD,qGAAqG;IACrG,wEAAwE;IACxE,MAAMwB,aAAa,CAAC,EAAE,QAAQxB,YAAY,EAAE,CAAC;IAC7C,OAAO;QACLY,OAAOY;QACPX,QAAQW;IACV;AACF,EACA,6CAA6C"}
@@ -24,7 +24,7 @@ function createPositionManager(options) {
24
24
  // When the container is first resolved, set position `fixed` to avoid scroll jumps.
25
25
  // Without this scroll jumps can occur when the element is rendered initially and receives focus
26
26
  Object.assign(container.style, {
27
- position: "fixed",
27
+ position: 'fixed',
28
28
  left: 0,
29
29
  top: 0,
30
30
  margin: 0
@@ -41,7 +41,7 @@ function createPositionManager(options) {
41
41
  scrollParents.add((0, _utils.getScrollParent)(target));
42
42
  }
43
43
  scrollParents.forEach((scrollParent)=>{
44
- scrollParent.addEventListener("scroll", updatePosition);
44
+ scrollParent.addEventListener('scroll', updatePosition);
45
45
  });
46
46
  isFirstUpdate = false;
47
47
  }
@@ -70,7 +70,7 @@ function createPositionManager(options) {
70
70
  x,
71
71
  y
72
72
  },
73
- lowPPI: (targetWindow?.devicePixelRatio || 1) <= 1,
73
+ lowPPI: ((targetWindow === null || targetWindow === void 0 ? void 0 : targetWindow.devicePixelRatio) || 1) <= 1,
74
74
  strategy
75
75
  });
76
76
  }).catch((err)=>{
@@ -81,9 +81,9 @@ function createPositionManager(options) {
81
81
  // JSDOM being torn down before this promise is resolved so globals like `window` and `document` don't exist
82
82
  // Unless all tests that ever use `usePositioning` are turned into async tests, any logging during testing
83
83
  // will actually be counter productive
84
- if (process.env.NODE_ENV === "development") {
84
+ if (process.env.NODE_ENV === 'development') {
85
85
  // eslint-disable-next-line no-console
86
- console.error("[usePositioning]: Failed to calculate position", err);
86
+ console.error('[usePositioning]: Failed to calculate position', err);
87
87
  }
88
88
  });
89
89
  };
@@ -91,16 +91,16 @@ function createPositionManager(options) {
91
91
  const dispose = ()=>{
92
92
  isDestroyed = true;
93
93
  if (targetWindow) {
94
- targetWindow.removeEventListener("scroll", updatePosition);
95
- targetWindow.removeEventListener("resize", updatePosition);
94
+ targetWindow.removeEventListener('scroll', updatePosition);
95
+ targetWindow.removeEventListener('resize', updatePosition);
96
96
  }
97
97
  scrollParents.forEach((scrollParent)=>{
98
- scrollParent.removeEventListener("scroll", updatePosition);
98
+ scrollParent.removeEventListener('scroll', updatePosition);
99
99
  });
100
100
  };
101
101
  if (targetWindow) {
102
- targetWindow.addEventListener("scroll", updatePosition);
103
- targetWindow.addEventListener("resize", updatePosition);
102
+ targetWindow.addEventListener('scroll', updatePosition);
103
+ targetWindow.addEventListener('resize', updatePosition);
104
104
  }
105
105
  // Update the position on initialization
106
106
  updatePosition();
@@ -1 +1 @@
1
- {"version":3,"sources":["../lib/createPositionManager.js"],"sourcesContent":["import { computePosition } from \"@floating-ui/dom\";\nimport { debounce, writeArrowUpdates, writeContainerUpdates, getScrollParent } from \"./utils\";\nimport { isHTMLElement } from \"@fluentui/react-utilities\";\n/**\n * @internal\n * @returns manager that handles positioning out of the react lifecycle\n */\nexport function createPositionManager(options) {\n const {\n container,\n target,\n arrow,\n strategy,\n middleware,\n placement\n } = options;\n let isDestroyed = false;\n if (!target || !container) {\n return {\n updatePosition: () => undefined,\n dispose: () => undefined\n };\n }\n let isFirstUpdate = true;\n const scrollParents = new Set();\n const targetWindow = container.ownerDocument.defaultView;\n // When the container is first resolved, set position `fixed` to avoid scroll jumps.\n // Without this scroll jumps can occur when the element is rendered initially and receives focus\n Object.assign(container.style, {\n position: \"fixed\",\n left: 0,\n top: 0,\n margin: 0\n });\n const forceUpdate = () => {\n // debounced update can still occur afterwards\n // early return to avoid memory leaks\n if (isDestroyed) {\n return;\n }\n if (isFirstUpdate) {\n scrollParents.add(getScrollParent(container));\n if (isHTMLElement(target)) {\n scrollParents.add(getScrollParent(target));\n }\n scrollParents.forEach(scrollParent => {\n scrollParent.addEventListener(\"scroll\", updatePosition);\n });\n isFirstUpdate = false;\n }\n Object.assign(container.style, {\n position: strategy\n });\n computePosition(target, container, {\n placement,\n middleware,\n strategy\n }).then(({\n x,\n y,\n middlewareData,\n placement: computedPlacement\n }) => {\n // Promise can still resolve after destruction\n // early return to avoid applying outdated position\n if (isDestroyed) {\n return;\n }\n writeArrowUpdates({\n arrow,\n middlewareData\n });\n writeContainerUpdates({\n container,\n middlewareData,\n placement: computedPlacement,\n coordinates: {\n x,\n y\n },\n lowPPI: (targetWindow?.devicePixelRatio || 1) <= 1,\n strategy\n });\n }).catch(err => {\n // https://github.com/floating-ui/floating-ui/issues/1845\n // FIXME for node > 14\n // node 15 introduces promise rejection which means that any components\n // tests need to be `it('', async () => {})` otherwise there can be race conditions with\n // JSDOM being torn down before this promise is resolved so globals like `window` and `document` don't exist\n // Unless all tests that ever use `usePositioning` are turned into async tests, any logging during testing\n // will actually be counter productive\n if (process.env.NODE_ENV === \"development\") {\n // eslint-disable-next-line no-console\n console.error(\"[usePositioning]: Failed to calculate position\", err);\n }\n });\n };\n const updatePosition = debounce(() => forceUpdate());\n const dispose = () => {\n isDestroyed = true;\n if (targetWindow) {\n targetWindow.removeEventListener(\"scroll\", updatePosition);\n targetWindow.removeEventListener(\"resize\", updatePosition);\n }\n scrollParents.forEach(scrollParent => {\n scrollParent.removeEventListener(\"scroll\", updatePosition);\n });\n };\n if (targetWindow) {\n targetWindow.addEventListener(\"scroll\", updatePosition);\n targetWindow.addEventListener(\"resize\", updatePosition);\n }\n // Update the position on initialization\n updatePosition();\n return {\n updatePosition,\n dispose\n };\n}\n//# sourceMappingURL=createPositionManager.js.map"],"names":["createPositionManager","options","container","target","arrow","strategy","middleware","placement","isDestroyed","updatePosition","undefined","dispose","isFirstUpdate","scrollParents","Set","targetWindow","ownerDocument","defaultView","Object","assign","style","position","left","top","margin","forceUpdate","add","getScrollParent","isHTMLElement","forEach","scrollParent","addEventListener","computePosition","then","x","y","middlewareData","computedPlacement","writeArrowUpdates","writeContainerUpdates","coordinates","lowPPI","devicePixelRatio","catch","err","process","env","NODE_ENV","console","error","debounce","removeEventListener"],"mappings":";;;;+BAOgBA;;aAAAA;;qBAPgB;uBACoD;gCACtD;AAKvB,SAASA,sBAAsBC,OAAO,EAAE;IAC7C,MAAM,EACJC,UAAS,EACTC,OAAM,EACNC,MAAK,EACLC,SAAQ,EACRC,WAAU,EACVC,UAAS,EACV,GAAGN;IACJ,IAAIO,cAAc,KAAK;IACvB,IAAI,CAACL,UAAU,CAACD,WAAW;QACzB,OAAO;YACLO,gBAAgB,IAAMC;YACtBC,SAAS,IAAMD;QACjB;IACF,CAAC;IACD,IAAIE,gBAAgB,IAAI;IACxB,MAAMC,gBAAgB,IAAIC;IAC1B,MAAMC,eAAeb,UAAUc,aAAa,CAACC,WAAW;IACxD,oFAAoF;IACpF,gGAAgG;IAChGC,OAAOC,MAAM,CAACjB,UAAUkB,KAAK,EAAE;QAC7BC,UAAU;QACVC,MAAM;QACNC,KAAK;QACLC,QAAQ;IACV;IACA,MAAMC,cAAc,IAAM;QACxB,8CAA8C;QAC9C,qCAAqC;QACrC,IAAIjB,aAAa;YACf;QACF,CAAC;QACD,IAAII,eAAe;YACjBC,cAAca,GAAG,CAACC,IAAAA,sBAAe,EAACzB;YAClC,IAAI0B,IAAAA,6BAAa,EAACzB,SAAS;gBACzBU,cAAca,GAAG,CAACC,IAAAA,sBAAe,EAACxB;YACpC,CAAC;YACDU,cAAcgB,OAAO,CAACC,CAAAA,eAAgB;gBACpCA,aAAaC,gBAAgB,CAAC,UAAUtB;YAC1C;YACAG,gBAAgB,KAAK;QACvB,CAAC;QACDM,OAAOC,MAAM,CAACjB,UAAUkB,KAAK,EAAE;YAC7BC,UAAUhB;QACZ;QACA2B,IAAAA,oBAAe,EAAC7B,QAAQD,WAAW;YACjCK;YACAD;YACAD;QACF,GAAG4B,IAAI,CAAC,CAAC,EACPC,EAAC,EACDC,EAAC,EACDC,eAAc,EACd7B,WAAW8B,kBAAiB,EAC7B,GAAK;YACJ,8CAA8C;YAC9C,mDAAmD;YACnD,IAAI7B,aAAa;gBACf;YACF,CAAC;YACD8B,IAAAA,wBAAiB,EAAC;gBAChBlC;gBACAgC;YACF;YACAG,IAAAA,4BAAqB,EAAC;gBACpBrC;gBACAkC;gBACA7B,WAAW8B;gBACXG,aAAa;oBACXN;oBACAC;gBACF;gBACAM,QAAQ,AAAC1B,CAAAA,cAAc2B,oBAAoB,CAAA,KAAM;gBACjDrC;YACF;QACF,GAAGsC,KAAK,CAACC,CAAAA,MAAO;YACd,yDAAyD;YACzD,sBAAsB;YACtB,uEAAuE;YACvE,wFAAwF;YACxF,4GAA4G;YAC5G,0GAA0G;YAC1G,sCAAsC;YACtC,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,eAAe;gBAC1C,sCAAsC;gBACtCC,QAAQC,KAAK,CAAC,kDAAkDL;YAClE,CAAC;QACH;IACF;IACA,MAAMnC,iBAAiByC,IAAAA,eAAQ,EAAC,IAAMzB;IACtC,MAAMd,UAAU,IAAM;QACpBH,cAAc,IAAI;QAClB,IAAIO,cAAc;YAChBA,aAAaoC,mBAAmB,CAAC,UAAU1C;YAC3CM,aAAaoC,mBAAmB,CAAC,UAAU1C;QAC7C,CAAC;QACDI,cAAcgB,OAAO,CAACC,CAAAA,eAAgB;YACpCA,aAAaqB,mBAAmB,CAAC,UAAU1C;QAC7C;IACF;IACA,IAAIM,cAAc;QAChBA,aAAagB,gBAAgB,CAAC,UAAUtB;QACxCM,aAAagB,gBAAgB,CAAC,UAAUtB;IAC1C,CAAC;IACD,wCAAwC;IACxCA;IACA,OAAO;QACLA;QACAE;IACF;AACF,EACA,iDAAiD"}
1
+ {"version":3,"sources":["../lib/createPositionManager.js"],"sourcesContent":["import { computePosition } from '@floating-ui/dom';\nimport { debounce, writeArrowUpdates, writeContainerUpdates, getScrollParent } from './utils';\nimport { isHTMLElement } from '@fluentui/react-utilities';\n/**\n * @internal\n * @returns manager that handles positioning out of the react lifecycle\n */\nexport function createPositionManager(options) {\n const {\n container,\n target,\n arrow,\n strategy,\n middleware,\n placement\n } = options;\n let isDestroyed = false;\n if (!target || !container) {\n return {\n updatePosition: () => undefined,\n dispose: () => undefined\n };\n }\n let isFirstUpdate = true;\n const scrollParents = new Set();\n const targetWindow = container.ownerDocument.defaultView;\n // When the container is first resolved, set position `fixed` to avoid scroll jumps.\n // Without this scroll jumps can occur when the element is rendered initially and receives focus\n Object.assign(container.style, {\n position: 'fixed',\n left: 0,\n top: 0,\n margin: 0\n });\n const forceUpdate = () => {\n // debounced update can still occur afterwards\n // early return to avoid memory leaks\n if (isDestroyed) {\n return;\n }\n if (isFirstUpdate) {\n scrollParents.add(getScrollParent(container));\n if (isHTMLElement(target)) {\n scrollParents.add(getScrollParent(target));\n }\n scrollParents.forEach(scrollParent => {\n scrollParent.addEventListener('scroll', updatePosition);\n });\n isFirstUpdate = false;\n }\n Object.assign(container.style, {\n position: strategy\n });\n computePosition(target, container, {\n placement,\n middleware,\n strategy\n }).then(({\n x,\n y,\n middlewareData,\n placement: computedPlacement\n }) => {\n // Promise can still resolve after destruction\n // early return to avoid applying outdated position\n if (isDestroyed) {\n return;\n }\n writeArrowUpdates({\n arrow,\n middlewareData\n });\n writeContainerUpdates({\n container,\n middlewareData,\n placement: computedPlacement,\n coordinates: {\n x,\n y\n },\n lowPPI: ((targetWindow === null || targetWindow === void 0 ? void 0 : targetWindow.devicePixelRatio) || 1) <= 1,\n strategy\n });\n }).catch(err => {\n // https://github.com/floating-ui/floating-ui/issues/1845\n // FIXME for node > 14\n // node 15 introduces promise rejection which means that any components\n // tests need to be `it('', async () => {})` otherwise there can be race conditions with\n // JSDOM being torn down before this promise is resolved so globals like `window` and `document` don't exist\n // Unless all tests that ever use `usePositioning` are turned into async tests, any logging during testing\n // will actually be counter productive\n if (process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.error('[usePositioning]: Failed to calculate position', err);\n }\n });\n };\n const updatePosition = debounce(() => forceUpdate());\n const dispose = () => {\n isDestroyed = true;\n if (targetWindow) {\n targetWindow.removeEventListener('scroll', updatePosition);\n targetWindow.removeEventListener('resize', updatePosition);\n }\n scrollParents.forEach(scrollParent => {\n scrollParent.removeEventListener('scroll', updatePosition);\n });\n };\n if (targetWindow) {\n targetWindow.addEventListener('scroll', updatePosition);\n targetWindow.addEventListener('resize', updatePosition);\n }\n // Update the position on initialization\n updatePosition();\n return {\n updatePosition,\n dispose\n };\n}\n//# sourceMappingURL=createPositionManager.js.map"],"names":["createPositionManager","options","container","target","arrow","strategy","middleware","placement","isDestroyed","updatePosition","undefined","dispose","isFirstUpdate","scrollParents","Set","targetWindow","ownerDocument","defaultView","Object","assign","style","position","left","top","margin","forceUpdate","add","getScrollParent","isHTMLElement","forEach","scrollParent","addEventListener","computePosition","then","x","y","middlewareData","computedPlacement","writeArrowUpdates","writeContainerUpdates","coordinates","lowPPI","devicePixelRatio","catch","err","process","env","NODE_ENV","console","error","debounce","removeEventListener"],"mappings":";;;;+BAOgBA;;aAAAA;;qBAPgB;uBACoD;gCACtD;AAKvB,SAASA,sBAAsBC,OAAO,EAAE;IAC7C,MAAM,EACJC,UAAS,EACTC,OAAM,EACNC,MAAK,EACLC,SAAQ,EACRC,WAAU,EACVC,UAAS,EACV,GAAGN;IACJ,IAAIO,cAAc,KAAK;IACvB,IAAI,CAACL,UAAU,CAACD,WAAW;QACzB,OAAO;YACLO,gBAAgB,IAAMC;YACtBC,SAAS,IAAMD;QACjB;IACF,CAAC;IACD,IAAIE,gBAAgB,IAAI;IACxB,MAAMC,gBAAgB,IAAIC;IAC1B,MAAMC,eAAeb,UAAUc,aAAa,CAACC,WAAW;IACxD,oFAAoF;IACpF,gGAAgG;IAChGC,OAAOC,MAAM,CAACjB,UAAUkB,KAAK,EAAE;QAC7BC,UAAU;QACVC,MAAM;QACNC,KAAK;QACLC,QAAQ;IACV;IACA,MAAMC,cAAc,IAAM;QACxB,8CAA8C;QAC9C,qCAAqC;QACrC,IAAIjB,aAAa;YACf;QACF,CAAC;QACD,IAAII,eAAe;YACjBC,cAAca,GAAG,CAACC,IAAAA,sBAAe,EAACzB;YAClC,IAAI0B,IAAAA,6BAAa,EAACzB,SAAS;gBACzBU,cAAca,GAAG,CAACC,IAAAA,sBAAe,EAACxB;YACpC,CAAC;YACDU,cAAcgB,OAAO,CAACC,CAAAA,eAAgB;gBACpCA,aAAaC,gBAAgB,CAAC,UAAUtB;YAC1C;YACAG,gBAAgB,KAAK;QACvB,CAAC;QACDM,OAAOC,MAAM,CAACjB,UAAUkB,KAAK,EAAE;YAC7BC,UAAUhB;QACZ;QACA2B,IAAAA,oBAAe,EAAC7B,QAAQD,WAAW;YACjCK;YACAD;YACAD;QACF,GAAG4B,IAAI,CAAC,CAAC,EACPC,EAAC,EACDC,EAAC,EACDC,eAAc,EACd7B,WAAW8B,kBAAiB,EAC7B,GAAK;YACJ,8CAA8C;YAC9C,mDAAmD;YACnD,IAAI7B,aAAa;gBACf;YACF,CAAC;YACD8B,IAAAA,wBAAiB,EAAC;gBAChBlC;gBACAgC;YACF;YACAG,IAAAA,4BAAqB,EAAC;gBACpBrC;gBACAkC;gBACA7B,WAAW8B;gBACXG,aAAa;oBACXN;oBACAC;gBACF;gBACAM,QAAQ,AAAC,CAAA,AAAC1B,CAAAA,iBAAiB,IAAI,IAAIA,iBAAiB,KAAK,IAAI,KAAK,IAAIA,aAAa2B,gBAAgB,AAAD,KAAM,CAAA,KAAM;gBAC9GrC;YACF;QACF,GAAGsC,KAAK,CAACC,CAAAA,MAAO;YACd,yDAAyD;YACzD,sBAAsB;YACtB,uEAAuE;YACvE,wFAAwF;YACxF,4GAA4G;YAC5G,0GAA0G;YAC1G,sCAAsC;YACtC,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,eAAe;gBAC1C,sCAAsC;gBACtCC,QAAQC,KAAK,CAAC,kDAAkDL;YAClE,CAAC;QACH;IACF;IACA,MAAMnC,iBAAiByC,IAAAA,eAAQ,EAAC,IAAMzB;IACtC,MAAMd,UAAU,IAAM;QACpBH,cAAc,IAAI;QAClB,IAAIO,cAAc;YAChBA,aAAaoC,mBAAmB,CAAC,UAAU1C;YAC3CM,aAAaoC,mBAAmB,CAAC,UAAU1C;QAC7C,CAAC;QACDI,cAAcgB,OAAO,CAACC,CAAAA,eAAgB;YACpCA,aAAaqB,mBAAmB,CAAC,UAAU1C;QAC7C;IACF;IACA,IAAIM,cAAc;QAChBA,aAAagB,gBAAgB,CAAC,UAAUtB;QACxCM,aAAagB,gBAAgB,CAAC,UAAUtB;IAC1C,CAAC;IACD,wCAAwC;IACxCA;IACA,OAAO;QACLA;QACAE;IACF;AACF,EACA,iDAAiD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { createVirtualElementFromClick } from \"./createVirtualElementFromClick\";\nexport { createArrowHeightStyles, createArrowStyles } from \"./createArrowStyles\";\nexport { usePositioning } from \"./usePositioning\";\nexport { usePositioningMouseTarget } from \"./usePositioningMouseTarget\";\nexport { resolvePositioningShorthand, mergeArrowOffset } from \"./utils/index\";\n//# sourceMappingURL=index.js.map"],"names":["createVirtualElementFromClick","createArrowHeightStyles","createArrowStyles","usePositioning","usePositioningMouseTarget","resolvePositioningShorthand","mergeArrowOffset"],"mappings":";;;;;;;;;;;IAASA,6BAA6B,MAA7BA,4DAA6B;IAC7BC,uBAAuB,MAAvBA,0CAAuB;IAAEC,iBAAiB,MAAjBA,oCAAiB;IAC1CC,cAAc,MAAdA,8BAAc;IACdC,yBAAyB,MAAzBA,oDAAyB;IACzBC,2BAA2B,MAA3BA,kCAA2B;IAAEC,gBAAgB,MAAhBA,uBAAgB;;+CAJR;mCACa;gCAC5B;2CACW;uBACoB;CAC9D,iCAAiC"}
1
+ {"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { createVirtualElementFromClick } from './createVirtualElementFromClick';\nexport { createArrowHeightStyles, createArrowStyles } from './createArrowStyles';\nexport { usePositioning } from './usePositioning';\nexport { usePositioningMouseTarget } from './usePositioningMouseTarget';\nexport { resolvePositioningShorthand, mergeArrowOffset } from './utils/index';\n//# sourceMappingURL=index.js.map"],"names":["createVirtualElementFromClick","createArrowHeightStyles","createArrowStyles","usePositioning","usePositioningMouseTarget","resolvePositioningShorthand","mergeArrowOffset"],"mappings":";;;;;;;;;;;IAASA,6BAA6B,MAA7BA,4DAA6B;IAC7BC,uBAAuB,MAAvBA,0CAAuB;IAAEC,iBAAiB,MAAjBA,oCAAiB;IAC1CC,cAAc,MAAdA,8BAAc;IACdC,yBAAyB,MAAzBA,oDAAyB;IACzBC,2BAA2B,MAA3BA,kCAA2B;IAAEC,gBAAgB,MAAhBA,uBAAgB;;+CAJR;mCACa;gCAC5B;2CACW;uBACoB;CAC9D,iCAAiC"}
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "coverTarget", {
9
9
  const _index = require("../utils/index");
10
10
  function coverTarget() {
11
11
  return {
12
- name: "coverTarget",
12
+ name: 'coverTarget',
13
13
  fn: (middlewareArguments)=>{
14
14
  const { placement , rects , x , y } = middlewareArguments;
15
15
  const basePlacement = (0, _index.parseFloatingUIPlacement)(placement).side;
@@ -18,16 +18,16 @@ function coverTarget() {
18
18
  y
19
19
  };
20
20
  switch(basePlacement){
21
- case "bottom":
21
+ case 'bottom':
22
22
  newCoords.y -= rects.reference.height;
23
23
  break;
24
- case "top":
24
+ case 'top':
25
25
  newCoords.y += rects.reference.height;
26
26
  break;
27
- case "left":
27
+ case 'left':
28
28
  newCoords.x += rects.reference.width;
29
29
  break;
30
- case "right":
30
+ case 'right':
31
31
  newCoords.x -= rects.reference.width;
32
32
  break;
33
33
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/middleware/coverTarget.js"],"sourcesContent":["import { parseFloatingUIPlacement } from \"../utils/index\";\nexport function coverTarget() {\n return {\n name: \"coverTarget\",\n fn: middlewareArguments => {\n const {\n placement,\n rects,\n x,\n y\n } = middlewareArguments;\n const basePlacement = parseFloatingUIPlacement(placement).side;\n const newCoords = {\n x,\n y\n };\n switch (basePlacement) {\n case \"bottom\":\n newCoords.y -= rects.reference.height;\n break;\n case \"top\":\n newCoords.y += rects.reference.height;\n break;\n case \"left\":\n newCoords.x += rects.reference.width;\n break;\n case \"right\":\n newCoords.x -= rects.reference.width;\n break;\n }\n return newCoords;\n }\n };\n}\n//# sourceMappingURL=coverTarget.js.map"],"names":["coverTarget","name","fn","middlewareArguments","placement","rects","x","y","basePlacement","parseFloatingUIPlacement","side","newCoords","reference","height","width"],"mappings":";;;;+BACgBA;;aAAAA;;uBADyB;AAClC,SAASA,cAAc;IAC5B,OAAO;QACLC,MAAM;QACNC,IAAIC,CAAAA,sBAAuB;YACzB,MAAM,EACJC,UAAS,EACTC,MAAK,EACLC,EAAC,EACDC,EAAC,EACF,GAAGJ;YACJ,MAAMK,gBAAgBC,IAAAA,+BAAwB,EAACL,WAAWM,IAAI;YAC9D,MAAMC,YAAY;gBAChBL;gBACAC;YACF;YACA,OAAQC;gBACN,KAAK;oBACHG,UAAUJ,CAAC,IAAIF,MAAMO,SAAS,CAACC,MAAM;oBACrC,KAAM;gBACR,KAAK;oBACHF,UAAUJ,CAAC,IAAIF,MAAMO,SAAS,CAACC,MAAM;oBACrC,KAAM;gBACR,KAAK;oBACHF,UAAUL,CAAC,IAAID,MAAMO,SAAS,CAACE,KAAK;oBACpC,KAAM;gBACR,KAAK;oBACHH,UAAUL,CAAC,IAAID,MAAMO,SAAS,CAACE,KAAK;oBACpC,KAAM;YACV;YACA,OAAOH;QACT;IACF;AACF,EACA,uCAAuC"}
1
+ {"version":3,"sources":["../../lib/middleware/coverTarget.js"],"sourcesContent":["import { parseFloatingUIPlacement } from '../utils/index';\nexport function coverTarget() {\n return {\n name: 'coverTarget',\n fn: middlewareArguments => {\n const {\n placement,\n rects,\n x,\n y\n } = middlewareArguments;\n const basePlacement = parseFloatingUIPlacement(placement).side;\n const newCoords = {\n x,\n y\n };\n switch (basePlacement) {\n case 'bottom':\n newCoords.y -= rects.reference.height;\n break;\n case 'top':\n newCoords.y += rects.reference.height;\n break;\n case 'left':\n newCoords.x += rects.reference.width;\n break;\n case 'right':\n newCoords.x -= rects.reference.width;\n break;\n }\n return newCoords;\n }\n };\n}\n//# sourceMappingURL=coverTarget.js.map"],"names":["coverTarget","name","fn","middlewareArguments","placement","rects","x","y","basePlacement","parseFloatingUIPlacement","side","newCoords","reference","height","width"],"mappings":";;;;+BACgBA;;aAAAA;;uBADyB;AAClC,SAASA,cAAc;IAC5B,OAAO;QACLC,MAAM;QACNC,IAAIC,CAAAA,sBAAuB;YACzB,MAAM,EACJC,UAAS,EACTC,MAAK,EACLC,EAAC,EACDC,EAAC,EACF,GAAGJ;YACJ,MAAMK,gBAAgBC,IAAAA,+BAAwB,EAACL,WAAWM,IAAI;YAC9D,MAAMC,YAAY;gBAChBL;gBACAC;YACF;YACA,OAAQC;gBACN,KAAK;oBACHG,UAAUJ,CAAC,IAAIF,MAAMO,SAAS,CAACC,MAAM;oBACrC,KAAM;gBACR,KAAK;oBACHF,UAAUJ,CAAC,IAAIF,MAAMO,SAAS,CAACC,MAAM;oBACrC,KAAM;gBACR,KAAK;oBACHF,UAAUL,CAAC,IAAID,MAAMO,SAAS,CAACE,KAAK;oBACpC,KAAM;gBACR,KAAK;oBACHH,UAAUL,CAAC,IAAID,MAAMO,SAAS,CAACE,KAAK;oBACpC,KAAM;YACV;YACA,OAAOH;QACT;IACF;AACF,EACA,uCAAuC"}
@@ -20,13 +20,13 @@ function flip(options) {
20
20
  }, []);
21
21
  return (0, _dom.flip)({
22
22
  ...hasScrollableElement && {
23
- boundary: "clippingAncestors"
23
+ boundary: 'clippingAncestors'
24
24
  },
25
25
  ...flipBoundary && {
26
26
  altBoundary: true,
27
27
  boundary: (0, _index.getBoundary)(container, flipBoundary)
28
28
  },
29
- fallbackStrategy: "bestFit",
29
+ fallbackStrategy: 'bestFit',
30
30
  ...fallbackPlacements.length && {
31
31
  fallbackPlacements
32
32
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/middleware/flip.js"],"sourcesContent":["import { flip as baseFlip } from \"@floating-ui/dom\";\nimport { getBoundary, resolvePositioningShorthand, toFloatingUIPlacement } from \"../utils/index\";\nexport function flip(options) {\n const {\n hasScrollableElement,\n flipBoundary,\n container,\n fallbackPositions = [],\n isRtl\n } = options;\n const fallbackPlacements = fallbackPositions.reduce((acc, shorthand) => {\n const {\n position,\n align\n } = resolvePositioningShorthand(shorthand);\n const placement = toFloatingUIPlacement(align, position, isRtl);\n if (placement) {\n acc.push(placement);\n }\n return acc;\n }, []);\n return baseFlip({\n ...(hasScrollableElement && {\n boundary: \"clippingAncestors\"\n }),\n ...(flipBoundary && {\n altBoundary: true,\n boundary: getBoundary(container, flipBoundary)\n }),\n fallbackStrategy: \"bestFit\",\n ...(fallbackPlacements.length && {\n fallbackPlacements\n })\n });\n}\n//# sourceMappingURL=flip.js.map"],"names":["flip","options","hasScrollableElement","flipBoundary","container","fallbackPositions","isRtl","fallbackPlacements","reduce","acc","shorthand","position","align","resolvePositioningShorthand","placement","toFloatingUIPlacement","push","baseFlip","boundary","altBoundary","getBoundary","fallbackStrategy","length"],"mappings":";;;;+BAEgBA;;aAAAA;;qBAFiB;uBAC+C;AACzE,SAASA,KAAKC,OAAO,EAAE;IAC5B,MAAM,EACJC,qBAAoB,EACpBC,aAAY,EACZC,UAAS,EACTC,mBAAoB,EAAE,CAAA,EACtBC,MAAK,EACN,GAAGL;IACJ,MAAMM,qBAAqBF,kBAAkBG,MAAM,CAAC,CAACC,KAAKC,YAAc;QACtE,MAAM,EACJC,SAAQ,EACRC,MAAK,EACN,GAAGC,IAAAA,kCAA2B,EAACH;QAChC,MAAMI,YAAYC,IAAAA,4BAAqB,EAACH,OAAOD,UAAUL;QACzD,IAAIQ,WAAW;YACbL,IAAIO,IAAI,CAACF;QACX,CAAC;QACD,OAAOL;IACT,GAAG,EAAE;IACL,OAAOQ,IAAAA,SAAQ,EAAC;QACd,GAAIf,wBAAwB;YAC1BgB,UAAU;QACZ,CAAC;QACD,GAAIf,gBAAgB;YAClBgB,aAAa,IAAI;YACjBD,UAAUE,IAAAA,kBAAW,EAAChB,WAAWD;QACnC,CAAC;QACDkB,kBAAkB;QAClB,GAAId,mBAAmBe,MAAM,IAAI;YAC/Bf;QACF,CAAC;IACH;AACF,EACA,gCAAgC"}
1
+ {"version":3,"sources":["../../lib/middleware/flip.js"],"sourcesContent":["import { flip as baseFlip } from '@floating-ui/dom';\nimport { getBoundary, resolvePositioningShorthand, toFloatingUIPlacement } from '../utils/index';\nexport function flip(options) {\n const {\n hasScrollableElement,\n flipBoundary,\n container,\n fallbackPositions = [],\n isRtl\n } = options;\n const fallbackPlacements = fallbackPositions.reduce((acc, shorthand) => {\n const {\n position,\n align\n } = resolvePositioningShorthand(shorthand);\n const placement = toFloatingUIPlacement(align, position, isRtl);\n if (placement) {\n acc.push(placement);\n }\n return acc;\n }, []);\n return baseFlip({\n ...(hasScrollableElement && {\n boundary: 'clippingAncestors'\n }),\n ...(flipBoundary && {\n altBoundary: true,\n boundary: getBoundary(container, flipBoundary)\n }),\n fallbackStrategy: 'bestFit',\n ...(fallbackPlacements.length && {\n fallbackPlacements\n })\n });\n}\n//# sourceMappingURL=flip.js.map"],"names":["flip","options","hasScrollableElement","flipBoundary","container","fallbackPositions","isRtl","fallbackPlacements","reduce","acc","shorthand","position","align","resolvePositioningShorthand","placement","toFloatingUIPlacement","push","baseFlip","boundary","altBoundary","getBoundary","fallbackStrategy","length"],"mappings":";;;;+BAEgBA;;aAAAA;;qBAFiB;uBAC+C;AACzE,SAASA,KAAKC,OAAO,EAAE;IAC5B,MAAM,EACJC,qBAAoB,EACpBC,aAAY,EACZC,UAAS,EACTC,mBAAoB,EAAE,CAAA,EACtBC,MAAK,EACN,GAAGL;IACJ,MAAMM,qBAAqBF,kBAAkBG,MAAM,CAAC,CAACC,KAAKC,YAAc;QACtE,MAAM,EACJC,SAAQ,EACRC,MAAK,EACN,GAAGC,IAAAA,kCAA2B,EAACH;QAChC,MAAMI,YAAYC,IAAAA,4BAAqB,EAACH,OAAOD,UAAUL;QACzD,IAAIQ,WAAW;YACbL,IAAIO,IAAI,CAACF;QACX,CAAC;QACD,OAAOL;IACT,GAAG,EAAE;IACL,OAAOQ,IAAAA,SAAQ,EAAC;QACd,GAAIf,wBAAwB;YAC1BgB,UAAU;QACZ,CAAC;QACD,GAAIf,gBAAgB;YAClBgB,aAAa,IAAI;YACjBD,UAAUE,IAAAA,kBAAW,EAAChB,WAAWD;QACnC,CAAC;QACDkB,kBAAkB;QAClB,GAAId,mBAAmBe,MAAM,IAAI;YAC/Bf;QACF,CAAC;IACH;AACF,EACA,gCAAgC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/middleware/index.js"],"sourcesContent":["export * from \"./coverTarget\";\nexport * from \"./flip\";\nexport * from \"./intersecting\";\nexport * from \"./maxSize\";\nexport * from \"./offset\";\nexport * from \"./shift\";\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
1
+ {"version":3,"sources":["../../lib/middleware/index.js"],"sourcesContent":["export * from './coverTarget';\nexport * from './flip';\nexport * from './intersecting';\nexport * from './maxSize';\nexport * from './offset';\nexport * from './shift';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "intersecting", {
9
9
  const _dom = require("@floating-ui/dom");
10
10
  function intersecting() {
11
11
  return {
12
- name: "intersectionObserver",
12
+ name: 'intersectionObserver',
13
13
  fn: async (middlewareArguments)=>{
14
14
  const floatingRect = middlewareArguments.rects.floating;
15
15
  const altOverflow = await (0, _dom.detectOverflow)(middlewareArguments, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/middleware/intersecting.js"],"sourcesContent":["import { detectOverflow } from \"@floating-ui/dom\";\nexport function intersecting() {\n return {\n name: \"intersectionObserver\",\n fn: async middlewareArguments => {\n const floatingRect = middlewareArguments.rects.floating;\n const altOverflow = await detectOverflow(middlewareArguments, {\n altBoundary: true\n });\n const isIntersectingTop = altOverflow.top < floatingRect.height && altOverflow.top > 0;\n const isIntersectingBottom = altOverflow.bottom < floatingRect.height && altOverflow.bottom > 0;\n const isIntersecting = isIntersectingTop || isIntersectingBottom;\n return {\n data: {\n intersecting: isIntersecting\n }\n };\n }\n };\n}\n//# sourceMappingURL=intersecting.js.map"],"names":["intersecting","name","fn","middlewareArguments","floatingRect","rects","floating","altOverflow","detectOverflow","altBoundary","isIntersectingTop","top","height","isIntersectingBottom","bottom","isIntersecting","data"],"mappings":";;;;+BACgBA;;aAAAA;;qBADe;AACxB,SAASA,eAAe;IAC7B,OAAO;QACLC,MAAM;QACNC,IAAI,OAAMC,sBAAuB;YAC/B,MAAMC,eAAeD,oBAAoBE,KAAK,CAACC,QAAQ;YACvD,MAAMC,cAAc,MAAMC,IAAAA,mBAAc,EAACL,qBAAqB;gBAC5DM,aAAa,IAAI;YACnB;YACA,MAAMC,oBAAoBH,YAAYI,GAAG,GAAGP,aAAaQ,MAAM,IAAIL,YAAYI,GAAG,GAAG;YACrF,MAAME,uBAAuBN,YAAYO,MAAM,GAAGV,aAAaQ,MAAM,IAAIL,YAAYO,MAAM,GAAG;YAC9F,MAAMC,iBAAiBL,qBAAqBG;YAC5C,OAAO;gBACLG,MAAM;oBACJhB,cAAce;gBAChB;YACF;QACF;IACF;AACF,EACA,wCAAwC"}
1
+ {"version":3,"sources":["../../lib/middleware/intersecting.js"],"sourcesContent":["import { detectOverflow } from '@floating-ui/dom';\nexport function intersecting() {\n return {\n name: 'intersectionObserver',\n fn: async middlewareArguments => {\n const floatingRect = middlewareArguments.rects.floating;\n const altOverflow = await detectOverflow(middlewareArguments, {\n altBoundary: true\n });\n const isIntersectingTop = altOverflow.top < floatingRect.height && altOverflow.top > 0;\n const isIntersectingBottom = altOverflow.bottom < floatingRect.height && altOverflow.bottom > 0;\n const isIntersecting = isIntersectingTop || isIntersectingBottom;\n return {\n data: {\n intersecting: isIntersecting\n }\n };\n }\n };\n}\n//# sourceMappingURL=intersecting.js.map"],"names":["intersecting","name","fn","middlewareArguments","floatingRect","rects","floating","altOverflow","detectOverflow","altBoundary","isIntersectingTop","top","height","isIntersectingBottom","bottom","isIntersecting","data"],"mappings":";;;;+BACgBA;;aAAAA;;qBADe;AACxB,SAASA,eAAe;IAC7B,OAAO;QACLC,MAAM;QACNC,IAAI,OAAMC,sBAAuB;YAC/B,MAAMC,eAAeD,oBAAoBE,KAAK,CAACC,QAAQ;YACvD,MAAMC,cAAc,MAAMC,IAAAA,mBAAc,EAACL,qBAAqB;gBAC5DM,aAAa,IAAI;YACnB;YACA,MAAMC,oBAAoBH,YAAYI,GAAG,GAAGP,aAAaQ,MAAM,IAAIL,YAAYI,GAAG,GAAG;YACrF,MAAME,uBAAuBN,YAAYO,MAAM,GAAGV,aAAaQ,MAAM,IAAIL,YAAYO,MAAM,GAAG;YAC9F,MAAMC,iBAAiBL,qBAAqBG;YAC5C,OAAO;gBACLG,MAAM;oBACJhB,cAAce;gBAChB;YACF;QACF;IACF;AACF,EACA,wCAAwC"}
@@ -16,20 +16,20 @@ function maxSize(autoSize, options) {
16
16
  boundary: (0, _getBoundary.getBoundary)(container, overflowBoundary)
17
17
  },
18
18
  apply ({ availableHeight , availableWidth , elements , rects }) {
19
- const applyMaxWidth = autoSize === "always" || autoSize === "width-always" || rects.floating.width > availableWidth && (autoSize === true || autoSize === "width");
20
- const applyMaxHeight = autoSize === "always" || autoSize === "height-always" || rects.floating.height > availableHeight && (autoSize === true || autoSize === "height");
19
+ const applyMaxWidth = autoSize === 'always' || autoSize === 'width-always' || rects.floating.width > availableWidth && (autoSize === true || autoSize === 'width');
20
+ const applyMaxHeight = autoSize === 'always' || autoSize === 'height-always' || rects.floating.height > availableHeight && (autoSize === true || autoSize === 'height');
21
21
  if (applyMaxHeight) {
22
22
  Object.assign(elements.floating.style, {
23
23
  maxHeight: `${availableHeight}px`,
24
- boxSizing: "border-box",
25
- overflowY: "auto"
24
+ boxSizing: 'border-box',
25
+ overflowY: 'auto'
26
26
  });
27
27
  }
28
28
  if (applyMaxWidth) {
29
29
  Object.assign(elements.floating.style, {
30
30
  maxWidth: `${availableWidth}px`,
31
- boxSizing: "border-box",
32
- overflowX: "auto"
31
+ boxSizing: 'border-box',
32
+ overflowX: 'auto'
33
33
  });
34
34
  }
35
35
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/middleware/maxSize.js"],"sourcesContent":["import { size } from \"@floating-ui/dom\";\nimport { getBoundary } from \"../utils/getBoundary\";\nexport function maxSize(autoSize, options) {\n const {\n container,\n overflowBoundary\n } = options;\n return size({\n ...(overflowBoundary && {\n altBoundary: true,\n boundary: getBoundary(container, overflowBoundary)\n }),\n apply({\n availableHeight,\n availableWidth,\n elements,\n rects\n }) {\n const applyMaxWidth = autoSize === \"always\" || autoSize === \"width-always\" || rects.floating.width > availableWidth && (autoSize === true || autoSize === \"width\");\n const applyMaxHeight = autoSize === \"always\" || autoSize === \"height-always\" || rects.floating.height > availableHeight && (autoSize === true || autoSize === \"height\");\n if (applyMaxHeight) {\n Object.assign(elements.floating.style, {\n maxHeight: `${availableHeight}px`,\n boxSizing: \"border-box\",\n overflowY: \"auto\"\n });\n }\n if (applyMaxWidth) {\n Object.assign(elements.floating.style, {\n maxWidth: `${availableWidth}px`,\n boxSizing: \"border-box\",\n overflowX: \"auto\"\n });\n }\n }\n });\n}\n//# sourceMappingURL=maxSize.js.map"],"names":["maxSize","autoSize","options","container","overflowBoundary","size","altBoundary","boundary","getBoundary","apply","availableHeight","availableWidth","elements","rects","applyMaxWidth","floating","width","applyMaxHeight","height","Object","assign","style","maxHeight","boxSizing","overflowY","maxWidth","overflowX"],"mappings":";;;;+BAEgBA;;aAAAA;;qBAFK;6BACO;AACrB,SAASA,QAAQC,QAAQ,EAAEC,OAAO,EAAE;IACzC,MAAM,EACJC,UAAS,EACTC,iBAAgB,EACjB,GAAGF;IACJ,OAAOG,IAAAA,SAAI,EAAC;QACV,GAAID,oBAAoB;YACtBE,aAAa,IAAI;YACjBC,UAAUC,IAAAA,wBAAW,EAACL,WAAWC;QACnC,CAAC;QACDK,OAAM,EACJC,gBAAe,EACfC,eAAc,EACdC,SAAQ,EACRC,MAAK,EACN,EAAE;YACD,MAAMC,gBAAgBb,aAAa,YAAYA,aAAa,kBAAkBY,MAAME,QAAQ,CAACC,KAAK,GAAGL,kBAAmBV,CAAAA,aAAa,IAAI,IAAIA,aAAa,OAAM;YAChK,MAAMgB,iBAAiBhB,aAAa,YAAYA,aAAa,mBAAmBY,MAAME,QAAQ,CAACG,MAAM,GAAGR,mBAAoBT,CAAAA,aAAa,IAAI,IAAIA,aAAa,QAAO;YACrK,IAAIgB,gBAAgB;gBAClBE,OAAOC,MAAM,CAACR,SAASG,QAAQ,CAACM,KAAK,EAAE;oBACrCC,WAAW,CAAC,EAAEZ,gBAAgB,EAAE,CAAC;oBACjCa,WAAW;oBACXC,WAAW;gBACb;YACF,CAAC;YACD,IAAIV,eAAe;gBACjBK,OAAOC,MAAM,CAACR,SAASG,QAAQ,CAACM,KAAK,EAAE;oBACrCI,UAAU,CAAC,EAAEd,eAAe,EAAE,CAAC;oBAC/BY,WAAW;oBACXG,WAAW;gBACb;YACF,CAAC;QACH;IACF;AACF,EACA,mCAAmC"}
1
+ {"version":3,"sources":["../../lib/middleware/maxSize.js"],"sourcesContent":["import { size } from '@floating-ui/dom';\nimport { getBoundary } from '../utils/getBoundary';\nexport function maxSize(autoSize, options) {\n const {\n container,\n overflowBoundary\n } = options;\n return size({\n ...(overflowBoundary && {\n altBoundary: true,\n boundary: getBoundary(container, overflowBoundary)\n }),\n apply({\n availableHeight,\n availableWidth,\n elements,\n rects\n }) {\n const applyMaxWidth = autoSize === 'always' || autoSize === 'width-always' || rects.floating.width > availableWidth && (autoSize === true || autoSize === 'width');\n const applyMaxHeight = autoSize === 'always' || autoSize === 'height-always' || rects.floating.height > availableHeight && (autoSize === true || autoSize === 'height');\n if (applyMaxHeight) {\n Object.assign(elements.floating.style, {\n maxHeight: `${availableHeight}px`,\n boxSizing: 'border-box',\n overflowY: 'auto'\n });\n }\n if (applyMaxWidth) {\n Object.assign(elements.floating.style, {\n maxWidth: `${availableWidth}px`,\n boxSizing: 'border-box',\n overflowX: 'auto'\n });\n }\n }\n });\n}\n//# sourceMappingURL=maxSize.js.map"],"names":["maxSize","autoSize","options","container","overflowBoundary","size","altBoundary","boundary","getBoundary","apply","availableHeight","availableWidth","elements","rects","applyMaxWidth","floating","width","applyMaxHeight","height","Object","assign","style","maxHeight","boxSizing","overflowY","maxWidth","overflowX"],"mappings":";;;;+BAEgBA;;aAAAA;;qBAFK;6BACO;AACrB,SAASA,QAAQC,QAAQ,EAAEC,OAAO,EAAE;IACzC,MAAM,EACJC,UAAS,EACTC,iBAAgB,EACjB,GAAGF;IACJ,OAAOG,IAAAA,SAAI,EAAC;QACV,GAAID,oBAAoB;YACtBE,aAAa,IAAI;YACjBC,UAAUC,IAAAA,wBAAW,EAACL,WAAWC;QACnC,CAAC;QACDK,OAAM,EACJC,gBAAe,EACfC,eAAc,EACdC,SAAQ,EACRC,MAAK,EACN,EAAE;YACD,MAAMC,gBAAgBb,aAAa,YAAYA,aAAa,kBAAkBY,MAAME,QAAQ,CAACC,KAAK,GAAGL,kBAAmBV,CAAAA,aAAa,IAAI,IAAIA,aAAa,OAAM;YAChK,MAAMgB,iBAAiBhB,aAAa,YAAYA,aAAa,mBAAmBY,MAAME,QAAQ,CAACG,MAAM,GAAGR,mBAAoBT,CAAAA,aAAa,IAAI,IAAIA,aAAa,QAAO;YACrK,IAAIgB,gBAAgB;gBAClBE,OAAOC,MAAM,CAACR,SAASG,QAAQ,CAACM,KAAK,EAAE;oBACrCC,WAAW,CAAC,EAAEZ,gBAAgB,EAAE,CAAC;oBACjCa,WAAW;oBACXC,WAAW;gBACb;YACF,CAAC;YACD,IAAIV,eAAe;gBACjBK,OAAOC,MAAM,CAACR,SAASG,QAAQ,CAACM,KAAK,EAAE;oBACrCI,UAAU,CAAC,EAAEd,eAAe,EAAE,CAAC;oBAC/BY,WAAW;oBACXG,WAAW;gBACb;YACF,CAAC;QACH;IACF;AACF,EACA,mCAAmC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/middleware/offset.js"],"sourcesContent":["import { offset as baseOffset } from \"@floating-ui/dom\";\nimport { getFloatingUIOffset } from \"../utils/getFloatingUIOffset\";\n/**\n * Wraps floating UI offset middleware to to transform offset value\n */\nexport function offset(offsetValue) {\n const floatingUIOffset = getFloatingUIOffset(offsetValue);\n return baseOffset(floatingUIOffset);\n}\n//# sourceMappingURL=offset.js.map"],"names":["offset","offsetValue","floatingUIOffset","getFloatingUIOffset","baseOffset"],"mappings":";;;;+BAKgBA;;aAAAA;;qBALqB;qCACD;AAI7B,SAASA,OAAOC,WAAW,EAAE;IAClC,MAAMC,mBAAmBC,IAAAA,wCAAmB,EAACF;IAC7C,OAAOG,IAAAA,WAAU,EAACF;AACpB,EACA,kCAAkC"}
1
+ {"version":3,"sources":["../../lib/middleware/offset.js"],"sourcesContent":["import { offset as baseOffset } from '@floating-ui/dom';\nimport { getFloatingUIOffset } from '../utils/getFloatingUIOffset';\n/**\n * Wraps floating UI offset middleware to to transform offset value\n */\nexport function offset(offsetValue) {\n const floatingUIOffset = getFloatingUIOffset(offsetValue);\n return baseOffset(floatingUIOffset);\n}\n//# sourceMappingURL=offset.js.map"],"names":["offset","offsetValue","floatingUIOffset","getFloatingUIOffset","baseOffset"],"mappings":";;;;+BAKgBA;;aAAAA;;qBALqB;qCACD;AAI7B,SAASA,OAAOC,WAAW,EAAE;IAClC,MAAMC,mBAAmBC,IAAAA,wCAAmB,EAACF;IAC7C,OAAOG,IAAAA,WAAU,EAACF;AACpB,EACA,kCAAkC"}
@@ -12,12 +12,12 @@ function shift(options) {
12
12
  const { hasScrollableElement , disableTether , overflowBoundary , container , overflowBoundaryPadding , isRtl } = options;
13
13
  return (0, _dom.shift)({
14
14
  ...hasScrollableElement && {
15
- boundary: "clippingAncestors"
15
+ boundary: 'clippingAncestors'
16
16
  },
17
17
  ...disableTether && {
18
- crossAxis: disableTether === "all",
18
+ crossAxis: disableTether === 'all',
19
19
  limiter: (0, _dom.limitShift)({
20
- crossAxis: disableTether !== "all",
20
+ crossAxis: disableTether !== 'all',
21
21
  mainAxis: false
22
22
  })
23
23
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/middleware/shift.js"],"sourcesContent":["import { shift as baseShift, limitShift } from \"@floating-ui/dom\";\nimport { getBoundary, toFloatingUIPadding } from \"../utils/index\";\n/**\n * Wraps the floating UI shift middleware for easier usage of our options\n */\nexport function shift(options) {\n const {\n hasScrollableElement,\n disableTether,\n overflowBoundary,\n container,\n overflowBoundaryPadding,\n isRtl\n } = options;\n return baseShift({\n ...(hasScrollableElement && {\n boundary: \"clippingAncestors\"\n }),\n ...(disableTether && {\n crossAxis: disableTether === \"all\",\n limiter: limitShift({\n crossAxis: disableTether !== \"all\",\n mainAxis: false\n })\n }),\n ...(overflowBoundaryPadding && {\n padding: toFloatingUIPadding(overflowBoundaryPadding, isRtl)\n }),\n ...(overflowBoundary && {\n altBoundary: true,\n boundary: getBoundary(container, overflowBoundary)\n })\n });\n}\n//# sourceMappingURL=shift.js.map"],"names":["shift","options","hasScrollableElement","disableTether","overflowBoundary","container","overflowBoundaryPadding","isRtl","baseShift","boundary","crossAxis","limiter","limitShift","mainAxis","padding","toFloatingUIPadding","altBoundary","getBoundary"],"mappings":";;;;+BAKgBA;;aAAAA;;qBAL+B;uBACE;AAI1C,SAASA,MAAMC,OAAO,EAAE;IAC7B,MAAM,EACJC,qBAAoB,EACpBC,cAAa,EACbC,iBAAgB,EAChBC,UAAS,EACTC,wBAAuB,EACvBC,MAAK,EACN,GAAGN;IACJ,OAAOO,IAAAA,UAAS,EAAC;QACf,GAAIN,wBAAwB;YAC1BO,UAAU;QACZ,CAAC;QACD,GAAIN,iBAAiB;YACnBO,WAAWP,kBAAkB;YAC7BQ,SAASC,IAAAA,eAAU,EAAC;gBAClBF,WAAWP,kBAAkB;gBAC7BU,UAAU,KAAK;YACjB;QACF,CAAC;QACD,GAAIP,2BAA2B;YAC7BQ,SAASC,IAAAA,0BAAmB,EAACT,yBAAyBC;QACxD,CAAC;QACD,GAAIH,oBAAoB;YACtBY,aAAa,IAAI;YACjBP,UAAUQ,IAAAA,kBAAW,EAACZ,WAAWD;QACnC,CAAC;IACH;AACF,EACA,iCAAiC"}
1
+ {"version":3,"sources":["../../lib/middleware/shift.js"],"sourcesContent":["import { shift as baseShift, limitShift } from '@floating-ui/dom';\nimport { getBoundary, toFloatingUIPadding } from '../utils/index';\n/**\n * Wraps the floating UI shift middleware for easier usage of our options\n */\nexport function shift(options) {\n const {\n hasScrollableElement,\n disableTether,\n overflowBoundary,\n container,\n overflowBoundaryPadding,\n isRtl\n } = options;\n return baseShift({\n ...(hasScrollableElement && {\n boundary: 'clippingAncestors'\n }),\n ...(disableTether && {\n crossAxis: disableTether === 'all',\n limiter: limitShift({\n crossAxis: disableTether !== 'all',\n mainAxis: false\n })\n }),\n ...(overflowBoundaryPadding && {\n padding: toFloatingUIPadding(overflowBoundaryPadding, isRtl)\n }),\n ...(overflowBoundary && {\n altBoundary: true,\n boundary: getBoundary(container, overflowBoundary)\n })\n });\n}\n//# sourceMappingURL=shift.js.map"],"names":["shift","options","hasScrollableElement","disableTether","overflowBoundary","container","overflowBoundaryPadding","isRtl","baseShift","boundary","crossAxis","limiter","limitShift","mainAxis","padding","toFloatingUIPadding","altBoundary","getBoundary"],"mappings":";;;;+BAKgBA;;aAAAA;;qBAL+B;uBACE;AAI1C,SAASA,MAAMC,OAAO,EAAE;IAC7B,MAAM,EACJC,qBAAoB,EACpBC,cAAa,EACbC,iBAAgB,EAChBC,UAAS,EACTC,wBAAuB,EACvBC,MAAK,EACN,GAAGN;IACJ,OAAOO,IAAAA,UAAS,EAAC;QACf,GAAIN,wBAAwB;YAC1BO,UAAU;QACZ,CAAC;QACD,GAAIN,iBAAiB;YACnBO,WAAWP,kBAAkB;YAC7BQ,SAASC,IAAAA,eAAU,EAAC;gBAClBF,WAAWP,kBAAkB;gBAC7BU,UAAU,KAAK;YACjB;QACF,CAAC;QACD,GAAIP,2BAA2B;YAC7BQ,SAASC,IAAAA,0BAAmB,EAACT,yBAAyBC;QACxD,CAAC;QACD,GAAIH,oBAAoB;YACtBY,aAAa,IAAI;YACjBP,UAAUQ,IAAAA,kBAAW,EAACZ,WAAWD;QACnC,CAAC;IACH;AACF,EACA,iCAAiC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../lib/types.js"],"sourcesContent":["import * as React from \"react\";\n//# sourceMappingURL=types.js.map"],"names":[],"mappings":";;;;;6DAAuB;CACvB,iCAAiC"}
1
+ {"version":3,"sources":["../lib/types.js"],"sourcesContent":["import * as React from 'react';\n//# sourceMappingURL=types.js.map"],"names":[],"mappings":";;;;;6DAAuB;CACvB,iCAAiC"}