q2-tecton-elements 1.50.1 → 1.50.2

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 (417) hide show
  1. package/dist/cjs/click-elsewhere_2.cjs.entry.js +73 -70
  2. package/dist/cjs/click-elsewhere_2.cjs.entry.js.map +1 -1
  3. package/dist/cjs/{index-64d8b839.js → index-799a5634.js} +1 -21
  4. package/dist/cjs/index-799a5634.js.map +1 -0
  5. package/dist/cjs/{index-43010ce4.js → index-f69742cf.js} +1 -1
  6. package/dist/cjs/{index-43010ce4.js.map → index-f69742cf.js.map} +1 -1
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/q2-action-sheet.cjs.entry.js +2 -2
  9. package/dist/cjs/q2-avatar.cjs.entry.js +1 -1
  10. package/dist/cjs/q2-badge_7.cjs.entry.js +4 -4
  11. package/dist/cjs/q2-calendar.cjs.entry.js +2 -2
  12. package/dist/cjs/q2-card.cjs.entry.js +1 -1
  13. package/dist/cjs/q2-carousel-pane.cjs.entry.js +3 -3
  14. package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
  15. package/dist/cjs/q2-chart-area.cjs.entry.js +2 -2
  16. package/dist/cjs/q2-chart-bar.cjs.entry.js +2 -2
  17. package/dist/cjs/q2-chart-donut.cjs.entry.js +2 -2
  18. package/dist/cjs/q2-checkbox-group.cjs.entry.js +1 -1
  19. package/dist/cjs/q2-checkbox.cjs.entry.js +1 -1
  20. package/dist/cjs/q2-currency.cjs.entry.js +1 -1
  21. package/dist/cjs/q2-data-table.cjs.entry.js +1 -1
  22. package/dist/cjs/q2-detail.cjs.entry.js +2 -2
  23. package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
  24. package/dist/cjs/q2-dropdown.cjs.entry.js +1 -1
  25. package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
  26. package/dist/cjs/q2-item.cjs.entry.js +2 -2
  27. package/dist/cjs/q2-legend.cjs.entry.js +1 -1
  28. package/dist/cjs/q2-list.cjs.entry.js +2 -2
  29. package/dist/cjs/q2-loc.cjs.entry.js +2 -2
  30. package/dist/cjs/q2-message.cjs.entry.js +2 -2
  31. package/dist/cjs/q2-month-picker.cjs.entry.js +3 -3
  32. package/dist/cjs/q2-optgroup.cjs.entry.js +2 -2
  33. package/dist/cjs/q2-option-list.cjs.entry.js +1 -1
  34. package/dist/cjs/q2-option.cjs.entry.js +1 -1
  35. package/dist/cjs/q2-pagination.cjs.entry.js +3 -3
  36. package/dist/cjs/q2-pill.cjs.entry.js +2 -2
  37. package/dist/cjs/q2-radio-group.cjs.entry.js +1 -1
  38. package/dist/cjs/q2-radio.cjs.entry.js +1 -1
  39. package/dist/cjs/q2-relative-time.cjs.entry.js +3 -3
  40. package/dist/cjs/q2-section.cjs.entry.js +3 -3
  41. package/dist/cjs/q2-select.cjs.entry.js +97 -19
  42. package/dist/cjs/q2-select.cjs.entry.js.map +1 -1
  43. package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
  44. package/dist/cjs/q2-stepper-vertical.cjs.entry.js +2 -2
  45. package/dist/cjs/q2-stepper.cjs.entry.js +2 -2
  46. package/dist/cjs/q2-tag.cjs.entry.js +2 -2
  47. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  48. package/dist/cjs/q2-textarea.cjs.entry.js +2 -2
  49. package/dist/cjs/q2-tooltip.cjs.entry.js +1 -1
  50. package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -2
  51. package/dist/collection/components/click-elsewhere/click-elsewhere.js.map +1 -1
  52. package/dist/collection/components/click-elsewhere/test/click-elsewhere-test.e2e.js.map +1 -1
  53. package/dist/collection/components/q2-action-sheet/q2-action-sheet.js +1 -1
  54. package/dist/collection/components/q2-action-sheet/q2-action-sheet.js.map +1 -1
  55. package/dist/collection/components/q2-action-sheet/test/q2-action-sheet-test.e2e.js.map +1 -1
  56. package/dist/collection/components/q2-avatar/q2-avatar.js +1 -1
  57. package/dist/collection/components/q2-avatar/q2-avatar.js.map +1 -1
  58. package/dist/collection/components/q2-avatar/test/q2-avatar-test.e2e.js.map +1 -1
  59. package/dist/collection/components/q2-badge/q2-badge.js.map +1 -1
  60. package/dist/collection/components/q2-badge/test/q2-badge-test.e2e.js.map +1 -1
  61. package/dist/collection/components/q2-btn/q2-btn.js.map +1 -1
  62. package/dist/collection/components/q2-btn/test/q2-btn-test.e2e.js.map +1 -1
  63. package/dist/collection/components/q2-calendar/q2-calendar-helpers.js.map +1 -1
  64. package/dist/collection/components/q2-calendar/q2-calendar-types.js.map +1 -1
  65. package/dist/collection/components/q2-calendar/q2-calendar-validation.js.map +1 -1
  66. package/dist/collection/components/q2-calendar/q2-calendar.js.map +1 -1
  67. package/dist/collection/components/q2-calendar/q2-month-picker.js +2 -2
  68. package/dist/collection/components/q2-calendar/q2-month-picker.js.map +1 -1
  69. package/dist/collection/components/q2-calendar/test/helpers-test.e2e.js.map +1 -1
  70. package/dist/collection/components/q2-calendar/test/q2-calendar-month-picker-test.e2e.js.map +1 -1
  71. package/dist/collection/components/q2-calendar/test/q2-calendar-test.e2e.js +2 -2
  72. package/dist/collection/components/q2-calendar/test/q2-calendar-test.e2e.js.map +1 -1
  73. package/dist/collection/components/q2-calendar/test/validation-test.e2e.js.map +1 -1
  74. package/dist/collection/components/q2-card/q2-card.js.map +1 -1
  75. package/dist/collection/components/q2-card/test/q2-card-test.e2e.js.map +1 -1
  76. package/dist/collection/components/q2-carousel/q2-carousel.js.map +1 -1
  77. package/dist/collection/components/q2-carousel/test/q2-carousel-test.e2e.js.map +1 -1
  78. package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js +2 -2
  79. package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js.map +1 -1
  80. package/dist/collection/components/q2-carousel-pane/test/q2-carousel-pane-test.e2e.js.map +1 -1
  81. package/dist/collection/components/q2-carousel-pane/test/q2-carousel-pane-test.spec.js.map +1 -1
  82. package/dist/collection/components/q2-chart-area/q2-chart-area.js +1 -1
  83. package/dist/collection/components/q2-chart-area/q2-chart-area.js.map +1 -1
  84. package/dist/collection/components/q2-chart-area/test/q2-chart-area-test.e2e.js.map +1 -1
  85. package/dist/collection/components/q2-chart-bar/q2-chart-bar.js +1 -1
  86. package/dist/collection/components/q2-chart-bar/q2-chart-bar.js.map +1 -1
  87. package/dist/collection/components/q2-chart-bar/test/q2-chart-bar-test.e2e.js.map +1 -1
  88. package/dist/collection/components/q2-chart-donut/q2-chart-donut.js +1 -1
  89. package/dist/collection/components/q2-chart-donut/q2-chart-donut.js.map +1 -1
  90. package/dist/collection/components/q2-chart-donut/test/q2-chart-donut-test.e2e.js.map +1 -1
  91. package/dist/collection/components/q2-checkbox/q2-checkbox.js.map +1 -1
  92. package/dist/collection/components/q2-checkbox/test/q2-checkbox-test.e2e.js.map +1 -1
  93. package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.js.map +1 -1
  94. package/dist/collection/components/q2-checkbox-group/test/q2-checkbox-group-test.e2e.js.map +1 -1
  95. package/dist/collection/components/q2-currency/q2-currency.js +1 -1
  96. package/dist/collection/components/q2-currency/q2-currency.js.map +1 -1
  97. package/dist/collection/components/q2-currency/test/q2-currency-test.e2e.js.map +1 -1
  98. package/dist/collection/components/q2-data-table/q2-data-table.js +7 -7
  99. package/dist/collection/components/q2-data-table/q2-data-table.js.map +1 -1
  100. package/dist/collection/components/q2-data-table/test/q2-data-table-test.e2e.js.map +1 -1
  101. package/dist/collection/components/q2-detail/q2-detail.js +1 -1
  102. package/dist/collection/components/q2-detail/q2-detail.js.map +1 -1
  103. package/dist/collection/components/q2-detail/test/q2-detail-test.e2e.js.map +1 -1
  104. package/dist/collection/components/q2-dropdown/q2-dropdown.js.map +1 -1
  105. package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.e2e.js +1 -13
  106. package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.e2e.js.map +1 -1
  107. package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.js.map +1 -1
  108. package/dist/collection/components/q2-dropdown-item/test/q2-dropdown-item-test.e2e.js.map +1 -1
  109. package/dist/collection/components/q2-editable-field/q2-editable-field.js.map +1 -1
  110. package/dist/collection/components/q2-editable-field/test/q2-editable-field-test.e2e.js.map +1 -1
  111. package/dist/collection/components/q2-icon/q2-icon-types.js.map +1 -1
  112. package/dist/collection/components/q2-icon/q2-icon.js.map +1 -1
  113. package/dist/collection/components/q2-icon/test/q2-icon-test.e2e.js.map +1 -1
  114. package/dist/collection/components/q2-input/formatting/alpha.js.map +1 -1
  115. package/dist/collection/components/q2-input/formatting/alphanumeric.js.map +1 -1
  116. package/dist/collection/components/q2-input/formatting/credit-card.js.map +1 -1
  117. package/dist/collection/components/q2-input/formatting/credit-card.spec.js.map +1 -1
  118. package/dist/collection/components/q2-input/formatting/currency.js.map +1 -1
  119. package/dist/collection/components/q2-input/formatting/date.js.map +1 -1
  120. package/dist/collection/components/q2-input/formatting/generic.js.map +1 -1
  121. package/dist/collection/components/q2-input/formatting/number.js.map +1 -1
  122. package/dist/collection/components/q2-input/formatting/numeric.js.map +1 -1
  123. package/dist/collection/components/q2-input/formatting/phone.js.map +1 -1
  124. package/dist/collection/components/q2-input/formatting/postal.js.map +1 -1
  125. package/dist/collection/components/q2-input/formatting/ssn.js.map +1 -1
  126. package/dist/collection/components/q2-input/formatting/tin.js.map +1 -1
  127. package/dist/collection/components/q2-input/q2-input-types.js.map +1 -1
  128. package/dist/collection/components/q2-input/q2-input.js +2 -2
  129. package/dist/collection/components/q2-input/q2-input.js.map +1 -1
  130. package/dist/collection/components/q2-input/test/q2-input-credit-card-test.e2e.js.map +1 -1
  131. package/dist/collection/components/q2-input/test/q2-input-test.e2e.js.map +1 -1
  132. package/dist/collection/components/q2-item/q2-item.js +1 -1
  133. package/dist/collection/components/q2-item/q2-item.js.map +1 -1
  134. package/dist/collection/components/q2-item/test/q2-item-test.e2e.js.map +1 -1
  135. package/dist/collection/components/q2-item/test/q2-item-test.spec.js.map +1 -1
  136. package/dist/collection/components/q2-legend/q2-legend.js +1 -1
  137. package/dist/collection/components/q2-legend/q2-legend.js.map +1 -1
  138. package/dist/collection/components/q2-legend/test/q2-legend-test.e2e.js.map +1 -1
  139. package/dist/collection/components/q2-legend/test/q2-legend-test.spec.js.map +1 -1
  140. package/dist/collection/components/q2-list/q2-list.js +1 -1
  141. package/dist/collection/components/q2-list/q2-list.js.map +1 -1
  142. package/dist/collection/components/q2-list/test/q2-list-test.e2e.js.map +1 -1
  143. package/dist/collection/components/q2-loading/q2-loading.js.map +1 -1
  144. package/dist/collection/components/q2-loading/skeleton/q2-loading-element/index.js.map +1 -1
  145. package/dist/collection/components/q2-loading/skeleton/shapes.js.map +1 -1
  146. package/dist/collection/components/q2-loading/test/q2-loading-element-test.e2e.js.map +1 -1
  147. package/dist/collection/components/q2-loading/test/q2-loading-test.e2e.js.map +1 -1
  148. package/dist/collection/components/q2-loc/q2-loc.js +1 -1
  149. package/dist/collection/components/q2-loc/q2-loc.js.map +1 -1
  150. package/dist/collection/components/q2-loc/test/q2-loc-test.e2e.js.map +1 -1
  151. package/dist/collection/components/q2-message/q2-message.js +1 -1
  152. package/dist/collection/components/q2-message/q2-message.js.map +1 -1
  153. package/dist/collection/components/q2-message/test/q2-message-test.e2e.js.map +1 -1
  154. package/dist/collection/components/q2-optgroup/q2-optgroup.js +1 -1
  155. package/dist/collection/components/q2-optgroup/q2-optgroup.js.map +1 -1
  156. package/dist/collection/components/q2-optgroup/test/q2-optgroup-test.e2e.js.map +1 -1
  157. package/dist/collection/components/q2-option/q2-option.js +1 -1
  158. package/dist/collection/components/q2-option/q2-option.js.map +1 -1
  159. package/dist/collection/components/q2-option/test/q2-option-test.e2e.js.map +1 -1
  160. package/dist/collection/components/q2-option-list/q2-option-list.js +2 -2
  161. package/dist/collection/components/q2-option-list/q2-option-list.js.map +1 -1
  162. package/dist/collection/components/q2-option-list/test/q2-option-list-test.e2e.js.map +1 -1
  163. package/dist/collection/components/q2-pagination/q2-pagination.js +2 -2
  164. package/dist/collection/components/q2-pagination/q2-pagination.js.map +1 -1
  165. package/dist/collection/components/q2-pagination/test/q2-pagination-test.e2e.js +1 -0
  166. package/dist/collection/components/q2-pagination/test/q2-pagination-test.e2e.js.map +1 -1
  167. package/dist/collection/components/q2-pill/q2-pill.js +1 -1
  168. package/dist/collection/components/q2-pill/q2-pill.js.map +1 -1
  169. package/dist/collection/components/q2-pill/test/q2-pill-test.e2e.js +1 -1
  170. package/dist/collection/components/q2-pill/test/q2-pill-test.e2e.js.map +1 -1
  171. package/dist/collection/components/q2-popover/q2-popover.css +18 -10
  172. package/dist/collection/components/q2-popover/q2-popover.js +73 -69
  173. package/dist/collection/components/q2-popover/q2-popover.js.map +1 -1
  174. package/dist/collection/components/q2-popover/test/q2-popover-test.e2e.js +1 -34
  175. package/dist/collection/components/q2-popover/test/q2-popover-test.e2e.js.map +1 -1
  176. package/dist/collection/components/q2-popover/test/q2-popover-test.spec.js +743 -435
  177. package/dist/collection/components/q2-popover/test/q2-popover-test.spec.js.map +1 -1
  178. package/dist/collection/components/q2-radio/q2-radio.js.map +1 -1
  179. package/dist/collection/components/q2-radio/test/q2-radio-test.e2e.js.map +1 -1
  180. package/dist/collection/components/q2-radio-group/q2-radio-group.js.map +1 -1
  181. package/dist/collection/components/q2-radio-group/test/q2-radio-group-test.e2e.js.map +1 -1
  182. package/dist/collection/components/q2-relative-time/q2-relative-time.js +1 -1
  183. package/dist/collection/components/q2-relative-time/q2-relative-time.js.map +1 -1
  184. package/dist/collection/components/q2-relative-time/test/q2-relative-time-test.e2e.js.map +1 -1
  185. package/dist/collection/components/q2-section/q2-section.js +2 -2
  186. package/dist/collection/components/q2-section/q2-section.js.map +1 -1
  187. package/dist/collection/components/q2-section/test/q2-section-test.e2e.js.map +1 -1
  188. package/dist/collection/components/q2-select/q2-select.js +135 -21
  189. package/dist/collection/components/q2-select/q2-select.js.map +1 -1
  190. package/dist/collection/components/q2-select/test/q2-select-test.e2e.js +1 -1
  191. package/dist/collection/components/q2-select/test/q2-select-test.e2e.js.map +1 -1
  192. package/dist/collection/components/q2-select/test/q2-select-test.spec.js +412 -0
  193. package/dist/collection/components/q2-select/test/q2-select-test.spec.js.map +1 -0
  194. package/dist/collection/components/q2-stepper/q2-stepper.js +1 -1
  195. package/dist/collection/components/q2-stepper/q2-stepper.js.map +1 -1
  196. package/dist/collection/components/q2-stepper/test/q2-stepper-test.e2e.js.map +1 -1
  197. package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js +2 -2
  198. package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js.map +1 -1
  199. package/dist/collection/components/q2-stepper-pane/test/q2-stepper-pane-test.e2e.js.map +1 -1
  200. package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js +1 -1
  201. package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js.map +1 -1
  202. package/dist/collection/components/q2-stepper-vertical/test/q2-stepper-vertical-test.e2e.js.map +1 -1
  203. package/dist/collection/components/q2-tab-container/q2-tab-container.js +1 -1
  204. package/dist/collection/components/q2-tab-container/q2-tab-container.js.map +1 -1
  205. package/dist/collection/components/q2-tab-container/test/q2-tab-container-test.e2e.js.map +1 -1
  206. package/dist/collection/components/q2-tab-container/test/q2-tab-container-test.spec.js.map +1 -1
  207. package/dist/collection/components/q2-tab-pane/q2-tab-pane.js +1 -1
  208. package/dist/collection/components/q2-tab-pane/q2-tab-pane.js.map +1 -1
  209. package/dist/collection/components/q2-tab-pane/test/q2-tab-pane-test.e2e.js.map +1 -1
  210. package/dist/collection/components/q2-tag/q2-tag.js +1 -1
  211. package/dist/collection/components/q2-tag/q2-tag.js.map +1 -1
  212. package/dist/collection/components/q2-tag/test/q2-tag-test.e2e.js +6 -1
  213. package/dist/collection/components/q2-tag/test/q2-tag-test.e2e.js.map +1 -1
  214. package/dist/collection/components/q2-textarea/q2-textarea.js +1 -1
  215. package/dist/collection/components/q2-textarea/q2-textarea.js.map +1 -1
  216. package/dist/collection/components/q2-textarea/test/q2-textarea-test.e2e.js.map +1 -1
  217. package/dist/collection/components/q2-tooltip/q2-tooltip.js.map +1 -1
  218. package/dist/collection/components/q2-tooltip/test/q2-tooltip-test.e2e.js.map +1 -1
  219. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane-types.js.map +1 -1
  220. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +2 -2
  221. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js.map +1 -1
  222. package/dist/collection/components/tecton-tab-pane/test/tecton-tab-pane-test.e2e.js.map +1 -1
  223. package/dist/collection/index.js.map +1 -1
  224. package/dist/collection/utils/action-sheet.js.map +1 -1
  225. package/dist/collection/utils/charting.js.map +1 -1
  226. package/dist/collection/utils/helpers.js.map +1 -1
  227. package/dist/collection/utils/index.js.map +1 -1
  228. package/dist/collection/utils/test/action-sheet-test.e2e.js.map +1 -1
  229. package/dist/collection/utils/test/index.spec.js.map +1 -1
  230. package/dist/components/index2.js +1 -20
  231. package/dist/components/index2.js.map +1 -1
  232. package/dist/components/q2-action-sheet.js +1 -1
  233. package/dist/components/q2-avatar2.js +1 -1
  234. package/dist/components/q2-carousel-pane.js +2 -2
  235. package/dist/components/q2-chart-area.js +1 -1
  236. package/dist/components/q2-chart-bar.js +1 -1
  237. package/dist/components/q2-chart-donut.js +1 -1
  238. package/dist/components/q2-currency.js +1 -1
  239. package/dist/components/q2-detail.js +1 -1
  240. package/dist/components/q2-input2.js +1 -1
  241. package/dist/components/q2-item.js +1 -1
  242. package/dist/components/q2-legend2.js +1 -1
  243. package/dist/components/q2-list.js +1 -1
  244. package/dist/components/q2-loc.js +1 -1
  245. package/dist/components/q2-message2.js +1 -1
  246. package/dist/components/q2-month-picker.js +2 -2
  247. package/dist/components/q2-optgroup2.js +1 -1
  248. package/dist/components/q2-option2.js +1 -1
  249. package/dist/components/q2-pagination.js +2 -2
  250. package/dist/components/q2-pill.js +1 -1
  251. package/dist/components/q2-popover2.js +72 -69
  252. package/dist/components/q2-popover2.js.map +1 -1
  253. package/dist/components/q2-relative-time.js +1 -1
  254. package/dist/components/q2-section.js +2 -2
  255. package/dist/components/q2-select2.js +101 -22
  256. package/dist/components/q2-select2.js.map +1 -1
  257. package/dist/components/q2-stepper-vertical.js +1 -1
  258. package/dist/components/q2-stepper.js +1 -1
  259. package/dist/components/q2-tab-container.js +1 -1
  260. package/dist/components/q2-tab-pane.js +1 -1
  261. package/dist/components/q2-tag.js +1 -1
  262. package/dist/components/q2-textarea.js +1 -1
  263. package/dist/components/tecton-tab-pane.js +2 -2
  264. package/dist/esm/click-elsewhere_2.entry.js +73 -70
  265. package/dist/esm/click-elsewhere_2.entry.js.map +1 -1
  266. package/dist/esm/{index-c6d74f10.js → index-3184c760.js} +1 -1
  267. package/dist/esm/{index-c6d74f10.js.map → index-3184c760.js.map} +1 -1
  268. package/dist/esm/{index-4a80972c.js → index-c774e1e4.js} +2 -21
  269. package/dist/esm/index-c774e1e4.js.map +1 -0
  270. package/dist/esm/loader.js +1 -1
  271. package/dist/esm/q2-action-sheet.entry.js +2 -2
  272. package/dist/esm/q2-avatar.entry.js +1 -1
  273. package/dist/esm/q2-badge_7.entry.js +4 -4
  274. package/dist/esm/q2-calendar.entry.js +2 -2
  275. package/dist/esm/q2-card.entry.js +1 -1
  276. package/dist/esm/q2-carousel-pane.entry.js +3 -3
  277. package/dist/esm/q2-carousel.entry.js +1 -1
  278. package/dist/esm/q2-chart-area.entry.js +2 -2
  279. package/dist/esm/q2-chart-bar.entry.js +2 -2
  280. package/dist/esm/q2-chart-donut.entry.js +2 -2
  281. package/dist/esm/q2-checkbox-group.entry.js +1 -1
  282. package/dist/esm/q2-checkbox.entry.js +1 -1
  283. package/dist/esm/q2-currency.entry.js +1 -1
  284. package/dist/esm/q2-data-table.entry.js +1 -1
  285. package/dist/esm/q2-detail.entry.js +2 -2
  286. package/dist/esm/q2-dropdown-item.entry.js +1 -1
  287. package/dist/esm/q2-dropdown.entry.js +1 -1
  288. package/dist/esm/q2-editable-field.entry.js +1 -1
  289. package/dist/esm/q2-item.entry.js +2 -2
  290. package/dist/esm/q2-legend.entry.js +1 -1
  291. package/dist/esm/q2-list.entry.js +2 -2
  292. package/dist/esm/q2-loc.entry.js +2 -2
  293. package/dist/esm/q2-message.entry.js +2 -2
  294. package/dist/esm/q2-month-picker.entry.js +3 -3
  295. package/dist/esm/q2-optgroup.entry.js +2 -2
  296. package/dist/esm/q2-option-list.entry.js +1 -1
  297. package/dist/esm/q2-option.entry.js +1 -1
  298. package/dist/esm/q2-pagination.entry.js +3 -3
  299. package/dist/esm/q2-pill.entry.js +2 -2
  300. package/dist/esm/q2-radio-group.entry.js +1 -1
  301. package/dist/esm/q2-radio.entry.js +1 -1
  302. package/dist/esm/q2-relative-time.entry.js +3 -3
  303. package/dist/esm/q2-section.entry.js +3 -3
  304. package/dist/esm/q2-select.entry.js +98 -20
  305. package/dist/esm/q2-select.entry.js.map +1 -1
  306. package/dist/esm/q2-stepper-pane.entry.js +1 -1
  307. package/dist/esm/q2-stepper-vertical.entry.js +2 -2
  308. package/dist/esm/q2-stepper.entry.js +2 -2
  309. package/dist/esm/q2-tag.entry.js +2 -2
  310. package/dist/esm/q2-tecton-elements.js +1 -1
  311. package/dist/esm/q2-textarea.entry.js +2 -2
  312. package/dist/esm/q2-tooltip.entry.js +1 -1
  313. package/dist/esm/tecton-tab-pane.entry.js +2 -2
  314. package/dist/jest.setup.js +22 -0
  315. package/dist/jest.setup.js.map +1 -0
  316. package/dist/q2-tecton-elements/{p-77272c4c.entry.js → p-0106e160.entry.js} +2 -2
  317. package/dist/q2-tecton-elements/{p-cb3f48de.entry.js → p-17a925c1.entry.js} +2 -2
  318. package/dist/q2-tecton-elements/{p-9a1a4bc0.js → p-19784a09.js} +2 -2
  319. package/dist/q2-tecton-elements/p-19784a09.js.map +1 -0
  320. package/dist/q2-tecton-elements/{p-34856c71.entry.js → p-1d38ba53.entry.js} +2 -2
  321. package/dist/q2-tecton-elements/{p-b72fd065.entry.js → p-2e26e06d.entry.js} +2 -2
  322. package/dist/q2-tecton-elements/{p-661ed976.entry.js → p-42e791cd.entry.js} +2 -2
  323. package/dist/q2-tecton-elements/{p-6e6d9793.entry.js → p-4498cd2f.entry.js} +2 -2
  324. package/dist/q2-tecton-elements/{p-376a0589.entry.js → p-531c96c8.entry.js} +2 -2
  325. package/dist/q2-tecton-elements/{p-395904b4.entry.js → p-68810402.entry.js} +2 -2
  326. package/dist/q2-tecton-elements/{p-6b7c53a8.entry.js → p-73cbf3bd.entry.js} +2 -2
  327. package/dist/q2-tecton-elements/{p-34696e3f.entry.js → p-7a5f1418.entry.js} +2 -2
  328. package/dist/q2-tecton-elements/{p-5d936af5.entry.js → p-80d6991d.entry.js} +2 -2
  329. package/dist/q2-tecton-elements/{p-2fcaf2d6.entry.js → p-810edec0.entry.js} +2 -2
  330. package/dist/q2-tecton-elements/{p-4116579f.entry.js → p-87b84009.entry.js} +2 -2
  331. package/dist/q2-tecton-elements/{p-8a4b106d.entry.js → p-8cb85069.entry.js} +2 -2
  332. package/dist/q2-tecton-elements/{p-2ca6d44f.entry.js → p-9ffc7859.entry.js} +2 -2
  333. package/dist/q2-tecton-elements/{p-074ae80c.entry.js → p-a41da37c.entry.js} +2 -2
  334. package/dist/q2-tecton-elements/{p-2c26295e.entry.js → p-ab35aa27.entry.js} +2 -2
  335. package/dist/q2-tecton-elements/{p-d2e1631a.entry.js → p-acba752c.entry.js} +2 -2
  336. package/dist/q2-tecton-elements/{p-0a3a804a.entry.js → p-b0ef6f43.entry.js} +2 -2
  337. package/dist/q2-tecton-elements/{p-403bf3d4.entry.js → p-b18c846d.entry.js} +2 -2
  338. package/dist/q2-tecton-elements/{p-c81d299a.entry.js → p-b22410f6.entry.js} +2 -2
  339. package/dist/q2-tecton-elements/{p-ce4e6b41.entry.js → p-b8aa76a0.entry.js} +2 -2
  340. package/dist/q2-tecton-elements/{p-ad998f71.entry.js → p-ba25f9a1.entry.js} +2 -2
  341. package/dist/q2-tecton-elements/{p-cf966a0f.entry.js → p-bed61b18.entry.js} +2 -2
  342. package/dist/q2-tecton-elements/{p-6237c775.entry.js → p-c0e76a27.entry.js} +2 -2
  343. package/dist/q2-tecton-elements/{p-58cafc0d.entry.js → p-c1790396.entry.js} +2 -2
  344. package/dist/q2-tecton-elements/{p-adec9275.entry.js → p-c59ad989.entry.js} +2 -2
  345. package/dist/q2-tecton-elements/{p-3c7be0bb.entry.js → p-cbb02f6f.entry.js} +2 -2
  346. package/dist/q2-tecton-elements/{p-c0c658d1.entry.js → p-cd460504.entry.js} +2 -2
  347. package/dist/q2-tecton-elements/p-d34fff19.entry.js +2 -0
  348. package/dist/q2-tecton-elements/p-d34fff19.entry.js.map +1 -0
  349. package/dist/q2-tecton-elements/{p-0a1dff75.entry.js → p-d3f700fe.entry.js} +2 -2
  350. package/dist/q2-tecton-elements/{p-3b0d3cd4.entry.js → p-d5a11ae4.entry.js} +2 -2
  351. package/dist/q2-tecton-elements/p-e0675a03.entry.js +2 -0
  352. package/dist/q2-tecton-elements/p-e0675a03.entry.js.map +1 -0
  353. package/dist/q2-tecton-elements/{p-072c5877.entry.js → p-e098781c.entry.js} +2 -2
  354. package/dist/q2-tecton-elements/{p-fffb54e9.entry.js → p-ec86e604.entry.js} +2 -2
  355. package/dist/q2-tecton-elements/{p-77a0cc0c.entry.js → p-f0aca80a.entry.js} +2 -2
  356. package/dist/q2-tecton-elements/{p-721365be.js → p-f1e887f5.js} +1 -1
  357. package/dist/q2-tecton-elements/{p-8111547c.entry.js → p-f321dc16.entry.js} +2 -2
  358. package/dist/q2-tecton-elements/{p-45407ecc.entry.js → p-f409b668.entry.js} +2 -2
  359. package/dist/q2-tecton-elements/{p-adf0a7c9.entry.js → p-fb65b8f3.entry.js} +2 -2
  360. package/dist/q2-tecton-elements/{p-a7a0b8aa.entry.js → p-fb72d692.entry.js} +2 -2
  361. package/dist/q2-tecton-elements/{p-259b728a.entry.js → p-fcb11cea.entry.js} +2 -2
  362. package/dist/q2-tecton-elements/{p-cf32b5db.entry.js → p-fe61cc4c.entry.js} +2 -2
  363. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  364. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js.map +1 -1
  365. package/dist/types/builds/q2e/development/tecton/tecton/packages/q2-tecton-elements/.stencil/jest.setup.d.ts +1 -0
  366. package/dist/types/components/q2-popover/q2-popover.d.ts +5 -5
  367. package/dist/types/components/q2-select/q2-select.d.ts +24 -0
  368. package/dist/types/components.d.ts +8 -0
  369. package/package.json +3 -3
  370. package/dist/cjs/index-64d8b839.js.map +0 -1
  371. package/dist/esm/index-4a80972c.js.map +0 -1
  372. package/dist/q2-tecton-elements/p-9a1a4bc0.js.map +0 -1
  373. package/dist/q2-tecton-elements/p-aa57b657.entry.js +0 -2
  374. package/dist/q2-tecton-elements/p-aa57b657.entry.js.map +0 -1
  375. package/dist/q2-tecton-elements/p-dc77bf66.entry.js +0 -2
  376. package/dist/q2-tecton-elements/p-dc77bf66.entry.js.map +0 -1
  377. /package/dist/q2-tecton-elements/{p-77272c4c.entry.js.map → p-0106e160.entry.js.map} +0 -0
  378. /package/dist/q2-tecton-elements/{p-cb3f48de.entry.js.map → p-17a925c1.entry.js.map} +0 -0
  379. /package/dist/q2-tecton-elements/{p-34856c71.entry.js.map → p-1d38ba53.entry.js.map} +0 -0
  380. /package/dist/q2-tecton-elements/{p-b72fd065.entry.js.map → p-2e26e06d.entry.js.map} +0 -0
  381. /package/dist/q2-tecton-elements/{p-661ed976.entry.js.map → p-42e791cd.entry.js.map} +0 -0
  382. /package/dist/q2-tecton-elements/{p-6e6d9793.entry.js.map → p-4498cd2f.entry.js.map} +0 -0
  383. /package/dist/q2-tecton-elements/{p-376a0589.entry.js.map → p-531c96c8.entry.js.map} +0 -0
  384. /package/dist/q2-tecton-elements/{p-395904b4.entry.js.map → p-68810402.entry.js.map} +0 -0
  385. /package/dist/q2-tecton-elements/{p-6b7c53a8.entry.js.map → p-73cbf3bd.entry.js.map} +0 -0
  386. /package/dist/q2-tecton-elements/{p-34696e3f.entry.js.map → p-7a5f1418.entry.js.map} +0 -0
  387. /package/dist/q2-tecton-elements/{p-5d936af5.entry.js.map → p-80d6991d.entry.js.map} +0 -0
  388. /package/dist/q2-tecton-elements/{p-2fcaf2d6.entry.js.map → p-810edec0.entry.js.map} +0 -0
  389. /package/dist/q2-tecton-elements/{p-4116579f.entry.js.map → p-87b84009.entry.js.map} +0 -0
  390. /package/dist/q2-tecton-elements/{p-8a4b106d.entry.js.map → p-8cb85069.entry.js.map} +0 -0
  391. /package/dist/q2-tecton-elements/{p-2ca6d44f.entry.js.map → p-9ffc7859.entry.js.map} +0 -0
  392. /package/dist/q2-tecton-elements/{p-074ae80c.entry.js.map → p-a41da37c.entry.js.map} +0 -0
  393. /package/dist/q2-tecton-elements/{p-2c26295e.entry.js.map → p-ab35aa27.entry.js.map} +0 -0
  394. /package/dist/q2-tecton-elements/{p-d2e1631a.entry.js.map → p-acba752c.entry.js.map} +0 -0
  395. /package/dist/q2-tecton-elements/{p-0a3a804a.entry.js.map → p-b0ef6f43.entry.js.map} +0 -0
  396. /package/dist/q2-tecton-elements/{p-403bf3d4.entry.js.map → p-b18c846d.entry.js.map} +0 -0
  397. /package/dist/q2-tecton-elements/{p-c81d299a.entry.js.map → p-b22410f6.entry.js.map} +0 -0
  398. /package/dist/q2-tecton-elements/{p-ce4e6b41.entry.js.map → p-b8aa76a0.entry.js.map} +0 -0
  399. /package/dist/q2-tecton-elements/{p-ad998f71.entry.js.map → p-ba25f9a1.entry.js.map} +0 -0
  400. /package/dist/q2-tecton-elements/{p-cf966a0f.entry.js.map → p-bed61b18.entry.js.map} +0 -0
  401. /package/dist/q2-tecton-elements/{p-6237c775.entry.js.map → p-c0e76a27.entry.js.map} +0 -0
  402. /package/dist/q2-tecton-elements/{p-58cafc0d.entry.js.map → p-c1790396.entry.js.map} +0 -0
  403. /package/dist/q2-tecton-elements/{p-adec9275.entry.js.map → p-c59ad989.entry.js.map} +0 -0
  404. /package/dist/q2-tecton-elements/{p-3c7be0bb.entry.js.map → p-cbb02f6f.entry.js.map} +0 -0
  405. /package/dist/q2-tecton-elements/{p-c0c658d1.entry.js.map → p-cd460504.entry.js.map} +0 -0
  406. /package/dist/q2-tecton-elements/{p-0a1dff75.entry.js.map → p-d3f700fe.entry.js.map} +0 -0
  407. /package/dist/q2-tecton-elements/{p-3b0d3cd4.entry.js.map → p-d5a11ae4.entry.js.map} +0 -0
  408. /package/dist/q2-tecton-elements/{p-072c5877.entry.js.map → p-e098781c.entry.js.map} +0 -0
  409. /package/dist/q2-tecton-elements/{p-fffb54e9.entry.js.map → p-ec86e604.entry.js.map} +0 -0
  410. /package/dist/q2-tecton-elements/{p-77a0cc0c.entry.js.map → p-f0aca80a.entry.js.map} +0 -0
  411. /package/dist/q2-tecton-elements/{p-721365be.js.map → p-f1e887f5.js.map} +0 -0
  412. /package/dist/q2-tecton-elements/{p-8111547c.entry.js.map → p-f321dc16.entry.js.map} +0 -0
  413. /package/dist/q2-tecton-elements/{p-45407ecc.entry.js.map → p-f409b668.entry.js.map} +0 -0
  414. /package/dist/q2-tecton-elements/{p-adf0a7c9.entry.js.map → p-fb65b8f3.entry.js.map} +0 -0
  415. /package/dist/q2-tecton-elements/{p-a7a0b8aa.entry.js.map → p-fb72d692.entry.js.map} +0 -0
  416. /package/dist/q2-tecton-elements/{p-259b728a.entry.js.map → p-fcb11cea.entry.js.map} +0 -0
  417. /package/dist/q2-tecton-elements/{p-cf32b5db.entry.js.map → p-fe61cc4c.entry.js.map} +0 -0
