JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9817
  • Score
    100M100P100Q116261F
  • License MIT

Core abilities of masked-input. Usefull to create custom input processors

Package Exports

  • input-core

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (input-core) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

input-core

This project would help you if:

  1. You don't need to create an input for user, but only formatting to show data as a plain text
  2. You want to create your own compnent which will work with inputs

Step-by-step guide:

  1. Install it

    npm install --save input-core

    or

    yarn add input-core
  2. import it:

    import { createInput } from 'input-core';
  3. Create an object (for example, if we want to format phone):

export default function formatPhone(value, mask) {
  const input = createInput({
    value,
    mask,
  });

  return input.getVisibleValue();
}
  1. Use it wherever you need ;)
const phone = '9651112222';
...
formatPhone(phone, '+7 (000) 000 00-00'); // returns +7 (965) 111 22-22

License

MIT