@main-class/componentes 3.3.3 → 3.3.5

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.
@@ -2,7 +2,7 @@ import * as i1 from '@angular/forms';
2
2
  import { NgControl, FormGroupDirective, FormControl, FormsModule, NG_VALIDATORS, NG_VALUE_ACCESSOR, ReactiveFormsModule } 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, LOCALE_ID, Optional, Self, Inject, Directive, Injectable } from '@angular/core';
5
+ import { inject, Input, HostBinding, ViewChild, Component, InjectionToken, QueryList, ContentChildren, EventEmitter, Output, Optional, Self, Inject, Directive, 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';
@@ -12,9 +12,10 @@ import { monetarioMask } from '@main-class/componentes/misc';
12
12
  import { MatFormFieldControl, MatPrefix, MatSuffix } from '@angular/material/form-field';
13
13
  import * as i1$1 from '@mat-datetimepicker/core';
14
14
  import { MAT_DATETIME_FORMATS, DatetimeAdapter, MatDatetimepickerModule } from '@mat-datetimepicker/core';
15
- import { MatMomentDatetimeModule, MomentDatetimeAdapter } from '@mat-datetimepicker/moment';
15
+ import { MatMomentDatetimeModule } from '@mat-datetimepicker/moment';
16
16
  import moment from 'moment';
17
- import { MomentDateAdapter } from '@angular/material-moment-adapter';
17
+ import { provideMomentDateAdapter, MomentDateAdapter } from '@angular/material-moment-adapter';
18
+ import 'moment/locale/pt-br.js';
18
19
  import { ARQUIVO_MANAGER_SERVICE, PreviewArquivoComponent, DownloadArquivoDirective } from '@main-class/componentes/arquivo';
19
20
  import { MatChipGrid, MatChip, MatChipInput } from '@angular/material/chips';
20
21
  import { NgClass, AsyncPipe, NgStyle } from '@angular/common';
@@ -205,6 +206,9 @@ class AbstractMatFormFieldSelectControl extends AbstractMatFormFieldControl {
205
206
  }));
206
207
  }
207
208
  };
209
+ get empty() {
210
+ return !this.control.value;
211
+ }
208
212
  get shouldFilter() {
209
213
  return true;
210
214
  }
@@ -249,16 +253,13 @@ class AbstractMatFormFieldSelectControl extends AbstractMatFormFieldControl {
249
253
  this.stateChanges.next();
250
254
  }
251
255
  writeValue(value) {
252
- clearTimeout(this.wvt);
253
- this.wvt = setTimeout(() => {
254
- super.writeValue(value);
255
- if (value) {
256
- this.control.setValue((this.optionProvider || this.defaultOptionProvider).label(value));
257
- }
258
- else {
259
- this.control.setValue('');
260
- }
261
- }, 150);
256
+ super.writeValue(value);
257
+ if (value) {
258
+ this.control.setValue((this.optionProvider || this.defaultOptionProvider).label(value));
259
+ }
260
+ else {
261
+ this.control.setValue('');
262
+ }
262
263
  }
263
264
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AbstractMatFormFieldSelectControl, deps: null, target: i0.ɵɵFactoryTarget.Component });
264
265
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: AbstractMatFormFieldSelectControl, isStandalone: true, selector: "ng-component", inputs: { trackBy: "trackBy", args: "args" }, queries: [{ propertyName: "options", predicate: SelectOptionComponent }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
@@ -438,6 +439,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
438
439
  type: Input
439
440
  }] } });
440
441
 
