onshore-forms 0.0.58 → 1.0.1

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