Browse Source

update on dependencyLib

Robin Herbots 10 years ago
parent
commit
47b41acb2c

+ 1 - 1
README.md

@@ -99,7 +99,7 @@ $(document).ready(function(){
 ### Default masking definitions
 - 9 : numeric
 - a : alphabetical
-  - * : alphanumeric
+- * : alphanumeric
 
 There are more definitions defined within the extensions.<br>You can find info within the js-files or by further exploring the options.
 

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "jquery.inputmask",
-  "version": "3.2.1-29",
+  "version": "3.2.1-55",
   "main": [
     "./dist/inputmask/dependencyLib.js"
     "./dist/inputmask/inputmask.js",

+ 2 - 2
component.json

@@ -2,11 +2,11 @@
   "name": "jquery_inputmask",
   "repository": "robinherbots/jquery.inputmask",
   "description": "jquery.inputmask is a jquery plugin which create an input mask.",
-  "version": "3.2.1-29",
+  "version": "3.2.1-55",
   "keywords": ["jquery", "plugins", "input", "form", "inputmask", "mask"],
   "main": "./dist/jquery.inputmask.bundle.js",
   "scripts": [
-    "./dist/inputmask/dependencyLib.js"
+    "./dist/inputmask/dependencyLib.js",
     "./dist/inputmask/inputmask.js",
     "./dist/inputmask/inputmask.extensions.js",
     "./dist/inputmask/inputmask.date.extensions.js",

+ 1 - 1
composer.json

@@ -1,7 +1,7 @@
 {
   "name": "robinherbots/jquery.inputmask",
   "description": "jquery.inputmask is a jquery plugin which create an input mask.",
-  "version": "3.2.1-29",
+  "version": "3.2.1-55",
   "type": "library",
   "keywords": ["jquery", "plugins", "input", "form", "inputmask", "mask"],
   "homepage": "http://robinherbots.github.io/jquery.inputmask",

+ 30 - 19
dist/inputmask/dependencyLib.js

@@ -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.2.1-29
+* Version: 3.2.1-55
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery")) : factory(jQuery);
@@ -12,25 +12,36 @@
         for (var i = 0, len = list.length; len > i; i++) if (list[i] === elem) return i;
         return -1;
     }
-    var dependencyLib = {
-        isFunction: function(obj) {
-            return "function" === jQuery.type(obj);
+    function type(obj) {
+        return null == obj ? obj + "" : "object" == typeof obj || "function" == typeof obj ? class2type[toString.call(obj)] || "object" : typeof obj;
+    }
+    function Event(elem) {
+        this[0] = elem;
+    }
+    function DependencyLib(elem) {
+        return new Event(elem);
+    }
+    for (var class2type = {}, classTypes = "Boolean Number String Function Array Date RegExp Object Error".split(" "), nameNdx = 0; nameNdx < classTypes.length; nameNdx++) class2type["[object " + classTypes[nameNdx] + "]"] = classTypes[nameNdx].toLowerCase();
+    return Event.prototype = {
+        on: function() {
+            return $.fn.on.apply($(this[0]), arguments), this;
         },
-        noop: function() {},
-        parseJSON: function(data) {
-            return JSON.parse(data + "");
+        off: function() {
+            return $.fn.off.apply($(this[0]), arguments), this;
         },
-        isArray: Array.isArray,
-        inArray: function(elem, arr, i) {
-            return null == arr ? -1 : indexOf.call(arr, elem, i);
+        trigger: function() {
+            return $.fn.trigger.apply($(this[0]), arguments), this;
         },
-        valHooks: void 0,
-        extend: $.extend,
-        each: $.each,
-        map: $.map,
-        Event: $.Event,
-        _data: $._data,
-        data: $.data
-    };
-    return dependencyLib = $, window.dependencyLib = dependencyLib, dependencyLib;
+        triggerHandler: function() {
+            return $.fn.triggerHandler.apply($(this[0]), arguments), this;
+        }
+    }, DependencyLib.isFunction = function(obj) {
+        return "function" === type(obj);
+    }, DependencyLib.noop = function() {}, DependencyLib.parseJSON = function(data) {
+        return JSON.parse(data + "");
+    }, DependencyLib.isArray = Array.isArray, DependencyLib.inArray = function(elem, arr, i) {
+        return null == arr ? -1 : indexOf(arr, elem, i);
+    }, DependencyLib.valHooks = void 0, DependencyLib.extend = $.extend, DependencyLib.each = $.each, 
+    DependencyLib.map = $.map, DependencyLib.Event = $.Event, DependencyLib._data = $._data, 
+    DependencyLib.data = $.data, window.dependencyLib = DependencyLib, DependencyLib;
 });

+ 12 - 0
dist/inputmask/dependencyLib_jqlite.js

@@ -0,0 +1,12 @@
+/*!
+* dependencyLib_jqlite.js
+* 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.2.1-55
+*/
+!function(factory) {
+    "function" == typeof define && define.amd ? define([ "jqlite" ], factory) : "object" == typeof exports ? module.exports = factory(require("jqlite")) : factory(jqlite);
+}(function($) {
+    return window.dependencyLib = $, $;
+});

+ 12 - 0
dist/inputmask/dependencyLib_jquery.js

@@ -0,0 +1,12 @@
+/*!
+* dependencyLib_jquery.js
+* 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.2.1-55
+*/
+!function(factory) {
+    "function" == typeof define && define.amd ? define([ "jquery" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery")) : factory(jQuery);
+}(function($) {
+    return window.dependencyLib = $, $;
+});

+ 1 - 1
dist/inputmask/inputmask.date.extensions.js

@@ -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.2.1-29
+* Version: 3.2.1-55
 */
 !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);

+ 1 - 1
dist/inputmask/inputmask.extensions.js

@@ -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.2.1-29
+* Version: 3.2.1-55
 */
 !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);

File diff suppressed because it is too large
+ 56 - 53
dist/inputmask/inputmask.js


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

@@ -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.2.1-29
+* Version: 3.2.1-55
 */
 !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);
@@ -361,9 +361,6 @@
                 }
                 return initialValue.toString();
             },
-            onBeforePaste: function(pastedValue, opts) {
-                return opts.onBeforeMask(pastedValue, opts);
-            },
             canClearPosition: function(maskset, position, lvp, strict, opts) {
                 var positionInput = maskset.validPositions[position].input, canClear = positionInput !== opts.radixPoint || null !== maskset.validPositions[position].match.fn && opts.decimalProtect === !1 || isFinite(positionInput) || position === lvp || positionInput === opts.groupSeparator || positionInput === opts.negationSymbol.front || positionInput === opts.negationSymbol.back;
                 if (canClear && isFinite(positionInput)) {

+ 1 - 1
dist/inputmask/inputmask.phone.extensions.js

@@ -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.2.1-29
+* Version: 3.2.1-55
 */
 !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);

+ 1 - 1
dist/inputmask/inputmask.regex.extensions.js

@@ -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.2.1-29
+* Version: 3.2.1-55
 */
 !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);

+ 1 - 1
dist/inputmask/jquery.inputmask.js

@@ -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.2.1-29
+* Version: 3.2.1-55
 */
 !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);

File diff suppressed because it is too large
+ 56 - 56
dist/jquery.inputmask.bundle.js


File diff suppressed because it is too large
+ 2 - 2
dist/min/inputmask/dependencyLib.min.js


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

@@ -0,0 +1,8 @@
+/*!
+* dependencyLib_jqlite.min.js
+* 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.2.1-55
+*/
+!function(a){"function"==typeof define&&define.amd?define(["jqlite"],a):"object"==typeof exports?module.exports=a(require("jqlite")):a(jqlite)}(function(a){return window.dependencyLib=a,a});

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

@@ -0,0 +1,8 @@
+/*!
+* dependencyLib_jquery.min.js
+* 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.2.1-55
+*/
+!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){return window.dependencyLib=a,a});

