@fluentui/react-positioning 9.5.5 → 9.5.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +55 -1
  3. package/CHANGELOG.md +24 -2
  4. package/lib/constants.js.map +1 -1
  5. package/lib/createArrowStyles.js.map +1 -1
  6. package/lib/createPositionManager.js.map +1 -1
  7. package/lib/createVirtualElementFromClick.js +1 -2
  8. package/lib/createVirtualElementFromClick.js.map +1 -1
  9. package/lib/index.js.map +1 -1
  10. package/lib/middleware/coverTarget.js.map +1 -1
  11. package/lib/middleware/flip.js.map +1 -1
  12. package/lib/middleware/index.js.map +1 -1
  13. package/lib/middleware/intersecting.js.map +1 -1
  14. package/lib/middleware/maxSize.js.map +1 -1
  15. package/lib/middleware/offset.js.map +1 -1
  16. package/lib/middleware/shift.js.map +1 -1
  17. package/lib/types.js +1 -1
  18. package/lib/types.js.map +1 -1
  19. package/lib/usePositioning.js +23 -21
  20. package/lib/usePositioning.js.map +1 -1
  21. package/lib/usePositioningMouseTarget.js.map +1 -1
  22. package/lib/utils/debounce.js +1 -2
  23. package/lib/utils/debounce.js.map +1 -1
  24. package/lib/utils/fromFloatingUIPlacement.js.map +1 -1
  25. package/lib/utils/getBoundary.js.map +1 -1
  26. package/lib/utils/getFloatingUIOffset.js.map +1 -1
  27. package/lib/utils/getReactFiberFromNode.js +1 -0
  28. package/lib/utils/getReactFiberFromNode.js.map +1 -1
  29. package/lib/utils/getScrollParent.js +5 -6
  30. package/lib/utils/getScrollParent.js.map +1 -1
  31. package/lib/utils/hasAutoFocusFilter.js +2 -2
  32. package/lib/utils/hasAutoFocusFilter.js.map +1 -1
  33. package/lib/utils/index.js.map +1 -1
  34. package/lib/utils/mergeArrowOffset.js +3 -4
  35. package/lib/utils/mergeArrowOffset.js.map +1 -1
  36. package/lib/utils/parseFloatingUIPlacement.js +1 -2
  37. package/lib/utils/parseFloatingUIPlacement.js.map +1 -1
  38. package/lib/utils/resolvePositioningShorthand.js.map +1 -1
  39. package/lib/utils/toFloatingUIPadding.js.map +1 -1
  40. package/lib/utils/toFloatingUIPlacement.js.map +1 -1
  41. package/lib/utils/toggleScrollListener.js.map +1 -1
  42. package/lib/utils/useCallbackRef.js.map +1 -1
  43. package/lib/utils/writeArrowUpdates.js +1 -2
  44. package/lib/utils/writeArrowUpdates.js.map +1 -1
  45. package/lib/utils/writeContainerupdates.js +4 -4
  46. package/lib/utils/writeContainerupdates.js.map +1 -1
  47. package/lib-commonjs/constants.js +18 -7
  48. package/lib-commonjs/constants.js.map +1 -1
  49. package/lib-commonjs/createArrowStyles.js +60 -88
  50. package/lib-commonjs/createArrowStyles.js.map +1 -1
  51. package/lib-commonjs/createPositionManager.js +103 -117
  52. package/lib-commonjs/createPositionManager.js.map +1 -1
  53. package/lib-commonjs/createVirtualElementFromClick.js +27 -26
  54. package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
  55. package/lib-commonjs/index.js +24 -51
  56. package/lib-commonjs/index.js.map +1 -1
  57. package/lib-commonjs/middleware/coverTarget.js +34 -37
  58. package/lib-commonjs/middleware/coverTarget.js.map +1 -1
  59. package/lib-commonjs/middleware/flip.js +31 -38
  60. package/lib-commonjs/middleware/flip.js.map +1 -1
  61. package/lib-commonjs/middleware/index.js +10 -9
  62. package/lib-commonjs/middleware/index.js.map +1 -1
  63. package/lib-commonjs/middleware/intersecting.js +24 -22
  64. package/lib-commonjs/middleware/intersecting.js.map +1 -1
  65. package/lib-commonjs/middleware/maxSize.js +34 -40
  66. package/lib-commonjs/middleware/maxSize.js.map +1 -1
  67. package/lib-commonjs/middleware/offset.js +11 -12
  68. package/lib-commonjs/middleware/offset.js.map +1 -1
  69. package/lib-commonjs/middleware/shift.js +29 -37
  70. package/lib-commonjs/middleware/shift.js.map +1 -1
  71. package/lib-commonjs/types.js +5 -2
  72. package/lib-commonjs/types.js.map +1 -1
  73. package/lib-commonjs/usePositioning.js +200 -164
  74. package/lib-commonjs/usePositioning.js.map +1 -1
  75. package/lib-commonjs/usePositioningMouseTarget.js +34 -37
  76. package/lib-commonjs/usePositioningMouseTarget.js.map +1 -1
  77. package/lib-commonjs/utils/debounce.js +22 -21
  78. package/lib-commonjs/utils/debounce.js.map +1 -1
  79. package/lib-commonjs/utils/fromFloatingUIPlacement.js +30 -35
  80. package/lib-commonjs/utils/fromFloatingUIPlacement.js.map +1 -1
  81. package/lib-commonjs/utils/getBoundary.js +21 -22
  82. package/lib-commonjs/utils/getBoundary.js.map +1 -1
  83. package/lib-commonjs/utils/getFloatingUIOffset.js +23 -35
  84. package/lib-commonjs/utils/getFloatingUIOffset.js.map +1 -1
  85. package/lib-commonjs/utils/getReactFiberFromNode.js +45 -41
  86. package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
  87. package/lib-commonjs/utils/getScrollParent.js +52 -56
  88. package/lib-commonjs/utils/getScrollParent.js.map +1 -1
  89. package/lib-commonjs/utils/hasAutoFocusFilter.js +18 -17
  90. package/lib-commonjs/utils/hasAutoFocusFilter.js.map +1 -1
  91. package/lib-commonjs/utils/index.js +19 -18
  92. package/lib-commonjs/utils/index.js.map +1 -1
  93. package/lib-commonjs/utils/mergeArrowOffset.js +33 -32
  94. package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
  95. package/lib-commonjs/utils/parseFloatingUIPlacement.js +15 -14
  96. package/lib-commonjs/utils/parseFloatingUIPlacement.js.map +1 -1
  97. package/lib-commonjs/utils/resolvePositioningShorthand.js +63 -61
  98. package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
  99. package/lib-commonjs/utils/toFloatingUIPadding.js +23 -25
  100. package/lib-commonjs/utils/toFloatingUIPadding.js.map +1 -1
  101. package/lib-commonjs/utils/toFloatingUIPlacement.js +31 -33
  102. package/lib-commonjs/utils/toFloatingUIPlacement.js.map +1 -1
  103. package/lib-commonjs/utils/toggleScrollListener.js +20 -24
  104. package/lib-commonjs/utils/toggleScrollListener.js.map +1 -1
  105. package/lib-commonjs/utils/useCallbackRef.js +39 -53
  106. package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
  107. package/lib-commonjs/utils/writeArrowUpdates.js +19 -24
  108. package/lib-commonjs/utils/writeArrowUpdates.js.map +1 -1
  109. package/lib-commonjs/utils/writeContainerupdates.js +37 -45
  110. package/lib-commonjs/utils/writeContainerupdates.js.map +1 -1
  111. package/package.json +7 -6
  112. package/lib-amd/constants.js +0 -10
  113. package/lib-amd/constants.js.map +0 -1
  114. package/lib-amd/createArrowStyles.js +0 -62
  115. package/lib-amd/createArrowStyles.js.map +0 -1
  116. package/lib-amd/createPositionManager.js +0 -97
  117. package/lib-amd/createPositionManager.js.map +0 -1
  118. package/lib-amd/createVirtualElementFromClick.js +0 -32
  119. package/lib-amd/createVirtualElementFromClick.js.map +0 -1
  120. package/lib-amd/index.js +0 -13
  121. package/lib-amd/index.js.map +0 -1
  122. package/lib-amd/middleware/coverTarget.js +0 -32
  123. package/lib-amd/middleware/coverTarget.js.map +0 -1
  124. package/lib-amd/middleware/flip.js +0 -19
  125. package/lib-amd/middleware/flip.js.map +0 -1
  126. package/lib-amd/middleware/index.js +0 -11
  127. package/lib-amd/middleware/index.js.map +0 -1
  128. package/lib-amd/middleware/intersecting.js +0 -33
  129. package/lib-amd/middleware/intersecting.js.map +0 -1
  130. package/lib-amd/middleware/maxSize.js +0 -33
  131. package/lib-amd/middleware/maxSize.js.map +0 -1
  132. package/lib-amd/middleware/offset.js +0 -14
  133. package/lib-amd/middleware/offset.js.map +0 -1
  134. package/lib-amd/middleware/shift.js +0 -17
  135. package/lib-amd/middleware/shift.js.map +0 -1
  136. package/lib-amd/types.js +0 -5
  137. package/lib-amd/types.js.map +0 -1
  138. package/lib-amd/usePositioning.js +0 -161
  139. package/lib-amd/usePositioning.js.map +0 -1
  140. package/lib-amd/usePositioningMouseTarget.js +0 -39
  141. package/lib-amd/usePositioningMouseTarget.js.map +0 -1
  142. package/lib-amd/utils/debounce.js +0 -27
  143. package/lib-amd/utils/debounce.js.map +0 -1
  144. package/lib-amd/utils/fromFloatingUIPlacement.js +0 -37
  145. package/lib-amd/utils/fromFloatingUIPlacement.js.map +0 -1
  146. package/lib-amd/utils/getBoundary.js +0 -26
  147. package/lib-amd/utils/getBoundary.js.map +0 -1
  148. package/lib-amd/utils/getFloatingUIOffset.js +0 -25
  149. package/lib-amd/utils/getFloatingUIOffset.js.map +0 -1
  150. package/lib-amd/utils/getReactFiberFromNode.js +0 -48
  151. package/lib-amd/utils/getReactFiberFromNode.js.map +0 -1
  152. package/lib-amd/utils/getScrollParent.js +0 -64
  153. package/lib-amd/utils/getScrollParent.js.map +0 -1
  154. package/lib-amd/utils/hasAutoFocusFilter.js +0 -31
  155. package/lib-amd/utils/hasAutoFocusFilter.js.map +0 -1
  156. package/lib-amd/utils/index.js +0 -20
  157. package/lib-amd/utils/index.js.map +0 -1
  158. package/lib-amd/utils/mergeArrowOffset.js +0 -38
  159. package/lib-amd/utils/mergeArrowOffset.js.map +0 -1
  160. package/lib-amd/utils/parseFloatingUIPlacement.js +0 -20
  161. package/lib-amd/utils/parseFloatingUIPlacement.js.map +0 -1
  162. package/lib-amd/utils/resolvePositioningShorthand.js +0 -31
  163. package/lib-amd/utils/resolvePositioningShorthand.js.map +0 -1
  164. package/lib-amd/utils/toFloatingUIPadding.js +0 -25
  165. package/lib-amd/utils/toFloatingUIPadding.js.map +0 -1
  166. package/lib-amd/utils/toFloatingUIPlacement.js +0 -40
  167. package/lib-amd/utils/toFloatingUIPlacement.js.map +0 -1
  168. package/lib-amd/utils/toggleScrollListener.js +0 -26
  169. package/lib-amd/utils/toggleScrollListener.js.map +0 -1
  170. package/lib-amd/utils/useCallbackRef.js +0 -55
  171. package/lib-amd/utils/useCallbackRef.js.map +0 -1
  172. package/lib-amd/utils/writeArrowUpdates.js +0 -21
  173. package/lib-amd/utils/writeArrowUpdates.js.map +0 -1
  174. package/lib-amd/utils/writeContainerupdates.js +0 -41
  175. package/lib-amd/utils/writeContainerupdates.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["createVirtualElementFromClick_1","require","Object","defineProperty","exports","enumerable","get","createVirtualElementFromClick","createArrowStyles_1","createArrowHeightStyles","createArrowStyles","usePositioning_1","usePositioning","usePositioningMouseTarget_1","usePositioningMouseTarget","index_1","resolvePositioningShorthand","mergeArrowOffset"],"sources":["../src/packages/react-components/react-positioning/src/index.ts"],"sourcesContent":["export { createVirtualElementFromClick } from './createVirtualElementFromClick';\nexport { createArrowHeightStyles, createArrowStyles } from './createArrowStyles';\nexport type { CreateArrowStylesOptions } from './createArrowStyles';\nexport { usePositioning } from './usePositioning';\nexport { usePositioningMouseTarget } from './usePositioningMouseTarget';\nexport { resolvePositioningShorthand, mergeArrowOffset } from './utils/index';\nexport type {\n Alignment,\n AutoSize,\n Boundary,\n Offset,\n OffsetFunction,\n OffsetFunctionParam,\n OffsetObject,\n OffsetShorthand,\n Position,\n PositioningImperativeRef,\n PositioningProps,\n PositioningShorthand,\n PositioningShorthandValue,\n PositioningVirtualElement,\n SetVirtualMouseTarget,\n} from './types';\n"],"mappings":";;;;;;AAAA,IAAAA,+BAAA,gBAAAC,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,+BAAA,CAAAO,6BAA6B;EAAA;AAAA;AACtC,IAAAC,mBAAA,gBAAAP,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAE,mBAAA,CAAAC,uBAAuB;EAAA;AAAA;AAAEP,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAE,mBAAA,CAAAE,iBAAiB;EAAA;AAAA;AAEnD,IAAAC,gBAAA,gBAAAV,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAK,gBAAA,CAAAC,cAAc;EAAA;AAAA;AACvB,IAAAC,2BAAA,gBAAAZ,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAO,2BAAA,CAAAC,yBAAyB;EAAA;AAAA;AAClC,IAAAC,OAAA,gBAAAd,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAS,OAAA,CAAAC,2BAA2B;EAAA;AAAA;AAAEd,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAS,OAAA,CAAAE,gBAAgB;EAAA;AAAA"}
