@haiilo/catalyst 6.0.3 → 6.1.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 (256) 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/p-2a094d64.entry.js +10 -0
  6. package/dist/catalyst/p-2a094d64.entry.js.map +1 -0
  7. package/dist/catalyst/{p-d7dc291a.js → p-48621e71.js} +1 -1
  8. package/dist/catalyst/p-48621e71.js.map +1 -0
  9. package/dist/catalyst/p-6904eb66.js +3 -0
  10. package/dist/catalyst/p-6904eb66.js.map +1 -0
  11. package/dist/cjs/cat-alert_25.cjs.entry.js +21 -9
  12. package/dist/cjs/cat-alert_25.cjs.entry.js.map +1 -1
  13. package/dist/cjs/{cat-icon-registry-6161e2ee.js → cat-icon-registry-5647cf1f.js} +1 -1
  14. package/dist/cjs/cat-icon-registry-5647cf1f.js.map +1 -0
  15. package/dist/cjs/catalyst.cjs.js +3 -6
  16. package/dist/cjs/catalyst.cjs.js.map +1 -1
  17. package/dist/cjs/{index-4258b31e.js → index-e06682a8.js} +89 -32
  18. package/dist/cjs/index-e06682a8.js.map +1 -0
  19. package/dist/cjs/index.cjs.js +1 -1
  20. package/dist/cjs/index.cjs.js.map +1 -1
  21. package/dist/cjs/loader.cjs.js +2 -11
  22. package/dist/cjs/loader.cjs.js.map +1 -1
  23. package/dist/collection/collection-manifest.json +27 -27
  24. package/dist/collection/components/cat-alert/cat-alert.e2e.js +11 -0
  25. package/dist/collection/components/cat-alert/cat-alert.e2e.js.map +1 -0
  26. package/dist/collection/components/cat-alert/cat-alert.js +2 -2
  27. package/dist/collection/components/cat-alert/cat-alert.spec.js +21 -0
  28. package/dist/collection/components/cat-alert/cat-alert.spec.js.map +1 -0
  29. package/dist/collection/components/cat-avatar/cat-avatar.e2e.js +10 -0
  30. package/dist/collection/components/cat-avatar/cat-avatar.e2e.js.map +1 -0
  31. package/dist/collection/components/cat-avatar/cat-avatar.js +3 -3
  32. package/dist/collection/components/cat-avatar/cat-avatar.spec.js +18 -0
  33. package/dist/collection/components/cat-avatar/cat-avatar.spec.js.map +1 -0
  34. package/dist/collection/components/cat-badge/cat-badge.e2e.js +10 -0
  35. package/dist/collection/components/cat-badge/cat-badge.e2e.js.map +1 -0
  36. package/dist/collection/components/cat-badge/cat-badge.js +1 -1
  37. package/dist/collection/components/cat-badge/cat-badge.spec.js +18 -0
  38. package/dist/collection/components/cat-badge/cat-badge.spec.js.map +1 -0
  39. package/dist/collection/components/cat-button/cat-button.e2e.js +10 -0
  40. package/dist/collection/components/cat-button/cat-button.e2e.js.map +1 -0
  41. package/dist/collection/components/cat-button/cat-button.js +20 -12
  42. package/dist/collection/components/cat-button/cat-button.js.map +1 -1
  43. package/dist/collection/components/cat-button/cat-button.spec.js +18 -0
  44. package/dist/collection/components/cat-button/cat-button.spec.js.map +1 -0
  45. package/dist/collection/components/cat-button-group/cat-button-group.e2e.js +10 -0
  46. package/dist/collection/components/cat-button-group/cat-button-group.e2e.js.map +1 -0
  47. package/dist/collection/components/cat-button-group/cat-button-group.js +1 -1
  48. package/dist/collection/components/cat-button-group/cat-button-group.spec.js +18 -0
  49. package/dist/collection/components/cat-button-group/cat-button-group.spec.js.map +1 -0
  50. package/dist/collection/components/cat-card/cat-card.e2e.js +10 -0
  51. package/dist/collection/components/cat-card/cat-card.e2e.js.map +1 -0
  52. package/dist/collection/components/cat-card/cat-card.js +1 -1
  53. package/dist/collection/components/cat-card/cat-card.spec.js +18 -0
  54. package/dist/collection/components/cat-card/cat-card.spec.js.map +1 -0
  55. package/dist/collection/components/cat-checkbox/cat-checkbox.e2e.js +10 -0
  56. package/dist/collection/components/cat-checkbox/cat-checkbox.e2e.js.map +1 -0
  57. package/dist/collection/components/cat-checkbox/cat-checkbox.js +51 -31
  58. package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
  59. package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js +29 -0
  60. package/dist/collection/components/cat-checkbox/cat-checkbox.spec.js.map +1 -0
  61. package/dist/collection/components/cat-datepicker/cat-datepicker.e2e.js +11 -0
  62. package/dist/collection/components/cat-datepicker/cat-datepicker.e2e.js.map +1 -0
  63. package/dist/collection/components/cat-datepicker/cat-datepicker.js +18 -12
  64. package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -1
  65. package/dist/collection/components/cat-datepicker/cat-datepicker.locale.js +1 -1
  66. package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js +19 -0
  67. package/dist/collection/components/cat-datepicker/cat-datepicker.spec.js.map +1 -0
  68. package/dist/collection/components/cat-dropdown/cat-dropdown.e2e.js +10 -0
  69. package/dist/collection/components/cat-dropdown/cat-dropdown.e2e.js.map +1 -0
  70. package/dist/collection/components/cat-dropdown/cat-dropdown.js +17 -11
  71. package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
  72. package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js +26 -0
  73. package/dist/collection/components/cat-dropdown/cat-dropdown.spec.js.map +1 -0
  74. package/dist/collection/components/cat-form-group/cat-form-group.e2e.js +10 -0
  75. package/dist/collection/components/cat-form-group/cat-form-group.e2e.js.map +1 -0
  76. package/dist/collection/components/cat-form-group/cat-form-group.js +1 -1
  77. package/dist/collection/components/cat-form-group/cat-form-group.spec.js +18 -0
  78. package/dist/collection/components/cat-form-group/cat-form-group.spec.js.map +1 -0
  79. package/dist/collection/components/cat-form-hint/cat-form-hint.js +2 -2
  80. package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js +15 -0
  81. package/dist/collection/components/cat-form-hint/cat-form-hint.spec.js.map +1 -0
  82. package/dist/collection/components/cat-i18n/cat-i18n-registry.js +1 -1
  83. package/dist/collection/components/cat-i18n/cat-i18n-registry.spec.js +7 -0
  84. package/dist/collection/components/cat-i18n/cat-i18n-registry.spec.js.map +1 -0
  85. package/dist/collection/components/cat-icon/cat-icon-registry.js +13 -13
  86. package/dist/collection/components/cat-icon/cat-icon-registry.spec.js +7 -0
  87. package/dist/collection/components/cat-icon/cat-icon-registry.spec.js.map +1 -0
  88. package/dist/collection/components/cat-icon/cat-icon.e2e.js +11 -0
  89. package/dist/collection/components/cat-icon/cat-icon.e2e.js.map +1 -0
  90. package/dist/collection/components/cat-icon/cat-icon.js +2 -2
  91. package/dist/collection/components/cat-icon/cat-icon.spec.js +15 -0
  92. package/dist/collection/components/cat-icon/cat-icon.spec.js.map +1 -0
  93. package/dist/collection/components/cat-input/cat-input.e2e.js +11 -0
  94. package/dist/collection/components/cat-input/cat-input.e2e.js.map +1 -0
  95. package/dist/collection/components/cat-input/cat-input.js +21 -13
  96. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  97. package/dist/collection/components/cat-input/cat-input.spec.js +36 -0
  98. package/dist/collection/components/cat-input/cat-input.spec.js.map +1 -0
  99. package/dist/collection/components/cat-notification/cat-notification.js +4 -3
  100. package/dist/collection/components/cat-notification/cat-notification.js.map +1 -1
  101. package/dist/collection/components/cat-notification/cat-notification.spec.js +7 -0
  102. package/dist/collection/components/cat-notification/cat-notification.spec.js.map +1 -0
  103. package/dist/collection/components/cat-pagination/cat-pagination.e2e.js +14 -0
  104. package/dist/collection/components/cat-pagination/cat-pagination.e2e.js.map +1 -0
  105. package/dist/collection/components/cat-pagination/cat-pagination.js +2 -2
  106. package/dist/collection/components/cat-pagination/cat-pagination.spec.js +31 -0
  107. package/dist/collection/components/cat-pagination/cat-pagination.spec.js.map +1 -0
  108. package/dist/collection/components/cat-radio/cat-radio.e2e.js +10 -0
  109. package/dist/collection/components/cat-radio/cat-radio.e2e.js.map +1 -0
  110. package/dist/collection/components/cat-radio/cat-radio.js +13 -8
  111. package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
  112. package/dist/collection/components/cat-radio/cat-radio.spec.js +24 -0
  113. package/dist/collection/components/cat-radio/cat-radio.spec.js.map +1 -0
  114. package/dist/collection/components/cat-radio-group/cat-radio-group.e2e.js +10 -0
  115. package/dist/collection/components/cat-radio-group/cat-radio-group.e2e.js.map +1 -0
  116. package/dist/collection/components/cat-radio-group/cat-radio-group.js +5 -3
  117. package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
  118. package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js +20 -0
  119. package/dist/collection/components/cat-radio-group/cat-radio-group.spec.js.map +1 -0
  120. package/dist/collection/components/cat-scrollable/cat-scrollable.e2e.js +10 -0
  121. package/dist/collection/components/cat-scrollable/cat-scrollable.e2e.js.map +1 -0
  122. package/dist/collection/components/cat-scrollable/cat-scrollable.js +6 -4
  123. package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
  124. package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js +25 -0
  125. package/dist/collection/components/cat-scrollable/cat-scrollable.spec.js.map +1 -0
  126. package/dist/collection/components/cat-select/cat-select.e2e.js +14 -0
  127. package/dist/collection/components/cat-select/cat-select.e2e.js.map +1 -0
  128. package/dist/collection/components/cat-select/cat-select.js +39 -23
  129. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  130. package/dist/collection/components/cat-select/cat-select.spec.js +41 -0
  131. package/dist/collection/components/cat-select/cat-select.spec.js.map +1 -0
  132. package/dist/collection/components/cat-select-demo/cat-select-demo.js +2 -2
  133. package/dist/collection/components/cat-skeleton/cat-skeleton.e2e.js +10 -0
  134. package/dist/collection/components/cat-skeleton/cat-skeleton.e2e.js.map +1 -0
  135. package/dist/collection/components/cat-skeleton/cat-skeleton.js +1 -1
  136. package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js +18 -0
  137. package/dist/collection/components/cat-skeleton/cat-skeleton.spec.js.map +1 -0
  138. package/dist/collection/components/cat-spinner/cat-spinner.e2e.js +10 -0
  139. package/dist/collection/components/cat-spinner/cat-spinner.e2e.js.map +1 -0
  140. package/dist/collection/components/cat-spinner/cat-spinner.js +1 -1
  141. package/dist/collection/components/cat-spinner/cat-spinner.spec.js +18 -0
  142. package/dist/collection/components/cat-spinner/cat-spinner.spec.js.map +1 -0
  143. package/dist/collection/components/cat-tab/cat-tab.e2e.js +10 -0
  144. package/dist/collection/components/cat-tab/cat-tab.e2e.js.map +1 -0
  145. package/dist/collection/components/cat-tab/cat-tab.js +5 -3
  146. package/dist/collection/components/cat-tab/cat-tab.js.map +1 -1
  147. package/dist/collection/components/cat-tab/cat-tab.spec.js +17 -0
  148. package/dist/collection/components/cat-tab/cat-tab.spec.js.map +1 -0
  149. package/dist/collection/components/cat-tabs/cat-tabs.e2e.js +10 -0
  150. package/dist/collection/components/cat-tabs/cat-tabs.e2e.js.map +1 -0
  151. package/dist/collection/components/cat-tabs/cat-tabs.js +1 -1
  152. package/dist/collection/components/cat-tabs/cat-tabs.spec.js +17 -0
  153. package/dist/collection/components/cat-tabs/cat-tabs.spec.js.map +1 -0
  154. package/dist/collection/components/cat-textarea/cat-textarea.e2e.js +11 -0
  155. package/dist/collection/components/cat-textarea/cat-textarea.e2e.js.map +1 -0
  156. package/dist/collection/components/cat-textarea/cat-textarea.js +20 -13
  157. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
  158. package/dist/collection/components/cat-textarea/cat-textarea.spec.js +34 -0
  159. package/dist/collection/components/cat-textarea/cat-textarea.spec.js.map +1 -0
  160. package/dist/collection/components/cat-toggle/cat-toggle.e2e.js +10 -0
  161. package/dist/collection/components/cat-toggle/cat-toggle.e2e.js.map +1 -0
  162. package/dist/collection/components/cat-toggle/cat-toggle.js +13 -8
  163. package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
  164. package/dist/collection/components/cat-toggle/cat-toggle.spec.js +22 -0
  165. package/dist/collection/components/cat-toggle/cat-toggle.spec.js.map +1 -0
  166. package/dist/collection/components/cat-tooltip/cat-tooltip.e2e.js +10 -0
  167. package/dist/collection/components/cat-tooltip/cat-tooltip.e2e.js.map +1 -0
  168. package/dist/collection/components/cat-tooltip/cat-tooltip.js +8 -5
  169. package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
  170. package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js +24 -0
  171. package/dist/collection/components/cat-tooltip/cat-tooltip.spec.js.map +1 -0
  172. package/dist/collection/utils/first-tabbable.js +1 -1
  173. package/dist/collection/utils/media-matcher.js +2 -2
  174. package/dist/collection/utils/media-matcher.spec.js +39 -0
  175. package/dist/collection/utils/media-matcher.spec.js.map +1 -0
  176. package/dist/components/cat-alert.js +1 -1
  177. package/dist/components/cat-alert.js.map +1 -1
  178. package/dist/components/cat-avatar2.js +1 -1
  179. package/dist/components/cat-avatar2.js.map +1 -1
  180. package/dist/components/cat-badge.js +1 -1
  181. package/dist/components/cat-badge.js.map +1 -1
  182. package/dist/components/cat-button-group.js +1 -1
  183. package/dist/components/cat-button-group.js.map +1 -1
  184. package/dist/components/cat-button2.js +1 -1
  185. package/dist/components/cat-button2.js.map +1 -1
  186. package/dist/components/cat-card.js +1 -1
  187. package/dist/components/cat-card.js.map +1 -1
  188. package/dist/components/cat-checkbox2.js +17 -7
  189. package/dist/components/cat-checkbox2.js.map +1 -1
  190. package/dist/components/cat-datepicker.js +1 -1
  191. package/dist/components/cat-datepicker.js.map +1 -1
  192. package/dist/components/cat-dropdown2.js +1 -1
  193. package/dist/components/cat-dropdown2.js.map +1 -1
  194. package/dist/components/cat-form-group.js +1 -1
  195. package/dist/components/cat-form-group.js.map +1 -1
  196. package/dist/components/cat-form-hint.js.map +1 -1
  197. package/dist/components/cat-i18n-registry.js.map +1 -1
  198. package/dist/components/cat-icon-registry.js.map +1 -1
  199. package/dist/components/cat-icon2.js +1 -1
  200. package/dist/components/cat-icon2.js.map +1 -1
  201. package/dist/components/cat-input2.js +1 -1
  202. package/dist/components/cat-input2.js.map +1 -1
  203. package/dist/components/cat-pagination.js +1 -1
  204. package/dist/components/cat-pagination.js.map +1 -1
  205. package/dist/components/cat-radio-group.js +1 -1
  206. package/dist/components/cat-radio-group.js.map +1 -1
  207. package/dist/components/cat-radio.js +1 -1
  208. package/dist/components/cat-radio.js.map +1 -1
  209. package/dist/components/cat-scrollable2.js +1 -1
  210. package/dist/components/cat-scrollable2.js.map +1 -1
  211. package/dist/components/cat-select-demo.js +1 -1
  212. package/dist/components/cat-select-demo.js.map +1 -1
  213. package/dist/components/cat-select2.js +5 -3
  214. package/dist/components/cat-select2.js.map +1 -1
  215. package/dist/components/cat-skeleton2.js +1 -1
  216. package/dist/components/cat-skeleton2.js.map +1 -1
  217. package/dist/components/cat-spinner2.js +1 -1
  218. package/dist/components/cat-spinner2.js.map +1 -1
  219. package/dist/components/cat-tab.js +1 -1
  220. package/dist/components/cat-tab.js.map +1 -1
  221. package/dist/components/cat-tabs.js +1 -1
  222. package/dist/components/cat-tabs.js.map +1 -1
  223. package/dist/components/cat-textarea.js +1 -1
  224. package/dist/components/cat-textarea.js.map +1 -1
  225. package/dist/components/cat-toggle.js +1 -1
  226. package/dist/components/cat-toggle.js.map +1 -1
  227. package/dist/components/cat-tooltip.js +2 -2
  228. package/dist/components/cat-tooltip.js.map +1 -1
  229. package/dist/components/coerce.js.map +1 -1
  230. package/dist/components/index.js.map +1 -1
  231. package/dist/esm/cat-alert_25.entry.js +21 -9
  232. package/dist/esm/cat-alert_25.entry.js.map +1 -1
  233. package/dist/esm/{cat-icon-registry-f15b29d9.js → cat-icon-registry-fc49b06c.js} +1 -1
  234. package/dist/esm/cat-icon-registry-fc49b06c.js.map +1 -0
  235. package/dist/esm/catalyst.js +4 -7
  236. package/dist/esm/catalyst.js.map +1 -1
  237. package/dist/esm/{index-636ce8d6.js → index-bac79c60.js} +89 -32
  238. package/dist/esm/index-bac79c60.js.map +1 -0
  239. package/dist/esm/index.js +2 -2
  240. package/dist/esm/index.js.map +1 -1
  241. package/dist/esm/loader.js +3 -12
  242. package/dist/esm/loader.js.map +1 -1
  243. package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +6 -4
  244. package/dist/types/stencil-public-runtime.d.ts +3 -0
  245. package/loader/index.d.ts +1 -1
  246. package/package.json +10 -10
  247. package/dist/catalyst/p-b218a2b0.entry.js +0 -10
  248. package/dist/catalyst/p-b218a2b0.entry.js.map +0 -1
  249. package/dist/catalyst/p-ce6a1db2.js +0 -3
  250. package/dist/catalyst/p-ce6a1db2.js.map +0 -1
  251. package/dist/catalyst/p-d7dc291a.js.map +0 -1
  252. package/dist/cjs/cat-icon-registry-6161e2ee.js.map +0 -1
  253. package/dist/cjs/index-4258b31e.js.map +0 -1
  254. package/dist/esm/cat-icon-registry-f15b29d9.js.map +0 -1
  255. package/dist/esm/index-636ce8d6.js.map +0 -1
  256. package/dist/esm/polyfills/css-shim.js +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"cat-datepicker.js","sourceRoot":"","sources":["../../../src/components/cat-datepicker/cat-datepicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAgB,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,gBAAgB,MAAM,8CAA8C,CAAC;AAE5E,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAOpD,MAAM,OAAO,iBAAiB;;0BAUqE,UAAU;sBAKtF,KAAK;;qBAUN,KAAK;oBAKN,KAAK;;;qBAeJ,KAAK;;iBAUT,EAAE;uBAKI,KAAK;;;gBAeyC,MAAM;;;;;oBAyBvD,KAAK;oBAKL,KAAK;gBAKT,CAAC;;;uBAsBwB,CAAC;;;EAjIzC,IAAY,KAAK;IACf,OAAO,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,IAAI,SAAS,CAAC;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, Method, EventEmitter, Prop, h } from '@stencil/core';\nimport flatpickr from 'flatpickr';\nimport weekSelectPlugin from 'flatpickr/dist/plugins/weekSelect/weekSelect';\nimport { ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\nimport { getFormat } from './cat-datepicker.config';\nimport { getLocale } from './cat-datepicker.locale';\n\n@Component({\n tag: 'cat-datepicker',\n styleUrl: 'cat-datepicker.scss',\n shadow: true\n})\nexport class CatDatepickerFlat {\n private pickr?: flatpickr.Instance;\n private _input?: HTMLCatInputElement;\n private get input(): HTMLInputElement | undefined {\n return this._input?.shadowRoot?.querySelector('input') ?? undefined;\n }\n\n /**\n * Whether the label need a marker to shown if the input is required or optional.\n */\n @Prop() requiredMarker: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!' = 'optional';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * Hint for form autofill feature.\n */\n @Prop() autoComplete?: string;\n\n /**\n * Whether the input should show a clear button.\n */\n @Prop() clearable = false;\n\n /**\n * Whether the input is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text(s) to be displayed with the input.\n */\n @Prop() hint?: string | string[];\n\n /**\n * The name of an icon to be displayed in the input.\n */\n @Prop() icon?: string;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label for the input.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * A maximum value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z.\n */\n @Prop() max?: string;\n\n /**\n * A minimum value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z.\n */\n @Prop() min?: string;\n\n /**\n * The mode of the datepicker, to select a date, time, both, a date range or a week number.\n */\n @Prop() mode: 'date' | 'time' | 'datetime' | 'daterange' | 'week' = 'date';\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 step size to use when changing the time.\n */\n @Prop() step = 5;\n\n /**\n * The value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z or as a week number string.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The validation errors for this input. Will render a hint under the input\n * with the translated error message(s) `error.${key}`. If an object is\n * passed, the keys will be used as error keys and the values translation\n * parameters.\n * If the value is `true`, the input will be marked as invalid without any\n * hints under the input.\n */\n @Prop() errors?: boolean | string[] | ErrorMap;\n\n /**\n * Fine-grained control over when the errors are shown. Can be `false` to\n * never show errors, `true` to show errors on blur, or a number to show\n * errors on change with the given delay in milliseconds.\n */\n @Prop() errorUpdate: boolean | number = 0;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter<string>;\n\n /**\n * Emitted when the input received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentDidLoad() {\n const input = this.input;\n if (input) {\n const locale = getLocale(i18n.getLocale());\n const format = getFormat(i18n.getLocale(), this.mode);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const plugins = this.mode === 'week' ? [new (weekSelectPlugin as any)({})] : [];\n this.pickr = flatpickr(input, {\n locale,\n plugins,\n altInput: true,\n prevArrow: '←',\n nextArrow: '→',\n dateFormat: this.dateFormat,\n altFormat: format,\n ariaDateFormat: format,\n mode: this.mode === 'daterange' ? 'range' : 'single',\n minDate: this.min,\n maxDate: this.max,\n enableTime: this.mode === 'time' || this.mode === 'datetime',\n noCalendar: this.mode === 'time',\n weekNumbers: true,\n minuteIncrement: this.step,\n onChange: (dates, dateStr, flatpickr) => {\n if (this.mode === 'week') {\n this.value = dates[0] ? flatpickr.config.getWeek(dates[0]).toString() : undefined;\n } else {\n this.value = dateStr;\n }\n this.catChange.emit(this.value);\n }\n });\n }\n }\n\n /**\n * Programmatically move focus to the datepicker. 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 datepicker. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this._input?.doBlur();\n }\n\n render() {\n return (\n <cat-input\n ref={el => (this._input = el)}\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.value}\n errors={this.errors}\n errorUpdate={this.errorUpdate}\n nativeAttributes={this.nativeAttributes}\n onCatChange={e => {\n e.stopPropagation();\n this.pickr?.setDate(e.detail);\n if (this.value !== (e.detail || undefined)) {\n this.value = e.detail || undefined;\n this.catChange.emit(this.value);\n }\n }}\n onCatFocus={e => {\n e.stopPropagation();\n this.catFocus.emit(e.detail);\n }}\n onCatBlur={e => {\n e.stopPropagation();\n this.catBlur.emit(e.detail);\n }}\n ></cat-input>\n );\n }\n\n private get dateFormat(): string {\n if (this.mode === 'week') {\n return 'W';\n } else if (this.mode === 'time') {\n return 'H:i';\n } else {\n return 'Z';\n }\n }\n}\n"]}
