@epilot/volt-ui 1.1.7-alpha.1 → 1.1.7

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 (217) hide show
  1. package/dist/index.cjs.js +51 -0
  2. package/dist/index.es.js +11823 -137
  3. package/dist/preflight.css +1 -241
  4. package/dist/style.css +1 -7393
  5. package/package.json +4 -1
  6. package/dist/components/button/index.d.ts +0 -1
  7. package/dist/index.es.js.map +0 -1
  8. package/dist/index.es10.js +0 -35
  9. package/dist/index.es10.js.map +0 -1
  10. package/dist/index.es100.js +0 -14
  11. package/dist/index.es100.js.map +0 -1
  12. package/dist/index.es101.js +0 -20
  13. package/dist/index.es101.js.map +0 -1
  14. package/dist/index.es102.js +0 -103
  15. package/dist/index.es102.js.map +0 -1
  16. package/dist/index.es103.js +0 -12
  17. package/dist/index.es103.js.map +0 -1
  18. package/dist/index.es104.js +0 -30
  19. package/dist/index.es104.js.map +0 -1
  20. package/dist/index.es105.js +0 -38
  21. package/dist/index.es105.js.map +0 -1
  22. package/dist/index.es106.js +0 -17
  23. package/dist/index.es106.js.map +0 -1
  24. package/dist/index.es107.js +0 -49
  25. package/dist/index.es107.js.map +0 -1
  26. package/dist/index.es108.js +0 -10
  27. package/dist/index.es108.js.map +0 -1
  28. package/dist/index.es11.js +0 -318
  29. package/dist/index.es11.js.map +0 -1
  30. package/dist/index.es12.js +0 -274
  31. package/dist/index.es12.js.map +0 -1
  32. package/dist/index.es13.js +0 -38
  33. package/dist/index.es13.js.map +0 -1
  34. package/dist/index.es14.js +0 -48
  35. package/dist/index.es14.js.map +0 -1
  36. package/dist/index.es15.js +0 -67
  37. package/dist/index.es15.js.map +0 -1
  38. package/dist/index.es16.js +0 -120
  39. package/dist/index.es16.js.map +0 -1
  40. package/dist/index.es17.js +0 -27
  41. package/dist/index.es17.js.map +0 -1
  42. package/dist/index.es18.js +0 -51
  43. package/dist/index.es18.js.map +0 -1
  44. package/dist/index.es19.js +0 -168
  45. package/dist/index.es19.js.map +0 -1
  46. package/dist/index.es20.js +0 -55
  47. package/dist/index.es20.js.map +0 -1
  48. package/dist/index.es21.js +0 -61
  49. package/dist/index.es21.js.map +0 -1
  50. package/dist/index.es22.js +0 -86
  51. package/dist/index.es22.js.map +0 -1
  52. package/dist/index.es23.js +0 -195
  53. package/dist/index.es23.js.map +0 -1
  54. package/dist/index.es24.js +0 -105
  55. package/dist/index.es24.js.map +0 -1
  56. package/dist/index.es25.js +0 -146
  57. package/dist/index.es25.js.map +0 -1
  58. package/dist/index.es26.js +0 -92
  59. package/dist/index.es26.js.map +0 -1
  60. package/dist/index.es27.js +0 -80
  61. package/dist/index.es27.js.map +0 -1
  62. package/dist/index.es28.js +0 -94
  63. package/dist/index.es28.js.map +0 -1
  64. package/dist/index.es29.js +0 -82
  65. package/dist/index.es29.js.map +0 -1
  66. package/dist/index.es30.js +0 -1087
  67. package/dist/index.es30.js.map +0 -1
  68. package/dist/index.es31.js +0 -18
  69. package/dist/index.es31.js.map +0 -1
  70. package/dist/index.es32.js +0 -3015
  71. package/dist/index.es32.js.map +0 -1
  72. package/dist/index.es33.js +0 -107
  73. package/dist/index.es33.js.map +0 -1
  74. package/dist/index.es34.js +0 -46
  75. package/dist/index.es34.js.map +0 -1
  76. package/dist/index.es35.js +0 -151
  77. package/dist/index.es35.js.map +0 -1
  78. package/dist/index.es36.js +0 -1200
  79. package/dist/index.es36.js.map +0 -1
  80. package/dist/index.es37.js +0 -27
  81. package/dist/index.es37.js.map +0 -1
  82. package/dist/index.es38.js +0 -493
  83. package/dist/index.es38.js.map +0 -1
  84. package/dist/index.es39.js +0 -156
  85. package/dist/index.es39.js.map +0 -1
  86. package/dist/index.es4.js +0 -9
  87. package/dist/index.es4.js.map +0 -1
  88. package/dist/index.es40.js +0 -31
  89. package/dist/index.es40.js.map +0 -1
  90. package/dist/index.es41.js +0 -314
  91. package/dist/index.es41.js.map +0 -1
  92. package/dist/index.es42.js +0 -343
  93. package/dist/index.es42.js.map +0 -1
  94. package/dist/index.es43.js +0 -280
  95. package/dist/index.es43.js.map +0 -1
  96. package/dist/index.es44.js +0 -289
  97. package/dist/index.es44.js.map +0 -1
  98. package/dist/index.es45.js +0 -319
  99. package/dist/index.es45.js.map +0 -1
  100. package/dist/index.es46.js +0 -167
  101. package/dist/index.es46.js.map +0 -1
  102. package/dist/index.es47.js +0 -195
  103. package/dist/index.es47.js.map +0 -1
  104. package/dist/index.es48.js +0 -40
  105. package/dist/index.es48.js.map +0 -1
  106. package/dist/index.es49.js +0 -40
  107. package/dist/index.es49.js.map +0 -1
  108. package/dist/index.es5.js +0 -57
  109. package/dist/index.es5.js.map +0 -1
  110. package/dist/index.es50.js +0 -12
  111. package/dist/index.es50.js.map +0 -1
  112. package/dist/index.es51.js +0 -82
  113. package/dist/index.es51.js.map +0 -1
  114. package/dist/index.es52.js +0 -72
  115. package/dist/index.es52.js.map +0 -1
  116. package/dist/index.es53.js +0 -15
  117. package/dist/index.es53.js.map +0 -1
  118. package/dist/index.es54.js +0 -40
  119. package/dist/index.es54.js.map +0 -1
  120. package/dist/index.es55.js +0 -44
  121. package/dist/index.es55.js.map +0 -1
  122. package/dist/index.es56.js +0 -71
  123. package/dist/index.es56.js.map +0 -1
  124. package/dist/index.es57.js +0 -152
  125. package/dist/index.es57.js.map +0 -1
  126. package/dist/index.es58.js +0 -15
  127. package/dist/index.es58.js.map +0 -1
  128. package/dist/index.es59.js +0 -11
  129. package/dist/index.es59.js.map +0 -1
  130. package/dist/index.es6.js +0 -77
  131. package/dist/index.es6.js.map +0 -1
  132. package/dist/index.es60.js +0 -130
  133. package/dist/index.es60.js.map +0 -1
  134. package/dist/index.es61.js +0 -213
  135. package/dist/index.es61.js.map +0 -1
  136. package/dist/index.es62.js +0 -294
  137. package/dist/index.es62.js.map +0 -1
  138. package/dist/index.es63.js +0 -16
  139. package/dist/index.es63.js.map +0 -1
  140. package/dist/index.es64.js +0 -37
  141. package/dist/index.es64.js.map +0 -1
  142. package/dist/index.es65.js +0 -228
  143. package/dist/index.es65.js.map +0 -1
  144. package/dist/index.es66.js +0 -209
  145. package/dist/index.es66.js.map +0 -1
  146. package/dist/index.es67.js +0 -19
  147. package/dist/index.es67.js.map +0 -1
  148. package/dist/index.es68.js +0 -30
  149. package/dist/index.es68.js.map +0 -1
  150. package/dist/index.es69.js +0 -12
  151. package/dist/index.es69.js.map +0 -1
  152. package/dist/index.es7.js +0 -200
  153. package/dist/index.es7.js.map +0 -1
  154. package/dist/index.es70.js +0 -123
  155. package/dist/index.es70.js.map +0 -1
  156. package/dist/index.es71.js +0 -90
  157. package/dist/index.es71.js.map +0 -1
  158. package/dist/index.es72.js +0 -7
  159. package/dist/index.es72.js.map +0 -1
  160. package/dist/index.es73.js +0 -90
  161. package/dist/index.es73.js.map +0 -1
  162. package/dist/index.es74.js +0 -15
  163. package/dist/index.es74.js.map +0 -1
  164. package/dist/index.es75.js +0 -7
  165. package/dist/index.es75.js.map +0 -1
  166. package/dist/index.es76.js +0 -40
  167. package/dist/index.es76.js.map +0 -1
  168. package/dist/index.es77.js +0 -90
  169. package/dist/index.es77.js.map +0 -1
  170. package/dist/index.es78.js +0 -313
  171. package/dist/index.es78.js.map +0 -1
  172. package/dist/index.es79.js +0 -16
  173. package/dist/index.es79.js.map +0 -1
  174. package/dist/index.es8.js +0 -47
  175. package/dist/index.es8.js.map +0 -1
  176. package/dist/index.es80.js +0 -90
  177. package/dist/index.es80.js.map +0 -1
  178. package/dist/index.es81.js +0 -18
  179. package/dist/index.es81.js.map +0 -1
  180. package/dist/index.es82.js +0 -298
  181. package/dist/index.es82.js.map +0 -1
  182. package/dist/index.es83.js +0 -26
  183. package/dist/index.es83.js.map +0 -1
  184. package/dist/index.es84.js +0 -626
  185. package/dist/index.es84.js.map +0 -1
  186. package/dist/index.es85.js +0 -19
  187. package/dist/index.es85.js.map +0 -1
  188. package/dist/index.es86.js +0 -40
  189. package/dist/index.es86.js.map +0 -1
  190. package/dist/index.es87.js +0 -40
  191. package/dist/index.es87.js.map +0 -1
  192. package/dist/index.es88.js +0 -39
  193. package/dist/index.es88.js.map +0 -1
  194. package/dist/index.es89.js +0 -8
  195. package/dist/index.es89.js.map +0 -1
  196. package/dist/index.es9.js +0 -37
  197. package/dist/index.es9.js.map +0 -1
  198. package/dist/index.es90.js +0 -722
  199. package/dist/index.es90.js.map +0 -1
  200. package/dist/index.es91.js +0 -155
  201. package/dist/index.es91.js.map +0 -1
  202. package/dist/index.es92.js +0 -174
  203. package/dist/index.es92.js.map +0 -1
  204. package/dist/index.es93.js +0 -11
  205. package/dist/index.es93.js.map +0 -1
  206. package/dist/index.es94.js +0 -6
  207. package/dist/index.es94.js.map +0 -1
  208. package/dist/index.es95.js +0 -36
  209. package/dist/index.es95.js.map +0 -1
  210. package/dist/index.es96.js +0 -175
  211. package/dist/index.es96.js.map +0 -1
  212. package/dist/index.es97.js +0 -22
  213. package/dist/index.es97.js.map +0 -1
  214. package/dist/index.es98.js +0 -89
  215. package/dist/index.es98.js.map +0 -1
  216. package/dist/index.es99.js +0 -48
  217. package/dist/index.es99.js.map +0 -1