1
+ {"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { createVirtualElementFromClick } from './createVirtualElementFromClick';\nexport { createArrowHeightStyles, createArrowStyles } from './createArrowStyles';\nexport { usePositioning } from './usePositioning';\nexport { usePositioningMouseTarget } from './usePositioningMouseTarget';\nexport { resolvePositioningShorthand, mergeArrowOffset } from './utils/index';\n//# sourceMappingURL=index.js.map"],"names":["createVirtualElementFromClick","createArrowHeightStyles","createArrowStyles","usePositioning","usePositioningMouseTarget","resolvePositioningShorthand","mergeArrowOffset"],"mappings":";;;;;;;;;;;IAASA,6BAA6B,MAA7BA,4DAA6B;IAC7BC,uBAAuB,MAAvBA,0CAAuB;IAAEC,iBAAiB,MAAjBA,oCAAiB;IAC1CC,cAAc,MAAdA,8BAAc;IACdC,yBAAyB,MAAzBA,oDAAyB;IACzBC,2BAA2B,MAA3BA,kCAA2B;IAAEC,gBAAgB,MAAhBA,uBAAgB;;+CAJR;mCACa;gCAC5B;2CACW;uBACoB;CAC9D,iCAAiC"}
@@ -1,42 +1,39 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "coverTarget", {
6
+ enumerable: true,
7
+ get: ()=>coverTarget
5
8
  });
