special-forms 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/README.md +24 -0
  2. package/esm2020/lib/components/index.mjs +22 -0
  3. package/esm2020/lib/components/special-autocomplete/special-autocomplete.component.mjs +61 -0
  4. package/esm2020/lib/components/special-autocomplete/special-autocomplete.interface.mjs +2 -0
  5. package/esm2020/lib/components/special-autocomplete/special-autocomplete.module.mjs +47 -0
  6. package/esm2020/lib/components/special-checkbox/special-checkbox.component.mjs +20 -0
  7. package/esm2020/lib/components/special-checkbox/special-checkbox.interface.mjs +2 -0
  8. package/esm2020/lib/components/special-checkbox/special-checkbox.module.mjs +47 -0
  9. package/esm2020/lib/components/special-datepicker/special-datepicker.component.mjs +24 -0
  10. package/esm2020/lib/components/special-datepicker/special-datepicker.interface.mjs +2 -0
  11. package/esm2020/lib/components/special-datepicker/special-datepicker.module.mjs +48 -0
  12. package/esm2020/lib/components/special-dropdown/special-dropdown.component.mjs +35 -0
  13. package/esm2020/lib/components/special-dropdown/special-dropdown.interface.mjs +2 -0
  14. package/esm2020/lib/components/special-dropdown/special-dropdown.module.mjs +43 -0
  15. package/esm2020/lib/components/special-form/special-form.component.mjs +97 -0
  16. package/esm2020/lib/components/special-form/special-form.module.mjs +68 -0
  17. package/esm2020/lib/components/special-input/special-input.component.mjs +42 -0
  18. package/esm2020/lib/components/special-input/special-input.interface.mjs +2 -0
  19. package/esm2020/lib/components/special-input/special-input.module.mjs +44 -0
  20. package/esm2020/lib/components/special-label/special-label.component.mjs +25 -0
  21. package/esm2020/lib/components/special-label/special-label.interface.mjs +2 -0
  22. package/esm2020/lib/components/special-label/special-label.module.mjs +47 -0
  23. package/esm2020/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.component.mjs +82 -0
  24. package/esm2020/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.interface.mjs +2 -0
  25. package/esm2020/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.module.mjs +51 -0
  26. package/esm2020/lib/components/special-text-area/special-text-area.component.mjs +30 -0
  27. package/esm2020/lib/components/special-text-area/special-text-area.interface.mjs +2 -0
  28. package/esm2020/lib/components/special-text-area/special-text-area.module.mjs +44 -0
  29. package/esm2020/lib/components/special-upload/special-upload.component.mjs +69 -0
  30. package/esm2020/lib/components/special-upload/special-upload.interface.mjs +2 -0
  31. package/esm2020/lib/components/special-upload/special-upload.module.mjs +43 -0
  32. package/esm2020/lib/core/aux-data/control-types.enum.mjs +18 -0
  33. package/esm2020/lib/core/forms/special-forms.mjs +238 -0
  34. package/esm2020/lib/core/interfaces/field-basics.interfaces.mjs +2 -0
  35. package/esm2020/lib/core/interfaces/form.interfaces.mjs +2 -0
  36. package/esm2020/lib/core/services/index.mjs +3 -0
  37. package/esm2020/lib/core/services/special-form-builder/special-form-builder.service.mjs +156 -0
  38. package/esm2020/lib/pipes/controls-list-pipe/controls-list.pipe.mjs +18 -0
  39. package/esm2020/lib/pipes/controls-list-pipe/controls-list.pipe.module.mjs +18 -0
  40. package/esm2020/lib/pipes/error-message-pipe/error.pipe.mjs +22 -0
  41. package/esm2020/lib/pipes/error-message-pipe/error.pipe.module.mjs +20 -0
  42. package/esm2020/lib/pipes/index.mjs +3 -0
  43. package/esm2020/lib/pipes/text-by-function/text-by-function.pipe.mjs +22 -0
  44. package/esm2020/lib/pipes/text-by-function/text-by-function.pipe.module.mjs +20 -0
  45. package/esm2020/public-api.mjs +6 -0
  46. package/esm2020/special-forms.mjs +5 -0
  47. package/fesm2015/special-forms.mjs +1292 -0
  48. package/fesm2015/special-forms.mjs.map +1 -0
  49. package/fesm2020/special-forms.mjs +1319 -0
  50. package/fesm2020/special-forms.mjs.map +1 -0
  51. package/index.d.ts +5 -0
  52. package/lib/components/index.d.ts +21 -0
  53. package/lib/components/special-autocomplete/special-autocomplete.component.d.ts +19 -0
  54. package/lib/components/special-autocomplete/special-autocomplete.interface.d.ts +18 -0
  55. package/lib/components/special-autocomplete/special-autocomplete.module.d.ts +15 -0
  56. package/lib/components/special-checkbox/special-checkbox.component.d.ts +11 -0
  57. package/lib/components/special-checkbox/special-checkbox.interface.d.ts +10 -0
  58. package/lib/components/special-checkbox/special-checkbox.module.d.ts +14 -0
  59. package/lib/components/special-datepicker/special-datepicker.component.d.ts +12 -0
  60. package/lib/components/special-datepicker/special-datepicker.interface.d.ts +11 -0
  61. package/lib/components/special-datepicker/special-datepicker.module.d.ts +15 -0
  62. package/lib/components/special-dropdown/special-dropdown.component.d.ts +11 -0
  63. package/lib/components/special-dropdown/special-dropdown.interface.d.ts +16 -0
  64. package/lib/components/special-dropdown/special-dropdown.module.d.ts +14 -0
  65. package/lib/components/special-form/special-form.component.d.ts +31 -0
  66. package/lib/components/special-form/special-form.module.d.ts +19 -0
  67. package/lib/components/special-input/special-input.component.d.ts +15 -0
  68. package/lib/components/special-input/special-input.interface.d.ts +15 -0
  69. package/lib/components/special-input/special-input.module.d.ts +14 -0
  70. package/lib/components/special-label/special-label.component.d.ts +13 -0
  71. package/lib/components/special-label/special-label.interface.d.ts +12 -0
  72. package/lib/components/special-label/special-label.module.d.ts +15 -0
  73. package/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.component.d.ts +22 -0
  74. package/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.interface.d.ts +18 -0
  75. package/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.module.d.ts +16 -0
  76. package/lib/components/special-text-area/special-text-area.component.d.ts +13 -0
  77. package/lib/components/special-text-area/special-text-area.interface.d.ts +7 -0
  78. package/lib/components/special-text-area/special-text-area.module.d.ts +14 -0
  79. package/lib/components/special-upload/special-upload.component.d.ts +21 -0
  80. package/lib/components/special-upload/special-upload.interface.d.ts +10 -0
  81. package/lib/components/special-upload/special-upload.module.d.ts +13 -0
  82. package/lib/core/aux-data/control-types.enum.d.ts +16 -0
  83. package/lib/core/forms/special-forms.d.ts +110 -0
  84. package/lib/core/interfaces/field-basics.interfaces.d.ts +22 -0
  85. package/lib/core/interfaces/form.interfaces.d.ts +51 -0
  86. package/lib/core/services/index.d.ts +2 -0
  87. package/lib/core/services/special-form-builder/special-form-builder.service.d.ts +25 -0
  88. package/lib/pipes/controls-list-pipe/controls-list.pipe.d.ts +11 -0
  89. package/lib/pipes/controls-list-pipe/controls-list.pipe.module.d.ts +8 -0
  90. package/lib/pipes/error-message-pipe/error.pipe.d.ts +12 -0
  91. package/lib/pipes/error-message-pipe/error.pipe.module.d.ts +8 -0
  92. package/lib/pipes/index.d.ts +2 -0
  93. package/lib/pipes/text-by-function/text-by-function.pipe.d.ts +7 -0
  94. package/lib/pipes/text-by-function/text-by-function.pipe.module.d.ts +8 -0
  95. package/package.json +31 -0
  96. package/public-api.d.ts +2 -0
