@4sh/ui-kit 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/README.fr.md +18 -10
  2. package/README.md +18 -10
  3. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs +542 -150
  4. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs.map +1 -1
  5. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +622 -248
  6. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
  7. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs +385 -152
  8. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
  9. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs +748 -433
  10. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs.map +1 -1
  11. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs +227 -135
  12. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs.map +1 -1
  13. package/fesm2022/4sh-ui-kit-base-ui-image.mjs +1200 -633
  14. package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
  15. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +1675 -953
  16. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
  17. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs +243 -117
  18. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs.map +1 -1
  19. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +2294 -2039
  20. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
  21. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +1058 -1113
  22. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -1
  23. package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs +1108 -0
  24. package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs.map +1 -0
  25. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +397 -141
  26. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
  27. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs +1529 -583
  28. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
  29. package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs +383 -224
  30. package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs.map +1 -1
  31. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs +345 -177
  32. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
  33. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +280 -130
  34. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
  35. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +507 -246
  36. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
  37. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs +401 -291
  38. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs.map +1 -1
  39. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +1277 -697
  40. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
  41. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +467 -194
  42. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
  43. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs +394 -270
  44. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs.map +1 -1
  45. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs +140 -60
  46. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs.map +1 -1
  47. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs +386 -167
  48. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
  49. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs +150 -87
  50. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs.map +1 -1
  51. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs +345 -180
  52. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs.map +1 -1
  53. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs +582 -392
  54. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
  55. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +1552 -888
  56. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
  57. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs +485 -338
  58. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs.map +1 -1
  59. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs +503 -311
  60. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs.map +1 -1
  61. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +271 -131
  62. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
  63. package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs +457 -214
  64. package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs.map +1 -1
  65. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs +711 -371
  66. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs.map +1 -1
  67. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs +235 -121
  68. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs.map +1 -1
  69. package/fesm2022/4sh-ui-kit-forms.mjs +723 -596
  70. package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -1
  71. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs +546 -242
  72. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs.map +1 -1
  73. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs +335 -157
  74. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
  75. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs +53 -33
  76. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs.map +1 -1
  77. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs +218 -121
  78. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs.map +1 -1
  79. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs +192 -100
  80. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs.map +1 -1
  81. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs +456 -204
  82. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs.map +1 -1
  83. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs +314 -147
  84. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs.map +1 -1
  85. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs +179 -82
  86. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs.map +1 -1
  87. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs +268 -123
  88. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs.map +1 -1
  89. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs +391 -146
  90. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs.map +1 -1
  91. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs +158 -76
  92. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs.map +1 -1
  93. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs +159 -80
  94. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs.map +1 -1
  95. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs +295 -131
  96. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs.map +1 -1
  97. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs +211 -83
  98. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs.map +1 -1
  99. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs +784 -414
  100. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
  101. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs +822 -476
  102. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs.map +1 -1
  103. package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs +1014 -599
  104. package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs.map +1 -1
  105. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs +403 -189
  106. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs.map +1 -1
  107. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs +707 -272
  108. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
  109. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +1146 -568
  110. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
  111. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs +519 -308
  112. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs.map +1 -1
  113. package/fesm2022/4sh-ui-kit-motion.mjs +252 -150
  114. package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -1
  115. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs +793 -341
  116. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs.map +1 -1
  117. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs +351 -194
  118. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs.map +1 -1
  119. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs +511 -220
  120. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs.map +1 -1
  121. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs +910 -548
  122. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
  123. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +1128 -555
  124. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
  125. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +915 -470
  126. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
  127. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +931 -474
  128. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
  129. package/fesm2022/4sh-ui-kit-overlay.mjs +26 -109
  130. package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -1
  131. package/fesm2022/4sh-ui-kit-ripple.mjs +329 -290
  132. package/fesm2022/4sh-ui-kit-ripple.mjs.map +1 -1
  133. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +709 -248
  134. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
  135. package/fesm2022/4sh-ui-kit-table-ui-table.mjs +2633 -1370
  136. package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
  137. package/fesm2022/4sh-ui-kit-theming.mjs +112 -113
  138. package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -1
  139. package/fesm2022/4sh-ui-kit-types.mjs +0 -12
  140. package/fesm2022/4sh-ui-kit.mjs +3 -15
  141. package/fesm2022/4sh-ui-kit.mjs.map +1 -1
  142. package/mcp/data/component-api.json +313 -2
  143. package/mcp/data/text-search-docs.json +177 -17
  144. package/mcp/data/ui-config.json +378 -1
  145. package/mcp/index.js +8190 -2876
  146. package/mcp/package.json +1 -1
  147. package/package.json +5 -1
  148. package/styles/component-vars.scss +22 -1
  149. package/styles/utils/_mixins.scss +11 -0
  150. package/types/4sh-ui-kit-actions-ui-button-split.d.ts +198 -87
  151. package/types/4sh-ui-kit-actions-ui-button.d.ts +240 -116
  152. package/types/4sh-ui-kit-actions-ui-link.d.ts +136 -67
  153. package/types/4sh-ui-kit-actions-ui-speed-dial.d.ts +287 -180
  154. package/types/4sh-ui-kit-base-ui-icon.d.ts +92 -58
  155. package/types/4sh-ui-kit-base-ui-image.d.ts +406 -205
  156. package/types/4sh-ui-kit-forms-ui-autocomplete.d.ts +577 -367
  157. package/types/4sh-ui-kit-forms-ui-checkbox.d.ts +77 -42
  158. package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +953 -700
  159. package/types/4sh-ui-kit-forms-ui-editor.d.ts +374 -340
  160. package/types/4sh-ui-kit-forms-ui-field-sign.d.ts +325 -0
  161. package/types/4sh-ui-kit-forms-ui-field.d.ts +150 -64
  162. package/types/4sh-ui-kit-forms-ui-file-upload.d.ts +583 -241
  163. package/types/4sh-ui-kit-forms-ui-input-date.d.ts +152 -103
  164. package/types/4sh-ui-kit-forms-ui-input-group.d.ts +109 -63
  165. package/types/4sh-ui-kit-forms-ui-input-mask.d.ts +93 -57
  166. package/types/4sh-ui-kit-forms-ui-input-number.d.ts +171 -93
  167. package/types/4sh-ui-kit-forms-ui-input-otp.d.ts +137 -100
  168. package/types/4sh-ui-kit-forms-ui-input-tags.d.ts +469 -309
  169. package/types/4sh-ui-kit-forms-ui-input.d.ts +198 -116
  170. package/types/4sh-ui-kit-forms-ui-knob.d.ts +132 -80
  171. package/types/4sh-ui-kit-forms-ui-label.d.ts +47 -22
  172. package/types/4sh-ui-kit-forms-ui-nudger.d.ts +134 -67
  173. package/types/4sh-ui-kit-forms-ui-radio.d.ts +48 -33
  174. package/types/4sh-ui-kit-forms-ui-rating.d.ts +120 -86
  175. package/types/4sh-ui-kit-forms-ui-segment-control.d.ts +221 -147
  176. package/types/4sh-ui-kit-forms-ui-select.d.ts +561 -357
  177. package/types/4sh-ui-kit-forms-ui-slider.d.ts +156 -105
  178. package/types/4sh-ui-kit-forms-ui-swatch-picker.d.ts +133 -97
  179. package/types/4sh-ui-kit-forms-ui-textarea.d.ts +90 -54
  180. package/types/4sh-ui-kit-forms-ui-toggle-block.d.ts +158 -94
  181. package/types/4sh-ui-kit-forms-ui-toggle-button.d.ts +314 -178
  182. package/types/4sh-ui-kit-forms-ui-toggle.d.ts +88 -54
  183. package/types/4sh-ui-kit-forms.d.ts +291 -186
  184. package/types/4sh-ui-kit-informative-ui-accordion.d.ts +162 -92
  185. package/types/4sh-ui-kit-informative-ui-alert.d.ts +128 -62
  186. package/types/4sh-ui-kit-informative-ui-avatar-group.d.ts +8 -8
  187. package/types/4sh-ui-kit-informative-ui-avatar.d.ts +81 -44
  188. package/types/4sh-ui-kit-informative-ui-badge.d.ts +71 -41
  189. package/types/4sh-ui-kit-informative-ui-chip.d.ts +194 -99
  190. package/types/4sh-ui-kit-informative-ui-empty-state.d.ts +105 -65
  191. package/types/4sh-ui-kit-informative-ui-helper.d.ts +64 -34
  192. package/types/4sh-ui-kit-informative-ui-progress-bar.d.ts +120 -65
  193. package/types/4sh-ui-kit-informative-ui-read-only.d.ts +147 -67
  194. package/types/4sh-ui-kit-informative-ui-separator.d.ts +65 -35
  195. package/types/4sh-ui-kit-informative-ui-skeleton.d.ts +62 -32
  196. package/types/4sh-ui-kit-informative-ui-spinner.d.ts +111 -50
  197. package/types/4sh-ui-kit-informative-ui-tag.d.ts +77 -37
  198. package/types/4sh-ui-kit-informative-ui-toast.d.ts +300 -180
  199. package/types/4sh-ui-kit-informative-ui-tooltip.d.ts +269 -141
  200. package/types/4sh-ui-kit-layout-ui-bottom-sheet.d.ts +360 -221
  201. package/types/4sh-ui-kit-layout-ui-card.d.ts +119 -79
  202. package/types/4sh-ui-kit-layout-ui-drawer.d.ts +244 -120
  203. package/types/4sh-ui-kit-layout-ui-modal.d.ts +409 -222
  204. package/types/4sh-ui-kit-layout-ui-popover.d.ts +149 -91
  205. package/types/4sh-ui-kit-motion.d.ts +117 -67
  206. package/types/4sh-ui-kit-navigation-ui-bottom-tab-bar.d.ts +279 -145
  207. package/types/4sh-ui-kit-navigation-ui-breadcrumb.d.ts +134 -96
  208. package/types/4sh-ui-kit-navigation-ui-context-menu.d.ts +148 -89
  209. package/types/4sh-ui-kit-navigation-ui-menu.d.ts +282 -201
  210. package/types/4sh-ui-kit-navigation-ui-sidebar.d.ts +425 -261
  211. package/types/4sh-ui-kit-navigation-ui-stepper.d.ts +279 -183
  212. package/types/4sh-ui-kit-navigation-ui-tabs.d.ts +275 -173
  213. package/types/4sh-ui-kit-overlay.d.ts +6 -6
  214. package/types/4sh-ui-kit-ripple.d.ts +99 -74
  215. package/types/4sh-ui-kit-table-ui-paginator.d.ts +237 -133
  216. package/types/4sh-ui-kit-table-ui-table.d.ts +769 -470
  217. package/types/4sh-ui-kit-theming.d.ts +27 -29
  218. package/types/4sh-ui-kit-types.d.ts +6 -5
  219. package/types/4sh-ui-kit.d.ts +4 -3
  220. package/fesm2022/4sh-ui-kit-types.mjs.map +0 -1