6
- exports.coverTarget = void 0;
7
- const index_1 = /*#__PURE__*/require("../utils/index");
9
+ const _index = require("../utils/index");
8
10
  function coverTarget() {
9
- return {
10
- name: 'coverTarget',
11
- fn: middlewareArguments => {
12
- const {
13
- placement,
14
- rects,
15
- x,
16
- y
17
- } = middlewareArguments;
18
- const basePlacement = index_1.parseFloatingUIPlacement(placement).side;
19
- const newCoords = {
20
- x,
21
- y
22
- };
23
- switch (basePlacement) {
24
- case 'bottom':
25
- newCoords.y -= rects.reference.height;
26
- break;
27
- case 'top':
28
- newCoords.y += rects.reference.height;
29
- break;
30
- case 'left':
31
- newCoords.x += rects.reference.width;
32
- break;
33
- case 'right':
34
- newCoords.x -= rects.reference.width;
35
- break;
36
- }
37
- return newCoords;
38
- }
39
- };
40
- }
41
- exports.coverTarget = coverTarget;
11
+ return {
12
+ name: 'coverTarget',
13
+ fn: (middlewareArguments)=>{
14
+ const { placement , rects , x , y } = middlewareArguments;
15
+ const basePlacement = (0, _index.parseFloatingUIPlacement)(placement).side;
16
+ const newCoords = {
17
+ x,
18
+ y
19
+ };
20
+ switch(basePlacement){
21
+ case 'bottom':
22
+ newCoords.y -= rects.reference.height;
23
+ break;
24
+ case 'top':
25
+ newCoords.y += rects.reference.height;
26
+ break;
27
+ case 'left':
28
+ newCoords.x += rects.reference.width;
29
+ break;
30
+ case 'right':
31
+ newCoords.x -= rects.reference.width;
32
+ break;
33
+ }
34
+ return newCoords;
35
+ }
36
+ };
37
+ } //# sourceMappingURL=coverTarget.js.map
38
+
42
39
  //# sourceMappingURL=coverTarget.js.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"sources":["../../lib/middleware/coverTarget.js"],"sourcesContent":["import { parseFloatingUIPlacement } from '../utils/index';\nexport function coverTarget() {\n return {\n name: 'coverTarget',\n fn: middlewareArguments => {\n const {\n placement,\n rects,\n x,\n y\n } = middlewareArguments;\n const basePlacement = parseFloatingUIPlacement(placement).side;\n const newCoords = {\n x,\n y\n };\n switch (basePlacement) {\n case 'bottom':\n newCoords.y -= rects.reference.height;\n break;\n case 'top':\n newCoords.y += rects.reference.height;\n break;\n case 'left':\n newCoords.x += rects.reference.width;\n break;\n case 'right':\n newCoords.x -= rects.reference.width;\n break;\n }\n return newCoords;\n }\n };\n}\n//# sourceMappingURL=coverTarget.js.map"],"names":["coverTarget","name","fn","middlewareArguments","placement","rects","x","y","basePlacement","parseFloatingUIPlacement","side","newCoords","reference","height","width"],"mappings":";;;;+BACgBA;;aAAAA;;uBADyB;AAClC,SAASA,cAAc;IAC5B,OAAO;QACLC,MAAM;QACNC,IAAIC,CAAAA,sBAAuB;YACzB,MAAM,EACJC,UAAS,EACTC,MAAK,EACLC,EAAC,EACDC,EAAC,EACF,GAAGJ;YACJ,MAAMK,gBAAgBC,IAAAA,+BAAwB,EAACL,WAAWM,IAAI;YAC9D,MAAMC,YAAY;gBAChBL;gBACAC;YACF;YACA,OAAQC;gBACN,KAAK;oBACHG,UAAUJ,CAAC,IAAIF,MAAMO,SAAS,CAACC,MAAM;oBACrC,KAAM;gBACR,KAAK;oBACHF,UAAUJ,CAAC,IAAIF,MAAMO,SAAS,CAACC,MAAM;oBACrC,KAAM;gBACR,KAAK;oBACHF,UAAUL,CAAC,IAAID,MAAMO,SAAS,CAACE,KAAK;oBACpC,KAAM;gBACR,KAAK;oBACHH,UAAUL,CAAC,IAAID,MAAMO,SAAS,CAACE,KAAK;oBACpC,KAAM;YACV;YACA,OAAOH;QACT;IACF;AACF,EACA,uCAAuC"}
