ES6 port of https://github.com/nosir/cleave.js
Same features, except no phone or credit card support Many PR have been reviewed and added
Demo: https://codepen.io/lekoalabe/pen/eYPvbax
I don't see the point of supporting specific frameworks when you can have a custom element that works really well :-)
The custom element provides :
- a quick
type
attribute to set the input type - a full
data-config
attribute that can store json configuration - you are free to use whatever html you want to style/name your input element
Please refer to original docs for now https://github.com/nosir/cleave.js/tree/master/doc
or check the demo.html
for sample usage
Add new option 'numeralDecimalPadding' (on blur only) nosir/cleave.js#707
Fix duplicate numbers are entered when input number with microsoft pinyin nosir/cleave.js#663
feature: strict positive number nosir/cleave.js#660
Add support for hexademical only characters nosir/cleave.js#643
Add support for datetime fields (date and time in same field) nosir/cleave.js#637
Fix Ctrl+X behavior in read-only inputs nosir/cleave.js#633
Add first character uppercase option (renamed to ucfirst) nosir/cleave.js#623
Numeral decimal mark nosir/cleave.js#619
Patch prefix containing decimal (numeralDecimalMark) nosir/cleave.js#619
Fix backspace bug when next delimiter partially match previous nosir/cleave.js#579
Limit input chars nosir/cleave.js#680
Well, I think there are better libs out there
- cardjs: https://cardjs.co.uk/
- intl tel: https://intl-tel-input.com/
You can check out my other library https://github.com/lekoala/formidable-elements for more :-)