bromcom-ui 2.8.0-rc.4 → 2.8.0-rc.6

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 (342) hide show
  1. package/dist/bromcom-ui/bromcom-ui.css +1 -1
  2. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  3. package/dist/bromcom-ui/p-01a0a933.entry.js +5 -0
  4. package/dist/bromcom-ui/{p-70ca213d.entry.js → p-04d4c6e7.entry.js} +1 -1
  5. package/dist/bromcom-ui/{p-4b23f132.entry.js → p-0541edbf.entry.js} +1 -1
  6. package/dist/bromcom-ui/{p-e23bb883.entry.js → p-0557b296.entry.js} +1 -1
  7. package/dist/bromcom-ui/{p-416febed.entry.js → p-0a16fcfa.entry.js} +1 -1
  8. package/dist/bromcom-ui/{p-210a8642.entry.js → p-0b663779.entry.js} +1 -1
  9. package/dist/bromcom-ui/p-10699025.entry.js +5 -0
  10. package/dist/bromcom-ui/{p-88f62d13.entry.js → p-1263a567.entry.js} +1 -1
  11. package/dist/bromcom-ui/{p-5ff9d4f6.entry.js → p-141d380f.entry.js} +1 -1
  12. package/dist/bromcom-ui/{p-86e5ffe3.entry.js → p-14a0a646.entry.js} +1 -1
  13. package/dist/bromcom-ui/{p-dbeb843a.entry.js → p-1a2c869c.entry.js} +1 -1
  14. package/dist/bromcom-ui/{p-3a75047e.entry.js → p-1e264881.entry.js} +1 -1
  15. package/dist/bromcom-ui/p-1ebf2c97.entry.js +5 -0
  16. package/dist/bromcom-ui/p-2179cbce.entry.js +10 -0
  17. package/dist/bromcom-ui/{p-d52e3a0a.entry.js → p-221448f8.entry.js} +1 -1
  18. package/dist/bromcom-ui/{p-3b31b8c4.entry.js → p-249f149d.entry.js} +1 -1
  19. package/dist/bromcom-ui/p-24aefda6.js +5 -0
  20. package/dist/bromcom-ui/{p-ebc810e1.entry.js → p-24ba1573.entry.js} +1 -1
  21. package/dist/bromcom-ui/{p-b81a4068.entry.js → p-262da209.entry.js} +1 -1
  22. package/dist/bromcom-ui/{p-f75f481a.entry.js → p-2f7fb8dd.entry.js} +1 -1
  23. package/dist/bromcom-ui/{p-2358bca8.entry.js → p-31226526.entry.js} +1 -1
  24. package/dist/bromcom-ui/p-31bb9db5.js +5 -0
  25. package/dist/bromcom-ui/{p-cd1cd1e5.entry.js → p-33dfaba1.entry.js} +1 -1
  26. package/dist/bromcom-ui/{p-77312b64.entry.js → p-39eda493.entry.js} +1 -1
  27. package/dist/bromcom-ui/{p-a46f0626.entry.js → p-3ad01bf4.entry.js} +1 -1
  28. package/dist/bromcom-ui/p-3db8f91e.js +5 -0
  29. package/dist/bromcom-ui/{p-dfe8e354.entry.js → p-4fcf03c1.entry.js} +1 -1
  30. package/dist/bromcom-ui/{p-0bcc14f8.entry.js → p-4fd8b48e.entry.js} +1 -1
  31. package/dist/bromcom-ui/{p-7f6736c8.entry.js → p-533cb826.entry.js} +1 -1
  32. package/dist/bromcom-ui/{p-c7f33aa3.entry.js → p-538c87d2.entry.js} +1 -1
  33. package/dist/bromcom-ui/{p-3c690e56.entry.js → p-58651d85.entry.js} +1 -1
  34. package/dist/bromcom-ui/{p-7f5409c2.entry.js → p-59e12dad.entry.js} +1 -1
  35. package/dist/bromcom-ui/{p-dc584fdd.entry.js → p-5d172f7d.entry.js} +1 -1
  36. package/dist/bromcom-ui/{p-65ab8436.entry.js → p-5df785a3.entry.js} +1 -1
  37. package/dist/bromcom-ui/{p-4a4562f5.js → p-60f7ae5d.js} +1 -1
  38. package/dist/bromcom-ui/p-617f4eb2.entry.js +5 -0
  39. package/dist/bromcom-ui/{p-b8d849a2.entry.js → p-67d3d8c6.entry.js} +1 -1
  40. package/dist/bromcom-ui/{p-1ca72216.entry.js → p-68185d36.entry.js} +1 -1
  41. package/dist/bromcom-ui/p-692a0269.js +5 -0
  42. package/dist/bromcom-ui/{p-a7cedfe6.entry.js → p-6b7a9d96.entry.js} +1 -1
  43. package/dist/bromcom-ui/p-6cc73d59.entry.js +5 -0
  44. package/dist/bromcom-ui/{p-ddb38da3.entry.js → p-6f27cf6d.entry.js} +1 -1
  45. package/dist/bromcom-ui/{p-3beac7a6.entry.js → p-74dd5f31.entry.js} +1 -1
  46. package/dist/bromcom-ui/{p-597be152.entry.js → p-75fa262b.entry.js} +1 -1
  47. package/dist/bromcom-ui/{p-56bb19ef.js → p-76358e74.js} +1 -1
  48. package/dist/bromcom-ui/{p-9e41c7f1.entry.js → p-79117799.entry.js} +1 -1
  49. package/dist/bromcom-ui/p-79fd816c.js +5 -0
  50. package/dist/bromcom-ui/{p-43c5f3c3.entry.js → p-7cff3fa9.entry.js} +1 -1
  51. package/dist/bromcom-ui/p-84c513eb.entry.js +5 -0
  52. package/dist/bromcom-ui/p-889a1255.entry.js +5 -0
  53. package/dist/bromcom-ui/{p-2c9d1709.entry.js → p-88ace511.entry.js} +1 -1
  54. package/dist/bromcom-ui/{p-9c970a65.entry.js → p-8afc794d.entry.js} +1 -1
  55. package/dist/bromcom-ui/{p-16b50160.js → p-8d0ca8c2.js} +1 -1
  56. package/dist/bromcom-ui/{p-2623b84a.entry.js → p-8e2540d8.entry.js} +1 -1
  57. package/dist/bromcom-ui/{p-81cfc9bf.entry.js → p-8fc1e2b0.entry.js} +1 -1
  58. package/dist/bromcom-ui/{p-d723d8e8.entry.js → p-9155ca09.entry.js} +1 -1
  59. package/dist/bromcom-ui/{p-9c5c74d6.entry.js → p-976f682f.entry.js} +1 -1
  60. package/dist/bromcom-ui/{p-25e8759d.entry.js → p-97933e31.entry.js} +1 -1
  61. package/dist/bromcom-ui/{p-0cb89561.entry.js → p-998f305e.entry.js} +1 -1
  62. package/dist/bromcom-ui/{p-66a9de7c.entry.js → p-a176cebc.entry.js} +1 -1
  63. package/dist/bromcom-ui/{p-21636df0.entry.js → p-a51a8010.entry.js} +1 -1
  64. package/dist/bromcom-ui/{p-74595a06.js → p-a60a2dd0.js} +1 -1
  65. package/dist/bromcom-ui/{p-c793cfcd.entry.js → p-b16f3edd.entry.js} +1 -1
  66. package/dist/bromcom-ui/{p-64c7173a.entry.js → p-b5d1ddf9.entry.js} +1 -1
  67. package/dist/bromcom-ui/p-b60bcecf.js +5 -0
  68. package/dist/bromcom-ui/{p-ab830de6.entry.js → p-b8fe88df.entry.js} +1 -1
  69. package/dist/bromcom-ui/{p-6cc1927f.entry.js → p-ba5686e2.entry.js} +1 -1
  70. package/dist/bromcom-ui/{p-3d4897d8.entry.js → p-bc840f30.entry.js} +1 -1
  71. package/dist/bromcom-ui/{p-c3dcd469.entry.js → p-bc97278b.entry.js} +1 -1
  72. package/dist/bromcom-ui/{p-ef0a59b6.js → p-c23b6240.js} +1 -1
  73. package/dist/bromcom-ui/{p-1cd1623f.entry.js → p-c36c80f8.entry.js} +1 -1
  74. package/dist/bromcom-ui/p-c4cdcb75.entry.js +5 -0
  75. package/dist/bromcom-ui/{p-ae1107ad.js → p-c682622d.js} +1 -1
  76. package/dist/bromcom-ui/{p-920fdcd8.entry.js → p-c85b8abc.entry.js} +1 -1
  77. package/dist/bromcom-ui/{p-5963e647.entry.js → p-c85d5bb2.entry.js} +1 -1
  78. package/dist/bromcom-ui/p-c8e13fd7.js +5 -0
  79. package/dist/bromcom-ui/{p-4a172a33.entry.js → p-c9707add.entry.js} +1 -1
  80. package/dist/bromcom-ui/{p-7c510c8f.entry.js → p-cdb04058.entry.js} +1 -1
  81. package/dist/bromcom-ui/{p-4260353d.entry.js → p-d644b6d9.entry.js} +1 -1
  82. package/dist/bromcom-ui/p-d65a1e21.js +11 -0
  83. package/dist/bromcom-ui/{p-5c6f941e.entry.js → p-d96c04f0.entry.js} +1 -1
  84. package/dist/bromcom-ui/p-da1055cb.js +6 -0
  85. package/dist/bromcom-ui/{p-45f6c93b.js → p-dbc4c30c.js} +1 -1
  86. package/dist/bromcom-ui/p-e16ff3f3.entry.js +5 -0
  87. package/dist/bromcom-ui/{p-9141db41.entry.js → p-e19e9dc1.entry.js} +1 -1
  88. package/dist/bromcom-ui/{p-2d7300b3.js → p-e741d71e.js} +1 -1
  89. package/dist/bromcom-ui/{p-59ee0928.js → p-ea6b1764.js} +1 -1
  90. package/dist/bromcom-ui/p-eb5b09a1.js +5 -0
  91. package/dist/bromcom-ui/{p-ab8bc270.entry.js → p-eb7da19e.entry.js} +1 -1
  92. package/dist/bromcom-ui/{p-a4c5cbd8.entry.js → p-eb89054e.entry.js} +1 -1
  93. package/dist/bromcom-ui/{p-6708a234.entry.js → p-ed6c561a.entry.js} +1 -1
  94. package/dist/bromcom-ui/{p-8dbcd26b.entry.js → p-f27bb138.entry.js} +1 -1
  95. package/dist/bromcom-ui/{p-9b723535.entry.js → p-f529ded0.entry.js} +1 -1
  96. package/dist/bromcom-ui/{p-97df9122.entry.js → p-f8c20298.entry.js} +1 -1
  97. package/dist/bromcom-ui/{p-136aeeea.entry.js → p-f9c235f9.entry.js} +1 -1
  98. package/dist/bromcom-ui/{p-6808ca09.entry.js → p-ff1acc28.entry.js} +1 -1
  99. package/dist/cjs/bcm-accordion.cjs.entry.js +4 -4
  100. package/dist/cjs/bcm-alert.cjs.entry.js +7 -7
  101. package/dist/cjs/bcm-attendance.cjs.entry.js +4 -4
  102. package/dist/cjs/bcm-autocomplete.cjs.entry.js +3 -3
  103. package/dist/cjs/bcm-avatar_2.cjs.entry.js +10 -10
  104. package/dist/cjs/bcm-box.cjs.entry.js +2 -2
  105. package/dist/cjs/bcm-breadcrumb.cjs.entry.js +5 -5
  106. package/dist/cjs/bcm-button-group.cjs.entry.js +6 -6
  107. package/dist/cjs/bcm-button.cjs.entry.js +9 -9
  108. package/dist/cjs/bcm-card.cjs.entry.js +8 -8
  109. package/dist/cjs/bcm-checkbox-group.cjs.entry.js +9 -9
  110. package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +5 -5
  111. package/dist/cjs/bcm-checkbox_2.cjs.entry.js +9 -9
  112. package/dist/cjs/bcm-chip.cjs.entry.js +6 -6
  113. package/dist/cjs/bcm-collapse-group.cjs.entry.js +2 -2
  114. package/dist/cjs/bcm-collapse.cjs.entry.js +5 -5
  115. package/dist/cjs/bcm-color-input.cjs.entry.js +7 -7
  116. package/dist/cjs/bcm-colorful_2.cjs.entry.js +44 -14
  117. package/dist/cjs/bcm-colorpicker.cjs.entry.js +3 -3
  118. package/dist/cjs/bcm-date-picker.cjs.entry.js +5 -5
  119. package/dist/cjs/bcm-datetime-picker.cjs.entry.js +9 -9
  120. package/dist/cjs/bcm-default.cjs.entry.js +4 -4
  121. package/dist/cjs/bcm-drawer.cjs.entry.js +9 -9
  122. package/dist/cjs/bcm-dropdown.cjs.entry.js +6 -6
  123. package/dist/cjs/bcm-error-layout.cjs.entry.js +3 -3
  124. package/dist/cjs/bcm-expansion-panel.cjs.entry.js +7 -7
  125. package/dist/cjs/bcm-form-2.cjs.entry.js +5 -5
  126. package/dist/cjs/bcm-form-group.cjs.entry.js +2 -2
  127. package/dist/cjs/bcm-form.cjs.entry.js +4 -4
  128. package/dist/cjs/bcm-icon.cjs.entry.js +2 -2
  129. package/dist/cjs/bcm-input-custom.cjs.entry.js +5 -5
  130. package/dist/cjs/bcm-input.cjs.entry.js +10 -10
  131. package/dist/cjs/bcm-item.cjs.entry.js +6 -6
  132. package/dist/cjs/bcm-items.cjs.entry.js +5 -5
  133. package/dist/cjs/bcm-label_2.cjs.entry.js +13 -13
  134. package/dist/cjs/bcm-link.cjs.entry.js +3 -3
  135. package/dist/cjs/bcm-list.cjs.entry.js +17 -17
  136. package/dist/cjs/bcm-menu.cjs.entry.js +11 -11
  137. package/dist/cjs/bcm-message.cjs.entry.js +3 -3
  138. package/dist/cjs/bcm-modal.cjs.entry.js +7 -7
  139. package/dist/cjs/bcm-notification.cjs.entry.js +3 -3
  140. package/dist/cjs/bcm-old-input.cjs.entry.js +4 -4
  141. package/dist/cjs/bcm-old-tag_2.cjs.entry.js +3 -3
  142. package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +8 -8
  143. package/dist/cjs/bcm-popconfirm.cjs.entry.js +5 -5
  144. package/dist/cjs/bcm-popover.cjs.entry.js +9 -9
  145. package/dist/cjs/bcm-progress.cjs.entry.js +6 -6
  146. package/dist/cjs/bcm-radio-group.cjs.entry.js +10 -10
  147. package/dist/cjs/bcm-radio.cjs.entry.js +8 -8
  148. package/dist/cjs/bcm-range.cjs.entry.js +5 -5
  149. package/dist/cjs/bcm-result.cjs.entry.js +3 -3
  150. package/dist/cjs/bcm-search.cjs.entry.js +8 -8
  151. package/dist/cjs/bcm-select-group.cjs.entry.js +2 -2
  152. package/dist/cjs/bcm-select-option.cjs.entry.js +2 -2
  153. package/dist/cjs/bcm-select.cjs.entry.js +4 -4
  154. package/dist/cjs/bcm-skeleton.cjs.entry.js +4 -4
  155. package/dist/cjs/bcm-step.cjs.entry.js +7 -7
  156. package/dist/cjs/bcm-stepper.cjs.entry.js +33 -43
  157. package/dist/cjs/bcm-switch.cjs.entry.js +6 -6
  158. package/dist/cjs/bcm-tab-group.cjs.entry.js +87 -31
  159. package/dist/cjs/bcm-tab-item-header.cjs.entry.js +9 -9
  160. package/dist/cjs/bcm-tab-item.cjs.entry.js +8 -8
  161. package/dist/cjs/bcm-tab-pane.cjs.entry.js +3 -3
  162. package/dist/cjs/bcm-tab.cjs.entry.js +3 -3
  163. package/dist/cjs/bcm-table.cjs.entry.js +2 -2
  164. package/dist/cjs/bcm-tabs-content.cjs.entry.js +3 -3
  165. package/dist/cjs/bcm-tabs.cjs.entry.js +3 -3
  166. package/dist/cjs/bcm-tag.cjs.entry.js +6 -6
  167. package/dist/cjs/bcm-text.cjs.entry.js +7 -7
  168. package/dist/cjs/bcm-textarea.cjs.entry.js +7 -7
  169. package/dist/cjs/bcm-time-picker.cjs.entry.js +5 -5
  170. package/dist/cjs/bcm-timeline-item.cjs.entry.js +3 -3
  171. package/dist/cjs/bcm-timeline.cjs.entry.js +3 -3
  172. package/dist/cjs/bcm-toast.cjs.entry.js +6 -6
  173. package/dist/cjs/bcm-treeview-group.cjs.entry.js +1 -1
  174. package/dist/cjs/bromcom-ui.cjs.js +7 -3
  175. package/dist/cjs/{caption-template-de4a0064.js → caption-template-8d099fd6.js} +2 -2
  176. package/dist/cjs/{color-helper-09aa652d.js → color-helper-0097a7c2.js} +1 -1
  177. package/dist/cjs/{colors-7cc2aee2.js → colors-43b24668.js} +45 -23
  178. package/dist/cjs/{floating-ui-c23acc6c.js → floating-ui-74eb26d6.js} +592 -542
  179. package/dist/cjs/{generate-44bb438e.js → generate-5d859f16.js} +2 -2
  180. package/dist/cjs/{index-56628fe5.js → index-4506fcd7.js} +1 -1
  181. package/dist/cjs/{index-7e2a5376.js → index-ddfd6d8f.js} +111 -2
  182. package/dist/cjs/{index-a2b50e51.js → index-fdbf5226.js} +11 -10
  183. package/dist/cjs/{input-template-6b354df9.js → input-template-4b1d9f28.js} +3 -3
  184. package/dist/cjs/{is-load-decorator-faac117d.js → is-load-decorator-137dded1.js} +1 -1
  185. package/dist/cjs/{json-parse-decarator-22ab54f7.js → json-parse-decarator-79fa9387.js} +2 -2
  186. package/dist/cjs/{label-template-098a30a4.js → label-template-cc69bc21.js} +3 -3
  187. package/dist/cjs/loader.cjs.js +4 -3
  188. package/dist/cjs/{number-helper-72b20785.js → number-helper-038de3fb.js} +1 -1
  189. package/dist/cjs/old-bcm-popover-box.cjs.entry.js +9 -9
  190. package/dist/cjs/old-bcm-popover.cjs.entry.js +5 -5
  191. package/dist/cjs/{popover-placement-69d37a5f.js → popover-placement-3c8f3a72.js} +1 -1
  192. package/dist/cjs/{slot-template-7a07f865.js → slot-template-3e59d7d8.js} +2 -2
  193. package/dist/cjs/{stepper-states-6892694b.js → stepper-states-23d4c730.js} +3 -3
  194. package/dist/cjs/{string-helper-71b10c53.js → string-helper-45cffee0.js} +4 -4
  195. package/dist/cjs/{tooltip-helper-6d6407d1.js → tooltip-helper-434735c4.js} +6 -6
  196. package/dist/cjs/{validators-cce37534.js → validators-412368c6.js} +1 -1
  197. package/dist/collection/collection-manifest.json +2 -2
  198. package/dist/collection/components/atoms/button/button.js +1 -1
  199. package/dist/collection/components/molecules/dropdown/dropdown.js +1 -1
  200. package/dist/collection/components/molecules/linked/linked.js +44 -7
  201. package/dist/collection/components/molecules/stepper/stepper.js +29 -42
  202. package/dist/collection/components/molecules/tab-group/tab-group.js +89 -24
  203. package/dist/collection/components/molecules/tab-group/tab-item.js +2 -2
  204. package/dist/components/bcm-stepper.js +25 -35
  205. package/dist/components/bcm-tab-group.js +80 -24
  206. package/dist/components/bcm-tab-item.js +1 -1
  207. package/dist/components/colors2.js +45 -23
  208. package/dist/components/floating-ui.js +592 -542
  209. package/dist/components/generate.js +1 -1
  210. package/dist/components/index.d.ts +9 -0
  211. package/dist/components/index.js +1 -1
  212. package/dist/components/index2.js +11 -10
  213. package/dist/components/linked.js +40 -9
  214. package/dist/components/string-helper.js +4 -4
  215. package/dist/esm/bcm-accordion.entry.js +4 -4
  216. package/dist/esm/bcm-alert.entry.js +7 -7
  217. package/dist/esm/bcm-attendance.entry.js +4 -4
  218. package/dist/esm/bcm-autocomplete.entry.js +3 -3
  219. package/dist/esm/bcm-avatar_2.entry.js +10 -10
  220. package/dist/esm/bcm-box.entry.js +2 -2
  221. package/dist/esm/bcm-breadcrumb.entry.js +5 -5
  222. package/dist/esm/bcm-button-group.entry.js +6 -6
  223. package/dist/esm/bcm-button.entry.js +9 -9
  224. package/dist/esm/bcm-card.entry.js +8 -8
  225. package/dist/esm/bcm-checkbox-group.entry.js +9 -9
  226. package/dist/esm/bcm-checkbox-lite_9.entry.js +5 -5
  227. package/dist/esm/bcm-checkbox_2.entry.js +9 -9
  228. package/dist/esm/bcm-chip.entry.js +6 -6
  229. package/dist/esm/bcm-collapse-group.entry.js +2 -2
  230. package/dist/esm/bcm-collapse.entry.js +5 -5
  231. package/dist/esm/bcm-color-input.entry.js +7 -7
  232. package/dist/esm/bcm-colorful_2.entry.js +44 -14
  233. package/dist/esm/bcm-colorpicker.entry.js +3 -3
  234. package/dist/esm/bcm-date-picker.entry.js +5 -5
  235. package/dist/esm/bcm-datetime-picker.entry.js +9 -9
  236. package/dist/esm/bcm-default.entry.js +4 -4
  237. package/dist/esm/bcm-drawer.entry.js +9 -9
  238. package/dist/esm/bcm-dropdown.entry.js +6 -6
  239. package/dist/esm/bcm-error-layout.entry.js +3 -3
  240. package/dist/esm/bcm-expansion-panel.entry.js +7 -7
  241. package/dist/esm/bcm-form-2.entry.js +5 -5
  242. package/dist/esm/bcm-form-group.entry.js +2 -2
  243. package/dist/esm/bcm-form.entry.js +4 -4
  244. package/dist/esm/bcm-icon.entry.js +2 -2
  245. package/dist/esm/bcm-input-custom.entry.js +5 -5
  246. package/dist/esm/bcm-input.entry.js +10 -10
  247. package/dist/esm/bcm-item.entry.js +6 -6
  248. package/dist/esm/bcm-items.entry.js +5 -5
  249. package/dist/esm/bcm-label_2.entry.js +13 -13
  250. package/dist/esm/bcm-link.entry.js +3 -3
  251. package/dist/esm/bcm-list.entry.js +17 -17
  252. package/dist/esm/bcm-menu.entry.js +11 -11
  253. package/dist/esm/bcm-message.entry.js +3 -3
  254. package/dist/esm/bcm-modal.entry.js +7 -7
  255. package/dist/esm/bcm-notification.entry.js +3 -3
  256. package/dist/esm/bcm-old-input.entry.js +4 -4
  257. package/dist/esm/bcm-old-tag_2.entry.js +3 -3
  258. package/dist/esm/bcm-popconfirm-box.entry.js +8 -8
  259. package/dist/esm/bcm-popconfirm.entry.js +5 -5
  260. package/dist/esm/bcm-popover.entry.js +9 -9
  261. package/dist/esm/bcm-progress.entry.js +6 -6
  262. package/dist/esm/bcm-radio-group.entry.js +10 -10
  263. package/dist/esm/bcm-radio.entry.js +8 -8
  264. package/dist/esm/bcm-range.entry.js +5 -5
  265. package/dist/esm/bcm-result.entry.js +3 -3
  266. package/dist/esm/bcm-search.entry.js +8 -8
  267. package/dist/esm/bcm-select-group.entry.js +2 -2
  268. package/dist/esm/bcm-select-option.entry.js +2 -2
  269. package/dist/esm/bcm-select.entry.js +4 -4
  270. package/dist/esm/bcm-skeleton.entry.js +4 -4
  271. package/dist/esm/bcm-step.entry.js +7 -7
  272. package/dist/esm/bcm-stepper.entry.js +34 -44
  273. package/dist/esm/bcm-switch.entry.js +6 -6
  274. package/dist/esm/bcm-tab-group.entry.js +87 -31
  275. package/dist/esm/bcm-tab-item-header.entry.js +9 -9
  276. package/dist/esm/bcm-tab-item.entry.js +8 -8
  277. package/dist/esm/bcm-tab-pane.entry.js +3 -3
  278. package/dist/esm/bcm-tab.entry.js +3 -3
  279. package/dist/esm/bcm-table.entry.js +2 -2
  280. package/dist/esm/bcm-tabs-content.entry.js +3 -3
  281. package/dist/esm/bcm-tabs.entry.js +3 -3
  282. package/dist/esm/bcm-tag.entry.js +6 -6
  283. package/dist/esm/bcm-text.entry.js +7 -7
  284. package/dist/esm/bcm-textarea.entry.js +7 -7
  285. package/dist/esm/bcm-time-picker.entry.js +5 -5
  286. package/dist/esm/bcm-timeline-item.entry.js +3 -3
  287. package/dist/esm/bcm-timeline.entry.js +3 -3
  288. package/dist/esm/bcm-toast.entry.js +6 -6
  289. package/dist/esm/bcm-treeview-group.entry.js +1 -1
  290. package/dist/esm/bromcom-ui.js +4 -3
  291. package/dist/esm/{caption-template-389f5bd6.js → caption-template-da16ba7b.js} +2 -2
  292. package/dist/esm/{color-helper-2b6697b6.js → color-helper-4fa5dd0d.js} +1 -1
  293. package/dist/esm/{colors-39b87f63.js → colors-fa05fe33.js} +45 -23
  294. package/dist/esm/{floating-ui-4a49ea46.js → floating-ui-e7341329.js} +592 -542
  295. package/dist/esm/{generate-42365155.js → generate-6c6d178a.js} +2 -2
  296. package/dist/esm/{index-6e2d80d7.js → index-39133086.js} +111 -3
  297. package/dist/esm/{index-8b349654.js → index-93e36fdb.js} +1 -1
  298. package/dist/esm/{index-ba2edd32.js → index-ed9652af.js} +11 -10
  299. package/dist/esm/{input-template-c035bb51.js → input-template-cdbd9d71.js} +3 -3
  300. package/dist/esm/{is-load-decorator-359a1080.js → is-load-decorator-bc14ec4b.js} +1 -1
  301. package/dist/esm/{json-parse-decarator-bfc50c70.js → json-parse-decarator-fb94a9f7.js} +2 -2
  302. package/dist/esm/{label-template-eed2dd69.js → label-template-d74fe788.js} +3 -3
  303. package/dist/esm/loader.js +4 -3
  304. package/dist/esm/{number-helper-6a09d08c.js → number-helper-3d45cd6b.js} +1 -1
  305. package/dist/esm/old-bcm-popover-box.entry.js +9 -9
  306. package/dist/esm/old-bcm-popover.entry.js +5 -5
  307. package/dist/esm/polyfills/css-shim.js +1 -1
  308. package/dist/esm/{popover-placement-4baf5f2f.js → popover-placement-78f86f15.js} +1 -1
  309. package/dist/esm/{slot-template-64b41ee5.js → slot-template-5b2db362.js} +2 -2
  310. package/dist/esm/{stepper-states-a0b074ca.js → stepper-states-9b3262ac.js} +3 -3
  311. package/dist/esm/{string-helper-0fb7ff20.js → string-helper-6bd24967.js} +4 -4
  312. package/dist/esm/{tooltip-helper-f4f3e26c.js → tooltip-helper-5bb91f74.js} +6 -6
  313. package/dist/esm/{validators-e2f24be7.js → validators-143e9133.js} +1 -1
  314. package/dist/types/components/molecules/linked/linked.d.ts +8 -2
  315. package/dist/types/components/molecules/stepper/stepper.d.ts +2 -2
  316. package/dist/types/components/molecules/tab-group/tab-group.d.ts +7 -1
  317. package/dist/types/components.d.ts +1 -1
  318. package/dist/types/stencil-public-runtime.d.ts +59 -3
  319. package/helper/index.js +1 -1
  320. package/helper/toast.js +1 -1
  321. package/loader/index.d.ts +9 -0
  322. package/package.json +10 -5
  323. package/dist/bromcom-ui/p-21ac8544.entry.js +0 -5
  324. package/dist/bromcom-ui/p-352b9ae6.entry.js +0 -5
  325. package/dist/bromcom-ui/p-4167e51c.js +0 -5
  326. package/dist/bromcom-ui/p-4487e8c2.js +0 -5
  327. package/dist/bromcom-ui/p-48e9166c.js +0 -5
  328. package/dist/bromcom-ui/p-4cc4f6cd.entry.js +0 -5
  329. package/dist/bromcom-ui/p-56898932.js +0 -5
  330. package/dist/bromcom-ui/p-56a9ce0a.js +0 -5
  331. package/dist/bromcom-ui/p-6b1bbd46.entry.js +0 -5
  332. package/dist/bromcom-ui/p-71930900.js +0 -5
  333. package/dist/bromcom-ui/p-7d0fb564.entry.js +0 -5
  334. package/dist/bromcom-ui/p-87cc3b5a.js +0 -5
  335. package/dist/bromcom-ui/p-88f7d869.js +0 -6
  336. package/dist/bromcom-ui/p-adbe308b.entry.js +0 -5
  337. package/dist/bromcom-ui/p-d5b08a77.js +0 -11
  338. package/dist/bromcom-ui/p-de954bc9.js +0 -5
  339. package/dist/bromcom-ui/p-e099ae93.entry.js +0 -5
  340. package/dist/bromcom-ui/p-e4bff61b.entry.js +0 -5
  341. package/dist/bromcom-ui/p-f75d23b0.entry.js +0 -5
  342. package/dist/bromcom-ui/p-fe684e3c.entry.js +0 -10