@@ -1,43 +1,36 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "flip", {
6
+ enumerable: true,
7
+ get: ()=>flip
5
8
  });
6
- exports.flip = void 0;
7
- const dom_1 = /*#__PURE__*/require("@floating-ui/dom");
8
- const index_1 = /*#__PURE__*/require("../utils/index");
9
+ const _dom = require("@floating-ui/dom");
10
+ const _index = require("../utils/index");
9
11
  function flip(options) {
10
- const {
11
- hasScrollableElement,
12
- flipBoundary,
13
- container,
14
- fallbackPositions = [],
15
- isRtl
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
- }, []);
28
- return dom_1.flip({
29
- ...(hasScrollableElement && {
30
- boundary: 'clippingAncestors'
31
- }),
32
- ...(flipBoundary && {
33
- altBoundary: true,
34
- boundary: index_1.getBoundary(container, flipBoundary)
35
- }),
36
- fallbackStrategy: 'bestFit',
37
- ...(fallbackPlacements.length && {
38
- fallbackPlacements
39
- })
40
- });
41
- }
42
- exports.flip = flip;
12
+ const { hasScrollableElement , flipBoundary , container , fallbackPositions =[] , isRtl } = options;
13
+ const fallbackPlacements = fallbackPositions.reduce((acc, shorthand)=>{
14
+ const { position , align } = (0, _index.resolvePositioningShorthand)(shorthand);
15
+ const placement = (0, _index.toFloatingUIPlacement)(align, position, isRtl);
16
+ if (placement) {
17
+ acc.push(placement);
18
+ }
19
+ return acc;
20
+ }, []);
21
+ return (0, _dom.flip)({
22
+ ...hasScrollableElement && {
23
+ boundary: 'clippingAncestors'
24
+ },
25
+ ...flipBoundary && {
26
+ altBoundary: true,
27
+ boundary: (0, _index.getBoundary)(container, flipBoundary)
28
+ },
29
+ fallbackStrategy: 'bestFit',
30
+ ...fallbackPlacements.length && {
31
+ fallbackPlacements
32
+ }
33
+ });
34
+ } //# sourceMappingURL=flip.js.map
35
+
43
36
  //# sourceMappingURL=flip.js.map
