ember-inputmask5

4.0.2 • Public • Published

ember-inputmask5

Ember addon for Inputmask input mask library.

Compatibility

  • Ember.js v3.24 or above
  • Ember CLI v3.24 or above
  • Node.js v12 or above

Installation

ember install ember-inputmask5

Usage

You can change all global configuration settings via config/environment.js file.

Please check Inputmask site for more defaults details.

ENV['ember-inputmask5'] = {
  defaults: {
    // ...
  },
  definitions: {
    // ...
  },
  aliases: {
    // ...
  },
};

Example as a component

<Inputmask @mask="999 999 99 99" />

Please check Inputmask site for more configuration details.

<Inputmask @mask="999 999 99 99" @placeholder="_" @clearIncomplete={{true}} />

Example as a modifer

<Input {{inputmask mask="999 999 99 99" placeholder="_" clearIncomplete=true}} />
<input type="text" {{inputmask mask="999 999 99 99" placeholder="_" clearIncomplete=true}} />

If you would like access to the inputmask instance in order to call some methods directly, for example to hide or show programmatically, pass an action to registerAPI

<Input {{inputmask registerAPI=this.saveApi mask="999 999 99 99" placeholder="_" clearIncomplete=true}} />
// save the inputmask instance to use later
@action
saveApi(inputmask) {
  this.inputmask = inputmask;
}

// programmatically show unmasked value
@action
openFocusOut() {
  console.log(this.inputmask.unmaskedvalue());
}

Contributing

See the Contributing guide for details. I'm sorry that i don't have time to write tests. Please report if you find any issue.

Thanks.

License

This project is licensed under the MIT License.

Dependencies (4)

Dev Dependencies (15)

Package Sidebar

Install

npm i ember-inputmask5

Weekly Downloads

272

Version

4.0.2

License

MIT

Unpacked Size

8.42 kB

Total Files

8

Last publish

Collaborators

  • khons