q2-tecton-elements 1.51.2 → 1.51.4

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 (445) hide show
  1. package/dist/cjs/click-elsewhere_2.cjs.entry.js +77 -81
  2. package/dist/cjs/click-elsewhere_2.cjs.entry.js.map +1 -1
  3. package/dist/cjs/{index-9aa4a776.js → index-bdd747a4.js} +30 -18
  4. package/dist/cjs/index-bdd747a4.js.map +1 -0
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/q2-action-group.cjs.entry.js +1 -1
  7. package/dist/cjs/q2-action-sheet.cjs.entry.js +2 -2
  8. package/dist/cjs/q2-avatar.cjs.entry.js +1 -1
  9. package/dist/cjs/q2-badge_7.cjs.entry.js +4 -4
  10. package/dist/cjs/q2-calendar.cjs.entry.js +1 -1
  11. package/dist/cjs/q2-card.cjs.entry.js +1 -1
  12. package/dist/cjs/q2-carousel-pane.cjs.entry.js +3 -3
  13. package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
  14. package/dist/cjs/q2-chart-area.cjs.entry.js +2 -2
  15. package/dist/cjs/q2-chart-bar.cjs.entry.js +2 -2
  16. package/dist/cjs/q2-chart-donut.cjs.entry.js +2 -2
  17. package/dist/cjs/q2-checkbox-group.cjs.entry.js +1 -1
  18. package/dist/cjs/q2-checkbox.cjs.entry.js +1 -1
  19. package/dist/cjs/q2-currency.cjs.entry.js +1 -1
  20. package/dist/cjs/q2-data-table.cjs.entry.js +1 -1
  21. package/dist/cjs/q2-detail.cjs.entry.js +2 -2
  22. package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
  23. package/dist/cjs/q2-dropdown.cjs.entry.js +4 -2
  24. package/dist/cjs/q2-dropdown.cjs.entry.js.map +1 -1
  25. package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
  26. package/dist/cjs/q2-formatted-text.cjs.entry.js +1 -1
  27. package/dist/cjs/q2-item.cjs.entry.js +2 -2
  28. package/dist/cjs/q2-legend.cjs.entry.js +1 -1
  29. package/dist/cjs/q2-list.cjs.entry.js +2 -2
  30. package/dist/cjs/q2-loc.cjs.entry.js +2 -2
  31. package/dist/cjs/q2-message.cjs.entry.js +2 -2
  32. package/dist/cjs/q2-month-picker.cjs.entry.js +3 -3
  33. package/dist/cjs/q2-optgroup.cjs.entry.js +2 -2
  34. package/dist/cjs/q2-option-list.cjs.entry.js +1 -1
  35. package/dist/cjs/q2-option.cjs.entry.js +1 -1
  36. package/dist/cjs/q2-pagination.cjs.entry.js +3 -3
  37. package/dist/cjs/q2-pill.cjs.entry.js +2 -2
  38. package/dist/cjs/q2-radio-group.cjs.entry.js +1 -1
  39. package/dist/cjs/q2-radio.cjs.entry.js +1 -1
  40. package/dist/cjs/q2-relative-time.cjs.entry.js +2 -2
  41. package/dist/cjs/q2-resize-observer.cjs.entry.js +1 -1
  42. package/dist/cjs/q2-section.cjs.entry.js +3 -3
  43. package/dist/cjs/q2-select.cjs.entry.js +134 -17
  44. package/dist/cjs/q2-select.cjs.entry.js.map +1 -1
  45. package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
  46. package/dist/cjs/q2-stepper-vertical.cjs.entry.js +2 -2
  47. package/dist/cjs/q2-stepper.cjs.entry.js +2 -2
  48. package/dist/cjs/q2-tag.cjs.entry.js +2 -2
  49. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  50. package/dist/cjs/q2-textarea.cjs.entry.js +2 -2
  51. package/dist/cjs/q2-tooltip.cjs.entry.js +1 -1
  52. package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -2
  53. package/dist/collection/components/click-elsewhere/click-elsewhere.js.map +1 -1
  54. package/dist/collection/components/click-elsewhere/test/click-elsewhere-test.e2e.js.map +1 -1
  55. package/dist/collection/components/q2-action-group/q2-action-group.js +1 -1
  56. package/dist/collection/components/q2-action-group/q2-action-group.js.map +1 -1
  57. package/dist/collection/components/q2-action-group/test/q2-action-group.e2e.js.map +1 -1
  58. package/dist/collection/components/q2-action-group/test/q2-action-group.spec.js.map +1 -1
  59. package/dist/collection/components/q2-action-sheet/q2-action-sheet.js +1 -1
  60. package/dist/collection/components/q2-action-sheet/q2-action-sheet.js.map +1 -1
  61. package/dist/collection/components/q2-action-sheet/test/q2-action-sheet-test.e2e.js.map +1 -1
  62. package/dist/collection/components/q2-avatar/q2-avatar.js +1 -1
  63. package/dist/collection/components/q2-avatar/q2-avatar.js.map +1 -1
  64. package/dist/collection/components/q2-avatar/test/q2-avatar-test.e2e.js.map +1 -1
  65. package/dist/collection/components/q2-badge/q2-badge.js.map +1 -1
  66. package/dist/collection/components/q2-badge/test/q2-badge-test.e2e.js.map +1 -1
  67. package/dist/collection/components/q2-btn/q2-btn.js.map +1 -1
  68. package/dist/collection/components/q2-btn/test/q2-btn-test.e2e.js.map +1 -1
  69. package/dist/collection/components/q2-calendar/q2-calendar-helpers.js.map +1 -1
  70. package/dist/collection/components/q2-calendar/q2-calendar-types.js.map +1 -1
  71. package/dist/collection/components/q2-calendar/q2-calendar-validation.js.map +1 -1
  72. package/dist/collection/components/q2-calendar/q2-calendar.js.map +1 -1
  73. package/dist/collection/components/q2-calendar/q2-month-picker.js +2 -2
  74. package/dist/collection/components/q2-calendar/q2-month-picker.js.map +1 -1
  75. package/dist/collection/components/q2-calendar/test/helpers-test.e2e.js.map +1 -1
  76. package/dist/collection/components/q2-calendar/test/q2-calendar-month-picker-test.e2e.js.map +1 -1
  77. package/dist/collection/components/q2-calendar/test/q2-calendar-test.e2e.js +2 -2
  78. package/dist/collection/components/q2-calendar/test/q2-calendar-test.e2e.js.map +1 -1
  79. package/dist/collection/components/q2-calendar/test/validation-test.e2e.js.map +1 -1
  80. package/dist/collection/components/q2-card/q2-card.js.map +1 -1
  81. package/dist/collection/components/q2-card/test/q2-card-test.e2e.js.map +1 -1
  82. package/dist/collection/components/q2-carousel/q2-carousel.js.map +1 -1
  83. package/dist/collection/components/q2-carousel/test/q2-carousel-test.e2e.js.map +1 -1
  84. package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js +2 -2
  85. package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js.map +1 -1
  86. package/dist/collection/components/q2-carousel-pane/test/q2-carousel-pane-test.e2e.js.map +1 -1
  87. package/dist/collection/components/q2-carousel-pane/test/q2-carousel-pane-test.spec.js.map +1 -1
  88. package/dist/collection/components/q2-chart-area/q2-chart-area.js +1 -1
  89. package/dist/collection/components/q2-chart-area/q2-chart-area.js.map +1 -1
  90. package/dist/collection/components/q2-chart-area/test/q2-chart-area-test.e2e.js.map +1 -1
  91. package/dist/collection/components/q2-chart-bar/q2-chart-bar.js +1 -1
  92. package/dist/collection/components/q2-chart-bar/q2-chart-bar.js.map +1 -1
  93. package/dist/collection/components/q2-chart-bar/test/q2-chart-bar-test.e2e.js.map +1 -1
  94. package/dist/collection/components/q2-chart-donut/q2-chart-donut.js +1 -1
  95. package/dist/collection/components/q2-chart-donut/q2-chart-donut.js.map +1 -1
  96. package/dist/collection/components/q2-chart-donut/test/q2-chart-donut-test.e2e.js.map +1 -1
  97. package/dist/collection/components/q2-checkbox/q2-checkbox.js.map +1 -1
  98. package/dist/collection/components/q2-checkbox/test/q2-checkbox-test.e2e.js.map +1 -1
  99. package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.js.map +1 -1
  100. package/dist/collection/components/q2-checkbox-group/test/q2-checkbox-group-test.e2e.js.map +1 -1
  101. package/dist/collection/components/q2-currency/q2-currency.js +1 -1
  102. package/dist/collection/components/q2-currency/q2-currency.js.map +1 -1
  103. package/dist/collection/components/q2-currency/test/q2-currency-test.e2e.js.map +1 -1
  104. package/dist/collection/components/q2-data-table/q2-data-table.js.map +1 -1
  105. package/dist/collection/components/q2-data-table/test/q2-data-table-test.e2e.js.map +1 -1
  106. package/dist/collection/components/q2-detail/q2-detail.js +1 -1
  107. package/dist/collection/components/q2-detail/q2-detail.js.map +1 -1
  108. package/dist/collection/components/q2-detail/test/q2-detail-test.e2e.js.map +1 -1
  109. package/dist/collection/components/q2-dropdown/q2-dropdown.js +3 -1
  110. package/dist/collection/components/q2-dropdown/q2-dropdown.js.map +1 -1
  111. package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.e2e.js +5 -17
  112. package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.e2e.js.map +1 -1
  113. package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.js.map +1 -1
  114. package/dist/collection/components/q2-dropdown-item/test/q2-dropdown-item-test.e2e.js.map +1 -1
  115. package/dist/collection/components/q2-editable-field/q2-editable-field.js.map +1 -1
  116. package/dist/collection/components/q2-editable-field/test/q2-editable-field-test.e2e.js.map +1 -1
  117. package/dist/collection/components/q2-formatted-text/q2-formatted-text.js +1 -1
  118. package/dist/collection/components/q2-formatted-text/q2-formatted-text.js.map +1 -1
  119. package/dist/collection/components/q2-formatted-text/test/q2-formatted-text-test.e2e.js.map +1 -1
  120. package/dist/collection/components/q2-icon/q2-icon-types.js.map +1 -1
  121. package/dist/collection/components/q2-icon/q2-icon.js.map +1 -1
  122. package/dist/collection/components/q2-icon/test/q2-icon-test.e2e.js.map +1 -1
  123. package/dist/collection/components/q2-input/formatting/alpha.js.map +1 -1
  124. package/dist/collection/components/q2-input/formatting/alphanumeric.js.map +1 -1
  125. package/dist/collection/components/q2-input/formatting/credit-card.js.map +1 -1
  126. package/dist/collection/components/q2-input/formatting/credit-card.spec.js.map +1 -1
  127. package/dist/collection/components/q2-input/formatting/currency.js.map +1 -1
  128. package/dist/collection/components/q2-input/formatting/date.js.map +1 -1
  129. package/dist/collection/components/q2-input/formatting/generic.js.map +1 -1
  130. package/dist/collection/components/q2-input/formatting/number.js.map +1 -1
  131. package/dist/collection/components/q2-input/formatting/numeric.js.map +1 -1
  132. package/dist/collection/components/q2-input/formatting/phone.js.map +1 -1
  133. package/dist/collection/components/q2-input/formatting/postal.js.map +1 -1
  134. package/dist/collection/components/q2-input/formatting/ssn.js.map +1 -1
  135. package/dist/collection/components/q2-input/formatting/tin.js.map +1 -1
  136. package/dist/collection/components/q2-input/q2-input-types.js.map +1 -1
  137. package/dist/collection/components/q2-input/q2-input.js +1 -1
  138. package/dist/collection/components/q2-input/q2-input.js.map +1 -1
  139. package/dist/collection/components/q2-input/test/q2-input-credit-card-test.e2e.js.map +1 -1
  140. package/dist/collection/components/q2-input/test/q2-input-test.e2e.js.map +1 -1
  141. package/dist/collection/components/q2-item/q2-item.js +1 -1
  142. package/dist/collection/components/q2-item/q2-item.js.map +1 -1
  143. package/dist/collection/components/q2-item/test/q2-item-test.e2e.js.map +1 -1
  144. package/dist/collection/components/q2-item/test/q2-item-test.spec.js.map +1 -1
  145. package/dist/collection/components/q2-legend/q2-legend.js +1 -1
  146. package/dist/collection/components/q2-legend/q2-legend.js.map +1 -1
  147. package/dist/collection/components/q2-legend/test/q2-legend-test.e2e.js.map +1 -1
  148. package/dist/collection/components/q2-legend/test/q2-legend-test.spec.js.map +1 -1
  149. package/dist/collection/components/q2-link/q2-link.js.map +1 -1
  150. package/dist/collection/components/q2-link/test/q2-link-test.e2e.js.map +1 -1
  151. package/dist/collection/components/q2-list/q2-list.js +1 -1
  152. package/dist/collection/components/q2-list/q2-list.js.map +1 -1
  153. package/dist/collection/components/q2-list/test/q2-list-test.e2e.js.map +1 -1
  154. package/dist/collection/components/q2-loading/q2-loading.js.map +1 -1
  155. package/dist/collection/components/q2-loading/skeleton/q2-loading-element/index.js.map +1 -1
  156. package/dist/collection/components/q2-loading/skeleton/shapes.js.map +1 -1
  157. package/dist/collection/components/q2-loading/test/q2-loading-element-test.e2e.js.map +1 -1
  158. package/dist/collection/components/q2-loading/test/q2-loading-test.e2e.js.map +1 -1
  159. package/dist/collection/components/q2-loc/q2-loc.js +1 -1
  160. package/dist/collection/components/q2-loc/q2-loc.js.map +1 -1
  161. package/dist/collection/components/q2-loc/test/q2-loc-test.e2e.js.map +1 -1
  162. package/dist/collection/components/q2-message/q2-message.js +1 -1
  163. package/dist/collection/components/q2-message/q2-message.js.map +1 -1
  164. package/dist/collection/components/q2-message/test/q2-message-test.e2e.js.map +1 -1
  165. package/dist/collection/components/q2-optgroup/q2-optgroup.js +1 -1
  166. package/dist/collection/components/q2-optgroup/q2-optgroup.js.map +1 -1
  167. package/dist/collection/components/q2-optgroup/test/q2-optgroup-test.e2e.js.map +1 -1
  168. package/dist/collection/components/q2-option/q2-option.js +1 -1
  169. package/dist/collection/components/q2-option/q2-option.js.map +1 -1
  170. package/dist/collection/components/q2-option/test/q2-option-test.e2e.js.map +1 -1
  171. package/dist/collection/components/q2-option-list/q2-option-list.js.map +1 -1
  172. package/dist/collection/components/q2-option-list/test/q2-option-list-test.e2e.js.map +1 -1
  173. package/dist/collection/components/q2-pagination/q2-pagination.js +2 -2
  174. package/dist/collection/components/q2-pagination/q2-pagination.js.map +1 -1
  175. package/dist/collection/components/q2-pagination/test/q2-pagination-test.e2e.js +1 -0
  176. package/dist/collection/components/q2-pagination/test/q2-pagination-test.e2e.js.map +1 -1
  177. package/dist/collection/components/q2-pill/q2-pill.js +1 -1
  178. package/dist/collection/components/q2-pill/q2-pill.js.map +1 -1
  179. package/dist/collection/components/q2-pill/test/q2-pill-test.e2e.js +1 -1
  180. package/dist/collection/components/q2-pill/test/q2-pill-test.e2e.js.map +1 -1
  181. package/dist/collection/components/q2-popover/q2-popover.css +18 -10
  182. package/dist/collection/components/q2-popover/q2-popover.js +78 -81
  183. package/dist/collection/components/q2-popover/q2-popover.js.map +1 -1
  184. package/dist/collection/components/q2-popover/test/q2-popover-test.e2e.js +1 -83
  185. package/dist/collection/components/q2-popover/test/q2-popover-test.e2e.js.map +1 -1
  186. package/dist/collection/components/q2-popover/test/q2-popover-test.spec.js +902 -511
  187. package/dist/collection/components/q2-popover/test/q2-popover-test.spec.js.map +1 -1
  188. package/dist/collection/components/q2-radio/q2-radio.js.map +1 -1
  189. package/dist/collection/components/q2-radio/test/q2-radio-test.e2e.js.map +1 -1
  190. package/dist/collection/components/q2-radio-group/q2-radio-group.js.map +1 -1
  191. package/dist/collection/components/q2-radio-group/test/q2-radio-group-test.e2e.js.map +1 -1
  192. package/dist/collection/components/q2-relative-time/q2-relative-time.js +1 -1
  193. package/dist/collection/components/q2-relative-time/q2-relative-time.js.map +1 -1
  194. package/dist/collection/components/q2-relative-time/test/q2-relative-time-test.e2e.js.map +1 -1
  195. package/dist/collection/components/q2-resize-observer/q2-resize-observer.js +1 -1
  196. package/dist/collection/components/q2-resize-observer/q2-resize-observer.js.map +1 -1
  197. package/dist/collection/components/q2-resize-observer/test/q2-resize-observer.e2e.js.map +1 -1
  198. package/dist/collection/components/q2-resize-observer/test/q2-resize-observer.spec.js.map +1 -1
  199. package/dist/collection/components/q2-section/q2-section.js +2 -2
  200. package/dist/collection/components/q2-section/q2-section.js.map +1 -1
  201. package/dist/collection/components/q2-section/test/q2-section-test.e2e.js.map +1 -1
  202. package/dist/collection/components/q2-select/q2-select.js +155 -19
  203. package/dist/collection/components/q2-select/q2-select.js.map +1 -1
  204. package/dist/collection/components/q2-select/test/q2-select-test.e2e.js +1 -2
  205. package/dist/collection/components/q2-select/test/q2-select-test.e2e.js.map +1 -1
  206. package/dist/collection/components/q2-select/test/q2-select-test.spec.js +552 -0
  207. package/dist/collection/components/q2-select/test/q2-select-test.spec.js.map +1 -0
  208. package/dist/collection/components/q2-stepper/q2-stepper.js +1 -1
  209. package/dist/collection/components/q2-stepper/q2-stepper.js.map +1 -1
  210. package/dist/collection/components/q2-stepper/test/q2-stepper-test.e2e.js.map +1 -1
  211. package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js.map +1 -1
  212. package/dist/collection/components/q2-stepper-pane/test/q2-stepper-pane-test.e2e.js.map +1 -1
  213. package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js +1 -1
  214. package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js.map +1 -1
  215. package/dist/collection/components/q2-stepper-vertical/test/q2-stepper-vertical-test.e2e.js.map +1 -1
  216. package/dist/collection/components/q2-tab-container/q2-tab-container.js +1 -1
  217. package/dist/collection/components/q2-tab-container/q2-tab-container.js.map +1 -1
  218. package/dist/collection/components/q2-tab-container/test/q2-tab-container-test.e2e.js.map +1 -1
  219. package/dist/collection/components/q2-tab-container/test/q2-tab-container-test.spec.js.map +1 -1
  220. package/dist/collection/components/q2-tab-pane/q2-tab-pane.js +1 -1
  221. package/dist/collection/components/q2-tab-pane/q2-tab-pane.js.map +1 -1
  222. package/dist/collection/components/q2-tab-pane/test/q2-tab-pane-test.e2e.js.map +1 -1
  223. package/dist/collection/components/q2-tag/q2-tag.js +1 -1
  224. package/dist/collection/components/q2-tag/q2-tag.js.map +1 -1
  225. package/dist/collection/components/q2-tag/test/q2-tag-test.e2e.js +6 -1
  226. package/dist/collection/components/q2-tag/test/q2-tag-test.e2e.js.map +1 -1
  227. package/dist/collection/components/q2-textarea/q2-textarea.js +1 -1
  228. package/dist/collection/components/q2-textarea/q2-textarea.js.map +1 -1
  229. package/dist/collection/components/q2-textarea/test/q2-textarea-test.e2e.js.map +1 -1
  230. package/dist/collection/components/q2-tooltip/q2-tooltip.js.map +1 -1
  231. package/dist/collection/components/q2-tooltip/test/q2-tooltip-test.e2e.js.map +1 -1
  232. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane-types.js.map +1 -1
  233. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +2 -2
  234. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js.map +1 -1
  235. package/dist/collection/components/tecton-tab-pane/test/tecton-tab-pane-test.e2e.js.map +1 -1
  236. package/dist/collection/index.js.map +1 -1
  237. package/dist/collection/utils/action-sheet.js.map +1 -1
  238. package/dist/collection/utils/charting.js.map +1 -1
  239. package/dist/collection/utils/helpers.js.map +1 -1
  240. package/dist/collection/utils/index.js +37 -0
  241. package/dist/collection/utils/index.js.map +1 -1
  242. package/dist/collection/utils/sanitize-html-string.js.map +1 -1
  243. package/dist/collection/utils/sanitize-regex-string.js.map +1 -1
  244. package/dist/collection/utils/test/action-sheet-test.e2e.js.map +1 -1
  245. package/dist/collection/utils/test/index.spec.js.map +1 -1
  246. package/dist/components/index2.js +29 -17
  247. package/dist/components/index2.js.map +1 -1
  248. package/dist/components/q2-action-group.js +1 -1
  249. package/dist/components/q2-action-sheet.js +1 -1
  250. package/dist/components/q2-avatar2.js +1 -1
  251. package/dist/components/q2-carousel-pane.js +2 -2
  252. package/dist/components/q2-chart-area.js +1 -1
  253. package/dist/components/q2-chart-bar.js +1 -1
  254. package/dist/components/q2-chart-donut.js +1 -1
  255. package/dist/components/q2-currency.js +1 -1
  256. package/dist/components/q2-detail.js +1 -1
  257. package/dist/components/q2-dropdown.js +3 -1
  258. package/dist/components/q2-dropdown.js.map +1 -1
  259. package/dist/components/q2-formatted-text.js +1 -1
  260. package/dist/components/q2-input2.js +1 -1
  261. package/dist/components/q2-item.js +1 -1
  262. package/dist/components/q2-legend2.js +1 -1
  263. package/dist/components/q2-list.js +1 -1
  264. package/dist/components/q2-loc.js +1 -1
  265. package/dist/components/q2-message2.js +1 -1
  266. package/dist/components/q2-month-picker.js +2 -2
  267. package/dist/components/q2-optgroup2.js +1 -1
  268. package/dist/components/q2-option2.js +1 -1
  269. package/dist/components/q2-pagination.js +2 -2
  270. package/dist/components/q2-pill.js +1 -1
  271. package/dist/components/q2-popover2.js +77 -81
  272. package/dist/components/q2-popover2.js.map +1 -1
  273. package/dist/components/q2-relative-time.js +1 -1
  274. package/dist/components/q2-resize-observer2.js +1 -1
  275. package/dist/components/q2-section.js +2 -2
  276. package/dist/components/q2-select2.js +137 -20
  277. package/dist/components/q2-select2.js.map +1 -1
  278. package/dist/components/q2-stepper-vertical.js +1 -1
  279. package/dist/components/q2-stepper.js +1 -1
  280. package/dist/components/q2-tab-container.js +1 -1
  281. package/dist/components/q2-tab-pane.js +1 -1
  282. package/dist/components/q2-tag.js +1 -1
  283. package/dist/components/q2-textarea.js +1 -1
  284. package/dist/components/tecton-tab-pane.js +2 -2
  285. package/dist/esm/click-elsewhere_2.entry.js +77 -81
  286. package/dist/esm/click-elsewhere_2.entry.js.map +1 -1
  287. package/dist/esm/{index-844fc010.js → index-7409eb95.js} +30 -18
  288. package/dist/esm/index-7409eb95.js.map +1 -0
  289. package/dist/esm/loader.js +1 -1
  290. package/dist/esm/q2-action-group.entry.js +1 -1
  291. package/dist/esm/q2-action-sheet.entry.js +2 -2
  292. package/dist/esm/q2-avatar.entry.js +1 -1
  293. package/dist/esm/q2-badge_7.entry.js +4 -4
  294. package/dist/esm/q2-calendar.entry.js +1 -1
  295. package/dist/esm/q2-card.entry.js +1 -1
  296. package/dist/esm/q2-carousel-pane.entry.js +3 -3
  297. package/dist/esm/q2-carousel.entry.js +1 -1
  298. package/dist/esm/q2-chart-area.entry.js +2 -2
  299. package/dist/esm/q2-chart-bar.entry.js +2 -2
  300. package/dist/esm/q2-chart-donut.entry.js +2 -2
  301. package/dist/esm/q2-checkbox-group.entry.js +1 -1
  302. package/dist/esm/q2-checkbox.entry.js +1 -1
  303. package/dist/esm/q2-currency.entry.js +1 -1
  304. package/dist/esm/q2-data-table.entry.js +1 -1
  305. package/dist/esm/q2-detail.entry.js +2 -2
  306. package/dist/esm/q2-dropdown-item.entry.js +1 -1
  307. package/dist/esm/q2-dropdown.entry.js +4 -2
  308. package/dist/esm/q2-dropdown.entry.js.map +1 -1
  309. package/dist/esm/q2-editable-field.entry.js +1 -1
  310. package/dist/esm/q2-formatted-text.entry.js +1 -1
  311. package/dist/esm/q2-item.entry.js +2 -2
  312. package/dist/esm/q2-legend.entry.js +1 -1
  313. package/dist/esm/q2-list.entry.js +2 -2
  314. package/dist/esm/q2-loc.entry.js +2 -2
  315. package/dist/esm/q2-message.entry.js +2 -2
  316. package/dist/esm/q2-month-picker.entry.js +3 -3
  317. package/dist/esm/q2-optgroup.entry.js +2 -2
  318. package/dist/esm/q2-option-list.entry.js +1 -1
  319. package/dist/esm/q2-option.entry.js +1 -1
  320. package/dist/esm/q2-pagination.entry.js +3 -3
  321. package/dist/esm/q2-pill.entry.js +2 -2
  322. package/dist/esm/q2-radio-group.entry.js +1 -1
  323. package/dist/esm/q2-radio.entry.js +1 -1
  324. package/dist/esm/q2-relative-time.entry.js +2 -2
  325. package/dist/esm/q2-resize-observer.entry.js +1 -1
  326. package/dist/esm/q2-section.entry.js +3 -3
  327. package/dist/esm/q2-select.entry.js +135 -18
  328. package/dist/esm/q2-select.entry.js.map +1 -1
  329. package/dist/esm/q2-stepper-pane.entry.js +1 -1
  330. package/dist/esm/q2-stepper-vertical.entry.js +2 -2
  331. package/dist/esm/q2-stepper.entry.js +2 -2
  332. package/dist/esm/q2-tag.entry.js +2 -2
  333. package/dist/esm/q2-tecton-elements.js +1 -1
  334. package/dist/esm/q2-textarea.entry.js +2 -2
  335. package/dist/esm/q2-tooltip.entry.js +1 -1
  336. package/dist/esm/tecton-tab-pane.entry.js +2 -2
  337. package/dist/jest.setup.js +33 -0
  338. package/dist/jest.setup.js.map +1 -0
  339. package/dist/q2-tecton-elements/p-011a8cb6.js +2 -0
  340. package/dist/{esm/index-844fc010.js.map → q2-tecton-elements/p-011a8cb6.js.map} +1 -1
  341. package/dist/q2-tecton-elements/p-0ab7d3d3.entry.js +2 -0
  342. package/dist/q2-tecton-elements/p-0ab7d3d3.entry.js.map +1 -0
  343. package/dist/q2-tecton-elements/{p-b7de110e.entry.js → p-0b56edea.entry.js} +2 -2
  344. package/dist/q2-tecton-elements/p-11f9deb7.entry.js +2 -0
  345. package/dist/q2-tecton-elements/p-11f9deb7.entry.js.map +1 -0
  346. package/dist/q2-tecton-elements/{p-81fbe718.entry.js → p-12286a4c.entry.js} +2 -2
  347. package/dist/q2-tecton-elements/{p-7c9a0122.entry.js → p-127e2513.entry.js} +2 -2
  348. package/dist/q2-tecton-elements/{p-7c9f8b62.entry.js → p-15383dc8.entry.js} +2 -2
  349. package/dist/q2-tecton-elements/{p-0d50ee56.entry.js → p-2bc82b46.entry.js} +2 -2
  350. package/dist/q2-tecton-elements/{p-f5f23659.entry.js → p-33f52a11.entry.js} +2 -2
  351. package/dist/q2-tecton-elements/{p-a47597dd.entry.js → p-385e6ae1.entry.js} +2 -2
  352. package/dist/q2-tecton-elements/{p-e0ae03c0.entry.js → p-45dc2aab.entry.js} +2 -2
  353. package/dist/q2-tecton-elements/{p-07d1c3ae.entry.js → p-4e4aa30e.entry.js} +2 -2
  354. package/dist/q2-tecton-elements/{p-16910682.entry.js → p-4ecad44e.entry.js} +2 -2
  355. package/dist/q2-tecton-elements/{p-7aef0c08.entry.js → p-4f77b52f.entry.js} +2 -2
  356. package/dist/q2-tecton-elements/{p-20a3d6ed.entry.js → p-5178f2cb.entry.js} +2 -2
  357. package/dist/q2-tecton-elements/{p-188eb162.entry.js → p-52af46d1.entry.js} +3 -3
  358. package/dist/q2-tecton-elements/{p-1c88d057.entry.js → p-5488af98.entry.js} +2 -2
  359. package/dist/q2-tecton-elements/{p-1c760a89.entry.js → p-5706de19.entry.js} +2 -2
  360. package/dist/q2-tecton-elements/{p-8d2b02e1.entry.js → p-5c71d589.entry.js} +2 -2
  361. package/dist/q2-tecton-elements/{p-e216ef3f.entry.js → p-5d809a5d.entry.js} +2 -2
  362. package/dist/q2-tecton-elements/{p-ac6aa392.entry.js → p-6214e9c0.entry.js} +2 -2
  363. package/dist/q2-tecton-elements/{p-3e428290.entry.js → p-6c190e64.entry.js} +2 -2
  364. package/dist/q2-tecton-elements/{p-06701928.entry.js → p-734efa4a.entry.js} +2 -2
  365. package/dist/q2-tecton-elements/{p-490ef8e5.entry.js → p-77de2770.entry.js} +2 -2
  366. package/dist/q2-tecton-elements/{p-4e10550d.entry.js → p-7823fd55.entry.js} +2 -2
  367. package/dist/q2-tecton-elements/{p-c5667d5d.entry.js → p-7c48cd76.entry.js} +2 -2
  368. package/dist/q2-tecton-elements/{p-7903cd15.entry.js → p-8d130707.entry.js} +2 -2
  369. package/dist/q2-tecton-elements/{p-7906f49e.entry.js → p-96bc1deb.entry.js} +2 -2
  370. package/dist/q2-tecton-elements/{p-5637c486.entry.js → p-998d2b5e.entry.js} +2 -2
  371. package/dist/q2-tecton-elements/{p-ad057d10.entry.js → p-9aadc2e6.entry.js} +2 -2
  372. package/dist/q2-tecton-elements/{p-e2c800ef.entry.js → p-9e8e33e4.entry.js} +2 -2
  373. package/dist/q2-tecton-elements/{p-c235ab3f.entry.js → p-a746e0d1.entry.js} +2 -2
  374. package/dist/q2-tecton-elements/{p-50f7328f.entry.js → p-b4f2418c.entry.js} +2 -2
  375. package/dist/q2-tecton-elements/{p-5f99a4a8.entry.js → p-bcc27542.entry.js} +2 -2
  376. package/dist/q2-tecton-elements/{p-5a834214.entry.js → p-bd9559b6.entry.js} +2 -2
  377. package/dist/q2-tecton-elements/{p-2733583e.entry.js → p-c324d1c8.entry.js} +2 -2
  378. package/dist/q2-tecton-elements/{p-b1784be3.entry.js → p-c5fa02eb.entry.js} +2 -2
  379. package/dist/q2-tecton-elements/{p-96b1406c.entry.js → p-d326261a.entry.js} +2 -2
  380. package/dist/q2-tecton-elements/{p-8d07cf91.entry.js → p-dd00b967.entry.js} +2 -2
  381. package/dist/q2-tecton-elements/p-ddada899.entry.js +2 -0
  382. package/dist/q2-tecton-elements/{p-1f0b9209.entry.js.map → p-ddada899.entry.js.map} +1 -1
  383. package/dist/q2-tecton-elements/{p-4774e5b3.entry.js → p-e0a617fd.entry.js} +2 -2
  384. package/dist/q2-tecton-elements/{p-ff8f1a32.entry.js → p-ebc71f10.entry.js} +2 -2
  385. package/dist/q2-tecton-elements/{p-a5d0e252.entry.js → p-eef77a94.entry.js} +2 -2
  386. package/dist/q2-tecton-elements/{p-fff01dc1.entry.js → p-f3101416.entry.js} +2 -2
  387. package/dist/q2-tecton-elements/{p-95a7c042.entry.js → p-fdde906e.entry.js} +2 -2
  388. package/dist/q2-tecton-elements/{p-61d68630.entry.js → p-fdf71eb1.entry.js} +2 -2
  389. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  390. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js.map +1 -1
  391. package/dist/types/builds/q2e/development/tecton/tecton/packages/q2-tecton-elements/.stencil/jest.setup.d.ts +10 -0
  392. package/dist/types/components/q2-popover/q2-popover.d.ts +4 -5
  393. package/dist/types/components/q2-select/q2-select.d.ts +23 -0
  394. package/dist/types/utils/index.d.ts +3 -0
  395. package/package.json +3 -3
  396. package/dist/cjs/index-9aa4a776.js.map +0 -1
  397. package/dist/q2-tecton-elements/p-15ac45d6.js +0 -2
  398. package/dist/q2-tecton-elements/p-15ac45d6.js.map +0 -1
  399. package/dist/q2-tecton-elements/p-1f0b9209.entry.js +0 -2
  400. package/dist/q2-tecton-elements/p-56df21b0.entry.js +0 -2
  401. package/dist/q2-tecton-elements/p-56df21b0.entry.js.map +0 -1
  402. package/dist/q2-tecton-elements/p-6f5b7571.entry.js +0 -2
  403. package/dist/q2-tecton-elements/p-6f5b7571.entry.js.map +0 -1
  404. /package/dist/q2-tecton-elements/{p-b7de110e.entry.js.map → p-0b56edea.entry.js.map} +0 -0
  405. /package/dist/q2-tecton-elements/{p-81fbe718.entry.js.map → p-12286a4c.entry.js.map} +0 -0
  406. /package/dist/q2-tecton-elements/{p-7c9a0122.entry.js.map → p-127e2513.entry.js.map} +0 -0
  407. /package/dist/q2-tecton-elements/{p-7c9f8b62.entry.js.map → p-15383dc8.entry.js.map} +0 -0
  408. /package/dist/q2-tecton-elements/{p-0d50ee56.entry.js.map → p-2bc82b46.entry.js.map} +0 -0
  409. /package/dist/q2-tecton-elements/{p-f5f23659.entry.js.map → p-33f52a11.entry.js.map} +0 -0
  410. /package/dist/q2-tecton-elements/{p-a47597dd.entry.js.map → p-385e6ae1.entry.js.map} +0 -0
  411. /package/dist/q2-tecton-elements/{p-e0ae03c0.entry.js.map → p-45dc2aab.entry.js.map} +0 -0
  412. /package/dist/q2-tecton-elements/{p-07d1c3ae.entry.js.map → p-4e4aa30e.entry.js.map} +0 -0
  413. /package/dist/q2-tecton-elements/{p-16910682.entry.js.map → p-4ecad44e.entry.js.map} +0 -0
  414. /package/dist/q2-tecton-elements/{p-7aef0c08.entry.js.map → p-4f77b52f.entry.js.map} +0 -0
  415. /package/dist/q2-tecton-elements/{p-20a3d6ed.entry.js.map → p-5178f2cb.entry.js.map} +0 -0
  416. /package/dist/q2-tecton-elements/{p-188eb162.entry.js.map → p-52af46d1.entry.js.map} +0 -0
  417. /package/dist/q2-tecton-elements/{p-1c88d057.entry.js.map → p-5488af98.entry.js.map} +0 -0
  418. /package/dist/q2-tecton-elements/{p-1c760a89.entry.js.map → p-5706de19.entry.js.map} +0 -0
  419. /package/dist/q2-tecton-elements/{p-8d2b02e1.entry.js.map → p-5c71d589.entry.js.map} +0 -0
  420. /package/dist/q2-tecton-elements/{p-e216ef3f.entry.js.map → p-5d809a5d.entry.js.map} +0 -0
  421. /package/dist/q2-tecton-elements/{p-ac6aa392.entry.js.map → p-6214e9c0.entry.js.map} +0 -0
  422. /package/dist/q2-tecton-elements/{p-3e428290.entry.js.map → p-6c190e64.entry.js.map} +0 -0
  423. /package/dist/q2-tecton-elements/{p-06701928.entry.js.map → p-734efa4a.entry.js.map} +0 -0
  424. /package/dist/q2-tecton-elements/{p-490ef8e5.entry.js.map → p-77de2770.entry.js.map} +0 -0
  425. /package/dist/q2-tecton-elements/{p-4e10550d.entry.js.map → p-7823fd55.entry.js.map} +0 -0
  426. /package/dist/q2-tecton-elements/{p-c5667d5d.entry.js.map → p-7c48cd76.entry.js.map} +0 -0
  427. /package/dist/q2-tecton-elements/{p-7903cd15.entry.js.map → p-8d130707.entry.js.map} +0 -0
  428. /package/dist/q2-tecton-elements/{p-7906f49e.entry.js.map → p-96bc1deb.entry.js.map} +0 -0
  429. /package/dist/q2-tecton-elements/{p-5637c486.entry.js.map → p-998d2b5e.entry.js.map} +0 -0
  430. /package/dist/q2-tecton-elements/{p-ad057d10.entry.js.map → p-9aadc2e6.entry.js.map} +0 -0
  431. /package/dist/q2-tecton-elements/{p-e2c800ef.entry.js.map → p-9e8e33e4.entry.js.map} +0 -0
  432. /package/dist/q2-tecton-elements/{p-c235ab3f.entry.js.map → p-a746e0d1.entry.js.map} +0 -0
  433. /package/dist/q2-tecton-elements/{p-50f7328f.entry.js.map → p-b4f2418c.entry.js.map} +0 -0
  434. /package/dist/q2-tecton-elements/{p-5f99a4a8.entry.js.map → p-bcc27542.entry.js.map} +0 -0
  435. /package/dist/q2-tecton-elements/{p-5a834214.entry.js.map → p-bd9559b6.entry.js.map} +0 -0
  436. /package/dist/q2-tecton-elements/{p-2733583e.entry.js.map → p-c324d1c8.entry.js.map} +0 -0
  437. /package/dist/q2-tecton-elements/{p-b1784be3.entry.js.map → p-c5fa02eb.entry.js.map} +0 -0
  438. /package/dist/q2-tecton-elements/{p-96b1406c.entry.js.map → p-d326261a.entry.js.map} +0 -0
  439. /package/dist/q2-tecton-elements/{p-8d07cf91.entry.js.map → p-dd00b967.entry.js.map} +0 -0
  440. /package/dist/q2-tecton-elements/{p-4774e5b3.entry.js.map → p-e0a617fd.entry.js.map} +0 -0
  441. /package/dist/q2-tecton-elements/{p-ff8f1a32.entry.js.map → p-ebc71f10.entry.js.map} +0 -0
  442. /package/dist/q2-tecton-elements/{p-a5d0e252.entry.js.map → p-eef77a94.entry.js.map} +0 -0
  443. /package/dist/q2-tecton-elements/{p-fff01dc1.entry.js.map → p-f3101416.entry.js.map} +0 -0
  444. /package/dist/q2-tecton-elements/{p-95a7c042.entry.js.map → p-fdde906e.entry.js.map} +0 -0
  445. /package/dist/q2-tecton-elements/{p-61d68630.entry.js.map → p-fdf71eb1.entry.js.map} +0 -0
