@4sh/ui-kit 0.1.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 (202) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +7 -0
  3. package/README.md +229 -0
  4. package/fesm2022/4sh-ui-kit-forms.mjs +501 -0
  5. package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -0
  6. package/fesm2022/4sh-ui-kit-motion.mjs +155 -0
  7. package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -0
  8. package/fesm2022/4sh-ui-kit-overlay.mjs +61 -0
  9. package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -0
  10. package/fesm2022/4sh-ui-kit-theming.mjs +120 -0
  11. package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -0
  12. package/fesm2022/4sh-ui-kit-types.mjs +12 -0
  13. package/fesm2022/4sh-ui-kit-types.mjs.map +1 -0
  14. package/fesm2022/4sh-ui-kit-ui-accordion.mjs +244 -0
  15. package/fesm2022/4sh-ui-kit-ui-accordion.mjs.map +1 -0
  16. package/fesm2022/4sh-ui-kit-ui-alert.mjs +160 -0
  17. package/fesm2022/4sh-ui-kit-ui-alert.mjs.map +1 -0
  18. package/fesm2022/4sh-ui-kit-ui-autocomplete.mjs +926 -0
  19. package/fesm2022/4sh-ui-kit-ui-autocomplete.mjs.map +1 -0
  20. package/fesm2022/4sh-ui-kit-ui-avatar-group.mjs +34 -0
  21. package/fesm2022/4sh-ui-kit-ui-avatar-group.mjs.map +1 -0
  22. package/fesm2022/4sh-ui-kit-ui-avatar.mjs +122 -0
  23. package/fesm2022/4sh-ui-kit-ui-avatar.mjs.map +1 -0
  24. package/fesm2022/4sh-ui-kit-ui-badge.mjs +95 -0
  25. package/fesm2022/4sh-ui-kit-ui-badge.mjs.map +1 -0
  26. package/fesm2022/4sh-ui-kit-ui-breadcrumb.mjs +190 -0
  27. package/fesm2022/4sh-ui-kit-ui-breadcrumb.mjs.map +1 -0
  28. package/fesm2022/4sh-ui-kit-ui-button-split.mjs +151 -0
  29. package/fesm2022/4sh-ui-kit-ui-button-split.mjs.map +1 -0
  30. package/fesm2022/4sh-ui-kit-ui-button.mjs +222 -0
  31. package/fesm2022/4sh-ui-kit-ui-button.mjs.map +1 -0
  32. package/fesm2022/4sh-ui-kit-ui-card.mjs +164 -0
  33. package/fesm2022/4sh-ui-kit-ui-card.mjs.map +1 -0
  34. package/fesm2022/4sh-ui-kit-ui-checkbox.mjs +118 -0
  35. package/fesm2022/4sh-ui-kit-ui-checkbox.mjs.map +1 -0
  36. package/fesm2022/4sh-ui-kit-ui-chip.mjs +205 -0
  37. package/fesm2022/4sh-ui-kit-ui-chip.mjs.map +1 -0
  38. package/fesm2022/4sh-ui-kit-ui-context-menu.mjs +219 -0
  39. package/fesm2022/4sh-ui-kit-ui-context-menu.mjs.map +1 -0
  40. package/fesm2022/4sh-ui-kit-ui-datepicker.mjs +1508 -0
  41. package/fesm2022/4sh-ui-kit-ui-datepicker.mjs.map +1 -0
  42. package/fesm2022/4sh-ui-kit-ui-drawer.mjs +300 -0
  43. package/fesm2022/4sh-ui-kit-ui-drawer.mjs.map +1 -0
  44. package/fesm2022/4sh-ui-kit-ui-empty-state.mjs +148 -0
  45. package/fesm2022/4sh-ui-kit-ui-empty-state.mjs.map +1 -0
  46. package/fesm2022/4sh-ui-kit-ui-field.mjs +102 -0
  47. package/fesm2022/4sh-ui-kit-ui-field.mjs.map +1 -0
  48. package/fesm2022/4sh-ui-kit-ui-file-upload.mjs +568 -0
  49. package/fesm2022/4sh-ui-kit-ui-file-upload.mjs.map +1 -0
  50. package/fesm2022/4sh-ui-kit-ui-helper.mjs +85 -0
  51. package/fesm2022/4sh-ui-kit-ui-helper.mjs.map +1 -0
  52. package/fesm2022/4sh-ui-kit-ui-icon.mjs +98 -0
  53. package/fesm2022/4sh-ui-kit-ui-icon.mjs.map +1 -0
  54. package/fesm2022/4sh-ui-kit-ui-image.mjs +201 -0
  55. package/fesm2022/4sh-ui-kit-ui-image.mjs.map +1 -0
  56. package/fesm2022/4sh-ui-kit-ui-input-group.mjs +119 -0
  57. package/fesm2022/4sh-ui-kit-ui-input-group.mjs.map +1 -0
  58. package/fesm2022/4sh-ui-kit-ui-input-mask.mjs +125 -0
  59. package/fesm2022/4sh-ui-kit-ui-input-mask.mjs.map +1 -0
  60. package/fesm2022/4sh-ui-kit-ui-input-number.mjs +234 -0
  61. package/fesm2022/4sh-ui-kit-ui-input-number.mjs.map +1 -0
  62. package/fesm2022/4sh-ui-kit-ui-input-otp.mjs +288 -0
  63. package/fesm2022/4sh-ui-kit-ui-input-otp.mjs.map +1 -0
  64. package/fesm2022/4sh-ui-kit-ui-input-tags.mjs +679 -0
  65. package/fesm2022/4sh-ui-kit-ui-input-tags.mjs.map +1 -0
  66. package/fesm2022/4sh-ui-kit-ui-input.mjs +121 -0
  67. package/fesm2022/4sh-ui-kit-ui-input.mjs.map +1 -0
  68. package/fesm2022/4sh-ui-kit-ui-label.mjs +61 -0
  69. package/fesm2022/4sh-ui-kit-ui-label.mjs.map +1 -0
  70. package/fesm2022/4sh-ui-kit-ui-link.mjs +147 -0
  71. package/fesm2022/4sh-ui-kit-ui-link.mjs.map +1 -0
  72. package/fesm2022/4sh-ui-kit-ui-menu.mjs +484 -0
  73. package/fesm2022/4sh-ui-kit-ui-menu.mjs.map +1 -0
  74. package/fesm2022/4sh-ui-kit-ui-modal.mjs +555 -0
  75. package/fesm2022/4sh-ui-kit-ui-modal.mjs.map +1 -0
  76. package/fesm2022/4sh-ui-kit-ui-nudger.mjs +168 -0
  77. package/fesm2022/4sh-ui-kit-ui-nudger.mjs.map +1 -0
  78. package/fesm2022/4sh-ui-kit-ui-paginator.mjs +245 -0
  79. package/fesm2022/4sh-ui-kit-ui-paginator.mjs.map +1 -0
  80. package/fesm2022/4sh-ui-kit-ui-popover.mjs +296 -0
  81. package/fesm2022/4sh-ui-kit-ui-popover.mjs.map +1 -0
  82. package/fesm2022/4sh-ui-kit-ui-progress-bar.mjs +124 -0
  83. package/fesm2022/4sh-ui-kit-ui-progress-bar.mjs.map +1 -0
  84. package/fesm2022/4sh-ui-kit-ui-radio.mjs +92 -0
  85. package/fesm2022/4sh-ui-kit-ui-radio.mjs.map +1 -0
  86. package/fesm2022/4sh-ui-kit-ui-rating.mjs +185 -0
  87. package/fesm2022/4sh-ui-kit-ui-rating.mjs.map +1 -0
  88. package/fesm2022/4sh-ui-kit-ui-read-only.mjs +146 -0
  89. package/fesm2022/4sh-ui-kit-ui-read-only.mjs.map +1 -0
  90. package/fesm2022/4sh-ui-kit-ui-segment-control.mjs +386 -0
  91. package/fesm2022/4sh-ui-kit-ui-segment-control.mjs.map +1 -0
  92. package/fesm2022/4sh-ui-kit-ui-select.mjs +868 -0
  93. package/fesm2022/4sh-ui-kit-ui-select.mjs.map +1 -0
  94. package/fesm2022/4sh-ui-kit-ui-separator.mjs +77 -0
  95. package/fesm2022/4sh-ui-kit-ui-separator.mjs.map +1 -0
  96. package/fesm2022/4sh-ui-kit-ui-sidebar.mjs +577 -0
  97. package/fesm2022/4sh-ui-kit-ui-sidebar.mjs.map +1 -0
  98. package/fesm2022/4sh-ui-kit-ui-skeleton.mjs +81 -0
  99. package/fesm2022/4sh-ui-kit-ui-skeleton.mjs.map +1 -0
  100. package/fesm2022/4sh-ui-kit-ui-slider.mjs +340 -0
  101. package/fesm2022/4sh-ui-kit-ui-slider.mjs.map +1 -0
  102. package/fesm2022/4sh-ui-kit-ui-spinner.mjs +132 -0
  103. package/fesm2022/4sh-ui-kit-ui-spinner.mjs.map +1 -0
  104. package/fesm2022/4sh-ui-kit-ui-stepper.mjs +389 -0
  105. package/fesm2022/4sh-ui-kit-ui-stepper.mjs.map +1 -0
  106. package/fesm2022/4sh-ui-kit-ui-table.mjs +1406 -0
  107. package/fesm2022/4sh-ui-kit-ui-table.mjs.map +1 -0
  108. package/fesm2022/4sh-ui-kit-ui-tabs.mjs +503 -0
  109. package/fesm2022/4sh-ui-kit-ui-tabs.mjs.map +1 -0
  110. package/fesm2022/4sh-ui-kit-ui-tag.mjs +84 -0
  111. package/fesm2022/4sh-ui-kit-ui-tag.mjs.map +1 -0
  112. package/fesm2022/4sh-ui-kit-ui-textarea.mjs +119 -0
  113. package/fesm2022/4sh-ui-kit-ui-textarea.mjs.map +1 -0
  114. package/fesm2022/4sh-ui-kit-ui-toast.mjs +424 -0
  115. package/fesm2022/4sh-ui-kit-ui-toast.mjs.map +1 -0
  116. package/fesm2022/4sh-ui-kit-ui-toggle.mjs +120 -0
  117. package/fesm2022/4sh-ui-kit-ui-toggle.mjs.map +1 -0
  118. package/fesm2022/4sh-ui-kit-ui-tooltip.mjs +445 -0
  119. package/fesm2022/4sh-ui-kit-ui-tooltip.mjs.map +1 -0
  120. package/fesm2022/4sh-ui-kit.mjs +16 -0
  121. package/fesm2022/4sh-ui-kit.mjs.map +1 -0
  122. package/package.json +287 -0
  123. package/styles/base/_base.scss +19 -0
  124. package/styles/base/_motion.scss +144 -0
  125. package/styles/base/_typography.scss +99 -0
  126. package/styles/generated/_tokens-breakpoint.scss +8 -0
  127. package/styles/generated/_tokens-metrics.scss +37 -0
  128. package/styles/generated/_tokens-primitives.scss +284 -0
  129. package/styles/generated/_tokens-responsive.scss +99 -0
  130. package/styles/generated/_tokens-semantics.scss +1274 -0
  131. package/styles/generated/_tokens-styles.scss +35 -0
  132. package/styles/generated/_tokens-transitions.scss +11 -0
  133. package/styles/generated/_tokens-typography.scss +14 -0
  134. package/styles/generated/_tokens.scss +10 -0
  135. package/styles/index.scss +25 -0
  136. package/styles/settings/_ui-config.scss +67 -0
  137. package/styles/utils/_functions.scss +67 -0
  138. package/styles/utils/_helpers.scss +129 -0
  139. package/styles/utils/_mixins.scss +186 -0
  140. package/styles/utils/_motion.scss +47 -0
  141. package/styles/utils/_overlay.scss +26 -0
  142. package/styles/utils.scss +15 -0
  143. package/styles.css +1 -0
  144. package/types/4sh-ui-kit-forms.d.ts +259 -0
  145. package/types/4sh-ui-kit-motion.d.ts +111 -0
  146. package/types/4sh-ui-kit-overlay.d.ts +31 -0
  147. package/types/4sh-ui-kit-theming.d.ts +54 -0
  148. package/types/4sh-ui-kit-types.d.ts +13 -0
  149. package/types/4sh-ui-kit-ui-accordion.d.ts +140 -0
  150. package/types/4sh-ui-kit-ui-alert.d.ts +89 -0
  151. package/types/4sh-ui-kit-ui-autocomplete.d.ts +411 -0
  152. package/types/4sh-ui-kit-ui-avatar-group.d.ts +17 -0
  153. package/types/4sh-ui-kit-ui-avatar.d.ts +55 -0
  154. package/types/4sh-ui-kit-ui-badge.d.ts +38 -0
  155. package/types/4sh-ui-kit-ui-breadcrumb.d.ts +131 -0
  156. package/types/4sh-ui-kit-ui-button-split.d.ts +102 -0
  157. package/types/4sh-ui-kit-ui-button.d.ts +91 -0
  158. package/types/4sh-ui-kit-ui-card.d.ts +102 -0
  159. package/types/4sh-ui-kit-ui-checkbox.d.ts +54 -0
  160. package/types/4sh-ui-kit-ui-chip.d.ts +114 -0
  161. package/types/4sh-ui-kit-ui-context-menu.d.ts +105 -0
  162. package/types/4sh-ui-kit-ui-datepicker.d.ts +539 -0
  163. package/types/4sh-ui-kit-ui-drawer.d.ts +147 -0
  164. package/types/4sh-ui-kit-ui-empty-state.d.ts +93 -0
  165. package/types/4sh-ui-kit-ui-field.d.ts +53 -0
  166. package/types/4sh-ui-kit-ui-file-upload.d.ts +268 -0
  167. package/types/4sh-ui-kit-ui-helper.d.ts +46 -0
  168. package/types/4sh-ui-kit-ui-icon.d.ts +69 -0
  169. package/types/4sh-ui-kit-ui-image.d.ts +88 -0
  170. package/types/4sh-ui-kit-ui-input-group.d.ts +54 -0
  171. package/types/4sh-ui-kit-ui-input-mask.d.ts +63 -0
  172. package/types/4sh-ui-kit-ui-input-number.d.ts +96 -0
  173. package/types/4sh-ui-kit-ui-input-otp.d.ts +130 -0
  174. package/types/4sh-ui-kit-ui-input-tags.d.ts +350 -0
  175. package/types/4sh-ui-kit-ui-input.d.ts +78 -0
  176. package/types/4sh-ui-kit-ui-label.d.ts +36 -0
  177. package/types/4sh-ui-kit-ui-link.d.ts +72 -0
  178. package/types/4sh-ui-kit-ui-menu.d.ts +235 -0
  179. package/types/4sh-ui-kit-ui-modal.d.ts +241 -0
  180. package/types/4sh-ui-kit-ui-nudger.d.ts +79 -0
  181. package/types/4sh-ui-kit-ui-paginator.d.ts +150 -0
  182. package/types/4sh-ui-kit-ui-popover.d.ts +125 -0
  183. package/types/4sh-ui-kit-ui-progress-bar.d.ts +82 -0
  184. package/types/4sh-ui-kit-ui-radio.d.ts +44 -0
  185. package/types/4sh-ui-kit-ui-rating.d.ts +90 -0
  186. package/types/4sh-ui-kit-ui-read-only.d.ts +70 -0
  187. package/types/4sh-ui-kit-ui-segment-control.d.ts +184 -0
  188. package/types/4sh-ui-kit-ui-select.d.ts +392 -0
  189. package/types/4sh-ui-kit-ui-separator.d.ts +43 -0
  190. package/types/4sh-ui-kit-ui-sidebar.d.ts +358 -0
  191. package/types/4sh-ui-kit-ui-skeleton.d.ts +52 -0
  192. package/types/4sh-ui-kit-ui-slider.d.ts +127 -0
  193. package/types/4sh-ui-kit-ui-spinner.d.ts +67 -0
  194. package/types/4sh-ui-kit-ui-stepper.d.ts +220 -0
  195. package/types/4sh-ui-kit-ui-table.d.ts +570 -0
  196. package/types/4sh-ui-kit-ui-tabs.d.ts +225 -0
  197. package/types/4sh-ui-kit-ui-tag.d.ts +46 -0
  198. package/types/4sh-ui-kit-ui-textarea.d.ts +61 -0
  199. package/types/4sh-ui-kit-ui-toast.d.ts +247 -0
  200. package/types/4sh-ui-kit-ui-toggle.d.ts +67 -0
  201. package/types/4sh-ui-kit-ui-tooltip.d.ts +167 -0
  202. package/types/4sh-ui-kit.d.ts +4 -0