@@ -6,13 +6,15 @@ export class Q2Popover {
6
6
  * The number of pixels to leave between the popover and the edge of the viewport
7
7
  */
8
8
  this.displayBuffer = 10;
9
- /** remove when Popover API is supported in iOS */
10
9
  this.orientationChanged = false;
11
10
  this.handleMinHeight = () => {
12
11
  if (this.minHeight) {
13
12
  handleDeprecationWarning(this, 'minHeight', 'prop');
14
13
  }
15
14
  };
15
+ this.handlePopoverToggleEvent = (event) => {
16
+ this.popoverStateChanged.emit({ open: event.newState === 'open' });
17
+ };
16
18
  this.setAbsoluteCSSProperties = async () => {
17
19
  const { controlElement, containerElement, currentDirection, align } = this;
18
20
  if (align === 'right') {
@@ -37,25 +39,42 @@ export class Q2Popover {
37
39
  await waitForNextPaint();
38
40
  containerElement.style.setProperty('--comp-pop-opacity', '1');
39
41
  };
40
- this.setFixedCSSProperties = async () => {
41
- var _a, _b;
42
- const { controlElement, containerElement, currentDirection, rootElementRect } = this;
42
+ this.setPopoverAPICSSProperties = async () => {
43
+ var _a, _b, _c, _d, _e, _f;
44
+ const { controlElement, containerElement, currentDirection, isModule, align } = this;
43
45
  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 : {
44
46
  top: 0,
45
47
  bottom: 0,
46
48
  left: 0,
47
49
  right: 0,
48
50
  };
49
- const popoverLeft = controlLeft - rootElementRect.left;
51
+ const popoverLeft = controlLeft;
52
+ const popoverRight = ((_c = window === null || window === void 0 ? void 0 : window.visualViewport) === null || _c === void 0 ? void 0 : _c.width) - controlRight;
53
+ if (align === 'right') {
54
+ containerElement.style.setProperty('--comp-pop-right', `${popoverRight - window.scrollX}px`);
55
+ containerElement.style.setProperty('--comp-pop-left', 'unset');
56
+ }
57
+ else {
58
+ containerElement.style.setProperty('--comp-pop-left', `${popoverLeft + window.scrollX}px`);
59
+ containerElement.style.setProperty('--comp-pop-right', 'unset');
60
+ }
50
61
  if (this.block)
51
- containerElement.style.setProperty('--comp-pop-width', `${controlElement.offsetWidth || 0}px`);
52
- containerElement.style.setProperty('--comp-pop-left', `${popoverLeft}px`);
53
- containerElement.style.setProperty('--comp-pop-right', `${rootElementRect.width + rootElementRect.left - controlRight}px`);
62
+ containerElement.style.setProperty('--comp-pop-width', `${(controlElement === null || controlElement === void 0 ? void 0 : controlElement.offsetWidth) || 0}px`);
54
63
  if (currentDirection === 'up') {
55
- containerElement.style.setProperty('--comp-pop-bottom', `${rootElementRect.height + rootElementRect.top - controlTop}px`);
64
+ if (isModule) {
65
+ containerElement.style.setProperty('--comp-pop-bottom', `${window.innerHeight - controlTop}px`);
66
+ }
67
+ else {
68
+ containerElement.style.setProperty('--comp-pop-bottom', `${window.innerHeight - controlTop - ((_d = window === null || window === void 0 ? void 0 : window.visualViewport) === null || _d === void 0 ? void 0 : _d.offsetTop) - window.scrollY}px`);
69
+ }
56
70
  }
57
71
  if (currentDirection === 'down') {
58
- containerElement.style.setProperty('--comp-pop-top', `${controlBottom - rootElementRect.top}px`);
72
+ if (isModule) {
73
+ containerElement.style.setProperty('--comp-pop-top', `${controlBottom}px`);
74
+ }
75
+ else {
76
+ containerElement.style.setProperty('--comp-pop-top', `${controlBottom + ((_f = (_e = window === null || window === void 0 ? void 0 : window.visualViewport) === null || _e === void 0 ? void 0 : _e.offsetTop) !== null && _f !== void 0 ? _f : 0) + window.scrollY}px`);
77
+ }
59
78
  }
60
79
  // Wait for one paint to prevent layout thrashing
61
80
  await waitForNextPaint();
@@ -72,7 +91,7 @@ export class Q2Popover {
72
91
  };
73
92
  this.currentDirection = undefined;
74
93
  this.show = false;
75
- this.align = undefined;
94
+ this.align = 'left';
76
95
  this.block = undefined;
77
96
  this.controlElement = undefined;
78
97
  this.direction = undefined;
@@ -84,9 +103,21 @@ export class Q2Popover {
84
103
  // #region Component Lifecycle Events
85
104
  disconnectedCallback() {
86
105
  this.removeViewportListeners();
106
+ this.containerElement.removeEventListener('toggle', this.handlePopoverToggleEvent);
107
+ this.containerElement = null;
108
+ this.contentElement = null;
109
+ this.controlElement = null;
110
+ }
111
+ componentWillLoad() {
112
+ if (!this.supportsPopoverAPI) {
113
+ 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.');
114
+ this.mode = 'legacy';
115
+ }
87
116
  }
88
117
  componentDidLoad() {
89
118
  this.handleMinHeight();
119
+ if (this.supportsPopoverAPI)
120
+ this.containerElement.addEventListener('toggle', this.handlePopoverToggleEvent);
90
121
  if (this.open)
91
122
  this.determinePopDirection();
92
123
  }
@@ -113,7 +144,6 @@ export class Q2Popover {
113
144
  this.handleMinHeight();
114
145
  }
115
146
  async openChanged(open) {
116
- this.setRootElement();
117
147
  this.popoverStateChanged.emit({ open });
118
148
  if (open) {
119
149
  this.addViewportListeners();
@@ -122,14 +152,25 @@ export class Q2Popover {
122
152
  else {
123
153
  this.removeViewportListeners();
124
154
  this.currentDirection = undefined;
125
- this.show = false;
155
+ if (this.mode === 'legacy' || !this.supportsPopoverAPI) {
156
+ this.show = false;
157
+ }
158
+ else {
159
+ this.containerElement.hidePopover();
160
+ }
126
161
  await waitForNextPaint();
127
162
  this.clearCSSProperties();
128
163
  }
129
164
  }
130
165
  // #endregion
131
166
  // #region Local Methods
132
- get actualDirection() {
167
+ get isModule() {
168
+ var _a, _b;
169
+ const isIframe = window !== window.top;
170
+ const hasPlatformDimensions = Object.keys((_b = (_a = window.Tecton) === null || _a === void 0 ? void 0 : _a.platformDimensions) !== null && _b !== void 0 ? _b : {}).length > 0;
171
+ return isIframe && hasPlatformDimensions;
172
+ }
173
+ get providedDirection() {
133
174
  const { direction } = this;
134
175
  switch (direction) {
135
176
  case 'up':
@@ -139,20 +180,16 @@ export class Q2Popover {
139
180
  return undefined;
140
181
  }
141
182
  }
142
- get isModule() {
143
- var _a, _b;
144
- const isIframe = window !== window.top;
145
- const hasPlatformDimensions = Object.keys((_b = (_a = window.Tecton) === null || _a === void 0 ? void 0 : _a.platformDimensions) !== null && _b !== void 0 ? _b : {}).length > 0;
146
- return isIframe && hasPlatformDimensions;
183
+ get supportsPopoverAPI() {
184
+ return Object.hasOwn(HTMLElement.prototype, 'popover');
147
185
  }
148
186
  addViewportListeners() {
149
187
  var _a;
150
188
  window.addEventListener('resize', this.viewPortOrientationChanged);
151
- // #region remove when Popover API is supported in iOS
189
+ visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.addEventListener('resize', this.viewPortChanged);
152
190
  window.addEventListener('scroll', this.viewPortChanged, { passive: true, capture: true });
153
- (_a = screen === null || screen === void 0 ? void 0 : screen.orientation) === null || _a === void 0 ? void 0 : _a.addEventListener('change', this.viewPortOrientationChanged);
191
+ (_a = screen === null || screen === void 0 ? void 0 : screen.orientation) === null || _a === void 0 ? void 0 : _a.addEventListener('orientationchange', this.viewPortOrientationChanged);
154
192
  window.addEventListener('orientationchange', this.viewPortOrientationChanged);
155
- // #endregion
156
193
  }
157
194
  clearCSSProperties() {
158
195
  this.containerElement.style.removeProperty('--comp-pop-max-height');
@@ -165,7 +202,7 @@ export class Q2Popover {
165
202
  }
166
203
  async determinePopDirection() {
167
204
  var _a, _b, _c;
168
- const { containerElement, controlElement, actualDirection, displayBuffer } = this;
205
+ const { containerElement, controlElement, providedDirection, displayBuffer } = this;
169
206
  if (containerElement)
170
207
  containerElement.style.maxHeight = null;
171
208
  await waitForNextPaint();
@@ -200,7 +237,7 @@ export class Q2Popover {
200
237
  const shouldUpdateMaxHeight = !containerElement.style.getPropertyValue('--comp-pop-max-height') || this.orientationChanged;
201
238
  // we do not want to constantly update the max-height after an orientation change, so we switch this back to false
202
239
  this.orientationChanged = false;
203
- const currentOrDetermineDirection = this.currentDirection || actualDirection || directionWithMostSpace;
240
+ const currentOrDetermineDirection = this.currentDirection || providedDirection || directionWithMostSpace;
204
241
  switch (currentOrDetermineDirection) {
205
242
  case 'up':
206
243
  if (shouldUpdateMaxHeight) {
@@ -221,72 +258,38 @@ export class Q2Popover {
221
258
  removeViewportListeners() {
222
259
  var _a;
223
260
  window.removeEventListener('resize', this.viewPortOrientationChanged);
224
- // #region remove when Popover API is supported in iOS
225
- window.removeEventListener('scroll', this.viewPortChanged);
261
+ visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.removeEventListener('resize', this.viewPortChanged);
262
+ window.removeEventListener('scroll', this.viewPortChanged, { capture: true });
226
263
  (_a = screen === null || screen === void 0 ? void 0 : screen.orientation) === null || _a === void 0 ? void 0 : _a.removeEventListener('orientationchange', this.viewPortOrientationChanged);
227
264
  window.removeEventListener('orientationchange', this.viewPortOrientationChanged);
228
- // #endregion
229
265
  }
230
266
  setDirectionAndShow(direction) {
231
- this.setRootElement();
232
267
  // Due to some runtime inconsistency across devices/browsers we need to add one more check here because the
233
268
  // popover can be closed between the time the popover is opened and the time the direction is determined
234
269
  const isOpen = this.open;
235
270
  if (!isOpen)
236
271
  return;
237
272
  this.currentDirection = direction;
238
- this.show = true;
239
- if (this.mode === 'legacy') {
273
+ if (this.mode === 'legacy' || !this.supportsPopoverAPI) {
274
+ this.show = true;
240
275
  this.setAbsoluteCSSProperties();
241
276
  }
242
277
  else {
243
- this.setFixedCSSProperties();
278
+ this.setPopoverAPICSSProperties();
279
+ this.containerElement.showPopover();
244
280
  }
245
281
  }
246
- setRootElement() {
247
- let currentElement = this.hostElement;
248
- while (currentElement && currentElement !== document.documentElement) {
249
- const computedStyle = window.getComputedStyle(currentElement);
250
- // Check if the element has any styles applied that create a new containg block
251
- if (computedStyle.transform !== 'none' ||
252
- computedStyle.filter !== 'none' ||
253
- computedStyle.perspective !== 'none' ||
254
- computedStyle.containerType !== 'normal' ||
255
- ['transform', 'perspective', 'filter'].includes(computedStyle.willChange) ||
256
- ['layout', 'paint', 'strict', 'content'].includes(computedStyle.contain)) {
257
- this.rootElementRect = currentElement.getBoundingClientRect();
258
- return;
259
- }
260
- const rootNode = currentElement.getRootNode();
261
- const isRootNodeWebComponent = typeof ShadowRoot !== 'undefined' &&
262
- rootNode instanceof ShadowRoot &&
263
- rootNode.host instanceof HTMLElement;
264
- if (isRootNodeWebComponent) {
265
- currentElement = rootNode.host;
266
- }
267
- else {
268
- currentElement = currentElement.parentElement;
269
- }
270
- }
271
- // Return the document's bounding rect if no element is found
272
- this.rootElementRect = {
273
- top: 0,
274
- bottom: 0,
275
- left: 0,
276
- right: 0,
277
- height: window.visualViewport.height,
278
- width: window.visualViewport.width,
279
- };
280
- }
281
282
  // #endregion
282
283
  // #region Render Methods
283
284
  render() {
284
- const containerClasses = ['container', this.currentDirection];
285
+ const containerClasses = ['container', this.currentDirection, this.align];
285
286
  if (this.show)
286
287
  containerClasses.push('show');
288
+ if (this.block)
289
+ containerClasses.push('block');
287
290
  if (this.mode === 'legacy')
288
291
  containerClasses.push('legacy');
289
- return (h("div", { key: '570cccbfa3c4830d4b9d52c9564c5355ed357e4f', ref: el => (this.containerElement = el), class: containerClasses.join(' '), "test-id": "outerContainer" }, h("div", { key: '7729d8f39d61e866de0cf3fe6d65fa8205af8a18', ref: el => (this.contentElement = el), class: "content" }, h("slot", { key: '315ce34d31a84a0a0d6688982567d2267452161c' }))));
292
+ return (h("div", { key: 'eb76d88fa98c35c45bc0615e4fb476c8dae8e885', ref: el => (this.containerElement = el), class: containerClasses.join(' '), "test-id": "outerContainer", tabIndex: -1, popover: "auto" }, h("div", { key: '34595cdb921b071b0082f90606343d9477ab0564', ref: el => (this.contentElement = el), class: "content" }, h("slot", { key: '58fc86882022353bf7786cd002f4dc0dc1b4ffdf' }))));
290
293
  }
291
294
  static get is() { return "q2-popover"; }
292
295
  static get encapsulation() { return "shadow"; }
@@ -317,7 +320,8 @@ export class Q2Popover {
317
320
  "text": "Aligns the popover to the left or right side of the control element."
318
321
  },
319
322
  "attribute": "align",
320
- "reflect": true
323
+ "reflect": true,
324
+ "defaultValue": "'left'"
321
325
  },
322
326
  "block": {
323
327
  "type": "boolean",
@@ -1 +1 @@
1
- {"version":3,"file":"q2-popover.js","sourceRoot":"","sources":["../../../src/components/q2-popover/q2-popover.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,IAAI,EACJ,CAAC,EAED,OAAO,EACP,KAAK,EACL,MAAM,EACN,MAAM,EAEN,KAAK,EACL,KAAK,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGzE,MAAM,OAAO,SAAS;;QAKlB;;WA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CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGJ","sourcesContent":["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 /** @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 }\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 actualDirection(): '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 isModule() {\n const isIframe = window !== window.top;\n const hasPlatformDimensions = Object.keys(window.Tecton?.platformDimensions ?? {}).length > 0;\n return isIframe && hasPlatformDimensions;\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, actualDirection, 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 || actualDirection || 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 removeViewportListeners() {\n window.removeEventListener('resize', this.viewPortOrientationChanged);\n // #region remove when Popover API is supported in iOS\n window.removeEventListener('scroll', this.viewPortChanged);\n screen?.orientation?.removeEventListener('orientationchange', 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\n // #endregion\n}\n"]}
1
+ {"version":3,"file":"q2-popover.js","sourceRoot":"","sources":["../../../../src/components/q2-popover/q2-popover.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,IAAI,EACJ,CAAC,EAED,OAAO,EACP,KAAK,EACL,MAAM,EACN,MAAM,EAEN,KAAK,EACL,KAAK,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGzE,MAAM,OAAO,SAAS;;QAKlB;;WAEG;QACH,kBAAa,GAAG,EAAE,CAAC;QACnB,uBAAkB,GAAY,KAAK,CAAC;QAqPpC,oBAAe,GAAG,GAAG,EAAE;YACnB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;gBACjB,wBAAwB,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;YACxD,CAAC;QACL,CAAC,CAAC;QAEF,6BAAwB,GAAG,CAAC,KAAkB,EAAE,EAAE;YAC9C,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC,CAAC;QACvE,CAAC,CAAC;QAUF,6BAAw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AAI,IAAI,CAAC,KAAK;YAAE,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/C,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ;YAAE,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAE5D,OAAO,CACH,4DACI,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC,EACvC,KAAK,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,aACzB,gBAAgB,EACxB,QAAQ,EAAE,CAAC,CAAC,EACZ,OAAO,EAAC,MAAM;YAEd,4DACI,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC,EACrC,KAAK,EAAC,SAAS;gBAEf,8DAAQ,CACN,CACJ,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGJ","sourcesContent":["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 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 /** @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 window.addEventListener('scroll', this.viewPortChanged, { passive: true, capture: true });\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\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 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?.visualViewport?.offsetTop - 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(\n '--comp-pop-top',\n `${controlBottom + (window?.visualViewport?.offsetTop ?? 0) + window.scrollY}px`\n );\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=\"auto\"\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"]}
@@ -432,37 +432,6 @@ describe('q2-popover', () => {
432
432
  });
433
433
  describe('Regressions', () => {
434
434
  describe('TCT-2699', () => {
435
- it('calls viewportChanged when document is scrolled', async () => {
436
- page = await setup({
437
- html: `
438
- <div style="height: 3000px">
439
- <div style="height: 50px;" id="control"></div>
440
- <q2-popover>
441
- <q2-option-list>
442
- <q2-option value="1">Account 1</q2-option>
443
- <q2-option value="2">Account 2</q2-option>
444
- <q2-option value="3">Account 3</q2-option>
445
- </q2-option-list>
446
- <q2-popover>
447
- </div>
448
- `,
449
- });
450
- popover = await page.find('q2-popover');
451
- popoverContainer = await page.find('q2-popover >>> .container');
452
- await page.$eval('q2-popover', (element) => {
453
- const controlElement = document.querySelector('#control');
454
- element.controlElement = controlElement;
455
- });
456
- await page.waitForChanges();
457
- await popover.setProperty('open', true);
458
- await page.waitForChanges();
459
- expect(popoverContainer).toHaveClass('down');
460
- expect(await getPopProperty('--comp-pop-top')).toEqual('58px');
461
- await page.$eval('body', () => window.scrollTo(0, 300));
462
- await page.waitForChanges();
463
- expect(popoverContainer).toHaveClass('down');
464
- expect(await getPopProperty('--comp-pop-top')).toEqual('-242px');
465
- });
466
435
  it('calls viewportChanged when another element is scrolled', async () => {
467
436
  page = await setup({
468
437
  html: `
@@ -584,14 +553,12 @@ describe('q2-popover', () => {
584
553
  element.controlElement = controlElement;
585
554
  });
586
555
  await page.waitForChanges();
587
- await popover.setProperty('open', true);
556
+ popover.setProperty('open', true);
588
557
  await page.waitForChanges();
589
558
  expect(popoverContainer).toHaveClass('up');
590
- expect(await getPopProperty('--comp-pop-bottom')).toEqual('200px');
591
559
  await page.$eval('body', () => window.scrollTo(0, 300));
592
560
  await page.waitForChanges();
593
561
  expect(popoverContainer).toHaveClass('up');
594
- expect(await getPopProperty('--comp-pop-bottom')).toEqual('500px');
595
562
  });
596
563
  });
597
564
  });