onshore-forms 0.0.58 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/fesm2022/onshore-forms.mjs +1399 -0
  2. package/fesm2022/onshore-forms.mjs.map +1 -0
  3. package/lib/components/form-autocomplete-item/form-autocomplete-item.component.d.ts +5 -3
  4. package/lib/components/form-checkbox-item/form-checkbox-item.component.d.ts +3 -2
  5. package/lib/components/form-colorpicker-item/form-colorpicker-item.component.d.ts +3 -2
  6. package/lib/components/form-datetime-item/form-datetime-item.component.d.ts +3 -2
  7. package/lib/components/form-dropdown-item/form-dropdown-item.component.d.ts +3 -2
  8. package/lib/components/form-image-item/form-image-item.component.d.ts +3 -3
  9. package/lib/components/form-input-item/form-input-item.component.d.ts +3 -2
  10. package/lib/components/form-item-container/form-item-container.component.d.ts +3 -3
  11. package/lib/components/form-sort-item/form-sort-item.component.d.ts +2 -2
  12. package/lib/components/form-switch-item/form-switch-item.component.d.ts +3 -2
  13. package/lib/components/form-validation-output/form-validation-output.component.d.ts +1 -1
  14. package/lib/components/image-chooser/image-chooser.component.d.ts +2 -2
  15. package/lib/components/image-placeholder/image-placeholder.component.d.ts +1 -1
  16. package/lib/components/webcam/webcam.component.d.ts +2 -2
  17. package/lib/onshore-forms.component.d.ts +1 -1
  18. package/lib/onshore-forms.service.d.ts +1 -1
  19. package/package.json +12 -19
  20. package/public-api.d.ts +0 -1
  21. package/styles/scss/main.css +1 -1
  22. package/styles/scss/theme1.css +1 -1
  23. package/esm2020/lib/components/form-autocomplete-item/form-autocomplete-item.component.mjs +0 -98
  24. package/esm2020/lib/components/form-checkbox-item/form-checkbox-item.component.mjs +0 -54
  25. package/esm2020/lib/components/form-colorpicker-item/form-colorpicker-item.component.mjs +0 -63
  26. package/esm2020/lib/components/form-datetime-item/form-datetime-item.component.mjs +0 -59
  27. package/esm2020/lib/components/form-dropdown-item/form-dropdown-item.component.mjs +0 -101
  28. package/esm2020/lib/components/form-image-item/form-image-item.component.mjs +0 -164
  29. package/esm2020/lib/components/form-input-item/form-input-item.component.mjs +0 -78
  30. package/esm2020/lib/components/form-item-container/form-item-container.component.mjs +0 -130
  31. package/esm2020/lib/components/form-sort-item/form-sort-item.component.mjs +0 -89
  32. package/esm2020/lib/components/form-switch-item/form-switch-item.component.mjs +0 -58
  33. package/esm2020/lib/components/form-validation-output/form-validation-output.component.mjs +0 -38
  34. package/esm2020/lib/components/image-chooser/image-chooser.component.mjs +0 -79
  35. package/esm2020/lib/components/image-placeholder/image-placeholder.component.mjs +0 -41
  36. package/esm2020/lib/components/webcam/webcam.component.mjs +0 -49
  37. package/esm2020/lib/enums/form.enums.mjs +0 -37
  38. package/esm2020/lib/models/form.models.mjs +0 -2
  39. package/esm2020/lib/onshore-forms.component.mjs +0 -14
  40. package/esm2020/lib/onshore-forms.module.mjs +0 -189
  41. package/esm2020/lib/onshore-forms.service.mjs +0 -213
  42. package/esm2020/lib/validators/form.validators.mjs +0 -15
  43. package/esm2020/onshore-forms.mjs +0 -5
  44. package/esm2020/public-api.mjs +0 -24
  45. package/fesm2015/onshore-forms.mjs +0 -1550
  46. package/fesm2015/onshore-forms.mjs.map +0 -1
  47. package/fesm2020/onshore-forms.mjs +0 -1479
  48. package/fesm2020/onshore-forms.mjs.map +0 -1
  49. package/lib/onshore-forms.module.d.ts +0 -43
