Robin Herbots 8 年 前
コミット
c9369e1470

+ 5 - 1
README.md

@@ -951,7 +951,11 @@ $(selector).inputmask("Regex", {
 Hook to alter the clear behavior in the stripValidPositions<br>Args => maskset, position, lastValidPosition, opts<br>Return => true|false
 
 ### postValidation
-Hook to postValidate the result from isValid.  Usefull for validating the entry as a whole.  Args => buffer, currentResult, opts<br>Return => true|false
+Hook to postValidate the result from isValid.  Usefull for validating the entry as a whole.  Args => buffer, currentResult, opts<br>Return => true|false|command object
+
+### preValidation
+Hook to preValidate the input.  Useful for validating regardless the definition. Args => buffer, pos, char, opts => return true/false/command object
+When return true, the normal validation kicks in, otherwise it is skipped.
 
 ### staticDefinitionSymbol
 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.

+ 0 - 4
README_numeric.md

@@ -27,10 +27,6 @@ Default: 3
 Enable grouping of the integer part.
 Default: false
 
-### allowPlus
-Allow to enter +.
-Default: true
-
 ### allowMinus
 Allow to enter -.
 Default: true

+ 4 - 0
dist/inputmask/inputmask.date.extensions.js

@@ -3,7 +3,11 @@
 * https://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+<<<<<<< HEAD
 * Version: 3.3.5-49
+=======
+* Version: 3.3.5-34
+>>>>>>> refs/remotes/origin/3.x
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "./dependencyLibs/inputmask.dependencyLib", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("./dependencyLibs/inputmask.dependencyLib"), require("./inputmask")) : factory(window.dependencyLib || jQuery, window.Inputmask);

+ 12 - 0
dist/inputmask/inputmask.dependencyLib.js

@@ -0,0 +1,12 @@
+/*!
+* inputmask.dependencyLib.js
+* https://github.com/RobinHerbots/jquery.inputmask
+* Copyright (c) 2010 - 2017 Robin Herbots
+* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+* Version: 3.3.5-34
+*/
+!function(factory) {
+    "function" == typeof define && define.amd ? define("inputmask.dependencyLib", [ "jquery" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery")) : factory(jQuery);
+}(function($) {
+    return window.dependencyLib = $, $;
+});

+ 4 - 0
dist/inputmask/inputmask.extensions.js

@@ -3,7 +3,11 @@
 * https://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+<<<<<<< HEAD
 * Version: 3.3.5-49
+=======
+* Version: 3.3.5-34
+>>>>>>> refs/remotes/origin/3.x
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "./dependencyLibs/inputmask.dependencyLib", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("./dependencyLibs/inputmask.dependencyLib"), require("./inputmask")) : factory(window.dependencyLib || jQuery, window.Inputmask);

+ 6 - 1
dist/inputmask/inputmask.js

@@ -3,7 +3,11 @@
 * https://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+<<<<<<< HEAD
 * Version: 3.3.5-49
+=======
+* Version: 3.3.5-34
+>>>>>>> refs/remotes/origin/3.x
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "./dependencyLibs/inputmask.dependencyLib", "./global/window", "./global/document" ], factory) : "object" == typeof exports ? module.exports = factory(require("./dependencyLibs/inputmask.dependencyLib"), require("../global/window"), require("../global/document")) : factory(window.dependencyLib || jQuery, window, document);
@@ -834,13 +838,14 @@
                 } else isSupported = "partial";
                 return isSupported !== !1 && patchValueProperty(input), isSupported;
             }
+            EventRuler.off(el);
             var isSupported = isElementTypeSupported(elem, opts);
             if (isSupported !== !1 && (el = elem, $el = $(el), ("rtl" === el.dir || opts.rightAlign) && (el.style.textAlign = "right"), 
             ("rtl" === el.dir || opts.numericInput) && (el.dir = "ltr", el.removeAttribute("dir"), 
             el.inputmask.isRTL = !0, isRTL = !0), opts.colorMask === !0 && initializeColorMask(el), 
             android && (el.hasOwnProperty("inputmode") && (el.inputmode = opts.inputmode, el.setAttribute("inputmode", opts.inputmode)), 
             "rtfm" === opts.androidHack && (opts.colorMask !== !0 && initializeColorMask(el), 
-            el.type = "password")), EventRuler.off(el), isSupported === !0 && (EventRuler.on(el, "submit", EventHandlers.submitEvent), 
+            el.type = "password")), isSupported === !0 && (EventRuler.on(el, "submit", EventHandlers.submitEvent), 
             EventRuler.on(el, "reset", EventHandlers.resetEvent), EventRuler.on(el, "mouseenter", EventHandlers.mouseenterEvent), 
             EventRuler.on(el, "blur", EventHandlers.blurEvent), EventRuler.on(el, "focus", EventHandlers.focusEvent), 
             EventRuler.on(el, "mouseleave", EventHandlers.mouseleaveEvent), opts.colorMask !== !0 && EventRuler.on(el, "click", EventHandlers.clickEvent), 

+ 4 - 0
dist/inputmask/inputmask.numeric.extensions.js

@@ -3,7 +3,11 @@
 * https://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+<<<<<<< HEAD
 * Version: 3.3.5-49
+=======
+* Version: 3.3.5-34
+>>>>>>> refs/remotes/origin/3.x
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "./dependencyLibs/inputmask.dependencyLib", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("./dependencyLibs/inputmask.dependencyLib"), require("./inputmask")) : factory(window.dependencyLib || jQuery, window.Inputmask);

+ 4 - 0
dist/inputmask/inputmask.phone.extensions.js

@@ -3,7 +3,11 @@
 * https://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+<<<<<<< HEAD
 * Version: 3.3.5-49
+=======
+* Version: 3.3.5-34
+>>>>>>> refs/remotes/origin/3.x
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "./dependencyLibs/inputmask.dependencyLib", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("./dependencyLibs/inputmask.dependencyLib"), require("./inputmask")) : factory(window.dependencyLib || jQuery, window.Inputmask);