@@ -1 +1 @@
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
+ {"version":3,"sources":["../../lib/middleware/flip.js"],"sourcesContent":["import { flip as baseFlip } from '@floating-ui/dom';\nimport { getBoundary, resolvePositioningShorthand, toFloatingUIPlacement } from '../utils/index';\nexport function flip(options) {\n const {\n hasScrollableElement,\n flipBoundary,\n container,\n fallbackPositions = [],\n isRtl\n } = options;\n const fallbackPlacements = fallbackPositions.reduce((acc, shorthand) => {\n const {\n position,\n align\n } = resolvePositioningShorthand(shorthand);\n const placement = toFloatingUIPlacement(align, position, isRtl);\n if (placement) {\n acc.push(placement);\n }\n return acc;\n }, []);\n return baseFlip({\n ...(hasScrollableElement && {\n boundary: 'clippingAncestors'\n }),\n ...(flipBoundary && {\n altBoundary: true,\n boundary: getBoundary(container, flipBoundary)\n }),\n fallbackStrategy: 'bestFit',\n ...(fallbackPlacements.length && {\n fallbackPlacements\n })\n });\n}\n//# sourceMappingURL=flip.js.map"],"names":["flip","options","hasScrollableElement","flipBoundary","container","fallbackPositions","isRtl","fallbackPlacements","reduce","acc","shorthand","position","align","resolvePositioningShorthand","placement","toFloatingUIPlacement","push","baseFlip","boundary","altBoundary","getBoundary","fallbackStrategy","length"],"mappings":";;;;+BAEgBA;;aAAAA;;qBAFiB;uBAC+C;AACzE,SAASA,KAAKC,OAAO,EAAE;IAC5B,MAAM,EACJC,qBAAoB,EACpBC,aAAY,EACZC,UAAS,EACTC,mBAAoB,EAAE,CAAA,EACtBC,MAAK,EACN,GAAGL;IACJ,MAAMM,qBAAqBF,kBAAkBG,MAAM,CAAC,CAACC,KAAKC,YAAc;QACtE,MAAM,EACJC,SAAQ,EACRC,MAAK,EACN,GAAGC,IAAAA,kCAA2B,EAACH;QAChC,MAAMI,YAAYC,IAAAA,4BAAqB,EAACH,OAAOD,UAAUL;QACzD,IAAIQ,WAAW;YACbL,IAAIO,IAAI,CAACF;QACX,CAAC;QACD,OAAOL;IACT,GAAG,EAAE;IACL,OAAOQ,IAAAA,SAAQ,EAAC;QACd,GAAIf,wBAAwB;YAC1BgB,UAAU;QACZ,CAAC;QACD,GAAIf,gBAAgB;YAClBgB,aAAa,IAAI;YACjBD,UAAUE,IAAAA,kBAAW,EAAChB,WAAWD;QACnC,CAAC;QACDkB,kBAAkB;QAClB,GAAId,mBAAmBe,MAAM,IAAI;YAC/Bf;QACF,CAAC;IACH;AACF,EACA,gCAAgC"}
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./coverTarget"), exports);
8
- tslib_1.__exportStar(require("./flip"), exports);
9
- tslib_1.__exportStar(require("./intersecting"), exports);
10
- tslib_1.__exportStar(require("./maxSize"), exports);
11
- tslib_1.__exportStar(require("./offset"), exports);
12
- tslib_1.__exportStar(require("./shift"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./coverTarget"), exports);
7
+ _exportStar(require("./flip"), exports);
8
+ _exportStar(require("./intersecting"), exports);
9
+ _exportStar(require("./maxSize"), exports);
10
+ _exportStar(require("./offset"), exports);
11
+ _exportStar(require("./shift"), exports);
12
+ //# sourceMappingURL=index.js.map
13
+
13
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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
+ {"version":3,"sources":["../../lib/middleware/index.js"],"sourcesContent":["export * from './coverTarget';\nexport * from './flip';\nexport * from './intersecting';\nexport * from './maxSize';\nexport * from './offset';\nexport * from './shift';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
@@ -1,28 +1,30 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "intersecting", {
6
+ enumerable: true,
7
+ get: ()=>intersecting
5
8
  });
6
- exports.intersecting = void 0;
7
- const dom_1 = /*#__PURE__*/require("@floating-ui/dom");
9
+ const _dom = require("@floating-ui/dom");
8
10
  function intersecting() {
9
- return {
10
- name: 'intersectionObserver',
11
- fn: async middlewareArguments => {
12
- const floatingRect = middlewareArguments.rects.floating;
13
- const altOverflow = await dom_1.detectOverflow(middlewareArguments, {
14
- altBoundary: true
15
- });
16
- const isIntersectingTop = altOverflow.top < floatingRect.height && altOverflow.top > 0;
17
- const isIntersectingBottom = altOverflow.bottom < floatingRect.height && altOverflow.bottom > 0;
18
- const isIntersecting = isIntersectingTop || isIntersectingBottom;
19
- return {
20
- data: {
21
- intersecting: isIntersecting
11
+ return {
12
+ name: 'intersectionObserver',
13
+ fn: async (middlewareArguments)=>{
14
+ const floatingRect = middlewareArguments.rects.floating;
15
+ const altOverflow = await (0, _dom.detectOverflow)(middlewareArguments, {
16
+ altBoundary: true
17
+ });
18
+ const isIntersectingTop = altOverflow.top < floatingRect.height && altOverflow.top > 0;
19
+ const isIntersectingBottom = altOverflow.bottom < floatingRect.height && altOverflow.bottom > 0;
20
+ const isIntersecting = isIntersectingTop || isIntersectingBottom;
21
+ return {
22
+ data: {
23
+ intersecting: isIntersecting
24
+ }
25
+ };
22
26
  }
23
- };
24
- }
25
- };
26
- }
27
- exports.intersecting = intersecting;
27
+ };
28
+ } //# sourceMappingURL=intersecting.js.map
29
+
28
30
  //# sourceMappingURL=intersecting.js.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"sources":["../../lib/middleware/intersecting.js"],"sourcesContent":["import { detectOverflow } from '@floating-ui/dom';\nexport function intersecting() {\n return {\n name: 'intersectionObserver',\n fn: async middlewareArguments => {\n const floatingRect = middlewareArguments.rects.floating;\n const altOverflow = await detectOverflow(middlewareArguments, {\n altBoundary: true\n });\n const isIntersectingTop = altOverflow.top < floatingRect.height && altOverflow.top > 0;\n const isIntersectingBottom = altOverflow.bottom < floatingRect.height && altOverflow.bottom > 0;\n const isIntersecting = isIntersectingTop || isIntersectingBottom;\n return {\n data: {\n intersecting: isIntersecting\n }\n };\n }\n };\n}\n//# sourceMappingURL=intersecting.js.map"],"names":["intersecting","name","fn","middlewareArguments","floatingRect","rects","floating","altOverflow","detectOverflow","altBoundary","isIntersectingTop","top","height","isIntersectingBottom","bottom","isIntersecting","data"],"mappings":";;;;+BACgBA;;aAAAA;;qBADe;AACxB,SAASA,eAAe;IAC7B,OAAO;QACLC,MAAM;QACNC,IAAI,OAAMC,sBAAuB;YAC/B,MAAMC,eAAeD,oBAAoBE,KAAK,CAACC,QAAQ;YACvD,MAAMC,cAAc,MAAMC,IAAAA,mBAAc,EAACL,qBAAqB;gBAC5DM,aAAa,IAAI;YACnB;YACA,MAAMC,oBAAoBH,YAAYI,GAAG,GAAGP,aAAaQ,MAAM,IAAIL,YAAYI,GAAG,GAAG;YACrF,MAAME,uBAAuBN,YAAYO,MAAM,GAAGV,aAAaQ,MAAM,IAAIL,YAAYO,MAAM,GAAG;YAC9F,MAAMC,iBAAiBL,qBAAqBG;YAC5C,OAAO;gBACLG,MAAM;oBACJhB,cAAce;gBAChB;YACF;QACF;IACF;AACF,EACA,wCAAwC"}
@@ -1,45 +1,39 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "maxSize", {
6
+ enumerable: true,
7
+ get: ()=>maxSize
5
8
  });
6
- exports.maxSize = void 0;
7
- const dom_1 = /*#__PURE__*/require("@floating-ui/dom");
8
- const getBoundary_1 = /*#__PURE__*/require("../utils/getBoundary");
9
+ const _dom = require("@floating-ui/dom");
10
+ const _getBoundary = require("../utils/getBoundary");
9
11
  function maxSize(autoSize, options) {
10
- const {
11
- container,
12
- overflowBoundary
13
- } = options;
14
- return dom_1.size({
15
- ...(overflowBoundary && {
16
- altBoundary: true,
17
- boundary: getBoundary_1.getBoundary(container, overflowBoundary)
18
- }),
19
- apply({
20
- availableHeight,
21
- availableWidth,
22
- elements,
23
- rects
24
- }) {
25
- const applyMaxWidth = autoSize === 'always' || autoSize === 'width-always' || rects.floating.width > availableWidth && (autoSize === true || autoSize === 'width');
26
- const applyMaxHeight = autoSize === 'always' || autoSize === 'height-always' || rects.floating.height > availableHeight && (autoSize === true || autoSize === 'height');
27
- if (applyMaxHeight) {
28
- Object.assign(elements.floating.style, {
29
- maxHeight: `${availableHeight}px`,
30
- boxSizing: 'border-box',
31
- overflowY: 'auto'
32
- });
33
- }
34
- if (applyMaxWidth) {
35
- Object.assign(elements.floating.style, {
36
- maxWidth: `${availableWidth}px`,
37
- boxSizing: 'border-box',
38
- overflowX: 'auto'
39
- });
40
- }
41
- }
42
- });
43
- }
44
- exports.maxSize = maxSize;
12
+ const { container , overflowBoundary } = options;
13
+ return (0, _dom.size)({
14
+ ...overflowBoundary && {
15
+ altBoundary: true,
16
+ boundary: (0, _getBoundary.getBoundary)(container, overflowBoundary)
17
+ },
18
+ apply ({ availableHeight , availableWidth , elements , rects }) {
19
+ const applyMaxWidth = autoSize === 'always' || autoSize === 'width-always' || rects.floating.width > availableWidth && (autoSize === true || autoSize === 'width');
20
+ const applyMaxHeight = autoSize === 'always' || autoSize === 'height-always' || rects.floating.height > availableHeight && (autoSize === true || autoSize === 'height');
21
+ if (applyMaxHeight) {
22
+ Object.assign(elements.floating.style, {
23
+ maxHeight: `${availableHeight}px`,
24
+ boxSizing: 'border-box',
25
+ overflowY: 'auto'
26
+ });
27
+ }
28
+ if (applyMaxWidth) {
29
+ Object.assign(elements.floating.style, {
30
+ maxWidth: `${availableWidth}px`,
31
+ boxSizing: 'border-box',
32
+ overflowX: 'auto'
33
+ });
34
+ }
35
+ }
36
+ });
37
+ } //# sourceMappingURL=maxSize.js.map
38
+
45
39
  //# sourceMappingURL=maxSize.js.map
@@ -1 +1 @@
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
+ {"version":3,"sources":["../../lib/middleware/maxSize.js"],"sourcesContent":["import { size } from '@floating-ui/dom';\nimport { getBoundary } from '../utils/getBoundary';\nexport function maxSize(autoSize, options) {\n const {\n container,\n overflowBoundary\n } = options;\n return size({\n ...(overflowBoundary && {\n altBoundary: true,\n boundary: getBoundary(container, overflowBoundary)\n }),\n apply({\n availableHeight,\n availableWidth,\n elements,\n rects\n }) {\n const applyMaxWidth = autoSize === 'always' || autoSize === 'width-always' || rects.floating.width > availableWidth && (autoSize === true || autoSize === 'width');\n const applyMaxHeight = autoSize === 'always' || autoSize === 'height-always' || rects.floating.height > availableHeight && (autoSize === true || autoSize === 'height');\n if (applyMaxHeight) {\n Object.assign(elements.floating.style, {\n maxHeight: `${availableHeight}px`,\n boxSizing: 'border-box',\n overflowY: 'auto'\n });\n }\n if (applyMaxWidth) {\n Object.assign(elements.floating.style, {\n maxWidth: `${availableWidth}px`,\n boxSizing: 'border-box',\n overflowX: 'auto'\n });\n }\n }\n });\n}\n//# sourceMappingURL=maxSize.js.map"],"names":["maxSize","autoSize","options","container","overflowBoundary","size","altBoundary","boundary","getBoundary","apply","availableHeight","availableWidth","elements","rects","applyMaxWidth","floating","width","applyMaxHeight","height","Object","assign","style","maxHeight","boxSizing","overflowY","maxWidth","overflowX"],"mappings":";;;;+BAEgBA;;aAAAA;;qBAFK;6BACO;AACrB,SAASA,QAAQC,QAAQ,EAAEC,OAAO,EAAE;IACzC,MAAM,EACJC,UAAS,EACTC,iBAAgB,EACjB,GAAGF;IACJ,OAAOG,IAAAA,SAAI,EAAC;QACV,GAAID,oBAAoB;YACtBE,aAAa,IAAI;YACjBC,UAAUC,IAAAA,wBAAW,EAACL,WAAWC;QACnC,CAAC;QACDK,OAAM,EACJC,gBAAe,EACfC,eAAc,EACdC,SAAQ,EACRC,MAAK,EACN,EAAE;YACD,MAAMC,gBAAgBb,aAAa,YAAYA,aAAa,kBAAkBY,MAAME,QAAQ,CAACC,KAAK,GAAGL,kBAAmBV,CAAAA,aAAa,IAAI,IAAIA,aAAa,OAAM;YAChK,MAAMgB,iBAAiBhB,aAAa,YAAYA,aAAa,mBAAmBY,MAAME,QAAQ,CAACG,MAAM,GAAGR,mBAAoBT,CAAAA,aAAa,IAAI,IAAIA,aAAa,QAAO;YACrK,IAAIgB,gBAAgB;gBAClBE,OAAOC,MAAM,CAACR,SAASG,QAAQ,CAACM,KAAK,EAAE;oBACrCC,WAAW,CAAC,EAAEZ,gBAAgB,EAAE,CAAC;oBACjCa,WAAW;oBACXC,WAAW;gBACb;YACF,CAAC;YACD,IAAIV,eAAe;gBACjBK,OAAOC,MAAM,CAACR,SAASG,QAAQ,CAACM,KAAK,EAAE;oBACrCI,UAAU,CAAC,EAAEd,eAAe,EAAE,CAAC;oBAC/BY,WAAW;oBACXG,WAAW;gBACb;YACF,CAAC;QACH;IACF;AACF,EACA,mCAAmC"}
@@ -1,17 +1,16 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "offset", {
6
+ enumerable: true,
7
+ get: ()=>offset
5
8
  });
