@i-cell/ids-angular 0.0.0-watch

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 (133) hide show
  1. package/README.md +24 -0
  2. package/accordion/index.d.ts +81 -0
  3. package/accordion/package.json +3 -0
  4. package/avatar/index.d.ts +66 -0
  5. package/avatar/package.json +3 -0
  6. package/badge/index.d.ts +61 -0
  7. package/badge/package.json +3 -0
  8. package/breadcrumb/index.d.ts +67 -0
  9. package/breadcrumb/package.json +3 -0
  10. package/button/index.d.ts +81 -0
  11. package/button/package.json +3 -0
  12. package/card/index.d.ts +91 -0
  13. package/card/package.json +3 -0
  14. package/checkbox/index.d.ts +137 -0
  15. package/checkbox/package.json +3 -0
  16. package/chip/index.d.ts +82 -0
  17. package/chip/package.json +3 -0
  18. package/core/index.d.ts +168 -0
  19. package/core/package.json +3 -0
  20. package/datepicker/index.d.ts +112 -0
  21. package/datepicker/package.json +3 -0
  22. package/dialog/index.d.ts +72 -0
  23. package/dialog/package.json +3 -0
  24. package/divider/index.d.ts +45 -0
  25. package/divider/package.json +3 -0
  26. package/fesm2022/i-cell-ids-angular-accordion.mjs +223 -0
  27. package/fesm2022/i-cell-ids-angular-accordion.mjs.map +1 -0
  28. package/fesm2022/i-cell-ids-angular-avatar.mjs +125 -0
  29. package/fesm2022/i-cell-ids-angular-avatar.mjs.map +1 -0
  30. package/fesm2022/i-cell-ids-angular-badge.mjs +172 -0
  31. package/fesm2022/i-cell-ids-angular-badge.mjs.map +1 -0
  32. package/fesm2022/i-cell-ids-angular-breadcrumb.mjs +313 -0
  33. package/fesm2022/i-cell-ids-angular-breadcrumb.mjs.map +1 -0
  34. package/fesm2022/i-cell-ids-angular-button.mjs +149 -0
  35. package/fesm2022/i-cell-ids-angular-button.mjs.map +1 -0
  36. package/fesm2022/i-cell-ids-angular-card.mjs +222 -0
  37. package/fesm2022/i-cell-ids-angular-card.mjs.map +1 -0
  38. package/fesm2022/i-cell-ids-angular-checkbox.mjs +350 -0
  39. package/fesm2022/i-cell-ids-angular-checkbox.mjs.map +1 -0
  40. package/fesm2022/i-cell-ids-angular-chip.mjs +166 -0
  41. package/fesm2022/i-cell-ids-angular-chip.mjs.map +1 -0
  42. package/fesm2022/i-cell-ids-angular-core.mjs +409 -0
  43. package/fesm2022/i-cell-ids-angular-core.mjs.map +1 -0
  44. package/fesm2022/i-cell-ids-angular-datepicker.mjs +860 -0
  45. package/fesm2022/i-cell-ids-angular-datepicker.mjs.map +1 -0
  46. package/fesm2022/i-cell-ids-angular-dialog.mjs +183 -0
  47. package/fesm2022/i-cell-ids-angular-dialog.mjs.map +1 -0
  48. package/fesm2022/i-cell-ids-angular-divider.mjs +76 -0
  49. package/fesm2022/i-cell-ids-angular-divider.mjs.map +1 -0
  50. package/fesm2022/i-cell-ids-angular-forms.mjs +972 -0
  51. package/fesm2022/i-cell-ids-angular-forms.mjs.map +1 -0
  52. package/fesm2022/i-cell-ids-angular-icon-button.mjs +120 -0
  53. package/fesm2022/i-cell-ids-angular-icon-button.mjs.map +1 -0
  54. package/fesm2022/i-cell-ids-angular-icon.mjs +158 -0
  55. package/fesm2022/i-cell-ids-angular-icon.mjs.map +1 -0
  56. package/fesm2022/i-cell-ids-angular-menu.mjs +154 -0
  57. package/fesm2022/i-cell-ids-angular-menu.mjs.map +1 -0
  58. package/fesm2022/i-cell-ids-angular-notification.mjs +167 -0
  59. package/fesm2022/i-cell-ids-angular-notification.mjs.map +1 -0
  60. package/fesm2022/i-cell-ids-angular-overlay-panel.mjs +72 -0
  61. package/fesm2022/i-cell-ids-angular-overlay-panel.mjs.map +1 -0
  62. package/fesm2022/i-cell-ids-angular-paginator.mjs +319 -0
  63. package/fesm2022/i-cell-ids-angular-paginator.mjs.map +1 -0
  64. package/fesm2022/i-cell-ids-angular-radio.mjs +312 -0
  65. package/fesm2022/i-cell-ids-angular-radio.mjs.map +1 -0
  66. package/fesm2022/i-cell-ids-angular-segmented-control-toggle.mjs +264 -0
  67. package/fesm2022/i-cell-ids-angular-segmented-control-toggle.mjs.map +1 -0
  68. package/fesm2022/i-cell-ids-angular-segmented-control.mjs +283 -0
  69. package/fesm2022/i-cell-ids-angular-segmented-control.mjs.map +1 -0
  70. package/fesm2022/i-cell-ids-angular-select.mjs +549 -0
  71. package/fesm2022/i-cell-ids-angular-select.mjs.map +1 -0
  72. package/fesm2022/i-cell-ids-angular-side-nav.mjs +375 -0
  73. package/fesm2022/i-cell-ids-angular-side-nav.mjs.map +1 -0
  74. package/fesm2022/i-cell-ids-angular-side-sheet.mjs +179 -0
  75. package/fesm2022/i-cell-ids-angular-side-sheet.mjs.map +1 -0
  76. package/fesm2022/i-cell-ids-angular-snackbar.mjs +440 -0
  77. package/fesm2022/i-cell-ids-angular-snackbar.mjs.map +1 -0
  78. package/fesm2022/i-cell-ids-angular-spinner.mjs +67 -0
  79. package/fesm2022/i-cell-ids-angular-spinner.mjs.map +1 -0
  80. package/fesm2022/i-cell-ids-angular-switch.mjs +181 -0
  81. package/fesm2022/i-cell-ids-angular-switch.mjs.map +1 -0
  82. package/fesm2022/i-cell-ids-angular-tab.mjs +142 -0
  83. package/fesm2022/i-cell-ids-angular-tab.mjs.map +1 -0
  84. package/fesm2022/i-cell-ids-angular-table.mjs +663 -0
  85. package/fesm2022/i-cell-ids-angular-table.mjs.map +1 -0
  86. package/fesm2022/i-cell-ids-angular-tag.mjs +116 -0
  87. package/fesm2022/i-cell-ids-angular-tag.mjs.map +1 -0
  88. package/fesm2022/i-cell-ids-angular-tooltip.mjs +586 -0
  89. package/fesm2022/i-cell-ids-angular-tooltip.mjs.map +1 -0
  90. package/fesm2022/i-cell-ids-angular.mjs +9 -0
  91. package/fesm2022/i-cell-ids-angular.mjs.map +1 -0
  92. package/forms/index.d.ts +470 -0
  93. package/forms/package.json +3 -0
  94. package/icon/index.d.ts +69 -0
  95. package/icon/package.json +3 -0
  96. package/icon-button/index.d.ts +68 -0
  97. package/icon-button/package.json +3 -0
  98. package/index.d.ts +2 -0
  99. package/menu/index.d.ts +68 -0
  100. package/menu/package.json +3 -0
  101. package/notification/index.d.ts +68 -0
  102. package/notification/package.json +3 -0
  103. package/overlay-panel/index.d.ts +41 -0
  104. package/overlay-panel/package.json +3 -0
  105. package/package.json +180 -0
  106. package/paginator/index.d.ts +122 -0
  107. package/paginator/package.json +3 -0
  108. package/radio/index.d.ts +95 -0
  109. package/radio/package.json +3 -0
  110. package/segmented-control/index.d.ts +98 -0
  111. package/segmented-control/package.json +3 -0
  112. package/segmented-control-toggle/index.d.ts +103 -0
  113. package/segmented-control-toggle/package.json +3 -0
  114. package/select/index.d.ts +103 -0
  115. package/select/package.json +3 -0
  116. package/side-nav/index.d.ts +107 -0
  117. package/side-nav/package.json +3 -0
  118. package/side-sheet/index.d.ts +84 -0
  119. package/side-sheet/package.json +3 -0
  120. package/snackbar/index.d.ts +149 -0
  121. package/snackbar/package.json +3 -0
  122. package/spinner/index.d.ts +41 -0
  123. package/spinner/package.json +3 -0
  124. package/switch/index.d.ts +89 -0
  125. package/switch/package.json +3 -0
  126. package/tab/index.d.ts +78 -0
  127. package/tab/package.json +3 -0
  128. package/table/index.d.ts +393 -0
  129. package/table/package.json +3 -0
  130. package/tag/index.d.ts +70 -0
  131. package/tag/package.json +3 -0
  132. package/tooltip/index.d.ts +96 -0
  133. package/tooltip/package.json +3 -0
