q2-tecton-elements 1.48.1-alpha.0 → 1.48.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (409) hide show
  1. package/dist/cjs/click-elsewhere_2.cjs.entry.js +82 -74
  2. package/dist/cjs/click-elsewhere_2.cjs.entry.js.map +1 -1
  3. package/dist/cjs/{index-a93362ed.js → index-3f1498f7.js} +33 -1
  4. package/dist/cjs/index-3f1498f7.js.map +1 -0
  5. package/dist/cjs/{index-c9a86a33.js → index-f69742cf.js} +1 -1
  6. package/dist/cjs/{index-c9a86a33.js.map → index-f69742cf.js.map} +1 -1
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/q2-action-sheet.cjs.entry.js +2 -2
  9. package/dist/cjs/q2-avatar.cjs.entry.js +1 -1
  10. package/dist/cjs/q2-btn_2.cjs.entry.js +1 -1
  11. package/dist/cjs/q2-calendar.cjs.entry.js +4 -4
  12. package/dist/cjs/q2-calendar.cjs.entry.js.map +1 -1
  13. package/dist/cjs/q2-card.cjs.entry.js +1 -1
  14. package/dist/cjs/q2-carousel-pane.cjs.entry.js +3 -3
  15. package/dist/cjs/q2-carousel.cjs.entry.js +2 -2
  16. package/dist/cjs/q2-chart-area.cjs.entry.js +2 -2
  17. package/dist/cjs/q2-chart-bar.cjs.entry.js +2 -2
  18. package/dist/cjs/q2-chart-donut.cjs.entry.js +2 -2
  19. package/dist/cjs/q2-checkbox-group.cjs.entry.js +3 -3
  20. package/dist/cjs/q2-checkbox-group.cjs.entry.js.map +1 -1
  21. package/dist/cjs/q2-checkbox.cjs.entry.js +3 -3
  22. package/dist/cjs/q2-checkbox.cjs.entry.js.map +1 -1
  23. package/dist/cjs/q2-currency.cjs.entry.js +1 -1
  24. package/dist/cjs/q2-data-table.cjs.entry.js +2 -2
  25. package/dist/cjs/q2-detail.cjs.entry.js +2 -2
  26. package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
  27. package/dist/cjs/q2-dropdown.cjs.entry.js +4 -2
  28. package/dist/cjs/q2-dropdown.cjs.entry.js.map +1 -1
  29. package/dist/cjs/q2-editable-field.cjs.entry.js +2 -2
  30. package/dist/cjs/q2-icon.cjs.entry.js +1 -1
  31. package/dist/cjs/q2-input.cjs.entry.js +3 -3
  32. package/dist/cjs/q2-input.cjs.entry.js.map +1 -1
  33. package/dist/cjs/q2-item.cjs.entry.js +2 -2
  34. package/dist/cjs/q2-legend.cjs.entry.js +1 -1
  35. package/dist/cjs/q2-list.cjs.entry.js +2 -2
  36. package/dist/cjs/q2-loc.cjs.entry.js +2 -2
  37. package/dist/cjs/q2-message.cjs.entry.js +2 -2
  38. package/dist/cjs/q2-month-picker.cjs.entry.js +3 -3
  39. package/dist/cjs/q2-optgroup.cjs.entry.js +2 -2
  40. package/dist/cjs/q2-option-list.cjs.entry.js +2 -2
  41. package/dist/cjs/q2-option.cjs.entry.js +1 -1
  42. package/dist/cjs/q2-pagination.cjs.entry.js +3 -3
  43. package/dist/cjs/q2-pill.cjs.entry.js +2 -2
  44. package/dist/cjs/q2-radio-group.cjs.entry.js +3 -3
  45. package/dist/cjs/q2-radio-group.cjs.entry.js.map +1 -1
  46. package/dist/cjs/q2-radio.cjs.entry.js +2 -2
  47. package/dist/cjs/q2-relative-time.cjs.entry.js +3 -3
  48. package/dist/cjs/q2-section.cjs.entry.js +3 -3
  49. package/dist/cjs/q2-select.cjs.entry.js +102 -10
  50. package/dist/cjs/q2-select.cjs.entry.js.map +1 -1
  51. package/dist/cjs/q2-stepper-pane.cjs.entry.js +2 -2
  52. package/dist/cjs/q2-stepper-vertical.cjs.entry.js +2 -2
  53. package/dist/cjs/q2-stepper.cjs.entry.js +2 -2
  54. package/dist/cjs/q2-tab-container.cjs.entry.js +2 -2
  55. package/dist/cjs/q2-tab-pane.cjs.entry.js +1 -1
  56. package/dist/cjs/q2-tag.cjs.entry.js +2 -2
  57. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  58. package/dist/cjs/q2-textarea.cjs.entry.js +3 -3
  59. package/dist/cjs/q2-textarea.cjs.entry.js.map +1 -1
  60. package/dist/cjs/q2-tooltip.cjs.entry.js +1 -1
  61. package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -2
  62. package/dist/collection/collection-manifest.json +5 -6
  63. package/dist/collection/components/q2-action-sheet/q2-action-sheet.js +1 -1
  64. package/dist/collection/components/q2-avatar/q2-avatar.js +1 -1
  65. package/dist/collection/components/q2-calendar/q2-calendar.css +0 -2
  66. package/dist/collection/components/q2-calendar/q2-calendar.js +1 -1
  67. package/dist/collection/components/q2-calendar/q2-month-picker.js +2 -2
  68. package/dist/collection/components/q2-carousel/q2-carousel.js +1 -1
  69. package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js +2 -2
  70. package/dist/collection/components/q2-chart-area/q2-chart-area.js +1 -1
  71. package/dist/collection/components/q2-chart-bar/q2-chart-bar.js +1 -1
  72. package/dist/collection/components/q2-chart-donut/q2-chart-donut.js +1 -1
  73. package/dist/collection/components/q2-checkbox/q2-checkbox.css +0 -2
  74. package/dist/collection/components/q2-checkbox/q2-checkbox.js +1 -1
  75. package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.css +1 -7
  76. package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.js +1 -1
  77. package/dist/collection/components/q2-currency/q2-currency.js +1 -1
  78. package/dist/collection/components/q2-data-table/q2-data-table.js +7 -7
  79. package/dist/collection/components/q2-detail/q2-detail.js +1 -1
  80. package/dist/collection/components/q2-dropdown/q2-dropdown.js +3 -1
  81. package/dist/collection/components/q2-dropdown/q2-dropdown.js.map +1 -1
  82. package/dist/collection/components/q2-editable-field/q2-editable-field.js +1 -1
  83. package/dist/collection/components/q2-input/q2-input.css +1 -1
  84. package/dist/collection/components/q2-input/q2-input.js +2 -2
  85. package/dist/collection/components/q2-item/q2-item.js +1 -1
  86. package/dist/collection/components/q2-legend/q2-legend.js +1 -1
  87. package/dist/collection/components/q2-list/q2-list.js +1 -1
  88. package/dist/collection/components/q2-loc/q2-loc.js +1 -1
  89. package/dist/collection/components/q2-message/q2-message.js +1 -1
  90. package/dist/collection/components/q2-optgroup/q2-optgroup.js +1 -1
  91. package/dist/collection/components/q2-option/q2-option.js +1 -1
  92. package/dist/collection/components/q2-option-list/q2-option-list.js +4 -4
  93. package/dist/collection/components/q2-pagination/q2-pagination.js +2 -2
  94. package/dist/collection/components/q2-pill/q2-pill.js +1 -1
  95. package/dist/collection/components/q2-popover/q2-popover.css +19 -11
  96. package/dist/collection/components/q2-popover/q2-popover.js +83 -74
  97. package/dist/collection/components/q2-popover/q2-popover.js.map +1 -1
  98. package/dist/collection/components/q2-radio/q2-radio.js +1 -1
  99. package/dist/collection/components/q2-radio-group/q2-radio-group.css +2 -4
  100. package/dist/collection/components/q2-radio-group/q2-radio-group.js +1 -1
  101. package/dist/collection/components/q2-relative-time/q2-relative-time.js +1 -1
  102. package/dist/collection/components/q2-section/q2-section.js +2 -2
  103. package/dist/collection/components/q2-select/q2-select.css +2 -2
  104. package/dist/collection/components/q2-select/q2-select.js +109 -10
  105. package/dist/collection/components/q2-select/q2-select.js.map +1 -1
  106. package/dist/collection/components/q2-stepper/q2-stepper.js +1 -1
  107. package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js +3 -3
  108. package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js +1 -1
  109. package/dist/collection/components/q2-tab-container/q2-tab-container.js +1 -1
  110. package/dist/collection/components/q2-tab-pane/q2-tab-pane.js +1 -1
  111. package/dist/collection/components/q2-tag/q2-tag.js +1 -1
  112. package/dist/collection/components/q2-textarea/q2-textarea.css +2 -2
  113. package/dist/collection/components/q2-textarea/q2-textarea.js +1 -1
  114. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +2 -2
  115. package/dist/collection/utils/index.js +31 -0
  116. package/dist/collection/utils/index.js.map +1 -1
  117. package/dist/components/index.js +0 -2
  118. package/dist/components/index.js.map +1 -1
  119. package/dist/components/index2.js +32 -1
  120. package/dist/components/index2.js.map +1 -1
  121. package/dist/components/q2-action-sheet.js +1 -1
  122. package/dist/components/q2-avatar2.js +1 -1
  123. package/dist/components/q2-calendar.js +2 -2
  124. package/dist/components/q2-calendar.js.map +1 -1
  125. package/dist/components/q2-carousel-pane.js +2 -2
  126. package/dist/components/q2-carousel.js +1 -1
  127. package/dist/components/q2-chart-area.js +1 -1
  128. package/dist/components/q2-chart-bar.js +1 -1
  129. package/dist/components/q2-chart-donut.js +1 -1
  130. package/dist/components/q2-checkbox-group.js +2 -2
  131. package/dist/components/q2-checkbox-group.js.map +1 -1
  132. package/dist/components/q2-checkbox2.js +2 -2
  133. package/dist/components/q2-checkbox2.js.map +1 -1
  134. package/dist/components/q2-currency.js +1 -1
  135. package/dist/components/q2-data-table.js +1 -1
  136. package/dist/components/q2-detail.js +1 -1
  137. package/dist/components/q2-dropdown.js +3 -1
  138. package/dist/components/q2-dropdown.js.map +1 -1
  139. package/dist/components/q2-editable-field.js +1 -1
  140. package/dist/components/q2-input2.js +2 -2
  141. package/dist/components/q2-input2.js.map +1 -1
  142. package/dist/components/q2-item.js +1 -1
  143. package/dist/components/q2-legend2.js +1 -1
  144. package/dist/components/q2-list.js +1 -1
  145. package/dist/components/q2-loc.js +1 -1
  146. package/dist/components/q2-message2.js +1 -1
  147. package/dist/components/q2-month-picker.js +2 -2
  148. package/dist/components/q2-optgroup2.js +1 -1
  149. package/dist/components/q2-option-list2.js +1 -1
  150. package/dist/components/q2-option2.js +1 -1
  151. package/dist/components/q2-pagination.js +2 -2
  152. package/dist/components/q2-pill.js +1 -1
  153. package/dist/components/q2-popover2.js +82 -74
  154. package/dist/components/q2-popover2.js.map +1 -1
  155. package/dist/components/q2-radio-group.js +2 -2
  156. package/dist/components/q2-radio-group.js.map +1 -1
  157. package/dist/components/q2-radio.js +1 -1
  158. package/dist/components/q2-relative-time.js +1 -1
  159. package/dist/components/q2-section.js +2 -2
  160. package/dist/components/q2-select2.js +103 -11
  161. package/dist/components/q2-select2.js.map +1 -1
  162. package/dist/components/q2-stepper-pane.js +1 -1
  163. package/dist/components/q2-stepper-vertical.js +1 -1
  164. package/dist/components/q2-stepper.js +1 -1
  165. package/dist/components/q2-tab-container.js +1 -1
  166. package/dist/components/q2-tab-pane.js +1 -1
  167. package/dist/components/q2-tag.js +1 -1
  168. package/dist/components/q2-textarea.js +2 -2
  169. package/dist/components/q2-textarea.js.map +1 -1
  170. package/dist/components/tecton-tab-pane.js +2 -2
  171. package/dist/esm/click-elsewhere_2.entry.js +82 -74
  172. package/dist/esm/click-elsewhere_2.entry.js.map +1 -1
  173. package/dist/esm/{index-8582f46d.js → index-3184c760.js} +1 -1
  174. package/dist/esm/{index-8582f46d.js.map → index-3184c760.js.map} +1 -1
  175. package/dist/esm/{index-3c5cd75e.js → index-58266aeb.js} +33 -2
  176. package/dist/esm/index-58266aeb.js.map +1 -0
  177. package/dist/esm/loader.js +1 -1
  178. package/dist/esm/q2-action-sheet.entry.js +2 -2
  179. package/dist/esm/q2-avatar.entry.js +1 -1
  180. package/dist/esm/q2-btn_2.entry.js +1 -1
  181. package/dist/esm/q2-calendar.entry.js +4 -4
  182. package/dist/esm/q2-calendar.entry.js.map +1 -1
  183. package/dist/esm/q2-card.entry.js +1 -1
  184. package/dist/esm/q2-carousel-pane.entry.js +3 -3
  185. package/dist/esm/q2-carousel.entry.js +2 -2
  186. package/dist/esm/q2-chart-area.entry.js +2 -2
  187. package/dist/esm/q2-chart-bar.entry.js +2 -2
  188. package/dist/esm/q2-chart-donut.entry.js +2 -2
  189. package/dist/esm/q2-checkbox-group.entry.js +3 -3
  190. package/dist/esm/q2-checkbox-group.entry.js.map +1 -1
  191. package/dist/esm/q2-checkbox.entry.js +3 -3
  192. package/dist/esm/q2-checkbox.entry.js.map +1 -1
  193. package/dist/esm/q2-currency.entry.js +1 -1
  194. package/dist/esm/q2-data-table.entry.js +2 -2
  195. package/dist/esm/q2-detail.entry.js +2 -2
  196. package/dist/esm/q2-dropdown-item.entry.js +1 -1
  197. package/dist/esm/q2-dropdown.entry.js +4 -2
  198. package/dist/esm/q2-dropdown.entry.js.map +1 -1
  199. package/dist/esm/q2-editable-field.entry.js +2 -2
  200. package/dist/esm/q2-icon.entry.js +1 -1
  201. package/dist/esm/q2-input.entry.js +3 -3
  202. package/dist/esm/q2-input.entry.js.map +1 -1
  203. package/dist/esm/q2-item.entry.js +2 -2
  204. package/dist/esm/q2-legend.entry.js +1 -1
  205. package/dist/esm/q2-list.entry.js +2 -2
  206. package/dist/esm/q2-loc.entry.js +2 -2
  207. package/dist/esm/q2-message.entry.js +2 -2
  208. package/dist/esm/q2-month-picker.entry.js +3 -3
  209. package/dist/esm/q2-optgroup.entry.js +2 -2
  210. package/dist/esm/q2-option-list.entry.js +2 -2
  211. package/dist/esm/q2-option.entry.js +1 -1
  212. package/dist/esm/q2-pagination.entry.js +3 -3
  213. package/dist/esm/q2-pill.entry.js +2 -2
  214. package/dist/esm/q2-radio-group.entry.js +3 -3
  215. package/dist/esm/q2-radio-group.entry.js.map +1 -1
  216. package/dist/esm/q2-radio.entry.js +2 -2
  217. package/dist/esm/q2-relative-time.entry.js +3 -3
  218. package/dist/esm/q2-section.entry.js +3 -3
  219. package/dist/esm/q2-select.entry.js +102 -10
  220. package/dist/esm/q2-select.entry.js.map +1 -1
  221. package/dist/esm/q2-stepper-pane.entry.js +2 -2
  222. package/dist/esm/q2-stepper-vertical.entry.js +2 -2
  223. package/dist/esm/q2-stepper.entry.js +2 -2
  224. package/dist/esm/q2-tab-container.entry.js +2 -2
  225. package/dist/esm/q2-tab-pane.entry.js +1 -1
  226. package/dist/esm/q2-tag.entry.js +2 -2
  227. package/dist/esm/q2-tecton-elements.js +1 -1
  228. package/dist/esm/q2-textarea.entry.js +3 -3
  229. package/dist/esm/q2-textarea.entry.js.map +1 -1
  230. package/dist/esm/q2-tooltip.entry.js +1 -1
  231. package/dist/esm/tecton-tab-pane.entry.js +2 -2
  232. package/dist/jest.setup.js +33 -0
  233. package/dist/jest.setup.js.map +1 -0
  234. package/dist/q2-tecton-elements/{p-3fe532bc.entry.js → p-05f5d0ab.entry.js} +2 -2
  235. package/dist/q2-tecton-elements/p-0f9d4d30.entry.js +2 -0
  236. package/dist/q2-tecton-elements/p-0f9d4d30.entry.js.map +1 -0
  237. package/dist/q2-tecton-elements/p-139926a3.entry.js +2 -0
  238. package/dist/q2-tecton-elements/p-139926a3.entry.js.map +1 -0
  239. package/dist/q2-tecton-elements/{p-fcffc029.entry.js → p-149044cd.entry.js} +2 -2
  240. package/dist/q2-tecton-elements/{p-400f6071.entry.js → p-2cbb1756.entry.js} +2 -2
  241. package/dist/q2-tecton-elements/{p-400f6071.entry.js.map → p-2cbb1756.entry.js.map} +1 -1
  242. package/dist/q2-tecton-elements/{p-2d6a9a94.entry.js → p-3468d85d.entry.js} +2 -2
  243. package/dist/q2-tecton-elements/p-3876d25b.entry.js +2 -0
  244. package/dist/q2-tecton-elements/p-3876d25b.entry.js.map +1 -0
  245. package/dist/q2-tecton-elements/{p-f57c4448.entry.js → p-3d6e350e.entry.js} +2 -2
  246. package/dist/q2-tecton-elements/{p-ced89010.entry.js → p-3dff9fb0.entry.js} +2 -2
  247. package/dist/q2-tecton-elements/p-414c5d4e.entry.js +2 -0
  248. package/dist/q2-tecton-elements/p-414c5d4e.entry.js.map +1 -0
  249. package/dist/q2-tecton-elements/{p-35cc1039.entry.js → p-48ecbcc9.entry.js} +2 -2
  250. package/dist/q2-tecton-elements/{p-861e83de.entry.js → p-4ce69e38.entry.js} +2 -2
  251. package/dist/q2-tecton-elements/p-4e58e187.entry.js +2 -0
  252. package/dist/q2-tecton-elements/p-4e58e187.entry.js.map +1 -0
  253. package/dist/q2-tecton-elements/{p-258f8c9c.entry.js → p-502af427.entry.js} +2 -2
  254. package/dist/q2-tecton-elements/{p-7cbb989e.entry.js → p-50476216.entry.js} +2 -2
  255. package/dist/q2-tecton-elements/{p-43236cac.entry.js → p-5234ced7.entry.js} +2 -2
  256. package/dist/q2-tecton-elements/{p-4008aceb.entry.js → p-5538d1df.entry.js} +2 -2
  257. package/dist/q2-tecton-elements/p-5d339d72.entry.js +2 -0
  258. package/dist/q2-tecton-elements/p-5d339d72.entry.js.map +1 -0
  259. package/dist/q2-tecton-elements/{p-4f7e6e79.entry.js → p-63f9a5e5.entry.js} +2 -2
  260. package/dist/q2-tecton-elements/{p-828850c1.entry.js → p-646214e2.entry.js} +2 -2
  261. package/dist/q2-tecton-elements/{p-30296b0e.entry.js → p-65e7dab0.entry.js} +2 -2
  262. package/dist/q2-tecton-elements/{p-d75e4752.entry.js → p-7c5ee4aa.entry.js} +2 -2
  263. package/dist/q2-tecton-elements/p-7ea95f38.js +2 -0
  264. package/dist/q2-tecton-elements/p-7ea95f38.js.map +1 -0
  265. package/dist/q2-tecton-elements/{p-9a5695db.entry.js → p-7fe8e174.entry.js} +2 -2
  266. package/dist/q2-tecton-elements/{p-3f665c56.entry.js → p-803a5897.entry.js} +2 -2
  267. package/dist/q2-tecton-elements/{p-d32f8e53.entry.js → p-871bad24.entry.js} +2 -2
  268. package/dist/q2-tecton-elements/{p-dfa489ba.entry.js → p-8764a131.entry.js} +2 -2
  269. package/dist/q2-tecton-elements/{p-bc73f69c.entry.js → p-8a2b4f10.entry.js} +2 -2
  270. package/dist/q2-tecton-elements/{p-30d70f4a.entry.js → p-97774780.entry.js} +2 -2
  271. package/dist/q2-tecton-elements/{p-81bb9436.entry.js → p-9c129294.entry.js} +2 -2
  272. package/dist/q2-tecton-elements/p-a99e1dc6.entry.js +2 -0
  273. package/dist/q2-tecton-elements/p-a99e1dc6.entry.js.map +1 -0
  274. package/dist/q2-tecton-elements/p-abf27f97.entry.js +2 -0
  275. package/dist/q2-tecton-elements/{p-4b47816d.entry.js.map → p-abf27f97.entry.js.map} +1 -1
  276. package/dist/q2-tecton-elements/{p-9b65cc28.entry.js → p-af3a383f.entry.js} +2 -2
  277. package/dist/q2-tecton-elements/{p-d35de465.entry.js → p-b85b6bc1.entry.js} +2 -2
  278. package/dist/q2-tecton-elements/{p-e793a82c.entry.js → p-b998e684.entry.js} +2 -2
  279. package/dist/q2-tecton-elements/{p-63038a54.entry.js → p-c30c53dc.entry.js} +2 -2
  280. package/dist/q2-tecton-elements/{p-76be9cad.entry.js → p-c37fff1e.entry.js} +2 -2
  281. package/dist/q2-tecton-elements/{p-32130845.entry.js → p-c782a1d6.entry.js} +2 -2
  282. package/dist/q2-tecton-elements/{p-49ecdf18.entry.js → p-cd225920.entry.js} +2 -2
  283. package/dist/q2-tecton-elements/{p-7dafc5da.entry.js → p-cdfe6e9d.entry.js} +2 -2
  284. package/dist/q2-tecton-elements/{p-75bb43b2.entry.js → p-d238dc6b.entry.js} +2 -2
  285. package/dist/q2-tecton-elements/{p-0d6edd2a.entry.js → p-d5776227.entry.js} +2 -2
  286. package/dist/q2-tecton-elements/{p-6e313705.entry.js → p-e08c6b8f.entry.js} +2 -2
  287. package/dist/q2-tecton-elements/{p-56dd051a.entry.js → p-e41f47bc.entry.js} +2 -2
  288. package/dist/q2-tecton-elements/{p-1b89b9c3.entry.js → p-e4241b1a.entry.js} +2 -2
  289. package/dist/q2-tecton-elements/{p-aed969d4.entry.js → p-e654d2d6.entry.js} +2 -2
  290. package/dist/q2-tecton-elements/{p-b6bcef6a.js → p-f1e887f5.js} +1 -1
  291. package/dist/q2-tecton-elements/{p-366a92d9.entry.js → p-ff39ba49.entry.js} +2 -2
  292. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  293. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js.map +1 -1
  294. package/dist/test/elements/q2-calendar-test.e2e.js +2 -2
  295. package/dist/test/elements/q2-calendar-test.e2e.js.map +1 -1
  296. package/dist/test/elements/q2-dropdown-test.e2e.js +2 -14
  297. package/dist/test/elements/q2-dropdown-test.e2e.js.map +1 -1
  298. package/dist/test/elements/q2-pagination-test.e2e.js +3 -2
  299. package/dist/test/elements/q2-pagination-test.e2e.js.map +1 -1
  300. package/dist/test/elements/q2-pill-test.e2e.js +1 -1
  301. package/dist/test/elements/q2-pill-test.e2e.js.map +1 -1
  302. package/dist/test/elements/q2-popover-test.e2e.js +1 -34
  303. package/dist/test/elements/q2-popover-test.e2e.js.map +1 -1
  304. package/dist/test/elements/q2-popover-test.spec.js +902 -511
  305. package/dist/test/elements/q2-popover-test.spec.js.map +1 -1
  306. package/dist/test/elements/q2-relative-time-test.e2e.js.map +1 -1
  307. package/dist/test/elements/q2-select-test.e2e.js +1 -1
  308. package/dist/test/elements/q2-select-test.e2e.js.map +1 -1
  309. package/dist/test/elements/q2-select-test.spec.js +552 -0
  310. package/dist/test/elements/q2-select-test.spec.js.map +1 -0
  311. package/dist/test/elements/q2-tag-test.e2e.js +1 -1
  312. package/dist/test/elements/q2-tag-test.e2e.js.map +1 -1
  313. package/dist/types/builds/q2e/development/tecton/tecton/packages/q2-tecton-elements/.stencil/jest.setup.d.ts +10 -0
  314. package/dist/types/components/q2-action-sheet/q2-action-sheet.d.ts +60 -0
  315. package/dist/types/components/q2-calendar/q2-calendar.d.ts +324 -0
  316. package/dist/types/components/q2-carousel/q2-carousel.d.ts +2 -2
  317. package/dist/types/components/q2-data-table/q2-data-table.d.ts +223 -0
  318. package/dist/types/components/q2-dropdown/q2-dropdown.d.ts +130 -0
  319. package/dist/types/components/q2-dropdown-item/q2-dropdown-item.d.ts +50 -0
  320. package/dist/types/components/q2-editable-field/q2-editable-field.d.ts +140 -0
  321. package/dist/types/components/q2-loading/skeleton/shapes.d.ts +1 -0
  322. package/dist/types/components/q2-optgroup/q2-optgroup.d.ts +1 -1
  323. package/dist/types/components/q2-option-list/q2-option-list.d.ts +99 -0
  324. package/dist/types/components/q2-pagination/q2-pagination.d.ts +60 -0
  325. package/dist/types/components/q2-pill/q2-pill.d.ts +102 -0
  326. package/dist/types/components/q2-popover/q2-popover.d.ts +5 -5
  327. package/dist/types/components/q2-select/q2-select.d.ts +243 -0
  328. package/dist/types/components/q2-stepper/q2-stepper.d.ts +52 -0
  329. package/dist/types/components/q2-stepper-vertical/q2-stepper-vertical.d.ts +62 -0
  330. package/dist/types/components/q2-tab-container/q2-tab-container.d.ts +2 -2
  331. package/dist/types/components/q2-tag/q2-tag.d.ts +59 -0
  332. package/dist/types/components.d.ts +0 -21
  333. package/dist/types/utils/action-sheet.d.ts +12 -0
  334. package/dist/types/utils/index.d.ts +1 -0
  335. package/package.json +5 -5
  336. package/dist/cjs/index-a93362ed.js.map +0 -1
  337. package/dist/cjs/q2-form.cjs.entry.js +0 -23
  338. package/dist/cjs/q2-form.cjs.entry.js.map +0 -1
  339. package/dist/collection/components/q2-form/q2-form.css +0 -92
  340. package/dist/collection/components/q2-form/q2-form.js +0 -44
  341. package/dist/collection/components/q2-form/q2-form.js.map +0 -1
  342. package/dist/components/q2-form.d.ts +0 -11
  343. package/dist/components/q2-form.js +0 -39
  344. package/dist/components/q2-form.js.map +0 -1
  345. package/dist/esm/index-3c5cd75e.js.map +0 -1
  346. package/dist/esm/q2-form.entry.js +0 -19
  347. package/dist/esm/q2-form.entry.js.map +0 -1
  348. package/dist/q2-tecton-elements/p-19da46dc.entry.js +0 -2
  349. package/dist/q2-tecton-elements/p-19da46dc.entry.js.map +0 -1
  350. package/dist/q2-tecton-elements/p-2878a662.entry.js +0 -2
  351. package/dist/q2-tecton-elements/p-2878a662.entry.js.map +0 -1
  352. package/dist/q2-tecton-elements/p-2a8de00d.entry.js +0 -2
  353. package/dist/q2-tecton-elements/p-2a8de00d.entry.js.map +0 -1
  354. package/dist/q2-tecton-elements/p-4b47816d.entry.js +0 -2
  355. package/dist/q2-tecton-elements/p-79696bef.entry.js +0 -2
  356. package/dist/q2-tecton-elements/p-79696bef.entry.js.map +0 -1
  357. package/dist/q2-tecton-elements/p-84190698.js +0 -2
  358. package/dist/q2-tecton-elements/p-84190698.js.map +0 -1
  359. package/dist/q2-tecton-elements/p-8a8d51f1.entry.js +0 -2
  360. package/dist/q2-tecton-elements/p-8a8d51f1.entry.js.map +0 -1
  361. package/dist/q2-tecton-elements/p-8e60bcaa.entry.js +0 -2
  362. package/dist/q2-tecton-elements/p-8e60bcaa.entry.js.map +0 -1
  363. package/dist/q2-tecton-elements/p-fde11d9c.entry.js +0 -2
  364. package/dist/q2-tecton-elements/p-fde11d9c.entry.js.map +0 -1
  365. package/dist/q2-tecton-elements/p-fec9edc8.entry.js +0 -2
  366. package/dist/q2-tecton-elements/p-fec9edc8.entry.js.map +0 -1
  367. package/dist/test/elements/q2-form-test.e2e.js +0 -93
  368. package/dist/test/elements/q2-form-test.e2e.js.map +0 -1
  369. package/dist/types/components/q2-form/q2-form.d.ts +0 -6
  370. /package/dist/q2-tecton-elements/{p-3fe532bc.entry.js.map → p-05f5d0ab.entry.js.map} +0 -0
  371. /package/dist/q2-tecton-elements/{p-fcffc029.entry.js.map → p-149044cd.entry.js.map} +0 -0
  372. /package/dist/q2-tecton-elements/{p-2d6a9a94.entry.js.map → p-3468d85d.entry.js.map} +0 -0
  373. /package/dist/q2-tecton-elements/{p-f57c4448.entry.js.map → p-3d6e350e.entry.js.map} +0 -0
  374. /package/dist/q2-tecton-elements/{p-ced89010.entry.js.map → p-3dff9fb0.entry.js.map} +0 -0
  375. /package/dist/q2-tecton-elements/{p-35cc1039.entry.js.map → p-48ecbcc9.entry.js.map} +0 -0
  376. /package/dist/q2-tecton-elements/{p-861e83de.entry.js.map → p-4ce69e38.entry.js.map} +0 -0
  377. /package/dist/q2-tecton-elements/{p-258f8c9c.entry.js.map → p-502af427.entry.js.map} +0 -0
  378. /package/dist/q2-tecton-elements/{p-7cbb989e.entry.js.map → p-50476216.entry.js.map} +0 -0
  379. /package/dist/q2-tecton-elements/{p-43236cac.entry.js.map → p-5234ced7.entry.js.map} +0 -0
  380. /package/dist/q2-tecton-elements/{p-4008aceb.entry.js.map → p-5538d1df.entry.js.map} +0 -0
  381. /package/dist/q2-tecton-elements/{p-4f7e6e79.entry.js.map → p-63f9a5e5.entry.js.map} +0 -0
  382. /package/dist/q2-tecton-elements/{p-828850c1.entry.js.map → p-646214e2.entry.js.map} +0 -0
  383. /package/dist/q2-tecton-elements/{p-30296b0e.entry.js.map → p-65e7dab0.entry.js.map} +0 -0
  384. /package/dist/q2-tecton-elements/{p-d75e4752.entry.js.map → p-7c5ee4aa.entry.js.map} +0 -0
  385. /package/dist/q2-tecton-elements/{p-9a5695db.entry.js.map → p-7fe8e174.entry.js.map} +0 -0
  386. /package/dist/q2-tecton-elements/{p-3f665c56.entry.js.map → p-803a5897.entry.js.map} +0 -0
  387. /package/dist/q2-tecton-elements/{p-d32f8e53.entry.js.map → p-871bad24.entry.js.map} +0 -0
  388. /package/dist/q2-tecton-elements/{p-dfa489ba.entry.js.map → p-8764a131.entry.js.map} +0 -0
  389. /package/dist/q2-tecton-elements/{p-bc73f69c.entry.js.map → p-8a2b4f10.entry.js.map} +0 -0
  390. /package/dist/q2-tecton-elements/{p-30d70f4a.entry.js.map → p-97774780.entry.js.map} +0 -0
  391. /package/dist/q2-tecton-elements/{p-81bb9436.entry.js.map → p-9c129294.entry.js.map} +0 -0
  392. /package/dist/q2-tecton-elements/{p-9b65cc28.entry.js.map → p-af3a383f.entry.js.map} +0 -0
  393. /package/dist/q2-tecton-elements/{p-d35de465.entry.js.map → p-b85b6bc1.entry.js.map} +0 -0
  394. /package/dist/q2-tecton-elements/{p-e793a82c.entry.js.map → p-b998e684.entry.js.map} +0 -0
  395. /package/dist/q2-tecton-elements/{p-63038a54.entry.js.map → p-c30c53dc.entry.js.map} +0 -0
  396. /package/dist/q2-tecton-elements/{p-76be9cad.entry.js.map → p-c37fff1e.entry.js.map} +0 -0
  397. /package/dist/q2-tecton-elements/{p-32130845.entry.js.map → p-c782a1d6.entry.js.map} +0 -0
  398. /package/dist/q2-tecton-elements/{p-49ecdf18.entry.js.map → p-cd225920.entry.js.map} +0 -0
  399. /package/dist/q2-tecton-elements/{p-7dafc5da.entry.js.map → p-cdfe6e9d.entry.js.map} +0 -0
  400. /package/dist/q2-tecton-elements/{p-75bb43b2.entry.js.map → p-d238dc6b.entry.js.map} +0 -0
  401. /package/dist/q2-tecton-elements/{p-0d6edd2a.entry.js.map → p-d5776227.entry.js.map} +0 -0
  402. /package/dist/q2-tecton-elements/{p-6e313705.entry.js.map → p-e08c6b8f.entry.js.map} +0 -0
  403. /package/dist/q2-tecton-elements/{p-56dd051a.entry.js.map → p-e41f47bc.entry.js.map} +0 -0
  404. /package/dist/q2-tecton-elements/{p-1b89b9c3.entry.js.map → p-e4241b1a.entry.js.map} +0 -0
  405. /package/dist/q2-tecton-elements/{p-aed969d4.entry.js.map → p-e654d2d6.entry.js.map} +0 -0
  406. /package/dist/q2-tecton-elements/{p-b6bcef6a.js.map → p-f1e887f5.js.map} +0 -0
  407. /package/dist/q2-tecton-elements/{p-366a92d9.entry.js.map → p-ff39ba49.entry.js.map} +0 -0
  408. /package/dist/types/{workspace/workspace/on-production_release_1.48.0-pre → builds/q2e/development/tecton/tecton}/packages/q2-tecton-elements/.stencil/test/elements/q2-detail/slot-component.d.ts +0 -0
  409. /package/dist/types/{workspace/workspace/on-production_release_1.48.0-pre → builds/q2e/development/tecton/tecton}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +0 -0
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-14c3693c.js');
6
- const index$1 = require('./index-a93362ed.js');
6
+ const index$1 = require('./index-3f1498f7.js');
7
7
 
