@4sh/ui-kit 0.6.1 → 0.8.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 (154) hide show
  1. package/README.fr.md +47 -22
  2. package/README.md +46 -23
  3. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs +1 -1
  4. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs.map +1 -1
  5. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +5 -3
  6. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
  7. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
  8. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs +439 -0
  9. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs.map +1 -0
  10. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs.map +1 -1
  11. package/fesm2022/4sh-ui-kit-base-ui-image.mjs +111 -10
  12. package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
  13. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +14 -6
  14. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
  15. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs.map +1 -1
  16. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +655 -92
  17. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
  18. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +1107 -0
  19. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -0
  20. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +43 -3
  21. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
  22. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs +5 -3
  23. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
  24. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
  25. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +8 -2
  26. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
  27. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +15 -2
  28. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
  29. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs.map +1 -1
  30. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +8 -4
  31. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
  32. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +40 -4
  33. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
  34. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs +282 -0
  35. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs.map +1 -0
  36. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs +2 -2
  37. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs.map +1 -1
  38. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs +1 -1
  39. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
  40. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs.map +1 -1
  41. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs.map +1 -1
  42. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs +6 -4
  43. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
  44. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +8 -3
  45. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
  46. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs.map +1 -1
  47. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs +317 -0
  48. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs.map +1 -0
  49. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +8 -2
  50. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
  51. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs +374 -0
  52. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs.map +1 -0
  53. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs.map +1 -1
  54. package/fesm2022/4sh-ui-kit-forms.mjs +49 -14
  55. package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -1
  56. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs.map +1 -1
  57. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
  58. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs.map +1 -1
  59. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs.map +1 -1
  60. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs +2 -2
  61. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs.map +1 -1
  62. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs +2 -2
  63. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs.map +1 -1
  64. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs.map +1 -1
  65. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs.map +1 -1
  66. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs.map +1 -1
  67. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs.map +1 -1
  68. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs.map +1 -1
  69. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs.map +1 -1
  70. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs.map +1 -1
  71. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs +2 -2
  72. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs.map +1 -1
  73. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
  74. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs +2 -2
  75. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs.map +1 -1
  76. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs.map +1 -1
  77. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
  78. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +45 -4
  79. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
  80. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs.map +1 -1
  81. package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -1
  82. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs +370 -0
  83. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs.map +1 -0
  84. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs +2 -2
  85. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs.map +1 -1
  86. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs +5 -3
  87. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs.map +1 -1
  88. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs +5 -3
  89. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
  90. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +5 -3
  91. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
  92. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +22 -10
  93. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
  94. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +19 -4
  95. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
  96. package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -1
  97. package/fesm2022/4sh-ui-kit-ripple.mjs +298 -0
  98. package/fesm2022/4sh-ui-kit-ripple.mjs.map +1 -0
  99. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +5 -3
  100. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
  101. package/fesm2022/4sh-ui-kit-table-ui-table.mjs +2 -2
  102. package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
  103. package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -1
  104. package/fesm2022/4sh-ui-kit.mjs.map +1 -1
  105. package/mcp/data/text-search-docs.json +1083 -83
  106. package/mcp/data/ui-config.json +5592 -2586
  107. package/mcp/index.js +682 -410
  108. package/mcp/package.json +1 -1
  109. package/package.json +29 -1
  110. package/schematics/index.cjs +1 -1
  111. package/styles/base/_ripple.scss +53 -0
  112. package/styles/component-vars.scss +177 -2
  113. package/styles/generated/_tokens-breakpoint.scss +1 -1
  114. package/styles/generated/_tokens-metrics.scss +1 -1
  115. package/styles/generated/_tokens-primitives.scss +1 -1
  116. package/styles/generated/_tokens-responsive.scss +17 -17
  117. package/styles/generated/_tokens-semantics.scss +15 -15
  118. package/styles/generated/_tokens-styles.scss +1 -1
  119. package/styles/generated/_tokens-transitions.scss +1 -1
  120. package/styles/generated/_tokens-typography.scss +1 -1
  121. package/styles/generated/_tokens.scss +1 -1
  122. package/styles/index.scss +1 -0
  123. package/styles/settings/_ui-config.scss +9 -0
  124. package/styles/utils/_helpers.scss +15 -0
  125. package/styles/utils/_mixins.scss +17 -1
  126. package/styles.css +1 -1
  127. package/types/4sh-ui-kit-actions-ui-button.d.ts +3 -1
  128. package/types/4sh-ui-kit-actions-ui-speed-dial.d.ts +234 -0
  129. package/types/4sh-ui-kit-base-ui-image.d.ts +16 -3
  130. package/types/4sh-ui-kit-forms-ui-autocomplete.d.ts +7 -2
  131. package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +242 -37
  132. package/types/4sh-ui-kit-forms-ui-editor.d.ts +481 -0
  133. package/types/4sh-ui-kit-forms-ui-field.d.ts +32 -2
  134. package/types/4sh-ui-kit-forms-ui-file-upload.d.ts +3 -1
  135. package/types/4sh-ui-kit-forms-ui-input-mask.d.ts +4 -0
  136. package/types/4sh-ui-kit-forms-ui-input-number.d.ts +9 -0
  137. package/types/4sh-ui-kit-forms-ui-input-tags.d.ts +4 -1
  138. package/types/4sh-ui-kit-forms-ui-input.d.ts +28 -2
  139. package/types/4sh-ui-kit-forms-ui-knob.d.ts +93 -0
  140. package/types/4sh-ui-kit-forms-ui-segment-control.d.ts +3 -1
  141. package/types/4sh-ui-kit-forms-ui-select.d.ts +5 -1
  142. package/types/4sh-ui-kit-forms-ui-swatch-picker.d.ts +126 -0
  143. package/types/4sh-ui-kit-forms-ui-textarea.d.ts +4 -0
  144. package/types/4sh-ui-kit-forms-ui-toggle-button.d.ts +222 -0
  145. package/types/4sh-ui-kit-forms.d.ts +38 -7
  146. package/types/4sh-ui-kit-layout-ui-modal.d.ts +7 -0
  147. package/types/4sh-ui-kit-navigation-ui-bottom-tab-bar.d.ts +201 -0
  148. package/types/4sh-ui-kit-navigation-ui-context-menu.d.ts +3 -1
  149. package/types/4sh-ui-kit-navigation-ui-menu.d.ts +3 -1
  150. package/types/4sh-ui-kit-navigation-ui-sidebar.d.ts +3 -1
  151. package/types/4sh-ui-kit-navigation-ui-stepper.d.ts +8 -3
  152. package/types/4sh-ui-kit-navigation-ui-tabs.d.ts +16 -3
  153. package/types/4sh-ui-kit-ripple.d.ts +156 -0
  154. package/types/4sh-ui-kit-table-ui-paginator.d.ts +3 -1
