@haiilo/catalyst 10.2.0 → 10.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/dist/catalyst/assets/fonts/Lato-Black.ttf +0 -0
  2. package/dist/catalyst/assets/fonts/Lato-Black.woff +0 -0
  3. package/dist/catalyst/assets/fonts/Lato-Black.woff2 +0 -0
  4. package/dist/catalyst/assets/fonts/Lato-BlackItalic.ttf +0 -0
  5. package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff +0 -0
  6. package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff2 +0 -0
  7. package/dist/catalyst/assets/fonts/Lato-Bold.ttf +0 -0
  8. package/dist/catalyst/assets/fonts/Lato-Bold.woff +0 -0
  9. package/dist/catalyst/assets/fonts/Lato-Bold.woff2 +0 -0
  10. package/dist/catalyst/assets/fonts/Lato-BoldItalic.ttf +0 -0
  11. package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff +0 -0
  12. package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  13. package/dist/catalyst/assets/fonts/Lato-Hairline.ttf +0 -0
  14. package/dist/catalyst/assets/fonts/Lato-Hairline.woff +0 -0
  15. package/dist/catalyst/assets/fonts/Lato-Hairline.woff2 +0 -0
  16. package/dist/catalyst/assets/fonts/Lato-HairlineItalic.ttf +0 -0
  17. package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff +0 -0
  18. package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
  19. package/dist/catalyst/assets/fonts/Lato-Heavy.ttf +0 -0
  20. package/dist/catalyst/assets/fonts/Lato-Heavy.woff +0 -0
  21. package/dist/catalyst/assets/fonts/Lato-Heavy.woff2 +0 -0
  22. package/dist/catalyst/assets/fonts/Lato-HeavyItalic.ttf +0 -0
  23. package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff +0 -0
  24. package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
  25. package/dist/catalyst/assets/fonts/Lato-Italic.ttf +0 -0
  26. package/dist/catalyst/assets/fonts/Lato-Italic.woff +0 -0
  27. package/dist/catalyst/assets/fonts/Lato-Italic.woff2 +0 -0
  28. package/dist/catalyst/assets/fonts/Lato-Light.ttf +0 -0
  29. package/dist/catalyst/assets/fonts/Lato-Light.woff +0 -0
  30. package/dist/catalyst/assets/fonts/Lato-Light.woff2 +0 -0
  31. package/dist/catalyst/assets/fonts/Lato-LightItalic.ttf +0 -0
  32. package/dist/catalyst/assets/fonts/Lato-LightItalic.woff +0 -0
  33. package/dist/catalyst/assets/fonts/Lato-LightItalic.woff2 +0 -0
  34. package/dist/catalyst/assets/fonts/Lato-Medium.ttf +0 -0
  35. package/dist/catalyst/assets/fonts/Lato-Medium.woff +0 -0
  36. package/dist/catalyst/assets/fonts/Lato-Medium.woff2 +0 -0
  37. package/dist/catalyst/assets/fonts/Lato-MediumItalic.ttf +0 -0
  38. package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff +0 -0
  39. package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff2 +0 -0
  40. package/dist/catalyst/assets/fonts/Lato-Regular.ttf +0 -0
  41. package/dist/catalyst/assets/fonts/Lato-Regular.woff +0 -0
  42. package/dist/catalyst/assets/fonts/Lato-Regular.woff2 +0 -0
  43. package/dist/catalyst/assets/fonts/Lato-Semibold.ttf +0 -0
  44. package/dist/catalyst/assets/fonts/Lato-Semibold.woff +0 -0
  45. package/dist/catalyst/assets/fonts/Lato-Semibold.woff2 +0 -0
  46. package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.ttf +0 -0
  47. package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff +0 -0
  48. package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
  49. package/dist/catalyst/assets/fonts/Lato-Thin.ttf +0 -0
  50. package/dist/catalyst/assets/fonts/Lato-Thin.woff +0 -0
  51. package/dist/catalyst/assets/fonts/Lato-Thin.woff2 +0 -0
  52. package/dist/catalyst/assets/fonts/Lato-ThinItalic.ttf +0 -0
  53. package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff +0 -0
  54. package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff2 +0 -0
  55. package/dist/catalyst/catalyst.css +10 -1
  56. package/dist/catalyst/catalyst.esm.js +1 -1
  57. package/dist/catalyst/catalyst.esm.js.map +1 -1
  58. package/dist/catalyst/index.esm.js +1 -1
  59. package/dist/catalyst/p-81800b65.js +2 -0
  60. package/dist/catalyst/p-81800b65.js.map +1 -0
  61. package/dist/catalyst/p-8a1d505d.entry.js +10 -0
  62. package/dist/catalyst/p-8a1d505d.entry.js.map +1 -0
  63. package/dist/catalyst/scss/core/_form.scss +12 -3
  64. package/dist/cjs/{cat-alert_26.cjs.entry.js → cat-alert_28.cjs.entry.js} +2293 -128
  65. package/dist/cjs/cat-alert_28.cjs.entry.js.map +1 -0
  66. package/dist/cjs/catalyst.cjs.js +1 -1
  67. package/dist/cjs/index.cjs.js +1 -1
  68. package/dist/cjs/loader.cjs.js +1 -1
  69. package/dist/cjs/{of-a6e7c491.js → of-45281229.js} +34 -19
  70. package/dist/cjs/of-45281229.js.map +1 -0
  71. package/dist/collection/assets/fonts/Lato-Black.ttf +0 -0
  72. package/dist/collection/assets/fonts/Lato-Black.woff +0 -0
  73. package/dist/collection/assets/fonts/Lato-Black.woff2 +0 -0
  74. package/dist/collection/assets/fonts/Lato-BlackItalic.ttf +0 -0
  75. package/dist/collection/assets/fonts/Lato-BlackItalic.woff +0 -0
  76. package/dist/collection/assets/fonts/Lato-BlackItalic.woff2 +0 -0
  77. package/dist/collection/assets/fonts/Lato-Bold.ttf +0 -0
  78. package/dist/collection/assets/fonts/Lato-Bold.woff +0 -0
  79. package/dist/collection/assets/fonts/Lato-Bold.woff2 +0 -0
  80. package/dist/collection/assets/fonts/Lato-BoldItalic.ttf +0 -0
  81. package/dist/collection/assets/fonts/Lato-BoldItalic.woff +0 -0
  82. package/dist/collection/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  83. package/dist/collection/assets/fonts/Lato-Hairline.ttf +0 -0
  84. package/dist/collection/assets/fonts/Lato-Hairline.woff +0 -0
  85. package/dist/collection/assets/fonts/Lato-Hairline.woff2 +0 -0
  86. package/dist/collection/assets/fonts/Lato-HairlineItalic.ttf +0 -0
  87. package/dist/collection/assets/fonts/Lato-HairlineItalic.woff +0 -0
  88. package/dist/collection/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
  89. package/dist/collection/assets/fonts/Lato-Heavy.ttf +0 -0
  90. package/dist/collection/assets/fonts/Lato-Heavy.woff +0 -0
  91. package/dist/collection/assets/fonts/Lato-Heavy.woff2 +0 -0
  92. package/dist/collection/assets/fonts/Lato-HeavyItalic.ttf +0 -0
  93. package/dist/collection/assets/fonts/Lato-HeavyItalic.woff +0 -0
  94. package/dist/collection/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
  95. package/dist/collection/assets/fonts/Lato-Italic.ttf +0 -0
  96. package/dist/collection/assets/fonts/Lato-Italic.woff +0 -0
  97. package/dist/collection/assets/fonts/Lato-Italic.woff2 +0 -0
  98. package/dist/collection/assets/fonts/Lato-Light.ttf +0 -0
  99. package/dist/collection/assets/fonts/Lato-Light.woff +0 -0
  100. package/dist/collection/assets/fonts/Lato-Light.woff2 +0 -0
  101. package/dist/collection/assets/fonts/Lato-LightItalic.ttf +0 -0
  102. package/dist/collection/assets/fonts/Lato-LightItalic.woff +0 -0
  103. package/dist/collection/assets/fonts/Lato-LightItalic.woff2 +0 -0
  104. package/dist/collection/assets/fonts/Lato-Medium.ttf +0 -0
  105. package/dist/collection/assets/fonts/Lato-Medium.woff +0 -0
  106. package/dist/collection/assets/fonts/Lato-Medium.woff2 +0 -0
  107. package/dist/collection/assets/fonts/Lato-MediumItalic.ttf +0 -0
  108. package/dist/collection/assets/fonts/Lato-MediumItalic.woff +0 -0
  109. package/dist/collection/assets/fonts/Lato-MediumItalic.woff2 +0 -0
  110. package/dist/collection/assets/fonts/Lato-Regular.ttf +0 -0
  111. package/dist/collection/assets/fonts/Lato-Regular.woff +0 -0
  112. package/dist/collection/assets/fonts/Lato-Regular.woff2 +0 -0
  113. package/dist/collection/assets/fonts/Lato-Semibold.ttf +0 -0
  114. package/dist/collection/assets/fonts/Lato-Semibold.woff +0 -0
  115. package/dist/collection/assets/fonts/Lato-Semibold.woff2 +0 -0
  116. package/dist/collection/assets/fonts/Lato-SemiboldItalic.ttf +0 -0
  117. package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff +0 -0
  118. package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
  119. package/dist/collection/assets/fonts/Lato-Thin.ttf +0 -0
  120. package/dist/collection/assets/fonts/Lato-Thin.woff +0 -0
  121. package/dist/collection/assets/fonts/Lato-Thin.woff2 +0 -0
  122. package/dist/collection/assets/fonts/Lato-ThinItalic.ttf +0 -0
  123. package/dist/collection/assets/fonts/Lato-ThinItalic.woff +0 -0
  124. package/dist/collection/assets/fonts/Lato-ThinItalic.woff2 +0 -0
  125. package/dist/collection/collection-manifest.json +3 -1
  126. package/dist/collection/components/cat-alert/cat-alert.spec.js +2 -9
  127. package/dist/collection/components/cat-alert/cat-alert.spec.js.map +1 -1
  128. package/dist/collection/components/cat-avatar/cat-avatar.spec.js +3 -7
  129. package/dist/collection/components/cat-avatar/cat-avatar.spec.js.map +1 -1
  130. package/dist/collection/components/cat-badge/cat-badge.spec.js +2 -6
  131. package/dist/collection/components/cat-badge/cat-badge.spec.js.map +1 -1
  132. package/dist/collection/components/cat-button/cat-button.css +29 -0
  133. package/dist/collection/components/cat-button/cat-button.spec.js +1 -1
  134. package/dist/collection/components/cat-button/cat-button.spec.js.map +1 -1
  135. package/dist/collection/components/cat-button-group/cat-button-group.spec.js +2 -6
  136. package/dist/collection/components/cat-button-group/cat-button-group.spec.js.map +1 -1
  137. package/dist/collection/components/cat-card/cat-card.spec.js +2 -6
  138. package/dist/collection/components/cat-card/cat-card.spec.js.map +1 -1
  139. package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js +2 -17
  140. package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js.map +1 -1
  141. package/dist/collection/components/cat-date/cat-date-locale.js +54 -0
  142. package/dist/collection/components/cat-date/cat-date-locale.js.map +1 -0
  143. package/dist/collection/components/cat-date/cat-date-math.js +28 -0
  144. package/dist/collection/components/cat-date/cat-date-math.js.map +1 -0
  145. package/dist/collection/components/cat-date/cat-date.css +122 -0
  146. package/dist/collection/components/cat-date/cat-date.e2e.js +11 -0
  147. package/dist/collection/components/cat-date/cat-date.e2e.js.map +1 -0
  148. package/dist/collection/components/cat-date/cat-date.js +923 -0
  149. package/dist/collection/components/cat-date/cat-date.js.map +1 -0
  150. package/dist/collection/components/cat-date/cat-date.spec.js +16 -0
  151. package/dist/collection/components/cat-date/cat-date.spec.js.map +1 -0
  152. package/dist/collection/components/cat-datepicker/cat-datepicker.js +3 -3
  153. package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js +3 -8
  154. package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js.map +1 -1
  155. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js +2 -2
  156. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js +2 -8
  157. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js.map +1 -1
  158. package/dist/collection/components/cat-dropdown/cat-dropdown.js +100 -30
  159. package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
  160. package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js +2 -8
  161. package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js.map +1 -1
  162. package/dist/collection/components/cat-form-group/cat-form-group.js +1 -1
  163. package/dist/collection/components/cat-form-group/cat-form-group.spec.js +2 -6
  164. package/dist/collection/components/cat-form-group/cat-form-group.spec.js.map +1 -1
  165. package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js +1 -1
  166. package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js.map +1 -1
  167. package/dist/collection/components/cat-icon/cat-icon-registry.js +27 -15
  168. package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -1
  169. package/dist/collection/components/cat-icon/cat-icon.js +1 -1
  170. package/dist/collection/components/cat-icon/cat-icon.spec.js +1 -1
  171. package/dist/collection/components/cat-icon/cat-icon.spec.js.map +1 -1
  172. package/dist/collection/components/cat-input/cat-input.css +15 -0
  173. package/dist/collection/components/cat-input/cat-input.js +44 -6
  174. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  175. package/dist/collection/components/cat-input/cat-input.spec.js +2 -23
  176. package/dist/collection/components/cat-input/cat-input.spec.js.map +1 -1
  177. package/dist/collection/components/cat-pagination/cat-pagination.js +2 -2
  178. package/dist/collection/components/cat-pagination/cat-pagination.spec.js +2 -18
  179. package/dist/collection/components/cat-pagination/cat-pagination.spec.js.map +1 -1
  180. package/dist/collection/components/cat-radio/cat-radio.js +1 -1
  181. package/dist/collection/components/cat-radio/cat-radio.spec.js +3 -13
  182. package/dist/collection/components/cat-radio/cat-radio.spec.js.map +1 -1
  183. package/dist/collection/components/cat-radio-group/cat-radio-group.js +1 -1
  184. package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js +2 -8
  185. package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js.map +1 -1
  186. package/dist/collection/components/cat-scrollable/cat-scrollable.js +3 -3
  187. package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js +2 -13
  188. package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js.map +1 -1
  189. package/dist/collection/components/cat-select/cat-select.js +4 -4
  190. package/dist/collection/components/cat-select/cat-select.spec.js +2 -28
  191. package/dist/collection/components/cat-select/cat-select.spec.js.map +1 -1
  192. package/dist/collection/components/cat-select-demo/cat-select-demo.js +1 -1
  193. package/dist/collection/components/cat-select-demo/cat-select-demo.js.map +1 -1
  194. package/dist/collection/components/cat-skeleton/cat-skeleton.js +1 -1
  195. package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js +2 -6
  196. package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js.map +1 -1
  197. package/dist/collection/components/cat-spinner/cat-spinner.js +2 -2
  198. package/dist/collection/components/cat-spinner/cat-spinner.spec.js +1 -1
  199. package/dist/collection/components/cat-spinner/cat-spinner.spec.js.map +1 -1
  200. package/dist/collection/components/cat-tab/cat-tab.js +1 -1
  201. package/dist/collection/components/cat-tab/cat-tab.spec.js +2 -5
  202. package/dist/collection/components/cat-tab/cat-tab.spec.js.map +1 -1
  203. package/dist/collection/components/cat-tabs/cat-tabs.js +1 -1
  204. package/dist/collection/components/cat-tabs/cat-tabs.spec.js +2 -5
  205. package/dist/collection/components/cat-tabs/cat-tabs.spec.js.map +1 -1
  206. package/dist/collection/components/cat-textarea/cat-textarea.js +3 -3
  207. package/dist/collection/components/cat-textarea/cat-textarea.spec.js +2 -21
  208. package/dist/collection/components/cat-textarea/cat-textarea.spec.js.map +1 -1
  209. package/dist/collection/components/cat-time/cat-time-locale.js +15 -0
  210. package/dist/collection/components/cat-time/cat-time-locale.js.map +1 -0
  211. package/dist/collection/components/cat-time/cat-time-math.js +28 -0
  212. package/dist/collection/components/cat-time/cat-time-math.js.map +1 -0
  213. package/dist/collection/components/cat-time/cat-time.css +41 -0
  214. package/dist/collection/components/cat-time/cat-time.e2e.js +11 -0
  215. package/dist/collection/components/cat-time/cat-time.e2e.js.map +1 -0
  216. package/dist/collection/components/cat-time/cat-time.js +801 -0
  217. package/dist/collection/components/cat-time/cat-time.js.map +1 -0
  218. package/dist/collection/components/cat-time/cat-time.spec.js +16 -0
  219. package/dist/collection/components/cat-time/cat-time.spec.js.map +1 -0
  220. package/dist/collection/components/cat-toggle/cat-toggle.js +1 -1
  221. package/dist/collection/components/cat-toggle/cat-toggle.spec.js +2 -10
  222. package/dist/collection/components/cat-toggle/cat-toggle.spec.js.map +1 -1
  223. package/dist/collection/components/cat-tooltip/cat-tooltip.js +2 -2
  224. package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js +1 -9
  225. package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js.map +1 -1
  226. package/dist/collection/scss/core/_form.scss +12 -3
  227. package/dist/components/cat-button2.js +1 -1
  228. package/dist/components/cat-button2.js.map +1 -1
  229. package/dist/components/cat-date.d.ts +11 -0
  230. package/dist/components/cat-date.js +469 -0
  231. package/dist/components/cat-date.js.map +1 -0
  232. package/dist/components/cat-datepicker-inline.js +2 -2
  233. package/dist/components/cat-datepicker.js +2 -2
  234. package/dist/components/cat-dropdown2.js +35 -30
  235. package/dist/components/cat-dropdown2.js.map +1 -1
  236. package/dist/components/cat-form-group.js +1 -1
  237. package/dist/components/cat-icon-registry.js +33 -18
  238. package/dist/components/cat-icon-registry.js.map +1 -1
  239. package/dist/components/cat-icon2.js +1 -1
  240. package/dist/components/cat-input2.js +1572 -6
  241. package/dist/components/cat-input2.js.map +1 -1
  242. package/dist/components/cat-pagination.js +2 -2
  243. package/dist/components/cat-radio-group.js +1 -1
  244. package/dist/components/cat-radio.js +1 -1
  245. package/dist/components/cat-scrollable2.js +3 -3
  246. package/dist/components/cat-select-demo.js +1 -1
  247. package/dist/components/cat-select-demo.js.map +1 -1
  248. package/dist/components/cat-skeleton2.js +1 -1
  249. package/dist/components/cat-spinner2.js +2 -2
  250. package/dist/components/cat-tab.js +1 -1
  251. package/dist/components/cat-tabs.js +1 -1
  252. package/dist/components/cat-textarea.js +3 -3
  253. package/dist/components/cat-time.d.ts +11 -0
  254. package/dist/components/cat-time.js +303 -0
  255. package/dist/components/cat-time.js.map +1 -0
  256. package/dist/components/cat-toggle.js +1 -1
  257. package/dist/components/cat-tooltip.js +2 -2
  258. package/dist/esm/{cat-alert_26.entry.js → cat-alert_28.entry.js} +2293 -130
  259. package/dist/esm/cat-alert_28.entry.js.map +1 -0
  260. package/dist/esm/catalyst.js +1 -1
  261. package/dist/esm/index.js +2 -2
  262. package/dist/esm/loader.js +1 -1
  263. package/dist/esm/{of-d37c1933.js → of-19888f3b.js} +34 -19
  264. package/dist/esm/of-19888f3b.js.map +1 -0
  265. package/dist/types/components/cat-date/cat-date-locale.d.ts +24 -0
  266. package/dist/types/components/cat-date/cat-date-math.d.ts +7 -0
  267. package/dist/types/components/cat-date/cat-date.d.ts +180 -0
  268. package/dist/types/components/cat-dropdown/cat-dropdown.d.ts +9 -3
  269. package/dist/types/components/cat-input/cat-input.d.ts +9 -2
  270. package/dist/types/components/cat-time/cat-time-locale.d.ts +6 -0
  271. package/dist/types/components/cat-time/cat-time-math.d.ts +3 -0
  272. package/dist/types/components/cat-time/cat-time.d.ts +168 -0
  273. package/dist/types/components.d.ts +551 -8
  274. package/package.json +7 -5
  275. package/dist/catalyst/p-37905c93.entry.js +0 -10
  276. package/dist/catalyst/p-37905c93.entry.js.map +0 -1
  277. package/dist/catalyst/p-8fc7b0f0.js +0 -2
  278. package/dist/catalyst/p-8fc7b0f0.js.map +0 -1
  279. package/dist/cjs/cat-alert_26.cjs.entry.js.map +0 -1
  280. package/dist/cjs/of-a6e7c491.js.map +0 -1
  281. package/dist/esm/cat-alert_26.entry.js.map +0 -1
  282. package/dist/esm/of-d37c1933.js.map +0 -1
