q2-tecton-elements 1.72.0 → 1.73.1

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 (392) hide show
  1. package/dist/bundle-report.json +39545 -34361
  2. package/dist/cjs/{charting-ClN1ldqv.js → charting-CdNTrVBe.js} +80 -0
  3. package/dist/cjs/click-elsewhere_3.cjs.entry.js +81 -14
  4. package/dist/cjs/{dataSample-BYR-wrOn.js → dataSample-B4blhlH4.js} +1 -1
  5. package/dist/cjs/date-picker-helpers-UYvPn98R.js +257 -0
  6. package/dist/cjs/{index-BY3aao8R.js → index-BqyWHpNu.js} +1 -1
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/q2-action-group.cjs.entry.js +1 -1
  9. package/dist/cjs/q2-action-sheet.cjs.entry.js +98 -18
  10. package/dist/cjs/q2-avatar.cjs.entry.js +34 -1
  11. package/dist/cjs/q2-badge_2.cjs.entry.js +3 -3
  12. package/dist/cjs/q2-btn_2.cjs.entry.js +2 -2
  13. package/dist/cjs/q2-calendar.cjs.entry.js +9 -4
  14. package/dist/cjs/q2-card-image.cjs.entry.js +3 -3
  15. package/dist/cjs/q2-card.cjs.entry.js +1 -1
  16. package/dist/cjs/q2-carousel-pane.cjs.entry.js +3 -3
  17. package/dist/cjs/q2-carousel.cjs.entry.js +20 -6
  18. package/dist/cjs/q2-chart-area.cjs.entry.js +38 -7
  19. package/dist/cjs/q2-chart-bar.cjs.entry.js +39 -8
  20. package/dist/cjs/q2-chart-donut.cjs.entry.js +31 -13
  21. package/dist/cjs/q2-checkbox-group.cjs.entry.js +2 -2
  22. package/dist/cjs/q2-checkbox_2.cjs.entry.js +8 -5
  23. package/dist/cjs/q2-context.cjs.entry.js +4 -4
  24. package/dist/cjs/q2-currency.cjs.entry.js +1 -1
  25. package/dist/cjs/q2-data-table.cjs.entry.js +7 -7
  26. package/dist/cjs/q2-date-calendar.cjs.entry.js +452 -0
  27. package/dist/cjs/q2-date-picker_2.cjs.entry.js +968 -0
  28. package/dist/cjs/q2-detail.cjs.entry.js +2 -2
  29. package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
  30. package/dist/cjs/q2-dropdown.cjs.entry.js +3 -3
  31. package/dist/cjs/q2-editable-field.cjs.entry.js +20 -7
  32. package/dist/cjs/q2-example.cjs.entry.js +1 -1
  33. package/dist/cjs/q2-file-picker.cjs.entry.js +2 -2
  34. package/dist/cjs/q2-form.cjs.entry.js +1 -1
  35. package/dist/cjs/q2-formatted-text.cjs.entry.js +1 -1
  36. package/dist/cjs/q2-icon.cjs.entry.js +1 -1
  37. package/dist/cjs/q2-item.cjs.entry.js +20 -2
  38. package/dist/cjs/q2-legend.cjs.entry.js +1 -1
  39. package/dist/cjs/q2-link_2.cjs.entry.js +2 -2
  40. package/dist/cjs/q2-loc.cjs.entry.js +1 -1
  41. package/dist/cjs/q2-message.cjs.entry.js +3 -3
  42. package/dist/cjs/q2-meter.cjs.entry.js +2 -2
  43. package/dist/cjs/q2-modal.cjs.entry.js +2 -2
  44. package/dist/cjs/q2-month-picker.cjs.entry.js +3 -3
  45. package/dist/cjs/q2-mutation-observer.cjs.entry.js +1 -1
  46. package/dist/cjs/q2-option.cjs.entry.js +1 -1
  47. package/dist/cjs/q2-otp.cjs.entry.js +5 -5
  48. package/dist/cjs/q2-pagination.cjs.entry.js +12 -6
  49. package/dist/cjs/q2-pill.cjs.entry.js +8 -5
  50. package/dist/cjs/q2-radio-group.cjs.entry.js +2 -2
  51. package/dist/cjs/q2-radio.cjs.entry.js +2 -2
  52. package/dist/cjs/q2-relative-time.cjs.entry.js +2 -2
  53. package/dist/cjs/q2-resize-observer.cjs.entry.js +1 -1
  54. package/dist/cjs/q2-search.cjs.entry.js +3 -3
  55. package/dist/cjs/q2-section.cjs.entry.js +3 -3
  56. package/dist/cjs/q2-select.cjs.entry.js +8 -4
  57. package/dist/cjs/q2-stepper-pane.cjs.entry.js +2 -2
  58. package/dist/cjs/q2-stepper-vertical.cjs.entry.js +2 -2
  59. package/dist/cjs/q2-stepper.cjs.entry.js +2 -2
  60. package/dist/cjs/q2-surface.cjs.entry.js +1 -1
  61. package/dist/cjs/q2-tab-container.cjs.entry.js +2 -2
  62. package/dist/cjs/q2-tab-pane.cjs.entry.js +1 -1
  63. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  64. package/dist/cjs/q2-textarea.cjs.entry.js +2 -2
  65. package/dist/cjs/q2-toast.cjs.entry.js +1 -1
  66. package/dist/cjs/q2-tooltip.cjs.entry.js +1 -1
  67. package/dist/cjs/{sectorHelper-9TWL-3dw.js → sectorHelper-CxhDl5ql.js} +1 -1
  68. package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -2
  69. package/dist/collection/collection-manifest.json +2 -0
  70. package/dist/collection/components/q2-action-sheet/q2-action-sheet.css +52 -0
  71. package/dist/collection/components/q2-action-sheet/q2-action-sheet.js +98 -18
  72. package/dist/collection/components/q2-action-sheet/test/q2-action-sheet-test.vr.js +124 -0
  73. package/dist/collection/components/q2-avatar/q2-avatar.js +34 -1
  74. package/dist/collection/components/q2-avatar/test/q2-avatar-test.vr.js +79 -4
  75. package/dist/collection/components/q2-btn/q2-btn.css +84 -136
  76. package/dist/collection/components/q2-btn/q2-btn.js +10 -4
  77. package/dist/collection/components/q2-btn/test/q2-btn-test.vr.js +99 -43
  78. package/dist/collection/components/q2-calendar/q2-calendar.js +16 -5
  79. package/dist/collection/components/q2-calendar/q2-month-picker.js +2 -2
  80. package/dist/collection/components/q2-calendar/test/q2-calendar-test.vr.js +3 -13
  81. package/dist/collection/components/q2-card-image/q2-card-image.js +2 -2
  82. package/dist/collection/components/q2-carousel/q2-carousel.js +19 -5
  83. package/dist/collection/components/q2-carousel/test/q2-carousel-test.vr.js +32 -0
  84. package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js +2 -2
  85. package/dist/collection/components/q2-chart-area/q2-chart-area.css +11 -0
  86. package/dist/collection/components/q2-chart-area/q2-chart-area.js +53 -7
  87. package/dist/collection/components/q2-chart-area/test/q2-chart-area-test.vr.js +14 -0
  88. package/dist/collection/components/q2-chart-bar/q2-chart-bar.css +11 -0
  89. package/dist/collection/components/q2-chart-bar/q2-chart-bar.js +50 -4
  90. package/dist/collection/components/q2-chart-bar/test/q2-chart-bar-test.vr.js +14 -0
  91. package/dist/collection/components/q2-chart-donut/q2-chart-donut.js +30 -10
  92. package/dist/collection/components/q2-chart-donut/test/q2-chart-donut-test.vr.js +25 -0
  93. package/dist/collection/components/q2-checkbox/q2-checkbox.js +6 -3
  94. package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.js +6 -3
  95. package/dist/collection/components/q2-context/q2-context.js +3 -3
  96. package/dist/collection/components/q2-context/test/q2-context-test.vr.js +3 -3
  97. package/dist/collection/components/q2-currency/q2-currency.js +1 -1
  98. package/dist/collection/components/q2-data-table/q2-data-table.css +3 -0
  99. package/dist/collection/components/q2-data-table/q2-data-table.js +5 -5
  100. package/dist/collection/components/q2-data-table/test/q2-data-table-test.vr.js +47 -0
  101. package/dist/collection/components/q2-date-calendar/q2-date-calendar.css +393 -0
  102. package/dist/collection/components/q2-date-calendar/q2-date-calendar.js +1022 -0
  103. package/dist/collection/components/q2-date-calendar/test/q2-date-calendar-test.vr.js +111 -0
  104. package/dist/collection/components/q2-date-picker/q2-date-picker.css +138 -0
  105. package/dist/collection/components/q2-date-picker/q2-date-picker.js +2010 -0
  106. package/dist/collection/components/q2-date-picker/test/q2-date-picker-test.vr.js +179 -0
  107. package/dist/collection/components/q2-detail/q2-detail.js +1 -1
  108. package/dist/collection/components/q2-dropdown/q2-dropdown.js +5 -5
  109. package/dist/collection/components/q2-editable-field/q2-editable-field.js +27 -8
  110. package/dist/collection/components/q2-example/q2-example.js +1 -1
  111. package/dist/collection/components/q2-file-picker/q2-file-picker.js +1 -1
  112. package/dist/collection/components/q2-form/q2-form.js +1 -1
  113. package/dist/collection/components/q2-formatted-text/q2-formatted-text.js +1 -1
  114. package/dist/collection/components/q2-input/formatting/phone-number-formats.js +1 -1
  115. package/dist/collection/components/q2-input/q2-input.js +6 -3
  116. package/dist/collection/components/q2-item/q2-item.js +19 -1
  117. package/dist/collection/components/q2-item/test/q2-item-test.vr.js +2 -2
  118. package/dist/collection/components/q2-legend/q2-legend.js +1 -1
  119. package/dist/collection/components/q2-list/q2-list.js +1 -1
  120. package/dist/collection/components/q2-message/q2-message.css +1 -1
  121. package/dist/collection/components/q2-message/q2-message.js +1 -1
  122. package/dist/collection/components/q2-message/test/q2-message-test.vr.js +11 -2
  123. package/dist/collection/components/q2-meter/q2-meter.js +1 -1
  124. package/dist/collection/components/q2-modal/q2-modal.js +1 -1
  125. package/dist/collection/components/q2-modal/test/q2-modal-test.vr.js +7 -7
  126. package/dist/collection/components/q2-mutation-observer/q2-mutation-observer.js +1 -1
  127. package/dist/collection/components/q2-optgroup/q2-optgroup.js +1 -1
  128. package/dist/collection/components/q2-option-list/q2-option-list.js +36 -4
  129. package/dist/collection/components/q2-otp/q2-otp.js +4 -4
  130. package/dist/collection/components/q2-pagination/q2-pagination.css +17 -0
  131. package/dist/collection/components/q2-pagination/q2-pagination.js +10 -4
  132. package/dist/collection/components/q2-pagination/test/q2-pagination-test.vr.js +39 -0
  133. package/dist/collection/components/q2-pill/q2-pill.css +14 -10
  134. package/dist/collection/components/q2-pill/q2-pill.js +6 -3
  135. package/dist/collection/components/q2-pill/test/q2-pill-test.vr.js +25 -0
  136. package/dist/collection/components/q2-popover/q2-popover.css +1 -0
  137. package/dist/collection/components/q2-popover/q2-popover.js +43 -8
  138. package/dist/collection/components/q2-radio/q2-radio.js +5 -2
  139. package/dist/collection/components/q2-radio-group/q2-radio-group.js +6 -3
  140. package/dist/collection/components/q2-relative-time/q2-relative-time.js +1 -1
  141. package/dist/collection/components/q2-resize-observer/q2-resize-observer.js +1 -1
  142. package/dist/collection/components/q2-search/q2-search.js +6 -3
  143. package/dist/collection/components/q2-section/q2-section.js +2 -2
  144. package/dist/collection/components/q2-select/q2-select.js +12 -5
  145. package/dist/collection/components/q2-stepper/q2-stepper.js +1 -1
  146. package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js +1 -1
  147. package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js +1 -1
  148. package/dist/collection/components/q2-surface/q2-surface.js +1 -1
  149. package/dist/collection/components/q2-surface/test/q2-surface-test.vr.js +2 -2
  150. package/dist/collection/components/q2-tab-container/q2-tab-container.js +1 -1
  151. package/dist/collection/components/q2-tab-pane/q2-tab-pane.js +1 -1
  152. package/dist/collection/components/q2-tag/q2-tag.js +6 -3
  153. package/dist/collection/components/q2-textarea/q2-textarea.js +6 -3
  154. package/dist/collection/components/q2-tooltip/test/q2-tooltip-test.vr.js +1 -1
  155. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +2 -2
  156. package/dist/collection/utils/chart-keyboard.js +76 -0
  157. package/dist/collection/utils/date-picker/date-picker-helpers.js +239 -0
  158. package/dist/collection/utils/date-picker/date-picker-types.js +1 -0
  159. package/dist/collection/utils/index.js +1 -1
  160. package/dist/components/charting.js +1603 -1532
  161. package/dist/components/dataSample.js +7 -7
  162. package/dist/components/index.js +57 -53
  163. package/dist/components/index2.js +2 -2
  164. package/dist/components/q2-action-sheet.js +224 -103
  165. package/dist/components/q2-avatar2.js +41 -27
  166. package/dist/components/q2-btn2.js +2 -2
  167. package/dist/components/q2-calendar.js +6 -3
  168. package/dist/components/q2-card-image.js +2 -2
  169. package/dist/components/q2-carousel-pane2.js +3 -3
  170. package/dist/components/q2-carousel.js +37 -24
  171. package/dist/components/q2-chart-area.js +415 -369
  172. package/dist/components/q2-chart-bar.js +193 -148
  173. package/dist/components/q2-chart-donut.js +185 -158
  174. package/dist/components/q2-checkbox-group.js +6 -6
  175. package/dist/components/q2-checkbox2.js +11 -11
  176. package/dist/components/q2-context.js +20 -20
  177. package/dist/components/q2-currency.js +9 -9
  178. package/dist/components/q2-data-table.js +111 -111
  179. package/dist/components/q2-date-calendar.d.ts +11 -0
  180. package/dist/components/q2-date-calendar.js +5 -0
  181. package/dist/components/q2-date-calendar2.js +678 -0
  182. package/dist/components/q2-date-picker.d.ts +11 -0
  183. package/dist/components/q2-date-picker.js +5 -0
  184. package/dist/components/q2-date-picker2.js +875 -0
  185. package/dist/components/q2-detail.js +3 -3
  186. package/dist/components/q2-dropdown.js +17 -17
  187. package/dist/components/q2-editable-field.js +16 -5
  188. package/dist/components/q2-example.js +11 -11
  189. package/dist/components/q2-file-picker.js +1 -1
  190. package/dist/components/q2-form.js +6 -6
  191. package/dist/components/q2-formatted-text.js +2 -2
  192. package/dist/components/q2-input2.js +6 -6
  193. package/dist/components/q2-item2.js +32 -22
  194. package/dist/components/q2-legend2.js +7 -7
  195. package/dist/components/q2-list2.js +6 -6
  196. package/dist/components/q2-message2.js +10 -10
  197. package/dist/components/q2-meter.js +7 -7
  198. package/dist/components/q2-modal.js +22 -22
  199. package/dist/components/q2-month-picker.js +17 -17
  200. package/dist/components/q2-mutation-observer.js +1 -1
  201. package/dist/components/q2-optgroup2.js +7 -7
  202. package/dist/components/q2-option-list2.js +55 -34
  203. package/dist/components/q2-otp.js +8 -8
  204. package/dist/components/q2-pagination.js +70 -68
  205. package/dist/components/q2-pill.js +51 -46
  206. package/dist/components/q2-popover2.js +70 -49
  207. package/dist/components/q2-radio-group.js +7 -7
  208. package/dist/components/q2-radio.js +6 -6
  209. package/dist/components/q2-relative-time.js +1 -1
  210. package/dist/components/q2-resize-observer2.js +1 -1
  211. package/dist/components/q2-search.js +5 -5
  212. package/dist/components/q2-section.js +17 -17
  213. package/dist/components/q2-select2.js +2 -2
  214. package/dist/components/q2-stepper-pane.js +29 -29
  215. package/dist/components/q2-stepper-vertical.js +4 -4
  216. package/dist/components/q2-stepper.js +57 -57
  217. package/dist/components/q2-surface.js +3 -3
  218. package/dist/components/q2-tab-container.js +21 -21
  219. package/dist/components/q2-tab-pane.js +6 -6
  220. package/dist/components/q2-tag2.js +8 -6
  221. package/dist/components/q2-textarea.js +3 -3
  222. package/dist/components/sectorHelper.js +78 -78
  223. package/dist/components/tecton-tab-pane.js +10 -10
  224. package/dist/esm/{charting-DOZct-UB.js → charting-DFXJklqs.js} +79 -1
  225. package/dist/esm/click-elsewhere_3.entry.js +81 -14
  226. package/dist/esm/{dataSample-Dm1zpQNi.js → dataSample-CP_VKNqt.js} +1 -1
  227. package/dist/esm/date-picker-helpers-D8QnN_AS.js +242 -0
  228. package/dist/esm/{index-DJw6Feh0.js → index-CP8pXJ-l.js} +1 -1
  229. package/dist/esm/loader.js +1 -1
  230. package/dist/esm/q2-action-group.entry.js +1 -1
  231. package/dist/esm/q2-action-sheet.entry.js +99 -19
  232. package/dist/esm/q2-avatar.entry.js +34 -1
  233. package/dist/esm/q2-badge_2.entry.js +3 -3
  234. package/dist/esm/q2-btn_2.entry.js +2 -2
  235. package/dist/esm/q2-calendar.entry.js +9 -4
  236. package/dist/esm/q2-card-image.entry.js +3 -3
  237. package/dist/esm/q2-card.entry.js +1 -1
  238. package/dist/esm/q2-carousel-pane.entry.js +3 -3
  239. package/dist/esm/q2-carousel.entry.js +20 -6
  240. package/dist/esm/q2-chart-area.entry.js +38 -7
  241. package/dist/esm/q2-chart-bar.entry.js +39 -8
  242. package/dist/esm/q2-chart-donut.entry.js +31 -13
  243. package/dist/esm/q2-checkbox-group.entry.js +2 -2
  244. package/dist/esm/q2-checkbox_2.entry.js +8 -5
  245. package/dist/esm/q2-context.entry.js +4 -4
  246. package/dist/esm/q2-currency.entry.js +1 -1
  247. package/dist/esm/q2-data-table.entry.js +7 -7
  248. package/dist/esm/q2-date-calendar.entry.js +450 -0
  249. package/dist/esm/q2-date-picker_2.entry.js +965 -0
  250. package/dist/esm/q2-detail.entry.js +2 -2
  251. package/dist/esm/q2-dropdown-item.entry.js +1 -1
  252. package/dist/esm/q2-dropdown.entry.js +3 -3
  253. package/dist/esm/q2-editable-field.entry.js +20 -7
  254. package/dist/esm/q2-example.entry.js +1 -1
  255. package/dist/esm/q2-file-picker.entry.js +2 -2
  256. package/dist/esm/q2-form.entry.js +1 -1
  257. package/dist/esm/q2-formatted-text.entry.js +1 -1
  258. package/dist/esm/q2-icon.entry.js +1 -1
  259. package/dist/esm/q2-item.entry.js +20 -2
  260. package/dist/esm/q2-legend.entry.js +1 -1
  261. package/dist/esm/q2-link_2.entry.js +2 -2
  262. package/dist/esm/q2-loc.entry.js +1 -1
  263. package/dist/esm/q2-message.entry.js +3 -3
  264. package/dist/esm/q2-meter.entry.js +2 -2
  265. package/dist/esm/q2-modal.entry.js +2 -2
  266. package/dist/esm/q2-month-picker.entry.js +3 -3
  267. package/dist/esm/q2-mutation-observer.entry.js +1 -1
  268. package/dist/esm/q2-option.entry.js +1 -1
  269. package/dist/esm/q2-otp.entry.js +5 -5
  270. package/dist/esm/q2-pagination.entry.js +12 -6
  271. package/dist/esm/q2-pill.entry.js +8 -5
  272. package/dist/esm/q2-radio-group.entry.js +2 -2
  273. package/dist/esm/q2-radio.entry.js +2 -2
  274. package/dist/esm/q2-relative-time.entry.js +2 -2
  275. package/dist/esm/q2-resize-observer.entry.js +1 -1
  276. package/dist/esm/q2-search.entry.js +3 -3
  277. package/dist/esm/q2-section.entry.js +3 -3
  278. package/dist/esm/q2-select.entry.js +8 -4
  279. package/dist/esm/q2-stepper-pane.entry.js +2 -2
  280. package/dist/esm/q2-stepper-vertical.entry.js +2 -2
  281. package/dist/esm/q2-stepper.entry.js +2 -2
  282. package/dist/esm/q2-surface.entry.js +1 -1
  283. package/dist/esm/q2-tab-container.entry.js +2 -2
  284. package/dist/esm/q2-tab-pane.entry.js +1 -1
  285. package/dist/esm/q2-tecton-elements.js +1 -1
  286. package/dist/esm/q2-textarea.entry.js +2 -2
  287. package/dist/esm/q2-toast.entry.js +1 -1
  288. package/dist/esm/q2-tooltip.entry.js +1 -1
  289. package/dist/esm/{sectorHelper--RMGWGAy.js → sectorHelper-DBtkWtpl.js} +1 -1
  290. package/dist/esm/tecton-tab-pane.entry.js +2 -2
  291. package/dist/q2-tecton-elements/{charting-DOZct-UB.js → charting-DFXJklqs.js} +1625 -1554
  292. package/dist/q2-tecton-elements/click-elsewhere_3.entry.js +85 -43
  293. package/dist/q2-tecton-elements/{dataSample-Dm1zpQNi.js → dataSample-CP_VKNqt.js} +33 -33
  294. package/dist/q2-tecton-elements/date-picker-helpers-D8QnN_AS.js +153 -0
  295. package/dist/q2-tecton-elements/{index-DJw6Feh0.js → index-CP8pXJ-l.js} +1 -1
  296. package/dist/q2-tecton-elements/q2-action-group.entry.js +1 -1
  297. package/dist/q2-tecton-elements/q2-action-sheet.entry.js +169 -84
  298. package/dist/q2-tecton-elements/q2-avatar.entry.js +24 -10
  299. package/dist/q2-tecton-elements/q2-badge_2.entry.js +6 -6
  300. package/dist/q2-tecton-elements/q2-btn_2.entry.js +23 -23
  301. package/dist/q2-tecton-elements/q2-calendar.entry.js +7 -4
  302. package/dist/q2-tecton-elements/q2-card-image.entry.js +3 -3
  303. package/dist/q2-tecton-elements/q2-card.entry.js +1 -1
  304. package/dist/q2-tecton-elements/q2-carousel-pane.entry.js +4 -4
  305. package/dist/q2-tecton-elements/q2-carousel.entry.js +24 -11
  306. package/dist/q2-tecton-elements/q2-chart-area.entry.js +187 -141
  307. package/dist/q2-tecton-elements/q2-chart-bar.entry.js +377 -333
  308. package/dist/q2-tecton-elements/q2-chart-donut.entry.js +184 -158
  309. package/dist/q2-tecton-elements/q2-checkbox-group.entry.js +7 -7
  310. package/dist/q2-tecton-elements/q2-checkbox_2.entry.js +20 -18
  311. package/dist/q2-tecton-elements/q2-context.entry.js +21 -21
  312. package/dist/q2-tecton-elements/q2-currency.entry.js +9 -9
  313. package/dist/q2-tecton-elements/q2-data-table.entry.js +7 -7
  314. package/dist/q2-tecton-elements/q2-date-calendar.entry.js +438 -0
  315. package/dist/q2-tecton-elements/q2-date-picker_2.entry.js +792 -0
  316. package/dist/q2-tecton-elements/q2-detail.entry.js +4 -4
  317. package/dist/q2-tecton-elements/q2-dropdown-item.entry.js +1 -1
  318. package/dist/q2-tecton-elements/q2-dropdown.entry.js +16 -16
  319. package/dist/q2-tecton-elements/q2-editable-field.entry.js +17 -6
  320. package/dist/q2-tecton-elements/q2-example.entry.js +1 -1
  321. package/dist/q2-tecton-elements/q2-file-picker.entry.js +2 -2
  322. package/dist/q2-tecton-elements/q2-form.entry.js +2 -2
  323. package/dist/q2-tecton-elements/q2-formatted-text.entry.js +2 -2
  324. package/dist/q2-tecton-elements/q2-icon.entry.js +1 -1
  325. package/dist/q2-tecton-elements/q2-item.entry.js +26 -16
  326. package/dist/q2-tecton-elements/q2-legend.entry.js +2 -2
  327. package/dist/q2-tecton-elements/q2-link_2.entry.js +7 -7
  328. package/dist/q2-tecton-elements/q2-loc.entry.js +1 -1
  329. package/dist/q2-tecton-elements/q2-message.entry.js +29 -29
  330. package/dist/q2-tecton-elements/q2-meter.entry.js +8 -8
  331. package/dist/q2-tecton-elements/q2-modal.entry.js +18 -18
  332. package/dist/q2-tecton-elements/q2-month-picker.entry.js +14 -14
  333. package/dist/q2-tecton-elements/q2-mutation-observer.entry.js +1 -1
  334. package/dist/q2-tecton-elements/q2-option.entry.js +1 -1
  335. package/dist/q2-tecton-elements/q2-otp.entry.js +9 -9
  336. package/dist/q2-tecton-elements/q2-pagination.entry.js +51 -49
  337. package/dist/q2-tecton-elements/q2-pill.entry.js +22 -17
  338. package/dist/q2-tecton-elements/q2-radio-group.entry.js +8 -8
  339. package/dist/q2-tecton-elements/q2-radio.entry.js +7 -7
  340. package/dist/q2-tecton-elements/q2-relative-time.entry.js +6 -6
  341. package/dist/q2-tecton-elements/q2-resize-observer.entry.js +13 -13
  342. package/dist/q2-tecton-elements/q2-search.entry.js +31 -31
  343. package/dist/q2-tecton-elements/q2-section.entry.js +20 -20
  344. package/dist/q2-tecton-elements/q2-select.entry.js +3 -3
  345. package/dist/q2-tecton-elements/q2-stepper-pane.entry.js +10 -10
  346. package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js +9 -9
  347. package/dist/q2-tecton-elements/q2-stepper.entry.js +45 -45
  348. package/dist/q2-tecton-elements/q2-surface.entry.js +15 -15
  349. package/dist/q2-tecton-elements/q2-tab-container.entry.js +20 -20
  350. package/dist/q2-tecton-elements/q2-tab-pane.entry.js +9 -9
  351. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  352. package/dist/q2-tecton-elements/q2-textarea.entry.js +3 -3
  353. package/dist/q2-tecton-elements/q2-toast.entry.js +1 -1
  354. package/dist/q2-tecton-elements/q2-tooltip.entry.js +1 -1
  355. package/dist/q2-tecton-elements/{sectorHelper--RMGWGAy.js → sectorHelper-DBtkWtpl.js} +56 -56
  356. package/dist/q2-tecton-elements/tecton-tab-pane.entry.js +9 -9
  357. package/dist/types/components/q2-action-sheet/q2-action-sheet.d.ts +21 -1
  358. package/dist/types/components/q2-action-sheet/test/q2-action-sheet-test.vr.d.ts +1 -0
  359. package/dist/types/components/q2-avatar/q2-avatar.d.ts +5 -0
  360. package/dist/types/components/q2-btn/q2-btn.d.ts +7 -3
  361. package/dist/types/components/q2-calendar/q2-calendar.d.ts +10 -2
  362. package/dist/types/components/q2-carousel/q2-carousel.d.ts +5 -0
  363. package/dist/types/components/q2-chart-area/q2-chart-area.d.ts +11 -2
  364. package/dist/types/components/q2-chart-bar/q2-chart-bar.d.ts +9 -0
  365. package/dist/types/components/q2-chart-donut/q2-chart-donut.d.ts +1 -0
  366. package/dist/types/components/q2-checkbox/q2-checkbox.d.ts +4 -3
  367. package/dist/types/components/q2-checkbox-group/q2-checkbox-group.d.ts +4 -2
  368. package/dist/types/components/q2-date-calendar/q2-date-calendar.d.ts +122 -0
  369. package/dist/types/components/q2-date-calendar/test/q2-date-calendar-test.vr.d.ts +1 -0
  370. package/dist/types/components/q2-date-picker/q2-date-picker.d.ts +304 -0
  371. package/dist/types/components/q2-date-picker/test/q2-date-picker-test.vr.d.ts +1 -0
  372. package/dist/types/components/q2-dropdown/q2-dropdown.d.ts +3 -3
  373. package/dist/types/components/q2-editable-field/q2-editable-field.d.ts +14 -1
  374. package/dist/types/components/q2-input/q2-input.d.ts +4 -2
  375. package/dist/types/components/q2-item/q2-item.d.ts +3 -0
  376. package/dist/types/components/q2-option-list/q2-option-list.d.ts +1 -0
  377. package/dist/types/components/q2-popover/q2-popover.d.ts +4 -0
  378. package/dist/types/components/q2-radio/q2-radio.d.ts +3 -2
  379. package/dist/types/components/q2-radio-group/q2-radio-group.d.ts +4 -2
  380. package/dist/types/components/q2-search/q2-search.d.ts +3 -1
  381. package/dist/types/components/q2-select/q2-select.d.ts +4 -2
  382. package/dist/types/components/q2-textarea/q2-textarea.d.ts +4 -2
  383. package/dist/types/components.d.ts +858 -49
  384. package/dist/types/global.d.ts +1 -0
  385. package/dist/types/index.d.ts +1 -0
  386. package/dist/types/utils/chart-keyboard.d.ts +16 -0
  387. package/dist/types/utils/date-picker/date-picker-helpers.d.ts +47 -0
  388. package/dist/types/utils/date-picker/date-picker-types.d.ts +42 -0
  389. package/package.json +3 -3
  390. package/dist/cjs/q2-optgroup.cjs.entry.js +0 -70
  391. package/dist/esm/q2-optgroup.entry.js +0 -68
  392. package/dist/q2-tecton-elements/q2-optgroup.entry.js +0 -88