@@ -38,7 +38,12 @@ class UiInput extends BaseFormField {
38
38
  /** `aria-haspopup` forwarded to the native input (popup trigger hosts). */
39
39
  this.ariaHasPopup = input(/* @ts-ignore */
40
40
  ...(ngDevMode ? [undefined, { debugName: "ariaHasPopup" }] : /* istanbul ignore next */ []));
41
- /** `aria-expanded` forwarded to the native input (popup trigger hosts). */
41
+ /**
42
+ * `aria-expanded` forwarded to the native input (popup trigger hosts).
43
+ * Setting it also promotes the input to `role="combobox"`: `aria-expanded`
44
+ * is not allowed on the implicit `textbox` role, so screen readers would
45
+ * silently drop the popup state without it.
46
+ */
42
47
  this.ariaExpanded = input(/* @ts-ignore */
43
48
  ...(ngDevMode ? [undefined, { debugName: "ariaExpanded" }] : /* istanbul ignore next */ []));
44
49
  /** `aria-controls` forwarded to the native input (popup trigger hosts). */
@@ -47,6 +52,14 @@ class UiInput extends BaseFormField {
47
52
  /** Native placeholder. */
48
53
  this.placeholder = input(/* @ts-ignore */
49
54
  ...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
55
+ /**
56
+ * id of an external element describing this control further (e.g. a composite host's own
57
+ * format hint), chained onto `aria-describedby` alongside the helper/error message rather than
58
+ * replacing it — a plain `[attr.aria-describedby]` override on the host would clobber whichever
59
+ * of the two lands last.
60
+ */
61
+ this.ariaDescribedBy = input(/* @ts-ignore */
62
+ ...(ngDevMode ? [undefined, { debugName: "ariaDescribedBy" }] : /* istanbul ignore next */ []));
50
63
  /** Suffix unit (e.g. "%", "@domain"). Shown when provided. */
51
64
  this.unit = input(/* @ts-ignore */
52
65
  ...(ngDevMode ? [undefined, { debugName: "unit" }] : /* istanbul ignore next */ []));
@@ -94,6 +107,15 @@ class UiInput extends BaseFormField {
94
107
  /** @ignore Icon size aligned with the field size. */
95
108
  this.iconSize = computed(() => (this.size() === 'small' ? 'sm' : 'md'), /* @ts-ignore */
96
109
  ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
110
+ /** @ignore Text rendered in the input: display-only `value` wins over the model. */
111
+ this.renderedValue = computed(() => this.value() ?? this.displayValue(), /* @ts-ignore */
112
+ ...(ngDevMode ? [{ debugName: "renderedValue" }] : /* istanbul ignore next */ []));
113
+ /** @ignore Keeps a floating label raised once focus leaves. */
114
+ this.isFilled = computed(() => this.renderedValue() !== '', /* @ts-ignore */
115
+ ...(ngDevMode ? [{ debugName: "isFilled" }] : /* istanbul ignore next */ []));
116
+ /** @ignore At rest the floating label already holds that spot. */
117
+ this.effectivePlaceholder = computed(() => this.hasFloatLabel() ? '' : (this.placeholder() ?? ''), /* @ts-ignore */
118
+ ...(ngDevMode ? [{ debugName: "effectivePlaceholder" }] : /* istanbul ignore next */ []));
97
119
  /** @ignore Input wins over the projected `#iconLeft` template. */
98
120
  this.resolvedIconLeftTemplate = computed(() => this.iconLeftTemplate() ?? this.iconLeftTemplateContent(), /* @ts-ignore */
99
121
  ...(ngDevMode ? [{ debugName: "resolvedIconLeftTemplate" }] : /* istanbul ignore next */ []));
@@ -117,6 +139,20 @@ class UiInput extends BaseFormField {
117
139
  /** @ignore The right icon is an action zone (has an accessible name). */
118
140
  this.hasRightAction = computed(() => (!!this.iconRight() || !!this.resolvedIconRightTemplate()) && !!this.iconRightAriaLabel(), /* @ts-ignore */
119
141
  ...(ngDevMode ? [{ debugName: "hasRightAction" }] : /* istanbul ignore next */ []));
142
+ /** @ignore Full `aria-describedby`: the helper/error message id (only when a message is
143
+ * actually rendered) plus the externally supplied `ariaDescribedBy`, space-joined — `null`
144
+ * when neither applies (native attribute is then omitted, not left dangling). */
145
+ this.resolvedAriaDescribedBy = computed(() => {
146
+ const ids = [this.displayMessage() ? this.messageId() : null, this.ariaDescribedBy() || null];
147
+ const joined = ids.filter((id) => !!id).join(' ');
148
+ return joined || null;
149
+ }, /* @ts-ignore */
150
+ ...(ngDevMode ? [{ debugName: "resolvedAriaDescribedBy" }] : /* istanbul ignore next */ []));
151
+ /** @ignore ARIA 1.2: only `combobox` (not the implicit `textbox`) accepts
152
+ * `aria-expanded`. Stays null for plain text fields so their announcement
153
+ * ("edit text") is untouched. */
154
+ this.nativeRole = computed(() => (this.ariaExpanded() === undefined ? null : 'combobox'), /* @ts-ignore */
155
+ ...(ngDevMode ? [{ debugName: "nativeRole" }] : /* istanbul ignore next */ []));
120
156
  }
121
157
  /** Focuses the input. */
122
158
  focus(options) {
@@ -140,12 +176,12 @@ class UiInput extends BaseFormField {
140
176
  this.inputBlur.emit(event);
141
177
  }
142
178
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: UiInput, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
143
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.2", type: UiInput, isStandalone: true, selector: "ui-input", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, ariaHasPopup: { classPropertyName: "ariaHasPopup", publicName: "ariaHasPopup", isSignal: true, isRequired: false, transformFunction: null }, ariaExpanded: { classPropertyName: "ariaExpanded", publicName: "ariaExpanded", isSignal: true, isRequired: false, transformFunction: null }, ariaControls: { classPropertyName: "ariaControls", publicName: "ariaControls", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, unit: { classPropertyName: "unit", publicName: "unit", isSignal: true, isRequired: false, transformFunction: null }, iconLeft: { classPropertyName: "iconLeft", publicName: "iconLeft", isSignal: true, isRequired: false, transformFunction: null }, iconRight: { classPropertyName: "iconRight", publicName: "iconRight", isSignal: true, isRequired: false, transformFunction: null }, iconRightAriaLabel: { classPropertyName: "iconRightAriaLabel", publicName: "iconRightAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null }, iconLeftTemplate: { classPropertyName: "iconLeftTemplate", publicName: "iconLeftTemplate", isSignal: true, isRequired: false, transformFunction: null }, iconRightTemplate: { classPropertyName: "iconRightTemplate", publicName: "iconRightTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", iconRightClick: "iconRightClick", inputFocus: "inputFocus", inputBlur: "inputBlur" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInput), multi: true }], queries: [{ propertyName: "iconLeftTemplateContent", first: true, predicate: ["iconLeft"], descendants: true, isSignal: true }, { propertyName: "iconRightTemplateContent", first: true, predicate: ["iconRight"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ui-field\n [label]=\"label()\"\n [for]=\"resolvedId()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n>\n @if (resolvedIconLeftTemplate(); as tpl) {\n <span uiFieldPrefix class=\"ui-input-icon\" [class._disabled]=\"isDisabled()\">\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"leftIconContext()\" />\n </span>\n } @else if (iconLeft(); as name) {\n <ui-icon\n uiFieldPrefix\n class=\"ui-input-icon\"\n [class._disabled]=\"isDisabled()\"\n [name]=\"name\"\n [size]=\"iconSize()\"\n />\n }\n\n <input\n #inputEl\n class=\"ui-input-native\"\n [class._small]=\"size() === 'small'\"\n [type]=\"type()\"\n [id]=\"resolvedId()\"\n [value]=\"value() ?? displayValue()\"\n [placeholder]=\"placeholder() ?? ''\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.autocomplete]=\"autocomplete() || null\"\n [attr.maxlength]=\"maxlength()\"\n [attr.aria-haspopup]=\"ariaHasPopup() || null\"\n [attr.aria-expanded]=\"ariaExpanded() ?? null\"\n [attr.aria-controls]=\"ariaControls() || null\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"displayMessage() ? messageId() : null\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput()\"\n (focus)=\"inputFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n @if (unit(); as u) {\n <span\n uiFieldSuffix\n class=\"ui-input-unit\"\n [class._small]=\"size() === 'small'\"\n [class._disabled]=\"isDisabled()\"\n >{{ u }}</span\n >\n }\n\n @if (iconRight() || resolvedIconRightTemplate()) {\n @if (hasRightAction()) {\n <button\n uiFieldSuffix\n type=\"button\"\n class=\"ui-input-action\"\n [attr.aria-label]=\"iconRightAriaLabel()\"\n [disabled]=\"isDisabled()\"\n (click)=\"iconRightClick.emit($event)\"\n >\n @if (resolvedIconRightTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"rightIconContext()\" />\n } @else {\n <ui-icon [name]=\"iconRight()!\" [size]=\"iconSize()\" />\n }\n </button>\n } @else if (resolvedIconRightTemplate(); as tpl) {\n <span uiFieldSuffix class=\"ui-input-icon\" [class._disabled]=\"isDisabled()\">\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"rightIconContext()\" />\n </span>\n } @else {\n <ui-icon\n uiFieldSuffix\n class=\"ui-input-icon\"\n [class._disabled]=\"isDisabled()\"\n [name]=\"iconRight()!\"\n [size]=\"iconSize()\"\n />\n }\n }\n</ui-field>\n", styles: [".ui-input-native{flex:1 1 auto;align-self:stretch;min-width:0;margin:0;padding:0;border:none;border-radius:inherit;background:transparent;outline:none;font-family:var(--fontfamily-base);font-size:var(--size-typography-text-default);color:var(--form-high-content-default)}.ui-input-native:first-child{padding-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-native:last-child{padding-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-native::placeholder{color:var(--form-low-content-default);opacity:1}.ui-input-native:disabled{cursor:not-allowed;color:var(--form-high-content-disabled)}.ui-input-native._small{font-size:var(--ui-input-font-size-small, var(--size-typography-text-md))}.ui-input-icon{flex-shrink:0;color:var(--form-low-content-default)}.ui-input-icon:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-icon:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-icon._disabled{color:var(--form-high-content-disabled)}.ui-input-unit{flex-shrink:0;color:var(--form-low-content-default)}.ui-input-unit:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-unit:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-unit._disabled{color:var(--form-high-content-disabled)}.ui-input-unit{font-family:var(--fontfamily-base);font-size:var(--ui-input-unit-font-size, var(--size-typography-text-default));white-space:nowrap;-webkit-user-select:none;user-select:none}.ui-input-unit._small{font-size:var(--ui-input-font-size-small, var(--size-typography-text-md))}.ui-input-action{display:flex;align-items:center;justify-content:center;align-self:stretch;aspect-ratio:1;flex-shrink:0;padding:0;border:none;background:none;border-radius:0 calc(var(--ui-form-field-radius, var(--radius-sm)) - var(--ui-control-stroke-width, var(--stroke-default))) calc(var(--ui-form-field-radius, var(--radius-sm)) - var(--ui-control-stroke-width, var(--stroke-default))) 0;color:var(--form-low-content-default);cursor:pointer;transition:color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),background-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-input-action:hover:not(:disabled){color:var(--form-high-content-hover);background-color:var(--form-high-surface-hover)}.ui-input-action:focus-visible{outline:none;color:var(--form-high-content-focused);background-color:var(--form-high-surface-focused)}.ui-input-action:disabled{cursor:not-allowed;color:var(--form-high-content-disabled)}\n"], dependencies: [{ kind: "component", type: UiField, selector: "ui-field", inputs: ["label", "for", "required", "size", "level", "disabled", "readonly", "multiline", "autoHeight", "message", "messageId", "hasFooter"] }, { kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
179
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.2", type: UiInput, isStandalone: true, selector: "ui-input", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, ariaHasPopup: { classPropertyName: "ariaHasPopup", publicName: "ariaHasPopup", isSignal: true, isRequired: false, transformFunction: null }, ariaExpanded: { classPropertyName: "ariaExpanded", publicName: "ariaExpanded", isSignal: true, isRequired: false, transformFunction: null }, ariaControls: { classPropertyName: "ariaControls", publicName: "ariaControls", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", isSignal: true, isRequired: false, transformFunction: null }, unit: { classPropertyName: "unit", publicName: "unit", isSignal: true, isRequired: false, transformFunction: null }, iconLeft: { classPropertyName: "iconLeft", publicName: "iconLeft", isSignal: true, isRequired: false, transformFunction: null }, iconRight: { classPropertyName: "iconRight", publicName: "iconRight", isSignal: true, isRequired: false, transformFunction: null }, iconRightAriaLabel: { classPropertyName: "iconRightAriaLabel", publicName: "iconRightAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null }, iconLeftTemplate: { classPropertyName: "iconLeftTemplate", publicName: "iconLeftTemplate", isSignal: true, isRequired: false, transformFunction: null }, iconRightTemplate: { classPropertyName: "iconRightTemplate", publicName: "iconRightTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", iconRightClick: "iconRightClick", inputFocus: "inputFocus", inputBlur: "inputBlur" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInput), multi: true }], queries: [{ propertyName: "iconLeftTemplateContent", first: true, predicate: ["iconLeft"], descendants: true, isSignal: true }, { propertyName: "iconRightTemplateContent", first: true, predicate: ["iconRight"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ui-field\n [label]=\"label()\"\n [for]=\"resolvedId()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [floatLabel]=\"floatLabel()\"\n [filled]=\"isFilled()\"\n [hasPrefix]=\"!!iconLeft() || !!resolvedIconLeftTemplate()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n @if (resolvedIconLeftTemplate(); as tpl) {\n <span uiFieldPrefix class=\"ui-input-icon\" [class._disabled]=\"isDisabled()\">\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"leftIconContext()\" />\n </span>\n } @else if (iconLeft(); as name) {\n <ui-icon\n uiFieldPrefix\n class=\"ui-input-icon\"\n [class._disabled]=\"isDisabled()\"\n [name]=\"name\"\n [size]=\"iconSize()\"\n />\n }\n\n <input\n #inputEl\n class=\"ui-input-native\"\n [class._small]=\"size() === 'small'\"\n [type]=\"type()\"\n [id]=\"resolvedId()\"\n [value]=\"renderedValue()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.autocomplete]=\"autocomplete() || null\"\n [attr.maxlength]=\"maxlength()\"\n [attr.role]=\"nativeRole()\"\n [attr.aria-haspopup]=\"ariaHasPopup() || null\"\n [attr.aria-expanded]=\"ariaExpanded() ?? null\"\n [attr.aria-controls]=\"ariaControls() || null\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"resolvedAriaDescribedBy()\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput()\"\n (focus)=\"inputFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n @if (unit(); as u) {\n <span\n uiFieldSuffix\n class=\"ui-input-unit\"\n [class._small]=\"size() === 'small'\"\n [class._disabled]=\"isDisabled()\"\n >{{ u }}</span\n >\n }\n\n @if (iconRight() || resolvedIconRightTemplate()) {\n @if (hasRightAction()) {\n <button\n uiFieldSuffix\n type=\"button\"\n class=\"ui-input-action\"\n [attr.aria-label]=\"iconRightAriaLabel()\"\n [disabled]=\"isDisabled()\"\n (click)=\"iconRightClick.emit($event)\"\n >\n @if (resolvedIconRightTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"rightIconContext()\" />\n } @else {\n <ui-icon [name]=\"iconRight()!\" [size]=\"iconSize()\" />\n }\n </button>\n } @else if (resolvedIconRightTemplate(); as tpl) {\n <span uiFieldSuffix class=\"ui-input-icon\" [class._disabled]=\"isDisabled()\">\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"rightIconContext()\" />\n </span>\n } @else {\n <ui-icon\n uiFieldSuffix\n class=\"ui-input-icon\"\n [class._disabled]=\"isDisabled()\"\n [name]=\"iconRight()!\"\n [size]=\"iconSize()\"\n />\n }\n }\n</ui-field>\n", styles: [".ui-input-native{flex:1 1 auto;align-self:stretch;min-width:0;margin:0;padding:0;border:none;border-radius:inherit;background:transparent;outline:none;font-family:var(--fontfamily-base);font-size:var(--size-typography-text-default);color:var(--form-high-content-default)}.ui-input-native:first-child{padding-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-native:last-child{padding-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-native{padding-block-start:calc(0px + var(--_field-inset-block-start, 0px))}.ui-input-native::placeholder{color:var(--form-low-content-default);opacity:1}.ui-input-native:disabled{cursor:not-allowed;color:var(--form-high-content-disabled)}.ui-input-native._small{font-size:var(--ui-input-font-size-small, var(--size-typography-text-md))}.ui-input-icon{flex-shrink:0;color:var(--form-low-content-default)}.ui-input-icon:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-icon:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-icon._disabled{color:var(--form-high-content-disabled)}.ui-input-unit{flex-shrink:0;color:var(--form-low-content-default)}.ui-input-unit:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-unit:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-unit._disabled{color:var(--form-high-content-disabled)}.ui-input-unit{font-family:var(--fontfamily-base);font-size:var(--ui-input-unit-font-size, var(--size-typography-text-default));white-space:nowrap;-webkit-user-select:none;user-select:none}.ui-input-unit._small{font-size:var(--ui-input-font-size-small, var(--size-typography-text-md))}.ui-input-action{display:flex;align-items:center;justify-content:center;align-self:stretch;aspect-ratio:1;flex-shrink:0;padding:0;border:none;background:none;border-radius:0 calc(var(--ui-form-field-radius, var(--radius-sm)) - var(--ui-control-stroke-width, var(--stroke-default))) calc(var(--ui-form-field-radius, var(--radius-sm)) - var(--ui-control-stroke-width, var(--stroke-default))) 0;color:var(--form-low-content-default);cursor:pointer;transition:color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),background-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-input-action:hover:not(:disabled){color:var(--form-high-content-hover);background-color:var(--form-high-surface-hover)}.ui-input-action:focus-visible{outline:none;color:var(--form-high-content-focused);background-color:var(--form-high-surface-focused)}.ui-input-action:disabled{cursor:not-allowed;color:var(--form-high-content-disabled)}\n"], dependencies: [{ kind: "component", type: UiField, selector: "ui-field", inputs: ["label", "for", "required", "size", "level", "floatLabel", "filled", "disabled", "readonly", "multiline", "autoHeight", "message", "messageId", "showMessageIcon", "messageIcon", "hasFooter", "hasPrefix"] }, { kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
144
180
  }
145
181
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: UiInput, decorators: [{
146
182
  type: Component,
147
- args: [{ selector: 'ui-input', imports: [UiField, UiIcon, NgTemplateOutlet], providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInput), multi: true }], template: "<ui-field\n [label]=\"label()\"\n [for]=\"resolvedId()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n>\n @if (resolvedIconLeftTemplate(); as tpl) {\n <span uiFieldPrefix class=\"ui-input-icon\" [class._disabled]=\"isDisabled()\">\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"leftIconContext()\" />\n </span>\n } @else if (iconLeft(); as name) {\n <ui-icon\n uiFieldPrefix\n class=\"ui-input-icon\"\n [class._disabled]=\"isDisabled()\"\n [name]=\"name\"\n [size]=\"iconSize()\"\n />\n }\n\n <input\n #inputEl\n class=\"ui-input-native\"\n [class._small]=\"size() === 'small'\"\n [type]=\"type()\"\n [id]=\"resolvedId()\"\n [value]=\"value() ?? displayValue()\"\n [placeholder]=\"placeholder() ?? ''\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.autocomplete]=\"autocomplete() || null\"\n [attr.maxlength]=\"maxlength()\"\n [attr.aria-haspopup]=\"ariaHasPopup() || null\"\n [attr.aria-expanded]=\"ariaExpanded() ?? null\"\n [attr.aria-controls]=\"ariaControls() || null\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"displayMessage() ? messageId() : null\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput()\"\n (focus)=\"inputFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n @if (unit(); as u) {\n <span\n uiFieldSuffix\n class=\"ui-input-unit\"\n [class._small]=\"size() === 'small'\"\n [class._disabled]=\"isDisabled()\"\n >{{ u }}</span\n >\n }\n\n @if (iconRight() || resolvedIconRightTemplate()) {\n @if (hasRightAction()) {\n <button\n uiFieldSuffix\n type=\"button\"\n class=\"ui-input-action\"\n [attr.aria-label]=\"iconRightAriaLabel()\"\n [disabled]=\"isDisabled()\"\n (click)=\"iconRightClick.emit($event)\"\n >\n @if (resolvedIconRightTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"rightIconContext()\" />\n } @else {\n <ui-icon [name]=\"iconRight()!\" [size]=\"iconSize()\" />\n }\n </button>\n } @else if (resolvedIconRightTemplate(); as tpl) {\n <span uiFieldSuffix class=\"ui-input-icon\" [class._disabled]=\"isDisabled()\">\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"rightIconContext()\" />\n </span>\n } @else {\n <ui-icon\n uiFieldSuffix\n class=\"ui-input-icon\"\n [class._disabled]=\"isDisabled()\"\n [name]=\"iconRight()!\"\n [size]=\"iconSize()\"\n />\n }\n }\n</ui-field>\n", styles: [".ui-input-native{flex:1 1 auto;align-self:stretch;min-width:0;margin:0;padding:0;border:none;border-radius:inherit;background:transparent;outline:none;font-family:var(--fontfamily-base);font-size:var(--size-typography-text-default);color:var(--form-high-content-default)}.ui-input-native:first-child{padding-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-native:last-child{padding-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-native::placeholder{color:var(--form-low-content-default);opacity:1}.ui-input-native:disabled{cursor:not-allowed;color:var(--form-high-content-disabled)}.ui-input-native._small{font-size:var(--ui-input-font-size-small, var(--size-typography-text-md))}.ui-input-icon{flex-shrink:0;color:var(--form-low-content-default)}.ui-input-icon:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-icon:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-icon._disabled{color:var(--form-high-content-disabled)}.ui-input-unit{flex-shrink:0;color:var(--form-low-content-default)}.ui-input-unit:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-unit:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-unit._disabled{color:var(--form-high-content-disabled)}.ui-input-unit{font-family:var(--fontfamily-base);font-size:var(--ui-input-unit-font-size, var(--size-typography-text-default));white-space:nowrap;-webkit-user-select:none;user-select:none}.ui-input-unit._small{font-size:var(--ui-input-font-size-small, var(--size-typography-text-md))}.ui-input-action{display:flex;align-items:center;justify-content:center;align-self:stretch;aspect-ratio:1;flex-shrink:0;padding:0;border:none;background:none;border-radius:0 calc(var(--ui-form-field-radius, var(--radius-sm)) - var(--ui-control-stroke-width, var(--stroke-default))) calc(var(--ui-form-field-radius, var(--radius-sm)) - var(--ui-control-stroke-width, var(--stroke-default))) 0;color:var(--form-low-content-default);cursor:pointer;transition:color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),background-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-input-action:hover:not(:disabled){color:var(--form-high-content-hover);background-color:var(--form-high-surface-hover)}.ui-input-action:focus-visible{outline:none;color:var(--form-high-content-focused);background-color:var(--form-high-surface-focused)}.ui-input-action:disabled{cursor:not-allowed;color:var(--form-high-content-disabled)}\n"] }]
148
- }], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], ariaHasPopup: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaHasPopup", required: false }] }], ariaExpanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaExpanded", required: false }] }], ariaControls: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaControls", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], unit: [{ type: i0.Input, args: [{ isSignal: true, alias: "unit", required: false }] }], iconLeft: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconLeft", required: false }] }], iconRight: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconRight", required: false }] }], iconRightAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconRightAriaLabel", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], maxlength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxlength", required: false }] }], iconLeftTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconLeftTemplate", required: false }] }], iconRightTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconRightTemplate", required: false }] }], iconLeftTemplateContent: [{ type: i0.ContentChild, args: ['iconLeft', { isSignal: true }] }], iconRightTemplateContent: [{ type: i0.ContentChild, args: ['iconRight', { isSignal: true }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], iconRightClick: [{ type: i0.Output, args: ["iconRightClick"] }], inputFocus: [{ type: i0.Output, args: ["inputFocus"] }], inputBlur: [{ type: i0.Output, args: ["inputBlur"] }], inputEl: [{ type: i0.ViewChild, args: ['inputEl', { isSignal: true }] }] } });
183
+ args: [{ selector: 'ui-input', imports: [UiField, UiIcon, NgTemplateOutlet], providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInput), multi: true }], template: "<ui-field\n [label]=\"label()\"\n [for]=\"resolvedId()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [floatLabel]=\"floatLabel()\"\n [filled]=\"isFilled()\"\n [hasPrefix]=\"!!iconLeft() || !!resolvedIconLeftTemplate()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n @if (resolvedIconLeftTemplate(); as tpl) {\n <span uiFieldPrefix class=\"ui-input-icon\" [class._disabled]=\"isDisabled()\">\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"leftIconContext()\" />\n </span>\n } @else if (iconLeft(); as name) {\n <ui-icon\n uiFieldPrefix\n class=\"ui-input-icon\"\n [class._disabled]=\"isDisabled()\"\n [name]=\"name\"\n [size]=\"iconSize()\"\n />\n }\n\n <input\n #inputEl\n class=\"ui-input-native\"\n [class._small]=\"size() === 'small'\"\n [type]=\"type()\"\n [id]=\"resolvedId()\"\n [value]=\"renderedValue()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.autocomplete]=\"autocomplete() || null\"\n [attr.maxlength]=\"maxlength()\"\n [attr.role]=\"nativeRole()\"\n [attr.aria-haspopup]=\"ariaHasPopup() || null\"\n [attr.aria-expanded]=\"ariaExpanded() ?? null\"\n [attr.aria-controls]=\"ariaControls() || null\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"resolvedAriaDescribedBy()\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput()\"\n (focus)=\"inputFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n @if (unit(); as u) {\n <span\n uiFieldSuffix\n class=\"ui-input-unit\"\n [class._small]=\"size() === 'small'\"\n [class._disabled]=\"isDisabled()\"\n >{{ u }}</span\n >\n }\n\n @if (iconRight() || resolvedIconRightTemplate()) {\n @if (hasRightAction()) {\n <button\n uiFieldSuffix\n type=\"button\"\n class=\"ui-input-action\"\n [attr.aria-label]=\"iconRightAriaLabel()\"\n [disabled]=\"isDisabled()\"\n (click)=\"iconRightClick.emit($event)\"\n >\n @if (resolvedIconRightTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"rightIconContext()\" />\n } @else {\n <ui-icon [name]=\"iconRight()!\" [size]=\"iconSize()\" />\n }\n </button>\n } @else if (resolvedIconRightTemplate(); as tpl) {\n <span uiFieldSuffix class=\"ui-input-icon\" [class._disabled]=\"isDisabled()\">\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"rightIconContext()\" />\n </span>\n } @else {\n <ui-icon\n uiFieldSuffix\n class=\"ui-input-icon\"\n [class._disabled]=\"isDisabled()\"\n [name]=\"iconRight()!\"\n [size]=\"iconSize()\"\n />\n }\n }\n</ui-field>\n", styles: [".ui-input-native{flex:1 1 auto;align-self:stretch;min-width:0;margin:0;padding:0;border:none;border-radius:inherit;background:transparent;outline:none;font-family:var(--fontfamily-base);font-size:var(--size-typography-text-default);color:var(--form-high-content-default)}.ui-input-native:first-child{padding-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-native:last-child{padding-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-native{padding-block-start:calc(0px + var(--_field-inset-block-start, 0px))}.ui-input-native::placeholder{color:var(--form-low-content-default);opacity:1}.ui-input-native:disabled{cursor:not-allowed;color:var(--form-high-content-disabled)}.ui-input-native._small{font-size:var(--ui-input-font-size-small, var(--size-typography-text-md))}.ui-input-icon{flex-shrink:0;color:var(--form-low-content-default)}.ui-input-icon:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-icon:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-icon._disabled{color:var(--form-high-content-disabled)}.ui-input-unit{flex-shrink:0;color:var(--form-low-content-default)}.ui-input-unit:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-unit:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-unit._disabled{color:var(--form-high-content-disabled)}.ui-input-unit{font-family:var(--fontfamily-base);font-size:var(--ui-input-unit-font-size, var(--size-typography-text-default));white-space:nowrap;-webkit-user-select:none;user-select:none}.ui-input-unit._small{font-size:var(--ui-input-font-size-small, var(--size-typography-text-md))}.ui-input-action{display:flex;align-items:center;justify-content:center;align-self:stretch;aspect-ratio:1;flex-shrink:0;padding:0;border:none;background:none;border-radius:0 calc(var(--ui-form-field-radius, var(--radius-sm)) - var(--ui-control-stroke-width, var(--stroke-default))) calc(var(--ui-form-field-radius, var(--radius-sm)) - var(--ui-control-stroke-width, var(--stroke-default))) 0;color:var(--form-low-content-default);cursor:pointer;transition:color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),background-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-input-action:hover:not(:disabled){color:var(--form-high-content-hover);background-color:var(--form-high-surface-hover)}.ui-input-action:focus-visible{outline:none;color:var(--form-high-content-focused);background-color:var(--form-high-surface-focused)}.ui-input-action:disabled{cursor:not-allowed;color:var(--form-high-content-disabled)}\n"] }]
184
+ }], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], ariaHasPopup: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaHasPopup", required: false }] }], ariaExpanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaExpanded", required: false }] }], ariaControls: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaControls", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedBy", required: false }] }], unit: [{ type: i0.Input, args: [{ isSignal: true, alias: "unit", required: false }] }], iconLeft: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconLeft", required: false }] }], iconRight: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconRight", required: false }] }], iconRightAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconRightAriaLabel", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], maxlength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxlength", required: false }] }], iconLeftTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconLeftTemplate", required: false }] }], iconRightTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconRightTemplate", required: false }] }], iconLeftTemplateContent: [{ type: i0.ContentChild, args: ['iconLeft', { isSignal: true }] }], iconRightTemplateContent: [{ type: i0.ContentChild, args: ['iconRight', { isSignal: true }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], iconRightClick: [{ type: i0.Output, args: ["iconRightClick"] }], inputFocus: [{ type: i0.Output, args: ["inputFocus"] }], inputBlur: [{ type: i0.Output, args: ["inputBlur"] }], inputEl: [{ type: i0.ViewChild, args: ['inputEl', { isSignal: true }] }] } });
149
185
 