@@ -1,626 +0,0 @@
1
- import { offset as offset$1, shift as shift$1, flip as flip$1, size as size$1, hide as hide$1, limitShift as limitShift$1, computePosition as computePosition$1, arrow as arrow$1 } from "./index.es90.js";
2
- import { createCoords, round, max, min, rectToClientRect, floor } from "./index.es91.js";
3
- import { isElement, getDocumentElement, getOverflowAncestors, getComputedStyle as getComputedStyle$1, isHTMLElement, getWindow, isTopLayer, getParentNode, isLastTraversableNode, isTableElement, isContainingBlock, getContainingBlock, getNodeName, isOverflowElement, getNodeScroll, getFrameElement, isWebKit } from "./index.es92.js";
4
- function getCssDimensions(element) {
5
- const css = getComputedStyle$1(element);
6
- let width = parseFloat(css.width) || 0;
7
- let height = parseFloat(css.height) || 0;
8
- const hasOffset = isHTMLElement(element);
9
- const offsetWidth = hasOffset ? element.offsetWidth : width;
10
- const offsetHeight = hasOffset ? element.offsetHeight : height;
11
- const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
12
- if (shouldFallback) {
13
- width = offsetWidth;
14
- height = offsetHeight;
15
- }
16
- return {
17
- width,
18
- height,
19
- $: shouldFallback
20
- };
21
- }
22
- function unwrapElement(element) {
23
- return !isElement(element) ? element.contextElement : element;
24
- }
25
- function getScale(element) {
26
- const domElement = unwrapElement(element);
27
- if (!isHTMLElement(domElement)) {
28
- return createCoords(1);
29
- }
30
- const rect = domElement.getBoundingClientRect();
31
- const {
32
- width,
33
- height,
34
- $
35
- } = getCssDimensions(domElement);
36
- let x = ($ ? round(rect.width) : rect.width) / width;
37
- let y = ($ ? round(rect.height) : rect.height) / height;
38
- if (!x || !Number.isFinite(x)) {
39
- x = 1;
40
- }
41
- if (!y || !Number.isFinite(y)) {
42
- y = 1;
43
- }
44
- return {
45
- x,
46
- y
47
- };
48
- }
49
- const noOffsets = /* @__PURE__ */ createCoords(0);
50
- function getVisualOffsets(element) {
51
- const win = getWindow(element);
52
- if (!isWebKit() || !win.visualViewport) {
53
- return noOffsets;
54
- }
55
- return {
56
- x: win.visualViewport.offsetLeft,
57
- y: win.visualViewport.offsetTop
58
- };
59
- }
60
- function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
61
- if (isFixed === void 0) {
62
- isFixed = false;
63
- }
64
- if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
65
- return false;
66
- }
67
- return isFixed;
68
- }
69
- function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
70
- if (includeScale === void 0) {
71
- includeScale = false;
72
- }
73
- if (isFixedStrategy === void 0) {
74
- isFixedStrategy = false;
75
- }
76
- const clientRect = element.getBoundingClientRect();
77
- const domElement = unwrapElement(element);
78
- let scale = createCoords(1);
79
- if (includeScale) {
80
- if (offsetParent) {
81
- if (isElement(offsetParent)) {
82
- scale = getScale(offsetParent);
83
- }
84
- } else {
85
- scale = getScale(element);
86
- }
87
- }
88
- const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
89
- let x = (clientRect.left + visualOffsets.x) / scale.x;
90
- let y = (clientRect.top + visualOffsets.y) / scale.y;
91
- let width = clientRect.width / scale.x;
92
- let height = clientRect.height / scale.y;
93
- if (domElement) {
94
- const win = getWindow(domElement);
95
- const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
96
- let currentWin = win;
97
- let currentIFrame = getFrameElement(currentWin);
98
- while (currentIFrame && offsetParent && offsetWin !== currentWin) {
99
- const iframeScale = getScale(currentIFrame);
100
- const iframeRect = currentIFrame.getBoundingClientRect();
101
- const css = getComputedStyle$1(currentIFrame);
102
- const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
103
- const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
104
- x *= iframeScale.x;
105
- y *= iframeScale.y;
106
- width *= iframeScale.x;
107
- height *= iframeScale.y;
108
- x += left;
109
- y += top;
110
- currentWin = getWindow(currentIFrame);
111
- currentIFrame = getFrameElement(currentWin);
112
- }
113
- }
114
- return rectToClientRect({
115
- width,
116
- height,
117
- x,
118
- y
119
- });
120
- }
121
- function getWindowScrollBarX(element, rect) {
122
- const leftScroll = getNodeScroll(element).scrollLeft;
123
- if (!rect) {
124
- return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
125
- }
126
- return rect.left + leftScroll;
127
- }
128
- function getHTMLOffset(documentElement, scroll) {
129
- const htmlRect = documentElement.getBoundingClientRect();
130
- const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
131
- const y = htmlRect.top + scroll.scrollTop;
132
- return {
133
- x,
134
- y
135
- };
136
- }
137
- function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
138
- let {
139
- elements,
140
- rect,
141
- offsetParent,
142
- strategy
143
- } = _ref;
144
- const isFixed = strategy === "fixed";
145
- const documentElement = getDocumentElement(offsetParent);
146
- const topLayer = elements ? isTopLayer(elements.floating) : false;
147
- if (offsetParent === documentElement || topLayer && isFixed) {
148
- return rect;
149
- }
150
- let scroll = {
151
- scrollLeft: 0,
152
- scrollTop: 0
153
- };
154
- let scale = createCoords(1);
155
- const offsets = createCoords(0);
156
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
157
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
158
- if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
159
- scroll = getNodeScroll(offsetParent);
160
- }
161
- if (isHTMLElement(offsetParent)) {
162
- const offsetRect = getBoundingClientRect(offsetParent);
163
- scale = getScale(offsetParent);
164
- offsets.x = offsetRect.x + offsetParent.clientLeft;
165
- offsets.y = offsetRect.y + offsetParent.clientTop;
166
- }
167
- }
168
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
169
- return {
170
- width: rect.width * scale.x,
171
- height: rect.height * scale.y,
172
- x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
173
- y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
174
- };
175
- }
176
- function getClientRects(element) {
177
- return Array.from(element.getClientRects());
178
- }
179
- function getDocumentRect(element) {
180
- const html = getDocumentElement(element);
181
- const scroll = getNodeScroll(element);
182
- const body = element.ownerDocument.body;
183
- const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
184
- const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
185
- let x = -scroll.scrollLeft + getWindowScrollBarX(element);
186
- const y = -scroll.scrollTop;
187
- if (getComputedStyle$1(body).direction === "rtl") {
188
- x += max(html.clientWidth, body.clientWidth) - width;
189
- }
190
- return {
191
- width,
192
- height,
193
- x,
194
- y
195
- };
196
- }
197
- const SCROLLBAR_MAX = 25;
198
- function getViewportRect(element, strategy) {
199
- const win = getWindow(element);
200
- const html = getDocumentElement(element);
201
- const visualViewport = win.visualViewport;
202
- let width = html.clientWidth;
203
- let height = html.clientHeight;
204
- let x = 0;
205
- let y = 0;
206
- if (visualViewport) {
207
- width = visualViewport.width;
208
- height = visualViewport.height;
209
- const visualViewportBased = isWebKit();
210
- if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
211
- x = visualViewport.offsetLeft;
212
- y = visualViewport.offsetTop;
213
- }
214
- }
215
- const windowScrollbarX = getWindowScrollBarX(html);
216
- if (windowScrollbarX <= 0) {
217
- const doc = html.ownerDocument;
218
- const body = doc.body;
219
- const bodyStyles = getComputedStyle(body);
220
- const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
221
- const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
222
- if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
223
- width -= clippingStableScrollbarWidth;
224
- }
225
- } else if (windowScrollbarX <= SCROLLBAR_MAX) {
226
- width += windowScrollbarX;
227
- }
228
- return {
229
- width,
230
- height,
231
- x,
232
- y
233
- };
234
- }
235
- const absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
236
- function getInnerBoundingClientRect(element, strategy) {
237
- const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
238
- const top = clientRect.top + element.clientTop;
239
- const left = clientRect.left + element.clientLeft;
240
- const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
241
- const width = element.clientWidth * scale.x;
242
- const height = element.clientHeight * scale.y;
243
- const x = left * scale.x;
244
- const y = top * scale.y;
245
- return {
246
- width,
247
- height,
248
- x,
249
- y
250
- };
251
- }
252
- function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
253
- let rect;
254
- if (clippingAncestor === "viewport") {
255
- rect = getViewportRect(element, strategy);
256
- } else if (clippingAncestor === "document") {
257
- rect = getDocumentRect(getDocumentElement(element));
258
- } else if (isElement(clippingAncestor)) {
259
- rect = getInnerBoundingClientRect(clippingAncestor, strategy);
260
- } else {
261
- const visualOffsets = getVisualOffsets(element);
262
- rect = {
263
- x: clippingAncestor.x - visualOffsets.x,
264
- y: clippingAncestor.y - visualOffsets.y,
265
- width: clippingAncestor.width,
266
- height: clippingAncestor.height
267
- };
268
- }
269
- return rectToClientRect(rect);
270
- }
271
- function hasFixedPositionAncestor(element, stopNode) {
272
- const parentNode = getParentNode(element);
273
- if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
274
- return false;
275
- }
276
- return getComputedStyle$1(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
277
- }
278
- function getClippingElementAncestors(element, cache) {
279
- const cachedResult = cache.get(element);
280
- if (cachedResult) {
281
- return cachedResult;
282
- }
283
- let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
284
- let currentContainingBlockComputedStyle = null;
285
- const elementIsFixed = getComputedStyle$1(element).position === "fixed";
286
- let currentNode = elementIsFixed ? getParentNode(element) : element;
287
- while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
288
- const computedStyle = getComputedStyle$1(currentNode);
289
- const currentNodeIsContaining = isContainingBlock(currentNode);
290
- if (!currentNodeIsContaining && computedStyle.position === "fixed") {
291
- currentContainingBlockComputedStyle = null;
292
- }
293
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
294
- if (shouldDropCurrentNode) {
295
- result = result.filter((ancestor) => ancestor !== currentNode);
296
- } else {
297
- currentContainingBlockComputedStyle = computedStyle;
298
- }
299
- currentNode = getParentNode(currentNode);
300
- }
301
- cache.set(element, result);
302
- return result;
303
- }
304
- function getClippingRect(_ref) {
305
- let {
306
- element,
307
- boundary,
308
- rootBoundary,
309
- strategy
310
- } = _ref;
311
- const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
312
- const clippingAncestors = [...elementClippingAncestors, rootBoundary];
313
- const firstClippingAncestor = clippingAncestors[0];
314
- const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
315
- const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
316
- accRect.top = max(rect.top, accRect.top);
317
- accRect.right = min(rect.right, accRect.right);
318
- accRect.bottom = min(rect.bottom, accRect.bottom);
319
- accRect.left = max(rect.left, accRect.left);
320
- return accRect;
321
- }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
322
- return {
323
- width: clippingRect.right - clippingRect.left,
324
- height: clippingRect.bottom - clippingRect.top,
325
- x: clippingRect.left,
326
- y: clippingRect.top
327
- };
328
- }
329
- function getDimensions(element) {
330
- const {
331
- width,
332
- height
333
- } = getCssDimensions(element);
334
- return {
335
- width,
336
- height
337
- };
338
- }
339
- function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
340
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
341
- const documentElement = getDocumentElement(offsetParent);
342
- const isFixed = strategy === "fixed";
343
- const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
344
- let scroll = {
345
- scrollLeft: 0,
346
- scrollTop: 0
347
- };
348
- const offsets = createCoords(0);
349
- function setLeftRTLScrollbarOffset() {
350
- offsets.x = getWindowScrollBarX(documentElement);
351
- }
352
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
353
- if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
354
- scroll = getNodeScroll(offsetParent);
355
- }
356
- if (isOffsetParentAnElement) {
357
- const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
358
- offsets.x = offsetRect.x + offsetParent.clientLeft;
359
- offsets.y = offsetRect.y + offsetParent.clientTop;
360
- } else if (documentElement) {
361
- setLeftRTLScrollbarOffset();
362
- }
363
- }
364
- if (isFixed && !isOffsetParentAnElement && documentElement) {
365
- setLeftRTLScrollbarOffset();
366
- }
367
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
368
- const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
369
- const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
370
- return {
371
- x,
372
- y,
373
- width: rect.width,
374
- height: rect.height
375
- };
376
- }
377
- function isStaticPositioned(element) {
378
- return getComputedStyle$1(element).position === "static";
379
- }
380
- function getTrueOffsetParent(element, polyfill) {
381
- if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") {
382
- return null;
383
- }
384
- if (polyfill) {
385
- return polyfill(element);
386
- }
387
- let rawOffsetParent = element.offsetParent;
388
- if (getDocumentElement(element) === rawOffsetParent) {
389
- rawOffsetParent = rawOffsetParent.ownerDocument.body;
390
- }
391
- return rawOffsetParent;
392
- }
393
- function getOffsetParent(element, polyfill) {
394
- const win = getWindow(element);
395
- if (isTopLayer(element)) {
396
- return win;
397
- }
398
- if (!isHTMLElement(element)) {
399
- let svgOffsetParent = getParentNode(element);
400
- while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
401
- if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
402
- return svgOffsetParent;
403
- }
404
- svgOffsetParent = getParentNode(svgOffsetParent);
405
- }
406
- return win;
407
- }
408
- let offsetParent = getTrueOffsetParent(element, polyfill);
409
- while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
410
- offsetParent = getTrueOffsetParent(offsetParent, polyfill);
411
- }
412
- if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
413
- return win;
414
- }
415
- return offsetParent || getContainingBlock(element) || win;
416
- }
417
- const getElementRects = async function(data) {
418
- const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
419
- const getDimensionsFn = this.getDimensions;
420
- const floatingDimensions = await getDimensionsFn(data.floating);
421
- return {
422
- reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
423
- floating: {
424
- x: 0,
425
- y: 0,
426
- width: floatingDimensions.width,
427
- height: floatingDimensions.height
428
- }
429
- };
430
- };
431
- function isRTL(element) {
432
- return getComputedStyle$1(element).direction === "rtl";
433
- }
434
- const platform = {
435
- convertOffsetParentRelativeRectToViewportRelativeRect,
436
- getDocumentElement,
437
- getClippingRect,
438
- getOffsetParent,
439
- getElementRects,
440
- getClientRects,
441
- getDimensions,
442
- getScale,
443
- isElement,
444
- isRTL
445
- };
446
- function rectsAreEqual(a, b) {
447
- return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
448
- }
449
- function observeMove(element, onMove) {
450
- let io = null;
451
- let timeoutId;
452
- const root = getDocumentElement(element);
453
- function cleanup() {
454
- var _io;
455
- clearTimeout(timeoutId);
456
- (_io = io) == null || _io.disconnect();
457
- io = null;
458
- }
459
- function refresh(skip, threshold) {
460
- if (skip === void 0) {
461
- skip = false;
462
- }
463
- if (threshold === void 0) {
464
- threshold = 1;
465
- }
466
- cleanup();
467
- const elementRectForRootMargin = element.getBoundingClientRect();
468
- const {
469
- left,
470
- top,
471
- width,
472
- height
473
- } = elementRectForRootMargin;
474
- if (!skip) {
475
- onMove();
476
- }
477
- if (!width || !height) {
478
- return;
479
- }
480
- const insetTop = floor(top);
481
- const insetRight = floor(root.clientWidth - (left + width));
482
- const insetBottom = floor(root.clientHeight - (top + height));
483
- const insetLeft = floor(left);
484
- const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
485
- const options = {
486
- rootMargin,
487
- threshold: max(0, min(1, threshold)) || 1
488
- };
489
- let isFirstUpdate = true;
490
- function handleObserve(entries) {
491
- const ratio = entries[0].intersectionRatio;
492
- if (ratio !== threshold) {
493
- if (!isFirstUpdate) {
494
- return refresh();
495
- }
496
- if (!ratio) {
497
- timeoutId = setTimeout(() => {
498
- refresh(false, 1e-7);
499
- }, 1e3);
500
- } else {
501
- refresh(false, ratio);
502
- }
503
- }
504
- if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
505
- refresh();
506
- }
507
- isFirstUpdate = false;
508
- }
509
- try {
510
- io = new IntersectionObserver(handleObserve, {
511
- ...options,
512
- // Handle <iframe>s
513
- root: root.ownerDocument
514
- });
515
- } catch (_e) {
516
- io = new IntersectionObserver(handleObserve, options);
517
- }
518
- io.observe(element);
519
- }
520
- refresh(true);
521
- return cleanup;
522
- }
523
- function autoUpdate(reference, floating, update, options) {
524
- if (options === void 0) {
525
- options = {};
526
- }
527
- const {
528
- ancestorScroll = true,
529
- ancestorResize = true,
530
- elementResize = typeof ResizeObserver === "function",
531
- layoutShift = typeof IntersectionObserver === "function",
532
- animationFrame = false
533
- } = options;
534
- const referenceEl = unwrapElement(reference);
535
- const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
536
- ancestors.forEach((ancestor) => {
537
- ancestorScroll && ancestor.addEventListener("scroll", update, {
538
- passive: true
539
- });
540
- ancestorResize && ancestor.addEventListener("resize", update);
541
- });
542
- const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
543
- let reobserveFrame = -1;
544
- let resizeObserver = null;
545
- if (elementResize) {
546
- resizeObserver = new ResizeObserver((_ref) => {
547
- let [firstEntry] = _ref;
548
- if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
549
- resizeObserver.unobserve(floating);
550
- cancelAnimationFrame(reobserveFrame);
551
- reobserveFrame = requestAnimationFrame(() => {
552
- var _resizeObserver;
553
- (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
554
- });
555
- }
556
- update();
557
- });
558
- if (referenceEl && !animationFrame) {
559
- resizeObserver.observe(referenceEl);
560
- }
561
- resizeObserver.observe(floating);
562
- }
563
- let frameId;
564
- let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
565
- if (animationFrame) {
566
- frameLoop();
567
- }
568
- function frameLoop() {
569
- const nextRefRect = getBoundingClientRect(reference);
570
- if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
571
- update();
572
- }
573
- prevRefRect = nextRefRect;
574
- frameId = requestAnimationFrame(frameLoop);
575
- }
576
- update();
577
- return () => {
578
- var _resizeObserver2;
579
- ancestors.forEach((ancestor) => {
580
- ancestorScroll && ancestor.removeEventListener("scroll", update);
581
- ancestorResize && ancestor.removeEventListener("resize", update);
582
- });
583
- cleanupIo == null || cleanupIo();
584
- (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
585
- resizeObserver = null;
586
- if (animationFrame) {
587
- cancelAnimationFrame(frameId);
588
- }
589
- };
590
- }
591
- const offset = offset$1;
592
- const shift = shift$1;
593
- const flip = flip$1;
594
- const size = size$1;
595
- const hide = hide$1;
596
- const arrow = arrow$1;
597
- const limitShift = limitShift$1;
598
- const computePosition = (reference, floating, options) => {
599
- const cache = /* @__PURE__ */ new Map();
600
- const mergedOptions = {
601
- platform,
602
- ...options
603
- };
604
- const platformWithCache = {
605
- ...mergedOptions.platform,
606
- _c: cache
607
- };
608
- return computePosition$1(reference, floating, {
609
- ...mergedOptions,
610
- platform: platformWithCache
611
- });
612
- };
613
- export {
614
- arrow,
615
- autoUpdate,
616
- computePosition,
617
- flip,
618
- getOverflowAncestors,
619
- hide,
620
- limitShift,
621
- offset,
622
- platform,
623
- shift,
624
- size
625
- };
626
- //# sourceMappingURL=index.es84.js.map