@main-class/componentes 3.3.7 → 3.3.9

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.
@@ -1,8 +1,8 @@
1
1
  import * as i1 from '@angular/forms';
2
- import { NgControl, FormGroupDirective, FormControl, FormsModule, NG_VALIDATORS, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';
2
+ import { FormControl, NgControl, FormGroupDirective, Validators, ReactiveFormsModule, NG_VALIDATORS, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
3
3
  import { Subject, BehaviorSubject, concat, of, debounceTime, Observable, combineLatest } from 'rxjs';
4
4
  import * as i0 from '@angular/core';
5
- import { inject, Input, HostBinding, ViewChild, Component, InjectionToken, QueryList, ContentChildren, EventEmitter, Output, Optional, Self, Inject, Directive, Injectable } from '@angular/core';
5
+ import { Directive, inject, Input, HostBinding, Component, InjectionToken, QueryList, ContentChildren, Inject, Optional, EventEmitter, Output, ViewChild, Self, Injectable } from '@angular/core';
6
6
  import * as i1$2 from '@angular/material/core';
7
7
  import { ErrorStateMatcher, MAT_DATE_LOCALE, DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
8
8
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
@@ -27,43 +27,76 @@ import { MatCheckbox } from '@angular/material/checkbox';
27
27
  import { MatAutocompleteTrigger, MatAutocomplete, MatOption } from '@angular/material/autocomplete';
28
28
  import { MatRadioGroup, MatRadioButton } from '@angular/material/radio';
29
29
  import * as i1$3 from 'lac-mat-tel-input';
30
- import { LacMatTelInputModule, phoneNumberValidator } from 'lac-mat-tel-input';
30
+ import { phoneNumberValidator, LacMatTelInputModule } from 'lac-mat-tel-input';
31
31
 
32
- class AbstractMatFormFieldControl {
32
+ class AbstractControlValueAccessor {
33
+ valueSubscription;
34
+ control = new FormControl();
35
+ onChange = (value) => {
36
+ };
37
+ onTouched = () => {
38
+ };
39
+ onControlValueChange(value) {
40
+ this.onTouched();
41
+ this.onChange(value);
42
+ }
43
+ ngOnInit() {
44
+ this.valueSubscription = this.control.valueChanges
45
+ .subscribe(value => {
46
+ this.onControlValueChange(value);
47
+ });
48
+ }
49
+ ngOnDestroy() {
50
+ this.valueSubscription?.unsubscribe();
51
+ }
52
+ writeValue(obj) {
53
+ this.control.setValue(obj);
54
+ }
55
+ registerOnChange(fn) {
56
+ this.onChange = fn;
57
+ }
58
+ registerOnTouched(fn) {
59
+ this.onTouched = fn;
60
+ }
61
+ setDisabledState(isDisabled) {
62
+ if (isDisabled) {
63
+ this.control.disable();
64
+ }
65
+ else {
66
+ this.control.enable();
67
+ }
68
+ }
69
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractControlValueAccessor, deps: [], target: i0.ɵɵFactoryTarget.Directive });
70
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: AbstractControlValueAccessor, isStandalone: true, ngImport: i0 });
71
+ }
72
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractControlValueAccessor, decorators: [{
73
+ type: Directive
74
+ }] });
75
+
76
+ class AbstractMatFormFieldControl extends AbstractControlValueAccessor {
33
77
  errorStateMatcher = inject(ErrorStateMatcher);
34
78
  ngControl = inject(NgControl, { optional: true, self: true });
35
79
  parentFormGroup = inject(FormGroupDirective, { optional: true });
36
80
  static nextId = 0;
37
- $value;
38
81
  $placeholder = '';
39
- $disabled = false;
40
- $required = false;
41
82
  focused = false;
42
83
  constructor() {
84
+ super();
43
85
  if (this.ngControl != null) {
44
86
  this.ngControl.valueAccessor = this;
45
87
  }
46
88
  }
47
- _input;
48
- get input() {
49
- return this._input;
50
- }
51
- set input(value) {
52
- this._input = value;
53
- }
54
89
  stateChanges = new Subject();
55
90
  id = `custom-input-${AbstractMatFormFieldControl.nextId++}`;
56
91
  describedBy = '';
57
- onChange = (val) => {
58
- };
59
- onTouched = () => {
60
- };
61
92
  get value() {
62
- return this.$value;
93
+ return this.control.value;
63
94
  }
64
95
  set value(value) {
65
- this.$value = value;
66
- this.onChange(value);
96
+ this.control.patchValue(value);
97
+ }
98
+ onControlValueChange(value) {
99
+ super.onControlValueChange(value);
67
100
  this.stateChanges.next();
68
101
  }
69
102
  get empty() {
@@ -81,7 +114,7 @@ class AbstractMatFormFieldControl {
81
114
  onContainerClick(event) {
82
115
  }
83
116
  get shouldLabelFloat() {
84
- return !this.empty || (this.input && this.input.nativeElement.value) || this.focused;
117
+ return !this.empty || this.focused;
85
118
  }
86
119
  get placeholder() {
87
120
  return this.$placeholder;
@@ -91,17 +124,27 @@ class AbstractMatFormFieldControl {
91
124
  this.stateChanges.next();
92
125
  }
93
126
  get required() {
94
- return this.$required;
127
+ return this.control.hasValidator(Validators.required);
95
128
  }
96
129
  set required(value) {
97
- this.$required = coerceBooleanProperty(value);
130
+ if (coerceBooleanProperty(value)) {
131
+ this.control.addValidators(Validators.required);
132
+ }
133
+ else {
134
+ this.control.removeValidators(Validators.required);
135
+ }
98
136
  this.stateChanges.next();
99
137
  }
100
138
  get disabled() {
101
- return this.$disabled;
139
+ return this.control.disabled;
102
140
  }
103
141
  set disabled(value) {
104
- this.$disabled = coerceBooleanProperty(value);
142
+ if (coerceBooleanProperty(value)) {
143
+ this.control.disable();
144
+ }
145
+ else {
146
+ this.control.enable();
147
+ }
105
148
  this.stateChanges.next();
106
149
  }
107
150
  get errorState() {
@@ -114,32 +157,18 @@ class AbstractMatFormFieldControl {
114
157
  this.describedBy = ids.join(' ');
115
158
  }
116
159
  ngOnDestroy() {
160
+ super.ngOnDestroy();
117
161
  this.stateChanges.complete();
118
162
  }
119
- registerOnTouched(fn) {
120
- this.onTouched = fn;
121
- }
122
- registerOnChange(fn) {
123
- this.onChange = fn;
124
- }
125
- setDisabledState(isDisabled) {
126
- this.disabled = isDisabled;
127
- }
128
- writeValue(value) {
129
- this.$value = value;
130
- }
131
163
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractMatFormFieldControl, deps: [], target: i0.ɵɵFactoryTarget.Component });
132
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: AbstractMatFormFieldControl, isStandalone: true, selector: "ng-component", inputs: { placeholder: "placeholder", required: "required", disabled: "disabled" }, host: { properties: { "id": "this.id", "attr.aria-describedby": "this.describedBy", "class.floating": "this.shouldLabelFloat" } }, viewQueries: [{ propertyName: "_input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: '', isInline: true });
164
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: AbstractMatFormFieldControl, isStandalone: true, selector: "ng-component", inputs: { placeholder: "placeholder", required: "required", disabled: "disabled" }, host: { properties: { "id": "this.id", "attr.aria-describedby": "this.describedBy", "class.floating": "this.shouldLabelFloat" } }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
133
165
  }
134
166
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractMatFormFieldControl, decorators: [{
135
167
  type: Component,
136
168
  args: [{
137
169
  template: ''
138
170
  }]
139
- }], ctorParameters: () => [], propDecorators: { _input: [{
140
- type: ViewChild,
141
- args: ['input']
142
- }], id: [{
171
+ }], ctorParameters: () => [], propDecorators: { id: [{
143
172
  type: HostBinding
144
173
  }], describedBy: [{
145
174
  type: HostBinding,
@@ -184,7 +213,7 @@ class AbstractMatFormFieldSelectControl extends AbstractMatFormFieldControl {
184
213
  $args = new BehaviorSubject(undefined);
185
214
  wvt;
186
215
  filteredOptions;
187
- control = new FormControl('');
216
+ inputControl = new FormControl('');
188
217
  trackBy = (val) => val;
189
218
  options = new QueryList();
190
219
  defaultOptionProvider = {
@@ -207,7 +236,7 @@ class AbstractMatFormFieldSelectControl extends AbstractMatFormFieldControl {
207
236
  }
208
237
  };
209
238
  get empty() {
210
- return !this.control.value;
239
+ return !this.inputControl.value;
211
240
  }
212
241
  get shouldFilter() {
213
242
  return true;
@@ -223,12 +252,12 @@ class AbstractMatFormFieldSelectControl extends AbstractMatFormFieldControl {
223
252
  this.$args.next(args);
224
253
  }
225
254
  ngAfterContentInit() {
226
- this.filteredOptions = concat(of(''), this.control.valueChanges).pipe(debounceTime(300), switchMap(value => {
255
+ this.filteredOptions = concat(of(''), this.inputControl.valueChanges).pipe(debounceTime(300), switchMap(value => {
227
256
  return (this.optionProvider || this.defaultOptionProvider).provide(this.shouldFilter ? value : '');
228
257
  }));
229
258
  this.optionsSubscription = this.options.changes.subscribe(() => {
230
259
  if (this.value !== undefined && this.value !== null) {
231
- this.control.setValue((this.optionProvider || this.defaultOptionProvider).label(this.value));
260
+ this.inputControl.setValue((this.optionProvider || this.defaultOptionProvider).label(this.value));
232
261
  }
233
262
  });
234
263
  this.options.notifyOnChanges();
@@ -244,21 +273,21 @@ class AbstractMatFormFieldSelectControl extends AbstractMatFormFieldControl {
244
273
  this.onTouched();
245
274
  if (value) {
246
275
  this.value = value;
247
- this.control.setValue((this.optionProvider || this.defaultOptionProvider).label(value));
276
+ this.inputControl.setValue((this.optionProvider || this.defaultOptionProvider).label(value));
248
277
  }
249
278
  else {
250
279
  this.value = undefined;
251
- this.control.setValue('');
280
+ this.inputControl.setValue('');
252
281
  }
253
282
  this.stateChanges.next();
254
283
  }
255
284
  writeValue(value) {
256
285
  super.writeValue(value);
257
286
  if (value) {
258
- this.control.setValue((this.optionProvider || this.defaultOptionProvider).label(value));
287
+ this.inputControl.setValue((this.optionProvider || this.defaultOptionProvider).label(value));
259
288
  }
260
289
  else {
261
- this.control.setValue('');
290
+ this.inputControl.setValue('');
262
291
  }
263
292
  }
264
293
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractMatFormFieldSelectControl, deps: null, target: i0.ɵɵFactoryTarget.Component });
@@ -278,58 +307,84 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
278
307
  type: Input
279
308
  }] } });
280
309
 
281
- class InputCurrencyComponent extends AbstractMatFormFieldControl {
282
- get value() {
283
- return super.value;
284
- }
285
- set value(value) {
286
- const unformatted = this.removeMask(value);
287
- if (unformatted) {
288
- super.value = unformatted;
289
- if (!!this.input) {
290
- this.input.nativeElement.text = this.applyMask(unformatted);
310
+ function applyMask(value, mask) {
311
+ if (!mask)
312
+ return value || '';
313
+ if (value && mask) {
314
+ value = removeMask(value) || '';
315
+ let result = '';
316
+ for (let im = 0, iv = 0; im < mask.length && iv < value.length; im++) {
317
+ if (mask[im] === '#') {
318
+ result += value[iv];
319
+ iv++;
320
+ }
321
+ else {
322
+ result += mask[im];
291
323
  }
292
324
  }
325
+ return result;
293
326
  }
294
- applyMask(value) {
295
- if (value) {
296
- return monetarioMask(value);
327
+ return '';
328
+ }
329
+ function removeMask(value, mask) {
330
+ if (!mask)
331
+ return value;
332
+ const lengthWithoutMask = mask?.replace(/[^#]/g, '')?.length || 0;
333
+ if (typeof value === 'number') {
334
+ value = String(value).padStart(lengthWithoutMask, '0');
335
+ }
336
+ if (value) {
337
+ const unformatted = value.replaceAll(/\D+/g, '');
338
+ if (unformatted.length > lengthWithoutMask) {
339
+ return unformatted.slice(0, lengthWithoutMask);
297
340
  }
298
- return undefined;
341
+ return unformatted;
299
342
  }
300
- removeMask(value) {
301
- if (value) {
302
- return monetarioMask(value, '', '', '.');
303
- }
304
- return undefined;
343
+ return undefined;
344
+ }
345
+
346
+ const MASK_RESOLVER = new InjectionToken('mainclass.MASK_RESOLVER');
347
+ class InputMaskValidatorDirective {
348
+ maskResolver;
349
+ $mask;
350
+ onValidatorChange = () => {
351
+ };
352
+ constructor(maskResolver) {
353
+ this.maskResolver = maskResolver;
305
354
  }
306
- writeValue(value) {
307
- super.writeValue(value);
308
- const masked = this.applyMask(value);
309
- if (!!this.input && masked !== this.value) {
310
- this.input.nativeElement.text = masked;
311
- }
355
+ set mask(mask) {
356
+ this.$mask = mask;
357
+ this.onValidatorChange();
312
358
  }
313
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCurrencyComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
314
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: InputCurrencyComponent, isStandalone: true, selector: "mcl-input[currency]", providers: [
315
- {
316
- provide: MatFormFieldControl,
317
- useExisting: InputCurrencyComponent
359
+ validate(control) {
360
+ if (!!control.value && (this.$mask || this.maskResolver)) {
361
+ const mask = this.$mask || this.maskResolver(control.value);
362
+ const lengthWithoutMask = mask.replace(/[^#]/g, '').length;
363
+ if (control.value.length !== lengthWithoutMask) {
364
+ return { 'incompleteMask': true };
318
365
  }
319
- ], usesInheritance: true, ngImport: i0, template: "<input matInput [(ngModel)]=\"value\"\n [placeholder]=\"placeholder\"\n (focusin)=\"onTouched()\"/>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }] });
366
+ }
367
+ return null;
368
+ }
369
+ registerOnValidatorChange(fn) {
370
+ this.onValidatorChange = fn;
371
+ }
372
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputMaskValidatorDirective, deps: [{ token: MASK_RESOLVER, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
373
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: InputMaskValidatorDirective, isStandalone: true, selector: "mcl-input[mask]", inputs: { mask: "mask" }, ngImport: i0 });
320
374
  }
321
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCurrencyComponent, decorators: [{
322
- type: Component,
323
- args: [{ selector: 'mcl-input[currency]', imports: [
324
- FormsModule,
325
- MatInput
326
- ], providers: [
327
- {
328
- provide: MatFormFieldControl,
329
- useExisting: InputCurrencyComponent
330
- }
331
- ], template: "<input matInput [(ngModel)]=\"value\"\n [placeholder]=\"placeholder\"\n (focusin)=\"onTouched()\"/>\n" }]
332
- }] });
375
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputMaskValidatorDirective, decorators: [{
376
+ type: Directive,
377
+ args: [{
378
+ selector: 'mcl-input[mask]'
379
+ }]
380
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
381
+ type: Inject,
382
+ args: [MASK_RESOLVER]
383
+ }, {
384
+ type: Optional
385
+ }] }], propDecorators: { mask: [{
386
+ type: Input
387
+ }] } });
333
388
 
334
389
  class InputMaskComponent extends AbstractMatFormFieldControl {
335
390
  /**
@@ -340,93 +395,79 @@ class InputMaskComponent extends AbstractMatFormFieldControl {
340
395
  keepMask;
341
396
  onFocusin = new EventEmitter();
342
397
  onFocusout = new EventEmitter();
343
- get value() {
344
- return super.value;
345
- }
346
- set value(value) {
398
+ onControlValueChange(value) {
347
399
  const unformatted = this.removeMask(value);
348
- if (unformatted) {
349
- super.value = this.keepMask ? this.applyMask(unformatted) : unformatted;
350
- if (!!this.input) {
351
- this.input.nativeElement.text = this.applyMask(unformatted);
352
- }
400
+ const formatted = this.applyMask(unformatted);
401
+ this.onChange(this.keepMask ? formatted : unformatted);
402
+ if (this.control.value !== formatted) {
403
+ this.control.patchValue(formatted);
353
404
  }
405
+ this.stateChanges.next();
354
406
  }
355
407
  set mask(mask) {
356
408
  if (this.$mask !== mask) {
357
409
  this.$mask = mask;
358
- this.writeValue(this.value);
410
+ this.reinforceMask();
359
411
  }
360
412
  }
361
413
  ngAfterViewInit() {
362
- if (this.input && this.mask) {
363
- const masked = this.applyMask(this.value);
364
- if (!!this.input && masked !== this.value) {
365
- this.input.nativeElement.text = masked;
366
- }
414
+ this.reinforceMask();
415
+ }
416
+ reinforceMask() {
417
+ if (this.mask) {
418
+ this.control.patchValue(this.applyMask(this.value));
367
419
  }
368
420
  }
369
421
  applyMask(value) {
370
- if (value && this.$mask) {
371
- value = this.removeMask(value);
372
- let result = '';
373
- for (let im = 0, iv = 0; im < this.$mask.length && iv < value.length; im++) {
374
- if (this.$mask[im] === '#') {
375
- result += value[iv];
376
- iv++;
377
- }
378
- else {
379
- result += this.$mask[im];
380
- }
381
- }
382
- return result;
383
- }
384
- return '';
422
+ return applyMask(value, this.$mask);
385
423
  }
386
424
  removeMask(value) {
387
- if (typeof value === 'number') {
388
- value = String(value).padStart(this.$mask?.replace(/[^#]/, '')?.length || 0, '0');
389
- }
390
- if (value) {
391
- return value.replaceAll(/\D+/g, '');
392
- }
393
- return undefined;
425
+ return removeMask(value, this.$mask);
394
426
  }
395
427
  writeValue(value) {
396
428
  super.writeValue(value);
397
- const masked = this.applyMask(value);
398
- if (!!this.input && masked !== this.value) {
399
- this.input.nativeElement.text = masked;
400
- }
429
+ this.control.patchValue(this.applyMask(value));
401
430
  }
402
431
  focusin() {
403
432
  this.onTouched();
404
433
  this.onFocusin.emit();
405
434
  this.focused = true;
435
+ this.stateChanges.next();
406
436
  }
407
437
  focusout() {
408
438
  this.onFocusout.emit();
409
439
  this.focused = false;
440
+ this.stateChanges.next();
410
441
  }
411
442
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputMaskComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
412
443
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: InputMaskComponent, isStandalone: true, selector: "mcl-input[mask]", inputs: { keepMask: "keepMask", mask: "mask" }, outputs: { onFocusin: "focusin", onFocusout: "focusout" }, providers: [
413
444
  {
414
445
  provide: MatFormFieldControl,
415
446
  useExisting: InputMaskComponent
447
+ },
448
+ {
449
+ provide: NG_VALIDATORS,
450
+ useClass: InputMaskValidatorDirective,
451
+ multi: true
416
452
  }
417
- ], usesInheritance: true, ngImport: i0, template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n", styles: [""], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
453
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput [formControl]=\"control\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n", styles: [""], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
418
454
  }
419
455
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputMaskComponent, decorators: [{
420
456
  type: Component,
421
457
  args: [{ selector: 'mcl-input[mask]', imports: [
422
458
  MatInput,
423
- FormsModule
459
+ ReactiveFormsModule
424
460
  ], providers: [
425
461
  {
426
462
  provide: MatFormFieldControl,
427
463
  useExisting: InputMaskComponent
464
+ },
465
+ {
466
+ provide: NG_VALIDATORS,
467
+ useClass: InputMaskValidatorDirective,
468
+ multi: true
428
469
  }
429
- ], template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n" }]
470
+ ], template: "<input matInput [formControl]=\"control\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n" }]
430
471
  }], propDecorators: { keepMask: [{
431
472
  type: Input
432
473
  }], onFocusin: [{
@@ -439,6 +480,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
439
480
  type: Input
440
481
  }] } });
441
482
 
483
+ class InputCurrencyComponent extends InputMaskComponent {
484
+ applyMask(value) {
485
+ if (value) {
486
+ return monetarioMask(value);
487
+ }
488
+ return undefined;
489
+ }
490
+ removeMask(value) {
491
+ if (value) {
492
+ return monetarioMask(value, '', '', '.');
493
+ }
494
+ return undefined;
495
+ }
496
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCurrencyComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
497
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: InputCurrencyComponent, isStandalone: true, selector: "mcl-input[currency]", providers: [
498
+ {
499
+ provide: MatFormFieldControl,
500
+ useExisting: InputCurrencyComponent
501
+ }
502
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput [formControl]=\"control\"\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n", styles: [""], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
503
+ }
504
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCurrencyComponent, decorators: [{
505
+ type: Component,
506
+ args: [{ selector: 'mcl-input[currency]', imports: [
507
+ MatInput,
508
+ ReactiveFormsModule
509
+ ], providers: [
510
+ {
511
+ provide: MatFormFieldControl,
512
+ useExisting: InputCurrencyComponent
513
+ }
514
+ ], template: "<input matInput [formControl]=\"control\"\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n" }]
515
+ }] });
516
+
442
517
  function validateDateTime(control) {
443
518
  if (!!control.value) {
444
519
  if (isNaN(control.value)) {
@@ -451,47 +526,37 @@ class InputDatetimeComponent extends AbstractMatFormFieldControl {
451
526
  locale = inject(MAT_DATE_LOCALE);
452
527
  formats = inject(MAT_DATETIME_FORMATS);
453
528
  adapter = inject(DatetimeAdapter);
529
+ maskedValueSubscription;
454
530
  type = 'date';
455
531
  readonly;
456
532
  name;
457
533
  picker;
458
534
  inputMask;
459
- innerValue;
460
- $maskedValue;
535
+ inputControl = new FormControl();
461
536
  constructor() {
462
537
  super();
463
538
  this.adapter.setLocale(this.locale);
464
- }
465
- get input() {
466
- return this.inputMask?.input;
467
- }
468
- set input(input) {
469
- // não necessário
539
+ this.maskedValueSubscription = this.inputControl.valueChanges
540
+ .subscribe(value => this.onMaskedValueChange(value));
470
541
  }
471
542
  get empty() {
472
- return !this.$maskedValue;
473
- }
474
- get maskedValue() {
475
- return this.$maskedValue;
476
- }
477
- set maskedValue(maskedValue) {
478
- if (this.$maskedValue !== maskedValue) {
479
- this.onTouched();
480
- this.$maskedValue = maskedValue;
481
- if (maskedValue) {
482
- if (maskedValue.match(new RegExp(`^${this.mask.replace(/#/g, '\\d')}$`))) {
483
- this.innerValue = this.adapter.parse(maskedValue, this.format)?.toDate();
484
- }
485
- else {
486
- this.innerValue = undefined;
487
- }
543
+ return !this.inputControl.value;
544
+ }
545
+ onMaskedValueChange(maskedValue) {
546
+ this.onTouched();
547
+ if (maskedValue) {
548
+ if (maskedValue.match(new RegExp(`^${this.mask.replace(/#/g, '\\d')}$`))) {
549
+ this.control.patchValue(this.adapter.parse(maskedValue, this.format)?.toDate());
488
550
  }
489
551
  else {
490
- this.innerValue = undefined;
552
+ this.control.patchValue(undefined);
491
553
  }
492
- this.onChange(this.innerValue);
493
- this.stateChanges.next();
494
554
  }
555
+ else {
556
+ this.control.patchValue(undefined);
557
+ }
558
+ this.onChange(this.control.value);
559
+ this.stateChanges.next();
495
560
  }
496
561
  get mask() {
497
562
  switch (this.type) {
@@ -511,34 +576,41 @@ class InputDatetimeComponent extends AbstractMatFormFieldControl {
511
576
  }
512
577
  return this.formats.display.datetimeInput;
513
578
  }
514
- get value() {
515
- return this.innerValue;
516
- }
517
- set value(value) {
518
- if (this.innerValue !== value) {
519
- this.onTouched();
520
- if (value) {
521
- this.innerValue = value instanceof Date ? value : value.toDate();
522
- this.$maskedValue = this.adapter.format(moment(this.innerValue), this.format);
523
- }
524
- else {
525
- this.innerValue = undefined;
526
- this.$maskedValue = '';
527
- }
528
- this.onChange(this.innerValue);
529
- this.stateChanges.next();
579
+ onControlValueChange(value) {
580
+ this.onTouched();
581
+ let dateValue;
582
+ let formattedValue;
583
+ if (value) {
584
+ dateValue = value instanceof Date ? value : value.toDate();
585
+ formattedValue = this.adapter.format(moment(dateValue), this.format);
586
+ }
587
+ else {
588
+ dateValue = undefined;
589
+ formattedValue = '';
530
590
  }
591
+ if (dateValue?.getTime() !== this.control.value?.geTime()) {
592
+ this.control.patchValue(dateValue);
593
+ this.onChange(dateValue);
594
+ }
595
+ if (formattedValue !== this.inputControl.value) {
596
+ this.inputControl.patchValue(formattedValue);
597
+ }
598
+ this.stateChanges.next();
531
599
  }
532
600
  writeValue(value) {
533
- this.innerValue = value;
601
+ super.writeValue(value);
534
602
  if (value) {
535
- this.$maskedValue = this.adapter.format(moment(value), this.format);
603
+ this.inputControl.patchValue(this.adapter.format(moment(value), this.format));
536
604
  }
537
605
  else {
538
- this.$maskedValue = '';
606
+ this.inputControl.patchValue('');
539
607
  }
540
608
  this.stateChanges.next();
541
609
  }
610
+ ngOnDestroy() {
611
+ super.ngOnDestroy();
612
+ this.maskedValueSubscription?.unsubscribe();
613
+ }
542
614
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputDatetimeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
543
615
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: InputDatetimeComponent, isStandalone: true, selector: "mcl-input-datetime", inputs: { type: "type", readonly: "readonly", name: "name" }, providers: [
544
616
  {
@@ -575,31 +647,31 @@ class InputDatetimeComponent extends AbstractMatFormFieldControl {
575
647
  useValue: {
576
648
  parse: {
577
649
  dateInput: 'DD/MM/YYYY',
578
- monthInput: "MM/YYYY",
579
- timeInput: "HH:mm",
580
- datetimeInput: "DD/MM/YYYY HH:mm"
650
+ monthInput: 'MM/YYYY',
651
+ timeInput: 'HH:mm',
652
+ datetimeInput: 'DD/MM/YYYY HH:mm'
581
653
  },
582
654
  display: {
583
655
  dateInput: 'DD/MM/YYYY',
584
- monthInput: "MM/YYYY",
585
- timeInput: "HH:mm",
586
- datetimeInput: "DD/MM/YYYY HH:mm",
587
- monthYearLabel: "MMM YYYY",
588
- dateA11yLabel: "LL",
589
- monthYearA11yLabel: "MMMM YYYY",
590
- popupHeaderDateLabel: "ddd, DD MMM"
656
+ monthInput: 'MM/YYYY',
657
+ timeInput: 'HH:mm',
658
+ datetimeInput: 'DD/MM/YYYY HH:mm',
659
+ monthYearLabel: 'MMM YYYY',
660
+ dateA11yLabel: 'LL',
661
+ monthYearA11yLabel: 'MMMM YYYY',
662
+ popupHeaderDateLabel: 'ddd, DD MMM'
591
663
  }
592
664
  }
593
665
  },
594
- ], viewQueries: [{ propertyName: "picker", first: true, predicate: ["pickerData"], descendants: true }, { propertyName: "inputMask", first: true, predicate: ["inputMask"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"dateinput\">\n <mcl-input [disabled]=\"disabled\" [(ngModel)]=\"maskedValue\" [mask]=\"mask\" #inputMask\n (focusin)=\"focused = true\" (focusout)=\"focused = false\" [keepMask]=\"true\"\n />\n <mat-datetimepicker [disabled]=\"disabled || readonly\"\n [type]=\"type\" #pickerData></mat-datetimepicker>\n <mat-datetimepicker-toggle [for]=\"pickerData\"></mat-datetimepicker-toggle>\n</div>\n<input class=\"hidden\" [(ngModel)]=\"value\" [matDatetimepicker]=\"pickerData\"/>\n", styles: [".dateinput{display:flex;align-items:center}.dateinput mcl-input{flex:1 1 auto}.dateinput mat-datetimepicker-toggle{margin:-6px 0}.hidden{display:none}\n"], dependencies: [{ kind: "ngmodule", type: MatDatetimepickerModule }, { kind: "component", type: i1$1.MatDatetimepickerComponent, selector: "mat-datetimepicker", inputs: ["multiYearSelector", "twelvehour", "startView", "mode", "timeInterval", "ariaNextMonthLabel", "ariaPrevMonthLabel", "ariaNextYearLabel", "ariaPrevYearLabel", "preventSameDateTimeSelection", "panelClass", "startAt", "openOnFocus", "type", "touchUi", "disabled"], outputs: ["selectedChanged", "opened", "closed", "viewChanged"], exportAs: ["matDatetimepicker"] }, { kind: "component", type: i1$1.MatDatetimepickerToggleComponent, selector: "mat-datetimepicker-toggle", inputs: ["for", "disabled"], exportAs: ["matDatetimepickerToggle"] }, { kind: "directive", type: i1$1.MatDatetimepickerInputDirective, selector: "input[matDatetimepicker]", inputs: ["matDatetimepicker", "matDatepickerFilter", "value", "min", "max", "disabled"], outputs: ["dateChange", "dateInput"], exportAs: ["matDatepickerInput"] }, { kind: "ngmodule", type: MatMomentDatetimeModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: InputMaskComponent, selector: "mcl-input[mask]", inputs: ["keepMask", "mask"], outputs: ["focusin", "focusout"] }] });
666
+ ], viewQueries: [{ propertyName: "picker", first: true, predicate: ["pickerData"], descendants: true }, { propertyName: "inputMask", first: true, predicate: ["inputMask"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"dateinput\">\n <mcl-input [disabled]=\"disabled\" [formControl]=\"inputControl\" [mask]=\"mask\" #inputMask\n (focusin)=\"focused = true\" (focusout)=\"focused = false\" [keepMask]=\"true\"\n />\n <mat-datetimepicker [disabled]=\"disabled || readonly\"\n [type]=\"type\" #pickerData></mat-datetimepicker>\n <mat-datetimepicker-toggle [for]=\"pickerData\"></mat-datetimepicker-toggle>\n</div>\n<input class=\"hidden\" [formControl]=\"control\" [matDatetimepicker]=\"pickerData\"/>\n", styles: [".dateinput{display:flex;align-items:center}.dateinput mcl-input{flex:1 1 auto}.dateinput mat-datetimepicker-toggle{margin:-6px 0}.hidden{display:none}\n"], dependencies: [{ kind: "ngmodule", type: MatDatetimepickerModule }, { kind: "component", type: i1$1.MatDatetimepickerComponent, selector: "mat-datetimepicker", inputs: ["multiYearSelector", "twelvehour", "startView", "mode", "timeInterval", "ariaNextMonthLabel", "ariaPrevMonthLabel", "ariaNextYearLabel", "ariaPrevYearLabel", "preventSameDateTimeSelection", "panelClass", "startAt", "openOnFocus", "type", "touchUi", "disabled"], outputs: ["selectedChanged", "opened", "closed", "viewChanged"], exportAs: ["matDatetimepicker"] }, { kind: "component", type: i1$1.MatDatetimepickerToggleComponent, selector: "mat-datetimepicker-toggle", inputs: ["for", "disabled"], exportAs: ["matDatetimepickerToggle"] }, { kind: "directive", type: i1$1.MatDatetimepickerInputDirective, selector: "input[matDatetimepicker]", inputs: ["matDatetimepicker", "matDatepickerFilter", "value", "min", "max", "disabled"], outputs: ["dateChange", "dateInput"], exportAs: ["matDatepickerInput"] }, { kind: "ngmodule", type: MatMomentDatetimeModule }, { kind: "component", type: InputMaskComponent, selector: "mcl-input[mask]", inputs: ["keepMask", "mask"], outputs: ["focusin", "focusout"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
595
667
  }
596
668
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputDatetimeComponent, decorators: [{
597
669
  type: Component,
598
670
  args: [{ selector: 'mcl-input-datetime', imports: [
599
671
  MatDatetimepickerModule,
600
672
  MatMomentDatetimeModule,
601
- FormsModule,
602
- InputMaskComponent
673
+ InputMaskComponent,
674
+ ReactiveFormsModule
603
675
  ], providers: [
604
676
  {
605
677
  provide: NG_VALIDATORS,
@@ -635,23 +707,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
635
707
  useValue: {
636
708
  parse: {
637
709
  dateInput: 'DD/MM/YYYY',
638
- monthInput: "MM/YYYY",
639
- timeInput: "HH:mm",
640
- datetimeInput: "DD/MM/YYYY HH:mm"
710
+ monthInput: 'MM/YYYY',
711
+ timeInput: 'HH:mm',
712
+ datetimeInput: 'DD/MM/YYYY HH:mm'
641
713
  },
642
714
  display: {
643
715
  dateInput: 'DD/MM/YYYY',
644
- monthInput: "MM/YYYY",
645
- timeInput: "HH:mm",
646
- datetimeInput: "DD/MM/YYYY HH:mm",
647
- monthYearLabel: "MMM YYYY",
648
- dateA11yLabel: "LL",
649
- monthYearA11yLabel: "MMMM YYYY",
650
- popupHeaderDateLabel: "ddd, DD MMM"
716
+ monthInput: 'MM/YYYY',
717
+ timeInput: 'HH:mm',
718
+ datetimeInput: 'DD/MM/YYYY HH:mm',
719
+ monthYearLabel: 'MMM YYYY',
720
+ dateA11yLabel: 'LL',
721
+ monthYearA11yLabel: 'MMMM YYYY',
722
+ popupHeaderDateLabel: 'ddd, DD MMM'
651
723
  }
652
724
  }
653
725
  },
654
- ], template: "<div class=\"dateinput\">\n <mcl-input [disabled]=\"disabled\" [(ngModel)]=\"maskedValue\" [mask]=\"mask\" #inputMask\n (focusin)=\"focused = true\" (focusout)=\"focused = false\" [keepMask]=\"true\"\n />\n <mat-datetimepicker [disabled]=\"disabled || readonly\"\n [type]=\"type\" #pickerData></mat-datetimepicker>\n <mat-datetimepicker-toggle [for]=\"pickerData\"></mat-datetimepicker-toggle>\n</div>\n<input class=\"hidden\" [(ngModel)]=\"value\" [matDatetimepicker]=\"pickerData\"/>\n", styles: [".dateinput{display:flex;align-items:center}.dateinput mcl-input{flex:1 1 auto}.dateinput mat-datetimepicker-toggle{margin:-6px 0}.hidden{display:none}\n"] }]
726
+ ], template: "<div class=\"dateinput\">\n <mcl-input [disabled]=\"disabled\" [formControl]=\"inputControl\" [mask]=\"mask\" #inputMask\n (focusin)=\"focused = true\" (focusout)=\"focused = false\" [keepMask]=\"true\"\n />\n <mat-datetimepicker [disabled]=\"disabled || readonly\"\n [type]=\"type\" #pickerData></mat-datetimepicker>\n <mat-datetimepicker-toggle [for]=\"pickerData\"></mat-datetimepicker-toggle>\n</div>\n<input class=\"hidden\" [formControl]=\"control\" [matDatetimepicker]=\"pickerData\"/>\n", styles: [".dateinput{display:flex;align-items:center}.dateinput mcl-input{flex:1 1 auto}.dateinput mat-datetimepicker-toggle{margin:-6px 0}.hidden{display:none}\n"] }]
655
727
  }], ctorParameters: () => [], propDecorators: { type: [{
656
728
  type: Input
657
729
  }], readonly: [{
@@ -666,6 +738,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
666
738
  args: ['inputMask']
667
739
  }] } });
668
740
 
741
+ class InputFileUploadValidatorDirective {
742
+ multiple = false;
743
+ validate(control) {
744
+ if (control.value) {
745
+ if (this.multiple && Array.isArray(control.value)) {
746
+ const error = control.value.find(a => a.loading && a.error);
747
+ if (error) {
748
+ return error.error;
749
+ }
750
+ if (control.value.find(a => a.loading)) {
751
+ return { fileUploading: true };
752
+ }
753
+ }
754
+ else if (control.value.loading && control.value.error) {
755
+ return control.value.error;
756
+ }
757
+ else if (control.value.loading) {
758
+ return { fileUploading: true };
759
+ }
760
+ }
761
+ return null;
762
+ }
763
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputFileUploadValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
764
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: InputFileUploadValidatorDirective, isStandalone: true, selector: "mcl-input-fileupload,[mclFileupload]", inputs: { multiple: "multiple" }, providers: [{ provide: NG_VALIDATORS, useExisting: InputFileUploadValidatorDirective, multi: true }], ngImport: i0 });
765
+ }
766
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputFileUploadValidatorDirective, decorators: [{
767
+ type: Directive,
768
+ args: [{
769
+ selector: 'mcl-input-fileupload,[mclFileupload]',
770
+ providers: [{ provide: NG_VALIDATORS, useExisting: InputFileUploadValidatorDirective, multi: true }]
771
+ }]
772
+ }], propDecorators: { multiple: [{
773
+ type: Input
774
+ }] } });
775
+
669
776
  class InputFileUploadComponent {
670
777
  errorStateMatcher;
671
778
  ngControl;
@@ -962,6 +1069,11 @@ class InputFileUploadComponent {
962
1069
  {
963
1070
  provide: MatFormFieldControl,
964
1071
  useExisting: InputFileUploadComponent
1072
+ },
1073
+ {
1074
+ provide: NG_VALIDATORS,
1075
+ useClass: InputFileUploadValidatorDirective,
1076
+ multi: true
965
1077
  }
966
1078
  ], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "@if (multiple && template == 'chips') {\r\n <div class=\"chips\">\r\n @if (value?.length) {\r\n <mat-chip-grid>\r\n @for (arquivo of value; track arquivo) {\r\n <mat-chip [ngClass]=\"{'error':arquivo.loading && arquivo.error,'success':!arquivo.loading}\">\r\n @if (arquivo.loading && !arquivo.error) {\r\n <mat-spinner [value]=\"arquivo.progresso\" [diameter]=\"24\"></mat-spinner>\r\n }\r\n @if (arquivo.loading && arquivo.error) {\r\n <mat-icon class=\"error\">remove_circle_outline</mat-icon>\r\n }\r\n @if (!arquivo.loading) {\r\n <mat-icon class=\"success\">check_circle_outline</mat-icon>\r\n }\r\n {{ arquivo.nome || arquivo.filename }}\r\n @if (!disabled) {\r\n <a (click)=\"remover(arquivo)\" href=\"javascript:void(0)\">\r\n <mat-icon>close</mat-icon>\r\n </a>\r\n }\r\n </mat-chip>\r\n }\r\n </mat-chip-grid>\r\n }\r\n\r\n @if (value?.length && !disabled) {\r\n <hr/>\r\n }\r\n\r\n @if (!disabled) {\r\n <input type=\"file\" (change)=\"onFileChange($event)\" #input [multiple]=\"multiple\"/>\r\n }\r\n </div>\r\n}\r\n\r\n@if (multiple && template == 'preview') {\r\n <div class=\"previews\">\r\n @if (value?.length) {\r\n <div fxLayout=\"row wrap\" fxLayoutGap=\"20px\" fxFlexAlign=\"center\">\r\n @for (arquivo of value; track arquivo) {\r\n <div>\r\n <div class=\"preview\" [ngClass]=\"{'error':arquivo.loading && arquivo.error,'success':!arquivo.loading}\">\r\n <mcl-preview-arquivo [group]=\"value\" [arquivo]=\"arquivo\"></mcl-preview-arquivo>\r\n\r\n @if (!disabled) {\r\n <div class=\"footer\">\r\n @if (arquivo.loading && !arquivo.error) {\r\n <mat-spinner [value]=\"arquivo.progresso\" [diameter]=\"24\"\r\n ></mat-spinner>\r\n }\r\n @if (arquivo.loading && arquivo.error) {\r\n <mat-icon class=\"error\">remove_circle_outline</mat-icon>\r\n }\r\n @if (!arquivo.loading) {\r\n <mat-icon class=\"success\">check_circle_outline</mat-icon>\r\n }\r\n <span>{{ arquivo.nome || arquivo.filename }}</span>\r\n @if (!disabled) {\r\n <a (click)=\"remover(arquivo)\" href=\"javascript:void(0)\">\r\n <mat-icon>close</mat-icon>\r\n </a>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n\r\n </div>\r\n }\r\n\r\n @if (value?.length && !disabled) {\r\n <hr/>\r\n }\r\n\r\n @if (!disabled) {\r\n <input type=\"file\" (change)=\"onFileChange($event)\" #input [multiple]=\"multiple\"/>\r\n }\r\n </div>\r\n}\r\n\r\n@if (template == 'manual') {\r\n <div>\r\n <input type=\"file\" [disabled]=\"disabled\" (change)=\"onFileChange($event)\" #input\r\n [multiple]=\"multiple\" style=\"display: none\"/>\r\n </div>\r\n}\r\n\r\n@if (!multiple && template != 'manual') {\r\n <input #input type=\"file\" style=\"display: none\"\r\n (change)=\"onFileChange($event)\"/>\r\n\r\n <div class=\"input\">\r\n @if (!value) {\r\n <button mat-icon-button type=\"button\"\r\n (click)=\"openFileChooser()\"\r\n matPrefix>\r\n <mat-icon>attach_file</mat-icon>\r\n </button>\r\n }\r\n @if (value && !value.loading && !value.error) {\r\n <button mat-icon-button type=\"button\"\r\n [mclDownloadArquivo]=\"value\"\r\n matPrefix>\r\n <mat-icon>download</mat-icon>\r\n </button>\r\n }\r\n @if (value?.error) {\r\n <button mat-icon-button type=\"button\" matPrefixdisabled>\r\n <mat-icon>warning</mat-icon>\r\n </button>\r\n }\r\n @if (value?.loading && !value?.error) {\r\n <button mat-icon-button type=\"button\" matPrefix disabled>\r\n <mat-spinner [value]=\"value.progresso\"\r\n [diameter]=\"24\"></mat-spinner>\r\n </button>\r\n }\r\n @if (!value) {\r\n <input matInput readonly (click)=\"openFileChooser()\" [required]=\"required\"\r\n value=\"Selecione um arquivo...\"/>\r\n }\r\n @if (value && value.loading && !value.error) {\r\n <input matInput readonly [required]=\"required\"\r\n value=\"Submetendo arquivo...\"/>\r\n }\r\n @if (value && value.error) {\r\n <input matInput readonly [required]=\"required\"\r\n [value]=\"value?.nome || value?.filename\"/>\r\n }\r\n @if (value && !value.loading) {\r\n <input matInput readonly [mclDownloadArquivo]=\"value\" [required]=\"required\"\r\n [value]=\"value?.nome || value?.filename\"/>\r\n }\r\n @if (value && (!value.loading || value?.error) && !disabled) {\r\n <button mat-icon-button type=\"button\" matSuffix\r\n matTooltip=\"Remover\" (click)=\"remover(value)\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n }\r\n </div>\r\n}\r\n", styles: ["span{opacity:0;transition:opacity .2s}:host.floating span{opacity:1}mat-chip>mat-spinner,mat-chip>mat-icon,.preview .footer>mat-spinner,.preview .footer>mat-icon{margin-right:5px;vertical-align:middle}mat-chip a,.preview .footer a{padding:5px}mat-chip a mat-icon,.preview .footer a mat-icon{margin-left:10px;vertical-align:middle}mat-chip.error,.preview.error{color:red}mat-chip.success,.preview.success{color:green}.preview{text-align:center;width:200px;overflow:hidden;margin:0 auto 20px}.preview mcl-preview-arquivo{margin:auto;display:block}.preview .footer{display:flex;text-align:left}.preview .footer span{flex:1 1 auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.preview .footer mat-icon,.preview .footer a{flex:1}.input{display:flex;align-items:center}.input button{margin:-6px 0}.input input{flex:1 1 auto}\n"], dependencies: [{ kind: "component", type: MatChipGrid, selector: "mat-chip-grid", inputs: ["disabled", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["change", "valueChange"] }, { kind: "component", type: MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: PreviewArquivoComponent, selector: "mcl-preview-arquivo", inputs: ["showLoading", "height", "width", "group", "arquivo"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: DownloadArquivoDirective, selector: "[mclDownloadArquivo]", inputs: ["mclDownloadArquivo", "target"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }] });
967
1079
  }
@@ -984,6 +1096,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
984
1096
  {
985
1097
  provide: MatFormFieldControl,
986
1098
  useExisting: InputFileUploadComponent
1099
+ },
1100
+ {
1101
+ provide: NG_VALIDATORS,
1102
+ useClass: InputFileUploadValidatorDirective,
1103
+ multi: true
987
1104
  }
988
1105
  ], template: "@if (multiple && template == 'chips') {\r\n <div class=\"chips\">\r\n @if (value?.length) {\r\n <mat-chip-grid>\r\n @for (arquivo of value; track arquivo) {\r\n <mat-chip [ngClass]=\"{'error':arquivo.loading && arquivo.error,'success':!arquivo.loading}\">\r\n @if (arquivo.loading && !arquivo.error) {\r\n <mat-spinner [value]=\"arquivo.progresso\" [diameter]=\"24\"></mat-spinner>\r\n }\r\n @if (arquivo.loading && arquivo.error) {\r\n <mat-icon class=\"error\">remove_circle_outline</mat-icon>\r\n }\r\n @if (!arquivo.loading) {\r\n <mat-icon class=\"success\">check_circle_outline</mat-icon>\r\n }\r\n {{ arquivo.nome || arquivo.filename }}\r\n @if (!disabled) {\r\n <a (click)=\"remover(arquivo)\" href=\"javascript:void(0)\">\r\n <mat-icon>close</mat-icon>\r\n </a>\r\n }\r\n </mat-chip>\r\n }\r\n </mat-chip-grid>\r\n }\r\n\r\n @if (value?.length && !disabled) {\r\n <hr/>\r\n }\r\n\r\n @if (!disabled) {\r\n <input type=\"file\" (change)=\"onFileChange($event)\" #input [multiple]=\"multiple\"/>\r\n }\r\n </div>\r\n}\r\n\r\n@if (multiple && template == 'preview') {\r\n <div class=\"previews\">\r\n @if (value?.length) {\r\n <div fxLayout=\"row wrap\" fxLayoutGap=\"20px\" fxFlexAlign=\"center\">\r\n @for (arquivo of value; track arquivo) {\r\n <div>\r\n <div class=\"preview\" [ngClass]=\"{'error':arquivo.loading && arquivo.error,'success':!arquivo.loading}\">\r\n <mcl-preview-arquivo [group]=\"value\" [arquivo]=\"arquivo\"></mcl-preview-arquivo>\r\n\r\n @if (!disabled) {\r\n <div class=\"footer\">\r\n @if (arquivo.loading && !arquivo.error) {\r\n <mat-spinner [value]=\"arquivo.progresso\" [diameter]=\"24\"\r\n ></mat-spinner>\r\n }\r\n @if (arquivo.loading && arquivo.error) {\r\n <mat-icon class=\"error\">remove_circle_outline</mat-icon>\r\n }\r\n @if (!arquivo.loading) {\r\n <mat-icon class=\"success\">check_circle_outline</mat-icon>\r\n }\r\n <span>{{ arquivo.nome || arquivo.filename }}</span>\r\n @if (!disabled) {\r\n <a (click)=\"remover(arquivo)\" href=\"javascript:void(0)\">\r\n <mat-icon>close</mat-icon>\r\n </a>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n\r\n </div>\r\n }\r\n\r\n @if (value?.length && !disabled) {\r\n <hr/>\r\n }\r\n\r\n @if (!disabled) {\r\n <input type=\"file\" (change)=\"onFileChange($event)\" #input [multiple]=\"multiple\"/>\r\n }\r\n </div>\r\n}\r\n\r\n@if (template == 'manual') {\r\n <div>\r\n <input type=\"file\" [disabled]=\"disabled\" (change)=\"onFileChange($event)\" #input\r\n [multiple]=\"multiple\" style=\"display: none\"/>\r\n </div>\r\n}\r\n\r\n@if (!multiple && template != 'manual') {\r\n <input #input type=\"file\" style=\"display: none\"\r\n (change)=\"onFileChange($event)\"/>\r\n\r\n <div class=\"input\">\r\n @if (!value) {\r\n <button mat-icon-button type=\"button\"\r\n (click)=\"openFileChooser()\"\r\n matPrefix>\r\n <mat-icon>attach_file</mat-icon>\r\n </button>\r\n }\r\n @if (value && !value.loading && !value.error) {\r\n <button mat-icon-button type=\"button\"\r\n [mclDownloadArquivo]=\"value\"\r\n matPrefix>\r\n <mat-icon>download</mat-icon>\r\n </button>\r\n }\r\n @if (value?.error) {\r\n <button mat-icon-button type=\"button\" matPrefixdisabled>\r\n <mat-icon>warning</mat-icon>\r\n </button>\r\n }\r\n @if (value?.loading && !value?.error) {\r\n <button mat-icon-button type=\"button\" matPrefix disabled>\r\n <mat-spinner [value]=\"value.progresso\"\r\n [diameter]=\"24\"></mat-spinner>\r\n </button>\r\n }\r\n @if (!value) {\r\n <input matInput readonly (click)=\"openFileChooser()\" [required]=\"required\"\r\n value=\"Selecione um arquivo...\"/>\r\n }\r\n @if (value && value.loading && !value.error) {\r\n <input matInput readonly [required]=\"required\"\r\n value=\"Submetendo arquivo...\"/>\r\n }\r\n @if (value && value.error) {\r\n <input matInput readonly [required]=\"required\"\r\n [value]=\"value?.nome || value?.filename\"/>\r\n }\r\n @if (value && !value.loading) {\r\n <input matInput readonly [mclDownloadArquivo]=\"value\" [required]=\"required\"\r\n [value]=\"value?.nome || value?.filename\"/>\r\n }\r\n @if (value && (!value.loading || value?.error) && !disabled) {\r\n <button mat-icon-button type=\"button\" matSuffix\r\n matTooltip=\"Remover\" (click)=\"remover(value)\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n }\r\n </div>\r\n}\r\n", styles: ["span{opacity:0;transition:opacity .2s}:host.floating span{opacity:1}mat-chip>mat-spinner,mat-chip>mat-icon,.preview .footer>mat-spinner,.preview .footer>mat-icon{margin-right:5px;vertical-align:middle}mat-chip a,.preview .footer a{padding:5px}mat-chip a mat-icon,.preview .footer a mat-icon{margin-left:10px;vertical-align:middle}mat-chip.error,.preview.error{color:red}mat-chip.success,.preview.success{color:green}.preview{text-align:center;width:200px;overflow:hidden;margin:0 auto 20px}.preview mcl-preview-arquivo{margin:auto;display:block}.preview .footer{display:flex;text-align:left}.preview .footer span{flex:1 1 auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.preview .footer mat-icon,.preview .footer a{flex:1}.input{display:flex;align-items:center}.input button{margin:-6px 0}.input input{flex:1 1 auto}\n"] }]
989
1106
  }], ctorParameters: () => [{ type: i1$2.ErrorStateMatcher }, { type: i1.NgControl, decorators: [{
@@ -1033,41 +1150,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
1033
1150
  type: Input
1034
1151
  }] } });
1035
1152
 
1036
- class InputFileUploadValidatorDirective {
1037
- multiple = false;
1038
- validate(control) {
1039
- if (control.value) {
1040
- if (this.multiple && Array.isArray(control.value)) {
1041
- const error = control.value.find(a => a.loading && a.error);
1042
- if (error) {
1043
- return error.error;
1044
- }
1045
- if (control.value.find(a => a.loading)) {
1046
- return { fileUploading: true };
1047
- }
1048
- }
1049
- else if (control.value.loading && control.value.error) {
1050
- return control.value.error;
1051
- }
1052
- else if (control.value.loading) {
1053
- return { fileUploading: true };
1054
- }
1055
- }
1056
- return null;
1057
- }
1058
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputFileUploadValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1059
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: InputFileUploadValidatorDirective, isStandalone: true, selector: "mcl-input-fileupload,[mclFileupload]", inputs: { multiple: "multiple" }, providers: [{ provide: NG_VALIDATORS, useExisting: InputFileUploadValidatorDirective, multi: true }], ngImport: i0 });
1060
- }
1061
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputFileUploadValidatorDirective, decorators: [{
1062
- type: Directive,
1063
- args: [{
1064
- selector: 'mcl-input-fileupload,[mclFileupload]',
1065
- providers: [{ provide: NG_VALIDATORS, useExisting: InputFileUploadValidatorDirective, multi: true }]
1066
- }]
1067
- }], propDecorators: { multiple: [{
1068
- type: Input
1069
- }] } });
1070
-
1071
1153
  class InputCnpjComponent extends InputMaskComponent {
1072
1154
  constructor() {
1073
1155
  super();
@@ -1078,20 +1160,30 @@ class InputCnpjComponent extends InputMaskComponent {
1078
1160
  {
1079
1161
  provide: MatFormFieldControl,
1080
1162
  useExisting: InputCnpjComponent
1163
+ },
1164
+ {
1165
+ provide: NG_VALIDATORS,
1166
+ useFactory: () => new InputMaskValidatorDirective(() => '##.###.###/####-##'),
1167
+ multi: true
1081
1168
  }
1082
- ], usesInheritance: true, ngImport: i0, template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n", styles: [""], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
1169
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput [formControl]=\"control\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n", styles: [""], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
1083
1170
  }
1084
1171
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCnpjComponent, decorators: [{
1085
1172
  type: Component,
1086
1173
  args: [{ selector: 'mcl-input[cnpj]', imports: [
1087
1174
  MatInput,
1088
- FormsModule
1175
+ ReactiveFormsModule
1089
1176
  ], providers: [
1090
1177
  {
1091
1178
  provide: MatFormFieldControl,
1092
1179
  useExisting: InputCnpjComponent
1180
+ },
1181
+ {
1182
+ provide: NG_VALIDATORS,
1183
+ useFactory: () => new InputMaskValidatorDirective(() => '##.###.###/####-##'),
1184
+ multi: true
1093
1185
  }
1094
- ], template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n" }]
1186
+ ], template: "<input matInput [formControl]=\"control\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n" }]
1095
1187
  }], ctorParameters: () => [] });
1096
1188
 
1097
1189
  class InputCepComponent extends InputMaskComponent {
@@ -1104,36 +1196,49 @@ class InputCepComponent extends InputMaskComponent {
1104
1196
  {
1105
1197
  provide: MatFormFieldControl,
1106
1198
  useExisting: InputCepComponent
1199
+ },
1200
+ {
1201
+ provide: NG_VALIDATORS,
1202
+ useFactory: () => new InputMaskValidatorDirective(() => '##.###-###'),
1203
+ multi: true
1107
1204
  }
1108
- ], usesInheritance: true, ngImport: i0, template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n", styles: [""], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
1205
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput [formControl]=\"control\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n", styles: [""], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
1109
1206
  }
1110
1207
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCepComponent, decorators: [{
1111
1208
  type: Component,
1112
1209
  args: [{ selector: 'mcl-input[cep]', imports: [
1113
1210
  MatInput,
1114
- FormsModule
1211
+ ReactiveFormsModule
1115
1212
  ], providers: [
1116
1213
  {
1117
1214
  provide: MatFormFieldControl,
1118
1215
  useExisting: InputCepComponent
1216
+ },
1217
+ {
1218
+ provide: NG_VALIDATORS,
1219
+ useFactory: () => new InputMaskValidatorDirective(() => '##.###-###'),
1220
+ multi: true
1119
1221
  }
1120
- ], template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n" }]
1222
+ ], template: "<input matInput [formControl]=\"control\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n" }]
1121
1223
  }], ctorParameters: () => [] });
1122
1224
 
1225
+ function resolveMask$1(value) {
1226
+ if (value.length > 11) {
1227
+ return '##.###.###/####-##';
1228
+ }
1229
+ else {
1230
+ return '###.###.###-##';
1231
+ }
1232
+ }
1123
1233
  class InputCpfCnpjComponent extends InputMaskComponent {
1124
1234
  get value() {
1125
1235
  return super.value;
1126
1236
  }
1127
1237
  set value(value) {
1128
- const unmasked = this.removeMask(value);
1238
+ const unmasked = removeMask(value, '##.###.###/####-##');
1129
1239
  if (!!unmasked) {
1130
- if (unmasked.length > 11) {
1131
- this.$mask = '##.###.###/####-##';
1132
- }
1133
- else {
1134
- this.$mask = '###.###.###-##';
1135
- }
1136
- super.value = value;
1240
+ this.$mask = resolveMask$1(unmasked);
1241
+ this.reinforceMask();
1137
1242
  }
1138
1243
  }
1139
1244
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCpfCnpjComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
@@ -1141,20 +1246,30 @@ class InputCpfCnpjComponent extends InputMaskComponent {
1141
1246
  {
1142
1247
  provide: MatFormFieldControl,
1143
1248
  useExisting: InputCpfCnpjComponent
1249
+ },
1250
+ {
1251
+ provide: NG_VALIDATORS,
1252
+ useFactory: () => new InputMaskValidatorDirective(resolveMask$1),
1253
+ multi: true
1144
1254
  }
1145
- ], usesInheritance: true, ngImport: i0, template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n", styles: [""], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
1255
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput [formControl]=\"control\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n", styles: [""], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
1146
1256
  }
1147
1257
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCpfCnpjComponent, decorators: [{
1148
1258
  type: Component,
1149
1259
  args: [{ selector: 'mcl-input[cpfCnpj]', imports: [
1150
1260
  MatInput,
1151
- FormsModule
1261
+ ReactiveFormsModule
1152
1262
  ], providers: [
1153
1263
  {
1154
1264
  provide: MatFormFieldControl,
1155
1265
  useExisting: InputCpfCnpjComponent
1266
+ },
1267
+ {
1268
+ provide: NG_VALIDATORS,
1269
+ useFactory: () => new InputMaskValidatorDirective(resolveMask$1),
1270
+ multi: true
1156
1271
  }
1157
- ], template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n" }]
1272
+ ], template: "<input matInput [formControl]=\"control\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n" }]
1158
1273
  }] });
1159
1274
 
1160
1275
  class InputCpfComponent extends InputMaskComponent {
@@ -1167,32 +1282,45 @@ class InputCpfComponent extends InputMaskComponent {
1167
1282
  {
1168
1283
  provide: MatFormFieldControl,
1169
1284
  useExisting: InputCpfComponent
1285
+ },
1286
+ {
1287
+ provide: NG_VALIDATORS,
1288
+ useFactory: () => new InputMaskValidatorDirective(() => '###.###.###-##'),
1289
+ multi: true
1170
1290
  }
1171
- ], usesInheritance: true, ngImport: i0, template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n", styles: [""], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
1291
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput [formControl]=\"control\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n", styles: [""], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
1172
1292
  }
1173
1293
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputCpfComponent, decorators: [{
1174
1294
  type: Component,
1175
1295
  args: [{ selector: 'mcl-input[cpf]', imports: [
1176
1296
  MatInput,
1177
- FormsModule
1297
+ ReactiveFormsModule
1178
1298
  ], providers: [
1179
1299
  {
1180
1300
  provide: MatFormFieldControl,
1181
1301
  useExisting: InputCpfComponent
1302
+ },
1303
+ {
1304
+ provide: NG_VALIDATORS,
1305
+ useFactory: () => new InputMaskValidatorDirective(() => '###.###.###-##'),
1306
+ multi: true
1182
1307
  }
1183
- ], template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n" }]
1308
+ ], template: "<input matInput [formControl]=\"control\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n" }]
1184
1309
  }], ctorParameters: () => [] });
1185
1310
 
1311
+ function resolveMask(value) {
1312
+ if (value.length > 2 && value[2] === '9') {
1313
+ return '(##) #####-####';
1314
+ }
1315
+ else {
1316
+ return '(##) ####-####';
1317
+ }
1318
+ }
1186
1319
  class InputPhoneComponent extends InputMaskComponent {
1187
1320
  applyMask(value) {
1188
1321
  if (value) {
1189
- const unmasked = this.removeMask(value);
1190
- if (unmasked.length > 2 && unmasked[2] === '9') {
1191
- this.$mask = '(##) #####-####';
1192
- }
1193
- else {
1194
- this.$mask = '(##) ####-####';
1195
- }
1322
+ const unmasked = removeMask(value, '(##) #####-####') || '';
1323
+ this.$mask = resolveMask(unmasked);
1196
1324
  }
1197
1325
  return super.applyMask(value);
1198
1326
  }
@@ -1201,20 +1329,30 @@ class InputPhoneComponent extends InputMaskComponent {
1201
1329
  {
1202
1330
  provide: MatFormFieldControl,
1203
1331
  useExisting: InputPhoneComponent
1332
+ },
1333
+ {
1334
+ provide: NG_VALIDATORS,
1335
+ useFactory: () => new InputMaskValidatorDirective(resolveMask),
1336
+ multi: true
1204
1337
  }
1205
- ], usesInheritance: true, ngImport: i0, template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n", styles: [""], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
1338
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput [formControl]=\"control\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n", styles: [""], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
1206
1339
  }
1207
1340
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputPhoneComponent, decorators: [{
1208
1341
  type: Component,
1209
1342
  args: [{ selector: 'mcl-input[phone]', imports: [
1210
1343
  MatInput,
1211
- FormsModule
1344
+ ReactiveFormsModule
1212
1345
  ], providers: [
1213
1346
  {
1214
1347
  provide: MatFormFieldControl,
1215
1348
  useExisting: InputPhoneComponent
1349
+ },
1350
+ {
1351
+ provide: NG_VALIDATORS,
1352
+ useFactory: () => new InputMaskValidatorDirective(resolveMask),
1353
+ multi: true
1216
1354
  }
1217
- ], template: "<input matInput [(ngModel)]=\"value\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n" }]
1355
+ ], template: "<input matInput [formControl]=\"control\" #input\n [placeholder]=\"placeholder\"\n (focusin)=\"focusin()\" (focusout)=\"focusout()\"/>\n" }]
1218
1356
  }] });
1219
1357
 
1220
1358
  class OptionNode {
@@ -1676,7 +1814,7 @@ class SelectAutocompleteComponent extends AbstractMatFormFieldSelectControl {
1676
1814
  provide: MatFormFieldControl,
1677
1815
  useExisting: SelectAutocompleteComponent
1678
1816
  }
1679
- ], usesInheritance: true, ngImport: i0, template: "<input matInput name=\"autocomplete\" autocomplete=\"off\" #input\n [formControl]=\"control\" [matAutocomplete]=\"autocompleteGeneric\"\n (keyup)=\"didTouch()\" (focus)=\"onFocus()\" (blur)=\"onBlur()\"\n [disabled]=\"disabled\" [readonly]=\"readonly\"/>\n<mat-autocomplete #autocompleteGeneric=\"matAutocomplete\"\n (optionSelected)=\"seleciona($event)\">\n @for (opcao of filteredOptions | async; track doTrackBy(opcao.value)) {\n <mat-option [value]=\"opcao.value\">\n {{ opcao.label }}\n </mat-option>\n }\n</mat-autocomplete>\n", styles: [".mat-option{line-height:inherit;height:inherit}h3{color:#333;margin:5px;white-space:nowrap;font-size:16px}p{color:#666;margin:5px;white-space:nowrap;font-size:12px}\n"], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "pipe", type: AsyncPipe, name: "async" }] });
1817
+ ], usesInheritance: true, ngImport: i0, template: "<input matInput name=\"autocomplete\" autocomplete=\"off\" #input\n [formControl]=\"inputControl\" [matAutocomplete]=\"autocompleteGeneric\"\n (keyup)=\"didTouch()\" (focus)=\"onFocus()\" (blur)=\"onBlur()\"\n [disabled]=\"disabled\" [readonly]=\"readonly\"/>\n<mat-autocomplete #autocompleteGeneric=\"matAutocomplete\"\n (optionSelected)=\"seleciona($event)\">\n @for (opcao of filteredOptions | async; track doTrackBy(opcao.value)) {\n <mat-option [value]=\"opcao.value\">\n {{ opcao.label }}\n </mat-option>\n }\n</mat-autocomplete>\n", styles: [".mat-option{line-height:inherit;height:inherit}h3{color:#333;margin:5px;white-space:nowrap;font-size:16px}p{color:#666;margin:5px;white-space:nowrap;font-size:12px}\n"], dependencies: [{ kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "pipe", type: AsyncPipe, name: "async" }] });
1680
1818
  }
1681
1819
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectAutocompleteComponent, decorators: [{
1682
1820
  type: Component,
@@ -1692,7 +1830,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
1692
1830
  provide: MatFormFieldControl,
1693
1831
  useExisting: SelectAutocompleteComponent
1694
1832
  }
1695
- ], template: "<input matInput name=\"autocomplete\" autocomplete=\"off\" #input\n [formControl]=\"control\" [matAutocomplete]=\"autocompleteGeneric\"\n (keyup)=\"didTouch()\" (focus)=\"onFocus()\" (blur)=\"onBlur()\"\n [disabled]=\"disabled\" [readonly]=\"readonly\"/>\n<mat-autocomplete #autocompleteGeneric=\"matAutocomplete\"\n (optionSelected)=\"seleciona($event)\">\n @for (opcao of filteredOptions | async; track doTrackBy(opcao.value)) {\n <mat-option [value]=\"opcao.value\">\n {{ opcao.label }}\n </mat-option>\n }\n</mat-autocomplete>\n", styles: [".mat-option{line-height:inherit;height:inherit}h3{color:#333;margin:5px;white-space:nowrap;font-size:16px}p{color:#666;margin:5px;white-space:nowrap;font-size:12px}\n"] }]
1833
+ ], template: "<input matInput name=\"autocomplete\" autocomplete=\"off\" #input\n [formControl]=\"inputControl\" [matAutocomplete]=\"autocompleteGeneric\"\n (keyup)=\"didTouch()\" (focus)=\"onFocus()\" (blur)=\"onBlur()\"\n [disabled]=\"disabled\" [readonly]=\"readonly\"/>\n<mat-autocomplete #autocompleteGeneric=\"matAutocomplete\"\n (optionSelected)=\"seleciona($event)\">\n @for (opcao of filteredOptions | async; track doTrackBy(opcao.value)) {\n <mat-option [value]=\"opcao.value\">\n {{ opcao.label }}\n </mat-option>\n }\n</mat-autocomplete>\n", styles: [".mat-option{line-height:inherit;height:inherit}h3{color:#333;margin:5px;white-space:nowrap;font-size:16px}p{color:#666;margin:5px;white-space:nowrap;font-size:12px}\n"] }]
1696
1834
  }], propDecorators: { readonly: [{
1697
1835
  type: Input
1698
1836
  }], select: [{
@@ -1805,40 +1943,60 @@ class SelectRadioComponent extends AbstractMatFormFieldSelectControl {
1805
1943
  provide: MatFormFieldControl,
1806
1944
  useExisting: SelectRadioComponent
1807
1945
  }
1808
- ], usesInheritance: true, ngImport: i0, template: "<mat-radio-group\n [ngClass]=\"{'vertical':layout === 'vertical','horizontal':layout ==='horizontal'}\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"value\">\n\n @for (opcao of filteredOptions | async; track doTrackBy(opcao.value)) {\n <mat-radio-button [value]=\"opcao.value\">{{ opcao.label }}</mat-radio-button>\n }\n\n</mat-radio-group>\n", styles: ["mat-radio-group{display:flex}mat-radio-group.horizontal{flex-direction:row}mat-radio-group.vertical{flex-direction:column}mat-radio-group mat-radio-button{flex:1}@media (max-width: 750px){mat-radio-group.horizontal,mat-radio-group.vertical{flex-direction:column}mat-radio-group.horizontal mat-radio-button,mat-radio-group.vertical mat-radio-button{margin:10px 0}}\n"], dependencies: [{ kind: "directive", type: MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "pipe", type: AsyncPipe, name: "async" }] });
1946
+ ], usesInheritance: true, ngImport: i0, template: "<mat-radio-group\n [ngClass]=\"{'vertical':layout === 'vertical','horizontal':layout ==='horizontal'}\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [formControl]=\"control\">\n\n @for (opcao of filteredOptions | async; track doTrackBy(opcao.value)) {\n <mat-radio-button [value]=\"opcao.value\">{{ opcao.label }}</mat-radio-button>\n }\n\n</mat-radio-group>\n", styles: ["mat-radio-group{display:flex}mat-radio-group.horizontal{flex-direction:row}mat-radio-group.vertical{flex-direction:column}mat-radio-group mat-radio-button{flex:1}@media (max-width: 750px){mat-radio-group.horizontal,mat-radio-group.vertical{flex-direction:column}mat-radio-group.horizontal mat-radio-button,mat-radio-group.vertical mat-radio-button{margin:10px 0}}\n"], dependencies: [{ kind: "directive", type: MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
1809
1947
  }
1810
1948
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectRadioComponent, decorators: [{
1811
1949
  type: Component,
1812
1950
  args: [{ selector: 'mcl-select-radio', imports: [
1813
1951
  MatRadioGroup,
1814
1952
  NgClass,
1815
- FormsModule,
1816
1953
  MatRadioButton,
1817
- AsyncPipe
1954
+ AsyncPipe,
1955
+ ReactiveFormsModule
1818
1956
  ], providers: [
1819
1957
  {
1820
1958
  provide: MatFormFieldControl,
1821
1959
  useExisting: SelectRadioComponent
1822
1960
  }
1823
- ], template: "<mat-radio-group\n [ngClass]=\"{'vertical':layout === 'vertical','horizontal':layout ==='horizontal'}\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"value\">\n\n @for (opcao of filteredOptions | async; track doTrackBy(opcao.value)) {\n <mat-radio-button [value]=\"opcao.value\">{{ opcao.label }}</mat-radio-button>\n }\n\n</mat-radio-group>\n", styles: ["mat-radio-group{display:flex}mat-radio-group.horizontal{flex-direction:row}mat-radio-group.vertical{flex-direction:column}mat-radio-group mat-radio-button{flex:1}@media (max-width: 750px){mat-radio-group.horizontal,mat-radio-group.vertical{flex-direction:column}mat-radio-group.horizontal mat-radio-button,mat-radio-group.vertical mat-radio-button{margin:10px 0}}\n"] }]
1961
+ ], template: "<mat-radio-group\n [ngClass]=\"{'vertical':layout === 'vertical','horizontal':layout ==='horizontal'}\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [formControl]=\"control\">\n\n @for (opcao of filteredOptions | async; track doTrackBy(opcao.value)) {\n <mat-radio-button [value]=\"opcao.value\">{{ opcao.label }}</mat-radio-button>\n }\n\n</mat-radio-group>\n", styles: ["mat-radio-group{display:flex}mat-radio-group.horizontal{flex-direction:row}mat-radio-group.vertical{flex-direction:column}mat-radio-group mat-radio-button{flex:1}@media (max-width: 750px){mat-radio-group.horizontal,mat-radio-group.vertical{flex-direction:column}mat-radio-group.horizontal mat-radio-button,mat-radio-group.vertical mat-radio-button{margin:10px 0}}\n"] }]
1824
1962
  }], propDecorators: { layout: [{
1825
1963
  type: Input
1826
1964
  }] } });
1827
1965
 
1966
+ class InputTelefoneInternacionalValidatorDirective {
1967
+ constructor() {
1968
+ }
1969
+ validate(control) {
1970
+ return phoneNumberValidator(control);
1971
+ }
1972
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputTelefoneInternacionalValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1973
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: InputTelefoneInternacionalValidatorDirective, isStandalone: true, selector: "mcl-input-telefone-intl,[mclInputTelefoneIntl]", providers: [{
1974
+ provide: NG_VALIDATORS,
1975
+ useExisting: InputTelefoneInternacionalValidatorDirective,
1976
+ multi: true,
1977
+ }], ngImport: i0 });
1978
+ }
1979
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputTelefoneInternacionalValidatorDirective, decorators: [{
1980
+ type: Directive,
1981
+ args: [{
1982
+ selector: 'mcl-input-telefone-intl,[mclInputTelefoneIntl]',
1983
+ providers: [{
1984
+ provide: NG_VALIDATORS,
1985
+ useExisting: InputTelefoneInternacionalValidatorDirective,
1986
+ multi: true,
1987
+ }]
1988
+ }]
1989
+ }], ctorParameters: () => [] });
1990
+
1828
1991
  class InputTelefoneInternacionalComponent extends AbstractMatFormFieldControl {
1829
1992
  preferredContries = ['br'];
1830
1993
  readonly;
1831
1994
  blur = new EventEmitter();
1832
1995
  alwaysShowCountry = false;
1833
1996
  telInput;
1834
- $innerValue;
1835
- get value() {
1836
- return this.$innerValue;
1837
- }
1838
- set value(value) {
1839
- this.$innerValue = value;
1840
- this.stateChanges.next();
1997
+ onControlValueChange(value) {
1841
1998
  this.onChange(value?.replace(/[^\d+]/g, ''));
1999
+ this.stateChanges.next();
1842
2000
  }
1843
2001
  get shouldLabelFloat() {
1844
2002
  return this.focused || !this.empty || this.alwaysShowCountry;
@@ -1864,20 +2022,31 @@ class InputTelefoneInternacionalComponent extends AbstractMatFormFieldControl {
1864
2022
  provide: MatFormFieldControl,
1865
2023
  useExisting: InputTelefoneInternacionalComponent
1866
2024
  },
1867
- ], viewQueries: [{ propertyName: "telInput", first: true, predicate: ["input"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"input\">\n <lac-mat-country-selector\n [ngClass]=\"{'hidden': !focused && !value && !alwaysShowCountry}\"\n [preferredCountries]=\"preferredContries\"\n [selectorFor]=\"input\"\n searchPlaceholder=\"Filtrar paises...\"></lac-mat-country-selector>\n <lac-mat-tel-input #input\n [(ngModel)]=\"value\"\n (focusin)=\"onFocus()\" (focusout)=\"onBlur()\"></lac-mat-tel-input>\n</div>\n", styles: [".input{display:flex;align-items:center;margin:-8px 0;gap:8px}.input lac-mat-country-selector{transition:.3s}.input lac-mat-country-selector.hidden{opacity:0}.input lac-mat-tel-input{flex:1 1 auto}\n"], dependencies: [{ kind: "ngmodule", type: LacMatTelInputModule }, { kind: "component", type: i1$3.LacMatTelInputComponent, selector: "lac-mat-tel-input", inputs: ["required", "disabled", "internationalFormat"], outputs: ["blur"] }, { kind: "component", type: i1$3.LacMatCountrySelectorComponent, selector: "lac-mat-country-selector", inputs: ["selectorFor", "preferredCountries", "onlyCountries", "showDialCode", "disableSearch", "searchPlaceholder"], outputs: ["change"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
2025
+ {
2026
+ provide: NG_VALIDATORS,
2027
+ useClass: InputTelefoneInternacionalValidatorDirective,
2028
+ multi: true
2029
+ },
2030
+ ], viewQueries: [{ propertyName: "telInput", first: true, predicate: ["input"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"input\">\n <lac-mat-country-selector\n [ngClass]=\"{'hidden': !focused && !value && !alwaysShowCountry}\"\n [preferredCountries]=\"preferredContries\"\n [selectorFor]=\"input\"\n searchPlaceholder=\"Filtrar paises...\"></lac-mat-country-selector>\n <lac-mat-tel-input #input\n [formControl]=\"control\"\n (focusin)=\"onFocus()\" (focusout)=\"onBlur()\"></lac-mat-tel-input>\n</div>\n", styles: [".input{display:flex;align-items:center;margin:-8px 0;gap:8px}.input lac-mat-country-selector{transition:.3s}.input lac-mat-country-selector.hidden{opacity:0}.input lac-mat-tel-input{flex:1 1 auto}\n"], dependencies: [{ kind: "ngmodule", type: LacMatTelInputModule }, { kind: "component", type: i1$3.LacMatTelInputComponent, selector: "lac-mat-tel-input", inputs: ["required", "disabled", "internationalFormat"], outputs: ["blur"] }, { kind: "component", type: i1$3.LacMatCountrySelectorComponent, selector: "lac-mat-country-selector", inputs: ["selectorFor", "preferredCountries", "onlyCountries", "showDialCode", "disableSearch", "searchPlaceholder"], outputs: ["change"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
1868
2031
  }
1869
2032
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputTelefoneInternacionalComponent, decorators: [{
1870
2033
  type: Component,
1871
2034
  args: [{ selector: 'mcl-input-telefone-intl', imports: [
1872
2035
  LacMatTelInputModule,
1873
2036
  NgClass,
1874
- FormsModule
2037
+ FormsModule,
2038
+ ReactiveFormsModule
1875
2039
  ], providers: [
1876
2040
  {
1877
2041
  provide: MatFormFieldControl,
1878
2042
  useExisting: InputTelefoneInternacionalComponent
1879
2043
  },
1880
- ], template: "<div class=\"input\">\n <lac-mat-country-selector\n [ngClass]=\"{'hidden': !focused && !value && !alwaysShowCountry}\"\n [preferredCountries]=\"preferredContries\"\n [selectorFor]=\"input\"\n searchPlaceholder=\"Filtrar paises...\"></lac-mat-country-selector>\n <lac-mat-tel-input #input\n [(ngModel)]=\"value\"\n (focusin)=\"onFocus()\" (focusout)=\"onBlur()\"></lac-mat-tel-input>\n</div>\n", styles: [".input{display:flex;align-items:center;margin:-8px 0;gap:8px}.input lac-mat-country-selector{transition:.3s}.input lac-mat-country-selector.hidden{opacity:0}.input lac-mat-tel-input{flex:1 1 auto}\n"] }]
2044
+ {
2045
+ provide: NG_VALIDATORS,
2046
+ useClass: InputTelefoneInternacionalValidatorDirective,
2047
+ multi: true
2048
+ },
2049
+ ], template: "<div class=\"input\">\n <lac-mat-country-selector\n [ngClass]=\"{'hidden': !focused && !value && !alwaysShowCountry}\"\n [preferredCountries]=\"preferredContries\"\n [selectorFor]=\"input\"\n searchPlaceholder=\"Filtrar paises...\"></lac-mat-country-selector>\n <lac-mat-tel-input #input\n [formControl]=\"control\"\n (focusin)=\"onFocus()\" (focusout)=\"onBlur()\"></lac-mat-tel-input>\n</div>\n", styles: [".input{display:flex;align-items:center;margin:-8px 0;gap:8px}.input lac-mat-country-selector{transition:.3s}.input lac-mat-country-selector.hidden{opacity:0}.input lac-mat-tel-input{flex:1 1 auto}\n"] }]
1881
2050
  }], propDecorators: { preferredContries: [{
1882
2051
  type: Input
1883
2052
  }], readonly: [{
@@ -1891,31 +2060,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
1891
2060
  args: ['input']
1892
2061
  }] } });
1893
2062
 
1894
- class InputTelefoneInternacionalValidatorDirective {
1895
- constructor() {
1896
- }
1897
- validate(control) {
1898
- return phoneNumberValidator(control);
1899
- }
1900
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputTelefoneInternacionalValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1901
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: InputTelefoneInternacionalValidatorDirective, isStandalone: true, selector: "mcl-input-telefone-intl,[mclInputTelefoneIntl]", providers: [{
1902
- provide: NG_VALIDATORS,
1903
- useExisting: InputTelefoneInternacionalValidatorDirective,
1904
- multi: true,
1905
- }], ngImport: i0 });
1906
- }
1907
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputTelefoneInternacionalValidatorDirective, decorators: [{
1908
- type: Directive,
1909
- args: [{
1910
- selector: 'mcl-input-telefone-intl,[mclInputTelefoneIntl]',
1911
- providers: [{
1912
- provide: NG_VALIDATORS,
1913
- useExisting: InputTelefoneInternacionalValidatorDirective,
1914
- multi: true,
1915
- }]
1916
- }]
1917
- }], ctorParameters: () => [] });
1918
-
1919
2063
  /**
1920
2064
  * Generated bundle index. Do not edit.
1921
2065
  */