1.0.4 • Published 7 years ago

ts-mask v1.0.4

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

ts-mask

Typescript input mask

Install

npm install ts-mask

Usegate

Mask

Mask is the mixed array of RegExp and strings One item of array corresponds to one character of string.

Class

Class constructor has got only two parameters: input: HTMLInputElement mask: (RegExp | string)[]

Example

component.html

<input type="text" id="text-input" />

component.ts

let phoneMask: (string | RegExp)[] = ['+','7',' ','(',/\d/,/\d/,/\d/,')',' ',/\d/,/\d/,/\d/,'-',/\d/,/\d/,/\d/,/\d/];

new TSMask(<HTMLInputElement>document.getElementById('text-input'), phoneMask);
1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago