q2-tecton-elements 1.53.1 → 1.53.3

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 (421) hide show
  1. package/dist/cjs/click-elsewhere_2.cjs.entry.js +73 -69
  2. package/dist/cjs/click-elsewhere_2.cjs.entry.js.map +1 -1
  3. package/dist/cjs/{index-07285783.js → index-7aecfed8.js} +30 -18
  4. package/dist/cjs/index-7aecfed8.js.map +1 -0
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/q2-action-group.cjs.entry.js +2 -2
  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-example.cjs.entry.js +1 -1
  27. package/dist/cjs/q2-file-picker.cjs.entry.js +1 -1
  28. package/dist/cjs/q2-formatted-text.cjs.entry.js +1 -1
  29. package/dist/cjs/q2-item_3.cjs.entry.js +3 -3
  30. package/dist/cjs/q2-legend.cjs.entry.js +1 -1
  31. package/dist/cjs/q2-loc.cjs.entry.js +2 -2
  32. package/dist/cjs/q2-message.cjs.entry.js +2 -2
  33. package/dist/cjs/q2-month-picker.cjs.entry.js +3 -3
  34. package/dist/cjs/q2-optgroup.cjs.entry.js +2 -2
  35. package/dist/cjs/q2-option-list.cjs.entry.js +1 -1
  36. package/dist/cjs/q2-option.cjs.entry.js +2 -2
  37. package/dist/cjs/q2-pagination.cjs.entry.js +4 -4
  38. package/dist/cjs/q2-pill.cjs.entry.js +2 -2
  39. package/dist/cjs/q2-radio-group.cjs.entry.js +1 -1
  40. package/dist/cjs/q2-radio.cjs.entry.js +1 -1
  41. package/dist/cjs/q2-relative-time.cjs.entry.js +2 -2
  42. package/dist/cjs/q2-resize-observer.cjs.entry.js +1 -1
  43. package/dist/cjs/q2-section.cjs.entry.js +3 -3
  44. package/dist/cjs/q2-select.cjs.entry.js +130 -14
  45. package/dist/cjs/q2-select.cjs.entry.js.map +1 -1
  46. package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
  47. package/dist/cjs/q2-stepper-vertical.cjs.entry.js +2 -2
  48. package/dist/cjs/q2-stepper.cjs.entry.js +2 -2
  49. package/dist/cjs/q2-tag.cjs.entry.js +2 -2
  50. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  51. package/dist/cjs/q2-textarea.cjs.entry.js +2 -2
  52. package/dist/cjs/q2-tooltip.cjs.entry.js +1 -1
  53. package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -2
  54. package/dist/collection/components/click-elsewhere/click-elsewhere.js.map +1 -1
  55. package/dist/collection/components/click-elsewhere/test/click-elsewhere-test.e2e.js.map +1 -1
  56. package/dist/collection/components/q2-action-group/q2-action-group.js +1 -1
  57. package/dist/collection/components/q2-action-group/q2-action-group.js.map +1 -1
  58. package/dist/collection/components/q2-action-group/test/q2-action-group.e2e.js.map +1 -1
  59. package/dist/collection/components/q2-action-group/test/q2-action-group.spec.js.map +1 -1
  60. package/dist/collection/components/q2-action-sheet/q2-action-sheet.js +1 -1
  61. package/dist/collection/components/q2-action-sheet/q2-action-sheet.js.map +1 -1
  62. package/dist/collection/components/q2-action-sheet/test/q2-action-sheet-test.e2e.js.map +1 -1
  63. package/dist/collection/components/q2-avatar/q2-avatar.js +1 -1
  64. package/dist/collection/components/q2-avatar/q2-avatar.js.map +1 -1
  65. package/dist/collection/components/q2-avatar/test/q2-avatar-test.e2e.js.map +1 -1
  66. package/dist/collection/components/q2-badge/q2-badge.js.map +1 -1
  67. package/dist/collection/components/q2-badge/test/q2-badge-test.e2e.js.map +1 -1
  68. package/dist/collection/components/q2-btn/q2-btn.js.map +1 -1
  69. package/dist/collection/components/q2-btn/test/q2-btn-test.e2e.js.map +1 -1
  70. package/dist/collection/components/q2-calendar/q2-calendar-helpers.js.map +1 -1
  71. package/dist/collection/components/q2-calendar/q2-calendar-types.js.map +1 -1
  72. package/dist/collection/components/q2-calendar/q2-calendar-validation.js.map +1 -1
  73. package/dist/collection/components/q2-calendar/q2-calendar.js.map +1 -1
  74. package/dist/collection/components/q2-calendar/q2-month-picker.js +2 -2
  75. package/dist/collection/components/q2-calendar/q2-month-picker.js.map +1 -1
  76. package/dist/collection/components/q2-calendar/test/helpers-test.e2e.js.map +1 -1
  77. package/dist/collection/components/q2-calendar/test/q2-calendar-month-picker-test.e2e.js.map +1 -1
  78. package/dist/collection/components/q2-calendar/test/q2-calendar-test.e2e.js +2 -2
  79. package/dist/collection/components/q2-calendar/test/q2-calendar-test.e2e.js.map +1 -1
  80. package/dist/collection/components/q2-calendar/test/validation-test.e2e.js.map +1 -1
  81. package/dist/collection/components/q2-card/q2-card.js.map +1 -1
  82. package/dist/collection/components/q2-card/test/q2-card-test.e2e.js.map +1 -1
  83. package/dist/collection/components/q2-carousel/q2-carousel.js.map +1 -1
  84. package/dist/collection/components/q2-carousel/test/q2-carousel-test.e2e.js.map +1 -1
  85. package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js +2 -2
  86. package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js.map +1 -1
  87. package/dist/collection/components/q2-carousel-pane/test/q2-carousel-pane-test.e2e.js.map +1 -1
  88. package/dist/collection/components/q2-carousel-pane/test/q2-carousel-pane-test.spec.js.map +1 -1
  89. package/dist/collection/components/q2-chart-area/q2-chart-area.js +1 -1
  90. package/dist/collection/components/q2-chart-area/q2-chart-area.js.map +1 -1
  91. package/dist/collection/components/q2-chart-area/test/q2-chart-area-test.e2e.js.map +1 -1
  92. package/dist/collection/components/q2-chart-bar/q2-chart-bar.js +1 -1
  93. package/dist/collection/components/q2-chart-bar/q2-chart-bar.js.map +1 -1
  94. package/dist/collection/components/q2-chart-bar/test/q2-chart-bar-test.e2e.js.map +1 -1
  95. package/dist/collection/components/q2-chart-donut/q2-chart-donut.js +1 -1
  96. package/dist/collection/components/q2-chart-donut/q2-chart-donut.js.map +1 -1
  97. package/dist/collection/components/q2-chart-donut/test/q2-chart-donut-test.e2e.js.map +1 -1
  98. package/dist/collection/components/q2-checkbox/q2-checkbox.js.map +1 -1
  99. package/dist/collection/components/q2-checkbox/test/q2-checkbox-test.e2e.js.map +1 -1
  100. package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.js.map +1 -1
  101. package/dist/collection/components/q2-checkbox-group/test/q2-checkbox-group-test.e2e.js.map +1 -1
  102. package/dist/collection/components/q2-currency/q2-currency.js +1 -1
  103. package/dist/collection/components/q2-currency/q2-currency.js.map +1 -1
  104. package/dist/collection/components/q2-currency/test/q2-currency-test.e2e.js.map +1 -1
  105. package/dist/collection/components/q2-data-table/q2-data-table.js.map +1 -1
  106. package/dist/collection/components/q2-data-table/test/q2-data-table-test.e2e.js.map +1 -1
  107. package/dist/collection/components/q2-detail/q2-detail.js +1 -1
  108. package/dist/collection/components/q2-detail/q2-detail.js.map +1 -1
  109. package/dist/collection/components/q2-detail/test/q2-detail-test.e2e.js.map +1 -1
  110. package/dist/collection/components/q2-dropdown/q2-dropdown.js +3 -1
  111. package/dist/collection/components/q2-dropdown/q2-dropdown.js.map +1 -1
  112. package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.e2e.js +5 -17
  113. package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.e2e.js.map +1 -1
  114. package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.js.map +1 -1
  115. package/dist/collection/components/q2-dropdown-item/test/q2-dropdown-item-test.e2e.js.map +1 -1
  116. package/dist/collection/components/q2-editable-field/q2-editable-field.js.map +1 -1
  117. package/dist/collection/components/q2-editable-field/test/q2-editable-field-test.e2e.js.map +1 -1
  118. package/dist/collection/components/q2-example/q2-example.js +1 -1
  119. package/dist/collection/components/q2-example/q2-example.js.map +1 -1
  120. package/dist/collection/components/q2-example/test/q2-example.e2e.js.map +1 -1
  121. package/dist/collection/components/q2-example/test/q2-example.spec.js.map +1 -1
  122. package/dist/collection/components/q2-file-picker/q2-file-picker.js.map +1 -1
  123. package/dist/collection/components/q2-file-picker/test/q2-file-picker-test.e2e.js.map +1 -1
  124. package/dist/collection/components/q2-file-picker/test/q2-file-picker-test.spec.js.map +1 -1
  125. package/dist/collection/components/q2-formatted-text/q2-formatted-text.js +1 -1
  126. package/dist/collection/components/q2-formatted-text/q2-formatted-text.js.map +1 -1
  127. package/dist/collection/components/q2-formatted-text/test/q2-formatted-text-test.e2e.js.map +1 -1
  128. package/dist/collection/components/q2-icon/q2-icon-types.js.map +1 -1
  129. package/dist/collection/components/q2-icon/q2-icon.js.map +1 -1
  130. package/dist/collection/components/q2-icon/test/q2-icon-test.e2e.js.map +1 -1
  131. package/dist/collection/components/q2-input/formatting/alpha.js.map +1 -1
  132. package/dist/collection/components/q2-input/formatting/alpha.spec.js.map +1 -1
  133. package/dist/collection/components/q2-input/formatting/alphanumeric.js.map +1 -1
  134. package/dist/collection/components/q2-input/formatting/alphanumeric.spec.js.map +1 -1
  135. package/dist/collection/components/q2-input/formatting/credit-card.js.map +1 -1
  136. package/dist/collection/components/q2-input/formatting/credit-card.spec.js.map +1 -1
  137. package/dist/collection/components/q2-input/formatting/currency.js.map +1 -1
  138. package/dist/collection/components/q2-input/formatting/currency.spec.js.map +1 -1
  139. package/dist/collection/components/q2-input/formatting/date.js.map +1 -1
  140. package/dist/collection/components/q2-input/formatting/date.spec.js.map +1 -1
  141. package/dist/collection/components/q2-input/formatting/generic.js.map +1 -1
  142. package/dist/collection/components/q2-input/formatting/number.js.map +1 -1
  143. package/dist/collection/components/q2-input/formatting/numeric.js.map +1 -1
  144. package/dist/collection/components/q2-input/formatting/numeric.spec.js.map +1 -1
  145. package/dist/collection/components/q2-input/formatting/phone.js.map +1 -1
  146. package/dist/collection/components/q2-input/formatting/phone.spec.js.map +1 -1
  147. package/dist/collection/components/q2-input/formatting/postal.js.map +1 -1
  148. package/dist/collection/components/q2-input/formatting/postal.spec.js.map +1 -1
  149. package/dist/collection/components/q2-input/formatting/ssn.js.map +1 -1
  150. package/dist/collection/components/q2-input/formatting/ssn.spec.js.map +1 -1
  151. package/dist/collection/components/q2-input/formatting/tin.js.map +1 -1
  152. package/dist/collection/components/q2-input/formatting/tin.spec.js.map +1 -1
  153. package/dist/collection/components/q2-input/q2-input-types.js.map +1 -1
  154. package/dist/collection/components/q2-input/q2-input.js +1 -1
  155. package/dist/collection/components/q2-input/q2-input.js.map +1 -1
  156. package/dist/collection/components/q2-input/test/q2-input-credit-card-test.e2e.js.map +1 -1
  157. package/dist/collection/components/q2-input/test/q2-input-test.e2e.js.map +1 -1
  158. package/dist/collection/components/q2-input/test/q2-input-test.spec.js.map +1 -1
  159. package/dist/collection/components/q2-item/q2-item.js +1 -1
  160. package/dist/collection/components/q2-item/q2-item.js.map +1 -1
  161. package/dist/collection/components/q2-item/test/q2-item-test.e2e.js.map +1 -1
  162. package/dist/collection/components/q2-item/test/q2-item-test.spec.js.map +1 -1
  163. package/dist/collection/components/q2-legend/q2-legend.js +1 -1
  164. package/dist/collection/components/q2-legend/q2-legend.js.map +1 -1
  165. package/dist/collection/components/q2-legend/test/q2-legend-test.e2e.js.map +1 -1
  166. package/dist/collection/components/q2-legend/test/q2-legend-test.spec.js.map +1 -1
  167. package/dist/collection/components/q2-link/q2-link.js.map +1 -1
  168. package/dist/collection/components/q2-link/test/q2-link-test.e2e.js.map +1 -1
  169. package/dist/collection/components/q2-list/q2-list.js +1 -1
  170. package/dist/collection/components/q2-list/q2-list.js.map +1 -1
  171. package/dist/collection/components/q2-list/test/q2-list-test.e2e.js.map +1 -1
  172. package/dist/collection/components/q2-loading/q2-loading.js.map +1 -1
  173. package/dist/collection/components/q2-loading/skeleton/q2-loading-element/index.js.map +1 -1
  174. package/dist/collection/components/q2-loading/skeleton/shapes.js.map +1 -1
  175. package/dist/collection/components/q2-loading/test/q2-loading-element-test.e2e.js.map +1 -1
  176. package/dist/collection/components/q2-loading/test/q2-loading-test.e2e.js.map +1 -1
  177. package/dist/collection/components/q2-loc/q2-loc.js +1 -1
  178. package/dist/collection/components/q2-loc/q2-loc.js.map +1 -1
  179. package/dist/collection/components/q2-loc/test/q2-loc-test.e2e.js.map +1 -1
  180. package/dist/collection/components/q2-loc/test/q2-loc-test.spec.js.map +1 -1
  181. package/dist/collection/components/q2-message/q2-message.js +1 -1
  182. package/dist/collection/components/q2-message/q2-message.js.map +1 -1
  183. package/dist/collection/components/q2-message/test/q2-message-test.e2e.js.map +1 -1
  184. package/dist/collection/components/q2-optgroup/q2-optgroup.js +1 -1
  185. package/dist/collection/components/q2-optgroup/q2-optgroup.js.map +1 -1
  186. package/dist/collection/components/q2-optgroup/test/q2-optgroup-test.e2e.js.map +1 -1
  187. package/dist/collection/components/q2-option/q2-option.js +1 -1
  188. package/dist/collection/components/q2-option/q2-option.js.map +1 -1
  189. package/dist/collection/components/q2-option/test/q2-option-test.e2e.js.map +1 -1
  190. package/dist/collection/components/q2-option/test/q2-option-test.spec.js.map +1 -1
  191. package/dist/collection/components/q2-option-list/q2-option-list.js.map +1 -1
  192. package/dist/collection/components/q2-option-list/test/q2-option-list-test.e2e.js.map +1 -1
  193. package/dist/collection/components/q2-pagination/q2-pagination.js +3 -3
  194. package/dist/collection/components/q2-pagination/q2-pagination.js.map +1 -1
  195. package/dist/collection/components/q2-pagination/test/q2-pagination-test.e2e.js +1 -0
  196. package/dist/collection/components/q2-pagination/test/q2-pagination-test.e2e.js.map +1 -1
  197. package/dist/collection/components/q2-pill/q2-pill.js +1 -1
  198. package/dist/collection/components/q2-pill/q2-pill.js.map +1 -1
  199. package/dist/collection/components/q2-pill/test/q2-pill-test.e2e.js +2 -2
  200. package/dist/collection/components/q2-pill/test/q2-pill-test.e2e.js.map +1 -1
  201. package/dist/collection/components/q2-popover/q2-popover.css +18 -10
  202. package/dist/collection/components/q2-popover/q2-popover.js +74 -69
  203. package/dist/collection/components/q2-popover/q2-popover.js.map +1 -1
  204. package/dist/collection/components/q2-popover/test/q2-popover-test.e2e.js +1 -34
  205. package/dist/collection/components/q2-popover/test/q2-popover-test.e2e.js.map +1 -1
  206. package/dist/collection/components/q2-popover/test/q2-popover-test.spec.js +902 -511
  207. package/dist/collection/components/q2-popover/test/q2-popover-test.spec.js.map +1 -1
  208. package/dist/collection/components/q2-radio/q2-radio.js.map +1 -1
  209. package/dist/collection/components/q2-radio/test/q2-radio-test.e2e.js.map +1 -1
  210. package/dist/collection/components/q2-radio-group/q2-radio-group.js.map +1 -1
  211. package/dist/collection/components/q2-radio-group/test/q2-radio-group-test.e2e.js.map +1 -1
  212. package/dist/collection/components/q2-relative-time/q2-relative-time.js +1 -1
  213. package/dist/collection/components/q2-relative-time/q2-relative-time.js.map +1 -1
  214. package/dist/collection/components/q2-relative-time/test/q2-relative-time-test.e2e.js.map +1 -1
  215. package/dist/collection/components/q2-resize-observer/q2-resize-observer.js +1 -1
  216. package/dist/collection/components/q2-resize-observer/q2-resize-observer.js.map +1 -1
  217. package/dist/collection/components/q2-resize-observer/test/q2-resize-observer.e2e.js.map +1 -1
  218. package/dist/collection/components/q2-resize-observer/test/q2-resize-observer.spec.js.map +1 -1
  219. package/dist/collection/components/q2-section/q2-section.js +2 -2
  220. package/dist/collection/components/q2-section/q2-section.js.map +1 -1
  221. package/dist/collection/components/q2-section/test/q2-section-test.e2e.js.map +1 -1
  222. package/dist/collection/components/q2-select/q2-select.js +151 -16
  223. package/dist/collection/components/q2-select/q2-select.js.map +1 -1
  224. package/dist/collection/components/q2-select/test/q2-select-test.e2e.js +1 -1
  225. package/dist/collection/components/q2-select/test/q2-select-test.e2e.js.map +1 -1
  226. package/dist/collection/components/q2-select/test/q2-select-test.spec.js +552 -0
  227. package/dist/collection/components/q2-select/test/q2-select-test.spec.js.map +1 -0
  228. package/dist/collection/components/q2-stepper/q2-stepper.js +1 -1
  229. package/dist/collection/components/q2-stepper/q2-stepper.js.map +1 -1
  230. package/dist/collection/components/q2-stepper/test/q2-stepper-test.e2e.js.map +1 -1
  231. package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js.map +1 -1
  232. package/dist/collection/components/q2-stepper-pane/test/q2-stepper-pane-test.e2e.js.map +1 -1
  233. package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js +1 -1
  234. package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js.map +1 -1
  235. package/dist/collection/components/q2-stepper-vertical/test/q2-stepper-vertical-test.e2e.js.map +1 -1
  236. package/dist/collection/components/q2-tab-container/q2-tab-container.js +1 -1
  237. package/dist/collection/components/q2-tab-container/q2-tab-container.js.map +1 -1
  238. package/dist/collection/components/q2-tab-container/test/q2-tab-container-test.e2e.js.map +1 -1
  239. package/dist/collection/components/q2-tab-container/test/q2-tab-container-test.spec.js.map +1 -1
  240. package/dist/collection/components/q2-tab-pane/q2-tab-pane.js +1 -1
  241. package/dist/collection/components/q2-tab-pane/q2-tab-pane.js.map +1 -1
  242. package/dist/collection/components/q2-tab-pane/test/q2-tab-pane-test.e2e.js.map +1 -1
  243. package/dist/collection/components/q2-tag/q2-tag.js +1 -1
  244. package/dist/collection/components/q2-tag/q2-tag.js.map +1 -1
  245. package/dist/collection/components/q2-tag/test/q2-tag-test.e2e.js +6 -1
  246. package/dist/collection/components/q2-tag/test/q2-tag-test.e2e.js.map +1 -1
  247. package/dist/collection/components/q2-textarea/q2-textarea.js +1 -1
  248. package/dist/collection/components/q2-textarea/q2-textarea.js.map +1 -1
  249. package/dist/collection/components/q2-textarea/test/q2-textarea-test.e2e.js.map +1 -1
  250. package/dist/collection/components/q2-tooltip/q2-tooltip.js.map +1 -1
  251. package/dist/collection/components/q2-tooltip/test/q2-tooltip-test.e2e.js.map +1 -1
  252. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane-types.js.map +1 -1
  253. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +2 -2
  254. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js.map +1 -1
  255. package/dist/collection/components/tecton-tab-pane/test/tecton-tab-pane-test.e2e.js.map +1 -1
  256. package/dist/collection/index.js.map +1 -1
  257. package/dist/collection/utils/action-sheet.js.map +1 -1
  258. package/dist/collection/utils/charting.js.map +1 -1
  259. package/dist/collection/utils/helpers.js.map +1 -1
  260. package/dist/collection/utils/index.js +37 -0
  261. package/dist/collection/utils/index.js.map +1 -1
  262. package/dist/collection/utils/sanitize-html-string.js.map +1 -1
  263. package/dist/collection/utils/sanitize-regex-string.js.map +1 -1
  264. package/dist/collection/utils/test/action-sheet-test.e2e.js.map +1 -1
  265. package/dist/collection/utils/test/index.spec.js.map +1 -1
  266. package/dist/components/index2.js +29 -17
  267. package/dist/components/index2.js.map +1 -1
  268. package/dist/components/q2-action-group.js +1 -1
  269. package/dist/components/q2-action-sheet.js +1 -1
  270. package/dist/components/q2-avatar2.js +1 -1
  271. package/dist/components/q2-carousel-pane.js +2 -2
  272. package/dist/components/q2-chart-area.js +1 -1
  273. package/dist/components/q2-chart-bar.js +1 -1
  274. package/dist/components/q2-chart-donut.js +1 -1
  275. package/dist/components/q2-currency.js +1 -1
  276. package/dist/components/q2-detail.js +1 -1
  277. package/dist/components/q2-dropdown.js +3 -1
  278. package/dist/components/q2-dropdown.js.map +1 -1
  279. package/dist/components/q2-example.js +1 -1
  280. package/dist/components/q2-formatted-text.js +1 -1
  281. package/dist/components/q2-input2.js +1 -1
  282. package/dist/components/q2-item2.js +1 -1
  283. package/dist/components/q2-legend2.js +1 -1
  284. package/dist/components/q2-list2.js +1 -1
  285. package/dist/components/q2-loc.js +1 -1
  286. package/dist/components/q2-message2.js +1 -1
  287. package/dist/components/q2-month-picker.js +2 -2
  288. package/dist/components/q2-optgroup2.js +1 -1
  289. package/dist/components/q2-option2.js +1 -1
  290. package/dist/components/q2-pagination.js +3 -3
  291. package/dist/components/q2-pill.js +1 -1
  292. package/dist/components/q2-popover2.js +73 -69
  293. package/dist/components/q2-popover2.js.map +1 -1
  294. package/dist/components/q2-relative-time.js +1 -1
  295. package/dist/components/q2-resize-observer2.js +1 -1
  296. package/dist/components/q2-section.js +2 -2
  297. package/dist/components/q2-select2.js +133 -17
  298. package/dist/components/q2-select2.js.map +1 -1
  299. package/dist/components/q2-stepper-vertical.js +1 -1
  300. package/dist/components/q2-stepper.js +1 -1
  301. package/dist/components/q2-tab-container.js +1 -1
  302. package/dist/components/q2-tab-pane.js +1 -1
  303. package/dist/components/q2-tag.js +1 -1
  304. package/dist/components/q2-textarea.js +1 -1
  305. package/dist/components/tecton-tab-pane.js +2 -2
  306. package/dist/esm/click-elsewhere_2.entry.js +73 -69
  307. package/dist/esm/click-elsewhere_2.entry.js.map +1 -1
  308. package/dist/esm/{index-d18e2a20.js → index-99c46474.js} +30 -18
  309. package/dist/esm/index-99c46474.js.map +1 -0
  310. package/dist/esm/loader.js +1 -1
  311. package/dist/esm/q2-action-group.entry.js +2 -2
  312. package/dist/esm/q2-action-sheet.entry.js +2 -2
  313. package/dist/esm/q2-avatar.entry.js +1 -1
  314. package/dist/esm/q2-badge_7.entry.js +4 -4
  315. package/dist/esm/q2-calendar.entry.js +1 -1
  316. package/dist/esm/q2-card.entry.js +1 -1
  317. package/dist/esm/q2-carousel-pane.entry.js +3 -3
  318. package/dist/esm/q2-carousel.entry.js +1 -1
  319. package/dist/esm/q2-chart-area.entry.js +2 -2
  320. package/dist/esm/q2-chart-bar.entry.js +2 -2
  321. package/dist/esm/q2-chart-donut.entry.js +2 -2
  322. package/dist/esm/q2-checkbox-group.entry.js +1 -1
  323. package/dist/esm/q2-checkbox.entry.js +1 -1
  324. package/dist/esm/q2-currency.entry.js +1 -1
  325. package/dist/esm/q2-data-table.entry.js +1 -1
  326. package/dist/esm/q2-detail.entry.js +2 -2
  327. package/dist/esm/q2-dropdown-item.entry.js +1 -1
  328. package/dist/esm/q2-dropdown.entry.js +4 -2
  329. package/dist/esm/q2-dropdown.entry.js.map +1 -1
  330. package/dist/esm/q2-editable-field.entry.js +1 -1
  331. package/dist/esm/q2-example.entry.js +1 -1
  332. package/dist/esm/q2-file-picker.entry.js +1 -1
  333. package/dist/esm/q2-formatted-text.entry.js +1 -1
  334. package/dist/esm/q2-item_3.entry.js +3 -3
  335. package/dist/esm/q2-legend.entry.js +1 -1
  336. package/dist/esm/q2-loc.entry.js +2 -2
  337. package/dist/esm/q2-message.entry.js +2 -2
  338. package/dist/esm/q2-month-picker.entry.js +3 -3
  339. package/dist/esm/q2-optgroup.entry.js +2 -2
  340. package/dist/esm/q2-option-list.entry.js +1 -1
  341. package/dist/esm/q2-option.entry.js +2 -2
  342. package/dist/esm/q2-pagination.entry.js +4 -4
  343. package/dist/esm/q2-pill.entry.js +2 -2
  344. package/dist/esm/q2-radio-group.entry.js +1 -1
  345. package/dist/esm/q2-radio.entry.js +1 -1
  346. package/dist/esm/q2-relative-time.entry.js +2 -2
  347. package/dist/esm/q2-resize-observer.entry.js +1 -1
  348. package/dist/esm/q2-section.entry.js +3 -3
  349. package/dist/esm/q2-select.entry.js +131 -15
  350. package/dist/esm/q2-select.entry.js.map +1 -1
  351. package/dist/esm/q2-stepper-pane.entry.js +1 -1
  352. package/dist/esm/q2-stepper-vertical.entry.js +2 -2
  353. package/dist/esm/q2-stepper.entry.js +2 -2
  354. package/dist/esm/q2-tag.entry.js +2 -2
  355. package/dist/esm/q2-tecton-elements.js +1 -1
  356. package/dist/esm/q2-textarea.entry.js +2 -2
  357. package/dist/esm/q2-tooltip.entry.js +1 -1
  358. package/dist/esm/tecton-tab-pane.entry.js +2 -2
  359. package/dist/jest.setup.js +33 -0
  360. package/dist/jest.setup.js.map +1 -0
  361. package/dist/q2-tecton-elements/click-elsewhere_2.entry.js +103 -92
  362. package/dist/q2-tecton-elements/click-elsewhere_2.entry.js.map +1 -1
  363. package/dist/q2-tecton-elements/{index-d18e2a20.js → index-99c46474.js} +24 -17
  364. package/dist/q2-tecton-elements/index-99c46474.js.map +1 -0
  365. package/dist/q2-tecton-elements/q2-action-group.entry.js +4 -4
  366. package/dist/q2-tecton-elements/q2-action-sheet.entry.js +34 -34
  367. package/dist/q2-tecton-elements/q2-avatar.entry.js +6 -6
  368. package/dist/q2-tecton-elements/q2-badge_7.entry.js +17 -17
  369. package/dist/q2-tecton-elements/q2-calendar.entry.js +1 -1
  370. package/dist/q2-tecton-elements/q2-card.entry.js +1 -1
  371. package/dist/q2-tecton-elements/q2-carousel-pane.entry.js +21 -21
  372. package/dist/q2-tecton-elements/q2-carousel.entry.js +1 -1
  373. package/dist/q2-tecton-elements/q2-chart-area.entry.js +3 -3
  374. package/dist/q2-tecton-elements/q2-chart-bar.entry.js +80 -80
  375. package/dist/q2-tecton-elements/q2-chart-donut.entry.js +101 -101
  376. package/dist/q2-tecton-elements/q2-checkbox-group.entry.js +1 -1
  377. package/dist/q2-tecton-elements/q2-checkbox.entry.js +1 -1
  378. package/dist/q2-tecton-elements/q2-currency.entry.js +6 -6
  379. package/dist/q2-tecton-elements/q2-data-table.entry.js +1 -1
  380. package/dist/q2-tecton-elements/q2-detail.entry.js +39 -39
  381. package/dist/q2-tecton-elements/q2-dropdown-item.entry.js +1 -1
  382. package/dist/q2-tecton-elements/q2-dropdown.entry.js +13 -11
  383. package/dist/q2-tecton-elements/q2-dropdown.entry.js.map +1 -1
  384. package/dist/q2-tecton-elements/q2-editable-field.entry.js +8 -8
  385. package/dist/q2-tecton-elements/q2-example.entry.js +1 -1
  386. package/dist/q2-tecton-elements/q2-file-picker.entry.js +1 -1
  387. package/dist/q2-tecton-elements/q2-formatted-text.entry.js +2 -2
  388. package/dist/q2-tecton-elements/q2-item_3.entry.js +19 -19
  389. package/dist/q2-tecton-elements/q2-legend.entry.js +2 -2
  390. package/dist/q2-tecton-elements/q2-loc.entry.js +2 -2
  391. package/dist/q2-tecton-elements/q2-message.entry.js +21 -21
  392. package/dist/q2-tecton-elements/q2-month-picker.entry.js +14 -14
  393. package/dist/q2-tecton-elements/q2-optgroup.entry.js +8 -8
  394. package/dist/q2-tecton-elements/q2-option-list.entry.js +1 -1
  395. package/dist/q2-tecton-elements/q2-option.entry.js +14 -14
  396. package/dist/q2-tecton-elements/q2-pagination.entry.js +34 -34
  397. package/dist/q2-tecton-elements/q2-pill.entry.js +14 -14
  398. package/dist/q2-tecton-elements/q2-radio-group.entry.js +5 -5
  399. package/dist/q2-tecton-elements/q2-radio.entry.js +1 -1
  400. package/dist/q2-tecton-elements/q2-relative-time.entry.js +2 -2
  401. package/dist/q2-tecton-elements/q2-resize-observer.entry.js +1 -1
  402. package/dist/q2-tecton-elements/q2-section.entry.js +19 -19
  403. package/dist/q2-tecton-elements/q2-select.entry.js +196 -93
  404. package/dist/q2-tecton-elements/q2-select.entry.js.map +1 -1
  405. package/dist/q2-tecton-elements/q2-stepper-pane.entry.js +1 -1
  406. package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js +37 -37
  407. package/dist/q2-tecton-elements/q2-stepper.entry.js +29 -29
  408. package/dist/q2-tecton-elements/q2-tag.entry.js +25 -25
  409. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  410. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js.map +1 -1
  411. package/dist/q2-tecton-elements/q2-textarea.entry.js +3 -3
  412. package/dist/q2-tecton-elements/q2-tooltip.entry.js +1 -1
  413. package/dist/q2-tecton-elements/tecton-tab-pane.entry.js +6 -6
  414. package/dist/types/builds/q2e/development/tecton/tecton/packages/q2-tecton-elements/.stencil/jest.setup.d.ts +10 -0
  415. package/dist/types/components/q2-popover/q2-popover.d.ts +4 -4
  416. package/dist/types/components/q2-select/q2-select.d.ts +23 -0
  417. package/dist/types/utils/index.d.ts +3 -0
  418. package/package.json +3 -3
  419. package/dist/cjs/index-07285783.js.map +0 -1
  420. package/dist/esm/index-d18e2a20.js.map +0 -1
  421. package/dist/q2-tecton-elements/index-d18e2a20.js.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import { r as t, c as o, g as i, h as e } from "./index-7a5365e2.js";
