q2-tecton-elements 1.53.0 → 1.53.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (442) hide show
  1. package/dist/cjs/click-elsewhere_2.cjs.entry.js +64 -61
  2. package/dist/cjs/click-elsewhere_2.cjs.entry.js.map +1 -1
  3. package/dist/cjs/{index-07285783.js → index-76f63767.js} +1 -21
  4. package/dist/cjs/index-76f63767.js.map +1 -0
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/q2-action-group.cjs.entry.js +2 -2
  7. package/dist/cjs/q2-action-sheet.cjs.entry.js +2 -2
  8. package/dist/cjs/q2-avatar.cjs.entry.js +1 -1
  9. package/dist/cjs/q2-badge_7.cjs.entry.js +12 -4
  10. package/dist/cjs/q2-badge_7.cjs.entry.js.map +1 -1
  11. package/dist/cjs/q2-calendar.cjs.entry.js +1 -1
  12. package/dist/cjs/q2-card.cjs.entry.js +1 -1
  13. package/dist/cjs/q2-carousel-pane.cjs.entry.js +3 -3
  14. package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
  15. package/dist/cjs/q2-chart-area.cjs.entry.js +2 -2
  16. package/dist/cjs/q2-chart-bar.cjs.entry.js +2 -2
  17. package/dist/cjs/q2-chart-donut.cjs.entry.js +2 -2
  18. package/dist/cjs/q2-checkbox-group.cjs.entry.js +1 -1
  19. package/dist/cjs/q2-checkbox.cjs.entry.js +1 -1
  20. package/dist/cjs/q2-currency.cjs.entry.js +1 -1
  21. package/dist/cjs/q2-data-table.cjs.entry.js +1 -1
  22. package/dist/cjs/q2-detail.cjs.entry.js +2 -2
  23. package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
  24. package/dist/cjs/q2-dropdown.cjs.entry.js +10 -12
  25. package/dist/cjs/q2-dropdown.cjs.entry.js.map +1 -1
  26. package/dist/cjs/q2-editable-field.cjs.entry.js +7 -8
  27. package/dist/cjs/q2-editable-field.cjs.entry.js.map +1 -1
  28. package/dist/cjs/q2-example.cjs.entry.js +1 -1
  29. package/dist/cjs/q2-file-picker.cjs.entry.js +1 -1
  30. package/dist/cjs/q2-formatted-text.cjs.entry.js +1 -1
  31. package/dist/cjs/q2-item_3.cjs.entry.js +3 -3
  32. package/dist/cjs/q2-legend.cjs.entry.js +1 -1
  33. package/dist/cjs/q2-loc.cjs.entry.js +2 -2
  34. package/dist/cjs/q2-message.cjs.entry.js +2 -2
  35. package/dist/cjs/q2-month-picker.cjs.entry.js +3 -3
  36. package/dist/cjs/q2-optgroup.cjs.entry.js +2 -2
  37. package/dist/cjs/q2-option-list.cjs.entry.js +1 -1
  38. package/dist/cjs/q2-option.cjs.entry.js +2 -2
  39. package/dist/cjs/q2-pagination.cjs.entry.js +4 -4
  40. package/dist/cjs/q2-pill.cjs.entry.js +2 -2
  41. package/dist/cjs/q2-radio-group.cjs.entry.js +1 -1
  42. package/dist/cjs/q2-radio.cjs.entry.js +1 -1
  43. package/dist/cjs/q2-relative-time.cjs.entry.js +2 -2
  44. package/dist/cjs/q2-resize-observer.cjs.entry.js +1 -1
  45. package/dist/cjs/q2-section.cjs.entry.js +3 -3
  46. package/dist/cjs/q2-select.cjs.entry.js +89 -13
  47. package/dist/cjs/q2-select.cjs.entry.js.map +1 -1
  48. package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
  49. package/dist/cjs/q2-stepper-vertical.cjs.entry.js +2 -2
  50. package/dist/cjs/q2-stepper.cjs.entry.js +2 -2
  51. package/dist/cjs/q2-tag.cjs.entry.js +2 -2
  52. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  53. package/dist/cjs/q2-textarea.cjs.entry.js +3 -2
  54. package/dist/cjs/q2-textarea.cjs.entry.js.map +1 -1
  55. package/dist/cjs/q2-tooltip.cjs.entry.js +1 -1
  56. package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -2
  57. package/dist/collection/components/click-elsewhere/click-elsewhere.js.map +1 -1
  58. package/dist/collection/components/click-elsewhere/test/click-elsewhere-test.e2e.js.map +1 -1
  59. package/dist/collection/components/q2-action-group/q2-action-group.js +1 -1
  60. package/dist/collection/components/q2-action-group/q2-action-group.js.map +1 -1
  61. package/dist/collection/components/q2-action-group/test/q2-action-group.e2e.js.map +1 -1
  62. package/dist/collection/components/q2-action-group/test/q2-action-group.spec.js.map +1 -1
  63. package/dist/collection/components/q2-action-sheet/q2-action-sheet.js +1 -1
  64. package/dist/collection/components/q2-action-sheet/q2-action-sheet.js.map +1 -1
  65. package/dist/collection/components/q2-action-sheet/test/q2-action-sheet-test.e2e.js.map +1 -1
  66. package/dist/collection/components/q2-avatar/q2-avatar.js +1 -1
  67. package/dist/collection/components/q2-avatar/q2-avatar.js.map +1 -1
  68. package/dist/collection/components/q2-avatar/test/q2-avatar-test.e2e.js.map +1 -1
  69. package/dist/collection/components/q2-badge/q2-badge.js.map +1 -1
  70. package/dist/collection/components/q2-badge/test/q2-badge-test.e2e.js.map +1 -1
  71. package/dist/collection/components/q2-btn/q2-btn.js +4 -0
  72. package/dist/collection/components/q2-btn/q2-btn.js.map +1 -1
  73. package/dist/collection/components/q2-btn/test/q2-btn-test.e2e.js.map +1 -1
  74. package/dist/collection/components/q2-calendar/q2-calendar-helpers.js.map +1 -1
  75. package/dist/collection/components/q2-calendar/q2-calendar-types.js.map +1 -1
  76. package/dist/collection/components/q2-calendar/q2-calendar-validation.js.map +1 -1
  77. package/dist/collection/components/q2-calendar/q2-calendar.js.map +1 -1
  78. package/dist/collection/components/q2-calendar/q2-month-picker.js +2 -2
  79. package/dist/collection/components/q2-calendar/q2-month-picker.js.map +1 -1
  80. package/dist/collection/components/q2-calendar/test/helpers-test.e2e.js.map +1 -1
  81. package/dist/collection/components/q2-calendar/test/q2-calendar-month-picker-test.e2e.js.map +1 -1
  82. package/dist/collection/components/q2-calendar/test/q2-calendar-test.e2e.js +2 -2
  83. package/dist/collection/components/q2-calendar/test/q2-calendar-test.e2e.js.map +1 -1
  84. package/dist/collection/components/q2-calendar/test/validation-test.e2e.js.map +1 -1
  85. package/dist/collection/components/q2-card/q2-card.js.map +1 -1
  86. package/dist/collection/components/q2-card/test/q2-card-test.e2e.js.map +1 -1
  87. package/dist/collection/components/q2-carousel/q2-carousel.js.map +1 -1
  88. package/dist/collection/components/q2-carousel/test/q2-carousel-test.e2e.js.map +1 -1
  89. package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js +2 -2
  90. package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js.map +1 -1
  91. package/dist/collection/components/q2-carousel-pane/test/q2-carousel-pane-test.e2e.js.map +1 -1
  92. package/dist/collection/components/q2-carousel-pane/test/q2-carousel-pane-test.spec.js.map +1 -1
  93. package/dist/collection/components/q2-chart-area/q2-chart-area.js +1 -1
  94. package/dist/collection/components/q2-chart-area/q2-chart-area.js.map +1 -1
  95. package/dist/collection/components/q2-chart-area/test/q2-chart-area-test.e2e.js.map +1 -1
  96. package/dist/collection/components/q2-chart-bar/q2-chart-bar.js +1 -1
  97. package/dist/collection/components/q2-chart-bar/q2-chart-bar.js.map +1 -1
  98. package/dist/collection/components/q2-chart-bar/test/q2-chart-bar-test.e2e.js.map +1 -1
  99. package/dist/collection/components/q2-chart-donut/q2-chart-donut.js +1 -1
  100. package/dist/collection/components/q2-chart-donut/q2-chart-donut.js.map +1 -1
  101. package/dist/collection/components/q2-chart-donut/test/q2-chart-donut-test.e2e.js.map +1 -1
  102. package/dist/collection/components/q2-checkbox/q2-checkbox.js.map +1 -1
  103. package/dist/collection/components/q2-checkbox/test/q2-checkbox-test.e2e.js.map +1 -1
  104. package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.js.map +1 -1
  105. package/dist/collection/components/q2-checkbox-group/test/q2-checkbox-group-test.e2e.js.map +1 -1
  106. package/dist/collection/components/q2-currency/q2-currency.js +1 -1
  107. package/dist/collection/components/q2-currency/q2-currency.js.map +1 -1
  108. package/dist/collection/components/q2-currency/test/q2-currency-test.e2e.js.map +1 -1
  109. package/dist/collection/components/q2-data-table/q2-data-table.js.map +1 -1
  110. package/dist/collection/components/q2-data-table/test/q2-data-table-test.e2e.js.map +1 -1
  111. package/dist/collection/components/q2-detail/q2-detail.js +1 -1
  112. package/dist/collection/components/q2-detail/q2-detail.js.map +1 -1
  113. package/dist/collection/components/q2-detail/test/q2-detail-test.e2e.js.map +1 -1
  114. package/dist/collection/components/q2-dropdown/q2-dropdown.js +9 -11
  115. package/dist/collection/components/q2-dropdown/q2-dropdown.js.map +1 -1
  116. package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.e2e.js +5 -17
  117. package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.e2e.js.map +1 -1
  118. package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.js.map +1 -1
  119. package/dist/collection/components/q2-dropdown-item/test/q2-dropdown-item-test.e2e.js.map +1 -1
  120. package/dist/collection/components/q2-editable-field/q2-editable-field.js +12 -7
  121. package/dist/collection/components/q2-editable-field/q2-editable-field.js.map +1 -1
  122. package/dist/collection/components/q2-editable-field/test/q2-editable-field-test.e2e.js.map +1 -1
  123. package/dist/collection/components/q2-example/q2-example.js +1 -1
  124. package/dist/collection/components/q2-example/q2-example.js.map +1 -1
  125. package/dist/collection/components/q2-example/test/q2-example.e2e.js.map +1 -1
  126. package/dist/collection/components/q2-example/test/q2-example.spec.js.map +1 -1
  127. package/dist/collection/components/q2-file-picker/q2-file-picker.js.map +1 -1
  128. package/dist/collection/components/q2-file-picker/test/q2-file-picker-test.e2e.js.map +1 -1
  129. package/dist/collection/components/q2-file-picker/test/q2-file-picker-test.spec.js.map +1 -1
  130. package/dist/collection/components/q2-formatted-text/q2-formatted-text.js +1 -1
  131. package/dist/collection/components/q2-formatted-text/q2-formatted-text.js.map +1 -1
  132. package/dist/collection/components/q2-formatted-text/test/q2-formatted-text-test.e2e.js.map +1 -1
  133. package/dist/collection/components/q2-icon/q2-icon-types.js.map +1 -1
  134. package/dist/collection/components/q2-icon/q2-icon.js +4 -0
  135. package/dist/collection/components/q2-icon/q2-icon.js.map +1 -1
  136. package/dist/collection/components/q2-icon/test/q2-icon-test.e2e.js.map +1 -1
  137. package/dist/collection/components/q2-input/formatting/alpha.js.map +1 -1
  138. package/dist/collection/components/q2-input/formatting/alpha.spec.js.map +1 -1
  139. package/dist/collection/components/q2-input/formatting/alphanumeric.js.map +1 -1
  140. package/dist/collection/components/q2-input/formatting/alphanumeric.spec.js.map +1 -1
  141. package/dist/collection/components/q2-input/formatting/credit-card.js.map +1 -1
  142. package/dist/collection/components/q2-input/formatting/credit-card.spec.js.map +1 -1
  143. package/dist/collection/components/q2-input/formatting/currency.js.map +1 -1
  144. package/dist/collection/components/q2-input/formatting/currency.spec.js.map +1 -1
  145. package/dist/collection/components/q2-input/formatting/date.js.map +1 -1
  146. package/dist/collection/components/q2-input/formatting/date.spec.js.map +1 -1
  147. package/dist/collection/components/q2-input/formatting/generic.js.map +1 -1
  148. package/dist/collection/components/q2-input/formatting/number.js.map +1 -1
  149. package/dist/collection/components/q2-input/formatting/numeric.js.map +1 -1
  150. package/dist/collection/components/q2-input/formatting/numeric.spec.js.map +1 -1
  151. package/dist/collection/components/q2-input/formatting/phone.js.map +1 -1
  152. package/dist/collection/components/q2-input/formatting/phone.spec.js.map +1 -1
  153. package/dist/collection/components/q2-input/formatting/postal.js.map +1 -1
  154. package/dist/collection/components/q2-input/formatting/postal.spec.js.map +1 -1
  155. package/dist/collection/components/q2-input/formatting/ssn.js.map +1 -1
  156. package/dist/collection/components/q2-input/formatting/ssn.spec.js.map +1 -1
  157. package/dist/collection/components/q2-input/formatting/tin.js.map +1 -1
  158. package/dist/collection/components/q2-input/formatting/tin.spec.js.map +1 -1
  159. package/dist/collection/components/q2-input/q2-input-types.js.map +1 -1
  160. package/dist/collection/components/q2-input/q2-input.js +1 -1
  161. package/dist/collection/components/q2-input/q2-input.js.map +1 -1
  162. package/dist/collection/components/q2-input/test/q2-input-credit-card-test.e2e.js.map +1 -1
  163. package/dist/collection/components/q2-input/test/q2-input-test.e2e.js.map +1 -1
  164. package/dist/collection/components/q2-input/test/q2-input-test.spec.js.map +1 -1
  165. package/dist/collection/components/q2-item/q2-item.js +1 -1
  166. package/dist/collection/components/q2-item/q2-item.js.map +1 -1
  167. package/dist/collection/components/q2-item/test/q2-item-test.e2e.js.map +1 -1
  168. package/dist/collection/components/q2-item/test/q2-item-test.spec.js.map +1 -1
  169. package/dist/collection/components/q2-legend/q2-legend.js +1 -1
  170. package/dist/collection/components/q2-legend/q2-legend.js.map +1 -1
  171. package/dist/collection/components/q2-legend/test/q2-legend-test.e2e.js.map +1 -1
  172. package/dist/collection/components/q2-legend/test/q2-legend-test.spec.js.map +1 -1
  173. package/dist/collection/components/q2-link/q2-link.js.map +1 -1
  174. package/dist/collection/components/q2-link/test/q2-link-test.e2e.js.map +1 -1
  175. package/dist/collection/components/q2-list/q2-list.js +1 -1
  176. package/dist/collection/components/q2-list/q2-list.js.map +1 -1
  177. package/dist/collection/components/q2-list/test/q2-list-test.e2e.js.map +1 -1
  178. package/dist/collection/components/q2-loading/q2-loading.js.map +1 -1
  179. package/dist/collection/components/q2-loading/skeleton/q2-loading-element/index.js.map +1 -1
  180. package/dist/collection/components/q2-loading/skeleton/shapes.js.map +1 -1
  181. package/dist/collection/components/q2-loading/test/q2-loading-element-test.e2e.js.map +1 -1
  182. package/dist/collection/components/q2-loading/test/q2-loading-test.e2e.js.map +1 -1
  183. package/dist/collection/components/q2-loc/q2-loc.js +1 -1
  184. package/dist/collection/components/q2-loc/q2-loc.js.map +1 -1
  185. package/dist/collection/components/q2-loc/test/q2-loc-test.e2e.js.map +1 -1
  186. package/dist/collection/components/q2-loc/test/q2-loc-test.spec.js.map +1 -1
  187. package/dist/collection/components/q2-message/q2-message.js +1 -1
  188. package/dist/collection/components/q2-message/q2-message.js.map +1 -1
  189. package/dist/collection/components/q2-message/test/q2-message-test.e2e.js.map +1 -1
  190. package/dist/collection/components/q2-optgroup/q2-optgroup.js +1 -1
  191. package/dist/collection/components/q2-optgroup/q2-optgroup.js.map +1 -1
  192. package/dist/collection/components/q2-optgroup/test/q2-optgroup-test.e2e.js.map +1 -1
  193. package/dist/collection/components/q2-option/q2-option.js +1 -1
  194. package/dist/collection/components/q2-option/q2-option.js.map +1 -1
  195. package/dist/collection/components/q2-option/test/q2-option-test.e2e.js.map +1 -1
  196. package/dist/collection/components/q2-option/test/q2-option-test.spec.js.map +1 -1
  197. package/dist/collection/components/q2-option-list/q2-option-list.js.map +1 -1
  198. package/dist/collection/components/q2-option-list/test/q2-option-list-test.e2e.js.map +1 -1
  199. package/dist/collection/components/q2-pagination/q2-pagination.js +3 -3
  200. package/dist/collection/components/q2-pagination/q2-pagination.js.map +1 -1
  201. package/dist/collection/components/q2-pagination/test/q2-pagination-test.e2e.js +1 -0
  202. package/dist/collection/components/q2-pagination/test/q2-pagination-test.e2e.js.map +1 -1
  203. package/dist/collection/components/q2-pill/q2-pill.js +1 -1
  204. package/dist/collection/components/q2-pill/q2-pill.js.map +1 -1
  205. package/dist/collection/components/q2-pill/test/q2-pill-test.e2e.js +1 -1
  206. package/dist/collection/components/q2-pill/test/q2-pill-test.e2e.js.map +1 -1
  207. package/dist/collection/components/q2-popover/q2-popover.css +18 -10
  208. package/dist/collection/components/q2-popover/q2-popover.js +64 -60
  209. package/dist/collection/components/q2-popover/q2-popover.js.map +1 -1
  210. package/dist/collection/components/q2-popover/test/q2-popover-test.e2e.js +1 -34
  211. package/dist/collection/components/q2-popover/test/q2-popover-test.e2e.js.map +1 -1
  212. package/dist/collection/components/q2-popover/test/q2-popover-test.spec.js +743 -435
  213. package/dist/collection/components/q2-popover/test/q2-popover-test.spec.js.map +1 -1
  214. package/dist/collection/components/q2-radio/q2-radio.js.map +1 -1
  215. package/dist/collection/components/q2-radio/test/q2-radio-test.e2e.js.map +1 -1
  216. package/dist/collection/components/q2-radio-group/q2-radio-group.js.map +1 -1
  217. package/dist/collection/components/q2-radio-group/test/q2-radio-group-test.e2e.js.map +1 -1
  218. package/dist/collection/components/q2-relative-time/q2-relative-time.js +1 -1
  219. package/dist/collection/components/q2-relative-time/q2-relative-time.js.map +1 -1
  220. package/dist/collection/components/q2-relative-time/test/q2-relative-time-test.e2e.js.map +1 -1
  221. package/dist/collection/components/q2-resize-observer/q2-resize-observer.js +1 -1
  222. package/dist/collection/components/q2-resize-observer/q2-resize-observer.js.map +1 -1
  223. package/dist/collection/components/q2-resize-observer/test/q2-resize-observer.e2e.js.map +1 -1
  224. package/dist/collection/components/q2-resize-observer/test/q2-resize-observer.spec.js.map +1 -1
  225. package/dist/collection/components/q2-section/q2-section.js +2 -2
  226. package/dist/collection/components/q2-section/q2-section.js.map +1 -1
  227. package/dist/collection/components/q2-section/test/q2-section-test.e2e.js.map +1 -1
  228. package/dist/collection/components/q2-select/q2-select.js +110 -15
  229. package/dist/collection/components/q2-select/q2-select.js.map +1 -1
  230. package/dist/collection/components/q2-select/test/q2-select-test.e2e.js +1 -1
  231. package/dist/collection/components/q2-select/test/q2-select-test.e2e.js.map +1 -1
  232. package/dist/collection/components/q2-select/test/q2-select-test.spec.js +412 -0
  233. package/dist/collection/components/q2-select/test/q2-select-test.spec.js.map +1 -0
  234. package/dist/collection/components/q2-stepper/q2-stepper.js +1 -1
  235. package/dist/collection/components/q2-stepper/q2-stepper.js.map +1 -1
  236. package/dist/collection/components/q2-stepper/test/q2-stepper-test.e2e.js.map +1 -1
  237. package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js.map +1 -1
  238. package/dist/collection/components/q2-stepper-pane/test/q2-stepper-pane-test.e2e.js.map +1 -1
  239. package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js +1 -1
  240. package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js.map +1 -1
  241. package/dist/collection/components/q2-stepper-vertical/test/q2-stepper-vertical-test.e2e.js.map +1 -1
  242. package/dist/collection/components/q2-tab-container/q2-tab-container.js +1 -1
  243. package/dist/collection/components/q2-tab-container/q2-tab-container.js.map +1 -1
  244. package/dist/collection/components/q2-tab-container/test/q2-tab-container-test.e2e.js.map +1 -1
  245. package/dist/collection/components/q2-tab-container/test/q2-tab-container-test.spec.js.map +1 -1
  246. package/dist/collection/components/q2-tab-pane/q2-tab-pane.js +1 -1
  247. package/dist/collection/components/q2-tab-pane/q2-tab-pane.js.map +1 -1
  248. package/dist/collection/components/q2-tab-pane/test/q2-tab-pane-test.e2e.js.map +1 -1
  249. package/dist/collection/components/q2-tag/q2-tag.js +1 -1
  250. package/dist/collection/components/q2-tag/q2-tag.js.map +1 -1
  251. package/dist/collection/components/q2-tag/test/q2-tag-test.e2e.js +6 -1
  252. package/dist/collection/components/q2-tag/test/q2-tag-test.e2e.js.map +1 -1
  253. package/dist/collection/components/q2-textarea/q2-textarea.js +2 -1
  254. package/dist/collection/components/q2-textarea/q2-textarea.js.map +1 -1
  255. package/dist/collection/components/q2-textarea/test/q2-textarea-test.e2e.js.map +1 -1
  256. package/dist/collection/components/q2-tooltip/q2-tooltip.js.map +1 -1
  257. package/dist/collection/components/q2-tooltip/test/q2-tooltip-test.e2e.js.map +1 -1
  258. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane-types.js.map +1 -1
  259. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +2 -2
  260. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js.map +1 -1
  261. package/dist/collection/components/tecton-tab-pane/test/tecton-tab-pane-test.e2e.js.map +1 -1
  262. package/dist/collection/index.js.map +1 -1
  263. package/dist/collection/utils/action-sheet.js.map +1 -1
  264. package/dist/collection/utils/charting.js.map +1 -1
  265. package/dist/collection/utils/helpers.js.map +1 -1
  266. package/dist/collection/utils/index.js.map +1 -1
  267. package/dist/collection/utils/sanitize-html-string.js.map +1 -1
  268. package/dist/collection/utils/sanitize-regex-string.js.map +1 -1
  269. package/dist/collection/utils/test/action-sheet-test.e2e.js.map +1 -1
  270. package/dist/collection/utils/test/index.spec.js.map +1 -1
  271. package/dist/components/index2.js +1 -20
  272. package/dist/components/index2.js.map +1 -1
  273. package/dist/components/q2-action-group.js +1 -1
  274. package/dist/components/q2-action-sheet.js +1 -1
  275. package/dist/components/q2-avatar2.js +1 -1
  276. package/dist/components/q2-btn2.js +4 -0
  277. package/dist/components/q2-btn2.js.map +1 -1
  278. package/dist/components/q2-carousel-pane.js +2 -2
  279. package/dist/components/q2-chart-area.js +1 -1
  280. package/dist/components/q2-chart-bar.js +1 -1
  281. package/dist/components/q2-chart-donut.js +1 -1
  282. package/dist/components/q2-currency.js +1 -1
  283. package/dist/components/q2-detail.js +1 -1
  284. package/dist/components/q2-dropdown.js +9 -11
  285. package/dist/components/q2-dropdown.js.map +1 -1
  286. package/dist/components/q2-editable-field.js +7 -8
  287. package/dist/components/q2-editable-field.js.map +1 -1
  288. package/dist/components/q2-example.js +1 -1
  289. package/dist/components/q2-formatted-text.js +1 -1
  290. package/dist/components/q2-icon2.js +4 -0
  291. package/dist/components/q2-icon2.js.map +1 -1
  292. package/dist/components/q2-input2.js +1 -1
  293. package/dist/components/q2-item2.js +1 -1
  294. package/dist/components/q2-legend2.js +1 -1
  295. package/dist/components/q2-list2.js +1 -1
  296. package/dist/components/q2-loc.js +1 -1
  297. package/dist/components/q2-message2.js +1 -1
  298. package/dist/components/q2-month-picker.js +2 -2
  299. package/dist/components/q2-optgroup2.js +1 -1
  300. package/dist/components/q2-option2.js +1 -1
  301. package/dist/components/q2-pagination.js +3 -3
  302. package/dist/components/q2-pill.js +1 -1
  303. package/dist/components/q2-popover2.js +63 -60
  304. package/dist/components/q2-popover2.js.map +1 -1
  305. package/dist/components/q2-relative-time.js +1 -1
  306. package/dist/components/q2-resize-observer2.js +1 -1
  307. package/dist/components/q2-section.js +2 -2
  308. package/dist/components/q2-select2.js +92 -16
  309. package/dist/components/q2-select2.js.map +1 -1
  310. package/dist/components/q2-stepper-vertical.js +1 -1
  311. package/dist/components/q2-stepper.js +1 -1
  312. package/dist/components/q2-tab-container.js +1 -1
  313. package/dist/components/q2-tab-pane.js +1 -1
  314. package/dist/components/q2-tag.js +1 -1
  315. package/dist/components/q2-textarea.js +2 -1
  316. package/dist/components/q2-textarea.js.map +1 -1
  317. package/dist/components/tecton-tab-pane.js +2 -2
  318. package/dist/esm/click-elsewhere_2.entry.js +64 -61
  319. package/dist/esm/click-elsewhere_2.entry.js.map +1 -1
  320. package/dist/esm/{index-d18e2a20.js → index-504f1a9e.js} +2 -21
  321. package/dist/esm/index-504f1a9e.js.map +1 -0
  322. package/dist/esm/loader.js +1 -1
  323. package/dist/esm/q2-action-group.entry.js +2 -2
  324. package/dist/esm/q2-action-sheet.entry.js +2 -2
  325. package/dist/esm/q2-avatar.entry.js +1 -1
  326. package/dist/esm/q2-badge_7.entry.js +12 -4
  327. package/dist/esm/q2-badge_7.entry.js.map +1 -1
  328. package/dist/esm/q2-calendar.entry.js +1 -1
  329. package/dist/esm/q2-card.entry.js +1 -1
  330. package/dist/esm/q2-carousel-pane.entry.js +3 -3
  331. package/dist/esm/q2-carousel.entry.js +1 -1
  332. package/dist/esm/q2-chart-area.entry.js +2 -2
  333. package/dist/esm/q2-chart-bar.entry.js +2 -2
  334. package/dist/esm/q2-chart-donut.entry.js +2 -2
  335. package/dist/esm/q2-checkbox-group.entry.js +1 -1
  336. package/dist/esm/q2-checkbox.entry.js +1 -1
  337. package/dist/esm/q2-currency.entry.js +1 -1
  338. package/dist/esm/q2-data-table.entry.js +1 -1
  339. package/dist/esm/q2-detail.entry.js +2 -2
  340. package/dist/esm/q2-dropdown-item.entry.js +1 -1
  341. package/dist/esm/q2-dropdown.entry.js +10 -12
  342. package/dist/esm/q2-dropdown.entry.js.map +1 -1
  343. package/dist/esm/q2-editable-field.entry.js +7 -8
  344. package/dist/esm/q2-editable-field.entry.js.map +1 -1
  345. package/dist/esm/q2-example.entry.js +1 -1
  346. package/dist/esm/q2-file-picker.entry.js +1 -1
  347. package/dist/esm/q2-formatted-text.entry.js +1 -1
  348. package/dist/esm/q2-item_3.entry.js +3 -3
  349. package/dist/esm/q2-legend.entry.js +1 -1
  350. package/dist/esm/q2-loc.entry.js +2 -2
  351. package/dist/esm/q2-message.entry.js +2 -2
  352. package/dist/esm/q2-month-picker.entry.js +3 -3
  353. package/dist/esm/q2-optgroup.entry.js +2 -2
  354. package/dist/esm/q2-option-list.entry.js +1 -1
  355. package/dist/esm/q2-option.entry.js +2 -2
  356. package/dist/esm/q2-pagination.entry.js +4 -4
  357. package/dist/esm/q2-pill.entry.js +2 -2
  358. package/dist/esm/q2-radio-group.entry.js +1 -1
  359. package/dist/esm/q2-radio.entry.js +1 -1
  360. package/dist/esm/q2-relative-time.entry.js +2 -2
  361. package/dist/esm/q2-resize-observer.entry.js +1 -1
  362. package/dist/esm/q2-section.entry.js +3 -3
  363. package/dist/esm/q2-select.entry.js +90 -14
  364. package/dist/esm/q2-select.entry.js.map +1 -1
  365. package/dist/esm/q2-stepper-pane.entry.js +1 -1
  366. package/dist/esm/q2-stepper-vertical.entry.js +2 -2
  367. package/dist/esm/q2-stepper.entry.js +2 -2
  368. package/dist/esm/q2-tag.entry.js +2 -2
  369. package/dist/esm/q2-tecton-elements.js +1 -1
  370. package/dist/esm/q2-textarea.entry.js +3 -2
  371. package/dist/esm/q2-textarea.entry.js.map +1 -1
  372. package/dist/esm/q2-tooltip.entry.js +1 -1
  373. package/dist/esm/tecton-tab-pane.entry.js +2 -2
  374. package/dist/jest.setup.js +22 -0
  375. package/dist/jest.setup.js.map +1 -0
  376. package/dist/q2-tecton-elements/click-elsewhere_2.entry.js +175 -163
  377. package/dist/q2-tecton-elements/click-elsewhere_2.entry.js.map +1 -1
  378. package/dist/q2-tecton-elements/{index-d18e2a20.js → index-504f1a9e.js} +51 -69
  379. package/dist/q2-tecton-elements/index-504f1a9e.js.map +1 -0
  380. package/dist/q2-tecton-elements/q2-action-group.entry.js +4 -4
  381. package/dist/q2-tecton-elements/q2-action-sheet.entry.js +34 -34
  382. package/dist/q2-tecton-elements/q2-avatar.entry.js +6 -6
  383. package/dist/q2-tecton-elements/q2-badge_7.entry.js +25 -17
  384. package/dist/q2-tecton-elements/q2-badge_7.entry.js.map +1 -1
  385. package/dist/q2-tecton-elements/q2-calendar.entry.js +1 -1
  386. package/dist/q2-tecton-elements/q2-card.entry.js +1 -1
  387. package/dist/q2-tecton-elements/q2-carousel-pane.entry.js +21 -21
  388. package/dist/q2-tecton-elements/q2-carousel.entry.js +1 -1
  389. package/dist/q2-tecton-elements/q2-chart-area.entry.js +3 -3
  390. package/dist/q2-tecton-elements/q2-chart-bar.entry.js +3 -3
  391. package/dist/q2-tecton-elements/q2-chart-donut.entry.js +101 -101
  392. package/dist/q2-tecton-elements/q2-checkbox-group.entry.js +1 -1
  393. package/dist/q2-tecton-elements/q2-checkbox.entry.js +1 -1
  394. package/dist/q2-tecton-elements/q2-currency.entry.js +6 -6
  395. package/dist/q2-tecton-elements/q2-data-table.entry.js +1 -1
  396. package/dist/q2-tecton-elements/q2-detail.entry.js +39 -39
  397. package/dist/q2-tecton-elements/q2-dropdown-item.entry.js +1 -1
  398. package/dist/q2-tecton-elements/q2-dropdown.entry.js +14 -16
  399. package/dist/q2-tecton-elements/q2-dropdown.entry.js.map +1 -1
  400. package/dist/q2-tecton-elements/q2-editable-field.entry.js +27 -18
  401. package/dist/q2-tecton-elements/q2-editable-field.entry.js.map +1 -1
  402. package/dist/q2-tecton-elements/q2-example.entry.js +1 -1
  403. package/dist/q2-tecton-elements/q2-file-picker.entry.js +1 -1
  404. package/dist/q2-tecton-elements/q2-formatted-text.entry.js +2 -2
  405. package/dist/q2-tecton-elements/q2-item_3.entry.js +19 -19
  406. package/dist/q2-tecton-elements/q2-legend.entry.js +2 -2
  407. package/dist/q2-tecton-elements/q2-loc.entry.js +5 -5
  408. package/dist/q2-tecton-elements/q2-message.entry.js +21 -21
  409. package/dist/q2-tecton-elements/q2-month-picker.entry.js +14 -14
  410. package/dist/q2-tecton-elements/q2-optgroup.entry.js +8 -8
  411. package/dist/q2-tecton-elements/q2-option-list.entry.js +1 -1
  412. package/dist/q2-tecton-elements/q2-option.entry.js +14 -14
  413. package/dist/q2-tecton-elements/q2-pagination.entry.js +34 -34
  414. package/dist/q2-tecton-elements/q2-pill.entry.js +14 -14
  415. package/dist/q2-tecton-elements/q2-radio-group.entry.js +1 -1
  416. package/dist/q2-tecton-elements/q2-radio.entry.js +1 -1
  417. package/dist/q2-tecton-elements/q2-relative-time.entry.js +2 -2
  418. package/dist/q2-tecton-elements/q2-resize-observer.entry.js +1 -1
  419. package/dist/q2-tecton-elements/q2-section.entry.js +19 -19
  420. package/dist/q2-tecton-elements/q2-select.entry.js +156 -92
  421. package/dist/q2-tecton-elements/q2-select.entry.js.map +1 -1
  422. package/dist/q2-tecton-elements/q2-stepper-pane.entry.js +1 -1
  423. package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js +37 -37
  424. package/dist/q2-tecton-elements/q2-stepper.entry.js +29 -29
  425. package/dist/q2-tecton-elements/q2-tag.entry.js +25 -25
  426. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  427. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js.map +1 -1
  428. package/dist/q2-tecton-elements/q2-textarea.entry.js +4 -3
  429. package/dist/q2-tecton-elements/q2-textarea.entry.js.map +1 -1
  430. package/dist/q2-tecton-elements/q2-tooltip.entry.js +1 -1
  431. package/dist/q2-tecton-elements/tecton-tab-pane.entry.js +6 -6
  432. package/dist/types/builds/q2e/development/tecton/tecton/packages/q2-tecton-elements/.stencil/jest.setup.d.ts +1 -0
  433. package/dist/types/components/q2-btn/q2-btn.d.ts +1 -0
  434. package/dist/types/components/q2-dropdown/q2-dropdown.d.ts +1 -4
  435. package/dist/types/components/q2-editable-field/q2-editable-field.d.ts +2 -1
  436. package/dist/types/components/q2-icon/q2-icon.d.ts +1 -0
  437. package/dist/types/components/q2-popover/q2-popover.d.ts +4 -4
  438. package/dist/types/components/q2-select/q2-select.d.ts +19 -0
  439. package/package.json +3 -3
  440. package/dist/cjs/index-07285783.js.map +0 -1
  441. package/dist/esm/index-d18e2a20.js.map +0 -1
  442. package/dist/q2-tecton-elements/index-d18e2a20.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"q2-formatted-text-test.e2e.js","sourceRoot":"","sources":["../../../../src/components/q2-formatted-text/test/q2-formatted-text-test.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,SAAS,iBAAiB,CAAC,KAS1B;IACG,IAAI,SAAS,GAAW,EAAE,CAAC;IAC3B,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QACtB,SAAS,IAAI,UAAU,KAAK,CAAC,KAAK,EAAE,CAAC;IACzC,CAAC;IACD,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QACjB,SAAS,IAAI,YAAY,KAAK,CAAC,MAAM,GAAG,CAAC;IAC7C,CAAC;IACD,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QACf,SAAS,IAAI,UAAU,KAAK,CAAC,IAAI,GAAG,CAAC;IACzC,CAAC;IACD,IAAI,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;QACtB,SAAS,IAAI,kBAAkB,KAAK,CAAC,WAAW,GAAG,CAAC;IACxD,CAAC;IACD,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;QACnB,SAAS,IAAI,eAAe,KAAK,CAAC,QAAQ,GAAG,CAAC;IAClD,CAAC;IACD,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;QACnB,SAAS,IAAI,eAAe,KAAK,CAAC,QAAQ,GAAG,CAAC;IAClD,CAAC;IACD,IAAI,CAAC,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC;QAChC,SAAS,IAA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AK,IAAI,EAAE;oBACvC,IAAI,GAAG,MAAM,iBAAiB,CAAC;wBAC3B,KAAK,EAAE,OAAO;wBACd,MAAM,EAAE,OAAO;qBAClB,CAAC,CAAC;oBACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;qBAO7B,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { SpecPage, newSpecPage } from '@stencil/core/testing';\nimport { setup, evaluateA11y, getListOfStyleCompilationIssues } from '@/utils/helpers';\nimport { Q2FormattedText } from '../q2-formatted-text';\n\nfunction createNewSpecPage(props: {\n value?: number;\n locale?: string;\n size?: string;\n slotSize?: string;\n signDisplay?: string;\n maximumFractionDigits?: number;\n minimumFractionDigits?: number;\n minimumIntegerDigits?: number;\n}) {\n let htmlProps: string = '';\n if (!isNaN(props.value)) {\n htmlProps += ` value=${props.value}`;\n }\n if (!!props.locale) {\n htmlProps += ` locale=\"${props.locale}\"`;\n }\n if (!!props.size) {\n htmlProps += ` size=\"${props.size}\"`;\n }\n if (!!props.signDisplay) {\n htmlProps += ` sign-display=\"${props.signDisplay}\"`;\n }\n if (!!props.slotSize) {\n htmlProps += ` slot-size=\"${props.slotSize}\"`;\n }\n if (!!props.slotSize) {\n htmlProps += ` slot-size=\"${props.slotSize}\"`;\n }\n if (!!props.maximumFractionDigits) {\n htmlProps += ` maximum-fraction-digits=\"${props.maximumFractionDigits}\"`;\n }\n if (!!props.minimumFractionDigits) {\n htmlProps += ` minimum-fraction-digits=\"${props.minimumFractionDigits}\"`;\n }\n if (!!props.minimumIntegerDigits) {\n htmlProps += ` minimum-integer-digits=\"${props.minimumIntegerDigits}\"`;\n }\n return newSpecPage({\n components: [Q2FormattedText],\n html: `<q2-formatted-text ${htmlProps}></q2-formatted-text>`,\n });\n}\n\ndescribe('q2-formatted-text', () => {\n it('properly compiles CSS vars and functions', async () => {\n const page = await setup({ html: '<q2-formatted-text></q2-formatted-text>' });\n expect(await getListOfStyleCompilationIssues(page, 'q2-formatted-text')).toHaveLength(0);\n });\n\n describe('[A11y] guideline compliance', () => {\n it('Does not have accessibility violations', async () => {\n const page = await setup({ html: `<q2-formatted-text value=\"1234.56\" />` });\n const hasViolations = await evaluateA11y(page);\n expect(hasViolations).toBe(false);\n });\n });\n\n let page: SpecPage;\n\n it('renders', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n });\n\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n\n describe('Props', () => {\n describe('value', () => {\n it('should render the value', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n });\n expect(page.root.value).toBe(1234.56);\n });\n it('should accept negative numbers', async () => {\n page = await createNewSpecPage({\n value: -1234.56,\n locale: 'en-US',\n });\n expect(page.root.value).toBe(-1234.56);\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"-1234.56\" locale=\"en-US\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"-1,234.56\" class=\"formatted-text\">\n <span>-1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n });\n describe('locale', () => {\n it('renders according to the locale', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'es-MX',\n });\n expect(page.root.locale).toBe('es-MX');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"es-MX\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n it('renders according to the locale', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'pt-BR',\n });\n expect(page.root.locale).toBe('pt-BR');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"pt-BR\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1.234,56\" class=\"formatted-text\">\n <span>1.234,56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n });\n\n describe('digits and fractions', () => {\n it('renders with maximumFractionDigits', async () => {\n page = await createNewSpecPage({\n value: 1234.56789,\n maximumFractionDigits: 3,\n });\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56789\" locale=\"en-US\" maximum-fraction-digits=\"3\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.568\" class=\"formatted-text\">\n <span>1,234.568</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n\n it('renders with minimumFractionDigits', async () => {\n page = await createNewSpecPage({\n value: 1234,\n minimumFractionDigits: 1,\n });\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234\" locale=\"en-US\" minimum-fraction-digits=\"1\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.0\" class=\"formatted-text\">\n <span>1,234.0</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n\n it('renders with minimumIntegerDigits', async () => {\n page = await createNewSpecPage({\n value: 1234.5678,\n minimumIntegerDigits: 6,\n maximumFractionDigits: 3,\n });\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.5678\" locale=\"en-US\" minimum-integer-digits=\"6\" maximum-fraction-digits=\"3\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"001,234.568\" class=\"formatted-text\">\n <span>001,234.568</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n });\n\n describe('size', () => {\n it('renders small', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n size: 'small',\n });\n expect(page.root.size).toBe('small');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" size=\"small\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text formatted-text-small\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n\n it('renders medium', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n size: 'medium',\n });\n expect(page.root.size).toBe('medium');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" size=\"medium\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text formatted-text-medium\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n\n it('renders large', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n size: 'large',\n });\n expect(page.root.size).toBe('large');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" size=\"large\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text formatted-text-large\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n });\n\n describe('signDisplay', () => {\n describe('when currency value is negative', () => {\n it('renders a negative sign on auto', async () => {\n page = await createNewSpecPage({\n value: -1234.56,\n locale: 'en-US',\n });\n expect(page.root.signDisplay).toBe('auto');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"-1234.56\" locale=\"en-US\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"-1,234.56\" class=\"formatted-text\">\n <span>-1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n it('renders a negative sign on always', async () => {\n page = await createNewSpecPage({\n value: -1234.56,\n locale: 'en-US',\n signDisplay: 'always',\n });\n expect(page.root.signDisplay).toBe('always');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"-1234.56\" locale=\"en-US\" sign-display=\"always\">\n <mock:shadow-root>\n <div aria-label=\"-1,234.56\" class=\"formatted-text\">\n <span>-1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n it('renders only when value is not zero on exceptZero', async () => {\n page = await createNewSpecPage({\n value: -0.0,\n locale: 'en-US',\n signDisplay: 'exceptZero',\n });\n expect(page.root.signDisplay).toBe('exceptZero');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"0\" locale=\"en-US\" sign-display=\"exceptZero\">\n <mock:shadow-root>\n <div aria-label=\"0.00\" class=\"formatted-text\">\n <span>0.00</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n\n page = await createNewSpecPage({\n value: -1234.56,\n locale: 'en-US',\n signDisplay: 'exceptZero',\n });\n expect(page.root.signDisplay).toBe('exceptZero');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"-1234.56\" locale=\"en-US\" sign-display=\"exceptZero\">\n <mock:shadow-root>\n <div aria-label=\"-1,234.56\" class=\"formatted-text\">\n <span>-1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n it('does not render when set to never', async () => {\n page = await createNewSpecPage({\n value: -1234.56,\n locale: 'en-US',\n signDisplay: 'never',\n });\n expect(page.root.signDisplay).toBe('never');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"-1234.56\" locale=\"en-US\" sign-display=\"never\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n });\n describe('when currency value is positive', () => {\n it('does not display positive sign on auto', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n });\n expect(page.root.signDisplay).toBe('auto');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n it('displays the positive sign on always', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n signDisplay: 'always',\n });\n expect(page.root.signDisplay).toBe('always');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" sign-display=\"always\">\n <mock:shadow-root>\n <div aria-label=\"+1,234.56\" class=\"formatted-text\">\n <span>+1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n it('renders sign only when value is not zero on exceptZero', async () => {\n page = await createNewSpecPage({\n value: 0,\n locale: 'en-US',\n signDisplay: 'exceptZero',\n });\n expect(page.root.signDisplay).toBe('exceptZero');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"0\" locale=\"en-US\" sign-display=\"exceptZero\">\n <mock:shadow-root>\n <div aria-label=\"0.00\" class=\"formatted-text\">\n <span>0.00</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n signDisplay: 'exceptZero',\n });\n expect(page.root.signDisplay).toBe('exceptZero');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" sign-display=\"exceptZero\">\n <mock:shadow-root>\n <div aria-label=\"+1,234.56\" class=\"formatted-text\">\n <span>+1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n it('does not render when set to never', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n signDisplay: 'never',\n });\n expect(page.root.signDisplay).toBe('never');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" sign-display=\"never\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n });\n });\n\n describe('slotSize', () => {\n describe('when provided', () => {\n it('applies size class to currency', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n slotSize: 'medium',\n });\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" slot-size=\"medium\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text formatted-text-medium\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n it('does NOT apply if the size property is already provided', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n size: 'large',\n slotSize: 'small',\n });\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" size=\"large\" slot-size=\"small\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text formatted-text-large\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n });\n describe('when not provided', () => {\n it('does NOT apply size class', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n });\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n });\n });\n });\n});\n"]}
