@justa/mask-directive
TypeScript icon, indicating that this package has built-in type declarations

1.2.6 • Public • Published

JST Mask Directives

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)

Props type default
hasDecimal bool true
hasPrefix bool false
prefixSymbol string R$

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)

Prop type default
currencyMultiplier number 100
currencySuffix string '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)

Prop type default
percentageSuffix string ' %'

Example

Add the jstPercentageMask directive to your input:

<input jstPercentageMask formControlName="value">

License

MIT @ Justa Pagamentos

/@justa/mask-directive/

    Package Sidebar

    Install

    npm i @justa/mask-directive

    Weekly Downloads

    11

    Version

    1.2.6

    License

    MIT

    Unpacked Size

    353 kB

    Total Files

    35

    Last publish

    Collaborators

    • venyustech
    • vinigomes
    • marcelli.marcelino
    • jacquefront
    • bielalmeida
    • jlemos
    • matheusnascgomes