@@ -1,4 +1,4 @@
1
- import { h, Fragment, } from "@stencil/core";
1
+ import { h } from "@stencil/core";
2
2
  import { loc, waitForNextPaint } from "../../utils/index";
3
3
  import sanitizeHTMLString, { sanitizeActionSheetSlotHtml } from "../../utils/sanitize-html-string";
4
4
  import mirrorEmit from "../../utils/mirror-emit";
@@ -9,9 +9,13 @@ import mirrorEmit from "../../utils/mirror-emit";
9
9
  */
10
10
  export class Q2ActionSheet {
11
11
  constructor() {
12
+ // #region Own Properties
13
+ this.bodyOverflow = '';
12
14
  this.initialSelectedOptions = [];
13
15
  this.maxHeight = 0.75;
14
16
  this.minHeight = 0.2;
17
+ this.rootOverflow = '';
18
+ this.selectedDate = {};
15
19
  this.selectedOptions = { values: [], value: '' };
16
20
  // #endregion
17
21
  // #region State Properties
@@ -168,6 +172,26 @@ export class Q2ActionSheet {
168
172
  return;
169
173
  this.onCancel(event);
170
174
  };
175
+ this.onDatePickerCancel = (event) => {
176
+ event.stopPropagation();
177
+ this.onCancel(event);
178
+ };
179
+ this.onDatePickerChange = (event) => {
180
+ event.stopPropagation();
181
+ this.selectedDate = event.detail;
182
+ };
183
+ this.onDatePickerClose = (event) => {
184
+ event.stopPropagation();
185
+ const detail = event.detail || undefined;
186
+ if (detail === null || detail === void 0 ? void 0 : detail.error) {
187
+ this.hide({ error: detail.error, type: 'confirm' });
188
+ return;
189
+ }
190
+ const hasSelection = this.selectedDate.value !== undefined ||
191
+ this.selectedDate.rangeStart !== undefined ||
192
+ this.selectedDate.rangeEnd !== undefined;
193
+ this.hide({ ...this.selectedDate, type: hasSelection ? 'confirm' : 'cancel' });
194
+ };
171
195
  this.onListChange = (event) => {
172
196
  this.selectedOptions = event.detail;
173
197
  };
@@ -187,16 +211,47 @@ export class Q2ActionSheet {
187
211
  this.onListDone();
188
212
  }
189
213
  };
214
+ this.onViewportResize = () => {
215
+ requestAnimationFrame(() => this.updateDialogMinMaxHeight());
216
+ };
190
217
  // #endregion
191
218
  // #region Render Methods
219
+ this.renderDatePicker = ({ data }) => {
220
+ const props = data.datePickerProps;
221
+ return (h("div", { class: "content date-picker-content", ref: el => (this.contentElement = el) }, h("q2-date-picker", { _actionSheet: true, open: true, calendarLabel: props.calendarLabel, closeDelay: props.closeDelay, cutoffTime: props.cutoffTime, daysOfWeekChecksum: props.daysOfWeekChecksum, disclaimer: props.disclaimer, endDate: props.endDate, displayFormat: props.displayFormat, invalidDates: props.invalidDates, locale: props.locale, mode: props.mode, rangeEnd: props.rangeEnd, rangeStart: props.rangeStart, startDate: props.startDate, validDates: props.validDates, value: props.value, onTctCancel: this.onDatePickerCancel, onTctChange: this.onDatePickerChange, onTctClose: this.onDatePickerClose })));
222
+ };
192
223
  this.renderList = ({ data }) => {
193
224
  var _a;
194
225
  const { listProps, slotsHtml = [] } = data;
195
- return (h(Fragment, null, slotsHtml
196
- .filter(entry => entry.slot === 'top')
197
- .map(entry => (h("div", { innerHTML: sanitizeActionSheetSlotHtml(entry.html) }))), h("div", { class: "content", ref: el => (this.contentElement = el) }, h("q2-option-list", { ref: el => (this.optionListElement = el), multiple: listProps.multiple, label: ((_a = this.data) === null || _a === void 0 ? void 0 : _a.title) || this.title, noSelect: listProps.noSelect, onChange: this.onListChange, onPopoverState: this.onListPopoverStateChange, selectedOptions: listProps.selectedOptions }, h("slot", null))), h("footer", null, listProps.multiple && (h("q2-btn", { ref: el => (this.doneButtonElement = el), "test-id": "btnDone", intent: "workflow-primary", onClick: this.onListDone }, loc('tecton.element.actionSheet.done')))), slotsHtml
198
- .filter(entry => entry.slot === 'bottom')
199
- .map(entry => (h("div", { innerHTML: sanitizeActionSheetSlotHtml(entry.html) })))));
226
+ let scrollTopSlots = false;
227
+ const slots = slotsHtml.map(entry => {
228
+ var _a;
229
+ const html = sanitizeActionSheetSlotHtml(entry.html);
230
+ const container = document.createElement('div');
231
+ container.innerHTML = html;
232
+ const marked = ((_a = container.firstElementChild) === null || _a === void 0 ? void 0 : _a.hasAttribute('data-action-sheet-scroll')) === true;
233
+ if (entry.slot === 'top' && marked)
234
+ scrollTopSlots = true;
235
+ return {
236
+ ...entry,
237
+ html,
238
+ scrolls: entry.slot === 'top' ? scrollTopSlots : marked,
239
+ };
240
+ });
241
+ // Bottom content joins the scroll area from the options through the last marker.
242
+ let scrollBottomSlots = false;
243
+ for (let index = slots.length - 1; index >= 0; index--) {
244
+ const entry = slots[index];
245
+ if (entry.slot !== 'bottom')
246
+ continue;
247
+ if (entry.scrolls)
248
+ scrollBottomSlots = true;
249
+ entry.scrolls = scrollBottomSlots;
250
+ }
251
+ const renderSlots = (position, scrolls) => slots
252
+ .filter(entry => entry.slot === position && entry.scrolls === scrolls)
253
+ .map(entry => (h("div", { class: "list-slot", innerHTML: entry.html })));
254
+ return (h("div", { class: "list-body" }, renderSlots('top', false), h("div", { class: "content", ref: el => (this.contentElement = el) }, renderSlots('top', true), h("q2-option-list", { ref: el => (this.optionListElement = el), multiple: listProps.multiple, label: ((_a = this.data) === null || _a === void 0 ? void 0 : _a.title) || this.title, noSelect: listProps.noSelect, onChange: this.onListChange, onPopoverState: this.onListPopoverStateChange, selectedOptions: listProps.selectedOptions }, h("slot", null)), renderSlots('bottom', true)), h("footer", null, listProps.multiple && (h("q2-btn", { ref: el => (this.doneButtonElement = el), "test-id": "btnDone", intent: "primary", onClick: this.onListDone }, loc('tecton.element.actionSheet.done')))), renderSlots('bottom', false)));
200
255
  };
201
256
  this.renderMessage = ({ data }) => {
202
257
  return (h("q2-message", { type: data.type }, data.title && h("h2", null, data.title), data.description && h("p", null, data.description)));
@@ -210,6 +265,9 @@ export class Q2ActionSheet {
210
265
  disconnectedCallback() {
211
266
  this.dialogElement.removeEventListener('cancel', this.onCancel);
212
267
  this.dialogElement.removeEventListener('keydown', this.handleDialogKeydown, true);
268
+ window.removeEventListener('resize', this.onViewportResize);
269
+ if (this.dialogElement.open)
270
+ this.restorePageScroll();
213
271
  }
214
272
  componentDidLoad() {
215
273
  this.dialogElement.addEventListener('cancel', this.onCancel);
@@ -222,6 +280,8 @@ export class Q2ActionSheet {
222
280
  async hide(data = { value: '', values: [], type: 'confirm' }) {
223
281
  mirrorEmit(this, ['close', 'tctClose'], data);
224
282
  this.renderStatus = 'is-closing';
283
+ window.removeEventListener('resize', this.onViewportResize);
284
+ this.restorePageScroll();
225
285
  this.dialogElement.addEventListener('transitionend', () => {
226
286
  if (this.renderStatus !== 'is-closing')
227
287
  return;
@@ -229,25 +289,38 @@ export class Q2ActionSheet {
229
289
  this.renderStatus = null;
230
290
  this.data = undefined;
231
291
  this.initialSelectedOptions = [];
292
+ this.selectedDate = {};
232
293
  this.selectedOptions = { values: [], value: '' };
233
294
  this.hidePostHook();
234
295
  }, { once: true });
235
296
  }
236
297
  async show() {
298
+ if (this.dialogElement.open)
299
+ return;
237
300
  this.showPreHook();
238
301
  await waitForNextPaint();
239
302
  this.updateDialogMinMaxHeight();
240
303
  this.storeInitialValues();
241
- if (this.dialogElement.open)
242
- return;
243
304
  this.dialogElement.showModal();
244
- this.renderStatus = 'is-opening';
245
- this.dialogElement.addEventListener('transitionend', () => {
246
- if (this.renderStatus !== 'is-opening')
247
- return;
248
- this.renderStatus = 'is-open';
249
- this.focusContent();
250
- }, { once: true });
305
+ window.addEventListener('resize', this.onViewportResize);
306
+ this.bodyOverflow = document.body.style.overflow;
307
+ this.rootOverflow = document.documentElement.style.overflow;
308
+ document.body.style.overflow = 'hidden';
309
+ document.documentElement.style.overflow = 'hidden';
310
+ try {
311
+ this.renderStatus = 'is-opening';
312
+ this.dialogElement.addEventListener('transitionend', () => {
313
+ if (this.renderStatus !== 'is-opening')
314
+ return;
315
+ this.renderStatus = 'is-open';
316
+ this.focusContent();
317
+ }, { once: true });
318
+ }
319
+ catch (error) {
320
+ window.removeEventListener('resize', this.onViewportResize);
321
+ this.restorePageScroll();
322
+ throw error;
323
+ }
251
324
  }
252
325
  // #endregion
253
326
  // #region Local Methods
@@ -273,6 +346,10 @@ export class Q2ActionSheet {
273
346
  this.hostElement.innerHTML = null;
274
347
  }
275
348
  }
349
+ restorePageScroll() {
350
+ document.body.style.overflow = this.bodyOverflow;
351
+ document.documentElement.style.overflow = this.rootOverflow;
352
+ }
276
353
  showPreHook() {
277
354
  const { data } = this;
278
355
  if (!data)
@@ -298,12 +375,15 @@ export class Q2ActionSheet {
298
375
  this.dialogElement.style.setProperty('--comp-action-sheet-computed-max-height', `${Math.floor(windowHeight * this.maxHeight)}px`);
299
376
  }
300
377
  render() {
301
- var _a;
302
378
  const { data } = this;
303
379
  const showHeader = (data === null || data === void 0 ? void 0 : data.title) || this.title || !this.hideClose;
380
+ const headerTitle = (data === null || data === void 0 ? void 0 : data.title) || this.title;
304
381
  const renderStatus = this.renderStatus || '';
305
382
  let RenderContent = null;
306
383
  switch (data === null || data === void 0 ? void 0 : data.appearance) {
384
+ case 'date-picker':
385
+ RenderContent = this.renderDatePicker;
386
+ break;
307
387
  case 'message':
308
388
  RenderContent = this.renderMessage;
309
389
  break;
@@ -316,7 +396,7 @@ export class Q2ActionSheet {
316
396
  }
317
397
  const appearance = (data === null || data === void 0 ? void 0 : data.appearance) || 'slot';
318
398
  const interiorClasses = `interior is-${appearance}`;
319
- return (h("dialog", { key: '840635222baf3ed3f7193c550bb73675d0b466d4', ref: el => (this.dialogElement = el), class: renderStatus, onClick: this.onClick, "aria-labelledby": showHeader ? 'title' : undefined }, h("div", { key: 'c09338fde8ba753281162bd75714e29e6a8cc936', class: interiorClasses }, showHeader && (h("header", { key: 'd3bb667204c262a28363b71ffe6fba8209454391' }, h("div", { key: '8981cf55df99b607a49660fd6ecfe8ef827c100e', id: "title" }, (data === null || data === void 0 ? void 0 : data.title) || this.title), !this.hideClose && (h("q2-btn", { key: 'b4d175a3e7d0382ae9e4630a4fe0f85403af5888', ref: el => (this.closeButtonElement = el), class: "btn-close", "test-id": "btnClose", onClick: this.onCancel, label: "tecton.element.actionSheet.close", "hide-label": true }, h("q2-icon", { key: '95624ea4bcb5a9897a2b09326de718205a32e346', type: "close" }))))), ((_a = this.data) === null || _a === void 0 ? void 0 : _a.description) && h("p", { key: '4f599b2645c604bde96747af50f8d7344db60e11' }, data.description), RenderContent && h(RenderContent, { key: '0878d252923c4c3a8b82cc89f8a88fc3bace794d', data: this.data }))));
399
+ return (h("dialog", { key: 'a2594cad0378cf9bf045ed3ec1022afc58e34dbb', ref: el => (this.dialogElement = el), class: renderStatus, "aria-label": showHeader ? undefined : headerTitle, "aria-labelledby": showHeader ? 'title' : undefined, onClick: this.onClick }, h("div", { key: 'de6361cfa49ec69666b8b2c193dcc9cfc5ac4b0f', class: interiorClasses }, showHeader && (h("header", { key: 'c5a1ddd1f414027e3f75d2a7048c1ccd349cba78' }, h("div", { key: '3d4e7472f5c55ed96eec5ad8909d6ada7a5aa5b2', id: "title" }, (data === null || data === void 0 ? void 0 : data.title) || this.title), !this.hideClose && (h("q2-btn", { key: 'c5e4c952b308e2571a6e90017e4f8010b4a580fe', ref: el => (this.closeButtonElement = el), class: "btn-close", "test-id": "btnClose", onClick: this.onCancel, label: "tecton.element.actionSheet.close", "hide-label": true }, h("q2-icon", { key: '10383e6b8d6ab899648208bbada3c18f47fb5bd3', type: "close" }))))), data && 'description' in data && data.description && h("p", { key: 'a1de7256a6f497270866f076d7697226a8bea946' }, data.description), RenderContent && h(RenderContent, { key: '3f5a57d706b4066c036bb4710a612bd34268b78e', data: this.data }))));
320
400
  }
321
401
  static get is() { return "q2-action-sheet"; }
322
402
  static get encapsulation() { return "shadow"; }
@@ -337,7 +417,7 @@ export class Q2ActionSheet {
337
417
  "mutable": true,
338
418
  "complexType": {
339
419
  "original": "ActionSheetData",
340
- "resolved": "{ appearance: \"list\"; title?: string; description?: string; event?: MouseEvent | KeyboardEvent; listProps: { multiple: boolean; selectedOptions: ActionSheetSelectedOption[]; noSelect: boolean; }; options: ActionSheetListDataOptions; slotsHtml?: ActionSheetStaticHtmlData[]; } | { appearance: \"message\"; type: \"info\" | \"success\" | \"warning\" | \"error\"; title?: string; description?: string; slotsHtml?: ActionSheetStaticHtmlData[]; }",
420
+ "resolved": "{ appearance: \"date-picker\"; title?: string; datePickerProps: ActionSheetDatePickerProps; } | { appearance: \"list\"; title?: string; description?: string; event?: MouseEvent | KeyboardEvent; listProps: { multiple: boolean; selectedOptions: ActionSheetSelectedOption[]; noSelect: boolean; }; options: ActionSheetListDataOptions; slotsHtml?: ActionSheetStaticHtmlData[]; } | { appearance: \"message\"; type: \"info\" | \"success\" | \"warning\" | \"error\"; title?: string; description?: string; slotsHtml?: ActionSheetStaticHtmlData[]; }",
341
421
  "references": {
342
422
  "ActionSheetData": {
343
423
  "location": "import",
@@ -0,0 +1,124 @@
1
+ import { expect } from "@playwright/test";
2
+ import { test } from "@stencil/playwright";
3
+ import { setupPage, THEMES } from "../../../utils/test/vr-helpers";
4
+ // q2-action-sheet hosts stay hidden until show() runs, which makes setupPage's
5
+ // `[stencil-hydrated]:visible` wait time out. Prepending any visible hydrated Stencil
6
+ // element lets that wait resolve so we can call show(). Matches q2-modal's VR setup.
7
+ const VISIBLE_HYDRATION_ANCHOR = `<q2-icon type="info"></q2-icon>`;
8
+ for (const multiple of [false, true]) {
9
+ for (const landscape of [false, true]) {
10
+ const name = `mixed-slots-${multiple ? 'multi' : 'single'}-${landscape ? 'landscape' : 'portrait'}`;
11
+ test(name, async ({ page }) => {
12
+ await page.setViewportSize(landscape ? { width: 667, height: 375 } : { width: 375, height: 667 });
13
+ await setupPage(page, `${VISIBLE_HYDRATION_ANCHOR}<q2-action-sheet></q2-action-sheet>`, {
14
+ setupLoc: true,
15
+ fontSizePx: 24,
16
+ });
17
+ await page.locator('q2-action-sheet').evaluate(async (element, multiple) => {
18
+ await element.componentOnReady();
19
+ element.data = {
20
+ appearance: 'list',
21
+ title: 'Profile',
22
+ listProps: { multiple, selectedOptions: [], noSelect: false },
23
+ options: Array.from({ length: 30 }, (_, index) => ({
24
+ value: `profile-${index}`,
25
+ display: `Profile ${index + 1}`,
26
+ innerHTML: `Profile ${index + 1}`,
27
+ disabled: false,
28
+ hidden: false,
29
+ multiline: false,
30
+ separator: false,
31
+ })),
32
+ slotsHtml: [
33
+ { slot: 'top', html: '<div>Fixed top</div>' },
34
+ { slot: 'top', html: '<div data-action-sheet-scroll>Alex Example</div>' },
35
+ { slot: 'top', html: '<div>alex@example.com</div>' },
36
+ { slot: 'bottom', html: '<div>Profile help</div>' },
37
+ { slot: 'bottom', html: '<div data-action-sheet-scroll>Manage profiles</div>' },
38
+ { slot: 'bottom', html: '<div>Fixed bottom</div>' },
39
+ ],
40
+ };
41
+ await element.show();
42
+ }, multiple);
43
+ await expect(page.locator('q2-action-sheet dialog')).toHaveClass('is-open');
44
+ const content = page.locator('q2-action-sheet .list-body > .content');
45
+ await expect(content).toHaveCount(1);
46
+ // Opening moves focus from the dialog's close button to its options.
47
+ // Capture a defined focus and scroll state rather than either opening state.
48
+ const firstOption = page.locator('q2-action-sheet q2-option').first();
49
+ await expect(firstOption).toHaveAttribute('stencil-hydrated', '');
50
+ await firstOption.evaluate(element => element.focus({ preventScroll: true }));
51
+ await expect(firstOption).toBeFocused();
52
+ await content.evaluate(element => {
53
+ element.scrollTop = 0;
54
+ });
55
+ await expect(content).toHaveJSProperty('scrollTop', 0);
56
+ const movingSlots = content.locator('.list-slot');
57
+ const fixedSlots = page.locator('q2-action-sheet .list-body > .list-slot');
58
+ await expect(movingSlots).toHaveText([
59
+ 'Alex Example',
60
+ 'alex@example.com',
61
+ 'Profile help',
62
+ 'Manage profiles',
63
+ ]);
64
+ await expect(fixedSlots).toHaveText(['Fixed top', 'Fixed bottom']);
65
+ const fixedElements = page.locator('q2-action-sheet header, q2-action-sheet .list-body > .list-slot, q2-action-sheet footer');
66
+ const initialBounds = await Promise.all((await fixedElements.all()).map(element => element.boundingBox()));
67
+ const dimensions = await content.evaluate(element => ({
68
+ clientHeight: element.clientHeight,
69
+ scrollHeight: element.scrollHeight,
70
+ }));
71
+ expect(dimensions.clientHeight).toBeGreaterThan(0);
72
+ expect(dimensions.scrollHeight).toBeGreaterThan(dimensions.clientHeight);
73
+ const dialogBounds = await page.locator('q2-action-sheet dialog').boundingBox();
74
+ const contentBounds = await content.boundingBox();
75
+ expect(contentBounds.y).toBeGreaterThanOrEqual(dialogBounds.y);
76
+ expect(contentBounds.y + contentBounds.height).toBeLessThanOrEqual(dialogBounds.y + dialogBounds.height + 1);
77
+ await expect(firstOption).toBeFocused();
78
+ await expect(page).toHaveScreenshot(`q2-action-sheet--${name}.png`);
79
+ const lastOption = page.locator('q2-action-sheet q2-option').last();
80
+ await lastOption.scrollIntoViewIfNeeded();
81
+ await expect(lastOption).toBeInViewport({ ratio: 1 });
82
+ const optionBounds = await lastOption.boundingBox();
83
+ expect(optionBounds.y).toBeGreaterThanOrEqual(contentBounds.y - 1);
84
+ expect(optionBounds.y + optionBounds.height).toBeLessThanOrEqual(contentBounds.y + contentBounds.height + 1);
85
+ expect(await content.evaluate(element => element.scrollTop)).toBeGreaterThan(0);
86
+ await content.evaluate(element => {
87
+ element.scrollTop = element.scrollHeight;
88
+ });
89
+ await expect(movingSlots.last()).toBeInViewport({ ratio: 1 });
90
+ await expect(movingSlots.first()).not.toBeInViewport();
91
+ expect(await Promise.all((await fixedElements.all()).map(element => element.boundingBox()))).toEqual(initialBounds);
92
+ for (const element of await fixedSlots.all()) {
93
+ await expect(element).toBeInViewport({ ratio: 1 });
94
+ }
95
+ if (multiple) {
96
+ await expect(page.locator('q2-action-sheet [test-id="btnDone"]')).toBeInViewport({ ratio: 1 });
97
+ }
98
+ await expect(page.locator('q2-action-sheet [test-id="btnClose"]')).toBeInViewport({ ratio: 1 });
99
+ await expect(page).toHaveScreenshot(`q2-action-sheet--${name}--scrolled.png`);
100
+ });
101
+ }
102
+ }
103
+ for (const theme of THEMES) {
104
+ test(`q2-action-sheet--calendar-navigation-focus — ${theme}`, async ({ page }) => {
105
+ await setupPage(page, '<q2-btn>Choose a date</q2-btn><q2-action-sheet></q2-action-sheet>', {
106
+ theme,
107
+ setupLoc: true,
108
+ });
109
+ await page.locator('q2-action-sheet').evaluate((element) => {
110
+ element.data = {
111
+ appearance: 'date-picker',
112
+ title: 'Choose a date',
113
+ datePickerProps: { mode: 'single', value: '2026-06-15' },
114
+ };
115
+ });
116
+ await page.locator('q2-action-sheet').evaluate((element) => element.show());
117
+ const navigation = page.locator('q2-date-picker .previousYear button');
118
+ await navigation.waitFor({ state: 'visible' });
119
+ await page.keyboard.press('Tab');
120
+ await navigation.focus();
121
+ await expect(navigation).toBeFocused();
122
+ await expect(page).toHaveScreenshot(`q2-action-sheet--calendar-navigation-focus--${theme}.png`);
123
+ });
124
+ }
@@ -8,6 +8,7 @@ import { h } from "@stencil/core";
8
8
  */
9
9
  export class Q2Avatar {
10
10
  constructor() {
11
+ this.initialsFontScale = 1;
11
12
  // #endregion
12
13
  // #region State Properties
13
14
  this.badSrc = false;
@@ -29,9 +30,11 @@ export class Q2Avatar {
29
30
  // #endregion
30
31
  // #region Component Lifecycle Events
31
32
  disconnectedCallback() {
33
+ var _a;
32
34
  if (this.decoratorObserver) {
33
35
  this.decoratorObserver.disconnect();
34
36
  }
37
+ (_a = this.initialsResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
35
38
  }
36
39
  componentWillLoad() {
37
40
  this.checkDecorator();
@@ -39,6 +42,20 @@ export class Q2Avatar {
39
42
  componentDidLoad() {
40
43
  this.setupDecoratorObserver();
41
44
  }
45
+ componentDidRender() {
46
+ var _a, _b, _c;
47
+ const text = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.avatar-initials text');
48
+ if (text !== this.observedInitialsText) {
49
+ (_b = this.initialsResizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
50
+ this.observedInitialsText = text;
51
+ this.initialsFontScale = 1;
52
+ if (text && typeof ResizeObserver === 'function') {
53
+ (_c = this.initialsResizeObserver) !== null && _c !== void 0 ? _c : (this.initialsResizeObserver = new ResizeObserver(() => this.fitInitials()));
54
+ this.initialsResizeObserver.observe(text);
55
+ }
56
+ }
57
+ this.fitInitials();
58
+ }
42
59
  // #endregion
43
60
  // #region Watchers
44
61
  srcDidUpdate() {
@@ -69,6 +86,22 @@ export class Q2Avatar {
69
86
  const decoratorElements = Array.from(this.el.children).filter(child => child.getAttribute('slot') === 'decorator');
70
87
  this.hasDecorator = decoratorElements.length > 0;
71
88
  }
89
+ fitInitials() {
90
+ const text = this.observedInitialsText;
91
+ if (!text)
92
+ return;
93
+ const { x, y, width, height } = text.getBBox();
94
+ const requiredHalfExtent = Math.max(50 - x, x + width - 50, 50 - y, y + height - 50);
95
+ const baseHalfExtent = requiredHalfExtent / this.initialsFontScale;
96
+ const scale = baseHalfExtent > 50 ? 48 / baseHalfExtent : 1;
97
+ if (Math.abs(scale - this.initialsFontScale) < 0.00001)
98
+ return;
99
+ this.initialsFontScale = scale;
100
+ if (scale === 1)
101
+ text.style.removeProperty('font-size');
102
+ else
103
+ text.style.fontSize = `calc(var(--tct-avatar-font-size, var(--const-px-40, 40px)) * ${scale})`;
104
+ }
72
105
  setupDecoratorObserver() {
73
106
  // Set up MutationObserver to watch for changes to the host element's children
74
107
  this.decoratorObserver = new MutationObserver(() => {
@@ -90,7 +123,7 @@ export class Q2Avatar {
90
123
  const isLoaded = this.isLoaded;
91
124
  const showInitials = (this.name || this.initials) && (!this.src || this.badSrc);
92
125
  const showFallback = !this.name && !this.initials && (!this.src || this.badSrc);
93
- return (h("div", { key: 'bdce1116b87a48c861e7ba66e0dccd13829d3819', class: `avatar-wrapper size-${this.size}` }, this.hasDecorator && (h("div", { key: '461db5f2062faa3c4d7f43105c84c51aabc179d8', class: "decorator" }, h("slot", { key: '673a93a53a752514bce15687f5791682fdf3b0b7', name: "decorator" }))), showImg && (h("img", { key: 'fa881cb161c7f2bf64dabc1cf888d465e4698cb9', class: `${isLoaded ? 'avatar-img' : 'avatar-img-default'}`, "test-id": "userImage", src: this.src, onError: this.onError, onLoad: this.onLoad, alt: this.name || '' })), showInitials && (h("svg", { key: '6d8707c833fed056813f81b9014e82584444fa54', viewBox: "0 0 100 100", preserveAspectRatio: "xMidYMid meet", "test-id": "userInitials", class: `avatar-initials initials-size-${computedInitials.length}`, "aria-label": this.name, "aria-hidden": !this.name && 'true' }, h("text", { key: 'ae99c0b68abaa70e9517dee3dfe6dfdccdad13d6', x: "50", y: "50", "dominant-baseline": "central", "text-anchor": "middle", "aria-hidden": "true" }, computedInitials))), showFallback && (h("div", { key: 'df92213216e69c7d933fdfcd4ba1664cee793e14', "test-id": "fallbackIcon", class: "fallback" }, h("q2-icon", { key: '373a344abc59c1e8ea07472d932d5417265582d3', type: this.icon })))));
126
+ return (h("div", { key: 'd5a32129734a7923c61ecfbace6af0799051b8c9', class: `avatar-wrapper size-${this.size}` }, this.hasDecorator && (h("div", { key: 'a20e35425d03a0b45df79846b1613be993935bab', class: "decorator" }, h("slot", { key: '082a7d3022be63825ac0237b0f458eb3fc328737', name: "decorator" }))), showImg && (h("img", { key: 'bc092a5fe3996d53f89bc69146aceb2af53b571a', class: `${isLoaded ? 'avatar-img' : 'avatar-img-default'}`, "test-id": "userImage", src: this.src, onError: this.onError, onLoad: this.onLoad, alt: this.name || '' })), showInitials && (h("svg", { key: '385335ea2b6d35d48179cbea4aa3ac3d99e56093', viewBox: "0 0 100 100", preserveAspectRatio: "xMidYMid meet", "test-id": "userInitials", class: `avatar-initials initials-size-${computedInitials.length}`, "aria-label": this.name, "aria-hidden": !this.name && 'true' }, h("text", { key: 'fb331a07ddc746787341e31febcf2a267f8f0e33', x: "50", y: "50", "dominant-baseline": "central", "text-anchor": "middle", "aria-hidden": "true" }, computedInitials))), showFallback && (h("div", { key: 'da7a75cc5e5b4e62eeaa63c399ed0dc6c869e99c', "test-id": "fallbackIcon", class: "fallback" }, h("q2-icon", { key: '626219dd1528fa7e39d298856be8205f21a6708e', type: this.icon })))));
94
127
  }
95
128
  static get is() { return "q2-avatar"; }
96
129
  static get encapsulation() { return "shadow"; }
@@ -3,6 +3,10 @@ import { test } from "@stencil/playwright";
3
3
  import { setupPage, THEMES, FONT_SCALE_PX, FONT_SCALE_SUFFIX } from "../../../utils/test/vr-helpers";
4
4
  // Inline 2x2 solid-blue PNG — keeps the image variant hermetic (no network).
5
5
  const IMAGE_DATA_URI = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAAFklEQVQI12NkYGD4z8DAwMTAwMDAAAALzAEFwQ7e7AAAAABJRU5ErkJggg==';
6
+ const waitForInitialsToSettle = (page) => page.evaluate(async () => {
7
+ await document.fonts.ready;
8
+ await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(() => resolve())));
9
+ });
6
10
  const VARIANTS = [
7
11
  {
8
12
  name: 'icon-small',
@@ -30,7 +34,7 @@ const VARIANTS = [
30
34
  },
31
35
  {
32
36
  name: 'initials-4',
33
- html: `<q2-avatar initials="LSMA"></q2-avatar>`,
37
+ html: `<q2-avatar initials="WWWW"></q2-avatar>`,
34
38
  },
35
39
  {
36
40
  name: 'image',
@@ -48,7 +52,9 @@ const VARIANTS = [
48
52
  const restingCase = (variant, theme) => {
49
53
  test(`q2-avatar--${variant.name}--resting — ${theme}`, async ({ page }) => {
50
54
  await setupPage(page, variant.html, { theme });
51
- await expect(page).toHaveScreenshot(`q2-avatar--${variant.name}--resting--${theme}.png`);
55
+ if (variant.name.startsWith('initials-'))
56
+ await waitForInitialsToSettle(page);
57
+ await expect(page).toHaveScreenshot(`q2-avatar--${variant.name}--resting--${theme}.png`, variant.name === 'initials-4' ? { maxDiffPixels: 50 } : undefined);
52
58
  });
53
59
  };
54
60
  test.describe('q2-avatar — variants × themes', () => {
@@ -59,14 +65,83 @@ test.describe('q2-avatar — variants × themes', () => {
59
65
  }
60
66
  });
61
67
  // Initials variants exercise --tct-avatar-font-size (SVG text element).
62
- const AVATAR_FONT_SCALE_VARIANTS = VARIANTS.filter(v => v.name === 'initials-1');
68
+ const AVATAR_FONT_SCALE_VARIANTS = VARIANTS.filter(v => v.name.startsWith('initials-'));
63
69
  test.describe(`q2-avatar — scaled font size × themes`, () => {
64
70
  for (const variant of AVATAR_FONT_SCALE_VARIANTS) {
65
71
  for (const theme of THEMES) {
66
72
  test(`q2-avatar--${variant.name}--resting--${FONT_SCALE_SUFFIX} — ${theme}`, async ({ page }) => {
67
73
  await setupPage(page, variant.html, { theme, fontSizePx: FONT_SCALE_PX });
68
- await expect(page).toHaveScreenshot(`q2-avatar--${variant.name}--resting--${FONT_SCALE_SUFFIX}--${theme}.png`);
74
+ await waitForInitialsToSettle(page);
75
+ await expect(page).toHaveScreenshot(`q2-avatar--${variant.name}--resting--${FONT_SCALE_SUFFIX}--${theme}.png`, variant.name === 'initials-4' ? { maxDiffPixels: 50 } : undefined);
69
76
  });
70
77
  }
71
78
  }
72
79
  });
80
+ test.describe('q2-avatar — initials fit inside the circle', () => {
81
+ for (const theme of THEMES) {
82
+ test(`q2-avatar--initials-fit — ${theme}`, async ({ page }) => {
83
+ const html = ['small', 'medium', 'large']
84
+ .map(size => `<div style="display: flex; gap: 8px; margin-bottom: 16px">
85
+ ${['E', 'ES', 'ESS', 'ESSS', 'LSMA', 'W', 'WW', 'WWW', 'WWWW']
86
+ .map(initials => `<q2-avatar size="${size}" initials="${initials}"></q2-avatar>`)
87
+ .join('')}
88
+ </div>`)
89
+ .join('');
90
+ await setupPage(page, html, { theme, fontSizePx: FONT_SCALE_PX });
91
+ await expect
92
+ .poll(() => page.locator('q2-avatar text').evaluateAll(elements => elements.every(element => {
93
+ const { x, y, width, height } = element.getBBox();
94
+ return x >= 0 && x + width <= 100 && y >= 0 && y + height <= 100;
95
+ })))
96
+ .toBe(true);
97
+ const bounds = await page.locator('q2-avatar text').evaluateAll(elements => elements.map(element => {
98
+ const { x, y, width, height } = element.getBBox();
99
+ return {
100
+ initials: element.textContent,
101
+ x,
102
+ y,
103
+ right: x + width,
104
+ bottom: y + height,
105
+ };
106
+ }));
107
+ for (const { initials, x, y, right, bottom } of bounds) {
108
+ expect(x, `${initials} left edge`).toBeGreaterThanOrEqual(-0.25);
109
+ expect(right, `${initials} right edge`).toBeLessThanOrEqual(100.25);
110
+ expect(y, `${initials} top edge`).toBeGreaterThanOrEqual(-0.25);
111
+ expect(bottom, `${initials} bottom edge`).toBeLessThanOrEqual(100.25);
112
+ }
113
+ });
114
+ }
115
+ });
116
+ test('q2-avatar — initials fit at font-32 root size', async ({ page }) => {
117
+ const html = ['small', 'medium', 'large']
118
+ .map(size => `<div style="display: flex; gap: 8px; margin-bottom: 16px">
119
+ ${['ES', 'ESS', 'LSM', 'LSMA', 'WWWW']
120
+ .map(initials => `<q2-avatar size="${size}" initials="${initials}"></q2-avatar>`)
121
+ .join('')}
122
+ </div>`)
123
+ .join('');
124
+ // Set the font size before hydration, as a browser preference would be.
125
+ await setupPage(page, `<style>html { font-size: 32px; --t-px-1: calc(1 / 16 * 1rem); }</style>${html}`, {
126
+ theme: 'standard',
127
+ });
128
+ expect(await page.evaluate(() => getComputedStyle(document.documentElement).fontSize)).toBe('32px');
129
+ const allInitialsFit = () => page.locator('q2-avatar text').evaluateAll(elements => elements.every(element => {
130
+ const { x, y, width, height } = element.getBBox();
131
+ return x >= 0 && x + width <= 100 && y >= 0 && y + height <= 100;
132
+ }));
133
+ await expect.poll(allInitialsFit).toBe(true);
134
+ const bounds = await page.locator('q2-avatar text').evaluateAll(elements => elements.map(element => {
135
+ const { x, y, width, height } = element.getBBox();
136
+ return { initials: element.textContent, x, y, right: x + width, bottom: y + height };
137
+ }));
138
+ for (const { initials, x, y, right, bottom } of bounds) {
139
+ expect(x, `${initials} left edge`).toBeGreaterThanOrEqual(0);
140
+ expect(right, `${initials} right edge`).toBeLessThanOrEqual(100);
141
+ expect(y, `${initials} top edge`).toBeGreaterThanOrEqual(0);
142
+ expect(bottom, `${initials} bottom edge`).toBeLessThanOrEqual(100);
143
+ }
144
+ // Also verify an already-rendered avatar refits when the font scale changes.
145
+ await page.evaluate(() => document.documentElement.style.setProperty('--t-px-1', '3px'));
146
+ await expect.poll(allInitialsFit).toBe(true);
147
+ });