@haiilo/catalyst 4.1.2 → 5.0.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 (277) hide show
  1. package/README.md +0 -2
  2. package/dist/catalyst/assets/fonts/Lato-Black.woff +0 -0
  3. package/dist/catalyst/assets/fonts/Lato-Black.woff2 +0 -0
  4. package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff +0 -0
  5. package/dist/catalyst/assets/fonts/Lato-BlackItalic.woff2 +0 -0
  6. package/dist/catalyst/assets/fonts/Lato-Bold.woff +0 -0
  7. package/dist/catalyst/assets/fonts/Lato-Bold.woff2 +0 -0
  8. package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff +0 -0
  9. package/dist/catalyst/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  10. package/dist/catalyst/assets/fonts/Lato-Hairline.woff +0 -0
  11. package/dist/catalyst/assets/fonts/Lato-Hairline.woff2 +0 -0
  12. package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff +0 -0
  13. package/dist/catalyst/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
  14. package/dist/catalyst/assets/fonts/Lato-Heavy.woff +0 -0
  15. package/dist/catalyst/assets/fonts/Lato-Heavy.woff2 +0 -0
  16. package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff +0 -0
  17. package/dist/catalyst/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
  18. package/dist/catalyst/assets/fonts/Lato-Italic.woff +0 -0
  19. package/dist/catalyst/assets/fonts/Lato-Italic.woff2 +0 -0
  20. package/dist/catalyst/assets/fonts/Lato-Light.woff +0 -0
  21. package/dist/catalyst/assets/fonts/Lato-Light.woff2 +0 -0
  22. package/dist/catalyst/assets/fonts/Lato-LightItalic.woff +0 -0
  23. package/dist/catalyst/assets/fonts/Lato-LightItalic.woff2 +0 -0
  24. package/dist/catalyst/assets/fonts/Lato-Medium.woff +0 -0
  25. package/dist/catalyst/assets/fonts/Lato-Medium.woff2 +0 -0
  26. package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff +0 -0
  27. package/dist/catalyst/assets/fonts/Lato-MediumItalic.woff2 +0 -0
  28. package/dist/catalyst/assets/fonts/Lato-Regular.woff +0 -0
  29. package/dist/catalyst/assets/fonts/Lato-Regular.woff2 +0 -0
  30. package/dist/catalyst/assets/fonts/Lato-Semibold.woff +0 -0
  31. package/dist/catalyst/assets/fonts/Lato-Semibold.woff2 +0 -0
  32. package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff +0 -0
  33. package/dist/catalyst/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
  34. package/dist/catalyst/assets/fonts/Lato-Thin.woff +0 -0
  35. package/dist/catalyst/assets/fonts/Lato-Thin.woff2 +0 -0
  36. package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff +0 -0
  37. package/dist/catalyst/assets/fonts/Lato-ThinItalic.woff2 +0 -0
  38. package/dist/catalyst/catalyst.css +6 -27
  39. package/dist/catalyst/catalyst.esm.js +1 -1
  40. package/dist/catalyst/catalyst.esm.js.map +1 -1
  41. package/dist/catalyst/index.esm.js.map +1 -1
  42. package/dist/catalyst/p-ccfebe33.js.map +1 -1
  43. package/dist/catalyst/p-d1ee6a09.entry.js +10 -0
  44. package/dist/catalyst/p-d1ee6a09.entry.js.map +1 -0
  45. package/dist/catalyst/p-d1fb9d96.js +3 -0
  46. package/dist/catalyst/p-d1fb9d96.js.map +1 -0
  47. package/dist/catalyst/scss/fonts/_fonts-mixins.scss +0 -10
  48. package/dist/cjs/cat-alert_24.cjs.entry.js +933 -1135
  49. package/dist/cjs/cat-alert_24.cjs.entry.js.map +1 -1
  50. package/dist/cjs/catalyst.cjs.js +10 -3
  51. package/dist/cjs/catalyst.cjs.js.map +1 -1
  52. package/dist/cjs/{index-c4542095.js → index-01312a2e.js} +527 -245
  53. package/dist/cjs/index-01312a2e.js.map +1 -0
  54. package/dist/cjs/index.cjs.js.map +1 -1
  55. package/dist/cjs/loader.cjs.js +4 -3
  56. package/dist/cjs/loader.cjs.js.map +1 -1
  57. package/dist/collection/assets/fonts/Lato-Black.woff +0 -0
  58. package/dist/collection/assets/fonts/Lato-Black.woff2 +0 -0
  59. package/dist/collection/assets/fonts/Lato-BlackItalic.woff +0 -0
  60. package/dist/collection/assets/fonts/Lato-BlackItalic.woff2 +0 -0
  61. package/dist/collection/assets/fonts/Lato-Bold.woff +0 -0
  62. package/dist/collection/assets/fonts/Lato-Bold.woff2 +0 -0
  63. package/dist/collection/assets/fonts/Lato-BoldItalic.woff +0 -0
  64. package/dist/collection/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  65. package/dist/collection/assets/fonts/Lato-Hairline.woff +0 -0
  66. package/dist/collection/assets/fonts/Lato-Hairline.woff2 +0 -0
  67. package/dist/collection/assets/fonts/Lato-HairlineItalic.woff +0 -0
  68. package/dist/collection/assets/fonts/Lato-HairlineItalic.woff2 +0 -0
  69. package/dist/collection/assets/fonts/Lato-Heavy.woff +0 -0
  70. package/dist/collection/assets/fonts/Lato-Heavy.woff2 +0 -0
  71. package/dist/collection/assets/fonts/Lato-HeavyItalic.woff +0 -0
  72. package/dist/collection/assets/fonts/Lato-HeavyItalic.woff2 +0 -0
  73. package/dist/collection/assets/fonts/Lato-Italic.woff +0 -0
  74. package/dist/collection/assets/fonts/Lato-Italic.woff2 +0 -0
  75. package/dist/collection/assets/fonts/Lato-Light.woff +0 -0
  76. package/dist/collection/assets/fonts/Lato-Light.woff2 +0 -0
  77. package/dist/collection/assets/fonts/Lato-LightItalic.woff +0 -0
  78. package/dist/collection/assets/fonts/Lato-LightItalic.woff2 +0 -0
  79. package/dist/collection/assets/fonts/Lato-Medium.woff +0 -0
  80. package/dist/collection/assets/fonts/Lato-Medium.woff2 +0 -0
  81. package/dist/collection/assets/fonts/Lato-MediumItalic.woff +0 -0
  82. package/dist/collection/assets/fonts/Lato-MediumItalic.woff2 +0 -0
  83. package/dist/collection/assets/fonts/Lato-Regular.woff +0 -0
  84. package/dist/collection/assets/fonts/Lato-Regular.woff2 +0 -0
  85. package/dist/collection/assets/fonts/Lato-Semibold.woff +0 -0
  86. package/dist/collection/assets/fonts/Lato-Semibold.woff2 +0 -0
  87. package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff +0 -0
  88. package/dist/collection/assets/fonts/Lato-SemiboldItalic.woff2 +0 -0
  89. package/dist/collection/assets/fonts/Lato-Thin.woff +0 -0
  90. package/dist/collection/assets/fonts/Lato-Thin.woff2 +0 -0
  91. package/dist/collection/assets/fonts/Lato-ThinItalic.woff +0 -0
  92. package/dist/collection/assets/fonts/Lato-ThinItalic.woff2 +0 -0
  93. package/dist/collection/collection-manifest.json +2 -2
  94. package/dist/collection/components/cat-alert/cat-alert.js +69 -71
  95. package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
  96. package/dist/collection/components/cat-avatar/cat-avatar.js +172 -165
  97. package/dist/collection/components/cat-avatar/cat-avatar.js.map +1 -1
  98. package/dist/collection/components/cat-badge/cat-badge.js +102 -111
  99. package/dist/collection/components/cat-badge/cat-badge.js.map +1 -1
  100. package/dist/collection/components/cat-button/cat-button.js +526 -537
  101. package/dist/collection/components/cat-button/cat-button.js.map +1 -1
  102. package/dist/collection/components/cat-card/cat-card.js +12 -8
  103. package/dist/collection/components/cat-checkbox/cat-checkbox.js +336 -350
  104. package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
  105. package/dist/collection/components/cat-dropdown/cat-dropdown.js +137 -137
  106. package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
  107. package/dist/collection/components/cat-form-group/cat-form-group.js +58 -40
  108. package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
  109. package/dist/collection/components/cat-form-hint/cat-form-hint.js +14 -7
  110. package/dist/collection/components/cat-form-hint/cat-form-hint.js.map +1 -1
  111. package/dist/collection/components/cat-i18n/cat-i18n-registry.js +1 -1
  112. package/dist/collection/components/cat-icon/cat-icon-registry.js +1 -1
  113. package/dist/collection/components/cat-icon/cat-icon.js +85 -79
  114. package/dist/collection/components/cat-icon/cat-icon.js.map +1 -1
  115. package/dist/collection/components/cat-input/cat-input.css +32 -3
  116. package/dist/collection/components/cat-input/cat-input.js +662 -660
  117. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  118. package/dist/collection/components/cat-input/input-type.js +1 -1
  119. package/dist/collection/components/cat-label/cat-label.js +69 -78
  120. package/dist/collection/components/cat-label/cat-label.js.map +1 -1
  121. package/dist/collection/components/cat-notification/cat-notification.js +1 -1
  122. package/dist/collection/components/cat-notification/cat-notification.js.map +1 -1
  123. package/dist/collection/components/cat-pagination/cat-pagination.js +192 -226
  124. package/dist/collection/components/cat-pagination/cat-pagination.js.map +1 -1
  125. package/dist/collection/components/cat-radio/cat-radio.js +319 -327
  126. package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
  127. package/dist/collection/components/cat-radio-group/cat-radio-group.js +173 -165
  128. package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
  129. package/dist/collection/components/cat-scrollable/cat-scrollable.js +200 -208
  130. package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
  131. package/dist/collection/components/cat-select/cat-select.js +556 -593
  132. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  133. package/dist/collection/components/cat-select-demo/cat-select-demo.js +3 -28
  134. package/dist/collection/components/cat-select-demo/cat-select-demo.js.map +1 -1
  135. package/dist/collection/components/cat-skeleton/cat-skeleton.js +85 -88
  136. package/dist/collection/components/cat-skeleton/cat-skeleton.js.map +1 -1
  137. package/dist/collection/components/cat-spinner/cat-spinner.js +52 -50
  138. package/dist/collection/components/cat-spinner/cat-spinner.js.map +1 -1
  139. package/dist/collection/components/cat-tab/cat-tab.js +169 -168
  140. package/dist/collection/components/cat-tab/cat-tab.js.map +1 -1
  141. package/dist/collection/components/cat-tabs/cat-tabs.js +73 -66
  142. package/dist/collection/components/cat-tabs/cat-tabs.js.map +1 -1
  143. package/dist/collection/components/cat-textarea/cat-textarea.css +32 -1
  144. package/dist/collection/components/cat-textarea/cat-textarea.js +479 -468
  145. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
  146. package/dist/collection/components/cat-toggle/cat-toggle.js +319 -326
  147. package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
  148. package/dist/collection/components/cat-tooltip/cat-tooltip.css +7 -1
  149. package/dist/collection/components/cat-tooltip/cat-tooltip.js +187 -198
  150. package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
  151. package/dist/collection/index.js +1 -1
  152. package/dist/collection/scss/fonts/_fonts-mixins.scss +0 -10
  153. package/dist/collection/utils/breakpoints.js +1 -1
  154. package/dist/collection/utils/breakpoints.js.map +1 -1
  155. package/dist/collection/utils/coerce.js +11 -0
  156. package/dist/collection/utils/coerce.js.map +1 -0
  157. package/dist/collection/utils/first-tabbable.js +1 -1
  158. package/dist/collection/utils/is-touch-screen.js +1 -1
  159. package/dist/collection/utils/load-img.js +1 -1
  160. package/dist/collection/utils/media-matcher.js +1 -1
  161. package/dist/collection/utils/platform.js +4 -4
  162. package/dist/collection/utils/setDefault.js +1 -1
  163. package/dist/components/cat-alert.js +1 -6
  164. package/dist/components/cat-alert.js.map +1 -1
  165. package/dist/components/cat-avatar2.js +6 -9
  166. package/dist/components/cat-avatar2.js.map +1 -1
  167. package/dist/components/cat-badge.js +0 -15
  168. package/dist/components/cat-badge.js.map +1 -1
  169. package/dist/components/cat-button2.js +10 -36
  170. package/dist/components/cat-button2.js.map +1 -1
  171. package/dist/components/cat-checkbox2.js +9 -26
  172. package/dist/components/cat-checkbox2.js.map +1 -1
  173. package/dist/components/cat-dropdown2.js +139 -176
  174. package/dist/components/cat-dropdown2.js.map +1 -1
  175. package/dist/components/cat-form-group.js +4 -9
  176. package/dist/components/cat-form-group.js.map +1 -1
  177. package/dist/components/cat-form-hint.js +13 -6
  178. package/dist/components/cat-form-hint.js.map +1 -1
  179. package/dist/components/cat-icon-registry.js +71 -0
  180. package/dist/components/cat-icon-registry.js.map +1 -0
  181. package/dist/components/cat-icon.js +1 -1
  182. package/dist/components/cat-icon2.js +5 -71
  183. package/dist/components/cat-icon2.js.map +1 -1
  184. package/dist/components/cat-input.js +33 -41
  185. package/dist/components/cat-input.js.map +1 -1
  186. package/dist/components/cat-label.js +1 -6
  187. package/dist/components/cat-label.js.map +1 -1
  188. package/dist/components/cat-pagination.js +0 -30
  189. package/dist/components/cat-pagination.js.map +1 -1
  190. package/dist/components/cat-radio-group.js +3 -6
  191. package/dist/components/cat-radio-group.js.map +1 -1
  192. package/dist/components/cat-radio.js +9 -23
  193. package/dist/components/cat-radio.js.map +1 -1
  194. package/dist/components/cat-scrollable2.js +1 -12
  195. package/dist/components/cat-scrollable2.js.map +1 -1
  196. package/dist/components/cat-select-demo.js +2 -12
  197. package/dist/components/cat-select-demo.js.map +1 -1
  198. package/dist/components/cat-select2.js +41 -50
  199. package/dist/components/cat-select2.js.map +1 -1
  200. package/dist/components/cat-skeleton2.js +1 -10
  201. package/dist/components/cat-skeleton2.js.map +1 -1
  202. package/dist/components/cat-spinner2.js +1 -3
  203. package/dist/components/cat-spinner2.js.map +1 -1
  204. package/dist/components/cat-tab.js +3 -12
  205. package/dist/components/cat-tab.js.map +1 -1
  206. package/dist/components/cat-tabs.js +1 -6
  207. package/dist/components/cat-tabs.js.map +1 -1
  208. package/dist/components/cat-textarea.js +28 -33
  209. package/dist/components/cat-textarea.js.map +1 -1
  210. package/dist/components/cat-toggle.js +9 -23
  211. package/dist/components/cat-toggle.js.map +1 -1
  212. package/dist/components/cat-tooltip.js +14 -34
  213. package/dist/components/cat-tooltip.js.map +1 -1
  214. package/dist/components/first-tabbable.js +51 -113
  215. package/dist/components/first-tabbable.js.map +1 -1
  216. package/dist/components/floating-ui.dom.esm.js +577 -441
  217. package/dist/components/floating-ui.dom.esm.js.map +1 -1
  218. package/dist/components/index.d.ts +9 -27
  219. package/dist/components/index.js +2 -26
  220. package/dist/components/index.js.map +1 -1
  221. package/dist/esm/cat-alert_24.entry.js +934 -1136
  222. package/dist/esm/cat-alert_24.entry.js.map +1 -1
  223. package/dist/esm/catalyst.js +7 -3
  224. package/dist/esm/catalyst.js.map +1 -1
  225. package/dist/esm/{index-524906f7.js → index-fc2f91a4.js} +527 -246
  226. package/dist/esm/index-fc2f91a4.js.map +1 -0
  227. package/dist/esm/index.js.map +1 -1
  228. package/dist/esm/loader.js +4 -3
  229. package/dist/esm/loader.js.map +1 -1
  230. package/dist/esm/polyfills/css-shim.js +1 -1
  231. package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +1 -1
  232. package/dist/types/components/cat-form-group/cat-form-group.d.ts +4 -0
  233. package/dist/types/components/cat-form-hint/cat-form-hint.d.ts +5 -0
  234. package/dist/types/components/cat-input/cat-input.d.ts +6 -1
  235. package/dist/types/components/cat-input/input-type.d.ts +1 -1
  236. package/dist/types/components/cat-radio/cat-radio.d.ts +1 -1
  237. package/dist/types/components/cat-select/cat-select.d.ts +2 -1
  238. package/dist/types/components/cat-textarea/cat-textarea.d.ts +6 -1
  239. package/dist/types/components/cat-toggle/cat-toggle.d.ts +1 -1
  240. package/dist/types/components/cat-tooltip/cat-tooltip.d.ts +3 -0
  241. package/dist/types/components.d.ts +353 -7
  242. package/dist/types/stencil-public-runtime.d.ts +91 -19
  243. package/dist/types/utils/breakpoints.d.ts +1 -1
  244. package/dist/types/utils/coerce.d.ts +3 -0
  245. package/dist/types/utils/first-tabbable.d.ts +2 -2
  246. package/loader/index.d.ts +9 -0
  247. package/loader/package.json +1 -0
  248. package/package.json +19 -19
  249. package/dist/catalyst/assets/fonts/AzeretMono-Regular.woff2 +0 -0
  250. package/dist/catalyst/assets/fonts/DMSans-Bold.woff2 +0 -0
  251. package/dist/catalyst/assets/fonts/DMSans-BoldItalic.woff2 +0 -0
  252. package/dist/catalyst/assets/fonts/DMSans-Italic.woff2 +0 -0
  253. package/dist/catalyst/assets/fonts/DMSans-Medium.woff2 +0 -0
  254. package/dist/catalyst/assets/fonts/DMSans-MediumItalic.woff2 +0 -0
  255. package/dist/catalyst/assets/fonts/DMSans-Regular.woff2 +0 -0
  256. package/dist/catalyst/p-919eea27.js +0 -3
  257. package/dist/catalyst/p-919eea27.js.map +0 -1
  258. package/dist/catalyst/p-cd8f8639.entry.js +0 -10
  259. package/dist/catalyst/p-cd8f8639.entry.js.map +0 -1
  260. package/dist/catalyst/scss/fonts/_fonts.mixins.azeret.scss +0 -14
  261. package/dist/catalyst/scss/fonts/_fonts.mixins.dm.scss +0 -53
  262. package/dist/cjs/index-c4542095.js.map +0 -1
  263. package/dist/collection/assets/fonts/AzeretMono-Regular.woff2 +0 -0
  264. package/dist/collection/assets/fonts/DMSans-Bold.woff2 +0 -0
  265. package/dist/collection/assets/fonts/DMSans-BoldItalic.woff2 +0 -0
  266. package/dist/collection/assets/fonts/DMSans-Italic.woff2 +0 -0
  267. package/dist/collection/assets/fonts/DMSans-Medium.woff2 +0 -0
  268. package/dist/collection/assets/fonts/DMSans-MediumItalic.woff2 +0 -0
  269. package/dist/collection/assets/fonts/DMSans-Regular.woff2 +0 -0
  270. package/dist/collection/components/cat-form-hint/cat-form-hint-utils.js +0 -13
  271. package/dist/collection/components/cat-form-hint/cat-form-hint-utils.js.map +0 -1
  272. package/dist/collection/scss/fonts/_fonts.mixins.azeret.scss +0 -14
  273. package/dist/collection/scss/fonts/_fonts.mixins.dm.scss +0 -53
  274. package/dist/components/cat-form-hint-utils.js +0 -17
  275. package/dist/components/cat-form-hint-utils.js.map +0 -1
  276. package/dist/esm/index-524906f7.js.map +0 -1
  277. package/dist/types/components/cat-form-hint/cat-form-hint-utils.d.ts +0 -4
