Skip to content

Commit c30d47b

Browse files
committed
further fix the numeric alias
1 parent 56f3f5c commit c30d47b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+4903
-4854
lines changed

.editorconfig

+2-9
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@ root = true
44
insert_final_newline = true
55
charset = utf-8
66
trim_trailing_whitespace = true
7-
8-
[*.js]
97
indent_style = tab
10-
11-
[*.json]
12-
indent_style = space
13-
indent_size = 2
14-
15-
[*.md]
16-
trim_trailing_whitespace = false
8+
indent_size = 4
9+
tab_width = 4

.eslintrc

+43-18
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
{
22
"rules": {
3-
"consistent-return": [1],
4-
"curly": [2, "multi-line"],
5-
"eol-last": [0],
6-
"eqeqeq": [2, "smart"],
3+
"consistent-return": [
4+
1
5+
],
6+
"curly": [
7+
2,
8+
"multi-line"
9+
],
10+
"eol-last": [
11+
0
12+
],
13+
"eqeqeq": [
14+
2,
15+
"smart"
16+
],
717
"indent": [
818
1,
9-
"tab", {
10-
"SwitchCase": 1
11-
}
19+
"tab"
1220
],
1321
"quotes": [
1422
1,
@@ -19,21 +27,38 @@
1927
1,
2028
"except-parens"
2129
],
22-
"new-cap": [0],
23-
"no-empty": [0],
24-
"no-loop-func": [0],
25-
"no-underscore-dangle": [0],
26-
"no-unused-vars": [2, {
27-
"vars": "all",
28-
"args": "none"
29-
}],
30+
"new-cap": [
31+
0
32+
],
33+
"no-empty": [
34+
0
35+
],
36+
"no-loop-func": [
37+
0
38+
],
39+
"no-underscore-dangle": [
40+
0
41+
],
42+
"no-unused-vars": [
43+
2,
44+
{
45+
"vars": "all",
46+
"args": "none"
47+
}
48+
],
3049
"no-use-before-define": [
3150
2,
3251
"nofunc"
3352
],
34-
"no-shadow": [0],
35-
"semi-spacing": [1],
36-
"strict": [0]
53+
"no-shadow": [
54+
0
55+
],
56+
"semi-spacing": [
57+
1
58+
],
59+
"strict": [
60+
0
61+
]
3762
},
3863
"env": {
3964
"browser": true

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ All notable changes to this project will be documented in this file.
1313
- patchValueProperty - enable native value property patch on IE10/IE11
1414

1515
### Fixed
16+
- Lost zero while replacing a digit in group #1202
17+
- RadixFocus problem #686
18+
- Can not change integer part when it is "0" #1192
1619
- "[object Object]" value after `$element.inputmask('setvalue', '')` call #1208
1720
- Paste does not work properly when using numericInput #1195
1821
- error occurs in safari 9.0.3 (11601.4.4) #1191

Gruntfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = function(grunt) {
1212
function createUglifyConfig(path) {
1313
function stripModuleLoaders(src, dst) {
1414
var srcFile = grunt.file.read(src);
15-
srcFile = srcFile.replace(new RegExp("\\(function\\(factory\\)[\\s\\S]*\\(function\\(\\$"), "(function($");
15+
srcFile = srcFile.replace(new RegExp("\\(function\\s?\\(factory\\)[\\s\\S]*\\(function\\s?\\(\\$"), "(function ($");
1616
if (src.indexOf("extensions") === -1 && src.indexOf("jquery.inputmask") === -1) {
1717
srcFile = srcFile.replace(new RegExp("\\}\\)\\);[\\s]*$"), "})(jQuery);");
1818
} else srcFile = srcFile.replace(new RegExp("\\}\\)\\);[\\s]*$"), "})(jQuery, Inputmask);");

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,8 @@ var isValid = Inputmask.isValid("23/03/1973", { alias: "dd/mm/yyyy"});
591591

592592
## Options:
593593
### placeholder
594-
Change the mask placeholder
594+
Change the mask placeholder.
595+
Default: "_"
595596

596597
```javascript
597598
$(document).ready(function(){
@@ -891,7 +892,7 @@ $(document).ready(function(){
891892
### rightAlign
892893
Align the input to the right
893894

894-
By setting the rightAlign you can specify to right align an inputmask. This is only applied in combination op the numericInput option or the dir-attribute. Default is true.
895+
By setting the rightAlign you can specify to right align an inputmask. This is only applied in combination op the numericInput option or the dir-attribute. Default is true.
895896

896897
```javascript
897898
$(document).ready(function(){
@@ -953,7 +954,7 @@ Hook to alter the clear behavior in the stripValidPositions<br>Args => maskset,
953954
Hook to postValidate the result from isValid. Usefull for validating the entry as a whole. Args => buffer, currentResult, opts<br>Return => true|false
954955

955956
### staticDefinitionSymbol
956-
The staticDefinitionSymbol option is used to indicate that the static entries in the mask can match a certain definition. Especially usefull with alternators so that static element in the mask can match another alternation.
957+
The staticDefinitionSymbol option is used to indicate that the static entries in the mask can match a certain definition. Especially usefull with alternators so that static element in the mask can match another alternation.
957958

958959
In the example below we mark the spaces as a possible match for the "i" definition. By doing so the mask can alternate to the second mask even when we typed already "12 3".
959960

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jquery.inputmask",
3-
"version": "3.2.8-11",
3+
"version": "3.2.8-15",
44
"main": [
55
"./dist/inputmask/inputmask.js"
66
],

component.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "jquery_inputmask",
33
"repository": "robinherbots/jquery.inputmask",
44
"description": "jquery.inputmask is a jquery plugin which create an input mask.",
5-
"version": "3.2.8-11",
5+
"version": "3.2.8-15",
66
"keywords": ["jquery", "plugins", "input", "form", "inputmask", "mask"],
77
"main": "./dist/jquery.inputmask.bundle.js",
88
"scripts": [

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "robinherbots/jquery.inputmask",
33
"description": "jquery.inputmask is a jquery plugin which create an input mask.",
4-
"version": "3.2.8-11",
4+
"version": "3.2.8-15",
55
"type": "library",
66
"keywords": ["jquery", "plugins", "input", "form", "inputmask", "mask"],
77
"homepage": "http://robinherbots.github.io/jquery.inputmask",

dist/inputmask/inputmask.date.extensions.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* https://github.com/RobinHerbots/jquery.inputmask
44
* Copyright (c) 2010 - 2016 Robin Herbots
55
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
6-
* Version: 3.2.8-11
6+
* Version: 3.2.8-15
77
*/
88
!function(factory) {
99
"function" == typeof define && define.amd ? define([ "inputmask.dependencyLib", "inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("./inputmask.dependencyLib.jquery"), require("./inputmask")) : factory(window.dependencyLib || jQuery, window.Inputmask);
@@ -90,6 +90,11 @@
9090
var maxxYear = maxYearPrefix + maxYearPostfix;
9191
return minyear > maxxYear ? minyear : maxxYear;
9292
}
93+
if (currentyear >= minyear && maxyear >= currentyear) {
94+
for (var currentYearPrefix = currentyear.toString().slice(0, 2); currentYearPrefix + hint > maxyear; ) currentYearPrefix--;
95+
var currentYearAndHint = currentYearPrefix + hint;
96+
return minyear > currentYearAndHint ? minyear : currentYearAndHint;
97+
}
9398
return currentyear;
9499
},
95100
onKeyDown: function(e, buffer, caretPos, opts) {

dist/inputmask/inputmask.dependencyLib.jquery.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* https://github.com/RobinHerbots/jquery.inputmask
44
* Copyright (c) 2010 - 2016 Robin Herbots
55
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
6-
* Version: 3.2.8-11
6+
* Version: 3.2.8-15
77
*/
88
!function(factory) {
99
"function" == typeof define && define.amd ? define([ "jquery" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery")) : factory(jQuery);

dist/inputmask/inputmask.extensions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* https://github.com/RobinHerbots/jquery.inputmask
44
* Copyright (c) 2010 - 2016 Robin Herbots
55
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
6-
* Version: 3.2.8-11
6+
* Version: 3.2.8-15
77
*/
88
!function(factory) {
99
"function" == typeof define && define.amd ? define([ "inputmask.dependencyLib", "inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("./inputmask.dependencyLib.jquery"), require("./inputmask")) : factory(window.dependencyLib || jQuery, window.Inputmask);

dist/inputmask/inputmask.js

+8-12
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* https://github.com/RobinHerbots/jquery.inputmask
44
* Copyright (c) 2010 - 2016 Robin Herbots
55
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
6-
* Version: 3.2.8-11
6+
* Version: 3.2.8-15
77
*/
88
!function(factory) {
99
"function" == typeof define && define.amd ? define([ "inputmask.dependencyLib" ], factory) : "object" == typeof exports ? module.exports = factory(require("./inputmask.dependencyLib.jquery")) : factory(window.dependencyLib || jQuery);
@@ -312,7 +312,7 @@
312312
return !1;
313313
}
314314
var i, startPos = start;
315-
for (getMaskSet().p = start, i = startPos; end > i; i++) void 0 !== getMaskSet().validPositions[i] && (nocheck === !0 || !IsEnclosedStatic(i) && opts.canClearPosition(getMaskSet(), i, getLastValidPosition(), strict, opts) !== !1) && delete getMaskSet().validPositions[i];
315+
for (getMaskSet().p = start, i = end - 1; i >= startPos; i--) void 0 !== getMaskSet().validPositions[i] && (nocheck === !0 || !IsEnclosedStatic(i) && opts.canClearPosition(getMaskSet(), i, getLastValidPosition(), strict, opts) !== !1) && delete getMaskSet().validPositions[i];
316316
for (resetMaskSet(!0), i = startPos + 1; i <= getLastValidPosition(); ) {
317317
for (;void 0 !== getMaskSet().validPositions[startPos]; ) startPos++;
318318
var s = getMaskSet().validPositions[startPos];
@@ -322,9 +322,6 @@
322322
i++) : isMask(i) || (i++, startPos--), startPos++;
323323
}
324324
}
325-
var lvp = getLastValidPosition(), ml = getMaskLength();
326-
for (strict !== !0 && nocheck !== !0 && void 0 !== getMaskSet().validPositions[lvp] && getMaskSet().validPositions[lvp].input === opts.radixPoint && delete getMaskSet().validPositions[lvp],
327-
i = lvp + 1; ml >= i; i++) getMaskSet().validPositions[i] && delete getMaskSet().validPositions[i];
328325
resetMaskSet(!0);
329326
}
330327
function getTestTemplate(pos, ndxIntlzr, tstPs) {
@@ -616,19 +613,18 @@
616613
}
617614
strict = strict === !0;
618615
var maskPos = pos;
619-
void 0 != pos.begin && (maskPos = isRTL && !isSelection(pos) ? pos.end : pos.begin);
620-
for (var pndx = maskPos - 1; pndx > -1 && !getMaskSet().validPositions[pndx]; pndx--) ;
616+
void 0 !== pos.begin && (maskPos = isRTL && !isSelection(pos) ? pos.end : pos.begin);
617+
for (var result = !1, positionsClone = $.extend(!0, {}, getMaskSet().validPositions), pndx = maskPos - 1; pndx > -1 && !getMaskSet().validPositions[pndx]; pndx--) ;
621618
pndx++;
622-
for (var testTemplate; maskPos > pndx; pndx++) getBuffer(), void 0 === getMaskSet().validPositions[pndx] && ((testTemplate = getTestTemplate(pndx)).match.def == opts.radixPointDefinitionSymbol || !isMask(pndx, !0) || $.inArray(opts.radixPoint, getBuffer()) < pndx && testTemplate.match.fn && testTemplate.match.fn.test(getPlaceholder(pndx), getMaskSet(), pndx, !1, opts)) && _isValid(pndx, testTemplate.match.placeholder || (null == testTemplate.match.fn ? testTemplate.match.def : getPlaceholder(pndx)), !0, fromSetValid);
623-
var result = !1, positionsClone = $.extend(!0, {}, getMaskSet().validPositions);
619+
for (var testTemplate; maskPos > pndx; pndx++) getBuffer(), void 0 === getMaskSet().validPositions[pndx] && ((testTemplate = getTestTemplate(pndx)).match.def === opts.radixPointDefinitionSymbol || !isMask(pndx, !0) || $.inArray(opts.radixPoint, getBuffer()) < pndx && testTemplate.match.fn && testTemplate.match.fn.test(getPlaceholder(pndx), getMaskSet(), pndx, !1, opts)) && _isValid(pndx, testTemplate.match.placeholder || (null == testTemplate.match.fn ? testTemplate.match.def : getPlaceholder(pndx)), !0, fromSetValid);
624620
if (isSelection(pos) && (handleRemove(void 0, Inputmask.keyCode.DELETE, pos), maskPos = getMaskSet().p),
625621
maskPos < getMaskLength() && (result = _isValid(maskPos, c, strict, fromSetValid),
626622
(!strict || fromSetValid === !0) && result === !1)) {
627623
var currentPosValid = getMaskSet().validPositions[maskPos];
628624
if (!currentPosValid || null !== currentPosValid.match.fn || currentPosValid.match.def !== c && c !== opts.skipOptionalPartCharacter) {
629625
if ((opts.insertMode || void 0 === getMaskSet().validPositions[seekNext(maskPos)]) && !isMask(maskPos, !0)) {
630-
var staticChar = getTestTemplate(maskPos).match, staticChar = staticChar.placeholder || staticChar.def;
631-
_isValid(maskPos, staticChar, strict, fromSetValid);
626+
var staticChar = getTestTemplate(maskPos).match;
627+
staticChar = staticChar.placeholder || staticChar.def, _isValid(maskPos, staticChar, strict, fromSetValid);
632628
for (var nPos = maskPos + 1, snPos = seekNext(maskPos); snPos >= nPos; nPos++) if (result = _isValid(nPos, c, strict, fromSetValid),
633629
result !== !1) {
634630
trackbackAlternations(maskPos, nPos), maskPos = nPos;
@@ -648,7 +644,7 @@
648644
}
649645
function isMask(pos, strict) {
650646
var test;
651-
if (strict ? (test = getTestTemplate(pos).match, "" == test.def && (test = getTest(pos))) : test = getTest(pos),
647+
if (strict ? (test = getTestTemplate(pos).match, "" === test.def && (test = getTest(pos))) : test = getTest(pos),
652648
null != test.fn) return test.fn;
653649
if (strict !== !0 && pos > -1 && !opts.keepStatic && void 0 === getMaskSet().validPositions[pos]) {
654650
var tests = getTests(pos);

0 commit comments

Comments
 (0)