onshore-forms 0.0.7 → 0.0.8
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/esm2020/lib/components/form-autocomplete-item/form-autocomplete-item.component.mjs +11 -0
- package/esm2020/lib/components/form-checkbox-item/form-checkbox-item.component.mjs +62 -0
- package/esm2020/lib/components/form-colorpicker-item/form-colorpicker-item.component.mjs +69 -0
- package/esm2020/lib/components/form-dropdown-item/form-dropdown-item.component.mjs +65 -0
- package/esm2020/lib/components/form-image-item/form-image-item.component.mjs +160 -0
- package/esm2020/lib/components/form-input-item/form-input-item.component.mjs +63 -0
- package/esm2020/lib/components/form-switch-item/form-switch-item.component.mjs +65 -0
- package/esm2020/lib/components/form-textarea-item/form-textarea-item.component.mjs +61 -0
- package/esm2020/lib/components/form-validation-output/form-validation-output.component.mjs +41 -0
- package/esm2020/lib/enums/form.enums.mjs +26 -0
- package/esm2020/lib/models/form.models.mjs +2 -0
- package/esm2020/lib/onshore-forms.component.mjs +22 -0
- package/esm2020/lib/onshore-forms.module.mjs +134 -0
- package/esm2020/lib/onshore-forms.service.mjs +151 -0
- package/esm2020/onshore-forms.mjs +5 -0
- package/esm2020/public-api.mjs +18 -0
- package/fesm2015/onshore-forms.mjs +921 -0
- package/fesm2015/onshore-forms.mjs.map +1 -0
- package/fesm2020/onshore-forms.mjs +877 -0
- package/fesm2020/onshore-forms.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/form-autocomplete-item/form-autocomplete-item.component.d.ts +5 -0
- package/lib/components/form-checkbox-item/form-checkbox-item.component.d.ts +21 -0
- package/lib/components/form-colorpicker-item/form-colorpicker-item.component.d.ts +23 -0
- package/lib/components/form-dropdown-item/form-dropdown-item.component.d.ts +22 -0
- package/lib/components/form-image-item/form-image-item.component.d.ts +40 -0
- package/lib/components/form-input-item/form-input-item.component.d.ts +23 -0
- package/lib/components/form-switch-item/form-switch-item.component.d.ts +21 -0
- package/lib/components/form-textarea-item/form-textarea-item.component.d.ts +22 -0
- package/lib/components/form-validation-output/form-validation-output.component.d.ts +17 -0
- package/lib/enums/form.enums.d.ts +23 -0
- package/lib/models/form.models.d.ts +61 -0
- package/lib/onshore-forms.component.d.ts +8 -0
- package/lib/onshore-forms.module.d.ts +31 -0
- package/lib/onshore-forms.service.d.ts +32 -0
- package/package.json +21 -10
- package/{src/public-api.ts → public-api.d.ts} +0 -4
- package/karma.conf.js +0 -44
- package/ng-package.json +0 -11
- package/src/lib/components/form-autocomplete-item/form-autocomplete-item.component.html +0 -46
- package/src/lib/components/form-autocomplete-item/form-autocomplete-item.component.scss +0 -0
- package/src/lib/components/form-autocomplete-item/form-autocomplete-item.component.ts +0 -133
- package/src/lib/components/form-checkbox-item/form-checkbox-item.component.html +0 -23
- package/src/lib/components/form-checkbox-item/form-checkbox-item.component.scss +0 -0
- package/src/lib/components/form-checkbox-item/form-checkbox-item.component.ts +0 -65
- package/src/lib/components/form-colorpicker-item/form-colorpicker-item.component.html +0 -30
- package/src/lib/components/form-colorpicker-item/form-colorpicker-item.component.scss +0 -0
- package/src/lib/components/form-colorpicker-item/form-colorpicker-item.component.ts +0 -71
- package/src/lib/components/form-dropdown-item/form-dropdown-item.component.html +0 -44
- package/src/lib/components/form-dropdown-item/form-dropdown-item.component.scss +0 -0
- package/src/lib/components/form-dropdown-item/form-dropdown-item.component.ts +0 -68
- package/src/lib/components/form-image-item/form-image-item.component.html +0 -79
- package/src/lib/components/form-image-item/form-image-item.component.scss +0 -3
- package/src/lib/components/form-image-item/form-image-item.component.ts +0 -155
- package/src/lib/components/form-input-item/form-input-item.component.html +0 -81
- package/src/lib/components/form-input-item/form-input-item.component.scss +0 -3
- package/src/lib/components/form-input-item/form-input-item.component.ts +0 -66
- package/src/lib/components/form-switch-item/form-switch-item.component.html +0 -8
- package/src/lib/components/form-switch-item/form-switch-item.component.scss +0 -0
- package/src/lib/components/form-switch-item/form-switch-item.component.ts +0 -72
- package/src/lib/components/form-textarea-item/form-textarea-item.component.html +0 -39
- package/src/lib/components/form-textarea-item/form-textarea-item.component.scss +0 -0
- package/src/lib/components/form-textarea-item/form-textarea-item.component.ts +0 -64
- package/src/lib/components/form-validation-output/form-validation-output.component.html +0 -2
- package/src/lib/components/form-validation-output/form-validation-output.component.scss +0 -1
- package/src/lib/components/form-validation-output/form-validation-output.component.ts +0 -43
- package/src/lib/enums/form.enums.ts +0 -24
- package/src/lib/models/form.models.ts +0 -70
- package/src/lib/onshore-forms.component.ts +0 -20
- package/src/lib/onshore-forms.module.ts +0 -78
- package/src/lib/onshore-forms.service.ts +0 -172
- package/src/test.ts +0 -27
- package/styles/css/main.css +0 -1
- package/styles/css/theme1.css +0 -1
- package/tsconfig.lib.json +0 -24
- package/tsconfig.lib.prod.json +0 -20
- package/tsconfig.spec.json +0 -17
|
@@ -0,0 +1,877 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, Component, ChangeDetectionStrategy, Input, Self, Optional, EventEmitter, Output, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1$1 from '@angular/forms';
|
|
4
|
+
import { FormGroup, FormControl, FormArray, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { Subject, debounceTime, distinctUntilChanged, skip } from 'rxjs';
|
|
6
|
+
import * as i2 from '@angular/common';
|
|
7
|
+
import { CommonModule } from '@angular/common';
|
|
8
|
+
import * as i3 from 'primeng/tooltip';
|
|
9
|
+
import { TooltipModule } from 'primeng/tooltip';
|
|
10
|
+
import * as i4 from 'primeng/inputnumber';
|
|
11
|
+
import { InputNumberModule } from 'primeng/inputnumber';
|
|
12
|
+
import * as i5 from 'primeng/inputtext';
|
|
13
|
+
import { InputTextModule } from 'primeng/inputtext';
|
|
14
|
+
import * as i1 from '@ngx-translate/core';
|
|
15
|
+
import * as i4$1 from 'primeng/inputswitch';
|
|
16
|
+
import { InputSwitchModule } from 'primeng/inputswitch';
|
|
17
|
+
import * as i4$2 from 'primeng/inputtextarea';
|
|
18
|
+
import { InputTextareaModule } from 'primeng/inputtextarea';
|
|
19
|
+
import * as i2$1 from 'primeng/dynamicdialog';
|
|
20
|
+
import * as i5$1 from 'primeng/button';
|
|
21
|
+
import { ButtonModule } from 'primeng/button';
|
|
22
|
+
import * as i6 from 'primeng/ripple';
|
|
23
|
+
import { RippleModule } from 'primeng/ripple';
|
|
24
|
+
import * as i3$1 from 'primeng/dropdown';
|
|
25
|
+
import { DropdownModule } from 'primeng/dropdown';
|
|
26
|
+
import * as i4$3 from 'primeng/multiselect';
|
|
27
|
+
import { MultiSelectModule } from 'primeng/multiselect';
|
|
28
|
+
import * as i3$2 from 'primeng/colorpicker';
|
|
29
|
+
import { ColorPickerModule } from 'primeng/colorpicker';
|
|
30
|
+
import * as i3$3 from 'primeng/checkbox';
|
|
31
|
+
import { CheckboxModule } from 'primeng/checkbox';
|
|
32
|
+
import { AutoCompleteModule } from 'primeng/autocomplete';
|
|
33
|
+
import { DialogModule } from 'primeng/dialog';
|
|
34
|
+
|
|
35
|
+
var OnshoreFormTemplateType;
|
|
36
|
+
(function (OnshoreFormTemplateType) {
|
|
37
|
+
OnshoreFormTemplateType["text"] = "text";
|
|
38
|
+
OnshoreFormTemplateType["textarea"] = "textarea";
|
|
39
|
+
OnshoreFormTemplateType["editor"] = "editor";
|
|
40
|
+
OnshoreFormTemplateType["password"] = "password";
|
|
41
|
+
OnshoreFormTemplateType["number"] = "number";
|
|
42
|
+
OnshoreFormTemplateType["email"] = "email";
|
|
43
|
+
OnshoreFormTemplateType["phone"] = "phone";
|
|
44
|
+
OnshoreFormTemplateType["regexp"] = "regexp";
|
|
45
|
+
OnshoreFormTemplateType["select"] = "select";
|
|
46
|
+
OnshoreFormTemplateType["check"] = "check";
|
|
47
|
+
OnshoreFormTemplateType["radio"] = "radio";
|
|
48
|
+
OnshoreFormTemplateType["image"] = "image";
|
|
49
|
+
OnshoreFormTemplateType["autocomplete"] = "autocomplete";
|
|
50
|
+
OnshoreFormTemplateType["color"] = "color";
|
|
51
|
+
OnshoreFormTemplateType["subform"] = "subform";
|
|
52
|
+
})(OnshoreFormTemplateType || (OnshoreFormTemplateType = {}));
|
|
53
|
+
var OnshoreImageError;
|
|
54
|
+
(function (OnshoreImageError) {
|
|
55
|
+
OnshoreImageError["none"] = "";
|
|
56
|
+
OnshoreImageError["fileType"] = "fileType";
|
|
57
|
+
OnshoreImageError["ratio"] = "ratio";
|
|
58
|
+
OnshoreImageError["size"] = "size";
|
|
59
|
+
})(OnshoreImageError || (OnshoreImageError = {}));
|
|
60
|
+
|
|
61
|
+
class OnshoreFormsService {
|
|
62
|
+
constructor() {
|
|
63
|
+
this._formValidations = [];
|
|
64
|
+
this.subscriptions = [];
|
|
65
|
+
this.isLoading$ = new Subject();
|
|
66
|
+
this._form = new FormGroup({}, { updateOn: 'change' });
|
|
67
|
+
this._formTemplate = [];
|
|
68
|
+
}
|
|
69
|
+
get form() {
|
|
70
|
+
return this._form;
|
|
71
|
+
}
|
|
72
|
+
get formValues() {
|
|
73
|
+
return this._form?.value;
|
|
74
|
+
}
|
|
75
|
+
patchForm(value) {
|
|
76
|
+
this._form?.patchValue(value);
|
|
77
|
+
}
|
|
78
|
+
resetForm() {
|
|
79
|
+
this._form?.reset();
|
|
80
|
+
this._form?.updateValueAndValidity({ onlySelf: false, emitEvent: true });
|
|
81
|
+
this.subscriptions.forEach((subscription) => {
|
|
82
|
+
subscription.unsubscribe();
|
|
83
|
+
});
|
|
84
|
+
this._form = null;
|
|
85
|
+
this._formTemplate = null;
|
|
86
|
+
}
|
|
87
|
+
generateForm(formTemplate) {
|
|
88
|
+
this._formTemplate = formTemplate;
|
|
89
|
+
this._form = new FormGroup({}, { updateOn: 'change' });
|
|
90
|
+
this._form = this.iterateNestedForm(this._form, formTemplate);
|
|
91
|
+
return this._form;
|
|
92
|
+
}
|
|
93
|
+
formTemplate(name, formTemplate = this._formTemplate) {
|
|
94
|
+
let template;
|
|
95
|
+
if (formTemplate) {
|
|
96
|
+
for (let i = 0; i < formTemplate?.length; i++) {
|
|
97
|
+
const item = formTemplate[i];
|
|
98
|
+
if (item.name === name) {
|
|
99
|
+
template = item;
|
|
100
|
+
i = formTemplate.length;
|
|
101
|
+
}
|
|
102
|
+
else if (item.subformArray) {
|
|
103
|
+
const arrayTemplate = this.formTemplate(name, item.subformArray);
|
|
104
|
+
if (arrayTemplate)
|
|
105
|
+
template = arrayTemplate;
|
|
106
|
+
}
|
|
107
|
+
else if (item.subformObject) {
|
|
108
|
+
const objectTemplate = this.formTemplate(name, item.subformObject);
|
|
109
|
+
if (objectTemplate)
|
|
110
|
+
template = objectTemplate;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return template;
|
|
115
|
+
}
|
|
116
|
+
formControl(name, formGroup = this._form) {
|
|
117
|
+
return formGroup?.get(name);
|
|
118
|
+
}
|
|
119
|
+
formArray(name) {
|
|
120
|
+
return this._form?.get(name);
|
|
121
|
+
}
|
|
122
|
+
formGroup(form, name) {
|
|
123
|
+
return form.get(name);
|
|
124
|
+
}
|
|
125
|
+
addFormArrayItem(name, item) {
|
|
126
|
+
let formControls = {};
|
|
127
|
+
if (item) {
|
|
128
|
+
item.subformArray?.forEach((subitem) => {
|
|
129
|
+
formControls[subitem.name] = new FormControl(subitem.default !== undefined ? subitem.default : '', {
|
|
130
|
+
validators: subitem.validators || [],
|
|
131
|
+
updateOn: 'change'
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
const formGroup = new FormGroup(formControls);
|
|
136
|
+
formGroup.setParent(this.formArray(name));
|
|
137
|
+
this.formArray(name).push(formGroup);
|
|
138
|
+
this.subscribeNestedFormGroup(formGroup);
|
|
139
|
+
}
|
|
140
|
+
removeFormArrayItem(form, index) {
|
|
141
|
+
form.removeAt(index);
|
|
142
|
+
}
|
|
143
|
+
setFormValidations(validations = []) {
|
|
144
|
+
this._formValidations = validations;
|
|
145
|
+
}
|
|
146
|
+
enable() {
|
|
147
|
+
setTimeout(() => {
|
|
148
|
+
this._form?.enable({ onlySelf: true, emitEvent: false });
|
|
149
|
+
}, 100);
|
|
150
|
+
}
|
|
151
|
+
disable() {
|
|
152
|
+
setTimeout(() => {
|
|
153
|
+
this._form?.disable({ onlySelf: true, emitEvent: false });
|
|
154
|
+
}, 100);
|
|
155
|
+
}
|
|
156
|
+
setError(control, error) {
|
|
157
|
+
this.formControl(control).setErrors(error);
|
|
158
|
+
}
|
|
159
|
+
setLoader(loaders$) {
|
|
160
|
+
loaders$.forEach($loader => {
|
|
161
|
+
this.subscriptions.push($loader.subscribe(isLoading => {
|
|
162
|
+
isLoading ? this.disable() : this.enable();
|
|
163
|
+
this.isLoading$.next(isLoading);
|
|
164
|
+
}));
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
iterateNestedForm(form, formTemplate) {
|
|
168
|
+
formTemplate.forEach((item) => {
|
|
169
|
+
if (item.type === OnshoreFormTemplateType.subform) {
|
|
170
|
+
if (item.subformArray) {
|
|
171
|
+
form.controls[item.name] = new FormArray([]);
|
|
172
|
+
form.controls[item.name].setParent(form);
|
|
173
|
+
}
|
|
174
|
+
if (item.subformObject) {
|
|
175
|
+
form.controls[item.name] = new FormGroup({});
|
|
176
|
+
form.controls[item.name] = this.iterateNestedForm(form.controls[item.name], item.subformObject);
|
|
177
|
+
this.subscribeNestedFormGroup(form.controls[item.name]);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
form.addControl(item.name, new FormControl(item.default !== undefined ? item.default : '', {
|
|
182
|
+
validators: item.validators || [],
|
|
183
|
+
updateOn: 'change'
|
|
184
|
+
}));
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
return form;
|
|
188
|
+
}
|
|
189
|
+
subscribeNestedFormGroup(nestedFormItem) {
|
|
190
|
+
this.subscriptions.push(nestedFormItem.valueChanges.subscribe(() => {
|
|
191
|
+
this.form?.updateValueAndValidity({ onlySelf: true, emitEvent: false });
|
|
192
|
+
}));
|
|
193
|
+
this.subscriptions.push(nestedFormItem.statusChanges.subscribe(() => {
|
|
194
|
+
this.form?.updateValueAndValidity({ onlySelf: true, emitEvent: false });
|
|
195
|
+
}));
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
OnshoreFormsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
199
|
+
OnshoreFormsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormsService, providedIn: 'root' });
|
|
200
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormsService, decorators: [{
|
|
201
|
+
type: Injectable,
|
|
202
|
+
args: [{
|
|
203
|
+
providedIn: 'root'
|
|
204
|
+
}]
|
|
205
|
+
}], ctorParameters: function () { return []; } });
|
|
206
|
+
|
|
207
|
+
class OnshoreFormsComponent {
|
|
208
|
+
constructor() { }
|
|
209
|
+
ngOnInit() {
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
OnshoreFormsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
213
|
+
OnshoreFormsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormsComponent, selector: "lib-onshore-forms", ngImport: i0, template: `
|
|
214
|
+
<p>
|
|
215
|
+
onshore-forms works 2!
|
|
216
|
+
</p>
|
|
217
|
+
`, isInline: true });
|
|
218
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormsComponent, decorators: [{
|
|
219
|
+
type: Component,
|
|
220
|
+
args: [{ selector: 'lib-onshore-forms', template: `
|
|
221
|
+
<p>
|
|
222
|
+
onshore-forms works 2!
|
|
223
|
+
</p>
|
|
224
|
+
` }]
|
|
225
|
+
}], ctorParameters: function () { return []; } });
|
|
226
|
+
|
|
227
|
+
class OnshoreFormValidationOutputComponent {
|
|
228
|
+
constructor(cdr, translate) {
|
|
229
|
+
this.cdr = cdr;
|
|
230
|
+
this.translate = translate;
|
|
231
|
+
this.externValidationPattern = "";
|
|
232
|
+
this.validationTranslation = '';
|
|
233
|
+
}
|
|
234
|
+
ngOnChanges(changes) {
|
|
235
|
+
this.validationTranslation = '';
|
|
236
|
+
if (changes['validationErrors'].currentValue) {
|
|
237
|
+
Object.keys(this.validationErrors).forEach(error => {
|
|
238
|
+
const exists = Object.values(this.validationItems).filter(validationItem => validationItem.key == error);
|
|
239
|
+
if (exists && exists.length > 0) {
|
|
240
|
+
this.validationTranslation += this.translate.instant('request.error.' + error) + '<br>';
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
const errorValues = this.validationErrors[error];
|
|
244
|
+
this.validationTranslation += this.translate.instant('form.validation.' + error, errorValues) + '<br>';
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
this.cdr.markForCheck();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
OnshoreFormValidationOutputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormValidationOutputComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
252
|
+
OnshoreFormValidationOutputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormValidationOutputComponent, selector: "onshore-form-validation-output", inputs: { validationErrors: "validationErrors", externValidationPattern: "externValidationPattern", validationItems: "validationItems" }, usesOnChanges: true, ngImport: i0, template: "<small *ngIf=\"validationErrors && validationErrors['pattern']\" [innerHTML]=\"externValidationPattern\"></small>\n<small *ngIf=\"validationTranslation\" [innerHTML]=\"validationTranslation\"></small>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
253
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormValidationOutputComponent, decorators: [{
|
|
254
|
+
type: Component,
|
|
255
|
+
args: [{ selector: 'onshore-form-validation-output', changeDetection: ChangeDetectionStrategy.OnPush, template: "<small *ngIf=\"validationErrors && validationErrors['pattern']\" [innerHTML]=\"externValidationPattern\"></small>\n<small *ngIf=\"validationTranslation\" [innerHTML]=\"validationTranslation\"></small>\n" }]
|
|
256
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.TranslateService }]; }, propDecorators: { validationErrors: [{
|
|
257
|
+
type: Input
|
|
258
|
+
}], externValidationPattern: [{
|
|
259
|
+
type: Input
|
|
260
|
+
}], validationItems: [{
|
|
261
|
+
type: Input
|
|
262
|
+
}] } });
|
|
263
|
+
|
|
264
|
+
class OnshoreFormInputItemComponent {
|
|
265
|
+
constructor(ngControl, cdr) {
|
|
266
|
+
this.ngControl = ngControl;
|
|
267
|
+
this.cdr = cdr;
|
|
268
|
+
this.FormTemplateItemType = OnshoreFormTemplateType;
|
|
269
|
+
this.passwordVisible = false;
|
|
270
|
+
this.disabled = false;
|
|
271
|
+
this.ngControl.valueAccessor = this;
|
|
272
|
+
}
|
|
273
|
+
// ControlValueAccessor interface
|
|
274
|
+
writeValue(obj) { }
|
|
275
|
+
registerOnChange(fn) { }
|
|
276
|
+
registerOnTouched(fn) { }
|
|
277
|
+
setDisabledState(isDisabled) {
|
|
278
|
+
this.disabled = isDisabled;
|
|
279
|
+
}
|
|
280
|
+
ngOnInit() {
|
|
281
|
+
this.ngControl.control?.valueChanges.subscribe(() => {
|
|
282
|
+
this.cdr.markForCheck();
|
|
283
|
+
});
|
|
284
|
+
this.ngControl.control?.statusChanges.subscribe(() => {
|
|
285
|
+
this.cdr.markForCheck();
|
|
286
|
+
});
|
|
287
|
+
if (this.ngControl.control?.value == '' && this.formTemplate.default != undefined) {
|
|
288
|
+
this.ngControl.control?.setValue(this.formTemplate.default);
|
|
289
|
+
this.cdr.markForCheck();
|
|
290
|
+
}
|
|
291
|
+
if (this.formTemplate.enabled) {
|
|
292
|
+
this.ngControl.control?.enable();
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
this.ngControl.control?.disable();
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
ngOnChanges(changes) {
|
|
299
|
+
this.cdr.markForCheck();
|
|
300
|
+
}
|
|
301
|
+
ngOnDestroy() {
|
|
302
|
+
this.ngControl.control?.disable();
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
OnshoreFormInputItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormInputItemComponent, deps: [{ token: i1$1.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
306
|
+
OnshoreFormInputItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormInputItemComponent, selector: "onshore-form-input-item", inputs: { formTemplate: "formTemplate" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"flex flex-column mb-3\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <span class=\"p-inputgroup w-100\">\n\n <container-element [ngSwitch]=\"formTemplate.type\" class=\"w-100\" style=\"width: 100%\">\n\n <input *ngSwitchDefault\n class=\"w-100\"\n type=\"text\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n pInputText\n [formControl]=\"ngControl.control\"\n [class.p-invalid]=\"ngControl.control.touched && ngControl.control.invalid\"\n [autocomplete]=\"'prevent-template-' + formTemplate.name\"/>\n\n <input *ngSwitchCase=\"'password'\"\n class=\"w-100\"\n [type]=\"passwordVisible ? 'text' : formTemplate.type\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n pInputText\n [formControl]=\"ngControl.control\"\n [class.p-invalid]=\"ngControl.control.touched && ngControl.control.invalid\"\n [autocomplete]=\"'prevent-template-' + formTemplate.name\"/>\n\n <p-inputNumber *ngSwitchCase=\"'number'\"\n class=\"w-100\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? 0\"\n [formControl]=\"ngControl.control\"\n [class.p-invalid]=\"ngControl.control.touched && ngControl.control.invalid\"\n [autocomplete]=\"'prevent-template-' + formTemplate.name\"\n [step]=\"formTemplate.settings?.step ?? 1\"\n [min]=\"formTemplate.settings?.min ?? null\"\n [max]=\"formTemplate.settings?.max ?? null\">\n </p-inputNumber>\n <!--\n [showButtons]=\"true\"\n buttonLayout=\"horizontal\"\n spinnerMode=\"horizontal\"\n decrementButtonClass=\"p-button-outlined text-black-50\"\n incrementButtonClass=\"p-button-outlined text-black-50\"\n -->\n </container-element>\n\n <span class=\"p-inputgroup-addon\">\n <i *ngIf=\"formTemplate.type != FormTemplateItemType.password\" class=\"fa\"\n [class.tl-color-black]=\"ngControl.control.untouched\"\n [class.fa-check]=\"formTemplate.required && ngControl.control.valid\"\n [class.tl-color-primary1]=\"ngControl.control.touched && ngControl.control.valid\"\n [class.fa-exclamation-triangle]=\"ngControl.control.touched && ngControl.control.invalid\"\n [class.tl-color-danger]=\"ngControl.control.touched && ngControl.control.invalid\"\n ></i>\n <i *ngIf=\"formTemplate.type == FormTemplateItemType.password\" class=\"fa tl-color-black\"\n [class.fa-eye-slash]=\"passwordVisible\"\n [class.fa-eye]=\"!passwordVisible\"\n (click)=\"passwordVisible = !passwordVisible\"\n ></i>\n </span>\n\n </span>\n\n <small *ngIf=\"formTemplate.description\"><i class=\"fa fa-info-circle\"></i> {{formTemplate.description}}</small>\n\n <div *ngIf=\"ngControl.control.touched\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n", styles: [".p-inputtext{border-color:var(--color-primary)!important}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: i4.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "directive", type: i5.InputText, selector: "[pInputText]" }, { kind: "component", type: OnshoreFormValidationOutputComponent, selector: "onshore-form-validation-output", inputs: ["validationErrors", "externValidationPattern", "validationItems"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
307
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormInputItemComponent, decorators: [{
|
|
308
|
+
type: Component,
|
|
309
|
+
args: [{ selector: 'onshore-form-input-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-column mb-3\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <span class=\"p-inputgroup w-100\">\n\n <container-element [ngSwitch]=\"formTemplate.type\" class=\"w-100\" style=\"width: 100%\">\n\n <input *ngSwitchDefault\n class=\"w-100\"\n type=\"text\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n pInputText\n [formControl]=\"ngControl.control\"\n [class.p-invalid]=\"ngControl.control.touched && ngControl.control.invalid\"\n [autocomplete]=\"'prevent-template-' + formTemplate.name\"/>\n\n <input *ngSwitchCase=\"'password'\"\n class=\"w-100\"\n [type]=\"passwordVisible ? 'text' : formTemplate.type\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n pInputText\n [formControl]=\"ngControl.control\"\n [class.p-invalid]=\"ngControl.control.touched && ngControl.control.invalid\"\n [autocomplete]=\"'prevent-template-' + formTemplate.name\"/>\n\n <p-inputNumber *ngSwitchCase=\"'number'\"\n class=\"w-100\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? 0\"\n [formControl]=\"ngControl.control\"\n [class.p-invalid]=\"ngControl.control.touched && ngControl.control.invalid\"\n [autocomplete]=\"'prevent-template-' + formTemplate.name\"\n [step]=\"formTemplate.settings?.step ?? 1\"\n [min]=\"formTemplate.settings?.min ?? null\"\n [max]=\"formTemplate.settings?.max ?? null\">\n </p-inputNumber>\n <!--\n [showButtons]=\"true\"\n buttonLayout=\"horizontal\"\n spinnerMode=\"horizontal\"\n decrementButtonClass=\"p-button-outlined text-black-50\"\n incrementButtonClass=\"p-button-outlined text-black-50\"\n -->\n </container-element>\n\n <span class=\"p-inputgroup-addon\">\n <i *ngIf=\"formTemplate.type != FormTemplateItemType.password\" class=\"fa\"\n [class.tl-color-black]=\"ngControl.control.untouched\"\n [class.fa-check]=\"formTemplate.required && ngControl.control.valid\"\n [class.tl-color-primary1]=\"ngControl.control.touched && ngControl.control.valid\"\n [class.fa-exclamation-triangle]=\"ngControl.control.touched && ngControl.control.invalid\"\n [class.tl-color-danger]=\"ngControl.control.touched && ngControl.control.invalid\"\n ></i>\n <i *ngIf=\"formTemplate.type == FormTemplateItemType.password\" class=\"fa tl-color-black\"\n [class.fa-eye-slash]=\"passwordVisible\"\n [class.fa-eye]=\"!passwordVisible\"\n (click)=\"passwordVisible = !passwordVisible\"\n ></i>\n </span>\n\n </span>\n\n <small *ngIf=\"formTemplate.description\"><i class=\"fa fa-info-circle\"></i> {{formTemplate.description}}</small>\n\n <div *ngIf=\"ngControl.control.touched\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n", styles: [".p-inputtext{border-color:var(--color-primary)!important}\n"] }]
|
|
310
|
+
}], ctorParameters: function () { return [{ type: i1$1.NgControl, decorators: [{
|
|
311
|
+
type: Self
|
|
312
|
+
}, {
|
|
313
|
+
type: Optional
|
|
314
|
+
}] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { formTemplate: [{
|
|
315
|
+
type: Input
|
|
316
|
+
}] } });
|
|
317
|
+
|
|
318
|
+
class OnshoreFormSwitchItemComponent {
|
|
319
|
+
constructor(ngControl, cdr) {
|
|
320
|
+
this.ngControl = ngControl;
|
|
321
|
+
this.cdr = cdr;
|
|
322
|
+
this.valueChange = new EventEmitter();
|
|
323
|
+
this.disabled = false;
|
|
324
|
+
this.ngControl.valueAccessor = this;
|
|
325
|
+
}
|
|
326
|
+
// ControlValueAccessor interface
|
|
327
|
+
writeValue(obj) { }
|
|
328
|
+
registerOnChange(fn) { }
|
|
329
|
+
registerOnTouched(fn) { }
|
|
330
|
+
setDisabledState(isDisabled) {
|
|
331
|
+
this.disabled = isDisabled;
|
|
332
|
+
}
|
|
333
|
+
ngOnInit() {
|
|
334
|
+
this.ngControl.control?.valueChanges.pipe(debounceTime(100), distinctUntilChanged(), skip(1)).subscribe(newValue => {
|
|
335
|
+
this.valueChange.emit(this.ngControl.control?.value);
|
|
336
|
+
});
|
|
337
|
+
this.ngControl.control?.valueChanges.subscribe(() => {
|
|
338
|
+
this.cdr.markForCheck();
|
|
339
|
+
});
|
|
340
|
+
this.ngControl.control?.statusChanges.subscribe(() => {
|
|
341
|
+
this.cdr.markForCheck();
|
|
342
|
+
});
|
|
343
|
+
if (this.ngControl.control?.value == undefined && this.formTemplate.default != undefined) {
|
|
344
|
+
this.ngControl.control?.setValue(this.formTemplate.default);
|
|
345
|
+
this.cdr.markForCheck();
|
|
346
|
+
}
|
|
347
|
+
if (this.formTemplate.enabled) {
|
|
348
|
+
this.ngControl.control?.enable();
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
this.ngControl.control?.disable();
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
ngOnChanges(changes) {
|
|
355
|
+
this.cdr.markForCheck();
|
|
356
|
+
}
|
|
357
|
+
ngOnDestroy() {
|
|
358
|
+
this.ngControl.control?.disable();
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
OnshoreFormSwitchItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormSwitchItemComponent, deps: [{ token: i1$1.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
362
|
+
OnshoreFormSwitchItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormSwitchItemComponent, selector: "onshore-form-switch-item", inputs: { formTemplate: "formTemplate" }, outputs: { valueChange: "valueChange" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"flex flex-column pt-1\">\n <div class=\"flex justify-content-between align-items-center\">\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <p-inputSwitch [name]=\"formTemplate.name\" [formControl]=\"ngControl.control\" [inputId]=\"formTemplate.name\"></p-inputSwitch>\n\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: i4$1.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabel", "ariaLabelledBy"], outputs: ["onChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
363
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormSwitchItemComponent, decorators: [{
|
|
364
|
+
type: Component,
|
|
365
|
+
args: [{ selector: 'onshore-form-switch-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-column pt-1\">\n <div class=\"flex justify-content-between align-items-center\">\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <p-inputSwitch [name]=\"formTemplate.name\" [formControl]=\"ngControl.control\" [inputId]=\"formTemplate.name\"></p-inputSwitch>\n\n</div>\n" }]
|
|
366
|
+
}], ctorParameters: function () { return [{ type: i1$1.NgControl, decorators: [{
|
|
367
|
+
type: Self
|
|
368
|
+
}, {
|
|
369
|
+
type: Optional
|
|
370
|
+
}] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { formTemplate: [{
|
|
371
|
+
type: Input
|
|
372
|
+
}], valueChange: [{
|
|
373
|
+
type: Output
|
|
374
|
+
}] } });
|
|
375
|
+
|
|
376
|
+
class OnshoreFormTextareaItemComponent {
|
|
377
|
+
constructor(ngControl, cdr) {
|
|
378
|
+
this.ngControl = ngControl;
|
|
379
|
+
this.cdr = cdr;
|
|
380
|
+
this.FormTemplateItemType = OnshoreFormTemplateType;
|
|
381
|
+
this.disabled = false;
|
|
382
|
+
this.ngControl.valueAccessor = this;
|
|
383
|
+
}
|
|
384
|
+
// ControlValueAccessor interface
|
|
385
|
+
writeValue(obj) { }
|
|
386
|
+
registerOnChange(fn) { }
|
|
387
|
+
registerOnTouched(fn) { }
|
|
388
|
+
setDisabledState(isDisabled) {
|
|
389
|
+
this.disabled = isDisabled;
|
|
390
|
+
}
|
|
391
|
+
ngOnInit() {
|
|
392
|
+
this.ngControl.control?.valueChanges.subscribe(() => {
|
|
393
|
+
this.cdr.markForCheck();
|
|
394
|
+
});
|
|
395
|
+
this.ngControl.control?.statusChanges.subscribe(() => {
|
|
396
|
+
this.cdr.markForCheck();
|
|
397
|
+
});
|
|
398
|
+
if (this.ngControl.control?.value == '' && this.formTemplate.default != undefined) {
|
|
399
|
+
this.ngControl.control?.setValue(this.formTemplate.default);
|
|
400
|
+
this.cdr.markForCheck();
|
|
401
|
+
}
|
|
402
|
+
if (this.formTemplate.enabled) {
|
|
403
|
+
this.ngControl.control?.enable();
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
this.ngControl.control?.disable();
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
ngOnDestroy() {
|
|
410
|
+
this.ngControl.control?.disable();
|
|
411
|
+
}
|
|
412
|
+
ngOnChanges(changes) {
|
|
413
|
+
this.cdr.markForCheck();
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
OnshoreFormTextareaItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormTextareaItemComponent, deps: [{ token: i1$1.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
417
|
+
OnshoreFormTextareaItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormTextareaItemComponent, selector: "onshore-form-textarea-item", inputs: { formTemplate: "formTemplate" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"flex flex-column mb-3\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <span class=\"p-input-icon-right\">\n <i class=\"fa\"\n [class.tl-color-black]=\"ngControl.control?.untouched\"\n [class.fa-check]=\"ngControl.control?.touched && ngControl.control?.valid\"\n [class.text-primary]=\"ngControl.control?.touched && ngControl.control?.valid\"\n [class.fa-exclamation-triangle]=\"ngControl.control?.touched && ngControl.control?.invalid\"\n [class.tl-color-danger]=\"ngControl.control?.touched && ngControl.control?.invalid\"\n ></i>\n <textarea class=\"w-100\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.label\"\n [rows]=\"3\"\n [cols]=\"30\"\n pInputTextarea\n [autoResize]=\"true\"\n [formControl]=\"ngControl.control\"\n [class.p-invalid]=\"ngControl.control?.touched && ngControl.control?.invalid\"></textarea>\n </span>\n\n <small *ngIf=\"formTemplate.description\"><i class=\"fa fa-info-circle\"></i> {{formTemplate.description}}</small>\n\n <div *ngIf=\"ngControl.control?.touched\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control?.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "directive", type: i4$2.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { kind: "component", type: OnshoreFormValidationOutputComponent, selector: "onshore-form-validation-output", inputs: ["validationErrors", "externValidationPattern", "validationItems"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
418
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormTextareaItemComponent, decorators: [{
|
|
419
|
+
type: Component,
|
|
420
|
+
args: [{ selector: 'onshore-form-textarea-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-column mb-3\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <span class=\"p-input-icon-right\">\n <i class=\"fa\"\n [class.tl-color-black]=\"ngControl.control?.untouched\"\n [class.fa-check]=\"ngControl.control?.touched && ngControl.control?.valid\"\n [class.text-primary]=\"ngControl.control?.touched && ngControl.control?.valid\"\n [class.fa-exclamation-triangle]=\"ngControl.control?.touched && ngControl.control?.invalid\"\n [class.tl-color-danger]=\"ngControl.control?.touched && ngControl.control?.invalid\"\n ></i>\n <textarea class=\"w-100\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.label\"\n [rows]=\"3\"\n [cols]=\"30\"\n pInputTextarea\n [autoResize]=\"true\"\n [formControl]=\"ngControl.control\"\n [class.p-invalid]=\"ngControl.control?.touched && ngControl.control?.invalid\"></textarea>\n </span>\n\n <small *ngIf=\"formTemplate.description\"><i class=\"fa fa-info-circle\"></i> {{formTemplate.description}}</small>\n\n <div *ngIf=\"ngControl.control?.touched\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control?.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n" }]
|
|
421
|
+
}], ctorParameters: function () { return [{ type: i1$1.NgControl, decorators: [{
|
|
422
|
+
type: Self
|
|
423
|
+
}, {
|
|
424
|
+
type: Optional
|
|
425
|
+
}] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { formTemplate: [{
|
|
426
|
+
type: Input
|
|
427
|
+
}] } });
|
|
428
|
+
|
|
429
|
+
class OnshoreFormImageItemComponent {
|
|
430
|
+
constructor(cdr, ngControl, dialogService, translate) {
|
|
431
|
+
this.cdr = cdr;
|
|
432
|
+
this.ngControl = ngControl;
|
|
433
|
+
this.dialogService = dialogService;
|
|
434
|
+
this.translate = translate;
|
|
435
|
+
this.inverseColor = false;
|
|
436
|
+
// Image updload params
|
|
437
|
+
this.imageWidth = 400;
|
|
438
|
+
this.imageHeight = 400;
|
|
439
|
+
this.containWithinAspectRatio = false;
|
|
440
|
+
this.aspectRatio = 1 / 1;
|
|
441
|
+
this.imageDeleted = new EventEmitter();
|
|
442
|
+
this.imageCleared = new EventEmitter();
|
|
443
|
+
this.imageSelectedFromMedia = new EventEmitter();
|
|
444
|
+
this.image = '';
|
|
445
|
+
this.disabled = false;
|
|
446
|
+
this.webcamDialogVisible = false;
|
|
447
|
+
this.imageChooserDialogVisible = false;
|
|
448
|
+
this.subscriptions = [];
|
|
449
|
+
this.ngControl.valueAccessor = this;
|
|
450
|
+
}
|
|
451
|
+
getFileImage(image) {
|
|
452
|
+
this.imageChooserDialogVisible = false;
|
|
453
|
+
if (image) {
|
|
454
|
+
this.image = image;
|
|
455
|
+
setTimeout(() => {
|
|
456
|
+
this.cdr.markForCheck();
|
|
457
|
+
this.ngControl?.control?.setValue(this.image);
|
|
458
|
+
this.ngControl?.control?.markAsDirty();
|
|
459
|
+
}, 500);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
getWebcamImage(image) {
|
|
463
|
+
this.webcamDialogVisible = false;
|
|
464
|
+
if (image) {
|
|
465
|
+
this.image = image;
|
|
466
|
+
setTimeout(() => {
|
|
467
|
+
this.cdr.markForCheck();
|
|
468
|
+
this.ngControl?.control?.setValue(this.image);
|
|
469
|
+
this.ngControl?.control?.markAsDirty();
|
|
470
|
+
}, 500);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
/*searchMedia() {
|
|
474
|
+
this.dialogService.open(SearchMediaComponent,{
|
|
475
|
+
styleClass: 'p-dialog-background-white',
|
|
476
|
+
modal: true,
|
|
477
|
+
header: this.translate.instant('search.media.dialogTitle'),
|
|
478
|
+
data: { targetType: this.formSettings.mediaType }
|
|
479
|
+
}).onClose.subscribe((result) => {
|
|
480
|
+
if(result) {
|
|
481
|
+
this.image = result.url;
|
|
482
|
+
setTimeout(() => {
|
|
483
|
+
this.cdr.markForCheck();
|
|
484
|
+
this.ngControl?.control?.setValue(this.image);
|
|
485
|
+
this.ngControl?.control?.markAsDirty();
|
|
486
|
+
this.imageSelectedFromMedia.next(result);
|
|
487
|
+
}, 500);
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
}*/
|
|
491
|
+
removeImage() {
|
|
492
|
+
if (this.image && !this.image.includes('base64')) {
|
|
493
|
+
this.imageDeleted.emit(this.image);
|
|
494
|
+
}
|
|
495
|
+
else {
|
|
496
|
+
this.imageCleared.emit();
|
|
497
|
+
}
|
|
498
|
+
this.ngControl?.control?.setValue(null);
|
|
499
|
+
this.ngControl?.control?.markAsDirty();
|
|
500
|
+
this.image = '';
|
|
501
|
+
}
|
|
502
|
+
writeValue(obj) {
|
|
503
|
+
if (obj && !obj.includes('base64')) {
|
|
504
|
+
this.image = obj;
|
|
505
|
+
}
|
|
506
|
+
if (obj == null) {
|
|
507
|
+
this.image = '';
|
|
508
|
+
}
|
|
509
|
+
this.cdr.markForCheck();
|
|
510
|
+
}
|
|
511
|
+
registerOnChange(fn) {
|
|
512
|
+
if (this.ngControl.value) {
|
|
513
|
+
this.image = this.ngControl.value;
|
|
514
|
+
this.cdr.markForCheck();
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
registerOnTouched(fn) { }
|
|
518
|
+
setDisabledState(isDisabled) {
|
|
519
|
+
this.disabled = isDisabled;
|
|
520
|
+
this.cdr.markForCheck();
|
|
521
|
+
}
|
|
522
|
+
ngOnInit() {
|
|
523
|
+
this.ngControl.control.valueChanges.subscribe((value) => {
|
|
524
|
+
this.cdr.markForCheck();
|
|
525
|
+
});
|
|
526
|
+
this.ngControl.control.statusChanges.subscribe((status) => {
|
|
527
|
+
this.cdr.markForCheck();
|
|
528
|
+
});
|
|
529
|
+
if (this.ngControl.control.value == '' && this.formTemplate.default != undefined) {
|
|
530
|
+
this.ngControl.control.setValue(this.formTemplate.default);
|
|
531
|
+
this.cdr.markForCheck();
|
|
532
|
+
}
|
|
533
|
+
if (this.formTemplate.enabled) {
|
|
534
|
+
this.ngControl.control.enable();
|
|
535
|
+
}
|
|
536
|
+
else {
|
|
537
|
+
this.ngControl.control.disable();
|
|
538
|
+
}
|
|
539
|
+
if (this.formTemplate.settings) {
|
|
540
|
+
this.formSettings = this.formTemplate.settings;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
ngOnDestroy() {
|
|
544
|
+
this.subscriptions.forEach((subscription) => {
|
|
545
|
+
subscription.unsubscribe();
|
|
546
|
+
});
|
|
547
|
+
this.ngControl.control.disable();
|
|
548
|
+
this.image = null;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
OnshoreFormImageItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormImageItemComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$1.NgControl, optional: true, self: true }, { token: i2$1.DialogService }, { token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
552
|
+
OnshoreFormImageItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormImageItemComponent, selector: "onshore-form-image-item", inputs: { formTemplate: "formTemplate", inverseColor: "inverseColor", imageWidth: "imageWidth", imageHeight: "imageHeight", containWithinAspectRatio: "containWithinAspectRatio", aspectRatio: "aspectRatio" }, outputs: { imageDeleted: "imageDeleted", imageCleared: "imageCleared", imageSelectedFromMedia: "imageSelectedFromMedia" }, ngImport: i0, template: "<div class=\"flex flex-column mb-3\" style=\"max-width: 500px\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <div class=\"w-100\">\n\n <div class=\"position-relative flex justify-content-center align-items-center\" style=\"background-color: white\">\n <!--<app-image-placeholder class=\"w-100\" [image]=\"image\" imageStyle=\"position: absolut; height: 250px; width: 250px\" [placeholder]=\"formSettings?.imagePlaceholder ? formSettings?.imagePlaceholder + ' fa-10x' : 'fa-image fa-10x'\" placeholderStyle=\"width: 250px; height: 250px\"></app-image-placeholder>-->\n </div>\n\n <div class=\"flex flex-column mt-4 w-100\">\n <button pButton pRipple type=\"button\"\n [hidden]=\"formSettings?.disableImageSelection\"\n icon=\"fa fa-image\"\n label=\"Bild hochladen\"\n class=\"p-button-rounded p-button-outlined text-secondary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"imageChooserDialogVisible = true\">\n </button>\n\n <button pButton pRipple type=\"button\"\n [hidden]=\"formSettings?.disableWebcamSelection\"\n icon=\"fa fa-camera\"\n label=\"Foto aufnehmen\"\n class=\"p-button-rounded p-button-outlined text-secondary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"webcamDialogVisible = true\">\n </button>\n\n <!--<button pButton pRipple type=\"button\"\n [hidden]=\"formSettings?.disableMediaSelection\"\n icon=\"fa fa-photo-video\"\n label=\"Medienverwaltung\"\n class=\"p-button-rounded p-button-outlined text-secondary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"searchMedia()\">\n </button>-->\n\n <button pButton pRipple type=\"button\"\n [hidden]=\"formSettings?.disableDelete\"\n icon=\"fa fa-eraser\"\n label=\"Entfernen\"\n (click)=\"removeImage()\"\n [disabled]=\"!image || disabled\"\n class=\"p-button-rounded p-button-outlined text-secondary\">\n </button>\n\n </div>\n\n </div>\n\n <small *ngIf=\"formTemplate.description\"><i class=\"fa fa-info-circle\"></i> {{formTemplate.description}}</small>\n\n</div>\n\n<!--\n<p-dialog [header]=\"'Bild ausw\u00E4hlen'\" [(visible)]=\"imageChooserDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\">\n <app-image-chooser buttonLabel=\"Ausw\u00E4hlen\"\n (choosen)=\"getFileImage($event)\"\n (canceled)=\"imageChooserDialogVisible = false\"\n [inverseColor]=\"inverseColor\"\n [resizeToWidth]=\"imageWidth\"\n [resizeToHeight]=\"imageHeight\"\n [containWithinAspectRatio]=\"containWithinAspectRatio\"\n [aspectRatio]=\"aspectRatio\"\n backgroundColor=\"transparent\"></app-image-chooser>\n</p-dialog>\n-->\n\n<!--\n<p-dialog [header]=\"'Foto aufnehmen'\" [(visible)]=\"webcamDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\">\n <app-webcam *ngIf=\"webcamDialogVisible\" buttonLabel=\"Smile\" (shot)=\"getWebcamImage($event)\" (canceled)=\"webcamDialogVisible = false\" [inverseColor]=\"inverseColor\"></app-webcam>\n</p-dialog>\n-->\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "directive", type: i6.Ripple, selector: "[pRipple]" }, { kind: "directive", type: i3.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
553
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormImageItemComponent, decorators: [{
|
|
554
|
+
type: Component,
|
|
555
|
+
args: [{ selector: 'onshore-form-image-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-column mb-3\" style=\"max-width: 500px\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <div class=\"w-100\">\n\n <div class=\"position-relative flex justify-content-center align-items-center\" style=\"background-color: white\">\n <!--<app-image-placeholder class=\"w-100\" [image]=\"image\" imageStyle=\"position: absolut; height: 250px; width: 250px\" [placeholder]=\"formSettings?.imagePlaceholder ? formSettings?.imagePlaceholder + ' fa-10x' : 'fa-image fa-10x'\" placeholderStyle=\"width: 250px; height: 250px\"></app-image-placeholder>-->\n </div>\n\n <div class=\"flex flex-column mt-4 w-100\">\n <button pButton pRipple type=\"button\"\n [hidden]=\"formSettings?.disableImageSelection\"\n icon=\"fa fa-image\"\n label=\"Bild hochladen\"\n class=\"p-button-rounded p-button-outlined text-secondary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"imageChooserDialogVisible = true\">\n </button>\n\n <button pButton pRipple type=\"button\"\n [hidden]=\"formSettings?.disableWebcamSelection\"\n icon=\"fa fa-camera\"\n label=\"Foto aufnehmen\"\n class=\"p-button-rounded p-button-outlined text-secondary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"webcamDialogVisible = true\">\n </button>\n\n <!--<button pButton pRipple type=\"button\"\n [hidden]=\"formSettings?.disableMediaSelection\"\n icon=\"fa fa-photo-video\"\n label=\"Medienverwaltung\"\n class=\"p-button-rounded p-button-outlined text-secondary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"searchMedia()\">\n </button>-->\n\n <button pButton pRipple type=\"button\"\n [hidden]=\"formSettings?.disableDelete\"\n icon=\"fa fa-eraser\"\n label=\"Entfernen\"\n (click)=\"removeImage()\"\n [disabled]=\"!image || disabled\"\n class=\"p-button-rounded p-button-outlined text-secondary\">\n </button>\n\n </div>\n\n </div>\n\n <small *ngIf=\"formTemplate.description\"><i class=\"fa fa-info-circle\"></i> {{formTemplate.description}}</small>\n\n</div>\n\n<!--\n<p-dialog [header]=\"'Bild ausw\u00E4hlen'\" [(visible)]=\"imageChooserDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\">\n <app-image-chooser buttonLabel=\"Ausw\u00E4hlen\"\n (choosen)=\"getFileImage($event)\"\n (canceled)=\"imageChooserDialogVisible = false\"\n [inverseColor]=\"inverseColor\"\n [resizeToWidth]=\"imageWidth\"\n [resizeToHeight]=\"imageHeight\"\n [containWithinAspectRatio]=\"containWithinAspectRatio\"\n [aspectRatio]=\"aspectRatio\"\n backgroundColor=\"transparent\"></app-image-chooser>\n</p-dialog>\n-->\n\n<!--\n<p-dialog [header]=\"'Foto aufnehmen'\" [(visible)]=\"webcamDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\">\n <app-webcam *ngIf=\"webcamDialogVisible\" buttonLabel=\"Smile\" (shot)=\"getWebcamImage($event)\" (canceled)=\"webcamDialogVisible = false\" [inverseColor]=\"inverseColor\"></app-webcam>\n</p-dialog>\n-->\n" }]
|
|
556
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1$1.NgControl, decorators: [{
|
|
557
|
+
type: Self
|
|
558
|
+
}, {
|
|
559
|
+
type: Optional
|
|
560
|
+
}] }, { type: i2$1.DialogService }, { type: i1.TranslateService }]; }, propDecorators: { formTemplate: [{
|
|
561
|
+
type: Input
|
|
562
|
+
}], inverseColor: [{
|
|
563
|
+
type: Input
|
|
564
|
+
}], imageWidth: [{
|
|
565
|
+
type: Input
|
|
566
|
+
}], imageHeight: [{
|
|
567
|
+
type: Input
|
|
568
|
+
}], containWithinAspectRatio: [{
|
|
569
|
+
type: Input
|
|
570
|
+
}], aspectRatio: [{
|
|
571
|
+
type: Input
|
|
572
|
+
}], imageDeleted: [{
|
|
573
|
+
type: Output
|
|
574
|
+
}], imageCleared: [{
|
|
575
|
+
type: Output
|
|
576
|
+
}], imageSelectedFromMedia: [{
|
|
577
|
+
type: Output
|
|
578
|
+
}] } });
|
|
579
|
+
|
|
580
|
+
class OnshoreFormDropdownItemComponent {
|
|
581
|
+
constructor(ngControl, cdr) {
|
|
582
|
+
this.ngControl = ngControl;
|
|
583
|
+
this.cdr = cdr;
|
|
584
|
+
this.disabled = false;
|
|
585
|
+
this.multiple = false;
|
|
586
|
+
this.ngControl.valueAccessor = this;
|
|
587
|
+
}
|
|
588
|
+
// ControlValueAccessor interface
|
|
589
|
+
writeValue(obj) { }
|
|
590
|
+
registerOnChange(fn) { }
|
|
591
|
+
registerOnTouched(fn) { }
|
|
592
|
+
setDisabledState(isDisabled) {
|
|
593
|
+
this.disabled = isDisabled;
|
|
594
|
+
}
|
|
595
|
+
clearSelection() {
|
|
596
|
+
this.ngControl.control?.setValue(null);
|
|
597
|
+
}
|
|
598
|
+
ngOnInit() {
|
|
599
|
+
this.ngControl.control?.valueChanges.subscribe(() => {
|
|
600
|
+
this.cdr.markForCheck();
|
|
601
|
+
});
|
|
602
|
+
this.ngControl.control?.statusChanges.subscribe(() => {
|
|
603
|
+
this.cdr.markForCheck();
|
|
604
|
+
});
|
|
605
|
+
if (this.ngControl.control?.value == '' && this.formTemplate.default != undefined) {
|
|
606
|
+
this.ngControl.control?.setValue(this.formTemplate.default);
|
|
607
|
+
this.cdr.markForCheck();
|
|
608
|
+
}
|
|
609
|
+
if (this.formTemplate.enabled) {
|
|
610
|
+
this.ngControl.control?.enable();
|
|
611
|
+
}
|
|
612
|
+
else {
|
|
613
|
+
this.ngControl.control?.disable();
|
|
614
|
+
}
|
|
615
|
+
this.multiple = this.formTemplate.settings?.multiple;
|
|
616
|
+
}
|
|
617
|
+
ngOnDestroy() {
|
|
618
|
+
this.ngControl.control?.disable();
|
|
619
|
+
}
|
|
620
|
+
ngOnChanges(changes) {
|
|
621
|
+
this.cdr.markForCheck();
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
OnshoreFormDropdownItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormDropdownItemComponent, deps: [{ token: i1$1.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
625
|
+
OnshoreFormDropdownItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormDropdownItemComponent, selector: "onshore-form-dropdown-item", inputs: { formTemplate: "formTemplate" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"flex flex-column mb-3\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate?.label}}\n <span *ngIf=\"formTemplate?.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate?.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate?.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <p-dropdown *ngIf=\"!multiple\"\n class=\"w-100\"\n [options]=\"formTemplate?.options\"\n [formControl]=\"ngControl.control\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [dataKey]=\"formTemplate?.optionDataKey\"\n [showClear]=\"formTemplate?.settings?.showClear\"\n (onClear)=\"clearSelection()\"\n optionDisabled=\"disabled\"\n appendTo=\"body\">\n </p-dropdown>\n\n <p-multiSelect *ngIf=\"multiple\"\n class=\"w-100\"\n [options]=\"formTemplate?.options\"\n [formControl]=\"ngControl.control\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [dataKey]=\"formTemplate?.optionDataKey\"\n display=\"chip\"\n optionDisabled=\"disabled\"\n appendTo=\"body\"></p-multiSelect>\n\n <div *ngIf=\"ngControl.control.touched\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate?.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i3$1.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "disabled", "itemSize", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "component", type: i4$3.MultiSelect, selector: "p-multiSelect", inputs: ["style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "appendTo", "dataKey", "name", "label", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "autoZIndex", "baseZIndex", "filterBy", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "defaultLabel", "placeholder", "options", "filterValue", "itemSize"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad"] }, { kind: "directive", type: i3.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: OnshoreFormValidationOutputComponent, selector: "onshore-form-validation-output", inputs: ["validationErrors", "externValidationPattern", "validationItems"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
626
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormDropdownItemComponent, decorators: [{
|
|
627
|
+
type: Component,
|
|
628
|
+
args: [{ selector: 'onshore-form-dropdown-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-column mb-3\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate?.label}}\n <span *ngIf=\"formTemplate?.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate?.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate?.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <p-dropdown *ngIf=\"!multiple\"\n class=\"w-100\"\n [options]=\"formTemplate?.options\"\n [formControl]=\"ngControl.control\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [dataKey]=\"formTemplate?.optionDataKey\"\n [showClear]=\"formTemplate?.settings?.showClear\"\n (onClear)=\"clearSelection()\"\n optionDisabled=\"disabled\"\n appendTo=\"body\">\n </p-dropdown>\n\n <p-multiSelect *ngIf=\"multiple\"\n class=\"w-100\"\n [options]=\"formTemplate?.options\"\n [formControl]=\"ngControl.control\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [dataKey]=\"formTemplate?.optionDataKey\"\n display=\"chip\"\n optionDisabled=\"disabled\"\n appendTo=\"body\"></p-multiSelect>\n\n <div *ngIf=\"ngControl.control.touched\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate?.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n" }]
|
|
629
|
+
}], ctorParameters: function () { return [{ type: i1$1.NgControl, decorators: [{
|
|
630
|
+
type: Self
|
|
631
|
+
}, {
|
|
632
|
+
type: Optional
|
|
633
|
+
}] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { formTemplate: [{
|
|
634
|
+
type: Input
|
|
635
|
+
}] } });
|
|
636
|
+
|
|
637
|
+
class OnshoreFormColorpickerItemComponent {
|
|
638
|
+
constructor(ngControl, cdr) {
|
|
639
|
+
this.ngControl = ngControl;
|
|
640
|
+
this.cdr = cdr;
|
|
641
|
+
this.disabled = false;
|
|
642
|
+
this.colorPickerValue = '';
|
|
643
|
+
this.ngControl.valueAccessor = this;
|
|
644
|
+
}
|
|
645
|
+
// ControlValueAccessor interface
|
|
646
|
+
writeValue(obj) { }
|
|
647
|
+
registerOnChange(fn) { }
|
|
648
|
+
registerOnTouched(fn) { }
|
|
649
|
+
setDisabledState(isDisabled) {
|
|
650
|
+
this.disabled = isDisabled;
|
|
651
|
+
}
|
|
652
|
+
changeColor() {
|
|
653
|
+
this.ngControl.control?.setValue(this.colorPickerValue);
|
|
654
|
+
}
|
|
655
|
+
changeInput(input) {
|
|
656
|
+
this.colorPickerValue = input.target?.value;
|
|
657
|
+
}
|
|
658
|
+
ngOnInit() {
|
|
659
|
+
this.ngControl.control?.valueChanges.subscribe(() => {
|
|
660
|
+
this.cdr.markForCheck();
|
|
661
|
+
});
|
|
662
|
+
this.ngControl.control?.statusChanges.subscribe(() => {
|
|
663
|
+
this.cdr.markForCheck();
|
|
664
|
+
});
|
|
665
|
+
if (this.ngControl.control?.value == '' && this.formTemplate.default != undefined) {
|
|
666
|
+
this.ngControl.control?.setValue(this.formTemplate.default);
|
|
667
|
+
this.colorPickerValue = this.formTemplate.default;
|
|
668
|
+
this.cdr.markForCheck();
|
|
669
|
+
}
|
|
670
|
+
if (this.formTemplate.enabled) {
|
|
671
|
+
this.ngControl.control?.enable();
|
|
672
|
+
}
|
|
673
|
+
else {
|
|
674
|
+
this.ngControl.control?.disable();
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
ngOnDestroy() {
|
|
678
|
+
this.ngControl.control?.disable();
|
|
679
|
+
}
|
|
680
|
+
ngOnChanges(changes) {
|
|
681
|
+
this.colorPickerValue = this.ngControl.control?.value;
|
|
682
|
+
this.cdr.markForCheck();
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
OnshoreFormColorpickerItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormColorpickerItemComponent, deps: [{ token: i1$1.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
686
|
+
OnshoreFormColorpickerItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormColorpickerItemComponent, selector: "onshore-form-colorpicker-item", inputs: { formTemplate: "formTemplate" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"flex flex-column mb-3\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}:\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <div class=\"flex w-100\">\n <p-colorPicker [(ngModel)]=\"colorPickerValue\" format=\"hex\" [inline]=\"false\" appendTo=\"body\" [baseZIndex]=\"99999\" (onChange)=\"changeColor()\"></p-colorPicker>\n <input class=\"w-100 ml-2\"\n type=\"text\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.label\"\n [formControl]=\"ngControl.control\"\n pInputText\n [value]=\"ngControl.control.value\"\n (input)=\"changeInput($event)\"/>\n </div>\n\n <div *ngIf=\"ngControl.control.touched\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i3$2.ColorPicker, selector: "p-colorPicker", inputs: ["style", "styleClass", "inline", "format", "appendTo", "disabled", "tabindex", "inputId", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onChange", "onShow", "onHide"] }, { kind: "directive", type: i3.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "directive", type: i5.InputText, selector: "[pInputText]" }, { kind: "component", type: OnshoreFormValidationOutputComponent, selector: "onshore-form-validation-output", inputs: ["validationErrors", "externValidationPattern", "validationItems"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
687
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormColorpickerItemComponent, decorators: [{
|
|
688
|
+
type: Component,
|
|
689
|
+
args: [{ selector: 'onshore-form-colorpicker-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-column mb-3\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}:\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <div class=\"flex w-100\">\n <p-colorPicker [(ngModel)]=\"colorPickerValue\" format=\"hex\" [inline]=\"false\" appendTo=\"body\" [baseZIndex]=\"99999\" (onChange)=\"changeColor()\"></p-colorPicker>\n <input class=\"w-100 ml-2\"\n type=\"text\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.label\"\n [formControl]=\"ngControl.control\"\n pInputText\n [value]=\"ngControl.control.value\"\n (input)=\"changeInput($event)\"/>\n </div>\n\n <div *ngIf=\"ngControl.control.touched\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n" }]
|
|
690
|
+
}], ctorParameters: function () { return [{ type: i1$1.NgControl, decorators: [{
|
|
691
|
+
type: Self
|
|
692
|
+
}, {
|
|
693
|
+
type: Optional
|
|
694
|
+
}] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { formTemplate: [{
|
|
695
|
+
type: Input
|
|
696
|
+
}] } });
|
|
697
|
+
|
|
698
|
+
class OnshoreFormCheckboxItemComponent {
|
|
699
|
+
constructor(ngControl, cdr) {
|
|
700
|
+
this.ngControl = ngControl;
|
|
701
|
+
this.cdr = cdr;
|
|
702
|
+
this.disabled = false;
|
|
703
|
+
this.ngControl.valueAccessor = this;
|
|
704
|
+
}
|
|
705
|
+
// ControlValueAccessor interface
|
|
706
|
+
writeValue(obj) { }
|
|
707
|
+
registerOnChange(fn) { }
|
|
708
|
+
registerOnTouched(fn) { }
|
|
709
|
+
setDisabledState(isDisabled) {
|
|
710
|
+
this.disabled = isDisabled;
|
|
711
|
+
}
|
|
712
|
+
changeCheck(value) {
|
|
713
|
+
this.ngControl.control?.setValue(value.checked);
|
|
714
|
+
}
|
|
715
|
+
ngOnInit() {
|
|
716
|
+
this.ngControl.control?.valueChanges.subscribe(() => {
|
|
717
|
+
this.cdr.markForCheck();
|
|
718
|
+
});
|
|
719
|
+
this.ngControl.control?.statusChanges.subscribe(() => {
|
|
720
|
+
this.cdr.markForCheck();
|
|
721
|
+
});
|
|
722
|
+
if (this.ngControl.control?.value !== true && this.ngControl.control?.value !== false && this.formTemplate.default != undefined) {
|
|
723
|
+
this.ngControl.control?.setValue(this.formTemplate.default);
|
|
724
|
+
this.cdr.markForCheck();
|
|
725
|
+
}
|
|
726
|
+
if (this.formTemplate.enabled) {
|
|
727
|
+
this.ngControl.control?.enable();
|
|
728
|
+
}
|
|
729
|
+
else {
|
|
730
|
+
this.ngControl.control?.disable();
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
ngOnChanges(changes) {
|
|
734
|
+
this.cdr.markForCheck();
|
|
735
|
+
}
|
|
736
|
+
ngOnDestroy() {
|
|
737
|
+
this.ngControl.control?.disable();
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
OnshoreFormCheckboxItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormCheckboxItemComponent, deps: [{ token: i1$1.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
741
|
+
OnshoreFormCheckboxItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormCheckboxItemComponent, selector: "onshore-form-checkbox-item", inputs: { formTemplate: "formTemplate" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"flex flex-column mb-3\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <div class=\"p-field-checkbox flex\">\n <p-checkbox class=\"align-self-start mt-1\" [name]=\"formTemplate.name\" [formControl]=\"ngControl.control\" [binary]=\"true\" [inputId]=\"formTemplate.name\" [value]=\"ngControl.control.value\" (onChange)=\"changeCheck($event)\"></p-checkbox>\n <label class=\"mb-0 ml-2\" [for]=\"formTemplate.name\">{{formTemplate.description}}</label>\n </div>\n\n <div *ngIf=\"ngControl.control.touched\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i3$3.Checkbox, selector: "p-checkbox", inputs: ["value", "name", "disabled", "binary", "label", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "styleClass", "labelStyleClass", "formControl", "checkboxIcon", "readonly", "required", "trueValue", "falseValue"], outputs: ["onChange"] }, { kind: "directive", type: i3.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: OnshoreFormValidationOutputComponent, selector: "onshore-form-validation-output", inputs: ["validationErrors", "externValidationPattern", "validationItems"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
742
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormCheckboxItemComponent, decorators: [{
|
|
743
|
+
type: Component,
|
|
744
|
+
args: [{ selector: 'onshore-form-checkbox-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-column mb-3\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <div class=\"p-field-checkbox flex\">\n <p-checkbox class=\"align-self-start mt-1\" [name]=\"formTemplate.name\" [formControl]=\"ngControl.control\" [binary]=\"true\" [inputId]=\"formTemplate.name\" [value]=\"ngControl.control.value\" (onChange)=\"changeCheck($event)\"></p-checkbox>\n <label class=\"mb-0 ml-2\" [for]=\"formTemplate.name\">{{formTemplate.description}}</label>\n </div>\n\n <div *ngIf=\"ngControl.control.touched\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n" }]
|
|
745
|
+
}], ctorParameters: function () { return [{ type: i1$1.NgControl, decorators: [{
|
|
746
|
+
type: Self
|
|
747
|
+
}, {
|
|
748
|
+
type: Optional
|
|
749
|
+
}] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { formTemplate: [{
|
|
750
|
+
type: Input
|
|
751
|
+
}] } });
|
|
752
|
+
|
|
753
|
+
class OnshoreFormAutocompleteItemComponent {
|
|
754
|
+
}
|
|
755
|
+
OnshoreFormAutocompleteItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormAutocompleteItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
756
|
+
OnshoreFormAutocompleteItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormAutocompleteItemComponent, selector: "onshore-form-autocomplete-item", ngImport: i0, template: "<!--<div class=\"flex flex-column mb-3\">\n <div *ngIf=\"formTemplate.label\" class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <p-autoComplete [placeholder]=\"formTemplate.placeholder\"\n appendTo=\"body\"\n [formControl]=\"this.ngControl.control\"\n (onSelect)=\"selected($event)\"\n (onUnselect)=\"selected($event)\"\n (onClear)=\"searchClear()\"\n [suggestions]=\"dataSearch\"\n (completeMethod)=\"searchPrepare($event)\"\n [size]=\"30\"\n [minLength]=\"2\"\n [multiple]=\"multiple\"\n [delay]=\"1000\"\n [unique]=\"true\"\n [field]=\"selectedField\"\n class=\"w-100\">\n <ng-template let-item pTemplate=\"item\">\n <div *ngIf=\"suggestionsHighlightedField\">\n <span class=\"mr-1\">\n <b>{{item[suggestionsHighlightedField]}}</b><br>\n </span>\n </div>\n <div [hidden]=\"suggestionsLineOneFields.length <= 0\"><span *ngFor=\"let field of suggestionsLineOneFields\">{{item[field]}} </span></div>\n <div [hidden]=\"suggestionsLineTwoFields.length <= 0\"><span *ngFor=\"let field of suggestionsLineTwoFields\">{{item[field]}} </span></div>\n </ng-template>\n </p-autoComplete>\n\n <small *ngIf=\"formTemplate.description\"><i class=\"fa fa-info-circle\"></i> {{formTemplate.description}}</small>\n\n <div *ngIf=\"ngControl.control.touched\">\n <onshore-form-validation-output\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n-->\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
757
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormAutocompleteItemComponent, decorators: [{
|
|
758
|
+
type: Component,
|
|
759
|
+
args: [{ selector: 'onshore-form-autocomplete-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--<div class=\"flex flex-column mb-3\">\n <div *ngIf=\"formTemplate.label\" class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <p-autoComplete [placeholder]=\"formTemplate.placeholder\"\n appendTo=\"body\"\n [formControl]=\"this.ngControl.control\"\n (onSelect)=\"selected($event)\"\n (onUnselect)=\"selected($event)\"\n (onClear)=\"searchClear()\"\n [suggestions]=\"dataSearch\"\n (completeMethod)=\"searchPrepare($event)\"\n [size]=\"30\"\n [minLength]=\"2\"\n [multiple]=\"multiple\"\n [delay]=\"1000\"\n [unique]=\"true\"\n [field]=\"selectedField\"\n class=\"w-100\">\n <ng-template let-item pTemplate=\"item\">\n <div *ngIf=\"suggestionsHighlightedField\">\n <span class=\"mr-1\">\n <b>{{item[suggestionsHighlightedField]}}</b><br>\n </span>\n </div>\n <div [hidden]=\"suggestionsLineOneFields.length <= 0\"><span *ngFor=\"let field of suggestionsLineOneFields\">{{item[field]}} </span></div>\n <div [hidden]=\"suggestionsLineTwoFields.length <= 0\"><span *ngFor=\"let field of suggestionsLineTwoFields\">{{item[field]}} </span></div>\n </ng-template>\n </p-autoComplete>\n\n <small *ngIf=\"formTemplate.description\"><i class=\"fa fa-info-circle\"></i> {{formTemplate.description}}</small>\n\n <div *ngIf=\"ngControl.control.touched\">\n <onshore-form-validation-output\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n-->\n" }]
|
|
760
|
+
}] });
|
|
761
|
+
|
|
762
|
+
class OnshoreFormsModule {
|
|
763
|
+
}
|
|
764
|
+
OnshoreFormsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
765
|
+
OnshoreFormsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormsModule, declarations: [OnshoreFormsComponent,
|
|
766
|
+
OnshoreFormInputItemComponent,
|
|
767
|
+
OnshoreFormSwitchItemComponent,
|
|
768
|
+
OnshoreFormTextareaItemComponent,
|
|
769
|
+
OnshoreFormValidationOutputComponent,
|
|
770
|
+
OnshoreFormImageItemComponent,
|
|
771
|
+
OnshoreFormDropdownItemComponent,
|
|
772
|
+
OnshoreFormColorpickerItemComponent,
|
|
773
|
+
OnshoreFormCheckboxItemComponent,
|
|
774
|
+
OnshoreFormAutocompleteItemComponent], imports: [CommonModule,
|
|
775
|
+
FormsModule,
|
|
776
|
+
ReactiveFormsModule,
|
|
777
|
+
ButtonModule,
|
|
778
|
+
RippleModule,
|
|
779
|
+
AutoCompleteModule,
|
|
780
|
+
CheckboxModule,
|
|
781
|
+
ColorPickerModule,
|
|
782
|
+
DropdownModule,
|
|
783
|
+
MultiSelectModule,
|
|
784
|
+
TooltipModule,
|
|
785
|
+
InputNumberModule,
|
|
786
|
+
InputSwitchModule,
|
|
787
|
+
InputTextModule,
|
|
788
|
+
InputTextareaModule,
|
|
789
|
+
DialogModule], exports: [OnshoreFormsComponent,
|
|
790
|
+
OnshoreFormInputItemComponent,
|
|
791
|
+
OnshoreFormSwitchItemComponent,
|
|
792
|
+
OnshoreFormTextareaItemComponent,
|
|
793
|
+
OnshoreFormValidationOutputComponent,
|
|
794
|
+
OnshoreFormImageItemComponent,
|
|
795
|
+
OnshoreFormDropdownItemComponent,
|
|
796
|
+
OnshoreFormColorpickerItemComponent,
|
|
797
|
+
OnshoreFormCheckboxItemComponent,
|
|
798
|
+
OnshoreFormAutocompleteItemComponent] });
|
|
799
|
+
OnshoreFormsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormsModule, providers: [
|
|
800
|
+
OnshoreFormsService
|
|
801
|
+
], imports: [CommonModule,
|
|
802
|
+
FormsModule,
|
|
803
|
+
ReactiveFormsModule,
|
|
804
|
+
ButtonModule,
|
|
805
|
+
RippleModule,
|
|
806
|
+
AutoCompleteModule,
|
|
807
|
+
CheckboxModule,
|
|
808
|
+
ColorPickerModule,
|
|
809
|
+
DropdownModule,
|
|
810
|
+
MultiSelectModule,
|
|
811
|
+
TooltipModule,
|
|
812
|
+
InputNumberModule,
|
|
813
|
+
InputSwitchModule,
|
|
814
|
+
InputTextModule,
|
|
815
|
+
InputTextareaModule,
|
|
816
|
+
DialogModule] });
|
|
817
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormsModule, decorators: [{
|
|
818
|
+
type: NgModule,
|
|
819
|
+
args: [{
|
|
820
|
+
declarations: [
|
|
821
|
+
OnshoreFormsComponent,
|
|
822
|
+
OnshoreFormInputItemComponent,
|
|
823
|
+
OnshoreFormSwitchItemComponent,
|
|
824
|
+
OnshoreFormTextareaItemComponent,
|
|
825
|
+
OnshoreFormValidationOutputComponent,
|
|
826
|
+
OnshoreFormImageItemComponent,
|
|
827
|
+
OnshoreFormDropdownItemComponent,
|
|
828
|
+
OnshoreFormColorpickerItemComponent,
|
|
829
|
+
OnshoreFormCheckboxItemComponent,
|
|
830
|
+
OnshoreFormAutocompleteItemComponent
|
|
831
|
+
],
|
|
832
|
+
imports: [
|
|
833
|
+
CommonModule,
|
|
834
|
+
FormsModule,
|
|
835
|
+
ReactiveFormsModule,
|
|
836
|
+
ButtonModule,
|
|
837
|
+
RippleModule,
|
|
838
|
+
AutoCompleteModule,
|
|
839
|
+
CheckboxModule,
|
|
840
|
+
ColorPickerModule,
|
|
841
|
+
DropdownModule,
|
|
842
|
+
MultiSelectModule,
|
|
843
|
+
TooltipModule,
|
|
844
|
+
InputNumberModule,
|
|
845
|
+
InputSwitchModule,
|
|
846
|
+
InputTextModule,
|
|
847
|
+
InputTextareaModule,
|
|
848
|
+
DialogModule
|
|
849
|
+
],
|
|
850
|
+
exports: [
|
|
851
|
+
OnshoreFormsComponent,
|
|
852
|
+
OnshoreFormInputItemComponent,
|
|
853
|
+
OnshoreFormSwitchItemComponent,
|
|
854
|
+
OnshoreFormTextareaItemComponent,
|
|
855
|
+
OnshoreFormValidationOutputComponent,
|
|
856
|
+
OnshoreFormImageItemComponent,
|
|
857
|
+
OnshoreFormDropdownItemComponent,
|
|
858
|
+
OnshoreFormColorpickerItemComponent,
|
|
859
|
+
OnshoreFormCheckboxItemComponent,
|
|
860
|
+
OnshoreFormAutocompleteItemComponent
|
|
861
|
+
],
|
|
862
|
+
providers: [
|
|
863
|
+
OnshoreFormsService
|
|
864
|
+
]
|
|
865
|
+
}]
|
|
866
|
+
}] });
|
|
867
|
+
|
|
868
|
+
/*
|
|
869
|
+
* Public API Surface of onshore-forms
|
|
870
|
+
*/
|
|
871
|
+
|
|
872
|
+
/**
|
|
873
|
+
* Generated bundle index. Do not edit.
|
|
874
|
+
*/
|
|
875
|
+
|
|
876
|
+
export { OnshoreFormAutocompleteItemComponent, OnshoreFormCheckboxItemComponent, OnshoreFormColorpickerItemComponent, OnshoreFormDropdownItemComponent, OnshoreFormImageItemComponent, OnshoreFormInputItemComponent, OnshoreFormSwitchItemComponent, OnshoreFormTemplateType, OnshoreFormTextareaItemComponent, OnshoreFormValidationOutputComponent, OnshoreFormsComponent, OnshoreFormsModule, OnshoreFormsService, OnshoreImageError };
|
|
877
|
+
//# sourceMappingURL=onshore-forms.mjs.map
|