+ 7 - 3
dist/inputmask/inputmask.regex.extensions.js

@@ -3,7 +3,11 @@
 * https://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+<<<<<<< HEAD
 * Version: 3.3.5-49
+=======
+* Version: 3.3.5-34
+>>>>>>> refs/remotes/origin/3.x
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "./dependencyLibs/inputmask.dependencyLib", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("./dependencyLibs/inputmask.dependencyLib"), require("./inputmask")) : factory(window.dependencyLib || jQuery, window.Inputmask);
@@ -18,7 +22,7 @@
             tokenizer: /\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g,
             quantifierFilter: /[0-9]+[^,]/,
             isComplete: function(buffer, opts) {
-                return new RegExp(opts.regex).test(buffer.join(""));
+                return new RegExp(opts.regex, opts.casing ? "i" : "").test(buffer.join(""));
             },
             definitions: {
                 r: {
@@ -85,12 +89,12 @@
                                     if ("[" == matchToken.charAt(0)) {
                                         testExp = regexPart, testExp += matchToken;
                                         for (var j = 0; j < openGroupCount; j++) testExp += ")";
-                                        var exp = new RegExp("^(" + testExp + ")$");
+                                        var exp = new RegExp("^(" + testExp + ")$", opts.casing ? "i" : "");
                                         isvalid = exp.test(bufferStr);
                                     } else for (var l = 0, tl = matchToken.length; l < tl; l++) if ("\\" !== matchToken.charAt(l)) {
                                         testExp = regexPart, testExp += matchToken.substr(0, l + 1), testExp = testExp.replace(/\|$/, "");
                                         for (var j = 0; j < openGroupCount; j++) testExp += ")";
-                                        var exp = new RegExp("^(" + testExp + ")$");
+                                        var exp = new RegExp("^(" + testExp + ")$", opts.casing ? "i" : "");
                                         if (isvalid = exp.test(bufferStr)) break;
                                     }
                                     regexPart += matchToken;

+ 4 - 0
dist/inputmask/jquery.inputmask.js

@@ -3,7 +3,11 @@
 * https://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+<<<<<<< HEAD
 * Version: 3.3.5-49
+=======
+* Version: 3.3.5-34
+>>>>>>> refs/remotes/origin/3.x
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery, window.Inputmask);

+ 10 - 5
dist/jquery.inputmask.bundle.js

@@ -3,7 +3,11 @@
 * https://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+<<<<<<< HEAD
 * Version: 3.3.5-49
+=======
+* Version: 3.3.5-34
+>>>>>>> refs/remotes/origin/3.x
 */
 !function($, window, document, undefined) {
     function Inputmask(alias, options, internal) {
@@ -832,13 +836,14 @@
                 } else isSupported = "partial";
                 return isSupported !== !1 && patchValueProperty(input), isSupported;
             }
+            EventRuler.off(el);
             var isSupported = isElementTypeSupported(elem, opts);
             if (isSupported !== !1 && (el = elem, $el = $(el), ("rtl" === el.dir || opts.rightAlign) && (el.style.textAlign = "right"), 
             ("rtl" === el.dir || opts.numericInput) && (el.dir = "ltr", el.removeAttribute("dir"), 
             el.inputmask.isRTL = !0, isRTL = !0), opts.colorMask === !0 && initializeColorMask(el), 
             android && (el.hasOwnProperty("inputmode") && (el.inputmode = opts.inputmode, el.setAttribute("inputmode", opts.inputmode)), 
             "rtfm" === opts.androidHack && (opts.colorMask !== !0 && initializeColorMask(el), 
-            el.type = "password")), EventRuler.off(el), isSupported === !0 && (EventRuler.on(el, "submit", EventHandlers.submitEvent), 
+            el.type = "password")), isSupported === !0 && (EventRuler.on(el, "submit", EventHandlers.submitEvent), 
             EventRuler.on(el, "reset", EventHandlers.resetEvent), EventRuler.on(el, "mouseenter", EventHandlers.mouseenterEvent), 
             EventRuler.on(el, "blur", EventHandlers.blurEvent), EventRuler.on(el, "focus", EventHandlers.focusEvent), 
             EventRuler.on(el, "mouseleave", EventHandlers.mouseleaveEvent), opts.colorMask !== !0 && EventRuler.on(el, "click", EventHandlers.clickEvent), 
@@ -1604,7 +1609,7 @@
             });
         }
     }), $.fn.inputmask;
