@rossigee/clarity-angular 18.2.1-fixed.1 → 18.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/fesm2022/clr-angular-accordion.mjs +355 -0
  2. package/fesm2022/clr-angular-accordion.mjs.map +1 -0
  3. package/fesm2022/clr-angular-button.mjs +713 -0
  4. package/fesm2022/clr-angular-button.mjs.map +1 -0
  5. package/fesm2022/clr-angular-collapsible-panel.mjs +201 -0
  6. package/fesm2022/clr-angular-collapsible-panel.mjs.map +1 -0
  7. package/fesm2022/clr-angular-data-datagrid.mjs +7635 -0
  8. package/fesm2022/clr-angular-data-datagrid.mjs.map +1 -0
  9. package/fesm2022/clr-angular-data-stack-view.mjs +442 -0
  10. package/fesm2022/clr-angular-data-stack-view.mjs.map +1 -0
  11. package/fesm2022/clr-angular-data-tree-view.mjs +1106 -0
  12. package/fesm2022/clr-angular-data-tree-view.mjs.map +1 -0
  13. package/fesm2022/clr-angular-data.mjs +40 -0
  14. package/fesm2022/clr-angular-data.mjs.map +1 -0
  15. package/fesm2022/clr-angular-emphasis-alert.mjs +624 -0
  16. package/fesm2022/clr-angular-emphasis-alert.mjs.map +1 -0
  17. package/fesm2022/clr-angular-emphasis-badge.mjs +69 -0
  18. package/fesm2022/clr-angular-emphasis-badge.mjs.map +1 -0
  19. package/fesm2022/clr-angular-emphasis-common.mjs +25 -0
  20. package/fesm2022/clr-angular-emphasis-common.mjs.map +1 -0
  21. package/fesm2022/clr-angular-emphasis-label.mjs +105 -0
  22. package/fesm2022/clr-angular-emphasis-label.mjs.map +1 -0
  23. package/fesm2022/clr-angular-emphasis.mjs +41 -0
  24. package/fesm2022/clr-angular-emphasis.mjs.map +1 -0
  25. package/fesm2022/clr-angular-forms-checkbox.mjs +270 -0
  26. package/fesm2022/clr-angular-forms-checkbox.mjs.map +1 -0
  27. package/fesm2022/clr-angular-forms-combobox.mjs +1775 -0
  28. package/fesm2022/clr-angular-forms-combobox.mjs.map +1 -0
  29. package/fesm2022/clr-angular-forms-common.mjs +1251 -0
  30. package/fesm2022/clr-angular-forms-common.mjs.map +1 -0
  31. package/fesm2022/clr-angular-forms-datalist.mjs +263 -0
  32. package/fesm2022/clr-angular-forms-datalist.mjs.map +1 -0
  33. package/fesm2022/clr-angular-forms-datepicker.mjs +3274 -0
  34. package/fesm2022/clr-angular-forms-datepicker.mjs.map +1 -0
  35. package/fesm2022/clr-angular-forms-file-input.mjs +826 -0
  36. package/fesm2022/clr-angular-forms-file-input.mjs.map +1 -0
  37. package/fesm2022/clr-angular-forms-input.mjs +153 -0
  38. package/fesm2022/clr-angular-forms-input.mjs.map +1 -0
  39. package/fesm2022/clr-angular-forms-number-input.mjs +236 -0
  40. package/fesm2022/clr-angular-forms-number-input.mjs.map +1 -0
  41. package/fesm2022/clr-angular-forms-password.mjs +233 -0
  42. package/fesm2022/clr-angular-forms-password.mjs.map +1 -0
  43. package/fesm2022/clr-angular-forms-radio.mjs +231 -0
  44. package/fesm2022/clr-angular-forms-radio.mjs.map +1 -0
  45. package/fesm2022/clr-angular-forms-range.mjs +186 -0
  46. package/fesm2022/clr-angular-forms-range.mjs.map +1 -0
  47. package/fesm2022/clr-angular-forms-select.mjs +153 -0
  48. package/fesm2022/clr-angular-forms-select.mjs.map +1 -0
  49. package/fesm2022/clr-angular-forms-textarea.mjs +136 -0
  50. package/fesm2022/clr-angular-forms-textarea.mjs.map +1 -0
  51. package/fesm2022/clr-angular-forms.mjs +100 -0
  52. package/fesm2022/clr-angular-forms.mjs.map +1 -0
  53. package/fesm2022/clr-angular-icon.mjs +7397 -0
  54. package/fesm2022/clr-angular-icon.mjs.map +1 -0
  55. package/fesm2022/clr-angular-layout-breadcrumbs.mjs +120 -0
  56. package/fesm2022/clr-angular-layout-breadcrumbs.mjs.map +1 -0
  57. package/fesm2022/clr-angular-layout-main-container.mjs +100 -0
  58. package/fesm2022/clr-angular-layout-main-container.mjs.map +1 -0
  59. package/fesm2022/clr-angular-layout-nav.mjs +582 -0
  60. package/fesm2022/clr-angular-layout-nav.mjs.map +1 -0
  61. package/fesm2022/clr-angular-layout-tabs.mjs +807 -0
  62. package/fesm2022/clr-angular-layout-tabs.mjs.map +1 -0
  63. package/fesm2022/clr-angular-layout-vertical-nav.mjs +507 -0
  64. package/fesm2022/clr-angular-layout-vertical-nav.mjs.map +1 -0
  65. package/fesm2022/clr-angular-layout.mjs +44 -0
  66. package/fesm2022/clr-angular-layout.mjs.map +1 -0
  67. package/fesm2022/clr-angular-modal.mjs +617 -0
  68. package/fesm2022/clr-angular-modal.mjs.map +1 -0
  69. package/fesm2022/clr-angular-popover-common.mjs +1082 -0
  70. package/fesm2022/clr-angular-popover-common.mjs.map +1 -0
  71. package/fesm2022/clr-angular-popover-dropdown.mjs +492 -0
  72. package/fesm2022/clr-angular-popover-dropdown.mjs.map +1 -0
  73. package/fesm2022/clr-angular-popover-signpost.mjs +494 -0
  74. package/fesm2022/clr-angular-popover-signpost.mjs.map +1 -0
  75. package/fesm2022/clr-angular-popover-tooltip.mjs +293 -0
  76. package/fesm2022/clr-angular-popover-tooltip.mjs.map +1 -0
  77. package/fesm2022/clr-angular-popover.mjs +41 -0
  78. package/fesm2022/clr-angular-popover.mjs.map +1 -0
  79. package/fesm2022/clr-angular-progress-progress-bars.mjs +217 -0
  80. package/fesm2022/clr-angular-progress-progress-bars.mjs.map +1 -0
  81. package/fesm2022/clr-angular-progress-spinner.mjs +132 -0
  82. package/fesm2022/clr-angular-progress-spinner.mjs.map +1 -0
  83. package/fesm2022/clr-angular-stepper.mjs +694 -0
  84. package/fesm2022/clr-angular-stepper.mjs.map +1 -0
  85. package/fesm2022/clr-angular-timeline.mjs +316 -0
  86. package/fesm2022/clr-angular-timeline.mjs.map +1 -0
  87. package/fesm2022/clr-angular-utils-conditional.mjs +351 -0
  88. package/fesm2022/clr-angular-utils-conditional.mjs.map +1 -0
  89. package/fesm2022/clr-angular-utils-loading.mjs +107 -0
  90. package/fesm2022/clr-angular-utils-loading.mjs.map +1 -0
  91. package/fesm2022/clr-angular-utils.mjs +2079 -0
  92. package/fesm2022/clr-angular-utils.mjs.map +1 -0
  93. package/fesm2022/clr-angular-wizard.mjs +3074 -0
  94. package/fesm2022/clr-angular-wizard.mjs.map +1 -0
  95. package/fesm2022/clr-angular.mjs +2 -2
  96. package/fesm2022/clr-angular.mjs.map +1 -1
  97. package/package.json +7 -5
  98. package/schematics/ng-update/index.d.ts +2 -0
  99. package/schematics/ng-update/index.js +69 -0
  100. package/schematics/ng-update/index.js.map +1 -0
  101. package/schematics/ng-update/migrations/css-migration.d.ts +6 -0
  102. package/schematics/ng-update/migrations/css-migration.js +177 -0
  103. package/schematics/ng-update/migrations/css-migration.js.map +1 -0
  104. package/schematics/ng-update/migrations/import-migration.d.ts +4 -0
  105. package/schematics/ng-update/migrations/import-migration.js +187 -0
  106. package/schematics/ng-update/migrations/import-migration.js.map +1 -0
  107. package/schematics/ng-update/migrations/template-migration.d.ts +6 -0
  108. package/schematics/ng-update/migrations/template-migration.js +261 -0
  109. package/schematics/ng-update/migrations/template-migration.js.map +1 -0
  110. package/schematics/ng-update/replacements/css-replacements.d.ts +17 -0
  111. package/schematics/ng-update/replacements/css-replacements.js +74 -0
  112. package/schematics/ng-update/replacements/css-replacements.js.map +1 -0
  113. package/schematics/ng-update/replacements/import-replacements.d.ts +13 -0
  114. package/schematics/ng-update/replacements/import-replacements.js +108 -0
  115. package/schematics/ng-update/replacements/import-replacements.js.map +1 -0
  116. package/schematics/ng-update/replacements/symbol-replacements.d.ts +12 -0
  117. package/schematics/ng-update/replacements/symbol-replacements.js +67 -0
  118. package/schematics/ng-update/replacements/symbol-replacements.js.map +1 -0
  119. package/schematics/ng-update/replacements/template-replacements.d.ts +19 -0
  120. package/schematics/ng-update/replacements/template-replacements.js +57 -0
  121. package/schematics/ng-update/replacements/template-replacements.js.map +1 -0
  122. package/schematics/ng-update/tests/test-helpers.d.ts +6 -0
  123. package/schematics/ng-update/tests/test-helpers.js +34 -0
  124. package/schematics/ng-update/tests/test-helpers.js.map +1 -0
  125. package/schematics/ng-update/utils/file-visitor.d.ts +8 -0
  126. package/schematics/ng-update/utils/file-visitor.js +44 -0
  127. package/schematics/ng-update/utils/file-visitor.js.map +1 -0
  128. package/schematics/ng-update/utils/regexp-utils.d.ts +16 -0
  129. package/schematics/ng-update/utils/regexp-utils.js +34 -0
  130. package/schematics/ng-update/utils/regexp-utils.js.map +1 -0
  131. package/schematics/vitest.config.d.ts +2 -0
  132. package/schematics/vitest.config.js +17 -0
  133. package/schematics/vitest.config.js.map +1 -0
  134. package/types/clr-angular-accordion.d.ts +100 -0
  135. package/types/clr-angular-button.d.ts +169 -0
  136. package/types/clr-angular-collapsible-panel.d.ts +73 -0
  137. package/types/clr-angular-data-datagrid.d.ts +1843 -0
  138. package/types/clr-angular-data-stack-view.d.ts +87 -0
  139. package/types/clr-angular-data-tree-view.d.ts +229 -0
  140. package/types/clr-angular-data.d.ts +15 -0
  141. package/types/clr-angular-emphasis-alert.d.ts +175 -0
  142. package/types/clr-angular-emphasis-badge.d.ts +25 -0
  143. package/types/clr-angular-emphasis-common.d.ts +6 -0
  144. package/types/clr-angular-emphasis-label.d.ts +29 -0
  145. package/types/clr-angular-emphasis.d.ts +15 -0
  146. package/types/clr-angular-forms-checkbox.d.ts +69 -0
  147. package/types/clr-angular-forms-combobox.d.ts +353 -0
  148. package/types/clr-angular-forms-common.d.ts +339 -0
  149. package/types/clr-angular-forms-datalist.d.ts +59 -0
  150. package/types/clr-angular-forms-datepicker.d.ts +986 -0
  151. package/types/clr-angular-forms-file-input.d.ts +193 -0
  152. package/types/clr-angular-forms-input.d.ts +29 -0
  153. package/types/clr-angular-forms-number-input.d.ts +43 -0
  154. package/types/clr-angular-forms-password.d.ts +52 -0
  155. package/types/clr-angular-forms-radio.d.ts +50 -0
  156. package/types/clr-angular-forms-range.d.ts +37 -0
  157. package/types/clr-angular-forms-select.d.ts +36 -0
  158. package/types/clr-angular-forms-textarea.d.ts +29 -0
  159. package/types/clr-angular-forms.d.ts +36 -0
  160. package/types/clr-angular-icon.d.ts +1498 -0
  161. package/types/clr-angular-layout-breadcrumbs.d.ts +45 -0
  162. package/types/clr-angular-layout-main-container.d.ts +28 -0
  163. package/types/clr-angular-layout-nav.d.ts +142 -0
  164. package/types/clr-angular-layout-tabs.d.ts +158 -0
  165. package/types/clr-angular-layout-vertical-nav.d.ts +128 -0
  166. package/types/clr-angular-layout.d.ts +19 -0
  167. package/types/clr-angular-modal.d.ts +160 -0
  168. package/types/clr-angular-popover-common.d.ts +254 -0
  169. package/types/clr-angular-popover-dropdown.d.ts +123 -0
  170. package/types/clr-angular-popover-signpost.d.ts +157 -0
  171. package/types/clr-angular-popover-tooltip.d.ts +83 -0
  172. package/types/clr-angular-popover.d.ts +16 -0
  173. package/types/clr-angular-progress-progress-bars.d.ts +57 -0
  174. package/types/clr-angular-progress-spinner.d.ts +44 -0
  175. package/types/clr-angular-stepper.d.ts +179 -0
  176. package/types/clr-angular-timeline.d.ts +86 -0
  177. package/types/clr-angular-utils-conditional.d.ts +132 -0
  178. package/types/clr-angular-utils-loading.d.ts +38 -0
  179. package/types/clr-angular-utils.d.ts +913 -0
  180. package/types/clr-angular-wizard.d.ts +1508 -0
