1.2.6 • Published 4 years ago

@justa/mask-directive v1.2.6

Weekly downloads
74
License
MIT
Repository
github
Last release
4 years ago

JST Mask Directives

npm.io npm.io

Justa Pagamentos Angular 2+ Directives! A set of NG2 Directives to improve your forms.

Install

npm install --save @justa/mask-directive inputmask

Usage

Add the MaskDirectiveModule in your app.module.ts file in the imports array.

Masks

Money Mask (Deprecated)

Deprecated: This directive is deprecated. For Brazilian Real, use the Currency Mask (jstCurrencyMask) instead.

Add the jstMoneyMask directive to your input.

Props (inputs)

Propstypedefault
hasDecimalbooltrue
hasPrefixboolfalse
prefixSymbolstringR$

Example

<input jstMoneyMask [hasDecimal]="true" prefixSymbol="$" placeholder="$0.00">

Legal document Mask (Brazil only)

Directive only used to format brazilian document (CNPJ/CPF) in a single input

Add the jstLegalDocumentMask Directive to your input.

Example

<input jstLegalDocumentMask placeholder="000.000.000-00">

Currency Mask (Brazil only)

Directive to format currency inputs. The form control value automatically is mutiplied/divided by currencyMultiplier before rendering/after keyboard input.

Props (inputs)

Proptypedefault
currencyMultipliernumber100
currencySuffixstring'R$ '

Example

Add the jstCurrencyMask directive to your input:

<input jstCurrencyMask formControlName="value">

Percentage mask

Directive to format percentage inputs. The form control value is always between 0 and 1.

Props (inputs)

Proptypedefault
percentageSuffixstring' %'

Example

Add the jstPercentageMask directive to your input:

<input jstPercentageMask formControlName="value">

License

MIT @ Justa Pagamentos

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.4

5 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.0.1

7 years ago