|
|
@@ -3,7 +3,7 @@
|
|
|
* http://github.com/RobinHerbots/jquery.inputmask
|
|
|
* Copyright (c) 2010 - 2015 Robin Herbots
|
|
|
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
|
|
-* Version: 3.1.62-67
|
|
|
+* Version: 3.1.62-79
|
|
|
*/
|
|
|
!function(factory) {
|
|
|
"function" == typeof define && define.amd ? define([ "jquery" ], factory) : factory(jQuery);
|
|
|
@@ -272,7 +272,7 @@
|
|
|
}
|
|
|
function getTestTemplate(pos, ndxIntlzr, tstPs) {
|
|
|
var testPos = getMaskSet().validPositions[pos];
|
|
|
- if (void 0 == testPos) for (var testPositions = getTests(pos, ndxIntlzr, tstPs), lvp = getLastValidPosition(), lvTest = getMaskSet().validPositions[lvp] || getTests(0, void 0, void 0)[0], lvTestAltArr = void 0 != lvTest.alternation ? lvTest.locator[lvTest.alternation].split(",") : [], ndx = 0; ndx < testPositions.length && (testPos = testPositions[ndx],
|
|
|
+ if (void 0 == testPos) for (var testPositions = getTests(pos, ndxIntlzr, tstPs), lvp = getLastValidPosition(), lvTest = getMaskSet().validPositions[lvp] || getTests(0, void 0, void 0)[0], lvTestAltArr = void 0 != lvTest.alternation ? lvTest.locator[lvTest.alternation].toString().split(",") : [], ndx = 0; ndx < testPositions.length && (testPos = testPositions[ndx],
|
|
|
!(testPos.match && (opts.greedy && testPos.match.optionalQuantifier !== !0 || (testPos.match.optionality === !1 || testPos.match.newBlockMarker === !1) && testPos.match.optionalQuantifier !== !0) && (void 0 == lvTest.alternation || void 0 != testPos.locator[lvTest.alternation] && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(","), lvTestAltArr)))); ndx++) ;
|
|
|
return testPos;
|
|
|
}
|
|
|
@@ -314,12 +314,16 @@
|
|
|
matches = [], match = handleMatch(alternateToken.matches[amndx], [ amndx ].concat(loopNdx), quantifierRecurse) || match,
|
|
|
maltMatches = matches.slice(), testPos = currentPos, matches = [];
|
|
|
for (var i = 0; i < ndxInitializerClone.length; i++) ndxInitializer[i] = ndxInitializerClone[i];
|
|
|
- for (var ndx1 = 0; ndx1 < maltMatches.length; ndx1++) for (var altMatch = maltMatches[ndx1], ndx2 = 0; ndx2 < malternateMatches.length; ndx2++) {
|
|
|
- var altMatch2 = malternateMatches[ndx2];
|
|
|
- if (altMatch.match.mask == altMatch2.match.mask && ("string" != typeof altIndex || -1 != $.inArray(altMatch.locator[loopNdxCnt].toString(), altIndexArr))) {
|
|
|
- maltMatches.splice(ndx1, 1), altMatch2.locator[loopNdxCnt] = altMatch2.locator[loopNdxCnt] + "," + altMatch.locator[loopNdxCnt],
|
|
|
- altMatch2.alternation = loopNdxCnt;
|
|
|
- break;
|
|
|
+ for (var ndx1 = 0; ndx1 < maltMatches.length; ndx1++) {
|
|
|
+ var altMatch = maltMatches[ndx1];
|
|
|
+ altMatch.alternation = loopNdxCnt;
|
|
|
+ for (var ndx2 = 0; ndx2 < malternateMatches.length; ndx2++) {
|
|
|
+ var altMatch2 = malternateMatches[ndx2];
|
|
|
+ if (altMatch.match.mask == altMatch2.match.mask && ("string" != typeof altIndex || -1 != $.inArray(altMatch.locator[loopNdxCnt].toString(), altIndexArr))) {
|
|
|
+ maltMatches.splice(ndx1, 1), altMatch2.locator[loopNdxCnt] = altMatch2.locator[loopNdxCnt] + "," + altMatch.locator[loopNdxCnt],
|
|
|
+ altMatch2.alternation = loopNdxCnt;
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
malternateMatches = malternateMatches.concat(maltMatches);
|
|
|
@@ -330,10 +334,11 @@
|
|
|
lmnt.locator[loopNdxCnt] = void 0, lmnt.alternation = void 0;
|
|
|
for (var alndx = 0; alndx < altLocArr.length; alndx++) mamatch = -1 != $.inArray(altLocArr[alndx], altIndexArr),
|
|
|
mamatch && (void 0 != lmnt.locator[loopNdxCnt] ? (lmnt.locator[loopNdxCnt] += ",",
|
|
|
- lmnt.alternation = loopNdxCnt, lmnt.locator[loopNdxCnt] += altLocArr[alndx]) : lmnt.locator[loopNdxCnt] = parseInt(altLocArr[alndx]));
|
|
|
+ lmnt.locator[loopNdxCnt] += altLocArr[alndx]) : lmnt.locator[loopNdxCnt] = parseInt(altLocArr[alndx]),
|
|
|
+ lmnt.alternation = loopNdxCnt);
|
|
|
if (void 0 != lmnt.locator[loopNdxCnt]) return lmnt;
|
|
|
}
|
|
|
- })), matches = currentMatches.concat(malternateMatches), insertStop = !0;
|
|
|
+ })), matches = currentMatches.concat(malternateMatches), testPos = pos, insertStop = !0;
|
|
|
} else match = handleMatch(alternateToken.matches[altIndex], [ altIndex ].concat(loopNdx), quantifierRecurse);
|
|
|
if (match) return !0;
|
|
|
} else if (match.isQuantifier && quantifierRecurse !== !0) for (var qt = match, qndx = ndxInitializer.length > 0 && quantifierRecurse !== !0 ? ndxInitializer.shift() : 0; qndx < (isNaN(qt.quantifier.max) ? qndx + 1 : qt.quantifier.max) && pos >= testPos; qndx++) {
|
|
|
@@ -455,17 +460,18 @@
|
|
|
}), rslt;
|
|
|
}
|
|
|
function alternate(pos, c, strict, fromSetValid) {
|
|
|
- var lastAlt, alternation, isValidRslt, validPsClone = $.extend(!0, {}, getMaskSet().validPositions);
|
|
|
- for (lastAlt = getLastValidPosition(); lastAlt >= 0; lastAlt--) if (getMaskSet().validPositions[lastAlt] && void 0 != getMaskSet().validPositions[lastAlt].alternation) {
|
|
|
+ var lastAlt, alternation, isValidRslt, altPos, validPsClone = $.extend(!0, {}, getMaskSet().validPositions);
|
|
|
+ for (lastAlt = getLastValidPosition(); lastAlt >= 0; lastAlt--) if (altPos = getMaskSet().validPositions[lastAlt],
|
|
|
+ altPos && void 0 != altPos.alternation && altPos.locator[altPos.alternation].length > 1) {
|
|
|
alternation = getMaskSet().validPositions[lastAlt].alternation;
|
|
|
break;
|
|
|
}
|
|
|
- if (void 0 != alternation) for (var decisionPos in getMaskSet().validPositions) if (parseInt(decisionPos) > parseInt(lastAlt) && void 0 === getMaskSet().validPositions[decisionPos].alternation) {
|
|
|
- for (var altPos = getMaskSet().validPositions[decisionPos], decisionTaker = altPos.locator[alternation], altNdxs = getMaskSet().validPositions[lastAlt].locator[alternation].split(","), mndx = 0; mndx < altNdxs.length; mndx++) if (decisionTaker < altNdxs[mndx]) {
|
|
|
+ if (void 0 != alternation) for (var decisionPos in getMaskSet().validPositions) if (altPos = getMaskSet().validPositions[decisionPos],
|
|
|
+ parseInt(decisionPos) > parseInt(lastAlt) && altPos.alternation) {
|
|
|
+ for (var decisionTaker = altPos.locator[alternation], altNdxs = getMaskSet().validPositions[lastAlt].locator[alternation].toString().split(","), mndx = 0; mndx < altNdxs.length; mndx++) if (decisionTaker < altNdxs[mndx]) {
|
|
|
for (var possibilityPos, possibilities, dp = decisionPos - 1; dp >= 0; dp--) if (possibilityPos = getMaskSet().validPositions[dp],
|
|
|
void 0 != possibilityPos) {
|
|
|
- possibilities = possibilityPos.locator[alternation], possibilityPos.alternation = void 0,
|
|
|
- possibilityPos.locator[alternation] = parseInt(altNdxs[mndx]);
|
|
|
+ possibilities = possibilityPos.locator[alternation], possibilityPos.locator[alternation] = parseInt(altNdxs[mndx]);
|
|
|
break;
|
|
|
}
|
|
|
if (decisionTaker != possibilityPos.locator[alternation]) {
|
|
|
@@ -531,8 +537,11 @@
|
|
|
var test = getTest(pos);
|
|
|
if (null != test.fn) return test.fn;
|
|
|
if (!opts.keepStatic && void 0 == getMaskSet().validPositions[pos]) {
|
|
|
- var tests = getTests(pos), testsLength = tests.length;
|
|
|
- return "" == tests[tests.length - 1].match.def && testsLength--, testsLength > 1;
|
|
|
+ for (var tests = getTests(pos), staticAlternations = !0, i = 0; i < tests.length; i++) if ("" != tests[i].match.def && (null !== tests[i].match.fn || void 0 == tests[i].alternation || tests[i].locator[tests[i].alternation].length > 1)) {
|
|
|
+ staticAlternations = !1;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return staticAlternations;
|
|
|
}
|
|
|
return !1;
|
|
|
}
|
|
|
@@ -542,7 +551,8 @@
|
|
|
var pos, lvp = getLastValidPosition(), testPos = getMaskSet().validPositions[lvp], ndxIntlzr = void 0 != testPos ? testPos.locator.slice() : void 0;
|
|
|
for (pos = lvp + 1; void 0 == testPos || null != testPos.match.fn || null == testPos.match.fn && "" != testPos.match.def; pos++) testPos = getTestTemplate(pos, ndxIntlzr, pos - 1),
|
|
|
ndxIntlzr = testPos.locator.slice();
|
|
|
- return maskLength = pos, void 0 == maxLength || maxLength > maskLength ? maskLength : maxLength;
|
|
|
+ var lastTest = getTest(pos - 1);
|
|
|
+ return maskLength = "" != lastTest.def ? pos : pos - 1, void 0 == maxLength || maxLength > maskLength ? maskLength : maxLength;
|
|
|
}
|
|
|
function seekNext(pos) {
|
|
|
var maskL = getMaskLength();
|
|
|
@@ -575,7 +585,18 @@
|
|
|
triggerInputEvent === !0 && (skipInputEvent = !0, $(input).trigger("input"));
|
|
|
}
|
|
|
function getPlaceholder(pos, test) {
|
|
|
- return test = test || getTest(pos), void 0 != test.placeholder ? test.placeholder : null == test.fn ? test.def : opts.placeholder.charAt(pos % opts.placeholder.length);
|
|
|
+ if (test = test || getTest(pos), void 0 != test.placeholder) return test.placeholder;
|
|
|
+ if (null == test.fn) {
|
|
|
+ if (!opts.keepStatic && void 0 == getMaskSet().validPositions[pos]) {
|
|
|
+ for (var tests = getTests(pos), staticAlternations = !0, i = 0; i < tests.length; i++) if ("" != tests[i].match.def && (null !== tests[i].match.fn || void 0 == tests[i].alternation || tests[i].locator[tests[i].alternation].length > 1)) {
|
|
|
+ staticAlternations = !1;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (staticAlternations) return opts.placeholder.charAt(pos % opts.placeholder.length);
|
|
|
+ }
|
|
|
+ return test.def;
|
|
|
+ }
|
|
|
+ return opts.placeholder.charAt(pos % opts.placeholder.length);
|
|
|
}
|
|
|
function checkVal(input, writeOut, strict, nptvl) {
|
|
|
function isTemplateMatch() {
|