@vonage/vivid 3.0.0-test.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (325) hide show
  1. package/README.md +176 -4
  2. package/accordion/index.js +22 -61
  3. package/accordion-item/index.js +16 -123
  4. package/action-group/index.js +5 -0
  5. package/avatar/index.js +11 -0
  6. package/badge/index.js +9 -60
  7. package/banner/index.js +20 -208
  8. package/breadcrumb/index.js +7 -96
  9. package/breadcrumb-item/index.js +15 -48
  10. package/button/index.js +19 -758
  11. package/calendar/index.js +5 -1519
  12. package/calendar-event/index.js +9 -0
  13. package/card/index.js +13 -0
  14. package/checkbox/index.js +16 -0
  15. package/combobox/index.js +35 -0
  16. package/dialog/index.js +24 -0
  17. package/divider/index.js +6 -0
  18. package/elevation/index.js +4 -30
  19. package/fab/index.js +22 -0
  20. package/focus/index.js +4 -2
  21. package/header/index.js +6 -0
  22. package/icon/index.js +8 -32
  23. package/index.js +76 -25
  24. package/layout/index.js +4 -52
  25. package/lib/accordion/accordion.d.ts +3 -7
  26. package/lib/accordion/accordion.template.d.ts +1 -2
  27. package/lib/accordion/definition.d.ts +1 -0
  28. package/lib/accordion/index.d.ts +1 -2
  29. package/lib/accordion-item/accordion-item.d.ts +4 -8
  30. package/lib/accordion-item/accordion-item.template.d.ts +4 -4
  31. package/lib/accordion-item/definition.d.ts +1 -0
  32. package/lib/accordion-item/index.d.ts +1 -3
  33. package/lib/action-group/action-group.d.ts +10 -0
  34. package/lib/{sidenav-item/sidenav-item.template.d.ts → action-group/action-group.template.d.ts} +2 -2
  35. package/lib/action-group/definition.d.ts +1 -0
  36. package/lib/action-group/index.d.ts +1 -0
  37. package/lib/avatar/avatar.d.ts +15 -0
  38. package/lib/avatar/avatar.template.d.ts +4 -0
  39. package/lib/avatar/definition.d.ts +1 -0
  40. package/lib/avatar/index.d.ts +1 -0
  41. package/lib/badge/badge.d.ts +4 -6
  42. package/lib/badge/definition.d.ts +3 -0
  43. package/lib/badge/index.d.ts +1 -3
  44. package/lib/banner/banner.d.ts +1 -1
  45. package/lib/banner/banner.template.d.ts +0 -2
  46. package/lib/banner/definition.d.ts +1 -0
  47. package/lib/banner/index.d.ts +1 -2
  48. package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
  49. package/lib/breadcrumb/definition.d.ts +1 -0
  50. package/lib/breadcrumb/index.d.ts +1 -2
  51. package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  52. package/lib/breadcrumb-item/definition.d.ts +1 -0
  53. package/lib/breadcrumb-item/index.d.ts +1 -3
  54. package/lib/button/button.d.ts +4 -3
  55. package/lib/button/definition.d.ts +1 -0
  56. package/lib/button/index.d.ts +1 -21
  57. package/lib/calendar/calendar.d.ts +3 -1
  58. package/lib/calendar/definition.d.ts +1 -0
  59. package/lib/calendar/index.d.ts +1 -3
  60. package/lib/calendar-event/calendar-event.d.ts +14 -0
  61. package/lib/calendar-event/calendar-event.template.d.ts +4 -0
  62. package/lib/calendar-event/definition.d.ts +1 -0
  63. package/lib/calendar-event/index.d.ts +1 -0
  64. package/lib/card/card.d.ts +10 -0
  65. package/lib/{text/text.template.d.ts → card/card.template.d.ts} +2 -2
  66. package/lib/card/definition.d.ts +1 -0
  67. package/lib/card/index.d.ts +1 -0
  68. package/lib/checkbox/checkbox.d.ts +5 -0
  69. package/lib/checkbox/checkbox.template.d.ts +4 -0
  70. package/lib/checkbox/definition.d.ts +1 -0
  71. package/lib/checkbox/index.d.ts +1 -0
  72. package/lib/combobox/combobox.d.ts +14 -0
  73. package/lib/combobox/combobox.template.d.ts +4 -0
  74. package/lib/combobox/definition.d.ts +3 -0
  75. package/lib/combobox/index.d.ts +1 -0
  76. package/lib/components.d.ts +44 -16
  77. package/lib/dialog/definition.d.ts +1 -0
  78. package/lib/dialog/dialog.d.ts +23 -0
  79. package/lib/dialog/dialog.template.d.ts +4 -0
  80. package/lib/dialog/index.d.ts +1 -0
  81. package/lib/divider/definition.d.ts +1 -0
  82. package/lib/divider/divider.d.ts +3 -0
  83. package/lib/divider/divider.template.d.ts +4 -0
  84. package/lib/divider/index.d.ts +1 -0
  85. package/lib/elevation/definition.d.ts +1 -0
  86. package/lib/elevation/elevation.d.ts +1 -0
  87. package/lib/elevation/index.d.ts +1 -2
  88. package/lib/enums.d.ts +20 -6
  89. package/lib/fab/definition.d.ts +3 -0
  90. package/lib/fab/fab.d.ts +13 -0
  91. package/lib/fab/fab.template.d.ts +4 -0
  92. package/lib/fab/index.d.ts +1 -0
  93. package/lib/focus/definition.d.ts +3 -0
  94. package/lib/focus/index.d.ts +1 -2
  95. package/lib/{sidenav-item/index.d.ts → header/definition.d.ts} +2 -2
  96. package/lib/header/header.d.ts +5 -0
  97. package/lib/header/header.template.d.ts +4 -0
  98. package/lib/header/index.d.ts +1 -0
  99. package/lib/icon/definition.d.ts +3 -0
  100. package/lib/icon/icon.d.ts +5 -6
  101. package/lib/icon/index.d.ts +1 -2
  102. package/lib/layout/definition.d.ts +3 -0
  103. package/lib/layout/index.d.ts +1 -2
  104. package/lib/layout/layout.d.ts +4 -4
  105. package/lib/listbox/definition.d.ts +3 -0
  106. package/lib/listbox/index.d.ts +1 -0
  107. package/lib/listbox/listbox.d.ts +6 -0
  108. package/lib/listbox/listbox.template.d.ts +4 -0
  109. package/lib/menu/definition.d.ts +11 -0
  110. package/lib/menu/index.d.ts +1 -0
  111. package/lib/menu/menu.d.ts +10 -0
  112. package/lib/menu/menu.template.d.ts +3 -0
  113. package/lib/menu-item/definition.d.ts +3 -0
  114. package/lib/menu-item/index.d.ts +1 -0
  115. package/lib/menu-item/menu-item.d.ts +8 -0
  116. package/lib/menu-item/menu-item.template.d.ts +5 -0
  117. package/lib/nav/definition.d.ts +3 -0
  118. package/lib/nav/index.d.ts +1 -0
  119. package/lib/nav/nav.d.ts +3 -0
  120. package/lib/nav/nav.template.d.ts +4 -0
  121. package/lib/nav-disclosure/definition.d.ts +3 -0
  122. package/lib/nav-disclosure/index.d.ts +1 -0
  123. package/lib/nav-disclosure/nav-disclosure.d.ts +10 -0
  124. package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -0
  125. package/lib/nav-item/definition.d.ts +3 -0
  126. package/lib/nav-item/index.d.ts +1 -0
  127. package/lib/{sidenav-item/sidenav-item.d.ts → nav-item/nav-item.d.ts} +2 -2
  128. package/lib/nav-item/nav-item.template.d.ts +4 -0
  129. package/lib/note/definition.d.ts +3 -0
  130. package/lib/note/index.d.ts +1 -0
  131. package/lib/note/note.d.ts +10 -0
  132. package/lib/note/note.template.d.ts +4 -0
  133. package/lib/number-field/definition.d.ts +4 -0
  134. package/lib/number-field/index.d.ts +1 -0
  135. package/lib/number-field/number-field.d.ts +14 -0
  136. package/lib/number-field/number-field.template.d.ts +4 -0
  137. package/lib/option/definition.d.ts +3 -0
  138. package/lib/option/index.d.ts +1 -0
  139. package/lib/option/option.d.ts +9 -0
  140. package/lib/option/option.template.d.ts +4 -0
  141. package/lib/popup/definition.d.ts +4 -0
  142. package/lib/popup/index.d.ts +1 -4
  143. package/lib/popup/popup.d.ts +8 -4
  144. package/lib/progress/definition.d.ts +3 -0
  145. package/lib/progress/index.d.ts +1 -2
  146. package/lib/progress/progress.d.ts +1 -1
  147. package/lib/progress-ring/definition.d.ts +3 -0
  148. package/lib/progress-ring/index.d.ts +1 -2
  149. package/lib/progress-ring/progress-ring.d.ts +2 -1
  150. package/lib/radio/definition.d.ts +3 -0
  151. package/lib/radio/index.d.ts +1 -0
  152. package/lib/radio/radio.d.ts +4 -0
  153. package/lib/radio/radio.template.d.ts +4 -0
  154. package/lib/radio-group/definition.d.ts +11 -0
  155. package/lib/radio-group/index.d.ts +1 -0
  156. package/lib/radio-group/radio-group.d.ts +4 -0
  157. package/lib/radio-group/radio-group.template.d.ts +4 -0
  158. package/lib/select/definition.d.ts +3 -0
  159. package/lib/select/index.d.ts +1 -0
  160. package/lib/select/select.d.ts +17 -0
  161. package/lib/select/select.template.d.ts +4 -0
  162. package/lib/side-drawer/definition.d.ts +3 -0
  163. package/lib/side-drawer/index.d.ts +1 -2
  164. package/lib/side-drawer/side-drawer.d.ts +3 -2
  165. package/lib/slider/definition.d.ts +3 -0
  166. package/lib/slider/index.d.ts +1 -0
  167. package/lib/slider/slider.d.ts +4 -0
  168. package/lib/slider/slider.template.d.ts +4 -0
  169. package/lib/switch/definition.d.ts +3 -0
  170. package/lib/switch/index.d.ts +1 -0
  171. package/lib/switch/switch.d.ts +7 -0
  172. package/lib/switch/switch.template.d.ts +4 -0
  173. package/lib/tab/definition.d.ts +3 -0
  174. package/lib/tab/index.d.ts +1 -0
  175. package/lib/tab/tab.d.ts +9 -0
  176. package/lib/tab/tab.template.d.ts +3 -0
  177. package/lib/tab-panel/definition.d.ts +3 -0
  178. package/lib/tab-panel/index.d.ts +1 -0
  179. package/lib/tab-panel/tab-panel.d.ts +3 -0
  180. package/lib/tab-panel/tab-panel.template.d.ts +2 -0
  181. package/lib/tabs/definition.d.ts +3 -0
  182. package/lib/tabs/index.d.ts +1 -0
  183. package/lib/tabs/tabs.d.ts +10 -0
  184. package/lib/tabs/tabs.template.d.ts +2 -0
  185. package/lib/text-anchor/definition.d.ts +3 -0
  186. package/lib/text-anchor/index.d.ts +1 -2
  187. package/lib/text-anchor/text-anchor.d.ts +1 -1
  188. package/lib/text-area/definition.d.ts +3 -0
  189. package/lib/text-area/index.d.ts +1 -0
  190. package/lib/text-area/text-area.d.ts +9 -0
  191. package/lib/text-area/text-area.template.d.ts +4 -0
  192. package/lib/text-field/definition.d.ts +3 -0
  193. package/lib/text-field/index.d.ts +1 -0
  194. package/lib/text-field/text-field.d.ts +14 -0
  195. package/lib/text-field/text-field.template.d.ts +4 -0
  196. package/lib/tooltip/definition.d.ts +3 -0
  197. package/lib/tooltip/index.d.ts +1 -3
  198. package/lib/tooltip/tooltip.d.ts +7 -7
  199. package/listbox/index.js +27 -0
  200. package/menu/index.js +30 -0
  201. package/menu-item/index.js +20 -0
  202. package/nav/index.js +4 -0
  203. package/nav-disclosure/index.js +17 -0
  204. package/nav-item/index.js +22 -0
  205. package/note/index.js +15 -0
  206. package/number-field/index.js +459 -0
  207. package/option/index.js +21 -0
  208. package/package.json +29 -19
  209. package/popup/index.js +21 -2061
  210. package/progress/index.js +6 -97
  211. package/progress-ring/index.js +6 -75
  212. package/radio/index.js +12 -0
  213. package/radio-group/index.js +11 -0
  214. package/select/index.js +34 -0
  215. package/shared/affix.js +2 -8
  216. package/shared/anchor.js +10 -2
  217. package/shared/apply-mixins.js +5 -4
  218. package/shared/aria-global.js +2 -86
  219. package/shared/aria.js +9 -0
  220. package/shared/base-progress.js +5 -0
  221. package/shared/breadcrumb-item.js +1 -1
  222. package/shared/button.js +200 -0
  223. package/shared/calendar-event.js +19 -0
  224. package/shared/definition.js +225 -0
  225. package/shared/definition10.js +99 -0
  226. package/shared/definition11.js +48 -0
  227. package/shared/definition12.js +1523 -0
  228. package/shared/definition13.js +111 -0
  229. package/shared/definition14.js +114 -0
  230. package/shared/definition15.js +32 -0
  231. package/shared/definition16.js +172 -0
  232. package/shared/definition17.js +727 -0
  233. package/shared/definition18.js +1842 -0
  234. package/shared/definition19.js +261 -0
  235. package/shared/definition2.js +150 -0
  236. package/shared/definition20.js +221 -0
  237. package/shared/definition21.js +78 -0
  238. package/shared/definition22.js +87 -0
  239. package/shared/definition23.js +58 -0
  240. package/shared/definition24.js +44 -0
  241. package/shared/definition25.js +58 -0
  242. package/shared/definition26.js +348 -0
  243. package/shared/definition27.js +363 -0
  244. package/shared/definition28.js +21 -0
  245. package/shared/definition29.js +75 -0
  246. package/shared/definition3.js +29 -0
  247. package/shared/definition30.js +31 -0
  248. package/shared/definition31.js +49 -0
  249. package/shared/definition32.js +94 -0
  250. package/shared/definition33.js +77 -0
  251. package/shared/definition34.js +45 -0
  252. package/shared/definition35.js +435 -0
  253. package/shared/definition36.js +634 -0
  254. package/shared/definition37.js +86 -0
  255. package/shared/definition38.js +592 -0
  256. package/shared/definition39.js +147 -0
  257. package/shared/definition4.js +19 -0
  258. package/shared/definition40.js +67 -0
  259. package/shared/definition41.js +32 -0
  260. package/shared/definition42.js +440 -0
  261. package/shared/definition43.js +282 -0
  262. package/shared/definition44.js +119 -0
  263. package/shared/definition45.js +77 -0
  264. package/shared/definition5.js +38 -0
  265. package/shared/definition6.js +60 -0
  266. package/shared/definition7.js +45 -0
  267. package/shared/definition8.js +113 -0
  268. package/shared/definition9.js +107 -0
  269. package/shared/design-system/index.d.ts +1 -1
  270. package/shared/dialog-polyfill.esm.js +858 -0
  271. package/shared/direction.js +20 -0
  272. package/shared/dom.js +8 -0
  273. package/shared/enums.js +70 -0
  274. package/shared/es.object.assign.js +2 -2
  275. package/shared/es.regexp.to-string.js +59 -0
  276. package/shared/focus.js +5 -0
  277. package/shared/focus2.js +11 -0
  278. package/shared/form-associated.js +466 -0
  279. package/shared/form-elements.js +127 -0
  280. package/shared/icon.js +538 -572
  281. package/shared/index.js +1664 -83
  282. package/shared/key-codes.js +97 -0
  283. package/shared/listbox.js +995 -0
  284. package/shared/numbers.js +34 -0
  285. package/shared/patterns/affix.d.ts +1 -1
  286. package/shared/patterns/focus.d.ts +3 -0
  287. package/shared/patterns/form-elements/form-elements.d.ts +43 -0
  288. package/shared/patterns/form-elements/index.d.ts +1 -0
  289. package/shared/patterns/index.d.ts +2 -0
  290. package/shared/radio.js +127 -0
  291. package/shared/ref.js +41 -0
  292. package/shared/select.options.js +10 -0
  293. package/shared/start-end.js +50 -0
  294. package/shared/string-trim.js +40 -0
  295. package/shared/strings.js +9 -0
  296. package/shared/text-anchor.js +2 -13
  297. package/shared/text-anchor.template.js +6 -5
  298. package/shared/text-field.js +3 -0
  299. package/shared/text-field2.js +225 -0
  300. package/shared/to-string.js +51 -0
  301. package/side-drawer/index.js +5 -80
  302. package/slider/index.js +17 -0
  303. package/styles/core/all.css +83 -0
  304. package/styles/core/theme.css +11 -0
  305. package/styles/core/typography.css +77 -0
  306. package/styles/tokens/theme-dark.css +228 -0
  307. package/styles/tokens/theme-light.css +228 -0
  308. package/switch/index.js +18 -0
  309. package/tab/index.js +16 -0
  310. package/tab-panel/index.js +4 -0
  311. package/tabs/index.js +24 -0
  312. package/text-anchor/index.js +11 -5
  313. package/text-area/index.js +23 -0
  314. package/text-field/index.js +24 -0
  315. package/tooltip/index.js +18 -57
  316. package/lib/text/index.d.ts +0 -2
  317. package/lib/text/text.d.ts +0 -10
  318. package/shared/index2.js +0 -21
  319. package/shared/style-inject.es.js +0 -28
  320. package/shared/web.dom-collections.iterator.js +0 -1479
  321. package/sidenav-item/index.js +0 -38
  322. package/styles/fonts/spezia.css +0 -23
  323. package/styles/themes/dark.css +0 -205
  324. package/styles/themes/light.css +0 -205
  325. package/text/index.js +0 -45
