q2-tecton-elements 1.45.3 → 1.46.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 (285) hide show
  1. package/dist/cjs/click-elsewhere_2.cjs.entry.js +1 -1
  2. package/dist/cjs/click-elsewhere_2.cjs.entry.js.map +1 -1
  3. package/dist/cjs/{index-0430339e.js → index-c385e32f.js} +1 -1
  4. package/dist/cjs/{index-0430339e.js.map → index-c385e32f.js.map} +1 -1
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/q2-btn_2.cjs.entry.js +2 -1
  7. package/dist/cjs/q2-btn_2.cjs.entry.js.map +1 -1
  8. package/dist/cjs/q2-calendar.cjs.entry.js +3 -3
  9. package/dist/cjs/q2-calendar.cjs.entry.js.map +1 -1
  10. package/dist/cjs/q2-carousel.cjs.entry.js +33 -2
  11. package/dist/cjs/q2-carousel.cjs.entry.js.map +1 -1
  12. package/dist/cjs/q2-currency.cjs.entry.js +1 -1
  13. package/dist/cjs/q2-currency.cjs.entry.js.map +1 -1
  14. package/dist/cjs/q2-dropdown.cjs.entry.js +1 -1
  15. package/dist/cjs/q2-dropdown.cjs.entry.js.map +1 -1
  16. package/dist/cjs/q2-input.cjs.entry.js +17 -10
  17. package/dist/cjs/q2-input.cjs.entry.js.map +1 -1
  18. package/dist/cjs/q2-item.cjs.entry.js +1 -1
  19. package/dist/cjs/q2-item.cjs.entry.js.map +1 -1
  20. package/dist/cjs/q2-list.cjs.entry.js +1 -1
  21. package/dist/cjs/q2-list.cjs.entry.js.map +1 -1
  22. package/dist/cjs/q2-optgroup.cjs.entry.js +59 -0
  23. package/dist/cjs/q2-optgroup.cjs.entry.js.map +1 -0
  24. package/dist/cjs/{q2-optgroup_2.cjs.entry.js → q2-option.cjs.entry.js} +1 -52
  25. package/dist/cjs/q2-option.cjs.entry.js.map +1 -0
  26. package/dist/cjs/q2-pagination.cjs.entry.js +22 -3
  27. package/dist/cjs/q2-pagination.cjs.entry.js.map +1 -1
  28. package/dist/cjs/q2-pill.cjs.entry.js +2 -2
  29. package/dist/cjs/q2-pill.cjs.entry.js.map +1 -1
  30. package/dist/cjs/q2-relative-time.cjs.entry.js +2 -2
  31. package/dist/cjs/q2-section.cjs.entry.js +2 -2
  32. package/dist/cjs/q2-select.cjs.entry.js +4 -5
  33. package/dist/cjs/q2-select.cjs.entry.js.map +1 -1
  34. package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
  35. package/dist/cjs/q2-stepper-pane.cjs.entry.js.map +1 -1
  36. package/dist/cjs/q2-stepper-vertical.cjs.entry.js +6 -6
  37. package/dist/cjs/q2-stepper-vertical.cjs.entry.js.map +1 -1
  38. package/dist/cjs/q2-stepper.cjs.entry.js +2 -2
  39. package/dist/cjs/q2-stepper.cjs.entry.js.map +1 -1
  40. package/dist/cjs/q2-tab-container.cjs.entry.js +2 -2
  41. package/dist/cjs/q2-tab-container.cjs.entry.js.map +1 -1
  42. package/dist/cjs/q2-tab-pane.cjs.entry.js +1 -1
  43. package/dist/cjs/q2-tag.cjs.entry.js +1 -1
  44. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  45. package/dist/cjs/q2-textarea.cjs.entry.js +1 -1
  46. package/dist/cjs/q2-textarea.cjs.entry.js.map +1 -1
  47. package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -2
  48. package/dist/collection/components/click-elsewhere/click-elsewhere.js.map +1 -1
  49. package/dist/collection/components/q2-btn/q2-btn.js +29 -5
  50. package/dist/collection/components/q2-btn/q2-btn.js.map +1 -1
  51. package/dist/collection/components/q2-calendar/q2-calendar.css +3 -0
  52. package/dist/collection/components/q2-calendar/q2-calendar.js +1 -1
  53. package/dist/collection/components/q2-calendar/q2-calendar.js.map +1 -1
  54. package/dist/collection/components/q2-carousel/q2-carousel.js +33 -2
  55. package/dist/collection/components/q2-carousel/q2-carousel.js.map +1 -1
  56. package/dist/collection/components/q2-currency/q2-currency.css +4 -0
  57. package/dist/collection/components/q2-data-table/q2-data-table.js +6 -6
  58. package/dist/collection/components/q2-dropdown/q2-dropdown.js +1 -1
  59. package/dist/collection/components/q2-dropdown/q2-dropdown.js.map +1 -1
  60. package/dist/collection/components/q2-input/q2-input.js +43 -15
  61. package/dist/collection/components/q2-input/q2-input.js.map +1 -1
  62. package/dist/collection/components/q2-item/q2-item.css +11 -11
  63. package/dist/collection/components/q2-list/q2-list.css +8 -5
  64. package/dist/collection/components/q2-option-list/q2-option-list.js +2 -2
  65. package/dist/collection/components/q2-pagination/q2-pagination.css +17 -2
  66. package/dist/collection/components/q2-pagination/q2-pagination.js +53 -2
  67. package/dist/collection/components/q2-pagination/q2-pagination.js.map +1 -1
  68. package/dist/collection/components/q2-pill/q2-pill.js +2 -2
  69. package/dist/collection/components/q2-pill/q2-pill.js.map +1 -1
  70. package/dist/collection/components/q2-popover/q2-popover.js +1 -1
  71. package/dist/collection/components/q2-relative-time/q2-relative-time.js +1 -1
  72. package/dist/collection/components/q2-section/q2-section.js +2 -2
  73. package/dist/collection/components/q2-select/q2-select.js +21 -5
  74. package/dist/collection/components/q2-select/q2-select.js.map +1 -1
  75. package/dist/collection/components/q2-stepper/q2-stepper.js +2 -2
  76. package/dist/collection/components/q2-stepper/q2-stepper.js.map +1 -1
  77. package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js +4 -4
  78. package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js.map +1 -1
  79. package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js +6 -6
  80. package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js.map +1 -1
  81. package/dist/collection/components/q2-tab-container/q2-tab-container.js +2 -2
  82. package/dist/collection/components/q2-tab-container/q2-tab-container.js.map +1 -1
  83. package/dist/collection/components/q2-tab-pane/q2-tab-pane.js +1 -1
  84. package/dist/collection/components/q2-tag/q2-tag.js +1 -1
  85. package/dist/collection/components/q2-textarea/q2-textarea.css +2 -2
  86. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +2 -2
  87. package/dist/components/click-elsewhere2.js.map +1 -1
  88. package/dist/components/index2.js +1 -1
  89. package/dist/components/q2-btn2.js +4 -2
  90. package/dist/components/q2-btn2.js.map +1 -1
  91. package/dist/components/q2-calendar.js +2 -2
  92. package/dist/components/q2-calendar.js.map +1 -1
  93. package/dist/components/q2-carousel.js +33 -2
  94. package/dist/components/q2-carousel.js.map +1 -1
  95. package/dist/components/q2-currency.js +1 -1
  96. package/dist/components/q2-currency.js.map +1 -1
  97. package/dist/components/q2-dropdown.js +1 -1
  98. package/dist/components/q2-dropdown.js.map +1 -1
  99. package/dist/components/q2-input2.js +20 -12
  100. package/dist/components/q2-input2.js.map +1 -1
  101. package/dist/components/q2-item.js +1 -1
  102. package/dist/components/q2-item.js.map +1 -1
  103. package/dist/components/q2-list.js +1 -1
  104. package/dist/components/q2-list.js.map +1 -1
  105. package/dist/components/q2-message2.js +1 -1
  106. package/dist/components/q2-option-list2.js +1 -1
  107. package/dist/components/q2-pagination.js +64 -13
  108. package/dist/components/q2-pagination.js.map +1 -1
  109. package/dist/components/q2-pill.js +2 -2
  110. package/dist/components/q2-pill.js.map +1 -1
  111. package/dist/components/q2-popover2.js +2 -2
  112. package/dist/components/q2-relative-time.js +1 -1
  113. package/dist/components/q2-section.js +2 -2
  114. package/dist/components/q2-select.js +1 -711
  115. package/dist/components/q2-select.js.map +1 -1
  116. package/dist/components/q2-select2.js +715 -0
  117. package/dist/components/q2-select2.js.map +1 -0
  118. package/dist/components/q2-stepper-pane.js +2 -2
  119. package/dist/components/q2-stepper-pane.js.map +1 -1
  120. package/dist/components/q2-stepper-vertical.js +6 -6
  121. package/dist/components/q2-stepper-vertical.js.map +1 -1
  122. package/dist/components/q2-stepper.js +2 -2
  123. package/dist/components/q2-stepper.js.map +1 -1
  124. package/dist/components/q2-tab-container.js +2 -2
  125. package/dist/components/q2-tab-container.js.map +1 -1
  126. package/dist/components/q2-tab-pane.js +1 -1
  127. package/dist/components/q2-tag.js +1 -1
  128. package/dist/components/q2-textarea.js +1 -1
  129. package/dist/components/q2-textarea.js.map +1 -1
  130. package/dist/components/tecton-tab-pane.js +2 -2
  131. package/dist/esm/click-elsewhere_2.entry.js +1 -1
  132. package/dist/esm/click-elsewhere_2.entry.js.map +1 -1
  133. package/dist/esm/{index-e940b40e.js → index-f0dfb099.js} +1 -1
  134. package/dist/esm/{index-e940b40e.js.map → index-f0dfb099.js.map} +1 -1
  135. package/dist/esm/loader.js +1 -1
  136. package/dist/esm/q2-btn_2.entry.js +2 -1
  137. package/dist/esm/q2-btn_2.entry.js.map +1 -1
  138. package/dist/esm/q2-calendar.entry.js +3 -3
  139. package/dist/esm/q2-calendar.entry.js.map +1 -1
  140. package/dist/esm/q2-carousel.entry.js +33 -2
  141. package/dist/esm/q2-carousel.entry.js.map +1 -1
  142. package/dist/esm/q2-currency.entry.js +1 -1
  143. package/dist/esm/q2-currency.entry.js.map +1 -1
  144. package/dist/esm/q2-dropdown.entry.js +1 -1
  145. package/dist/esm/q2-dropdown.entry.js.map +1 -1
  146. package/dist/esm/q2-input.entry.js +17 -10
  147. package/dist/esm/q2-input.entry.js.map +1 -1
  148. package/dist/esm/q2-item.entry.js +1 -1
  149. package/dist/esm/q2-item.entry.js.map +1 -1
  150. package/dist/esm/q2-list.entry.js +1 -1
  151. package/dist/esm/q2-list.entry.js.map +1 -1
  152. package/dist/esm/q2-optgroup.entry.js +55 -0
  153. package/dist/esm/q2-optgroup.entry.js.map +1 -0
  154. package/dist/esm/{q2-optgroup_2.entry.js → q2-option.entry.js} +3 -53
  155. package/dist/esm/q2-option.entry.js.map +1 -0
  156. package/dist/esm/q2-pagination.entry.js +22 -3
  157. package/dist/esm/q2-pagination.entry.js.map +1 -1
  158. package/dist/esm/q2-pill.entry.js +2 -2
  159. package/dist/esm/q2-pill.entry.js.map +1 -1
  160. package/dist/esm/q2-relative-time.entry.js +2 -2
  161. package/dist/esm/q2-section.entry.js +2 -2
  162. package/dist/esm/q2-select.entry.js +4 -5
  163. package/dist/esm/q2-select.entry.js.map +1 -1
  164. package/dist/esm/q2-stepper-pane.entry.js +2 -2
  165. package/dist/esm/q2-stepper-pane.entry.js.map +1 -1
  166. package/dist/esm/q2-stepper-vertical.entry.js +6 -6
  167. package/dist/esm/q2-stepper-vertical.entry.js.map +1 -1
  168. package/dist/esm/q2-stepper.entry.js +2 -2
  169. package/dist/esm/q2-stepper.entry.js.map +1 -1
  170. package/dist/esm/q2-tab-container.entry.js +2 -2
  171. package/dist/esm/q2-tab-container.entry.js.map +1 -1
  172. package/dist/esm/q2-tab-pane.entry.js +1 -1
  173. package/dist/esm/q2-tag.entry.js +1 -1
  174. package/dist/esm/q2-tecton-elements.js +1 -1
  175. package/dist/esm/q2-textarea.entry.js +1 -1
  176. package/dist/esm/q2-textarea.entry.js.map +1 -1
  177. package/dist/esm/tecton-tab-pane.entry.js +2 -2
  178. package/dist/q2-tecton-elements/{p-685b821c.entry.js → p-0eff37c6.entry.js} +2 -2
  179. package/dist/q2-tecton-elements/{p-fcc84527.entry.js → p-12326313.entry.js} +2 -2
  180. package/dist/q2-tecton-elements/p-12326313.entry.js.map +1 -0
  181. package/dist/q2-tecton-elements/p-176ad382.entry.js +2 -0
  182. package/dist/q2-tecton-elements/p-176ad382.entry.js.map +1 -0
  183. package/dist/q2-tecton-elements/{p-f4d77672.entry.js → p-195a133c.entry.js} +2 -2
  184. package/dist/q2-tecton-elements/p-1b37b8c6.entry.js +2 -0
  185. package/dist/q2-tecton-elements/p-1b37b8c6.entry.js.map +1 -0
  186. package/dist/q2-tecton-elements/{p-bfe9d688.entry.js → p-1c4aa7e3.entry.js} +2 -2
  187. package/dist/q2-tecton-elements/p-1c4aa7e3.entry.js.map +1 -0
  188. package/dist/q2-tecton-elements/p-1e927478.entry.js +2 -0
  189. package/dist/q2-tecton-elements/p-1e927478.entry.js.map +1 -0
  190. package/dist/q2-tecton-elements/p-36398b59.entry.js +2 -0
  191. package/dist/q2-tecton-elements/p-36398b59.entry.js.map +1 -0
  192. package/dist/q2-tecton-elements/{p-7ce6e587.js → p-3c42c90f.js} +1 -1
  193. package/dist/q2-tecton-elements/p-66af375f.entry.js +2 -0
  194. package/dist/q2-tecton-elements/p-66af375f.entry.js.map +1 -0
  195. package/dist/q2-tecton-elements/p-6ebe37ea.entry.js +2 -0
  196. package/dist/q2-tecton-elements/p-6ebe37ea.entry.js.map +1 -0
  197. package/dist/q2-tecton-elements/p-79df783e.entry.js +2 -0
  198. package/dist/q2-tecton-elements/p-79df783e.entry.js.map +1 -0
  199. package/dist/q2-tecton-elements/p-7e1dc7e8.entry.js +2 -0
  200. package/dist/q2-tecton-elements/p-7e1dc7e8.entry.js.map +1 -0
  201. package/dist/q2-tecton-elements/{p-05b015a8.entry.js → p-87bbeb9c.entry.js} +2 -2
  202. package/dist/q2-tecton-elements/{p-05b015a8.entry.js.map → p-87bbeb9c.entry.js.map} +1 -1
  203. package/dist/q2-tecton-elements/p-89305707.entry.js +2 -0
  204. package/dist/q2-tecton-elements/p-89305707.entry.js.map +1 -0
  205. package/dist/q2-tecton-elements/{p-debd5249.entry.js → p-ad274c67.entry.js} +2 -2
  206. package/dist/q2-tecton-elements/{p-debd5249.entry.js.map → p-ad274c67.entry.js.map} +1 -1
  207. package/dist/q2-tecton-elements/{p-68556733.entry.js → p-c56b58e9.entry.js} +2 -2
  208. package/dist/q2-tecton-elements/p-c56b58e9.entry.js.map +1 -0
  209. package/dist/q2-tecton-elements/{p-2436c843.entry.js → p-cb4f9b33.entry.js} +2 -2
  210. package/dist/q2-tecton-elements/p-cb4f9b33.entry.js.map +1 -0
  211. package/dist/q2-tecton-elements/{p-5dc5c4e2.entry.js → p-d013e05d.entry.js} +2 -2
  212. package/dist/q2-tecton-elements/p-d013e05d.entry.js.map +1 -0
  213. package/dist/q2-tecton-elements/p-d1522382.entry.js +2 -0
  214. package/dist/q2-tecton-elements/p-d1522382.entry.js.map +1 -0
  215. package/dist/q2-tecton-elements/{p-63192fac.entry.js → p-da7fc914.entry.js} +2 -2
  216. package/dist/q2-tecton-elements/p-e3230823.entry.js +2 -0
  217. package/dist/q2-tecton-elements/p-e3230823.entry.js.map +1 -0
  218. package/dist/q2-tecton-elements/{p-b376c111.entry.js → p-e47dbfbe.entry.js} +2 -2
  219. package/dist/q2-tecton-elements/{p-a214077c.entry.js → p-e4a2469f.entry.js} +2 -2
  220. package/dist/q2-tecton-elements/p-fc9f43f8.entry.js +2 -0
  221. package/dist/q2-tecton-elements/p-fc9f43f8.entry.js.map +1 -0
  222. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  223. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js.map +1 -1
  224. package/dist/test/elements/q2-calendar-test.e2e.js +1 -1
  225. package/dist/test/elements/q2-calendar-test.e2e.js.map +1 -1
  226. package/dist/test/elements/q2-carousel-test.e2e.js +67 -1
  227. package/dist/test/elements/q2-carousel-test.e2e.js.map +1 -1
  228. package/dist/test/elements/q2-detail/q2-list-test.e2e.js +1 -1
  229. package/dist/test/elements/q2-detail/q2-list-test.e2e.js.map +1 -1
  230. package/dist/test/elements/q2-input-test.e2e.js +25 -2
  231. package/dist/test/elements/q2-input-test.e2e.js.map +1 -1
  232. package/dist/test/elements/q2-pagination-test.e2e.js +22 -0
  233. package/dist/test/elements/q2-pagination-test.e2e.js.map +1 -1
  234. package/dist/test/elements/q2-pill-test.e2e.js +21 -2
  235. package/dist/test/elements/q2-pill-test.e2e.js.map +1 -1
  236. package/dist/test/elements/q2-select-test.e2e.js +26 -8
  237. package/dist/test/elements/q2-select-test.e2e.js.map +1 -1
  238. package/dist/test/elements/q2-stepper-test.e2e.js +10 -17
  239. package/dist/test/elements/q2-stepper-test.e2e.js.map +1 -1
  240. package/dist/test/elements/q2-stepper-vertical-test.e2e.js +20 -4
  241. package/dist/test/elements/q2-stepper-vertical-test.e2e.js.map +1 -1
  242. package/dist/test/elements/q2-tab-container-test.e2e.js +10 -4
  243. package/dist/test/elements/q2-tab-container-test.e2e.js.map +1 -1
  244. package/dist/types/components/q2-btn/q2-btn.d.ts +14 -3
  245. package/dist/types/components/q2-carousel/q2-carousel.d.ts +2 -0
  246. package/dist/types/components/q2-input/q2-input.d.ts +10 -3
  247. package/dist/types/components.d.ts +50 -4
  248. package/package.json +3 -3
  249. package/dist/cjs/q2-optgroup_2.cjs.entry.js.map +0 -1
  250. package/dist/esm/q2-optgroup_2.entry.js.map +0 -1
  251. package/dist/q2-tecton-elements/p-1c17d118.entry.js +0 -2
  252. package/dist/q2-tecton-elements/p-1c17d118.entry.js.map +0 -1
  253. package/dist/q2-tecton-elements/p-2436c843.entry.js.map +0 -1
  254. package/dist/q2-tecton-elements/p-3b1ea100.entry.js +0 -2
  255. package/dist/q2-tecton-elements/p-3b1ea100.entry.js.map +0 -1
  256. package/dist/q2-tecton-elements/p-445990a8.entry.js +0 -2
  257. package/dist/q2-tecton-elements/p-445990a8.entry.js.map +0 -1
  258. package/dist/q2-tecton-elements/p-4b81a121.entry.js +0 -2
  259. package/dist/q2-tecton-elements/p-4b81a121.entry.js.map +0 -1
  260. package/dist/q2-tecton-elements/p-50bd4437.entry.js +0 -2
  261. package/dist/q2-tecton-elements/p-50bd4437.entry.js.map +0 -1
  262. package/dist/q2-tecton-elements/p-5dc5c4e2.entry.js.map +0 -1
  263. package/dist/q2-tecton-elements/p-68556733.entry.js.map +0 -1
  264. package/dist/q2-tecton-elements/p-7c12ba02.entry.js +0 -2
  265. package/dist/q2-tecton-elements/p-7c12ba02.entry.js.map +0 -1
  266. package/dist/q2-tecton-elements/p-a977e723.entry.js +0 -2
  267. package/dist/q2-tecton-elements/p-a977e723.entry.js.map +0 -1
  268. package/dist/q2-tecton-elements/p-b3d10d52.entry.js +0 -2
  269. package/dist/q2-tecton-elements/p-b3d10d52.entry.js.map +0 -1
  270. package/dist/q2-tecton-elements/p-bfe9d688.entry.js.map +0 -1
  271. package/dist/q2-tecton-elements/p-bffda54d.entry.js +0 -2
  272. package/dist/q2-tecton-elements/p-bffda54d.entry.js.map +0 -1
  273. package/dist/q2-tecton-elements/p-cadceb00.entry.js +0 -2
  274. package/dist/q2-tecton-elements/p-cadceb00.entry.js.map +0 -1
  275. package/dist/q2-tecton-elements/p-d1a9ed3d.entry.js +0 -2
  276. package/dist/q2-tecton-elements/p-d1a9ed3d.entry.js.map +0 -1
  277. package/dist/q2-tecton-elements/p-fcc84527.entry.js.map +0 -1
  278. /package/dist/q2-tecton-elements/{p-685b821c.entry.js.map → p-0eff37c6.entry.js.map} +0 -0
  279. /package/dist/q2-tecton-elements/{p-f4d77672.entry.js.map → p-195a133c.entry.js.map} +0 -0
  280. /package/dist/q2-tecton-elements/{p-7ce6e587.js.map → p-3c42c90f.js.map} +0 -0
  281. /package/dist/q2-tecton-elements/{p-63192fac.entry.js.map → p-da7fc914.entry.js.map} +0 -0
  282. /package/dist/q2-tecton-elements/{p-b376c111.entry.js.map → p-e47dbfbe.entry.js.map} +0 -0
  283. /package/dist/q2-tecton-elements/{p-a214077c.entry.js.map → p-e4a2469f.entry.js.map} +0 -0
  284. /package/dist/types/workspace/workspace/{tecton-production_release_1.45.x → _Gitlab_tecton-production_master}/packages/q2-tecton-elements/.stencil/test/elements/q2-detail/slot-component.d.ts +0 -0
  285. /package/dist/types/workspace/workspace/{tecton-production_release_1.45.x → _Gitlab_tecton-production_master}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +0 -0
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-14c3693c.js');
6
6
 
