@haiilo/catalyst 11.0.0 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (350) hide show
  1. package/dist/catalyst/catalyst.esm.js +1 -1
  2. package/dist/catalyst/catalyst.esm.js.map +1 -1
  3. package/dist/catalyst/index.esm.js +2 -2
  4. package/dist/catalyst/index.esm.js.map +1 -1
  5. package/dist/catalyst/loader.esm.js.map +1 -0
  6. package/dist/catalyst/p-6a54965a.entry.js +10 -0
  7. package/dist/catalyst/p-6a54965a.entry.js.map +1 -0
  8. package/dist/catalyst/p-B-m4GNf1.js +3 -0
  9. package/dist/catalyst/p-B-m4GNf1.js.map +1 -0
  10. package/dist/catalyst/p-DQuL1Twl.js +2 -0
  11. package/dist/catalyst/p-DQuL1Twl.js.map +1 -0
  12. package/dist/catalyst/p-LJZzaWFR.js +2 -0
  13. package/dist/catalyst/p-LJZzaWFR.js.map +1 -0
  14. package/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
  15. package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
  16. package/dist/cjs/cat-alert_30.cjs.entry.js +1467 -1833
  17. package/dist/cjs/cat-alert_30.cjs.entry.js.map +1 -1
  18. package/dist/cjs/catalyst.cjs.js +8 -7
  19. package/dist/cjs/catalyst.cjs.js.map +1 -1
  20. package/dist/cjs/index-DNLT6JC9.js +10178 -0
  21. package/dist/cjs/index-DNLT6JC9.js.map +1 -0
  22. package/dist/cjs/{index-1094f0fc.js → index-jGQAsDy6.js} +528 -358
  23. package/dist/cjs/index-jGQAsDy6.js.map +1 -0
  24. package/dist/cjs/index.cjs.js +461 -453
  25. package/dist/cjs/index.cjs.js.map +1 -1
  26. package/dist/cjs/loader.cjs.js +4 -5
  27. package/dist/cjs/loader.cjs.js.map +1 -1
  28. package/dist/collection/collection-manifest.json +2 -2
  29. package/dist/collection/components/cat-alert/cat-alert.js +15 -4
  30. package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
  31. package/dist/collection/components/cat-avatar/cat-avatar.js +33 -14
  32. package/dist/collection/components/cat-avatar/cat-avatar.js.map +1 -1
  33. package/dist/collection/components/cat-badge/cat-badge.js +45 -9
  34. package/dist/collection/components/cat-badge/cat-badge.js.map +1 -1
  35. package/dist/collection/components/cat-button/cat-button.css +4 -2
  36. package/dist/collection/components/cat-button/cat-button.js +107 -35
  37. package/dist/collection/components/cat-button/cat-button.js.map +1 -1
  38. package/dist/collection/components/cat-button-group/cat-button-group.js +3 -2
  39. package/dist/collection/components/cat-button-group/cat-button-group.js.map +1 -1
  40. package/dist/collection/components/cat-checkbox/cat-checkbox.js +83 -24
  41. package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
  42. package/dist/collection/components/cat-date/cat-date.js +114 -39
  43. package/dist/collection/components/cat-date/cat-date.js.map +1 -1
  44. package/dist/collection/components/cat-date-inline/cat-date-inline.js +69 -19
  45. package/dist/collection/components/cat-date-inline/cat-date-inline.js.map +1 -1
  46. package/dist/collection/components/cat-datepicker/cat-datepicker.js +130 -42
  47. package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -1
  48. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js +37 -12
  49. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js.map +1 -1
  50. package/dist/collection/components/cat-dropdown/cat-dropdown.js +129 -17
  51. package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
  52. package/dist/collection/components/cat-form-group/cat-form-group.js +19 -4
  53. package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
  54. package/dist/collection/components/cat-icon/cat-icon.js +15 -7
  55. package/dist/collection/components/cat-icon/cat-icon.js.map +1 -1
  56. package/dist/collection/components/cat-input/cat-input.js +143 -51
  57. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  58. package/dist/collection/components/cat-pagination/cat-pagination.js +60 -10
  59. package/dist/collection/components/cat-pagination/cat-pagination.js.map +1 -1
  60. package/dist/collection/components/cat-radio/cat-radio.js +65 -18
  61. package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
  62. package/dist/collection/components/cat-radio-group/cat-radio-group.js +21 -8
  63. package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
  64. package/dist/collection/components/cat-scrollable/cat-scrollable.js +32 -7
  65. package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
  66. package/dist/collection/components/cat-select/cat-select.js +105 -34
  67. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  68. package/dist/collection/components/cat-skeleton/cat-skeleton.js +22 -5
  69. package/dist/collection/components/cat-skeleton/cat-skeleton.js.map +1 -1
  70. package/dist/collection/components/cat-spinner/cat-spinner.js +15 -4
  71. package/dist/collection/components/cat-spinner/cat-spinner.js.map +1 -1
  72. package/dist/collection/components/cat-tab/cat-tab.js +84 -17
  73. package/dist/collection/components/cat-tab/cat-tab.js.map +1 -1
  74. package/dist/collection/components/cat-tabs/cat-tabs.css +29 -12
  75. package/dist/collection/components/cat-tabs/cat-tabs.js +189 -8
  76. package/dist/collection/components/cat-tabs/cat-tabs.js.map +1 -1
  77. package/dist/collection/components/cat-tag/cat-tag.js +84 -25
  78. package/dist/collection/components/cat-tag/cat-tag.js.map +1 -1
  79. package/dist/collection/components/cat-textarea/cat-textarea.js +90 -32
  80. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
  81. package/dist/collection/components/cat-time/cat-time.js +120 -39
  82. package/dist/collection/components/cat-time/cat-time.js.map +1 -1
  83. package/dist/collection/components/cat-toggle/cat-toggle.js +71 -22
  84. package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
  85. package/dist/collection/components/cat-tooltip/cat-tooltip.js +49 -8
  86. package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
  87. package/dist/components/cat-alert.js +8 -3
  88. package/dist/components/cat-alert.js.map +1 -1
  89. package/dist/components/cat-avatar.js +1 -0
  90. package/dist/components/cat-avatar2.js +11 -8
  91. package/dist/components/cat-avatar2.js.map +1 -1
  92. package/dist/components/cat-badge.js +23 -3
  93. package/dist/components/cat-badge.js.map +1 -1
  94. package/dist/components/cat-button-group.js +2 -3
  95. package/dist/components/cat-button-group.js.map +1 -1
  96. package/dist/components/cat-button.js +1 -0
  97. package/dist/components/cat-button2.js +41 -17
  98. package/dist/components/cat-button2.js.map +1 -1
  99. package/dist/components/cat-card.js +2 -2
  100. package/dist/components/cat-card.js.map +1 -1
  101. package/dist/components/cat-checkbox.js +1 -0
  102. package/dist/components/cat-checkbox2.js +34 -10
  103. package/dist/components/cat-checkbox2.js.map +1 -1
  104. package/dist/components/cat-date-inline.js +1 -0
  105. package/dist/components/cat-date-inline2.js +29 -7
  106. package/dist/components/cat-date-inline2.js.map +1 -1
  107. package/dist/components/cat-date.js +41 -17
  108. package/dist/components/cat-date.js.map +1 -1
  109. package/dist/components/cat-datepicker-inline.js +16 -8
  110. package/dist/components/cat-datepicker-inline.js.map +1 -1
  111. package/dist/components/cat-datepicker.js +50 -20
  112. package/dist/components/cat-datepicker.js.map +1 -1
  113. package/dist/components/cat-datepicker.locale.js +110 -99
  114. package/dist/components/cat-datepicker.locale.js.map +1 -1
  115. package/dist/components/cat-dropdown.js +1 -0
  116. package/dist/components/cat-dropdown2.js +70 -13
  117. package/dist/components/cat-dropdown2.js.map +1 -1
  118. package/dist/components/cat-form-group.js +12 -3
  119. package/dist/components/cat-form-group.js.map +1 -1
  120. package/dist/components/cat-form-hint.js +1 -0
  121. package/dist/components/cat-form-hint.js.map +1 -1
  122. package/dist/components/cat-i18n-registry.js +1 -0
  123. package/dist/components/cat-i18n-registry.js.map +1 -1
  124. package/dist/components/cat-icon-registry.js +22 -21
  125. package/dist/components/cat-icon-registry.js.map +1 -1
  126. package/dist/components/cat-icon.js +1 -0
  127. package/dist/components/cat-icon2.js +5 -5
  128. package/dist/components/cat-icon2.js.map +1 -1
  129. package/dist/components/cat-input.js +1 -0
  130. package/dist/components/cat-input2.js +50 -25
  131. package/dist/components/cat-input2.js.map +1 -1
  132. package/dist/components/cat-pagination.js +32 -2
  133. package/dist/components/cat-pagination.js.map +1 -1
  134. package/dist/components/cat-radio-group.js +8 -5
  135. package/dist/components/cat-radio-group.js.map +1 -1
  136. package/dist/components/cat-radio.js +28 -8
  137. package/dist/components/cat-radio.js.map +1 -1
  138. package/dist/components/cat-scrollable.js +1 -0
  139. package/dist/components/cat-scrollable2.js +322 -542
  140. package/dist/components/cat-scrollable2.js.map +1 -1
  141. package/dist/components/cat-select-demo.js +27 -49
  142. package/dist/components/cat-select-demo.js.map +1 -1
  143. package/dist/components/cat-select.js +1 -0
  144. package/dist/components/cat-select2.js +135 -316
  145. package/dist/components/cat-select2.js.map +1 -1
  146. package/dist/components/cat-skeleton.js +1 -0
  147. package/dist/components/cat-skeleton2.js +12 -3
  148. package/dist/components/cat-skeleton2.js.map +1 -1
  149. package/dist/components/cat-spinner.js +1 -0
  150. package/dist/components/cat-spinner2.js +8 -3
  151. package/dist/components/cat-spinner2.js.map +1 -1
  152. package/dist/components/cat-tab.js +34 -9
  153. package/dist/components/cat-tab.js.map +1 -1
  154. package/dist/components/cat-tabs.js +140 -11
  155. package/dist/components/cat-tabs.js.map +1 -1
  156. package/dist/components/cat-tag.js +35 -13
  157. package/dist/components/cat-tag.js.map +1 -1
  158. package/dist/components/cat-textarea.js +33 -16
  159. package/dist/components/cat-textarea.js.map +1 -1
  160. package/dist/components/cat-time.js +44 -16
  161. package/dist/components/cat-time.js.map +1 -1
  162. package/dist/components/cat-toggle.js +28 -10
  163. package/dist/components/cat-toggle.js.map +1 -1
  164. package/dist/components/cat-tooltip.js +28 -3
  165. package/dist/components/cat-tooltip.js.map +1 -1
  166. package/dist/components/coerce.js +1 -0
  167. package/dist/components/coerce.js.map +1 -1
  168. package/dist/components/first-tabbable.js +1 -0
  169. package/dist/components/first-tabbable.js.map +1 -1
  170. package/dist/components/{floating-ui.dom.esm.js → floating-ui.dom.js} +3 -492
  171. package/dist/components/floating-ui.dom.js.map +1 -0
  172. package/dist/components/index.js +460 -450
  173. package/dist/components/index.js.map +1 -1
  174. package/dist/components/index2.js +9456 -0
  175. package/dist/components/index2.js.map +1 -0
  176. package/dist/components/loglevel.js +368 -356
  177. package/dist/components/loglevel.js.map +1 -1
  178. package/dist/components/media-matcher.js +1 -0
  179. package/dist/components/media-matcher.js.map +1 -1
  180. package/dist/esm/app-globals-DQuL1Twl.js +6 -0
  181. package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
  182. package/dist/esm/cat-alert_30.entry.js +1428 -1792
  183. package/dist/esm/cat-alert_30.entry.js.map +1 -1
  184. package/dist/esm/catalyst.js +7 -5
  185. package/dist/esm/catalyst.js.map +1 -1
  186. package/dist/esm/{index-e8c0ddf2.js → index-B-m4GNf1.js} +528 -338
  187. package/dist/esm/index-B-m4GNf1.js.map +1 -0
  188. package/dist/esm/index-LJZzaWFR.js +10057 -0
  189. package/dist/esm/index-LJZzaWFR.js.map +1 -0
  190. package/dist/esm/index.js +458 -448
  191. package/dist/esm/index.js.map +1 -1
  192. package/dist/esm/loader.js +5 -4
  193. package/dist/esm/loader.js.map +1 -1
  194. package/dist/types/components/cat-dropdown/cat-dropdown.d.ts +11 -1
  195. package/dist/types/components/cat-tab/cat-tab.d.ts +6 -0
  196. package/dist/types/components/cat-tabs/cat-tabs.d.ts +18 -0
  197. package/dist/types/components.d.ts +46 -0
  198. package/dist/types/stencil-public-runtime.d.ts +28 -2
  199. package/loader/index.d.ts +3 -0
  200. package/package.json +3 -3
  201. package/dist/catalyst/p-59e2ada2.entry.js +0 -10
  202. package/dist/catalyst/p-59e2ada2.entry.js.map +0 -1
  203. package/dist/catalyst/p-7f3bcfb9.js +0 -3
  204. package/dist/catalyst/p-7f3bcfb9.js.map +0 -1
  205. package/dist/catalyst/p-9500d6fb.js +0 -2
  206. package/dist/catalyst/p-9500d6fb.js.map +0 -1
  207. package/dist/catalyst/p-e1255160.js +0 -2
  208. package/dist/catalyst/p-e1255160.js.map +0 -1
  209. package/dist/cjs/app-globals-3a1e7e63.js +0 -7
  210. package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
  211. package/dist/cjs/index-1094f0fc.js.map +0 -1
  212. package/dist/cjs/of-958251e4.js +0 -1549
  213. package/dist/cjs/of-958251e4.js.map +0 -1
  214. package/dist/collection/components/cat-alert/cat-alert.e2e.js +0 -11
  215. package/dist/collection/components/cat-alert/cat-alert.e2e.js.map +0 -1
  216. package/dist/collection/components/cat-alert/cat-alert.spec.js +0 -14
  217. package/dist/collection/components/cat-alert/cat-alert.spec.js.map +0 -1
  218. package/dist/collection/components/cat-avatar/cat-avatar.e2e.js +0 -10
  219. package/dist/collection/components/cat-avatar/cat-avatar.e2e.js.map +0 -1
  220. package/dist/collection/components/cat-avatar/cat-avatar.spec.js +0 -14
  221. package/dist/collection/components/cat-avatar/cat-avatar.spec.js.map +0 -1
  222. package/dist/collection/components/cat-badge/cat-badge.e2e.js +0 -10
  223. package/dist/collection/components/cat-badge/cat-badge.e2e.js.map +0 -1
  224. package/dist/collection/components/cat-badge/cat-badge.spec.js +0 -14
  225. package/dist/collection/components/cat-badge/cat-badge.spec.js.map +0 -1
  226. package/dist/collection/components/cat-button/cat-button.e2e.js +0 -10
  227. package/dist/collection/components/cat-button/cat-button.e2e.js.map +0 -1
  228. package/dist/collection/components/cat-button/cat-button.spec.js +0 -20
  229. package/dist/collection/components/cat-button/cat-button.spec.js.map +0 -1
  230. package/dist/collection/components/cat-button-group/cat-button-group.e2e.js +0 -10
  231. package/dist/collection/components/cat-button-group/cat-button-group.e2e.js.map +0 -1
  232. package/dist/collection/components/cat-button-group/cat-button-group.spec.js +0 -14
  233. package/dist/collection/components/cat-button-group/cat-button-group.spec.js.map +0 -1
  234. package/dist/collection/components/cat-card/cat-card.e2e.js +0 -10
  235. package/dist/collection/components/cat-card/cat-card.e2e.js.map +0 -1
  236. package/dist/collection/components/cat-card/cat-card.spec.js +0 -14
  237. package/dist/collection/components/cat-card/cat-card.spec.js.map +0 -1
  238. package/dist/collection/components/cat-checkbox/cat-checkbox.e2e.js +0 -10
  239. package/dist/collection/components/cat-checkbox/cat-checkbox.e2e.js.map +0 -1
  240. package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js +0 -14
  241. package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js.map +0 -1
  242. package/dist/collection/components/cat-date/cat-date.e2e.js +0 -11
  243. package/dist/collection/components/cat-date/cat-date.e2e.js.map +0 -1
  244. package/dist/collection/components/cat-date/cat-date.spec.js +0 -17
  245. package/dist/collection/components/cat-date/cat-date.spec.js.map +0 -1
  246. package/dist/collection/components/cat-date-inline/cat-date-inline.e2e.js +0 -11
  247. package/dist/collection/components/cat-date-inline/cat-date-inline.e2e.js.map +0 -1
  248. package/dist/collection/components/cat-date-inline/cat-date-inline.spec.js +0 -16
  249. package/dist/collection/components/cat-date-inline/cat-date-inline.spec.js.map +0 -1
  250. package/dist/collection/components/cat-datepicker/cat-datepicker.e2e.js +0 -11
  251. package/dist/collection/components/cat-datepicker/cat-datepicker.e2e.js.map +0 -1
  252. package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js +0 -15
  253. package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js.map +0 -1
  254. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.e2e.js +0 -11
  255. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.e2e.js.map +0 -1
  256. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js +0 -15
  257. package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.spec.js.map +0 -1
  258. package/dist/collection/components/cat-dropdown/cat-dropdown.e2e.js +0 -10
  259. package/dist/collection/components/cat-dropdown/cat-dropdown.e2e.js.map +0 -1
  260. package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js +0 -21
  261. package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js.map +0 -1
  262. package/dist/collection/components/cat-form-group/cat-form-group.e2e.js +0 -10
  263. package/dist/collection/components/cat-form-group/cat-form-group.e2e.js.map +0 -1
  264. package/dist/collection/components/cat-form-group/cat-form-group.spec.js +0 -14
  265. package/dist/collection/components/cat-form-group/cat-form-group.spec.js.map +0 -1
  266. package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js +0 -15
  267. package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js.map +0 -1
  268. package/dist/collection/components/cat-i18n/cat-i18n-registry.spec.js +0 -7
  269. package/dist/collection/components/cat-i18n/cat-i18n-registry.spec.js.map +0 -1
  270. package/dist/collection/components/cat-icon/cat-icon-registry.spec.js +0 -7
  271. package/dist/collection/components/cat-icon/cat-icon-registry.spec.js.map +0 -1
  272. package/dist/collection/components/cat-icon/cat-icon.e2e.js +0 -11
  273. package/dist/collection/components/cat-icon/cat-icon.e2e.js.map +0 -1
  274. package/dist/collection/components/cat-icon/cat-icon.spec.js +0 -15
  275. package/dist/collection/components/cat-icon/cat-icon.spec.js.map +0 -1
  276. package/dist/collection/components/cat-input/cat-input.e2e.js +0 -11
  277. package/dist/collection/components/cat-input/cat-input.e2e.js.map +0 -1
  278. package/dist/collection/components/cat-input/cat-input.spec.js +0 -15
  279. package/dist/collection/components/cat-input/cat-input.spec.js.map +0 -1
  280. package/dist/collection/components/cat-notification/cat-notification.spec.js +0 -7
  281. package/dist/collection/components/cat-notification/cat-notification.spec.js.map +0 -1
  282. package/dist/collection/components/cat-pagination/cat-pagination.e2e.js +0 -14
  283. package/dist/collection/components/cat-pagination/cat-pagination.e2e.js.map +0 -1
  284. package/dist/collection/components/cat-pagination/cat-pagination.spec.js +0 -15
  285. package/dist/collection/components/cat-pagination/cat-pagination.spec.js.map +0 -1
  286. package/dist/collection/components/cat-radio/cat-radio.e2e.js +0 -10
  287. package/dist/collection/components/cat-radio/cat-radio.e2e.js.map +0 -1
  288. package/dist/collection/components/cat-radio/cat-radio.spec.js +0 -14
  289. package/dist/collection/components/cat-radio/cat-radio.spec.js.map +0 -1
  290. package/dist/collection/components/cat-radio-group/cat-radio-group.e2e.js +0 -10
  291. package/dist/collection/components/cat-radio-group/cat-radio-group.e2e.js.map +0 -1
  292. package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js +0 -14
  293. package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js.map +0 -1
  294. package/dist/collection/components/cat-scrollable/cat-scrollable.e2e.js +0 -10
  295. package/dist/collection/components/cat-scrollable/cat-scrollable.e2e.js.map +0 -1
  296. package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js +0 -14
  297. package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js.map +0 -1
  298. package/dist/collection/components/cat-select/cat-select.e2e.js +0 -14
  299. package/dist/collection/components/cat-select/cat-select.e2e.js.map +0 -1
  300. package/dist/collection/components/cat-select/cat-select.spec.js +0 -15
  301. package/dist/collection/components/cat-select/cat-select.spec.js.map +0 -1
  302. package/dist/collection/components/cat-skeleton/cat-skeleton.e2e.js +0 -10
  303. package/dist/collection/components/cat-skeleton/cat-skeleton.e2e.js.map +0 -1
  304. package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js +0 -14
  305. package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js.map +0 -1
  306. package/dist/collection/components/cat-spinner/cat-spinner.e2e.js +0 -10
  307. package/dist/collection/components/cat-spinner/cat-spinner.e2e.js.map +0 -1
  308. package/dist/collection/components/cat-spinner/cat-spinner.spec.js +0 -18
  309. package/dist/collection/components/cat-spinner/cat-spinner.spec.js.map +0 -1
  310. package/dist/collection/components/cat-tab/cat-tab.e2e.js +0 -10
  311. package/dist/collection/components/cat-tab/cat-tab.e2e.js.map +0 -1
  312. package/dist/collection/components/cat-tab/cat-tab.spec.js +0 -14
  313. package/dist/collection/components/cat-tab/cat-tab.spec.js.map +0 -1
  314. package/dist/collection/components/cat-tabs/cat-tabs.e2e.js +0 -10
  315. package/dist/collection/components/cat-tabs/cat-tabs.e2e.js.map +0 -1
  316. package/dist/collection/components/cat-tabs/cat-tabs.spec.js +0 -14
  317. package/dist/collection/components/cat-tabs/cat-tabs.spec.js.map +0 -1
  318. package/dist/collection/components/cat-tag/cat-tag.e2e.js +0 -14
  319. package/dist/collection/components/cat-tag/cat-tag.e2e.js.map +0 -1
  320. package/dist/collection/components/cat-tag/cat-tag.spec.js +0 -23
  321. package/dist/collection/components/cat-tag/cat-tag.spec.js.map +0 -1
  322. package/dist/collection/components/cat-textarea/cat-textarea.e2e.js +0 -11
  323. package/dist/collection/components/cat-textarea/cat-textarea.e2e.js.map +0 -1
  324. package/dist/collection/components/cat-textarea/cat-textarea.spec.js +0 -15
  325. package/dist/collection/components/cat-textarea/cat-textarea.spec.js.map +0 -1
  326. package/dist/collection/components/cat-time/cat-time.e2e.js +0 -11
  327. package/dist/collection/components/cat-time/cat-time.e2e.js.map +0 -1
  328. package/dist/collection/components/cat-time/cat-time.spec.js +0 -16
  329. package/dist/collection/components/cat-time/cat-time.spec.js.map +0 -1
  330. package/dist/collection/components/cat-toggle/cat-toggle.e2e.js +0 -10
  331. package/dist/collection/components/cat-toggle/cat-toggle.e2e.js.map +0 -1
  332. package/dist/collection/components/cat-toggle/cat-toggle.spec.js +0 -14
  333. package/dist/collection/components/cat-toggle/cat-toggle.spec.js.map +0 -1
  334. package/dist/collection/components/cat-tooltip/cat-tooltip.e2e.js +0 -10
  335. package/dist/collection/components/cat-tooltip/cat-tooltip.e2e.js.map +0 -1
  336. package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js +0 -20
  337. package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js.map +0 -1
  338. package/dist/collection/utils/media-matcher.spec.js +0 -39
  339. package/dist/collection/utils/media-matcher.spec.js.map +0 -1
  340. package/dist/components/floating-ui.dom.esm.js.map +0 -1
  341. package/dist/components/from.js +0 -928
  342. package/dist/components/from.js.map +0 -1
  343. package/dist/components/of.js +0 -10
  344. package/dist/components/of.js.map +0 -1
  345. package/dist/esm/app-globals-0f993ce5.js +0 -5
  346. package/dist/esm/app-globals-0f993ce5.js.map +0 -1
  347. package/dist/esm/index-e8c0ddf2.js.map +0 -1
  348. package/dist/esm/of-e4ec2eb4.js +0 -1523
  349. package/dist/esm/of-e4ec2eb4.js.map +0 -1
  350. package/loader/package.json +0 -11