@@ -1,118 +1,244 @@
1
- import * as i0 from '@angular/core';
2
- import { input, booleanAttribute, output, viewChild, computed, effect, forwardRef, Component } from '@angular/core';
3
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
4
- import { BaseFieldControl } from '@4sh/ui-kit/forms';
5
- import { UiIcon } from '@4sh/ui-kit/base/ui-icon';
6
-
7
- /**
8
- * ui-checkbox — headless checkbox built on a real native <input type="checkbox">.
9
- *
10
- * The native input stays in the DOM (visually covering the styled box) so
11
- * keyboard, screen readers, label click and form semantics come for free.
12
- * Interactive states (hover/focus/disabled/checked) are pure CSS driven by
13
- * `form.*` design tokens.
14
- *
15
- * Works standalone, with [(ngModel)] or with reactive forms (ControlValueAccessor).
16
- * By default the model value is boolean; `trueValue`/`falseValue` let the model
17
- * carry any pair of values (e.g. 'yes'/'no', 1/0).
18
- */
19
- class UiCheckbox extends BaseFieldControl {
20
- constructor() {
21
- super();
22
- /** Label displayed next to the box (clicking it toggles the checkbox). */
23
- this.label = input(/* @ts-ignore */
24
- ...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
25
- /** Model value emitted when checked. */
26
- this.trueValue = input(true, /* @ts-ignore */
27
- ...(ngDevMode ? [{ debugName: "trueValue" }] : /* istanbul ignore next */ []));
28
- /** Model value emitted when unchecked. */
29
- this.falseValue = input(false, /* @ts-ignore */
30
- ...(ngDevMode ? [{ debugName: "falseValue" }] : /* istanbul ignore next */ []));
31
- /** Visual indeterminate state ("some but not all selected"). Purely visual: the model keeps its value. */
32
- this.indeterminate = input(false, { ...(ngDevMode ? { debugName: "indeterminate" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
33
- /** Icon shown when checked. */
34
- this.checkIcon = input('check', /* @ts-ignore */
35
- ...(ngDevMode ? [{ debugName: "checkIcon" }] : /* istanbul ignore next */ []));
36
- /** Icon shown when indeterminate. */
37
- this.indeterminateIcon = input('minus', /* @ts-ignore */
38
- ...(ngDevMode ? [{ debugName: "indeterminateIcon" }] : /* istanbul ignore next */ []));
39
- /** Emitted on user toggle with the new model value (never when disabled/readonly). */
40
- this.checkboxChange = output();
41
- /** Emitted when the native input receives focus. */
42
- this.checkboxFocus = output();
43
- /** Emitted when the native input loses focus. */
44
- this.checkboxBlur = output();
45
- /** @ignore */
46
- this.inputEl = viewChild.required('inputEl', /* @ts-ignore */
47
- ...(ngDevMode ? [{ debugName: "inputEl" }] : /* istanbul ignore next */ []));
48
- /** @ignore */
49
- this.checked = computed(() => this.modelValue() === this.trueValue(), /* @ts-ignore */
50
- ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
51
- /** @ignore */
52
- this.classes = computed(() => {
53
- const c = ['ui-checkbox'];
54
- if (this.checked())
55
- c.push('_checked');
56
- if (this.indeterminate())
57
- c.push('_indeterminate');
58
- if (this.isDisabled())
59
- c.push('_disabled');
60
- if (this.readonly())
61
- c.push('_readonly');
62
- if (this.isInvalid())
63
- c.push('_invalid');
64
- return c.join(' ');
65
- }, /* @ts-ignore */
66
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
67
- // The `indeterminate` state only exists as a DOM property.
68
- effect(() => {
69
- this.inputEl().nativeElement.indeterminate = this.indeterminate();
70
- });
71
- }
72
- /** @ignore */
73
- uidPrefix() {
74
- return 'ui-checkbox';
75
- }
76
- /** Focus the native input programmatically. */
77
- focus(options) {
78
- this.inputEl().nativeElement.focus(options);
79
- }
80
- /** @ignore Native change: single source of truth for user toggles. */
81
- onNativeChange() {
82
- const inputEl = this.inputEl().nativeElement;
83
- if (this.readonly()) {
84
- inputEl.checked = this.checked(); // revert the native toggle
85
- return;
86
- }
87
- const value = inputEl.checked ? this.trueValue() : this.falseValue();
88
- this.modelValue.set(value);
89
- this.emitChange(value);
90
- this.checkboxChange.emit(value);
91
- }
92
- /** @ignore */
93
- onBlur(event) {
94
- this.emitTouch();
95
- this.checkboxBlur.emit(event);
96
- }
97
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
98
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: UiCheckbox, isStandalone: true, selector: "ui-checkbox", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, trueValue: { classPropertyName: "trueValue", publicName: "trueValue", isSignal: true, isRequired: false, transformFunction: null }, falseValue: { classPropertyName: "falseValue", publicName: "falseValue", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, checkIcon: { classPropertyName: "checkIcon", publicName: "checkIcon", isSignal: true, isRequired: false, transformFunction: null }, indeterminateIcon: { classPropertyName: "indeterminateIcon", publicName: "indeterminateIcon", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkboxChange: "checkboxChange", checkboxFocus: "checkboxFocus", checkboxBlur: "checkboxBlur" }, providers: [
99
- { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiCheckbox), multi: true },
100
- ], viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<label [class]=\"classes()\">\n <span class=\"ui-checkbox-control\">\n <input\n #inputEl\n type=\"checkbox\"\n class=\"ui-checkbox-input\"\n [id]=\"resolvedId()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (change)=\"onNativeChange()\"\n (focus)=\"checkboxFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n <span class=\"ui-checkbox-box\" aria-hidden=\"true\">\n <ui-icon\n class=\"ui-checkbox-icon\"\n [name]=\"indeterminate() ? indeterminateIcon() : checkIcon()\"\n size=\"md\"\n />\n </span>\n </span>\n\n @if (label()) {\n <span class=\"ui-checkbox-label\">\n <span class=\"ui-checkbox-text\">{{ label() }}</span>\n @if (required()) {\n <span class=\"ui-checkbox-required\" aria-hidden=\"true\">*</span>\n }\n </span>\n }\n</label>\n", styles: [".ui-checkbox{display:inline-flex;align-items:center;gap:var(--ui-checkbox-gap, var(--ui-form-control-gap, var(--units-sm)));cursor:pointer;--_surface: var(--ui-form-control-surface, var(--form-high-surface-default));--_stroke: var(--ui-form-control-stroke, var(--form-high-stroke-default));--_content: var(--ui-form-control-marker-color, var(--form-high-content-checked))}.ui-checkbox:hover:not(._disabled):not(._readonly){--_surface: var(--ui-form-control-surface-hover, var(--form-high-surface-hover));--_stroke: var(--ui-form-control-stroke-hover, var(--form-high-stroke-hover));--ui-label-color: var(--form-high-content-hover)}.ui-checkbox._checked:not(._disabled),.ui-checkbox._indeterminate:not(._disabled){--_surface: var(--ui-form-control-surface-checked, var(--form-high-surface-checked));--_stroke: var(--ui-form-control-stroke-checked, var(--form-high-stroke-checked))}.ui-checkbox:has(.ui-checkbox-input:focus-visible){--_stroke: var(--ui-form-control-stroke-focus, var(--form-high-stroke-focused));--_focus-ring: rgb(from var(--ui-form-control-stroke-focus, var(--form-high-stroke-focused)) r g b / 50%)}.ui-checkbox._disabled{--_surface: var(--ui-form-control-surface-disabled, var(--form-high-surface-disabled));--_stroke: var(--ui-form-control-stroke-disabled, var(--form-high-stroke-disabled));--_content: var(--ui-form-control-marker-color-disabled, var(--form-high-content-disabled))}.ui-checkbox._invalid{--_surface: var(--ui-form-control-surface, var(--form-error-surface-default));--_stroke: var(--ui-form-control-stroke, var(--form-error-stroke-default));--_content: var(--ui-form-control-marker-color, var(--form-error-content-checked))}.ui-checkbox._invalid:hover:not(._disabled):not(._readonly){--_surface: var(--ui-form-control-surface-hover, var(--form-error-surface-hover));--_stroke: var(--ui-form-control-stroke-hover, var(--form-error-stroke-hover));--ui-label-color: var(--form-error-content-hover)}.ui-checkbox._invalid._checked:not(._disabled),.ui-checkbox._invalid._indeterminate:not(._disabled){--_surface: var(--ui-form-control-surface-checked, var(--form-error-surface-checked));--_stroke: var(--ui-form-control-stroke-checked, var(--form-error-stroke-checked))}.ui-checkbox._invalid:has(.ui-checkbox-input:focus-visible){--_stroke: var(--ui-form-control-stroke-focus, var(--form-error-stroke-focused));--_focus-ring: rgb(from var(--ui-form-control-stroke-focus, var(--form-error-stroke-focused)) r g b / 50%)}.ui-checkbox._invalid._disabled{--_surface: var(--ui-form-control-surface-disabled, var(--form-error-surface-disabled));--_stroke: var(--ui-form-control-stroke-disabled, var(--form-error-stroke-disabled));--_content: var(--ui-form-control-marker-color-disabled, var(--form-error-content-disabled))}.ui-checkbox-control{position:relative;display:inline-flex;width:var(--ui-checkbox-box-size, var(--ui-form-control-size, var(--size-components-2xs)));height:var(--ui-checkbox-box-size, var(--ui-form-control-size, var(--size-components-2xs)));flex-shrink:0}.ui-checkbox-input{position:absolute;inset:0;z-index:1;width:100%;height:100%;margin:0;opacity:0;cursor:inherit}.ui-checkbox-box{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:100%;height:100%;background-color:var(--_surface);border:var(--ui-checkbox-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--_stroke);border-radius:var(--ui-checkbox-box-radius, var(--radius-xs));transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),border-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),box-shadow var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-checkbox:has(.ui-checkbox-input:focus-visible) .ui-checkbox-box{box-shadow:0 0 0 var(--ui-checkbox-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--_focus-ring)}.ui-checkbox-icon{--ui-icon-size: var(--ui-checkbox-icon-size, var(--ui-icon-size-md, var(--size-typography-icon-md)));color:var(--_content);opacity:0;transform:scale(.6);transition:opacity var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),transform var(--ui-control-transition-duration, var(--motion-toggle-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-toggle-easing, var(--transition-easeinout)))}.ui-checkbox._checked .ui-checkbox-icon,.ui-checkbox._indeterminate .ui-checkbox-icon{opacity:1;transform:scale(1)}.ui-checkbox-label{display:inline-flex;align-items:center;gap:var(--ui-checkbox-label-gap, var(--units-2xs));font-family:var(--ui-checkbox-font-family, var(--fontfamily-base));font-size:var(--ui-checkbox-font-size, var(--size-typography-text-default));color:var(--ui-label-color, var(--form-high-content-default));cursor:inherit;-webkit-user-select:none;user-select:none;transition:color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-checkbox-required{color:var(--ui-checkbox-required-color, var(--informative-errorlow-content-default))}.ui-checkbox._disabled{cursor:not-allowed}.ui-checkbox._disabled .ui-checkbox-label{color:var(--ui-label-color-disabled, var(--form-high-content-disabled))}.ui-checkbox._readonly{cursor:default}\n"], dependencies: [{ kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }] }); }
101
- }
102
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiCheckbox, decorators: [{
103
- type: Component,
104
- args: [{ selector: 'ui-checkbox', imports: [UiIcon], providers: [
105
- { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiCheckbox), multi: true },
106
- ], template: "<label [class]=\"classes()\">\n <span class=\"ui-checkbox-control\">\n <input\n #inputEl\n type=\"checkbox\"\n class=\"ui-checkbox-input\"\n [id]=\"resolvedId()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (change)=\"onNativeChange()\"\n (focus)=\"checkboxFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n <span class=\"ui-checkbox-box\" aria-hidden=\"true\">\n <ui-icon\n class=\"ui-checkbox-icon\"\n [name]=\"indeterminate() ? indeterminateIcon() : checkIcon()\"\n size=\"md\"\n />\n </span>\n </span>\n\n @if (label()) {\n <span class=\"ui-checkbox-label\">\n <span class=\"ui-checkbox-text\">{{ label() }}</span>\n @if (required()) {\n <span class=\"ui-checkbox-required\" aria-hidden=\"true\">*</span>\n }\n </span>\n }\n</label>\n", styles: [".ui-checkbox{display:inline-flex;align-items:center;gap:var(--ui-checkbox-gap, var(--ui-form-control-gap, var(--units-sm)));cursor:pointer;--_surface: var(--ui-form-control-surface, var(--form-high-surface-default));--_stroke: var(--ui-form-control-stroke, var(--form-high-stroke-default));--_content: var(--ui-form-control-marker-color, var(--form-high-content-checked))}.ui-checkbox:hover:not(._disabled):not(._readonly){--_surface: var(--ui-form-control-surface-hover, var(--form-high-surface-hover));--_stroke: var(--ui-form-control-stroke-hover, var(--form-high-stroke-hover));--ui-label-color: var(--form-high-content-hover)}.ui-checkbox._checked:not(._disabled),.ui-checkbox._indeterminate:not(._disabled){--_surface: var(--ui-form-control-surface-checked, var(--form-high-surface-checked));--_stroke: var(--ui-form-control-stroke-checked, var(--form-high-stroke-checked))}.ui-checkbox:has(.ui-checkbox-input:focus-visible){--_stroke: var(--ui-form-control-stroke-focus, var(--form-high-stroke-focused));--_focus-ring: rgb(from var(--ui-form-control-stroke-focus, var(--form-high-stroke-focused)) r g b / 50%)}.ui-checkbox._disabled{--_surface: var(--ui-form-control-surface-disabled, var(--form-high-surface-disabled));--_stroke: var(--ui-form-control-stroke-disabled, var(--form-high-stroke-disabled));--_content: var(--ui-form-control-marker-color-disabled, var(--form-high-content-disabled))}.ui-checkbox._invalid{--_surface: var(--ui-form-control-surface, var(--form-error-surface-default));--_stroke: var(--ui-form-control-stroke, var(--form-error-stroke-default));--_content: var(--ui-form-control-marker-color, var(--form-error-content-checked))}.ui-checkbox._invalid:hover:not(._disabled):not(._readonly){--_surface: var(--ui-form-control-surface-hover, var(--form-error-surface-hover));--_stroke: var(--ui-form-control-stroke-hover, var(--form-error-stroke-hover));--ui-label-color: var(--form-error-content-hover)}.ui-checkbox._invalid._checked:not(._disabled),.ui-checkbox._invalid._indeterminate:not(._disabled){--_surface: var(--ui-form-control-surface-checked, var(--form-error-surface-checked));--_stroke: var(--ui-form-control-stroke-checked, var(--form-error-stroke-checked))}.ui-checkbox._invalid:has(.ui-checkbox-input:focus-visible){--_stroke: var(--ui-form-control-stroke-focus, var(--form-error-stroke-focused));--_focus-ring: rgb(from var(--ui-form-control-stroke-focus, var(--form-error-stroke-focused)) r g b / 50%)}.ui-checkbox._invalid._disabled{--_surface: var(--ui-form-control-surface-disabled, var(--form-error-surface-disabled));--_stroke: var(--ui-form-control-stroke-disabled, var(--form-error-stroke-disabled));--_content: var(--ui-form-control-marker-color-disabled, var(--form-error-content-disabled))}.ui-checkbox-control{position:relative;display:inline-flex;width:var(--ui-checkbox-box-size, var(--ui-form-control-size, var(--size-components-2xs)));height:var(--ui-checkbox-box-size, var(--ui-form-control-size, var(--size-components-2xs)));flex-shrink:0}.ui-checkbox-input{position:absolute;inset:0;z-index:1;width:100%;height:100%;margin:0;opacity:0;cursor:inherit}.ui-checkbox-box{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:100%;height:100%;background-color:var(--_surface);border:var(--ui-checkbox-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--_stroke);border-radius:var(--ui-checkbox-box-radius, var(--radius-xs));transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),border-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),box-shadow var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-checkbox:has(.ui-checkbox-input:focus-visible) .ui-checkbox-box{box-shadow:0 0 0 var(--ui-checkbox-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--_focus-ring)}.ui-checkbox-icon{--ui-icon-size: var(--ui-checkbox-icon-size, var(--ui-icon-size-md, var(--size-typography-icon-md)));color:var(--_content);opacity:0;transform:scale(.6);transition:opacity var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),transform var(--ui-control-transition-duration, var(--motion-toggle-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-toggle-easing, var(--transition-easeinout)))}.ui-checkbox._checked .ui-checkbox-icon,.ui-checkbox._indeterminate .ui-checkbox-icon{opacity:1;transform:scale(1)}.ui-checkbox-label{display:inline-flex;align-items:center;gap:var(--ui-checkbox-label-gap, var(--units-2xs));font-family:var(--ui-checkbox-font-family, var(--fontfamily-base));font-size:var(--ui-checkbox-font-size, var(--size-typography-text-default));color:var(--ui-label-color, var(--form-high-content-default));cursor:inherit;-webkit-user-select:none;user-select:none;transition:color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-checkbox-required{color:var(--ui-checkbox-required-color, var(--informative-errorlow-content-default))}.ui-checkbox._disabled{cursor:not-allowed}.ui-checkbox._disabled .ui-checkbox-label{color:var(--ui-label-color-disabled, var(--form-high-content-disabled))}.ui-checkbox._readonly{cursor:default}\n"] }]
107
- }], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], trueValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "trueValue", required: false }] }], falseValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "falseValue", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], checkIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkIcon", required: false }] }], indeterminateIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminateIcon", required: false }] }], checkboxChange: [{ type: i0.Output, args: ["checkboxChange"] }], checkboxFocus: [{ type: i0.Output, args: ["checkboxFocus"] }], checkboxBlur: [{ type: i0.Output, args: ["checkboxBlur"] }], inputEl: [{ type: i0.ViewChild, args: ['inputEl', { isSignal: true }] }] } });
108
-
109
- /*
110
- * Public API Surface of ui-kit/ui-checkbox
111
- */
112
-
113
- /**
114
- * Generated bundle index. Do not edit.
115
- */
116
-
1
+ import * as i0 from "@angular/core";
2
+ import { Component, booleanAttribute, computed, effect, forwardRef, input, output, viewChild } from "@angular/core";
3
+ import { NG_VALUE_ACCESSOR } from "@angular/forms";
4
+ import { BaseFieldControl } from "@4sh/ui-kit/forms";
5
+ import { UiIcon } from "@4sh/ui-kit/base/ui-icon";
6
+ var UiCheckbox = class UiCheckbox extends BaseFieldControl {
7
+ constructor() {
8
+ super();
9
+ this.label = input(...ngDevMode ? [void 0, { debugName: "label" }] : /* istanbul ignore next */ []);
10
+ this.trueValue = input(true, ...ngDevMode ? [{ debugName: "trueValue" }] : /* istanbul ignore next */ []);
11
+ this.falseValue = input(false, ...ngDevMode ? [{ debugName: "falseValue" }] : /* istanbul ignore next */ []);
12
+ this.indeterminate = input(false, {
13
+ ...ngDevMode ? { debugName: "indeterminate" } : /* istanbul ignore next */ {},
14
+ transform: booleanAttribute
15
+ });
16
+ this.checkIcon = input("check", ...ngDevMode ? [{ debugName: "checkIcon" }] : /* istanbul ignore next */ []);
17
+ this.indeterminateIcon = input("minus", ...ngDevMode ? [{ debugName: "indeterminateIcon" }] : /* istanbul ignore next */ []);
18
+ this.checkboxChange = output();
19
+ this.checkboxFocus = output();
20
+ this.checkboxBlur = output();
21
+ this.inputEl = viewChild.required("inputEl", ...ngDevMode ? [{ debugName: "inputEl" }] : /* istanbul ignore next */ []);
22
+ this.checked = computed(() => this.modelValue() === this.trueValue(), ...ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []);
23
+ this.classes = computed(() => {
24
+ const c = ["ui-checkbox"];
25
+ if (this.checked()) c.push("_checked");
26
+ if (this.indeterminate()) c.push("_indeterminate");
27
+ if (this.isDisabled()) c.push("_disabled");
28
+ if (this.readonly()) c.push("_readonly");
29
+ if (this.isInvalid()) c.push("_invalid");
30
+ return c.join(" ");
31
+ }, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
32
+ effect(() => {
33
+ this.inputEl().nativeElement.indeterminate = this.indeterminate();
34
+ });
35
+ }
36
+ uidPrefix() {
37
+ return "ui-checkbox";
38
+ }
39
+ focus(options) {
40
+ this.inputEl().nativeElement.focus(options);
41
+ }
42
+ onNativeChange() {
43
+ const inputEl = this.inputEl().nativeElement;
44
+ if (this.readonly()) {
45
+ inputEl.checked = this.checked();
46
+ return;
47
+ }
48
+ const value = inputEl.checked ? this.trueValue() : this.falseValue();
49
+ this.modelValue.set(value);
50
+ this.emitChange(value);
51
+ this.checkboxChange.emit(value);
52
+ }
53
+ onBlur(event) {
54
+ this.emitTouch();
55
+ this.checkboxBlur.emit(event);
56
+ }
57
+ static {
58
+ this.ɵfac = i0.ɵɵngDeclareFactory({
59
+ minVersion: "12.0.0",
60
+ version: "22.3.0",
61
+ ngImport: i0,
62
+ type: UiCheckbox,
63
+ deps: [],
64
+ target: i0.ɵɵFactoryTarget.Component
65
+ });
66
+ }
67
+ static {
68
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
69
+ minVersion: "17.0.0",
70
+ version: "22.3.0",
71
+ type: UiCheckbox,
72
+ isStandalone: true,
73
+ selector: "ui-checkbox",
74
+ inputs: {
75
+ label: {
76
+ classPropertyName: "label",
77
+ publicName: "label",
78
+ isSignal: true,
79
+ isRequired: false,
80
+ transformFunction: null
81
+ },
82
+ trueValue: {
83
+ classPropertyName: "trueValue",
84
+ publicName: "trueValue",
85
+ isSignal: true,
86
+ isRequired: false,
87
+ transformFunction: null
88
+ },
89
+ falseValue: {
90
+ classPropertyName: "falseValue",
91
+ publicName: "falseValue",
92
+ isSignal: true,
93
+ isRequired: false,
94
+ transformFunction: null
95
+ },
96
+ indeterminate: {
97
+ classPropertyName: "indeterminate",
98
+ publicName: "indeterminate",
99
+ isSignal: true,
100
+ isRequired: false,
101
+ transformFunction: null
102
+ },
103
+ checkIcon: {
104
+ classPropertyName: "checkIcon",
105
+ publicName: "checkIcon",
106
+ isSignal: true,
107
+ isRequired: false,
108
+ transformFunction: null
109
+ },
110
+ indeterminateIcon: {
111
+ classPropertyName: "indeterminateIcon",
112
+ publicName: "indeterminateIcon",
113
+ isSignal: true,
114
+ isRequired: false,
115
+ transformFunction: null
116
+ }
117
+ },
118
+ outputs: {
119
+ checkboxChange: "checkboxChange",
120
+ checkboxFocus: "checkboxFocus",
121
+ checkboxBlur: "checkboxBlur"
122
+ },
123
+ providers: [{
124
+ provide: NG_VALUE_ACCESSOR,
125
+ useExisting: forwardRef(() => UiCheckbox),
126
+ multi: true
127
+ }],
128
+ viewQueries: [{
129
+ propertyName: "inputEl",
130
+ first: true,
131
+ predicate: ["inputEl"],
132
+ descendants: true,
133
+ isSignal: true
134
+ }],
135
+ usesInheritance: true,
136
+ ngImport: i0,
137
+ template: "<label [class]=\"classes()\">\n <span class=\"ui-checkbox-control\">\n <input\n #inputEl\n type=\"checkbox\"\n class=\"ui-checkbox-input\"\n [id]=\"resolvedId()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (change)=\"onNativeChange()\"\n (focus)=\"checkboxFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n <span class=\"ui-checkbox-box\" aria-hidden=\"true\">\n <ui-icon\n class=\"ui-checkbox-icon\"\n [name]=\"indeterminate() ? indeterminateIcon() : checkIcon()\"\n size=\"md\"\n />\n </span>\n </span>\n\n @if (label()) {\n <span class=\"ui-checkbox-label\">\n <span class=\"ui-checkbox-text\">{{ label() }}</span>\n @if (required()) {\n <span class=\"ui-checkbox-required\" aria-hidden=\"true\">*</span>\n }\n </span>\n }\n</label>\n",
138
+ styles: [".ui-checkbox{display:inline-flex;align-items:center;gap:var(--ui-checkbox-gap, var(--ui-form-control-gap, var(--units-sm)));cursor:pointer;--_surface: var(--ui-form-control-surface, var(--form-high-surface-default));--_stroke: var(--ui-form-control-stroke, var(--form-high-stroke-default));--_content: var(--ui-form-control-marker-color, var(--form-high-content-checked))}.ui-checkbox:hover:not(._disabled):not(._readonly){--_surface: var(--ui-form-control-surface-hover, var(--form-high-surface-hover));--_stroke: var(--ui-form-control-stroke-hover, var(--form-high-stroke-hover));--ui-label-color: var(--form-high-content-hover)}.ui-checkbox._checked:not(._disabled),.ui-checkbox._indeterminate:not(._disabled){--_surface: var(--ui-form-control-surface-checked, var(--form-high-surface-checked));--_stroke: var(--ui-form-control-stroke-checked, var(--form-high-stroke-checked))}.ui-checkbox:has(.ui-checkbox-input:focus-visible){--_stroke: var(--ui-form-control-stroke-focus, var(--form-high-stroke-focused));--_focus-ring: rgb(from var(--ui-form-control-stroke-focus, var(--form-high-stroke-focused)) r g b / 50%)}.ui-checkbox._disabled{--_surface: var(--ui-form-control-surface-disabled, var(--form-high-surface-disabled));--_stroke: var(--ui-form-control-stroke-disabled, var(--form-high-stroke-disabled));--_content: var(--ui-form-control-marker-color-disabled, var(--form-high-content-disabled))}.ui-checkbox._invalid{--_surface: var(--ui-form-control-surface, var(--form-error-surface-default));--_stroke: var(--ui-form-control-stroke, var(--form-error-stroke-default));--_content: var(--ui-form-control-marker-color, var(--form-error-content-checked))}.ui-checkbox._invalid:hover:not(._disabled):not(._readonly){--_surface: var(--ui-form-control-surface-hover, var(--form-error-surface-hover));--_stroke: var(--ui-form-control-stroke-hover, var(--form-error-stroke-hover));--ui-label-color: var(--form-error-content-hover)}.ui-checkbox._invalid._checked:not(._disabled),.ui-checkbox._invalid._indeterminate:not(._disabled){--_surface: var(--ui-form-control-surface-checked, var(--form-error-surface-checked));--_stroke: var(--ui-form-control-stroke-checked, var(--form-error-stroke-checked))}.ui-checkbox._invalid:has(.ui-checkbox-input:focus-visible){--_stroke: var(--ui-form-control-stroke-focus, var(--form-error-stroke-focused));--_focus-ring: rgb(from var(--ui-form-control-stroke-focus, var(--form-error-stroke-focused)) r g b / 50%)}.ui-checkbox._invalid._disabled{--_surface: var(--ui-form-control-surface-disabled, var(--form-error-surface-disabled));--_stroke: var(--ui-form-control-stroke-disabled, var(--form-error-stroke-disabled));--_content: var(--ui-form-control-marker-color-disabled, var(--form-error-content-disabled))}.ui-checkbox-control{position:relative;display:inline-flex;width:var(--ui-checkbox-box-size, var(--ui-form-control-size, var(--size-components-2xs)));height:var(--ui-checkbox-box-size, var(--ui-form-control-size, var(--size-components-2xs)));flex-shrink:0}.ui-checkbox-input{position:absolute;inset:0;z-index:1;width:100%;height:100%;margin:0;opacity:0;cursor:inherit}.ui-checkbox-box{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:100%;height:100%;background-color:var(--_surface);border:var(--ui-checkbox-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--_stroke);border-radius:var(--ui-checkbox-box-radius, var(--radius-xs));transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),border-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),box-shadow var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-checkbox:has(.ui-checkbox-input:focus-visible) .ui-checkbox-box{box-shadow:0 0 0 var(--ui-checkbox-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--_focus-ring)}.ui-checkbox-icon{--ui-icon-size: var(--ui-checkbox-icon-size, var(--ui-icon-size-md, var(--size-typography-icon-md)));color:var(--_content);opacity:0;transform:scale(.6);transition:opacity var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),transform var(--ui-control-transition-duration, var(--motion-toggle-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-toggle-easing, var(--transition-easeinout)))}.ui-checkbox._checked .ui-checkbox-icon,.ui-checkbox._indeterminate .ui-checkbox-icon{opacity:1;transform:scale(1)}.ui-checkbox-label{display:inline-flex;align-items:center;gap:var(--ui-checkbox-label-gap, var(--units-2xs));font-family:var(--ui-checkbox-font-family, var(--fontfamily-base));font-size:var(--ui-checkbox-font-size, var(--size-typography-text-default));color:var(--ui-label-color, var(--form-high-content-default));cursor:inherit;-webkit-user-select:none;user-select:none;transition:color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-checkbox-required{color:var(--ui-checkbox-required-color, var(--informative-errorlow-content-default))}.ui-checkbox._disabled{cursor:not-allowed}.ui-checkbox._disabled .ui-checkbox-label{color:var(--ui-label-color-disabled, var(--form-high-content-disabled))}.ui-checkbox._readonly{cursor:default}\n"],
139
+ dependencies: [{
140
+ kind: "component",
141
+ type: UiIcon,
142
+ selector: "ui-icon",
143
+ inputs: [
144
+ "name",
145
+ "size",
146
+ "type",
147
+ "family",
148
+ "decorative",
149
+ "ariaLabel"
150
+ ]
151
+ }]
152
+ });
153
+ }
154
+ };
155
+ i0.ɵɵngDeclareClassMetadata({
156
+ minVersion: "12.0.0",
157
+ version: "22.3.0",
158
+ ngImport: i0,
159
+ type: UiCheckbox,
160
+ decorators: [{
161
+ type: Component,
162
+ args: [{
163
+ selector: "ui-checkbox",
164
+ imports: [UiIcon],
165
+ providers: [{
166
+ provide: NG_VALUE_ACCESSOR,
167
+ useExisting: forwardRef(() => UiCheckbox),
168
+ multi: true
169
+ }],
170
+ template: "<label [class]=\"classes()\">\n <span class=\"ui-checkbox-control\">\n <input\n #inputEl\n type=\"checkbox\"\n class=\"ui-checkbox-input\"\n [id]=\"resolvedId()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (change)=\"onNativeChange()\"\n (focus)=\"checkboxFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n <span class=\"ui-checkbox-box\" aria-hidden=\"true\">\n <ui-icon\n class=\"ui-checkbox-icon\"\n [name]=\"indeterminate() ? indeterminateIcon() : checkIcon()\"\n size=\"md\"\n />\n </span>\n </span>\n\n @if (label()) {\n <span class=\"ui-checkbox-label\">\n <span class=\"ui-checkbox-text\">{{ label() }}</span>\n @if (required()) {\n <span class=\"ui-checkbox-required\" aria-hidden=\"true\">*</span>\n }\n </span>\n }\n</label>\n",
171
+ styles: [".ui-checkbox{display:inline-flex;align-items:center;gap:var(--ui-checkbox-gap, var(--ui-form-control-gap, var(--units-sm)));cursor:pointer;--_surface: var(--ui-form-control-surface, var(--form-high-surface-default));--_stroke: var(--ui-form-control-stroke, var(--form-high-stroke-default));--_content: var(--ui-form-control-marker-color, var(--form-high-content-checked))}.ui-checkbox:hover:not(._disabled):not(._readonly){--_surface: var(--ui-form-control-surface-hover, var(--form-high-surface-hover));--_stroke: var(--ui-form-control-stroke-hover, var(--form-high-stroke-hover));--ui-label-color: var(--form-high-content-hover)}.ui-checkbox._checked:not(._disabled),.ui-checkbox._indeterminate:not(._disabled){--_surface: var(--ui-form-control-surface-checked, var(--form-high-surface-checked));--_stroke: var(--ui-form-control-stroke-checked, var(--form-high-stroke-checked))}.ui-checkbox:has(.ui-checkbox-input:focus-visible){--_stroke: var(--ui-form-control-stroke-focus, var(--form-high-stroke-focused));--_focus-ring: rgb(from var(--ui-form-control-stroke-focus, var(--form-high-stroke-focused)) r g b / 50%)}.ui-checkbox._disabled{--_surface: var(--ui-form-control-surface-disabled, var(--form-high-surface-disabled));--_stroke: var(--ui-form-control-stroke-disabled, var(--form-high-stroke-disabled));--_content: var(--ui-form-control-marker-color-disabled, var(--form-high-content-disabled))}.ui-checkbox._invalid{--_surface: var(--ui-form-control-surface, var(--form-error-surface-default));--_stroke: var(--ui-form-control-stroke, var(--form-error-stroke-default));--_content: var(--ui-form-control-marker-color, var(--form-error-content-checked))}.ui-checkbox._invalid:hover:not(._disabled):not(._readonly){--_surface: var(--ui-form-control-surface-hover, var(--form-error-surface-hover));--_stroke: var(--ui-form-control-stroke-hover, var(--form-error-stroke-hover));--ui-label-color: var(--form-error-content-hover)}.ui-checkbox._invalid._checked:not(._disabled),.ui-checkbox._invalid._indeterminate:not(._disabled){--_surface: var(--ui-form-control-surface-checked, var(--form-error-surface-checked));--_stroke: var(--ui-form-control-stroke-checked, var(--form-error-stroke-checked))}.ui-checkbox._invalid:has(.ui-checkbox-input:focus-visible){--_stroke: var(--ui-form-control-stroke-focus, var(--form-error-stroke-focused));--_focus-ring: rgb(from var(--ui-form-control-stroke-focus, var(--form-error-stroke-focused)) r g b / 50%)}.ui-checkbox._invalid._disabled{--_surface: var(--ui-form-control-surface-disabled, var(--form-error-surface-disabled));--_stroke: var(--ui-form-control-stroke-disabled, var(--form-error-stroke-disabled));--_content: var(--ui-form-control-marker-color-disabled, var(--form-error-content-disabled))}.ui-checkbox-control{position:relative;display:inline-flex;width:var(--ui-checkbox-box-size, var(--ui-form-control-size, var(--size-components-2xs)));height:var(--ui-checkbox-box-size, var(--ui-form-control-size, var(--size-components-2xs)));flex-shrink:0}.ui-checkbox-input{position:absolute;inset:0;z-index:1;width:100%;height:100%;margin:0;opacity:0;cursor:inherit}.ui-checkbox-box{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:100%;height:100%;background-color:var(--_surface);border:var(--ui-checkbox-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--_stroke);border-radius:var(--ui-checkbox-box-radius, var(--radius-xs));transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),border-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),box-shadow var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-checkbox:has(.ui-checkbox-input:focus-visible) .ui-checkbox-box{box-shadow:0 0 0 var(--ui-checkbox-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--_focus-ring)}.ui-checkbox-icon{--ui-icon-size: var(--ui-checkbox-icon-size, var(--ui-icon-size-md, var(--size-typography-icon-md)));color:var(--_content);opacity:0;transform:scale(.6);transition:opacity var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),transform var(--ui-control-transition-duration, var(--motion-toggle-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-toggle-easing, var(--transition-easeinout)))}.ui-checkbox._checked .ui-checkbox-icon,.ui-checkbox._indeterminate .ui-checkbox-icon{opacity:1;transform:scale(1)}.ui-checkbox-label{display:inline-flex;align-items:center;gap:var(--ui-checkbox-label-gap, var(--units-2xs));font-family:var(--ui-checkbox-font-family, var(--fontfamily-base));font-size:var(--ui-checkbox-font-size, var(--size-typography-text-default));color:var(--ui-label-color, var(--form-high-content-default));cursor:inherit;-webkit-user-select:none;user-select:none;transition:color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-checkbox-required{color:var(--ui-checkbox-required-color, var(--informative-errorlow-content-default))}.ui-checkbox._disabled{cursor:not-allowed}.ui-checkbox._disabled .ui-checkbox-label{color:var(--ui-label-color-disabled, var(--form-high-content-disabled))}.ui-checkbox._readonly{cursor:default}\n"]
172
+ }]
173
+ }],
174
+ ctorParameters: () => [],
175
+ propDecorators: {
176
+ label: [{
177
+ type: i0.Input,
178
+ args: [{
179
+ isSignal: true,
180
+ alias: "label",
181
+ required: false
182
+ }]
183
+ }],
184
+ trueValue: [{
185
+ type: i0.Input,
186
+ args: [{
187
+ isSignal: true,
188
+ alias: "trueValue",
189
+ required: false
190
+ }]
191
+ }],
192
+ falseValue: [{
193
+ type: i0.Input,
194
+ args: [{
195
+ isSignal: true,
196
+ alias: "falseValue",
197
+ required: false
198
+ }]
199
+ }],
200
+ indeterminate: [{
201
+ type: i0.Input,
202
+ args: [{
203
+ isSignal: true,
204
+ alias: "indeterminate",
205
+ required: false
206
+ }]
207
+ }],
208
+ checkIcon: [{
209
+ type: i0.Input,
210
+ args: [{
211
+ isSignal: true,
212
+ alias: "checkIcon",
213
+ required: false
214
+ }]
215
+ }],
216
+ indeterminateIcon: [{
217
+ type: i0.Input,
218
+ args: [{
219
+ isSignal: true,
220
+ alias: "indeterminateIcon",
221
+ required: false
222
+ }]
223
+ }],
224
+ checkboxChange: [{
225
+ type: i0.Output,
226
+ args: ["checkboxChange"]
227
+ }],
228
+ checkboxFocus: [{
229
+ type: i0.Output,
230
+ args: ["checkboxFocus"]
231
+ }],
232
+ checkboxBlur: [{
233
+ type: i0.Output,
234
+ args: ["checkboxBlur"]
235
+ }],
236
+ inputEl: [{
237
+ type: i0.ViewChild,
238
+ args: ["inputEl", { isSignal: true }]
239
+ }]
240
+ }
241
+ });
117
242
  export { UiCheckbox };
