@siemens/ix-angular 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/READMEOSS.html +10 -61
  2. package/angular-component-lib/utils.d.ts +9 -0
  3. package/common/directives/control-value-accessors/boolean-value-accessor.d.ts +10 -0
  4. package/common/directives/control-value-accessors/date-value-accessor.d.ts +9 -0
  5. package/common/directives/control-value-accessors/index.d.ts +5 -0
  6. package/common/directives/control-value-accessors/radio-value-accessor.d.ts +14 -0
  7. package/common/directives/control-value-accessors/select-value-accessor.d.ts +9 -0
  8. package/common/directives/control-value-accessors/text-value-accessor.d.ts +9 -0
  9. package/common/directives/control-value-accessors/value-accessor.d.ts +30 -0
  10. package/common/directives/dropdown-trigger.d.ts +10 -0
  11. package/common/directives/tree.d.ts +26 -0
  12. package/common/index.d.ts +6 -0
  13. package/common/providers/modal/index.d.ts +3 -0
  14. package/common/providers/modal/modal-ref.d.ts +21 -0
  15. package/common/providers/modal/modal.config.d.ts +6 -0
  16. package/common/providers/modal/modal.service.d.ts +20 -0
  17. package/common/providers/toast/index.d.ts +2 -0
  18. package/common/providers/toast/toast.config.d.ts +6 -0
  19. package/common/providers/toast/toast.service.d.ts +9 -0
  20. package/common/utils/create-value-accessor-provider.d.ts +2 -0
  21. package/components.d.ts +1374 -0
  22. package/declare-components.d.ts +2 -0
  23. package/directives/control-value-accessors/boolean-value-accessor.d.ts +8 -0
  24. package/directives/control-value-accessors/date-value-accessor.d.ts +8 -0
  25. package/directives/control-value-accessors/index.d.ts +5 -0
  26. package/directives/control-value-accessors/radio-value-accessor.d.ts +8 -0
  27. package/directives/control-value-accessors/select-value-accessor.d.ts +8 -0
  28. package/directives/control-value-accessors/text-value-accessor.d.ts +8 -0
  29. package/directives/dropdown-trigger.d.ts +10 -0
  30. package/esm2022/angular-component-lib/utils.mjs +59 -0
  31. package/esm2022/common/directives/control-value-accessors/boolean-value-accessor.mjs +32 -0
  32. package/esm2022/common/directives/control-value-accessors/date-value-accessor.mjs +28 -0
  33. package/esm2022/common/directives/control-value-accessors/index.mjs +14 -0
  34. package/esm2022/common/directives/control-value-accessors/radio-value-accessor.mjs +50 -0
  35. package/esm2022/common/directives/control-value-accessors/select-value-accessor.mjs +28 -0
  36. package/esm2022/common/directives/control-value-accessors/text-value-accessor.mjs +31 -0
  37. package/esm2022/common/directives/control-value-accessors/value-accessor.mjs +157 -0
  38. package/esm2022/common/directives/dropdown-trigger.mjs +28 -0
  39. package/esm2022/common/directives/tree.mjs +70 -0
  40. package/esm2022/common/index.mjs +15 -0
  41. package/esm2022/common/providers/modal/index.mjs +11 -0
  42. package/esm2022/common/providers/modal/modal-ref.mjs +41 -0
  43. package/esm2022/common/providers/modal/modal.config.mjs +10 -0
  44. package/esm2022/common/providers/modal/modal.service.mjs +90 -0
  45. package/esm2022/common/providers/toast/index.mjs +11 -0
  46. package/esm2022/common/providers/toast/toast.config.mjs +10 -0
  47. package/esm2022/common/providers/toast/toast.service.mjs +67 -0
  48. package/esm2022/common/siemens-ix-angular-common.mjs +5 -0
  49. package/esm2022/common/utils/create-value-accessor-provider.mjs +17 -0
  50. package/esm2022/components.mjs +2865 -0
  51. package/esm2022/declare-components.mjs +108 -0
  52. package/esm2022/directives/control-value-accessors/boolean-value-accessor.mjs +26 -0
  53. package/esm2022/directives/control-value-accessors/date-value-accessor.mjs +26 -0
  54. package/esm2022/directives/control-value-accessors/index.mjs +14 -0
  55. package/esm2022/directives/control-value-accessors/radio-value-accessor.mjs +26 -0
  56. package/esm2022/directives/control-value-accessors/select-value-accessor.mjs +26 -0
  57. package/esm2022/directives/control-value-accessors/text-value-accessor.mjs +26 -0
  58. package/esm2022/directives/dropdown-trigger.mjs +31 -0
  59. package/esm2022/index.mjs +19 -0
  60. package/esm2022/ix-icon.mjs +40 -0
  61. package/esm2022/module.mjs +78 -0
  62. package/esm2022/providers/modal/index.mjs +11 -0
  63. package/esm2022/providers/modal/modal.service.mjs +28 -0
  64. package/esm2022/providers/theme/index.mjs +10 -0
  65. package/esm2022/providers/theme/theme.service.mjs +40 -0
  66. package/esm2022/providers/toast/index.mjs +2 -0
  67. package/esm2022/providers/toast/toast.service.mjs +34 -0
  68. package/esm2022/siemens-ix-angular.mjs +5 -0
  69. package/esm2022/standalone/angular-component-lib/utils.mjs +59 -0
  70. package/esm2022/standalone/components.mjs +3188 -0
  71. package/esm2022/standalone/directives/control-value-accessors/boolean-value-accessor.mjs +30 -0
  72. package/esm2022/standalone/directives/control-value-accessors/date-value-accessor.mjs +30 -0
  73. package/esm2022/standalone/directives/control-value-accessors/index.mjs +14 -0
  74. package/esm2022/standalone/directives/control-value-accessors/radio-value-accessor.mjs +30 -0
  75. package/esm2022/standalone/directives/control-value-accessors/select-value-accessor.mjs +30 -0
  76. package/esm2022/standalone/directives/control-value-accessors/text-value-accessor.mjs +30 -0
  77. package/esm2022/standalone/directives/dropdown-trigger.mjs +32 -0
  78. package/esm2022/standalone/index.mjs +18 -0
  79. package/esm2022/standalone/internal-components.mjs +25 -0
  80. package/esm2022/standalone/ix-icon.mjs +44 -0
  81. package/esm2022/standalone/providers/modal.mjs +28 -0
  82. package/esm2022/standalone/providers/toast.mjs +35 -0
  83. package/esm2022/standalone/siemens-ix-angular-standalone.mjs +5 -0
  84. package/esm2022/standalone/tree.mjs +41 -0
  85. package/esm2022/standalone/utils/value-accessor-directives.mjs +23 -0
  86. package/esm2022/tree.mjs +39 -0
  87. package/esm2022/utils/app-initialize.mjs +25 -0
  88. package/fesm2022/siemens-ix-angular-common.mjs +664 -0
  89. package/fesm2022/siemens-ix-angular-common.mjs.map +1 -0
  90. package/fesm2022/siemens-ix-angular-standalone.mjs +3483 -0
  91. package/fesm2022/siemens-ix-angular-standalone.mjs.map +1 -0
  92. package/fesm2022/siemens-ix-angular.mjs +3345 -0
  93. package/fesm2022/siemens-ix-angular.mjs.map +1 -0
  94. package/index.d.ts +10 -0
  95. package/ix-icon.d.ts +12 -0
  96. package/module.d.ts +17 -0
  97. package/package.json +2 -7
  98. package/providers/modal/index.d.ts +2 -0
  99. package/providers/modal/modal.service.d.ts +15 -0
  100. package/providers/theme/index.d.ts +1 -0
  101. package/providers/theme/theme.service.d.ts +15 -0
  102. package/providers/toast/index.d.ts +2 -0
  103. package/providers/toast/toast.service.d.ts +11 -0
  104. package/standalone/angular-component-lib/utils.d.ts +9 -0
  105. package/standalone/components.d.ts +1374 -0
  106. package/standalone/directives/control-value-accessors/boolean-value-accessor.d.ts +11 -0
  107. package/standalone/directives/control-value-accessors/date-value-accessor.d.ts +11 -0
  108. package/standalone/directives/control-value-accessors/index.d.ts +5 -0
  109. package/standalone/directives/control-value-accessors/radio-value-accessor.d.ts +11 -0
  110. package/standalone/directives/control-value-accessors/select-value-accessor.d.ts +11 -0
  111. package/standalone/directives/control-value-accessors/text-value-accessor.d.ts +11 -0
  112. package/standalone/directives/dropdown-trigger.d.ts +10 -0
  113. package/standalone/index.d.ts +9 -0
  114. package/standalone/internal-components.d.ts +1 -0
  115. package/standalone/ix-icon.d.ts +9 -0
  116. package/standalone/providers/modal.d.ts +11 -0
  117. package/standalone/providers/toast.d.ts +11 -0
  118. package/standalone/tree.d.ts +9 -0
  119. package/standalone/utils/value-accessor-directives.d.ts +16 -0
  120. package/tree.d.ts +9 -0
  121. package/utils/app-initialize.d.ts +1 -0