@@ -278,7 +278,7 @@ const Q2StepperVertical$1 = /*@__PURE__*/ proxyCustomElement(class Q2StepperVert
278
278
  return (h("li", { role: "presentation" }, h("button", { class: stepClasses.join(' '), type: "button", "aria-labelledby": labelId, "aria-describedBy": descriptionId, "aria-label": btnLabel, "aria-selected": `${isCurrentStep}`, "aria-expanded": !!pane.children.length ? `${isExpanded}` : null, id: id, "aria-disabled": isLocked ? 'true' : null, role: "tab", tabIndex: isCurrentStep ? 0 : -1, onKeyDown: ev => !isLocked && this.onStepKeyDown(ev, id), onClick: ev => !isLocked && this.onStepClick(ev, id) }, statusIcon ? (h("div", { class: "step-icon" }, h("q2-icon", { type: statusIcon }))) : (h("div", { class: "step-bubble" }, stepNumber)), label && (h("div", null, h("div", { class: "step-label", id: labelId }, stepLabel), description && (h("div", { class: "step-description", id: descriptionId }, loc(description)))))), this.renderSpacer(pane, stepLabel, isExpanded, isLastStep)));
279
279
  }
280
280
  render() {
281
- return (h(Fragment, { key: '7ae13fa2f0b7eb1c9fd67fbc46a554c499370769' }, h("ul", { key: '348ba34130cba480f99c1354cca50fba929c4021', role: "tablist" }, this.structuredPanes.map((pane, index) => this.renderStepBtn(pane, index))), h("div", { key: 'dcb4c1d54e8f3ebde6872c48d92a84809626ea65', role: "list" }, h("slot", { key: '216afda1b4ac14b3e925db9e10478a127cdbc90f' }))));
281
+ return (h(Fragment, { key: 'c2600aea6c67ca0fd930191371ae76161cd613b1' }, h("ul", { key: 'a1c69bab32dcdc4fb3b7a2f7f2d0a0964496e686', role: "tablist" }, this.structuredPanes.map((pane, index) => this.renderStepBtn(pane, index))), h("div", { key: 'dd078979accca9f9e88670cedfead4a6a74271e4', role: "list" }, h("slot", { key: '5152cff4a5661558296375cb89580801dd439e4c' }))));
282
282
  }