-}(jQuery, Inputmask), function($, Inputmask) {}(jQuery, Inputmask), function($, Inputmask) {
+}(jQuery, Inputmask), function($, Inputmask) {
     function isLeapYear(year) {
         return isNaN(year) || 29 === new Date(year, 2, 0).getDate();
     }
@@ -2611,7 +2616,7 @@
             tokenizer: /\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g,
             quantifierFilter: /[0-9]+[^,]/,
             isComplete: function(buffer, opts) {
-                return new RegExp(opts.regex).test(buffer.join(""));
+                return new RegExp(opts.regex, opts.casing ? "i" : "").test(buffer.join(""));
             },
             definitions: {
                 r: {
@@ -2678,12 +2683,12 @@
                                     if ("[" == matchToken.charAt(0)) {
                                         testExp = regexPart, testExp += matchToken;
                                         for (var j = 0; j < openGroupCount; j++) testExp += ")";
-                                        var exp = new RegExp("^(" + testExp + ")$");
+                                        var exp = new RegExp("^(" + testExp + ")$", opts.casing ? "i" : "");
                                         isvalid = exp.test(bufferStr);
                                     } else for (var l = 0, tl = matchToken.length; l < tl; l++) if ("\\" !== matchToken.charAt(l)) {
                                         testExp = regexPart, testExp += matchToken.substr(0, l + 1), testExp = testExp.replace(/\|$/, "");
                                         for (var j = 0; j < openGroupCount; j++) testExp += ")";
-                                        var exp = new RegExp("^(" + testExp + ")$");
+                                        var exp = new RegExp("^(" + testExp + ")$", opts.casing ? "i" : "");
                                         if (isvalid = exp.test(bufferStr)) break;
                                     }
                                     regexPart += matchToken;

ファイルの差分が大きいため隠しています
+ 4 - 0
dist/min/inputmask/inputmask.date.extensions.min.js


+ 8 - 0
dist/min/inputmask/inputmask.dependencyLib.min.js

@@ -0,0 +1,8 @@
+/*!
+* inputmask.dependencyLib.min.js
+* https://github.com/RobinHerbots/jquery.inputmask
+* Copyright (c) 2010 - 2017 Robin Herbots
+* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+* Version: 3.3.5-34
+*/
+!function(a){"function"==typeof define&&define.amd?define("inputmask.dependencyLib",["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){return window.dependencyLib=a,a});

ファイルの差分が大きいため隠しています
+ 4 - 0
dist/min/inputmask/inputmask.extensions.min.js


ファイルの差分が大きいため隠しています
+ 8 - 1
dist/min/inputmask/inputmask.min.js


ファイルの差分が大きいため隠しています
+ 4 - 0
dist/min/inputmask/inputmask.numeric.extensions.min.js


ファイルの差分が大きいため隠しています
+ 4 - 0
dist/min/inputmask/inputmask.phone.extensions.min.js


ファイルの差分が大きいため隠しています
+ 7 - 1
dist/min/inputmask/inputmask.regex.extensions.min.js


ファイルの差分が大きいため隠しています
+ 4 - 0
dist/min/inputmask/jquery.inputmask.min.js


ファイルの差分が大きいため隠しています
+ 9 - 1
dist/min/jquery.inputmask.bundle.min.js


+ 1 - 2
js/dependencyLibs/inputmask.dependencyLib.jqlite.js

@@ -10,7 +10,7 @@
 	} else if (typeof exports === "object") {
 		module.exports = factory(require("jqlite"), require("../global/window"), require("../global/document"));
 	} else {
-		factory(jqlite, window, document);
+		window.dependencyLib = 	factory(jqlite, window, document);
 	}
 }
 (function ($, window, document) {
@@ -222,6 +222,5 @@
 		};
 	$.Event.prototype = window.Event.prototype;
 
-	window.dependencyLib = $;
 	return $;
 }));

+ 4 - 5
js/dependencyLibs/inputmask.dependencyLib.jquery.js

@@ -1,13 +1,12 @@
 (function (factory) {
 	if (typeof define === "function" && define.amd) {
-		define(["jquery", "../global/window"], factory);
+		define(["jquery"], factory);
 	} else if (typeof exports === "object") {
-		module.exports = factory(require("jquery"), require("../global/window"));
+		module.exports = factory(require("jquery"));
 	} else {
-		factory(jQuery, window);
+		window.dependencyLib = factory(jQuery);
 	}
 }
-(function ($, window) {
-	window.dependencyLib = $;
+(function ($) {
 	return $;
 }));

+ 1 - 2
js/dependencyLibs/inputmask.dependencyLib.js

@@ -10,7 +10,7 @@
 	} else if (typeof exports === "object") {
 		module.exports = factory(require("../global/window"), require("../global/document"));
 	} else {
-		factory(window, document);
+		window.dependencyLib = factory(window, document);
 	}
 }
 (function (window, document) {
@@ -435,6 +435,5 @@
 	}
 	DependencyLib.Event.prototype = window.Event.prototype;
 
-	window.dependencyLib = DependencyLib;
 	return DependencyLib;
 }));

+ 195 - 390
js/inputmask.numeric.extensions.js

@@ -16,28 +16,28 @@
 		factory(window.dependencyLib || jQuery, window.Inputmask);
 	}
 }