@@ -15,31 +15,59 @@ export class CatTime {
15
15
  this.selectionTime = null;
16
16
  this.isAm = true;
17
17
  this.valueChangedBySelection = false;
18
+ /**
19
+ * Whether the label need a marker to shown if the input is required or optional.
20
+ */
18
21
  this.requiredMarker = 'optional';
22
+ /**
23
+ * Whether the label is on top or left.
24
+ */
19
25
  this.horizontal = false;
26
+ /**
27
+ * Hint for form autofill feature.
28
+ */
20
29
  this.autoComplete = 'off';
30
+ /**
31
+ * Whether the input should show a clear button.
32
+ */
21
33
  this.clearable = false;
34
+ /**
35
+ * Whether the input is disabled.
36
+ */
22
37
  this.disabled = false;
23
- this.hint = undefined;
24
- this.icon = undefined;
38
+ /**
39
+ * Display the icon on the right.
40
+ */
25
41
  this.iconRight = false;
26
- this.identifier = undefined;
42
+ /**
43
+ * The label for the input.
44
+ */
27
45
  this.label = '';
46
+ /**
47
+ * Visually hide the label, but still show it to assistive technologies like screen readers.
48
+ */
28
49
  this.labelHidden = false;
29
- this.max = undefined;
30
- this.min = undefined;
31
- this.name = undefined;
32
- this.placeholder = undefined;
33
- this.textPrefix = undefined;
34
- this.textSuffix = undefined;
50
+ /**
51
+ * The value is not editable.
52
+ */
35
53
  this.readonly = false;
54
+ /**
55
+ * A value is required or must be check for the form to be submittable.
56
+ */
36
57
  this.required = false;
37
- this.value = undefined;
38
- this.errors = undefined;
58
+ /**
59
+ * Fine-grained control over when the errors are shown. Can be `false` to
60
+ * never show errors, `true` to show errors on blur, or a number to show
61
+ * errors change with the given delay in milliseconds or immediately on blur.
62
+ */
39
63
  this.errorUpdate = 0;
40
- this.nativeAttributes = undefined;
41
- this.testId = undefined;
64
+ /**
65
+ * The placement of the dropdown.
66
+ */
42
67
  this.placement = 'bottom-end';
68
+ /**
69
+ * The step size for times in minutes.
70
+ */
43
71
  this.step = 30;
44
72
  }
