1.1.3 • Published 3 years ago

@lbtek/input-masks v1.1.3

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

input-masks

Masks for input fields in forms.

Description

This is a utility lib that provides mask functions for inputs, it is necessary to reference these functions in the keyup event (Only in the 'keyup' event) in inputs type="text" (Give preference to type text) to achieve the desired mask effect.

Installation

$ npm i @lbtek/input-masks
# or
$ yarn add @lbtek/input-masks

Use

Available mask functions:

  • cepMask
  • cpfMask
  • cnpjMask
  • cpfCnpjMask
  • phoneMask

Example of basic use:

Use in a front-end project with resolution of importing modules through nodejs.

<input type="text" id="randomInput">

<script>
  import { cpfCnpjMask } from '@lbtek/input-masks'

  document.getElementById('randomInput')
    .addEventListener('keyup', cpfCnpjMask)
</script>

Attention!

To avoid problems with two-way data binding in vue components, you should use the 'lazy' modifier in v-model

To report a problem or suggestion, just open an issue in the repository.

This is an open source project, feel free to collaborate with the development of improvements 🤓.

1.1.1

3 years ago

1.1.0

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago