bootstrap-vue-next 1.2.4 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/dist/{BAccordion-ByAMZCS9.js → BAccordion-BfaVicrj.js} +2 -2
  2. package/dist/{BAccordion-ByAMZCS9.js.map → BAccordion-BfaVicrj.js.map} +1 -1
  3. package/dist/{BAlert-DdfFcjWF.js → BAlert-Czy83dU3.js} +5 -5
  4. package/dist/{BAlert-DdfFcjWF.js.map → BAlert-Czy83dU3.js.map} +1 -1
  5. package/dist/BAutocomplete-Bh4Bp5AI.js +437 -0
  6. package/dist/BAutocomplete-Bh4Bp5AI.js.map +1 -0
  7. package/dist/{BAvatar-BsStQrBF.js → BAvatar-BJNeQ1fe.js} +2 -2
  8. package/dist/{BAvatar-BsStQrBF.js.map → BAvatar-BJNeQ1fe.js.map} +1 -1
  9. package/dist/{BButton-KZu5jczf.js → BButton-DlOQ5sem.js} +2 -2
  10. package/dist/{BButton-KZu5jczf.js.map → BButton-DlOQ5sem.js.map} +1 -1
  11. package/dist/{BCard-DELccMG-.js → BCard-Bc1wed-3.js} +2 -2
  12. package/dist/{BCard-DELccMG-.js.map → BCard-Bc1wed-3.js.map} +1 -1
  13. package/dist/{BCarousel-qHGRSVFe.js → BCarousel-B-WZR469.js} +3 -4
  14. package/dist/{BCarousel-qHGRSVFe.js.map → BCarousel-B-WZR469.js.map} +1 -1
  15. package/dist/{BCollapse-DtuJwN7B.js → BCollapse-DCjKiTxo.js} +2 -2
  16. package/dist/{BCollapse-DtuJwN7B.js.map → BCollapse-DCjKiTxo.js.map} +1 -1
  17. package/dist/BDateField-Oh-cU-4i.js +456 -0
  18. package/dist/BDateField-Oh-cU-4i.js.map +1 -0
  19. package/dist/BDatePicker-HNI11eCe.js +632 -0
  20. package/dist/BDatePicker-HNI11eCe.js.map +1 -0
  21. package/dist/{BDropdown-BY-E0SHv.js → BDropdown-04nGcMhm.js} +6 -7
  22. package/dist/{BDropdown-BY-E0SHv.js.map → BDropdown-04nGcMhm.js.map} +1 -1
  23. package/dist/{BFormCheckbox-BYNGQgr2.js → BFormCheckbox-zjr8OsNd.js} +2 -2
  24. package/dist/{BFormCheckbox-BYNGQgr2.js.map → BFormCheckbox-zjr8OsNd.js.map} +1 -1
  25. package/dist/{BFormFile-C2DnrbK7.js → BFormFile-D_s8tf1m.js} +2 -2
  26. package/dist/{BFormFile-C2DnrbK7.js.map → BFormFile-D_s8tf1m.js.map} +1 -1
  27. package/dist/{BFormInput-_AkAy6Wk.js → BFormInput-DnIBPLCx.js} +2 -2
  28. package/dist/{BFormInput-_AkAy6Wk.js.map → BFormInput-DnIBPLCx.js.map} +1 -1
  29. package/dist/BFormOtp-Dx2RxPAW.js +150 -0
  30. package/dist/BFormOtp-Dx2RxPAW.js.map +1 -0
  31. package/dist/{BFormRadio-DAddcnfE.js → BFormRadio-DUz60sBI.js} +2 -2
  32. package/dist/{BFormRadio-DAddcnfE.js.map → BFormRadio-DUz60sBI.js.map} +1 -1
  33. package/dist/{BFormRating-iKFgSFet.js → BFormRating-CtMmDgrF.js} +2 -2
  34. package/dist/{BFormRating-iKFgSFet.js.map → BFormRating-CtMmDgrF.js.map} +1 -1
  35. package/dist/{BFormSelect-CSS-_kul.js → BFormSelect-CeslPN3i.js} +2 -3
  36. package/dist/{BFormSelect-CSS-_kul.js.map → BFormSelect-CeslPN3i.js.map} +1 -1
  37. package/dist/{BFormSpinbutton-fkVMbQC3.js → BFormSpinbutton-BR9YTfYy.js} +2 -3
  38. package/dist/{BFormSpinbutton-fkVMbQC3.js.map → BFormSpinbutton-BR9YTfYy.js.map} +1 -1
  39. package/dist/{BFormTags-CUcyRTCK.js → BFormTags-6qQn0Vlv.js} +2 -3
  40. package/dist/{BFormTags-CUcyRTCK.js.map → BFormTags-6qQn0Vlv.js.map} +1 -1
  41. package/dist/{BFormTextarea-CBBlEcrV.js → BFormTextarea-DvLrtG08.js} +3 -3
  42. package/dist/{BFormTextarea-CBBlEcrV.js.map → BFormTextarea-DvLrtG08.js.map} +1 -1
  43. package/dist/{BImg-knz2UZQE.js → BImg-Dd8Pc1Ln.js} +2 -2
  44. package/dist/{BImg-knz2UZQE.js.map → BImg-Dd8Pc1Ln.js.map} +1 -1
  45. package/dist/{BModal-DtQlIFNn.js → BModal-DOmTYI6F.js} +5 -6
  46. package/dist/{BModal-DtQlIFNn.js.map → BModal-DOmTYI6F.js.map} +1 -1
  47. package/dist/{BNav-BMWNXoNo.js → BNav-D3XbyI1R.js} +2 -2
  48. package/dist/{BNav-BMWNXoNo.js.map → BNav-D3XbyI1R.js.map} +1 -1
  49. package/dist/{BOffcanvas-BtvIDgH7.js → BOffcanvas-DyPG7s8I.js} +5 -5
  50. package/dist/{BOffcanvas-BtvIDgH7.js.map → BOffcanvas-DyPG7s8I.js.map} +1 -1
  51. package/dist/{BPagination-C85wHRgS.js → BPagination-DGvgWeYG.js} +2 -2
  52. package/dist/{BPagination-C85wHRgS.js.map → BPagination-DGvgWeYG.js.map} +1 -1
  53. package/dist/{BPlaceholder-DI12zz0a.js → BPlaceholder-BrBmbfIg.js} +3 -3
  54. package/dist/{BPlaceholder-DI12zz0a.js.map → BPlaceholder-BrBmbfIg.js.map} +1 -1
  55. package/dist/{BProgress-BNxYppi-.js → BProgress-CXhe6hsN.js} +2 -2
  56. package/dist/{BProgress-BNxYppi-.js.map → BProgress-CXhe6hsN.js.map} +1 -1
  57. package/dist/{BTable-BZxX17YU.js → BTable-8jp3wPAI.js} +2 -2
  58. package/dist/{BTable-BZxX17YU.js.map → BTable-8jp3wPAI.js.map} +1 -1
  59. package/dist/BTimeField-vdultTwg.js +138 -0
  60. package/dist/BTimeField-vdultTwg.js.map +1 -0
  61. package/dist/{BToast-Cm7TZlZq.js → BToast-vxfpFGe3.js} +5 -5
  62. package/dist/{BToast-Cm7TZlZq.js.map → BToast-vxfpFGe3.js.map} +1 -1
  63. package/dist/{BTooltip-CAgQ77tS.js → BTooltip-CV5Ogidy.js} +2 -2
  64. package/dist/{BTooltip-CAgQ77tS.js.map → BTooltip-CV5Ogidy.js.map} +1 -1
  65. package/dist/bootstrap-vue-next.mjs +33 -33
  66. package/dist/{floatingUi-CSJCHfOw.js → floatingUi-BhgR4GBJ.js} +10 -168
  67. package/dist/floatingUi-BhgR4GBJ.js.map +1 -0
  68. package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
  69. package/dist/src/components/BAccordion/index.mjs +1 -1
  70. package/dist/src/components/BAlert/index.mjs +1 -1
  71. package/dist/src/components/BAutocomplete/index.mjs +1 -1
  72. package/dist/src/components/BAvatar/index.mjs +1 -1
  73. package/dist/src/components/BButton/index.mjs +1 -1
  74. package/dist/src/components/BCard/index.mjs +1 -1
  75. package/dist/src/components/BCarousel/index.mjs +1 -1
  76. package/dist/src/components/BCollapse/index.mjs +1 -1
  77. package/dist/src/components/BDateField/index.mjs +1 -1
  78. package/dist/src/components/BDatePicker/index.mjs +1 -1
  79. package/dist/src/components/BDropdown/index.mjs +1 -1
  80. package/dist/src/components/BFormCheckbox/index.mjs +1 -1
  81. package/dist/src/components/BFormFile/index.mjs +1 -1
  82. package/dist/src/components/BFormInput/index.mjs +1 -1
  83. package/dist/src/components/BFormOtp/index.mjs +1 -1
  84. package/dist/src/components/BFormRadio/index.mjs +1 -1
  85. package/dist/src/components/BFormRating/index.mjs +1 -1
  86. package/dist/src/components/BFormSelect/index.mjs +1 -1
  87. package/dist/src/components/BFormSpinbutton/index.mjs +1 -1
  88. package/dist/src/components/BFormTags/index.mjs +1 -1
  89. package/dist/src/components/BFormTextarea/index.mjs +1 -1
  90. package/dist/src/components/BImg/index.mjs +1 -1
  91. package/dist/src/components/BModal/index.mjs +1 -1
  92. package/dist/src/components/BNav/index.mjs +1 -1
  93. package/dist/src/components/BOffcanvas/index.mjs +1 -1
  94. package/dist/src/components/BPagination/index.mjs +1 -1
  95. package/dist/src/components/BPlaceholder/index.mjs +1 -1
  96. package/dist/src/components/BPopover/index.mjs +1 -1
  97. package/dist/src/components/BProgress/index.mjs +1 -1
  98. package/dist/src/components/BTable/index.mjs +1 -1
  99. package/dist/src/components/BTimeField/index.mjs +1 -1
  100. package/dist/src/components/BToast/index.mjs +1 -1
  101. package/dist/src/components/BTooltip/index.mjs +1 -1
  102. package/dist/src/components/index.mjs +34 -34
  103. package/dist/src/composables/index.mjs +1 -1
  104. package/dist/src/composables/useColorMode/index.mjs +1 -1
  105. package/dist/src/composables/useModal/index.mjs +1 -1
  106. package/dist/src/composables/usePopover/index.mjs +2 -2
  107. package/dist/src/composables/useScrollLock/index.mjs +1 -2
  108. package/dist/src/composables/useScrollLock/index.mjs.map +1 -1
  109. package/dist/src/composables/useScrollspy/index.mjs +1 -2
  110. package/dist/src/composables/useScrollspy/index.mjs.map +1 -1
  111. package/dist/src/composables/useToast/index.mjs +1 -1
  112. package/dist/src/directives/BPopover/index.mjs +2 -2
  113. package/dist/src/directives/BScrollspy/index.mjs +1 -1
  114. package/dist/src/directives/BToggle/index.mjs +1 -1
  115. package/dist/src/directives/BTooltip/index.mjs +2 -2
  116. package/dist/src/directives/index.mjs +1 -1
  117. package/dist/src/plugins/index.mjs +1 -1
  118. package/dist/src/resolvers/index.mjs +1 -1
  119. package/dist/src/types/index.mjs +1 -1
  120. package/dist/src/utils/index.mjs +1 -1
  121. package/dist/{useCountdownHover-BN8vJIQW.js → useCountdownHover-HZSJZkHq.js} +2 -2
  122. package/dist/{useCountdownHover-BN8vJIQW.js.map → useCountdownHover-HZSJZkHq.js.map} +1 -1
  123. package/dist/{useFormInput-C-iXRxog.js → useFormInput-CMtXFoM2.js} +2 -3
  124. package/dist/{useFormInput-C-iXRxog.js.map → useFormInput-CMtXFoM2.js.map} +1 -1
  125. package/dist/useSafeScrollLock-BT4KKhxB.js +89 -0
  126. package/dist/useSafeScrollLock-BT4KKhxB.js.map +1 -0
  127. package/dist/{useShowHide-Dpld86ys.js → useShowHide-BLIZLD9E.js} +2 -3
  128. package/dist/{useShowHide-Dpld86ys.js.map → useShowHide-BLIZLD9E.js.map} +1 -1
  129. package/dist/{utils-DYdkCKBf.js → utils-CvjliJBf.js} +2 -2
  130. package/dist/{utils-DYdkCKBf.js.map → utils-CvjliJBf.js.map} +1 -1
  131. package/package.json +3 -23
  132. package/dist/BAutocomplete-BFbbKtpz.js +0 -2490
  133. package/dist/BAutocomplete-BFbbKtpz.js.map +0 -1
  134. package/dist/BDateField-Bj-Jz7u4.js +0 -906
  135. package/dist/BDateField-Bj-Jz7u4.js.map +0 -1
  136. package/dist/BDatePicker-AVTYcVLy.js +0 -5210
  137. package/dist/BDatePicker-AVTYcVLy.js.map +0 -1
  138. package/dist/BFormOtp-ClDACqXM.js +0 -577
  139. package/dist/BFormOtp-ClDACqXM.js.map +0 -1
  140. package/dist/BTimeField-CbRGjaI6.js +0 -516
  141. package/dist/BTimeField-CbRGjaI6.js.map +0 -1
  142. package/dist/DateRangeFieldInput-Cbzjg8iF.js +0 -761
  143. package/dist/DateRangeFieldInput-Cbzjg8iF.js.map +0 -1
  144. package/dist/PopperContent-C9eeL6LH.js +0 -1726
  145. package/dist/PopperContent-C9eeL6LH.js.map +0 -1
  146. package/dist/VisuallyHidden-BYzyjJiY.js +0 -182
  147. package/dist/VisuallyHidden-BYzyjJiY.js.map +0 -1
  148. package/dist/VisuallyHiddenInput-CUrc8XXa.js +0 -180
  149. package/dist/VisuallyHiddenInput-CUrc8XXa.js.map +0 -1
  150. package/dist/dist-9-XTMhb-.js +0 -1302
  151. package/dist/dist-9-XTMhb-.js.map +0 -1
  152. package/dist/dist-B-regXAP.js +0 -123
  153. package/dist/dist-B-regXAP.js.map +0 -1
  154. package/dist/dist-DKc2ivHS.js +0 -411
  155. package/dist/dist-DKc2ivHS.js.map +0 -1
  156. package/dist/floating-ui.dom-C7UZexJK.js +0 -1484
  157. package/dist/floating-ui.dom-C7UZexJK.js.map +0 -1
  158. package/dist/floatingUi-CSJCHfOw.js.map +0 -1
  159. package/dist/rolldown-runtime-BBjsoOtd.js +0 -27
  160. package/dist/useDateField-CQZb799C.js +0 -3679
  161. package/dist/useDateField-CQZb799C.js.map +0 -1
  162. package/dist/useForwardExpose-DDvk7mir.js +0 -60
  163. package/dist/useForwardExpose-DDvk7mir.js.map +0 -1
  164. package/dist/useKbd-DRsaFU_f.js +0 -76
  165. package/dist/useKbd-DRsaFU_f.js.map +0 -1
  166. package/dist/useSafeScrollLock-PVgSASYu.js +0 -1326
  167. package/dist/useSafeScrollLock-PVgSASYu.js.map +0 -1
