onshore-forms 0.0.9 → 0.0.11

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 (33) hide show
  1. package/esm2020/lib/components/form-autocomplete-item/form-autocomplete-item.component.mjs +87 -6
  2. package/esm2020/lib/components/form-checkbox-item/form-checkbox-item.component.mjs +5 -19
  3. package/esm2020/lib/components/form-colorpicker-item/form-colorpicker-item.component.mjs +6 -20
  4. package/esm2020/lib/components/form-datetime-item/form-datetime-item.component.mjs +53 -0
  5. package/esm2020/lib/components/form-dropdown-item/form-dropdown-item.component.mjs +13 -20
  6. package/esm2020/lib/components/form-image-item/form-image-item.component.mjs +22 -19
  7. package/esm2020/lib/components/form-input-item/form-input-item.component.mjs +20 -21
  8. package/esm2020/lib/components/form-item-container/form-item-container.component.mjs +65 -0
  9. package/esm2020/lib/components/form-switch-item/form-switch-item.component.mjs +5 -18
  10. package/esm2020/lib/components/form-validation-output/form-validation-output.component.mjs +5 -5
  11. package/esm2020/lib/enums/form.enums.mjs +10 -1
  12. package/esm2020/lib/models/form.models.mjs +1 -1
  13. package/esm2020/lib/onshore-forms.component.mjs +3 -3
  14. package/esm2020/lib/onshore-forms.module.mjs +30 -13
  15. package/esm2020/public-api.mjs +3 -2
  16. package/fesm2015/onshore-forms.mjs +323 -197
  17. package/fesm2015/onshore-forms.mjs.map +1 -1
  18. package/fesm2020/onshore-forms.mjs +296 -179
  19. package/fesm2020/onshore-forms.mjs.map +1 -1
  20. package/lib/components/form-autocomplete-item/form-autocomplete-item.component.d.ts +27 -3
  21. package/lib/components/{form-textarea-item/form-textarea-item.component.d.ts → form-datetime-item/form-datetime-item.component.d.ts} +7 -5
  22. package/lib/components/form-dropdown-item/form-dropdown-item.component.d.ts +3 -2
  23. package/lib/components/form-image-item/form-image-item.component.d.ts +8 -3
  24. package/lib/components/form-input-item/form-input-item.component.d.ts +9 -3
  25. package/lib/components/form-item-container/form-item-container.component.d.ts +17 -0
  26. package/lib/enums/form.enums.d.ts +8 -0
  27. package/lib/models/form.models.d.ts +10 -23
  28. package/lib/onshore-forms.module.d.ts +27 -23
  29. package/package.json +9 -11
  30. package/public-api.d.ts +2 -1
  31. package/esm2020/lib/components/form-textarea-item/form-textarea-item.component.mjs +0 -61
  32. package/styles/scss/main.scss +0 -4
  33. package/styles/scss/theme1.scss +0 -8
@@ -5,32 +5,40 @@ import { FormGroup, FormControl, FormArray, FormsModule, ReactiveFormsModule } f
5
5
  import { Subject, debounceTime, distinctUntilChanged, skip } from 'rxjs';
6
6
  import * as i2 from '@angular/common';
7
7
  import { CommonModule } from '@angular/common';
8
- import * as i3 from 'primeng/tooltip';
9
- import { TooltipModule } from 'primeng/tooltip';
10
- import * as i4 from 'primeng/inputnumber';
8
+ import * as i3$1 from 'primeng/inputnumber';
11
9
  import { InputNumberModule } from 'primeng/inputnumber';
12
- import * as i5 from 'primeng/inputtext';
10
+ import * as i4 from 'primeng/inputtext';
13
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/tooltip';
15
+ import { TooltipModule } from 'primeng/tooltip';
16
+ import * as i3 from 'primeng/togglebutton';
17
+ import { ToggleButtonModule } from 'primeng/togglebutton';
14
18
  import * as i1 from '@ngx-translate/core';
15
- import * as i4$1 from 'primeng/inputswitch';
19
+ import * as i2$2 from 'primeng/inputswitch';
16
20
  import { InputSwitchModule } from 'primeng/inputswitch';
17
- import * as i4$2 from 'primeng/inputtextarea';
18
- import { InputTextareaModule } from 'primeng/inputtextarea';
19
- import * as i2$1 from 'primeng/dynamicdialog';
21
+ import * as i2$3 from 'primeng/dynamicdialog';
20
22
  import * as i5$1 from 'primeng/button';
21
23
  import { ButtonModule } from 'primeng/button';
22
24
  import * as i6 from 'primeng/ripple';
23
25
  import { RippleModule } from 'primeng/ripple';
24
- import * as i3$1 from 'primeng/dropdown';
26
+ import * as i3$2 from 'primeng/dropdown';
25
27
  import { DropdownModule } from 'primeng/dropdown';
26
- import * as i4$3 from 'primeng/multiselect';
28
+ import * as i4$1 from 'primeng/multiselect';
27
29
  import { MultiSelectModule } from 'primeng/multiselect';
28
- import * as i3$2 from 'primeng/colorpicker';
30
+ import * as i2$4 from 'primeng/colorpicker';
29
31
  import { ColorPickerModule } from 'primeng/colorpicker';
30
- import * as i3$3 from 'primeng/checkbox';
32
+ import * as i2$5 from 'primeng/checkbox';
31
33
  import { CheckboxModule } from 'primeng/checkbox';
34
+ import { __awaiter } from 'tslib';
35
+ import * as i3$3 from 'primeng/autocomplete';
32
36
  import { AutoCompleteModule } from 'primeng/autocomplete';
37
+ import * as i4$2 from 'primeng/api';
33
38
  import { DialogModule } from 'primeng/dialog';
39
+ import { SelectButtonModule } from 'primeng/selectbutton';
40
+ import * as i2$6 from 'primeng/calendar';
41
+ import { CalendarModule } from 'primeng/calendar';
34
42
 
35
43
  var OnshoreFormTemplateType;
36
44
  (function (OnshoreFormTemplateType) {
@@ -43,13 +51,22 @@ var OnshoreFormTemplateType;
43
51
  OnshoreFormTemplateType["phone"] = "phone";
44
52
  OnshoreFormTemplateType["regexp"] = "regexp";
45
53
  OnshoreFormTemplateType["select"] = "select";
54
+ OnshoreFormTemplateType["switch"] = "switch";
46
55
  OnshoreFormTemplateType["check"] = "check";
47
56
  OnshoreFormTemplateType["radio"] = "radio";
48
57
  OnshoreFormTemplateType["image"] = "image";
49
58
  OnshoreFormTemplateType["autocomplete"] = "autocomplete";
50
59
  OnshoreFormTemplateType["color"] = "color";
60
+ OnshoreFormTemplateType["date"] = "date";
61
+ OnshoreFormTemplateType["time"] = "time";
62
+ OnshoreFormTemplateType["datetime"] = "datetime";
51
63
  OnshoreFormTemplateType["subform"] = "subform";
52
64
  })(OnshoreFormTemplateType || (OnshoreFormTemplateType = {}));
65
+ var OnshoreFormTemplateLayout;
66
+ (function (OnshoreFormTemplateLayout) {
67
+ OnshoreFormTemplateLayout["vertical"] = "vertical";
68
+ OnshoreFormTemplateLayout["horizontal"] = "horizontal";
69
+ })(OnshoreFormTemplateLayout || (OnshoreFormTemplateLayout = {}));
53
70
  var OnshoreImageError;
54
71
  (function (OnshoreImageError) {
55
72
  OnshoreImageError["none"] = "";
@@ -221,14 +238,14 @@ class OnshoreFormsComponent {
221
238
  OnshoreFormsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
222
239
  OnshoreFormsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormsComponent, selector: "lib-onshore-forms", ngImport: i0, template: `
223
240
  <p>
224
- onshore-forms works 2!
241
+ onshore-forms works!
225
242
  </p>
226
243
  `, isInline: true });
227
244
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormsComponent, decorators: [{
228
245
  type: Component,
229
246
  args: [{ selector: 'lib-onshore-forms', template: `
230
247
  <p>
231
- onshore-forms works 2!
248
+ onshore-forms works!
232
249
  </p>
233
250
  ` }]
234
251
  }], ctorParameters: function () { return []; } });
@@ -242,9 +259,10 @@ class OnshoreFormValidationOutputComponent {
242
259
  }
243
260
  ngOnChanges(changes) {
244
261
  this.validationTranslation = '';
245
- if (changes['validationErrors'].currentValue) {
262
+ if (changes['validationErrors'].currentValue && this.validationErrors) {
246
263
  Object.keys(this.validationErrors).forEach(error => {
247
- const exists = Object.values(this.validationItems).filter(validationItem => validationItem.key == error);
264
+ var _a;
265
+ const exists = Object.values((_a = this.validationItems) !== null && _a !== void 0 ? _a : []).filter(validationItem => validationItem.key == error);
248
266
  if (exists && exists.length > 0) {
249
267
  this.validationTranslation += this.translate.instant('request.error.' + error) + '<br>';
250
268
  }
@@ -258,10 +276,10 @@ class OnshoreFormValidationOutputComponent {
258
276
  }
259
277
  }
260
278
  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 });
261
- OnshoreFormValidationOutputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormValidationOutputComponent, selector: "onshore-form-validation-output", inputs: { validationErrors: "validationErrors", externValidationPattern: "externValidationPattern", validationItems: "validationItems" }, usesOnChanges: true, ngImport: i0, template: "<small *ngIf=\"validationErrors && validationErrors['pattern']\" [innerHTML]=\"externValidationPattern\"></small>\n<small *ngIf=\"validationTranslation\" [innerHTML]=\"validationTranslation\"></small>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
279
+ OnshoreFormValidationOutputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormValidationOutputComponent, selector: "onshore-form-validation-output", inputs: { validationErrors: "validationErrors", externValidationPattern: "externValidationPattern", validationItems: "validationItems" }, usesOnChanges: true, ngImport: i0, template: "<small class=\"onshore-color-danger\"\n *ngIf=\"validationErrors && validationErrors['pattern']\"\n [innerHTML]=\"externValidationPattern\">\n</small>\n<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 });
262
280
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormValidationOutputComponent, decorators: [{
263
281
  type: Component,
264
- args: [{ selector: 'onshore-form-validation-output', changeDetection: ChangeDetectionStrategy.OnPush, template: "<small *ngIf=\"validationErrors && validationErrors['pattern']\" [innerHTML]=\"externValidationPattern\"></small>\n<small *ngIf=\"validationTranslation\" [innerHTML]=\"validationTranslation\"></small>\n" }]
282
+ args: [{ selector: 'onshore-form-validation-output', changeDetection: ChangeDetectionStrategy.OnPush, template: "<small class=\"onshore-color-danger\"\n *ngIf=\"validationErrors && validationErrors['pattern']\"\n [innerHTML]=\"externValidationPattern\">\n</small>\n<small class=\"onshore-color-danger\"\n *ngIf=\"validationTranslation\"\n [innerHTML]=\"validationTranslation\">\n</small>\n" }]
265
283
  }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.TranslateService }]; }, propDecorators: { validationErrors: [{
266
284
  type: Input
267
285
  }], externValidationPattern: [{
@@ -270,69 +288,72 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
270
288
  type: Input
271
289
  }] } });
272
290
 
