@haiilo/catalyst 10.1.1 → 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 (386) 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 +23 -14
  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 +2 -3
  59. package/dist/catalyst/index.esm.js.map +1 -1
  60. package/dist/catalyst/p-20919029.js +3 -0
  61. package/dist/catalyst/p-20919029.js.map +1 -0
  62. package/dist/catalyst/p-81800b65.js +2 -0
  63. package/dist/catalyst/p-81800b65.js.map +1 -0
  64. package/dist/catalyst/p-8a1d505d.entry.js +10 -0
  65. package/dist/catalyst/p-8a1d505d.entry.js.map +1 -0
  66. package/dist/catalyst/p-e1255160.js +2 -0
  67. package/dist/catalyst/p-e1255160.js.map +1 -0
  68. package/dist/catalyst/scss/core/_form.scss +12 -3
  69. package/dist/cjs/app-globals-3a1e7e63.js +7 -0
  70. package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
  71. package/dist/cjs/{cat-alert_26.cjs.entry.js → cat-alert_28.cjs.entry.js} +2435 -189
  72. package/dist/cjs/cat-alert_28.cjs.entry.js.map +1 -0
  73. package/dist/cjs/catalyst.cjs.js +6 -4
  74. package/dist/cjs/catalyst.cjs.js.map +1 -1
  75. package/dist/cjs/{index-eb056d5e.js → index-13aff0b4.js} +93 -38
  76. package/dist/cjs/index-13aff0b4.js.map +1 -0
  77. package/dist/cjs/index.cjs.js +9 -4
  78. package/dist/cjs/index.cjs.js.map +1 -1
  79. package/dist/cjs/loader.cjs.js +5 -3
  80. package/dist/cjs/loader.cjs.js.map +1 -1
  81. package/dist/cjs/{of-30c47b72.js → of-45281229.js} +164 -84
  82. package/dist/cjs/of-45281229.js.map +1 -0
  83. package/dist/collection/assets/fonts/Lato-Black.ttf +0 -0
  84. package/dist/collection/assets/fonts/Lato-Black.woff +0 -0
  85. package/dist/collection/assets/fonts/Lato-Black.woff2 +0 -0
  86. package/dist/collection/assets/fonts/Lato-BlackItalic.ttf +0 -0
  87. package/dist/collection/assets/fonts/Lato-BlackItalic.woff +0 -0
  88. package/dist/collection/assets/fonts/Lato-BlackItalic.woff2 +0 -0
  89. package/dist/collection/assets/fonts/Lato-Bold.ttf +0 -0
  90. package/dist/collection/assets/fonts/Lato-Bold.woff +0 -0
  91. package/dist/collection/assets/fonts/Lato-Bold.woff2 +0 -0
  92. package/dist/collection/assets/fonts/Lato-BoldItalic.ttf +0 -0
  93. package/dist/collection/assets/fonts/Lato-BoldItalic.woff +0 -0
  94. package/dist/collection/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  95. package/dist/collection/assets/fonts/Lato-Hairline.ttf +0 -0
  96. package/dist/collection/assets/fonts/Lato-Hairline.woff +0 -0
  97. package/dist/collection/assets/fonts/Lato-Hairline.woff2 +0 -0
  98. package/dist/collection/assets/fonts/Lato-HairlineItalic.ttf +0 -0
  99. package/dist/collection/assets/fonts/Lato-HairlineItalic.woff +0 -0
  100. package/dist/collection/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
  101. package/dist/collection/assets/fonts/Lato-Heavy.ttf +0 -0
  102. package/dist/collection/assets/fonts/Lato-Heavy.woff +0 -0
  103. package/dist/collection/assets/fonts/Lato-Heavy.woff2 +0 -0
  104. package/dist/collection/assets/fonts/Lato-HeavyItalic.ttf +0 -0
  105. package/dist/collection/assets/fonts/Lato-HeavyItalic.woff +0 -0
  106. package/dist/collection/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
  107. package/dist/collection/assets/fonts/Lato-Italic.ttf +0 -0
  108. package/dist/collection/assets/fonts/Lato-Italic.woff +0 -0
  109. package/dist/collection/assets/fonts/Lato-Italic.woff2 +0 -0
  110. package/dist/collection/assets/fonts/Lato-Light.ttf +0 -0
  111. package/dist/collection/assets/fonts/Lato-Light.woff +0 -0
  112. package/dist/collection/assets/fonts/Lato-Light.woff2 +0 -0
  113. package/dist/collection/assets/fonts/Lato-LightItalic.ttf +0 -0
  114. package/dist/collection/assets/fonts/Lato-LightItalic.woff +0 -0
  115. package/dist/collection/assets/fonts/Lato-LightItalic.woff2 +0 -0
  116. package/dist/collection/assets/fonts/Lato-Medium.ttf +0 -0
  117. package/dist/collection/assets/fonts/Lato-Medium.woff +0 -0
  118. package/dist/collection/assets/fonts/Lato-Medium.woff2 +0 -0
  119. package/dist/collection/assets/fonts/Lato-MediumItalic.ttf +0 -0
  120. package/dist/collection/assets/fonts/Lato-MediumItalic.woff +0 -0
  121. package/dist/collection/assets/fonts/Lato-MediumItalic.woff2 +0 -0
  122. package/dist/collection/assets/fonts/Lato-Regular.ttf +0 -0
  123. package/dist/collection/assets/fonts/Lato-Regular.woff +0 -0
  124. package/dist/collection/assets/fonts/Lato-Regular.woff2 +0 -0
  125. package/dist/collection/assets/fonts/Lato-Semibold.ttf +0 -0
  126. package/dist/collection/assets/fonts/Lato-Semibold.woff +0 -0
  127. package/dist/collection/assets/fonts/Lato-Semibold.woff2 +0 -0
  128. package/dist/collection/assets/fonts/Lato-SemiboldItalic.ttf +0 -0
  129. package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff +0 -0
  130. package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
  131. package/dist/collection/assets/fonts/Lato-Thin.ttf +0 -0
  132. package/dist/collection/assets/fonts/Lato-Thin.woff +0 -0
  133. package/dist/collection/assets/fonts/Lato-Thin.woff2 +0 -0
  134. package/dist/collection/assets/fonts/Lato-ThinItalic.ttf +0 -0
  135. package/dist/collection/assets/fonts/Lato-ThinItalic.woff +0 -0
  136. package/dist/collection/assets/fonts/Lato-ThinItalic.woff2 +0 -0
  137. package/dist/collection/collection-manifest.json +5 -3
  138. package/dist/collection/components/cat-alert/cat-alert.css +5 -5
  139. package/dist/collection/components/cat-alert/cat-alert.js +1 -1
  140. package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
  141. package/dist/collection/components/cat-alert/cat-alert.spec.js +2 -9
  142. package/dist/collection/components/cat-alert/cat-alert.spec.js.map +1 -1
  143. package/dist/collection/components/cat-avatar/cat-avatar.js.map +1 -1
  144. package/dist/collection/components/cat-avatar/cat-avatar.spec.js +3 -7
  145. package/dist/collection/components/cat-avatar/cat-avatar.spec.js.map +1 -1
  146. package/dist/collection/components/cat-badge/cat-badge.css +3 -3
  147. package/dist/collection/components/cat-badge/cat-badge.js +1 -1
  148. package/dist/collection/components/cat-badge/cat-badge.js.map +1 -1
  149. package/dist/collection/components/cat-badge/cat-badge.spec.js +2 -6
  150. package/dist/collection/components/cat-badge/cat-badge.spec.js.map +1 -1
  151. package/dist/collection/components/cat-button/cat-button.css +39 -10
  152. package/dist/collection/components/cat-button/cat-button.js +3 -5
  153. package/dist/collection/components/cat-button/cat-button.js.map +1 -1
  154. package/dist/collection/components/cat-button/cat-button.spec.js +1 -1
  155. package/dist/collection/components/cat-button/cat-button.spec.js.map +1 -1
  156. package/dist/collection/components/cat-button-group/cat-button-group.js +1 -1
  157. package/dist/collection/components/cat-button-group/cat-button-group.js.map +1 -1
  158. package/dist/collection/components/cat-button-group/cat-button-group.spec.js +2 -6
  159. package/dist/collection/components/cat-button-group/cat-button-group.spec.js.map +1 -1
  160. package/dist/collection/components/cat-card/cat-card.js +1 -1
  161. package/dist/collection/components/cat-card/cat-card.js.map +1 -1
  162. package/dist/collection/components/cat-card/cat-card.spec.js +2 -6
  163. package/dist/collection/components/cat-card/cat-card.spec.js.map +1 -1
  164. package/dist/collection/components/cat-checkbox/cat-checkbox.js +4 -6
  165. package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
  166. package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js +2 -17
  167. package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js.map +1 -1
  168. package/dist/collection/components/cat-date/cat-date-locale.js +54 -0
  169. package/dist/collection/components/cat-date/cat-date-locale.js.map +1 -0
  170. package/dist/collection/components/cat-date/cat-date-math.js +28 -0
  171. package/dist/collection/components/cat-date/cat-date-math.js.map +1 -0
  172. package/dist/collection/components/cat-date/cat-date.css +122 -0
  173. package/dist/collection/components/cat-date/cat-date.e2e.js +11 -0
  174. package/dist/collection/components/cat-date/cat-date.e2e.js.map +1 -0
  175. package/dist/collection/components/cat-date/cat-date.js +923 -0
  176. package/dist/collection/components/cat-date/cat-date.js.map +1 -0
  177. package/dist/collection/components/cat-date/cat-date.spec.js +16 -0
  178. package/dist/collection/components/cat-date/cat-date.spec.js.map +1 -0
  179. package/dist/collection/components/cat-datepicker/cat-datepicker.config.js.map +1 -1
  180. package/dist/collection/components/cat-datepicker/cat-datepicker.js +7 -9
  181. package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -1
  182. package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js +3 -8
  183. package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js.map +1 -1
  184. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js +2 -2
  185. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js.map +1 -1
  186. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js +2 -8
  187. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js.map +1 -1
  188. package/dist/collection/components/cat-dropdown/cat-dropdown.js +101 -31
  189. package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
  190. package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js +2 -8
  191. package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js.map +1 -1
  192. package/dist/collection/components/cat-form-group/cat-form-group.js +1 -1
  193. package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
  194. package/dist/collection/components/cat-form-group/cat-form-group.spec.js +2 -6
  195. package/dist/collection/components/cat-form-group/cat-form-group.spec.js.map +1 -1
  196. package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js +1 -1
  197. package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js.map +1 -1
  198. package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -1
  199. package/dist/collection/components/cat-icon/cat-icon-registry.js +27 -15
  200. package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -1
  201. package/dist/collection/components/cat-icon/cat-icon.js +1 -1
  202. package/dist/collection/components/cat-icon/cat-icon.js.map +1 -1
  203. package/dist/collection/components/cat-icon/cat-icon.spec.js +1 -1
  204. package/dist/collection/components/cat-icon/cat-icon.spec.js.map +1 -1
  205. package/dist/collection/components/cat-input/cat-input.css +28 -13
  206. package/dist/collection/components/cat-input/cat-input.js +47 -11
  207. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  208. package/dist/collection/components/cat-input/cat-input.spec.js +2 -23
  209. package/dist/collection/components/cat-input/cat-input.spec.js.map +1 -1
  210. package/dist/collection/components/cat-notification/cat-notification.js.map +1 -1
  211. package/dist/collection/components/cat-pagination/cat-pagination.js +2 -2
  212. package/dist/collection/components/cat-pagination/cat-pagination.js.map +1 -1
  213. package/dist/collection/components/cat-pagination/cat-pagination.spec.js +2 -18
  214. package/dist/collection/components/cat-pagination/cat-pagination.spec.js.map +1 -1
  215. package/dist/collection/components/cat-radio/cat-radio.js +4 -6
  216. package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
  217. package/dist/collection/components/cat-radio/cat-radio.spec.js +3 -13
  218. package/dist/collection/components/cat-radio/cat-radio.spec.js.map +1 -1
  219. package/dist/collection/components/cat-radio-group/cat-radio-group.js +1 -1
  220. package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
  221. package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js +2 -8
  222. package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js.map +1 -1
  223. package/dist/collection/components/cat-scrollable/cat-scrollable.js +3 -3
  224. package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
  225. package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js +2 -13
  226. package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js.map +1 -1
  227. package/dist/collection/components/cat-select/cat-select.css +13 -13
  228. package/dist/collection/components/cat-select/cat-select.js +15 -19
  229. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  230. package/dist/collection/components/cat-select/cat-select.spec.js +2 -28
  231. package/dist/collection/components/cat-select/cat-select.spec.js.map +1 -1
  232. package/dist/collection/components/cat-select-demo/cat-select-demo.js +1 -1
  233. package/dist/collection/components/cat-select-demo/cat-select-demo.js.map +1 -1
  234. package/dist/collection/components/cat-skeleton/cat-skeleton.js +1 -1
  235. package/dist/collection/components/cat-skeleton/cat-skeleton.js.map +1 -1
  236. package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js +2 -6
  237. package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js.map +1 -1
  238. package/dist/collection/components/cat-spinner/cat-spinner.js +2 -2
  239. package/dist/collection/components/cat-spinner/cat-spinner.js.map +1 -1
  240. package/dist/collection/components/cat-spinner/cat-spinner.spec.js +1 -1
  241. package/dist/collection/components/cat-spinner/cat-spinner.spec.js.map +1 -1
  242. package/dist/collection/components/cat-tab/cat-tab.js +1 -1
  243. package/dist/collection/components/cat-tab/cat-tab.js.map +1 -1
  244. package/dist/collection/components/cat-tab/cat-tab.spec.js +2 -5
  245. package/dist/collection/components/cat-tab/cat-tab.spec.js.map +1 -1
  246. package/dist/collection/components/cat-tabs/cat-tabs.js +7 -11
  247. package/dist/collection/components/cat-tabs/cat-tabs.js.map +1 -1
  248. package/dist/collection/components/cat-tabs/cat-tabs.spec.js +2 -5
  249. package/dist/collection/components/cat-tabs/cat-tabs.spec.js.map +1 -1
  250. package/dist/collection/components/cat-textarea/cat-textarea.css +13 -13
  251. package/dist/collection/components/cat-textarea/cat-textarea.js +6 -8
  252. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
  253. package/dist/collection/components/cat-textarea/cat-textarea.spec.js +2 -21
  254. package/dist/collection/components/cat-textarea/cat-textarea.spec.js.map +1 -1
  255. package/dist/collection/components/cat-time/cat-time-locale.js +15 -0
  256. package/dist/collection/components/cat-time/cat-time-locale.js.map +1 -0
  257. package/dist/collection/components/cat-time/cat-time-math.js +28 -0
  258. package/dist/collection/components/cat-time/cat-time-math.js.map +1 -0
  259. package/dist/collection/components/cat-time/cat-time.css +41 -0
  260. package/dist/collection/components/cat-time/cat-time.e2e.js +11 -0
  261. package/dist/collection/components/cat-time/cat-time.e2e.js.map +1 -0
  262. package/dist/collection/components/cat-time/cat-time.js +801 -0
  263. package/dist/collection/components/cat-time/cat-time.js.map +1 -0
  264. package/dist/collection/components/cat-time/cat-time.spec.js +16 -0
  265. package/dist/collection/components/cat-time/cat-time.spec.js.map +1 -0
  266. package/dist/collection/components/cat-toggle/cat-toggle.js +4 -6
  267. package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
  268. package/dist/collection/components/cat-toggle/cat-toggle.spec.js +2 -10
  269. package/dist/collection/components/cat-toggle/cat-toggle.spec.js.map +1 -1
  270. package/dist/collection/components/cat-tooltip/cat-tooltip.js +3 -3
  271. package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
  272. package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js +1 -9
  273. package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js.map +1 -1
  274. package/dist/collection/scss/core/_form.scss +12 -3
  275. package/dist/collection/utils/find-closest.js.map +1 -1
  276. package/dist/collection/utils/media-matcher.js.map +1 -1
  277. package/dist/collection/utils/platform.js.map +1 -1
  278. package/dist/collection/utils/setDefault.js.map +1 -1
  279. package/dist/components/cat-alert.js +4 -3
  280. package/dist/components/cat-alert.js.map +1 -1
  281. package/dist/components/cat-avatar2.js +4 -3
  282. package/dist/components/cat-avatar2.js.map +1 -1
  283. package/dist/components/cat-badge.js +4 -3
  284. package/dist/components/cat-badge.js.map +1 -1
  285. package/dist/components/cat-button-group.js +3 -2
  286. package/dist/components/cat-button-group.js.map +1 -1
  287. package/dist/components/cat-button2.js +6 -5
  288. package/dist/components/cat-button2.js.map +1 -1
  289. package/dist/components/cat-card.js +3 -2
  290. package/dist/components/cat-card.js.map +1 -1
  291. package/dist/components/cat-checkbox2.js +5 -4
  292. package/dist/components/cat-checkbox2.js.map +1 -1
  293. package/dist/components/cat-date.d.ts +11 -0
  294. package/dist/components/cat-date.js +469 -0
  295. package/dist/components/cat-date.js.map +1 -0
  296. package/dist/components/cat-datepicker-inline.js +4 -3
  297. package/dist/components/cat-datepicker-inline.js.map +1 -1
  298. package/dist/components/cat-datepicker.js +4 -3
  299. package/dist/components/cat-datepicker.js.map +1 -1
  300. package/dist/components/cat-datepicker.locale.js +8 -4
  301. package/dist/components/cat-datepicker.locale.js.map +1 -1
  302. package/dist/components/cat-dropdown2.js +37 -31
  303. package/dist/components/cat-dropdown2.js.map +1 -1
  304. package/dist/components/cat-form-group.js +3 -2
  305. package/dist/components/cat-form-group.js.map +1 -1
  306. package/dist/components/cat-i18n-registry.js +7 -7
  307. package/dist/components/cat-i18n-registry.js.map +1 -1
  308. package/dist/components/cat-icon-registry.js +37 -22
  309. package/dist/components/cat-icon-registry.js.map +1 -1
  310. package/dist/components/cat-icon2.js +3 -2
  311. package/dist/components/cat-icon2.js.map +1 -1
  312. package/dist/components/cat-input2.js +1576 -9
  313. package/dist/components/cat-input2.js.map +1 -1
  314. package/dist/components/cat-pagination.js +4 -3
  315. package/dist/components/cat-pagination.js.map +1 -1
  316. package/dist/components/cat-radio-group.js +3 -2
  317. package/dist/components/cat-radio-group.js.map +1 -1
  318. package/dist/components/cat-radio.js +5 -4
  319. package/dist/components/cat-radio.js.map +1 -1
  320. package/dist/components/cat-scrollable2.js +5 -4
  321. package/dist/components/cat-scrollable2.js.map +1 -1
  322. package/dist/components/cat-select-demo.js +1 -1
  323. package/dist/components/cat-select-demo.js.map +1 -1
  324. package/dist/components/cat-select2.js +10 -9
  325. package/dist/components/cat-select2.js.map +1 -1
  326. package/dist/components/cat-skeleton2.js +3 -2
  327. package/dist/components/cat-skeleton2.js.map +1 -1
  328. package/dist/components/cat-spinner2.js +4 -3
  329. package/dist/components/cat-spinner2.js.map +1 -1
  330. package/dist/components/cat-tab.js +3 -2
  331. package/dist/components/cat-tab.js.map +1 -1
  332. package/dist/components/cat-tabs.js +3 -2
  333. package/dist/components/cat-tabs.js.map +1 -1
  334. package/dist/components/cat-textarea.js +8 -7
  335. package/dist/components/cat-textarea.js.map +1 -1
  336. package/dist/components/cat-time.d.ts +11 -0
  337. package/dist/components/cat-time.js +303 -0
  338. package/dist/components/cat-time.js.map +1 -0
  339. package/dist/components/cat-toggle.js +5 -4
  340. package/dist/components/cat-toggle.js.map +1 -1
  341. package/dist/components/cat-tooltip.js +5 -4
  342. package/dist/components/cat-tooltip.js.map +1 -1
  343. package/dist/components/floating-ui.dom.esm.js +97 -45
  344. package/dist/components/floating-ui.dom.esm.js.map +1 -1
  345. package/dist/components/from.js +16 -1
  346. package/dist/components/from.js.map +1 -1
  347. package/dist/components/index.js +9 -4
  348. package/dist/components/index.js.map +1 -1
  349. package/dist/components/loglevel.js +106 -55
  350. package/dist/components/loglevel.js.map +1 -1
  351. package/dist/esm/app-globals-0f993ce5.js +5 -0
  352. package/dist/esm/app-globals-0f993ce5.js.map +1 -0
  353. package/dist/esm/{cat-alert_26.entry.js → cat-alert_28.entry.js} +2435 -191
  354. package/dist/esm/cat-alert_28.entry.js.map +1 -0
  355. package/dist/esm/catalyst.js +7 -5
  356. package/dist/esm/catalyst.js.map +1 -1
  357. package/dist/esm/{index-acddba36.js → index-ecb4a974.js} +93 -38
  358. package/dist/esm/index-ecb4a974.js.map +1 -0
  359. package/dist/esm/index.js +10 -5
  360. package/dist/esm/index.js.map +1 -1
  361. package/dist/esm/loader.js +6 -4
  362. package/dist/esm/loader.js.map +1 -1
  363. package/dist/esm/{of-4b71dda1.js → of-19888f3b.js} +164 -83
  364. package/dist/esm/of-19888f3b.js.map +1 -0
  365. package/dist/types/components/cat-date/cat-date-locale.d.ts +24 -0
  366. package/dist/types/components/cat-date/cat-date-math.d.ts +7 -0
  367. package/dist/types/components/cat-date/cat-date.d.ts +180 -0
  368. package/dist/types/components/cat-dropdown/cat-dropdown.d.ts +9 -3
  369. package/dist/types/components/cat-input/cat-input.d.ts +9 -2
  370. package/dist/types/components/cat-time/cat-time-locale.d.ts +6 -0
  371. package/dist/types/components/cat-time/cat-time-math.d.ts +3 -0
  372. package/dist/types/components/cat-time/cat-time.d.ts +168 -0
  373. package/dist/types/components.d.ts +551 -8
  374. package/package.json +20 -18
  375. package/dist/catalyst/p-2a5b4714.entry.js +0 -10
  376. package/dist/catalyst/p-2a5b4714.entry.js.map +0 -1
  377. package/dist/catalyst/p-6cd4fa1e.js +0 -3
  378. package/dist/catalyst/p-6cd4fa1e.js.map +0 -1
  379. package/dist/catalyst/p-f5febe1f.js +0 -2
  380. package/dist/catalyst/p-f5febe1f.js.map +0 -1
  381. package/dist/cjs/cat-alert_26.cjs.entry.js.map +0 -1
  382. package/dist/cjs/index-eb056d5e.js.map +0 -1
  383. package/dist/cjs/of-30c47b72.js.map +0 -1
  384. package/dist/esm/cat-alert_26.entry.js.map +0 -1
  385. package/dist/esm/index-acddba36.js.map +0 -1
  386. package/dist/esm/of-4b71dda1.js.map +0 -1
