@siemens/ix 1.3.0 → 1.4.0-beta.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 (536) hide show
  1. package/dist/cjs/alignment-51e20690.js +13 -0
  2. package/dist/cjs/{animation-dfe01edc.js → animation-d5cc0bec.js} +1 -1
  3. package/dist/cjs/{base-button-6ef79cb6.js → base-button-497db257.js} +1 -1
  4. package/dist/cjs/context-a0900b95.js +75 -0
  5. package/dist/cjs/{default-tree-item-4597cd84.js → default-tree-item-89cd1f3f.js} +1 -1
  6. package/dist/cjs/{flip-tile-state-c95639e5.js → flip-tile-state-b5ff5ea0.js} +1 -1
  7. package/dist/cjs/{alignment-24ae2e63.js → floating-ui.dom.esm-9a5d67b2.js} +393 -402
  8. package/dist/cjs/{index-17eb8998.js → index-f4b8e6ee.js} +74 -1
  9. package/dist/cjs/index.cjs.js +13 -13
  10. package/dist/cjs/ix-animated-tab_2.cjs.entry.js +3 -3
  11. package/dist/cjs/ix-application-header.cjs.entry.js +26 -3
  12. package/dist/cjs/ix-basic-navigation.cjs.entry.js +17 -3
  13. package/dist/cjs/ix-blind.cjs.entry.js +2 -2
  14. package/dist/cjs/ix-breadcrumb_2.cjs.entry.js +2 -2
  15. package/dist/cjs/ix-burger-menu.cjs.entry.js +22 -0
  16. package/dist/cjs/ix-button.cjs.entry.js +4 -4
  17. package/dist/cjs/ix-category-filter.cjs.entry.js +86 -117
  18. package/dist/cjs/ix-chip.cjs.entry.js +1 -1
  19. package/dist/cjs/ix-counter-pill.cjs.entry.js +1 -1
  20. package/dist/cjs/ix-date-picker_2.cjs.entry.js +4 -4
  21. package/dist/cjs/ix-date-time-card.cjs.entry.js +1 -1
  22. package/dist/cjs/ix-datetime-picker.cjs.entry.js +1 -1
  23. package/dist/cjs/ix-divider.cjs.entry.js +19 -0
  24. package/dist/cjs/ix-drawer.cjs.entry.js +1 -1
  25. package/dist/cjs/ix-dropdown-button.cjs.entry.js +6 -4
  26. package/dist/cjs/ix-dropdown-quick-actions.cjs.entry.js +19 -0
  27. package/dist/cjs/ix-dropdown_2.cjs.entry.js +78 -17
  28. package/dist/cjs/ix-event-list_2.cjs.entry.js +4 -4
  29. package/dist/cjs/ix-expanding-search.cjs.entry.js +1 -1
  30. package/dist/cjs/ix-filter-chip.cjs.entry.js +1 -1
  31. package/dist/cjs/ix-flip-tile_2.cjs.entry.js +2 -2
  32. package/dist/cjs/ix-group-context-menu.cjs.entry.js +1 -4
  33. package/dist/cjs/ix-group_3.cjs.entry.js +1 -1
  34. package/dist/cjs/ix-icon-button.cjs.entry.js +2 -2
  35. package/dist/cjs/ix-icon.cjs.entry.js +1 -1
  36. package/dist/cjs/ix-input-group.cjs.entry.js +1 -1
  37. package/dist/cjs/ix-kpi.cjs.entry.js +1 -1
  38. package/dist/cjs/ix-map-navigation_2.cjs.entry.js +2 -2
  39. package/dist/cjs/ix-menu_9.cjs.entry.js +50 -19
  40. package/dist/cjs/ix-message-bar.cjs.entry.js +1 -1
  41. package/dist/cjs/ix-modal-example.cjs.entry.js +2 -2
  42. package/dist/cjs/ix-modal_2.cjs.entry.js +4 -4
  43. package/dist/cjs/ix-pill.cjs.entry.js +1 -1
  44. package/dist/cjs/ix-select_2.cjs.entry.js +1 -1
  45. package/dist/cjs/ix-spinner.cjs.entry.js +1 -1
  46. package/dist/cjs/ix-split-button_2.cjs.entry.js +7 -5
  47. package/dist/cjs/ix-tab-item.cjs.entry.js +2 -2
  48. package/dist/cjs/ix-tabs.cjs.entry.js +12 -5
  49. package/dist/cjs/ix-tile.cjs.entry.js +1 -1
  50. package/dist/cjs/ix-toast_2.cjs.entry.js +10 -6
  51. package/dist/cjs/ix-toggle.cjs.entry.js +2 -2
  52. package/dist/cjs/ix-tooltip.cjs.entry.js +127 -0
  53. package/dist/cjs/ix-tree_2.cjs.entry.js +3 -4
  54. package/dist/cjs/ix-typography.cjs.entry.js +38 -0
  55. package/dist/cjs/ix-upload.cjs.entry.js +2 -2
  56. package/dist/cjs/ix-validation-tooltip.cjs.entry.js +10 -9
  57. package/dist/cjs/ix-workflow-step_2.cjs.entry.js +1 -1
  58. package/dist/cjs/loader.cjs.js +2 -2
  59. package/dist/cjs/{logical-filter-operator-467e2faf.js → logical-filter-operator-0faf70b8.js} +2 -2
  60. package/dist/cjs/{modal-dda2f6be.js → modal-a93045dd.js} +4 -4
  61. package/dist/cjs/{modal-utils-9ee0acda.js → modal-utils-b645989b.js} +1 -1
  62. package/dist/cjs/{mutation-observer-29bedada.js → mutation-observer-eaaa5399.js} +1 -1
  63. package/dist/cjs/my-component.cjs.entry.js +2 -2
  64. package/dist/cjs/{rwd.util-2326824e.js → rwd.util-9480f0b5.js} +1 -1
  65. package/dist/cjs/service-18dc5907.js +73 -0
  66. package/dist/cjs/siemens-ix.cjs.js +2 -2
  67. package/dist/cjs/{theme-switcher-f91c8d8d.js → theme-switcher-67669a35.js} +1 -1
  68. package/dist/cjs/{typed-event-5030cc6a.js → typed-event-f0f051da.js} +1 -1
  69. package/dist/cjs/{upload-file-state-923b2c65.js → upload-file-state-a79acf2b.js} +1 -1
  70. package/dist/collection/collection-manifest.json +5 -0
  71. package/dist/collection/components/animated-tab/animated-tab.css +1 -1
  72. package/dist/collection/components/animated-tab/animated-tab.js +1 -1
  73. package/dist/collection/components/animated-tabs/animated-tabs.css +4 -4
  74. package/dist/collection/components/animated-tabs/animated-tabs.js +1 -1
  75. package/dist/collection/components/application-header/application-header.css +11 -2
  76. package/dist/collection/components/application-header/application-header.js +31 -2
  77. package/dist/collection/components/basic-navigation/basic-navigation.css +6 -1
  78. package/dist/collection/components/basic-navigation/basic-navigation.js +21 -3
  79. package/dist/collection/components/blind/blind.css +5 -6
  80. package/dist/collection/components/blind/blind.js +1 -1
  81. package/dist/collection/components/breadcrumb/breadcrumb.css +4 -4
  82. package/dist/collection/components/breadcrumb/breadcrumb.js +1 -1
  83. package/dist/collection/components/breadcrumb-item/breadcrumb-item.css +1 -1
  84. package/dist/collection/components/breadcrumb-item/breadcrumb-item.js +1 -1
  85. package/dist/collection/components/button/base-button.js +1 -1
  86. package/dist/collection/components/{utils → button}/button-variants.js +0 -0
  87. package/dist/collection/components/button/button.css +7 -2
  88. package/dist/collection/components/button/button.js +3 -3
  89. package/dist/collection/components/category-filter/category-filter.css +37 -50
  90. package/dist/collection/components/category-filter/category-filter.js +86 -132
  91. package/dist/collection/components/category-filter/filter-state.js +1 -1
  92. package/dist/collection/components/category-filter/input-state.js +1 -1
  93. package/dist/collection/components/category-filter/logical-filter-operator.js +1 -1
  94. package/dist/collection/components/chip/chip.css +4 -4
  95. package/dist/collection/components/chip/chip.js +1 -1
  96. package/dist/collection/components/counter-pill/counter-pill.css +7 -7
  97. package/dist/collection/components/counter-pill/counter-pill.js +1 -1
  98. package/dist/collection/components/date-picker/date-picker.css +2 -2
  99. package/dist/collection/components/date-picker/date-picker.js +4 -4
  100. package/dist/collection/components/date-time-card/date-time-card.css +2 -2
  101. package/dist/collection/components/date-time-card/date-time-card.js +1 -1
  102. package/dist/collection/components/datetime-picker/datetime-picker.css +2 -2
  103. package/dist/collection/components/datetime-picker/datetime-picker.js +1 -1
  104. package/dist/collection/components/divider/divider.css +16 -0
  105. package/dist/collection/components/divider/divider.js +29 -0
  106. package/dist/collection/components/drawer/drawer.css +3 -3
  107. package/dist/collection/components/drawer/drawer.js +1 -1
  108. package/dist/collection/components/dropdown/dropdown-trigger-event.js +1 -0
  109. package/dist/collection/components/dropdown/dropdown.css +6 -6
  110. package/dist/collection/components/dropdown/dropdown.js +96 -10
  111. package/dist/collection/components/dropdown-button/dropdown-button.css +15 -7
  112. package/dist/collection/components/dropdown-button/dropdown-button.js +6 -4
  113. package/dist/collection/components/dropdown-item/dropdown-item.css +13 -4
  114. package/dist/collection/components/dropdown-item/dropdown-item.js +1 -1
  115. package/dist/collection/components/dropdown-quick-actions/dropdown-quick-actions.css +36 -0
  116. package/dist/collection/components/dropdown-quick-actions/dropdown-quick-actions.js +29 -0
  117. package/dist/collection/components/event-list/event-list.css +1 -1
  118. package/dist/collection/components/event-list/event-list.js +1 -1
  119. package/dist/collection/components/event-list-item/event-list-item.css +8 -4
  120. package/dist/collection/components/event-list-item/event-list-item.js +1 -1
  121. package/dist/collection/components/expanding-search/expanding-search.css +4 -4
  122. package/dist/collection/components/expanding-search/expanding-search.js +1 -1
  123. package/dist/collection/components/filter-chip/filter-chip.css +4 -4
  124. package/dist/collection/components/filter-chip/filter-chip.js +1 -1
  125. package/dist/collection/components/flip-tile/flip-tile-state.js +1 -1
  126. package/dist/collection/components/flip-tile/flip-tile.css +4 -4
  127. package/dist/collection/components/flip-tile/flip-tile.js +1 -1
  128. package/dist/collection/components/flip-tile-content/flip-tile-content.css +1 -1
  129. package/dist/collection/components/flip-tile-content/flip-tile-content.js +1 -1
  130. package/dist/collection/components/group/group-context-menu.css +1 -1
  131. package/dist/collection/components/group/group-context-menu.js +1 -4
  132. package/dist/collection/components/group/group.css +5 -5
  133. package/dist/collection/components/group/group.js +1 -1
  134. package/dist/collection/components/group-dropdown-item/group-dropdown-item.css +1 -1
  135. package/dist/collection/components/group-dropdown-item/group-dropdown-item.js +1 -1
  136. package/dist/collection/components/group-item/group-item.css +5 -5
  137. package/dist/collection/components/group-item/group-item.js +1 -1
  138. package/dist/collection/components/icon/icon.css +2 -2
  139. package/dist/collection/components/icon/icon.js +1 -1
  140. package/dist/collection/components/icon-button/icon-button.css +1 -1
  141. package/dist/collection/components/icon-button/icon-button.js +1 -1
  142. package/dist/collection/components/input-group/input-group.css +1 -1
  143. package/dist/collection/components/input-group/input-group.js +1 -1
  144. package/dist/collection/components/kpi/kpi.css +5 -5
  145. package/dist/collection/components/kpi/kpi.js +1 -1
  146. package/dist/collection/components/map-navigation/map-navigation.css +6 -5
  147. package/dist/collection/components/map-navigation/map-navigation.js +1 -1
  148. package/dist/collection/components/map-navigation-overlay/map-navigation-overlay.css +5 -5
  149. package/dist/collection/components/map-navigation-overlay/map-navigation-overlay.js +1 -1
  150. package/dist/collection/components/menu/burger-menu.css +85 -0
  151. package/dist/collection/components/menu/burger-menu.js +64 -0
  152. package/dist/collection/components/menu/menu.css +20 -37
  153. package/dist/collection/components/menu/menu.js +27 -11
  154. package/dist/collection/components/menu-about/menu-about.css +4 -4
  155. package/dist/collection/components/menu-about/menu-about.js +1 -1
  156. package/dist/collection/components/menu-about-item/menu-about-item.css +1 -1
  157. package/dist/collection/components/menu-about-item/menu-about-item.js +1 -1
  158. package/dist/collection/components/menu-about-news/menu-about-news.css +13 -17
  159. package/dist/collection/components/menu-about-news/menu-about-news.js +2 -2
  160. package/dist/collection/components/menu-avatar/menu-avatar.css +17 -5
  161. package/dist/collection/components/menu-avatar/menu-avatar.js +52 -3
  162. package/dist/collection/components/menu-avatar-item/menu-avatar-item.css +1 -1
  163. package/dist/collection/components/menu-avatar-item/menu-avatar-item.js +1 -1
  164. package/dist/collection/components/menu-item/menu-item.css +27 -27
  165. package/dist/collection/components/menu-item/menu-item.js +2 -1
  166. package/dist/collection/components/menu-settings/menu-settings.css +4 -4
  167. package/dist/collection/components/menu-settings/menu-settings.js +1 -1
  168. package/dist/collection/components/menu-settings-item/menu-settings-item.css +1 -1
  169. package/dist/collection/components/menu-settings-item/menu-settings-item.js +1 -1
  170. package/dist/collection/components/message-bar/message-bar.css +3 -3
  171. package/dist/collection/components/message-bar/message-bar.js +1 -1
  172. package/dist/collection/components/modal/modal-utils.js +1 -1
  173. package/dist/collection/components/modal/modal.css +2 -2
  174. package/dist/collection/components/modal/modal.js +1 -1
  175. package/dist/collection/components/modal-container/modal-container.css +1 -1
  176. package/dist/collection/components/modal-container/modal-container.js +1 -1
  177. package/dist/collection/components/my-component/example-modal.js +1 -1
  178. package/dist/collection/components/my-component/my-component.css +3 -3
  179. package/dist/collection/components/my-component/my-component.js +1 -1
  180. package/dist/collection/components/pill/pill.css +4 -4
  181. package/dist/collection/components/pill/pill.js +1 -1
  182. package/dist/collection/components/select/select.css +5 -5
  183. package/dist/collection/components/select/select.js +1 -1
  184. package/dist/collection/components/select-item/select-item.css +1 -1
  185. package/dist/collection/components/select-item/select-item.js +1 -1
  186. package/dist/collection/components/spinner/spinner.css +1 -1
  187. package/dist/collection/components/spinner/spinner.js +1 -1
  188. package/dist/collection/components/split-button/split-button.css +20 -2
  189. package/dist/collection/components/split-button/split-button.js +6 -4
  190. package/dist/collection/components/split-button-item/split-button-item.css +1 -1
  191. package/dist/collection/components/split-button-item/split-button-item.js +1 -1
  192. package/dist/collection/components/tab-item/tab-item.css +5 -7
  193. package/dist/collection/components/tab-item/tab-item.js +1 -1
  194. package/dist/collection/components/tabs/tabs.css +4 -3
  195. package/dist/collection/components/tabs/tabs.js +13 -4
  196. package/dist/collection/components/tile/tile.css +3 -3
  197. package/dist/collection/components/tile/tile.js +1 -1
  198. package/dist/collection/components/time-picker/time-picker.css +2 -2
  199. package/dist/collection/components/time-picker/time-picker.js +1 -1
  200. package/dist/collection/components/toast/toast-container.js +1 -1
  201. package/dist/collection/components/toast/toast-utils.js +1 -1
  202. package/dist/collection/components/toast/toast.css +4 -4
  203. package/dist/collection/components/toast/toast.js +9 -5
  204. package/dist/collection/components/toggle/toggle.css +5 -4
  205. package/dist/collection/components/toggle/toggle.js +1 -1
  206. package/dist/collection/components/tooltip/tooltip.css +43 -0
  207. package/dist/collection/components/tooltip/tooltip.js +203 -0
  208. package/dist/collection/components/tree/tree.css +1 -1
  209. package/dist/collection/components/tree/tree.js +1 -1
  210. package/dist/collection/components/tree-item/default-tree-item.js +1 -1
  211. package/dist/collection/components/tree-item/tree-item.css +5 -5
  212. package/dist/collection/components/tree-item/tree-item.js +2 -3
  213. package/dist/collection/components/typography/types.js +14 -0
  214. package/dist/collection/components/typography/typography.css +146 -0
  215. package/dist/collection/components/typography/typography.js +63 -0
  216. package/dist/collection/components/upload/upload-file-state.js +1 -1
  217. package/dist/collection/components/upload/upload.css +3 -3
  218. package/dist/collection/components/upload/upload.js +1 -1
  219. package/dist/collection/components/utils/animation.js +1 -1
  220. package/dist/collection/components/utils/menu-service/menu-service.js +53 -0
  221. package/dist/collection/components/utils/mutation-observer.js +1 -1
  222. package/dist/collection/components/utils/rwd.util.js +1 -1
  223. package/dist/collection/components/utils/screen/context.js +29 -0
  224. package/{scss/theme/_define-theme-variable.scss → dist/collection/components/utils/screen/index.js} +2 -5
  225. package/dist/collection/components/utils/screen/mode.js +36 -0
  226. package/dist/collection/components/utils/screen/service.js +45 -0
  227. package/dist/collection/components/utils/typed-event.js +1 -1
  228. package/dist/collection/components/validation-tooltip/validation-tooltip.css +4 -4
  229. package/dist/collection/components/validation-tooltip/validation-tooltip.js +1 -1
  230. package/dist/collection/components/workflow-step/workflow-step.css +2 -2
  231. package/dist/collection/components/workflow-step/workflow-step.js +1 -1
  232. package/dist/collection/components/workflow-steps/workflow-steps.css +2 -2
  233. package/dist/collection/components/workflow-steps/workflow-steps.js +1 -1
  234. package/dist/collection/env.js +1 -1
  235. package/dist/collection/exports.js +2 -1
  236. package/dist/collection/index.js +1 -1
  237. package/dist/collection/tests/utils/test/index.js +9 -0
  238. package/dist/collection/tests/utils/test/matchMedia.mock.js +22 -0
  239. package/dist/collection/tests/utils/test/page.js +29 -0
  240. package/dist/collection/utils/test/index.js +1 -1
  241. package/dist/collection/utils/test/matchMedia.mock.js +22 -0
  242. package/dist/collection/utils/test/page.js +2 -2
  243. package/dist/components/alignment.js +1 -1353
  244. package/dist/components/animation.js +1 -1
  245. package/dist/components/application-header.js +33 -4
  246. package/dist/components/base-button.js +1 -1
  247. package/dist/components/burger-menu.js +35 -0
  248. package/dist/components/button.js +2 -2
  249. package/dist/components/date-picker.js +3 -3
  250. package/dist/components/dropdown-item.js +1 -1
  251. package/dist/components/dropdown.js +71 -9
  252. package/dist/components/floating-ui.dom.esm.js +1355 -0
  253. package/dist/components/group-context-menu.js +0 -3
  254. package/dist/components/index.d.ts +5 -0
  255. package/dist/components/index.js +7 -2
  256. package/dist/components/ix-basic-navigation.js +25 -5
  257. package/dist/components/ix-blind.js +1 -1
  258. package/dist/components/ix-burger-menu.d.ts +11 -0
  259. package/dist/components/ix-burger-menu.js +6 -0
  260. package/dist/components/ix-category-filter.js +96 -125
  261. package/dist/components/ix-divider.d.ts +11 -0
  262. package/dist/components/ix-divider.js +33 -0
  263. package/dist/components/ix-dropdown-button.js +5 -3
  264. package/dist/components/ix-dropdown-quick-actions.d.ts +11 -0
  265. package/dist/components/ix-dropdown-quick-actions.js +33 -0
  266. package/dist/components/ix-event-list-item.js +1 -1
  267. package/dist/components/ix-flip-tile.js +1 -1
  268. package/dist/components/ix-map-navigation.js +9 -3
  269. package/dist/components/ix-menu-about-news.js +2 -2
  270. package/dist/components/ix-menu-avatar.js +21 -2
  271. package/dist/components/ix-menu.js +31 -11
  272. package/dist/components/ix-modal-example.js +1 -1
  273. package/dist/components/ix-split-button.js +5 -3
  274. package/dist/components/ix-toggle.js +1 -1
  275. package/dist/components/ix-tooltip.d.ts +11 -0
  276. package/dist/components/ix-tooltip.js +152 -0
  277. package/dist/components/ix-tree.js +1 -1
  278. package/dist/components/ix-typography.d.ts +11 -0
  279. package/dist/components/ix-typography.js +6 -0
  280. package/dist/components/ix-upload.js +1 -1
  281. package/dist/components/ix-validation-tooltip.js +2 -1
  282. package/dist/components/menu-item.js +2 -2
  283. package/dist/components/modal-container.js +1 -1
  284. package/dist/components/mutation-observer.js +1 -1
  285. package/dist/components/my-component.js +1 -1
  286. package/dist/components/rwd.util.js +1 -1
  287. package/dist/components/service.js +139 -0
  288. package/dist/components/tab-item.js +1 -1
  289. package/dist/components/tabs.js +13 -4
  290. package/dist/components/toast.js +8 -4
  291. package/dist/components/tree-item.js +1 -2
  292. package/dist/components/typed-event.js +1 -1
  293. package/dist/components/typography.js +51 -0
  294. package/dist/esm/alignment-6490c552.js +11 -0
  295. package/dist/esm/{animation-b667a4c4.js → animation-268dce50.js} +1 -1
  296. package/dist/esm/{base-button-0b6635df.js → base-button-5bfeb71c.js} +1 -1
  297. package/dist/esm/context-f6a2b727.js +71 -0
  298. package/dist/esm/{default-tree-item-638c435a.js → default-tree-item-91ff2c08.js} +1 -1
  299. package/dist/esm/{flip-tile-state-28a1f8ce.js → flip-tile-state-051bb2fd.js} +1 -1
  300. package/dist/esm/{alignment-f63c1b89.js → floating-ui.dom.esm-e13c649f.js} +394 -402
  301. package/dist/esm/{index-6f4f3582.js → index-6b660a23.js} +74 -1
  302. package/dist/esm/index.js +13 -13
  303. package/dist/esm/ix-animated-tab_2.entry.js +3 -3
  304. package/dist/esm/ix-application-header.entry.js +26 -3
  305. package/dist/esm/ix-basic-navigation.entry.js +17 -3
  306. package/dist/esm/ix-blind.entry.js +2 -2
  307. package/dist/esm/ix-breadcrumb_2.entry.js +2 -2
  308. package/dist/esm/ix-burger-menu.entry.js +18 -0
  309. package/dist/esm/ix-button.entry.js +4 -4
  310. package/dist/esm/ix-category-filter.entry.js +86 -117
  311. package/dist/esm/ix-chip.entry.js +1 -1
  312. package/dist/esm/ix-counter-pill.entry.js +1 -1
  313. package/dist/esm/ix-date-picker_2.entry.js +4 -4
  314. package/dist/esm/ix-date-time-card.entry.js +1 -1
  315. package/dist/esm/ix-datetime-picker.entry.js +1 -1
  316. package/dist/esm/ix-divider.entry.js +15 -0
  317. package/dist/esm/ix-drawer.entry.js +1 -1
  318. package/dist/esm/ix-dropdown-button.entry.js +6 -4
  319. package/dist/esm/ix-dropdown-quick-actions.entry.js +15 -0
  320. package/dist/esm/ix-dropdown_2.entry.js +72 -11
  321. package/dist/esm/ix-event-list_2.entry.js +4 -4
  322. package/dist/esm/ix-expanding-search.entry.js +1 -1
  323. package/dist/esm/ix-filter-chip.entry.js +1 -1
  324. package/dist/esm/ix-flip-tile_2.entry.js +2 -2
  325. package/dist/esm/ix-group-context-menu.entry.js +1 -4
  326. package/dist/esm/ix-group_3.entry.js +1 -1
  327. package/dist/esm/ix-icon-button.entry.js +2 -2
  328. package/dist/esm/ix-icon.entry.js +1 -1
  329. package/dist/esm/ix-input-group.entry.js +1 -1
  330. package/dist/esm/ix-kpi.entry.js +1 -1
  331. package/dist/esm/ix-map-navigation_2.entry.js +2 -2
  332. package/dist/esm/ix-menu_9.entry.js +50 -19
  333. package/dist/esm/ix-message-bar.entry.js +1 -1
  334. package/dist/esm/ix-modal-example.entry.js +2 -2
  335. package/dist/esm/ix-modal_2.entry.js +4 -4
  336. package/dist/esm/ix-pill.entry.js +1 -1
  337. package/dist/esm/ix-select_2.entry.js +1 -1
  338. package/dist/esm/ix-spinner.entry.js +1 -1
  339. package/dist/esm/ix-split-button_2.entry.js +7 -5
  340. package/dist/esm/ix-tab-item.entry.js +2 -2
  341. package/dist/esm/ix-tabs.entry.js +12 -5
  342. package/dist/esm/ix-tile.entry.js +1 -1
  343. package/dist/esm/ix-toast_2.entry.js +10 -6
  344. package/dist/esm/ix-toggle.entry.js +2 -2
  345. package/dist/esm/ix-tooltip.entry.js +123 -0
  346. package/dist/esm/ix-tree_2.entry.js +3 -4
  347. package/dist/esm/ix-typography.entry.js +34 -0
  348. package/dist/esm/ix-upload.entry.js +2 -2
  349. package/dist/esm/ix-validation-tooltip.entry.js +3 -2
  350. package/dist/esm/ix-workflow-step_2.entry.js +1 -1
  351. package/dist/esm/loader.js +2 -2
  352. package/dist/esm/{logical-filter-operator-1bf83315.js → logical-filter-operator-15696001.js} +2 -2
  353. package/dist/esm/{modal-df0a62f2.js → modal-64e18970.js} +4 -4
  354. package/dist/esm/{modal-utils-df50b35a.js → modal-utils-aecbcba5.js} +1 -1
  355. package/dist/esm/{mutation-observer-379959bb.js → mutation-observer-7d01bbea.js} +1 -1
  356. package/dist/esm/my-component.entry.js +2 -2
  357. package/dist/esm/{rwd.util-4a61a4b8.js → rwd.util-cfc2ea72.js} +1 -1
  358. package/dist/esm/service-fc436c5b.js +71 -0
  359. package/dist/esm/siemens-ix.js +2 -2
  360. package/dist/esm/{theme-switcher-9ecc9b69.js → theme-switcher-4b9e5cc2.js} +1 -1
  361. package/dist/esm/{typed-event-ab58c27e.js → typed-event-a230184a.js} +1 -1
  362. package/dist/esm/{upload-file-state-631bb8a2.js → upload-file-state-532a36d3.js} +1 -1
  363. package/dist/siemens-ix/index.esm.js +1 -1
  364. package/dist/siemens-ix/p-06d5ab35.entry.js +1 -0
  365. package/dist/siemens-ix/{p-da2cae32.js → p-076c29d1.js} +0 -0
  366. package/dist/siemens-ix/{p-4b170382.entry.js → p-082bbe13.entry.js} +1 -1
  367. package/dist/siemens-ix/{p-418e2d14.entry.js → p-098e22c3.entry.js} +1 -1
  368. package/dist/siemens-ix/{p-43616759.entry.js → p-0bc4408b.entry.js} +1 -1
  369. package/dist/siemens-ix/p-0bd6554e.entry.js +1 -0
  370. package/dist/siemens-ix/{p-218de283.entry.js → p-0bf4a256.entry.js} +1 -1
  371. package/dist/siemens-ix/{p-7f842cdc.entry.js → p-0d619f3e.entry.js} +1 -1
  372. package/dist/siemens-ix/{p-3663f989.entry.js → p-122cf38d.entry.js} +1 -1
  373. package/dist/siemens-ix/p-1572aab3.js +1 -0
  374. package/dist/siemens-ix/{p-1d30454e.js → p-15bebd8a.js} +0 -0
  375. package/dist/siemens-ix/{p-8a7141a6.entry.js → p-165c6a82.entry.js} +1 -1
  376. package/dist/siemens-ix/{p-e7621b0a.entry.js → p-1d48ce36.entry.js} +1 -1
  377. package/dist/siemens-ix/{p-cc0f6f6b.entry.js → p-20c88582.entry.js} +1 -1
  378. package/dist/siemens-ix/{p-c8cc3bb3.js → p-21aa3602.js} +0 -0
  379. package/dist/siemens-ix/{p-0a12b3df.js → p-2b33ead4.js} +0 -0
  380. package/dist/siemens-ix/{p-d0bb8225.entry.js → p-2e55e255.entry.js} +1 -1
  381. package/dist/siemens-ix/{p-e2925222.entry.js → p-3624a41c.entry.js} +1 -1
  382. package/dist/siemens-ix/{p-bdd294d2.js → p-3b97bb69.js} +0 -0
  383. package/dist/siemens-ix/{p-ea333007.entry.js → p-3cc4df65.entry.js} +1 -1
  384. package/dist/siemens-ix/{p-4fcb5f2b.entry.js → p-404e81d2.entry.js} +1 -1
  385. package/dist/siemens-ix/p-4251a6dd.entry.js +1 -0
  386. package/dist/siemens-ix/p-4b2265fd.entry.js +1 -0
  387. package/dist/siemens-ix/p-529d7530.js +1 -0
  388. package/dist/siemens-ix/{p-eb150313.entry.js → p-560cfce8.entry.js} +1 -1
  389. package/dist/siemens-ix/{p-1c82637e.js → p-56ed024b.js} +0 -0
  390. package/dist/siemens-ix/{p-18d02e6f.entry.js → p-5890faf9.entry.js} +1 -1
  391. package/dist/siemens-ix/{p-b12006c6.js → p-5b39e04e.js} +0 -0
  392. package/dist/siemens-ix/p-5b47360e.entry.js +1 -0
  393. package/dist/siemens-ix/{p-a88618e3.entry.js → p-5ca7b937.entry.js} +1 -1
  394. package/dist/siemens-ix/p-5feec7a4.entry.js +1 -0
  395. package/dist/siemens-ix/p-63776469.entry.js +1 -0
  396. package/dist/siemens-ix/p-66074788.js +2 -0
  397. package/dist/siemens-ix/{p-a5fa7ae5.entry.js → p-6637ae65.entry.js} +1 -1
  398. package/dist/siemens-ix/{p-33283dbf.entry.js → p-67cf5cd4.entry.js} +1 -1
  399. package/dist/siemens-ix/{p-c3e90c06.entry.js → p-6be65050.entry.js} +1 -1
  400. package/dist/siemens-ix/p-6e5543fe.entry.js +1 -0
  401. package/dist/siemens-ix/p-70be8cb8.entry.js +1 -0
  402. package/dist/siemens-ix/p-71c91a11.entry.js +1 -0
  403. package/dist/siemens-ix/{p-b3d00feb.entry.js → p-72cc8632.entry.js} +1 -1
  404. package/dist/siemens-ix/{p-dec6114f.js → p-75abd144.js} +1 -1
  405. package/dist/siemens-ix/p-9269d0e8.entry.js +1 -0
  406. package/dist/siemens-ix/p-94b440bc.entry.js +1 -0
  407. package/dist/siemens-ix/{p-592f1ed3.entry.js → p-9c8c835c.entry.js} +1 -1
  408. package/dist/siemens-ix/{p-8b4e4718.entry.js → p-9eb8347c.entry.js} +1 -1
  409. package/dist/siemens-ix/{p-4944ad0b.js → p-9ee41861.js} +0 -0
  410. package/dist/siemens-ix/p-9fa6a59b.entry.js +1 -0
  411. package/dist/siemens-ix/p-ac1d6617.entry.js +1 -0
  412. package/dist/siemens-ix/{p-6fe3bb9c.entry.js → p-ae35c07f.entry.js} +1 -1
  413. package/dist/siemens-ix/{p-f6e713f3.js → p-affb60fb.js} +1 -1
  414. package/dist/siemens-ix/{p-96e46f99.js → p-b14308ed.js} +0 -0
  415. package/dist/siemens-ix/p-b5599b0b.entry.js +1 -0
  416. package/dist/siemens-ix/{p-eed28e55.entry.js → p-b85458fb.entry.js} +1 -1
  417. package/dist/siemens-ix/{p-fbe40498.js → p-c0454c9a.js} +0 -0
  418. package/dist/siemens-ix/p-c2b50878.entry.js +1 -0
  419. package/dist/siemens-ix/{p-9b5290d4.entry.js → p-c4568016.entry.js} +1 -1
  420. package/dist/siemens-ix/p-cb4269bf.js +1 -0
  421. package/dist/siemens-ix/{p-f7be9635.entry.js → p-d1a16c62.entry.js} +1 -1
  422. package/dist/siemens-ix/p-d7618223.entry.js +1 -0
  423. package/dist/siemens-ix/p-e48e659d.entry.js +1 -0
  424. package/dist/siemens-ix/p-e4bda8e7.entry.js +1 -0
  425. package/dist/siemens-ix/p-e5fd4b34.entry.js +1 -0
  426. package/dist/siemens-ix/{p-72f851ae.entry.js → p-f3cde62f.entry.js} +1 -1
  427. package/dist/siemens-ix/p-f7b5b66f.js +1 -0
  428. package/dist/siemens-ix/{p-150d7a02.entry.js → p-fa262af7.entry.js} +1 -1
  429. package/dist/siemens-ix/p-feefa8c7.entry.js +1 -0
  430. package/dist/siemens-ix/siemens-ix.css +2080 -1824
  431. package/dist/siemens-ix/siemens-ix.esm.js +1 -1
  432. package/dist/types/components/application-header/application-header.d.ts +8 -0
  433. package/dist/types/components/basic-navigation/basic-navigation.d.ts +6 -1
  434. package/dist/types/components/{utils → button}/button-variants.d.ts +0 -0
  435. package/dist/types/components/button/button.d.ts +1 -1
  436. package/dist/types/components/category-filter/category-filter.d.ts +10 -15
  437. package/dist/types/components/divider/divider.d.ts +6 -0
  438. package/dist/types/components/dropdown/dropdown-trigger-event.d.ts +4 -0
  439. package/dist/types/components/dropdown/dropdown.d.ts +11 -1
  440. package/dist/types/components/dropdown-button/dropdown-button.d.ts +1 -1
  441. package/dist/types/components/dropdown-quick-actions/dropdown-quick-actions.d.ts +6 -0
  442. package/dist/types/components/group/group-context-menu.d.ts +0 -2
  443. package/dist/types/components/menu/burger-menu.d.ts +10 -0
  444. package/dist/types/components/menu/menu.d.ts +3 -1
  445. package/dist/types/components/menu-avatar/menu-avatar.d.ts +12 -0
  446. package/dist/types/components/split-button/split-button.d.ts +1 -1
  447. package/dist/types/components/tabs/tabs.d.ts +3 -0
  448. package/dist/types/components/tooltip/tooltip.d.ts +39 -0
  449. package/dist/types/components/typography/types.d.ts +2 -0
  450. package/dist/types/components/typography/typography.d.ts +11 -0
  451. package/dist/types/components/utils/menu-service/menu-service.d.ts +13 -0
  452. package/dist/types/components/utils/screen/context.d.ts +4 -0
  453. package/dist/types/components/utils/screen/index.d.ts +1 -0
  454. package/dist/types/components/utils/screen/mode.d.ts +10 -0
  455. package/dist/types/components/utils/screen/service.d.ts +10 -0
  456. package/dist/types/components.d.ts +144 -7
  457. package/dist/types/exports.d.ts +1 -0
  458. package/dist/types/index.d.ts +2 -1
  459. package/dist/types/tests/utils/test/index.d.ts +1 -0
  460. package/dist/types/tests/utils/test/page.d.ts +3 -0
  461. package/package.json +2 -2
  462. package/scss/_common-variables.scss +1 -1
  463. package/scss/_fonts.scss +1 -1
  464. package/scss/_z-index.scss +1 -1
  465. package/scss/components/_button-group.scss +1 -1
  466. package/scss/components/_buttons.scss +2 -2
  467. package/scss/components/_checkboxes.scss +7 -7
  468. package/scss/components/_dropdown.scss +1 -1
  469. package/scss/components/_forms.scss +13 -11
  470. package/scss/components/_input-group.scss +1 -1
  471. package/scss/components/_links.scss +1 -1
  472. package/scss/components/_modal.scss +1 -1
  473. package/scss/components/_radiobuttons.scss +3 -3
  474. package/scss/components/_shadows.scss +13 -25
  475. package/scss/components/_table.scss +1 -1
  476. package/scss/ix.scss +2 -3
  477. package/scss/mixins/_animations.scss +1 -1
  478. package/scss/mixins/_fonts.scss +1 -1
  479. package/scss/mixins/_hover.scss +1 -1
  480. package/scss/mixins/_shadows.scss +1 -1
  481. package/scss/mixins/_text-truncation.scss +1 -1
  482. package/scss/theme/classic-dark/_border.scss +35 -0
  483. package/scss/theme/classic-dark/_borderRadius.scss +24 -0
  484. package/scss/theme/classic-dark/_borderWidth.scss +18 -0
  485. package/scss/theme/classic-dark/_boxShadow.scss +19 -0
  486. package/scss/theme/classic-dark/_color.scss +860 -0
  487. package/scss/theme/classic-dark/_fontFamilies.scss +8 -0
  488. package/scss/theme/classic-dark/_fontSizes.scss +13 -0
  489. package/scss/theme/classic-dark/_fontWeights.scss +9 -0
  490. package/scss/theme/classic-dark/_index.scss +16 -0
  491. package/scss/theme/classic-dark/_lineHeights.scss +18 -0
  492. package/scss/theme/classic-dark/_other.scss +16 -0
  493. package/scss/theme/classic-dark/_sizing.scss +16 -0
  494. package/scss/theme/classic-dark/_spacing.scss +9 -0
  495. package/scss/theme/classic-dark/_typography.scss +23 -0
  496. package/scss/theme/classic-light/_border.scss +35 -0
  497. package/scss/theme/classic-light/_borderRadius.scss +24 -0
  498. package/scss/theme/classic-light/_borderWidth.scss +18 -0
  499. package/scss/theme/classic-light/_boxShadow.scss +19 -0
  500. package/scss/theme/classic-light/_color.scss +860 -0
  501. package/scss/theme/classic-light/_fontFamilies.scss +8 -0
  502. package/scss/theme/classic-light/_fontSizes.scss +13 -0
  503. package/scss/theme/classic-light/_fontWeights.scss +9 -0
  504. package/scss/theme/classic-light/_index.scss +16 -0
  505. package/scss/theme/classic-light/_lineHeights.scss +18 -0
  506. package/scss/theme/classic-light/_other.scss +16 -0
  507. package/scss/theme/classic-light/_sizing.scss +16 -0
  508. package/scss/theme/classic-light/_spacing.scss +9 -0
  509. package/scss/theme/classic-light/_typography.scss +23 -0
  510. package/dist/siemens-ix/p-03d38416.entry.js +0 -1
  511. package/dist/siemens-ix/p-05c16b94.js +0 -2
  512. package/dist/siemens-ix/p-0e357d27.entry.js +0 -1
  513. package/dist/siemens-ix/p-23d79e3d.entry.js +0 -1
  514. package/dist/siemens-ix/p-2bc72119.entry.js +0 -1
  515. package/dist/siemens-ix/p-2bd88760.entry.js +0 -1
  516. package/dist/siemens-ix/p-2c5abec1.js +0 -1
  517. package/dist/siemens-ix/p-2e24ae23.entry.js +0 -1
  518. package/dist/siemens-ix/p-5631ae88.entry.js +0 -1
  519. package/dist/siemens-ix/p-5bbe9943.entry.js +0 -1
  520. package/dist/siemens-ix/p-65e61684.entry.js +0 -1
  521. package/dist/siemens-ix/p-67eb9d59.entry.js +0 -1
  522. package/dist/siemens-ix/p-a6f4cfc6.entry.js +0 -1
  523. package/dist/siemens-ix/p-ab7949ff.entry.js +0 -1
  524. package/dist/siemens-ix/p-b242bd39.entry.js +0 -1
  525. package/dist/siemens-ix/p-c993560f.entry.js +0 -1
  526. package/dist/siemens-ix/p-d20119c1.entry.js +0 -1
  527. package/dist/siemens-ix/p-fecf0ade.entry.js +0 -1
  528. package/scss/theme/_define-theme-colors.scss +0 -22
  529. package/scss/theme/_define-theme.scss +0 -36
  530. package/scss/theme/_static-colors.scss +0 -19
  531. package/scss/theme/classic-dark/_sizes.scss +0 -66
  532. package/scss/theme/classic-dark/_variables.scss +0 -827
  533. package/scss/theme/classic-dark/index.scss +0 -15
  534. package/scss/theme/classic-light/_sizes.scss +0 -66
  535. package/scss/theme/classic-light/_variables.scss +0 -829
  536. package/scss/theme/classic-light/index.scss +0 -15
