|
|
@@ -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-92
|
|
|
+* Version: 3.3.4-100
|
|
|
*/
|
|
|
!function($) {
|
|
|
function Inputmask(alias, options) {
|
|
|
@@ -230,7 +230,7 @@
|
|
|
for (var ndx2 = 0; ndx2 < malternateMatches.length; ndx2++) {
|
|
|
var altMatch2 = malternateMatches[ndx2];
|
|
|
if (("string" != typeof altIndex || $.inArray(altMatch.locator[altMatch.alternation].toString(), altIndexArr) !== -1) && (altMatch.match.def === altMatch2.match.def || staticCanMatchDefinition(altMatch, altMatch2))) {
|
|
|
- hasMatch = altMatch.match.nativeDef === altMatch2.match.nativeDef, altMatch2.locator[altMatch.alternation].toString().indexOf(altMatch.locator[altMatch.alternation]) === -1 && (altMatch2.locator[altMatch.alternation] = altMatch2.locator[altMatch.alternation] + "," + altMatch.locator[altMatch.alternation],
|
|
|
+ hasMatch = altMatch.match.nativeDef === altMatch2.match.nativeDef, altMatch.alternation == altMatch2.alternation && altMatch2.locator[altMatch2.alternation].toString().indexOf(altMatch.locator[altMatch.alternation]) === -1 && (altMatch2.locator[altMatch2.alternation] = altMatch2.locator[altMatch2.alternation] + "," + altMatch.locator[altMatch.alternation],
|
|
|
altMatch2.alternation = altMatch.alternation, null == altMatch.match.fn && (altMatch2.na = altMatch2.na || altMatch.locator[altMatch.alternation].toString(),
|
|
|
altMatch2.na.indexOf(altMatch.locator[altMatch.alternation]) === -1 && (altMatch2.na = altMatch2.na + "," + altMatch.locator[altMatch.alternation])));
|
|
|
break;
|
|
|
@@ -1610,54 +1610,7 @@
|
|
|
function isLeapYear(year) {
|
|
|
return isNaN(year) || 29 === new Date(year, 2, 0).getDate();
|
|
|
}
|
|
|
- return Inputmask.extendDefinitions({
|
|
|
- h: {
|
|
|
- validator: "[01][0-9]|2[0-3]",
|
|
|
- cardinality: 2,
|
|
|
- prevalidator: [ {
|
|
|
- validator: "[0-2]",
|
|
|
- cardinality: 1
|
|
|
- } ]
|
|
|
- },
|
|
|
- s: {
|
|
|
- validator: "[0-5][0-9]",
|
|
|
- cardinality: 2,
|
|
|
- prevalidator: [ {
|
|
|
- validator: "[0-5]",
|
|
|
- cardinality: 1
|
|
|
- } ]
|
|
|
- },
|
|
|
- d: {
|
|
|
- validator: "0[1-9]|[12][0-9]|3[01]",
|
|
|
- cardinality: 2,
|
|
|
- prevalidator: [ {
|
|
|
- validator: "[0-3]",
|
|
|
- cardinality: 1
|
|
|
- } ]
|
|
|
- },
|
|
|
- m: {
|
|
|
- validator: "0[1-9]|1[012]",
|
|
|
- cardinality: 2,
|
|
|
- prevalidator: [ {
|
|
|
- validator: "[01]",
|
|
|
- cardinality: 1
|
|
|
- } ]
|
|
|
- },
|
|
|
- y: {
|
|
|
- validator: "(19|20)\\d{2}",
|
|
|
- cardinality: 4,
|
|
|
- prevalidator: [ {
|
|
|
- validator: "[12]",
|
|
|
- cardinality: 1
|
|
|
- }, {
|
|
|
- validator: "(19|20)",
|
|
|
- cardinality: 2
|
|
|
- }, {
|
|
|
- validator: "(19|20)\\d",
|
|
|
- cardinality: 3
|
|
|
- } ]
|
|
|
- }
|
|
|
- }), Inputmask.extendAliases({
|
|
|
+ return Inputmask.extendAliases({
|
|
|
"dd/mm/yyyy": {
|
|
|
mask: "1/2/y",
|
|
|
placeholder: "dd/mm/yyyy",
|
|
|
@@ -2508,13 +2461,15 @@
|
|
|
},
|
|
|
onBeforeMask: function(initialValue, opts) {
|
|
|
if (opts.numericInput === !0 && (initialValue = initialValue.split("").reverse().join("")),
|
|
|
- "" !== opts.radixPoint && isFinite(initialValue)) initialValue = initialValue.toString().replace(".", opts.radixPoint); else {
|
|
|
- var kommaMatches = initialValue.match(/,/g), dotMatches = initialValue.match(/\./g);
|
|
|
- dotMatches && kommaMatches ? dotMatches.length > kommaMatches.length ? (initialValue = initialValue.replace(/\./g, ""),
|
|
|
- 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"), "");
|
|
|
+ "" !== opts.radixPoint && isFinite(initialValue)) {
|
|
|
+ var vs = initialValue.split("."), groupSize = "" !== opts.groupSeparator ? parseInt(opts.groupSize) : 0;
|
|
|
+ 2 === vs.length && (vs[0].length > groupSize || vs[1].length > groupSize) && (initialValue = initialValue.toString().replace(".", opts.radixPoint));
|
|
|
}
|
|
|
- if (0 === opts.digits && (initialValue.indexOf(".") !== -1 ? initialValue = initialValue.substring(0, initialValue.indexOf(".")) : initialValue.indexOf(",") !== -1 && (initialValue = initialValue.substring(0, initialValue.indexOf(",")))),
|
|
|
+ var kommaMatches = initialValue.match(/,/g), dotMatches = initialValue.match(/\./g);
|
|
|
+ if (dotMatches && kommaMatches ? dotMatches.length > kommaMatches.length ? (initialValue = initialValue.replace(/\./g, ""),
|
|
|
+ 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"), ""),
|
|
|
+ 0 === opts.digits && (initialValue.indexOf(".") !== -1 ? initialValue = initialValue.substring(0, initialValue.indexOf(".")) : initialValue.indexOf(",") !== -1 && (initialValue = initialValue.substring(0, initialValue.indexOf(",")))),
|
|
|
"" !== opts.radixPoint && isFinite(opts.digits) && initialValue.indexOf(opts.radixPoint) !== -1) {
|
|
|
var valueParts = initialValue.split(opts.radixPoint), decPart = valueParts[1].match(new RegExp("\\d*"))[0];
|
|
|
if (parseInt(opts.digits) < decPart.toString().length) {
|
|
|
@@ -2595,9 +2550,9 @@
|
|
|
return mask += 1 === submasks.length ? submasks[0] : opts.groupmarker.start + submasks.join(opts.groupmarker.end + opts.alternatormarker + opts.groupmarker.start) + opts.groupmarker.end;
|
|
|
}
|
|
|
var maskGroups = {};
|
|
|
- opts.phoneCodes && opts.phoneCodes.length > 500 && (mask = mask.substr(1, mask.length - 2),
|
|
|
+ opts.phoneCodes && opts.phoneCodes.length > 2e3 && (mask = mask.substr(1, mask.length - 2),
|
|
|
reduceVariations(mask.split(opts.groupmarker.end + opts.alternatormarker + opts.groupmarker.start)),
|
|
|
- mask = rebuild(maskGroups)), console.log(mask);
|
|
|
+ mask = rebuild(maskGroups));
|
|
|
var mt = analyseMaskBase.call(this, mask, opts);
|
|
|
return mt;
|
|
|
}, Inputmask.extendAliases({
|