1
+ {"version":3,"file":"q2-formatted-text-test.e2e.js","sourceRoot":"","sources":["../../../../../src/components/q2-formatted-text/test/q2-formatted-text-test.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,SAAS,iBAAiB,CAAC,KAS1B;IACG,IAAI,SAAS,GAAW,EAAE,CAAC;IAC3B,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,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CAAC,eAAe,EAAE,GAAG,EAAE;gBAC3B,EAAE,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;oBAC5C,IAAI,GAAG,MAAM,iBAAiB,CAAC;wBAC3B,KAAK,EAAE,OAAO;wBACd,MAAM,EAAE,OAAO;wBACf,QAAQ,EAAE,QAAQ;qBACrB,CAAC,CAAC;oBACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;qBAO7B,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;gBACH,EAAE,CAAC,yDAAyD,EAAE,KAAK,IAAI,EAAE;oBACrE,IAAI,GAAG,MAAM,iBAAiB,CAAC;wBAC3B,KAAK,EAAE,OAAO;wBACd,MAAM,EAAE,OAAO;wBACf,IAAI,EAAE,OAAO;wBACb,QAAQ,EAAE,OAAO;qBACpB,CAAC,CAAC;oBACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;qBAO7B,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;YACH,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;gBAC/B,EAAE,CAAC,2BAA2B,EAAE,KAAK,IAAI,EAAE;oBACvC,IAAI,GAAG,MAAM,iBAAiB,CAAC;wBAC3B,KAAK,EAAE,OAAO;wBACd,MAAM,EAAE,OAAO;qBAClB,CAAC,CAAC;oBACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;qBAO7B,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { SpecPage, newSpecPage } from '@stencil/core/testing';\nimport { setup, evaluateA11y, getListOfStyleCompilationIssues } from '@/utils/helpers';\nimport { Q2FormattedText } from '../q2-formatted-text';\n\nfunction createNewSpecPage(props: {\n value?: number;\n locale?: string;\n size?: string;\n slotSize?: string;\n signDisplay?: string;\n maximumFractionDigits?: number;\n minimumFractionDigits?: number;\n minimumIntegerDigits?: number;\n}) {\n let htmlProps: string = '';\n if (!isNaN(props.value)) {\n htmlProps += ` value=${props.value}`;\n }\n if (!!props.locale) {\n htmlProps += ` locale=\"${props.locale}\"`;\n }\n if (!!props.size) {\n htmlProps += ` size=\"${props.size}\"`;\n }\n if (!!props.signDisplay) {\n htmlProps += ` sign-display=\"${props.signDisplay}\"`;\n }\n if (!!props.slotSize) {\n htmlProps += ` slot-size=\"${props.slotSize}\"`;\n }\n if (!!props.slotSize) {\n htmlProps += ` slot-size=\"${props.slotSize}\"`;\n }\n if (!!props.maximumFractionDigits) {\n htmlProps += ` maximum-fraction-digits=\"${props.maximumFractionDigits}\"`;\n }\n if (!!props.minimumFractionDigits) {\n htmlProps += ` minimum-fraction-digits=\"${props.minimumFractionDigits}\"`;\n }\n if (!!props.minimumIntegerDigits) {\n htmlProps += ` minimum-integer-digits=\"${props.minimumIntegerDigits}\"`;\n }\n return newSpecPage({\n components: [Q2FormattedText],\n html: `<q2-formatted-text ${htmlProps}></q2-formatted-text>`,\n });\n}\n\ndescribe('q2-formatted-text', () => {\n it('properly compiles CSS vars and functions', async () => {\n const page = await setup({ html: '<q2-formatted-text></q2-formatted-text>' });\n expect(await getListOfStyleCompilationIssues(page, 'q2-formatted-text')).toHaveLength(0);\n });\n\n describe('[A11y] guideline compliance', () => {\n it('Does not have accessibility violations', async () => {\n const page = await setup({ html: `<q2-formatted-text value=\"1234.56\" />` });\n const hasViolations = await evaluateA11y(page);\n expect(hasViolations).toBe(false);\n });\n });\n\n let page: SpecPage;\n\n it('renders', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n });\n\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n\n describe('Props', () => {\n describe('value', () => {\n it('should render the value', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n });\n expect(page.root.value).toBe(1234.56);\n });\n it('should accept negative numbers', async () => {\n page = await createNewSpecPage({\n value: -1234.56,\n locale: 'en-US',\n });\n expect(page.root.value).toBe(-1234.56);\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"-1234.56\" locale=\"en-US\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"-1,234.56\" class=\"formatted-text\">\n <span>-1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n });\n describe('locale', () => {\n it('renders according to the locale', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'es-MX',\n });\n expect(page.root.locale).toBe('es-MX');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"es-MX\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n it('renders according to the locale', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'pt-BR',\n });\n expect(page.root.locale).toBe('pt-BR');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"pt-BR\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1.234,56\" class=\"formatted-text\">\n <span>1.234,56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n });\n\n describe('digits and fractions', () => {\n it('renders with maximumFractionDigits', async () => {\n page = await createNewSpecPage({\n value: 1234.56789,\n maximumFractionDigits: 3,\n });\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56789\" locale=\"en-US\" maximum-fraction-digits=\"3\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.568\" class=\"formatted-text\">\n <span>1,234.568</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n\n it('renders with minimumFractionDigits', async () => {\n page = await createNewSpecPage({\n value: 1234,\n minimumFractionDigits: 1,\n });\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234\" locale=\"en-US\" minimum-fraction-digits=\"1\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.0\" class=\"formatted-text\">\n <span>1,234.0</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n\n it('renders with minimumIntegerDigits', async () => {\n page = await createNewSpecPage({\n value: 1234.5678,\n minimumIntegerDigits: 6,\n maximumFractionDigits: 3,\n });\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.5678\" locale=\"en-US\" minimum-integer-digits=\"6\" maximum-fraction-digits=\"3\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"001,234.568\" class=\"formatted-text\">\n <span>001,234.568</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n });\n\n describe('size', () => {\n it('renders small', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n size: 'small',\n });\n expect(page.root.size).toBe('small');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" size=\"small\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text formatted-text-small\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n\n it('renders medium', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n size: 'medium',\n });\n expect(page.root.size).toBe('medium');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" size=\"medium\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text formatted-text-medium\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n\n it('renders large', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n size: 'large',\n });\n expect(page.root.size).toBe('large');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" size=\"large\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text formatted-text-large\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n });\n\n describe('signDisplay', () => {\n describe('when currency value is negative', () => {\n it('renders a negative sign on auto', async () => {\n page = await createNewSpecPage({\n value: -1234.56,\n locale: 'en-US',\n });\n expect(page.root.signDisplay).toBe('auto');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"-1234.56\" locale=\"en-US\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"-1,234.56\" class=\"formatted-text\">\n <span>-1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n it('renders a negative sign on always', async () => {\n page = await createNewSpecPage({\n value: -1234.56,\n locale: 'en-US',\n signDisplay: 'always',\n });\n expect(page.root.signDisplay).toBe('always');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"-1234.56\" locale=\"en-US\" sign-display=\"always\">\n <mock:shadow-root>\n <div aria-label=\"-1,234.56\" class=\"formatted-text\">\n <span>-1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n it('renders only when value is not zero on exceptZero', async () => {\n page = await createNewSpecPage({\n value: -0.0,\n locale: 'en-US',\n signDisplay: 'exceptZero',\n });\n expect(page.root.signDisplay).toBe('exceptZero');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"0\" locale=\"en-US\" sign-display=\"exceptZero\">\n <mock:shadow-root>\n <div aria-label=\"0.00\" class=\"formatted-text\">\n <span>0.00</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n\n page = await createNewSpecPage({\n value: -1234.56,\n locale: 'en-US',\n signDisplay: 'exceptZero',\n });\n expect(page.root.signDisplay).toBe('exceptZero');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"-1234.56\" locale=\"en-US\" sign-display=\"exceptZero\">\n <mock:shadow-root>\n <div aria-label=\"-1,234.56\" class=\"formatted-text\">\n <span>-1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n it('does not render when set to never', async () => {\n page = await createNewSpecPage({\n value: -1234.56,\n locale: 'en-US',\n signDisplay: 'never',\n });\n expect(page.root.signDisplay).toBe('never');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"-1234.56\" locale=\"en-US\" sign-display=\"never\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n });\n describe('when currency value is positive', () => {\n it('does not display positive sign on auto', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n });\n expect(page.root.signDisplay).toBe('auto');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n it('displays the positive sign on always', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n signDisplay: 'always',\n });\n expect(page.root.signDisplay).toBe('always');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" sign-display=\"always\">\n <mock:shadow-root>\n <div aria-label=\"+1,234.56\" class=\"formatted-text\">\n <span>+1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n it('renders sign only when value is not zero on exceptZero', async () => {\n page = await createNewSpecPage({\n value: 0,\n locale: 'en-US',\n signDisplay: 'exceptZero',\n });\n expect(page.root.signDisplay).toBe('exceptZero');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"0\" locale=\"en-US\" sign-display=\"exceptZero\">\n <mock:shadow-root>\n <div aria-label=\"0.00\" class=\"formatted-text\">\n <span>0.00</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n signDisplay: 'exceptZero',\n });\n expect(page.root.signDisplay).toBe('exceptZero');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" sign-display=\"exceptZero\">\n <mock:shadow-root>\n <div aria-label=\"+1,234.56\" class=\"formatted-text\">\n <span>+1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n it('does not render when set to never', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n signDisplay: 'never',\n });\n expect(page.root.signDisplay).toBe('never');\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" sign-display=\"never\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n });\n });\n\n describe('slotSize', () => {\n describe('when provided', () => {\n it('applies size class to currency', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n slotSize: 'medium',\n });\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" slot-size=\"medium\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text formatted-text-medium\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n it('does NOT apply if the size property is already provided', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n size: 'large',\n slotSize: 'small',\n });\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" size=\"large\" slot-size=\"small\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text formatted-text-large\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n });\n describe('when not provided', () => {\n it('does NOT apply size class', async () => {\n page = await createNewSpecPage({\n value: 1234.56,\n locale: 'en-US',\n });\n expect(page.root).toEqualHtml(`\n <q2-formatted-text value=\"1234.56\" locale=\"en-US\" sign-display=\"auto\">\n <mock:shadow-root>\n <div aria-label=\"1,234.56\" class=\"formatted-text\">\n <span>1,234.56</span>\n </mock:shadow-root>\n </q2-formatted-text>\n `);\n });\n });\n });\n });\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"q2-icon-types.js","sourceRoot":"","sources":["../../../src/components/q2-icon/q2-icon-types.ts"],"names":[],"mappings":"","sourcesContent":["import { IDict } from '../../util';\nimport { JSX } from '../../components';\n\nexport interface Q2Icon {\n markup: () => JSX.IntrinsicElements;\n}\n\nexport type Q2Icons = IDict<Q2Icon>;\n"]}
1
+ {"version":3,"file":"q2-icon-types.js","sourceRoot":"","sources":["../../../../src/components/q2-icon/q2-icon-types.ts"],"names":[],"mappings":"","sourcesContent":["import { IDict } from '../../util';\nimport { JSX } from '../../components';\n\nexport interface Q2Icon {\n markup: () => JSX.IntrinsicElements;\n}\n\nexport type Q2Icons = IDict<Q2Icon>;\n"]}
@@ -22,6 +22,10 @@ export class Q2Icon {
22
22
  // We have to set the `href` attribute after the symbol is appended to the DOM to avoid a bug in Safari
23
23
  (_d = this.spriteUse) === null || _d === void 0 ? void 0 : _d.setAttribute('href', `#${appendedClone.id}`);
24
24
  }
25
+ disconnectedCallback() {
26
+ this.spriteGroup = null;
27
+ this.spriteUse = null;
28
+ }
25
29
  // #endregion
26
30
  // #region Watchers
27
31
  handleIcon() {
@@ -1 +1 @@
1
- {"version":3,"file":"q2-icon.js","sourceRoot":"","sources":["../../../src/components/q2-icon/q2-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAsB,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,E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AAG,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,GAAM,CACzC,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGJ","sourcesContent":["import { Component, ComponentInterface, Prop, h, Element, Watch, getAssetPath, State } from '@stencil/core';\nimport { createGuid } from 'src/utils';\nimport iconMap from './assets/icon-map.json';\n\n@Component({ tag: 'q2-icon', shadow: true, styleUrl: 'q2-icon.scss', assetsDirs: ['assets'] })\nexport class Q2Icon implements ComponentInterface {\n // #region Own Properties\n\n spriteGroup: SVGElement;\n spriteUse: SVGElement;\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 iconClone: SVGSymbolElement;\n\n // #endregion\n // #region Public Property API\n\n /** Styles the component to have a `height` and `width` of `1em`, making it easy to place alongside text. */\n @Prop({ reflect: true })\n inline: boolean;\n\n /** The text that is presented by screen-readers when they encounter the icon. */\n @Prop({ reflect: true })\n label: string;\n\n /** The name of the icon to be displayed. */\n @Prop({ reflect: true })\n type: string;\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentWillLoad() {\n this.handleIcon();\n }\n\n componentDidRender(): void {\n if (!this.iconClone) return;\n this.spriteGroup?.firstElementChild?.remove();\n const appendedClone = this.spriteGroup?.appendChild(this.iconClone);\n\n // We have to set the `href` attribute after the symbol is appended to the DOM to avoid a bug in Safari\n this.spriteUse?.setAttribute('href', `#${appendedClone.id}`);\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('type')\n handleIcon() {\n if (this.isCustom) {\n this.setCustomSVGAttrs();\n } else if (this.type) {\n this.fetchSprite();\n } else {\n this.iconClone = null;\n this.spriteGroup?.firstElementChild?.remove();\n }\n }\n\n // #endregion\n // #region Local Methods\n\n get iconCloneViewBox() {\n return this.iconClone?.getAttribute('viewBox') ?? '0 0 24 24';\n }\n\n get isCustom() {\n return this.type === 'custom';\n }\n\n get spriteElement() {\n const { spriteId } = this;\n if (!spriteId) return;\n return document.querySelector<HTMLElement>(`#${spriteId}`);\n }\n\n get spriteEventName() {\n const { spriteFileName } = this;\n if (!spriteFileName) return;\n return `tct-loaded-${spriteFileName}`;\n }\n\n get spriteFileName() {\n if (this.isCustom) return;\n return iconMap[this.type];\n }\n\n get spriteId() {\n const { spriteFileName } = this;\n if (!spriteFileName) return;\n return `tecton-sprite-${spriteFileName}`;\n }\n\n checkForSprite() {\n const { spriteId, spriteEventName } = this;\n const spriteContainer = this.getOrCreateSpriteContainer();\n let spriteElement: HTMLElement = document.querySelector(`#${spriteId}`);\n\n // If the sprite element exists and has the `data-loaded` attribute, we know we have everything we need\n if (spriteElement?.hasAttribute('data-loaded') ?? false) {\n this.cloneSpriteNode();\n return true;\n }\n\n // If the sprite element exists but does not have the `data-loaded` attribute, we know it's being loaded\n // We'll listen for the event that will be dispatched when the sprite is loaded\n spriteContainer.addEventListener(\n spriteEventName,\n () => {\n this.cloneSpriteNode();\n },\n { once: true }\n );\n\n // If the sprite element exists, we know it's being loaded and will be handled by the event listener\n if (spriteElement) return true;\n\n // If sprite element does not exist, create a placeholder\n // This will let other icons know the sprite is being loaded\n spriteElement = document.createElement('div');\n spriteElement.id = spriteId;\n spriteContainer.appendChild(spriteElement);\n return false;\n }\n\n cloneSpriteNode() {\n const spriteContainer = this.getOrCreateSpriteContainer();\n const spriteNode = spriteContainer.querySelector<HTMLElement>(`#tct-${this.type}`);\n this.iconClone = spriteNode ? (spriteNode.cloneNode(true) as SVGSymbolElement) : undefined;\n }\n\n async fetchSprite() {\n const { spriteFileName, spriteId, spriteEventName } = this;\n\n const spriteExists = this.checkForSprite();\n if (spriteExists) return;\n\n if (!spriteFileName) return;\n const spritePath = getAssetPath(`assets/${spriteFileName}.symbol.svg`);\n const response = await fetch(spritePath);\n const data = await response.text();\n const wrappingDiv = document.createElement('div');\n wrappingDiv.innerHTML = data;\n const svg = wrappingDiv.querySelector('svg');\n\n svg.id = spriteId;\n svg.setAttribute('data-loaded', '');\n\n let { spriteElement } = this;\n if (spriteElement?.tagName === 'SVG') return;\n\n if (typeof spriteElement.replaceWith === 'function') {\n spriteElement.replaceWith(svg);\n } else {\n spriteElement.parentNode.replaceChild(svg, spriteElement);\n }\n\n spriteElement = document.querySelector(`#${spriteId}`);\n spriteElement.dispatchEvent(new CustomEvent(spriteEventName, { bubbles: true }));\n }\n\n /**\n * Checks for the sprite container element in the global DOM\n * If it does not exist, it creates and appends it to the body\n */\n getOrCreateSpriteContainer() {\n const spriteContainerId = 'tecton-sprites';\n let spriteContainer: HTMLDivElement = document.querySelector(`#${spriteContainerId}`);\n\n if (spriteContainer) return spriteContainer;\n spriteContainer = document.createElement('div');\n spriteContainer.id = spriteContainerId;\n spriteContainer.style.display = 'none';\n document.body.appendChild(spriteContainer);\n return spriteContainer;\n }\n\n setCustomSVGAttrs() {\n const innerSVG = this.hostElement.querySelector('svg');\n\n if (!innerSVG) return;\n\n innerSVG.setAttribute('role', 'img');\n innerSVG.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n\n const { label } = this;\n if (label) {\n const title = document.createElement('title');\n const labelId = `label-${createGuid()}`;\n title.id = labelId;\n title.textContent = label;\n innerSVG.appendChild(title);\n innerSVG.setAttribute('aria-labelledby', labelId);\n } else {\n innerSVG.setAttribute('aria-hidden', 'true');\n }\n }\n\n // #endregion\n // #region Render Methods\n\n render() {\n const { label, type } = this;\n return this.isCustom ? (\n <slot />\n ) : (\n <svg\n aria-hidden={!!label ? undefined : 'true'}\n role={!!label ? 'img' : undefined}\n aria-labelledby={!!label ? 'label' : undefined}\n viewBox={this.iconCloneViewBox}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n {!!label && <title id=\"label\">{label}</title>}\n {!!type && <use ref={el => (this.spriteUse = el)} />}\n <g ref={el => (this.spriteGroup = el)}></g>\n </svg>\n );\n }\n\n // #endregion\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AAS,EAC9C,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAC9B,KAAK,EAAC,4BAA4B;YAEjC,CAAC,CAAC,KAAK,IAAI,aAAO,EAAE,EAAC,OAAO,IAAE,KAAK,CAAS;YAC5C,CAAC,CAAC,IAAI,IAAI,WAAK,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC,GAAI;YACpD,SAAG,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,GAAM,CACzC,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGJ","sourcesContent":["import { Component, ComponentInterface, Prop, h, Element, Watch, getAssetPath, State } from '@stencil/core';\nimport { createGuid } from 'src/utils';\nimport iconMap from './assets/icon-map.json';\n\n@Component({ tag: 'q2-icon', shadow: true, styleUrl: 'q2-icon.scss', assetsDirs: ['assets'] })\nexport class Q2Icon implements ComponentInterface {\n // #region Own Properties\n\n spriteGroup: SVGElement;\n spriteUse: SVGElement;\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 iconClone: SVGSymbolElement;\n\n // #endregion\n // #region Public Property API\n\n /** Styles the component to have a `height` and `width` of `1em`, making it easy to place alongside text. */\n @Prop({ reflect: true })\n inline: boolean;\n\n /** The text that is presented by screen-readers when they encounter the icon. */\n @Prop({ reflect: true })\n label: string;\n\n /** The name of the icon to be displayed. */\n @Prop({ reflect: true })\n type: string;\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentWillLoad() {\n this.handleIcon();\n }\n\n componentDidRender(): void {\n if (!this.iconClone) return;\n this.spriteGroup?.firstElementChild?.remove();\n const appendedClone = this.spriteGroup?.appendChild(this.iconClone);\n\n // We have to set the `href` attribute after the symbol is appended to the DOM to avoid a bug in Safari\n this.spriteUse?.setAttribute('href', `#${appendedClone.id}`);\n }\n\n disconnectedCallback(): void {\n this.spriteGroup = null;\n this.spriteUse = null;\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('type')\n handleIcon() {\n if (this.isCustom) {\n this.setCustomSVGAttrs();\n } else if (this.type) {\n this.fetchSprite();\n } else {\n this.iconClone = null;\n this.spriteGroup?.firstElementChild?.remove();\n }\n }\n\n // #endregion\n // #region Local Methods\n\n get iconCloneViewBox() {\n return this.iconClone?.getAttribute('viewBox') ?? '0 0 24 24';\n }\n\n get isCustom() {\n return this.type === 'custom';\n }\n\n get spriteElement() {\n const { spriteId } = this;\n if (!spriteId) return;\n return document.querySelector<HTMLElement>(`#${spriteId}`);\n }\n\n get spriteEventName() {\n const { spriteFileName } = this;\n if (!spriteFileName) return;\n return `tct-loaded-${spriteFileName}`;\n }\n\n get spriteFileName() {\n if (this.isCustom) return;\n return iconMap[this.type];\n }\n\n get spriteId() {\n const { spriteFileName } = this;\n if (!spriteFileName) return;\n return `tecton-sprite-${spriteFileName}`;\n }\n\n checkForSprite() {\n const { spriteId, spriteEventName } = this;\n const spriteContainer = this.getOrCreateSpriteContainer();\n let spriteElement: HTMLElement = document.querySelector(`#${spriteId}`);\n\n // If the sprite element exists and has the `data-loaded` attribute, we know we have everything we need\n if (spriteElement?.hasAttribute('data-loaded') ?? false) {\n this.cloneSpriteNode();\n return true;\n }\n\n // If the sprite element exists but does not have the `data-loaded` attribute, we know it's being loaded\n // We'll listen for the event that will be dispatched when the sprite is loaded\n spriteContainer.addEventListener(\n spriteEventName,\n () => {\n this.cloneSpriteNode();\n },\n { once: true }\n );\n\n // If the sprite element exists, we know it's being loaded and will be handled by the event listener\n if (spriteElement) return true;\n\n // If sprite element does not exist, create a placeholder\n // This will let other icons know the sprite is being loaded\n spriteElement = document.createElement('div');\n spriteElement.id = spriteId;\n spriteContainer.appendChild(spriteElement);\n return false;\n }\n\n cloneSpriteNode() {\n const spriteContainer = this.getOrCreateSpriteContainer();\n const spriteNode = spriteContainer.querySelector<HTMLElement>(`#tct-${this.type}`);\n this.iconClone = spriteNode ? (spriteNode.cloneNode(true) as SVGSymbolElement) : undefined;\n }\n\n async fetchSprite() {\n const { spriteFileName, spriteId, spriteEventName } = this;\n\n const spriteExists = this.checkForSprite();\n if (spriteExists) return;\n\n if (!spriteFileName) return;\n const spritePath = getAssetPath(`assets/${spriteFileName}.symbol.svg`);\n const response = await fetch(spritePath);\n const data = await response.text();\n const wrappingDiv = document.createElement('div');\n wrappingDiv.innerHTML = data;\n const svg = wrappingDiv.querySelector('svg');\n\n svg.id = spriteId;\n svg.setAttribute('data-loaded', '');\n\n let { spriteElement } = this;\n if (spriteElement?.tagName === 'SVG') return;\n\n if (typeof spriteElement.replaceWith === 'function') {\n spriteElement.replaceWith(svg);\n } else {\n spriteElement.parentNode.replaceChild(svg, spriteElement);\n }\n\n spriteElement = document.querySelector(`#${spriteId}`);\n spriteElement.dispatchEvent(new CustomEvent(spriteEventName, { bubbles: true }));\n }\n\n /**\n * Checks for the sprite container element in the global DOM\n * If it does not exist, it creates and appends it to the body\n */\n getOrCreateSpriteContainer() {\n const spriteContainerId = 'tecton-sprites';\n let spriteContainer: HTMLDivElement = document.querySelector(`#${spriteContainerId}`);\n\n if (spriteContainer) return spriteContainer;\n spriteContainer = document.createElement('div');\n spriteContainer.id = spriteContainerId;\n spriteContainer.style.display = 'none';\n document.body.appendChild(spriteContainer);\n return spriteContainer;\n }\n\n setCustomSVGAttrs() {\n const innerSVG = this.hostElement.querySelector('svg');\n\n if (!innerSVG) return;\n\n innerSVG.setAttribute('role', 'img');\n innerSVG.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n\n const { label } = this;\n if (label) {\n const title = document.createElement('title');\n const labelId = `label-${createGuid()}`;\n title.id = labelId;\n title.textContent = label;\n innerSVG.appendChild(title);\n innerSVG.setAttribute('aria-labelledby', labelId);\n } else {\n innerSVG.setAttribute('aria-hidden', 'true');\n }\n }\n\n // #endregion\n // #region Render Methods\n\n render() {\n const { label, type } = this;\n return this.isCustom ? (\n <slot />\n ) : (\n <svg\n aria-hidden={!!label ? undefined : 'true'}\n role={!!label ? 'img' : undefined}\n aria-labelledby={!!label ? 'label' : undefined}\n viewBox={this.iconCloneViewBox}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n {!!label && <title id=\"label\">{label}</title>}\n {!!type && <use ref={el => (this.spriteUse = el)} />}\n <g ref={el => (this.spriteGroup = el)}></g>\n </svg>\n );\n }\n\n // #endregion\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"q2-icon-test.e2e.js","sourceRoot":"","sources":["../../../../src/components/q2-icon/test/q2-icon-test.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,WAAW,EAAY,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,+BAA+B,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACtG,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACrB,IAAI,OAAgB,CAAC;IACrB,IAAI,QAAkB,CAAC;IAEvB,EAAE,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;QACtD,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC,CAAC;QAC1D,MAAM,CAAC,MAAM,+BAA+B,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IACnF,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;QACxB,IAAI,sBAAgC,CAAC;QACrC,IAAI,oBAA8B,CAAC;QAEnC,UAAU,CAAC,KAAK,IAAI,EAAE;YAClB,OAAO,GAAG,MAAM,KAAK,CAAC;gBAClB,IAAI,EAAE,EAAE;aACX,CAAC,CAAC;YACH,OAAO,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AC;QACzC,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACxC,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG;;;;;;;;;CAS1B,CAAC;AAEF,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;CAevB,CAAC;AAEF,MAAM,eAAe,GAAG;;;;;;;;CAQvB,CAAC","sourcesContent":["import { E2EPage, EventSpy, newSpecPage, SpecPage } from '@stencil/core/testing';\nimport { evaluateA11y, getListOfStyleCompilationIssues, mockIconFetch, setup } from '@/utils/helpers';\nimport { Q2Icon } from '../q2-icon';\n\ndescribe('q2-icon', () => {\n let e2ePage: E2EPage;\n let specPage: SpecPage;\n\n it('properly compiles CSS vars and functions', async () => {\n const page = await setup({ html: '<q2-icon></q2-icon>' });\n expect(await getListOfStyleCompilationIssues(page, 'q2-icon')).toHaveLength(0);\n });\n\n describe('SVG Sprite', () => {\n let standardLoadedEventSpy: EventSpy;\n let statusLoadedEventSpy: EventSpy;\n\n beforeEach(async () => {\n e2ePage = await setup({\n html: '',\n });\n e2ePage.setDefaultTimeout(5000);\n e2ePage.setContent(`<q2-icon type=\"close\"></q2-icon>`);\n standardLoadedEventSpy = await e2ePage.spyOnEvent('tct-loaded-standard');\n statusLoadedEventSpy = await e2ePage.spyOnEvent('tct-loaded-status');\n await e2ePage.waitForSelector('#tecton-sprites');\n await e2ePage.waitForSelector('#tecton-sprite-standard');\n await e2ePage.waitForChanges();\n });\n\n it('creates the sprite container', async () => {\n const spriteContainers = await e2ePage.findAll('#tecton-sprites');\n expect(spriteContainers).toHaveLength(1);\n\n const spriteContainer = spriteContainers[0];\n expect(spriteContainer).toBeTruthy();\n expect((await spriteContainer.getComputedStyle()).display).toEqual('none');\n });\n\n it('adds the sprite', async () => {\n const spriteElements = await e2ePage.findAll('#tecton-sprites > svg');\n expect(spriteElements).toHaveLength(1);\n\n const spriteElement = spriteElements[0];\n expect(spriteElement).toBeTruthy();\n expect(spriteElement).toEqualAttribute('id', 'tecton-sprite-standard');\n expect(spriteElement).toHaveAttribute('data-loaded');\n });\n\n it('fires the loaded event', async () => {\n expect(standardLoadedEventSpy).toHaveReceivedEventTimes(1);\n expect(statusLoadedEventSpy).toHaveReceivedEventTimes(0);\n });\n\n it('renders the use element to the SVG', async () => {\n const useElement = await e2ePage.find('q2-icon >>> use');\n expect(useElement).toBeTruthy();\n expect(useElement).toEqualAttribute('href', '#tct-close');\n });\n\n it('renders the symbol element to the SVG', async () => {\n const symbolElements = await e2ePage.findAll('q2-icon >>> symbol');\n\n expect(symbolElements).toHaveLength(1);\n\n const symbolElement = symbolElements[0];\n expect(symbolElement).toBeTruthy();\n expect(symbolElement).toEqualAttribute('id', 'tct-close');\n expect(symbolElement).toEqualHtml(`\n <symbol fill=\"none\" id=\"tct-close\" viewbox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <g class=\"stroke-primary\">\n <path d=\"m17.875 6-12 12m0-12 12 12\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </g>\n </symbol>\n `);\n });\n\n describe('when icon is updated to one in a separate sprite', () => {\n beforeEach(async () => {\n const icon = await e2ePage.find('q2-icon');\n await icon.setProperty('type', 'success');\n await e2ePage.waitForChanges();\n await e2ePage.waitForSelector('#tecton-sprite-status');\n });\n\n it('does not create a new sprite container', async () => {\n const spriteContainers = await e2ePage.findAll('#tecton-sprites');\n expect(spriteContainers).toHaveLength(1);\n\n const spriteContainer = spriteContainers[0];\n expect(spriteContainer).toBeTruthy();\n expect((await spriteContainer.getComputedStyle()).display).toEqual('none');\n });\n\n it('adds a new sprite without removing previous one', async () => {\n const spriteElements = await e2ePage.findAll('#tecton-sprites > svg');\n expect(spriteElements).toHaveLength(2);\n\n const oldSpriteElement = spriteElements[0];\n expect(oldSpriteElement).toEqualAttribute('id', 'tecton-sprite-standard');\n\n const newSpriteElement = spriteElements[1];\n expect(newSpriteElement).toBeTruthy();\n expect(newSpriteElement).toEqualAttribute('id', 'tecton-sprite-status');\n expect(newSpriteElement).toHaveAttribute('data-loaded');\n });\n\n it('fires the loaded event', async () => {\n expect(standardLoadedEventSpy).toHaveReceivedEventTimes(1);\n expect(statusLoadedEventSpy).toHaveReceivedEventTimes(1);\n });\n\n it('renders the use element to the SVG', async () => {\n const useElement = await e2ePage.find('q2-icon >>> use');\n expect(useElement).toBeTruthy();\n expect(useElement).toEqualAttribute('href', '#tct-success');\n });\n\n it('renders the symbol element to the SVG', async () => {\n const symbolElements = await e2ePage.findAll('q2-icon >>> symbol');\n expect(symbolElements).toHaveLength(1);\n\n const symbolElement = symbolElements[0];\n expect(symbolElement).toBeTruthy();\n expect(symbolElement).toEqualAttribute('id', 'tct-success');\n expect(symbolElement).toEqualHtml(`\n <symbol fill=\"none\" id=\"tct-success\" viewbox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 21.244a9.244 9.244 0 1 0 0-18.488 9.244 9.244 0 0 0 0 18.488Z\" stroke=\"var(--comp-status-color)\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"m7.754 12.739 2.613 2.613 5.88-5.88\" stroke=\"var(--comp-status-color)\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </symbol>\n `);\n });\n });\n });\n\n describe('Props', () => {\n describe('inline', () => {\n it('uses the default width and height when false', async () => {\n e2ePage = await setup({\n html: `<q2-icon type=\"a11y\"></q2-icon>`,\n });\n const icon = await e2ePage.find('q2-icon');\n const iconComputedStyle = await icon.getComputedStyle();\n expect(iconComputedStyle.width).toEqual('24px');\n expect(iconComputedStyle.height).toEqual('24px');\n });\n\n it('sets the width and height to 1em when true', async () => {\n e2ePage = await setup({\n html: `<q2-icon type=\"a11y\" inline></q2-icon>`,\n });\n const icon = await e2ePage.find('q2-icon');\n const iconComputedStyle = await icon.getComputedStyle();\n expect(iconComputedStyle.width).toEqual('16px');\n expect(iconComputedStyle.height).toEqual('16px');\n });\n });\n\n describe('label', () => {\n beforeEach(async () => {\n mockIconFetch(`\n <symbol fill=\"none\" id=\"tct-close\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <g class=\"close\">\n <path class=\"stroke-primary\" d=\"m17.875 6-12 12m0-12 12 12\"></path>\n </g>\n </symbol>\n `);\n });\n\n afterEach(() => {\n jest.restoreAllMocks();\n });\n\n it('renders the expected output when provided', async () => {\n specPage = await newSpecPage({\n components: [Q2Icon],\n html: '<q2-icon label=\"Iron Man\" type=\"close\"></q2-icon>',\n });\n\n expect(specPage.root).toEqualHtml(`\n <q2-icon label=\"Iron Man\" type=\"close\">\n <mock:shadow-root>\n <svg aria-labelledby=\"label\" role=\"img\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <title id=\"label\">\n Iron Man\n </title>\n <use href=\"#tct-close\"></use>\n <g>\n <symbol fill=\"none\" id=\"tct-close\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <g class=\"close\">\n <path class=\"stroke-primary\" d=\"m17.875 6-12 12m0-12 12 12\"></path>\n </g>\n </symbol>\n </g>\n </svg>\n </mock:shadow-root>\n </q2-icon>\n `);\n });\n });\n\n describe('type', () => {\n beforeEach(async () => {\n mockIconFetch(`\n <symbol fill=\"none\" id=\"tct-close\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <g class=\"close\">\n <path class=\"stroke-primary\" d=\"m17.875 6-12 12m0-12 12 12\"></path>\n </g>\n </symbol>\n `);\n });\n\n afterEach(() => {\n jest.restoreAllMocks();\n });\n\n it('renders nothing when not provided', async () => {\n specPage = await newSpecPage({\n components: [Q2Icon],\n html: '<q2-icon></q2-icon>',\n });\n\n expect(specPage.root).toEqualHtml(emptyIconMarkup);\n });\n\n it('renders expected output when provided', async () => {\n specPage = await newSpecPage({\n components: [Q2Icon],\n html: '<q2-icon type=\"close\"></q2-icon>',\n });\n\n expect(specPage.root).toEqualHtml(closeIconMarkup);\n });\n\n it('clears the content when removed', async () => {\n specPage = await newSpecPage({\n components: [Q2Icon],\n html: '<q2-icon type=\"close\"></q2-icon>',\n });\n\n expect(specPage.root).toEqualHtml(closeIconMarkup);\n\n specPage.root.type = undefined;\n await specPage.waitForChanges();\n\n expect(specPage.root).toEqualHtml(emptyIconMarkup);\n });\n\n it('updates the content when added', async () => {\n specPage = await newSpecPage({\n components: [Q2Icon],\n html: '<q2-icon></q2-icon>',\n });\n\n expect(specPage.root).toEqualHtml(emptyIconMarkup);\n\n specPage.root.type = 'close';\n await specPage.waitForChanges();\n\n expect(specPage.root).toEqualHtml(closeIconMarkup);\n });\n\n it('does not add the href to the use element if the icon is not found', async () => {\n specPage = await newSpecPage({\n components: [Q2Icon],\n html: '<q2-icon type=\"not-found\"></q2-icon>',\n });\n\n expect(specPage.root).toEqualHtml(notFoundIconMarkup);\n });\n\n describe(\"when type is 'custom'\", () => {\n it('it renders in a slot and adds necessary attributes', async () => {\n specPage = await newSpecPage({\n components: [Q2Icon],\n html: `\n <q2-icon type=\"custom\">\n <svg viewBox=\"0 0 34 34\">\n <circle cx=\"17\" cy=\"17\" r=\"10\" />\n </svg>\n </q2-icon>\n `,\n });\n\n const svg = specPage.root.querySelector('svg');\n\n expect(svg).toEqualAttribute('role', 'img');\n expect(svg).toEqualAttribute('xmlns', 'http://www.w3.org/2000/svg');\n expect(svg).toEqualAttribute('aria-hidden', 'true');\n expect(svg).not.toHaveAttribute('aria-labelledby');\n\n expect(specPage.root).toEqualHtml(`\n <q2-icon type=\"custom\">\n <mock:shadow-root>\n <slot />\n </mock:shadow-root>\n <svg aria-hidden=\"true\" role=\"img\" viewBox=\"0 0 34 34\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"17\" cy=\"17\" r=\"10\" />\n </svg>\n </q2-icon>\n `);\n });\n\n it('it renders in a slot and adds necessary attributes when label is provided', async () => {\n specPage = await newSpecPage({\n components: [Q2Icon],\n html: `\n <q2-icon type=\"custom\" label=\"Iron Man\">\n <svg viewBox=\"0 0 34 34\">\n <circle cx=\"17\" cy=\"17\" r=\"10\" />\n </svg>\n </q2-icon>\n `,\n });\n\n const svg = specPage.root.querySelector('svg');\n\n expect(svg).toEqualAttribute('role', 'img');\n expect(svg).toEqualAttribute('xmlns', 'http://www.w3.org/2000/svg');\n expect(svg).not.toHaveAttribute('aria-hidden');\n expect(svg).toHaveAttribute('aria-labelledby');\n\n expect(specPage.root).toEqualHtml(`\n <q2-icon label=\"Iron Man\" type=\"custom\">\n <mock:shadow-root>\n <slot />\n </mock:shadow-root>\n <svg aria-labelledby=\"label-1000\" role=\"img\" viewBox=\"0 0 34 34\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"17\" cy=\"17\" r=\"10\" />\n <title id=\"label-1000\">\n Iron Man\n </title>\n </svg>\n </q2-icon>\n `);\n });\n });\n });\n });\n\n describe('Styling', () => {\n describe('fill', () => {\n it('uses fallback color when override not provided', async () => {\n e2ePage = await setup({\n html: `<q2-icon type=\"brand-facebook-color\"></q2-icon>`,\n });\n const pathElements = await e2ePage.findAll('q2-icon >>> path');\n const pathOneStyle = await pathElements[0].getComputedStyle();\n const pathTwoStyle = await pathElements[1].getComputedStyle();\n expect(pathOneStyle.fill).toEqual('rgb(57, 87, 154)');\n expect(pathTwoStyle.fill).toEqual('rgb(255, 255, 255)');\n });\n\n it('uses override color when provided', async () => {\n e2ePage = await setup({\n html: `<q2-icon type=\"brand-facebook-color\" style=\"--tct-icon-brand-fill-primary: blue; --tct-icon-brand-fill-secondary: red;\"></q2-icon>`,\n });\n const pathElements = await e2ePage.findAll('q2-icon >>> path');\n const pathOneStyle = await pathElements[0].getComputedStyle();\n const pathTwoStyle = await pathElements[1].getComputedStyle();\n expect(pathOneStyle.fill).toEqual('rgb(0, 0, 255)');\n expect(pathTwoStyle.fill).toEqual('rgb(255, 0, 0)');\n });\n });\n });\n\n describe('Getters', () => {\n describe('isCustom', () => {\n it(\"returns true when type is 'custom'\", () => {\n const icon = new Q2Icon();\n icon.type = 'custom';\n expect(icon.isCustom).toBeTruthy();\n });\n\n it(\"returns false when type is not 'custom'\", () => {\n const icon = new Q2Icon();\n icon.type = 'close';\n expect(icon.isCustom).toBeFalsy();\n });\n });\n\n describe('spriteFileName', () => {\n it(\"returns undefined when type is 'custom'\", () => {\n const icon = new Q2Icon();\n icon.type = 'custom';\n expect(icon.spriteFileName).toBeUndefined();\n });\n\n it('returns undefined when type does not map to a file', () => {\n const icon = new Q2Icon();\n icon.type = 'foobar';\n expect(icon.spriteFileName).toBeUndefined();\n });\n\n it(\"returns the sprite filename when type is not 'custom'\", () => {\n const icon = new Q2Icon();\n icon.type = 'close';\n expect(icon.spriteFileName).toEqual('standard');\n });\n });\n\n describe('spriteId', () => {\n it(\"returns undefined when type is 'custom'\", () => {\n const icon = new Q2Icon();\n icon.type = 'custom';\n expect(icon.spriteId).toBeUndefined();\n });\n\n it('returns undefined when spriteFileName is undefined', () => {\n const icon = new Q2Icon();\n icon.type = 'foobar';\n expect(icon.spriteId).toBeUndefined();\n });\n\n it('returns the sprite ID when spriteFileName is defined', () => {\n const icon = new Q2Icon();\n icon.type = 'close';\n expect(icon.spriteId).toEqual('tecton-sprite-standard');\n });\n });\n\n describe('spriteElement', () => {\n it('returns undefined when spriteId is undefined', () => {\n const icon = new Q2Icon();\n icon.type = 'foobar';\n expect(icon.spriteElement).toBeUndefined();\n });\n\n it('returns the sprite element when spriteId is defined', () => {\n const icon = new Q2Icon();\n icon.type = 'close';\n\n const element = document.createElement('div');\n element.id = 'tecton-sprite-standard';\n document.body.appendChild(element);\n\n expect(icon.spriteElement).toBeTruthy();\n\n element.remove();\n });\n });\n\n describe('spriteEventName', () => {\n it('returns undefined when spriteFileName is undefined', () => {\n const icon = new Q2Icon();\n icon.type = 'foobar';\n expect(icon.spriteEventName).toBeUndefined();\n });\n\n it('returns the event name when spriteFileName is defined', () => {\n const icon = new Q2Icon();\n icon.type = 'close';\n expect(icon.spriteEventName).toEqual('tct-loaded-standard');\n });\n });\n });\n\n describe('Methods', () => {\n describe('getOrCreateSpriteContainer', () => {\n it('returns the existing sprite container', () => {\n const icon = new Q2Icon();\n const spriteContainer = document.createElement('div');\n spriteContainer.id = 'tecton-sprites';\n document.body.appendChild(spriteContainer);\n\n expect(icon.getOrCreateSpriteContainer()).toEqual(spriteContainer);\n\n spriteContainer.remove();\n });\n\n it('creates and returns a new sprite container', () => {\n const icon = new Q2Icon();\n const spriteContainer = icon.getOrCreateSpriteContainer();\n\n expect(spriteContainer).toBeTruthy();\n expect(spriteContainer).toEqualAttribute('id', 'tecton-sprites');\n });\n });\n\n describe('fetchSprite', () => {\n beforeEach(async () => {\n mockIconFetch();\n });\n\n afterEach(() => {\n jest.restoreAllMocks();\n });\n\n it('does nothing when type is not defined', async () => {\n const icon = new Q2Icon();\n icon.fetchSprite();\n expect(icon.spriteElement).toBeUndefined();\n });\n\n it('does not try to recreate sprite element if it already exists', async () => {\n const icon = new Q2Icon();\n icon.type = 'close';\n\n const container = icon.getOrCreateSpriteContainer();\n const spriteElement = document.createElement('SVG');\n spriteElement.id = 'tecton-sprite-standard';\n spriteElement.setAttribute('data-loaded', '');\n container.appendChild(spriteElement);\n\n expect(icon.spriteElement).toEqual(spriteElement);\n\n await icon.fetchSprite();\n\n expect(icon.spriteElement).toEqual(spriteElement);\n\n spriteElement.remove();\n });\n\n it('fetches the sprite when type is defined', async () => {\n const icon = new Q2Icon();\n icon.type = 'close';\n\n await icon.fetchSprite();\n\n expect(icon.spriteElement.tagName.toUpperCase()).toEqual('SVG');\n });\n });\n\n describe('cloneSpriteNode', () => {\n it('returns undefined when spriteElement is undefined', () => {\n const icon = new Q2Icon();\n icon.type = 'foobar';\n icon.cloneSpriteNode();\n expect(icon.iconClone).toBeUndefined();\n });\n\n it('returns a clone of the sprite element', () => {\n const icon = new Q2Icon();\n icon.type = 'close';\n\n const container = icon.getOrCreateSpriteContainer();\n\n const element = document.createElement('div');\n element.id = 'tct-close';\n container.appendChild(element);\n\n icon.cloneSpriteNode();\n\n expect(icon.iconClone).toBeTruthy();\n expect(icon.iconClone).toEqualAttribute('id', 'tct-close');\n\n element.remove();\n });\n });\n });\n\n describe('Accessibility', () => {\n describe('aXe DevTools', () => {\n it('does not have accessibility violations', async () => {\n const page = await setup({\n html: `<q2-icon type=\"close\"></q2-icon>`,\n });\n const hasViolations = await evaluateA11y(page);\n expect(hasViolations).toBe(false);\n });\n });\n describe('Accessibility Tree', () => {});\n describe('Keyboard Controls', () => {});\n describe('Other', () => {});\n });\n});\n\nconst notFoundIconMarkup = `\n <q2-icon type=\"not-found\">\n <mock:shadow-root>\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <use></use>\n <g></g>\n </svg>\n </mock:shadow-root>\n </q2-icon>\n`;\n\nconst closeIconMarkup = `\n <q2-icon type=\"close\">\n <mock:shadow-root>\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <use href=\"#tct-close\"></use>\n <g>\n <symbol fill=\"none\" id=\"tct-close\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <g class=\"close\">\n <path class=\"stroke-primary\" d=\"m17.875 6-12 12m0-12 12 12\"></path>\n </g>\n </symbol>\n </g>\n </svg>\n </mock:shadow-root>\n </q2-icon>\n`;\n\nconst emptyIconMarkup = `\n <q2-icon>\n <mock:shadow-root>\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <g></g>\n </svg>\n </mock:shadow-root>\n </q2-icon>\n`;\n"]}
1
+ {"version":3,"file":"q2-icon-test.e2e.js","sourceRoot":"","sources":["../../../../../src/components/q2-icon/test/q2-icon-test.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,WAAW,EAAY,M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gBAEvB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,CAAC;gBACpC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,gBAAgB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;gBAE3D,OAAO,CAAC,MAAM,EAAE,CAAC;YACrB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;QAC3B,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;YAC1B,EAAE,CAAC,wCAAwC,EAAE,KAAK,IAAI,EAAE;gBACpD,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC;oBACrB,IAAI,EAAE,kCAAkC;iBAC3C,CAAC,CAAC;gBACH,MAAM,aAAa,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC;gBAC/C,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACtC,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QACH,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACzC,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACxC,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG;;;;;;;;;CAS1B,CAAC;AAEF,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;CAevB,CAAC;AAEF,MAAM,eAAe,GAAG;;;;;;;;CAQvB,CAAC","sourcesContent":["import { E2EPage, EventSpy, newSpecPage, SpecPage } from '@stencil/core/testing';\nimport { evaluateA11y, getListOfStyleCompilationIssues, mockIconFetch, setup } from '@/utils/helpers';\nimport { Q2Icon } from '../q2-icon';\n\ndescribe('q2-icon', () => {\n let e2ePage: E2EPage;\n let specPage: SpecPage;\n\n it('properly compiles CSS vars and functions', async () => {\n const page = await setup({ html: '<q2-icon></q2-icon>' });\n expect(await getListOfStyleCompilationIssues(page, 'q2-icon')).toHaveLength(0);\n });\n\n describe('SVG Sprite', () => {\n let standardLoadedEventSpy: EventSpy;\n let statusLoadedEventSpy: EventSpy;\n\n beforeEach(async () => {\n e2ePage = await setup({\n html: '',\n });\n e2ePage.setDefaultTimeout(5000);\n e2ePage.setContent(`<q2-icon type=\"close\"></q2-icon>`);\n standardLoadedEventSpy = await e2ePage.spyOnEvent('tct-loaded-standard');\n statusLoadedEventSpy = await e2ePage.spyOnEvent('tct-loaded-status');\n await e2ePage.waitForSelector('#tecton-sprites');\n await e2ePage.waitForSelector('#tecton-sprite-standard');\n await e2ePage.waitForChanges();\n });\n\n it('creates the sprite container', async () => {\n const spriteContainers = await e2ePage.findAll('#tecton-sprites');\n expect(spriteContainers).toHaveLength(1);\n\n const spriteContainer = spriteContainers[0];\n expect(spriteContainer).toBeTruthy();\n expect((await spriteContainer.getComputedStyle()).display).toEqual('none');\n });\n\n it('adds the sprite', async () => {\n const spriteElements = await e2ePage.findAll('#tecton-sprites > svg');\n expect(spriteElements).toHaveLength(1);\n\n const spriteElement = spriteElements[0];\n expect(spriteElement).toBeTruthy();\n expect(spriteElement).toEqualAttribute('id', 'tecton-sprite-standard');\n expect(spriteElement).toHaveAttribute('data-loaded');\n });\n\n it('fires the loaded event', async () => {\n expect(standardLoadedEventSpy).toHaveReceivedEventTimes(1);\n expect(statusLoadedEventSpy).toHaveReceivedEventTimes(0);\n });\n\n it('renders the use element to the SVG', async () => {\n const useElement = await e2ePage.find('q2-icon >>> use');\n expect(useElement).toBeTruthy();\n expect(useElement).toEqualAttribute('href', '#tct-close');\n });\n\n it('renders the symbol element to the SVG', async () => {\n const symbolElements = await e2ePage.findAll('q2-icon >>> symbol');\n\n expect(symbolElements).toHaveLength(1);\n\n const symbolElement = symbolElements[0];\n expect(symbolElement).toBeTruthy();\n expect(symbolElement).toEqualAttribute('id', 'tct-close');\n expect(symbolElement).toEqualHtml(`\n <symbol fill=\"none\" id=\"tct-close\" viewbox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <g class=\"stroke-primary\">\n <path d=\"m17.875 6-12 12m0-12 12 12\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </g>\n </symbol>\n `);\n });\n\n describe('when icon is updated to one in a separate sprite', () => {\n beforeEach(async () => {\n const icon = await e2ePage.find('q2-icon');\n await icon.setProperty('type', 'success');\n await e2ePage.waitForChanges();\n await e2ePage.waitForSelector('#tecton-sprite-status');\n });\n\n it('does not create a new sprite container', async () => {\n const spriteContainers = await e2ePage.findAll('#tecton-sprites');\n expect(spriteContainers).toHaveLength(1);\n\n const spriteContainer = spriteContainers[0];\n expect(spriteContainer).toBeTruthy();\n expect((await spriteContainer.getComputedStyle()).display).toEqual('none');\n });\n\n it('adds a new sprite without removing previous one', async () => {\n const spriteElements = await e2ePage.findAll('#tecton-sprites > svg');\n expect(spriteElements).toHaveLength(2);\n\n const oldSpriteElement = spriteElements[0];\n expect(oldSpriteElement).toEqualAttribute('id', 'tecton-sprite-standard');\n\n const newSpriteElement = spriteElements[1];\n expect(newSpriteElement).toBeTruthy();\n expect(newSpriteElement).toEqualAttribute('id', 'tecton-sprite-status');\n expect(newSpriteElement).toHaveAttribute('data-loaded');\n });\n\n it('fires the loaded event', async () => {\n expect(standardLoadedEventSpy).toHaveReceivedEventTimes(1);\n expect(statusLoadedEventSpy).toHaveReceivedEventTimes(1);\n });\n\n it('renders the use element to the SVG', async () => {\n const useElement = await e2ePage.find('q2-icon >>> use');\n expect(useElement).toBeTruthy();\n expect(useElement).toEqualAttribute('href', '#tct-success');\n });\n\n it('renders the symbol element to the SVG', async () => {\n const symbolElements = await e2ePage.findAll('q2-icon >>> symbol');\n expect(symbolElements).toHaveLength(1);\n\n const symbolElement = symbolElements[0];\n expect(symbolElement).toBeTruthy();\n expect(symbolElement).toEqualAttribute('id', 'tct-success');\n expect(symbolElement).toEqualHtml(`\n <symbol fill=\"none\" id=\"tct-success\" viewbox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 21.244a9.244 9.244 0 1 0 0-18.488 9.244 9.244 0 0 0 0 18.488Z\" stroke=\"var(--comp-status-color)\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"m7.754 12.739 2.613 2.613 5.88-5.88\" stroke=\"var(--comp-status-color)\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </symbol>\n `);\n });\n });\n });\n\n describe('Props', () => {\n describe('inline', () => {\n it('uses the default width and height when false', async () => {\n e2ePage = await setup({\n html: `<q2-icon type=\"a11y\"></q2-icon>`,\n });\n const icon = await e2ePage.find('q2-icon');\n const iconComputedStyle = await icon.getComputedStyle();\n expect(iconComputedStyle.width).toEqual('24px');\n expect(iconComputedStyle.height).toEqual('24px');\n });\n\n it('sets the width and height to 1em when true', async () => {\n e2ePage = await setup({\n html: `<q2-icon type=\"a11y\" inline></q2-icon>`,\n });\n const icon = await e2ePage.find('q2-icon');\n const iconComputedStyle = await icon.getComputedStyle();\n expect(iconComputedStyle.width).toEqual('16px');\n expect(iconComputedStyle.height).toEqual('16px');\n });\n });\n\n describe('label', () => {\n beforeEach(async () => {\n mockIconFetch(`\n <symbol fill=\"none\" id=\"tct-close\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <g class=\"close\">\n <path class=\"stroke-primary\" d=\"m17.875 6-12 12m0-12 12 12\"></path>\n </g>\n </symbol>\n `);\n });\n\n afterEach(() => {\n jest.restoreAllMocks();\n });\n\n it('renders the expected output when provided', async () => {\n specPage = await newSpecPage({\n components: [Q2Icon],\n html: '<q2-icon label=\"Iron Man\" type=\"close\"></q2-icon>',\n });\n\n expect(specPage.root).toEqualHtml(`\n <q2-icon label=\"Iron Man\" type=\"close\">\n <mock:shadow-root>\n <svg aria-labelledby=\"label\" role=\"img\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <title id=\"label\">\n Iron Man\n </title>\n <use href=\"#tct-close\"></use>\n <g>\n <symbol fill=\"none\" id=\"tct-close\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <g class=\"close\">\n <path class=\"stroke-primary\" d=\"m17.875 6-12 12m0-12 12 12\"></path>\n </g>\n </symbol>\n </g>\n </svg>\n </mock:shadow-root>\n </q2-icon>\n `);\n });\n });\n\n describe('type', () => {\n beforeEach(async () => {\n mockIconFetch(`\n <symbol fill=\"none\" id=\"tct-close\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <g class=\"close\">\n <path class=\"stroke-primary\" d=\"m17.875 6-12 12m0-12 12 12\"></path>\n </g>\n </symbol>\n `);\n });\n\n afterEach(() => {\n jest.restoreAllMocks();\n });\n\n it('renders nothing when not provided', async () => {\n specPage = await newSpecPage({\n components: [Q2Icon],\n html: '<q2-icon></q2-icon>',\n });\n\n expect(specPage.root).toEqualHtml(emptyIconMarkup);\n });\n\n it('renders expected output when provided', async () => {\n specPage = await newSpecPage({\n components: [Q2Icon],\n html: '<q2-icon type=\"close\"></q2-icon>',\n });\n\n expect(specPage.root).toEqualHtml(closeIconMarkup);\n });\n\n it('clears the content when removed', async () => {\n specPage = await newSpecPage({\n components: [Q2Icon],\n html: '<q2-icon type=\"close\"></q2-icon>',\n });\n\n expect(specPage.root).toEqualHtml(closeIconMarkup);\n\n specPage.root.type = undefined;\n await specPage.waitForChanges();\n\n expect(specPage.root).toEqualHtml(emptyIconMarkup);\n });\n\n it('updates the content when added', async () => {\n specPage = await newSpecPage({\n components: [Q2Icon],\n html: '<q2-icon></q2-icon>',\n });\n\n expect(specPage.root).toEqualHtml(emptyIconMarkup);\n\n specPage.root.type = 'close';\n await specPage.waitForChanges();\n\n expect(specPage.root).toEqualHtml(closeIconMarkup);\n });\n\n it('does not add the href to the use element if the icon is not found', async () => {\n specPage = await newSpecPage({\n components: [Q2Icon],\n html: '<q2-icon type=\"not-found\"></q2-icon>',\n });\n\n expect(specPage.root).toEqualHtml(notFoundIconMarkup);\n });\n\n describe(\"when type is 'custom'\", () => {\n it('it renders in a slot and adds necessary attributes', async () => {\n specPage = await newSpecPage({\n components: [Q2Icon],\n html: `\n <q2-icon type=\"custom\">\n <svg viewBox=\"0 0 34 34\">\n <circle cx=\"17\" cy=\"17\" r=\"10\" />\n </svg>\n </q2-icon>\n `,\n });\n\n const svg = specPage.root.querySelector('svg');\n\n expect(svg).toEqualAttribute('role', 'img');\n expect(svg).toEqualAttribute('xmlns', 'http://www.w3.org/2000/svg');\n expect(svg).toEqualAttribute('aria-hidden', 'true');\n expect(svg).not.toHaveAttribute('aria-labelledby');\n\n expect(specPage.root).toEqualHtml(`\n <q2-icon type=\"custom\">\n <mock:shadow-root>\n <slot />\n </mock:shadow-root>\n <svg aria-hidden=\"true\" role=\"img\" viewBox=\"0 0 34 34\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"17\" cy=\"17\" r=\"10\" />\n </svg>\n </q2-icon>\n `);\n });\n\n it('it renders in a slot and adds necessary attributes when label is provided', async () => {\n specPage = await newSpecPage({\n components: [Q2Icon],\n html: `\n <q2-icon type=\"custom\" label=\"Iron Man\">\n <svg viewBox=\"0 0 34 34\">\n <circle cx=\"17\" cy=\"17\" r=\"10\" />\n </svg>\n </q2-icon>\n `,\n });\n\n const svg = specPage.root.querySelector('svg');\n\n expect(svg).toEqualAttribute('role', 'img');\n expect(svg).toEqualAttribute('xmlns', 'http://www.w3.org/2000/svg');\n expect(svg).not.toHaveAttribute('aria-hidden');\n expect(svg).toHaveAttribute('aria-labelledby');\n\n expect(specPage.root).toEqualHtml(`\n <q2-icon label=\"Iron Man\" type=\"custom\">\n <mock:shadow-root>\n <slot />\n </mock:shadow-root>\n <svg aria-labelledby=\"label-1000\" role=\"img\" viewBox=\"0 0 34 34\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"17\" cy=\"17\" r=\"10\" />\n <title id=\"label-1000\">\n Iron Man\n </title>\n </svg>\n </q2-icon>\n `);\n });\n });\n });\n });\n\n describe('Styling', () => {\n describe('fill', () => {\n it('uses fallback color when override not provided', async () => {\n e2ePage = await setup({\n html: `<q2-icon type=\"brand-facebook-color\"></q2-icon>`,\n });\n const pathElements = await e2ePage.findAll('q2-icon >>> path');\n const pathOneStyle = await pathElements[0].getComputedStyle();\n const pathTwoStyle = await pathElements[1].getComputedStyle();\n expect(pathOneStyle.fill).toEqual('rgb(57, 87, 154)');\n expect(pathTwoStyle.fill).toEqual('rgb(255, 255, 255)');\n });\n\n it('uses override color when provided', async () => {\n e2ePage = await setup({\n html: `<q2-icon type=\"brand-facebook-color\" style=\"--tct-icon-brand-fill-primary: blue; --tct-icon-brand-fill-secondary: red;\"></q2-icon>`,\n });\n const pathElements = await e2ePage.findAll('q2-icon >>> path');\n const pathOneStyle = await pathElements[0].getComputedStyle();\n const pathTwoStyle = await pathElements[1].getComputedStyle();\n expect(pathOneStyle.fill).toEqual('rgb(0, 0, 255)');\n expect(pathTwoStyle.fill).toEqual('rgb(255, 0, 0)');\n });\n });\n });\n\n describe('Getters', () => {\n describe('isCustom', () => {\n it(\"returns true when type is 'custom'\", () => {\n const icon = new Q2Icon();\n icon.type = 'custom';\n expect(icon.isCustom).toBeTruthy();\n });\n\n it(\"returns false when type is not 'custom'\", () => {\n const icon = new Q2Icon();\n icon.type = 'close';\n expect(icon.isCustom).toBeFalsy();\n });\n });\n\n describe('spriteFileName', () => {\n it(\"returns undefined when type is 'custom'\", () => {\n const icon = new Q2Icon();\n icon.type = 'custom';\n expect(icon.spriteFileName).toBeUndefined();\n });\n\n it('returns undefined when type does not map to a file', () => {\n const icon = new Q2Icon();\n icon.type = 'foobar';\n expect(icon.spriteFileName).toBeUndefined();\n });\n\n it(\"returns the sprite filename when type is not 'custom'\", () => {\n const icon = new Q2Icon();\n icon.type = 'close';\n expect(icon.spriteFileName).toEqual('standard');\n });\n });\n\n describe('spriteId', () => {\n it(\"returns undefined when type is 'custom'\", () => {\n const icon = new Q2Icon();\n icon.type = 'custom';\n expect(icon.spriteId).toBeUndefined();\n });\n\n it('returns undefined when spriteFileName is undefined', () => {\n const icon = new Q2Icon();\n icon.type = 'foobar';\n expect(icon.spriteId).toBeUndefined();\n });\n\n it('returns the sprite ID when spriteFileName is defined', () => {\n const icon = new Q2Icon();\n icon.type = 'close';\n expect(icon.spriteId).toEqual('tecton-sprite-standard');\n });\n });\n\n describe('spriteElement', () => {\n it('returns undefined when spriteId is undefined', () => {\n const icon = new Q2Icon();\n icon.type = 'foobar';\n expect(icon.spriteElement).toBeUndefined();\n });\n\n it('returns the sprite element when spriteId is defined', () => {\n const icon = new Q2Icon();\n icon.type = 'close';\n\n const element = document.createElement('div');\n element.id = 'tecton-sprite-standard';\n document.body.appendChild(element);\n\n expect(icon.spriteElement).toBeTruthy();\n\n element.remove();\n });\n });\n\n describe('spriteEventName', () => {\n it('returns undefined when spriteFileName is undefined', () => {\n const icon = new Q2Icon();\n icon.type = 'foobar';\n expect(icon.spriteEventName).toBeUndefined();\n });\n\n it('returns the event name when spriteFileName is defined', () => {\n const icon = new Q2Icon();\n icon.type = 'close';\n expect(icon.spriteEventName).toEqual('tct-loaded-standard');\n });\n });\n });\n\n describe('Methods', () => {\n describe('getOrCreateSpriteContainer', () => {\n it('returns the existing sprite container', () => {\n const icon = new Q2Icon();\n const spriteContainer = document.createElement('div');\n spriteContainer.id = 'tecton-sprites';\n document.body.appendChild(spriteContainer);\n\n expect(icon.getOrCreateSpriteContainer()).toEqual(spriteContainer);\n\n spriteContainer.remove();\n });\n\n it('creates and returns a new sprite container', () => {\n const icon = new Q2Icon();\n const spriteContainer = icon.getOrCreateSpriteContainer();\n\n expect(spriteContainer).toBeTruthy();\n expect(spriteContainer).toEqualAttribute('id', 'tecton-sprites');\n });\n });\n\n describe('fetchSprite', () => {\n beforeEach(async () => {\n mockIconFetch();\n });\n\n afterEach(() => {\n jest.restoreAllMocks();\n });\n\n it('does nothing when type is not defined', async () => {\n const icon = new Q2Icon();\n icon.fetchSprite();\n expect(icon.spriteElement).toBeUndefined();\n });\n\n it('does not try to recreate sprite element if it already exists', async () => {\n const icon = new Q2Icon();\n icon.type = 'close';\n\n const container = icon.getOrCreateSpriteContainer();\n const spriteElement = document.createElement('SVG');\n spriteElement.id = 'tecton-sprite-standard';\n spriteElement.setAttribute('data-loaded', '');\n container.appendChild(spriteElement);\n\n expect(icon.spriteElement).toEqual(spriteElement);\n\n await icon.fetchSprite();\n\n expect(icon.spriteElement).toEqual(spriteElement);\n\n spriteElement.remove();\n });\n\n it('fetches the sprite when type is defined', async () => {\n const icon = new Q2Icon();\n icon.type = 'close';\n\n await icon.fetchSprite();\n\n expect(icon.spriteElement.tagName.toUpperCase()).toEqual('SVG');\n });\n });\n\n describe('cloneSpriteNode', () => {\n it('returns undefined when spriteElement is undefined', () => {\n const icon = new Q2Icon();\n icon.type = 'foobar';\n icon.cloneSpriteNode();\n expect(icon.iconClone).toBeUndefined();\n });\n\n it('returns a clone of the sprite element', () => {\n const icon = new Q2Icon();\n icon.type = 'close';\n\n const container = icon.getOrCreateSpriteContainer();\n\n const element = document.createElement('div');\n element.id = 'tct-close';\n container.appendChild(element);\n\n icon.cloneSpriteNode();\n\n expect(icon.iconClone).toBeTruthy();\n expect(icon.iconClone).toEqualAttribute('id', 'tct-close');\n\n element.remove();\n });\n });\n });\n\n describe('Accessibility', () => {\n describe('aXe DevTools', () => {\n it('does not have accessibility violations', async () => {\n const page = await setup({\n html: `<q2-icon type=\"close\"></q2-icon>`,\n });\n const hasViolations = await evaluateA11y(page);\n expect(hasViolations).toBe(false);\n });\n });\n describe('Accessibility Tree', () => {});\n describe('Keyboard Controls', () => {});\n describe('Other', () => {});\n });\n});\n\nconst notFoundIconMarkup = `\n <q2-icon type=\"not-found\">\n <mock:shadow-root>\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <use></use>\n <g></g>\n </svg>\n </mock:shadow-root>\n </q2-icon>\n`;\n\nconst closeIconMarkup = `\n <q2-icon type=\"close\">\n <mock:shadow-root>\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <use href=\"#tct-close\"></use>\n <g>\n <symbol fill=\"none\" id=\"tct-close\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <g class=\"close\">\n <path class=\"stroke-primary\" d=\"m17.875 6-12 12m0-12 12 12\"></path>\n </g>\n </symbol>\n </g>\n </svg>\n </mock:shadow-root>\n </q2-icon>\n`;\n\nconst emptyIconMarkup = `\n <q2-icon>\n <mock:shadow-root>\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <g></g>\n </svg>\n </mock:shadow-root>\n </q2-icon>\n`;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"alpha.js","sourceRoot":"","sources":["../../../../src/components/q2-input/formatting/alpha.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,WAAW,CAAC;AAEpC,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAa,EAAE,QAAiB;IAChE,IAAI,GAAG,GAAG,KAAK,IAAI,EAAE,CAAC;IAEtB,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACxB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;IACzC,CAAC;SAAM,CAAC;QACJ,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["import formatValue from './generic';\n\nexport default function formatAlpha(value: string, modifier?: string) {\n let val = value || '';\n\n if (modifier === 'spaced') {\n val = val.replace(/[^a-zA-Z ]/g, '');\n } else {\n val = val.replace(/[^a-zA-Z]/g, '');\n }\n\n return formatValue(val);\n}\n"]}
1
+ {"version":3,"file":"alpha.js","sourceRoot":"","sources":["../../../../../src/components/q2-input/formatting/alpha.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,WAAW,CAAC;AAEpC,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAa,EAAE,QAAiB;IAChE,IAAI,GAAG,GAAG,KAAK,IAAI,EAAE,CAAC;IAEtB,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACxB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;IACzC,CAAC;SAAM,CAAC;QACJ,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["import formatValue from './generic';\n\nexport default function formatAlpha(value: string, modifier?: string) {\n let val = value || '';\n\n if (modifier === 'spaced') {\n val = val.replace(/[^a-zA-Z ]/g, '');\n } else {\n val = val.replace(/[^a-zA-Z]/g, '');\n }\n\n return formatValue(val);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"alpha.spec.js","sourceRoot":"","sources":["../../../../src/components/q2-input/formatting/alpha.spec.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,SAAS,CAAC;AAElC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC5C,MAAM,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/E,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QAC/C,MAAM,CAAC,WAAW,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAChF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import formatAlpha from './alpha';\n\ndescribe('formatAlpha', () => {\n it('should format alpha values correctly', () => {\n expect(formatAlpha('a b c 1 2 3 - . ? #').fullyFormattedValue).toBe('abc');\n });\n it('should apply format modifiers correctly', () => {\n expect(formatAlpha('a b c123', 'spaced').fullyFormattedValue).toBe('a b c');\n });\n});\n"]}
1
+ {"version":3,"file":"alpha.spec.js","sourceRoot":"","sources":["../../../../../src/components/q2-input/formatting/alpha.spec.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,SAAS,CAAC;AAElC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC5C,MAAM,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/E,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QAC/C,MAAM,CAAC,WAAW,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAChF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import formatAlpha from './alpha';\n\ndescribe('formatAlpha', () => {\n it('should format alpha values correctly', () => {\n expect(formatAlpha('a b c 1 2 3 - . ? #').fullyFormattedValue).toBe('abc');\n });\n it('should apply format modifiers correctly', () => {\n expect(formatAlpha('a b c123', 'spaced').fullyFormattedValue).toBe('a b c');\n });\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"alphanumeric.js","sourceRoot":"","sources":["../../../../src/components/q2-input/formatting/alphanumeric.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,WAAW,CAAC;AAEpC,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,KAAa;IACpD,MAAM,GAAG,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;IACtD,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["import formatValue from './generic';\n\nexport default function formatAlphanumeric(value: string) {\n const val = (value || '').replace(/[^\\da-zA-Z]/g, '');\n return formatValue(val);\n}\n"]}
1
+ {"version":3,"file":"alphanumeric.js","sourceRoot":"","sources":["../../../../../src/components/q2-input/formatting/alphanumeric.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,WAAW,CAAC;AAEpC,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,KAAa;IACpD,MAAM,GAAG,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;IACtD,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["import formatValue from './generic';\n\nexport default function formatAlphanumeric(value: string) {\n const val = (value || '').replace(/[^\\da-zA-Z]/g, '');\n return formatValue(val);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"alphanumeric.spec.js","sourceRoot":"","sources":["../../../../src/components/q2-input/formatting/alphanumeric.spec.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,gBAAgB,CAAC;AAEhD,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACnD,MAAM,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import formatAlphanumeric from './alphanumeric';\n\ndescribe('formatAlphanumeric', () => {\n it('should format alphanumeric values correctly', () => {\n expect(formatAlphanumeric('a b c 1 2 3 - . ? #').fullyFormattedValue).toBe('abc123');\n });\n});\n"]}
1
+ {"version":3,"file":"alphanumeric.spec.js","sourceRoot":"","sources":["../../../../../src/components/q2-input/formatting/alphanumeric.spec.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,gBAAgB,CAAC;AAEhD,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACnD,MAAM,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import formatAlphanumeric from './alphanumeric';\n\ndescribe('formatAlphanumeric', () => {\n it('should format alphanumeric values correctly', () => {\n expect(formatAlphanumeric('a b c 1 2 3 - . ? #').fullyFormattedValue).toBe('abc123');\n });\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"credit-card.js","sourceRoot":"","sources":["../../../../src/components/q2-input/formatting/credit-card.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,WAAW,CAAC;AAWpC,SAAS,MAAM,CAAC,KAAa;IACzB,mEAAmE;IACnE,MAAM,YAAY,GAAG,gBAAgB,CAAC,6BAA6B,CAAC,KAAK,CAAC,CAAC;IAC3E,MAAM,oBAAoB,GAAG,oBAAoB,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC;IAEvE,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QACjD,oBAAoB,CAAC,QAAQ,GAAG,MAAM,CAAC;IAC3C,CAAC;IACD,OAAO,oBAAoB,CAAC;AAChC,CAAC;AAED,MAAM,gBAAgB,GAAc,SAAS,SAAS,CAAC,KAAK;IACxD,MAAM,WAAW,GAAG,WAAW,CAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC;IAE9D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AAU,GAAG,GAAG,EAAE,CAAC;wBACnB,OAAO,UAAU,CAAC;oBACtB,CAAC;gBACL,CAAC;qBAAM,CAAC;oBACJ,OAAO,UAAU,CAAC;gBACtB,CAAC;YACL,CAAC;YACD,IAAI,SAAS,KAAK,CAAC,EAAE,CAAC;gBAClB,OAAO,UAAU,CAAC;YACtB,CAAC;YACD,IAAI,SAAS,KAAK,CAAC,EAAE,CAAC;gBAClB,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACnB,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;oBAC9C,IAAI,QAAQ,IAAI,MAAM,IAAI,QAAQ,IAAI,MAAM,EAAE,CAAC;wBAC3C,OAAO,UAAU,CAAC;oBACtB,CAAC;gBACL,CAAC;qBAAM,CAAC;oBACJ,OAAO,UAAU,CAAC;gBACtB,CAAC;YACL,CAAC;YACD,MAAM;QACV;YACI,OAAO,SAAS,CAAC;IACzB,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AACD,yCAAyC;AAEzC,MAAM,gBAAgB,GAAG;IACrB,6BAA6B;IAC7B,MAAM;IACN,aAAa;IACb,gCAAgC;IAChC,iBAAiB;IACjB,mBAAmB;IACnB,aAAa;IACb,gBAAgB;CACnB,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import formatValue from './generic';\nimport { IFormatterValueObject } from '../q2-input-types';\n\ninterface FormattedCreditCardObject extends IFormatterValueObject {\n type: string;\n leftIcon: string;\n leftIconMuted: boolean;\n}\n\ntype Formatter = (value: string) => FormattedCreditCardObject;\n\nfunction format(value: string): FormattedCreditCardObject {\n // have a initial generic mask which then converts to specific mask\n const detectedType = formatCreditCard.detectCreditCardTypeFromValue(value);\n const formattedValueObject = creditCardFormatters[detectedType](value);\n\n if (value.length < 2 && detectedType === 'unknown') {\n formattedValueObject.leftIcon = 'card';\n }\n return formattedValueObject;\n}\n\nconst unknownFormatter: Formatter = function unknownFn(value) {\n const valueObject = formatValue(value, '#### #### #### ####');\n\n return {\n ...valueObject,\n type: 'unknown',\n leftIcon: 'card-unknown',\n leftIconMuted: value.length < 16,\n };\n};\n\nconst amexFormatter: Formatter = function amexFn(value) {\n const valueObject = formatValue(value, '#### ###### #####');\n\n return {\n ...valueObject,\n type: 'amex',\n leftIcon: 'card-amex-color',\n leftIconMuted: value.length < 15,\n };\n};\n\nconst discoverFormatter: Formatter = function discoverFn(value) {\n const valueObject = formatValue(value, '#### #### #### ####');\n\n return {\n ...valueObject,\n type: 'discover',\n leftIcon: 'card-discover-color',\n leftIconMuted: value.length < 16,\n };\n};\n\nconst masterCardFormatter: Formatter = function masterCardFn(value) {\n const valueObject = formatValue(value, '#### #### #### ####');\n\n return {\n ...valueObject,\n type: 'masterCard',\n leftIcon: 'card-mastercard-color',\n leftIconMuted: value.length < 16,\n };\n};\n\nconst visaFormatter: Formatter = function visaFn(value) {\n const valueObject = formatValue(value, '#### #### #### ####');\n\n return {\n ...valueObject,\n type: 'visa',\n leftIcon: 'card-visa-color',\n leftIconMuted: value.length < 16,\n };\n};\n\nconst dinersClubInternationalFormatter: Formatter = function dinersClub(value) {\n const valueObject = formatValue(value, '#### ###### ####');\n\n return {\n ...valueObject,\n type: 'dinersClub',\n leftIcon: 'card-dinersclub-color',\n leftIconMuted: value.length < 14,\n };\n};\n\nconst creditCardFormatters = {\n discover: discoverFormatter,\n amex: amexFormatter,\n masterCard: masterCardFormatter,\n visa: visaFormatter,\n dinersClub: dinersClubInternationalFormatter,\n unknown: unknownFormatter,\n};\n\n/* tslint:disable:cyclomatic-complexity */\nfunction detectCreditCardTypeFromValue(value: string): string {\n // use value and some algorithm from the internet to detect and return card type based on string\n // return string 'unknown' if algorithm cannot detect or returns a type that is not one of our 5 supported types\n const firstInt = parseInt(value.charAt(0));\n const secondInt = parseInt(value.charAt(1));\n\n switch (firstInt) {\n case 2:\n if (secondInt > 1 && secondInt < 8) {\n if (value.length >= 4) {\n const firstfour = parseInt(value.substr(0, 4));\n if (firstfour >= 2221 && firstfour < 2721) {\n return 'masterCard';\n }\n } else {\n return 'masterCard';\n }\n }\n break;\n case 3:\n if (secondInt === 4 || secondInt === 7) {\n return 'amex';\n }\n if (secondInt === 0) {\n if (value.length > 2) {\n const thirdInt = parseInt(value.charAt(2));\n if (thirdInt < 6 || thirdInt === 9) {\n return 'dinersClub';\n }\n } else {\n return 'dinersClub';\n }\n }\n if (secondInt === 6 || secondInt === 8 || secondInt === 9) {\n return 'dinersClub';\n }\n break;\n case 4:\n return 'visa';\n case 5:\n if (secondInt > 0 && secondInt < 6) {\n return 'masterCard';\n }\n break;\n case 6:\n if (secondInt === 0) {\n if (value.length > 3) {\n const firstfour = value.substr(0, 4);\n if (firstfour === '6011') {\n return 'discover';\n }\n } else {\n return 'discover';\n }\n }\n if (secondInt === 4) {\n if (value.length > 2) {\n const firstthree = parseInt(value.substr(0, 3));\n if (firstthree > 643) {\n return 'discover';\n }\n } else {\n return 'discover';\n }\n }\n if (secondInt === 5) {\n return 'discover';\n }\n if (secondInt === 2) {\n if (value.length > 5) {\n const firstsix = parseInt(value.substr(0, 6));\n if (firstsix >= 622126 && firstsix <= 622925) {\n return 'discover';\n }\n } else {\n return 'discover';\n }\n }\n break;\n default:\n return 'unknown';\n }\n return 'unknown';\n}\n/* tslint:enable:cyclomatic-complexity */\n\nconst formatCreditCard = {\n detectCreditCardTypeFromValue,\n format,\n amexFormatter,\n dinersClubInternationalFormatter,\n discoverFormatter,\n masterCardFormatter,\n visaFormatter,\n unknownFormatter,\n};\n\nexport default formatCreditCard;\n"]}
1
+ {"version":3,"file":"credit-card.js","sourceRoot":"","sources":["../../../../../src/components/q2-input/formatting/credit-card.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,WAAW,CAAC;AAWpC,SAAS,MAAM,CAAC,KAAa;IACzB,mEAAmE;IACnE,MAAM,YAAY,GAAG,gBAAgB,CAAC,6BAA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BAAgB;CACnB,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import formatValue from './generic';\nimport { IFormatterValueObject } from '../q2-input-types';\n\ninterface FormattedCreditCardObject extends IFormatterValueObject {\n type: string;\n leftIcon: string;\n leftIconMuted: boolean;\n}\n\ntype Formatter = (value: string) => FormattedCreditCardObject;\n\nfunction format(value: string): FormattedCreditCardObject {\n // have a initial generic mask which then converts to specific mask\n const detectedType = formatCreditCard.detectCreditCardTypeFromValue(value);\n const formattedValueObject = creditCardFormatters[detectedType](value);\n\n if (value.length < 2 && detectedType === 'unknown') {\n formattedValueObject.leftIcon = 'card';\n }\n return formattedValueObject;\n}\n\nconst unknownFormatter: Formatter = function unknownFn(value) {\n const valueObject = formatValue(value, '#### #### #### ####');\n\n return {\n ...valueObject,\n type: 'unknown',\n leftIcon: 'card-unknown',\n leftIconMuted: value.length < 16,\n };\n};\n\nconst amexFormatter: Formatter = function amexFn(value) {\n const valueObject = formatValue(value, '#### ###### #####');\n\n return {\n ...valueObject,\n type: 'amex',\n leftIcon: 'card-amex-color',\n leftIconMuted: value.length < 15,\n };\n};\n\nconst discoverFormatter: Formatter = function discoverFn(value) {\n const valueObject = formatValue(value, '#### #### #### ####');\n\n return {\n ...valueObject,\n type: 'discover',\n leftIcon: 'card-discover-color',\n leftIconMuted: value.length < 16,\n };\n};\n\nconst masterCardFormatter: Formatter = function masterCardFn(value) {\n const valueObject = formatValue(value, '#### #### #### ####');\n\n return {\n ...valueObject,\n type: 'masterCard',\n leftIcon: 'card-mastercard-color',\n leftIconMuted: value.length < 16,\n };\n};\n\nconst visaFormatter: Formatter = function visaFn(value) {\n const valueObject = formatValue(value, '#### #### #### ####');\n\n return {\n ...valueObject,\n type: 'visa',\n leftIcon: 'card-visa-color',\n leftIconMuted: value.length < 16,\n };\n};\n\nconst dinersClubInternationalFormatter: Formatter = function dinersClub(value) {\n const valueObject = formatValue(value, '#### ###### ####');\n\n return {\n ...valueObject,\n type: 'dinersClub',\n leftIcon: 'card-dinersclub-color',\n leftIconMuted: value.length < 14,\n };\n};\n\nconst creditCardFormatters = {\n discover: discoverFormatter,\n amex: amexFormatter,\n masterCard: masterCardFormatter,\n visa: visaFormatter,\n dinersClub: dinersClubInternationalFormatter,\n unknown: unknownFormatter,\n};\n\n/* tslint:disable:cyclomatic-complexity */\nfunction detectCreditCardTypeFromValue(value: string): string {\n // use value and some algorithm from the internet to detect and return card type based on string\n // return string 'unknown' if algorithm cannot detect or returns a type that is not one of our 5 supported types\n const firstInt = parseInt(value.charAt(0));\n const secondInt = parseInt(value.charAt(1));\n\n switch (firstInt) {\n case 2:\n if (secondInt > 1 && secondInt < 8) {\n if (value.length >= 4) {\n const firstfour = parseInt(value.substr(0, 4));\n if (firstfour >= 2221 && firstfour < 2721) {\n return 'masterCard';\n }\n } else {\n return 'masterCard';\n }\n }\n break;\n case 3:\n if (secondInt === 4 || secondInt === 7) {\n return 'amex';\n }\n if (secondInt === 0) {\n if (value.length > 2) {\n const thirdInt = parseInt(value.charAt(2));\n if (thirdInt < 6 || thirdInt === 9) {\n return 'dinersClub';\n }\n } else {\n return 'dinersClub';\n }\n }\n if (secondInt === 6 || secondInt === 8 || secondInt === 9) {\n return 'dinersClub';\n }\n break;\n case 4:\n return 'visa';\n case 5:\n if (secondInt > 0 && secondInt < 6) {\n return 'masterCard';\n }\n break;\n case 6:\n if (secondInt === 0) {\n if (value.length > 3) {\n const firstfour = value.substr(0, 4);\n if (firstfour === '6011') {\n return 'discover';\n }\n } else {\n return 'discover';\n }\n }\n if (secondInt === 4) {\n if (value.length > 2) {\n const firstthree = parseInt(value.substr(0, 3));\n if (firstthree > 643) {\n return 'discover';\n }\n } else {\n return 'discover';\n }\n }\n if (secondInt === 5) {\n return 'discover';\n }\n if (secondInt === 2) {\n if (value.length > 5) {\n const firstsix = parseInt(value.substr(0, 6));\n if (firstsix >= 622126 && firstsix <= 622925) {\n return 'discover';\n }\n } else {\n return 'discover';\n }\n }\n break;\n default:\n return 'unknown';\n }\n return 'unknown';\n}\n/* tslint:enable:cyclomatic-complexity */\n\nconst formatCreditCard = {\n detectCreditCardTypeFromValue,\n format,\n amexFormatter,\n dinersClubInternationalFormatter,\n discoverFormatter,\n masterCardFormatter,\n visaFormatter,\n unknownFormatter,\n};\n\nexport default formatCreditCard;\n"]}