form-dynamic-ajax 7.0.3 → 7.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,323 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, Input, NgModule } from '@angular/core';
3
+ import * as i1 from '@ngx-translate/core';
4
+ import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
5
+ import * as i2 from '@angular/forms';
6
+ import { ReactiveFormsModule } from '@angular/forms';
7
+ import * as i3 from 'primeng/inputmask';
8
+ import { InputMaskModule } from 'primeng/inputmask';
9
+ import * as i4 from 'primeng/api';
10
+ import * as i5 from 'primeng/inputnumber';
11
+ import { InputNumberModule } from 'primeng/inputnumber';
12
+ import * as i6 from 'primeng/password';
13
+ import { PasswordModule } from 'primeng/password';
14
+ import * as i7 from 'primeng/button';
15
+ import { ButtonModule } from 'primeng/button';
16
+ import * as i8 from 'primeng/table';
17
+ import { TableModule } from 'primeng/table';
18
+ import * as i9 from 'primeng/multiselect';
19
+ import { MultiSelectModule } from 'primeng/multiselect';
20
+ import * as i10 from '@angular/common';
21
+ import { CommonModule } from '@angular/common';
22
+ import * as i11 from 'primeng/selectbutton';
23
+ import { SelectButtonModule } from 'primeng/selectbutton';
24
+ import * as i12 from 'primeng/inputswitch';
25
+ import { InputSwitchModule } from 'primeng/inputswitch';
26
+ import * as i13 from 'primeng/checkbox';
27
+ import { CheckboxModule } from 'primeng/checkbox';
28
+ import * as i14 from 'primeng/inputtextarea';
29
+ import { InputTextareaModule } from 'primeng/inputtextarea';
30
+ import * as i15 from 'primeng/inputtext';
31
+ import { InputTextModule } from 'primeng/inputtext';
32
+ import * as i16 from 'primeng/divider';
33
+ import { DividerModule } from 'primeng/divider';
34
+ import * as i17 from 'primeng/calendar';
35
+ import { CalendarModule } from 'primeng/calendar';
36
+ import * as i18 from 'primeng/dropdown';
37
+ import { DropdownModule } from 'primeng/dropdown';
38
+ import * as i19 from 'primeng/treeselect';
39
+ import { TreeSelectModule } from 'primeng/treeselect';
40
+ import * as i20 from 'primeng/radiobutton';
41
+ import { RadioButtonModule } from 'primeng/radiobutton';
42
+ import * as i21 from 'primeng/autocomplete';
43
+ import { AutoCompleteModule } from 'primeng/autocomplete';
44
+ import * as i22 from 'primeng/overlaypanel';
45
+ import { OverlayPanelModule } from 'primeng/overlaypanel';
46
+ import * as i23 from 'primeng/editor';
47
+ import { EditorModule } from 'primeng/editor';
48
+ import { TranslateHttpLoader } from '@ngx-translate/http-loader';
49
+ import { HttpClientModule, HttpClient } from '@angular/common/http';
50
+ import { FileUploadModule } from 'primeng/fileupload';
51
+
52
+ class FormDynamicAngularComponent {
53
+ constructor(translate, formBuilder) {
54
+ this.translate = translate;
55
+ this.formBuilder = formBuilder;
56
+ this.validateForm = false;
57
+ this.form = [];
58
+ this.files = [];
59
+ this.filesView = [];
60
+ this.filteredAutoComplete = [];
61
+ this.toBase64 = async (file) => {
62
+ return new Promise((resolve, _) => {
63
+ const reader = new FileReader();
64
+ reader.onloadend = () => resolve(reader.result);
65
+ reader.readAsDataURL(file);
66
+ });
67
+ };
68
+ this.control = this.formBuilder.group({});
69
+ }
70
+ ngOnInit() {
71
+ this.files.map(f => {
72
+ this.filesView.push({ ...f, type: f.contentType });
73
+ });
74
+ if (window.location.protocol === "https") {
75
+ navigator.mediaDevices.getUserMedia({ video: true })
76
+ .then(function (mediaStream) {
77
+ const video = document.querySelector('#video');
78
+ if (video) {
79
+ video.srcObject = mediaStream;
80
+ video.play();
81
+ }
82
+ })
83
+ .catch(function (err) { });
84
+ }
85
+ }
86
+ numberOfMonthsDate(numberOfMonthsDate) {
87
+ return numberOfMonthsDate ?? 1;
88
+ }
89
+ selectionMode(selectionMode) {
90
+ return selectionMode ?? "single";
91
+ }
92
+ async capturePhoto(fileName) {
93
+ const canvas = document.querySelector("#canvas");
94
+ const icon = document.querySelector("#icon-remove");
95
+ const video = document.querySelector('#video');
96
+ const button = document.querySelector('#button');
97
+ if (canvas && video) {
98
+ canvas.height = video.videoHeight;
99
+ canvas.width = video.videoWidth;
100
+ const context = canvas.getContext('2d');
101
+ if (context && icon && button) {
102
+ context.drawImage(video, 0, 0);
103
+ video.style.display = "none";
104
+ button.disabled = true;
105
+ canvas.style.display = "block";
106
+ icon.style.visibility = "visible";
107
+ let aux = {
108
+ name: "photo user",
109
+ contentType: "image/png",
110
+ content: canvas.toDataURL("image/png")
111
+ };
112
+ this.control.get(fileName)?.setValue(aux);
113
+ }
114
+ }
115
+ }
116
+ removePhoto() {
117
+ const canvas = document.querySelector("#canvas");
118
+ const icon = document.querySelector("#icon-remove");
119
+ const video = document.querySelector('#video');
120
+ const button = document.querySelector('#button');
121
+ if (canvas && video) {
122
+ const context = canvas.getContext('2d');
123
+ if (context && icon && button) {
124
+ video.style.display = "block";
125
+ button.disabled = false;
126
+ canvas.style.display = "none";
127
+ icon.style.visibility = "collapse";
128
+ }
129
+ }
130
+ }
131
+ getUrl(file) {
132
+ return window.URL.createObjectURL(file);
133
+ }
134
+ async onSelectFile(fileName, event, multiple) {
135
+ const file = event.target.files;
136
+ // if (!multiple) {
137
+ // this.filesView = [];
138
+ // }
139
+ this.filesView.push(...file);
140
+ const newFIles = file;
141
+ let arr = [];
142
+ for (const item of newFIles) {
143
+ let aux = {
144
+ name: item.name,
145
+ contentType: item?.type,
146
+ content: await this.toBase64(item)
147
+ };
148
+ arr.push(aux);
149
+ }
150
+ this.control.get(fileName)?.setValue(arr);
151
+ }
152
+ onRemove(event, fileName) {
153
+ this.filesView.splice(this.filesView.indexOf(event), 1);
154
+ var input = document.getElementById('fileInput');
155
+ if (input) {
156
+ input.value = '';
157
+ }
158
+ }
159
+ filterAutoComplete(event, suggestionsAutoComplete) {
160
+ let filtered = [];
161
+ let query = event.query;
162
+ if (suggestionsAutoComplete) {
163
+ for (let i = 0; i < suggestionsAutoComplete.length; i++) {
164
+ let dados = suggestionsAutoComplete[i];
165
+ if (dados.description.toLowerCase().normalize('NFD').replace(/\p{M}/ug, '').indexOf(query.toLowerCase().normalize('NFD').replace(/\p{M}/ug, '')) != -1) {
166
+ filtered.push(dados);
167
+ }
168
+ }
169
+ this.filteredAutoComplete = filtered;
170
+ }
171
+ }
172
+ onChange(change) {
173
+ if (change) {
174
+ change();
175
+ }
176
+ }
177
+ clickCLear(clear) {
178
+ if (clear) {
179
+ clear();
180
+ }
181
+ }
182
+ onBlur(blur) {
183
+ if (blur) {
184
+ blur();
185
+ }
186
+ }
187
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: FormDynamicAngularComponent, deps: [{ token: i1.TranslateService }, { token: i2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
188
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.0", type: FormDynamicAngularComponent, selector: "form-dynamic-angular", inputs: { title: "title", subTitle: "subTitle", validateForm: "validateForm", form: "form", control: "control", buttonsStandard: "buttonsStandard", buttonsOptional: "buttonsOptional", files: "files" }, ngImport: i0, template: "<div>\r\n <div *ngIf=\"title\" class=\"div-title\">\r\n <span translate=\"{{ title }}\"></span>\r\n <div *ngIf=\"subTitle\" class=\"flex subtitle\">\r\n <span translate=\"{{ subTitle }}\"></span>\r\n </div>\r\n <p-divider></p-divider>\r\n </div>\r\n <form *ngIf=\"control\" [formGroup]=\"control\">\r\n <div class=\"grid\">\r\n <div *ngFor=\"let item of form\" class=\"{{ item.col }} col-12\">\r\n <label *ngIf=\"item.label && !item.hideLabelTop\">{{ item.label }}</label>\r\n <label *ngIf=\"item.required && item.label\" class=\"danger-text ml-2\"\r\n >*</label\r\n >\r\n\r\n <div class=\"mt-2\">\r\n <!-- text -->\r\n <input\r\n id=\"{{ item.id }}\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n pInputText\r\n placeholder=\"{{ item.placeholder }}\"\r\n *ngIf=\"item.type == 'text' || item.type == 'number'\"\r\n type=\"{{ item.type }}\"\r\n formControlName=\"{{ item.formControl }}\"\r\n class=\"w-full\"\r\n />\r\n\r\n <p-editor\r\n *ngIf=\"item.type == 'editor'\"\r\n formControlName=\"{{ item.formControl }}\"\r\n [style]=\"{ height: '320px' }\"\r\n />\r\n\r\n <!-- select -->\r\n <p-dropdown\r\n id=\"{{ item.id }}\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n [filter]=\"item.search\"\r\n emptyFilterMessage=\"Nenhum dado encontrado\"\r\n emptyMessage=\"Nenhum dado encontrado\"\r\n placeholder=\"{{ item.placeholder }}\"\r\n styleClass=\"w-full p-0\"\r\n (onChange)=\"onChange(item.onChange)\"\r\n *ngIf=\"item.type === 'select'\"\r\n [showClear]=\"true\"\r\n [options]=\"item.options\"\r\n formControlName=\"{{ item.formControl }}\"\r\n optionLabel=\"description\"\r\n (onClear)=\"clickCLear(item.onCLear)\"\r\n ></p-dropdown>\r\n\r\n <!-- currency -->\r\n <p-inputNumber\r\n id=\"{{ item.id }}\"\r\n *ngIf=\"item.type === 'currency'\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n formControlName=\"{{ item.formControl }}\"\r\n placeholder=\"{{ item.placeholder }}\"\r\n inputStyleClass=\"w-full\"\r\n styleClass=\"w-full\"\r\n (onKeyDown)=\"onChange(item.onChange)\"\r\n mode=\"currency\"\r\n [min]=\"0\"\r\n currency=\"BRL\"\r\n >\r\n </p-inputNumber>\r\n\r\n <!-- mask -->\r\n <p-inputMask\r\n id=\"{{ item.id }}\"\r\n *ngIf=\"item.type === 'mask'\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n formControlName=\"{{ item.formControl }}\"\r\n placeholder=\"{{ item.placeholder }}\"\r\n styleClass=\"w-full\"\r\n (onComplete)=\"onChange(item.onChange)\"\r\n mask=\"{{ item.mask }}\"\r\n unmask=\"{{ item.unmask }}\"\r\n (onClear)=\"clickCLear(item.onCLear)\"\r\n showClear=\"true\"\r\n ></p-inputMask>\r\n\r\n <!-- treeSelect -->\r\n <p-treeSelect\r\n id=\"{{ item.id }}\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n placeholder=\"{{ item.placeholder }}\"\r\n (onNodeSelect)=\"onChange(item.onChange)\"\r\n *ngIf=\"item.type === 'tree-select'\"\r\n containerStyleClass=\"w-full p-0\"\r\n formControlName=\"{{ item.formControl }}\"\r\n [options]=\"item.treeSelectOptions\"\r\n [filter]=\"true\"\r\n [filterInputAutoFocus]=\"true\"\r\n emptyMessage=\"Nenhum dado encontrado\"\r\n [showClear]=\"true\"\r\n (onClear)=\"clickCLear(item.onCLear)\"\r\n ></p-treeSelect>\r\n\r\n <!-- autoComplete -->\r\n <p-autoComplete\r\n inputId=\"{{ item.id }}\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n placeholder=\"{{ item.placeholder }}\"\r\n styleClass=\"w-full p-0\"\r\n [inputStyle]=\"{ width: '100%' }\"\r\n *ngIf=\"item.type === 'autocomplete'\"\r\n (onSelect)=\"onChange(item.onChange)\"\r\n formControlName=\"{{ item.formControl }}\"\r\n [suggestions]=\"filteredAutoComplete\"\r\n (completeMethod)=\"filterAutoComplete($event, item.options)\"\r\n [forceSelection]=\"false\"\r\n [showEmptyMessage]=\"true\"\r\n emptyMessage=\"Nenhum dado encontrado\"\r\n dataKey=\"code\"\r\n field=\"description\"\r\n showClear=\"true\"\r\n (onClear)=\"clickCLear(item.onCLear)\"\r\n ></p-autoComplete>\r\n\r\n <!-- date -->\r\n <p-calendar\r\n id=\"{{ item.id }}\"\r\n view=\"{{ item.viewDate }}\"\r\n *ngIf=\"item.type === 'date'\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n formControlName=\"{{ item.formControl }}\"\r\n styleClass=\"w-full\"\r\n [numberOfMonths]=\"numberOfMonthsDate(item.numberOfMonthsDate)\"\r\n [selectionMode]=\"selectionMode(item.selectionMode)\"\r\n (onFocus)=\"onChange(item.onFocusDate)\"\r\n [maxDate]=\"item.maxDate\"\r\n [minDate]=\"item.minDate\"\r\n dateFormat=\"{{ item.dateFormat }}\"\r\n (onSelect)=\"onChange(item.onChange)\"\r\n [iconDisplay]=\"'input'\"\r\n placeholder=\"{{ item.placeholder }}\"\r\n [showIcon]=\"true\"\r\n [showTime]=\"item.showTime\"\r\n [timeOnly]=\"item.timeOnly\"\r\n ></p-calendar>\r\n\r\n <!-- textarea -->\r\n <div *ngIf=\"item.type === 'text-area'\" class=\"text-right\">\r\n <textarea\r\n id=\"{{ item.id }}\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n placeholder=\"{{ item.placeholder }}\"\r\n class=\"w-full\"\r\n maxlength=\"{{ item.maxlength }}\"\r\n counterTemplate=\"{1} of 50, {0} remaining\"\r\n counter=\"display\"\r\n (attr.change)=\"onChange(item.onChange)\"\r\n pInputTextarea\r\n formControlName=\"{{ item.formControl }}\"\r\n rows=\"{{ item.rowsTextArea }}\"\r\n ></textarea>\r\n <small *ngIf=\"item.maxlength\" id=\"username-help\">\r\n {{ control.controls[item.formControl].value.length }}/{{\r\n item.maxlength\r\n }}\r\n </small>\r\n </div>\r\n\r\n <!-- checkbox -->\r\n <div *ngIf=\"item.type == 'check-box'\">\r\n <p-checkbox\r\n id=\"{{ item.id }}\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n (onChange)=\"onChange(item.onChange)\"\r\n binary=\"true\"\r\n formControlName=\"{{ item.formControl }}\"\r\n value=\"{{ item.formControl }}\"\r\n label=\"{{ item.label }}\"\r\n ></p-checkbox>\r\n </div>\r\n\r\n <!-- checkbox multiple -->\r\n <div\r\n id=\"{{ item.id }}\"\r\n *ngIf=\"item.type === 'check-box-multi'\"\r\n class=\"flex gap-3\"\r\n >\r\n <div\r\n formArrayName=\"{{ item.formControl }}\"\r\n *ngFor=\"let list of item.options; let i = index\"\r\n class=\"flex align-items-center gap-2\"\r\n >\r\n <div [formGroupName]=\"i\">\r\n <p-checkbox\r\n id=\"{{ item.id }}\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n (onChange)=\"onChange(item.onChange)\"\r\n binary=\"true\"\r\n formControlName=\"{{ list.code }}\"\r\n label=\"{{ list.description }}\"\r\n ></p-checkbox>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- button -->\r\n <p-button\r\n id=\"{{ item.id }}\"\r\n *ngIf=\"item.type == 'button'\"\r\n styleClass=\"{{ item.buttonClass }} w-full mt-3\"\r\n (click)=\"item.onCLick()\"\r\n [disabled]=\"item.disabled\"\r\n icon=\"{{ item.iconButton }}\"\r\n label=\"{{ item.label }}\"\r\n ></p-button>\r\n\r\n <!-- can -->\r\n <div id=\"{{ item.id }}\" class=\"area\" *ngIf=\"item.type == 'can'\">\r\n <video autoplay=\"true\" id=\"webCamera\"></video>\r\n\r\n <input type=\"text\" id=\"base_img\" name=\"base_img\" />\r\n <button type=\"button\" onclick=\"takeSnapShot()\">\r\n Tirar foto e salvar\r\n </button>\r\n\r\n <img id=\"imagemConvertida\" />\r\n <p id=\"caminhoImagem\" class=\"caminho-imagem\">\r\n <a href=\"\" target=\"_blank\" rel=\"noopener\"></a>\r\n </p>\r\n <script src=\"script.js\"></script>\r\n </div>\r\n\r\n <!-- upload files -->\r\n <div\r\n id=\"{{ item.id }}\"\r\n *ngIf=\"item.type === 'upload-files' && !item.disabled\"\r\n class=\"drag-image\"\r\n [style.border]=\"\r\n validateForm && control.controls[item.formControl].errors\r\n ? ' 1px dashed #f18282'\r\n : ' 1px dashed #d1d5db'\r\n \"\r\n >\r\n <i *ngIf=\"filesView.length === 0\" class=\"pi pi-cloud-upload\"></i>\r\n <p *ngIf=\"filesView.length === 0\">\r\n Clique ou arraste e solte um arquivo para anexar\r\n </p>\r\n <span *ngIf=\"filesView.length === 0\">{{\r\n item.msgAcceptFiles\r\n }}</span>\r\n <input\r\n id=\"fileInput\"\r\n type=\"file\"\r\n [multiple]=\"item.multileFile\"\r\n [accept]=\"item.acceptFiles\"\r\n (change)=\"\r\n onSelectFile(item.formControl, $event, item.multileFile)\r\n \"\r\n />\r\n <div *ngFor=\"let f of filesView\">\r\n <div *ngIf=\"f.type && f.type.includes('image')\">\r\n <label class=\"preview-img\">\r\n <img *ngIf=\"!f.content\" src=\"{{ getUrl(f) }}\" />\r\n <img *ngIf=\"f.content\" src=\"{{ f.content }}\" />\r\n <span *ngIf=\"item.viewNameFile\">{{ f.name }}</span>\r\n <input\r\n type=\"file\"\r\n [multiple]=\"item.multileFile\"\r\n [accept]=\"item.acceptFiles\"\r\n (change)=\"\r\n onSelectFile(item.formControl, $event, item.multileFile)\r\n \"\r\n />\r\n <label>\r\n <i\r\n class=\"pi pi-times remove-file absolute\"\r\n (click)=\"onRemove(item.formControl, f)\"\r\n ></i\r\n ></label>\r\n </label>\r\n </div>\r\n <div *ngIf=\"f.type && !f.type.includes('image')\">\r\n <label class=\"preview-img h-0 max-w-0 mh-75 m-0\">\r\n <label class=\"mr-3\">{{ f.name }}</label>\r\n <input\r\n type=\"file\"\r\n [multiple]=\"item.multileFile\"\r\n [accept]=\"item.acceptFiles\"\r\n (change)=\"\r\n onSelectFile(item.formControl, $event, item.multileFile)\r\n \"\r\n />\r\n <label>\r\n <i\r\n class=\"pi pi-times remove-file absolute\"\r\n (click)=\"onRemove(f)\"\r\n ></i\r\n ></label>\r\n </label>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- upload files disabled -->\r\n <!-- <p-fileUpload mode=\"basic\" formControlName=\"{{item.formControl}}\" chooseLabel=\"Choose\"\r\n chooseIcon=\"pi pi-upload\" accept=\"image/*\" maxFileSize=\"1000000\" /> -->\r\n\r\n <div\r\n id=\"{{ item.id }}\"\r\n *ngIf=\"item.type === 'upload-files' && item.disabled\"\r\n >\r\n <p-button\r\n (click)=\"op.toggle($event)\"\r\n icon=\"pi pi-paperclip\"\r\n label=\"Arquivos anexados\"\r\n ></p-button>\r\n\r\n <p-overlayPanel\r\n #op\r\n [style]=\"{ width: '450px' }\"\r\n [showCloseIcon]=\"true\"\r\n >\r\n <ng-template pTemplate=\"content\">\r\n <p-table\r\n *ngIf=\"files.length > 0\"\r\n [value]=\"files\"\r\n selectionMode=\"single\"\r\n [(selection)]=\"selectedProduct\"\r\n (onRowSelect)=\"onRowSelect($event, op)\"\r\n responsiveLayout=\"scroll\"\r\n >\r\n <ng-template pTemplate=\"header\">\r\n <tr>\r\n <th pSortableColumn=\"name\">\r\n Nome<p-sortIcon field=\"name\"></p-sortIcon>\r\n </th>\r\n <th></th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData let-file>\r\n <tr>\r\n <td *ngIf=\"item.viewNameFile\">{{ file.name }}</td>\r\n <td>\r\n <p-button\r\n *ngIf=\"item.onCLick\"\r\n icon=\"pi pi-download\"\r\n (click)=\"item.onCLick(file)\"\r\n ></p-button>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n <div *ngIf=\"files.length === 0\" class=\"p-10\">\r\n <label>Nenhum arquivo anexado</label>\r\n </div>\r\n </ng-template>\r\n </p-overlayPanel>\r\n </div>\r\n\r\n <!-- list -->\r\n <ul id=\"{{ item.id }}\" *ngIf=\"item.type === 'list' && item.options\">\r\n <li *ngFor=\"let list of item.options\">{{ list.description }}</li>\r\n </ul>\r\n\r\n <!-- multi -->\r\n <p-multiSelect\r\n id=\"{{ item.id }}\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n placeholder=\"{{ item.placeholder }}\"\r\n *ngIf=\"item.type === 'multi'\"\r\n [options]=\"item.options\"\r\n formControlName=\"{{ item.formControl }}\"\r\n styleClass=\"p-0 w-full\"\r\n optionLabel=\"description\"\r\n (onChange)=\"onChange(item.onChange)\"\r\n maxSelectedLabels=\"100\"\r\n ></p-multiSelect>\r\n\r\n <!-- radioButton -->\r\n <div\r\n id=\"{{ item.id }}\"\r\n *ngIf=\"item.type === 'radio-button'\"\r\n class=\"flex gap-3\"\r\n >\r\n <div\r\n *ngFor=\"let listRadioButton of item.options\"\r\n class=\"flex align-items-center gap-2\"\r\n >\r\n <p-radioButton\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n [value]=\"listRadioButton.code\"\r\n formControlName=\"{{ item.formControl }}\"\r\n (onClick)=\"onChange(item.onChange)\"\r\n ></p-radioButton>\r\n <label>{{ listRadioButton.description }}</label>\r\n </div>\r\n @if(control.controls[item.formControl].value == 'other'){\r\n <input\r\n pInputText\r\n type=\"text\"\r\n formControlName=\"{{ item.formControlOther }}\"\r\n />\r\n }\r\n </div>\r\n\r\n <!-- selectButton -->\r\n <div class=\"d-flex\" *ngIf=\"item.type === 'select-button'\">\r\n <p-selectButton\r\n id=\"{{ item.id }}\"\r\n (onChange)=\"onChange(item.onChange)\"\r\n [options]=\"item.options\"\r\n formControlName=\"{{ item.formControl }}\"\r\n optionValue=\"code\"\r\n >\r\n <ng-template let-item>\r\n <span>{{ item.description }}</span>\r\n </ng-template>\r\n </p-selectButton>\r\n <!-- <input type=\"text\" pInputText [attr.disabled]=\"item.disabled\"\r\n formControlName={{item.formControlSecondary}}> -->\r\n </div>\r\n\r\n <!-- table -->\r\n <p-table\r\n id=\"{{ item.id }}\"\r\n *ngIf=\"item.type === 'table'\"\r\n [scrollable]=\"true\"\r\n scrollHeight=\"{{ item.scrollHeight }}\"\r\n [columns]=\"item.colsTable\"\r\n styleClass=\"p-datatable-striped p-datatable-sm\"\r\n [value]=\"item.rowsTable\"\r\n >\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <th *ngFor=\"let col of columns\">\r\n <span *ngIf=\"col.filed !== 'action'\">{{ col.header }}</span>\r\n <span *ngIf=\"col.filed === 'action'\">A\u00E7\u00E3o</span>\r\n </th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\">\r\n <tr>\r\n <td *ngFor=\"let col of columns\">\r\n <div *ngIf=\"col.field !== 'button'\">\r\n {{ rowData[col.field] }}\r\n </div>\r\n <div *ngIf=\"col.field === 'action'\">\r\n <p-button\r\n *ngFor=\"let action of item.buttonsTable\"\r\n styleClass=\"{{ action.styleClass }}\"\r\n label=\"{{ action.label }}\"\r\n (click)=\"action.onCLick(rowData)\"\r\n icon=\"{{ action.icon }}\"\r\n ></p-button>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"footer\" let-columns>\r\n <tr *ngFor=\"let footer of item.rowsFooter\">\r\n <td colspan=\"12\">\r\n <span class=\"font-normal\">{{ footer.text }}:</span>\r\n {{ footer.value }}\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n\r\n <!-- inputSwitch -->\r\n <div class=\"d-flex\" *ngIf=\"item.type === 'switch'\">\r\n <p-inputSwitch\r\n id=\"{{ item.id }}\"\r\n formControlName=\"{{ item.formControl }}\"\r\n class=\"mr-10\"\r\n (onChange)=\"onChange(item.onChange)\"\r\n ></p-inputSwitch>\r\n <p translate=\"{{ item.label }}\"></p>\r\n </div>\r\n\r\n <!-- password -->\r\n <p-password\r\n id=\"{{ item.id }}\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n placeholder=\"{{ item.placeholder }}\"\r\n *ngIf=\"item.type === 'password'\"\r\n [feedback]=\"false\"\r\n formControlName=\"{{ item.formControl }}\"\r\n (onChange)=\"onChange(item.onChange)\"\r\n styleClass=\"w-full\"\r\n [toggleMask]=\"true\"\r\n ></p-password>\r\n\r\n <!-- photo -->\r\n <div id=\"{{ item.id }}\" class=\"camera\" *ngIf=\"item.type === 'photo'\">\r\n <video id=\"video\" class=\"foto\" autoplay>\r\n V\u00EDdeo n\u00E3o dispon\u00EDvel.\r\n </video>\r\n <canvas id=\"canvas\" class=\"foto\" style=\"display: none\"></canvas>\r\n <button\r\n pButton\r\n icon=\"pi pi-times\"\r\n class=\"remove-file\"\r\n id=\"icon-remove\"\r\n [rounded]=\"true\"\r\n style=\"visibility: collapse\"\r\n (click)=\"removePhoto()\"\r\n ></button>\r\n <button\r\n pButton\r\n icon=\"pi pi-camera\"\r\n [rounded]=\"true\"\r\n (click)=\"capturePhoto(item.formControl)\"\r\n id=\"button\"\r\n ></button>\r\n </div>\r\n\r\n <!-- likert -->\r\n <p-table\r\n id=\"{{ item.id }}\"\r\n *ngIf=\"item.type === 'likert'\"\r\n [scrollable]=\"true\"\r\n scrollHeight=\"{{ item.scrollHeight }}\"\r\n [columns]=\"item.colsTable\"\r\n styleClass=\"p-datatable-striped p-datatable-sm\"\r\n [value]=\"item.rowsTable\"\r\n >\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <th style=\"width: 4rem\"></th>\r\n <th *ngFor=\"let col of columns\">\r\n <span>{{ col.header }}</span>\r\n </th>\r\n </tr>\r\n </ng-template>\r\n <ng-template\r\n pTemplate=\"body\"\r\n let-row\r\n let-rowIndex=\"rowIndex\"\r\n let-columns=\"columns\"\r\n formArrayName=\"{{ item.formControl }}\"\r\n >\r\n <tr>\r\n <td>\r\n {{ row }}\r\n </td>\r\n @for (control of columns; track item; let index = $index) {\r\n <td [formGroupName]=\"rowIndex\">\r\n <p-radioButton\r\n value=\"{{ columns[index].field }}+{{ row }}\"\r\n formControlName=\"question{{ rowIndex }}\"\r\n />\r\n </td>\r\n }\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n\r\n <!-- editable table -->\r\n <p-table\r\n id=\"{{ item.id }}\"\r\n *ngIf=\"item.type === 'editable-table'\"\r\n [scrollable]=\"true\"\r\n scrollHeight=\"{{ item.scrollHeight }}\"\r\n [columns]=\"item.colsTable\"\r\n styleClass=\"p-datatable-striped p-datatable-sm\"\r\n [value]=\"item.rowsTable\"\r\n editMode=\"cell\"\r\n >\r\n <!-- Cabe\u00E7alho da tabela -->\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <th style=\"width: 4rem\"></th>\r\n <th *ngFor=\"let col of columns\">\r\n <span>{{ col.header }}</span>\r\n </th>\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- Corpo da tabela -->\r\n <ng-template\r\n pTemplate=\"body\"\r\n let-row\r\n let-rowIndex=\"rowIndex\"\r\n let-columns=\"columns\"\r\n formArrayName=\"{{ item.formControl }}\"\r\n let-editing=\"editing\"\r\n >\r\n <tr>\r\n <td>{{ row }}</td>\r\n @for (control of columns; track item; let index = $index) {\r\n <td\r\n [formGroupName]=\"rowIndex\"\r\n [pEditableColumn]=\"row\"\r\n pEditableColumnField=\"row\"\r\n >\r\n <p-cellEditor>\r\n <ng-template pTemplate=\"input\">\r\n <input\r\n pInputText\r\n type=\"text\"\r\n formControlName=\"_{{ control.field }}question{{\r\n rowIndex\r\n }}\"\r\n />\r\n </ng-template>\r\n <ng-template pTemplate=\"output\">\r\n <input\r\n pInputText\r\n type=\"text\"\r\n formControlName=\"_{{ control.field }}question{{\r\n rowIndex\r\n }}\"\r\n />\r\n </ng-template>\r\n </p-cellEditor>\r\n </td>\r\n }\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n\r\n <!-- valida\u00E7\u00E3o de item -->\r\n <div>\r\n <small\r\n class=\"danger-text\"\r\n *ngIf=\"validateForm && control.controls[item.formControl] && control.controls[item.formControl].errors?.['required']\"\r\n >\r\n Campo obrigat\u00F3rio\r\n </small>\r\n <small\r\n class=\"danger-text\"\r\n *ngIf=\"validateForm && control.controls[item.formControl] && control.controls[item.formControl].errors?.['email']\"\r\n >\r\n Email inv\u00E1lido\r\n </small>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <p-divider\r\n *ngIf=\"\r\n (buttonsStandard && buttonsStandard.length > 0) ||\r\n (buttonsOptional && buttonsOptional.length > 0)\r\n \"\r\n ></p-divider>\r\n\r\n <div class=\"buttons-form\">\r\n <div *ngFor=\"let button of buttonsStandard\">\r\n <p-button\r\n *ngIf=\"button.type === 'clean'\"\r\n styleClass=\"p-button-warning {{ button.styleClass }}\"\r\n label=\"Limpar\"\r\n (click)=\"button.onCLick()\"\r\n icon=\"pi pi-times\"\r\n ></p-button>\r\n <p-button\r\n *ngIf=\"button.type === 'filter'\"\r\n styleClass=\"{{ button.styleClass }}\"\r\n label=\"Filtrar\"\r\n (click)=\"button.onCLick()\"\r\n icon=\"pi pi-search\"\r\n ></p-button>\r\n <p-button\r\n *ngIf=\"button.type === 'save'\"\r\n styleClass=\"p-button-success {{ button.styleClass }}\"\r\n label=\"Salvar\"\r\n (click)=\"button.onCLick()\"\r\n icon=\"pi pi-save\"\r\n ></p-button>\r\n <p-button\r\n *ngIf=\"button.type === 'cancel'\"\r\n styleClass=\"p-button-danger {{ button.styleClass }}\"\r\n label=\"Cancelar\"\r\n (click)=\"button.onCLick()\"\r\n icon=\"pi pi-times\"\r\n ></p-button>\r\n </div>\r\n <div *ngFor=\"let button of buttonsOptional\">\r\n <p-button\r\n styleClass=\"{{ button.styleClass }}\"\r\n label=\"{{ button.label }}\"\r\n (click)=\"button.onCLick()\"\r\n icon=\"{{ button.icon }}\"\r\n ></p-button>\r\n </div>\r\n </div>\r\n </div>\r\n </form>\r\n</div>\r\n", styles: [".div-title span{font-size:20px;font-weight:500}.buttons-form{display:flex;gap:10px;justify-content:flex-end}.danger-text{color:#f18282}.drag-image{height:auto;width:100%;border-radius:10px;font-weight:400;display:flex;align-items:center;flex-direction:column;top:20px;max-height:250px;color:#000;padding:20px;text-align:center;overflow:auto}.drag-image h6{font-size:20px}.drag-image .file-name{font-size:14px}.drag-image i{font-size:3rem}.subtitle span{font-size:14px;margin-right:5px}.subtitle{align-items:baseline}.mh-75{min-height:75px!important}input[type=file]{position:absolute;width:100%;height:100%;inset:0;opacity:0;cursor:pointer}.preview-img{align-items:center;border-radius:5px;display:flex;height:140px;justify-content:center;margin:10px;max-width:180px;min-height:140px;min-width:180px;padding:0 20px;position:relative}.preview-img span{position:absolute;overflow-wrap:break-word}.remove-file{display:flex;justify-content:center;align-items:center;height:22px;width:22px;top:5px;right:5px;border-radius:50%;background:#bbb;color:#333;cursor:pointer;font-size:.8rem!important}.preview-img img{max-width:100%;opacity:.8}.camera{display:flex;flex-direction:column;align-items:center;position:relative}.foto{max-width:186px;min-height:140px;min-width:180px;border:1px dashed #000;border-radius:5px;margin-bottom:1em}.preview-photo{position:relative}.h-0{height:0}\n"], dependencies: [{ kind: "component", type: i3.InputMask, selector: "p-inputMask", inputs: ["type", "slotChar", "autoClear", "showClear", "style", "inputId", "styleClass", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaLabelledBy", "ariaRequired", "disabled", "readonly", "unmask", "name", "required", "characterPattern", "autoFocus", "autocomplete", "keepBuffer", "mask"], outputs: ["onComplete", "onFocus", "onBlur", "onInput", "onKeydown", "onClear"] }, { kind: "directive", type: i4.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i5.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabelledBy", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "component", type: i6.Password, selector: "p-password", inputs: ["ariaLabel", "ariaLabelledBy", "label", "disabled", "promptLabel", "mediumRegex", "strongRegex", "weakLabel", "mediumLabel", "maxLength", "strongLabel", "inputId", "feedback", "appendTo", "toggleMask", "inputStyleClass", "styleClass", "style", "inputStyle", "showTransitionOptions", "hideTransitionOptions", "autocomplete", "placeholder", "showClear"], outputs: ["onFocus", "onBlur", "onClear"] }, { kind: "directive", type: i7.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i7.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "size", "style", "styleClass", "badgeClass", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i8.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll", "virtualRowHeight"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i8.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "directive", type: i8.EditableColumn, selector: "[pEditableColumn]", inputs: ["pEditableColumn", "pEditableColumnField", "pEditableColumnRowIndex", "pEditableColumnDisabled", "pFocusCellSelector"] }, { kind: "component", type: i8.CellEditor, selector: "p-cellEditor" }, { kind: "component", type: i8.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i9.MultiSelect, selector: "p-multiSelect", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "directive", type: i10.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i11.SelectButton, selector: "p-selectButton", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "unselectable", "tabindex", "multiple", "allowEmpty", "style", "styleClass", "ariaLabelledBy", "disabled", "dataKey"], outputs: ["onOptionClick", "onChange"] }, { kind: "component", type: i12.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabel", "ariaLabelledBy"], outputs: ["onChange"] }, { kind: "component", type: i13.Checkbox, selector: "p-checkbox", inputs: ["value", "name", "disabled", "binary", "label", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "styleClass", "labelStyleClass", "formControl", "checkboxIcon", "readonly", "required", "trueValue", "falseValue"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "directive", type: i14.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize"], outputs: ["onResize"] }, { kind: "directive", type: i15.InputText, selector: "[pInputText]" }, { kind: "component", type: i16.Divider, selector: "p-divider", inputs: ["style", "styleClass", "layout", "type", "align"] }, { kind: "component", type: i17.Calendar, selector: "p-calendar", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "component", type: i18.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "component", type: i19.TreeSelect, selector: "p-treeSelect", inputs: ["inputId", "scrollHeight", "disabled", "metaKeySelection", "display", "selectionMode", "tabindex", "ariaLabel", "ariaLabelledBy", "placeholder", "panelClass", "panelStyle", "panelStyleClass", "containerStyle", "containerStyleClass", "labelStyle", "labelStyleClass", "overlayOptions", "emptyMessage", "appendTo", "filter", "filterBy", "filterMode", "filterPlaceholder", "filterLocale", "filterInputAutoFocus", "propagateSelectionDown", "propagateSelectionUp", "showClear", "resetFilterOnHide", "options", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onNodeExpand", "onNodeCollapse", "onShow", "onHide", "onClear", "onFilter", "onNodeUnselect", "onNodeSelect"] }, { kind: "component", type: i20.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i21.AutoComplete, selector: "p-autoComplete", inputs: ["minLength", "delay", "style", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "disabled", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "maxlength", "name", "required", "size", "appendTo", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "showClear", "field", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "overlayOptions", "suggestions", "itemSize", "optionLabel", "id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "selectOnFocus", "searchLocale", "optionDisabled", "focusOnHover"], outputs: ["completeMethod", "onSelect", "onUnselect", "onFocus", "onBlur", "onDropdownClick", "onClear", "onKeyUp", "onShow", "onHide", "onLazyLoad"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "component", type: i22.OverlayPanel, selector: "p-overlayPanel", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "showCloseIcon", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { kind: "component", type: i23.Editor, selector: "p-editor", inputs: ["style", "styleClass", "placeholder", "formats", "modules", "bounds", "scrollingContainer", "debug", "readonly"], outputs: ["onInit", "onTextChange", "onSelectionChange"] }, { kind: "directive", type: i1.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
189
+ }
190
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: FormDynamicAngularComponent, decorators: [{
191
+ type: Component,
192
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'form-dynamic-angular', template: "<div>\r\n <div *ngIf=\"title\" class=\"div-title\">\r\n <span translate=\"{{ title }}\"></span>\r\n <div *ngIf=\"subTitle\" class=\"flex subtitle\">\r\n <span translate=\"{{ subTitle }}\"></span>\r\n </div>\r\n <p-divider></p-divider>\r\n </div>\r\n <form *ngIf=\"control\" [formGroup]=\"control\">\r\n <div class=\"grid\">\r\n <div *ngFor=\"let item of form\" class=\"{{ item.col }} col-12\">\r\n <label *ngIf=\"item.label && !item.hideLabelTop\">{{ item.label }}</label>\r\n <label *ngIf=\"item.required && item.label\" class=\"danger-text ml-2\"\r\n >*</label\r\n >\r\n\r\n <div class=\"mt-2\">\r\n <!-- text -->\r\n <input\r\n id=\"{{ item.id }}\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n pInputText\r\n placeholder=\"{{ item.placeholder }}\"\r\n *ngIf=\"item.type == 'text' || item.type == 'number'\"\r\n type=\"{{ item.type }}\"\r\n formControlName=\"{{ item.formControl }}\"\r\n class=\"w-full\"\r\n />\r\n\r\n <p-editor\r\n *ngIf=\"item.type == 'editor'\"\r\n formControlName=\"{{ item.formControl }}\"\r\n [style]=\"{ height: '320px' }\"\r\n />\r\n\r\n <!-- select -->\r\n <p-dropdown\r\n id=\"{{ item.id }}\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n [filter]=\"item.search\"\r\n emptyFilterMessage=\"Nenhum dado encontrado\"\r\n emptyMessage=\"Nenhum dado encontrado\"\r\n placeholder=\"{{ item.placeholder }}\"\r\n styleClass=\"w-full p-0\"\r\n (onChange)=\"onChange(item.onChange)\"\r\n *ngIf=\"item.type === 'select'\"\r\n [showClear]=\"true\"\r\n [options]=\"item.options\"\r\n formControlName=\"{{ item.formControl }}\"\r\n optionLabel=\"description\"\r\n (onClear)=\"clickCLear(item.onCLear)\"\r\n ></p-dropdown>\r\n\r\n <!-- currency -->\r\n <p-inputNumber\r\n id=\"{{ item.id }}\"\r\n *ngIf=\"item.type === 'currency'\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n formControlName=\"{{ item.formControl }}\"\r\n placeholder=\"{{ item.placeholder }}\"\r\n inputStyleClass=\"w-full\"\r\n styleClass=\"w-full\"\r\n (onKeyDown)=\"onChange(item.onChange)\"\r\n mode=\"currency\"\r\n [min]=\"0\"\r\n currency=\"BRL\"\r\n >\r\n </p-inputNumber>\r\n\r\n <!-- mask -->\r\n <p-inputMask\r\n id=\"{{ item.id }}\"\r\n *ngIf=\"item.type === 'mask'\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n formControlName=\"{{ item.formControl }}\"\r\n placeholder=\"{{ item.placeholder }}\"\r\n styleClass=\"w-full\"\r\n (onComplete)=\"onChange(item.onChange)\"\r\n mask=\"{{ item.mask }}\"\r\n unmask=\"{{ item.unmask }}\"\r\n (onClear)=\"clickCLear(item.onCLear)\"\r\n showClear=\"true\"\r\n ></p-inputMask>\r\n\r\n <!-- treeSelect -->\r\n <p-treeSelect\r\n id=\"{{ item.id }}\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n placeholder=\"{{ item.placeholder }}\"\r\n (onNodeSelect)=\"onChange(item.onChange)\"\r\n *ngIf=\"item.type === 'tree-select'\"\r\n containerStyleClass=\"w-full p-0\"\r\n formControlName=\"{{ item.formControl }}\"\r\n [options]=\"item.treeSelectOptions\"\r\n [filter]=\"true\"\r\n [filterInputAutoFocus]=\"true\"\r\n emptyMessage=\"Nenhum dado encontrado\"\r\n [showClear]=\"true\"\r\n (onClear)=\"clickCLear(item.onCLear)\"\r\n ></p-treeSelect>\r\n\r\n <!-- autoComplete -->\r\n <p-autoComplete\r\n inputId=\"{{ item.id }}\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n placeholder=\"{{ item.placeholder }}\"\r\n styleClass=\"w-full p-0\"\r\n [inputStyle]=\"{ width: '100%' }\"\r\n *ngIf=\"item.type === 'autocomplete'\"\r\n (onSelect)=\"onChange(item.onChange)\"\r\n formControlName=\"{{ item.formControl }}\"\r\n [suggestions]=\"filteredAutoComplete\"\r\n (completeMethod)=\"filterAutoComplete($event, item.options)\"\r\n [forceSelection]=\"false\"\r\n [showEmptyMessage]=\"true\"\r\n emptyMessage=\"Nenhum dado encontrado\"\r\n dataKey=\"code\"\r\n field=\"description\"\r\n showClear=\"true\"\r\n (onClear)=\"clickCLear(item.onCLear)\"\r\n ></p-autoComplete>\r\n\r\n <!-- date -->\r\n <p-calendar\r\n id=\"{{ item.id }}\"\r\n view=\"{{ item.viewDate }}\"\r\n *ngIf=\"item.type === 'date'\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n formControlName=\"{{ item.formControl }}\"\r\n styleClass=\"w-full\"\r\n [numberOfMonths]=\"numberOfMonthsDate(item.numberOfMonthsDate)\"\r\n [selectionMode]=\"selectionMode(item.selectionMode)\"\r\n (onFocus)=\"onChange(item.onFocusDate)\"\r\n [maxDate]=\"item.maxDate\"\r\n [minDate]=\"item.minDate\"\r\n dateFormat=\"{{ item.dateFormat }}\"\r\n (onSelect)=\"onChange(item.onChange)\"\r\n [iconDisplay]=\"'input'\"\r\n placeholder=\"{{ item.placeholder }}\"\r\n [showIcon]=\"true\"\r\n [showTime]=\"item.showTime\"\r\n [timeOnly]=\"item.timeOnly\"\r\n ></p-calendar>\r\n\r\n <!-- textarea -->\r\n <div *ngIf=\"item.type === 'text-area'\" class=\"text-right\">\r\n <textarea\r\n id=\"{{ item.id }}\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n placeholder=\"{{ item.placeholder }}\"\r\n class=\"w-full\"\r\n maxlength=\"{{ item.maxlength }}\"\r\n counterTemplate=\"{1} of 50, {0} remaining\"\r\n counter=\"display\"\r\n (attr.change)=\"onChange(item.onChange)\"\r\n pInputTextarea\r\n formControlName=\"{{ item.formControl }}\"\r\n rows=\"{{ item.rowsTextArea }}\"\r\n ></textarea>\r\n <small *ngIf=\"item.maxlength\" id=\"username-help\">\r\n {{ control.controls[item.formControl].value.length }}/{{\r\n item.maxlength\r\n }}\r\n </small>\r\n </div>\r\n\r\n <!-- checkbox -->\r\n <div *ngIf=\"item.type == 'check-box'\">\r\n <p-checkbox\r\n id=\"{{ item.id }}\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n (onChange)=\"onChange(item.onChange)\"\r\n binary=\"true\"\r\n formControlName=\"{{ item.formControl }}\"\r\n value=\"{{ item.formControl }}\"\r\n label=\"{{ item.label }}\"\r\n ></p-checkbox>\r\n </div>\r\n\r\n <!-- checkbox multiple -->\r\n <div\r\n id=\"{{ item.id }}\"\r\n *ngIf=\"item.type === 'check-box-multi'\"\r\n class=\"flex gap-3\"\r\n >\r\n <div\r\n formArrayName=\"{{ item.formControl }}\"\r\n *ngFor=\"let list of item.options; let i = index\"\r\n class=\"flex align-items-center gap-2\"\r\n >\r\n <div [formGroupName]=\"i\">\r\n <p-checkbox\r\n id=\"{{ item.id }}\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n (onChange)=\"onChange(item.onChange)\"\r\n binary=\"true\"\r\n formControlName=\"{{ list.code }}\"\r\n label=\"{{ list.description }}\"\r\n ></p-checkbox>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- button -->\r\n <p-button\r\n id=\"{{ item.id }}\"\r\n *ngIf=\"item.type == 'button'\"\r\n styleClass=\"{{ item.buttonClass }} w-full mt-3\"\r\n (click)=\"item.onCLick()\"\r\n [disabled]=\"item.disabled\"\r\n icon=\"{{ item.iconButton }}\"\r\n label=\"{{ item.label }}\"\r\n ></p-button>\r\n\r\n <!-- can -->\r\n <div id=\"{{ item.id }}\" class=\"area\" *ngIf=\"item.type == 'can'\">\r\n <video autoplay=\"true\" id=\"webCamera\"></video>\r\n\r\n <input type=\"text\" id=\"base_img\" name=\"base_img\" />\r\n <button type=\"button\" onclick=\"takeSnapShot()\">\r\n Tirar foto e salvar\r\n </button>\r\n\r\n <img id=\"imagemConvertida\" />\r\n <p id=\"caminhoImagem\" class=\"caminho-imagem\">\r\n <a href=\"\" target=\"_blank\" rel=\"noopener\"></a>\r\n </p>\r\n <script src=\"script.js\"></script>\r\n </div>\r\n\r\n <!-- upload files -->\r\n <div\r\n id=\"{{ item.id }}\"\r\n *ngIf=\"item.type === 'upload-files' && !item.disabled\"\r\n class=\"drag-image\"\r\n [style.border]=\"\r\n validateForm && control.controls[item.formControl].errors\r\n ? ' 1px dashed #f18282'\r\n : ' 1px dashed #d1d5db'\r\n \"\r\n >\r\n <i *ngIf=\"filesView.length === 0\" class=\"pi pi-cloud-upload\"></i>\r\n <p *ngIf=\"filesView.length === 0\">\r\n Clique ou arraste e solte um arquivo para anexar\r\n </p>\r\n <span *ngIf=\"filesView.length === 0\">{{\r\n item.msgAcceptFiles\r\n }}</span>\r\n <input\r\n id=\"fileInput\"\r\n type=\"file\"\r\n [multiple]=\"item.multileFile\"\r\n [accept]=\"item.acceptFiles\"\r\n (change)=\"\r\n onSelectFile(item.formControl, $event, item.multileFile)\r\n \"\r\n />\r\n <div *ngFor=\"let f of filesView\">\r\n <div *ngIf=\"f.type && f.type.includes('image')\">\r\n <label class=\"preview-img\">\r\n <img *ngIf=\"!f.content\" src=\"{{ getUrl(f) }}\" />\r\n <img *ngIf=\"f.content\" src=\"{{ f.content }}\" />\r\n <span *ngIf=\"item.viewNameFile\">{{ f.name }}</span>\r\n <input\r\n type=\"file\"\r\n [multiple]=\"item.multileFile\"\r\n [accept]=\"item.acceptFiles\"\r\n (change)=\"\r\n onSelectFile(item.formControl, $event, item.multileFile)\r\n \"\r\n />\r\n <label>\r\n <i\r\n class=\"pi pi-times remove-file absolute\"\r\n (click)=\"onRemove(item.formControl, f)\"\r\n ></i\r\n ></label>\r\n </label>\r\n </div>\r\n <div *ngIf=\"f.type && !f.type.includes('image')\">\r\n <label class=\"preview-img h-0 max-w-0 mh-75 m-0\">\r\n <label class=\"mr-3\">{{ f.name }}</label>\r\n <input\r\n type=\"file\"\r\n [multiple]=\"item.multileFile\"\r\n [accept]=\"item.acceptFiles\"\r\n (change)=\"\r\n onSelectFile(item.formControl, $event, item.multileFile)\r\n \"\r\n />\r\n <label>\r\n <i\r\n class=\"pi pi-times remove-file absolute\"\r\n (click)=\"onRemove(f)\"\r\n ></i\r\n ></label>\r\n </label>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- upload files disabled -->\r\n <!-- <p-fileUpload mode=\"basic\" formControlName=\"{{item.formControl}}\" chooseLabel=\"Choose\"\r\n chooseIcon=\"pi pi-upload\" accept=\"image/*\" maxFileSize=\"1000000\" /> -->\r\n\r\n <div\r\n id=\"{{ item.id }}\"\r\n *ngIf=\"item.type === 'upload-files' && item.disabled\"\r\n >\r\n <p-button\r\n (click)=\"op.toggle($event)\"\r\n icon=\"pi pi-paperclip\"\r\n label=\"Arquivos anexados\"\r\n ></p-button>\r\n\r\n <p-overlayPanel\r\n #op\r\n [style]=\"{ width: '450px' }\"\r\n [showCloseIcon]=\"true\"\r\n >\r\n <ng-template pTemplate=\"content\">\r\n <p-table\r\n *ngIf=\"files.length > 0\"\r\n [value]=\"files\"\r\n selectionMode=\"single\"\r\n [(selection)]=\"selectedProduct\"\r\n (onRowSelect)=\"onRowSelect($event, op)\"\r\n responsiveLayout=\"scroll\"\r\n >\r\n <ng-template pTemplate=\"header\">\r\n <tr>\r\n <th pSortableColumn=\"name\">\r\n Nome<p-sortIcon field=\"name\"></p-sortIcon>\r\n </th>\r\n <th></th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData let-file>\r\n <tr>\r\n <td *ngIf=\"item.viewNameFile\">{{ file.name }}</td>\r\n <td>\r\n <p-button\r\n *ngIf=\"item.onCLick\"\r\n icon=\"pi pi-download\"\r\n (click)=\"item.onCLick(file)\"\r\n ></p-button>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n <div *ngIf=\"files.length === 0\" class=\"p-10\">\r\n <label>Nenhum arquivo anexado</label>\r\n </div>\r\n </ng-template>\r\n </p-overlayPanel>\r\n </div>\r\n\r\n <!-- list -->\r\n <ul id=\"{{ item.id }}\" *ngIf=\"item.type === 'list' && item.options\">\r\n <li *ngFor=\"let list of item.options\">{{ list.description }}</li>\r\n </ul>\r\n\r\n <!-- multi -->\r\n <p-multiSelect\r\n id=\"{{ item.id }}\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n placeholder=\"{{ item.placeholder }}\"\r\n *ngIf=\"item.type === 'multi'\"\r\n [options]=\"item.options\"\r\n formControlName=\"{{ item.formControl }}\"\r\n styleClass=\"p-0 w-full\"\r\n optionLabel=\"description\"\r\n (onChange)=\"onChange(item.onChange)\"\r\n maxSelectedLabels=\"100\"\r\n ></p-multiSelect>\r\n\r\n <!-- radioButton -->\r\n <div\r\n id=\"{{ item.id }}\"\r\n *ngIf=\"item.type === 'radio-button'\"\r\n class=\"flex gap-3\"\r\n >\r\n <div\r\n *ngFor=\"let listRadioButton of item.options\"\r\n class=\"flex align-items-center gap-2\"\r\n >\r\n <p-radioButton\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n [value]=\"listRadioButton.code\"\r\n formControlName=\"{{ item.formControl }}\"\r\n (onClick)=\"onChange(item.onChange)\"\r\n ></p-radioButton>\r\n <label>{{ listRadioButton.description }}</label>\r\n </div>\r\n @if(control.controls[item.formControl].value == 'other'){\r\n <input\r\n pInputText\r\n type=\"text\"\r\n formControlName=\"{{ item.formControlOther }}\"\r\n />\r\n }\r\n </div>\r\n\r\n <!-- selectButton -->\r\n <div class=\"d-flex\" *ngIf=\"item.type === 'select-button'\">\r\n <p-selectButton\r\n id=\"{{ item.id }}\"\r\n (onChange)=\"onChange(item.onChange)\"\r\n [options]=\"item.options\"\r\n formControlName=\"{{ item.formControl }}\"\r\n optionValue=\"code\"\r\n >\r\n <ng-template let-item>\r\n <span>{{ item.description }}</span>\r\n </ng-template>\r\n </p-selectButton>\r\n <!-- <input type=\"text\" pInputText [attr.disabled]=\"item.disabled\"\r\n formControlName={{item.formControlSecondary}}> -->\r\n </div>\r\n\r\n <!-- table -->\r\n <p-table\r\n id=\"{{ item.id }}\"\r\n *ngIf=\"item.type === 'table'\"\r\n [scrollable]=\"true\"\r\n scrollHeight=\"{{ item.scrollHeight }}\"\r\n [columns]=\"item.colsTable\"\r\n styleClass=\"p-datatable-striped p-datatable-sm\"\r\n [value]=\"item.rowsTable\"\r\n >\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <th *ngFor=\"let col of columns\">\r\n <span *ngIf=\"col.filed !== 'action'\">{{ col.header }}</span>\r\n <span *ngIf=\"col.filed === 'action'\">A\u00E7\u00E3o</span>\r\n </th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\">\r\n <tr>\r\n <td *ngFor=\"let col of columns\">\r\n <div *ngIf=\"col.field !== 'button'\">\r\n {{ rowData[col.field] }}\r\n </div>\r\n <div *ngIf=\"col.field === 'action'\">\r\n <p-button\r\n *ngFor=\"let action of item.buttonsTable\"\r\n styleClass=\"{{ action.styleClass }}\"\r\n label=\"{{ action.label }}\"\r\n (click)=\"action.onCLick(rowData)\"\r\n icon=\"{{ action.icon }}\"\r\n ></p-button>\r\n </div>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"footer\" let-columns>\r\n <tr *ngFor=\"let footer of item.rowsFooter\">\r\n <td colspan=\"12\">\r\n <span class=\"font-normal\">{{ footer.text }}:</span>\r\n {{ footer.value }}\r\n </td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n\r\n <!-- inputSwitch -->\r\n <div class=\"d-flex\" *ngIf=\"item.type === 'switch'\">\r\n <p-inputSwitch\r\n id=\"{{ item.id }}\"\r\n formControlName=\"{{ item.formControl }}\"\r\n class=\"mr-10\"\r\n (onChange)=\"onChange(item.onChange)\"\r\n ></p-inputSwitch>\r\n <p translate=\"{{ item.label }}\"></p>\r\n </div>\r\n\r\n <!-- password -->\r\n <p-password\r\n id=\"{{ item.id }}\"\r\n [ngClass]=\"{\r\n 'ng-invalid ng-dirty':\r\n validateForm && control.controls[item.formControl].errors\r\n }\"\r\n placeholder=\"{{ item.placeholder }}\"\r\n *ngIf=\"item.type === 'password'\"\r\n [feedback]=\"false\"\r\n formControlName=\"{{ item.formControl }}\"\r\n (onChange)=\"onChange(item.onChange)\"\r\n styleClass=\"w-full\"\r\n [toggleMask]=\"true\"\r\n ></p-password>\r\n\r\n <!-- photo -->\r\n <div id=\"{{ item.id }}\" class=\"camera\" *ngIf=\"item.type === 'photo'\">\r\n <video id=\"video\" class=\"foto\" autoplay>\r\n V\u00EDdeo n\u00E3o dispon\u00EDvel.\r\n </video>\r\n <canvas id=\"canvas\" class=\"foto\" style=\"display: none\"></canvas>\r\n <button\r\n pButton\r\n icon=\"pi pi-times\"\r\n class=\"remove-file\"\r\n id=\"icon-remove\"\r\n [rounded]=\"true\"\r\n style=\"visibility: collapse\"\r\n (click)=\"removePhoto()\"\r\n ></button>\r\n <button\r\n pButton\r\n icon=\"pi pi-camera\"\r\n [rounded]=\"true\"\r\n (click)=\"capturePhoto(item.formControl)\"\r\n id=\"button\"\r\n ></button>\r\n </div>\r\n\r\n <!-- likert -->\r\n <p-table\r\n id=\"{{ item.id }}\"\r\n *ngIf=\"item.type === 'likert'\"\r\n [scrollable]=\"true\"\r\n scrollHeight=\"{{ item.scrollHeight }}\"\r\n [columns]=\"item.colsTable\"\r\n styleClass=\"p-datatable-striped p-datatable-sm\"\r\n [value]=\"item.rowsTable\"\r\n >\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <th style=\"width: 4rem\"></th>\r\n <th *ngFor=\"let col of columns\">\r\n <span>{{ col.header }}</span>\r\n </th>\r\n </tr>\r\n </ng-template>\r\n <ng-template\r\n pTemplate=\"body\"\r\n let-row\r\n let-rowIndex=\"rowIndex\"\r\n let-columns=\"columns\"\r\n formArrayName=\"{{ item.formControl }}\"\r\n >\r\n <tr>\r\n <td>\r\n {{ row }}\r\n </td>\r\n @for (control of columns; track item; let index = $index) {\r\n <td [formGroupName]=\"rowIndex\">\r\n <p-radioButton\r\n value=\"{{ columns[index].field }}+{{ row }}\"\r\n formControlName=\"question{{ rowIndex }}\"\r\n />\r\n </td>\r\n }\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n\r\n <!-- editable table -->\r\n <p-table\r\n id=\"{{ item.id }}\"\r\n *ngIf=\"item.type === 'editable-table'\"\r\n [scrollable]=\"true\"\r\n scrollHeight=\"{{ item.scrollHeight }}\"\r\n [columns]=\"item.colsTable\"\r\n styleClass=\"p-datatable-striped p-datatable-sm\"\r\n [value]=\"item.rowsTable\"\r\n editMode=\"cell\"\r\n >\r\n <!-- Cabe\u00E7alho da tabela -->\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <th style=\"width: 4rem\"></th>\r\n <th *ngFor=\"let col of columns\">\r\n <span>{{ col.header }}</span>\r\n </th>\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- Corpo da tabela -->\r\n <ng-template\r\n pTemplate=\"body\"\r\n let-row\r\n let-rowIndex=\"rowIndex\"\r\n let-columns=\"columns\"\r\n formArrayName=\"{{ item.formControl }}\"\r\n let-editing=\"editing\"\r\n >\r\n <tr>\r\n <td>{{ row }}</td>\r\n @for (control of columns; track item; let index = $index) {\r\n <td\r\n [formGroupName]=\"rowIndex\"\r\n [pEditableColumn]=\"row\"\r\n pEditableColumnField=\"row\"\r\n >\r\n <p-cellEditor>\r\n <ng-template pTemplate=\"input\">\r\n <input\r\n pInputText\r\n type=\"text\"\r\n formControlName=\"_{{ control.field }}question{{\r\n rowIndex\r\n }}\"\r\n />\r\n </ng-template>\r\n <ng-template pTemplate=\"output\">\r\n <input\r\n pInputText\r\n type=\"text\"\r\n formControlName=\"_{{ control.field }}question{{\r\n rowIndex\r\n }}\"\r\n />\r\n </ng-template>\r\n </p-cellEditor>\r\n </td>\r\n }\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n\r\n <!-- valida\u00E7\u00E3o de item -->\r\n <div>\r\n <small\r\n class=\"danger-text\"\r\n *ngIf=\"validateForm && control.controls[item.formControl] && control.controls[item.formControl].errors?.['required']\"\r\n >\r\n Campo obrigat\u00F3rio\r\n </small>\r\n <small\r\n class=\"danger-text\"\r\n *ngIf=\"validateForm && control.controls[item.formControl] && control.controls[item.formControl].errors?.['email']\"\r\n >\r\n Email inv\u00E1lido\r\n </small>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <p-divider\r\n *ngIf=\"\r\n (buttonsStandard && buttonsStandard.length > 0) ||\r\n (buttonsOptional && buttonsOptional.length > 0)\r\n \"\r\n ></p-divider>\r\n\r\n <div class=\"buttons-form\">\r\n <div *ngFor=\"let button of buttonsStandard\">\r\n <p-button\r\n *ngIf=\"button.type === 'clean'\"\r\n styleClass=\"p-button-warning {{ button.styleClass }}\"\r\n label=\"Limpar\"\r\n (click)=\"button.onCLick()\"\r\n icon=\"pi pi-times\"\r\n ></p-button>\r\n <p-button\r\n *ngIf=\"button.type === 'filter'\"\r\n styleClass=\"{{ button.styleClass }}\"\r\n label=\"Filtrar\"\r\n (click)=\"button.onCLick()\"\r\n icon=\"pi pi-search\"\r\n ></p-button>\r\n <p-button\r\n *ngIf=\"button.type === 'save'\"\r\n styleClass=\"p-button-success {{ button.styleClass }}\"\r\n label=\"Salvar\"\r\n (click)=\"button.onCLick()\"\r\n icon=\"pi pi-save\"\r\n ></p-button>\r\n <p-button\r\n *ngIf=\"button.type === 'cancel'\"\r\n styleClass=\"p-button-danger {{ button.styleClass }}\"\r\n label=\"Cancelar\"\r\n (click)=\"button.onCLick()\"\r\n icon=\"pi pi-times\"\r\n ></p-button>\r\n </div>\r\n <div *ngFor=\"let button of buttonsOptional\">\r\n <p-button\r\n styleClass=\"{{ button.styleClass }}\"\r\n label=\"{{ button.label }}\"\r\n (click)=\"button.onCLick()\"\r\n icon=\"{{ button.icon }}\"\r\n ></p-button>\r\n </div>\r\n </div>\r\n </div>\r\n </form>\r\n</div>\r\n", styles: [".div-title span{font-size:20px;font-weight:500}.buttons-form{display:flex;gap:10px;justify-content:flex-end}.danger-text{color:#f18282}.drag-image{height:auto;width:100%;border-radius:10px;font-weight:400;display:flex;align-items:center;flex-direction:column;top:20px;max-height:250px;color:#000;padding:20px;text-align:center;overflow:auto}.drag-image h6{font-size:20px}.drag-image .file-name{font-size:14px}.drag-image i{font-size:3rem}.subtitle span{font-size:14px;margin-right:5px}.subtitle{align-items:baseline}.mh-75{min-height:75px!important}input[type=file]{position:absolute;width:100%;height:100%;inset:0;opacity:0;cursor:pointer}.preview-img{align-items:center;border-radius:5px;display:flex;height:140px;justify-content:center;margin:10px;max-width:180px;min-height:140px;min-width:180px;padding:0 20px;position:relative}.preview-img span{position:absolute;overflow-wrap:break-word}.remove-file{display:flex;justify-content:center;align-items:center;height:22px;width:22px;top:5px;right:5px;border-radius:50%;background:#bbb;color:#333;cursor:pointer;font-size:.8rem!important}.preview-img img{max-width:100%;opacity:.8}.camera{display:flex;flex-direction:column;align-items:center;position:relative}.foto{max-width:186px;min-height:140px;min-width:180px;border:1px dashed #000;border-radius:5px;margin-bottom:1em}.preview-photo{position:relative}.h-0{height:0}\n"] }]
193
+ }], ctorParameters: () => [{ type: i1.TranslateService }, { type: i2.FormBuilder }], propDecorators: { title: [{
194
+ type: Input
195
+ }], subTitle: [{
196
+ type: Input
197
+ }], validateForm: [{
198
+ type: Input
199
+ }], form: [{
200
+ type: Input
201
+ }], control: [{
202
+ type: Input
203
+ }], buttonsStandard: [{
204
+ type: Input
205
+ }], buttonsOptional: [{
206
+ type: Input
207
+ }], files: [{
208
+ type: Input
209
+ }] } });
210
+
211
+ function HttpLoaderFactory(http) {
212
+ return new TranslateHttpLoader(http);
213
+ }
214
+ class FormDynamicAngularModule {
215
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: FormDynamicAngularModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
216
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.0", ngImport: i0, type: FormDynamicAngularModule, declarations: [FormDynamicAngularComponent], imports: [InputMaskModule,
217
+ InputNumberModule,
218
+ PasswordModule,
219
+ ButtonModule,
220
+ TableModule,
221
+ FileUploadModule,
222
+ MultiSelectModule,
223
+ CommonModule,
224
+ SelectButtonModule,
225
+ InputSwitchModule,
226
+ CheckboxModule,
227
+ InputTextareaModule,
228
+ InputTextModule,
229
+ DividerModule,
230
+ CalendarModule,
231
+ DropdownModule,
232
+ TreeSelectModule,
233
+ RadioButtonModule,
234
+ AutoCompleteModule,
235
+ ReactiveFormsModule,
236
+ HttpClientModule,
237
+ OverlayPanelModule,
238
+ EditorModule, i1.TranslateModule], exports: [FormDynamicAngularComponent] }); }
239
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: FormDynamicAngularModule, imports: [InputMaskModule,
240
+ InputNumberModule,
241
+ PasswordModule,
242
+ ButtonModule,
243
+ TableModule,
244
+ FileUploadModule,
245
+ MultiSelectModule,
246
+ CommonModule,
247
+ SelectButtonModule,
248
+ InputSwitchModule,
249
+ CheckboxModule,
250
+ InputTextareaModule,
251
+ InputTextModule,
252
+ DividerModule,
253
+ CalendarModule,
254
+ DropdownModule,
255
+ TreeSelectModule,
256
+ RadioButtonModule,
257
+ AutoCompleteModule,
258
+ ReactiveFormsModule,
259
+ HttpClientModule,
260
+ OverlayPanelModule,
261
+ EditorModule,
262
+ TranslateModule.forRoot({
263
+ loader: {
264
+ provide: TranslateLoader,
265
+ useFactory: HttpLoaderFactory,
266
+ deps: [HttpClient]
267
+ },
268
+ })] }); }
269
+ }
270
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: FormDynamicAngularModule, decorators: [{
271
+ type: NgModule,
272
+ args: [{
273
+ declarations: [
274
+ FormDynamicAngularComponent
275
+ ],
276
+ imports: [
277
+ InputMaskModule,
278
+ InputNumberModule,
279
+ PasswordModule,
280
+ ButtonModule,
281
+ TableModule,
282
+ FileUploadModule,
283
+ MultiSelectModule,
284
+ CommonModule,
285
+ SelectButtonModule,
286
+ InputSwitchModule,
287
+ CheckboxModule,
288
+ InputTextareaModule,
289
+ InputTextModule,
290
+ DividerModule,
291
+ CalendarModule,
292
+ DropdownModule,
293
+ TreeSelectModule,
294
+ RadioButtonModule,
295
+ AutoCompleteModule,
296
+ ReactiveFormsModule,
297
+ HttpClientModule,
298
+ OverlayPanelModule,
299
+ EditorModule,
300
+ TranslateModule.forRoot({
301
+ loader: {
302
+ provide: TranslateLoader,
303
+ useFactory: HttpLoaderFactory,
304
+ deps: [HttpClient]
305
+ },
306
+ })
307
+ ],
308
+ exports: [
309
+ FormDynamicAngularComponent
310
+ ]
311
+ }]
312
+ }] });
313
+
314
+ /*
315
+ * Public API Surface of form-dynamic-ajax
316
+ */
317
+
318
+ /**
319
+ * Generated bundle index. Do not edit.
320
+ */
321
+
322
+ export { FormDynamicAngularComponent, FormDynamicAngularModule, HttpLoaderFactory };
323
+ //# sourceMappingURL=form-dynamic-ajax.mjs.map