@controladad/ng-base
Version:
Everything you need for Angular
42 lines (41 loc) • 2.09 kB
TypeScript
import { ElementRef, NgZone, OnDestroy, OnInit, Renderer2 } from '@angular/core';
import { InputMaskConfig } from './config';
import { AbstractControl, ControlValueAccessor, NgControl, Validator } from '@angular/forms';
import { InputmaskOptions } from './types';
import Inputmask from 'inputmask';
import * as i0 from "@angular/core";
export declare class InputMaskDirective<T = any> implements OnInit, OnDestroy, ControlValueAccessor, Validator {
private platformId;
private elementRef;
private renderer;
private ngZone;
ngControl?: NgControl | undefined;
config?: InputMaskConfig | undefined;
get inputMask(): InputmaskOptions<T> | undefined;
set inputMask(inputMask: InputmaskOptions<T> | undefined);
private inputMaskOptions;
private mutationObserver?;
inputMaskPlugin?: Inputmask.Instance;
nativeInputElement?: HTMLInputElement;
defaultInputMaskConfig: InputMaskConfig;
constructor(platformId: string, elementRef: ElementRef, renderer: Renderer2, ngZone: NgZone, ngControl?: NgControl | undefined, config?: InputMaskConfig | undefined);
private onChange;
onInput: (_: any) => void;
onTouched: (_: any) => void;
validate: (control: AbstractControl) => {
inputMask: boolean;
} | null;
ngOnInit(): void;
ngOnDestroy(): void;
writeValue(value: string): void;
registerOnChange(onChange: (value: T | null) => void): void;
registerOnTouched(fn: VoidFunction): void;
setDisabledState(disabled: boolean): void;
updateInputMask(): void;
createInputMaskPlugin(): void;
get control(): AbstractControl<any, any> | null | undefined;
setNativeInputElement(config: InputMaskConfig | undefined): void;
removeInputMaskPlugin(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<InputMaskDirective<any>, [null, null, null, null, { optional: true; self: true; }, { optional: true; }]>;
static ɵdir: i0.ɵɵDirectiveDeclaration<InputMaskDirective<any>, "[inputMask]", never, { "inputMask": { "alias": "inputMask"; "required": false; }; }, {}, never, never, true, never>;
}