q2-tecton-elements 1.66.2 → 1.67.0

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 (681) hide show
  1. package/dist/bundle-report.json +3496 -3360
  2. package/dist/cjs/action-sheet-D71RSc-w.js.map +1 -1
  3. package/dist/cjs/click-elsewhere.q2-option-list.q2-popover.entry.cjs.js.map +1 -0
  4. package/dist/cjs/{q2-option-list_2.cjs.entry.js → click-elsewhere_3.cjs.entry.js} +131 -10
  5. package/dist/cjs/click-elsewhere_3.cjs.entry.js.map +1 -0
  6. package/dist/cjs/{index-DyAq0y0v.js → index-YvKoRT-t.js} +61 -21
  7. package/dist/cjs/index-YvKoRT-t.js.map +1 -0
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/q2-action-group_2.cjs.entry.js +2 -2
  10. package/dist/cjs/q2-action-sheet.cjs.entry.js +2 -2
  11. package/dist/cjs/q2-avatar.cjs.entry.js +33 -2
  12. package/dist/cjs/q2-avatar.cjs.entry.js.map +1 -1
  13. package/dist/cjs/q2-avatar.entry.cjs.js.map +1 -1
  14. package/dist/cjs/q2-badge.cjs.entry.js +1 -1
  15. package/dist/cjs/q2-btn.q2-loading.entry.cjs.js.map +1 -1
  16. package/dist/cjs/q2-btn_2.cjs.entry.js +18 -6
  17. package/dist/cjs/q2-btn_2.cjs.entry.js.map +1 -1
  18. package/dist/cjs/q2-calendar.cjs.entry.js +3 -3
  19. package/dist/cjs/q2-calendar.cjs.entry.js.map +1 -1
  20. package/dist/cjs/q2-calendar.entry.cjs.js.map +1 -1
  21. package/dist/cjs/q2-card-image.cjs.entry.js +3 -3
  22. package/dist/cjs/q2-card.cjs.entry.js +1 -1
  23. package/dist/cjs/q2-carousel-pane.cjs.entry.js +4 -4
  24. package/dist/cjs/q2-carousel-pane.cjs.entry.js.map +1 -1
  25. package/dist/cjs/q2-carousel-pane.entry.cjs.js.map +1 -1
  26. package/dist/cjs/q2-carousel.cjs.entry.js +67 -42
  27. package/dist/cjs/q2-carousel.cjs.entry.js.map +1 -1
  28. package/dist/cjs/q2-carousel.entry.cjs.js.map +1 -1
  29. package/dist/cjs/q2-chart-area.cjs.entry.js +4 -2
  30. package/dist/cjs/q2-chart-area.cjs.entry.js.map +1 -1
  31. package/dist/cjs/q2-chart-area.entry.cjs.js.map +1 -1
  32. package/dist/cjs/q2-chart-bar.cjs.entry.js +4 -2
  33. package/dist/cjs/q2-chart-bar.cjs.entry.js.map +1 -1
  34. package/dist/cjs/q2-chart-bar.entry.cjs.js.map +1 -1
  35. package/dist/cjs/q2-chart-donut.cjs.entry.js +7 -3
  36. package/dist/cjs/q2-chart-donut.cjs.entry.js.map +1 -1
  37. package/dist/cjs/q2-chart-donut.entry.cjs.js.map +1 -1
  38. package/dist/cjs/q2-checkbox-group.cjs.entry.js +2 -2
  39. package/dist/cjs/q2-checkbox-group.cjs.entry.js.map +1 -1
  40. package/dist/cjs/q2-checkbox-group.entry.cjs.js.map +1 -1
  41. package/dist/cjs/q2-checkbox.q2-tag.entry.cjs.js.map +1 -0
  42. package/dist/cjs/q2-checkbox_2.cjs.entry.js +322 -0
  43. package/dist/cjs/q2-checkbox_2.cjs.entry.js.map +1 -0
  44. package/dist/cjs/q2-context.cjs.entry.js +2 -2
  45. package/dist/cjs/q2-currency.cjs.entry.js +1 -1
  46. package/dist/cjs/q2-data-table.cjs.entry.js +13 -16
  47. package/dist/cjs/q2-data-table.cjs.entry.js.map +1 -1
  48. package/dist/cjs/q2-data-table.entry.cjs.js.map +1 -1
  49. package/dist/cjs/q2-detail.cjs.entry.js +2 -2
  50. package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
  51. package/dist/cjs/q2-dropdown.cjs.entry.js +1 -1
  52. package/dist/cjs/q2-editable-field.cjs.entry.js +2 -2
  53. package/dist/cjs/q2-editable-field.cjs.entry.js.map +1 -1
  54. package/dist/cjs/q2-editable-field.entry.cjs.js.map +1 -1
  55. package/dist/cjs/q2-example.cjs.entry.js +1 -1
  56. package/dist/cjs/q2-file-picker.cjs.entry.js +1 -1
  57. package/dist/cjs/q2-file-picker.cjs.entry.js.map +1 -1
  58. package/dist/cjs/q2-file-picker.entry.cjs.js.map +1 -1
  59. package/dist/cjs/q2-form.cjs.entry.js +1 -1
  60. package/dist/cjs/q2-formatted-text.cjs.entry.js +1 -1
  61. package/dist/cjs/q2-icon.cjs.entry.js +11 -1
  62. package/dist/cjs/q2-icon.cjs.entry.js.map +1 -1
  63. package/dist/cjs/q2-icon.entry.cjs.js.map +1 -1
  64. package/dist/cjs/q2-input.cjs.entry.js +2 -2
  65. package/dist/cjs/q2-input.cjs.entry.js.map +1 -1
  66. package/dist/cjs/q2-input.entry.cjs.js.map +1 -1
  67. package/dist/cjs/q2-item.cjs.entry.js +3 -3
  68. package/dist/cjs/q2-item.cjs.entry.js.map +1 -1
  69. package/dist/cjs/q2-item.entry.cjs.js.map +1 -1
  70. package/dist/cjs/q2-legend.cjs.entry.js +2 -2
  71. package/dist/cjs/q2-legend.cjs.entry.js.map +1 -1
  72. package/dist/cjs/q2-legend.entry.cjs.js.map +1 -1
  73. package/dist/cjs/q2-link.q2-list.entry.cjs.js.map +1 -1
  74. package/dist/cjs/q2-link_2.cjs.entry.js +14 -6
  75. package/dist/cjs/q2-link_2.cjs.entry.js.map +1 -1
  76. package/dist/cjs/q2-loc.cjs.entry.js +1 -1
  77. package/dist/cjs/q2-message.cjs.entry.js +3 -3
  78. package/dist/cjs/q2-message.cjs.entry.js.map +1 -1
  79. package/dist/cjs/q2-message.entry.cjs.js.map +1 -1
  80. package/dist/cjs/q2-meter.cjs.entry.js +2 -2
  81. package/dist/cjs/q2-modal.cjs.entry.js +4 -21
  82. package/dist/cjs/q2-modal.cjs.entry.js.map +1 -1
  83. package/dist/cjs/q2-modal.entry.cjs.js.map +1 -1
  84. package/dist/cjs/q2-month-picker.cjs.entry.js +3 -3
  85. package/dist/cjs/q2-mutation-observer.cjs.entry.js +1 -1
  86. package/dist/cjs/q2-optgroup.cjs.entry.js +2 -2
  87. package/dist/cjs/q2-option.cjs.entry.js +1 -1
  88. package/dist/cjs/q2-pagination.cjs.entry.js +12 -7
  89. package/dist/cjs/q2-pagination.cjs.entry.js.map +1 -1
  90. package/dist/cjs/q2-pagination.entry.cjs.js.map +1 -1
  91. package/dist/cjs/q2-pill.cjs.entry.js +3 -3
  92. package/dist/cjs/q2-pill.cjs.entry.js.map +1 -1
  93. package/dist/cjs/q2-pill.entry.cjs.js.map +1 -1
  94. package/dist/cjs/q2-radio-group.cjs.entry.js +2 -2
  95. package/dist/cjs/q2-radio-group.cjs.entry.js.map +1 -1
  96. package/dist/cjs/q2-radio-group.entry.cjs.js.map +1 -1
  97. package/dist/cjs/q2-radio.cjs.entry.js +2 -2
  98. package/dist/cjs/q2-radio.cjs.entry.js.map +1 -1
  99. package/dist/cjs/q2-radio.entry.cjs.js.map +1 -1
  100. package/dist/cjs/q2-relative-time.cjs.entry.js +2 -2
  101. package/dist/cjs/q2-section.cjs.entry.js +3 -3
  102. package/dist/cjs/q2-select.cjs.entry.js +22 -8
  103. package/dist/cjs/q2-select.cjs.entry.js.map +1 -1
  104. package/dist/cjs/q2-select.entry.cjs.js.map +1 -1
  105. package/dist/cjs/q2-stepper-pane.cjs.entry.js +7 -6
  106. package/dist/cjs/q2-stepper-pane.cjs.entry.js.map +1 -1
  107. package/dist/cjs/q2-stepper-pane.entry.cjs.js.map +1 -1
  108. package/dist/cjs/q2-stepper-vertical.cjs.entry.js +16 -8
  109. package/dist/cjs/q2-stepper-vertical.cjs.entry.js.map +1 -1
  110. package/dist/cjs/q2-stepper-vertical.entry.cjs.js.map +1 -1
  111. package/dist/cjs/q2-stepper.cjs.entry.js +7 -4
  112. package/dist/cjs/q2-stepper.cjs.entry.js.map +1 -1
  113. package/dist/cjs/q2-stepper.entry.cjs.js.map +1 -1
  114. package/dist/cjs/q2-tab-container.cjs.entry.js +3 -3
  115. package/dist/cjs/q2-tab-container.cjs.entry.js.map +1 -1
  116. package/dist/cjs/q2-tab-container.entry.cjs.js.map +1 -1
  117. package/dist/cjs/q2-tab-pane.cjs.entry.js +1 -1
  118. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  119. package/dist/cjs/q2-textarea.cjs.entry.js +2 -2
  120. package/dist/cjs/q2-textarea.cjs.entry.js.map +1 -1
  121. package/dist/cjs/q2-textarea.entry.cjs.js.map +1 -1
  122. package/dist/cjs/q2-toast.cjs.entry.js +1 -1
  123. package/dist/cjs/q2-tooltip.cjs.entry.js +33 -3
  124. package/dist/cjs/q2-tooltip.cjs.entry.js.map +1 -1
  125. package/dist/cjs/q2-tooltip.entry.cjs.js.map +1 -1
  126. package/dist/cjs/{sanitize-html-string-C2iwHNz5.js → sanitize-html-string-CW6y5624.js} +27 -17
  127. package/dist/cjs/sanitize-html-string-CW6y5624.js.map +1 -0
  128. package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -2
  129. package/dist/collection/__mocks__/echarts.js +12 -0
  130. package/dist/collection/__mocks__/echarts.js.map +1 -0
  131. package/dist/collection/components/q2-avatar/q2-avatar.css +84 -89
  132. package/dist/collection/components/q2-avatar/q2-avatar.js +35 -1
  133. package/dist/collection/components/q2-avatar/q2-avatar.js.map +1 -1
  134. package/dist/collection/components/q2-btn/q2-btn.css +10 -3
  135. package/dist/collection/components/q2-btn/q2-btn.js +38 -4
  136. package/dist/collection/components/q2-btn/q2-btn.js.map +1 -1
  137. package/dist/collection/components/q2-calendar/q2-calendar-helpers.js.map +1 -1
  138. package/dist/collection/components/q2-calendar/q2-calendar-types.js.map +1 -1
  139. package/dist/collection/components/q2-calendar/q2-calendar-validation.js.map +1 -1
  140. package/dist/collection/components/q2-calendar/q2-calendar.css +4 -1
  141. package/dist/collection/components/q2-calendar/q2-calendar.js +1 -1
  142. package/dist/collection/components/q2-calendar/q2-calendar.js.map +1 -1
  143. package/dist/collection/components/q2-calendar/q2-month-picker.js +2 -2
  144. package/dist/collection/components/q2-card-image/q2-card-image.js +2 -2
  145. package/dist/collection/components/q2-carousel/q2-carousel.css +143 -13
  146. package/dist/collection/components/q2-carousel/q2-carousel.js +90 -42
  147. package/dist/collection/components/q2-carousel/q2-carousel.js.map +1 -1
  148. package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.css +2 -11
  149. package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js +2 -2
  150. package/dist/collection/components/q2-chart-area/q2-chart-area.js +18 -16
  151. package/dist/collection/components/q2-chart-area/q2-chart-area.js.map +1 -1
  152. package/dist/collection/components/q2-chart-bar/q2-chart-bar.js +8 -6
  153. package/dist/collection/components/q2-chart-bar/q2-chart-bar.js.map +1 -1
  154. package/dist/collection/components/q2-chart-donut/q2-chart-donut.css +4 -1
  155. package/dist/collection/components/q2-chart-donut/q2-chart-donut.js +30 -26
  156. package/dist/collection/components/q2-chart-donut/q2-chart-donut.js.map +1 -1
  157. package/dist/collection/components/q2-checkbox/q2-checkbox.css +4 -1
  158. package/dist/collection/components/q2-checkbox/q2-checkbox.js +38 -1
  159. package/dist/collection/components/q2-checkbox/q2-checkbox.js.map +1 -1
  160. package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.css +1 -1
  161. package/dist/collection/components/q2-context/q2-context.js +1 -1
  162. package/dist/collection/components/q2-currency/q2-currency.js +1 -1
  163. package/dist/collection/components/q2-data-table/q2-data-table.css +14 -0
  164. package/dist/collection/components/q2-data-table/q2-data-table.js +47 -50
  165. package/dist/collection/components/q2-data-table/q2-data-table.js.map +1 -1
  166. package/dist/collection/components/q2-detail/q2-detail.js +1 -1
  167. package/dist/collection/components/q2-editable-field/q2-editable-field.js +1 -1
  168. package/dist/collection/components/q2-editable-field/q2-editable-field.js.map +1 -1
  169. package/dist/collection/components/q2-example/q2-example.js +1 -1
  170. package/dist/collection/components/q2-file-picker/q2-file-picker.js +9 -9
  171. package/dist/collection/components/q2-file-picker/q2-file-picker.js.map +1 -1
  172. package/dist/collection/components/q2-form/q2-form.js +1 -1
  173. package/dist/collection/components/q2-formatted-text/q2-formatted-text.js +1 -1
  174. package/dist/collection/components/q2-grid/q2-grid.js +30 -30
  175. package/dist/collection/components/q2-grid-area/q2-grid-area.js +42 -42
  176. package/dist/collection/components/q2-icon/assets/brand.symbol.svg +1 -1
  177. package/dist/collection/components/q2-icon/assets/browsersos.symbol.svg +1 -1
  178. package/dist/collection/components/q2-icon/assets/cards.symbol.svg +1 -1
  179. package/dist/collection/components/q2-icon/assets/communication.symbol.svg +1 -1
  180. package/dist/collection/components/q2-icon/assets/currencies.symbol.svg +1 -1
  181. package/dist/collection/components/q2-icon/assets/devices.symbol.svg +1 -1
  182. package/dist/collection/components/q2-icon/assets/filetypes.symbol.svg +1 -1
  183. package/dist/collection/components/q2-icon/assets/gestures.symbol.svg +1 -1
  184. package/dist/collection/components/q2-icon/assets/icon-list.json +1 -1
  185. package/dist/collection/components/q2-icon/assets/icon-map.json +1 -1
  186. package/dist/collection/components/q2-icon/assets/legacy.symbol.svg +1 -1
  187. package/dist/collection/components/q2-icon/assets/mobile.symbol.svg +1 -1
  188. package/dist/collection/components/q2-icon/assets/standard.symbol.svg +1 -1
  189. package/dist/collection/components/q2-icon/assets/status.symbol.svg +1 -1
  190. package/dist/collection/components/q2-icon/q2-icon.js +8 -0
  191. package/dist/collection/components/q2-icon/q2-icon.js.map +1 -1
  192. package/dist/collection/components/q2-input/formatting/credit-card.js.map +1 -1
  193. package/dist/collection/components/q2-input/formatting/currency.js.map +1 -1
  194. package/dist/collection/components/q2-input/formatting/generic.js.map +1 -1
  195. package/dist/collection/components/q2-input/formatting/number.js.map +1 -1
  196. package/dist/collection/components/q2-input/formatting/numeric.js.map +1 -1
  197. package/dist/collection/components/q2-input/formatting/phone.js.map +1 -1
  198. package/dist/collection/components/q2-input/q2-input-types.js.map +1 -1
  199. package/dist/collection/components/q2-input/q2-input.js +42 -42
  200. package/dist/collection/components/q2-input/q2-input.js.map +1 -1
  201. package/dist/collection/components/q2-item/q2-item.css +4 -0
  202. package/dist/collection/components/q2-item/q2-item.js +1 -1
  203. package/dist/collection/components/q2-legend/q2-legend.css +3 -0
  204. package/dist/collection/components/q2-legend/q2-legend.js +36 -36
  205. package/dist/collection/components/q2-legend/q2-legend.js.map +1 -1
  206. package/dist/collection/components/q2-link/q2-link.css +5 -2
  207. package/dist/collection/components/q2-link/q2-link.js +33 -3
  208. package/dist/collection/components/q2-link/q2-link.js.map +1 -1
  209. package/dist/collection/components/q2-list/q2-list.js +1 -1
  210. package/dist/collection/components/q2-message/q2-message.css +19 -16
  211. package/dist/collection/components/q2-message/q2-message.js +1 -1
  212. package/dist/collection/components/q2-message/q2-message.js.map +1 -1
  213. package/dist/collection/components/q2-meter/q2-meter.js +1 -1
  214. package/dist/collection/components/q2-modal/q2-modal.css +3 -3
  215. package/dist/collection/components/q2-modal/q2-modal.js +1 -94
  216. package/dist/collection/components/q2-modal/q2-modal.js.map +1 -1
  217. package/dist/collection/components/q2-mutation-observer/q2-mutation-observer.js +1 -1
  218. package/dist/collection/components/q2-optgroup/q2-optgroup.js +1 -1
  219. package/dist/collection/components/q2-option-list/q2-option-list.js +18 -18
  220. package/dist/collection/components/q2-option-list/q2-option-list.js.map +1 -1
  221. package/dist/collection/components/q2-pagination/q2-pagination.js +15 -10
  222. package/dist/collection/components/q2-pagination/q2-pagination.js.map +1 -1
  223. package/dist/collection/components/q2-pill/q2-pill.css +9 -0
  224. package/dist/collection/components/q2-pill/q2-pill.js +13 -13
  225. package/dist/collection/components/q2-pill/q2-pill.js.map +1 -1
  226. package/dist/collection/components/q2-popover/q2-popover.css +66 -1
  227. package/dist/collection/components/q2-popover/q2-popover.js +57 -4
  228. package/dist/collection/components/q2-popover/q2-popover.js.map +1 -1
  229. package/dist/collection/components/q2-radio/q2-radio.css +4 -3
  230. package/dist/collection/components/q2-radio-group/q2-radio-group.css +1 -1
  231. package/dist/collection/components/q2-relative-time/q2-relative-time.js +1 -1
  232. package/dist/collection/components/q2-resize-observer/q2-resize-observer.js +1 -1
  233. package/dist/collection/components/q2-section/q2-section.js +2 -2
  234. package/dist/collection/components/q2-select/q2-select.js +23 -7
  235. package/dist/collection/components/q2-select/q2-select.js.map +1 -1
  236. package/dist/collection/components/q2-stepper/q2-stepper.css +9 -2
  237. package/dist/collection/components/q2-stepper/q2-stepper.js +5 -2
  238. package/dist/collection/components/q2-stepper/q2-stepper.js.map +1 -1
  239. package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js +52 -30
  240. package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js.map +1 -1
  241. package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.css +11 -2
  242. package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js +20 -6
  243. package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js.map +1 -1
  244. package/dist/collection/components/q2-tab-container/q2-tab-container.css +7 -1
  245. package/dist/collection/components/q2-tab-container/q2-tab-container.js +1 -1
  246. package/dist/collection/components/q2-tab-pane/q2-tab-pane.js +1 -1
  247. package/dist/collection/components/q2-tag/q2-tag.css +3 -0
  248. package/dist/collection/components/q2-tag/q2-tag.js +1 -1
  249. package/dist/collection/components/q2-textarea/q2-textarea.css +1 -0
  250. package/dist/collection/components/q2-tooltip/q2-tooltip.css +1 -1
  251. package/dist/collection/components/q2-tooltip/q2-tooltip.js +34 -1
  252. package/dist/collection/components/q2-tooltip/q2-tooltip.js.map +1 -1
  253. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +2 -2
  254. package/dist/collection/index.js +1 -0
  255. package/dist/collection/index.js.map +1 -1
  256. package/dist/collection/utils/action-sheet.js.map +1 -1
  257. package/dist/collection/utils/index.js +59 -19
  258. package/dist/collection/utils/index.js.map +1 -1
  259. package/dist/components/action-sheet.js.map +1 -1
  260. package/dist/components/index2.js +59 -19
  261. package/dist/components/index2.js.map +1 -1
  262. package/dist/components/q2-avatar2.js +34 -2
  263. package/dist/components/q2-avatar2.js.map +1 -1
  264. package/dist/components/q2-btn2.js +18 -5
  265. package/dist/components/q2-btn2.js.map +1 -1
  266. package/dist/components/q2-calendar.js +2 -2
  267. package/dist/components/q2-calendar.js.map +1 -1
  268. package/dist/components/q2-card-image.js +2 -2
  269. package/dist/components/q2-carousel-pane.js +3 -3
  270. package/dist/components/q2-carousel-pane.js.map +1 -1
  271. package/dist/components/q2-carousel.js +69 -55
  272. package/dist/components/q2-carousel.js.map +1 -1
  273. package/dist/components/q2-chart-area.js +3 -1
  274. package/dist/components/q2-chart-area.js.map +1 -1
  275. package/dist/components/q2-chart-bar.js +3 -1
  276. package/dist/components/q2-chart-bar.js.map +1 -1
  277. package/dist/components/q2-chart-donut.js +6 -2
  278. package/dist/components/q2-chart-donut.js.map +1 -1
  279. package/dist/components/q2-checkbox-group.js +1 -1
  280. package/dist/components/q2-checkbox-group.js.map +1 -1
  281. package/dist/components/q2-checkbox2.js +13 -2
  282. package/dist/components/q2-checkbox2.js.map +1 -1
  283. package/dist/components/q2-context.js +1 -1
  284. package/dist/components/q2-currency.js +1 -1
  285. package/dist/components/q2-data-table.js +46 -25
  286. package/dist/components/q2-data-table.js.map +1 -1
  287. package/dist/components/q2-detail.js +1 -1
  288. package/dist/components/q2-editable-field.js +1 -1
  289. package/dist/components/q2-editable-field.js.map +1 -1
  290. package/dist/components/q2-example.js +1 -1
  291. package/dist/components/q2-file-picker.js.map +1 -1
  292. package/dist/components/q2-form.js +1 -1
  293. package/dist/components/q2-formatted-text.js +1 -1
  294. package/dist/components/q2-icon2.js +10 -0
  295. package/dist/components/q2-icon2.js.map +1 -1
  296. package/dist/components/q2-input2.js +1 -1
  297. package/dist/components/q2-input2.js.map +1 -1
  298. package/dist/components/q2-item2.js +2 -2
  299. package/dist/components/q2-item2.js.map +1 -1
  300. package/dist/components/q2-legend2.js +2 -2
  301. package/dist/components/q2-legend2.js.map +1 -1
  302. package/dist/components/q2-link2.js +13 -4
  303. package/dist/components/q2-link2.js.map +1 -1
  304. package/dist/components/q2-list2.js +1 -1
  305. package/dist/components/q2-message2.js +2 -2
  306. package/dist/components/q2-message2.js.map +1 -1
  307. package/dist/components/q2-meter.js +1 -1
  308. package/dist/components/q2-modal.js +2 -23
  309. package/dist/components/q2-modal.js.map +1 -1
  310. package/dist/components/q2-month-picker.js +2 -2
  311. package/dist/components/q2-mutation-observer.js +1 -1
  312. package/dist/components/q2-optgroup2.js +1 -1
  313. package/dist/components/q2-option-list2.js +1 -1
  314. package/dist/components/q2-option-list2.js.map +1 -1
  315. package/dist/components/q2-pagination.js +11 -6
  316. package/dist/components/q2-pagination.js.map +1 -1
  317. package/dist/components/q2-pill.js +2 -2
  318. package/dist/components/q2-pill.js.map +1 -1
  319. package/dist/components/q2-popover2.js +39 -5
  320. package/dist/components/q2-popover2.js.map +1 -1
  321. package/dist/components/q2-radio-group.js +1 -1
  322. package/dist/components/q2-radio-group.js.map +1 -1
  323. package/dist/components/q2-radio.js +1 -1
  324. package/dist/components/q2-radio.js.map +1 -1
  325. package/dist/components/q2-relative-time.js +1 -1
  326. package/dist/components/q2-resize-observer2.js +1 -1
  327. package/dist/components/q2-section.js +2 -2
  328. package/dist/components/q2-select2.js +23 -8
  329. package/dist/components/q2-select2.js.map +1 -1
  330. package/dist/components/q2-stepper-pane.js +9 -6
  331. package/dist/components/q2-stepper-pane.js.map +1 -1
  332. package/dist/components/q2-stepper-vertical.js +16 -8
  333. package/dist/components/q2-stepper-vertical.js.map +1 -1
  334. package/dist/components/q2-stepper.js +6 -3
  335. package/dist/components/q2-stepper.js.map +1 -1
  336. package/dist/components/q2-tab-container.js +2 -2
  337. package/dist/components/q2-tab-container.js.map +1 -1
  338. package/dist/components/q2-tab-pane.js +1 -1
  339. package/dist/components/q2-tag.js +1 -257
  340. package/dist/components/q2-tag.js.map +1 -1
  341. package/dist/{esm/q2-tag.entry.js → components/q2-tag2.js} +68 -15
  342. package/dist/components/q2-tag2.js.map +1 -0
  343. package/dist/components/q2-textarea.js +1 -1
  344. package/dist/components/q2-textarea.js.map +1 -1
  345. package/dist/components/q2-tooltip2.js +35 -3
  346. package/dist/components/q2-tooltip2.js.map +1 -1
  347. package/dist/components/sanitize-html-string.js +25 -15
  348. package/dist/components/sanitize-html-string.js.map +1 -1
  349. package/dist/components/tecton-tab-pane.js +2 -2
  350. package/dist/esm/action-sheet-B7adb3xs.js.map +1 -1
  351. package/dist/esm/click-elsewhere.q2-option-list.q2-popover.entry.js.map +1 -0
  352. package/dist/esm/{q2-option-list_2.entry.js → click-elsewhere_3.entry.js} +132 -12
  353. package/dist/esm/click-elsewhere_3.entry.js.map +1 -0
  354. package/dist/esm/{index-B4WYBDS9.js → index-C4PILj1_.js} +61 -21
  355. package/dist/esm/index-C4PILj1_.js.map +1 -0
  356. package/dist/esm/loader.js +1 -1
  357. package/dist/esm/q2-action-group_2.entry.js +2 -2
  358. package/dist/esm/q2-action-sheet.entry.js +2 -2
  359. package/dist/esm/q2-avatar.entry.js +33 -2
  360. package/dist/esm/q2-avatar.entry.js.map +1 -1
  361. package/dist/esm/q2-badge.entry.js +1 -1
  362. package/dist/esm/q2-btn.q2-loading.entry.js.map +1 -1
  363. package/dist/esm/q2-btn_2.entry.js +18 -6
  364. package/dist/esm/q2-btn_2.entry.js.map +1 -1
  365. package/dist/esm/q2-calendar.entry.js +3 -3
  366. package/dist/esm/q2-calendar.entry.js.map +1 -1
  367. package/dist/esm/q2-card-image.entry.js +3 -3
  368. package/dist/esm/q2-card.entry.js +1 -1
  369. package/dist/esm/q2-carousel-pane.entry.js +4 -4
  370. package/dist/esm/q2-carousel-pane.entry.js.map +1 -1
  371. package/dist/esm/q2-carousel.entry.js +67 -42
  372. package/dist/esm/q2-carousel.entry.js.map +1 -1
  373. package/dist/esm/q2-chart-area.entry.js +4 -2
  374. package/dist/esm/q2-chart-area.entry.js.map +1 -1
  375. package/dist/esm/q2-chart-bar.entry.js +4 -2
  376. package/dist/esm/q2-chart-bar.entry.js.map +1 -1
  377. package/dist/esm/q2-chart-donut.entry.js +7 -3
  378. package/dist/esm/q2-chart-donut.entry.js.map +1 -1
  379. package/dist/esm/q2-checkbox-group.entry.js +2 -2
  380. package/dist/esm/q2-checkbox-group.entry.js.map +1 -1
  381. package/dist/esm/q2-checkbox.q2-tag.entry.js.map +1 -0
  382. package/dist/esm/q2-checkbox_2.entry.js +319 -0
  383. package/dist/esm/q2-checkbox_2.entry.js.map +1 -0
  384. package/dist/esm/q2-context.entry.js +2 -2
  385. package/dist/esm/q2-currency.entry.js +1 -1
  386. package/dist/esm/q2-data-table.entry.js +13 -16
  387. package/dist/esm/q2-data-table.entry.js.map +1 -1
  388. package/dist/esm/q2-detail.entry.js +2 -2
  389. package/dist/esm/q2-dropdown-item.entry.js +1 -1
  390. package/dist/esm/q2-dropdown.entry.js +1 -1
  391. package/dist/esm/q2-editable-field.entry.js +2 -2
  392. package/dist/esm/q2-editable-field.entry.js.map +1 -1
  393. package/dist/esm/q2-example.entry.js +1 -1
  394. package/dist/esm/q2-file-picker.entry.js +1 -1
  395. package/dist/esm/q2-file-picker.entry.js.map +1 -1
  396. package/dist/esm/q2-form.entry.js +1 -1
  397. package/dist/esm/q2-formatted-text.entry.js +1 -1
  398. package/dist/esm/q2-icon.entry.js +11 -1
  399. package/dist/esm/q2-icon.entry.js.map +1 -1
  400. package/dist/esm/q2-input.entry.js +2 -2
  401. package/dist/esm/q2-input.entry.js.map +1 -1
  402. package/dist/esm/q2-item.entry.js +3 -3
  403. package/dist/esm/q2-item.entry.js.map +1 -1
  404. package/dist/esm/q2-legend.entry.js +2 -2
  405. package/dist/esm/q2-legend.entry.js.map +1 -1
  406. package/dist/esm/q2-link.q2-list.entry.js.map +1 -1
  407. package/dist/esm/q2-link_2.entry.js +14 -6
  408. package/dist/esm/q2-link_2.entry.js.map +1 -1
  409. package/dist/esm/q2-loc.entry.js +1 -1
  410. package/dist/esm/q2-message.entry.js +3 -3
  411. package/dist/esm/q2-message.entry.js.map +1 -1
  412. package/dist/esm/q2-meter.entry.js +2 -2
  413. package/dist/esm/q2-modal.entry.js +4 -21
  414. package/dist/esm/q2-modal.entry.js.map +1 -1
  415. package/dist/esm/q2-month-picker.entry.js +3 -3
  416. package/dist/esm/q2-mutation-observer.entry.js +1 -1
  417. package/dist/esm/q2-optgroup.entry.js +2 -2
  418. package/dist/esm/q2-option.entry.js +1 -1
  419. package/dist/esm/q2-pagination.entry.js +12 -7
  420. package/dist/esm/q2-pagination.entry.js.map +1 -1
  421. package/dist/esm/q2-pill.entry.js +3 -3
  422. package/dist/esm/q2-pill.entry.js.map +1 -1
  423. package/dist/esm/q2-radio-group.entry.js +2 -2
  424. package/dist/esm/q2-radio-group.entry.js.map +1 -1
  425. package/dist/esm/q2-radio.entry.js +2 -2
  426. package/dist/esm/q2-radio.entry.js.map +1 -1
  427. package/dist/esm/q2-relative-time.entry.js +2 -2
  428. package/dist/esm/q2-section.entry.js +3 -3
  429. package/dist/esm/q2-select.entry.js +22 -8
  430. package/dist/esm/q2-select.entry.js.map +1 -1
  431. package/dist/esm/q2-stepper-pane.entry.js +7 -6
  432. package/dist/esm/q2-stepper-pane.entry.js.map +1 -1
  433. package/dist/esm/q2-stepper-vertical.entry.js +16 -8
  434. package/dist/esm/q2-stepper-vertical.entry.js.map +1 -1
  435. package/dist/esm/q2-stepper.entry.js +7 -4
  436. package/dist/esm/q2-stepper.entry.js.map +1 -1
  437. package/dist/esm/q2-tab-container.entry.js +3 -3
  438. package/dist/esm/q2-tab-container.entry.js.map +1 -1
  439. package/dist/esm/q2-tab-pane.entry.js +1 -1
  440. package/dist/esm/q2-tecton-elements.js +1 -1
  441. package/dist/esm/q2-textarea.entry.js +2 -2
  442. package/dist/esm/q2-textarea.entry.js.map +1 -1
  443. package/dist/esm/q2-toast.entry.js +1 -1
  444. package/dist/esm/q2-tooltip.entry.js +33 -3
  445. package/dist/esm/q2-tooltip.entry.js.map +1 -1
  446. package/dist/esm/{sanitize-html-string-BPwFpYg-.js → sanitize-html-string-B35VmRc9.js} +27 -17
  447. package/dist/esm/sanitize-html-string-B35VmRc9.js.map +1 -0
  448. package/dist/esm/tecton-tab-pane.entry.js +2 -2
  449. package/dist/q2-tecton-elements/action-sheet-B7adb3xs.js.map +1 -1
  450. package/dist/q2-tecton-elements/assets/brand.symbol.svg +1 -1
  451. package/dist/q2-tecton-elements/assets/browsersos.symbol.svg +1 -1
  452. package/dist/q2-tecton-elements/assets/cards.symbol.svg +1 -1
  453. package/dist/q2-tecton-elements/assets/communication.symbol.svg +1 -1
  454. package/dist/q2-tecton-elements/assets/currencies.symbol.svg +1 -1
  455. package/dist/q2-tecton-elements/assets/devices.symbol.svg +1 -1
  456. package/dist/q2-tecton-elements/assets/filetypes.symbol.svg +1 -1
  457. package/dist/q2-tecton-elements/assets/gestures.symbol.svg +1 -1
  458. package/dist/q2-tecton-elements/assets/icon-list.json +1 -1
  459. package/dist/q2-tecton-elements/assets/icon-map.json +1 -1
  460. package/dist/q2-tecton-elements/assets/legacy.symbol.svg +1 -1
  461. package/dist/q2-tecton-elements/assets/mobile.symbol.svg +1 -1
  462. package/dist/q2-tecton-elements/assets/standard.symbol.svg +1 -1
  463. package/dist/q2-tecton-elements/assets/status.symbol.svg +1 -1
  464. package/dist/q2-tecton-elements/click-elsewhere.q2-option-list.q2-popover.entry.esm.js.map +1 -0
  465. package/dist/q2-tecton-elements/{q2-option-list_2.entry.js → click-elsewhere_3.entry.js} +205 -91
  466. package/dist/q2-tecton-elements/click-elsewhere_3.entry.js.map +1 -0
  467. package/dist/q2-tecton-elements/{index-B4WYBDS9.js → index-C4PILj1_.js} +53 -14
  468. package/dist/q2-tecton-elements/index-C4PILj1_.js.map +1 -0
  469. package/dist/q2-tecton-elements/q2-action-group_2.entry.js +2 -2
  470. package/dist/q2-tecton-elements/q2-action-sheet.entry.js +2 -2
  471. package/dist/q2-tecton-elements/q2-avatar.entry.esm.js.map +1 -1
  472. package/dist/q2-tecton-elements/q2-avatar.entry.js +68 -30
  473. package/dist/q2-tecton-elements/q2-avatar.entry.js.map +1 -1
  474. package/dist/q2-tecton-elements/q2-badge.entry.js +1 -1
  475. package/dist/q2-tecton-elements/q2-btn.q2-loading.entry.esm.js.map +1 -1
  476. package/dist/q2-tecton-elements/q2-btn_2.entry.js +26 -19
  477. package/dist/q2-tecton-elements/q2-btn_2.entry.js.map +1 -1
  478. package/dist/q2-tecton-elements/q2-calendar.entry.esm.js.map +1 -1
  479. package/dist/q2-tecton-elements/q2-calendar.entry.js +4 -4
  480. package/dist/q2-tecton-elements/q2-calendar.entry.js.map +1 -1
  481. package/dist/q2-tecton-elements/q2-card-image.entry.js +3 -3
  482. package/dist/q2-tecton-elements/q2-card.entry.js +1 -1
  483. package/dist/q2-tecton-elements/q2-carousel-pane.entry.esm.js.map +1 -1
  484. package/dist/q2-tecton-elements/q2-carousel-pane.entry.js +17 -17
  485. package/dist/q2-tecton-elements/q2-carousel-pane.entry.js.map +1 -1
  486. package/dist/q2-tecton-elements/q2-carousel.entry.esm.js.map +1 -1
  487. package/dist/q2-tecton-elements/q2-carousel.entry.js +269 -242
  488. package/dist/q2-tecton-elements/q2-carousel.entry.js.map +1 -1
  489. package/dist/q2-tecton-elements/q2-chart-area.entry.esm.js.map +1 -1
  490. package/dist/q2-tecton-elements/q2-chart-area.entry.js +6 -5
  491. package/dist/q2-tecton-elements/q2-chart-area.entry.js.map +1 -1
  492. package/dist/q2-tecton-elements/q2-chart-bar.entry.esm.js.map +1 -1
  493. package/dist/q2-tecton-elements/q2-chart-bar.entry.js +4 -3
  494. package/dist/q2-tecton-elements/q2-chart-bar.entry.js.map +1 -1
  495. package/dist/q2-tecton-elements/q2-chart-donut.entry.esm.js.map +1 -1
  496. package/dist/q2-tecton-elements/q2-chart-donut.entry.js +21 -19
  497. package/dist/q2-tecton-elements/q2-chart-donut.entry.js.map +1 -1
  498. package/dist/q2-tecton-elements/q2-checkbox-group.entry.esm.js.map +1 -1
  499. package/dist/q2-tecton-elements/q2-checkbox-group.entry.js +2 -2
  500. package/dist/q2-tecton-elements/q2-checkbox-group.entry.js.map +1 -1
  501. package/dist/q2-tecton-elements/q2-checkbox.q2-tag.entry.esm.js.map +1 -0
  502. package/dist/q2-tecton-elements/q2-checkbox_2.entry.js +482 -0
  503. package/dist/q2-tecton-elements/q2-checkbox_2.entry.js.map +1 -0
  504. package/dist/q2-tecton-elements/q2-context.entry.js +12 -12
  505. package/dist/q2-tecton-elements/q2-currency.entry.js +11 -11
  506. package/dist/q2-tecton-elements/q2-data-table.entry.esm.js.map +1 -1
  507. package/dist/q2-tecton-elements/q2-data-table.entry.js +26 -28
  508. package/dist/q2-tecton-elements/q2-data-table.entry.js.map +1 -1
  509. package/dist/q2-tecton-elements/q2-detail.entry.js +4 -4
  510. package/dist/q2-tecton-elements/q2-dropdown-item.entry.js +1 -1
  511. package/dist/q2-tecton-elements/q2-dropdown.entry.js +1 -1
  512. package/dist/q2-tecton-elements/q2-editable-field.entry.esm.js.map +1 -1
  513. package/dist/q2-tecton-elements/q2-editable-field.entry.js +2 -2
  514. package/dist/q2-tecton-elements/q2-editable-field.entry.js.map +1 -1
  515. package/dist/q2-tecton-elements/q2-example.entry.js +1 -1
  516. package/dist/q2-tecton-elements/q2-file-picker.entry.esm.js.map +1 -1
  517. package/dist/q2-tecton-elements/q2-file-picker.entry.js +1 -1
  518. package/dist/q2-tecton-elements/q2-file-picker.entry.js.map +1 -1
  519. package/dist/q2-tecton-elements/q2-form.entry.js +2 -2
  520. package/dist/q2-tecton-elements/q2-formatted-text.entry.js +2 -2
  521. package/dist/q2-tecton-elements/q2-icon.entry.esm.js.map +1 -1
  522. package/dist/q2-tecton-elements/q2-icon.entry.js +122 -111
  523. package/dist/q2-tecton-elements/q2-icon.entry.js.map +1 -1
  524. package/dist/q2-tecton-elements/q2-input.entry.esm.js.map +1 -1
  525. package/dist/q2-tecton-elements/q2-input.entry.js +7 -7
  526. package/dist/q2-tecton-elements/q2-input.entry.js.map +1 -1
  527. package/dist/q2-tecton-elements/q2-item.entry.esm.js.map +1 -1
  528. package/dist/q2-tecton-elements/q2-item.entry.js +34 -34
  529. package/dist/q2-tecton-elements/q2-item.entry.js.map +1 -1
  530. package/dist/q2-tecton-elements/q2-legend.entry.esm.js.map +1 -1
  531. package/dist/q2-tecton-elements/q2-legend.entry.js +3 -3
  532. package/dist/q2-tecton-elements/q2-legend.entry.js.map +1 -1
  533. package/dist/q2-tecton-elements/q2-link.q2-list.entry.esm.js.map +1 -1
  534. package/dist/q2-tecton-elements/q2-link_2.entry.js +24 -18
  535. package/dist/q2-tecton-elements/q2-link_2.entry.js.map +1 -1
  536. package/dist/q2-tecton-elements/q2-loc.entry.js +1 -1
  537. package/dist/q2-tecton-elements/q2-message.entry.esm.js.map +1 -1
  538. package/dist/q2-tecton-elements/q2-message.entry.js +29 -25
  539. package/dist/q2-tecton-elements/q2-message.entry.js.map +1 -1
  540. package/dist/q2-tecton-elements/q2-meter.entry.js +14 -14
  541. package/dist/q2-tecton-elements/q2-modal.entry.esm.js.map +1 -1
  542. package/dist/q2-tecton-elements/q2-modal.entry.js +65 -79
  543. package/dist/q2-tecton-elements/q2-modal.entry.js.map +1 -1
  544. package/dist/q2-tecton-elements/q2-month-picker.entry.js +81 -81
  545. package/dist/q2-tecton-elements/q2-mutation-observer.entry.js +1 -1
  546. package/dist/q2-tecton-elements/q2-optgroup.entry.js +5 -5
  547. package/dist/q2-tecton-elements/q2-option.entry.js +1 -1
  548. package/dist/q2-tecton-elements/q2-pagination.entry.esm.js.map +1 -1
  549. package/dist/q2-tecton-elements/q2-pagination.entry.js +43 -32
  550. package/dist/q2-tecton-elements/q2-pagination.entry.js.map +1 -1
  551. package/dist/q2-tecton-elements/q2-pill.entry.esm.js.map +1 -1
  552. package/dist/q2-tecton-elements/q2-pill.entry.js +17 -17
  553. package/dist/q2-tecton-elements/q2-pill.entry.js.map +1 -1
  554. package/dist/q2-tecton-elements/q2-radio-group.entry.esm.js.map +1 -1
  555. package/dist/q2-tecton-elements/q2-radio-group.entry.js +2 -2
  556. package/dist/q2-tecton-elements/q2-radio-group.entry.js.map +1 -1
  557. package/dist/q2-tecton-elements/q2-radio.entry.esm.js.map +1 -1
  558. package/dist/q2-tecton-elements/q2-radio.entry.js +15 -15
  559. package/dist/q2-tecton-elements/q2-radio.entry.js.map +1 -1
  560. package/dist/q2-tecton-elements/q2-relative-time.entry.js +2 -2
  561. package/dist/q2-tecton-elements/q2-section.entry.js +22 -22
  562. package/dist/q2-tecton-elements/q2-select.entry.esm.js.map +1 -1
  563. package/dist/q2-tecton-elements/q2-select.entry.js +21 -8
  564. package/dist/q2-tecton-elements/q2-select.entry.js.map +1 -1
  565. package/dist/q2-tecton-elements/q2-stepper-pane.entry.esm.js.map +1 -1
  566. package/dist/q2-tecton-elements/q2-stepper-pane.entry.js +14 -13
  567. package/dist/q2-tecton-elements/q2-stepper-pane.entry.js.map +1 -1
  568. package/dist/q2-tecton-elements/q2-stepper-vertical.entry.esm.js.map +1 -1
  569. package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js +73 -67
  570. package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js.map +1 -1
  571. package/dist/q2-tecton-elements/q2-stepper.entry.esm.js.map +1 -1
  572. package/dist/q2-tecton-elements/q2-stepper.entry.js +46 -44
  573. package/dist/q2-tecton-elements/q2-stepper.entry.js.map +1 -1
  574. package/dist/q2-tecton-elements/q2-tab-container.entry.esm.js.map +1 -1
  575. package/dist/q2-tecton-elements/q2-tab-container.entry.js +19 -19
  576. package/dist/q2-tecton-elements/q2-tab-container.entry.js.map +1 -1
  577. package/dist/q2-tecton-elements/q2-tab-pane.entry.js +2 -2
  578. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  579. package/dist/q2-tecton-elements/q2-textarea.entry.esm.js.map +1 -1
  580. package/dist/q2-tecton-elements/q2-textarea.entry.js +2 -2
  581. package/dist/q2-tecton-elements/q2-textarea.entry.js.map +1 -1
  582. package/dist/q2-tecton-elements/q2-toast.entry.js +1 -1
  583. package/dist/q2-tecton-elements/q2-tooltip.entry.esm.js.map +1 -1
  584. package/dist/q2-tecton-elements/q2-tooltip.entry.js +41 -5
  585. package/dist/q2-tecton-elements/q2-tooltip.entry.js.map +1 -1
  586. package/dist/q2-tecton-elements/{sanitize-html-string-BPwFpYg-.js → sanitize-html-string-B35VmRc9.js} +118 -109
  587. package/dist/q2-tecton-elements/sanitize-html-string-B35VmRc9.js.map +1 -0
  588. package/dist/q2-tecton-elements/tecton-tab-pane.entry.js +6 -6
  589. package/dist/scripts/docs-generator/index.js +1 -1
  590. package/dist/scripts/docs-generator/index.js.map +1 -1
  591. package/dist/types/__mocks__/echarts.d.ts +16 -0
  592. package/dist/types/components/q2-avatar/q2-avatar.d.ts +9 -0
  593. package/dist/types/components/q2-btn/q2-btn.d.ts +6 -0
  594. package/dist/types/components/q2-calendar/q2-calendar-helpers.d.ts +3 -3
  595. package/dist/types/components/q2-calendar/q2-calendar-types.d.ts +2 -2
  596. package/dist/types/components/q2-calendar/q2-calendar-validation.d.ts +5 -5
  597. package/dist/types/components/q2-calendar/q2-calendar.d.ts +8 -8
  598. package/dist/types/components/q2-carousel/q2-carousel.d.ts +6 -0
  599. package/dist/types/components/q2-chart-area/q2-chart-area.d.ts +4 -4
  600. package/dist/types/components/q2-chart-bar/q2-chart-bar.d.ts +3 -3
  601. package/dist/types/components/q2-chart-donut/q2-chart-donut.d.ts +9 -9
  602. package/dist/types/components/q2-checkbox/q2-checkbox.d.ts +11 -0
  603. package/dist/types/components/q2-data-table/q2-data-table.d.ts +8 -41
  604. package/dist/types/components/q2-editable-field/q2-editable-field.d.ts +4 -4
  605. package/dist/types/components/q2-file-picker/q2-file-picker.d.ts +1 -13
  606. package/dist/types/components/q2-input/formatting/alpha.d.ts +1 -1
  607. package/dist/types/components/q2-input/formatting/alphanumeric.d.ts +1 -1
  608. package/dist/types/components/q2-input/formatting/cif.d.ts +1 -1
  609. package/dist/types/components/q2-input/formatting/clabe.d.ts +1 -1
  610. package/dist/types/components/q2-input/formatting/credit-card.d.ts +2 -2
  611. package/dist/types/components/q2-input/formatting/currency.d.ts +2 -2
  612. package/dist/types/components/q2-input/formatting/generic.d.ts +2 -2
  613. package/dist/types/components/q2-input/formatting/iban.d.ts +1 -1
  614. package/dist/types/components/q2-input/formatting/number.d.ts +3 -2
  615. package/dist/types/components/q2-input/formatting/numeric.d.ts +2 -2
  616. package/dist/types/components/q2-input/formatting/phone.d.ts +2 -2
  617. package/dist/types/components/q2-input/formatting/postal.d.ts +1 -1
  618. package/dist/types/components/q2-input/formatting/routingnumber.d.ts +1 -1
  619. package/dist/types/components/q2-input/formatting/ssn.d.ts +1 -1
  620. package/dist/types/components/q2-input/formatting/swift.d.ts +1 -1
  621. package/dist/types/components/q2-input/formatting/tin.d.ts +1 -1
  622. package/dist/types/components/q2-input/q2-input-types.d.ts +2 -22
  623. package/dist/types/components/q2-input/q2-input.d.ts +16 -15
  624. package/dist/types/components/q2-legend/q2-legend.d.ts +11 -11
  625. package/dist/types/components/q2-link/q2-link.d.ts +6 -0
  626. package/dist/types/components/q2-modal/q2-modal.d.ts +0 -17
  627. package/dist/types/components/q2-option-list/q2-option-list.d.ts +4 -4
  628. package/dist/types/components/q2-pagination/q2-pagination.d.ts +2 -0
  629. package/dist/types/components/q2-pill/q2-pill.d.ts +5 -5
  630. package/dist/types/components/q2-popover/q2-popover.d.ts +7 -0
  631. package/dist/types/components/q2-select/q2-select.d.ts +9 -6
  632. package/dist/types/components/q2-stepper-pane/q2-stepper-pane.d.ts +8 -11
  633. package/dist/types/components/q2-stepper-vertical/q2-stepper-vertical.d.ts +10 -7
  634. package/dist/types/components/q2-tooltip/q2-tooltip.d.ts +4 -0
  635. package/dist/types/components.d.ts +148 -118
  636. package/dist/types/global.d.ts +2 -2
  637. package/dist/types/index.d.ts +1 -0
  638. package/dist/types/utils/action-sheet.d.ts +5 -5
  639. package/dist/types/utils/index.d.ts +13 -0
  640. package/package.json +69 -72
  641. package/dist/cjs/click-elsewhere.cjs.entry.js +0 -97
  642. package/dist/cjs/click-elsewhere.cjs.entry.js.map +0 -1
  643. package/dist/cjs/click-elsewhere.entry.cjs.js.map +0 -1
  644. package/dist/cjs/index-DyAq0y0v.js.map +0 -1
  645. package/dist/cjs/q2-checkbox.cjs.entry.js +0 -110
  646. package/dist/cjs/q2-checkbox.cjs.entry.js.map +0 -1
  647. package/dist/cjs/q2-checkbox.entry.cjs.js.map +0 -1
  648. package/dist/cjs/q2-option-list.q2-popover.entry.cjs.js.map +0 -1
  649. package/dist/cjs/q2-option-list_2.cjs.entry.js.map +0 -1
  650. package/dist/cjs/q2-tag.cjs.entry.js +0 -211
  651. package/dist/cjs/q2-tag.cjs.entry.js.map +0 -1
  652. package/dist/cjs/q2-tag.entry.cjs.js.map +0 -1
  653. package/dist/cjs/sanitize-html-string-C2iwHNz5.js.map +0 -1
  654. package/dist/esm/click-elsewhere.entry.js +0 -95
  655. package/dist/esm/click-elsewhere.entry.js.map +0 -1
  656. package/dist/esm/index-B4WYBDS9.js.map +0 -1
  657. package/dist/esm/q2-checkbox.entry.js +0 -108
  658. package/dist/esm/q2-checkbox.entry.js.map +0 -1
  659. package/dist/esm/q2-option-list.q2-popover.entry.js.map +0 -1
  660. package/dist/esm/q2-option-list_2.entry.js.map +0 -1
  661. package/dist/esm/q2-tag.entry.js.map +0 -1
  662. package/dist/esm/sanitize-html-string-BPwFpYg-.js.map +0 -1
  663. package/dist/q2-tecton-elements/click-elsewhere.entry.esm.js.map +0 -1
  664. package/dist/q2-tecton-elements/click-elsewhere.entry.js +0 -94
  665. package/dist/q2-tecton-elements/click-elsewhere.entry.js.map +0 -1
  666. package/dist/q2-tecton-elements/index-B4WYBDS9.js.map +0 -1
  667. package/dist/q2-tecton-elements/q2-checkbox.entry.esm.js.map +0 -1
  668. package/dist/q2-tecton-elements/q2-checkbox.entry.js +0 -228
  669. package/dist/q2-tecton-elements/q2-checkbox.entry.js.map +0 -1
  670. package/dist/q2-tecton-elements/q2-option-list.q2-popover.entry.esm.js.map +0 -1
  671. package/dist/q2-tecton-elements/q2-option-list_2.entry.js.map +0 -1
  672. package/dist/q2-tecton-elements/q2-tag.entry.esm.js.map +0 -1
  673. package/dist/q2-tecton-elements/q2-tag.entry.js +0 -256
  674. package/dist/q2-tecton-elements/q2-tag.entry.js.map +0 -1
  675. package/dist/q2-tecton-elements/sanitize-html-string-BPwFpYg-.js.map +0 -1
  676. /package/dist/types/{builds/q2e/development/tecton/tecton → Users/kvanhouten/Documents/Work/tecton_extra}/packages/q2-tecton-elements/.stencil/jest.e2e-coverage.d.ts +0 -0
  677. /package/dist/types/{builds/q2e/development/tecton/tecton → Users/kvanhouten/Documents/Work/tecton_extra}/packages/q2-tecton-elements/.stencil/jest.setup.d.ts +0 -0
  678. /package/dist/types/{builds/q2e/development/tecton/tecton → Users/kvanhouten/Documents/Work/tecton_extra}/packages/q2-tecton-elements/.stencil/scripts/docs-generator/index.d.ts +0 -0
  679. /package/dist/types/{builds/q2e/development/tecton/tecton → Users/kvanhouten/Documents/Work/tecton_extra}/packages/q2-tecton-elements/.stencil/scripts/docs-generator/markdown-generator.d.ts +0 -0
  680. /package/dist/types/{builds/q2e/development/tecton/tecton → Users/kvanhouten/Documents/Work/tecton_extra}/packages/q2-tecton-elements/.stencil/scripts/docs-generator/tag-handlers.d.ts +0 -0
  681. /package/dist/types/{builds/q2e/development/tecton/tecton → Users/kvanhouten/Documents/Work/tecton_extra}/packages/q2-tecton-elements/.stencil/scripts/docs-generator/types.d.ts +0 -0