273
- class OnshoreFormInputItemComponent {
274
- constructor(ngControl, cdr) {
275
- this.ngControl = ngControl;
291
+ class OnshoreFormItemContainer {
292
+ constructor(cdr) {
276
293
  this.cdr = cdr;
277
- this.FormTemplateItemType = OnshoreFormTemplateType;
278
- this.passwordVisible = false;
279
- this.disabled = false;
280
- this.ngControl.valueAccessor = this;
294
+ this.OnshoreFormTemplateLayout = OnshoreFormTemplateLayout;
281
295
  }
282
- // ControlValueAccessor interface
283
- writeValue(obj) { }
284
- registerOnChange(fn) { }
285
- registerOnTouched(fn) { }
286
- setDisabledState(isDisabled) {
287
- this.disabled = isDisabled;
296
+ enabled(enable) {
297
+ setTimeout(() => {
298
+ if (enable) {
299
+ this.ngControl.control.enable();
300
+ }
301
+ else {
302
+ this.ngControl.control.disable();
303
+ }
304
+ this.cdr.markForCheck();
305
+ }, 100);
288
306
  }
289
307
  ngOnInit() {
290
- var _a, _b, _c, _d, _e, _f;
308
+ var _a, _b;
291
309
  (_a = this.ngControl.control) === null || _a === void 0 ? void 0 : _a.valueChanges.subscribe(() => {
292
310
  this.cdr.markForCheck();
293
311
  });
294
312
  (_b = this.ngControl.control) === null || _b === void 0 ? void 0 : _b.statusChanges.subscribe(() => {
295
313
  this.cdr.markForCheck();
296
314
  });
297
- if (((_c = this.ngControl.control) === null || _c === void 0 ? void 0 : _c.value) == '' && this.formTemplate.default != undefined) {
298
- (_d = this.ngControl.control) === null || _d === void 0 ? void 0 : _d.setValue(this.formTemplate.default);
299
- this.cdr.markForCheck();
300
- }
301
- if (this.formTemplate.enabled) {
302
- (_e = this.ngControl.control) === null || _e === void 0 ? void 0 : _e.enable();
303
- }
304
- else {
305
- (_f = this.ngControl.control) === null || _f === void 0 ? void 0 : _f.disable();
315
+ this.enabled(this.formTemplate.enabled);
316
+ if (this.formTemplate.locked) {
317
+ this.enabled(false);
306
318
  }
307
319
  }
308
320
  ngOnChanges(changes) {
309
- this.cdr.markForCheck();
310
- }
311
- ngOnDestroy() {
312
- var _a;
313
- (_a = this.ngControl.control) === null || _a === void 0 ? void 0 : _a.disable();
321
+ const previousValue = changes['formTemplate'].previousValue;
322
+ const currentValue = changes['formTemplate'].currentValue;
323
+ if (currentValue) {
324
+ if ((previousValue === null || previousValue === void 0 ? void 0 : previousValue.enabled) !== (currentValue === null || currentValue === void 0 ? void 0 : currentValue.enabled)) {
325
+ this.enabled(currentValue === null || currentValue === void 0 ? void 0 : currentValue.enabled);
326
+ }
327
+ if ((previousValue === null || previousValue === void 0 ? void 0 : previousValue.locked) !== (currentValue === null || currentValue === void 0 ? void 0 : currentValue.locked)) {
328
+ if (currentValue.locked) {
329
+ this.enabled(false);
330
+ }
331
+ else {
332
+ this.enabled(currentValue.enabled);
333
+ }
334
+ }
335
+ this.cdr.markForCheck();
336
+ }
314
337
  }
315
338
  }
316
- 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 });
317
- OnshoreFormInputItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormInputItemComponent, selector: "onshore-form-input-item", inputs: { formTemplate: "formTemplate" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"flex flex-column mb-3\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <span class=\"p-inputgroup w-100\">\n\n <container-element [ngSwitch]=\"formTemplate.type\" class=\"w-100\" style=\"width: 100%\">\n\n <input *ngSwitchDefault\n class=\"w-100\"\n type=\"text\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n pInputText\n [formControl]=\"ngControl.control\"\n [class.p-invalid]=\"ngControl.control.touched && ngControl.control.invalid\"\n [autocomplete]=\"'prevent-template-' + formTemplate.name\"/>\n\n <input *ngSwitchCase=\"'password'\"\n class=\"w-100\"\n [type]=\"passwordVisible ? 'text' : formTemplate.type\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n pInputText\n [formControl]=\"ngControl.control\"\n [class.p-invalid]=\"ngControl.control.touched && ngControl.control.invalid\"\n [autocomplete]=\"'prevent-template-' + formTemplate.name\"/>\n\n <p-inputNumber *ngSwitchCase=\"'number'\"\n class=\"w-100\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? 0\"\n [formControl]=\"ngControl.control\"\n [class.p-invalid]=\"ngControl.control.touched && ngControl.control.invalid\"\n [autocomplete]=\"'prevent-template-' + formTemplate.name\"\n [step]=\"formTemplate.settings?.step ?? 1\"\n [min]=\"formTemplate.settings?.min ?? null\"\n [max]=\"formTemplate.settings?.max ?? null\">\n </p-inputNumber>\n <!--\n [showButtons]=\"true\"\n buttonLayout=\"horizontal\"\n spinnerMode=\"horizontal\"\n decrementButtonClass=\"p-button-outlined text-black-50\"\n incrementButtonClass=\"p-button-outlined text-black-50\"\n -->\n </container-element>\n\n <span class=\"p-inputgroup-addon\">\n <i *ngIf=\"formTemplate.type != FormTemplateItemType.password\" class=\"fa\"\n [class.tl-color-black]=\"ngControl.control.untouched\"\n [class.fa-check]=\"formTemplate.required && ngControl.control.valid\"\n [class.tl-color-primary1]=\"ngControl.control.touched && ngControl.control.valid\"\n [class.fa-exclamation-triangle]=\"ngControl.control.touched && ngControl.control.invalid\"\n [class.tl-color-danger]=\"ngControl.control.touched && ngControl.control.invalid\"\n ></i>\n <i *ngIf=\"formTemplate.type == FormTemplateItemType.password\" class=\"fa tl-color-black\"\n [class.fa-eye-slash]=\"passwordVisible\"\n [class.fa-eye]=\"!passwordVisible\"\n (click)=\"passwordVisible = !passwordVisible\"\n ></i>\n </span>\n\n </span>\n\n <small *ngIf=\"formTemplate.description\"><i class=\"fa fa-info-circle\"></i> {{formTemplate.description}}</small>\n\n <div *ngIf=\"ngControl.control.touched\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n", styles: [".p-inputtext{border-color:var(--color-primary)!important}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: i4.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "directive", type: i5.InputText, selector: "[pInputText]" }, { kind: "component", type: OnshoreFormValidationOutputComponent, selector: "onshore-form-validation-output", inputs: ["validationErrors", "externValidationPattern", "validationItems"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
318
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormInputItemComponent, decorators: [{
339
+ OnshoreFormItemContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormItemContainer, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
340
+ OnshoreFormItemContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: { formTemplate: "formTemplate", ngControl: "ngControl" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"mb-4\">\n <div class=\"flex w-full\"\n [class.flex-column]=\"formTemplate.layout == OnshoreFormTemplateLayout.vertical\"\n [class.flex-row]=\"formTemplate.layout == OnshoreFormTemplateLayout.horizontal\"\n [class.justify-content-between]=\"formTemplate.layout == OnshoreFormTemplateLayout.horizontal\">\n\n <div #formLabel\n class=\"flex justify-content-between\"\n [style]=\"formTemplate.labelStyle ?? 'min-width: 200px'\">\n\n <b [class.mr-2]=\"formTemplate.layout == OnshoreFormTemplateLayout.horizontal\"\n [class.mb-2]=\"formTemplate.layout == OnshoreFormTemplateLayout.vertical\">\n {{formTemplate.label}}\n <small *ngIf=\"formTemplate.required\" class=\"onshore-color-danger\">*</small>\n </b>\n\n <div *ngIf=\"formTemplate.tooltip && formTemplate.layout == OnshoreFormTemplateLayout.vertical\" [pTooltip]=\"formTemplate.tooltip\" [escape]=\"false\" 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)=\"enabled($event.checked)\"\n onIcon=\"fa fa-lock-open\"\n offIcon=\"fa fa-lock\"\n class=\"mr-2\"\n [style]=\"{height: '36px'}\">\n </p-toggleButton>\n\n <ng-content></ng-content>\n </div>\n\n <div *ngIf=\"formTemplate.tooltip && formTemplate.layout == OnshoreFormTemplateLayout.horizontal\" class=\"ml-2 align-self-center\" [pTooltip]=\"formTemplate.tooltip\" [escape]=\"false\"><i class=\"fa fa-circle-question onshore-color-gray-5\"></i></div>\n </div>\n\n <div *ngIf=\"ngControl.control.touched\" [style]=\"{'margin-left': formTemplate.layout == OnshoreFormTemplateLayout.horizontal ? formLabel.clientWidth + 'px' : '0px'}\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n <div [style]=\"{'margin-left': formTemplate.layout == OnshoreFormTemplateLayout.horizontal ? formLabel.clientWidth + 'px' : '0px'}\">\n <small *ngIf=\"formTemplate.description\" class=\"mt-2 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.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: i3.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", "externValidationPattern", "validationItems"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
341
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormItemContainer, decorators: [{
319
342
  type: Component,
320
- args: [{ selector: 'onshore-form-input-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-column mb-3\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <span class=\"p-inputgroup w-100\">\n\n <container-element [ngSwitch]=\"formTemplate.type\" class=\"w-100\" style=\"width: 100%\">\n\n <input *ngSwitchDefault\n class=\"w-100\"\n type=\"text\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n pInputText\n [formControl]=\"ngControl.control\"\n [class.p-invalid]=\"ngControl.control.touched && ngControl.control.invalid\"\n [autocomplete]=\"'prevent-template-' + formTemplate.name\"/>\n\n <input *ngSwitchCase=\"'password'\"\n class=\"w-100\"\n [type]=\"passwordVisible ? 'text' : formTemplate.type\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? ''\"\n pInputText\n [formControl]=\"ngControl.control\"\n [class.p-invalid]=\"ngControl.control.touched && ngControl.control.invalid\"\n [autocomplete]=\"'prevent-template-' + formTemplate.name\"/>\n\n <p-inputNumber *ngSwitchCase=\"'number'\"\n class=\"w-100\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.placeholder ?? 0\"\n [formControl]=\"ngControl.control\"\n [class.p-invalid]=\"ngControl.control.touched && ngControl.control.invalid\"\n [autocomplete]=\"'prevent-template-' + formTemplate.name\"\n [step]=\"formTemplate.settings?.step ?? 1\"\n [min]=\"formTemplate.settings?.min ?? null\"\n [max]=\"formTemplate.settings?.max ?? null\">\n </p-inputNumber>\n <!--\n [showButtons]=\"true\"\n buttonLayout=\"horizontal\"\n spinnerMode=\"horizontal\"\n decrementButtonClass=\"p-button-outlined text-black-50\"\n incrementButtonClass=\"p-button-outlined text-black-50\"\n -->\n </container-element>\n\n <span class=\"p-inputgroup-addon\">\n <i *ngIf=\"formTemplate.type != FormTemplateItemType.password\" class=\"fa\"\n [class.tl-color-black]=\"ngControl.control.untouched\"\n [class.fa-check]=\"formTemplate.required && ngControl.control.valid\"\n [class.tl-color-primary1]=\"ngControl.control.touched && ngControl.control.valid\"\n [class.fa-exclamation-triangle]=\"ngControl.control.touched && ngControl.control.invalid\"\n [class.tl-color-danger]=\"ngControl.control.touched && ngControl.control.invalid\"\n ></i>\n <i *ngIf=\"formTemplate.type == FormTemplateItemType.password\" class=\"fa tl-color-black\"\n [class.fa-eye-slash]=\"passwordVisible\"\n [class.fa-eye]=\"!passwordVisible\"\n (click)=\"passwordVisible = !passwordVisible\"\n ></i>\n </span>\n\n </span>\n\n <small *ngIf=\"formTemplate.description\"><i class=\"fa fa-info-circle\"></i> {{formTemplate.description}}</small>\n\n <div *ngIf=\"ngControl.control.touched\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n", styles: [".p-inputtext{border-color:var(--color-primary)!important}\n"] }]
321
- }], ctorParameters: function () {
322
- return [{ type: i1$1.NgControl, decorators: [{
323
- type: Self
324
- }, {
325
- type: Optional
326
- }] }, { type: i0.ChangeDetectorRef }];
327
- }, propDecorators: { formTemplate: [{
343
+ args: [{ selector: 'onshore-form-item-container', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"mb-4\">\n <div class=\"flex w-full\"\n [class.flex-column]=\"formTemplate.layout == OnshoreFormTemplateLayout.vertical\"\n [class.flex-row]=\"formTemplate.layout == OnshoreFormTemplateLayout.horizontal\"\n [class.justify-content-between]=\"formTemplate.layout == OnshoreFormTemplateLayout.horizontal\">\n\n <div #formLabel\n class=\"flex justify-content-between\"\n [style]=\"formTemplate.labelStyle ?? 'min-width: 200px'\">\n\n <b [class.mr-2]=\"formTemplate.layout == OnshoreFormTemplateLayout.horizontal\"\n [class.mb-2]=\"formTemplate.layout == OnshoreFormTemplateLayout.vertical\">\n {{formTemplate.label}}\n <small *ngIf=\"formTemplate.required\" class=\"onshore-color-danger\">*</small>\n </b>\n\n <div *ngIf=\"formTemplate.tooltip && formTemplate.layout == OnshoreFormTemplateLayout.vertical\" [pTooltip]=\"formTemplate.tooltip\" [escape]=\"false\" 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)=\"enabled($event.checked)\"\n onIcon=\"fa fa-lock-open\"\n offIcon=\"fa fa-lock\"\n class=\"mr-2\"\n [style]=\"{height: '36px'}\">\n </p-toggleButton>\n\n <ng-content></ng-content>\n </div>\n\n <div *ngIf=\"formTemplate.tooltip && formTemplate.layout == OnshoreFormTemplateLayout.horizontal\" class=\"ml-2 align-self-center\" [pTooltip]=\"formTemplate.tooltip\" [escape]=\"false\"><i class=\"fa fa-circle-question onshore-color-gray-5\"></i></div>\n </div>\n\n <div *ngIf=\"ngControl.control.touched\" [style]=\"{'margin-left': formTemplate.layout == OnshoreFormTemplateLayout.horizontal ? formLabel.clientWidth + 'px' : '0px'}\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n <div [style]=\"{'margin-left': formTemplate.layout == OnshoreFormTemplateLayout.horizontal ? formLabel.clientWidth + 'px' : '0px'}\">\n <small *ngIf=\"formTemplate.description\" class=\"mt-2 onshore-color-gray-5\"><i class=\"fa fa-info-circle\"></i> {{formTemplate.description}}</small>\n </div>\n\n</div>\n" }]
344
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { formTemplate: [{
345
+ type: Input
346
+ }], ngControl: [{
328
347
  type: Input
329
348
  }] } });
330
349
 
331
- class OnshoreFormSwitchItemComponent {
350
+ class OnshoreFormInputItemComponent {
332
351
  constructor(ngControl, cdr) {
333
352
  this.ngControl = ngControl;
334
353
  this.cdr = cdr;
335
- this.valueChange = new EventEmitter();
354
+ this.OnshoreFormTemplateType = OnshoreFormTemplateType;
355
+ this.OnshoreFormTemplateLayout = OnshoreFormTemplateLayout;
356
+ this.passwordVisible = false;
336
357
  this.disabled = false;
337
358
  this.ngControl.valueAccessor = this;
338
359
  }
@@ -344,27 +365,11 @@ class OnshoreFormSwitchItemComponent {
344
365
  this.disabled = isDisabled;
345
366
  }
346
367
  ngOnInit() {
347
- var _a, _b, _c, _d, _e, _f, _g;
348
- (_a = this.ngControl.control) === null || _a === void 0 ? void 0 : _a.valueChanges.pipe(debounceTime(100), distinctUntilChanged(), skip(1)).subscribe(newValue => {
349
- var _a;
350
- this.valueChange.emit((_a = this.ngControl.control) === null || _a === void 0 ? void 0 : _a.value);
351
- });
352
- (_b = this.ngControl.control) === null || _b === void 0 ? void 0 : _b.valueChanges.subscribe(() => {
353
- this.cdr.markForCheck();
354
- });
355
- (_c = this.ngControl.control) === null || _c === void 0 ? void 0 : _c.statusChanges.subscribe(() => {
356
- this.cdr.markForCheck();
357
- });
358
- if (((_d = this.ngControl.control) === null || _d === void 0 ? void 0 : _d.value) == undefined && this.formTemplate.default != undefined) {
359
- (_e = this.ngControl.control) === null || _e === void 0 ? void 0 : _e.setValue(this.formTemplate.default);
368
+ var _a, _b;
369
+ if (((_a = this.ngControl.control) === null || _a === void 0 ? void 0 : _a.value) == '' && this.formTemplate.default != undefined) {
370
+ (_b = this.ngControl.control) === null || _b === void 0 ? void 0 : _b.setValue(this.formTemplate.default);
360
371
  this.cdr.markForCheck();
361
372
  }
362
- if (this.formTemplate.enabled) {
363
- (_f = this.ngControl.control) === null || _f === void 0 ? void 0 : _f.enable();
364
- }
365
- else {
366
- (_g = this.ngControl.control) === null || _g === void 0 ? void 0 : _g.disable();
367
- }
368
373
  }
369
374
  ngOnChanges(changes) {
370
375
  this.cdr.markForCheck();
@@ -374,11 +379,11 @@ class OnshoreFormSwitchItemComponent {
374
379
  (_a = this.ngControl.control) === null || _a === void 0 ? void 0 : _a.disable();
375
380
  }
376
381
  }
377
- 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 });
378
- OnshoreFormSwitchItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormSwitchItemComponent, selector: "onshore-form-switch-item", inputs: { formTemplate: "formTemplate" }, outputs: { valueChange: "valueChange" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"flex flex-column pt-1\">\n <div class=\"flex justify-content-between align-items-center\">\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <p-inputSwitch [name]=\"formTemplate.name\" [formControl]=\"ngControl.control\" [inputId]=\"formTemplate.name\"></p-inputSwitch>\n\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: i4$1.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabel", "ariaLabelledBy"], outputs: ["onChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
379
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormSwitchItemComponent, decorators: [{
382
+ 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 });
383
+ 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" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\">\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 ?? null\"\n [maxLength]=\"maxLength ?? null\"></textarea>\n\n <input *ngIf=\"formTemplate.type == OnshoreFormTemplateType.text\"\n class=\"w-full\"\n type=\"text\"\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 ?? null\"\n [maxLength]=\"maxLength ?? null\"/>\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 ?? null\"\n [maxLength]=\"maxLength ?? null\"/>\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 ?? null\"\n [max]=\"max ?? null\">\n </p-inputNumber>\n\n <span class=\"p-inputgroup-addon\" *ngIf=\"!disabled\">\n <i class=\"fa\"\n [class.fa-check]=\"formTemplate.required && (ngControl.control.valid || ngControl.control.untouched)\"\n [class.fa-exclamation-triangle]=\"ngControl.control.touched && ngControl.control.invalid\"\n [class.onshore-color-gray-3]=\"ngControl.control.untouched\"\n [class.onshore-color-success]=\"ngControl.control.touched && ngControl.control.valid\"\n [class.onshore-color-danger]=\"ngControl.control.touched && ngControl.control.invalid\">\n </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.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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
384
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormInputItemComponent, decorators: [{
380
385
  type: Component,
381
- args: [{ selector: 'onshore-form-switch-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-column pt-1\">\n <div class=\"flex justify-content-between align-items-center\">\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <p-inputSwitch [name]=\"formTemplate.name\" [formControl]=\"ngControl.control\" [inputId]=\"formTemplate.name\"></p-inputSwitch>\n\n</div>\n" }]
386
+ args: [{ selector: 'onshore-form-input-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\">\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 ?? null\"\n [maxLength]=\"maxLength ?? null\"></textarea>\n\n <input *ngIf=\"formTemplate.type == OnshoreFormTemplateType.text\"\n class=\"w-full\"\n type=\"text\"\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 ?? null\"\n [maxLength]=\"maxLength ?? null\"/>\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 ?? null\"\n [maxLength]=\"maxLength ?? null\"/>\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 ?? null\"\n [max]=\"max ?? null\">\n </p-inputNumber>\n\n <span class=\"p-inputgroup-addon\" *ngIf=\"!disabled\">\n <i class=\"fa\"\n [class.fa-check]=\"formTemplate.required && (ngControl.control.valid || ngControl.control.untouched)\"\n [class.fa-exclamation-triangle]=\"ngControl.control.touched && ngControl.control.invalid\"\n [class.onshore-color-gray-3]=\"ngControl.control.untouched\"\n [class.onshore-color-success]=\"ngControl.control.touched && ngControl.control.valid\"\n [class.onshore-color-danger]=\"ngControl.control.touched && ngControl.control.invalid\">\n </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" }]
382
387
  }], ctorParameters: function () {
383
388
  return [{ type: i1$1.NgControl, decorators: [{
384
389
  type: Self
@@ -387,15 +392,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
387
392
  }] }, { type: i0.ChangeDetectorRef }];
388
393
  }, propDecorators: { formTemplate: [{
389
394
  type: Input
390
- }], valueChange: [{
391
- type: Output
395
+ }], step: [{
396
+ type: Input
397
+ }], min: [{
398
+ type: Input
399
+ }], max: [{
400
+ type: Input
401
+ }], minLength: [{
402
+ type: Input
403
+ }], maxLength: [{
404
+ type: Input
392
405
  }] } });
393
406
 
394
- class OnshoreFormTextareaItemComponent {
407
+ class OnshoreFormSwitchItemComponent {
395
408
  constructor(ngControl, cdr) {
396
409
  this.ngControl = ngControl;
397
410
  this.cdr = cdr;
398
- this.FormTemplateItemType = OnshoreFormTemplateType;
411
+ this.valueChange = new EventEmitter();
399
412
  this.disabled = false;
400
413
  this.ngControl.valueAccessor = this;
401
414
  }
@@ -407,37 +420,29 @@ class OnshoreFormTextareaItemComponent {
407
420
  this.disabled = isDisabled;
408
421
  }
409
422
  ngOnInit() {
410
- var _a, _b, _c, _d, _e, _f;
411
- (_a = this.ngControl.control) === null || _a === void 0 ? void 0 : _a.valueChanges.subscribe(() => {
412
- this.cdr.markForCheck();
413
- });
414
- (_b = this.ngControl.control) === null || _b === void 0 ? void 0 : _b.statusChanges.subscribe(() => {
415
- this.cdr.markForCheck();
423
+ var _a, _b, _c;
424
+ (_a = this.ngControl.control) === null || _a === void 0 ? void 0 : _a.valueChanges.pipe(debounceTime(100), distinctUntilChanged(), skip(1)).subscribe(newValue => {
425
+ var _a;
426
+ this.valueChange.emit((_a = this.ngControl.control) === null || _a === void 0 ? void 0 : _a.value);
416
427
  });
417
- if (((_c = this.ngControl.control) === null || _c === void 0 ? void 0 : _c.value) == '' && this.formTemplate.default != undefined) {
418
- (_d = this.ngControl.control) === null || _d === void 0 ? void 0 : _d.setValue(this.formTemplate.default);
428
+ if (((_b = this.ngControl.control) === null || _b === void 0 ? void 0 : _b.value) == undefined && this.formTemplate.default != undefined) {
429
+ (_c = this.ngControl.control) === null || _c === void 0 ? void 0 : _c.setValue(this.formTemplate.default);
419
430
  this.cdr.markForCheck();
420
431
  }
421
- if (this.formTemplate.enabled) {
422
- (_e = this.ngControl.control) === null || _e === void 0 ? void 0 : _e.enable();
423
- }
424
- else {
425
- (_f = this.ngControl.control) === null || _f === void 0 ? void 0 : _f.disable();
426
- }
432
+ }
433
+ ngOnChanges(changes) {
434
+ this.cdr.markForCheck();
427
435
  }
428
436
  ngOnDestroy() {
429
437
  var _a;
430
438
  (_a = this.ngControl.control) === null || _a === void 0 ? void 0 : _a.disable();
431
439
  }
432
- ngOnChanges(changes) {
433
- this.cdr.markForCheck();
434
- }
435
440
  }
436
- OnshoreFormTextareaItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormTextareaItemComponent, deps: [{ token: i1$1.NgControl, optional: true, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
437
- OnshoreFormTextareaItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormTextareaItemComponent, selector: "onshore-form-textarea-item", inputs: { formTemplate: "formTemplate" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"flex flex-column mb-3\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <span class=\"p-input-icon-right\">\n <i class=\"fa\"\n [class.tl-color-black]=\"ngControl.control?.untouched\"\n [class.fa-check]=\"ngControl.control?.touched && ngControl.control?.valid\"\n [class.text-primary]=\"ngControl.control?.touched && ngControl.control?.valid\"\n [class.fa-exclamation-triangle]=\"ngControl.control?.touched && ngControl.control?.invalid\"\n [class.tl-color-danger]=\"ngControl.control?.touched && ngControl.control?.invalid\"\n ></i>\n <textarea class=\"w-100\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.label\"\n [rows]=\"3\"\n [cols]=\"30\"\n pInputTextarea\n [autoResize]=\"true\"\n [formControl]=\"ngControl.control\"\n [class.p-invalid]=\"ngControl.control?.touched && ngControl.control?.invalid\"></textarea>\n </span>\n\n <small *ngIf=\"formTemplate.description\"><i class=\"fa fa-info-circle\"></i> {{formTemplate.description}}</small>\n\n <div *ngIf=\"ngControl.control?.touched\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control?.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "directive", type: i4$2.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { kind: "component", type: OnshoreFormValidationOutputComponent, selector: "onshore-form-validation-output", inputs: ["validationErrors", "externValidationPattern", "validationItems"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
438
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormTextareaItemComponent, decorators: [{
441
+ 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 });
442
+ OnshoreFormSwitchItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormSwitchItemComponent, selector: "onshore-form-switch-item", inputs: { formTemplate: "formTemplate" }, outputs: { valueChange: "valueChange" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\">\n <p-inputSwitch [name]=\"formTemplate.name\"\n [formControl]=\"ngControl.control\"\n [disabled]=\"disabled\"\n [inputId]=\"formTemplate.name\" class=\"align-self-center\">\n </p-inputSwitch>\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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
443
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormSwitchItemComponent, decorators: [{
439
444
  type: Component,
440
- args: [{ selector: 'onshore-form-textarea-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-column mb-3\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <span class=\"p-input-icon-right\">\n <i class=\"fa\"\n [class.tl-color-black]=\"ngControl.control?.untouched\"\n [class.fa-check]=\"ngControl.control?.touched && ngControl.control?.valid\"\n [class.text-primary]=\"ngControl.control?.touched && ngControl.control?.valid\"\n [class.fa-exclamation-triangle]=\"ngControl.control?.touched && ngControl.control?.invalid\"\n [class.tl-color-danger]=\"ngControl.control?.touched && ngControl.control?.invalid\"\n ></i>\n <textarea class=\"w-100\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.label\"\n [rows]=\"3\"\n [cols]=\"30\"\n pInputTextarea\n [autoResize]=\"true\"\n [formControl]=\"ngControl.control\"\n [class.p-invalid]=\"ngControl.control?.touched && ngControl.control?.invalid\"></textarea>\n </span>\n\n <small *ngIf=\"formTemplate.description\"><i class=\"fa fa-info-circle\"></i> {{formTemplate.description}}</small>\n\n <div *ngIf=\"ngControl.control?.touched\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control?.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n" }]
445
+ args: [{ selector: 'onshore-form-switch-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\">\n <p-inputSwitch [name]=\"formTemplate.name\"\n [formControl]=\"ngControl.control\"\n [disabled]=\"disabled\"\n [inputId]=\"formTemplate.name\" class=\"align-self-center\">\n </p-inputSwitch>\n</onshore-form-item-container>\n" }]
441
446
  }], ctorParameters: function () {
442
447
  return [{ type: i1$1.NgControl, decorators: [{
443
448
  type: Self
@@ -446,6 +451,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
446
451
  }] }, { type: i0.ChangeDetectorRef }];
447
452
  }, propDecorators: { formTemplate: [{
448
453
  type: Input
454
+ }], valueChange: [{
455
+ type: Output
449
456
  }] } });
450
457
 
451
458
  class OnshoreFormImageItemComponent {
@@ -460,6 +467,12 @@ class OnshoreFormImageItemComponent {
460
467
  this.imageHeight = 400;
461
468
  this.containWithinAspectRatio = false;
462
469
  this.aspectRatio = 1 / 1;
470
+ this.disableImageSelection = false;
471
+ this.disableWebcamSelection = false;
472
+ this.disableMediaSelection = false;
473
+ this.disableDelete = false;
474
+ this.imagePlaceholder = '';
475
+ this.mediaType = '';
463
476
  this.imageDeleted = new EventEmitter();
464
477
  this.imageCleared = new EventEmitter();
465
478
  this.imageSelectedFromMedia = new EventEmitter();
@@ -499,7 +512,7 @@ class OnshoreFormImageItemComponent {
499
512
  styleClass: 'p-dialog-background-white',
500
513
  modal: true,
501
514
  header: this.translate.instant('search.media.dialogTitle'),
502
- data: { targetType: this.formSettings.mediaType }
515
+ data: { targetType: this.mediaType }
503
516
  }).onClose.subscribe((result) => {
504
517
  if(result) {
505
518
  this.image = result.url;
@@ -545,25 +558,10 @@ class OnshoreFormImageItemComponent {
545
558
  this.cdr.markForCheck();
546
559
  }
547
560
  ngOnInit() {
548
- this.ngControl.control.valueChanges.subscribe((value) => {
549
- this.cdr.markForCheck();
550
- });
551
- this.ngControl.control.statusChanges.subscribe((status) => {
552
- this.cdr.markForCheck();
553
- });
554
561
  if (this.ngControl.control.value == '' && this.formTemplate.default != undefined) {
555
562
  this.ngControl.control.setValue(this.formTemplate.default);
556
563
  this.cdr.markForCheck();
557
564
  }
558
- if (this.formTemplate.enabled) {
559
- this.ngControl.control.enable();
560
- }
561
- else {
562
- this.ngControl.control.disable();
563
- }
564
- if (this.formTemplate.settings) {
565
- this.formSettings = this.formTemplate.settings;
566
- }
567
565
  }
568
566
  ngOnDestroy() {
569
567
  this.subscriptions.forEach((subscription) => {
@@ -573,17 +571,17 @@ class OnshoreFormImageItemComponent {
573
571
  this.image = null;
574
572
  }
575
573
  }
576
- OnshoreFormImageItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormImageItemComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$1.NgControl, optional: true, self: true }, { token: i2$1.DialogService }, { token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
577
- OnshoreFormImageItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormImageItemComponent, selector: "onshore-form-image-item", inputs: { formTemplate: "formTemplate", inverseColor: "inverseColor", imageWidth: "imageWidth", imageHeight: "imageHeight", containWithinAspectRatio: "containWithinAspectRatio", aspectRatio: "aspectRatio" }, outputs: { imageDeleted: "imageDeleted", imageCleared: "imageCleared", imageSelectedFromMedia: "imageSelectedFromMedia" }, ngImport: i0, template: "<div class=\"flex flex-column mb-3\" style=\"max-width: 500px\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <div class=\"w-100\">\n\n <div class=\"position-relative flex justify-content-center align-items-center\" style=\"background-color: white\">\n <!--<app-image-placeholder class=\"w-100\" [image]=\"image\" imageStyle=\"position: absolut; height: 250px; width: 250px\" [placeholder]=\"formSettings?.imagePlaceholder ? formSettings?.imagePlaceholder + ' fa-10x' : 'fa-image fa-10x'\" placeholderStyle=\"width: 250px; height: 250px\"></app-image-placeholder>-->\n </div>\n\n <div class=\"flex flex-column mt-4 w-100\">\n <button pButton pRipple type=\"button\"\n [hidden]=\"formSettings?.disableImageSelection\"\n icon=\"fa fa-image\"\n label=\"Bild hochladen\"\n class=\"p-button-rounded p-button-outlined text-secondary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"imageChooserDialogVisible = true\">\n </button>\n\n <button pButton pRipple type=\"button\"\n [hidden]=\"formSettings?.disableWebcamSelection\"\n icon=\"fa fa-camera\"\n label=\"Foto aufnehmen\"\n class=\"p-button-rounded p-button-outlined text-secondary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"webcamDialogVisible = true\">\n </button>\n\n <!--<button pButton pRipple type=\"button\"\n [hidden]=\"formSettings?.disableMediaSelection\"\n icon=\"fa fa-photo-video\"\n label=\"Medienverwaltung\"\n class=\"p-button-rounded p-button-outlined text-secondary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"searchMedia()\">\n </button>-->\n\n <button pButton pRipple type=\"button\"\n [hidden]=\"formSettings?.disableDelete\"\n icon=\"fa fa-eraser\"\n label=\"Entfernen\"\n (click)=\"removeImage()\"\n [disabled]=\"!image || disabled\"\n class=\"p-button-rounded p-button-outlined text-secondary\">\n </button>\n\n </div>\n\n </div>\n\n <small *ngIf=\"formTemplate.description\"><i class=\"fa fa-info-circle\"></i> {{formTemplate.description}}</small>\n\n</div>\n\n<!--\n<p-dialog [header]=\"'Bild ausw\u00E4hlen'\" [(visible)]=\"imageChooserDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\">\n <app-image-chooser buttonLabel=\"Ausw\u00E4hlen\"\n (choosen)=\"getFileImage($event)\"\n (canceled)=\"imageChooserDialogVisible = false\"\n [inverseColor]=\"inverseColor\"\n [resizeToWidth]=\"imageWidth\"\n [resizeToHeight]=\"imageHeight\"\n [containWithinAspectRatio]=\"containWithinAspectRatio\"\n [aspectRatio]=\"aspectRatio\"\n backgroundColor=\"transparent\"></app-image-chooser>\n</p-dialog>\n-->\n\n<!--\n<p-dialog [header]=\"'Foto aufnehmen'\" [(visible)]=\"webcamDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\">\n <app-webcam *ngIf=\"webcamDialogVisible\" buttonLabel=\"Smile\" (shot)=\"getWebcamImage($event)\" (canceled)=\"webcamDialogVisible = false\" [inverseColor]=\"inverseColor\"></app-webcam>\n</p-dialog>\n-->\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "directive", type: i6.Ripple, selector: "[pRipple]" }, { kind: "directive", type: i3.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
574
+ 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 }, { token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
575
+ OnshoreFormImageItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormImageItemComponent, selector: "onshore-form-image-item", inputs: { formTemplate: "formTemplate", inverseColor: "inverseColor", imageWidth: "imageWidth", imageHeight: "imageHeight", containWithinAspectRatio: "containWithinAspectRatio", aspectRatio: "aspectRatio", disableImageSelection: "disableImageSelection", disableWebcamSelection: "disableWebcamSelection", disableMediaSelection: "disableMediaSelection", disableDelete: "disableDelete", imagePlaceholder: "imagePlaceholder", mediaType: "mediaType" }, outputs: { imageDeleted: "imageDeleted", imageCleared: "imageCleared", imageSelectedFromMedia: "imageSelectedFromMedia" }, ngImport: i0, template: "<div class=\"flex flex-column mb-3\" style=\"max-width: 500px\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <div class=\"w-100\">\n\n <div class=\"position-relative flex justify-content-center align-items-center\" style=\"background-color: white\">\n <!--<app-image-placeholder class=\"w-100\" [image]=\"image\" imageStyle=\"position: absolut; height: 250px; width: 250px\" [placeholder]=\"fimagePlaceholder ? imagePlaceholder + ' fa-10x' : 'fa-image fa-10x'\" placeholderStyle=\"width: 250px; height: 250px\"></app-image-placeholder>-->\n </div>\n\n <div class=\"flex flex-column mt-4 w-100\">\n <button pButton pRipple type=\"button\"\n [hidden]=\"disableImageSelection\"\n icon=\"fa fa-image\"\n label=\"Bild hochladen\"\n class=\"p-button-rounded p-button-outlined text-secondary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"imageChooserDialogVisible = true\">\n </button>\n\n <button pButton pRipple type=\"button\"\n [hidden]=\"disableWebcamSelection\"\n icon=\"fa fa-camera\"\n label=\"Foto aufnehmen\"\n class=\"p-button-rounded p-button-outlined text-secondary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"webcamDialogVisible = true\">\n </button>\n\n <!--<button pButton pRipple type=\"button\"\n [hidden]=\"disableMediaSelection\"\n icon=\"fa fa-photo-video\"\n label=\"Medienverwaltung\"\n class=\"p-button-rounded p-button-outlined text-secondary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"searchMedia()\">\n </button>-->\n\n <button pButton pRipple type=\"button\"\n [hidden]=\"disableDelete\"\n icon=\"fa fa-eraser\"\n label=\"Entfernen\"\n (click)=\"removeImage()\"\n [disabled]=\"!image || disabled\"\n class=\"p-button-rounded p-button-outlined text-secondary\">\n </button>\n\n </div>\n\n </div>\n\n <small *ngIf=\"formTemplate.description\"><i class=\"fa fa-info-circle\"></i> {{formTemplate.description}}</small>\n\n</div>\n\n<!--\n<p-dialog [header]=\"'Bild ausw\u00E4hlen'\" [(visible)]=\"imageChooserDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\">\n <app-image-chooser buttonLabel=\"Ausw\u00E4hlen\"\n (choosen)=\"getFileImage($event)\"\n (canceled)=\"imageChooserDialogVisible = false\"\n [inverseColor]=\"inverseColor\"\n [resizeToWidth]=\"imageWidth\"\n [resizeToHeight]=\"imageHeight\"\n [containWithinAspectRatio]=\"containWithinAspectRatio\"\n [aspectRatio]=\"aspectRatio\"\n backgroundColor=\"transparent\"></app-image-chooser>\n</p-dialog>\n-->\n\n<!--\n<p-dialog [header]=\"'Foto aufnehmen'\" [(visible)]=\"webcamDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\">\n <app-webcam *ngIf=\"webcamDialogVisible\" buttonLabel=\"Smile\" (shot)=\"getWebcamImage($event)\" (canceled)=\"webcamDialogVisible = false\" [inverseColor]=\"inverseColor\"></app-webcam>\n</p-dialog>\n-->\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "directive", type: i6.Ripple, selector: "[pRipple]" }, { kind: "directive", type: i2$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
578
576
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormImageItemComponent, decorators: [{
579
577
  type: Component,
580
- args: [{ selector: 'onshore-form-image-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-column mb-3\" style=\"max-width: 500px\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <div class=\"w-100\">\n\n <div class=\"position-relative flex justify-content-center align-items-center\" style=\"background-color: white\">\n <!--<app-image-placeholder class=\"w-100\" [image]=\"image\" imageStyle=\"position: absolut; height: 250px; width: 250px\" [placeholder]=\"formSettings?.imagePlaceholder ? formSettings?.imagePlaceholder + ' fa-10x' : 'fa-image fa-10x'\" placeholderStyle=\"width: 250px; height: 250px\"></app-image-placeholder>-->\n </div>\n\n <div class=\"flex flex-column mt-4 w-100\">\n <button pButton pRipple type=\"button\"\n [hidden]=\"formSettings?.disableImageSelection\"\n icon=\"fa fa-image\"\n label=\"Bild hochladen\"\n class=\"p-button-rounded p-button-outlined text-secondary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"imageChooserDialogVisible = true\">\n </button>\n\n <button pButton pRipple type=\"button\"\n [hidden]=\"formSettings?.disableWebcamSelection\"\n icon=\"fa fa-camera\"\n label=\"Foto aufnehmen\"\n class=\"p-button-rounded p-button-outlined text-secondary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"webcamDialogVisible = true\">\n </button>\n\n <!--<button pButton pRipple type=\"button\"\n [hidden]=\"formSettings?.disableMediaSelection\"\n icon=\"fa fa-photo-video\"\n label=\"Medienverwaltung\"\n class=\"p-button-rounded p-button-outlined text-secondary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"searchMedia()\">\n </button>-->\n\n <button pButton pRipple type=\"button\"\n [hidden]=\"formSettings?.disableDelete\"\n icon=\"fa fa-eraser\"\n label=\"Entfernen\"\n (click)=\"removeImage()\"\n [disabled]=\"!image || disabled\"\n class=\"p-button-rounded p-button-outlined text-secondary\">\n </button>\n\n </div>\n\n </div>\n\n <small *ngIf=\"formTemplate.description\"><i class=\"fa fa-info-circle\"></i> {{formTemplate.description}}</small>\n\n</div>\n\n<!--\n<p-dialog [header]=\"'Bild ausw\u00E4hlen'\" [(visible)]=\"imageChooserDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\">\n <app-image-chooser buttonLabel=\"Ausw\u00E4hlen\"\n (choosen)=\"getFileImage($event)\"\n (canceled)=\"imageChooserDialogVisible = false\"\n [inverseColor]=\"inverseColor\"\n [resizeToWidth]=\"imageWidth\"\n [resizeToHeight]=\"imageHeight\"\n [containWithinAspectRatio]=\"containWithinAspectRatio\"\n [aspectRatio]=\"aspectRatio\"\n backgroundColor=\"transparent\"></app-image-chooser>\n</p-dialog>\n-->\n\n<!--\n<p-dialog [header]=\"'Foto aufnehmen'\" [(visible)]=\"webcamDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\">\n <app-webcam *ngIf=\"webcamDialogVisible\" buttonLabel=\"Smile\" (shot)=\"getWebcamImage($event)\" (canceled)=\"webcamDialogVisible = false\" [inverseColor]=\"inverseColor\"></app-webcam>\n</p-dialog>\n-->\n" }]
578
+ args: [{ selector: 'onshore-form-image-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-column mb-3\" style=\"max-width: 500px\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <div class=\"w-100\">\n\n <div class=\"position-relative flex justify-content-center align-items-center\" style=\"background-color: white\">\n <!--<app-image-placeholder class=\"w-100\" [image]=\"image\" imageStyle=\"position: absolut; height: 250px; width: 250px\" [placeholder]=\"fimagePlaceholder ? imagePlaceholder + ' fa-10x' : 'fa-image fa-10x'\" placeholderStyle=\"width: 250px; height: 250px\"></app-image-placeholder>-->\n </div>\n\n <div class=\"flex flex-column mt-4 w-100\">\n <button pButton pRipple type=\"button\"\n [hidden]=\"disableImageSelection\"\n icon=\"fa fa-image\"\n label=\"Bild hochladen\"\n class=\"p-button-rounded p-button-outlined text-secondary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"imageChooserDialogVisible = true\">\n </button>\n\n <button pButton pRipple type=\"button\"\n [hidden]=\"disableWebcamSelection\"\n icon=\"fa fa-camera\"\n label=\"Foto aufnehmen\"\n class=\"p-button-rounded p-button-outlined text-secondary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"webcamDialogVisible = true\">\n </button>\n\n <!--<button pButton pRipple type=\"button\"\n [hidden]=\"disableMediaSelection\"\n icon=\"fa fa-photo-video\"\n label=\"Medienverwaltung\"\n class=\"p-button-rounded p-button-outlined text-secondary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"searchMedia()\">\n </button>-->\n\n <button pButton pRipple type=\"button\"\n [hidden]=\"disableDelete\"\n icon=\"fa fa-eraser\"\n label=\"Entfernen\"\n (click)=\"removeImage()\"\n [disabled]=\"!image || disabled\"\n class=\"p-button-rounded p-button-outlined text-secondary\">\n </button>\n\n </div>\n\n </div>\n\n <small *ngIf=\"formTemplate.description\"><i class=\"fa fa-info-circle\"></i> {{formTemplate.description}}</small>\n\n</div>\n\n<!--\n<p-dialog [header]=\"'Bild ausw\u00E4hlen'\" [(visible)]=\"imageChooserDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\">\n <app-image-chooser buttonLabel=\"Ausw\u00E4hlen\"\n (choosen)=\"getFileImage($event)\"\n (canceled)=\"imageChooserDialogVisible = false\"\n [inverseColor]=\"inverseColor\"\n [resizeToWidth]=\"imageWidth\"\n [resizeToHeight]=\"imageHeight\"\n [containWithinAspectRatio]=\"containWithinAspectRatio\"\n [aspectRatio]=\"aspectRatio\"\n backgroundColor=\"transparent\"></app-image-chooser>\n</p-dialog>\n-->\n\n<!--\n<p-dialog [header]=\"'Foto aufnehmen'\" [(visible)]=\"webcamDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\">\n <app-webcam *ngIf=\"webcamDialogVisible\" buttonLabel=\"Smile\" (shot)=\"getWebcamImage($event)\" (canceled)=\"webcamDialogVisible = false\" [inverseColor]=\"inverseColor\"></app-webcam>\n</p-dialog>\n-->\n" }]
581
579
  }], ctorParameters: function () {
582
580
  return [{ type: i0.ChangeDetectorRef }, { type: i1$1.NgControl, decorators: [{
583
581
  type: Self
584
582
  }, {
585
583
  type: Optional
586
- }] }, { type: i2$1.DialogService }, { type: i1.TranslateService }];
584
+ }] }, { type: i2$3.DialogService }, { type: i1.TranslateService }];
587
585
  }, propDecorators: { formTemplate: [{
588
586
  type: Input
589
587
  }], inverseColor: [{
@@ -596,6 +594,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
596
594
  type: Input
597
595
  }], aspectRatio: [{
598
596
  type: Input
597
+ }], disableImageSelection: [{
598
+ type: Input
599
+ }], disableWebcamSelection: [{
600
+ type: Input
601
+ }], disableMediaSelection: [{
602
+ type: Input
603
+ }], disableDelete: [{
604
+ type: Input
605
+ }], imagePlaceholder: [{
606
+ type: Input
607
+ }], mediaType: [{
608
+ type: Input
599
609
  }], imageDeleted: [{
600
610
  type: Output
601
611
  }], imageCleared: [{
@@ -608,8 +618,9 @@ class OnshoreFormDropdownItemComponent {
608
618
  constructor(ngControl, cdr) {
609
619
  this.ngControl = ngControl;
610
620
  this.cdr = cdr;
611
- this.disabled = false;
612
621
  this.multiple = false;
622
+ this.showClear = false;
623
+ this.disabled = false;
613
624
  this.ngControl.valueAccessor = this;
614
625
  }
615
626
  // ControlValueAccessor interface
@@ -621,27 +632,16 @@ class OnshoreFormDropdownItemComponent {
621
632
  }
622
633
  clearSelection() {
623
634
  var _a;
624
- (_a = this.ngControl.control) === null || _a === void 0 ? void 0 : _a.setValue(null);
635
+ (_a = this.ngControl.control) === null || _a === void 0 ? void 0 : _a.reset();
636
+ //this.ngControl.control?.setValue(this.multiple ? [] : '');
637
+ this.cdr.markForCheck();
625
638
  }
626
639
  ngOnInit() {
627
- var _a, _b, _c, _d, _e, _f, _g;
628
- (_a = this.ngControl.control) === null || _a === void 0 ? void 0 : _a.valueChanges.subscribe(() => {
629
- this.cdr.markForCheck();
630
- });
631
- (_b = this.ngControl.control) === null || _b === void 0 ? void 0 : _b.statusChanges.subscribe(() => {
632
- this.cdr.markForCheck();
633
- });
634
- if (((_c = this.ngControl.control) === null || _c === void 0 ? void 0 : _c.value) == '' && this.formTemplate.default != undefined) {
635
- (_d = this.ngControl.control) === null || _d === void 0 ? void 0 : _d.setValue(this.formTemplate.default);
640
+ var _a, _b;
641
+ if (((_a = this.ngControl.control) === null || _a === void 0 ? void 0 : _a.value) == '' && this.formTemplate.default != undefined) {
642
+ (_b = this.ngControl.control) === null || _b === void 0 ? void 0 : _b.setValue(this.formTemplate.default);
636
643
  this.cdr.markForCheck();
637
644
  }
638
- if (this.formTemplate.enabled) {
639
- (_e = this.ngControl.control) === null || _e === void 0 ? void 0 : _e.enable();
640
- }
641
- else {
642
- (_f = this.ngControl.control) === null || _f === void 0 ? void 0 : _f.disable();
643
- }
644
- this.multiple = (_g = this.formTemplate.settings) === null || _g === void 0 ? void 0 : _g.multiple;
645
645
  }
646
646
  ngOnDestroy() {
647
647
  var _a;
@@ -652,10 +652,10 @@ class OnshoreFormDropdownItemComponent {
652
652
  }
653
653
  }
654
654
  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 });
655
- OnshoreFormDropdownItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormDropdownItemComponent, selector: "onshore-form-dropdown-item", inputs: { formTemplate: "formTemplate" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"flex flex-column mb-3\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate?.label}}\n <span *ngIf=\"formTemplate?.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate?.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate?.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <p-dropdown *ngIf=\"!multiple\"\n class=\"w-100\"\n [options]=\"formTemplate?.options\"\n [formControl]=\"ngControl.control\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [dataKey]=\"formTemplate?.optionDataKey\"\n [showClear]=\"formTemplate?.settings?.showClear\"\n (onClear)=\"clearSelection()\"\n optionDisabled=\"disabled\"\n appendTo=\"body\">\n </p-dropdown>\n\n <p-multiSelect *ngIf=\"multiple\"\n class=\"w-100\"\n [options]=\"formTemplate?.options\"\n [formControl]=\"ngControl.control\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [dataKey]=\"formTemplate?.optionDataKey\"\n display=\"chip\"\n optionDisabled=\"disabled\"\n appendTo=\"body\"></p-multiSelect>\n\n <div *ngIf=\"ngControl.control.touched\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate?.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i3$1.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "disabled", "itemSize", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "component", type: i4$3.MultiSelect, selector: "p-multiSelect", inputs: ["style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "appendTo", "dataKey", "name", "label", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "autoZIndex", "baseZIndex", "filterBy", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "defaultLabel", "placeholder", "options", "filterValue", "itemSize"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad"] }, { kind: "directive", type: i3.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: OnshoreFormValidationOutputComponent, selector: "onshore-form-validation-output", inputs: ["validationErrors", "externValidationPattern", "validationItems"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
655
+ 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" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\">\n <p-dropdown *ngIf=\"!multiple\"\n class=\"w-full\"\n [options]=\"formTemplate?.options\"\n [formControl]=\"ngControl.control\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [dataKey]=\"formTemplate?.optionDataKey\"\n [showClear]=\"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]=\"formTemplate?.options\"\n [formControl]=\"ngControl.control\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [dataKey]=\"formTemplate?.optionDataKey\"\n [showClear]=\"showClear\"\n (onClear)=\"clearSelection()\"\n display=\"chip\"\n optionDisabled=\"disabled\"\n appendTo=\"body\"></p-multiSelect>\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$2.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$1.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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
656
656
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormDropdownItemComponent, decorators: [{
657
657
  type: Component,
658
- args: [{ selector: 'onshore-form-dropdown-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-column mb-3\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate?.label}}\n <span *ngIf=\"formTemplate?.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate?.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate?.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <p-dropdown *ngIf=\"!multiple\"\n class=\"w-100\"\n [options]=\"formTemplate?.options\"\n [formControl]=\"ngControl.control\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [dataKey]=\"formTemplate?.optionDataKey\"\n [showClear]=\"formTemplate?.settings?.showClear\"\n (onClear)=\"clearSelection()\"\n optionDisabled=\"disabled\"\n appendTo=\"body\">\n </p-dropdown>\n\n <p-multiSelect *ngIf=\"multiple\"\n class=\"w-100\"\n [options]=\"formTemplate?.options\"\n [formControl]=\"ngControl.control\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [dataKey]=\"formTemplate?.optionDataKey\"\n display=\"chip\"\n optionDisabled=\"disabled\"\n appendTo=\"body\"></p-multiSelect>\n\n <div *ngIf=\"ngControl.control.touched\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate?.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n" }]
658
+ args: [{ selector: 'onshore-form-dropdown-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\">\n <p-dropdown *ngIf=\"!multiple\"\n class=\"w-full\"\n [options]=\"formTemplate?.options\"\n [formControl]=\"ngControl.control\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [dataKey]=\"formTemplate?.optionDataKey\"\n [showClear]=\"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]=\"formTemplate?.options\"\n [formControl]=\"ngControl.control\"\n [name]=\"formTemplate?.name\"\n [placeholder]=\"formTemplate?.placeholder\"\n [disabled]=\"disabled\"\n [dataKey]=\"formTemplate?.optionDataKey\"\n [showClear]=\"showClear\"\n (onClear)=\"clearSelection()\"\n display=\"chip\"\n optionDisabled=\"disabled\"\n appendTo=\"body\"></p-multiSelect>\n</onshore-form-item-container>\n" }]
659
659
  }], ctorParameters: function () {
660
660
  return [{ type: i1$1.NgControl, decorators: [{
661
661
  type: Self
@@ -664,6 +664,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
664
664
  }] }, { type: i0.ChangeDetectorRef }];
665
665
  }, propDecorators: { formTemplate: [{
666
666
  type: Input
667
+ }], multiple: [{
668
+ type: Input
669
+ }], showClear: [{
670
+ type: Input
667
671
  }] } });
668
672
 
669
673
  class OnshoreFormColorpickerItemComponent {
@@ -690,24 +694,12 @@ class OnshoreFormColorpickerItemComponent {
690
694
  this.colorPickerValue = (_a = input.target) === null || _a === void 0 ? void 0 : _a.value;
691
695
  }
692
696
  ngOnInit() {
693
- var _a, _b, _c, _d, _e, _f;
694
- (_a = this.ngControl.control) === null || _a === void 0 ? void 0 : _a.valueChanges.subscribe(() => {
695
- this.cdr.markForCheck();
696
- });
697
- (_b = this.ngControl.control) === null || _b === void 0 ? void 0 : _b.statusChanges.subscribe(() => {
698
- this.cdr.markForCheck();
699
- });
700
- if (((_c = this.ngControl.control) === null || _c === void 0 ? void 0 : _c.value) == '' && this.formTemplate.default != undefined) {
701
- (_d = this.ngControl.control) === null || _d === void 0 ? void 0 : _d.setValue(this.formTemplate.default);
697
+ var _a, _b;
698
+ if (((_a = this.ngControl.control) === null || _a === void 0 ? void 0 : _a.value) == '' && this.formTemplate.default != undefined) {
699
+ (_b = this.ngControl.control) === null || _b === void 0 ? void 0 : _b.setValue(this.formTemplate.default);
702
700
  this.colorPickerValue = this.formTemplate.default;
703
701
  this.cdr.markForCheck();
704
702
  }
705
- if (this.formTemplate.enabled) {
706
- (_e = this.ngControl.control) === null || _e === void 0 ? void 0 : _e.enable();
707
- }
708
- else {
709
- (_f = this.ngControl.control) === null || _f === void 0 ? void 0 : _f.disable();
710
- }
711
703
  }
712
704
  ngOnDestroy() {
713
705
  var _a;
@@ -720,10 +712,10 @@ class OnshoreFormColorpickerItemComponent {
720
712
  }
721
713
  }
722
714
  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 });
723
- OnshoreFormColorpickerItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormColorpickerItemComponent, selector: "onshore-form-colorpicker-item", inputs: { formTemplate: "formTemplate" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"flex flex-column mb-3\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}:\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <div class=\"flex w-100\">\n <p-colorPicker [(ngModel)]=\"colorPickerValue\" format=\"hex\" [inline]=\"false\" appendTo=\"body\" [baseZIndex]=\"99999\" (onChange)=\"changeColor()\"></p-colorPicker>\n <input class=\"w-100 ml-2\"\n type=\"text\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.label\"\n [formControl]=\"ngControl.control\"\n pInputText\n [value]=\"ngControl.control.value\"\n (input)=\"changeInput($event)\"/>\n </div>\n\n <div *ngIf=\"ngControl.control.touched\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i3$2.ColorPicker, selector: "p-colorPicker", inputs: ["style", "styleClass", "inline", "format", "appendTo", "disabled", "tabindex", "inputId", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onChange", "onShow", "onHide"] }, { kind: "directive", type: i3.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "directive", type: i5.InputText, selector: "[pInputText]" }, { kind: "component", type: OnshoreFormValidationOutputComponent, selector: "onshore-form-validation-output", inputs: ["validationErrors", "externValidationPattern", "validationItems"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
715
+ OnshoreFormColorpickerItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormColorpickerItemComponent, selector: "onshore-form-colorpicker-item", inputs: { formTemplate: "formTemplate" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\">\n <div class=\"flex w-full\">\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\n <input class=\"w-full ml-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 </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.InputText, selector: "[pInputText]" }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
724
716
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormColorpickerItemComponent, decorators: [{
725
717
  type: Component,
726
- args: [{ selector: 'onshore-form-colorpicker-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-column mb-3\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}:\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <div class=\"flex w-100\">\n <p-colorPicker [(ngModel)]=\"colorPickerValue\" format=\"hex\" [inline]=\"false\" appendTo=\"body\" [baseZIndex]=\"99999\" (onChange)=\"changeColor()\"></p-colorPicker>\n <input class=\"w-100 ml-2\"\n type=\"text\"\n [name]=\"formTemplate.name\"\n [placeholder]=\"formTemplate.label\"\n [formControl]=\"ngControl.control\"\n pInputText\n [value]=\"ngControl.control.value\"\n (input)=\"changeInput($event)\"/>\n </div>\n\n <div *ngIf=\"ngControl.control.touched\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n" }]
718
+ args: [{ selector: 'onshore-form-colorpicker-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\">\n <div class=\"flex w-full\">\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\n <input class=\"w-full ml-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 </div>\n</onshore-form-item-container>\n" }]
727
719
  }], ctorParameters: function () {
728
720
  return [{ type: i1$1.NgControl, decorators: [{
729
721
  type: Self
@@ -753,22 +745,10 @@ class OnshoreFormCheckboxItemComponent {
753
745
  (_a = this.ngControl.control) === null || _a === void 0 ? void 0 : _a.setValue(value.checked);
754
746
  }
755
747
  ngOnInit() {
756
- var _a, _b, _c, _d, _e, _f, _g;
757
- (_a = this.ngControl.control) === null || _a === void 0 ? void 0 : _a.valueChanges.subscribe(() => {
748
+ var _a, _b, _c;
749
+ 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) {
750
+ (_c = this.ngControl.control) === null || _c === void 0 ? void 0 : _c.setValue(this.formTemplate.default);
758
751
  this.cdr.markForCheck();
759
- });
760
- (_b = this.ngControl.control) === null || _b === void 0 ? void 0 : _b.statusChanges.subscribe(() => {
761
- this.cdr.markForCheck();
762
- });
763
- if (((_c = this.ngControl.control) === null || _c === void 0 ? void 0 : _c.value) !== true && ((_d = this.ngControl.control) === null || _d === void 0 ? void 0 : _d.value) !== false && this.formTemplate.default != undefined) {
764
- (_e = this.ngControl.control) === null || _e === void 0 ? void 0 : _e.setValue(this.formTemplate.default);
765
- this.cdr.markForCheck();
766
- }
767
- if (this.formTemplate.enabled) {
768
- (_f = this.ngControl.control) === null || _f === void 0 ? void 0 : _f.enable();
769
- }
770
- else {
771
- (_g = this.ngControl.control) === null || _g === void 0 ? void 0 : _g.disable();
772
752
  }
773
753
  }
774
754
  ngOnChanges(changes) {
@@ -780,10 +760,10 @@ class OnshoreFormCheckboxItemComponent {
780
760
  }
781
761
  }
782
762
  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 });
783
- OnshoreFormCheckboxItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormCheckboxItemComponent, selector: "onshore-form-checkbox-item", inputs: { formTemplate: "formTemplate" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"flex flex-column mb-3\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <div class=\"p-field-checkbox flex\">\n <p-checkbox class=\"align-self-start mt-1\" [name]=\"formTemplate.name\" [formControl]=\"ngControl.control\" [binary]=\"true\" [inputId]=\"formTemplate.name\" [value]=\"ngControl.control.value\" (onChange)=\"changeCheck($event)\"></p-checkbox>\n <label class=\"mb-0 ml-2\" [for]=\"formTemplate.name\">{{formTemplate.description}}</label>\n </div>\n\n <div *ngIf=\"ngControl.control.touched\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i3$3.Checkbox, selector: "p-checkbox", inputs: ["value", "name", "disabled", "binary", "label", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "styleClass", "labelStyleClass", "formControl", "checkboxIcon", "readonly", "required", "trueValue", "falseValue"], outputs: ["onChange"] }, { kind: "directive", type: i3.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: OnshoreFormValidationOutputComponent, selector: "onshore-form-validation-output", inputs: ["validationErrors", "externValidationPattern", "validationItems"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
763
+ OnshoreFormCheckboxItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormCheckboxItemComponent, selector: "onshore-form-checkbox-item", inputs: { formTemplate: "formTemplate" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\">\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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
784
764
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormCheckboxItemComponent, decorators: [{
785
765
  type: Component,
786
- args: [{ selector: 'onshore-form-checkbox-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-column mb-3\">\n <div class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <div class=\"p-field-checkbox flex\">\n <p-checkbox class=\"align-self-start mt-1\" [name]=\"formTemplate.name\" [formControl]=\"ngControl.control\" [binary]=\"true\" [inputId]=\"formTemplate.name\" [value]=\"ngControl.control.value\" (onChange)=\"changeCheck($event)\"></p-checkbox>\n <label class=\"mb-0 ml-2\" [for]=\"formTemplate.name\">{{formTemplate.description}}</label>\n </div>\n\n <div *ngIf=\"ngControl.control.touched\">\n <onshore-form-validation-output\n [validationItems]=\"formTemplate.validationItems\"\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n" }]
766
+ args: [{ selector: 'onshore-form-checkbox-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\">\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" }]
787
767
  }], ctorParameters: function () {
788
768
  return [{ type: i1$1.NgControl, decorators: [{
789
769
  type: Self
@@ -795,13 +775,146 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
795
775
  }] } });
796
776
 
797
777
  class OnshoreFormAutocompleteItemComponent {
778
+ constructor(cdr, ngControl) {
779
+ this.cdr = cdr;
780
+ this.ngControl = ngControl;
781
+ this.multiple = false;
782
+ this.searchedData = [];
783
+ this.onSearch = new EventEmitter();
784
+ this.onSelect = new EventEmitter();
785
+ this.onClear = new EventEmitter();
786
+ this.disabled = false;
787
+ this.ngControl.valueAccessor = this;
788
+ }
789
+ selected(selectedItem) {
790
+ this.onSelect.emit(selectedItem.data);
791
+ this.cdr.markForCheck();
792
+ }
793
+ searchClear() {
794
+ this.searchedData = [];
795
+ this.ngControl.reset();
796
+ this.onClear.emit();
797
+ }
798
+ searchPrepare(term) {
799
+ if (term.query != '') {
800
+ this.search(term.query);
801
+ }
802
+ else {
803
+ this.searchedData = [];
804
+ this.ngControl.reset();
805
+ this.onClear.emit();
806
+ }
807
+ }
808
+ search(searchTerm) {
809
+ return __awaiter(this, void 0, void 0, function* () {
810
+ this.onSearch.emit(searchTerm);
811
+ this.cdr.markForCheck();
812
+ });
813
+ }
814
+ writeValue(obj) {
815
+ if (obj) {
816
+ this.cdr.markForCheck();
817
+ }
818
+ }
819
+ registerOnChange(fn) {
820
+ if (this.ngControl.value) {
821
+ this.cdr.markForCheck();
822
+ }
823
+ }
824
+ registerOnTouched(fn) { }
825
+ setDisabledState(isDisabled) {
826
+ this.disabled = isDisabled;
827
+ }
828
+ ngOnInit() {
829
+ var _a, _b;
830
+ if (((_a = this.ngControl.control) === null || _a === void 0 ? void 0 : _a.value) == '' && this.formTemplate.default != undefined) {
831
+ (_b = this.ngControl.control) === null || _b === void 0 ? void 0 : _b.setValue(this.formTemplate.default);
832
+ this.cdr.markForCheck();
833
+ }
834
+ }
835
+ ngOnDestroy() {
836
+ var _a;
837
+ (_a = this.ngControl.control) === null || _a === void 0 ? void 0 : _a.disable();
838
+ }
839
+ ngOnChanges(changes) {
840
+ this.cdr.markForCheck();
841
+ }
798
842
  }
799
- OnshoreFormAutocompleteItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormAutocompleteItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
800
- OnshoreFormAutocompleteItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormAutocompleteItemComponent, selector: "onshore-form-autocomplete-item", ngImport: i0, template: "<!--<div class=\"flex flex-column mb-3\">\n <div *ngIf=\"formTemplate.label\" class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <p-autoComplete [placeholder]=\"formTemplate.placeholder\"\n appendTo=\"body\"\n [formControl]=\"this.ngControl.control\"\n (onSelect)=\"selected($event)\"\n (onUnselect)=\"selected($event)\"\n (onClear)=\"searchClear()\"\n [suggestions]=\"dataSearch\"\n (completeMethod)=\"searchPrepare($event)\"\n [size]=\"30\"\n [minLength]=\"2\"\n [multiple]=\"multiple\"\n [delay]=\"1000\"\n [unique]=\"true\"\n [field]=\"selectedField\"\n class=\"w-100\">\n <ng-template let-item pTemplate=\"item\">\n <div *ngIf=\"suggestionsHighlightedField\">\n <span class=\"mr-1\">\n <b>{{item[suggestionsHighlightedField]}}</b><br>\n </span>\n </div>\n <div [hidden]=\"suggestionsLineOneFields.length <= 0\"><span *ngFor=\"let field of suggestionsLineOneFields\">{{item[field]}} </span></div>\n <div [hidden]=\"suggestionsLineTwoFields.length <= 0\"><span *ngFor=\"let field of suggestionsLineTwoFields\">{{item[field]}} </span></div>\n </ng-template>\n </p-autoComplete>\n\n <small *ngIf=\"formTemplate.description\"><i class=\"fa fa-info-circle\"></i> {{formTemplate.description}}</small>\n\n <div *ngIf=\"ngControl.control.touched\">\n <onshore-form-validation-output\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n-->\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
843
+ 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 });
844
+ 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" }, outputs: { onSearch: "onSearch", onSelect: "onSelect", onClear: "onClear" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\">\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$3.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: i4$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
801
845
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormAutocompleteItemComponent, decorators: [{
802
846
  type: Component,
803
- args: [{ selector: 'onshore-form-autocomplete-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--<div class=\"flex flex-column mb-3\">\n <div *ngIf=\"formTemplate.label\" class=\"flex justify-content-between align-items-center\">\n <b [class.text-muted]=\"disabled\" class=\"mb-1 white-space-nowrap\">\n {{formTemplate.label}}\n <span *ngIf=\"formTemplate.required\" class=\"tl-color-danger\">*</span>\n </b>\n <i *ngIf=\"formTemplate.tooltip\" class=\"fa fa-info-circle tl-color-black\" [pTooltip]=\"formTemplate.tooltip\" tooltipPosition=\"left\" [escape]=\"false\"></i>\n </div>\n\n <p-autoComplete [placeholder]=\"formTemplate.placeholder\"\n appendTo=\"body\"\n [formControl]=\"this.ngControl.control\"\n (onSelect)=\"selected($event)\"\n (onUnselect)=\"selected($event)\"\n (onClear)=\"searchClear()\"\n [suggestions]=\"dataSearch\"\n (completeMethod)=\"searchPrepare($event)\"\n [size]=\"30\"\n [minLength]=\"2\"\n [multiple]=\"multiple\"\n [delay]=\"1000\"\n [unique]=\"true\"\n [field]=\"selectedField\"\n class=\"w-100\">\n <ng-template let-item pTemplate=\"item\">\n <div *ngIf=\"suggestionsHighlightedField\">\n <span class=\"mr-1\">\n <b>{{item[suggestionsHighlightedField]}}</b><br>\n </span>\n </div>\n <div [hidden]=\"suggestionsLineOneFields.length <= 0\"><span *ngFor=\"let field of suggestionsLineOneFields\">{{item[field]}} </span></div>\n <div [hidden]=\"suggestionsLineTwoFields.length <= 0\"><span *ngFor=\"let field of suggestionsLineTwoFields\">{{item[field]}} </span></div>\n </ng-template>\n </p-autoComplete>\n\n <small *ngIf=\"formTemplate.description\"><i class=\"fa fa-info-circle\"></i> {{formTemplate.description}}</small>\n\n <div *ngIf=\"ngControl.control.touched\">\n <onshore-form-validation-output\n [validationErrors]=\"ngControl.control.errors\"\n [externValidationPattern]=\"formTemplate.validationPatternTranslation\">\n </onshore-form-validation-output>\n </div>\n\n</div>\n-->\n" }]
804
- }] });
847
+ args: [{ selector: 'onshore-form-autocomplete-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\">\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" }]
848
+ }], ctorParameters: function () {
849
+ return [{ type: i0.ChangeDetectorRef }, { type: i1$1.NgControl, decorators: [{
850
+ type: Self
851
+ }, {
852
+ type: Optional
853
+ }] }];
854
+ }, propDecorators: { formTemplate: [{
855
+ type: Input
856
+ }], multiple: [{
857
+ type: Input
858
+ }], searchedData: [{
859
+ type: Input
860
+ }], onSearch: [{
861
+ type: Output
862
+ }], onSelect: [{
863
+ type: Output
864
+ }], onClear: [{
865
+ type: Output
866
+ }] } });
867
+
868
+ class OnshoreFormDatetimeItemComponent {
869
+ constructor(ngControl, cdr) {
870
+ this.ngControl = ngControl;
871
+ this.cdr = cdr;
872
+ this.OnshoreFormTemplateType = OnshoreFormTemplateType;
873
+ this.disabled = false;
874
+ this.ngControl.valueAccessor = this;
875
+ }
876
+ // ControlValueAccessor interface
877
+ writeValue(obj) { }
878
+ registerOnChange(fn) { }
879
+ registerOnTouched(fn) { }
880
+ setDisabledState(isDisabled) {
881
+ this.disabled = isDisabled;
882
+ }
883
+ selectDate(date) {
884
+ console.log(date);
885
+ }
886
+ selectTime(time) {
887
+ console.log(time);
888
+ }
889
+ ngOnInit() {
890
+ var _a, _b, _c;
891
+ 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) {
892
+ (_c = this.ngControl.control) === null || _c === void 0 ? void 0 : _c.setValue(this.formTemplate.default);
893
+ this.cdr.markForCheck();
894
+ }
895
+ }
896
+ ngOnChanges(changes) {
897
+ this.cdr.markForCheck();
898
+ }
899
+ ngOnDestroy() {
900
+ var _a;
901
+ (_a = this.ngControl.control) === null || _a === void 0 ? void 0 : _a.disable();
902
+ }
903
+ }
904
+ 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 });
905
+ OnshoreFormDatetimeItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormDatetimeItemComponent, selector: "onshore-form-datetime-item", inputs: { formTemplate: "formTemplate" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\">\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 </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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
906
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormDatetimeItemComponent, decorators: [{
907
+ type: Component,
908
+ args: [{ selector: 'onshore-form-datetime-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\">\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 </p-calendar>\n\n</onshore-form-item-container>\n" }]
909
+ }], ctorParameters: function () {
910
+ return [{ type: i1$1.NgControl, decorators: [{
911
+ type: Self
912
+ }, {
913
+ type: Optional
914
+ }] }, { type: i0.ChangeDetectorRef }];
915
+ }, propDecorators: { formTemplate: [{
916
+ type: Input
917
+ }] } });
805
918
 
806
919
  class OnshoreFormsModule {
807
920
  }
@@ -809,13 +922,14 @@ OnshoreFormsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", versi
809
922
  OnshoreFormsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormsModule, declarations: [OnshoreFormsComponent,
810
923
  OnshoreFormInputItemComponent,
811
924
  OnshoreFormSwitchItemComponent,
812
- OnshoreFormTextareaItemComponent,
813
925
  OnshoreFormValidationOutputComponent,
814
926
  OnshoreFormImageItemComponent,
815
927
  OnshoreFormDropdownItemComponent,
816
928
  OnshoreFormColorpickerItemComponent,
817
929
  OnshoreFormCheckboxItemComponent,
818
- OnshoreFormAutocompleteItemComponent], imports: [CommonModule,
930
+ OnshoreFormAutocompleteItemComponent,
931
+ OnshoreFormItemContainer,
932
+ OnshoreFormDatetimeItemComponent], imports: [CommonModule,
819
933
  FormsModule,
820
934
  ReactiveFormsModule,
821
935
  ButtonModule,
@@ -830,16 +944,20 @@ OnshoreFormsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", vers
830
944
  InputSwitchModule,
831
945
  InputTextModule,
832
946
  InputTextareaModule,
833
- DialogModule], exports: [OnshoreFormsComponent,
947
+ DialogModule,
948
+ SelectButtonModule,
949
+ ToggleButtonModule,
950
+ CalendarModule], exports: [OnshoreFormsComponent,
834
951
  OnshoreFormInputItemComponent,
835
952
  OnshoreFormSwitchItemComponent,
836
- OnshoreFormTextareaItemComponent,
837
953
  OnshoreFormValidationOutputComponent,
838
954
  OnshoreFormImageItemComponent,
839
955
  OnshoreFormDropdownItemComponent,
840
956
  OnshoreFormColorpickerItemComponent,
841
957
  OnshoreFormCheckboxItemComponent,
842
- OnshoreFormAutocompleteItemComponent] });
958
+ OnshoreFormAutocompleteItemComponent,
959
+ OnshoreFormItemContainer,
960
+ OnshoreFormDatetimeItemComponent] });
843
961
  OnshoreFormsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormsModule, providers: [
844
962
  OnshoreFormsService
845
963
  ], imports: [CommonModule,
@@ -857,7 +975,10 @@ OnshoreFormsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", vers
857
975
  InputSwitchModule,
858
976
  InputTextModule,
859
977
  InputTextareaModule,
860
- DialogModule] });
978
+ DialogModule,
979
+ SelectButtonModule,
980
+ ToggleButtonModule,
981
+ CalendarModule] });
861
982
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormsModule, decorators: [{
862
983
  type: NgModule,
863
984
  args: [{
@@ -865,13 +986,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
865
986
  OnshoreFormsComponent,
866
987
  OnshoreFormInputItemComponent,
867
988
  OnshoreFormSwitchItemComponent,
868
- OnshoreFormTextareaItemComponent,
869
989
  OnshoreFormValidationOutputComponent,
870
990
  OnshoreFormImageItemComponent,
871
991
  OnshoreFormDropdownItemComponent,
872
992
  OnshoreFormColorpickerItemComponent,
873
993
  OnshoreFormCheckboxItemComponent,
874
- OnshoreFormAutocompleteItemComponent
994
+ OnshoreFormAutocompleteItemComponent,
995
+ OnshoreFormItemContainer,
996
+ OnshoreFormDatetimeItemComponent
875
997
  ],
876
998
  imports: [
877
999
  CommonModule,
@@ -889,19 +1011,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
889
1011
  InputSwitchModule,
890
1012
  InputTextModule,
891
1013
  InputTextareaModule,
892
- DialogModule
1014
+ DialogModule,
1015
+ SelectButtonModule,
1016
+ ToggleButtonModule,
1017
+ CalendarModule
893
1018
  ],
894
1019
  exports: [
895
1020
  OnshoreFormsComponent,
896
1021
  OnshoreFormInputItemComponent,
897
1022
  OnshoreFormSwitchItemComponent,
898
- OnshoreFormTextareaItemComponent,
899
1023
  OnshoreFormValidationOutputComponent,
900
1024
  OnshoreFormImageItemComponent,
901
1025
  OnshoreFormDropdownItemComponent,
902
1026
  OnshoreFormColorpickerItemComponent,
903
1027
  OnshoreFormCheckboxItemComponent,
904
- OnshoreFormAutocompleteItemComponent
1028
+ OnshoreFormAutocompleteItemComponent,
1029
+ OnshoreFormItemContainer,
1030
+ OnshoreFormDatetimeItemComponent
905
1031
  ],
906
1032
  providers: [
907
1033
  OnshoreFormsService
@@ -917,5 +1043,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
917
1043
  * Generated bundle index. Do not edit.
918
1044
  */
919
1045
 
920
- export { OnshoreFormAutocompleteItemComponent, OnshoreFormCheckboxItemComponent, OnshoreFormColorpickerItemComponent, OnshoreFormDropdownItemComponent, OnshoreFormImageItemComponent, OnshoreFormInputItemComponent, OnshoreFormSwitchItemComponent, OnshoreFormTemplateType, OnshoreFormTextareaItemComponent, OnshoreFormValidationOutputComponent, OnshoreFormsComponent, OnshoreFormsModule, OnshoreFormsService, OnshoreImageError };
1046
+ export { OnshoreFormAutocompleteItemComponent, OnshoreFormCheckboxItemComponent, OnshoreFormColorpickerItemComponent, OnshoreFormDatetimeItemComponent, OnshoreFormDropdownItemComponent, OnshoreFormImageItemComponent, OnshoreFormInputItemComponent, OnshoreFormItemContainer, OnshoreFormSwitchItemComponent, OnshoreFormTemplateLayout, OnshoreFormTemplateType, OnshoreFormValidationOutputComponent, OnshoreFormsComponent, OnshoreFormsModule, OnshoreFormsService, OnshoreImageError };
921
1047
  //# sourceMappingURL=onshore-forms.mjs.map