45
73
  onMinChanged(min, oldMin) {
@@ -222,6 +250,7 @@ export class CatTime {
222
250
  return {
223
251
  "requiredMarker": {
224
252
  "type": "string",
253
+ "attribute": "required-marker",
225
254
  "mutable": false,
226
255
  "complexType": {
227
256
  "original": "'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!'",
@@ -234,12 +263,14 @@ export class CatTime {
234
263
  "tags": [],
235
264
  "text": "Whether the label need a marker to shown if the input is required or optional."
236
265
  },
237
- "attribute": "required-marker",
266
+ "getter": false,
267
+ "setter": false,
238
268
  "reflect": false,
239
269
  "defaultValue": "'optional'"
240
270
  },
241
271
  "horizontal": {
242
272
  "type": "boolean",
273
+ "attribute": "horizontal",
243
274
  "mutable": false,
244
275
  "complexType": {
245
276
  "original": "boolean",
@@ -252,12 +283,14 @@ export class CatTime {
252
283
  "tags": [],
253
284
  "text": "Whether the label is on top or left."
254
285
  },
255
- "attribute": "horizontal",
286
+ "getter": false,
287
+ "setter": false,
256
288
  "reflect": false,
257
289
  "defaultValue": "false"
258
290
  },
259
291
  "autoComplete": {
260
292
  "type": "string",
293
+ "attribute": "auto-complete",
261
294
  "mutable": false,
262
295
  "complexType": {
263
296
  "original": "string",
@@ -270,12 +303,14 @@ export class CatTime {
270
303
  "tags": [],
271
304
  "text": "Hint for form autofill feature."
272
305
  },
273
- "attribute": "auto-complete",
306
+ "getter": false,
307
+ "setter": false,
274
308
  "reflect": false,
275
309
  "defaultValue": "'off'"
276
310
  },
277
311
  "clearable": {
278
312
  "type": "boolean",
313
+ "attribute": "clearable",
279
314
  "mutable": false,
280
315
  "complexType": {
281
316
  "original": "boolean",
@@ -288,12 +323,14 @@ export class CatTime {
288
323
  "tags": [],
289
324
  "text": "Whether the input should show a clear button."
290
325
  },
291
- "attribute": "clearable",
326
+ "getter": false,
327
+ "setter": false,
292
328
  "reflect": false,
293
329
  "defaultValue": "false"
294
330
  },
295
331
  "disabled": {
296
332
  "type": "boolean",
333
+ "attribute": "disabled",
297
334
  "mutable": false,
298
335
  "complexType": {
299
336
  "original": "boolean",
@@ -306,12 +343,14 @@ export class CatTime {
306
343
  "tags": [],
307
344
  "text": "Whether the input is disabled."
308
345
  },
309
- "attribute": "disabled",
346
+ "getter": false,
347
+ "setter": false,
310
348
  "reflect": false,
311
349
  "defaultValue": "false"
312
350
  },
313
351
  "hint": {
314
352
  "type": "string",
353
+ "attribute": "hint",
315
354
  "mutable": false,
316
355
  "complexType": {
317
356
  "original": "string | string[]",
@@ -324,11 +363,13 @@ export class CatTime {
324
363
  "tags": [],
325
364
  "text": "Optional hint text(s) to be displayed with the input."
326
365
  },
327
- "attribute": "hint",
366
+ "getter": false,
367
+ "setter": false,
328
368
  "reflect": false
329
369
  },
330
370
  "icon": {
331
371
  "type": "string",
372
+ "attribute": "icon",
332
373
  "mutable": false,
333
374
  "complexType": {
334
375
  "original": "string",
@@ -341,11 +382,13 @@ export class CatTime {
341
382
  "tags": [],
342
383
  "text": "The name of an icon to be displayed in the input."
343
384
  },
344
- "attribute": "icon",
385
+ "getter": false,
386
+ "setter": false,
345
387
  "reflect": false
346
388
  },
347
389
  "iconRight": {
348
390
  "type": "boolean",
391
+ "attribute": "icon-right",
349
392
  "mutable": false,
350
393
  "complexType": {
351
394
  "original": "boolean",
@@ -358,12 +401,14 @@ export class CatTime {
358
401
  "tags": [],
359
402
  "text": "Display the icon on the right."
360
403
  },
361
- "attribute": "icon-right",
404
+ "getter": false,
405
+ "setter": false,
362
406
  "reflect": false,
363
407
  "defaultValue": "false"
364
408
  },
365
409
  "identifier": {
366
410
  "type": "string",
411
+ "attribute": "identifier",
367
412
  "mutable": false,
368
413
  "complexType": {
369
414
  "original": "string",
@@ -376,11 +421,13 @@ export class CatTime {
376
421
  "tags": [],
377
422
  "text": "A unique identifier for the input."
378
423
  },
379
- "attribute": "identifier",
424
+ "getter": false,
425
+ "setter": false,
380
426
  "reflect": false
381
427
  },
382
428
  "label": {
383
429
  "type": "string",
430
+ "attribute": "label",
384
431
  "mutable": false,
385
432
  "complexType": {
386
433
  "original": "string",
@@ -393,12 +440,14 @@ export class CatTime {
393
440
  "tags": [],
394
441
  "text": "The label for the input."
395
442
  },
396
- "attribute": "label",
443
+ "getter": false,
444
+ "setter": false,
397
445
  "reflect": false,
398
446
  "defaultValue": "''"
399
447
  },
400
448
  "labelHidden": {
401
449
  "type": "boolean",
450
+ "attribute": "label-hidden",
402
451
  "mutable": false,
403
452
  "complexType": {
404
453
  "original": "boolean",
@@ -411,12 +460,14 @@ export class CatTime {
411
460
  "tags": [],
412
461
  "text": "Visually hide the label, but still show it to assistive technologies like screen readers."
413
462
  },
414
- "attribute": "label-hidden",
463
+ "getter": false,
464
+ "setter": false,
415
465
  "reflect": false,
416
466
  "defaultValue": "false"
417
467
  },
418
468
  "max": {
419
469
  "type": "string",
470
+ "attribute": "max",
420
471
  "mutable": false,
421
472
  "complexType": {
422
473
  "original": "string",
@@ -429,11 +480,13 @@ export class CatTime {
429
480
  "tags": [],
430
481
  "text": "A maximum time value given in HH:mm format."
431
482
  },
432
- "attribute": "max",
483
+ "getter": false,
484
+ "setter": false,
433
485
  "reflect": false
434
486
  },
435
487
  "min": {
436
488
  "type": "string",
489
+ "attribute": "min",
437
490
  "mutable": false,
438
491
  "complexType": {
439
492
  "original": "string",
@@ -446,11 +499,13 @@ export class CatTime {
446
499
  "tags": [],
447
500
  "text": "A minimum value given in HH:mm format."
448
501
  },
449
- "attribute": "min",
502
+ "getter": false,
503
+ "setter": false,
450
504
  "reflect": false
451
505
  },
452
506
  "name": {
453
507
  "type": "string",
508
+ "attribute": "name",
454
509
  "mutable": false,
455
510
  "complexType": {
456
511
  "original": "string",
@@ -463,11 +518,13 @@ export class CatTime {
463
518
  "tags": [],
464
519
  "text": "The name of the form control. Submitted with the form as part of a name/value pair."
465
520
  },
466
- "attribute": "name",
521
+ "getter": false,
522
+ "setter": false,
467
523
  "reflect": false
468
524
  },
469
525
  "placeholder": {
470
526
  "type": "string",
527
+ "attribute": "placeholder",
471
528
  "mutable": false,
472
529
  "complexType": {
473
530
  "original": "string",
@@ -480,11 +537,13 @@ export class CatTime {
480
537
  "tags": [],
481
538
  "text": "The placeholder text to display within the input."
482
539
  },
483
- "attribute": "placeholder",
540
+ "getter": false,
541
+ "setter": false,
484
542
  "reflect": false
485
543
  },
486
544
  "textPrefix": {
487
545
  "type": "string",
546
+ "attribute": "text-prefix",
488
547
  "mutable": false,
489
548
  "complexType": {
490
549
  "original": "string",
@@ -497,11 +556,13 @@ export class CatTime {
497
556
  "tags": [],
498
557
  "text": "A textual prefix to be displayed in the input."
499
558
  },
500
- "attribute": "text-prefix",
559
+ "getter": false,
560
+ "setter": false,
501
561
  "reflect": false
502
562
  },
503
563
  "textSuffix": {
504
564
  "type": "string",
565
+ "attribute": "text-suffix",
505
566
  "mutable": false,
506
567
  "complexType": {
507
568
  "original": "string",
@@ -514,11 +575,13 @@ export class CatTime {
514
575
  "tags": [],
515
576
  "text": "A textual suffix to be displayed in the input."
516
577
  },
517
- "attribute": "text-suffix",
578
+ "getter": false,
579
+ "setter": false,
518
580
  "reflect": false
519
581
  },
520
582
  "readonly": {
521
583
  "type": "boolean",
584
+ "attribute": "readonly",
522
585
  "mutable": false,
523
586
  "complexType": {
524
587
  "original": "boolean",
@@ -531,12 +594,14 @@ export class CatTime {
531
594
  "tags": [],
532
595
  "text": "The value is not editable."
533
596
  },
534
- "attribute": "readonly",
597
+ "getter": false,
598
+ "setter": false,
535
599
  "reflect": false,
536
600
  "defaultValue": "false"
537
601
  },
538
602
  "required": {
539
603
  "type": "boolean",
604
+ "attribute": "required",
540
605
  "mutable": false,
541
606
  "complexType": {
542
607
  "original": "boolean",
@@ -549,12 +614,14 @@ export class CatTime {
549
614
  "tags": [],
550
615
  "text": "A value is required or must be check for the form to be submittable."
551
616
  },
552
- "attribute": "required",
617
+ "getter": false,
618
+ "setter": false,
553
619
  "reflect": false,
554
620
  "defaultValue": "false"
555
621
  },
556
622
  "value": {
557
623
  "type": "string",
624
+ "attribute": "value",
558
625
  "mutable": true,
559
626
  "complexType": {
560
627
  "original": "string",
@@ -567,11 +634,13 @@ export class CatTime {
567
634
  "tags": [],
568
635
  "text": "The value of the control given in HH:mm format"
569
636
  },
570
- "attribute": "value",
637
+ "getter": false,
638
+ "setter": false,
571
639
  "reflect": false
572
640
  },
573
641
  "errors": {
574
642
  "type": "boolean",
643
+ "attribute": "errors",
575
644
  "mutable": false,
576
645
  "complexType": {
577
646
  "original": "boolean | string[] | ErrorMap",
@@ -590,11 +659,13 @@ export class CatTime {
590
659
  "tags": [],
591
660
  "text": "The validation errors for this input. Will render a hint under the input\nwith the translated error message(s) `error.${key}`. If an object is\npassed, the keys will be used as error keys and the values translation\nparameters.\nIf the value is `true`, the input will be marked as invalid without any\nhints under the input."
592
661
  },
593
- "attribute": "errors",
662
+ "getter": false,
663
+ "setter": false,
594
664
  "reflect": false
595
665
  },
596
666
  "errorUpdate": {
597
667
  "type": "any",
668
+ "attribute": "error-update",
598
669
  "mutable": false,
599
670
  "complexType": {
600
671
  "original": "boolean | number",
@@ -607,12 +678,14 @@ export class CatTime {
607
678
  "tags": [],
608
679
  "text": "Fine-grained control over when the errors are shown. Can be `false` to\nnever show errors, `true` to show errors on blur, or a number to show\nerrors change with the given delay in milliseconds or immediately on blur."
609
680
  },
610
- "attribute": "error-update",
681
+ "getter": false,
682
+ "setter": false,
611
683
  "reflect": false,
612
684
  "defaultValue": "0"
613
685
  },
614
686
  "nativeAttributes": {
615
687
  "type": "unknown",
688
+ "attribute": "native-attributes",
616
689
  "mutable": false,
617
690
  "complexType": {
618
691
  "original": "{ [key: string]: string }",
@@ -624,10 +697,13 @@ export class CatTime {
624
697
  "docs": {
625
698
  "tags": [],
626
699
  "text": "Attributes that will be added to the native HTML input element."
627
- }
700
+ },
701
+ "getter": false,
702
+ "setter": false
628
703
  },
629
704
  "testId": {
630
705
  "type": "string",
706
+ "attribute": "test-id",
631
707
  "mutable": false,
632
708
  "complexType": {
633
709
  "original": "string",
@@ -640,11 +716,13 @@ export class CatTime {
640
716
  "tags": [],
641
717
  "text": "A unique identifier for the underlying native element that is used for\ntesting purposes. The attribute is added as `data-test` attribute and acts\nas a shorthand for `nativeAttributes={ 'data-test': 'test-Id' }`."
642
718
  },
643
- "attribute": "test-id",
719
+ "getter": false,
720
+ "setter": false,
644
721
  "reflect": false
645
722
  },
646
723
  "placement": {
647
724
  "type": "string",
725
+ "attribute": "placement",
648
726
  "mutable": false,
649
727
  "complexType": {
650
728
  "original": "Placement",
@@ -663,12 +741,14 @@ export class CatTime {
663
741
  "tags": [],
664
742
  "text": "The placement of the dropdown."
665
743
  },
666
- "attribute": "placement",
744
+ "getter": false,
745
+ "setter": false,
667
746
  "reflect": false,
668
747
  "defaultValue": "'bottom-end'"
669
748
  },
670
749
  "step": {
671
750
  "type": "number",
751
+ "attribute": "step",
672
752
  "mutable": false,
673
753
  "complexType": {
674
754
  "original": "number",
@@ -681,7 +761,8 @@ export class CatTime {
681
761
  "tags": [],
682
762
  "text": "The step size for times in minutes."
683
763
  },
684
- "attribute": "step",
764
+ "getter": false,
765
+ "setter": false,
685
766
  "reflect": false,
686
767
  "defaultValue": "30"
687
768
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cat-time.js","sourceRoot":"","sources":["../../../src/components/cat-time/cat-time.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAErH,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG/D;;GAEG;AAQH,MAAM,OAAO,OAAO;;Q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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Placement } from '@floating-ui/dom';\nimport { Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, Watch, h } from '@stencil/core';\nimport { ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\nimport { formatIso, getLocale } from './cat-time-locale';\nimport { clampTime, isAfter, isBefore } from './cat-time-math';\nimport { FormatTimeOptions } from 'cleave-zen';\n\n/**\n * A time input component to select a time in a dropdown.\n */\n@Component({\n tag: 'cat-time',\n styleUrl: 'cat-time.scss',\n shadow: {\n delegatesFocus: true\n }\n})\nexport class CatTime {\n private readonly language = i18n.getLocale();\n private readonly locale = getLocale(this.language);\n private readonly timeMaskOptions: FormatTimeOptions = { timeFormat: this.locale.timeFormat, timePattern: ['h', 'm'] };\n private input?: HTMLCatInputElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n @State() hasSlottedHint = false;\n\n @State() selectionTime: Date | null = null;\n\n @State() isAm = true;\n\n @State() valueChangedBySelection = false;\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 = 'off';\n\n /**\n * Whether the input should show a clear button.\n */\n @Prop() clearable = 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 time value given in HH:mm format.\n */\n @Prop() max?: string;\n\n /**\n * A minimum value given in HH:mm format.\n */\n @Prop() min?: string;\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 * The value of the control given in HH:mm format\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 change with the given delay in milliseconds or immediately on blur.\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 * A unique identifier for the underlying native element that is used for\n * testing purposes. The attribute is added as `data-test` attribute and acts\n * as a shorthand for `nativeAttributes={ 'data-test': 'test-Id' }`.\n */\n @Prop() testId?: string;\n\n /**\n * The placement of the dropdown.\n */\n @Prop() placement: Placement = 'bottom-end';\n\n /**\n * The step size for times in minutes.\n */\n @Prop() step = 30;\n\n @Watch('min')\n onMinChanged(min?: string, oldMin?: string) {\n if (min !== oldMin) {\n this.reclamp('min', min);\n }\n }\n\n @Watch('max')\n onMaxChanged(max?: string, oldMax?: string) {\n if (max !== oldMax) {\n this.reclamp('max', max);\n }\n }\n\n @Watch('value')\n onValueChanged(value: string, oldValue: string) {\n if (this.valueChangedBySelection) {\n this.valueChangedBySelection = false;\n } else if (value !== oldValue) {\n this.set12hFormat();\n this.syncValue(value ?? '');\n }\n }\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 componentWillLoad() {\n this.set12hFormat();\n this.syncValue(this.value ?? '');\n }\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n }\n\n @Listen('catOpen')\n onOpen() {\n const query = (selector: string) => this.hostElement.shadowRoot?.querySelector<HTMLCatButtonElement>(selector);\n const time = clampTime(this.min ?? null, this.selectionTime ?? new Date(2000, 5, 1, 8), this.max ?? null);\n const elem1 = query(`[data-time=\"${formatIso(time)}\"]`);\n time.setMinutes(Math.floor(time.getMinutes() / this.step) * this.step);\n const elem2 = query(`[data-time=\"${formatIso(time)}\"]`);\n setTimeout(() => {\n (elem2 ?? elem1)?.doFocus();\n (elem2 ?? elem1)?.scrollIntoView(this.selectionTime ? { block: 'center' } : undefined);\n }); // not entirely sure why this is necessary\n }\n\n /**\n * Select a time in the picker.\n *\n * @param date The time to select.\n */\n @Method()\n async select(date: Date | null): Promise<void> {\n const oldValue = this.value;\n let newValue = this.value;\n if (!date) {\n this.selectionTime = null;\n newValue = undefined;\n } else {\n const time = clampTime(this.min ?? null, date, this.max ?? null);\n this.isAm = this.format(time).toLowerCase().includes('am');\n this.selectionTime = time;\n newValue = formatIso(time);\n }\n // we need to set the input explicitly to sync the input even without a\n // rerender (if the value is not changed)\n if (this.input) {\n this.input.value = this.format(this.selectionTime, false);\n }\n if (oldValue !== newValue) {\n this.valueChangedBySelection = true;\n this.value = newValue;\n this.catChange.emit(this.value);\n } else {\n this.valueChangedBySelection = false;\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 this.input?.doFocus(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?.doBlur();\n }\n\n /**\n * Clear the input.\n */\n @Method()\n async clear(): Promise<void> {\n this.input?.clear();\n }\n\n render() {\n this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;\n return (\n <Host>\n <cat-input\n class=\"cat-time-input\"\n ref={el => (this.input = el as HTMLCatInputElement)}\n requiredMarker={this.requiredMarker}\n horizontal={this.horizontal}\n autoComplete={this.autoComplete}\n clearable={this.clearable}\n disabled={this.disabled}\n hint={this.hint}\n icon={this.icon}\n iconRight={this.iconRight}\n identifier={this.identifier}\n label={this.label}\n labelHidden={this.labelHidden}\n name={this.name}\n placeholder={this.placeholder}\n textPrefix={this.textPrefix}\n textSuffix={this.textSuffix}\n readonly={this.readonly}\n required={this.required}\n value={this.format(this.selectionTime, false)}\n errors={this.errors}\n errorUpdate={this.errorUpdate}\n testId={this.testId}\n nativeAttributes={this.nativeAttributes}\n timeMaskOptions={this.timeMaskOptions}\n onCatFocus={e => this.catFocus.emit(e.detail)}\n onCatBlur={e => this.onInputBlur(e.detail)}\n >\n <span slot=\"label\">\n {this.hasSlottedLabel && <slot name=\"label\"></slot>}\n {!this.hasSlottedLabel && this.label}\n <span class=\"label-aria\"> (HH:mm)</span>\n </span>\n <div slot=\"addon\" class=\"cat-time-addon\">\n {this.locale.timeFormat === '12' && (\n <cat-button\n class=\"cat-time-format\"\n disabled={this.disabled || this.readonly}\n onCatClick={() => this.toggleAm()}\n >\n {this.isAm ? 'AM' : 'PM'}\n </cat-button>\n )}\n <cat-dropdown slot=\"addon\" placement={this.placement}>\n <cat-button\n slot=\"trigger\"\n class=\"cat-time-toggle\"\n disabled={this.disabled || this.readonly}\n icon=\"$cat:timepicker-clock\"\n iconOnly\n a11yLabel={\n this.selectionTime ? `${this.locale.change}, ${this.format(this.selectionTime)}` : this.locale.choose\n }\n ></cat-button>\n <nav slot=\"content\" class=\"cat-nav\">\n <ul>\n {this.timeArray().map(time => {\n const isoTime = formatIso(time);\n const disabled = isBefore(time, this.min ?? null) || isAfter(time, this.max ?? null);\n return (\n <li>\n <cat-button\n class={{\n 'cat-nav-item': true,\n 'time-disabled': disabled\n }}\n disabled={disabled}\n active={isoTime === this.value}\n color={isoTime === this.value ? 'primary' : 'secondary'}\n variant={isoTime === this.value ? 'filled' : 'outlined'}\n onCatClick={() => this.select(time)}\n data-time={isoTime}\n >\n {this.format(time)}\n </cat-button>\n </li>\n );\n })}\n </ul>\n </nav>\n </cat-dropdown>\n </div>\n {this.hasSlottedHint && (\n <span slot=\"hint\">\n <slot name=\"hint\"></slot>\n </span>\n )}\n </cat-input>\n </Host>\n );\n }\n\n private timeArray() {\n const result = [];\n const start = new Date(2000, 5, 1, 0, 0, 0);\n let time = new Date(start.getTime());\n while (time.getDate() === start.getDate()) {\n result.push(time);\n time = new Date(time.getTime() + this.step * 60000);\n }\n return result;\n }\n\n private syncValue(value: string) {\n const [, hh, mm] = value.match(/(\\d{2}):(\\d{2})/)?.map(Number) ?? [];\n if (hh === undefined || mm === undefined) {\n this.select(null);\n return;\n }\n\n this.select(\n this.locale.timeFormat === '24'\n ? new Date(2000, 5, 1, hh, mm, 0)\n : new Date(2000, 5, 1, (hh % 12) + (this.isAm ? 0 : 12), mm, 0)\n );\n }\n\n private set12hFormat() {\n const [, hh] = this.value?.match(/(\\d{2}):(\\d{2})/)?.map(Number) ?? [];\n if (this.locale.timeFormat === '12') {\n this.isAm = hh === 0 || hh < 12;\n }\n }\n\n private toggleAm() {\n if (this.selectionTime) {\n this.select(new Date(this.selectionTime.getTime() + (this.isAm ? 12 : -12) * 3600000));\n } else {\n this.isAm = !this.isAm;\n }\n }\n\n private onInputBlur(e: FocusEvent) {\n this.syncValue(this.input?.value ?? '');\n this.catBlur.emit(e);\n }\n\n private format(date: Date | null, includeAmPm = true) {\n const str = date\n ? new Intl.DateTimeFormat(this.language, {\n hour: '2-digit',\n minute: '2-digit'\n }).format(date)\n : '';\n return includeAmPm ? str : str.replace(/\\s?(am|pm)/i, '');\n }\n\n private reclamp(mode: 'min' | 'max', limit: string | undefined) {\n if (!this.value) return;\n const min = (mode === 'min' ? limit : this.min) ?? null;\n const max = (mode === 'max' ? limit : this.max) ?? null;\n const [match, hh, mm] = this.value.match(/(\\d{2}):(\\d{2})/) ?? [];\n const newValue = match ? formatIso(clampTime(min, new Date(2000, 5, 1, Number(hh), Number(mm)), max)) : undefined;\n if (this.value !== newValue) {\n this.syncValue(newValue ?? '');\n this.catChange.emit(newValue);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"cat-time.js","sourceRoot":"","sources":["../../../src/components/cat-time/cat-time.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAErH,OAAO,EAAE,eAAe,IA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placement } from '@floating-ui/dom';\nimport { Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, Watch, h } from '@stencil/core';\nimport { ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\nimport { formatIso, getLocale } from './cat-time-locale';\nimport { clampTime, isAfter, isBefore } from './cat-time-math';\nimport { FormatTimeOptions } from 'cleave-zen';\n\n/**\n * A time input component to select a time in a dropdown.\n */\n@Component({\n tag: 'cat-time',\n styleUrl: 'cat-time.scss',\n shadow: {\n delegatesFocus: true\n }\n})\nexport class CatTime {\n private readonly language = i18n.getLocale();\n private readonly locale = getLocale(this.language);\n private readonly timeMaskOptions: FormatTimeOptions = { timeFormat: this.locale.timeFormat, timePattern: ['h', 'm'] };\n private input?: HTMLCatInputElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n @State() hasSlottedHint = false;\n\n @State() selectionTime: Date | null = null;\n\n @State() isAm = true;\n\n @State() valueChangedBySelection = false;\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 = 'off';\n\n /**\n * Whether the input should show a clear button.\n */\n @Prop() clearable = 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 time value given in HH:mm format.\n */\n @Prop() max?: string;\n\n /**\n * A minimum value given in HH:mm format.\n */\n @Prop() min?: string;\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 * The value of the control given in HH:mm format\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 change with the given delay in milliseconds or immediately on blur.\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 * A unique identifier for the underlying native element that is used for\n * testing purposes. The attribute is added as `data-test` attribute and acts\n * as a shorthand for `nativeAttributes={ 'data-test': 'test-Id' }`.\n */\n @Prop() testId?: string;\n\n /**\n * The placement of the dropdown.\n */\n @Prop() placement: Placement = 'bottom-end';\n\n /**\n * The step size for times in minutes.\n */\n @Prop() step = 30;\n\n @Watch('min')\n onMinChanged(min?: string, oldMin?: string) {\n if (min !== oldMin) {\n this.reclamp('min', min);\n }\n }\n\n @Watch('max')\n onMaxChanged(max?: string, oldMax?: string) {\n if (max !== oldMax) {\n this.reclamp('max', max);\n }\n }\n\n @Watch('value')\n onValueChanged(value: string, oldValue: string) {\n if (this.valueChangedBySelection) {\n this.valueChangedBySelection = false;\n } else if (value !== oldValue) {\n this.set12hFormat();\n this.syncValue(value ?? '');\n }\n }\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 componentWillLoad() {\n this.set12hFormat();\n this.syncValue(this.value ?? '');\n }\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n this.hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n }\n\n @Listen('catOpen')\n onOpen() {\n const query = (selector: string) => this.hostElement.shadowRoot?.querySelector<HTMLCatButtonElement>(selector);\n const time = clampTime(this.min ?? null, this.selectionTime ?? new Date(2000, 5, 1, 8), this.max ?? null);\n const elem1 = query(`[data-time=\"${formatIso(time)}\"]`);\n time.setMinutes(Math.floor(time.getMinutes() / this.step) * this.step);\n const elem2 = query(`[data-time=\"${formatIso(time)}\"]`);\n setTimeout(() => {\n (elem2 ?? elem1)?.doFocus();\n (elem2 ?? elem1)?.scrollIntoView(this.selectionTime ? { block: 'center' } : undefined);\n }); // not entirely sure why this is necessary\n }\n\n /**\n * Select a time in the picker.\n *\n * @param date The time to select.\n */\n @Method()\n async select(date: Date | null): Promise<void> {\n const oldValue = this.value;\n let newValue = this.value;\n if (!date) {\n this.selectionTime = null;\n newValue = undefined;\n } else {\n const time = clampTime(this.min ?? null, date, this.max ?? null);\n this.isAm = this.format(time).toLowerCase().includes('am');\n this.selectionTime = time;\n newValue = formatIso(time);\n }\n // we need to set the input explicitly to sync the input even without a\n // rerender (if the value is not changed)\n if (this.input) {\n this.input.value = this.format(this.selectionTime, false);\n }\n if (oldValue !== newValue) {\n this.valueChangedBySelection = true;\n this.value = newValue;\n this.catChange.emit(this.value);\n } else {\n this.valueChangedBySelection = false;\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 this.input?.doFocus(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?.doBlur();\n }\n\n /**\n * Clear the input.\n */\n @Method()\n async clear(): Promise<void> {\n this.input?.clear();\n }\n\n render() {\n this.hostElement.tabIndex = Number(this.hostElement.getAttribute('tabindex')) || 0;\n return (\n <Host>\n <cat-input\n class=\"cat-time-input\"\n ref={el => (this.input = el as HTMLCatInputElement)}\n requiredMarker={this.requiredMarker}\n horizontal={this.horizontal}\n autoComplete={this.autoComplete}\n clearable={this.clearable}\n disabled={this.disabled}\n hint={this.hint}\n icon={this.icon}\n iconRight={this.iconRight}\n identifier={this.identifier}\n label={this.label}\n labelHidden={this.labelHidden}\n name={this.name}\n placeholder={this.placeholder}\n textPrefix={this.textPrefix}\n textSuffix={this.textSuffix}\n readonly={this.readonly}\n required={this.required}\n value={this.format(this.selectionTime, false)}\n errors={this.errors}\n errorUpdate={this.errorUpdate}\n testId={this.testId}\n nativeAttributes={this.nativeAttributes}\n timeMaskOptions={this.timeMaskOptions}\n onCatFocus={e => this.catFocus.emit(e.detail)}\n onCatBlur={e => this.onInputBlur(e.detail)}\n >\n <span slot=\"label\">\n {this.hasSlottedLabel && <slot name=\"label\"></slot>}\n {!this.hasSlottedLabel && this.label}\n <span class=\"label-aria\"> (HH:mm)</span>\n </span>\n <div slot=\"addon\" class=\"cat-time-addon\">\n {this.locale.timeFormat === '12' && (\n <cat-button\n class=\"cat-time-format\"\n disabled={this.disabled || this.readonly}\n onCatClick={() => this.toggleAm()}\n >\n {this.isAm ? 'AM' : 'PM'}\n </cat-button>\n )}\n <cat-dropdown slot=\"addon\" placement={this.placement}>\n <cat-button\n slot=\"trigger\"\n class=\"cat-time-toggle\"\n disabled={this.disabled || this.readonly}\n icon=\"$cat:timepicker-clock\"\n iconOnly\n a11yLabel={\n this.selectionTime ? `${this.locale.change}, ${this.format(this.selectionTime)}` : this.locale.choose\n }\n ></cat-button>\n <nav slot=\"content\" class=\"cat-nav\">\n <ul>\n {this.timeArray().map(time => {\n const isoTime = formatIso(time);\n const disabled = isBefore(time, this.min ?? null) || isAfter(time, this.max ?? null);\n return (\n <li>\n <cat-button\n class={{\n 'cat-nav-item': true,\n 'time-disabled': disabled\n }}\n disabled={disabled}\n active={isoTime === this.value}\n color={isoTime === this.value ? 'primary' : 'secondary'}\n variant={isoTime === this.value ? 'filled' : 'outlined'}\n onCatClick={() => this.select(time)}\n data-time={isoTime}\n >\n {this.format(time)}\n </cat-button>\n </li>\n );\n })}\n </ul>\n </nav>\n </cat-dropdown>\n </div>\n {this.hasSlottedHint && (\n <span slot=\"hint\">\n <slot name=\"hint\"></slot>\n </span>\n )}\n </cat-input>\n </Host>\n );\n }\n\n private timeArray() {\n const result = [];\n const start = new Date(2000, 5, 1, 0, 0, 0);\n let time = new Date(start.getTime());\n while (time.getDate() === start.getDate()) {\n result.push(time);\n time = new Date(time.getTime() + this.step * 60000);\n }\n return result;\n }\n\n private syncValue(value: string) {\n const [, hh, mm] = value.match(/(\\d{2}):(\\d{2})/)?.map(Number) ?? [];\n if (hh === undefined || mm === undefined) {\n this.select(null);\n return;\n }\n\n this.select(\n this.locale.timeFormat === '24'\n ? new Date(2000, 5, 1, hh, mm, 0)\n : new Date(2000, 5, 1, (hh % 12) + (this.isAm ? 0 : 12), mm, 0)\n );\n }\n\n private set12hFormat() {\n const [, hh] = this.value?.match(/(\\d{2}):(\\d{2})/)?.map(Number) ?? [];\n if (this.locale.timeFormat === '12') {\n this.isAm = hh === 0 || hh < 12;\n }\n }\n\n private toggleAm() {\n if (this.selectionTime) {\n this.select(new Date(this.selectionTime.getTime() + (this.isAm ? 12 : -12) * 3600000));\n } else {\n this.isAm = !this.isAm;\n }\n }\n\n private onInputBlur(e: FocusEvent) {\n this.syncValue(this.input?.value ?? '');\n this.catBlur.emit(e);\n }\n\n private format(date: Date | null, includeAmPm = true) {\n const str = date\n ? new Intl.DateTimeFormat(this.language, {\n hour: '2-digit',\n minute: '2-digit'\n }).format(date)\n : '';\n return includeAmPm ? str : str.replace(/\\s?(am|pm)/i, '');\n }\n\n private reclamp(mode: 'min' | 'max', limit: string | undefined) {\n if (!this.value) return;\n const min = (mode === 'min' ? limit : this.min) ?? null;\n const max = (mode === 'max' ? limit : this.max) ?? null;\n const [match, hh, mm] = this.value.match(/(\\d{2}):(\\d{2})/) ?? [];\n const newValue = match ? formatIso(clampTime(min, new Date(2000, 5, 1, Number(hh), Number(mm)), max)) : undefined;\n if (this.value !== newValue) {\n this.syncValue(newValue ?? '');\n this.catChange.emit(newValue);\n }\n }\n}\n"]}