@@ -0,0 +1,664 @@
1
+ import { closeModal, dismissModal, showModal, getToastContainer, toast } from '@siemens/ix';
2
+ import * as i0 from '@angular/core';
3
+ import { Type, Injector, ElementRef, Injectable, TemplateRef, HostListener, Input, Directive, Inject } from '@angular/core';
4
+ import { NgControl, NG_VALUE_ACCESSOR } from '@angular/forms';
5
+
6
+ /*
7
+ * SPDX-FileCopyrightText: 2024 Siemens AG
8
+ *
9
+ * SPDX-License-Identifier: MIT
10
+ *
11
+ * This source code is licensed under the MIT license found in the
12
+ * LICENSE file in the root directory of this source tree.
13
+ */
14
+ class IxActiveModal {
15
+ modalData;
16
+ modalElement;
17
+ constructor(modalData) {
18
+ this.modalData = modalData;
19
+ }
20
+ get data() {
21
+ return this.modalData;
22
+ }
23
+ /**
24
+ * Close the active modal
25
+ *
26
+ * @param reason
27
+ */
28
+ close(reason) {
29
+ closeModal(this.modalElement, reason);
30
+ }
31
+ /**
32
+ * Dismiss the active modal
33
+ *
34
+ * @param reason
35
+ */
36
+ dismiss(reason) {
37
+ dismissModal(this.modalElement, reason);
38
+ }
39
+ }
40
+ class InternalIxActiveModal extends IxActiveModal {
41
+ setModalElement(element) {
42
+ this.modalElement = element;
43
+ }
44
+ }
45
+
46
+ /*
47
+ * SPDX-FileCopyrightText: 2024 Siemens AG
48
+ *
49
+ * SPDX-License-Identifier: MIT
50
+ *
51
+ * This source code is licensed under the MIT license found in the
52
+ * LICENSE file in the root directory of this source tree.
53
+ */
54
+ class ModalService {
55
+ appRef;
56
+ componentFactoryResolver;
57
+ injector;
58
+ constructor(appRef, componentFactoryResolver, injector) {
59
+ this.appRef = appRef;
60
+ this.componentFactoryResolver = componentFactoryResolver;
61
+ this.injector = injector;
62
+ }
63
+ async open(config) {
64
+ const context = {
65
+ close: null,
66
+ dismiss: null,
67
+ data: config.data,
68
+ };
69
+ if (config.content instanceof Type) {
70
+ return this.createContentByComponentType(config.content, config, context);
71
+ }
72
+ const modalInstance = await this.createContentByTemplateRef(config.content, config, context);
73
+ return modalInstance;
74
+ }
75
+ async createContentByComponentType(componentType, config, context) {
76
+ const activeModal = new InternalIxActiveModal(context.data);
77
+ const modalFactory = this.componentFactoryResolver.resolveComponentFactory(componentType);
78
+ const modalInjector = Injector.create({
79
+ providers: [
80
+ {
81
+ provide: IxActiveModal,
82
+ useValue: activeModal,
83
+ },
84
+ ],
85
+ parent: this.injector,
86
+ });
87
+ const instance = modalFactory.create(modalInjector);
88
+ this.appRef.attachView(instance.hostView);
89
+ const element = instance.injector.get(ElementRef);
90
+ element.nativeElement.style.display = 'contents';
91
+ const modalInstance = await this.createModalInstance(context, element.nativeElement, instance.hostView, config);
92
+ activeModal.setModalElement(modalInstance.htmlElement);
93
+ return modalInstance;
94
+ }
95
+ async createContentByTemplateRef(templateRef, config, context) {
96
+ const embeddedView = templateRef.createEmbeddedView({
97
+ $implicit: context,
98
+ });
99
+ this.appRef.attachView(embeddedView);
100
+ return await this.createModalInstance(context, embeddedView.rootNodes[0], embeddedView, config);
101
+ }
102
+ async createModalInstance(context, htmlElement, viewRef, config) {
103
+ context.close = (result) => {
104
+ closeModal(htmlElement, result);
105
+ };
106
+ context.dismiss = (result) => {
107
+ dismissModal(htmlElement, result);
108
+ };
109
+ viewRef.detectChanges();
110
+ const modalInstance = await showModal({
111
+ ...config,
112
+ content: htmlElement,
113
+ });
114
+ modalInstance.onClose.once(() => {
115
+ viewRef.destroy();
116
+ });
117
+ modalInstance.onDismiss.once(() => {
118
+ viewRef.destroy();
119
+ });
120
+ return modalInstance;
121
+ }
122
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ModalService, deps: [{ token: i0.ApplicationRef }, { token: i0.ComponentFactoryResolver }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
123
+ /** @nocollapse */ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ModalService, providedIn: 'root' });
124
+ }
125
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ModalService, decorators: [{
126
+ type: Injectable,
127
+ args: [{
128
+ providedIn: 'root',
129
+ }]
130
+ }], ctorParameters: () => [{ type: i0.ApplicationRef }, { type: i0.ComponentFactoryResolver }, { type: i0.Injector }] });
131
+
132
+ /*
133
+ * SPDX-FileCopyrightText: 2024 Siemens AG
134
+ *
135
+ * SPDX-License-Identifier: MIT
136
+ *
137
+ * This source code is licensed under the MIT license found in the
138
+ * LICENSE file in the root directory of this source tree.
139
+ */
140
+
141
+ /*
142
+ * SPDX-FileCopyrightText: 2024 Siemens AG
143
+ *
144
+ * SPDX-License-Identifier: MIT
145
+ *
146
+ * This source code is licensed under the MIT license found in the
147
+ * LICENSE file in the root directory of this source tree.
148
+ */
149
+ class ToastService {
150
+ setPosition(position) {
151
+ getToastContainer().position = position;
152
+ }
153
+ getPosition() {
154
+ return getToastContainer().position;
155
+ }
156
+ async show(config) {
157
+ if (typeof config.message === 'string' && !config.action) {
158
+ return toast(config);
159
+ }
160
+ const context = {
161
+ close: null,
162
+ };
163
+ let node = config.message;
164
+ let embeddedView;
165
+ let embeddedViewAction;
166
+ let nodeAction;
167
+ if (config.message instanceof TemplateRef) {
168
+ embeddedView = config.message.createEmbeddedView({
169
+ $implicit: context,
170
+ });
171
+ node = embeddedView.rootNodes[0];
172
+ embeddedView.detectChanges();
173
+ }
174
+ if (config.action instanceof TemplateRef) {
175
+ embeddedViewAction = config.action.createEmbeddedView({
176
+ $implicit: context,
177
+ });
178
+ nodeAction = embeddedViewAction.rootNodes[0];
179
+ embeddedViewAction.detectChanges();
180
+ }
181
+ const instance = await toast({
182
+ ...config,
183
+ message: node,
184
+ action: nodeAction,
185
+ });
186
+ context.close = () => {
187
+ instance.close();
188
+ };
189
+ instance.onClose.once(() => {
190
+ embeddedView?.destroy();
191
+ embeddedViewAction?.destroy();
192
+ });
193
+ return instance;
194
+ }
195
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
196
+ /** @nocollapse */ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ToastService, providedIn: 'root' });
197
+ }
198
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ToastService, decorators: [{
199
+ type: Injectable,
200
+ args: [{
201
+ providedIn: 'root',
202
+ }]
203
+ }] });
204
+
205
+ /*
206
+ * SPDX-FileCopyrightText: 2024 Siemens AG
207
+ *
208
+ * SPDX-License-Identifier: MIT
209
+ *
210
+ * This source code is licensed under the MIT license found in the
211
+ * LICENSE file in the root directory of this source tree.
212
+ */
213
+
214
+ /*
215
+ * SPDX-FileCopyrightText: 2024 Siemens AG
216
+ *
217
+ * SPDX-License-Identifier: MIT
218
+ *
219
+ * This source code is licensed under the MIT license found in the
220
+ * LICENSE file in the root directory of this source tree.
221
+ */
222
+
223
+ /*
224
+ * SPDX-FileCopyrightText: 2025 Siemens AG
225
+ *
226
+ * SPDX-License-Identifier: MIT
227
+ *
228
+ * This source code is licensed under the MIT license found in the
229
+ * LICENSE file in the root directory of this source tree.
230
+ */
231
+ class ValueAccessor {
232
+ injector;
233
+ elementRef;
234
+ checkRequiredValidator;
235
+ static ANGULAR_CLASS_PREFIX = 'ng-';
236
+ onChange = () => {
237
+ /**/
238
+ };
239
+ onTouched = () => {
240
+ /**/
241
+ };
242
+ lastValue;
243
+ statusChanges;
244
+ suppressClassMapping = false;
245
+ constructor(injector, elementRef, checkRequiredValidator = false) {
246
+ this.injector = injector;
247
+ this.elementRef = elementRef;
248
+ this.checkRequiredValidator = checkRequiredValidator;
249
+ }
250
+ writeValue(value) {
251
+ this.elementRef.nativeElement.value = this.lastValue = value;
252
+ this.setClasses();
253
+ }
254
+ handleValueChange(el, value) {
255
+ if (el === this.elementRef.nativeElement) {
256
+ if (value !== this.lastValue) {
257
+ this.lastValue = value;
258
+ this.onChange(value);
259
+ }
260
+ this.setClasses();
261
+ }
262
+ }
263
+ _handleBlurEvent(el) {
264
+ if (el === this.elementRef.nativeElement) {
265
+ this.onTouched();
266
+ this.setClasses();
267
+ }
268
+ }
269
+ registerOnChange(fn) {
270
+ this.onChange = fn;
271
+ }
272
+ registerOnTouched(fn) {
273
+ this.onTouched = fn;
274
+ }
275
+ setDisabledState(isDisabled) {
276
+ this.elementRef.nativeElement.disabled = isDisabled;
277
+ }
278
+ ngOnDestroy() {
279
+ if (this.statusChanges) {
280
+ this.statusChanges.unsubscribe();
281
+ }
282
+ }
283
+ ngAfterViewInit() {
284
+ let ngControl = this.getAssignedNgControl();
285
+ if (!ngControl) {
286
+ return;
287
+ }
288
+ if (ngControl.statusChanges) {
289
+ this.statusChanges = ngControl.statusChanges.subscribe(() => {
290
+ this.setClasses();
291
+ });
292
+ }
293
+ this.detourFormControlMethods(ngControl, this.elementRef);
294
+ }
295
+ getAssignedNgControl() {
296
+ let ngControl = null;
297
+ try {
298
+ ngControl = this.injector.get(NgControl);
299
+ }
300
+ catch {
301
+ /* No FormControl or ngModel binding */
302
+ }
303
+ return ngControl;
304
+ }
305
+ setClasses() {
306
+ const ngControl = this.getAssignedNgControl();
307
+ if (!ngControl) {
308
+ return;
309
+ }
310
+ this.mapNgToIxClassNames(this.elementRef);
311
+ }
312
+ detourFormControlMethods(ngControl, elementRef) {
313
+ const formControl = ngControl.control;
314
+ if (formControl) {
315
+ const methodsToPatch = [
316
+ 'markAsTouched',
317
+ 'markAllAsTouched',
318
+ 'markAsUntouched',
319
+ 'markAsDirty',
320
+ 'markAsPristine',
321
+ ];
322
+ methodsToPatch.forEach((method) => {
323
+ if (typeof formControl[method] !== 'undefined') {
324
+ const oldFn = formControl[method].bind(formControl);
325
+ formControl[method] = (...params) => {
326
+ oldFn(...params);
327
+ this.mapNgToIxClassNames(elementRef);
328
+ };
329
+ }
330
+ });
331
+ }
332
+ }
333
+ async mapNgToIxClassNames(element) {
334
+ if (this.suppressClassMapping) {
335
+ return;
336
+ }
337
+ const input = element.nativeElement;
338
+ setTimeout(async () => {
339
+ const classes = this.getClasses(input);
340
+ const classList = input.classList;
341
+ classList.remove('ix-valid', 'ix-invalid', 'ix-touched', 'ix-untouched', 'ix-dirty', 'ix-pristine');
342
+ classList.add(...classes);
343
+ const ngControl = this.getAssignedNgControl();
344
+ if (ngControl && this.checkRequiredValidator) {
345
+ const { errors, touched } = ngControl;
346
+ const hasOtherErrors = errors && Object.keys(errors).length > 1;
347
+ const isRequiredButUntouched = errors?.required && !touched;
348
+ if (hasOtherErrors === false && isRequiredButUntouched) {
349
+ input.classList.remove('ix-invalid');
350
+ }
351
+ }
352
+ });
353
+ }
354
+ getClasses(element) {
355
+ const classList = element.classList;
356
+ const classes = [];
357
+ for (let i = 0; i < classList.length; i++) {
358
+ const item = classList.item(i);
359
+ if (item?.startsWith(ValueAccessor.ANGULAR_CLASS_PREFIX)) {
360
+ classes.push(`ix-${item.substring(3)}`);
361
+ }
362
+ }
363
+ return classes;
364
+ }
365
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ValueAccessor, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
366
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: ValueAccessor, inputs: { suppressClassMapping: "suppressClassMapping" }, host: { listeners: { "ixBlur": "_handleBlurEvent($event.target)" } }, ngImport: i0 });
367
+ }
368
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ValueAccessor, decorators: [{
369
+ type: Directive
370
+ }], ctorParameters: () => [{ type: i0.Injector }, { type: i0.ElementRef }, { type: undefined }], propDecorators: { suppressClassMapping: [{
371
+ type: Input
372
+ }], _handleBlurEvent: [{
373
+ type: HostListener,
374
+ args: ['ixBlur', ['$event.target']]
375
+ }] } });
376
+
377
+ /*
378
+ * SPDX-FileCopyrightText: 2025 Siemens AG
379
+ *
380
+ * SPDX-License-Identifier: MIT
381
+ *
382
+ * This source code is licensed under the MIT license found in the
383
+ * LICENSE file in the root directory of this source tree.
384
+ */
385
+ class BooleanValueAccessorBaseDirective extends ValueAccessor {
386
+ constructor(injector, el) {
387
+ super(injector, el, true);
388
+ }
389
+ writeValue(value) {
390
+ this.elementRef.nativeElement.checked = this.lastValue = value;
391
+ super.mapNgToIxClassNames(this.elementRef);
392
+ }
393
+ handleChangeEvent(el) {
394
+ super.handleValueChange(el, el.checked);
395
+ }
396
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: BooleanValueAccessorBaseDirective, deps: [{ token: i0.Injector }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
397
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: BooleanValueAccessorBaseDirective, host: { listeners: { "checkedChange": "handleChangeEvent($event.target)" } }, usesInheritance: true, ngImport: i0 });
398
+ }
399
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: BooleanValueAccessorBaseDirective, decorators: [{
400
+ type: Directive
401
+ }], ctorParameters: () => [{ type: i0.Injector }, { type: i0.ElementRef }], propDecorators: { handleChangeEvent: [{
402
+ type: HostListener,
403
+ args: ['checkedChange', ['$event.target']]
404
+ }] } });
405
+
406
+ /*
407
+ * SPDX-FileCopyrightText: 2025 Siemens AG
408
+ *
409
+ * SPDX-License-Identifier: MIT
410
+ *
411
+ * This source code is licensed under the MIT license found in the
412
+ * LICENSE file in the root directory of this source tree.
413
+ */
414
+ class RadioValueAccessorBaseDirective extends ValueAccessor {
415
+ radioValueChangeSubscription;
416
+ constructor(injector, el) {
417
+ super(injector, el);
418
+ }
419
+ ngAfterViewInit() {
420
+ super.ngAfterViewInit();
421
+ this.handleRadioGroupValueChange();
422
+ }
423
+ handleRadioGroupValueChange() {
424
+ this.radioValueChangeSubscription = this.getAssignedNgControl()?.valueChanges?.subscribe((value) => {
425
+ this.lastValue = value;
426
+ });
427
+ }
428
+ writeValue(value) {
429
+ this.lastValue = value;
430
+ this.elementRef.nativeElement.checked =
431
+ this.elementRef.nativeElement.value === value;
432
+ super.mapNgToIxClassNames(this.elementRef);
433
+ }
434
+ handleChangeEvent(el) {
435
+ super.handleValueChange(el, el.value);
436
+ }
437
+ ngOnDestroy() {
438
+ super.ngOnDestroy();
439
+ if (this.radioValueChangeSubscription) {
440
+ this.radioValueChangeSubscription.unsubscribe();
441
+ }
442
+ }
443
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RadioValueAccessorBaseDirective, deps: [{ token: i0.Injector }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
444
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: RadioValueAccessorBaseDirective, host: { listeners: { "checkedChange": "handleChangeEvent($event.target)" } }, usesInheritance: true, ngImport: i0 });
445
+ }
446
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RadioValueAccessorBaseDirective, decorators: [{
447
+ type: Directive
448
+ }], ctorParameters: () => [{ type: i0.Injector }, { type: i0.ElementRef }], propDecorators: { handleChangeEvent: [{
449
+ type: HostListener,
450
+ args: ['checkedChange', ['$event.target']]
451
+ }] } });
452
+
453
+ /*
454
+ * SPDX-FileCopyrightText: 2025 Siemens AG
455
+ *
456
+ * SPDX-License-Identifier: MIT
457
+ *
458
+ * This source code is licensed under the MIT license found in the
459
+ * LICENSE file in the root directory of this source tree.
460
+ */
461
+ class SelectValueAccessorBaseDirective extends ValueAccessor {
462
+ constructor(injector, el) {
463
+ super(injector, el, true);
464
+ }
465
+ handleChangeEvent(el) {
466
+ super.handleValueChange(el, el.value);
467
+ }
468
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectValueAccessorBaseDirective, deps: [{ token: i0.Injector }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
469
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: SelectValueAccessorBaseDirective, host: { listeners: { "valueChange": "handleChangeEvent($event.target)" } }, usesInheritance: true, ngImport: i0 });
470
+ }
471
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectValueAccessorBaseDirective, decorators: [{
472
+ type: Directive
473
+ }], ctorParameters: () => [{ type: i0.Injector }, { type: i0.ElementRef }], propDecorators: { handleChangeEvent: [{
474
+ type: HostListener,
475
+ args: ['valueChange', ['$event.target']]
476
+ }] } });
477
+
478
+ /*
479
+ * SPDX-FileCopyrightText: 2025 Siemens AG
480
+ *
481
+ * SPDX-License-Identifier: MIT
482
+ *
483
+ * This source code is licensed under the MIT license found in the
484
+ * LICENSE file in the root directory of this source tree.
485
+ */
486
+ class TextValueAccessorBaseDirective extends ValueAccessor {
487
+ constructor(injector, el) {
488
+ super(injector, el, true);
489
+ }
490
+ handleInputEvent(el) {
491
+ super.handleValueChange(el, el.value);
492
+ }
493
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TextValueAccessorBaseDirective, deps: [{ token: i0.Injector }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
494
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: TextValueAccessorBaseDirective, host: { listeners: { "input": "handleInputEvent($event.target)", "valueChange": "handleInputEvent($event.target)" } }, usesInheritance: true, ngImport: i0 });
495
+ }
496
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TextValueAccessorBaseDirective, decorators: [{
497
+ type: Directive
498
+ }], ctorParameters: () => [{ type: i0.Injector }, { type: i0.ElementRef }], propDecorators: { handleInputEvent: [{
499
+ type: HostListener,
500
+ args: ['input', ['$event.target']]
501
+ }, {
502
+ type: HostListener,
503
+ args: ['valueChange', ['$event.target']]
504
+ }] } });
505
+
506
+ /*
507
+ * SPDX-FileCopyrightText: 2025 Siemens AG
508
+ *
509
+ * SPDX-License-Identifier: MIT
510
+ *
511
+ * This source code is licensed under the MIT license found in the
512
+ * LICENSE file in the root directory of this source tree.
513
+ */
514
+ class DateValueAccessorBaseDirective extends ValueAccessor {
515
+ constructor(injector, el) {
516
+ super(injector, el, true);
517
+ }
518
+ handleInputEvent(el) {
519
+ super.handleValueChange(el, el.value);
520
+ }
521
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DateValueAccessorBaseDirective, deps: [{ token: i0.Injector }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
522
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: DateValueAccessorBaseDirective, host: { listeners: { "valueChange": "handleInputEvent($event.target)" } }, usesInheritance: true, ngImport: i0 });
523
+ }
524
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DateValueAccessorBaseDirective, decorators: [{
525
+ type: Directive
526
+ }], ctorParameters: () => [{ type: i0.Injector }, { type: i0.ElementRef }], propDecorators: { handleInputEvent: [{
527
+ type: HostListener,
528
+ args: ['valueChange', ['$event.target']]
529
+ }] } });
530
+
531
+ /*
532
+ * SPDX-FileCopyrightText: 2025 Siemens AG
533
+ *
534
+ * SPDX-License-Identifier: MIT
535
+ *
536
+ * This source code is licensed under the MIT license found in the
537
+ * LICENSE file in the root directory of this source tree.
538
+ */
539
+
540
+ /*
541
+ * SPDX-FileCopyrightText: 2024 Siemens AG
542
+ *
543
+ * SPDX-License-Identifier: MIT
544
+ *
545
+ * This source code is licensed under the MIT license found in the
546
+ * LICENSE file in the root directory of this source tree.
547
+ */
548
+ class DropdownTriggerBaseDirective {
549
+ element;
550
+ ixDropdownTrigger;
551
+ constructor(element) {
552
+ this.element = element;
553
+ }
554
+ ngOnChanges() {
555
+ this.element.nativeElement.trigger = this.ixDropdownTrigger.el;
556
+ }
557
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DropdownTriggerBaseDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
558
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: DropdownTriggerBaseDirective, inputs: { ixDropdownTrigger: "ixDropdownTrigger" }, usesOnChanges: true, ngImport: i0 });
559
+ }
560
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DropdownTriggerBaseDirective, decorators: [{
561
+ type: Directive
562
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { ixDropdownTrigger: [{
563
+ type: Input
564
+ }] } });
565
+
566
+ /*
567
+ * SPDX-FileCopyrightText: 2025 Siemens AG
568
+ *
569
+ * SPDX-License-Identifier: MIT
570
+ *
571
+ * This source code is licensed under the MIT license found in the
572
+ * LICENSE file in the root directory of this source tree.
573
+ */
574
+ class TreeBaseDirective {
575
+ z;
576
+ renderCache = new Map();
577
+ set renderItem(template) {
578
+ const itemRenderFunction = this.generateItemRenderer(template);
579
+ this.el.renderItem = itemRenderFunction.bind(this);
580
+ }
581
+ el;
582
+ onRemovedSubscription;
583
+ constructor(c, r, z, proxyOutputs) {
584
+ this.z = z;
585
+ c.detach();
586
+ this.el = r.nativeElement;
587
+ proxyOutputs(this, this.el, ['contextChange', 'nodeRemoved']);
588
+ this.onRemovedSubscription = this.nodeRemoved.subscribe((removedEvent) => {
589
+ const { detail } = removedEvent;
590
+ detail.forEach((removedItemElement) => {
591
+ if (this.renderCache.has(removedItemElement)) {
592
+ this.renderCache.get(removedItemElement)?.destroy();
593
+ this.renderCache.delete(removedItemElement);
594
+ }
595
+ });
596
+ });
597
+ }
598
+ ngOnDestroy() {
599
+ this.onRemovedSubscription?.unsubscribe();
600
+ }
601
+ generateItemRenderer(templateRef) {
602
+ return (_, itemData, __, context, update) => {
603
+ const treeItem = document.createElement('ix-tree-item');
604
+ treeItem.hasChildren = itemData.hasChildren;
605
+ treeItem.context = context[itemData.id];
606
+ const embeddedView = templateRef.createEmbeddedView({
607
+ $implicit: itemData.data,
608
+ });
609
+ const container = embeddedView.rootNodes[0];
610
+ embeddedView.detectChanges();
611
+ update((itemData, context) => {
612
+ treeItem.context = context[itemData.id];
613
+ treeItem.hasChildren = itemData.hasChildren;
614
+ embeddedView.context.$implicit = itemData.data;
615
+ embeddedView.detectChanges();
616
+ });
617
+ treeItem.appendChild(container);
618
+ this.renderCache.set(treeItem, embeddedView);
619
+ return treeItem;
620
+ };
621
+ }
622
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TreeBaseDirective, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: 'proxyOutputs' }], target: i0.ɵɵFactoryTarget.Directive });
623
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: TreeBaseDirective, inputs: { renderItem: "renderItem" }, ngImport: i0 });
624
+ }
625
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TreeBaseDirective, decorators: [{
626
+ type: Directive
627
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
628
+ type: Inject,
629
+ args: ['proxyOutputs']
630
+ }] }], propDecorators: { renderItem: [{
631
+ type: Input
632
+ }] } });
633
+
634
+ /*
635
+ * SPDX-FileCopyrightText: 2025 Siemens AG
636
+ *
637
+ * SPDX-License-Identifier: MIT
638
+ *
639
+ * This source code is licensed under the MIT license found in the
640
+ * LICENSE file in the root directory of this source tree.
641
+ */
642
+ function createValueAccessorProvider(useExisting) {
643
+ return {
644
+ provide: NG_VALUE_ACCESSOR,
645
+ useExisting,
646
+ multi: true,
647
+ };
648
+ }
649
+
650
+ /*
651
+ * SPDX-FileCopyrightText: 2025 Siemens AG
652
+ *
653
+ * SPDX-License-Identifier: MIT
654
+ *
655
+ * This source code is licensed under the MIT license found in the
656
+ * LICENSE file in the root directory of this source tree.
657
+ */
658
+
659
+ /**
660
+ * Generated bundle index. Do not edit.
661
+ */
662
+
663
+ export { BooleanValueAccessorBaseDirective, DateValueAccessorBaseDirective, DropdownTriggerBaseDirective, IxActiveModal, ModalService, RadioValueAccessorBaseDirective, SelectValueAccessorBaseDirective, TextValueAccessorBaseDirective, ToastService, TreeBaseDirective, createValueAccessorProvider };
664
+ //# sourceMappingURL=siemens-ix-angular-common.mjs.map