@@ -6,11 +6,8 @@ describe('cat-tabs', () => {
6
6
  components: [CatTabs],
7
7
  html: `<cat-tabs></cat-tabs>`
8
8
  });
9
- expect(page.root).toEqualHtml(`
10
- <cat-tabs>
11
- <mock:shadow-root>
12
- </mock:shadow-root>
13
- </cat-tabs>
9
+ expect(page.root).toEqualLightHtml(`
10
+ <cat-tabs></cat-tabs>
14
11
  `);
15
12
  });
16
13
  });
@@ -1 +1 @@
1
- {"version":3,"file":"cat-tabs.spec.js","sourceRoot":"","sources":["../../../src/components/cat-tabs/cat-tabs.spec.tsx"],"names":[],"mappings":"AAAA,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,uBAAuB;SAC9B,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;KAK7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { CatTabs } from './cat-tabs';\n\ndescribe('cat-tabs', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatTabs],\n html: `<cat-tabs></cat-tabs>`\n });\n expect(page.root).toEqualHtml(`\n <cat-tabs>\n <mock:shadow-root>\n </mock:shadow-root>\n </cat-tabs>\n `);\n });\n});\n"]}
1
+ {"version":3,"file":"cat-tabs.spec.js","sourceRoot":"","sources":["../../../src/components/cat-tabs/cat-tabs.spec.tsx"],"names":[],"mappings":"AAAA,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,uBAAuB;SAC9B,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 { CatTabs } from './cat-tabs';\n\ndescribe('cat-tabs', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatTabs],\n html: `<cat-tabs></cat-tabs>`\n });\n expect(page.root).toEqualLightHtml(`\n <cat-tabs></cat-tabs>\n `);\n });\n});\n"]}
@@ -180,11 +180,11 @@
180
180
  }
181
181
 
182
182
  .cat-bg-info {
183
- background-color: rgb(var(--cat-success-bg, 0, 115, 230)) !important;
184
- color: rgb(var(--cat-success-fill, 255, 255, 255)) !important;
185
- --cat-primary-text: var(--cat-success-fill, 255, 255, 255);
186
- --cat-primary-text-hover: var(--cat-success-fill-hover, 255, 255, 255);
187
- --cat-primary-text-active: var(--cat-success-fill-active, 255, 255, 255);
183
+ background-color: rgb(var(--cat-info-bg, 0, 115, 230)) !important;
184
+ color: rgb(var(--cat-info-fill, 255, 255, 255)) !important;
185
+ --cat-primary-text: var(--cat-info-fill, 255, 255, 255);
186
+ --cat-primary-text-hover: var(--cat-info-fill-hover, 255, 255, 255);
187
+ --cat-primary-text-active: var(--cat-info-fill-active, 255, 255, 255);
188
188
  --cat-link-decoration: underline;
189
189
  }
190
190
 
@@ -192,17 +192,17 @@
192
192
  transition: background-color 125ms, color 125ms;
193
193
  }
194
194
  .cat-bg-info-hover:hover {
195
- background-color: rgb(var(--cat-success-bg-hover, 0, 107, 227)) !important;
196
- color: rgb(var(--cat-success-fill-hover, 255, 255, 255)) !important;
197
- --cat-primary-text: var(--cat-success-fill, 255, 255, 255);
198
- --cat-primary-text-hover: var(--cat-success-fill-hover, 255, 255, 255);
199
- --cat-primary-text-active: var(--cat-success-fill-active, 255, 255, 255);
195
+ background-color: rgb(var(--cat-info-bg-hover, 0, 107, 227)) !important;
196
+ color: rgb(var(--cat-info-fill-hover, 255, 255, 255)) !important;
197
+ --cat-primary-text: var(--cat-info-fill, 255, 255, 255);
198
+ --cat-primary-text-hover: var(--cat-info-fill-hover, 255, 255, 255);
199
+ --cat-primary-text-active: var(--cat-info-fill-active, 255, 255, 255);
200
200
  --cat-link-decoration: underline;
201
201
  }
202
202
 
203
203
  .cat-text-info,
204
204
  .cat-link-info {
205
- color: rgb(var(--cat-success-text, 0, 115, 230)) !important;
205
+ color: rgb(var(--cat-info-text, 0, 115, 230)) !important;
206
206
  }
207
207
 
208
208
  .cat-link-info,
@@ -211,11 +211,11 @@
211
211
  }
212
212
  .cat-link-info:hover,
213
213
  .cat-text-info-hover:hover {
214
- color: rgb(var(--cat-success-text-hover, 0, 107, 227)) !important;
214
+ color: rgb(var(--cat-info-text-hover, 0, 107, 227)) !important;
215
215
  }
216
216
  .cat-link-info:active,
217
217
  .cat-text-info-hover:active {
218
- color: rgb(var(--cat-success-text-active, 0, 96, 223)) !important;
218
+ color: rgb(var(--cat-info-text-active, 0, 96, 223)) !important;
219
219
  }
220
220
 
221
221
  .cat-bg-success {
@@ -92,15 +92,15 @@ export class CatTextarea {
92
92
  }
93
93
  }
94
94
  render() {
95
- return (h(Host, null, h("div", { class: {
95
+ return (h(Host, { key: 'cb67b2133a56d47e02cc099e0a52670d8b2ba808' }, h("div", { key: 'bd7af8f7626ea32983a2cd2595556722b9384384', class: {
96
96
  'textarea-field': true,
97
97
  'textarea-horizontal': this.horizontal
98
- } }, h("div", { 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?.length ?? 0, "/", this.maxLength))))))), h("div", { class: "textarea-container" }, h("div", { class: {
98
+ } }, h("div", { key: '58eaf7f6f077148933667818c80ba7c61f3f599c', 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?.length ?? 0, "/", this.maxLength))))))), h("div", { key: '697555f611a053df4df7dfe12cbd7e6fdcb4f0a1', class: "textarea-container" }, h("div", { key: '85c1b4a93bf03b3b6046f310bbb841d312638d3b', class: {
99
99
  'textarea-wrapper': true,
100
100
  'textarea-readonly': this.readonly,
101
101
  'textarea-disabled': this.disabled,
102
102
  'textarea-invalid': this.invalid
103
- } }, h("textarea", { ...this.nativeAttributes, part: "textarea", ref: el => (this.textarea = el), id: this.id, disabled: this.disabled, maxlength: this.maxLength, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, rows: this.rows, 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.invalid && (h("cat-icon", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l", onClick: () => this.textarea.focus() }))), this.hasHint && (h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap }))))));
103
+ } }, h("textarea", { key: '2646d5e59ea09e361c87ad1635d641c9ce2d1fb6', ...this.nativeAttributes, part: "textarea", ref: el => (this.textarea = el), id: this.id, disabled: this.disabled, maxlength: this.maxLength, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, rows: this.rows, 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.invalid && (h("cat-icon", { icon: "$cat:input-error", class: "icon-suffix cat-text-danger", size: "l", onClick: () => this.textarea.focus() }))), this.hasHint && (h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }), errorMap: this.errorMap }))))));
104
104
  }
105
105
  get hasHint() {
106
106
  return !!this.hint || !!this.hasSlottedHint || this.invalid;
@@ -546,11 +546,9 @@ export class CatTextarea {
546
546
  "complexType": {
547
547
  "signature": "(options?: FocusOptions) => Promise<void>",
548
548
  "parameters": [{
549
- "tags": [{
550
- "name": "param",
551
- "text": "options An optional object providing options to control aspects of\nthe focusing process."
552
- }],
553
- "text": "An optional object providing options to control aspects of\nthe focusing process."
549
+ "name": "options",
550
+ "type": "FocusOptions | undefined",
551
+ "docs": "An optional object providing options to control aspects of\nthe focusing process."
554
552
  }],
555
553
  "references": {
556
554
  "Promise": {
@@ -1 +1 @@
1
- {"version":3,"file":"cat-textarea.js","sourceRoot":"","sources":["../../../src/components/cat-textarea/cat-textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,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;AAExE,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;;;;;GASG;AAMH,MAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from '@stencil/core';\nimport autosize from 'autosize';\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';\n\nlet nextUniqueId = 0;\n\n/**\n * Textarea specifies a control that allows user to write text over multiple\n * rows. Used when the expected user input is long. For shorter input, use the\n * input component.\n *\n * @slot hint - Optional hint element to be displayed with the textarea.\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 textarea - The native textarea element.\n */\n@Component({\n tag: 'cat-textarea',\n styleUrl: 'cat-textarea.scss',\n shadow: true\n})\nexport class CatTextarea {\n private readonly _id = `cat-textarea-${nextUniqueId++}`;\n private get id() {\n return this.identifier || this._id;\n }\n\n private textarea!: HTMLTextAreaElement;\n private errorMapSrc?: ErrorMap;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n @State() hasSlottedHint = false;\n\n @State() errorMap?: ErrorMap;\n\n /**\n * Whether the label need a marker to shown if the textarea 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 * Whether the textarea is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text(s) to be displayed with the textarea.\n */\n @Prop() hint?: string | string[];\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label for the textarea.\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 length (number of characters) for textual values.\n */\n @Prop() maxLength?: number;\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 * 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 * Specifies the initial number of lines in the textarea.\n */\n @Prop() rows = 3;\n\n /**\n * The initial 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 textarea 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 textarea received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the textarea 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 textarea', this);\n }\n }\n\n componentDidLoad(): void {\n autosize(this.textarea);\n }\n\n /**\n * Programmatically move focus to the textarea. Use this method instead of\n * `textarea.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 this.textarea.focus(options);\n }\n\n /**\n * Programmatically remove focus from the textarea. Use this method instead of\n * `textarea.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.textarea.blur();\n }\n\n /**\n * Clear the textarea.\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 <Host>\n <div\n class={{\n 'textarea-field': true,\n 'textarea-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?.length ?? 0}/{this.maxLength}\n </div>\n )}\n </div>\n </span>\n </label>\n )}\n </div>\n <div class=\"textarea-container\">\n <div\n class={{\n 'textarea-wrapper': true,\n 'textarea-readonly': this.readonly,\n 'textarea-disabled': this.disabled,\n 'textarea-invalid': this.invalid\n }}\n >\n <textarea\n {...this.nativeAttributes}\n part=\"textarea\"\n ref={el => (this.textarea = el as HTMLTextAreaElement)}\n id={this.id}\n disabled={this.disabled}\n maxlength={this.maxLength}\n minlength={this.minLength}\n name={this.name}\n placeholder={this.placeholder}\n readonly={this.readonly}\n required={this.required}\n rows={this.rows}\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 ></textarea>\n {this.invalid && (\n <cat-icon\n icon=\"$cat:input-error\"\n class=\"icon-suffix cat-text-danger\"\n size=\"l\"\n onClick={() => this.textarea.focus()}\n ></cat-icon>\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 </Host>\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.textarea.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 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.textarea;\n if (!hasFocus) {\n this.showErrors();\n }\n }\n}\n"]}
1
+ {"version":3,"file":"cat-textarea.js","sourceRoot":"","sources":["../../../src/components/cat-textarea/cat-textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,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;AAExE,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB;;;;;;;;;GASG;AAMH,MAAM,OAAO,WAAW;;QACL,QAAG,GAAG,gBAAgB,YAAY,EAAE,EAAE,CAAC;+BAU7B,KAAK;8BAEN,KAAK;;8BAOmE,UAAU;0BAKvF,KAAK;wBAKP,KAAK;;;qBAeR,EAAE;2BAKI,KAAK;;;;;wBAyBR,KAAK;wBAKL,KAAK;oBAKT,CAAC;;;2BAsBwB,CAAC;;;IAzGzC,IAAY,EAAE;QACZ,OAAO,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,GAAG,CAAC;IACrC,CAAC;IA6HD,mBAAmB;QACjB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAClC,IAAI,CAAC,eA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from '@stencil/core';\nimport autosize from 'autosize';\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';\n\nlet nextUniqueId = 0;\n\n/**\n * Textarea specifies a control that allows user to write text over multiple\n * rows. Used when the expected user input is long. For shorter input, use the\n * input component.\n *\n * @slot hint - Optional hint element to be displayed with the textarea.\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 textarea - The native textarea element.\n */\n@Component({\n tag: 'cat-textarea',\n styleUrl: 'cat-textarea.scss',\n shadow: true\n})\nexport class CatTextarea {\n private readonly _id = `cat-textarea-${nextUniqueId++}`;\n private get id() {\n return this.identifier || this._id;\n }\n\n private textarea!: HTMLTextAreaElement;\n private errorMapSrc?: ErrorMap;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n @State() hasSlottedHint = false;\n\n @State() errorMap?: ErrorMap;\n\n /**\n * Whether the label need a marker to shown if the textarea 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 * Whether the textarea is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text(s) to be displayed with the textarea.\n */\n @Prop() hint?: string | string[];\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label for the textarea.\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 length (number of characters) for textual values.\n */\n @Prop() maxLength?: number;\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 * 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 * Specifies the initial number of lines in the textarea.\n */\n @Prop() rows = 3;\n\n /**\n * The initial 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 textarea 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 textarea received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the textarea 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 textarea', this);\n }\n }\n\n componentDidLoad(): void {\n autosize(this.textarea);\n }\n\n /**\n * Programmatically move focus to the textarea. Use this method instead of\n * `textarea.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 this.textarea.focus(options);\n }\n\n /**\n * Programmatically remove focus from the textarea. Use this method instead of\n * `textarea.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this.textarea.blur();\n }\n\n /**\n * Clear the textarea.\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 <Host>\n <div\n class={{\n 'textarea-field': true,\n 'textarea-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?.length ?? 0}/{this.maxLength}\n </div>\n )}\n </div>\n </span>\n </label>\n )}\n </div>\n <div class=\"textarea-container\">\n <div\n class={{\n 'textarea-wrapper': true,\n 'textarea-readonly': this.readonly,\n 'textarea-disabled': this.disabled,\n 'textarea-invalid': this.invalid\n }}\n >\n <textarea\n {...this.nativeAttributes}\n part=\"textarea\"\n ref={el => (this.textarea = el as HTMLTextAreaElement)}\n id={this.id}\n disabled={this.disabled}\n maxlength={this.maxLength}\n minlength={this.minLength}\n name={this.name}\n placeholder={this.placeholder}\n readonly={this.readonly}\n required={this.required}\n rows={this.rows}\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 ></textarea>\n {this.invalid && (\n <cat-icon\n icon=\"$cat:input-error\"\n class=\"icon-suffix cat-text-danger\"\n size=\"l\"\n onClick={() => this.textarea.focus()}\n ></cat-icon>\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 </Host>\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.textarea.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 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.textarea;\n if (!hasFocus) {\n this.showErrors();\n }\n }\n}\n"]}
@@ -7,27 +7,8 @@ describe('cat-textarea', () => {
7
7
  components: [CatTextarea],
8
8
  html: `<cat-textarea label="Label"></cat-textarea>`
9
9
  });
10
- expect(page.root).toEqualHtml(`
11
- <cat-textarea label="Label">
12
- <mock:shadow-root>
13
- <div class="textarea-field">
14
- <div class="label-container">
15
- <label htmlfor="cat-textarea-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="textarea-container">
24
- <div class="textarea-wrapper">
25
- <textarea id="cat-textarea-0" part="textarea" rows="3"></textarea>
26
- </div>
27
- </div>
28
- </div>
29
- </mock:shadow-root>
30
- </cat-textarea>
10
+ expect(page.root).toEqualLightHtml(`
11
+ <cat-textarea label="Label"></cat-textarea>
31
12
  `);
32
13
  });
33
14
  });
@@ -1 +1 @@
1
- {"version":3,"file":"cat-textarea.spec.js","sourceRoot":"","sources":["../../../src/components/cat-textarea/cat-textarea.spec.tsx"],"names":[],"mappings":"AAAA,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,WAAW,CAAC;YACzB,IAAI,EAAE,6CAA6C;SACpD,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;KAqB7B,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 { CatTextarea } from './cat-textarea';\n\ndescribe('cat-textarea', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatTextarea],\n html: `<cat-textarea label=\"Label\"></cat-textarea>`\n });\n expect(page.root).toEqualHtml(`\n <cat-textarea label=\"Label\">\n <mock:shadow-root>\n <div class=\"textarea-field\">\n <div class=\"label-container\">\n <label htmlfor=\"cat-textarea-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=\"textarea-container\">\n <div class=\"textarea-wrapper\">\n <textarea id=\"cat-textarea-0\" part=\"textarea\" rows=\"3\"></textarea>\n </div>\n </div>\n </div>\n </mock:shadow-root>\n </cat-textarea>\n `);\n });\n});\n"]}
1
+ {"version":3,"file":"cat-textarea.spec.js","sourceRoot":"","sources":["../../../src/components/cat-textarea/cat-textarea.spec.tsx"],"names":[],"mappings":"AAAA,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,WAAW,CAAC;YACzB,IAAI,EAAE,6CAA6C;SACpD,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 { CatTextarea } from './cat-textarea';\n\ndescribe('cat-textarea', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatTextarea],\n html: `<cat-textarea label=\"Label\"></cat-textarea>`\n });\n expect(page.root).toEqualLightHtml(`\n <cat-textarea label=\"Label\"></cat-textarea>\n `);\n });\n});\n"]}
@@ -0,0 +1,15 @@
1
+ import { catI18nRegistry as i18n } from "../cat-i18n/cat-i18n-registry";
2
+ export function getHour12(language) {
3
+ const dateStr = new Intl.DateTimeFormat(language, { hour: '2-digit', minute: '2-digit' })
4
+ .format(new Date())
5
+ .toLowerCase();
6
+ return dateStr.includes('am') || dateStr.includes('pm');
7
+ }
8
+ export function getLocale(language) {
9
+ return {
10
+ change: i18n.t('timepicker.change'),
11
+ choose: i18n.t('timepicker.choose'),
12
+ timeFormat: getHour12(language) ? '12' : '24'
13
+ };
14
+ }
15
+ //# sourceMappingURL=cat-time-locale.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-time-locale.js","sourceRoot":"","sources":["../../../src/components/cat-time/cat-time-locale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAExE,MAAM,UAAU,SAAS,CAAC,QAAgB;IACxC,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;SACtF,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;SAClB,WAAW,EAAE,CAAC;IACjB,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,QAAgB;IACxC,OAAO;QACL,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC;QACnC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC;QACnC,UAAU,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;KAC9C,CAAC;AACJ,CAAC","sourcesContent":["import { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\n\nexport function getHour12(language: string): boolean {\n const dateStr = new Intl.DateTimeFormat(language, { hour: '2-digit', minute: '2-digit' })\n .format(new Date())\n .toLowerCase();\n return dateStr.includes('am') || dateStr.includes('pm');\n}\n\nexport function getLocale(language: string) {\n return {\n change: i18n.t('timepicker.change'),\n choose: i18n.t('timepicker.choose'),\n timeFormat: getHour12(language) ? '12' : '24'\n };\n}\n"]}
@@ -0,0 +1,28 @@
1
+ export function clampTime(min, date, max) {
2
+ const [, hhMin, mmMin] = min?.match(/(\d{2}):(\d{2})/)?.map(Number) ?? [];
3
+ const [, hhMax, mmMax] = max?.match(/(\d{2}):(\d{2})/)?.map(Number) ?? [];
4
+ let minTime = -Infinity;
5
+ let maxTime = Infinity;
6
+ if (hhMin !== undefined && mmMin !== undefined) {
7
+ minTime = new Date(date.getFullYear(), date.getMonth(), date.getDate(), hhMin, mmMin).getTime();
8
+ }
9
+ if (hhMax !== undefined && mmMax !== undefined) {
10
+ maxTime = new Date(date.getFullYear(), date.getMonth(), date.getDate(), hhMax, mmMax).getTime();
11
+ }
12
+ return new Date(Math.min(Math.max(date.getTime(), minTime), maxTime));
13
+ }
14
+ export function isBefore(date, time) {
15
+ const [, hh, mm] = time?.match(/(\d{2}):(\d{2})/)?.map(Number) ?? [];
16
+ if (hh === undefined || mm === undefined) {
17
+ return false;
18
+ }
19
+ return date.getHours() < hh || (date.getHours() === hh && date.getMinutes() < mm);
20
+ }
21
+ export function isAfter(date, time) {
22
+ const [, hh, mm] = time?.match(/(\d{2}):(\d{2})/)?.map(Number) ?? [];
23
+ if (hh === undefined || mm === undefined) {
24
+ return false;
25
+ }
26
+ return date.getHours() > hh || (date.getHours() === hh && date.getMinutes() > mm);
27
+ }
28
+ //# sourceMappingURL=cat-time-math.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-time-math.js","sourceRoot":"","sources":["../../../src/components/cat-time/cat-time-math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,KAAK,CAAC,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACrE,IAAI,EAAE,KAAK,SAAS,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;AACpF,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,IAAU,EAAE,IAAmB;IACrD,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACrE,IAAI,EAAE,KAAK,SAAS,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;AACpF,CAAC","sourcesContent":["export function clampTime(min: string | null, date: Date, max: string | null): Date {\n const [, hhMin, mmMin] = min?.match(/(\\d{2}):(\\d{2})/)?.map(Number) ?? [];\n const [, hhMax, mmMax] = max?.match(/(\\d{2}):(\\d{2})/)?.map(Number) ?? [];\n let minTime = -Infinity;\n let maxTime = Infinity;\n if (hhMin !== undefined && mmMin !== undefined) {\n minTime = new Date(date.getFullYear(), date.getMonth(), date.getDate(), hhMin, mmMin).getTime();\n }\n if (hhMax !== undefined && mmMax !== undefined) {\n maxTime = new Date(date.getFullYear(), date.getMonth(), date.getDate(), hhMax, mmMax).getTime();\n }\n return new Date(Math.min(Math.max(date.getTime(), minTime), maxTime));\n}\n\nexport function isBefore(date: Date, time: string | null): boolean {\n const [, hh, mm] = time?.match(/(\\d{2}):(\\d{2})/)?.map(Number) ?? [];\n if (hh === undefined || mm === undefined) {\n return false;\n }\n return date.getHours() < hh || (date.getHours() === hh && date.getMinutes() < mm);\n}\n\nexport function isAfter(date: Date, time: string | null): boolean {\n const [, hh, mm] = time?.match(/(\\d{2}):(\\d{2})/)?.map(Number) ?? [];\n if (hh === undefined || mm === undefined) {\n return false;\n }\n return date.getHours() > hh || (date.getHours() === hh && date.getMinutes() > mm);\n}\n"]}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Auto-generated file. Do not edit directly.
3
+ */
4
+ /* stylelint-disable value-keyword-case */
5
+ /* stylelint-enable value-keyword-case */
6
+ :host {
7
+ display: block;
8
+ }
9
+
10
+ :host([hidden]) {
11
+ display: none;
12
+ }
13
+
14
+ .label-aria {
15
+ position: absolute !important;
16
+ width: 1px !important;
17
+ height: 1px !important;
18
+ padding: 0 !important;
19
+ margin: -1px !important;
20
+ overflow: hidden !important;
21
+ clip: rect(0, 0, 0, 0) !important;
22
+ white-space: nowrap !important;
23
+ border: 0 !important;
24
+ }
25
+
26
+ .cat-time-addon {
27
+ margin-left: -1px;
28
+ }
29
+
30
+ nav {
31
+ max-height: 16rem;
32
+ }
33
+ nav ul {
34
+ list-style: none;
35
+ margin: 0;
36
+ padding: 0;
37
+ }
38
+
39
+ .time-disabled {
40
+ opacity: 0.25;
41
+ }
@@ -0,0 +1,11 @@
1
+ import { newE2EPage } from "@stencil/core/testing";
2
+ describe('cat-time', () => {
3
+ beforeAll(() => (console.error = jest.fn()));
4
+ it('renders', async () => {
5
+ const page = await newE2EPage();
6
+ await page.setContent('<cat-time></cat-time>');
7
+ const element = await page.find('cat-time');
8
+ expect(element).toHaveClass('hydrated');
9
+ });
10
+ });
11
+ //# sourceMappingURL=cat-time.e2e.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-time.e2e.js","sourceRoot":"","sources":["../../../src/components/cat-time/cat-time.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAE7C,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;QAE/C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC5C,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('cat-time', () => {\n beforeAll(() => (console.error = jest.fn()));\n\n it('renders', async () => {\n const page = await newE2EPage();\n await page.setContent('<cat-time></cat-time>');\n\n const element = await page.find('cat-time');\n expect(element).toHaveClass('hydrated');\n });\n});\n"]}