6
- exports.offset = void 0;
7
- const dom_1 = /*#__PURE__*/require("@floating-ui/dom");
8
- const getFloatingUIOffset_1 = /*#__PURE__*/require("../utils/getFloatingUIOffset");
9
- /**
10
- * Wraps floating UI offset middleware to to transform offset value
11
- */
9
+ const _dom = require("@floating-ui/dom");
10
+ const _getFloatingUIOffset = require("../utils/getFloatingUIOffset");
12
11
  function offset(offsetValue) {
13
- const floatingUIOffset = getFloatingUIOffset_1.getFloatingUIOffset(offsetValue);
14
- return dom_1.offset(floatingUIOffset);
15
- }
16
- exports.offset = offset;
12
+ const floatingUIOffset = (0, _getFloatingUIOffset.getFloatingUIOffset)(offsetValue);
13
+ return (0, _dom.offset)(floatingUIOffset);
14
+ } //# sourceMappingURL=offset.js.map
15
+
17
16
  //# sourceMappingURL=offset.js.map
@@ -1 +1 @@
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
+ {"version":3,"sources":["../../lib/middleware/offset.js"],"sourcesContent":["import { offset as baseOffset } from '@floating-ui/dom';\nimport { getFloatingUIOffset } from '../utils/getFloatingUIOffset';\n/**\n * Wraps floating UI offset middleware to to transform offset value\n */\nexport function offset(offsetValue) {\n const floatingUIOffset = getFloatingUIOffset(offsetValue);\n return baseOffset(floatingUIOffset);\n}\n//# sourceMappingURL=offset.js.map"],"names":["offset","offsetValue","floatingUIOffset","getFloatingUIOffset","baseOffset"],"mappings":";;;;+BAKgBA;;aAAAA;;qBALqB;qCACD;AAI7B,SAASA,OAAOC,WAAW,EAAE;IAClC,MAAMC,mBAAmBC,IAAAA,wCAAmB,EAACF;IAC7C,OAAOG,IAAAA,WAAU,EAACF;AACpB,EACA,kCAAkC"}
@@ -1,42 +1,34 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "shift", {
6
+ enumerable: true,
7
+ get: ()=>shift
5
8
  });
