ember-cli-input-mask

1.0.1 • Public • Published

ember-cli-input-mask

An ember-cli addon for creating input masks on text fields. It makes use of the jquery.inputmask plugin to assist users in entering text that matches the required format.

Installation

To install this addon in your ember application:

  • ember install:addon ember-cli-input-mask

Usage

In your handlebars template:

{{input-mask
  mask='000-00-0000'}}

This addon's input-mask component extends an Ember.TextField. See the Ember input helpers guides for information on the available attributes.

A very common case will be to set a value:

{{input-mask
  value=myInputValue
  mask='000-00-0000'}}

Your value can be a JS date if you use jquery.inputmask's built-in date type, and it will be handled correctly:

{{input-mask
  value=myJsDateValue
  mask='mm/dd/yyyy'}}

See jquery.inputmask's masking types docs for more information on defining masks.

Running Tests

  • ember test

Credits

This addon was born from a blog post by Peter Brown of Agilion.

Package Sidebar

Install

npm i ember-cli-input-mask

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • patrickberkeley