@main-class/componentes 3.2.6 → 3.2.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.
- package/crud/index.d.ts +7 -0
- package/crud/src/abstract-consulta-paginada-component.d.ts +24 -0
- package/crud/src/abstract-edicao-component.d.ts +19 -0
- package/crud/src/abstract-edicao-modal-component.d.ts +19 -0
- package/crud/src/query/query-field/query-field.component.d.ts +37 -0
- package/crud/src/query/query-form-field/query-form-field.component.d.ts +11 -0
- package/crud/src/query/query-form.component.d.ts +23 -0
- package/crud/src/query/query-modal-form/query-modal-form.component.d.ts +13 -0
- package/dialog/index.d.ts +10 -0
- package/dialog/src/dialog-confirmacao/dialog-confirmacao.component.d.ts +23 -0
- package/dialog/src/dialog-iframe/dialog-iframe.component.d.ts +21 -0
- package/dialog/src/dialog-sidebar/modal-template/modal-body.directive.d.ts +9 -0
- package/dialog/src/dialog-sidebar/modal-template/modal-close.directive.d.ts +9 -0
- package/dialog/src/dialog-sidebar/modal-template/modal-footer.directive.d.ts +6 -0
- package/dialog/src/dialog-sidebar/modal-template/modal-header.directive.d.ts +6 -0
- package/dialog/src/dialog-sidebar/modal-template/modal-template.component.d.ts +12 -0
- package/dialog/src/dialog-sidebar/modal.component.d.ts +8 -0
- package/dialog/src/dialog-sidebar/sidebar-modal-ref.d.ts +17 -0
- package/dialog/src/dialog.service.d.ts +26 -0
- package/fesm2022/main-class-componentes-crud.mjs +458 -0
- package/fesm2022/main-class-componentes-crud.mjs.map +1 -0
- package/fesm2022/main-class-componentes-dialog.mjs +393 -0
- package/fesm2022/main-class-componentes-dialog.mjs.map +1 -0
- package/fesm2022/main-class-componentes-form.mjs +209 -0
- package/fesm2022/main-class-componentes-form.mjs.map +1 -0
- package/fesm2022/main-class-componentes-input.mjs +1861 -0
- package/fesm2022/main-class-componentes-input.mjs.map +1 -0
- package/fesm2022/main-class-componentes-loader.mjs +213 -0
- package/fesm2022/main-class-componentes-loader.mjs.map +1 -0
- package/fesm2022/main-class-componentes-pipe.mjs +27 -0
- package/fesm2022/main-class-componentes-pipe.mjs.map +1 -0
- package/fesm2022/main-class-componentes-table.mjs +443 -0
- package/fesm2022/main-class-componentes-table.mjs.map +1 -0
- package/form/index.d.ts +3 -0
- package/form/src/form.component.d.ts +24 -0
- package/form/src/mensagens-erro/mensagens-erro.component.d.ts +17 -0
- package/form/src/single-click.directive.d.ts +13 -0
- package/input/index.d.ts +25 -0
- package/input/src/abstract-mat-form-field-control.d.ts +50 -0
- package/input/src/abstract-mat-form-field-select-control.d.ts +28 -0
- package/input/src/input-currency/input-currency.component.d.ts +11 -0
- package/input/src/input-datetime/input-datetime.component.d.ts +28 -0
- package/input/src/input-fileupload/input-fileupload.component.d.ts +69 -0
- package/input/src/input-fileupload/input-fileupload.directive.d.ts +8 -0
- package/input/src/input-mask/input-cep.component.d.ts +7 -0
- package/input/src/input-mask/input-cnpj.component.d.ts +7 -0
- package/input/src/input-mask/input-cpf-cnpj.component.d.ts +8 -0
- package/input/src/input-mask/input-cpf.component.d.ts +7 -0
- package/input/src/input-mask/input-mask.component.d.ts +24 -0
- package/input/src/input-mask/input-phone.component.d.ts +7 -0
- package/input/src/input-telefone-internacional/input-telefone-internacional-validator.directive.d.ts +8 -0
- package/input/src/input-telefone-internacional/input-telefone-internacional.component.d.ts +21 -0
- package/input/src/option-checkbox/all-option-checkbox.component.d.ts +18 -0
- package/input/src/option-checkbox/node-pool.d.ts +23 -0
- package/input/src/option-checkbox/option-checkbox-group.component.d.ts +25 -0
- package/input/src/option-checkbox/option-checkbox.component.d.ts +23 -0
- package/input/src/option-checkbox/option-checkbox.service.d.ts +16 -0
- package/input/src/option-checkbox/option-node.d.ts +13 -0
- package/input/src/select-autocomplete/select-autocomplete.component.d.ts +17 -0
- package/input/src/select-chips/select-chips.component.d.ts +11 -0
- package/input/src/select-many-checkbox/select-many-checkbox.component.d.ts +11 -0
- package/input/src/select-option/delegate-option-provider.directive.d.ts +13 -0
- package/input/src/select-option/select-option-provider.d.ts +10 -0
- package/input/src/select-option/select-option.component.d.ts +10 -0
- package/input/src/select-option/select-option.d.ts +4 -0
- package/input/src/select-radio/select-radio.component.d.ts +8 -0
- package/loader/index.d.ts +2 -0
- package/loader/src/loader.component.d.ts +25 -0
- package/loader/src/loader.service.d.ts +20 -0
- package/package.json +5 -5
- package/pipe/index.d.ts +1 -0
- package/pipe/src/nome-resumido.pipe.d.ts +7 -0
- package/table/index.d.ts +9 -0
- package/table/src/column/column-cell.directive.d.ts +8 -0
- package/table/src/column/column-footer.directive.d.ts +8 -0
- package/table/src/column/column-header.directive.d.ts +8 -0
- package/table/src/column/column.directive.d.ts +16 -0
- package/table/src/numeric-paginator/numeric-paginator.component.d.ts +6 -0
- package/table/src/paginated-table/paginated-table.component.d.ts +58 -0
- package/table/src/paginator-i18n.d.ts +8 -0
- package/table/src/table/table.component.d.ts +39 -0
- package/table/src/td/td.component.d.ts +8 -0
- package/table/src/th/th.component.d.ts +8 -0
- package/table/src/undefined-paginator/undefined-paginator.component.d.ts +25 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, ViewChild, ContentChildren, Input, Output, Component, Directive, Host, Optional } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/forms';
|
|
4
|
+
import { FormsModule, NgForm, NgModel, FormControl } from '@angular/forms';
|
|
5
|
+
import { throttleTime } from 'rxjs/operators';
|
|
6
|
+
import { Subject, Observable, fromEvent } from 'rxjs';
|
|
7
|
+
import { TranslatePipe } from '@ngx-translate/core';
|
|
8
|
+
|
|
9
|
+
class FormComponent {
|
|
10
|
+
submitted = new EventEmitter();
|
|
11
|
+
throttleMillis = 500;
|
|
12
|
+
eventSubject = new Subject();
|
|
13
|
+
subscription;
|
|
14
|
+
models;
|
|
15
|
+
form;
|
|
16
|
+
currentModels = [];
|
|
17
|
+
constructor() {
|
|
18
|
+
}
|
|
19
|
+
ngOnInit() {
|
|
20
|
+
this.subscription = this.eventSubject
|
|
21
|
+
.pipe(throttleTime(this.throttleMillis))
|
|
22
|
+
.subscribe((v) => {
|
|
23
|
+
this.submitted.emit(v);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
ngOnDestroy() {
|
|
27
|
+
this.eventSubject.complete();
|
|
28
|
+
this.subscription?.unsubscribe();
|
|
29
|
+
this.submitted.unsubscribe();
|
|
30
|
+
}
|
|
31
|
+
ngAfterViewInit() {
|
|
32
|
+
this.models.changes.subscribe(() => {
|
|
33
|
+
this.atualizaModels();
|
|
34
|
+
});
|
|
35
|
+
this.atualizaModels();
|
|
36
|
+
}
|
|
37
|
+
atualizaModels() {
|
|
38
|
+
const ngContentModels = this.models.toArray();
|
|
39
|
+
for (let i = 0; i < this.currentModels.length;) {
|
|
40
|
+
const model = this.currentModels[i];
|
|
41
|
+
if (ngContentModels.indexOf(model) < 0) {
|
|
42
|
+
this.form.removeControl(model);
|
|
43
|
+
model.control.setParent(null);
|
|
44
|
+
this.currentModels.splice(i, 1);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
i++;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
ngContentModels.forEach(model => {
|
|
51
|
+
if (this.currentModels.indexOf(model) < 0) {
|
|
52
|
+
this.currentModels.push(model);
|
|
53
|
+
this.form.addControl(model);
|
|
54
|
+
model.control.setParent(this.form.form);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
touched() {
|
|
59
|
+
this.models.toArray().forEach((model) => {
|
|
60
|
+
model.control.markAsTouched();
|
|
61
|
+
model.control.markAsDirty();
|
|
62
|
+
model.control.updateValueAndValidity();
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
untouched() {
|
|
66
|
+
this.models.toArray().forEach((model) => {
|
|
67
|
+
model.control.markAsPristine();
|
|
68
|
+
model.control.markAsUntouched();
|
|
69
|
+
model.control.updateValueAndValidity();
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
reset() {
|
|
73
|
+
this.form.resetForm();
|
|
74
|
+
this.form.control.markAsPending();
|
|
75
|
+
this.models.toArray().forEach((model) => {
|
|
76
|
+
model.control.reset();
|
|
77
|
+
model.control.setErrors(null);
|
|
78
|
+
model.control.updateValueAndValidity();
|
|
79
|
+
});
|
|
80
|
+
return new Observable(observer => {
|
|
81
|
+
setTimeout(() => {
|
|
82
|
+
observer.next(null);
|
|
83
|
+
observer.complete();
|
|
84
|
+
}, 300);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
submit(form) {
|
|
88
|
+
if (!form.valid) {
|
|
89
|
+
this.touched();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
this.eventSubject.next(form);
|
|
93
|
+
}
|
|
94
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: FormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
95
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: FormComponent, isStandalone: true, selector: "mcl-form", inputs: { throttleMillis: "throttleMillis" }, outputs: { submitted: "submitted" }, queries: [{ propertyName: "models", predicate: NgModel, descendants: true }], viewQueries: [{ propertyName: "form", first: true, predicate: NgForm, descendants: true }], ngImport: i0, template: "<form #form=\"ngForm\" (ngSubmit)=\"submit(form)\">\n <ng-content></ng-content>\n</form>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
96
|
+
}
|
|
97
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: FormComponent, decorators: [{
|
|
98
|
+
type: Component,
|
|
99
|
+
args: [{ selector: 'mcl-form', imports: [
|
|
100
|
+
FormsModule
|
|
101
|
+
], template: "<form #form=\"ngForm\" (ngSubmit)=\"submit(form)\">\n <ng-content></ng-content>\n</form>\n" }]
|
|
102
|
+
}], ctorParameters: () => [], propDecorators: { submitted: [{
|
|
103
|
+
type: Output
|
|
104
|
+
}], throttleMillis: [{
|
|
105
|
+
type: Input
|
|
106
|
+
}], models: [{
|
|
107
|
+
type: ContentChildren,
|
|
108
|
+
args: [NgModel, { descendants: true }]
|
|
109
|
+
}], form: [{
|
|
110
|
+
type: ViewChild,
|
|
111
|
+
args: [NgForm]
|
|
112
|
+
}] } });
|
|
113
|
+
|
|
114
|
+
class SingleClickDirective {
|
|
115
|
+
elementRef;
|
|
116
|
+
subscription;
|
|
117
|
+
throttleMillis = 500;
|
|
118
|
+
singleClick = new EventEmitter();
|
|
119
|
+
constructor(elementRef) {
|
|
120
|
+
this.elementRef = elementRef;
|
|
121
|
+
}
|
|
122
|
+
ngOnInit() {
|
|
123
|
+
this.subscription = fromEvent(this.elementRef.nativeElement, 'click')
|
|
124
|
+
.pipe(throttleTime(this.throttleMillis))
|
|
125
|
+
.subscribe((v) => {
|
|
126
|
+
this.singleClick.emit(v);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
ngOnDestroy() {
|
|
130
|
+
this.subscription?.unsubscribe();
|
|
131
|
+
this.singleClick.unsubscribe();
|
|
132
|
+
}
|
|
133
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SingleClickDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
134
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: SingleClickDirective, isStandalone: true, selector: "[mclSingleClick],[singleClick]", inputs: { throttleMillis: "throttleMillis" }, outputs: { singleClick: "singleClick" }, ngImport: i0 });
|
|
135
|
+
}
|
|
136
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SingleClickDirective, decorators: [{
|
|
137
|
+
type: Directive,
|
|
138
|
+
args: [{
|
|
139
|
+
selector: '[mclSingleClick],[singleClick]'
|
|
140
|
+
}]
|
|
141
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { throttleMillis: [{
|
|
142
|
+
type: Input
|
|
143
|
+
}], singleClick: [{
|
|
144
|
+
type: Output
|
|
145
|
+
}] } });
|
|
146
|
+
|
|
147
|
+
class MensagensErroComponent {
|
|
148
|
+
mcForm;
|
|
149
|
+
formGroup;
|
|
150
|
+
formGroupName;
|
|
151
|
+
for;
|
|
152
|
+
constructor(mcForm, formGroup, formGroupName) {
|
|
153
|
+
this.mcForm = mcForm;
|
|
154
|
+
this.formGroup = formGroup;
|
|
155
|
+
this.formGroupName = formGroupName;
|
|
156
|
+
}
|
|
157
|
+
get group() {
|
|
158
|
+
return this.formGroup?.form || this.formGroupName?.control || this.mcForm?.form;
|
|
159
|
+
}
|
|
160
|
+
ngOnInit() {
|
|
161
|
+
}
|
|
162
|
+
get control() {
|
|
163
|
+
if (typeof this.for === 'string') {
|
|
164
|
+
if (!!this.group) {
|
|
165
|
+
return this.group?.controls && this.group?.controls[this.for];
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
else if (this.for instanceof FormControl) {
|
|
169
|
+
return this.for;
|
|
170
|
+
}
|
|
171
|
+
return undefined;
|
|
172
|
+
}
|
|
173
|
+
get errors() {
|
|
174
|
+
if (!!this.control?.errors) {
|
|
175
|
+
return Object.keys(this.control.errors);
|
|
176
|
+
}
|
|
177
|
+
return undefined;
|
|
178
|
+
}
|
|
179
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: MensagensErroComponent, deps: [{ token: FormComponent, host: true, optional: true }, { token: i2.FormGroupDirective, host: true, optional: true }, { token: i2.FormGroupName, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
180
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: MensagensErroComponent, isStandalone: true, selector: "[mclErrorFor]", inputs: { for: ["mclErrorFor", "for"] }, ngImport: i0, template: "@for (error of errors; track error) {\n <span>{{ 'validation.' + error | translate:control!.errors![error] }}</span>\n}\n", styles: [""], dependencies: [{ kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
181
|
+
}
|
|
182
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: MensagensErroComponent, decorators: [{
|
|
183
|
+
type: Component,
|
|
184
|
+
args: [{ selector: '[mclErrorFor]', imports: [
|
|
185
|
+
TranslatePipe,
|
|
186
|
+
], template: "@for (error of errors; track error) {\n <span>{{ 'validation.' + error | translate:control!.errors![error] }}</span>\n}\n" }]
|
|
187
|
+
}], ctorParameters: () => [{ type: FormComponent, decorators: [{
|
|
188
|
+
type: Host
|
|
189
|
+
}, {
|
|
190
|
+
type: Optional
|
|
191
|
+
}] }, { type: i2.FormGroupDirective, decorators: [{
|
|
192
|
+
type: Host
|
|
193
|
+
}, {
|
|
194
|
+
type: Optional
|
|
195
|
+
}] }, { type: i2.FormGroupName, decorators: [{
|
|
196
|
+
type: Host
|
|
197
|
+
}, {
|
|
198
|
+
type: Optional
|
|
199
|
+
}] }], propDecorators: { for: [{
|
|
200
|
+
type: Input,
|
|
201
|
+
args: ['mclErrorFor']
|
|
202
|
+
}] } });
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Generated bundle index. Do not edit.
|
|
206
|
+
*/
|
|
207
|
+
|
|
208
|
+
export { FormComponent, MensagensErroComponent, SingleClickDirective };
|
|
209
|
+
//# sourceMappingURL=main-class-componentes-form.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main-class-componentes-form.mjs","sources":["../../../../projects/main-class/componentes/form/src/form.component.ts","../../../../projects/main-class/componentes/form/src/form.component.html","../../../../projects/main-class/componentes/form/src/single-click.directive.ts","../../../../projects/main-class/componentes/form/src/mensagens-erro/mensagens-erro.component.ts","../../../../projects/main-class/componentes/form/src/mensagens-erro/mensagens-erro.component.html","../../../../projects/main-class/componentes/form/main-class-componentes-form.ts"],"sourcesContent":["import {\n AfterViewInit,\n Component,\n ContentChildren,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n QueryList,\n ViewChild\n} from '@angular/core';\nimport {FormsModule, NgForm, NgModel} from '@angular/forms';\nimport {Subscription} from 'rxjs';\nimport {throttleTime} from 'rxjs/operators';\nimport {Observable, Subject} from 'rxjs';\n\n@Component({\n selector: 'mcl-form',\n templateUrl: './form.component.html',\n imports: [\n FormsModule\n ],\n styleUrls: ['./form.component.scss']\n})\nexport class FormComponent implements OnInit, OnDestroy, AfterViewInit {\n\n @Output() submitted = new EventEmitter<NgForm>();\n\n @Input()\n throttleMillis = 500;\n\n private eventSubject = new Subject<NgForm>();\n private subscription?: Subscription;\n\n @ContentChildren(NgModel, {descendants: true}) public models!: QueryList<NgModel>;\n @ViewChild(NgForm) form!: NgForm;\n\n private currentModels: Array<NgModel> = [];\n\n constructor() {\n }\n\n ngOnInit(): void {\n this.subscription = this.eventSubject\n .pipe(throttleTime(this.throttleMillis))\n .subscribe((v) => {\n this.submitted.emit(v);\n });\n }\n\n ngOnDestroy() {\n this.eventSubject.complete();\n this.subscription?.unsubscribe();\n this.submitted.unsubscribe();\n }\n\n ngAfterViewInit() {\n this.models.changes.subscribe(() => {\n this.atualizaModels();\n });\n\n this.atualizaModels();\n }\n\n private atualizaModels() {\n const ngContentModels = this.models.toArray();\n\n for (let i = 0; i < this.currentModels.length;) {\n const model = this.currentModels[i];\n if (ngContentModels.indexOf(model) < 0) {\n this.form.removeControl(model);\n model.control.setParent(null);\n this.currentModels.splice(i, 1);\n } else {\n i++;\n }\n }\n\n ngContentModels.forEach(model => {\n if (this.currentModels.indexOf(model) < 0) {\n this.currentModels.push(model);\n this.form.addControl(model);\n model.control.setParent(this.form.form);\n }\n });\n }\n\n touched() {\n this.models.toArray().forEach((model) => {\n model.control.markAsTouched();\n model.control.markAsDirty();\n model.control.updateValueAndValidity();\n });\n }\n\n untouched() {\n this.models.toArray().forEach((model) => {\n model.control.markAsPristine();\n model.control.markAsUntouched();\n model.control.updateValueAndValidity();\n });\n }\n\n reset(): Observable<any> {\n this.form.resetForm();\n this.form.control.markAsPending();\n this.models.toArray().forEach((model) => {\n model.control.reset();\n model.control.setErrors(null);\n model.control.updateValueAndValidity();\n });\n\n return new Observable(observer => {\n setTimeout(() => {\n observer.next(null);\n observer.complete();\n }, 300);\n });\n }\n\n submit(form: NgForm) {\n if (!form.valid) {\n this.touched();\n return;\n }\n\n this.eventSubject.next(form);\n }\n}\n","<form #form=\"ngForm\" (ngSubmit)=\"submit(form)\">\n <ng-content></ng-content>\n</form>\n","import {Directive, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output} from '@angular/core';\nimport {fromEvent, Subscription} from 'rxjs';\nimport {throttleTime} from 'rxjs/operators';\n\n@Directive({\n selector: '[mclSingleClick],[singleClick]'\n})\nexport class SingleClickDirective implements OnInit, OnDestroy {\n private subscription?: Subscription;\n\n @Input()\n throttleMillis = 500;\n\n @Output()\n singleClick = new EventEmitter();\n\n constructor(private elementRef: ElementRef) {\n }\n\n ngOnInit(): void {\n this.subscription = fromEvent(this.elementRef.nativeElement, 'click')\n .pipe(throttleTime(this.throttleMillis))\n .subscribe((v) => {\n this.singleClick.emit(v);\n });\n }\n\n ngOnDestroy(): void {\n this.subscription?.unsubscribe();\n this.singleClick.unsubscribe();\n }\n\n}\n","import {Component, Host, Input, OnInit, Optional} from '@angular/core';\nimport {FormComponent} from '../form.component';\nimport {FormControl, FormGroupDirective, FormGroupName} from '@angular/forms';\nimport {TranslatePipe} from '@ngx-translate/core';\n\n@Component({\n selector: '[mclErrorFor]',\n templateUrl: './mensagens-erro.component.html',\n imports: [\n TranslatePipe,\n ],\n styleUrls: ['./mensagens-erro.component.scss']\n})\nexport class MensagensErroComponent implements OnInit {\n\n @Input('mclErrorFor') for?: string | FormControl;\n\n constructor(\n @Host() @Optional() private mcForm: FormComponent,\n @Host() @Optional() private formGroup: FormGroupDirective,\n @Host() @Optional() private formGroupName: FormGroupName,\n ) {\n }\n\n get group() {\n return this.formGroup?.form || this.formGroupName?.control || this.mcForm?.form;\n }\n\n ngOnInit(): void {\n }\n\n get control() {\n if (typeof this.for === 'string') {\n if (!!this.group) {\n return this.group?.controls && this.group?.controls[this.for];\n }\n } else if (this.for instanceof FormControl) {\n return this.for;\n }\n\n return undefined;\n }\n\n get errors() {\n if (!!this.control?.errors) {\n return Object.keys(this.control.errors);\n }\n\n return undefined;\n }\n\n}\n","@for (error of errors; track error) {\n <span>{{ 'validation.' + error | translate:control!.errors![error] }}</span>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i1.FormComponent"],"mappings":";;;;;;;;MAyBa,aAAa,CAAA;AAEd,IAAA,SAAS,GAAG,IAAI,YAAY,EAAU;IAGhD,cAAc,GAAG,GAAG;AAEZ,IAAA,YAAY,GAAG,IAAI,OAAO,EAAU;AACpC,IAAA,YAAY;AAEkC,IAAA,MAAM;AACzC,IAAA,IAAI;IAEf,aAAa,GAAmB,EAAE;AAE1C,IAAA,WAAA,GAAA;;IAGA,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;AACtB,aAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC;AACtC,aAAA,SAAS,CAAC,CAAC,CAAC,KAAI;AACf,YAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;AACxB,SAAC,CAAC;;IAGN,WAAW,G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