File diff suppressed because it is too large
+ 1 - 1
dist/min/inputmask/inputmask.date.extensions.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/min/inputmask/inputmask.extensions.min.js


File diff suppressed because it is too large
+ 3 - 3
dist/min/inputmask/inputmask.min.js


File diff suppressed because it is too large
+ 2 - 2
dist/min/inputmask/inputmask.numeric.extensions.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/min/inputmask/inputmask.phone.extensions.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/min/inputmask/inputmask.regex.extensions.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/min/inputmask/jquery.inputmask.min.js


+ 74 - 19
js/dependencyLib.js

@@ -9,6 +9,8 @@
 	}
 	(function($) {
 
+		//helper functions
+
 		// Use a stripped-down indexOf as it's faster than native
 		// http://jsperf.com/thor-indexof-vs-for/5
 		function indexOf(list, elem) {
@@ -22,27 +24,80 @@
 			return -1;
 		}
 
-		var dependencyLib = {
-			isFunction: function(obj) {
-				return jQuery.type(obj) === "function";
+		var class2type = {},
+			classTypes = "Boolean Number String Function Array Date RegExp Object Error".split(" ");
+		for (var nameNdx = 0; nameNdx < classTypes.length; nameNdx++) {
+			class2type["[object " + classTypes[nameNdx] + "]"] = classTypes[nameNdx].toLowerCase();
+		}
+
+		function type(obj) {
+			if (obj == null) {
+				return obj + "";
+			}
+			// Support: Android<4.0, iOS<6 (functionish RegExp)
+			return typeof obj === "object" || typeof obj === "function" ?
+				class2type[toString.call(obj)] || "object" :
+				typeof obj;
+		}
+
+		//micro event lib
+		function Event(elem) {
+			this[0] = elem;
+		}
+
+		Event.prototype = {
+			on: function() {
+				$.fn.on.apply($(this[0]), arguments);
+				return this;
 			},
-			noop: function() {},
-			parseJSON: function(data) {
-				return JSON.parse(data + "");
+			off: function() {
+				$.fn.off.apply($(this[0]), arguments);
+				return this;
 			},
-			isArray: Array.isArray,
-			inArray: function(elem, arr, i) {
-				return arr == null ? -1 : indexOf.call(arr, elem, i);
+			trigger: function() {
+				$.fn.trigger.apply($(this[0]), arguments);
+				return this;
 			},
-			valHooks: undefined,
-			extend: $.extend,
-			each: $.each,
-			map: $.map,
-			Event: $.Event, //needs to be replaced
-			_data: $._data, //needs to be replaced
-			data: $.data //needs to be replaced
+			triggerHandler: function() {
+				$.fn.triggerHandler.apply($(this[0]), arguments);
+				return this;
+			}
+		};
+
+		function getDomEvents() {
+			var domEvents = [];
+			for (var i in document) {
+				if (i.substring(0, 2) === "on" && (document[i] === null || typeof document[i] === 'function'))
+					domEvents.push(i);
+			}
+			return domEvents;
+		};
+
+
+		function DependencyLib(elem) {
+			return new Event(elem);
 		}
-		dependencyLib = $; //todo split out needed functionality
-		window.dependencyLib = dependencyLib;
-		return dependencyLib;
+
+		//static
+		DependencyLib.isFunction = function(obj) {
+			return type(obj) === "function";
+		};
+		DependencyLib.noop = function() {};
+		DependencyLib.parseJSON = function(data) {
+			return JSON.parse(data + "");
+		};
+		DependencyLib.isArray = Array.isArray;
+		DependencyLib.inArray = function(elem, arr, i) {
+			return arr == null ? -1 : indexOf(arr, elem, i);
+		};
+		DependencyLib.valHooks = undefined;
+		DependencyLib.extend = $.extend;
+		DependencyLib.each = $.each;
+		DependencyLib.map = $.map;
+		DependencyLib.Event = $.Event; //needs to be replaced
+		DependencyLib._data = $._data; //needs to be replaced
+		DependencyLib.data = $.data; //needs to be replaced
+
+		window.dependencyLib = DependencyLib;
+		return DependencyLib;
 	}));

+ 13 - 0
js/dependencyLib_jqlite.js

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

+ 13 - 0
js/dependencyLib_jquery.js

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

+ 59 - 58
js/inputmask.js

@@ -1476,7 +1476,7 @@
 
 			function getMaskLength() {
 				var maskLength;
-				maxLength = el.maxLength;
+				maxLength = el !== undefined ? el.maxLength : undefined;
 				if (maxLength === -1) maxLength = undefined; /* FF sets no defined max length to -1 */
 				var pos, lvp = getLastValidPosition(),
 					testPos = getMaskSet().validPositions[lvp],
@@ -1625,26 +1625,27 @@
 				}
 			}
 
-			function unmaskedvalue($input) {
-				if ($input[0].inputmask && !$input.hasClass("hasDatepicker")) {
-					var umValue = [],
-						vps = getMaskSet().validPositions;
-					for (var pndx in vps) {
-						if (vps[pndx].match && vps[pndx].match.fn != null) {
-							umValue.push(vps[pndx].input);
+			function unmaskedvalue(input) {
+				if (input.inputmask) {
+					if (input.className === undefined || input.className.indexOf("hasDatepicker") === -1) {
+						var umValue = [],
+							vps = getMaskSet().validPositions;
+						for (var pndx in vps) {
+							if (vps[pndx].match && vps[pndx].match.fn != null) {
+								umValue.push(vps[pndx].input);
+							}
 						}
-					}
-					var unmaskedValue = umValue.length === 0 ? null : (isRTL ? umValue.reverse() : umValue).join("");
-					if (unmaskedValue !== null) {
-						var bufferValue = (isRTL ? getBuffer().slice().reverse() : getBuffer()).join("");
-						if ($.isFunction(opts.onUnMask)) {
-							unmaskedValue = (opts.onUnMask.call($input, bufferValue, unmaskedValue, opts) || unmaskedValue);
+						var unmaskedValue = umValue.length === 0 ? null : (isRTL ? umValue.reverse() : umValue).join("");
+						if (unmaskedValue !== null) {
+							var bufferValue = (isRTL ? getBuffer().slice().reverse() : getBuffer()).join("");
+							if ($.isFunction(opts.onUnMask)) {
+								unmaskedValue = (opts.onUnMask.call($input, bufferValue, unmaskedValue, opts) || unmaskedValue);
+							}
 						}
-					}
-					return unmaskedValue;
-				} else {
-					return $input[0].inputmask._valueGet();
+						return unmaskedValue;
+					} else return input.inputmask._valueGet();
 				}
+				return input.value;
 			}
 
 			function caret(input, begin, end) {
@@ -1660,9 +1661,9 @@
 					begin = translatePosition(begin);
 					end = translatePosition(end);
 					end = (typeof end == "number") ? end : begin;
-					if (!$(input).is(":visible")) {
-						return;
-					}
+					// if (!$(input).is(":visible")) {
+					// 	return;
+					// }
 
 					var scrollCalc = input.style.fontSize.replace("px", "") * end;
 					input.scrollLeft = scrollCalc > input.scrollWidth ? scrollCalc : 0;
@@ -1794,7 +1795,7 @@
 								if (this.inputmask === undefined) { //happens when cloning an object with jquery.clone
 									var imOpts = $.data(this, "_inputmask_opts");
 									if (imOpts)(new Inputmask(imOpts)).mask(this);
-									else $(this).unbind(".inputmask");
+									else $(this).off(".inputmask");
 								} else if (e.type !== "setvalue" && (this.disabled || (this.readOnly && !(e.type === "keydown" && (e.ctrlKey && e.keyCode === 67) || (opts.tabThrough === false && e.keyCode === Inputmask.keyCode.TAB))))) {
 									e.preventDefault();
 								} else {
@@ -1892,7 +1893,7 @@
 				}
 
 				function installNativeValueSetFallback(npt) {
-					$(npt).bind("mouseenter.inputmask", function(event) {
+					$(npt).on("mouseenter.inputmask", function(event) {
 						var $input = $(this),
 							input = this,
 							value = input.inputmask._valueGet();
@@ -2054,7 +2055,7 @@
 					caret(input, 0, e.shiftKey ? pos.begin : 0);
 				} else if (((opts.undoOnEscape && k === Inputmask.keyCode.ESCAPE) || (k === 90 && e.ctrlKey)) && e.altKey !== true) { //escape && undo && #762
 					checkVal(input, true, false, undoValue.split(""));
-					$input.click();
+					$input.trigger("click");
 				} else if (k === Inputmask.keyCode.INSERT && !(e.shiftKey || e.ctrlKey)) { //insert
 					opts.insertMode = !opts.insertMode;
 					caret(input, !opts.insertMode && pos.begin === getMaskLength() ? pos.begin - 1 : pos.begin);
@@ -2099,7 +2100,7 @@
 				if (checkval !== true && (!(e.ctrlKey && e.altKey) && (e.ctrlKey || e.metaKey || ignorable))) {
 					if (k === Inputmask.keyCode.ENTER && undoValue !== getBuffer().join("")) {
 						setTimeout(function() {
-							$input.change();
+							$input.trigger("change");
 							undoValue = getBuffer().join("");
 						}, 0);
 					}
@@ -2229,7 +2230,7 @@
 				}
 				checkVal(input, false, false, isRTL ? pasteValue.split("").reverse() : pasteValue.toString().split(""));
 				writeBuffer(input, getBuffer(), undefined, e, true);
-				$input.click();
+				$input.trigger("click");
 				if (isComplete(getBuffer()) === true) {
 					$input.trigger("complete");
 				}
@@ -2313,13 +2314,12 @@
 			}
 
 			function mouseleaveEvent(e) {
-				var $input = $(this),
-					input = this;
+				var input = this;
 				mouseEnter = false;
 				if (opts.clearMaskOnLostFocus) {
 					var buffer = getBuffer().slice(),
 						nptValue = input.inputmask._valueGet();
-					if (document.activeElement !== input && nptValue !== $input.attr("placeholder") && nptValue !== "") {
+					if (document.activeElement !== input && nptValue !== input.getAttribute("placeholder") && nptValue !== "") {
 						if (getLastValidPosition() === -1 && nptValue === getBufferTemplate().join("")) {
 							buffer = [];
 						} else { //clearout optional tail of the mask
@@ -2408,7 +2408,7 @@
 						buffer = getBuffer().slice();
 					if (undoValue !== buffer.join("")) {
 						setTimeout(function() { //change event should be triggered after the other buffer manipulations on blur
-							$input.change();
+							$input.trigger("change");
 							undoValue = buffer.join("");
 						}, 0);
 					}
@@ -2449,7 +2449,8 @@
 				}
 			}
 
-			function mask(el) {
+			function mask(elem) {
+				el = elem;
 				$el = $(el);
 
 				//show tooltip
@@ -2469,13 +2470,13 @@
 				}
 
 				//unbind all events - to make sure that no other mask will interfere when re-masking
-				$el.unbind(".inputmask");
+				$el.off(".inputmask");
 
 				if ((el.tagName === "INPUT" && isInputTypeSupported(el.getAttribute("type"))) || el.isContentEditable) {
 					//bind events
-					$el.closest("form").bind("submit", function() { //trigger change on submit if any
+					$(el.form).on("submit", function() { //trigger change on submit if any
 						if (undoValue !== getBuffer().join("")) {
-							$el.change();
+							$el.trigger("change");
 						}
 						if (opts.clearMaskOnLostFocus && getLastValidPosition() === -1 && el.inputmask._valueGet && el.inputmask._valueGet() === getBufferTemplate().join("")) {
 							el.inputmask._valueSet(""); //clear masktemplete on submit and still has focus
@@ -2486,40 +2487,40 @@
 								writeBuffer(el, getBuffer());
 							}, 0);
 						}
-					}).bind("reset", function() {
+					}).on("reset", function() {
 						setTimeout(function() {
 							$el.triggerHandler("setvalue.inputmask");
 						}, 0);
 					});
 
-					$el.bind("mouseenter.inputmask", mouseenterEvent)
-						.bind("blur.inputmask", blurEvent)
-						.bind("focus.inputmask", focusEvent)
-						.bind("mouseleave.inputmask", mouseleaveEvent)
-						.bind("click.inputmask", clickEvent)
-						.bind("dblclick.inputmask", dblclickEvent)
-						.bind(PasteEventType + ".inputmask dragdrop.inputmask drop.inputmask", pasteEvent)
-						.bind("cut.inputmask", cutEvent)
-						.bind("complete.inputmask", opts.oncomplete)
-						.bind("incomplete.inputmask", opts.onincomplete)
-						.bind("cleared.inputmask", opts.oncleared)
-						.bind("keydown.inputmask", keydownEvent)
-						.bind("keypress.inputmask", keypressEvent);
+					$el.on("mouseenter.inputmask", mouseenterEvent)
+						.on("blur.inputmask", blurEvent)
+						.on("focus.inputmask", focusEvent)
+						.on("mouseleave.inputmask", mouseleaveEvent)
+						.on("click.inputmask", clickEvent)
+						.on("dblclick.inputmask", dblclickEvent)
+						.on(PasteEventType + ".inputmask dragdrop.inputmask drop.inputmask", pasteEvent)
+						.on("cut.inputmask", cutEvent)
+						.on("complete.inputmask", opts.oncomplete)
+						.on("incomplete.inputmask", opts.onincomplete)
+						.on("cleared.inputmask", opts.oncleared)
+						.on("keydown.inputmask", keydownEvent)
+						.on("keypress.inputmask", keypressEvent);
 
 
 					if (!androidfirefox) {
-						$el.bind("compositionstart.inputmask", compositionStartEvent).bind("compositionupdate.inputmask", compositionUpdateEvent).bind("compositionend.inputmask", compositionEndEvent);
+						$el.on("compositionstart.inputmask", compositionStartEvent).on("compositionupdate.inputmask", compositionUpdateEvent).on("compositionend.inputmask", compositionEndEvent);
 					}
 
 					if (PasteEventType === "paste") {
-						$el.bind("input.inputmask", inputFallBackEvent);
+						$el.on("input.inputmask", inputFallBackEvent);
 					}
 					//if (android || androidfirefox || androidchrome || kindle) {
-					//		$el.unbind("input.inputmask");
-					//		$el.bind("input.inputmask", mobileInputEvent);
+					//		$el.off("input.inputmask");
+					//		$el.on("input.inputmask", mobileInputEvent);
 					//}
 				}
-				$el.bind("setvalue.inputmask", setValueEvent);
+				$el.on("setvalue.inputmask", setValueEvent);
 				patchValueProperty(el);
 
 				//apply mask
@@ -2579,13 +2580,13 @@
 								isRTL = true;
 							}
 							valueBuffer = ($.isFunction(opts.onBeforeMask) ? (opts.onBeforeMask.call($el, actionObj.value, opts) || actionObj.value) : actionObj.value).split("");
-							checkVal($el, false, false, isRTL ? valueBuffer.reverse() : valueBuffer);
+							checkVal(el, false, false, isRTL ? valueBuffer.reverse() : valueBuffer);
 							if ($.isFunction(opts.onBeforeWrite)) opts.onBeforeWrite.call(this, undefined, getBuffer(), 0, opts);
 						} else $el = $(el);
 						maskset = el.inputmask.maskset;
 						opts = el.inputmask.opts;
 						isRTL = el.inputmask.isRTL;
-						return unmaskedvalue($el);
+						return unmaskedvalue(el);
 					case "mask":
 						undoValue = getBuffer().join("");
 						mask(actionObj.el);
@@ -2603,7 +2604,7 @@
 							isRTL = true;
 						}
 						valueBuffer = ($.isFunction(opts.onBeforeMask) ? (opts.onBeforeMask.call($el, actionObj.value, opts) || actionObj.value) : actionObj.value).split("");
-						checkVal($el, false, false, isRTL ? valueBuffer.reverse() : valueBuffer);
+						checkVal(el, false, false, isRTL ? valueBuffer.reverse() : valueBuffer);
 						if ($.isFunction(opts.onBeforeWrite)) opts.onBeforeWrite.call(this, undefined, getBuffer(), 0, opts);
 
 						if (actionObj.metadata) {
@@ -2627,7 +2628,7 @@
 							isRTL = true;
 						}
 						valueBuffer = actionObj.value.split("");
-						checkVal($el, false, true, isRTL ? valueBuffer.reverse() : valueBuffer);
+						checkVal(el, false, true, isRTL ? valueBuffer.reverse() : valueBuffer);
 						var buffer = getBuffer();
 						var rl = determineLastRequiredPosition(),
 							lmib = buffer.length - 1;
@@ -2651,7 +2652,7 @@
 						//writeout the unmaskedvalue
 						el.inputmask._valueSet(unmaskedvalue($el));
 						//unbind all events
-						$el.unbind(".inputmask");
+						$el.off(".inputmask");
 						//restore the value property
 						var valueProperty;
 						if (Object.getOwnPropertyDescriptor) {

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "jquery.inputmask",
-  "version": "3.2.1-29",
+  "version": "3.2.1-55",
   "description": "jquery.inputmask is a jquery plugin which create an input mask.",
   "main": "./dist/inputmask/jquery.inputmask.js",
   "files": [

+ 1 - 0
qunit/config.js

@@ -2,6 +2,7 @@ requirejs.config({
 	baseUrl: "./",
 	paths: {
 		"jquery": "../node_modules/jquery/dist/jquery",
+		"jqlite": "../node_modules/jqlite/jqlite",
 		"qunit": "../node_modules/qunitjs/qunit/qunit",
 		"dependencyLib": "../dist/inputmask/dependencyLib",
 		"inputmask": "../dist/inputmask/inputmask"