@@ -0,0 +1,92 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, output, viewChild, computed, forwardRef, Component } from '@angular/core';
3
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
4
+ import { BaseFieldControl } from '@4sh/ui-kit/forms';
5
+
6
+ /**
7
+ * ui-radio — headless radio button built on a real native <input type="radio">.
8
+ *
9
+ * Each ui-radio holds one `value`; the group is formed by binding every member
10
+ * to the same form control (same `formControlName` / `[(ngModel)]`) AND giving
11
+ * them the same `name` (native grouping = roving arrow-key navigation for free).
12
+ * The one whose `value` equals the model value is checked.
13
+ *
14
+ * Interactive states (hover/focus/disabled/checked) are pure CSS driven by
15
+ * `form.*` design tokens.
16
+ */
17
+ class UiRadio extends BaseFieldControl {
18
+ constructor() {
19
+ super(...arguments);
20
+ /** Value carried by this radio (the model takes it when selected). */
21
+ this.value = input.required(/* @ts-ignore */
22
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
23
+ /** Label displayed next to the radio (clicking it selects it). */
24
+ this.label = input(/* @ts-ignore */
25
+ ...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
26
+ /** Emitted when this radio becomes selected by user interaction, with its value. */
27
+ this.radioChange = output();
28
+ /** Emitted when the native input receives focus. */
29
+ this.radioFocus = output();
30
+ /** Emitted when the native input loses focus. */
31
+ this.radioBlur = output();
32
+ /** @ignore */
33
+ this.inputEl = viewChild.required('inputEl', /* @ts-ignore */
34
+ ...(ngDevMode ? [{ debugName: "inputEl" }] : /* istanbul ignore next */ []));
35
+ /** @ignore */
36
+ this.checked = computed(() => this.modelValue() === this.value(), /* @ts-ignore */
37
+ ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
38
+ /** @ignore */
39
+ this.classes = computed(() => {
40
+ const c = ['ui-radio'];
41
+ if (this.checked())
42
+ c.push('_checked');
43
+ if (this.isDisabled())
44
+ c.push('_disabled');
45
+ if (this.isInvalid())
46
+ c.push('_invalid');
47
+ return c.join(' ');
48
+ }, /* @ts-ignore */
49
+ ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
50
+ }
51
+ /** @ignore */
52
+ uidPrefix() {
53
+ return 'ui-radio';
54
+ }
55
+ /** Focus the native input programmatically. */
56
+ focus(options) {
57
+ this.inputEl().nativeElement.focus(options);
58
+ }
59
+ /** @ignore Native change fires only when this radio becomes checked. */
60
+ onNativeChange() {
61
+ const value = this.value();
62
+ this.modelValue.set(value);
63
+ this.emitChange(value);
64
+ this.radioChange.emit(value);
65
+ }
66
+ /** @ignore */
67
+ onBlur(event) {
68
+ this.emitTouch();
69
+ this.radioBlur.emit(event);
70
+ }
71
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: UiRadio, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
72
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: UiRadio, isStandalone: true, selector: "ui-radio", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { radioChange: "radioChange", radioFocus: "radioFocus", radioBlur: "radioBlur" }, providers: [
73
+ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiRadio), multi: true },
74
+ ], viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<label [class]=\"classes()\">\n <span class=\"ui-radio-control\">\n <input\n #inputEl\n type=\"radio\"\n class=\"ui-radio-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)=\"radioFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n <span class=\"ui-radio-box\" aria-hidden=\"true\">\n <span class=\"ui-radio-dot\"></span>\n </span>\n </span>\n\n @if (label()) {\n <span class=\"ui-radio-label\">\n <span class=\"ui-radio-text\">{{ label() }}</span>\n @if (required()) {\n <span class=\"ui-radio-required\" aria-hidden=\"true\">*</span>\n }\n </span>\n }\n</label>\n", styles: [".ui-radio{display:inline-flex;align-items:center;gap:var(--units-sm);cursor:pointer;--_surface: var(--form-high-surface-default);--_stroke: var(--form-high-stroke-default);--_content: var(--form-high-content-checked)}.ui-radio:hover:not(._disabled):not(._readonly){--_surface: var(--form-high-surface-hover);--_stroke: var(--form-high-stroke-hover);--ui-label-color: var(--form-high-content-hover)}.ui-radio._checked:not(._disabled),.ui-radio._indeterminate:not(._disabled){--_surface: var(--form-high-surface-checked);--_stroke: var(--form-high-stroke-checked)}.ui-radio:has(.ui-radio-input:focus-visible){--_stroke: var(--form-high-stroke-focused);--_focus-ring: rgb(from var(--form-high-stroke-focused) r g b / 50%)}.ui-radio._disabled{--_surface: var(--form-high-surface-disabled);--_stroke: var(--form-high-stroke-disabled);--_content: var(--form-high-content-disabled)}.ui-radio._invalid{--_surface: var(--form-error-surface-default);--_stroke: var(--form-error-stroke-default);--_content: var(--form-error-content-checked)}.ui-radio._invalid:hover:not(._disabled):not(._readonly){--_surface: var(--form-error-surface-hover);--_stroke: var(--form-error-stroke-hover);--ui-label-color: var(--form-error-content-hover)}.ui-radio._invalid._checked:not(._disabled),.ui-radio._invalid._indeterminate:not(._disabled){--_surface: var(--form-error-surface-checked);--_stroke: var(--form-error-stroke-checked)}.ui-radio._invalid:has(.ui-radio-input:focus-visible){--_stroke: var(--form-error-stroke-focused);--_focus-ring: rgb(from var(--form-error-stroke-focused) r g b / 50%)}.ui-radio._invalid._disabled{--_surface: var(--form-error-surface-disabled);--_stroke: var(--form-error-stroke-disabled);--_content: var(--form-error-content-disabled)}.ui-radio-control{position:relative;display:inline-flex;width:var(--size-components-2xs);height:var(--size-components-2xs);flex-shrink:0}.ui-radio-input{position:absolute;inset:0;z-index:1;width:100%;height:100%;margin:0;opacity:0;cursor:inherit}.ui-radio-box{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:100%;height:100%;background-color:var(--_surface);border:var(--stroke-default) solid var(--_stroke);border-radius:var(--radius-full);transition:background-color var(--transition-default) var(--transition-easeinout),border-color var(--transition-default) var(--transition-easeinout),box-shadow var(--transition-default) var(--transition-easeinout)}.ui-radio:has(.ui-radio-input:focus-visible) .ui-radio-box{box-shadow:0 0 0 var(--units-2xs) var(--_focus-ring)}.ui-radio-dot{width:var(--units-md);height:var(--units-md);background-color:var(--_content);border-radius:var(--radius-full);transform:scale(0);transition:transform var(--transition-default) var(--transition-easeinout)}.ui-radio._checked .ui-radio-dot{transform:scale(1)}.ui-radio-label{display:inline-flex;align-items:center;gap:var(--units-2xs);font-family:var(--fontfamily-base);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}.ui-radio-required{color:var(--informative-errorlow-content-default)}.ui-radio._disabled{cursor:not-allowed}.ui-radio._disabled .ui-radio-label{color:var(--form-high-content-disabled)}\n"] }); }
75
+ }
76
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: UiRadio, decorators: [{
77
+ type: Component,
78
+ args: [{ selector: 'ui-radio', providers: [
79
+ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiRadio), multi: true },
80
+ ], template: "<label [class]=\"classes()\">\n <span class=\"ui-radio-control\">\n <input\n #inputEl\n type=\"radio\"\n class=\"ui-radio-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)=\"radioFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n <span class=\"ui-radio-box\" aria-hidden=\"true\">\n <span class=\"ui-radio-dot\"></span>\n </span>\n </span>\n\n @if (label()) {\n <span class=\"ui-radio-label\">\n <span class=\"ui-radio-text\">{{ label() }}</span>\n @if (required()) {\n <span class=\"ui-radio-required\" aria-hidden=\"true\">*</span>\n }\n </span>\n }\n</label>\n", styles: [".ui-radio{display:inline-flex;align-items:center;gap:var(--units-sm);cursor:pointer;--_surface: var(--form-high-surface-default);--_stroke: var(--form-high-stroke-default);--_content: var(--form-high-content-checked)}.ui-radio:hover:not(._disabled):not(._readonly){--_surface: var(--form-high-surface-hover);--_stroke: var(--form-high-stroke-hover);--ui-label-color: var(--form-high-content-hover)}.ui-radio._checked:not(._disabled),.ui-radio._indeterminate:not(._disabled){--_surface: var(--form-high-surface-checked);--_stroke: var(--form-high-stroke-checked)}.ui-radio:has(.ui-radio-input:focus-visible){--_stroke: var(--form-high-stroke-focused);--_focus-ring: rgb(from var(--form-high-stroke-focused) r g b / 50%)}.ui-radio._disabled{--_surface: var(--form-high-surface-disabled);--_stroke: var(--form-high-stroke-disabled);--_content: var(--form-high-content-disabled)}.ui-radio._invalid{--_surface: var(--form-error-surface-default);--_stroke: var(--form-error-stroke-default);--_content: var(--form-error-content-checked)}.ui-radio._invalid:hover:not(._disabled):not(._readonly){--_surface: var(--form-error-surface-hover);--_stroke: var(--form-error-stroke-hover);--ui-label-color: var(--form-error-content-hover)}.ui-radio._invalid._checked:not(._disabled),.ui-radio._invalid._indeterminate:not(._disabled){--_surface: var(--form-error-surface-checked);--_stroke: var(--form-error-stroke-checked)}.ui-radio._invalid:has(.ui-radio-input:focus-visible){--_stroke: var(--form-error-stroke-focused);--_focus-ring: rgb(from var(--form-error-stroke-focused) r g b / 50%)}.ui-radio._invalid._disabled{--_surface: var(--form-error-surface-disabled);--_stroke: var(--form-error-stroke-disabled);--_content: var(--form-error-content-disabled)}.ui-radio-control{position:relative;display:inline-flex;width:var(--size-components-2xs);height:var(--size-components-2xs);flex-shrink:0}.ui-radio-input{position:absolute;inset:0;z-index:1;width:100%;height:100%;margin:0;opacity:0;cursor:inherit}.ui-radio-box{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:100%;height:100%;background-color:var(--_surface);border:var(--stroke-default) solid var(--_stroke);border-radius:var(--radius-full);transition:background-color var(--transition-default) var(--transition-easeinout),border-color var(--transition-default) var(--transition-easeinout),box-shadow var(--transition-default) var(--transition-easeinout)}.ui-radio:has(.ui-radio-input:focus-visible) .ui-radio-box{box-shadow:0 0 0 var(--units-2xs) var(--_focus-ring)}.ui-radio-dot{width:var(--units-md);height:var(--units-md);background-color:var(--_content);border-radius:var(--radius-full);transform:scale(0);transition:transform var(--transition-default) var(--transition-easeinout)}.ui-radio._checked .ui-radio-dot{transform:scale(1)}.ui-radio-label{display:inline-flex;align-items:center;gap:var(--units-2xs);font-family:var(--fontfamily-base);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}.ui-radio-required{color:var(--informative-errorlow-content-default)}.ui-radio._disabled{cursor:not-allowed}.ui-radio._disabled .ui-radio-label{color:var(--form-high-content-disabled)}\n"] }]
81
+ }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], radioChange: [{ type: i0.Output, args: ["radioChange"] }], radioFocus: [{ type: i0.Output, args: ["radioFocus"] }], radioBlur: [{ type: i0.Output, args: ["radioBlur"] }], inputEl: [{ type: i0.ViewChild, args: ['inputEl', { isSignal: true }] }] } });
82
+
83
+ /*
84
+ * Public API Surface of ui-kit/ui-radio
85
+ */
86
+
87
+ /**
88
+ * Generated bundle index. Do not edit.
89
+ */
90
+
91
+ export { UiRadio };
92
+ //# sourceMappingURL=4sh-ui-kit-ui-radio.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"4sh-ui-kit-ui-radio.mjs","sources":["../../../projects/ui-kit/ui-radio/src/lib/ui-radio.ts","../../../projects/ui-kit/ui-radio/src/lib/ui-radio.html","../../../projects/ui-kit/ui-radio/src/public-api.ts","../../../projects/ui-kit/ui-radio/src/4sh-ui-kit-ui-radio.ts"],"sourcesContent":["import {\n Component,\n computed,\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';\n\n/**\n * ui-radio — headless radio button built on a real native <input type=\"radio\">.\n *\n * Each ui-radio holds one `value`; the group is formed by binding every member\n * to the same form control (same `formControlName` / `[(ngModel)]`) AND giving\n * them the same `name` (native grouping = roving arrow-key navigation for free).\n * The one whose `value` equals the model value is checked.\n *\n * Interactive states (hover/focus/disabled/checked) are pure CSS driven by\n * `form.*` design tokens.\n */\n@Component({\n selector: 'ui-radio',\n templateUrl: './ui-radio.html',\n styleUrl: './ui-radio.scss',\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiRadio), multi: true },\n ],\n})\nexport class UiRadio<T = unknown> extends BaseFieldControl<T> {\n /** Value carried by this radio (the model takes it when selected). */\n value = input.required<T>();\n /** Label displayed next to the radio (clicking it selects it). */\n label = input<string>();\n\n /** Emitted when this radio becomes selected by user interaction, with its value. */\n radioChange = output<T>();\n /** Emitted when the native input receives focus. */\n radioFocus = output<FocusEvent>();\n /** Emitted when the native input loses focus. */\n radioBlur = output<FocusEvent>();\n\n /** @ignore */\n private readonly inputEl = viewChild.required<ElementRef<HTMLInputElement>>('inputEl');\n\n /** @ignore */\n protected readonly checked = computed(() => this.modelValue() === this.value());\n\n /** @ignore */\n protected readonly classes = computed(() => {\n const c = ['ui-radio'];\n if (this.checked()) c.push('_checked');\n if (this.isDisabled()) c.push('_disabled');\n if (this.isInvalid()) c.push('_invalid');\n return c.join(' ');\n });\n\n /** @ignore */\n protected override uidPrefix(): string {\n return 'ui-radio';\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 fires only when this radio becomes checked. */\n protected onNativeChange(): void {\n const value = this.value();\n this.modelValue.set(value);\n this.emitChange(value);\n this.radioChange.emit(value);\n }\n\n /** @ignore */\n protected onBlur(event: FocusEvent): void {\n this.emitTouch();\n this.radioBlur.emit(event);\n }\n}\n","<label [class]=\"classes()\">\n <span class=\"ui-radio-control\">\n <input\n #inputEl\n type=\"radio\"\n class=\"ui-radio-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)=\"radioFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n <span class=\"ui-radio-box\" aria-hidden=\"true\">\n <span class=\"ui-radio-dot\"></span>\n </span>\n </span>\n\n @if (label()) {\n <span class=\"ui-radio-label\">\n <span class=\"ui-radio-text\">{{ label() }}</span>\n @if (required()) {\n <span class=\"ui-radio-required\" aria-hidden=\"true\">*</span>\n }\n </span>\n }\n</label>\n","/*\n * Public API Surface of ui-kit/ui-radio\n */\n\nexport * from './lib/ui-radio';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAYA;;;;;;;;;;AAUG;AASG,MAAO,OAAqB,SAAQ,gBAAmB,CAAA;AAR7D,IAAA,WAAA,GAAA;;;QAUE,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,QAAQ;kFAAK;;AAE3B,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK;6FAAU;;QAGvB,IAAA,CAAA,WAAW,GAAG,MAAM,EAAK;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AAA,UAAA,EAAA,CAAA;kBARnB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,UAAU,EAAA,SAAA,EAGT;AACT,wBAAA,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;AACpF,qBAAA,EAAA,QAAA,EAAA,6gCAAA,EAAA,MAAA,EAAA,CAAA,gtGAAA,CAAA,EAAA;maAgB2E,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE7CvF;;AAEG;;ACFH;;AAEG;;;;"}
@@ -0,0 +1,185 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, numberAttribute, booleanAttribute, contentChild, TemplateRef, output, viewChild, signal, computed, forwardRef, Component } from '@angular/core';
3
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
4
+ import { NgTemplateOutlet } from '@angular/common';
5
+ import { BaseFieldControl } from '@4sh/ui-kit/forms';
6
+ import { UiIcon } from '@4sh/ui-kit/ui-icon';
7
+
8
+ /**
9
+ * ui-rating — headless rating component built over a native <input type="range">.
10
+ */
11
+ class UiRating extends BaseFieldControl {
12
+ constructor() {
13
+ super(...arguments);
14
+ /** Size of the rating stars. */
15
+ this.size = input('default', /* @ts-ignore */
16
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
17
+ /** Number of stars to display. */
18
+ this.stars = input(5, { ...(ngDevMode ? { debugName: "stars" } : /* istanbul ignore next */ {}), transform: numberAttribute });
19
+ /** Enables half-star notation: the value moves by 0.5 (click on a half, arrow keys). */
20
+ this.allowHalf = input(false, { ...(ngDevMode ? { debugName: "allowHalf" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
21
+ /** Allows clearing the rating by clicking the current value. */
22
+ this.cancel = input(true, { ...(ngDevMode ? { debugName: "cancel" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
23
+ /** Native autofocus attribute. */
24
+ this.autofocus = input(false, { ...(ngDevMode ? { debugName: "autofocus" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
25
+ /** Orientation of the rating control. */
26
+ this.orientation = input('horizontal', /* @ts-ignore */
27
+ ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
28
+ /** Custom template for active stars. */
29
+ this.onIconTemplate = contentChild('onIcon', { ...(ngDevMode ? { debugName: "onIconTemplate" } : /* istanbul ignore next */ {}), read: (TemplateRef) });
30
+ /** Custom template for inactive stars. */
31
+ this.offIconTemplate = contentChild('offIcon', { ...(ngDevMode ? { debugName: "offIconTemplate" } : /* istanbul ignore next */ {}), read: (TemplateRef) });
32
+ /** Emitted when rating changes (`null` = cleared / not rated). */
33
+ this.rateChange = output();
34
+ /** Emitted when the native input receives focus. */
35
+ this.ratingFocus = output();
36
+ /** Emitted when the native input loses focus. */
37
+ this.ratingBlur = output();
38
+ /** @ignore */
39
+ this.inputEl = viewChild.required('inputEl', /* @ts-ignore */
40
+ ...(ngDevMode ? [{ debugName: "inputEl" }] : /* istanbul ignore next */ []));
41
+ /** @ignore Redeclared over the base signal: `null` = not rated (never `undefined`). */
42
+ this.modelValue = signal(null, /* @ts-ignore */
43
+ ...(ngDevMode ? [{ debugName: "modelValue" }] : /* istanbul ignore next */ []));
44
+ /** @ignore */
45
+ this.hoverValue = signal(0, /* @ts-ignore */
46
+ ...(ngDevMode ? [{ debugName: "hoverValue" }] : /* istanbul ignore next */ []));
47
+ /** @ignore Selection granularity: one star, or a half when `allowHalf`. */
48
+ this.step = computed(() => (this.allowHalf() ? 0.5 : 1), /* @ts-ignore */
49
+ ...(ngDevMode ? [{ debugName: "step" }] : /* istanbul ignore next */ []));
50
+ /**
51
+ * @ignore Numeric value used for display comparisons (`null` renders as 0 stars).
52
+ * Floored to the granularity so an out-of-step value (an average pushed by the
53
+ * host, e.g. 4.3) never renders a fill the user could not have selected.
54
+ */
55
+ this.currentValue = computed(() => {
56
+ const step = this.step();
57
+ return Math.floor(Math.max(0, this.modelValue() ?? 0) / step) * step;
58
+ }, /* @ts-ignore */
59
+ ...(ngDevMode ? [{ debugName: "currentValue" }] : /* istanbul ignore next */ []));
60
+ /** @ignore Per-star render model; `fill` (0 → 1) drives the clipped overlay. */
61
+ this.starList = computed(() => {
62
+ const value = this.currentValue();
63
+ const preview = this.hoverValue() || value;
64
+ return Array.from({ length: this.stars() }, (_, i) => ({
65
+ index: i + 1,
66
+ fill: Math.min(1, Math.max(0, preview - i)),
67
+ active: i + 1 <= value,
68
+ }));
69
+ }, /* @ts-ignore */
70
+ ...(ngDevMode ? [{ debugName: "starList" }] : /* istanbul ignore next */ []));
71
+ /** @ignore */
72
+ this.classes = computed(() => {
73
+ const c = ['ui-rating', `_size-${this.size()}`];
74
+ if (this.orientation() === 'vertical')
75
+ c.push('_vertical');
76
+ if (this.isDisabled())
77
+ c.push('_disabled');
78
+ if (this.readonly())
79
+ c.push('_readonly');
80
+ if (this.isInvalid())
81
+ c.push('_invalid');
82
+ return c.join(' ');
83
+ }, /* @ts-ignore */
84
+ ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
85
+ }
86
+ writeValue(value) {
87
+ this.modelValue.set(value ?? null);
88
+ }
89
+ /** @ignore */
90
+ uidPrefix() {
91
+ return 'ui-rating';
92
+ }
93
+ focus(options) {
94
+ this.inputEl().nativeElement.focus(options);
95
+ }
96
+ /** @ignore Native change is triggered by keyboard or programmatic native actions */
97
+ onNativeChange(event) {
98
+ const input = event.target;
99
+ const value = parseFloat(input.value);
100
+ if (this.isDisabled() || this.readonly() || Number.isNaN(value)) {
101
+ // Revert the native range so its value stays in sync with the model.
102
+ input.value = String(this.currentValue());
103
+ return;
104
+ }
105
+ // The range's 0 means "not rated" → null at the public boundary.
106
+ this.updateValue(value === 0 ? null : value);
107
+ }
108
+ /** @ignore */
109
+ rate(star, event) {
110
+ if (this.isDisabled() || this.readonly())
111
+ return;
112
+ const value = this.pointedValue(star, event);
113
+ let newValue = value;
114
+ if (this.cancel() && this.modelValue() === value) {
115
+ newValue = null;
116
+ }
117
+ this.updateValue(newValue);
118
+ this.focus();
119
+ }
120
+ /**
121
+ * @ignore Value pointed at by the cursor: the star itself, or its first half
122
+ * when `allowHalf`. Reads the writing direction so the "first half" stays the
123
+ * leading one in RTL, like the clip applied by the stylesheet.
124
+ */
125
+ pointedValue(star, event) {
126
+ if (!this.allowHalf())
127
+ return star;
128
+ const el = event.currentTarget;
129
+ const { left, width } = el.getBoundingClientRect();
130
+ if (!width)
131
+ return star;
132
+ const ratio = (event.clientX - left) / width;
133
+ const leadingHalf = getComputedStyle(el).direction === 'rtl' ? ratio > 0.5 : ratio < 0.5;
134
+ return leadingHalf ? star - 0.5 : star;
135
+ }
136
+ updateValue(value) {
137
+ if (this.modelValue() !== value) {
138
+ this.modelValue.set(value);
139
+ this.emitChange(value);
140
+ this.rateChange.emit(value);
141
+ }
142
+ }
143
+ /** @ignore Bound to `mousemove`: the preview must follow the cursor across the two halves. */
144
+ setHover(star, event) {
145
+ if (this.isDisabled() || this.readonly())
146
+ return;
147
+ this.hoverValue.set(this.pointedValue(star, event));
148
+ }
149
+ /** @ignore */
150
+ clearHover() {
151
+ if (this.isDisabled() || this.readonly())
152
+ return;
153
+ this.hoverValue.set(0);
154
+ }
155
+ /** @ignore */
156
+ onFocus(event) {
157
+ this.ratingFocus.emit(event);
158
+ }
159
+ /** @ignore */
160
+ onBlur(event) {
161
+ this.emitTouch();
162
+ this.ratingBlur.emit(event);
163
+ }
164
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: UiRating, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
165
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: UiRating, isStandalone: true, selector: "ui-rating", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, stars: { classPropertyName: "stars", publicName: "stars", isSignal: true, isRequired: false, transformFunction: null }, allowHalf: { classPropertyName: "allowHalf", publicName: "allowHalf", isSignal: true, isRequired: false, transformFunction: null }, cancel: { classPropertyName: "cancel", publicName: "cancel", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { rateChange: "rateChange", ratingFocus: "ratingFocus", ratingBlur: "ratingBlur" }, providers: [
166
+ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiRating), multi: true },
167
+ ], queries: [{ propertyName: "onIconTemplate", first: true, predicate: ["onIcon"], descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "offIconTemplate", first: true, predicate: ["offIcon"], descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div [class]=\"classes()\" (mouseleave)=\"clearHover()\">\n <!-- autofocus is a deliberate opt-in input of the component (default false). -->\n <!-- eslint-disable @angular-eslint/template/no-autofocus -->\n <input #inputEl\n type=\"range\"\n class=\"ui-rating-input\"\n min=\"0\" [max]=\"stars()\" [step]=\"step()\"\n [id]=\"resolvedId()\"\n [name]=\"name()\"\n [disabled]=\"isDisabled()\"\n [required]=\"required()\"\n [attr.autofocus]=\"autofocus() ? true : null\"\n [attr.readonly]=\"readonly() ? true : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [tabindex]=\"tabindex() ?? 0\"\n [value]=\"currentValue()\"\n (input)=\"onNativeChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\">\n <!-- eslint-enable @angular-eslint/template/no-autofocus -->\n\n <div class=\"ui-rating-stars\">\n @for (star of starList(); track star.index) {\n <!-- Purely visual stars: focus and keyboard are carried by\n the native <input type=\"range\"> above. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div class=\"ui-rating-icon\"\n (click)=\"rate(star.index, $event)\"\n (mousemove)=\"setHover(star.index, $event)\">\n <!-- The \"on\" icon is stacked over the \"off\" one and clipped to `fill`:\n a half star works with any icon family and any projected template. -->\n <span class=\"ui-rating-icon-stack\">\n <span class=\"ui-rating-icon-base\">\n <ng-container *ngTemplateOutlet=\"offIconTemplate() || defaultOffIcon; context: { $implicit: star.index, active: star.active, fill: star.fill }\" />\n </span>\n @if (star.fill > 0) {\n <span class=\"ui-rating-icon-fill\" [style.--ui-rating-fill]=\"star.fill\">\n <ng-container *ngTemplateOutlet=\"onIconTemplate() || defaultOnIcon; context: { $implicit: star.index, active: star.active, fill: star.fill }\" />\n </span>\n }\n </span>\n </div>\n }\n </div>\n</div>\n\n<ng-template #defaultOnIcon>\n <ui-icon name=\"star\" type=\"solid\" [size]=\"size()\" />\n</ng-template>\n\n<ng-template #defaultOffIcon>\n <ui-icon name=\"star\" type=\"outline\" [size]=\"size()\" />\n</ng-template>\n", styles: [".ui-rating{position:relative;display:inline-flex;align-items:center}.ui-rating-input{position:absolute;inset:0;z-index:1;width:100%;height:100%;margin:0;opacity:0;cursor:inherit;pointer-events:none}.ui-rating-stars{display:flex;gap:var(--units-2xs)}.ui-rating._size-sm .ui-rating-stars,.ui-rating._size-md .ui-rating-stars,.ui-rating._size-default .ui-rating-stars,.ui-rating._size-lg .ui-rating-stars,.ui-rating._size-xl .ui-rating-stars{gap:var(--units-2xs)}.ui-rating._vertical .ui-rating-stars{flex-direction:column}.ui-rating-icon{display:flex;align-items:center;justify-content:center;padding:var(--units-2xs);cursor:pointer;border-radius:var(--radius-full);pointer-events:auto}.ui-rating-icon-stack{position:relative;display:flex;line-height:1;color:var(--form-low-content-default);transition:color var(--transition-default) var(--transition-easeinout)}.ui-rating-icon-base,.ui-rating-icon-fill{display:flex;align-items:center;justify-content:center}.ui-rating-icon-fill{position:absolute;inset:0;color:var(--form-high-content-checked);clip-path:inset(0 calc((1 - var(--ui-rating-fill, 1)) * 100%) 0 0);transition:color var(--transition-default) var(--transition-easeinout)}.ui-rating._disabled,.ui-rating._disabled .ui-rating-icon{cursor:not-allowed}.ui-rating._disabled .ui-rating-icon-stack{color:var(--form-low-content-disabled)}.ui-rating._disabled .ui-rating-icon-fill{color:var(--form-high-content-disabled)}.ui-rating._readonly .ui-rating-icon{cursor:default}.ui-rating._invalid .ui-rating-icon-stack{color:var(--form-error-content-default)}.ui-rating._invalid .ui-rating-icon-fill{color:var(--form-error-content-checked)}:host-context([dir=rtl]) .ui-rating-icon-fill{clip-path:inset(0 0 0 calc((1 - var(--ui-rating-fill, 1)) * 100%))}\n"], dependencies: [{ kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
168
+ }
169
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: UiRating, decorators: [{
170
+ type: Component,
171
+ args: [{ selector: 'ui-rating', standalone: true, imports: [UiIcon, NgTemplateOutlet], providers: [
172
+ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiRating), multi: true },
173
+ ], template: "<div [class]=\"classes()\" (mouseleave)=\"clearHover()\">\n <!-- autofocus is a deliberate opt-in input of the component (default false). -->\n <!-- eslint-disable @angular-eslint/template/no-autofocus -->\n <input #inputEl\n type=\"range\"\n class=\"ui-rating-input\"\n min=\"0\" [max]=\"stars()\" [step]=\"step()\"\n [id]=\"resolvedId()\"\n [name]=\"name()\"\n [disabled]=\"isDisabled()\"\n [required]=\"required()\"\n [attr.autofocus]=\"autofocus() ? true : null\"\n [attr.readonly]=\"readonly() ? true : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [tabindex]=\"tabindex() ?? 0\"\n [value]=\"currentValue()\"\n (input)=\"onNativeChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\">\n <!-- eslint-enable @angular-eslint/template/no-autofocus -->\n\n <div class=\"ui-rating-stars\">\n @for (star of starList(); track star.index) {\n <!-- Purely visual stars: focus and keyboard are carried by\n the native <input type=\"range\"> above. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div class=\"ui-rating-icon\"\n (click)=\"rate(star.index, $event)\"\n (mousemove)=\"setHover(star.index, $event)\">\n <!-- The \"on\" icon is stacked over the \"off\" one and clipped to `fill`:\n a half star works with any icon family and any projected template. -->\n <span class=\"ui-rating-icon-stack\">\n <span class=\"ui-rating-icon-base\">\n <ng-container *ngTemplateOutlet=\"offIconTemplate() || defaultOffIcon; context: { $implicit: star.index, active: star.active, fill: star.fill }\" />\n </span>\n @if (star.fill > 0) {\n <span class=\"ui-rating-icon-fill\" [style.--ui-rating-fill]=\"star.fill\">\n <ng-container *ngTemplateOutlet=\"onIconTemplate() || defaultOnIcon; context: { $implicit: star.index, active: star.active, fill: star.fill }\" />\n </span>\n }\n </span>\n </div>\n }\n </div>\n</div>\n\n<ng-template #defaultOnIcon>\n <ui-icon name=\"star\" type=\"solid\" [size]=\"size()\" />\n</ng-template>\n\n<ng-template #defaultOffIcon>\n <ui-icon name=\"star\" type=\"outline\" [size]=\"size()\" />\n</ng-template>\n", styles: [".ui-rating{position:relative;display:inline-flex;align-items:center}.ui-rating-input{position:absolute;inset:0;z-index:1;width:100%;height:100%;margin:0;opacity:0;cursor:inherit;pointer-events:none}.ui-rating-stars{display:flex;gap:var(--units-2xs)}.ui-rating._size-sm .ui-rating-stars,.ui-rating._size-md .ui-rating-stars,.ui-rating._size-default .ui-rating-stars,.ui-rating._size-lg .ui-rating-stars,.ui-rating._size-xl .ui-rating-stars{gap:var(--units-2xs)}.ui-rating._vertical .ui-rating-stars{flex-direction:column}.ui-rating-icon{display:flex;align-items:center;justify-content:center;padding:var(--units-2xs);cursor:pointer;border-radius:var(--radius-full);pointer-events:auto}.ui-rating-icon-stack{position:relative;display:flex;line-height:1;color:var(--form-low-content-default);transition:color var(--transition-default) var(--transition-easeinout)}.ui-rating-icon-base,.ui-rating-icon-fill{display:flex;align-items:center;justify-content:center}.ui-rating-icon-fill{position:absolute;inset:0;color:var(--form-high-content-checked);clip-path:inset(0 calc((1 - var(--ui-rating-fill, 1)) * 100%) 0 0);transition:color var(--transition-default) var(--transition-easeinout)}.ui-rating._disabled,.ui-rating._disabled .ui-rating-icon{cursor:not-allowed}.ui-rating._disabled .ui-rating-icon-stack{color:var(--form-low-content-disabled)}.ui-rating._disabled .ui-rating-icon-fill{color:var(--form-high-content-disabled)}.ui-rating._readonly .ui-rating-icon{cursor:default}.ui-rating._invalid .ui-rating-icon-stack{color:var(--form-error-content-default)}.ui-rating._invalid .ui-rating-icon-fill{color:var(--form-error-content-checked)}:host-context([dir=rtl]) .ui-rating-icon-fill{clip-path:inset(0 0 0 calc((1 - var(--ui-rating-fill, 1)) * 100%))}\n"] }]
174
+ }], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], stars: [{ type: i0.Input, args: [{ isSignal: true, alias: "stars", required: false }] }], allowHalf: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowHalf", required: false }] }], cancel: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancel", required: false }] }], autofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocus", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], onIconTemplate: [{ type: i0.ContentChild, args: ['onIcon', { ...{ read: (TemplateRef) }, isSignal: true }] }], offIconTemplate: [{ type: i0.ContentChild, args: ['offIcon', { ...{ read: (TemplateRef) }, isSignal: true }] }], rateChange: [{ type: i0.Output, args: ["rateChange"] }], ratingFocus: [{ type: i0.Output, args: ["ratingFocus"] }], ratingBlur: [{ type: i0.Output, args: ["ratingBlur"] }], inputEl: [{ type: i0.ViewChild, args: ['inputEl', { isSignal: true }] }] } });
175
+
176
+ /*
177
+ * Public API Surface of ui-kit/ui-rating
178
+ */
179
+
180
+ /**
181
+ * Generated bundle index. Do not edit.
182
+ */
183
+
184
+ export { UiRating };
185
+ //# sourceMappingURL=4sh-ui-kit-ui-rating.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"4sh-ui-kit-ui-rating.mjs","sources":["../../../projects/ui-kit/ui-rating/src/lib/ui-rating.ts","../../../projects/ui-kit/ui-rating/src/lib/ui-rating.html","../../../projects/ui-kit/ui-rating/src/public-api.ts","../../../projects/ui-kit/ui-rating/src/4sh-ui-kit-ui-rating.ts"],"sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n contentChild,\n ElementRef,\n forwardRef,\n input,\n numberAttribute,\n output,\n signal,\n TemplateRef,\n viewChild,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { BaseFieldControl } from '@4sh/ui-kit/forms';\nimport { UiIcon, UiIconSize } from '@4sh/ui-kit/ui-icon';\n\nexport interface UiRatingIconContext {\n /** The current star value (1-based index). */\n $implicit: number;\n /** Whether this star is active (value <= current rating). */\n active: boolean;\n /** Filled portion of this star, `0` to `1` (hover preview included). */\n fill: number;\n}\n\n/**\n * ui-rating — headless rating component built over a native <input type=\"range\">.\n */\n@Component({\n selector: 'ui-rating',\n templateUrl: './ui-rating.html',\n styleUrl: './ui-rating.scss',\n standalone: true,\n imports: [UiIcon, NgTemplateOutlet],\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiRating), multi: true },\n ],\n})\nexport class UiRating extends BaseFieldControl<number | null> {\n /** Size of the rating stars. */\n size = input<UiIconSize>('default');\n /** Number of stars to display. */\n stars = input(5, { transform: numberAttribute });\n /** Enables half-star notation: the value moves by 0.5 (click on a half, arrow keys). */\n allowHalf = input(false, { transform: booleanAttribute });\n /** Allows clearing the rating by clicking the current value. */\n cancel = input(true, { transform: booleanAttribute });\n /** Native autofocus attribute. */\n autofocus = input(false, { transform: booleanAttribute });\n /** Orientation of the rating control. */\n orientation = input<'horizontal' | 'vertical'>('horizontal');\n\n /** Custom template for active stars. */\n onIconTemplate = contentChild('onIcon', { read: TemplateRef<UiRatingIconContext> });\n /** Custom template for inactive stars. */\n offIconTemplate = contentChild('offIcon', { read: TemplateRef<UiRatingIconContext> });\n\n /** Emitted when rating changes (`null` = cleared / not rated). */\n rateChange = output<number | null>();\n /** Emitted when the native input receives focus. */\n ratingFocus = output<FocusEvent>();\n /** Emitted when the native input loses focus. */\n ratingBlur = output<FocusEvent>();\n\n /** @ignore */\n private readonly inputEl = viewChild.required<ElementRef<HTMLInputElement>>('inputEl');\n /** @ignore Redeclared over the base signal: `null` = not rated (never `undefined`). */\n protected override readonly modelValue = signal<number | null>(null);\n /** @ignore */\n protected readonly hoverValue = signal<number>(0);\n /** @ignore Selection granularity: one star, or a half when `allowHalf`. */\n protected readonly step = computed(() => (this.allowHalf() ? 0.5 : 1));\n /**\n * @ignore Numeric value used for display comparisons (`null` renders as 0 stars).\n * Floored to the granularity so an out-of-step value (an average pushed by the\n * host, e.g. 4.3) never renders a fill the user could not have selected.\n */\n protected readonly currentValue = computed(() => {\n const step = this.step();\n return Math.floor(Math.max(0, this.modelValue() ?? 0) / step) * step;\n });\n\n /** @ignore Per-star render model; `fill` (0 → 1) drives the clipped overlay. */\n protected readonly starList = computed(() => {\n const value = this.currentValue();\n const preview = this.hoverValue() || value;\n return Array.from({ length: this.stars() }, (_, i) => ({\n index: i + 1,\n fill: Math.min(1, Math.max(0, preview - i)),\n active: i + 1 <= value,\n }));\n });\n\n /** @ignore */\n protected readonly classes = computed(() => {\n const c = ['ui-rating', `_size-${this.size()}`];\n if (this.orientation() === 'vertical') c.push('_vertical');\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 override writeValue(value: number | null): void {\n this.modelValue.set(value ?? null);\n }\n\n /** @ignore */\n protected override uidPrefix(): string {\n return 'ui-rating';\n }\n\n focus(options?: FocusOptions): void {\n this.inputEl().nativeElement.focus(options);\n }\n\n /** @ignore Native change is triggered by keyboard or programmatic native actions */\n protected onNativeChange(event: Event): void {\n const input = event.target as HTMLInputElement;\n const value = parseFloat(input.value);\n if (this.isDisabled() || this.readonly() || Number.isNaN(value)) {\n // Revert the native range so its value stays in sync with the model.\n input.value = String(this.currentValue());\n return;\n }\n // The range's 0 means \"not rated\" → null at the public boundary.\n this.updateValue(value === 0 ? null : value);\n }\n\n /** @ignore */\n protected rate(star: number, event: MouseEvent): void {\n if (this.isDisabled() || this.readonly()) return;\n\n const value = this.pointedValue(star, event);\n let newValue: number | null = value;\n if (this.cancel() && this.modelValue() === value) {\n newValue = null;\n }\n\n this.updateValue(newValue);\n this.focus();\n }\n\n /**\n * @ignore Value pointed at by the cursor: the star itself, or its first half\n * when `allowHalf`. Reads the writing direction so the \"first half\" stays the\n * leading one in RTL, like the clip applied by the stylesheet.\n */\n private pointedValue(star: number, event: MouseEvent): number {\n if (!this.allowHalf()) return star;\n const el = event.currentTarget as HTMLElement;\n const { left, width } = el.getBoundingClientRect();\n if (!width) return star;\n const ratio = (event.clientX - left) / width;\n const leadingHalf = getComputedStyle(el).direction === 'rtl' ? ratio > 0.5 : ratio < 0.5;\n return leadingHalf ? star - 0.5 : star;\n }\n\n private updateValue(value: number | null): void {\n if (this.modelValue() !== value) {\n this.modelValue.set(value);\n this.emitChange(value);\n this.rateChange.emit(value);\n }\n }\n\n /** @ignore Bound to `mousemove`: the preview must follow the cursor across the two halves. */\n protected setHover(star: number, event: MouseEvent): void {\n if (this.isDisabled() || this.readonly()) return;\n this.hoverValue.set(this.pointedValue(star, event));\n }\n\n /** @ignore */\n protected clearHover(): void {\n if (this.isDisabled() || this.readonly()) return;\n this.hoverValue.set(0);\n }\n\n /** @ignore */\n protected onFocus(event: FocusEvent): void {\n this.ratingFocus.emit(event);\n }\n\n /** @ignore */\n protected onBlur(event: FocusEvent): void {\n this.emitTouch();\n this.ratingBlur.emit(event);\n }\n}\n","<div [class]=\"classes()\" (mouseleave)=\"clearHover()\">\n <!-- autofocus is a deliberate opt-in input of the component (default false). -->\n <!-- eslint-disable @angular-eslint/template/no-autofocus -->\n <input #inputEl\n type=\"range\"\n class=\"ui-rating-input\"\n min=\"0\" [max]=\"stars()\" [step]=\"step()\"\n [id]=\"resolvedId()\"\n [name]=\"name()\"\n [disabled]=\"isDisabled()\"\n [required]=\"required()\"\n [attr.autofocus]=\"autofocus() ? true : null\"\n [attr.readonly]=\"readonly() ? true : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [tabindex]=\"tabindex() ?? 0\"\n [value]=\"currentValue()\"\n (input)=\"onNativeChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\">\n <!-- eslint-enable @angular-eslint/template/no-autofocus -->\n\n <div class=\"ui-rating-stars\">\n @for (star of starList(); track star.index) {\n <!-- Purely visual stars: focus and keyboard are carried by\n the native <input type=\"range\"> above. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div class=\"ui-rating-icon\"\n (click)=\"rate(star.index, $event)\"\n (mousemove)=\"setHover(star.index, $event)\">\n <!-- The \"on\" icon is stacked over the \"off\" one and clipped to `fill`:\n a half star works with any icon family and any projected template. -->\n <span class=\"ui-rating-icon-stack\">\n <span class=\"ui-rating-icon-base\">\n <ng-container *ngTemplateOutlet=\"offIconTemplate() || defaultOffIcon; context: { $implicit: star.index, active: star.active, fill: star.fill }\" />\n </span>\n @if (star.fill > 0) {\n <span class=\"ui-rating-icon-fill\" [style.--ui-rating-fill]=\"star.fill\">\n <ng-container *ngTemplateOutlet=\"onIconTemplate() || defaultOnIcon; context: { $implicit: star.index, active: star.active, fill: star.fill }\" />\n </span>\n }\n </span>\n </div>\n }\n </div>\n</div>\n\n<ng-template #defaultOnIcon>\n <ui-icon name=\"star\" type=\"solid\" [size]=\"size()\" />\n</ng-template>\n\n<ng-template #defaultOffIcon>\n <ui-icon name=\"star\" type=\"outline\" [size]=\"size()\" />\n</ng-template>\n","/*\n * Public API Surface of ui-kit/ui-rating\n */\n\nexport * from './lib/ui-rating';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AA4BA;;AAEG;AAWG,MAAO,QAAS,SAAQ,gBAA+B,CAAA;AAV7D,IAAA,WAAA,GAAA;;;QAYE,IAAA,CAAA,IAAI,GAAG,KAAK,CAAa,SAAS;iFAAC;;QAEnC,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,CAAC,6EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;;QAEhD,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,KAAK,iFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;QAEzD,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,IAAI,8EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;QAErD,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,KAAK,iFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;QAEzD,IAAA,CAAA,WAAW,GAAG,KAAK,CAA4B,YAAY;wFAAC;;QAG5D,IAAA,CAAA,cAAc,GAAG,YAAY,CAAC,QAAQ,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,8BAAA,EAAA,CAAA,EAAI,IAAI,GAAE,WAAgC,CAAA,EAAA,CAAG;;QAEnF,IAAA,CAAA,eAAe,GAAG,YAAY,CAAC,SAAS,EAAA,EAAA,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EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEpEvF;;AAEG;;ACFH;;AAEG;;;;"}
@@ -0,0 +1,146 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, booleanAttribute, viewChild, signal, computed, afterNextRender, Component } from '@angular/core';
3
+ import { NgTemplateOutlet } from '@angular/common';
4
+ import { UiLabel } from '@4sh/ui-kit/ui-label';
5
+
6
+ /**
7
+ * ui-read-only — displays a labelled value in read-only mode.
8
+ */
9
+ class UiReadOnly {
10
+ constructor() {
11
+ /** Field label (plain string — i18n is the caller's responsibility). Rendered via `ui-label`. */
12
+ this.label = input(/* @ts-ignore */
13
+ ...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
14
+ /** Shows the required marker (*) on the label — for parity with a required field. */
15
+ this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
16
+ /** Fully custom label markup, replacing the default `ui-label` (escape hatch). */
17
+ this.labelTemplate = input(/* @ts-ignore */
18
+ ...(ngDevMode ? [undefined, { debugName: "labelTemplate" }] : /* istanbul ignore next */ []));
19
+ /** Displayed value. Ignored when content is projected. */
20
+ this.value = input(/* @ts-ignore */
21
+ ...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
22
+ /** Shown (muted) when the value is null / undefined / empty. */
23
+ this.fallback = input('—', /* @ts-ignore */
24
+ ...(ngDevMode ? [{ debugName: "fallback" }] : /* istanbul ignore next */ []));
25
+ /**
26
+ * Accessible text announced in place of the `fallback` symbol when the value
27
+ * is empty (e.g. "Non renseigné"). The visual `fallback` stays decorative.
28
+ */
29
+ this.emptyLabel = input(/* @ts-ignore */
30
+ ...(ngDevMode ? [undefined, { debugName: "emptyLabel" }] : /* istanbul ignore next */ []));
31
+ /** Stacked (`vertical`), side-by-side (`horizontal`), or grid-driven (`grid`). */
32
+ this.layout = input('vertical', /* @ts-ignore */
33
+ ...(ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []));
34
+ /** Text/label size. */
35
+ this.size = input('default', /* @ts-ignore */
36
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
37
+ /** Label text alignment (horizontal layout only). */
38
+ this.labelAlign = input('left', /* @ts-ignore */
39
+ ...(ngDevMode ? [{ debugName: "labelAlign" }] : /* istanbul ignore next */ []));
40
+ /** Label column width in horizontal layout (any CSS length, e.g. `160px`, `30%`). Unset = hug content. */
41
+ this.labelWidth = input(/* @ts-ignore */
42
+ ...(ngDevMode ? [undefined, { debugName: "labelWidth" }] : /* istanbul ignore next */ []));
43
+ /** Preserve line breaks in the value (`white-space: pre-line`). */
44
+ this.multiline = input(false, { ...(ngDevMode ? { debugName: "multiline" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
45
+ /** Hug content and flow inline instead of filling the container. */
46
+ this.inline = input(false, { ...(ngDevMode ? { debugName: "inline" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
47
+ /**
48
+ * Adapt the layout to sit alongside form fields
49
+ */
50
+ this.matchField = input(false, { ...(ngDevMode ? { debugName: "matchField" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
51
+ // --- Layout passthrough (grid / utility systems) ---------------------
52
+ // Classes forwarded verbatim onto the row / label cell / value cell, so any
53
+ // grid or utility system drives the layout (e.g. Gridaflex `flex-x` on the
54
+ // row + `cell phone-24 desktop-auto` on the cells). Additive in every layout.
55
+ /** Extra classes on the row (`<dl>`), e.g. a grid row class like `flex-x`. */
56
+ this.rowClass = input(/* @ts-ignore */
57
+ ...(ngDevMode ? [undefined, { debugName: "rowClass" }] : /* istanbul ignore next */ []));
58
+ /** Extra classes on the label cell (`<dt>`), e.g. `cell phone-24 desktop-auto`. */
59
+ this.labelClass = input(/* @ts-ignore */
60
+ ...(ngDevMode ? [undefined, { debugName: "labelClass" }] : /* istanbul ignore next */ []));
61
+ /** Extra classes on the value cell (`<dd>`), e.g. `cell phone-24 desktop-auto`. */
62
+ this.valueClass = input(/* @ts-ignore */
63
+ ...(ngDevMode ? [undefined, { debugName: "valueClass" }] : /* istanbul ignore next */ []));
64
+ /** @ignore Wrapper around <ng-content>, used to detect projected content. */
65
+ this.projectedWrap = viewChild('projectedWrap', /* @ts-ignore */
66
+ ...(ngDevMode ? [{ debugName: "projectedWrap" }] : /* istanbul ignore next */ []));
67
+ /** @ignore Rich value was projected via <ng-content>. */
68
+ this.hasProjectedContent = signal(false, /* @ts-ignore */
69
+ ...(ngDevMode ? [{ debugName: "hasProjectedContent" }] : /* istanbul ignore next */ []));
70
+ /** @ignore A label is provided (drives the <dl>/<dt>/<dd> vs plain markup). */
71
+ this.hasLabel = computed(() => !!this.label() || !!this.labelTemplate(), /* @ts-ignore */
72
+ ...(ngDevMode ? [{ debugName: "hasLabel" }] : /* istanbul ignore next */ []));
73
+ /** @ignore Displayed value, or the fallback when empty. */
74
+ this.displayValue = computed(() => {
75
+ const v = this.value();
76
+ if (v === null || v === undefined || v === '')
77
+ return this.fallback();
78
+ return String(v);
79
+ }, /* @ts-ignore */
80
+ ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
81
+ /** @ignore The displayed value is the fallback placeholder (styled muted). */
82
+ this.isFallback = computed(() => {
83
+ const v = this.value();
84
+ return v === null || v === undefined || v === '';
85
+ }, /* @ts-ignore */
86
+ ...(ngDevMode ? [{ debugName: "isFallback" }] : /* istanbul ignore next */ []));
87
+ /** @ignore Root (row) classes: base + modifiers + passthrough `rowClass`. */
88
+ this.rootClasses = computed(() => {
89
+ const c = ['ui-read-only'];
90
+ const layout = this.layout();
91
+ if (layout === 'horizontal')
92
+ c.push('_horizontal');
93
+ else if (layout === 'grid')
94
+ c.push('_grid');
95
+ if (this.size() !== 'default')
96
+ c.push(`_${this.size()}`);
97
+ if (this.labelAlign() === 'right')
98
+ c.push('_label-right');
99
+ if (this.matchField())
100
+ c.push('_match-field');
101
+ const extra = this.rowClass();
102
+ if (extra)
103
+ c.push(extra);
104
+ return c.join(' ');
105
+ }, /* @ts-ignore */
106
+ ...(ngDevMode ? [{ debugName: "rootClasses" }] : /* istanbul ignore next */ []));
107
+ /** @ignore Label-cell classes: base + passthrough `labelClass`. */
108
+ this.labelClasses = computed(() => {
109
+ const extra = this.labelClass();
110
+ return extra ? `ui-read-only-label ${extra}` : 'ui-read-only-label';
111
+ }, /* @ts-ignore */
112
+ ...(ngDevMode ? [{ debugName: "labelClasses" }] : /* istanbul ignore next */ []));
113
+ /** @ignore Value-cell classes: base + passthrough `valueClass`. */
114
+ this.valueCellClasses = computed(() => {
115
+ const extra = this.valueClass();
116
+ return extra ? `ui-read-only-value-cell ${extra}` : 'ui-read-only-value-cell';
117
+ }, /* @ts-ignore */
118
+ ...(ngDevMode ? [{ debugName: "valueCellClasses" }] : /* istanbul ignore next */ []));
119
+ // Detect projected content once (SSR-safe, browser only) — mirrors ui-button.
120
+ afterNextRender(() => {
121
+ const el = this.projectedWrap()?.nativeElement;
122
+ const has = !!el &&
123
+ Array.from(el.childNodes).some((n) => n.nodeType === Node.ELEMENT_NODE || (n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim()));
124
+ this.hasProjectedContent.set(has);
125
+ });
126
+ }
127
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: UiReadOnly, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
128
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: UiReadOnly, isStandalone: true, selector: "ui-read-only", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, labelTemplate: { classPropertyName: "labelTemplate", publicName: "labelTemplate", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, fallback: { classPropertyName: "fallback", publicName: "fallback", isSignal: true, isRequired: false, transformFunction: null }, emptyLabel: { classPropertyName: "emptyLabel", publicName: "emptyLabel", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, labelAlign: { classPropertyName: "labelAlign", publicName: "labelAlign", isSignal: true, isRequired: false, transformFunction: null }, labelWidth: { classPropertyName: "labelWidth", publicName: "labelWidth", isSignal: true, isRequired: false, transformFunction: null }, multiline: { classPropertyName: "multiline", publicName: "multiline", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: true, isRequired: false, transformFunction: null }, matchField: { classPropertyName: "matchField", publicName: "matchField", isSignal: true, isRequired: false, transformFunction: null }, rowClass: { classPropertyName: "rowClass", publicName: "rowClass", isSignal: true, isRequired: false, transformFunction: null }, labelClass: { classPropertyName: "labelClass", publicName: "labelClass", isSignal: true, isRequired: false, transformFunction: null }, valueClass: { classPropertyName: "valueClass", publicName: "valueClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.display": "inline() ? 'inline-block' : 'block'" } }, viewQueries: [{ propertyName: "projectedWrap", first: true, predicate: ["projectedWrap"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (hasLabel()) {\n <dl [class]=\"rootClasses()\" [style.--ui-read-only-label-width]=\"labelWidth()\">\n <dt [class]=\"labelClasses()\">\n @if (labelTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <ui-label [label]=\"label()!\" [size]=\"size()\" [required]=\"required()\" />\n }\n </dt>\n <dd [class]=\"valueCellClasses()\">\n <ng-container [ngTemplateOutlet]=\"valueBlock\" />\n </dd>\n </dl>\n} @else {\n <!-- No label \u2192 no <dl> (a <dd> without a <dt> would be invalid markup). -->\n <div [class]=\"rootClasses()\">\n <div [class]=\"valueCellClasses()\">\n <ng-container [ngTemplateOutlet]=\"valueBlock\" />\n </div>\n </div>\n}\n\n<ng-template #valueBlock>\n <!-- Projected rich value (badge, link\u2026). Wrapper is measured after render. -->\n <span #projectedWrap class=\"ui-read-only-projected\"><ng-content /></span>\n\n @if (!hasProjectedContent()) {\n @if (isFallback() && emptyLabel()) {\n <!-- Empty: show the fallback symbol visually, announce meaningful text. -->\n <span class=\"ui-read-only-value _fallback\" [class._multiline]=\"multiline()\">\n <span aria-hidden=\"true\">{{ displayValue() }}</span>\n <span class=\"ui-read-only-sr\">{{ emptyLabel() }}</span>\n </span>\n } @else {\n <span\n class=\"ui-read-only-value\"\n [class._fallback]=\"isFallback()\"\n [class._multiline]=\"multiline()\"\n >{{ displayValue() }}</span\n >\n }\n }\n</ng-template>\n", styles: [".ui-read-only{margin:0;font-family:var(--fontfamily-base)}.ui-read-only:not(._grid){display:flex}.ui-read-only:not(._grid):not(._horizontal){flex-direction:column;gap:var(--units-2xs)}.ui-read-only._horizontal{flex-direction:row;align-items:baseline;gap:var(--units-default)}.ui-read-only._horizontal .ui-read-only-label{flex:0 0 var(--ui-read-only-label-width, auto)}.ui-read-only._horizontal .ui-read-only-value-cell{flex:1 1 auto}.ui-read-only-label{margin:0}.ui-read-only-value-cell{margin:0;min-width:0;color:var(--global-text-default)}.ui-read-only-value{font-size:var(--size-typography-text-default);font-weight:var(--weight-regular);line-height:1.3}.ui-read-only-value._fallback{color:var(--global-text-muted)}.ui-read-only-value._multiline{white-space:pre-line}.ui-read-only-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.ui-read-only._small .ui-read-only-value{font-size:var(--size-typography-text-md)}.ui-read-only._label-right .ui-read-only-label{text-align:right}.ui-read-only._match-field:not(._grid):not(._horizontal){gap:var(--units-sm)}.ui-read-only._small._match-field:not(._grid):not(._horizontal){gap:var(--units-xs)}.ui-read-only._match-field .ui-read-only-value-cell{display:flex;align-items:center;min-height:var(--size-components-default)}.ui-read-only._small._match-field .ui-read-only-value-cell{min-height:var(--size-components-sm)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: UiLabel, selector: "ui-label", inputs: ["label", "required", "size", "for", "disabled"] }] }); }
129
+ }
130
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: UiReadOnly, decorators: [{
131
+ type: Component,
132
+ args: [{ selector: 'ui-read-only', imports: [NgTemplateOutlet, UiLabel], host: {
133
+ '[style.display]': "inline() ? 'inline-block' : 'block'",
134
+ }, template: "@if (hasLabel()) {\n <dl [class]=\"rootClasses()\" [style.--ui-read-only-label-width]=\"labelWidth()\">\n <dt [class]=\"labelClasses()\">\n @if (labelTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <ui-label [label]=\"label()!\" [size]=\"size()\" [required]=\"required()\" />\n }\n </dt>\n <dd [class]=\"valueCellClasses()\">\n <ng-container [ngTemplateOutlet]=\"valueBlock\" />\n </dd>\n </dl>\n} @else {\n <!-- No label \u2192 no <dl> (a <dd> without a <dt> would be invalid markup). -->\n <div [class]=\"rootClasses()\">\n <div [class]=\"valueCellClasses()\">\n <ng-container [ngTemplateOutlet]=\"valueBlock\" />\n </div>\n </div>\n}\n\n<ng-template #valueBlock>\n <!-- Projected rich value (badge, link\u2026). Wrapper is measured after render. -->\n <span #projectedWrap class=\"ui-read-only-projected\"><ng-content /></span>\n\n @if (!hasProjectedContent()) {\n @if (isFallback() && emptyLabel()) {\n <!-- Empty: show the fallback symbol visually, announce meaningful text. -->\n <span class=\"ui-read-only-value _fallback\" [class._multiline]=\"multiline()\">\n <span aria-hidden=\"true\">{{ displayValue() }}</span>\n <span class=\"ui-read-only-sr\">{{ emptyLabel() }}</span>\n </span>\n } @else {\n <span\n class=\"ui-read-only-value\"\n [class._fallback]=\"isFallback()\"\n [class._multiline]=\"multiline()\"\n >{{ displayValue() }}</span\n >\n }\n }\n</ng-template>\n", styles: [".ui-read-only{margin:0;font-family:var(--fontfamily-base)}.ui-read-only:not(._grid){display:flex}.ui-read-only:not(._grid):not(._horizontal){flex-direction:column;gap:var(--units-2xs)}.ui-read-only._horizontal{flex-direction:row;align-items:baseline;gap:var(--units-default)}.ui-read-only._horizontal .ui-read-only-label{flex:0 0 var(--ui-read-only-label-width, auto)}.ui-read-only._horizontal .ui-read-only-value-cell{flex:1 1 auto}.ui-read-only-label{margin:0}.ui-read-only-value-cell{margin:0;min-width:0;color:var(--global-text-default)}.ui-read-only-value{font-size:var(--size-typography-text-default);font-weight:var(--weight-regular);line-height:1.3}.ui-read-only-value._fallback{color:var(--global-text-muted)}.ui-read-only-value._multiline{white-space:pre-line}.ui-read-only-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.ui-read-only._small .ui-read-only-value{font-size:var(--size-typography-text-md)}.ui-read-only._label-right .ui-read-only-label{text-align:right}.ui-read-only._match-field:not(._grid):not(._horizontal){gap:var(--units-sm)}.ui-read-only._small._match-field:not(._grid):not(._horizontal){gap:var(--units-xs)}.ui-read-only._match-field .ui-read-only-value-cell{display:flex;align-items:center;min-height:var(--size-components-default)}.ui-read-only._small._match-field .ui-read-only-value-cell{min-height:var(--size-components-sm)}\n"] }]
135
+ }], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], labelTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelTemplate", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], fallback: [{ type: i0.Input, args: [{ isSignal: true, alias: "fallback", required: false }] }], emptyLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyLabel", required: false }] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], labelAlign: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelAlign", required: false }] }], labelWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelWidth", required: false }] }], multiline: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiline", required: false }] }], inline: [{ type: i0.Input, args: [{ isSignal: true, alias: "inline", required: false }] }], matchField: [{ type: i0.Input, args: [{ isSignal: true, alias: "matchField", required: false }] }], rowClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowClass", required: false }] }], labelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelClass", required: false }] }], valueClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueClass", required: false }] }], projectedWrap: [{ type: i0.ViewChild, args: ['projectedWrap', { isSignal: true }] }] } });
136
+
137
+ /*
138
+ * Public API Surface of ui-kit/ui-read-only
139
+ */
140
+
141
+ /**
142
+ * Generated bundle index. Do not edit.
143
+ */
144
+
145
+ export { UiReadOnly };
146
+ //# sourceMappingURL=4sh-ui-kit-ui-read-only.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"4sh-ui-kit-ui-read-only.mjs","sources":["../../../projects/ui-kit/ui-read-only/src/lib/ui-read-only.ts","../../../projects/ui-kit/ui-read-only/src/lib/ui-read-only.html","../../../projects/ui-kit/ui-read-only/src/public-api.ts","../../../projects/ui-kit/ui-read-only/src/4sh-ui-kit-ui-read-only.ts"],"sourcesContent":["import {\n afterNextRender,\n booleanAttribute,\n Component,\n computed,\n ElementRef,\n input,\n signal,\n TemplateRef,\n viewChild,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { UiLabel } from '@4sh/ui-kit/ui-label';\n\nexport type ReadOnlySize = 'default' | 'small';\nexport type ReadOnlyLayout = 'vertical' | 'horizontal' | 'grid';\nexport type ReadOnlyAlign = 'left' | 'right';\n\n/**\n * ui-read-only — displays a labelled value in read-only mode.\n */\n@Component({\n selector: 'ui-read-only',\n imports: [NgTemplateOutlet, UiLabel],\n templateUrl: './ui-read-only.html',\n styleUrl: './ui-read-only.scss',\n host: {\n '[style.display]': \"inline() ? 'inline-block' : 'block'\",\n },\n})\nexport class UiReadOnly {\n /** Field label (plain string — i18n is the caller's responsibility). Rendered via `ui-label`. */\n label = input<string>();\n /** Shows the required marker (*) on the label — for parity with a required field. */\n required = input(false, { transform: booleanAttribute });\n /** Fully custom label markup, replacing the default `ui-label` (escape hatch). */\n labelTemplate = input<TemplateRef<unknown>>();\n /** Displayed value. Ignored when content is projected. */\n value = input<string | number | null | undefined>();\n /** Shown (muted) when the value is null / undefined / empty. */\n fallback = input<string>('—');\n /**\n * Accessible text announced in place of the `fallback` symbol when the value\n * is empty (e.g. \"Non renseigné\"). The visual `fallback` stays decorative.\n */\n emptyLabel = input<string>();\n /** Stacked (`vertical`), side-by-side (`horizontal`), or grid-driven (`grid`). */\n layout = input<ReadOnlyLayout>('vertical');\n /** Text/label size. */\n size = input<ReadOnlySize>('default');\n /** Label text alignment (horizontal layout only). */\n labelAlign = input<ReadOnlyAlign>('left');\n /** Label column width in horizontal layout (any CSS length, e.g. `160px`, `30%`). Unset = hug content. */\n labelWidth = input<string>();\n /** Preserve line breaks in the value (`white-space: pre-line`). */\n multiline = input(false, { transform: booleanAttribute });\n /** Hug content and flow inline instead of filling the container. */\n inline = input(false, { transform: booleanAttribute });\n /**\n * Adapt the layout to sit alongside form fields\n */\n matchField = input(false, { transform: booleanAttribute });\n\n // --- Layout passthrough (grid / utility systems) ---------------------\n // Classes forwarded verbatim onto the row / label cell / value cell, so any\n // grid or utility system drives the layout (e.g. Gridaflex `flex-x` on the\n // row + `cell phone-24 desktop-auto` on the cells). Additive in every layout.\n /** Extra classes on the row (`<dl>`), e.g. a grid row class like `flex-x`. */\n rowClass = input<string>();\n /** Extra classes on the label cell (`<dt>`), e.g. `cell phone-24 desktop-auto`. */\n labelClass = input<string>();\n /** Extra classes on the value cell (`<dd>`), e.g. `cell phone-24 desktop-auto`. */\n valueClass = input<string>();\n\n /** @ignore Wrapper around <ng-content>, used to detect projected content. */\n private readonly projectedWrap = viewChild<ElementRef<HTMLElement>>('projectedWrap');\n /** @ignore Rich value was projected via <ng-content>. */\n protected readonly hasProjectedContent = signal(false);\n\n constructor() {\n // Detect projected content once (SSR-safe, browser only) — mirrors ui-button.\n afterNextRender(() => {\n const el = this.projectedWrap()?.nativeElement;\n const has =\n !!el &&\n Array.from(el.childNodes).some(\n (n) => n.nodeType === Node.ELEMENT_NODE || (n.nodeType === Node.TEXT_NODE && !!n.textContent?.trim()),\n );\n this.hasProjectedContent.set(has);\n });\n }\n\n /** @ignore A label is provided (drives the <dl>/<dt>/<dd> vs plain markup). */\n protected readonly hasLabel = computed(() => !!this.label() || !!this.labelTemplate());\n\n /** @ignore Displayed value, or the fallback when empty. */\n protected readonly displayValue = computed(() => {\n const v = this.value();\n if (v === null || v === undefined || v === '') return this.fallback();\n return String(v);\n });\n\n /** @ignore The displayed value is the fallback placeholder (styled muted). */\n protected readonly isFallback = computed(() => {\n const v = this.value();\n return v === null || v === undefined || v === '';\n });\n\n /** @ignore Root (row) classes: base + modifiers + passthrough `rowClass`. */\n protected readonly rootClasses = computed(() => {\n const c = ['ui-read-only'];\n const layout = this.layout();\n if (layout === 'horizontal') c.push('_horizontal');\n else if (layout === 'grid') c.push('_grid');\n if (this.size() !== 'default') c.push(`_${this.size()}`);\n if (this.labelAlign() === 'right') c.push('_label-right');\n if (this.matchField()) c.push('_match-field');\n const extra = this.rowClass();\n if (extra) c.push(extra);\n return c.join(' ');\n });\n\n /** @ignore Label-cell classes: base + passthrough `labelClass`. */\n protected readonly labelClasses = computed(() => {\n const extra = this.labelClass();\n return extra ? `ui-read-only-label ${extra}` : 'ui-read-only-label';\n });\n\n /** @ignore Value-cell classes: base + passthrough `valueClass`. */\n protected readonly valueCellClasses = computed(() => {\n const extra = this.valueClass();\n return extra ? `ui-read-only-value-cell ${extra}` : 'ui-read-only-value-cell';\n });\n}\n","@if (hasLabel()) {\n <dl [class]=\"rootClasses()\" [style.--ui-read-only-label-width]=\"labelWidth()\">\n <dt [class]=\"labelClasses()\">\n @if (labelTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <ui-label [label]=\"label()!\" [size]=\"size()\" [required]=\"required()\" />\n }\n </dt>\n <dd [class]=\"valueCellClasses()\">\n <ng-container [ngTemplateOutlet]=\"valueBlock\" />\n </dd>\n </dl>\n} @else {\n <!-- No label → no <dl> (a <dd> without a <dt> would be invalid markup). -->\n <div [class]=\"rootClasses()\">\n <div [class]=\"valueCellClasses()\">\n <ng-container [ngTemplateOutlet]=\"valueBlock\" />\n </div>\n </div>\n}\n\n<ng-template #valueBlock>\n <!-- Projected rich value (badge, link…). Wrapper is measured after render. -->\n <span #projectedWrap class=\"ui-read-only-projected\"><ng-content /></span>\n\n @if (!hasProjectedContent()) {\n @if (isFallback() && emptyLabel()) {\n <!-- Empty: show the fallback symbol visually, announce meaningful text. -->\n <span class=\"ui-read-only-value _fallback\" [class._multiline]=\"multiline()\">\n <span aria-hidden=\"true\">{{ displayValue() }}</span>\n <span class=\"ui-read-only-sr\">{{ emptyLabel() }}</span>\n </span>\n } @else {\n <span\n class=\"ui-read-only-value\"\n [class._fallback]=\"isFallback()\"\n [class._multiline]=\"multiline()\"\n >{{ displayValue() }}</span\n >\n }\n }\n</ng-template>\n","/*\n * Public API Surface of ui-kit/ui-read-only\n */\n\nexport * from './lib/ui-read-only';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAkBA;;AAEG;MAUU,UAAU,CAAA;AAiDrB,IAAA,WAAA,GAAA;;AA/CA,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK;6FAAU;;QAEvB,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,E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