1
+ {"version":3,"file":"cat-datepicker.js","sourceRoot":"","sources":["../../../src/components/cat-datepicker/cat-datepicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAgB,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,gBAAgB,MAAM,8CAA8C,CAAC;AAE5E,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAOpD,MAAM,OAAO,iBAAiB;;0BAUqE,UAAU;sBAKtF,KAAK;;qBAUN,KAAK;oBAKN,KAAK;;;qBAeJ,KAAK;;iBAUT,EAAE;uBAKI,KAAK;;;gBAeyC,MAAM;;;;;oBAyBvD,KAAK;oBAKL,KAAK;gBAKT,CAAC;;;uBAsBwB,CAAC;;;EA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, Method, EventEmitter, Prop, h } from '@stencil/core';\nimport flatpickr from 'flatpickr';\nimport weekSelectPlugin from 'flatpickr/dist/plugins/weekSelect/weekSelect';\nimport { ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\nimport { getFormat } from './cat-datepicker.config';\nimport { getLocale } from './cat-datepicker.locale';\n\n@Component({\n tag: 'cat-datepicker',\n styleUrl: 'cat-datepicker.scss',\n shadow: true\n})\nexport class CatDatepickerFlat {\n private pickr?: flatpickr.Instance;\n private _input?: HTMLCatInputElement;\n private get input(): HTMLInputElement | undefined {\n return this._input?.shadowRoot?.querySelector('input') ?? undefined;\n }\n\n /**\n * Whether the label need a marker to shown if the input is required or optional.\n */\n @Prop() requiredMarker: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!' = 'optional';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * Hint for form autofill feature.\n */\n @Prop() autoComplete?: string;\n\n /**\n * Whether the input should show a clear button.\n */\n @Prop() clearable = false;\n\n /**\n * Whether the input is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text(s) to be displayed with the input.\n */\n @Prop() hint?: string | string[];\n\n /**\n * The name of an icon to be displayed in the input.\n */\n @Prop() icon?: string;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label for the input.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * A maximum value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z.\n */\n @Prop() max?: string;\n\n /**\n * A minimum value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z.\n */\n @Prop() min?: string;\n\n /**\n * The mode of the datepicker, to select a date, time, both, a date range or a week number.\n */\n @Prop() mode: 'date' | 'time' | 'datetime' | 'daterange' | 'week' = 'date';\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 step size to use when changing the time.\n */\n @Prop() step = 5;\n\n /**\n * The value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z or as a week number string.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The validation errors for this input. Will render a hint under the input\n * with the translated error message(s) `error.${key}`. If an object is\n * passed, the keys will be used as error keys and the values translation\n * parameters.\n * If the value is `true`, the input will be marked as invalid without any\n * hints under the input.\n */\n @Prop() errors?: boolean | string[] | ErrorMap;\n\n /**\n * Fine-grained control over when the errors are shown. Can be `false` to\n * never show errors, `true` to show errors on blur, or a number to show\n * errors on change with the given delay in milliseconds.\n */\n @Prop() errorUpdate: boolean | number = 0;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter<string>;\n\n /**\n * Emitted when the input received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentDidLoad() {\n const input = this.input;\n if (input) {\n const locale = getLocale(i18n.getLocale());\n const format = getFormat(i18n.getLocale(), this.mode);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const plugins = this.mode === 'week' ? [new (weekSelectPlugin as any)({})] : [];\n this.pickr = flatpickr(input, {\n locale,\n plugins,\n altInput: true,\n prevArrow: '←',\n nextArrow: '→',\n dateFormat: this.dateFormat,\n altFormat: format,\n ariaDateFormat: format,\n mode: this.mode === 'daterange' ? 'range' : 'single',\n minDate: this.min,\n maxDate: this.max,\n enableTime: this.mode === 'time' || this.mode === 'datetime',\n noCalendar: this.mode === 'time',\n weekNumbers: true,\n minuteIncrement: this.step,\n onChange: (dates, dateStr, flatpickr) => {\n if (this.mode === 'week') {\n this.value = dates[0] ? flatpickr.config.getWeek(dates[0]).toString() : undefined;\n } else {\n this.value = dateStr;\n }\n this.catChange.emit(this.value);\n }\n });\n }\n }\n\n /**\n * Programmatically move focus to the datepicker. 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 datepicker. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this._input?.doBlur();\n }\n\n render() {\n return (\n <cat-input\n ref={el => (this._input = el)}\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.value}\n errors={this.errors}\n errorUpdate={this.errorUpdate}\n nativeAttributes={this.nativeAttributes}\n onCatChange={e => {\n e.stopPropagation();\n this.pickr?.setDate(e.detail);\n if (this.value !== (e.detail || undefined)) {\n this.value = e.detail || undefined;\n this.catChange.emit(this.value);\n }\n }}\n onCatFocus={e => {\n e.stopPropagation();\n this.catFocus.emit(e.detail);\n }}\n onCatBlur={e => {\n e.stopPropagation();\n this.catBlur.emit(e.detail);\n }}\n ></cat-input>\n );\n }\n\n private get dateFormat(): string {\n if (this.mode === 'week') {\n return 'W';\n } else if (this.mode === 'time') {\n return 'H:i';\n } else {\n return 'Z';\n }\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';
1
+ import { catI18nRegistry as i18n } from "../cat-i18n/cat-i18n-registry";
2
2
  export function getHour12(language) {
3
3
  const dateStr = new Intl.DateTimeFormat(language, { hour: '2-digit', minute: '2-digit' })
4
4
  .format(new Date())
@@ -0,0 +1,19 @@
1
+ jest.mock('../cat-i18n/cat-i18n-registry');
2
+ import { newSpecPage } from "@stencil/core/testing";
3
+ import { CatDatepickerFlat } from "./cat-datepicker";
4
+ describe('cat-datepicker', () => {
5
+ it('renders', async () => {
6
+ const page = await newSpecPage({
7
+ components: [CatDatepickerFlat],
8
+ html: `<cat-datepicker label="Label"></cat-datepicker>`
9
+ });
10
+ expect(page.root).toEqualHtml(`
11
+ <cat-datepicker label="Label">
12
+ <mock:shadow-root>
13
+ <cat-input errorupdate="0" label="Label" requiredmarker="optional"></cat-input>
14
+ </mock:shadow-root>
15
+ </cat-datepicker>
16
+ `);
17
+ });
18
+ });
19
+ //# sourceMappingURL=cat-datepicker.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-datepicker.spec.js","sourceRoot":"","sources":["../../../src/components/cat-datepicker/cat-datepicker.spec.tsx"],"names":[],"mappings":"AAAA,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;EAC9B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,iBAAiB,CAAC;MAC/B,IAAI,EAAE,iDAAiD;KACxD,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;KAM7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["jest.mock('../cat-i18n/cat-i18n-registry');\n\nimport { newSpecPage } from '@stencil/core/testing';\nimport { CatDatepickerFlat } from './cat-datepicker';\n\ndescribe('cat-datepicker', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatDatepickerFlat],\n html: `<cat-datepicker label=\"Label\"></cat-datepicker>`\n });\n expect(page.root).toEqualHtml(`\n <cat-datepicker label=\"Label\">\n <mock:shadow-root>\n <cat-input errorupdate=\"0\" label=\"Label\" requiredmarker=\"optional\"></cat-input>\n </mock:shadow-root>\n </cat-datepicker>\n `);\n });\n});\n"]}
@@ -0,0 +1,10 @@
1
+ import { newE2EPage } from "@stencil/core/testing";
2
+ describe('cat-dropdown', () => {
3
+ it('renders', async () => {
4
+ const page = await newE2EPage();
5
+ await page.setContent('<cat-dropdown><button slot="trigger"></button><nav slot="content"></nav></cat-dropdown>');
6
+ const element = await page.find('cat-dropdown');
7
+ expect(element).toHaveClass('hydrated');
8
+ });
9
+ });
10
+ //# sourceMappingURL=cat-dropdown.e2e.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-dropdown.e2e.js","sourceRoot":"","sources":["../../../src/components/cat-dropdown/cat-dropdown.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;EAC5B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAChC,MAAM,IAAI,CAAC,UAAU,CAAC,yFAAyF,CAAC,CAAC;IAEjH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAChD,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;EAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('cat-dropdown', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n await page.setContent('<cat-dropdown><button slot=\"trigger\"></button><nav slot=\"content\"></nav></cat-dropdown>');\n\n const element = await page.find('cat-dropdown');\n expect(element).toHaveClass('hydrated');\n });\n});\n"]}
@@ -1,11 +1,11 @@
1
- import { autoUpdate, computePosition, flip, offset, size } from '@floating-ui/dom';
2
- import { timeTransitionS } from '@haiilo/catalyst-tokens';
3
- import { h, Host } from '@stencil/core';
4
- import * as focusTrap from 'focus-trap';
5
- import { tabbable } from 'tabbable';
6
- import firstTabbable from '../../utils/first-tabbable';
1
+ import { autoUpdate, computePosition, flip, offset, size } from "@floating-ui/dom";
2
+ import { timeTransitionS } from "@haiilo/catalyst-tokens";
3
+ import { h, Host } from "@stencil/core";
4
+ import * as focusTrap from "focus-trap";
5
+ import { tabbable } from "tabbable";
6
+ import firstTabbable from "../../utils/first-tabbable";
7
7
  let nextUniqueId = 0;
8
- export class CatDropdown {
8
+ class CatDropdown {
9
9
  constructor() {
10
10
  this.id = nextUniqueId++;
11
11
  this.isOpen = false;
@@ -188,7 +188,8 @@ export class CatDropdown {
188
188
  "references": {
189
189
  "Placement": {
190
190
  "location": "import",
191
- "path": "@floating-ui/dom"
191
+ "path": "@floating-ui/dom",
192
+ "id": "../node_modules/@floating-ui/dom/index.d.ts::Placement"
192
193
  }
193
194
  }
194
195
  },
@@ -256,7 +257,8 @@ export class CatDropdown {
256
257
  "resolved": "FocusEvent",
257
258
  "references": {
258
259
  "FocusEvent": {
259
- "location": "global"
260
+ "location": "global",
261
+ "id": "global::FocusEvent"
260
262
  }
261
263
  }
262
264
  }
@@ -275,7 +277,8 @@ export class CatDropdown {
275
277
  "resolved": "FocusEvent",
276
278
  "references": {
277
279
  "FocusEvent": {
278
- "location": "global"
280
+ "location": "global",
281
+ "id": "global::FocusEvent"
279
282
  }
280
283
  }
281
284
  }
@@ -289,7 +292,8 @@ export class CatDropdown {
289
292
  "parameters": [],
290
293
  "references": {
291
294
  "Promise": {
292
- "location": "global"
295
+ "location": "global",
296
+ "id": "global::Promise"
293
297
  }
294
298
  },
295
299
  "return": "Promise<void>"
@@ -310,6 +314,8 @@ export class CatDropdown {
310
314
  "passive": false
311
315
  }];
312
316
  }
317
+ static get stencilHasStaticMembersWithInit() { return true; }
313
318
  }
314
319
  CatDropdown.OFFSET = 4;
320
+ export { CatDropdown };
315
321
  //# sourceMappingURL=cat-dropdown.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cat-dropdown.js","sourceRoot":"","sources":["../../../src/components/cat-dropdown/cat-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAa,IAAI,EAAE,MAAM,kBAA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CAAC,MAAM,CAAC;UAC1B,IAAI,EAAE;UACN,IAAI,CAAC;YACH,OAAO,EAAE,WAAW,CAAC,MAAM;YAC3B,KAAK,CAAC,EAAE,cAAc,EAAE,eAAe,EAAE,QAAQ,EAAE;cACjD,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE;gBACrC,QAAQ,EAAE,GAAG,cAAc,IAAI;gBAC/B,SAAS,EAAE,GAAG,eAAe,IAAI;eAClC,CAAC,CAAC;YACL,CAAC;WACF,CAAC;SACH;OACF,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;QAC9B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;UAChC,IAAI,EAAE,GAAG,CAAC,IAAI;UACd,GAAG,EAAE,GAAG,CAAC,IAAI;SACd,CAAC,CAAC;MACL,CAAC,CAAC,CAAC;KACJ;EACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AArNuB,kBAAM,GAAG,CAAC,CAAC","sourcesContent":["import { autoUpdate, computePosition, flip, offset, Placement, size } from '@floating-ui/dom';\nimport { timeTransitionS } from '@haiilo/catalyst-tokens';\nimport { Component, Event, EventEmitter, h, Host, Listen, Method, Prop } from '@stencil/core';\nimport * as focusTrap from 'focus-trap';\nimport { FocusableElement, tabbable } from 'tabbable';\nimport firstTabbable from '../../utils/first-tabbable';\n\nlet nextUniqueId = 0;\n\n@Component({\n tag: 'cat-dropdown',\n styleUrl: 'cat-dropdown.scss',\n shadow: true\n})\nexport class CatDropdown {\n private static readonly OFFSET = 4;\n private readonly id = nextUniqueId++;\n private triggerSlot!: HTMLSlotElement;\n private trigger?: FocusableElement;\n private content!: HTMLElement;\n private trap?: focusTrap.FocusTrap;\n private keyListener?: (event: KeyboardEvent) => void;\n private isOpen: boolean | null = false;\n\n /**\n * The placement of the dropdown.\n */\n @Prop() placement: Placement = 'bottom-start';\n\n /**\n * Do not close the dropdown on outside clicks.\n */\n @Prop() noAutoClose = false;\n\n /**\n * Allow overflow when dropdown is open.\n */\n @Prop() overflow = false;\n\n /**\n * Emitted when the dropdown is opened.\n */\n @Event() catOpen!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the dropdown is closed.\n */\n @Event() catClose!: EventEmitter<FocusEvent>;\n\n @Listen('catClick')\n clickHandler(event: CustomEvent<MouseEvent>) {\n // we need to delay the initialization of the trigger until first,\n // interaction because the element might still be hidden (and thus not\n // tabbable) if contained in another Stencil web component\n if (!this.trigger) {\n this.initTrigger();\n this.toggle();\n }\n\n const button = event.target as HTMLButtonElement;\n\n // hide dropdown on button click\n if (!this.noAutoClose && event.composedPath().includes(this.content) && button.slot !== 'trigger') {\n this.close();\n }\n }\n\n /**\n * Toggles the dropdown.\n */\n async toggle(): Promise<void> {\n this.isOpen ? this.close() : this.open();\n }\n\n /**\n * Opens the dropdown.\n */\n async open(): Promise<void> {\n if (this.isOpen === null) {\n return; // busy\n }\n\n this.isOpen = null;\n this.content.style.display = 'block';\n // give CSS transition time to apply\n setTimeout(() => {\n this.isOpen = true;\n this.content.classList.add('show');\n this.trigger?.setAttribute('aria-expanded', 'true');\n this.catOpen.emit();\n this.trap = this.trap\n ? this.trap.updateContainerElements(this.content)\n : focusTrap.createFocusTrap(this.content, {\n tabbableOptions: {\n getShadowRoot: true\n },\n allowOutsideClick: true,\n clickOutsideDeactivates: event => {\n const shouldClose =\n !this.noAutoClose &&\n !event.composedPath().includes(this.content) &&\n (!this.trigger || !event.composedPath().includes(this.trigger));\n if (shouldClose) {\n this.close();\n }\n return shouldClose;\n },\n onPostDeactivate: () => this.close()\n });\n this.trap.activate();\n });\n }\n\n /**\n * Closes the dropdown.\n */\n @Method()\n async close(): Promise<void> {\n if (this.isOpen === null || !this.isOpen) {\n return; // busy\n }\n\n this.isOpen = null;\n this.content.classList.remove('show');\n // give CSS transition time to apply\n setTimeout(() => {\n this.isOpen = false;\n this.content.classList.remove('show');\n this.content.style.display = '';\n this.trigger?.setAttribute('aria-expanded', 'false');\n this.trap?.deactivate();\n this.catClose.emit();\n }, timeTransitionS);\n }\n\n componentDidLoad(): void {\n this.keyListener = event => {\n if (this.isOpen && ['ArrowDown', 'ArrowUp'].includes(event.key)) {\n const targetElements = tabbable(this.content, { includeContainer: false, getShadowRoot: true });\n const activeElement = firstTabbable(document.activeElement);\n const activeIdx = activeElement ? targetElements.indexOf(activeElement) : -1;\n const activeOff = event.key === 'ArrowDown' ? 1 : -1;\n const targetIdx = activeIdx < 0 ? 0 : (activeIdx + activeOff + targetElements.length) % targetElements.length;\n targetElements[targetIdx].focus();\n event.preventDefault();\n }\n };\n document.addEventListener('keydown', this.keyListener);\n }\n\n disconnectedCallback(): void {\n if (this.keyListener) {\n document.removeEventListener('keydown', this.keyListener);\n }\n }\n\n render() {\n return (\n <Host>\n <slot name=\"trigger\" ref={el => (this.triggerSlot = el as HTMLSlotElement)}></slot>\n <div\n id={this.contentId}\n class={{ content: true, 'overflow-auto': !this.overflow }}\n ref={el => (this.content = el as HTMLElement)}\n >\n <slot name=\"content\"></slot>\n </div>\n </Host>\n );\n }\n\n private get contentId() {\n return `cat-dropdown-${this.id}`;\n }\n\n private initTrigger() {\n this.trigger = this.findTrigger();\n this.trigger.setAttribute('aria-haspopup', 'true');\n this.trigger.setAttribute('aria-expanded', 'false');\n this.trigger.setAttribute('aria-controls', this.contentId);\n this.trigger.addEventListener('click', () => this.toggle());\n autoUpdate(this.trigger, this.content, () => this.update());\n }\n\n private findTrigger() {\n let trigger: FocusableElement | undefined;\n const elems = this.triggerSlot?.assignedElements?.() || [];\n while (!trigger && elems.length) {\n const elem = elems.shift();\n trigger = elem?.hasAttribute('data-trigger')\n ? (elem as HTMLElement)\n : elem?.querySelector('[data-trigger]') ?? undefined;\n }\n if (!trigger) {\n trigger = firstTabbable(this.triggerSlot);\n }\n if (!trigger) {\n throw new Error('Cannot find tabbable element. Use [data-trigger] to set the trigger.');\n }\n return trigger;\n }\n\n private update() {\n if (this.trigger) {\n computePosition(this.trigger, this.content, {\n strategy: 'fixed',\n placement: this.placement,\n middleware: [\n offset(CatDropdown.OFFSET),\n flip(),\n size({\n padding: CatDropdown.OFFSET,\n apply({ availableWidth, availableHeight, elements }) {\n Object.assign(elements.floating.style, {\n maxWidth: `${availableWidth}px`,\n maxHeight: `${availableHeight}px`\n });\n }\n })\n ]\n }).then(({ x, y, placement }) => {\n this.content.dataset.placement = placement;\n Object.assign(this.content.style, {\n left: `${x}px`,\n top: `${y}px`\n });\n });\n }\n }\n}\n"]}
1
+ {"version":3,"file":"cat-dropdown.js","sourceRoot":"","sources":["../../../src/components/cat-dropdown/cat-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAa,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC9F,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC9F,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AACxC,OAAO,EAAoB,QAAQ,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AAEvD,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB,MAKa,WAAW;;IAEL,OAAE,GAAG,YAAY,EAAE,CAAC;IAM7B,WAAM,GAAmB,KAAK,CAAC;qBAKR,cAAc;uBAKvB,KAAK;oBAKR,KAAK;;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,CAAC;QAC3C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;UAChC,IAAI,EAAE,GAAG,CAAC,IAAI;UACd,GAAG,EAAE,GAAG,CAAC,IAAI;SACd,CAAC,CAAC;MACL,CAAC,CAAC,CAAC;KACJ;EACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AArNuB,kBAAM,GAAG,CAAC,AAAJ,CAAK;SADxB,WAAW","sourcesContent":["import { autoUpdate, computePosition, flip, offset, Placement, size } from '@floating-ui/dom';\nimport { timeTransitionS } from '@haiilo/catalyst-tokens';\nimport { Component, Event, EventEmitter, h, Host, Listen, Method, Prop } from '@stencil/core';\nimport * as focusTrap from 'focus-trap';\nimport { FocusableElement, tabbable } from 'tabbable';\nimport firstTabbable from '../../utils/first-tabbable';\n\nlet nextUniqueId = 0;\n\n@Component({\n tag: 'cat-dropdown',\n styleUrl: 'cat-dropdown.scss',\n shadow: true\n})\nexport class CatDropdown {\n private static readonly OFFSET = 4;\n private readonly id = nextUniqueId++;\n private triggerSlot!: HTMLSlotElement;\n private trigger?: FocusableElement;\n private content!: HTMLElement;\n private trap?: focusTrap.FocusTrap;\n private keyListener?: (event: KeyboardEvent) => void;\n private isOpen: boolean | null = false;\n\n /**\n * The placement of the dropdown.\n */\n @Prop() placement: Placement = 'bottom-start';\n\n /**\n * Do not close the dropdown on outside clicks.\n */\n @Prop() noAutoClose = false;\n\n /**\n * Allow overflow when dropdown is open.\n */\n @Prop() overflow = false;\n\n /**\n * Emitted when the dropdown is opened.\n */\n @Event() catOpen!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the dropdown is closed.\n */\n @Event() catClose!: EventEmitter<FocusEvent>;\n\n @Listen('catClick')\n clickHandler(event: CustomEvent<MouseEvent>) {\n // we need to delay the initialization of the trigger until first,\n // interaction because the element might still be hidden (and thus not\n // tabbable) if contained in another Stencil web component\n if (!this.trigger) {\n this.initTrigger();\n this.toggle();\n }\n\n const button = event.target as HTMLButtonElement;\n\n // hide dropdown on button click\n if (!this.noAutoClose && event.composedPath().includes(this.content) && button.slot !== 'trigger') {\n this.close();\n }\n }\n\n /**\n * Toggles the dropdown.\n */\n async toggle(): Promise<void> {\n this.isOpen ? this.close() : this.open();\n }\n\n /**\n * Opens the dropdown.\n */\n async open(): Promise<void> {\n if (this.isOpen === null) {\n return; // busy\n }\n\n this.isOpen = null;\n this.content.style.display = 'block';\n // give CSS transition time to apply\n setTimeout(() => {\n this.isOpen = true;\n this.content.classList.add('show');\n this.trigger?.setAttribute('aria-expanded', 'true');\n this.catOpen.emit();\n this.trap = this.trap\n ? this.trap.updateContainerElements(this.content)\n : focusTrap.createFocusTrap(this.content, {\n tabbableOptions: {\n getShadowRoot: true\n },\n allowOutsideClick: true,\n clickOutsideDeactivates: event => {\n const shouldClose =\n !this.noAutoClose &&\n !event.composedPath().includes(this.content) &&\n (!this.trigger || !event.composedPath().includes(this.trigger));\n if (shouldClose) {\n this.close();\n }\n return shouldClose;\n },\n onPostDeactivate: () => this.close()\n });\n this.trap.activate();\n });\n }\n\n /**\n * Closes the dropdown.\n */\n @Method()\n async close(): Promise<void> {\n if (this.isOpen === null || !this.isOpen) {\n return; // busy\n }\n\n this.isOpen = null;\n this.content.classList.remove('show');\n // give CSS transition time to apply\n setTimeout(() => {\n this.isOpen = false;\n this.content.classList.remove('show');\n this.content.style.display = '';\n this.trigger?.setAttribute('aria-expanded', 'false');\n this.trap?.deactivate();\n this.catClose.emit();\n }, timeTransitionS);\n }\n\n componentDidLoad(): void {\n this.keyListener = event => {\n if (this.isOpen && ['ArrowDown', 'ArrowUp'].includes(event.key)) {\n const targetElements = tabbable(this.content, { includeContainer: false, getShadowRoot: true });\n const activeElement = firstTabbable(document.activeElement);\n const activeIdx = activeElement ? targetElements.indexOf(activeElement) : -1;\n const activeOff = event.key === 'ArrowDown' ? 1 : -1;\n const targetIdx = activeIdx < 0 ? 0 : (activeIdx + activeOff + targetElements.length) % targetElements.length;\n targetElements[targetIdx].focus();\n event.preventDefault();\n }\n };\n document.addEventListener('keydown', this.keyListener);\n }\n\n disconnectedCallback(): void {\n if (this.keyListener) {\n document.removeEventListener('keydown', this.keyListener);\n }\n }\n\n render() {\n return (\n <Host>\n <slot name=\"trigger\" ref={el => (this.triggerSlot = el as HTMLSlotElement)}></slot>\n <div\n id={this.contentId}\n class={{ content: true, 'overflow-auto': !this.overflow }}\n ref={el => (this.content = el as HTMLElement)}\n >\n <slot name=\"content\"></slot>\n </div>\n </Host>\n );\n }\n\n private get contentId() {\n return `cat-dropdown-${this.id}`;\n }\n\n private initTrigger() {\n this.trigger = this.findTrigger();\n this.trigger.setAttribute('aria-haspopup', 'true');\n this.trigger.setAttribute('aria-expanded', 'false');\n this.trigger.setAttribute('aria-controls', this.contentId);\n this.trigger.addEventListener('click', () => this.toggle());\n autoUpdate(this.trigger, this.content, () => this.update());\n }\n\n private findTrigger() {\n let trigger: FocusableElement | undefined;\n const elems = this.triggerSlot?.assignedElements?.() || [];\n while (!trigger && elems.length) {\n const elem = elems.shift();\n trigger = elem?.hasAttribute('data-trigger')\n ? (elem as HTMLElement)\n : elem?.querySelector('[data-trigger]') ?? undefined;\n }\n if (!trigger) {\n trigger = firstTabbable(this.triggerSlot);\n }\n if (!trigger) {\n throw new Error('Cannot find tabbable element. Use [data-trigger] to set the trigger.');\n }\n return trigger;\n }\n\n private update() {\n if (this.trigger) {\n computePosition(this.trigger, this.content, {\n strategy: 'fixed',\n placement: this.placement,\n middleware: [\n offset(CatDropdown.OFFSET),\n flip(),\n size({\n padding: CatDropdown.OFFSET,\n apply({ availableWidth, availableHeight, elements }) {\n Object.assign(elements.floating.style, {\n maxWidth: `${availableWidth}px`,\n maxHeight: `${availableHeight}px`\n });\n }\n })\n ]\n }).then(({ x, y, placement }) => {\n this.content.dataset.placement = placement;\n Object.assign(this.content.style, {\n left: `${x}px`,\n top: `${y}px`\n });\n });\n }\n }\n}\n"]}
@@ -0,0 +1,26 @@
1
+ import { newSpecPage } from "@stencil/core/testing";
2
+ import { CatDropdown } from "./cat-dropdown";
3
+ describe('cat-dropdown', () => {
4
+ it('renders', async () => {
5
+ const page = await newSpecPage({
6
+ components: [CatDropdown],
7
+ html: `<cat-dropdown>
8
+ <button slot="trigger"></button>
9
+ <nav slot="content"></nav>
10
+ </cat-dropdown>`
11
+ });
12
+ expect(page.root).toEqualHtml(`
13
+ <cat-dropdown>
14
+ <mock:shadow-root>
15
+ <slot name="trigger"></slot>
16
+ <div class="content overflow-auto" id="cat-dropdown-0">
17
+ <slot name="content"></slot>
18
+ </div>
19
+ </mock:shadow-root>
20
+ <button slot="trigger"></button>
21
+ <nav slot="content"></nav>
22
+ </cat-dropdown>
23
+ `);
24
+ });
25
+ });
26
+ //# sourceMappingURL=cat-dropdown.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-dropdown.spec.js","sourceRoot":"","sources":["../../../src/components/cat-dropdown/cat-dropdown.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;EAC5B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,WAAW,CAAC;MACzB,IAAI,EAAE;;;sBAGU;KACjB,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;KAW7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { CatDropdown } from './cat-dropdown';\n\ndescribe('cat-dropdown', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatDropdown],\n html: `<cat-dropdown>\n <button slot=\"trigger\"></button>\n <nav slot=\"content\"></nav>\n </cat-dropdown>`\n });\n expect(page.root).toEqualHtml(`\n <cat-dropdown>\n <mock:shadow-root>\n <slot name=\"trigger\"></slot>\n <div class=\"content overflow-auto\" id=\"cat-dropdown-0\">\n <slot name=\"content\"></slot>\n </div>\n </mock:shadow-root>\n <button slot=\"trigger\"></button>\n <nav slot=\"content\"></nav>\n </cat-dropdown>\n `);\n });\n});\n"]}
@@ -0,0 +1,10 @@
1
+ import { newE2EPage } from "@stencil/core/testing";
2
+ describe('cat-form-group', () => {
3
+ it('renders', async () => {
4
+ const page = await newE2EPage();
5
+ await page.setContent('<cat-form-group></cat-form-group>');
6
+ const element = await page.find('cat-form-group');
7
+ expect(element).toHaveClass('hydrated');
8
+ });
9
+ });
10
+ //# sourceMappingURL=cat-form-group.e2e.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-form-group.e2e.js","sourceRoot":"","sources":["../../../src/components/cat-form-group/cat-form-group.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;EAC9B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAChC,MAAM,IAAI,CAAC,UAAU,CAAC,mCAAmC,CAAC,CAAC;IAE3D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAClD,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;EAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('cat-form-group', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n await page.setContent('<cat-form-group></cat-form-group>');\n\n const element = await page.find('cat-form-group');\n expect(element).toHaveClass('hydrated');\n });\n});\n"]}
@@ -1,4 +1,4 @@
1
- import { h, Host } from '@stencil/core';
1
+ import { h, Host } from "@stencil/core";
2
2
  export class CatFormGroup {
3
3
  constructor() {
4
4
  this.formElements = [];
@@ -0,0 +1,18 @@
1
+ import { newSpecPage } from "@stencil/core/testing";
2
+ import { CatFormGroup } from "./cat-form-group";
3
+ describe('cat-form-group', () => {
4
+ it('renders', async () => {
5
+ const page = await newSpecPage({
6
+ components: [CatFormGroup],
7
+ html: `<cat-form-group></cat-form-group>`
8
+ });
9
+ expect(page.root).toEqualHtml(`
10
+ <cat-form-group>
11
+ <mock:shadow-root>
12
+ <slot></slot>
13
+ </mock:shadow-root>
14
+ </cat-form-group>
15
+ `);
16
+ });
17
+ });
18
+ //# sourceMappingURL=cat-form-group.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-form-group.spec.js","sourceRoot":"","sources":["../../../src/components/cat-form-group/cat-form-group.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;EAC9B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,YAAY,CAAC;MAC1B,IAAI,EAAE,mCAAmC;KAC1C,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;KAM7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { CatFormGroup } from './cat-form-group';\n\ndescribe('cat-form-group', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatFormGroup],\n html: `<cat-form-group></cat-form-group>`\n });\n expect(page.root).toEqualHtml(`\n <cat-form-group>\n <mock:shadow-root>\n <slot></slot>\n </mock:shadow-root>\n </cat-form-group>\n `);\n });\n});\n"]}
@@ -1,5 +1,5 @@
1
- import { h } from '@stencil/core';
2
- import { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';
1
+ import { h } from "@stencil/core";
2
+ import { catI18nRegistry as i18n } from "../cat-i18n/cat-i18n-registry";
3
3
  /**
4
4
  * CatFormHint is a functional component that represents the hint area of form elements.
5
5
  *
@@ -0,0 +1,15 @@
1
+ import { h } from "@stencil/core";
2
+ import { newSpecPage } from "@stencil/core/testing";
3
+ import { CatFormHint } from "./cat-form-hint";
4
+ describe('CatFormHint', () => {
5
+ it('renders', async () => {
6
+ const page = await newSpecPage({
7
+ components: [],
8
+ template: () => h(CatFormHint, { id: "host-id" })
9
+ });
10
+ expect(page.root).toEqualHtml(`
11
+ <div class="hint-section" id="host-id-hint"></div>
12
+ `);
13
+ });
14
+ });
15
+ //# sourceMappingURL=cat-form-hint.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-form-hint.spec.js","sourceRoot":"","sources":["../../../src/components/cat-form-hint/cat-form-hint.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;EAC3B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,EAAE;MACd,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAC,WAAW,IAAC,EAAE,EAAC,SAAS,GAAe;KACzD,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;KAE7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport { newSpecPage } from '@stencil/core/testing';\nimport { CatFormHint } from './cat-form-hint';\n\ndescribe('CatFormHint', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [],\n template: () => <CatFormHint id=\"host-id\"></CatFormHint>\n });\n expect(page.root).toEqualHtml(`\n <div class=\"hint-section\" id=\"host-id-hint\"></div>\n `);\n });\n});\n"]}
@@ -1,4 +1,4 @@
1
- import log from 'loglevel';
1
+ import log from "loglevel";
2
2
  export class CatI18nRegistry {
3
3
  constructor() {
4
4
  // hide constructor
@@ -0,0 +1,7 @@
1
+ import { catI18nRegistry } from "./cat-i18n-registry";
2
+ describe('CatI18nRegistry', () => {
3
+ it('exists', async () => {
4
+ expect(catI18nRegistry).toBeTruthy();
5
+ });
6
+ });
7
+ //# sourceMappingURL=cat-i18n-registry.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-i18n-registry.spec.js","sourceRoot":"","sources":["../../../src/components/cat-i18n/cat-i18n-registry.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;EAC/B,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IACtB,MAAM,CAAC,eAAe,CAAC,CAAC,UAAU,EAAE,CAAC;EACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { catI18nRegistry } from './cat-i18n-registry';\n\ndescribe('CatI18nRegistry', () => {\n it('exists', async () => {\n expect(catI18nRegistry).toBeTruthy();\n });\n});\n"]}
@@ -1,16 +1,16 @@
1
- import cross16 from '@haiilo/catalyst-icons/tmp/assets/16-cross.svg';
2
- import alertCircleOutlined from '@haiilo/catalyst-icons/tmp/assets/alert-circle-outlined.svg';
3
- import checkCircleFilled from '@haiilo/catalyst-icons/tmp/assets/check-circle-filled.svg';
4
- import chevronDownOutlined from '@haiilo/catalyst-icons/tmp/assets/chevron-down-outlined.svg';
5
- import chevronLeftOutlined from '@haiilo/catalyst-icons/tmp/assets/chevron-left-outlined.svg';
6
- import chevronRightOutlined from '@haiilo/catalyst-icons/tmp/assets/chevron-right-outlined.svg';
7
- import clockFilled from '@haiilo/catalyst-icons/tmp/assets/clock-filled.svg';
8
- import crossCircleFilled from '@haiilo/catalyst-icons/tmp/assets/cross-circle-filled.svg';
9
- import crossCircleOutlined from '@haiilo/catalyst-icons/tmp/assets/cross-circle-outlined.svg';
10
- import crossOutlined from '@haiilo/catalyst-icons/tmp/assets/cross-outlined.svg';
11
- import dangerFilled from '@haiilo/catalyst-icons/tmp/assets/danger-filled.svg';
12
- import starCircleFilled from '@haiilo/catalyst-icons/tmp/assets/star-circle-filled.svg';
13
- import log from 'loglevel';
1
+ import cross16 from "@haiilo/catalyst-icons/tmp/assets/16-cross.svg";
2
+ import alertCircleOutlined from "@haiilo/catalyst-icons/tmp/assets/alert-circle-outlined.svg";
3
+ import checkCircleFilled from "@haiilo/catalyst-icons/tmp/assets/check-circle-filled.svg";
4
+ import chevronDownOutlined from "@haiilo/catalyst-icons/tmp/assets/chevron-down-outlined.svg";
5
+ import chevronLeftOutlined from "@haiilo/catalyst-icons/tmp/assets/chevron-left-outlined.svg";
6
+ import chevronRightOutlined from "@haiilo/catalyst-icons/tmp/assets/chevron-right-outlined.svg";
7
+ import clockFilled from "@haiilo/catalyst-icons/tmp/assets/clock-filled.svg";
8
+ import crossCircleFilled from "@haiilo/catalyst-icons/tmp/assets/cross-circle-filled.svg";
9
+ import crossCircleOutlined from "@haiilo/catalyst-icons/tmp/assets/cross-circle-outlined.svg";
10
+ import crossOutlined from "@haiilo/catalyst-icons/tmp/assets/cross-outlined.svg";
11
+ import dangerFilled from "@haiilo/catalyst-icons/tmp/assets/danger-filled.svg";
12
+ import starCircleFilled from "@haiilo/catalyst-icons/tmp/assets/star-circle-filled.svg";
13
+ import log from "loglevel";
14
14
  export class CatIconRegistry {
15
15
  constructor() {
16
16
  // hide constructor
@@ -0,0 +1,7 @@
1
+ import { catIconRegistry } from "./cat-icon-registry";
2
+ describe('CatIconRegistry', () => {
3
+ it('exists', async () => {
4
+ expect(catIconRegistry).toBeTruthy();
5
+ });
6
+ });
7
+ //# sourceMappingURL=cat-icon-registry.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-icon-registry.spec.js","sourceRoot":"","sources":["../../../src/components/cat-icon/cat-icon-registry.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;EAC/B,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IACtB,MAAM,CAAC,eAAe,CAAC,CAAC,UAAU,EAAE,CAAC;EACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { catIconRegistry } from './cat-icon-registry';\n\ndescribe('CatIconRegistry', () => {\n it('exists', async () => {\n expect(catIconRegistry).toBeTruthy();\n });\n});\n"]}
@@ -0,0 +1,11 @@
1
+ import { newE2EPage } from "@stencil/core/testing";
2
+ describe('cat-icon', () => {
3
+ beforeAll(() => (console.error = jest.fn()));
4
+ it('renders', async () => {
5
+ const page = await newE2EPage();
6
+ await page.setContent('<cat-icon icon="icon"></cat-icon>');
7
+ const element = await page.find('cat-icon');
8
+ expect(element).toHaveClass('hydrated');
9
+ });
10
+ });
11
+ //# sourceMappingURL=cat-icon.e2e.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-icon.e2e.js","sourceRoot":"","sources":["../../../src/components/cat-icon/cat-icon.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;EACxB,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;EAE7C,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAChC,MAAM,IAAI,CAAC,UAAU,CAAC,mCAAmC,CAAC,CAAC;IAE3D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;EAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('cat-icon', () => {\n beforeAll(() => (console.error = jest.fn()));\n\n it('renders', async () => {\n const page = await newE2EPage();\n await page.setContent('<cat-icon icon=\"icon\"></cat-icon>');\n\n const element = await page.find('cat-icon');\n expect(element).toHaveClass('hydrated');\n });\n});\n"]}
@@ -1,5 +1,5 @@
1
- import { h } from '@stencil/core';
2
- import { catIconRegistry as icons } from './cat-icon-registry';
1
+ import { h } from "@stencil/core";
2
+ import { catIconRegistry as icons } from "./cat-icon-registry";
3
3
  /**
4
4
  * Icons are used to provide additional meaning or in places where text label
5
5
  * doesn't fit.
@@ -0,0 +1,15 @@
1
+ jest.mock('./cat-icon-registry');
2
+ import { newSpecPage } from "@stencil/core/testing";
3
+ import { CatIcon } from "./cat-icon";
4
+ describe('cat-icon', () => {
5
+ it('renders', async () => {
6
+ const page = await newSpecPage({
7
+ components: [CatIcon],
8
+ html: `<cat-icon icon="icon"></cat-icon>`
9
+ });
10
+ expect(page.root?.shadowRoot).toEqualHtml(`
11
+ <span aria-hidden="true" class="icon icon-m" part="icon"></span>
12
+ `);
13
+ });
14
+ });
15
+ //# sourceMappingURL=cat-icon.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-icon.spec.js","sourceRoot":"","sources":["../../../src/components/cat-icon/cat-icon.spec.tsx"],"names":[],"mappings":"AAAA,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;EACxB,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,OAAO,CAAC;MACrB,IAAI,EAAE,mCAAmC;KAC1C,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,WAAW,CAAC;;KAEzC,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["jest.mock('./cat-icon-registry');\nimport { newSpecPage } from '@stencil/core/testing';\nimport { CatIcon } from './cat-icon';\n\ndescribe('cat-icon', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [CatIcon],\n html: `<cat-icon icon=\"icon\"></cat-icon>`\n });\n expect(page.root?.shadowRoot).toEqualHtml(`\n <span aria-hidden=\"true\" class=\"icon icon-m\" part=\"icon\"></span>\n `);\n });\n});\n"]}
@@ -0,0 +1,11 @@
1
+ import { newE2EPage } from "@stencil/core/testing";
2
+ describe('cat-input', () => {
3
+ beforeAll(() => (console.error = jest.fn()));
4
+ it('renders', async () => {
5
+ const page = await newE2EPage();
6
+ await page.setContent('<cat-input label="Label"></cat-input>');
7
+ const element = await page.find('cat-input');
8
+ expect(element).toHaveClass('hydrated');
9
+ });
10
+ });
11
+ //# sourceMappingURL=cat-input.e2e.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-input.e2e.js","sourceRoot":"","sources":["../../../src/components/cat-input/cat-input.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;EACzB,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;EAE7C,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IACvB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAChC,MAAM,IAAI,CAAC,UAAU,CAAC,uCAAuC,CAAC,CAAC;IAE/D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC7C,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;EAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('cat-input', () => {\n beforeAll(() => (console.error = jest.fn()));\n\n it('renders', async () => {\n const page = await newE2EPage();\n await page.setContent('<cat-input label=\"Label\"></cat-input>');\n\n const element = await page.find('cat-input');\n expect(element).toHaveClass('hydrated');\n });\n});\n"]}
@@ -1,8 +1,8 @@
1
- import { h } from '@stencil/core';
2
- import log from 'loglevel';
3
- import { coerceBoolean, coerceNumber } from '../../utils/coerce';
4
- import { CatFormHint } from '../cat-form-hint/cat-form-hint';
5
- import { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';
1
+ import { h } from "@stencil/core";
2
+ import log from "loglevel";
3
+ import { coerceBoolean, coerceNumber } from "../../utils/coerce";
4
+ import { CatFormHint } from "../cat-form-hint/cat-form-hint";
5
+ import { catI18nRegistry as i18n } from "../cat-i18n/cat-i18n-registry";
6
6
  let nextUniqueId = 0;
7
7
  /**
8
8
  * Inputs are used to allow users to provide text input when the expected input
@@ -555,7 +555,8 @@ export class CatInput {
555
555
  "references": {
556
556
  "InputType": {
557
557
  "location": "import",
558
- "path": "./input-type"
558
+ "path": "./input-type",
559
+ "id": "src/components/cat-input/input-type.ts::InputType"
559
560
  }
560
561
  }
561
562
  },
@@ -595,7 +596,8 @@ export class CatInput {
595
596
  "references": {
596
597
  "ErrorMap": {
597
598
  "location": "import",
598
- "path": "../cat-form-hint/cat-form-hint"
599
+ "path": "../cat-form-hint/cat-form-hint",
600
+ "id": "src/components/cat-form-hint/cat-form-hint.tsx::ErrorMap"
599
601
  }
600
602
  }
601
603
  },
@@ -681,7 +683,8 @@ export class CatInput {
681
683
  "resolved": "FocusEvent",
682
684
  "references": {
683
685
  "FocusEvent": {
684
- "location": "global"
686
+ "location": "global",
687
+ "id": "global::FocusEvent"
685
688
  }
686
689
  }
687
690
  }
@@ -700,7 +703,8 @@ export class CatInput {
700
703
  "resolved": "FocusEvent",
701
704
  "references": {
702
705
  "FocusEvent": {
703
- "location": "global"
706
+ "location": "global",
707
+ "id": "global::FocusEvent"
704
708
  }
705
709
  }
706
710
  }
@@ -720,10 +724,12 @@ export class CatInput {
720
724
  }],
721
725
  "references": {
722
726
  "Promise": {
723
- "location": "global"
727
+ "location": "global",
728
+ "id": "global::Promise"
724
729
  },
725
730
  "FocusOptions": {
726
- "location": "global"
731
+ "location": "global",
732
+ "id": "global::FocusOptions"
727
733
  }
728
734
  },
729
735
  "return": "Promise<void>"
@@ -742,7 +748,8 @@ export class CatInput {
742
748
  "parameters": [],
743
749
  "references": {
744
750
  "Promise": {
745
- "location": "global"
751
+ "location": "global",
752
+ "id": "global::Promise"
746
753
  }
747
754
  },
748
755
  "return": "Promise<void>"
@@ -758,7 +765,8 @@ export class CatInput {
758
765
  "parameters": [],
759
766
  "references": {
760
767
  "Promise": {
761
- "location": "global"
768
+ "location": "global",
769
+ "id": "global::Promise"
762
770
  }
763
771
  },
764
772
  "return": "Promise<void>"