@@ -6,22 +6,22 @@
6
6
 
7
7
  const bcm = require('./bcm-634604e3.js');
8
8
 
9
- function getSide(placement) {
10
- return placement.split('-')[0];
11
- }
12
-
13
9
  function getAlignment(placement) {
14
10
  return placement.split('-')[1];
15
11
  }
16
12
 
17
- function getMainAxisFromPlacement(placement) {
18
- return ['top', 'bottom'].includes(getSide(placement)) ? 'x' : 'y';
19
- }
20
-
21
13
  function getLengthFromAxis(axis) {
22
14
  return axis === 'y' ? 'height' : 'width';
23
15
  }
24
16
 
17
+ function getSide(placement) {
18
+ return placement.split('-')[0];
19
+ }
20
+
21
+ function getMainAxisFromPlacement(placement) {
22
+ return ['top', 'bottom'].includes(getSide(placement)) ? 'x' : 'y';
23
+ }
24
+
25
25
  function computeCoordsFromPlacement(_ref, placement, rtl) {
26
26
  let {
27
27
  reference,
@@ -35,7 +35,6 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
35
35
  const side = getSide(placement);
36
36
  const isVertical = mainAxis === 'x';
37
37
  let coords;
38
-
39
38
  switch (side) {
40
39
  case 'top':
41
40
  coords = {
@@ -43,45 +42,38 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
43
42
  y: reference.y - floating.height
44
43
  };
45
44
  break;
46
-
47
45
  case 'bottom':
48
46
  coords = {
49
47
  x: commonX,
50
48
  y: reference.y + reference.height
51
49
  };
52
50
  break;
53
-
54
51
  case 'right':
55
52
  coords = {
56
53
  x: reference.x + reference.width,
57
54
  y: commonY
58
55
  };
59
56
  break;
60
-
61
57
  case 'left':
62
58
  coords = {
63
59
  x: reference.x - floating.width,
64
60
  y: commonY
65
61
  };
66
62
  break;
67
-
68
63
  default:
69
64
  coords = {
70
65
  x: reference.x,
71
66
  y: reference.y
72
67
  };
73
68
  }
74
-
75
69
  switch (getAlignment(placement)) {
76
70
  case 'start':
77
71
  coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
78
72
  break;
79
-
80
73
  case 'end':
81
74
  coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
82
75
  break;
83
76
  }
84
-
85
77
  return coords;
86
78
  }
87
79
 
@@ -92,7 +84,6 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
92
84
  * This export does not have any `platform` interface logic. You will need to
93
85
  * write one for the platform you are using Floating UI with.
94
86
  */
95
-
96
87
  const computePosition$1 = async (reference, floating, config) => {
97
88
  const {
98
89
  placement = 'bottom',
@@ -100,8 +91,8 @@ const computePosition$1 = async (reference, floating, config) => {
100
91
  middleware = [],
101
92
  platform
102
93
  } = config;
94
+ const validMiddleware = middleware.filter(Boolean);
103
95
  const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
104
-
105
96
  let rects = await platform.getElementRects({
106
97
  reference,
107
98
  floating,
@@ -114,12 +105,11 @@ const computePosition$1 = async (reference, floating, config) => {
114
105
  let statefulPlacement = placement;
115
106
  let middlewareData = {};
116
107
  let resetCount = 0;
117
-
118
- for (let i = 0; i < middleware.length; i++) {
108
+ for (let i = 0; i < validMiddleware.length; i++) {
119
109
  const {
120
110
  name,
121
111
  fn
122
- } = middleware[i];
112
+ } = validMiddleware[i];
123
113
  const {
124
114
  x: nextX,
125
115
  y: nextY,
@@ -141,20 +131,19 @@ const computePosition$1 = async (reference, floating, config) => {
141
131
  });
142
132
  x = nextX != null ? nextX : x;
143
133
  y = nextY != null ? nextY : y;
144
- middlewareData = { ...middlewareData,
145
- [name]: { ...middlewareData[name],
134
+ middlewareData = {
135
+ ...middlewareData,
136
+ [name]: {
137
+ ...middlewareData[name],
146
138
  ...data
147
139
  }
148
140
  };
149
-
150
141
  if (reset && resetCount <= 50) {
151
142
  resetCount++;
152
-
153
143
  if (typeof reset === 'object') {
154
144
  if (reset.placement) {
155
145
  statefulPlacement = reset.placement;
156
146
  }
157
-
158
147
  if (reset.rects) {
159
148
  rects = reset.rects === true ? await platform.getElementRects({
160
149
  reference,
@@ -162,18 +151,15 @@ const computePosition$1 = async (reference, floating, config) => {
162
151
  strategy
163
152
  }) : reset.rects;
164
153
  }
165
-
166
154
  ({
167
155
  x,
168
156
  y
169
157
  } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
170
158
  }
171
-
172
159
  i = -1;
173
160
  continue;
174
161
  }
175
162
  }
176
-
177
163
  return {
178
164
  x,
179
165
  y,
@@ -203,7 +189,8 @@ function getSideObjectFromPadding(padding) {
203
189
  }
204
190
 
205
191
  function rectToClientRect(rect) {
206
- return { ...rect,
192
+ return {
193
+ ...rect,
207
194
  top: rect.y,
208
195
  left: rect.x,
209
196
  right: rect.x + rect.width,
@@ -213,19 +200,17 @@ function rectToClientRect(rect) {
213
200
 
214
201
  /**
215
202
  * Resolves with an object of overflow side offsets that determine how much the
216
- * element is overflowing a given clipping boundary.
203
+ * element is overflowing a given clipping boundary on each side.
217
204
  * - positive = overflowing the boundary by that number of pixels
218
205
  * - negative = how many pixels left before it will overflow
219
206
  * - 0 = lies flush with the boundary
220
207
  * @see https://floating-ui.com/docs/detectOverflow
221
208
  */
222
- async function detectOverflow(middlewareArguments, options) {
209
+ async function detectOverflow(state, options) {
223
210
  var _await$platform$isEle;
224
-
225
211
  if (options === void 0) {
226
212
  options = {};
227
213
  }
228
-
229
214
  const {
230
215
  x,
231
216
  y,
@@ -233,7 +218,7 @@ async function detectOverflow(middlewareArguments, options) {
233
218
  rects,
234
219
  elements,
235
220
  strategy
236
- } = middlewareArguments;
221
+ } = state;
237
222
  const {
238
223
  boundary = 'clippingAncestors',
239
224
  rootBoundary = 'viewport',
@@ -250,19 +235,29 @@ async function detectOverflow(middlewareArguments, options) {
250
235
  rootBoundary,
251
236
  strategy
252
237
  }));
238
+ const rect = elementContext === 'floating' ? {
239
+ ...rects.floating,
240
+ x,
241
+ y
242
+ } : rects.reference;
243
+ const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
244
+ const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
245
+ x: 1,
246
+ y: 1
247
+ } : {
248
+ x: 1,
249
+ y: 1
250
+ };
253
251
  const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
254
- rect: elementContext === 'floating' ? { ...rects.floating,
255
- x,
256
- y
257
- } : rects.reference,
258
- offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
252
+ rect,
253
+ offsetParent,
259
254
  strategy
260
- }) : rects[elementContext]);
255
+ }) : rect);
261
256
  return {
262
- top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
263
- bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
264
- left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
265
- right: elementClientRect.right - clippingClientRect.right + paddingObject.right
257
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
258
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
259
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
260
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
266
261
  };
267
262
  }
268
263
 
@@ -274,63 +269,65 @@ function within(min$1$1, value, max$1$1) {
274
269
  }
275
270
 
276
271
  /**
277
- * Positions an inner element of the floating element such that it is centered
278
- * to the reference element.
272
+ * Provides data to position an inner element of the floating element so that it
273
+ * appears centered to the reference element.
279
274
  * @see https://floating-ui.com/docs/arrow
280
275
  */
281
276
  const arrow = options => ({
282
277
  name: 'arrow',
283
278
  options,
284
-
285
- async fn(middlewareArguments) {
286
- // Since `element` is required, we don't Partial<> the type
279
+ async fn(state) {
280
+ // Since `element` is required, we don't Partial<> the type.
287
281
  const {
288
282
  element,
289
283
  padding = 0
290
- } = options != null ? options : {};
284
+ } = options || {};
291
285
  const {
292
286
  x,
293
287
  y,
294
288
  placement,
295
289
  rects,
296
- platform
297
- } = middlewareArguments;
298
-
290
+ platform,
291
+ elements
292
+ } = state;
299
293
  if (element == null) {
300
-
301
294
  return {};
302
295
  }
303
-
304
296
  const paddingObject = getSideObjectFromPadding(padding);
305
297
  const coords = {
306
298
  x,
307
299
  y
308
300
  };
309
301
  const axis = getMainAxisFromPlacement(placement);
310
- const alignment = getAlignment(placement);
311
302
  const length = getLengthFromAxis(axis);
312
303
  const arrowDimensions = await platform.getDimensions(element);
313
- const minProp = axis === 'y' ? 'top' : 'left';
314
- const maxProp = axis === 'y' ? 'bottom' : 'right';
304
+ const isYAxis = axis === 'y';
305
+ const minProp = isYAxis ? 'top' : 'left';
306
+ const maxProp = isYAxis ? 'bottom' : 'right';
307
+ const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
315
308
  const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
316
309
  const startDiff = coords[axis] - rects.reference[axis];
317
310
  const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
318
- let clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
311
+ let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
319
312
 
320
- if (clientSize === 0) {
321
- clientSize = rects.floating[length];
313
+ // DOM platform can return `window` as the `offsetParent`.
314
+ if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
315
+ clientSize = elements.floating[clientProp] || rects.floating[length];
322
316
  }
317
+ const centerToReference = endDiff / 2 - startDiff / 2;
323
318
 
324
- const centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the floating element if the center
325
- // point is outside the floating element's bounds
326
-
319
+ // Make sure the arrow doesn't overflow the floating element if the center
320
+ // point is outside the floating element's bounds.
327
321
  const min = paddingObject[minProp];
328
322
  const max = clientSize - arrowDimensions[length] - paddingObject[maxProp];
329
323
  const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
330
- const offset = within(min, center, max); // Make sure that arrow points at the reference
324
+ const offset = within(min, center, max);
331
325
 
332
- const alignmentPadding = alignment === 'start' ? paddingObject[minProp] : paddingObject[maxProp];
333
- const shouldAddOffset = alignmentPadding > 0 && center !== offset && rects.reference[length] <= rects.floating[length];
326
+ // If the reference is small enough that the arrow's padding causes it to
327
+ // to point to nothing for an aligned placement, adjust the offset of the
328
+ // floating element itself. This stops `shift()` from taking action, but can
329
+ // be worked around by calling it again after the `arrow()` if desired.
330
+ const shouldAddOffset = getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min ? paddingObject[minProp] : paddingObject[maxProp]) - arrowDimensions[length] / 2 < 0;
334
331
  const alignmentOffset = shouldAddOffset ? center < min ? min - center : max - center : 0;
335
332
  return {
336
333
  [axis]: coords[axis] - alignmentOffset,
@@ -340,71 +337,94 @@ const arrow = options => ({
340
337
  }
341
338
  };
342
339
  }
343
-
344
340
  });
345
341
 
346
- const hash$1 = {
342
+ const sides = ['top', 'right', 'bottom', 'left'];
343
+
344
+ const oppositeSideMap = {
347
345
  left: 'right',
348
346
  right: 'left',
349
347
  bottom: 'top',
350
348
  top: 'bottom'
351
349
  };
352
350
  function getOppositePlacement(placement) {
353
- return placement.replace(/left|right|bottom|top/g, matched => hash$1[matched]);
351
+ return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
354
352
  }
355
353
 
356
354
  function getAlignmentSides(placement, rects, rtl) {
357
355
  if (rtl === void 0) {
358
356
  rtl = false;
359
357
  }
360
-
361
358
  const alignment = getAlignment(placement);
362
359
  const mainAxis = getMainAxisFromPlacement(placement);
363
360
  const length = getLengthFromAxis(mainAxis);
364
361
  let mainAlignmentSide = mainAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
365
-
366
362
  if (rects.reference[length] > rects.floating[length]) {
367
363
  mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
368
364
  }
369
-
370
365
  return {
371
366
  main: mainAlignmentSide,
372
367
  cross: getOppositePlacement(mainAlignmentSide)
373
368
  };
374
369
  }
375
370
 
376
- const hash = {
371
+ const oppositeAlignmentMap = {
377
372
  start: 'end',
378
373
  end: 'start'
379
374
  };
380
375
  function getOppositeAlignmentPlacement(placement) {
381
- return placement.replace(/start|end/g, matched => hash[matched]);
376
+ return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
382
377
  }
383
378
 
384
- const sides = ['top', 'right', 'bottom', 'left'];
385
-
386
379
  function getExpandedPlacements(placement) {
387
380
  const oppositePlacement = getOppositePlacement(placement);
388
381
  return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
389
382
  }
390
383
 
384
+ function getSideList(side, isStart, rtl) {
385
+ const lr = ['left', 'right'];
386
+ const rl = ['right', 'left'];
387
+ const tb = ['top', 'bottom'];
388
+ const bt = ['bottom', 'top'];
389
+ switch (side) {
390
+ case 'top':
391
+ case 'bottom':
392
+ if (rtl) return isStart ? rl : lr;
393
+ return isStart ? lr : rl;
394
+ case 'left':
395
+ case 'right':
396
+ return isStart ? tb : bt;
397
+ default:
398
+ return [];
399
+ }
400
+ }
401
+ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
402
+ const alignment = getAlignment(placement);
403
+ let list = getSideList(getSide(placement), direction === 'start', rtl);
404
+ if (alignment) {
405
+ list = list.map(side => side + "-" + alignment);
406
+ if (flipAlignment) {
407
+ list = list.concat(list.map(getOppositeAlignmentPlacement));
408
+ }
409
+ }
410
+ return list;
411
+ }
412
+
391
413
  /**
392
- * Changes the placement of the floating element to one that will fit if the
393
- * initially specified `placement` does not.
414
+ * Optimizes the visibility of the floating element by flipping the `placement`
415
+ * in order to keep it in view when the preferred placement(s) will overflow the
416
+ * clipping boundary. Alternative to `autoPlacement`.
394
417
  * @see https://floating-ui.com/docs/flip
395
418
  */
396
419
  const flip = function (options) {
397
420
  if (options === void 0) {
398
421
  options = {};
399
422
  }
400
-
401
423
  return {
402
424
  name: 'flip',
403
425
  options,
404
-
405
- async fn(middlewareArguments) {
426
+ async fn(state) {
406
427
  var _middlewareData$flip;
407
-
408
428
  const {
409
429
  placement,
410
430
  middlewareData,
@@ -412,48 +432,49 @@ const flip = function (options) {
412
432
  initialPlacement,
413
433
  platform,
414
434
  elements
415
- } = middlewareArguments;
435
+ } = state;
416
436
  const {
417
437
  mainAxis: checkMainAxis = true,
418
438
  crossAxis: checkCrossAxis = true,
419
439
  fallbackPlacements: specifiedFallbackPlacements,
420
440
  fallbackStrategy = 'bestFit',
441
+ fallbackAxisSideDirection = 'none',
421
442
  flipAlignment = true,
422
443
  ...detectOverflowOptions
423
444
  } = options;
424
445
  const side = getSide(placement);
425
- const isBasePlacement = side === initialPlacement;
446
+ const isBasePlacement = getSide(initialPlacement) === initialPlacement;
447
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
426
448
  const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
449
+ if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
450
+ fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
451
+ }
427
452
  const placements = [initialPlacement, ...fallbackPlacements];
428
- const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
453
+ const overflow = await detectOverflow(state, detectOverflowOptions);
429
454
  const overflows = [];
430
455
  let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
431
-
432
456
  if (checkMainAxis) {
433
457
  overflows.push(overflow[side]);
434
458
  }
435
-
436
459
  if (checkCrossAxis) {
437
460
  const {
438
461
  main,
439
462
  cross
440
- } = getAlignmentSides(placement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
463
+ } = getAlignmentSides(placement, rects, rtl);
441
464
  overflows.push(overflow[main], overflow[cross]);
442
465
  }
443
-
444
466
  overflowsData = [...overflowsData, {
445
467
  placement,
446
468
  overflows
447
- }]; // One or more sides is overflowing
469
+ }];
448
470
 
471
+ // One or more sides is overflowing.
449
472
  if (!overflows.every(side => side <= 0)) {
450
- var _middlewareData$flip$, _middlewareData$flip2;
451
-
452
- const nextIndex = ((_middlewareData$flip$ = (_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) != null ? _middlewareData$flip$ : 0) + 1;
473
+ var _middlewareData$flip2, _overflowsData$filter;
474
+ const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
453
475
  const nextPlacement = placements[nextIndex];
454
-
455
476
  if (nextPlacement) {
456
- // Try next placement and re-run the lifecycle
477
+ // Try next placement and re-run the lifecycle.
457
478
  return {
458
479
  data: {
459
480
  index: nextIndex,
@@ -465,27 +486,27 @@ const flip = function (options) {
465
486
  };
466
487
  }
467
488
 
468
- let resetPlacement = 'bottom';
469
-
470
- switch (fallbackStrategy) {
471
- case 'bestFit':
472
- {
473
- var _overflowsData$map$so;
474
-
475
- const placement = (_overflowsData$map$so = overflowsData.map(d => [d, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0].placement;
476
-
477
- if (placement) {
478
- resetPlacement = placement;
489
+ // First, find the candidates that fit on the mainAxis side of overflow,
490
+ // then find the placement that fits the best on the main crossAxis side.
491
+ let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
492
+
493
+ // Otherwise fallback.
494
+ if (!resetPlacement) {
495
+ switch (fallbackStrategy) {
496
+ case 'bestFit':
497
+ {
498
+ var _overflowsData$map$so;
499
+ const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
500
+ if (placement) {
501
+ resetPlacement = placement;
502
+ }
503
+ break;
479
504
  }
480
-
505
+ case 'initialPlacement':
506
+ resetPlacement = initialPlacement;
481
507
  break;
482
- }
483
-
484
- case 'initialPlacement':
485
- resetPlacement = initialPlacement;
486
- break;
508
+ }
487
509
  }
488
-
489
510
  if (placement !== resetPlacement) {
490
511
  return {
491
512
  reset: {
@@ -494,10 +515,8 @@ const flip = function (options) {
494
515
  };
495
516
  }
496
517
  }
497
-
498
518
  return {};
499
519
  }
500
-
501
520
  };
502
521
  };
503
522
 
@@ -509,33 +528,34 @@ function getSideOffsets(overflow, rect) {
509
528
  left: overflow.left - rect.width
510
529
  };
511
530
  }
512
-
513
531
  function isAnySideFullyClipped(overflow) {
514
532
  return sides.some(side => overflow[side] >= 0);
515
533
  }
516
-
517
534
  /**
518
535
  * Provides data to hide the floating element in applicable situations, such as
519
536
  * when it is not in the same clipping context as the reference element.
520
537
  * @see https://floating-ui.com/docs/hide
521
538
  */
522
- const hide = function (_temp) {
523
- let {
524
- strategy = 'referenceHidden',
525
- ...detectOverflowOptions
526
- } = _temp === void 0 ? {} : _temp;
539
+ const hide = function (options) {
540
+ if (options === void 0) {
541
+ options = {};
542
+ }
527
543
  return {
528
544
  name: 'hide',
529
-
530
- async fn(middlewareArguments) {
545
+ options,
546
+ async fn(state) {
547
+ const {
548
+ strategy = 'referenceHidden',
549
+ ...detectOverflowOptions
550
+ } = options;
531
551
  const {
532
552
  rects
533
- } = middlewareArguments;
534
-
553
+ } = state;
535
554
  switch (strategy) {
536
555
  case 'referenceHidden':
537
556
  {
538
- const overflow = await detectOverflow(middlewareArguments, { ...detectOverflowOptions,
557
+ const overflow = await detectOverflow(state, {
558
+ ...detectOverflowOptions,
539
559
  elementContext: 'reference'
540
560
  });
541
561
  const offsets = getSideOffsets(overflow, rects.reference);
@@ -546,10 +566,10 @@ const hide = function (_temp) {
546
566
  }
547
567
  };
548
568
  }
549
-
550
569
  case 'escaped':
551
570
  {
552
- const overflow = await detectOverflow(middlewareArguments, { ...detectOverflowOptions,
571
+ const overflow = await detectOverflow(state, {
572
+ ...detectOverflowOptions,
553
573
  altBoundary: true
554
574
  });
555
575
  const offsets = getSideOffsets(overflow, rects.floating);
@@ -560,31 +580,30 @@ const hide = function (_temp) {
560
580
  }
561
581
  };
562
582
  }
563
-
564
583
  default:
565
584
  {
566
585
  return {};
567
586
  }
568
587
  }
569
588
  }
570
-
571
589
  };
572
590
  };
573
591
 
574
- async function convertValueToCoords(middlewareArguments, value) {
592
+ async function convertValueToCoords(state, value) {
575
593
  const {
576
594
  placement,
577
595
  platform,
578
596
  elements
579
- } = middlewareArguments;
597
+ } = state;
580
598
  const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
581
599
  const side = getSide(placement);
582
600
  const alignment = getAlignment(placement);
583
601
  const isVertical = getMainAxisFromPlacement(placement) === 'x';
584
602
  const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
585
603
  const crossAxisMulti = rtl && isVertical ? -1 : 1;
586
- const rawValue = typeof value === 'function' ? value(middlewareArguments) : value; // eslint-disable-next-line prefer-const
604
+ const rawValue = typeof value === 'function' ? value(state) : value;
587
605
 
606
+ // eslint-disable-next-line prefer-const
588
607
  let {
589
608
  mainAxis,
590
609
  crossAxis,
@@ -599,11 +618,9 @@ async function convertValueToCoords(middlewareArguments, value) {
599
618
  alignmentAxis: null,
600
619
  ...rawValue
601
620
  };
602
-
603
621
  if (alignment && typeof alignmentAxis === 'number') {
604
622
  crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
605
623
  }
606
-
607
624
  return isVertical ? {
608
625
  x: crossAxis * crossAxisMulti,
609
626
  y: mainAxis * mainAxisMulti
@@ -612,33 +629,33 @@ async function convertValueToCoords(middlewareArguments, value) {
612
629
  y: crossAxis * crossAxisMulti
613
630
  };
614
631
  }
632
+
615
633
  /**
616
- * Displaces the floating element from its reference element.
634
+ * Modifies the placement by translating the floating element along the
635
+ * specified axes.
636
+ * A number (shorthand for `mainAxis` or distance), or an axes configuration
637
+ * object may be passed.
617
638
  * @see https://floating-ui.com/docs/offset
618
639
  */
619
-
620
640
  const offset = function (value) {
621
641
  if (value === void 0) {
622
642
  value = 0;
623
643
  }
624
-
625
644
  return {
626
645
  name: 'offset',
627
646
  options: value,
628
-
629
- async fn(middlewareArguments) {
647
+ async fn(state) {
630
648
  const {
631
649
  x,
632
650
  y
633
- } = middlewareArguments;
634
- const diffCoords = await convertValueToCoords(middlewareArguments, value);
651
+ } = state;
652
+ const diffCoords = await convertValueToCoords(state, value);
635
653
  return {
636
654
  x: x + diffCoords.x,
637
655
  y: y + diffCoords.y,
638
656
  data: diffCoords
639
657
  };
640
658
  }
641
-
642
659
  };
643
660
  };
644
661
 
@@ -647,25 +664,23 @@ function getCrossAxis(axis) {
647
664
  }
648
665
 
649
666
  /**
650
- * Shifts the floating element in order to keep it in view when it will overflow
651
- * a clipping boundary.
667
+ * Optimizes the visibility of the floating element by shifting it in order to
668
+ * keep it in view when it will overflow the clipping boundary.
652
669
  * @see https://floating-ui.com/docs/shift
653
670
  */
654
671
  const shift = function (options) {
655
672
  if (options === void 0) {
656
673
  options = {};
657
674
  }
658
-
659
675
  return {
660
676
  name: 'shift',
661
677
  options,
662
-
663
- async fn(middlewareArguments) {
678
+ async fn(state) {
664
679
  const {
665
680
  x,
666
681
  y,
667
682
  placement
668
- } = middlewareArguments;
683
+ } = state;
669
684
  const {
670
685
  mainAxis: checkMainAxis = true,
671
686
  crossAxis: checkCrossAxis = false,
@@ -687,12 +702,11 @@ const shift = function (options) {
687
702
  x,
688
703
  y
689
704
  };
690
- const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
705
+ const overflow = await detectOverflow(state, detectOverflowOptions);
691
706
  const mainAxis = getMainAxisFromPlacement(getSide(placement));
692
707
  const crossAxis = getCrossAxis(mainAxis);
693
708
  let mainAxisCoord = coords[mainAxis];
694
709
  let crossAxisCoord = coords[crossAxis];
695
-
696
710
  if (checkMainAxis) {
697
711
  const minSide = mainAxis === 'y' ? 'top' : 'left';
698
712
  const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
@@ -700,7 +714,6 @@ const shift = function (options) {
700
714
  const max = mainAxisCoord - overflow[maxSide];
701
715
  mainAxisCoord = within(min, mainAxisCoord, max);
702
716
  }
703
-
704
717
  if (checkCrossAxis) {
705
718
  const minSide = crossAxis === 'y' ? 'top' : 'left';
706
719
  const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
@@ -708,54 +721,57 @@ const shift = function (options) {
708
721
  const max = crossAxisCoord - overflow[maxSide];
709
722
  crossAxisCoord = within(min, crossAxisCoord, max);
710
723
  }
711
-
712
- const limitedCoords = limiter.fn({ ...middlewareArguments,
724
+ const limitedCoords = limiter.fn({
725
+ ...state,
713
726
  [mainAxis]: mainAxisCoord,
714
727
  [crossAxis]: crossAxisCoord
715
728
  });
716
- return { ...limitedCoords,
729
+ return {
730
+ ...limitedCoords,
717
731
  data: {
718
732
  x: limitedCoords.x - x,
719
733
  y: limitedCoords.y - y
720
734
  }
721
735
  };
722
736
  }
723
-
724
737
  };
725
738
  };
726
739
 
727
740
  /**
728
- * Provides data to change the size of the floating element. For instance,
729
- * prevent it from overflowing its clipping boundary or match the width of the
730
- * reference element.
741
+ * Provides data that allows you to change the size of the floating element
742
+ * for instance, prevent it from overflowing the clipping boundary or match the
743
+ * width of the reference element.
731
744
  * @see https://floating-ui.com/docs/size
732
745
  */
733
746
  const size = function (options) {
734
747
  if (options === void 0) {
735
748
  options = {};
736
749
  }
737
-
738
750
  return {
739
751
  name: 'size',
740
752
  options,
741
-
742
- async fn(middlewareArguments) {
753
+ async fn(state) {
743
754
  const {
744
755
  placement,
745
756
  rects,
746
757
  platform,
747
758
  elements
748
- } = middlewareArguments;
759
+ } = state;
749
760
  const {
750
761
  apply = () => {},
751
762
  ...detectOverflowOptions
752
763
  } = options;
753
- const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
764
+ const overflow = await detectOverflow(state, detectOverflowOptions);
754
765
  const side = getSide(placement);
755
766
  const alignment = getAlignment(placement);
767
+ const axis = getMainAxisFromPlacement(placement);
768
+ const isXAxis = axis === 'x';
769
+ const {
770
+ width,
771
+ height
772
+ } = rects.floating;
756
773
  let heightSide;
757
774
  let widthSide;
758
-
759
775
  if (side === 'top' || side === 'bottom') {
760
776
  heightSide = side;
761
777
  widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
@@ -763,65 +779,74 @@ const size = function (options) {
763
779
  widthSide = side;
764
780
  heightSide = alignment === 'end' ? 'top' : 'bottom';
765
781
  }
766
-
767
- const xMin = max$1(overflow.left, 0);
768
- const xMax = max$1(overflow.right, 0);
769
- const yMin = max$1(overflow.top, 0);
770
- const yMax = max$1(overflow.bottom, 0);
771
- const dimensions = {
772
- availableHeight: rects.floating.height - (['left', 'right'].includes(placement) ? 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max$1(overflow.top, overflow.bottom)) : overflow[heightSide]),
773
- availableWidth: rects.floating.width - (['top', 'bottom'].includes(placement) ? 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max$1(overflow.left, overflow.right)) : overflow[widthSide])
774
- };
775
- await apply({ ...middlewareArguments,
776
- ...dimensions
782
+ const overflowAvailableHeight = height - overflow[heightSide];
783
+ const overflowAvailableWidth = width - overflow[widthSide];
784
+ let availableHeight = overflowAvailableHeight;
785
+ let availableWidth = overflowAvailableWidth;
786
+ if (isXAxis) {
787
+ availableWidth = min$1(
788
+ // Maximum clipping viewport width
789
+ width - overflow.right - overflow.left, overflowAvailableWidth);
790
+ } else {
791
+ availableHeight = min$1(
792
+ // Maximum clipping viewport height
793
+ height - overflow.bottom - overflow.top, overflowAvailableHeight);
794
+ }
795
+ if (!state.middlewareData.shift && !alignment) {
796
+ const xMin = max$1(overflow.left, 0);
797
+ const xMax = max$1(overflow.right, 0);
798
+ const yMin = max$1(overflow.top, 0);
799
+ const yMax = max$1(overflow.bottom, 0);
800
+ if (isXAxis) {
801
+ availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max$1(overflow.left, overflow.right));
802
+ } else {
803
+ availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max$1(overflow.top, overflow.bottom));
804
+ }
805
+ }
806
+ await apply({
807
+ ...state,
808
+ availableWidth,
809
+ availableHeight
777
810
  });
778
811
  const nextDimensions = await platform.getDimensions(elements.floating);
779
-
780
- if (rects.floating.width !== nextDimensions.width || rects.floating.height !== nextDimensions.height) {
812
+ if (width !== nextDimensions.width || height !== nextDimensions.height) {
781
813
  return {
782
814
  reset: {
783
815
  rects: true
784
816
  }
785
817
  };
786
818
  }
787
-
788
819
  return {};
789
820
  }
790
-
791
821
  };
792
822
  };
793
823
 
794
- function isWindow(value) {
795
- return value && value.document && value.location && value.alert && value.setInterval;
796
- }
797
824
  function getWindow(node) {
798
- if (node == null) {
799
- return window;
800
- }
801
-
802
- if (!isWindow(node)) {
803
- const ownerDocument = node.ownerDocument;
804
- return ownerDocument ? ownerDocument.defaultView || window : window;
805
- }
806
-
807
- return node;
825
+ var _node$ownerDocument;
826
+ return ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
808
827
  }
809
828
 
810
- function getComputedStyle(element) {
829
+ function getComputedStyle$1(element) {
811
830
  return getWindow(element).getComputedStyle(element);
812
831
  }
813
832
 
833
+ function isNode(value) {
834
+ return value instanceof getWindow(value).Node;
835
+ }
814
836
  function getNodeName(node) {
815
- return isWindow(node) ? '' : node ? (node.nodeName || '').toLowerCase() : '';
837
+ return isNode(node) ? (node.nodeName || '').toLowerCase() : '';
816
838
  }
817
839
 
840
+ let uaString;
818
841
  function getUAString() {
842
+ if (uaString) {
843
+ return uaString;
844
+ }
819
845
  const uaData = navigator.userAgentData;
820
-
821
- if (uaData != null && uaData.brands) {
822
- return uaData.brands.map(item => item.brand + "/" + item.version).join(' ');
846
+ if (uaData && Array.isArray(uaData.brands)) {
847
+ uaString = uaData.brands.map(item => item.brand + "/" + item.version).join(' ');
848
+ return uaString;
823
849
  }
824
-
825
850
  return navigator.userAgent;
826
851
  }
827
852
 
@@ -831,275 +856,188 @@ function isHTMLElement(value) {
831
856
  function isElement(value) {
832
857
  return value instanceof getWindow(value).Element;
833
858
  }
834
- function isNode(value) {
835
- return value instanceof getWindow(value).Node;
836
- }
837
859
  function isShadowRoot(node) {
838
- // Browsers without `ShadowRoot` support
860
+ // Browsers without `ShadowRoot` support.
839
861
  if (typeof ShadowRoot === 'undefined') {
840
862
  return false;
841
863
  }
842
-
843
864
  const OwnElement = getWindow(node).ShadowRoot;
844
865
  return node instanceof OwnElement || node instanceof ShadowRoot;
845
866
  }
846
867
  function isOverflowElement(element) {
847
- // Firefox wants us to check `-x` and `-y` variations as well
848
868
  const {
849
869
  overflow,
850
870
  overflowX,
851
- overflowY
852
- } = getComputedStyle(element);
853
- return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
871
+ overflowY,
872
+ display
873
+ } = getComputedStyle$1(element);
874
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
854
875
  }
855
876
  function isTableElement(element) {
856
877
  return ['table', 'td', 'th'].includes(getNodeName(element));
857
878
  }
858
879
  function isContainingBlock(element) {
859
- // TODO: Try and use feature detection here instead
880
+ // TODO: Try to use feature detection here instead.
860
881
  const isFirefox = /firefox/i.test(getUAString());
861
- const css = getComputedStyle(element); // This is non-exhaustive but covers the most common CSS properties that
882
+ const css = getComputedStyle$1(element);
883
+ const backdropFilter = css.backdropFilter || css.WebkitBackdropFilter;
884
+
885
+ // This is non-exhaustive but covers the most common CSS properties that
862
886
  // create a containing block.
863
887
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
864
-
865
- return css.transform !== 'none' || css.perspective !== 'none' || // @ts-ignore (TS 4.1 compat)
866
- css.contain === 'paint' || ['transform', 'perspective'].includes(css.willChange) || isFirefox && css.willChange === 'filter' || isFirefox && (css.filter ? css.filter !== 'none' : false);
888
+ 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(value => {
889
+ // Add type check for old browsers.
890
+ const contain = css.contain;
891
+ return contain != null ? contain.includes(value) : false;
892
+ });
867
893
  }
868
- function isLayoutViewport() {
869
- // Not Safari
870
- return !/^((?!chrome|android).)*safari/i.test(getUAString()); // Feature detection for this fails in various ways
894
+
895
+ /**
896
+ * Determines whether or not `.getBoundingClientRect()` is affected by visual
897
+ * viewport offsets. In Safari, the `x`/`y` offsets are values relative to the
898
+ * visual viewport, while in other engines, they are values relative to the
899
+ * layout viewport.
900
+ */
901
+ function isClientRectVisualViewportBased() {
902
+ // TODO: Try to use feature detection here instead. Feature detection for
903
+ // this can fail in various ways, making the userAgent check the most
904
+ // reliable:
871
905
  // • Always-visible scrollbar or not
872
- // • Width of <html>, etc.
873
- // const vV = win.visualViewport;
874
- // return vV ? Math.abs(win.innerWidth / vV.scale - vV.width) < 0.5 : true;
906
+ // • Width of <html>
907
+
908
+ // Is Safari.
909
+ return /^((?!chrome|android).)*safari/i.test(getUAString());
910
+ }
911
+ function isLastTraversableNode(node) {
912
+ return ['html', 'body', '#document'].includes(getNodeName(node));
875
913
  }
876
914
 
877
915
  const min = Math.min;
878
916
  const max = Math.max;
879
917
  const round = Math.round;
880
918
 
881
- function getBoundingClientRect(element, includeScale, isFixedStrategy) {
882
- var _win$visualViewport$o, _win$visualViewport, _win$visualViewport$o2, _win$visualViewport2;
883
-
884
- if (includeScale === void 0) {
885
- includeScale = false;
919
+ function getCssDimensions(element) {
920
+ const css = getComputedStyle$1(element);
921
+ let width = parseFloat(css.width);
922
+ let height = parseFloat(css.height);
923
+ const hasOffset = isHTMLElement(element);
924
+ const offsetWidth = hasOffset ? element.offsetWidth : width;
925
+ const offsetHeight = hasOffset ? element.offsetHeight : height;
926
+ const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
927
+ if (shouldFallback) {
928
+ width = offsetWidth;
929
+ height = offsetHeight;
886
930
  }
887
-
888
- if (isFixedStrategy === void 0) {
889
- isFixedStrategy = false;
890
- }
891
-
892
- const clientRect = element.getBoundingClientRect();
893
- let scaleX = 1;
894
- let scaleY = 1;
895
-
896
- if (includeScale && isHTMLElement(element)) {
897
- scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
898
- scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
899
- }
900
-
901
- const win = isElement(element) ? getWindow(element) : window;
902
- const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
903
- 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;
904
- 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;
905
- const width = clientRect.width / scaleX;
906
- const height = clientRect.height / scaleY;
907
931
  return {
908
932
  width,
909
933
  height,
910
- top: y,
911
- right: x + width,
912
- bottom: y + height,
913
- left: x,
914
- x,
915
- y
934
+ fallback: shouldFallback
916
935
  };
917
936
  }
918
937
 
919
- function getDocumentElement(node) {
920
- return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;
938
+ function unwrapElement(element) {
939
+ return !isElement(element) ? element.contextElement : element;
921
940
  }
922
941
 
923
- function getNodeScroll(element) {
924
- if (isElement(element)) {
925
- return {
926
- scrollLeft: element.scrollLeft,
927
- scrollTop: element.scrollTop
928
- };
942
+ const FALLBACK_SCALE = {
943
+ x: 1,
944
+ y: 1
945
+ };
946
+ function getScale(element) {
947
+ const domElement = unwrapElement(element);
948
+ if (!isHTMLElement(domElement)) {
949
+ return FALLBACK_SCALE;
929
950
  }
951
+ const rect = domElement.getBoundingClientRect();
952
+ const {
953
+ width,
954
+ height,
955
+ fallback
956
+ } = getCssDimensions(domElement);
957
+ let x = (fallback ? round(rect.width) : rect.width) / width;
958
+ let y = (fallback ? round(rect.height) : rect.height) / height;
930
959
 
931
- return {
932
- scrollLeft: element.pageXOffset,
933
- scrollTop: element.pageYOffset
934
- };
935
- }
936
-
937
- function getWindowScrollBarX(element) {
938
- // If <html> has a CSS width greater than the viewport, then this will be
939
- // incorrect for RTL.
940
- return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
941
- }
942
-
943
- function isScaled(element) {
944
- const rect = getBoundingClientRect(element);
945
- return round(rect.width) !== element.offsetWidth || round(rect.height) !== element.offsetHeight;
946
- }
947
-
948
- function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
949
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
950
- const documentElement = getDocumentElement(offsetParent);
951
- const rect = getBoundingClientRect(element, // @ts-ignore - checked above (TS 4.1 compat)
952
- isOffsetParentAnElement && isScaled(offsetParent), strategy === 'fixed');
953
- let scroll = {
954
- scrollLeft: 0,
955
- scrollTop: 0
956
- };
957
- const offsets = {
958
- x: 0,
959
- y: 0
960
- };
961
-
962
- if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
963
- if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
964
- scroll = getNodeScroll(offsetParent);
965
- }
960
+ // 0, NaN, or Infinity should always fallback to 1.
966
961
 
967
- if (isHTMLElement(offsetParent)) {
968
- const offsetRect = getBoundingClientRect(offsetParent, true);
969
- offsets.x = offsetRect.x + offsetParent.clientLeft;
970
- offsets.y = offsetRect.y + offsetParent.clientTop;
971
- } else if (documentElement) {
972
- offsets.x = getWindowScrollBarX(documentElement);
973
- }
962
+ if (!x || !Number.isFinite(x)) {
963
+ x = 1;
964
+ }
965
+ if (!y || !Number.isFinite(y)) {
966
+ y = 1;
974
967
  }
975
-
976
968
  return {
977
- x: rect.left + scroll.scrollLeft - offsets.x,
978
- y: rect.top + scroll.scrollTop - offsets.y,
979
- width: rect.width,
980
- height: rect.height
969
+ x,
970
+ y
981
971
  };
982
972
  }
983
973
 
984
- function getParentNode(node) {
985
- if (getNodeName(node) === 'html') {
986
- return node;
974
+ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
975
+ var _win$visualViewport, _win$visualViewport2;
976
+ if (includeScale === void 0) {
977
+ includeScale = false;
987
978
  }
988
-
989
- return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
990
- // @ts-ignore
991
- node.assignedSlot || // step into the shadow DOM of the parent of a slotted node
992
- node.parentNode || ( // DOM Element detected
993
- isShadowRoot(node) ? node.host : null) || // ShadowRoot detected
994
- getDocumentElement(node) // fallback
995
-
996
- );
997
- }
998
-
999
- function getTrueOffsetParent(element) {
1000
- if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
1001
- return null;
979
+ if (isFixedStrategy === void 0) {
980
+ isFixedStrategy = false;
1002
981
  }
1003
-
1004
- return composedOffsetParent(element);
1005
- }
1006
- /**
1007
- * Polyfills the old offsetParent behavior from before the spec was changed:
1008
- * https://github.com/w3c/csswg-drafts/issues/159
1009
- */
1010
-
1011
-
1012
- function composedOffsetParent(element) {
1013
- let {
1014
- offsetParent
1015
- } = element;
1016
- let ancestor = element;
1017
- let foundInsideSlot = false;
1018
-
1019
- while (ancestor && ancestor !== offsetParent) {
1020
- const {
1021
- assignedSlot
1022
- } = ancestor;
1023
-
1024
- if (assignedSlot) {
1025
- let newOffsetParent = assignedSlot.offsetParent;
1026
-
1027
- if (getComputedStyle(assignedSlot).display === 'contents') {
1028
- const hadStyleAttribute = assignedSlot.hasAttribute('style');
1029
- const oldDisplay = assignedSlot.style.display;
1030
- assignedSlot.style.display = getComputedStyle(ancestor).display;
1031
- newOffsetParent = assignedSlot.offsetParent;
1032
- assignedSlot.style.display = oldDisplay;
1033
-
1034
- if (!hadStyleAttribute) {
1035
- assignedSlot.removeAttribute('style');
1036
- }
1037
- }
1038
-
1039
- ancestor = assignedSlot;
1040
-
1041
- if (offsetParent !== newOffsetParent) {
1042
- offsetParent = newOffsetParent;
1043
- foundInsideSlot = true;
982
+ const clientRect = element.getBoundingClientRect();
983
+ const domElement = unwrapElement(element);
984
+ let scale = FALLBACK_SCALE;
985
+ if (includeScale) {
986
+ if (offsetParent) {
987
+ if (isElement(offsetParent)) {
988
+ scale = getScale(offsetParent);
1044
989
  }
1045
- } else if (isShadowRoot(ancestor) && ancestor.host && foundInsideSlot) {
1046
- break;
1047
- }
1048
-
1049
- ancestor = isShadowRoot(ancestor) && ancestor.host || ancestor.parentNode;
1050
- }
1051
-
1052
- return offsetParent;
1053
- }
1054
-
1055
- function getContainingBlock(element) {
1056
- let currentNode = getParentNode(element);
1057
-
1058
- if (isShadowRoot(currentNode)) {
1059
- currentNode = currentNode.host;
1060
- }
1061
-
1062
- while (isHTMLElement(currentNode) && !['html', 'body'].includes(getNodeName(currentNode))) {
1063
- if (isContainingBlock(currentNode)) {
1064
- return currentNode;
1065
990
  } else {
1066
- const parent = currentNode.parentNode;
1067
- currentNode = isShadowRoot(parent) ? parent.host : parent;
991
+ scale = getScale(element);
1068
992
  }
1069
993
  }
1070
-
1071
- return null;
1072
- } // Gets the closest ancestor positioned element. Handles some edge cases,
1073
- // such as table ancestors and cross browser bugs.
1074
-
1075
-
1076
- function getOffsetParent(element) {
1077
- const window = getWindow(element);
1078
- let offsetParent = getTrueOffsetParent(element);
1079
-
1080
- while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
1081
- offsetParent = getTrueOffsetParent(offsetParent);
1082
- }
1083
-
1084
- if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
1085
- return window;
994
+ const win = domElement ? getWindow(domElement) : window;
995
+ const addVisualOffsets = isClientRectVisualViewportBased() && isFixedStrategy;
996
+ let x = (clientRect.left + (addVisualOffsets ? ((_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) || 0 : 0)) / scale.x;
997
+ let y = (clientRect.top + (addVisualOffsets ? ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0 : 0)) / scale.y;
998
+ let width = clientRect.width / scale.x;
999
+ let height = clientRect.height / scale.y;
1000
+ if (domElement) {
1001
+ const win = getWindow(domElement);
1002
+ const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
1003
+ let currentIFrame = win.frameElement;
1004
+ while (currentIFrame && offsetParent && offsetWin !== win) {
1005
+ const iframeScale = getScale(currentIFrame);
1006
+ const iframeRect = currentIFrame.getBoundingClientRect();
1007
+ const css = getComputedStyle(currentIFrame);
1008
+ iframeRect.x += (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
1009
+ iframeRect.y += (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
1010
+ x *= iframeScale.x;
1011
+ y *= iframeScale.y;
1012
+ width *= iframeScale.x;
1013
+ height *= iframeScale.y;
1014
+ x += iframeRect.x;
1015
+ y += iframeRect.y;
1016
+ currentIFrame = getWindow(currentIFrame).frameElement;
1017
+ }
1086
1018
  }
1019
+ return rectToClientRect({
1020
+ width,
1021
+ height,
1022
+ x,
1023
+ y
1024
+ });
1025
+ }
1087
1026
 
1088
- return offsetParent || getContainingBlock(element) || window;
1027
+ function getDocumentElement(node) {
1028
+ return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;
1089
1029
  }
1090
1030
 
1091
- function getDimensions(element) {
1092
- if (isHTMLElement(element)) {
1031
+ function getNodeScroll(element) {
1032
+ if (isElement(element)) {
1093
1033
  return {
1094
- width: element.offsetWidth,
1095
- height: element.offsetHeight
1034
+ scrollLeft: element.scrollLeft,
1035
+ scrollTop: element.scrollTop
1096
1036
  };
1097
1037
  }
1098
-
1099
- const rect = getBoundingClientRect(element);
1100
1038
  return {
1101
- width: rect.width,
1102
- height: rect.height
1039
+ scrollLeft: element.pageXOffset,
1040
+ scrollTop: element.pageYOffset
1103
1041
  };
1104
1042
  }
1105
1043
 
@@ -1111,87 +1049,59 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
1111
1049
  } = _ref;
1112
1050
  const isOffsetParentAnElement = isHTMLElement(offsetParent);
1113
1051
  const documentElement = getDocumentElement(offsetParent);
1114
-
1115
1052
  if (offsetParent === documentElement) {
1116
1053
  return rect;
1117
1054
  }
1118
-
1119
1055
  let scroll = {
1120
1056
  scrollLeft: 0,
1121
1057
  scrollTop: 0
1122
1058
  };
1059
+ let scale = {
1060
+ x: 1,
1061
+ y: 1
1062
+ };
1123
1063
  const offsets = {
1124
1064
  x: 0,
1125
1065
  y: 0
1126
1066
  };
1127
-
1128
1067
  if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
1129
1068
  if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
1130
1069
  scroll = getNodeScroll(offsetParent);
1131
1070
  }
1132
-
1133
1071
  if (isHTMLElement(offsetParent)) {
1134
- const offsetRect = getBoundingClientRect(offsetParent, true);
1072
+ const offsetRect = getBoundingClientRect(offsetParent);
1073
+ scale = getScale(offsetParent);
1135
1074
  offsets.x = offsetRect.x + offsetParent.clientLeft;
1136
1075
  offsets.y = offsetRect.y + offsetParent.clientTop;
1137
- } // This doesn't appear to be need to be negated.
1138
- // else if (documentElement) {
1139
- // offsets.x = getWindowScrollBarX(documentElement);
1140
- // }
1141
-
1142
- }
1143
-
1144
- return { ...rect,
1145
- x: rect.x - scroll.scrollLeft + offsets.x,
1146
- y: rect.y - scroll.scrollTop + offsets.y
1147
- };
1148
- }
1149
-
1150
- function getViewportRect(element, strategy) {
1151
- const win = getWindow(element);
1152
- const html = getDocumentElement(element);
1153
- const visualViewport = win.visualViewport;
1154
- let width = html.clientWidth;
1155
- let height = html.clientHeight;
1156
- let x = 0;
1157
- let y = 0;
1158
-
1159
- if (visualViewport) {
1160
- width = visualViewport.width;
1161
- height = visualViewport.height;
1162
- const layoutViewport = isLayoutViewport();
1163
-
1164
- if (layoutViewport || !layoutViewport && strategy === 'fixed') {
1165
- x = visualViewport.offsetLeft;
1166
- y = visualViewport.offsetTop;
1167
1076
  }
1168
1077
  }
1169
-
1170
1078
  return {
1171
- width,
1172
- height,
1173
- x,
1174
- y
1079
+ width: rect.width * scale.x,
1080
+ height: rect.height * scale.y,
1081
+ x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
1082
+ y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
1175
1083
  };
1176
1084
  }
1177
1085
 
1178
- // of the `<html>` and `<body>` rect bounds if horizontally scrollable
1086
+ function getWindowScrollBarX(element) {
1087
+ // If <html> has a CSS width greater than the viewport, then this will be
1088
+ // incorrect for RTL.
1089
+ return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
1090
+ }
1179
1091
 
1092
+ // Gets the entire size of the scrollable document area, even extending outside
1093
+ // of the `<html>` and `<body>` rect bounds if horizontally scrollable.
1180
1094
  function getDocumentRect(element) {
1181
- var _element$ownerDocumen;
1182
-
1183
1095
  const html = getDocumentElement(element);
1184
1096
  const scroll = getNodeScroll(element);
1185
- const body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
1186
- const width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
1187
- const height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
1097
+ const body = element.ownerDocument.body;
1098
+ const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
1099
+ const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
1188
1100
  let x = -scroll.scrollLeft + getWindowScrollBarX(element);
1189
1101
  const y = -scroll.scrollTop;
1190
-
1191
- if (getComputedStyle(body || html).direction === 'rtl') {
1192
- x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
1102
+ if (getComputedStyle$1(body).direction === 'rtl') {
1103
+ x += max(html.clientWidth, body.clientWidth) - width;
1193
1104
  }
1194
-
1195
1105
  return {
1196
1106
  width,
1197
1107
  height,
@@ -1200,106 +1110,155 @@ function getDocumentRect(element) {
1200
1110
  };
1201
1111
  }
1202
1112
 
1113
+ function getParentNode(node) {
1114
+ if (getNodeName(node) === 'html') {
1115
+ return node;
1116
+ }
1117
+ const result =
1118
+ // Step into the shadow DOM of the parent of a slotted node.
1119
+ node.assignedSlot ||
1120
+ // DOM Element detected.
1121
+ node.parentNode ||
1122
+ // ShadowRoot detected.
1123
+ isShadowRoot(node) && node.host ||
1124
+ // Fallback.
1125
+ getDocumentElement(node);
1126
+ return isShadowRoot(result) ? result.host : result;
1127
+ }
1128
+
1203
1129
  function getNearestOverflowAncestor(node) {
1204
1130
  const parentNode = getParentNode(node);
1205
-
1206
- if (['html', 'body', '#document'].includes(getNodeName(parentNode))) {
1207
- // @ts-ignore assume body is always available
1208
- return node.ownerDocument.body;
1131
+ if (isLastTraversableNode(parentNode)) {
1132
+ // `getParentNode` will never return a `Document` due to the fallback
1133
+ // check, so it's either the <html> or <body> element.
1134
+ return parentNode.ownerDocument.body;
1209
1135
  }
1210
-
1211
1136
  if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
1212
1137
  return parentNode;
1213
1138
  }
1214
-
1215
1139
  return getNearestOverflowAncestor(parentNode);
1216
1140
  }
1217
1141
 
1218
1142
  function getOverflowAncestors(node, list) {
1219
1143
  var _node$ownerDocument;
1220
-
1221
1144
  if (list === void 0) {
1222
1145
  list = [];
1223
1146
  }
1224
-
1225
1147
  const scrollableAncestor = getNearestOverflowAncestor(node);
1226
1148
  const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
1227
1149
  const win = getWindow(scrollableAncestor);
1228
- const target = isBody ? [win].concat(win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []) : scrollableAncestor;
1229
- const updatedList = list.concat(target);
1230
- return isBody ? updatedList : // @ts-ignore: isBody tells us target will be an HTMLElement here
1231
- updatedList.concat(getOverflowAncestors(target));
1150
+ if (isBody) {
1151
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []);
1152
+ }
1153
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor));
1232
1154
  }
1233
1155
 
1234
- function contains(parent, child) {
1235
- const rootNode = child.getRootNode == null ? void 0 : child.getRootNode(); // First, attempt with faster native method
1236
-
1237
- if (parent.contains(child)) {
1238
- return true;
1239
- } // then fallback to custom implementation with Shadow DOM support
1240
- else if (rootNode && isShadowRoot(rootNode)) {
1241
- let next = child;
1242
-
1243
- do {
1244
- // use `===` replace node.isSameNode()
1245
- if (next && parent === next) {
1246
- return true;
1247
- } // @ts-ignore: need a better way to handle this...
1248
-
1249
-
1250
- next = next.parentNode || next.host;
1251
- } while (next);
1156
+ function getViewportRect(element, strategy) {
1157
+ const win = getWindow(element);
1158
+ const html = getDocumentElement(element);
1159
+ const visualViewport = win.visualViewport;
1160
+ let width = html.clientWidth;
1161
+ let height = html.clientHeight;
1162
+ let x = 0;
1163
+ let y = 0;
1164
+ if (visualViewport) {
1165
+ width = visualViewport.width;
1166
+ height = visualViewport.height;
1167
+ const visualViewportBased = isClientRectVisualViewportBased();
1168
+ if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
1169
+ x = visualViewport.offsetLeft;
1170
+ y = visualViewport.offsetTop;
1171
+ }
1252
1172
  }
1253
-
1254
- return false;
1173
+ return {
1174
+ width,
1175
+ height,
1176
+ x,
1177
+ y
1178
+ };
1255
1179
  }
1256
1180
 
1181
+ // Returns the inner client rect, subtracting scrollbars if present.
1257
1182
  function getInnerBoundingClientRect(element, strategy) {
1258
- const clientRect = getBoundingClientRect(element, false, strategy === 'fixed');
1183
+ const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
1259
1184
  const top = clientRect.top + element.clientTop;
1260
1185
  const left = clientRect.left + element.clientLeft;
1186
+ const scale = isHTMLElement(element) ? getScale(element) : {
1187
+ x: 1,
1188
+ y: 1
1189
+ };
1190
+ const width = element.clientWidth * scale.x;
1191
+ const height = element.clientHeight * scale.y;
1192
+ const x = left * scale.x;
1193
+ const y = top * scale.y;
1261
1194
  return {
1262
- top,
1263
- left,
1264
- x: left,
1265
- y: top,
1266
- right: left + element.clientWidth,
1267
- bottom: top + element.clientHeight,
1268
- width: element.clientWidth,
1269
- height: element.clientHeight
1195
+ width,
1196
+ height,
1197
+ x,
1198
+ y
1270
1199
  };
1271
1200
  }
1272
-
1273
- function getClientRectFromClippingAncestor(element, clippingParent, strategy) {
1274
- if (clippingParent === 'viewport') {
1275
- return rectToClientRect(getViewportRect(element, strategy));
1201
+ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
1202
+ let rect;
1203
+ if (clippingAncestor === 'viewport') {
1204
+ rect = getViewportRect(element, strategy);
1205
+ } else if (clippingAncestor === 'document') {
1206
+ rect = getDocumentRect(getDocumentElement(element));
1207
+ } else if (isElement(clippingAncestor)) {
1208
+ rect = getInnerBoundingClientRect(clippingAncestor, strategy);
1209
+ } else {
1210
+ const mutableRect = {
1211
+ ...clippingAncestor
1212
+ };
1213
+ if (isClientRectVisualViewportBased()) {
1214
+ var _win$visualViewport, _win$visualViewport2;
1215
+ const win = getWindow(element);
1216
+ mutableRect.x -= ((_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) || 0;
1217
+ mutableRect.y -= ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0;
1218
+ }
1219
+ rect = mutableRect;
1276
1220
  }
1221
+ return rectToClientRect(rect);
1222
+ }
1277
1223
 
1278
- if (isElement(clippingParent)) {
1279
- return getInnerBoundingClientRect(clippingParent, strategy);
1224
+ // A "clipping ancestor" is an `overflow` element with the characteristic of
1225
+ // clipping (or hiding) child elements. This returns all clipping ancestors
1226
+ // of the given element up the tree.
1227
+ function getClippingElementAncestors(element, cache) {
1228
+ const cachedResult = cache.get(element);
1229
+ if (cachedResult) {
1230
+ return cachedResult;
1280
1231
  }
1232
+ let result = getOverflowAncestors(element).filter(el => isElement(el) && getNodeName(el) !== 'body');
1233
+ let currentContainingBlockComputedStyle = null;
1234
+ const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
1235
+ let currentNode = elementIsFixed ? getParentNode(element) : element;
1281
1236
 
1282
- return rectToClientRect(getDocumentRect(getDocumentElement(element)));
1283
- } // A "clipping ancestor" is an overflowable container with the characteristic of
1284
- // clipping (or hiding) overflowing elements with a position different from
1285
- // `initial`
1286
-
1287
-
1288
- function getClippingAncestors(element) {
1289
- const clippingAncestors = getOverflowAncestors(element);
1290
- const canEscapeClipping = ['absolute', 'fixed'].includes(getComputedStyle(element).position);
1291
- const clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
1292
-
1293
- if (!isElement(clipperElement)) {
1294
- return [];
1295
- } // @ts-ignore isElement check ensures we return Array<Element>
1296
-
1297
-
1298
- return clippingAncestors.filter(clippingAncestors => isElement(clippingAncestors) && contains(clippingAncestors, clipperElement) && getNodeName(clippingAncestors) !== 'body');
1299
- } // Gets the maximum area that the element is visible in due to any number of
1300
- // clipping ancestors
1301
-
1237
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
1238
+ while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
1239
+ const computedStyle = getComputedStyle$1(currentNode);
1240
+ const containingBlock = isContainingBlock(currentNode);
1241
+ const shouldIgnoreCurrentNode = computedStyle.position === 'fixed';
1242
+ if (shouldIgnoreCurrentNode) {
1243
+ currentContainingBlockComputedStyle = null;
1244
+ } else {
1245
+ const shouldDropCurrentNode = elementIsFixed ? !containingBlock && !currentContainingBlockComputedStyle : !containingBlock && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position);
1246
+ if (shouldDropCurrentNode) {
1247
+ // Drop non-containing blocks.
1248
+ result = result.filter(ancestor => ancestor !== currentNode);
1249
+ } else {
1250
+ // Record last containing block for next iteration.
1251
+ currentContainingBlockComputedStyle = computedStyle;
1252
+ }
1253
+ }
1254
+ currentNode = getParentNode(currentNode);
1255
+ }
1256
+ cache.set(element, result);
1257
+ return result;
1258
+ }
1302
1259
 
1260
+ // Gets the maximum area that the element is visible in due to any number of
1261
+ // clipping ancestors.
1303
1262
  function getClippingRect(_ref) {
1304
1263
  let {
1305
1264
  element,
@@ -1307,8 +1266,8 @@ function getClippingRect(_ref) {
1307
1266
  rootBoundary,
1308
1267
  strategy
1309
1268
  } = _ref;
1310
- const mainClippingAncestors = boundary === 'clippingAncestors' ? getClippingAncestors(element) : [].concat(boundary);
1311
- const clippingAncestors = [...mainClippingAncestors, rootBoundary];
1269
+ const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
1270
+ const clippingAncestors = [...elementClippingAncestors, rootBoundary];
1312
1271
  const firstClippingAncestor = clippingAncestors[0];
1313
1272
  const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
1314
1273
  const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
@@ -1326,6 +1285,80 @@ function getClippingRect(_ref) {
1326
1285
  };
1327
1286
  }
1328
1287
 
1288
+ function getDimensions(element) {
1289
+ return getCssDimensions(element);
1290
+ }
1291
+
1292
+ function getTrueOffsetParent(element, polyfill) {
1293
+ if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
1294
+ return null;
1295
+ }
1296
+ if (polyfill) {
1297
+ return polyfill(element);
1298
+ }
1299
+ return element.offsetParent;
1300
+ }
1301
+ function getContainingBlock(element) {
1302
+ let currentNode = getParentNode(element);
1303
+ while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
1304
+ if (isContainingBlock(currentNode)) {
1305
+ return currentNode;
1306
+ } else {
1307
+ currentNode = getParentNode(currentNode);
1308
+ }
1309
+ }
1310
+ return null;
1311
+ }
1312
+
1313
+ // Gets the closest ancestor positioned element. Handles some edge cases,
1314
+ // such as table ancestors and cross browser bugs.
1315
+ function getOffsetParent(element, polyfill) {
1316
+ const window = getWindow(element);
1317
+ if (!isHTMLElement(element)) {
1318
+ return window;
1319
+ }
1320
+ let offsetParent = getTrueOffsetParent(element, polyfill);
1321
+ while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
1322
+ offsetParent = getTrueOffsetParent(offsetParent, polyfill);
1323
+ }
1324
+ if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
1325
+ return window;
1326
+ }
1327
+ return offsetParent || getContainingBlock(element) || window;
1328
+ }
1329
+
1330
+ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
1331
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
1332
+ const documentElement = getDocumentElement(offsetParent);
1333
+ const rect = getBoundingClientRect(element, true, strategy === 'fixed', offsetParent);
1334
+ let scroll = {
1335
+ scrollLeft: 0,
1336
+ scrollTop: 0
1337
+ };
1338
+ const offsets = {
1339
+ x: 0,
1340
+ y: 0
1341
+ };
1342
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
1343
+ if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
1344
+ scroll = getNodeScroll(offsetParent);
1345
+ }
1346
+ if (isHTMLElement(offsetParent)) {
1347
+ const offsetRect = getBoundingClientRect(offsetParent, true);
1348
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
1349
+ offsets.y = offsetRect.y + offsetParent.clientTop;
1350
+ } else if (documentElement) {
1351
+ offsets.x = getWindowScrollBarX(documentElement);
1352
+ }
1353
+ }
1354
+ return {
1355
+ x: rect.left + scroll.scrollLeft - offsets.x,
1356
+ y: rect.top + scroll.scrollTop - offsets.y,
1357
+ width: rect.width,
1358
+ height: rect.height
1359
+ };
1360
+ }
1361
+
1329
1362
  const platform = {
1330
1363
  getClippingRect,
1331
1364
  convertOffsetParentRelativeRectToViewportRelativeRect,
@@ -1333,22 +1366,26 @@ const platform = {
1333
1366
  getDimensions,
1334
1367
  getOffsetParent,
1335
1368
  getDocumentElement,
1336
- getElementRects: _ref => {
1369
+ getScale,
1370
+ async getElementRects(_ref) {
1337
1371
  let {
1338
1372
  reference,
1339
1373
  floating,
1340
1374
  strategy
1341
1375
  } = _ref;
1376
+ const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
1377
+ const getDimensionsFn = this.getDimensions;
1342
1378
  return {
1343
- reference: getRectRelativeToOffsetParent(reference, getOffsetParent(floating), strategy),
1344
- floating: { ...getDimensions(floating),
1379
+ reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy),
1380
+ floating: {
1345
1381
  x: 0,
1346
- y: 0
1382
+ y: 0,
1383
+ ...(await getDimensionsFn(floating))
1347
1384
  }
1348
1385
  };
1349
1386
  },
1350
1387
  getClientRects: element => Array.from(element.getClientRects()),
1351
- isRTL: element => getComputedStyle(element).direction === 'rtl'
1388
+ isRTL: element => getComputedStyle$1(element).direction === 'rtl'
1352
1389
  };
1353
1390
 
1354
1391
  /**
@@ -1356,11 +1393,24 @@ const platform = {
1356
1393
  * next to a reference element when it is given a certain CSS positioning
1357
1394
  * strategy.
1358
1395
  */
1359
-
1360
- const computePosition = (reference, floating, options) => computePosition$1(reference, floating, {
1361
- platform,
1362
- ...options
1363
- });
1396
+ const computePosition = (reference, floating, options) => {
1397
+ // This caches the expensive `getClippingElementAncestors` function so that
1398
+ // multiple lifecycle resets re-use the same result. It only lives for a
1399
+ // single call. If other functions become expensive, we can add them as well.
1400
+ const cache = new Map();
1401
+ const mergedOptions = {
1402
+ platform,
1403
+ ...options
1404
+ };
1405
+ const platformWithCache = {
1406
+ ...mergedOptions.platform,
1407
+ _c: cache
1408
+ };
1409
+ return computePosition$1(reference, floating, {
1410
+ ...mergedOptions,
1411
+ platform: platformWithCache
1412
+ });
1413
+ };
1364
1414
 
1365
1415
  const FloatingUI = (
1366
1416
  // el,