@@ -0,0 +1,972 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, signal, ChangeDetectionStrategy, ViewEncapsulation, Component, InjectionToken, Directive, input, contentChildren, computed, inject, Injector, effect, booleanAttribute, Input, ElementRef, ChangeDetectorRef, viewChild, contentChild, isDevMode, output } from '@angular/core';
3
+ import { ComponentBase, IdsSize, ComponentBaseWithDefaults, coerceBooleanAttribute } from '@i-cell/ids-angular/core';
4
+ import { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
5
+ import { NgForm, FormGroupDirective, NgControl, Validators, StatusChangeEvent } from '@angular/forms';
6
+ import { Subject, observeOn, asapScheduler, tap, switchMap, of, startWith } from 'rxjs';
7
+ import { IdsIconComponent } from '@i-cell/ids-angular/icon';
8
+ import { hasModifierKey } from '@angular/cdk/keycodes';
9
+
10
+ class AbstractErrorStateMatcher {
11
+ }
12
+ class ErrorStateMatcher extends AbstractErrorStateMatcher {
13
+ isErrorState(control, form) {
14
+ return !!(control && control.invalid && (control.touched || (form && form.submitted)));
15
+ }
16
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: ErrorStateMatcher, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
17
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: ErrorStateMatcher, providedIn: 'root' }); }
18
+ }
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: ErrorStateMatcher, decorators: [{
20
+ type: Injectable,
21
+ args: [{ providedIn: 'root' }]
22
+ }] });
23
+ class ErrorStateTracker {
24
+ constructor(_matcher, _ngControl, _parentFormGroup, _parentForm, _stateChanges) {
25
+ this._matcher = _matcher;
26
+ this._ngControl = _ngControl;
27
+ this._parentFormGroup = _parentFormGroup;
28
+ this._parentForm = _parentForm;
29
+ this._stateChanges = _stateChanges;
30
+ /** Whether the tracker is currently in an error state. */
31
+ this.hasErrorState = false;
32
+ }
33
+ /** Updates the error state based on the provided error state matcher. */
34
+ updateErrorState() {
35
+ const oldState = this.hasErrorState;
36
+ const parent = this._parentFormGroup || this._parentForm;
37
+ const matcher = this._matcher;
38
+ const control = this._ngControl ? (this._ngControl.control) : null;
39
+ const newState = matcher?.isErrorState(control, parent) ?? false;
40
+ if (newState !== oldState) {
41
+ this.hasErrorState = newState;
42
+ this._stateChanges?.next();
43
+ }
44
+ }
45
+ }
46
+
47
+ class AbstractSuccessStateMatcher {
48
+ }
49
+ class SuccessStateMatcher extends AbstractSuccessStateMatcher {
50
+ isSuccessState(control, form) {
51
+ return !!(control && control.valid && (control.touched || (form && form.submitted)));
52
+ }
53
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: SuccessStateMatcher, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
54
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: SuccessStateMatcher, providedIn: 'root' }); }
55
+ }
56
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: SuccessStateMatcher, decorators: [{
57
+ type: Injectable,
58
+ args: [{ providedIn: 'root' }]
59
+ }] });
60
+ class SuccessStateTracker {
61
+ constructor(_matcher, _ngControl, _parentFormGroup, _parentForm, _stateChanges) {
62
+ this._matcher = _matcher;
63
+ this._ngControl = _ngControl;
64
+ this._parentFormGroup = _parentFormGroup;
65
+ this._parentForm = _parentForm;
66
+ this._stateChanges = _stateChanges;
67
+ /** Whether the tracker is currently in an success state. */
68
+ this.hasSuccessState = false;
69
+ }
70
+ /** Updates the success state based on the provided success state matcher. */
71
+ updateSuccessState() {
72
+ const oldState = this.hasSuccessState;
73
+ const parent = this._parentFormGroup || this._parentForm;
74
+ const matcher = this._matcher;
75
+ const control = this._ngControl ? (this._ngControl.control) : null;
76
+ const newState = matcher?.isSuccessState(control, parent) ?? false;
77
+ if (newState !== oldState) {
78
+ this.hasSuccessState = newState;
79
+ this._stateChanges?.next();
80
+ }
81
+ }
82
+ }
83
+
84
+ class IdsFieldsetRowComponent extends ComponentBase {
85
+ constructor() {
86
+ super(...arguments);
87
+ this._hostClasses = signal(this._getHostClasses([]), ...(ngDevMode ? [{ debugName: "_hostClasses" }] : []));
88
+ }
89
+ get _hostName() {
90
+ return 'fieldset-row';
91
+ }
92
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsFieldsetRowComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
93
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.7", type: IdsFieldsetRowComponent, isStandalone: true, selector: "ids-fieldset-row", usesInheritance: true, ngImport: i0, template: "<ng-content />\n", changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
94
+ }
95
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsFieldsetRowComponent, decorators: [{
96
+ type: Component,
97
+ args: [{ selector: 'ids-fieldset-row', imports: [], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content />\n" }]
98
+ }] });
99
+
100
+ const IdsFormFieldVariant = {
101
+ SURFACE: 'surface',
102
+ LIGHT: 'light',
103
+ };
104
+
105
+ const IDS_FIELDSET_DEFAULT_CONFIG = new InjectionToken('IDS_FIELDSET_DEFAULT_CONFIG', {
106
+ providedIn: 'root',
107
+ factory: IDS_FIELDSET_DEFAULT_CONFIG_FACTORY,
108
+ });
109
+ function IDS_FIELDSET_DEFAULT_CONFIG_FACTORY() {
110
+ return {
111
+ size: IdsSize.COMPACT,
112
+ variant: IdsFormFieldVariant.SURFACE,
113
+ };
114
+ }
115
+
116
+ class IdsFieldsetMessageDirective {
117
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsFieldsetMessageDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
118
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.7", type: IdsFieldsetMessageDirective, isStandalone: true, selector: "[idsFieldsetMessage]", ngImport: i0 }); }
119
+ }
120
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsFieldsetMessageDirective, decorators: [{
121
+ type: Directive,
122
+ args: [{
123
+ selector: '[idsFieldsetMessage]',
124
+ standalone: true,
125
+ }]
126
+ }] });
127
+
128
+ const defaultConfig$3 = IDS_FIELDSET_DEFAULT_CONFIG_FACTORY();
129
+ class IdsFieldsetComponent extends ComponentBaseWithDefaults {
130
+ constructor() {
131
+ super(...arguments);
132
+ this._defaultConfig = this._getDefaultConfig(defaultConfig$3, IDS_FIELDSET_DEFAULT_CONFIG);
133
+ this.size = input(this._defaultConfig.size, ...(ngDevMode ? [{ debugName: "size" }] : []));
134
+ this.variant = input(this._defaultConfig.variant, ...(ngDevMode ? [{ debugName: "variant" }] : []));
135
+ this.legend = input('', ...(ngDevMode ? [{ debugName: "legend" }] : []));
136
+ this._fieldsetMessage = contentChildren(IdsFieldsetMessageDirective, ...(ngDevMode ? [{ debugName: "_fieldsetMessage" }] : []));
137
+ this._hasMessage = computed(() => this._fieldsetMessage().length > 0, ...(ngDevMode ? [{ debugName: "_hasMessage" }] : []));
138
+ this._hostClasses = computed(() => this._getHostClasses([
139
+ this.size(),
140
+ this.variant(),
141
+ ]), ...(ngDevMode ? [{ debugName: "_hostClasses" }] : []));
142
+ }
143
+ get _hostName() {
144
+ return 'fieldset';
145
+ }
146
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsFieldsetComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
147
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: IdsFieldsetComponent, isStandalone: true, selector: "fieldset[idsFieldset]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, legend: { classPropertyName: "legend", publicName: "legend", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "_fieldsetMessage", predicate: IdsFieldsetMessageDirective, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<legend class=\"ids-fieldset-legend\">{{ legend() }}</legend>\n@if (_hasMessage()) {\n <div class=\"ids-fieldset-message\">\n <ng-content select=\"[idsFieldsetMessage]\" />\n </div>\n}\n<ng-content select=\"ids-fieldset-row\" />\n", changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
148
+ }
149
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsFieldsetComponent, decorators: [{
150
+ type: Component,
151
+ args: [{ selector: 'fieldset[idsFieldset]', imports: [], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<legend class=\"ids-fieldset-legend\">{{ legend() }}</legend>\n@if (_hasMessage()) {\n <div class=\"ids-fieldset-message\">\n <ng-content select=\"[idsFieldsetMessage]\" />\n </div>\n}\n<ng-content select=\"ids-fieldset-row\" />\n" }]
152
+ }] });
153
+
154
+ const IDS_FORM_FIELD_CONTROL = new InjectionToken('IDS_FORM_FIELD_CONTROL');
155
+
156
+ const formFieldControlClass = 'ids-form-field-control';
157
+ class IdsFormFieldControl extends ComponentBaseWithDefaults {
158
+ constructor() {
159
+ super();
160
+ this._injector = inject(Injector);
161
+ this._parentForm = inject(NgForm, { optional: true });
162
+ this._parentFormGroup = inject(FormGroupDirective, { optional: true });
163
+ this.ngControl = signal(null, ...(ngDevMode ? [{ debugName: "ngControl" }] : []));
164
+ this.errorStateChanges = new Subject();
165
+ this.successStateChanges = new Subject();
166
+ this.canHandleSuccessState = input(false, ...(ngDevMode ? [{ debugName: "canHandleSuccessState" }] : []));
167
+ this.hasErrorState = signal(false, ...(ngDevMode ? [{ debugName: "hasErrorState" }] : []));
168
+ this.hasSuccessState = signal(false, ...(ngDevMode ? [{ debugName: "hasSuccessState" }] : []));
169
+ this._canHandleSuccessStateEffect = effect(() => {
170
+ this._setSuccessStateTracker(this.canHandleSuccessState());
171
+ }, ...(ngDevMode ? [{ debugName: "_canHandleSuccessStateEffect" }] : []));
172
+ /** Handles the `disabled` input binding */
173
+ this.disabledInput = input(false, ...(ngDevMode ? [{ debugName: "disabledInput", transform: booleanAttribute, alias: 'disabled' }] : [{ transform: booleanAttribute, alias: 'disabled' }]));
174
+ /** Stores the `disabled` state internally */
175
+ this._disabled = signal(this.disabledInput(), ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
176
+ /** The input's `disabled` state as a read-only signal (to enable/disable the contol programmatically, use the FormControl's related API) */
177
+ this.disabled = computed(() => this._disabled(), ...(ngDevMode ? [{ debugName: "disabled" }] : []));
178
+ this.readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
179
+ /** This effect is triggered if the `disabled` attribute binding changes and delegates the change to the underlying FormControl */
180
+ this._disabledInputEffect = effect(() => {
181
+ const enableOrDisable = this.disabledInput() ? 'disable' : 'enable';
182
+ const controlDir = this.ngControl();
183
+ // The NgControl's `control` property might not be initialized so we delay the enable/disable call
184
+ // (the FormControl's enable/disable method call will trigger a StatusChangeEvent and/or the ControlValueAccessor's setDisabledState() callback
185
+ // so that we can update the `disabled` signal)
186
+ queueMicrotask(() => controlDir?.control?.[enableOrDisable]());
187
+ }, ...(ngDevMode ? [{ debugName: "_disabledInputEffect" }] : []));
188
+ this.required = input(false, ...(ngDevMode ? [{ debugName: "required", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
189
+ this.placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
190
+ // Get the NgControl reference as soon as we can
191
+ queueMicrotask(() => {
192
+ this.ngControl.set(this._injector.get(NgControl, null, { self: true }));
193
+ this._initErrorStateTracker();
194
+ });
195
+ }
196
+ setDescribedByIds(ids) {
197
+ if (ids.length) {
198
+ this._elementRef.nativeElement.setAttribute('aria-describedby', ids.join(' '));
199
+ }
200
+ else {
201
+ this._elementRef.nativeElement.removeAttribute('aria-describedby');
202
+ }
203
+ }
204
+ _initErrorStateTracker() {
205
+ this._errorStateTracker = new ErrorStateTracker(this.errorStateMatcher(), this.ngControl(), this._parentFormGroup, this._parentForm, this.errorStateChanges);
206
+ this.errorStateChanges.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => this.hasErrorState.set(this._errorStateTracker.hasErrorState));
207
+ this._errorStateTracker.updateErrorState();
208
+ }
209
+ _setSuccessStateTracker(canHandleSuccessState) {
210
+ if (canHandleSuccessState) {
211
+ this._successStateTracker = new SuccessStateTracker(this.successStateMatcher(), this.ngControl(), this._parentFormGroup, this._parentForm, this.successStateChanges);
212
+ this._successStateSubscription = this.successStateChanges.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => this.hasSuccessState.set(this._successStateTracker.hasSuccessState));
213
+ this._successStateTracker.updateSuccessState();
214
+ }
215
+ else {
216
+ this._successStateTracker = undefined;
217
+ this._successStateSubscription?.unsubscribe();
218
+ this.hasSuccessState.set(false);
219
+ }
220
+ }
221
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsFormFieldControl, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
222
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.7", type: IdsFormFieldControl, isStandalone: true, inputs: { canHandleSuccessState: { classPropertyName: "canHandleSuccessState", publicName: "canHandleSuccessState", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
223
+ }
224
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsFormFieldControl, decorators: [{
225
+ type: Directive
226
+ }], ctorParameters: () => [] });
227
+
228
+ const IDS_FORM_FIELD_DEFAULT_CONFIG = new InjectionToken('IDS_FORM_FIELD_DEFAULT_CONFIG', {
229
+ providedIn: 'root',
230
+ factory: IDS_FORM_FIELD_DEFAULT_CONFIG_FACTORY,
231
+ });
232
+ function IDS_FORM_FIELD_DEFAULT_CONFIG_FACTORY() {
233
+ return {
234
+ size: IdsSize.COMPACT,
235
+ variant: IdsFormFieldVariant.SURFACE,
236
+ };
237
+ }
238
+
239
+ class IdsFormFieldActionDirective {
240
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsFormFieldActionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
241
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.7", type: IdsFormFieldActionDirective, isStandalone: true, selector: "[idsFormFieldAction]", ngImport: i0 }); }
242
+ }
243
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsFormFieldActionDirective, decorators: [{
244
+ type: Directive,
245
+ args: [{
246
+ selector: '[idsFormFieldAction]',
247
+ standalone: true,
248
+ }]
249
+ }] });
250
+
251
+ class IdsPrefixDirective {
252
+ constructor() {
253
+ this.isLeadingIcon = false;
254
+ }
255
+ set idsLeadingIcon(value) {
256
+ this.isLeadingIcon = true;
257
+ }
258
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsPrefixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
259
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.7", type: IdsPrefixDirective, isStandalone: true, selector: "[idsPrefix], [idsLeadingIcon]", inputs: { idsLeadingIcon: "idsLeadingIcon" }, ngImport: i0 }); }
260
+ }
261
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsPrefixDirective, decorators: [{
262
+ type: Directive,
263
+ args: [{
264
+ selector: '[idsPrefix], [idsLeadingIcon]',
265
+ standalone: true,
266
+ }]
267
+ }], propDecorators: { idsLeadingIcon: [{
268
+ type: Input,
269
+ args: ['idsLeadingIcon']
270
+ }] } });
271
+
272
+ class IdsSuffixDirective {
273
+ constructor() {
274
+ this.isTrailingIcon = false;
275
+ }
276
+ set idsTrailingIcon(value) {
277
+ this.isTrailingIcon = true;
278
+ }
279
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsSuffixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
280
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.7", type: IdsSuffixDirective, isStandalone: true, selector: "[idsSuffix], [idsTrailingIcon]", inputs: { idsTrailingIcon: "idsTrailingIcon" }, ngImport: i0 }); }
281
+ }
282
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsSuffixDirective, decorators: [{
283
+ type: Directive,
284
+ args: [{
285
+ selector: '[idsSuffix], [idsTrailingIcon]',
286
+ standalone: true,
287
+ }]
288
+ }], propDecorators: { idsTrailingIcon: [{
289
+ type: Input,
290
+ args: ['idsTrailingIcon']
291
+ }] } });
292
+
293
+ function isEmptyInputValue(value) {
294
+ return (value == null || ((typeof value === 'string' || Array.isArray(value)) && value.length === 0));
295
+ }
296
+ class IdsValidators {
297
+ static required(control) {
298
+ return requiredValidator(control);
299
+ }
300
+ static requiredTrue(control) {
301
+ return requiredTrueValidator(control);
302
+ }
303
+ static requiredFalse(control) {
304
+ return requiredFalseValidator(control);
305
+ }
306
+ }
307
+ function requiredValidator(control) {
308
+ return isEmptyInputValue(control.value) ? { required: true } : null;
309
+ }
310
+ function requiredTrueValidator(control) {
311
+ return control.value === true ? null : { requiredTrue: true };
312
+ }
313
+ function requiredFalseValidator(control) {
314
+ return control.value === false ? null : { requiredFalse: true };
315
+ }
316
+
317
+ /**
318
+ * Directive to map an error message to an error code for a form field.
319
+ * Mappings must be defined between the directive element's tags ordered by priority (descending from top to bottom).
320
+ * The error code is provided as an attribute, while the error message will be this directive's text content.
321
+ * The latter can be a plain string literal or even an interpolated string value.
322
+ *
323
+ * @example
324
+ * ```html
325
+ * <ids-form-field>
326
+ * <ids-label>Input field</ids-label>
327
+ * <input
328
+ * idsInput
329
+ * ngModel
330
+ * customValidator
331
+ * required
332
+ * [minlength]="3"
333
+ * [maxlength]="10"
334
+ * [pattern]="validPattern"
335
+ * >
336
+ * <ids-error-message>
337
+ * <ids-error-def code="required">{{ 'ERROR.REQUIRED.CUSTOM' | translate }}</ids-error-def>
338
+ * <ids-error-def code="minlength">'minLength' error message</ids-error-def>
339
+ * <ids-error-def code="maxlength">'maxLength' error message</ids-error-def>
340
+ * <ids-error-def code="pattern">'pattern' error message with interpolation: {{ model.value }}</ids-error-def>
341
+ * <ids-error-def code="custom">Custom validator error message</ids-error-def>
342
+ * </ids-error-message>
343
+ * </ids-form-field>
344
+ * ```
345
+ */
346
+ class IdsErrorDefinitionDirective {
347
+ constructor() {
348
+ /**
349
+ * The validation error's identifier code
350
+ */
351
+ this.code = input.required(...(ngDevMode ? [{ debugName: "code" }] : []));
352
+ this._elementRef = inject(ElementRef);
353
+ }
354
+ /**
355
+ * The validation error's message that will be presented to the user
356
+ */
357
+ get errorMessage() {
358
+ return this._elementRef.nativeElement.innerText;
359
+ }
360
+ /**
361
+ * Creates a IdsErrorMessageMapping instance based on this directive's state (code, errorMessage)
362
+ * @returns A IdsErrorMessageMapping instance
363
+ */
364
+ toErrorMessageMapping() {
365
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
366
+ const self = this;
367
+ return {
368
+ code: this.code(),
369
+ message: () => self.errorMessage,
370
+ };
371
+ }
372
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsErrorDefinitionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
373
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.7", type: IdsErrorDefinitionDirective, isStandalone: true, selector: "ids-error-def", inputs: { code: { classPropertyName: "code", publicName: "code", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
374
+ }
375
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsErrorDefinitionDirective, decorators: [{
376
+ type: Directive,
377
+ args: [{
378
+ selector: 'ids-error-def',
379
+ }]
380
+ }] });
381
+
382
+ class IdsMessageSuffixDirective {
383
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsMessageSuffixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
384
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.7", type: IdsMessageSuffixDirective, isStandalone: true, selector: "[idsMessageSuffix]", ngImport: i0 }); }
385
+ }
386
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsMessageSuffixDirective, decorators: [{
387
+ type: Directive,
388
+ args: [{
389
+ selector: '[idsMessageSuffix]',
390
+ standalone: true,
391
+ }]
392
+ }] });
393
+
394
+ const IdsMessageVariant = {
395
+ SURFACE: 'surface',
396
+ LIGHT: 'light',
397
+ DARK: 'dark',
398
+ };
399
+
400
+ const IDS_MESSAGE_DEFAULT_CONFIG = new InjectionToken('IDS_MESSAGE_DEFAULT_CONFIG', {
401
+ providedIn: 'root',
402
+ factory: IDS_MESSAGE_DEFAULT_CONFIG_FACTORY,
403
+ });
404
+ function IDS_MESSAGE_DEFAULT_CONFIG_FACTORY() {
405
+ return {
406
+ size: IdsSize.COMPACT,
407
+ variant: IdsMessageVariant.SURFACE,
408
+ };
409
+ }
410
+
411
+ // eslint-disable-next-line @typescript-eslint/naming-convention
412
+ const IDS_MESSAGE_PARENT_FORM_FIELD = new InjectionToken('IDS_MESSAGE_PARENT_FORM_FIELD');
413
+
414
+ const defaultConfig$2 = IDS_MESSAGE_DEFAULT_CONFIG_FACTORY();
415
+ class IdsMessageDirective extends ComponentBaseWithDefaults {
416
+ constructor() {
417
+ super(...arguments);
418
+ this._parent = inject(IDS_MESSAGE_PARENT_FORM_FIELD, { skipSelf: true, optional: true });
419
+ this._defaultConfig = this._getDefaultConfig(defaultConfig$2, IDS_MESSAGE_DEFAULT_CONFIG);
420
+ this.size = input(this._defaultConfig.size, ...(ngDevMode ? [{ debugName: "size" }] : []));
421
+ this.variant = input(this._defaultConfig.variant, ...(ngDevMode ? [{ debugName: "variant" }] : []));
422
+ this._parentOrSelfSize = computed(() => this._parent?.size() ?? this.size(), ...(ngDevMode ? [{ debugName: "_parentOrSelfSize" }] : []));
423
+ this._parentOrSelfVariant = computed(() => this._parent?.variant() ?? this.variant(), ...(ngDevMode ? [{ debugName: "_parentOrSelfVariant" }] : []));
424
+ this._parentDisabled = computed(() => this._parent?.disabled(), ...(ngDevMode ? [{ debugName: "_parentDisabled" }] : []));
425
+ this._hostClasses = computed(() => this._getHostClasses([
426
+ this._parentOrSelfSize(),
427
+ this._parentOrSelfVariant(),
428
+ this._parentDisabled() ? 'disabled' : null,
429
+ ]), ...(ngDevMode ? [{ debugName: "_hostClasses" }] : []));
430
+ }
431
+ get _hostName() {
432
+ return 'message';
433
+ }
434
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsMessageDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
435
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.7", type: IdsMessageDirective, isStandalone: true, selector: "[idsMessage]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
436
+ }
437
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsMessageDirective, decorators: [{
438
+ type: Directive,
439
+ args: [{
440
+ selector: '[idsMessage]',
441
+ standalone: true,
442
+ }]
443
+ }] });
444
+
445
+ class IdsErrorMessageComponent extends ComponentBase {
446
+ get _hostName() {
447
+ return 'error-message';
448
+ }
449
+ constructor() {
450
+ super();
451
+ this._parent = inject(IdsFormFieldComponent, { skipSelf: true });
452
+ this._control = signal(null, ...(ngDevMode ? [{ debugName: "_control" }] : []));
453
+ this._errorDefDirs = contentChildren(IdsErrorDefinitionDirective, ...(ngDevMode ? [{ debugName: "_errorDefDirs" }] : []));
454
+ this._errorDefs = computed(() => this._errorDefDirs().map((errorDefDir) => errorDefDir.toErrorMessageMapping()), ...(ngDevMode ? [{ debugName: "_errorDefs" }] : []));
455
+ this._validationError = signal(null, ...(ngDevMode ? [{ debugName: "_validationError" }] : []));
456
+ this._hostClasses = computed(() => this._getHostClasses([]), ...(ngDevMode ? [{ debugName: "_hostClasses" }] : []));
457
+ this.suffixes = contentChildren(IdsMessageSuffixDirective, ...(ngDevMode ? [{ debugName: "suffixes" }] : []));
458
+ toObservable(this._parent.controlDir).pipe(observeOn(asapScheduler), tap((controlDir) => this._control.set(controlDir?.control ?? null)), switchMap(() => this._control()?.statusChanges.pipe(startWith(this._control()?.status)) ?? of(null)), takeUntilDestroyed(this._destroyRef)).subscribe((status) => {
459
+ if (status === 'INVALID') {
460
+ const nextError = this._selectMostImportantValidationError();
461
+ this._validationError.set(nextError);
462
+ }
463
+ else {
464
+ this._validationError.set(null);
465
+ }
466
+ });
467
+ }
468
+ _selectMostImportantValidationError() {
469
+ const errorDefs = this._errorDefs();
470
+ const control = this._control();
471
+ if (!errorDefs?.length || !control?.errors || Object.keys(control.errors).length === 0) {
472
+ return null;
473
+ }
474
+ const errorCodes = new Set(Object.keys(control.errors));
475
+ return errorDefs.find((errorDef) => errorCodes.has(errorDef.code)) ?? null;
476
+ }
477
+ _getValidationErrorMessage(messageOrFn) {
478
+ return messageOrFn instanceof Function ? messageOrFn() : messageOrFn;
479
+ }
480
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsErrorMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
481
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: IdsErrorMessageComponent, isStandalone: true, selector: "ids-error-message", queries: [{ propertyName: "_errorDefDirs", predicate: IdsErrorDefinitionDirective, isSignal: true }, { propertyName: "suffixes", predicate: IdsMessageSuffixDirective, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: IdsMessageDirective }], ngImport: i0, template: "<div class=\"ids-message__prefix\">\n <ng-content select=\"[idsMessagePrefix]\">\n <ids-icon aria-hidden=\"true\" fontIcon=\"exclamation-circle\" variant=\"error\" />\n </ng-content>\n</div>\n<div class=\"ids-message__text\">\n @let validationError = _validationError();\n @if (validationError) {\n @let messageString = _getValidationErrorMessage(validationError.message);\n {{ messageString }}\n }\n</div>\n@if (suffixes().length) {\n <div class=\"ids-message__suffix\">\n <ng-content select=\"[idsMessageSuffix]\" />\n </div>\n}\n", dependencies: [{ kind: "component", type: IdsIconComponent, selector: "ids-icon", inputs: ["size", "sizeCollection", "variant", "fontIcon", "svgIcon", "aria-hidden"] }], encapsulation: i0.ViewEncapsulation.None }); }
482
+ }
483
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsErrorMessageComponent, decorators: [{
484
+ type: Component,
485
+ args: [{ selector: 'ids-error-message', imports: [IdsIconComponent], hostDirectives: [IdsMessageDirective], encapsulation: ViewEncapsulation.None, template: "<div class=\"ids-message__prefix\">\n <ng-content select=\"[idsMessagePrefix]\">\n <ids-icon aria-hidden=\"true\" fontIcon=\"exclamation-circle\" variant=\"error\" />\n </ng-content>\n</div>\n<div class=\"ids-message__text\">\n @let validationError = _validationError();\n @if (validationError) {\n @let messageString = _getValidationErrorMessage(validationError.message);\n {{ messageString }}\n }\n</div>\n@if (suffixes().length) {\n <div class=\"ids-message__suffix\">\n <ng-content select=\"[idsMessageSuffix]\" />\n </div>\n}\n" }]
486
+ }], ctorParameters: () => [] });
487
+
488
+ class IdsMessagePrefixDirective {
489
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsMessagePrefixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
490
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.7", type: IdsMessagePrefixDirective, isStandalone: true, selector: "[idsMessagePrefix]", ngImport: i0 }); }
491
+ }
492
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsMessagePrefixDirective, decorators: [{
493
+ type: Directive,
494
+ args: [{
495
+ selector: '[idsMessagePrefix]',
496
+ standalone: true,
497
+ }]
498
+ }] });
499
+
500
+ class IdsHintMessageComponent {
501
+ constructor() {
502
+ this.prefixes = contentChildren(IdsMessagePrefixDirective, ...(ngDevMode ? [{ debugName: "prefixes" }] : []));
503
+ this.suffixes = contentChildren(IdsMessageSuffixDirective, ...(ngDevMode ? [{ debugName: "suffixes" }] : []));
504
+ }
505
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsHintMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
506
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: IdsHintMessageComponent, isStandalone: true, selector: "ids-hint-message", host: { classAttribute: "ids-hint-message" }, queries: [{ propertyName: "prefixes", predicate: IdsMessagePrefixDirective, isSignal: true }, { propertyName: "suffixes", predicate: IdsMessageSuffixDirective, isSignal: true }], hostDirectives: [{ directive: IdsMessageDirective, inputs: ["size", "size", "variant", "variant"] }], ngImport: i0, template: "@if (prefixes().length) {\n <div class=\"ids-message__prefix\">\n <ng-content select=\"[idsMessagePrefix]\" />\n </div>\n}\n<div class=\"ids-message__text\">\n <ng-content />\n</div>\n@if (suffixes().length) {\n <div class=\"ids-message__suffix\">\n <ng-content select=\"[idsMessageSuffix]\" />\n </div>\n}\n", encapsulation: i0.ViewEncapsulation.None }); }
507
+ }
508
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsHintMessageComponent, decorators: [{
509
+ type: Component,
510
+ args: [{ selector: 'ids-hint-message', imports: [], host: {
511
+ class: 'ids-hint-message',
512
+ }, hostDirectives: [
513
+ {
514
+ directive: IdsMessageDirective,
515
+ inputs: [
516
+ 'size: size',
517
+ 'variant: variant',
518
+ ],
519
+ },
520
+ ], encapsulation: ViewEncapsulation.None, template: "@if (prefixes().length) {\n <div class=\"ids-message__prefix\">\n <ng-content select=\"[idsMessagePrefix]\" />\n </div>\n}\n<div class=\"ids-message__text\">\n <ng-content />\n</div>\n@if (suffixes().length) {\n <div class=\"ids-message__suffix\">\n <ng-content select=\"[idsMessageSuffix]\" />\n </div>\n}\n" }]
521
+ }] });
522
+
523
+ class IdsSuccessMessageComponent extends ComponentBase {
524
+ constructor() {
525
+ super(...arguments);
526
+ this._hostClasses = computed(() => this._getHostClasses([]), ...(ngDevMode ? [{ debugName: "_hostClasses" }] : []));
527
+ this.suffixes = contentChildren(IdsMessageSuffixDirective, ...(ngDevMode ? [{ debugName: "suffixes" }] : []));
528
+ }
529
+ get _hostName() {
530
+ return 'success-message';
531
+ }
532
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsSuccessMessageComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
533
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: IdsSuccessMessageComponent, isStandalone: true, selector: "ids-success-message", queries: [{ propertyName: "suffixes", predicate: IdsMessageSuffixDirective, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: IdsMessageDirective }], ngImport: i0, template: "<div class=\"ids-message__prefix\">\n <ng-content select=\"[idsMessagePrefix]\">\n <ids-icon aria-hidden=\"true\" fontIcon=\"check\" variant=\"success\" />\n </ng-content>\n</div>\n<div class=\"ids-message__text\">\n <ng-content />\n</div>\n@if (suffixes().length) {\n <div class=\"ids-message__suffix\">\n <ng-content select=\"[idsMessageSuffix]\" />\n </div>\n}\n", dependencies: [{ kind: "component", type: IdsIconComponent, selector: "ids-icon", inputs: ["size", "sizeCollection", "variant", "fontIcon", "svgIcon", "aria-hidden"] }], encapsulation: i0.ViewEncapsulation.None }); }
534
+ }
535
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsSuccessMessageComponent, decorators: [{
536
+ type: Component,
537
+ args: [{ selector: 'ids-success-message', imports: [IdsIconComponent], hostDirectives: [IdsMessageDirective], encapsulation: ViewEncapsulation.None, template: "<div class=\"ids-message__prefix\">\n <ng-content select=\"[idsMessagePrefix]\">\n <ids-icon aria-hidden=\"true\" fontIcon=\"check\" variant=\"success\" />\n </ng-content>\n</div>\n<div class=\"ids-message__text\">\n <ng-content />\n</div>\n@if (suffixes().length) {\n <div class=\"ids-message__suffix\">\n <ng-content select=\"[idsMessageSuffix]\" />\n </div>\n}\n" }]
538
+ }] });
539
+
540
+ const defaultConfig$1 = IDS_FORM_FIELD_DEFAULT_CONFIG_FACTORY();
541
+ class IdsFormFieldComponent extends ComponentBaseWithDefaults {
542
+ constructor() {
543
+ super(...arguments);
544
+ this._changeDetectorRef = inject(ChangeDetectorRef);
545
+ this._parentFieldset = inject(IdsFieldsetComponent, { optional: true });
546
+ this._defaultConfig = this._getDefaultConfig(defaultConfig$1, IDS_FORM_FIELD_DEFAULT_CONFIG);
547
+ this._fieldWrapper = viewChild.required('fieldWrapper');
548
+ this._child = contentChild.required(IDS_FORM_FIELD_CONTROL);
549
+ this._hintMessages = contentChildren(IdsHintMessageComponent, ...(ngDevMode ? [{ debugName: "_hintMessages", descendants: true }] : [{ descendants: true }]));
550
+ this._successMessages = contentChildren(IdsSuccessMessageComponent, ...(ngDevMode ? [{ debugName: "_successMessages", descendants: true }] : [{ descendants: true }]));
551
+ this._errorMessages = contentChildren(IdsErrorMessageComponent, ...(ngDevMode ? [{ debugName: "_errorMessages", descendants: true }] : [{ descendants: true }]));
552
+ this._actions = contentChildren(IdsFormFieldActionDirective, ...(ngDevMode ? [{ debugName: "_actions" }] : []));
553
+ this._prefixes = contentChildren(IdsPrefixDirective, ...(ngDevMode ? [{ debugName: "_prefixes" }] : []));
554
+ this._suffixes = contentChildren(IdsSuffixDirective, ...(ngDevMode ? [{ debugName: "_suffixes" }] : []));
555
+ this._hasActions = computed(() => Boolean(this._actions().length), ...(ngDevMode ? [{ debugName: "_hasActions" }] : []));
556
+ this._hasLeadingIcon = computed(() => Boolean(this._prefixes().filter((prefix) => prefix.isLeadingIcon).length), ...(ngDevMode ? [{ debugName: "_hasLeadingIcon" }] : []));
557
+ this._hasPrefix = computed(() => Boolean(this._prefixes().filter((prefix) => !prefix.isLeadingIcon).length), ...(ngDevMode ? [{ debugName: "_hasPrefix" }] : []));
558
+ this._hasSuffix = computed(() => Boolean(this._suffixes().filter((suffix) => !suffix.isTrailingIcon).length), ...(ngDevMode ? [{ debugName: "_hasSuffix" }] : []));
559
+ this._hasTrailingIcon = computed(() => Boolean(this._suffixes().filter((suffix) => suffix.isTrailingIcon).length), ...(ngDevMode ? [{ debugName: "_hasTrailingIcon" }] : []));
560
+ this._inputId = computed(() => this._child()?.id(), ...(ngDevMode ? [{ debugName: "_inputId" }] : []));
561
+ this.size = input(this._defaultConfig.size, ...(ngDevMode ? [{ debugName: "size" }] : []));
562
+ this.variant = input(this._defaultConfig.variant, ...(ngDevMode ? [{ debugName: "variant" }] : []));
563
+ this.parentOrSelfSize = computed(() => this._parentFieldset?.size() ?? this.size(), ...(ngDevMode ? [{ debugName: "parentOrSelfSize" }] : []));
564
+ this.parentOrSelfVariant = computed(() => this._parentFieldset?.variant() ?? this.variant(), ...(ngDevMode ? [{ debugName: "parentOrSelfVariant" }] : []));
565
+ this.controlDir = computed(() => this._child().ngControl(), ...(ngDevMode ? [{ debugName: "controlDir" }] : []));
566
+ this.disabled = computed(() => Boolean(this._child().disabled()), ...(ngDevMode ? [{ debugName: "disabled" }] : []));
567
+ this.readonly = computed(() => Boolean(this._child().readonly()), ...(ngDevMode ? [{ debugName: "readonly" }] : []));
568
+ this._hasErrorState = computed(() => Boolean(this._child().hasErrorState()), ...(ngDevMode ? [{ debugName: "_hasErrorState" }] : []));
569
+ this._hasSuccessState = computed(() => Boolean(this._child().hasSuccessState()), ...(ngDevMode ? [{ debugName: "_hasSuccessState" }] : []));
570
+ this._hostClasses = computed(() => this._getHostClasses([
571
+ this.parentOrSelfSize(),
572
+ this.parentOrSelfVariant(),
573
+ this.disabled() ? 'disabled' : null,
574
+ this._hasErrorState() ? 'invalid' : null,
575
+ this._hasSuccessState() ? 'valid' : null,
576
+ ]), ...(ngDevMode ? [{ debugName: "_hostClasses" }] : []));
577
+ this._displayedMessages = computed(() => {
578
+ if (this._errorMessages().length > 0 && this._hasErrorState()) {
579
+ return 'error';
580
+ }
581
+ if (this._successMessages().length > 0 && this._hasSuccessState()) {
582
+ return 'success';
583
+ }
584
+ if (this._hintMessages().length > 0) {
585
+ return 'hint';
586
+ }
587
+ return undefined;
588
+ }, ...(ngDevMode ? [{ debugName: "_displayedMessages" }] : []));
589
+ this.hasRequiredValidator = computed(() => {
590
+ const control = this.controlDir()?.control;
591
+ return this._child().required()
592
+ || control?.hasValidator(Validators.required)
593
+ || control?.hasValidator(Validators.requiredTrue)
594
+ || control?.hasValidator(IdsValidators.required)
595
+ || control?.hasValidator(IdsValidators.requiredTrue)
596
+ || control?.hasValidator(IdsValidators.requiredFalse);
597
+ }, ...(ngDevMode ? [{ debugName: "hasRequiredValidator" }] : []));
598
+ }
599
+ get _hostName() {
600
+ return 'form-field';
601
+ }
602
+ getConnectedOverlayOrigin() {
603
+ return this._fieldWrapper();
604
+ }
605
+ containerClick(event) {
606
+ const containerClick = this._child().onContainerClick;
607
+ if (containerClick) {
608
+ containerClick(event);
609
+ }
610
+ }
611
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsFormFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
612
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: IdsFormFieldComponent, isStandalone: true, selector: "ids-form-field", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "_child", first: true, predicate: IDS_FORM_FIELD_CONTROL, descendants: true, isSignal: true }, { propertyName: "_hintMessages", predicate: IdsHintMessageComponent, descendants: true, isSignal: true }, { propertyName: "_successMessages", predicate: IdsSuccessMessageComponent, descendants: true, isSignal: true }, { propertyName: "_errorMessages", predicate: IdsErrorMessageComponent, descendants: true, isSignal: true }, { propertyName: "_actions", predicate: IdsFormFieldActionDirective, isSignal: true }, { propertyName: "_prefixes", predicate: IdsPrefixDirective, isSignal: true }, { propertyName: "_suffixes", predicate: IdsSuffixDirective, isSignal: true }], viewQueries: [{ propertyName: "_fieldWrapper", first: true, predicate: ["fieldWrapper"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<label class=\"ids-form-field__label\" [for]=\"_inputId()\">\n @if (hasRequiredValidator()) {\n <span class=\"ids-form-field__required-marker\"></span>\n }\n <ng-content select=\"ids-label\" />\n</label>\n\n<div #fieldWrapper class=\"ids-form-field__field-wrapper\">\n <div class=\"ids-form-field__field-wrapper__container\" (click)=\"containerClick($event)\">\n @if (_hasLeadingIcon()) {\n <div class=\"ids-form-field__leading-icon\">\n <ng-content select=\"ids-icon[idsLeadingIcon]\" />\n </div>\n }\n @if (_hasPrefix()) {\n <div class=\"ids-form-field__prefix\">\n <ng-content select=\"[idsPrefix]\" />\n </div>\n }\n <div class=\"ids-form-field__infix\">\n <ng-content />\n </div>\n @if (_hasSuffix()) {\n <div class=\"ids-form-field__suffix\">\n <ng-content select=\"[idsSuffix]\" />\n </div>\n }\n @if (_hasTrailingIcon()) {\n <div class=\"ids-form-field__trailing-icon\">\n <ng-content select=\"ids-icon[idsTrailingIcon]\" />\n </div>\n }\n </div>\n @if (_hasActions()) {\n <div class=\"ids-form-field__field-wrapper__action\">\n <ng-content select=\"[idsFormFieldAction]\" />\n </div>\n }\n</div>\n\n<div class=\"ids-form-field__subscript-wrapper\">\n @let messages = _displayedMessages();\n @if (messages) {\n <div class=\"ids-form-field__message-container\">\n @switch (messages) {\n @case (\"error\") {\n <ng-content select=\"ids-error-message\" />\n }\n @case (\"success\") {\n <ng-content select=\"ids-success-message\" />\n }\n @case (\"hint\") {\n <ng-content select=\"ids-hint-message\" />\n }\n }\n </div>\n }\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
613
+ }
614
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsFormFieldComponent, decorators: [{
615
+ type: Component,
616
+ args: [{ selector: 'ids-form-field', imports: [], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<label class=\"ids-form-field__label\" [for]=\"_inputId()\">\n @if (hasRequiredValidator()) {\n <span class=\"ids-form-field__required-marker\"></span>\n }\n <ng-content select=\"ids-label\" />\n</label>\n\n<div #fieldWrapper class=\"ids-form-field__field-wrapper\">\n <div class=\"ids-form-field__field-wrapper__container\" (click)=\"containerClick($event)\">\n @if (_hasLeadingIcon()) {\n <div class=\"ids-form-field__leading-icon\">\n <ng-content select=\"ids-icon[idsLeadingIcon]\" />\n </div>\n }\n @if (_hasPrefix()) {\n <div class=\"ids-form-field__prefix\">\n <ng-content select=\"[idsPrefix]\" />\n </div>\n }\n <div class=\"ids-form-field__infix\">\n <ng-content />\n </div>\n @if (_hasSuffix()) {\n <div class=\"ids-form-field__suffix\">\n <ng-content select=\"[idsSuffix]\" />\n </div>\n }\n @if (_hasTrailingIcon()) {\n <div class=\"ids-form-field__trailing-icon\">\n <ng-content select=\"ids-icon[idsTrailingIcon]\" />\n </div>\n }\n </div>\n @if (_hasActions()) {\n <div class=\"ids-form-field__field-wrapper__action\">\n <ng-content select=\"[idsFormFieldAction]\" />\n </div>\n }\n</div>\n\n<div class=\"ids-form-field__subscript-wrapper\">\n @let messages = _displayedMessages();\n @if (messages) {\n <div class=\"ids-form-field__message-container\">\n @switch (messages) {\n @case (\"error\") {\n <ng-content select=\"ids-error-message\" />\n }\n @case (\"success\") {\n <ng-content select=\"ids-success-message\" />\n }\n @case (\"hint\") {\n <ng-content select=\"ids-hint-message\" />\n }\n }\n </div>\n }\n</div>\n" }]
617
+ }] });
618
+
619
+ const IDS_INPUT_DEFAULT_CONFIG = new InjectionToken('IDS_INPUT_DEFAULT_CONFIG', {
620
+ providedIn: 'root',
621
+ factory: IDS_INPUT_DEFAULT_CONFIG_FACTORY,
622
+ });
623
+ function IDS_INPUT_DEFAULT_CONFIG_FACTORY() {
624
+ return {
625
+ errorStateMatcher: ErrorStateMatcher,
626
+ successStateMatcher: SuccessStateMatcher,
627
+ };
628
+ }
629
+
630
+ const defaultConfig = IDS_INPUT_DEFAULT_CONFIG_FACTORY();
631
+ const IDS_INPUT_INVALID_TYPES = [
632
+ 'button',
633
+ 'checkbox',
634
+ 'file',
635
+ 'hidden',
636
+ 'image',
637
+ 'radio',
638
+ 'range',
639
+ 'reset',
640
+ 'submit',
641
+ ];
642
+ class IdsInputDirective extends IdsFormFieldControl {
643
+ constructor() {
644
+ super(...arguments);
645
+ this._elementRef = inject(ElementRef);
646
+ this._defaultConfig = this._getDefaultConfig(defaultConfig, IDS_INPUT_DEFAULT_CONFIG);
647
+ this._focused = false;
648
+ this.name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : []));
649
+ this.type = input('text', ...(ngDevMode ? [{ debugName: "type" }] : []));
650
+ this.errorStateMatcher = input(inject(this._defaultConfig.errorStateMatcher), ...(ngDevMode ? [{ debugName: "errorStateMatcher" }] : []));
651
+ this.successStateMatcher = input(inject(this._defaultConfig.successStateMatcher), ...(ngDevMode ? [{ debugName: "successStateMatcher" }] : []));
652
+ this._hostClasses = computed(() => this._getHostClasses([], [formFieldControlClass]), ...(ngDevMode ? [{ debugName: "_hostClasses" }] : []));
653
+ this._validateTypeEffect = effect(() => {
654
+ this._validateType(this.type());
655
+ }, ...(ngDevMode ? [{ debugName: "_validateTypeEffect" }] : []));
656
+ /**
657
+ * Should be an arrow function in order to handle `this` outside of this class
658
+ */
659
+ this.onContainerClick = () => {
660
+ if (!this._focused && !this.readonly() && !this.disabled) {
661
+ this.focus();
662
+ }
663
+ };
664
+ }
665
+ get _hostName() {
666
+ return 'input';
667
+ }
668
+ ngAfterViewInit() {
669
+ queueMicrotask(() => {
670
+ const control = this.ngControl()?.control;
671
+ if (control) {
672
+ this._disabled.set(control.status === 'DISABLED');
673
+ control.events.pipe(takeUntilDestroyed(this._destroyRef)).subscribe((event) => this.updateControlState(event));
674
+ }
675
+ });
676
+ }
677
+ _validateType(type) {
678
+ if (isDevMode() && IDS_INPUT_INVALID_TYPES.indexOf(type) > -1) {
679
+ throw this._createHostError(`Input type ${type} is not supportedby idsInput`);
680
+ }
681
+ }
682
+ focus(options) {
683
+ this._elementRef.nativeElement.focus(options);
684
+ }
685
+ _focusChanged(isFocused) {
686
+ if (isFocused !== this._focused) {
687
+ this._focused = isFocused;
688
+ }
689
+ }
690
+ updateControlState(event) {
691
+ this._errorStateTracker?.updateErrorState();
692
+ this._successStateTracker?.updateSuccessState();
693
+ if (event instanceof StatusChangeEvent) {
694
+ this._disabled.set(event.status === 'DISABLED');
695
+ }
696
+ }
697
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsInputDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
698
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.7", type: IdsInputDirective, isStandalone: true, selector: "input[idsInput][ngModel]:not([formControl]):not([formControlName]),\n input[idsInput][formControl]:not([ngModel]):not([formControlName]),\n input[idsInput][formControlName]:not([ngModel]):not([formControl]),\n textarea[idsInput][ngModel]:not([formControl]):not([formControlName]),\n textarea[idsInput][formControl]:not([ngModel]):not([formControlName]),\n textarea[idsInput][formControlName]:not([ngModel]):not([formControl])", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, errorStateMatcher: { classPropertyName: "errorStateMatcher", publicName: "errorStateMatcher", isSignal: true, isRequired: false, transformFunction: null }, successStateMatcher: { classPropertyName: "successStateMatcher", publicName: "successStateMatcher", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focus": "_focusChanged(true)", "blur": "_focusChanged(false)" }, properties: { "attr.placeholder": "placeholder()", "attr.disabled": "disabled() ? \"\" : null", "attr.readonly": "readonly() ? \"\" : null" } }, providers: [
699
+ {
700
+ provide: IDS_FORM_FIELD_CONTROL,
701
+ useExisting: IdsInputDirective,
702
+ },
703
+ ], exportAs: ["idsInput"], usesInheritance: true, ngImport: i0 }); }
704
+ }
705
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsInputDirective, decorators: [{
706
+ type: Directive,
707
+ args: [{
708
+ selector: `input[idsInput][ngModel]:not([formControl]):not([formControlName]),
709
+ input[idsInput][formControl]:not([ngModel]):not([formControlName]),
710
+ input[idsInput][formControlName]:not([ngModel]):not([formControl]),
711
+ textarea[idsInput][ngModel]:not([formControl]):not([formControlName]),
712
+ textarea[idsInput][formControl]:not([ngModel]):not([formControlName]),
713
+ textarea[idsInput][formControlName]:not([ngModel]):not([formControl])`,
714
+ exportAs: 'idsInput',
715
+ standalone: true,
716
+ providers: [
717
+ {
718
+ provide: IDS_FORM_FIELD_CONTROL,
719
+ useExisting: IdsInputDirective,
720
+ },
721
+ ],
722
+ host: {
723
+ '[attr.placeholder]': 'placeholder()',
724
+ '[attr.disabled]': 'disabled() ? "" : null',
725
+ '[attr.readonly]': 'readonly() ? "" : null',
726
+ '(focus)': '_focusChanged(true)',
727
+ '(blur)': '_focusChanged(false)',
728
+ },
729
+ }]
730
+ }] });
731
+
732
+ const Message = {
733
+ HINT: 'hint',
734
+ ERROR: 'error',
735
+ SUCCESS: 'success',
736
+ };
737
+
738
+ const IDS_OPTION_GROUP = new InjectionToken('IdsOptionGroup');
739
+
740
+ const IDS_OPTION_PARENT_COMPONENT = new InjectionToken('IDS_OPTION_PARENT_COMPONENT');
741
+
742
+ class IdsOptionSelectionChange {
743
+ constructor(source, selected, isUserInput = false) {
744
+ this.source = source;
745
+ this.selected = selected;
746
+ this.isUserInput = isUserInput;
747
+ }
748
+ }
749
+
750
+ class IdsOptionGroupComponent extends ComponentBase {
751
+ constructor() {
752
+ super(...arguments);
753
+ this._parent = inject(IDS_OPTION_PARENT_COMPONENT);
754
+ this._inert = this._parent?.inertGroups ?? false;
755
+ this.label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
756
+ this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: coerceBooleanAttribute }] : [{ transform: coerceBooleanAttribute }]));
757
+ this._labelId = computed(() => `${this.id()}-label`, ...(ngDevMode ? [{ debugName: "_labelId" }] : []));
758
+ this._hostClasses = computed(() => this._getHostClasses([
759
+ this.disabled() ? 'disabled' : null,
760
+ this._parent.parentSize(),
761
+ this._parent.parentVariant(),
762
+ ]), ...(ngDevMode ? [{ debugName: "_hostClasses" }] : []));
763
+ }
764
+ get _hostName() {
765
+ return 'option-group';
766
+ }
767
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsOptionGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
768
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.7", type: IdsOptionGroupComponent, isStandalone: true, selector: "ids-option-group", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.role": "_inert ? null : \"group\"", "attr.aria-disabled": "_inert ? null : disabled().toString()", "attr.aria-labelledby": "_inert ? null : _labelId()" } }, providers: [{ provide: IDS_OPTION_GROUP, useExisting: IdsOptionGroupComponent }], usesInheritance: true, ngImport: i0, template: "<div role=\"presentation\" class=\"ids-option-group__label\" [id]=\"_labelId()\">\n <div class=\"ids-option-group__text\">{{ label() }}</div>\n</div>\n<ng-content select=\"ids-option, ng-container\" />\n", changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
769
+ }
770
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsOptionGroupComponent, decorators: [{
771
+ type: Component,
772
+ args: [{ selector: 'ids-option-group', imports: [], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: IDS_OPTION_GROUP, useExisting: IdsOptionGroupComponent }], host: {
773
+ '[attr.role]': '_inert ? null : "group"',
774
+ '[attr.aria-disabled]': '_inert ? null : disabled().toString()',
775
+ '[attr.aria-labelledby]': '_inert ? null : _labelId()',
776
+ }, template: "<div role=\"presentation\" class=\"ids-option-group__label\" [id]=\"_labelId()\">\n <div class=\"ids-option-group__text\">{{ label() }}</div>\n</div>\n<ng-content select=\"ids-option, ng-container\" />\n" }]
777
+ }] });
778
+
779
+ const IDS_PSEUDO_CHECKBOX_PARENT = new InjectionToken('IDS_PSEUDO_CHECKBOX_PARENT');
780
+
781
+ const IdsPseudoCheckboxState = {
782
+ UNCHECKED: 'unchecked',
783
+ CHECKED: 'checked',
784
+ INDETERMINATE: 'indeterminate',
785
+ };
786
+
787
+ class PseudoCheckboxComponent extends ComponentBase {
788
+ constructor() {
789
+ super(...arguments);
790
+ this._parent = inject(IDS_PSEUDO_CHECKBOX_PARENT, { optional: true });
791
+ this.checkboxState = input(IdsPseudoCheckboxState.UNCHECKED, ...(ngDevMode ? [{ debugName: "checkboxState" }] : []));
792
+ this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: coerceBooleanAttribute }] : [{ transform: coerceBooleanAttribute }]));
793
+ this._isChecked = computed(() => this.checkboxState() === IdsPseudoCheckboxState.CHECKED, ...(ngDevMode ? [{ debugName: "_isChecked" }] : []));
794
+ this._isIndeterminate = computed(() => this.checkboxState() === IdsPseudoCheckboxState.INDETERMINATE, ...(ngDevMode ? [{ debugName: "_isIndeterminate" }] : []));
795
+ this._hostClasses = computed(() => this._getHostClasses([
796
+ this._parent?.embeddedPseudoCheckboxSize(),
797
+ this._parent?.embeddedPseudoCheckboxVariant(),
798
+ this.disabled() ? 'disabled' : null,
799
+ ]), ...(ngDevMode ? [{ debugName: "_hostClasses" }] : []));
800
+ }
801
+ get _hostName() {
802
+ return 'pseudo-checkbox';
803
+ }
804
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PseudoCheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
805
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: PseudoCheckboxComponent, isStandalone: true, selector: "ids-pseudo-checkbox", inputs: { checkboxState: { classPropertyName: "checkboxState", publicName: "checkboxState", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: "<div class=\"ids-pseudo-checkbox__input-wrapper\">\n <input\n type=\"checkbox\"\n [disabled]=\"disabled()\"\n [attr.aria-checked]=\"_isIndeterminate() ? 'mixed' : null\"\n [checked]=\"_isChecked()\"\n [indeterminate]=\"_isIndeterminate()\"\n (change)=\"$event.stopPropagation()\"\n />\n <div class=\"ids-pseudo-checkbox__icon\" aria-hidden=\"true\">\n @if (_isIndeterminate()) {\n <ids-icon fontIcon=\"minus\" aria-hidden=\"true\" />\n }\n @if (_isChecked()) {\n <ids-icon fontIcon=\"check\" aria-hidden=\"true\" />\n }\n </div>\n</div>\n", dependencies: [{ kind: "component", type: IdsIconComponent, selector: "ids-icon", inputs: ["size", "sizeCollection", "variant", "fontIcon", "svgIcon", "aria-hidden"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
806
+ }
807
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: PseudoCheckboxComponent, decorators: [{
808
+ type: Component,
809
+ args: [{ selector: 'ids-pseudo-checkbox', imports: [IdsIconComponent], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ids-pseudo-checkbox__input-wrapper\">\n <input\n type=\"checkbox\"\n [disabled]=\"disabled()\"\n [attr.aria-checked]=\"_isIndeterminate() ? 'mixed' : null\"\n [checked]=\"_isChecked()\"\n [indeterminate]=\"_isIndeterminate()\"\n (change)=\"$event.stopPropagation()\"\n />\n <div class=\"ids-pseudo-checkbox__icon\" aria-hidden=\"true\">\n @if (_isIndeterminate()) {\n <ids-icon fontIcon=\"minus\" aria-hidden=\"true\" />\n }\n @if (_isChecked()) {\n <ids-icon fontIcon=\"check\" aria-hidden=\"true\" />\n }\n </div>\n</div>\n" }]
810
+ }] });
811
+
812
+ class IdsOptionComponent extends ComponentBase {
813
+ get _hostName() {
814
+ return 'option';
815
+ }
816
+ constructor() {
817
+ super();
818
+ this._parent = inject(IDS_OPTION_PARENT_COMPONENT);
819
+ this._element = inject(ElementRef);
820
+ this.group = inject(IDS_OPTION_GROUP, { optional: true });
821
+ this._textElement = viewChild.required('text');
822
+ this.selected = signal(false, ...(ngDevMode ? [{ debugName: "selected" }] : []));
823
+ this._active = signal(false, ...(ngDevMode ? [{ debugName: "_active" }] : []));
824
+ this.size = computed(() => this._parent.parentSize(), ...(ngDevMode ? [{ debugName: "size" }] : []));
825
+ this.variant = computed(() => this._parent.parentVariant(), ...(ngDevMode ? [{ debugName: "variant" }] : []));
826
+ this.value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
827
+ this.explicitViewValue = input(null, ...(ngDevMode ? [{ debugName: "explicitViewValue", alias: 'viewValue' }] : [{ alias: 'viewValue' }]));
828
+ this.disabledInput = input(false, ...(ngDevMode ? [{ debugName: "disabledInput", alias: 'disabled', transform: coerceBooleanAttribute }] : [{ alias: 'disabled', transform: coerceBooleanAttribute }]));
829
+ this.disabled = false; // Do not delete this class member, until ListKeyManagerOption requires: `disabled: boolean`
830
+ this._groupOrOptionIsDisabled = computed(() => this.group?.disabled() || this.disabledInput(), ...(ngDevMode ? [{ debugName: "_groupOrOptionIsDisabled" }] : []));
831
+ this._multiSelect = Boolean(this._parent?.multiSelect());
832
+ this.onSelectionChange = output();
833
+ this.viewValue = computed(() => this._textElement().nativeElement.textContent || this.explicitViewValue() || '', ...(ngDevMode ? [{ debugName: "viewValue" }] : []));
834
+ this._hostClasses = computed(() => this._getHostClasses([
835
+ this.selected() ? 'selected' : null,
836
+ this._active() ? 'active' : null,
837
+ this._groupOrOptionIsDisabled() ? 'disabled' : null,
838
+ this._multiSelect ? 'multiselect' : null,
839
+ this.size(),
840
+ this.variant(),
841
+ ]), ...(ngDevMode ? [{ debugName: "_hostClasses" }] : []));
842
+ this._pseudoCheckboxState = computed(() => (this.selected() ? IdsPseudoCheckboxState.CHECKED : IdsPseudoCheckboxState.UNCHECKED), ...(ngDevMode ? [{ debugName: "_pseudoCheckboxState" }] : []));
843
+ this.embeddedPseudoCheckboxSize = computed(() => this.size(), ...(ngDevMode ? [{ debugName: "embeddedPseudoCheckboxSize" }] : []));
844
+ this.embeddedPseudoCheckboxVariant = signal(IdsFormFieldVariant.SURFACE, ...(ngDevMode ? [{ debugName: "embeddedPseudoCheckboxVariant" }] : []));
845
+ effect(() => {
846
+ this.disabled = this.disabledInput();
847
+ });
848
+ }
849
+ ngOnInit() {
850
+ const parent = this._parent;
851
+ if (parent.isOptionPreSelectedByValue(this.value())) {
852
+ this.selected.set(true);
853
+ }
854
+ }
855
+ _handleKeydown(event) {
856
+ if ((event.key === 'ENTER' || event.key === ' ') && !hasModifierKey(event)) {
857
+ this.selectViaInteraction();
858
+ event.preventDefault();
859
+ }
860
+ }
861
+ selectViaInteraction() {
862
+ if (!this._groupOrOptionIsDisabled()) {
863
+ this._emitSelectionChangeEvent(!this.selected(), true);
864
+ }
865
+ }
866
+ getHostElement() {
867
+ return this._element.nativeElement;
868
+ }
869
+ select(emitEvent = true) {
870
+ if (!this.selected()) {
871
+ if (emitEvent) {
872
+ this._emitSelectionChangeEvent(true);
873
+ }
874
+ }
875
+ }
876
+ deselect(emitEvent = true) {
877
+ if (this.selected()) {
878
+ if (emitEvent) {
879
+ this._emitSelectionChangeEvent(false);
880
+ }
881
+ }
882
+ }
883
+ focus(_origin, options) {
884
+ const element = this._element.nativeElement;
885
+ if (typeof element.focus === 'function') {
886
+ element.focus(options);
887
+ }
888
+ }
889
+ setActiveStyles() {
890
+ if (!this._active()) {
891
+ this._active.set(true);
892
+ }
893
+ }
894
+ setInactiveStyles() {
895
+ if (this._active()) {
896
+ this._active.set(false);
897
+ }
898
+ }
899
+ getLabel() {
900
+ return this.viewValue();
901
+ }
902
+ _emitSelectionChangeEvent(selected, isUserInput = false) {
903
+ if (this._multiSelect || !this.selected()) {
904
+ this.onSelectionChange.emit(new IdsOptionSelectionChange(this, selected, isUserInput));
905
+ }
906
+ }
907
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsOptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
908
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: IdsOptionComponent, isStandalone: true, selector: "ids-option", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, explicitViewValue: { classPropertyName: "explicitViewValue", publicName: "viewValue", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSelectionChange: "onSelectionChange" }, host: { attributes: { "role": "option" }, listeners: { "click": "selectViaInteraction()", "keydown": "_handleKeydown($event)" }, properties: { "attr.aria-selected": "selected()", "attr.aria-disabled": "disabled.toString()" } }, providers: [
909
+ {
910
+ provide: IDS_PSEUDO_CHECKBOX_PARENT,
911
+ useExisting: IdsOptionComponent,
912
+ },
913
+ ], viewQueries: [{ propertyName: "_textElement", first: true, predicate: ["text"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (_multiSelect) {\n <ids-pseudo-checkbox aria-hidden=\"true\" [disabled]=\"_groupOrOptionIsDisabled()\" [checkboxState]=\"_pseudoCheckboxState()\" />\n}\n\n<div #text class=\"ids-option__text\"><ng-content /></div>\n\n@if (!_multiSelect && selected()) {\n <ids-icon fontIcon=\"check\" />\n}\n", dependencies: [{ kind: "component", type: IdsIconComponent, selector: "ids-icon", inputs: ["size", "sizeCollection", "variant", "fontIcon", "svgIcon", "aria-hidden"] }, { kind: "component", type: PseudoCheckboxComponent, selector: "ids-pseudo-checkbox", inputs: ["checkboxState", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
914
+ }
915
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsOptionComponent, decorators: [{
916
+ type: Component,
917
+ args: [{ selector: 'ids-option', imports: [
918
+ IdsIconComponent,
919
+ PseudoCheckboxComponent,
920
+ ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
921
+ {
922
+ provide: IDS_PSEUDO_CHECKBOX_PARENT,
923
+ useExisting: IdsOptionComponent,
924
+ },
925
+ ], host: {
926
+ 'role': 'option',
927
+ '[attr.aria-selected]': 'selected()',
928
+ '[attr.aria-disabled]': 'disabled.toString()',
929
+ '(click)': 'selectViaInteraction()',
930
+ '(keydown)': '_handleKeydown($event)',
931
+ }, template: "@if (_multiSelect) {\n <ids-pseudo-checkbox aria-hidden=\"true\" [disabled]=\"_groupOrOptionIsDisabled()\" [checkboxState]=\"_pseudoCheckboxState()\" />\n}\n\n<div #text class=\"ids-option__text\"><ng-content /></div>\n\n@if (!_multiSelect && selected()) {\n <ids-icon fontIcon=\"check\" />\n}\n" }]
932
+ }], ctorParameters: () => [] });
933
+ function _countGroupLabelsBeforeOption(optionIndex, options, optionGroups) {
934
+ if (optionGroups.length) {
935
+ let groupCounter = 0;
936
+ for (let i = 0; i < optionIndex + 1; i++) {
937
+ if (options[i].group && options[i].group === optionGroups[groupCounter]) {
938
+ groupCounter++;
939
+ }
940
+ }
941
+ return groupCounter;
942
+ }
943
+ return 0;
944
+ }
945
+ function _getOptionScrollPosition(optionOffset, optionHeight, currentScrollPosition, panelHeight) {
946
+ if (optionOffset < currentScrollPosition) {
947
+ return optionOffset;
948
+ }
949
+ if (optionOffset + optionHeight > currentScrollPosition + panelHeight) {
950
+ return Math.max(0, optionOffset - panelHeight + optionHeight);
951
+ }
952
+ return currentScrollPosition;
953
+ }
954
+
955
+ class IdsLabelDirective {
956
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
957
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.7", type: IdsLabelDirective, isStandalone: true, selector: "ids-label", ngImport: i0 }); }
958
+ }
959
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: IdsLabelDirective, decorators: [{
960
+ type: Directive,
961
+ args: [{
962
+ selector: 'ids-label',
963
+ standalone: true,
964
+ }]
965
+ }] });
966
+
967
+ /**
968
+ * Generated bundle index. Do not edit.
969
+ */
970
+
971
+ export { AbstractErrorStateMatcher, AbstractSuccessStateMatcher, ErrorStateMatcher, ErrorStateTracker, IDS_FIELDSET_DEFAULT_CONFIG, IDS_FIELDSET_DEFAULT_CONFIG_FACTORY, IDS_FORM_FIELD_CONTROL, IDS_FORM_FIELD_DEFAULT_CONFIG, IDS_FORM_FIELD_DEFAULT_CONFIG_FACTORY, IDS_INPUT_DEFAULT_CONFIG, IDS_INPUT_DEFAULT_CONFIG_FACTORY, IDS_MESSAGE_DEFAULT_CONFIG, IDS_MESSAGE_DEFAULT_CONFIG_FACTORY, IDS_OPTION_GROUP, IDS_OPTION_PARENT_COMPONENT, IDS_PSEUDO_CHECKBOX_PARENT, IdsErrorDefinitionDirective, IdsErrorMessageComponent, IdsFieldsetComponent, IdsFieldsetMessageDirective, IdsFieldsetRowComponent, IdsFormFieldActionDirective, IdsFormFieldComponent, IdsFormFieldControl, IdsFormFieldVariant, IdsHintMessageComponent, IdsInputDirective, IdsLabelDirective, IdsMessageDirective, IdsMessagePrefixDirective, IdsMessageSuffixDirective, IdsMessageVariant, IdsOptionComponent, IdsOptionGroupComponent, IdsOptionSelectionChange, IdsPrefixDirective, IdsPseudoCheckboxState, IdsSuccessMessageComponent, IdsSuffixDirective, IdsValidators, Message, PseudoCheckboxComponent, SuccessStateMatcher, SuccessStateTracker, _countGroupLabelsBeforeOption, _getOptionScrollPosition, formFieldControlClass, requiredFalseValidator, requiredTrueValidator, requiredValidator };
972
+ //# sourceMappingURL=i-cell-ids-angular-forms.mjs.map