150
186
  /*
151
187
  * Public API Surface of ui-kit/ui-input
@@ -1 +1 @@
1
- {"version":3,"file":"4sh-ui-kit-forms-ui-input.mjs","sources":["../../../projects/ui-kit/forms/ui-input/src/lib/ui-input.ts","../../../projects/ui-kit/forms/ui-input/src/lib/ui-input.html","../../../projects/ui-kit/forms/ui-input/src/public-api.ts","../../../projects/ui-kit/forms/ui-input/src/4sh-ui-kit-forms-ui-input.ts"],"sourcesContent":["import {\n Component,\n computed,\n contentChild,\n ElementRef,\n forwardRef,\n input,\n output,\n TemplateRef,\n viewChild,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BaseFormField } from '@4sh/ui-kit/forms';\nimport { UiField } from '@4sh/ui-kit/forms/ui-field';\nimport { UiIcon, UiIconSize } from '@4sh/ui-kit/base/ui-icon';\n\n/** Supported text types (numeric has its dedicated `ui-input-number` component). */\nexport type InputType = 'text' | 'password' | 'email' | 'tel' | 'url' | 'search';\n\n/** Context handed to the `#iconLeft` / `#iconRight` templates. */\nexport interface UiInputIconContext {\n /** Icon name configured on that side (`iconLeft` / `iconRight`), if any. */\n $implicit: string | undefined;\n /** Icon size matching the field size. */\n size: UiIconSize;\n /** Whether the field is disabled. */\n disabled: boolean;\n}\n\n/**\n * ui-input — headless composed text field, built on the `ui-field` shell\n * (label + box + helper) + a native `<input>`.\n *\n * Covers all text types (text/email/tel/url/search/**password**). Password\n * reveal, search clearing, etc. are handled via the **right action zone**\n * (`iconRightAriaLabel` + `iconRightClick`).\n *\n * Both icon zones accept a `<ng-template #iconLeft>` / `#iconRight` to replace the\n * rendered markup (another icon family, an inline SVG, a brand logo). To retarget\n * the family of every icon at once — this field's and the ones its neighbours\n * render internally — use the `uiIconFamily` directive instead.\n *\n * Standalone, `[(ngModel)]` or reactive forms (ControlValueAccessor via BaseFormField).\n * For numbers → `ui-input-number`, for masks → `ui-input-mask`.\n */\n@Component({\n selector: 'ui-input',\n imports: [UiField, UiIcon, NgTemplateOutlet],\n templateUrl: './ui-input.html',\n styleUrl: './ui-input.scss',\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInput), multi: true }],\n})\nexport class UiInput extends BaseFormField<string> {\n /** Native input type. */\n type = input<InputType>('text');\n /**\n * Display-only value (bypasses the CVA model). For composite hosts\n * (e.g. `ui-datepicker`) that own the visible text and read it back via\n * `valueChange` — leave unset when using `[(ngModel)]`/reactive forms.\n */\n value = input<string>();\n /** `aria-haspopup` forwarded to the native input (popup trigger hosts). */\n ariaHasPopup = input<'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'>();\n /** `aria-expanded` forwarded to the native input (popup trigger hosts). */\n ariaExpanded = input<boolean>();\n /** `aria-controls` forwarded to the native input (popup trigger hosts). */\n ariaControls = input<string>();\n /** Native placeholder. */\n placeholder = input<string>();\n /** Suffix unit (e.g. \"%\", \"@domain\"). Shown when provided. */\n unit = input<string>();\n /** Left FontAwesome icon name (decorative). */\n iconLeft = input<string>();\n /** Right FontAwesome icon name. */\n iconRight = input<string>();\n /**\n * Accessible name of the right icon. **When provided, the right icon becomes a\n * clickable action zone** (square, full-height button) that emits `iconRightClick`.\n */\n iconRightAriaLabel = input<string>();\n /** Native autocomplete. */\n autocomplete = input<string>();\n /** Native maxlength. */\n maxlength = input<number>();\n\n /** Left-icon template, provided programmatically (composite hosts like `ui-datepicker`). */\n iconLeftTemplate = input<TemplateRef<UiInputIconContext>>();\n /** Right-icon template, provided programmatically (composite hosts like `ui-datepicker`). */\n iconRightTemplate = input<TemplateRef<UiInputIconContext>>();\n\n /** Custom left icon: `<ng-template #iconLeft let-name let-size=\"size\">`. */\n private readonly iconLeftTemplateContent =\n contentChild<TemplateRef<UiInputIconContext>>('iconLeft');\n /** Custom right icon: `<ng-template #iconRight let-name let-size=\"size\">`. */\n private readonly iconRightTemplateContent =\n contentChild<TemplateRef<UiInputIconContext>>('iconRight');\n\n /** Emitted on each input with the new value. */\n valueChange = output<string>();\n /** Emitted on click of the right action zone (active when `iconRightAriaLabel` is set). */\n iconRightClick = output<MouseEvent>();\n /** Emitted when the input receives focus. */\n inputFocus = output<FocusEvent>();\n /** Emitted when the input loses focus. */\n inputBlur = output<FocusEvent>();\n\n /** @ignore */\n private readonly inputEl = viewChild.required<ElementRef<HTMLInputElement>>('inputEl');\n\n /** @ignore Icon size aligned with the field size. */\n protected readonly iconSize = computed<UiIconSize>(() => (this.size() === 'small' ? 'sm' : 'md'));\n /** @ignore Input wins over the projected `#iconLeft` template. */\n protected readonly resolvedIconLeftTemplate = computed(\n () => this.iconLeftTemplate() ?? this.iconLeftTemplateContent(),\n );\n /** @ignore Input wins over the projected `#iconRight` template. */\n protected readonly resolvedIconRightTemplate = computed(\n () => this.iconRightTemplate() ?? this.iconRightTemplateContent(),\n );\n /** @ignore */\n protected readonly leftIconContext = computed<UiInputIconContext>(() => ({\n $implicit: this.iconLeft(),\n size: this.iconSize(),\n disabled: this.isDisabled(),\n }));\n /** @ignore */\n protected readonly rightIconContext = computed<UiInputIconContext>(() => ({\n $implicit: this.iconRight(),\n size: this.iconSize(),\n disabled: this.isDisabled(),\n }));\n /** @ignore The right icon is an action zone (has an accessible name). */\n protected readonly hasRightAction = computed(\n () => (!!this.iconRight() || !!this.resolvedIconRightTemplate()) && !!this.iconRightAriaLabel(),\n );\n\n /** Focuses the input. */\n focus(options?: FocusOptions): void {\n this.inputEl().nativeElement.focus(options);\n }\n\n /** Native `<input>` element — composite hosts that own `value` (e.g. `ui-datepicker`)\n * need direct DOM access to control the caret while reformatting text as typed. */\n nativeInputElement(): HTMLInputElement {\n return this.inputEl().nativeElement;\n }\n\n /** @ignore Input: single source of the value (view → form). */\n protected onInput(): void {\n const value = this.inputEl().nativeElement.value;\n this.modelValue.set(value);\n this.emitChange(value);\n this.valueChange.emit(value);\n }\n\n /** @ignore */\n protected onBlur(event: FocusEvent): void {\n this.emitTouch();\n this.inputBlur.emit(event);\n }\n}\n","<ui-field\n [label]=\"label()\"\n [for]=\"resolvedId()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n>\n @if (resolvedIconLeftTemplate(); as tpl) {\n <span uiFieldPrefix class=\"ui-input-icon\" [class._disabled]=\"isDisabled()\">\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"leftIconContext()\" />\n </span>\n } @else if (iconLeft(); as name) {\n <ui-icon\n uiFieldPrefix\n class=\"ui-input-icon\"\n [class._disabled]=\"isDisabled()\"\n [name]=\"name\"\n [size]=\"iconSize()\"\n />\n }\n\n <input\n #inputEl\n class=\"ui-input-native\"\n [class._small]=\"size() === 'small'\"\n [type]=\"type()\"\n [id]=\"resolvedId()\"\n [value]=\"value() ?? displayValue()\"\n [placeholder]=\"placeholder() ?? ''\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.autocomplete]=\"autocomplete() || null\"\n [attr.maxlength]=\"maxlength()\"\n [attr.aria-haspopup]=\"ariaHasPopup() || null\"\n [attr.aria-expanded]=\"ariaExpanded() ?? null\"\n [attr.aria-controls]=\"ariaControls() || null\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"displayMessage() ? messageId() : null\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput()\"\n (focus)=\"inputFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n @if (unit(); as u) {\n <span\n uiFieldSuffix\n class=\"ui-input-unit\"\n [class._small]=\"size() === 'small'\"\n [class._disabled]=\"isDisabled()\"\n >{{ u }}</span\n >\n }\n\n @if (iconRight() || resolvedIconRightTemplate()) {\n @if (hasRightAction()) {\n <button\n uiFieldSuffix\n type=\"button\"\n class=\"ui-input-action\"\n [attr.aria-label]=\"iconRightAriaLabel()\"\n [disabled]=\"isDisabled()\"\n (click)=\"iconRightClick.emit($event)\"\n >\n @if (resolvedIconRightTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"rightIconContext()\" />\n } @else {\n <ui-icon [name]=\"iconRight()!\" [size]=\"iconSize()\" />\n }\n </button>\n } @else if (resolvedIconRightTemplate(); as tpl) {\n <span uiFieldSuffix class=\"ui-input-icon\" [class._disabled]=\"isDisabled()\">\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"rightIconContext()\" />\n </span>\n } @else {\n <ui-icon\n uiFieldSuffix\n class=\"ui-input-icon\"\n [class._disabled]=\"isDisabled()\"\n [name]=\"iconRight()!\"\n [size]=\"iconSize()\"\n />\n }\n }\n</ui-field>\n","/*\n * Public API Surface of ui-kit/ui-input\n */\n\nexport * from './lib/ui-input';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AA8BA;;;;;;;;;;;;;;;AAeG;AAQG,MAAO,OAAQ,SAAQ,aAAqB,CAAA;AAPlD,IAAA,WAAA,GAAA;;;QASE,IAAA,CAAA,IAAI,GAAG,KAAK,CAAY,MAAM;iFAAC;AAC/B;;;;AAIG;AACH,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK;6FAAU;;AAEvB,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK;oGAAmD;;AAEvE,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK;oGAAW;;AAE/B,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK;oGAAU;;AAE9B,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK;mGAAU;;AAE7B,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK;4FAAU;;AAEtB,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK;gGAAU;;AAE1B,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK;iGAAU;AAC3B;;;AAGG;AACH,QAAA,IAAA,CAAA,kBAAkB,GAAG,KAAK;0GAAU;;AAEpC,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK;oGAAU;;AAE9B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AAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAA,QAAA,EAAA,6+FAAA,EAAA,MAAA,EAAA,CAAA,4qFAAA,CAAA,EAAA;k+CA0ChD,UAAU,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,wBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAGV,WAAW,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,aAAA,CAAA,EAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,WAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAYiB,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE5GvF;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"4sh-ui-kit-forms-ui-input.mjs","sources":["../../../projects/ui-kit/forms/ui-input/src/lib/ui-input.ts","../../../projects/ui-kit/forms/ui-input/src/lib/ui-input.html","../../../projects/ui-kit/forms/ui-input/src/public-api.ts","../../../projects/ui-kit/forms/ui-input/src/4sh-ui-kit-forms-ui-input.ts"],"sourcesContent":["import {\n Component,\n computed,\n contentChild,\n ElementRef,\n forwardRef,\n input,\n output,\n TemplateRef,\n viewChild,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BaseFormField } from '@4sh/ui-kit/forms';\nimport { UiField } from '@4sh/ui-kit/forms/ui-field';\nimport { UiIcon, UiIconSize } from '@4sh/ui-kit/base/ui-icon';\n\n/** Supported text types (numeric has its dedicated `ui-input-number` component). */\nexport type InputType = 'text' | 'password' | 'email' | 'tel' | 'url' | 'search';\n\n/** Context handed to the `#iconLeft` / `#iconRight` templates. */\nexport interface UiInputIconContext {\n /** Icon name configured on that side (`iconLeft` / `iconRight`), if any. */\n $implicit: string | undefined;\n /** Icon size matching the field size. */\n size: UiIconSize;\n /** Whether the field is disabled. */\n disabled: boolean;\n}\n\n/**\n * ui-input — headless composed text field, built on the `ui-field` shell\n * (label + box + helper) + a native `<input>`.\n *\n * Covers all text types (text/email/tel/url/search/**password**). Password\n * reveal, search clearing, etc. are handled via the **right action zone**\n * (`iconRightAriaLabel` + `iconRightClick`).\n *\n * Both icon zones accept a `<ng-template #iconLeft>` / `#iconRight` to replace the\n * rendered markup (another icon family, an inline SVG, a brand logo). To retarget\n * the family of every icon at once — this field's and the ones its neighbours\n * render internally — use the `uiIconFamily` directive instead.\n *\n * Standalone, `[(ngModel)]` or reactive forms (ControlValueAccessor via BaseFormField).\n * For numbers → `ui-input-number`, for masks → `ui-input-mask`.\n */\n@Component({\n selector: 'ui-input',\n imports: [UiField, UiIcon, NgTemplateOutlet],\n templateUrl: './ui-input.html',\n styleUrl: './ui-input.scss',\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInput), multi: true }],\n})\nexport class UiInput extends BaseFormField<string> {\n /** Native input type. */\n type = input<InputType>('text');\n /**\n * Display-only value (bypasses the CVA model). For composite hosts\n * (e.g. `ui-datepicker`) that own the visible text and read it back via\n * `valueChange` — leave unset when using `[(ngModel)]`/reactive forms.\n */\n value = input<string>();\n /** `aria-haspopup` forwarded to the native input (popup trigger hosts). */\n ariaHasPopup = input<'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'>();\n /**\n * `aria-expanded` forwarded to the native input (popup trigger hosts).\n * Setting it also promotes the input to `role=\"combobox\"`: `aria-expanded`\n * is not allowed on the implicit `textbox` role, so screen readers would\n * silently drop the popup state without it.\n */\n ariaExpanded = input<boolean>();\n /** `aria-controls` forwarded to the native input (popup trigger hosts). */\n ariaControls = input<string>();\n /** Native placeholder. */\n placeholder = input<string>();\n /**\n * id of an external element describing this control further (e.g. a composite host's own\n * format hint), chained onto `aria-describedby` alongside the helper/error message rather than\n * replacing it — a plain `[attr.aria-describedby]` override on the host would clobber whichever\n * of the two lands last.\n */\n ariaDescribedBy = input<string>();\n /** Suffix unit (e.g. \"%\", \"@domain\"). Shown when provided. */\n unit = input<string>();\n /** Left FontAwesome icon name (decorative). */\n iconLeft = input<string>();\n /** Right FontAwesome icon name. */\n iconRight = input<string>();\n /**\n * Accessible name of the right icon. **When provided, the right icon becomes a\n * clickable action zone** (square, full-height button) that emits `iconRightClick`.\n */\n iconRightAriaLabel = input<string>();\n /** Native autocomplete. */\n autocomplete = input<string>();\n /** Native maxlength. */\n maxlength = input<number>();\n\n /** Left-icon template, provided programmatically (composite hosts like `ui-datepicker`). */\n iconLeftTemplate = input<TemplateRef<UiInputIconContext>>();\n /** Right-icon template, provided programmatically (composite hosts like `ui-datepicker`). */\n iconRightTemplate = input<TemplateRef<UiInputIconContext>>();\n\n /** Custom left icon: `<ng-template #iconLeft let-name let-size=\"size\">`. */\n private readonly iconLeftTemplateContent =\n contentChild<TemplateRef<UiInputIconContext>>('iconLeft');\n /** Custom right icon: `<ng-template #iconRight let-name let-size=\"size\">`. */\n private readonly iconRightTemplateContent =\n contentChild<TemplateRef<UiInputIconContext>>('iconRight');\n\n /** Emitted on each input with the new value. */\n valueChange = output<string>();\n /** Emitted on click of the right action zone (active when `iconRightAriaLabel` is set). */\n iconRightClick = output<MouseEvent>();\n /** Emitted when the input receives focus. */\n inputFocus = output<FocusEvent>();\n /** Emitted when the input loses focus. */\n inputBlur = output<FocusEvent>();\n\n /** @ignore */\n private readonly inputEl = viewChild.required<ElementRef<HTMLInputElement>>('inputEl');\n\n /** @ignore Icon size aligned with the field size. */\n protected readonly iconSize = computed<UiIconSize>(() => (this.size() === 'small' ? 'sm' : 'md'));\n /** @ignore Text rendered in the input: display-only `value` wins over the model. */\n protected readonly renderedValue = computed(() => this.value() ?? this.displayValue());\n /** @ignore Keeps a floating label raised once focus leaves. */\n protected readonly isFilled = computed(() => this.renderedValue() !== '');\n /** @ignore At rest the floating label already holds that spot. */\n protected readonly effectivePlaceholder = computed(() =>\n this.hasFloatLabel() ? '' : (this.placeholder() ?? ''),\n );\n /** @ignore Input wins over the projected `#iconLeft` template. */\n protected readonly resolvedIconLeftTemplate = computed(\n () => this.iconLeftTemplate() ?? this.iconLeftTemplateContent(),\n );\n /** @ignore Input wins over the projected `#iconRight` template. */\n protected readonly resolvedIconRightTemplate = computed(\n () => this.iconRightTemplate() ?? this.iconRightTemplateContent(),\n );\n /** @ignore */\n protected readonly leftIconContext = computed<UiInputIconContext>(() => ({\n $implicit: this.iconLeft(),\n size: this.iconSize(),\n disabled: this.isDisabled(),\n }));\n /** @ignore */\n protected readonly rightIconContext = computed<UiInputIconContext>(() => ({\n $implicit: this.iconRight(),\n size: this.iconSize(),\n disabled: this.isDisabled(),\n }));\n /** @ignore The right icon is an action zone (has an accessible name). */\n protected readonly hasRightAction = computed(\n () => (!!this.iconRight() || !!this.resolvedIconRightTemplate()) && !!this.iconRightAriaLabel(),\n );\n /** @ignore Full `aria-describedby`: the helper/error message id (only when a message is\n * actually rendered) plus the externally supplied `ariaDescribedBy`, space-joined — `null`\n * when neither applies (native attribute is then omitted, not left dangling). */\n protected readonly resolvedAriaDescribedBy = computed(() => {\n const ids = [this.displayMessage() ? this.messageId() : null, this.ariaDescribedBy() || null];\n const joined = ids.filter((id): id is string => !!id).join(' ');\n return joined || null;\n });\n /** @ignore ARIA 1.2: only `combobox` (not the implicit `textbox`) accepts\n * `aria-expanded`. Stays null for plain text fields so their announcement\n * (\"edit text\") is untouched. */\n protected readonly nativeRole = computed(() => (this.ariaExpanded() === undefined ? null : 'combobox'));\n\n /** Focuses the input. */\n focus(options?: FocusOptions): void {\n this.inputEl().nativeElement.focus(options);\n }\n\n /** Native `<input>` element — composite hosts that own `value` (e.g. `ui-datepicker`)\n * need direct DOM access to control the caret while reformatting text as typed. */\n nativeInputElement(): HTMLInputElement {\n return this.inputEl().nativeElement;\n }\n\n /** @ignore Input: single source of the value (view → form). */\n protected onInput(): void {\n const value = this.inputEl().nativeElement.value;\n this.modelValue.set(value);\n this.emitChange(value);\n this.valueChange.emit(value);\n }\n\n /** @ignore */\n protected onBlur(event: FocusEvent): void {\n this.emitTouch();\n this.inputBlur.emit(event);\n }\n}\n","<ui-field\n [label]=\"label()\"\n [for]=\"resolvedId()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [floatLabel]=\"floatLabel()\"\n [filled]=\"isFilled()\"\n [hasPrefix]=\"!!iconLeft() || !!resolvedIconLeftTemplate()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n @if (resolvedIconLeftTemplate(); as tpl) {\n <span uiFieldPrefix class=\"ui-input-icon\" [class._disabled]=\"isDisabled()\">\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"leftIconContext()\" />\n </span>\n } @else if (iconLeft(); as name) {\n <ui-icon\n uiFieldPrefix\n class=\"ui-input-icon\"\n [class._disabled]=\"isDisabled()\"\n [name]=\"name\"\n [size]=\"iconSize()\"\n />\n }\n\n <input\n #inputEl\n class=\"ui-input-native\"\n [class._small]=\"size() === 'small'\"\n [type]=\"type()\"\n [id]=\"resolvedId()\"\n [value]=\"renderedValue()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.autocomplete]=\"autocomplete() || null\"\n [attr.maxlength]=\"maxlength()\"\n [attr.role]=\"nativeRole()\"\n [attr.aria-haspopup]=\"ariaHasPopup() || null\"\n [attr.aria-expanded]=\"ariaExpanded() ?? null\"\n [attr.aria-controls]=\"ariaControls() || null\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"resolvedAriaDescribedBy()\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput()\"\n (focus)=\"inputFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n @if (unit(); as u) {\n <span\n uiFieldSuffix\n class=\"ui-input-unit\"\n [class._small]=\"size() === 'small'\"\n [class._disabled]=\"isDisabled()\"\n >{{ u }}</span\n >\n }\n\n @if (iconRight() || resolvedIconRightTemplate()) {\n @if (hasRightAction()) {\n <button\n uiFieldSuffix\n type=\"button\"\n class=\"ui-input-action\"\n [attr.aria-label]=\"iconRightAriaLabel()\"\n [disabled]=\"isDisabled()\"\n (click)=\"iconRightClick.emit($event)\"\n >\n @if (resolvedIconRightTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"rightIconContext()\" />\n } @else {\n <ui-icon [name]=\"iconRight()!\" [size]=\"iconSize()\" />\n }\n </button>\n } @else if (resolvedIconRightTemplate(); as tpl) {\n <span uiFieldSuffix class=\"ui-input-icon\" [class._disabled]=\"isDisabled()\">\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"rightIconContext()\" />\n </span>\n } @else {\n <ui-icon\n uiFieldSuffix\n class=\"ui-input-icon\"\n [class._disabled]=\"isDisabled()\"\n [name]=\"iconRight()!\"\n [size]=\"iconSize()\"\n />\n }\n }\n</ui-field>\n","/*\n * Public API Surface of ui-kit/ui-input\n */\n\nexport * from './lib/ui-input';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AA8BA;;;;;;;;;;;;;;;AAeG;AAQG,MAAO,OAAQ,SAAQ,aAAqB,CAAA;AAPlD,IAAA,WAAA,GAAA;;;QASE,IAAA,CAAA,IAAI,GAAG,KAAK,CAAY,MAAM;iFAAC;AAC/B;;;;AAIG;AACH,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK;6FAAU;;AAEvB,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK;oGAAmD;AACvE;;;;;AAKG;AACH,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK;oGAAW;;AAE/B,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK;oGAAU;;AAE9B,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK;mGAAU;AAC7B;;;;;AAKG;AACH,QAAA,IAAA,CAAA,eAAe,GAAG,KAAK;uGAAU;;AAEjC,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK;4FAAU;;AAEtB,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK;gGAAU;;AAE1B,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK;iGAAU;AAC3B;;;AAGG;AACH,QAAA,IAAA,CAAA,kBAAkB,GAAG,KAAK;0GAAU;;AAEpC,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK;oGAAU;;AAE9B,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK;iGAAU;;AAG3B,QAAA,IAAA,CAAA,gBAAgB,GAAG,KAAK;wGAAmC;;AAE3D,QAAA,IAAA,CAAA,iBAAiB,GAAG,KAAK;yGAAmC;;QAG3C,IAAA,CAAA,uBAAuB,GACtC,YAAY,CAAkC,UAAU;oGAAC;;QAE1C,IAAA,CAAA,wBAAwB,GACvC,YAAY,CAAkC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,CAAA,aAAA,CAAA,EAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,WAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAYiB,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AExHvF;;AAEG;;ACFH;;AAEG;;"}
@@ -0,0 +1,282 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, numberAttribute, booleanAttribute, output, viewChild, computed, isDevMode, effect, forwardRef, Component } from '@angular/core';
3
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
4
+ import { BaseFieldControl, warnMissingAccessibleName } from '@4sh/ui-kit/forms';
5
+
6
+ // --- Dial geometry (viewBox 0 0 100 100) -------------------------------
7
+ // A 300° arc opening at the bottom: min at 240°, max at -60°. Everything is
8
+ // expressed in viewBox units, so the drawing scales with the rendered diameter.
9
+ const CENTER = 50;
10
+ const MIN_RADIANS = (4 * Math.PI) / 3;
11
+ const MAX_RADIANS = -Math.PI / 3;
12
+ /** Bottom gap, where a pointer angle maps to no value. */
13
+ const GAP_START = -(2 * Math.PI) / 3;
14
+ /** Breathing room kept between the arc and the focus ring drawn on the box edge. */
15
+ const RING_GAP = 3;
16
+ const round = (n) => Number(n.toFixed(3));
17
+ /**
18
+ * Centreline radius for a given thickness: the arc, caps included, always fits
19
+ * its box, so a thick stroke never spills over the focus ring.
20
+ */
21
+ function dialRadius(strokeWidth) {
22
+ return Math.max(2, CENTER - strokeWidth / 2 - RING_GAP);
23
+ }
24
+ /** Point on the dial for an angle, in viewBox coordinates (y grows downwards). */
25
+ function polar(radians, radius) {
26
+ return {
27
+ x: round(CENTER + Math.cos(radians) * radius),
28
+ y: round(CENTER - Math.sin(radians) * radius),
29
+ };
30
+ }
31
+ function mapRange(x, inMin, inMax, outMin, outMax) {
32
+ if (inMax === inMin)
33
+ return outMin;
34
+ return ((x - inMin) * (outMax - outMin)) / (inMax - inMin) + outMin;
35
+ }
36
+ /**
37
+ * ui-knob — headless circular dial to pick a numeric value.
38
+ *
39
+ * Follows the WAI-ARIA slider pattern: the dial is a single `role="slider"`
40
+ * stop exposing `aria-valuemin/max/now`, driven at the keyboard (arrows,
41
+ * Page Up/Down, Home/End) and by pointer (mouse, touch, pen) through one code
42
+ * path. The drawing is an SVG arc in a 100×100 viewBox, so it scales with the
43
+ * rendered diameter; every colour comes from the design tokens and can be
44
+ * repainted per instance.
45
+ *
46
+ * Works standalone, with `[(ngModel)]`, Reactive Forms or Signal Forms
47
+ * (`[formField]`) — it is a `ControlValueAccessor`.
48
+ */
49
+ class UiKnob extends BaseFieldControl {
50
+ constructor() {
51
+ super();
52
+ /** Minimum boundary value. */
53
+ this.min = input(0, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}), transform: numberAttribute });
54
+ /** Maximum boundary value. */
55
+ this.max = input(100, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}), transform: numberAttribute });
56
+ /** Increment/decrement granularity (drag snapping + keyboard step). */
57
+ this.step = input(1, { ...(ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {}), transform: numberAttribute });
58
+ /** Diameter preset (override any diameter with the `--ui-knob-size` hook). */
59
+ this.size = input('default', /* @ts-ignore */
60
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
61
+ /** Arc thickness, in viewBox units (100 = the diameter), so it scales with the knob. */
62
+ this.strokeWidth = input(14, { ...(ngDevMode ? { debugName: "strokeWidth" } : /* istanbul ignore next */ {}), transform: numberAttribute });
63
+ /** Renders the value at the centre of the dial. */
64
+ this.showValue = input(true, { ...(ngDevMode ? { debugName: "showValue" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
65
+ /** Template of the centre label, `{value}` being the placeholder. */
66
+ this.valueTemplate = input('{value}', /* @ts-ignore */
67
+ ...(ngDevMode ? [{ debugName: "valueTemplate" }] : /* istanbul ignore next */ []));
68
+ /** Colour of the filled arc (any CSS colour). Sets `--ui-knob-value-color`. */
69
+ this.valueColor = input(/* @ts-ignore */
70
+ ...(ngDevMode ? [undefined, { debugName: "valueColor" }] : /* istanbul ignore next */ []));
71
+ /** Colour of the track behind it. Sets `--ui-knob-range-color`. */
72
+ this.rangeColor = input(/* @ts-ignore */
73
+ ...(ngDevMode ? [undefined, { debugName: "rangeColor" }] : /* istanbul ignore next */ []));
74
+ /** Colour of the centre label. Sets `--ui-knob-text-color`. */
75
+ this.textColor = input(/* @ts-ignore */
76
+ ...(ngDevMode ? [undefined, { debugName: "textColor" }] : /* istanbul ignore next */ []));
77
+ /** Emitted on every value change (drag, keyboard, click on the dial). */
78
+ this.knobChange = output();
79
+ /** @ignore Pointer target, focus stop and % reference of the dial. */
80
+ this.root = viewChild.required('root', /* @ts-ignore */
81
+ ...(ngDevMode ? [{ debugName: "root" }] : /* istanbul ignore next */ []));
82
+ /** @ignore True while a drag is in progress. */
83
+ this.dragging = false;
84
+ /** @ignore Current value, clamped to the boundaries (falls back to `min`). */
85
+ this.currentValue = computed(() => {
86
+ const value = this.modelValue();
87
+ return this.clamp(typeof value === 'number' && !Number.isNaN(value) ? value : this.min());
88
+ }, /* @ts-ignore */
89
+ ...(ngDevMode ? [{ debugName: "currentValue" }] : /* istanbul ignore next */ []));
90
+ /** @ignore Centre label, with `{value}` substituted. */
91
+ this.displayValue = computed(() => this.valueTemplate().replace('{value}', String(this.currentValue())), /* @ts-ignore */
92
+ ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
93
+ /** @ignore Announced only when the label differs from the raw value. */
94
+ this.ariaValueText = computed(() => {
95
+ const label = this.displayValue();
96
+ return label === String(this.currentValue()) ? null : label;
97
+ }, /* @ts-ignore */
98
+ ...(ngDevMode ? [{ debugName: "ariaValueText" }] : /* istanbul ignore next */ []));
99
+ /** @ignore Radius of the arc centreline, inset so the stroke fits the box. */
100
+ this.radius = computed(() => dialRadius(this.strokeWidth()), /* @ts-ignore */
101
+ ...(ngDevMode ? [{ debugName: "radius" }] : /* istanbul ignore next */ []));
102
+ /** @ignore The full track. */
103
+ this.rangePath = computed(() => {
104
+ const radius = this.radius();
105
+ const from = polar(MIN_RADIANS, radius);
106
+ const to = polar(MAX_RADIANS, radius);
107
+ return `M ${from.x} ${from.y} A ${radius} ${radius} 0 1 1 ${to.x} ${to.y}`;
108
+ }, /* @ts-ignore */
109
+ ...(ngDevMode ? [{ debugName: "rangePath" }] : /* istanbul ignore next */ []));
110
+ /** @ignore Arc drawn from the origin (0, or the nearest boundary) to the value. */
111
+ this.valuePath = computed(() => {
112
+ const radius = this.radius();
113
+ const from = polar(this.originRadians(), radius);
114
+ const to = polar(this.valueRadians(), radius);
115
+ const largeArc = Math.abs(this.originRadians() - this.valueRadians()) < Math.PI ? 0 : 1;
116
+ const sweep = this.valueRadians() > this.originRadians() ? 0 : 1;
117
+ return `M ${from.x} ${from.y} A ${radius} ${radius} 0 ${largeArc} ${sweep} ${to.x} ${to.y}`;
118
+ }, /* @ts-ignore */
119
+ ...(ngDevMode ? [{ debugName: "valuePath" }] : /* istanbul ignore next */ []));
120
+ /** @ignore */
121
+ this.classes = computed(() => {
122
+ const classes = ['ui-knob'];
123
+ if (this.size() !== 'default')
124
+ classes.push(`_${this.size()}`);
125
+ if (this.isDisabled())
126
+ classes.push('_disabled');
127
+ if (this.readonly())
128
+ classes.push('_readonly');
129
+ if (this.isInvalid())
130
+ classes.push('_invalid');
131
+ return classes.join(' ');
132
+ }, /* @ts-ignore */
133
+ ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
134
+ if (isDevMode()) {
135
+ effect(() => {
136
+ if (!this.ariaLabel() && !this.ariaLabelledBy()) {
137
+ warnMissingAccessibleName('ui-knob', 'No accessible name: provide `ariaLabel` (or `ariaLabelledBy`).');
138
+ }
139
+ });
140
+ }
141
+ }
142
+ /** @ignore */
143
+ uidPrefix() {
144
+ return 'ui-knob';
145
+ }
146
+ /** Focus the dial programmatically. */
147
+ focus(options) {
148
+ this.root().nativeElement.focus(options);
149
+ }
150
+ // --- Pointer interaction (mouse / touch / pen) -----------------------
151
+ /** @ignore */
152
+ onPointerDown(event) {
153
+ if (this.isDisabled() || this.readonly())
154
+ return;
155
+ this.dragging = true;
156
+ this.root().nativeElement.setPointerCapture(event.pointerId);
157
+ this.updateFromPointer(event);
158
+ // preventDefault kills the implicit focus, so take it explicitly.
159
+ event.preventDefault();
160
+ this.root().nativeElement.focus();
161
+ }
162
+ /** @ignore */
163
+ onPointerMove(event) {
164
+ if (!this.dragging)
165
+ return;
166
+ this.updateFromPointer(event);
167
+ }
168
+ /** @ignore */
169
+ onPointerUp(event) {
170
+ if (!this.dragging)
171
+ return;
172
+ this.dragging = false;
173
+ this.root().nativeElement.releasePointerCapture?.(event.pointerId);
174
+ }
175
+ // --- Keyboard --------------------------------------------------------
176
+ /** @ignore */
177
+ onKeyDown(event) {
178
+ if (this.isDisabled() || this.readonly())
179
+ return;
180
+ const step = this.stepSize();
181
+ const current = this.currentValue();
182
+ let next;
183
+ switch (event.key) {
184
+ case 'ArrowLeft':
185
+ case 'ArrowDown':
186
+ next = current - step;
187
+ break;
188
+ case 'ArrowRight':
189
+ case 'ArrowUp':
190
+ next = current + step;
191
+ break;
192
+ case 'PageDown':
193
+ next = current - step * 10;
194
+ break;
195
+ case 'PageUp':
196
+ next = current + step * 10;
197
+ break;
198
+ case 'Home':
199
+ next = this.min();
200
+ break;
201
+ case 'End':
202
+ next = this.max();
203
+ break;
204
+ default:
205
+ return;
206
+ }
207
+ event.preventDefault();
208
+ this.commit(next);
209
+ }
210
+ /** @ignore */
211
+ onBlur() {
212
+ this.emitTouch();
213
+ }
214
+ // --- Value helpers ---------------------------------------------------
215
+ /** @ignore Effective step (never 0). */
216
+ stepSize() {
217
+ const step = this.step();
218
+ return step > 0 ? step : 1;
219
+ }
220
+ /** @ignore Angle of the value on the dial. */
221
+ valueRadians() {
222
+ return mapRange(this.currentValue(), this.min(), this.max(), MIN_RADIANS, MAX_RADIANS);
223
+ }
224
+ /** @ignore Angle the filled arc starts from: zero when it is inside the boundaries. */
225
+ originRadians() {
226
+ const origin = Math.min(Math.max(0, this.min()), this.max());
227
+ return mapRange(origin, this.min(), this.max(), MIN_RADIANS, MAX_RADIANS);
228
+ }
229
+ /** @ignore Pointer position → value, or `null` inside the bottom gap. */
230
+ updateFromPointer(event) {
231
+ const rect = this.root().nativeElement.getBoundingClientRect();
232
+ if (!rect.width || !rect.height)
233
+ return;
234
+ const dx = (event.clientX - rect.left) / rect.width - 0.5;
235
+ const dy = 0.5 - (event.clientY - rect.top) / rect.height;
236
+ const angle = Math.atan2(dy, dx);
237
+ if (angle > MAX_RADIANS) {
238
+ this.commit(mapRange(angle, MIN_RADIANS, MAX_RADIANS, this.min(), this.max()));
239
+ }
240
+ else if (angle <= GAP_START) {
241
+ this.commit(mapRange(angle + 2 * Math.PI, MIN_RADIANS, MAX_RADIANS, this.min(), this.max()));
242
+ }
243
+ }
244
+ /** @ignore Round to the step's decimal precision (avoids float drift). */
245
+ round(value) {
246
+ const step = this.stepSize();
247
+ const decimals = Number.isInteger(step) ? 0 : (step.toString().split('.')[1]?.length ?? 0);
248
+ return decimals > 0 ? +value.toFixed(decimals) : Math.round(value);
249
+ }
250
+ /** @ignore Clamp to [min, max]. */
251
+ clamp(value) {
252
+ return Math.min(this.max(), Math.max(this.min(), value));
253
+ }
254
+ /** @ignore Snap to the step grid, clamp, then propagate if it moved. */
255
+ commit(raw) {
256
+ const step = this.stepSize();
257
+ const min = this.min();
258
+ const value = this.clamp(this.round(min + Math.round((raw - min) / step) * step));
259
+ if (value === this.currentValue())
260
+ return;
261
+ this.modelValue.set(value);
262
+ this.emitChange(value);
263
+ this.knobChange.emit(value);
264
+ }
265
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: UiKnob, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
266
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.2", type: UiKnob, isStandalone: true, selector: "ui-knob", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, strokeWidth: { classPropertyName: "strokeWidth", publicName: "strokeWidth", isSignal: true, isRequired: false, transformFunction: null }, showValue: { classPropertyName: "showValue", publicName: "showValue", isSignal: true, isRequired: false, transformFunction: null }, valueTemplate: { classPropertyName: "valueTemplate", publicName: "valueTemplate", isSignal: true, isRequired: false, transformFunction: null }, valueColor: { classPropertyName: "valueColor", publicName: "valueColor", isSignal: true, isRequired: false, transformFunction: null }, rangeColor: { classPropertyName: "rangeColor", publicName: "rangeColor", isSignal: true, isRequired: false, transformFunction: null }, textColor: { classPropertyName: "textColor", publicName: "textColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { knobChange: "knobChange" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiKnob), multi: true }], viewQueries: [{ propertyName: "root", first: true, predicate: ["root"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n #root\n [class]=\"classes()\"\n role=\"slider\"\n [attr.id]=\"resolvedId()\"\n [attr.tabindex]=\"isDisabled() ? -1 : (tabindex() ?? 0)\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"currentValue()\"\n [attr.aria-valuetext]=\"ariaValueText()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-disabled]=\"isDisabled() ? true : null\"\n [attr.aria-readonly]=\"readonly() ? true : null\"\n [attr.aria-required]=\"required() ? true : null\"\n [style.--ui-knob-value-color]=\"valueColor() ?? null\"\n [style.--ui-knob-range-color]=\"rangeColor() ?? null\"\n [style.--ui-knob-text-color]=\"textColor() ?? null\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n (keydown)=\"onKeyDown($event)\"\n (blur)=\"onBlur()\"\n>\n <!-- The value is carried by role=\"slider\" above: the drawing is decorative. -->\n <svg class=\"ui-knob-dial\" viewBox=\"0 0 100 100\" focusable=\"false\" aria-hidden=\"true\">\n <path class=\"ui-knob-range\" [attr.d]=\"rangePath()\" [attr.stroke-width]=\"strokeWidth()\"></path>\n <path class=\"ui-knob-value\" [attr.d]=\"valuePath()\" [attr.stroke-width]=\"strokeWidth()\"></path>\n </svg>\n\n @if (showValue()) {\n <span class=\"ui-knob-text\" aria-hidden=\"true\">{{ displayValue() }}</span>\n }\n</div>\n", styles: [":host{display:inline-block}.ui-knob{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--ui-knob-size, 6.25rem);height:var(--ui-knob-size, 6.25rem);border-radius:var(--ui-knob-radius, var(--radius-full));touch-action:none;cursor:pointer;-webkit-user-select:none;user-select:none;transition:box-shadow var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-knob:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-knob-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--actions-high-stroke-focused)}.ui-knob-dial{display:block;width:100%;height:100%}.ui-knob-range,.ui-knob-value{fill:none;stroke-linecap:round}.ui-knob-range{stroke:var(--ui-knob-range-color, var(--global-background-muted))}.ui-knob-value{stroke:var(--ui-knob-value-color, var(--actions-high-surface-default));transition:stroke var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-knob-text{position:absolute;font-size:var(--ui-knob-font-size, var(--size-typography-title-md));font-weight:var(--weight-bold);color:var(--ui-knob-text-color, var(--global-text-default));font-variant-numeric:tabular-nums;pointer-events:none}.ui-knob._small{width:var(--ui-knob-size-small, 4.375rem);height:var(--ui-knob-size-small, 4.375rem)}.ui-knob._small .ui-knob-text{font-size:var(--ui-knob-font-size-small, var(--size-typography-text-lg))}.ui-knob._large{width:var(--ui-knob-size-large, 8.75rem);height:var(--ui-knob-size-large, 8.75rem)}.ui-knob._large .ui-knob-text{font-size:var(--ui-knob-font-size-large, var(--size-typography-title-default))}.ui-knob:hover .ui-knob-value{stroke:var(--actions-high-surface-hover)}.ui-knob:active .ui-knob-value{stroke:var(--actions-high-surface-pressed)}.ui-knob._readonly{cursor:default}.ui-knob._readonly:hover .ui-knob-value,.ui-knob._readonly:active .ui-knob-value{stroke:var(--ui-knob-value-color, var(--actions-high-surface-default))}.ui-knob._disabled{cursor:not-allowed}.ui-knob._disabled .ui-knob-value,.ui-knob._disabled:hover .ui-knob-value{stroke:var(--actions-high-surface-disabled)}.ui-knob._disabled .ui-knob-text{color:var(--global-text-muted)}.ui-knob._invalid .ui-knob-value{stroke:var(--form-error-content-default)}.ui-knob._invalid:hover .ui-knob-value{stroke:var(--form-error-content-hover)}.ui-knob._invalid:focus-visible{box-shadow:0 0 0 var(--ui-knob-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--form-error-stroke-focused)}\n"] }); }
267
+ }
268
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: UiKnob, decorators: [{
269
+ type: Component,
270
+ args: [{ selector: 'ui-knob', standalone: true, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiKnob), multi: true }], template: "<div\n #root\n [class]=\"classes()\"\n role=\"slider\"\n [attr.id]=\"resolvedId()\"\n [attr.tabindex]=\"isDisabled() ? -1 : (tabindex() ?? 0)\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"currentValue()\"\n [attr.aria-valuetext]=\"ariaValueText()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-disabled]=\"isDisabled() ? true : null\"\n [attr.aria-readonly]=\"readonly() ? true : null\"\n [attr.aria-required]=\"required() ? true : null\"\n [style.--ui-knob-value-color]=\"valueColor() ?? null\"\n [style.--ui-knob-range-color]=\"rangeColor() ?? null\"\n [style.--ui-knob-text-color]=\"textColor() ?? null\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n (keydown)=\"onKeyDown($event)\"\n (blur)=\"onBlur()\"\n>\n <!-- The value is carried by role=\"slider\" above: the drawing is decorative. -->\n <svg class=\"ui-knob-dial\" viewBox=\"0 0 100 100\" focusable=\"false\" aria-hidden=\"true\">\n <path class=\"ui-knob-range\" [attr.d]=\"rangePath()\" [attr.stroke-width]=\"strokeWidth()\"></path>\n <path class=\"ui-knob-value\" [attr.d]=\"valuePath()\" [attr.stroke-width]=\"strokeWidth()\"></path>\n </svg>\n\n @if (showValue()) {\n <span class=\"ui-knob-text\" aria-hidden=\"true\">{{ displayValue() }}</span>\n }\n</div>\n", styles: [":host{display:inline-block}.ui-knob{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--ui-knob-size, 6.25rem);height:var(--ui-knob-size, 6.25rem);border-radius:var(--ui-knob-radius, var(--radius-full));touch-action:none;cursor:pointer;-webkit-user-select:none;user-select:none;transition:box-shadow var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-knob:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-knob-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--actions-high-stroke-focused)}.ui-knob-dial{display:block;width:100%;height:100%}.ui-knob-range,.ui-knob-value{fill:none;stroke-linecap:round}.ui-knob-range{stroke:var(--ui-knob-range-color, var(--global-background-muted))}.ui-knob-value{stroke:var(--ui-knob-value-color, var(--actions-high-surface-default));transition:stroke var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-knob-text{position:absolute;font-size:var(--ui-knob-font-size, var(--size-typography-title-md));font-weight:var(--weight-bold);color:var(--ui-knob-text-color, var(--global-text-default));font-variant-numeric:tabular-nums;pointer-events:none}.ui-knob._small{width:var(--ui-knob-size-small, 4.375rem);height:var(--ui-knob-size-small, 4.375rem)}.ui-knob._small .ui-knob-text{font-size:var(--ui-knob-font-size-small, var(--size-typography-text-lg))}.ui-knob._large{width:var(--ui-knob-size-large, 8.75rem);height:var(--ui-knob-size-large, 8.75rem)}.ui-knob._large .ui-knob-text{font-size:var(--ui-knob-font-size-large, var(--size-typography-title-default))}.ui-knob:hover .ui-knob-value{stroke:var(--actions-high-surface-hover)}.ui-knob:active .ui-knob-value{stroke:var(--actions-high-surface-pressed)}.ui-knob._readonly{cursor:default}.ui-knob._readonly:hover .ui-knob-value,.ui-knob._readonly:active .ui-knob-value{stroke:var(--ui-knob-value-color, var(--actions-high-surface-default))}.ui-knob._disabled{cursor:not-allowed}.ui-knob._disabled .ui-knob-value,.ui-knob._disabled:hover .ui-knob-value{stroke:var(--actions-high-surface-disabled)}.ui-knob._disabled .ui-knob-text{color:var(--global-text-muted)}.ui-knob._invalid .ui-knob-value{stroke:var(--form-error-content-default)}.ui-knob._invalid:hover .ui-knob-value{stroke:var(--form-error-content-hover)}.ui-knob._invalid:focus-visible{box-shadow:0 0 0 var(--ui-knob-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--form-error-stroke-focused)}\n"] }]
271
+ }], ctorParameters: () => [], propDecorators: { min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], strokeWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "strokeWidth", required: false }] }], showValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValue", required: false }] }], valueTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueTemplate", required: false }] }], valueColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueColor", required: false }] }], rangeColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "rangeColor", required: false }] }], textColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "textColor", required: false }] }], knobChange: [{ type: i0.Output, args: ["knobChange"] }], root: [{ type: i0.ViewChild, args: ['root', { isSignal: true }] }] } });
272
+
273
+ /*
274
+ * Public API Surface of ui-kit/ui-knob
275
+ */
276
+
277
+ /**
278
+ * Generated bundle index. Do not edit.
279
+ */
280
+
281
+ export { UiKnob };
282
+ //# sourceMappingURL=4sh-ui-kit-forms-ui-knob.mjs.map