UNPKG

3.41 kBTypeScriptView Raw
1import { ElementRef } from '@angular/core';
2import { IConfig } from './ngx-mask.config';
3import { NgxMaskApplierService } from './ngx-mask-applier.service';
4import * as i0 from "@angular/core";
5export declare class NgxMaskService extends NgxMaskApplierService {
6 isNumberValue: boolean;
7 maskIsShown: string;
8 selStart: number | null;
9 selEnd: number | null;
10 /**
11 * Whether we are currently in writeValue function, in this case when applying the mask we don't want to trigger onChange function,
12 * since writeValue should be a one way only process of writing the DOM value based on the Angular model value.
13 */
14 writingValue: boolean;
15 maskChanged: boolean;
16 _maskExpressionArray: string[];
17 triggerOnMaskChange: boolean;
18 _previousValue: string;
19 _currentValue: string;
20 private _emitValue;
21 private _start;
22 private _end;
23 onChange: (_: any) => void;
24 readonly _elementRef: ElementRef<any> | null;
25 private readonly document;
26 protected _config: IConfig;
27 private readonly _renderer;
28 applyMask(inputValue: string, maskExpression: string, position?: number, justPasted?: boolean, backspaced?: boolean, cb?: (...args: any[]) => any): string;
29 private _numberSkipedSymbols;
30 applyValueChanges(position: number, justPasted: boolean, backspaced: boolean, cb?: (...args: any[]) => any): void;
31 hideInput(inputValue: string, maskExpression: string): string;
32 getActualValue(res: string): string;
33 shiftTypedSymbols(inputValue: string): string;
34 /**
35 * Convert number value to string
36 * 3.1415 -> '3.1415'
37 * 1e-7 -> '0.0000001'
38 */
39 numberToString(value: number | string): string;
40 showMaskInInput(inputVal?: string): string;
41 clearIfNotMatchFn(): void;
42 set formElementProperty([name, value]: [string, string | boolean]);
43 checkDropSpecialCharAmount(mask: string): number;
44 removeMask(inputValue: string): string;
45 private _checkForIp;
46 private _checkForCpfCnpj;
47 /**
48 * Recursively determine the current active element by navigating the Shadow DOM until the Active Element is found.
49 */
50 private _getActiveElement;
51 /**
52 * Propogates the input value back to the Angular model by triggering the onChange function. It won't do this if writingValue
53 * is true. If that is true it means we are currently in the writeValue function, which is supposed to only update the actual
54 * DOM element based on the Angular model value. It should be a one way process, i.e. writeValue should not be modifying the Angular
55 * model value too. Therefore, we don't trigger onChange in this scenario.
56 * @param inputValue the current form input value
57 */
58 private formControlResult;
59 private _toNumber;
60 private _removeMask;
61 private _removePrefix;
62 private _removeSuffix;
63 private _retrieveSeparatorValue;
64 private _regExpForRemove;
65 private _replaceDecimalMarkerToDot;
66 _checkSymbols(result: string): string | number | undefined | null;
67 private _checkPatternForSpace;
68 private _retrieveSeparatorPrecision;
69 _checkPrecision(separatorExpression: string, separatorValue: string): number | string;
70 _repeatPatternSymbols(maskExp: string): string;
71 currentLocaleDecimalMarker(): string;
72 static ɵfac: i0.ɵɵFactoryDeclaration<NgxMaskService, never>;
73 static ɵprov: i0.ɵɵInjectableDeclaration<NgxMaskService>;
74}