7
- const q2CurrencyCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}.currency{color:var(--tct-currency-color, inherit);font-size:var(--tct-currency-font-size, inherit);font-weight:var(--tct-currency-font-weight, inherit)}.currency-small{color:var(--tct-currency-small-color, inherit);font-size:var(--tct-currency-small-font-size, 24px);font-weight:var(--tct-currency-small-font-weight, 600)}.currency-small .superscript{vertical-align:super;color:var(--tct-currency-small-superscript-color, inherit);font-size:var(--tct-currency-small-superscript-font-size, var(--app-font-size-small, 12px));font-weight:var(--tct-currency-small-superscript-font-weight, 700)}.currency-medium{color:var(--tct-currency-medium-color, inherit);font-size:var(--tct-currency-medium-font-size, 42px);font-weight:var(--tct-currency-medium-font-weight, 600)}.currency-medium .superscript{vertical-align:super;color:var(--tct-currency-medium-superscript-color, inherit);font-size:var(--tct-currency-medium-superscript-font-size, 16px);font-weight:var(--tct-currency-medium-superscript-font-weight, 700)}.currency-large{color:var(--tct-currency-large-color, inherit);font-size:var(--tct-currency-large-font-size, 70px);font-weight:var(--tct-currency-large-font-weight, 700)}.currency-large .superscript{vertical-align:super;color:var(--tct-currency-large-superscript-color, inherit);font-size:var(--tct-currency-large-superscript-font-size, 28px);font-weight:var(--tct-currency-large-superscript-font-weight, 800)}";
7
+ const q2CurrencyCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:inline-block}.currency{color:var(--tct-currency-color, inherit);font-size:var(--tct-currency-font-size, inherit);font-weight:var(--tct-currency-font-weight, inherit)}.currency-small{color:var(--tct-currency-small-color, inherit);font-size:var(--tct-currency-small-font-size, 24px);font-weight:var(--tct-currency-small-font-weight, 600)}.currency-small .superscript{vertical-align:super;color:var(--tct-currency-small-superscript-color, inherit);font-size:var(--tct-currency-small-superscript-font-size, var(--app-font-size-small, 12px));font-weight:var(--tct-currency-small-superscript-font-weight, 700)}.currency-medium{color:var(--tct-currency-medium-color, inherit);font-size:var(--tct-currency-medium-font-size, 42px);font-weight:var(--tct-currency-medium-font-weight, 600)}.currency-medium .superscript{vertical-align:super;color:var(--tct-currency-medium-superscript-color, inherit);font-size:var(--tct-currency-medium-superscript-font-size, 16px);font-weight:var(--tct-currency-medium-superscript-font-weight, 700)}.currency-large{color:var(--tct-currency-large-color, inherit);font-size:var(--tct-currency-large-font-size, 70px);font-weight:var(--tct-currency-large-font-weight, 700)}.currency-large .superscript{vertical-align:super;color:var(--tct-currency-large-superscript-color, inherit);font-size:var(--tct-currency-large-superscript-font-size, 28px);font-weight:var(--tct-currency-large-superscript-font-weight, 800)}";
8
8
  const Q2CurrencyStyle0 = q2CurrencyCss;
