|
|
@@ -3,7 +3,7 @@
|
|
|
* https://github.com/RobinHerbots/jquery.inputmask
|
|
|
* Copyright (c) 2010 - 2016 Robin Herbots
|
|
|
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
|
|
-* Version: 3.3.4-105
|
|
|
+* Version: 3.3.4-106
|
|
|
*/
|
|
|
!function(factory) {
|
|
|
"function" == typeof define && define.amd ? define("inputmask", [ "inputmask.dependencyLib" ], factory) : "object" == typeof exports ? module.exports = factory(require("./inputmask.dependencyLib")) : factory(window.dependencyLib || jQuery);
|
|
|
@@ -53,13 +53,13 @@
|
|
|
ms;
|
|
|
}
|
|
|
function maskScope(actionObj, maskset, opts) {
|
|
|
- function getMaskTemplate(baseOnInput, minimalPos, includeInput) {
|
|
|
+ function getMaskTemplate(baseOnInput, minimalPos, includeMode) {
|
|
|
minimalPos = minimalPos || 0;
|
|
|
var ndxIntlzr, test, testPos, maskTemplate = [], pos = 0, lvp = getLastValidPosition();
|
|
|
maxLength = void 0 !== el ? el.maxLength : void 0, maxLength === -1 && (maxLength = void 0);
|
|
|
do baseOnInput === !0 && getMaskSet().validPositions[pos] ? (testPos = getMaskSet().validPositions[pos],
|
|
|
- test = testPos.match, ndxIntlzr = testPos.locator.slice(), maskTemplate.push(includeInput === !0 ? testPos.input : getPlaceholder(pos, test))) : (testPos = getTestTemplate(pos, ndxIntlzr, pos - 1),
|
|
|
- test = testPos.match, ndxIntlzr = testPos.locator.slice(), (opts.jitMasking === !1 || pos < lvp || Number.isFinite(opts.jitMasking) && opts.jitMasking > pos) && maskTemplate.push(getPlaceholder(pos, test))),
|
|
|
+ test = testPos.match, ndxIntlzr = testPos.locator.slice(), maskTemplate.push(includeMode === !0 ? testPos.input : includeMode === !1 ? test.nativeDef : getPlaceholder(pos, test))) : (testPos = getTestTemplate(pos, ndxIntlzr, pos - 1),
|
|
|
+ test = testPos.match, ndxIntlzr = testPos.locator.slice(), (opts.jitMasking === !1 || pos < lvp || Number.isFinite(opts.jitMasking) && opts.jitMasking > pos) && maskTemplate.push(includeMode === !1 ? test.nativeDef : getPlaceholder(pos, test))),
|
|
|
pos++; while ((void 0 === maxLength || pos < maxLength) && (null !== test.fn || "" !== test.def) || minimalPos > pos);
|
|
|
return "" === maskTemplate[maskTemplate.length - 1] && maskTemplate.pop(), getMaskSet().maskLength = pos + 1,
|
|
|
maskTemplate;
|
|
|
@@ -136,10 +136,10 @@
|
|
|
function resolveNdxInitializer(pos, alternateNdx, targetAlternation) {
|
|
|
var bestMatch, indexPos;
|
|
|
return (getMaskSet().tests[pos] || getMaskSet().validPositions[pos]) && $.each(getMaskSet().tests[pos] || [ getMaskSet().validPositions[pos] ], function(ndx, lmnt) {
|
|
|
- var ndxPos = targetAlternation && lmnt.locator[targetAlternation] ? lmnt.locator[targetAlternation].toString().indexOf(alternateNdx) : -1;
|
|
|
+ var alternation = void 0 !== targetAlternation ? targetAlternation : lmnt.alternation, ndxPos = lmnt.locator[alternation] ? lmnt.locator[alternation].toString().indexOf(alternateNdx) : -1;
|
|
|
(void 0 === indexPos || ndxPos < indexPos) && ndxPos !== -1 && (bestMatch = lmnt,
|
|
|
indexPos = ndxPos);
|
|
|
- }), bestMatch ? bestMatch.locator.slice(bestMatch.alternation + 1) : void 0;
|
|
|
+ }), bestMatch ? bestMatch.locator.slice(bestMatch.alternation + 1) : void 0 !== targetAlternation ? resolveNdxInitializer(pos, alternateNdx) : void 0;
|
|
|
}
|
|
|
function staticCanMatchDefinition(source, target) {
|
|
|
return null === source.match.fn && null !== target.match.fn && target.match.fn.test(source.match.def, getMaskSet(), pos, !1, opts, !1);
|
|
|
@@ -1158,11 +1158,10 @@
|
|
|
|
|
|
case "getmetadata":
|
|
|
if ($.isArray(maskset.metadata)) {
|
|
|
- for (var alternation, lvp = getLastValidPosition(void 0, !0), firstAlt = lvp; firstAlt >= 0; firstAlt--) if (getMaskSet().validPositions[firstAlt] && void 0 !== getMaskSet().validPositions[firstAlt].alternation) {
|
|
|
- alternation = getMaskSet().validPositions[firstAlt].alternation;
|
|
|
- break;
|
|
|
- }
|
|
|
- return void 0 !== alternation ? maskset.metadata[getMaskSet().validPositions[firstAlt].locator[alternation]] : [];
|
|
|
+ var maskTarget = getMaskTemplate(!0, 0, !1).join("");
|
|
|
+ return $.each(maskset.metadata, function(ndx, mtdt) {
|
|
|
+ if (mtdt.mask === maskTarget) return maskTarget = mtdt, !1;
|
|
|
+ }), maskTarget;
|
|
|
}
|
|
|
return maskset.metadata;
|
|
|
}
|