@@ -1,4 +1,4 @@
1
- import { Component, Element, Event, h, Host, Method, Prop, State } from '@stencil/core';
1
+ import { h, Host } from '@stencil/core';
2
2
  import log from 'loglevel';
3
3
  import { CatFormHint } from '../cat-form-hint/cat-form-hint';
4
4
  let nextUniqueId = 0;
@@ -15,34 +15,19 @@ export class CatCheckbox {
15
15
  constructor() {
16
16
  this._id = `cat-checkbox-${nextUniqueId++}`;
17
17
  this.hasSlottedLabel = false;
18
- /**
19
- * Checked state of the checkbox
20
- */
18
+ this.hasSlottedHint = false;
21
19
  this.checked = false;
22
- /**
23
- * Disabled state of the checkbox
24
- */
25
20
  this.disabled = false;
26
- /**
27
- * Indeterminate state of the checkbox
28
- */
21
+ this.identifier = undefined;
29
22
  this.indeterminate = false;
30
- /**
31
- * Label of the checkbox which is presented in the UI
32
- */
33
23
  this.label = '';
34
- /**
35
- * Visually hide the label, but still show it to assistive technologies like screen readers.
36
- */
37
24
  this.labelHidden = false;
38
- /**
39
- * Required state of the checkbox
40
- */
25
+ this.name = undefined;
41
26
  this.required = false;
42
- /**
43
- * Whether the label should appear to the left of the checkbox.
44
- */
27
+ this.value = undefined;
28
+ this.hint = undefined;
45
29
  this.labelLeft = false;
30
+ this.nativeAttributes = undefined;
46
31
  }
47
32
  get id() {
48
33
  return this.identifier || this._id;
@@ -54,6 +39,7 @@ export class CatCheckbox {
54
39
  }
55
40
  componentWillRender() {
56
41
  this.hasSlottedLabel = !!this.hostElement.querySelector('[slot="label"]');
42
+ this.hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
57
43
  if (!this.label && !this.hasSlottedLabel) {
58
44
  log.warn('[A11y] Missing ARIA label on checkbox', this);
59
45
  }
@@ -82,20 +68,7 @@ export class CatCheckbox {
82
68
  this.input.click();
83
69
  }
84
70
  render() {
85
- return (h(Host, null,
86
- h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } },
87
- h("input", Object.assign({}, this.nativeAttributes, { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value !== undefined ? String(this.value) : this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) })),
88
- h("span", { class: "box", "aria-hidden": "true", part: "checkbox" },
89
- h("svg", { class: "check", viewBox: "0 0 12 10" },
90
- h("polyline", { points: "1.5 6 4.5 9 10.5 1" })),
91
- h("svg", { class: "dash", viewBox: "0 0 12 10" },
92
- h("polyline", { points: "1.5 5 10.5 5" }))),
93
- h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label)),
94
- this.hintSection));
95
- }
96
- get hintSection() {
97
- const hasSlottedHint = !!this.hostElement.querySelector('[slot="hint"]');
98
- return ((this.hint || hasSlottedHint) && (h(CatFormHint, { hint: this.hint, slottedHint: hasSlottedHint && h("slot", { name: "hint" }) })));
71
+ return (h(Host, null, h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, h("input", Object.assign({}, this.nativeAttributes, { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value !== undefined ? String(this.value) : this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) })), h("span", { class: "box", "aria-hidden": "true", part: "checkbox" }, h("svg", { class: "check", viewBox: "0 0 12 10" }, h("polyline", { points: "1.5 6 4.5 9 10.5 1" })), h("svg", { class: "dash", viewBox: "0 0 12 10" }, h("polyline", { points: "1.5 5 10.5 5" }))), h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && h("slot", { name: "label" })) || this.label)), (this.hint || this.hasSlottedHint) && (h(CatFormHint, { id: this.id, hint: this.hint, slottedHint: this.hasSlottedHint && h("slot", { name: "hint" }) }))));
99
72
  }