@@ -1,1484 +0,0 @@
1
- //#region ../../node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
2
- /**
3
- * Custom positioning reference element.
4
- * @see https://floating-ui.com/docs/virtual-elements
5
- */
6
- var sides = [
7
- "top",
8
- "right",
9
- "bottom",
10
- "left"
11
- ];
12
- var alignments = ["start", "end"];
13
- var placements = /*#__PURE__*/ sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
14
- var min = Math.min;
15
- var max = Math.max;
16
- var round = Math.round;
17
- var floor = Math.floor;
18
- var createCoords = (v) => ({
19
- x: v,
20
- y: v
21
- });
22
- var oppositeSideMap = {
23
- left: "right",
24
- right: "left",
25
- bottom: "top",
26
- top: "bottom"
27
- };
28
- function clamp(start, value, end) {
29
- return max(start, min(value, end));
30
- }
31
- function evaluate(value, param) {
32
- return typeof value === "function" ? value(param) : value;
33
- }
34
- function getSide(placement) {
35
- return placement.split("-")[0];
36
- }
37
- function getAlignment(placement) {
38
- return placement.split("-")[1];
39
- }
40
- function getOppositeAxis(axis) {
41
- return axis === "x" ? "y" : "x";
42
- }
43
- function getAxisLength(axis) {
44
- return axis === "y" ? "height" : "width";
45
- }
46
- function getSideAxis(placement) {
47
- const firstChar = placement[0];
48
- return firstChar === "t" || firstChar === "b" ? "y" : "x";
49
- }
50
- function getAlignmentAxis(placement) {
51
- return getOppositeAxis(getSideAxis(placement));
52
- }
53
- function getAlignmentSides(placement, rects, rtl) {
54
- if (rtl === void 0) rtl = false;
55
- const alignment = getAlignment(placement);
56
- const alignmentAxis = getAlignmentAxis(placement);
57
- const length = getAxisLength(alignmentAxis);
58
- let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
59
- if (rects.reference[length] > rects.floating[length]) mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
60
- return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
61
- }
62
- function getExpandedPlacements(placement) {
63
- const oppositePlacement = getOppositePlacement(placement);
64
- return [
65
- getOppositeAlignmentPlacement(placement),
66
- oppositePlacement,
67
- getOppositeAlignmentPlacement(oppositePlacement)
68
- ];
69
- }
70
- function getOppositeAlignmentPlacement(placement) {
71
- return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start");
72
- }
73
- var lrPlacement = ["left", "right"];
74
- var rlPlacement = ["right", "left"];
75
- var tbPlacement = ["top", "bottom"];
76
- var btPlacement = ["bottom", "top"];
77
- function getSideList(side, isStart, rtl) {
78
- switch (side) {
79
- case "top":
80
- case "bottom":
81
- if (rtl) return isStart ? rlPlacement : lrPlacement;
82
- return isStart ? lrPlacement : rlPlacement;
83
- case "left":
84
- case "right": return isStart ? tbPlacement : btPlacement;
85
- default: return [];
86
- }
87
- }
88
- function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
89
- const alignment = getAlignment(placement);
90
- let list = getSideList(getSide(placement), direction === "start", rtl);
91
- if (alignment) {
92
- list = list.map((side) => side + "-" + alignment);
93
- if (flipAlignment) list = list.concat(list.map(getOppositeAlignmentPlacement));
94
- }
95
- return list;
96
- }
97
- function getOppositePlacement(placement) {
98
- const side = getSide(placement);
99
- return oppositeSideMap[side] + placement.slice(side.length);
100
- }
101
- function expandPaddingObject(padding) {
102
- var _padding$top, _padding$right, _padding$bottom, _padding$left;
103
- return {
104
- top: (_padding$top = padding.top) != null ? _padding$top : 0,
105
- right: (_padding$right = padding.right) != null ? _padding$right : 0,
106
- bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,
107
- left: (_padding$left = padding.left) != null ? _padding$left : 0
108
- };
109
- }
110
- function getPaddingObject(padding) {
111
- return typeof padding !== "number" ? expandPaddingObject(padding) : {
112
- top: padding,
113
- right: padding,
114
- bottom: padding,
115
- left: padding
116
- };
117
- }
118
- function rectToClientRect(rect) {
119
- const { x, y, width, height } = rect;
120
- return {
121
- width,
122
- height,
123
- top: y,
124
- left: x,
125
- right: x + width,
126
- bottom: y + height,
127
- x,
128
- y
129
- };
130
- }
131
- //#endregion
132
- //#region ../../node_modules/.pnpm/@floating-ui+core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
133
- function computeCoordsFromPlacement(_ref, placement, rtl) {
134
- let { reference, floating } = _ref;
135
- const sideAxis = getSideAxis(placement);
136
- const alignmentAxis = getAlignmentAxis(placement);
137
- const alignLength = getAxisLength(alignmentAxis);
138
- const side = getSide(placement);
139
- const isVertical = sideAxis === "y";
140
- const commonX = reference.x + reference.width / 2 - floating.width / 2;
141
- const commonY = reference.y + reference.height / 2 - floating.height / 2;
142
- const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
143
- let coords;
144
- switch (side) {
145
- case "top":
146
- coords = {
147
- x: commonX,
148
- y: reference.y - floating.height
149
- };
150
- break;
151
- case "bottom":
152
- coords = {
153
- x: commonX,
154
- y: reference.y + reference.height
155
- };
156
- break;
157
- case "right":
158
- coords = {
159
- x: reference.x + reference.width,
160
- y: commonY
161
- };
162
- break;
163
- case "left":
164
- coords = {
165
- x: reference.x - floating.width,
166
- y: commonY
167
- };
168
- break;
169
- default: coords = {
170
- x: reference.x,
171
- y: reference.y
172
- };
173
- }
174
- const alignment = getAlignment(placement);
175
- if (alignment) coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1);
176
- return coords;
177
- }
178
- /**
179
- * Resolves with an object of overflow side offsets that determine how much the
180
- * element is overflowing a given clipping boundary on each side.
181
- * - positive = overflowing the boundary by that number of pixels
182
- * - negative = how many pixels left before it will overflow
183
- * - 0 = lies flush with the boundary
184
- * @see https://floating-ui.com/docs/detectOverflow
185
- */
186
- async function detectOverflow(state, options) {
187
- var _await$platform$isEle;
188
- if (options === void 0) options = {};
189
- const { x, y, platform, rects, elements, strategy } = state;
190
- const { boundary = "clippingAncestors", rootBoundary = "viewport", elementContext = "floating", altBoundary = false, padding = 0 } = evaluate(options, state);
191
- const paddingObject = getPaddingObject(padding);
192
- const element = elements[altBoundary ? elementContext === "floating" ? "reference" : "floating" : elementContext];
193
- const clippingClientRect = rectToClientRect(await platform.getClippingRect({
194
- element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating)),
195
- boundary,
196
- rootBoundary,
197
- strategy
198
- }));
199
- const rect = elementContext === "floating" ? {
200
- x,
201
- y,
202
- width: rects.floating.width,
203
- height: rects.floating.height
204
- } : rects.reference;
205
- const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
206
- const offsetScale = await (platform.isElement == null ? void 0 : platform.isElement(offsetParent)) && await (platform.getScale == null ? void 0 : platform.getScale(offsetParent)) || {
207
- x: 1,
208
- y: 1
209
- };
210
- const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
211
- elements,
212
- rect,
213
- offsetParent,
214
- strategy
215
- }) : rect);
216
- return {
217
- top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
218
- bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
219
- left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
220
- right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
221
- };
222
- }
223
- var MAX_RESET_COUNT = 50;
224
- /**
225
- * Computes the `x` and `y` coordinates that will place the floating element
226
- * next to a given reference element.
227
- *
228
- * This export does not have any `platform` interface logic. You will need to
229
- * write one for the platform you are using Floating UI with.
230
- */
231
- var computePosition$1 = async (reference, floating, config) => {
232
- const { placement = "bottom", strategy = "absolute", middleware = [], platform } = config;
233
- const platformWithDetectOverflow = platform.detectOverflow ? platform : {
234
- ...platform,
235
- detectOverflow
236
- };
237
- const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
238
- let rects = await platform.getElementRects({
239
- reference,
240
- floating,
241
- strategy
242
- });
243
- let { x, y } = computeCoordsFromPlacement(rects, placement, rtl);
244
- let statefulPlacement = placement;
245
- let resetCount = 0;
246
- const middlewareData = {};
247
- for (let i = 0; i < middleware.length; i++) {
248
- const currentMiddleware = middleware[i];
249
- if (!currentMiddleware) continue;
250
- const { name, fn } = currentMiddleware;
251
- const { x: nextX, y: nextY, data, reset } = await fn({
252
- x,
253
- y,
254
- initialPlacement: placement,
255
- placement: statefulPlacement,
256
- strategy,
257
- middlewareData,
258
- rects,
259
- platform: platformWithDetectOverflow,
260
- elements: {
261
- reference,
262
- floating
263
- }
264
- });
265
- x = nextX != null ? nextX : x;
266
- y = nextY != null ? nextY : y;
267
- middlewareData[name] = {
268
- ...middlewareData[name],
269
- ...data
270
- };
271
- if (reset && resetCount < MAX_RESET_COUNT) {
272
- resetCount++;
273
- if (typeof reset === "object") {
274
- if (reset.placement) statefulPlacement = reset.placement;
275
- if (reset.rects) rects = reset.rects === true ? await platform.getElementRects({
276
- reference,
277
- floating,
278
- strategy
279
- }) : reset.rects;
280
- ({x, y} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
281
- }
282
- i = -1;
283
- }
284
- }
285
- return {
286
- x,
287
- y,
288
- placement: statefulPlacement,
289
- strategy,
290
- middlewareData
291
- };
292
- };
293
- /**
294
- * Provides data to position an inner element of the floating element so that it
295
- * appears centered to the reference element.
296
- * @see https://floating-ui.com/docs/arrow
297
- */
298
- var arrow$1 = (options) => ({
299
- name: "arrow",
300
- options,
301
- async fn(state) {
302
- const { x, y, placement, rects, platform, elements, middlewareData } = state;
303
- const { element, padding = 0 } = evaluate(options, state) || {};
304
- if (element == null) return {};
305
- const paddingObject = getPaddingObject(padding);
306
- const coords = {
307
- x,
308
- y
309
- };
310
- const axis = getAlignmentAxis(placement);
311
- const length = getAxisLength(axis);
312
- const arrowDimensions = await platform.getDimensions(element);
313
- const isYAxis = axis === "y";
314
- const minProp = isYAxis ? "top" : "left";
315
- const maxProp = isYAxis ? "bottom" : "right";
316
- const clientProp = isYAxis ? "clientHeight" : "clientWidth";
317
- const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
318
- const startDiff = coords[axis] - rects.reference[axis];
319
- const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
320
- let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
321
- if (!clientSize || !await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent))) clientSize = elements.floating[clientProp] || rects.floating[length];
322
- const centerToReference = endDiff / 2 - startDiff / 2;
323
- const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
324
- const minPadding = min(paddingObject[minProp], largestPossiblePadding);
325
- const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
326
- const max = clientSize - arrowDimensions[length] - maxPadding;
327
- const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
328
- const offset = clamp(minPadding, center, max);
329
- const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < minPadding ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
330
- const alignmentOffset = shouldAddOffset ? center < minPadding ? center - minPadding : center - max : 0;
331
- return {
332
- [axis]: coords[axis] + alignmentOffset,
333
- data: {
334
- [axis]: offset,
335
- centerOffset: center - offset - alignmentOffset,
336
- ...shouldAddOffset && { alignmentOffset }
337
- },
338
- reset: shouldAddOffset
339
- };
340
- }
341
- });
342
- function getPlacementList(alignment, autoAlignment, allowedPlacements) {
343
- return (alignment ? [...allowedPlacements.filter((placement) => getAlignment(placement) === alignment), ...allowedPlacements.filter((placement) => getAlignment(placement) !== alignment)] : allowedPlacements.filter((placement) => getSide(placement) === placement)).filter((placement) => {
344
- if (alignment) return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
345
- return true;
346
- });
347
- }
348
- /**
349
- * Optimizes the visibility of the floating element by choosing the placement
350
- * that has the most space available automatically, without needing to specify a
351
- * preferred placement. Alternative to `flip`.
352
- * @see https://floating-ui.com/docs/autoPlacement
353
- */
354
- var autoPlacement$1 = function(options) {
355
- if (options === void 0) options = {};
356
- return {
357
- name: "autoPlacement",
358
- options,
359
- async fn(state) {
360
- var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
361
- const { rects, middlewareData, placement, platform, elements } = state;
362
- const { crossAxis = false, alignment, allowedPlacements = placements, autoAlignment = true, ...detectOverflowOptions } = evaluate(options, state);
363
- const placements$1 = alignment !== void 0 || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
364
- const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
365
- const currentPlacement = placements$1[currentIndex];
366
- if (currentPlacement == null) return {};
367
- if (placement !== currentPlacement) return { reset: { placement: placements$1[0] } };
368
- const overflow = await platform.detectOverflow(state, detectOverflowOptions);
369
- const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
370
- const currentOverflows = [
371
- overflow[getSide(currentPlacement)],
372
- overflow[alignmentSides[0]],
373
- overflow[alignmentSides[1]]
374
- ];
375
- const allOverflows = [...((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || [], {
376
- placement: currentPlacement,
377
- overflows: currentOverflows
378
- }];
379
- const nextPlacement = placements$1[currentIndex + 1];
380
- if (nextPlacement) return {
381
- data: {
382
- index: currentIndex + 1,
383
- overflows: allOverflows
384
- },
385
- reset: { placement: nextPlacement }
386
- };
387
- const placementsSortedByMostSpace = allOverflows.map((d) => {
388
- const alignment = getAlignment(d.placement);
389
- return [
390
- d.placement,
391
- alignment && crossAxis ? d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) : d.overflows[0],
392
- d.overflows
393
- ];
394
- }).sort((a, b) => a[1] - b[1]);
395
- const resetPlacement = ((_placementsThatFitOnE = placementsSortedByMostSpace.filter((d) => d[2].slice(0, getAlignment(d[0]) ? 2 : 3).every((v) => v <= 0))[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
396
- if (resetPlacement !== placement) return {
397
- data: {
398
- index: currentIndex + 1,
399
- overflows: allOverflows
400
- },
401
- reset: { placement: resetPlacement }
402
- };
403
- return {};
404
- }
405
- };
406
- };
407
- /**
408
- * Optimizes the visibility of the floating element by flipping the `placement`
409
- * in order to keep it in view when the preferred placement(s) will overflow the
410
- * clipping boundary. Alternative to `autoPlacement`.
411
- * @see https://floating-ui.com/docs/flip
412
- */
413
- var flip$1 = function(options) {
414
- if (options === void 0) options = {};
415
- return {
416
- name: "flip",
417
- options,
418
- async fn(state) {
419
- var _middlewareData$arrow, _middlewareData$flip;
420
- const { placement, middlewareData, rects, initialPlacement, platform, elements } = state;
421
- const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true, fallbackPlacements: specifiedFallbackPlacements, fallbackStrategy = "bestFit", fallbackAxisSideDirection = "none", flipAlignment = true, ...detectOverflowOptions } = evaluate(options, state);
422
- if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) return {};
423
- const side = getSide(placement);
424
- const initialSideAxis = getSideAxis(initialPlacement);
425
- const isBasePlacement = getSide(initialPlacement) === initialPlacement;
426
- const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
427
- const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
428
- const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
429
- if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
430
- const placements = [initialPlacement, ...fallbackPlacements];
431
- const overflow = await platform.detectOverflow(state, detectOverflowOptions);
432
- const overflows = [];
433
- let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
434
- if (checkMainAxis) overflows.push(overflow[side]);
435
- if (checkCrossAxis) {
436
- const sides = getAlignmentSides(placement, rects, rtl);
437
- overflows.push(overflow[sides[0]], overflow[sides[1]]);
438
- }
439
- overflowsData = [...overflowsData, {
440
- placement,
441
- overflows
442
- }];
443
- if (!overflows.every((side) => side <= 0)) {
444
- var _middlewareData$flip2, _overflowsData$filter;
445
- const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
446
- const nextPlacement = placements[nextIndex];
447
- if (nextPlacement) {
448
- if (!(checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false) || overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) return {
449
- data: {
450
- index: nextIndex,
451
- overflows: overflowsData
452
- },
453
- reset: { placement: nextPlacement }
454
- };
455
- }
456
- let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
457
- if (!resetPlacement) switch (fallbackStrategy) {
458
- case "bestFit": {
459
- var _overflowsData$filter2;
460
- const placement = (_overflowsData$filter2 = overflowsData.filter((d) => {
461
- if (hasFallbackAxisSideDirection) {
462
- const currentSideAxis = getSideAxis(d.placement);
463
- return currentSideAxis === initialSideAxis || currentSideAxis === "y";
464
- }
465
- return true;
466
- }).map((d) => [d.placement, d.overflows.filter((overflow) => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
467
- if (placement) resetPlacement = placement;
468
- break;
469
- }
470
- case "initialPlacement": resetPlacement = initialPlacement;
471
- }
472
- if (placement !== resetPlacement) return { reset: { placement: resetPlacement } };
473
- }
474
- return {};
475
- }
476
- };
477
- };
478
- function getSideOffsets(overflow, rect) {
479
- return {
480
- top: overflow.top - rect.height,
481
- right: overflow.right - rect.width,
482
- bottom: overflow.bottom - rect.height,
483
- left: overflow.left - rect.width
484
- };
485
- }
486
- function isAnySideFullyClipped(overflow) {
487
- return sides.some((side) => overflow[side] >= 0);
488
- }
489
- /**
490
- * Provides data to hide the floating element in applicable situations, such as
491
- * when it is not in the same clipping context as the reference element.
492
- * @see https://floating-ui.com/docs/hide
493
- */
494
- var hide$1 = function(options) {
495
- if (options === void 0) options = {};
496
- return {
497
- name: "hide",
498
- options,
499
- async fn(state) {
500
- const { rects, platform } = state;
501
- const { strategy = "referenceHidden", ...detectOverflowOptions } = evaluate(options, state);
502
- switch (strategy) {
503
- case "referenceHidden": {
504
- const offsets = getSideOffsets(await platform.detectOverflow(state, {
505
- ...detectOverflowOptions,
506
- elementContext: "reference"
507
- }), rects.reference);
508
- return { data: {
509
- referenceHiddenOffsets: offsets,
510
- referenceHidden: isAnySideFullyClipped(offsets)
511
- } };
512
- }
513
- case "escaped": {
514
- const offsets = getSideOffsets(await platform.detectOverflow(state, {
515
- ...detectOverflowOptions,
516
- altBoundary: true
517
- }), rects.floating);
518
- return { data: {
519
- escapedOffsets: offsets,
520
- escaped: isAnySideFullyClipped(offsets)
521
- } };
522
- }
523
- default: return {};
524
- }
525
- }
526
- };
527
- };
528
- function getBoundingRect(rects) {
529
- const minX = min(...rects.map((rect) => rect.left));
530
- const minY = min(...rects.map((rect) => rect.top));
531
- const maxX = max(...rects.map((rect) => rect.right));
532
- const maxY = max(...rects.map((rect) => rect.bottom));
533
- return {
534
- x: minX,
535
- y: minY,
536
- width: maxX - minX,
537
- height: maxY - minY
538
- };
539
- }
540
- function getRectsByLine(rects) {
541
- const sortedRects = rects.slice().sort((a, b) => a.y - b.y);
542
- const groups = [];
543
- let prevRect = null;
544
- for (let i = 0; i < sortedRects.length; i++) {
545
- const rect = sortedRects[i];
546
- if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) groups.push([rect]);
547
- else groups[groups.length - 1].push(rect);
548
- prevRect = rect;
549
- }
550
- return groups.map((rect) => rectToClientRect(getBoundingRect(rect)));
551
- }
552
- /**
553
- * Provides improved positioning for inline reference elements that can span
554
- * over multiple lines, such as hyperlinks or range selections.
555
- * @see https://floating-ui.com/docs/inline
556
- */
557
- var inline$1 = function(options) {
558
- if (options === void 0) options = {};
559
- return {
560
- name: "inline",
561
- options,
562
- async fn(state) {
563
- const { placement, elements, rects, platform, strategy } = state;
564
- const { padding = 2, x, y } = evaluate(options, state);
565
- const nativeClientRects = Array.from(await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference)) || []);
566
- if (!nativeClientRects.length) return {};
567
- const clientRects = getRectsByLine(nativeClientRects);
568
- const fallback = rectToClientRect(getBoundingRect(nativeClientRects));
569
- const paddingObject = getPaddingObject(padding);
570
- function getBoundingClientRect() {
571
- if (clientRects.length === 2 && (clientRects[0].left > clientRects[1].right || clientRects[1].left > clientRects[0].right) && x != null && y != null) return clientRects.find((rect) => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
572
- if (clientRects.length >= 2) {
573
- if (getSideAxis(placement) === "y") {
574
- const firstRect = clientRects[0];
575
- const lastRect = clientRects[clientRects.length - 1];
576
- const isTop = getSide(placement) === "top";
577
- const top = firstRect.top;
578
- const bottom = lastRect.bottom;
579
- const left = isTop ? firstRect.left : lastRect.left;
580
- return rectToClientRect({
581
- x: left,
582
- y: top,
583
- width: (isTop ? firstRect.right : lastRect.right) - left,
584
- height: bottom - top
585
- });
586
- }
587
- const isLeftSide = getSide(placement) === "left";
588
- const maxRight = max(...clientRects.map((rect) => rect.right));
589
- const minLeft = min(...clientRects.map((rect) => rect.left));
590
- const measureRects = clientRects.filter((rect) => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
591
- const top = measureRects[0].top;
592
- const bottom = measureRects[measureRects.length - 1].bottom;
593
- return rectToClientRect({
594
- x: minLeft,
595
- y: top,
596
- width: maxRight - minLeft,
597
- height: bottom - top
598
- });
599
- }
600
- return fallback;
601
- }
602
- const resetRects = await platform.getElementRects({
603
- reference: { getBoundingClientRect },
604
- floating: elements.floating,
605
- strategy
606
- });
607
- if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) return { reset: { rects: resetRects } };
608
- return {};
609
- }
610
- };
611
- };
612
- var originSides = /*#__PURE__*/ new Set(["left", "top"]);
613
- async function convertValueToCoords(state, options) {
614
- const { placement, platform, elements } = state;
615
- const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
616
- const side = getSide(placement);
617
- const alignment = getAlignment(placement);
618
- const isVertical = getSideAxis(placement) === "y";
619
- const mainAxisMulti = originSides.has(side) ? -1 : 1;
620
- const crossAxisMulti = rtl && isVertical ? -1 : 1;
621
- const rawValue = evaluate(options, state);
622
- let { mainAxis, crossAxis, alignmentAxis } = typeof rawValue === "number" ? {
623
- mainAxis: rawValue,
624
- crossAxis: 0,
625
- alignmentAxis: null
626
- } : {
627
- mainAxis: rawValue.mainAxis || 0,
628
- crossAxis: rawValue.crossAxis || 0,
629
- alignmentAxis: rawValue.alignmentAxis
630
- };
631
- if (alignment && typeof alignmentAxis === "number") crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
632
- return isVertical ? {
633
- x: crossAxis * crossAxisMulti,
634
- y: mainAxis * mainAxisMulti
635
- } : {
636
- x: mainAxis * mainAxisMulti,
637
- y: crossAxis * crossAxisMulti
638
- };
639
- }
640
- /**
641
- * Modifies the placement by translating the floating element along the
642
- * specified axes.
643
- * A number (shorthand for `mainAxis` or distance), or an axes configuration
644
- * object may be passed.
645
- * @see https://floating-ui.com/docs/offset
646
- */
647
- var offset$1 = function(options) {
648
- if (options === void 0) options = 0;
649
- return {
650
- name: "offset",
651
- options,
652
- async fn(state) {
653
- var _middlewareData$offse, _middlewareData$arrow;
654
- const { x, y, placement, middlewareData } = state;
655
- const diffCoords = await convertValueToCoords(state, options);
656
- if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) return {};
657
- return {
658
- x: x + diffCoords.x,
659
- y: y + diffCoords.y,
660
- data: {
661
- ...diffCoords,
662
- placement
663
- }
664
- };
665
- }
666
- };
667
- };
668
- /**
669
- * Optimizes the visibility of the floating element by shifting it in order to
670
- * keep it in view when it will overflow the clipping boundary.
671
- * @see https://floating-ui.com/docs/shift
672
- */
673
- var shift$1 = function(options) {
674
- if (options === void 0) options = {};
675
- return {
676
- name: "shift",
677
- options,
678
- async fn(state) {
679
- const { x, y, placement, platform } = state;
680
- const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = false, limiter = { fn: (_ref) => {
681
- let { x, y } = _ref;
682
- return {
683
- x,
684
- y
685
- };
686
- } }, ...detectOverflowOptions } = evaluate(options, state);
687
- const coords = {
688
- x,
689
- y
690
- };
691
- const overflow = await platform.detectOverflow(state, detectOverflowOptions);
692
- const crossAxis = getSideAxis(placement);
693
- const mainAxis = getOppositeAxis(crossAxis);
694
- let mainAxisCoord = coords[mainAxis];
695
- let crossAxisCoord = coords[crossAxis];
696
- const clampCoord = (axis, coord) => clamp(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]);
697
- if (checkMainAxis) mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);
698
- if (checkCrossAxis) crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);
699
- const limitedCoords = limiter.fn({
700
- ...state,
701
- [mainAxis]: mainAxisCoord,
702
- [crossAxis]: crossAxisCoord
703
- });
704
- return {
705
- ...limitedCoords,
706
- data: {
707
- x: limitedCoords.x - x,
708
- y: limitedCoords.y - y,
709
- enabled: {
710
- [mainAxis]: checkMainAxis,
711
- [crossAxis]: checkCrossAxis
712
- }
713
- }
714
- };
715
- }
716
- };
717
- };
718
- /**
719
- * Built-in `limiter` that will stop `shift()` at a certain point.
720
- */
721
- var limitShift$1 = function(options) {
722
- if (options === void 0) options = {};
723
- return {
724
- options,
725
- fn(state) {
726
- var _rawOffset$mainAxis, _rawOffset$crossAxis;
727
- const { x, y, placement, rects, middlewareData } = state;
728
- const { offset = 0, mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true } = evaluate(options, state);
729
- const coords = {
730
- x,
731
- y
732
- };
733
- const crossAxis = getSideAxis(placement);
734
- const mainAxis = getOppositeAxis(crossAxis);
735
- let mainAxisCoord = coords[mainAxis];
736
- let crossAxisCoord = coords[crossAxis];
737
- const rawOffset = evaluate(offset, state);
738
- const computedOffset = typeof rawOffset === "number" ? {
739
- mainAxis: rawOffset,
740
- crossAxis: 0
741
- } : {
742
- mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0,
743
- crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0
744
- };
745
- if (checkMainAxis) {
746
- const len = mainAxis === "y" ? "height" : "width";
747
- const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
748
- const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
749
- if (mainAxisCoord < limitMin) mainAxisCoord = limitMin;
750
- else if (mainAxisCoord > limitMax) mainAxisCoord = limitMax;
751
- }
752
- if (checkCrossAxis) {
753
- var _middlewareData$offse, _middlewareData$offse2;
754
- const len = mainAxis === "y" ? "width" : "height";
755
- const isOriginSide = originSides.has(getSide(placement));
756
- const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
757
- const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
758
- if (crossAxisCoord < limitMin) crossAxisCoord = limitMin;
759
- else if (crossAxisCoord > limitMax) crossAxisCoord = limitMax;
760
- }
761
- return {
762
- [mainAxis]: mainAxisCoord,
763
- [crossAxis]: crossAxisCoord
764
- };
765
- }
766
- };
767
- };
768
- /**
769
- * Provides data that allows you to change the size of the floating element —
770
- * for instance, prevent it from overflowing the clipping boundary or match the
771
- * width of the reference element.
772
- * @see https://floating-ui.com/docs/size
773
- */
774
- var size$1 = function(options) {
775
- if (options === void 0) options = {};
776
- return {
777
- name: "size",
778
- options,
779
- async fn(state) {
780
- const { placement, rects, platform, elements } = state;
781
- const { apply = () => {}, ...detectOverflowOptions } = evaluate(options, state);
782
- const overflow = await platform.detectOverflow(state, detectOverflowOptions);
783
- const side = getSide(placement);
784
- const alignment = getAlignment(placement);
785
- const isYAxis = getSideAxis(placement) === "y";
786
- const { width, height } = rects.floating;
787
- let heightSide;
788
- let widthSide;
789
- if (side === "top" || side === "bottom") {
790
- heightSide = side;
791
- widthSide = alignment === (await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
792
- } else {
793
- widthSide = side;
794
- heightSide = alignment === "end" ? "top" : "bottom";
795
- }
796
- const maximumClippingHeight = height - overflow.top - overflow.bottom;
797
- const maximumClippingWidth = width - overflow.left - overflow.right;
798
- const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
799
- const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
800
- const shiftData = state.middlewareData.shift;
801
- const noShift = !shiftData;
802
- let availableHeight = overflowAvailableHeight;
803
- let availableWidth = overflowAvailableWidth;
804
- if (shiftData != null && shiftData.enabled.x) availableWidth = maximumClippingWidth;
805
- if (shiftData != null && shiftData.enabled.y) availableHeight = maximumClippingHeight;
806
- if (noShift && !alignment) {
807
- if (isYAxis) availableWidth = width - 2 * max(overflow.left, overflow.right);
808
- else availableHeight = height - 2 * max(overflow.top, overflow.bottom);
809
- }
810
- await apply({
811
- ...state,
812
- availableWidth,
813
- availableHeight
814
- });
815
- const nextDimensions = await platform.getDimensions(elements.floating);
816
- if (width !== nextDimensions.width || height !== nextDimensions.height) return { reset: { rects: true } };
817
- return {};
818
- }
819
- };
820
- };
821
- //#endregion
822
- //#region ../../node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
823
- function hasWindow() {
824
- return typeof window !== "undefined";
825
- }
826
- function getNodeName(node) {
827
- if (isNode(node)) return (node.nodeName || "").toLowerCase();
828
- return "#document";
829
- }
830
- function getWindow(node) {
831
- var _node$ownerDocument;
832
- return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
833
- }
834
- function getDocumentElement(node) {
835
- var _ref;
836
- return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
837
- }
838
- function isNode(value) {
839
- if (!hasWindow()) return false;
840
- return value instanceof Node || value instanceof getWindow(value).Node;
841
- }
842
- function isElement(value) {
843
- if (!hasWindow()) return false;
844
- return value instanceof Element || value instanceof getWindow(value).Element;
845
- }
846
- function isHTMLElement(value) {
847
- if (!hasWindow()) return false;
848
- return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
849
- }
850
- function isShadowRoot(value) {
851
- if (!hasWindow() || typeof ShadowRoot === "undefined") return false;
852
- return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
853
- }
854
- function isOverflowElement(element) {
855
- const { overflow, overflowX, overflowY, display } = getComputedStyle$1(element);
856
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents";
857
- }
858
- function isTableElement(element) {
859
- return /^(table|td|th)$/.test(getNodeName(element));
860
- }
861
- function isTopLayer(element) {
862
- try {
863
- if (element.matches(":popover-open")) return true;
864
- } catch (_e) {}
865
- try {
866
- return element.matches(":modal");
867
- } catch (_e) {
868
- return false;
869
- }
870
- }
871
- var willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
872
- var containRe = /paint|layout|strict|content/;
873
- var isNotNone = (value) => !!value && value !== "none";
874
- var isWebKitValue;
875
- function isContainingBlock(elementOrCss) {
876
- const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
877
- return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || "") || containRe.test(css.contain || "");
878
- }
879
- function getContainingBlock(element) {
880
- let currentNode = getParentNode(element);
881
- while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
882
- if (isContainingBlock(currentNode)) return currentNode;
883
- else if (isTopLayer(currentNode)) return null;
884
- currentNode = getParentNode(currentNode);
885
- }
886
- return null;
887
- }
888
- function isWebKit() {
889
- if (isWebKitValue == null) isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none");
890
- return isWebKitValue;
891
- }
892
- function isLastTraversableNode(node) {
893
- return /^(html|body|#document)$/.test(getNodeName(node));
894
- }
895
- function getComputedStyle$1(element) {
896
- return getWindow(element).getComputedStyle(element);
897
- }
898
- function getNodeScroll(element) {
899
- if (isElement(element)) return {
900
- scrollLeft: element.scrollLeft,
901
- scrollTop: element.scrollTop
902
- };
903
- return {
904
- scrollLeft: element.scrollX,
905
- scrollTop: element.scrollY
906
- };
907
- }
908
- function getParentNode(node) {
909
- if (getNodeName(node) === "html") return node;
910
- const result = node.assignedSlot || node.parentNode || isShadowRoot(node) && node.host || getDocumentElement(node);
911
- return isShadowRoot(result) ? result.host : result;
912
- }
913
- function getNearestOverflowAncestor(node) {
914
- const parentNode = getParentNode(node);
915
- if (isLastTraversableNode(parentNode)) return (node.ownerDocument || node).body;
916
- if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) return parentNode;
917
- return getNearestOverflowAncestor(parentNode);
918
- }
919
- function getOverflowAncestors(node, list, traverseIframes) {
920
- var _node$ownerDocument2;
921
- if (list === void 0) list = [];
922
- if (traverseIframes === void 0) traverseIframes = true;
923
- const scrollableAncestor = getNearestOverflowAncestor(node);
924
- const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
925
- const win = getWindow(scrollableAncestor);
926
- if (isBody) {
927
- const frameElement = getFrameElement(win);
928
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
929
- } else return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
930
- }
931
- function getFrameElement(win) {
932
- return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
933
- }
934
- //#endregion
935
- //#region ../../node_modules/.pnpm/@floating-ui+dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
936
- function getCssDimensions(element) {
937
- const css = getComputedStyle$1(element);
938
- let width = parseFloat(css.width) || 0;
939
- let height = parseFloat(css.height) || 0;
940
- const hasOffset = isHTMLElement(element);
941
- const offsetWidth = hasOffset ? element.offsetWidth : width;
942
- const offsetHeight = hasOffset ? element.offsetHeight : height;
943
- const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
944
- if (shouldFallback) {
945
- width = offsetWidth;
946
- height = offsetHeight;
947
- }
948
- return {
949
- width,
950
- height,
951
- $: shouldFallback
952
- };
953
- }
954
- function unwrapElement(element) {
955
- return !isElement(element) ? element.contextElement : element;
956
- }
957
- function getScale(element) {
958
- const domElement = unwrapElement(element);
959
- if (!isHTMLElement(domElement)) return createCoords(1);
960
- const rect = domElement.getBoundingClientRect();
961
- const { width, height, $ } = getCssDimensions(domElement);
962
- let x = ($ ? round(rect.width) : rect.width) / width;
963
- let y = ($ ? round(rect.height) : rect.height) / height;
964
- if (!x || !Number.isFinite(x)) x = 1;
965
- if (!y || !Number.isFinite(y)) y = 1;
966
- return {
967
- x,
968
- y
969
- };
970
- }
971
- var noOffsets = /*#__PURE__*/ createCoords(0);
972
- function getVisualOffsets(element) {
973
- const win = getWindow(element);
974
- if (!isWebKit() || !win.visualViewport) return noOffsets;
975
- return {
976
- x: win.visualViewport.offsetLeft,
977
- y: win.visualViewport.offsetTop
978
- };
979
- }
980
- function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
981
- if (isFixed === void 0) isFixed = false;
982
- return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);
983
- }
984
- function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
985
- if (includeScale === void 0) includeScale = false;
986
- if (isFixedStrategy === void 0) isFixedStrategy = false;
987
- const clientRect = element.getBoundingClientRect();
988
- const domElement = unwrapElement(element);
989
- let scale = createCoords(1);
990
- if (includeScale) {
991
- if (offsetParent) {
992
- if (isElement(offsetParent)) scale = getScale(offsetParent);
993
- } else scale = getScale(element);
994
- }
995
- const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
996
- let x = (clientRect.left + visualOffsets.x) / scale.x;
997
- let y = (clientRect.top + visualOffsets.y) / scale.y;
998
- let width = clientRect.width / scale.x;
999
- let height = clientRect.height / scale.y;
1000
- if (domElement && offsetParent) {
1001
- const win = getWindow(domElement);
1002
- const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
1003
- let currentWin = win;
1004
- let currentIFrame = getFrameElement(currentWin);
1005
- while (currentIFrame && offsetWin !== currentWin) {
1006
- const iframeScale = getScale(currentIFrame);
1007
- const iframeRect = currentIFrame.getBoundingClientRect();
1008
- const css = getComputedStyle$1(currentIFrame);
1009
- const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
1010
- const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
1011
- x *= iframeScale.x;
1012
- y *= iframeScale.y;
1013
- width *= iframeScale.x;
1014
- height *= iframeScale.y;
1015
- x += left;
1016
- y += top;
1017
- currentWin = getWindow(currentIFrame);
1018
- currentIFrame = getFrameElement(currentWin);
1019
- }
1020
- }
1021
- return rectToClientRect({
1022
- width,
1023
- height,
1024
- x,
1025
- y
1026
- });
1027
- }
1028
- function getWindowScrollBarX(element, rect) {
1029
- const leftScroll = getNodeScroll(element).scrollLeft;
1030
- if (!rect) return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
1031
- return rect.left + leftScroll;
1032
- }
1033
- function getHTMLOffset(documentElement, scroll) {
1034
- const htmlRect = documentElement.getBoundingClientRect();
1035
- return {
1036
- x: htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect),
1037
- y: htmlRect.top + scroll.scrollTop
1038
- };
1039
- }
1040
- function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
1041
- let { elements, rect, offsetParent, strategy } = _ref;
1042
- const isFixed = strategy === "fixed";
1043
- const documentElement = getDocumentElement(offsetParent);
1044
- const topLayer = elements ? isTopLayer(elements.floating) : false;
1045
- if (offsetParent === documentElement || topLayer && isFixed) return rect;
1046
- let scroll = {
1047
- scrollLeft: 0,
1048
- scrollTop: 0
1049
- };
1050
- let scale = createCoords(1);
1051
- const offsets = createCoords(0);
1052
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
1053
- if (isOffsetParentAnElement || !isFixed) {
1054
- if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) scroll = getNodeScroll(offsetParent);
1055
- if (isOffsetParentAnElement) {
1056
- const offsetRect = getBoundingClientRect(offsetParent);
1057
- scale = getScale(offsetParent);
1058
- offsets.x = offsetRect.x + offsetParent.clientLeft;
1059
- offsets.y = offsetRect.y + offsetParent.clientTop;
1060
- }
1061
- }
1062
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
1063
- return {
1064
- width: rect.width * scale.x,
1065
- height: rect.height * scale.y,
1066
- x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
1067
- y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
1068
- };
1069
- }
1070
- function getClientRects(element) {
1071
- return element.getClientRects ? Array.from(element.getClientRects()) : [];
1072
- }
1073
- function getDocumentRect(html) {
1074
- const scroll = getNodeScroll(html);
1075
- const body = html.ownerDocument.body;
1076
- const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
1077
- const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
1078
- let x = -scroll.scrollLeft + getWindowScrollBarX(html);
1079
- const y = -scroll.scrollTop;
1080
- if (getComputedStyle$1(body).direction === "rtl") x += max(html.clientWidth, body.clientWidth) - width;
1081
- return {
1082
- width,
1083
- height,
1084
- x,
1085
- y
1086
- };
1087
- }
1088
- var SCROLLBAR_MAX = 25;
1089
- function getViewportRect(element, strategy, rootBoundary) {
1090
- if (rootBoundary === void 0) rootBoundary = "viewport";
1091
- const isLayoutViewport = rootBoundary === "layoutViewport";
1092
- const win = getWindow(element);
1093
- const html = getDocumentElement(element);
1094
- const visualViewport = win.visualViewport;
1095
- let width = html.clientWidth;
1096
- let height = html.clientHeight;
1097
- let x = 0;
1098
- let y = 0;
1099
- if (visualViewport) {
1100
- const layoutRelativeClientCoords = !isWebKit() || strategy === "fixed";
1101
- if (isLayoutViewport) {
1102
- if (!layoutRelativeClientCoords) {
1103
- x = -visualViewport.offsetLeft;
1104
- y = -visualViewport.offsetTop;
1105
- }
1106
- } else {
1107
- width = visualViewport.width;
1108
- height = visualViewport.height;
1109
- if (layoutRelativeClientCoords) {
1110
- x = visualViewport.offsetLeft;
1111
- y = visualViewport.offsetTop;
1112
- }
1113
- }
1114
- }
1115
- if (getWindowScrollBarX(html) <= 0) {
1116
- const doc = html.ownerDocument;
1117
- const body = doc.body;
1118
- const bodyStyles = getComputedStyle(body);
1119
- const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
1120
- const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
1121
- const gutter = getComputedStyle(html).scrollbarGutter === "stable both-edges" ? reservedWidth / 2 : reservedWidth;
1122
- if (gutter <= SCROLLBAR_MAX) width -= gutter;
1123
- }
1124
- return {
1125
- width,
1126
- height,
1127
- x,
1128
- y
1129
- };
1130
- }
1131
- function getInnerBoundingClientRect(element, strategy) {
1132
- const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
1133
- const top = clientRect.top + element.clientTop;
1134
- const left = clientRect.left + element.clientLeft;
1135
- const scale = getScale(element);
1136
- return {
1137
- width: element.clientWidth * scale.x,
1138
- height: element.clientHeight * scale.y,
1139
- x: left * scale.x,
1140
- y: top * scale.y
1141
- };
1142
- }
1143
- function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
1144
- let rect;
1145
- if (clippingAncestor === "viewport" || clippingAncestor === "layoutViewport") rect = getViewportRect(element, strategy, clippingAncestor);
1146
- else if (clippingAncestor === "document") rect = getDocumentRect(getDocumentElement(element));
1147
- else if (isElement(clippingAncestor)) rect = getInnerBoundingClientRect(clippingAncestor, strategy);
1148
- else {
1149
- const visualOffsets = getVisualOffsets(element);
1150
- rect = {
1151
- x: clippingAncestor.x - visualOffsets.x,
1152
- y: clippingAncestor.y - visualOffsets.y,
1153
- width: clippingAncestor.width,
1154
- height: clippingAncestor.height
1155
- };
1156
- }
1157
- return rectToClientRect(rect);
1158
- }
1159
- function getClippingElementAncestors(element, cache) {
1160
- const cachedResult = cache.get(element);
1161
- if (cachedResult) return cachedResult;
1162
- let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
1163
- let lastKeptComputedStyle = null;
1164
- const elementIsFixed = getComputedStyle$1(element).position === "fixed";
1165
- let currentNode = elementIsFixed ? getParentNode(element) : element;
1166
- while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
1167
- const computedStyle = getComputedStyle$1(currentNode);
1168
- const currentNodeIsContaining = isContainingBlock(currentNode);
1169
- const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? "fixed" : "";
1170
- if (!currentNodeIsContaining && (lastPosition === "fixed" || lastPosition === "absolute" && computedStyle.position === "static")) result = result.filter((ancestor) => ancestor !== currentNode);
1171
- else lastKeptComputedStyle = computedStyle;
1172
- currentNode = getParentNode(currentNode);
1173
- }
1174
- cache.set(element, result);
1175
- return result;
1176
- }
1177
- function getClippingRect(_ref) {
1178
- let { element, boundary, rootBoundary, strategy } = _ref;
1179
- const clippingAncestors = [...boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary), rootBoundary];
1180
- const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);
1181
- let top = firstRect.top;
1182
- let right = firstRect.right;
1183
- let bottom = firstRect.bottom;
1184
- let left = firstRect.left;
1185
- for (let i = 1; i < clippingAncestors.length; i++) {
1186
- const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);
1187
- top = max(rect.top, top);
1188
- right = min(rect.right, right);
1189
- bottom = min(rect.bottom, bottom);
1190
- left = max(rect.left, left);
1191
- }
1192
- return {
1193
- width: right - left,
1194
- height: bottom - top,
1195
- x: left,
1196
- y: top
1197
- };
1198
- }
1199
- function getDimensions(element) {
1200
- const { width, height } = getCssDimensions(element);
1201
- return {
1202
- width,
1203
- height
1204
- };
1205
- }
1206
- function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
1207
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
1208
- const documentElement = getDocumentElement(offsetParent);
1209
- const isFixed = strategy === "fixed";
1210
- const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
1211
- let scroll = {
1212
- scrollLeft: 0,
1213
- scrollTop: 0
1214
- };
1215
- const offsets = createCoords(0);
1216
- if (isOffsetParentAnElement || !isFixed) {
1217
- if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) scroll = getNodeScroll(offsetParent);
1218
- if (isOffsetParentAnElement) {
1219
- const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
1220
- offsets.x = offsetRect.x + offsetParent.clientLeft;
1221
- offsets.y = offsetRect.y + offsetParent.clientTop;
1222
- }
1223
- }
1224
- if (!isOffsetParentAnElement && documentElement) offsets.x = getWindowScrollBarX(documentElement);
1225
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
1226
- return {
1227
- x: rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x,
1228
- y: rect.top + scroll.scrollTop - offsets.y - htmlOffset.y,
1229
- width: rect.width,
1230
- height: rect.height
1231
- };
1232
- }
1233
- function isStaticPositioned(element) {
1234
- return getComputedStyle$1(element).position === "static";
1235
- }
1236
- function getTrueOffsetParent(element, polyfill) {
1237
- if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") return null;
1238
- if (polyfill) return polyfill(element);
1239
- let rawOffsetParent = element.offsetParent;
1240
- if (getDocumentElement(element) === rawOffsetParent) rawOffsetParent = rawOffsetParent.ownerDocument.body;
1241
- return rawOffsetParent;
1242
- }
1243
- function getOffsetParent(element, polyfill) {
1244
- const win = getWindow(element);
1245
- if (isTopLayer(element)) return win;
1246
- if (!isHTMLElement(element)) {
1247
- let svgOffsetParent = getParentNode(element);
1248
- while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
1249
- if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) return svgOffsetParent;
1250
- svgOffsetParent = getParentNode(svgOffsetParent);
1251
- }
1252
- return win;
1253
- }
1254
- let offsetParent = getTrueOffsetParent(element, polyfill);
1255
- while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) offsetParent = getTrueOffsetParent(offsetParent, polyfill);
1256
- if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) return win;
1257
- return offsetParent || getContainingBlock(element) || win;
1258
- }
1259
- var getElementRects = async function(data) {
1260
- const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
1261
- const getDimensionsFn = this.getDimensions;
1262
- const floatingDimensions = await getDimensionsFn(data.floating);
1263
- return {
1264
- reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
1265
- floating: {
1266
- x: 0,
1267
- y: 0,
1268
- width: floatingDimensions.width,
1269
- height: floatingDimensions.height
1270
- }
1271
- };
1272
- };
1273
- function isRTL(element) {
1274
- return getComputedStyle$1(element).direction === "rtl";
1275
- }
1276
- var platform = {
1277
- convertOffsetParentRelativeRectToViewportRelativeRect,
1278
- getDocumentElement,
1279
- getClippingRect,
1280
- getOffsetParent,
1281
- getElementRects,
1282
- getClientRects,
1283
- getDimensions,
1284
- getScale,
1285
- isElement,
1286
- isRTL
1287
- };
1288
- function rectsAreEqual(a, b) {
1289
- return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
1290
- }
1291
- function observeMove(element, onMove, ancestorResize) {
1292
- let io = null;
1293
- let timeoutId;
1294
- const root = getDocumentElement(element);
1295
- function cleanup() {
1296
- var _io;
1297
- clearTimeout(timeoutId);
1298
- (_io = io) == null || _io.disconnect();
1299
- io = null;
1300
- }
1301
- function refresh(skip, threshold) {
1302
- if (skip === void 0) skip = false;
1303
- if (threshold === void 0) threshold = 1;
1304
- cleanup();
1305
- const elementRectForRootMargin = element.getBoundingClientRect();
1306
- const { left, top, width, height } = elementRectForRootMargin;
1307
- if (!skip) onMove();
1308
- if (!width || !height) return;
1309
- const insetTop = floor(top);
1310
- const insetRight = floor(root.clientWidth - (left + width));
1311
- const insetBottom = floor(root.clientHeight - (top + height));
1312
- const insetLeft = floor(left);
1313
- const options = {
1314
- rootMargin: -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px",
1315
- threshold: max(0, min(1, threshold)) || 1
1316
- };
1317
- let isFirstUpdate = true;
1318
- function handleObserve(entries) {
1319
- const ratio = entries[0].intersectionRatio;
1320
- if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) return refresh();
1321
- if (ratio !== threshold) {
1322
- if (!isFirstUpdate) return refresh();
1323
- if (!ratio) timeoutId = setTimeout(() => {
1324
- refresh(false, 1e-7);
1325
- }, 1e3);
1326
- else refresh(false, ratio);
1327
- }
1328
- isFirstUpdate = false;
1329
- }
1330
- try {
1331
- io = new IntersectionObserver(handleObserve, {
1332
- ...options,
1333
- root: root.ownerDocument
1334
- });
1335
- } catch (_e) {
1336
- io = new IntersectionObserver(handleObserve, options);
1337
- }
1338
- io.observe(element);
1339
- }
1340
- const win = getWindow(element);
1341
- const handleResize = () => refresh(ancestorResize);
1342
- win.addEventListener("resize", handleResize);
1343
- refresh(true);
1344
- return () => {
1345
- win.removeEventListener("resize", handleResize);
1346
- cleanup();
1347
- };
1348
- }
1349
- /**
1350
- * Automatically updates the position of the floating element when necessary.
1351
- * Should only be called when the floating element is mounted on the DOM or
1352
- * visible on the screen.
1353
- * @returns cleanup function that should be invoked when the floating element is
1354
- * removed from the DOM or hidden from the screen.
1355
- * @see https://floating-ui.com/docs/autoUpdate
1356
- */
1357
- function autoUpdate(reference, floating, update, options) {
1358
- if (options === void 0) options = {};
1359
- const { ancestorScroll = true, ancestorResize = true, elementResize = typeof ResizeObserver === "function", layoutShift = typeof IntersectionObserver === "function", animationFrame = false } = options;
1360
- const referenceEl = unwrapElement(reference);
1361
- const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : [];
1362
- ancestors.forEach((ancestor) => {
1363
- ancestorScroll && ancestor.addEventListener("scroll", update);
1364
- ancestorResize && ancestor.addEventListener("resize", update);
1365
- });
1366
- const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null;
1367
- let reobserveFrame = -1;
1368
- let resizeObserver = null;
1369
- if (elementResize) {
1370
- resizeObserver = new ResizeObserver((_ref) => {
1371
- let [firstEntry] = _ref;
1372
- if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {
1373
- resizeObserver.unobserve(floating);
1374
- cancelAnimationFrame(reobserveFrame);
1375
- reobserveFrame = requestAnimationFrame(() => {
1376
- var _resizeObserver;
1377
- (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
1378
- });
1379
- }
1380
- update();
1381
- });
1382
- if (referenceEl && !animationFrame) resizeObserver.observe(referenceEl);
1383
- if (floating) resizeObserver.observe(floating);
1384
- }
1385
- let frameId;
1386
- let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
1387
- if (animationFrame) frameLoop();
1388
- function frameLoop() {
1389
- const nextRefRect = getBoundingClientRect(reference);
1390
- if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) update();
1391
- prevRefRect = nextRefRect;
1392
- frameId = requestAnimationFrame(frameLoop);
1393
- }
1394
- update();
1395
- return () => {
1396
- var _resizeObserver2;
1397
- ancestors.forEach((ancestor) => {
1398
- ancestorScroll && ancestor.removeEventListener("scroll", update);
1399
- ancestorResize && ancestor.removeEventListener("resize", update);
1400
- });
1401
- cleanupIo?.();
1402
- (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
1403
- resizeObserver = null;
1404
- if (animationFrame) cancelAnimationFrame(frameId);
1405
- };
1406
- }
1407
- /**
1408
- * Modifies the placement by translating the floating element along the
1409
- * specified axes.
1410
- * A number (shorthand for `mainAxis` or distance), or an axes configuration
1411
- * object may be passed.
1412
- * @see https://floating-ui.com/docs/offset
1413
- */
1414
- var offset = offset$1;
1415
- /**
1416
- * Optimizes the visibility of the floating element by choosing the placement
1417
- * that has the most space available automatically, without needing to specify a
1418
- * preferred placement. Alternative to `flip`.
1419
- * @see https://floating-ui.com/docs/autoPlacement
1420
- */
1421
- var autoPlacement = autoPlacement$1;
1422
- /**
1423
- * Optimizes the visibility of the floating element by shifting it in order to
1424
- * keep it in view when it will overflow the clipping boundary.
1425
- * @see https://floating-ui.com/docs/shift
1426
- */
1427
- var shift = shift$1;
1428
- /**
1429
- * Optimizes the visibility of the floating element by flipping the `placement`
1430
- * in order to keep it in view when the preferred placement(s) will overflow the
1431
- * clipping boundary. Alternative to `autoPlacement`.
1432
- * @see https://floating-ui.com/docs/flip
1433
- */
1434
- var flip = flip$1;
1435
- /**
1436
- * Provides data that allows you to change the size of the floating element —
1437
- * for instance, prevent it from overflowing the clipping boundary or match the
1438
- * width of the reference element.
1439
- * @see https://floating-ui.com/docs/size
1440
- */
1441
- var size = size$1;
1442
- /**
1443
- * Provides data to hide the floating element in applicable situations, such as
1444
- * when it is not in the same clipping context as the reference element.
1445
- * @see https://floating-ui.com/docs/hide
1446
- */
1447
- var hide = hide$1;
1448
- /**
1449
- * Provides data to position an inner element of the floating element so that it
1450
- * appears centered to the reference element.
1451
- * @see https://floating-ui.com/docs/arrow
1452
- */
1453
- var arrow = arrow$1;
1454
- /**
1455
- * Provides improved positioning for inline reference elements that can span
1456
- * over multiple lines, such as hyperlinks or range selections.
1457
- * @see https://floating-ui.com/docs/inline
1458
- */
1459
- var inline = inline$1;
1460
- /**
1461
- * Built-in `limiter` that will stop `shift()` at a certain point.
1462
- */
1463
- var limitShift = limitShift$1;
1464
- /**
1465
- * Computes the `x` and `y` coordinates that will place the floating element
1466
- * next to a given reference element.
1467
- */
1468
- var computePosition = (reference, floating, options) => {
1469
- const cache = /* @__PURE__ */ new Map();
1470
- const mergedOptions = options != null ? options : {};
1471
- const platformWithCache = {
1472
- ...platform,
1473
- ...mergedOptions.platform,
1474
- _c: cache
1475
- };
1476
- return computePosition$1(reference, floating, {
1477
- ...mergedOptions,
1478
- platform: platformWithCache
1479
- });
1480
- };
1481
- //#endregion
1482
- export { flip as a, limitShift as c, size as d, getNodeName as f, computePosition as i, offset as l, autoPlacement as n, hide as o, isNode as p, autoUpdate as r, inline as s, arrow as t, shift as u };
1483
-
1484
- //# sourceMappingURL=floating-ui.dom-C7UZexJK.js.map