@@ -0,0 +1,1292 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Pipe, Component, ChangeDetectionStrategy, Input, NgModule, EventEmitter, Output, Directive, Injectable } from '@angular/core';
3
+ import * as i3 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import * as i1 from '@ngneat/input-mask';
6
+ import { InputMaskModule } from '@ngneat/input-mask';
7
+ import * as i1$1 from '@angular/material/form-field';
8
+ import * as i2 from '@angular/material/input';
9
+ import { MatInputModule } from '@angular/material/input';
10
+ import * as i6 from '@angular/material/icon';
11
+ import { MatIconModule } from '@angular/material/icon';
12
+ import * as i7 from '@angular/forms';
13
+ import { ReactiveFormsModule, FormControl, FormsModule, FormGroup, FormArray, Validators } from '@angular/forms';
14
+ import * as i7$1 from '@angular/material/button';
15
+ import { MatButtonModule } from '@angular/material/button';
16
+ import * as i3$1 from '@angular/material/select';
17
+ import { MatSelectModule } from '@angular/material/select';
18
+ import * as i5 from '@angular/material/core';
19
+ import { MatNativeDateModule } from '@angular/material/core';
20
+ import * as i4 from '@angular/material/autocomplete';
21
+ import { MatAutocompleteModule } from '@angular/material/autocomplete';
22
+ import { debounceTime } from 'rxjs/operators';
23
+ import { Subscription } from 'rxjs';
24
+ import * as i3$2 from '@angular/material/datepicker';
25
+ import { MatDatepickerModule } from '@angular/material/datepicker';
26
+ import * as i9 from '@angular/material/chips';
27
+ import { MatChipsModule } from '@angular/material/chips';
28
+ import * as i2$1 from '@angular/material/checkbox';
29
+ import { MatCheckboxModule } from '@angular/material/checkbox';
30
+ import * as i2$2 from '@angular/cdk/text-field';
31
+ import * as i1$2 from '@angular/platform-browser';
32
+ import * as i2$3 from 'ngx-dropzone';
33
+ import { NgxDropzoneModule } from 'ngx-dropzone';
34
+ import { EControlTypes as EControlTypes$1 } from '@lib/core/aux-data/control-types.enum';
35
+
36
+ class ErrorMessagePipe {
37
+ transform(errorsObj, errorMessages, control) {
38
+ const errors = errorsObj ? Object.keys(errorsObj) : [];
39
+ const error = errors[0];
40
+ const message = errorMessages[error] || error;
41
+ if (control) {
42
+ control.setErrors(errorsObj);
43
+ }
44
+ return message;
45
+ }
46
+ }
47
+ ErrorMessagePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ErrorMessagePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
48
+ ErrorMessagePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: ErrorMessagePipe, name: "errorMessage" });
49
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ErrorMessagePipe, decorators: [{
50
+ type: Pipe,
51
+ args: [{
52
+ name: "errorMessage",
53
+ }]
54
+ }] });
55
+
56
+ class SpecialInputComponent {
57
+ constructor() { }
58
+ ngOnInit() { }
59
+ onEnterClick() {
60
+ if (this.settings.onEnter) {
61
+ this.settings.onEnter(this.control.value);
62
+ }
63
+ }
64
+ onBlurAction() {
65
+ if (this.settings.onBlur) {
66
+ this.settings.onBlur(this.control.value);
67
+ }
68
+ }
69
+ get settings() {
70
+ return this.control.settings;
71
+ }
72
+ iconClick(event) {
73
+ if (this.settings.iconAction) {
74
+ this.settings.iconAction(this.control.value);
75
+ event.stopPropagation();
76
+ }
77
+ }
78
+ }
79
+ SpecialInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
80
+ SpecialInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: SpecialInputComponent, selector: "sp-input", inputs: { control: "control" }, ngImport: i0, template: "<mat-form-field\n *ngIf=\"control\"\n [id]=\"control.elementId\"\n class=\"w-full {{ control.styleClasses }}\"\n [appearance]=\"control.label ? 'outline' : 'standard'\"\n>\n <mat-label *ngIf=\"control.label\">{{ control.label }}</mat-label>\n <input\n matInput\n (blur)=\"onBlurAction()\"\n (keydown.enter)=\"onEnterClick()\"\n [inputMask]=\"settings?.mask\"\n autocomplete=\"off\"\n [type]=\"settings?.type || 'text'\"\n [readonly]=\"control.readOnly\"\n [required]=\"control.required\"\n [placeholder]=\"control.placeholder\"\n [formControl]=\"control\"\n />\n <mat-icon *ngIf=\"control.icon\" matPrefix>{{ control.icon }} </mat-icon>\n <mat-hint>\n {{ control.tooltip }}\n </mat-hint>\n <button\n *ngIf=\"settings?.icon\"\n mat-icon-button\n matSuffix\n (click)=\"iconClick($event)\"\n >\n <mat-icon>\n {{ settings.icon }}\n </mat-icon>\n </button>\n <mat-error>\n {{ control.errors | errorMessage: control.errorMessages }}\n </mat-error>\n</mat-form-field>\n", styles: [":host{display:contents}\n"], dependencies: [{ kind: "directive", type: i1.InputMaskDirective, selector: "[inputMask]", inputs: ["inputMask"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$1.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i1$1.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i7.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: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i7$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "pipe", type: ErrorMessagePipe, name: "errorMessage" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
81
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialInputComponent, decorators: [{
82
+ type: Component,
83
+ args: [{ selector: 'sp-input', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-form-field\n *ngIf=\"control\"\n [id]=\"control.elementId\"\n class=\"w-full {{ control.styleClasses }}\"\n [appearance]=\"control.label ? 'outline' : 'standard'\"\n>\n <mat-label *ngIf=\"control.label\">{{ control.label }}</mat-label>\n <input\n matInput\n (blur)=\"onBlurAction()\"\n (keydown.enter)=\"onEnterClick()\"\n [inputMask]=\"settings?.mask\"\n autocomplete=\"off\"\n [type]=\"settings?.type || 'text'\"\n [readonly]=\"control.readOnly\"\n [required]=\"control.required\"\n [placeholder]=\"control.placeholder\"\n [formControl]=\"control\"\n />\n <mat-icon *ngIf=\"control.icon\" matPrefix>{{ control.icon }} </mat-icon>\n <mat-hint>\n {{ control.tooltip }}\n </mat-hint>\n <button\n *ngIf=\"settings?.icon\"\n mat-icon-button\n matSuffix\n (click)=\"iconClick($event)\"\n >\n <mat-icon>\n {{ settings.icon }}\n </mat-icon>\n </button>\n <mat-error>\n {{ control.errors | errorMessage: control.errorMessages }}\n </mat-error>\n</mat-form-field>\n", styles: [":host{display:contents}\n"] }]
84
+ }], ctorParameters: function () { return []; }, propDecorators: { control: [{
85
+ type: Input
86
+ }] } });
87
+
88
+ class ErrorMessagePipeModule {
89
+ }
90
+ ErrorMessagePipeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ErrorMessagePipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
91
+ ErrorMessagePipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: ErrorMessagePipeModule, declarations: [ErrorMessagePipe], imports: [CommonModule], exports: [ErrorMessagePipe] });
92
+ ErrorMessagePipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ErrorMessagePipeModule, imports: [CommonModule] });
93
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ErrorMessagePipeModule, decorators: [{
94
+ type: NgModule,
95
+ args: [{
96
+ declarations: [ErrorMessagePipe],
97
+ imports: [
98
+ CommonModule,
99
+ ],
100
+ exports: [ErrorMessagePipe],
101
+ }]
102
+ }] });
103
+
104
+ class TextByFunctionPipe {
105
+ transform(value, field) {
106
+ if (field instanceof Function) {
107
+ return field(value);
108
+ }
109
+ else if (value instanceof Object) {
110
+ return value[field];
111
+ }
112
+ else {
113
+ return value;
114
+ }
115
+ }
116
+ }
117
+ TextByFunctionPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: TextByFunctionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
118
+ TextByFunctionPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: TextByFunctionPipe, name: "textByFunction" });
119
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: TextByFunctionPipe, decorators: [{
120
+ type: Pipe,
121
+ args: [{ name: 'textByFunction' }]
122
+ }] });
123
+
124
+ class TextByFunctionPipeModule {
125
+ }
126
+ TextByFunctionPipeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: TextByFunctionPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
127
+ TextByFunctionPipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: TextByFunctionPipeModule, declarations: [TextByFunctionPipe], imports: [CommonModule], exports: [TextByFunctionPipe] });
128
+ TextByFunctionPipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: TextByFunctionPipeModule, imports: [CommonModule] });
129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: TextByFunctionPipeModule, decorators: [{
130
+ type: NgModule,
131
+ args: [{
132
+ declarations: [TextByFunctionPipe],
133
+ imports: [
134
+ CommonModule,
135
+ ],
136
+ exports: [TextByFunctionPipe],
137
+ }]
138
+ }] });
139
+
140
+ class SpecialInputModule {
141
+ }
142
+ SpecialInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
143
+ SpecialInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: SpecialInputModule, declarations: [SpecialInputComponent], imports: [InputMaskModule,
144
+ CommonModule,
145
+ MatInputModule,
146
+ MatIconModule,
147
+ ReactiveFormsModule,
148
+ MatButtonModule,
149
+ ErrorMessagePipeModule], exports: [SpecialInputComponent] });
150
+ SpecialInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialInputModule, imports: [InputMaskModule,
151
+ CommonModule,
152
+ MatInputModule,
153
+ MatIconModule,
154
+ ReactiveFormsModule,
155
+ MatButtonModule,
156
+ ErrorMessagePipeModule] });
157
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialInputModule, decorators: [{
158
+ type: NgModule,
159
+ args: [{
160
+ declarations: [SpecialInputComponent],
161
+ imports: [
162
+ InputMaskModule,
163
+ CommonModule,
164
+ MatInputModule,
165
+ MatIconModule,
166
+ ReactiveFormsModule,
167
+ MatButtonModule,
168
+ ErrorMessagePipeModule
169
+ ],
170
+ exports: [SpecialInputComponent],
171
+ }]
172
+ }] });
173
+
174
+ class SpecialDropdownComponent {
175
+ get settings() {
176
+ return this.control.settings;
177
+ }
178
+ iconClick(event) {
179
+ if (this.settings.iconAction) {
180
+ this.settings.iconAction(this.control.value);
181
+ event.stopPropagation();
182
+ }
183
+ }
184
+ optionSelected(value) {
185
+ if (this.settings.onSelect)
186
+ this.settings.onSelect(value);
187
+ }
188
+ }
189
+ SpecialDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
190
+ SpecialDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: SpecialDropdownComponent, selector: "sp-dropdown", inputs: { control: "control" }, ngImport: i0, template: "<mat-form-field\r\n *ngIf=\"control\"\r\n [id]=\"control.elementId\"\r\n class=\"w-full {{ control.styleClasses }}\"\r\n [appearance]=\"control.label ? 'outline' : 'standard'\"\r\n>\r\n <mat-label *ngIf=\"control.label\">\r\n {{ control.label }}\r\n </mat-label>\r\n <mat-select\r\n [formControl]=\"control\"\r\n [required]=\"control.required\"\r\n (selectionChange)=\"optionSelected($event.value)\"\r\n [placeholder]=\"control.placeholder\"\r\n >\r\n <mat-option *ngIf=\"!control.required\" [value]=\"null\">\r\n {{ control.placeholder || control.settings.notSelectedText }}\r\n </mat-option>\r\n <mat-option\r\n *ngFor=\"let item of control.settings.source | async\"\r\n [value]=\"item[control.settings.fieldId]\"\r\n >\r\n {{ item | textByFunction: control.settings.fieldName }}\r\n </mat-option>\r\n </mat-select>\r\n <button\r\n *ngIf=\"settings.icon\"\r\n mat-icon-button\r\n matSuffix\r\n (click)=\"iconClick($event)\"\r\n >\r\n <mat-icon>\r\n {{ settings.icon }}\r\n </mat-icon>\r\n </button>\r\n <mat-icon *ngIf=\"control.icon\" matPrefix>{{ control.icon }}</mat-icon>\r\n <mat-hint *ngIf=\"control.tooltip\">{{ control.tooltip }}</mat-hint>\r\n <mat-error>\r\n {{ control.errors | errorMessage: control.errorMessages }}\r\n </mat-error>\r\n</mat-form-field>\r\n", styles: [":host{display:contents}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$1.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i1$1.MatSuffix, selector: "[matSuffix]" }, { kind: "component", type: i3$1.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i7$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: ErrorMessagePipe, name: "errorMessage" }, { kind: "pipe", type: TextByFunctionPipe, name: "textByFunction" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
191
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialDropdownComponent, decorators: [{
192
+ type: Component,
193
+ args: [{ selector: 'sp-dropdown', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-form-field\r\n *ngIf=\"control\"\r\n [id]=\"control.elementId\"\r\n class=\"w-full {{ control.styleClasses }}\"\r\n [appearance]=\"control.label ? 'outline' : 'standard'\"\r\n>\r\n <mat-label *ngIf=\"control.label\">\r\n {{ control.label }}\r\n </mat-label>\r\n <mat-select\r\n [formControl]=\"control\"\r\n [required]=\"control.required\"\r\n (selectionChange)=\"optionSelected($event.value)\"\r\n [placeholder]=\"control.placeholder\"\r\n >\r\n <mat-option *ngIf=\"!control.required\" [value]=\"null\">\r\n {{ control.placeholder || control.settings.notSelectedText }}\r\n </mat-option>\r\n <mat-option\r\n *ngFor=\"let item of control.settings.source | async\"\r\n [value]=\"item[control.settings.fieldId]\"\r\n >\r\n {{ item | textByFunction: control.settings.fieldName }}\r\n </mat-option>\r\n </mat-select>\r\n <button\r\n *ngIf=\"settings.icon\"\r\n mat-icon-button\r\n matSuffix\r\n (click)=\"iconClick($event)\"\r\n >\r\n <mat-icon>\r\n {{ settings.icon }}\r\n </mat-icon>\r\n </button>\r\n <mat-icon *ngIf=\"control.icon\" matPrefix>{{ control.icon }}</mat-icon>\r\n <mat-hint *ngIf=\"control.tooltip\">{{ control.tooltip }}</mat-hint>\r\n <mat-error>\r\n {{ control.errors | errorMessage: control.errorMessages }}\r\n </mat-error>\r\n</mat-form-field>\r\n", styles: [":host{display:contents}\n"] }]
194
+ }], propDecorators: { control: [{
195
+ type: Input
196
+ }] } });
197
+
198
+ class SpecialDropdownModule {
199
+ }
200
+ SpecialDropdownModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialDropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
201
+ SpecialDropdownModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: SpecialDropdownModule, declarations: [SpecialDropdownComponent], imports: [CommonModule,
202
+ MatSelectModule,
203
+ ReactiveFormsModule,
204
+ ErrorMessagePipeModule,
205
+ MatIconModule,
206
+ MatButtonModule,
207
+ TextByFunctionPipeModule], exports: [SpecialDropdownComponent] });
208
+ SpecialDropdownModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialDropdownModule, imports: [CommonModule,
209
+ MatSelectModule,
210
+ ReactiveFormsModule,
211
+ ErrorMessagePipeModule,
212
+ MatIconModule,
213
+ MatButtonModule,
214
+ TextByFunctionPipeModule] });
215
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialDropdownModule, decorators: [{
216
+ type: NgModule,
217
+ args: [{
218
+ declarations: [SpecialDropdownComponent],
219
+ imports: [
220
+ CommonModule,
221
+ MatSelectModule,
222
+ ReactiveFormsModule,
223
+ ErrorMessagePipeModule,
224
+ MatIconModule,
225
+ MatButtonModule,
226
+ TextByFunctionPipeModule
227
+ ],
228
+ exports: [SpecialDropdownComponent],
229
+ }]
230
+ }] });
231
+
232
+ class SpecialAutocompleteComponent {
233
+ constructor() {
234
+ this.subs = new Subscription();
235
+ this.configValue = (item) => {
236
+ if (!item)
237
+ return '';
238
+ const fieldName = this.settings.fieldName;
239
+ return fieldName instanceof Function ? fieldName(item) : item[fieldName];
240
+ };
241
+ }
242
+ ngOnInit() {
243
+ this.init();
244
+ }
245
+ get settings() {
246
+ return this.control.settings;
247
+ }
248
+ init() {
249
+ this.subs.add(this.control.valueChanges.pipe(debounceTime(500)).subscribe((value) => {
250
+ if (typeof value === 'string') {
251
+ this.settings.getData(value, this.control);
252
+ }
253
+ }));
254
+ }
255
+ optionSelected(data) {
256
+ this.control.setValue(data.option.value);
257
+ if (this.settings.onSelect)
258
+ this.settings.onSelect(data.option.value);
259
+ }
260
+ iconClick(event) {
261
+ if (this.settings.iconAction) {
262
+ this.settings.iconAction(this.control.value);
263
+ event.stopPropagation();
264
+ }
265
+ }
266
+ ngOnDestroy() {
267
+ this.subs.unsubscribe();
268
+ }
269
+ }
270
+ SpecialAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialAutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
271
+ SpecialAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: SpecialAutocompleteComponent, selector: "sp-autocomplete", inputs: { control: "control" }, ngImport: i0, template: "<ng-container *ngIf=\"control && !control.hidden\">\r\n <mat-form-field\r\n class=\"w-full {{ control.styleClasses }}\"\r\n [appearance]=\"control.label ? 'outline' : 'standard'\"\r\n >\r\n <mat-label\r\n [ngClass]=\"{ 'is-link': control.label }\"\r\n class=\"control-label\"\r\n *ngIf=\"control.label\"\r\n >\r\n {{ control.label }}\r\n </mat-label>\r\n <input\r\n type=\"text\"\r\n autocomplete=\"off\"\r\n [required]=\"control.required\"\r\n [readonly]=\"control.readOnly\"\r\n [placeholder]=\"control.placeholder\"\r\n matInput\r\n [formControl]=\"control\"\r\n [matAutocomplete]=\"auto\"\r\n />\r\n <mat-autocomplete\r\n class=\"autocomplete-options\"\r\n #auto=\"matAutocomplete\"\r\n [displayWith]=\"configValue\"\r\n (optionSelected)=\"optionSelected($event)\"\r\n >\r\n <mat-option\r\n *ngFor=\"let option of settings?.source | async\"\r\n [value]=\"option\"\r\n >\r\n <div class=\"flex items-center\">\r\n <img\r\n *ngIf=\"settings.fieldImage\"\r\n class=\"w-8 pr-2\"\r\n alt=\"\"\r\n [src]=\"option | textByFunction: settings.fieldImage\"\r\n />\r\n <span>\r\n {{ option | textByFunction: settings.fieldName }}\r\n </span>\r\n </div>\r\n </mat-option>\r\n </mat-autocomplete>\r\n <mat-icon *ngIf=\"control.icon\" matPrefix>{{ control.icon }}</mat-icon>\r\n <button\r\n *ngIf=\"settings.icon\"\r\n mat-icon-button\r\n matSuffix\r\n (click)=\"iconClick($event)\"\r\n >\r\n <mat-icon>\r\n {{ settings.icon }}\r\n </mat-icon>\r\n </button>\r\n <mat-hint>{{ control.tooltip }}</mat-hint>\r\n <mat-error>\r\n {{ control.errors | errorMessage: control.errorMessages }}\r\n </mat-error>\r\n </mat-form-field>\r\n</ng-container>\r\n", styles: [":host{display:contents}\n"], dependencies: [{ kind: "directive", type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$1.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i1$1.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i4.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i7.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: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i7$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: ErrorMessagePipe, name: "errorMessage" }, { kind: "pipe", type: TextByFunctionPipe, name: "textByFunction" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
272
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialAutocompleteComponent, decorators: [{
273
+ type: Component,
274
+ args: [{ selector: 'sp-autocomplete', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"control && !control.hidden\">\r\n <mat-form-field\r\n class=\"w-full {{ control.styleClasses }}\"\r\n [appearance]=\"control.label ? 'outline' : 'standard'\"\r\n >\r\n <mat-label\r\n [ngClass]=\"{ 'is-link': control.label }\"\r\n class=\"control-label\"\r\n *ngIf=\"control.label\"\r\n >\r\n {{ control.label }}\r\n </mat-label>\r\n <input\r\n type=\"text\"\r\n autocomplete=\"off\"\r\n [required]=\"control.required\"\r\n [readonly]=\"control.readOnly\"\r\n [placeholder]=\"control.placeholder\"\r\n matInput\r\n [formControl]=\"control\"\r\n [matAutocomplete]=\"auto\"\r\n />\r\n <mat-autocomplete\r\n class=\"autocomplete-options\"\r\n #auto=\"matAutocomplete\"\r\n [displayWith]=\"configValue\"\r\n (optionSelected)=\"optionSelected($event)\"\r\n >\r\n <mat-option\r\n *ngFor=\"let option of settings?.source | async\"\r\n [value]=\"option\"\r\n >\r\n <div class=\"flex items-center\">\r\n <img\r\n *ngIf=\"settings.fieldImage\"\r\n class=\"w-8 pr-2\"\r\n alt=\"\"\r\n [src]=\"option | textByFunction: settings.fieldImage\"\r\n />\r\n <span>\r\n {{ option | textByFunction: settings.fieldName }}\r\n </span>\r\n </div>\r\n </mat-option>\r\n </mat-autocomplete>\r\n <mat-icon *ngIf=\"control.icon\" matPrefix>{{ control.icon }}</mat-icon>\r\n <button\r\n *ngIf=\"settings.icon\"\r\n mat-icon-button\r\n matSuffix\r\n (click)=\"iconClick($event)\"\r\n >\r\n <mat-icon>\r\n {{ settings.icon }}\r\n </mat-icon>\r\n </button>\r\n <mat-hint>{{ control.tooltip }}</mat-hint>\r\n <mat-error>\r\n {{ control.errors | errorMessage: control.errorMessages }}\r\n </mat-error>\r\n </mat-form-field>\r\n</ng-container>\r\n", styles: [":host{display:contents}\n"] }]
275
+ }], ctorParameters: function () { return []; }, propDecorators: { control: [{
276
+ type: Input
277
+ }] } });
278
+
279
+ class SpecialAutocompleteModule {
280
+ }
281
+ SpecialAutocompleteModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialAutocompleteModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
282
+ SpecialAutocompleteModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: SpecialAutocompleteModule, declarations: [SpecialAutocompleteComponent], imports: [MatInputModule,
283
+ CommonModule,
284
+ MatAutocompleteModule,
285
+ MatIconModule,
286
+ ReactiveFormsModule,
287
+ MatButtonModule,
288
+ ErrorMessagePipeModule,
289
+ TextByFunctionPipeModule], exports: [SpecialAutocompleteComponent] });
290
+ SpecialAutocompleteModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialAutocompleteModule, imports: [MatInputModule,
291
+ CommonModule,
292
+ MatAutocompleteModule,
293
+ MatIconModule,
294
+ ReactiveFormsModule,
295
+ MatButtonModule,
296
+ ErrorMessagePipeModule,
297
+ TextByFunctionPipeModule] });
298
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialAutocompleteModule, decorators: [{
299
+ type: NgModule,
300
+ args: [{
301
+ declarations: [SpecialAutocompleteComponent],
302
+ imports: [
303
+ MatInputModule,
304
+ CommonModule,
305
+ MatAutocompleteModule,
306
+ MatIconModule,
307
+ ReactiveFormsModule,
308
+ MatButtonModule,
309
+ ErrorMessagePipeModule,
310
+ TextByFunctionPipeModule,
311
+ ],
312
+ exports: [SpecialAutocompleteComponent],
313
+ }]
314
+ }] });
315
+
316
+ class SpecialDatepickerComponent {
317
+ constructor() { }
318
+ get startAt() {
319
+ var _a;
320
+ return ((_a = this.control.settings) === null || _a === void 0 ? void 0 : _a.startAt) || new Date();
321
+ }
322
+ ngOnInit() { }
323
+ }
324
+ SpecialDatepickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialDatepickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
325
+ SpecialDatepickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: SpecialDatepickerComponent, selector: "sp-datepicker", inputs: { control: "control" }, ngImport: i0, template: "<mat-form-field\n *ngIf=\"control\"\n [id]=\"control.elementId\"\n class=\"w-full {{ control.styleClasses }}\"\n [appearance]=\"control.label ? 'outline' : 'standard'\"\n>\n <mat-label *ngIf=\"control.label\">{{ control.label }}</mat-label>\n <input\n matInput\n autocomplete=\"off\"\n [readonly]=\"control.readOnly\"\n [matDatepicker]=\"picker\"\n [required]=\"control.required\"\n [placeholder]=\"control.placeholder\"\n [formControl]=\"control\"\n />\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker startView=\"year\" [startAt]=\"startAt\">\n </mat-datepicker>\n <mat-hint>\n {{ control.tooltip }}\n </mat-hint>\n <mat-error>\n {{ control.errors | errorMessage: control.errorMessages }}\n </mat-error>\n</mat-form-field>\n", styles: [":host{display:contents}\n"], dependencies: [{ kind: "directive", type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$1.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i3$2.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i3$2.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i3$2.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i7.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: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: ErrorMessagePipe, name: "errorMessage" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
326
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialDatepickerComponent, decorators: [{
327
+ type: Component,
328
+ args: [{ selector: 'sp-datepicker', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-form-field\n *ngIf=\"control\"\n [id]=\"control.elementId\"\n class=\"w-full {{ control.styleClasses }}\"\n [appearance]=\"control.label ? 'outline' : 'standard'\"\n>\n <mat-label *ngIf=\"control.label\">{{ control.label }}</mat-label>\n <input\n matInput\n autocomplete=\"off\"\n [readonly]=\"control.readOnly\"\n [matDatepicker]=\"picker\"\n [required]=\"control.required\"\n [placeholder]=\"control.placeholder\"\n [formControl]=\"control\"\n />\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker startView=\"year\" [startAt]=\"startAt\">\n </mat-datepicker>\n <mat-hint>\n {{ control.tooltip }}\n </mat-hint>\n <mat-error>\n {{ control.errors | errorMessage: control.errorMessages }}\n </mat-error>\n</mat-form-field>\n", styles: [":host{display:contents}\n"] }]
329
+ }], ctorParameters: function () { return []; }, propDecorators: { control: [{
330
+ type: Input
331
+ }] } });
332
+
333
+ class SpecialDatepickerModule {
334
+ }
335
+ SpecialDatepickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialDatepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
336
+ SpecialDatepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: SpecialDatepickerModule, declarations: [SpecialDatepickerComponent], imports: [MatInputModule,
337
+ MatDatepickerModule,
338
+ CommonModule,
339
+ MatIconModule,
340
+ ReactiveFormsModule,
341
+ MatButtonModule,
342
+ ErrorMessagePipeModule,
343
+ MatNativeDateModule], exports: [SpecialDatepickerComponent] });
344
+ SpecialDatepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialDatepickerModule, imports: [MatInputModule,
345
+ MatDatepickerModule,
346
+ CommonModule,
347
+ MatIconModule,
348
+ ReactiveFormsModule,
349
+ MatButtonModule,
350
+ ErrorMessagePipeModule,
351
+ MatNativeDateModule] });
352
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialDatepickerModule, decorators: [{
353
+ type: NgModule,
354
+ args: [{
355
+ declarations: [SpecialDatepickerComponent],
356
+ imports: [
357
+ MatInputModule,
358
+ MatDatepickerModule,
359
+ CommonModule,
360
+ MatIconModule,
361
+ ReactiveFormsModule,
362
+ MatButtonModule,
363
+ ErrorMessagePipeModule,
364
+ MatNativeDateModule
365
+ ],
366
+ exports: [SpecialDatepickerComponent],
367
+ }]
368
+ }] });
369
+
370
+ class SpecialMultipleAutocompleteComponent {
371
+ constructor() {
372
+ this.subs = new Subscription();
373
+ this.internalControl = new FormControl();
374
+ this.configValue = (item) => {
375
+ if (!item)
376
+ return '';
377
+ const fieldName = this.control.settings.fieldName;
378
+ return fieldName instanceof Function ? fieldName(item) : item[fieldName];
379
+ };
380
+ }
381
+ ngOnInit() {
382
+ this.init();
383
+ }
384
+ get settings() {
385
+ return this.control.settings;
386
+ }
387
+ init() {
388
+ this.subs.add(this.internalControl.valueChanges
389
+ .pipe(debounceTime(500))
390
+ .subscribe((value) => {
391
+ if (typeof value === 'string') {
392
+ this.control.settings.getData(value, this.control);
393
+ }
394
+ }));
395
+ }
396
+ optionSelected(data) {
397
+ const newItem = data.option.value;
398
+ this.internalControl.reset();
399
+ this.control.setValue([
400
+ ...(this.control.value || []).filter((item) => item[this.control.settings.fieldId] !==
401
+ newItem[this.control.settings.fieldId]),
402
+ newItem,
403
+ ]);
404
+ if (this.settings.onSelect)
405
+ this.settings.onSelect(newItem);
406
+ }
407
+ iconClick(event) {
408
+ if (this.settings.iconAction) {
409
+ this.settings.iconAction(this.control.value);
410
+ event.stopPropagation();
411
+ }
412
+ }
413
+ remove(value) {
414
+ let currentValues = Array.from(this.control.value);
415
+ const index = currentValues.indexOf(value);
416
+ if (index > -1) {
417
+ currentValues.splice(index, 1);
418
+ const value = currentValues;
419
+ this.control.markAsDirty();
420
+ this.control.setValue(value);
421
+ }
422
+ }
423
+ ngOnDestroy() {
424
+ this.subs.unsubscribe();
425
+ }
426
+ }
427
+ SpecialMultipleAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialMultipleAutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
428
+ SpecialMultipleAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: SpecialMultipleAutocompleteComponent, selector: "sp-multiple-autocomplete", inputs: { control: "control" }, ngImport: i0, template: "<div\r\n class=\"w-full {{ control.styleClasses }}\"\r\n *ngIf=\"control && !control.hidden\"\r\n>\r\n <mat-form-field\r\n class=\"w-full\"\r\n [id]=\"control.elementId\"\r\n [appearance]=\"control.label ? 'outline' : 'standard'\"\r\n >\r\n <mat-label *ngIf=\"control.label\">\r\n {{ control.label }}\r\n </mat-label>\r\n <input\r\n type=\"text\"\r\n autocomplete=\"off\"\r\n [required]=\"control.required && !control.value?.length\"\r\n [readonly]=\"control.readOnly\"\r\n [placeholder]=\"control.placeholder\"\r\n matInput\r\n [formControl]=\"internalControl\"\r\n [matAutocomplete]=\"auto\"\r\n />\r\n <mat-autocomplete\r\n class=\"autocomplete-options\"\r\n #auto=\"matAutocomplete\"\r\n [displayWith]=\"configValue\"\r\n (optionSelected)=\"optionSelected($event)\"\r\n >\r\n <mat-option\r\n *ngFor=\"let option of settings?.source | async\"\r\n [value]=\"option\"\r\n >\r\n <div class=\"flex items-center\">\r\n <img\r\n *ngIf=\"settings.fieldImage\"\r\n class=\"w-8 pr-2 object-contain\"\r\n alt=\"\"\r\n [src]=\"option | textByFunction: settings.fieldImage\"\r\n />\r\n <span>\r\n {{ option | textByFunction: settings.fieldName }}\r\n </span>\r\n </div>\r\n </mat-option>\r\n </mat-autocomplete>\r\n <mat-icon *ngIf=\"control.icon\" matPrefix>{{ control.icon }}</mat-icon>\r\n <button\r\n *ngIf=\"settings.icon\"\r\n mat-icon-button\r\n matSuffix\r\n (click)=\"iconClick($event)\"\r\n >\r\n <mat-icon>\r\n {{ settings.icon }}\r\n </mat-icon>\r\n </button>\r\n <mat-hint>{{ control.tooltip }}</mat-hint>\r\n <mat-error>\r\n {{ control.errors | errorMessage: control.errorMessages }}\r\n </mat-error>\r\n </mat-form-field>\r\n\r\n <mat-chip-list>\r\n <mat-chip\r\n class=\"chip-style\"\r\n *ngFor=\"let chip of control.value\"\r\n [removable]=\"true\"\r\n (removed)=\"remove(chip)\"\r\n >\r\n <div class=\"flex items-center\">\r\n <img\r\n *ngIf=\"settings.fieldImage\"\r\n class=\"w-8 pr-2 object-contain\"\r\n alt=\"\"\r\n [src]=\"chip | textByFunction: settings.fieldImage\"\r\n />\r\n {{ chip | textByFunction: settings.fieldName }}\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </div>\r\n </mat-chip>\r\n </mat-chip-list>\r\n</div>\r\n", styles: [":host{display:contents}\n"], dependencies: [{ kind: "directive", type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$1.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i1$1.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i4.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i7.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: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i7$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i9.MatChipList, selector: "mat-chip-list", inputs: ["role", "aria-describedby", "errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { kind: "directive", type: i9.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "role", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { kind: "directive", type: i9.MatChipRemove, selector: "[matChipRemove]" }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: ErrorMessagePipe, name: "errorMessage" }, { kind: "pipe", type: TextByFunctionPipe, name: "textByFunction" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
429
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialMultipleAutocompleteComponent, decorators: [{
430
+ type: Component,
431
+ args: [{ selector: 'sp-multiple-autocomplete', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\r\n class=\"w-full {{ control.styleClasses }}\"\r\n *ngIf=\"control && !control.hidden\"\r\n>\r\n <mat-form-field\r\n class=\"w-full\"\r\n [id]=\"control.elementId\"\r\n [appearance]=\"control.label ? 'outline' : 'standard'\"\r\n >\r\n <mat-label *ngIf=\"control.label\">\r\n {{ control.label }}\r\n </mat-label>\r\n <input\r\n type=\"text\"\r\n autocomplete=\"off\"\r\n [required]=\"control.required && !control.value?.length\"\r\n [readonly]=\"control.readOnly\"\r\n [placeholder]=\"control.placeholder\"\r\n matInput\r\n [formControl]=\"internalControl\"\r\n [matAutocomplete]=\"auto\"\r\n />\r\n <mat-autocomplete\r\n class=\"autocomplete-options\"\r\n #auto=\"matAutocomplete\"\r\n [displayWith]=\"configValue\"\r\n (optionSelected)=\"optionSelected($event)\"\r\n >\r\n <mat-option\r\n *ngFor=\"let option of settings?.source | async\"\r\n [value]=\"option\"\r\n >\r\n <div class=\"flex items-center\">\r\n <img\r\n *ngIf=\"settings.fieldImage\"\r\n class=\"w-8 pr-2 object-contain\"\r\n alt=\"\"\r\n [src]=\"option | textByFunction: settings.fieldImage\"\r\n />\r\n <span>\r\n {{ option | textByFunction: settings.fieldName }}\r\n </span>\r\n </div>\r\n </mat-option>\r\n </mat-autocomplete>\r\n <mat-icon *ngIf=\"control.icon\" matPrefix>{{ control.icon }}</mat-icon>\r\n <button\r\n *ngIf=\"settings.icon\"\r\n mat-icon-button\r\n matSuffix\r\n (click)=\"iconClick($event)\"\r\n >\r\n <mat-icon>\r\n {{ settings.icon }}\r\n </mat-icon>\r\n </button>\r\n <mat-hint>{{ control.tooltip }}</mat-hint>\r\n <mat-error>\r\n {{ control.errors | errorMessage: control.errorMessages }}\r\n </mat-error>\r\n </mat-form-field>\r\n\r\n <mat-chip-list>\r\n <mat-chip\r\n class=\"chip-style\"\r\n *ngFor=\"let chip of control.value\"\r\n [removable]=\"true\"\r\n (removed)=\"remove(chip)\"\r\n >\r\n <div class=\"flex items-center\">\r\n <img\r\n *ngIf=\"settings.fieldImage\"\r\n class=\"w-8 pr-2 object-contain\"\r\n alt=\"\"\r\n [src]=\"chip | textByFunction: settings.fieldImage\"\r\n />\r\n {{ chip | textByFunction: settings.fieldName }}\r\n <mat-icon matChipRemove>cancel</mat-icon>\r\n </div>\r\n </mat-chip>\r\n </mat-chip-list>\r\n</div>\r\n", styles: [":host{display:contents}\n"] }]
432
+ }], ctorParameters: function () { return []; }, propDecorators: { control: [{
433
+ type: Input
434
+ }] } });
435
+
436
+ class SpecialMultipleAutocompleteModule {
437
+ }
438
+ SpecialMultipleAutocompleteModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialMultipleAutocompleteModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
439
+ SpecialMultipleAutocompleteModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: SpecialMultipleAutocompleteModule, declarations: [SpecialMultipleAutocompleteComponent], imports: [MatInputModule,
440
+ CommonModule,
441
+ MatAutocompleteModule,
442
+ MatIconModule,
443
+ ReactiveFormsModule,
444
+ MatButtonModule,
445
+ ErrorMessagePipeModule,
446
+ TextByFunctionPipeModule,
447
+ MatChipsModule], exports: [SpecialMultipleAutocompleteComponent] });
448
+ SpecialMultipleAutocompleteModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialMultipleAutocompleteModule, imports: [MatInputModule,
449
+ CommonModule,
450
+ MatAutocompleteModule,
451
+ MatIconModule,
452
+ ReactiveFormsModule,
453
+ MatButtonModule,
454
+ ErrorMessagePipeModule,
455
+ TextByFunctionPipeModule,
456
+ MatChipsModule] });
457
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialMultipleAutocompleteModule, decorators: [{
458
+ type: NgModule,
459
+ args: [{
460
+ declarations: [SpecialMultipleAutocompleteComponent],
461
+ imports: [
462
+ MatInputModule,
463
+ CommonModule,
464
+ MatAutocompleteModule,
465
+ MatIconModule,
466
+ ReactiveFormsModule,
467
+ MatButtonModule,
468
+ ErrorMessagePipeModule,
469
+ TextByFunctionPipeModule,
470
+ MatChipsModule,
471
+ ],
472
+ exports: [SpecialMultipleAutocompleteComponent],
473
+ }]
474
+ }] });
475
+
476
+ class SpecialCheckboxComponent {
477
+ constructor() { }
478
+ ngOnInit() { }
479
+ }
480
+ SpecialCheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
481
+ SpecialCheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: SpecialCheckboxComponent, selector: "sp-checkbox", inputs: { control: "control" }, ngImport: i0, template: "<div\n *ngIf=\"control\"\n [id]=\"control.elementId\"\n class=\"w-full flex flex-col {{ control.styleClasses }}\"\n>\n <mat-label *ngIf=\"control.label\">{{ control.label }}</mat-label>\n <mat-checkbox\n [ngModel]=\"control.value\"\n (ngModelChange)=\"control.setValue($event); control.markAsDirty()\"\n [indeterminate]=\"control.settings.indeterminate\"\n [labelPosition]=\"control.settings.labelPosition\"\n [disabled]=\"control.disabled\"\n >\n <mat-icon *ngIf=\"control.icon\" matSuffix>{{ control.icon }} </mat-icon>\n {{ control.placeholder }}\n </mat-checkbox>\n</div>\n", styles: [":host{display:contents}\n"], dependencies: [{ kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$1.MatSuffix, selector: "[matSuffix]" }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
482
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialCheckboxComponent, decorators: [{
483
+ type: Component,
484
+ args: [{ selector: 'sp-checkbox', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n *ngIf=\"control\"\n [id]=\"control.elementId\"\n class=\"w-full flex flex-col {{ control.styleClasses }}\"\n>\n <mat-label *ngIf=\"control.label\">{{ control.label }}</mat-label>\n <mat-checkbox\n [ngModel]=\"control.value\"\n (ngModelChange)=\"control.setValue($event); control.markAsDirty()\"\n [indeterminate]=\"control.settings.indeterminate\"\n [labelPosition]=\"control.settings.labelPosition\"\n [disabled]=\"control.disabled\"\n >\n <mat-icon *ngIf=\"control.icon\" matSuffix>{{ control.icon }} </mat-icon>\n {{ control.placeholder }}\n </mat-checkbox>\n</div>\n", styles: [":host{display:contents}\n"] }]
485
+ }], ctorParameters: function () { return []; }, propDecorators: { control: [{
486
+ type: Input
487
+ }] } });
488
+
489
+ class SpecialCheckboxModule {
490
+ }
491
+ SpecialCheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
492
+ SpecialCheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: SpecialCheckboxModule, declarations: [SpecialCheckboxComponent], imports: [FormsModule,
493
+ MatCheckboxModule,
494
+ CommonModule,
495
+ MatInputModule,
496
+ MatIconModule,
497
+ ReactiveFormsModule,
498
+ MatButtonModule,
499
+ ErrorMessagePipeModule], exports: [SpecialCheckboxComponent] });
500
+ SpecialCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialCheckboxModule, imports: [FormsModule,
501
+ MatCheckboxModule,
502
+ CommonModule,
503
+ MatInputModule,
504
+ MatIconModule,
505
+ ReactiveFormsModule,
506
+ MatButtonModule,
507
+ ErrorMessagePipeModule] });
508
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialCheckboxModule, decorators: [{
509
+ type: NgModule,
510
+ args: [{
511
+ declarations: [SpecialCheckboxComponent],
512
+ imports: [
513
+ FormsModule,
514
+ MatCheckboxModule,
515
+ CommonModule,
516
+ MatInputModule,
517
+ MatIconModule,
518
+ ReactiveFormsModule,
519
+ MatButtonModule,
520
+ ErrorMessagePipeModule
521
+ ],
522
+ exports: [SpecialCheckboxComponent],
523
+ }]
524
+ }] });
525
+
526
+ class SpecialTextAreaComponent {
527
+ constructor() {
528
+ this.onBlur = new EventEmitter();
529
+ this.onEnter = new EventEmitter();
530
+ }
531
+ ngOnInit() { }
532
+ }
533
+ SpecialTextAreaComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialTextAreaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
534
+ SpecialTextAreaComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: SpecialTextAreaComponent, selector: "sp-text-area", inputs: { control: "control" }, outputs: { onBlur: "onBlur", onEnter: "onEnter" }, ngImport: i0, template: "<mat-form-field\n *ngIf=\"control\"\n [id]=\"control.elementId\"\n class=\"w-full {{ control.styleClasses }}\"\n [appearance]=\"control.label ? 'outline' : 'standard'\"\n>\n <mat-label *ngIf=\"control.label\">{{ control.label }}</mat-label>\n <textarea\n cdkTextareaAutosize\n #autosize=\"cdkTextareaAutosize\"\n cdkAutosizeMinRows=\"1\"\n cdkAutosizeMaxRows=\"5\"\n matInput\n (blur)=\"onBlur.emit(control.value)\"\n (keydown.enter)=\"onEnter.emit(control.value)\"\n [type]=\"control.settings?.type || 'text'\"\n [readonly]=\"control.readOnly\"\n [required]=\"control.required\"\n [placeholder]=\"control.placeholder\"\n [formControl]=\"control\"\n ></textarea>\n <mat-icon *ngIf=\"control.icon\" matPrefix>{{ control.icon }} </mat-icon>\n <mat-hint>\n {{ control.tooltip }}\n </mat-hint>\n <mat-error>\n {{ control.errors | errorMessage: control.errorMessages }}\n </mat-error>\n</mat-form-field>\n", styles: [":host{display:contents}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$2.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "directive", type: i1$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i1$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$1.MatPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i7.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: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: ErrorMessagePipe, name: "errorMessage" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
535
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialTextAreaComponent, decorators: [{
536
+ type: Component,
537
+ args: [{ selector: 'sp-text-area', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-form-field\n *ngIf=\"control\"\n [id]=\"control.elementId\"\n class=\"w-full {{ control.styleClasses }}\"\n [appearance]=\"control.label ? 'outline' : 'standard'\"\n>\n <mat-label *ngIf=\"control.label\">{{ control.label }}</mat-label>\n <textarea\n cdkTextareaAutosize\n #autosize=\"cdkTextareaAutosize\"\n cdkAutosizeMinRows=\"1\"\n cdkAutosizeMaxRows=\"5\"\n matInput\n (blur)=\"onBlur.emit(control.value)\"\n (keydown.enter)=\"onEnter.emit(control.value)\"\n [type]=\"control.settings?.type || 'text'\"\n [readonly]=\"control.readOnly\"\n [required]=\"control.required\"\n [placeholder]=\"control.placeholder\"\n [formControl]=\"control\"\n ></textarea>\n <mat-icon *ngIf=\"control.icon\" matPrefix>{{ control.icon }} </mat-icon>\n <mat-hint>\n {{ control.tooltip }}\n </mat-hint>\n <mat-error>\n {{ control.errors | errorMessage: control.errorMessages }}\n </mat-error>\n</mat-form-field>\n", styles: [":host{display:contents}\n"] }]
538
+ }], ctorParameters: function () { return []; }, propDecorators: { control: [{
539
+ type: Input
540
+ }], onBlur: [{
541
+ type: Output
542
+ }], onEnter: [{
543
+ type: Output
544
+ }] } });
545
+
546
+ class SpecialTextAreaModule {
547
+ }
548
+ SpecialTextAreaModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialTextAreaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
549
+ SpecialTextAreaModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: SpecialTextAreaModule, declarations: [SpecialTextAreaComponent], imports: [InputMaskModule,
550
+ CommonModule,
551
+ MatInputModule,
552
+ MatIconModule,
553
+ ReactiveFormsModule,
554
+ MatButtonModule,
555
+ ErrorMessagePipeModule], exports: [SpecialTextAreaComponent] });
556
+ SpecialTextAreaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialTextAreaModule, imports: [InputMaskModule,
557
+ CommonModule,
558
+ MatInputModule,
559
+ MatIconModule,
560
+ ReactiveFormsModule,
561
+ MatButtonModule,
562
+ ErrorMessagePipeModule] });
563
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialTextAreaModule, decorators: [{
564
+ type: NgModule,
565
+ args: [{
566
+ declarations: [SpecialTextAreaComponent],
567
+ imports: [
568
+ InputMaskModule,
569
+ CommonModule,
570
+ MatInputModule,
571
+ MatIconModule,
572
+ ReactiveFormsModule,
573
+ MatButtonModule,
574
+ ErrorMessagePipeModule,
575
+ ],
576
+ exports: [SpecialTextAreaComponent],
577
+ }]
578
+ }] });
579
+
580
+ class SpecialUploadComponent {
581
+ constructor(sanitizer) {
582
+ this.sanitizer = sanitizer;
583
+ this.onSelect = new EventEmitter();
584
+ this.previewImages = [];
585
+ }
586
+ set controlSetter(control) {
587
+ this.control = control;
588
+ this.previewImages = control.value;
589
+ }
590
+ ngOnInit() { }
591
+ onSelectMultiple(event) {
592
+ this.previewImages = [
593
+ ...this.previewImages,
594
+ ...event.addedFiles.map(file => ({
595
+ lastModified: file.lastModified,
596
+ url: this.sanitizer.bypassSecurityTrustUrl(URL.createObjectURL(file))
597
+ }))
598
+ ];
599
+ this.control.setValue([
600
+ ...this.control.value,
601
+ ...event.addedFiles.map(this.fixFileName)
602
+ ]);
603
+ this.onSelect.emit(this.control.value);
604
+ this.control.markAsDirty();
605
+ }
606
+ onSelectOne(event) {
607
+ this.previewImages = event.addedFiles.map(file => ({
608
+ lastModified: file.lastModified,
609
+ url: this.sanitizer.bypassSecurityTrustUrl(URL.createObjectURL(file))
610
+ }));
611
+ this.control.setValue(event.addedFiles.map(this.fixFileName));
612
+ this.onSelect.emit(this.control.value);
613
+ this.control.markAsDirty();
614
+ }
615
+ fixFileName(file) {
616
+ return Object.defineProperty(file, 'name', {
617
+ writable: true,
618
+ value: file.name.normalize("NFD").replace(/[\u0300-\u036f]/g, "")
619
+ });
620
+ }
621
+ clean() {
622
+ this.previewImages = [];
623
+ }
624
+ onRemove(file) {
625
+ this.control.setValue(this.control.value.filter(fl => fl.lastModified !== file.lastModified));
626
+ this.previewImages = this.previewImages.filter(fl => fl.lastModified !== file.lastModified);
627
+ }
628
+ }
629
+ SpecialUploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialUploadComponent, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
630
+ SpecialUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: SpecialUploadComponent, selector: "sp-upload", inputs: { controlSetter: ["control", "controlSetter"] }, outputs: { onSelect: "onSelect" }, ngImport: i0, template: "<div class=\"special_upload mb-2\">\n <ngx-dropzone\n class=\"special_upload__dropzone\"\n [ngClass]=\"{\n 'special_upload--error-dashed':\n !!control.errors && (control.dirty || control.touched)\n }\"\n [multiple]=\"control.settings?.multiple\"\n [accept]=\"\n control.settings?.accept\n ? control.settings?.accept\n : 'image/png, .jpeg, .jpg, image/gif'\n \"\n (change)=\"\n control.settings?.multiple\n ? onSelectMultiple($event)\n : onSelectOne($event)\n \"\n >\n <ngx-dropzone-label\n [ngClass]=\"{\n 'special_upload--error':\n !!control.errors && (control.dirty || control.touched)\n }\"\n >\n <mat-icon class=\"special_upload__icon\"*ngIf=\"control.icon\">{{ control.icon }} </mat-icon>\n <h2 class=\"text-base font-bold\">\n {{ control.label }}\n </h2>\n <h3 class=\"text-base\">\n {{ control.placeholder }}\n </h3>\n </ngx-dropzone-label>\n <ngx-dropzone-preview\n *ngFor=\"let file of previewImages\"\n [removable]=\"true\"\n (removed)=\"onRemove(file)\"\n >\n <ngx-dropzone-label class=\"special_upload__card\">\n <img class=\"special_upload__card--image\" [src]=\"file?.url\" alt=\"\" />\n </ngx-dropzone-label>\n </ngx-dropzone-preview>\n </ngx-dropzone>\n <div\n class=\"special_upload--error mt-2\"\n *ngIf=\"!!control.errors && (control.dirty || control.touched)\"\n >\n {{ control.errors | errorMessage: control.errorMessages }}\n </div>\n</div>\n", styles: [":host{display:contents}:host .special-upload{margin-bottom:2rem}:host .special-upload__icon{height:64px;width:64px;font-size:64px}:host .special-upload__card{width:100%;height:100%;margin:0;box-sizing:border-box;display:flex;align-items:center;flex-direction:column}:host .special-upload__card--image{width:100%;height:100%;object-fit:cover}\n"], dependencies: [{ kind: "component", type: i2$3.NgxDropzoneComponent, selector: "ngx-dropzone, [ngx-dropzone]", inputs: ["accept", "disabled", "multiple", "maxFileSize", "expandable", "disableClick", "processDirectoryDrop", "id", "aria-label", "aria-labelledby", "aria-describedby"], outputs: ["change"] }, { kind: "directive", type: i2$3.NgxDropzoneLabelDirective, selector: "ngx-dropzone-label" }, { kind: "component", type: i2$3.NgxDropzonePreviewComponent, selector: "ngx-dropzone-preview", inputs: ["file", "removable"], outputs: ["removed"] }, { kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: ErrorMessagePipe, name: "errorMessage" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
631
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialUploadComponent, decorators: [{
632
+ type: Component,
633
+ args: [{ selector: 'sp-upload', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"special_upload mb-2\">\n <ngx-dropzone\n class=\"special_upload__dropzone\"\n [ngClass]=\"{\n 'special_upload--error-dashed':\n !!control.errors && (control.dirty || control.touched)\n }\"\n [multiple]=\"control.settings?.multiple\"\n [accept]=\"\n control.settings?.accept\n ? control.settings?.accept\n : 'image/png, .jpeg, .jpg, image/gif'\n \"\n (change)=\"\n control.settings?.multiple\n ? onSelectMultiple($event)\n : onSelectOne($event)\n \"\n >\n <ngx-dropzone-label\n [ngClass]=\"{\n 'special_upload--error':\n !!control.errors && (control.dirty || control.touched)\n }\"\n >\n <mat-icon class=\"special_upload__icon\"*ngIf=\"control.icon\">{{ control.icon }} </mat-icon>\n <h2 class=\"text-base font-bold\">\n {{ control.label }}\n </h2>\n <h3 class=\"text-base\">\n {{ control.placeholder }}\n </h3>\n </ngx-dropzone-label>\n <ngx-dropzone-preview\n *ngFor=\"let file of previewImages\"\n [removable]=\"true\"\n (removed)=\"onRemove(file)\"\n >\n <ngx-dropzone-label class=\"special_upload__card\">\n <img class=\"special_upload__card--image\" [src]=\"file?.url\" alt=\"\" />\n </ngx-dropzone-label>\n </ngx-dropzone-preview>\n </ngx-dropzone>\n <div\n class=\"special_upload--error mt-2\"\n *ngIf=\"!!control.errors && (control.dirty || control.touched)\"\n >\n {{ control.errors | errorMessage: control.errorMessages }}\n </div>\n</div>\n", styles: [":host{display:contents}:host .special-upload{margin-bottom:2rem}:host .special-upload__icon{height:64px;width:64px;font-size:64px}:host .special-upload__card{width:100%;height:100%;margin:0;box-sizing:border-box;display:flex;align-items:center;flex-direction:column}:host .special-upload__card--image{width:100%;height:100%;object-fit:cover}\n"] }]
634
+ }], ctorParameters: function () { return [{ type: i1$2.DomSanitizer }]; }, propDecorators: { controlSetter: [{
635
+ type: Input,
636
+ args: ['control']
637
+ }], onSelect: [{
638
+ type: Output
639
+ }] } });
640
+
641
+ class SpecialUploadModule {
642
+ }
643
+ SpecialUploadModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialUploadModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
644
+ SpecialUploadModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: SpecialUploadModule, declarations: [SpecialUploadComponent], imports: [FormsModule,
645
+ NgxDropzoneModule,
646
+ CommonModule,
647
+ MatIconModule,
648
+ ReactiveFormsModule,
649
+ MatButtonModule,
650
+ ErrorMessagePipeModule], exports: [SpecialUploadComponent] });
651
+ SpecialUploadModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialUploadModule, imports: [FormsModule,
652
+ NgxDropzoneModule,
653
+ CommonModule,
654
+ MatIconModule,
655
+ ReactiveFormsModule,
656
+ MatButtonModule,
657
+ ErrorMessagePipeModule] });
658
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialUploadModule, decorators: [{
659
+ type: NgModule,
660
+ args: [{
661
+ declarations: [SpecialUploadComponent],
662
+ imports: [
663
+ FormsModule,
664
+ NgxDropzoneModule,
665
+ CommonModule,
666
+ MatIconModule,
667
+ ReactiveFormsModule,
668
+ MatButtonModule,
669
+ ErrorMessagePipeModule
670
+ ],
671
+ exports: [SpecialUploadComponent],
672
+ }]
673
+ }] });
674
+
675
+ class SpecialLabelComponent {
676
+ constructor() { }
677
+ ngOnInit() { }
678
+ get settings() {
679
+ return this.control.settings || { isLink: false };
680
+ }
681
+ onLink() {
682
+ if (this.settings.isLink && this.settings.onClickLink) {
683
+ this.settings.onClickLink(this.control.value);
684
+ }
685
+ }
686
+ }
687
+ SpecialLabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
688
+ SpecialLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: SpecialLabelComponent, selector: "sp-label", inputs: { control: "control" }, ngImport: i0, template: "<div class=\"px-2 {{control.styleClasses}} {{ control.value | textByFunction: settings.stylesPipe}}\">\n <div *ngIf=\"!!control.label\" class=\"font-bold\">{{control.label}}</div>\n <div [ngClass]=\"{'cursor-pointer text-blue-600 hover:text-blue-700':settings.isLink }\" (click)=\"onLink()\">\n {{ control.value | textByFunction: control.settings.pipe}}\n </div>\n</div>\n", styles: [":host{display:contents}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: TextByFunctionPipe, name: "textByFunction" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
689
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialLabelComponent, decorators: [{
690
+ type: Component,
691
+ args: [{ selector: 'sp-label', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"px-2 {{control.styleClasses}} {{ control.value | textByFunction: settings.stylesPipe}}\">\n <div *ngIf=\"!!control.label\" class=\"font-bold\">{{control.label}}</div>\n <div [ngClass]=\"{'cursor-pointer text-blue-600 hover:text-blue-700':settings.isLink }\" (click)=\"onLink()\">\n {{ control.value | textByFunction: control.settings.pipe}}\n </div>\n</div>\n", styles: [":host{display:contents}\n"] }]
692
+ }], ctorParameters: function () { return []; }, propDecorators: { control: [{
693
+ type: Input
694
+ }] } });
695
+
696
+ class SpecialLabelModule {
697
+ }
698
+ SpecialLabelModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialLabelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
699
+ SpecialLabelModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: SpecialLabelModule, declarations: [SpecialLabelComponent], imports: [InputMaskModule,
700
+ CommonModule,
701
+ MatInputModule,
702
+ MatIconModule,
703
+ ReactiveFormsModule,
704
+ MatButtonModule,
705
+ TextByFunctionPipeModule,
706
+ ErrorMessagePipeModule], exports: [SpecialLabelComponent] });
707
+ SpecialLabelModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialLabelModule, imports: [InputMaskModule,
708
+ CommonModule,
709
+ MatInputModule,
710
+ MatIconModule,
711
+ ReactiveFormsModule,
712
+ MatButtonModule,
713
+ TextByFunctionPipeModule,
714
+ ErrorMessagePipeModule] });
715
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialLabelModule, decorators: [{
716
+ type: NgModule,
717
+ args: [{
718
+ declarations: [SpecialLabelComponent],
719
+ imports: [
720
+ InputMaskModule,
721
+ CommonModule,
722
+ MatInputModule,
723
+ MatIconModule,
724
+ ReactiveFormsModule,
725
+ MatButtonModule,
726
+ TextByFunctionPipeModule,
727
+ ErrorMessagePipeModule
728
+ ],
729
+ exports: [SpecialLabelComponent],
730
+ }]
731
+ }] });
732
+
733
+ class FormControlsListPipe {
734
+ transform(controls) {
735
+ if (!controls)
736
+ return [];
737
+ return Object.values(controls)
738
+ .filter((control) => !control.hidden)
739
+ .map((control) => control);
740
+ }
741
+ }
742
+ FormControlsListPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: FormControlsListPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
743
+ FormControlsListPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: FormControlsListPipe, name: "controlsList" });
744
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: FormControlsListPipe, decorators: [{
745
+ type: Pipe,
746
+ args: [{ name: 'controlsList' }]
747
+ }] });
748
+
749
+ class SpecialFormComponent {
750
+ set control(form) {
751
+ this.form = form;
752
+ }
753
+ ngOnInit() { }
754
+ }
755
+ SpecialFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
756
+ SpecialFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: SpecialFormComponent, selector: "sp-form", inputs: { form: ["control", "form"] }, ngImport: i0, template: "<div class=\"w-full box-border p-2\">\n <div\n *ngIf=\"form\"\n [class]=\"\n form.label\n ? 'w-full mt-2 p-3 border-slate-200 border border-solid box-border'\n : 'container'\n \"\n >\n <h1 *ngIf=\"!!form.label\" class=\"font-bold py-3\">{{ form.label }}</h1>\n <div class=\"w-full flex flex-wrap\">\n <ng-template\n *ngFor=\"let control of form.controls | controlsList\"\n controlRender\n [control]=\"control\"\n ></ng-template>\n </div>\n </div>\n</div>\n", styles: [":host{display:contents}\n"], dependencies: [{ kind: "directive", type: i0.forwardRef(function () { return i3.NgForOf; }), selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i0.forwardRef(function () { return i3.NgIf; }), selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i0.forwardRef(function () { return FormControlsRenderDirective; }), selector: "[controlRender]", inputs: ["control"] }, { kind: "pipe", type: i0.forwardRef(function () { return FormControlsListPipe; }), name: "controlsList" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
757
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialFormComponent, decorators: [{
758
+ type: Component,
759
+ args: [{ selector: 'sp-form', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"w-full box-border p-2\">\n <div\n *ngIf=\"form\"\n [class]=\"\n form.label\n ? 'w-full mt-2 p-3 border-slate-200 border border-solid box-border'\n : 'container'\n \"\n >\n <h1 *ngIf=\"!!form.label\" class=\"font-bold py-3\">{{ form.label }}</h1>\n <div class=\"w-full flex flex-wrap\">\n <ng-template\n *ngFor=\"let control of form.controls | controlsList\"\n controlRender\n [control]=\"control\"\n ></ng-template>\n </div>\n </div>\n</div>\n", styles: [":host{display:contents}\n"] }]
760
+ }], propDecorators: { form: [{
761
+ type: Input,
762
+ args: ['control']
763
+ }] } });
764
+ class SpecialArrayComponent {
765
+ constructor() { }
766
+ set control(formArray) {
767
+ this.formArray = formArray;
768
+ }
769
+ get withFormHeader() {
770
+ return this.formArray.settings.withFormHeader;
771
+ }
772
+ get settings() {
773
+ return this.formArray.settings;
774
+ }
775
+ ngOnInit() { }
776
+ removeItem(index) {
777
+ this.formArray.removeAt(index);
778
+ }
779
+ addItem() {
780
+ this.formArray.addItem();
781
+ }
782
+ }
783
+ SpecialArrayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialArrayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
784
+ SpecialArrayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: SpecialArrayComponent, selector: "sp-array", inputs: { formArray: ["control", "formArray"] }, ngImport: i0, template: "<div class=\"w-full box-border p-2\">\r\n <div\r\n *ngIf=\"formArray\"\r\n class=\"w-full mt-2 p-3 border-slate-200 border border-solid box-border\"\r\n >\r\n <h1 *ngIf=\"!!formArray.label\" class=\"font-bold py-3\">\r\n {{ formArray.label }}\r\n </h1>\r\n <div class=\"divide-y divide-solid\">\r\n <div\r\n *ngIf=\"formArray.form\"\r\n [ngClass]=\"{ 'md:grid-cols-15': settings.withActionButtons }\"\r\n class=\"grid gap-4 grid-cols-12\"\r\n >\r\n <ng-container *ngIf=\"!withFormHeader; else FORMHEADERREF\">\r\n <h2\r\n [class]=\"item.styleClasses\"\r\n *ngFor=\"let item of formArray.form.controls | controlsList\"\r\n >\r\n {{ item.label }}\r\n </h2>\r\n <div\r\n *ngIf=\"settings.withActionButtons\"\r\n class=\"\r\n col-start-7 col-end-13\r\n md:col-start-13 md:col-end-16\r\n pb-5\r\n my-auto\r\n ml-auto\r\n md:m-auto\r\n \"\r\n ></div>\r\n </ng-container>\r\n <ng-template #FORMHEADERREF>\r\n <ng-template\r\n *ngFor=\"let item of formArray.form.controls | controlsList\"\r\n controlRender\r\n [control]=\"item\"\r\n ></ng-template>\r\n <div\r\n *ngIf=\"settings.withActionButtons\"\r\n class=\"\r\n col-start-7 col-end-13\r\n md:col-start-13 md:col-end-16\r\n pb-5\r\n my-auto\r\n ml-auto\r\n md:m-auto\r\n \"\r\n >\r\n <button\r\n mat-flat-button\r\n color=\"primary\"\r\n [disabled]=\"formArray.form.invalid\"\r\n (click)=\"addItem()\"\r\n >\r\n Add\r\n </button>\r\n </div>\r\n </ng-template>\r\n </div>\r\n <div\r\n class=\"w-full pt-5 grid gap-4 grid-cols-12 md:grid-cols-15\"\r\n *ngFor=\"let formGroup of formArray.controls; let i = index\"\r\n >\r\n <ng-template\r\n *ngFor=\"let item of formGroup.controls | controlsList\"\r\n controlRender\r\n [control]=\"item\"\r\n ></ng-template>\r\n <div\r\n class=\"\r\n col-start-7 col-end-13\r\n md:col-start-13 md:col-end-16\r\n pb-5\r\n my-auto\r\n ml-auto\r\n md:m-auto\r\n \"\r\n >\r\n <button mat-flat-button color=\"warn\" (click)=\"removeItem(i)\">\r\n Remove\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- <table class=\"form-array-container__table\">\r\n <thead *ngIf=\"formArray.form\">\r\n <tr\r\n *ngIf=\"headerForm; else HEADERFORMREF\"\r\n class=\"form-array-container__table-header\"\r\n >\r\n <th\r\n class=\"header-cell\"\r\n *ngFor=\"let control of formArray.form | controlsList\"\r\n >\r\n {{ control.label | translate }}\r\n </th>\r\n <th *ngIf=\"!formArray.readOnly\"></th>\r\n </tr>\r\n <ng-template #HEADERFORMREF>\r\n <tr class=\"table-form-header\">\r\n <th\r\n class=\"header-cell\"\r\n [ngSwitch]=\"control.type\"\r\n *ngFor=\"let control of formArray.form | controlsList\"\r\n >\r\n <sp-form-control-selector\r\n [control]=\"control\"\r\n ></sp-form-control-selector>\r\n </th>\r\n <th class=\"header-cell\" *ngIf=\"!formArray.readOnly\">\r\n <ng-container *ngTemplateOutlet=\"ADDBUTTON\"></ng-container>\r\n </th>\r\n </tr>\r\n </ng-template>\r\n </thead> -->\r\n\r\n<!-- [ngStyle]=\"{'max-height':'calc(100vh - '+maxHeight+'px)' }\"> -->\r\n<!-- <tbody>\r\n <tr *ngFor=\"let formGroup of formArray.controls; let i = index\">\r\n <td [ngSwitch]=\"control.type\" *ngFor=\"let control of formGroup.controls | controlsList\">\r\n <sp-form-control-selector\r\n [control]=\"control\"\r\n ></sp-form-control-selector>\r\n </td>\r\n <td *ngIf=\"!formArray.readOnly\">\r\n <bmb-button\r\n [icon]=\"'delete_outline'\"\r\n [type]=\"'Raised'\"\r\n [size]=\"'XLarge'\"\r\n [bdrColor]=\"'error-500'\"\r\n [tColor]=\"'error-500'\"\r\n (onClick)=\"deleteItem(i)\"\r\n >\r\n </bmb-button>\r\n </td>\r\n </tr>\r\n </tbody> -->\r\n<!-- </table> -->\r\n\r\n<!-- <ng-template #TABLET>\r\n <div class=\"mt-1\">\r\n <ng-container *ngIf=\"headerFormEnable\">\r\n <div class=\"card-form-container\">\r\n <automatic-forms [form]=\"formArray.form\" [enableButtons]=\"false\">\r\n </automatic-forms>\r\n <ng-container *ngTemplateOutlet=\"ADDBUTTON\"></ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-content select=\"[header]\"></ng-content>\r\n </div>\r\n <div class=\"accordion-container\">\r\n <mat-accordion>\r\n <mat-expansion-panel\r\n class=\"mat-elevation-z1\"\r\n *ngFor=\"let item of formArray.controls; let i = index\"\r\n >\r\n <mat-expansion-panel-header\r\n class=\"expanded-header\"\r\n collapsedHeight=\"3rem\"\r\n expandedHeight=\"3rem\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"cardHeaderTemplate; context: { $implicit: item }\"\r\n >\r\n </ng-container>\r\n <mat-icon\r\n *ngIf=\"!formArray.readOnly\"\r\n class=\"mobile-delete\"\r\n (click)=\"deleteItem(i)\"\r\n color=\"warn\"\r\n >\r\n delete_outline\r\n </mat-icon>\r\n </mat-expansion-panel-header>\r\n <ng-container\r\n *ngTemplateOutlet=\"cardBodyTemplate; context: { $implicit: item }\"\r\n >\r\n </ng-container>\r\n </mat-expansion-panel>\r\n </mat-accordion>\r\n </div>\r\n</ng-template>\r\n\r\n<div class=\"text-error\" *ngIf=\"formArray.dirty && formArray.invalid\">\r\n {{ formArray.errors | errorMessage | translate }}\r\n</div>\r\n\r\n<ng-template #ADDBUTTON>\r\n <div class=\"add-item-btn\">\r\n <bmb-button\r\n [icon]=\"'add'\"\r\n [type]=\"'Raised'\"\r\n [bdrColor]=\"'aux-success'\"\r\n [size]=\"'XLarge'\"\r\n [tColor]=\"'aux-success'\"\r\n [disabled]=\"!formArray.form.valid || !formArray.form.dirty\"\r\n (onClick)=\"addItemAction()\"\r\n >\r\n </bmb-button>\r\n </div>\r\n</ng-template> -->\r\n", styles: [":host{display:contents}\n"], dependencies: [{ kind: "directive", type: i0.forwardRef(function () { return i3.NgClass; }), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i0.forwardRef(function () { return i3.NgForOf; }), selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i0.forwardRef(function () { return i3.NgIf; }), selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i0.forwardRef(function () { return i7$1.MatButton; }), selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i0.forwardRef(function () { return FormControlsRenderDirective; }), selector: "[controlRender]", inputs: ["control"] }, { kind: "pipe", type: i0.forwardRef(function () { return FormControlsListPipe; }), name: "controlsList" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
785
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialArrayComponent, decorators: [{
786
+ type: Component,
787
+ args: [{ selector: 'sp-array', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"w-full box-border p-2\">\r\n <div\r\n *ngIf=\"formArray\"\r\n class=\"w-full mt-2 p-3 border-slate-200 border border-solid box-border\"\r\n >\r\n <h1 *ngIf=\"!!formArray.label\" class=\"font-bold py-3\">\r\n {{ formArray.label }}\r\n </h1>\r\n <div class=\"divide-y divide-solid\">\r\n <div\r\n *ngIf=\"formArray.form\"\r\n [ngClass]=\"{ 'md:grid-cols-15': settings.withActionButtons }\"\r\n class=\"grid gap-4 grid-cols-12\"\r\n >\r\n <ng-container *ngIf=\"!withFormHeader; else FORMHEADERREF\">\r\n <h2\r\n [class]=\"item.styleClasses\"\r\n *ngFor=\"let item of formArray.form.controls | controlsList\"\r\n >\r\n {{ item.label }}\r\n </h2>\r\n <div\r\n *ngIf=\"settings.withActionButtons\"\r\n class=\"\r\n col-start-7 col-end-13\r\n md:col-start-13 md:col-end-16\r\n pb-5\r\n my-auto\r\n ml-auto\r\n md:m-auto\r\n \"\r\n ></div>\r\n </ng-container>\r\n <ng-template #FORMHEADERREF>\r\n <ng-template\r\n *ngFor=\"let item of formArray.form.controls | controlsList\"\r\n controlRender\r\n [control]=\"item\"\r\n ></ng-template>\r\n <div\r\n *ngIf=\"settings.withActionButtons\"\r\n class=\"\r\n col-start-7 col-end-13\r\n md:col-start-13 md:col-end-16\r\n pb-5\r\n my-auto\r\n ml-auto\r\n md:m-auto\r\n \"\r\n >\r\n <button\r\n mat-flat-button\r\n color=\"primary\"\r\n [disabled]=\"formArray.form.invalid\"\r\n (click)=\"addItem()\"\r\n >\r\n Add\r\n </button>\r\n </div>\r\n </ng-template>\r\n </div>\r\n <div\r\n class=\"w-full pt-5 grid gap-4 grid-cols-12 md:grid-cols-15\"\r\n *ngFor=\"let formGroup of formArray.controls; let i = index\"\r\n >\r\n <ng-template\r\n *ngFor=\"let item of formGroup.controls | controlsList\"\r\n controlRender\r\n [control]=\"item\"\r\n ></ng-template>\r\n <div\r\n class=\"\r\n col-start-7 col-end-13\r\n md:col-start-13 md:col-end-16\r\n pb-5\r\n my-auto\r\n ml-auto\r\n md:m-auto\r\n \"\r\n >\r\n <button mat-flat-button color=\"warn\" (click)=\"removeItem(i)\">\r\n Remove\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- <table class=\"form-array-container__table\">\r\n <thead *ngIf=\"formArray.form\">\r\n <tr\r\n *ngIf=\"headerForm; else HEADERFORMREF\"\r\n class=\"form-array-container__table-header\"\r\n >\r\n <th\r\n class=\"header-cell\"\r\n *ngFor=\"let control of formArray.form | controlsList\"\r\n >\r\n {{ control.label | translate }}\r\n </th>\r\n <th *ngIf=\"!formArray.readOnly\"></th>\r\n </tr>\r\n <ng-template #HEADERFORMREF>\r\n <tr class=\"table-form-header\">\r\n <th\r\n class=\"header-cell\"\r\n [ngSwitch]=\"control.type\"\r\n *ngFor=\"let control of formArray.form | controlsList\"\r\n >\r\n <sp-form-control-selector\r\n [control]=\"control\"\r\n ></sp-form-control-selector>\r\n </th>\r\n <th class=\"header-cell\" *ngIf=\"!formArray.readOnly\">\r\n <ng-container *ngTemplateOutlet=\"ADDBUTTON\"></ng-container>\r\n </th>\r\n </tr>\r\n </ng-template>\r\n </thead> -->\r\n\r\n<!-- [ngStyle]=\"{'max-height':'calc(100vh - '+maxHeight+'px)' }\"> -->\r\n<!-- <tbody>\r\n <tr *ngFor=\"let formGroup of formArray.controls; let i = index\">\r\n <td [ngSwitch]=\"control.type\" *ngFor=\"let control of formGroup.controls | controlsList\">\r\n <sp-form-control-selector\r\n [control]=\"control\"\r\n ></sp-form-control-selector>\r\n </td>\r\n <td *ngIf=\"!formArray.readOnly\">\r\n <bmb-button\r\n [icon]=\"'delete_outline'\"\r\n [type]=\"'Raised'\"\r\n [size]=\"'XLarge'\"\r\n [bdrColor]=\"'error-500'\"\r\n [tColor]=\"'error-500'\"\r\n (onClick)=\"deleteItem(i)\"\r\n >\r\n </bmb-button>\r\n </td>\r\n </tr>\r\n </tbody> -->\r\n<!-- </table> -->\r\n\r\n<!-- <ng-template #TABLET>\r\n <div class=\"mt-1\">\r\n <ng-container *ngIf=\"headerFormEnable\">\r\n <div class=\"card-form-container\">\r\n <automatic-forms [form]=\"formArray.form\" [enableButtons]=\"false\">\r\n </automatic-forms>\r\n <ng-container *ngTemplateOutlet=\"ADDBUTTON\"></ng-container>\r\n </div>\r\n </ng-container>\r\n <ng-content select=\"[header]\"></ng-content>\r\n </div>\r\n <div class=\"accordion-container\">\r\n <mat-accordion>\r\n <mat-expansion-panel\r\n class=\"mat-elevation-z1\"\r\n *ngFor=\"let item of formArray.controls; let i = index\"\r\n >\r\n <mat-expansion-panel-header\r\n class=\"expanded-header\"\r\n collapsedHeight=\"3rem\"\r\n expandedHeight=\"3rem\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"cardHeaderTemplate; context: { $implicit: item }\"\r\n >\r\n </ng-container>\r\n <mat-icon\r\n *ngIf=\"!formArray.readOnly\"\r\n class=\"mobile-delete\"\r\n (click)=\"deleteItem(i)\"\r\n color=\"warn\"\r\n >\r\n delete_outline\r\n </mat-icon>\r\n </mat-expansion-panel-header>\r\n <ng-container\r\n *ngTemplateOutlet=\"cardBodyTemplate; context: { $implicit: item }\"\r\n >\r\n </ng-container>\r\n </mat-expansion-panel>\r\n </mat-accordion>\r\n </div>\r\n</ng-template>\r\n\r\n<div class=\"text-error\" *ngIf=\"formArray.dirty && formArray.invalid\">\r\n {{ formArray.errors | errorMessage | translate }}\r\n</div>\r\n\r\n<ng-template #ADDBUTTON>\r\n <div class=\"add-item-btn\">\r\n <bmb-button\r\n [icon]=\"'add'\"\r\n [type]=\"'Raised'\"\r\n [bdrColor]=\"'aux-success'\"\r\n [size]=\"'XLarge'\"\r\n [tColor]=\"'aux-success'\"\r\n [disabled]=\"!formArray.form.valid || !formArray.form.dirty\"\r\n (onClick)=\"addItemAction()\"\r\n >\r\n </bmb-button>\r\n </div>\r\n</ng-template> -->\r\n", styles: [":host{display:contents}\n"] }]
788
+ }], ctorParameters: function () { return []; }, propDecorators: { formArray: [{
789
+ type: Input,
790
+ args: ['control']
791
+ }] } });
792
+ class FormControlsRenderDirective {
793
+ constructor(viewContainer) {
794
+ this.viewContainer = viewContainer;
795
+ this.componentsBuffer = {
796
+ [EControlTypes$1.autocomplete]: SpecialAutocompleteComponent,
797
+ [EControlTypes$1.checkbox]: SpecialCheckboxComponent,
798
+ [EControlTypes$1.date]: SpecialDatepickerComponent,
799
+ [EControlTypes$1.dropdown]: SpecialDropdownComponent,
800
+ [EControlTypes$1.array]: SpecialArrayComponent,
801
+ [EControlTypes$1.input]: SpecialInputComponent,
802
+ [EControlTypes$1.multiple]: SpecialMultipleAutocompleteComponent,
803
+ [EControlTypes$1.textArea]: SpecialTextAreaComponent,
804
+ [EControlTypes$1.label]: SpecialLabelComponent,
805
+ [EControlTypes$1.upload]: SpecialUploadComponent,
806
+ [EControlTypes$1.form]: SpecialFormComponent,
807
+ };
808
+ }
809
+ set controlSetter(control) {
810
+ this.viewContainer.clear();
811
+ const component = this.componentsBuffer[control.type];
812
+ if (component) {
813
+ const componentRef = this.viewContainer.createComponent(component);
814
+ componentRef.instance.control = control;
815
+ }
816
+ }
817
+ }
818
+ FormControlsRenderDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: FormControlsRenderDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
819
+ FormControlsRenderDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.3", type: FormControlsRenderDirective, selector: "[controlRender]", inputs: { controlSetter: ["control", "controlSetter"] }, ngImport: i0 });
820
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: FormControlsRenderDirective, decorators: [{
821
+ type: Directive,
822
+ args: [{
823
+ selector: `[controlRender]`,
824
+ }]
825
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { controlSetter: [{
826
+ type: Input,
827
+ args: ['control']
828
+ }] } });
829
+
830
+ class FormControlsListPipeModule {
831
+ }
832
+ FormControlsListPipeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: FormControlsListPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
833
+ FormControlsListPipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: FormControlsListPipeModule, declarations: [FormControlsListPipe], imports: [CommonModule], exports: [FormControlsListPipe] });
834
+ FormControlsListPipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: FormControlsListPipeModule, imports: [CommonModule] });
835
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: FormControlsListPipeModule, decorators: [{
836
+ type: NgModule,
837
+ args: [{
838
+ declarations: [FormControlsListPipe],
839
+ imports: [CommonModule],
840
+ exports: [FormControlsListPipe],
841
+ }]
842
+ }] });
843
+
844
+ class SpecialFormModule {
845
+ }
846
+ SpecialFormModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
847
+ SpecialFormModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: SpecialFormModule, declarations: [SpecialArrayComponent,
848
+ FormControlsRenderDirective,
849
+ SpecialFormComponent], imports: [CommonModule,
850
+ FormControlsListPipeModule,
851
+ MatButtonModule,
852
+ SpecialDropdownModule,
853
+ SpecialInputModule,
854
+ SpecialAutocompleteModule,
855
+ SpecialDatepickerModule,
856
+ SpecialLabelModule,
857
+ SpecialMultipleAutocompleteModule,
858
+ SpecialCheckboxModule,
859
+ SpecialTextAreaModule,
860
+ SpecialUploadModule], exports: [SpecialArrayComponent,
861
+ FormControlsRenderDirective,
862
+ SpecialFormComponent] });
863
+ SpecialFormModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialFormModule, imports: [CommonModule,
864
+ FormControlsListPipeModule,
865
+ MatButtonModule,
866
+ SpecialDropdownModule,
867
+ SpecialInputModule,
868
+ SpecialAutocompleteModule,
869
+ SpecialDatepickerModule,
870
+ SpecialLabelModule,
871
+ SpecialMultipleAutocompleteModule,
872
+ SpecialCheckboxModule,
873
+ SpecialTextAreaModule,
874
+ SpecialUploadModule] });
875
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialFormModule, decorators: [{
876
+ type: NgModule,
877
+ args: [{
878
+ declarations: [
879
+ SpecialArrayComponent,
880
+ FormControlsRenderDirective,
881
+ SpecialFormComponent,
882
+ ],
883
+ imports: [
884
+ CommonModule,
885
+ FormControlsListPipeModule,
886
+ MatButtonModule,
887
+ SpecialDropdownModule,
888
+ SpecialInputModule,
889
+ SpecialAutocompleteModule,
890
+ SpecialDatepickerModule,
891
+ SpecialLabelModule,
892
+ SpecialMultipleAutocompleteModule,
893
+ SpecialCheckboxModule,
894
+ SpecialTextAreaModule,
895
+ SpecialUploadModule,
896
+ ],
897
+ exports: [
898
+ SpecialArrayComponent,
899
+ FormControlsRenderDirective,
900
+ SpecialFormComponent,
901
+ ],
902
+ }]
903
+ }] });
904
+
905
+ var EControlTypes;
906
+ (function (EControlTypes) {
907
+ EControlTypes["pkey"] = "PRIMARY-KEY";
908
+ EControlTypes["input"] = "INPUT";
909
+ EControlTypes["textArea"] = "TEXT-AREA";
910
+ EControlTypes["dropdown"] = "DROPDOWN";
911
+ EControlTypes["date"] = "DATE";
912
+ EControlTypes["time"] = "TIME";
913
+ EControlTypes["checkbox"] = "CHECKBOX";
914
+ EControlTypes["upload"] = "UPLOAD";
915
+ EControlTypes["autocomplete"] = "AUTOCOMPLETE";
916
+ EControlTypes["multiple"] = "MULTIPLE-AUTOCOMPLETE";
917
+ EControlTypes["array"] = "ARRAY";
918
+ EControlTypes["form"] = "FORM";
919
+ EControlTypes["label"] = "LABEL";
920
+ EControlTypes["default"] = "DEFAULT";
921
+ })(EControlTypes || (EControlTypes = {}));
922
+
923
+ class SpecialFormControl extends FormControl {
924
+ constructor({ name, settings, type, validators, asyncValidators, elementId, styleClasses, defaultValue, hidden, icon, label, length, placeholder, readOnly, required, tooltip, errorMessages, disabled, }) {
925
+ super(defaultValue, validators, asyncValidators);
926
+ this.name = name;
927
+ this.placeholder = placeholder;
928
+ this.label = label;
929
+ this.tooltip = tooltip;
930
+ this.icon = icon;
931
+ this.elementId = elementId;
932
+ this.settings = settings;
933
+ this.type = type;
934
+ this.styleClasses = styleClasses;
935
+ this.hidden = hidden;
936
+ this.length = length;
937
+ this.readOnly = readOnly;
938
+ this.required = required;
939
+ this.errorMessages = errorMessages;
940
+ disabled ? this.disable() : this.enable();
941
+ }
942
+ setReadOnly(status = true) {
943
+ this.readOnly = status;
944
+ }
945
+ setDisabled(status = true) {
946
+ status ? this.disable() : this.enable();
947
+ }
948
+ setHidden(status = true) {
949
+ this.hidden = status;
950
+ }
951
+ }
952
+ class SpecialFormGroup extends FormGroup {
953
+ constructor({ name, settings, type, validators, asyncValidators, elementId, styleClasses, defaultValue, hidden, icon, label, length, placeholder, readOnly, required, tooltip, disabled, }, controls) {
954
+ super(controls, validators, asyncValidators);
955
+ this.name = name;
956
+ this.placeholder = placeholder;
957
+ this.label = label;
958
+ this.tooltip = tooltip;
959
+ this.icon = icon;
960
+ this.elementId = elementId;
961
+ this.settings = settings;
962
+ this.type = type;
963
+ this.styleClasses = styleClasses;
964
+ this.hidden = hidden;
965
+ this.length = length;
966
+ this.readOnly = readOnly;
967
+ this.required = required;
968
+ this.defaultValue = defaultValue;
969
+ disabled ? this.disable() : this.enable();
970
+ }
971
+ unpristineRequired() {
972
+ Object.values(this.controls).forEach((control) => {
973
+ if (control instanceof SpecialFormControl) {
974
+ control.markAsDirty();
975
+ }
976
+ else if (control instanceof SpecialFormGroup) {
977
+ control.unpristineRequired();
978
+ }
979
+ else if (control instanceof SpecialFormArray) {
980
+ control.unpristineRequired();
981
+ }
982
+ });
983
+ }
984
+ specialReset(value = {}) {
985
+ const aux = {};
986
+ Object.entries(this.controls).map(([key, control]) => {
987
+ if (control instanceof SpecialFormControl) {
988
+ aux[key] = control.defaultValue;
989
+ }
990
+ else if (control instanceof SpecialFormArray) {
991
+ control.clear();
992
+ }
993
+ });
994
+ this.reset(Object.assign(Object.assign({}, aux), value));
995
+ }
996
+ setReadOnly(status = true) {
997
+ Object.values(this.controls).map((value) => {
998
+ if (value instanceof SpecialFormControl ||
999
+ value instanceof SpecialFormArray ||
1000
+ value instanceof SpecialFormGroup) {
1001
+ value.setReadOnly(status);
1002
+ }
1003
+ });
1004
+ }
1005
+ setReadOnlyByFields(fieldsObject) {
1006
+ Object.entries(fieldsObject).map(([key, value]) => {
1007
+ const control = this.controls[key];
1008
+ if (control instanceof SpecialFormControl) {
1009
+ control.readOnly = value;
1010
+ }
1011
+ });
1012
+ }
1013
+ setHiddenByFields(fields) {
1014
+ Object.entries(fields).map(([key, value]) => {
1015
+ const control = this.controls[key];
1016
+ if (control instanceof SpecialFormControl) {
1017
+ control.hidden = value;
1018
+ }
1019
+ });
1020
+ }
1021
+ setDisabled(status) {
1022
+ Object.values(this.controls).map((value) => {
1023
+ if (value instanceof SpecialFormControl ||
1024
+ value instanceof SpecialFormArray ||
1025
+ value instanceof SpecialFormGroup) {
1026
+ value.setDisabled(status);
1027
+ }
1028
+ });
1029
+ }
1030
+ setDisabledByFields(fieldsObject) {
1031
+ Object.entries(fieldsObject).map((entries) => {
1032
+ if (this.controls[entries[0]] instanceof SpecialFormControl) {
1033
+ entries[1]
1034
+ ? this.controls[entries[0]].enable()
1035
+ : this.controls[entries[0]].disable();
1036
+ }
1037
+ });
1038
+ }
1039
+ /**
1040
+ * donde value es el objeto semilla y detailForm es un arreglo de form key para dar un marco al formarray
1041
+ */
1042
+ setFormValue(value) {
1043
+ this.specialReset(value);
1044
+ Object.entries(this.controls)
1045
+ .filter(([_key, control]) => control instanceof SpecialFormArray)
1046
+ .map(([key, control]) => {
1047
+ control.fillFormArray(value[key]);
1048
+ });
1049
+ }
1050
+ /**
1051
+ * Método que retorna
1052
+ */
1053
+ getIdPkey() {
1054
+ return Object.values(this.controls).find((control) => control instanceof SpecialFormControl && control.type === 'PRIMARY-KEY');
1055
+ }
1056
+ }
1057
+ class SpecialFormArray extends FormArray {
1058
+ constructor({ name, settings, type, validators, asyncValidators, elementId, styleClasses, defaultValue, hidden, icon, label, placeholder, readOnly, required, tooltip, errorMessages, disabled, }, formCreation, controls) {
1059
+ super(controls, validators, asyncValidators);
1060
+ this.formCreation = formCreation;
1061
+ this.form = this.formCreation();
1062
+ this.name = name;
1063
+ this.placeholder = placeholder;
1064
+ this.label = label;
1065
+ this.tooltip = tooltip;
1066
+ this.icon = icon;
1067
+ this.elementId = elementId;
1068
+ this.settings = settings;
1069
+ this.type = type;
1070
+ this.styleClasses = styleClasses;
1071
+ this.hidden = hidden;
1072
+ this.readOnly = readOnly;
1073
+ this.required = required;
1074
+ this.defaultValue = defaultValue;
1075
+ this.errorMessages = errorMessages;
1076
+ disabled ? this.disable() : this.enable();
1077
+ }
1078
+ fillFormArray(data) {
1079
+ this.form.reset();
1080
+ this.clear();
1081
+ data.forEach((item) => {
1082
+ const form = this.formCreation(item);
1083
+ this.push(form);
1084
+ });
1085
+ }
1086
+ addItem() {
1087
+ const form = this.formCreation(this.form.value);
1088
+ this.form.specialReset();
1089
+ this.push(form);
1090
+ this.markAsDirty();
1091
+ }
1092
+ specialPush(index) {
1093
+ const form = this.formCreation(this.form.value);
1094
+ if (!index)
1095
+ this.push(form);
1096
+ else
1097
+ this.controls[index].reset(this.form.value);
1098
+ }
1099
+ specialInsert(index = 0) {
1100
+ const form = this.formCreation(this.form.value);
1101
+ this.insert(index, form);
1102
+ }
1103
+ specialEdit(index, newValue) {
1104
+ this.controls[index].reset(Object.assign(Object.assign({}, this.controls[index].value), newValue));
1105
+ this.markAsDirty();
1106
+ }
1107
+ /**
1108
+ * Vuelve todos los controles del formArray de lectura o de sololectura
1109
+ * @param status
1110
+ */
1111
+ setReadOnly(status) {
1112
+ this.readOnly = status;
1113
+ this.controls.forEach((control) => {
1114
+ if (control instanceof SpecialFormGroup) {
1115
+ control.setReadOnly(status);
1116
+ }
1117
+ });
1118
+ }
1119
+ /**
1120
+ * Vuelve todos los controles del formArray habilitados o deshabilitados
1121
+ * @param status
1122
+ */
1123
+ setDisabled(status) {
1124
+ status ? this.disable() : this.enable();
1125
+ this.controls.forEach((control) => {
1126
+ if (control instanceof SpecialFormGroup) {
1127
+ control.setDisabled(status);
1128
+ }
1129
+ });
1130
+ }
1131
+ /**
1132
+ * Permite editar un control especifico.
1133
+ * @param index
1134
+ */
1135
+ editControl(index) {
1136
+ this.form.reset(this.controls[index].value);
1137
+ }
1138
+ unpristineRequired() {
1139
+ this.markAsDirty();
1140
+ this.controls.forEach((item) => {
1141
+ item.unpristineRequired();
1142
+ });
1143
+ }
1144
+ recursiveFillForm(form, data) {
1145
+ Object.entries(form.controls).map(([key, control]) => {
1146
+ if (control instanceof FormControl) {
1147
+ control.setValue(data[key]);
1148
+ }
1149
+ else if (control instanceof FormArray) {
1150
+ data[key].forEach(() => { });
1151
+ }
1152
+ else if (control instanceof FormGroup) {
1153
+ control.reset(data[key]);
1154
+ }
1155
+ });
1156
+ return form;
1157
+ }
1158
+ }
1159
+
1160
+ class SpecialFormBuilderService {
1161
+ constructor() {
1162
+ this.defectField = {
1163
+ asyncValidators: null,
1164
+ validators: null,
1165
+ defaultValue: null,
1166
+ elementId: '',
1167
+ hidden: false,
1168
+ icon: '',
1169
+ label: '',
1170
+ disabled: false,
1171
+ length: 0,
1172
+ placeholder: '',
1173
+ readOnly: false,
1174
+ required: false,
1175
+ styleClasses: '',
1176
+ errorMessages: {},
1177
+ tooltip: '',
1178
+ };
1179
+ this.inputDefectField = Object.assign(Object.assign({}, this.defectField), { settings: {}, type: EControlTypes.input, name: '' });
1180
+ this.formDefectField = Object.assign(Object.assign({}, this.defectField), { settings: {
1181
+ formFields: {},
1182
+ }, type: EControlTypes.form, name: '' });
1183
+ this.arrayDefectField = Object.assign(Object.assign({}, this.defectField), { settings: {
1184
+ formFields: {},
1185
+ }, type: EControlTypes.array, name: '' });
1186
+ }
1187
+ control(field) {
1188
+ const formField = Object.assign(Object.assign({}, this.inputDefectField), field);
1189
+ const { control } = this.setFormControl(formField);
1190
+ return control;
1191
+ }
1192
+ group(fields, parentField = {}) {
1193
+ return this.formGenerator(this.fieldDataToArray(fields), parentField);
1194
+ }
1195
+ array() { }
1196
+ fieldDataToArray(fields) {
1197
+ return Object.entries(fields).map(([name, field]) => this.setDefectFieldOptions(name, field));
1198
+ }
1199
+ setDefectFieldOptions(name, field) {
1200
+ return Object.assign(Object.assign(Object.assign({}, this.inputDefectField), field), { name });
1201
+ }
1202
+ formGenerator(fields, parentField = {}) {
1203
+ const formField = Object.assign(Object.assign({}, this.formDefectField), parentField);
1204
+ const structure = fields
1205
+ .map((field) => this.getControlAndNameByType(field))
1206
+ .reduce((prev, { name, control }) => (Object.assign(Object.assign({}, prev), { [name]: control })), {});
1207
+ return new SpecialFormGroup(formField, structure);
1208
+ }
1209
+ getControlAndNameByType(field) {
1210
+ switch (field.type) {
1211
+ case EControlTypes.array:
1212
+ return this.setFormArray(field);
1213
+ case EControlTypes.form:
1214
+ return this.setFormGroup(field);
1215
+ default:
1216
+ return this.setFormControl(field);
1217
+ }
1218
+ }
1219
+ setFormGroup(field) {
1220
+ const control = this.formGenerator(this.fieldDataToArray(field.settings.formFields), field);
1221
+ return { control, name: field.name };
1222
+ }
1223
+ setFormArray(field) {
1224
+ const auxForm = (value = {}) => {
1225
+ const auxForm = this.formGenerator(this.fieldDataToArray(field.settings.formFields), {});
1226
+ auxForm.reset(value);
1227
+ return auxForm;
1228
+ };
1229
+ if (field.required) {
1230
+ field.validators = this.setValidatorsArray(field.validators, [
1231
+ this.arrayLengthRequired,
1232
+ ]);
1233
+ }
1234
+ return {
1235
+ name: field.name,
1236
+ control: new SpecialFormArray(field, auxForm, []),
1237
+ };
1238
+ }
1239
+ setFormControl(field) {
1240
+ const validators = [];
1241
+ if (field.required)
1242
+ validators.push(this.setRequiredValidator(field));
1243
+ if (field.length)
1244
+ validators.push(Validators.maxLength(field.length));
1245
+ field.validators = this.setValidatorsArray(field.validators, validators);
1246
+ return {
1247
+ name: field.name,
1248
+ control: new SpecialFormControl(field),
1249
+ };
1250
+ }
1251
+ setRequiredValidator(field) {
1252
+ if (field.type !== EControlTypes.autocomplete) {
1253
+ return Validators.required;
1254
+ }
1255
+ return (control) => !!control.value && control.value instanceof Object
1256
+ ? null
1257
+ : { required: true };
1258
+ }
1259
+ setValidatorsArray(validators, newValidators) {
1260
+ if (!validators) {
1261
+ return newValidators;
1262
+ }
1263
+ return validators instanceof Array
1264
+ ? [...validators, ...newValidators]
1265
+ : [validators, ...newValidators];
1266
+ }
1267
+ arrayLengthRequired(control) {
1268
+ if (control.value.length) {
1269
+ return {};
1270
+ }
1271
+ return { noItems: 'NO_SELECTED_ITEM' };
1272
+ }
1273
+ }
1274
+ SpecialFormBuilderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialFormBuilderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1275
+ SpecialFormBuilderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialFormBuilderService, providedIn: 'root' });
1276
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SpecialFormBuilderService, decorators: [{
1277
+ type: Injectable,
1278
+ args: [{
1279
+ providedIn: 'root',
1280
+ }]
1281
+ }], ctorParameters: function () { return []; } });
1282
+
1283
+ /*
1284
+ * Public API Surface of special-forms
1285
+ */
1286
+
1287
+ /**
1288
+ * Generated bundle index. Do not edit.
1289
+ */
1290
+
1291
+ export { FormControlsRenderDirective, SpecialArrayComponent, SpecialAutocompleteComponent, SpecialAutocompleteModule, SpecialCheckboxComponent, SpecialCheckboxModule, SpecialDatepickerComponent, SpecialDatepickerModule, SpecialDropdownComponent, SpecialDropdownModule, SpecialFormBuilderService, SpecialFormComponent, SpecialFormModule, SpecialInputComponent, SpecialInputModule, SpecialLabelComponent, SpecialLabelModule, SpecialMultipleAutocompleteComponent, SpecialMultipleAutocompleteModule, SpecialTextAreaComponent, SpecialTextAreaModule, SpecialUploadComponent, SpecialUploadModule };
1292
+ //# sourceMappingURL=special-forms.mjs.map