283
283
  get hostElement() { return this; }
284
284
  static get watchers() { return {
@@ -252,7 +252,7 @@ const Q2Stepper$1 = /*@__PURE__*/ proxyCustomElement(class Q2Stepper extends HTM
252
252
  const containerClasses = ['step-container'];
253
253
  if (scrollEnabled)
254
254
  containerClasses.push('has-scroll');
255
- return (h(Fragment, { key: '301bb6d606d272d94d410fe02b7cbbd77fff9df6' }, h("div", { key: '092a53f199221b012f134b5570d809961ccb128a', class: containerClasses.join(' ') }, scrollEnabled && (h(Fragment, { key: '7de8b86ec973640795bd6639bb65722eeb6b5635' }, h("div", { key: '1be776974e4925344468a763bc031d69c84933da', class: "gradient-left", hidden: !showScrollLeft }), h("div", { key: '634e94553a5671a7ca5db5cf71e875cb96281e58', class: "gradient-right", hidden: !showScrollRight }), h("q2-btn", { key: '2387f9ed1f6cb08cafb07b6cf212094e61ebe197', class: "btn-left", hideLabel: true, hidden: !this.showScrollLeft, label: loc('tecton.element.stepper.scrollLeft'), onClick: () => this.onScrollBtnClick('left') }, h("q2-icon", { key: 'a80f570480facea5601eb5e39cefe39a251c85a2', type: "chevron-left" })), h("q2-btn", { key: '515178ad7c257c69e52a8fd0b70228d51586e3b1', class: "btn-right", hideLabel: true, hidden: !this.showScrollRight, label: loc('tecton.element.stepper.scrollRight'), onClick: () => this.onScrollBtnClick('right') }, h("q2-icon", { key: '198eeec44ee4ec3770b8433eac622c9e6ce8e267', type: "chevron-right" })))), h("ul", { key: 'd2e70be7ead2e575dbf621a038565a60b00e8fc3', onScroll: this.checkScrollState, ref: el => (this.listElement = el), role: "tablist" }, stepCount > 0 && [...Array(stepCount).keys()].map(stepIndex => this.renderStepBtn(stepIndex)))), h("div", { key: '94323e24a7b470daebc0f3c36512ef8068b7f8ce', role: "list" }, h("slot", { key: 'b87444498045a57258ec22830ffdf0af65502731', onSlotchange: () => this.onSlotChange() }))));
255
+ return (h(Fragment, { key: 'b5e3113cf973ac76ba9bc3234787a9880b60f71c' }, h("div", { key: '3c6a14b11e62052e01705ab487110010e9cc8794', class: containerClasses.join(' ') }, scrollEnabled && (h(Fragment, { key: '5f4e99177c34f403748aafe06623f70160939c2b' }, h("div", { key: 'bbf93c3ffc0b6b93036ee876228aeceb42152765', class: "gradient-left", hidden: !showScrollLeft }), h("div", { key: '9ca0c409de7b0eaa920d009706238b454f37a787', class: "gradient-right", hidden: !showScrollRight }), h("q2-btn", { key: 'df254f93832bbee48e921f7e524ac6682818c760', class: "btn-left", hideLabel: true, hidden: !this.showScrollLeft, label: loc('tecton.element.stepper.scrollLeft'), onClick: () => this.onScrollBtnClick('left') }, h("q2-icon", { key: 'f37c853db96405216a966f2cb3328aaf556767f1', type: "chevron-left" })), h("q2-btn", { key: '86100777aae91dfe07efa09d442cad1cab2a2193', class: "btn-right", hideLabel: true, hidden: !this.showScrollRight, label: loc('tecton.element.stepper.scrollRight'), onClick: () => this.onScrollBtnClick('right') }, h("q2-icon", { key: '63018ee77b14aac768436535b251b4d693e199df', type: "chevron-right" })))), h("ul", { key: 'c9755003117e4e4e15dbf232b457bbbd3a0e7f10', onScroll: this.checkScrollState, ref: el => (this.listElement = el), role: "tablist" }, stepCount > 0 && [...Array(stepCount).keys()].map(stepIndex => this.renderStepBtn(stepIndex)))), h("div", { key: 'adde2371383726e3577f9b2483316fce7c927155', role: "list" }, h("slot", { key: 'f0f452d46f5a6cff90c645d31a6d3bdbe5b30e8b', onSlotchange: () => this.onSlotChange() }))));
256
256
  }
257
257
  get hostElement() { return this; }
258
258
  static get watchers() { return {
@@ -262,7 +262,7 @@ const Q2TabContainer$1 = /*@__PURE__*/ proxyCustomElement(class Q2TabContainer e
262
262
  return (h("div", { class: "tab-pane-badge", "aria-label": `${tab.label}, ${tab.badgeCount} ${description}` }, tab.label, h("q2-badge", { value: tab.badgeCount, theme: theme, status: tab.badgeStatus })));
263
263
  }
264
264
  render() {
265
- return (h(Fragment, { key: 'd3227122cbfb0966ed5ef245bfb191a5ad4b3497' }, h("div", { key: 'fafe3fd90582be7ee387f10543f42fc67972898c', class: "tab-container" }, this.scrollEnabled && (h(Fragment, { key: '9f7788997823849429c18bb3efeefc901ff950c7' }, h("div", { key: '71cdbba8055f769a2aba3289f258624190096e8c', class: "gradient-left", hidden: !this.showScrollLeft }), h("div", { key: 'c94c446a56de2b5204c4aeddffa80fccb7aa2adc', class: "gradient-right", hidden: !this.showScrollRight }), h("q2-btn", { key: '29f87fe1c620d9ecd648e0f3fbb74d5f3d55bdfb', class: "btn-left", hidden: !this.showScrollLeft, onClick: () => this.onScrollBtnClick('left') }, h("q2-icon", { key: '537f3f0b7db9fc66abbc924f42921bc52d154c82', type: "chevron-left", label: "scroll left" })), h("q2-btn", { key: 'ca014731b26aec3c97b6c2d087cf127ef51082b1', class: "btn-right", hidden: !this.showScrollRight, onClick: () => this.onScrollBtnClick('right') }, h("q2-icon", { key: '27d28814e55ec845a1ea7bf79221fa35f820ef4d', type: "chevron-right", label: "scroll right" })))), h("ul", { key: '007981ca273ff2b97085f4f13008dece711cf0a6', onScroll: this.checkScrollState, ref: el => (this.listElement = el), class: this.noPrint ? 'no-print' : null, role: "tablist" }, this.tabs.map((tab, index) => this.renderTab(tab, index)))), h("div", { key: '40dfdd6fd0af54194a06f7c88c2e9cb00c1fb0de', class: "tab-content" }, h("slot", { key: 'df63966be08080fba9a4100b594f8190f970f050', onSlotchange: () => this.onSlotChange() }))));
265
+ return (h(Fragment, { key: '64d18ed57b8b8f6bd09b499a5e05dd3ef37526a4' }, h("div", { key: '27e663fee691bf52c9b0d11c2be4f75836e871db', class: "tab-container" }, this.scrollEnabled && (h(Fragment, { key: '206be14c20e85e6411ec37b4be10081d8dfd0ac3' }, h("div", { key: '88a19b5fb1b3e1a77e31bf7c247c3d5880cdabb0', class: "gradient-left", hidden: !this.showScrollLeft }), h("div", { key: '12dfb9f9ca1afb4e7cec459b6f84a6b0a96551b6', class: "gradient-right", hidden: !this.showScrollRight }), h("q2-btn", { key: '0b4f4a75c54f1e4a34bf8e6fb833ca72c48622f8', class: "btn-left", hidden: !this.showScrollLeft, onClick: () => this.onScrollBtnClick('left') }, h("q2-icon", { key: '6bad3fff42d7d1a18d5f476a459ed371f69ba1c5', type: "chevron-left", label: "scroll left" })), h("q2-btn", { key: '4667e67af11357fd199cc16a6d85096c649395c5', class: "btn-right", hidden: !this.showScrollRight, onClick: () => this.onScrollBtnClick('right') }, h("q2-icon", { key: 'e01536290f2f6afca5becb377752aaa764c2a21f', type: "chevron-right", label: "scroll right" })))), h("ul", { key: '27a5bce8d44246cbd63a5b8781a8a8cbfb7b31b7', onScroll: this.checkScrollState, ref: el => (this.listElement = el), class: this.noPrint ? 'no-print' : null, role: "tablist" }, this.tabs.map((tab, index) => this.renderTab(tab, index)))), h("div", { key: 'de97c0cdb8354adcbec9c5b721019d3540b0911a', class: "tab-content" }, h("slot", { key: '5ada170c25bfa55360f3addc5e66bf7180ee56de', onSlotchange: () => this.onSlotChange() }))));
266
266
  }
267
267
  get hostElement() { return this; }
268
268
  static get watchers() { return {
@@ -28,7 +28,7 @@ const Q2TabPane$1 = /*@__PURE__*/ proxyCustomElement(class Q2TabPane extends HTM
28
28
  // #endregion
29
29
  // #region Render Methods
30
30
  render() {
31
- return (h("div", { key: '3cd86f02e748fc4e77059cb31b5e478acf22d27a', id: `tab-pane-${this.guid}-${this.index}`, class: `tab-pane${this.selected ? '' : ' hidden'}`, role: "tabpanel", tabindex: "-1", "aria-hidden": `${!this.selected}`, "aria-labelledby": `tab-${this.guid}-${this.index}` }, h("slot", { key: 'b5d23f0194a61be45bc488480e0c9047ac07f367' })));
31
+ return (h("div", { key: '8a3e7a801e430511db3aa455d99b262edf803718', id: `tab-pane-${this.guid}-${this.index}`, class: `tab-pane${this.selected ? '' : ' hidden'}`, role: "tabpanel", tabindex: "-1", "aria-hidden": `${!this.selected}`, "aria-labelledby": `tab-${this.guid}-${this.index}` }, h("slot", { key: 'c603b8c3ad64179e39a99f25ba5a8bff43923c2c' })));
32
32
  }
33
33
  static get watchers() { return {
34
34
  "badgeCount": ["badgeObserver"],
@@ -152,7 +152,7 @@ const Q2Tag$1 = /*@__PURE__*/ proxyCustomElement(class Q2Tag extends HTMLElement
152
152
  const wrapperClassNames = ['tag'];
153
153
  if (optionCount)
154
154
  wrapperClassNames.push('has-options');
155
- return (h(Host, { key: 'e3db4189c64feb619ea9c7f377b6f9ea52a48927', role: this.optionCount > 0 ? 'list' : undefined }, h("click-elsewhere", { key: '4e8c4a8acca059010017761cc8b1fa7457eb3862', onChange: this.onClickElsewhere }, this.optionCount ? (h(Fragment, null, h("div", { class: "btn-wrapper", onClick: this.handleWrapperClick }, h("button", { class: "tag-wrapper", ref: el => (this.dropdownBtn = el), "test-id": "btn-control", type: "button", role: "combobox", onClick: this.handleClick, onKeyDown: this.handleKeydown, onFocusout: this.handleButtonFocusout, "aria-controls": "option-list", "aria-expanded": open ? 'true' : 'false', "aria-describedby": "option-description" }, h("div", { class: wrapperClassNames.join(' ') }, this.label), h("q2-icon", { type: "options" }))), this.renderHiddenElement())) : (h("div", { class: "tag-wrapper", onClick: e => e.stopPropagation() }, h("div", { class: wrapperClassNames.join(' ') }, this.label))), this.optionCount > 0 && (h("q2-popover", { key: 'fd1665df7aa579bd92b691bd90ac87f330dedd70', ref: el => (this.popoverElement = el), controlElement: this.dropdownBtn, open: this.open, maxHeight: this.popoverMaxHeight, minHeight: this.popoverMinHeight, direction: this.popoverDirection, align: this.popoverAlignment }, h("q2-option-list", { key: 'fe431b250446c2bd7da6cd0b27b24731e142ceca', id: "option-list", ref: el => (this.optionList = el), onChange: this.handleChange, type: "menu", align: "right", label: loc('tecton.element.optionList.label', [this.optionListLabel]), "no-select": true }, h("slot", { key: '4836b67e24c40a941dd659c72f7cc99e7568f9eb' })))))));
155
+ return (h(Host, { key: 'e8687a7bcc77e24647aea7c594ea370fab02df53', role: this.optionCount > 0 ? 'list' : undefined }, h("click-elsewhere", { key: '9bb842ed421239fa2101b3c2348ae9b6dc4418e2', onChange: this.onClickElsewhere }, this.optionCount ? (h(Fragment, null, h("div", { class: "btn-wrapper", onClick: this.handleWrapperClick }, h("button", { class: "tag-wrapper", ref: el => (this.dropdownBtn = el), "test-id": "btn-control", type: "button", role: "combobox", onClick: this.handleClick, onKeyDown: this.handleKeydown, onFocusout: this.handleButtonFocusout, "aria-controls": "option-list", "aria-expanded": open ? 'true' : 'false', "aria-describedby": "option-description" }, h("div", { class: wrapperClassNames.join(' ') }, this.label), h("q2-icon", { type: "options" }))), this.renderHiddenElement())) : (h("div", { class: "tag-wrapper", onClick: e => e.stopPropagation() }, h("div", { class: wrapperClassNames.join(' ') }, this.label))), this.optionCount > 0 && (h("q2-popover", { key: 'd50f403bfd5f2fa44e6e592e9953f7df247d5b08', ref: el => (this.popoverElement = el), controlElement: this.dropdownBtn, open: this.open, maxHeight: this.popoverMaxHeight, minHeight: this.popoverMinHeight, direction: this.popoverDirection, align: this.popoverAlignment }, h("q2-option-list", { key: '60ad216348d8ed2a9873d7f79fd07f0fb93f5e49', id: "option-list", ref: el => (this.optionList = el), onChange: this.handleChange, type: "menu", align: "right", label: loc('tecton.element.optionList.label', [this.optionListLabel]), "no-select": true }, h("slot", { key: '874a1163afefab4c7888e38da0aab6bbbe6abc12' })))))));
156
156
  }
157
157
  get hostElement() { return this; }
158
158
  static get style() { return Q2TagStyle0; }
@@ -296,7 +296,7 @@ const Q2Textarea$1 = /*@__PURE__*/ proxyCustomElement(class Q2Textarea extends H
296
296
  ]))));
297
297
  }
298
298
  render() {
299
- return (h("div", { key: 'ab90cf471fb50a933abb228614c6463e9c7037b4', class: this.wrapperClasses }, renderLabel(this), h("div", { key: '7f9a7f1e9e19fb3f4b3706a412a6e514bf7cdd58', class: "content-container", ref: el => (this.contentContainer = el) }, this.renderInput(), this.maxlength ? this.renderMaxLength() : '', renderMessages(this))));
299
+ return (h("div", { key: 'ded2aac01d00ea262e87b1dcb6e123ed3c9eefd4', class: this.wrapperClasses }, renderLabel(this), h("div", { key: '52ccdef3bd5c822e7b3cc6a2fcb06f491192f917', class: "content-container", ref: el => (this.contentContainer = el) }, this.renderInput(), this.maxlength ? this.renderMaxLength() : '', renderMessages(this))));
300
300
  }
301
301
  get hostElement() { return this; }
302
302
  static get watchers() { return {
@@ -71,9 +71,9 @@ const TectonTabPane$1 = /*@__PURE__*/ proxyCustomElement(class TectonTabPane ext
71
71
  // #endregion
72
72
  // #region Render Methods
73
73
  render() {
74
- return (h("div", { key: 'fbf2550a809c04de1ec1e0d56d042772e7a56ab1', id: `tab-pane-${this.guid}-${this.index}`, class: `tab-pane${this.selected ? '' : ' hidden'}`, role: "tabpanel", tabindex: "-1", "aria-hidden": `${!this.selected}`, "aria-labelledby": `tab-${this.guid}-${this.index}` }, this.selected && this.provided !== undefined && !this.provided && (h("div", { key: '3dfbabecf7a65d3e4a9e9cb022488ea2d74ec64a' }, h("slot", { key: '38f20a0d29bea45eaae2c9fd1bfb6f324694accc', name: "loading-wrapper" }), h("iframe", { key: '25106e9d4ff8fca4b9ca785d75b97557d4441ade', hidden: true, name: this.moduleId, scrolling: "no", src: this.showForm && this.authPayload.length ? '' : this.url || '', "data-module-id": this.moduleId, style: this.minHeight ? { minHeight: this.minHeight } : null, onLoad: this.onIFrameLoad, title: this.iframeTitle, allow: "geolocation; camera" }), this._showForm && this.authPayload ? (h("form", { hidden: true, method: "post", action: this.url, target: this.moduleId, encType: "multipart/form-data" }, this.authPayload.map(element => {
74
+ return (h("div", { key: '3b22a6510250b56e4dbec93d184ea232ae76e61b', id: `tab-pane-${this.guid}-${this.index}`, class: `tab-pane${this.selected ? '' : ' hidden'}`, role: "tabpanel", tabindex: "-1", "aria-hidden": `${!this.selected}`, "aria-labelledby": `tab-${this.guid}-${this.index}` }, this.selected && this.provided !== undefined && !this.provided && (h("div", { key: '460c06185379502e8e3b8abc7a440e58fb074676' }, h("slot", { key: '3f04ef0c68bbcd20d6948e393ee127ed4d5dbf67', name: "loading-wrapper" }), h("iframe", { key: '2fe35c1523a0aa01106d94bfdf950410a04757e7', hidden: true, name: this.moduleId, scrolling: "no", src: this.showForm && this.authPayload.length ? '' : this.url || '', "data-module-id": this.moduleId, style: this.minHeight ? { minHeight: this.minHeight } : null, onLoad: this.onIFrameLoad, title: this.iframeTitle, allow: "geolocation; camera" }), this._showForm && this.authPayload ? (h("form", { hidden: true, method: "post", action: this.url, target: this.moduleId, encType: "multipart/form-data" }, this.authPayload.map(element => {
75
75
  return (h("input", { type: "hidden", value: element.value, name: element.key }));
76
- }))) : (''))), h("div", { key: 'caa4de86bb34e5cf3f4bb60977f2be9450210cf3', class: "slot-wrapper", hidden: this.selected && this.provided !== undefined && !this.provided }, h("slot", { key: 'da2ded5ffc3b4f5f42741b574f25280040a39eae' }))));
76
+ }))) : (''))), h("div", { key: '76d8f7bb400fd64631e115fe68541011006f0a3c', class: "slot-wrapper", hidden: this.selected && this.provided !== undefined && !this.provided }, h("slot", { key: 'f331248404b9929f343c32bdcd92dbd12d94f3b3' }))));
77
77
  }
78
78
  get hostElement() { return this; }
79
79
  static get watchers() { return {
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, g as getElement, h } from './index-1e1ce94e.js';
2
- import { h as handleDeprecationWarning, w as waitForNextPaint } from './index-844fc010.js';
2
+ import { h as handleDeprecationWarning, w as waitForNextPaint, v as isInScrollableContainer, d as isMobile } from './index-7409eb95.js';
3
3
 
4
4
  const ClickElsewhere = class {
5
5
  constructor(hostRef) {
@@ -88,7 +88,7 @@ const ClickElsewhere = class {
88
88
  get hostElement() { return getElement(this); }
89
89
  };
90
90
 
91
- const q2PopoverCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}.container{display:none}.show{display:block;position:fixed;z-index:var(--tct-popover-z-index, 50);margin:0;padding:0;overflow:auto;background:var(--tct-popover-background, var(--app-white, #ffffff));color:var(--tct-popover-font-color, var(--t-text, #4d4d4d));min-width:var(--tct-popover-min-width, 135px);margin-block:var(--tct-popover-margin-block, 0);box-shadow:var(--tct-popover-box-shadow, var(--app-shadow-1, 0px 0px 2px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.14)));border-width:var(--tct-popover-border-width, 0);border-style:solid;border-color:var(--tct-popover-border-color, transparent);border-radius:var(--tct-popover-border-radius, 0);max-height:var(--comp-pop-max-height);left:var(--comp-pop-left);opacity:var(--comp-pop-opacity, 0);--comp-scrollbar-size:var(--tct-scrollbar-size, var(--t-scrollbar-size, var(--app-scale-1x, 5px)));--comp-scrollbar-border-radius:var(--tct-scrollbar-border-radius, var(--t-scrollbar-border-radius, var(--app-border-radius-1, 4px)));--comp-scrollbar-color:var(--tct-scrollbar-color, var(--t-scrollbar-color, var(--t-a11y-gray-color, #747474)));scrollbar-width:thin;scrollbar-color:var(--comp-scrollbar-color) transparent}:host([block]) .show{right:unset;width:var(--comp-pop-width);min-width:var(--tct-popover-min-width, unset)}:host([align=left]) .show{left:var(--comp-pop-left);right:unset}:host([align=right]) .show{right:var(--comp-pop-right);left:unset}.show.down{top:var(--tct-popover-top, var(--comp-pop-top));bottom:unset}.show.up{top:unset;bottom:var(--comp-pop-bottom)}.show.legacy{position:absolute}.show::-webkit-scrollbar{width:var(--comp-scrollbar-size);height:var(--comp-scrollbar-size);margin:5px}.show::-webkit-scrollbar-thumb{background:var(--comp-scrollbar-color);border-radius:var(--comp-scrollbar-border-radius)}.show::-webkit-scrollbar-track{background:transparent;border-radius:var(--comp-scrollbar-border-radius)}click-elsewhere{position:relative;display:block}";
91
+ const q2PopoverCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}.legacy.container{display:none}.legacy.show{display:block;z-index:var(--tct-popover-z-index, 50)}:popover-open,.show{position:absolute;margin:0;padding:0;overflow:auto;background:var(--tct-popover-background, var(--app-white, #ffffff));color:var(--tct-popover-font-color, var(--t-text, #4d4d4d));min-width:var(--tct-popover-min-width, 135px);margin-block:var(--tct-popover-margin-block, 0);box-shadow:var(--tct-popover-box-shadow, var(--app-shadow-1, 0px 0px 2px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.14)));border-width:var(--tct-popover-border-width, 0);border-style:solid;border-color:var(--tct-popover-border-color, transparent);border-radius:var(--tct-popover-border-radius, 0);max-height:var(--comp-pop-max-height);left:var(--comp-pop-left);opacity:var(--comp-pop-opacity, 0);--comp-scrollbar-size:var(--tct-scrollbar-size, var(--t-scrollbar-size, var(--app-scale-1x, 5px)));--comp-scrollbar-border-radius:var(--tct-scrollbar-border-radius, var(--t-scrollbar-border-radius, var(--app-border-radius-1, 4px)));--comp-scrollbar-color:var(--tct-scrollbar-color, var(--t-scrollbar-color, var(--t-a11y-gray-color, #747474)));scrollbar-width:thin;scrollbar-color:var(--comp-scrollbar-color) transparent}:popover-open.block,.show.block{right:unset;width:var(--comp-pop-width);min-width:var(--tct-popover-min-width, unset)}:popover-open.left,.show.left{left:var(--comp-pop-left);right:unset}:popover-open.right,.show.right{right:var(--comp-pop-right);left:unset}:popover-open.down,.show.down{top:var(--tct-popover-top, var(--comp-pop-top));bottom:unset}:popover-open.up,.show.up{top:unset;bottom:var(--comp-pop-bottom)}:popover-open::-webkit-scrollbar,.show::-webkit-scrollbar{width:var(--comp-scrollbar-size);height:var(--comp-scrollbar-size);margin:5px}:popover-open::-webkit-scrollbar-thumb,.show::-webkit-scrollbar-thumb{background:var(--comp-scrollbar-color);border-radius:var(--comp-scrollbar-border-radius)}:popover-open::-webkit-scrollbar-track,.show::-webkit-scrollbar-track{background:transparent;border-radius:var(--comp-scrollbar-border-radius)}click-elsewhere{position:relative;display:block}";
92
92
  const Q2PopoverStyle0 = q2PopoverCss;
93
93
 
94
94
  const Q2Popover = class {
@@ -99,13 +99,15 @@ const Q2Popover = class {
99
99
  * The number of pixels to leave between the popover and the edge of the viewport
100
100
  */
101
101
  this.displayBuffer = 10;
102
- /** remove when Popover API is supported in iOS */
103
102
  this.orientationChanged = false;
104
103
  this.handleMinHeight = () => {
105
104
  if (this.minHeight) {
106
105
  handleDeprecationWarning(this, 'minHeight', 'prop');
107
106
  }
108
107
  };
108
+ this.handlePopoverToggleEvent = (event) => {
109
+ this.popoverStateChanged.emit({ open: event.newState === 'open' });
110
+ };
109
111
  this.setAbsoluteCSSProperties = async () => {
110
112
  const { controlElement, containerElement, currentDirection, align } = this;
111
113
  if (align === 'right') {
@@ -130,25 +132,42 @@ const Q2Popover = class {
130
132
  await waitForNextPaint();
131
133
  containerElement.style.setProperty('--comp-pop-opacity', '1');
132
134
  };
133
- this.setFixedCSSProperties = async () => {
134
- var _a, _b;
135
- const { controlElement, containerElement, currentDirection, rootElementRect } = this;
135
+ this.setPopoverAPICSSProperties = async () => {
136
+ var _a, _b, _c;
137
+ const { controlElement, containerElement, currentDirection, isModule, align } = this;
136
138
  const { top: controlTop, bottom: controlBottom, left: controlLeft, right: controlRight, } = (_b = (_a = controlElement === null || controlElement === void 0 ? void 0 : controlElement.getBoundingClientRect) === null || _a === void 0 ? void 0 : _a.call(controlElement)) !== null && _b !== void 0 ? _b : {
137
139
  top: 0,
138
140
  bottom: 0,
139
141
  left: 0,
140
142
  right: 0,
141
143
  };
142
- const popoverLeft = controlLeft - rootElementRect.left;
144
+ const popoverLeft = controlLeft;
145
+ const popoverRight = ((_c = window === null || window === void 0 ? void 0 : window.visualViewport) === null || _c === void 0 ? void 0 : _c.width) - controlRight;
146
+ if (align === 'right') {
147
+ containerElement.style.setProperty('--comp-pop-right', `${popoverRight - window.scrollX}px`);
148
+ containerElement.style.setProperty('--comp-pop-left', 'unset');
149
+ }
150
+ else {
151
+ containerElement.style.setProperty('--comp-pop-left', `${popoverLeft + window.scrollX}px`);
152
+ containerElement.style.setProperty('--comp-pop-right', 'unset');
153
+ }
143
154
  if (this.block)
144
- containerElement.style.setProperty('--comp-pop-width', `${controlElement.offsetWidth || 0}px`);
145
- containerElement.style.setProperty('--comp-pop-left', `${popoverLeft}px`);
146
- containerElement.style.setProperty('--comp-pop-right', `${rootElementRect.width + rootElementRect.left - controlRight}px`);
155
+ containerElement.style.setProperty('--comp-pop-width', `${(controlElement === null || controlElement === void 0 ? void 0 : controlElement.offsetWidth) || 0}px`);
147
156
  if (currentDirection === 'up') {
148
- containerElement.style.setProperty('--comp-pop-bottom', `${rootElementRect.height + rootElementRect.top - controlTop}px`);
157
+ if (isModule) {
158
+ containerElement.style.setProperty('--comp-pop-bottom', `${window.innerHeight - controlTop}px`);
159
+ }
160
+ else {
161
+ containerElement.style.setProperty('--comp-pop-bottom', `${window.innerHeight - controlTop - window.scrollY}px`);
162
+ }
149
163
  }
150
164
  if (currentDirection === 'down') {
151
- containerElement.style.setProperty('--comp-pop-top', `${controlBottom - rootElementRect.top}px`);
165
+ if (isModule) {
166
+ containerElement.style.setProperty('--comp-pop-top', `${controlBottom}px`);
167
+ }
168
+ else {
169
+ containerElement.style.setProperty('--comp-pop-top', `${controlBottom + window.scrollY}px`);
170
+ }
152
171
  }
153
172
  // Wait for one paint to prevent layout thrashing
154
173
  await waitForNextPaint();
@@ -165,7 +184,7 @@ const Q2Popover = class {
165
184
  };
166
185
  this.currentDirection = undefined;
167
186
  this.show = false;
168
- this.align = undefined;
187
+ this.align = 'left';
169
188
  this.block = undefined;
170
189
  this.controlElement = undefined;
171
190
  this.direction = undefined;
@@ -178,13 +197,21 @@ const Q2Popover = class {
178
197
  // #region Component Lifecycle Events
179
198
  disconnectedCallback() {
180
199
  this.removeViewportListeners();
200
+ this.containerElement.removeEventListener('toggle', this.handlePopoverToggleEvent);
181
201
  this.containerElement = null;
182
202
  this.contentElement = null;
183
203
  this.controlElement = null;
184
- this.rootElementRect = null;
204
+ }
205
+ componentWillLoad() {
206
+ if (!this.supportsPopoverAPI) {
207
+ console.warn('The Popover API is not supported in this browser. Please update your browser to the latest version. The component will use legacy mode.');
208
+ this.mode = 'legacy';
209
+ }
185
210
  }
186
211
  componentDidLoad() {
187
212
  this.handleMinHeight();
213
+ if (this.supportsPopoverAPI)
214
+ this.containerElement.addEventListener('toggle', this.handlePopoverToggleEvent);
188
215
  if (this.open)
189
216
  this.determinePopDirection();
190
217
  }
@@ -211,7 +238,6 @@ const Q2Popover = class {
211
238
  this.handleMinHeight();
212
239
  }
213
240
  async openChanged(open) {
214
- this.setRootElement();
215
241
  this.popoverStateChanged.emit({ open });
216
242
  if (open) {
217
243
  this.addViewportListeners();
@@ -220,7 +246,12 @@ const Q2Popover = class {
220
246
  else {
221
247
  this.removeViewportListeners();
222
248
  this.currentDirection = undefined;
223
- this.show = false;
249
+ if (this.mode === 'legacy' || !this.supportsPopoverAPI) {
250
+ this.show = false;
251
+ }
252
+ else {
253
+ this.containerElement.hidePopover();
254
+ }
224
255
  await waitForNextPaint();
225
256
  this.clearCSSProperties();
226
257
  }
@@ -243,18 +274,18 @@ const Q2Popover = class {
243
274
  return undefined;
244
275
  }
245
276
  }
246
- get validatedMaxHeight() {
247
- const { maxHeight } = this;
248
- return isNaN(maxHeight) ? undefined : maxHeight;
277
+ get supportsPopoverAPI() {
278
+ return Object.hasOwn(HTMLElement.prototype, 'popover');
249
279
  }
250
280
  addViewportListeners() {
251
281
  var _a;
252
282
  window.addEventListener('resize', this.viewPortOrientationChanged);
253
- // #region remove when Popover API is supported in iOS
254
- window.addEventListener('scroll', this.viewPortChanged, { passive: true, capture: true });
255
- (_a = screen === null || screen === void 0 ? void 0 : screen.orientation) === null || _a === void 0 ? void 0 : _a.addEventListener('change', this.viewPortOrientationChanged);
283
+ visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.addEventListener('resize', this.viewPortChanged);
284
+ if (isInScrollableContainer(this.hostElement) && !isMobile()) {
285
+ window.addEventListener('scroll', this.viewPortChanged, { passive: true, capture: true });
286
+ }
287
+ (_a = screen === null || screen === void 0 ? void 0 : screen.orientation) === null || _a === void 0 ? void 0 : _a.addEventListener('orientationchange', this.viewPortOrientationChanged);
256
288
  window.addEventListener('orientationchange', this.viewPortOrientationChanged);
257
- // #endregion
258
289
  }
259
290
  clearCSSProperties() {
260
291
  this.containerElement.style.removeProperty('--comp-pop-max-height');
@@ -280,20 +311,23 @@ const Q2Popover = class {
280
311
  let maxSpaceAbove;
281
312
  let maxSpaceBelow;
282
313
  if (isModule) {
283
- const { outletOffset = 0, innerHeight = window.innerHeight } = ((_c = window.Tecton) === null || _c === void 0 ? void 0 : _c.platformDimensions) || {};
284
- const distanceToIframeBottom = window.visualViewport.height - controlBottom;
285
- const viewableSpaceBelow = innerHeight - (outletOffset + controlBottom);
314
+ const { outletOffset = 0, innerHeight = window.innerHeight, top: topBarHeight = 0, bottom: bottomBarHeight = 0, } = ((_c = window.Tecton) === null || _c === void 0 ? void 0 : _c.platformDimensions) || {};
315
+ const distanceToIframeBottom = window.innerHeight - controlBottom;
316
+ // controlElement position visually on the page
317
+ const visualControlTop = outletOffset > 0 ? controlTop : controlTop + outletOffset - topBarHeight;
318
+ const visualControlBottom = outletOffset + controlBottom - topBarHeight;
319
+ // visual space around the controlElement
320
+ const viewableSpaceAbove = visualControlTop;
321
+ const viewableSpaceBelow = innerHeight - bottomBarHeight - visualControlBottom;
322
+ // calculate space above and below controlElement
286
323
  const isIframeShorterThanWindow = distanceToIframeBottom < viewableSpaceBelow;
287
- windowHeight = innerHeight;
288
- // If the top of the module is below the top of the window we just use the controlTop
289
- // Otherwise we need to add the outletOffset to the controlTop
290
- maxSpaceAbove = (outletOffset > 0 ? controlTop : controlTop + outletOffset) - displayBuffer;
324
+ maxSpaceAbove = viewableSpaceAbove - displayBuffer;
291
325
  maxSpaceBelow = isIframeShorterThanWindow
292
326
  ? distanceToIframeBottom - displayBuffer
293
327
  : viewableSpaceBelow - displayBuffer;
294
328
  }
295
329
  else {
296
- windowHeight = window.visualViewport.height;
330
+ windowHeight = window.innerHeight;
297
331
  maxSpaceAbove = controlTop - displayBuffer;
298
332
  maxSpaceBelow = windowHeight - controlBottom - displayBuffer;
299
333
  }
@@ -306,17 +340,13 @@ const Q2Popover = class {
306
340
  switch (currentOrDetermineDirection) {
307
341
  case 'up':
308
342
  if (shouldUpdateMaxHeight) {
309
- const priorityMaxHeight = this.validatedMaxHeight || maxSpaceAbove;
310
- const maxHeight = Math.min(maxSpaceAbove, priorityMaxHeight);
311
- containerElement.style.setProperty('--comp-pop-max-height', `${maxHeight}px`);
343
+ containerElement.style.setProperty('--comp-pop-max-height', `${maxSpaceAbove}px`);
312
344
  }
313
345
  this.setDirectionAndShow('up');
314
346
  break;
315
347
  case 'down':
316
348
  if (shouldUpdateMaxHeight) {
317
- const priorityMaxHeight = this.validatedMaxHeight || maxSpaceBelow;
318
- const maxHeight = Math.min(maxSpaceBelow, priorityMaxHeight);
319
- containerElement.style.setProperty('--comp-pop-max-height', `${maxHeight}px`);
349
+ containerElement.style.setProperty('--comp-pop-max-height', `${maxSpaceBelow}px`);
320
350
  }
321
351
  this.setDirectionAndShow('down');
322
352
  break;
@@ -325,72 +355,38 @@ const Q2Popover = class {
325
355
  removeViewportListeners() {
326
356
  var _a;
327
357
  window.removeEventListener('resize', this.viewPortOrientationChanged);
328
- // #region remove when Popover API is supported in iOS
358
+ visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.removeEventListener('resize', this.viewPortChanged);
329
359
  window.removeEventListener('scroll', this.viewPortChanged, { capture: true });
330
- (_a = screen === null || screen === void 0 ? void 0 : screen.orientation) === null || _a === void 0 ? void 0 : _a.removeEventListener('change', this.viewPortOrientationChanged);
360
+ (_a = screen === null || screen === void 0 ? void 0 : screen.orientation) === null || _a === void 0 ? void 0 : _a.removeEventListener('orientationchange', this.viewPortOrientationChanged);
331
361
  window.removeEventListener('orientationchange', this.viewPortOrientationChanged);
332
- // #endregion
333
362
  }
334
363
  setDirectionAndShow(direction) {
335
- this.setRootElement();
336
364
  // Due to some runtime inconsistency across devices/browsers we need to add one more check here because the
337
365
  // popover can be closed between the time the popover is opened and the time the direction is determined
338
366
  const isOpen = this.open;
339
367
  if (!isOpen)
340
368
  return;
341
369
  this.currentDirection = direction;
342
- this.show = true;
343
- if (this.mode === 'legacy') {
370
+ if (this.mode === 'legacy' || !this.supportsPopoverAPI) {
371
+ this.show = true;
344
372
  this.setAbsoluteCSSProperties();
345
373
  }
346
374
  else {
347
- this.setFixedCSSProperties();
375
+ this.setPopoverAPICSSProperties();
376
+ this.containerElement.showPopover();
348
377
  }
349
378
  }
350
- setRootElement() {
351
- let currentElement = this.hostElement;
352
- while (currentElement && currentElement !== document.documentElement) {
353
- const computedStyle = window.getComputedStyle(currentElement);
354
- // Check if the element has any styles applied that create a new containg block
355
- if (computedStyle.transform !== 'none' ||
356
- computedStyle.filter !== 'none' ||
357
- computedStyle.perspective !== 'none' ||
358
- computedStyle.containerType !== 'normal' ||
359
- ['transform', 'perspective', 'filter'].includes(computedStyle.willChange) ||
360
- ['layout', 'paint', 'strict', 'content'].includes(computedStyle.contain)) {
361
- this.rootElementRect = currentElement.getBoundingClientRect();
362
- return;
363
- }
364
- const rootNode = currentElement.getRootNode();
365
- const isRootNodeWebComponent = typeof ShadowRoot !== 'undefined' &&
366
- rootNode instanceof ShadowRoot &&
367
- rootNode.host instanceof HTMLElement;
368
- if (isRootNodeWebComponent) {
369
- currentElement = rootNode.host;
370
- }
371
- else {
372
- currentElement = currentElement.parentElement;
373
- }
374
- }
375
- // Return the document's bounding rect if no element is found
376
- this.rootElementRect = {
377
- top: 0,
378
- bottom: 0,
379
- left: 0,
380
- right: 0,
381
- height: window.visualViewport.height,
382
- width: window.visualViewport.width,
383
- };
384
- }
385
379
  // #endregion
386
380
  // #region Render Methods
387
381
  render() {
388
- const containerClasses = ['container', this.currentDirection];
382
+ const containerClasses = ['container', this.currentDirection, this.align];
389
383
  if (this.show)
390
384
  containerClasses.push('show');
385
+ if (this.block)
386
+ containerClasses.push('block');
391
387
  if (this.mode === 'legacy')
392
388
  containerClasses.push('legacy');
393
- return (h("div", { key: '4cc36b0388e9ca27dfe5ce94863600a5e36bbb14', ref: el => (this.containerElement = el), class: containerClasses.join(' '), "test-id": "outerContainer" }, h("div", { key: 'af9a31c2c8c970d9b80639e2901f477277baf9bb', ref: el => (this.contentElement = el), class: "content" }, h("slot", { key: '16a982acc292f434732ab7242ae5c3c15117e56c' }))));
389
+ return (h("div", { key: 'a75180a8cedcf7f65d661719fd165073ddf66eba', ref: el => (this.containerElement = el), class: containerClasses.join(' '), "test-id": "outerContainer", tabIndex: -1, popover: "manual" }, h("div", { key: '8448932d1b716a1a116e3396fa02c5b9dc882456', ref: el => (this.contentElement = el), class: "content" }, h("slot", { key: 'd6b9cd3b58263bc44eb4bf466c0afe793c119187' }))));
394
390
  }
395
391
  get hostElement() { return getElement(this); }
396
392
  static get watchers() { return {
@@ -1 +1 @@
1
- {"file":"click-elsewhere.q2-popover.entry.js","mappings":";;;MAMa,cAAc;IAJ3B;;;;QAOI,uBAAkB,GAAY,KAAK,CAAC;;;;QAIpC,mBAAc,GAAa,CAAC,WAAW,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;QAqDpE,iBAAY,GAAG,CAAC,KAAY;YACxB,MAAM,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;YACzE,MAAM,gBAAgB,GAClB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,MAAiB,CAAC,CAAC;YAE1G,IAAI,CAAC,gBAAgB,KAAK,IAAI,CAAC,kBAAkB,IAAI,kBAAkB,CAAC,EAAE;gBACtE,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;gBAChC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;gBACnB,OAAO;aACV;YAC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AAC,IAAI;YAAE,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7C,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ;YAAE,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAE5D,QACI,4DACI,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC,EACvC,KAAK,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,aACzB,gBAAgB,IAExB,4DACI,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC,EACrC,KAAK,EAAC,SAAS,IAEf,8DAAQ,CACN,CACJ,EACR;KACL;;;;;;;;;;;","names":[],"sources":["src/components/click-elsewhere/click-elsewhere.tsx","src/components/q2-popover/q2-popover.scss?tag=q2-popover&encapsulation=shadow","src/components/q2-popover/q2-popover.tsx"],"sourcesContent":["import { Component, ComponentInterface, Element, Event, EventEmitter } from '@stencil/core';\n\n@Component({\n tag: 'click-elsewhere',\n shadow: false,\n})\nexport class ClickElsewhere implements ComponentInterface {\n // #region Own Properties\n\n isCurrentlyFocused: boolean = false;\n /**\n * Listens for mouse and window events that happen outside this click-elsewhere element so we can close popovers when users click outside them\n */\n mouseEventList: string[] = ['mousedown', 'dragstart', 'touchstart'];\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the user clicks outside the element\n */\n @Event()\n change: EventEmitter;\n\n // #endregion\n // #region Component Lifecycle Events\n\n /* tslint:enable:no-empty */\n\n connectedCallback() {\n this.mouseEventList.forEach((eventName: string) => {\n document.addEventListener(eventName, this.mouseHandler);\n });\n window.addEventListener('blur', this.windowBlurHandler);\n }\n\n disconnectedCallback() {\n this.mouseEventList.forEach((eventName: string) => {\n document.removeEventListener(eventName, this.mouseHandler);\n });\n window.removeEventListener('blur', this.windowBlurHandler);\n }\n\n /* TODO: Stencil/Rollup is having issues compiling without this here. Will try to remove in future Stencil upgrade. */\n /* tslint:disable:no-empty */\n componentWillLoad() {}\n\n // #endregion\n // #region Local Methods\n\n findActiveElement(): Element | null {\n let workingElement = document.activeElement!;\n while (true) {\n if (!workingElement || !workingElement.shadowRoot) {\n return workingElement;\n }\n workingElement = workingElement.shadowRoot.activeElement;\n }\n }\n\n mouseHandler = (event: Event): void => {\n const isCurrentlyFocused = this.shadowContains(this.findActiveElement());\n const aboutToBeFocused =\n this.shadowContains(this.shadowEventTarget(event)) || this.originatesInSlots(event.target as Element);\n\n if (!aboutToBeFocused && (this.isCurrentlyFocused || isCurrentlyFocused)) {\n this.isCurrentlyFocused = false;\n this.change.emit();\n return;\n }\n this.isCurrentlyFocused = aboutToBeFocused || isCurrentlyFocused;\n };\n\n originatesInSlots(target: Element): boolean {\n const slots = this.hostElement.querySelectorAll('slot');\n for (const currentSlot of Array.from(slots)) {\n const lightNodes =\n (currentSlot && currentSlot.assignedNodes && currentSlot.assignedNodes()) ||\n this.hostElement.childNodes;\n\n for (const currentNode of Array.from(lightNodes)) {\n if (currentNode.contains(target)) {\n return true;\n }\n }\n }\n return false;\n }\n\n shadowContains(child: any): boolean {\n /**\n * shadow-dom enabled version of Node.contains()\n */\n\n while (true) {\n if (child === this.hostElement) {\n return true;\n }\n if (!child) {\n return false;\n }\n child = child.parentNode || child.host;\n }\n }\n\n shadowEventTarget(event: any): Element {\n return event.composedPath()[0] || event.target;\n }\n\n windowBlurHandler = (): void => {\n this.isCurrentlyFocused = false;\n this.change.emit();\n };\n}\n","@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n.container {\n display: none;\n}\n\n.show {\n display: block;\n position: fixed;\n z-index: var-list(--tct-popover-z-index, 50);\n margin: 0;\n padding: 0;\n overflow: auto;\n background: var-list(--tct-popover-background, --app-white, #ffffff);\n color: var-list(--tct-popover-font-color, --t-text, #4d4d4d);\n min-width: var-list(--tct-popover-min-width, 135px);\n margin-block: var-list(--tct-popover-margin-block, 0);\n box-shadow: var-list(--tct-popover-box-shadow, --app-shadow-1, unquote(\"0px 0px 2px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.14)\"));\n border-width: var-list(--tct-popover-border-width, 0);\n border-style: solid;\n border-color: var-list(--tct-popover-border-color, transparent);\n border-radius: var-list(--tct-popover-border-radius, 0);\n // the following --comp variables are set via JS\n max-height: var(--comp-pop-max-height);\n left: var(--comp-pop-left);\n opacity: var(--comp-pop-opacity, 0);\n\n :host([block]) & {\n right: unset;\n width: var(--comp-pop-width);\n min-width: var-list(--tct-popover-min-width, unset);\n }\n\n :host([align='left']) & {\n left: var(--comp-pop-left);\n right: unset;\n }\n\n :host([align='right']) & {\n right: var(--comp-pop-right);\n left: unset;\n }\n\n &.down {\n top: var-list(--tct-popover-top, --comp-pop-top);\n bottom: unset;\n }\n\n &.up {\n top: unset;\n bottom: var(--comp-pop-bottom);\n }\n\n &.legacy {\n position: absolute;\n }\n\n @include tiny-scrollbar();\n}\n\nclick-elsewhere {\n position: relative;\n display: block;\n}\n","import {\n Component,\n Prop,\n h,\n ComponentInterface,\n Element,\n Watch,\n Method,\n Listen,\n EventEmitter,\n Event,\n State,\n} from '@stencil/core';\nimport { handleDeprecationWarning, waitForNextPaint } from '../../utils';\n\n@Component({ tag: 'q2-popover', shadow: true, styleUrl: 'q2-popover.scss' })\nexport class Q2Popover implements ComponentInterface {\n // #region Own Properties\n\n containerElement: HTMLDivElement;\n contentElement: HTMLDivElement;\n /**\n * The number of pixels to leave between the popover and the edge of the viewport\n */\n displayBuffer = 10;\n /** remove when Popover API is supported in iOS */\n orientationChanged: boolean = false;\n rootElementRect: DOMRect;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region State Properties\n\n @State()\n currentDirection: 'down' | 'up' = undefined;\n\n // remove `show` when Popover API is supported in iOS\n @State()\n show: boolean = false;\n\n // #endregion\n // #region Public Property API\n\n /** Aligns the popover to the left or right side of the control element. */\n @Prop({ reflect: true })\n align: 'left' | 'right';\n\n /** Indicates the popover will match the width of its parent element. */\n @Prop({ reflect: true })\n block: boolean;\n\n /** The element that controls the popover's behavior. */\n @Prop()\n controlElement: HTMLElement;\n\n /**\n * Force the direction of the popover when it opens.\n * If no value is passed, the component will auto-detect the direction based on available space.\n */\n @Prop({ reflect: true })\n direction: 'up' | 'down';\n\n /**\n * Force the maximum height of the popover. This value will be interpreted as pixels.\n * If no value is passed, or the value exceeds available space, the component will auto-detect the maximum height based on available space.\n */\n @Prop()\n maxHeight: number;\n\n /** @deprecated */\n @Prop()\n minHeight: number;\n\n @Prop()\n mode: 'legacy' = null;\n\n /** Controls whether the popover is open or closed. */\n @Prop({ reflect: true, mutable: true })\n open: boolean;\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the popover is opened or closed.\n */\n @Event()\n popoverStateChanged: EventEmitter<{ open: boolean }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n disconnectedCallback() {\n this.removeViewportListeners();\n this.containerElement = null;\n this.contentElement = null;\n this.controlElement = null;\n this.rootElementRect = null;\n }\n\n componentDidLoad() {\n this.handleMinHeight();\n if (this.open) this.determinePopDirection();\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('popoverState')\n popoverStateHandler(event: CustomEvent<{ open: boolean }>) {\n const {\n detail: { open },\n } = event;\n if (open === this.open) return;\n\n this.open = open;\n event.stopPropagation();\n }\n\n // #endregion\n // #region Public Methods API\n\n @Method()\n async scrollContainerTo(options: ScrollToOptions) {\n this.containerElement.scrollTo(options);\n }\n\n @Method()\n async toggle() {\n this.open = !this.open;\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('minHeight')\n minHeightProvided() {\n this.handleMinHeight();\n }\n\n @Watch('open')\n async openChanged(open: boolean) {\n this.setRootElement();\n this.popoverStateChanged.emit({ open });\n\n if (open) {\n this.addViewportListeners();\n this.determinePopDirection();\n } else {\n this.removeViewportListeners();\n this.currentDirection = undefined;\n this.show = false;\n await waitForNextPaint();\n this.clearCSSProperties();\n }\n }\n\n // #endregion\n // #region Local Methods\n\n get isModule() {\n const isIframe = window !== window.top;\n const hasPlatformDimensions = Object.keys(window.Tecton?.platformDimensions ?? {}).length > 0;\n return isIframe && hasPlatformDimensions;\n }\n\n get providedDirection(): 'up' | 'down' | undefined {\n const { direction } = this;\n switch (direction) {\n case 'up':\n case 'down':\n return direction;\n default:\n return undefined;\n }\n }\n\n get validatedMaxHeight(): number | undefined {\n const { maxHeight } = this;\n return isNaN(maxHeight) ? undefined : maxHeight;\n }\n\n addViewportListeners() {\n window.addEventListener('resize', this.viewPortOrientationChanged);\n // #region remove when Popover API is supported in iOS\n window.addEventListener('scroll', this.viewPortChanged, { passive: true, capture: true });\n screen?.orientation?.addEventListener('change', this.viewPortOrientationChanged);\n window.addEventListener('orientationchange', this.viewPortOrientationChanged);\n\n // #endregion\n }\n\n clearCSSProperties() {\n this.containerElement.style.removeProperty('--comp-pop-max-height');\n this.containerElement.style.removeProperty('--comp-pop-top');\n this.containerElement.style.removeProperty('--comp-pop-bottom');\n this.containerElement.style.removeProperty('--comp-pop-left');\n this.containerElement.style.removeProperty('--comp-pop-right');\n this.containerElement.style.removeProperty('--comp-pop-width');\n this.containerElement.style.removeProperty('--comp-pop-opacity');\n }\n\n async determinePopDirection() {\n const { containerElement, controlElement, providedDirection, displayBuffer } = this;\n if (containerElement) containerElement.style.maxHeight = null;\n\n await waitForNextPaint();\n\n const { isModule } = this;\n const { top: controlTop, bottom: controlBottom } = controlElement?.getBoundingClientRect?.() ?? {\n top: 0,\n bottom: 0,\n };\n\n let windowHeight: number;\n let maxSpaceAbove: number;\n let maxSpaceBelow: number;\n\n if (isModule) {\n const { outletOffset = 0, innerHeight = window.innerHeight } = window.Tecton?.platformDimensions || {};\n const distanceToIframeBottom = window.visualViewport.height - controlBottom;\n const viewableSpaceBelow = innerHeight - (outletOffset + controlBottom);\n const isIframeShorterThanWindow = distanceToIframeBottom < viewableSpaceBelow;\n windowHeight = innerHeight;\n // If the top of the module is below the top of the window we just use the controlTop\n // Otherwise we need to add the outletOffset to the controlTop\n maxSpaceAbove = (outletOffset > 0 ? controlTop : controlTop + outletOffset) - displayBuffer;\n maxSpaceBelow = isIframeShorterThanWindow\n ? distanceToIframeBottom - displayBuffer\n : viewableSpaceBelow - displayBuffer;\n } else {\n windowHeight = window.visualViewport.height;\n maxSpaceAbove = controlTop - displayBuffer;\n maxSpaceBelow = windowHeight - controlBottom - displayBuffer;\n }\n\n const directionWithMostSpace: 'up' | 'down' = maxSpaceAbove > maxSpaceBelow ? 'up' : 'down';\n\n // We do not want to update the max height once the popover is open unless the page orientation shifts (resize or mobile use cases)\n const shouldUpdateMaxHeight =\n !containerElement.style.getPropertyValue('--comp-pop-max-height') || this.orientationChanged;\n // we do not want to constantly update the max-height after an orientation change, so we switch this back to false\n this.orientationChanged = false;\n const currentOrDetermineDirection = this.currentDirection || providedDirection || directionWithMostSpace;\n\n switch (currentOrDetermineDirection) {\n case 'up':\n if (shouldUpdateMaxHeight) {\n const priorityMaxHeight = this.validatedMaxHeight || maxSpaceAbove;\n const maxHeight = Math.min(maxSpaceAbove, priorityMaxHeight);\n containerElement.style.setProperty('--comp-pop-max-height', `${maxHeight}px`);\n }\n this.setDirectionAndShow('up');\n break;\n case 'down':\n if (shouldUpdateMaxHeight) {\n const priorityMaxHeight = this.validatedMaxHeight || maxSpaceBelow;\n const maxHeight = Math.min(maxSpaceBelow, priorityMaxHeight);\n containerElement.style.setProperty('--comp-pop-max-height', `${maxHeight}px`);\n }\n this.setDirectionAndShow('down');\n break;\n default:\n break;\n }\n }\n\n handleMinHeight = () => {\n if (this.minHeight) {\n handleDeprecationWarning(this, 'minHeight', 'prop');\n }\n };\n\n removeViewportListeners() {\n window.removeEventListener('resize', this.viewPortOrientationChanged);\n // #region remove when Popover API is supported in iOS\n window.removeEventListener('scroll', this.viewPortChanged, { capture: true });\n screen?.orientation?.removeEventListener('change', this.viewPortOrientationChanged);\n window.removeEventListener('orientationchange', this.viewPortOrientationChanged);\n\n // #endregion\n }\n\n setAbsoluteCSSProperties = async () => {\n const { controlElement, containerElement, currentDirection, align } = this;\n\n if (align === 'right') {\n containerElement.style.setProperty('--comp-pop-right', '0');\n containerElement.style.setProperty('--comp-pop-left', 'unset');\n } else {\n containerElement.style.setProperty('--comp-pop-left', '0');\n containerElement.style.setProperty('--comp-pop-right', 'unset');\n }\n\n if (this.block) {\n containerElement.style.setProperty('--comp-pop-width', '100%');\n }\n\n if (currentDirection === 'up') {\n const controlStyle = getComputedStyle(controlElement);\n const controlSize =\n parseInt(controlStyle.height || '0') +\n parseInt(controlStyle.borderTopWidth || '0') +\n parseInt(controlStyle.borderBottomWidth || '0');\n\n containerElement.style.setProperty('--comp-pop-bottom', `${controlSize}px`);\n }\n\n // Wait for one paint to prevent layout thrashing\n await waitForNextPaint();\n containerElement.style.setProperty('--comp-pop-opacity', '1');\n };\n\n setDirectionAndShow(direction: 'up' | 'down') {\n this.setRootElement();\n // Due to some runtime inconsistency across devices/browsers we need to add one more check here because the\n // popover can be closed between the time the popover is opened and the time the direction is determined\n const isOpen = this.open;\n if (!isOpen) return;\n\n this.currentDirection = direction;\n this.show = true;\n if (this.mode === 'legacy') {\n this.setAbsoluteCSSProperties();\n } else {\n this.setFixedCSSProperties();\n }\n }\n\n setFixedCSSProperties = async () => {\n const { controlElement, containerElement, currentDirection, rootElementRect } = this;\n const {\n top: controlTop,\n bottom: controlBottom,\n left: controlLeft,\n right: controlRight,\n } = controlElement?.getBoundingClientRect?.() ?? {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n };\n const popoverLeft: number = controlLeft - rootElementRect.left;\n\n if (this.block) containerElement.style.setProperty('--comp-pop-width', `${controlElement.offsetWidth || 0}px`);\n containerElement.style.setProperty('--comp-pop-left', `${popoverLeft}px`);\n containerElement.style.setProperty(\n '--comp-pop-right',\n `${rootElementRect.width + rootElementRect.left - controlRight}px`\n );\n\n if (currentDirection === 'up') {\n containerElement.style.setProperty(\n '--comp-pop-bottom',\n `${rootElementRect.height + rootElementRect.top - controlTop}px`\n );\n }\n if (currentDirection === 'down') {\n containerElement.style.setProperty('--comp-pop-top', `${controlBottom - rootElementRect.top}px`);\n }\n\n // Wait for one paint to prevent layout thrashing\n await waitForNextPaint();\n containerElement.style.setProperty('--comp-pop-opacity', '1');\n };\n\n setRootElement() {\n let currentElement: HTMLElement = this.hostElement;\n\n while (currentElement && currentElement !== document.documentElement) {\n const computedStyle = window.getComputedStyle(currentElement);\n\n // Check if the element has any styles applied that create a new containg block\n if (\n computedStyle.transform !== 'none' ||\n computedStyle.filter !== 'none' ||\n computedStyle.perspective !== 'none' ||\n computedStyle.containerType !== 'normal' ||\n ['transform', 'perspective', 'filter'].includes(computedStyle.willChange) ||\n ['layout', 'paint', 'strict', 'content'].includes(computedStyle.contain)\n ) {\n this.rootElementRect = currentElement.getBoundingClientRect();\n return;\n }\n\n const rootNode = currentElement.getRootNode();\n const isRootNodeWebComponent =\n typeof ShadowRoot !== 'undefined' &&\n rootNode instanceof ShadowRoot &&\n rootNode.host instanceof HTMLElement;\n if (isRootNodeWebComponent) {\n currentElement = rootNode.host;\n } else {\n currentElement = currentElement.parentElement;\n }\n }\n\n // Return the document's bounding rect if no element is found\n this.rootElementRect = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n height: window.visualViewport.height,\n width: window.visualViewport.width,\n } as DOMRect;\n }\n\n viewPortChanged = () => {\n if (!this.open) return;\n this.determinePopDirection();\n };\n\n viewPortOrientationChanged = () => {\n this.orientationChanged = true;\n this.viewPortChanged();\n };\n\n // #endregion\n // #region Render Methods\n\n render() {\n const containerClasses = ['container', this.currentDirection];\n if (this.show) containerClasses.push('show');\n if (this.mode === 'legacy') containerClasses.push('legacy');\n\n return (\n <div\n ref={el => (this.containerElement = el)}\n class={containerClasses.join(' ')}\n test-id=\"outerContainer\"\n >\n <div\n ref={el => (this.contentElement = el)}\n class=\"content\"\n >\n <slot />\n </div>\n </div>\n );\n }\n\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GAAG,EAAE,CAAC,EACvC,KAAK,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,aACzB,gBAAgB,EACxB,QAAQ,EAAE,CAAC,CAAC,EACZ,OAAO,EAAC,QAAQ,IAEhB,4DACI,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC,EACrC,KAAK,EAAC,SAAS,IAEf,8DAAQ,CACN,CACJ,EACR;KACL;;;;;;;;;;;","names":[],"sources":["src/components/click-elsewhere/click-elsewhere.tsx","src/components/q2-popover/q2-popover.scss?tag=q2-popover&encapsulation=shadow","src/components/q2-popover/q2-popover.tsx"],"sourcesContent":["import { Component, ComponentInterface, Element, Event, EventEmitter } from '@stencil/core';\n\n@Component({\n tag: 'click-elsewhere',\n shadow: false,\n})\nexport class ClickElsewhere implements ComponentInterface {\n // #region Own Properties\n\n isCurrentlyFocused: boolean = false;\n /**\n * Listens for mouse and window events that happen outside this click-elsewhere element so we can close popovers when users click outside them\n */\n mouseEventList: string[] = ['mousedown', 'dragstart', 'touchstart'];\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the user clicks outside the element\n */\n @Event()\n change: EventEmitter;\n\n // #endregion\n // #region Component Lifecycle Events\n\n /* tslint:enable:no-empty */\n\n connectedCallback() {\n this.mouseEventList.forEach((eventName: string) => {\n document.addEventListener(eventName, this.mouseHandler);\n });\n window.addEventListener('blur', this.windowBlurHandler);\n }\n\n disconnectedCallback() {\n this.mouseEventList.forEach((eventName: string) => {\n document.removeEventListener(eventName, this.mouseHandler);\n });\n window.removeEventListener('blur', this.windowBlurHandler);\n }\n\n /* TODO: Stencil/Rollup is having issues compiling without this here. Will try to remove in future Stencil upgrade. */\n /* tslint:disable:no-empty */\n componentWillLoad() {}\n\n // #endregion\n // #region Local Methods\n\n findActiveElement(): Element | null {\n let workingElement = document.activeElement!;\n while (true) {\n if (!workingElement || !workingElement.shadowRoot) {\n return workingElement;\n }\n workingElement = workingElement.shadowRoot.activeElement;\n }\n }\n\n mouseHandler = (event: Event): void => {\n const isCurrentlyFocused = this.shadowContains(this.findActiveElement());\n const aboutToBeFocused =\n this.shadowContains(this.shadowEventTarget(event)) || this.originatesInSlots(event.target as Element);\n\n if (!aboutToBeFocused && (this.isCurrentlyFocused || isCurrentlyFocused)) {\n this.isCurrentlyFocused = false;\n this.change.emit();\n return;\n }\n this.isCurrentlyFocused = aboutToBeFocused || isCurrentlyFocused;\n };\n\n originatesInSlots(target: Element): boolean {\n const slots = this.hostElement.querySelectorAll('slot');\n for (const currentSlot of Array.from(slots)) {\n const lightNodes =\n (currentSlot && currentSlot.assignedNodes && currentSlot.assignedNodes()) ||\n this.hostElement.childNodes;\n\n for (const currentNode of Array.from(lightNodes)) {\n if (currentNode.contains(target)) {\n return true;\n }\n }\n }\n return false;\n }\n\n shadowContains(child: any): boolean {\n /**\n * shadow-dom enabled version of Node.contains()\n */\n\n while (true) {\n if (child === this.hostElement) {\n return true;\n }\n if (!child) {\n return false;\n }\n child = child.parentNode || child.host;\n }\n }\n\n shadowEventTarget(event: any): Element {\n return event.composedPath()[0] || event.target;\n }\n\n windowBlurHandler = (): void => {\n this.isCurrentlyFocused = false;\n this.change.emit();\n };\n}\n","@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n.legacy {\n &.container {\n display: none;\n }\n\n &.show {\n display: block;\n z-index: var-list(--tct-popover-z-index, 50);\n }\n}\n\n:popover-open,\n.show {\n position: absolute;\n margin: 0;\n padding: 0;\n overflow: auto;\n background: var-list(--tct-popover-background, --app-white, #ffffff);\n color: var-list(--tct-popover-font-color, --t-text, #4d4d4d);\n min-width: var-list(--tct-popover-min-width, 135px);\n margin-block: var-list(--tct-popover-margin-block, 0);\n box-shadow: var-list(\n --tct-popover-box-shadow,\n --app-shadow-1,\n unquote('0px 0px 2px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.14)')\n );\n border-width: var-list(--tct-popover-border-width, 0);\n border-style: solid;\n border-color: var-list(--tct-popover-border-color, transparent);\n border-radius: var-list(--tct-popover-border-radius, 0);\n // the --comp variables are set via JS\n max-height: var(--comp-pop-max-height);\n left: var(--comp-pop-left);\n opacity: var(--comp-pop-opacity, 0);\n\n &.block {\n right: unset;\n width: var(--comp-pop-width);\n min-width: var-list(--tct-popover-min-width, unset);\n }\n\n &.left {\n left: var(--comp-pop-left);\n right: unset;\n }\n\n &.right {\n right: var(--comp-pop-right);\n left: unset;\n }\n\n &.down {\n top: var-list(--tct-popover-top, --comp-pop-top);\n bottom: unset;\n }\n\n &.up {\n top: unset;\n bottom: var(--comp-pop-bottom);\n }\n\n @include tiny-scrollbar();\n}\n\nclick-elsewhere {\n position: relative;\n display: block;\n}\n","import {\n Component,\n Prop,\n h,\n ComponentInterface,\n Element,\n Watch,\n Method,\n Listen,\n EventEmitter,\n Event,\n State,\n} from '@stencil/core';\nimport { handleDeprecationWarning, waitForNextPaint, isMobile, isInScrollableContainer } from '../../utils';\n\n@Component({ tag: 'q2-popover', shadow: true, styleUrl: 'q2-popover.scss' })\nexport class Q2Popover implements ComponentInterface {\n // #region Own Properties\n\n containerElement: HTMLDivElement;\n contentElement: HTMLDivElement;\n /**\n * The number of pixels to leave between the popover and the edge of the viewport\n */\n displayBuffer = 10;\n orientationChanged: boolean = false;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region State Properties\n\n @State()\n currentDirection: 'down' | 'up' = undefined;\n\n // remove `show` when Popover API is supported in iOS\n @State()\n show: boolean = false;\n\n // #endregion\n // #region Public Property API\n\n /** Aligns the popover to the left or right side of the control element. */\n @Prop({ reflect: true })\n align: 'left' | 'right' = 'left';\n\n /** Indicates the popover will match the width of its parent element. */\n @Prop({ reflect: true })\n block: boolean;\n\n /** The element that controls the popover's behavior. */\n @Prop()\n controlElement: HTMLElement;\n\n /**\n * Force the direction of the popover when it opens.\n * If no value is passed, the component will auto-detect the direction based on available space.\n */\n @Prop({ reflect: true })\n direction: 'up' | 'down';\n\n /**\n * Force the maximum height of the popover. This value will be interpreted as pixels.\n * If no value is passed, or the value exceeds available space, the component will auto-detect the maximum height based on available space.\n */\n @Prop()\n maxHeight: number;\n\n /** @deprecated */\n @Prop()\n minHeight: number;\n\n @Prop()\n mode: 'legacy' = null;\n\n /** Controls whether the popover is open or closed. */\n @Prop({ reflect: true, mutable: true })\n open: boolean;\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the popover is opened or closed.\n */\n @Event()\n popoverStateChanged: EventEmitter<{ open: boolean }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n disconnectedCallback() {\n this.removeViewportListeners();\n this.containerElement.removeEventListener('toggle', this.handlePopoverToggleEvent);\n this.containerElement = null;\n this.contentElement = null;\n this.controlElement = null;\n }\n\n componentWillLoad() {\n if (!this.supportsPopoverAPI) {\n console.warn(\n 'The Popover API is not supported in this browser. Please update your browser to the latest version. The component will use legacy mode.'\n );\n this.mode = 'legacy';\n }\n }\n\n componentDidLoad() {\n this.handleMinHeight();\n if (this.supportsPopoverAPI) this.containerElement.addEventListener('toggle', this.handlePopoverToggleEvent);\n if (this.open) this.determinePopDirection();\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('popoverState')\n popoverStateHandler(event: CustomEvent<{ open: boolean }>) {\n const {\n detail: { open },\n } = event;\n if (open === this.open) return;\n\n this.open = open;\n event.stopPropagation();\n }\n\n // #endregion\n // #region Public Methods API\n\n @Method()\n async scrollContainerTo(options: ScrollToOptions) {\n this.containerElement.scrollTo(options);\n }\n\n @Method()\n async toggle() {\n this.open = !this.open;\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('minHeight')\n minHeightProvided() {\n this.handleMinHeight();\n }\n\n @Watch('open')\n async openChanged(open: boolean) {\n this.popoverStateChanged.emit({ open });\n\n if (open) {\n this.addViewportListeners();\n this.determinePopDirection();\n } else {\n this.removeViewportListeners();\n this.currentDirection = undefined;\n if (this.mode === 'legacy' || !this.supportsPopoverAPI) {\n this.show = false;\n } else {\n this.containerElement.hidePopover();\n }\n\n await waitForNextPaint();\n this.clearCSSProperties();\n }\n }\n\n // #endregion\n // #region Local Methods\n\n get isModule() {\n const isIframe = window !== window.top;\n const hasPlatformDimensions = Object.keys(window.Tecton?.platformDimensions ?? {}).length > 0;\n return isIframe && hasPlatformDimensions;\n }\n\n get providedDirection(): 'up' | 'down' | undefined {\n const { direction } = this;\n switch (direction) {\n case 'up':\n case 'down':\n return direction;\n default:\n return undefined;\n }\n }\n\n get supportsPopoverAPI(): boolean {\n return Object.hasOwn(HTMLElement.prototype, 'popover');\n }\n\n addViewportListeners() {\n window.addEventListener('resize', this.viewPortOrientationChanged);\n visualViewport?.addEventListener('resize', this.viewPortChanged);\n if (isInScrollableContainer(this.hostElement) && !isMobile()) {\n window.addEventListener('scroll', this.viewPortChanged, { passive: true, capture: true });\n }\n screen?.orientation?.addEventListener('orientationchange', this.viewPortOrientationChanged);\n window.addEventListener('orientationchange', this.viewPortOrientationChanged);\n }\n\n clearCSSProperties() {\n this.containerElement.style.removeProperty('--comp-pop-max-height');\n this.containerElement.style.removeProperty('--comp-pop-top');\n this.containerElement.style.removeProperty('--comp-pop-bottom');\n this.containerElement.style.removeProperty('--comp-pop-left');\n this.containerElement.style.removeProperty('--comp-pop-right');\n this.containerElement.style.removeProperty('--comp-pop-width');\n this.containerElement.style.removeProperty('--comp-pop-opacity');\n }\n\n async determinePopDirection() {\n const { containerElement, controlElement, providedDirection, displayBuffer } = this;\n if (containerElement) containerElement.style.maxHeight = null;\n await waitForNextPaint();\n\n const { isModule } = this;\n const { top: controlTop, bottom: controlBottom } = controlElement?.getBoundingClientRect?.() ?? {\n top: 0,\n bottom: 0,\n };\n\n let windowHeight: number;\n let maxSpaceAbove: number;\n let maxSpaceBelow: number;\n if (isModule) {\n const {\n outletOffset = 0,\n innerHeight = window.innerHeight,\n top: topBarHeight = 0,\n bottom: bottomBarHeight = 0,\n } = window.Tecton?.platformDimensions || {};\n\n const distanceToIframeBottom = window.innerHeight - controlBottom;\n\n // controlElement position visually on the page\n const visualControlTop = outletOffset > 0 ? controlTop : controlTop + outletOffset - topBarHeight;\n const visualControlBottom = outletOffset + controlBottom - topBarHeight;\n\n // visual space around the controlElement\n const viewableSpaceAbove = visualControlTop;\n const viewableSpaceBelow = innerHeight - bottomBarHeight - visualControlBottom;\n\n // calculate space above and below controlElement\n const isIframeShorterThanWindow = distanceToIframeBottom < viewableSpaceBelow;\n maxSpaceAbove = viewableSpaceAbove - displayBuffer;\n maxSpaceBelow = isIframeShorterThanWindow\n ? distanceToIframeBottom - displayBuffer\n : viewableSpaceBelow - displayBuffer;\n } else {\n windowHeight = window.innerHeight;\n maxSpaceAbove = controlTop - displayBuffer;\n maxSpaceBelow = windowHeight - controlBottom - displayBuffer;\n }\n\n const directionWithMostSpace: 'up' | 'down' = maxSpaceAbove > maxSpaceBelow ? 'up' : 'down';\n\n // We do not want to update the max height once the popover is open unless the page orientation shifts (resize or mobile use cases)\n const shouldUpdateMaxHeight =\n !containerElement.style.getPropertyValue('--comp-pop-max-height') || this.orientationChanged;\n // we do not want to constantly update the max-height after an orientation change, so we switch this back to false\n this.orientationChanged = false;\n const currentOrDetermineDirection = this.currentDirection || providedDirection || directionWithMostSpace;\n\n switch (currentOrDetermineDirection) {\n case 'up':\n if (shouldUpdateMaxHeight) {\n containerElement.style.setProperty('--comp-pop-max-height', `${maxSpaceAbove}px`);\n }\n this.setDirectionAndShow('up');\n break;\n case 'down':\n if (shouldUpdateMaxHeight) {\n containerElement.style.setProperty('--comp-pop-max-height', `${maxSpaceBelow}px`);\n }\n this.setDirectionAndShow('down');\n break;\n default:\n break;\n }\n }\n\n handleMinHeight = () => {\n if (this.minHeight) {\n handleDeprecationWarning(this, 'minHeight', 'prop');\n }\n };\n\n handlePopoverToggleEvent = (event: ToggleEvent) => {\n this.popoverStateChanged.emit({ open: event.newState === 'open' });\n };\n\n removeViewportListeners() {\n window.removeEventListener('resize', this.viewPortOrientationChanged);\n visualViewport?.removeEventListener('resize', this.viewPortChanged);\n window.removeEventListener('scroll', this.viewPortChanged, { capture: true });\n screen?.orientation?.removeEventListener('orientationchange', this.viewPortOrientationChanged);\n window.removeEventListener('orientationchange', this.viewPortOrientationChanged);\n }\n\n setAbsoluteCSSProperties = async () => {\n const { controlElement, containerElement, currentDirection, align } = this;\n\n if (align === 'right') {\n containerElement.style.setProperty('--comp-pop-right', '0');\n containerElement.style.setProperty('--comp-pop-left', 'unset');\n } else {\n containerElement.style.setProperty('--comp-pop-left', '0');\n containerElement.style.setProperty('--comp-pop-right', 'unset');\n }\n\n if (this.block) {\n containerElement.style.setProperty('--comp-pop-width', '100%');\n }\n\n if (currentDirection === 'up') {\n const controlStyle = getComputedStyle(controlElement);\n const controlSize =\n parseInt(controlStyle.height || '0') +\n parseInt(controlStyle.borderTopWidth || '0') +\n parseInt(controlStyle.borderBottomWidth || '0');\n\n containerElement.style.setProperty('--comp-pop-bottom', `${controlSize}px`);\n }\n\n // Wait for one paint to prevent layout thrashing\n await waitForNextPaint();\n containerElement.style.setProperty('--comp-pop-opacity', '1');\n };\n\n setDirectionAndShow(direction: 'up' | 'down') {\n // Due to some runtime inconsistency across devices/browsers we need to add one more check here because the\n // popover can be closed between the time the popover is opened and the time the direction is determined\n const isOpen = this.open;\n if (!isOpen) return;\n\n this.currentDirection = direction;\n if (this.mode === 'legacy' || !this.supportsPopoverAPI) {\n this.show = true;\n this.setAbsoluteCSSProperties();\n } else {\n this.setPopoverAPICSSProperties();\n this.containerElement.showPopover();\n }\n }\n\n setPopoverAPICSSProperties = async () => {\n const { controlElement, containerElement, currentDirection, isModule, align } = this;\n const {\n top: controlTop,\n bottom: controlBottom,\n left: controlLeft,\n right: controlRight,\n } = controlElement?.getBoundingClientRect?.() ?? {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n };\n\n const popoverLeft: number = controlLeft;\n const popoverRight: number = window?.visualViewport?.width - controlRight;\n\n if (align === 'right') {\n containerElement.style.setProperty('--comp-pop-right', `${popoverRight - window.scrollX}px`);\n containerElement.style.setProperty('--comp-pop-left', 'unset');\n } else {\n containerElement.style.setProperty('--comp-pop-left', `${popoverLeft + window.scrollX}px`);\n containerElement.style.setProperty('--comp-pop-right', 'unset');\n }\n\n if (this.block) containerElement.style.setProperty('--comp-pop-width', `${controlElement?.offsetWidth || 0}px`);\n\n if (currentDirection === 'up') {\n if (isModule) {\n containerElement.style.setProperty('--comp-pop-bottom', `${window.innerHeight - controlTop}px`);\n } else {\n containerElement.style.setProperty(\n '--comp-pop-bottom',\n `${window.innerHeight - controlTop - window.scrollY}px`\n );\n }\n }\n\n if (currentDirection === 'down') {\n if (isModule) {\n containerElement.style.setProperty('--comp-pop-top', `${controlBottom}px`);\n } else {\n containerElement.style.setProperty('--comp-pop-top', `${controlBottom + window.scrollY}px`);\n }\n }\n\n // Wait for one paint to prevent layout thrashing\n await waitForNextPaint();\n containerElement.style.setProperty('--comp-pop-opacity', '1');\n };\n\n viewPortChanged = () => {\n if (!this.open) return;\n this.determinePopDirection();\n };\n\n viewPortOrientationChanged = () => {\n this.orientationChanged = true;\n this.viewPortChanged();\n };\n\n // #endregion\n // #region Render Methods\n\n render() {\n const containerClasses = ['container', this.currentDirection, this.align];\n if (this.show) containerClasses.push('show');\n if (this.block) containerClasses.push('block');\n if (this.mode === 'legacy') containerClasses.push('legacy');\n\n return (\n <div\n ref={el => (this.containerElement = el)}\n class={containerClasses.join(' ')}\n test-id=\"outerContainer\"\n tabIndex={-1}\n popover=\"manual\"\n >\n <div\n ref={el => (this.contentElement = el)}\n class=\"content\"\n >\n <slot />\n </div>\n </div>\n );\n }\n\n // #endregion\n}\n"],"version":3}