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