@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.
package/input/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export * from './src/abstract-mat-form-field-select-control';
3
3
  export * from './src/input-currency/input-currency.component';
4
4
  export * from './src/input-datetime/input-datetime.component';
5
5
  export * from './src/input-fileupload/input-fileupload.component';
6
- export * from './src/input-fileupload/input-fileupload.directive';
6
+ export * from './src/input-fileupload/input-fileupload-validator.directive';
7
7
  export * from './src/input-mask/input-cnpj.component';
8
8
  export * from './src/input-mask/input-cep.component';
9
9
  export * from './src/input-mask/input-cpf-cnpj.component';
@@ -0,0 +1,18 @@
1
+ import { ControlValueAccessor, FormControl } from "@angular/forms";
2
+ import { OnDestroy, OnInit } from "@angular/core";
3
+ import * as i0 from "@angular/core";
4
+ export declare abstract class AbstractControlValueAccessor<T> implements ControlValueAccessor, OnInit, OnDestroy {
5
+ private valueSubscription?;
6
+ control: FormControl<any>;
7
+ onChange: (value: T | undefined) => void;
8
+ onTouched: () => void;
9
+ protected onControlValueChange(value: T | undefined): void;
10
+ ngOnInit(): void;
11
+ ngOnDestroy(): void;
12
+ writeValue(obj: any): void;
13
+ registerOnChange(fn: any): void;
14
+ registerOnTouched(fn: any): void;
15
+ setDisabledState?(isDisabled: boolean): void;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<AbstractControlValueAccessor<any>, never>;
17
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractControlValueAccessor<any>, never, never, {}, {}, never, never, true, never>;
18
+ }
@@ -1,36 +1,29 @@
1
- import { ControlValueAccessor, FormGroupDirective, NgControl } from '@angular/forms';
1
+ import { FormGroupDirective, NgControl } from '@angular/forms';
2
2
  import { Subject } from 'rxjs';
3
- import { ElementRef, OnDestroy } from '@angular/core';
4
3
  import { ErrorStateMatcher } from '@angular/material/core';
5
4
  import { MatFormFieldControl } from '@angular/material/form-field';
5
+ import { AbstractControlValueAccessor } from './abstract-control-value-accessor';
6
6
  import * as i0 from "@angular/core";
