Skip to content

Commit

Permalink
Regenreate assets
Browse files Browse the repository at this point in the history
  • Loading branch information
nosir committed Jul 16, 2016
1 parent ca689af commit d232e61
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 16 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Cleave.js has a simple purpose: to help you format input text content automatica
- Numeral formatting
- Custom delimiter, prefix and blocks pattern
- CommonJS / AMD mode
- ReactJS component port
- ReactJS component

**TL;DR** [the demo page](http://nosir.github.io/cleave.js/)

Expand Down Expand Up @@ -164,10 +164,10 @@ gulp mocha && gulp eslint
```

## Todo
- [x] ReactJS component port
- [x] ReactJS component
- [x] Add credit card type detection callback
- [x] Mocha unit tests for formatter
- [ ] AngularJS component port (WIP...)
- [ ] AngularJS component (WIP...)
- [ ] PhantomJS / Jest browser tests

## Get in touch
Expand Down
15 changes: 12 additions & 3 deletions dist/cleave-react.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cleave-react.min.js

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions dist/cleave.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,7 @@ var DefaultProperties = {
target.creditCard = !!opts.creditCard;
target.creditCardStrictMode = !!opts.creditCardStrictMode;
target.creditCardType = '';
target.onCreditCardTypeChanged = opts.onCreditCardTypeChanged || (function () {
});
target.onCreditCardTypeChanged = opts.onCreditCardTypeChanged || (function () {});

// phone
target.phone = !!opts.phone;
Expand All @@ -374,7 +373,7 @@ var DefaultProperties = {
target.prefix = (target.creditCard || target.phone || target.date) ? '' : (opts.prefix || '');
target.prefixLength = target.prefix.length;

target.initValue = target.prefix + (opts.initValue || '');
target.initValue = opts.initValue || '';

target.delimiter = opts.delimiter || (target.date ? '/' : (target.numeral ? ',' : ' '));
target.delimiterRE = new RegExp('\\' + target.delimiter, 'g');
Expand Down Expand Up @@ -554,11 +553,15 @@ DateFormatter.prototype = {
case 'd':
if (parseInt(sub, 10) > 31) {
sub = '31';
} else if (parseInt(sub, 10) === 0) {
//sub = '01';
}
break;
case 'm':
if (parseInt(sub, 10) > 12) {
sub = '12';
} else if (parseInt(sub, 10) === 0) {
//sub = '01';
}
break;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/cleave.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion doc/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ A `String` value indicates the thousands separator grouping style.

It accepts three preset value:

- `thousand`: Global numbering group style. It groups numbers in thousands and the delimiter occurs every 3 digits. `1,234,567.89`
- `thousand`: Thousand numbering group style. It groups numbers in thousands and the delimiter occurs every 3 digits. `1,234,567.89`
- `lakh`: Indian numbering group style. It groups the rightmost 3 digits in a similar manner to regular way but then groups every 2 digits thereafter. `12,34,567.89`
- `wan`: Chinese numbering group style. It groups numbers in 10-thousand(万, 萬) and the delimiter occurs every 4 digits. `123,4567.89`

Expand Down
7 changes: 4 additions & 3 deletions src/Cleave.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ var Cleave = React.createClass({

componentWillReceiveProps: function (nextProps) {
var owner = this,
phoneRegionCode = nextProps.options.phoneRegionCode;
phoneRegionCode = nextProps.options.phoneRegionCode,
newValue = nextProps.value;

if (owner.properties.result === owner.properties.initValue && nextProps.value) {
owner.onInput(nextProps.value);
if (newValue) {
owner.onInput(newValue);
}

// update phone region code
Expand Down
2 changes: 1 addition & 1 deletion src/common/DefaultProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var DefaultProperties = {
target.prefix = (target.creditCard || target.phone || target.date) ? '' : (opts.prefix || '');
target.prefixLength = target.prefix.length;

target.initValue = target.prefix + (opts.initValue || '');
target.initValue = opts.initValue || '';

target.delimiter = opts.delimiter || (target.date ? '/' : (target.numeral ? ',' : ' '));
target.delimiterRE = new RegExp('\\' + target.delimiter, 'g');
Expand Down

0 comments on commit d232e61

Please sign in to comment.