8
8
  const ClickElsewhere = class {
9
9
  constructor(hostRef) {
@@ -87,7 +87,7 @@ const ClickElsewhere = class {
87
87
  get hostElement() { return index.getElement(this); }
88
88
  };
89
89
 
90
- const q2PopoverCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}.container{display:none}.show{display:block;position:fixed;z-index:var(--tct-popover-z-index, 50);margin:0;padding:0;overflow:auto;background:var(--tct-popover-background, var(--app-white, #ffffff));color:var(--tct-popover-font-color, var(--t-text, #4d4d4d));min-width:var(--tct-popover-min-width, 135px);margin-block:var(--tct-popover-margin-block, 0);box-shadow:var(--tct-popover-box-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3)));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, 3px)));--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}";
90
+ const q2PopoverCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}.legacy.container{display:none}.legacy.show{display:block;z-index:var(--tct-popover-z-index, 50)}:popover-open,.show{position:absolute;margin:0;padding:0;overflow:auto;background:var(--tct-popover-background, var(--app-white, #ffffff));color:var(--tct-popover-font-color, var(--t-text, #4d4d4d));min-width:var(--tct-popover-min-width, 135px);margin-block:var(--tct-popover-margin-block, 0);box-shadow:var(--tct-popover-box-shadow, var(--app-shadow-1, 0px 0px 2px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.14)));border-width:var(--tct-popover-border-width, 0);border-style:solid;border-color:var(--tct-popover-border-color, transparent);border-radius:var(--tct-popover-border-radius, 0);max-height:var(--comp-pop-max-height);left:var(--comp-pop-left);opacity:var(--comp-pop-opacity, 0);--comp-scrollbar-size:var(--tct-scrollbar-size, var(--t-scrollbar-size, var(--app-scale-1x, 5px)));--comp-scrollbar-border-radius:var(--tct-scrollbar-border-radius, var(--t-scrollbar-border-radius, var(--app-border-radius-1, 3px)));--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}";
91
91
  const Q2PopoverStyle0 = q2PopoverCss;
92
92
 
93
93
  const Q2Popover = class {
@@ -98,7 +98,6 @@ const Q2Popover = class {
98
98
  * The number of pixels to leave between the popover and the edge of the viewport
99
99
  */
100
100
  this.displayBuffer = 10;
101
- /** remove when Popover API is supported in iOS */
102
101
  this.orientationChanged = false;
103
102
  /// Helpers ///
104
103
  this.handleMinHeight = () => {
@@ -106,6 +105,9 @@ const Q2Popover = class {
106
105
  index$1.handleDeprecationWarning(this, 'minHeight', 'prop');
107
106
  }
108
107
  };
108
+ this.handlePopoverToggleEvent = (event) => {
109
+ this.popoverStateChanged.emit({ open: event.newState === 'open' });
110
+ };
109
111
  this.viewPortChanged = () => {
110
112
  if (!this.open)
111
113
  return;
@@ -115,25 +117,42 @@ const Q2Popover = class {
115
117
  this.orientationChanged = true;
116
118
  this.viewPortChanged();
117
119
  };
118
- this.setFixedCSSProperties = async () => {
119
- var _a, _b;
120
- const { controlElement, containerElement, currentDirection, rootElementRect } = this;
120
+ this.setPopoverAPICSSProperties = async () => {
121
+ var _a, _b, _c, _d, _e, _f;
122
+ const { controlElement, containerElement, currentDirection, isModule, align } = this;
121
123
  const { top: controlTop, bottom: controlBottom, left: controlLeft, right: controlRight, } = (_b = (_a = controlElement === null || controlElement === void 0 ? void 0 : controlElement.getBoundingClientRect) === null || _a === void 0 ? void 0 : _a.call(controlElement)) !== null && _b !== void 0 ? _b : {
122
124
  top: 0,
123
125
  bottom: 0,
124
126
  left: 0,
125
127
  right: 0,
126
128
  };
127
- const popoverLeft = controlLeft - rootElementRect.left;
129
+ const popoverLeft = controlLeft;
130
+ const popoverRight = ((_c = window === null || window === void 0 ? void 0 : window.visualViewport) === null || _c === void 0 ? void 0 : _c.width) - controlRight;
131
+ if (align === 'right') {
132
+ containerElement.style.setProperty('--comp-pop-right', `${popoverRight - window.scrollX}px`);
133
+ containerElement.style.setProperty('--comp-pop-left', 'unset');
134
+ }
135
+ else {
136
+ containerElement.style.setProperty('--comp-pop-left', `${popoverLeft + window.scrollX}px`);
137
+ containerElement.style.setProperty('--comp-pop-right', 'unset');
138
+ }
128
139
  if (this.block)
129
- containerElement.style.setProperty('--comp-pop-width', `${controlElement.offsetWidth || 0}px`);
130
- containerElement.style.setProperty('--comp-pop-left', `${popoverLeft}px`);
131
- containerElement.style.setProperty('--comp-pop-right', `${rootElementRect.width + rootElementRect.left - controlRight}px`);
140
+ containerElement.style.setProperty('--comp-pop-width', `${(controlElement === null || controlElement === void 0 ? void 0 : controlElement.offsetWidth) || 0}px`);
132
141
  if (currentDirection === 'up') {
133
- containerElement.style.setProperty('--comp-pop-bottom', `${rootElementRect.height + rootElementRect.top - controlTop}px`);
142
+ if (isModule) {
143
+ containerElement.style.setProperty('--comp-pop-bottom', `${window.innerHeight - controlTop}px`);
144
+ }
145
+ else {
146
+ containerElement.style.setProperty('--comp-pop-bottom', `${window.innerHeight - controlTop - ((_d = window === null || window === void 0 ? void 0 : window.visualViewport) === null || _d === void 0 ? void 0 : _d.offsetTop) - window.scrollY}px`);
147
+ }
134
148
  }
135
149
  if (currentDirection === 'down') {
136
- containerElement.style.setProperty('--comp-pop-top', `${controlBottom - rootElementRect.top}px`);
150
+ if (isModule) {
151
+ containerElement.style.setProperty('--comp-pop-top', `${controlBottom}px`);
152
+ }
153
+ else {
154
+ containerElement.style.setProperty('--comp-pop-top', `${controlBottom + ((_f = (_e = window === null || window === void 0 ? void 0 : window.visualViewport) === null || _e === void 0 ? void 0 : _e.offsetTop) !== null && _f !== void 0 ? _f : 0) + window.scrollY}px`);
155
+ }
137
156
  }
138
157
  // Wait for one paint to prevent layout thrashing
139
158
  await index$1.waitForNextPaint();
@@ -164,7 +183,7 @@ const Q2Popover = class {
164
183
  containerElement.style.setProperty('--comp-pop-opacity', '1');
165
184
  };
166
185
  this.direction = undefined;
167
- this.align = undefined;
186
+ this.align = 'left';
168
187
  this.open = undefined;
169
188
  this.block = undefined;
170
189
  this.controlElement = undefined;
@@ -174,13 +193,25 @@ const Q2Popover = class {
174
193
  this.show = false;
175
194
  }
176
195
  /// Lifecycle hooks ///
196
+ componentWillLoad() {
197
+ if (!this.supportsPopoverAPI) {
198
+ 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.');
199
+ this.mode = 'legacy';
200
+ }
201
+ }
177
202
  componentDidLoad() {
178
203
  this.handleMinHeight();
204
+ if (this.supportsPopoverAPI)
205
+ this.containerElement.addEventListener('toggle', this.handlePopoverToggleEvent);
179
206
  if (this.open)
180
207
  this.determinePopDirection();
181
208
  }
182
209
  disconnectedCallback() {
183
210
  this.removeViewportListeners();
211
+ this.containerElement.removeEventListener('toggle', this.handlePopoverToggleEvent);
212
+ this.containerElement = null;
213
+ this.contentElement = null;
214
+ this.controlElement = null;
184
215
  }
185
216
  /// Methods ///
186
217
  async toggle() {
@@ -189,44 +220,8 @@ const Q2Popover = class {
189
220
  async scrollContainerTo(options) {
190
221
  this.containerElement.scrollTo(options);
191
222
  }
192
- setRootElement() {
193
- let currentElement = this.hostElement;
194
- while (currentElement && currentElement !== document.documentElement) {
195
- const computedStyle = window.getComputedStyle(currentElement);
196
- // Check if the element has any styles applied that create a new containg block
197
- if (computedStyle.transform !== 'none' ||
198
- computedStyle.filter !== 'none' ||
199
- computedStyle.perspective !== 'none' ||
200
- computedStyle.containerType !== 'normal' ||
201
- ['transform', 'perspective', 'filter'].includes(computedStyle.willChange) ||
202
- ['layout', 'paint', 'strict', 'content'].includes(computedStyle.contain)) {
203
- this.rootElementRect = currentElement.getBoundingClientRect();
204
- return;
205
- }
206
- const rootNode = currentElement.getRootNode();
207
- const isRootNodeWebComponent = typeof ShadowRoot !== 'undefined' &&
208
- rootNode instanceof ShadowRoot &&
209
- rootNode.host instanceof HTMLElement;
210
- if (isRootNodeWebComponent) {
211
- currentElement = rootNode.host;
212
- }
213
- else {
214
- currentElement = currentElement.parentElement;
215
- }
216
- }
217
- // Return the document's bounding rect if no element is found
218
- this.rootElementRect = {
219
- top: 0,
220
- bottom: 0,
221
- left: 0,
222
- right: 0,
223
- height: window.visualViewport.height,
224
- width: window.visualViewport.width,
225
- };
226
- }
227
223
  /// Watchers ///
228
224
  async openChanged(open) {
229
- this.setRootElement();
230
225
  this.popoverStateChanged.emit({ open });
231
226
  if (open) {
232
227
  this.addViewportListeners();
@@ -235,7 +230,12 @@ const Q2Popover = class {
235
230
  else {
236
231
  this.removeViewportListeners();
237
232
  this.currentDirection = undefined;
238
- this.show = false;
233
+ if (this.mode === 'legacy' || !this.supportsPopoverAPI) {
234
+ this.show = false;
235
+ }
236
+ else {
237
+ this.containerElement.hidePopover();
238
+ }
239
239
  await index$1.waitForNextPaint();
240
240
  this.clearCSSProperties();
241
241
  }
@@ -252,7 +252,7 @@ const Q2Popover = class {
252
252
  event.stopPropagation();
253
253
  }
254
254
  /// Getters ///
255
- get actualDirection() {
255
+ get providedDirection() {
256
256
  const { direction } = this;
257
257
  switch (direction) {
258
258
  case 'up':
@@ -268,23 +268,26 @@ const Q2Popover = class {
268
268
  const hasPlatformDimensions = Object.keys((_b = (_a = window.Tecton) === null || _a === void 0 ? void 0 : _a.platformDimensions) !== null && _b !== void 0 ? _b : {}).length > 0;
269
269
  return isIframe && hasPlatformDimensions;
270
270
  }
271
+ get supportsPopoverAPI() {
272
+ return Object.hasOwn(HTMLElement.prototype, 'popover');
273
+ }
271
274
  addViewportListeners() {
272
275
  var _a;
273
276
  window.addEventListener('resize', this.viewPortOrientationChanged);
274
- // #region remove when Popover API is supported in iOS
275
- window.addEventListener('scroll', this.viewPortChanged, { passive: true, capture: true });
276
- (_a = screen === null || screen === void 0 ? void 0 : screen.orientation) === null || _a === void 0 ? void 0 : _a.addEventListener('change', this.viewPortOrientationChanged);
277
+ visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.addEventListener('resize', this.viewPortChanged);
278
+ if (index$1.isInScrollableContainer(this.hostElement) && !index$1.isMobile()) {
279
+ window.addEventListener('scroll', this.viewPortChanged, { passive: true, capture: true });
280
+ }
281
+ (_a = screen === null || screen === void 0 ? void 0 : screen.orientation) === null || _a === void 0 ? void 0 : _a.addEventListener('orientationchange', this.viewPortOrientationChanged);
277
282
  window.addEventListener('orientationchange', this.viewPortOrientationChanged);
278
- // #endregion
279
283
  }
280
284
  removeViewportListeners() {
281
285
  var _a;
282
286
  window.removeEventListener('resize', this.viewPortOrientationChanged);
283
- // #region remove when Popover API is supported in iOS
284
- window.removeEventListener('scroll', this.viewPortChanged);
287
+ visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.removeEventListener('resize', this.viewPortChanged);
288
+ window.removeEventListener('scroll', this.viewPortChanged, { capture: true });
285
289
  (_a = screen === null || screen === void 0 ? void 0 : screen.orientation) === null || _a === void 0 ? void 0 : _a.removeEventListener('orientationchange', this.viewPortOrientationChanged);
286
290
  window.removeEventListener('orientationchange', this.viewPortOrientationChanged);
287
- // #endregion
288
291
  }
289
292
  clearCSSProperties() {
290
293
  this.containerElement.style.removeProperty('--comp-pop-max-height');
@@ -296,24 +299,24 @@ const Q2Popover = class {
296
299
  this.containerElement.style.removeProperty('--comp-pop-opacity');
297
300
  }
298
301
  setDirectionAndShow(direction) {
299
- this.setRootElement();
300
302
  // Due to some runtime inconsistency across devices/browsers we need to add one more check here because the
301
303
  // popover can be closed between the time the popover is opened and the time the direction is determined
302
304
  const isOpen = this.open;
303
305
  if (!isOpen)
304
306
  return;
305
307
  this.currentDirection = direction;
306
- this.show = true;
307
- if (this.mode === 'legacy') {
308
+ if (this.mode === 'legacy' || !this.supportsPopoverAPI) {
309
+ this.show = true;
308
310
  this.setAbsoluteCSSProperties();
309
311
  }
310
312
  else {
311
- this.setFixedCSSProperties();
313
+ this.setPopoverAPICSSProperties();
314
+ this.containerElement.showPopover();
312
315
  }
313
316
  }
314
317
  async determinePopDirection() {
315
318
  var _a, _b, _c;
316
- const { containerElement, controlElement, actualDirection, displayBuffer } = this;
319
+ const { containerElement, controlElement, providedDirection, displayBuffer } = this;
317
320
  if (containerElement)
318
321
  containerElement.style.maxHeight = null;
319
322
  await index$1.waitForNextPaint();
@@ -326,20 +329,23 @@ const Q2Popover = class {
326
329
  let maxSpaceAbove;
327
330
  let maxSpaceBelow;
328
331
  if (isModule) {
329
- const { outletOffset = 0, innerHeight = window.innerHeight } = ((_c = window.Tecton) === null || _c === void 0 ? void 0 : _c.platformDimensions) || {};
330
- const distanceToIframeBottom = window.visualViewport.height - controlBottom;
331
- const viewableSpaceBelow = innerHeight - (outletOffset + controlBottom);
332
+ const { outletOffset = 0, innerHeight = window.innerHeight, top: topBarHeight = 0, bottom: bottomBarHeight = 0, } = ((_c = window.Tecton) === null || _c === void 0 ? void 0 : _c.platformDimensions) || {};
333
+ const distanceToIframeBottom = window.innerHeight - controlBottom;
334
+ // controlElement position visually on the page
335
+ const visualControlTop = outletOffset > 0 ? controlTop : controlTop + outletOffset - topBarHeight;
336
+ const visualControlBottom = outletOffset + controlBottom - topBarHeight;
337
+ // visual space around the controlElement
338
+ const viewableSpaceAbove = visualControlTop;
339
+ const viewableSpaceBelow = innerHeight - bottomBarHeight - visualControlBottom;
340
+ // calculate space above and below controlElement
332
341
  const isIframeShorterThanWindow = distanceToIframeBottom < viewableSpaceBelow;
333
- windowHeight = innerHeight;
334
- // If the top of the module is below the top of the window we just use the controlTop
335
- // Otherwise we need to add the outletOffset to the controlTop
336
- maxSpaceAbove = (outletOffset > 0 ? controlTop : controlTop + outletOffset) - displayBuffer;
342
+ maxSpaceAbove = viewableSpaceAbove - displayBuffer;
337
343
  maxSpaceBelow = isIframeShorterThanWindow
338
344
  ? distanceToIframeBottom - displayBuffer
339
345
  : viewableSpaceBelow - displayBuffer;
340
346
  }
341
347
  else {
342
- windowHeight = window.visualViewport.height;
348
+ windowHeight = window.innerHeight;
343
349
  maxSpaceAbove = controlTop - displayBuffer;
344
350
  maxSpaceBelow = windowHeight - controlBottom - displayBuffer;
345
351
  }
@@ -348,7 +354,7 @@ const Q2Popover = class {
348
354
  const shouldUpdateMaxHeight = !containerElement.style.getPropertyValue('--comp-pop-max-height') || this.orientationChanged;
349
355
  // we do not want to constantly update the max-height after an orientation change, so we switch this back to false
350
356
  this.orientationChanged = false;
351
- const currentOrDetermineDirection = this.currentDirection || actualDirection || directionWithMostSpace;
357
+ const currentOrDetermineDirection = this.currentDirection || providedDirection || directionWithMostSpace;
352
358
  switch (currentOrDetermineDirection) {
353
359
  case 'up':
354
360
  if (shouldUpdateMaxHeight) {
@@ -366,12 +372,14 @@ const Q2Popover = class {
366
372
  }
367
373
  /// DOM ///
368
374
  render() {
369
- const containerClasses = ['container', this.currentDirection];
375
+ const containerClasses = ['container', this.currentDirection, this.align];
370
376
  if (this.show)
371
377
  containerClasses.push('show');
378
+ if (this.block)
379
+ containerClasses.push('block');
372
380
  if (this.mode === 'legacy')
373
381
  containerClasses.push('legacy');
374
- return (index.h("div", { key: 'cae82b5d3654da661c49f1dc655a5d0721eb62ea', ref: el => (this.containerElement = el), class: containerClasses.join(' '), "test-id": "outerContainer" }, index.h("div", { key: '38627a57a05e6fa12fed42f2c1a4f1ac90b6760a', ref: el => (this.contentElement = el), class: "content" }, index.h("slot", { key: 'a7b96f27d1fd85fecef2f1aa53648d03bc3f7fb8' }))));
382
+ return (index.h("div", { key: '3c4f9aa456357dbb8bbb07b2120de7a5999ba52a', ref: el => (this.containerElement = el), class: containerClasses.join(' '), "test-id": "outerContainer", tabIndex: -1, popover: "manual" }, index.h("div", { key: '249dcb31d3af7689d47b5d3d81112afa212c9123', ref: el => (this.contentElement = el), class: "content" }, index.h("slot", { key: '26c48e818d567b9a63223df1b13320e9a9bbb1c3' }))));
375
383
  }
376
384
  get hostElement() { return index.getElement(this); }
377
385
  static get watchers() { return {
@@ -1 +1 @@
1
- {"file":"click-elsewhere.q2-popover.entry.cjs.js","mappings":";;;;;;;MAMa,cAAc;IAJ3B;;;;;;QAQI,mBAAc,GAAa,CAAC,WAAW,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;QACpE,uBAAkB,GAAY,KAAK,CAAC;QA0EpC,iBAAY,GAAG,CAAC,KAAY;YACxB,MAAM,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;YACzE,MAAM,gBAAgB,GAClB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,MAAiB,CAAC,CAAC;YAE1G,IAAI,CAAC,gBAAgB,KAAK,IAAI,CAAC,kBAAkB,IAAI,kBAAkB,CAAC,EAAE;gBACtE,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;gBAChC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;gBACnB,OAAO;aACV;YACD,IAAI,CAAC,kBAAkB,GAAG,gBAAgB,IAAI,kBAAkB,CAAC;SACpE,CAAC;QAEF,sBAAiB,GAAG;YAChB,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;YAChC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;SACtB,CAAC;KACL;;;IAhFG,iBAAiB,MAAK;;IAGtB,iBAAiB;QACb,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,SAAiB;YAC1C,QAAQ,CAAC,gBAAgB,CA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B,EAAE,GAAG,aAAa,IAAI,CAAC,CAAC;iBACrF;gBACD,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;gBACjC,MAAM;SAGb;KACJ;;IAGD,MAAM;QACF,MAAM,gBAAgB,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC9D,IAAI,IAAI,CAAC,IAAI;YAAE,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7C,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ;YAAE,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAE5D,QACIC,kEACI,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC,EACvC,KAAK,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,aACzB,gBAAgB,IAExBA,kEACI,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC,EACrC,KAAK,EAAC,SAAS,IAEfA,oEAAQ,CACN,CACJ,EACR;KACL;;;;;;;;;;;;","names":["handleDeprecationWarning","waitForNextPaint","h"],"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 /**\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 isCurrentlyFocused: boolean = false;\n\n @Element() hostElement: HTMLElement;\n\n /**\n * Emitted when the user clicks outside the element\n */\n @Event() change: EventEmitter;\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 /* 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 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 shadowEventTarget(event: any): Element {\n return event.composedPath()[0] || event.target;\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 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 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 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('0 2px 4px rgba(0, 0, 0, 0.3)'));\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 /**\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 }) direction: 'up' | 'down';\n\n /** Aligns the popover to the left or right side of the control element. */\n @Prop({ reflect: true }) align: 'left' | 'right';\n\n /** Controls whether the popover is open or closed. */\n @Prop({ reflect: true, mutable: true }) open: boolean;\n\n /** Indicates the popover will match the width of its parent element. */\n @Prop({ reflect: true }) block: boolean;\n\n /** The element that controls the popover's behavior. */\n @Prop() controlElement: HTMLElement;\n\n @Prop() mode: 'legacy' = null;\n\n /** @deprecated */\n @Prop() minHeight: number;\n\n @Element() hostElement: HTMLElement;\n\n /**\n * Emitted when the popover is opened or closed.\n */\n @Event() popoverStateChanged: EventEmitter<{ open: boolean }>;\n\n @State() currentDirection: 'down' | 'up' = undefined;\n // remove `show` when Popover API is supported in iOS\n @State() show: boolean = false;\n\n containerElement: HTMLDivElement;\n contentElement: HTMLDivElement;\n rootElementRect: DOMRect;\n\n /**\n * The number of pixels to leave between the popover and the edge of the viewport\n */\n displayBuffer = 10;\n\n /** remove when Popover API is supported in iOS */\n orientationChanged: boolean = false;\n\n /// Lifecycle hooks ///\n componentDidLoad() {\n this.handleMinHeight();\n if (this.open) this.determinePopDirection();\n }\n\n disconnectedCallback() {\n this.removeViewportListeners();\n }\n\n /// Methods ///\n @Method()\n async toggle() {\n this.open = !this.open;\n }\n\n @Method()\n async scrollContainerTo(options: ScrollToOptions) {\n this.containerElement.scrollTo(options);\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 /// Watchers ///\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 @Watch('minHeight')\n minHeightProvided() {\n this.handleMinHeight();\n }\n\n /// Listeners ///\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 /// Getters ///\n get actualDirection(): 'up' | 'down' | undefined {\n const { direction } = this;\n switch (direction) {\n case 'up':\n case 'down':\n return direction;\n default:\n return undefined;\n }\n }\n\n get isModule() {\n const isIframe = window !== window.top;\n const hasPlatformDimensions = Object.keys(window.Tecton?.platformDimensions ?? {}).length > 0;\n return isIframe && hasPlatformDimensions;\n }\n\n /// Helpers ///\n handleMinHeight = () => {\n if (this.minHeight) {\n handleDeprecationWarning(this, 'minHeight', 'prop');\n }\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 addViewportListeners() {\n window.addEventListener('resize', this.viewPortOrientationChanged);\n // #region remove when Popover API is supported in iOS\n window.addEventListener('scroll', this.viewPortChanged, { passive: true, capture: true });\n screen?.orientation?.addEventListener('change', this.viewPortOrientationChanged);\n window.addEventListener('orientationchange', this.viewPortOrientationChanged);\n // #endregion\n }\n\n removeViewportListeners() {\n window.removeEventListener('resize', this.viewPortOrientationChanged);\n // #region remove when Popover API is supported in iOS\n window.removeEventListener('scroll', this.viewPortChanged);\n screen?.orientation?.removeEventListener('orientationchange', this.viewPortOrientationChanged);\n window.removeEventListener('orientationchange', this.viewPortOrientationChanged);\n // #endregion\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 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 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 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 async determinePopDirection() {\n const { containerElement, controlElement, actualDirection, displayBuffer } = this;\n if (containerElement) containerElement.style.maxHeight = null;\n\n await waitForNextPaint();\n\n const { isModule } = this;\n const { top: controlTop, bottom: controlBottom } = controlElement?.getBoundingClientRect?.() ?? {\n top: 0,\n bottom: 0,\n };\n\n let windowHeight: number;\n let maxSpaceAbove: number;\n let maxSpaceBelow: number;\n\n if (isModule) {\n const { outletOffset = 0, innerHeight = window.innerHeight } = window.Tecton?.platformDimensions || {};\n const distanceToIframeBottom = window.visualViewport.height - controlBottom;\n const viewableSpaceBelow = innerHeight - (outletOffset + controlBottom);\n const isIframeShorterThanWindow = distanceToIframeBottom < viewableSpaceBelow;\n windowHeight = innerHeight;\n // If the top of the module is below the top of the window we just use the controlTop\n // Otherwise we need to add the outletOffset to the controlTop\n maxSpaceAbove = (outletOffset > 0 ? controlTop : controlTop + outletOffset) - displayBuffer;\n maxSpaceBelow = isIframeShorterThanWindow\n ? distanceToIframeBottom - displayBuffer\n : viewableSpaceBelow - displayBuffer;\n } else {\n windowHeight = window.visualViewport.height;\n maxSpaceAbove = controlTop - displayBuffer;\n maxSpaceBelow = windowHeight - controlBottom - displayBuffer;\n }\n\n const directionWithMostSpace: 'up' | 'down' = maxSpaceAbove > maxSpaceBelow ? 'up' : 'down';\n\n // We do not want to update the max height once the popover is open unless the page orientation shifts (resize or mobile use cases)\n const shouldUpdateMaxHeight =\n !containerElement.style.getPropertyValue('--comp-pop-max-height') || this.orientationChanged;\n // we do not want to constantly update the max-height after an orientation change, so we switch this back to false\n this.orientationChanged = false;\n const currentOrDetermineDirection = this.currentDirection || actualDirection || directionWithMostSpace;\n\n switch (currentOrDetermineDirection) {\n case 'up':\n if (shouldUpdateMaxHeight) {\n containerElement.style.setProperty('--comp-pop-max-height', `${maxSpaceAbove}px`);\n }\n this.setDirectionAndShow('up');\n break;\n case 'down':\n if (shouldUpdateMaxHeight) {\n containerElement.style.setProperty('--comp-pop-max-height', `${maxSpaceBelow}px`);\n }\n this.setDirectionAndShow('down');\n break;\n default:\n break;\n }\n }\n\n /// DOM ///\n render() {\n const containerClasses = ['container', this.currentDirection];\n if (this.show) containerClasses.push('show');\n if (this.mode === 'legacy') containerClasses.push('legacy');\n\n return (\n <div\n ref={el => (this.containerElement = el)}\n class={containerClasses.join(' ')}\n test-id=\"outerContainer\"\n >\n <div\n ref={el => (this.contentElement = el)}\n class=\"content\"\n >\n <slot />\n </div>\n </div>\n );\n }\n}\n"],"version":3}
1
+ {"file":"click-elsewhere.q2-popover.entry.cjs.js","mappings":";;;;;;;MAMa,cAAc;IAJ3B;;;;;;QAQI,mBAAc,GAAa,CAAC,WAAW,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;QACpE,uBAAkB,GAAY,KAAK,CAAC;QA0EpC,iBAAY,GAAG,CAAC,KAAY;YACxB,MAAM,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;YACzE,MAAM,gBAAgB,GAClB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,MAAiB,CAAC,CAAC;YAE1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int","isInScrollableContainer","isMobile","h"],"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 /**\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 isCurrentlyFocused: boolean = false;\n\n @Element() hostElement: HTMLElement;\n\n /**\n * Emitted when the user clicks outside the element\n */\n @Event() change: EventEmitter;\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 /* 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 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 shadowEventTarget(event: any): Element {\n return event.composedPath()[0] || event.target;\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 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 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 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 /**\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 }) direction: 'up' | 'down';\n\n /** Aligns the popover to the left or right side of the control element. */\n @Prop({ reflect: true }) align: 'left' | 'right' = 'left';\n\n /** Controls whether the popover is open or closed. */\n @Prop({ reflect: true, mutable: true }) open: boolean;\n\n /** Indicates the popover will match the width of its parent element. */\n @Prop({ reflect: true }) block: boolean;\n\n /** The element that controls the popover's behavior. */\n @Prop() controlElement: HTMLElement;\n\n @Prop() mode: 'legacy' = null;\n\n /** @deprecated */\n @Prop() minHeight: number;\n\n @Element() hostElement: HTMLElement;\n\n /**\n * Emitted when the popover is opened or closed.\n */\n @Event() popoverStateChanged: EventEmitter<{ open: boolean }>;\n\n @State() currentDirection: 'down' | 'up' = undefined;\n // remove `show` when Popover API is supported in iOS\n @State() show: boolean = false;\n\n containerElement: HTMLDivElement;\n contentElement: HTMLDivElement;\n\n /**\n * The number of pixels to leave between the popover and the edge of the viewport\n */\n displayBuffer = 10;\n\n orientationChanged: boolean = false;\n\n /// Lifecycle hooks ///\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 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 /// Methods ///\n @Method()\n async toggle() {\n this.open = !this.open;\n }\n\n @Method()\n async scrollContainerTo(options: ScrollToOptions) {\n this.containerElement.scrollTo(options);\n }\n\n /// Watchers ///\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 @Watch('minHeight')\n minHeightProvided() {\n this.handleMinHeight();\n }\n\n /// Listeners ///\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 /// Getters ///\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 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 supportsPopoverAPI(): boolean {\n return Object.hasOwn(HTMLElement.prototype, 'popover');\n }\n\n /// Helpers ///\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 viewPortChanged = () => {\n if (!this.open) return;\n this.determinePopDirection();\n };\n\n viewPortOrientationChanged = () => {\n this.orientationChanged = true;\n this.viewPortChanged();\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 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 setPopoverAPICSSProperties = async () => {\n const { controlElement, containerElement, currentDirection, isModule, align } = this;\n const {\n top: controlTop,\n bottom: controlBottom,\n left: controlLeft,\n right: controlRight,\n } = controlElement?.getBoundingClientRect?.() ?? {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n };\n\n const popoverLeft: number = controlLeft;\n const popoverRight: number = window?.visualViewport?.width - controlRight;\n\n if (align === 'right') {\n containerElement.style.setProperty('--comp-pop-right', `${popoverRight - window.scrollX}px`);\n containerElement.style.setProperty('--comp-pop-left', 'unset');\n } else {\n containerElement.style.setProperty('--comp-pop-left', `${popoverLeft + window.scrollX}px`);\n containerElement.style.setProperty('--comp-pop-right', 'unset');\n }\n\n if (this.block) containerElement.style.setProperty('--comp-pop-width', `${controlElement?.offsetWidth || 0}px`);\n\n if (currentDirection === 'up') {\n if (isModule) {\n containerElement.style.setProperty('--comp-pop-bottom', `${window.innerHeight - controlTop}px`);\n } else {\n containerElement.style.setProperty(\n '--comp-pop-bottom',\n `${window.innerHeight - controlTop - window?.visualViewport?.offsetTop - window.scrollY}px`\n );\n }\n }\n\n if (currentDirection === 'down') {\n if (isModule) {\n containerElement.style.setProperty('--comp-pop-top', `${controlBottom}px`);\n } else {\n containerElement.style.setProperty(\n '--comp-pop-top',\n `${controlBottom + (window?.visualViewport?.offsetTop ?? 0) + window.scrollY}px`\n );\n }\n }\n\n // Wait for one paint to prevent layout thrashing\n await waitForNextPaint();\n containerElement.style.setProperty('--comp-pop-opacity', '1');\n };\n\n 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 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 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 async determinePopDirection() {\n const { containerElement, controlElement, providedDirection, displayBuffer } = this;\n if (containerElement) containerElement.style.maxHeight = null;\n await waitForNextPaint();\n\n const { isModule } = this;\n const { top: controlTop, bottom: controlBottom } = controlElement?.getBoundingClientRect?.() ?? {\n top: 0,\n bottom: 0,\n };\n\n let windowHeight: number;\n let maxSpaceAbove: number;\n let maxSpaceBelow: number;\n if (isModule) {\n const {\n outletOffset = 0,\n innerHeight = window.innerHeight,\n top: topBarHeight = 0,\n bottom: bottomBarHeight = 0,\n } = window.Tecton?.platformDimensions || {};\n\n const distanceToIframeBottom = window.innerHeight - controlBottom;\n\n // controlElement position visually on the page\n const visualControlTop = outletOffset > 0 ? controlTop : controlTop + outletOffset - topBarHeight;\n const visualControlBottom = outletOffset + controlBottom - topBarHeight;\n\n // visual space around the controlElement\n const viewableSpaceAbove = visualControlTop;\n const viewableSpaceBelow = innerHeight - bottomBarHeight - visualControlBottom;\n\n // calculate space above and below controlElement\n const isIframeShorterThanWindow = distanceToIframeBottom < viewableSpaceBelow;\n maxSpaceAbove = viewableSpaceAbove - displayBuffer;\n maxSpaceBelow = isIframeShorterThanWindow\n ? distanceToIframeBottom - displayBuffer\n : viewableSpaceBelow - displayBuffer;\n } else {\n windowHeight = window.innerHeight;\n maxSpaceAbove = controlTop - displayBuffer;\n maxSpaceBelow = windowHeight - controlBottom - displayBuffer;\n }\n\n const directionWithMostSpace: 'up' | 'down' = maxSpaceAbove > maxSpaceBelow ? 'up' : 'down';\n\n // We do not want to update the max height once the popover is open unless the page orientation shifts (resize or mobile use cases)\n const shouldUpdateMaxHeight =\n !containerElement.style.getPropertyValue('--comp-pop-max-height') || this.orientationChanged;\n // we do not want to constantly update the max-height after an orientation change, so we switch this back to false\n this.orientationChanged = false;\n const currentOrDetermineDirection = this.currentDirection || providedDirection || directionWithMostSpace;\n\n switch (currentOrDetermineDirection) {\n case 'up':\n if (shouldUpdateMaxHeight) {\n containerElement.style.setProperty('--comp-pop-max-height', `${maxSpaceAbove}px`);\n }\n this.setDirectionAndShow('up');\n break;\n case 'down':\n if (shouldUpdateMaxHeight) {\n containerElement.style.setProperty('--comp-pop-max-height', `${maxSpaceBelow}px`);\n }\n this.setDirectionAndShow('down');\n break;\n default:\n break;\n }\n }\n\n /// DOM ///\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"],"version":3}
@@ -5,6 +5,37 @@ const index = require('./index-14c3693c.js');
5
5
  function isMobile() {
6
6
  return /Android|webOS|iPhone|iPad|iPod|BlackBerry|Mobile|IEMobile|Windows Phone|Opera Mini/i.test(navigator.userAgent);
7
7
  }
8
+ function isInScrollableContainer(element) {
9
+ let current = element;
10
+ while (current && current !== document.body && current !== document.documentElement) {
11
+ // Move to parent
12
+ if (current.parentElement) {
13
+ current = current.parentElement;
14
+ }
15
+ else {
16
+ // Try to cross shadow DOM boundary
17
+ const root = current.getRootNode();
18
+ if (root && root.host) {
19
+ current = root.host;
20
+ }
21
+ else {
22
+ break;
23
+ }
24
+ }
25
+ const style = window.getComputedStyle(current);
26
+ const hasScrollableOverflow = style.overflow === 'scroll' ||
27
+ style.overflow === 'auto' ||
28
+ style.overflowX === 'scroll' ||
29
+ style.overflowX === 'auto' ||
30
+ style.overflowY === 'scroll' ||
31
+ style.overflowY === 'auto';
32
+ const hasOverflowingContent = current.scrollHeight > current.clientHeight || current.scrollWidth > current.clientWidth;
33
+ if (hasScrollableOverflow && hasOverflowingContent) {
34
+ return true;
35
+ }
36
+ }
37
+ return false;
38
+ }
8
39
  function isHostLosingFocus(event, hostElement) {
9
40
  const type = event.type;
10
41
  const focusInTypes = ['focusin', 'focus'];
@@ -209,6 +240,7 @@ exports.hasSlotContent = hasSlotContent;
209
240
  exports.isEventFromElement = isEventFromElement;
210
241
  exports.isFirefox = isFirefox;
211
242
  exports.isHostLosingFocus = isHostLosingFocus;
243
+ exports.isInScrollableContainer = isInScrollableContainer;
212
244
  exports.isMobile = isMobile;
213
245
  exports.isRelatedTargetWithinHost = isRelatedTargetWithinHost;
214
246
  exports.isTouchDevice = isTouchDevice;
@@ -222,4 +254,4 @@ exports.resizeIframe = resizeIframe;
222
254
  exports.setMessageHeight = setMessageHeight;
223
255
  exports.waitForNextPaint = waitForNextPaint;
224
256
 
225
- //# sourceMappingURL=index-a93362ed.js.map
257
+ //# sourceMappingURL=index-3f1498f7.js.map
@@ -0,0 +1 @@
1
+ {"file":"index-3f1498f7.js","mappings":";;;;SAgBgB,QAAQ;IACpB,OAAO,qFAAqF,CAAC,IAAI,CAC7F,SAAS,CAAC,SAAS,CACtB,CAAC;AACN,CAAC;SAEe,uBAAuB,CAAC,OAAO;IAC3C,IAAI,OAAO,GAAG,OAAO,CAAC;IAEtB,OAAO,OAAO,IAAI,OAAO,KAAK,QAAQ,CAAC,IAAI,IAAI,OAAO,KAAK,QAAQ,CAAC,eAAe,EAAE;;QAEjF,IAAI,OAAO,CAAC,aAAa,EAAE;YACvB,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;SACnC;aAAM;;YAEH,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;YACnC,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE;gBACnB,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC;aACvB;iBAAM;gBACH,MAAM;aACT;SACJ;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAC/C,MAAM,qBAAqB,GACvB,KAAK,CAAC,QAAQ,KAAK,QAAQ;YAC3B,KAAK,CAAC,QAAQ,KAAK,MAAM;YACzB,KAAK,CAAC,SAAS,KAAK,QAAQ;YAC5B,KAAK,CAAC,S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AAa;IACrC,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;QACnE,MAAM,CAAC,MAAM,GAAG,YAAY,MAAM,CAAC,KAAK,EAAgC,CAAC;QACzE,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC;KAC5B;AACL;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["h"],"sources":["src/utils/index.tsx"],"sourcesContent":["import { h } from '@stencil/core';\nimport { Q2Btn } from 'src/components/q2-btn/q2-btn';\nimport { Q2Calendar } from 'src/components/q2-calendar/q2-calendar';\nimport { Q2Carousel } from 'src/components/q2-carousel/q2-carousel';\nimport { Q2Checkbox } from 'src/components/q2-checkbox/q2-checkbox';\nimport { Q2CheckboxGroup } from 'src/components/q2-checkbox-group/q2-checkbox-group';\nimport { Q2RadioGroup } from 'src/components/q2-radio-group/q2-radio-group';\nimport { Q2Dropdown } from 'src/components/q2-dropdown/q2-dropdown';\nimport { Q2DropdownItem } from 'src/components/q2-dropdown-item/q2-dropdown-item';\nimport { Q2EditableField } from 'src/components/q2-editable-field/q2-editable-field';\nimport { Q2Input } from 'src/components/q2-input/q2-input';\nimport { Q2Loading } from 'src/components/q2-loading/q2-loading';\nimport { Q2Radio } from 'src/components/q2-radio/q2-radio';\nimport { Q2Select } from 'src/components/q2-select/q2-select';\nimport { FormFieldTypes, IDict } from 'src/util';\n\nexport function isMobile(): boolean {\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|Mobile|IEMobile|Windows Phone|Opera Mini/i.test(\n navigator.userAgent\n );\n}\n\nexport function isInScrollableContainer(element) {\n let current = element;\n\n while (current && current !== document.body && current !== document.documentElement) {\n // Move to parent\n if (current.parentElement) {\n current = current.parentElement;\n } else {\n // Try to cross shadow DOM boundary\n const root = current.getRootNode();\n if (root && root.host) {\n current = root.host;\n } else {\n break;\n }\n }\n\n const style = window.getComputedStyle(current);\n const hasScrollableOverflow =\n style.overflow === 'scroll' ||\n style.overflow === 'auto' ||\n style.overflowX === 'scroll' ||\n style.overflowX === 'auto' ||\n style.overflowY === 'scroll' ||\n style.overflowY === 'auto';\n\n const hasOverflowingContent =\n current.scrollHeight > current.clientHeight || current.scrollWidth > current.clientWidth;\n\n if (hasScrollableOverflow && hasOverflowingContent) {\n return true;\n }\n }\n\n return false;\n}\n\nexport function isHostLosingFocus(event: FocusEvent, hostElement: HTMLElement) {\n const type = event.type;\n const focusInTypes = ['focusin', 'focus'];\n const isFocusIn = focusInTypes.includes(type);\n\n // on focusin: `target` is element losing focus, `relatedTarget` is element gaining focus\n // on focusout: `target` is element gaining focus, `relatedTarget` is element losing focus\n const elementGainingFocus = isFocusIn ? event.target : event.relatedTarget;\n\n const isElementNestedInHostElement = (element: HTMLElement) => {\n if (element === hostElement) return true;\n if (element.parentElement) {\n return isElementNestedInHostElement(element.parentElement);\n }\n return false;\n };\n\n if (!(elementGainingFocus instanceof HTMLElement)) return true;\n return !isElementNestedInHostElement(elementGainingFocus);\n}\n\nexport function isRelatedTargetWithinHost(event: FocusEvent, element: HTMLElement) {\n return event.relatedTarget !== element && !element.contains(event.relatedTarget as Node);\n}\n\nexport function isEventFromElement(event: Event, element: HTMLElement): boolean {\n return event.composedPath?.()[0] === element;\n}\n\nexport function overrideFocus(hostElement: HTMLElement) {\n hostElement.focus = () => hostElement?.dispatchEvent(new FocusEvent('focus', { bubbles: false }));\n}\n\nexport function isFirefox() {\n const userAgent = navigator.userAgent.toLowerCase();\n return userAgent.includes('firefox');\n}\n\nexport function isTouchDevice() {\n return 'ontouchstart' in window || navigator.maxTouchPoints > 0;\n}\n\nexport function isSafari() {\n const userAgent = navigator.userAgent.toLowerCase();\n return userAgent.includes('safari') && !userAgent.includes('chrome');\n}\n\n/**\n * Returns the value of a prop if it is defined and included in the `validValues`\n * array. This is used primarily to prevent Vue wrappers from setting aria props\n * to \"Symbol()\" when the prop is not set.\n */\nexport function getAriaValueFromProp(prop: string, validValues?: string[]) {\n if (prop === undefined) return prop;\n if (!validValues) return prop !== 'Symbol()' ? prop : undefined;\n return validValues.includes(prop) || prop === '' ? prop : undefined;\n}\n\nlet guid: number = 1000;\nexport function createGuid(): number {\n return guid++;\n}\n\nexport function nextPaint(fn: (value?: unknown) => void) {\n requestAnimationFrame(() => {\n requestAnimationFrame(fn);\n });\n}\n\nexport function isVisible(element: HTMLElement) {\n return element.offsetWidth > 0 || element.offsetHeight > 0 || element.getClientRects().length > 0;\n}\n\nexport function waitForNextPaint() {\n return new Promise(resolve => nextPaint(resolve));\n}\n\nexport function capitalize(value: string) {\n return `${value.charAt(0).toUpperCase()}${value.slice(1)}`;\n}\n\nexport function pick(props: string[]): (obj: object) => object {\n return obj => {\n return props.reduce((memo, prop) => {\n return {\n ...memo,\n [prop]: obj[prop],\n };\n }, {});\n };\n}\n\nexport function loc(key: string, subs?: IDict<any> | string[]) {\n if (!key) return '';\n if (window.Tecton?.noStrings === true) {\n return key;\n }\n return window?.TectonElements?.loc(key, subs) ?? key;\n}\n\nexport function labelDOM(target: FormFieldTypes | Q2RadioGroup | Q2CheckboxGroup) {\n const { label, hideLabel, optional, readonly } = target;\n const labelClasses: string[] = ['input-label'];\n let helpText = '';\n\n let shouldHideLabel = hideLabel;\n if (!shouldHideLabel) {\n const labelSlotElements = target.hostElement.querySelectorAll<HTMLSlotElement>('[slot=\"label\"]');\n const hasSlotContent = labelSlotElements.length > 0;\n const hasLabel = !!label;\n\n shouldHideLabel = hasLabel || hasSlotContent ? false : true;\n }\n\n if (shouldHideLabel) labelClasses.push('sr');\n if (optional) {\n helpText = <span class=\"optional-tag\">{loc('tecton.element.input.optional')}</span>;\n }\n if (readonly) {\n helpText = <span class=\"optional-tag\">{loc('tecton.element.input.readonly')}</span>;\n labelClasses.push('readonly-field');\n }\n return (\n <label\n htmlFor={target.inputId}\n class={labelClasses.join(' ')}\n >\n <slot name=\"label\">\n {label ? loc(label) : undefined}\n {helpText}\n </slot>\n </label>\n );\n}\n\nexport function hasSlotContent(target: HTMLElement, slotName: string) {\n return target.querySelector(`[slot=\"${slotName}\"]`) !== null;\n}\n\nexport function handleAriaLabel(\n target:\n | Q2Input\n | Q2Select\n | Q2Radio\n | Q2Checkbox\n | Q2EditableField\n | Q2Dropdown\n | Q2DropdownItem\n | Q2Loading\n | Q2Carousel\n | Q2Calendar\n | Q2Btn\n) {\n const { ariaLabel } = target;\n if (!ariaLabel) return;\n\n // If empty ariaLabel prop is set to primitive symbol by framework wrapper, set ariaLabel to undefined and return\n const FW_WRAPPERS_EMPTY_PROP = Symbol().toString();\n if (ariaLabel === FW_WRAPPERS_EMPTY_PROP) {\n target.ariaLabel = undefined;\n return;\n }\n\n // If ariaLabel is set, set hideLabel to true and set label to ariaLabel\n if ('hideLabel' in target) target.hideLabel = true;\n target.label = loc(ariaLabel);\n target.ariaLabel = undefined;\n}\n\n/**\n * Handles when a prop has been renamed on a component without introducing a breaking change.\n */\nexport function handleRenamedProp(target: object, oldProp: string, newProp: string, removeOldProp?: boolean) {\n if (typeof target[oldProp] === 'undefined') return;\n\n // If old prop has value, aka set in component, call handleDeprecationWarning()\n if (target[oldProp]) {\n handleDeprecationWarning(target, oldProp, 'prop');\n }\n\n target[newProp] = target[oldProp];\n\n if (removeOldProp) {\n delete target[oldProp];\n }\n}\n\nexport function handleDeprecationWarning(\n target: object,\n deprecatedItemName: string,\n deprecatedItemType: 'function' | 'prop' | 'method' | 'event'\n) {\n if (window.location.hostname === 'localhost' || window.location.host === 'stack.q2developer.com') {\n if (target[deprecatedItemName] === 'undefined') return;\n\n const componentName = target.constructor.name.toLowerCase().slice(2);\n\n switch (deprecatedItemType) {\n case 'prop':\n if (deprecatedItemName === 'size' && componentName === 'btn') {\n console.warn(\n `The property of size in q2-btn should not be typeof number, or typeof string containing a number. This functionality will be deprecated in an upcoming release. Instead, please use the value 'undefined', or typeof string with any of the following values: \"small\" / \"medium\" / \"large\" `\n );\n } else {\n console.warn(\n `The property ${deprecatedItemName} in q2-${componentName} has been marked for deprecation and will be removed in an upcoming major release.`\n );\n }\n break;\n\n case 'function':\n console.warn(\n `The function ${deprecatedItemName} in ${componentName} has been marked for deprecation and will be removed in an upcoming major release.`\n );\n break;\n\n case 'method':\n console.warn(\n `The method ${deprecatedItemName} in ${componentName} has been marked for deprecation and will be removed in an upcoming major release.`\n );\n break;\n\n case 'event':\n console.warn(\n `The event ${deprecatedItemName} in ${componentName} has been marked for deprecation and will be removed in an upcoming major release.`\n );\n break;\n\n default:\n console.error(\n `handleDeprecationWarning --> No type found for desired deprecation: ${deprecatedItemName} in q2-${componentName}: deprecatedItemType = ${deprecatedItemName}`\n );\n }\n }\n}\n\nexport function messagesDOM(target: FormFieldTypes) {\n const type = target.hasError ? 'danger' : 'info';\n\n return (\n <div class=\"messages-container\">\n <q2-message\n appearance=\"minimal\"\n description\n type={type}\n test-id=\"message\"\n >\n <ul id={target.inputDescribedBy}>\n {target.messages.map(message => (\n <li test-id=\"messageListItem\">{loc(message)}</li>\n ))}\n </ul>\n </q2-message>\n </div>\n );\n}\n\nexport function setMessageHeight(target: FormFieldTypes) {\n const messageContainer = (target.hostElement.shadowRoot as ShadowRoot).querySelector<HTMLDivElement>(\n '.messages-container'\n );\n const q2Message = messageContainer.querySelector('q2-message');\n nextPaint(() => {\n const height = target.showMessages && target.hasFocus ? q2Message.getBoundingClientRect().height : 0;\n\n if (messageContainer.style.getPropertyValue('height') === `${height}px`) return;\n\n if (height === 0) {\n q2Message.classList.add('invisible');\n messageContainer.style.removeProperty('height');\n } else {\n q2Message.classList.remove('invisible');\n messageContainer.style.setProperty('height', `${height}px`);\n }\n });\n}\n\nexport const resizeIframe = () => {\n return window.TectonElements?.resizeIframe?.();\n};\n\n// Handling color attribute (deprecated)\nexport const handleColor = (target: Q2Btn) => {\n if (!target.intent && ['primary', 'secondary'].includes(target.color)) {\n target.intent = `workflow-${target.color}` as HTMLQ2BtnElement['intent'];\n target.color = undefined;\n }\n};\n"],"version":3}
@@ -19269,4 +19269,4 @@ Object.keys(_index245).forEach(function (key) {
19269
19269
 
19270
19270
  exports.dateFns = dateFns;
19271
19271
 
19272
- //# sourceMappingURL=index-c9a86a33.js.map
19272
+ //# sourceMappingURL=index-f69742cf.js.map