|
|
@@ -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.64-159
|
|
|
+* Version: 3.1.64-162
|
|
|
*/
|
|
|
!function($) {
|
|
|
function Inputmask(options) {
|
|
|
@@ -440,7 +440,7 @@
|
|
|
if (buffer = buffer || getBuffer().slice(), start === !0) resetMaskSet(), start = 0,
|
|
|
end = buffer.length; else for (i = start; end > i; i++) delete getMaskSet().validPositions[i],
|
|
|
delete getMaskSet().tests[i];
|
|
|
- for (i = start; end > i; i++) buffer[i] !== opts.skipOptionalPartCharacter && isValid(i, buffer[i], !0, !0);
|
|
|
+ for (i = start; end > i; i++) resetMaskSet(!0), buffer[i] !== opts.skipOptionalPartCharacter && isValid(i, buffer[i], !0, !0);
|
|
|
}
|
|
|
function casing(elem, test) {
|
|
|
switch (test.casing) {
|
|
|
@@ -1229,6 +1229,7 @@
|
|
|
keepStatic: void 0,
|
|
|
positionCaretOnTab: !1,
|
|
|
tabThrough: !1,
|
|
|
+ supportsInputType: [],
|
|
|
definitions: {
|
|
|
"9": {
|
|
|
validator: "[0-9]",
|
|
|
@@ -2043,12 +2044,12 @@
|
|
|
unmaskAsNumber: !1,
|
|
|
postFormat: function(buffer, pos, reformatOnly, opts) {
|
|
|
opts.numericInput === !0 && (buffer = buffer.reverse(), isFinite(pos) && (pos = buffer.join("").length - pos - 1));
|
|
|
- var i, suffixStripped = !1;
|
|
|
+ var i, l, suffixStripped = !1;
|
|
|
buffer.length >= opts.suffix.length && buffer.join("").indexOf(opts.suffix) === buffer.length - opts.suffix.length && (buffer.length = buffer.length - opts.suffix.length,
|
|
|
suffixStripped = !0), pos = pos >= buffer.length ? buffer.length - 1 : pos < opts.prefix.length ? opts.prefix.length : pos;
|
|
|
var needsRefresh = !1, charAtPos = buffer[pos];
|
|
|
if ("" === opts.groupSeparator || opts.numericInput !== !0 && -1 !== $.inArray(opts.radixPoint, buffer) && pos > $.inArray(opts.radixPoint, buffer) || new RegExp("[" + Inputmask.escapeRegex(opts.negationSymbol.front) + "+]").test(charAtPos)) {
|
|
|
- if (suffixStripped) for (var i = 0, l = opts.suffix.length; l > i; i++) buffer.push(opts.suffix.charAt(i));
|
|
|
+ if (suffixStripped) for (i = 0, l = opts.suffix.length; l > i; i++) buffer.push(opts.suffix.charAt(i));
|
|
|
return {
|
|
|
pos: pos
|
|
|
};
|
|
|
@@ -2088,21 +2089,23 @@
|
|
|
}, opts.postFormat((opts.prefix + opts.min).split(""), 0, !0, opts));
|
|
|
if (opts.numericInput !== !0) {
|
|
|
var tmpBufSplit = "" !== opts.radixPoint ? buffer.join("").split(opts.radixPoint) : [ buffer.join("") ], matchRslt = tmpBufSplit[0].match(opts.regex.integerPart(opts)), matchRsltDigits = 2 === tmpBufSplit.length ? tmpBufSplit[1].match(opts.regex.integerNPart(opts)) : void 0;
|
|
|
- !matchRslt || matchRslt[0] !== opts.negationSymbol.front + "0" && matchRslt[0] !== opts.negationSymbol.front && "+" !== matchRslt[0] || void 0 !== matchRsltDigits && !matchRsltDigits[0].match(/^0+$/) || buffer.splice(matchRslt.index, 1);
|
|
|
- var radixPosition = $.inArray(opts.radixPoint, buffer);
|
|
|
- if (-1 !== radixPosition) {
|
|
|
- if (isFinite(opts.digits) && !opts.digitsOptional) {
|
|
|
- for (var i = 1; i <= opts.digits; i++) (void 0 === buffer[radixPosition + i] || buffer[radixPosition + i] === opts.placeholder.charAt(0)) && (buffer[radixPosition + i] = "0");
|
|
|
- return {
|
|
|
+ if (matchRslt) {
|
|
|
+ matchRslt[0] !== opts.negationSymbol.front + "0" && matchRslt[0] !== opts.negationSymbol.front && "+" !== matchRslt[0] || void 0 !== matchRsltDigits && !matchRsltDigits[0].match(/^0+$/) || buffer.splice(matchRslt.index, 1);
|
|
|
+ var radixPosition = $.inArray(opts.radixPoint, buffer);
|
|
|
+ if (-1 !== radixPosition) {
|
|
|
+ if (isFinite(opts.digits) && !opts.digitsOptional) {
|
|
|
+ for (var i = 1; i <= opts.digits; i++) (void 0 === buffer[radixPosition + i] || buffer[radixPosition + i] === opts.placeholder.charAt(0)) && (buffer[radixPosition + i] = "0");
|
|
|
+ return {
|
|
|
+ refreshFromBuffer: !0,
|
|
|
+ buffer: buffer
|
|
|
+ };
|
|
|
+ }
|
|
|
+ if (radixPosition === buffer.length - opts.suffix.length - 1) return buffer.splice(radixPosition, 1),
|
|
|
+ {
|
|
|
refreshFromBuffer: !0,
|
|
|
buffer: buffer
|
|
|
};
|
|
|
}
|
|
|
- if (radixPosition === buffer.length - opts.suffix.length - 1) return buffer.splice(radixPosition, 1),
|
|
|
- {
|
|
|
- refreshFromBuffer: !0,
|
|
|
- buffer: buffer
|
|
|
- };
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -2174,7 +2177,7 @@
|
|
|
},
|
|
|
radixHandler: function(chrs, maskset, pos, strict, opts) {
|
|
|
if (!strict && (-1 !== $.inArray(chrs, [ ",", "." ]) && (chrs = opts.radixPoint),
|
|
|
- chrs === opts.radixPoint && void 0 != opts.digits && (isNaN(opts.digits) || parseInt(opts.digits) > 0))) {
|
|
|
+ chrs === opts.radixPoint && void 0 !== opts.digits && (isNaN(opts.digits) || parseInt(opts.digits) > 0))) {
|
|
|
var radixPos = $.inArray(opts.radixPoint, maskset.buffer), integerValue = maskset.buffer.join("").match(opts.regex.integerPart(opts));
|
|
|
if (-1 !== radixPos && maskset.validPositions[radixPos]) return maskset.validPositions[radixPos - 1] ? {
|
|
|
caret: radixPos + 1
|
|
|
@@ -2240,7 +2243,7 @@
|
|
|
isValid === !0 && (isValid = opts.leadingZeroHandler(chrs, maskset, pos, strict, opts),
|
|
|
isValid === !0)))) {
|
|
|
var radixPosition = $.inArray(opts.radixPoint, maskset.buffer);
|
|
|
- isValid = -1 != radixPosition && opts.digitsOptional === !1 && pos > radixPosition && !strict ? {
|
|
|
+ isValid = -1 !== radixPosition && opts.digitsOptional === !1 && pos > radixPosition && !strict ? {
|
|
|
pos: pos,
|
|
|
remove: pos
|
|
|
} : {
|
|
|
@@ -2255,7 +2258,7 @@
|
|
|
"+": {
|
|
|
validator: function(chrs, maskset, pos, strict, opts) {
|
|
|
var isValid = opts.signHandler(chrs, maskset, pos, strict, opts);
|
|
|
- return !isValid && (strict && opts.allowMinus && chrs === opts.negationSymbol.front || opts.allowMinus && "-" == chrs || opts.allowPlus && "+" == chrs) && (isValid = "-" == chrs ? "" != opts.negationSymbol.back ? {
|
|
|
+ return !isValid && (strict && opts.allowMinus && chrs === opts.negationSymbol.front || opts.allowMinus && "-" === chrs || opts.allowPlus && "+" === chrs) && (isValid = "-" === chrs ? "" !== opts.negationSymbol.back ? {
|
|
|
pos: pos,
|
|
|
c: "-" === chrs ? opts.negationSymbol.front : "+",
|
|
|
caret: pos + 1,
|
|
|
@@ -2288,7 +2291,7 @@
|
|
|
var isValid = opts.signHandler(chrs, maskset, pos, strict, opts);
|
|
|
if (!isValid) {
|
|
|
var radix = "[" + Inputmask.escapeRegex(opts.radixPoint) + ",\\.]";
|
|
|
- isValid = new RegExp(radix).test(chrs), isValid && maskset.validPositions[pos] && maskset.validPositions[pos].match.placeholder == opts.radixPoint && (isValid = {
|
|
|
+ isValid = new RegExp(radix).test(chrs), isValid && maskset.validPositions[pos] && maskset.validPositions[pos].match.placeholder === opts.radixPoint && (isValid = {
|
|
|
caret: pos + 1
|
|
|
});
|
|
|
}
|
|
|
@@ -2324,7 +2327,7 @@
|
|
|
initialValue = initialValue.replace(",", opts.radixPoint)) : kommaMatches.length > dotMatches.length ? (initialValue = initialValue.replace(/,/g, ""),
|
|
|
initialValue = initialValue.replace(".", opts.radixPoint)) : initialValue = initialValue.indexOf(".") < initialValue.indexOf(",") ? initialValue.replace(/\./g, "") : initialValue = initialValue.replace(/,/g, "") : initialValue = initialValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), "");
|
|
|
}
|
|
|
- if (0 == opts.digits && (-1 !== initialValue.indexOf(".") ? initialValue = initialValue.substring(0, initialValue.indexOf(".")) : -1 !== initialValue.indexOf(",") && (initialValue = initialValue.substring(0, initialValue.indexOf(",")))),
|
|
|
+ if (0 === opts.digits && (-1 !== initialValue.indexOf(".") ? initialValue = initialValue.substring(0, initialValue.indexOf(".")) : -1 !== initialValue.indexOf(",") && (initialValue = initialValue.substring(0, initialValue.indexOf(",")))),
|
|
|
"" !== opts.radixPoint && isFinite(opts.digits) && -1 !== initialValue.indexOf(opts.radixPoint)) {
|
|
|
var valueParts = initialValue.split(opts.radixPoint), decPart = valueParts[1].match(new RegExp("\\d*"))[0];
|
|
|
if (parseInt(opts.digits) < decPart.toString().length) {
|