package/popup/index.js CHANGED
@@ -1,2065 +1,25 @@
1
- import '../elevation/index.js';
2
- import '../button/index.js';
3
- import { F as FoundationElement, c as __classPrivateFieldGet, g as __classPrivateFieldSet, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
4
- import { t as toString$3, s as speciesConstructor$1, f as functionApply } from '../shared/icon.js';
5
- import { m as anObject$3, p as fails$5, g as global$5, l as functionCall, f as functionUncurryThis, M as shared$1, N as objectCreate, E as internalState, _ as _export, w as wellKnownSymbol$2, r as redefine$1, O as createNonEnumerableProperty$1, z as isObject$1, h as classofRaw, F as requireObjectCoercible$2, P as toIntegerOrInfinity$1, Q as toPropertyKey$1, o as objectDefineProperty, R as createPropertyDescriptor$1, n as lengthOfArrayLike$1, S as toAbsoluteIndex$1, j as isCallable$1, T as toLength$1, k as getMethod$1 } from '../shared/web.dom-collections.iterator.js';
6
- import '../shared/es.object.assign.js';
7
- import { s as styleInject } from '../shared/style-inject.es.js';
8
- import { w as when } from '../shared/when.js';
9
- import { r as ref } from '../shared/aria-global.js';
10
- import { c as classNames } from '../shared/class-names.js';
11
- import '../icon/index.js';
1
+ import { r as registerPopup } from '../shared/definition18.js';
2
+ import '../shared/index.js';
3
+ import '../shared/definition9.js';
4
+ import '../shared/definition3.js';
5
+ import '../shared/icon.js';
6
+ import '../shared/to-string.js';
7
+ import '../shared/string-trim.js';
12
8
  import '../shared/_has.js';
13
- import '../shared/index2.js';
9
+ import '../shared/class-names.js';
10
+ import '../shared/when.js';
11
+ import '../shared/definition4.js';
12
+ import '../shared/focus.js';
14
13
  import '../shared/affix.js';
14
+ import '../shared/button.js';
15
15
  import '../shared/apply-mixins.js';
16
+ import '../shared/form-associated.js';
17
+ import '../shared/key-codes.js';
18
+ import '../shared/aria-global.js';
19
+ import '../shared/start-end.js';
20
+ import '../shared/ref.js';
21
+ import '../shared/focus2.js';
22
+ import '../shared/definition15.js';
23
+ import '../shared/es.object.assign.js';
16
24
 
17
- var anObject$2 = anObject$3;
18
-
19
- // `RegExp.prototype.flags` getter implementation
20
- // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
21
- var regexpFlags$1 = function () {
22
- var that = anObject$2(this);
23
- var result = '';
24
- if (that.global) result += 'g';
25
- if (that.ignoreCase) result += 'i';
26
- if (that.multiline) result += 'm';
27
- if (that.dotAll) result += 's';
28
- if (that.unicode) result += 'u';
29
- if (that.sticky) result += 'y';
30
- return result;
31
- };
32
-
33
- var fails$4 = fails$5;
34
- var global$4 = global$5;
35
-
36
- // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
37
- var $RegExp$2 = global$4.RegExp;
38
-
39
- var UNSUPPORTED_Y$2 = fails$4(function () {
40
- var re = $RegExp$2('a', 'y');
41
- re.lastIndex = 2;
42
- return re.exec('abcd') != null;
43
- });
44
-
45
- // UC Browser bug
46
- // https://github.com/zloirock/core-js/issues/1008
47
- var MISSED_STICKY = UNSUPPORTED_Y$2 || fails$4(function () {
48
- return !$RegExp$2('a', 'y').sticky;
49
- });
50
-
51
- var BROKEN_CARET = UNSUPPORTED_Y$2 || fails$4(function () {
52
- // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
53
- var re = $RegExp$2('^r', 'gy');
54
- re.lastIndex = 2;
55
- return re.exec('str') != null;
56
- });
57
-
58
- var regexpStickyHelpers = {
59
- BROKEN_CARET: BROKEN_CARET,
60
- MISSED_STICKY: MISSED_STICKY,
61
- UNSUPPORTED_Y: UNSUPPORTED_Y$2
62
- };
63
-
64
- var fails$3 = fails$5;
65
- var global$3 = global$5;
66
-
67
- // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
68
- var $RegExp$1 = global$3.RegExp;
69
-
70
- var regexpUnsupportedDotAll = fails$3(function () {
71
- var re = $RegExp$1('.', 's');
72
- return !(re.dotAll && re.exec('\n') && re.flags === 's');
73
- });
74
-
75
- var fails$2 = fails$5;
76
- var global$2 = global$5;
77
-
78
- // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
79
- var $RegExp = global$2.RegExp;
80
-
81
- var regexpUnsupportedNcg = fails$2(function () {
82
- var re = $RegExp('(?<a>b)', 'g');
83
- return re.exec('b').groups.a !== 'b' ||
84
- 'b'.replace(re, '$<a>c') !== 'bc';
85
- });
86
-
87
- /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
88
- /* eslint-disable regexp/no-useless-quantifier -- testing */
89
- var call$2 = functionCall;
90
- var uncurryThis$3 = functionUncurryThis;
91
- var toString$2 = toString$3;
92
- var regexpFlags = regexpFlags$1;
93
- var stickyHelpers$1 = regexpStickyHelpers;
94
- var shared = shared$1.exports;
95
- var create = objectCreate;
96
- var getInternalState = internalState.get;
97
- var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
98
- var UNSUPPORTED_NCG = regexpUnsupportedNcg;
99
-
100
- var nativeReplace = shared('native-string-replace', String.prototype.replace);
101
- var nativeExec = RegExp.prototype.exec;
102
- var patchedExec = nativeExec;
103
- var charAt$2 = uncurryThis$3(''.charAt);
104
- var indexOf = uncurryThis$3(''.indexOf);
105
- var replace = uncurryThis$3(''.replace);
106
- var stringSlice$2 = uncurryThis$3(''.slice);
107
-
108
- var UPDATES_LAST_INDEX_WRONG = (function () {
109
- var re1 = /a/;
110
- var re2 = /b*/g;
111
- call$2(nativeExec, re1, 'a');
112
- call$2(nativeExec, re2, 'a');
113
- return re1.lastIndex !== 0 || re2.lastIndex !== 0;
114
- })();
115
-
116
- var UNSUPPORTED_Y$1 = stickyHelpers$1.BROKEN_CARET;
117
-
118
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
119
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
120
-
121
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1 || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
122
-
123
- if (PATCH) {
124
- patchedExec = function exec(string) {
125
- var re = this;
126
- var state = getInternalState(re);
127
- var str = toString$2(string);
128
- var raw = state.raw;
129
- var result, reCopy, lastIndex, match, i, object, group;
130
-
131
- if (raw) {
132
- raw.lastIndex = re.lastIndex;
133
- result = call$2(patchedExec, raw, str);
134
- re.lastIndex = raw.lastIndex;
135
- return result;
136
- }
137
-
138
- var groups = state.groups;
139
- var sticky = UNSUPPORTED_Y$1 && re.sticky;
140
- var flags = call$2(regexpFlags, re);
141
- var source = re.source;
142
- var charsAdded = 0;
143
- var strCopy = str;
144
-
145
- if (sticky) {
146
- flags = replace(flags, 'y', '');
147
- if (indexOf(flags, 'g') === -1) {
148
- flags += 'g';
149
- }
150
-
151
- strCopy = stringSlice$2(str, re.lastIndex);
152
- // Support anchored sticky behavior.
153
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$2(str, re.lastIndex - 1) !== '\n')) {
154
- source = '(?: ' + source + ')';
155
- strCopy = ' ' + strCopy;
156
- charsAdded++;
157
- }
158
- // ^(? + rx + ) is needed, in combination with some str slicing, to
159
- // simulate the 'y' flag.
160
- reCopy = new RegExp('^(?:' + source + ')', flags);
161
- }
162
-
163
- if (NPCG_INCLUDED) {
164
- reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
165
- }
166
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
167
-
168
- match = call$2(nativeExec, sticky ? reCopy : re, strCopy);
169
-
170
- if (sticky) {
171
- if (match) {
172
- match.input = stringSlice$2(match.input, charsAdded);
173
- match[0] = stringSlice$2(match[0], charsAdded);
174
- match.index = re.lastIndex;
175
- re.lastIndex += match[0].length;
176
- } else re.lastIndex = 0;
177
- } else if (UPDATES_LAST_INDEX_WRONG && match) {
178
- re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
179
- }
180
- if (NPCG_INCLUDED && match && match.length > 1) {
181
- // Fix browsers whose `exec` methods don't consistently return `undefined`
182
- // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
183
- call$2(nativeReplace, match[0], reCopy, function () {
184
- for (i = 1; i < arguments.length - 2; i++) {
185
- if (arguments[i] === undefined) match[i] = undefined;
186
- }
187
- });
188
- }
189
-
190
- if (match && groups) {
191
- match.groups = object = create(null);
192
- for (i = 0; i < groups.length; i++) {
193
- group = groups[i];
194
- object[group[0]] = match[group[1]];
195
- }
196
- }
197
-
198
- return match;
199
- };
200
- }
201
-
202
- var regexpExec$3 = patchedExec;
203
-
204
- var $ = _export;
205
- var exec$1 = regexpExec$3;
206
-
207
- // `RegExp.prototype.exec` method
208
- // https://tc39.es/ecma262/#sec-regexp.prototype.exec
209
- $({ target: 'RegExp', proto: true, forced: /./.exec !== exec$1 }, {
210
- exec: exec$1
211
- });
212
-
213
- // TODO: Remove from `core-js@4` since it's moved to entry points
214
-
215
- var uncurryThis$2 = functionUncurryThis;
216
- var redefine = redefine$1.exports;
217
- var regexpExec$2 = regexpExec$3;
218
- var fails$1 = fails$5;
219
- var wellKnownSymbol$1 = wellKnownSymbol$2;
220
- var createNonEnumerableProperty = createNonEnumerableProperty$1;
221
-
222
- var SPECIES = wellKnownSymbol$1('species');
223
- var RegExpPrototype = RegExp.prototype;
224
-
225
- var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
226
- var SYMBOL = wellKnownSymbol$1(KEY);
227
-
228
- var DELEGATES_TO_SYMBOL = !fails$1(function () {
229
- // String methods call symbol-named RegEp methods
230
- var O = {};
231
- O[SYMBOL] = function () { return 7; };
232
- return ''[KEY](O) != 7;
233
- });
234
-
235
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$1(function () {
236
- // Symbol-named RegExp methods call .exec
237
- var execCalled = false;
238
- var re = /a/;
239
-
240
- if (KEY === 'split') {
241
- // We can't use real regex here since it causes deoptimization
242
- // and serious performance degradation in V8
243
- // https://github.com/zloirock/core-js/issues/306
244
- re = {};
245
- // RegExp[@@split] doesn't call the regex's exec method, but first creates
246
- // a new one. We need to return the patched regex when creating the new one.
247
- re.constructor = {};
248
- re.constructor[SPECIES] = function () { return re; };
249
- re.flags = '';
250
- re[SYMBOL] = /./[SYMBOL];
251
- }
252
-
253
- re.exec = function () { execCalled = true; return null; };
254
-
255
- re[SYMBOL]('');
256
- return !execCalled;
257
- });
258
-
259
- if (
260
- !DELEGATES_TO_SYMBOL ||
261
- !DELEGATES_TO_EXEC ||
262
- FORCED
263
- ) {
264
- var uncurriedNativeRegExpMethod = uncurryThis$2(/./[SYMBOL]);
265
- var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
266
- var uncurriedNativeMethod = uncurryThis$2(nativeMethod);
267
- var $exec = regexp.exec;
268
- if ($exec === regexpExec$2 || $exec === RegExpPrototype.exec) {
269
- if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
270
- // The native String method already delegates to @@method (this
271
- // polyfilled function), leasing to infinite recursion.
272
- // We avoid it by directly calling the native @@method method.
273
- return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
274
- }
275
- return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
276
- }
277
- return { done: false };
278
- });
279
-
280
- redefine(String.prototype, KEY, methods[0]);
281
- redefine(RegExpPrototype, SYMBOL, methods[1]);
282
- }
283
-
284
- if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
285
- };
286
-
287
- var isObject = isObject$1;
288
- var classof$1 = classofRaw;
289
- var wellKnownSymbol = wellKnownSymbol$2;
290
-
291
- var MATCH = wellKnownSymbol('match');
292
-
293
- // `IsRegExp` abstract operation
294
- // https://tc39.es/ecma262/#sec-isregexp
295
- var isRegexp = function (it) {
296
- var isRegExp;
297
- return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof$1(it) == 'RegExp');
298
- };
299
-
300
- var uncurryThis$1 = functionUncurryThis;
301
- var toIntegerOrInfinity = toIntegerOrInfinity$1;
302
- var toString$1 = toString$3;
303
- var requireObjectCoercible$1 = requireObjectCoercible$2;
304
-
305
- var charAt$1 = uncurryThis$1(''.charAt);
306
- var charCodeAt = uncurryThis$1(''.charCodeAt);
307
- var stringSlice$1 = uncurryThis$1(''.slice);
308
-
309
- var createMethod = function (CONVERT_TO_STRING) {
310
- return function ($this, pos) {
311
- var S = toString$1(requireObjectCoercible$1($this));
312
- var position = toIntegerOrInfinity(pos);
313
- var size = S.length;
314
- var first, second;
315
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
316
- first = charCodeAt(S, position);
317
- return first < 0xD800 || first > 0xDBFF || position + 1 === size
318
- || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
319
- ? CONVERT_TO_STRING
320
- ? charAt$1(S, position)
321
- : first
322
- : CONVERT_TO_STRING
323
- ? stringSlice$1(S, position, position + 2)
324
- : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
325
- };
326
- };
327
-
328
- var stringMultibyte = {
329
- // `String.prototype.codePointAt` method
330
- // https://tc39.es/ecma262/#sec-string.prototype.codepointat
331
- codeAt: createMethod(false),
332
- // `String.prototype.at` method
333
- // https://github.com/mathiasbynens/String.prototype.at
334
- charAt: createMethod(true)
335
- };
336
-
337
- var charAt = stringMultibyte.charAt;
338
-
339
- // `AdvanceStringIndex` abstract operation
340
- // https://tc39.es/ecma262/#sec-advancestringindex
341
- var advanceStringIndex$1 = function (S, index, unicode) {
342
- return index + (unicode ? charAt(S, index).length : 1);
343
- };
344
-
345
- var toPropertyKey = toPropertyKey$1;
346
- var definePropertyModule = objectDefineProperty;
347
- var createPropertyDescriptor = createPropertyDescriptor$1;
348
-
349
- var createProperty$1 = function (object, key, value) {
350
- var propertyKey = toPropertyKey(key);
351
- if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
352
- else object[propertyKey] = value;
353
- };
354
-
355
- var global$1 = global$5;
356
- var toAbsoluteIndex = toAbsoluteIndex$1;
357
- var lengthOfArrayLike = lengthOfArrayLike$1;
358
- var createProperty = createProperty$1;
359
-
360
- var Array$1 = global$1.Array;
361
- var max$2 = Math.max;
362
-
363
- var arraySliceSimple = function (O, start, end) {
364
- var length = lengthOfArrayLike(O);
365
- var k = toAbsoluteIndex(start, length);
366
- var fin = toAbsoluteIndex(end === undefined ? length : end, length);
367
- var result = Array$1(max$2(fin - k, 0));
368
- for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
369
- result.length = n;
370
- return result;
371
- };
372
-
373
- var global = global$5;
374
- var call$1 = functionCall;
375
- var anObject$1 = anObject$3;
376
- var isCallable = isCallable$1;
377
- var classof = classofRaw;
378
- var regexpExec$1 = regexpExec$3;
379
-
380
- var TypeError = global.TypeError;
381
-
382
- // `RegExpExec` abstract operation
383
- // https://tc39.es/ecma262/#sec-regexpexec
384
- var regexpExecAbstract = function (R, S) {
385
- var exec = R.exec;
386
- if (isCallable(exec)) {
387
- var result = call$1(exec, R, S);
388
- if (result !== null) anObject$1(result);
389
- return result;
390
- }
391
- if (classof(R) === 'RegExp') return call$1(regexpExec$1, R, S);
392
- throw TypeError('RegExp#exec called on incompatible receiver');
393
- };
394
-
395
- var apply = functionApply;
396
- var call = functionCall;
397
- var uncurryThis = functionUncurryThis;
398
- var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
399
- var isRegExp = isRegexp;
400
- var anObject = anObject$3;
401
- var requireObjectCoercible = requireObjectCoercible$2;
402
- var speciesConstructor = speciesConstructor$1;
403
- var advanceStringIndex = advanceStringIndex$1;
404
- var toLength = toLength$1;
405
- var toString = toString$3;
406
- var getMethod = getMethod$1;
407
- var arraySlice = arraySliceSimple;
408
- var callRegExpExec = regexpExecAbstract;
409
- var regexpExec = regexpExec$3;
410
- var stickyHelpers = regexpStickyHelpers;
411
- var fails = fails$5;
412
-
413
- var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
414
- var MAX_UINT32 = 0xFFFFFFFF;
415
- var min$2 = Math.min;
416
- var $push = [].push;
417
- var exec = uncurryThis(/./.exec);
418
- var push = uncurryThis($push);
419
- var stringSlice = uncurryThis(''.slice);
420
-
421
- // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
422
- // Weex JS has frozen built-in prototypes, so use try / catch wrapper
423
- var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
424
- // eslint-disable-next-line regexp/no-empty-group -- required for testing
425
- var re = /(?:)/;
426
- var originalExec = re.exec;
427
- re.exec = function () { return originalExec.apply(this, arguments); };
428
- var result = 'ab'.split(re);
429
- return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
430
- });
431
-
432
- // @@split logic
433
- fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {
434
- var internalSplit;
435
- if (
436
- 'abbc'.split(/(b)*/)[1] == 'c' ||
437
- // eslint-disable-next-line regexp/no-empty-group -- required for testing
438
- 'test'.split(/(?:)/, -1).length != 4 ||
439
- 'ab'.split(/(?:ab)*/).length != 2 ||
440
- '.'.split(/(.?)(.?)/).length != 4 ||
441
- // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
442
- '.'.split(/()()/).length > 1 ||
443
- ''.split(/.?/).length
444
- ) {
445
- // based on es5-shim implementation, need to rework it
446
- internalSplit = function (separator, limit) {
447
- var string = toString(requireObjectCoercible(this));
448
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
449
- if (lim === 0) return [];
450
- if (separator === undefined) return [string];
451
- // If `separator` is not a regex, use native split
452
- if (!isRegExp(separator)) {
453
- return call(nativeSplit, string, separator, lim);
454
- }
455
- var output = [];
456
- var flags = (separator.ignoreCase ? 'i' : '') +
457
- (separator.multiline ? 'm' : '') +
458
- (separator.unicode ? 'u' : '') +
459
- (separator.sticky ? 'y' : '');
460
- var lastLastIndex = 0;
461
- // Make `global` and avoid `lastIndex` issues by working with a copy
462
- var separatorCopy = new RegExp(separator.source, flags + 'g');
463
- var match, lastIndex, lastLength;
464
- while (match = call(regexpExec, separatorCopy, string)) {
465
- lastIndex = separatorCopy.lastIndex;
466
- if (lastIndex > lastLastIndex) {
467
- push(output, stringSlice(string, lastLastIndex, match.index));
468
- if (match.length > 1 && match.index < string.length) apply($push, output, arraySlice(match, 1));
469
- lastLength = match[0].length;
470
- lastLastIndex = lastIndex;
471
- if (output.length >= lim) break;
472
- }
473
- if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
474
- }
475
- if (lastLastIndex === string.length) {
476
- if (lastLength || !exec(separatorCopy, '')) push(output, '');
477
- } else push(output, stringSlice(string, lastLastIndex));
478
- return output.length > lim ? arraySlice(output, 0, lim) : output;
479
- };
480
- // Chakra, V8
481
- } else if ('0'.split(undefined, 0).length) {
482
- internalSplit = function (separator, limit) {
483
- return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit);
484
- };
485
- } else internalSplit = nativeSplit;
486
-
487
- return [
488
- // `String.prototype.split` method
489
- // https://tc39.es/ecma262/#sec-string.prototype.split
490
- function split(separator, limit) {
491
- var O = requireObjectCoercible(this);
492
- var splitter = separator == undefined ? undefined : getMethod(separator, SPLIT);
493
- return splitter
494
- ? call(splitter, separator, O, limit)
495
- : call(internalSplit, toString(O), separator, limit);
496
- },
497
- // `RegExp.prototype[@@split]` method
498
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
499
- //
500
- // NOTE: This cannot be properly polyfilled in engines that don't support
501
- // the 'y' flag.
502
- function (string, limit) {
503
- var rx = anObject(this);
504
- var S = toString(string);
505
- var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
506
-
507
- if (res.done) return res.value;
508
-
509
- var C = speciesConstructor(rx, RegExp);
510
-
511
- var unicodeMatching = rx.unicode;
512
- var flags = (rx.ignoreCase ? 'i' : '') +
513
- (rx.multiline ? 'm' : '') +
514
- (rx.unicode ? 'u' : '') +
515
- (UNSUPPORTED_Y ? 'g' : 'y');
516
-
517
- // ^(? + rx + ) is needed, in combination with some S slicing, to
518
- // simulate the 'y' flag.
519
- var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
520
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
521
- if (lim === 0) return [];
522
- if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
523
- var p = 0;
524
- var q = 0;
525
- var A = [];
526
- while (q < S.length) {
527
- splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
528
- var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);
529
- var e;
530
- if (
531
- z === null ||
532
- (e = min$2(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
533
- ) {
534
- q = advanceStringIndex(S, q, unicodeMatching);
535
- } else {
536
- push(A, stringSlice(S, p, q));
537
- if (A.length === lim) return A;
538
- for (var i = 1; i <= z.length - 1; i++) {
539
- push(A, z[i]);
540
- if (A.length === lim) return A;
541
- }
542
- q = p = e;
543
- }
544
- }
545
- push(A, stringSlice(S, p));
546
- return A;
547
- }
548
- ];
549
- }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
550
-
551
- function getSide(placement) {
552
- return placement.split('-')[0];
553
- }
554
-
555
- function getAlignment(placement) {
556
- return placement.split('-')[1];
557
- }
558
-
559
- function getMainAxisFromPlacement(placement) {
560
- return ['top', 'bottom'].includes(getSide(placement)) ? 'x' : 'y';
561
- }
562
-
563
- function getLengthFromAxis(axis) {
564
- return axis === 'y' ? 'height' : 'width';
565
- }
566
-
567
- function computeCoordsFromPlacement(_ref, placement, rtl) {
568
- let {
569
- reference,
570
- floating
571
- } = _ref;
572
- const commonX = reference.x + reference.width / 2 - floating.width / 2;
573
- const commonY = reference.y + reference.height / 2 - floating.height / 2;
574
- const mainAxis = getMainAxisFromPlacement(placement);
575
- const length = getLengthFromAxis(mainAxis);
576
- const commonAlign = reference[length] / 2 - floating[length] / 2;
577
- const side = getSide(placement);
578
- const isVertical = mainAxis === 'x';
579
- let coords;
580
-
581
- switch (side) {
582
- case 'top':
583
- coords = {
584
- x: commonX,
585
- y: reference.y - floating.height
586
- };
587
- break;
588
-
589
- case 'bottom':
590
- coords = {
591
- x: commonX,
592
- y: reference.y + reference.height
593
- };
594
- break;
595
-
596
- case 'right':
597
- coords = {
598
- x: reference.x + reference.width,
599
- y: commonY
600
- };
601
- break;
602
-
603
- case 'left':
604
- coords = {
605
- x: reference.x - floating.width,
606
- y: commonY
607
- };
608
- break;
609
-
610
- default:
611
- coords = {
612
- x: reference.x,
613
- y: reference.y
614
- };
615
- }
616
-
617
- switch (getAlignment(placement)) {
618
- case 'start':
619
- coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
620
- break;
621
-
622
- case 'end':
623
- coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
624
- break;
625
- }
626
-
627
- return coords;
628
- }
629
-
630
- /**
631
- * Computes the `x` and `y` coordinates that will place the floating element
632
- * next to a reference element when it is given a certain positioning strategy.
633
- *
634
- * This export does not have any `platform` interface logic. You will need to
635
- * write one for the platform you are using Floating UI with.
636
- */
637
-
638
- const computePosition$1 = async (reference, floating, config) => {
639
- const {
640
- placement = 'bottom',
641
- strategy = 'absolute',
642
- middleware = [],
643
- platform
644
- } = config;
645
- const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
646
-
647
- {
648
- if (platform == null) {
649
- console.error(['Floating UI: `platform` property was not passed to config. If you', 'want to use Floating UI on the web, install @floating-ui/dom', 'instead of the /core package. Otherwise, you can create your own', '`platform`: https://floating-ui.com/docs/platform'].join(' '));
650
- }
651
-
652
- if (middleware.filter(_ref => {
653
- let {
654
- name
655
- } = _ref;
656
- return name === 'autoPlacement' || name === 'flip';
657
- }).length > 1) {
658
- throw new Error(['Floating UI: duplicate `flip` and/or `autoPlacement`', 'middleware detected. This will lead to an infinite loop. Ensure only', 'one of either has been passed to the `middleware` array.'].join(' '));
659
- }
660
- }
661
-
662
- let rects = await platform.getElementRects({
663
- reference,
664
- floating,
665
- strategy
666
- });
667
- let {
668
- x,
669
- y
670
- } = computeCoordsFromPlacement(rects, placement, rtl);
671
- let statefulPlacement = placement;
672
- let middlewareData = {};
673
- let _debug_loop_count_ = 0;
674
-
675
- for (let i = 0; i < middleware.length; i++) {
676
- {
677
- _debug_loop_count_++;
678
-
679
- if (_debug_loop_count_ > 100) {
680
- throw new Error(['Floating UI: The middleware lifecycle appears to be', 'running in an infinite loop. This is usually caused by a `reset`', 'continually being returned without a break condition.'].join(' '));
681
- }
682
- }
683
-
684
- const {
685
- name,
686
- fn
687
- } = middleware[i];
688
- const {
689
- x: nextX,
690
- y: nextY,
691
- data,
692
- reset
693
- } = await fn({
694
- x,
695
- y,
696
- initialPlacement: placement,
697
- placement: statefulPlacement,
698
- strategy,
699
- middlewareData,
700
- rects,
701
- platform,
702
- elements: {
703
- reference,
704
- floating
705
- }
706
- });
707
- x = nextX != null ? nextX : x;
708
- y = nextY != null ? nextY : y;
709
- middlewareData = { ...middlewareData,
710
- [name]: { ...middlewareData[name],
711
- ...data
712
- }
713
- };
714
-
715
- if (reset) {
716
- if (typeof reset === 'object') {
717
- if (reset.placement) {
718
- statefulPlacement = reset.placement;
719
- }
720
-
721
- if (reset.rects) {
722
- rects = reset.rects === true ? await platform.getElementRects({
723
- reference,
724
- floating,
725
- strategy
726
- }) : reset.rects;
727
- }
728
-
729
- ({
730
- x,
731
- y
732
- } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
733
- }
734
-
735
- i = -1;
736
- continue;
737
- }
738
- }
739
-
740
- return {
741
- x,
742
- y,
743
- placement: statefulPlacement,
744
- strategy,
745
- middlewareData
746
- };
747
- };
748
-
749
- function expandPaddingObject(padding) {
750
- return {
751
- top: 0,
752
- right: 0,
753
- bottom: 0,
754
- left: 0,
755
- ...padding
756
- };
757
- }
758
-
759
- function getSideObjectFromPadding(padding) {
760
- return typeof padding !== 'number' ? expandPaddingObject(padding) : {
761
- top: padding,
762
- right: padding,
763
- bottom: padding,
764
- left: padding
765
- };
766
- }
767
-
768
- function rectToClientRect(rect) {
769
- return { ...rect,
770
- top: rect.y,
771
- left: rect.x,
772
- right: rect.x + rect.width,
773
- bottom: rect.y + rect.height
774
- };
775
- }
776
-
777
- /**
778
- * Resolves with an object of overflow side offsets that determine how much the
779
- * element is overflowing a given clipping boundary.
780
- * - positive = overflowing the boundary by that number of pixels
781
- * - negative = how many pixels left before it will overflow
782
- * - 0 = lies flush with the boundary
783
- * @see https://floating-ui.com/docs/detectOverflow
784
- */
785
- async function detectOverflow(middlewareArguments, options) {
786
- var _await$platform$isEle;
787
-
788
- if (options === void 0) {
789
- options = {};
790
- }
791
-
792
- const {
793
- x,
794
- y,
795
- platform,
796
- rects,
797
- elements,
798
- strategy
799
- } = middlewareArguments;
800
- const {
801
- boundary = 'clippingAncestors',
802
- rootBoundary = 'viewport',
803
- elementContext = 'floating',
804
- altBoundary = false,
805
- padding = 0
806
- } = options;
807
- const paddingObject = getSideObjectFromPadding(padding);
808
- const altContext = elementContext === 'floating' ? 'reference' : 'floating';
809
- const element = elements[altBoundary ? altContext : elementContext];
810
- const clippingClientRect = rectToClientRect(await platform.getClippingRect({
811
- 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))),
812
- boundary,
813
- rootBoundary
814
- }));
815
- const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
816
- rect: elementContext === 'floating' ? { ...rects.floating,
817
- x,
818
- y
819
- } : rects.reference,
820
- offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
821
- strategy
822
- }) : rects[elementContext]); // positive = overflowing the clipping rect
823
- // 0 or negative = within the clipping rect
824
-
825
- return {
826
- top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
827
- bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
828
- left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
829
- right: elementClientRect.right - clippingClientRect.right + paddingObject.right
830
- };
831
- }
832
-
833
- const min$1 = Math.min;
834
- const max$1 = Math.max;
835
-
836
- function within(min$1$1, value, max$1$1) {
837
- return max$1(min$1$1, min$1(value, max$1$1));
838
- }
839
-
840
- /**
841
- * Positions an inner element of the floating element such that it is centered
842
- * to the reference element.
843
- * @see https://floating-ui.com/docs/arrow
844
- */
845
- const arrow = options => ({
846
- name: 'arrow',
847
- options,
848
-
849
- async fn(middlewareArguments) {
850
- // Since `element` is required, we don't Partial<> the type
851
- const {
852
- element,
853
- padding = 0
854
- } = options != null ? options : {};
855
- const {
856
- x,
857
- y,
858
- placement,
859
- rects,
860
- platform
861
- } = middlewareArguments;
862
-
863
- if (element == null) {
864
- {
865
- console.warn('Floating UI: No `element` was passed to the `arrow` middleware.');
866
- }
867
-
868
- return {};
869
- }
870
-
871
- const paddingObject = getSideObjectFromPadding(padding);
872
- const coords = {
873
- x,
874
- y
875
- };
876
- const axis = getMainAxisFromPlacement(placement);
877
- const length = getLengthFromAxis(axis);
878
- const arrowDimensions = await platform.getDimensions(element);
879
- const minProp = axis === 'y' ? 'top' : 'left';
880
- const maxProp = axis === 'y' ? 'bottom' : 'right';
881
- const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
882
- const startDiff = coords[axis] - rects.reference[axis];
883
- const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
884
- const clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
885
- const centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the floating element if the center
886
- // point is outside of the floating element's bounds
887
-
888
- const min = paddingObject[minProp];
889
- const max = clientSize - arrowDimensions[length] - paddingObject[maxProp];
890
- const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
891
- const offset = within(min, center, max);
892
- return {
893
- data: {
894
- [axis]: offset,
895
- centerOffset: center - offset
896
- }
897
- };
898
- }
899
-
900
- });
901
-
902
- const hash$1 = {
903
- left: 'right',
904
- right: 'left',
905
- bottom: 'top',
906
- top: 'bottom'
907
- };
908
- function getOppositePlacement(placement) {
909
- return placement.replace(/left|right|bottom|top/g, matched => hash$1[matched]);
910
- }
911
-
912
- function getAlignmentSides(placement, rects, rtl) {
913
- if (rtl === void 0) {
914
- rtl = false;
915
- }
916
-
917
- const alignment = getAlignment(placement);
918
- const mainAxis = getMainAxisFromPlacement(placement);
919
- const length = getLengthFromAxis(mainAxis);
920
- let mainAlignmentSide = mainAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
921
-
922
- if (rects.reference[length] > rects.floating[length]) {
923
- mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
924
- }
925
-
926
- return {
927
- main: mainAlignmentSide,
928
- cross: getOppositePlacement(mainAlignmentSide)
929
- };
930
- }
931
-
932
- const hash = {
933
- start: 'end',
934
- end: 'start'
935
- };
936
- function getOppositeAlignmentPlacement(placement) {
937
- return placement.replace(/start|end/g, matched => hash[matched]);
938
- }
939
-
940
- const sides = ['top', 'right', 'bottom', 'left'];
941
-
942
- function getExpandedPlacements(placement) {
943
- const oppositePlacement = getOppositePlacement(placement);
944
- return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
945
- }
946
-
947
- /**
948
- * Changes the placement of the floating element to one that will fit if the
949
- * initially specified `placement` does not.
950
- * @see https://floating-ui.com/docs/flip
951
- */
952
- const flip = function (options) {
953
- if (options === void 0) {
954
- options = {};
955
- }
956
-
957
- return {
958
- name: 'flip',
959
- options,
960
-
961
- async fn(middlewareArguments) {
962
- var _middlewareData$flip;
963
-
964
- const {
965
- placement,
966
- middlewareData,
967
- rects,
968
- initialPlacement,
969
- platform,
970
- elements
971
- } = middlewareArguments;
972
- const {
973
- mainAxis: checkMainAxis = true,
974
- crossAxis: checkCrossAxis = true,
975
- fallbackPlacements: specifiedFallbackPlacements,
976
- fallbackStrategy = 'bestFit',
977
- flipAlignment = true,
978
- ...detectOverflowOptions
979
- } = options;
980
- const side = getSide(placement);
981
- const isBasePlacement = side === initialPlacement;
982
- const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
983
- const placements = [initialPlacement, ...fallbackPlacements];
984
- const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
985
- const overflows = [];
986
- let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
987
-
988
- if (checkMainAxis) {
989
- overflows.push(overflow[side]);
990
- }
991
-
992
- if (checkCrossAxis) {
993
- const {
994
- main,
995
- cross
996
- } = getAlignmentSides(placement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
997
- overflows.push(overflow[main], overflow[cross]);
998
- }
999
-
1000
- overflowsData = [...overflowsData, {
1001
- placement,
1002
- overflows
1003
- }]; // One or more sides is overflowing
1004
-
1005
- if (!overflows.every(side => side <= 0)) {
1006
- var _middlewareData$flip$, _middlewareData$flip2;
1007
-
1008
- const nextIndex = ((_middlewareData$flip$ = (_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) != null ? _middlewareData$flip$ : 0) + 1;
1009
- const nextPlacement = placements[nextIndex];
1010
-
1011
- if (nextPlacement) {
1012
- // Try next placement and re-run the lifecycle
1013
- return {
1014
- data: {
1015
- index: nextIndex,
1016
- overflows: overflowsData
1017
- },
1018
- reset: {
1019
- placement: nextPlacement
1020
- }
1021
- };
1022
- }
1023
-
1024
- let resetPlacement = 'bottom';
1025
-
1026
- switch (fallbackStrategy) {
1027
- case 'bestFit':
1028
- {
1029
- var _overflowsData$slice$;
1030
-
1031
- const placement = (_overflowsData$slice$ = overflowsData.slice().sort((a, b) => a.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0) - b.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0))[0]) == null ? void 0 : _overflowsData$slice$.placement;
1032
-
1033
- if (placement) {
1034
- resetPlacement = placement;
1035
- }
1036
-
1037
- break;
1038
- }
1039
-
1040
- case 'initialPlacement':
1041
- resetPlacement = initialPlacement;
1042
- break;
1043
- }
1044
-
1045
- if (placement !== resetPlacement) {
1046
- return {
1047
- reset: {
1048
- placement: resetPlacement
1049
- }
1050
- };
1051
- }
1052
- }
1053
-
1054
- return {};
1055
- }
1056
-
1057
- };
1058
- };
1059
-
1060
- function getSideOffsets(overflow, rect) {
1061
- return {
1062
- top: overflow.top - rect.height,
1063
- right: overflow.right - rect.width,
1064
- bottom: overflow.bottom - rect.height,
1065
- left: overflow.left - rect.width
1066
- };
1067
- }
1068
-
1069
- function isAnySideFullyClipped(overflow) {
1070
- return sides.some(side => overflow[side] >= 0);
1071
- }
1072
-
1073
- /**
1074
- * Provides data to hide the floating element in applicable situations, such as
1075
- * when it is not in the same clipping context as the reference element.
1076
- * @see https://floating-ui.com/docs/hide
1077
- */
1078
- const hide = function (_temp) {
1079
- let {
1080
- strategy = 'referenceHidden',
1081
- ...detectOverflowOptions
1082
- } = _temp === void 0 ? {} : _temp;
1083
- return {
1084
- name: 'hide',
1085
-
1086
- async fn(middlewareArguments) {
1087
- const {
1088
- rects
1089
- } = middlewareArguments;
1090
-
1091
- switch (strategy) {
1092
- case 'referenceHidden':
1093
- {
1094
- const overflow = await detectOverflow(middlewareArguments, { ...detectOverflowOptions,
1095
- elementContext: 'reference'
1096
- });
1097
- const offsets = getSideOffsets(overflow, rects.reference);
1098
- return {
1099
- data: {
1100
- referenceHiddenOffsets: offsets,
1101
- referenceHidden: isAnySideFullyClipped(offsets)
1102
- }
1103
- };
1104
- }
1105
-
1106
- case 'escaped':
1107
- {
1108
- const overflow = await detectOverflow(middlewareArguments, { ...detectOverflowOptions,
1109
- altBoundary: true
1110
- });
1111
- const offsets = getSideOffsets(overflow, rects.floating);
1112
- return {
1113
- data: {
1114
- escapedOffsets: offsets,
1115
- escaped: isAnySideFullyClipped(offsets)
1116
- }
1117
- };
1118
- }
1119
-
1120
- default:
1121
- {
1122
- return {};
1123
- }
1124
- }
1125
- }
1126
-
1127
- };
1128
- };
1129
-
1130
- function convertValueToCoords(placement, rects, value, rtl) {
1131
- if (rtl === void 0) {
1132
- rtl = false;
1133
- }
1134
-
1135
- const side = getSide(placement);
1136
- const alignment = getAlignment(placement);
1137
- const isVertical = getMainAxisFromPlacement(placement) === 'x';
1138
- const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
1139
- const crossAxisMulti = rtl && isVertical ? -1 : 1;
1140
- const rawValue = typeof value === 'function' ? value({ ...rects,
1141
- placement
1142
- }) : value;
1143
- const isNumber = typeof rawValue === 'number'; // eslint-disable-next-line prefer-const
1144
-
1145
- let {
1146
- mainAxis,
1147
- crossAxis,
1148
- alignmentAxis
1149
- } = isNumber ? {
1150
- mainAxis: rawValue,
1151
- crossAxis: 0,
1152
- alignmentAxis: null
1153
- } : {
1154
- mainAxis: 0,
1155
- crossAxis: 0,
1156
- alignmentAxis: null,
1157
- ...rawValue
1158
- };
1159
-
1160
- if (alignment && typeof alignmentAxis === 'number') {
1161
- crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
1162
- }
1163
-
1164
- return isVertical ? {
1165
- x: crossAxis * crossAxisMulti,
1166
- y: mainAxis * mainAxisMulti
1167
- } : {
1168
- x: mainAxis * mainAxisMulti,
1169
- y: crossAxis * crossAxisMulti
1170
- };
1171
- }
1172
- /**
1173
- * Displaces the floating element from its reference element.
1174
- * @see https://floating-ui.com/docs/offset
1175
- */
1176
-
1177
- const offset = function (value) {
1178
- if (value === void 0) {
1179
- value = 0;
1180
- }
1181
-
1182
- return {
1183
- name: 'offset',
1184
- options: value,
1185
-
1186
- async fn(middlewareArguments) {
1187
- const {
1188
- x,
1189
- y,
1190
- placement,
1191
- rects,
1192
- platform,
1193
- elements
1194
- } = middlewareArguments;
1195
- const diffCoords = convertValueToCoords(placement, rects, value, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
1196
- return {
1197
- x: x + diffCoords.x,
1198
- y: y + diffCoords.y,
1199
- data: diffCoords
1200
- };
1201
- }
1202
-
1203
- };
1204
- };
1205
-
1206
- /**
1207
- * Provides improved positioning for inline reference elements that can span
1208
- * over multiple lines, such as hyperlinks or range selections.
1209
- * @see https://floating-ui.com/docs/inline
1210
- */
1211
- const inline = function (options) {
1212
- if (options === void 0) {
1213
- options = {};
1214
- }
1215
-
1216
- return {
1217
- name: 'inline',
1218
- options,
1219
-
1220
- async fn(middlewareArguments) {
1221
- var _await$platform$getCl;
1222
-
1223
- const {
1224
- placement,
1225
- elements,
1226
- rects,
1227
- platform,
1228
- strategy
1229
- } = middlewareArguments; // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
1230
- // ClientRect's bounds, despite the event listener being triggered. A
1231
- // padding of 2 seems to handle this issue.
1232
-
1233
- const {
1234
- padding = 2,
1235
- x,
1236
- y
1237
- } = options;
1238
- const fallback = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
1239
- rect: rects.reference,
1240
- offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
1241
- strategy
1242
- }) : rects.reference);
1243
- const clientRects = (_await$platform$getCl = await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) != null ? _await$platform$getCl : [];
1244
- const paddingObject = getSideObjectFromPadding(padding);
1245
-
1246
- function getBoundingClientRect() {
1247
- // There are two rects and they are disjoined
1248
- if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
1249
- var _clientRects$find;
1250
-
1251
- // Find the first rect in which the point is fully inside
1252
- return (_clientRects$find = clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom)) != null ? _clientRects$find : fallback;
1253
- } // There are 2 or more connected rects
1254
-
1255
-
1256
- if (clientRects.length >= 2) {
1257
- if (getMainAxisFromPlacement(placement) === 'x') {
1258
- const firstRect = clientRects[0];
1259
- const lastRect = clientRects[clientRects.length - 1];
1260
- const isTop = getSide(placement) === 'top';
1261
- const top = firstRect.top;
1262
- const bottom = lastRect.bottom;
1263
- const left = isTop ? firstRect.left : lastRect.left;
1264
- const right = isTop ? firstRect.right : lastRect.right;
1265
- const width = right - left;
1266
- const height = bottom - top;
1267
- return {
1268
- top,
1269
- bottom,
1270
- left,
1271
- right,
1272
- width,
1273
- height,
1274
- x: left,
1275
- y: top
1276
- };
1277
- }
1278
-
1279
- const isLeftSide = getSide(placement) === 'left';
1280
- const maxRight = max$1(...clientRects.map(rect => rect.right));
1281
- const minLeft = min$1(...clientRects.map(rect => rect.left));
1282
- const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
1283
- const top = measureRects[0].top;
1284
- const bottom = measureRects[measureRects.length - 1].bottom;
1285
- const left = minLeft;
1286
- const right = maxRight;
1287
- const width = right - left;
1288
- const height = bottom - top;
1289
- return {
1290
- top,
1291
- bottom,
1292
- left,
1293
- right,
1294
- width,
1295
- height,
1296
- x: left,
1297
- y: top
1298
- };
1299
- }
1300
-
1301
- return fallback;
1302
- }
1303
-
1304
- const resetRects = await platform.getElementRects({
1305
- reference: {
1306
- getBoundingClientRect
1307
- },
1308
- floating: elements.floating,
1309
- strategy
1310
- });
1311
-
1312
- 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) {
1313
- return {
1314
- reset: {
1315
- rects: resetRects
1316
- }
1317
- };
1318
- }
1319
-
1320
- return {};
1321
- }
1322
-
1323
- };
1324
- };
1325
-
1326
- function isWindow(value) {
1327
- return (value == null ? void 0 : value.toString()) === '[object Window]';
1328
- }
1329
- function getWindow(node) {
1330
- if (node == null) {
1331
- return window;
1332
- }
1333
-
1334
- if (!isWindow(node)) {
1335
- const ownerDocument = node.ownerDocument;
1336
- return ownerDocument ? ownerDocument.defaultView || window : window;
1337
- }
1338
-
1339
- return node;
1340
- }
1341
-
1342
- function getComputedStyle$1(element) {
1343
- return getWindow(element).getComputedStyle(element);
1344
- }
1345
-
1346
- function getNodeName(node) {
1347
- return isWindow(node) ? '' : node ? (node.nodeName || '').toLowerCase() : '';
1348
- }
1349
-
1350
- function isHTMLElement(value) {
1351
- return value instanceof getWindow(value).HTMLElement;
1352
- }
1353
- function isElement(value) {
1354
- return value instanceof getWindow(value).Element;
1355
- }
1356
- function isNode(value) {
1357
- return value instanceof getWindow(value).Node;
1358
- }
1359
- function isShadowRoot(node) {
1360
- const OwnElement = getWindow(node).ShadowRoot;
1361
- return node instanceof OwnElement || node instanceof ShadowRoot;
1362
- }
1363
- function isOverflowElement(element) {
1364
- // Firefox wants us to check `-x` and `-y` variations as well
1365
- const {
1366
- overflow,
1367
- overflowX,
1368
- overflowY
1369
- } = getComputedStyle$1(element);
1370
- return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
1371
- }
1372
- function isTableElement(element) {
1373
- return ['table', 'td', 'th'].includes(getNodeName(element));
1374
- }
1375
- function isContainingBlock(element) {
1376
- // TODO: Try and use feature detection here instead
1377
- const isFirefox = navigator.userAgent.toLowerCase().includes('firefox');
1378
- const css = getComputedStyle$1(element); // This is non-exhaustive but covers the most common CSS properties that
1379
- // create a containing block.
1380
- // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
1381
-
1382
- return css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].includes(css.willChange) || isFirefox && css.willChange === 'filter' || isFirefox && (css.filter ? css.filter !== 'none' : false);
1383
- }
1384
-
1385
- const min = Math.min;
1386
- const max = Math.max;
1387
- const round = Math.round;
1388
-
1389
- function getBoundingClientRect(element, includeScale) {
1390
- if (includeScale === void 0) {
1391
- includeScale = false;
1392
- }
1393
-
1394
- const clientRect = element.getBoundingClientRect();
1395
- let scaleX = 1;
1396
- let scaleY = 1;
1397
-
1398
- if (includeScale && isHTMLElement(element)) {
1399
- scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
1400
- scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
1401
- }
1402
-
1403
- return {
1404
- width: clientRect.width / scaleX,
1405
- height: clientRect.height / scaleY,
1406
- top: clientRect.top / scaleY,
1407
- right: clientRect.right / scaleX,
1408
- bottom: clientRect.bottom / scaleY,
1409
- left: clientRect.left / scaleX,
1410
- x: clientRect.left / scaleX,
1411
- y: clientRect.top / scaleY
1412
- };
1413
- }
1414
-
1415
- function getDocumentElement(node) {
1416
- return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;
1417
- }
1418
-
1419
- function getNodeScroll(element) {
1420
- if (isWindow(element)) {
1421
- return {
1422
- scrollLeft: element.pageXOffset,
1423
- scrollTop: element.pageYOffset
1424
- };
1425
- }
1426
-
1427
- return {
1428
- scrollLeft: element.scrollLeft,
1429
- scrollTop: element.scrollTop
1430
- };
1431
- }
1432
-
1433
- function getWindowScrollBarX(element) {
1434
- // If <html> has a CSS width greater than the viewport, then this will be
1435
- // incorrect for RTL.
1436
- return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
1437
- }
1438
-
1439
- function isScaled(element) {
1440
- const rect = getBoundingClientRect(element);
1441
- return round(rect.width) !== element.offsetWidth || round(rect.height) !== element.offsetHeight;
1442
- }
1443
-
1444
- function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
1445
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
1446
- const documentElement = getDocumentElement(offsetParent);
1447
- const rect = getBoundingClientRect(element, isOffsetParentAnElement && isScaled(offsetParent));
1448
- let scroll = {
1449
- scrollLeft: 0,
1450
- scrollTop: 0
1451
- };
1452
- const offsets = {
1453
- x: 0,
1454
- y: 0
1455
- };
1456
-
1457
- if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
1458
- if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
1459
- scroll = getNodeScroll(offsetParent);
1460
- }
1461
-
1462
- if (isHTMLElement(offsetParent)) {
1463
- const offsetRect = getBoundingClientRect(offsetParent, true);
1464
- offsets.x = offsetRect.x + offsetParent.clientLeft;
1465
- offsets.y = offsetRect.y + offsetParent.clientTop;
1466
- } else if (documentElement) {
1467
- offsets.x = getWindowScrollBarX(documentElement);
1468
- }
1469
- }
1470
-
1471
- return {
1472
- x: rect.left + scroll.scrollLeft - offsets.x,
1473
- y: rect.top + scroll.scrollTop - offsets.y,
1474
- width: rect.width,
1475
- height: rect.height
1476
- };
1477
- }
1478
-
1479
- function getParentNode(node) {
1480
- if (getNodeName(node) === 'html') {
1481
- return node;
1482
- }
1483
-
1484
- return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
1485
- // @ts-ignore
1486
- node.assignedSlot || // step into the shadow DOM of the parent of a slotted node
1487
- node.parentNode || ( // DOM Element detected
1488
- isShadowRoot(node) ? node.host : null) || // ShadowRoot detected
1489
- getDocumentElement(node) // fallback
1490
-
1491
- );
1492
- }
1493
-
1494
- function getTrueOffsetParent(element) {
1495
- if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
1496
- return null;
1497
- }
1498
-
1499
- return element.offsetParent;
1500
- }
1501
-
1502
- function getContainingBlock(element) {
1503
- let currentNode = getParentNode(element);
1504
-
1505
- if (isShadowRoot(currentNode)) {
1506
- currentNode = currentNode.host;
1507
- }
1508
-
1509
- while (isHTMLElement(currentNode) && !['html', 'body'].includes(getNodeName(currentNode))) {
1510
- if (isContainingBlock(currentNode)) {
1511
- return currentNode;
1512
- } else {
1513
- currentNode = currentNode.parentNode;
1514
- }
1515
- }
1516
-
1517
- return null;
1518
- } // Gets the closest ancestor positioned element. Handles some edge cases,
1519
- // such as table ancestors and cross browser bugs.
1520
-
1521
-
1522
- function getOffsetParent(element) {
1523
- const window = getWindow(element);
1524
- let offsetParent = getTrueOffsetParent(element);
1525
-
1526
- while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
1527
- offsetParent = getTrueOffsetParent(offsetParent);
1528
- }
1529
-
1530
- if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
1531
- return window;
1532
- }
1533
-
1534
- return offsetParent || getContainingBlock(element) || window;
1535
- }
1536
-
1537
- function getDimensions(element) {
1538
- if (isHTMLElement(element)) {
1539
- return {
1540
- width: element.offsetWidth,
1541
- height: element.offsetHeight
1542
- };
1543
- }
1544
-
1545
- const rect = getBoundingClientRect(element);
1546
- return {
1547
- width: rect.width,
1548
- height: rect.height
1549
- };
1550
- }
1551
-
1552
- function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
1553
- let {
1554
- rect,
1555
- offsetParent,
1556
- strategy
1557
- } = _ref;
1558
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
1559
- const documentElement = getDocumentElement(offsetParent);
1560
-
1561
- if (offsetParent === documentElement) {
1562
- return rect;
1563
- }
1564
-
1565
- let scroll = {
1566
- scrollLeft: 0,
1567
- scrollTop: 0
1568
- };
1569
- const offsets = {
1570
- x: 0,
1571
- y: 0
1572
- };
1573
-
1574
- if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
1575
- if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
1576
- scroll = getNodeScroll(offsetParent);
1577
- }
1578
-
1579
- if (isHTMLElement(offsetParent)) {
1580
- const offsetRect = getBoundingClientRect(offsetParent, true);
1581
- offsets.x = offsetRect.x + offsetParent.clientLeft;
1582
- offsets.y = offsetRect.y + offsetParent.clientTop;
1583
- } // This doesn't appear to be need to be negated.
1584
- // else if (documentElement) {
1585
- // offsets.x = getWindowScrollBarX(documentElement);
1586
- // }
1587
-
1588
- }
1589
-
1590
- return { ...rect,
1591
- x: rect.x - scroll.scrollLeft + offsets.x,
1592
- y: rect.y - scroll.scrollTop + offsets.y
1593
- };
1594
- }
1595
-
1596
- function getViewportRect(element) {
1597
- const win = getWindow(element);
1598
- const html = getDocumentElement(element);
1599
- const visualViewport = win.visualViewport;
1600
- let width = html.clientWidth;
1601
- let height = html.clientHeight;
1602
- let x = 0;
1603
- let y = 0;
1604
-
1605
- if (visualViewport) {
1606
- width = visualViewport.width;
1607
- height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)
1608
- // In Chrome, it returns a value very close to 0 (+/-) but contains rounding
1609
- // errors due to floating point numbers, so we need to check precision.
1610
- // Safari returns a number <= 0, usually < -1 when pinch-zoomed
1611
-
1612
- if (Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) < 0.01) {
1613
- x = visualViewport.offsetLeft;
1614
- y = visualViewport.offsetTop;
1615
- }
1616
- }
1617
-
1618
- return {
1619
- width,
1620
- height,
1621
- x,
1622
- y
1623
- };
1624
- }
1625
-
1626
- // of the `<html>` and `<body>` rect bounds if horizontally scrollable
1627
-
1628
- function getDocumentRect(element) {
1629
- var _element$ownerDocumen;
1630
-
1631
- const html = getDocumentElement(element);
1632
- const scroll = getNodeScroll(element);
1633
- const body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
1634
- const width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
1635
- const height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
1636
- let x = -scroll.scrollLeft + getWindowScrollBarX(element);
1637
- const y = -scroll.scrollTop;
1638
-
1639
- if (getComputedStyle$1(body || html).direction === 'rtl') {
1640
- x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
1641
- }
1642
-
1643
- return {
1644
- width,
1645
- height,
1646
- x,
1647
- y
1648
- };
1649
- }
1650
-
1651
- function getNearestOverflowAncestor(node) {
1652
- const parentNode = getParentNode(node);
1653
-
1654
- if (['html', 'body', '#document'].includes(getNodeName(parentNode))) {
1655
- // @ts-ignore assume body is always available
1656
- return node.ownerDocument.body;
1657
- }
1658
-
1659
- if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
1660
- return parentNode;
1661
- }
1662
-
1663
- return getNearestOverflowAncestor(parentNode);
1664
- }
1665
-
1666
- function getOverflowAncestors(node, list) {
1667
- var _node$ownerDocument;
1668
-
1669
- if (list === void 0) {
1670
- list = [];
1671
- }
1672
-
1673
- const scrollableAncestor = getNearestOverflowAncestor(node);
1674
- const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
1675
- const win = getWindow(scrollableAncestor);
1676
- const target = isBody ? [win].concat(win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []) : scrollableAncestor;
1677
- const updatedList = list.concat(target);
1678
- return isBody ? updatedList : // @ts-ignore: isBody tells us target will be an HTMLElement here
1679
- updatedList.concat(getOverflowAncestors(getParentNode(target)));
1680
- }
1681
-
1682
- function contains(parent, child) {
1683
- const rootNode = child.getRootNode == null ? void 0 : child.getRootNode(); // First, attempt with faster native method
1684
-
1685
- if (parent.contains(child)) {
1686
- return true;
1687
- } // then fallback to custom implementation with Shadow DOM support
1688
- else if (rootNode && isShadowRoot(rootNode)) {
1689
- let next = child;
1690
-
1691
- do {
1692
- // use `===` replace node.isSameNode()
1693
- if (next && parent === next) {
1694
- return true;
1695
- } // @ts-ignore: need a better way to handle this...
1696
-
1697
-
1698
- next = next.parentNode || next.host;
1699
- } while (next);
1700
- }
1701
-
1702
- return false;
1703
- }
1704
-
1705
- function getInnerBoundingClientRect(element) {
1706
- const clientRect = getBoundingClientRect(element);
1707
- const top = clientRect.top + element.clientTop;
1708
- const left = clientRect.left + element.clientLeft;
1709
- return {
1710
- top,
1711
- left,
1712
- x: left,
1713
- y: top,
1714
- right: left + element.clientWidth,
1715
- bottom: top + element.clientHeight,
1716
- width: element.clientWidth,
1717
- height: element.clientHeight
1718
- };
1719
- }
1720
-
1721
- function getClientRectFromClippingAncestor(element, clippingParent) {
1722
- if (clippingParent === 'viewport') {
1723
- return rectToClientRect(getViewportRect(element));
1724
- }
1725
-
1726
- if (isElement(clippingParent)) {
1727
- return getInnerBoundingClientRect(clippingParent);
1728
- }
1729
-
1730
- return rectToClientRect(getDocumentRect(getDocumentElement(element)));
1731
- } // A "clipping ancestor" is an overflowable container with the characteristic of
1732
- // clipping (or hiding) overflowing elements with a position different from
1733
- // `initial`
1734
-
1735
-
1736
- function getClippingAncestors(element) {
1737
- const clippingAncestors = getOverflowAncestors(element);
1738
- const canEscapeClipping = ['absolute', 'fixed'].includes(getComputedStyle$1(element).position);
1739
- const clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
1740
-
1741
- if (!isElement(clipperElement)) {
1742
- return [];
1743
- } // @ts-ignore isElement check ensures we return Array<Element>
1744
-
1745
-
1746
- return clippingAncestors.filter(clippingAncestors => isElement(clippingAncestors) && contains(clippingAncestors, clipperElement) && getNodeName(clippingAncestors) !== 'body');
1747
- } // Gets the maximum area that the element is visible in due to any number of
1748
- // clipping ancestors
1749
-
1750
-
1751
- function getClippingRect(_ref) {
1752
- let {
1753
- element,
1754
- boundary,
1755
- rootBoundary
1756
- } = _ref;
1757
- const mainClippingAncestors = boundary === 'clippingAncestors' ? getClippingAncestors(element) : [].concat(boundary);
1758
- const clippingAncestors = [...mainClippingAncestors, rootBoundary];
1759
- const firstClippingAncestor = clippingAncestors[0];
1760
- const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
1761
- const rect = getClientRectFromClippingAncestor(element, clippingAncestor);
1762
- accRect.top = max(rect.top, accRect.top);
1763
- accRect.right = min(rect.right, accRect.right);
1764
- accRect.bottom = min(rect.bottom, accRect.bottom);
1765
- accRect.left = max(rect.left, accRect.left);
1766
- return accRect;
1767
- }, getClientRectFromClippingAncestor(element, firstClippingAncestor));
1768
- return {
1769
- width: clippingRect.right - clippingRect.left,
1770
- height: clippingRect.bottom - clippingRect.top,
1771
- x: clippingRect.left,
1772
- y: clippingRect.top
1773
- };
1774
- }
1775
-
1776
- const platform = {
1777
- getClippingRect,
1778
- convertOffsetParentRelativeRectToViewportRelativeRect,
1779
- isElement,
1780
- getDimensions,
1781
- getOffsetParent,
1782
- getDocumentElement,
1783
- getElementRects: _ref => {
1784
- let {
1785
- reference,
1786
- floating,
1787
- strategy
1788
- } = _ref;
1789
- return {
1790
- reference: getRectRelativeToOffsetParent(reference, getOffsetParent(floating), strategy),
1791
- floating: { ...getDimensions(floating),
1792
- x: 0,
1793
- y: 0
1794
- }
1795
- };
1796
- },
1797
- getClientRects: element => Array.from(element.getClientRects()),
1798
- isRTL: element => getComputedStyle$1(element).direction === 'rtl'
1799
- };
1800
-
1801
- /**
1802
- * Automatically updates the position of the floating element when necessary.
1803
- * @see https://floating-ui.com/docs/autoUpdate
1804
- */
1805
- function autoUpdate(reference, floating, update, options) {
1806
- if (options === void 0) {
1807
- options = {};
1808
- }
1809
-
1810
- const {
1811
- ancestorScroll: _ancestorScroll = true,
1812
- ancestorResize: _ancestorResize = true,
1813
- elementResize: _elementResize = true,
1814
- animationFrame = false
1815
- } = options;
1816
- let cleanedUp = false;
1817
- const ancestorScroll = _ancestorScroll && !animationFrame;
1818
- const ancestorResize = _ancestorResize && !animationFrame;
1819
- const elementResize = _elementResize && !animationFrame;
1820
- const ancestors = ancestorScroll || ancestorResize ? [...(isElement(reference) ? getOverflowAncestors(reference) : []), ...getOverflowAncestors(floating)] : [];
1821
- ancestors.forEach(ancestor => {
1822
- ancestorScroll && ancestor.addEventListener('scroll', update, {
1823
- passive: true
1824
- });
1825
- ancestorResize && ancestor.addEventListener('resize', update);
1826
- });
1827
- let observer = null;
1828
-
1829
- if (elementResize) {
1830
- observer = new ResizeObserver(update);
1831
- isElement(reference) && observer.observe(reference);
1832
- observer.observe(floating);
1833
- }
1834
-
1835
- let frameId;
1836
- let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
1837
-
1838
- if (animationFrame) {
1839
- frameLoop();
1840
- }
1841
-
1842
- function frameLoop() {
1843
- if (cleanedUp) {
1844
- return;
1845
- }
1846
-
1847
- const nextRefRect = getBoundingClientRect(reference);
1848
-
1849
- if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
1850
- update();
1851
- }
1852
-
1853
- prevRefRect = nextRefRect;
1854
- frameId = requestAnimationFrame(frameLoop);
1855
- }
1856
-
1857
- return () => {
1858
- var _observer;
1859
-
1860
- cleanedUp = true;
1861
- ancestors.forEach(ancestor => {
1862
- ancestorScroll && ancestor.removeEventListener('scroll', update);
1863
- ancestorResize && ancestor.removeEventListener('resize', update);
1864
- });
1865
- (_observer = observer) == null ? void 0 : _observer.disconnect();
1866
- observer = null;
1867
-
1868
- if (animationFrame) {
1869
- cancelAnimationFrame(frameId);
1870
- }
1871
- };
1872
- }
1873
-
1874
- /**
1875
- * Computes the `x` and `y` coordinates that will place the floating element
1876
- * next to a reference element when it is given a certain CSS positioning
1877
- * strategy.
1878
- */
1879
-
1880
- const computePosition = (reference, floating, options) => computePosition$1(reference, floating, {
1881
- platform,
1882
- ...options
1883
- });
1884
-
1885
- var _Popup_instances, _Popup_arrowPosition_get, _Popup_padding_get, _Popup_distance_get, _Popup_strategy_get, _Popup_middleware_get, _Popup_cleanup, _Popup_anchorEl, _Popup_assignPopupPosition, _Popup_assignArrowPosition, _Popup_getAnchorById;
1886
- class Popup extends FoundationElement {
1887
- constructor() {
1888
- super();
1889
-
1890
- _Popup_instances.add(this);
1891
-
1892
- _Popup_cleanup.set(this, void 0);
1893
-
1894
- _Popup_anchorEl.set(this, void 0);
1895
-
1896
- this.open = false;
1897
- this.dismissible = false;
1898
- this.arrow = false;
1899
- this.alternate = false;
1900
- this.corner = 'left';
1901
- }
1902
-
1903
- disconnectedCallback() {
1904
- var _a;
1905
-
1906
- super.disconnectedCallback();
1907
- (_a = __classPrivateFieldGet(this, _Popup_cleanup, "f")) === null || _a === void 0 ? void 0 : _a.call(this);
1908
- }
1909
-
1910
- attributeChangedCallback(name, oldValue, newValue) {
1911
- var _a;
1912
-
1913
- super.attributeChangedCallback(name, oldValue, newValue);
1914
-
1915
- switch (name) {
1916
- case 'anchor':
1917
- {
1918
- __classPrivateFieldSet(this, _Popup_anchorEl, __classPrivateFieldGet(this, _Popup_instances, "m", _Popup_getAnchorById).call(this), "f");
1919
-
1920
- break;
1921
- }
1922
- }
1923
-
1924
- if (__classPrivateFieldGet(this, _Popup_anchorEl, "f") && this.popupEl) {
1925
- __classPrivateFieldSet(this, _Popup_cleanup, autoUpdate(__classPrivateFieldGet(this, _Popup_anchorEl, "f"), this.popupEl, () => this.updatePosition()), "f");
1926
- } else {
1927
- (_a = __classPrivateFieldGet(this, _Popup_cleanup, "f")) === null || _a === void 0 ? void 0 : _a.call(this);
1928
- }
1929
- }
1930
-
1931
- async updatePosition() {
1932
- if (!this.open || !__classPrivateFieldGet(this, _Popup_anchorEl, "f")) {
1933
- return;
1934
- }
1935
-
1936
- const positionData = await computePosition(__classPrivateFieldGet(this, _Popup_anchorEl, "f"), this.popupEl, {
1937
- placement: this.corner,
1938
- strategy: __classPrivateFieldGet(this, _Popup_instances, "a", _Popup_strategy_get),
1939
- middleware: __classPrivateFieldGet(this, _Popup_instances, "a", _Popup_middleware_get)
1940
- });
1941
-
1942
- __classPrivateFieldGet(this, _Popup_instances, "m", _Popup_assignPopupPosition).call(this, positionData);
1943
-
1944
- if (this.arrow) {
1945
- __classPrivateFieldGet(this, _Popup_instances, "m", _Popup_assignArrowPosition).call(this, positionData);
1946
- }
1947
- }
1948
-
1949
- }
1950
- _Popup_cleanup = new WeakMap(), _Popup_anchorEl = new WeakMap(), _Popup_instances = new WeakSet(), _Popup_arrowPosition_get = function _Popup_arrowPosition_get() {
1951
- return {
1952
- top: 'bottom',
1953
- right: 'left',
1954
- bottom: 'top',
1955
- left: 'right'
1956
- };
1957
- }, _Popup_padding_get = function _Popup_padding_get() {
1958
- return 0;
1959
- }, _Popup_distance_get = function _Popup_distance_get() {
1960
- return 12;
1961
- }, _Popup_strategy_get = function _Popup_strategy_get() {
1962
- return 'fixed';
1963
- }, _Popup_middleware_get = function _Popup_middleware_get() {
1964
- const middleware = [flip(), hide(), inline()];
1965
-
1966
- if (this.arrow) {
1967
- middleware.push(arrow({
1968
- element: this.arrowEl,
1969
- padding: __classPrivateFieldGet(this, _Popup_instances, "a", _Popup_padding_get)
1970
- }), offset(__classPrivateFieldGet(this, _Popup_instances, "a", _Popup_distance_get)));
1971
- }
1972
-
1973
- return middleware;
1974
- }, _Popup_assignPopupPosition = function _Popup_assignPopupPosition(data) {
1975
- const {
1976
- x: popupX,
1977
- y: popupY
1978
- } = data;
1979
- const {
1980
- referenceHidden
1981
- } = data.middlewareData.hide;
1982
- Object.assign(this.popupEl.style, {
1983
- left: `${popupX}px`,
1984
- top: `${popupY}px`,
1985
- visibility: referenceHidden ? 'hidden' : 'visible'
1986
- });
1987
- }, _Popup_assignArrowPosition = function _Popup_assignArrowPosition(data) {
1988
- const {
1989
- x: arrowX,
1990
- y: arrowY
1991
- } = data.middlewareData.arrow;
1992
-
1993
- const side = __classPrivateFieldGet(this, _Popup_instances, "a", _Popup_arrowPosition_get)[data.placement.split('-')[0]];
1994
-
1995
- Object.assign(this.arrowEl.style, {
1996
- left: `${arrowX}px`,
1997
- top: `${arrowY}px`,
1998
- right: '',
1999
- bottom: '',
2000
- [side]: '-4px'
2001
- });
2002
- }, _Popup_getAnchorById = function _Popup_getAnchorById() {
2003
- return document.getElementById(this.anchor);
2004
- };
2005
-
2006
- __decorate([attr({
2007
- mode: 'boolean'
2008
- }), __metadata("design:type", Object)], Popup.prototype, "open", void 0);
2009
-
2010
- __decorate([attr({
2011
- mode: 'boolean'
2012
- }), __metadata("design:type", Object)], Popup.prototype, "dismissible", void 0);
2013
-
2014
- __decorate([attr({
2015
- mode: 'boolean'
2016
- }), __metadata("design:type", Object)], Popup.prototype, "arrow", void 0);
2017
-
2018
- __decorate([attr({
2019
- mode: 'boolean'
2020
- }), __metadata("design:type", Object)], Popup.prototype, "alternate", void 0);
2021
-
2022
- __decorate([attr({
2023
- mode: 'fromView'
2024
- }), __metadata("design:type", String)], Popup.prototype, "corner", void 0);
2025
-
2026
- __decorate([attr, __metadata("design:type", String)], Popup.prototype, "anchor", void 0);
2027
-
2028
- var css_248z = ".control {\n width: min-content;\n background-color: var(--vvd-color-surface-4dp);\n border-radius: inherit;\n contain: layout;\n}\n.control:not(.open) {\n display: none;\n}\n\n.popup-wrapper {\n position: fixed;\n border-radius: 6px;\n}\n\n.popup-content {\n display: grid;\n color: var(--vvd-color-on-canvas);\n}\n.dismissible .popup-content {\n align-content: start;\n grid-template-columns: 1fr auto;\n}\n\n.arrow {\n position: absolute;\n z-index: -1;\n width: 8px;\n height: 8px;\n background-color: var(--vvd-color-surface-4dp);\n transform: rotate(45deg);\n}\n\n.dismissible {\n align-self: flex-start;\n margin-block-start: 0.25rem;\n margin-inline-end: 0.25rem;\n}";
2029
- styleInject(css_248z);
2030
-
2031
- let _ = t => t,
2032
- _t,
2033
- _t2,
2034
- _t3;
2035
-
2036
- const getClasses = ({
2037
- open,
2038
- dismissible,
2039
- alternate
2040
- }) => classNames('control', ['open', Boolean(open)], ['dismissible', Boolean(dismissible)], ['alternate', Boolean(alternate)]);
2041
-
2042
- const popupTemplate = () => html(_t || (_t = _`
2043
- <vwc-elevation>
2044
- <!--the popup-wrapper is needed for alternating the inside of the popup nd not its shadow-->
2045
- <div class="popup-wrapper" ${0}>
2046
- <div class="${0}" aria-hidden="${0}"
2047
- part="${0}">
2048
- <div class="popup-content">
2049
- <slot></slot>
2050
- ${0}
2051
- </div>
2052
- ${0}
2053
- </div>
2054
- </div>
2055
- </vwc-elevation>`), ref('popupEl'), getClasses, x => x.open ? 'false' : 'true', x => x.alternate ? 'vvd-theme-alternate' : '', when(x => x.dismissible, html(_t2 || (_t2 = _`<vwc-button size="base-small" @click="${0}"
2056
- class="dismissible" icon="close-small-solid" shape="pill"></vwc-button>`), x => x.open = false)), when(x => x.arrow, html(_t3 || (_t3 = _`<div class="arrow" ${0}></div>`), ref('arrowEl'))));
2057
-
2058
- const VIVIDPopup = Popup.compose({
2059
- baseName: 'popup',
2060
- template: popupTemplate,
2061
- styles: css_248z
2062
- });
2063
- designSystem.register(VIVIDPopup());
2064
-
2065
- export { VIVIDPopup };
25
+ registerPopup();