@@ -1,18 +1,24 @@
1
- import cross16 from "@haiilo/catalyst-icons/tmp/assets/16-cross.svg";
2
- import alertCircleOutlined from "@haiilo/catalyst-icons/tmp/assets/alert-circle-outlined.svg";
3
- import checkCircleFilled from "@haiilo/catalyst-icons/tmp/assets/check-circle-filled.svg";
4
- import chevronDownOutlined from "@haiilo/catalyst-icons/tmp/assets/chevron-down-outlined.svg";
5
- import chevronLeftOutlined from "@haiilo/catalyst-icons/tmp/assets/chevron-left-outlined.svg";
6
- import chevronRightOutlined from "@haiilo/catalyst-icons/tmp/assets/chevron-right-outlined.svg";
7
- import clockFilled from "@haiilo/catalyst-icons/tmp/assets/clock-filled.svg";
8
- import crossCircleFilled from "@haiilo/catalyst-icons/tmp/assets/cross-circle-filled.svg";
9
- import crossCircleOutlined from "@haiilo/catalyst-icons/tmp/assets/cross-circle-outlined.svg";
10
- import crossOutlined from "@haiilo/catalyst-icons/tmp/assets/cross-outlined.svg";
11
- import dangerFilled from "@haiilo/catalyst-icons/tmp/assets/danger-filled.svg";
12
- import eyeClosedOutlined from "@haiilo/catalyst-icons/tmp/assets/eye-closed-outlined.svg";
13
- import eyeOpenOutlined from "@haiilo/catalyst-icons/tmp/assets/eye-open-outlined.svg";
14
- import infoCircleFilled from "@haiilo/catalyst-icons/tmp/assets/info-circle-filled.svg";
15
- import starCircleFilled from "@haiilo/catalyst-icons/tmp/assets/star-circle-filled.svg";
1
+ import chevronDoubleLeft16 from "@haiilo/catalyst-icons/src/16-chevron-double-left.svg";
2
+ import chevronDoubleRight16 from "@haiilo/catalyst-icons/src/16-chevron-double-right.svg";
3
+ import chevronLeft16 from "@haiilo/catalyst-icons/src/16-chevron-left.svg";
4
+ import chevronRight16 from "@haiilo/catalyst-icons/src/16-chevron-right.svg";
5
+ import cross16 from "@haiilo/catalyst-icons/src/16-cross.svg";
6
+ import alertCircleOutlined from "@haiilo/catalyst-icons/src/alert-circle-outlined.svg";
7
+ import calendarOutlined from "@haiilo/catalyst-icons/src/calendar-outlined.svg";
8
+ import checkCircleFilled from "@haiilo/catalyst-icons/src/check-circle-filled.svg";
9
+ import chevronDownOutlined from "@haiilo/catalyst-icons/src/chevron-down-outlined.svg";
10
+ import chevronLeftOutlined from "@haiilo/catalyst-icons/src/chevron-left-outlined.svg";
11
+ import chevronRightOutlined from "@haiilo/catalyst-icons/src/chevron-right-outlined.svg";
12
+ import clockFilled from "@haiilo/catalyst-icons/src/clock-filled.svg";
13
+ import clockOutlined from "@haiilo/catalyst-icons/src/clock-outlined.svg";
14
+ import crossCircleFilled from "@haiilo/catalyst-icons/src/cross-circle-filled.svg";
15
+ import crossCircleOutlined from "@haiilo/catalyst-icons/src/cross-circle-outlined.svg";
16
+ import crossOutlined from "@haiilo/catalyst-icons/src/cross-outlined.svg";
17
+ import dangerFilled from "@haiilo/catalyst-icons/src/danger-filled.svg";
18
+ import eyeClosedOutlined from "@haiilo/catalyst-icons/src/eye-closed-outlined.svg";
19
+ import eyeOpenOutlined from "@haiilo/catalyst-icons/src/eye-open-outlined.svg";
20
+ import infoCircleFilled from "@haiilo/catalyst-icons/src/info-circle-filled.svg";
21
+ import starCircleFilled from "@haiilo/catalyst-icons/src/star-circle-filled.svg";
16
22
  import log from "loglevel";