@@ -0,0 +1,1251 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Optional, Directive, Component, ElementRef, HostListener, ContentChild, Input, HostBinding, KeyValueDiffers, Self, ContentChildren, NgModule } from '@angular/core';
3
+ import { BehaviorSubject, Subject, tap, merge, of } from 'rxjs';
4
+ import * as i3 from '@clr/angular/icon';
5
+ import { ClarityIcons, successStandardIcon, errorStandardIcon, ClrIcon } from '@clr/angular/icon';
6
+ import { ClrSignpost } from '@clr/angular/popover/signpost';
7
+ import * as i1 from '@angular/common';
8
+ import { CommonModule } from '@angular/common';
9
+ import { HostWrapper } from '@clr/angular/utils';
10
+ import * as i1$1 from '@angular/forms';
11
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
12
+ import { switchMap, startWith } from 'rxjs/operators';
13
+
14
+ /*
15
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
16
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
17
+ * This software is released under MIT license.
18
+ * The full license information can be found in LICENSE in the root directory of this project.
19
+ */
20
+ let counter$1 = 0;
21
+ class ControlIdService {
22
+ constructor() {
23
+ this._id = 'clr-form-control-' + ++counter$1;
24
+ this._idChange = new BehaviorSubject(this._id);
25
+ }
26
+ get id() {
27
+ return this._id;
28
+ }
29
+ set id(value) {
30
+ this._id = value;
31
+ this._idChange.next(value);
32
+ }
33
+ get idChange() {
34
+ return this._idChange.asObservable();
35
+ }
36
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ControlIdService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
37
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ControlIdService }); }
38
+ }
39
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ControlIdService, decorators: [{
40
+ type: Injectable
41
+ }] });
42
+
43
+ /*
44
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
45
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
46
+ * This software is released under MIT license.
47
+ * The full license information can be found in LICENSE in the root directory of this project.
48
+ */
49
+ let counter = 0;
50
+ /**
51
+ * @TODO No idea why I need to use provideIn .. without I'm getting error that
52
+ * ContainerIdService is not defined - But this must be optional service!?
53
+ *
54
+ * There is something wrong - will come back to investigate it when I have more time
55
+ *
56
+ */
57
+ class ContainerIdService {
58
+ constructor() {
59
+ this._id = `clr-form-container-${++counter}`;
60
+ this._idChange = new BehaviorSubject(this._id);
61
+ }
62
+ get id() {
63
+ return this._id;
64
+ }
65
+ set id(value) {
66
+ this._id = value;
67
+ this._idChange.next(value);
68
+ }
69
+ get idChange() {
70
+ return this._idChange.asObservable();
71
+ }
72
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ContainerIdService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
73
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ContainerIdService }); }
74
+ }
75
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ContainerIdService, decorators: [{
76
+ type: Injectable
77
+ }] });
78
+
79
+ /*
80
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
81
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
82
+ * This software is released under MIT license.
83
+ * The full license information can be found in LICENSE in the root directory of this project.
84
+ */
85
+ const CONTROL_SUFFIX = {
86
+ HELPER: 'helper',
87
+ ERROR: 'error',
88
+ SUCCESS: 'success',
89
+ NONE: null,
90
+ };
91
+ class ClrAbstractControl {
92
+ constructor(controlIdService, containerIdService) {
93
+ this.controlIdService = controlIdService;
94
+ this.containerIdService = containerIdService;
95
+ /**
96
+ * Hold the suffix for the ID
97
+ */
98
+ this.controlIdSuffix = 'abstract';
99
+ }
100
+ get id() {
101
+ /**
102
+ * The order of witch the id will be pick is:
103
+ * - Container ID (Wrapper arround multiple Controls like, Checkbox, Radio, ...)
104
+ * - Control ID (Single Control wrapper like Input, Textarea, Password, ...)
105
+ * - None
106
+ */
107
+ if (this.containerIdService) {
108
+ return `${this.containerIdService.id}-${this.controlIdSuffix}`;
109
+ }
110
+ if (this.controlIdService) {
111
+ return `${this.controlIdService.id}-${this.controlIdSuffix}`;
112
+ }
113
+ return null;
114
+ }
115
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrAbstractControl, deps: [{ token: ControlIdService, optional: true }, { token: ContainerIdService, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
116
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: ClrAbstractControl, isStandalone: true, ngImport: i0 }); }
117
+ }
118
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrAbstractControl, decorators: [{
119
+ type: Directive
120
+ }], ctorParameters: () => [{ type: ControlIdService, decorators: [{
121
+ type: Optional
122
+ }] }, { type: ContainerIdService, decorators: [{
123
+ type: Optional
124
+ }] }] });
125
+
126
+ /*
127
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
128
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
129
+ * This software is released under MIT license.
130
+ * The full license information can be found in LICENSE in the root directory of this project.
131
+ */
132
+ class ClrControlError extends ClrAbstractControl {
133
+ constructor(controlIdService, containerIdService) {
134
+ super(controlIdService, containerIdService);
135
+ this.controlIdService = controlIdService;
136
+ this.containerIdService = containerIdService;
137
+ this.controlIdSuffix = CONTROL_SUFFIX.ERROR;
138
+ }
139
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrControlError, deps: [{ token: ControlIdService, optional: true }, { token: ContainerIdService, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
140
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: ClrControlError, isStandalone: false, selector: "clr-control-error", host: { properties: { "class.clr-subtext-wrapper": "true", "class.error": "true", "attr.id": "id" } }, usesInheritance: true, ngImport: i0, template: `
141
+ <cds-icon class="clr-validate-icon" shape="error-standard" status="danger" aria-hidden="true"></cds-icon>
142
+ <span class="clr-subtext">
143
+ <ng-content></ng-content>
144
+ </span>
145
+ `, isInline: true, dependencies: [{ kind: "component", type: i3.ClrIcon, selector: "clr-icon, cds-icon", inputs: ["shape", "size", "direction", "flip", "solid", "status", "inverse", "badge"] }] }); }
146
+ }
147
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrControlError, decorators: [{
148
+ type: Component,
149
+ args: [{
150
+ selector: 'clr-control-error',
151
+ template: `
152
+ <cds-icon class="clr-validate-icon" shape="error-standard" status="danger" aria-hidden="true"></cds-icon>
153
+ <span class="clr-subtext">
154
+ <ng-content></ng-content>
155
+ </span>
156
+ `,
157
+ host: {
158
+ '[class.clr-subtext-wrapper]': 'true',
159
+ '[class.error]': 'true',
160
+ '[attr.id]': 'id',
161
+ },
162
+ standalone: false,
163
+ }]
164
+ }], ctorParameters: () => [{ type: ControlIdService, decorators: [{
165
+ type: Optional
166
+ }] }, { type: ContainerIdService, decorators: [{
167
+ type: Optional
168
+ }] }] });
169
+
170
+ /*
171
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
172
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
173
+ * This software is released under MIT license.
174
+ * The full license information can be found in LICENSE in the root directory of this project.
175
+ */
176
+ class ClrControlHelper extends ClrAbstractControl {
177
+ constructor(controlIdService, containerIdService) {
178
+ super(controlIdService, containerIdService);
179
+ this.controlIdService = controlIdService;
180
+ this.containerIdService = containerIdService;
181
+ this.controlIdSuffix = CONTROL_SUFFIX.HELPER;
182
+ }
183
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrControlHelper, deps: [{ token: ControlIdService, optional: true }, { token: ContainerIdService, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
184
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: ClrControlHelper, isStandalone: false, selector: "clr-control-helper", host: { properties: { "class.clr-subtext": "true", "attr.id": "id" } }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true }); }
185
+ }
186
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrControlHelper, decorators: [{
187
+ type: Component,
188
+ args: [{
189
+ selector: 'clr-control-helper',
190
+ template: `<ng-content></ng-content>`,
191
+ host: {
192
+ '[class.clr-subtext]': 'true',
193
+ '[attr.id]': 'id',
194
+ },
195
+ standalone: false,
196
+ }]
197
+ }], ctorParameters: () => [{ type: ControlIdService, decorators: [{
198
+ type: Optional
199
+ }] }, { type: ContainerIdService, decorators: [{
200
+ type: Optional
201
+ }] }] });
202
+
203
+ /*
204
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
205
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
206
+ * This software is released under MIT license.
207
+ * The full license information can be found in LICENSE in the root directory of this project.
208
+ */
209
+ class ClrControlSuccess extends ClrAbstractControl {
210
+ constructor(controlIdService, containerIdService) {
211
+ super(controlIdService, containerIdService);
212
+ this.controlIdService = controlIdService;
213
+ this.containerIdService = containerIdService;
214
+ this.controlIdSuffix = CONTROL_SUFFIX.SUCCESS;
215
+ }
216
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrControlSuccess, deps: [{ token: ControlIdService, optional: true }, { token: ContainerIdService, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
217
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: ClrControlSuccess, isStandalone: false, selector: "clr-control-success", host: { properties: { "class.clr-subtext-wrapper": "true", "class.success": "true", "attr.id": "id" } }, usesInheritance: true, ngImport: i0, template: `
218
+ <cds-icon class="clr-validate-icon" shape="success-standard" status="success" aria-hidden="true"></cds-icon>
219
+ <span class="clr-subtext">
220
+ <ng-content></ng-content>
221
+ </span>
222
+ `, isInline: true, dependencies: [{ kind: "component", type: i3.ClrIcon, selector: "clr-icon, cds-icon", inputs: ["shape", "size", "direction", "flip", "solid", "status", "inverse", "badge"] }] }); }
223
+ }
224
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrControlSuccess, decorators: [{
225
+ type: Component,
226
+ args: [{
227
+ selector: 'clr-control-success',
228
+ template: `
229
+ <cds-icon class="clr-validate-icon" shape="success-standard" status="success" aria-hidden="true"></cds-icon>
230
+ <span class="clr-subtext">
231
+ <ng-content></ng-content>
232
+ </span>
233
+ `,
234
+ host: {
235
+ '[class.clr-subtext-wrapper]': 'true',
236
+ '[class.success]': 'true',
237
+ '[attr.id]': 'id',
238
+ },
239
+ standalone: false,
240
+ }]
241
+ }], ctorParameters: () => [{ type: ControlIdService, decorators: [{
242
+ type: Optional
243
+ }] }, { type: ContainerIdService, decorators: [{
244
+ type: Optional
245
+ }] }] });
246
+
247
+ /*
248
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
249
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
250
+ * This software is released under MIT license.
251
+ * The full license information can be found in LICENSE in the root directory of this project.
252
+ */
253
+ var CONTROL_STATE;
254
+ (function (CONTROL_STATE) {
255
+ CONTROL_STATE["VALID"] = "VALID";
256
+ CONTROL_STATE["INVALID"] = "INVALID";
257
+ })(CONTROL_STATE || (CONTROL_STATE = {}));
258
+
259
+ /*
260
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
261
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
262
+ * This software is released under MIT license.
263
+ * The full license information can be found in LICENSE in the root directory of this project.
264
+ */
265
+ var ClrFormLayout;
266
+ (function (ClrFormLayout) {
267
+ ClrFormLayout["VERTICAL"] = "vertical";
268
+ ClrFormLayout["HORIZONTAL"] = "horizontal";
269
+ ClrFormLayout["COMPACT"] = "compact";
270
+ })(ClrFormLayout || (ClrFormLayout = {}));
271
+ class LayoutService {
272
+ constructor() {
273
+ this.minLabelSize = 1;
274
+ this.maxLabelSize = 12;
275
+ this.layout = ClrFormLayout.HORIZONTAL;
276
+ this.layoutValues = Object.values(ClrFormLayout);
277
+ this._labelSize = 2;
278
+ }
279
+ get labelSize() {
280
+ return this._labelSize;
281
+ }
282
+ set labelSize(size) {
283
+ if (this.labelSizeIsValid(size)) {
284
+ this._labelSize = size;
285
+ }
286
+ }
287
+ get layoutClass() {
288
+ return `clr-form-${this.layout}`;
289
+ }
290
+ isVertical() {
291
+ return this.layout === ClrFormLayout.VERTICAL;
292
+ }
293
+ isHorizontal() {
294
+ return this.layout === ClrFormLayout.HORIZONTAL;
295
+ }
296
+ isCompact() {
297
+ return this.layout === ClrFormLayout.COMPACT;
298
+ }
299
+ isValid(layout) {
300
+ return this.layoutValues.indexOf(layout) > -1;
301
+ }
302
+ labelSizeIsValid(labelSize) {
303
+ return Number.isInteger(labelSize) && labelSize >= this.minLabelSize && labelSize <= this.maxLabelSize;
304
+ }
305
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: LayoutService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
306
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: LayoutService }); }
307
+ }
308
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: LayoutService, decorators: [{
309
+ type: Injectable
310
+ }] });
311
+
312
+ /*
313
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
314
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
315
+ * This software is released under MIT license.
316
+ * The full license information can be found in LICENSE in the root directory of this project.
317
+ */
318
+ class NgControlService {
319
+ constructor() {
320
+ this._controls = [];
321
+ // Observable to subscribe to the control, since its not available immediately for projected content
322
+ this._controlsChanges = new Subject();
323
+ }
324
+ get controls() {
325
+ return this._controls;
326
+ }
327
+ get controlsChanges() {
328
+ return this._controlsChanges.asObservable();
329
+ }
330
+ get hasMultipleControls() {
331
+ return this._controls?.length > 1;
332
+ }
333
+ addControl(control) {
334
+ this._controls.push(control);
335
+ this.emitControlsChange(this._controls);
336
+ }
337
+ emitControlsChange(controls) {
338
+ this._controlsChanges.next(controls);
339
+ }
340
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: NgControlService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
341
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: NgControlService }); }
342
+ }
343
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: NgControlService, decorators: [{
344
+ type: Injectable
345
+ }] });
346
+
347
+ /*
348
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
349
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
350
+ * This software is released under MIT license.
351
+ * The full license information can be found in LICENSE in the root directory of this project.
352
+ */
353
+ class ClrControlLabel {
354
+ constructor(controlIdService, layoutService, ngControlService, renderer, el) {
355
+ this.controlIdService = controlIdService;
356
+ this.layoutService = layoutService;
357
+ this.ngControlService = ngControlService;
358
+ this.renderer = renderer;
359
+ this.el = el;
360
+ this.enableGrid = true;
361
+ this.subscriptions = [];
362
+ }
363
+ get labelText() {
364
+ return this.el.nativeElement && this.el.nativeElement.textContent;
365
+ }
366
+ ngOnInit() {
367
+ // Prevent id attributes from being removed by the `undefined` host binding.
368
+ // This happens when a `label` is used outside of a control container and other use cases.
369
+ this.idAttr = this.idInput;
370
+ // Only add the clr-control-label if it is inside a control container
371
+ if (this.controlIdService || this.ngControlService) {
372
+ this.renderer.addClass(this.el.nativeElement, 'clr-control-label');
373
+ }
374
+ // Only set the grid column classes if we are in the right context and if they aren't already set
375
+ if (this.enableGrid &&
376
+ this.layoutService &&
377
+ !this.layoutService.isVertical() &&
378
+ this.el.nativeElement &&
379
+ this.el.nativeElement.className.indexOf('clr-col') < 0) {
380
+ this.renderer.addClass(this.el.nativeElement, 'clr-col-12');
381
+ this.renderer.addClass(this.el.nativeElement, `clr-col-md-${this.layoutService.labelSize}`);
382
+ }
383
+ if (this.controlIdService && !this.forAttr) {
384
+ this.subscriptions.push(this.controlIdService.idChange.subscribe(id => {
385
+ this.forAttr = id;
386
+ this.idAttr = this.idInput || `${id}-label`;
387
+ }));
388
+ }
389
+ }
390
+ ngOnDestroy() {
391
+ this.subscriptions.forEach(sub => sub.unsubscribe());
392
+ }
393
+ disableGrid() {
394
+ this.enableGrid = false;
395
+ }
396
+ /**
397
+ * Allowing signposts inside labels to work without disabling default behavior. <label> is spreading a click event to its children so signposts get
398
+ * automatically closed once clicked inside a <label>.
399
+ * @param event
400
+ */
401
+ onClick(event) {
402
+ this.preventDefaultOnSignpostTarget(event);
403
+ }
404
+ preventDefaultOnSignpostTarget(event) {
405
+ if (this.signpost && this.signpost.nativeElement && this.signpost.nativeElement.contains(event.target)) {
406
+ event.preventDefault();
407
+ }
408
+ }
409
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrControlLabel, deps: [{ token: ControlIdService, optional: true }, { token: LayoutService, optional: true }, { token: NgControlService, optional: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
410
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: ClrControlLabel, isStandalone: false, selector: "label", inputs: { idInput: ["id", "idInput"], forAttr: ["for", "forAttr"] }, host: { listeners: { "click": "onClick($event)" }, properties: { "attr.id": "this.idAttr", "attr.for": "this.forAttr" } }, queries: [{ propertyName: "signpost", first: true, predicate: ClrSignpost, descendants: true, read: ElementRef }], ngImport: i0 }); }
411
+ }
412
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrControlLabel, decorators: [{
413
+ type: Directive,
414
+ args: [{
415
+ selector: 'label',
416
+ standalone: false,
417
+ }]
418
+ }], ctorParameters: () => [{ type: ControlIdService, decorators: [{
419
+ type: Optional
420
+ }] }, { type: LayoutService, decorators: [{
421
+ type: Optional
422
+ }] }, { type: NgControlService, decorators: [{
423
+ type: Optional
424
+ }] }, { type: i0.Renderer2 }, { type: i0.ElementRef }], propDecorators: { idInput: [{
425
+ type: Input,
426
+ args: ['id']
427
+ }], idAttr: [{
428
+ type: HostBinding,
429
+ args: ['attr.id']
430
+ }], forAttr: [{
431
+ type: Input,
432
+ args: ['for']
433
+ }, {
434
+ type: HostBinding,
435
+ args: ['attr.for']
436
+ }], signpost: [{
437
+ type: ContentChild,
438
+ args: [ClrSignpost, { read: ElementRef }]
439
+ }], onClick: [{
440
+ type: HostListener,
441
+ args: ['click', ['$event']]
442
+ }] } });
443
+
444
+ /*
445
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
446
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
447
+ * This software is released under MIT license.
448
+ * The full license information can be found in LICENSE in the root directory of this project.
449
+ */
450
+ const CLASS_ERROR = 'clr-error';
451
+ const CLASS_SUCCESS = 'clr-success';
452
+ class ControlClassService {
453
+ constructor(layoutService) {
454
+ this.layoutService = layoutService;
455
+ this.className = '';
456
+ }
457
+ controlClass(state, grid = false, additional = '') {
458
+ const controlClasses = [this.className, additional];
459
+ switch (state) {
460
+ case CONTROL_STATE.VALID:
461
+ controlClasses.push(CLASS_SUCCESS);
462
+ break;
463
+ case CONTROL_STATE.INVALID:
464
+ controlClasses.push(CLASS_ERROR);
465
+ break;
466
+ }
467
+ if (grid && this.layoutService && this.className.indexOf('clr-col') === -1) {
468
+ controlClasses.push(`clr-col-md-${this.layoutService.maxLabelSize - this.layoutService.labelSize} clr-col-12`);
469
+ }
470
+ return controlClasses.join(' ').trim();
471
+ }
472
+ // We want to remove the column classes from the input up to the container
473
+ initControlClass(renderer, element) {
474
+ if (element && element.className) {
475
+ const klasses = element.className.split(' ');
476
+ const controlKlasses = [];
477
+ klasses.forEach(klass => {
478
+ if (klass.startsWith('clr-')) {
479
+ controlKlasses.push(klass);
480
+ }
481
+ if (klass.startsWith('clr-col')) {
482
+ renderer.removeClass(element, klass);
483
+ }
484
+ });
485
+ this.className = controlKlasses.join(' ').trim();
486
+ }
487
+ }
488
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ControlClassService, deps: [{ token: LayoutService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
489
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ControlClassService }); }
490
+ }
491
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ControlClassService, decorators: [{
492
+ type: Injectable
493
+ }], ctorParameters: () => [{ type: LayoutService, decorators: [{
494
+ type: Optional
495
+ }] }] });
496
+
497
+ /*
498
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
499
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
500
+ * This software is released under MIT license.
501
+ * The full license information can be found in LICENSE in the root directory of this project.
502
+ */
503
+ class ClrAbstractContainer {
504
+ constructor(layoutService, controlClassService, ngControlService) {
505
+ this.layoutService = layoutService;
506
+ this.controlClassService = controlClassService;
507
+ this.ngControlService = ngControlService;
508
+ this.controls = [];
509
+ this.subscriptions = [];
510
+ this.subscriptions.push(ngControlService.controlsChanges.subscribe(controls => {
511
+ this.controls = controls;
512
+ }));
513
+ ngControlService.container = this;
514
+ }
515
+ get control() {
516
+ return this.controls[0];
517
+ }
518
+ /**
519
+ * @NOTE
520
+ * Helper control is a bit different than the others, it must be always visible:
521
+ * - Labels and instructions must always accompany forms and are persistent.
522
+ * - The recommendation here is to always have helper text or anything instructions visible.
523
+ * - The expectation is to have error text + helper text in the errored state. this way all users will have the helper text information always available.
524
+ */
525
+ get showHelper() {
526
+ /**
527
+ * @NOTE
528
+ * Saving the previous version in case something is changed. We'll return always true so we can be flexible
529
+ * and keep the condition per components.
530
+ *
531
+ * return (
532
+ * Helper Component exist and the state of the form is NONE (not touched)
533
+ * (!!this.controlHelperComponent && (!this.touched || this.state === CONTROL_STATE.NONE)) ||
534
+ * or there is no success component but the state of the form is VALID - show helper information
535
+ * (!!this.controlSuccessComponent === false && this.state === CONTROL_STATE.VALID) ||
536
+ * or there is no error component but the state of the form is INVALID - show helper information
537
+ * (!!this.controlErrorComponent === false && this.state === CONTROL_STATE.INVALID)
538
+ * );
539
+ */
540
+ return Boolean(this.controlHelperComponent);
541
+ }
542
+ /**
543
+ * We gonna set the helper control state, after all or most of the components
544
+ * are ready - also this will trigger some initial flows into wrappers and controls,
545
+ * like locating IDs and setting attributes.
546
+ */
547
+ get helpers() {
548
+ return {
549
+ show: this.showInvalid || this.showHelper || this.showValid,
550
+ showInvalid: this.showInvalid,
551
+ showHelper: this.showHelper,
552
+ showValid: this.showValid,
553
+ };
554
+ }
555
+ get showValid() {
556
+ return this.touched && this.state === CONTROL_STATE.VALID && this.successMessagePresent;
557
+ }
558
+ get showInvalid() {
559
+ return this.touched && this.state === CONTROL_STATE.INVALID && this.errorMessagePresent;
560
+ }
561
+ get successMessagePresent() {
562
+ return !!this.controlSuccessComponent;
563
+ }
564
+ get errorMessagePresent() {
565
+ return !!this.controlErrorComponent;
566
+ }
567
+ get touched() {
568
+ return !!this.controls?.some(control => control.touched);
569
+ }
570
+ get state() {
571
+ const controlStatuses = this.controls.map((control) => {
572
+ return control.status;
573
+ });
574
+ // These status values are mutually exclusive, so a control
575
+ // cannot be both valid AND invalid or invalid AND disabled.
576
+ // if else order is important!
577
+ if (controlStatuses.includes(CONTROL_STATE.INVALID)) {
578
+ return CONTROL_STATE.INVALID;
579
+ }
580
+ else if (controlStatuses.includes(CONTROL_STATE.VALID)) {
581
+ return CONTROL_STATE.VALID;
582
+ }
583
+ else {
584
+ return null;
585
+ }
586
+ }
587
+ ngOnDestroy() {
588
+ this.subscriptions.forEach(subscription => subscription.unsubscribe());
589
+ }
590
+ controlClass() {
591
+ /**
592
+ * Decide what subtext to display:
593
+ * - container is valid but no success component is implemented - use helper class
594
+ * - container is valid and success component is implemented - use success class
595
+ * - Pass form control state and return string of classes to be applied to the container.
596
+ */
597
+ const currentState = this.touched ? this.state : null;
598
+ return this.controlClassService.controlClass(currentState, this.addGrid());
599
+ }
600
+ addGrid() {
601
+ return this.layoutService && !this.layoutService.isVertical();
602
+ }
603
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrAbstractContainer, deps: [{ token: LayoutService, optional: true }, { token: ControlClassService }, { token: NgControlService }], target: i0.ɵɵFactoryTarget.Directive }); }
604
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: ClrAbstractContainer, isStandalone: true, queries: [{ propertyName: "label", first: true, predicate: ClrControlLabel, descendants: true }, { propertyName: "controlSuccessComponent", first: true, predicate: ClrControlSuccess, descendants: true }, { propertyName: "controlErrorComponent", first: true, predicate: ClrControlError, descendants: true }, { propertyName: "controlHelperComponent", first: true, predicate: ClrControlHelper, descendants: true }], ngImport: i0 }); }
605
+ }
606
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrAbstractContainer, decorators: [{
607
+ type: Directive
608
+ }], ctorParameters: () => [{ type: LayoutService, decorators: [{
609
+ type: Optional
610
+ }] }, { type: ControlClassService }, { type: NgControlService }], propDecorators: { label: [{
611
+ type: ContentChild,
612
+ args: [ClrControlLabel, { static: false }]
613
+ }], controlSuccessComponent: [{
614
+ type: ContentChild,
615
+ args: [ClrControlSuccess]
616
+ }], controlErrorComponent: [{
617
+ type: ContentChild,
618
+ args: [ClrControlError]
619
+ }], controlHelperComponent: [{
620
+ type: ContentChild,
621
+ args: [ClrControlHelper]
622
+ }] } });
623
+
624
+ /*
625
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
626
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
627
+ * This software is released under MIT license.
628
+ * The full license information can be found in LICENSE in the root directory of this project.
629
+ */
630
+ class ClrControlContainer extends ClrAbstractContainer {
631
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrControlContainer, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
632
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: ClrControlContainer, isStandalone: false, selector: "clr-control-container", host: { properties: { "class.clr-form-control": "true", "class.clr-form-control-disabled": "control?.disabled", "class.clr-row": "addGrid()" } }, providers: [NgControlService, ControlIdService, ControlClassService], usesInheritance: true, ngImport: i0, template: `
633
+ <ng-content select="label"></ng-content>
634
+ @if (!label && addGrid()) {
635
+ <label></label>
636
+ }
637
+ <div class="clr-control-container" [ngClass]="controlClass()">
638
+ <div class="clr-input-wrapper">
639
+ <ng-content></ng-content>
640
+ </div>
641
+ @if (showHelper) {
642
+ <ng-content select="clr-control-helper"></ng-content>
643
+ }
644
+ @if (showInvalid) {
645
+ <ng-content select="clr-control-error"></ng-content>
646
+ }
647
+ @if (showValid) {
648
+ <ng-content select="clr-control-success"></ng-content>
649
+ }
650
+ </div>
651
+ `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: ClrControlLabel, selector: "label", inputs: ["id", "for"] }] }); }
652
+ }
653
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrControlContainer, decorators: [{
654
+ type: Component,
655
+ args: [{
656
+ selector: 'clr-control-container',
657
+ template: `
658
+ <ng-content select="label"></ng-content>
659
+ @if (!label && addGrid()) {
660
+ <label></label>
661
+ }
662
+ <div class="clr-control-container" [ngClass]="controlClass()">
663
+ <div class="clr-input-wrapper">
664
+ <ng-content></ng-content>
665
+ </div>
666
+ @if (showHelper) {
667
+ <ng-content select="clr-control-helper"></ng-content>
668
+ }
669
+ @if (showInvalid) {
670
+ <ng-content select="clr-control-error"></ng-content>
671
+ }
672
+ @if (showValid) {
673
+ <ng-content select="clr-control-success"></ng-content>
674
+ }
675
+ </div>
676
+ `,
677
+ host: {
678
+ '[class.clr-form-control]': 'true',
679
+ '[class.clr-form-control-disabled]': 'control?.disabled',
680
+ '[class.clr-row]': 'addGrid()',
681
+ },
682
+ providers: [NgControlService, ControlIdService, ControlClassService],
683
+ standalone: false,
684
+ }]
685
+ }] });
686
+
687
+ /*
688
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
689
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
690
+ * This software is released under MIT license.
691
+ * The full license information can be found in LICENSE in the root directory of this project.
692
+ */
693
+ class MarkControlService {
694
+ constructor() {
695
+ this._touched = new Subject();
696
+ }
697
+ get touchedChange() {
698
+ return this._touched.asObservable();
699
+ }
700
+ markAsTouched() {
701
+ this._touched.next();
702
+ }
703
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MarkControlService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
704
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MarkControlService }); }
705
+ }
706
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MarkControlService, decorators: [{
707
+ type: Injectable
708
+ }] });
709
+
710
+ /*
711
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
712
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
713
+ * This software is released under MIT license.
714
+ * The full license information can be found in LICENSE in the root directory of this project.
715
+ */
716
+ var CHANGE_KEYS;
717
+ (function (CHANGE_KEYS) {
718
+ CHANGE_KEYS["FORM"] = "form";
719
+ CHANGE_KEYS["MODEL"] = "model";
720
+ })(CHANGE_KEYS || (CHANGE_KEYS = {}));
721
+ class WrappedFormControl {
722
+ // I lost way too much time trying to make this work without injecting the ViewContainerRef and the Injector,
723
+ // I'm giving up. So we have to inject these two manually for now.
724
+ constructor(vcr, wrapperType, injector, ngControl, renderer, el) {
725
+ this.vcr = vcr;
726
+ this.wrapperType = wrapperType;
727
+ this.ngControl = ngControl;
728
+ this.renderer = renderer;
729
+ this.el = el;
730
+ this.index = 0;
731
+ this.subscriptions = [];
732
+ if (injector) {
733
+ this.ngControlService = injector.get(NgControlService, null);
734
+ this.markControlService = injector.get(MarkControlService, null);
735
+ this.differs = injector.get(KeyValueDiffers, null);
736
+ }
737
+ if (this.markControlService) {
738
+ this.subscriptions.push(this.markControlService.touchedChange.subscribe(() => {
739
+ this.markAsTouched();
740
+ }));
741
+ }
742
+ }
743
+ get id() {
744
+ return this._id;
745
+ }
746
+ set id(value) {
747
+ this._id = value;
748
+ if (this.controlIdService) {
749
+ this.controlIdService.id = value;
750
+ }
751
+ }
752
+ get ariaDescribedById() {
753
+ const helpers = this.ngControlService?.container?.helpers;
754
+ if (!helpers?.show) {
755
+ return null;
756
+ }
757
+ const elementId = this.containerIdService?.id || this.controlIdService?.id;
758
+ /**
759
+ * If ContainerIdService or ControlIdService are missing don't try to guess
760
+ * Don't set anything.
761
+ */
762
+ if (!elementId) {
763
+ return null;
764
+ }
765
+ /**
766
+ * As the helper text is now always visible. If we have error/success then we should use both ids.
767
+ */
768
+ const describedByIds = [`${elementId}-${CONTROL_SUFFIX.HELPER}`];
769
+ if (helpers.showInvalid) {
770
+ describedByIds.push(`${elementId}-${CONTROL_SUFFIX.ERROR}`);
771
+ }
772
+ else if (helpers.showValid) {
773
+ describedByIds.push(`${elementId}-${CONTROL_SUFFIX.SUCCESS}`);
774
+ }
775
+ return describedByIds.join(' ');
776
+ }
777
+ ngOnInit() {
778
+ this._containerInjector = new HostWrapper(this.wrapperType, this.vcr, this.index);
779
+ this.controlIdService = this._containerInjector.get(ControlIdService);
780
+ this.injectControlClassService(this._containerInjector);
781
+ /**
782
+ * not all containers will provide `ContainerIdService`
783
+ */
784
+ this.containerIdService = this._containerInjector.get(ContainerIdService, null);
785
+ if (this._id) {
786
+ this.controlIdService.id = this._id;
787
+ }
788
+ else {
789
+ this._id = this.controlIdService.id;
790
+ }
791
+ // 4 possible variations
792
+ // 1. NO ngControlService and NO ngControl
793
+ // 2. NO ngControlService and YES ngControl
794
+ // 3. YES ngControlService and NO ngControl
795
+ // 4. YES ngControlService and YES ngControl
796
+ if (this.ngControl) {
797
+ this.differ = this.differs.find(this.ngControl).create();
798
+ }
799
+ if (this.ngControlService && this.ngControl) {
800
+ this.ngControlService.addControl(this.ngControl);
801
+ }
802
+ }
803
+ ngDoCheck() {
804
+ if (this.ngControl) {
805
+ this.triggerDoCheck(this.differ, this.ngControl);
806
+ }
807
+ }
808
+ ngOnDestroy() {
809
+ this.subscriptions.forEach(sub => sub?.unsubscribe());
810
+ }
811
+ // blur HostListener decorator MUST be 1 and on the parent.
812
+ // overrides MUST NOT have HostListener decorator.
813
+ triggerValidation() {
814
+ if (this.ngControl?.control?.markAsTouched) {
815
+ this.ngControl.control.markAsTouched();
816
+ }
817
+ }
818
+ // @TODO This method has a try/catch due to an unknown issue that came when building the clrToggle feature
819
+ // We need to figure out why this fails for the ClrToggle scenario but works for Date picker...
820
+ // To see the error, remove the try/catch here and run the ClrToggle suite to see issues getting the container
821
+ // injector in time, and this ONLY HAPPENS in tests and not in dev/prod mode.
822
+ getProviderFromContainer(token, notFoundValue) {
823
+ try {
824
+ return this._containerInjector.get(token, notFoundValue);
825
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
826
+ }
827
+ catch (e) {
828
+ return notFoundValue;
829
+ }
830
+ }
831
+ injectControlClassService(injector) {
832
+ if (!this.controlClassService) {
833
+ this.controlClassService = injector.get(ControlClassService, null);
834
+ if (this.controlClassService) {
835
+ this.controlClassService.initControlClass(this.renderer, this.el.nativeElement);
836
+ }
837
+ }
838
+ }
839
+ triggerDoCheck(differ, ngControl) {
840
+ if (differ) {
841
+ const changes = differ.diff(ngControl);
842
+ if (changes) {
843
+ changes.forEachChangedItem(change => {
844
+ if ((change.key === CHANGE_KEYS.FORM || change.key === CHANGE_KEYS.MODEL) &&
845
+ change.currentValue !== change.previousValue) {
846
+ if (this.ngControlService) {
847
+ this.ngControlService.emitControlsChange(this.ngControlService.controls);
848
+ }
849
+ this.triggerValidation();
850
+ }
851
+ });
852
+ }
853
+ }
854
+ }
855
+ markAsTouched() {
856
+ if (this.ngControlService && this.ngControlService.hasMultipleControls) {
857
+ this.ngControlService.controls.forEach((ngControl) => {
858
+ ngControl.control.markAsTouched();
859
+ ngControl.control.updateValueAndValidity();
860
+ });
861
+ return;
862
+ }
863
+ if (this.ngControl) {
864
+ this.ngControl.control.markAsTouched();
865
+ this.ngControl.control.updateValueAndValidity();
866
+ }
867
+ }
868
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: WrappedFormControl, deps: [{ token: i0.ViewContainerRef }, { token: i0.Type }, { token: i0.Injector }, { token: i1$1.NgControl }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
869
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: WrappedFormControl, isStandalone: true, inputs: { id: "id" }, host: { listeners: { "blur": "triggerValidation()" }, properties: { "id": "this.id", "attr.aria-describedby": "this.ariaDescribedById" } }, ngImport: i0 }); }
870
+ }
871
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: WrappedFormControl, decorators: [{
872
+ type: Directive
873
+ }], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.Type }, { type: i0.Injector }, { type: i1$1.NgControl }, { type: i0.Renderer2 }, { type: i0.ElementRef }], propDecorators: { id: [{
874
+ type: Input
875
+ }, {
876
+ type: HostBinding
877
+ }], ariaDescribedById: [{
878
+ type: HostBinding,
879
+ args: ['attr.aria-describedby']
880
+ }], triggerValidation: [{
881
+ type: HostListener,
882
+ args: ['blur']
883
+ }] } });
884
+
885
+ /*
886
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
887
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
888
+ * This software is released under MIT license.
889
+ * The full license information can be found in LICENSE in the root directory of this project.
890
+ */
891
+ class ClrControl extends WrappedFormControl {
892
+ constructor(vcr, injector, control, renderer, el) {
893
+ super(vcr, ClrControlContainer, injector, control, renderer, el);
894
+ this.index = 1;
895
+ }
896
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrControl, deps: [{ token: i0.ViewContainerRef }, { token: i0.Injector }, { token: i1$1.NgControl, optional: true, self: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
897
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: ClrControl, isStandalone: false, selector: "[clrControl]", host: { properties: { "class.clr-input": "true" } }, usesInheritance: true, ngImport: i0 }); }
898
+ }
899
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrControl, decorators: [{
900
+ type: Directive,
901
+ args: [{
902
+ selector: '[clrControl]',
903
+ host: { '[class.clr-input]': 'true' },
904
+ standalone: false,
905
+ }]
906
+ }], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.Injector }, { type: i1$1.NgControl, decorators: [{
907
+ type: Self
908
+ }, {
909
+ type: Optional
910
+ }] }, { type: i0.Renderer2 }, { type: i0.ElementRef }] });
911
+
912
+ /*
913
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
914
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
915
+ * This software is released under MIT license.
916
+ * The full license information can be found in LICENSE in the root directory of this project.
917
+ */
918
+ class ClrForm {
919
+ constructor(layoutService, markControlService) {
920
+ this.layoutService = layoutService;
921
+ this.markControlService = markControlService;
922
+ }
923
+ set labelSize(size) {
924
+ const sizeNumber = parseInt(size, 10) || 2;
925
+ this.layoutService.labelSize = sizeNumber;
926
+ }
927
+ onFormSubmit() {
928
+ this.markAsTouched();
929
+ }
930
+ // Trying to avoid adding an input and keep this backwards compatible at the same time
931
+ markAsTouched() {
932
+ this.markControlService.markAsTouched();
933
+ }
934
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrForm, deps: [{ token: LayoutService }, { token: MarkControlService }], target: i0.ɵɵFactoryTarget.Directive }); }
935
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: ClrForm, isStandalone: false, selector: "[clrForm]", inputs: { labelSize: ["clrLabelSize", "labelSize"] }, host: { listeners: { "submit": "onFormSubmit()" }, properties: { "class.clr-form": "true", "class.clr-form-horizontal": "layoutService.isHorizontal()", "class.clr-form-compact": "layoutService.isCompact()" } }, providers: [LayoutService, MarkControlService], queries: [{ propertyName: "labels", predicate: ClrControlLabel, descendants: true }], ngImport: i0 }); }
936
+ }
937
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrForm, decorators: [{
938
+ type: Directive,
939
+ args: [{
940
+ selector: '[clrForm]',
941
+ providers: [LayoutService, MarkControlService],
942
+ host: {
943
+ '[class.clr-form]': 'true',
944
+ '[class.clr-form-horizontal]': 'layoutService.isHorizontal()',
945
+ '[class.clr-form-compact]': 'layoutService.isCompact()',
946
+ },
947
+ standalone: false,
948
+ }]
949
+ }], ctorParameters: () => [{ type: LayoutService }, { type: MarkControlService }], propDecorators: { labels: [{
950
+ type: ContentChildren,
951
+ args: [ClrControlLabel, { descendants: true }]
952
+ }], labelSize: [{
953
+ type: Input,
954
+ args: ['clrLabelSize']
955
+ }], onFormSubmit: [{
956
+ type: HostListener,
957
+ args: ['submit']
958
+ }] } });
959
+
960
+ /*
961
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
962
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
963
+ * This software is released under MIT license.
964
+ * The full license information can be found in LICENSE in the root directory of this project.
965
+ */
966
+ class AbstractIfState {
967
+ constructor(ngControlService) {
968
+ this.ngControlService = ngControlService;
969
+ this.displayedContent = false;
970
+ if (ngControlService) {
971
+ ngControlService.controlsChanges
972
+ .pipe(tap(controls => {
973
+ this.controls = controls;
974
+ }), switchMap(controls => {
975
+ if (!controls || controls.length === 0) {
976
+ return [];
977
+ }
978
+ const statusStreams = controls.map(c => this.getControlStatusChangesObservable(c));
979
+ return merge(...statusStreams);
980
+ }), takeUntilDestroyed())
981
+ .subscribe(status => {
982
+ this.state = status;
983
+ this.handleState(status);
984
+ });
985
+ }
986
+ }
987
+ handleState(_state) {
988
+ /* overwrite in implementation to handle status change */
989
+ }
990
+ getControlStatusChangesObservable(control) {
991
+ if (!control.statusChanges) {
992
+ return of(null);
993
+ }
994
+ return control.statusChanges.pipe(startWith(control.status));
995
+ }
996
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AbstractIfState, deps: [{ token: NgControlService, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
997
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: AbstractIfState, isStandalone: true, ngImport: i0 }); }
998
+ }
999
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AbstractIfState, decorators: [{
1000
+ type: Directive
1001
+ }], ctorParameters: () => [{ type: NgControlService, decorators: [{
1002
+ type: Optional
1003
+ }] }] });
1004
+
1005
+ /*
1006
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
1007
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
1008
+ * This software is released under MIT license.
1009
+ * The full license information can be found in LICENSE in the root directory of this project.
1010
+ */
1011
+ class ClrIfError extends AbstractIfState {
1012
+ constructor(ngControlService, template, container) {
1013
+ super(ngControlService);
1014
+ this.template = template;
1015
+ this.container = container;
1016
+ if (!ngControlService) {
1017
+ throw new Error('clrIfError can only be used within a form control container element like clr-input-container');
1018
+ }
1019
+ }
1020
+ get error() {
1021
+ return this._error;
1022
+ }
1023
+ set error(value) {
1024
+ this._error = value;
1025
+ this.handleState(this.state);
1026
+ }
1027
+ /**
1028
+ * @param state CONTROL_STATE
1029
+ */
1030
+ handleState(state) {
1031
+ if (!this.controls?.length) {
1032
+ return;
1033
+ }
1034
+ if (this.error) {
1035
+ const invalidControl = this.controls?.filter(control => control.hasError(this.error))[0];
1036
+ this.displayError(!!invalidControl, invalidControl);
1037
+ }
1038
+ else {
1039
+ this.displayError(CONTROL_STATE.INVALID === state, this.controls[0]);
1040
+ }
1041
+ }
1042
+ displayError(invalid, control) {
1043
+ /* if no container do nothing */
1044
+ if (!this.container) {
1045
+ return;
1046
+ }
1047
+ if (invalid) {
1048
+ if (this.displayedContent === false) {
1049
+ this.embeddedViewRef = this.container.createEmbeddedView(this.template, {
1050
+ error: control.getError(this.error),
1051
+ });
1052
+ this.displayedContent = true;
1053
+ }
1054
+ else if (this.embeddedViewRef && this.embeddedViewRef.context) {
1055
+ // if view is already rendered, update the error object to keep it in sync
1056
+ this.embeddedViewRef.context.error = control.getError(this.error);
1057
+ }
1058
+ }
1059
+ else {
1060
+ this.container.clear();
1061
+ this.displayedContent = false;
1062
+ }
1063
+ }
1064
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrIfError, deps: [{ token: NgControlService, optional: true }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
1065
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: ClrIfError, isStandalone: false, selector: "[clrIfError]", inputs: { error: ["clrIfError", "error"] }, usesInheritance: true, ngImport: i0 }); }
1066
+ }
1067
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrIfError, decorators: [{
1068
+ type: Directive,
1069
+ args: [{
1070
+ selector: '[clrIfError]',
1071
+ standalone: false,
1072
+ }]
1073
+ }], ctorParameters: () => [{ type: NgControlService, decorators: [{
1074
+ type: Optional
1075
+ }] }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }], propDecorators: { error: [{
1076
+ type: Input,
1077
+ args: ['clrIfError']
1078
+ }] } });
1079
+
1080
+ /*
1081
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
1082
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
1083
+ * This software is released under MIT license.
1084
+ * The full license information can be found in LICENSE in the root directory of this project.
1085
+ */
1086
+ class ClrIfSuccess extends AbstractIfState {
1087
+ constructor(ngControlService, template, container) {
1088
+ super(ngControlService);
1089
+ this.template = template;
1090
+ this.container = container;
1091
+ if (!ngControlService) {
1092
+ throw new Error('ClrIfSuccess can only be used within a form control container element like clr-input-container');
1093
+ }
1094
+ }
1095
+ /**
1096
+ * @param state CONTROL_STATE
1097
+ */
1098
+ handleState(state) {
1099
+ const isValid = CONTROL_STATE.VALID === state;
1100
+ if (isValid && !this.displayedContent) {
1101
+ this.container.createEmbeddedView(this.template);
1102
+ }
1103
+ else if (!isValid && this.container) {
1104
+ this.container.clear();
1105
+ }
1106
+ this.displayedContent = isValid;
1107
+ }
1108
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrIfSuccess, deps: [{ token: NgControlService, optional: true }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
1109
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: ClrIfSuccess, isStandalone: false, selector: "[clrIfSuccess]", usesInheritance: true, ngImport: i0 }); }
1110
+ }
1111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrIfSuccess, decorators: [{
1112
+ type: Directive,
1113
+ args: [{
1114
+ selector: '[clrIfSuccess]',
1115
+ standalone: false,
1116
+ }]
1117
+ }], ctorParameters: () => [{ type: NgControlService, decorators: [{
1118
+ type: Optional
1119
+ }] }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }] });
1120
+
1121
+ /*
1122
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
1123
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
1124
+ * This software is released under MIT license.
1125
+ * The full license information can be found in LICENSE in the root directory of this project.
1126
+ */
1127
+ class ClrLayout {
1128
+ constructor(layoutService) {
1129
+ this.layoutService = layoutService;
1130
+ }
1131
+ ngOnInit() {
1132
+ // Only set the layout if it is a valid option
1133
+ if (this.layout && this.layoutService.isValid(this.layout)) {
1134
+ this.layoutService.layout = this.layout;
1135
+ }
1136
+ }
1137
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrLayout, deps: [{ token: LayoutService }], target: i0.ɵɵFactoryTarget.Directive }); }
1138
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: ClrLayout, isStandalone: false, selector: "[clrForm][clrLayout]", inputs: { layout: ["clrLayout", "layout"] }, ngImport: i0 }); }
1139
+ }
1140
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrLayout, decorators: [{
1141
+ type: Directive,
1142
+ args: [{
1143
+ selector: '[clrForm][clrLayout]',
1144
+ standalone: false,
1145
+ }]
1146
+ }], ctorParameters: () => [{ type: LayoutService }], propDecorators: { layout: [{
1147
+ type: Input,
1148
+ args: ['clrLayout']
1149
+ }] } });
1150
+
1151
+ /*
1152
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
1153
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
1154
+ * This software is released under MIT license.
1155
+ * The full license information can be found in LICENSE in the root directory of this project.
1156
+ */
1157
+ class ClrCommonFormsModule {
1158
+ constructor() {
1159
+ ClarityIcons.addIcons(successStandardIcon, errorStandardIcon);
1160
+ }
1161
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrCommonFormsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1162
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.3", ngImport: i0, type: ClrCommonFormsModule, declarations: [ClrControlLabel,
1163
+ ClrControlError,
1164
+ ClrControlSuccess,
1165
+ ClrControlHelper,
1166
+ ClrIfError,
1167
+ ClrIfSuccess,
1168
+ ClrForm,
1169
+ ClrLayout,
1170
+ ClrControlContainer,
1171
+ ClrControl], imports: [CommonModule, ClrIcon], exports: [ClrControlLabel,
1172
+ ClrControlError,
1173
+ ClrControlSuccess,
1174
+ ClrControlHelper,
1175
+ ClrIfError,
1176
+ ClrIfSuccess,
1177
+ ClrForm,
1178
+ ClrLayout,
1179
+ ClrControlContainer,
1180
+ ClrControl,
1181
+ ClrIcon] }); }
1182
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrCommonFormsModule, imports: [CommonModule, ClrIcon] }); }
1183
+ }
1184
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrCommonFormsModule, decorators: [{
1185
+ type: NgModule,
1186
+ args: [{
1187
+ imports: [CommonModule, ClrIcon],
1188
+ declarations: [
1189
+ ClrControlLabel,
1190
+ ClrControlError,
1191
+ ClrControlSuccess,
1192
+ ClrControlHelper,
1193
+ ClrIfError,
1194
+ ClrIfSuccess,
1195
+ ClrForm,
1196
+ ClrLayout,
1197
+ ClrControlContainer,
1198
+ ClrControl,
1199
+ ],
1200
+ exports: [
1201
+ ClrControlLabel,
1202
+ ClrControlError,
1203
+ ClrControlSuccess,
1204
+ ClrControlHelper,
1205
+ ClrIfError,
1206
+ ClrIfSuccess,
1207
+ ClrForm,
1208
+ ClrLayout,
1209
+ ClrControlContainer,
1210
+ ClrControl,
1211
+ ClrIcon,
1212
+ ],
1213
+ }]
1214
+ }], ctorParameters: () => [] });
1215
+
1216
+ /*
1217
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
1218
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
1219
+ * This software is released under MIT license.
1220
+ * The full license information can be found in LICENSE in the root directory of this project.
1221
+ */
1222
+ class FormsFocusService {
1223
+ constructor() {
1224
+ this._focused = new BehaviorSubject(false);
1225
+ }
1226
+ get focusChange() {
1227
+ return this._focused.asObservable();
1228
+ }
1229
+ set focused(state) {
1230
+ this._focused.next(state);
1231
+ }
1232
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: FormsFocusService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1233
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: FormsFocusService }); }
1234
+ }
1235
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: FormsFocusService, decorators: [{
1236
+ type: Injectable
1237
+ }] });
1238
+
1239
+ /*
1240
+ * Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
1241
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
1242
+ * This software is released under MIT license.
1243
+ * The full license information can be found in LICENSE in the root directory of this project.
1244
+ */
1245
+
1246
+ /**
1247
+ * Generated bundle index. Do not edit.
1248
+ */
1249
+
1250
+ export { AbstractIfState, CHANGE_KEYS, ClrAbstractContainer, ClrCommonFormsModule, ClrControl, ClrControlContainer, ClrControlError, ClrControlHelper, ClrControlLabel, ClrControlSuccess, ClrForm, ClrFormLayout, ClrIfError, ClrIfSuccess, ClrLayout, ContainerIdService, ControlClassService, ControlIdService, FormsFocusService, LayoutService, MarkControlService, NgControlService, WrappedFormControl };
1251
+ //# sourceMappingURL=clr-angular-forms-common.mjs.map