100
73
  onInput(event) {
101
74
  this.checked = this.input.checked;
@@ -112,342 +85,355 @@ export class CatCheckbox {
112
85
  }
113
86
  static get is() { return "cat-checkbox"; }
114
87
  static get encapsulation() { return "shadow"; }
115
- static get originalStyleUrls() { return {
116
- "$": ["cat-checkbox.scss"]
117
- }; }
118
- static get styleUrls() { return {
119
- "$": ["cat-checkbox.css"]
120
- }; }
121
- static get properties() { return {
122
- "checked": {
123
- "type": "boolean",
124
- "mutable": true,
125
- "complexType": {
126
- "original": "boolean",
127
- "resolved": "boolean",
128
- "references": {}
129
- },
130
- "required": false,
131
- "optional": false,
132
- "docs": {
133
- "tags": [],
134
- "text": "Checked state of the checkbox"
135
- },
136
- "attribute": "checked",
137
- "reflect": false,
138
- "defaultValue": "false"
139
- },
140
- "disabled": {
141
- "type": "boolean",
142
- "mutable": false,
143
- "complexType": {
144
- "original": "boolean",
145
- "resolved": "boolean",
146
- "references": {}
147
- },
148
- "required": false,
149
- "optional": false,
150
- "docs": {
151
- "tags": [],
152
- "text": "Disabled state of the checkbox"
153
- },
154
- "attribute": "disabled",
155
- "reflect": false,
156
- "defaultValue": "false"
157
- },
158
- "identifier": {
159
- "type": "string",
160
- "mutable": false,
161
- "complexType": {
162
- "original": "string",
163
- "resolved": "string | undefined",
164
- "references": {}
165
- },
166
- "required": false,
167
- "optional": true,
168
- "docs": {
169
- "tags": [],
170
- "text": "A unique identifier for the input."
171
- },
172
- "attribute": "identifier",
173
- "reflect": false
174
- },
175
- "indeterminate": {
176
- "type": "boolean",
177
- "mutable": false,
178
- "complexType": {
179
- "original": "boolean",
180
- "resolved": "boolean",
181
- "references": {}
182
- },
183
- "required": false,
184
- "optional": false,
185
- "docs": {
186
- "tags": [],
187
- "text": "Indeterminate state of the checkbox"
188
- },
189
- "attribute": "indeterminate",
190
- "reflect": false,
191
- "defaultValue": "false"
192
- },
193
- "label": {
194
- "type": "string",
195
- "mutable": false,
196
- "complexType": {
197
- "original": "string",
198
- "resolved": "string",
199
- "references": {}
200
- },
201
- "required": false,
202
- "optional": false,
203
- "docs": {
204
- "tags": [],
205
- "text": "Label of the checkbox which is presented in the UI"
206
- },
207
- "attribute": "label",
208
- "reflect": false,
209
- "defaultValue": "''"
210
- },
211
- "labelHidden": {
212
- "type": "boolean",
213
- "mutable": false,
214
- "complexType": {
215
- "original": "boolean",
216
- "resolved": "boolean",
217
- "references": {}
218
- },
219
- "required": false,
220
- "optional": false,
221
- "docs": {
222
- "tags": [],
223
- "text": "Visually hide the label, but still show it to assistive technologies like screen readers."
224
- },
225
- "attribute": "label-hidden",
226
- "reflect": false,
227
- "defaultValue": "false"
228
- },
229
- "name": {
230
- "type": "string",
231
- "mutable": false,
232
- "complexType": {
233
- "original": "string",
234
- "resolved": "string | undefined",
235
- "references": {}
236
- },
237
- "required": false,
238
- "optional": true,
239
- "docs": {
240
- "tags": [],
241
- "text": "The name of the input"
88
+ static get originalStyleUrls() {
89
+ return {
90
+ "$": ["cat-checkbox.scss"]
91
+ };
92
+ }
93
+ static get styleUrls() {
94
+ return {
95
+ "$": ["cat-checkbox.css"]
96
+ };
97
+ }
98
+ static get properties() {
99
+ return {
100
+ "checked": {
101
+ "type": "boolean",
102
+ "mutable": true,
103
+ "complexType": {
104
+ "original": "boolean",
105
+ "resolved": "boolean",
106
+ "references": {}
107
+ },
108
+ "required": false,
109
+ "optional": false,
110
+ "docs": {
111
+ "tags": [],
112
+ "text": "Checked state of the checkbox"
113
+ },
114
+ "attribute": "checked",
115
+ "reflect": false,
116
+ "defaultValue": "false"
242
117
  },
243
- "attribute": "name",
244
- "reflect": false
245
- },
246
- "required": {
247
- "type": "boolean",
248
- "mutable": false,
249
- "complexType": {
250
- "original": "boolean",
251
- "resolved": "boolean",
252
- "references": {}
118
+ "disabled": {
119
+ "type": "boolean",
120
+ "mutable": false,
121
+ "complexType": {
122
+ "original": "boolean",
123
+ "resolved": "boolean",
124
+ "references": {}
125
+ },
126
+ "required": false,
127
+ "optional": false,
128
+ "docs": {
129
+ "tags": [],
130
+ "text": "Disabled state of the checkbox"
131
+ },
132
+ "attribute": "disabled",
133
+ "reflect": false,
134
+ "defaultValue": "false"
253
135
  },
254
- "required": false,
255
- "optional": false,
256
- "docs": {
257
- "tags": [],
258
- "text": "Required state of the checkbox"
136
+ "identifier": {
137
+ "type": "string",
138
+ "mutable": false,
139
+ "complexType": {
140
+ "original": "string",
141
+ "resolved": "string | undefined",
142
+ "references": {}
143
+ },
144
+ "required": false,
145
+ "optional": true,
146
+ "docs": {
147
+ "tags": [],
148
+ "text": "A unique identifier for the input."
149
+ },
150
+ "attribute": "identifier",
151
+ "reflect": false
259
152
  },
260
- "attribute": "required",
261
- "reflect": false,
262
- "defaultValue": "false"
263
- },
264
- "value": {
265
- "type": "any",
266
- "mutable": true,
267
- "complexType": {
268
- "original": "string | boolean",
269
- "resolved": "boolean | string | undefined",
270
- "references": {}
153
+ "indeterminate": {
154
+ "type": "boolean",
155
+ "mutable": false,
156
+ "complexType": {
157
+ "original": "boolean",
158
+ "resolved": "boolean",
159
+ "references": {}
160
+ },
161
+ "required": false,
162
+ "optional": false,
163
+ "docs": {
164
+ "tags": [],
165
+ "text": "Indeterminate state of the checkbox"
166
+ },
167
+ "attribute": "indeterminate",
168
+ "reflect": false,
169
+ "defaultValue": "false"
271
170
  },
272
- "required": false,
273
- "optional": true,
274
- "docs": {
275
- "tags": [],
276
- "text": "The value of the checkbox"
171
+ "label": {
172
+ "type": "string",
173
+ "mutable": false,
174
+ "complexType": {
175
+ "original": "string",
176
+ "resolved": "string",
177
+ "references": {}
178
+ },
179
+ "required": false,
180
+ "optional": false,
181
+ "docs": {
182
+ "tags": [],
183
+ "text": "Label of the checkbox which is presented in the UI"
184
+ },
185
+ "attribute": "label",
186
+ "reflect": false,
187
+ "defaultValue": "''"
277
188
  },
278
- "attribute": "value",
279
- "reflect": false
280
- },
281
- "hint": {
282
- "type": "string",
283
- "mutable": false,
284
- "complexType": {
285
- "original": "string | string[]",
286
- "resolved": "string | string[] | undefined",
287
- "references": {}
189
+ "labelHidden": {
190
+ "type": "boolean",
191
+ "mutable": false,
192
+ "complexType": {
193
+ "original": "boolean",
194
+ "resolved": "boolean",
195
+ "references": {}
196
+ },
197
+ "required": false,
198
+ "optional": false,
199
+ "docs": {
200
+ "tags": [],
201
+ "text": "Visually hide the label, but still show it to assistive technologies like screen readers."
202
+ },
203
+ "attribute": "label-hidden",
204
+ "reflect": false,
205
+ "defaultValue": "false"
288
206
  },
289
- "required": false,
290
- "optional": true,
291
- "docs": {
292
- "tags": [],
293
- "text": "Optional hint text(s) to be displayed with the checkbox."
207
+ "name": {
208
+ "type": "string",
209
+ "mutable": false,
210
+ "complexType": {
211
+ "original": "string",
212
+ "resolved": "string | undefined",
213
+ "references": {}
214
+ },
215
+ "required": false,
216
+ "optional": true,
217
+ "docs": {
218
+ "tags": [],
219
+ "text": "The name of the input"
220
+ },
221
+ "attribute": "name",
222
+ "reflect": false
294
223
  },
295
- "attribute": "hint",
296
- "reflect": false
297
- },
298
- "labelLeft": {
299
- "type": "boolean",
300
- "mutable": false,
301
- "complexType": {
302
- "original": "boolean",
303
- "resolved": "boolean",
304
- "references": {}
224
+ "required": {
225
+ "type": "boolean",
226
+ "mutable": false,
227
+ "complexType": {
228
+ "original": "boolean",
229
+ "resolved": "boolean",
230
+ "references": {}
231
+ },
232
+ "required": false,
233
+ "optional": false,
234
+ "docs": {
235
+ "tags": [],
236
+ "text": "Required state of the checkbox"
237
+ },
238
+ "attribute": "required",
239
+ "reflect": false,
240
+ "defaultValue": "false"
305
241
  },
306
- "required": false,
307
- "optional": false,
308
- "docs": {
309
- "tags": [],
310
- "text": "Whether the label should appear to the left of the checkbox."
242
+ "value": {
243
+ "type": "any",
244
+ "mutable": true,
245
+ "complexType": {
246
+ "original": "string | boolean",
247
+ "resolved": "boolean | string | undefined",
248
+ "references": {}
249
+ },
250
+ "required": false,
251
+ "optional": true,
252
+ "docs": {
253
+ "tags": [],
254
+ "text": "The value of the checkbox"
255
+ },
256
+ "attribute": "value",
257
+ "reflect": false
311
258
  },
312
- "attribute": "label-left",
313
- "reflect": false,
314
- "defaultValue": "false"
315
- },
316
- "nativeAttributes": {
317
- "type": "unknown",
318
- "mutable": false,
319
- "complexType": {
320
- "original": "{ [key: string]: string }",
321
- "resolved": "undefined | { [key: string]: string; }",
322
- "references": {}
259
+ "hint": {
260
+ "type": "string",
261
+ "mutable": false,
262
+ "complexType": {
263
+ "original": "string | string[]",
264
+ "resolved": "string | string[] | undefined",
265
+ "references": {}
266
+ },
267
+ "required": false,
268
+ "optional": true,
269
+ "docs": {
270
+ "tags": [],
271
+ "text": "Optional hint text(s) to be displayed with the checkbox."
272
+ },
273
+ "attribute": "hint",
274
+ "reflect": false
323
275
  },
324
- "required": false,
325
- "optional": true,
326
- "docs": {
327
- "tags": [],
328
- "text": "Attributes that will be added to the native HTML input element."
329
- }
330
- }
331
- }; }
332
- static get states() { return {
333
- "hasSlottedLabel": {}
334
- }; }
335
- static get events() { return [{
336
- "method": "catChange",
337
- "name": "catChange",
338
- "bubbles": true,
339
- "cancelable": true,
340
- "composed": true,
341
- "docs": {
342
- "tags": [],
343
- "text": "Emitted when the checked status of the checkbox is changed."
276
+ "labelLeft": {
277
+ "type": "boolean",
278
+ "mutable": false,
279
+ "complexType": {
280
+ "original": "boolean",
281
+ "resolved": "boolean",
282
+ "references": {}
283
+ },
284
+ "required": false,
285
+ "optional": false,
286
+ "docs": {
287
+ "tags": [],
288
+ "text": "Whether the label should appear to the left of the checkbox."
289
+ },
290
+ "attribute": "label-left",
291
+ "reflect": false,
292
+ "defaultValue": "false"
344
293
  },
345
- "complexType": {
346
- "original": "any",
347
- "resolved": "any",
348
- "references": {}
294
+ "nativeAttributes": {
295
+ "type": "unknown",
296
+ "mutable": false,
297
+ "complexType": {
298
+ "original": "{ [key: string]: string }",
299
+ "resolved": "undefined | { [key: string]: string; }",
300
+ "references": {}
301
+ },
302
+ "required": false,
303
+ "optional": true,
304
+ "docs": {
305
+ "tags": [],
306
+ "text": "Attributes that will be added to the native HTML input element."
307
+ }
349
308
  }
350
- }, {
351
- "method": "catFocus",
352
- "name": "catFocus",
353
- "bubbles": true,
354
- "cancelable": true,
355
- "composed": true,
356
- "docs": {
357
- "tags": [],
358
- "text": "Emitted when the checkbox received focus."
359
- },
360
- "complexType": {
361
- "original": "FocusEvent",
362
- "resolved": "FocusEvent",
363
- "references": {
364
- "FocusEvent": {
365
- "location": "global"
309
+ };
310
+ }
311
+ static get states() {
312
+ return {
313
+ "hasSlottedLabel": {},
314
+ "hasSlottedHint": {}
315
+ };
316
+ }
317
+ static get events() {
318
+ return [{
319
+ "method": "catChange",
320
+ "name": "catChange",
321
+ "bubbles": true,
322
+ "cancelable": true,
323
+ "composed": true,
324
+ "docs": {
325
+ "tags": [],
326
+ "text": "Emitted when the checked status of the checkbox is changed."
327
+ },
328
+ "complexType": {
329
+ "original": "any",
330
+ "resolved": "any",
331
+ "references": {}
332
+ }
333
+ }, {
334
+ "method": "catFocus",
335
+ "name": "catFocus",
336
+ "bubbles": true,
337
+ "cancelable": true,
338
+ "composed": true,
339
+ "docs": {
340
+ "tags": [],
341
+ "text": "Emitted when the checkbox received focus."
342
+ },
343
+ "complexType": {
344
+ "original": "FocusEvent",
345
+ "resolved": "FocusEvent",
346
+ "references": {
347
+ "FocusEvent": {
348
+ "location": "global"
349
+ }
366
350
  }
367
351
  }
368
- }
369
- }, {
370
- "method": "catBlur",
371
- "name": "catBlur",
372
- "bubbles": true,
373
- "cancelable": true,
374
- "composed": true,
375
- "docs": {
376
- "tags": [],
377
- "text": "Emitted when the checkbox loses focus."
378
- },
379
- "complexType": {
380
- "original": "FocusEvent",
381
- "resolved": "FocusEvent",
382
- "references": {
383
- "FocusEvent": {
384
- "location": "global"
352
+ }, {
353
+ "method": "catBlur",
354
+ "name": "catBlur",
355
+ "bubbles": true,
356
+ "cancelable": true,
357
+ "composed": true,
358
+ "docs": {
359
+ "tags": [],
360
+ "text": "Emitted when the checkbox loses focus."
361
+ },
362
+ "complexType": {
363
+ "original": "FocusEvent",
364
+ "resolved": "FocusEvent",
365
+ "references": {
366
+ "FocusEvent": {
367
+ "location": "global"
368
+ }
385
369
  }
386
370
  }
387
- }
388
- }]; }
389
- static get methods() { return {
390
- "doFocus": {
391
- "complexType": {
392
- "signature": "(options?: FocusOptions | undefined) => Promise<void>",
393
- "parameters": [{
394
- "tags": [{
395
- "name": "param",
396
- "text": "options An optional object providing options to control aspects of\nthe focusing process."
397
- }],
398
- "text": "An optional object providing options to control aspects of\nthe focusing process."
399
- }],
400
- "references": {
401
- "Promise": {
402
- "location": "global"
371
+ }];
372
+ }
373
+ static get methods() {
374
+ return {
375
+ "doFocus": {
376
+ "complexType": {
377
+ "signature": "(options?: FocusOptions) => Promise<void>",
378
+ "parameters": [{
379
+ "tags": [{
380
+ "name": "param",
381
+ "text": "options An optional object providing options to control aspects of\nthe focusing process."
382
+ }],
383
+ "text": "An optional object providing options to control aspects of\nthe focusing process."
384
+ }],
385
+ "references": {
386
+ "Promise": {
387
+ "location": "global"
388
+ },
389
+ "FocusOptions": {
390
+ "location": "global"
391
+ }
403
392
  },
404
- "FocusOptions": {
405
- "location": "global"
406
- }
393
+ "return": "Promise<void>"
407
394
  },
408
- "return": "Promise<void>"
395
+ "docs": {
396
+ "text": "Programmatically move focus to the checkbox. Use this method instead of\n`input.focus()`.",
397
+ "tags": [{
398
+ "name": "param",
399
+ "text": "options An optional object providing options to control aspects of\nthe focusing process."
400
+ }]
401
+ }
409
402
  },
410
- "docs": {
411
- "text": "Programmatically move focus to the checkbox. Use this method instead of\n`input.focus()`.",
412
- "tags": [{
413
- "name": "param",
414
- "text": "options An optional object providing options to control aspects of\nthe focusing process."
415
- }]
416
- }
417
- },
418
- "doBlur": {
419
- "complexType": {
420
- "signature": "() => Promise<void>",
421
- "parameters": [],
422
- "references": {
423
- "Promise": {
424
- "location": "global"
425
- }
403
+ "doBlur": {
404
+ "complexType": {
405
+ "signature": "() => Promise<void>",
406
+ "parameters": [],
407
+ "references": {
408
+ "Promise": {
409
+ "location": "global"
410
+ }
411
+ },
412
+ "return": "Promise<void>"
426
413
  },
427
- "return": "Promise<void>"
414
+ "docs": {
415
+ "text": "Programmatically remove focus from the checkbox. Use this method instead of\n`input.blur()`.",
416
+ "tags": []
417
+ }
428
418
  },
429
- "docs": {
430
- "text": "Programmatically remove focus from the checkbox. Use this method instead of\n`input.blur()`.",
431
- "tags": []
432
- }
433
- },
434
- "doClick": {
435
- "complexType": {
436
- "signature": "() => Promise<void>",
437
- "parameters": [],
438
- "references": {
439
- "Promise": {
440
- "location": "global"
441
- }
419
+ "doClick": {
420
+ "complexType": {
421
+ "signature": "() => Promise<void>",
422
+ "parameters": [],
423
+ "references": {
424
+ "Promise": {
425
+ "location": "global"
426
+ }
427
+ },
428
+ "return": "Promise<void>"
442
429
  },
443
- "return": "Promise<void>"
444
- },
445
- "docs": {
446
- "text": "Programmatically simulate a click on the checkbox.",
447
- "tags": []
430
+ "docs": {
431
+ "text": "Programmatically simulate a click on the checkbox.",
432
+ "tags": []
433
+ }
448
434
  }
449
- }
450
- }; }
435
+ };
436
+ }
451
437
  static get elementRef() { return "hostElement"; }
452
438
  }
453
- //# sourceMappingURL=cat-checkbox.js.map
439
+ //# sourceMappingURL=cat-checkbox.js.map