6
- exports.shift = void 0;
7
- const dom_1 = /*#__PURE__*/require("@floating-ui/dom");
8
- const index_1 = /*#__PURE__*/require("../utils/index");
9
- /**
10
- * Wraps the floating UI shift middleware for easier usage of our options
11
- */
9
+ const _dom = require("@floating-ui/dom");
10
+ const _index = require("../utils/index");
12
11
  function shift(options) {
13
- const {
14
- hasScrollableElement,
15
- disableTether,
16
- overflowBoundary,
17
- container,
18
- overflowBoundaryPadding,
19
- isRtl
20
- } = options;
21
- return dom_1.shift({
22
- ...(hasScrollableElement && {
23
- boundary: 'clippingAncestors'
24
- }),
25
- ...(disableTether && {
26
- crossAxis: disableTether === 'all',
27
- limiter: dom_1.limitShift({
28
- crossAxis: disableTether !== 'all',
29
- mainAxis: false
30
- })
31
- }),
32
- ...(overflowBoundaryPadding && {
33
- padding: index_1.toFloatingUIPadding(overflowBoundaryPadding, isRtl)
34
- }),
35
- ...(overflowBoundary && {
36
- altBoundary: true,
37
- boundary: index_1.getBoundary(container, overflowBoundary)
38
- })
39
- });
40
- }
41
- exports.shift = shift;
12
+ const { hasScrollableElement , disableTether , overflowBoundary , container , overflowBoundaryPadding , isRtl } = options;
13
+ return (0, _dom.shift)({
14
+ ...hasScrollableElement && {
15
+ boundary: 'clippingAncestors'
16
+ },
17
+ ...disableTether && {
18
+ crossAxis: disableTether === 'all',
19
+ limiter: (0, _dom.limitShift)({
20
+ crossAxis: disableTether !== 'all',
21
+ mainAxis: false
22
+ })
23
+ },
24
+ ...overflowBoundaryPadding && {
25
+ padding: (0, _index.toFloatingUIPadding)(overflowBoundaryPadding, isRtl)
26
+ },
27
+ ...overflowBoundary && {
28
+ altBoundary: true,
29
+ boundary: (0, _index.getBoundary)(container, overflowBoundary)
30
+ }
31
+ });
32
+ } //# sourceMappingURL=shift.js.map
33
+
42
34
  //# sourceMappingURL=shift.js.map