118
- //# sourceMappingURL=4sh-ui-kit-forms-ui-checkbox.mjs.map
243
+
244
+ //# sourceMappingURL=4sh-ui-kit-forms-ui-checkbox.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"4sh-ui-kit-forms-ui-checkbox.mjs","sources":["../../../projects/ui-kit/forms/ui-checkbox/src/lib/ui-checkbox.ts","../../../projects/ui-kit/forms/ui-checkbox/src/lib/ui-checkbox.html","../../../projects/ui-kit/forms/ui-checkbox/src/public-api.ts","../../../projects/ui-kit/forms/ui-checkbox/src/4sh-ui-kit-forms-ui-checkbox.ts"],"sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n effect,\n ElementRef,\n forwardRef,\n input,\n output,\n viewChild,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BaseFieldControl } from '@4sh/ui-kit/forms';\nimport { UiIcon } from '@4sh/ui-kit/base/ui-icon';\n\n/**\n * ui-checkbox — headless checkbox built on a real native <input type=\"checkbox\">.\n *\n * The native input stays in the DOM (visually covering the styled box) so\n * keyboard, screen readers, label click and form semantics come for free.\n * Interactive states (hover/focus/disabled/checked) are pure CSS driven by\n * `form.*` design tokens.\n *\n * Works standalone, with [(ngModel)] or with reactive forms (ControlValueAccessor).\n * By default the model value is boolean; `trueValue`/`falseValue` let the model\n * carry any pair of values (e.g. 'yes'/'no', 1/0).\n */\n@Component({\n selector: 'ui-checkbox',\n imports: [UiIcon],\n templateUrl: './ui-checkbox.html',\n styleUrl: './ui-checkbox.scss',\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiCheckbox), multi: true },\n ],\n})\nexport class UiCheckbox<T = boolean> extends BaseFieldControl<T> {\n /** Label displayed next to the box (clicking it toggles the checkbox). */\n label = input<string>();\n /** Model value emitted when checked. */\n trueValue = input<T>(true as T);\n /** Model value emitted when unchecked. */\n falseValue = input<T>(false as T);\n /** Visual indeterminate state (\"some but not all selected\"). Purely visual: the model keeps its value. */\n indeterminate = input(false, { transform: booleanAttribute });\n /** Icon shown when checked. */\n checkIcon = input<string>('check');\n /** Icon shown when indeterminate. */\n indeterminateIcon = input<string>('minus');\n\n /** Emitted on user toggle with the new model value (never when disabled/readonly). */\n checkboxChange = output<T>();\n /** Emitted when the native input receives focus. */\n checkboxFocus = output<FocusEvent>();\n /** Emitted when the native input loses focus. */\n checkboxBlur = output<FocusEvent>();\n\n /** @ignore */\n private readonly inputEl = viewChild.required<ElementRef<HTMLInputElement>>('inputEl');\n\n constructor() {\n super();\n // The `indeterminate` state only exists as a DOM property.\n effect(() => {\n this.inputEl().nativeElement.indeterminate = this.indeterminate();\n });\n }\n\n /** @ignore */\n protected readonly checked = computed(() => this.modelValue() === this.trueValue());\n\n /** @ignore */\n protected readonly classes = computed(() => {\n const c = ['ui-checkbox'];\n if (this.checked()) c.push('_checked');\n if (this.indeterminate()) c.push('_indeterminate');\n if (this.isDisabled()) c.push('_disabled');\n if (this.readonly()) c.push('_readonly');\n if (this.isInvalid()) c.push('_invalid');\n return c.join(' ');\n });\n\n /** @ignore */\n protected override uidPrefix(): string {\n return 'ui-checkbox';\n }\n\n /** Focus the native input programmatically. */\n focus(options?: FocusOptions): void {\n this.inputEl().nativeElement.focus(options);\n }\n\n /** @ignore Native change: single source of truth for user toggles. */\n protected onNativeChange(): void {\n const inputEl = this.inputEl().nativeElement;\n if (this.readonly()) {\n inputEl.checked = this.checked(); // revert the native toggle\n return;\n }\n const value = inputEl.checked ? this.trueValue() : this.falseValue();\n this.modelValue.set(value);\n this.emitChange(value);\n this.checkboxChange.emit(value);\n }\n\n /** @ignore */\n protected onBlur(event: FocusEvent): void {\n this.emitTouch();\n this.checkboxBlur.emit(event);\n }\n}\n","<label [class]=\"classes()\">\n <span class=\"ui-checkbox-control\">\n <input\n #inputEl\n type=\"checkbox\"\n class=\"ui-checkbox-input\"\n [id]=\"resolvedId()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (change)=\"onNativeChange()\"\n (focus)=\"checkboxFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n <span class=\"ui-checkbox-box\" aria-hidden=\"true\">\n <ui-icon\n class=\"ui-checkbox-icon\"\n [name]=\"indeterminate() ? indeterminateIcon() : checkIcon()\"\n size=\"md\"\n />\n </span>\n </span>\n\n @if (label()) {\n <span class=\"ui-checkbox-label\">\n <span class=\"ui-checkbox-text\">{{ label() }}</span>\n @if (required()) {\n <span class=\"ui-checkbox-required\" aria-hidden=\"true\">*</span>\n }\n </span>\n }\n</label>\n","/*\n * Public API Surface of ui-kit/ui-checkbox\n */\n\nexport * from './lib/ui-checkbox';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from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EAAA,SAAA,EAJV;AACT,YAAA,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,MAAM,UAAU,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;SACvF,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,SAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,SAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EClCH,opCAqCA,kvLDRY,MAAM,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,QAAA,EAAA,YAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAOL,UAAU,EAAA,UAAA,EAAA,CAAA;kBATtB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,EAAA,OAAA,EACd,CAAC,MAAM,CAAC,EAAA,SAAA,EAGN;AACT,wBAAA,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;AACvF,qBAAA,EAAA,QAAA,EAAA,opCAAA,EAAA,MAAA,EAAA,CAAA,0rLAAA,CAAA,EAAA;03BAwB2E,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE1DvF;;AAEG;;ACFH;;AAEG;;"}
1
+ {"version":3,"file":"4sh-ui-kit-forms-ui-checkbox.mjs","names":[],"sources":["../../../projects/ui-kit/forms/ui-checkbox/src/lib/ui-checkbox.ts","../../../projects/ui-kit/forms/ui-checkbox/src/lib/ui-checkbox.html"],"sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n effect,\n ElementRef,\n forwardRef,\n input,\n output,\n viewChild,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BaseFieldControl } from '@4sh/ui-kit/forms';\nimport { UiIcon } from '@4sh/ui-kit/base/ui-icon';\n\n/**\n * ui-checkbox — headless checkbox built on a real native <input type=\"checkbox\">.\n *\n * The native input stays in the DOM (visually covering the styled box) so\n * keyboard, screen readers, label click and form semantics come for free.\n * Interactive states (hover/focus/disabled/checked) are pure CSS driven by\n * `form.*` design tokens.\n *\n * Works standalone, with [(ngModel)] or with reactive forms (ControlValueAccessor).\n * By default the model value is boolean; `trueValue`/`falseValue` let the model\n * carry any pair of values (e.g. 'yes'/'no', 1/0).\n */\n@Component({\n selector: 'ui-checkbox',\n imports: [UiIcon],\n templateUrl: './ui-checkbox.html',\n styleUrl: './ui-checkbox.scss',\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiCheckbox), multi: true },\n ],\n})\nexport class UiCheckbox<T = boolean> extends BaseFieldControl<T> {\n /** Label displayed next to the box (clicking it toggles the checkbox). */\n label = input<string>();\n /** Model value emitted when checked. */\n trueValue = input<T>(true as T);\n /** Model value emitted when unchecked. */\n falseValue = input<T>(false as T);\n /** Visual indeterminate state (\"some but not all selected\"). Purely visual: the model keeps its value. */\n indeterminate = input(false, { transform: booleanAttribute });\n /** Icon shown when checked. */\n checkIcon = input<string>('check');\n /** Icon shown when indeterminate. */\n indeterminateIcon = input<string>('minus');\n\n /** Emitted on user toggle with the new model value (never when disabled/readonly). */\n checkboxChange = output<T>();\n /** Emitted when the native input receives focus. */\n checkboxFocus = output<FocusEvent>();\n /** Emitted when the native input loses focus. */\n checkboxBlur = output<FocusEvent>();\n\n /** @ignore */\n private readonly inputEl = viewChild.required<ElementRef<HTMLInputElement>>('inputEl');\n\n constructor() {\n super();\n // The `indeterminate` state only exists as a DOM property.\n effect(() => {\n this.inputEl().nativeElement.indeterminate = this.indeterminate();\n });\n }\n\n /** @ignore */\n protected readonly checked = computed(() => this.modelValue() === this.trueValue());\n\n /** @ignore */\n protected readonly classes = computed(() => {\n const c = ['ui-checkbox'];\n if (this.checked()) c.push('_checked');\n if (this.indeterminate()) c.push('_indeterminate');\n if (this.isDisabled()) c.push('_disabled');\n if (this.readonly()) c.push('_readonly');\n if (this.isInvalid()) c.push('_invalid');\n return c.join(' ');\n });\n\n /** @ignore */\n protected override uidPrefix(): string {\n return 'ui-checkbox';\n }\n\n /** Focus the native input programmatically. */\n focus(options?: FocusOptions): void {\n this.inputEl().nativeElement.focus(options);\n }\n\n /** @ignore Native change: single source of truth for user toggles. */\n protected onNativeChange(): void {\n const inputEl = this.inputEl().nativeElement;\n if (this.readonly()) {\n inputEl.checked = this.checked(); // revert the native toggle\n return;\n }\n const value = inputEl.checked ? this.trueValue() : this.falseValue();\n this.modelValue.set(value);\n this.emitChange(value);\n this.checkboxChange.emit(value);\n }\n\n /** @ignore */\n protected onBlur(event: FocusEvent): void {\n this.emitTouch();\n this.checkboxBlur.emit(event);\n }\n}\n","<label [class]=\"classes()\">\n <span class=\"ui-checkbox-control\">\n <input\n #inputEl\n type=\"checkbox\"\n class=\"ui-checkbox-input\"\n [id]=\"resolvedId()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (change)=\"onNativeChange()\"\n (focus)=\"checkboxFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n <span class=\"ui-checkbox-box\" aria-hidden=\"true\">\n <ui-icon\n class=\"ui-checkbox-icon\"\n [name]=\"indeterminate() ? indeterminateIcon() : checkIcon()\"\n size=\"md\"\n />\n </span>\n </span>\n\n @if (label()) {\n <span class=\"ui-checkbox-label\">\n <span class=\"ui-checkbox-text\">{{ label() }}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