@@ -1,14 +1,14 @@
1
1
  import { r as t, c as i, h as o, g as e } from "./index-CGkHOjh1.js";
2
2
 
3
- import { a as r, o as a, i as n, w as c, l as s } from "./index-B4WYBDS9.js";
3
+ import { a as r, o as a, i as n, w as c, l as s } from "./index-C4PILj1_.js";
4
4
 
5
5
  import { m as l } from "./mirror-emit-DUjY_ucm.js";
6
6
 
7
7
  import { a as p, s as d } from "./action-sheet-B7adb3xs.js";
8
8
 
9
- const h = "*{box-sizing:border-box}*:active{outline:none}*:focus-visible{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}:host{display:inline-block;position:relative;line-height:0}:host(:not(:last-child)){margin-inline-end:var(--tct-pill-margin, var(--t-pill-margin, var(--app-scale-2x, 10px)))}q2-popover,.btn-wrapper{--comp-pill-min-height:var(--tct-pill-min-height, var(--t-pill-min-height, 44px));--comp-pill-btn-height:var(--tct-pill-btn-height, var(--t-pill-btn-height, 30px))}.popover-top-container{position:sticky;top:0;z-index:5}.popover-bottom-container{position:sticky;bottom:0;z-index:5}.btn-wrapper{--comp-pill-btn-border-width:var(--tct-pill-btn-border-width, var(--t-pill-btn-border-width, 2px));--comp-close-size:0px;--comp-btn-background:var(--tct-pill-btn-background, var(--t-pill-btn-background, var(--t-base, #ffffff)));--comp-btn-box-shadow:var(--tct-pill-btn-box-shadow, none);--comp-btn-backdrop-filter:var(--tct-pill-btn-backdrop-filter, none);--comp-hover-btn-background:var(--tct-pill-hover-btn-background, var(--t-pill-hover-btn-background, var(--t-gray-13, #e6e6e6)));--comp-btn-padding:var(--tct-pill-btn-padding-inline, var(--t-pill-btn-padding-inline, var(--app-scale-3x, 15px)));--comp-btn-color:var(--tct-pill-btn-color, var(--t-pill-btn-color, var(--t-gray-3, #262626)));--comp-active-btn-color:var(--tct-pill-active-btn-color, var(--comp-btn-background));--comp-active-btn-background:var(--tct-pill-active-btn-background, var(--t-pill-active-btn-background, var(--t-gray-7, #666666)));--comp-active-btn-box-shadow:var(--tct-pill-active-btn-box-shadow, var(--tct-pill-btn-box-shadow, none));--comp-active-btn-backdrop-filter:var(--tct-pill-active-btn-backdrop-filter, none);--comp-active-btn-border-color:var(--tct-pill-active-btn-border-color, var(--t-pill-active-btn-border-color, var(--t-gray-7, #666666)));--comp-hover-active-btn-background:var(--tct-pill-active-btn-background, var(--t-pill-active-btn-background, var(--t-gray-6, #4d4d4d)));--comp-hover-active-btn-border-color:var(--tct-pill-active-btn-background, var(--t-pill-active-btn-background, var(--t-gray-6, #4d4d4d)));position:relative}.btn-wrapper.has-options,.btn-wrapper.has-icon{--comp-close-size:var(--comp-pill-btn-height)}:host([active]:not([active=false])) .btn-wrapper{--comp-btn-color:var(--tct-pill-active-btn-color, var(--t-pill-active-btn-color, var(--t-base, #ffffff)))}:host([theme=primary]) .btn-wrapper{--comp-active-btn-background:var(--tct-pill-primary-active-background, var(--t-primary, #0079c1));--comp-active-btn-box-shadow:var(--tct-pill-primary-active-btn-box-shadow, none);--comp-active-btn-backdrop-filter:var(--tct-pill-primary-active-backdrop-filter, none);--comp-active-btn-color:var(--tct-pill-primary-active-font-color, var(--t-primary-text, #ffffff));--comp-active-btn-border-color:var(--tct-pill-primary-active-border-color, var(--t-primary, #0079c1));--comp-hover-active-btn-background:var(--tct-pill-primary-active-hover-background, var(--t-primary-l3, #21acff));--comp-hover-active-btn-border-color:var(--tct-pill-primary-active-hover-border-color, var(--t-primary-l3, #21acff))}:host([theme=secondary]) .btn-wrapper{--comp-active-btn-background:var(--tct-pill-secondary-active-background, var(--t-secondary, #b3c2cc));--comp-active-btn-box-shadow:var(--tct-pill-secondary-active-box-shadow, none);--comp-active-btn-backdrop-filter:var(--tct-pill-secondary-active-backdrop-filter, none);--comp-active-btn-color:var(--tct-pill-secondary-active-font-color, var(--t-secondary-text, #141414));--comp-active-btn-border-color:var(--tct-pill-secondary-active-border-color, var(--t-secondary, #b3c2cc));--comp-hover-active-btn-background:var(--tct-pill-secondary-active-hover-background, var(--t-secondary-l3, #c9d5db));--comp-hover-active-btn-border-color:var(--tct-pill-secondary-active-hover-border-color, var(--t-secondary-l3, #c9d5db))}:host([theme=tertiary]) .btn-wrapper{--comp-active-btn-background:var(--tct-pill-tertiary-active-background, var(--t-tertiary, #e8f5fc));--comp-active-btn-box-shadow:var(--tct-pill-tertiary-active-box-shadow, none);--comp-active-btn-backdrop-filter:var(--tct-pill-tertiary-active-backdrop-filter, none);--comp-active-btn-color:var(--tct-pill-tertiary-active-font-color, var(--t-tertiary-text, #141414));--comp-active-btn-border-color:var(--tct-pill-tertiary-active-border-color, var(--t-tertiary, #e8f5fc));--comp-hover-active-btn-background:var(--tct-pill-tertiary-active-hover-background, var(--t-tertiary-l3, #eff8fd));--comp-hover-active-btn-border-color:var(--tct-pill-tertiary-active-hover-border-color, var(--t-tertiary-l3, #eff8fd))}.btn-height-wrapper{height:var(--comp-pill-min-height);display:flex;align-items:center;cursor:pointer}.btn-height-wrapper:focus{box-shadow:none}:host([disabled]) .btn-height-wrapper{cursor:not-allowed}.btn-close,.btn-primary{cursor:pointer;height:var(--comp-pill-btn-height);border-style:solid;border-radius:var(--tct-pill-btn-border-radius, var(--t-pill-btn-border-radius, 30px));transition-property:background, color, padding, width, opacity;transition:var(--tct-pill-btn-tween, var(--t-pill-btn-tween, var(--app-tween-1, 0.2s ease)))}:host([disabled]) .btn-close,:host([disabled]) .btn-primary,:host([disabled]) q2-icon{opacity:var(--tct-pill-disabled-opacity, var(--t-pill-disabled-opacity, var(--tct-disabled-opacity, var(--app-disabled-opacity, 0.4))));cursor:not-allowed}.btn-primary{background:var(--comp-btn-background);box-shadow:var(--comp-btn-box-shadow);backdrop-filter:var(--comp-btn-backdrop-filter);border-width:var(--comp-pill-btn-border-width);border-color:var(--tct-pill-btn-border-color, var(--t-pill-btn-border-color, var(--t-a11y-gray-color-AA, #949494)));padding-inline:var(--comp-btn-padding);padding-right:calc(var(--comp-btn-padding) + var(--comp-close-size));font-size:var(--tct-pill-btn-font-size, var(--t-pill-btn-font-size, var(--app-font-size, 14px)));font-weight:var(--tct-pill-btn-font-weight, 400);color:var(--comp-btn-color);display:block;width:100%;text-align:start}.btn-primary:focus{box-shadow:var(--tct-pill-btn-focus-box-shadow, var(--const-double-focus-ring))}.btn-primary:hover{background:var(--comp-hover-btn-background)}.has-options .btn-primary,.has-icon .btn-primary{padding-right:calc(var(--tct-pill-icon-gap, var(--t-pill-icon-gap, var(--app-scale-1x, 5px))) + var(--comp-close-size))}.has-options .btn-primary{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:var(--tct-pill-max-width, var(--t-pill-max-width, 200px))}:host([active]:not([active=false])) .btn-primary{background:var(--comp-active-btn-background);box-shadow:var(--comp-active-btn-box-shadow);backdrop-filter:var(--comp-active-btn-backdrop-filter);border-color:var(--comp-active-btn-border-color);color:var(--comp-active-btn-color)}:host([active]:not([active=false])) .btn-primary:focus{box-shadow:var(--tct-pill-btn-focus-box-shadow, var(--const-double-focus-ring))}:host([active]:not([active=false])) .btn-primary:hover{background:var(--comp-hover-active-btn-background);border-color:var(--comp-hover-active-btn-border-color)}.btn-close{background:transparent;border-color:transparent;border-width:var(--comp-pill-btn-border-width);width:var(--comp-close-size);height:var(--comp-close-size);padding:0;border:0;display:inline-flex;justify-content:center;align-items:center;position:absolute;right:0;top:50%;transform:translateY(-50%);opacity:0}:host([active]:not([active=false])) .btn-close{color:var(--comp-active-btn-color)}.has-options .btn-close,.has-icon .btn-close{opacity:1}q2-icon{--tct-icon-stroke-primary:var(--tct-pill-icon-stroke, currentcolor);--tct-icon-stroke-width:var(--tct-pill-icon-stroke-width, inherit);width:var(--tct-pill-icon-size, var(--t-pill-icon-size, 14px));height:var(--tct-pill-icon-size, var(--t-pill-icon-size, 14px));transition-property:transform;transition:var(--tct-pill-btn-tween, var(--t-pill-btn-tween, var(--app-tween-1, 0.2s ease)))}div.btn-close{pointer-events:none}:host([open]) div.btn-close q2-icon{transform:rotate(180deg)}:host([active]:not([active=false])) button.btn-close:focus,:host([active]:not([active=false])) button.btn-close:hover{background:var(--tct-pill-hover-close-btn-background, var(--t-pill-hover-close-btn-background, var(--t-top-a1, rgba(13, 13, 13, 0.35))));border-color:var(--tct-pill-hover-close-btn-border-color, var(--t-pill-hover-close-btn-border-color, var(--t-top-a1, rgba(13, 13, 13, 0.35))))}q2-popover{top:calc(var(--comp-pill-min-height) - (var(--comp-pill-min-height) - var(--comp-pill-btn-height)) / 2)}:host([borderless]:not([borderless=false])) button{border-style:none}";
9
+ const v = "*{box-sizing:border-box}*:active{outline:none}*:focus-visible{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}:host{display:inline-block;position:relative;line-height:0}:host(:not(:last-child)){margin-inline-end:var(--tct-pill-margin, var(--t-pill-margin, var(--app-scale-2x, 10px)))}q2-popover,.btn-wrapper{--comp-pill-min-height:var(--tct-pill-min-height, var(--t-pill-min-height, 44px));--comp-pill-btn-height:var(--tct-pill-btn-height, var(--t-pill-btn-height, 30px))}.popover-top-container{position:sticky;top:0;z-index:5}.popover-bottom-container{position:sticky;bottom:0;z-index:5}.btn-wrapper{--comp-pill-btn-border-width:var(--tct-pill-btn-border-width, var(--t-pill-btn-border-width, 2px));--comp-close-size:0px;--comp-btn-background:var(--tct-pill-btn-background, var(--t-pill-btn-background, var(--t-base, #ffffff)));--comp-btn-box-shadow:var(--tct-pill-btn-box-shadow, none);--comp-btn-backdrop-filter:var(--tct-pill-btn-backdrop-filter, none);--comp-hover-btn-background:var(--tct-pill-hover-btn-background, var(--t-pill-hover-btn-background, var(--t-gray-13, #e6e6e6)));--comp-btn-padding:var(--tct-pill-btn-padding-inline, var(--t-pill-btn-padding-inline, var(--app-scale-3x, 15px)));--comp-btn-color:var(--tct-pill-btn-color, var(--t-pill-btn-color, var(--t-gray-3, #262626)));--comp-active-btn-color:var(--tct-pill-active-btn-color, var(--comp-btn-background));--comp-active-btn-background:var(--tct-pill-active-btn-background, var(--t-pill-active-btn-background, var(--t-gray-7, #666666)));--comp-active-btn-box-shadow:var(--tct-pill-active-btn-box-shadow, var(--tct-pill-btn-box-shadow, none));--comp-active-btn-backdrop-filter:var(--tct-pill-active-btn-backdrop-filter, none);--comp-active-btn-border-color:var(--tct-pill-active-btn-border-color, var(--t-pill-active-btn-border-color, var(--t-gray-7, #666666)));--comp-hover-active-btn-background:var(--tct-pill-active-btn-background, var(--t-pill-active-btn-background, var(--t-gray-6, #4d4d4d)));--comp-hover-active-btn-border-color:var(--tct-pill-active-btn-background, var(--t-pill-active-btn-background, var(--t-gray-6, #4d4d4d)));position:relative}.btn-wrapper.has-options,.btn-wrapper.has-icon{--comp-close-size:var(--comp-pill-btn-height)}:host([active]:not([active=false])) .btn-wrapper{--comp-btn-color:var(--tct-pill-active-btn-color, var(--t-pill-active-btn-color, var(--t-base, #ffffff)))}:host([theme=primary]) .btn-wrapper{--comp-active-btn-background:var(--tct-pill-primary-active-background, var(--t-primary, #0079c1));--comp-active-btn-box-shadow:var(--tct-pill-primary-active-btn-box-shadow, none);--comp-active-btn-backdrop-filter:var(--tct-pill-primary-active-backdrop-filter, none);--comp-active-btn-color:var(--tct-pill-primary-active-font-color, var(--t-primary-text, #ffffff));--comp-active-btn-border-color:var(--tct-pill-primary-active-border-color, var(--t-primary, #0079c1));--comp-hover-active-btn-background:var(--tct-pill-primary-active-hover-background, var(--t-primary-l3, #21acff));--comp-hover-active-btn-border-color:var(--tct-pill-primary-active-hover-border-color, var(--t-primary-l3, #21acff))}:host([theme=secondary]) .btn-wrapper{--comp-active-btn-background:var(--tct-pill-secondary-active-background, var(--t-secondary, #b3c2cc));--comp-active-btn-box-shadow:var(--tct-pill-secondary-active-box-shadow, none);--comp-active-btn-backdrop-filter:var(--tct-pill-secondary-active-backdrop-filter, none);--comp-active-btn-color:var(--tct-pill-secondary-active-font-color, var(--t-secondary-text, #141414));--comp-active-btn-border-color:var(--tct-pill-secondary-active-border-color, var(--t-secondary, #b3c2cc));--comp-hover-active-btn-background:var(--tct-pill-secondary-active-hover-background, var(--t-secondary-l3, #c9d5db));--comp-hover-active-btn-border-color:var(--tct-pill-secondary-active-hover-border-color, var(--t-secondary-l3, #c9d5db))}:host([theme=tertiary]) .btn-wrapper{--comp-active-btn-background:var(--tct-pill-tertiary-active-background, var(--t-tertiary, #e8f5fc));--comp-active-btn-box-shadow:var(--tct-pill-tertiary-active-box-shadow, none);--comp-active-btn-backdrop-filter:var(--tct-pill-tertiary-active-backdrop-filter, none);--comp-active-btn-color:var(--tct-pill-tertiary-active-font-color, var(--t-tertiary-text, #141414));--comp-active-btn-border-color:var(--tct-pill-tertiary-active-border-color, var(--t-tertiary, #e8f5fc));--comp-hover-active-btn-background:var(--tct-pill-tertiary-active-hover-background, var(--t-tertiary-l3, #eff8fd));--comp-hover-active-btn-border-color:var(--tct-pill-tertiary-active-hover-border-color, var(--t-tertiary-l3, #eff8fd))}.btn-height-wrapper{height:var(--comp-pill-min-height);display:flex;align-items:center;cursor:pointer}.btn-height-wrapper:focus{box-shadow:none}:host([disabled]) .btn-height-wrapper{cursor:not-allowed}.btn-close,.btn-primary{cursor:pointer;height:var(--comp-pill-btn-height);border-style:solid;border-radius:var(--tct-pill-btn-border-radius, var(--t-pill-btn-border-radius, 30px));transition-property:background, color, padding, width, opacity;transition:var(--tct-pill-btn-tween, var(--t-pill-btn-tween, var(--app-tween-1, 0.2s ease)))}:host([disabled]) .btn-close,:host([disabled]) .btn-primary,:host([disabled]) q2-icon{opacity:var(--tct-pill-disabled-opacity, var(--t-pill-disabled-opacity, var(--tct-disabled-opacity, var(--app-disabled-opacity, 0.4))));cursor:not-allowed}.btn-primary{background:var(--comp-btn-background);box-shadow:var(--comp-btn-box-shadow);backdrop-filter:var(--comp-btn-backdrop-filter);border-width:var(--comp-pill-btn-border-width);border-color:var(--tct-pill-btn-border-color, var(--t-pill-btn-border-color, var(--t-a11y-gray-color-AA, #949494)));padding-inline:var(--comp-btn-padding);padding-right:calc(var(--comp-btn-padding) + var(--comp-close-size));font-size:var(--tct-pill-btn-font-size, var(--t-pill-btn-font-size, var(--app-font-size, 14px)));font-weight:var(--tct-pill-btn-font-weight, 400);color:var(--comp-btn-color);display:block;width:100%;text-align:start}.btn-primary:focus{box-shadow:var(--tct-pill-btn-focus-box-shadow, var(--const-double-focus-ring))}.btn-primary:focus-visible{box-shadow:var(--tct-pill-btn-focus-visible-box-shadow, var(--const-double-focus-ring))}.btn-primary:hover{background:var(--comp-hover-btn-background)}.has-options .btn-primary,.has-icon .btn-primary{padding-right:calc(var(--tct-pill-icon-gap, var(--t-pill-icon-gap, var(--app-scale-1x, 5px))) + var(--comp-close-size))}.has-options .btn-primary{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:var(--tct-pill-max-width, var(--t-pill-max-width, 200px))}:host([active]:not([active=false])) .btn-primary{background:var(--comp-active-btn-background);box-shadow:var(--comp-active-btn-box-shadow);backdrop-filter:var(--comp-active-btn-backdrop-filter);border-color:var(--comp-active-btn-border-color);color:var(--comp-active-btn-color)}:host([active]:not([active=false])) .btn-primary:focus{box-shadow:var(--tct-pill-btn-focus-box-shadow, var(--const-double-focus-ring))}:host([active]:not([active=false])) .btn-primary:focus-visible{box-shadow:var(--tct-pill-btn-focus-visible-box-shadow, var(--const-double-focus-ring))}:host([active]:not([active=false])) .btn-primary:hover{background:var(--comp-hover-active-btn-background);border-color:var(--comp-hover-active-btn-border-color)}.btn-close{background:transparent;border-color:transparent;border-width:var(--comp-pill-btn-border-width);width:var(--comp-close-size);height:var(--comp-close-size);padding:0;border:0;display:inline-flex;justify-content:center;align-items:center;position:absolute;right:0;top:50%;transform:translateY(-50%);opacity:0}.btn-close:focus-visible{box-shadow:var(--tct-pill-btn-focus-visible-box-shadow, var(--const-double-focus-ring))}:host([active]:not([active=false])) .btn-close{color:var(--comp-active-btn-color)}.has-options .btn-close,.has-icon .btn-close{opacity:1}q2-icon{--tct-icon-stroke-primary:var(--tct-pill-icon-stroke, currentcolor);--tct-icon-stroke-width:var(--tct-pill-icon-stroke-width, inherit);width:var(--tct-pill-icon-size, var(--t-pill-icon-size, 14px));height:var(--tct-pill-icon-size, var(--t-pill-icon-size, 14px));transition-property:transform;transition:var(--tct-pill-btn-tween, var(--t-pill-btn-tween, var(--app-tween-1, 0.2s ease)))}div.btn-close{pointer-events:none}:host([open]) div.btn-close q2-icon{transform:rotate(180deg)}:host([active]:not([active=false])) button.btn-close:focus,:host([active]:not([active=false])) button.btn-close:hover{background:var(--tct-pill-hover-close-btn-background, var(--t-pill-hover-close-btn-background, var(--t-top-a1, rgba(13, 13, 13, 0.35))));border-color:var(--tct-pill-hover-close-btn-border-color, var(--t-pill-hover-close-btn-border-color, var(--t-top-a1, rgba(13, 13, 13, 0.35))))}q2-popover{top:calc(var(--comp-pill-min-height) - (var(--comp-pill-min-height) - var(--comp-pill-btn-height)) / 2)}:host([borderless]:not([borderless=false])) button{border-style:none}";
10
10
 