@@ -1 +1 @@
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
+ {"version":3,"sources":["../../lib/middleware/shift.js"],"sourcesContent":["import { shift as baseShift, limitShift } from '@floating-ui/dom';\nimport { getBoundary, toFloatingUIPadding } from '../utils/index';\n/**\n * Wraps the floating UI shift middleware for easier usage of our options\n */\nexport function shift(options) {\n const {\n hasScrollableElement,\n disableTether,\n overflowBoundary,\n container,\n overflowBoundaryPadding,\n isRtl\n } = options;\n return baseShift({\n ...(hasScrollableElement && {\n boundary: 'clippingAncestors'\n }),\n ...(disableTether && {\n crossAxis: disableTether === 'all',\n limiter: limitShift({\n crossAxis: disableTether !== 'all',\n mainAxis: false\n })\n }),\n ...(overflowBoundaryPadding && {\n padding: toFloatingUIPadding(overflowBoundaryPadding, isRtl)\n }),\n ...(overflowBoundary && {\n altBoundary: true,\n boundary: getBoundary(container, overflowBoundary)\n })\n });\n}\n//# sourceMappingURL=shift.js.map"],"names":["shift","options","hasScrollableElement","disableTether","overflowBoundary","container","overflowBoundaryPadding","isRtl","baseShift","boundary","crossAxis","limiter","limitShift","mainAxis","padding","toFloatingUIPadding","altBoundary","getBoundary"],"mappings":";;;;+BAKgBA;;aAAAA;;qBAL+B;uBACE;AAI1C,SAASA,MAAMC,OAAO,EAAE;IAC7B,MAAM,EACJC,qBAAoB,EACpBC,cAAa,EACbC,iBAAgB,EAChBC,UAAS,EACTC,wBAAuB,EACvBC,MAAK,EACN,GAAGN;IACJ,OAAOO,IAAAA,UAAS,EAAC;QACf,GAAIN,wBAAwB;YAC1BO,UAAU;QACZ,CAAC;QACD,GAAIN,iBAAiB;YACnBO,WAAWP,kBAAkB;YAC7BQ,SAASC,IAAAA,eAAU,EAAC;gBAClBF,WAAWP,kBAAkB;gBAC7BU,UAAU,KAAK;YACjB;QACF,CAAC;QACD,GAAIP,2BAA2B;YAC7BQ,SAASC,IAAAA,0BAAmB,EAACT,yBAAyBC;QACxD,CAAC;QACD,GAAIH,oBAAoB;YACtBY,aAAa,IAAI;YACjBP,UAAUQ,IAAAA,kBAAW,EAACZ,WAAWD;QACnC,CAAC;IACH;AACF,EACA,iCAAiC"}
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
5
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
6
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
7
+ //# sourceMappingURL=types.js.map
8
+
6
9
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
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 | 'pinned'\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":""}
1
+ {"version":3,"sources":["../lib/types.js"],"sourcesContent":["import * as React from 'react';\n//# sourceMappingURL=types.js.map"],"names":[],"mappings":";;;;;6DAAuB;CACvB,iCAAiC"}