17
23
  export class CatIconRegistry {
18
24
  constructor() {
@@ -27,6 +33,12 @@ export class CatIconRegistry {
27
33
  'alert-success': checkCircleFilled,
28
34
  'alert-warning': dangerFilled,
29
35
  'alert-danger': crossCircleFilled,
36
+ 'datepicker-month-prev': chevronLeft16,
37
+ 'datepicker-month-next': chevronRight16,
38
+ 'datepicker-year-prev': chevronDoubleLeft16,
39
+ 'datepicker-year-next': chevronDoubleRight16,
40
+ 'datepicker-calendar': calendarOutlined,
41
+ 'timepicker-clock': clockOutlined,
30
42
  'dialog-close': crossOutlined,
31
43
  'input-close': crossCircleOutlined,
32
44
  'input-error': alertCircleOutlined,
@@ -1 +1 @@
1
- {"version":3,"file":"cat-icon-registry.js","sourceRoot":"","sources":["../../../src/components/cat-icon/cat-icon-registry.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,gDAAgD,CAAC;AACrE,OAAO,mBAAmB,MAAM,6DAA6D,CAAC;AAC9F,OAAO,iBAAiB,MAAM,2DAA2D,CAAC;AAC1F,OAAO,mBAAmB,MAAM,6DAA6D,CAAC;AAC9F,OAAO,mBAAmB,MAAM,6DAA6D,CAAC;AAC9F,OAAO,oBAAoB,MAAM,8DAA8D,CAAC;AAChG,OAAO,WAAW,MAAM,oDAAoD,CAAC;AAC7E,OAAO,iBAAiB,MAAM,2DAA2D,CAAC;AAC1F,OAAO,mBAAmB,MAAM,6DAA6D,CAAC;AAC9F,OAAO,aAAa,MAAM,sDAAsD,CAAC;AACjF,OAAO,YAAY,MAAM,qDAAqD,CAAC;AAC/E,OAAO,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IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;QACvG,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,SAAS,CAAC,IAAY,EAAE,OAAgB;QAC9C,OAAO,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/C,CAAC;IAEO,UAAU,CAAI,IAAY,EAAE,MAAU;QAC5C,OAAO,IAAI,WAAW,CAAC,IAAI,EAAE;YAC3B,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,MAAM;SACP,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC,WAAW,EAAE,CAAC","sourcesContent":["import cross16 from '@haiilo/catalyst-icons/tmp/assets/16-cross.svg';\nimport alertCircleOutlined from '@haiilo/catalyst-icons/tmp/assets/alert-circle-outlined.svg';\nimport checkCircleFilled from '@haiilo/catalyst-icons/tmp/assets/check-circle-filled.svg';\nimport chevronDownOutlined from '@haiilo/catalyst-icons/tmp/assets/chevron-down-outlined.svg';\nimport chevronLeftOutlined from '@haiilo/catalyst-icons/tmp/assets/chevron-left-outlined.svg';\nimport chevronRightOutlined from '@haiilo/catalyst-icons/tmp/assets/chevron-right-outlined.svg';\nimport clockFilled from '@haiilo/catalyst-icons/tmp/assets/clock-filled.svg';\nimport crossCircleFilled from '@haiilo/catalyst-icons/tmp/assets/cross-circle-filled.svg';\nimport crossCircleOutlined from '@haiilo/catalyst-icons/tmp/assets/cross-circle-outlined.svg';\nimport crossOutlined from '@haiilo/catalyst-icons/tmp/assets/cross-outlined.svg';\nimport dangerFilled from '@haiilo/catalyst-icons/tmp/assets/danger-filled.svg';\nimport eyeClosedOutlined from '@haiilo/catalyst-icons/tmp/assets/eye-closed-outlined.svg';\nimport eyeOpenOutlined from '@haiilo/catalyst-icons/tmp/assets/eye-open-outlined.svg';\nimport infoCircleFilled from '@haiilo/catalyst-icons/tmp/assets/info-circle-filled.svg';\nimport starCircleFilled from '@haiilo/catalyst-icons/tmp/assets/star-circle-filled.svg';\nimport log from 'loglevel';\n\nexport class CatIconRegistry {\n private static instance: CatIconRegistry;\n\n private readonly id = (Math.random() + 1).toString(36).substring(2);\n private readonly icons: Map<string, string> = new Map();\n\n private constructor() {\n // hide constructor\n\n // register default icons that are used in the framework by other components\n this.addIcons(\n {\n 'alert-primary': starCircleFilled,\n 'alert-secondary': clockFilled,\n 'alert-info': infoCircleFilled,\n 'alert-success': checkCircleFilled,\n 'alert-warning': dangerFilled,\n 'alert-danger': crossCircleFilled,\n 'dialog-close': crossOutlined,\n 'input-close': crossCircleOutlined,\n 'input-error': alertCircleOutlined,\n 'input-password-show': eyeOpenOutlined,\n 'input-password-hide': eyeClosedOutlined,\n 'notification-close': crossCircleOutlined,\n 'pagination-left': chevronLeftOutlined,\n 'pagination-right': chevronRightOutlined,\n 'select-clear': cross16,\n 'select-open': chevronDownOutlined\n },\n '$cat',\n true\n );\n\n // In rare cases, the registry can be initialized twice. This can happen in\n // a micro frontend architecture where the registry is initialized in the\n // host application and in the micro frontend. To prevent the registry in\n // one application from overwriting the registry in the other, we listen for\n // events that are dispatched when icons are added or removed in other\n // applications and add or remove icons if the event was not dispatched by\n // this registry.\n window.addEventListener('cat-icons-added', event => {\n const { detail } = (event as CustomEvent) || {};\n if (detail && detail.id !== this.id) {\n this.addIcons(detail.icons, detail.setName, true);\n }\n });\n window.addEventListener('cat-icons-removed', event => {\n const { detail } = (event as CustomEvent) || {};\n if (detail && detail.id !== this.id) {\n this.removeIcons(detail.names, detail.setName, true);\n }\n });\n }\n\n static getInstance(): CatIconRegistry {\n if (!CatIconRegistry.instance) {\n CatIconRegistry.instance = new CatIconRegistry();\n }\n return CatIconRegistry.instance;\n }\n\n getIcon(name: string, setName?: string): string | undefined {\n const icon = this.icons.get(this.buildName(name, setName));\n if (!icon) {\n log.error(`[CatIconRegistry::${this.id}] Unknown icon${setName ? ` in set ${setName}` : ''}: ${name}`);\n }\n return icon;\n }\n\n addIcons(icons: { [name: string]: string }, setName?: string, silent = false): CatIconRegistry {\n const iconEntries = Object.entries(icons);\n const iconSize = iconEntries.length;\n iconEntries.forEach(([name, data]) => this.icons.set(this.buildName(name, setName), data));\n log.info(\n `[CatIconRegistry::${this.id}] Added ${iconSize !== 1 ? 'icons' : 'icon'}${setName ? ` to set ${setName}` : ''}`\n );\n !silent && window.dispatchEvent(this.buildEvent('cat-icons-added', { id: this.id, icons, setName }));\n return this;\n }\n\n removeIcons(names: string[], setName?: string, silent = false): CatIconRegistry {\n const iconSize = names.length;\n names.forEach(name => this.icons.delete(this.buildName(name, setName)));\n log.info(\n `[CatIconRegistry::${this.id}] Removed ${iconSize !== 1 ? 'icons' : 'icon'}${\n setName ? ` from set ${setName}` : ''\n }`\n );\n !silent && window.dispatchEvent(this.buildEvent('cat-icons-removed', { id: this.id, names, setName }));\n return this;\n }\n\n private buildName(name: string, setName?: string) {\n return setName ? `${setName}:${name}` : name;\n }\n\n private buildEvent<T>(name: string, detail?: T) {\n return new CustomEvent(name, {\n bubbles: true,\n composed: true,\n detail\n });\n }\n}\n\nexport const catIconRegistry = CatIconRegistry.getInstance();\n"]}
1
+ {"version":3,"file":"cat-icon-registry.js","sourceRoot":"","sources":["../../../src/components/cat-icon/cat-icon-registry.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,uDAAuD,CAAC;AACxF,OAAO,oBAAoB,MAAM,wDAAwD,CAAC;AAC1F,OAAO,aAAa,MAAM,gDAAgD,CAAC;AAC3E,OAAO,cAAc,MAAM,iDAAiD,CAAC;AAC7E,OAAO,OAAO,MAAM,yCAAyC,CAAC;AAC9D,OAAO,mBAAmB,MAAM,sDAAsD,CAAC;AACvF,OAAO,gBAAgB,MAAM,kDAAkD,CAAC;AAChF,OAAO,iBAAiB,MAAM,oDAAoD,CAAC;AACnF,OAAO,mBAAmB,MAAM,sDAAsD,CAAC;AACvF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AAC,MAAM,CAAC;QAC9B,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;QACxE,GAAG,CAAC,IAAI,CACN,qBAAqB,IAAI,CAAC,EAAE,aAAa,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,GACxE,OAAO,CAAC,CAAC,CAAC,aAAa,OAAO,EAAE,CAAC,CAAC,CAAC,EACrC,EAAE,CACH,CAAC;QACF,CAAC,MAAM,IAAI,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;QACvG,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,SAAS,CAAC,IAAY,EAAE,OAAgB;QAC9C,OAAO,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/C,CAAC;IAEO,UAAU,CAAI,IAAY,EAAE,MAAU;QAC5C,OAAO,IAAI,WAAW,CAAC,IAAI,EAAE;YAC3B,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,MAAM;SACP,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC,WAAW,EAAE,CAAC","sourcesContent":["import chevronDoubleLeft16 from '@haiilo/catalyst-icons/src/16-chevron-double-left.svg';\nimport chevronDoubleRight16 from '@haiilo/catalyst-icons/src/16-chevron-double-right.svg';\nimport chevronLeft16 from '@haiilo/catalyst-icons/src/16-chevron-left.svg';\nimport chevronRight16 from '@haiilo/catalyst-icons/src/16-chevron-right.svg';\nimport cross16 from '@haiilo/catalyst-icons/src/16-cross.svg';\nimport alertCircleOutlined from '@haiilo/catalyst-icons/src/alert-circle-outlined.svg';\nimport calendarOutlined from '@haiilo/catalyst-icons/src/calendar-outlined.svg';\nimport checkCircleFilled from '@haiilo/catalyst-icons/src/check-circle-filled.svg';\nimport chevronDownOutlined from '@haiilo/catalyst-icons/src/chevron-down-outlined.svg';\nimport chevronLeftOutlined from '@haiilo/catalyst-icons/src/chevron-left-outlined.svg';\nimport chevronRightOutlined from '@haiilo/catalyst-icons/src/chevron-right-outlined.svg';\nimport clockFilled from '@haiilo/catalyst-icons/src/clock-filled.svg';\nimport clockOutlined from '@haiilo/catalyst-icons/src/clock-outlined.svg';\nimport crossCircleFilled from '@haiilo/catalyst-icons/src/cross-circle-filled.svg';\nimport crossCircleOutlined from '@haiilo/catalyst-icons/src/cross-circle-outlined.svg';\nimport crossOutlined from '@haiilo/catalyst-icons/src/cross-outlined.svg';\nimport dangerFilled from '@haiilo/catalyst-icons/src/danger-filled.svg';\nimport eyeClosedOutlined from '@haiilo/catalyst-icons/src/eye-closed-outlined.svg';\nimport eyeOpenOutlined from '@haiilo/catalyst-icons/src/eye-open-outlined.svg';\nimport infoCircleFilled from '@haiilo/catalyst-icons/src/info-circle-filled.svg';\nimport starCircleFilled from '@haiilo/catalyst-icons/src/star-circle-filled.svg';\nimport log from 'loglevel';\n\nexport class CatIconRegistry {\n private static instance: CatIconRegistry;\n\n private readonly id = (Math.random() + 1).toString(36).substring(2);\n private readonly icons: Map<string, string> = new Map();\n\n private constructor() {\n // hide constructor\n\n // register default icons that are used in the framework by other components\n this.addIcons(\n {\n 'alert-primary': starCircleFilled,\n 'alert-secondary': clockFilled,\n 'alert-info': infoCircleFilled,\n 'alert-success': checkCircleFilled,\n 'alert-warning': dangerFilled,\n 'alert-danger': crossCircleFilled,\n 'datepicker-month-prev': chevronLeft16,\n 'datepicker-month-next': chevronRight16,\n 'datepicker-year-prev': chevronDoubleLeft16,\n 'datepicker-year-next': chevronDoubleRight16,\n 'datepicker-calendar': calendarOutlined,\n 'timepicker-clock': clockOutlined,\n 'dialog-close': crossOutlined,\n 'input-close': crossCircleOutlined,\n 'input-error': alertCircleOutlined,\n 'input-password-show': eyeOpenOutlined,\n 'input-password-hide': eyeClosedOutlined,\n 'notification-close': crossCircleOutlined,\n 'pagination-left': chevronLeftOutlined,\n 'pagination-right': chevronRightOutlined,\n 'select-clear': cross16,\n 'select-open': chevronDownOutlined\n },\n '$cat',\n true\n );\n\n // In rare cases, the registry can be initialized twice. This can happen in\n // a micro frontend architecture where the registry is initialized in the\n // host application and in the micro frontend. To prevent the registry in\n // one application from overwriting the registry in the other, we listen for\n // events that are dispatched when icons are added or removed in other\n // applications and add or remove icons if the event was not dispatched by\n // this registry.\n window.addEventListener('cat-icons-added', event => {\n const { detail } = (event as CustomEvent) || {};\n if (detail && detail.id !== this.id) {\n this.addIcons(detail.icons, detail.setName, true);\n }\n });\n window.addEventListener('cat-icons-removed', event => {\n const { detail } = (event as CustomEvent) || {};\n if (detail && detail.id !== this.id) {\n this.removeIcons(detail.names, detail.setName, true);\n }\n });\n }\n\n static getInstance(): CatIconRegistry {\n if (!CatIconRegistry.instance) {\n CatIconRegistry.instance = new CatIconRegistry();\n }\n return CatIconRegistry.instance;\n }\n\n getIcon(name: string, setName?: string): string | undefined {\n const icon = this.icons.get(this.buildName(name, setName));\n if (!icon) {\n log.error(`[CatIconRegistry::${this.id}] Unknown icon${setName ? ` in set ${setName}` : ''}: ${name}`);\n }\n return icon;\n }\n\n addIcons(icons: { [name: string]: string }, setName?: string, silent = false): CatIconRegistry {\n const iconEntries = Object.entries(icons);\n const iconSize = iconEntries.length;\n iconEntries.forEach(([name, data]) => this.icons.set(this.buildName(name, setName), data));\n log.info(\n `[CatIconRegistry::${this.id}] Added ${iconSize !== 1 ? 'icons' : 'icon'}${setName ? ` to set ${setName}` : ''}`\n );\n !silent && window.dispatchEvent(this.buildEvent('cat-icons-added', { id: this.id, icons, setName }));\n return this;\n }\n\n removeIcons(names: string[], setName?: string, silent = false): CatIconRegistry {\n const iconSize = names.length;\n names.forEach(name => this.icons.delete(this.buildName(name, setName)));\n log.info(\n `[CatIconRegistry::${this.id}] Removed ${iconSize !== 1 ? 'icons' : 'icon'}${\n setName ? ` from set ${setName}` : ''\n }`\n );\n !silent && window.dispatchEvent(this.buildEvent('cat-icons-removed', { id: this.id, names, setName }));\n return this;\n }\n\n private buildName(name: string, setName?: string) {\n return setName ? `${setName}:${name}` : name;\n }\n\n private buildEvent<T>(name: string, detail?: T) {\n return new CustomEvent(name, {\n bubbles: true,\n composed: true,\n detail\n });\n }\n}\n\nexport const catIconRegistry = CatIconRegistry.getInstance();\n"]}
@@ -14,7 +14,7 @@ export class CatIcon {
14
14
  this.a11yLabel = undefined;
15
15
  }
16
16
  render() {
17
- return (h("span", { key: 'f7ef8a40c1fe37966b886ef9cd1a726a536dd08b', innerHTML: this.iconSrc || (this.icon ? icons.getIcon(this.icon) : ''), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
17
+ return (h("span", { key: 'ace2ec39a623d9c8168269a5b4c46c4efef2fbc7', innerHTML: this.iconSrc || (this.icon ? icons.getIcon(this.icon) : ''), "aria-label": this.a11yLabel, "aria-hidden": this.a11yLabel ? null : 'true', part: "icon", class: {
18
18
  icon: true,
19
19
  [`icon-${this.size}`]: this.size !== 'inline'
20
20
  } }));
@@ -7,7 +7,7 @@ describe('cat-icon', () => {
7
7
  components: [CatIcon],
8
8
  html: `<cat-icon icon="icon"></cat-icon>`
9
9
  });
10
- expect(page.root?.shadowRoot).toEqualHtml(`
10
+ expect(page.root?.shadowRoot).toEqualLightHtml(`
11
11
  <span aria-hidden="true" class="icon icon-m" part="icon"></span>
12
12
  `);
13
13
  });
@@ -1 +1 @@
1
- {"version":3,"file":"cat-icon.spec.js","sourceRoot":"","sources":["../../../src/components/cat-icon/cat-icon.spec.tsx"],"names":[],"mappings":"AAAA,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,OAAO,CAAC;YACrB,IAAI,EAAE,mCAAmC;SAC1C,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,WAAW,CAAC;;KAEzC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["jest.mock('./cat-icon-registry');\nimport { newSpecPage } from '@stencil/core/testing';\nimport { CatIcon } from './cat-icon';\n\ndescribe('cat-icon', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatIcon],\n html: `<cat-icon icon=\"icon\"></cat-icon>`\n });\n expect(page.root?.shadowRoot).toEqualHtml(`\n <span aria-hidden=\"true\" class=\"icon icon-m\" part=\"icon\"></span>\n `);\n });\n});\n"]}
1
+ {"version":3,"file":"cat-icon.spec.js","sourceRoot":"","sources":["../../../src/components/cat-icon/cat-icon.spec.tsx"],"names":[],"mappings":"AAAA,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,OAAO,CAAC;YACrB,IAAI,EAAE,mCAAmC;SAC1C,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,gBAAgB,CAAC;;KAE9C,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["jest.mock('./cat-icon-registry');\nimport { newSpecPage } from '@stencil/core/testing';\nimport { CatIcon } from './cat-icon';\n\ndescribe('cat-icon', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatIcon],\n html: `<cat-icon icon=\"icon\"></cat-icon>`\n });\n expect(page.root?.shadowRoot).toEqualLightHtml(`\n <span aria-hidden=\"true\" class=\"icon icon-m\" part=\"icon\"></span>\n `);\n });\n});\n"]}
@@ -474,6 +474,7 @@
474
474
  }
475
475
 
476
476
  .input-wrapper {
477
+ flex: 1 1 auto;
477
478
  display: flex;
478
479
  align-items: stretch;
479
480
  gap: 0.75rem;
@@ -506,6 +507,9 @@
506
507
  outline: 2px solid rgb(var(--cat-border-color-focus, 0, 113, 255));
507
508
  outline-offset: -1px;
508
509
  }
510
+ .input-wrapper:focus-within:has(.clearable:focus) {
511
+ outline: none;
512
+ }
509
513
  .input-wrapper.input-invalid {
510
514
  --border-color: var(--cat-danger-bg, 217, 52, 13), 0.2;
511
515
  }
@@ -539,6 +543,10 @@
539
543
  align-self: center;
540
544
  }
541
545
 
546
+ .input-outer-wrapper {
547
+ display: flex;
548
+ }
549
+
542
550
  .input-inner-wrapper {
543
551
  display: flex;
544
552
  align-items: center;
@@ -593,4 +601,11 @@ input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:foc
593
601
  }
594
602
  .has-clearable ~ .toggle-password {
595
603
  right: 1.5rem;
604
+ }
605
+
606
+ :host(.cat-date-input) .input-wrapper,
607
+ :host(.cat-time-input) .input-wrapper {
608
+ z-index: 1;
609
+ border-top-right-radius: 0;
610
+ border-bottom-right-radius: 0;
596
611
  }
@@ -1,4 +1,5 @@
1
1
  import { h } from "@stencil/core";
2
+ import Cleave from "cleave.js";
2
3
  import log from "loglevel";
3
4
  import { coerceBoolean, coerceNumber } from "../../utils/coerce";
4
5
  import { CatFormHint } from "../cat-form-hint/cat-form-hint";
@@ -91,6 +92,14 @@ export class CatInput {
91
92
  this.value = '';
92
93
  this.catChange.emit(this.value);
93
94
  }
95
+ /**
96
+ * Adds a Cleave.js mask to the input.
97
+ *
98
+ * @param options The Cleave.js options.
99
+ */
100
+ async mask(options) {
101
+ new Cleave(this.input, options);
102
+ }
94
103
  onErrorsChanged(value) {
95
104
  if (!coerceBoolean(this.errorUpdate)) {
96
105
  this.errorMap = undefined;
@@ -105,19 +114,19 @@ export class CatInput {
105
114
  }
106
115
  }
107
116
  render() {
108
- return (h("div", { key: 'fe89677c5a5768818b2ac9b1536cb50c2cde2edd', class: {
117
+ return (h("div", { key: 'aab57f9704562874b2dee392630c473fc31a33cb', class: {
109
118
  'input-field': true,
110
119
  'input-horizontal': this.horizontal
111
- } }, h("div", { key: '92aaf9f42e27da513f87648888551f221bb45d52', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { htmlFor: this.id, part: "label" }, h("span", { class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label, h("div", { class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", i18n.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", i18n.t('input.required'), ")")), this.maxLength && (h("div", { class: "label-character-count", "aria-hidden": "true" }, this.value?.toString().length ?? 0, "/", this.maxLength))))))), h("div", { key: '24008f6704d6108ae439ba96507bf45db7b38978', class: "input-container" }, h("div", { key: 'fd329b7aff321121d771b325ff59a51668d5ad70', class: {
120
+ } }, h("div", { key: 'f599b443389362d9eb3ee72d496d225ca2a8bf8d', class: { 'label-container': true, hidden: this.labelHidden } }, (this.hasSlottedLabel || this.label) && (h("label", { htmlFor: this.id, part: "label" }, h("span", { class: "label-wrapper" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label, h("div", { class: "label-metadata" }, !this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", i18n.t('input.optional'), ")")), this.required && this.requiredMarker?.startsWith('required') && (h("span", { class: "label-optional", "aria-hidden": "true" }, "(", i18n.t('input.required'), ")")), this.maxLength && (h("div", { class: "label-character-count", "aria-hidden": "true" }, this.value?.toString().length ?? 0, "/", this.maxLength))))))), h("div", { key: 'ddce0aaa854e32ae4b8a8686a3886089beac6300', class: "input-container" }, h("div", { key: '25eb9aa776ba2cee97fb2bf79bc52d5c44c54b55', class: "input-outer-wrapper" }, h("div", { key: '7cd420c3525b8e15a7c0f2d8405cdd70f2e5291c', class: {
112
121
  'input-wrapper': true,
113
122
  'input-round': this.round,
114
123
  'input-readonly': this.readonly,
115
124
  'input-disabled': this.disabled,
116
125
  'input-invalid': this.invalid
117
- }, onClick: () => this.input.focus() }, this.textPrefix && (h("span", { class: "text-prefix", part: "prefix" }, this.textPrefix)), this.icon && !this.iconRight && (h("cat-icon", { icon: this.icon, class: "icon-prefix", size: "l", onClick: () => this.doFocus() })), h("div", { key: '0a6fcef52829bd6429ca419a544a64fe68779afa', class: "input-inner-wrapper" }, h("input", { key: '43a4affa77f7f8f75b52da2cc553f20096519000', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.id, class: {
126
+ }, onClick: () => this.input.focus() }, this.textPrefix && (h("span", { class: "text-prefix", part: "prefix" }, this.textPrefix)), this.icon && !this.iconRight && (h("cat-icon", { icon: this.icon, class: "icon-prefix", size: "l", onClick: () => this.doFocus() })), h("div", { key: '7f0c24c572ddfb4a1f76457955b28c111c1b444a', class: "input-inner-wrapper" }, h("input", { key: 'fcef418a1eb7c5d54f47e239f8db0cf52f23d3f7', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.id, class: {
118
127
  'has-clearable': this.clearable && !this.disabled && !this.readonly && !!this.value,
119
128
  'has-toggle-password': this.togglePassword && !this.disabled && !this.readonly && !!this.value
120
- }, autocomplete: this.autoComplete, disabled: this.disabled, max: this.max, maxlength: this.maxLength, min: this.min, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, type: this.isPasswordShown ? 'text' : this.type, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), this.clearable && !this.disabled && !this.readonly && this.value && (h("cat-button", { class: "clearable", icon: "$cat:input-close", "icon-only": "true", size: "s", variant: "text", "a11y-label": i18n.t('input.clear'), onClick: this.clear.bind(this), "data-dropdown-no-close": true })), this.togglePassword && !this.disabled && !this.readonly && this.value && (h("cat-button", { class: "toggle-password", icon: this.isPasswordShown ? '$cat:input-password-hide' : '$cat:input-password-show', "icon-only": "true", size: "s", variant: "text", "a11y-label": i18n.t(this.isPasswordShown ? 'input.hidePassword' : 'input.showPassword'), onClick: this.doTogglePassword.bind(this) }))), !this.invalid && this.icon && this.iconRight && (h("cat-icon", { icon: this.icon, class: "icon-suffix", size: "l", onClick: () => this.doFocus() })), this.invalid && h("cat-icon", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" }), this.textSuffix && (h("span", { class: "text-suffix", part: "suffix" }, this.textSuffix))), this.hasHint && (h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap })))));
129
+ }, autocomplete: this.autoComplete, disabled: this.disabled, max: this.max, maxlength: this.maxLength, min: this.min, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, type: this.isPasswordShown ? 'text' : this.type, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), this.clearable && !this.disabled && !this.readonly && this.value && (h("cat-button", { class: "clearable", icon: "$cat:input-close", "icon-only": "true", size: "s", variant: "text", "a11y-label": i18n.t('input.clear'), onClick: this.clear.bind(this), "data-dropdown-no-close": true })), this.togglePassword && !this.disabled && !this.readonly && this.value && (h("cat-button", { class: "toggle-password", icon: this.isPasswordShown ? '$cat:input-password-hide' : '$cat:input-password-show', "icon-only": "true", size: "s", variant: "text", "a11y-label": i18n.t(this.isPasswordShown ? 'input.hidePassword' : 'input.showPassword'), onClick: this.doTogglePassword.bind(this) }))), !this.invalid && this.icon && this.iconRight && (h("cat-icon", { icon: this.icon, class: "icon-suffix", size: "l", onClick: () => this.doFocus() })), this.invalid && (h("cat-icon", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l" })), this.textSuffix && (h("span", { class: "text-suffix", part: "suffix" }, this.textSuffix))), h("slot", { key: '3c3ff6368c631ae0634a7d0b875cb0d6a69edcba', name: "addon" })), this.hasHint && (h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap })))));
121
130
  }
122
131
  get hasHint() {
123
132
  return !!this.hint || !!this.hasSlottedHint || this.invalid;
@@ -407,7 +416,7 @@ export class CatInput {
407
416
  "optional": true,
408
417
  "docs": {
409
418
  "tags": [],
410
- "text": "A maximum value for date, time and numeric values."
419
+ "text": "A maximum value for numeric values."
411
420
  },
412
421
  "attribute": "max",
413
422
  "reflect": false
@@ -441,7 +450,7 @@ export class CatInput {
441
450
  "optional": true,
442
451
  "docs": {
443
452
  "tags": [],
444
- "text": "A minimum value for date, time and numeric values."
453
+ "text": "A minimum value for numeric values."
445
454
  },
446
455
  "attribute": "min",
447
456
  "reflect": false
@@ -813,6 +822,35 @@ export class CatInput {
813
822
  "text": "Clear the input.",
814
823
  "tags": []
815
824
  }
825
+ },
826
+ "mask": {
827
+ "complexType": {
828
+ "signature": "(options: CleaveOptions) => Promise<void>",
829
+ "parameters": [{
830
+ "name": "options",
831
+ "type": "CleaveOptions",
832
+ "docs": "The Cleave.js options."
833
+ }],
834
+ "references": {
835
+ "Promise": {
836
+ "location": "global",
837
+ "id": "global::Promise"
838
+ },
839
+ "CleaveOptions": {
840
+ "location": "import",
841
+ "path": "cleave.js/options",
842
+ "id": "../node_modules/.pnpm/@types+cleave.js@1.4.12/node_modules/@types/cleave.js/options/index.d.ts::CleaveOptions"
843
+ }
844
+ },
845
+ "return": "Promise<void>"
846
+ },
847
+ "docs": {
848
+ "text": "Adds a Cleave.js mask to the input.",
849
+ "tags": [{
850
+ "name": "param",
851
+ "text": "options The Cleave.js options."
852
+ }]
853
+ }
816
854
  }
817
855
  };
818
856
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cat-input.js","sourceRoot":"","sources":["../../../src/components/cat-input/cat-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAY,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAGxE,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;;;;;;;GAWG;AAMH,MAAM,OAAO,QAAQ;;QACF,QAAG,GAAG,aAAa,YAAY,EAAE,EAAE,CAAC;+BAU1B,KAAK;8BAEN,KAAK;+BAEJ,KAAK;;8BAOkE,UAAU;0BAKvF,KAAK;;yBAUN,KAAK;8BAKA,KAAK;wBAKX,KAAK;;;yBAeJ,KAAK;;qBAUT,EAAE;2BAKI,KAAK;;;;;;;;;wBA6CR,KAAK;wBAKL,KAAK;qBAKR,KAAK;oBAKK,MAAM;;;2BAsBQ,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport log from 'loglevel';\nimport { coerceBoolean, coerceNumber } from '../../utils/coerce';\nimport { CatFormHint, ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\nimport { InputType } from './input-type';\n\nlet nextUniqueId = 0;\n\n/**\n * Inputs are used to allow users to provide text input when the expected input\n * is short. As well as plain text, Input supports various types of text,\n * including passwords and numbers.\n *\n * @slot hint - Optional hint element to be displayed with the input.\n * @slot label - The slotted label. If both the label property and the label slot are present, only the label slot will be displayed.\n * @part label - The native label element.\n * @part input - The native input element.\n * @part prefix - The text prefix.\n * @part suffix - The text suffix.\n */\n@Component({\n tag: 'cat-input',\n styleUrl: 'cat-input.scss',\n shadow: true\n})\nexport class CatInput {\n private readonly _id = `cat-input-${nextUniqueId++}`;\n private get id() {\n return this.identifier || this._id;\n }\n\n private input!: HTMLInputElement;\n private errorMapSrc?: ErrorMap;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n @State() hasSlottedHint = false;\n\n @State() isPasswordShown = false;\n\n @State() errorMap?: ErrorMap;\n\n /**\n * Whether the label need a marker to shown if the input is required or optional.\n */\n @Prop() requiredMarker?: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!' = 'optional';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * Hint for form autofill feature.\n */\n @Prop() autoComplete?: string;\n\n /**\n * Whether the input should show a clear button.\n */\n @Prop() clearable = false;\n\n /**\n * Whether the input should show a password toggle button for password inputs.\n */\n @Prop() togglePassword = false;\n\n /**\n * Whether the input is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text(s) to be displayed with the input.\n */\n @Prop() hint?: string | string[];\n\n /**\n * The name of an icon to be displayed in the input.\n */\n @Prop() icon?: string;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label for the input.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * A maximum value for date, time and numeric values.\n */\n @Prop() max?: number | string;\n\n /**\n * A maximum length (number of characters) for textual values.\n */\n @Prop() maxLength?: number;\n\n /**\n * A minimum value for date, time and numeric values.\n */\n @Prop() min?: number | string;\n\n /**\n * A minimum length (number of characters) for textual values.\n */\n @Prop() minLength?: number;\n\n /**\n * The name of the form control. Submitted with the form as part of a name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * The placeholder text to display within the input.\n */\n @Prop() placeholder?: string;\n\n /**\n * A textual prefix to be displayed in the input.\n */\n @Prop() textPrefix?: string;\n\n /**\n * A textual suffix to be displayed in the input.\n */\n @Prop() textSuffix?: string;\n\n /**\n * The value is not editable.\n */\n @Prop() readonly = false;\n\n /**\n * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * Use round input edges.\n */\n @Prop() round = false;\n\n /**\n * Type of form control.\n */\n @Prop() type: InputType = 'text';\n\n /**\n * The value of the control.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The validation errors for this input. Will render a hint under the input\n * with the translated error message(s) `error.${key}`. If an object is\n * passed, the keys will be used as error keys and the values translation\n * parameters.\n * If the value is `true`, the input will be marked as invalid without any\n * hints under the input.\n */\n @Prop() errors?: boolean | string[] | ErrorMap;\n\n /**\n * Fine-grained control over when the errors are shown. Can be `false` to\n * never show errors, `true` to show errors on blur, or a number to show\n * errors on change with the given delay in milliseconds.\n */\n @Prop() errorUpdate: boolean | number = 0;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter<string>;\n\n /**\n * Emitted when the input received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillRender(): void {\n this.onErrorsChanged(this.errors);\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.warn('[A11y] Missing ARIA label on input', this);\n }\n }\n\n /**\n * Programmatically move focus to the input. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n // hack to make datepicker inputs focusable. The datepicker hides the input\n // element and dynamically creates a sibling. We need to find the new input\n // element and focus it instead.\n const input = this.input.type === 'hidden' ? this.findSiblingInput(this.input.nextSibling) : this.input;\n input?.focus(options);\n }\n\n /**\n * Programmatically remove focus from the input. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input.blur();\n }\n\n /**\n * Clear the input.\n */\n @Method()\n async clear(): Promise<void> {\n this.value = '';\n this.catChange.emit(this.value);\n }\n\n @Watch('errors')\n onErrorsChanged(value?: boolean | string[] | ErrorMap) {\n if (!coerceBoolean(this.errorUpdate)) {\n this.errorMap = undefined;\n } else {\n this.errorMapSrc = Array.isArray(value)\n ? (value as string[]).reduce((acc, err) => ({ ...acc, [err]: undefined }), {})\n : value === true\n ? {}\n : value || undefined;\n this.showErrorsIfTimeout() || this.showErrorsIfNoFocus();\n }\n }\n\n render() {\n return (\n <div\n class={{\n 'input-field': true,\n 'input-horizontal': this.horizontal\n }}\n >\n <div class={{ 'label-container': true, hidden: this.labelHidden }}>\n {(this.hasSlottedLabel || this.label) && (\n <label htmlFor={this.id} part=\"label\">\n <span class=\"label-wrapper\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n <div class=\"label-metadata\">\n {!this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.optional')})\n </span>\n )}\n {this.required && this.requiredMarker?.startsWith('required') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.required')})\n </span>\n )}\n {this.maxLength && (\n <div class=\"label-character-count\" aria-hidden=\"true\">\n {this.value?.toString().length ?? 0}/{this.maxLength}\n </div>\n )}\n </div>\n </span>\n </label>\n )}\n </div>\n <div class=\"input-container\">\n <div\n class={{\n 'input-wrapper': true,\n 'input-round': this.round,\n 'input-readonly': this.readonly,\n 'input-disabled': this.disabled,\n 'input-invalid': this.invalid\n }}\n onClick={() => this.input.focus()}\n >\n {this.textPrefix && (\n <span class=\"text-prefix\" part=\"prefix\">\n {this.textPrefix}\n </span>\n )}\n {this.icon && !this.iconRight && (\n <cat-icon icon={this.icon} class=\"icon-prefix\" size=\"l\" onClick={() => this.doFocus()}></cat-icon>\n )}\n <div class=\"input-inner-wrapper\">\n <input\n {...this.nativeAttributes}\n part=\"input\"\n ref={el => (this.input = el as HTMLInputElement)}\n id={this.id}\n class={{\n 'has-clearable': this.clearable && !this.disabled && !this.readonly && !!this.value,\n 'has-toggle-password': this.togglePassword && !this.disabled && !this.readonly && !!this.value\n }}\n autocomplete={this.autoComplete}\n disabled={this.disabled}\n max={this.max}\n maxlength={this.maxLength}\n min={this.min}\n minlength={this.minLength}\n name={this.name}\n placeholder={this.placeholder}\n readonly={this.readonly}\n required={this.required}\n type={this.isPasswordShown ? 'text' : this.type}\n value={this.value}\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n aria-invalid={this.invalid ? 'true' : undefined}\n aria-describedby={this.hasHint ? this.id + '-hint' : undefined}\n ></input>\n {this.clearable && !this.disabled && !this.readonly && this.value && (\n <cat-button\n class=\"clearable\"\n icon=\"$cat:input-close\"\n icon-only=\"true\"\n size=\"s\"\n variant=\"text\"\n a11y-label={i18n.t('input.clear')}\n onClick={this.clear.bind(this)}\n data-dropdown-no-close\n ></cat-button>\n )}\n {this.togglePassword && !this.disabled && !this.readonly && this.value && (\n <cat-button\n class=\"toggle-password\"\n icon={this.isPasswordShown ? '$cat:input-password-hide' : '$cat:input-password-show'}\n icon-only=\"true\"\n size=\"s\"\n variant=\"text\"\n a11y-label={i18n.t(this.isPasswordShown ? 'input.hidePassword' : 'input.showPassword')}\n onClick={this.doTogglePassword.bind(this)}\n ></cat-button>\n )}\n </div>\n {!this.invalid && this.icon && this.iconRight && (\n <cat-icon icon={this.icon} class=\"icon-suffix\" size=\"l\" onClick={() => this.doFocus()}></cat-icon>\n )}\n {this.invalid && <cat-icon icon=\"$cat:input-error\" class=\"icon-suffix cat-text-danger\" size=\"l\"></cat-icon>}\n {this.textSuffix && (\n <span class=\"text-suffix\" part=\"suffix\">\n {this.textSuffix}\n </span>\n )}\n </div>\n {this.hasHint && (\n <CatFormHint\n id={this.id}\n hint={this.hint}\n slottedHint={this.hasSlottedHint && <slot name=\"hint\"></slot>}\n errorMap={this.errorMap}\n />\n )}\n </div>\n </div>\n );\n }\n\n private get hasHint() {\n return !!this.hint || !!this.hasSlottedHint || this.invalid;\n }\n\n private get invalid() {\n return !!Object.keys(this.errorMap || {}).length;\n }\n\n private onInput() {\n this.value = this.input.value;\n this.catChange.emit(this.value);\n this.showErrorsIfTimeout();\n }\n\n private onFocus(event: FocusEvent) {\n this.catFocus.emit(event);\n }\n\n private onBlur(event: FocusEvent) {\n this.catBlur.emit(event);\n if (coerceBoolean(this.errorUpdate)) {\n this.showErrors();\n }\n }\n\n private doTogglePassword() {\n this.isPasswordShown = !this.isPasswordShown;\n }\n\n private showErrors() {\n this.errorMap = this.errorMapSrc;\n }\n\n private errorUpdateTimeoutId?: number;\n private showErrorsIfTimeout() {\n const errorUpdate = coerceNumber(this.errorUpdate, null);\n if (errorUpdate !== null) {\n typeof this.errorUpdateTimeoutId === 'number' && window.clearTimeout(this.errorUpdateTimeoutId);\n this.errorUpdateTimeoutId = window.setTimeout(() => this.showErrors(), errorUpdate);\n return true;\n }\n return false;\n }\n\n private showErrorsIfNoFocus() {\n const hasFocus = document.activeElement === this.hostElement || document.activeElement === this.input;\n if (!hasFocus) {\n this.showErrors();\n }\n }\n\n private findSiblingInput(node: Node | null): HTMLInputElement | undefined {\n if (node instanceof HTMLInputElement) {\n return node;\n } else if (node?.nextSibling) {\n return this.findSiblingInput(node.nextSibling);\n }\n return undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"cat-input.js","sourceRoot":"","sources":["../../../src/components/cat-input/cat-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAY,MAAM,gCAAgC,CAAC;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;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport Cleave from 'cleave.js';\nimport type { CleaveOptions } from 'cleave.js/options';\nimport log from 'loglevel';\nimport { coerceBoolean, coerceNumber } from '../../utils/coerce';\nimport { CatFormHint, ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\nimport { InputType } from './input-type';\n\nlet nextUniqueId = 0;\n\n/**\n * Inputs are used to allow users to provide text input when the expected input\n * is short. As well as plain text, Input supports various types of text,\n * including passwords and numbers.\n *\n * @slot hint - Optional hint element to be displayed with the input.\n * @slot label - The slotted label. If both the label property and the label slot are present, only the label slot will be displayed.\n * @part label - The native label element.\n * @part input - The native input element.\n * @part prefix - The text prefix.\n * @part suffix - The text suffix.\n */\n@Component({\n tag: 'cat-input',\n styleUrl: 'cat-input.scss',\n shadow: true\n})\nexport class CatInput {\n private readonly _id = `cat-input-${nextUniqueId++}`;\n private get id() {\n return this.identifier || this._id;\n }\n\n private input!: HTMLInputElement;\n private errorMapSrc?: ErrorMap;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n @State() hasSlottedHint = false;\n\n @State() isPasswordShown = false;\n\n @State() errorMap?: ErrorMap;\n\n /**\n * Whether the label need a marker to shown if the input is required or optional.\n */\n @Prop() requiredMarker?: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!' = 'optional';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * Hint for form autofill feature.\n */\n @Prop() autoComplete?: string;\n\n /**\n * Whether the input should show a clear button.\n */\n @Prop() clearable = false;\n\n /**\n * Whether the input should show a password toggle button for password inputs.\n */\n @Prop() togglePassword = false;\n\n /**\n * Whether the input is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text(s) to be displayed with the input.\n */\n @Prop() hint?: string | string[];\n\n /**\n * The name of an icon to be displayed in the input.\n */\n @Prop() icon?: string;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label for the input.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * A maximum value for numeric values.\n */\n @Prop() max?: number | string;\n\n /**\n * A maximum length (number of characters) for textual values.\n */\n @Prop() maxLength?: number;\n\n /**\n * A minimum value for numeric values.\n */\n @Prop() min?: number | string;\n\n /**\n * A minimum length (number of characters) for textual values.\n */\n @Prop() minLength?: number;\n\n /**\n * The name of the form control. Submitted with the form as part of a name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * The placeholder text to display within the input.\n */\n @Prop() placeholder?: string;\n\n /**\n * A textual prefix to be displayed in the input.\n */\n @Prop() textPrefix?: string;\n\n /**\n * A textual suffix to be displayed in the input.\n */\n @Prop() textSuffix?: string;\n\n /**\n * The value is not editable.\n */\n @Prop() readonly = false;\n\n /**\n * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * Use round input edges.\n */\n @Prop() round = false;\n\n /**\n * Type of form control.\n */\n @Prop() type: InputType = 'text';\n\n /**\n * The value of the control.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The validation errors for this input. Will render a hint under the input\n * with the translated error message(s) `error.${key}`. If an object is\n * passed, the keys will be used as error keys and the values translation\n * parameters.\n * If the value is `true`, the input will be marked as invalid without any\n * hints under the input.\n */\n @Prop() errors?: boolean | string[] | ErrorMap;\n\n /**\n * Fine-grained control over when the errors are shown. Can be `false` to\n * never show errors, `true` to show errors on blur, or a number to show\n * errors on change with the given delay in milliseconds.\n */\n @Prop() errorUpdate: boolean | number = 0;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter<string>;\n\n /**\n * Emitted when the input received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillRender(): void {\n this.onErrorsChanged(this.errors);\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.warn('[A11y] Missing ARIA label on input', this);\n }\n }\n\n /**\n * Programmatically move focus to the input. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n // hack to make datepicker inputs focusable. The datepicker hides the input\n // element and dynamically creates a sibling. We need to find the new input\n // element and focus it instead.\n const input = this.input.type === 'hidden' ? this.findSiblingInput(this.input.nextSibling) : this.input;\n input?.focus(options);\n }\n\n /**\n * Programmatically remove focus from the input. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.input.blur();\n }\n\n /**\n * Clear the input.\n */\n @Method()\n async clear(): Promise<void> {\n this.value = '';\n this.catChange.emit(this.value);\n }\n\n /**\n * Adds a Cleave.js mask to the input.\n *\n * @param options The Cleave.js options.\n */\n @Method()\n async mask(options: CleaveOptions): Promise<void> {\n new Cleave(this.input, options);\n }\n\n @Watch('errors')\n onErrorsChanged(value?: boolean | string[] | ErrorMap) {\n if (!coerceBoolean(this.errorUpdate)) {\n this.errorMap = undefined;\n } else {\n this.errorMapSrc = Array.isArray(value)\n ? (value as string[]).reduce((acc, err) => ({ ...acc, [err]: undefined }), {})\n : value === true\n ? {}\n : value || undefined;\n this.showErrorsIfTimeout() || this.showErrorsIfNoFocus();\n }\n }\n\n render() {\n return (\n <div\n class={{\n 'input-field': true,\n 'input-horizontal': this.horizontal\n }}\n >\n <div class={{ 'label-container': true, hidden: this.labelHidden }}>\n {(this.hasSlottedLabel || this.label) && (\n <label htmlFor={this.id} part=\"label\">\n <span class=\"label-wrapper\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n <div class=\"label-metadata\">\n {!this.required && (this.requiredMarker ?? 'optional').startsWith('optional') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.optional')})\n </span>\n )}\n {this.required && this.requiredMarker?.startsWith('required') && (\n <span class=\"label-optional\" aria-hidden=\"true\">\n ({i18n.t('input.required')})\n </span>\n )}\n {this.maxLength && (\n <div class=\"label-character-count\" aria-hidden=\"true\">\n {this.value?.toString().length ?? 0}/{this.maxLength}\n </div>\n )}\n </div>\n </span>\n </label>\n )}\n </div>\n <div class=\"input-container\">\n <div class=\"input-outer-wrapper\">\n <div\n class={{\n 'input-wrapper': true,\n 'input-round': this.round,\n 'input-readonly': this.readonly,\n 'input-disabled': this.disabled,\n 'input-invalid': this.invalid\n }}\n onClick={() => this.input.focus()}\n >\n {this.textPrefix && (\n <span class=\"text-prefix\" part=\"prefix\">\n {this.textPrefix}\n </span>\n )}\n {this.icon && !this.iconRight && (\n <cat-icon icon={this.icon} class=\"icon-prefix\" size=\"l\" onClick={() => this.doFocus()}></cat-icon>\n )}\n <div class=\"input-inner-wrapper\">\n <input\n {...this.nativeAttributes}\n part=\"input\"\n ref={el => (this.input = el as HTMLInputElement)}\n id={this.id}\n class={{\n 'has-clearable': this.clearable && !this.disabled && !this.readonly && !!this.value,\n 'has-toggle-password': this.togglePassword && !this.disabled && !this.readonly && !!this.value\n }}\n autocomplete={this.autoComplete}\n disabled={this.disabled}\n max={this.max}\n maxlength={this.maxLength}\n min={this.min}\n minlength={this.minLength}\n name={this.name}\n placeholder={this.placeholder}\n readonly={this.readonly}\n required={this.required}\n type={this.isPasswordShown ? 'text' : this.type}\n value={this.value}\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n aria-invalid={this.invalid ? 'true' : undefined}\n aria-describedby={this.hasHint ? this.id + '-hint' : undefined}\n ></input>\n {this.clearable && !this.disabled && !this.readonly && this.value && (\n <cat-button\n class=\"clearable\"\n icon=\"$cat:input-close\"\n icon-only=\"true\"\n size=\"s\"\n variant=\"text\"\n a11y-label={i18n.t('input.clear')}\n onClick={this.clear.bind(this)}\n data-dropdown-no-close\n ></cat-button>\n )}\n {this.togglePassword && !this.disabled && !this.readonly && this.value && (\n <cat-button\n class=\"toggle-password\"\n icon={this.isPasswordShown ? '$cat:input-password-hide' : '$cat:input-password-show'}\n icon-only=\"true\"\n size=\"s\"\n variant=\"text\"\n a11y-label={i18n.t(this.isPasswordShown ? 'input.hidePassword' : 'input.showPassword')}\n onClick={this.doTogglePassword.bind(this)}\n ></cat-button>\n )}\n </div>\n {!this.invalid && this.icon && this.iconRight && (\n <cat-icon icon={this.icon} class=\"icon-suffix\" size=\"l\" onClick={() => this.doFocus()}></cat-icon>\n )}\n {this.invalid && (\n <cat-icon icon=\"$cat:input-error\" class=\"icon-suffix cat-text-danger\" size=\"l\"></cat-icon>\n )}\n {this.textSuffix && (\n <span class=\"text-suffix\" part=\"suffix\">\n {this.textSuffix}\n </span>\n )}\n </div>\n <slot name=\"addon\"></slot>\n </div>\n {this.hasHint && (\n <CatFormHint\n id={this.id}\n hint={this.hint}\n slottedHint={this.hasSlottedHint && <slot name=\"hint\"></slot>}\n errorMap={this.errorMap}\n />\n )}\n </div>\n </div>\n );\n }\n\n private get hasHint() {\n return !!this.hint || !!this.hasSlottedHint || this.invalid;\n }\n\n private get invalid() {\n return !!Object.keys(this.errorMap || {}).length;\n }\n\n private onInput() {\n this.value = this.input.value;\n this.catChange.emit(this.value);\n this.showErrorsIfTimeout();\n }\n\n private onFocus(event: FocusEvent) {\n this.catFocus.emit(event);\n }\n\n private onBlur(event: FocusEvent) {\n this.catBlur.emit(event);\n if (coerceBoolean(this.errorUpdate)) {\n this.showErrors();\n }\n }\n\n private doTogglePassword() {\n this.isPasswordShown = !this.isPasswordShown;\n }\n\n private showErrors() {\n this.errorMap = this.errorMapSrc;\n }\n\n private errorUpdateTimeoutId?: number;\n private showErrorsIfTimeout() {\n const errorUpdate = coerceNumber(this.errorUpdate, null);\n if (errorUpdate !== null) {\n typeof this.errorUpdateTimeoutId === 'number' && window.clearTimeout(this.errorUpdateTimeoutId);\n this.errorUpdateTimeoutId = window.setTimeout(() => this.showErrors(), errorUpdate);\n return true;\n }\n return false;\n }\n\n private showErrorsIfNoFocus() {\n const hasFocus = document.activeElement === this.hostElement || document.activeElement === this.input;\n if (!hasFocus) {\n this.showErrors();\n }\n }\n\n private findSiblingInput(node: Node | null): HTMLInputElement | undefined {\n if (node instanceof HTMLInputElement) {\n return node;\n } else if (node?.nextSibling) {\n return this.findSiblingInput(node.nextSibling);\n }\n return undefined;\n }\n}\n"]}
@@ -7,29 +7,8 @@ describe('cat-input', () => {
7
7
  components: [CatInput],
8
8
  html: `<cat-input label="Label"></cat-input>`
9
9
  });
10
- expect(page.root).toEqualHtml(`
11
- <cat-input label="Label">
12
- <mock:shadow-root>
13
- <div class="input-field">
14
- <div class="label-container">
15
- <label htmlfor="cat-input-0" part="label">
16
- <span class="label-wrapper">Label
17
- <div class="label-metadata">
18
- <span aria-hidden="true" class="label-optional">(input.optional)</span>
19
- </div>
20
- </span>
21
- </label>
22
- </div>
23
- <div class="input-container">
24
- <div class="input-wrapper">
25
- <div class="input-inner-wrapper">
26
- <input id="cat-input-0" part="input" type="text">
27
- </div>
28
- </div>
29
- </div>
30
- </div>
31
- </mock:shadow-root>
32
- </cat-input>
10
+ expect(page.root).toEqualLightHtml(`
11
+ <cat-input label="Label"></cat-input>
33
12
  `);
34
13
  });
35
14
  });
@@ -1 +1 @@
1
- {"version":3,"file":"cat-input.spec.js","sourceRoot":"","sources":["../../../src/components/cat-input/cat-input.spec.tsx"],"names":[],"mappings":"AAAA,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,QAAQ,CAAC;YACtB,IAAI,EAAE,uCAAuC;SAC9C,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;KAuB7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["jest.mock('../cat-i18n/cat-i18n-registry');\n\nimport { newSpecPage } from '@stencil/core/testing';\nimport { CatInput } from './cat-input';\n\ndescribe('cat-input', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatInput],\n html: `<cat-input label=\"Label\"></cat-input>`\n });\n expect(page.root).toEqualHtml(`\n <cat-input label=\"Label\">\n <mock:shadow-root>\n <div class=\"input-field\">\n <div class=\"label-container\">\n <label htmlfor=\"cat-input-0\" part=\"label\">\n <span class=\"label-wrapper\">Label \n <div class=\"label-metadata\">\n <span aria-hidden=\"true\" class=\"label-optional\">(input.optional)</span>\n </div>\n </span>\n </label>\n </div>\n <div class=\"input-container\">\n <div class=\"input-wrapper\">\n <div class=\"input-inner-wrapper\">\n <input id=\"cat-input-0\" part=\"input\" type=\"text\">\n </div>\n </div>\n </div>\n </div>\n </mock:shadow-root>\n </cat-input>\n `);\n });\n});\n"]}
1
+ {"version":3,"file":"cat-input.spec.js","sourceRoot":"","sources":["../../../src/components/cat-input/cat-input.spec.tsx"],"names":[],"mappings":"AAAA,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,QAAQ,CAAC;YACtB,IAAI,EAAE,uCAAuC;SAC9C,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC;;KAElC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["jest.mock('../cat-i18n/cat-i18n-registry');\n\nimport { newSpecPage } from '@stencil/core/testing';\nimport { CatInput } from './cat-input';\n\ndescribe('cat-input', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatInput],\n html: `<cat-input label=\"Label\"></cat-input>`\n });\n expect(page.root).toEqualLightHtml(`\n <cat-input label=\"Label\"></cat-input>\n `);\n });\n});\n"]}
@@ -21,9 +21,9 @@ export class CatPagination {
21
21
  this.iconNext = '$cat:pagination-right';
22
22
  }
23
23
  render() {
24
- return (h("nav", { key: 'b6166d7adf97431fcd6cd0b451f1c3287b3fca52', role: "navigation" }, h("ol", { key: '1810a4226ab05830a0b7e9d8d010d0e13dd6bd7f', class: {
24
+ return (h("nav", { key: '113d4e757e003c8351efe53f8baeaffe28428c8f', role: "navigation" }, h("ol", { key: '15d86b0fd427abdd7f1af9ababb324806a746d05', class: {
25
25
  [`cat-pagination-${this.size}`]: Boolean(this.size)
26
- } }, h("li", { key: '3b76a3f4a56ddbb998ba0da43cd99d759629567c' }, h("cat-button", { key: '7a07b951565187f86a2048bae6d9139eda2ecf57', variant: this.variant, size: this.size, round: this.round, disabled: this.isFirst, a11yLabel: i18n.t('pagination.prev'), icon: this.iconPrev, iconOnly: true, onClick: () => this.setPage(this.page - 1) })), this.content, h("li", { key: '14e62c6284d2d52cb0d14f86bc960ff7bba8fb9d' }, h("cat-button", { key: '922396cb778f9a1f439557c5b15627415a733347', variant: this.variant, size: this.size, round: this.round, disabled: this.isLast, a11yLabel: i18n.t('pagination.next'), icon: this.iconNext, iconOnly: true, onClick: () => this.setPage(this.page + 1) })))));
26
+ } }, h("li", { key: 'b6e6dad6d903b65850cd33c15327386a61fde3d4' }, h("cat-button", { key: 'd32aa4a3af4aaae84b5d2de695deadf0852f4ae0', variant: this.variant, size: this.size, round: this.round, disabled: this.isFirst, a11yLabel: i18n.t('pagination.prev'), icon: this.iconPrev, iconOnly: true, onClick: () => this.setPage(this.page - 1) })), this.content, h("li", { key: '19567f748e4f3976576ea1c894c2524865d6201a' }, h("cat-button", { key: '6170034891849aef2e248a1f531d86806aa4f4c1', variant: this.variant, size: this.size, round: this.round, disabled: this.isLast, a11yLabel: i18n.t('pagination.next'), icon: this.iconNext, iconOnly: true, onClick: () => this.setPage(this.page + 1) })))));
27
27
  }
28
28
  get isFirst() {
29
29
  return this.page === 0;
@@ -7,24 +7,8 @@ describe('cat-pagination', () => {
7
7
  components: [CatPagination],
8
8
  html: `<cat-pagination></cat-pagination>`
9
9
  });
10
- expect(page.root).toEqualHtml(`
11
- <cat-pagination>
12
- <mock:shadow-root>
13
- <nav role="navigation">
14
- <ol class="cat-pagination-m">
15
- <li>
16
- <cat-button a11ylabel="pagination.prev" disabled="" icon="$cat:pagination-left" icononly="" size="m" variant="text"></cat-button>
17
- </li>
18
- <li>
19
- <cat-button a11ycurrent="step" a11ylabel="pagination.page" active="" color="primary" size="m" variant="text">1</cat-button>
20
- </li>
21
- <li>
22
- <cat-button a11ylabel="pagination.next" disabled="" icon="$cat:pagination-right" icononly="" size="m" variant="text"></cat-button>
23
- </li>
24
- </ol>
25
- </nav>
26
- </mock:shadow-root>
27
- </cat-pagination>
10
+ expect(page.root).toEqualLightHtml(`
11
+ <cat-pagination></cat-pagination>
28
12
  `);
29
13
  });
30
14
  });
@@ -1 +1 @@
1
- {"version":3,"file":"cat-pagination.spec.js","sourceRoot":"","sources":["../../../src/components/cat-pagination/cat-pagination.spec.tsx"],"names":[],"mappings":"AAAA,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,aAAa,CAAC;YAC3B,IAAI,EAAE,mCAAmC;SAC1C,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;KAkB7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["jest.mock('../cat-i18n/cat-i18n-registry');\nimport { newSpecPage } from '@stencil/core/testing';\nimport { CatPagination } from './cat-pagination';\n\ndescribe('cat-pagination', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatPagination],\n html: `<cat-pagination></cat-pagination>`\n });\n expect(page.root).toEqualHtml(`\n <cat-pagination>\n <mock:shadow-root>\n <nav role=\"navigation\">\n <ol class=\"cat-pagination-m\">\n <li>\n <cat-button a11ylabel=\"pagination.prev\" disabled=\"\" icon=\"$cat:pagination-left\" icononly=\"\" size=\"m\" variant=\"text\"></cat-button>\n </li>\n <li>\n <cat-button a11ycurrent=\"step\" a11ylabel=\"pagination.page\" active=\"\" color=\"primary\" size=\"m\" variant=\"text\">1</cat-button>\n </li>\n <li>\n <cat-button a11ylabel=\"pagination.next\" disabled=\"\" icon=\"$cat:pagination-right\" icononly=\"\" size=\"m\" variant=\"text\"></cat-button>\n </li>\n </ol>\n </nav>\n </mock:shadow-root>\n </cat-pagination>\n `);\n });\n});\n"]}
1
+ {"version":3,"file":"cat-pagination.spec.js","sourceRoot":"","sources":["../../../src/components/cat-pagination/cat-pagination.spec.tsx"],"names":[],"mappings":"AAAA,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,aAAa,CAAC;YAC3B,IAAI,EAAE,mCAAmC;SAC1C,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC;;KAElC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["jest.mock('../cat-i18n/cat-i18n-registry');\nimport { newSpecPage } from '@stencil/core/testing';\nimport { CatPagination } from './cat-pagination';\n\ndescribe('cat-pagination', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatPagination],\n html: `<cat-pagination></cat-pagination>`\n });\n expect(page.root).toEqualLightHtml(`\n <cat-pagination></cat-pagination>\n `);\n });\n});\n"]}
@@ -56,7 +56,7 @@ export class CatRadio {
56
56
  this.input.blur();
57
57
  }
58
58
  render() {
59
- return (h(Host, { key: 'c44f5c1369b86ff3cc51d724a93ad0b2f3ec305d' }, h("label", { key: '921bc4790f98c244d60f60dad26eafb6f2dfe2a4', htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft }, role: "radio", "aria-checked": this.checked ? 'true' : 'false' }, h("span", { key: 'dea160109a4e097630b4dcccf22b4f201e79261d', class: "radio" }, h("input", { key: 'f03523fe726e79745b296983ff39803bf797b164', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.identifier || this.id, type: "radio", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), h("span", { key: '71259c52a7f46c1b49e4ccfa2e78e539ddf8c98f', class: "circle" })), h("span", { key: '93f2193a483bf6b8ad6e01d323393403714a1d95', class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label)), this.hasHint && (h("div", { class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { class: "circle-placeholder" }), h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
59
+ return (h(Host, { key: '9e3d983eeda3b42a67db73775cafcb9a5d98953a' }, h("label", { key: 'e2c5919edf0540000622a239b4acaa7704b2b3a8', htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft }, role: "radio", "aria-checked": this.checked ? 'true' : 'false' }, h("span", { key: '1f8d95c1728e910305c6ef827b6779b4642102d8', class: "radio" }, h("input", { key: 'd0217cd454023eb440ef4c2481899f30c15c340f', ...this.nativeAttributes, part: "input", ref: el => (this.input = el), id: this.identifier || this.id, type: "radio", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this), "aria-describedby": this.hasHint ? this.id + '-hint' : undefined }), h("span", { key: '83a85842c187adf508cba7497d9e2a545163967b', class: "circle" })), h("span", { key: 'de6ed4d4a62b894406ec53380ac4949a265fe74b', class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label)), this.hasHint && (h("div", { class: { 'hint-wrapper': true, 'label-left': this.labelLeft } }, h("div", { class: "circle-placeholder" }), h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) })))));
60
60
  }
61
61
  get hasHint() {
62
62
  return !!this.hint || !!this.hasSlottedHint;
@@ -4,20 +4,10 @@ describe('cat-radio', () => {
4
4
  it('renders', async () => {
5
5
  const page = await newSpecPage({
6
6
  components: [CatRadio],
7
- html: `<cat-radio label="Label" value="value"></cat-radio>`
7
+ html: `<cat-radio label="Label"></cat-radio>`
8
8
  });
9
- expect(page.root).toEqualHtml(`
10
- <cat-radio label="Label" value="value">
11
- <mock:shadow-root>
12
- <label aria-checked="false" htmlfor="cat-radio-1" role="radio">
13
- <span class="radio">
14
- <input id="cat-radio-1" part="input" type="radio" value="value">
15
- <span class="circle"></span>
16
- </span>
17
- <span class="label" part="label">Label</span>
18
- </label>
19
- </mock:shadow-root>
20
- </cat-radio>
9
+ expect(page.root).toEqualLightHtml(`
10
+ <cat-radio label="Label"></cat-radio>
21
11
  `);
22
12
  });
23
13
  });
@@ -1 +1 @@
1
- {"version":3,"file":"cat-radio.spec.js","sourceRoot":"","sources":["../../../src/components/cat-radio/cat-radio.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,QAAQ,CAAC;YACtB,IAAI,EAAE,qDAAqD;SAC5D,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;KAY7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { CatRadio } from './cat-radio';\n\ndescribe('cat-radio', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatRadio],\n html: `<cat-radio label=\"Label\" value=\"value\"></cat-radio>`\n });\n expect(page.root).toEqualHtml(`\n <cat-radio label=\"Label\" value=\"value\">\n <mock:shadow-root>\n <label aria-checked=\"false\" htmlfor=\"cat-radio-1\" role=\"radio\">\n <span class=\"radio\">\n <input id=\"cat-radio-1\" part=\"input\" type=\"radio\" value=\"value\">\n <span class=\"circle\"></span>\n </span>\n <span class=\"label\" part=\"label\">Label</span>\n </label>\n </mock:shadow-root>\n </cat-radio>\n `);\n });\n});\n"]}
1
+ {"version":3,"file":"cat-radio.spec.js","sourceRoot":"","sources":["../../../src/components/cat-radio/cat-radio.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,QAAQ,CAAC;YACtB,IAAI,EAAE,uCAAuC;SAC9C,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC;;KAElC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { CatRadio } from './cat-radio';\n\ndescribe('cat-radio', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatRadio],\n html: `<cat-radio label=\"Label\"></cat-radio>`\n });\n expect(page.root).toEqualLightHtml(`\n <cat-radio label=\"Label\"></cat-radio>\n `);\n });\n});\n"]}
@@ -67,7 +67,7 @@ export class CatRadioGroup {
67
67
  }
68
68
  }
69
69
  render() {
70
- return (h("div", { key: '75b4eaacbbe46c9117d1668b088aaa2dd19dbc07', role: "radiogroup", "aria-label": this.a11yLabel }, h("slot", { key: '1d74e89695ff302ac5f166814a7912ba2826432d' })));
70
+ return (h("div", { key: '05f0e3dddf696ecc2de0ea7491011e9ce6cf7ce4', role: "radiogroup", "aria-label": this.a11yLabel }, h("slot", { key: 'f67dc6e9f7e8410104626a1c5e54587d4cae51b0' })));
71
71
  }
72
72
  init() {
73
73
  this.catRadioGroup = Array.from(this.hostElement.querySelectorAll(`cat-radio`));
@@ -6,14 +6,8 @@ describe('cat-radio-group', () => {
6
6
  components: [CatRadioGroup],
7
7
  html: `<cat-radio-group></cat-radio-group>`
8
8
  });
9
- expect(page.root).toEqualHtml(`
10
- <cat-radio-group>
11
- <mock:shadow-root>
12
- <div role="radiogroup">
13
- <slot></slot>
14
- </div>
15
- </mock:shadow-root>
16
- </cat-radio-group>
9
+ expect(page.root).toEqualLightHtml(`
10
+ <cat-radio-group></cat-radio-group>
17
11
  `);
18
12
  });
19
13
  });
@@ -1 +1 @@
1
- {"version":3,"file":"cat-radio-group.spec.js","sourceRoot":"","sources":["../../../src/components/cat-radio-group/cat-radio-group.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,aAAa,CAAC;YAC3B,IAAI,EAAE,qCAAqC;SAC5C,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;KAQ7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { CatRadioGroup } from './cat-radio-group';\n\ndescribe('cat-radio-group', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatRadioGroup],\n html: `<cat-radio-group></cat-radio-group>`\n });\n expect(page.root).toEqualHtml(`\n <cat-radio-group>\n <mock:shadow-root>\n <div role=\"radiogroup\">\n <slot></slot>\n </div>\n </mock:shadow-root>\n </cat-radio-group>\n `);\n });\n});\n"]}
1
+ {"version":3,"file":"cat-radio-group.spec.js","sourceRoot":"","sources":["../../../src/components/cat-radio-group/cat-radio-group.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,aAAa,CAAC;YAC3B,IAAI,EAAE,qCAAqC;SAC5C,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC;;KAElC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { CatRadioGroup } from './cat-radio-group';\n\ndescribe('cat-radio-group', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatRadioGroup],\n html: `<cat-radio-group></cat-radio-group>`\n });\n expect(page.root).toEqualLightHtml(`\n <cat-radio-group></cat-radio-group>\n `);\n });\n});\n"]}