11
- const v = class {
11
+ const h = class {
12
12
  constructor(o) {
13
13
  t(this, o);
14
14
  this.change = i(this, "change", 7);
@@ -362,19 +362,19 @@ const v = class {
362
362
  if (t || i) r.push("has-icon");
363
363
  if (t) r.push("has-options");
364
364
  return o("click-elsewhere", {
365
- key: "91addb6ad7da4eb7fd3a97fe2c4302ad5161d2e3",
365
+ key: "33f8d76b96617663d26ec896e9d389fcaa18e6e1",
366
366
  onChange: this.onClickElsewhere
367
367
  }, o("div", {
368
- key: "dfb6eb41e00e01731a4fce7127a4f1976f77d46f",
368
+ key: "96e54e580f5f313a5f50049fe4a795fc444c1de5",
369
369
  class: r.join(" ")
370
370
  }, o("div", {
371
- key: "fc37efbf4e08c403bfe6c1e35e3104c7c1c012dc",
371
+ key: "a5482940be97c882b54e4674f96f88344553e274",
372
372
  class: "btn-height-wrapper",
373
373
  ref: t => this.primaryBtnWrapper = t,
374
374
  onClick: this.handleWrapperClick,
375
375
  tabIndex: -1
376
376
  }, o("button", {
377
- key: "0636ba4cee4e0e822599c3394909bb539c1f7f0b",
377
+ key: "d19714c018c3ba17433614432fc6225f84c2dbba",
378
378
  class: "btn-primary",
379
379
  "test-id": "btn-control",
380
380
  type: "button",
@@ -390,7 +390,7 @@ const v = class {
390
390
  "aria-label": `${this.buttonContent}${!t && i ? ` ${s("tecton.element.pill.active")}` : ""}`,
391
391
  "aria-describedby": t && "option-description" || undefined
392
392
  }, this.truncatedButtonContent)), this.renderIcon(), !!t && this.renderHiddenElement()), this.optionCount > 0 && o("q2-popover", {
393
- key: "8c39c09df3cbbbd7b9cc39b93535d087c3b406cd",
393
+ key: "a321b1db273a1d401e932f35f05245e3d3199b88",
394
394
  ref: t => this.popoverElement = t,
395
395
  controlElement: this.primaryBtn,
396
396
  open: this.open,
@@ -400,20 +400,20 @@ const v = class {
400
400
  align: this.popoverAlignment,
401
401
  onFocusout: this.handleFocusOut
402
402
  }, o("div", {
403
- key: "1d6bc4e841d5e722fe9ded9f76cd7784242f8c16",
403
+ key: "e9fc516f6855ae2c9cc67dd46c041e736c4d552e",
404
404
  class: "popover-content"
405
405
  }, o("div", {
406
- key: "17389fd5ca5eb6f676e274b6b27d786e55b94790",
406
+ key: "9cc43dbc66b7eb40f05d89278684a24f7f2b061f",
407
407
  ref: t => this.popoverTopContainer = t,
408
408
  class: "popover-top-container",
409
409
  tabindex: "-1",
410
410
  hidden: !this.hasPopoverTop,
411
411
  onKeyDown: this.handleKeydown
412
412
  }, o("slot", {
413
- key: "d51f6148515907a7f2271fae9935f38f9a577b4b",
413
+ key: "b3d2ff22c4fc3293ebfa70db9f42c2940e149825",
414
414
  name: "popover-top"
415
415
  })), o("q2-option-list", {
416
- key: "3b1762582597ea9f56358301ecb8543b83c50858",
416
+ key: "ebb64d5e7086c49c84b8da96669b5ad9eaa9b631",
417
417
  type: "listbox",
418
418
  ref: t => this.optionList = t,
419
419
  id: "option-list",
@@ -424,16 +424,16 @@ const v = class {
424
424
  onPopoverState: this.onPopoverState,
425
425
  label: s("tecton.element.optionList.label", [ this.optionListLabel ])
426
426
  }, o("slot", {
427
- key: "b813df162daaa546c705042065c3b4d168381423"
427
+ key: "a09461650fc5b4cd38cdc316eb546f877c0ee9d6"
428
428
  })), o("div", {
429
- key: "cdf545308a7e9b85a1388c681c4d9198b97ce623",
429
+ key: "f146e3181d0b35dbe28f46b9ab4d0aaf9691f9ef",
430
430
  ref: t => this.popoverBottomContainer = t,
431
431
  class: "popover-bottom-container",
432
432
  tabindex: "-1",
433
433
  hidden: !this.hasPopoverBottom,
434
434
  onKeyDown: this.handleKeydown
435
435
  }, o("slot", {
436
- key: "daf5ab50500a1572cd645475e5788932ed3ab360",
436
+ key: "515c40d83c6de0758426ca430fcfbc35c5266cc3",
437
437
  name: "popover-bottom"
438
438
  })))));
439
439
  }
@@ -449,8 +449,8 @@ const v = class {
449
449
  }
450
450
  };
451
451
 
452
- v.style = h;
452
+ h.style = v;
453
453
 
454
- export { v as q2_pill };
454
+ export { h as q2_pill };
455
455
  //# sourceMappingURL=q2-pill.entry.esm.js.map
456
456
  //# sourceMappingURL=q2-pill.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["q2PillCss","Q2Pill","constructor","hostRef","this","scheduledAfterRender","hasPopoverBottom","hasPopoverTop","selectedOptionElements","hoist","_a","window","Tecton","useActionSheets","popoverAlignment","popoverMinHeight","selectedOptions","clearSelectedOptions","value","active","open","primaryBtn","focus","mirrorEmit","values","push","resizeIframe","determineOptionCount","async","optionList","allOptions","getOptionListOptions","optionCount","length","numberOfOptions","hostElement","querySelectorAll","executeActionSheet","event","result","showActionSheetList","handleSelectionChanges","getOption","options","find","option","querySelector","getOptions","handleChange","stopPropagation","detail","handleClick","disabled","shouldShowActionSheet","popoverElement","toggle","label","isActive","display","handleFocusOut","relatedTarget","contains","handleKeydown","isTabMetaOrCtrl","metaKey","ctrlKey","key","preventDefault","hasSlot","handleOptionListExternalKeydown","handleExternalKeydown","changeDetails","multiple","onchange","undefined","selectedOption","handleWrapperClick","click","onClickElsewhere","target","localName","onMutationObserved","updateSlotState","updateSelectedOptionElements","onPopoverState","action","setOptionListActiveElement","index","setActiveElement","syncValueProperties","selectedOptionsChanged","valueChanged","selectedValues","map","filter","includes","popTopSlot","shadowRoot","popBottomSlot","topSlotHasNode","assignedNodes","bottomSlotHasNode","disconnectedCallback","mutationObserver","disconnect","componentWillLoad","observer","MutationObserver","observe","childList","attributes","componentDidLoad","overrideFocus","componentDidRender","forEach","fn","handleSelectedDisplay","delegateFocus","isEventFromElement","popoverStateHandler","closePopover","_togglePopover","openPopover","setValue","valueSet","Set","Array","isArray","waitForNextPaint","newValue","firstValue","_b","_oldValue","propName","valueProxy","labelProxy","buttonContent","loc","count","truncatedButtonContent","maxLength","substring","dispatchEvent","FocusEvent","renderHiddenElement","h","id","class","renderIcon","isButton","TagName","iconName","onClick","type","render","wrapperClassNames","onChange","join","ref","el","primaryBtnWrapper","tabIndex","role","onKeyDown","onFocusout","controlElement","popoverMaxHeight","minHeight","direction","popoverDirection","align","popoverTopContainer","tabindex","hidden","name","onReady","optionListLabel","popoverBottomContainer"],"sources":["src/components/q2-pill/q2-pill.scss?tag=q2-pill&encapsulation=shadow","src/components/q2-pill/q2-pill.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n display: inline-block;\n position: relative;\n line-height: 0;\n}\n\n:host(:not(:last-child)) {\n margin-inline-end: var-list(var-prefixer(pill-margin), --app-scale-2x, 10px);\n}\n\nq2-popover,\n.btn-wrapper {\n --comp-pill-min-height: #{var-list(var-prefixer(pill-min-height), 44px)};\n --comp-pill-btn-height: #{var-list(var-prefixer(pill-btn-height), 30px)};\n}\n\n.popover-top-container {\n position: sticky;\n top: 0;\n z-index: 5;\n}\n\n.popover-bottom-container {\n position: sticky;\n bottom: 0;\n z-index: 5;\n}\n\n.btn-wrapper {\n --comp-pill-btn-border-width: #{var-list(var-prefixer(pill-btn-border-width), 2px)};\n --comp-close-size: 0px;\n --comp-btn-background: #{var-list(var-prefixer(pill-btn-background), --t-base, #ffffff)};\n --comp-btn-box-shadow: #{var-list(--tct-pill-btn-box-shadow, none)};\n --comp-btn-backdrop-filter: #{var-list(--tct-pill-btn-backdrop-filter, none)};\n --comp-hover-btn-background: #{var-list(var-prefixer(pill-hover-btn-background), --t-gray-13, #e6e6e6)};\n --comp-btn-padding: #{var-list(var-prefixer(pill-btn-padding-inline), --app-scale-3x, 15px)};\n --comp-btn-color: #{var-list(var-prefixer(pill-btn-color), --t-gray-3, #262626)};\n --comp-active-btn-color: #{var-list(--tct-pill-active-btn-color, --comp-btn-background)};\n --comp-active-btn-background: #{var-list(var-prefixer(pill-active-btn-background), --t-gray-7, #666666)};\n --comp-active-btn-box-shadow: #{var-list(--tct-pill-active-btn-box-shadow, --tct-pill-btn-box-shadow, none)};\n --comp-active-btn-backdrop-filter: #{var-list(--tct-pill-active-btn-backdrop-filter, none)};\n --comp-active-btn-border-color: #{var-list(var-prefixer(pill-active-btn-border-color), --t-gray-7, #666666)};\n --comp-hover-active-btn-background: #{var-list(var-prefixer(pill-active-btn-background), --t-gray-6, #4d4d4d)};\n --comp-hover-active-btn-border-color: #{var-list(var-prefixer(pill-active-btn-background), --t-gray-6, #4d4d4d)};\n\n position: relative;\n\n &.has-options,\n &.has-icon {\n --comp-close-size: var(--comp-pill-btn-height);\n }\n\n :host([active]:not([active='false'])) & {\n --comp-btn-color: #{var-list(var-prefixer(pill-active-btn-color), --t-base, #ffffff)};\n }\n\n :host([theme='primary']) & {\n --comp-active-btn-background: #{var-list(--tct-pill-primary-active-background, --t-primary, #0079c1)};\n --comp-active-btn-box-shadow: #{var-list(--tct-pill-primary-active-btn-box-shadow, none)};\n --comp-active-btn-backdrop-filter: #{var-list(--tct-pill-primary-active-backdrop-filter, none)};\n --comp-active-btn-color: #{var-list(--tct-pill-primary-active-font-color, --t-primary-text, #ffffff)};\n --comp-active-btn-border-color: #{var-list(--tct-pill-primary-active-border-color, --t-primary, #0079c1)};\n --comp-hover-active-btn-background: #{var-list(\n --tct-pill-primary-active-hover-background,\n --t-primary-l3,\n #21acff\n )};\n --comp-hover-active-btn-border-color: #{var-list(\n --tct-pill-primary-active-hover-border-color,\n --t-primary-l3,\n #21acff\n )};\n }\n\n :host([theme='secondary']) & {\n --comp-active-btn-background: #{var-list(--tct-pill-secondary-active-background, --t-secondary, #b3c2cc)};\n --comp-active-btn-box-shadow: #{var-list(--tct-pill-secondary-active-box-shadow, none)};\n --comp-active-btn-backdrop-filter: #{var-list(--tct-pill-secondary-active-backdrop-filter, none)};\n --comp-active-btn-color: #{var-list(--tct-pill-secondary-active-font-color, --t-secondary-text, #141414)};\n --comp-active-btn-border-color: #{var-list(--tct-pill-secondary-active-border-color, --t-secondary, #b3c2cc)};\n --comp-hover-active-btn-background: #{var-list(\n --tct-pill-secondary-active-hover-background,\n --t-secondary-l3,\n #c9d5db\n )};\n --comp-hover-active-btn-border-color: #{var-list(\n --tct-pill-secondary-active-hover-border-color,\n --t-secondary-l3,\n #c9d5db\n )};\n }\n\n :host([theme='tertiary']) & {\n --comp-active-btn-background: #{var-list(--tct-pill-tertiary-active-background, --t-tertiary, #e8f5fc)};\n --comp-active-btn-box-shadow: #{var-list(--tct-pill-tertiary-active-box-shadow, none)};\n --comp-active-btn-backdrop-filter: #{var-list(--tct-pill-tertiary-active-backdrop-filter, none)};\n --comp-active-btn-color: #{var-list(--tct-pill-tertiary-active-font-color, --t-tertiary-text, #141414)};\n --comp-active-btn-border-color: #{var-list(--tct-pill-tertiary-active-border-color, --t-tertiary, #e8f5fc)};\n --comp-hover-active-btn-background: #{var-list(\n --tct-pill-tertiary-active-hover-background,\n --t-tertiary-l3,\n #eff8fd\n )};\n --comp-hover-active-btn-border-color: #{var-list(\n --tct-pill-tertiary-active-hover-border-color,\n --t-tertiary-l3,\n #eff8fd\n )};\n }\n}\n\n.btn-height-wrapper {\n height: var(--comp-pill-min-height);\n display: flex;\n align-items: center;\n cursor: pointer;\n &:focus {\n box-shadow: none;\n }\n\n :host([disabled]) & {\n cursor: not-allowed;\n }\n}\n\n.btn-close,\n.btn-primary {\n cursor: pointer;\n height: var(--comp-pill-btn-height);\n border-style: solid;\n border-radius: var-list(var-prefixer(pill-btn-border-radius), 30px);\n transition-property: background, color, padding, width, opacity;\n transition: var-list(var-prefixer(pill-btn-tween), --app-tween-1, unquote('0.2s ease'));\n}\n\n.btn-close,\n.btn-primary,\nq2-icon {\n :host([disabled]) & {\n opacity: var-list(var-prefixer(pill-disabled-opacity), --tct-disabled-opacity, --app-disabled-opacity, 0.4);\n cursor: not-allowed;\n }\n}\n\n.btn-primary {\n background: var(--comp-btn-background);\n box-shadow: var(--comp-btn-box-shadow);\n backdrop-filter: var(--comp-btn-backdrop-filter);\n border-width: var-list(--comp-pill-btn-border-width);\n border-color: var-list(var-prefixer(pill-btn-border-color), --t-a11y-gray-color-AA, #949494);\n padding-inline: var(--comp-btn-padding);\n padding-right: calc(var(--comp-btn-padding) + var(--comp-close-size));\n font-size: var-list(var-prefixer(pill-btn-font-size), --app-font-size, 14px);\n font-weight: var-list(--tct-pill-btn-font-weight, 400);\n color: var(--comp-btn-color);\n display: block;\n width: 100%;\n text-align: start;\n\n &:focus {\n box-shadow: var-list(--tct-pill-btn-focus-box-shadow, --const-double-focus-ring);\n }\n\n &:hover {\n background: var(--comp-hover-btn-background);\n }\n\n .has-options &,\n .has-icon & {\n padding-right: calc(#{var-list(var-prefixer(pill-icon-gap), --app-scale-1x, 5px)} + var(--comp-close-size));\n }\n\n .has-options & {\n @include line-clamp(1);\n max-width: var-list(var-prefixer(pill-max-width), 200px);\n }\n\n :host([active]:not([active='false'])) & {\n background: var(--comp-active-btn-background);\n box-shadow: var(--comp-active-btn-box-shadow);\n backdrop-filter: var(--comp-active-btn-backdrop-filter);\n border-color: var(--comp-active-btn-border-color);\n color: var(--comp-active-btn-color);\n\n &:focus {\n box-shadow: var-list(--tct-pill-btn-focus-box-shadow, --const-double-focus-ring);\n }\n\n &:hover {\n background: var(--comp-hover-active-btn-background);\n border-color: var(--comp-hover-active-btn-border-color);\n }\n }\n}\n\n.btn-close {\n background: transparent;\n border-color: transparent;\n border-width: var(--comp-pill-btn-border-width);\n width: var(--comp-close-size);\n height: var(--comp-close-size);\n padding: 0;\n border: 0;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n right: 0;\n top: 50%;\n transform: translateY(-50%);\n opacity: 0;\n :host([active]:not([active='false'])) & {\n color: var(--comp-active-btn-color);\n }\n\n .has-options &,\n .has-icon & {\n opacity: 1;\n }\n}\n\nq2-icon {\n --tct-icon-stroke-primary: #{var-list(--tct-pill-icon-stroke, currentcolor)};\n --tct-icon-stroke-width: #{var-list(--tct-pill-icon-stroke-width, inherit)};\n width: var-list(var-prefixer(pill-icon-size), 14px);\n height: var-list(var-prefixer(pill-icon-size), 14px);\n transition-property: transform;\n transition: var-list(var-prefixer(pill-btn-tween), --app-tween-1, unquote('0.2s ease'));\n}\n\ndiv.btn-close {\n pointer-events: none;\n\n :host([open]) & q2-icon {\n transform: rotate(180deg);\n }\n}\n\nbutton.btn-close {\n :host([active]:not([active='false'])) & {\n &:focus,\n &:hover {\n background: var-list(var-prefixer(pill-hover-close-btn-background), --t-top-a1, rgba(13, 13, 13, 0.35));\n border-color: var-list(var-prefixer(pill-hover-close-btn-border-color), --t-top-a1, rgba(13, 13, 13, 0.35));\n }\n }\n}\n\nq2-popover {\n top: calc(var(--comp-pill-min-height) - calc(calc(var(--comp-pill-min-height) - var(--comp-pill-btn-height)) / 2));\n}\n\n:host([borderless]:not([borderless='false'])) {\n button {\n border-style: none;\n }\n}\n","import {\n Component,\n State,\n Prop,\n h,\n ComponentInterface,\n Listen,\n Watch,\n Element,\n EventEmitter,\n Event,\n Method,\n} from '@stencil/core';\nimport { isEventFromElement, loc, overrideFocus, resizeIframe, waitForNextPaint } from 'src/utils';\nimport mirrorEmit from '@/utils/mirror-emit';\nimport { shouldShowActionSheet, showActionSheetList } from 'src/utils/action-sheet';\nimport { IOptionValue } from '../q2-option-list/q2-option-list';\n\n/**\n * @name Pill\n * @category Display\n * @summary Use for displaying and removing active filters in data views.\n * @slot popover-top - An optional slot to display custom content persistently at the top of the popover. This is **not** compatible with the action sheet workflow.\n * @slot popover-bottom - An optional slot to display custom content persistently at the bottom of the popover. This is **not** compatible with the action sheet workflow.\n */\n@Component({ tag: 'q2-pill', shadow: true, styleUrl: 'q2-pill.scss' })\nexport class Q2Pill implements ComponentInterface {\n // #region Own Properties\n\n mutationObserver: MutationObserver;\n optionList: HTMLQ2OptionListElement;\n popoverBottomContainer: HTMLElement;\n popoverElement: HTMLQ2PopoverElement;\n popoverTopContainer: HTMLElement;\n primaryBtn: HTMLButtonElement;\n primaryBtnWrapper: HTMLElement;\n scheduledAfterRender: (() => void)[] = [];\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region State Properties\n\n @State()\n hasPopoverBottom = false;\n\n @State()\n hasPopoverTop = false;\n\n @State()\n optionCount: number;\n\n @State()\n selectedOptionElements: HTMLQ2OptionElement[] = [];\n\n // #endregion\n // #region Public Property API\n\n /** Determine if the elements is in the selected state, with values. */\n @Prop({ reflect: true, mutable: true })\n active: boolean;\n\n /** Indicates that the pill has no border */\n @Prop({ reflect: true })\n borderless: boolean;\n\n /** Indicates the pill cannot be focused or interacted with. */\n @Prop({ reflect: true })\n disabled: boolean;\n\n /**\n * Instructs the component to use the action sheet workflow for displaying its options.\n *\n * For more information, see [Action Sheets](https://tecton.q2developer.com/guides/action-sheets/).\n */\n @Prop()\n hoist: boolean = !!window.Tecton?.useActionSheets;\n\n /**\n * The text that populates the label.\n * @localizable\n */\n @Prop({ reflect: true })\n label: string;\n\n /**\n * The maximum number of characters to display before ellipcizing.\n * @info\n * Limitless by default.\n */\n @Prop({ reflect: true })\n maxLength: number;\n\n /**\n * Enables the multi-select ability for the dropdown.\n * @info\n * Only applicable when options are provided.\n */\n @Prop({ reflect: true })\n multiple: boolean;\n\n /**\n * Determine whether the popover is open or closed.\n *\n * @readonly\n */\n @Prop({ reflect: true, mutable: true })\n open: boolean;\n\n /** Determines the label that is applied to the option list for accessibility purposes. */\n @Prop()\n optionListLabel: string;\n\n /** Aligns the popover dropdown to the left or right side of the input field. */\n @Prop({ mutable: true })\n popoverAlignment: 'left' | 'right' = 'right';\n\n /**\n * Force the direction of the popover dropdown when it opens.\n * If no value is passed, the component will auto-detect the direction based on available space.\n */\n @Prop()\n popoverDirection: 'up' | 'down';\n\n /**\n * Force the maximum height of the popover. This value will be interpreted as pixels.\n * If no value is passed, or the value exceeds available space, the component will auto-detect the maximum height based on available space.\n */\n @Prop()\n popoverMaxHeight: number;\n\n /** @deprecated */\n @Prop()\n popoverMinHeight: number = 150;\n\n /** A list of the selected options on the element. */\n @Prop({ mutable: true })\n selectedOptions: IOptionValue[] = [];\n\n /** The color of the element when in the active state. */\n @Prop({ reflect: true })\n theme: 'primary' | 'secondary' | 'tertiary';\n\n /** The value emitted when the component is selected. */\n @Prop({ reflect: true, mutable: true })\n value: string;\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the pill is clicked or the selected options change.\n *\n * When multi-select is enabled, `value` will be `undefined`.\n * @legacyEvent\n * @deprecated Use 'tctChange' instead\n */\n @Event()\n change: EventEmitter<{ value: string; values: IOptionValue[]; active: boolean }>;\n\n /**\n * Emitted when the pill is clicked or the selected options change.\n *\n * When multi-select is enabled, `value` will be `undefined`.\n * @legacyEvent\n */\n @Event()\n tctChange: EventEmitter<{ value: string; values: IOptionValue[]; active: boolean }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n disconnectedCallback() {\n this.mutationObserver?.disconnect();\n this.mutationObserver = null;\n }\n\n componentWillLoad() {\n const observer = new MutationObserver(this.onMutationObserved);\n observer.observe(this.hostElement, { childList: true, attributes: true });\n this.mutationObserver = observer;\n }\n\n componentDidLoad() {\n overrideFocus(this.hostElement);\n this.syncValueProperties();\n }\n\n componentDidRender() {\n this.scheduledAfterRender.forEach(fn => fn());\n this.scheduledAfterRender = [];\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('displayChanged')\n handleSelectedDisplay() {\n if (this.multiple) return;\n this.updateSelectedOptionElements();\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n this.primaryBtn.focus();\n }\n\n @Listen('popoverStateChanged')\n async popoverStateHandler({ detail: { open } }: CustomEvent<{ open: boolean }>) {\n if (this.open !== open) this.open = open;\n if (open) return;\n this.setOptionListActiveElement(null);\n }\n\n // #endregion\n // #region Public Methods API\n\n /**\n * Emulates clicking the `<button>` to hide the popover if it is visible.\n *\n * @testOnly\n */\n @Method()\n async closePopover() {\n if (!this.open || this.disabled) return;\n this._togglePopover();\n }\n\n /**\n * Emulates clicking the `<button>` to display the popover if it is hidden.\n *\n * @testOnly\n */\n @Method()\n async openPopover() {\n if (this.open || this.disabled) return;\n this._togglePopover();\n }\n\n /**\n * Emulates clicking the `<button>` to display the popover and selecting the option(s) with the specified value(s).\n *\n * If multi-select is enabled and the `closePopover` argument is `true` (default), the popover will be closed\n * after the option(s) are selected.\n *\n * @testOnly\n */\n @Method()\n async setValue(values: string | string[], options: { closePopover?: boolean } = { closePopover: true }) {\n const valueSet = new Set(Array.isArray(values) ? values : [values]);\n const allOptions = (await this.getOptionListOptions()) as HTMLQ2OptionElement[];\n if (!this.open) {\n await this.openPopover();\n await waitForNextPaint();\n }\n\n valueSet.forEach(value => {\n allOptions.find(option => option.value === value)?.click();\n });\n\n if (options.closePopover) {\n await this.closePopover();\n await waitForNextPaint();\n }\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('selectedOptions')\n selectedOptionsChanged(newValue) {\n const { multiple } = this;\n const firstValue = newValue?.[0]?.value ?? null;\n if (multiple) {\n if (this.value) this.value = null;\n this.updateSelectedOptionElements();\n } else if (this.value === firstValue) {\n this.updateSelectedOptionElements();\n } else {\n this.value = firstValue;\n }\n }\n\n @Watch('value')\n @Watch('label')\n async valueChanged(newValue, _oldValue, propName) {\n const { label, multiple, selectedOptions, value } = this;\n const valueProxy = propName === 'value' ? newValue : value;\n const labelProxy = propName === 'label' ? newValue : label;\n if (multiple) return;\n const firstValue = selectedOptions?.[0]?.value ?? null;\n if (propName === 'value' && newValue === firstValue) this.updateSelectedOptionElements();\n else {\n const selectedOption = (await this.getOption(newValue)) as HTMLQ2OptionElement;\n const { value, display } = selectedOption || { value: valueProxy, display: labelProxy };\n this.selectedOptions = value ? [{ value, display }] : [];\n }\n }\n\n // #endregion\n // #region Local Methods\n\n get buttonContent() {\n const { label, selectedOptions, selectedOptionElements, optionCount } = this;\n if (!optionCount || selectedOptionElements.length === 0) return loc(label);\n else if (selectedOptionElements.length === 1) return `${loc(selectedOptionElements[0].display)}`;\n\n return loc('tecton.element.pill.activeCount', { count: selectedOptions.length });\n }\n\n get truncatedButtonContent() {\n const { maxLength, buttonContent } = this;\n if (maxLength && buttonContent.length > maxLength) return `${buttonContent.substring(0, maxLength)}…`;\n else return buttonContent;\n }\n\n _togglePopover() {\n const { primaryBtn } = this;\n primaryBtn?.click();\n primaryBtn?.focus();\n primaryBtn.dispatchEvent(new FocusEvent('focus'));\n }\n\n clearSelectedOptions = () => {\n this.selectedOptions = [];\n this.value = null;\n this.active = false;\n this.open = false;\n this.primaryBtn.focus();\n mirrorEmit(this, ['change', 'tctChange'], { value: null, values: [], active: false });\n this.scheduledAfterRender.push(resizeIframe);\n };\n\n determineOptionCount = async () => {\n if (this.optionList) {\n const allOptions = await this.getOptionListOptions();\n this.optionCount = allOptions.length;\n } else {\n const numberOfOptions = this.hostElement.querySelectorAll('q2-option').length;\n this.optionCount = numberOfOptions;\n }\n };\n\n executeActionSheet = async (event: MouseEvent | KeyboardEvent) => {\n const result = await showActionSheetList(this, event);\n this.primaryBtn.focus();\n this.handleSelectionChanges(result);\n };\n\n getOption = async (value: string) => {\n if (this.optionList) {\n const options = await this.getOptionListOptions();\n return options.find(option => option.value === value);\n } else {\n return this.hostElement.querySelector<HTMLQ2OptionElement>(`q2-option[value=\"${value}\"]`);\n }\n };\n\n // for spec testing\n getOptionListOptions = async () => {\n return await this.optionList?.getOptions();\n };\n\n handleChange = event => {\n event.stopPropagation();\n if (!this.optionCount) return;\n this.handleSelectionChanges(event.detail);\n };\n\n handleClick = async (event: MouseEvent) => {\n event.stopPropagation();\n if (this.disabled) return;\n if (this.optionCount) {\n if (shouldShowActionSheet(this)) {\n this.executeActionSheet(event);\n } else {\n await this.popoverElement.toggle();\n }\n } else {\n const { value, label } = this;\n const isActive = (this.active = !this.active);\n const values = isActive ? [{ value, display: label }] : [];\n mirrorEmit(this, ['change', 'tctChange'], {\n value,\n values,\n active: isActive,\n });\n }\n };\n\n handleFocusOut = async (event: FocusEvent) => {\n const relatedTarget = event.relatedTarget as unknown as HTMLElement;\n if (this.popoverElement?.contains(relatedTarget)) return;\n if (this.hostElement.contains(relatedTarget)) return;\n this.open = false;\n };\n\n handleKeydown = async (event: KeyboardEvent) => {\n const isTabMetaOrCtrl = event.metaKey || event.ctrlKey || event.key === 'Tab';\n if (!this.optionCount || this.disabled || isTabMetaOrCtrl) return;\n event.preventDefault();\n const hasSlot = this.hasPopoverTop || this.hasPopoverBottom;\n\n // slots are incompatible with action sheet\n if (shouldShowActionSheet(this, event) && !hasSlot) {\n this.executeActionSheet(event);\n } else {\n this.handleOptionListExternalKeydown(event);\n }\n };\n\n // for spec testing\n handleOptionListExternalKeydown = async (event: KeyboardEvent) => {\n await this.optionList?.handleExternalKeydown(event);\n };\n\n handleSelectionChanges = async (changeDetails: { value?: string; values?: IOptionValue[] }) => {\n const { multiple } = this;\n const { value = '', values = [] } = changeDetails;\n const isActive = multiple ? !!values.length : !!value;\n if (!this.hostElement.onchange) {\n if (multiple) {\n this.selectedOptions = values;\n this.value = undefined;\n } else {\n const selectedOption = (await this.getOption(value)) as HTMLQ2OptionElement;\n this.selectedOptions = selectedOption\n ? [{ value: selectedOption.value, display: selectedOption.display }]\n : [];\n this.value = selectedOption?.value || undefined;\n }\n }\n\n mirrorEmit(this, ['change', 'tctChange'], {\n value: multiple ? undefined : value,\n values,\n active: isActive,\n });\n };\n\n handleWrapperClick = () => {\n this.primaryBtn.focus();\n this.primaryBtn.click();\n };\n\n onClickElsewhere = (event: CustomEvent) => {\n const target = event.target as HTMLClickElsewhereElement;\n if (target.localName === 'click-elsewhere') {\n event.stopPropagation();\n const { popoverElement } = this;\n if (!popoverElement) return;\n popoverElement.open = false;\n }\n };\n\n onMutationObserved = () => {\n this.updateSlotState();\n this.determineOptionCount();\n this.updateSelectedOptionElements();\n };\n\n onPopoverState = (event: CustomEvent<{ open: boolean; action: 'close' | 'select' | 'open' }>) => {\n const { open, action } = event.detail;\n if (open) return;\n\n switch (action) {\n case 'select':\n case 'close':\n this.primaryBtn.focus();\n break;\n }\n };\n\n // for spec testing\n setOptionListActiveElement = async (index: number) => {\n await this.optionList?.setActiveElement(index);\n };\n\n syncValueProperties = () => {\n const { value, selectedOptions } = this;\n if (!!selectedOptions?.length) this.selectedOptionsChanged(selectedOptions);\n else if (value) this.valueChanged(value, null, 'value');\n };\n\n updateSelectedOptionElements = async () => {\n const { selectedOptions = [] } = this;\n const selectedValues = selectedOptions.map(option => option.value);\n const options = await this.getOptionListOptions();\n if (this.optionCount) this.active = !!selectedValues.length;\n this.selectedOptionElements =\n (options?.filter(option => selectedValues.includes(option.value)) as HTMLQ2OptionElement[]) || [];\n };\n\n updateSlotState = () => {\n const { hostElement, hasPopoverTop, hasPopoverBottom } = this;\n const popTopSlot = hostElement.shadowRoot.querySelector<HTMLSlotElement>('slot[name=\"popover-top\"]');\n const popBottomSlot = hostElement.shadowRoot.querySelector<HTMLSlotElement>('slot[name=\"popover-bottom\"]');\n const topSlotHasNode = popTopSlot?.assignedNodes().length > 0;\n const bottomSlotHasNode = popBottomSlot?.assignedNodes().length > 0;\n\n if (hasPopoverTop !== topSlotHasNode) this.hasPopoverTop = topSlotHasNode;\n if (hasPopoverBottom !== bottomSlotHasNode) this.hasPopoverBottom = bottomSlotHasNode;\n };\n\n // #endregion\n // #region Render Methods\n\n renderHiddenElement() {\n return (\n <div\n id=\"option-description\"\n class=\"sr\"\n aria-hidden=\"true\"\n >\n {loc('tecton.element.optionList.optionCount', [this.optionCount])}\n </div>\n );\n }\n\n renderIcon() {\n const { optionCount, active } = this;\n const isButton = optionCount && active;\n const TagName = isButton ? 'button' : 'div';\n const iconName = isButton || !optionCount ? 'close' : 'chevron-down';\n\n return (\n <TagName\n class=\"btn-close\"\n onClick={(isButton && this.clearSelectedOptions) || undefined}\n disabled={(isButton && this.disabled) || undefined}\n aria-label={(isButton && loc('tecton.element.pill.clearSelection')) || undefined}\n type={(isButton && 'button') || undefined}\n >\n <q2-icon type={iconName}></q2-icon>\n </TagName>\n );\n }\n\n render() {\n const { optionCount, active, open } = this;\n const wrapperClassNames = ['btn-wrapper'];\n if (optionCount || active) wrapperClassNames.push('has-icon');\n if (optionCount) wrapperClassNames.push('has-options');\n\n return (\n <click-elsewhere onChange={this.onClickElsewhere}>\n <div class={wrapperClassNames.join(' ')}>\n <div\n class=\"btn-height-wrapper\"\n ref={el => (this.primaryBtnWrapper = el)}\n onClick={this.handleWrapperClick}\n tabIndex={-1}\n >\n <button\n class=\"btn-primary\"\n test-id=\"btn-control\"\n type=\"button\"\n role={(optionCount && 'combobox') || undefined}\n ref={el => (this.primaryBtn = el)}\n onClick={this.handleClick}\n onKeyDown={this.handleKeydown}\n onFocusout={this.handleFocusOut}\n disabled={this.disabled}\n aria-roledescription={!optionCount && 'filter'}\n aria-controls={(optionCount && 'option-list') || undefined}\n aria-expanded={(optionCount && `${!!open}`) || undefined}\n aria-label={`${this.buttonContent}${!optionCount && active ? ` ${loc('tecton.element.pill.active')}` : ''}`}\n aria-describedby={(optionCount && 'option-description') || undefined}\n >\n {this.truncatedButtonContent}\n </button>\n </div>\n {this.renderIcon()}\n {!!optionCount && this.renderHiddenElement()}\n </div>\n {this.optionCount > 0 && (\n <q2-popover\n ref={el => (this.popoverElement = el)}\n controlElement={this.primaryBtn}\n open={this.open}\n max-height={this.popoverMaxHeight}\n minHeight={this.popoverMinHeight}\n direction={this.popoverDirection}\n align={this.popoverAlignment}\n onFocusout={this.handleFocusOut}\n >\n <div class=\"popover-content\">\n <div\n ref={el => (this.popoverTopContainer = el)}\n class=\"popover-top-container\"\n tabindex=\"-1\"\n hidden={!this.hasPopoverTop}\n onKeyDown={this.handleKeydown}\n >\n <slot name=\"popover-top\"></slot>\n </div>\n <q2-option-list\n type=\"listbox\"\n ref={el => (this.optionList = el)}\n id=\"option-list\"\n onChange={this.handleChange}\n multiple={this.multiple}\n selectedOptions={this.selectedOptions}\n onReady={() => this.updateSelectedOptionElements()}\n onPopoverState={this.onPopoverState}\n label={loc('tecton.element.optionList.label', [this.optionListLabel])}\n >\n <slot />\n </q2-option-list>\n <div\n ref={el => (this.popoverBottomContainer = el)}\n class=\"popover-bottom-container\"\n tabindex=\"-1\"\n hidden={!this.hasPopoverBottom}\n onKeyDown={this.handleKeydown}\n >\n <slot name=\"popover-bottom\"></slot>\n </div>\n </div>\n </q2-popover>\n )}\n </click-elsewhere>\n );\n }\n\n // #endregion\n}\n"],"mappings":";;;;;;;;AAAA,MAAMA,IAAY;;MC0BLC,IAAM;EADnB,WAAAC,CAAAC;;;;;IAWIC,KAAoBC,uBAAmB;;;QAYvCD,KAAgBE,mBAAG;IAGnBF,KAAaG,gBAAG;IAMhBH,KAAsBI,yBAA0B;;;;;eAuBhDJ,KAAKK,YAAcC,IAAAC,OAAOC,YAAM,QAAAF,WAAA,aAAAA,EAAEG;wFAuClCT,KAAgBU,mBAAqB;0BAkBrCV,KAAgBW,mBAAW;6DAI3BX,KAAeY,kBAAmB;IA2LlCZ,KAAoBa,uBAA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jK,KAAKiB;MACrBD,MAAMhB,KAAKgB;MAAI,cACHhB,KAAKkK;MACjBC,WAAWnK,KAAKW;MAChByJ,WAAWpK,KAAKqK;MAChBC,OAAOtK,KAAKU;MACZsJ,YAAYhK,KAAKuD;OAEjBsF,EAAK;MAAA/E,KAAA;MAAAiF,OAAM;OACPF,EAAA;MAAA/E,KAAA;MACI4F,KAAKC,KAAO3J,KAAKuK,sBAAsBZ;MACvCZ,OAAM;MACNyB,UAAS;MACTC,SAASzK,KAAKG;MACd4J,WAAW/J,KAAK0D;OAEhBmF,EAAA;MAAA/E,KAAA;MAAM4G,MAAK;SAEf7B,EAAA;MAAA/E,KAAA;MACIuF,MAAK;MACLK,KAAKC,KAAO3J,KAAKyB,aAAakI;MAC9Bb,IAAG;MACHU,UAAUxJ,KAAK4C;MACfwB,UAAUpE,KAAKoE;MACfxD,iBAAiBZ,KAAKY;MACtB+J,SAAS,MAAM3K,KAAK+E;MACpBC,gBAAgBhF,KAAKgF;MACrB5B,OAAOiF,EAAI,mCAAmC,EAACrI,KAAK4K;OAEpD/B,EAAA;MAAA/E,KAAA;SAEJ+E,EAAA;MAAA/E,KAAA;MACI4F,KAAKC,KAAO3J,KAAK6K,yBAAyBlB;MAC1CZ,OAAM;MACNyB,UAAS;MACTC,SAASzK,KAAKE;MACd6J,WAAW/J,KAAK0D;OAEhBmF,EAAM;MAAA/E,KAAA;MAAA4G,MAAK","ignoreList":[]}
1
+ {"version":3,"names":["q2PillCss","Q2Pill","constructor","hostRef","this","scheduledAfterRender","hasPopoverBottom","hasPopoverTop","selectedOptionElements","hoist","_a","window","Tecton","useActionSheets","popoverAlignment","popoverMinHeight","selectedOptions","clearSelectedOptions","value","active","open","primaryBtn","focus","mirrorEmit","values","push","resizeIframe","determineOptionCount","async","optionList","allOptions","getOptionListOptions","optionCount","length","numberOfOptions","hostElement","querySelectorAll","executeActionSheet","event","result","showActionSheetList","handleSelectionChanges","getOption","options","find","option","querySelector","getOptions","handleChange","stopPropagation","detail","handleClick","disabled","shouldShowActionSheet","popoverElement","toggle","label","isActive","display","handleFocusOut","relatedTarget","contains","handleKeydown","isTabMetaOrCtrl","metaKey","ctrlKey","key","preventDefault","hasSlot","handleOptionListExternalKeydown","handleExternalKeydown","changeDetails","multiple","onchange","undefined","selectedOption","handleWrapperClick","click","onClickElsewhere","target","localName","onMutationObserved","updateSlotState","updateSelectedOptionElements","onPopoverState","action","setOptionListActiveElement","index","setActiveElement","syncValueProperties","selectedOptionsChanged","valueChanged","selectedValues","map","filter","includes","popTopSlot","shadowRoot","popBottomSlot","topSlotHasNode","assignedNodes","bottomSlotHasNode","disconnectedCallback","mutationObserver","disconnect","componentWillLoad","observer","MutationObserver","observe","childList","attributes","componentDidLoad","overrideFocus","componentDidRender","forEach","fn","handleSelectedDisplay","delegateFocus","isEventFromElement","popoverStateHandler","closePopover","_togglePopover","openPopover","setValue","valueSet","Set","Array","isArray","waitForNextPaint","newValue","firstValue","_b","_oldValue","propName","valueProxy","labelProxy","buttonContent","loc","count","truncatedButtonContent","maxLength","substring","dispatchEvent","FocusEvent","renderHiddenElement","h","id","class","renderIcon","isButton","TagName","iconName","onClick","type","render","wrapperClassNames","onChange","join","ref","el","primaryBtnWrapper","tabIndex","role","onKeyDown","onFocusout","controlElement","popoverMaxHeight","minHeight","direction","popoverDirection","align","popoverTopContainer","tabindex","hidden","name","onReady","optionListLabel","popoverBottomContainer"],"sources":["src/components/q2-pill/q2-pill.scss?tag=q2-pill&encapsulation=shadow","src/components/q2-pill/q2-pill.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n display: inline-block;\n position: relative;\n line-height: 0;\n}\n\n:host(:not(:last-child)) {\n margin-inline-end: var-list(var-prefixer(pill-margin), --app-scale-2x, 10px);\n}\n\nq2-popover,\n.btn-wrapper {\n --comp-pill-min-height: #{var-list(var-prefixer(pill-min-height), 44px)};\n --comp-pill-btn-height: #{var-list(var-prefixer(pill-btn-height), 30px)};\n}\n\n.popover-top-container {\n position: sticky;\n top: 0;\n z-index: 5;\n}\n\n.popover-bottom-container {\n position: sticky;\n bottom: 0;\n z-index: 5;\n}\n\n.btn-wrapper {\n --comp-pill-btn-border-width: #{var-list(var-prefixer(pill-btn-border-width), 2px)};\n --comp-close-size: 0px;\n --comp-btn-background: #{var-list(var-prefixer(pill-btn-background), --t-base, #ffffff)};\n --comp-btn-box-shadow: #{var-list(--tct-pill-btn-box-shadow, none)};\n --comp-btn-backdrop-filter: #{var-list(--tct-pill-btn-backdrop-filter, none)};\n --comp-hover-btn-background: #{var-list(var-prefixer(pill-hover-btn-background), --t-gray-13, #e6e6e6)};\n --comp-btn-padding: #{var-list(var-prefixer(pill-btn-padding-inline), --app-scale-3x, 15px)};\n --comp-btn-color: #{var-list(var-prefixer(pill-btn-color), --t-gray-3, #262626)};\n --comp-active-btn-color: #{var-list(--tct-pill-active-btn-color, --comp-btn-background)};\n --comp-active-btn-background: #{var-list(var-prefixer(pill-active-btn-background), --t-gray-7, #666666)};\n --comp-active-btn-box-shadow: #{var-list(--tct-pill-active-btn-box-shadow, --tct-pill-btn-box-shadow, none)};\n --comp-active-btn-backdrop-filter: #{var-list(--tct-pill-active-btn-backdrop-filter, none)};\n --comp-active-btn-border-color: #{var-list(var-prefixer(pill-active-btn-border-color), --t-gray-7, #666666)};\n --comp-hover-active-btn-background: #{var-list(var-prefixer(pill-active-btn-background), --t-gray-6, #4d4d4d)};\n --comp-hover-active-btn-border-color: #{var-list(var-prefixer(pill-active-btn-background), --t-gray-6, #4d4d4d)};\n\n position: relative;\n\n &.has-options,\n &.has-icon {\n --comp-close-size: var(--comp-pill-btn-height);\n }\n\n :host([active]:not([active='false'])) & {\n --comp-btn-color: #{var-list(var-prefixer(pill-active-btn-color), --t-base, #ffffff)};\n }\n\n :host([theme='primary']) & {\n --comp-active-btn-background: #{var-list(--tct-pill-primary-active-background, --t-primary, #0079c1)};\n --comp-active-btn-box-shadow: #{var-list(--tct-pill-primary-active-btn-box-shadow, none)};\n --comp-active-btn-backdrop-filter: #{var-list(--tct-pill-primary-active-backdrop-filter, none)};\n --comp-active-btn-color: #{var-list(--tct-pill-primary-active-font-color, --t-primary-text, #ffffff)};\n --comp-active-btn-border-color: #{var-list(--tct-pill-primary-active-border-color, --t-primary, #0079c1)};\n --comp-hover-active-btn-background: #{var-list(\n --tct-pill-primary-active-hover-background,\n --t-primary-l3,\n #21acff\n )};\n --comp-hover-active-btn-border-color: #{var-list(\n --tct-pill-primary-active-hover-border-color,\n --t-primary-l3,\n #21acff\n )};\n }\n\n :host([theme='secondary']) & {\n --comp-active-btn-background: #{var-list(--tct-pill-secondary-active-background, --t-secondary, #b3c2cc)};\n --comp-active-btn-box-shadow: #{var-list(--tct-pill-secondary-active-box-shadow, none)};\n --comp-active-btn-backdrop-filter: #{var-list(--tct-pill-secondary-active-backdrop-filter, none)};\n --comp-active-btn-color: #{var-list(--tct-pill-secondary-active-font-color, --t-secondary-text, #141414)};\n --comp-active-btn-border-color: #{var-list(--tct-pill-secondary-active-border-color, --t-secondary, #b3c2cc)};\n --comp-hover-active-btn-background: #{var-list(\n --tct-pill-secondary-active-hover-background,\n --t-secondary-l3,\n #c9d5db\n )};\n --comp-hover-active-btn-border-color: #{var-list(\n --tct-pill-secondary-active-hover-border-color,\n --t-secondary-l3,\n #c9d5db\n )};\n }\n\n :host([theme='tertiary']) & {\n --comp-active-btn-background: #{var-list(--tct-pill-tertiary-active-background, --t-tertiary, #e8f5fc)};\n --comp-active-btn-box-shadow: #{var-list(--tct-pill-tertiary-active-box-shadow, none)};\n --comp-active-btn-backdrop-filter: #{var-list(--tct-pill-tertiary-active-backdrop-filter, none)};\n --comp-active-btn-color: #{var-list(--tct-pill-tertiary-active-font-color, --t-tertiary-text, #141414)};\n --comp-active-btn-border-color: #{var-list(--tct-pill-tertiary-active-border-color, --t-tertiary, #e8f5fc)};\n --comp-hover-active-btn-background: #{var-list(\n --tct-pill-tertiary-active-hover-background,\n --t-tertiary-l3,\n #eff8fd\n )};\n --comp-hover-active-btn-border-color: #{var-list(\n --tct-pill-tertiary-active-hover-border-color,\n --t-tertiary-l3,\n #eff8fd\n )};\n }\n}\n\n.btn-height-wrapper {\n height: var(--comp-pill-min-height);\n display: flex;\n align-items: center;\n cursor: pointer;\n &:focus {\n box-shadow: none;\n }\n\n :host([disabled]) & {\n cursor: not-allowed;\n }\n}\n\n.btn-close,\n.btn-primary {\n cursor: pointer;\n height: var(--comp-pill-btn-height);\n border-style: solid;\n border-radius: var-list(var-prefixer(pill-btn-border-radius), 30px);\n transition-property: background, color, padding, width, opacity;\n transition: var-list(var-prefixer(pill-btn-tween), --app-tween-1, unquote('0.2s ease'));\n}\n\n.btn-close,\n.btn-primary,\nq2-icon {\n :host([disabled]) & {\n opacity: var-list(var-prefixer(pill-disabled-opacity), --tct-disabled-opacity, --app-disabled-opacity, 0.4);\n cursor: not-allowed;\n }\n}\n\n.btn-primary {\n background: var(--comp-btn-background);\n box-shadow: var(--comp-btn-box-shadow);\n backdrop-filter: var(--comp-btn-backdrop-filter);\n border-width: var-list(--comp-pill-btn-border-width);\n border-color: var-list(var-prefixer(pill-btn-border-color), --t-a11y-gray-color-AA, #949494);\n padding-inline: var(--comp-btn-padding);\n padding-right: calc(var(--comp-btn-padding) + var(--comp-close-size));\n font-size: var-list(var-prefixer(pill-btn-font-size), --app-font-size, 14px);\n font-weight: var-list(--tct-pill-btn-font-weight, 400);\n color: var(--comp-btn-color);\n display: block;\n width: 100%;\n text-align: start;\n\n &:focus {\n box-shadow: var-list(--tct-pill-btn-focus-box-shadow, --const-double-focus-ring);\n }\n\n &:focus-visible {\n box-shadow: var-list(--tct-pill-btn-focus-visible-box-shadow, --const-double-focus-ring);\n }\n\n &:hover {\n background: var(--comp-hover-btn-background);\n }\n\n .has-options &,\n .has-icon & {\n padding-right: calc(#{var-list(var-prefixer(pill-icon-gap), --app-scale-1x, 5px)} + var(--comp-close-size));\n }\n\n .has-options & {\n @include line-clamp(1);\n max-width: var-list(var-prefixer(pill-max-width), 200px);\n }\n\n :host([active]:not([active='false'])) & {\n background: var(--comp-active-btn-background);\n box-shadow: var(--comp-active-btn-box-shadow);\n backdrop-filter: var(--comp-active-btn-backdrop-filter);\n border-color: var(--comp-active-btn-border-color);\n color: var(--comp-active-btn-color);\n\n &:focus {\n box-shadow: var-list(--tct-pill-btn-focus-box-shadow, --const-double-focus-ring);\n }\n\n &:focus-visible {\n box-shadow: var-list(--tct-pill-btn-focus-visible-box-shadow, --const-double-focus-ring);\n }\n\n &:hover {\n background: var(--comp-hover-active-btn-background);\n border-color: var(--comp-hover-active-btn-border-color);\n }\n }\n}\n\n.btn-close {\n background: transparent;\n border-color: transparent;\n border-width: var(--comp-pill-btn-border-width);\n width: var(--comp-close-size);\n height: var(--comp-close-size);\n padding: 0;\n border: 0;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n right: 0;\n top: 50%;\n transform: translateY(-50%);\n opacity: 0;\n &:focus-visible {\n box-shadow: var-list(--tct-pill-btn-focus-visible-box-shadow, --const-double-focus-ring);\n }\n :host([active]:not([active='false'])) & {\n color: var(--comp-active-btn-color);\n }\n\n .has-options &,\n .has-icon & {\n opacity: 1;\n }\n}\n\nq2-icon {\n --tct-icon-stroke-primary: #{var-list(--tct-pill-icon-stroke, currentcolor)};\n --tct-icon-stroke-width: #{var-list(--tct-pill-icon-stroke-width, inherit)};\n width: var-list(var-prefixer(pill-icon-size), 14px);\n height: var-list(var-prefixer(pill-icon-size), 14px);\n transition-property: transform;\n transition: var-list(var-prefixer(pill-btn-tween), --app-tween-1, unquote('0.2s ease'));\n}\n\ndiv.btn-close {\n pointer-events: none;\n\n :host([open]) & q2-icon {\n transform: rotate(180deg);\n }\n}\n\nbutton.btn-close {\n :host([active]:not([active='false'])) & {\n &:focus,\n &:hover {\n background: var-list(var-prefixer(pill-hover-close-btn-background), --t-top-a1, rgba(13, 13, 13, 0.35));\n border-color: var-list(var-prefixer(pill-hover-close-btn-border-color), --t-top-a1, rgba(13, 13, 13, 0.35));\n }\n }\n}\n\nq2-popover {\n top: calc(var(--comp-pill-min-height) - calc(calc(var(--comp-pill-min-height) - var(--comp-pill-btn-height)) / 2));\n}\n\n:host([borderless]:not([borderless='false'])) {\n button {\n border-style: none;\n }\n}\n","import {\n Component,\n State,\n Prop,\n h,\n ComponentInterface,\n Listen,\n Watch,\n Element,\n EventEmitter,\n Event,\n Method,\n} from '@stencil/core';\nimport { isEventFromElement, loc, overrideFocus, resizeIframe, waitForNextPaint } from 'src/utils';\nimport mirrorEmit from '@/utils/mirror-emit';\nimport { shouldShowActionSheet, showActionSheetList } from 'src/utils/action-sheet';\nimport { OptionValue } from '../q2-option-list/q2-option-list';\n\n/**\n * @name Pill\n * @category Display\n * @summary Use for displaying and removing active filters in data views.\n * @slot popover-top - An optional slot to display custom content persistently at the top of the popover. This is **not** compatible with the action sheet workflow.\n * @slot popover-bottom - An optional slot to display custom content persistently at the bottom of the popover. This is **not** compatible with the action sheet workflow.\n */\n@Component({ tag: 'q2-pill', shadow: true, styleUrl: 'q2-pill.scss' })\nexport class Q2Pill implements ComponentInterface {\n // #region Own Properties\n\n mutationObserver: MutationObserver;\n optionList: HTMLQ2OptionListElement;\n popoverBottomContainer: HTMLElement;\n popoverElement: HTMLQ2PopoverElement;\n popoverTopContainer: HTMLElement;\n primaryBtn: HTMLButtonElement;\n primaryBtnWrapper: HTMLElement;\n scheduledAfterRender: (() => void)[] = [];\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region State Properties\n\n @State()\n hasPopoverBottom = false;\n\n @State()\n hasPopoverTop = false;\n\n @State()\n optionCount: number;\n\n @State()\n selectedOptionElements: HTMLQ2OptionElement[] = [];\n\n // #endregion\n // #region Public Property API\n\n /** Determine if the elements is in the selected state, with values. */\n @Prop({ reflect: true, mutable: true })\n active: boolean;\n\n /** Indicates that the pill has no border */\n @Prop({ reflect: true })\n borderless: boolean;\n\n /** Indicates the pill cannot be focused or interacted with. */\n @Prop({ reflect: true })\n disabled: boolean;\n\n /**\n * Instructs the component to use the action sheet workflow for displaying its options.\n *\n * For more information, see [Action Sheets](https://tecton.q2developer.com/guides/action-sheets/).\n */\n @Prop()\n hoist: boolean = !!window.Tecton?.useActionSheets;\n\n /**\n * The text that populates the label.\n * @localizable\n */\n @Prop({ reflect: true })\n label: string;\n\n /**\n * The maximum number of characters to display before ellipcizing.\n * @info\n * Limitless by default.\n */\n @Prop({ reflect: true })\n maxLength: number;\n\n /**\n * Enables the multi-select ability for the dropdown.\n * @info\n * Only applicable when options are provided.\n */\n @Prop({ reflect: true })\n multiple: boolean;\n\n /**\n * Determine whether the popover is open or closed.\n *\n * @readonly\n */\n @Prop({ reflect: true, mutable: true })\n open: boolean;\n\n /** Determines the label that is applied to the option list for accessibility purposes. */\n @Prop()\n optionListLabel: string;\n\n /** Aligns the popover dropdown to the left or right side of the input field. */\n @Prop({ mutable: true })\n popoverAlignment: 'left' | 'right' = 'right';\n\n /**\n * Force the direction of the popover dropdown when it opens.\n * If no value is passed, the component will auto-detect the direction based on available space.\n */\n @Prop()\n popoverDirection: 'up' | 'down';\n\n /**\n * Force the maximum height of the popover. This value will be interpreted as pixels.\n * If no value is passed, or the value exceeds available space, the component will auto-detect the maximum height based on available space.\n */\n @Prop()\n popoverMaxHeight: number;\n\n /** @deprecated */\n @Prop()\n popoverMinHeight: number = 150;\n\n /** A list of the selected options on the element. */\n @Prop({ mutable: true })\n selectedOptions: OptionValue[] = [];\n\n /** The color of the element when in the active state. */\n @Prop({ reflect: true })\n theme: 'primary' | 'secondary' | 'tertiary';\n\n /** The value emitted when the component is selected. */\n @Prop({ reflect: true, mutable: true })\n value: string;\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the pill is clicked or the selected options change.\n *\n * When multi-select is enabled, `value` will be `undefined`.\n * @legacyEvent\n * @deprecated Use 'tctChange' instead\n */\n @Event()\n change: EventEmitter<{ value: string; values: OptionValue[]; active: boolean }>;\n\n /**\n * Emitted when the pill is clicked or the selected options change.\n *\n * When multi-select is enabled, `value` will be `undefined`.\n * @legacyEvent\n */\n @Event()\n tctChange: EventEmitter<{ value: string; values: OptionValue[]; active: boolean }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n disconnectedCallback() {\n this.mutationObserver?.disconnect();\n this.mutationObserver = null;\n }\n\n componentWillLoad() {\n const observer = new MutationObserver(this.onMutationObserved);\n observer.observe(this.hostElement, { childList: true, attributes: true });\n this.mutationObserver = observer;\n }\n\n componentDidLoad() {\n overrideFocus(this.hostElement);\n this.syncValueProperties();\n }\n\n componentDidRender() {\n this.scheduledAfterRender.forEach(fn => fn());\n this.scheduledAfterRender = [];\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('displayChanged')\n handleSelectedDisplay() {\n if (this.multiple) return;\n this.updateSelectedOptionElements();\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n this.primaryBtn.focus();\n }\n\n @Listen('popoverStateChanged')\n async popoverStateHandler({ detail: { open } }: CustomEvent<{ open: boolean }>) {\n if (this.open !== open) this.open = open;\n if (open) return;\n this.setOptionListActiveElement(null);\n }\n\n // #endregion\n // #region Public Methods API\n\n /**\n * Emulates clicking the `<button>` to hide the popover if it is visible.\n *\n * @testOnly\n */\n @Method()\n async closePopover() {\n if (!this.open || this.disabled) return;\n this._togglePopover();\n }\n\n /**\n * Emulates clicking the `<button>` to display the popover if it is hidden.\n *\n * @testOnly\n */\n @Method()\n async openPopover() {\n if (this.open || this.disabled) return;\n this._togglePopover();\n }\n\n /**\n * Emulates clicking the `<button>` to display the popover and selecting the option(s) with the specified value(s).\n *\n * If multi-select is enabled and the `closePopover` argument is `true` (default), the popover will be closed\n * after the option(s) are selected.\n *\n * @testOnly\n */\n @Method()\n async setValue(values: string | string[], options: { closePopover?: boolean } = { closePopover: true }) {\n const valueSet = new Set(Array.isArray(values) ? values : [values]);\n const allOptions = (await this.getOptionListOptions()) as HTMLQ2OptionElement[];\n if (!this.open) {\n await this.openPopover();\n await waitForNextPaint();\n }\n\n valueSet.forEach(value => {\n allOptions.find(option => option.value === value)?.click();\n });\n\n if (options.closePopover) {\n await this.closePopover();\n await waitForNextPaint();\n }\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('selectedOptions')\n selectedOptionsChanged(newValue) {\n const { multiple } = this;\n const firstValue = newValue?.[0]?.value ?? null;\n if (multiple) {\n if (this.value) this.value = null;\n this.updateSelectedOptionElements();\n } else if (this.value === firstValue) {\n this.updateSelectedOptionElements();\n } else {\n this.value = firstValue;\n }\n }\n\n @Watch('value')\n @Watch('label')\n async valueChanged(newValue, _oldValue, propName) {\n const { label, multiple, selectedOptions, value } = this;\n const valueProxy = propName === 'value' ? newValue : value;\n const labelProxy = propName === 'label' ? newValue : label;\n if (multiple) return;\n const firstValue = selectedOptions?.[0]?.value ?? null;\n if (propName === 'value' && newValue === firstValue) this.updateSelectedOptionElements();\n else {\n const selectedOption = (await this.getOption(newValue)) as HTMLQ2OptionElement;\n const { value, display } = selectedOption || { value: valueProxy, display: labelProxy };\n this.selectedOptions = value ? [{ value, display }] : [];\n }\n }\n\n // #endregion\n // #region Local Methods\n\n get buttonContent() {\n const { label, selectedOptions, selectedOptionElements, optionCount } = this;\n if (!optionCount || selectedOptionElements.length === 0) return loc(label);\n else if (selectedOptionElements.length === 1) return `${loc(selectedOptionElements[0].display)}`;\n\n return loc('tecton.element.pill.activeCount', { count: selectedOptions.length });\n }\n\n get truncatedButtonContent() {\n const { maxLength, buttonContent } = this;\n if (maxLength && buttonContent.length > maxLength) return `${buttonContent.substring(0, maxLength)}…`;\n else return buttonContent;\n }\n\n _togglePopover() {\n const { primaryBtn } = this;\n primaryBtn?.click();\n primaryBtn?.focus();\n primaryBtn.dispatchEvent(new FocusEvent('focus'));\n }\n\n clearSelectedOptions = () => {\n this.selectedOptions = [];\n this.value = null;\n this.active = false;\n this.open = false;\n this.primaryBtn.focus();\n mirrorEmit(this, ['change', 'tctChange'], { value: null, values: [], active: false });\n this.scheduledAfterRender.push(resizeIframe);\n };\n\n determineOptionCount = async () => {\n if (this.optionList) {\n const allOptions = await this.getOptionListOptions();\n this.optionCount = allOptions.length;\n } else {\n const numberOfOptions = this.hostElement.querySelectorAll('q2-option').length;\n this.optionCount = numberOfOptions;\n }\n };\n\n executeActionSheet = async (event: MouseEvent | KeyboardEvent) => {\n const result = await showActionSheetList(this, event);\n this.primaryBtn.focus();\n this.handleSelectionChanges(result);\n };\n\n getOption = async (value: string) => {\n if (this.optionList) {\n const options = await this.getOptionListOptions();\n return options.find(option => option.value === value);\n } else {\n return this.hostElement.querySelector<HTMLQ2OptionElement>(`q2-option[value=\"${value}\"]`);\n }\n };\n\n // for spec testing\n getOptionListOptions = async () => {\n return await this.optionList?.getOptions();\n };\n\n handleChange = event => {\n event.stopPropagation();\n if (!this.optionCount) return;\n this.handleSelectionChanges(event.detail);\n };\n\n handleClick = async (event: MouseEvent) => {\n event.stopPropagation();\n if (this.disabled) return;\n if (this.optionCount) {\n if (shouldShowActionSheet(this)) {\n this.executeActionSheet(event);\n } else {\n await this.popoverElement.toggle();\n }\n } else {\n const { value, label } = this;\n const isActive = (this.active = !this.active);\n const values = isActive ? [{ value, display: label }] : [];\n mirrorEmit(this, ['change', 'tctChange'], {\n value,\n values,\n active: isActive,\n });\n }\n };\n\n handleFocusOut = async (event: FocusEvent) => {\n const relatedTarget = event.relatedTarget as unknown as HTMLElement;\n if (this.popoverElement?.contains(relatedTarget)) return;\n if (this.hostElement.contains(relatedTarget)) return;\n this.open = false;\n };\n\n handleKeydown = async (event: KeyboardEvent) => {\n const isTabMetaOrCtrl = event.metaKey || event.ctrlKey || event.key === 'Tab';\n if (!this.optionCount || this.disabled || isTabMetaOrCtrl) return;\n event.preventDefault();\n const hasSlot = this.hasPopoverTop || this.hasPopoverBottom;\n\n // slots are incompatible with action sheet\n if (shouldShowActionSheet(this, event) && !hasSlot) {\n this.executeActionSheet(event);\n } else {\n this.handleOptionListExternalKeydown(event);\n }\n };\n\n // for spec testing\n handleOptionListExternalKeydown = async (event: KeyboardEvent) => {\n await this.optionList?.handleExternalKeydown(event);\n };\n\n handleSelectionChanges = async (changeDetails: { value?: string; values?: OptionValue[] }) => {\n const { multiple } = this;\n const { value = '', values = [] } = changeDetails;\n const isActive = multiple ? !!values.length : !!value;\n if (!this.hostElement.onchange) {\n if (multiple) {\n this.selectedOptions = values;\n this.value = undefined;\n } else {\n const selectedOption = (await this.getOption(value)) as HTMLQ2OptionElement;\n this.selectedOptions = selectedOption\n ? [{ value: selectedOption.value, display: selectedOption.display }]\n : [];\n this.value = selectedOption?.value || undefined;\n }\n }\n\n mirrorEmit(this, ['change', 'tctChange'], {\n value: multiple ? undefined : value,\n values,\n active: isActive,\n });\n };\n\n handleWrapperClick = () => {\n this.primaryBtn.focus();\n this.primaryBtn.click();\n };\n\n onClickElsewhere = (event: CustomEvent) => {\n const target = event.target as HTMLClickElsewhereElement;\n if (target.localName === 'click-elsewhere') {\n event.stopPropagation();\n const { popoverElement } = this;\n if (!popoverElement) return;\n popoverElement.open = false;\n }\n };\n\n onMutationObserved = () => {\n this.updateSlotState();\n this.determineOptionCount();\n this.updateSelectedOptionElements();\n };\n\n onPopoverState = (event: CustomEvent<{ open: boolean; action: 'close' | 'select' | 'open' }>) => {\n const { open, action } = event.detail;\n if (open) return;\n\n switch (action) {\n case 'select':\n case 'close':\n this.primaryBtn.focus();\n break;\n }\n };\n\n // for spec testing\n setOptionListActiveElement = async (index: number) => {\n await this.optionList?.setActiveElement(index);\n };\n\n syncValueProperties = () => {\n const { value, selectedOptions } = this;\n if (!!selectedOptions?.length) this.selectedOptionsChanged(selectedOptions);\n else if (value) this.valueChanged(value, null, 'value');\n };\n\n updateSelectedOptionElements = async () => {\n const { selectedOptions = [] } = this;\n const selectedValues = selectedOptions.map(option => option.value);\n const options = await this.getOptionListOptions();\n if (this.optionCount) this.active = !!selectedValues.length;\n this.selectedOptionElements =\n (options?.filter(option => selectedValues.includes(option.value)) as HTMLQ2OptionElement[]) || [];\n };\n\n updateSlotState = () => {\n const { hostElement, hasPopoverTop, hasPopoverBottom } = this;\n const popTopSlot = hostElement.shadowRoot.querySelector<HTMLSlotElement>('slot[name=\"popover-top\"]');\n const popBottomSlot = hostElement.shadowRoot.querySelector<HTMLSlotElement>('slot[name=\"popover-bottom\"]');\n const topSlotHasNode = popTopSlot?.assignedNodes().length > 0;\n const bottomSlotHasNode = popBottomSlot?.assignedNodes().length > 0;\n\n if (hasPopoverTop !== topSlotHasNode) this.hasPopoverTop = topSlotHasNode;\n if (hasPopoverBottom !== bottomSlotHasNode) this.hasPopoverBottom = bottomSlotHasNode;\n };\n\n // #endregion\n // #region Render Methods\n\n renderHiddenElement() {\n return (\n <div\n id=\"option-description\"\n class=\"sr\"\n aria-hidden=\"true\"\n >\n {loc('tecton.element.optionList.optionCount', [this.optionCount])}\n </div>\n );\n }\n\n renderIcon() {\n const { optionCount, active } = this;\n const isButton = optionCount && active;\n const TagName = isButton ? 'button' : 'div';\n const iconName = isButton || !optionCount ? 'close' : 'chevron-down';\n\n return (\n <TagName\n class=\"btn-close\"\n onClick={(isButton && this.clearSelectedOptions) || undefined}\n disabled={(isButton && this.disabled) || undefined}\n aria-label={(isButton && loc('tecton.element.pill.clearSelection')) || undefined}\n type={(isButton && 'button') || undefined}\n >\n <q2-icon type={iconName}></q2-icon>\n </TagName>\n );\n }\n\n render() {\n const { optionCount, active, open } = this;\n const wrapperClassNames = ['btn-wrapper'];\n if (optionCount || active) wrapperClassNames.push('has-icon');\n if (optionCount) wrapperClassNames.push('has-options');\n\n return (\n <click-elsewhere onChange={this.onClickElsewhere}>\n <div class={wrapperClassNames.join(' ')}>\n <div\n class=\"btn-height-wrapper\"\n ref={el => (this.primaryBtnWrapper = el)}\n onClick={this.handleWrapperClick}\n tabIndex={-1}\n >\n <button\n class=\"btn-primary\"\n test-id=\"btn-control\"\n type=\"button\"\n role={(optionCount && 'combobox') || undefined}\n ref={el => (this.primaryBtn = el)}\n onClick={this.handleClick}\n onKeyDown={this.handleKeydown}\n onFocusout={this.handleFocusOut}\n disabled={this.disabled}\n aria-roledescription={!optionCount && 'filter'}\n aria-controls={(optionCount && 'option-list') || undefined}\n aria-expanded={(optionCount && `${!!open}`) || undefined}\n aria-label={`${this.buttonContent}${!optionCount && active ? ` ${loc('tecton.element.pill.active')}` : ''}`}\n aria-describedby={(optionCount && 'option-description') || undefined}\n >\n {this.truncatedButtonContent}\n </button>\n </div>\n {this.renderIcon()}\n {!!optionCount && this.renderHiddenElement()}\n </div>\n {this.optionCount > 0 && (\n <q2-popover\n ref={el => (this.popoverElement = el)}\n controlElement={this.primaryBtn}\n open={this.open}\n max-height={this.popoverMaxHeight}\n minHeight={this.popoverMinHeight}\n direction={this.popoverDirection}\n align={this.popoverAlignment}\n onFocusout={this.handleFocusOut}\n >\n <div class=\"popover-content\">\n <div\n ref={el => (this.popoverTopContainer = el)}\n class=\"popover-top-container\"\n tabindex=\"-1\"\n hidden={!this.hasPopoverTop}\n onKeyDown={this.handleKeydown}\n >\n <slot name=\"popover-top\"></slot>\n </div>\n <q2-option-list\n type=\"listbox\"\n ref={el => (this.optionList = el)}\n id=\"option-list\"\n onChange={this.handleChange}\n multiple={this.multiple}\n selectedOptions={this.selectedOptions}\n onReady={() => this.updateSelectedOptionElements()}\n onPopoverState={this.onPopoverState}\n label={loc('tecton.element.optionList.label', [this.optionListLabel])}\n >\n <slot />\n </q2-option-list>\n <div\n ref={el => (this.popoverBottomContainer = el)}\n class=\"popover-bottom-container\"\n tabindex=\"-1\"\n hidden={!this.hasPopoverBottom}\n onKeyDown={this.handleKeydown}\n >\n <slot name=\"popover-bottom\"></slot>\n </div>\n </div>\n </q2-popover>\n )}\n </click-elsewhere>\n );\n }\n\n // #endregion\n}\n"],"mappings":";;;;;;;;AAAA,MAAMA,IAAY;;MC0BLC,IAAM;EADnB,WAAAC,CAAAC;;;;;IAWIC,KAAoBC,uBAAmB;;;QAYvCD,KAAgBE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eb,IAAS,IAAIsH,EAAI,kCAAkC;MAAI,oBACxFzG,KAAe,wBAAyB0C;OAE1DtE,KAAKuI,0BAGbvI,KAAKgJ,gBACHpH,KAAe5B,KAAK4I,wBAE1B5I,KAAK4B,cAAc,KAChBiH,EAAA;MAAA/E,KAAA;MACI4F,KAAKC,KAAO3J,KAAKkD,iBAAiByG;MAClCM,gBAAgBjK,KAAKiB;MACrBD,MAAMhB,KAAKgB;MAAI,cACHhB,KAAKkK;MACjBC,WAAWnK,KAAKW;MAChByJ,WAAWpK,KAAKqK;MAChBC,OAAOtK,KAAKU;MACZsJ,YAAYhK,KAAKuD;OAEjBsF,EAAK;MAAA/E,KAAA;MAAAiF,OAAM;OACPF,EAAA;MAAA/E,KAAA;MACI4F,KAAKC,KAAO3J,KAAKuK,sBAAsBZ;MACvCZ,OAAM;MACNyB,UAAS;MACTC,SAASzK,KAAKG;MACd4J,WAAW/J,KAAK0D;OAEhBmF,EAAA;MAAA/E,KAAA;MAAM4G,MAAK;SAEf7B,EAAA;MAAA/E,KAAA;MACIuF,MAAK;MACLK,KAAKC,KAAO3J,KAAKyB,aAAakI;MAC9Bb,IAAG;MACHU,UAAUxJ,KAAK4C;MACfwB,UAAUpE,KAAKoE;MACfxD,iBAAiBZ,KAAKY;MACtB+J,SAAS,MAAM3K,KAAK+E;MACpBC,gBAAgBhF,KAAKgF;MACrB5B,OAAOiF,EAAI,mCAAmC,EAACrI,KAAK4K;OAEpD/B,EAAA;MAAA/E,KAAA;SAEJ+E,EAAA;MAAA/E,KAAA;MACI4F,KAAKC,KAAO3J,KAAK6K,yBAAyBlB;MAC1CZ,OAAM;MACNyB,UAAS;MACTC,SAASzK,KAAKE;MACd6J,WAAW/J,KAAK0D;OAEhBmF,EAAM;MAAA/E,KAAA;MAAA4G,MAAK","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"q2-radio-group.entry.esm.js","sources":["src/components/q2-radio-group/q2-radio-group.scss?tag=q2-radio-group&encapsulation=shadow","src/components/q2-radio-group/q2-radio-group.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n --comp-default-radio-group-margin: #{var-list(var-prefixer(radio-group-margin-top), --app-scale-5x, 25px) 0\n var-list(var-prefixer(radio-group-margin-bottom), --app-scale-5x, 25px)};\n display: block;\n margin: var-list(--tct-radio-group-margin, --comp-default-radio-group-margin);\n}\n\nfieldset {\n padding: var(--tct-radio-group-fieldset-padding, 0);\n margin: 0;\n border: 0;\n position: relative;\n}\n\n.label-row {\n display: grid;\n grid-template-columns: 1fr 24px;\n grid-template-areas: 'label icon';\n column-gap: var(--tct-radio-group-label-column-gap, var(--app-scale-2x, 10px));\n\n color: var-list(--tct-radio-group-label-font-color, inherit);\n font-size: var-list(--tct-radio-group-label-font-size, inherit);\n font-weight: var-list(--tct-radio-group-label-font-weight, 600);\n text-transform: var-list(--tct-radio-group-label-text-transform, none);\n letter-spacing: var-list(--tct-radio-group-label-letter-spacing, inherit);\n\n q2-icon {\n grid-area: icon;\n margin-top: -2px;\n margin-bottom: -2px;\n }\n}\n\n.group-legend {\n font-weight: 600;\n}\n\nlegend.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n border: 0;\n}\n\n.optional-tag {\n margin-left: var-list(--tct-radio-group-label-optional-margin-left, --app-scale-1x, 5px);\n color: var-list(\n var-prefixer(radio-group-label-optional-color),\n var-prefixer(a11y-color),\n var-prefixer(a11y-gray-color),\n var-prefixer(gray-7),\n var-prefixer(gray-d1),\n --app-gray-d1,\n rgba(77, 77, 77, 0.77)\n );\n font-size: var-list(var-prefixer(radio-group-label-optional-font-size), 12px);\n font-weight: var-list(var-prefixer(radio-group-label-optional-font-weight), 400);\n}\n\n.tile-container {\n &,\n .options-container {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n flex-grow: 1;\n }\n}\n\n.options-container {\n --comp-default-margin: #{var-list(--app-scale-1x, 5px)} 0;\n --comp-options-margin: #{var-list(var-prefixer(radio-group-options-margin), --comp-default-margin, unquote('5px 0'))};\n margin: var(--comp-options-margin);\n padding: var-list(var-prefixer(radio-group-options-padding), --app-scale-0x, 0px);\n border-width: 1px;\n border-color: transparent;\n border-style: solid;\n border-radius: var-list(--tct-radio-group-border-radius, --app-border-radius-1, 4px);\n\n :host([has-error]) & {\n border-color: var-list(--tct-radio-group-error-border-color, --const-stoplight-alert, #d20a0a);\n }\n :host([has-error='false']) & {\n border-color: transparent;\n }\n}\n\n.tile-container {\n &.left {\n justify-content: start;\n }\n &.right {\n justify-content: end;\n }\n\n .options-container {\n gap: var-list(var-prefixer(radio-group-tile-gap), --app-scale-2x, 10px);\n justify-content: inherit;\n }\n}\n","import {\n Component,\n Prop,\n Element,\n h,\n Listen,\n EventEmitter,\n Event,\n ComponentInterface,\n Watch,\n Fragment,\n Method,\n} from '@stencil/core';\nimport { createGuid, isEventFromElement, overrideFocus, renderLabel } from 'src/utils';\nimport mirrorEmit from '@/utils/mirror-emit';\n\n/**\n * @name Radio Group\n * @category Forms\n * @summary Use for selecting exactly one option from a small set of choices.\n * @slot label - An optional slot to display a custom label.\n */\n@Component({ tag: 'q2-radio-group', shadow: true, styleUrl: 'q2-radio-group.scss' })\nexport class Q2RadioGroup implements ComponentInterface {\n // #region Own Properties\n\n _id: string = `radio-group-${createGuid()}`;\n mutationObserver: MutationObserver;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region Public Property API\n\n /** Determines if all radios in the group are put into a `disabled` state. */\n @Prop({ reflect: true })\n disabled: boolean = false;\n\n /** Determines if the component should display in an errant state. */\n @Prop({ reflect: true })\n hasError: boolean = false;\n\n /**\n * Hide's the group's `<label>` element from view.\n * @warning\n * Only use when a visible label is impractical.\n */\n @Prop({ reflect: true, mutable: true })\n hideLabel: boolean;\n\n /**\n * Text for the fieldset legend describing the radio group.\n * @localizable\n */\n @Prop({ reflect: true })\n label: string;\n\n /** Identifier which ties all radios together for accessibility and DOM selection. */\n @Prop({ reflect: true })\n name: string;\n\n /** Appends \"(optional)\" to the group label, and sets `aria-required` on the nested input tag to `false`. */\n @Prop({ reflect: true })\n optional: boolean;\n\n /** Determines if all radios in the group can be focused, but not interacted with. */\n @Prop({ reflect: true })\n readonly: boolean;\n\n /** Provides alignment direction for tile-style radio group. */\n @Prop({ reflect: true })\n tileAlignment: 'left' | 'center' | 'right' = 'center';\n\n /** @deprecated */\n @Prop({ reflect: true, mutable: true })\n tilelayout: boolean;\n\n /** Show the radio group as a horizontal set of tiles. */\n @Prop({ reflect: true, mutable: true })\n tileLayout: boolean;\n\n /** The `value` of the currently selected `q2-radio` within the `q2-radio-group`. */\n @Prop({ mutable: true })\n value: string;\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the value of the radio group changes.\n * @legacyEvent\n * @deprecated Use 'tctChange' instead\n */\n @Event()\n change: EventEmitter<{ value: string }>;\n\n /**\n * Emitted when the value of the radio group changes.\n * @legacyEvent\n */\n @Event()\n tctChange: EventEmitter<{ value: string }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentWillLoad() {\n this.checkedRadioExists();\n this.onMutationObserved();\n this.handleDeprecatedTilelayout(this.tilelayout);\n }\n\n componentDidLoad() {\n const observer = new MutationObserver(this.onMutationObserved);\n observer.observe(this.hostElement, { childList: true });\n this.mutationObserver = observer;\n overrideFocus(this.hostElement);\n this.checkedRadioExists();\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('change')\n onHostElementChange(event: CustomEvent) {\n if (event.target === this.hostElement) {\n if (!this.hostElement.onchange) {\n this.value = event.detail.value;\n }\n }\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n const radio = this.hostElement.querySelector('q2-radio[checked]') || this.hostElement.querySelector('q2-radio');\n radio?.dispatchEvent(new FocusEvent('focus'));\n }\n\n @Listen('keydown')\n keydownHandler(event: KeyboardEvent) {\n const currentValue = (event.target as HTMLElement).getAttribute('value') || this.value;\n let index = this.radioElements.findIndex(\n el => el === event.target || (el as HTMLElement).getAttribute('value') === currentValue\n );\n let sign = 0;\n switch (event.key) {\n case 'ArrowLeft':\n case 'ArrowUp':\n sign = -1;\n break;\n\n case 'ArrowRight':\n case 'ArrowDown':\n sign = 1;\n break;\n }\n\n if (index === -1 || sign === 0) {\n return;\n }\n index += sign;\n index = sign < 0 ? Math.max(0, index) : Math.min(this.radioElements.length - 1, index);\n event.preventDefault();\n if (!this.readonly) {\n this.value = this.radioElements[index].value;\n }\n this.radioElements[index].dispatchEvent(new FocusEvent('focus'));\n }\n\n // #endregion\n // #region Public Methods API\n\n /**\n * Emulates clicking the `<q2-radio>` option with the provided value.\n *\n * @testOnly\n */\n @Method()\n setValue(value: string) {\n this.radioElements.forEach(radio => {\n if (value !== radio.value) return;\n radio.click();\n });\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('disabled')\n disabledUpdated() {\n this.radioElements.forEach(radio => {\n radio.groupDisabled = this.disabled;\n });\n }\n\n @Watch('name')\n nameUpdated() {\n this.radioElements.forEach(radio => {\n radio.name = this.name || this._id;\n });\n }\n\n @Watch('readonly')\n readonlyUpdated() {\n const readonly = this.readonly;\n this.radioElements.forEach(radio => (radio.groupReadonly = readonly));\n }\n\n @Watch('tilelayout')\n handleDeprecatedTilelayout(tilelayout: boolean) {\n if (typeof tilelayout !== 'boolean') return;\n this.tileLayout = tilelayout;\n this.tilelayout = undefined;\n }\n\n @Watch('tileLayout')\n tileLayoutUpdated(tileLayout: boolean) {\n this.radioElements.forEach(radio => {\n radio.groupTileLayout = tileLayout;\n });\n }\n\n @Watch('value')\n valueUpdated(newVal: string) {\n this.radioElements.forEach(radio => {\n radio.checked = newVal === radio.value;\n // Removes checked attribute from trailing radios, if multiple individual radio's are intially checked (checked={true}) at componentDidLoad\n if (!radio.checked) {\n radio.removeAttribute('checked');\n radio.tabIndex = -1;\n } else if (radio.checked) {\n radio.tabIndex = 0;\n }\n });\n }\n\n // #endregion\n // #region Local Methods\n\n get inputId() {\n return this._id;\n }\n\n get radioElements() {\n return Array.from(this.hostElement.querySelectorAll('q2-radio')) as HTMLQ2RadioElement[];\n }\n\n checkedRadioExists = () => {\n // Returns first checked individual q2-radio or undefined if none are set to checked={true}\n const firstCheckedRadio = this.radioElements.find(radio => radio.checked === true) || undefined;\n\n // Changes radio-group[\"value\"] if inital value is not set and if a any individual q2-radio is checked\n if (!this.value && !!firstCheckedRadio) {\n this.value = firstCheckedRadio.value;\n } else if (!this.value && !firstCheckedRadio) {\n // if no radios are meant to be checked, then assign first radio tabIndex of 0\n if (this.radioElements.length) this.radioElements[0].tabIndex = 0;\n }\n };\n\n inputDom() {\n if (this.tileLayout) {\n const { tileAlignment } = this;\n const alignment = ['left', 'center', 'right'].includes(tileAlignment) ? tileAlignment : 'center';\n return (\n <div class={`tile-container ${alignment}`}>\n <div class=\"options-container\">\n <slot />\n </div>\n </div>\n );\n } else {\n return (\n <div class=\"options-container\">\n <slot />\n </div>\n );\n }\n }\n\n onInnerRadioChange = (event: CustomEvent) => {\n event.stopImmediatePropagation();\n if (this.readonly) return;\n\n mirrorEmit(this, ['change', 'tctChange'], { value: event.detail.value });\n };\n\n onMutationObserved = () => {\n this.valueUpdated(this.value);\n this.nameUpdated();\n this.disabledUpdated();\n this.readonlyUpdated();\n this.tileLayoutUpdated(this.tileLayout);\n };\n\n // #endregion\n // #region Render Methods\n\n render() {\n const showLabel = this.label || this.optional || this.readonly;\n const { hasError } = this;\n const showLabelRow = (showLabel && !this.hideLabel) || hasError;\n return (\n <Fragment>\n {showLabelRow && (\n <div class=\"label-row\">\n {showLabel && !this.hideLabel && <div class=\"group-legend\">{renderLabel(this)}</div>}\n {hasError && (\n <q2-icon\n type=\"error\"\n test-id=\"iconError\"\n ></q2-icon>\n )}\n </div>\n )}\n <fieldset\n onChange={this.onInnerRadioChange}\n aria-invalid={hasError ? `${hasError}` : undefined}\n >\n {showLabel && <legend class=\"sr-only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AA,GAAA,EAAA,0CAAA,EAAA,EACJ,YAAY,KACT,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,WAAW,EAAA,EACjB,SAAS,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,cAAc,EAAE,EAAA,WAAW,CAAC,IAAI,CAAC,CAAO,EACnF,QAAQ,KACL,CAAA,CAAA,SAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACI,IAAI,EAAC,OAAO,EAAA,SAAA,EACJ,WAAW,EAAA,CACZ,CACd,CACC,CACT,EACD,CAAA,CAAA,UAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACI,QAAQ,EAAE,IAAI,CAAC,kBAAkB,kBACnB,QAAQ,GAAG,CAAA,EAAG,QAAQ,CAAE,CAAA,GAAG,SAAS,EAAA,EAEjD,SAAS,IAAI,CAAQ,CAAA,QAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,SAAS,IAAE,WAAW,CAAC,IAAI,CAAC,CAAU,EACjE,IAAI,CAAC,QAAQ,EAAE,CACT,CACJ;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"q2-radio-group.entry.esm.js","sources":["src/components/q2-radio-group/q2-radio-group.scss?tag=q2-radio-group&encapsulation=shadow","src/components/q2-radio-group/q2-radio-group.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n --comp-default-radio-group-margin: #{var-list(var-prefixer(radio-group-margin-top), --app-scale-5x, 25px) 0\n var-list(var-prefixer(radio-group-margin-bottom), --app-scale-5x, 25px)};\n display: block;\n margin: var-list(--tct-radio-group-margin, --comp-default-radio-group-margin);\n}\n\nfieldset {\n padding: var(--tct-radio-group-fieldset-padding, 0);\n margin: 0;\n border: 0;\n position: relative;\n}\n\n.label-row {\n display: grid;\n grid-template-columns: 1fr 24px;\n grid-template-areas: 'label icon';\n column-gap: var(--tct-radio-group-label-column-gap, var(--app-scale-2x, 10px));\n\n color: var-list(--tct-radio-group-label-font-color, inherit);\n font-size: var-list(--tct-radio-group-label-font-size, inherit);\n font-weight: var-list(--tct-radio-group-label-font-weight, 600);\n text-transform: var-list(--tct-radio-group-label-text-transform, none);\n letter-spacing: var-list(--tct-radio-group-label-letter-spacing, inherit);\n\n q2-icon {\n grid-area: icon;\n margin-top: -2px;\n margin-bottom: -2px;\n }\n}\n\n.group-legend {\n font-weight: 600;\n}\n\nlegend.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n border: 0;\n}\n\n.optional-tag {\n margin-left: var-list(--tct-radio-group-label-optional-margin-left, --app-scale-1x, 5px);\n color: var-list(\n var-prefixer(radio-group-label-optional-color),\n var-prefixer(a11y-color),\n var-prefixer(a11y-gray-color),\n var-prefixer(gray-7),\n var-prefixer(gray-d1),\n --app-gray-d1,\n rgba(77, 77, 77, 0.77)\n );\n font-size: var-list(var-prefixer(radio-group-label-optional-font-size), 12px);\n font-weight: var-list(var-prefixer(radio-group-label-optional-font-weight), 400);\n}\n\n.tile-container {\n &,\n .options-container {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n flex-grow: 1;\n }\n}\n\n.options-container {\n --comp-default-margin: #{var-list(--app-scale-1x, 5px)} 0;\n --comp-options-margin: #{var-list(var-prefixer(radio-group-options-margin), --comp-default-margin, unquote('5px 0'))};\n margin: var(--comp-options-margin);\n padding: var-list(var-prefixer(radio-group-options-padding), --app-scale-0x, 0px);\n border-width: var-list(--tct-radio-group-border-width, 1px);\n border-color: transparent;\n border-style: solid;\n border-radius: var-list(--tct-radio-group-border-radius, --app-border-radius-1, 4px);\n\n :host([has-error]) & {\n border-color: var-list(--tct-radio-group-error-border-color, --const-stoplight-alert, #d20a0a);\n }\n :host([has-error='false']) & {\n border-color: transparent;\n }\n}\n\n.tile-container {\n &.left {\n justify-content: start;\n }\n &.right {\n justify-content: end;\n }\n\n .options-container {\n gap: var-list(var-prefixer(radio-group-tile-gap), --app-scale-2x, 10px);\n justify-content: inherit;\n }\n}\n","import {\n Component,\n Prop,\n Element,\n h,\n Listen,\n EventEmitter,\n Event,\n ComponentInterface,\n Watch,\n Fragment,\n Method,\n} from '@stencil/core';\nimport { createGuid, isEventFromElement, overrideFocus, renderLabel } from 'src/utils';\nimport mirrorEmit from '@/utils/mirror-emit';\n\n/**\n * @name Radio Group\n * @category Forms\n * @summary Use for selecting exactly one option from a small set of choices.\n * @slot label - An optional slot to display a custom label.\n */\n@Component({ tag: 'q2-radio-group', shadow: true, styleUrl: 'q2-radio-group.scss' })\nexport class Q2RadioGroup implements ComponentInterface {\n // #region Own Properties\n\n _id: string = `radio-group-${createGuid()}`;\n mutationObserver: MutationObserver;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region Public Property API\n\n /** Determines if all radios in the group are put into a `disabled` state. */\n @Prop({ reflect: true })\n disabled: boolean = false;\n\n /** Determines if the component should display in an errant state. */\n @Prop({ reflect: true })\n hasError: boolean = false;\n\n /**\n * Hide's the group's `<label>` element from view.\n * @warning\n * Only use when a visible label is impractical.\n */\n @Prop({ reflect: true, mutable: true })\n hideLabel: boolean;\n\n /**\n * Text for the fieldset legend describing the radio group.\n * @localizable\n */\n @Prop({ reflect: true })\n label: string;\n\n /** Identifier which ties all radios together for accessibility and DOM selection. */\n @Prop({ reflect: true })\n name: string;\n\n /** Appends \"(optional)\" to the group label, and sets `aria-required` on the nested input tag to `false`. */\n @Prop({ reflect: true })\n optional: boolean;\n\n /** Determines if all radios in the group can be focused, but not interacted with. */\n @Prop({ reflect: true })\n readonly: boolean;\n\n /** Provides alignment direction for tile-style radio group. */\n @Prop({ reflect: true })\n tileAlignment: 'left' | 'center' | 'right' = 'center';\n\n /** @deprecated */\n @Prop({ reflect: true, mutable: true })\n tilelayout: boolean;\n\n /** Show the radio group as a horizontal set of tiles. */\n @Prop({ reflect: true, mutable: true })\n tileLayout: boolean;\n\n /** The `value` of the currently selected `q2-radio` within the `q2-radio-group`. */\n @Prop({ mutable: true })\n value: string;\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the value of the radio group changes.\n * @legacyEvent\n * @deprecated Use 'tctChange' instead\n */\n @Event()\n change: EventEmitter<{ value: string }>;\n\n /**\n * Emitted when the value of the radio group changes.\n * @legacyEvent\n */\n @Event()\n tctChange: EventEmitter<{ value: string }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentWillLoad() {\n this.checkedRadioExists();\n this.onMutationObserved();\n this.handleDeprecatedTilelayout(this.tilelayout);\n }\n\n componentDidLoad() {\n const observer = new MutationObserver(this.onMutationObserved);\n observer.observe(this.hostElement, { childList: true });\n this.mutationObserver = observer;\n overrideFocus(this.hostElement);\n this.checkedRadioExists();\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('change')\n onHostElementChange(event: CustomEvent) {\n if (event.target === this.hostElement) {\n if (!this.hostElement.onchange) {\n this.value = event.detail.value;\n }\n }\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n const radio = this.hostElement.querySelector('q2-radio[checked]') || this.hostElement.querySelector('q2-radio');\n radio?.dispatchEvent(new FocusEvent('focus'));\n }\n\n @Listen('keydown')\n keydownHandler(event: KeyboardEvent) {\n const currentValue = (event.target as HTMLElement).getAttribute('value') || this.value;\n let index = this.radioElements.findIndex(\n el => el === event.target || (el as HTMLElement).getAttribute('value') === currentValue\n );\n let sign = 0;\n switch (event.key) {\n case 'ArrowLeft':\n case 'ArrowUp':\n sign = -1;\n break;\n\n case 'ArrowRight':\n case 'ArrowDown':\n sign = 1;\n break;\n }\n\n if (index === -1 || sign === 0) {\n return;\n }\n index += sign;\n index = sign < 0 ? Math.max(0, index) : Math.min(this.radioElements.length - 1, index);\n event.preventDefault();\n if (!this.readonly) {\n this.value = this.radioElements[index].value;\n }\n this.radioElements[index].dispatchEvent(new FocusEvent('focus'));\n }\n\n // #endregion\n // #region Public Methods API\n\n /**\n * Emulates clicking the `<q2-radio>` option with the provided value.\n *\n * @testOnly\n */\n @Method()\n setValue(value: string) {\n this.radioElements.forEach(radio => {\n if (value !== radio.value) return;\n radio.click();\n });\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('disabled')\n disabledUpdated() {\n this.radioElements.forEach(radio => {\n radio.groupDisabled = this.disabled;\n });\n }\n\n @Watch('name')\n nameUpdated() {\n this.radioElements.forEach(radio => {\n radio.name = this.name || this._id;\n });\n }\n\n @Watch('readonly')\n readonlyUpdated() {\n const readonly = this.readonly;\n this.radioElements.forEach(radio => (radio.groupReadonly = readonly));\n }\n\n @Watch('tilelayout')\n handleDeprecatedTilelayout(tilelayout: boolean) {\n if (typeof tilelayout !== 'boolean') return;\n this.tileLayout = tilelayout;\n this.tilelayout = undefined;\n }\n\n @Watch('tileLayout')\n tileLayoutUpdated(tileLayout: boolean) {\n this.radioElements.forEach(radio => {\n radio.groupTileLayout = tileLayout;\n });\n }\n\n @Watch('value')\n valueUpdated(newVal: string) {\n this.radioElements.forEach(radio => {\n radio.checked = newVal === radio.value;\n // Removes checked attribute from trailing radios, if multiple individual radio's are intially checked (checked={true}) at componentDidLoad\n if (!radio.checked) {\n radio.removeAttribute('checked');\n radio.tabIndex = -1;\n } else if (radio.checked) {\n radio.tabIndex = 0;\n }\n });\n }\n\n // #endregion\n // #region Local Methods\n\n get inputId() {\n return this._id;\n }\n\n get radioElements() {\n return Array.from(this.hostElement.querySelectorAll('q2-radio')) as HTMLQ2RadioElement[];\n }\n\n checkedRadioExists = () => {\n // Returns first checked individual q2-radio or undefined if none are set to checked={true}\n const firstCheckedRadio = this.radioElements.find(radio => radio.checked === true) || undefined;\n\n // Changes radio-group[\"value\"] if inital value is not set and if a any individual q2-radio is checked\n if (!this.value && !!firstCheckedRadio) {\n this.value = firstCheckedRadio.value;\n } else if (!this.value && !firstCheckedRadio) {\n // if no radios are meant to be checked, then assign first radio tabIndex of 0\n if (this.radioElements.length) this.radioElements[0].tabIndex = 0;\n }\n };\n\n inputDom() {\n if (this.tileLayout) {\n const { tileAlignment } = this;\n const alignment = ['left', 'center', 'right'].includes(tileAlignment) ? tileAlignment : 'center';\n return (\n <div class={`tile-container ${alignment}`}>\n <div class=\"options-container\">\n <slot />\n </div>\n </div>\n );\n } else {\n return (\n <div class=\"options-container\">\n <slot />\n </div>\n );\n }\n }\n\n onInnerRadioChange = (event: CustomEvent) => {\n event.stopImmediatePropagation();\n if (this.readonly) return;\n\n mirrorEmit(this, ['change', 'tctChange'], { value: event.detail.value });\n };\n\n onMutationObserved = () => {\n this.valueUpdated(this.value);\n this.nameUpdated();\n this.disabledUpdated();\n this.readonlyUpdated();\n this.tileLayoutUpdated(this.tileLayout);\n };\n\n // #endregion\n // #region Render Methods\n\n render() {\n const showLabel = this.label || this.optional || this.readonly;\n const { hasError } = this;\n const showLabelRow = (showLabel && !this.hideLabel) || hasError;\n return (\n <Fragment>\n {showLabelRow && (\n <div class=\"label-row\">\n {showLabel && !this.hideLabel && <div class=\"group-legend\">{renderLabel(this)}</div>}\n {hasError && (\n <q2-icon\n type=\"error\"\n test-id=\"iconError\"\n ></q2-icon>\n )}\n </div>\n )}\n <fieldset\n onChange={this.onInnerRadioChange}\n aria-invalid={hasError ? `${hasError}` : undefined}\n >\n {showLabel && <legend class=\"sr-only\">{renderLabel(this)}</legend>}\n {this.inputDom()}\n </fieldset>\n </Fragment>\n );\n }\n\n // #endregion\n}\n"],"names":[],"mappings":";;;;AAAA,MAAM,eAAe,GAAG,i7GAAi7G;;MCuB57G,YAAY,GAAA,MAAA;AADzB,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;AAII,QAAA,IAAA,CAAA,GAAG,GAAW,eAAe,UAAU,EAAE,EAAE;;;;AAc3C,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;;AAIzB,QAAA,IAAQ,CAAA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AAA,GAAA,EAAA,0CAAA,EACI,IAAI,EAAC,OAAO,EAAA,SAAA,EACJ,WAAW,EAAA,CACZ,CACd,CACC,CACT,EACD,CAAA,CAAA,UAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACI,QAAQ,EAAE,IAAI,CAAC,kBAAkB,kBACnB,QAAQ,GAAG,CAAA,EAAG,QAAQ,CAAE,CAAA,GAAG,SAAS,EAAA,EAEjD,SAAS,IAAI,CAAQ,CAAA,QAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,SAAS,IAAE,WAAW,CAAC,IAAI,CAAC,CAAU,EACjE,IAAI,CAAC,QAAQ,EAAE,CACT,CACJ;;;;;;;;;;;;;;;;"}
@@ -1,10 +1,10 @@
1
1
  import { r as t, c as r, h as i, F as o, g as a } from "./index-CGkHOjh1.js";
2
2
 
3
- import { c as e, o as n, i as s, r as d } from "./index-B4WYBDS9.js";
3
+ import { c as e, o as n, i as s, r as d } from "./index-C4PILj1_.js";
4
4
 
5
5
  import { m as l } from "./mirror-emit-DUjY_ucm.js";
6
6
 
7
- const p = '*{box-sizing:border-box}*:active{outline:none}*:focus-visible{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}:host{--comp-default-radio-group-margin:var(--tct-radio-group-margin-top, var(--t-radio-group-margin-top, var(--app-scale-5x, 25px))) 0 var(--tct-radio-group-margin-bottom, var(--t-radio-group-margin-bottom, var(--app-scale-5x, 25px)));display:block;margin:var(--tct-radio-group-margin, var(--comp-default-radio-group-margin))}fieldset{padding:var(--tct-radio-group-fieldset-padding, 0);margin:0;border:0;position:relative}.label-row{display:grid;grid-template-columns:1fr 24px;grid-template-areas:"label icon";column-gap:var(--tct-radio-group-label-column-gap, var(--app-scale-2x, 10px));color:var(--tct-radio-group-label-font-color, inherit);font-size:var(--tct-radio-group-label-font-size, inherit);font-weight:var(--tct-radio-group-label-font-weight, 600);text-transform:var(--tct-radio-group-label-text-transform, none);letter-spacing:var(--tct-radio-group-label-letter-spacing, inherit)}.label-row q2-icon{grid-area:icon;margin-top:-2px;margin-bottom:-2px}.group-legend{font-weight:600}legend.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;border:0}.optional-tag{margin-left:var(--tct-radio-group-label-optional-margin-left, var(--app-scale-1x, 5px));color:var(--tct-radio-group-label-optional-color, var(--t-radio-group-label-optional-color, var(--tct-a11y-color, var(--t-a11y-color, var(--tct-a11y-gray-color, var(--t-a11y-gray-color, var(--tct-gray-7, var(--t-gray-7, var(--tct-gray-d1, var(--t-gray-d1, var(--app-gray-d1, rgba(77, 77, 77, 0.77))))))))))));font-size:var(--tct-radio-group-label-optional-font-size, var(--t-radio-group-label-optional-font-size, 12px));font-weight:var(--tct-radio-group-label-optional-font-weight, var(--t-radio-group-label-optional-font-weight, 400))}.tile-container,.tile-container .options-container{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;flex-grow:1}.options-container{--comp-default-margin:var(--app-scale-1x, 5px) 0;--comp-options-margin:var(--tct-radio-group-options-margin, var(--t-radio-group-options-margin, var(--comp-default-margin, 5px 0)));margin:var(--comp-options-margin);padding:var(--tct-radio-group-options-padding, var(--t-radio-group-options-padding, var(--app-scale-0x, 0px)));border-width:1px;border-color:transparent;border-style:solid;border-radius:var(--tct-radio-group-border-radius, var(--app-border-radius-1, 4px))}:host([has-error]) .options-container{border-color:var(--tct-radio-group-error-border-color, var(--const-stoplight-alert, #d20a0a))}:host([has-error=false]) .options-container{border-color:transparent}.tile-container.left{justify-content:start}.tile-container.right{justify-content:end}.tile-container .options-container{gap:var(--tct-radio-group-tile-gap, var(--t-radio-group-tile-gap, var(--app-scale-2x, 10px)));justify-content:inherit}';
7
+ const p = '*{box-sizing:border-box}*:active{outline:none}*:focus-visible{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}:host{--comp-default-radio-group-margin:var(--tct-radio-group-margin-top, var(--t-radio-group-margin-top, var(--app-scale-5x, 25px))) 0 var(--tct-radio-group-margin-bottom, var(--t-radio-group-margin-bottom, var(--app-scale-5x, 25px)));display:block;margin:var(--tct-radio-group-margin, var(--comp-default-radio-group-margin))}fieldset{padding:var(--tct-radio-group-fieldset-padding, 0);margin:0;border:0;position:relative}.label-row{display:grid;grid-template-columns:1fr 24px;grid-template-areas:"label icon";column-gap:var(--tct-radio-group-label-column-gap, var(--app-scale-2x, 10px));color:var(--tct-radio-group-label-font-color, inherit);font-size:var(--tct-radio-group-label-font-size, inherit);font-weight:var(--tct-radio-group-label-font-weight, 600);text-transform:var(--tct-radio-group-label-text-transform, none);letter-spacing:var(--tct-radio-group-label-letter-spacing, inherit)}.label-row q2-icon{grid-area:icon;margin-top:-2px;margin-bottom:-2px}.group-legend{font-weight:600}legend.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;border:0}.optional-tag{margin-left:var(--tct-radio-group-label-optional-margin-left, var(--app-scale-1x, 5px));color:var(--tct-radio-group-label-optional-color, var(--t-radio-group-label-optional-color, var(--tct-a11y-color, var(--t-a11y-color, var(--tct-a11y-gray-color, var(--t-a11y-gray-color, var(--tct-gray-7, var(--t-gray-7, var(--tct-gray-d1, var(--t-gray-d1, var(--app-gray-d1, rgba(77, 77, 77, 0.77))))))))))));font-size:var(--tct-radio-group-label-optional-font-size, var(--t-radio-group-label-optional-font-size, 12px));font-weight:var(--tct-radio-group-label-optional-font-weight, var(--t-radio-group-label-optional-font-weight, 400))}.tile-container,.tile-container .options-container{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;flex-grow:1}.options-container{--comp-default-margin:var(--app-scale-1x, 5px) 0;--comp-options-margin:var(--tct-radio-group-options-margin, var(--t-radio-group-options-margin, var(--comp-default-margin, 5px 0)));margin:var(--comp-options-margin);padding:var(--tct-radio-group-options-padding, var(--t-radio-group-options-padding, var(--app-scale-0x, 0px)));border-width:var(--tct-radio-group-border-width, 1px);border-color:transparent;border-style:solid;border-radius:var(--tct-radio-group-border-radius, var(--app-border-radius-1, 4px))}:host([has-error]) .options-container{border-color:var(--tct-radio-group-error-border-color, var(--const-stoplight-alert, #d20a0a))}:host([has-error=false]) .options-container{border-color:transparent}.tile-container.left{justify-content:start}.tile-container.right{justify-content:end}.tile-container .options-container{gap:var(--tct-radio-group-tile-gap, var(--t-radio-group-tile-gap, var(--app-scale-2x, 10px)));justify-content:inherit}';
8
8
 
9
9
  const c = class {
10
10
  constructor(i) {
@@ -1 +1 @@
1
- {"version":3,"names":["q2RadioGroupCss","Q2RadioGroup","constructor","hostRef","this","_id","createGuid","disabled","hasError","tileAlignment","checkedRadioExists","firstCheckedRadio","radioElements","find","radio","checked","undefined","value","length","tabIndex","onInnerRadioChange","event","stopImmediatePropagation","readonly","mirrorEmit","detail","onMutationObserved","valueUpdated","nameUpdated","disabledUpdated","readonlyUpdated","tileLayoutUpdated","tileLayout","componentWillLoad","handleDeprecatedTilelayout","tilelayout","componentDidLoad","observer","MutationObserver","observe","hostElement","childList","mutationObserver","overrideFocus","onHostElementChange","target","onchange","delegateFocus","isEventFromElement","querySelector","dispatchEvent","FocusEvent","keydownHandler","currentValue","getAttribute","index","findIndex","el","sign","key","Math","max","min","preventDefault","setValue","forEach","click","groupDisabled","name","groupReadonly","groupTileLayout","newVal","removeAttribute","inputId","Array","from","querySelectorAll","inputDom","alignment","includes","h","class","render","showLabel","label","optional","showLabelRow","hideLabel","Fragment","renderLabel","type","onChange"],"sources":["src/components/q2-radio-group/q2-radio-group.scss?tag=q2-radio-group&encapsulation=shadow","src/components/q2-radio-group/q2-radio-group.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n --comp-default-radio-group-margin: #{var-list(var-prefixer(radio-group-margin-top), --app-scale-5x, 25px) 0\n var-list(var-prefixer(radio-group-margin-bottom), --app-scale-5x, 25px)};\n display: block;\n margin: var-list(--tct-radio-group-margin, --comp-default-radio-group-margin);\n}\n\nfieldset {\n padding: var(--tct-radio-group-fieldset-padding, 0);\n margin: 0;\n border: 0;\n position: relative;\n}\n\n.label-row {\n display: grid;\n grid-template-columns: 1fr 24px;\n grid-template-areas: 'label icon';\n column-gap: var(--tct-radio-group-label-column-gap, var(--app-scale-2x, 10px));\n\n color: var-list(--tct-radio-group-label-font-color, inherit);\n font-size: var-list(--tct-radio-group-label-font-size, inherit);\n font-weight: var-list(--tct-radio-group-label-font-weight, 600);\n text-transform: var-list(--tct-radio-group-label-text-transform, none);\n letter-spacing: var-list(--tct-radio-group-label-letter-spacing, inherit);\n\n q2-icon {\n grid-area: icon;\n margin-top: -2px;\n margin-bottom: -2px;\n }\n}\n\n.group-legend {\n font-weight: 600;\n}\n\nlegend.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n border: 0;\n}\n\n.optional-tag {\n margin-left: var-list(--tct-radio-group-label-optional-margin-left, --app-scale-1x, 5px);\n color: var-list(\n var-prefixer(radio-group-label-optional-color),\n var-prefixer(a11y-color),\n var-prefixer(a11y-gray-color),\n var-prefixer(gray-7),\n var-prefixer(gray-d1),\n --app-gray-d1,\n rgba(77, 77, 77, 0.77)\n );\n font-size: var-list(var-prefixer(radio-group-label-optional-font-size), 12px);\n font-weight: var-list(var-prefixer(radio-group-label-optional-font-weight), 400);\n}\n\n.tile-container {\n &,\n .options-container {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n flex-grow: 1;\n }\n}\n\n.options-container {\n --comp-default-margin: #{var-list(--app-scale-1x, 5px)} 0;\n --comp-options-margin: #{var-list(var-prefixer(radio-group-options-margin), --comp-default-margin, unquote('5px 0'))};\n margin: var(--comp-options-margin);\n padding: var-list(var-prefixer(radio-group-options-padding), --app-scale-0x, 0px);\n border-width: 1px;\n border-color: transparent;\n border-style: solid;\n border-radius: var-list(--tct-radio-group-border-radius, --app-border-radius-1, 4px);\n\n :host([has-error]) & {\n border-color: var-list(--tct-radio-group-error-border-color, --const-stoplight-alert, #d20a0a);\n }\n :host([has-error='false']) & {\n border-color: transparent;\n }\n}\n\n.tile-container {\n &.left {\n justify-content: start;\n }\n &.right {\n justify-content: end;\n }\n\n .options-container {\n gap: var-list(var-prefixer(radio-group-tile-gap), --app-scale-2x, 10px);\n justify-content: inherit;\n }\n}\n","import {\n Component,\n Prop,\n Element,\n h,\n Listen,\n EventEmitter,\n Event,\n ComponentInterface,\n Watch,\n Fragment,\n Method,\n} from '@stencil/core';\nimport { createGuid, isEventFromElement, overrideFocus, renderLabel } from 'src/utils';\nimport mirrorEmit from '@/utils/mirror-emit';\n\n/**\n * @name Radio Group\n * @category Forms\n * @summary Use for selecting exactly one option from a small set of choices.\n * @slot label - An optional slot to display a custom label.\n */\n@Component({ tag: 'q2-radio-group', shadow: true, styleUrl: 'q2-radio-group.scss' })\nexport class Q2RadioGroup implements ComponentInterface {\n // #region Own Properties\n\n _id: string = `radio-group-${createGuid()}`;\n mutationObserver: MutationObserver;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region Public Property API\n\n /** Determines if all radios in the group are put into a `disabled` state. */\n @Prop({ reflect: true })\n disabled: boolean = false;\n\n /** Determines if the component should display in an errant state. */\n @Prop({ reflect: true })\n hasError: boolean = false;\n\n /**\n * Hide's the group's `<label>` element from view.\n * @warning\n * Only use when a visible label is impractical.\n */\n @Prop({ reflect: true, mutable: true })\n hideLabel: boolean;\n\n /**\n * Text for the fieldset legend describing the radio group.\n * @localizable\n */\n @Prop({ reflect: true })\n label: string;\n\n /** Identifier which ties all radios together for accessibility and DOM selection. */\n @Prop({ reflect: true })\n name: string;\n\n /** Appends \"(optional)\" to the group label, and sets `aria-required` on the nested input tag to `false`. */\n @Prop({ reflect: true })\n optional: boolean;\n\n /** Determines if all radios in the group can be focused, but not interacted with. */\n @Prop({ reflect: true })\n readonly: boolean;\n\n /** Provides alignment direction for tile-style radio group. */\n @Prop({ reflect: true })\n tileAlignment: 'left' | 'center' | 'right' = 'center';\n\n /** @deprecated */\n @Prop({ reflect: true, mutable: true })\n tilelayout: boolean;\n\n /** Show the radio group as a horizontal set of tiles. */\n @Prop({ reflect: true, mutable: true })\n tileLayout: boolean;\n\n /** The `value` of the currently selected `q2-radio` within the `q2-radio-group`. */\n @Prop({ mutable: true })\n value: string;\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the value of the radio group changes.\n * @legacyEvent\n * @deprecated Use 'tctChange' instead\n */\n @Event()\n change: EventEmitter<{ value: string }>;\n\n /**\n * Emitted when the value of the radio group changes.\n * @legacyEvent\n */\n @Event()\n tctChange: EventEmitter<{ value: string }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentWillLoad() {\n this.checkedRadioExists();\n this.onMutationObserved();\n this.handleDeprecatedTilelayout(this.tilelayout);\n }\n\n componentDidLoad() {\n const observer = new MutationObserver(this.onMutationObserved);\n observer.observe(this.hostElement, { childList: true });\n this.mutationObserver = observer;\n overrideFocus(this.hostElement);\n this.checkedRadioExists();\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('change')\n onHostElementChange(event: CustomEvent) {\n if (event.target === this.hostElement) {\n if (!this.hostElement.onchange) {\n this.value = event.detail.value;\n }\n }\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n const radio = this.hostElement.querySelector('q2-radio[checked]') || this.hostElement.querySelector('q2-radio');\n radio?.dispatchEvent(new FocusEvent('focus'));\n }\n\n @Listen('keydown')\n keydownHandler(event: KeyboardEvent) {\n const currentValue = (event.target as HTMLElement).getAttribute('value') || this.value;\n let index = this.radioElements.findIndex(\n el => el === event.target || (el as HTMLElement).getAttribute('value') === currentValue\n );\n let sign = 0;\n switch (event.key) {\n case 'ArrowLeft':\n case 'ArrowUp':\n sign = -1;\n break;\n\n case 'ArrowRight':\n case 'ArrowDown':\n sign = 1;\n break;\n }\n\n if (index === -1 || sign === 0) {\n return;\n }\n index += sign;\n index = sign < 0 ? Math.max(0, index) : Math.min(this.radioElements.length - 1, index);\n event.preventDefault();\n if (!this.readonly) {\n this.value = this.radioElements[index].value;\n }\n this.radioElements[index].dispatchEvent(new FocusEvent('focus'));\n }\n\n // #endregion\n // #region Public Methods API\n\n /**\n * Emulates clicking the `<q2-radio>` option with the provided value.\n *\n * @testOnly\n */\n @Method()\n setValue(value: string) {\n this.radioElements.forEach(radio => {\n if (value !== radio.value) return;\n radio.click();\n });\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('disabled')\n disabledUpdated() {\n this.radioElements.forEach(radio => {\n radio.groupDisabled = this.disabled;\n });\n }\n\n @Watch('name')\n nameUpdated() {\n this.radioElements.forEach(radio => {\n radio.name = this.name || this._id;\n });\n }\n\n @Watch('readonly')\n readonlyUpdated() {\n const readonly = this.readonly;\n this.radioElements.forEach(radio => (radio.groupReadonly = readonly));\n }\n\n @Watch('tilelayout')\n handleDeprecatedTilelayout(tilelayout: boolean) {\n if (typeof tilelayout !== 'boolean') return;\n this.tileLayout = tilelayout;\n this.tilelayout = undefined;\n }\n\n @Watch('tileLayout')\n tileLayoutUpdated(tileLayout: boolean) {\n this.radioElements.forEach(radio => {\n radio.groupTileLayout = tileLayout;\n });\n }\n\n @Watch('value')\n valueUpdated(newVal: string) {\n this.radioElements.forEach(radio => {\n radio.checked = newVal === radio.value;\n // Removes checked attribute from trailing radios, if multiple individual radio's are intially checked (checked={true}) at componentDidLoad\n if (!radio.checked) {\n radio.removeAttribute('checked');\n radio.tabIndex = -1;\n } else if (radio.checked) {\n radio.tabIndex = 0;\n }\n });\n }\n\n // #endregion\n // #region Local Methods\n\n get inputId() {\n return this._id;\n }\n\n get radioElements() {\n return Array.from(this.hostElement.querySelectorAll('q2-radio')) as HTMLQ2RadioElement[];\n }\n\n checkedRadioExists = () => {\n // Returns first checked individual q2-radio or undefined if none are set to checked={true}\n const firstCheckedRadio = this.radioElements.find(radio => radio.checked === true) || undefined;\n\n // Changes radio-group[\"value\"] if inital value is not set and if a any individual q2-radio is checked\n if (!this.value && !!firstCheckedRadio) {\n this.value = firstCheckedRadio.value;\n } else if (!this.value && !firstCheckedRadio) {\n // if no radios are meant to be checked, then assign first radio tabIndex of 0\n if (this.radioElements.length) this.radioElements[0].tabIndex = 0;\n }\n };\n\n inputDom() {\n if (this.tileLayout) {\n const { tileAlignment } = this;\n const alignment = ['left', 'center', 'right'].includes(tileAlignment) ? tileAlignment : 'center';\n return (\n <div class={`tile-container ${alignment}`}>\n <div class=\"options-container\">\n <slot />\n </div>\n </div>\n );\n } else {\n return (\n <div class=\"options-container\">\n <slot />\n </div>\n );\n }\n }\n\n onInnerRadioChange = (event: CustomEvent) => {\n event.stopImmediatePropagation();\n if (this.readonly) return;\n\n mirrorEmit(this, ['change', 'tctChange'], { value: event.detail.value });\n };\n\n onMutationObserved = () => {\n this.valueUpdated(this.value);\n this.nameUpdated();\n this.disabledUpdated();\n this.readonlyUpdated();\n this.tileLayoutUpdated(this.tileLayout);\n };\n\n // #endregion\n // #region Render Methods\n\n render() {\n const showLabel = this.label || this.optional || this.readonly;\n const { hasError } = this;\n const showLabelRow = (showLabel && !this.hideLabel) || hasError;\n return (\n <Fragment>\n {showLabelRow && (\n <div class=\"label-row\">\n {showLabel && !this.hideLabel && <div class=\"group-legend\">{renderLabel(this)}</div>}\n {hasError && (\n <q2-icon\n type=\"error\"\n test-id=\"iconError\"\n ></q2-icon>\n )}\n </div>\n )}\n <fieldset\n onChange={this.onInnerRadioChange}\n aria-invalid={hasError ? `${hasError}` : undefined}\n >\n {showLabel && <legend class=\"sr-only\">{renderLabel(this)}</legend>}\n {this.inputDom()}\n </fieldset>\n </Fragment>\n );\n }\n\n // #endregion\n}\n"],"mappings":";;;;;;AAAA,MAAMA,IAAkB;;MCuBXC,IAAY;EADzB,WAAAC,CAAAC;;;;;QAIIC,KAAAC,MAAc,eAAeC;;;qFAc7BF,KAAQG,WAAY;6EAIpBH,KAAQI,WAAY;uEA+BpBJ,KAAaK,gBAAgC;IAiL7CL,KAAkBM,qBAAG;;MAEjB,MAAMC,IAAoBP,KAAKQ,cAAcC,MAAKC,KAASA,EAAMC,YAAY,UAASC;;YAGtF,KAAKZ,KAAKa,WAAWN,GAAmB;QACpCP,KAAKa,QAAQN,EAAkBM;aAC5B,KAAKb,KAAKa,UAAUN,GAAmB;;QAE1C,IAAIP,KAAKQ,cAAcM,QAAQd,KAAKQ,cAAc,GAAGO,WAAW;;;IAwBxEf,KAAAgB,qBAAsBC;MAClBA,EAAMC;MACN,IAAIlB,KAAKmB,UAAU;MAEnBC,EAAWpB,MAAM,EAAC,UAAU,eAAc;QAAEa,OAAOI,EAAMI,OAAOR;;AAAQ;IAG5Eb,KAAkBsB,qBAAG;MACjBtB,KAAKuB,aAAavB,KAAKa;MACvBb,KAAKwB;MACLxB,KAAKyB;MACLzB,KAAK0B;MACL1B,KAAK2B,kBAAkB3B,KAAK4B;AAAW;AAmC9C;;;EA9NG,iBAAAC;IACI7B,KAAKM;IACLN,KAAKsB;IACLtB,KAAK8B,2BAA2B9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IACtD,OAAMf,UAAEA,KAAaJ;IACrB,MAAMkF,IAAgBH,MAAc/E,KAAKmF,aAAc/E;IACvD,OACIwE,EAACQ,GAAQ;MAAA7B,KAAA;OACJ2B,KACGN,EAAK;MAAArB,KAAA;MAAAsB,OAAM;OACNE,MAAc/E,KAAKmF,aAAaP,EAAA;MAAArB,KAAA;MAAKsB,OAAM;OAAgBQ,EAAYrF,QACvEI,KACGwE,EAAA;MAAArB,KAAA;MACI+B,MAAK;MAAO,WACJ;SAKxBV,EAAA;MAAArB,KAAA;MACIgC,UAAUvF,KAAKgB;MAAkB,gBACnBZ,IAAW,GAAGA,MAAaQ;OAExCmE,KAAaH,EAAQ;MAAArB,KAAA;MAAAsB,OAAM;OAAWQ,EAAYrF,QAClDA,KAAKyE","ignoreList":[]}
1
+ {"version":3,"names":["q2RadioGroupCss","Q2RadioGroup","constructor","hostRef","this","_id","createGuid","disabled","hasError","tileAlignment","checkedRadioExists","firstCheckedRadio","radioElements","find","radio","checked","undefined","value","length","tabIndex","onInnerRadioChange","event","stopImmediatePropagation","readonly","mirrorEmit","detail","onMutationObserved","valueUpdated","nameUpdated","disabledUpdated","readonlyUpdated","tileLayoutUpdated","tileLayout","componentWillLoad","handleDeprecatedTilelayout","tilelayout","componentDidLoad","observer","MutationObserver","observe","hostElement","childList","mutationObserver","overrideFocus","onHostElementChange","target","onchange","delegateFocus","isEventFromElement","querySelector","dispatchEvent","FocusEvent","keydownHandler","currentValue","getAttribute","index","findIndex","el","sign","key","Math","max","min","preventDefault","setValue","forEach","click","groupDisabled","name","groupReadonly","groupTileLayout","newVal","removeAttribute","inputId","Array","from","querySelectorAll","inputDom","alignment","includes","h","class","render","showLabel","label","optional","showLabelRow","hideLabel","Fragment","renderLabel","type","onChange"],"sources":["src/components/q2-radio-group/q2-radio-group.scss?tag=q2-radio-group&encapsulation=shadow","src/components/q2-radio-group/q2-radio-group.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n --comp-default-radio-group-margin: #{var-list(var-prefixer(radio-group-margin-top), --app-scale-5x, 25px) 0\n var-list(var-prefixer(radio-group-margin-bottom), --app-scale-5x, 25px)};\n display: block;\n margin: var-list(--tct-radio-group-margin, --comp-default-radio-group-margin);\n}\n\nfieldset {\n padding: var(--tct-radio-group-fieldset-padding, 0);\n margin: 0;\n border: 0;\n position: relative;\n}\n\n.label-row {\n display: grid;\n grid-template-columns: 1fr 24px;\n grid-template-areas: 'label icon';\n column-gap: var(--tct-radio-group-label-column-gap, var(--app-scale-2x, 10px));\n\n color: var-list(--tct-radio-group-label-font-color, inherit);\n font-size: var-list(--tct-radio-group-label-font-size, inherit);\n font-weight: var-list(--tct-radio-group-label-font-weight, 600);\n text-transform: var-list(--tct-radio-group-label-text-transform, none);\n letter-spacing: var-list(--tct-radio-group-label-letter-spacing, inherit);\n\n q2-icon {\n grid-area: icon;\n margin-top: -2px;\n margin-bottom: -2px;\n }\n}\n\n.group-legend {\n font-weight: 600;\n}\n\nlegend.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n border: 0;\n}\n\n.optional-tag {\n margin-left: var-list(--tct-radio-group-label-optional-margin-left, --app-scale-1x, 5px);\n color: var-list(\n var-prefixer(radio-group-label-optional-color),\n var-prefixer(a11y-color),\n var-prefixer(a11y-gray-color),\n var-prefixer(gray-7),\n var-prefixer(gray-d1),\n --app-gray-d1,\n rgba(77, 77, 77, 0.77)\n );\n font-size: var-list(var-prefixer(radio-group-label-optional-font-size), 12px);\n font-weight: var-list(var-prefixer(radio-group-label-optional-font-weight), 400);\n}\n\n.tile-container {\n &,\n .options-container {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n flex-grow: 1;\n }\n}\n\n.options-container {\n --comp-default-margin: #{var-list(--app-scale-1x, 5px)} 0;\n --comp-options-margin: #{var-list(var-prefixer(radio-group-options-margin), --comp-default-margin, unquote('5px 0'))};\n margin: var(--comp-options-margin);\n padding: var-list(var-prefixer(radio-group-options-padding), --app-scale-0x, 0px);\n border-width: var-list(--tct-radio-group-border-width, 1px);\n border-color: transparent;\n border-style: solid;\n border-radius: var-list(--tct-radio-group-border-radius, --app-border-radius-1, 4px);\n\n :host([has-error]) & {\n border-color: var-list(--tct-radio-group-error-border-color, --const-stoplight-alert, #d20a0a);\n }\n :host([has-error='false']) & {\n border-color: transparent;\n }\n}\n\n.tile-container {\n &.left {\n justify-content: start;\n }\n &.right {\n justify-content: end;\n }\n\n .options-container {\n gap: var-list(var-prefixer(radio-group-tile-gap), --app-scale-2x, 10px);\n justify-content: inherit;\n }\n}\n","import {\n Component,\n Prop,\n Element,\n h,\n Listen,\n EventEmitter,\n Event,\n ComponentInterface,\n Watch,\n Fragment,\n Method,\n} from '@stencil/core';\nimport { createGuid, isEventFromElement, overrideFocus, renderLabel } from 'src/utils';\nimport mirrorEmit from '@/utils/mirror-emit';\n\n/**\n * @name Radio Group\n * @category Forms\n * @summary Use for selecting exactly one option from a small set of choices.\n * @slot label - An optional slot to display a custom label.\n */\n@Component({ tag: 'q2-radio-group', shadow: true, styleUrl: 'q2-radio-group.scss' })\nexport class Q2RadioGroup implements ComponentInterface {\n // #region Own Properties\n\n _id: string = `radio-group-${createGuid()}`;\n mutationObserver: MutationObserver;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region Public Property API\n\n /** Determines if all radios in the group are put into a `disabled` state. */\n @Prop({ reflect: true })\n disabled: boolean = false;\n\n /** Determines if the component should display in an errant state. */\n @Prop({ reflect: true })\n hasError: boolean = false;\n\n /**\n * Hide's the group's `<label>` element from view.\n * @warning\n * Only use when a visible label is impractical.\n */\n @Prop({ reflect: true, mutable: true })\n hideLabel: boolean;\n\n /**\n * Text for the fieldset legend describing the radio group.\n * @localizable\n */\n @Prop({ reflect: true })\n label: string;\n\n /** Identifier which ties all radios together for accessibility and DOM selection. */\n @Prop({ reflect: true })\n name: string;\n\n /** Appends \"(optional)\" to the group label, and sets `aria-required` on the nested input tag to `false`. */\n @Prop({ reflect: true })\n optional: boolean;\n\n /** Determines if all radios in the group can be focused, but not interacted with. */\n @Prop({ reflect: true })\n readonly: boolean;\n\n /** Provides alignment direction for tile-style radio group. */\n @Prop({ reflect: true })\n tileAlignment: 'left' | 'center' | 'right' = 'center';\n\n /** @deprecated */\n @Prop({ reflect: true, mutable: true })\n tilelayout: boolean;\n\n /** Show the radio group as a horizontal set of tiles. */\n @Prop({ reflect: true, mutable: true })\n tileLayout: boolean;\n\n /** The `value` of the currently selected `q2-radio` within the `q2-radio-group`. */\n @Prop({ mutable: true })\n value: string;\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the value of the radio group changes.\n * @legacyEvent\n * @deprecated Use 'tctChange' instead\n */\n @Event()\n change: EventEmitter<{ value: string }>;\n\n /**\n * Emitted when the value of the radio group changes.\n * @legacyEvent\n */\n @Event()\n tctChange: EventEmitter<{ value: string }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentWillLoad() {\n this.checkedRadioExists();\n this.onMutationObserved();\n this.handleDeprecatedTilelayout(this.tilelayout);\n }\n\n componentDidLoad() {\n const observer = new MutationObserver(this.onMutationObserved);\n observer.observe(this.hostElement, { childList: true });\n this.mutationObserver = observer;\n overrideFocus(this.hostElement);\n this.checkedRadioExists();\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('change')\n onHostElementChange(event: CustomEvent) {\n if (event.target === this.hostElement) {\n if (!this.hostElement.onchange) {\n this.value = event.detail.value;\n }\n }\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n const radio = this.hostElement.querySelector('q2-radio[checked]') || this.hostElement.querySelector('q2-radio');\n radio?.dispatchEvent(new FocusEvent('focus'));\n }\n\n @Listen('keydown')\n keydownHandler(event: KeyboardEvent) {\n const currentValue = (event.target as HTMLElement).getAttribute('value') || this.value;\n let index = this.radioElements.findIndex(\n el => el === event.target || (el as HTMLElement).getAttribute('value') === currentValue\n );\n let sign = 0;\n switch (event.key) {\n case 'ArrowLeft':\n case 'ArrowUp':\n sign = -1;\n break;\n\n case 'ArrowRight':\n case 'ArrowDown':\n sign = 1;\n break;\n }\n\n if (index === -1 || sign === 0) {\n return;\n }\n index += sign;\n index = sign < 0 ? Math.max(0, index) : Math.min(this.radioElements.length - 1, index);\n event.preventDefault();\n if (!this.readonly) {\n this.value = this.radioElements[index].value;\n }\n this.radioElements[index].dispatchEvent(new FocusEvent('focus'));\n }\n\n // #endregion\n // #region Public Methods API\n\n /**\n * Emulates clicking the `<q2-radio>` option with the provided value.\n *\n * @testOnly\n */\n @Method()\n setValue(value: string) {\n this.radioElements.forEach(radio => {\n if (value !== radio.value) return;\n radio.click();\n });\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('disabled')\n disabledUpdated() {\n this.radioElements.forEach(radio => {\n radio.groupDisabled = this.disabled;\n });\n }\n\n @Watch('name')\n nameUpdated() {\n this.radioElements.forEach(radio => {\n radio.name = this.name || this._id;\n });\n }\n\n @Watch('readonly')\n readonlyUpdated() {\n const readonly = this.readonly;\n this.radioElements.forEach(radio => (radio.groupReadonly = readonly));\n }\n\n @Watch('tilelayout')\n handleDeprecatedTilelayout(tilelayout: boolean) {\n if (typeof tilelayout !== 'boolean') return;\n this.tileLayout = tilelayout;\n this.tilelayout = undefined;\n }\n\n @Watch('tileLayout')\n tileLayoutUpdated(tileLayout: boolean) {\n this.radioElements.forEach(radio => {\n radio.groupTileLayout = tileLayout;\n });\n }\n\n @Watch('value')\n valueUpdated(newVal: string) {\n this.radioElements.forEach(radio => {\n radio.checked = newVal === radio.value;\n // Removes checked attribute from trailing radios, if multiple individual radio's are intially checked (checked={true}) at componentDidLoad\n if (!radio.checked) {\n radio.removeAttribute('checked');\n radio.tabIndex = -1;\n } else if (radio.checked) {\n radio.tabIndex = 0;\n }\n });\n }\n\n // #endregion\n // #region Local Methods\n\n get inputId() {\n return this._id;\n }\n\n get radioElements() {\n return Array.from(this.hostElement.querySelectorAll('q2-radio')) as HTMLQ2RadioElement[];\n }\n\n checkedRadioExists = () => {\n // Returns first checked individual q2-radio or undefined if none are set to checked={true}\n const firstCheckedRadio = this.radioElements.find(radio => radio.checked === true) || undefined;\n\n // Changes radio-group[\"value\"] if inital value is not set and if a any individual q2-radio is checked\n if (!this.value && !!firstCheckedRadio) {\n this.value = firstCheckedRadio.value;\n } else if (!this.value && !firstCheckedRadio) {\n // if no radios are meant to be checked, then assign first radio tabIndex of 0\n if (this.radioElements.length) this.radioElements[0].tabIndex = 0;\n }\n };\n\n inputDom() {\n if (this.tileLayout) {\n const { tileAlignment } = this;\n const alignment = ['left', 'center', 'right'].includes(tileAlignment) ? tileAlignment : 'center';\n return (\n <div class={`tile-container ${alignment}`}>\n <div class=\"options-container\">\n <slot />\n </div>\n </div>\n );\n } else {\n return (\n <div class=\"options-container\">\n <slot />\n </div>\n );\n }\n }\n\n onInnerRadioChange = (event: CustomEvent) => {\n event.stopImmediatePropagation();\n if (this.readonly) return;\n\n mirrorEmit(this, ['change', 'tctChange'], { value: event.detail.value });\n };\n\n onMutationObserved = () => {\n this.valueUpdated(this.value);\n this.nameUpdated();\n this.disabledUpdated();\n this.readonlyUpdated();\n this.tileLayoutUpdated(this.tileLayout);\n };\n\n // #endregion\n // #region Render Methods\n\n render() {\n const showLabel = this.label || this.optional || this.readonly;\n const { hasError } = this;\n const showLabelRow = (showLabel && !this.hideLabel) || hasError;\n return (\n <Fragment>\n {showLabelRow && (\n <div class=\"label-row\">\n {showLabel && !this.hideLabel && <div class=\"group-legend\">{renderLabel(this)}</div>}\n {hasError && (\n <q2-icon\n type=\"error\"\n test-id=\"iconError\"\n ></q2-icon>\n )}\n </div>\n )}\n <fieldset\n onChange={this.onInnerRadioChange}\n aria-invalid={hasError ? `${hasError}` : undefined}\n >\n {showLabel && <legend class=\"sr-only\">{renderLabel(this)}</legend>}\n {this.inputDom()}\n </fieldset>\n </Fragment>\n );\n }\n\n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