@@ -0,0 +1,1399 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Component, ChangeDetectionStrategy, Input, EventEmitter, Output, ViewChild, HostListener, Self, Optional } from '@angular/core';
3
+ import * as i1$2 from '@angular/forms';
4
+ import { FormGroup, FormArray, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
+ import { Subject, debounceTime, distinctUntilChanged, skip } from 'rxjs';
6
+ import * as i1$1 from '@angular/common';
7
+ import { CommonModule } from '@angular/common';
8
+ import * as i1 from '@ngx-translate/core';
9
+ import { TranslateModule } from '@ngx-translate/core';
10
+ import * as i2 from 'primeng/togglebutton';
11
+ import { ToggleButtonModule } from 'primeng/togglebutton';
12
+ import * as i3 from 'primeng/tooltip';
13
+ import { TooltipModule } from 'primeng/tooltip';
14
+ import * as i3$1 from 'primeng/button';
15
+ import { ButtonModule } from 'primeng/button';
16
+ import * as i3$2 from 'primeng/autocomplete';
17
+ import { AutoCompleteModule } from 'primeng/autocomplete';
18
+ import * as i4 from 'primeng/api';
19
+ import * as i2$1 from 'primeng/checkbox';
20
+ import { CheckboxModule } from 'primeng/checkbox';
21
+ import * as i2$2 from 'primeng/inputtext';
22
+ import { InputTextModule } from 'primeng/inputtext';
23
+ import * as i3$3 from 'primeng/colorpicker';
24
+ import { ColorPickerModule } from 'primeng/colorpicker';
25
+ import * as i4$1 from 'primeng/dropdown';
26
+ import { DropdownModule } from 'primeng/dropdown';
27
+ import * as i5 from 'primeng/multiselect';
28
+ import { MultiSelectModule } from 'primeng/multiselect';
29
+ import * as i6 from 'primeng/dialog';
30
+ import { DialogModule } from 'primeng/dialog';
31
+ import { ImageCropperComponent } from 'ngx-image-cropper';
32
+ import * as i5$1 from 'ngx-webcam';
33
+ import { WebcamModule } from 'ngx-webcam';
34
+ import * as i2$3 from 'primeng/dynamicdialog';
35
+ import * as i3$4 from 'primeng/textarea';
36
+ import { TextareaModule } from 'primeng/textarea';
37
+ import * as i5$2 from 'primeng/inputnumber';
38
+ import { InputNumberModule } from 'primeng/inputnumber';
39
+ import * as i6$1 from 'primeng/inputgroup';
40
+ import { InputGroupModule } from 'primeng/inputgroup';
41
+ import * as i7 from 'primeng/inputgroupaddon';
42
+ import { InputGroupAddonModule } from 'primeng/inputgroupaddon';
43
+ import * as i2$4 from 'primeng/inputswitch';
44
+ import { InputSwitchModule } from 'primeng/inputswitch';
45
+ import * as i2$5 from 'primeng/calendar';
46
+ import { CalendarModule } from 'primeng/calendar';
47
+
48
+ var OnshoreFormTemplateType;
49
+ (function (OnshoreFormTemplateType) {
50
+ OnshoreFormTemplateType["text"] = "text";
51
+ OnshoreFormTemplateType["textarea"] = "textarea";
52
+ OnshoreFormTemplateType["editor"] = "editor";
53
+ OnshoreFormTemplateType["password"] = "password";
54
+ OnshoreFormTemplateType["number"] = "number";
55
+ OnshoreFormTemplateType["email"] = "email";
56
+ OnshoreFormTemplateType["phone"] = "phone";
57
+ OnshoreFormTemplateType["regexp"] = "regexp";
58
+ OnshoreFormTemplateType["select"] = "select";
59
+ OnshoreFormTemplateType["switch"] = "switch";
60
+ OnshoreFormTemplateType["check"] = "check";
61
+ OnshoreFormTemplateType["radio"] = "radio";
62
+ OnshoreFormTemplateType["image"] = "image";
63
+ OnshoreFormTemplateType["autocomplete"] = "autocomplete";
64
+ OnshoreFormTemplateType["color"] = "color";
65
+ OnshoreFormTemplateType["date"] = "date";
66
+ OnshoreFormTemplateType["time"] = "time";
67
+ OnshoreFormTemplateType["datetime"] = "datetime";
68
+ OnshoreFormTemplateType["sort"] = "sort";
69
+ OnshoreFormTemplateType["subform"] = "subform";
70
+ })(OnshoreFormTemplateType || (OnshoreFormTemplateType = {}));
71
+ var OnshoreFormTemplateLayout;
72
+ (function (OnshoreFormTemplateLayout) {
73
+ OnshoreFormTemplateLayout["vertical"] = "vertical";
74
+ OnshoreFormTemplateLayout["horizontal"] = "horizontal";
75
+ OnshoreFormTemplateLayout["auto"] = "auto";
76
+ })(OnshoreFormTemplateLayout || (OnshoreFormTemplateLayout = {}));
77
+ var OnshoreImageError;
78
+ (function (OnshoreImageError) {
79
+ OnshoreImageError["none"] = "";
80
+ OnshoreImageError["fileType"] = "fileType";
81
+ OnshoreImageError["ratio"] = "ratio";
82
+ OnshoreImageError["size"] = "size";
83
+ })(OnshoreImageError || (OnshoreImageError = {}));
84
+
85
+ class OnshoreFormsService {
86
+ _form;
87
+ _formTemplate;
88
+ _formValidations = [];
89
+ subscriptions = [];
90
+ isLoading$ = new Subject();
91
+ constructor() {
92
+ this._form = new FormGroup({}, { updateOn: 'change' });
93
+ this._formTemplate = [];
94
+ }
95
+ get form() {
96
+ return this._form;
97
+ }
98
+ get formValues() {
99
+ return this._form?.value;
100
+ }
101
+ patchForm(value) {
102
+ this._form?.patchValue(value);
103
+ }
104
+ resetForm() {
105
+ this._form?.reset();
106
+ this._form?.updateValueAndValidity({ onlySelf: false, emitEvent: true });
107
+ this.subscriptions.forEach((subscription) => {
108
+ subscription.unsubscribe();
109
+ });
110
+ this._form = null;
111
+ this._formTemplate = null;
112
+ }
113
+ resetFormControl(name, touched = false) {
114
+ this._form?.get(name)?.reset();
115
+ if (touched) {
116
+ this._form?.get(name)?.markAsTouched();
117
+ this._form?.get(name)?.markAsDirty();
118
+ }
119
+ this._form?.get(name)?.updateValueAndValidity({ onlySelf: false, emitEvent: true });
120
+ }
121
+ generateForm(formTemplate) {
122
+ this._formTemplate = formTemplate;
123
+ this._form = new FormGroup({}, { updateOn: 'change' });
124
+ this._form = this.iterateNestedForm(this._form, formTemplate);
125
+ return this._form;
126
+ }
127
+ formTemplate(name, formTemplate = this._formTemplate) {
128
+ let template;
129
+ if (formTemplate) {
130
+ for (let i = 0; i < formTemplate?.length; i++) {
131
+ const item = formTemplate[i];
132
+ if (item.name === name) {
133
+ template = item;
134
+ i = formTemplate.length;
135
+ }
136
+ else if (item.subformArray) {
137
+ const arrayTemplate = this.formTemplate(name, item.subformArray);
138
+ if (arrayTemplate)
139
+ template = arrayTemplate;
140
+ }
141
+ else if (item.subformObject) {
142
+ const objectTemplate = this.formTemplate(name, item.subformObject);
143
+ if (objectTemplate)
144
+ template = objectTemplate;
145
+ }
146
+ }
147
+ }
148
+ return template;
149
+ }
150
+ formControl(name, formGroup = this._form) {
151
+ return formGroup?.get(name);
152
+ }
153
+ formArray(name) {
154
+ return this._form?.get(name);
155
+ }
156
+ formGroup(form, name) {
157
+ return form.get(name);
158
+ }
159
+ addFormArrayItem(formArray, item, defaultValues) {
160
+ let formControls = {};
161
+ if (item) {
162
+ item.subformArray?.forEach((subitem) => {
163
+ if (subitem.type == OnshoreFormTemplateType.subform) {
164
+ if (item.subformArray) {
165
+ formControls[subitem.name] = new FormArray([]);
166
+ formControls[subitem.name].setParent(formControls[subitem.name]);
167
+ this.subscribeNestedFormArray(formControls[subitem.name]);
168
+ }
169
+ if (item.subformObject) {
170
+ formControls[subitem.name] = new FormGroup({});
171
+ this.subscribeNestedFormGroup(formControls[subitem.name]);
172
+ }
173
+ }
174
+ else {
175
+ const defaultValue = defaultValues?.find(value => value.name === subitem.name)?.value;
176
+ if (defaultValue)
177
+ subitem.default = defaultValue.value;
178
+ formControls[subitem.name] = new FormControl(defaultValue ?? (subitem.default !== undefined ? subitem.default : ''), {
179
+ validators: subitem.validators || [],
180
+ updateOn: 'change'
181
+ });
182
+ formControls[subitem.name].updateValueAndValidity({ onlySelf: false, emitEvent: true });
183
+ }
184
+ });
185
+ }
186
+ const formGroup = new FormGroup(formControls);
187
+ formGroup.setParent(formArray);
188
+ formArray.push(formGroup);
189
+ this.subscribeNestedFormGroup(formGroup);
190
+ return formGroup;
191
+ }
192
+ removeFormArrayItem(form, index) {
193
+ form.removeAt(index);
194
+ }
195
+ setFormValidations(validations = []) {
196
+ this._formValidations = validations;
197
+ }
198
+ enable() {
199
+ this._formTemplate.forEach((item) => {
200
+ item.enabled = true;
201
+ });
202
+ setTimeout(() => {
203
+ this._form?.enable({ onlySelf: true, emitEvent: false });
204
+ }, 100);
205
+ }
206
+ disable() {
207
+ this._formTemplate.forEach((item) => {
208
+ item.enabled = false;
209
+ });
210
+ setTimeout(() => {
211
+ this._form?.disable({ onlySelf: true, emitEvent: false });
212
+ }, 100);
213
+ }
214
+ setError(control, error) {
215
+ const errors = { ...this.formControl(control).errors ?? {}, ...error };
216
+ this.formControl(control).setErrors(errors);
217
+ }
218
+ setLoader(loaders$) {
219
+ loaders$.forEach($loader => {
220
+ this.subscriptions.push($loader.subscribe(isLoading => {
221
+ isLoading ? this.disable() : this.enable();
222
+ this.isLoading$.next(isLoading);
223
+ }));
224
+ });
225
+ }
226
+ lock(lockSubfields = true) {
227
+ this._formTemplate.forEach((item) => {
228
+ item.locked = true;
229
+ if (item.subformArray && lockSubfields) {
230
+ item.subformArray.forEach(subitem => {
231
+ subitem.locked = true;
232
+ });
233
+ }
234
+ });
235
+ }
236
+ unlock() {
237
+ this._formTemplate.forEach((item) => {
238
+ item.locked = false;
239
+ if (item.subformArray) {
240
+ item.subformArray.forEach(subitem => {
241
+ subitem.locked = false;
242
+ });
243
+ }
244
+ });
245
+ }
246
+ iterateNestedForm(form, formTemplate) {
247
+ formTemplate.forEach((item) => {
248
+ if (item.type === OnshoreFormTemplateType.subform) {
249
+ if (item.subformArray) {
250
+ form.controls[item.name] = new FormArray([]);
251
+ form.controls[item.name].setParent(form);
252
+ this.subscribeNestedFormArray(form.controls[item.name]);
253
+ }
254
+ if (item.subformObject) {
255
+ form.controls[item.name] = new FormGroup({});
256
+ form.controls[item.name] = this.iterateNestedForm(form.controls[item.name], item.subformObject);
257
+ this.subscribeNestedFormGroup(form.controls[item.name]);
258
+ }
259
+ }
260
+ else {
261
+ form.addControl(item.name, new FormControl(item.default !== undefined ? item.default : '', {
262
+ validators: item.validators || [],
263
+ updateOn: 'change'
264
+ }));
265
+ }
266
+ });
267
+ return form;
268
+ }
269
+ subscribeNestedFormArray(nestedFormItem) {
270
+ this.subscriptions.push(nestedFormItem.valueChanges.subscribe(() => {
271
+ this.form?.updateValueAndValidity({ onlySelf: true, emitEvent: false });
272
+ }));
273
+ this.subscriptions.push(nestedFormItem.statusChanges.subscribe(() => {
274
+ this.form?.updateValueAndValidity({ onlySelf: true, emitEvent: false });
275
+ }));
276
+ }
277
+ subscribeNestedFormGroup(nestedFormItem) {
278
+ this.subscriptions.push(nestedFormItem.valueChanges.subscribe(() => {
279
+ this.form?.updateValueAndValidity({ onlySelf: true, emitEvent: false });
280
+ }));
281
+ this.subscriptions.push(nestedFormItem.statusChanges.subscribe(() => {
282
+ this.form?.updateValueAndValidity({ onlySelf: true, emitEvent: false });
283
+ }));
284
+ }
285
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
286
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormsService, providedIn: 'root' });
287
+ }
288
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormsService, decorators: [{
289
+ type: Injectable,
290
+ args: [{
291
+ providedIn: 'root'
292
+ }]
293
+ }], ctorParameters: () => [] });
294
+
295
+ class OnshoreFormsComponent {
296
+ constructor() { }
297
+ ngOnInit() {
298
+ }
299
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
300
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: OnshoreFormsComponent, isStandalone: true, selector: "lib-onshore-forms", ngImport: i0, template: '', isInline: true });
301
+ }
302
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormsComponent, decorators: [{
303
+ type: Component,
304
+ args: [{ selector: 'lib-onshore-forms', template: '', standalone: true }]
305
+ }], ctorParameters: () => [] });
306
+
307
+ class OnshoreValidators {
308
+ static slug = (control) => {
309
+ return /^[A-Za-z0-9\._-]{2,20}$/.test(control.value) ? null : { slug: true };
310
+ };
311
+ static numeric = (control) => {
312
+ return /^[0-9]*$/.test(control.value) ? null : { numeric: true };
313
+ };
314
+ static email = (control) => {
315
+ return /^([\w-\.]+@([\w-]+\.)+[\w-]{2,10})?$/.test(control.value) ? null : { email: true };
316
+ };
317
+ static cleanComment = (control) => {
318
+ return /[A-Z]{5}\d{4}[A-Z]{1}/.test(control.value) ? null : { cleanComment: true };
319
+ };
320
+ }
321
+
322
+ class OnshoreFormValidationOutputComponent {
323
+ cdr;
324
+ translate;
325
+ validationErrors;
326
+ validationItems;
327
+ validationTranslation = '';
328
+ ngOnChanges(changes) {
329
+ this.validationTranslation = '';
330
+ if (changes['validationErrors'].currentValue && this.validationErrors) {
331
+ Object.keys(this.validationErrors).forEach(error => {
332
+ const exists = Object.values(this.validationItems ?? []).filter(validationItem => validationItem == error);
333
+ if (exists && exists.length > 0) {
334
+ this.validationTranslation += this.translate.instant('form.validation.' + error) + '<br>';
335
+ }
336
+ else {
337
+ const errorValues = this.validationErrors[error];
338
+ this.validationTranslation += this.translate.instant('form.validation.' + error, errorValues) + '<br>';
339
+ }
340
+ });
341
+ }
342
+ this.cdr.markForCheck();
343
+ }
344
+ constructor(cdr, translate) {
345
+ this.cdr = cdr;
346
+ this.translate = translate;
347
+ }
348
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormValidationOutputComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
349
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: OnshoreFormValidationOutputComponent, isStandalone: true, selector: "onshore-form-validation-output", inputs: { validationErrors: "validationErrors", validationItems: "validationItems" }, usesOnChanges: true, ngImport: i0, template: "<small class=\"onshore-color-danger\"\n *ngIf=\"validationTranslation\"\n [innerHTML]=\"validationTranslation\">\n</small>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
350
+ }
351
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormValidationOutputComponent, decorators: [{
352
+ type: Component,
353
+ args: [{ selector: 'onshore-form-validation-output', imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<small class=\"onshore-color-danger\"\n *ngIf=\"validationTranslation\"\n [innerHTML]=\"validationTranslation\">\n</small>\n" }]
354
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1.TranslateService }], propDecorators: { validationErrors: [{
355
+ type: Input
356
+ }], validationItems: [{
357
+ type: Input
358
+ }] } });
359
+
360
+ class OnshoreFormItemContainer {
361
+ cdr;
362
+ formTemplate;
363
+ ngControl;
364
+ actionButtonDisabled = false;
365
+ actionButtonClick = new EventEmitter();
366
+ lockIsChanged = new EventEmitter();
367
+ formContainer;
368
+ disabled = false;
369
+ tempLockValue;
370
+ OnshoreFormTemplateLayout = OnshoreFormTemplateLayout;
371
+ layout = OnshoreFormTemplateLayout.auto;
372
+ enabled(enable = true) {
373
+ setTimeout(() => {
374
+ if (enable) {
375
+ this.ngControl?.control?.enable();
376
+ }
377
+ else {
378
+ this.ngControl?.control?.disable();
379
+ }
380
+ this.disabled = !enable;
381
+ this.cdr.markForCheck();
382
+ }, 100);
383
+ }
384
+ lockChanged(unlocked) {
385
+ if (unlocked && this.formTemplate.enabled) {
386
+ this.tempLockValue = this.ngControl?.control?.value;
387
+ this.enabled(true);
388
+ this.disabled = false;
389
+ this.lockIsChanged.emit(unlocked);
390
+ }
391
+ else {
392
+ this.enabled(false);
393
+ this.disabled = true;
394
+ this.ngControl?.control?.setValue(this.tempLockValue);
395
+ this.tempLockValue = null;
396
+ this.lockIsChanged.emit(unlocked);
397
+ }
398
+ this.cdr.markForCheck();
399
+ }
400
+ onWindowResize() {
401
+ const conatinerWidth = this.formContainer?.nativeElement.offsetWidth;
402
+ if (conatinerWidth > 500 && this.formTemplate.layout === OnshoreFormTemplateLayout.auto && this.layout !== OnshoreFormTemplateLayout.horizontal) {
403
+ this.layout = OnshoreFormTemplateLayout.horizontal;
404
+ this.cdr.markForCheck();
405
+ }
406
+ if (conatinerWidth <= 500 && this.formTemplate.layout === OnshoreFormTemplateLayout.auto && this.layout !== OnshoreFormTemplateLayout.vertical) {
407
+ this.layout = OnshoreFormTemplateLayout.vertical;
408
+ this.cdr.markForCheck();
409
+ }
410
+ }
411
+ ngOnInit() {
412
+ this.ngControl?.control?.valueChanges.subscribe(value => {
413
+ this.cdr.markForCheck();
414
+ });
415
+ this.ngControl?.control?.statusChanges.subscribe(status => {
416
+ this.cdr.markForCheck();
417
+ });
418
+ this.enabled(this.formTemplate.enabled);
419
+ this.disabled = !this.formTemplate.enabled;
420
+ if (this.formTemplate.locked) {
421
+ this.enabled(false);
422
+ this.disabled = true;
423
+ }
424
+ this.layout = this.formTemplate.layout;
425
+ setTimeout(() => {
426
+ this.cdr.markForCheck();
427
+ }, 100);
428
+ }
429
+ ngAfterViewInit() {
430
+ this.onWindowResize();
431
+ }
432
+ ngOnChanges(changes) {
433
+ const previousValue = changes['formTemplate']?.previousValue;
434
+ const currentValue = changes['formTemplate']?.currentValue;
435
+ if (currentValue) {
436
+ if (previousValue?.enabled !== currentValue?.enabled) {
437
+ this.enabled(currentValue?.enabled);
438
+ this.disabled = !currentValue?.enabled;
439
+ }
440
+ if (previousValue?.locked !== currentValue?.locked) {
441
+ if (currentValue.locked) {
442
+ this.enabled(false);
443
+ this.disabled = true;
444
+ }
445
+ else {
446
+ this.enabled(currentValue.enabled);
447
+ this.disabled = currentValue.enabled;
448
+ }
449
+ }
450
+ if (previousValue?.layout !== currentValue?.layout) {
451
+ this.layout = this.formTemplate.layout;
452
+ this.onWindowResize();
453
+ }
454
+ if (previousValue?.labelStyle !== currentValue?.labelStyle) {
455
+ this.onWindowResize();
456
+ }
457
+ this.cdr.markForCheck();
458
+ }
459
+ }
460
+ constructor(cdr) {
461
+ this.cdr = cdr;
462
+ }
463
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormItemContainer, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
464
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: OnshoreFormItemContainer, isStandalone: true, selector: "onshore-form-item-container", inputs: { formTemplate: "formTemplate", ngControl: "ngControl", actionButtonDisabled: "actionButtonDisabled" }, outputs: { actionButtonClick: "actionButtonClick", lockIsChanged: "lockIsChanged" }, host: { listeners: { "window:resize": "onWindowResize($event)" } }, viewQueries: [{ propertyName: "formContainer", first: true, predicate: ["formContainer"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div [class.mb-4]=\"!formTemplate.noGap\" #formContainer>\n <div class=\"flex w-full\"\n [class.flex-column]=\"layout == OnshoreFormTemplateLayout.vertical\"\n [class.flex-row]=\"layout == OnshoreFormTemplateLayout.horizontal\"\n [class.justify-content-between]=\"layout == OnshoreFormTemplateLayout.horizontal\">\n\n <div #formLabel\n [hidden]=\"!formTemplate.label || formTemplate.label == ''\"\n class=\"flex justify-content-between\"\n [style]=\"formTemplate.labelStyle ?? 'min-width: 200px; max-height: 36px'\">\n\n <span *ngIf=\"formTemplate.label && formTemplate.label != ''\" [class.mr-2]=\"layout == OnshoreFormTemplateLayout.horizontal\"\n [class.align-self-center]=\"layout == OnshoreFormTemplateLayout.horizontal\"\n [class.mb-2]=\"layout == OnshoreFormTemplateLayout.vertical\">\n {{formTemplate.label}}\n <small *ngIf=\"formTemplate.required\" class=\"onshore-color-danger\">*</small>\n </span>\n\n <div *ngIf=\"formTemplate.tooltip && layout == OnshoreFormTemplateLayout.vertical\" [pTooltip]=\"formTemplate.tooltip\" [escape]=\"false\" [tooltipPosition]=\"'left'\" appendTo=\"body\"><i class=\"fa fa-circle-question onshore-color-gray-5\"></i></div>\n\n </div>\n\n <div class=\"flex w-full\">\n <p-toggleButton\n *ngIf=\"formTemplate.locked\"\n (onChange)=\"lockChanged($event.checked)\"\n onIcon=\"fa fa-lock-open\"\n offIcon=\"fa fa-lock\"\n class=\"mr-2\"\n [disabled]=\"!formTemplate.enabled\">\n </p-toggleButton>\n\n <div class=\"w-full overflow-hidden align-self-center\">\n <ng-content></ng-content>\n </div>\n\n <button *ngIf=\"formTemplate.actionButton\"\n class=\"ml-2 onshore-button-light\"\n [style]=\"{'height': '37px', 'min-width': '38px'}\"\n pButton\n [disabled]=\"actionButtonDisabled\"\n [icon]=\"formTemplate.actionButtonIcon\"\n (click)=\"actionButtonClick.emit()\">\n </button>\n </div>\n\n <div *ngIf=\"formTemplate.tooltip && layout == OnshoreFormTemplateLayout.horizontal\" class=\"ml-2 align-self-center\" [pTooltip]=\"formTemplate.tooltip\" [tooltipPosition]=\"'left'\" [escape]=\"false\"><i class=\"fa fa-circle-question onshore-color-gray-5\"></i></div>\n </div>\n\n <div *ngIf=\"ngControl.control.touched || ngControl.control.dirty\" [style]=\"{'margin-left': layout == OnshoreFormTemplateLayout.horizontal ? (formLabel?.clientWidth + (formTemplate.locked ? 60 : 0)) + 'px' : (formTemplate.locked ? 60 : 0) + 'px', 'margin-right': formTemplate.tooltip && layout == OnshoreFormTemplateLayout.horizontal ? '16px' : '0px'}\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control.errors\">\n </onshore-form-validation-output>\n </div>\n\n <div *ngIf=\"formTemplate.description\" class=\"mt-2\" [style]=\"{'margin-left': layout == OnshoreFormTemplateLayout.horizontal ? (formLabel?.clientWidth + (formTemplate.locked ? 60 : 0)) + 'px' : (formTemplate.locked ? 60 : 0) + 'px', 'margin-right': formTemplate.tooltip && layout == OnshoreFormTemplateLayout.horizontal ? '16px' : '0px'}\">\n <small class=\"onshore-color-gray-5\"><i class=\"fa fa-info-circle\"></i> {{formTemplate.description}}</small>\n </div>\n\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: OnshoreFormValidationOutputComponent, selector: "onshore-form-validation-output", inputs: ["validationErrors", "validationItems"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: ToggleButtonModule }, { kind: "component", type: i2.ToggleButton, selector: "p-toggleButton, p-togglebutton, p-toggle-button", inputs: ["onLabel", "offLabel", "onIcon", "offIcon", "ariaLabel", "ariaLabelledBy", "disabled", "style", "styleClass", "inputId", "tabindex", "size", "iconPos", "autofocus", "allowEmpty"], outputs: ["onChange"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i3.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
465
+ }
466
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormItemContainer, decorators: [{
467
+ type: Component,
468
+ args: [{ selector: 'onshore-form-item-container', imports: [CommonModule, OnshoreFormValidationOutputComponent, TranslateModule, ToggleButtonModule, TooltipModule, ButtonModule], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<div [class.mb-4]=\"!formTemplate.noGap\" #formContainer>\n <div class=\"flex w-full\"\n [class.flex-column]=\"layout == OnshoreFormTemplateLayout.vertical\"\n [class.flex-row]=\"layout == OnshoreFormTemplateLayout.horizontal\"\n [class.justify-content-between]=\"layout == OnshoreFormTemplateLayout.horizontal\">\n\n <div #formLabel\n [hidden]=\"!formTemplate.label || formTemplate.label == ''\"\n class=\"flex justify-content-between\"\n [style]=\"formTemplate.labelStyle ?? 'min-width: 200px; max-height: 36px'\">\n\n <span *ngIf=\"formTemplate.label && formTemplate.label != ''\" [class.mr-2]=\"layout == OnshoreFormTemplateLayout.horizontal\"\n [class.align-self-center]=\"layout == OnshoreFormTemplateLayout.horizontal\"\n [class.mb-2]=\"layout == OnshoreFormTemplateLayout.vertical\">\n {{formTemplate.label}}\n <small *ngIf=\"formTemplate.required\" class=\"onshore-color-danger\">*</small>\n </span>\n\n <div *ngIf=\"formTemplate.tooltip && layout == OnshoreFormTemplateLayout.vertical\" [pTooltip]=\"formTemplate.tooltip\" [escape]=\"false\" [tooltipPosition]=\"'left'\" appendTo=\"body\"><i class=\"fa fa-circle-question onshore-color-gray-5\"></i></div>\n\n </div>\n\n <div class=\"flex w-full\">\n <p-toggleButton\n *ngIf=\"formTemplate.locked\"\n (onChange)=\"lockChanged($event.checked)\"\n onIcon=\"fa fa-lock-open\"\n offIcon=\"fa fa-lock\"\n class=\"mr-2\"\n [disabled]=\"!formTemplate.enabled\">\n </p-toggleButton>\n\n <div class=\"w-full overflow-hidden align-self-center\">\n <ng-content></ng-content>\n </div>\n\n <button *ngIf=\"formTemplate.actionButton\"\n class=\"ml-2 onshore-button-light\"\n [style]=\"{'height': '37px', 'min-width': '38px'}\"\n pButton\n [disabled]=\"actionButtonDisabled\"\n [icon]=\"formTemplate.actionButtonIcon\"\n (click)=\"actionButtonClick.emit()\">\n </button>\n </div>\n\n <div *ngIf=\"formTemplate.tooltip && layout == OnshoreFormTemplateLayout.horizontal\" class=\"ml-2 align-self-center\" [pTooltip]=\"formTemplate.tooltip\" [tooltipPosition]=\"'left'\" [escape]=\"false\"><i class=\"fa fa-circle-question onshore-color-gray-5\"></i></div>\n </div>\n\n <div *ngIf=\"ngControl.control.touched || ngControl.control.dirty\" [style]=\"{'margin-left': layout == OnshoreFormTemplateLayout.horizontal ? (formLabel?.clientWidth + (formTemplate.locked ? 60 : 0)) + 'px' : (formTemplate.locked ? 60 : 0) + 'px', 'margin-right': formTemplate.tooltip && layout == OnshoreFormTemplateLayout.horizontal ? '16px' : '0px'}\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control.errors\">\n </onshore-form-validation-output>\n </div>\n\n <div *ngIf=\"formTemplate.description\" class=\"mt-2\" [style]=\"{'margin-left': layout == OnshoreFormTemplateLayout.horizontal ? (formLabel?.clientWidth + (formTemplate.locked ? 60 : 0)) + 'px' : (formTemplate.locked ? 60 : 0) + 'px', 'margin-right': formTemplate.tooltip && layout == OnshoreFormTemplateLayout.horizontal ? '16px' : '0px'}\">\n <small class=\"onshore-color-gray-5\"><i class=\"fa fa-info-circle\"></i> {{formTemplate.description}}</small>\n </div>\n\n</div>\n" }]
469
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { formTemplate: [{
470
+ type: Input
471
+ }], ngControl: [{
472
+ type: Input
473
+ }], actionButtonDisabled: [{
474
+ type: Input
475
+ }], actionButtonClick: [{
476
+ type: Output
477
+ }], lockIsChanged: [{
478
+ type: Output
479
+ }], formContainer: [{
480
+ type: ViewChild,
481
+ args: ['formContainer']
482
+ }], onWindowResize: [{
483
+ type: HostListener,
484
+ args: ['window:resize', ['$event']]
485
+ }] } });
486
+
487
+ class OnshoreFormAutocompleteItemComponent {
488
+ cdr;
489
+ ngControl;
490
+ formTemplate;
491
+ multiple = false;
492
+ searchedData = [];
493
+ actionButtonDisabled = false;
494
+ onSearch = new EventEmitter();
495
+ onSelect = new EventEmitter();
496
+ onClear = new EventEmitter();
497
+ actionButtonClick = new EventEmitter();
498
+ disabled = false;
499
+ selected(event) {
500
+ const selectedItem = event.value;
501
+ this.onSelect.emit(selectedItem.data);
502
+ this.cdr.markForCheck();
503
+ }
504
+ searchClear() {
505
+ this.searchedData = [];
506
+ this.ngControl.reset();
507
+ this.onClear.emit();
508
+ }
509
+ searchPrepare(term) {
510
+ if (term.query != '') {
511
+ this.search(term.query);
512
+ }
513
+ else {
514
+ this.searchedData = [];
515
+ this.ngControl.reset();
516
+ this.onClear.emit();
517
+ }
518
+ }
519
+ async search(searchTerm) {
520
+ this.onSearch.emit(searchTerm);
521
+ this.cdr.markForCheck();
522
+ }
523
+ writeValue(obj) {
524
+ if (obj) {
525
+ this.cdr.markForCheck();
526
+ }
527
+ }
528
+ registerOnChange(fn) {
529
+ if (this.ngControl.value) {
530
+ this.cdr.markForCheck();
531
+ }
532
+ }
533
+ registerOnTouched(fn) { }
534
+ setDisabledState(isDisabled) {
535
+ this.disabled = isDisabled;
536
+ }
537
+ ngOnInit() {
538
+ if (this.ngControl.control?.value == '' && this.formTemplate.default != undefined) {
539
+ this.ngControl.control?.setValue(this.formTemplate.default);
540
+ this.cdr.markForCheck();
541
+ }
542
+ }
543
+ get formControl() {
544
+ return this.ngControl.control;
545
+ }
546
+ ngOnDestroy() {
547
+ this.ngControl.control?.disable();
548
+ }
549
+ ngOnChanges(changes) {
550
+ this.cdr.markForCheck();
551
+ }
552
+ constructor(cdr, ngControl) {
553
+ this.cdr = cdr;
554
+ this.ngControl = ngControl;
555
+ this.ngControl.valueAccessor = this;
556
+ }
557
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormAutocompleteItemComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$2.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
558
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: OnshoreFormAutocompleteItemComponent, isStandalone: true, selector: "onshore-form-autocomplete-item", inputs: { formTemplate: "formTemplate", multiple: "multiple", searchedData: "searchedData", actionButtonDisabled: "actionButtonDisabled" }, outputs: { onSearch: "onSearch", onSelect: "onSelect", onClear: "onClear", actionButtonClick: "actionButtonClick" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\">\n <p-autoComplete [placeholder]=\"formTemplate.placeholder\"\n appendTo=\"body\"\n [formControl]=\"formControl\"\n (onSelect)=\"selected($event)\"\n (onUnselect)=\"selected($event)\"\n (onClear)=\"searchClear()\"\n [suggestions]=\"searchedData\"\n (completeMethod)=\"searchPrepare($event)\"\n [disabled]=\"disabled\"\n size=\"small\"\n [minLength]=\"2\"\n [multiple]=\"multiple\"\n [delay]=\"1000\"\n [unique]=\"true\"\n field=\"firstLineLabel\"\n dataKey=\"data\"\n class=\"w-full\">\n <ng-template let-item pTemplate=\"item\">\n <div *ngIf=\"item.firstLineLabel\">\n <span class=\"mr-1\">\n <b>{{item.firstLineLabel}}</b><br>\n </span>\n </div>\n <div *ngIf=\"item.secondLineLabel\"><span>{{item.secondLineLabel}} </span></div>\n <div *ngIf=\"item.thirdLineLabel\"><span>{{item.thirdLineLabel}} </span></div>\n </ng-template>\n </p-autoComplete>\n</onshore-form-item-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl", "actionButtonDisabled"], outputs: ["actionButtonClick", "lockIsChanged"] }, { kind: "ngmodule", type: AutoCompleteModule }, { kind: "component", type: i3$2.AutoComplete, selector: "p-autoComplete, p-autocomplete, p-auto-complete", inputs: ["minLength", "delay", "style", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "disabled", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "maxlength", "name", "required", "size", "appendTo", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "showClear", "field", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "overlayOptions", "suggestions", "itemSize", "optionLabel", "optionValue", "id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "selectOnFocus", "searchLocale", "optionDisabled", "focusOnHover", "typeahead", "variant", "fluid"], outputs: ["completeMethod", "onSelect", "onUnselect", "onFocus", "onBlur", "onDropdownClick", "onClear", "onKeyUp", "onShow", "onHide", "onLazyLoad"] }, { kind: "directive", type: i4.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
559
+ }
560
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormAutocompleteItemComponent, decorators: [{
561
+ type: Component,
562
+ args: [{ selector: 'onshore-form-autocomplete-item', imports: [CommonModule, OnshoreFormItemContainer, AutoCompleteModule, FormsModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\">\n <p-autoComplete [placeholder]=\"formTemplate.placeholder\"\n appendTo=\"body\"\n [formControl]=\"formControl\"\n (onSelect)=\"selected($event)\"\n (onUnselect)=\"selected($event)\"\n (onClear)=\"searchClear()\"\n [suggestions]=\"searchedData\"\n (completeMethod)=\"searchPrepare($event)\"\n [disabled]=\"disabled\"\n size=\"small\"\n [minLength]=\"2\"\n [multiple]=\"multiple\"\n [delay]=\"1000\"\n [unique]=\"true\"\n field=\"firstLineLabel\"\n dataKey=\"data\"\n class=\"w-full\">\n <ng-template let-item pTemplate=\"item\">\n <div *ngIf=\"item.firstLineLabel\">\n <span class=\"mr-1\">\n <b>{{item.firstLineLabel}}</b><br>\n </span>\n </div>\n <div *ngIf=\"item.secondLineLabel\"><span>{{item.secondLineLabel}} </span></div>\n <div *ngIf=\"item.thirdLineLabel\"><span>{{item.thirdLineLabel}} </span></div>\n </ng-template>\n </p-autoComplete>\n</onshore-form-item-container>\n" }]
563
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$2.NgControl, decorators: [{
564
+ type: Self
565
+ }, {
566
+ type: Optional
567
+ }] }], propDecorators: { formTemplate: [{
568
+ type: Input
569
+ }], multiple: [{
570
+ type: Input
571
+ }], searchedData: [{
572
+ type: Input
573
+ }], actionButtonDisabled: [{
574
+ type: Input
575
+ }], onSearch: [{
576
+ type: Output
577
+ }], onSelect: [{
578
+ type: Output
579
+ }], onClear: [{
580
+ type: Output
581
+ }], actionButtonClick: [{
582
+ type: Output
583
+ }] } });
584
+
585
+ class OnshoreFormCheckboxItemComponent {
586
+ ngControl;
587
+ cdr;
588
+ formTemplate;
589
+ actionButtonDisabled = false;
590
+ actionButtonClick = new EventEmitter();
591
+ disabled = false;
592
+ // ControlValueAccessor interface
593
+ writeValue(obj) { }
594
+ registerOnChange(fn) { }
595
+ registerOnTouched(fn) { }
596
+ setDisabledState(isDisabled) {
597
+ this.disabled = isDisabled;
598
+ }
599
+ changeCheck(value) {
600
+ this.ngControl.control?.setValue(value.checked);
601
+ }
602
+ get formControl() {
603
+ return this.ngControl.control;
604
+ }
605
+ ngOnInit() {
606
+ if (this.ngControl.control?.value !== true && this.ngControl.control?.value !== false && this.formTemplate.default != undefined) {
607
+ this.ngControl.control?.setValue(this.formTemplate.default);
608
+ this.cdr.markForCheck();
609
+ }
610
+ }
611
+ ngOnChanges(changes) {
612
+ this.cdr.markForCheck();
613
+ }
614
+ ngOnDestroy() {
615
+ this.ngControl.control?.disable();
616
+ }
617
+ constructor(ngControl, cdr) {
618
+ this.ngControl = ngControl;
619
+ this.cdr = cdr;
620
+ this.ngControl.valueAccessor = this;
621
+ }
622
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormCheckboxItemComponent, deps: [{ token: i1$2.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
623
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: OnshoreFormCheckboxItemComponent, isStandalone: true, selector: "onshore-form-checkbox-item", inputs: { formTemplate: "formTemplate", actionButtonDisabled: "actionButtonDisabled" }, outputs: { actionButtonClick: "actionButtonClick" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\">\n\n <div class=\"p-field-checkbox flex\">\n <p-checkbox\n class=\"align-self-start mt-1\"\n [name]=\"formTemplate.name\"\n [formControl]=\"formControl\"\n [binary]=\"true\"\n [disabled]=\"disabled\"\n [inputId]=\"formTemplate.name\"\n [value]=\"ngControl.control.value\"\n (onChange)=\"changeCheck($event)\">\n </p-checkbox>\n\n <label class=\"mb-0 ml-2 onshore-color-gray-5\"\n [for]=\"formTemplate.name\">\n {{formTemplate.description}}\n </label>\n </div>\n\n</onshore-form-item-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl", "actionButtonDisabled"], outputs: ["actionButtonClick", "lockIsChanged"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i2$1.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
624
+ }
625
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormCheckboxItemComponent, decorators: [{
626
+ type: Component,
627
+ args: [{ selector: 'onshore-form-checkbox-item', imports: [CommonModule, OnshoreFormItemContainer, CheckboxModule, FormsModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\">\n\n <div class=\"p-field-checkbox flex\">\n <p-checkbox\n class=\"align-self-start mt-1\"\n [name]=\"formTemplate.name\"\n [formControl]=\"formControl\"\n [binary]=\"true\"\n [disabled]=\"disabled\"\n [inputId]=\"formTemplate.name\"\n [value]=\"ngControl.control.value\"\n (onChange)=\"changeCheck($event)\">\n </p-checkbox>\n\n <label class=\"mb-0 ml-2 onshore-color-gray-5\"\n [for]=\"formTemplate.name\">\n {{formTemplate.description}}\n </label>\n </div>\n\n</onshore-form-item-container>\n" }]
628
+ }], ctorParameters: () => [{ type: i1$2.NgControl, decorators: [{
629
+ type: Self
630
+ }, {
631
+ type: Optional
632
+ }] }, { type: i0.ChangeDetectorRef }], propDecorators: { formTemplate: [{
633
+ type: Input
634
+ }], actionButtonDisabled: [{
635
+ type: Input
636
+ }], actionButtonClick: [{
637
+ type: Output
638
+ }] } });
639
+
640
+ class OnshoreFormColorpickerItemComponent {
641
+ ngControl;
642
+ cdr;
643
+ formTemplate;
644
+ actionButtonDisabled = false;
645
+ actionButtonClick = new EventEmitter();
646
+ disabled = false;
647
+ colorPickerValue = '';
648
+ // ControlValueAccessor interface
649
+ writeValue(obj) { }
650
+ registerOnChange(fn) { }
651
+ registerOnTouched(fn) { }
652
+ setDisabledState(isDisabled) {
653
+ this.disabled = isDisabled;
654
+ }
655
+ changeColor() {
656
+ this.ngControl.control?.setValue(this.colorPickerValue);
657
+ this.ngControl?.control?.markAsDirty();
658
+ this.cdr.markForCheck();
659
+ }
660
+ changeInput(input) {
661
+ this.colorPickerValue = input.target?.value;
662
+ }
663
+ get formControl() {
664
+ return this.ngControl.control;
665
+ }
666
+ ngOnInit() {
667
+ if (this.ngControl.control?.value == '' && this.formTemplate.default != undefined) {
668
+ this.ngControl.control?.setValue(this.formTemplate.default);
669
+ this.colorPickerValue = this.formTemplate.default;
670
+ this.cdr.markForCheck();
671
+ }
672
+ }
673
+ ngOnDestroy() {
674
+ this.ngControl.control?.disable();
675
+ }
676
+ ngOnChanges(changes) {
677
+ this.colorPickerValue = this.ngControl.control?.value;
678
+ this.cdr.markForCheck();
679
+ }
680
+ constructor(ngControl, cdr) {
681
+ this.ngControl = ngControl;
682
+ this.cdr = cdr;
683
+ this.ngControl.valueAccessor = this;
684
+ }
685
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormColorpickerItemComponent, deps: [{ token: i1$2.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
686
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: OnshoreFormColorpickerItemComponent, isStandalone: true, selector: "onshore-form-colorpicker-item", inputs: { formTemplate: "formTemplate", actionButtonDisabled: "actionButtonDisabled" }, outputs: { actionButtonClick: "actionButtonClick" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\">\n <div class=\"flex w-full\">\n\n <input class=\"w-full mr-2\"\n type=\"text\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n [formControl]=\"formControl\"\n [disabled]=\"disabled\"\n pInputText\n [value]=\"ngControl.control.value\"\n (input)=\"changeInput($event)\"/>\n\n <p-colorPicker [(ngModel)]=\"colorPickerValue\"\n format=\"hex\" [inline]=\"false\"\n appendTo=\"body\"\n [disabled]=\"disabled\"\n [baseZIndex]=\"99999\"\n (onChange)=\"changeColor()\">\n </p-colorPicker>\n </div>\n</onshore-form-item-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl", "actionButtonDisabled"], outputs: ["actionButtonClick", "lockIsChanged"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i2$2.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "ngmodule", type: ColorPickerModule }, { kind: "component", type: i3$3.ColorPicker, selector: "p-colorPicker, p-colorpicker, p-color-picker", inputs: ["style", "styleClass", "inline", "format", "appendTo", "disabled", "tabindex", "inputId", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "autofocus"], outputs: ["onChange", "onShow", "onHide"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
687
+ }
688
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormColorpickerItemComponent, decorators: [{
689
+ type: Component,
690
+ args: [{ selector: 'onshore-form-colorpicker-item', imports: [CommonModule, OnshoreFormItemContainer, InputTextModule, ColorPickerModule, FormsModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\">\n <div class=\"flex w-full\">\n\n <input class=\"w-full mr-2\"\n type=\"text\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n [formControl]=\"formControl\"\n [disabled]=\"disabled\"\n pInputText\n [value]=\"ngControl.control.value\"\n (input)=\"changeInput($event)\"/>\n\n <p-colorPicker [(ngModel)]=\"colorPickerValue\"\n format=\"hex\" [inline]=\"false\"\n appendTo=\"body\"\n [disabled]=\"disabled\"\n [baseZIndex]=\"99999\"\n (onChange)=\"changeColor()\">\n </p-colorPicker>\n </div>\n</onshore-form-item-container>\n" }]
691
+ }], ctorParameters: () => [{ type: i1$2.NgControl, decorators: [{
692
+ type: Self
693
+ }, {
694
+ type: Optional
695
+ }] }, { type: i0.ChangeDetectorRef }], propDecorators: { formTemplate: [{
696
+ type: Input
697
+ }], actionButtonDisabled: [{
698
+ type: Input
699
+ }], actionButtonClick: [{
700
+ type: Output
701
+ }] } });
702
+
703
+ class OnshoreFormDropdownItemComponent {
704
+ ngControl;
705
+ cdr;
706
+ formTemplate;
707
+ multiple = false;
708
+ showClear = false;
709
+ group = false;
710
+ selectionLimit = 0;
711
+ minLength = 0;
712
+ optionLabel = '';
713
+ optionGroupLabel = '';
714
+ dataKey = '';
715
+ actionButtonDisabled = false;
716
+ options = [];
717
+ valueChange = new EventEmitter();
718
+ actionButtonClick = new EventEmitter();
719
+ disabled = false;
720
+ // ControlValueAccessor interface
721
+ writeValue(obj) {
722
+ if (obj) {
723
+ this.cdr.markForCheck();
724
+ }
725
+ }
726
+ registerOnChange(fn) {
727
+ if (this.ngControl.value) {
728
+ this.cdr.markForCheck();
729
+ }
730
+ }
731
+ registerOnTouched(fn) { }
732
+ setDisabledState(isDisabled) {
733
+ this.disabled = isDisabled;
734
+ }
735
+ clearSelection() {
736
+ this.ngControl.control?.reset();
737
+ this.ngControl.control?.setValue(this.multiple ? [] : '');
738
+ this.cdr.markForCheck();
739
+ }
740
+ get formControl() {
741
+ return this.ngControl.control;
742
+ }
743
+ ngOnInit() {
744
+ if ((!this.ngControl.control?.value || this.ngControl.control?.value == '' || this.ngControl.control?.value == undefined) && !this.multiple) {
745
+ this.ngControl.control?.setValue(this.formTemplate.default);
746
+ this.cdr.markForCheck();
747
+ }
748
+ }
749
+ ngOnDestroy() {
750
+ this.ngControl.control?.disable();
751
+ }
752
+ ngOnChanges(changes) {
753
+ const currentOptions = changes['options']?.currentValue ?? changes['formTemplate']?.currentValue?.options;
754
+ //const previousOptions = changes['options']?.previousValue ?? changes['formTemplate']?.previousValue?.options;
755
+ if (!this.options && currentOptions) {
756
+ this.options = currentOptions;
757
+ }
758
+ this.cdr.markForCheck();
759
+ }
760
+ constructor(ngControl, cdr) {
761
+ this.ngControl = ngControl;
762
+ this.cdr = cdr;
763
+ this.ngControl.valueAccessor = this;
764
+ }
765
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormDropdownItemComponent, deps: [{ token: i1$2.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
766
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: OnshoreFormDropdownItemComponent, isStandalone: true, selector: "onshore-form-dropdown-item", inputs: { formTemplate: "formTemplate", multiple: "multiple", showClear: "showClear", group: "group", selectionLimit: "selectionLimit", minLength: "minLength", optionLabel: "optionLabel", optionGroupLabel: "optionGroupLabel", dataKey: "dataKey", actionButtonDisabled: "actionButtonDisabled", options: "options" }, outputs: { valueChange: "valueChange", actionButtonClick: "actionButtonClick" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\">\n\n <p-dropdown *ngIf=\"!multiple\"\n class=\"w-full\"\n [options]=\"options\"\n [formControl]=\"formControl\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [optionLabel]=\"optionLabel\"\n [dataKey]=\"dataKey\"\n [optionGroupLabel]=\"optionGroupLabel\"\n [group]=\"group\"\n [showClear]=\"showClear && formTemplate?.placeholder\"\n (onClear)=\"clearSelection()\"\n optionDisabled=\"disabled\"\n appendTo=\"body\">\n </p-dropdown>\n\n <p-multiSelect *ngIf=\"multiple\"\n class=\"w-full\"\n [options]=\"options\"\n [formControl]=\"formControl\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [showClear]=\"showClear\"\n [selectionLimit]=\"selectionLimit\"\n [minlength]=\"minLength\"\n [optionLabel]=\"optionLabel\"\n [dataKey]=\"dataKey\"\n [optionGroupLabel]=\"optionGroupLabel\"\n [group]=\"group\"\n (onClear)=\"clearSelection()\"\n [selectedItemsLabel]=\"'form.dropdownControl.selectedItems' | translate\"\n optionDisabled=\"disabled\"\n appendTo=\"body\"></p-multiSelect>\n\n</onshore-form-item-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl", "actionButtonDisabled"], outputs: ["actionButtonClick", "lockIsChanged"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: DropdownModule }, { kind: "component", type: i4$1.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "fluid", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i5.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "fluid", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "variant", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "size", "showClear", "autofocus", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
767
+ }
768
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormDropdownItemComponent, decorators: [{
769
+ type: Component,
770
+ args: [{ selector: 'onshore-form-dropdown-item', imports: [CommonModule, OnshoreFormItemContainer, TranslateModule, DropdownModule, MultiSelectModule, FormsModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\">\n\n <p-dropdown *ngIf=\"!multiple\"\n class=\"w-full\"\n [options]=\"options\"\n [formControl]=\"formControl\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [optionLabel]=\"optionLabel\"\n [dataKey]=\"dataKey\"\n [optionGroupLabel]=\"optionGroupLabel\"\n [group]=\"group\"\n [showClear]=\"showClear && formTemplate?.placeholder\"\n (onClear)=\"clearSelection()\"\n optionDisabled=\"disabled\"\n appendTo=\"body\">\n </p-dropdown>\n\n <p-multiSelect *ngIf=\"multiple\"\n class=\"w-full\"\n [options]=\"options\"\n [formControl]=\"formControl\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [showClear]=\"showClear\"\n [selectionLimit]=\"selectionLimit\"\n [minlength]=\"minLength\"\n [optionLabel]=\"optionLabel\"\n [dataKey]=\"dataKey\"\n [optionGroupLabel]=\"optionGroupLabel\"\n [group]=\"group\"\n (onClear)=\"clearSelection()\"\n [selectedItemsLabel]=\"'form.dropdownControl.selectedItems' | translate\"\n optionDisabled=\"disabled\"\n appendTo=\"body\"></p-multiSelect>\n\n</onshore-form-item-container>\n" }]
771
+ }], ctorParameters: () => [{ type: i1$2.NgControl, decorators: [{
772
+ type: Self
773
+ }, {
774
+ type: Optional
775
+ }] }, { type: i0.ChangeDetectorRef }], propDecorators: { formTemplate: [{
776
+ type: Input
777
+ }], multiple: [{
778
+ type: Input
779
+ }], showClear: [{
780
+ type: Input
781
+ }], group: [{
782
+ type: Input
783
+ }], selectionLimit: [{
784
+ type: Input
785
+ }], minLength: [{
786
+ type: Input
787
+ }], optionLabel: [{
788
+ type: Input
789
+ }], optionGroupLabel: [{
790
+ type: Input
791
+ }], dataKey: [{
792
+ type: Input
793
+ }], actionButtonDisabled: [{
794
+ type: Input
795
+ }], options: [{
796
+ type: Input
797
+ }], valueChange: [{
798
+ type: Output
799
+ }], actionButtonClick: [{
800
+ type: Output
801
+ }] } });
802
+
803
+ class OnshoreImagePlaceholderComponent {
804
+ placeholderIcon = '';
805
+ placeholderImage = '';
806
+ image = '';
807
+ imageStyle = '';
808
+ placeholderStyle = '';
809
+ showLoader = true;
810
+ imageLoaded = false;
811
+ loadReady() {
812
+ this.imageLoaded = true;
813
+ this.showLoader = false;
814
+ }
815
+ abort() {
816
+ this.imageLoaded = false;
817
+ this.showLoader = false;
818
+ }
819
+ constructor() { }
820
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreImagePlaceholderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
821
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: OnshoreImagePlaceholderComponent, isStandalone: true, selector: "onshore-image-placeholder", inputs: { placeholderIcon: "placeholderIcon", placeholderImage: "placeholderImage", image: "image", imageStyle: "imageStyle", placeholderStyle: "placeholderStyle", showLoader: "showLoader" }, ngImport: i0, template: "<div [hidden]=\"!imageLoaded || !image\">\n <img [style]=\"imageStyle\" [src]=\"image\" (load)=\"loadReady()\" (abort)=\"abort()\" />\n</div>\n\n<div *ngIf=\"!imageLoaded || !image\" class=\"flex justify-content-center align-items-center\" [style]=\"placeholderStyle\" [class.bg-gray-200]=\"placeholderIcon\" [class.p-2]=\"placeholderIcon\">\n <i *ngIf=\"placeholderIcon\" [class]=\"'text-muted fa ' + placeholderIcon\" [class.opacity-20]=\"showLoader && image\"></i>\n <img *ngIf=\"placeholderImage\" [src]=\"placeholderImage\" [class.opacity-20]=\"showLoader && image\" class=\"h-full\" />\n <i *ngIf=\"showLoader && image\" class=\"fas fa-circle-notch fa-spin fa-2x absolute\"></i>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
822
+ }
823
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreImagePlaceholderComponent, decorators: [{
824
+ type: Component,
825
+ args: [{ selector: 'onshore-image-placeholder', imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<div [hidden]=\"!imageLoaded || !image\">\n <img [style]=\"imageStyle\" [src]=\"image\" (load)=\"loadReady()\" (abort)=\"abort()\" />\n</div>\n\n<div *ngIf=\"!imageLoaded || !image\" class=\"flex justify-content-center align-items-center\" [style]=\"placeholderStyle\" [class.bg-gray-200]=\"placeholderIcon\" [class.p-2]=\"placeholderIcon\">\n <i *ngIf=\"placeholderIcon\" [class]=\"'text-muted fa ' + placeholderIcon\" [class.opacity-20]=\"showLoader && image\"></i>\n <img *ngIf=\"placeholderImage\" [src]=\"placeholderImage\" [class.opacity-20]=\"showLoader && image\" class=\"h-full\" />\n <i *ngIf=\"showLoader && image\" class=\"fas fa-circle-notch fa-spin fa-2x absolute\"></i>\n</div>\n" }]
826
+ }], ctorParameters: () => [], propDecorators: { placeholderIcon: [{
827
+ type: Input
828
+ }], placeholderImage: [{
829
+ type: Input
830
+ }], image: [{
831
+ type: Input
832
+ }], imageStyle: [{
833
+ type: Input
834
+ }], placeholderStyle: [{
835
+ type: Input
836
+ }], showLoader: [{
837
+ type: Input
838
+ }] } });
839
+
840
+ class OnshoreImageChooserComponent {
841
+ cdr;
842
+ drag = false;
843
+ image = '';
844
+ finalImage = '';
845
+ imageErrorType = OnshoreImageError;
846
+ imageError = OnshoreImageError.none;
847
+ imageSettings = undefined;
848
+ choosen = new EventEmitter();
849
+ canceled = new EventEmitter();
850
+ clear() {
851
+ this.image = '';
852
+ this.finalImage = '';
853
+ this.imageError = OnshoreImageError.none;
854
+ }
855
+ fileChange(event) {
856
+ this.imageError = OnshoreImageError.none;
857
+ const target = event.target;
858
+ const file = target?.files ? target?.files[0] : null;
859
+ const maxFileSize = this.imageSettings?.maxFileSize || 0;
860
+ const imageWidth = this.imageSettings?.imageWidth || 0;
861
+ const imageHeight = this.imageSettings?.imageHeight || 0;
862
+ if (file?.type != 'image/png' && file?.type != 'image/jpeg' && file?.type != 'image/webp') {
863
+ this.imageError = OnshoreImageError.fileType;
864
+ return;
865
+ }
866
+ if (file?.size > maxFileSize) {
867
+ this.imageError = OnshoreImageError.size;
868
+ return;
869
+ }
870
+ if (file) {
871
+ const reader = new FileReader();
872
+ reader.readAsDataURL(file);
873
+ reader.onload = () => {
874
+ const img = new Image();
875
+ img.src = window.URL.createObjectURL(file);
876
+ img.onload = () => {
877
+ const originalWidth = img.width;
878
+ const originalHeight = img.height;
879
+ if (originalWidth >= imageWidth && originalHeight >= imageHeight) {
880
+ this.image = reader.result?.toString() || '';
881
+ }
882
+ else {
883
+ this.imageError = OnshoreImageError.ratio;
884
+ }
885
+ this.cdr.markForCheck();
886
+ };
887
+ };
888
+ }
889
+ }
890
+ imageCropped(event) {
891
+ // ToDo: Check needed base64 format
892
+ //this.finalImage = event.base64.split(',')[1];
893
+ this.finalImage = event.base64 || '';
894
+ }
895
+ imageCroppedReady() {
896
+ this.choosen.emit(this.finalImage);
897
+ this.clear();
898
+ }
899
+ constructor(cdr) {
900
+ this.cdr = cdr;
901
+ }
902
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreImageChooserComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
903
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: OnshoreImageChooserComponent, isStandalone: true, selector: "onshore-image-chooser", inputs: { imageSettings: "imageSettings" }, outputs: { choosen: "choosen", canceled: "canceled" }, ngImport: i0, template: "<div class=\"flex flex-column justify-content-center align-items-center w-full\">\n\n <div *ngIf=\"!image\" class=\"flex justify-content-center flex-column align-items-center w-full\">\n <div\n class=\"onshore-image-upload flex flex-column justify-content-between align-items-center rounded-lg p-4 relative m-3\"\n [class.onshore-border-gray-3]=\"drag\"\n [class.onshore-border-danger]=\"imageError != imageErrorType.none\">\n <i class=\"fa fa-image fa-5x onshore-color-gray-4\"></i>\n <small class=\"onshore-color-gray-4 mb-2\">{{'form.imageControl.dropImageLabel' | translate}}</small>\n\n <button pButton\n type=\"button\"\n icon=\"fa fa-file\"\n [label]=\"'form.imageControl.imageChooserFileButton' | translate\"\n class=\"onshore-button-primary mr-2\">\n </button>\n\n <input\n (change)=\"fileChange($event)\"\n *ngIf=\"!image\"\n accept=\"image/png, image/jpeg, image/webp\"\n class=\"onshore-image-input absolute w-full h-full\"\n type=\"file\"\n (dragenter)=\"drag = true\"\n (dragleave)=\"drag = false\"\n (dragend)=\"drag = false\"\n />\n </div>\n </div>\n\n <div class=\"flex flex-column relative align-items-center w-full\" *ngIf=\"image\">\n <image-cropper\n class=\"m-3\"\n [style]=\"'align-items: center; height: ' + (imageSettings.cropperPreviewHeight * this.imageSettings.aspectRatio) + 'px; width: ' + (imageSettings.cropperPreviewWidth * this.imageSettings.aspectRatio) + 'px'\"\n [class.onshore-cropper-circle]=\"this.imageSettings.circleCropper\"\n (imageCropped)=\"imageCropped($event)\"\n [imageBase64]=\"image\"\n [imageQuality]=\"this.imageSettings.imageQuality\"\n [alignImage]=\"this.imageSettings.alignImage\"\n [backgroundColor]=\"this.imageSettings.backgroundColor\"\n [containWithinAspectRatio]=\"this.imageSettings.containWithinAspectRatio\"\n [format]=\"this.imageSettings.format\"\n [aspectRatio]=\"this.imageSettings.aspectRatio\"\n [resizeToHeight]=\"this.imageSettings.imageWidth * this.imageSettings.aspectRatio\"\n [resizeToWidth]=\"this.imageSettings.imageHeight * this.imageSettings.aspectRatio\">\n </image-cropper>\n </div>\n\n <div *ngIf=\"imageError\"class=\"pb-2 text-wrap text-center onshore-color-danger\">\n <small *ngIf=\"imageError == imageErrorType.ratio\">{{'form.imageControl.imageErrorRatio' | translate: {resizeToWidth: this.imageSettings.imageWidth, resizeToHeight: this.imageSettings.imageHeight} }}</small>\n <small *ngIf=\"imageError == imageErrorType.fileType\">{{'form.imageControl.imageErrorFileType' | translate}}</small>\n <small *ngIf=\"imageError == imageErrorType.size\">{{'form.imageControl.imageErrorSize' | translate}}</small>\n </div>\n</div>\n\n\n<p-footer>\n <div class=\"flex justify-content-end align-items-center mt-2\">\n <button pButton\n type=\"button\"\n icon=\"fa fa-times\"\n [label]=\"'form.imageControl.imageChooserCancelButton' | translate\"\n class=\"onshore-button-light mr-2\"\n (click)=\"clear(); canceled.emit(true)\">\n </button>\n\n <button pButton\n type=\"button\"\n [label]=\"'form.imageControl.imageChooserSelectButton' | translate\"\n class=\"onshore-button-primary\"\n icon=\"fa fa-check\"\n [disabled]=\"!image\"\n (click)=\"imageCroppedReady()\">\n </button>\n </div>\n</p-footer>\n\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "component", type: i4.Footer, selector: "p-footer" }, { kind: "ngmodule", type: InputTextModule }, { kind: "component", type: ImageCropperComponent, selector: "image-cropper", inputs: ["imageChangedEvent", "imageURL", "imageBase64", "imageFile", "imageAltText", "options", "cropperFrameAriaLabel", "output", "format", "autoCrop", "cropper", "transform", "maintainAspectRatio", "aspectRatio", "resetCropOnAspectRatioChange", "resizeToWidth", "resizeToHeight", "cropperMinWidth", "cropperMinHeight", "cropperMaxHeight", "cropperMaxWidth", "cropperStaticWidth", "cropperStaticHeight", "canvasRotation", "initialStepSize", "roundCropper", "onlyScaleDown", "imageQuality", "backgroundColor", "containWithinAspectRatio", "hideResizeSquares", "allowMoveImage", "checkImageType", "alignImage", "disabled", "hidden"], outputs: ["imageCropped", "startCropImage", "imageLoaded", "cropperReady", "loadImageFailed", "transformChange", "cropperChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
904
+ }
905
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreImageChooserComponent, decorators: [{
906
+ type: Component,
907
+ args: [{ selector: 'onshore-image-chooser', imports: [CommonModule, TranslateModule, ButtonModule, InputTextModule, ImageCropperComponent, FormsModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<div class=\"flex flex-column justify-content-center align-items-center w-full\">\n\n <div *ngIf=\"!image\" class=\"flex justify-content-center flex-column align-items-center w-full\">\n <div\n class=\"onshore-image-upload flex flex-column justify-content-between align-items-center rounded-lg p-4 relative m-3\"\n [class.onshore-border-gray-3]=\"drag\"\n [class.onshore-border-danger]=\"imageError != imageErrorType.none\">\n <i class=\"fa fa-image fa-5x onshore-color-gray-4\"></i>\n <small class=\"onshore-color-gray-4 mb-2\">{{'form.imageControl.dropImageLabel' | translate}}</small>\n\n <button pButton\n type=\"button\"\n icon=\"fa fa-file\"\n [label]=\"'form.imageControl.imageChooserFileButton' | translate\"\n class=\"onshore-button-primary mr-2\">\n </button>\n\n <input\n (change)=\"fileChange($event)\"\n *ngIf=\"!image\"\n accept=\"image/png, image/jpeg, image/webp\"\n class=\"onshore-image-input absolute w-full h-full\"\n type=\"file\"\n (dragenter)=\"drag = true\"\n (dragleave)=\"drag = false\"\n (dragend)=\"drag = false\"\n />\n </div>\n </div>\n\n <div class=\"flex flex-column relative align-items-center w-full\" *ngIf=\"image\">\n <image-cropper\n class=\"m-3\"\n [style]=\"'align-items: center; height: ' + (imageSettings.cropperPreviewHeight * this.imageSettings.aspectRatio) + 'px; width: ' + (imageSettings.cropperPreviewWidth * this.imageSettings.aspectRatio) + 'px'\"\n [class.onshore-cropper-circle]=\"this.imageSettings.circleCropper\"\n (imageCropped)=\"imageCropped($event)\"\n [imageBase64]=\"image\"\n [imageQuality]=\"this.imageSettings.imageQuality\"\n [alignImage]=\"this.imageSettings.alignImage\"\n [backgroundColor]=\"this.imageSettings.backgroundColor\"\n [containWithinAspectRatio]=\"this.imageSettings.containWithinAspectRatio\"\n [format]=\"this.imageSettings.format\"\n [aspectRatio]=\"this.imageSettings.aspectRatio\"\n [resizeToHeight]=\"this.imageSettings.imageWidth * this.imageSettings.aspectRatio\"\n [resizeToWidth]=\"this.imageSettings.imageHeight * this.imageSettings.aspectRatio\">\n </image-cropper>\n </div>\n\n <div *ngIf=\"imageError\"class=\"pb-2 text-wrap text-center onshore-color-danger\">\n <small *ngIf=\"imageError == imageErrorType.ratio\">{{'form.imageControl.imageErrorRatio' | translate: {resizeToWidth: this.imageSettings.imageWidth, resizeToHeight: this.imageSettings.imageHeight} }}</small>\n <small *ngIf=\"imageError == imageErrorType.fileType\">{{'form.imageControl.imageErrorFileType' | translate}}</small>\n <small *ngIf=\"imageError == imageErrorType.size\">{{'form.imageControl.imageErrorSize' | translate}}</small>\n </div>\n</div>\n\n\n<p-footer>\n <div class=\"flex justify-content-end align-items-center mt-2\">\n <button pButton\n type=\"button\"\n icon=\"fa fa-times\"\n [label]=\"'form.imageControl.imageChooserCancelButton' | translate\"\n class=\"onshore-button-light mr-2\"\n (click)=\"clear(); canceled.emit(true)\">\n </button>\n\n <button pButton\n type=\"button\"\n [label]=\"'form.imageControl.imageChooserSelectButton' | translate\"\n class=\"onshore-button-primary\"\n icon=\"fa fa-check\"\n [disabled]=\"!image\"\n (click)=\"imageCroppedReady()\">\n </button>\n </div>\n</p-footer>\n\n" }]
908
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { imageSettings: [{
909
+ type: Input
910
+ }], choosen: [{
911
+ type: Output
912
+ }], canceled: [{
913
+ type: Output
914
+ }] } });
915
+
916
+ class WebcamComponent {
917
+ cdr;
918
+ imageSettings = undefined;
919
+ shot = new EventEmitter();
920
+ canceled = new EventEmitter();
921
+ image = '';
922
+ finalImage = '';
923
+ trigger = new Subject();
924
+ camImageShot(webcamImage) {
925
+ this.image = webcamImage.imageAsDataUrl;
926
+ this.cdr.markForCheck();
927
+ }
928
+ imageCropped(event) {
929
+ // ToDo: Check needed base64 format
930
+ this.finalImage = event.base64 || '';
931
+ }
932
+ imageCroppedReady() {
933
+ this.shot.emit(this.finalImage);
934
+ }
935
+ get triggerObservable() {
936
+ return this.trigger.asObservable();
937
+ }
938
+ triggerSnapshot() {
939
+ this.trigger.next();
940
+ }
941
+ constructor(cdr) {
942
+ this.cdr = cdr;
943
+ }
944
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: WebcamComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
945
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: WebcamComponent, isStandalone: true, selector: "onshore-webcam", inputs: { imageSettings: "imageSettings" }, outputs: { shot: "shot", canceled: "canceled" }, ngImport: i0, template: "<div class=\"flex w-full justify-content-center align-items-center overflow-hidden p-2\">\n <webcam *ngIf=\"!image || image == ''\"\n [mirrorImage]=\"'never'\"\n [height]=\"imageSettings.webcamWidth * this.imageSettings.aspectRatio\"\n [width]=\"imageSettings.webcamHeight * this.imageSettings.aspectRatio\"\n [allowCameraSwitch]=\"true\"\n [trigger]=\"triggerObservable\"\n [imageQuality]=\"imageSettings.imageQuality / 100\"\n (imageCapture)=\"camImageShot($event)\">\n </webcam>\n\n <image-cropper *ngIf=\"image && image != ''\"\n class=\"m-3\" [style]=\"'height: ' + (imageSettings.cropperPreviewWidth * this.imageSettings.aspectRatio) + 'px; width: ' + (imageSettings.cropperPreviewHeight * this.imageSettings.aspectRatio) + 'px'\"\n [class.onshore-cropper-circle]=\"imageSettings.circleCropper\"\n (imageCropped)=\"imageCropped($event)\"\n [imageBase64]=\"image\"\n [imageQuality]=\"imageSettings.imageQuality\"\n [alignImage]=\"imageSettings.alignImage\"\n [backgroundColor]=\"imageSettings?.backgroundColor\"\n [containWithinAspectRatio]=\"imageSettings?.containWithinAspectRatio\"\n [format]=\"imageSettings.format\"\n [aspectRatio]=\"imageSettings.aspectRatio\"\n [resizeToHeight]=\"imageSettings.imageHeight * this.imageSettings.aspectRatio\"\n [resizeToWidth]=\"this.imageSettings.imageWidth * this.imageSettings.aspectRatio\">\n </image-cropper>\n</div>\n\n<p-footer>\n <div class=\"flex justify-content-end align-items-center mt-2\">\n\n <button pButton\n type=\"button\"\n icon=\"fa fa-times\"\n [label]=\"'global.cancel' | translate\"\n class=\"onshore-button-light mr-2\"\n (click)=\"canceled.emit(true)\">\n </button>\n\n <button *ngIf=\"!image || image == ''\"\n pButton\n type=\"button\"\n [label]=\"'form.imageControl.webcamSmileButton' | translate\"\n class=\"onshore-button-primary\"\n icon=\"fa fa-laugh-wink\"\n (click)=\"triggerSnapshot()\">\n </button>\n\n <button *ngIf=\"image && image != ''\"\n pButton\n type=\"button\"\n [label]=\"'global.use' | translate\"\n class=\"onshore-button-primary\"\n icon=\"fa fa-check\"\n (click)=\"imageCroppedReady()\">\n </button>\n </div>\n</p-footer>\n\n\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "component", type: i4.Footer, selector: "p-footer" }, { kind: "component", type: ImageCropperComponent, selector: "image-cropper", inputs: ["imageChangedEvent", "imageURL", "imageBase64", "imageFile", "imageAltText", "options", "cropperFrameAriaLabel", "output", "format", "autoCrop", "cropper", "transform", "maintainAspectRatio", "aspectRatio", "resetCropOnAspectRatioChange", "resizeToWidth", "resizeToHeight", "cropperMinWidth", "cropperMinHeight", "cropperMaxHeight", "cropperMaxWidth", "cropperStaticWidth", "cropperStaticHeight", "canvasRotation", "initialStepSize", "roundCropper", "onlyScaleDown", "imageQuality", "backgroundColor", "containWithinAspectRatio", "hideResizeSquares", "allowMoveImage", "checkImageType", "alignImage", "disabled", "hidden"], outputs: ["imageCropped", "startCropImage", "imageLoaded", "cropperReady", "loadImageFailed", "transformChange", "cropperChange"] }, { kind: "ngmodule", type: WebcamModule }, { kind: "component", type: i5$1.WebcamComponent, selector: "webcam", inputs: ["width", "height", "videoOptions", "allowCameraSwitch", "mirrorImage", "captureImageData", "imageType", "imageQuality", "trigger", "switchCamera"], outputs: ["imageCapture", "initError", "imageClick", "cameraSwitched"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
946
+ }
947
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: WebcamComponent, decorators: [{
948
+ type: Component,
949
+ args: [{ selector: 'onshore-webcam', imports: [CommonModule, TranslateModule, ButtonModule, ImageCropperComponent, WebcamModule], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<div class=\"flex w-full justify-content-center align-items-center overflow-hidden p-2\">\n <webcam *ngIf=\"!image || image == ''\"\n [mirrorImage]=\"'never'\"\n [height]=\"imageSettings.webcamWidth * this.imageSettings.aspectRatio\"\n [width]=\"imageSettings.webcamHeight * this.imageSettings.aspectRatio\"\n [allowCameraSwitch]=\"true\"\n [trigger]=\"triggerObservable\"\n [imageQuality]=\"imageSettings.imageQuality / 100\"\n (imageCapture)=\"camImageShot($event)\">\n </webcam>\n\n <image-cropper *ngIf=\"image && image != ''\"\n class=\"m-3\" [style]=\"'height: ' + (imageSettings.cropperPreviewWidth * this.imageSettings.aspectRatio) + 'px; width: ' + (imageSettings.cropperPreviewHeight * this.imageSettings.aspectRatio) + 'px'\"\n [class.onshore-cropper-circle]=\"imageSettings.circleCropper\"\n (imageCropped)=\"imageCropped($event)\"\n [imageBase64]=\"image\"\n [imageQuality]=\"imageSettings.imageQuality\"\n [alignImage]=\"imageSettings.alignImage\"\n [backgroundColor]=\"imageSettings?.backgroundColor\"\n [containWithinAspectRatio]=\"imageSettings?.containWithinAspectRatio\"\n [format]=\"imageSettings.format\"\n [aspectRatio]=\"imageSettings.aspectRatio\"\n [resizeToHeight]=\"imageSettings.imageHeight * this.imageSettings.aspectRatio\"\n [resizeToWidth]=\"this.imageSettings.imageWidth * this.imageSettings.aspectRatio\">\n </image-cropper>\n</div>\n\n<p-footer>\n <div class=\"flex justify-content-end align-items-center mt-2\">\n\n <button pButton\n type=\"button\"\n icon=\"fa fa-times\"\n [label]=\"'global.cancel' | translate\"\n class=\"onshore-button-light mr-2\"\n (click)=\"canceled.emit(true)\">\n </button>\n\n <button *ngIf=\"!image || image == ''\"\n pButton\n type=\"button\"\n [label]=\"'form.imageControl.webcamSmileButton' | translate\"\n class=\"onshore-button-primary\"\n icon=\"fa fa-laugh-wink\"\n (click)=\"triggerSnapshot()\">\n </button>\n\n <button *ngIf=\"image && image != ''\"\n pButton\n type=\"button\"\n [label]=\"'global.use' | translate\"\n class=\"onshore-button-primary\"\n icon=\"fa fa-check\"\n (click)=\"imageCroppedReady()\">\n </button>\n </div>\n</p-footer>\n\n\n" }]
950
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { imageSettings: [{
951
+ type: Input
952
+ }], shot: [{
953
+ type: Output
954
+ }], canceled: [{
955
+ type: Output
956
+ }] } });
957
+
958
+ class OnshoreFormImageItemComponent {
959
+ cdr;
960
+ ngControl;
961
+ dialogService;
962
+ formTemplate;
963
+ imageSettings = undefined;
964
+ actionButtonDisabled = false;
965
+ imageDeleted = new EventEmitter();
966
+ imageCleared = new EventEmitter();
967
+ imageReady = new EventEmitter();
968
+ selectFromMedia = new EventEmitter();
969
+ isLoading = new EventEmitter();
970
+ OnshoreFormTemplateLayout = OnshoreFormTemplateLayout;
971
+ defaultImageSettings = {
972
+ imageWidth: 400,
973
+ imageHeight: 400,
974
+ containWithinAspectRatio: false,
975
+ aspectRatio: 1 / 1,
976
+ imageSelectionEnabled: true,
977
+ webcamSelectionEnabled: true,
978
+ mediaSelectionEnabled: true,
979
+ deleteEnabled: true,
980
+ placeholderImage: '',
981
+ placeholderIcon: 'fa fa-image fa-10x',
982
+ containerWidth: 250,
983
+ containerHeight: 250,
984
+ imageQuality: 100,
985
+ format: 'png',
986
+ alignImage: 'center',
987
+ cropperPreviewWidth: 400,
988
+ cropperPreviewHeight: 400,
989
+ webcamWidth: 400,
990
+ webcamHeight: 400,
991
+ circleCropper: false,
992
+ maxFileSize: 6400000,
993
+ backgroundColor: 'white'
994
+ };
995
+ image = '';
996
+ disabled = false;
997
+ webcamDialogVisible = false;
998
+ imageChooserDialogVisible = false;
999
+ subscriptions = [];
1000
+ getFileImage(image) {
1001
+ this.imageChooserDialogVisible = false;
1002
+ if (image) {
1003
+ this.image = image;
1004
+ setTimeout(() => {
1005
+ this.ngControl?.control?.setValue(this.image);
1006
+ this.ngControl?.control?.markAsDirty();
1007
+ this.imageReady.emit(this.image);
1008
+ this.cdr.markForCheck();
1009
+ }, 500);
1010
+ }
1011
+ }
1012
+ getWebcamImage(image) {
1013
+ this.webcamDialogVisible = false;
1014
+ if (image) {
1015
+ this.image = image;
1016
+ setTimeout(() => {
1017
+ this.ngControl?.control?.setValue(this.image);
1018
+ this.ngControl?.control?.markAsDirty();
1019
+ this.imageReady.emit(this.image);
1020
+ this.cdr.markForCheck();
1021
+ }, 500);
1022
+ }
1023
+ }
1024
+ removeImage() {
1025
+ if (this.image && !this.image.includes('base64')) {
1026
+ this.imageDeleted.emit(this.image);
1027
+ }
1028
+ else {
1029
+ this.imageCleared.emit();
1030
+ }
1031
+ this.ngControl?.control?.setValue(null);
1032
+ this.ngControl?.control?.markAsDirty();
1033
+ this.image = '';
1034
+ this.cdr.markForCheck();
1035
+ }
1036
+ writeValue(obj) {
1037
+ if (obj && !obj.includes('base64')) {
1038
+ this.image = obj;
1039
+ }
1040
+ if (obj == null) {
1041
+ this.image = '';
1042
+ }
1043
+ this.imageReady.emit(this.image);
1044
+ this.cdr.markForCheck();
1045
+ }
1046
+ registerOnChange(fn) {
1047
+ if (this.ngControl.value) {
1048
+ this.image = this.ngControl.value;
1049
+ this.cdr.markForCheck();
1050
+ }
1051
+ }
1052
+ registerOnTouched(fn) { }
1053
+ setDisabledState(isDisabled) {
1054
+ this.disabled = isDisabled;
1055
+ this.cdr.markForCheck();
1056
+ }
1057
+ ngOnInit() {
1058
+ if (this.ngControl?.control?.value == '' && this.formTemplate.default != undefined) {
1059
+ this.ngControl?.control?.setValue(this.formTemplate.default);
1060
+ this.cdr.markForCheck();
1061
+ }
1062
+ }
1063
+ ngOnDestroy() {
1064
+ this.subscriptions.forEach((subscription) => {
1065
+ subscription.unsubscribe();
1066
+ });
1067
+ this.ngControl?.control?.disable();
1068
+ this.image = undefined;
1069
+ }
1070
+ ngOnChanges(changes) {
1071
+ const imageSettings = changes['imageSettings']?.currentValue;
1072
+ this.imageSettings = {
1073
+ ...this.defaultImageSettings,
1074
+ ...imageSettings,
1075
+ placeholderIcon: imageSettings?.placeholderImage ? '' : (imageSettings?.placeholderIcon ?? this.defaultImageSettings.placeholderIcon)
1076
+ };
1077
+ //this.removeImage();
1078
+ this.cdr.markForCheck();
1079
+ }
1080
+ constructor(cdr, ngControl, dialogService) {
1081
+ this.cdr = cdr;
1082
+ this.ngControl = ngControl;
1083
+ this.dialogService = dialogService;
1084
+ this.ngControl.valueAccessor = this;
1085
+ }
1086
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormImageItemComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$2.NgControl, optional: true, self: true }, { token: i2$3.DialogService }], target: i0.ɵɵFactoryTarget.Component });
1087
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: OnshoreFormImageItemComponent, isStandalone: true, selector: "onshore-form-image-item", inputs: { formTemplate: "formTemplate", imageSettings: "imageSettings", actionButtonDisabled: "actionButtonDisabled" }, outputs: { imageDeleted: "imageDeleted", imageCleared: "imageCleared", imageReady: "imageReady", selectFromMedia: "selectFromMedia", isLoading: "isLoading" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\">\n <div class=\"w-full flex align-items-center\" [class.flex-column]=\"formTemplate.layout === OnshoreFormTemplateLayout.vertical\">\n\n <div class=\"onshore-border-gray-4 border-solid border-1 overflow-hidden\"\n [style]=\"'background-color: white; width: ' + imageSettings.containerWidth + 'px; height: ' + imageSettings.containerHeight + 'px'\">\n <onshore-image-placeholder\n class=\"w-full\"\n [image]=\"image\"\n [imageStyle]=\"'width: 100%; height: 100%'\"\n [placeholderIcon]=\"imageSettings.placeholderIcon\"\n [placeholderImage]=\"imageSettings.placeholderImage\"\n [placeholderStyle]=\"'width: 100%; height: 100%'\">\n </onshore-image-placeholder>\n </div>\n\n <div class=\"flex flex-column m-4\">\n <button pButton\n type=\"button\"\n *ngIf=\"imageSettings.imageSelectionEnabled\"\n icon=\"fa fa-image\"\n [label]=\"'form.imageControl.uploadImageButton' | translate\"\n class=\"onshore-button-primary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"imageChooserDialogVisible = true; cdr.detectChanges()\">\n </button>\n\n <button pButton\n type=\"button\"\n *ngIf=\"imageSettings.webcamSelectionEnabled\"\n icon=\"fa fa-camera\"\n [label]=\"'form.imageControl.webcamImageButton' | translate\"\n class=\"onshore-button-light mb-2\"\n [disabled]=\"disabled\"\n (click)=\"webcamDialogVisible = true\">\n </button>\n\n <button pButton\n type=\"button\"\n *ngIf=\"imageSettings.mediaSelectionEnabled\"\n icon=\"fa fa-photo-video\"\n [label]=\"'form.imageControl.mediaImageButton' | translate\"\n class=\"onshore-button-light mb-2\"\n [disabled]=\"disabled\"\n (click)=\"selectFromMedia.emit()\">\n </button>\n\n <button pButton\n type=\"button\"\n *ngIf=\"imageSettings.deleteEnabled\"\n icon=\"fa fa-eraser\"\n [label]=\"'form.imageControl.removeImageButton' | translate\"\n class=\"onshore-button-light\"\n (click)=\"removeImage()\"\n [disabled]=\"!image || disabled\">\n </button>\n\n </div>\n\n </div>\n</onshore-form-item-container>\n\n<p-dialog [header]=\"'form.imageControl.uploadImageTitle' | translate\" [(visible)]=\"imageChooserDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\" appendTo=\"body\">\n <onshore-image-chooser\n (choosen)=\"getFileImage($event)\"\n (canceled)=\"imageChooserDialogVisible = false\"\n [imageSettings]=\"imageSettings\">\n </onshore-image-chooser>\n</p-dialog>\n\n<p-dialog [header]=\"'form.imageControl.webacmImageTitle' | translate\" [(visible)]=\"webcamDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\" appendTo=\"body\">\n <onshore-webcam\n *ngIf=\"webcamDialogVisible\"\n (shot)=\"getWebcamImage($event)\"\n (canceled)=\"webcamDialogVisible = false\"\n [imageSettings]=\"imageSettings\"></onshore-webcam>\n</p-dialog>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl", "actionButtonDisabled"], outputs: ["actionButtonClick", "lockIsChanged"] }, { kind: "component", type: OnshoreImagePlaceholderComponent, selector: "onshore-image-placeholder", inputs: ["placeholderIcon", "placeholderImage", "image", "imageStyle", "placeholderStyle", "showLoader"] }, { kind: "component", type: OnshoreImageChooserComponent, selector: "onshore-image-chooser", inputs: ["imageSettings"], outputs: ["choosen", "canceled"] }, { kind: "component", type: WebcamComponent, selector: "onshore-webcam", inputs: ["imageSettings"], outputs: ["shot", "canceled"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i6.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1088
+ }
1089
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormImageItemComponent, decorators: [{
1090
+ type: Component,
1091
+ args: [{ selector: 'onshore-form-image-item', imports: [CommonModule, OnshoreFormItemContainer, OnshoreImagePlaceholderComponent, OnshoreImageChooserComponent, WebcamComponent, TranslateModule, ButtonModule, DialogModule, FormsModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\">\n <div class=\"w-full flex align-items-center\" [class.flex-column]=\"formTemplate.layout === OnshoreFormTemplateLayout.vertical\">\n\n <div class=\"onshore-border-gray-4 border-solid border-1 overflow-hidden\"\n [style]=\"'background-color: white; width: ' + imageSettings.containerWidth + 'px; height: ' + imageSettings.containerHeight + 'px'\">\n <onshore-image-placeholder\n class=\"w-full\"\n [image]=\"image\"\n [imageStyle]=\"'width: 100%; height: 100%'\"\n [placeholderIcon]=\"imageSettings.placeholderIcon\"\n [placeholderImage]=\"imageSettings.placeholderImage\"\n [placeholderStyle]=\"'width: 100%; height: 100%'\">\n </onshore-image-placeholder>\n </div>\n\n <div class=\"flex flex-column m-4\">\n <button pButton\n type=\"button\"\n *ngIf=\"imageSettings.imageSelectionEnabled\"\n icon=\"fa fa-image\"\n [label]=\"'form.imageControl.uploadImageButton' | translate\"\n class=\"onshore-button-primary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"imageChooserDialogVisible = true; cdr.detectChanges()\">\n </button>\n\n <button pButton\n type=\"button\"\n *ngIf=\"imageSettings.webcamSelectionEnabled\"\n icon=\"fa fa-camera\"\n [label]=\"'form.imageControl.webcamImageButton' | translate\"\n class=\"onshore-button-light mb-2\"\n [disabled]=\"disabled\"\n (click)=\"webcamDialogVisible = true\">\n </button>\n\n <button pButton\n type=\"button\"\n *ngIf=\"imageSettings.mediaSelectionEnabled\"\n icon=\"fa fa-photo-video\"\n [label]=\"'form.imageControl.mediaImageButton' | translate\"\n class=\"onshore-button-light mb-2\"\n [disabled]=\"disabled\"\n (click)=\"selectFromMedia.emit()\">\n </button>\n\n <button pButton\n type=\"button\"\n *ngIf=\"imageSettings.deleteEnabled\"\n icon=\"fa fa-eraser\"\n [label]=\"'form.imageControl.removeImageButton' | translate\"\n class=\"onshore-button-light\"\n (click)=\"removeImage()\"\n [disabled]=\"!image || disabled\">\n </button>\n\n </div>\n\n </div>\n</onshore-form-item-container>\n\n<p-dialog [header]=\"'form.imageControl.uploadImageTitle' | translate\" [(visible)]=\"imageChooserDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\" appendTo=\"body\">\n <onshore-image-chooser\n (choosen)=\"getFileImage($event)\"\n (canceled)=\"imageChooserDialogVisible = false\"\n [imageSettings]=\"imageSettings\">\n </onshore-image-chooser>\n</p-dialog>\n\n<p-dialog [header]=\"'form.imageControl.webacmImageTitle' | translate\" [(visible)]=\"webcamDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\" appendTo=\"body\">\n <onshore-webcam\n *ngIf=\"webcamDialogVisible\"\n (shot)=\"getWebcamImage($event)\"\n (canceled)=\"webcamDialogVisible = false\"\n [imageSettings]=\"imageSettings\"></onshore-webcam>\n</p-dialog>\n" }]
1092
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$2.NgControl, decorators: [{
1093
+ type: Self
1094
+ }, {
1095
+ type: Optional
1096
+ }] }, { type: i2$3.DialogService }], propDecorators: { formTemplate: [{
1097
+ type: Input
1098
+ }], imageSettings: [{
1099
+ type: Input
1100
+ }], actionButtonDisabled: [{
1101
+ type: Input
1102
+ }], imageDeleted: [{
1103
+ type: Output
1104
+ }], imageCleared: [{
1105
+ type: Output
1106
+ }], imageReady: [{
1107
+ type: Output
1108
+ }], selectFromMedia: [{
1109
+ type: Output
1110
+ }], isLoading: [{
1111
+ type: Output
1112
+ }] } });
1113
+
1114
+ class OnshoreFormInputItemComponent {
1115
+ ngControl;
1116
+ cdr;
1117
+ formTemplate;
1118
+ step = 1;
1119
+ min = 0;
1120
+ max = 999999;
1121
+ minLength = 0;
1122
+ maxLength = 999999;
1123
+ actionButtonDisabled = false;
1124
+ actionButtonClick = new EventEmitter();
1125
+ OnshoreFormTemplateType = OnshoreFormTemplateType;
1126
+ passwordVisible = false;
1127
+ disabled = false;
1128
+ // ControlValueAccessor interface
1129
+ writeValue(obj) { }
1130
+ registerOnChange(fn) { }
1131
+ registerOnTouched(fn) { }
1132
+ setDisabledState(isDisabled) {
1133
+ this.disabled = isDisabled;
1134
+ }
1135
+ ngOnInit() {
1136
+ if (this.ngControl.control?.value == '' && this.formTemplate.default != undefined) {
1137
+ this.ngControl.control?.setValue(this.formTemplate.default);
1138
+ this.cdr.markForCheck();
1139
+ }
1140
+ }
1141
+ // @ts-ignore
1142
+ onNumberInput(event) {
1143
+ this.ngControl.control?.setValue(event.value);
1144
+ this.ngControl?.control?.markAsDirty();
1145
+ this.cdr.markForCheck();
1146
+ }
1147
+ get formControl() {
1148
+ return this.ngControl.control;
1149
+ }
1150
+ ngOnChanges(changes) {
1151
+ this.cdr.markForCheck();
1152
+ }
1153
+ ngOnDestroy() {
1154
+ this.ngControl.control?.disable();
1155
+ }
1156
+ constructor(ngControl, cdr) {
1157
+ this.ngControl = ngControl;
1158
+ this.cdr = cdr;
1159
+ this.ngControl.valueAccessor = this;
1160
+ }
1161
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormInputItemComponent, deps: [{ token: i1$2.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1162
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: OnshoreFormInputItemComponent, isStandalone: true, selector: "onshore-form-input-item", inputs: { formTemplate: "formTemplate", step: "step", min: "min", max: "max", minLength: "minLength", maxLength: "maxLength", actionButtonDisabled: "actionButtonDisabled" }, outputs: { actionButtonClick: "actionButtonClick" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\">\n <p-inputgroup class=\"w-full\">\n\n <textarea *ngIf=\"formTemplate.type == OnshoreFormTemplateType.textarea\"\n class=\"w-full\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n [disabled]=\"disabled\"\n [rows]=\"3\"\n [cols]=\"30\"\n pTextarea\n [autoResize]=\"true\"\n [formControl]=\"formControl\"\n [class.p-invalid]=\"ngControl.control?.touched && ngControl.control?.invalid\"\n [minLength]=\"minLength\"\n [maxLength]=\"maxLength\"></textarea>\n\n <input *ngIf=\"formTemplate.type == OnshoreFormTemplateType.text || formTemplate.type == OnshoreFormTemplateType.email || formTemplate.type == OnshoreFormTemplateType.phone\"\n class=\"w-full\"\n [type]=\"formTemplate.type\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n [disabled]=\"disabled\"\n pInputText\n [formControl]=\"formControl\"\n [autocomplete]=\"'prevent-template-' + formTemplate.name\"\n [minLength]=\"minLength\"\n [maxLength]=\"maxLength\"/>\n\n <input *ngIf=\"formTemplate.type == OnshoreFormTemplateType.password\"\n class=\"w-full\"\n [type]=\"passwordVisible ? 'text' : formTemplate.type\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n [disabled]=\"disabled\"\n pInputText\n [formControl]=\"formControl\"\n [autocomplete]=\"'prevent-template-' + formTemplate.name\"\n [minLength]=\"minLength\"\n [maxLength]=\"maxLength\"/>\n\n <p-inputNumber *ngIf=\"formTemplate.type == OnshoreFormTemplateType.number\"\n class=\"w-full\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n [disabled]=\"disabled\"\n [formControl]=\"formControl\"\n [autocomplete]=\"'prevent-template-' + formTemplate.name\"\n [showButtons]=\"true\"\n [step]=\"step ?? 1\"\n [min]=\"min\"\n [max]=\"max\"\n (onInput)=\"onNumberInput($event)\">\n </p-inputNumber>\n\n <p-inputgroup-addon *ngIf=\"formTemplate.inputAddon\">\n <p-button [icon]=\"'fa ' + formTemplate.inputAddon\" severity=\"secondary\" />\n </p-inputgroup-addon>\n\n <p-inputgroup-addon *ngIf=\"formTemplate.type == OnshoreFormTemplateType.password\"\n (click)=\"passwordVisible = !passwordVisible\"\n class=\"cursor-pointer\">\n <p-button [icon]=\"passwordVisible ? 'fa fa-eye' : 'fa fa-eye-slash'\" severity=\"secondary\" />\n </p-inputgroup-addon>\n\n </p-inputgroup>\n</onshore-form-item-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl", "actionButtonDisabled"], outputs: ["actionButtonClick", "lockIsChanged"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: TextareaModule }, { kind: "directive", type: i3$4.Textarea, selector: "[pTextarea]", inputs: ["autoResize", "variant", "fluid", "pSize"], outputs: ["onResize"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i2$2.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "ngmodule", type: InputNumberModule }, { kind: "component", type: i5$2.InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabelledBy", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "variant", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus", "disabled", "fluid"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.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$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: InputGroupModule }, { kind: "component", type: i6$1.InputGroup, selector: "p-inputgroup, p-inputGroup, p-input-group", inputs: ["style", "styleClass"] }, { kind: "ngmodule", type: InputGroupAddonModule }, { kind: "component", type: i7.InputGroupAddon, selector: "p-inputgroup-addon, p-inputGroupAddon", inputs: ["style", "styleClass"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i3$1.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1163
+ }
1164
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormInputItemComponent, decorators: [{
1165
+ type: Component,
1166
+ args: [{ selector: 'onshore-form-input-item', imports: [CommonModule, OnshoreFormItemContainer, TranslateModule, TextareaModule, InputTextModule, InputNumberModule, FormsModule, ReactiveFormsModule, InputGroupModule, InputGroupAddonModule, ButtonModule], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\">\n <p-inputgroup class=\"w-full\">\n\n <textarea *ngIf=\"formTemplate.type == OnshoreFormTemplateType.textarea\"\n class=\"w-full\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n [disabled]=\"disabled\"\n [rows]=\"3\"\n [cols]=\"30\"\n pTextarea\n [autoResize]=\"true\"\n [formControl]=\"formControl\"\n [class.p-invalid]=\"ngControl.control?.touched && ngControl.control?.invalid\"\n [minLength]=\"minLength\"\n [maxLength]=\"maxLength\"></textarea>\n\n <input *ngIf=\"formTemplate.type == OnshoreFormTemplateType.text || formTemplate.type == OnshoreFormTemplateType.email || formTemplate.type == OnshoreFormTemplateType.phone\"\n class=\"w-full\"\n [type]=\"formTemplate.type\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n [disabled]=\"disabled\"\n pInputText\n [formControl]=\"formControl\"\n [autocomplete]=\"'prevent-template-' + formTemplate.name\"\n [minLength]=\"minLength\"\n [maxLength]=\"maxLength\"/>\n\n <input *ngIf=\"formTemplate.type == OnshoreFormTemplateType.password\"\n class=\"w-full\"\n [type]=\"passwordVisible ? 'text' : formTemplate.type\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n [disabled]=\"disabled\"\n pInputText\n [formControl]=\"formControl\"\n [autocomplete]=\"'prevent-template-' + formTemplate.name\"\n [minLength]=\"minLength\"\n [maxLength]=\"maxLength\"/>\n\n <p-inputNumber *ngIf=\"formTemplate.type == OnshoreFormTemplateType.number\"\n class=\"w-full\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n [disabled]=\"disabled\"\n [formControl]=\"formControl\"\n [autocomplete]=\"'prevent-template-' + formTemplate.name\"\n [showButtons]=\"true\"\n [step]=\"step ?? 1\"\n [min]=\"min\"\n [max]=\"max\"\n (onInput)=\"onNumberInput($event)\">\n </p-inputNumber>\n\n <p-inputgroup-addon *ngIf=\"formTemplate.inputAddon\">\n <p-button [icon]=\"'fa ' + formTemplate.inputAddon\" severity=\"secondary\" />\n </p-inputgroup-addon>\n\n <p-inputgroup-addon *ngIf=\"formTemplate.type == OnshoreFormTemplateType.password\"\n (click)=\"passwordVisible = !passwordVisible\"\n class=\"cursor-pointer\">\n <p-button [icon]=\"passwordVisible ? 'fa fa-eye' : 'fa fa-eye-slash'\" severity=\"secondary\" />\n </p-inputgroup-addon>\n\n </p-inputgroup>\n</onshore-form-item-container>\n" }]
1167
+ }], ctorParameters: () => [{ type: i1$2.NgControl, decorators: [{
1168
+ type: Self
1169
+ }, {
1170
+ type: Optional
1171
+ }] }, { type: i0.ChangeDetectorRef }], propDecorators: { formTemplate: [{
1172
+ type: Input
1173
+ }], step: [{
1174
+ type: Input
1175
+ }], min: [{
1176
+ type: Input
1177
+ }], max: [{
1178
+ type: Input
1179
+ }], minLength: [{
1180
+ type: Input
1181
+ }], maxLength: [{
1182
+ type: Input
1183
+ }], actionButtonDisabled: [{
1184
+ type: Input
1185
+ }], actionButtonClick: [{
1186
+ type: Output
1187
+ }] } });
1188
+
1189
+ class OnshoreFormSwitchItemComponent {
1190
+ ngControl;
1191
+ cdr;
1192
+ formTemplate;
1193
+ actionButtonDisabled = false;
1194
+ valueChange = new EventEmitter();
1195
+ actionButtonClick = new EventEmitter();
1196
+ disabled = false;
1197
+ // ControlValueAccessor interface
1198
+ writeValue(obj) { }
1199
+ registerOnChange(fn) { }
1200
+ registerOnTouched(fn) { }
1201
+ setDisabledState(isDisabled) {
1202
+ this.disabled = isDisabled;
1203
+ }
1204
+ get formControl() {
1205
+ return this.ngControl.control;
1206
+ }
1207
+ ngOnInit() {
1208
+ this.ngControl.control?.valueChanges.pipe(debounceTime(100), distinctUntilChanged(), skip(1)).subscribe(newValue => {
1209
+ this.valueChange.emit(this.ngControl.control?.value);
1210
+ });
1211
+ if (this.ngControl.control?.value == undefined && this.formTemplate.default != undefined) {
1212
+ this.ngControl.control?.setValue(this.formTemplate.default);
1213
+ this.cdr.markForCheck();
1214
+ }
1215
+ }
1216
+ ngOnChanges(changes) {
1217
+ this.cdr.markForCheck();
1218
+ }
1219
+ ngOnDestroy() {
1220
+ this.ngControl.control?.disable();
1221
+ }
1222
+ constructor(ngControl, cdr) {
1223
+ this.ngControl = ngControl;
1224
+ this.cdr = cdr;
1225
+ this.ngControl.valueAccessor = this;
1226
+ }
1227
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormSwitchItemComponent, deps: [{ token: i1$2.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1228
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: OnshoreFormSwitchItemComponent, isStandalone: true, selector: "onshore-form-switch-item", inputs: { formTemplate: "formTemplate", actionButtonDisabled: "actionButtonDisabled" }, outputs: { valueChange: "valueChange", actionButtonClick: "actionButtonClick" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\">\n <div class=\"h-full align-items-center mt-1\">\n <p-inputSwitch [name]=\"formTemplate.name\"\n [formControl]=\"formControl\"\n [disabled]=\"disabled\"\n [inputId]=\"formTemplate.name\">\n </p-inputSwitch>\n </div>\n\n</onshore-form-item-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl", "actionButtonDisabled"], outputs: ["actionButtonClick", "lockIsChanged"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: InputSwitchModule }, { kind: "component", type: i2$4.InputSwitch, selector: "p-inputSwitch, p-inputswitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabel", "ariaLabelledBy", "autofocus"], outputs: ["onChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1229
+ }
1230
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormSwitchItemComponent, decorators: [{
1231
+ type: Component,
1232
+ args: [{ selector: 'onshore-form-switch-item', imports: [CommonModule, OnshoreFormItemContainer, TranslateModule, InputSwitchModule, FormsModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\">\n <div class=\"h-full align-items-center mt-1\">\n <p-inputSwitch [name]=\"formTemplate.name\"\n [formControl]=\"formControl\"\n [disabled]=\"disabled\"\n [inputId]=\"formTemplate.name\">\n </p-inputSwitch>\n </div>\n\n</onshore-form-item-container>\n" }]
1233
+ }], ctorParameters: () => [{ type: i1$2.NgControl, decorators: [{
1234
+ type: Self
1235
+ }, {
1236
+ type: Optional
1237
+ }] }, { type: i0.ChangeDetectorRef }], propDecorators: { formTemplate: [{
1238
+ type: Input
1239
+ }], actionButtonDisabled: [{
1240
+ type: Input
1241
+ }], valueChange: [{
1242
+ type: Output
1243
+ }], actionButtonClick: [{
1244
+ type: Output
1245
+ }] } });
1246
+
1247
+ class OnshoreFormDatetimeItemComponent {
1248
+ ngControl;
1249
+ cdr;
1250
+ formTemplate;
1251
+ actionButtonDisabled = false;
1252
+ actionButtonClick = new EventEmitter();
1253
+ OnshoreFormTemplateType = OnshoreFormTemplateType;
1254
+ disabled = false;
1255
+ // ControlValueAccessor interface
1256
+ writeValue(obj) { }
1257
+ registerOnChange(fn) { }
1258
+ registerOnTouched(fn) { }
1259
+ setDisabledState(isDisabled) {
1260
+ this.disabled = isDisabled;
1261
+ }
1262
+ selectDate(date) {
1263
+ console.log(date);
1264
+ }
1265
+ selectTime(time) {
1266
+ console.log(time);
1267
+ }
1268
+ get formControl() {
1269
+ return this.ngControl.control;
1270
+ }
1271
+ ngOnInit() {
1272
+ if (this.ngControl.control?.value !== true && this.ngControl.control?.value !== false && this.formTemplate.default != undefined) {
1273
+ this.ngControl.control?.setValue(this.formTemplate.default);
1274
+ this.cdr.markForCheck();
1275
+ }
1276
+ }
1277
+ ngOnChanges(changes) {
1278
+ this.cdr.markForCheck();
1279
+ }
1280
+ ngOnDestroy() {
1281
+ this.ngControl.control?.disable();
1282
+ }
1283
+ constructor(ngControl, cdr) {
1284
+ this.ngControl = ngControl;
1285
+ this.cdr = cdr;
1286
+ this.ngControl.valueAccessor = this;
1287
+ }
1288
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormDatetimeItemComponent, deps: [{ token: i1$2.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1289
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: OnshoreFormDatetimeItemComponent, isStandalone: true, selector: "onshore-form-datetime-item", inputs: { formTemplate: "formTemplate", actionButtonDisabled: "actionButtonDisabled" }, outputs: { actionButtonClick: "actionButtonClick" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\">\n\n <p-calendar class=\"w-full\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n [disabled]=\"disabled\"\n [formControl]=\"formControl\"\n dateFormat=\"dd.mm.yy\"\n dataType=\"string\"\n hourFormat=\"24\"\n [timeOnly]=\"formTemplate.type == OnshoreFormTemplateType.time\"\n [showTime]=\"formTemplate.type == OnshoreFormTemplateType.datetime\"\n [defaultDate]=\"formTemplate.default\"\n (onSelect)=\"selectDate($event)\"\n appendTo=\"body\">\n </p-calendar>\n\n</onshore-form-item-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl", "actionButtonDisabled"], outputs: ["actionButtonClick", "lockIsChanged"] }, { kind: "ngmodule", type: CalendarModule }, { kind: "component", type: i2$5.Calendar, selector: "p-calendar", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "fluid", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1290
+ }
1291
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormDatetimeItemComponent, decorators: [{
1292
+ type: Component,
1293
+ args: [{ selector: 'onshore-form-datetime-item', imports: [CommonModule, OnshoreFormItemContainer, CalendarModule, FormsModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\">\n\n <p-calendar class=\"w-full\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n [disabled]=\"disabled\"\n [formControl]=\"formControl\"\n dateFormat=\"dd.mm.yy\"\n dataType=\"string\"\n hourFormat=\"24\"\n [timeOnly]=\"formTemplate.type == OnshoreFormTemplateType.time\"\n [showTime]=\"formTemplate.type == OnshoreFormTemplateType.datetime\"\n [defaultDate]=\"formTemplate.default\"\n (onSelect)=\"selectDate($event)\"\n appendTo=\"body\">\n </p-calendar>\n\n</onshore-form-item-container>\n" }]
1294
+ }], ctorParameters: () => [{ type: i1$2.NgControl, decorators: [{
1295
+ type: Self
1296
+ }, {
1297
+ type: Optional
1298
+ }] }, { type: i0.ChangeDetectorRef }], propDecorators: { formTemplate: [{
1299
+ type: Input
1300
+ }], actionButtonDisabled: [{
1301
+ type: Input
1302
+ }], actionButtonClick: [{
1303
+ type: Output
1304
+ }] } });
1305
+
1306
+ class OnshoreFormSortItemComponent {
1307
+ ngControl;
1308
+ cdr;
1309
+ formTemplate;
1310
+ actionButtonDisabled = false;
1311
+ actionButtonClick = new EventEmitter();
1312
+ sortItems = [];
1313
+ tempLockValue = [];
1314
+ OnshoreFormTemplateType = OnshoreFormTemplateType;
1315
+ disabled = false;
1316
+ sortItemsChanged(event) {
1317
+ this.sortItems = event;
1318
+ this.ngControl?.control?.setValue(event);
1319
+ this.ngControl?.control?.markAsDirty();
1320
+ this.cdr.markForCheck();
1321
+ }
1322
+ lockChanged(unlocked) {
1323
+ if (unlocked && this.formTemplate.enabled) {
1324
+ this.tempLockValue = this.ngControl?.control?.value;
1325
+ }
1326
+ else {
1327
+ this.ngControl?.control?.setValue(this.tempLockValue);
1328
+ this.sortItems = this.tempLockValue;
1329
+ this.tempLockValue = undefined;
1330
+ }
1331
+ this.cdr.markForCheck();
1332
+ }
1333
+ // ControlValueAccessor interface
1334
+ writeValue(obj) {
1335
+ if (obj) {
1336
+ this.cdr.markForCheck();
1337
+ }
1338
+ }
1339
+ registerOnChange(fn) {
1340
+ if (this.ngControl.value) {
1341
+ this.cdr.markForCheck();
1342
+ }
1343
+ }
1344
+ registerOnTouched(fn) { }
1345
+ setDisabledState(isDisabled) {
1346
+ this.disabled = isDisabled;
1347
+ }
1348
+ ngOnInit() {
1349
+ this.ngControl.control?.valueChanges.pipe(debounceTime(100), distinctUntilChanged(), skip(1)).subscribe(newValue => {
1350
+ this.ngControl?.control?.setValue(newValue);
1351
+ });
1352
+ if (this.ngControl.control?.value == '' && this.formTemplate.default != undefined) {
1353
+ this.ngControl.control?.setValue(this.formTemplate.default);
1354
+ this.sortItems = this.formTemplate.default;
1355
+ }
1356
+ else {
1357
+ this.sortItems = this.ngControl.control?.value;
1358
+ }
1359
+ this.cdr.markForCheck();
1360
+ }
1361
+ ngOnChanges(changes) {
1362
+ this.cdr.markForCheck();
1363
+ }
1364
+ ngOnDestroy() {
1365
+ this.ngControl.control?.disable();
1366
+ }
1367
+ constructor(ngControl, cdr) {
1368
+ this.ngControl = ngControl;
1369
+ this.cdr = cdr;
1370
+ this.ngControl.valueAccessor = this;
1371
+ }
1372
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormSortItemComponent, deps: [{ token: i1$2.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1373
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: OnshoreFormSortItemComponent, isStandalone: true, selector: "onshore-form-sort-item", inputs: { formTemplate: "formTemplate", actionButtonDisabled: "actionButtonDisabled" }, outputs: { actionButtonClick: "actionButtonClick" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n (lockIsChanged)=\"lockChanged($event)\">\n\n <!--<div *ngIf=\"formTemplate.type == OnshoreFormTemplateType.sort\"\n class=\"w-full\" [dragula]=\"ngControl.enabled\"\n [dragulaModel]=\"sortItems\"\n (dragulaModelChange)=\"sortItemsChanged($event)\">\n <div [class.cursor-move]=\"ngControl.enabled\"\n style=\"border-radius: 3px\"\n class=\"onshore-sort-item flex justify-content-between align-items-center onshore-border-gray-4 border-solid border-1 p-2 mb-2 onshore-background-color-white\" *ngFor=\"let item of sortItems\">\n <span [class.onshore-color-blocked]=\"!ngControl.enabled\">{{ item.label }}</span>\n <i [class.onshore-color-blocked]=\"!ngControl.enabled\" class=\"fa fa-arrows-v\"></i>\n </div>\n </div>-->\n\n</onshore-form-item-container>\n\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl", "actionButtonDisabled"], outputs: ["actionButtonClick", "lockIsChanged"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1374
+ }
1375
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: OnshoreFormSortItemComponent, decorators: [{
1376
+ type: Component,
1377
+ args: [{ selector: 'onshore-form-sort-item', imports: [CommonModule, OnshoreFormItemContainer, TranslateModule, FormsModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\"\n [ngControl]=\"ngControl\"\n (actionButtonClick)=\"actionButtonClick.emit()\"\n [actionButtonDisabled]=\"actionButtonDisabled\"\n (lockIsChanged)=\"lockChanged($event)\">\n\n <!--<div *ngIf=\"formTemplate.type == OnshoreFormTemplateType.sort\"\n class=\"w-full\" [dragula]=\"ngControl.enabled\"\n [dragulaModel]=\"sortItems\"\n (dragulaModelChange)=\"sortItemsChanged($event)\">\n <div [class.cursor-move]=\"ngControl.enabled\"\n style=\"border-radius: 3px\"\n class=\"onshore-sort-item flex justify-content-between align-items-center onshore-border-gray-4 border-solid border-1 p-2 mb-2 onshore-background-color-white\" *ngFor=\"let item of sortItems\">\n <span [class.onshore-color-blocked]=\"!ngControl.enabled\">{{ item.label }}</span>\n <i [class.onshore-color-blocked]=\"!ngControl.enabled\" class=\"fa fa-arrows-v\"></i>\n </div>\n </div>-->\n\n</onshore-form-item-container>\n\n" }]
1378
+ }], ctorParameters: () => [{ type: i1$2.NgControl, decorators: [{
1379
+ type: Self
1380
+ }, {
1381
+ type: Optional
1382
+ }] }, { type: i0.ChangeDetectorRef }], propDecorators: { formTemplate: [{
1383
+ type: Input
1384
+ }], actionButtonDisabled: [{
1385
+ type: Input
1386
+ }], actionButtonClick: [{
1387
+ type: Output
1388
+ }] } });
1389
+
1390
+ /*
1391
+ * Public API Surface of onshore-forms
1392
+ */
1393
+
1394
+ /**
1395
+ * Generated bundle index. Do not edit.
1396
+ */
1397
+
1398
+ export { OnshoreFormAutocompleteItemComponent, OnshoreFormCheckboxItemComponent, OnshoreFormColorpickerItemComponent, OnshoreFormDatetimeItemComponent, OnshoreFormDropdownItemComponent, OnshoreFormImageItemComponent, OnshoreFormInputItemComponent, OnshoreFormItemContainer, OnshoreFormSortItemComponent, OnshoreFormSwitchItemComponent, OnshoreFormTemplateLayout, OnshoreFormTemplateType, OnshoreFormValidationOutputComponent, OnshoreFormsComponent, OnshoreFormsService, OnshoreImageChooserComponent, OnshoreImageError, OnshoreImagePlaceholderComponent, OnshoreValidators, WebcamComponent };
1399
+ //# sourceMappingURL=onshore-forms.mjs.map