2
2
 
3
- import { h as s, w as r } from "./index-d18e2a20.js";
3
+ import { h as s, w as r, x as n, d as p } from "./index-99c46474.js";
4
4
 
5
- const n = class {
5
+ const a = class {
6
6
  constructor(i) {
7
7
  t(this, i);
8
8
  this.change = o(this, "change", 7);
@@ -88,23 +88,28 @@ const n = class {
88
88
  }
89
89
  };
90
90
 
91
- const a = "*{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 c = "*{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
 
93
- const c = a;
93
+ const h = c;
94
94
 
95
- const h = class {
95
+ const l = class {
96
96
  constructor(i) {
97
97
  t(this, i);
98
98
  this.popoverStateChanged = o(this, "popoverStateChanged", 7);
99
99
  /**
100
100
  * The number of pixels to leave between the popover and the edge of the viewport
101
101
  */ this.displayBuffer = 10;
102
- /** remove when Popover API is supported in iOS */ this.orientationChanged = false;
102
+ this.orientationChanged = false;
103
103
  this.handleMinHeight = () => {
104
104
  if (this.minHeight) {
105
105
  s(this, "minHeight", "prop");
106
106
  }
107
107
  };
108
+ this.handlePopoverToggleEvent = t => {
109
+ this.popoverStateChanged.emit({
110
+ open: t.newState === "open"
111
+ });
112
+ };
108
113
  this.setAbsoluteCSSProperties = async () => {
109
114
  const {controlElement: t, containerElement: o, currentDirection: i, align: e} = this;
110
115
  if (e === "right") {
@@ -126,28 +131,42 @@ const h = class {
126
131
  await r();
127
132
  o.style.setProperty("--comp-pop-opacity", "1");
128
133
  };
129
- this.setFixedCSSProperties = async () => {
130
- var t, o;
131
- const {controlElement: i, containerElement: e, currentDirection: s, rootElementRect: n} = this;
132
- const {top: a, bottom: c, left: h, right: p} = (o = (t = i === null || i === void 0 ? void 0 : i.getBoundingClientRect) === null || t === void 0 ? void 0 : t.call(i)) !== null && o !== void 0 ? o : {
134
+ this.setPopoverAPICSSProperties = async () => {
135
+ var t, o, i;
136
+ const {controlElement: e, containerElement: s, currentDirection: n, isModule: p, align: a} = this;
137
+ const {top: c, bottom: h, left: l, right: d} = (o = (t = e === null || e === void 0 ? void 0 : e.getBoundingClientRect) === null || t === void 0 ? void 0 : t.call(e)) !== null && o !== void 0 ? o : {
133
138
  top: 0,
134
139
  bottom: 0,
135
140
  left: 0,
136
141
  right: 0
137
142
  };
138
- const l = h - n.left;
139
- if (this.block) e.style.setProperty("--comp-pop-width", `${(i === null || i === void 0 ? void 0 : i.offsetWidth) || 0}px`);
140
- e.style.setProperty("--comp-pop-left", `${l}px`);
141
- e.style.setProperty("--comp-pop-right", `${n.width + n.left - p}px`);
142
- if (s === "up") {
143
- e.style.setProperty("--comp-pop-bottom", `${n.height + n.top - a}px`);
143
+ const u = l;
144
+ const v = ((i = window === null || window === void 0 ? void 0 : window.visualViewport) === null || i === void 0 ? void 0 : i.width) - d;
145
+ if (a === "right") {
146
+ s.style.setProperty("--comp-pop-right", `${v - window.scrollX}px`);
147
+ s.style.setProperty("--comp-pop-left", "unset");
148
+ } else {
149
+ s.style.setProperty("--comp-pop-left", `${u + window.scrollX}px`);
150
+ s.style.setProperty("--comp-pop-right", "unset");
144
151
  }
145
- if (s === "down") {
146
- e.style.setProperty("--comp-pop-top", `${c - n.top}px`);
152
+ if (this.block) s.style.setProperty("--comp-pop-width", `${(e === null || e === void 0 ? void 0 : e.offsetWidth) || 0}px`);
153
+ if (n === "up") {
154
+ if (p) {
155
+ s.style.setProperty("--comp-pop-bottom", `${window.innerHeight - c}px`);
156
+ } else {
157
+ s.style.setProperty("--comp-pop-bottom", `${window.innerHeight - c - window.scrollY}px`);
158
+ }
159
+ }
160
+ if (n === "down") {
161
+ if (p) {
162
+ s.style.setProperty("--comp-pop-top", `${h}px`);
163
+ } else {
164
+ s.style.setProperty("--comp-pop-top", `${h + window.scrollY}px`);
165
+ }
147
166
  }
148
167
  // Wait for one paint to prevent layout thrashing
149
168
  await r();
150
- e.style.setProperty("--comp-pop-opacity", "1");
169
+ s.style.setProperty("--comp-pop-opacity", "1");
151
170
  };
152
171
  this.viewPortChanged = () => {
153
172
  if (!this.open) return;
@@ -159,7 +178,7 @@ const h = class {
159
178
  };
160
179
  this.currentDirection = undefined;
161
180
  this.show = false;
162
- this.align = undefined;
181
+ this.align = "left";
163
182
  this.block = undefined;
164
183
  this.controlElement = undefined;
165
184
  this.direction = undefined;
@@ -172,13 +191,20 @@ const h = class {
172
191
  // #region Component Lifecycle Events
173
192
  disconnectedCallback() {
174
193
  this.removeViewportListeners();
194
+ this.containerElement.removeEventListener("toggle", this.handlePopoverToggleEvent);
175
195
  this.containerElement = null;
176
196
  this.contentElement = null;
177
197
  this.controlElement = null;
178
- this.rootElementRect = null;
198
+ }
199
+ componentWillLoad() {
200
+ if (!this.supportsPopoverAPI) {
201
+ 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.");
202
+ this.mode = "legacy";
203
+ }
179
204
  }
180
205
  componentDidLoad() {
181
206
  this.handleMinHeight();
207
+ if (this.supportsPopoverAPI) this.containerElement.addEventListener("toggle", this.handlePopoverToggleEvent);
182
208
  if (this.open) this.determinePopDirection();
183
209
  }
184
210
  // #endregion
@@ -203,7 +229,6 @@ const h = class {
203
229
  this.handleMinHeight();
204
230
  }
205
231
  async openChanged(t) {
206
- this.setRootElement();
207
232
  this.popoverStateChanged.emit({
208
233
  open: t
209
234
  });
@@ -213,7 +238,11 @@ const h = class {
213
238
  } else {
214
239
  this.removeViewportListeners();
215
240
  this.currentDirection = undefined;
216
- this.show = false;
241
+ if (this.mode === "legacy" || !this.supportsPopoverAPI) {
242
+ this.show = false;
243
+ } else {
244
+ this.containerElement.hidePopover();
245
+ }
217
246
  await r();
218
247
  this.clearCSSProperties();
219
248
  }
@@ -237,6 +266,9 @@ const h = class {
237
266
  return undefined;
238
267
  }
239
268
  }
269
+ get supportsPopoverAPI() {
270
+ return Object.hasOwn(HTMLElement.prototype, "popover");
271
+ }
240
272
  get validatedMaxHeight() {
241
273
  const {maxHeight: t} = this;
242
274
  return isNaN(t) ? undefined : t;
@@ -244,15 +276,16 @@ const h = class {
244
276
  addViewportListeners() {
245
277
  var t;
246
278
  window.addEventListener("resize", this.viewPortOrientationChanged);
247
- // #region remove when Popover API is supported in iOS
248
- window.addEventListener("scroll", this.viewPortChanged, {
249
- passive: true,
250
- capture: true
251
- });
279
+ visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.addEventListener("resize", this.viewPortChanged);
280
+ if (n(this.hostElement) && !p()) {
281
+ window.addEventListener("scroll", this.viewPortChanged, {
282
+ passive: true,
283
+ capture: true
284
+ });
285
+ }
252
286
  (t = screen === null || screen === void 0 ? void 0 : screen.orientation) === null || t === void 0 ? void 0 : t.addEventListener("orientationchange", this.viewPortOrientationChanged);
253
287
  window.addEventListener("orientationchange", this.viewPortOrientationChanged);
254
- // #endregion
255
- }
288
+ }
256
289
  clearCSSProperties() {
257
290
  this.containerElement.style.removeProperty("--comp-pop-max-height");
258
291
  this.containerElement.style.removeProperty("--comp-pop-top");
@@ -264,39 +297,42 @@ const h = class {
264
297
  }
265
298
  async determinePopDirection() {
266
299
  var t, o, i;
267
- const {containerElement: e, controlElement: s, providedDirection: n, displayBuffer: a} = this;
300
+ const {containerElement: e, controlElement: s, providedDirection: n, displayBuffer: p} = this;
268
301
  if (e) e.style.maxHeight = null;
269
302
  await r();
270
- const {isModule: c} = this;
271
- const {top: h, bottom: p} = (o = (t = s === null || s === void 0 ? void 0 : s.getBoundingClientRect) === null || t === void 0 ? void 0 : t.call(s)) !== null && o !== void 0 ? o : {
303
+ const {isModule: a} = this;
304
+ const {top: c, bottom: h} = (o = (t = s === null || s === void 0 ? void 0 : s.getBoundingClientRect) === null || t === void 0 ? void 0 : t.call(s)) !== null && o !== void 0 ? o : {
272
305
  top: 0,
273
306
  bottom: 0
274
307
  };
275
308
  let l;
276
309
  let d;
277
310
  let u;
278
- if (c) {
279
- const {outletOffset: t = 0, innerHeight: o = window.innerHeight} = ((i = window.Tecton) === null || i === void 0 ? void 0 : i.platformDimensions) || {};
280
- const e = window.visualViewport.height - p;
281
- const s = o - (t + p);
282
- const r = e < s;
283
- l = o;
284
- // If the top of the module is below the top of the window we just use the controlTop
285
- // Otherwise we need to add the outletOffset to the controlTop
286
- d = (t > 0 ? h : h + t) - a;
287
- u = r ? e - a : s - a;
311
+ if (a) {
312
+ const {outletOffset: t = 0, innerHeight: o = window.innerHeight, top: e = 0, bottom: s = 0} = ((i = window.Tecton) === null || i === void 0 ? void 0 : i.platformDimensions) || {};
313
+ const r = window.innerHeight - h;
314
+ // controlElement position visually on the page
315
+ const n = t > 0 ? c : c + t - e;
316
+ const a = t + h - e;
317
+ // visual space around the controlElement
318
+ const l = n;
319
+ const v = o - s - a;
320
+ // calculate space above and below controlElement
321
+ const w = r < v;
322
+ d = l - p;
323
+ u = w ? r - p : v - p;
288
324
  } else {
289
- l = window.visualViewport.height;
290
- d = h - a;
291
- u = l - p - a;
325
+ l = window.innerHeight;
326
+ d = c - p;
327
+ u = l - h - p;
292
328
  }
293
- const f = d > u ? "up" : "down";
329
+ const v = d > u ? "up" : "down";
294
330
  // We do not want to update the max height once the popover is open unless the page orientation shifts (resize or mobile use cases)
295
331
  const w = !e.style.getPropertyValue("--comp-pop-max-height") || this.orientationChanged;
296
332
  // we do not want to constantly update the max-height after an orientation change, so we switch this back to false
297
333
  this.orientationChanged = false;
298
- const m = this.currentDirection || n || f;
299
- switch (m) {
334
+ const f = this.currentDirection || n || v;
335
+ switch (f) {
300
336
  case "up":
301
337
  if (w) {
302
338
  const t = this.validatedMaxHeight || d;
@@ -319,72 +355,47 @@ const h = class {
319
355
  removeViewportListeners() {
320
356
  var t;
321
357
  window.removeEventListener("resize", this.viewPortOrientationChanged);
322
- // #region remove when Popover API is supported in iOS
323
- window.removeEventListener("scroll", this.viewPortChanged, {
358
+ visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.removeEventListener("resize", this.viewPortChanged);
359
+ window.removeEventListener("scroll", this.viewPortChanged, {
324
360
  capture: true
325
361
  });
326
362
  (t = screen === null || screen === void 0 ? void 0 : screen.orientation) === null || t === void 0 ? void 0 : t.removeEventListener("orientationchange", this.viewPortOrientationChanged);
327
363
  window.removeEventListener("orientationchange", this.viewPortOrientationChanged);
328
- // #endregion
329
- }
364
+ }
330
365
  setDirectionAndShow(t) {
331
- this.setRootElement();
332
366
  // Due to some runtime inconsistency across devices/browsers we need to add one more check here because the
333
367
  // popover can be closed between the time the popover is opened and the time the direction is determined
334
- const o = this.open;
368
+ const o = this.open;
335
369
  if (!o) return;
336
370
  this.currentDirection = t;
337
- this.show = true;
338
- if (this.mode === "legacy") {
371
+ if (this.mode === "legacy" || !this.supportsPopoverAPI) {
372
+ this.show = true;
339
373
  this.setAbsoluteCSSProperties();
340
374
  } else {
341
- this.setFixedCSSProperties();
342
- }
343
- }
344
- setRootElement() {
345
- let t = this.hostElement;
346
- while (t && t !== document.documentElement) {
347
- const o = window.getComputedStyle(t);
348
- // Check if the element has any styles applied that create a new containg block
349
- if (o.transform !== "none" || o.filter !== "none" || o.perspective !== "none" || o.containerType !== "normal" || [ "transform", "perspective", "filter" ].includes(o.willChange) || [ "layout", "paint", "strict", "content" ].includes(o.contain)) {
350
- this.rootElementRect = t.getBoundingClientRect();
351
- return;
352
- }
353
- const i = t.getRootNode();
354
- const e = typeof ShadowRoot !== "undefined" && i instanceof ShadowRoot && i.host instanceof HTMLElement;
355
- if (e) {
356
- t = i.host;
357
- } else {
358
- t = t.parentElement;
359
- }
375
+ this.setPopoverAPICSSProperties();
376
+ this.containerElement.showPopover();
360
377
  }
361
- // Return the document's bounding rect if no element is found
362
- this.rootElementRect = {
363
- top: 0,
364
- bottom: 0,
365
- left: 0,
366
- right: 0,
367
- height: window.visualViewport.height,
368
- width: window.visualViewport.width
369
- };
370
378
  }
371
379
  // #endregion
372
380
  // #region Render Methods
373
381
  render() {
374
- const t = [ "container", this.currentDirection ];
382
+ const t = [ "container", this.currentDirection, this.align ];
375
383
  if (this.show) t.push("show");
384
+ if (this.block) t.push("block");
376
385
  if (this.mode === "legacy") t.push("legacy");
377
386
  return e("div", {
378
- key: "5669de4447eb2f2d28aced78c45310244100d0e4",
387
+ key: "4cd26a6c090a6fb5b56d2fa6464143f74998c215",
379
388
  ref: t => this.containerElement = t,
380
389
  class: t.join(" "),
381
- "test-id": "outerContainer"
390
+ "test-id": "outerContainer",
391
+ tabIndex: -1,
392
+ popover: "manual"
382
393
  }, e("div", {
383
- key: "6602ee2fd04336a7857b23b75bd47df228e8592c",
394
+ key: "545c376ca96c14e129a8f60fadac3a3264b916cf",
384
395
  ref: t => this.contentElement = t,
385
396
  class: "content"
386
397
  }, e("slot", {
387
- key: "3fe9913b64d11e3a540fae64c214c4fb0a802ad1"
398
+ key: "9a2824ab9023f34a2b3a56a76ace4df6a91b5ec6"
388
399
  })));
389
400
  }
390
401
  get hostElement() {
@@ -398,7 +409,7 @@ const h = class {
398
409
  }
399
410
  };
400
411
 
401
- h.style = c;
412
+ l.style = h;
402
413
 
403
- export { n as click_elsewhere, h as q2_popover };
414
+ export { a as click_elsewhere, l as q2_popover };
404
415
  //# sourceMappingURL=click-elsewhere_2.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ClickElsewhere","constructor","hostRef","this","isCurrentlyFocused","mouseEventList","mouseHandler","event","shadowContains","findActiveElement","aboutToBeFocused","shadowEventTarget","originatesInSlots","target","change","emit","windowBlurHandler","connectedCallback","forEach","eventName","document","addEventListener","window","disconnectedCallback","removeEventListener","componentWillLoad","workingElement","activeElement","shadowRoot","slots","hostElement","querySelectorAll","currentSlot","Array","from","lightNodes","assignedNodes","childNodes","currentNode","contains","child","parentNode","host","composedPath","q2PopoverCss","Q2PopoverStyle0","Q2Popover","displayBuffer","orientationChanged","handleMinHeight","minHeight","handleDeprecationWarning","setAbsoluteCSSProperties","async","controlElement","containerElement","currentDirection","align","style","setProperty","block","controlStyle","getComputedStyle","controlSize","parseInt","height","borderTopWidth","borderBottomWidth","waitForNextPaint","setFixedCSSProperties","rootElementRect","top","controlTop","bottom","controlBottom","left","controlLeft","right","controlRight","_b","_a","getBoundingClientRect","call","popoverLeft","offsetWidth","width","viewPortChanged","open","determinePopDirection","viewPortOrientationChanged","undefined","removeViewportListeners","contentElement","componentDidLoad","popoverStateHandler","detail","stopPropagation","scrollContainerTo","options","scrollTo","toggle","minHeightProvided","openChanged","setRootElement","popoverStateChanged","addViewportListeners","show","clearCSSProperties","isModule","isIframe","hasPlatformDimensions","Object","keys","Tecton","platformDimensions","length","providedDirection","direction","validatedMaxHeight","maxHeight","isNaN","passive","capture","screen","orientation","removeProperty","windowHeight","maxSpaceAbove","maxSpaceBelow","outletOffset","innerHeight","_c","distanceToIframeBottom","visualViewport","viewableSpaceBelow","isIframeShorterThanWindow","directionWithMostSpace","shouldUpdateMaxHeight","getPropertyValue","currentOrDetermineDirection","priorityMaxHeight","Math","min","setDirectionAndShow","isOpen","mode","currentElement","documentElement","computedStyle","transform","filter","perspective","containerType","includes","willChange","contain","rootNode","getRootNode","isRootNodeWebComponent","ShadowRoot","HTMLElement","parentElement","render","containerClasses","push","h","key","ref","el","class","join"],"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('orientationchange', 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('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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cE,WAAW,UACzBF,EAAcG,gBAAgB,UAC9BH,EAAcI,kBAAkB,YAChC,EAAC,aAAa,eAAe,WAAUC,SAASL,EAAcM,eAC9D,EAAC,UAAU,SAAS,UAAU,YAAWD,SAASL,EAAcO,UAClE;QACExJ,KAAKmE,kBAAkB4E,EAAejE;QACtC;;MAGJ,MAAM2E,IAAWV,EAAeW;MAChC,MAAMC,WACKC,eAAe,eACtBH,aAAoBG,cACpBH,EAASlH,gBAAgBsH;MAC7B,IAAIF,GAAwB;QACxBZ,IAAiBU,EAASlH;aACvB;QACHwG,IAAiBA,EAAee;;;;QAKxC9J,KAAKmE,kBAAkB;MACnBC,KAAK;MACLE,QAAQ;MACRE,MAAM;MACNE,OAAO;MACPZ,QAAQ3C,OAAO+G,eAAepE;MAC9BoB,OAAO/D,OAAO+G,eAAehD;;;;;EAiBrC,MAAA6E;IACI,MAAMC,IAAmB,EAAC,aAAahK,KAAKqD;IAC5C,IAAIrD,KAAKuG,MAAMyD,EAAiBC,KAAK;IACrC,IAAIjK,KAAK8I,SAAS,UAAUkB,EAAiBC,KAAK;IAElD,OACIC,EAAA;MAAAC,KAAA;MACIC,KAAKC,KAAOrK,KAAKoD,mBAAmBiH;MACpCC,OAAON,EAAiBO,KAAK;MAAI,WACzB;OAERL,EAAA;MAAAC,KAAA;MACIC,KAAKC,KAAOrK,KAAKyF,iBAAiB4E;MAClCC,OAAM;OAENJ,EAAA;MAAAC,KAAA"}
1
+ {"version":3,"names":["ClickElsewhere","constructor","hostRef","this","isCurrentlyFocused","mouseEventList","mouseHandler","event","shadowContains","findActiveElement","aboutToBeFocused","shadowEventTarget","originatesInSlots","target","change","emit","windowBlurHandler","connectedCallback","forEach","eventName","document","addEventListener","window","disconnectedCallback","removeEventListener","componentWillLoad","workingElement","activeElement","shadowRoot","slots","hostElement","querySelectorAll","currentSlot","Array","from","lightNodes","assignedNodes","childNodes","currentNode","contains","child","parentNode","host","composedPath","q2PopoverCss","Q2PopoverStyle0","Q2Popover","displayBuffer","orientationChanged","handleMinHeight","minHeight","handleDeprecationWarning","handlePopoverToggleEvent","popoverStateChanged","open","newState","setAbsoluteCSSProperties","async","controlElement","containerElement","currentDirection","align","style","setProperty","block","controlStyle","getComputedStyle","controlSize","parseInt","height","borderTopWidth","borderBottomWidth","waitForNextPaint","setPopoverAPICSSProperties","isModule","top","controlTop","bottom","controlBottom","left","controlLeft","right","controlRight","_b","_a","getBoundingClientRect","call","popoverLeft","popoverRight","_c","visualViewport","width","scrollX","offsetWidth","innerHeight","scrollY","viewPortChanged","determinePopDirection","viewPortOrientationChanged","undefined","removeViewportListeners","contentElement","supportsPopoverAPI","console","warn","mode","componentDidLoad","popoverStateHandler","detail","stopPropagation","scrollContainerTo","options","scrollTo","toggle","minHeightProvided","openChanged","addViewportListeners","show","hidePopover","clearCSSProperties","isIframe","hasPlatformDimensions","Object","keys","Tecton","platformDimensions","length","providedDirection","direction","hasOwn","HTMLElement","prototype","validatedMaxHeight","maxHeight","isNaN","isInScrollableContainer","isMobile","passive","capture","screen","orientation","removeProperty","windowHeight","maxSpaceAbove","maxSpaceBelow","outletOffset","topBarHeight","bottomBarHeight","distanceToIframeBottom","visualControlTop","visualControlBottom","viewableSpaceAbove","viewableSpaceBelow","isIframeShorterThanWindow","directionWithMostSpace","shouldUpdateMaxHeight","getPropertyValue","currentOrDetermineDirection","priorityMaxHeight","Math","min","setDirectionAndShow","isOpen","showPopover","render","containerClasses","push","h","key","ref","el","class","join","tabIndex","popover"],"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 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 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 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 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"],"mappings":";;;;MAMaA,IAAc;EAJ3B,WAAAC,CAAAC;;;;QAOIC,KAAAC,qBAA8B;;;eAI9BD,KAAAE,iBAA2B,EAAC,aAAa,aAAa;IAqDtDF,KAAAG,eAAgBC;MACZ,MAAMH,IAAqBD,KAAKK,eAAeL,KAAKM;MACpD,MAAMC,IACFP,KAAKK,eAAeL,KAAKQ,kBAAkBJ,OAAWJ,KAAKS,kBAAkBL,EAAMM;MAEvF,KAAKH,MAAqBP,KAAKC,sBAAsBA,IAAqB;QACtED,KAAKC,qBAAqB;QAC1BD,KAAKW,OAAOC;QACZ;;MAEJZ,KAAKC,qBAAqBM,KAAoBN;AAAkB;IAuCpED,KAAAa,oBAAoB;MAChBb,KAAKC,qBAAqB;MAC1BD,KAAKW,OAAOC;AAAM;;;;;EAlFtB,iBAAAE;IACId,KAAKE,eAAea,SAASC;MACzBC,SAASC,iB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D,WAAA,aAAAA,EAAE5D,oBAAoB,qBAAqBrB,KAAK+F;IACnE5E,OAAOE,oBAAoB,qBAAqBrB,KAAK+F;;EAiCzD,mBAAA+D,CAAoBjC;;;IAGhB,MAAMkC,IAAS/J,KAAKmD;IACpB,KAAK4G,GAAQ;IAEb/J,KAAKyD,mBAAmBoE;IACxB,IAAI7H,KAAKsG,SAAS,aAAatG,KAAKmG,oBAAoB;MACpDnG,KAAKkH,OAAO;MACZlH,KAAKqD;WACF;MACHrD,KAAKsE;MACLtE,KAAKwD,iBAAiBwG;;;;;EAoE9B,MAAAC;IACI,MAAMC,IAAmB,EAAC,aAAalK,KAAKyD,kBAAkBzD,KAAK0D;IACnE,IAAI1D,KAAKkH,MAAMgD,EAAiBC,KAAK;IACrC,IAAInK,KAAK6D,OAAOqG,EAAiBC,KAAK;IACtC,IAAInK,KAAKsG,SAAS,UAAU4D,EAAiBC,KAAK;IAElD,OACIC,EAAA;MAAAC,KAAA;MACIC,KAAKC,KAAOvK,KAAKwD,mBAAmB+G;MACpCC,OAAON,EAAiBO,KAAK;MAAI,WACzB;MACRC,WAAW;MACXC,SAAQ;OAERP,EAAA;MAAAC,KAAA;MACIC,KAAKC,KAAOvK,KAAKkG,iBAAiBqE;MAClCC,OAAM;OAENJ,EAAA;MAAAC,KAAA"}
@@ -14,22 +14,29 @@ function isMobile() {
14
14
  return /Android|webOS|iPhone|iPad|iPod|BlackBerry|Mobile|IEMobile|Windows Phone|Opera Mini/i.test(navigator.userAgent);
15
15
  }
16
16
 
17
- function isHostLosingFocus(e, n) {
18
- const o = e.type;
19
- const i = [ "focusin", "focus" ];
20
- const t = i.includes(o);
21
- // on focusin: `target` is element losing focus, `relatedTarget` is element gaining focus
22
- // on focusout: `target` is element gaining focus, `relatedTarget` is element losing focus
23
- const a = t ? e.target : e.relatedTarget;
24
- const isElementNestedInHostElement = e => {
25
- if (e === n) return true;
26
- if (e.parentElement) {
27
- return isElementNestedInHostElement(e.parentElement);
17
+ function isInScrollableContainer(e) {
18
+ let n = e;
19
+ while (n && n !== document.body && n !== document.documentElement) {
20
+ // Move to parent
21
+ if (n.parentElement) {
22
+ n = n.parentElement;
23
+ } else {
24
+ // Try to cross shadow DOM boundary
25
+ const e = n.getRootNode();
26
+ if (e && e.host) {
27
+ n = e.host;
28
+ } else {
29
+ break;
30
+ }
28
31
  }
29
- return false;
30
- };
31
- if (!(a instanceof HTMLElement)) return true;
32
- return !isElementNestedInHostElement(a);
32
+ const e = window.getComputedStyle(n);
33
+ const o = e.overflow === "scroll" || e.overflow === "auto" || e.overflowX === "scroll" || e.overflowX === "auto" || e.overflowY === "scroll" || e.overflowY === "auto";
34
+ const i = n.scrollHeight > n.clientHeight || n.scrollWidth > n.clientWidth;
35
+ if (o && i) {
36
+ return true;
37
+ }
38
+ }
39
+ return false;
33
40
  }
34
41
 
35
42
  function isRelatedTargetWithinHost(e, n) {
@@ -319,5 +326,5 @@ const handleColor = e => {
319
326
  return a;
320
327
  };
321
328
 
322
- export { handleAriaLabel as a, handleColor as b, createGuid as c, isMobile as d, hasSlotContent as e, renderLabel as f, getAriaValueFromProp as g, handleDeprecationWarning as h, isEventFromElement as i, handleRenamedProp as j, isTouchDevice as k, loc as l, resizeIframe as m, nextPaint as n, overrideFocus as o, debounce as p, isRelatedTargetWithinHost as q, renderMessages as r, setMessageHeight as s, isHostLosingFocus as t, isFirefox as u, getAllText as v, waitForNextPaint as w, isVisible as x };
323
- //# sourceMappingURL=index-d18e2a20.js.map
329
+ export { handleAriaLabel as a, handleColor as b, createGuid as c, isMobile as d, hasSlotContent as e, renderLabel as f, getAriaValueFromProp as g, handleDeprecationWarning as h, isEventFromElement as i, handleRenamedProp as j, isTouchDevice as k, loc as l, resizeIframe as m, nextPaint as n, overrideFocus as o, debounce as p, isRelatedTargetWithinHost as q, renderMessages as r, setMessageHeight as s, isFirefox as t, getAllText as u, isVisible as v, waitForNextPaint as w, isInScrollableContainer as x };
330
+ //# sourceMappingURL=index-99c46474.js.map