@fluentui/react-positioning 9.4.3 → 9.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. package/CHANGELOG.json +51 -1
  2. package/CHANGELOG.md +22 -2
  3. package/dist/index.d.ts +7 -2
  4. package/lib/createArrowStyles.js.map +1 -1
  5. package/lib/createPositionManager.js.map +1 -1
  6. package/lib/createVirtualElementFromClick.js.map +1 -1
  7. package/lib/middleware/coverTarget.js.map +1 -1
  8. package/lib/middleware/flip.js +19 -3
  9. package/lib/middleware/flip.js.map +1 -1
  10. package/lib/middleware/intersecting.js.map +1 -1
  11. package/lib/middleware/maxSize.js +4 -2
  12. package/lib/middleware/maxSize.js.map +1 -1
  13. package/lib/middleware/offset.js.map +1 -1
  14. package/lib/middleware/shift.js.map +1 -1
  15. package/lib/types.js.map +1 -1
  16. package/lib/usePositioning.js +6 -3
  17. package/lib/usePositioning.js.map +1 -1
  18. package/lib/usePositioningMouseTarget.js.map +1 -1
  19. package/lib/utils/debounce.js.map +1 -1
  20. package/lib/utils/fromFloatingUIPlacement.js.map +1 -1
  21. package/lib/utils/getBoundary.js.map +1 -1
  22. package/lib/utils/getFloatingUIOffset.js.map +1 -1
  23. package/lib/utils/getReactFiberFromNode.js.map +1 -1
  24. package/lib/utils/getScrollParent.js.map +1 -1
  25. package/lib/utils/hasAutoFocusFilter.js.map +1 -1
  26. package/lib/utils/mergeArrowOffset.js.map +1 -1
  27. package/lib/utils/parseFloatingUIPlacement.js.map +1 -1
  28. package/lib/utils/resolvePositioningShorthand.js.map +1 -1
  29. package/lib/utils/toFloatingUIPadding.js.map +1 -1
  30. package/lib/utils/toFloatingUIPlacement.js.map +1 -1
  31. package/lib/utils/toggleScrollListener.js.map +1 -1
  32. package/lib/utils/useCallbackRef.js.map +1 -1
  33. package/lib/utils/writeArrowUpdates.js.map +1 -1
  34. package/lib/utils/writeContainerupdates.js.map +1 -1
  35. package/lib-amd/middleware/flip.js +10 -2
  36. package/lib-amd/middleware/flip.js.map +1 -1
  37. package/lib-amd/middleware/maxSize.js +2 -0
  38. package/lib-amd/middleware/maxSize.js.map +1 -1
  39. package/lib-amd/types.js.map +1 -1
  40. package/lib-amd/usePositioning.js +3 -2
  41. package/lib-amd/usePositioning.js.map +1 -1
  42. package/lib-amd/utils/getScrollParent.js.map +1 -1
  43. package/lib-commonjs/constants.js.map +1 -1
  44. package/lib-commonjs/createArrowStyles.js.map +1 -1
  45. package/lib-commonjs/createPositionManager.js.map +1 -1
  46. package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
  47. package/lib-commonjs/index.js.map +1 -1
  48. package/lib-commonjs/middleware/coverTarget.js.map +1 -1
  49. package/lib-commonjs/middleware/flip.js +18 -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.map +1 -1
  53. package/lib-commonjs/middleware/maxSize.js +4 -2
  54. package/lib-commonjs/middleware/maxSize.js.map +1 -1
  55. package/lib-commonjs/middleware/offset.js.map +1 -1
  56. package/lib-commonjs/middleware/shift.js.map +1 -1
  57. package/lib-commonjs/types.js.map +1 -1
  58. package/lib-commonjs/usePositioning.js +6 -3
  59. package/lib-commonjs/usePositioning.js.map +1 -1
  60. package/lib-commonjs/usePositioningMouseTarget.js.map +1 -1
  61. package/lib-commonjs/utils/debounce.js.map +1 -1
  62. package/lib-commonjs/utils/fromFloatingUIPlacement.js.map +1 -1
  63. package/lib-commonjs/utils/getBoundary.js.map +1 -1
  64. package/lib-commonjs/utils/getFloatingUIOffset.js.map +1 -1
  65. package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
  66. package/lib-commonjs/utils/getScrollParent.js.map +1 -1
  67. package/lib-commonjs/utils/hasAutoFocusFilter.js.map +1 -1
  68. package/lib-commonjs/utils/index.js.map +1 -1
  69. package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
  70. package/lib-commonjs/utils/parseFloatingUIPlacement.js.map +1 -1
  71. package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
  72. package/lib-commonjs/utils/toFloatingUIPadding.js.map +1 -1
  73. package/lib-commonjs/utils/toFloatingUIPlacement.js.map +1 -1
  74. package/lib-commonjs/utils/toggleScrollListener.js.map +1 -1
  75. package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
  76. package/lib-commonjs/utils/writeArrowUpdates.js.map +1 -1
  77. package/lib-commonjs/utils/writeContainerupdates.js.map +1 -1
  78. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AACA;AAEA,SAAgBA,WAAW;EACzB,OAAO;IACLC,IAAI,EAAE,aAAa;IACnBC,EAAE,EAAEC,mBAAmB,IAAG;MACxB,MAAM;QAAEC,SAAS;QAAEC,KAAK;QAAEC,CAAC;QAAEC;MAAC,CAAE,GAAGJ,mBAAmB;MACtD,MAAMK,aAAa,GAAGC,gCAAwB,CAACL,SAAS,CAAC,CAACM,IAAI;MAC9D,MAAMC,SAAS,GAAG;QAAEL,CAAC;QAAEC;MAAC,CAAE;MAE1B,QAAQC,aAAa;QACnB,KAAK,QAAQ;UACXG,SAAS,CAACJ,CAAC,IAAIF,KAAK,CAACO,SAAS,CAACC,MAAM;UACrC;QACF,KAAK,KAAK;UACRF,SAAS,CAACJ,CAAC,IAAIF,KAAK,CAACO,SAAS,CAACC,MAAM;UACrC;QACF,KAAK,MAAM;UACTF,SAAS,CAACL,CAAC,IAAID,KAAK,CAACO,SAAS,CAACE,KAAK;UACpC;QACF,KAAK,OAAO;UACVH,SAAS,CAACL,CAAC,IAAID,KAAK,CAACO,SAAS,CAACE,KAAK;UACpC;MAAM;MAGV,OAAOH,SAAS;IAClB;GACD;AACH;AA1BAI","names":["coverTarget","name","fn","middlewareArguments","placement","rects","x","y","basePlacement","index_1","side","newCoords","reference","height","width","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/middleware/coverTarget.ts"],"sourcesContent":["import type { Middleware } from '@floating-ui/dom';\nimport { parseFloatingUIPlacement } from '../utils/index';\n\nexport function coverTarget(): Middleware {\n return {\n name: 'coverTarget',\n fn: middlewareArguments => {\n const { placement, rects, x, y } = middlewareArguments;\n const basePlacement = parseFloatingUIPlacement(placement).side;\n const newCoords = { x, 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\n return newCoords;\n },\n };\n}\n"]}
1
+ {"version":3,"names":["index_1","require","coverTarget","name","fn","middlewareArguments","placement","rects","x","y","basePlacement","parseFloatingUIPlacement","side","newCoords","reference","height","width","exports"],"sources":["../src/packages/react-components/react-positioning/src/middleware/coverTarget.ts"],"sourcesContent":["import type { Middleware } from '@floating-ui/dom';\nimport { parseFloatingUIPlacement } from '../utils/index';\n\nexport function coverTarget(): Middleware {\n return {\n name: 'coverTarget',\n fn: middlewareArguments => {\n const { placement, rects, x, y } = middlewareArguments;\n const basePlacement = parseFloatingUIPlacement(placement).side;\n const newCoords = { x, 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\n return newCoords;\n },\n };\n}\n"],"mappings":";;;;;;AACA,MAAAA,OAAA,gBAAAC,OAAA;AAEA,SAAgBC,WAAWA,CAAA;EACzB,OAAO;IACLC,IAAI,EAAE,aAAa;IACnBC,EAAE,EAAEC,mBAAmB,IAAG;MACxB,MAAM;QAAEC,SAAS;QAAEC,KAAK;QAAEC,CAAC;QAAEC;MAAC,CAAE,GAAGJ,mBAAmB;MACtD,MAAMK,aAAa,GAAGV,OAAA,CAAAW,wBAAwB,CAACL,SAAS,CAAC,CAACM,IAAI;MAC9D,MAAMC,SAAS,GAAG;QAAEL,CAAC;QAAEC;MAAC,CAAE;MAE1B,QAAQC,aAAa;QACnB,KAAK,QAAQ;UACXG,SAAS,CAACJ,CAAC,IAAIF,KAAK,CAACO,SAAS,CAACC,MAAM;UACrC;QACF,KAAK,KAAK;UACRF,SAAS,CAACJ,CAAC,IAAIF,KAAK,CAACO,SAAS,CAACC,MAAM;UACrC;QACF,KAAK,MAAM;UACTF,SAAS,CAACL,CAAC,IAAID,KAAK,CAACO,SAAS,CAACE,KAAK;UACpC;QACF,KAAK,OAAO;UACVH,SAAS,CAACL,CAAC,IAAID,KAAK,CAACO,SAAS,CAACE,KAAK;UACpC;MAAM;MAGV,OAAOH,SAAS;IAClB;GACD;AACH;AA1BAI,OAAA,CAAAf,WAAA,GAAAA,WAAA"}
@@ -10,8 +10,21 @@ function flip(options) {
10
10
  const {
11
11
  hasScrollableElement,
12
12
  flipBoundary,
13
- container
13
+ container,
14
+ fallbackPositions = [],
15
+ isRtl
14
16
  } = options;
17
+ const fallbackPlacements = fallbackPositions.reduce((acc, shorthand) => {
18
+ const {
19
+ position,
20
+ align
21
+ } = index_1.resolvePositioningShorthand(shorthand);
22
+ const placement = index_1.toFloatingUIPlacement(align, position, isRtl);
23
+ if (placement) {
24
+ acc.push(placement);
25
+ }
26
+ return acc;
27
+ }, []);
15
28
  return dom_1.flip({
16
29
  ...(hasScrollableElement && {
17
30
  boundary: 'clippingAncestors'
@@ -20,7 +33,10 @@ function flip(options) {
20
33
  altBoundary: true,
21
34
  boundary: index_1.getBoundary(container, flipBoundary)
22
35
  }),
23
- fallbackStrategy: 'bestFit'
36
+ fallbackStrategy: 'bestFit',
37
+ ...(fallbackPlacements.length && {
38
+ fallbackPlacements
39
+ })
24
40
  });
25
41
  }
26
42
  exports.flip = flip;
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AAEA;AAOA,SAAgBA,IAAI,CAACC,OAA8B;EACjD,MAAM;IAAEC,oBAAoB;IAAEC,YAAY;IAAEC;EAAS,CAAE,GAAGH,OAAO;EAEjE,OAAOI,UAAQ,CAAC;IACd,IAAIH,oBAAoB,IAAI;MAAEI,QAAQ,EAAE;IAAmB,CAAE,CAAC;IAC9D,IAAIH,YAAY,IAAI;MAAEI,WAAW,EAAE,IAAI;MAAED,QAAQ,EAAEE,mBAAW,CAACJ,SAAS,EAAED,YAAY;IAAC,CAAE,CAAC;IAC1FM,gBAAgB,EAAE;GACnB,CAAC;AACJ;AARAC","names":["flip","options","hasScrollableElement","flipBoundary","container","dom_1","boundary","altBoundary","index_1","fallbackStrategy","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/middleware/flip.ts"],"sourcesContent":["import { flip as baseFlip } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary } from '../utils/index';\n\nexport interface FlipMiddlewareOptions extends Pick<PositioningOptions, 'flipBoundary'> {\n hasScrollableElement?: boolean;\n container: HTMLElement | null;\n}\n\nexport function flip(options: FlipMiddlewareOptions) {\n const { hasScrollableElement, flipBoundary, container } = options;\n\n return baseFlip({\n ...(hasScrollableElement && { boundary: 'clippingAncestors' }),\n ...(flipBoundary && { altBoundary: true, boundary: getBoundary(container, flipBoundary) }),\n fallbackStrategy: 'bestFit',\n });\n}\n"]}
1
+ {"version":3,"names":["dom_1","require","index_1","flip","options","hasScrollableElement","flipBoundary","container","fallbackPositions","isRtl","fallbackPlacements","reduce","acc","shorthand","position","align","resolvePositioningShorthand","placement","toFloatingUIPlacement","push","boundary","altBoundary","getBoundary","fallbackStrategy","length","exports"],"sources":["../src/packages/react-components/react-positioning/src/middleware/flip.ts"],"sourcesContent":["import { flip as baseFlip, Placement } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary, resolvePositioningShorthand, toFloatingUIPlacement } from '../utils/index';\n\nexport interface FlipMiddlewareOptions extends Pick<PositioningOptions, 'flipBoundary' | 'fallbackPositions'> {\n hasScrollableElement?: boolean;\n container: HTMLElement | null;\n isRtl?: boolean;\n}\n\nexport function flip(options: FlipMiddlewareOptions) {\n const { hasScrollableElement, flipBoundary, container, fallbackPositions = [], isRtl } = options;\n\n const fallbackPlacements = fallbackPositions.reduce<Placement[]>((acc, shorthand) => {\n const { position, align } = resolvePositioningShorthand(shorthand);\n const placement = toFloatingUIPlacement(align, position, isRtl);\n if (placement) {\n acc.push(placement);\n }\n return acc;\n }, []);\n\n return baseFlip({\n ...(hasScrollableElement && { boundary: 'clippingAncestors' }),\n ...(flipBoundary && { altBoundary: true, boundary: getBoundary(container, flipBoundary) }),\n fallbackStrategy: 'bestFit',\n ...(fallbackPlacements.length && { fallbackPlacements }),\n });\n}\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AAEA,MAAAC,OAAA,gBAAAD,OAAA;AAQA,SAAgBE,IAAIA,CAACC,OAA8B;EACjD,MAAM;IAAEC,oBAAoB;IAAEC,YAAY;IAAEC,SAAS;IAAEC,iBAAiB,GAAG,EAAE;IAAEC;EAAK,CAAE,GAAGL,OAAO;EAEhG,MAAMM,kBAAkB,GAAGF,iBAAiB,CAACG,MAAM,CAAc,CAACC,GAAG,EAAEC,SAAS,KAAI;IAClF,MAAM;MAAEC,QAAQ;MAAEC;IAAK,CAAE,GAAGb,OAAA,CAAAc,2BAA2B,CAACH,SAAS,CAAC;IAClE,MAAMI,SAAS,GAAGf,OAAA,CAAAgB,qBAAqB,CAACH,KAAK,EAAED,QAAQ,EAAEL,KAAK,CAAC;IAC/D,IAAIQ,SAAS,EAAE;MACbL,GAAG,CAACO,IAAI,CAACF,SAAS,CAAC;;IAErB,OAAOL,GAAG;EACZ,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOZ,KAAA,CAAAG,IAAQ,CAAC;IACd,IAAIE,oBAAoB,IAAI;MAAEe,QAAQ,EAAE;IAAmB,CAAE,CAAC;IAC9D,IAAId,YAAY,IAAI;MAAEe,WAAW,EAAE,IAAI;MAAED,QAAQ,EAAElB,OAAA,CAAAoB,WAAW,CAACf,SAAS,EAAED,YAAY;IAAC,CAAE,CAAC;IAC1FiB,gBAAgB,EAAE,SAAS;IAC3B,IAAIb,kBAAkB,CAACc,MAAM,IAAI;MAAEd;IAAkB,CAAE;GACxD,CAAC;AACJ;AAlBAe,OAAA,CAAAtB,IAAA,GAAAA,IAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAAA;AACAA;AACAA;AACAA;AACAA;AACAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/middleware/index.ts"],"sourcesContent":["export * from './coverTarget';\nexport * from './flip';\nexport * from './intersecting';\nexport * from './maxSize';\nexport * from './offset';\nexport * from './shift';\n"]}
1
+ {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-positioning/src/middleware/index.ts"],"sourcesContent":["export * from './coverTarget';\nexport * from './flip';\nexport * from './intersecting';\nexport * from './maxSize';\nexport * from './offset';\nexport * from './shift';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,mBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,YAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,oBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,eAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,cAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,aAAAC,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AACA;AAEA,SAAgBA,YAAY;EAC1B,OAAO;IACLC,IAAI,EAAE,sBAAsB;IAC5BC,EAAE,EAAE,MAAMC,mBAAmB,IAAG;MAC9B,MAAMC,YAAY,GAAGD,mBAAmB,CAACE,KAAK,CAACC,QAAQ;MACvD,MAAMC,WAAW,GAAG,MAAMC,oBAAc,CAACL,mBAAmB,EAAE;QAAEM,WAAW,EAAE;MAAI,CAAE,CAAC;MAEpF,MAAMC,iBAAiB,GAAGH,WAAW,CAACI,GAAG,GAAGP,YAAY,CAACQ,MAAM,IAAIL,WAAW,CAACI,GAAG,GAAG,CAAC;MACtF,MAAME,oBAAoB,GAAGN,WAAW,CAACO,MAAM,GAAGV,YAAY,CAACQ,MAAM,IAAIL,WAAW,CAACO,MAAM,GAAG,CAAC;MAE/F,MAAMC,cAAc,GAAGL,iBAAiB,IAAIG,oBAAoB;MAEhE,OAAO;QACLG,IAAI,EAAE;UACJhB,YAAY,EAAEe;;OAEjB;IACH;GACD;AACH;AAnBAE","names":["intersecting","name","fn","middlewareArguments","floatingRect","rects","floating","altOverflow","dom_1","altBoundary","isIntersectingTop","top","height","isIntersectingBottom","bottom","isIntersecting","data","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/middleware/intersecting.ts"],"sourcesContent":["import type { Middleware } from '@floating-ui/dom';\nimport { detectOverflow } from '@floating-ui/dom';\n\nexport function intersecting(): Middleware {\n return {\n name: 'intersectionObserver',\n fn: async middlewareArguments => {\n const floatingRect = middlewareArguments.rects.floating;\n const altOverflow = await detectOverflow(middlewareArguments, { altBoundary: true });\n\n const isIntersectingTop = altOverflow.top < floatingRect.height && altOverflow.top > 0;\n const isIntersectingBottom = altOverflow.bottom < floatingRect.height && altOverflow.bottom > 0;\n\n const isIntersecting = isIntersectingTop || isIntersectingBottom;\n\n return {\n data: {\n intersecting: isIntersecting,\n },\n };\n },\n };\n}\n"]}
1
+ {"version":3,"names":["dom_1","require","intersecting","name","fn","middlewareArguments","floatingRect","rects","floating","altOverflow","detectOverflow","altBoundary","isIntersectingTop","top","height","isIntersectingBottom","bottom","isIntersecting","data","exports"],"sources":["../src/packages/react-components/react-positioning/src/middleware/intersecting.ts"],"sourcesContent":["import type { Middleware } from '@floating-ui/dom';\nimport { detectOverflow } from '@floating-ui/dom';\n\nexport function intersecting(): Middleware {\n return {\n name: 'intersectionObserver',\n fn: async middlewareArguments => {\n const floatingRect = middlewareArguments.rects.floating;\n const altOverflow = await detectOverflow(middlewareArguments, { altBoundary: true });\n\n const isIntersectingTop = altOverflow.top < floatingRect.height && altOverflow.top > 0;\n const isIntersectingBottom = altOverflow.bottom < floatingRect.height && altOverflow.bottom > 0;\n\n const isIntersecting = isIntersectingTop || isIntersectingBottom;\n\n return {\n data: {\n intersecting: isIntersecting,\n },\n };\n },\n };\n}\n"],"mappings":";;;;;;AACA,MAAAA,KAAA,gBAAAC,OAAA;AAEA,SAAgBC,YAAYA,CAAA;EAC1B,OAAO;IACLC,IAAI,EAAE,sBAAsB;IAC5BC,EAAE,EAAE,MAAMC,mBAAmB,IAAG;MAC9B,MAAMC,YAAY,GAAGD,mBAAmB,CAACE,KAAK,CAACC,QAAQ;MACvD,MAAMC,WAAW,GAAG,MAAMT,KAAA,CAAAU,cAAc,CAACL,mBAAmB,EAAE;QAAEM,WAAW,EAAE;MAAI,CAAE,CAAC;MAEpF,MAAMC,iBAAiB,GAAGH,WAAW,CAACI,GAAG,GAAGP,YAAY,CAACQ,MAAM,IAAIL,WAAW,CAACI,GAAG,GAAG,CAAC;MACtF,MAAME,oBAAoB,GAAGN,WAAW,CAACO,MAAM,GAAGV,YAAY,CAACQ,MAAM,IAAIL,WAAW,CAACO,MAAM,GAAG,CAAC;MAE/F,MAAMC,cAAc,GAAGL,iBAAiB,IAAIG,oBAAoB;MAEhE,OAAO;QACLG,IAAI,EAAE;UACJhB,YAAY,EAAEe;;OAEjB;IACH;GACD;AACH;AAnBAE,OAAA,CAAAjB,YAAA,GAAAA,YAAA"}
@@ -27,13 +27,15 @@ function maxSize(autoSize, options) {
27
27
  if (applyMaxHeight) {
28
28
  Object.assign(elements.floating.style, {
29
29
  maxHeight: `${availableHeight}px`,
30
- boxSizing: 'border-box'
30
+ boxSizing: 'border-box',
31
+ overflowY: 'auto'
31
32
  });
32
33
  }
33
34
  if (applyMaxWidth) {
34
35
  Object.assign(elements.floating.style, {
35
36
  maxWidth: `${availableWidth}px`,
36
- boxSizing: 'border-box'
37
+ boxSizing: 'border-box',
38
+ overflowX: 'auto'
37
39
  });
38
40
  }
39
41
  }
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AAGA;AAKA,SAAgBA,OAAO,CAACC,QAAwC,EAAEC,OAAiC;EACjG,MAAM;IAAEC,SAAS;IAAEC;EAAgB,CAAE,GAAGF,OAAO;EAC/C,OAAOG,UAAI,CAAC;IACV,IAAID,gBAAgB,IAAI;MAAEE,WAAW,EAAE,IAAI;MAAEC,QAAQ,EAAEC,yBAAW,CAACL,SAAS,EAAEC,gBAAgB;IAAC,CAAE,CAAC;IAClGK,KAAK,CAAC;MAAEC,eAAe;MAAEC,cAAc;MAAEC,QAAQ;MAAEC;IAAK,CAAE;MACxD,MAAMC,aAAa,GACjBb,QAAQ,KAAK,QAAQ,IACrBA,QAAQ,KAAK,cAAc,IAC1BY,KAAK,CAACE,QAAQ,CAACC,KAAK,GAAGL,cAAc,KAAKV,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAK,OAAO,CAAE;MAExF,MAAMgB,cAAc,GAClBhB,QAAQ,KAAK,QAAQ,IACrBA,QAAQ,KAAK,eAAe,IAC3BY,KAAK,CAACE,QAAQ,CAACG,MAAM,GAAGR,eAAe,KAAKT,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAK,QAAQ,CAAE;MAE3F,IAAIgB,cAAc,EAAE;QAClBE,MAAM,CAACC,MAAM,CAACR,QAAQ,CAACG,QAAQ,CAACM,KAAK,EAAE;UACrCC,SAAS,EAAE,GAAGZ,eAAe,IAAI;UACjCa,SAAS,EAAE;SACZ,CAAC;;MAGJ,IAAIT,aAAa,EAAE;QACjBK,MAAM,CAACC,MAAM,CAACR,QAAQ,CAACG,QAAQ,CAACM,KAAK,EAAE;UACrCG,QAAQ,EAAE,GAAGb,cAAc,IAAI;UAC/BY,SAAS,EAAE;SACZ,CAAC;;IAEN;GACD,CAAC;AACJ;AA9BAE","names":["maxSize","autoSize","options","container","overflowBoundary","dom_1","altBoundary","boundary","getBoundary_1","apply","availableHeight","availableWidth","elements","rects","applyMaxWidth","floating","width","applyMaxHeight","height","Object","assign","style","maxHeight","boxSizing","maxWidth","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/middleware/maxSize.ts"],"sourcesContent":["import { size } from '@floating-ui/dom';\nimport type { Middleware } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary } from '../utils/getBoundary';\nexport interface MaxSizeMiddlewareOptions extends Pick<PositioningOptions, 'overflowBoundary'> {\n container: HTMLElement | null;\n}\n\nexport function maxSize(autoSize: PositioningOptions['autoSize'], options: MaxSizeMiddlewareOptions): Middleware {\n const { container, overflowBoundary } = options;\n return size({\n ...(overflowBoundary && { altBoundary: true, boundary: getBoundary(container, overflowBoundary) }),\n apply({ availableHeight, availableWidth, elements, rects }) {\n const applyMaxWidth =\n autoSize === 'always' ||\n autoSize === 'width-always' ||\n (rects.floating.width > availableWidth && (autoSize === true || autoSize === 'width'));\n\n const applyMaxHeight =\n autoSize === 'always' ||\n autoSize === 'height-always' ||\n (rects.floating.height > availableHeight && (autoSize === true || autoSize === 'height'));\n\n if (applyMaxHeight) {\n Object.assign(elements.floating.style, {\n maxHeight: `${availableHeight}px`,\n boxSizing: 'border-box',\n });\n }\n\n if (applyMaxWidth) {\n Object.assign(elements.floating.style, {\n maxWidth: `${availableWidth}px`,\n boxSizing: 'border-box',\n });\n }\n },\n });\n}\n"]}
1
+ {"version":3,"names":["dom_1","require","getBoundary_1","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","exports"],"sources":["../src/packages/react-components/react-positioning/src/middleware/maxSize.ts"],"sourcesContent":["import { size } from '@floating-ui/dom';\nimport type { Middleware } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary } from '../utils/getBoundary';\nexport interface MaxSizeMiddlewareOptions extends Pick<PositioningOptions, 'overflowBoundary'> {\n container: HTMLElement | null;\n}\n\nexport function maxSize(autoSize: PositioningOptions['autoSize'], options: MaxSizeMiddlewareOptions): Middleware {\n const { container, overflowBoundary } = options;\n return size({\n ...(overflowBoundary && { altBoundary: true, boundary: getBoundary(container, overflowBoundary) }),\n apply({ availableHeight, availableWidth, elements, rects }) {\n const applyMaxWidth =\n autoSize === 'always' ||\n autoSize === 'width-always' ||\n (rects.floating.width > availableWidth && (autoSize === true || autoSize === 'width'));\n\n const applyMaxHeight =\n autoSize === 'always' ||\n autoSize === 'height-always' ||\n (rects.floating.height > availableHeight && (autoSize === true || autoSize === 'height'));\n\n if (applyMaxHeight) {\n Object.assign<CSSStyleDeclaration, Partial<CSSStyleDeclaration>>(elements.floating.style, {\n maxHeight: `${availableHeight}px`,\n boxSizing: 'border-box',\n overflowY: 'auto',\n });\n }\n\n if (applyMaxWidth) {\n Object.assign<CSSStyleDeclaration, Partial<CSSStyleDeclaration>>(elements.floating.style, {\n maxWidth: `${availableWidth}px`,\n boxSizing: 'border-box',\n overflowX: 'auto',\n });\n }\n },\n });\n}\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AAGA,MAAAC,aAAA,gBAAAD,OAAA;AAKA,SAAgBE,OAAOA,CAACC,QAAwC,EAAEC,OAAiC;EACjG,MAAM;IAAEC,SAAS;IAAEC;EAAgB,CAAE,GAAGF,OAAO;EAC/C,OAAOL,KAAA,CAAAQ,IAAI,CAAC;IACV,IAAID,gBAAgB,IAAI;MAAEE,WAAW,EAAE,IAAI;MAAEC,QAAQ,EAAER,aAAA,CAAAS,WAAW,CAACL,SAAS,EAAEC,gBAAgB;IAAC,CAAE,CAAC;IAClGK,KAAKA,CAAC;MAAEC,eAAe;MAAEC,cAAc;MAAEC,QAAQ;MAAEC;IAAK,CAAE;MACxD,MAAMC,aAAa,GACjBb,QAAQ,KAAK,QAAQ,IACrBA,QAAQ,KAAK,cAAc,IAC1BY,KAAK,CAACE,QAAQ,CAACC,KAAK,GAAGL,cAAc,KAAKV,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAK,OAAO,CAAE;MAExF,MAAMgB,cAAc,GAClBhB,QAAQ,KAAK,QAAQ,IACrBA,QAAQ,KAAK,eAAe,IAC3BY,KAAK,CAACE,QAAQ,CAACG,MAAM,GAAGR,eAAe,KAAKT,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAK,QAAQ,CAAE;MAE3F,IAAIgB,cAAc,EAAE;QAClBE,MAAM,CAACC,MAAM,CAAoDR,QAAQ,CAACG,QAAQ,CAACM,KAAK,EAAE;UACxFC,SAAS,EAAE,GAAGZ,eAAe,IAAI;UACjCa,SAAS,EAAE,YAAY;UACvBC,SAAS,EAAE;SACZ,CAAC;;MAGJ,IAAIV,aAAa,EAAE;QACjBK,MAAM,CAACC,MAAM,CAAoDR,QAAQ,CAACG,QAAQ,CAACM,KAAK,EAAE;UACxFI,QAAQ,EAAE,GAAGd,cAAc,IAAI;UAC/BY,SAAS,EAAE,YAAY;UACvBG,SAAS,EAAE;SACZ,CAAC;;IAEN;GACD,CAAC;AACJ;AAhCAC,OAAA,CAAA3B,OAAA,GAAAA,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AAEA;AAEA;;;AAGA,SAAgBA,MAAM,CAACC,WAAyC;EAC9D,MAAMC,gBAAgB,GAAGC,yCAAmB,CAACF,WAAW,CAAC;EACzD,OAAOG,YAAU,CAACF,gBAAgB,CAAC;AACrC;AAHAG","names":["offset","offsetValue","floatingUIOffset","getFloatingUIOffset_1","dom_1","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/middleware/offset.ts"],"sourcesContent":["import { offset as baseOffset } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getFloatingUIOffset } from '../utils/getFloatingUIOffset';\n\n/**\n * Wraps floating UI offset middleware to to transform offset value\n */\nexport function offset(offsetValue: PositioningOptions['offset']) {\n const floatingUIOffset = getFloatingUIOffset(offsetValue);\n return baseOffset(floatingUIOffset);\n}\n"]}
1
+ {"version":3,"names":["dom_1","require","getFloatingUIOffset_1","offset","offsetValue","floatingUIOffset","getFloatingUIOffset","exports"],"sources":["../src/packages/react-components/react-positioning/src/middleware/offset.ts"],"sourcesContent":["import { offset as baseOffset } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getFloatingUIOffset } from '../utils/getFloatingUIOffset';\n\n/**\n * Wraps floating UI offset middleware to to transform offset value\n */\nexport function offset(offsetValue: PositioningOptions['offset']) {\n const floatingUIOffset = getFloatingUIOffset(offsetValue);\n return baseOffset(floatingUIOffset);\n}\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AAEA,MAAAC,qBAAA,gBAAAD,OAAA;AAEA;;;AAGA,SAAgBE,MAAMA,CAACC,WAAyC;EAC9D,MAAMC,gBAAgB,GAAGH,qBAAA,CAAAI,mBAAmB,CAACF,WAAW,CAAC;EACzD,OAAOJ,KAAA,CAAAG,MAAU,CAACE,gBAAgB,CAAC;AACrC;AAHAE,OAAA,CAAAJ,MAAA,GAAAA,MAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AAEA;AAUA;;;AAGA,SAAgBA,KAAK,CAACC,OAA+B;EACnD,MAAM;IAAEC,oBAAoB;IAAEC,aAAa;IAAEC,gBAAgB;IAAEC,SAAS;IAAEC,uBAAuB;IAAEC;EAAK,CAAE,GAAGN,OAAO;EAEpH,OAAOO,WAAS,CAAC;IACf,IAAIN,oBAAoB,IAAI;MAAEO,QAAQ,EAAE;IAAmB,CAAE,CAAC;IAC9D,IAAIN,aAAa,IAAI;MACnBO,SAAS,EAAEP,aAAa,KAAK,KAAK;MAClCQ,OAAO,EAAEH,gBAAU,CAAC;QAAEE,SAAS,EAAEP,aAAa,KAAK,KAAK;QAAES,QAAQ,EAAE;MAAK,CAAE;KAC5E,CAAC;IACF,IAAIN,uBAAuB,IAAI;MAAEO,OAAO,EAAEC,2BAAmB,CAACR,uBAAuB,EAAEC,KAAK;IAAC,CAAE,CAAC;IAChG,IAAIH,gBAAgB,IAAI;MAAEW,WAAW,EAAE,IAAI;MAAEN,QAAQ,EAAEK,mBAAW,CAACT,SAAS,EAAED,gBAAgB;IAAC,CAAE;GAClG,CAAC;AACJ;AAZAY","names":["shift","options","hasScrollableElement","disableTether","overflowBoundary","container","overflowBoundaryPadding","isRtl","dom_1","boundary","crossAxis","limiter","mainAxis","padding","index_1","altBoundary","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/middleware/shift.ts"],"sourcesContent":["import { shift as baseShift, limitShift } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary, toFloatingUIPadding } from '../utils/index';\n\nexport interface ShiftMiddlewareOptions\n extends Pick<PositioningOptions, 'overflowBoundary' | 'overflowBoundaryPadding'> {\n hasScrollableElement?: boolean;\n disableTether?: PositioningOptions['unstable_disableTether'];\n container: HTMLElement | null;\n isRtl: boolean;\n}\n\n/**\n * Wraps the floating UI shift middleware for easier usage of our options\n */\nexport function shift(options: ShiftMiddlewareOptions) {\n const { hasScrollableElement, disableTether, overflowBoundary, container, overflowBoundaryPadding, isRtl } = options;\n\n return baseShift({\n ...(hasScrollableElement && { boundary: 'clippingAncestors' }),\n ...(disableTether && {\n crossAxis: disableTether === 'all',\n limiter: limitShift({ crossAxis: disableTether !== 'all', mainAxis: false }),\n }),\n ...(overflowBoundaryPadding && { padding: toFloatingUIPadding(overflowBoundaryPadding, isRtl) }),\n ...(overflowBoundary && { altBoundary: true, boundary: getBoundary(container, overflowBoundary) }),\n });\n}\n"]}
1
+ {"version":3,"names":["dom_1","require","index_1","shift","options","hasScrollableElement","disableTether","overflowBoundary","container","overflowBoundaryPadding","isRtl","boundary","crossAxis","limiter","limitShift","mainAxis","padding","toFloatingUIPadding","altBoundary","getBoundary","exports"],"sources":["../src/packages/react-components/react-positioning/src/middleware/shift.ts"],"sourcesContent":["import { shift as baseShift, limitShift } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary, toFloatingUIPadding } from '../utils/index';\n\nexport interface ShiftMiddlewareOptions\n extends Pick<PositioningOptions, 'overflowBoundary' | 'overflowBoundaryPadding'> {\n hasScrollableElement?: boolean;\n disableTether?: PositioningOptions['unstable_disableTether'];\n container: HTMLElement | null;\n isRtl: boolean;\n}\n\n/**\n * Wraps the floating UI shift middleware for easier usage of our options\n */\nexport function shift(options: ShiftMiddlewareOptions) {\n const { hasScrollableElement, disableTether, overflowBoundary, container, overflowBoundaryPadding, isRtl } = options;\n\n return baseShift({\n ...(hasScrollableElement && { boundary: 'clippingAncestors' }),\n ...(disableTether && {\n crossAxis: disableTether === 'all',\n limiter: limitShift({ crossAxis: disableTether !== 'all', mainAxis: false }),\n }),\n ...(overflowBoundaryPadding && { padding: toFloatingUIPadding(overflowBoundaryPadding, isRtl) }),\n ...(overflowBoundary && { altBoundary: true, boundary: getBoundary(container, overflowBoundary) }),\n });\n}\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AAEA,MAAAC,OAAA,gBAAAD,OAAA;AAUA;;;AAGA,SAAgBE,KAAKA,CAACC,OAA+B;EACnD,MAAM;IAAEC,oBAAoB;IAAEC,aAAa;IAAEC,gBAAgB;IAAEC,SAAS;IAAEC,uBAAuB;IAAEC;EAAK,CAAE,GAAGN,OAAO;EAEpH,OAAOJ,KAAA,CAAAG,KAAS,CAAC;IACf,IAAIE,oBAAoB,IAAI;MAAEM,QAAQ,EAAE;IAAmB,CAAE,CAAC;IAC9D,IAAIL,aAAa,IAAI;MACnBM,SAAS,EAAEN,aAAa,KAAK,KAAK;MAClCO,OAAO,EAAEb,KAAA,CAAAc,UAAU,CAAC;QAAEF,SAAS,EAAEN,aAAa,KAAK,KAAK;QAAES,QAAQ,EAAE;MAAK,CAAE;KAC5E,CAAC;IACF,IAAIN,uBAAuB,IAAI;MAAEO,OAAO,EAAEd,OAAA,CAAAe,mBAAmB,CAACR,uBAAuB,EAAEC,KAAK;IAAC,CAAE,CAAC;IAChG,IAAIH,gBAAgB,IAAI;MAAEW,WAAW,EAAE,IAAI;MAAEP,QAAQ,EAAET,OAAA,CAAAiB,WAAW,CAACX,SAAS,EAAED,gBAAgB;IAAC,CAAE;GAClG,CAAC;AACJ;AAZAa,OAAA,CAAAjB,KAAA,GAAAA,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":"","names":[],"sourceRoot":"../src/","sources":[],"sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["../src/packages/react-components/react-positioning/src/types.ts"],"sourcesContent":["import * as React from 'react';\n\ntype Rect = {\n width: number;\n height: number;\n x: number;\n y: number;\n};\n\nexport type OffsetFunctionParam = {\n positionedRect: Rect;\n targetRect: Rect;\n position: Position;\n alignment?: Alignment;\n};\n\nexport type TargetElement = HTMLElement | PositioningVirtualElement;\n\n/**\n * @internal\n */\nexport interface UsePositioningOptions extends PositioningProps {\n /**\n * If false, does not position anything\n */\n enabled?: boolean;\n}\n\n/**\n * @internal\n */\nexport interface PositionManager {\n updatePosition: () => void;\n dispose: () => void;\n}\n\nexport interface UsePositioningReturn {\n // React refs are supposed to be contravariant\n // (allows a more general type to be passed rather than a more specific one)\n // However, Typescript currently can't infer that fact for refs\n // See https://github.com/microsoft/TypeScript/issues/30748 for more information\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n targetRef: React.MutableRefObject<any>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n containerRef: React.MutableRefObject<any>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n arrowRef: React.MutableRefObject<any>;\n}\n\nexport type OffsetObject = { crossAxis?: number; mainAxis: number };\n\nexport type OffsetShorthand = number;\n\nexport type OffsetFunction = (param: OffsetFunctionParam) => OffsetObject | OffsetShorthand;\n\nexport type Offset = OffsetFunction | OffsetObject | OffsetShorthand;\n\nexport type Position = 'above' | 'below' | 'before' | 'after';\nexport type Alignment = 'top' | 'bottom' | 'start' | 'end' | 'center';\n\nexport type AutoSize = 'height' | 'height-always' | 'width' | 'width-always' | 'always' | boolean;\n\nexport type Boundary = HTMLElement | Array<HTMLElement> | 'clippingParents' | 'scrollParent' | 'window';\n\nexport type PositioningImperativeRef = {\n /**\n * Updates the position imperatively.\n * Useful when the position of the target changes from other factors than scrolling of window resize.\n */\n updatePosition: () => void;\n\n /**\n * Sets the target and updates positioning imperatively.\n * Useful for avoiding double renders with the target option.\n */\n setTarget: (target: TargetElement) => void;\n};\n\nexport type PositioningVirtualElement = {\n getBoundingClientRect: () => {\n x: number;\n y: number;\n top: number;\n left: number;\n bottom: number;\n right: number;\n width: number;\n height: number;\n };\n contextElement?: Element;\n};\n\nexport type SetVirtualMouseTarget = (event: React.MouseEvent | MouseEvent | undefined | null) => void;\n\nexport interface PositioningOptions {\n /** Alignment for the component. Only has an effect if used with the @see position option */\n align?: Alignment;\n\n /** The element which will define the boundaries of the positioned element for the flip behavior. */\n flipBoundary?: Boundary | null;\n\n /** The element which will define the boundaries of the positioned element for the overflow behavior. */\n overflowBoundary?: Boundary | null;\n\n /**\n * Applies a padding to the overflow bounadry, so that overflow is detected earlier before the\n * positioned surface hits the overflow boundary.\n */\n overflowBoundaryPadding?: number | Partial<{ top: number; end: number; bottom: number; start: number }>;\n\n /**\n * Position for the component. Position has higher priority than align. If position is vertical ('above' | 'below')\n * and align is also vertical ('top' | 'bottom') or if both position and align are horizontal ('before' | 'after'\n * and 'start' | 'end' respectively),\n * then provided value for 'align' will be ignored and 'center' will be used instead.\n */\n position?: Position;\n\n /**\n * Enables the position element to be positioned with 'fixed' (default value is position: 'absolute')\n * @default false\n */\n positionFixed?: boolean;\n\n /**\n * Lets you displace a positioned element from its reference element.\n * This can be useful if you need to apply some margin between them or if you need to fine tune the\n * position according to some custom logic.\n */\n offset?: Offset;\n\n /**\n * Defines padding between the corner of the popup element and the arrow.\n * Use to prevent the arrow from overlapping a rounded corner, for example.\n */\n arrowPadding?: number;\n\n /**\n * Applies max-height and max-width on the positioned element to fit it within the available space in viewport.\n * true enables this for both width and height when overflow happens.\n * 'always' applies `max-height`/`max-width` regardless of overflow.\n * 'height' applies `max-height` when overflow happens, and 'width' for `max-width`\n * `height-always` applies `max-height` regardless of overflow, and 'width-always' for always applying `max-width`\n */\n autoSize?: AutoSize;\n\n /**\n * Modifies position and alignment to cover the target\n */\n coverTarget?: boolean;\n\n /**\n * Disables automatic repositioning of the component; it will always be placed according to the values of `align` and\n * `position` props, regardless of the size of the component, the reference element or the viewport.\n */\n pinned?: boolean;\n\n /**\n * When the reference element or the viewport is outside viewport allows a positioned element to be fully in viewport.\n * \"all\" enables this behavior for all axis.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_disableTether?: boolean | 'all';\n\n /**\n * If flip fails to stop the positioned element from overflowing\n * its boundaries, use a specified fallback positions.\n */\n fallbackPositions?: PositioningShorthandValue[];\n}\n\nexport interface PositioningProps\n extends Pick<\n PositioningOptions,\n | 'align'\n | 'flipBoundary'\n | 'overflowBoundary'\n | 'overflowBoundaryPadding'\n | 'position'\n | 'offset'\n | 'arrowPadding'\n | 'autoSize'\n | 'coverTarget'\n > {\n /** An imperative handle to Popper methods. */\n positioningRef?: React.Ref<PositioningImperativeRef>;\n\n /**\n * Manual override for the target element. Useful for scenarios where a component accepts user prop to override target\n */\n target?: TargetElement | null;\n}\n\nexport type PositioningShorthandValue =\n | 'above'\n | 'above-start'\n | 'above-end'\n | 'below'\n | 'below-start'\n | 'below-end'\n | 'before'\n | 'before-top'\n | 'before-bottom'\n | 'after'\n | 'after-top'\n | 'after-bottom';\n\nexport type PositioningShorthand = PositioningProps | PositioningShorthandValue;\n"],"mappings":""}
@@ -129,7 +129,8 @@ function usePositioningOptions(options) {
129
129
  position,
130
130
  unstable_disableTether: disableTether,
131
131
  positionFixed,
132
- overflowBoundaryPadding
132
+ overflowBoundaryPadding,
133
+ fallbackPositions
133
134
  } = options;
134
135
  const {
135
136
  dir
@@ -141,7 +142,9 @@ function usePositioningOptions(options) {
141
142
  const middleware = [offset && middleware_1.offset(offset), coverTarget && middleware_1.coverTarget(), !pinned && middleware_1.flip({
142
143
  container,
143
144
  flipBoundary,
144
- hasScrollableElement
145
+ hasScrollableElement,
146
+ isRtl,
147
+ fallbackPositions
145
148
  }), middleware_1.shift({
146
149
  container,
147
150
  hasScrollableElement,
@@ -166,6 +169,6 @@ function usePositioningOptions(options) {
166
169
  middleware,
167
170
  strategy
168
171
  };
169
- }, [align, arrowPadding, autoSize, coverTarget, disableTether, flipBoundary, isRtl, offset, overflowBoundary, pinned, position, strategy, overflowBoundaryPadding]);
172
+ }, [align, arrowPadding, autoSize, coverTarget, disableTether, flipBoundary, isRtl, offset, overflowBoundary, pinned, position, strategy, overflowBoundaryPadding, fallbackPositions]);
170
173
  }
171
174
  //# sourceMappingURL=usePositioning.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AAEA;AACA;AACA;AAQA;AACA;AAQA;AAEA;;;AAGA,SAAgBA,cAAc,CAACC,OAA8B;EAC3D,MAAMC,UAAU,GAAGC,KAAK,CAACC,MAAM,CAAyB,IAAI,CAAC;EAC7D,MAAMC,SAAS,GAAGF,KAAK,CAACC,MAAM,CAAuB,IAAI,CAAC;EAC1D,MAAME,iBAAiB,GAAGH,KAAK,CAACC,MAAM,CAAuB,IAAI,CAAC;EAClE,MAAMG,YAAY,GAAGJ,KAAK,CAACC,MAAM,CAAqB,IAAI,CAAC;EAC3D,MAAMI,QAAQ,GAAGL,KAAK,CAACC,MAAM,CAAqB,IAAI,CAAC;EAEvD,MAAM;IAAEK,OAAO,GAAG;EAAI,CAAE,GAAGR,OAAO;EAClC,MAAMS,yBAAyB,GAAGC,qBAAqB,CAACV,OAAO,CAAC;EAChE,MAAMW,qBAAqB,GAAGT,KAAK,CAACU,WAAW,CAAC,MAAK;;IACnD,IAAIX,UAAU,CAACY,OAAO,EAAE;MACtBZ,UAAU,CAACY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C;MAAElD,SAAS;MAAEmC,YAAY;MAAEa;IAAoB,CAAE,CAAC,EAC5EE,kBAAe,CAAC;MACdlD,SAAS;MACTgD,oBAAoB;MACpBX,gBAAgB;MAChBI,aAAa;MACbE,uBAAuB;MACvBG;KACD,CAAC,EACFb,QAAQ,IAAIiB,oBAAiB,CAACjB,QAAQ,EAAE;MAAEjC,SAAS;MAAEqC;IAAgB,CAAE,CAAC,EACxEa,yBAAsB,EAAE,EACxBjD,KAAK,IAAIkD,WAAe,CAAC;MAAEC,OAAO,EAAEnD,KAAK;MAAEoD,OAAO,EAAErB;IAAY,CAAE,CAAC,EACnEmB,UAAc,CAAC;MAAEJ,QAAQ,EAAE;IAAiB,CAAE,CAAC,EAC/CI,UAAc,CAAC;MAAEJ,QAAQ,EAAE;IAAS,CAAE,CAAC,CACxC,CAACO,MAAM,CAACC,OAAO,CAAiB;IAEjC,MAAMC,SAAS,GAAGjC,6BAAqB,CAACQ,KAAK,EAAEQ,QAAQ,EAAEO,KAAK,CAAC;IAE/D,OAAO;MACLU,SAAS;MACTP,UAAU;MACVF;KACD;EACH,CAAC,EACD,CACEhB,KAAK,EACLC,YAAY,EACZC,QAAQ,EACRC,WAAW,EACXO,aAAa,EACbN,YAAY,EACZW,KAAK,EACLV,MAAM,EACNC,gBAAgB,EAChBC,MAAM,EACNC,QAAQ,EACRQ,QAAQ,EACRJ,uBAAuB,CACxB,CACF;AACH","names":["usePositioning","options","managerRef","React","useRef","targetRef","overrideTargetRef","containerRef","arrowRef","enabled","resolvePositioningOptions","usePositioningOptions","updatePositionManager","useCallback","current","dispose","target","react_utilities_1","createPositionManager_1","container","arrow","setOverrideTarget","useImperativeHandle","positioningRef","updatePosition","setTarget","process","env","NODE_ENV","err","Error","console","warn","stack","useEffect","contentNode","treeWalker","ownerDocument","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","utils_1","nextNode","node","currentNode","join","setContainer","setArrow","exports","align","arrowPadding","autoSize","coverTarget","flipBoundary","offset","overflowBoundary","pinned","position","unstable_disableTether","disableTether","positionFixed","overflowBoundaryPadding","dir","react_shared_contexts_1","isRtl","strategy","hasScrollableElement","middleware","middleware_1","dom_1","element","padding","filter","Boolean","placement"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/usePositioning.ts"],"sourcesContent":["import { hide as hideMiddleware, arrow as arrowMiddleware } from '@floating-ui/dom';\nimport type { Middleware, Strategy } from '@floating-ui/dom';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { canUseDOM, useEventCallback, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport type {\n PositioningOptions,\n PositioningProps,\n PositionManager,\n TargetElement,\n UsePositioningReturn,\n} from './types';\nimport { useCallbackRef, toFloatingUIPlacement, hasAutofocusFilter, hasScrollParent } from './utils';\nimport {\n shift as shiftMiddleware,\n flip as flipMiddleware,\n coverTarget as coverTargetMiddleware,\n maxSize as maxSizeMiddleware,\n offset as offsetMiddleware,\n intersecting as intersectingMiddleware,\n} from './middleware';\nimport { createPositionManager } from './createPositionManager';\n\n/**\n * @internal\n */\nexport function usePositioning(options: UsePositioningOptions): UsePositioningReturn {\n const managerRef = React.useRef<PositionManager | null>(null);\n const targetRef = React.useRef<TargetElement | null>(null);\n const overrideTargetRef = React.useRef<TargetElement | null>(null);\n const containerRef = React.useRef<HTMLElement | null>(null);\n const arrowRef = React.useRef<HTMLElement | null>(null);\n\n const { enabled = true } = options;\n const resolvePositioningOptions = usePositioningOptions(options);\n const updatePositionManager = React.useCallback(() => {\n if (managerRef.current) {\n managerRef.current.dispose();\n }\n managerRef.current = null;\n\n const target = overrideTargetRef.current ?? targetRef.current;\n\n if (enabled && canUseDOM() && target && containerRef.current) {\n managerRef.current = createPositionManager({\n container: containerRef.current,\n target,\n arrow: arrowRef.current,\n ...resolvePositioningOptions(containerRef.current, arrowRef.current),\n });\n }\n }, [enabled, resolvePositioningOptions]);\n\n const setOverrideTarget = useEventCallback((target: TargetElement | null) => {\n overrideTargetRef.current = target;\n updatePositionManager();\n });\n\n React.useImperativeHandle(\n options.positioningRef,\n () => ({\n updatePosition: () => managerRef.current?.updatePosition(),\n setTarget: (target: TargetElement) => {\n if (options.target && process.env.NODE_ENV !== 'production') {\n const err = new Error();\n // eslint-disable-next-line no-console\n console.warn('Imperative setTarget should not be used at the same time as target option');\n // eslint-disable-next-line no-console\n console.warn(err.stack);\n }\n\n setOverrideTarget(target);\n },\n }),\n [options.target, setOverrideTarget],\n );\n\n useIsomorphicLayoutEffect(() => {\n setOverrideTarget(options.target ?? null);\n }, [options.target, setOverrideTarget]);\n\n useIsomorphicLayoutEffect(() => {\n updatePositionManager();\n }, [updatePositionManager]);\n\n if (process.env.NODE_ENV !== 'production') {\n // This checked should run only in development mode\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (containerRef.current) {\n const contentNode = containerRef.current;\n const treeWalker = contentNode.ownerDocument?.createTreeWalker(contentNode, NodeFilter.SHOW_ELEMENT, {\n acceptNode: hasAutofocusFilter,\n });\n\n while (treeWalker.nextNode()) {\n const node = treeWalker.currentNode;\n // eslint-disable-next-line no-console\n console.warn('<Popper>:', node);\n // eslint-disable-next-line no-console\n console.warn(\n [\n '<Popper>: ^ this node contains \"autoFocus\" prop on a React element. This can break the initial',\n 'positioning of an element and cause a window jump effect. This issue occurs because React polyfills',\n '\"autoFocus\" behavior to solve inconsistencies between different browsers:',\n 'https://github.com/facebook/react/issues/11851#issuecomment-351787078',\n '\\n',\n 'However, \".focus()\" in this case occurs before any other React effects will be executed',\n '(React.useEffect(), componentDidMount(), etc.) and we can not prevent this behavior. If you really',\n 'want to use \"autoFocus\" please add \"position: fixed\" to styles of the element that is wrapped by',\n '\"Popper\".',\n `In general, it's not recommended to use \"autoFocus\" as it may break accessibility aspects:`,\n 'https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-autofocus.md',\n '\\n',\n 'We suggest to use the \"trapFocus\" prop on Fluent components or a catch \"ref\" and then use',\n '\"ref.current.focus\" in React.useEffect():',\n 'https://reactjs.org/docs/refs-and-the-dom.html#adding-a-ref-to-a-dom-element',\n ].join(' '),\n );\n }\n }\n // We run this check once, no need to add deps here\n // TODO: Should be rework to handle options.enabled and contentRef updates\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n }\n\n const setTarget = useCallbackRef<TargetElement>(null, target => {\n if (targetRef.current !== target) {\n targetRef.current = target;\n updatePositionManager();\n }\n });\n\n const setContainer = useCallbackRef<HTMLElement | null>(null, container => {\n if (containerRef.current !== container) {\n containerRef.current = container;\n updatePositionManager();\n }\n });\n\n const setArrow = useCallbackRef<HTMLElement | null>(null, arrow => {\n if (arrowRef.current !== arrow) {\n arrowRef.current = arrow;\n updatePositionManager();\n }\n });\n\n // Let users use callback refs so they feel like 'normal' DOM refs\n return { targetRef: setTarget, containerRef: setContainer, arrowRef: setArrow };\n}\n\ninterface UsePositioningOptions extends PositioningProps {\n /**\n * If false, does not position anything\n */\n enabled?: boolean;\n}\n\nfunction usePositioningOptions(options: PositioningOptions) {\n const {\n align,\n arrowPadding,\n autoSize,\n coverTarget,\n flipBoundary,\n offset,\n overflowBoundary,\n pinned,\n position,\n unstable_disableTether: disableTether,\n positionFixed,\n overflowBoundaryPadding,\n } = options;\n\n const { dir } = useFluent();\n const isRtl = dir === 'rtl';\n const strategy: Strategy = positionFixed ? 'fixed' : 'absolute';\n\n return React.useCallback(\n (container: HTMLElement | null, arrow: HTMLElement | null) => {\n const hasScrollableElement = hasScrollParent(container);\n\n const middleware = [\n offset && offsetMiddleware(offset),\n coverTarget && coverTargetMiddleware(),\n !pinned && flipMiddleware({ container, flipBoundary, hasScrollableElement }),\n shiftMiddleware({\n container,\n hasScrollableElement,\n overflowBoundary,\n disableTether,\n overflowBoundaryPadding,\n isRtl,\n }),\n autoSize && maxSizeMiddleware(autoSize, { container, overflowBoundary }),\n intersectingMiddleware(),\n arrow && arrowMiddleware({ element: arrow, padding: arrowPadding }),\n hideMiddleware({ strategy: 'referenceHidden' }),\n hideMiddleware({ strategy: 'escaped' }),\n ].filter(Boolean) as Middleware[];\n\n const placement = toFloatingUIPlacement(align, position, isRtl);\n\n return {\n placement,\n middleware,\n strategy,\n };\n },\n [\n align,\n arrowPadding,\n autoSize,\n coverTarget,\n disableTether,\n flipBoundary,\n isRtl,\n offset,\n overflowBoundary,\n pinned,\n position,\n strategy,\n overflowBoundaryPadding,\n ],\n );\n}\n"]}
1
+ {"version":3,"names":["dom_1","require","react_shared_contexts_1","react_utilities_1","React","utils_1","middleware_1","createPositionManager_1","usePositioning","options","managerRef","useRef","targetRef","overrideTargetRef","containerRef","arrowRef","enabled","resolvePositioningOptions","usePositioningOptions","updatePositionManager","useCallback","current","dispose","target","_a","canUseDOM","createPositionManager","container","arrow","setOverrideTarget","useEventCallback","useImperativeHandle","positioningRef","updatePosition","setTarget","process","env","NODE_ENV","err","Error","console","warn","stack","useIsomorphicLayoutEffect","useEffect","contentNode","treeWalker","ownerDocument","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","hasAutofocusFilter","nextNode","node","currentNode","join","useCallbackRef","setContainer","setArrow","exports","align","arrowPadding","autoSize","coverTarget","flipBoundary","offset","overflowBoundary","pinned","position","unstable_disableTether","disableTether","positionFixed","overflowBoundaryPadding","fallbackPositions","dir","useFluent_unstable","isRtl","strategy","hasScrollableElement","hasScrollParent","middleware","flip","shift","maxSize","intersecting","element","padding","hide","filter","Boolean","placement","toFloatingUIPlacement"],"sources":["../src/packages/react-components/react-positioning/src/usePositioning.ts"],"sourcesContent":["import { hide as hideMiddleware, arrow as arrowMiddleware } from '@floating-ui/dom';\nimport type { Middleware, Strategy } from '@floating-ui/dom';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { canUseDOM, useEventCallback, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport type {\n PositioningOptions,\n PositioningProps,\n PositionManager,\n TargetElement,\n UsePositioningReturn,\n} from './types';\nimport { useCallbackRef, toFloatingUIPlacement, hasAutofocusFilter, hasScrollParent } from './utils';\nimport {\n shift as shiftMiddleware,\n flip as flipMiddleware,\n coverTarget as coverTargetMiddleware,\n maxSize as maxSizeMiddleware,\n offset as offsetMiddleware,\n intersecting as intersectingMiddleware,\n} from './middleware';\nimport { createPositionManager } from './createPositionManager';\n\n/**\n * @internal\n */\nexport function usePositioning(options: UsePositioningOptions): UsePositioningReturn {\n const managerRef = React.useRef<PositionManager | null>(null);\n const targetRef = React.useRef<TargetElement | null>(null);\n const overrideTargetRef = React.useRef<TargetElement | null>(null);\n const containerRef = React.useRef<HTMLElement | null>(null);\n const arrowRef = React.useRef<HTMLElement | null>(null);\n\n const { enabled = true } = options;\n const resolvePositioningOptions = usePositioningOptions(options);\n const updatePositionManager = React.useCallback(() => {\n if (managerRef.current) {\n managerRef.current.dispose();\n }\n managerRef.current = null;\n\n const target = overrideTargetRef.current ?? targetRef.current;\n\n if (enabled && canUseDOM() && target && containerRef.current) {\n managerRef.current = createPositionManager({\n container: containerRef.current,\n target,\n arrow: arrowRef.current,\n ...resolvePositioningOptions(containerRef.current, arrowRef.current),\n });\n }\n }, [enabled, resolvePositioningOptions]);\n\n const setOverrideTarget = useEventCallback((target: TargetElement | null) => {\n overrideTargetRef.current = target;\n updatePositionManager();\n });\n\n React.useImperativeHandle(\n options.positioningRef,\n () => ({\n updatePosition: () => managerRef.current?.updatePosition(),\n setTarget: (target: TargetElement) => {\n if (options.target && process.env.NODE_ENV !== 'production') {\n const err = new Error();\n // eslint-disable-next-line no-console\n console.warn('Imperative setTarget should not be used at the same time as target option');\n // eslint-disable-next-line no-console\n console.warn(err.stack);\n }\n\n setOverrideTarget(target);\n },\n }),\n [options.target, setOverrideTarget],\n );\n\n useIsomorphicLayoutEffect(() => {\n setOverrideTarget(options.target ?? null);\n }, [options.target, setOverrideTarget]);\n\n useIsomorphicLayoutEffect(() => {\n updatePositionManager();\n }, [updatePositionManager]);\n\n if (process.env.NODE_ENV !== 'production') {\n // This checked should run only in development mode\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (containerRef.current) {\n const contentNode = containerRef.current;\n const treeWalker = contentNode.ownerDocument?.createTreeWalker(contentNode, NodeFilter.SHOW_ELEMENT, {\n acceptNode: hasAutofocusFilter,\n });\n\n while (treeWalker.nextNode()) {\n const node = treeWalker.currentNode;\n // eslint-disable-next-line no-console\n console.warn('<Popper>:', node);\n // eslint-disable-next-line no-console\n console.warn(\n [\n '<Popper>: ^ this node contains \"autoFocus\" prop on a React element. This can break the initial',\n 'positioning of an element and cause a window jump effect. This issue occurs because React polyfills',\n '\"autoFocus\" behavior to solve inconsistencies between different browsers:',\n 'https://github.com/facebook/react/issues/11851#issuecomment-351787078',\n '\\n',\n 'However, \".focus()\" in this case occurs before any other React effects will be executed',\n '(React.useEffect(), componentDidMount(), etc.) and we can not prevent this behavior. If you really',\n 'want to use \"autoFocus\" please add \"position: fixed\" to styles of the element that is wrapped by',\n '\"Popper\".',\n `In general, it's not recommended to use \"autoFocus\" as it may break accessibility aspects:`,\n 'https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-autofocus.md',\n '\\n',\n 'We suggest to use the \"trapFocus\" prop on Fluent components or a catch \"ref\" and then use',\n '\"ref.current.focus\" in React.useEffect():',\n 'https://reactjs.org/docs/refs-and-the-dom.html#adding-a-ref-to-a-dom-element',\n ].join(' '),\n );\n }\n }\n // We run this check once, no need to add deps here\n // TODO: Should be rework to handle options.enabled and contentRef updates\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n }\n\n const setTarget = useCallbackRef<TargetElement>(null, target => {\n if (targetRef.current !== target) {\n targetRef.current = target;\n updatePositionManager();\n }\n });\n\n const setContainer = useCallbackRef<HTMLElement | null>(null, container => {\n if (containerRef.current !== container) {\n containerRef.current = container;\n updatePositionManager();\n }\n });\n\n const setArrow = useCallbackRef<HTMLElement | null>(null, arrow => {\n if (arrowRef.current !== arrow) {\n arrowRef.current = arrow;\n updatePositionManager();\n }\n });\n\n // Let users use callback refs so they feel like 'normal' DOM refs\n return { targetRef: setTarget, containerRef: setContainer, arrowRef: setArrow };\n}\n\ninterface UsePositioningOptions extends PositioningProps, Pick<PositioningOptions, 'fallbackPositions' | 'pinned'> {\n /**\n * If false, does not position anything\n */\n enabled?: boolean;\n}\n\nfunction usePositioningOptions(options: PositioningOptions) {\n const {\n align,\n arrowPadding,\n autoSize,\n coverTarget,\n flipBoundary,\n offset,\n overflowBoundary,\n pinned,\n position,\n unstable_disableTether: disableTether,\n positionFixed,\n overflowBoundaryPadding,\n fallbackPositions,\n } = options;\n\n const { dir } = useFluent();\n const isRtl = dir === 'rtl';\n const strategy: Strategy = positionFixed ? 'fixed' : 'absolute';\n\n return React.useCallback(\n (container: HTMLElement | null, arrow: HTMLElement | null) => {\n const hasScrollableElement = hasScrollParent(container);\n\n const middleware = [\n offset && offsetMiddleware(offset),\n coverTarget && coverTargetMiddleware(),\n !pinned && flipMiddleware({ container, flipBoundary, hasScrollableElement, isRtl, fallbackPositions }),\n shiftMiddleware({\n container,\n hasScrollableElement,\n overflowBoundary,\n disableTether,\n overflowBoundaryPadding,\n isRtl,\n }),\n autoSize && maxSizeMiddleware(autoSize, { container, overflowBoundary }),\n intersectingMiddleware(),\n arrow && arrowMiddleware({ element: arrow, padding: arrowPadding }),\n hideMiddleware({ strategy: 'referenceHidden' }),\n hideMiddleware({ strategy: 'escaped' }),\n ].filter(Boolean) as Middleware[];\n\n const placement = toFloatingUIPlacement(align, position, isRtl);\n\n return {\n placement,\n middleware,\n strategy,\n };\n },\n [\n align,\n arrowPadding,\n autoSize,\n coverTarget,\n disableTether,\n flipBoundary,\n isRtl,\n offset,\n overflowBoundary,\n pinned,\n position,\n strategy,\n overflowBoundaryPadding,\n fallbackPositions,\n ],\n );\n}\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AAEA,MAAAC,uBAA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CAAC;EAE/G,MAAMK,qBAAqB,GAA0BC,KAAK,IAAG;IAC3D,IAAIA,KAAK,KAAKC,SAAS,IAAID,KAAK,KAAK,IAAI,EAAE;MACzCJ,iBAAiB,CAACK,SAAS,CAAC;MAC5B;;IAGF,IAAIC,UAAsB;IAC1B,IAAI,EAAEF,KAAK,YAAYG,UAAU,CAAC,EAAE;MAClCD,UAAU,GAAGF,KAAK,CAACI,WAAW;KAC/B,MAAM;MACLF,UAAU,GAAGF,KAAK;;IAGpB,IAAI,EAAEE,UAAU,YAAYC,UAAU,CAAC,IAAIE,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;MAChF;MACAC,OAAO,CAACC,KAAK,CAAC,+DAA+D,CAAC;;IAGhF,MAAMC,aAAa,GAAGC,6DAA6B,CAACT,UAAU,CAAC;IAC/DN,iBAAiB,CAACc,aAAa,CAAC;EAClC,CAAC;EAED,OAAO,CAACf,cAAc,EAAEI,qBAAqB,CAAU;AACzD,CAAC;AA5BYa,iCAAyB","names":["usePositioningMouseTarget","initialState","virtualElement","setVirtualElement","React","useState","setVirtualMouseTarget","event","undefined","mouseevent","MouseEvent","nativeEvent","process","env","NODE_ENV","console","error","contextTarget","createVirtualElementFromClick_1","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/usePositioningMouseTarget.ts"],"sourcesContent":["import * as React from 'react';\nimport { createVirtualElementFromClick } from './createVirtualElementFromClick';\nimport { PositioningVirtualElement, SetVirtualMouseTarget } from './types';\n\n/**\n * @internal\n * A state hook that manages a popper virtual element from mouseevents.\n * Useful for scenarios where a component needs to be positioned by mouse click (e.g. contextmenu)\n * React synthetic events are not persisted by this hook\n *\n * @param initialState - initializes a user provided state similare to useState\n * @returns state and dispatcher for a Popper virtual element that uses native/synthetic mouse events\n */\nexport const usePositioningMouseTarget = (\n initialState?: PositioningVirtualElement | (() => PositioningVirtualElement),\n) => {\n const [virtualElement, setVirtualElement] = React.useState<PositioningVirtualElement | undefined>(initialState);\n\n const setVirtualMouseTarget: SetVirtualMouseTarget = event => {\n if (event === undefined || event === null) {\n setVirtualElement(undefined);\n return;\n }\n\n let mouseevent: MouseEvent;\n if (!(event instanceof MouseEvent)) {\n mouseevent = event.nativeEvent;\n } else {\n mouseevent = event;\n }\n\n if (!(mouseevent instanceof MouseEvent) && process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error('usePositioningMouseTarget should only be used with MouseEvent');\n }\n\n const contextTarget = createVirtualElementFromClick(mouseevent);\n setVirtualElement(contextTarget);\n };\n\n return [virtualElement, setVirtualMouseTarget] as const;\n};\n"]}
1
+ {"version":3,"names":["React","require","createVirtualElementFromClick_1","usePositioningMouseTarget","initialState","virtualElement","setVirtualElement","useState","setVirtualMouseTarget","event","undefined","mouseevent","MouseEvent","nativeEvent","process","env","NODE_ENV","console","error","contextTarget","createVirtualElementFromClick","exports"],"sources":["../src/packages/react-components/react-positioning/src/usePositioningMouseTarget.ts"],"sourcesContent":["import * as React from 'react';\nimport { createVirtualElementFromClick } from './createVirtualElementFromClick';\nimport { PositioningVirtualElement, SetVirtualMouseTarget } from './types';\n\n/**\n * @internal\n * A state hook that manages a popper virtual element from mouseevents.\n * Useful for scenarios where a component needs to be positioned by mouse click (e.g. contextmenu)\n * React synthetic events are not persisted by this hook\n *\n * @param initialState - initializes a user provided state similare to useState\n * @returns state and dispatcher for a Popper virtual element that uses native/synthetic mouse events\n */\nexport const usePositioningMouseTarget = (\n initialState?: PositioningVirtualElement | (() => PositioningVirtualElement),\n) => {\n const [virtualElement, setVirtualElement] = React.useState<PositioningVirtualElement | undefined>(initialState);\n\n const setVirtualMouseTarget: SetVirtualMouseTarget = event => {\n if (event === undefined || event === null) {\n setVirtualElement(undefined);\n return;\n }\n\n let mouseevent: MouseEvent;\n if (!(event instanceof MouseEvent)) {\n mouseevent = event.nativeEvent;\n } else {\n mouseevent = event;\n }\n\n if (!(mouseevent instanceof MouseEvent) && process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error('usePositioningMouseTarget should only be used with MouseEvent');\n }\n\n const contextTarget = createVirtualElementFromClick(mouseevent);\n setVirtualElement(contextTarget);\n };\n\n return [virtualElement, setVirtualMouseTarget] as const;\n};\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,+BAAA,gBAAAD,OAAA;AAGA;;;;;;;;;AASO,MAAME,yBAAyB,GACpCC,YAA4E,IAC1E;EACF,MAAM,CAACC,cAAc,EAAEC,iBAAiB,CAAC,GAAGN,KAAK,CAACO,QAAQ,CAAwCH,YAAY,CAAC;EAE/G,MAAMI,qBAAqB,GAA0BC,KAAK,IAAG;IAC3D,IAAIA,KAAK,KAAKC,SAAS,IAAID,KAAK,KAAK,IAAI,EAAE;MACzCH,iBAAiB,CAACI,SAAS,CAAC;MAC5B;;IAGF,IAAIC,UAAsB;IAC1B,IAAI,EAAEF,KAAK,YAAYG,UAAU,CAAC,EAAE;MAClCD,UAAU,GAAGF,KAAK,CAACI,WAAW;KAC/B,MAAM;MACLF,UAAU,GAAGF,KAAK;;IAGpB,IAAI,EAAEE,UAAU,YAAYC,UAAU,CAAC,IAAIE,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;MAChF;MACAC,OAAO,CAACC,KAAK,CAAC,+DAA+D,CAAC;;IAGhF,MAAMC,aAAa,GAAGjB,+BAAA,CAAAkB,6BAA6B,CAACT,UAAU,CAAC;IAC/DL,iBAAiB,CAACa,aAAa,CAAC;EAClC,CAAC;EAED,OAAO,CAACd,cAAc,EAAEG,qBAAqB,CAAU;AACzD,CAAC;AA5BYa,OAAA,CAAAlB,yBAAyB,GAAAA,yBAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;;;;;;AAMA,SAAgBA,QAAQ,CAAIC,EAAY;EACtC,IAAIC,OAA+B;EACnC,OAAO,MAAK;IACV,IAAI,CAACA,OAAO,EAAE;MACZA,OAAO,GAAG,IAAIC,OAAO,CAAIC,OAAO,IAAG;QACjCD,OAAO,CAACC,OAAO,EAAE,CAACC,IAAI,CAAC,MAAK;UAC1BH,OAAO,GAAGI,SAAS;UACnBF,OAAO,CAACH,EAAE,EAAE,CAAC;QACf,CAAC,CAAC;MACJ,CAAC,CAAC;;IAGJ,OAAOC,OAAO;EAChB,CAAC;AACH;AAdAK","names":["debounce","fn","pending","Promise","resolve","then","undefined","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/utils/debounce.ts"],"sourcesContent":["/**\n * Promise microtask debouncer used by Popper.js v2\n * This is no longer exported in Floating UI (Popper.js v3)\n * https://github.com/floating-ui/floating-ui/blob/v2.x/src/utils/debounce.js\n * @param fn function that will be debounced\n */\nexport function debounce<T>(fn: Function): () => Promise<T> {\n let pending: Promise<T> | undefined;\n return () => {\n if (!pending) {\n pending = new Promise<T>(resolve => {\n Promise.resolve().then(() => {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}\n"]}
1
+ {"version":3,"names":["debounce","fn","pending","Promise","resolve","then","undefined","exports"],"sources":["../src/packages/react-components/react-positioning/src/utils/debounce.ts"],"sourcesContent":["/**\n * Promise microtask debouncer used by Popper.js v2\n * This is no longer exported in Floating UI (Popper.js v3)\n * https://github.com/floating-ui/floating-ui/blob/v2.x/src/utils/debounce.js\n * @param fn function that will be debounced\n */\nexport function debounce<T>(fn: Function): () => Promise<T> {\n let pending: Promise<T> | undefined;\n return () => {\n if (!pending) {\n pending = new Promise<T>(resolve => {\n Promise.resolve().then(() => {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}\n"],"mappings":";;;;;;AAAA;;;;;;AAMA,SAAgBA,QAAQA,CAAIC,EAAY;EACtC,IAAIC,OAA+B;EACnC,OAAO,MAAK;IACV,IAAI,CAACA,OAAO,EAAE;MACZA,OAAO,GAAG,IAAIC,OAAO,CAAIC,OAAO,IAAG;QACjCD,OAAO,CAACC,OAAO,EAAE,CAACC,IAAI,CAAC,MAAK;UAC1BH,OAAO,GAAGI,SAAS;UACnBF,OAAO,CAACH,EAAE,EAAE,CAAC;QACf,CAAC,CAAC;MACJ,CAAC,CAAC;;IAGJ,OAAOC,OAAO;EAChB,CAAC;AACH;AAdAK,OAAA,CAAAP,QAAA,GAAAA,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAEA;AAEA,MAAMA,cAAc,GAAG,OAA+B;EACpDC,GAAG,EAAE,OAAO;EACZC,MAAM,EAAE,OAAO;EACfC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE;CACP,CAAC;AAEF;AACA;AACA,MAAMC,eAAe,GAAIC,QAAkB,IAA4C;EACrF,IAAIA,QAAQ,KAAK,OAAO,IAAIA,QAAQ,KAAK,OAAO,EAAE;IAChD,OAAO;MACLC,KAAK,EAAE,OAAO;MACdC,GAAG,EAAE;KACN;;EAGH,OAAO;IACLD,KAAK,EAAE,KAAK;IACZC,GAAG,EAAE;GACN;AACH,CAAC;AAED;;;;AAIO,MAAMC,uBAAuB,GAAIC,SAAoB,IAAmD;EAC7G,MAAM;IAAEC,IAAI;IAAEC,SAAS,EAAEC;EAAmB,CAAE,GAAGC,mDAAwB,CAACJ,SAAS,CAAC;EACpF,MAAMJ,QAAQ,GAAGN,cAAc,EAAE,CAACW,IAAI,CAAC;EACvC,MAAMC,SAAS,GAAGC,mBAAmB,IAAIR,eAAe,CAACC,QAAQ,CAAC,CAACO,mBAAmB,CAAC;EAEvF,OAAO;IAAEP,QAAQ;IAAEM;EAAS,CAAE;AAChC,CAAC;AANYG,+BAAuB","names":["getPositionMap","top","bottom","right","left","getAlignmentMap","position","start","end","fromFloatingUIPlacement","placement","side","alignment","floatingUIAlignment","parseFloatingUIPlacement_1","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/utils/fromFloatingUIPlacement.ts"],"sourcesContent":["import type { Side, Alignment as FloatingUIAlignment, Placement } from '@floating-ui/dom';\nimport type { Alignment, Position } from '../types';\nimport { parseFloatingUIPlacement } from './parseFloatingUIPlacement';\n\nconst getPositionMap = (): Record<Side, Position> => ({\n top: 'above',\n bottom: 'below',\n right: 'after',\n left: 'before',\n});\n\n// Floating UI automatically flips alignment\n// https://github.com/floating-ui/floating-ui/issues/1563\nconst getAlignmentMap = (position: Position): Record<FloatingUIAlignment, Alignment> => {\n if (position === 'above' || position === 'below') {\n return {\n start: 'start',\n end: 'end',\n };\n }\n\n return {\n start: 'top',\n end: 'bottom',\n };\n};\n\n/**\n * Maps Floating UI placement to positioning values\n * @see positioningHelper.test.ts for expected placement values\n */\nexport const fromFloatingUIPlacement = (placement: Placement): { position: Position; alignment?: Alignment } => {\n const { side, alignment: floatingUIAlignment } = parseFloatingUIPlacement(placement);\n const position = getPositionMap()[side];\n const alignment = floatingUIAlignment && getAlignmentMap(position)[floatingUIAlignment];\n\n return { position, alignment };\n};\n"]}
1
+ {"version":3,"names":["parseFloatingUIPlacement_1","require","getPositionMap","top","bottom","right","left","getAlignmentMap","position","start","end","fromFloatingUIPlacement","placement","side","alignment","floatingUIAlignment","parseFloatingUIPlacement","exports"],"sources":["../src/packages/react-components/react-positioning/src/utils/fromFloatingUIPlacement.ts"],"sourcesContent":["import type { Side, Alignment as FloatingUIAlignment, Placement } from '@floating-ui/dom';\nimport type { Alignment, Position } from '../types';\nimport { parseFloatingUIPlacement } from './parseFloatingUIPlacement';\n\nconst getPositionMap = (): Record<Side, Position> => ({\n top: 'above',\n bottom: 'below',\n right: 'after',\n left: 'before',\n});\n\n// Floating UI automatically flips alignment\n// https://github.com/floating-ui/floating-ui/issues/1563\nconst getAlignmentMap = (position: Position): Record<FloatingUIAlignment, Alignment> => {\n if (position === 'above' || position === 'below') {\n return {\n start: 'start',\n end: 'end',\n };\n }\n\n return {\n start: 'top',\n end: 'bottom',\n };\n};\n\n/**\n * Maps Floating UI placement to positioning values\n * @see positioningHelper.test.ts for expected placement values\n */\nexport const fromFloatingUIPlacement = (placement: Placement): { position: Position; alignment?: Alignment } => {\n const { side, alignment: floatingUIAlignment } = parseFloatingUIPlacement(placement);\n const position = getPositionMap()[side];\n const alignment = floatingUIAlignment && getAlignmentMap(position)[floatingUIAlignment];\n\n return { position, alignment };\n};\n"],"mappings":";;;;;;AAEA,MAAAA,0BAAA,gBAAAC,OAAA;AAEA,MAAMC,cAAc,GAAGA,CAAA,MAA+B;EACpDC,GAAG,EAAE,OAAO;EACZC,MAAM,EAAE,OAAO;EACfC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE;CACP,CAAC;AAEF;AACA;AACA,MAAMC,eAAe,GAAIC,QAAkB,IAA4C;EACrF,IAAIA,QAAQ,KAAK,OAAO,IAAIA,QAAQ,KAAK,OAAO,EAAE;IAChD,OAAO;MACLC,KAAK,EAAE,OAAO;MACdC,GAAG,EAAE;KACN;;EAGH,OAAO;IACLD,KAAK,EAAE,KAAK;IACZC,GAAG,EAAE;GACN;AACH,CAAC;AAED;;;;AAIO,MAAMC,uBAAuB,GAAIC,SAAoB,IAAmD;EAC7G,MAAM;IAAEC,IAAI;IAAEC,SAAS,EAAEC;EAAmB,CAAE,GAAGf,0BAAA,CAAAgB,wBAAwB,CAACJ,SAAS,CAAC;EACpF,MAAMJ,QAAQ,GAAGN,cAAc,EAAE,CAACW,IAAI,CAAC;EACvC,MAAMC,SAAS,GAAGC,mBAAmB,IAAIR,eAAe,CAACC,QAAQ,CAAC,CAACO,mBAAmB,CAAC;EAEvF,OAAO;IAAEP,QAAQ;IAAEM;EAAS,CAAE;AAChC,CAAC;AANYG,OAAA,CAAAN,uBAAuB,GAAAA,uBAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAEA;AAGA;;;AAGA,SAAgBA,WAAW,CAACC,OAA2B,EAAEC,QAAmB;EAC1E,IAAIA,QAAQ,KAAK,QAAQ,EAAE;IACzB,OAAOD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,aAAa,CAAEC,eAAe;;EAGhD,IAAIF,QAAQ,KAAK,iBAAiB,EAAE;IAClC,OAAO,mBAAmB;;EAG5B,IAAIA,QAAQ,KAAK,cAAc,EAAE;IAC/B,IAAIG,cAAc,GAA4BC,iCAAe,CAACL,OAAO,CAAC;IAEtE,IAAII,cAAc,CAACE,QAAQ,KAAK,MAAM,EAAE;MACtCF,cAAc,GAAGJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,aAAa,CAAEC,eAAe;;IAG1D,OAAOC,cAAc;;EAGvB,OAAOH,QAAQ;AACjB;AApBAM","names":["getBoundary","element","boundary","ownerDocument","documentElement","boundariesNode","getScrollParent_1","nodeName","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/utils/getBoundary.ts"],"sourcesContent":["import type { Boundary as FloatingUIBoundary } from '@floating-ui/dom';\n\nimport { getScrollParent } from './getScrollParent';\nimport type { Boundary } from '../types';\n\n/**\n * Allows to mimic a behavior from V1 of Popper and accept `window` and `scrollParent` as strings.\n */\nexport function getBoundary(element: HTMLElement | null, boundary?: Boundary): FloatingUIBoundary | undefined {\n if (boundary === 'window') {\n return element?.ownerDocument!.documentElement;\n }\n\n if (boundary === 'clippingParents') {\n return 'clippingAncestors';\n }\n\n if (boundary === 'scrollParent') {\n let boundariesNode: HTMLElement | undefined = getScrollParent(element);\n\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = element?.ownerDocument!.documentElement;\n }\n\n return boundariesNode;\n }\n\n return boundary;\n}\n"]}
1
+ {"version":3,"names":["getScrollParent_1","require","getBoundary","element","boundary","ownerDocument","documentElement","boundariesNode","getScrollParent","nodeName","exports"],"sources":["../src/packages/react-components/react-positioning/src/utils/getBoundary.ts"],"sourcesContent":["import type { Boundary as FloatingUIBoundary } from '@floating-ui/dom';\n\nimport { getScrollParent } from './getScrollParent';\nimport type { Boundary } from '../types';\n\n/**\n * Allows to mimic a behavior from V1 of Popper and accept `window` and `scrollParent` as strings.\n */\nexport function getBoundary(element: HTMLElement | null, boundary?: Boundary): FloatingUIBoundary | undefined {\n if (boundary === 'window') {\n return element?.ownerDocument!.documentElement;\n }\n\n if (boundary === 'clippingParents') {\n return 'clippingAncestors';\n }\n\n if (boundary === 'scrollParent') {\n let boundariesNode: HTMLElement | undefined = getScrollParent(element);\n\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = element?.ownerDocument!.documentElement;\n }\n\n return boundariesNode;\n }\n\n return boundary;\n}\n"],"mappings":";;;;;;AAEA,MAAAA,iBAAA,gBAAAC,OAAA;AAGA;;;AAGA,SAAgBC,WAAWA,CAACC,OAA2B,EAAEC,QAAmB;EAC1E,IAAIA,QAAQ,KAAK,QAAQ,EAAE;IACzB,OAAOD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,aAAa,CAAEC,eAAe;;EAGhD,IAAIF,QAAQ,KAAK,iBAAiB,EAAE;IAClC,OAAO,mBAAmB;;EAG5B,IAAIA,QAAQ,KAAK,cAAc,EAAE;IAC/B,IAAIG,cAAc,GAA4BP,iBAAA,CAAAQ,eAAe,CAACL,OAAO,CAAC;IAEtE,IAAII,cAAc,CAACE,QAAQ,KAAK,MAAM,EAAE;MACtCF,cAAc,GAAGJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEE,aAAa,CAAEC,eAAe;;IAG1D,OAAOC,cAAc;;EAGvB,OAAOH,QAAQ;AACjB;AApBAM,OAAA,CAAAR,WAAA,GAAAA,WAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAEA;AAgCA;;;;;AAKA,SAAgBA,mBAAmB,CACjCC,SAA6B;EAE7B,IAAI,CAACA,SAAS,EAAE;IACd,OAAOA,SAAS;;EAGlB,IAAI,OAAOA,SAAS,KAAK,QAAQ,IAAI,OAAOA,SAAS,KAAK,QAAQ,EAAE;IAClE,OAAOA,SAAS;;EAGlB,OAAO,CAAC;IAAEC,KAAK,EAAE;MAAEC,QAAQ;MAAEC;IAAS,CAAE;IAAEC;EAAS,CAAE,KAAI;IACvD,MAAM;MAAEC,QAAQ;MAAEC;IAAS,CAAE,GAAGC,iDAAuB,CAACH,SAAS,CAAC;IAClE,OAAOJ,SAAS,CAAC;MAAEQ,cAAc,EAAEN,QAAQ;MAAEO,UAAU,EAAEN,SAAS;MAAEE,QAAQ;MAAEC;IAAS,CAAE,CAAC;EAC5F,CAAC;AACH;AAfAI","names":["getFloatingUIOffset","rawOffset","rects","floating","reference","placement","position","alignment","fromFloatingUIPlacement_1","positionedRect","targetRect","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/utils/getFloatingUIOffset.ts"],"sourcesContent":["import type { Offset } from '../types';\nimport type { MiddlewareArguments } from '@floating-ui/dom';\nimport { fromFloatingUIPlacement } from './fromFloatingUIPlacement';\n/**\n * Type taken from Floating UI since they are not exported\n */\nexport type FloatingUIOffsetValue =\n | number\n | {\n /**\n * The axis that runs along the side of the floating element.\n * @default 0\n */\n mainAxis?: number;\n /**\n * The axis that runs along the alignment of the floating element.\n * @default 0\n */\n crossAxis?: number;\n /**\n * When set to a number, overrides the `crossAxis` value for aligned\n * (non-centered/base) placements and works logically. A positive number\n * will move the floating element in the direction of the opposite edge\n * to the one that is aligned, while a negative number the reverse.\n * @default null\n */\n alignmentAxis?: number | null;\n };\n\n/**\n * Type taken from Floating UI since they are not exported\n */\nexport type FloatingUIOffsetFunction = (args: MiddlewareArguments) => FloatingUIOffsetValue;\n\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 */\nexport function getFloatingUIOffset(\n rawOffset: Offset | undefined,\n): FloatingUIOffsetValue | FloatingUIOffsetFunction | undefined {\n if (!rawOffset) {\n return rawOffset;\n }\n\n if (typeof rawOffset === 'number' || typeof rawOffset === 'object') {\n return rawOffset;\n }\n\n return ({ rects: { floating, reference }, placement }) => {\n const { position, alignment } = fromFloatingUIPlacement(placement);\n return rawOffset({ positionedRect: floating, targetRect: reference, position, alignment });\n };\n}\n"]}
1
+ {"version":3,"names":["fromFloatingUIPlacement_1","require","getFloatingUIOffset","rawOffset","rects","floating","reference","placement","position","alignment","fromFloatingUIPlacement","positionedRect","targetRect","exports"],"sources":["../src/packages/react-components/react-positioning/src/utils/getFloatingUIOffset.ts"],"sourcesContent":["import type { Offset } from '../types';\nimport type { MiddlewareArguments } from '@floating-ui/dom';\nimport { fromFloatingUIPlacement } from './fromFloatingUIPlacement';\n/**\n * Type taken from Floating UI since they are not exported\n */\nexport type FloatingUIOffsetValue =\n | number\n | {\n /**\n * The axis that runs along the side of the floating element.\n * @default 0\n */\n mainAxis?: number;\n /**\n * The axis that runs along the alignment of the floating element.\n * @default 0\n */\n crossAxis?: number;\n /**\n * When set to a number, overrides the `crossAxis` value for aligned\n * (non-centered/base) placements and works logically. A positive number\n * will move the floating element in the direction of the opposite edge\n * to the one that is aligned, while a negative number the reverse.\n * @default null\n */\n alignmentAxis?: number | null;\n };\n\n/**\n * Type taken from Floating UI since they are not exported\n */\nexport type FloatingUIOffsetFunction = (args: MiddlewareArguments) => FloatingUIOffsetValue;\n\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 */\nexport function getFloatingUIOffset(\n rawOffset: Offset | undefined,\n): FloatingUIOffsetValue | FloatingUIOffsetFunction | undefined {\n if (!rawOffset) {\n return rawOffset;\n }\n\n if (typeof rawOffset === 'number' || typeof rawOffset === 'object') {\n return rawOffset;\n }\n\n return ({ rects: { floating, reference }, placement }) => {\n const { position, alignment } = fromFloatingUIPlacement(placement);\n return rawOffset({ positionedRect: floating, targetRect: reference, position, alignment });\n };\n}\n"],"mappings":";;;;;;AAEA,MAAAA,yBAAA,gBAAAC,OAAA;AAgCA;;;;;AAKA,SAAgBC,mBAAmBA,CACjCC,SAA6B;EAE7B,IAAI,CAACA,SAAS,EAAE;IACd,OAAOA,SAAS;;EAGlB,IAAI,OAAOA,SAAS,KAAK,QAAQ,IAAI,OAAOA,SAAS,KAAK,QAAQ,EAAE;IAClE,OAAOA,SA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romNode","elm","k","indexOf","Error","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/utils/getReactFiberFromNode.ts"],"sourcesContent":["import * as React from 'react';\n\n// ========================================================\n// react/packages/shared/ReactTypes.js\n// ========================================================\n\ntype ReactEventResponder<E, C> = {\n $$typeof: Symbol | number;\n displayName: string;\n targetEventTypes: null | string[];\n rootEventTypes: null | string[];\n getInitialState: null | ((props: Object) => Object);\n onEvent: null | ((event: E, context: C, props: Object, state: Object) => void);\n onRootEvent: null | ((event: E, context: C, props: Object, state: Object) => void);\n onMount: null | ((context: C, props: Object, state: Object) => void);\n onUnmount: null | ((context: C, props: Object, state: Object) => void);\n};\n\ntype ReactEventResponderInstance<E, C> = {\n fiber: Object;\n props: Object;\n responder: ReactEventResponder<E, C>;\n rootEventTypes: null | Set<string>;\n state: Object;\n};\n\n// ========================================================\n// react/packages/react-reconciler/src/ReactFiberHooks.js\n// ========================================================\n\nexport type HookType =\n | 'useState'\n | 'useReducer'\n | 'useContext'\n | 'useRef'\n | 'useEffect'\n | 'useLayoutEffect'\n | 'useCallback'\n | 'useMemo'\n | 'useImperativeHandle'\n | 'useDebugValue'\n | 'useResponder';\n\ntype ReactProviderType<T> = {\n $$typeof: Symbol | number;\n _context: ReactContext<T>;\n};\n\ntype ReactContext<T> = {\n $$typeof: Symbol | number;\n Consumer: ReactContext<T>;\n Provider: ReactProviderType<T>;\n\n _calculateChangedBits: ((a: T, b: T) => number) | null;\n\n _currentValue: T;\n _currentValue2: T;\n _threadCount: number;\n\n // DEV only\n _currentRenderer?: Object | null;\n _currentRenderer2?: Object | null;\n};\n\ntype ContextDependency<T> = {\n context: ReactContext<T>;\n observedBits: number;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n next: ContextDependency<any> | null;\n};\n\nenum WorkTag {\n FunctionComponent = 0,\n ClassComponent = 1,\n IndeterminateComponent = 2, // Before we know whether it is function or class\n HostRoot = 3, // Root of a host tree. Could be nested inside another node.\n HostPortal = 4, // A subtree. Could be an entry point to a different renderer.\n HostComponent = 5,\n HostText = 6,\n Fragment = 7,\n Mode = 8,\n ContextConsumer = 9,\n ContextProvider = 10,\n ForwardRef = 11,\n Profiler = 12,\n SuspenseComponent = 13,\n MemoComponent = 14,\n SimpleMemoComponent = 15,\n LazyComponent = 16,\n IncompleteClassComponent = 17,\n DehydratedFragment = 18,\n SuspenseListComponent = 19,\n FundamentalComponent = 20,\n ScopeComponent = 21,\n}\n\ntype Source = {\n fileName: string;\n lineNumber: number;\n};\n\ntype ExpirationTime = number;\n\ntype Dependencies = {\n expirationTime: ExpirationTime;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n firstContext: ContextDependency<any> | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n responders: Map<ReactEventResponder<any, any>, ReactEventResponderInstance<any, any>> | null;\n};\n\n// ========================================================\n// react/packages/react-reconciler/src/ReactFiber.js\n// ========================================================\n\n// A Fiber is work on a Component that needs to be done or was done. There can\n// be more than one per component.\n\nexport type Fiber = {\n // These first fields are conceptually members of an Instance. This used to\n // be split into a separate type and intersected with the other Fiber fields,\n // but until Flow fixes its intersection bugs, we've merged them into a\n // single type.\n\n // An Instance is shared between all versions of a component. We can easily\n // break this out into a separate object to avoid copying so much to the\n // alternate versions of the tree. We put this on a single object for now to\n // minimize the number of objects created during the initial render.\n\n // Tag identifying the type of fiber.\n tag: WorkTag;\n\n // Unique identifier of this child.\n key: null | string;\n\n // The value of element.type which is used to preserve the identity during\n // reconciliation of this child.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n elementType: any;\n\n // The resolved function/class/ associated with this fiber.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: any;\n\n // The local state associated with this fiber.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n stateNode: any;\n\n // Conceptual aliases\n // parent : Instance -> return The parent happens to be the same as the\n // return fiber since we've merged the fiber and instance.\n\n // Remaining fields belong to Fiber\n\n // The Fiber to return to after finishing processing this one.\n // This is effectively the parent, but there can be multiple parents (two)\n // so this is only the parent of the thing we're currently processing.\n // It is conceptually the same as the return address of a stack frame.\n return: Fiber | null;\n\n // Singly Linked List Tree Structure.\n child: Fiber | null;\n sibling: Fiber | null;\n index: number;\n\n // The ref last used to attach this node.\n // I'll avoid adding an owner field for prod and model that as functions.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref: React.Ref<any>;\n\n // Input is the data coming into process this fiber. Arguments. Props.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n pendingProps: any; // This type will be more specific once we overload the tag.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n memoizedProps: any; // The props used to create the output.\n\n // A queue of state updates and callbacks.\n // updateQueue: UpdateQueue<any> | null,\n\n // The state used to create the output\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n memoizedState: any;\n\n // Dependencies (contexts, events) for this fiber, if it has any\n dependencies: Dependencies | null;\n\n // // Bitfield that describes properties about the fiber and its subtree. E.g.\n // // the ConcurrentMode flag indicates whether the subtree should be async-by-\n // // default. When a fiber is created, it inherits the mode of its\n // // parent. Additional flags can be set at creation time, but after that the\n // // value should remain unchanged throughout the fiber's lifetime, particularly\n // // before its child fibers are created.\n // mode: TypeOfMode\n //\n // // Effect\n // effectTag: SideEffectTag\n\n // Singly linked list fast path to the next fiber with side-effects.\n nextEffect: Fiber | null;\n\n // The first and last fiber with side-effect within this subtree. This allows\n // us to reuse a slice of the linked list when we reuse the work done within\n // this fiber.\n firstEffect: Fiber | null;\n lastEffect: Fiber | null;\n\n // Represents a time in the future by which this work should be completed.\n // Does not include work found in its subtree.\n expirationTime: ExpirationTime;\n\n // This is used to quickly determine if a subtree has no pending changes.\n childExpirationTime: ExpirationTime;\n\n // This is a pooled version of a Fiber. Every fiber that gets updated will\n // eventually have a pair. There are cases when we can clean up pairs to save\n // memory if we need to.\n alternate: Fiber | null;\n\n // Time spent rendering this Fiber and its descendants for the current update.\n // This tells us how well the tree makes use of sCU for memoization.\n // It is reset to 0 each time we render and only updated when we don't bailout.\n // This field is only set when the enableProfilerTimer flag is enabled.\n actualDuration?: number;\n\n // If the Fiber is currently active in the \"render\" phase,\n // This marks the time at which the work began.\n // This field is only set when the enableProfilerTimer flag is enabled.\n actualStartTime?: number;\n\n // Duration of the most recent render time for this Fiber.\n // This value is not updated when we bailout for memoization purposes.\n // This field is only set when the enableProfilerTimer flag is enabled.\n selfBaseDuration?: number;\n\n // Sum of base times for all descendants of this Fiber.\n // This value bubbles up during the \"complete\" phase.\n // This field is only set when the enableProfilerTimer flag is enabled.\n treeBaseDuration?: number;\n\n // Conceptual aliases\n // workInProgress : Fiber -> alternate The alternate used for reuse happens\n // to be the same as work in progress.\n // __DEV__ only\n _debugID?: number;\n _debugSource?: Source | null;\n _debugOwner?: Fiber | null;\n _debugIsCurrentlyTiming?: boolean;\n _debugNeedsRemount?: boolean;\n\n // Used to verify that the order of hooks does not change between renders.\n _debugHookTypes?: HookType[] | null;\n};\n\nexport function getReactFiberFromNode(elm: Node | undefined): Fiber | null {\n if (!elm) {\n return null;\n }\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\n throw new Error('getReactFiber(): Failed to find a React Fiber on a node');\n}\n"]}
1
+ {"version":3,"names":["WorkTag","getReactFiberFromNode","elm","k","indexOf","Error","exports"],"sources":["../src/packages/react-components/react-positioning/src/utils/getReactFiberFromNode.ts"],"sourcesContent":["import * as React from 'react';\n\n// ========================================================\n// react/packages/shared/ReactTypes.js\n// ========================================================\n\ntype ReactEventResponder<E, C> = {\n $$typeof: Symbol | number;\n displayName: string;\n targetEventTypes: null | string[];\n rootEventTypes: null | string[];\n getInitialState: null | ((props: Object) => Object);\n onEvent: null | ((event: E, context: C, props: Object, state: Object) => void);\n onRootEvent: null | ((event: E, context: C, props: Object, state: Object) => void);\n onMount: null | ((context: C, props: Object, state: Object) => void);\n onUnmount: null | ((context: C, props: Object, state: Object) => void);\n};\n\ntype ReactEventResponderInstance<E, C> = {\n fiber: Object;\n props: Object;\n responder: ReactEventResponder<E, C>;\n rootEventTypes: null | Set<string>;\n state: Object;\n};\n\n// ========================================================\n// react/packages/react-reconciler/src/ReactFiberHooks.js\n// ========================================================\n\nexport type HookType =\n | 'useState'\n | 'useReducer'\n | 'useContext'\n | 'useRef'\n | 'useEffect'\n | 'useLayoutEffect'\n | 'useCallback'\n | 'useMemo'\n | 'useImperativeHandle'\n | 'useDebugValue'\n | 'useResponder';\n\ntype ReactProviderType<T> = {\n $$typeof: Symbol | number;\n _context: ReactContext<T>;\n};\n\ntype ReactContext<T> = {\n $$typeof: Symbol | number;\n Consumer: ReactContext<T>;\n Provider: ReactProviderType<T>;\n\n _calculateChangedBits: ((a: T, b: T) => number) | null;\n\n _currentValue: T;\n _currentValue2: T;\n _threadCount: number;\n\n // DEV only\n _currentRenderer?: Object | null;\n _currentRenderer2?: Object | null;\n};\n\ntype ContextDependency<T> = {\n context: ReactContext<T>;\n observedBits: number;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n next: ContextDependency<any> | null;\n};\n\nenum WorkTag {\n FunctionComponent = 0,\n ClassComponent = 1,\n IndeterminateComponent = 2, // Before we know whether it is function or class\n HostRoot = 3, // Root of a host tree. Could be nested inside another node.\n HostPortal = 4, // A subtree. Could be an entry point to a different renderer.\n HostComponent = 5,\n HostText = 6,\n Fragment = 7,\n Mode = 8,\n ContextConsumer = 9,\n ContextProvider = 10,\n ForwardRef = 11,\n Profiler = 12,\n SuspenseComponent = 13,\n MemoComponent = 14,\n SimpleMemoComponent = 15,\n LazyComponent = 16,\n IncompleteClassComponent = 17,\n DehydratedFragment = 18,\n SuspenseListComponent = 19,\n FundamentalComponent = 20,\n ScopeComponent = 21,\n}\n\ntype Source = {\n fileName: string;\n lineNumber: number;\n};\n\ntype ExpirationTime = number;\n\ntype Dependencies = {\n expirationTime: ExpirationTime;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n firstContext: ContextDependency<any> | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n responders: Map<ReactEventResponder<any, any>, ReactEventResponderInstance<any, any>> | null;\n};\n\n// ========================================================\n// react/packages/react-reconciler/src/ReactFiber.js\n// ========================================================\n\n// A Fiber is work on a Component that needs to be done or was done. There can\n// be more than one per component.\n\nexport type Fiber = {\n // These first fields are conceptually members of an Instance. This used to\n // be split into a separate type and intersected with the other Fiber fields,\n // but until Flow fixes its intersection bugs, we've merged them into a\n // single type.\n\n // An Instance is shared between all versions of a component. We can easily\n // break this out into a separate object to avoid copying so much to the\n // alternate versions of the tree. We put this on a single object for now to\n // minimize the number of objects created during the initial render.\n\n // Tag identifying the type of fiber.\n tag: WorkTag;\n\n // Unique identifier of this child.\n key: null | string;\n\n // The value of element.type which is used to preserve the identity during\n // reconciliation of this child.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n elementType: any;\n\n // The resolved function/class/ associated with this fiber.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: any;\n\n // The local state associated with this fiber.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n stateNode: any;\n\n // Conceptual aliases\n // parent : Instance -> return The parent happens to be the same as the\n // return fiber since we've merged the fiber and instance.\n\n // Remaining fields belong to Fiber\n\n // The Fiber to return to after finishing processing this one.\n // This is effectively the parent, but there can be multiple parents (two)\n // so this is only the parent of the thing we're currently processing.\n // It is conceptually the same as the return address of a stack frame.\n return: Fiber | null;\n\n // Singly Linked List Tree Structure.\n child: Fiber | null;\n sibling: Fiber | null;\n index: number;\n\n // The ref last used to attach this node.\n // I'll avoid adding an owner field for prod and model that as functions.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref: React.Ref<any>;\n\n // Input is the data coming into process this fiber. Arguments. Props.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n pendingProps: any; // This type will be more specific once we overload the tag.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n memoizedProps: any; // The props used to create the output.\n\n // A queue of state updates and callbacks.\n // updateQueue: UpdateQueue<any> | null,\n\n // The state used to create the output\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n memoizedState: any;\n\n // Dependencies (contexts, events) for this fiber, if it has any\n dependencies: Dependencies | null;\n\n // // Bitfield that describes properties about the fiber and its subtree. E.g.\n // // the ConcurrentMode flag indicates whether the subtree should be async-by-\n // // default. When a fiber is created, it inherits the mode of its\n // // parent. Additional flags can be set at creation time, but after that the\n // // value should remain unchanged throughout the fiber's lifetime, particularly\n // // before its child fibers are created.\n // mode: TypeOfMode\n //\n // // Effect\n // effectTag: SideEffectTag\n\n // Singly linked list fast path to the next fiber with side-effects.\n nextEffect: Fiber | null;\n\n // The first and last fiber with side-effect within this subtree. This allows\n // us to reuse a slice of the linked list when we reuse the work done within\n // this fiber.\n firstEffect: Fiber | null;\n lastEffect: Fiber | null;\n\n // Represents a time in the future by which this work should be completed.\n // Does not include work found in its subtree.\n expirationTime: ExpirationTime;\n\n // This is used to quickly determine if a subtree has no pending changes.\n childExpirationTime: ExpirationTime;\n\n // This is a pooled version of a Fiber. Every fiber that gets updated will\n // eventually have a pair. There are cases when we can clean up pairs to save\n // memory if we need to.\n alternate: Fiber | null;\n\n // Time spent rendering this Fiber and its descendants for the current update.\n // This tells us how well the tree makes use of sCU for memoization.\n // It is reset to 0 each time we render and only updated when we don't bailout.\n // This field is only set when the enableProfilerTimer flag is enabled.\n actualDuration?: number;\n\n // If the Fiber is currently active in the \"render\" phase,\n // This marks the time at which the work began.\n // This field is only set when the enableProfilerTimer flag is enabled.\n actualStartTime?: number;\n\n // Duration of the most recent render time for this Fiber.\n // This value is not updated when we bailout for memoization purposes.\n // This field is only set when the enableProfilerTimer flag is enabled.\n selfBaseDuration?: number;\n\n // Sum of base times for all descendants of this Fiber.\n // This value bubbles up during the \"complete\" phase.\n // This field is only set when the enableProfilerTimer flag is enabled.\n treeBaseDuration?: number;\n\n // Conceptual aliases\n // workInProgress : Fiber -> alternate The alternate used for reuse happens\n // to be the same as work in progress.\n // __DEV__ only\n _debugID?: number;\n _debugSource?: Source | null;\n _debugOwner?: Fiber | null;\n _debugIsCurrentlyTiming?: boolean;\n _debugNeedsRemount?: boolean;\n\n // Used to verify that the order of hooks does not change between renders.\n _debugHookTypes?: HookType[] | null;\n};\n\nexport function getReactFiberFromNode(elm: Node | undefined): Fiber | null {\n if (!elm) {\n return null;\n }\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\n throw new Error('getReactFiber(): Failed to find a React Fiber on a node');\n}\n"],"mappings":";;;;;;AAuEA,IAAKA,OAuBJ;AAvBD,WAAKA,OAAO;EACVA,OAAA,CAAAA,OAAA,gDAAqB;EACrBA,OAAA,CAAAA,OAAA,0CAAkB;EAClBA,OAAA,CAAAA,OAAA,0DAA0B;EAC1BA,OAAA,CAAAA,OAAA,8BAAY;EACZA,OAAA,CAAAA,OAAA,kCAAc;EACdA,OAAA,CAAAA,OAAA,wCAAiB;EACjBA,OAAA,CAAAA,OAAA,8BAAY;EACZA,OAAA,CAAAA,OAAA,8BAAY;EACZA,OAAA,CAAAA,OAAA,sBAAQ;EACRA,OAAA,CAAAA,OAAA,4CAAmB;EACnBA,OAAA,CAAAA,OAAA,6CAAoB;EACpBA,OAAA,CAAAA,OAAA,mCAAe;EACfA,OAAA,CAAAA,OAAA,+BAAa;EACbA,OAAA,CAAAA,OAAA,iDAAsB;EACtBA,OAAA,CAAAA,OAAA,yCAAkB;EAClBA,OAAA,CAAAA,OAAA,qDAAwB;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iB;EAClF;EACA,MAAME,UAAU,GAAGF,IAAI,IAAII,qBAAa,CAACJ,IAAmB,CAAC;EAC7D;EACA,IAAI,CAACE,UAAU,EAAE,OAAOU,QAAQ,CAACC,IAAI;EAErC,QAAQX,UAAU,CAACD,QAAQ;IACzB,KAAK,MAAM;IACX,KAAK,MAAM;MACT,OAAOC,UAAU,CAACM,aAAc,CAACK,IAAI;IACvC,KAAK,WAAW;MACd,OAASX,UAAmC,CAACW,IAAI;EAAC;EAGtD;EACA,MAAM;IAAEC,QAAQ;IAAEC,SAAS;IAAEC;EAAS,CAAE,GAAGX,wBAAwB,CAACH,UAAU,CAAC;EAC/E,IAAI,uBAAuB,CAACe,IAAI,CAACH,QAAS,GAAGE,SAAU,GAAGD,SAAS,CAAC,EAAE;IACpE,OAAOb,UAAU;;EAGnB,OAAOE,uBAAe,CAACF,UAAU,CAAC;AACpC,CAAC;AArBYE,uBAAe;AAuBrB,MAAMc,eAAe,GAAIlB,IAAmC,IAAa;;EAC9E,MAAMmB,mBAAmB,GAAgBf,uBAAe,CAACJ,IAAI,CAAC;EAC9D,OAAOmB,mBAAmB,GAAGA,mBAAmB,MAAK,yBAAmB,CAACX,aAAa,0CAAEK,IAAI,IAAG,KAAK;AACtG,CAAC;AAHYT,uBAAe","names":["getParentNode","node","nodeName","parentNode","host","exports","getStyleComputedProperty","nodeType","window","ownerDocument","defaultView","getComputedStyle","getScrollParent","document","body","overflow","overflowX","overflowY","test","hasScrollParent","scrollParentElement"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/utils/getScrollParent.ts"],"sourcesContent":["/**\n * Returns the parent node or the host of the node argument.\n * @param node - DOM node.\n * @returns - parent DOM node.\n */\nexport const getParentNode = (node: HTMLElement): HTMLElement => {\n if (node.nodeName === 'HTML') {\n return node;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return node.parentNode || (node as any).host;\n};\n\n/**\n * Returns CSS styles of the given node.\n * @param node - DOM node.\n * @returns - CSS styles.\n */\nconst getStyleComputedProperty = (node: HTMLElement): Partial<CSSStyleDeclaration> => {\n if (node.nodeType !== 1) {\n return {};\n }\n\n const window = node.ownerDocument?.defaultView;\n return window!.getComputedStyle(node, null);\n};\n\n/**\n * Returns the first scrollable parent of the given element.\n * @param node - DOM node.\n * @returns - the first scrollable parent.\n */\nexport const getScrollParent = (node: Document | HTMLElement | null): HTMLElement => {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n const parentNode = node && getParentNode(node as HTMLElement);\n // eslint-disable-next-line\n if (!parentNode) return document.body;\n\n switch (parentNode.nodeName) {\n case 'HTML':\n case 'BODY':\n return parentNode.ownerDocument!.body;\n case '#document':\n return ((parentNode as unknown) as Document).body;\n }\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\n return getScrollParent(parentNode);\n};\n\nexport const hasScrollParent = (node: Document | HTMLElement | null): boolean => {\n const scrollParentElement: HTMLElement = getScrollParent(node);\n return scrollParentElement ? scrollParentElement !== scrollParentElement.ownerDocument?.body : false;\n};\n"]}
1
+ {"version":3,"names":["getParentNode","node","nodeName","parentNode","host","exports","getStyleComputedProperty","nodeType","window","_a","ownerDocument","defaultView","getComputedStyle","getScrollParent","document","body","overflow","overflowX","overflowY","test","hasScrollParent","scrollParentElement"],"sources":["../src/packages/react-components/react-positioning/src/utils/getScrollParent.ts"],"sourcesContent":["/**\n * Returns the parent node or the host of the node argument.\n * @param node - DOM node.\n * @returns - parent DOM node.\n */\nexport const getParentNode = (node: HTMLElement): HTMLElement => {\n if (node.nodeName === 'HTML') {\n return node;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return node.parentNode || (node as any).host;\n};\n\n/**\n * Returns CSS styles of the given node.\n * @param node - DOM node.\n * @returns - CSS styles.\n */\nconst getStyleComputedProperty = (node: HTMLElement): Partial<CSSStyleDeclaration> => {\n if (node.nodeType !== 1) {\n return {};\n }\n\n const window = node.ownerDocument?.defaultView;\n return window!.getComputedStyle(node, null);\n};\n\n/**\n * Returns the first scrollable parent of the given element.\n * @param node - DOM node.\n * @returns - the first scrollable parent.\n */\nexport const getScrollParent = (node: Document | HTMLElement | null): HTMLElement => {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n const parentNode = node && getParentNode(node as HTMLElement);\n // eslint-disable-next-line\n if (!parentNode) return document.body;\n\n switch (parentNode.nodeName) {\n case 'HTML':\n case 'BODY':\n return parentNode.ownerDocument!.body;\n case '#document':\n return (parentNode as unknown as Document).body;\n }\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\n return getScrollParent(parentNode);\n};\n\nexport const hasScrollParent = (node: Document | HTMLElement | null): boolean => {\n const scrollParentElement: HTMLElement = getScrollParent(node);\n return scrollParentElement ? scrollParentElement !== scrollParentElement.ownerDocument?.body : false;\n};\n"],"mappings":";;;;;;AAAA;;;;;AAKO,MAAMA,aAAa,GAAIC,IAAiB,IAAiB;EAC9D,IAAIA,IAAI,CAACC,QAAQ,KAAK,MAAM,EAAE;IAC5B,OAAOD,IAAI;;EAEb;EACA,OAAOA,IAAI,CAACE,UAAU,IAAKF,IAAY,CAACG,IAAI;AAC9C,CAAC;AANYC,OAAA,CAAAL,aAAa,GAAAA,aAAA;AAQ1B;;;;;AAKA,MAAMM,wBAAwB,GAAIL,IAAiB,IAAkC;;EACnF,IAAIA,IAAI,CAACM,QAAQ,KAAK,CAAC,EAAE;IACvB,OAAO,EAAE;;EAGX,MAAMC,MAAM,GAAG,CAAAC,EAAA,GAAAR,IAAI,CAACS,aAAa,cAAAD,EAAA,uBAAAA,EAAA,CAAEE,WAAW;EAC9C,OAAOH,MAAO,CAACI,gBAAgB,CAACX,IAAI,EAAE,IAAI,CAAC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QAAQ,KAAK,QAAQ,IAC1BF,IAAI,CAACE,QAAQ,KAAK,UAAU;EAE9B,IAAID,sBAAsB,EAAE;IAC1B,OAAO,CAAC,EAAC,mDAAqB,CAACD,IAAI,CAAC,0CAAEG,YAAY,CAACC,SAAS;;EAG9D,OAAO,KAAK;AACd;AAEA,SAAgBC,kBAAkB,CAACL,IAAU;EAC3C,OAAOD,gBAAgB,CAACC,IAAI,CAAC,GAAGM,UAAU,CAACC,aAAa,GAAGD,UAAU,CAACE,WAAW;AACnF;AAFAC","names":["hasAutofocusProp","node","isAutoFocusableElement","nodeName","pendingProps","autoFocus","hasAutofocusFilter","NodeFilter","FILTER_ACCEPT","FILTER_SKIP","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/utils/hasAutoFocusFilter.ts"],"sourcesContent":["//\n// Dev utils to detect if nodes have \"autoFocus\" props.\n//\n\nimport { getReactFiberFromNode } from './getReactFiberFromNode';\n\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 */\nfunction hasAutofocusProp(node: Node): boolean {\n // https://github.com/facebook/react/blob/848bb2426e44606e0a55dfe44c7b3ece33772485/packages/react-dom/src/client/ReactDOMHostConfig.js#L157-L166\n const isAutoFocusableElement =\n node.nodeName === 'BUTTON' ||\n node.nodeName === 'INPUT' ||\n node.nodeName === 'SELECT' ||\n node.nodeName === 'TEXTAREA';\n\n if (isAutoFocusableElement) {\n return !!getReactFiberFromNode(node)?.pendingProps.autoFocus;\n }\n\n return false;\n}\n\nexport function hasAutofocusFilter(node: Node) {\n return hasAutofocusProp(node) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n}\n"]}
1
+ {"version":3,"names":["getReactFiberFromNode_1","require","hasAutofocusProp","node","isAutoFocusableElement","nodeName","_a","getReactFiberFromNode","pendingProps","autoFocus","hasAutofocusFilter","NodeFilter","FILTER_ACCEPT","FILTER_SKIP","exports"],"sources":["../src/packages/react-components/react-positioning/src/utils/hasAutoFocusFilter.ts"],"sourcesContent":["//\n// Dev utils to detect if nodes have \"autoFocus\" props.\n//\n\nimport { getReactFiberFromNode } from './getReactFiberFromNode';\n\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 */\nfunction hasAutofocusProp(node: Node): boolean {\n // https://github.com/facebook/react/blob/848bb2426e44606e0a55dfe44c7b3ece33772485/packages/react-dom/src/client/ReactDOMHostConfig.js#L157-L166\n const isAutoFocusableElement =\n node.nodeName === 'BUTTON' ||\n node.nodeName === 'INPUT' ||\n node.nodeName === 'SELECT' ||\n node.nodeName === 'TEXTAREA';\n\n if (isAutoFocusableElement) {\n return !!getReactFiberFromNode(node)?.pendingProps.autoFocus;\n }\n\n return false;\n}\n\nexport function hasAutofocusFilter(node: Node) {\n return hasAutofocusProp(node) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n}\n"],"mappings":";;AAAA;AACA;AACA;;;;;AAEA,MAAAA,uBAAA,gBAAAC,OAAA;AAEA;;;;;;AAMA,SAASC,gBAAgBA,CAACC,IAAU;;EAClC;EACA,MAAMC,sBAAsB,GAC1BD,IAAI,CAACE,QAAQ,KAAK,QAAQ,IAC1BF,IAAI,CAACE,QAAQ,KAAK,OAAO,IACzBF,IAAI,CAACE,QAAQ,KAAK,QAAQ,IAC1BF,IAAI,CAACE,QAAQ,KAAK,UAAU;EAE9B,IAAID,sBAAsB,EAAE;IAC1B,OAAO,CAAC,EAAC,CAAAE,EAAA,GAAAN,uBAAA,CAAAO,qBAAqB,CAACJ,IAAI,CAAC,cAAAG,EAAA,uBAAAA,EAAA,CAAEE,YAAY,CAACC,SAAS;;EAG9D,OAAO,KAAK;AACd;AAEA,SAAgBC,kBAAkBA,CAACP,IAAU;EAC3C,OAAOD,gBAAgB,CAACC,IAAI,CAAC,GAAGQ,UAAU,CAACC,aAAa,GAAGD,UAAU,CAACE,WAAW;AACnF;AAFAC,OAAA,CAAAJ,kBAAA,GAAAA,kBAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/utils/index.ts"],"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';\n"]}
1
+ {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-positioning/src/utils/index.ts"],"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';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,gCAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,mBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,6BAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,u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EAC1F,IAAI,OAAOG,MAAM,KAAK,QAAQ,EAAE;IAC9B,OAAO;MAAEC,QAAQ,EAAED,MAAM,GAAGH;IAAW,CAAE;;EAG3C,OAAO;IAAE,GAAGG,MAAM;IAAEC,QAAQ,EAAE,CAAC,YAAM,CAACA,QAAQ,mCAAI,CAAC,IAAIJ;EAAW,CAAE;AACtE,CAAC","names":["mergeArrowOffset","userOffset","arrowHeight","addArrowOffset","offsetParams","offset","mainAxis","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/utils/mergeArrowOffset.ts"],"sourcesContent":["import type { Offset, OffsetObject } from '../types';\n\n/**\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 */\nexport function mergeArrowOffset(userOffset: Offset | undefined | null, arrowHeight: number): Offset {\n if (typeof userOffset === 'number') {\n return addArrowOffset(userOffset, arrowHeight);\n }\n\n if (typeof userOffset === 'object' && userOffset !== null) {\n return addArrowOffset(userOffset, arrowHeight);\n }\n\n if (typeof userOffset === 'function') {\n return offsetParams => {\n const offset = userOffset(offsetParams);\n return addArrowOffset(offset, arrowHeight);\n };\n }\n\n return { mainAxis: arrowHeight };\n}\n\nconst addArrowOffset = (offset: OffsetObject | number, arrowHeight: number): OffsetObject => {\n if (typeof offset === 'number') {\n return { mainAxis: offset + arrowHeight };\n }\n\n return { ...offset, mainAxis: (offset.mainAxis ?? 0) + arrowHeight };\n};\n"]}
1
+ {"version":3,"names":["mergeArrowOffset","userOffset","arrowHeight","addArrowOffset","offsetParams","offset","mainAxis","exports","_a"],"sources":["../src/packages/react-components/react-positioning/src/utils/mergeArrowOffset.ts"],"sourcesContent":["import type { Offset, OffsetObject } from '../types';\n\n/**\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 */\nexport function mergeArrowOffset(userOffset: Offset | undefined | null, arrowHeight: number): Offset {\n if (typeof userOffset === 'number') {\n return addArrowOffset(userOffset, arrowHeight);\n }\n\n if (typeof userOffset === 'object' && userOffset !== null) {\n return addArrowOffset(userOffset, arrowHeight);\n }\n\n if (typeof userOffset === 'function') {\n return offsetParams => {\n const offset = userOffset(offsetParams);\n return addArrowOffset(offset, arrowHeight);\n };\n }\n\n return { mainAxis: arrowHeight };\n}\n\nconst addArrowOffset = (offset: OffsetObject | number, arrowHeight: number): OffsetObject => {\n if (typeof offset === 'number') {\n return { mainAxis: offset + arrowHeight };\n }\n\n return { ...offset, mainAxis: (offset.mainAxis ?? 0) + arrowHeight };\n};\n"],"mappings":";;;;;;AAEA;;;;;;;;;AASA,SAAgBA,gBAAgBA,CAACC,UAAqC,EAAEC,WAAmB;EACzF,IAAI,OAAOD,UAAU,KAAK,QAAQ,EAAE;IAClC,OAAOE,cAAc,CAACF,UAAU,EAAEC,WAAW,CAAC;;EAGhD,IAAI,OAAOD,UAAU,KAAK,QAAQ,IAAIA,UAAU,KAAK,IAAI,EAAE;IACzD,OAAOE,cAAc,CAACF,UAAU,EAAEC,WAAW,CAAC;;EAGhD,IAAI,OAAOD,UAAU,KAAK,UAAU,EAAE;IACpC,OAAOG,YAAY,IAAG;MACpB,MAAMC,MAAM,GAAGJ,UAAU,CAACG,YAAY,CAAC;MACvC,OAAOD,cAAc,CAACE,MAAM,EAAEH,WAAW,CAAC;IAC5C,CAAC;;EAGH,OAAO;IAAEI,QAAQ,EAAEJ;EAAW,CAAE;AAClC;AAjBAK,OAAA,CAAAP,gBAAA,GAAAA,gBAAA;AAmBA,MAAMG,cAAc,GAAGA,CAACE,MAA6B,EAAEH,WAAmB,KAAkB;;EAC1F,IAAI,OAAOG,MAAM,KAAK,QAAQ,EAAE;IAC9B,OAAO;MAAEC,QAAQ,EAAED,MAAM,GAAGH;IAAW,CAAE;;EAG3C,OAAO;IAAE,GAAGG,MAAM;IAAEC,QAAQ,EAAE,CAAC,CAAAE,EAAA,GAAAH,MAAM,CAACC,QAAQ,cAAAE,EAAA,cAAAA,EAAA,GAAI,CAAC,IAAIN;EAAW,CAAE;AACtE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAEA;;;;;;AAMA,SAAgBA,wBAAwB,CAACC,SAAoB;EAC3D,MAAMC,MAAM,GAAGD,SAAS,CAACE,KAAK,CAAC,GAAG,CAAC;EACnC,OAAO;IACLC,IAAI,EAAEF,MAAM,CAAC,CAAC,CAAS;IACvBG,SAAS,EAAEH,MAAM,CAAC,CAAC;GACpB;AACH;AANAI","names":["parseFloatingUIPlacement","placement","tokens","split","side","alignment","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/utils/parseFloatingUIPlacement.ts"],"sourcesContent":["import type { Side, Placement, Alignment } from '@floating-ui/dom';\n\n/**\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 */\nexport function parseFloatingUIPlacement(placement: Placement): { side: Side; alignment: Alignment } {\n const tokens = placement.split('-');\n return {\n side: tokens[0] as Side,\n alignment: tokens[1] as Alignment,\n };\n}\n"]}
1
+ {"version":3,"names":["parseFloatingUIPlacement","placement","tokens","split","side","alignment","exports"],"sources":["../src/packages/react-components/react-positioning/src/utils/parseFloatingUIPlacement.ts"],"sourcesContent":["import type { Side, Placement, Alignment } from '@floating-ui/dom';\n\n/**\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 */\nexport function parseFloatingUIPlacement(placement: Placement): { side: Side; alignment: Alignment } {\n const tokens = placement.split('-');\n return {\n side: tokens[0] as Side,\n alignment: tokens[1] as Alignment,\n };\n}\n"],"mappings":";;;;;;AAEA;;;;;;AA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CACrD;AAED,SAAgBI,2BAA2B,CACzCC,SAAkD;EAElD,IAAIA,SAAS,KAAKC,SAAS,IAAID,SAAS,KAAK,IAAI,EAAE;IACjD,OAAO,EAAE;;EAGX,IAAI,OAAOA,SAAS,KAAK,QAAQ,EAAE;IACjC,OAAOR,eAAe,CAACQ,SAAS,CAAC;;EAGnC,OAAOA,SAAuC;AAChD;AAZAE","names":["shorthandLookup","above","position","align","below","before","after","resolvePositioningShorthand","shorthand","undefined","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/utils/resolvePositioningShorthand.ts"],"sourcesContent":["import type { PositioningShorthand, PositioningShorthandValue, PositioningProps } from '../types';\n\n// Look up table for shorthand to avoid parsing strings\nconst shorthandLookup: Record<PositioningShorthandValue, Pick<PositioningProps, 'position' | 'align'>> = {\n above: { position: 'above', align: 'center' },\n 'above-start': { position: 'above', align: 'start' },\n 'above-end': { position: 'above', align: 'end' },\n below: { position: 'below', align: 'center' },\n 'below-start': { position: 'below', align: 'start' },\n 'below-end': { position: 'below', align: 'end' },\n before: { position: 'before', align: 'center' },\n 'before-top': { position: 'before', align: 'top' },\n 'before-bottom': { position: 'before', align: 'bottom' },\n after: { position: 'after', align: 'center' },\n 'after-top': { position: 'after', align: 'top' },\n 'after-bottom': { position: 'after', align: 'bottom' },\n};\n\nexport function resolvePositioningShorthand(\n shorthand: PositioningShorthand | undefined | null,\n): Readonly<PositioningProps> {\n if (shorthand === undefined || shorthand === null) {\n return {};\n }\n\n if (typeof shorthand === 'string') {\n return shorthandLookup[shorthand];\n }\n\n return shorthand as Readonly<PositioningProps>;\n}\n"]}
1
+ {"version":3,"names":["shorthandLookup","above","position","align","below","before","after","resolvePositioningShorthand","shorthand","undefined","exports"],"sources":["../src/packages/react-components/react-positioning/src/utils/resolvePositioningShorthand.ts"],"sourcesContent":["import type { PositioningShorthand, PositioningShorthandValue, PositioningProps } from '../types';\n\n// Look up table for shorthand to avoid parsing strings\nconst shorthandLookup: Record<PositioningShorthandValue, Pick<PositioningProps, 'position' | 'align'>> = {\n above: { position: 'above', align: 'center' },\n 'above-start': { position: 'above', align: 'start' },\n 'above-end': { position: 'above', align: 'end' },\n below: { position: 'below', align: 'center' },\n 'below-start': { position: 'below', align: 'start' },\n 'below-end': { position: 'below', align: 'end' },\n before: { position: 'before', align: 'center' },\n 'before-top': { position: 'before', align: 'top' },\n 'before-bottom': { position: 'before', align: 'bottom' },\n after: { position: 'after', align: 'center' },\n 'after-top': { position: 'after', align: 'top' },\n 'after-bottom': { position: 'after', align: 'bottom' },\n};\n\nexport function resolvePositioningShorthand(\n shorthand: PositioningShorthand | undefined | null,\n): Readonly<PositioningProps> {\n if (shorthand === undefined || shorthand === null) {\n return {};\n }\n\n if (typeof shorthand === 'string') {\n return shorthandLookup[shorthand];\n }\n\n return shorthand as Readonly<PositioningProps>;\n}\n"],"mappings":";;;;;;AAEA;AACA,MAAMA,eAAe,GAAoF;EACvGC,KAAK,EAAE;IAAEC,QAAQ,EAAE,OAAO;IAAEC,KAAK,EAAE;EAAQ,CAAE;EAC7C,aAAa,EAAE;IAAED,QAAQ,EAAE,OAAO;IAAEC,KAAK,EAAE;EAAO,CAAE;EACpD,WAAW,EAAE;IAAED,QAAQ,EAAE,OAAO;IAAEC,KAAK,EAAE;EAAK,CAAE;EAChDC,KAAK,EAAE;IAAEF,QAAQ,EAAE,OAAO;IAAEC,KAAK,EAAE;EAAQ,CAAE;EAC7C,aAAa,EAAE;IAAED,QAAQ,EAAE,OAAO;IAAEC,KAAK,EAAE;EAAO,CAAE;EACpD,WAAW,EAAE;IAAED,QAAQ,EAAE,OAAO;IAAEC,KAAK,EAAE;EAAK,CAAE;EAChDE,MAAM,EAAE;IAAEH,QAAQ,EAAE,QAAQ;IAAEC,KAAK,EAAE;EAAQ,CAAE;EAC/C,YAAY,EAAE;IAAED,QAAQ,EAAE,QAAQ;IAAEC,KAAK,EAAE;EAAK,CAAE;EAClD,eAAe,EAAE;IAAED,QAAQ,EAAE,QAAQ;IAAEC,KAAK,EAAE;EAAQ,CAAE;EACxDG,KAAK,EAAE;IAAEJ,QAAQ,EAAE,OAAO;IAAEC,KAAK,EAAE;EAAQ,CAAE;EAC7C,WAAW,EAAE;IAAED,QAAQ,EAAE,OAAO;IAAEC,KAAK,EAAE;EAAK,CAAE;EAChD,cAAc,EAAE;IAAED,QAAQ,EAAE,OAAO;IAAEC,KAAK,EAAE;EAAQ;CACrD;AAED,SAAgBI,2BAA2BA,CACzCC,SAAkD;EAElD,IAAIA,SAAS,KAAKC,SAAS,IAAID,SAAS,KAAK,IAAI,EAAE;IACjD,OAAO,EAAE;;EAGX,IAAI,OAAOA,SAAS,KAAK,QAAQ,EAAE;IACjC,OAAOR,eAAe,CAACQ,SAAS,CAAC;;EAGnC,OAAOA,SAAuC;AAChD;AAZAE,OAAA,CAAAH,2BAAA,GAAAA,2BAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAGA,SAAgBA,mBAAmB,CACjCC,OAAmE,EACnEC,KAAc;EAEd,IAAI,OAAOD,OAAO,KAAK,QAAQ,EAAE;IAC/B,OAAOA,OAAO;;EAGhB,MAAM;IAAEE,KAAK;IAAEC,GAAG;IAAE,GAAGC;EAAe,CAAE,GAAGJ,OAAO;EAElD,MAAMK,aAAa,GAAwBD,eAAe;EAE1D,MAAME,IAAI,GAAGL,KAAK,GAAG,KAAK,GAAG,OAAO;EACpC,MAAMM,KAAK,GAAGN,KAAK,GAAG,OAAO,GAAG,KAAK;EAErC;EACA;EACA,IAAID,OAAO,CAACM,IAAI,CAAC,EAAE;IACjBD,aAAa,CAACC,IAAI,GAAGN,OAAO,CAACM,IAAI,CAAC;;EAGpC,IAAIN,OAAO,CAACO,KAAK,CAAC,EAAE;IAClBF,aAAa,CAACE,KAAK,GAAGP,OAAO,CAACO,KAAK,CAAC;;EAGtC,OAAOF,aAAa;AACtB;AA1BAG","names":["toFloatingUIPadding","padding","isRtl","start","end","verticalPadding","paddingObject","left","right","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/utils/toFloatingUIPadding.ts"],"sourcesContent":["import type { SideObject } from '@floating-ui/dom';\nimport { PositioningOptions } from '../types';\n\nexport function toFloatingUIPadding(\n padding: NonNullable<PositioningOptions['overflowBoundaryPadding']>,\n isRtl: boolean,\n): number | Partial<SideObject> {\n if (typeof padding === 'number') {\n return padding;\n }\n\n const { start, end, ...verticalPadding } = padding;\n\n const paddingObject: Partial<SideObject> = verticalPadding;\n\n const left = isRtl ? 'end' : 'start';\n const right = isRtl ? 'start' : 'end';\n\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\n if (padding[right]) {\n paddingObject.right = padding[right];\n }\n\n return paddingObject;\n}\n"]}
1
+ {"version":3,"names":["toFloatingUIPadding","padding","isRtl","start","end","verticalPadding","paddingObject","left","right","exports"],"sources":["../src/packages/react-components/react-positioning/src/utils/toFloatingUIPadding.ts"],"sourcesContent":["import type { SideObject } from '@floating-ui/dom';\nimport { PositioningOptions } from '../types';\n\nexport function toFloatingUIPadding(\n padding: NonNullable<PositioningOptions['overflowBoundaryPadding']>,\n isRtl: boolean,\n): number | Partial<SideObject> {\n if (typeof padding === 'number') {\n return padding;\n }\n\n const { start, end, ...verticalPadding } = padding;\n\n const paddingObject: Partial<SideObject> = verticalPadding;\n\n const left = isRtl ? 'end' : 'start';\n const right = isRtl ? 'start' : 'end';\n\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\n if (padding[right]) {\n paddingObject.right = padding[right];\n }\n\n return paddingObject;\n}\n"],"mappings":";;;;;;AAGA,SAAgBA,mBAAmBA,CACjCC,OAAmE,EACnEC,KAAc;EAEd,IAAI,OAAOD,OAAO,KAAK,QAAQ,EAAE;IAC/B,OAAOA,OAAO;;EAGhB,MAAM;IAAEE,KAAK;IAAEC,GAAG;IAAE,GAAGC;EAAe,CA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,KAA2B;EACpH,MAAMoB,SAAS,GAAGR,mBAAmB,CAACO,QAAQ,EAAED,KAAK,CAAC,GAAG,QAAQ,GAAGA,KAAK;EAEzE,MAAMG,gBAAgB,GAAGF,QAAQ,IAAIpB,cAAc,CAACC,GAAG,CAAC,CAACmB,QAAQ,CAAC;EAClE,MAAMG,iBAAiB,GAAGF,SAAS,IAAIf,eAAe,EAAE,CAACe,SAAS,CAAC;EAEnE,IAAIC,gBAAgB,IAAIC,iBAAiB,EAAE;IACzC,OAAO,GAAGD,gBAAgB,IAAIC,iBAAiB,EAAe;;EAGhE,OAAOD,gBAAgB;AACzB,CAAC;AAXYE,6BAAqB","names":["getPositionMap","rtl","above","below","before","after","getAlignmentMap","start","end","top","bottom","center","undefined","shouldAlignToCenter","p","a","positionedVertically","alignedVertically","toFloatingUIPlacement","align","position","alignment","computedPosition","computedAlignment","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/utils/toFloatingUIPlacement.ts"],"sourcesContent":["import type { Placement, Side, Alignment as FloatingUIAlignment } from '@floating-ui/dom';\nimport type { Alignment, Position } from '../types';\n\ntype PlacementPosition = Side;\ntype PlacementAlign = FloatingUIAlignment;\n\nconst getPositionMap = (rtl?: boolean): Record<Position, PlacementPosition> => ({\n above: 'top',\n below: 'bottom',\n before: rtl ? 'right' : 'left',\n after: rtl ? 'left' : 'right',\n});\n\n// Floating UI automatically flips alignment\n// https://github.com/floating-ui/floating-ui/issues/1563\nconst getAlignmentMap = (): Record<Alignment, PlacementAlign | undefined> => ({\n start: 'start',\n end: 'end',\n top: 'start',\n bottom: 'end',\n center: undefined,\n});\n\nconst shouldAlignToCenter = (p?: Position, a?: Alignment): boolean => {\n const positionedVertically = p === 'above' || p === 'below';\n const alignedVertically = a === 'top' || a === 'bottom';\n\n return (positionedVertically && alignedVertically) || (!positionedVertically && !alignedVertically);\n};\n\n/**\n * Maps internal positioning values to Floating UI placement\n * @see positioningHelper.test.ts for expected placement values\n */\nexport const toFloatingUIPlacement = (align?: Alignment, position?: Position, rtl?: boolean): Placement | undefined => {\n const alignment = shouldAlignToCenter(position, align) ? 'center' : align;\n\n const computedPosition = position && getPositionMap(rtl)[position];\n const computedAlignment = alignment && getAlignmentMap()[alignment];\n\n if (computedPosition && computedAlignment) {\n return `${computedPosition}-${computedAlignment}` as Placement;\n }\n\n return computedPosition;\n};\n"]}
1
+ {"version":3,"names":["getPositionMap","rtl","above","below","before","after","getAlignmentMap","start","end","top","bottom","center","undefined","shouldAlignToCenter","p","a","positionedVertically","alignedVertically","toFloatingUIPlacement","align","position","alignment","computedPosition","computedAlignment","exports"],"sources":["../src/packages/react-components/react-positioning/src/utils/toFloatingUIPlacement.ts"],"sourcesContent":["import type { Placement, Side, Alignment as FloatingUIAlignment } from '@floating-ui/dom';\nimport type { Alignment, Position } from '../types';\n\ntype PlacementPosition = Side;\ntype PlacementAlign = FloatingUIAlignment;\n\nconst getPositionMap = (rtl?: boolean): Record<Position, PlacementPosition> => ({\n above: 'top',\n below: 'bottom',\n before: rtl ? 'right' : 'left',\n after: rtl ? 'left' : 'right',\n});\n\n// Floating UI automatically flips alignment\n// https://github.com/floating-ui/floating-ui/issues/1563\nconst getAlignmentMap = (): Record<Alignment, PlacementAlign | undefined> => ({\n start: 'start',\n end: 'end',\n top: 'start',\n bottom: 'end',\n center: undefined,\n});\n\nconst shouldAlignToCenter = (p?: Position, a?: Alignment): boolean => {\n const positionedVertically = p === 'above' || p === 'below';\n const alignedVertically = a === 'top' || a === 'bottom';\n\n return (positionedVertically && alignedVertically) || (!positionedVertically && !alignedVertically);\n};\n\n/**\n * Maps internal positioning values to Floating UI placement\n * @see positioningHelper.test.ts for expected placement values\n */\nexport const toFloatingUIPlacement = (align?: Alignment, position?: Position, rtl?: boolean): Placement | undefined => {\n const alignment = shouldAlignToCenter(position, align) ? 'center' : align;\n\n const computedPosition = position && getPositionMap(rtl)[position];\n const computedAlignment = alignment && getAlignmentMap()[alignment];\n\n if (computedPosition && computedAlignment) {\n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AAN,qBAAqB,GAAAA,qBAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AACA;AAEA;;;;;;AAMA,SAAgBA,oBAAoB,CAClCC,IAAoD,EACpDC,IAAoD,EACpDC,OAAsB;EAEtB,IAAIF,IAAI,KAAKC,IAAI,EAAE;IACjB;;EAGF,IAAIA,IAAI,YAAYE,WAAW,EAAE;IAC/B,MAAMC,gBAAgB,GAAGC,iCAAe,CAACJ,IAAI,CAAC;IAC9CG,gBAAgB,CAACE,mBAAmB,CAAC,QAAQ,EAAEJ,OAAO,CAAC;;EAEzD,IAAIF,IAAI,YAAYG,WAAW,EAAE;IAC/B,MAAMI,YAAY,GAAGF,iCAAe,CAACL,IAAI,CAAC;IAC1CO,YAAY,CAACC,gBAAgB,CAAC,QAAQ,EAAEN,OAAO,CAAC;;AAEpD;AAjBAO","names":["toggleScrollListener","next","prev","handler","HTMLElement","prevScrollParent","getScrollParent_1","removeEventListener","scrollParent","addEventListener","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/utils/toggleScrollListener.ts"],"sourcesContent":["import type { PositioningVirtualElement } from '../types';\nimport { getScrollParent } from './getScrollParent';\n\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 */\nexport function toggleScrollListener(\n next: HTMLElement | PositioningVirtualElement | null,\n prev: HTMLElement | PositioningVirtualElement | null,\n handler: EventListener,\n) {\n if (next === prev) {\n return;\n }\n\n if (prev instanceof HTMLElement) {\n const prevScrollParent = getScrollParent(prev);\n prevScrollParent.removeEventListener('scroll', handler);\n }\n if (next instanceof HTMLElement) {\n const scrollParent = getScrollParent(next);\n scrollParent.addEventListener('scroll', handler);\n }\n}\n"]}
1
+ {"version":3,"names":["getScrollParent_1","require","toggleScrollListener","next","prev","handler","HTMLElement","prevScrollParent","getScrollParent","removeEventListener","scrollParent","addEventListener","exports"],"sources":["../src/packages/react-components/react-positioning/src/utils/toggleScrollListener.ts"],"sourcesContent":["import type { PositioningVirtualElement } from '../types';\nimport { getScrollParent } from './getScrollParent';\n\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 */\nexport function toggleScrollListener(\n next: HTMLElement | PositioningVirtualElement | null,\n prev: HTMLElement | PositioningVirtualElement | null,\n handler: EventListener,\n) {\n if (next === prev) {\n return;\n }\n\n if (prev instanceof HTMLElement) {\n const prevScrollParent = getScrollParent(prev);\n prevScrollParent.removeEventListener('scroll', handler);\n }\n if (next instanceof HTMLElement) {\n const scrollParent = getScrollParent(next);\n scrollParent.addEventListener('scroll', handler);\n }\n}\n"],"mappings":";;;;;;AACA,MAAAA,iBAAA,gBAAAC,OAAA;AAEA;;;;;;AAMA,SAAgBC,oBAAoBA,CAClCC,IAAoD,EACpDC,IAAoD,EACpDC,OAAsB;EAEtB,IAAIF,IAAI,KAAKC,IAAI,EAAE;IACjB;;EAGF,IAAIA,IAAI,YAAYE,WAAW,EAAE;IAC/B,MAAMC,gBAAgB,GAAGP,iBAAA,CAAAQ,eAAe,CAACJ,IAAI,CAAC;IAC9CG,gBAAgB,CAACE,mBAAmB,CAAC,QAAQ,EAAEJ,OAAO,CAAC;;EAEzD,IAAIF,IAAI,YAAYG,WAAW,EAAE;IAC/B,MAAMI,YAAY,GAAGV,iBAAA,CAAAQ,eAAe,CAACL,IAAI,CAAC;IAC1CO,YAAY,CAACC,gBAAgB,CAAC,QAAQ,EAAEN,OAAO,CAAC;;AAEpD;AAjBAO,OAAA,CAAAV,oBAAA,GAAAA,oBAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AACA;AAEA;;;;;;;;;;;;;;;;;AAiBA,SAAgBA,cAAc,CAC5BC,YAAsB,EACtBC,QAA2D,EAC3DC,kBAA4B;EAE5B,MAAMC,OAAO,GAAGC,KAAK,CAACC,MAAM,CAAC,IAAI,CAAC;EAClC,MAAM,CAACC,GAAG,CAAC,GAAGF,KAAK,CAACG,QAAQ,CAAC,OAAO;IAClC;IACAC,KAAK,EAAER,YAAY;IACnB;IACAC,QAAQ;IACR;IACAQ,MAAM,EAAE;MACN,IAAIC,OAAO;QACT,OAAOJ,GAAG,CAACE,KAAK;MAClB,CAAC;MACD,IAAIE,OAAO,CAACF,KAAK;QACf,MAAMG,IAAI,GAAGL,GAAG,CAACE,KAAK;QAEtB,IAAIG,IAAI,KAAKH,KAAK,EAAE;UAClBF,GAAG,CAACE,KAAK,GAAGA,KAAK;UAEjB,IAAIN,kBAAkB,IAAIC,OAAO,CAACO,OAAO,EAAE;YACzC;;UAGFJ,GAAG,CAACL,QAAQ,CAACO,KAAK,EAAEG,IAAI,CAAC;;MAE7B;;GAEH,CAAC,CAAC;EAEHC,2CAAyB,CAAC,MAAK;IAC7BT,OAAO,CAACO,OAAO,GAAG,KAAK;EACzB,CAAC,EAAE,EAAE,CAAC;EAEN;EACAJ,GAAG,CAACL,QAAQ,GAAGA,QAAQ;EAEvB,OAAOK,GAAG,CAACG,MAAM;AACnB;AAxCAI","names":["useCallbackRef","initialValue","callback","skipInitialResolve","isFirst","React","useRef","ref","useState","value","facade","current","last","react_utilities_1","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/utils/useCallbackRef.ts"],"sourcesContent":["import * as React from 'react';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\n\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 */\nexport function useCallbackRef<T>(\n initialValue: T | null,\n callback: (newValue: T | null, lastValue: T | null) => void,\n skipInitialResolve?: boolean,\n): React.MutableRefObject<T | null> {\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\n if (last !== value) {\n ref.value = value;\n\n if (skipInitialResolve && isFirst.current) {\n return;\n }\n\n ref.callback(value, last);\n }\n },\n },\n }));\n\n useIsomorphicLayoutEffect(() => {\n isFirst.current = false;\n }, []);\n\n // update callback\n ref.callback = callback;\n\n return ref.facade;\n}\n"]}
1
+ {"version":3,"names":["React","require","react_utilities_1","useCallbackRef","initialValue","callback","skipInitialResolve","isFirst","useRef","ref","useState","value","facade","current","last","useIsomorphicLayoutEffect","exports"],"sources":["../src/packages/react-components/react-positioning/src/utils/useCallbackRef.ts"],"sourcesContent":["import * as React from 'react';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\n\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 */\nexport function useCallbackRef<T>(\n initialValue: T | null,\n callback: (newValue: T | null, lastValue: T | null) => void,\n skipInitialResolve?: boolean,\n): React.MutableRefObject<T | null> {\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\n if (last !== value) {\n ref.value = value;\n\n if (skipInitialResolve && isFirst.current) {\n return;\n }\n\n ref.callback(value, last);\n }\n },\n },\n }));\n\n useIsomorphicLayoutEffect(() => {\n isFirst.current = false;\n }, []);\n\n // update callback\n ref.callback = callback;\n\n return ref.facade;\n}\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AAEA;;;;;;;;;;;;;;;;;AAiBA,SAAgBE,cAAcA,CAC5BC,YAAsB,EACtBC,QAA2D,EAC3DC,kBAA4B;EAE5B,MAAMC,OAAO,GAAGP,KAAK,CAACQ,MAAM,CAAC,IAAI,CAAC;EAClC,MAAM,CAACC,GAAG,CAAC,GAAGT,KAAK,CAACU,QAAQ,CAAC,OAAO;IAClC;IACAC,KAAK,EAAEP,YAAY;IACnB;IACAC,QAAQ;IACR;IACAO,MAAM,EAAE;MACN,IAAIC,OAAOA,CAAA;QACT,OAAOJ,GAAG,CAACE,KAAK;MAClB,CAAC;MACD,IAAIE,OAAOA,CAACF,KAAK;QACf,MAAMG,IAAI,GAAGL,GAAG,CAACE,KAAK;QAEtB,IAAIG,IAAI,KAAKH,KAAK,EAAE;UAClBF,GAAG,CAACE,KAAK,GAAGA,KAAK;UAEjB,IAAIL,kBAAkB,IAAIC,OAAO,CAACM,OAAO,EAAE;YACzC;;UAGFJ,GAAG,CAACJ,QAAQ,CAACM,KAAK,EAAEG,IAAI,CAAC;;MAE7B;;GAEH,CAAC,CAAC;EAEHZ,iBAAA,CAAAa,yBAAyB,CAAC,MAAK;IAC7BR,OAAO,CAACM,OAAO,GAAG,KAAK;EACzB,CAAC,EAAE,EAAE,CAAC;EAEN;EACAJ,GAAG,CAACJ,QAAQ,GAAGA,QAAQ;EAEvB,OAAOI,GAAG,CAACG,MAAM;AACnB;AAxCAI,OAAA,CAAAb,cAAA,GAAAA,cAAA"}
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAEA;;;AAGA,SAAgBA,iBAAiB,CAACC,OAAsE;EACtG,MAAM;IAAEC,KAAK;IAAEC;EAAc,CAAE,GAAGF,OAAO;EACzC,IAAI,CAACE,cAAc,CAACD,KAAK,IAAI,CAACA,KAAK,EAAE;IACnC;;EAGF,MAAM;IAAEE,CAAC,EAAEC,MAAM;IAAEC,CAAC,EAAEC;EAAM,CAAE,GAAGJ,cAAc,CAACD,KAAK;EAErDM,MAAM,CAACC,MAAM,CAACP,KAAK,CAACQ,KAAK,EAAE;IACzBC,IAAI,EAAE,GAAGN,MAAM,IAAI;IACnBO,GAAG,EAAE,GAAGL,MAAM;GACf,CAAC;AACJ;AAZAM","names":["writeArrowUpdates","options","arrow","middlewareData","x","arrowX","y","arrowY","Object","assign","style","left","top","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-positioning/src/utils/writeArrowUpdates.ts"],"sourcesContent":["import { MiddlewareData } from '@floating-ui/dom';\n\n/**\n * Writes all DOM element updates after position is computed\n */\nexport function writeArrowUpdates(options: { arrow: HTMLElement | null; middlewareData: MiddlewareData }) {\n const { arrow, middlewareData } = options;\n if (!middlewareData.arrow || !arrow) {\n return;\n }\n\n const { x: arrowX, y: arrowY } = middlewareData.arrow;\n\n Object.assign(arrow.style, {\n left: `${arrowX}px`,\n top: `${arrowY}px`,\n });\n}\n"]}
1
+ {"version":3,"names":["writeArrowUpdates","options","arrow","middlewareData","x","arrowX","y","arrowY","Object","assign","style","left","top","exports"],"sources":["../src/packages/react-components/react-positioning/src/utils/writeArrowUpdates.ts"],"sourcesContent":["import { MiddlewareData } from '@floating-ui/dom';\n\n/**\n * Writes all DOM element updates after position is computed\n */\nexport function writeArrowUpdates(options: { arrow: HTMLElement | null; middlewareData: MiddlewareData }) {\n const { arrow, middlewareData } = options;\n if (!middlewareData.arrow || !arrow) {\n return;\n }\n\n const { x: arrowX, y: arrowY } = middlewareData.arrow;\n\n Object.assign(arrow.style, {\n left: `${arrowX}px`,\n top: `${arrowY}px`,\n });\n}\n"],"mappings":";;;;;;AAEA;;;AAGA,SAAgBA,iBAAiBA,CAACC,OAAsE;EACtG,MAAM;IAAEC,KAAK;IAAEC;EAAc,CAAE,GAAGF,OAAO;EACzC,IAAI,CAACE,cAAc,CAACD,KAAK,IAAI,CAACA,KAAK,EAAE;IACnC;;EAGF,MAAM;IAAEE,CAAC,EAAEC,MAAM;IAAEC,CAAC,EAAEC;EAAM,CAAE,GAAGJ,cAAc,CAACD,KAAK;EAErDM,MAAM,CAACC,MAAM,CAACP,KAAK,CAACQ,KAAK,EAAE;IACzBC,IAAI,EAAE,GAAGN,MAAM,IAAI;IACnBO,GAAG,EAAE,GAAGL,MAAM;GACf,CAAC;AACJ;AAZAM,OAAA,CAAAb,iBAAA,GAAAA,iBAAA"}