Skip to content

lekoala/cleave-es6

Repository files navigation

Cleave ES6

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

What about react and angular ?

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

Documentation

Please refer to original docs for now https://github.com/nosir/cleave.js/tree/master/doc or check the demo.html for sample usage

Included PR

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

But I want credit card and phone support!

Well, I think there are better libs out there

You can check out my other library https://github.com/lekoala/formidable-elements for more :-)