@siemens/ix-angular 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/READMEOSS.html +421 -0
- package/package.json +7 -2
- package/angular-component-lib/utils.d.ts +0 -9
- package/common/directives/control-value-accessors/boolean-value-accessor.d.ts +0 -10
- package/common/directives/control-value-accessors/date-value-accessor.d.ts +0 -9
- package/common/directives/control-value-accessors/index.d.ts +0 -5
- package/common/directives/control-value-accessors/radio-value-accessor.d.ts +0 -10
- package/common/directives/control-value-accessors/select-value-accessor.d.ts +0 -9
- package/common/directives/control-value-accessors/text-value-accessor.d.ts +0 -9
- package/common/directives/control-value-accessors/value-accessor.d.ts +0 -30
- package/common/directives/dropdown-trigger.d.ts +0 -10
- package/common/directives/tree.d.ts +0 -26
- package/common/index.d.ts +0 -6
- package/common/providers/modal/index.d.ts +0 -3
- package/common/providers/modal/modal-ref.d.ts +0 -21
- package/common/providers/modal/modal.config.d.ts +0 -6
- package/common/providers/modal/modal.service.d.ts +0 -20
- package/common/providers/toast/index.d.ts +0 -2
- package/common/providers/toast/toast.config.d.ts +0 -5
- package/common/providers/toast/toast.service.d.ts +0 -9
- package/common/utils/create-value-accessor-provider.d.ts +0 -2
- package/components.d.ts +0 -1342
- package/declare-components.d.ts +0 -2
- package/directives/control-value-accessors/boolean-value-accessor.d.ts +0 -8
- package/directives/control-value-accessors/date-value-accessor.d.ts +0 -8
- package/directives/control-value-accessors/index.d.ts +0 -5
- package/directives/control-value-accessors/radio-value-accessor.d.ts +0 -8
- package/directives/control-value-accessors/select-value-accessor.d.ts +0 -8
- package/directives/control-value-accessors/text-value-accessor.d.ts +0 -8
- package/directives/dropdown-trigger.d.ts +0 -10
- package/esm2022/angular-component-lib/utils.mjs +0 -59
- package/esm2022/common/directives/control-value-accessors/boolean-value-accessor.mjs +0 -32
- package/esm2022/common/directives/control-value-accessors/date-value-accessor.mjs +0 -28
- package/esm2022/common/directives/control-value-accessors/index.mjs +0 -14
- package/esm2022/common/directives/control-value-accessors/radio-value-accessor.mjs +0 -34
- package/esm2022/common/directives/control-value-accessors/select-value-accessor.mjs +0 -28
- package/esm2022/common/directives/control-value-accessors/text-value-accessor.mjs +0 -31
- package/esm2022/common/directives/control-value-accessors/value-accessor.mjs +0 -157
- package/esm2022/common/directives/dropdown-trigger.mjs +0 -28
- package/esm2022/common/directives/tree.mjs +0 -70
- package/esm2022/common/index.mjs +0 -15
- package/esm2022/common/providers/modal/index.mjs +0 -11
- package/esm2022/common/providers/modal/modal-ref.mjs +0 -41
- package/esm2022/common/providers/modal/modal.config.mjs +0 -10
- package/esm2022/common/providers/modal/modal.service.mjs +0 -90
- package/esm2022/common/providers/toast/index.mjs +0 -11
- package/esm2022/common/providers/toast/toast.config.mjs +0 -10
- package/esm2022/common/providers/toast/toast.service.mjs +0 -52
- package/esm2022/common/siemens-ix-angular-common.mjs +0 -5
- package/esm2022/common/utils/create-value-accessor-provider.mjs +0 -17
- package/esm2022/components.mjs +0 -2809
- package/esm2022/declare-components.mjs +0 -106
- package/esm2022/directives/control-value-accessors/boolean-value-accessor.mjs +0 -26
- package/esm2022/directives/control-value-accessors/date-value-accessor.mjs +0 -26
- package/esm2022/directives/control-value-accessors/index.mjs +0 -14
- package/esm2022/directives/control-value-accessors/radio-value-accessor.mjs +0 -26
- package/esm2022/directives/control-value-accessors/select-value-accessor.mjs +0 -26
- package/esm2022/directives/control-value-accessors/text-value-accessor.mjs +0 -26
- package/esm2022/directives/dropdown-trigger.mjs +0 -31
- package/esm2022/index.mjs +0 -19
- package/esm2022/ix-icon.mjs +0 -40
- package/esm2022/module.mjs +0 -78
- package/esm2022/providers/modal/index.mjs +0 -11
- package/esm2022/providers/modal/modal.service.mjs +0 -28
- package/esm2022/providers/theme/index.mjs +0 -10
- package/esm2022/providers/theme/theme.service.mjs +0 -40
- package/esm2022/providers/toast/index.mjs +0 -2
- package/esm2022/providers/toast/toast.service.mjs +0 -52
- package/esm2022/siemens-ix-angular.mjs +0 -5
- package/esm2022/standalone/angular-component-lib/utils.mjs +0 -59
- package/esm2022/standalone/components.mjs +0 -3126
- package/esm2022/standalone/directives/control-value-accessors/boolean-value-accessor.mjs +0 -30
- package/esm2022/standalone/directives/control-value-accessors/date-value-accessor.mjs +0 -30
- package/esm2022/standalone/directives/control-value-accessors/index.mjs +0 -14
- package/esm2022/standalone/directives/control-value-accessors/radio-value-accessor.mjs +0 -30
- package/esm2022/standalone/directives/control-value-accessors/select-value-accessor.mjs +0 -30
- package/esm2022/standalone/directives/control-value-accessors/text-value-accessor.mjs +0 -30
- package/esm2022/standalone/directives/dropdown-trigger.mjs +0 -32
- package/esm2022/standalone/index.mjs +0 -18
- package/esm2022/standalone/internal-components.mjs +0 -19
- package/esm2022/standalone/ix-icon.mjs +0 -44
- package/esm2022/standalone/providers/modal.mjs +0 -26
- package/esm2022/standalone/providers/toast.mjs +0 -31
- package/esm2022/standalone/siemens-ix-angular-standalone.mjs +0 -5
- package/esm2022/standalone/tree.mjs +0 -41
- package/esm2022/standalone/utils/value-accessor-directives.mjs +0 -23
- package/esm2022/tree.mjs +0 -39
- package/esm2022/utils/app-initialize.mjs +0 -25
- package/fesm2022/siemens-ix-angular-common.mjs +0 -633
- package/fesm2022/siemens-ix-angular-common.mjs.map +0 -1
- package/fesm2022/siemens-ix-angular-standalone.mjs +0 -3415
- package/fesm2022/siemens-ix-angular-standalone.mjs.map +0 -1
- package/fesm2022/siemens-ix-angular.mjs +0 -3307
- package/fesm2022/siemens-ix-angular.mjs.map +0 -1
- package/index.d.ts +0 -10
- package/ix-icon.d.ts +0 -12
- package/module.d.ts +0 -17
- package/providers/modal/index.d.ts +0 -2
- package/providers/modal/modal.service.d.ts +0 -15
- package/providers/theme/index.d.ts +0 -1
- package/providers/theme/theme.service.d.ts +0 -15
- package/providers/toast/index.d.ts +0 -2
- package/providers/toast/toast.service.d.ts +0 -9
- package/standalone/angular-component-lib/utils.d.ts +0 -9
- package/standalone/components.d.ts +0 -1342
- package/standalone/directives/control-value-accessors/boolean-value-accessor.d.ts +0 -11
- package/standalone/directives/control-value-accessors/date-value-accessor.d.ts +0 -11
- package/standalone/directives/control-value-accessors/index.d.ts +0 -5
- package/standalone/directives/control-value-accessors/radio-value-accessor.d.ts +0 -11
- package/standalone/directives/control-value-accessors/select-value-accessor.d.ts +0 -11
- package/standalone/directives/control-value-accessors/text-value-accessor.d.ts +0 -11
- package/standalone/directives/dropdown-trigger.d.ts +0 -10
- package/standalone/index.d.ts +0 -9
- package/standalone/internal-components.d.ts +0 -1
- package/standalone/ix-icon.d.ts +0 -9
- package/standalone/providers/modal.d.ts +0 -11
- package/standalone/providers/toast.d.ts +0 -11
- package/standalone/tree.d.ts +0 -9
- package/standalone/utils/value-accessor-directives.d.ts +0 -16
- package/tree.d.ts +0 -9
- package/utils/app-initialize.d.ts +0 -1
|
@@ -1,633 +0,0 @@
|
|
|
1
|
-
import { closeModal, dismissModal, showModal, getToastContainer, toast } from '@siemens/ix';
|
|
2
|
-
import * as i0 from '@angular/core';
|
|
3
|
-
import { Type, Injector, ElementRef, Injectable, 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') {
|
|
158
|
-
return toast(config);
|
|
159
|
-
}
|
|
160
|
-
const context = {
|
|
161
|
-
close: null,
|
|
162
|
-
};
|
|
163
|
-
const embeddedView = config.message.createEmbeddedView({
|
|
164
|
-
$implicit: context,
|
|
165
|
-
});
|
|
166
|
-
const node = embeddedView.rootNodes[0];
|
|
167
|
-
const instance = await toast({
|
|
168
|
-
...config,
|
|
169
|
-
message: node,
|
|
170
|
-
});
|
|
171
|
-
context.close = () => {
|
|
172
|
-
instance.close();
|
|
173
|
-
};
|
|
174
|
-
embeddedView.detectChanges();
|
|
175
|
-
instance.onClose.once(() => {
|
|
176
|
-
embeddedView.destroy();
|
|
177
|
-
});
|
|
178
|
-
return instance;
|
|
179
|
-
}
|
|
180
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
181
|
-
/** @nocollapse */ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ToastService, providedIn: 'root' });
|
|
182
|
-
}
|
|
183
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ToastService, decorators: [{
|
|
184
|
-
type: Injectable,
|
|
185
|
-
args: [{
|
|
186
|
-
providedIn: 'root',
|
|
187
|
-
}]
|
|
188
|
-
}] });
|
|
189
|
-
|
|
190
|
-
/*
|
|
191
|
-
* SPDX-FileCopyrightText: 2024 Siemens AG
|
|
192
|
-
*
|
|
193
|
-
* SPDX-License-Identifier: MIT
|
|
194
|
-
*
|
|
195
|
-
* This source code is licensed under the MIT license found in the
|
|
196
|
-
* LICENSE file in the root directory of this source tree.
|
|
197
|
-
*/
|
|
198
|
-
|
|
199
|
-
/*
|
|
200
|
-
* SPDX-FileCopyrightText: 2024 Siemens AG
|
|
201
|
-
*
|
|
202
|
-
* SPDX-License-Identifier: MIT
|
|
203
|
-
*
|
|
204
|
-
* This source code is licensed under the MIT license found in the
|
|
205
|
-
* LICENSE file in the root directory of this source tree.
|
|
206
|
-
*/
|
|
207
|
-
|
|
208
|
-
/*
|
|
209
|
-
* SPDX-FileCopyrightText: 2025 Siemens AG
|
|
210
|
-
*
|
|
211
|
-
* SPDX-License-Identifier: MIT
|
|
212
|
-
*
|
|
213
|
-
* This source code is licensed under the MIT license found in the
|
|
214
|
-
* LICENSE file in the root directory of this source tree.
|
|
215
|
-
*/
|
|
216
|
-
class ValueAccessor {
|
|
217
|
-
injector;
|
|
218
|
-
elementRef;
|
|
219
|
-
checkRequiredValidator;
|
|
220
|
-
static ANGULAR_CLASS_PREFIX = 'ng-';
|
|
221
|
-
onChange = () => {
|
|
222
|
-
/**/
|
|
223
|
-
};
|
|
224
|
-
onTouched = () => {
|
|
225
|
-
/**/
|
|
226
|
-
};
|
|
227
|
-
lastValue;
|
|
228
|
-
statusChanges;
|
|
229
|
-
suppressClassMapping = false;
|
|
230
|
-
constructor(injector, elementRef, checkRequiredValidator = false) {
|
|
231
|
-
this.injector = injector;
|
|
232
|
-
this.elementRef = elementRef;
|
|
233
|
-
this.checkRequiredValidator = checkRequiredValidator;
|
|
234
|
-
}
|
|
235
|
-
writeValue(value) {
|
|
236
|
-
this.elementRef.nativeElement.value = this.lastValue = value;
|
|
237
|
-
this.setClasses();
|
|
238
|
-
}
|
|
239
|
-
handleValueChange(el, value) {
|
|
240
|
-
if (el === this.elementRef.nativeElement) {
|
|
241
|
-
if (value !== this.lastValue) {
|
|
242
|
-
this.lastValue = value;
|
|
243
|
-
this.onChange(value);
|
|
244
|
-
}
|
|
245
|
-
this.setClasses();
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
_handleBlurEvent(el) {
|
|
249
|
-
if (el === this.elementRef.nativeElement) {
|
|
250
|
-
this.onTouched();
|
|
251
|
-
this.setClasses();
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
registerOnChange(fn) {
|
|
255
|
-
this.onChange = fn;
|
|
256
|
-
}
|
|
257
|
-
registerOnTouched(fn) {
|
|
258
|
-
this.onTouched = fn;
|
|
259
|
-
}
|
|
260
|
-
setDisabledState(isDisabled) {
|
|
261
|
-
this.elementRef.nativeElement.disabled = isDisabled;
|
|
262
|
-
}
|
|
263
|
-
ngOnDestroy() {
|
|
264
|
-
if (this.statusChanges) {
|
|
265
|
-
this.statusChanges.unsubscribe();
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
ngAfterViewInit() {
|
|
269
|
-
let ngControl = this.getAssignedNgControl();
|
|
270
|
-
if (!ngControl) {
|
|
271
|
-
return;
|
|
272
|
-
}
|
|
273
|
-
if (ngControl.statusChanges) {
|
|
274
|
-
this.statusChanges = ngControl.statusChanges.subscribe(() => {
|
|
275
|
-
this.setClasses();
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
this.detourFormControlMethods(ngControl, this.elementRef);
|
|
279
|
-
}
|
|
280
|
-
getAssignedNgControl() {
|
|
281
|
-
let ngControl = null;
|
|
282
|
-
try {
|
|
283
|
-
ngControl = this.injector.get(NgControl);
|
|
284
|
-
}
|
|
285
|
-
catch {
|
|
286
|
-
/* No FormControl or ngModel binding */
|
|
287
|
-
}
|
|
288
|
-
return ngControl;
|
|
289
|
-
}
|
|
290
|
-
setClasses() {
|
|
291
|
-
const ngControl = this.getAssignedNgControl();
|
|
292
|
-
if (!ngControl) {
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
this.mapNgToIxClassNames(this.elementRef);
|
|
296
|
-
}
|
|
297
|
-
detourFormControlMethods(ngControl, elementRef) {
|
|
298
|
-
const formControl = ngControl.control;
|
|
299
|
-
if (formControl) {
|
|
300
|
-
const methodsToPatch = [
|
|
301
|
-
'markAsTouched',
|
|
302
|
-
'markAllAsTouched',
|
|
303
|
-
'markAsUntouched',
|
|
304
|
-
'markAsDirty',
|
|
305
|
-
'markAsPristine',
|
|
306
|
-
];
|
|
307
|
-
methodsToPatch.forEach((method) => {
|
|
308
|
-
if (typeof formControl[method] !== 'undefined') {
|
|
309
|
-
const oldFn = formControl[method].bind(formControl);
|
|
310
|
-
formControl[method] = (...params) => {
|
|
311
|
-
oldFn(...params);
|
|
312
|
-
this.mapNgToIxClassNames(elementRef);
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
async mapNgToIxClassNames(element) {
|
|
319
|
-
if (this.suppressClassMapping) {
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
const input = element.nativeElement;
|
|
323
|
-
setTimeout(async () => {
|
|
324
|
-
const classes = this.getClasses(input);
|
|
325
|
-
const classList = input.classList;
|
|
326
|
-
classList.remove('ix-valid', 'ix-invalid', 'ix-touched', 'ix-untouched', 'ix-dirty', 'ix-pristine');
|
|
327
|
-
classList.add(...classes);
|
|
328
|
-
const ngControl = this.getAssignedNgControl();
|
|
329
|
-
if (ngControl && this.checkRequiredValidator) {
|
|
330
|
-
const { errors, touched } = ngControl;
|
|
331
|
-
const hasOtherErrors = errors && Object.keys(errors).length > 1;
|
|
332
|
-
const isRequiredButUntouched = errors?.required && !touched;
|
|
333
|
-
if (hasOtherErrors === false && isRequiredButUntouched) {
|
|
334
|
-
input.classList.remove('ix-invalid');
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
getClasses(element) {
|
|
340
|
-
const classList = element.classList;
|
|
341
|
-
const classes = [];
|
|
342
|
-
for (let i = 0; i < classList.length; i++) {
|
|
343
|
-
const item = classList.item(i);
|
|
344
|
-
if (item?.startsWith(ValueAccessor.ANGULAR_CLASS_PREFIX)) {
|
|
345
|
-
classes.push(`ix-${item.substring(3)}`);
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
return classes;
|
|
349
|
-
}
|
|
350
|
-
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ValueAccessor, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
|
|
351
|
-
/** @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 });
|
|
352
|
-
}
|
|
353
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ValueAccessor, decorators: [{
|
|
354
|
-
type: Directive
|
|
355
|
-
}], ctorParameters: () => [{ type: i0.Injector }, { type: i0.ElementRef }, { type: undefined }], propDecorators: { suppressClassMapping: [{
|
|
356
|
-
type: Input
|
|
357
|
-
}], _handleBlurEvent: [{
|
|
358
|
-
type: HostListener,
|
|
359
|
-
args: ['ixBlur', ['$event.target']]
|
|
360
|
-
}] } });
|
|
361
|
-
|
|
362
|
-
/*
|
|
363
|
-
* SPDX-FileCopyrightText: 2025 Siemens AG
|
|
364
|
-
*
|
|
365
|
-
* SPDX-License-Identifier: MIT
|
|
366
|
-
*
|
|
367
|
-
* This source code is licensed under the MIT license found in the
|
|
368
|
-
* LICENSE file in the root directory of this source tree.
|
|
369
|
-
*/
|
|
370
|
-
class BooleanValueAccessorBaseDirective extends ValueAccessor {
|
|
371
|
-
constructor(injector, el) {
|
|
372
|
-
super(injector, el, true);
|
|
373
|
-
}
|
|
374
|
-
writeValue(value) {
|
|
375
|
-
this.elementRef.nativeElement.checked = this.lastValue = value;
|
|
376
|
-
super.mapNgToIxClassNames(this.elementRef);
|
|
377
|
-
}
|
|
378
|
-
handleChangeEvent(el) {
|
|
379
|
-
super.handleValueChange(el, el.checked);
|
|
380
|
-
}
|
|
381
|
-
/** @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 });
|
|
382
|
-
/** @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 });
|
|
383
|
-
}
|
|
384
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: BooleanValueAccessorBaseDirective, decorators: [{
|
|
385
|
-
type: Directive
|
|
386
|
-
}], ctorParameters: () => [{ type: i0.Injector }, { type: i0.ElementRef }], propDecorators: { handleChangeEvent: [{
|
|
387
|
-
type: HostListener,
|
|
388
|
-
args: ['checkedChange', ['$event.target']]
|
|
389
|
-
}] } });
|
|
390
|
-
|
|
391
|
-
/*
|
|
392
|
-
* SPDX-FileCopyrightText: 2025 Siemens AG
|
|
393
|
-
*
|
|
394
|
-
* SPDX-License-Identifier: MIT
|
|
395
|
-
*
|
|
396
|
-
* This source code is licensed under the MIT license found in the
|
|
397
|
-
* LICENSE file in the root directory of this source tree.
|
|
398
|
-
*/
|
|
399
|
-
class RadioValueAccessorBaseDirective extends ValueAccessor {
|
|
400
|
-
constructor(injector, el) {
|
|
401
|
-
super(injector, el);
|
|
402
|
-
}
|
|
403
|
-
writeValue(value) {
|
|
404
|
-
this.lastValue = value;
|
|
405
|
-
this.elementRef.nativeElement.checked =
|
|
406
|
-
this.elementRef.nativeElement.value === value;
|
|
407
|
-
super.mapNgToIxClassNames(this.elementRef);
|
|
408
|
-
}
|
|
409
|
-
handleChangeEvent(el) {
|
|
410
|
-
super.handleValueChange(el, el.value);
|
|
411
|
-
}
|
|
412
|
-
/** @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 });
|
|
413
|
-
/** @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 });
|
|
414
|
-
}
|
|
415
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RadioValueAccessorBaseDirective, decorators: [{
|
|
416
|
-
type: Directive
|
|
417
|
-
}], ctorParameters: () => [{ type: i0.Injector }, { type: i0.ElementRef }], propDecorators: { handleChangeEvent: [{
|
|
418
|
-
type: HostListener,
|
|
419
|
-
args: ['checkedChange', ['$event.target']]
|
|
420
|
-
}] } });
|
|
421
|
-
|
|
422
|
-
/*
|
|
423
|
-
* SPDX-FileCopyrightText: 2025 Siemens AG
|
|
424
|
-
*
|
|
425
|
-
* SPDX-License-Identifier: MIT
|
|
426
|
-
*
|
|
427
|
-
* This source code is licensed under the MIT license found in the
|
|
428
|
-
* LICENSE file in the root directory of this source tree.
|
|
429
|
-
*/
|
|
430
|
-
class SelectValueAccessorBaseDirective extends ValueAccessor {
|
|
431
|
-
constructor(injector, el) {
|
|
432
|
-
super(injector, el, true);
|
|
433
|
-
}
|
|
434
|
-
handleChangeEvent(el) {
|
|
435
|
-
super.handleValueChange(el, el.value);
|
|
436
|
-
}
|
|
437
|
-
/** @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 });
|
|
438
|
-
/** @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 });
|
|
439
|
-
}
|
|
440
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectValueAccessorBaseDirective, decorators: [{
|
|
441
|
-
type: Directive
|
|
442
|
-
}], ctorParameters: () => [{ type: i0.Injector }, { type: i0.ElementRef }], propDecorators: { handleChangeEvent: [{
|
|
443
|
-
type: HostListener,
|
|
444
|
-
args: ['valueChange', ['$event.target']]
|
|
445
|
-
}] } });
|
|
446
|
-
|
|
447
|
-
/*
|
|
448
|
-
* SPDX-FileCopyrightText: 2025 Siemens AG
|
|
449
|
-
*
|
|
450
|
-
* SPDX-License-Identifier: MIT
|
|
451
|
-
*
|
|
452
|
-
* This source code is licensed under the MIT license found in the
|
|
453
|
-
* LICENSE file in the root directory of this source tree.
|
|
454
|
-
*/
|
|
455
|
-
class TextValueAccessorBaseDirective extends ValueAccessor {
|
|
456
|
-
constructor(injector, el) {
|
|
457
|
-
super(injector, el, true);
|
|
458
|
-
}
|
|
459
|
-
handleInputEvent(el) {
|
|
460
|
-
super.handleValueChange(el, el.value);
|
|
461
|
-
}
|
|
462
|
-
/** @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 });
|
|
463
|
-
/** @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 });
|
|
464
|
-
}
|
|
465
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TextValueAccessorBaseDirective, decorators: [{
|
|
466
|
-
type: Directive
|
|
467
|
-
}], ctorParameters: () => [{ type: i0.Injector }, { type: i0.ElementRef }], propDecorators: { handleInputEvent: [{
|
|
468
|
-
type: HostListener,
|
|
469
|
-
args: ['input', ['$event.target']]
|
|
470
|
-
}, {
|
|
471
|
-
type: HostListener,
|
|
472
|
-
args: ['valueChange', ['$event.target']]
|
|
473
|
-
}] } });
|
|
474
|
-
|
|
475
|
-
/*
|
|
476
|
-
* SPDX-FileCopyrightText: 2025 Siemens AG
|
|
477
|
-
*
|
|
478
|
-
* SPDX-License-Identifier: MIT
|
|
479
|
-
*
|
|
480
|
-
* This source code is licensed under the MIT license found in the
|
|
481
|
-
* LICENSE file in the root directory of this source tree.
|
|
482
|
-
*/
|
|
483
|
-
class DateValueAccessorBaseDirective extends ValueAccessor {
|
|
484
|
-
constructor(injector, el) {
|
|
485
|
-
super(injector, el, true);
|
|
486
|
-
}
|
|
487
|
-
handleInputEvent(el) {
|
|
488
|
-
super.handleValueChange(el, el.value);
|
|
489
|
-
}
|
|
490
|
-
/** @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 });
|
|
491
|
-
/** @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 });
|
|
492
|
-
}
|
|
493
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DateValueAccessorBaseDirective, decorators: [{
|
|
494
|
-
type: Directive
|
|
495
|
-
}], ctorParameters: () => [{ type: i0.Injector }, { type: i0.ElementRef }], propDecorators: { handleInputEvent: [{
|
|
496
|
-
type: HostListener,
|
|
497
|
-
args: ['valueChange', ['$event.target']]
|
|
498
|
-
}] } });
|
|
499
|
-
|
|
500
|
-
/*
|
|
501
|
-
* SPDX-FileCopyrightText: 2025 Siemens AG
|
|
502
|
-
*
|
|
503
|
-
* SPDX-License-Identifier: MIT
|
|
504
|
-
*
|
|
505
|
-
* This source code is licensed under the MIT license found in the
|
|
506
|
-
* LICENSE file in the root directory of this source tree.
|
|
507
|
-
*/
|
|
508
|
-
|
|
509
|
-
/*
|
|
510
|
-
* SPDX-FileCopyrightText: 2024 Siemens AG
|
|
511
|
-
*
|
|
512
|
-
* SPDX-License-Identifier: MIT
|
|
513
|
-
*
|
|
514
|
-
* This source code is licensed under the MIT license found in the
|
|
515
|
-
* LICENSE file in the root directory of this source tree.
|
|
516
|
-
*/
|
|
517
|
-
class DropdownTriggerBaseDirective {
|
|
518
|
-
element;
|
|
519
|
-
ixDropdownTrigger;
|
|
520
|
-
constructor(element) {
|
|
521
|
-
this.element = element;
|
|
522
|
-
}
|
|
523
|
-
ngOnChanges() {
|
|
524
|
-
this.element.nativeElement.trigger = this.ixDropdownTrigger.el;
|
|
525
|
-
}
|
|
526
|
-
/** @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 });
|
|
527
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: DropdownTriggerBaseDirective, inputs: { ixDropdownTrigger: "ixDropdownTrigger" }, usesOnChanges: true, ngImport: i0 });
|
|
528
|
-
}
|
|
529
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DropdownTriggerBaseDirective, decorators: [{
|
|
530
|
-
type: Directive
|
|
531
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { ixDropdownTrigger: [{
|
|
532
|
-
type: Input
|
|
533
|
-
}] } });
|
|
534
|
-
|
|
535
|
-
/*
|
|
536
|
-
* SPDX-FileCopyrightText: 2025 Siemens AG
|
|
537
|
-
*
|
|
538
|
-
* SPDX-License-Identifier: MIT
|
|
539
|
-
*
|
|
540
|
-
* This source code is licensed under the MIT license found in the
|
|
541
|
-
* LICENSE file in the root directory of this source tree.
|
|
542
|
-
*/
|
|
543
|
-
class TreeBaseDirective {
|
|
544
|
-
z;
|
|
545
|
-
renderCache = new Map();
|
|
546
|
-
set renderItem(template) {
|
|
547
|
-
const itemRenderFunction = this.generateItemRenderer(template);
|
|
548
|
-
this.el.renderItem = itemRenderFunction.bind(this);
|
|
549
|
-
}
|
|
550
|
-
el;
|
|
551
|
-
onRemovedSubscription;
|
|
552
|
-
constructor(c, r, z, proxyOutputs) {
|
|
553
|
-
this.z = z;
|
|
554
|
-
c.detach();
|
|
555
|
-
this.el = r.nativeElement;
|
|
556
|
-
proxyOutputs(this, this.el, ['contextChange', 'nodeRemoved']);
|
|
557
|
-
this.onRemovedSubscription = this.nodeRemoved.subscribe((removedEvent) => {
|
|
558
|
-
const { detail } = removedEvent;
|
|
559
|
-
detail.forEach((removedItemElement) => {
|
|
560
|
-
if (this.renderCache.has(removedItemElement)) {
|
|
561
|
-
this.renderCache.get(removedItemElement)?.destroy();
|
|
562
|
-
this.renderCache.delete(removedItemElement);
|
|
563
|
-
}
|
|
564
|
-
});
|
|
565
|
-
});
|
|
566
|
-
}
|
|
567
|
-
ngOnDestroy() {
|
|
568
|
-
this.onRemovedSubscription?.unsubscribe();
|
|
569
|
-
}
|
|
570
|
-
generateItemRenderer(templateRef) {
|
|
571
|
-
return (_, itemData, __, context, update) => {
|
|
572
|
-
const treeItem = document.createElement('ix-tree-item');
|
|
573
|
-
treeItem.hasChildren = itemData.hasChildren;
|
|
574
|
-
treeItem.context = context[itemData.id];
|
|
575
|
-
const embeddedView = templateRef.createEmbeddedView({
|
|
576
|
-
$implicit: itemData.data,
|
|
577
|
-
});
|
|
578
|
-
const container = embeddedView.rootNodes[0];
|
|
579
|
-
embeddedView.detectChanges();
|
|
580
|
-
update((itemData, context) => {
|
|
581
|
-
treeItem.context = context[itemData.id];
|
|
582
|
-
treeItem.hasChildren = itemData.hasChildren;
|
|
583
|
-
embeddedView.context.$implicit = itemData.data;
|
|
584
|
-
embeddedView.detectChanges();
|
|
585
|
-
});
|
|
586
|
-
treeItem.appendChild(container);
|
|
587
|
-
this.renderCache.set(treeItem, embeddedView);
|
|
588
|
-
return treeItem;
|
|
589
|
-
};
|
|
590
|
-
}
|
|
591
|
-
/** @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 });
|
|
592
|
-
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: TreeBaseDirective, inputs: { renderItem: "renderItem" }, ngImport: i0 });
|
|
593
|
-
}
|
|
594
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TreeBaseDirective, decorators: [{
|
|
595
|
-
type: Directive
|
|
596
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
|
|
597
|
-
type: Inject,
|
|
598
|
-
args: ['proxyOutputs']
|
|
599
|
-
}] }], propDecorators: { renderItem: [{
|
|
600
|
-
type: Input
|
|
601
|
-
}] } });
|
|
602
|
-
|
|
603
|
-
/*
|
|
604
|
-
* SPDX-FileCopyrightText: 2025 Siemens AG
|
|
605
|
-
*
|
|
606
|
-
* SPDX-License-Identifier: MIT
|
|
607
|
-
*
|
|
608
|
-
* This source code is licensed under the MIT license found in the
|
|
609
|
-
* LICENSE file in the root directory of this source tree.
|
|
610
|
-
*/
|
|
611
|
-
function createValueAccessorProvider(useExisting) {
|
|
612
|
-
return {
|
|
613
|
-
provide: NG_VALUE_ACCESSOR,
|
|
614
|
-
useExisting,
|
|
615
|
-
multi: true,
|
|
616
|
-
};
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
/*
|
|
620
|
-
* SPDX-FileCopyrightText: 2025 Siemens AG
|
|
621
|
-
*
|
|
622
|
-
* SPDX-License-Identifier: MIT
|
|
623
|
-
*
|
|
624
|
-
* This source code is licensed under the MIT license found in the
|
|
625
|
-
* LICENSE file in the root directory of this source tree.
|
|
626
|
-
*/
|
|
627
|
-
|
|
628
|
-
/**
|
|
629
|
-
* Generated bundle index. Do not edit.
|
|
630
|
-
*/
|
|
631
|
-
|
|
632
|
-
export { BooleanValueAccessorBaseDirective, DateValueAccessorBaseDirective, DropdownTriggerBaseDirective, IxActiveModal, ModalService, RadioValueAccessorBaseDirective, SelectValueAccessorBaseDirective, TextValueAccessorBaseDirective, ToastService, TreeBaseDirective, createValueAccessorProvider };
|
|
633
|
-
//# sourceMappingURL=siemens-ix-angular-common.mjs.map
|