return custom mask in input for ionic 3
- node v8.2.1 or up
- npm 5.3.0 or up
- ionic 3.9.2
npm install brmasker-ionic-3 --save
<ion-item>
<ion-input type="text" name="cpf" placeholder="CPF" [brmasker]="{mask:'000.000.000-00', len:14}"></ion-input>
</ion-item>
<input type="text" name="cpf" placeholder="CPF" [brmasker]="{mask:'000.000.000-00', len:14}" value="">
import { BrMaskerModule } from 'brmasker-ionic-3';
@NgModule({
imports: [
BrMaskerModule
],
})
- brmasker: BrModel
BrModel = {
mask: string;
len: number;
money: boolean;
phone: boolean;
person: boolean;
percent:boolean;
type: 'alfa' | 'num' | 'all'
}
Name | type | info |
---|---|---|
mask | string | Optional |
len | string | Optional |
money | boolean | Optional |
phone | boolean | Optional |
person | boolean | Optional |
percent | boolean | Optional |
type | string | Optional default 'all' |
<ion-item>
<ion-input type="text" name="cpf" placeholder="CPF/CNPJ" [brmasker]="{mask:'00/00/0000', len:10, type:'alfa'}"></ion-input>
</ion-item>
<ion-item>
<ion-input type="text" name="cpf" placeholder="CPF/CNPJ" [brmasker]="{mask:'00/00/0000', len:10, type:'num'}"></ion-input>
</ion-item>
<ion-item>
<ion-input type="text" name="cpf" placeholder="CPF/CNPJ" [brmasker]="{mask:'00/00/0000', len:10, type:'all'}"></ion-input>
</ion-item>
<ion-item>
<ion-input type="text" name="cpf" placeholder="CPF/CNPJ" [brmasker]="{person: true}"></ion-input>
</ion-item>
<input type="text" name="cpf" placeholder="CPF/CNPJ" [brmasker]="{person: true}" value="">
<ion-item>
<ion-input type="text" name="money" placeholder="(R$) Real" [brmasker]="{money: true}"></ion-input>
</ion-item>
<input type="text" name="money" placeholder="(R$) Real" [brmasker]="{money: true}" value="">
<input type="text" name="percent" placeholder="% Percent" [brmasker]="{percent: true}" value="">
<ion-item>
<ion-input type="text" name="phone" placeholder="Phone" [brmasker]="{phone: true}"></ion-input>
</ion-item>
<input type="text" name="phone" placeholder="Phone" [brmasker]="{phone: true}" value="">
- . / ( ) , * + @ # $ & % :
[brmasker]="{mask:'00/00/0000', len:10}"
[brmasker]="{mask:'00.000-000', len:10}"
[brmasker]="{mask:'000.000.000-00', len:14}"
[brmasker]="{mask:'00.000.000/0000-00', len:18}"
[brmasker]="{mask:'(00) 0000-0000', len:14}"
[brmasker]="{mask:'(00) 00000-0000', len:15}"
npm run build
npm publish
- Fix mask type caracter
- Fix mask caracter
:
- Fix mask pool
- Replace percent symbol
- percent mask #pull #23
- fix(events): ionic has changed event names #pull #22
- Updating devdependencies
- fix number in phone and person
- fix compiler project for npm
- Suport reactive form