# brmasker4

> Mask for angular 4

Latest version **1.0.3** (published 2018-10-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install brmasker4
pnpm add brmasker4
yarn add brmasker4
bun add brmasker4
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2018-10-25 |
| First published | 2017-10-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 34.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Antonio Marques |
| Maintainers | amarkes |
| Keywords | mask for angular 4, mask, mascara data, mascara cpf, mascara cnpj, mascara telefone, mascara celular, mascara cep, mascara real, mascara dolar, mask data, mask cpf, mask cnpj, mask telefone, mask celular, mask cep, mask real, mask dolar, mask angular 2, input angular 2, angular 2 |

## Links

- npm: https://www.npmjs.com/package/brmasker4
- Repository: https://github.com/amarkes/brmasker4
- Homepage: https://github.com/amarkes/brmasker4/issues#readme
- Issues: https://github.com/amarkes/brmasker4/issues
- npm.io page: https://npm.io/package/brmasker4

## Recent versions

- 1.0.3 (latest) — 2018-10-25
- 1.0.2 — 2018-06-11
- 1.0.1 — 2017-11-17
- 1.0.0 — 2017-10-27
- 0.0.29 — 2017-10-24
- 0.0.28 — 2017-10-24
- 0.0.27 — 2017-10-24
- 0.0.26 — 2017-10-16
- 0.0.25 — 2017-10-14
- 0.0.24 — 2017-10-14
- 0.0.1 — 2017-10-14
- 0.0.23 — 2017-10-12
- 0.0.22 — 2017-10-04
- 0.0.21 — 2017-10-04
- 0.0.20 — 2017-10-04
- … 8 more at https://npm.io/package/brmasker4/versions

## README

# Lib is deprecated 

We're sorry, but we'll focus only on one [library](https://github.com/amarkes/br-masker-ionic-3)


# brmasker4

[![GitHub issues](https://img.shields.io/github/issues/amarkes/brmasker4.svg)](https://github.com/amarkes/brmasker4/issues)
[![GitHub stars](https://img.shields.io/github/stars/amarkes/brmasker4.svg)](https://github.com/amarkes/brmasker4/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/amarkes/brmasker4.svg)](https://github.com/amarkes/brmasker4/network)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/amarkes/brmasker4/master/LICENSE)
[![Build Status](https://travis-ci.org/amarkes/brmasker-ionic.svg?branch=master)](https://travis-ci.org/amarkes/brmasker4)


return custom mask in input for angular 4

# Required
- node v8.4.0 or up
- npm 5.4.2 or up
- @angular/cli: 1.4.4

# install

```sh
npm install brmasker4 --save
```

### HTML

### correct usage

```html
<input type="text" name="cpf" placeholder="CPF" [brmasker]="{mask:'000.000.000-00', len:14}" value="">
```

# Module

```javascript
import { BrMasker4Module } from 'brmasker4';

@NgModule({
  imports: [
    BrMasker4Module
  ],
})

```

# Features

```js
import { BrMaskerDirective, BrMaskModel } from 'brmasker-ionic-3';

...

constructor(public brMaskerDirective: BrMaskerDirective) {}

...

protected createForm(): FormGroup {
  return new FormGroup({
    phone: new FormControl(this.createPhone())
  });
}

private createPhone(): string {
  const config: BrMaskModel = new BrMaskModel();
  config.phone = true;
  return this.brMaskerDirective.writeCreateValue('99999999999', config);
}
```

# Inputs

* brmasker: BrModel

```js
	BrModel = {
	 mask: string;
	 len: number;
	 money: boolean;
	 phone: boolean;
	 person: boolean;
	}
```


 Name | type | info |
| ------ | ------ | ------ |
| mask | string | Optional |
| len | string | Optional |
| money | boolean | Optional |
| decimal| number | Optional for 'money', default '2' |
| phone | boolean | Optional |
| person | boolean | Optional |
| percent | boolean | Optional |
| type | string | Optional default 'all' |


### Exemple for CPF/CNPJ `999.999.999-99` / `99.999.999/9999-99`

### usage

```html
<input type="text" name="cpf" placeholder="CPF/CNPJ" [brmasker]="{person: true}" value="">
```

### Exemple for Real `999,99`

### usage

```html
<input type="text" name="money" placeholder="(R$) Real" [brmasker]="{money: true}"  value="">
```

### Exemple for Phone `(99) 9999-9999` / `(99) 99999-9999`

### usage

```html
<input type="text" name="phone" placeholder="Phone" [brmasker]="{phone: true}"  value="">
```

# Characters

`- . / ( ) , * + @ # $ & %`

# Guide

[brmasker]="{mask:'000.000.000-00', len:14}"

[brmasker] = component receive array (mask, len)

mask --> required / default = '' / custom mask

len --> required / default = 0 / number of length

### data
```html
[brmasker]="{mask:'00/00/0000', len:10}"
```
### cep
```html
[brmasker]="{mask:'00.000-000', len:10}"
```

### custom cpf
```html
[brmasker]="{mask:'000.000.000-00', len:14}"
```

### custom cnpj
```html
[brmasker]="{mask:'00.000.000/0000-00', len:18}"
```

### custom telefone
```html
[brmasker]="{mask:'(00) 0000-0000', len:14}"
```

### custom whatsapp
```html
[brmasker]="{mask:'(00) 00000-0000', len:15}"
```



# Build for developer

### Only use if you change the component

### Build

```sh
npm run build
```

### Publish

```sh
npm publish
```

# Versions

- for angular 6 using version 1.0.2

- for angular 5 using version 1.0.1


# Changelog

### v1.0.2

- support for angular 6

- news updates

### v1.0.1

- fix number in person and phone

### v1.0.0

- Suport reactive form

### v0.0.29

- custom phone, money and person mask

---
_Source: https://npm.io/package/brmasker4 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