-(function ($, Inputmask) {
+(function ($, Inputmask, undefined) {
+	function autoEscape(txt, opts) {
+		var escapedTxt = "";
+		for (var i = 0; i < txt.length; i++) {
+			if (opts.definitions[txt.charAt(i)] ||
+				opts.optionalmarker.start === txt.charAt(i) ||
+				opts.optionalmarker.end === txt.charAt(i) ||
+				opts.quantifiermarker.start === txt.charAt(i) ||
+				opts.quantifiermarker.end === txt.charAt(i) ||
+				opts.groupmarker.start === txt.charAt(i) ||
+				opts.groupmarker.end === txt.charAt(i) ||
+				opts.alternatormarker === txt.charAt(i))
+				escapedTxt += "\\" + txt.charAt(i)
+			else escapedTxt += txt.charAt(i);
+		}
+		return escapedTxt;
+	}
+
 	//number aliases
 	Inputmask.extendAliases({
 		"numeric": {
 			mask: function (opts) {
-				function autoEscape(txt) {
-					var escapedTxt = "";
-					for (var i = 0; i < txt.length; i++) {
-						if (opts.definitions[txt.charAt(i)] ||
-							opts.optionalmarker.start === txt.charAt(i) ||
-							opts.optionalmarker.end === txt.charAt(i) ||
-							opts.quantifiermarker.start === txt.charAt(i) ||
-							opts.quantifiermarker.end === txt.charAt(i) ||
-							opts.groupmarker.start === txt.charAt(i) ||
-							opts.groupmarker.end === txt.charAt(i) ||
-							opts.alternatormarker === txt.charAt(i))
-							escapedTxt += "\\" + txt.charAt(i)
-						else escapedTxt += txt.charAt(i);
-					}
-					return escapedTxt;
-				}
-
 				if (opts.repeat !== 0 && isNaN(opts.integerDigits)) {
 					opts.integerDigits = opts.repeat;
 				}
@@ -84,7 +84,7 @@
 				}
 
 				var mask = "[+]";
-				mask += autoEscape(opts.prefix);
+				mask += autoEscape(opts.prefix, opts);
 
 				if (opts.integerOptional === true) {
 					mask += "~{1," + opts.integerDigits + "}";
@@ -100,7 +100,7 @@
 						} else mask += opts.radixPointDefinitionSymbol + ";{" + opts.digits + "}";
 					}
 				}
-				mask += autoEscape(opts.suffix);
+				mask += autoEscape(opts.suffix, opts);
 				mask += "[-]";
 
 				opts.greedy = false; //enforce greedy false
@@ -115,6 +115,7 @@
 					if (opts.radixPoint === ",") opts.max = opts.max.replace(opts.radixPoint, ".");
 				}
 
+
 				return mask;
 			},
 			placeholder: "",
@@ -126,7 +127,6 @@
 			groupSize: 3,
 			groupSeparator: "",
 			autoGroup: false,
-			allowPlus: true,
 			allowMinus: true,
 			negationSymbol: {
 				front: "-", //"("
@@ -145,172 +145,176 @@
 			autoUnmask: false,
 			unmaskAsNumber: false,
 			inputmode: "numeric",
-			postFormat: function (buffer, pos, opts) { //this needs to be removed // this is crap
-				// console.log(buffer);
-				if (opts.numericInput === true) {
-					buffer = buffer.reverse();
-					if (isFinite(pos)) {
-						pos = buffer.join("").length - pos - 1;
+			preValidation: function (buffer, pos, c, opts) {
+				if (c === "-" || c == opts.negationSymbol.front) {
+					if (opts.allowMinus !== true) return false;
+					opts.isNegative = opts.isNegative === undefined ? true : !opts.isNegative;
+					return {caretPos: pos};
+				}
+				if (opts.numericInput !== true && c === opts.radixPoint && (opts.digits !== undefined && (isNaN(opts.digits) || parseInt(opts.digits) > 0))) {
+					var radixPos = $.inArray(opts.radixPoint, buffer);
+					if (radixPos !== -1) {
+						return {"caret": radixPos + 1};
 					}
 				}
-				var i, l;
 
-				//position overflow corrections
-				pos = pos >= buffer.length ? buffer.length - 1 : (pos < 0 ? 0 : pos);
-
-				var charAtPos = buffer[pos];
+				return true;
+			},
+			postValidation: function (buffer, currentResult, opts) {
+				function buildPostMask(buffer, opts) {
+					//define base for formatter
+					var postMask = "";
+					postMask += "(" + opts.groupSeparator + "*{" + opts.groupSize + "}){*}";
+					if (opts.radixPoint !== "") {
+						var radixSplit = buffer.join("").split(opts.radixPoint);
+						if (radixSplit[1]) {
+							postMask += opts.radixPoint + "*{" + radixSplit[1].match(/^\d*\??\d*/)[0].length + "}";
+						}
+					}
 
-				var cbuf = buffer.slice();
-				if (charAtPos === opts.groupSeparator && pos > opts.prefix.length && pos < (buffer.length - opts.suffix.length)) {
-					cbuf.splice(pos--, 1);
-					charAtPos = cbuf[pos];
+					return postMask;
 				}
 
-				var isNegative = cbuf.join("").match(new RegExp("^" + Inputmask.escapeRegex(opts.negationSymbol.front)));
-				isNegative = isNegative !== null && isNegative.length === 1;
+				var suffix = opts.suffix.split(""), prefix = opts.prefix.split("");
 
-				if (pos > ((isNegative ? opts.negationSymbol.front.length : 0 ) + opts.prefix.length ) && (pos < (cbuf.length - opts.suffix.length))) {
-					//mark current pos
-					cbuf[pos] = "!";
-				}
-				var bufVal = cbuf.join(""), bufValOrigin = cbuf.join(); //join without args to keep the exact elements
+				if (currentResult.pos == undefined && currentResult.caret !== undefined) return currentResult;
 
-				if (isNegative) {
-					bufVal = bufVal.replace(new RegExp("^" + Inputmask.escapeRegex(opts.negationSymbol.front)), "");
-					bufVal = bufVal.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "");
+				var caretPos = currentResult.caretPos || currentResult.pos;
+				var maskedValue = buffer.slice();
+				if (opts.numericInput) {
+					caretPos = maskedValue.length - caretPos;
+					maskedValue = maskedValue.reverse();
 				}
+				//mark caretPos
+				var charAtPos = maskedValue[caretPos];
+				if (caretPos == maskedValue.length - 1 && charAtPos === opts.radixPoint) return currentResult;
 
-				bufVal = bufVal.replace(new RegExp(Inputmask.escapeRegex(opts.suffix) + "$"), "");
-				bufVal = bufVal.replace(new RegExp("^" + Inputmask.escapeRegex(opts.prefix)), "");
-				if (bufVal.length > 0 && opts.autoGroup || bufVal.indexOf(opts.groupSeparator) !== -1) {
-					var escapedGroupSeparator = Inputmask.escapeRegex(opts.groupSeparator);
-					bufVal = bufVal.replace(new RegExp(escapedGroupSeparator, "g"), "");
-					var radixSplit = bufVal.split(charAtPos === opts.radixPoint ? "!" : opts.radixPoint);
-					bufVal = opts.radixPoint === "" ? bufVal : radixSplit[0];
-					if (charAtPos !== opts.negationSymbol.front) bufVal = bufVal.replace("!", "?");
-					if (bufVal.length > opts.groupSize) {
-						var reg = new RegExp("([-\+]?[\\d\?]+)([\\d\?]{" + opts.groupSize + "})");
-						while (reg.test(bufVal) && opts.groupSeparator !== "") {
-							bufVal = bufVal.replace(reg, "$1" + opts.groupSeparator + "$2");
-							bufVal = bufVal.replace(opts.groupSeparator + opts.groupSeparator, opts.groupSeparator);
+				if (charAtPos !== undefined) {
+					if (charAtPos !== opts.radixPoint &&
+						charAtPos !== opts.negationSymbol.front &&
+						charAtPos !== opts.negationSymbol.back
+					) {
+						maskedValue[caretPos] = "?";
+						if (caretPos >= (opts.isNegative ? 0 : 1) && caretPos < opts.prefix.length + (opts.isNegative ? 0 : 1)) {
+							prefix[caretPos - (opts.isNegative ? 0 : 1)] = "?";
+						} else if (caretPos >= (maskedValue.length - opts.suffix.length) - (opts.isNegative ? 0 : 1)) {
+							suffix[caretPos - (maskedValue.length - opts.suffix.length - (opts.isNegative ? 0 : 1))] = "?";
 						}
 					}
-					bufVal = bufVal.replace("?", "!");
-					if (opts.radixPoint !== "" && radixSplit.length > 1) {
-						bufVal += (charAtPos === opts.radixPoint ? "!" : opts.radixPoint) + radixSplit[1];
-					}
 				}
-
-				bufVal = opts.prefix + bufVal + opts.suffix;
-				if (isNegative) {
-					bufVal = opts.negationSymbol.front + bufVal + opts.negationSymbol.back;
+				//make numeric
+				prefix = prefix.join("");
+				suffix = suffix.join("");
+				var processValue = maskedValue.join("").replace(prefix, "");
+				processValue = processValue.replace(suffix, "");
+				processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), "");
+				//strip negation symbol
+				processValue = processValue.replace(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"), "");
+				processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "");
+				//strip placeholder at the end
+				if (isNaN(opts.placeholder)) {
+					processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.placeholder), "g"), "");
 				}
 
-				var needsRefresh = bufValOrigin !== bufVal.split('').join(),
-					newPos = $.inArray("!", bufVal);
-				if (newPos === -1) newPos = pos;
-				if (needsRefresh) {
-					buffer.length = bufVal.length; //align the length
-					for (i = 0, l = bufVal.length; i < l; i++) {
-						buffer[i] = bufVal.charAt(i);
-					}
-					buffer[newPos] = charAtPos;
-				}
+				//strip leading zeroes
+				processValue = processValue.replace(/^0/g, "");
+				if (processValue[0] === opts.radixPoint) processValue = "0" + processValue;
 
-				// console.log("formatted " + buffer + " refresh " + needsRefresh);
-				newPos = (opts.numericInput && isFinite(pos)) ? buffer.join("").length - newPos - 1 : newPos;
-				if (opts.numericInput) {
-					buffer = buffer.reverse();
-					if ($.inArray(opts.radixPoint, buffer) < newPos && (buffer.join("").length - opts.suffix.length) !== newPos) {
-						newPos = newPos - 1;
-					}
-				}
-				return {
-					pos: newPos,
-					"refreshFromBuffer": needsRefresh,
-					"buffer": buffer,
-					isNegative: isNegative
-				};
-			}
-			,
-			onBeforeWrite: function (e, buffer, caretPos, opts) {
-				var rslt;
-				if (e && (e.type === "blur" || e.type === "checkval" || e.type === "keydown")) {
-					var maskedValue = opts.numericInput ? buffer.slice().reverse().join("") : buffer.join(""),
-						processValue = maskedValue.replace(opts.prefix, "");
-					processValue = processValue.replace(opts.suffix, "");
-					processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), "");
-					if (opts.radixPoint === ",") processValue = processValue.replace(opts.radixPoint, ".");
-					//handle negation symbol
-					var isNegative = processValue.match(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"));
-					isNegative = isNegative !== null && isNegative.length === 1;
-					processValue = processValue.replace(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"), "");
-					processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "");
-					//strip placeholder at the end
-					if (isNaN(opts.placeholder)) {
-						processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.placeholder), "g"), "");
-					}
-					processValue = processValue === opts.negationSymbol.front ? processValue + "0" : processValue;
-
-					if (processValue !== "" && isFinite(processValue)) {
-						var floatValue = parseFloat(processValue),
-							signedFloatValue = isNegative ? floatValue * -1 : floatValue;
-						if (e.type === "blur") {
-							if (opts.min !== null && isFinite(opts.min) && signedFloatValue < parseFloat(opts.min)) {
-								floatValue = Math.abs(opts.min);
-								isNegative = opts.min < 0;
-								maskedValue = undefined;
-							}
-							else if (opts.max !== null && isFinite(opts.max) && signedFloatValue > parseFloat(opts.max)) {
-								floatValue = Math.abs(opts.max);
-								isNegative = opts.max < 0;
-								maskedValue = undefined;
+				if (processValue !== "") {
+					processValue = processValue.split("");
+					//handle digits
+					if (isFinite(opts.digits)) {
+						var radixPosition = $.inArray(opts.radixPoint, processValue);
+						var rpb = $.inArray(opts.radixPoint, maskedValue);
+						if (radixPosition === -1) {
+							processValue.push(opts.radixPoint);
+							radixPosition = processValue.length - 1;
+						}
+						for (var i = 1; i <= opts.digits; i++) {
+							if (!opts.digitsOptional && (processValue[radixPosition + i] === undefined || processValue[radixPosition + i] === opts.placeholder.charAt(0))) {
+								processValue[radixPosition + i] = "0";
+							} else if (rpb !== -1 && maskedValue[rpb + i] !== undefined) {
+								processValue[radixPosition + i] = processValue[radixPosition + i] || maskedValue[rpb + i];
 							}
 						}
+					}
 
-						processValue = floatValue.toString().replace(".", opts.radixPoint).split('');
-						if (isFinite(opts.digits)) {
-							var radixPosition = $.inArray(opts.radixPoint, processValue);
-							var rpb = $.inArray(opts.radixPoint, maskedValue);
-							if (radixPosition === -1) {
-								processValue.push(opts.radixPoint);
-								radixPosition = processValue.length - 1;
-							}
-							for (var i = 1; i <= opts.digits; i++) {
-								if (!opts.digitsOptional && (processValue[radixPosition + i] === undefined || processValue[radixPosition + i] === opts.placeholder.charAt(0))) {
-									processValue[radixPosition + i] = "0";
-								} else if (rpb !== -1 && maskedValue[rpb + i] !== undefined) {
-									processValue[radixPosition + i] = processValue[radixPosition + i] || maskedValue[rpb + i];
+					if (opts.autoGroup === true && opts.groupSeparator !== "") {
+						processValue = Inputmask(buildPostMask(processValue, opts), {
+							numericInput: true, jitMasking: true,
+							definitions: {
+								"*": {
+									validator: "[0-9?]",
+									cardinality: 1
 								}
 							}
+						}).format(processValue.join(""));
+					} else processValue = processValue.join("");
 
-							if (processValue[processValue.length - 1] === opts.radixPoint) {
-								delete processValue[processValue.length - 1];
-							}
+					processValue = prefix + processValue;
+					processValue += suffix;
+					if (opts.isNegative) {
+						processValue = opts.negationSymbol.front + processValue;
+						processValue += opts.negationSymbol.back;
+					}
+					processValue = processValue.split("");
+					//unmark position
+					if (charAtPos !== undefined) {
+						if (charAtPos !== opts.radixPoint && charAtPos !== opts.negationSymbol.front && charAtPos !== opts.negationSymbol.back) {
+							caretPos = $.inArray("?", processValue);
+							processValue[caretPos] = charAtPos;
+						} else if (charAtPos === opts.radixPoint &&
+							charAtPos === opts.negationSymbol.front &&
+							charAtPos === opts.negationSymbol.back) {
+							caretPos = $.inArray(charAtPos, processValue);
 						}
+					}
 
-						if ((floatValue.toString() !== processValue && floatValue.toString() + "." !== processValue) || isNegative) {
-							processValue = (opts.prefix + processValue.join("")).split("");
-							if (isNegative && (floatValue !== 0 || e.type !== "blur")) {
-								processValue.unshift(opts.negationSymbol.front);
-								processValue.push(opts.negationSymbol.back);
-							}
 
-							if (opts.numericInput) processValue = processValue.reverse();
-							rslt = opts.postFormat(processValue, opts.numericInput ? caretPos : caretPos - 1, opts);
-							if (rslt.buffer) rslt.refreshFromBuffer = rslt.buffer.join("") !== buffer.join("");
-							return rslt;
-						}
+					if (opts.numericInput) {
+						caretPos = processValue.length - caretPos;
+						processValue = processValue.reverse();
 					}
-				}
-				if (opts.autoGroup) {
-					rslt = opts.postFormat(buffer, opts.numericInput ? caretPos : (caretPos - 1), opts);
-					rslt.caret = //FIXME
-						((caretPos <= (rslt.isNegative ? opts.negationSymbol.front.length : 0) + opts.prefix.length) ||
-						(caretPos > (rslt.buffer.length - (rslt.isNegative ? opts.negationSymbol.back.length : 0))))
-							? caretPos : caretPos + 1;
+
+					var rslt = {
+						caret: currentResult.caret || (currentResult.pos ? caretPos + 1 : caretPos),
+						buffer: processValue,
+						refreshFromBuffer: processValue.join("") != buffer.join("")
+					};
+
+					console.log(JSON.stringify(rslt));
 					return rslt;
 				}
+				return currentResult;
+			},
+			onBeforeWrite: function (e, buffer, caretPos, opts) {
+				if (e) {
+					if (e.type === "keydown") {
+						return opts.postValidation(buffer, {caretPos: caretPos}, opts);
+					}
+					if (e.type === "blur") {
+						// var valc = processValue.split("")[caretPos] = charAtPos;
+						// var floatValue = parseFloat(valc),
+						// 	signedFloatValue = opts.isNegative ? floatValue * -1 : floatValue;
+						//
+						// if (opts.min !== null && isFinite(opts.min) && signedFloatValue < parseFloat(opts.min)) {
+						// 	floatValue = Math.abs(opts.min);
+						// 	opts.isNegative = opts.min < 0;
+						// 	maskedValue = undefined;
+						// }
+						// else if (opts.max !== null && isFinite(opts.max) && signedFloatValue > parseFloat(opts.max)) {
+						// 	floatValue = Math.abs(opts.max);
+						// 	opts.isNegative = opts.max < 0;
+						// 	maskedValue = undefined;
+						// }
+
+
+						//strip radixpoint at the end
+						// if (processValue[processValue.length - 1] === opts.radixPoint) {
+						// 	delete processValue[processValue.length - 1];
+						// }
+					}
+				}
 			},
 			regex: {
 				integerPart: function (opts, emptyCheck) {
@@ -320,253 +324,54 @@
 				integerNPart: function (opts) {
 					return new RegExp("[\\d" + Inputmask.escapeRegex(opts.groupSeparator) + Inputmask.escapeRegex(opts.placeholder.charAt(0)) + "]+");
 				}
-			},
-			signHandler: function (chrs, maskset, pos, strict, opts) {
-				if (!strict && (opts.allowMinus && chrs === "-") || (opts.allowPlus && chrs === "+")) {
-					var matchRslt = maskset.buffer.join("").match(opts.regex.integerPart(opts));
-					if (matchRslt === null) matchRslt = maskset.buffer.join("").match(opts.regex.integerPart(opts, true));
-					if (matchRslt && matchRslt[0].length > 0) {
-						if (maskset.buffer[matchRslt.index] === (chrs === "-" ? "+" : opts.negationSymbol.front)) {
-							if (chrs === "-") {
-								if (opts.negationSymbol.back !== "") {
-									return {
-										"pos": 0,
-										"c": opts.negationSymbol.front,
-										"remove": 0,
-										"caret": pos,
-										"insert": {
-											"pos": maskset.buffer.length - 1,
-											"c": opts.negationSymbol.back
-										}
-									};
-								} else {
-									return {
-										"pos": 0,
-										"c": opts.negationSymbol.front,
-										"remove": 0,
-										"caret": pos
-									};
-								}
-							} else {
-								if (opts.negationSymbol.back !== "") {
-									return {
-										"pos": 0,
-										"c": "+",
-										"remove": [0, maskset.buffer.length - 1],
-										"caret": pos
-									};
-								} else {
-									return {
-										"pos": 0,
-										"c": "+",
-										"remove": 0,
-										"caret": pos
-									};
-								}
-							}
-						} else if (maskset.buffer[0] === (chrs === "-" ? opts.negationSymbol.front : "+")) {
-							if (chrs === "-" && opts.negationSymbol.back !== "") {
-								return {
-									"remove": [0, maskset.buffer.length - 1],
-									"caret": pos - 1
-								};
-							} else {
-								return {
-									"remove": 0,
-									"caret": pos - 1
-								};
-							}
-						} else {
-							if (chrs === "-") {
-								if (opts.negationSymbol.back !== "") {
-									return {
-										"pos": 0,
-										"c": opts.negationSymbol.front,
-										"caret": pos + 1,
-										"insert": {
-											"pos": maskset.buffer.length,
-											"c": opts.negationSymbol.back
-										}
-									};
-								} else {
-									return {
-										"pos": 0,
-										"c": opts.negationSymbol.front,
-										"caret": pos + 1
-									};
-								}
-							} else {
-								return {
-									"pos": 0,
-									"c": chrs,
-									"caret": pos + 1
-								};
-							}
-						}
-					}
-				}
-				return false;
 			}
 			,
-			radixHandler: function (chrs, maskset, pos, strict, opts) {
-				if (!strict && opts.numericInput !== true) {
-					//if ($.inArray(chrs, [",", "."]) !== -1) chrs = opts.radixPoint;
-					if (chrs === opts.radixPoint && (opts.digits !== undefined && (isNaN(opts.digits) || parseInt(opts.digits) > 0))) {
-						var radixPos = $.inArray(opts.radixPoint, maskset.buffer),
-							integerValue = maskset.buffer.join("").match(opts.regex.integerPart(opts));
-
-						if (radixPos !== -1 && maskset.validPositions[radixPos]) {
-							if (maskset.validPositions[radixPos - 1]) {
-								return {
-									"caret": radixPos + 1
-								};
-							} else {
-								return {
-									"pos": integerValue.index,
-									c: integerValue[0],
-									"caret": radixPos + 1
-								};
-							}
-						} else if (!integerValue || (integerValue["0"] === "0" && (integerValue.index + 1) !== pos)) {
-							maskset.buffer[integerValue ? integerValue.index : pos] = "0";
-							return {
-								"pos": (integerValue ? integerValue.index : pos) + 1,
-								c: opts.radixPoint
-							};
-						}
-					}
-				}
-				return false;
-			},
-			leadingZeroHandler: function (chrs, maskset, pos, strict, opts, isSelection) {
-				if (!strict) {
-					var initialPos = pos,
-						buffer = opts.numericInput === true ? maskset.buffer.slice("").reverse() : maskset.buffer.slice("");
-					if (opts.numericInput) {
-						pos = buffer.join("").length - pos - 1;
-					}
-					buffer.splice(0, opts.prefix.length);
-					buffer.splice(buffer.length - opts.suffix.length, opts.suffix.length);
-
-					pos = pos - opts.prefix.length;
-					var radixPosition = $.inArray(opts.radixPoint, buffer),
-						matchRslt = buffer.slice(0, radixPosition !== -1 ? radixPosition : undefined).join("").match(opts.regex.integerNPart(opts));
-					if (matchRslt && (radixPosition === -1 || pos <= radixPosition || opts.numericInput)) {
-						var decimalPart = radixPosition === -1 ? 0 : parseInt(buffer.slice(radixPosition + 1).join("")),
-							leadingZero = matchRslt["0"].indexOf(opts.placeholder !== "" ? opts.placeholder.charAt(0) : "0") === 0;
-						if (opts.numericInput) {
-							if (leadingZero && decimalPart !== 0 && isSelection !== true) {
-								maskset.buffer.splice((buffer.length - matchRslt.index - 1) + opts.suffix.length, 1);
-								return {
-									"pos": initialPos,
-									"remove": (buffer.length - matchRslt.index - 1) + opts.suffix.length
-								};
-							}
-						} else {
-							if (leadingZero && (matchRslt.index + 1 === pos || (isSelection !== true && decimalPart === 0))) {
-								maskset.buffer.splice(matchRslt.index + opts.prefix.length, 1);
-								return {
-									"pos": matchRslt.index + opts.prefix.length,
-									"remove": matchRslt.index + opts.prefix.length
-								};
-							} else if (chrs === "0" && pos <= matchRslt.index && matchRslt["0"] !== opts.groupSeparator) {
-								return false;
-							}
-						}
-					}
-				}
-				return true;
-			},
 			definitions: {
 				"~": {
 					validator: function (chrs, maskset, pos, strict, opts, isSelection) {
-						var isValid = opts.signHandler(chrs, maskset, pos, strict, opts);
-						if (!isValid) {
-							isValid = opts.radixHandler(chrs, maskset, pos, strict, opts);
-							if (!isValid) {
-								isValid = strict ? new RegExp("[0-9" + Inputmask.escapeRegex(opts.groupSeparator) + "]").test(chrs) : new RegExp("[0-9]").test(chrs);
-								if (isValid === true) {
-									isValid = opts.leadingZeroHandler(chrs, maskset, pos, strict, opts, isSelection);
-									if (isValid === true && opts.numericInput !== true) {
-										//handle overwrite when fixed precision
-										var radixPosition = $.inArray(opts.radixPoint, maskset.buffer);
-										if (radixPosition !== -1 && (opts.digitsOptional === false || maskset.validPositions[pos]) && opts.numericInput !== true && pos > radixPosition && !strict) {
-											isValid = {
-												"pos": pos,
-												"remove": pos
-											};
-										} else {
-											isValid = {
-												pos: pos
-											};
-										}
-									}
-								}
+						var isValid = strict ? new RegExp("[0-9" + Inputmask.escapeRegex(opts.groupSeparator) + "]").test(chrs) : new RegExp("[0-9]").test(chrs);
+						if (isValid === true && opts.numericInput !== true) {
+							//handle overwrite when fixed precision
+							var radixPosition = $.inArray(opts.radixPoint, maskset.buffer);
+							if (radixPosition !== -1 && (opts.digitsOptional === false || maskset.validPositions[pos]) && opts.numericInput !== true && pos > radixPosition && !strict) {
+								isValid = {
+									"pos": pos,
+									"remove": pos
+								};
+							} else {
+								isValid = {
+									pos: pos
+								};
 							}
 						}
-
 						return isValid;
-					}
-					,
+					},
 					cardinality: 1
-				}
-				,
+				},
 				"+": {
 					validator: function (chrs, maskset, pos, strict, opts) {
-						var isValid = opts.signHandler(chrs, maskset, pos, strict, opts);
-						if (!isValid && ((strict && opts.allowMinus && chrs === opts.negationSymbol.front) || (opts.allowMinus && chrs === "-") || (opts.allowPlus && chrs === "+"))) {
-							if (!strict && chrs === "-") {
-								if (opts.negationSymbol.back !== "") {
-									isValid = {
-										"pos": pos,
-										"c": chrs === "-" ? opts.negationSymbol.front : "+",
-										"caret": pos + 1,
-										"insert": {
-											"pos": maskset.buffer.length,
-											"c": opts.negationSymbol.back
-										}
-									};
-								} else {
-									isValid = {
-										"pos": pos,
-										"c": chrs === "-" ? opts.negationSymbol.front : "+",
-										"caret": pos + 1
-									};
-								}
-							} else {
-								isValid = true;
-							}
-						}
-						return isValid;
-					}
-					,
+						return (strict && opts.allowMinus && chrs === opts.negationSymbol.front);
+
+					},
 					cardinality: 1,
 					placeholder: ""
 				},
 				"-": {
 					validator: function (chrs, maskset, pos, strict, opts) {
-						var isValid = opts.signHandler(chrs, maskset, pos, strict, opts);
-						if (!isValid && strict && opts.allowMinus && chrs === opts.negationSymbol.back) {
-							isValid = true;
-						}
-						return isValid;
-					}
-					,
+						return (strict && opts.allowMinus && chrs === opts.negationSymbol.back);
+
+					},
 					cardinality: 1,
 					placeholder: ""
-				}
-				,
+				},
 				":": {
 					validator: function (chrs, maskset, pos, strict, opts) {
-						var isValid = opts.signHandler(chrs, maskset, pos, strict, opts);
-						if (!isValid) {
-							var radix = "[" + Inputmask.escapeRegex(opts.radixPoint) + "]";
-							isValid = new RegExp(radix).test(chrs);
-							if (isValid && maskset.validPositions[pos] && maskset.validPositions[pos].match.placeholder === opts.radixPoint) {
-								isValid = {
-									"caret": pos + 1
-								};
-							}
+						var radix = "[" + Inputmask.escapeRegex(opts.radixPoint) + "]";
+						isValid = new RegExp(radix).test(chrs);
+						if (isValid && maskset.validPositions[pos] && maskset.validPositions[pos].match.placeholder === opts.radixPoint) {
+							isValid = {
+								"caret": pos + 1
+							};
 						}
 						return isValid;
 					},
@@ -595,7 +400,6 @@
 				var maskedValue = buffer.join(""),
 					bufClone = buffer.slice();
 				//verify separator positions
-				opts.postFormat(bufClone, 0, opts);
 				if (bufClone.join("") !== maskedValue) return false;
 
 				var processValue = maskedValue.replace(opts.prefix, "");
@@ -656,7 +460,8 @@
 					initialValue = initialValue.split("").reverse().join("");
 				}
 				return initialValue;
-			},
+			}
+			,
 			canClearPosition: function (maskset, position, lvp, strict, opts) {
 				var positionInput = maskset.validPositions[position].input,
 					canClear = ((positionInput !== opts.radixPoint || (maskset.validPositions[position].match.fn !== null && opts.decimalProtect === false)) || isFinite(positionInput)) ||
@@ -665,7 +470,8 @@
 						positionInput === opts.negationSymbol.front ||
 						positionInput === opts.negationSymbol.back;
 				return canClear;
-			},
+			}
+			,
 			onKeyDown: function (e, buffer, caretPos, opts) {
 				var $input = $(this);
 				if (e.ctrlKey) {
@@ -709,7 +515,6 @@
 			min: 0,
 			max: 100,
 			suffix: " %",
-			allowPlus: false,
 			allowMinus: false
 		}
 	})

+ 3 - 3
js/inputmask.regex.extensions.js

@@ -29,7 +29,7 @@
 			tokenizer: /\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g,
 			quantifierFilter: /[0-9]+[^,]/,
 			isComplete: function (buffer, opts) {
-				return new RegExp(opts.regex).test(buffer.join(""));
+				return new RegExp(opts.regex,opts.casing?"i":"").test(buffer.join(""));
 			},
 			definitions: {
 				"r": {
@@ -163,7 +163,7 @@
 										for (var j = 0; j < openGroupCount; j++) {
 											testExp += ")";
 										}
-										var exp = new RegExp("^(" + testExp + ")$");
+										var exp = new RegExp("^(" + testExp + ")$",opts.casing?"i":"");
 										isvalid = exp.test(bufferStr);
 									} else {
 										for (var l = 0, tl = matchToken.length; l < tl; l++) {
@@ -174,7 +174,7 @@
 											for (var j = 0; j < openGroupCount; j++) {
 												testExp += ")";
 											}
-											var exp = new RegExp("^(" + testExp + ")$");
+											var exp = new RegExp("^(" + testExp + ")$",opts.casing?"i":"");
 											isvalid = exp.test(bufferStr);
 											if (isvalid) break;
 										}