@@ -1,17 +1,17 @@
1
- function getSide(placement) {
2
- return placement.split('-')[0];
1
+ function getAlignment(placement) {
2
+ return placement.split('-')[1];
3
3
  }
4
4
 
5
- function getAlignment$1(placement) {
6
- return placement.split('-')[1];
5
+ function getLengthFromAxis(axis) {
6
+ return axis === 'y' ? 'height' : 'width';
7
7
  }
8
8
 
9
- function getMainAxisFromPlacement(placement) {
10
- return ['top', 'bottom'].includes(getSide(placement)) ? 'x' : 'y';
9
+ function getSide(placement) {
10
+ return placement.split('-')[0];
11
11
  }
12
12
 
13
- function getLengthFromAxis(axis) {
14
- return axis === 'y' ? 'height' : 'width';
13
+ function getMainAxisFromPlacement(placement) {
14
+ return ['top', 'bottom'].includes(getSide(placement)) ? 'x' : 'y';
15
15
  }
16
16
 
17
17
  function computeCoordsFromPlacement(_ref, placement, rtl) {
@@ -27,7 +27,6 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
27
27
  const side = getSide(placement);
28
28
  const isVertical = mainAxis === 'x';
29
29
  let coords;
30
-
31
30
  switch (side) {
32
31
  case 'top':
33
32
  coords = {
@@ -35,45 +34,38 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
35
34
  y: reference.y - floating.height
36
35
  };
37
36
  break;
38
-
39
37
  case 'bottom':
40
38
  coords = {
41
39
  x: commonX,
42
40
  y: reference.y + reference.height
43
41
  };
44
42
  break;
45
-
46
43
  case 'right':
47
44
  coords = {
48
45
  x: reference.x + reference.width,
49
46
  y: commonY
50
47
  };
51
48
  break;
52
-
53
49
  case 'left':
54
50
  coords = {
55
51
  x: reference.x - floating.width,
56
52
  y: commonY
57
53
  };
58
54
  break;
59
-
60
55
  default:
61
56
  coords = {
62
57
  x: reference.x,
63
58
  y: reference.y
64
59
  };
65
60
  }
66
-
67
- switch (getAlignment$1(placement)) {
61
+ switch (getAlignment(placement)) {
68
62
  case 'start':
69
63
  coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
70
64
  break;
71
-
72
65
  case 'end':
73
66
  coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
74
67
  break;
75
68
  }
76
-
77
69
  return coords;
78
70
  }
79
71
 
@@ -84,7 +76,6 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
84
76
  * This export does not have any `platform` interface logic. You will need to
85
77
  * write one for the platform you are using Floating UI with.
86
78
  */
87
-
88
79
  const computePosition$1 = async (reference, floating, config) => {
89
80
  const {
90
81
  placement = 'bottom',
@@ -94,7 +85,6 @@ const computePosition$1 = async (reference, floating, config) => {
94
85
  } = config;
95
86
  const validMiddleware = middleware.filter(Boolean);
96
87
  const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
97
-
98
88
  let rects = await platform.getElementRects({
99
89
  reference,
100
90
  floating,
@@ -107,7 +97,6 @@ const computePosition$1 = async (reference, floating, config) => {
107
97
  let statefulPlacement = placement;
108
98
  let middlewareData = {};
109
99
  let resetCount = 0;
110
-
111
100
  for (let i = 0; i < validMiddleware.length; i++) {
112
101
  const {
113
102
  name,
@@ -134,20 +123,19 @@ const computePosition$1 = async (reference, floating, config) => {
134
123
  });
135
124
  x = nextX != null ? nextX : x;
136
125
  y = nextY != null ? nextY : y;
137
- middlewareData = { ...middlewareData,
138
- [name]: { ...middlewareData[name],
126
+ middlewareData = {
127
+ ...middlewareData,
128
+ [name]: {
129
+ ...middlewareData[name],
139
130
  ...data
140
131
  }
141
132
  };
142
-
143
133
  if (reset && resetCount <= 50) {
144
134
  resetCount++;
145
-
146
135
  if (typeof reset === 'object') {
147
136
  if (reset.placement) {
148
137
  statefulPlacement = reset.placement;
149
138
  }
150
-
151
139
  if (reset.rects) {
152
140
  rects = reset.rects === true ? await platform.getElementRects({
153
141
  reference,
@@ -155,18 +143,15 @@ const computePosition$1 = async (reference, floating, config) => {
155
143
  strategy
156
144
  }) : reset.rects;
157
145
  }
158
-
159
146
  ({
160
147
  x,
161
148
  y
162
149
  } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
163
150
  }
164
-
165
151
  i = -1;
166
152
  continue;
167
153
  }
168
154
  }
169
-
170
155
  return {
171
156
  x,
172
157
  y,
@@ -196,7 +181,8 @@ function getSideObjectFromPadding(padding) {
196
181
  }
197
182
 
198
183
  function rectToClientRect(rect) {
199
- return { ...rect,
184
+ return {
185
+ ...rect,
200
186
  top: rect.y,
201
187
  left: rect.x,
202
188
  right: rect.x + rect.width,
@@ -214,11 +200,9 @@ function rectToClientRect(rect) {
214
200
  */
215
201
  async function detectOverflow(middlewareArguments, options) {
216
202
  var _await$platform$isEle;
217
-
218
203
  if (options === void 0) {
219
204
  options = {};
220
205
  }
221
-
222
206
  const {
223
207
  x,
224
208
  y,
@@ -243,19 +227,29 @@ async function detectOverflow(middlewareArguments, options) {
243
227
  rootBoundary,
244
228
  strategy
245
229
  }));
230
+ const rect = elementContext === 'floating' ? {
231
+ ...rects.floating,
232
+ x,
233
+ y
234
+ } : rects.reference;
235
+ const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
236
+ const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
237
+ x: 1,
238
+ y: 1
239
+ } : {
240
+ x: 1,
241
+ y: 1
242
+ };
246
243
  const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
247
- rect: elementContext === 'floating' ? { ...rects.floating,
248
- x,
249
- y
250
- } : rects.reference,
251
- offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
244
+ rect,
245
+ offsetParent,
252
246
  strategy
253
- }) : rects[elementContext]);
247
+ }) : rect);
254
248
  return {
255
- top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
256
- bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
257
- left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
258
- right: elementClientRect.right - clippingClientRect.right + paddingObject.right
249
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
250
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
251
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
252
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
259
253
  };
260
254
  }
261
255
 
@@ -274,13 +268,12 @@ function within(min$1$1, value, max$1$1) {
274
268
  const arrow = options => ({
275
269
  name: 'arrow',
276
270
  options,
277
-
278
271
  async fn(middlewareArguments) {
279
- // Since `element` is required, we don't Partial<> the type
272
+ // Since `element` is required, we don't Partial<> the type.
280
273
  const {
281
274
  element,
282
275
  padding = 0
283
- } = options != null ? options : {};
276
+ } = options || {};
284
277
  const {
285
278
  x,
286
279
  y,
@@ -288,19 +281,15 @@ const arrow = options => ({
288
281
  rects,
289
282
  platform
290
283
  } = middlewareArguments;
291
-
292
284
  if (element == null) {
293
-
294
285
  return {};
295
286
  }
296
-
297
287
  const paddingObject = getSideObjectFromPadding(padding);
298
288
  const coords = {
299
289
  x,
300
290
  y
301
291
  };
302
292
  const axis = getMainAxisFromPlacement(placement);
303
- const alignment = getAlignment$1(placement);
304
293
  const length = getLengthFromAxis(axis);
305
294
  const arrowDimensions = await platform.getDimensions(element);
306
295
  const minProp = axis === 'y' ? 'top' : 'left';
@@ -309,21 +298,23 @@ const arrow = options => ({
309
298
  const startDiff = coords[axis] - rects.reference[axis];
310
299
  const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
311
300
  let clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
312
-
313
301
  if (clientSize === 0) {
314
302
  clientSize = rects.floating[length];
315
303
  }
304
+ const centerToReference = endDiff / 2 - startDiff / 2;
316
305
 
317
- const centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the floating element if the center
318
- // point is outside the floating element's bounds
319
-
306
+ // Make sure the arrow doesn't overflow the floating element if the center
307
+ // point is outside the floating element's bounds.
320
308
  const min = paddingObject[minProp];
321
309
  const max = clientSize - arrowDimensions[length] - paddingObject[maxProp];
322
310
  const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
323
- const offset = within(min, center, max); // Make sure that arrow points at the reference
311
+ const offset = within(min, center, max);
324
312
 
325
- const alignmentPadding = alignment === 'start' ? paddingObject[minProp] : paddingObject[maxProp];
326
- const shouldAddOffset = alignmentPadding > 0 && center !== offset && rects.reference[length] <= rects.floating[length];
313
+ // If the reference is small enough that the arrow's padding causes it to
314
+ // to point to nothing for an aligned placement, adjust the offset of the
315
+ // floating element itself. This stops `shift()` from taking action, but can
316
+ // be worked around by calling it again after the `arrow()` if desired.
317
+ const shouldAddOffset = getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min ? paddingObject[minProp] : paddingObject[maxProp]) - arrowDimensions[length] / 2 < 0;
327
318
  const alignmentOffset = shouldAddOffset ? center < min ? min - center : max - center : 0;
328
319
  return {
329
320
  [axis]: coords[axis] - alignmentOffset,
@@ -333,61 +324,55 @@ const arrow = options => ({
333
324
  }
334
325
  };
335
326
  }
336
-
337
327
  });
338
328
 
339
- const hash$1 = {
329
+ const sides = ['top', 'right', 'bottom', 'left'];
330
+ const allPlacements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-start", side + "-end"), []);
331
+
332
+ const oppositeSideMap = {
340
333
  left: 'right',
341
334
  right: 'left',
342
335
  bottom: 'top',
343
336
  top: 'bottom'
344
337
  };
345
338
  function getOppositePlacement(placement) {
346
- return placement.replace(/left|right|bottom|top/g, matched => hash$1[matched]);
339
+ return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
347
340
  }
348
341
 
349
342
  function getAlignmentSides(placement, rects, rtl) {
350
343
  if (rtl === void 0) {
351
344
  rtl = false;
352
345
  }
353
-
354
- const alignment = getAlignment$1(placement);
346
+ const alignment = getAlignment(placement);
355
347
  const mainAxis = getMainAxisFromPlacement(placement);
356
348
  const length = getLengthFromAxis(mainAxis);
357
349
  let mainAlignmentSide = mainAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
358
-
359
350
  if (rects.reference[length] > rects.floating[length]) {
360
351
  mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
361
352
  }
362
-
363
353
  return {
364
354
  main: mainAlignmentSide,
365
355
  cross: getOppositePlacement(mainAlignmentSide)
366
356
  };
367
357
  }
368
358
 
369
- const hash = {
359
+ const oppositeAlignmentMap = {
370
360
  start: 'end',
371
361
  end: 'start'
372
362
  };
373
363
  function getOppositeAlignmentPlacement(placement) {
374
- return placement.replace(/start|end/g, matched => hash[matched]);
364
+ return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
375
365
  }
376
366
 
377
- const sides = ['top', 'right', 'bottom', 'left'];
378
- const allPlacements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-start", side + "-end"), []);
379
-
380
367
  function getPlacementList(alignment, autoAlignment, allowedPlacements) {
381
- const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment$1(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment$1(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);
368
+ const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);
382
369
  return allowedPlacementsSortedByAlignment.filter(placement => {
383
370
  if (alignment) {
384
- return getAlignment$1(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
371
+ return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
385
372
  }
386
-
387
373
  return true;
388
374
  });
389
375
  }
390
-
391
376
  /**
392
377
  * Automatically chooses the `placement` which has the most space available.
393
378
  * @see https://floating-ui.com/docs/autoPlacement
@@ -396,17 +381,12 @@ const autoPlacement = function (options) {
396
381
  if (options === void 0) {
397
382
  options = {};
398
383
  }
399
-
400
384
  return {
401
385
  name: 'autoPlacement',
402
386
  options,
403
-
404
387
  async fn(middlewareArguments) {
405
- var _middlewareData$autoP, _middlewareData$autoP2, _middlewareData$autoP3, _middlewareData$autoP4, _placementsSortedByLe;
406
-
388
+ var _middlewareData$autoP, _middlewareData$autoP2, _placementsSortedByLe;
407
389
  const {
408
- x,
409
- y,
410
390
  rects,
411
391
  middlewareData,
412
392
  placement,
@@ -414,42 +394,39 @@ const autoPlacement = function (options) {
414
394
  elements
415
395
  } = middlewareArguments;
416
396
  const {
417
- alignment = null,
397
+ alignment,
418
398
  allowedPlacements = allPlacements,
419
399
  autoAlignment = true,
420
400
  ...detectOverflowOptions
421
401
  } = options;
422
- const placements = getPlacementList(alignment, autoAlignment, allowedPlacements);
402
+ const placements = alignment !== undefined || allowedPlacements === allPlacements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
423
403
  const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
424
- const currentIndex = (_middlewareData$autoP = (_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.index) != null ? _middlewareData$autoP : 0;
404
+ const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
425
405
  const currentPlacement = placements[currentIndex];
426
-
427
406
  if (currentPlacement == null) {
428
407
  return {};
429
408
  }
430
-
431
409
  const {
432
410
  main,
433
411
  cross
434
- } = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))); // Make `computeCoords` start from the right place
412
+ } = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
435
413
 
414
+ // Make `computeCoords` start from the right place.
436
415
  if (placement !== currentPlacement) {
437
416
  return {
438
- x,
439
- y,
440
417
  reset: {
441
418
  placement: placements[0]
442
419
  }
443
420
  };
444
421
  }
445
-
446
422
  const currentOverflows = [overflow[getSide(currentPlacement)], overflow[main], overflow[cross]];
447
- const allOverflows = [...((_middlewareData$autoP3 = (_middlewareData$autoP4 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP4.overflows) != null ? _middlewareData$autoP3 : []), {
423
+ const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {
448
424
  placement: currentPlacement,
449
425
  overflows: currentOverflows
450
426
  }];
451
- const nextPlacement = placements[currentIndex + 1]; // There are more placements to check
427
+ const nextPlacement = placements[currentIndex + 1];
452
428
 
429
+ // There are more placements to check.
453
430
  if (nextPlacement) {
454
431
  return {
455
432
  data: {
@@ -461,7 +438,6 @@ const autoPlacement = function (options) {
461
438
  }
462
439
  };
463
440
  }
464
-
465
441
  const placementsSortedByLeastOverflow = allOverflows.slice().sort((a, b) => a.overflows[0] - b.overflows[0]);
466
442
  const placementThatFitsOnAllSides = (_placementsSortedByLe = placementsSortedByLeastOverflow.find(_ref => {
467
443
  let {
@@ -469,8 +445,7 @@ const autoPlacement = function (options) {
469
445
  } = _ref;
470
446
  return overflows.every(overflow => overflow <= 0);
471
447
  })) == null ? void 0 : _placementsSortedByLe.placement;
472
- const resetPlacement = placementThatFitsOnAllSides != null ? placementThatFitsOnAllSides : placementsSortedByLeastOverflow[0].placement;
473
-
448
+ const resetPlacement = placementThatFitsOnAllSides || placementsSortedByLeastOverflow[0].placement;
474
449
  if (resetPlacement !== placement) {
475
450
  return {
476
451
  data: {
@@ -482,10 +457,115 @@ const autoPlacement = function (options) {
482
457
  }
483
458
  };
484
459
  }
485
-
486
460
  return {};
487
461
  }
462
+ };
463
+ };
464
+
465
+ /**
466
+ * Provides improved positioning for inline reference elements that can span
467
+ * over multiple lines, such as hyperlinks or range selections.
468
+ * @see https://floating-ui.com/docs/inline
469
+ */
470
+ const inline = function (options) {
471
+ if (options === void 0) {
472
+ options = {};
473
+ }
474
+ return {
475
+ name: 'inline',
476
+ options,
477
+ async fn(middlewareArguments) {
478
+ const {
479
+ placement,
480
+ elements,
481
+ rects,
482
+ platform,
483
+ strategy
484
+ } = middlewareArguments;
485
+ // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
486
+ // ClientRect's bounds, despite the event listener being triggered. A
487
+ // padding of 2 seems to handle this issue.
488
+ const {
489
+ padding = 2,
490
+ x,
491
+ y
492
+ } = options;
493
+ const fallback = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
494
+ rect: rects.reference,
495
+ offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
496
+ strategy
497
+ }) : rects.reference);
498
+ const clientRects = (await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || [];
499
+ const paddingObject = getSideObjectFromPadding(padding);
500
+ function getBoundingClientRect() {
501
+ // There are two rects and they are disjoined.
502
+ if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
503
+ // Find the first rect in which the point is fully inside.
504
+ return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
505
+ }
488
506
 
507
+ // There are 2 or more connected rects.
508
+ if (clientRects.length >= 2) {
509
+ if (getMainAxisFromPlacement(placement) === 'x') {
510
+ const firstRect = clientRects[0];
511
+ const lastRect = clientRects[clientRects.length - 1];
512
+ const isTop = getSide(placement) === 'top';
513
+ const top = firstRect.top;
514
+ const bottom = lastRect.bottom;
515
+ const left = isTop ? firstRect.left : lastRect.left;
516
+ const right = isTop ? firstRect.right : lastRect.right;
517
+ const width = right - left;
518
+ const height = bottom - top;
519
+ return {
520
+ top,
521
+ bottom,
522
+ left,
523
+ right,
524
+ width,
525
+ height,
526
+ x: left,
527
+ y: top
528
+ };
529
+ }
530
+ const isLeftSide = getSide(placement) === 'left';
531
+ const maxRight = max$1(...clientRects.map(rect => rect.right));
532
+ const minLeft = min$1(...clientRects.map(rect => rect.left));
533
+ const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
534
+ const top = measureRects[0].top;
535
+ const bottom = measureRects[measureRects.length - 1].bottom;
536
+ const left = minLeft;
537
+ const right = maxRight;
538
+ const width = right - left;
539
+ const height = bottom - top;
540
+ return {
541
+ top,
542
+ bottom,
543
+ left,
544
+ right,
545
+ width,
546
+ height,
547
+ x: left,
548
+ y: top
549
+ };
550
+ }
551
+ return fallback;
552
+ }
553
+ const resetRects = await platform.getElementRects({
554
+ reference: {
555
+ getBoundingClientRect
556
+ },
557
+ floating: elements.floating,
558
+ strategy
559
+ });
560
+ 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) {
561
+ return {
562
+ reset: {
563
+ rects: resetRects
564
+ }
565
+ };
566
+ }
567
+ return {};
568
+ }
489
569
  };
490
570
  };
491
571
 
@@ -497,12 +577,13 @@ async function convertValueToCoords(middlewareArguments, value) {
497
577
  } = middlewareArguments;
498
578
  const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
499
579
  const side = getSide(placement);
500
- const alignment = getAlignment$1(placement);
580
+ const alignment = getAlignment(placement);
501
581
  const isVertical = getMainAxisFromPlacement(placement) === 'x';
502
582
  const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
503
583
  const crossAxisMulti = rtl && isVertical ? -1 : 1;
504
- const rawValue = typeof value === 'function' ? value(middlewareArguments) : value; // eslint-disable-next-line prefer-const
584
+ const rawValue = typeof value === 'function' ? value(middlewareArguments) : value;
505
585
 
586
+ // eslint-disable-next-line prefer-const
506
587
  let {
507
588
  mainAxis,
508
589
  crossAxis,
@@ -517,11 +598,9 @@ async function convertValueToCoords(middlewareArguments, value) {
517
598
  alignmentAxis: null,
518
599
  ...rawValue
519
600
  };
520
-
521
601
  if (alignment && typeof alignmentAxis === 'number') {
522
602
  crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
523
603
  }
524
-
525
604
  return isVertical ? {
526
605
  x: crossAxis * crossAxisMulti,
527
606
  y: mainAxis * mainAxisMulti
@@ -530,20 +609,18 @@ async function convertValueToCoords(middlewareArguments, value) {
530
609
  y: crossAxis * crossAxisMulti
531
610
  };
532
611
  }
612
+
533
613
  /**
534
614
  * Displaces the floating element from its reference element.
535
615
  * @see https://floating-ui.com/docs/offset
536
616
  */
537
-
538
617
  const offset = function (value) {
539
618
  if (value === void 0) {
540
619
  value = 0;
541
620
  }
542
-
543
621
  return {
544
622
  name: 'offset',
545
623
  options: value,
546
-
547
624
  async fn(middlewareArguments) {
548
625
  const {
549
626
  x,
@@ -556,7 +633,6 @@ const offset = function (value) {
556
633
  data: diffCoords
557
634
  };
558
635
  }
559
-
560
636
  };
561
637
  };
562
638
 
@@ -573,11 +649,9 @@ const shift = function (options) {
573
649
  if (options === void 0) {
574
650
  options = {};
575
651
  }
576
-
577
652
  return {
578
653
  name: 'shift',
579
654
  options,
580
-
581
655
  async fn(middlewareArguments) {
582
656
  const {
583
657
  x,
@@ -610,7 +684,6 @@ const shift = function (options) {
610
684
  const crossAxis = getCrossAxis(mainAxis);
611
685
  let mainAxisCoord = coords[mainAxis];
612
686
  let crossAxisCoord = coords[crossAxis];
613
-
614
687
  if (checkMainAxis) {
615
688
  const minSide = mainAxis === 'y' ? 'top' : 'left';
616
689
  const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
@@ -618,7 +691,6 @@ const shift = function (options) {
618
691
  const max = mainAxisCoord - overflow[maxSide];
619
692
  mainAxisCoord = within(min, mainAxisCoord, max);
620
693
  }
621
-
622
694
  if (checkCrossAxis) {
623
695
  const minSide = crossAxis === 'y' ? 'top' : 'left';
624
696
  const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
@@ -626,173 +698,45 @@ const shift = function (options) {
626
698
  const max = crossAxisCoord - overflow[maxSide];
627
699
  crossAxisCoord = within(min, crossAxisCoord, max);
628
700
  }
629
-
630
- const limitedCoords = limiter.fn({ ...middlewareArguments,
701
+ const limitedCoords = limiter.fn({
702
+ ...middlewareArguments,
631
703
  [mainAxis]: mainAxisCoord,
632
704
  [crossAxis]: crossAxisCoord
633
705
  });
634
- return { ...limitedCoords,
706
+ return {
707
+ ...limitedCoords,
635
708
  data: {
636
709
  x: limitedCoords.x - x,
637
710
  y: limitedCoords.y - y
638
711
  }
639
712
  };
640
713
  }
641
-
642
- };
643
- };
644
-
645
- /**
646
- * Provides improved positioning for inline reference elements that can span
647
- * over multiple lines, such as hyperlinks or range selections.
648
- * @see https://floating-ui.com/docs/inline
649
- */
650
- const inline = function (options) {
651
- if (options === void 0) {
652
- options = {};
653
- }
654
-
655
- return {
656
- name: 'inline',
657
- options,
658
-
659
- async fn(middlewareArguments) {
660
- var _await$platform$getCl;
661
-
662
- const {
663
- placement,
664
- elements,
665
- rects,
666
- platform,
667
- strategy
668
- } = middlewareArguments; // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
669
- // ClientRect's bounds, despite the event listener being triggered. A
670
- // padding of 2 seems to handle this issue.
671
-
672
- const {
673
- padding = 2,
674
- x,
675
- y
676
- } = options;
677
- const fallback = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
678
- rect: rects.reference,
679
- offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
680
- strategy
681
- }) : rects.reference);
682
- const clientRects = (_await$platform$getCl = await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) != null ? _await$platform$getCl : [];
683
- const paddingObject = getSideObjectFromPadding(padding);
684
-
685
- function getBoundingClientRect() {
686
- // There are two rects and they are disjoined
687
- if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
688
- var _clientRects$find;
689
-
690
- // Find the first rect in which the point is fully inside
691
- 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;
692
- } // There are 2 or more connected rects
693
-
694
-
695
- if (clientRects.length >= 2) {
696
- if (getMainAxisFromPlacement(placement) === 'x') {
697
- const firstRect = clientRects[0];
698
- const lastRect = clientRects[clientRects.length - 1];
699
- const isTop = getSide(placement) === 'top';
700
- const top = firstRect.top;
701
- const bottom = lastRect.bottom;
702
- const left = isTop ? firstRect.left : lastRect.left;
703
- const right = isTop ? firstRect.right : lastRect.right;
704
- const width = right - left;
705
- const height = bottom - top;
706
- return {
707
- top,
708
- bottom,
709
- left,
710
- right,
711
- width,
712
- height,
713
- x: left,
714
- y: top
715
- };
716
- }
717
-
718
- const isLeftSide = getSide(placement) === 'left';
719
- const maxRight = max$1(...clientRects.map(rect => rect.right));
720
- const minLeft = min$1(...clientRects.map(rect => rect.left));
721
- const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
722
- const top = measureRects[0].top;
723
- const bottom = measureRects[measureRects.length - 1].bottom;
724
- const left = minLeft;
725
- const right = maxRight;
726
- const width = right - left;
727
- const height = bottom - top;
728
- return {
729
- top,
730
- bottom,
731
- left,
732
- right,
733
- width,
734
- height,
735
- x: left,
736
- y: top
737
- };
738
- }
739
-
740
- return fallback;
741
- }
742
-
743
- const resetRects = await platform.getElementRects({
744
- reference: {
745
- getBoundingClientRect
746
- },
747
- floating: elements.floating,
748
- strategy
749
- });
750
-
751
- 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) {
752
- return {
753
- reset: {
754
- rects: resetRects
755
- }
756
- };
757
- }
758
-
759
- return {};
760
- }
761
-
762
714
  };
763
715
  };
764
716
 
765
- function isWindow(value) {
766
- return value && value.document && value.location && value.alert && value.setInterval;
767
- }
768
717
  function getWindow(node) {
769
- if (node == null) {
770
- return window;
771
- }
772
-
773
- if (!isWindow(node)) {
774
- const ownerDocument = node.ownerDocument;
775
- return ownerDocument ? ownerDocument.defaultView || window : window;
776
- }
777
-
778
- return node;
718
+ var _node$ownerDocument;
719
+ return ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
779
720
  }
780
721
 
781
- function getComputedStyle(element) {
722
+ function getComputedStyle$1(element) {
782
723
  return getWindow(element).getComputedStyle(element);
783
724
  }
784
725
 
785
726
  function getNodeName(node) {
786
- return isWindow(node) ? '' : node ? (node.nodeName || '').toLowerCase() : '';
727
+ return isNode(node) ? (node.nodeName || '').toLowerCase() : '';
787
728
  }
788
729
 
730
+ let uaString;
789
731
  function getUAString() {
732
+ if (uaString) {
733
+ return uaString;
734
+ }
790
735
  const uaData = navigator.userAgentData;
791
-
792
- if (uaData != null && uaData.brands) {
793
- return uaData.brands.map(item => item.brand + "/" + item.version).join(' ');
736
+ if (uaData && Array.isArray(uaData.brands)) {
737
+ uaString = uaData.brands.map(item => item.brand + "/" + item.version).join(' ');
738
+ return uaString;
794
739
  }
795
-
796
740
  return navigator.userAgent;
797
741
  }
798
742
 
@@ -810,19 +754,17 @@ function isShadowRoot(node) {
810
754
  if (typeof ShadowRoot === 'undefined') {
811
755
  return false;
812
756
  }
813
-
814
757
  const OwnElement = getWindow(node).ShadowRoot;
815
758
  return node instanceof OwnElement || node instanceof ShadowRoot;
816
759
  }
817
760
  function isOverflowElement(element) {
818
- // Firefox wants us to check `-x` and `-y` variations as well
819
761
  const {
820
762
  overflow,
821
763
  overflowX,
822
764
  overflowY,
823
765
  display
824
- } = getComputedStyle(element);
825
- return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
766
+ } = getComputedStyle$1(element);
767
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
826
768
  }
827
769
  function isTableElement(element) {
828
770
  return ['table', 'td', 'th'].includes(getNodeName(element));
@@ -830,12 +772,14 @@ function isTableElement(element) {
830
772
  function isContainingBlock(element) {
831
773
  // TODO: Try and use feature detection here instead
832
774
  const isFirefox = /firefox/i.test(getUAString());
833
- const css = getComputedStyle(element);
834
- const backdropFilter = css.backdropFilter || css.WebkitBackdropFilter; // This is non-exhaustive but covers the most common CSS properties that
775
+ const css = getComputedStyle$1(element);
776
+ const backdropFilter = css.backdropFilter || css.WebkitBackdropFilter;
777
+
778
+ // This is non-exhaustive but covers the most common CSS properties that
835
779
  // create a containing block.
836
780
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
837
-
838
- return css.transform !== 'none' || css.perspective !== 'none' || (backdropFilter ? backdropFilter !== 'none' : false) || isFirefox && css.willChange === 'filter' || isFirefox && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective'].some(value => css.willChange.includes(value)) || ['paint', 'layout', 'strict', 'content'].some( // TS 4.1 compat
781
+ return css.transform !== 'none' || css.perspective !== 'none' || (backdropFilter ? backdropFilter !== 'none' : false) || isFirefox && css.willChange === 'filter' || isFirefox && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective'].some(value => css.willChange.includes(value)) || ['paint', 'layout', 'strict', 'content'].some(
782
+ // TS 4.1 compat
839
783
  value => {
840
784
  const contain = css.contain;
841
785
  return contain != null ? contain.includes(value) : false;
@@ -843,12 +787,14 @@ function isContainingBlock(element) {
843
787
  }
844
788
  function isLayoutViewport() {
845
789
  // Not Safari
846
- return !/^((?!chrome|android).)*safari/i.test(getUAString()); // Feature detection for this fails in various ways
790
+ return !/^((?!chrome|android).)*safari/i.test(getUAString());
791
+ // Feature detection for this fails in various ways
847
792
  // • Always-visible scrollbar or not
848
793
  // • Width of <html>, etc.
849
794
  // const vV = win.visualViewport;
850
795
  // return vV ? Math.abs(win.innerWidth / vV.scale - vV.width) < 0.5 : true;
851
796
  }
797
+
852
798
  function isLastTraversableNode(node) {
853
799
  return ['html', 'body', '#document'].includes(getNodeName(node));
854
800
  }
@@ -857,32 +803,105 @@ const min = Math.min;
857
803
  const max = Math.max;
858
804
  const round = Math.round;
859
805
 
860
- function getBoundingClientRect(element, includeScale, isFixedStrategy) {
861
- var _win$visualViewport$o, _win$visualViewport, _win$visualViewport$o2, _win$visualViewport2;
806
+ function getCssDimensions(element) {
807
+ const css = getComputedStyle$1(element);
808
+ let width = parseFloat(css.width);
809
+ let height = parseFloat(css.height);
810
+ const offsetWidth = element.offsetWidth;
811
+ const offsetHeight = element.offsetHeight;
812
+ const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
813
+ if (shouldFallback) {
814
+ width = offsetWidth;
815
+ height = offsetHeight;
816
+ }
817
+ return {
818
+ width,
819
+ height,
820
+ fallback: shouldFallback
821
+ };
822
+ }
823
+
824
+ function unwrapElement(element) {
825
+ return !isElement(element) ? element.contextElement : element;
826
+ }
827
+
828
+ const FALLBACK_SCALE = {
829
+ x: 1,
830
+ y: 1
831
+ };
832
+ function getScale(element) {
833
+ const domElement = unwrapElement(element);
834
+ if (!isHTMLElement(domElement)) {
835
+ return FALLBACK_SCALE;
836
+ }
837
+ const rect = domElement.getBoundingClientRect();
838
+ const {
839
+ width,
840
+ height,
841
+ fallback
842
+ } = getCssDimensions(domElement);
843
+ let x = (fallback ? round(rect.width) : rect.width) / width;
844
+ let y = (fallback ? round(rect.height) : rect.height) / height;
845
+
846
+ // 0, NaN, or Infinity should always fallback to 1.
847
+
848
+ if (!x || !Number.isFinite(x)) {
849
+ x = 1;
850
+ }
851
+ if (!y || !Number.isFinite(y)) {
852
+ y = 1;
853
+ }
854
+ return {
855
+ x,
856
+ y
857
+ };
858
+ }
862
859
 
860
+ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
861
+ var _win$visualViewport, _win$visualViewport2;
863
862
  if (includeScale === void 0) {
864
863
  includeScale = false;
865
864
  }
866
-
867
865
  if (isFixedStrategy === void 0) {
868
866
  isFixedStrategy = false;
869
867
  }
870
-
871
868
  const clientRect = element.getBoundingClientRect();
872
- let scaleX = 1;
873
- let scaleY = 1;
874
-
875
- if (includeScale && isHTMLElement(element)) {
876
- scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
877
- scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
869
+ const domElement = unwrapElement(element);
870
+ let scale = FALLBACK_SCALE;
871
+ if (includeScale) {
872
+ if (offsetParent) {
873
+ if (isElement(offsetParent)) {
874
+ scale = getScale(offsetParent);
875
+ }
876
+ } else {
877
+ scale = getScale(element);
878
+ }
878
879
  }
879
-
880
- const win = isElement(element) ? getWindow(element) : window;
880
+ const win = domElement ? getWindow(domElement) : window;
881
881
  const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
882
- const x = (clientRect.left + (addVisualOffsets ? (_win$visualViewport$o = (_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) != null ? _win$visualViewport$o : 0 : 0)) / scaleX;
883
- const y = (clientRect.top + (addVisualOffsets ? (_win$visualViewport$o2 = (_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) != null ? _win$visualViewport$o2 : 0 : 0)) / scaleY;
884
- const width = clientRect.width / scaleX;
885
- const height = clientRect.height / scaleY;
882
+ let x = (clientRect.left + (addVisualOffsets ? ((_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) || 0 : 0)) / scale.x;
883
+ let y = (clientRect.top + (addVisualOffsets ? ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0 : 0)) / scale.y;
884
+ let width = clientRect.width / scale.x;
885
+ let height = clientRect.height / scale.y;
886
+ if (domElement) {
887
+ const win = getWindow(domElement);
888
+ const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
889
+ let currentIFrame = win.frameElement;
890
+ while (currentIFrame && offsetParent && offsetWin !== win) {
891
+ const iframeScale = getScale(currentIFrame);
892
+ const iframeRect = currentIFrame.getBoundingClientRect();
893
+ const css = getComputedStyle(currentIFrame);
894
+ iframeRect.x += (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
895
+ iframeRect.y += (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
896
+ x *= iframeScale.x;
897
+ y *= iframeScale.y;
898
+ width *= iframeScale.x;
899
+ height *= iframeScale.y;
900
+ x += iframeRect.x;
901
+ y += iframeRect.y;
902
+ currentIFrame = getWindow(currentIFrame).frameElement;
903
+ }
904
+ }
886
905
  return {
887
906
  width,
888
907
  height,
@@ -906,7 +925,6 @@ function getNodeScroll(element) {
906
925
  scrollTop: element.scrollTop
907
926
  };
908
927
  }
909
-
910
928
  return {
911
929
  scrollLeft: element.pageXOffset,
912
930
  scrollTop: element.pageYOffset
@@ -919,16 +937,10 @@ function getWindowScrollBarX(element) {
919
937
  return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
920
938
  }
921
939
 
922
- function isScaled(element) {
923
- const rect = getBoundingClientRect(element);
924
- return round(rect.width) !== element.offsetWidth || round(rect.height) !== element.offsetHeight;
925
- }
926
-
927
940
  function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
928
941
  const isOffsetParentAnElement = isHTMLElement(offsetParent);
929
942
  const documentElement = getDocumentElement(offsetParent);
930
- const rect = getBoundingClientRect(element, // @ts-ignore - checked above (TS 4.1 compat)
931
- isOffsetParentAnElement && isScaled(offsetParent), strategy === 'fixed');
943
+ const rect = getBoundingClientRect(element, true, strategy === 'fixed', offsetParent);
932
944
  let scroll = {
933
945
  scrollLeft: 0,
934
946
  scrollTop: 0
@@ -937,12 +949,10 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
937
949
  x: 0,
938
950
  y: 0
939
951
  };
940
-
941
952
  if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
942
953
  if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
943
954
  scroll = getNodeScroll(offsetParent);
944
955
  }
945
-
946
956
  if (isHTMLElement(offsetParent)) {
947
957
  const offsetRect = getBoundingClientRect(offsetParent, true);
948
958
  offsets.x = offsetRect.x + offsetParent.clientLeft;
@@ -951,7 +961,6 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
951
961
  offsets.x = getWindowScrollBarX(documentElement);
952
962
  }
953
963
  }
954
-
955
964
  return {
956
965
  x: rect.left + scroll.scrollLeft - offsets.x,
957
966
  y: rect.top + scroll.scrollTop - offsets.y,
@@ -964,26 +973,26 @@ function getParentNode(node) {
964
973
  if (getNodeName(node) === 'html') {
965
974
  return node;
966
975
  }
967
-
968
- const result = // Step into the shadow DOM of the parent of a slotted node
969
- node.assignedSlot || // DOM Element detected
970
- node.parentNode || ( // ShadowRoot detected
971
- isShadowRoot(node) ? node.host : null) || // Fallback
976
+ const result =
977
+ // Step into the shadow DOM of the parent of a slotted node
978
+ node.assignedSlot ||
979
+ // DOM Element detected
980
+ node.parentNode || (
981
+ // ShadowRoot detected
982
+ isShadowRoot(node) ? node.host : null) ||
983
+ // Fallback
972
984
  getDocumentElement(node);
973
985
  return isShadowRoot(result) ? result.host : result;
974
986
  }
975
987
 
976
988
  function getTrueOffsetParent(element) {
977
- if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
989
+ if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
978
990
  return null;
979
991
  }
980
-
981
992
  return element.offsetParent;
982
993
  }
983
-
984
994
  function getContainingBlock(element) {
985
995
  let currentNode = getParentNode(element);
986
-
987
996
  while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
988
997
  if (isContainingBlock(currentNode)) {
989
998
  return currentNode;
@@ -991,40 +1000,25 @@ function getContainingBlock(element) {
991
1000
  currentNode = getParentNode(currentNode);
992
1001
  }
993
1002
  }
994
-
995
1003
  return null;
996
- } // Gets the closest ancestor positioned element. Handles some edge cases,
997
- // such as table ancestors and cross browser bugs.
998
-
1004
+ }
999
1005
 
1006
+ // Gets the closest ancestor positioned element. Handles some edge cases,
1007
+ // such as table ancestors and cross browser bugs.
1000
1008
  function getOffsetParent(element) {
1001
1009
  const window = getWindow(element);
1002
1010
  let offsetParent = getTrueOffsetParent(element);
1003
-
1004
- while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
1011
+ while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
1005
1012
  offsetParent = getTrueOffsetParent(offsetParent);
1006
1013
  }
1007
-
1008
- if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
1014
+ if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
1009
1015
  return window;
1010
1016
  }
1011
-
1012
1017
  return offsetParent || getContainingBlock(element) || window;
1013
1018
  }
1014
1019
 
1015
1020
  function getDimensions(element) {
1016
- if (isHTMLElement(element)) {
1017
- return {
1018
- width: element.offsetWidth,
1019
- height: element.offsetHeight
1020
- };
1021
- }
1022
-
1023
- const rect = getBoundingClientRect(element);
1024
- return {
1025
- width: rect.width,
1026
- height: rect.height
1027
- };
1021
+ return getCssDimensions(element);
1028
1022
  }
1029
1023
 
1030
1024
  function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
@@ -1035,39 +1029,42 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
1035
1029
  } = _ref;
1036
1030
  const isOffsetParentAnElement = isHTMLElement(offsetParent);
1037
1031
  const documentElement = getDocumentElement(offsetParent);
1038
-
1039
1032
  if (offsetParent === documentElement) {
1040
1033
  return rect;
1041
1034
  }
1042
-
1043
1035
  let scroll = {
1044
1036
  scrollLeft: 0,
1045
1037
  scrollTop: 0
1046
1038
  };
1039
+ let scale = {
1040
+ x: 1,
1041
+ y: 1
1042
+ };
1047
1043
  const offsets = {
1048
1044
  x: 0,
1049
1045
  y: 0
1050
1046
  };
1051
-
1052
1047
  if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
1053
1048
  if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
1054
1049
  scroll = getNodeScroll(offsetParent);
1055
1050
  }
1056
-
1057
1051
  if (isHTMLElement(offsetParent)) {
1058
- const offsetRect = getBoundingClientRect(offsetParent, true);
1052
+ const offsetRect = getBoundingClientRect(offsetParent);
1053
+ scale = getScale(offsetParent);
1059
1054
  offsets.x = offsetRect.x + offsetParent.clientLeft;
1060
1055
  offsets.y = offsetRect.y + offsetParent.clientTop;
1061
- } // This doesn't appear to be need to be negated.
1056
+ }
1057
+ // This doesn't appear to need to be negated.
1062
1058
  // else if (documentElement) {
1063
1059
  // offsets.x = getWindowScrollBarX(documentElement);
1064
1060
  // }
1065
-
1066
1061
  }
1067
1062
 
1068
- return { ...rect,
1069
- x: rect.x - scroll.scrollLeft + offsets.x,
1070
- y: rect.y - scroll.scrollTop + offsets.y
1063
+ return {
1064
+ width: rect.width * scale.x,
1065
+ height: rect.height * scale.y,
1066
+ x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
1067
+ y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
1071
1068
  };
1072
1069
  }
1073
1070
 
@@ -1079,18 +1076,15 @@ function getViewportRect(element, strategy) {
1079
1076
  let height = html.clientHeight;
1080
1077
  let x = 0;
1081
1078
  let y = 0;
1082
-
1083
1079
  if (visualViewport) {
1084
1080
  width = visualViewport.width;
1085
1081
  height = visualViewport.height;
1086
1082
  const layoutViewport = isLayoutViewport();
1087
-
1088
1083
  if (layoutViewport || !layoutViewport && strategy === 'fixed') {
1089
1084
  x = visualViewport.offsetLeft;
1090
1085
  y = visualViewport.offsetTop;
1091
1086
  }
1092
1087
  }
1093
-
1094
1088
  return {
1095
1089
  width,
1096
1090
  height,
@@ -1099,11 +1093,10 @@ function getViewportRect(element, strategy) {
1099
1093
  };
1100
1094
  }
1101
1095
 
1096
+ // Gets the entire size of the scrollable document area, even extending outside
1102
1097
  // of the `<html>` and `<body>` rect bounds if horizontally scrollable
1103
-
1104
1098
  function getDocumentRect(element) {
1105
1099
  var _element$ownerDocumen;
1106
-
1107
1100
  const html = getDocumentElement(element);
1108
1101
  const scroll = getNodeScroll(element);
1109
1102
  const body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
@@ -1111,11 +1104,9 @@ function getDocumentRect(element) {
1111
1104
  const height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
1112
1105
  let x = -scroll.scrollLeft + getWindowScrollBarX(element);
1113
1106
  const y = -scroll.scrollTop;
1114
-
1115
- if (getComputedStyle(body || html).direction === 'rtl') {
1107
+ if (getComputedStyle$1(body || html).direction === 'rtl') {
1116
1108
  x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
1117
1109
  }
1118
-
1119
1110
  return {
1120
1111
  width,
1121
1112
  height,
@@ -1126,90 +1117,97 @@ function getDocumentRect(element) {
1126
1117
 
1127
1118
  function getNearestOverflowAncestor(node) {
1128
1119
  const parentNode = getParentNode(node);
1129
-
1130
1120
  if (isLastTraversableNode(parentNode)) {
1131
1121
  // @ts-ignore assume body is always available
1132
1122
  return node.ownerDocument.body;
1133
1123
  }
1134
-
1135
1124
  if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
1136
1125
  return parentNode;
1137
1126
  }
1138
-
1139
1127
  return getNearestOverflowAncestor(parentNode);
1140
1128
  }
1141
1129
 
1142
1130
  function getOverflowAncestors(node, list) {
1143
1131
  var _node$ownerDocument;
1144
-
1145
1132
  if (list === void 0) {
1146
1133
  list = [];
1147
1134
  }
1148
-
1149
1135
  const scrollableAncestor = getNearestOverflowAncestor(node);
1150
1136
  const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
1151
1137
  const win = getWindow(scrollableAncestor);
1152
- const target = isBody ? [win].concat(win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []) : scrollableAncestor;
1153
- const updatedList = list.concat(target);
1154
- return isBody ? updatedList : // @ts-ignore: isBody tells us target will be an HTMLElement here
1155
- updatedList.concat(getOverflowAncestors(target));
1138
+ if (isBody) {
1139
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []);
1140
+ }
1141
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor));
1156
1142
  }
1157
1143
 
1144
+ // Returns the inner client rect, subtracting scrollbars if present
1158
1145
  function getInnerBoundingClientRect(element, strategy) {
1159
- const clientRect = getBoundingClientRect(element, false, strategy === 'fixed');
1146
+ const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
1160
1147
  const top = clientRect.top + element.clientTop;
1161
1148
  const left = clientRect.left + element.clientLeft;
1149
+ const scale = isHTMLElement(element) ? getScale(element) : {
1150
+ x: 1,
1151
+ y: 1
1152
+ };
1153
+ const width = element.clientWidth * scale.x;
1154
+ const height = element.clientHeight * scale.y;
1155
+ const x = left * scale.x;
1156
+ const y = top * scale.y;
1162
1157
  return {
1163
- top,
1164
- left,
1165
- x: left,
1166
- y: top,
1167
- right: left + element.clientWidth,
1168
- bottom: top + element.clientHeight,
1169
- width: element.clientWidth,
1170
- height: element.clientHeight
1158
+ top: y,
1159
+ left: x,
1160
+ right: x + width,
1161
+ bottom: y + height,
1162
+ x,
1163
+ y,
1164
+ width,
1165
+ height
1171
1166
  };
1172
1167
  }
1173
-
1174
1168
  function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
1175
1169
  if (clippingAncestor === 'viewport') {
1176
1170
  return rectToClientRect(getViewportRect(element, strategy));
1177
1171
  }
1178
-
1179
1172
  if (isElement(clippingAncestor)) {
1180
1173
  return getInnerBoundingClientRect(clippingAncestor, strategy);
1181
1174
  }
1182
-
1183
1175
  return rectToClientRect(getDocumentRect(getDocumentElement(element)));
1184
- } // A "clipping ancestor" is an overflowable container with the characteristic of
1185
- // clipping (or hiding) overflowing elements with a position different from
1186
- // `initial`
1187
-
1176
+ }
1188
1177
 
1189
- function getClippingElementAncestors(element) {
1178
+ // A "clipping ancestor" is an `overflow` element with the characteristic of
1179
+ // clipping (or hiding) child elements. This returns all clipping ancestors
1180
+ // of the given element up the tree.
1181
+ function getClippingElementAncestors(element, cache) {
1182
+ const cachedResult = cache.get(element);
1183
+ if (cachedResult) {
1184
+ return cachedResult;
1185
+ }
1190
1186
  let result = getOverflowAncestors(element).filter(el => isElement(el) && getNodeName(el) !== 'body');
1191
- let currentNode = element;
1192
- let currentContainingBlockComputedStyle = null; // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
1187
+ let currentContainingBlockComputedStyle = null;
1188
+ const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
1189
+ let currentNode = elementIsFixed ? getParentNode(element) : element;
1193
1190
 
1191
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
1194
1192
  while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
1195
- const computedStyle = getComputedStyle(currentNode);
1196
-
1197
- if (computedStyle.position === 'static' && currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) && !isContainingBlock(currentNode)) {
1193
+ const computedStyle = getComputedStyle$1(currentNode);
1194
+ const containingBlock = isContainingBlock(currentNode);
1195
+ const shouldDropCurrentNode = elementIsFixed ? !containingBlock && !currentContainingBlockComputedStyle : !containingBlock && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position);
1196
+ if (shouldDropCurrentNode) {
1198
1197
  // Drop non-containing blocks
1199
1198
  result = result.filter(ancestor => ancestor !== currentNode);
1200
1199
  } else {
1201
1200
  // Record last containing block for next iteration
1202
1201
  currentContainingBlockComputedStyle = computedStyle;
1203
1202
  }
1204
-
1205
1203
  currentNode = getParentNode(currentNode);
1206
1204
  }
1207
-
1205
+ cache.set(element, result);
1208
1206
  return result;
1209
- } // Gets the maximum area that the element is visible in due to any number of
1210
- // clipping ancestors
1211
-
1207
+ }
1212
1208
 
1209
+ // Gets the maximum area that the element is visible in due to any number of
1210
+ // clipping ancestors
1213
1211
  function getClippingRect(_ref) {
1214
1212
  let {
1215
1213
  element,
@@ -1217,7 +1215,7 @@ function getClippingRect(_ref) {
1217
1215
  rootBoundary,
1218
1216
  strategy
1219
1217
  } = _ref;
1220
- const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element) : [].concat(boundary);
1218
+ const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
1221
1219
  const clippingAncestors = [...elementClippingAncestors, rootBoundary];
1222
1220
  const firstClippingAncestor = clippingAncestors[0];
1223
1221
  const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
@@ -1243,22 +1241,26 @@ const platform = {
1243
1241
  getDimensions,
1244
1242
  getOffsetParent,
1245
1243
  getDocumentElement,
1246
- getElementRects: _ref => {
1244
+ getScale,
1245
+ async getElementRects(_ref) {
1247
1246
  let {
1248
1247
  reference,
1249
1248
  floating,
1250
1249
  strategy
1251
1250
  } = _ref;
1251
+ const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
1252
+ const getDimensionsFn = this.getDimensions;
1252
1253
  return {
1253
- reference: getRectRelativeToOffsetParent(reference, getOffsetParent(floating), strategy),
1254
- floating: { ...getDimensions(floating),
1254
+ reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy),
1255
+ floating: {
1255
1256
  x: 0,
1256
- y: 0
1257
+ y: 0,
1258
+ ...(await getDimensionsFn(floating))
1257
1259
  }
1258
1260
  };
1259
1261
  },
1260
1262
  getClientRects: element => Array.from(element.getClientRects()),
1261
- isRTL: element => getComputedStyle(element).direction === 'rtl'
1263
+ isRTL: element => getComputedStyle$1(element).direction === 'rtl'
1262
1264
  };
1263
1265
 
1264
1266
  /**
@@ -1269,7 +1271,6 @@ function autoUpdate(reference, floating, update, options) {
1269
1271
  if (options === void 0) {
1270
1272
  options = {};
1271
1273
  }
1272
-
1273
1274
  const {
1274
1275
  ancestorScroll: _ancestorScroll = true,
1275
1276
  ancestorResize = true,
@@ -1285,54 +1286,42 @@ function autoUpdate(reference, floating, update, options) {
1285
1286
  ancestorResize && ancestor.addEventListener('resize', update);
1286
1287
  });
1287
1288
  let observer = null;
1288
-
1289
1289
  if (elementResize) {
1290
1290
  let initialUpdate = true;
1291
1291
  observer = new ResizeObserver(() => {
1292
1292
  if (!initialUpdate) {
1293
1293
  update();
1294
1294
  }
1295
-
1296
1295
  initialUpdate = false;
1297
1296
  });
1298
1297
  isElement(reference) && !animationFrame && observer.observe(reference);
1299
-
1300
1298
  if (!isElement(reference) && reference.contextElement && !animationFrame) {
1301
1299
  observer.observe(reference.contextElement);
1302
1300
  }
1303
-
1304
1301
  observer.observe(floating);
1305
1302
  }
1306
-
1307
1303
  let frameId;
1308
1304
  let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
1309
-
1310
1305
  if (animationFrame) {
1311
1306
  frameLoop();
1312
1307
  }
1313
-
1314
1308
  function frameLoop() {
1315
1309
  const nextRefRect = getBoundingClientRect(reference);
1316
-
1317
1310
  if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
1318
1311
  update();
1319
1312
  }
1320
-
1321
1313
  prevRefRect = nextRefRect;
1322
1314
  frameId = requestAnimationFrame(frameLoop);
1323
1315
  }
1324
-
1325
1316
  update();
1326
1317
  return () => {
1327
1318
  var _observer;
1328
-
1329
1319
  ancestors.forEach(ancestor => {
1330
1320
  ancestorScroll && ancestor.removeEventListener('scroll', update);
1331
1321
  ancestorResize && ancestor.removeEventListener('resize', update);
1332
1322
  });
1333
1323
  (_observer = observer) == null ? void 0 : _observer.disconnect();
1334
1324
  observer = null;
1335
-
1336
1325
  if (animationFrame) {
1337
1326
  cancelAnimationFrame(frameId);
1338
1327
  }
@@ -1344,20 +1333,23 @@ function autoUpdate(reference, floating, update, options) {
1344
1333
  * next to a reference element when it is given a certain CSS positioning
1345
1334
  * strategy.
1346
1335
  */
1336
+ const computePosition = (reference, floating, options) => {
1337
+ // This caches the expensive `getClippingElementAncestors` function so that
1338
+ // multiple lifecycle resets re-use the same result. It only lives for a
1339
+ // single call. If other functions become expensive, we can add them as well.
1340
+ const cache = new Map();
1341
+ const mergedOptions = {
1342
+ platform,
1343
+ ...options
1344
+ };
1345
+ const platformWithCache = {
1346
+ ...mergedOptions.platform,
1347
+ _c: cache
1348
+ };
1349
+ return computePosition$1(reference, floating, {
1350
+ ...mergedOptions,
1351
+ platform: platformWithCache
1352
+ });
1353
+ };
1347
1354
 
1348
- const computePosition = (reference, floating, options) => computePosition$1(reference, floating, {
1349
- platform,
1350
- ...options
1351
- });
1352
-
1353
- function getAlignment(placement) {
1354
- if (placement.includes('-end')) {
1355
- return 'end';
1356
- }
1357
- else if (placement.includes('-start')) {
1358
- return 'start';
1359
- }
1360
- return undefined;
1361
- }
1362
-
1363
- export { autoPlacement as a, autoUpdate as b, computePosition as c, arrow as d, getAlignment as g, inline as i, offset as o, shift as s };
1355
+ export { autoPlacement as a, autoUpdate as b, computePosition as c, arrow as d, inline as i, offset as o, shift as s };