7
- export declare abstract class AbstractMatFormFieldControl<T> implements ControlValueAccessor, MatFormFieldControl<T | undefined>, OnDestroy {
7
+ export declare abstract class AbstractMatFormFieldControl<T> extends AbstractControlValueAccessor<T> implements MatFormFieldControl<T | undefined> {
8
8
  readonly errorStateMatcher: ErrorStateMatcher;
9
9
  readonly ngControl: NgControl | null;
10
10
  readonly parentFormGroup: FormGroupDirective | null;
11
11
  static nextId: number;
12
- private $value?;
13
12
  private $placeholder;
14
- private $disabled;
15
- private $required;
16
13
  focused: boolean;
17
14
  constructor();
18
- private _input?;
19
- get input(): ElementRef | undefined;
20
- set input(value: ElementRef | undefined);
21
15
  stateChanges: Subject<void>;
22
16
  id: string;
23
17
  describedBy: string;
24
- protected onChange: (val: any) => void;
25
- protected onTouched: () => void;
26
18
  get value(): T | undefined;
27
19
  set value(value: T | undefined);
20
+ protected onControlValueChange(value: T | undefined): void;
28
21
  get empty(): boolean;
29
22
  get autofilled(): boolean;
30
23
  get userAriaDescribedBy(): undefined;
31
24
  get disableAutomaticLabeling(): undefined;
32
25
  onContainerClick(event: MouseEvent): void;
33
- get shouldLabelFloat(): any;
26
+ get shouldLabelFloat(): boolean;
34
27
  get placeholder(): string;
35
28
  set placeholder(plh: string);
36
29
  get required(): any;
@@ -41,10 +34,6 @@ export declare abstract class AbstractMatFormFieldControl<T> implements ControlV
41
34
  get controlType(): string;
42
35
  setDescribedByIds(ids: string[]): void;
43
36
  ngOnDestroy(): void;
44
- registerOnTouched(fn: any): void;
45
- registerOnChange(fn: any): void;
46
- setDisabledState(isDisabled: boolean): void;
47
- writeValue(value: T): void;
48
37
  static ɵfac: i0.ɵɵFactoryDeclaration<AbstractMatFormFieldControl<any>, never>;
49
38
  static ɵcmp: i0.ɵɵComponentDeclaration<AbstractMatFormFieldControl<any>, "ng-component", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "required": { "alias": "required"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
50
39
  }
@@ -12,7 +12,7 @@ export declare abstract class AbstractMatFormFieldSelectControl<T> extends Abstr
12
12
  private $args;
13
13
  private wvt;
14
14
  filteredOptions?: Observable<SelectOption[]>;
15
- control: FormControl<string | null>;
15
+ inputControl: FormControl<string | null>;
16
16
  trackBy: (val: any) => any;
17
17
  private options;
18
18
  private defaultOptionProvider;
@@ -1,11 +1,8 @@
1
- import { AbstractMatFormFieldControl } from '../abstract-mat-form-field-control';
1
+ import { InputMaskComponent } from '../input-mask/input-mask.component';
2
2
  import * as i0 from "@angular/core";
3
- export declare class InputCurrencyComponent extends AbstractMatFormFieldControl<string> {
4
- get value(): string | undefined;
5
- set value(value: string | undefined);
3
+ export declare class InputCurrencyComponent extends InputMaskComponent {
6
4
  protected applyMask(value: string | undefined): string | undefined;
7
5
  protected removeMask(value: string | undefined): string | undefined;
8
- writeValue(value: any): void;
9
6
  static ɵfac: i0.ɵɵFactoryDeclaration<InputCurrencyComponent, never>;
10
7
  static ɵcmp: i0.ɵɵComponentDeclaration<InputCurrencyComponent, "mcl-input[currency]", never, {}, {}, never, never, true, never>;
11
8
  }
@@ -1,6 +1,6 @@
1
- import { AbstractControl, ValidationErrors } from '@angular/forms';
1
+ import { AbstractControl, FormControl, ValidationErrors } from '@angular/forms';
2
2
  import { MatDatetimepickerComponent } from '@mat-datetimepicker/core';
3
- import { Moment } from 'moment';
3
+ import moment, { Moment } from 'moment';
4
4
  import 'moment/locale/pt-br.js';
5
5
  import { InputMaskComponent } from '../input-mask/input-mask.component';
6
6
  import { AbstractMatFormFieldControl } from '../abstract-mat-form-field-control';
@@ -10,24 +10,21 @@ export declare class InputDatetimeComponent extends AbstractMatFormFieldControl<
10
10
  private readonly locale;
11
11
  private readonly formats;
12
12
  private readonly adapter;
13
+ private maskedValueSubscription?;
13
14
  type: 'datetime' | 'date' | 'time';
14
15
  readonly: any;
15
16
  name?: string;
16
17
  picker?: MatDatetimepickerComponent<Date>;
17
18
  inputMask?: InputMaskComponent;
18
- private innerValue?;
19
- private $maskedValue?;
19
+ inputControl: FormControl<any>;
20
20
  constructor();
21
- get input(): import("@angular/core").ElementRef<any> | undefined;
22
- set input(input: import("@angular/core").ElementRef<any> | undefined);
23
21
  get empty(): boolean;
24
- get maskedValue(): string | undefined;
25
- set maskedValue(maskedValue: string);
22
+ onMaskedValueChange(maskedValue: string): void;
26
23
  get mask(): "##/##/####" | "##:##" | "##/##/#### ##:##";
27
24
  get format(): any;
28
- get value(): Date | Moment | undefined;
29
- set value(value: Date | Moment | undefined);
25
+ protected onControlValueChange(value: Date | moment.Moment | undefined): void;
30
26
  writeValue(value: Date | undefined): void;
27
+ ngOnDestroy(): void;
31
28
  static ɵfac: i0.ɵɵFactoryDeclaration<InputDatetimeComponent, never>;
32
29
  static ɵcmp: i0.ɵɵComponentDeclaration<InputDatetimeComponent, "mcl-input-datetime", never, { "type": { "alias": "type"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "name": { "alias": "name"; "required": false; }; }, {}, never, never, true, never>;
33
30
  }
@@ -0,0 +1,16 @@
1
+ import { AbstractControl, ValidationErrors, Validator } from '@angular/forms';
2
+ import { InjectionToken } from '@angular/core';
3
+ import * as i0 from "@angular/core";
4
+ export type MaskResolver = (value: string) => string;
5
+ export declare const MASK_RESOLVER: InjectionToken<unknown>;
6
+ export declare class InputMaskValidatorDirective implements Validator {
7
+ private readonly maskResolver?;
8
+ private $mask?;
9
+ private onValidatorChange;
10
+ constructor(maskResolver?: MaskResolver);
11
+ set mask(mask: string | undefined);
12
+ validate(control: AbstractControl): ValidationErrors | null;
13
+ registerOnValidatorChange(fn: () => void): void;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<InputMaskValidatorDirective, [{ optional: true; }]>;
15
+ static ɵdir: i0.ɵɵDirectiveDeclaration<InputMaskValidatorDirective, "mcl-input[mask]", never, { "mask": { "alias": "mask"; "required": false; }; }, {}, never, never, true, never>;
16
+ }
@@ -10,12 +10,12 @@ export declare class InputMaskComponent extends AbstractMatFormFieldControl<stri
10
10
  keepMask?: boolean;
11
11
  onFocusin: EventEmitter<any>;
12
12
  onFocusout: EventEmitter<any>;
13
- get value(): string | undefined;
14
- set value(value: string | undefined);
13
+ protected onControlValueChange(value: string | undefined): void;
15
14
  set mask(mask: string);
16
15
  ngAfterViewInit(): void;
17
- protected applyMask(value: string | undefined): string;
18
- protected removeMask<T extends string | undefined>(value: T): T;
16
+ reinforceMask(): void;
17
+ protected applyMask(value: string | undefined): string | undefined;
18
+ protected removeMask(value: string | undefined): string | undefined;
19
19
  writeValue(value: any): void;
20
20
  focusin(): void;
21
21
  focusout(): void;
@@ -1,7 +1,7 @@
1
1
  import { InputMaskComponent } from './input-mask.component';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class InputPhoneComponent extends InputMaskComponent {
4
- protected applyMask(value: string | undefined): string;
4
+ protected applyMask(value: string | undefined): string | undefined;
5
5
  static ɵfac: i0.ɵɵFactoryDeclaration<InputPhoneComponent, never>;
6
6
  static ɵcmp: i0.ɵɵComponentDeclaration<InputPhoneComponent, "mcl-input[phone]", never, {}, {}, never, never, true, never>;
7
7
  }
@@ -0,0 +1,2 @@
1
+ export declare function applyMask(value: string | undefined, mask?: string): string;
2
+ export declare function removeMask<T extends string | undefined>(value: T, mask?: string): T;
@@ -8,9 +8,7 @@ export declare class InputTelefoneInternacionalComponent extends AbstractMatForm
8
8
  blur: EventEmitter<any>;
9
9
  alwaysShowCountry: boolean;
10
10
  telInput?: LacMatTelInputComponent;
11
- private $innerValue?;
12
- get value(): string | undefined;
13
- set value(value: string | undefined);
11
+ protected onControlValueChange(value: string | undefined): void;
14
12
  get shouldLabelFloat(): any;
15
13
  get empty(): boolean;
16
14
  onFocus(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@main-class/componentes",
3
- "version": "3.3.7",
3
+ "version": "3.3.9",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.2.0",
6
6
  "@angular/core": "^19.2.0"
@@ -39,25 +39,25 @@
39
39
  "types": "./form/index.d.ts",
40
40
  "default": "./fesm2022/main-class-componentes-form.mjs"
41
41
  },
42
- "./loader": {
43
- "types": "./loader/index.d.ts",
44
- "default": "./fesm2022/main-class-componentes-loader.mjs"
45
- },
46
42
  "./input": {
47
43
  "types": "./input/index.d.ts",
48
44
  "default": "./fesm2022/main-class-componentes-input.mjs"
49
45
  },
46
+ "./loader": {
47
+ "types": "./loader/index.d.ts",
48
+ "default": "./fesm2022/main-class-componentes-loader.mjs"
49
+ },
50
50
  "./misc": {
51
51
  "types": "./misc/index.d.ts",
52
52
  "default": "./fesm2022/main-class-componentes-misc.mjs"
53
53
  },
54
- "./pipe": {
55
- "types": "./pipe/index.d.ts",
56
- "default": "./fesm2022/main-class-componentes-pipe.mjs"
57
- },
58
54
  "./table": {
59
55
  "types": "./table/index.d.ts",
60
56
  "default": "./fesm2022/main-class-componentes-table.mjs"
57
+ },
58
+ "./pipe": {
59
+ "types": "./pipe/index.d.ts",
60
+ "default": "./fesm2022/main-class-componentes-pipe.mjs"
61
61
  }
62
62
  }
63
63
  }