442
+ function validateDateTime(control) {
443
+ if (!!control.value) {
444
+ if (isNaN(control.value)) {
445
+ return { date: true };
446
+ }
447
+ }
448
+ return null;
449
+ }
441
450
  class InputDatetimeComponent extends AbstractMatFormFieldControl {
442
451
  locale = inject(MAT_DATE_LOCALE);
443
452
  formats = inject(MAT_DATETIME_FORMATS);
@@ -531,16 +540,18 @@ class InputDatetimeComponent extends AbstractMatFormFieldControl {
531
540
  this.stateChanges.next();
532
541
  }
533
542
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputDatetimeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
534
- 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: [
543
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: InputDatetimeComponent, isStandalone: true, selector: "tcn-input-datetime", inputs: { type: "type", readonly: "readonly", name: "name" }, providers: [
535
544
  {
536
- provide: MatFormFieldControl,
537
- useExisting: InputDatetimeComponent
545
+ provide: NG_VALIDATORS,
546
+ useValue: validateDateTime,
547
+ multi: true,
538
548
  },
539
- { provide: MAT_DATE_LOCALE, useExisting: LOCALE_ID },
540
549
  {
541
- provide: DatetimeAdapter,
542
- useClass: MomentDatetimeAdapter
550
+ provide: MatFormFieldControl,
551
+ useExisting: InputDatetimeComponent
543
552
  },
553
+ { provide: MAT_DATE_LOCALE, useValue: 'pt-br' },
554
+ provideMomentDateAdapter(),
544
555
  {
545
556
  provide: DateAdapter,
546
557
  useClass: MomentDateAdapter
@@ -584,21 +595,23 @@ class InputDatetimeComponent extends AbstractMatFormFieldControl {
584
595
  }
585
596
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: InputDatetimeComponent, decorators: [{
586
597
  type: Component,
587
- args: [{ selector: 'mcl-input-datetime', imports: [
598
+ args: [{ selector: 'tcn-input-datetime', imports: [
588
599
  MatDatetimepickerModule,
589
600
  MatMomentDatetimeModule,
590
601
  FormsModule,
591
602
  InputMaskComponent
592
603
  ], providers: [
593
604
  {
594
- provide: MatFormFieldControl,
595
- useExisting: InputDatetimeComponent
605
+ provide: NG_VALIDATORS,
606
+ useValue: validateDateTime,
607
+ multi: true,
596
608
  },
597
- { provide: MAT_DATE_LOCALE, useExisting: LOCALE_ID },
598
609
  {
599
- provide: DatetimeAdapter,
600
- useClass: MomentDatetimeAdapter
610
+ provide: MatFormFieldControl,
611
+ useExisting: InputDatetimeComponent
601
612
  },
613
+ { provide: MAT_DATE_LOCALE, useValue: 'pt-br' },
614
+ provideMomentDateAdapter(),
602
615
  {
603
616
  provide: DateAdapter,
604
617
  useClass: MomentDateAdapter
@@ -1658,7 +1671,7 @@ class SelectAutocompleteComponent extends AbstractMatFormFieldSelectControl {
1658
1671
  }
1659
1672
  }
1660
1673
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectAutocompleteComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1661
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: SelectAutocompleteComponent, isStandalone: true, selector: "mcl-select-autocomplete", inputs: { readonly: "readonly" }, outputs: { select: "select", blur: "blur" }, providers: [
1674
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: SelectAutocompleteComponent, isStandalone: true, selector: "tcn-select-autocomplete", inputs: { readonly: "readonly" }, outputs: { select: "select", blur: "blur" }, providers: [
1662
1675
  {
1663
1676
  provide: MatFormFieldControl,
1664
1677
  useExisting: SelectAutocompleteComponent
@@ -1667,7 +1680,7 @@ class SelectAutocompleteComponent extends AbstractMatFormFieldSelectControl {
1667
1680
  }
1668
1681
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SelectAutocompleteComponent, decorators: [{
1669
1682
  type: Component,
1670
- args: [{ selector: 'mcl-select-autocomplete', imports: [
1683
+ args: [{ selector: 'tcn-select-autocomplete', imports: [
1671
1684
  MatInput,
1672
1685
  MatAutocompleteTrigger,
1673
1686
  ReactiveFormsModule,
@@ -1907,5 +1920,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
1907
1920
  * Generated bundle index. Do not edit.
1908
1921
  */
1909
1922
 
1910
- export { AbstractMatFormFieldControl, AbstractMatFormFieldSelectControl, AllOptionCheckboxComponent, DelegateOptionProviderDirective, InputCepComponent, InputCnpjComponent, InputCpfCnpjComponent, InputCpfComponent, InputCurrencyComponent, InputDatetimeComponent, InputFileUploadComponent, InputFileUploadValidatorDirective, InputMaskComponent, InputPhoneComponent, InputTelefoneInternacionalComponent, InputTelefoneInternacionalValidatorDirective, OptionCheckboxComponent, OptionCheckboxGroupComponent, SELECT_OPTION_PROVIDER, SelectAutocompleteComponent, SelectChipsComponent, SelectManyCheckboxComponent, SelectOptionComponent, SelectRadioComponent };
1923
+ export { AbstractMatFormFieldControl, AbstractMatFormFieldSelectControl, AllOptionCheckboxComponent, DelegateOptionProviderDirective, InputCepComponent, InputCnpjComponent, InputCpfCnpjComponent, InputCpfComponent, InputCurrencyComponent, InputDatetimeComponent, InputFileUploadComponent, InputFileUploadValidatorDirective, InputMaskComponent, InputPhoneComponent, InputTelefoneInternacionalComponent, InputTelefoneInternacionalValidatorDirective, OptionCheckboxComponent, OptionCheckboxGroupComponent, SELECT_OPTION_PROVIDER, SelectAutocompleteComponent, SelectChipsComponent, SelectManyCheckboxComponent, SelectOptionComponent, SelectRadioComponent, validateDateTime };
1911
1924
  //# sourceMappingURL=main-class-componentes-input.mjs.map