9
9
 
10
10
  const Q2Currency = class {
@@ -1 +1 @@
1
- {"file":"q2-currency.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,aAAa,GAAG,oiEAAoiE,CAAC;AAC3jE,yBAAe,aAAa;;MCCf,UAAU;;;;wBAKyB,KAAK;sBAGI,QAAQ,CAAC,eAAe,CAAC,IAAI,IAAI,OAAO;;2BAcV,MAAM;;;;IAWzF,iBAAiB;QACb,IAAI,CAAC,cAAc,EAAE,CAAC;KACzB;;IAGD,IAAI,gBAAgB;QAChB,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAC3B,CAAC,IAA2B,KAAK,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,IAAI,CAA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D,eAAe,IAAIA,mEAAM,KAAK,EAAE,uBAAuB,GAAG,aAAa,GAAG,EAAE,IAAG,cAAc,CAAQ,EACtGA,qEAAO,UAAU,CAAQ,EACzBA,mEAAM,KAAK,EAAE,yBAAyB,GAAG,aAAa,GAAG,EAAE,IAAG,QAAQ,CAAQ,EAC7E,CAAC,eAAe,IAAIA,mEAAM,KAAK,EAAE,uBAAuB,GAAG,aAAa,GAAG,EAAE,IAAG,cAAc,CAAQ,CACrG,EACR;KACL;;;;;;;;;;;;;;","names":["h"],"sources":["src/components/q2-currency/q2-currency.scss?tag=q2-currency&encapsulation=shadow","src/components/q2-currency/q2-currency.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n.currency {\n color: var-list(--tct-currency-color, inherit);\n font-size: var-list(--tct-currency-font-size, inherit);\n font-weight: var-list(--tct-currency-font-weight, inherit);\n}\n\n.currency-small {\n color: var-list(--tct-currency-small-color, inherit);\n font-size: var-list(--tct-currency-small-font-size, 24px);\n font-weight: var-list(--tct-currency-small-font-weight, 600);\n\n .superscript {\n vertical-align: super;\n color: var-list(--tct-currency-small-superscript-color, inherit);\n font-size: var-list(--tct-currency-small-superscript-font-size, --app-font-size-small, 12px);\n font-weight: var-list(--tct-currency-small-superscript-font-weight, 700);\n }\n}\n\n.currency-medium {\n color: var-list(--tct-currency-medium-color, inherit);\n font-size: var-list(--tct-currency-medium-font-size, 42px);\n font-weight: var-list(--tct-currency-medium-font-weight, 600);\n\n .superscript {\n vertical-align: super;\n color: var-list(--tct-currency-medium-superscript-color, inherit);\n font-size: var-list(--tct-currency-medium-superscript-font-size, 16px);\n font-weight: var-list(--tct-currency-medium-superscript-font-weight, 700);\n }\n}\n\n.currency-large {\n color: var-list(--tct-currency-large-color, inherit);\n font-size: var-list(--tct-currency-large-font-size, 70px);\n font-weight: var-list(--tct-currency-large-font-weight, 700);\n\n .superscript {\n vertical-align: super;\n color: var-list(--tct-currency-large-superscript-color, inherit);\n font-size: var-list(--tct-currency-large-superscript-font-size, 28px);\n font-weight: var-list(--tct-currency-large-superscript-font-weight, 800);\n }\n}\n","import { Component, Prop, Watch, h, ComponentInterface } from '@stencil/core';\n@Component({ tag: 'q2-currency', shadow: true, styleUrl: 'q2-currency.scss' })\nexport class Q2Currency implements ComponentInterface {\n /** The amount you want formatted. */\n @Prop({ reflect: true }) amount: number;\n\n /** Formats the `amount` to a specific currency. */\n @Prop({ reflect: true }) currency: string = 'USD';\n\n /** Formats to the language provided. Accepts multiple locales in an array as sequential fallbacks. */\n @Prop({ reflect: true }) locale: string | string[] = document.documentElement.lang || 'en-US';\n\n /** Applies styling based on the size provided. If no size is provided, it will display as inline text. */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large';\n\n /**\n * Determine how the positive or negative sign should display.\n *\n * Behavior:\n * - `always`: Always display the sign.\n * - `auto`: Sign displays for negative numbers only, including negative zero.\n * - `exceptZero`: Sign displays for positive and negative numbers, but not zero.\n * - `never`: Never display the sign.\n */\n @Prop({ reflect: true }) signDisplay: 'never' | 'auto' | 'always' | 'exceptZero' = 'auto';\n\n /** @private Inherited from q2-detail when slotted to match styling of q2-detail and q2-currency texts. */\n @Prop({ reflect: true }) slotSize: string;\n\n /** @private The parts of the formatted number. */\n formattedParts: Intl.NumberFormatPart[];\n /** @private The full currency for aria-label purposes. */\n readableCurrency: string;\n\n /// Lifecycle Hooks ///\n componentWillLoad(): void | Promise<void> {\n this.formatCurrency();\n }\n\n /// Getters ///\n get hasPlusMinusSign(): boolean {\n return this.formattedParts.some(\n (part: Intl.NumberFormatPart) => part.type === 'minusSign' || part.type === 'plusSign'\n );\n }\n get plusMinusSign(): string {\n const { formattedParts, hasPlusMinusSign } = this;\n if (!hasPlusMinusSign) return;\n\n const sign = formattedParts.find(\n (part: Intl.NumberFormatPart) => part.type === 'minusSign' || part.type === 'plusSign'\n );\n return sign.value;\n }\n\n get currencyIsFront(): boolean {\n const index = this.formattedParts.findIndex((part: Intl.NumberFormatPart) => part.type === 'currency');\n if (index === 0 || index === 1) return true;\n return false;\n }\n\n get currencySymbol(): string {\n const { formattedParts, currencyIsFront } = this;\n const currencyIndex = formattedParts.findIndex((part: Intl.NumberFormatPart) => part.type === 'currency');\n const symbol = formattedParts[currencyIndex].value;\n return currencyIsFront ? symbol : ' ' + symbol;\n }\n\n get shouldSuperscriptSymbol(): boolean {\n if (!this.currencyIsFront || this.sizeProvided) return true;\n\n return false;\n }\n\n get amountCore(): string {\n const { formattedParts, shouldSuperscriptFraction } = this;\n let amount: string = '';\n\n for (const part of formattedParts) {\n if (\n part.type === 'integer' ||\n part.type === 'decimal' ||\n part.type === 'group' ||\n part.type === 'literal'\n ) {\n amount += part.value;\n }\n }\n\n // removes trailing decimal point if superscripting the fraction\n if (shouldSuperscriptFraction && amount[amount.length - 1] === '.') amount = amount.slice(0, -1);\n // removes end whitespace that breaks formatting\n amount = amount.trimEnd();\n\n return amount;\n }\n\n get fraction(): string {\n const { formattedParts } = this;\n const fraction = formattedParts.find((part: Intl.NumberFormatPart) => part.type === 'fraction');\n if (!fraction) return;\n\n return fraction.value;\n }\n\n get shouldSuperscriptFraction(): boolean {\n const { formattedParts, currencyIsFront, sizeProvided } = this;\n const fractionIndex = formattedParts.findIndex((part: Intl.NumberFormatPart) => part.type === 'fraction');\n const commaBeforeFraction = formattedParts[fractionIndex - 1].value === ',';\n\n if (commaBeforeFraction || !currencyIsFront || !sizeProvided) return false;\n\n return true;\n }\n\n get sizeProvided(): boolean {\n return !!this.size || !!this.slotSize;\n }\n\n get slotSizeValue(): string {\n let size = this.slotSize;\n switch (size) {\n case 'xsmall':\n size = 'small';\n break;\n case 'xlarge':\n size = 'large';\n break;\n default:\n break;\n }\n\n return size;\n }\n\n get currencyClasses(): string {\n const classes = ['currency'];\n const sizeClass = this.size ? this.size : this.slotSizeValue;\n\n if (!!sizeClass) classes.push(`currency-${sizeClass}`);\n\n return classes.join(' ');\n }\n\n /// Watchers ///\n @Watch('amount')\n @Watch('currency')\n @Watch('locale')\n @Watch('size')\n @Watch('slotSize')\n @Watch('signDisplay')\n propsUpdated() {\n this.formatCurrency();\n }\n\n /// Helpers ///\n formatCurrency() {\n const formatOptions = new Intl.NumberFormat(this.locale, {\n style: 'currency',\n currency: this.currency,\n signDisplay: this.signDisplay,\n });\n this.formattedParts = formatOptions.formatToParts(this.amount);\n this.readableCurrency = formatOptions.format(this.amount);\n }\n\n /// DOM ///\n render() {\n const {\n hasPlusMinusSign,\n plusMinusSign,\n currencyIsFront,\n currencySymbol,\n shouldSuperscriptSymbol,\n amountCore,\n fraction,\n shouldSuperscriptFraction,\n readableCurrency,\n currencyClasses,\n } = this;\n\n return (\n <div\n class={currencyClasses}\n aria-label={readableCurrency}\n >\n {hasPlusMinusSign && <span>{plusMinusSign}</span>}\n {currencyIsFront && <span class={shouldSuperscriptSymbol ? 'superscript' : ''}>{currencySymbol}</span>}\n <span>{amountCore}</span>\n <span class={shouldSuperscriptFraction ? 'superscript' : ''}>{fraction}</span>\n {!currencyIsFront && <span class={shouldSuperscriptSymbol ? 'superscript' : ''}>{currencySymbol}</span>}\n </div>\n );\n }\n}\n"],"version":3}
1
+ {"file":"q2-currency.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,aAAa,GAAG,+jEAA+jE,CAAC;AACtlE,yBAAe,aAAa;;MCCf,UAAU;;;;wBAKyB,KAAK;sBAGI,QAAQ,CAAC,eAAe,CAAC,IAAI,IAAI,OAAO;;2BAcV,MAAM;;;;IAWzF,iBAAiB;QACb,IAAI,CAAC,cAAc,EAAE,CAAC;KACzB;;IAGD,IAAI,gBAAgB;QAChB,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAC3B,CAAC,IAA2B,KAAK,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,CACzF,CAAC;KACL;IACD,IAAI,aAAa;QACb,MAAM,EAAE,cAAc,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC;QAClD,IAAI,CAAC,g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EAAE,yBAAyB,GAAG,aAAa,GAAG,EAAE,IAAG,QAAQ,CAAQ,EAC7E,CAAC,eAAe,IAAIA,mEAAM,KAAK,EAAE,uBAAuB,GAAG,aAAa,GAAG,EAAE,IAAG,cAAc,CAAQ,CACrG,EACR;KACL;;;;;;;;;;;;;;","names":["h"],"sources":["src/components/q2-currency/q2-currency.scss?tag=q2-currency&encapsulation=shadow","src/components/q2-currency/q2-currency.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n display: inline-block;\n}\n\n.currency {\n color: var-list(--tct-currency-color, inherit);\n font-size: var-list(--tct-currency-font-size, inherit);\n font-weight: var-list(--tct-currency-font-weight, inherit);\n}\n\n.currency-small {\n color: var-list(--tct-currency-small-color, inherit);\n font-size: var-list(--tct-currency-small-font-size, 24px);\n font-weight: var-list(--tct-currency-small-font-weight, 600);\n\n .superscript {\n vertical-align: super;\n color: var-list(--tct-currency-small-superscript-color, inherit);\n font-size: var-list(--tct-currency-small-superscript-font-size, --app-font-size-small, 12px);\n font-weight: var-list(--tct-currency-small-superscript-font-weight, 700);\n }\n}\n\n.currency-medium {\n color: var-list(--tct-currency-medium-color, inherit);\n font-size: var-list(--tct-currency-medium-font-size, 42px);\n font-weight: var-list(--tct-currency-medium-font-weight, 600);\n\n .superscript {\n vertical-align: super;\n color: var-list(--tct-currency-medium-superscript-color, inherit);\n font-size: var-list(--tct-currency-medium-superscript-font-size, 16px);\n font-weight: var-list(--tct-currency-medium-superscript-font-weight, 700);\n }\n}\n\n.currency-large {\n color: var-list(--tct-currency-large-color, inherit);\n font-size: var-list(--tct-currency-large-font-size, 70px);\n font-weight: var-list(--tct-currency-large-font-weight, 700);\n\n .superscript {\n vertical-align: super;\n color: var-list(--tct-currency-large-superscript-color, inherit);\n font-size: var-list(--tct-currency-large-superscript-font-size, 28px);\n font-weight: var-list(--tct-currency-large-superscript-font-weight, 800);\n }\n}\n","import { Component, Prop, Watch, h, ComponentInterface } from '@stencil/core';\n@Component({ tag: 'q2-currency', shadow: true, styleUrl: 'q2-currency.scss' })\nexport class Q2Currency implements ComponentInterface {\n /** The amount you want formatted. */\n @Prop({ reflect: true }) amount: number;\n\n /** Formats the `amount` to a specific currency. */\n @Prop({ reflect: true }) currency: string = 'USD';\n\n /** Formats to the language provided. Accepts multiple locales in an array as sequential fallbacks. */\n @Prop({ reflect: true }) locale: string | string[] = document.documentElement.lang || 'en-US';\n\n /** Applies styling based on the size provided. If no size is provided, it will display as inline text. */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large';\n\n /**\n * Determine how the positive or negative sign should display.\n *\n * Behavior:\n * - `always`: Always display the sign.\n * - `auto`: Sign displays for negative numbers only, including negative zero.\n * - `exceptZero`: Sign displays for positive and negative numbers, but not zero.\n * - `never`: Never display the sign.\n */\n @Prop({ reflect: true }) signDisplay: 'never' | 'auto' | 'always' | 'exceptZero' = 'auto';\n\n /** @private Inherited from q2-detail when slotted to match styling of q2-detail and q2-currency texts. */\n @Prop({ reflect: true }) slotSize: string;\n\n /** @private The parts of the formatted number. */\n formattedParts: Intl.NumberFormatPart[];\n /** @private The full currency for aria-label purposes. */\n readableCurrency: string;\n\n /// Lifecycle Hooks ///\n componentWillLoad(): void | Promise<void> {\n this.formatCurrency();\n }\n\n /// Getters ///\n get hasPlusMinusSign(): boolean {\n return this.formattedParts.some(\n (part: Intl.NumberFormatPart) => part.type === 'minusSign' || part.type === 'plusSign'\n );\n }\n get plusMinusSign(): string {\n const { formattedParts, hasPlusMinusSign } = this;\n if (!hasPlusMinusSign) return;\n\n const sign = formattedParts.find(\n (part: Intl.NumberFormatPart) => part.type === 'minusSign' || part.type === 'plusSign'\n );\n return sign.value;\n }\n\n get currencyIsFront(): boolean {\n const index = this.formattedParts.findIndex((part: Intl.NumberFormatPart) => part.type === 'currency');\n if (index === 0 || index === 1) return true;\n return false;\n }\n\n get currencySymbol(): string {\n const { formattedParts, currencyIsFront } = this;\n const currencyIndex = formattedParts.findIndex((part: Intl.NumberFormatPart) => part.type === 'currency');\n const symbol = formattedParts[currencyIndex].value;\n return currencyIsFront ? symbol : ' ' + symbol;\n }\n\n get shouldSuperscriptSymbol(): boolean {\n if (!this.currencyIsFront || this.sizeProvided) return true;\n\n return false;\n }\n\n get amountCore(): string {\n const { formattedParts, shouldSuperscriptFraction } = this;\n let amount: string = '';\n\n for (const part of formattedParts) {\n if (\n part.type === 'integer' ||\n part.type === 'decimal' ||\n part.type === 'group' ||\n part.type === 'literal'\n ) {\n amount += part.value;\n }\n }\n\n // removes trailing decimal point if superscripting the fraction\n if (shouldSuperscriptFraction && amount[amount.length - 1] === '.') amount = amount.slice(0, -1);\n // removes end whitespace that breaks formatting\n amount = amount.trimEnd();\n\n return amount;\n }\n\n get fraction(): string {\n const { formattedParts } = this;\n const fraction = formattedParts.find((part: Intl.NumberFormatPart) => part.type === 'fraction');\n if (!fraction) return;\n\n return fraction.value;\n }\n\n get shouldSuperscriptFraction(): boolean {\n const { formattedParts, currencyIsFront, sizeProvided } = this;\n const fractionIndex = formattedParts.findIndex((part: Intl.NumberFormatPart) => part.type === 'fraction');\n const commaBeforeFraction = formattedParts[fractionIndex - 1].value === ',';\n\n if (commaBeforeFraction || !currencyIsFront || !sizeProvided) return false;\n\n return true;\n }\n\n get sizeProvided(): boolean {\n return !!this.size || !!this.slotSize;\n }\n\n get slotSizeValue(): string {\n let size = this.slotSize;\n switch (size) {\n case 'xsmall':\n size = 'small';\n break;\n case 'xlarge':\n size = 'large';\n break;\n default:\n break;\n }\n\n return size;\n }\n\n get currencyClasses(): string {\n const classes = ['currency'];\n const sizeClass = this.size ? this.size : this.slotSizeValue;\n\n if (!!sizeClass) classes.push(`currency-${sizeClass}`);\n\n return classes.join(' ');\n }\n\n /// Watchers ///\n @Watch('amount')\n @Watch('currency')\n @Watch('locale')\n @Watch('size')\n @Watch('slotSize')\n @Watch('signDisplay')\n propsUpdated() {\n this.formatCurrency();\n }\n\n /// Helpers ///\n formatCurrency() {\n const formatOptions = new Intl.NumberFormat(this.locale, {\n style: 'currency',\n currency: this.currency,\n signDisplay: this.signDisplay,\n });\n this.formattedParts = formatOptions.formatToParts(this.amount);\n this.readableCurrency = formatOptions.format(this.amount);\n }\n\n /// DOM ///\n render() {\n const {\n hasPlusMinusSign,\n plusMinusSign,\n currencyIsFront,\n currencySymbol,\n shouldSuperscriptSymbol,\n amountCore,\n fraction,\n shouldSuperscriptFraction,\n readableCurrency,\n currencyClasses,\n } = this;\n\n return (\n <div\n class={currencyClasses}\n aria-label={readableCurrency}\n >\n {hasPlusMinusSign && <span>{plusMinusSign}</span>}\n {currencyIsFront && <span class={shouldSuperscriptSymbol ? 'superscript' : ''}>{currencySymbol}</span>}\n <span>{amountCore}</span>\n <span class={shouldSuperscriptFraction ? 'superscript' : ''}>{fraction}</span>\n {!currencyIsFront && <span class={shouldSuperscriptSymbol ? 'superscript' : ''}>{currencySymbol}</span>}\n </div>\n );\n }\n}\n"],"version":3}
@@ -290,7 +290,7 @@ const Q2Dropdown = class {
290
290
  /// DOM ///
291
291
  render() {
292
292
  const btnProps = this.toggleButtonProps;
293
- return (index.h("click-elsewhere", { key: 'f6f0b6c404fbb9040e08e6ec1a17a9ae7a6e10fd', class: this.open ? 'dropdown-open' : '', onChange: this.onClickElsewhere, "test-id": "dropdownContainer" }, index.h("q2-btn", { key: '7e7115046cbeb548012b55d5b7ba2dc1672f1e39', ref: el => (this.controlElement = el), class: btnProps.className, onClick: this.onToggleClick, onKeyDown: this.onToggleKeydown, fab: btnProps.fab, intent: btnProps.intent, active: btnProps.active, disabled: btnProps.disabled, ariaExpanded: `${!!btnProps.ariaExpanded}`, label: this.hideLabel && this.label ? index$1.loc(this.label) : undefined, hideLabel: this.hideLabel, ariaHasPopup: "menu", "test-id": "dropdownButton", block: this.block, description: index$1.loc('tecton.element.dropdown.itemCount', [this.determineDropdownItemCount]) }, this.hasCustomButton ? (index.h("div", { "test-id": "dropdownCustom", class: btnProps.custom ? '' : 'hidden' }, index.h("slot", { name: "custom-dropdown-button" }))) : (index.h(index.Fragment, null, this.icon ? index.h("q2-icon", { type: this.icon }) : ' ', this.label && !this.hideLabel && (index.h("span", { class: "dropdown-button-text" }, index$1.loc(this.label)))))), index.h("q2-popover", { key: '0f74367791e5d8217ed62aa0b113c0548fd8a37b', ref: el => (this.popoverElement = el), controlElement: this.controlElement, open: this.open, minHeight: this.popoverMinHeight, direction: this.popoverDirection, align: this.popoverAlignment, mode: this.popoverMode || undefined, block: this.block }, index.h("div", { key: '856c5019464cc99c078a5aaf43b36cd7c95ff479', onClick: this.onDropdownMenuClick, onKeyDown: this.onDropdownMenuKeydown }, index.h("slot", { key: 'c037d8593ad02966c5bebce8946ae4780092af77' }), this.open && (index.h("q2-btn", { key: 'ac81396b05dcf44a633adc68386e34affc3db4af', class: "sr close-dropdown", onFocus: this.closeDropdown }))))));
293
+ return (index.h("click-elsewhere", { key: 'f6f0b6c404fbb9040e08e6ec1a17a9ae7a6e10fd', class: this.open ? 'dropdown-open' : '', onChange: this.onClickElsewhere, "test-id": "dropdownContainer" }, index.h("q2-btn", { key: 'f8c88762e98fe78cf144eddde787810dc49cb023', ref: el => (this.controlElement = el), class: btnProps.className, onClick: this.onToggleClick, onKeyDown: this.onToggleKeydown, fab: btnProps.fab, intent: btnProps.intent, active: btnProps.active, disabled: btnProps.disabled, ariaExpanded: `${!!btnProps.ariaExpanded}`, label: this.hideLabel && this.label ? index$1.loc(this.label) : undefined, hideLabel: this.hideLabel, ariaHasPopup: "menu", _role: "menu", "test-id": "dropdownButton", block: this.block, description: index$1.loc('tecton.element.dropdown.itemCount', [this.determineDropdownItemCount]) }, this.hasCustomButton ? (index.h("div", { "test-id": "dropdownCustom", class: btnProps.custom ? '' : 'hidden' }, index.h("slot", { name: "custom-dropdown-button" }))) : (index.h(index.Fragment, null, this.icon ? index.h("q2-icon", { type: this.icon }) : ' ', this.label && !this.hideLabel && (index.h("span", { class: "dropdown-button-text" }, index$1.loc(this.label)))))), index.h("q2-popover", { key: 'b17bbd6349ff1ef2aec3f0845923da4a61d610c1', ref: el => (this.popoverElement = el), controlElement: this.controlElement, open: this.open, minHeight: this.popoverMinHeight, direction: this.popoverDirection, align: this.popoverAlignment, mode: this.popoverMode || undefined, block: this.block }, index.h("div", { key: '77f1a6ad2523f063ead322b227f74faed3decf87', onClick: this.onDropdownMenuClick, onKeyDown: this.onDropdownMenuKeydown }, index.h("slot", { key: '78e513900d75e8a1f012f1d22aabc7dada672acf' }), this.open && (index.h("q2-btn", { key: '1f5f2c6a7d7ce88a3340dfe80d5766d3bb21faf9', class: "sr close-dropdown", onFocus: this.closeDropdown }))))));
294
294
  }
295
295
  get hostElement() { return index.getElement(this); }
296
296
  static get watchers() { return {
@@ -1 +1 @@
1
- {"file":"q2-dropdown.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,aAAa,GAAG,s1BAAs1B,CAAC;AAC72B,yBAAe,aAAa;;MCWf,UAAU;;;QAqGnB,yBAAoB,GAAW,mDAAmD,CAAC;;QAiLnF,gBAAW,GAAG;YACV,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,aAAa,CAAoB,QAAQ,CAAC,CAAC,KAAK,EAAE,CAAC;SACrF,CAAC;QAEF,iBAAY,GAAG;YACX,IAAI,IAAI,CAAC,IAAI;gBAAE,OAAO;YACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;SACpB,CAAC;QAEF,kBAAa,GAAG;YACZ,IAAI,CAAC,IAAI,CAAC,IAAI;gBAAE,OAAO;YACvB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;SACrB,CAAC;QAEF,qBAAgB,GAAG,CAAC,KAAkB;YAClC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAmC,CAAC;YACzD,IAAI,MAAM,CAAC,SAAS,KAAK,iBAAiB,EAAE;gBACxC,KAAK,CAAC,eAAe,EAAE,CAAC;gBACxB,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;gBAChC,IAAI,CAAC,cAAc;oBAAE,OAA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AAO,EAAE,IAAI,CAAC,mBAAmB,EACjC,SAAS,EAAE,IAAI,CAAC,qBAAqB,IAErCA,oEAAQ,EACP,IAAI,CAAC,IAAI,KACNA,qEACI,KAAK,EAAC,mBAAmB,EACzB,OAAO,EAAE,IAAI,CAAC,aAAa,GAC7B,CACL,CACC,CACG,CACC,EACpB;KACL;;;;;;;;;;;;;;;;;","names":["waitForNextPaint","handleRenamedProp","handleAriaLabel","isEventFromElement","overrideFocus","h","loc","Fragment"],"sources":["src/components/q2-dropdown/q2-dropdown.scss?tag=q2-dropdown&encapsulation=shadow","src/components/q2-dropdown/q2-dropdown.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n display: inline-flex;\n}\n\n:host([block]) {\n display: block;\n}\n\nclick-elsewhere {\n position: relative;\n display: block;\n}\n\nq2-popover {\n --tct-popover-min-width: #{var-list(var-prefixer(dropdown-width))};\n}\n","import { Component, ComponentInterface, Prop, Element, Watch, h, Fragment, Listen } from '@stencil/core';\nimport { IDict } from 'src/util';\nimport {\n handleAriaLabel,\n handleRenamedProp,\n isEventFromElement,\n loc,\n overrideFocus,\n waitForNextPaint,\n} from 'src/utils';\n\n@Component({ tag: 'q2-dropdown', shadow: true, styleUrl: 'q2-dropdown.scss' })\nexport class Q2Dropdown implements ComponentInterface {\n @Prop({ reflect: true }) additionalContext: string;\n\n /** If `true`, component expands to fill the width of its parent element. */\n @Prop({ reflect: true }) block: boolean;\n\n /**\n * Tells the outlet what the type of object being passed in as contextValue.\n * This will allow for the hierarchy resolution logic to work to determine if an option should or should not be shown.\n *\n * @info\n * Only applicable when using `<q2-dropdown>` for outlets.\n */\n @Prop({ reflect: true }) context: string;\n\n /**\n * Passes important information to the outlet (e.g., pass an account id that your platform can use to look up what module to show for that account type).\n *\n * @info\n * Only applicable when using `<q2-dropdown>` for outlets.\n */\n @Prop({ reflect: true }) contextValue: string;\n\n /** Indicates the menu cannot be focused or interacted with. */\n @Prop({ reflect: true }) disabled: boolean;\n\n /**\n * Hide's the field's `<label>` element from view.\n * @warning\n * Only use when a visible label is impractical.\n */\n @Prop({ reflect: true, mutable: true }) hideLabel: boolean;\n\n /** The icon that will render within the toggle button. You may use any of the `q2-icon` types. */\n @Prop({ reflect: true }) icon: string;\n\n /**\n * The text that appears within the button.\n * @warning\n * This property should not be used if the `type` is `icon`.\n * @localizable\n */\n @Prop({ reflect: true, mutable: true }) label: string;\n\n /**\n * Identifies this menu as an outlet. Used in conjunction with context and, optionally, `contextValue`.\n * @info\n * Only applicable when using `<q2-dropdown>` for outlets.\n */\n @Prop({ reflect: true }) name: string;\n\n /** Determine whether the popover is open or closed. */\n @Prop({ reflect: true, mutable: true }) open: boolean;\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({ mutable: true }) popoverDirection: 'up' | 'down';\n\n /** Aligns the popover dropdown to the left or right side of the input field. */\n @Prop({ mutable: true }) popoverAlignment: 'left' | 'right' = 'left'; // being used in dropdown.scss\n\n /**\n * Determines the display mode of the popover.\n *\n * Providing a value of `legacy` instructs the popover to use absolute positioning instead of fixed positioning.\n *\n * @info\n * This is a temporary solution to work around styling issues related to using fixed positioning for the popover\n * when nested inside of elements with transform properties. This will be removed once the popover API is available\n * for use.\n */\n @Prop({ mutable: true }) popoverMode: 'legacy' = null;\n\n /** @deprecated */\n @Prop() popoverMinHeight: number = 150;\n\n /**\n * Use with `context` to tell the outlet where it appears. It will be matched with the appropriately configured module for that context.\n * @info\n * Only applicable when using `<q2-dropdown>` for outlets.\n */\n @Prop({ reflect: true }) resolvedType: string;\n\n /** The type of button used as the menu toggle. */\n @Prop({ reflect: true }) type: 'icon' | 'fab' | 'custom' | 'primary' | 'secondary' | 'neutral' = 'icon';\n\n /** @deprecated */\n @Prop({ reflect: true }) alignment: 'left' | 'right';\n\n /** @deprecated */\n @Prop({ reflect: true }) popDirection: 'up' | 'down';\n\n /** @deprecated */\n @Prop({ reflect: true, mutable: true }) ariaLabel: string;\n\n @Element() hostElement: HTMLElement;\n privatePopDirection: 'down' | 'up';\n controlElement?: HTMLQ2BtnElement;\n popoverElement?: HTMLQ2PopoverElement;\n dropdownItemSelector: string = 'q2-dropdown-item:not([disabled]):not([separator])';\n\n resolveMenu() {\n return (\n this.name &&\n window.TectonElements &&\n window.TectonElements.resolveMenu(this.name, this.contextValue, this.resolvedType, this.additionalContext)\n );\n }\n\n orchestrateResolvedMenuItems() {\n if (!this.name || !this.context) {\n // this is only for contextual menu outlets\n this.removeResolvedElements();\n return;\n }\n\n this.resolveMenuItemElements()\n .then(data => {\n this.removeResolvedElements();\n data.forEach(element => {\n this.hostElement.appendChild(element);\n });\n })\n .catch(err => {\n this.removeResolvedElements();\n throw err;\n });\n }\n\n removeResolvedElements() {\n const resolvedElements = this.hostElement.querySelectorAll('q2-dropdown-item.resolved-menu-item');\n resolvedElements.forEach(element => this.hostElement.removeChild(element));\n }\n\n resolveMenuItemElements() {\n return this.resolveMenu().then(datas => {\n return datas.map(menuItemData => {\n let onClickFn;\n let queryParams;\n if (menuItemData['tct-ctxid']) {\n queryParams = {};\n queryParams[menuItemData.contextIdParamName] = menuItemData['tct-ctxid'];\n }\n\n switch (menuItemData.action) {\n case 'navigateTo':\n onClickFn = () =>\n this.navigateTo(menuItemData.featureName, menuItemData.moduleName, queryParams);\n break;\n case 'showOverpanel':\n onClickFn = () =>\n this.showOverpanel(`${menuItemData.featureName}.${menuItemData.moduleName}`, queryParams);\n break;\n }\n\n const newDropdownItem = document.createElement('q2-dropdown-item');\n newDropdownItem.setAttribute('value', menuItemData.itemLabel);\n newDropdownItem.classList.add('resolved-menu-item');\n newDropdownItem.innerHTML = menuItemData.itemLabel;\n newDropdownItem.onclick = onClickFn;\n\n return newDropdownItem;\n });\n });\n }\n\n navigateTo(featureName: string, moduleName?: string, queryParams?: IDict<string>) {\n return window.TectonElements?.navigateTo?.(featureName, moduleName, queryParams);\n }\n\n showOverpanel(overpanelPath: string, params: IDict<string>) {\n return window.TectonElements?.showOverpanel?.(overpanelPath, params, undefined, true);\n }\n\n get hasCustomButton() {\n return !!this.hostElement.querySelector('[slot=custom-dropdown-button]');\n }\n\n get determineDropdownItemCount() {\n return this.hostElement.querySelectorAll(this.dropdownItemSelector).length;\n }\n\n get toggleButtonProps() {\n const allowedIntents = ['primary', 'secondary', 'neutral'];\n const allowedTypes = ['icon', 'fab', 'custom', ...allowedIntents];\n const type = allowedTypes.includes(this.type) ? this.type : '';\n const icon = type === 'icon';\n const fab = type === 'fab';\n const custom = type === 'custom';\n let intent;\n if (allowedIntents.includes(type)) {\n intent = type === 'neutral' ? type : `workflow-${type}`;\n }\n const active = this.open;\n const disabled = !!this.disabled;\n const ariaExpanded = this.open;\n const className = !icon && !fab && !intent ? 'unstyled' : '';\n\n return {\n icon,\n fab,\n intent,\n active,\n disabled,\n ariaExpanded,\n className,\n custom,\n };\n }\n\n //////// Observers //////////\n @Watch('popDirection')\n popDirectionHandler() {\n handleRenamedProp(this, 'popDirection', 'popoverDirection');\n }\n\n @Watch('alignment')\n alignmentHandler() {\n handleRenamedProp(this, 'alignment', 'popoverAlignment');\n }\n\n @Watch('ariaLabel')\n ariaLabelHandler() {\n handleAriaLabel(this);\n }\n\n @Watch('name')\n nameHandler() {\n this.orchestrateResolvedMenuItems();\n }\n\n @Watch('context')\n contextHandler() {\n this.orchestrateResolvedMenuItems();\n }\n\n @Watch('contextValue')\n contextValueHandler() {\n this.orchestrateResolvedMenuItems();\n }\n\n @Watch('resolvedType')\n resolvedTypeHandler() {\n this.orchestrateResolvedMenuItems();\n }\n\n @Watch('additionalContext')\n additionalContextHandler() {\n this.orchestrateResolvedMenuItems();\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n this.focusToggle();\n }\n\n @Listen('popoverStateChanged')\n popoverStateHandler({ detail: { open } }: CustomEvent<{ open: boolean }>) {\n if (this.open !== open) this.open = open;\n this.popoverElement?.scrollContainerTo({ top: 0 });\n }\n\n ///// Lifecycle Hooks ////////\n componentWillLoad() {\n this.popDirectionHandler();\n this.alignmentHandler();\n this.ariaLabelHandler();\n }\n\n componentDidLoad() {\n this.orchestrateResolvedMenuItems();\n overrideFocus(this.hostElement);\n }\n\n ///// Actions ////////\n focusToggle = () => {\n this.controlElement.shadowRoot.querySelector<HTMLButtonElement>('button').focus();\n };\n\n openDropdown = () => {\n if (this.open) return;\n this.open = true;\n };\n\n closeDropdown = () => {\n if (!this.open) return;\n this.open = false;\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 onToggleClick = () => {\n if (this.open) {\n this.closeDropdown();\n } else {\n this.openDropdown();\n }\n };\n\n onToggleKeydown = (event: KeyboardEvent) => {\n if (['ArrowUp', 'Up'].includes(event.key)) {\n event.preventDefault();\n this.openDropdown();\n this.focusLastItem();\n return;\n }\n\n if (['ArrowDown', 'Down'].includes(event.key)) {\n event.preventDefault();\n this.openDropdown();\n this.focusFirstItem();\n return;\n }\n\n if (['Escape', 'Esc'].includes(event.key)) {\n event.preventDefault();\n this.focusToggle();\n this.closeDropdown();\n return;\n }\n };\n\n onDropdownMenuClick = async (event: MouseEvent | CustomEvent) => {\n if ((event.target as HTMLElement).localName !== 'q2-dropdown-item') {\n return;\n }\n const item = event.target as HTMLQ2DropdownItemElement;\n if (!item.disabled && !item.separator) {\n this.closeDropdown();\n await waitForNextPaint();\n this.focusToggle();\n }\n };\n\n focusFirstItem() {\n const firstItem = this.hostElement.querySelector<HTMLQ2DropdownItemElement>(\n `${this.dropdownItemSelector}:first-child`\n );\n\n firstItem?.dispatchEvent(new FocusEvent('focus'));\n }\n\n focusLastItem() {\n const lastItem = this.hostElement.querySelector<HTMLQ2DropdownItemElement>(\n `${this.dropdownItemSelector}:last-child`\n );\n lastItem?.dispatchEvent(new FocusEvent('focus'));\n }\n\n focusAdjacentItem(activeItem: HTMLQ2DropdownItemElement, direction: 'next' | 'prev') {\n const dropdownItems: HTMLQ2DropdownItemElement[] = Array.from(\n this.hostElement.querySelectorAll(this.dropdownItemSelector)\n );\n\n const activeIndex = dropdownItems.indexOf(activeItem);\n\n if (activeIndex === -1) {\n return;\n }\n\n let targetIndex: number = 0;\n if (direction === 'next') {\n targetIndex = activeIndex < dropdownItems.length - 1 ? activeIndex + 1 : 0;\n } else if (direction === 'prev') {\n if (activeIndex > 0) {\n targetIndex = activeIndex - 1;\n } else {\n targetIndex = dropdownItems.length - 1;\n }\n }\n const targetItem = dropdownItems[targetIndex];\n targetItem && targetItem.dispatchEvent(new Event('focus'));\n }\n\n onDropdownMenuKeydown = (event: KeyboardEvent) => {\n if (['Escape', 'Esc'].includes(event.key)) {\n this.closeDropdown();\n this.focusToggle();\n return;\n }\n\n if ((event.target as HTMLElement).localName !== 'q2-dropdown-item') {\n return;\n }\n\n const item = event.target as HTMLQ2DropdownItemElement;\n if (['ArrowUp', 'Up'].includes(event.key)) {\n event.preventDefault();\n this.focusAdjacentItem(item, 'prev');\n return;\n }\n\n if (['ArrowDown', 'Down'].includes(event.key)) {\n event.preventDefault();\n this.focusAdjacentItem(item, 'next');\n return;\n }\n if (event.key === 'Tab') {\n event.preventDefault();\n }\n };\n\n /// DOM ///\n\n render() {\n const btnProps = this.toggleButtonProps;\n\n return (\n <click-elsewhere\n class={this.open ? 'dropdown-open' : ''}\n onChange={this.onClickElsewhere}\n test-id=\"dropdownContainer\"\n >\n <q2-btn\n ref={el => (this.controlElement = el)}\n class={btnProps.className}\n onClick={this.onToggleClick}\n onKeyDown={this.onToggleKeydown}\n fab={btnProps.fab}\n intent={btnProps.intent}\n active={btnProps.active}\n disabled={btnProps.disabled}\n ariaExpanded={`${!!btnProps.ariaExpanded}`}\n label={this.hideLabel && this.label ? loc(this.label) : undefined}\n hideLabel={this.hideLabel}\n ariaHasPopup=\"menu\"\n test-id=\"dropdownButton\"\n block={this.block}\n description={loc('tecton.element.dropdown.itemCount', [this.determineDropdownItemCount])}\n >\n {this.hasCustomButton ? (\n <div\n test-id=\"dropdownCustom\"\n class={btnProps.custom ? '' : 'hidden'}\n >\n <slot name=\"custom-dropdown-button\" />\n </div>\n ) : (\n <Fragment>\n {this.icon ? <q2-icon type={this.icon} /> : ' '}\n {this.label && !this.hideLabel && (\n <span class=\"dropdown-button-text\">{loc(this.label)}</span>\n )}\n </Fragment>\n )}\n </q2-btn>\n <q2-popover\n ref={el => (this.popoverElement = el)}\n controlElement={this.controlElement}\n open={this.open}\n minHeight={this.popoverMinHeight}\n direction={this.popoverDirection}\n align={this.popoverAlignment}\n mode={this.popoverMode || undefined}\n block={this.block}\n >\n <div\n onClick={this.onDropdownMenuClick}\n onKeyDown={this.onDropdownMenuKeydown}\n >\n <slot />\n {this.open && (\n <q2-btn\n class=\"sr close-dropdown\"\n onFocus={this.closeDropdown}\n />\n )}\n </div>\n </q2-popover>\n </click-elsewhere>\n );\n }\n}\n"],"version":3}
1
+ {"file":"q2-dropdown.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,aAAa,GAAG,s1BAAs1B,CAAC;AAC72B,yBAAe,aAAa;;MCWf,UAAU;;;QAqGnB,yBAAoB,GAAW,mDAAmD,CAAC;;QAiLnF,gBAAW,GAAG;YACV,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,aAAa,CAAoB,QAAQ,CAAC,CAAC,KAAK,EAAE,CAAC;SACrF,CAAC;QAEF,iBAAY,GAAG;YACX,IAAI,IAAI,CAAC,IAAI;gBAAE,OAAO;YACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;SACpB,CAAC;QAEF,kBAAa,GAAG;YACZ,IAAI,CAAC,IAAI,CAAC,IAAI;gBAAE,OAAO;YACvB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;SACrB,CAAC;QAEF,qBAAgB,GAAG,CAAC,KAAkB;YAClC,MAAM,MA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IAAI,CAAC,IAAI,EACf,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAChC,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAChC,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAC5B,IAAI,EAAE,IAAI,CAAC,WAAW,IAAI,SAAS,EACnC,KAAK,EAAE,IAAI,CAAC,KAAK,IAEjBA,kEACI,OAAO,EAAE,IAAI,CAAC,mBAAmB,EACjC,SAAS,EAAE,IAAI,CAAC,qBAAqB,IAErCA,oEAAQ,EACP,IAAI,CAAC,IAAI,KACNA,qEACI,KAAK,EAAC,mBAAmB,EACzB,OAAO,EAAE,IAAI,CAAC,aAAa,GAC7B,CACL,CACC,CACG,CACC,EACpB;KACL;;;;;;;;;;;;;;;;;","names":["waitForNextPaint","handleRenamedProp","handleAriaLabel","isEventFromElement","overrideFocus","h","loc","Fragment"],"sources":["src/components/q2-dropdown/q2-dropdown.scss?tag=q2-dropdown&encapsulation=shadow","src/components/q2-dropdown/q2-dropdown.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n display: inline-flex;\n}\n\n:host([block]) {\n display: block;\n}\n\nclick-elsewhere {\n position: relative;\n display: block;\n}\n\nq2-popover {\n --tct-popover-min-width: #{var-list(var-prefixer(dropdown-width))};\n}\n","import { Component, ComponentInterface, Prop, Element, Watch, h, Fragment, Listen } from '@stencil/core';\nimport { IDict } from 'src/util';\nimport {\n handleAriaLabel,\n handleRenamedProp,\n isEventFromElement,\n loc,\n overrideFocus,\n waitForNextPaint,\n} from 'src/utils';\n\n@Component({ tag: 'q2-dropdown', shadow: true, styleUrl: 'q2-dropdown.scss' })\nexport class Q2Dropdown implements ComponentInterface {\n @Prop({ reflect: true }) additionalContext: string;\n\n /** If `true`, component expands to fill the width of its parent element. */\n @Prop({ reflect: true }) block: boolean;\n\n /**\n * Tells the outlet what the type of object being passed in as contextValue.\n * This will allow for the hierarchy resolution logic to work to determine if an option should or should not be shown.\n *\n * @info\n * Only applicable when using `<q2-dropdown>` for outlets.\n */\n @Prop({ reflect: true }) context: string;\n\n /**\n * Passes important information to the outlet (e.g., pass an account id that your platform can use to look up what module to show for that account type).\n *\n * @info\n * Only applicable when using `<q2-dropdown>` for outlets.\n */\n @Prop({ reflect: true }) contextValue: string;\n\n /** Indicates the menu cannot be focused or interacted with. */\n @Prop({ reflect: true }) disabled: boolean;\n\n /**\n * Hide's the field's `<label>` element from view.\n * @warning\n * Only use when a visible label is impractical.\n */\n @Prop({ reflect: true, mutable: true }) hideLabel: boolean;\n\n /** The icon that will render within the toggle button. You may use any of the `q2-icon` types. */\n @Prop({ reflect: true }) icon: string;\n\n /**\n * The text that appears within the button.\n * @warning\n * This property should not be used if the `type` is `icon`.\n * @localizable\n */\n @Prop({ reflect: true, mutable: true }) label: string;\n\n /**\n * Identifies this menu as an outlet. Used in conjunction with context and, optionally, `contextValue`.\n * @info\n * Only applicable when using `<q2-dropdown>` for outlets.\n */\n @Prop({ reflect: true }) name: string;\n\n /** Determine whether the popover is open or closed. */\n @Prop({ reflect: true, mutable: true }) open: boolean;\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({ mutable: true }) popoverDirection: 'up' | 'down';\n\n /** Aligns the popover dropdown to the left or right side of the input field. */\n @Prop({ mutable: true }) popoverAlignment: 'left' | 'right' = 'left'; // being used in dropdown.scss\n\n /**\n * Determines the display mode of the popover.\n *\n * Providing a value of `legacy` instructs the popover to use absolute positioning instead of fixed positioning.\n *\n * @info\n * This is a temporary solution to work around styling issues related to using fixed positioning for the popover\n * when nested inside of elements with transform properties. This will be removed once the popover API is available\n * for use.\n */\n @Prop({ mutable: true }) popoverMode: 'legacy' = null;\n\n /** @deprecated */\n @Prop() popoverMinHeight: number = 150;\n\n /**\n * Use with `context` to tell the outlet where it appears. It will be matched with the appropriately configured module for that context.\n * @info\n * Only applicable when using `<q2-dropdown>` for outlets.\n */\n @Prop({ reflect: true }) resolvedType: string;\n\n /** The type of button used as the menu toggle. */\n @Prop({ reflect: true }) type: 'icon' | 'fab' | 'custom' | 'primary' | 'secondary' | 'neutral' = 'icon';\n\n /** @deprecated */\n @Prop({ reflect: true }) alignment: 'left' | 'right';\n\n /** @deprecated */\n @Prop({ reflect: true }) popDirection: 'up' | 'down';\n\n /** @deprecated */\n @Prop({ reflect: true, mutable: true }) ariaLabel: string;\n\n @Element() hostElement: HTMLElement;\n privatePopDirection: 'down' | 'up';\n controlElement?: HTMLQ2BtnElement;\n popoverElement?: HTMLQ2PopoverElement;\n dropdownItemSelector: string = 'q2-dropdown-item:not([disabled]):not([separator])';\n\n resolveMenu() {\n return (\n this.name &&\n window.TectonElements &&\n window.TectonElements.resolveMenu(this.name, this.contextValue, this.resolvedType, this.additionalContext)\n );\n }\n\n orchestrateResolvedMenuItems() {\n if (!this.name || !this.context) {\n // this is only for contextual menu outlets\n this.removeResolvedElements();\n return;\n }\n\n this.resolveMenuItemElements()\n .then(data => {\n this.removeResolvedElements();\n data.forEach(element => {\n this.hostElement.appendChild(element);\n });\n })\n .catch(err => {\n this.removeResolvedElements();\n throw err;\n });\n }\n\n removeResolvedElements() {\n const resolvedElements = this.hostElement.querySelectorAll('q2-dropdown-item.resolved-menu-item');\n resolvedElements.forEach(element => this.hostElement.removeChild(element));\n }\n\n resolveMenuItemElements() {\n return this.resolveMenu().then(datas => {\n return datas.map(menuItemData => {\n let onClickFn;\n let queryParams;\n if (menuItemData['tct-ctxid']) {\n queryParams = {};\n queryParams[menuItemData.contextIdParamName] = menuItemData['tct-ctxid'];\n }\n\n switch (menuItemData.action) {\n case 'navigateTo':\n onClickFn = () =>\n this.navigateTo(menuItemData.featureName, menuItemData.moduleName, queryParams);\n break;\n case 'showOverpanel':\n onClickFn = () =>\n this.showOverpanel(`${menuItemData.featureName}.${menuItemData.moduleName}`, queryParams);\n break;\n }\n\n const newDropdownItem = document.createElement('q2-dropdown-item');\n newDropdownItem.setAttribute('value', menuItemData.itemLabel);\n newDropdownItem.classList.add('resolved-menu-item');\n newDropdownItem.innerHTML = menuItemData.itemLabel;\n newDropdownItem.onclick = onClickFn;\n\n return newDropdownItem;\n });\n });\n }\n\n navigateTo(featureName: string, moduleName?: string, queryParams?: IDict<string>) {\n return window.TectonElements?.navigateTo?.(featureName, moduleName, queryParams);\n }\n\n showOverpanel(overpanelPath: string, params: IDict<string>) {\n return window.TectonElements?.showOverpanel?.(overpanelPath, params, undefined, true);\n }\n\n get hasCustomButton() {\n return !!this.hostElement.querySelector('[slot=custom-dropdown-button]');\n }\n\n get determineDropdownItemCount() {\n return this.hostElement.querySelectorAll(this.dropdownItemSelector).length;\n }\n\n get toggleButtonProps() {\n const allowedIntents = ['primary', 'secondary', 'neutral'];\n const allowedTypes = ['icon', 'fab', 'custom', ...allowedIntents];\n const type = allowedTypes.includes(this.type) ? this.type : '';\n const icon = type === 'icon';\n const fab = type === 'fab';\n const custom = type === 'custom';\n let intent;\n if (allowedIntents.includes(type)) {\n intent = type === 'neutral' ? type : `workflow-${type}`;\n }\n const active = this.open;\n const disabled = !!this.disabled;\n const ariaExpanded = this.open;\n const className = !icon && !fab && !intent ? 'unstyled' : '';\n\n return {\n icon,\n fab,\n intent,\n active,\n disabled,\n ariaExpanded,\n className,\n custom,\n };\n }\n\n //////// Observers //////////\n @Watch('popDirection')\n popDirectionHandler() {\n handleRenamedProp(this, 'popDirection', 'popoverDirection');\n }\n\n @Watch('alignment')\n alignmentHandler() {\n handleRenamedProp(this, 'alignment', 'popoverAlignment');\n }\n\n @Watch('ariaLabel')\n ariaLabelHandler() {\n handleAriaLabel(this);\n }\n\n @Watch('name')\n nameHandler() {\n this.orchestrateResolvedMenuItems();\n }\n\n @Watch('context')\n contextHandler() {\n this.orchestrateResolvedMenuItems();\n }\n\n @Watch('contextValue')\n contextValueHandler() {\n this.orchestrateResolvedMenuItems();\n }\n\n @Watch('resolvedType')\n resolvedTypeHandler() {\n this.orchestrateResolvedMenuItems();\n }\n\n @Watch('additionalContext')\n additionalContextHandler() {\n this.orchestrateResolvedMenuItems();\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n this.focusToggle();\n }\n\n @Listen('popoverStateChanged')\n popoverStateHandler({ detail: { open } }: CustomEvent<{ open: boolean }>) {\n if (this.open !== open) this.open = open;\n this.popoverElement?.scrollContainerTo({ top: 0 });\n }\n\n ///// Lifecycle Hooks ////////\n componentWillLoad() {\n this.popDirectionHandler();\n this.alignmentHandler();\n this.ariaLabelHandler();\n }\n\n componentDidLoad() {\n this.orchestrateResolvedMenuItems();\n overrideFocus(this.hostElement);\n }\n\n ///// Actions ////////\n focusToggle = () => {\n this.controlElement.shadowRoot.querySelector<HTMLButtonElement>('button').focus();\n };\n\n openDropdown = () => {\n if (this.open) return;\n this.open = true;\n };\n\n closeDropdown = () => {\n if (!this.open) return;\n this.open = false;\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 onToggleClick = () => {\n if (this.open) {\n this.closeDropdown();\n } else {\n this.openDropdown();\n }\n };\n\n onToggleKeydown = (event: KeyboardEvent) => {\n if (['ArrowUp', 'Up'].includes(event.key)) {\n event.preventDefault();\n this.openDropdown();\n this.focusLastItem();\n return;\n }\n\n if (['ArrowDown', 'Down'].includes(event.key)) {\n event.preventDefault();\n this.openDropdown();\n this.focusFirstItem();\n return;\n }\n\n if (['Escape', 'Esc'].includes(event.key)) {\n event.preventDefault();\n this.focusToggle();\n this.closeDropdown();\n return;\n }\n };\n\n onDropdownMenuClick = async (event: MouseEvent | CustomEvent) => {\n if ((event.target as HTMLElement).localName !== 'q2-dropdown-item') {\n return;\n }\n const item = event.target as HTMLQ2DropdownItemElement;\n if (!item.disabled && !item.separator) {\n this.closeDropdown();\n await waitForNextPaint();\n this.focusToggle();\n }\n };\n\n focusFirstItem() {\n const firstItem = this.hostElement.querySelector<HTMLQ2DropdownItemElement>(\n `${this.dropdownItemSelector}:first-child`\n );\n\n firstItem?.dispatchEvent(new FocusEvent('focus'));\n }\n\n focusLastItem() {\n const lastItem = this.hostElement.querySelector<HTMLQ2DropdownItemElement>(\n `${this.dropdownItemSelector}:last-child`\n );\n lastItem?.dispatchEvent(new FocusEvent('focus'));\n }\n\n focusAdjacentItem(activeItem: HTMLQ2DropdownItemElement, direction: 'next' | 'prev') {\n const dropdownItems: HTMLQ2DropdownItemElement[] = Array.from(\n this.hostElement.querySelectorAll(this.dropdownItemSelector)\n );\n\n const activeIndex = dropdownItems.indexOf(activeItem);\n\n if (activeIndex === -1) {\n return;\n }\n\n let targetIndex: number = 0;\n if (direction === 'next') {\n targetIndex = activeIndex < dropdownItems.length - 1 ? activeIndex + 1 : 0;\n } else if (direction === 'prev') {\n if (activeIndex > 0) {\n targetIndex = activeIndex - 1;\n } else {\n targetIndex = dropdownItems.length - 1;\n }\n }\n const targetItem = dropdownItems[targetIndex];\n targetItem && targetItem.dispatchEvent(new Event('focus'));\n }\n\n onDropdownMenuKeydown = (event: KeyboardEvent) => {\n if (['Escape', 'Esc'].includes(event.key)) {\n this.closeDropdown();\n this.focusToggle();\n return;\n }\n\n if ((event.target as HTMLElement).localName !== 'q2-dropdown-item') {\n return;\n }\n\n const item = event.target as HTMLQ2DropdownItemElement;\n if (['ArrowUp', 'Up'].includes(event.key)) {\n event.preventDefault();\n this.focusAdjacentItem(item, 'prev');\n return;\n }\n\n if (['ArrowDown', 'Down'].includes(event.key)) {\n event.preventDefault();\n this.focusAdjacentItem(item, 'next');\n return;\n }\n if (event.key === 'Tab') {\n event.preventDefault();\n }\n };\n\n /// DOM ///\n\n render() {\n const btnProps = this.toggleButtonProps;\n\n return (\n <click-elsewhere\n class={this.open ? 'dropdown-open' : ''}\n onChange={this.onClickElsewhere}\n test-id=\"dropdownContainer\"\n >\n <q2-btn\n ref={el => (this.controlElement = el)}\n class={btnProps.className}\n onClick={this.onToggleClick}\n onKeyDown={this.onToggleKeydown}\n fab={btnProps.fab}\n intent={btnProps.intent}\n active={btnProps.active}\n disabled={btnProps.disabled}\n ariaExpanded={`${!!btnProps.ariaExpanded}`}\n label={this.hideLabel && this.label ? loc(this.label) : undefined}\n hideLabel={this.hideLabel}\n ariaHasPopup=\"menu\"\n _role=\"menu\"\n test-id=\"dropdownButton\"\n block={this.block}\n description={loc('tecton.element.dropdown.itemCount', [this.determineDropdownItemCount])}\n >\n {this.hasCustomButton ? (\n <div\n test-id=\"dropdownCustom\"\n class={btnProps.custom ? '' : 'hidden'}\n >\n <slot name=\"custom-dropdown-button\" />\n </div>\n ) : (\n <Fragment>\n {this.icon ? <q2-icon type={this.icon} /> : ' '}\n {this.label && !this.hideLabel && (\n <span class=\"dropdown-button-text\">{loc(this.label)}</span>\n )}\n </Fragment>\n )}\n </q2-btn>\n <q2-popover\n ref={el => (this.popoverElement = el)}\n controlElement={this.controlElement}\n open={this.open}\n minHeight={this.popoverMinHeight}\n direction={this.popoverDirection}\n align={this.popoverAlignment}\n mode={this.popoverMode || undefined}\n block={this.block}\n >\n <div\n onClick={this.onDropdownMenuClick}\n onKeyDown={this.onDropdownMenuKeydown}\n >\n <slot />\n {this.open && (\n <q2-btn\n class=\"sr close-dropdown\"\n onFocus={this.closeDropdown}\n />\n )}\n </div>\n </q2-popover>\n </click-elsewhere>\n );\n }\n}\n"],"version":3}
@@ -3030,9 +3030,10 @@ const Q2Input = class {
3030
3030
  this.step = undefined;
3031
3031
  this.textHidden = undefined;
3032
3032
  this.type = 'text';
3033
+ this._role = undefined;
3033
3034
  this.value = undefined;
3034
- this.ariaControls = undefined;
3035
3035
  this.ariaOwns = undefined;
3036
+ this.ariaControls = undefined;
3036
3037
  this.ariaHaspopup = undefined;
3037
3038
  this.ariaExpanded = undefined;
3038
3039
  this.ariaActivedescendant = undefined;
@@ -3106,7 +3107,6 @@ const Q2Input = class {
3106
3107
  }
3107
3108
  get ariaAttributes() {
3108
3109
  return {
3109
- ariaControls: index$1.getAriaValueFromProp(this.ariaControls),
3110
3110
  ariaOwns: index$1.getAriaValueFromProp(this.ariaOwns),
3111
3111
  ariaHaspopup: index$1.getAriaValueFromProp(this.ariaHaspopup, [
3112
3112
  'true',
@@ -3124,9 +3124,13 @@ const Q2Input = class {
3124
3124
  get hasCustomDisplaySlot() {
3125
3125
  return !!this.hostElement.querySelector('[slot=custom-display]');
3126
3126
  }
3127
- get canClear() {
3127
+ get clearClasses() {
3128
3128
  var _a;
3129
- return this.clearable && !!(((_a = this.inputField) === null || _a === void 0 ? void 0 : _a.value) || this.value);
3129
+ const classes = ['btn-clear'];
3130
+ if (!this.clearable || !(((_a = this.inputField) === null || _a === void 0 ? void 0 : _a.value) || this.value)) {
3131
+ classes.push('hidden');
3132
+ }
3133
+ return classes;
3130
3134
  }
3131
3135
  get shouldCursorStartAtEnd() {
3132
3136
  return this.type === 'currency';
@@ -3252,6 +3256,9 @@ const Q2Input = class {
3252
3256
  get visibilityToggleText() {
3253
3257
  return index$1.loc(`tecton.element.input.toggle.${this.textHidden ? 'show' : 'hide'}`);
3254
3258
  }
3259
+ get visibilityToggleAriaLabel() {
3260
+ return `tecton.element.input.toggleAriaLabel.${this.textHidden ? `show ${this.label}` : `hide ${this.label}`}`;
3261
+ }
3255
3262
  formatAndUpdateValueFromProp() {
3256
3263
  this.formattedValueObject = this.getFormattedValue(this.stringValue, true);
3257
3264
  if (!this.pseudo) {
@@ -3422,7 +3429,7 @@ const Q2Input = class {
3422
3429
  }
3423
3430
  /////// VIEW METHODS ///////
3424
3431
  render() {
3425
- return (index.h("div", { key: '165e2173dc173450c6c08b4a9527d54d4d2e5cc2', class: this.wrapperClasses }, index.h("div", { key: '51d61f7ef98d0ffa36502469b7a341222a8d3865', class: "label-wrapper" }, index$1.labelDOM(this), this.countDOM()), this.inputContainerDOM(), index$1.messagesDOM(this)));
3432
+ return (index.h("div", { key: '99673dcff3480239090a523f3bd11fe50dc3bb7c', class: this.wrapperClasses }, index.h("div", { key: '81b949df05caf96b67fdee796cabe21c202b5e46', class: "label-wrapper" }, index$1.labelDOM(this), this.countDOM()), this.inputContainerDOM(), index$1.messagesDOM(this)));
3426
3433
  }
3427
3434
  countDOM() {
3428
3435
  if (!this.showCount)
@@ -3433,23 +3440,23 @@ const Q2Input = class {
3433
3440
  /* tslint:disable:cyclomatic-complexity */
3434
3441
  inputContainerDOM() {
3435
3442
  const { hasInputLeftSlot, hasInputRightSlot } = this;
3436
- return (index.h("div", { class: "input-container", tabindex: -1, "test-id": "inputContainer" }, index.h("div", { class: "input-icons-container-left" }, this.formattedValueObject.prefix && (index.h("div", { class: "input-prefix" }, this.formattedValueObject.prefix)), this.computedIconLeft && (index.h("div", null, index.h("q2-icon", { type: this.computedIconLeft, class: this.computedClassForIconLeft }))), hasInputLeftSlot && index.h("slot", { name: "input-left" }), this.showIconSeparator && index.h("div", { class: "vertical-separator" }), this.hasError && this.type === 'currency' && (index.h("div", { "test-id": "divIconError", onClick: this.onRefocusInput }, index.h("q2-icon", { type: "error", class: "icon-error", "test-id": "iconError" })))), this.pseudo ? this.pseudoInputDOM() : this.standardInputDOM(), index.h("div", { class: "input-icons-container-right" }, this.canClear && (index.h("q2-btn", { class: "btn-clear", ariaLabel: index$1.loc('tecton.element.input.clear', [this.label]), "test-id": "clearButton", onClick: this.onClearInput }, index.h("q2-icon", { type: "close", class: "icon-clear" }))), ['password', 'text', 'ssn', 'tin'].includes(this.type) && this.showVisibilityToggle && (index.h("q2-btn", { class: "btn-visibility-toggle", "test-id": "toggleVisibilityButton", onClick: this.onToggleVisibility }, this.visibilityToggleText)), this.formattedValueObject.suffix && (index.h("span", { class: "input-suffix" }, this.formattedValueObject.suffix)), this.badgeValue && (index.h("q2-badge", { size: "large", theme: this.badgeTheme }, this.badgeValue)), this.hasError && this.type !== 'currency' && (index.h("div", { "test-id": "divIconError", onClick: this.onRefocusInput }, index.h("q2-icon", { type: "error", class: "icon-error", "test-id": "iconError" }))), this.iconRight && !this.formattedValueObject.suffix && (index.h("div", null, index.h("q2-icon", { type: this.iconRight, class: "icon-right" }))), hasInputRightSlot && index.h("slot", { name: "input-right" }))));
3443
+ return (index.h("div", { class: "input-container", tabindex: -1, "test-id": "inputContainer" }, index.h("div", { class: "input-icons-container-left" }, this.formattedValueObject.prefix && (index.h("div", { class: "input-prefix" }, this.formattedValueObject.prefix)), this.computedIconLeft && (index.h("div", null, index.h("q2-icon", { type: this.computedIconLeft, class: this.computedClassForIconLeft }))), hasInputLeftSlot && index.h("slot", { name: "input-left" }), this.showIconSeparator && index.h("div", { class: "vertical-separator" }), this.hasError && this.type === 'currency' && (index.h("div", { "test-id": "divIconError", onClick: this.onRefocusInput }, index.h("q2-icon", { type: "error", class: "icon-error", "test-id": "iconError" })))), this.pseudo ? this.pseudoInputDOM() : this.standardInputDOM(), index.h("div", { class: "input-icons-container-right" }, index.h("q2-btn", { class: this.clearClasses.join(' '), ariaLabel: index$1.loc('tecton.element.input.clear', [this.label]), "test-id": "clearButton", onClick: this.onClearInput }, index.h("q2-icon", { type: "close", class: "icon-clear" })), ['password', 'text', 'ssn', 'tin'].includes(this.type) && this.showVisibilityToggle && (index.h("q2-btn", { class: "btn-visibility-toggle", "test-id": "toggleVisibilityButton", onClick: this.onToggleVisibility, label: this.visibilityToggleAriaLabel, "hide-label": true }, this.visibilityToggleText)), this.formattedValueObject.suffix && (index.h("span", { class: "input-suffix" }, this.formattedValueObject.suffix)), this.badgeValue && (index.h("q2-badge", { size: "large", theme: this.badgeTheme }, this.badgeValue)), this.hasError && this.type !== 'currency' && (index.h("div", { "test-id": "divIconError", onClick: this.onRefocusInput }, index.h("q2-icon", { type: "error", class: "icon-error", "test-id": "iconError" }))), this.iconRight && !this.formattedValueObject.suffix && (index.h("div", null, index.h("q2-icon", { type: this.iconRight, class: "icon-right" }))), hasInputRightSlot && index.h("slot", { name: "input-right" }))));
3437
3444
  }
3438
3445
  /* tslint:enable:cyclomatic-complexity */
3439
3446
  /* tslint:disable:cyclomatic-complexity */
3440
3447
  standardInputDOM() {
3441
3448
  const { hasCustomDisplaySlot } = this;
3442
3449
  const inputClasses = ['input-field'];
3443
- const { ariaControls, ariaOwns, ariaHaspopup, ariaExpanded, ariaActivedescendant } = this.ariaAttributes;
3450
+ const { ariaOwns, ariaHaspopup, ariaExpanded, ariaActivedescendant } = this.ariaAttributes;
3444
3451
  if (hasCustomDisplaySlot)
3445
3452
  inputClasses.push('sr');
3446
- return (index.h(index.Fragment, null, hasCustomDisplaySlot && (index.h("div", { class: "custom-display-container" }, index.h("slot", { name: "custom-display" }))), index.h("input", { class: inputClasses.join(' '), id: this.inputId, type: this.computedType, size: this.formattedValueObject.prefix ? 10 : undefined, max: this.max, min: this.min, step: this.step, "aria-current": this.current || undefined, "aria-describedby": this.inputDescribedBy, "aria-required": `${!this.optional}`, "aria-invalid": `${this.hasError}`, "aria-controls": ariaControls, "aria-owns": ariaOwns, "aria-haspopup": ariaHaspopup, "aria-expanded": ariaExpanded, "aria-activedescendant": ariaActivedescendant, autocomplete: this.computedAutocomplete, autocapitalize: this.autocapitalize, autocorrect: this.autocorrect === 'on' ? 'on' : 'off', autofocus: this.autofocus, placeholder: (this.placeholder && index$1.loc(this.placeholder)) || undefined, role: (this.role && `${this.role}`) || undefined, "test-id": "inputField", readonly: !!this.readonly, disabled: !!this.disabled, onFocus: this.onInputFocus, onBlur: this.onInputBlur, onClick: this.onInputClick, onKeyDown: this.onInputKeydown, onInput: this.onInputInput, onPaste: this.onInputPaste, inputmode: this.inputMode })));
3453
+ return (index.h(index.Fragment, null, hasCustomDisplaySlot && (index.h("div", { class: "custom-display-container" }, index.h("slot", { name: "custom-display" }))), index.h("input", { class: inputClasses.join(' '), id: this.inputId, type: this.computedType, size: this.formattedValueObject.prefix ? 10 : undefined, max: this.max, min: this.min, step: this.step, "aria-current": this.current || undefined, "aria-describedby": this.inputDescribedBy, "aria-required": `${!this.optional}`, "aria-invalid": `${this.hasError}`, "aria-owns": ariaOwns, "aria-haspopup": ariaHaspopup, "aria-expanded": ariaExpanded, "aria-activedescendant": ariaActivedescendant, autocomplete: this.computedAutocomplete, autocapitalize: this.autocapitalize, autocorrect: this.autocorrect === 'on' ? 'on' : 'off', autofocus: this.autofocus, placeholder: (this.placeholder && index$1.loc(this.placeholder)) || undefined, role: this._role, "test-id": "inputField", readonly: !!this.readonly, disabled: !!this.disabled, onFocus: this.onInputFocus, onBlur: this.onInputBlur, onClick: this.onInputClick, onKeyDown: this.onInputKeydown, onInput: this.onInputInput, onPaste: this.onInputPaste, inputmode: this.inputMode })));
3447
3454
  }
3448
3455
  /* tslint:enable:cyclomatic-complexity */
3449
3456
  pseudoInputDOM() {
3450
3457
  const showPlaceholder = !this.value && !!this.placeholder;
3451
- const { ariaControls, ariaOwns, ariaHaspopup, ariaExpanded, ariaActivedescendant } = this.ariaAttributes;
3452
- return (index.h("div", { class: "pseudo-input-container" }, index.h("button", { class: "input-field", type: "button", id: this.inputId, "aria-describedby": this.inputDescribedBy, "aria-invalid": `${this.hasError}`, "aria-controls": ariaControls, "aria-owns": ariaOwns, "aria-haspopup": ariaHaspopup, "aria-expanded": ariaExpanded, "aria-activedescendant": ariaActivedescendant, role: (this.role && `${this.role}`) || undefined, disabled: !!this.disabled, "test-id": "q2InputInnerClearButton", onFocus: this.onInputFocus, onBlur: this.onInputBlur }, index.h("div", { class: "custom-display-container" }, index.h("slot", { name: "custom-display" }, index.h("span", { class: showPlaceholder ? 'placeholder-text' : '' }, showPlaceholder ? this.placeholder : this.value))))));
3458
+ const { ariaOwns, ariaHaspopup, ariaExpanded, ariaActivedescendant } = this.ariaAttributes;
3459
+ return (index.h("div", { class: "pseudo-input-container" }, index.h("button", { class: "input-field", type: "button", id: this.inputId, "aria-describedby": this.inputDescribedBy, "aria-invalid": `${this.hasError}`, "aria-owns": ariaOwns, "aria-haspopup": ariaHaspopup, "aria-expanded": ariaExpanded, "aria-activedescendant": ariaActivedescendant, role: (this.role && `${this.role}`) || 'textbox', disabled: !!this.disabled, "test-id": "q2InputInnerClearButton", onFocus: this.onInputFocus, onBlur: this.onInputBlur }, index.h("div", { class: "custom-display-container" }, index.h("slot", { name: "custom-display" }, index.h("span", { class: showPlaceholder ? 'placeholder-text' : '' }, showPlaceholder ? this.placeholder : this.value))))));
3453
3460
  }
3454
3461
  placeCursorAtEnd() {
3455
3462
  const { inputField } = this;