Ember addon for Inputmask input mask library.
- Ember.js v3.24 or above
- Ember CLI v3.24 or above
- Node.js v12 or above
ember install ember-inputmask5
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
Please check Inputmask site for more configuration details.
Example as a modifer
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
// save the inputmask instance to use later
@action
saveApi(inputmask) {
this.inputmask = inputmask;
}
// programmatically show unmasked value
@action
openFocusOut() {
console.log(this.inputmask.unmaskedvalue());
}
Datetime (datetime extension)
<Input {{inputmask alias="datetime" inputFormat="dd/mm/yyyy" outputFormat="yyyy-mm-dd"}}/>
Currency (numeric extension)
<Input {{inputmask alias="currency" unmaskAsNumber="true" min="0" max="1000000" groupSeparator=" "}}/>
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.
This project is licensed under the MIT License.