Robin Herbots 8 年 前
コミット
69b2b1581d
51 ファイル変更546 行追加1167019 行削除
  1. 10 15
      Gruntfile.js
  2. 1 1
      bower.json
  3. 1 1
      component.json
  4. 1 1
      composer.json
  5. 1 1
      dist/inputmask/bindings/inputmask.binding.js
  6. 9 11
      dist/inputmask/dependencyLibs/inputmask.dependencyLib.jqlite.js
  7. 1 1
      dist/inputmask/dependencyLibs/inputmask.dependencyLib.jquery.js
  8. 47 40
      dist/inputmask/dependencyLibs/inputmask.dependencyLib.js
  9. 1 1
      dist/inputmask/global/document.js
  10. 1 1
      dist/inputmask/global/window.js
  11. 51 52
      dist/inputmask/inputmask.date.extensions.js
  12. 1 1
      dist/inputmask/inputmask.extensions.js
  13. 348 369
      dist/inputmask/inputmask.js
  14. 9 12
      dist/inputmask/inputmask.numeric.extensions.js
  15. 6 8
      dist/inputmask/inputmask.phone.extensions.js
  16. 1 1
      dist/inputmask/jquery.inputmask.js
  17. 1 1
      dist/inputmask/phone-codes/phone-be.js
  18. 1 1
      dist/inputmask/phone-codes/phone-ca.js
  19. 1 1
      dist/inputmask/phone-codes/phone-hu.js
  20. 1 1
      dist/inputmask/phone-codes/phone-mx.js
  21. 1 1
      dist/inputmask/phone-codes/phone-nl.js
  22. 1 1
      dist/inputmask/phone-codes/phone-ru.js
  23. 1 1
      dist/inputmask/phone-codes/phone-uk.js
  24. 0 1161931
      dist/inputmask/phone-codes/phone-us.js
  25. 0 2144
      dist/inputmask/phone-codes/phone.js
  26. 0 2346
      dist/jquery.inputmask.bundle.js
  27. 1 1
      dist/min/inputmask/bindings/inputmask.binding.min.js
  28. 2 2
      dist/min/inputmask/dependencyLibs/inputmask.dependencyLib.jqlite.min.js
  29. 1 1
      dist/min/inputmask/dependencyLibs/inputmask.dependencyLib.jquery.min.js
  30. 2 2
      dist/min/inputmask/dependencyLibs/inputmask.dependencyLib.min.js
  31. 1 1
      dist/min/inputmask/global/document.min.js
  32. 1 1
      dist/min/inputmask/global/window.min.js
  33. 2 2
      dist/min/inputmask/inputmask.date.extensions.min.js
  34. 1 1
      dist/min/inputmask/inputmask.extensions.min.js
  35. 2 2
      dist/min/inputmask/inputmask.min.js
  36. 2 2
      dist/min/inputmask/inputmask.numeric.extensions.min.js
  37. 2 2
      dist/min/inputmask/inputmask.phone.extensions.min.js
  38. 1 1
      dist/min/inputmask/jquery.inputmask.min.js
  39. 1 1
      dist/min/inputmask/phone-codes/phone-be.min.js
  40. 1 1
      dist/min/inputmask/phone-codes/phone-ca.min.js
  41. 1 1
      dist/min/inputmask/phone-codes/phone-hu.min.js
  42. 1 1
      dist/min/inputmask/phone-codes/phone-mx.min.js
  43. 1 1
      dist/min/inputmask/phone-codes/phone-nl.min.js
  44. 1 1
      dist/min/inputmask/phone-codes/phone-ru.min.js
  45. 1 1
      dist/min/inputmask/phone-codes/phone-uk.min.js
  46. 0 9
      dist/min/inputmask/phone-codes/phone-us.min.js
  47. 0 9
      dist/min/inputmask/phone-codes/phone.min.js
  48. 0 9
      dist/min/jquery.inputmask.bundle.min.js
  49. 2 2
      js/inputmask.js
  50. 6 3
      js/inputmask.numeric.extensions.js
  51. 17 18
      package.json

+ 10 - 15
Gruntfile.js

@@ -87,7 +87,8 @@ module.exports = function (grunt) {
                 updateConfigs: ['pkg'],
                 commit: false,
                 createTag: false,
-                push: false
+                push: false,
+                prereleaseName: "beta"
             }
         },
         release: {
@@ -130,17 +131,6 @@ module.exports = function (grunt) {
                 }
             }
         },
-        shell: {
-            options: {
-                stderr: false
-            },
-            gitcommitchanges: {
-                command: ['git add .',
-                    'git reset -- package.json',
-                    'git commit -m "Inputmask <%= pkg.version %>"'
-                ].join('&&')
-            }
-        },
         eslint: {
             target: "{extra/*,js}/*.js"
         },
@@ -163,10 +153,15 @@ module.exports = function (grunt) {
 // Load the plugin that provides the tasks.
     require('load-grunt-tasks')(grunt);
 
-    grunt.registerTask('publish:patch', ['clean', 'bump:patch', 'webpack:build', 'uglify', 'shell:gitcommitchanges', 'release', 'nugetpack', 'nugetpush']);
-    grunt.registerTask('publish:minor', ['clean', 'bump:minor', 'webpack:build', 'uglify', 'shell:gitcommitchanges', 'release', 'nugetpack', 'nugetpush']);
-    grunt.registerTask('publish:major', ['clean', 'bump:major', 'webpack:build', 'uglify', 'shell:gitcommitchanges', 'release', 'nugetpack', 'nugetpush']);
+    grunt.registerTask('publish', ['release', 'nugetpack', 'nugetpush']);
+    grunt.registerTask('publishnext', function() {
+        grunt.config('release.options.npmtag', "next");
+        grunt.task.run('release');
+    });
     grunt.registerTask('validate', ['webpack:qunit', 'eslint', 'karma']);
     grunt.registerTask('build', ['bump:prerelease', 'clean', 'webpack:build', 'uglify']);
+    grunt.registerTask('build:patch', ['bump:patch', 'clean', 'webpack:build', 'uglify']);
+    grunt.registerTask('build:minor', ['bump:minor', 'clean', 'webpack:build', 'uglify']);
+    grunt.registerTask('build:major', ['bump:major', 'clean', 'webpack:build', 'uglify']);
     grunt.registerTask('default', ["availabletasks"]);
 };

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "inputmask",
-  "version": "4.0.0-103",
+  "version": "4.0.0-beta.1",
   "main": [
 	  "./dist/inputmask/inputmask.js",
 	  "./dist/inputmask/inputmask.extensions.js",

+ 1 - 1
component.json

@@ -2,7 +2,7 @@
 	"name": "inputmask",
 	"repository": "robinherbots/Inputmask",
 	"description": "Inputmask is a javascript library which creates an input mask.  Inputmask can run against vanilla javascript, jQuery and jqlite.",
-	"version": "4.0.0-103",
+	"version": "4.0.0-beta.1",
 	"keywords": [
 		"jquery",
 		"plugins",

+ 1 - 1
composer.json

@@ -1,7 +1,7 @@
 {
   "name": "robinherbots/inputmask",
   "description": "Inputmask is a javascript library which creates an input mask.  Inputmask can run against vanilla javascript, jQuery and jqlite.",
-  "version": "4.0.0-103",
+  "version": "4.0.0-beta.1",
   "type": "library",
   "keywords": ["jquery", "plugins", "input", "form", "inputmask", "mask"],
   "homepage": "http://robinherbots.github.io/Inputmask",

+ 1 - 1
dist/inputmask/bindings/inputmask.binding.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.0-103
+* Version: 4.0.0-beta.1
 */
 
 !function(factory) {

+ 9 - 11
dist/inputmask/dependencyLibs/inputmask.dependencyLib.jqlite.js

@@ -3,25 +3,20 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.0-103
+* Version: 4.0.0-beta.1
 */
 
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jqlite", "../global/window", "../global/document]" ], factory) : "object" == typeof exports ? module.exports = factory(require("jqlite"), require("../global/window"), require("../global/document")) : window.dependencyLib = factory(jqlite, window, document);
 }(function($, window, document) {
-    function indexOf(list, elem) {
-        for (var i = 0, len = list.length; i < len; i++) if (list[i] === elem) return i;
-        return -1;
-    }
     function isWindow(obj) {
         return null != obj && obj === obj.window;
     }
-    function isArraylike(obj) {
-        var length = "length" in obj && obj.length, ltype = typeof obj;
-        return "function" !== ltype && !isWindow(obj) && (!(1 !== obj.nodeType || !length) || ("array" === ltype || 0 === length || "number" == typeof length && length > 0 && length - 1 in obj));
-    }
     return $.inArray = function(elem, arr, i) {
-        return null == arr ? -1 : indexOf(arr, elem);
+        return null == arr ? -1 : function(list, elem) {
+            for (var i = 0, len = list.length; i < len; i++) if (list[i] === elem) return i;
+            return -1;
+        }(arr, elem);
     }, $.isFunction = function(obj) {
         return "function" == typeof obj;
     }, $.isArray = Array.isArray, $.isPlainObject = function(obj) {
@@ -37,7 +32,10 @@
         return target;
     }, $.each = function(obj, callback) {
         var i = 0;
-        if (isArraylike(obj)) for (var length = obj.length; i < length && !1 !== callback.call(obj[i], i, obj[i]); i++) ; else for (i in obj) if (!1 === callback.call(obj[i], i, obj[i])) break;
+        if (function(obj) {
+            var length = "length" in obj && obj.length, ltype = typeof obj;
+            return "function" !== ltype && !isWindow(obj) && (!(1 !== obj.nodeType || !length) || "array" === ltype || 0 === length || "number" == typeof length && length > 0 && length - 1 in obj);
+        }(obj)) for (var length = obj.length; i < length && !1 !== callback.call(obj[i], i, obj[i]); i++) ; else for (i in obj) if (!1 === callback.call(obj[i], i, obj[i])) break;
         return obj;
     }, $.data = function(elem, name, data) {
         return $(elem).data(name, data);

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

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.0-103
+* Version: 4.0.0-beta.1
 */
 
 !function(factory) {

+ 47 - 40
dist/inputmask/dependencyLibs/inputmask.dependencyLib.js

@@ -3,23 +3,15 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.0-103
+* Version: 4.0.0-beta.1
 */
 
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "../global/window", "../global/document" ], factory) : "object" == typeof exports ? module.exports = factory(require("../global/window"), require("../global/document")) : window.dependencyLib = factory(window, document);
 }(function(window, document) {
-    function indexOf(list, elem) {
-        for (var i = 0, len = list.length; i < len; i++) if (list[i] === elem) return i;
-        return -1;
-    }
     function isWindow(obj) {
         return null != obj && obj === obj.window;
     }
-    function isArraylike(obj) {
-        var length = "length" in obj && obj.length, ltype = typeof obj;
-        return "function" !== ltype && !isWindow(obj) && (!(1 !== obj.nodeType || !length) || ("array" === ltype || 0 === length || "number" == typeof length && length > 0 && length - 1 in obj));
-    }
     function isValidElement(elem) {
         return elem instanceof Element;
     }
@@ -29,42 +21,51 @@
     }
     return DependencyLib.prototype = {
         on: function(events, handler) {
-            if (isValidElement(this[0])) for (var eventRegistry = this[0].eventRegistry, elem = this[0], _events = events.split(" "), endx = 0; endx < _events.length; endx++) {
-                var nsEvent = _events[endx].split(".");
-                !function(ev, namespace) {
+            if (isValidElement(this[0])) {
+                var eventRegistry = this[0].eventRegistry, elem = this[0];
+                function addEvent(ev, namespace) {
                     elem.addEventListener ? elem.addEventListener(ev, handler, !1) : elem.attachEvent && elem.attachEvent("on" + ev, handler), 
                     eventRegistry[ev] = eventRegistry[ev] || {}, eventRegistry[ev][namespace] = eventRegistry[ev][namespace] || [], 
                     eventRegistry[ev][namespace].push(handler);
-                }(nsEvent[0], nsEvent[1] || "global");
+                }
+                for (var _events = events.split(" "), endx = 0; endx < _events.length; endx++) {
+                    var nsEvent = _events[endx].split(".");
+                    addEvent(nsEvent[0], nsEvent[1] || "global");
+                }
             }
             return this;
         },
         off: function(events, handler) {
-            if (isValidElement(this[0])) for (var eventRegistry = this[0].eventRegistry, elem = this[0], _events = events.split(" "), endx = 0; endx < _events.length; endx++) for (var nsEvent = _events[endx].split("."), offEvents = function(ev, namespace) {
-                var hndx, hndL, evts = [];
-                if (ev.length > 0) if (void 0 === handler) for (hndx = 0, hndL = eventRegistry[ev][namespace].length; hndx < hndL; hndx++) evts.push({
-                    ev: ev,
-                    namespace: namespace && namespace.length > 0 ? namespace : "global",
-                    handler: eventRegistry[ev][namespace][hndx]
-                }); else evts.push({
-                    ev: ev,
-                    namespace: namespace && namespace.length > 0 ? namespace : "global",
-                    handler: handler
-                }); else if (namespace.length > 0) for (var evNdx in eventRegistry) for (var nmsp in eventRegistry[evNdx]) if (nmsp === namespace) if (void 0 === handler) for (hndx = 0, 
-                hndL = eventRegistry[evNdx][nmsp].length; hndx < hndL; hndx++) evts.push({
-                    ev: evNdx,
-                    namespace: nmsp,
-                    handler: eventRegistry[evNdx][nmsp][hndx]
-                }); else evts.push({
-                    ev: evNdx,
-                    namespace: nmsp,
-                    handler: handler
-                });
-                return evts;
-            }(nsEvent[0], nsEvent[1]), i = 0, offEventsL = offEvents.length; i < offEventsL; i++) !function(ev, namespace, handler) {
-                if (ev in eventRegistry == 1) if (elem.removeEventListener ? elem.removeEventListener(ev, handler, !1) : elem.detachEvent && elem.detachEvent("on" + ev, handler), 
-                "global" === namespace) for (var nmsp in eventRegistry[ev]) eventRegistry[ev][nmsp].splice(eventRegistry[ev][nmsp].indexOf(handler), 1); else eventRegistry[ev][namespace].splice(eventRegistry[ev][namespace].indexOf(handler), 1);
-            }(offEvents[i].ev, offEvents[i].namespace, offEvents[i].handler);
+            if (isValidElement(this[0])) {
+                var eventRegistry = this[0].eventRegistry, elem = this[0];
+                function removeEvent(ev, namespace, handler) {
+                    if (ev in eventRegistry == !0) if (elem.removeEventListener ? elem.removeEventListener(ev, handler, !1) : elem.detachEvent && elem.detachEvent("on" + ev, handler), 
+                    "global" === namespace) for (var nmsp in eventRegistry[ev]) eventRegistry[ev][nmsp].splice(eventRegistry[ev][nmsp].indexOf(handler), 1); else eventRegistry[ev][namespace].splice(eventRegistry[ev][namespace].indexOf(handler), 1);
+                }
+                function resolveNamespace(ev, namespace) {
+                    var hndx, hndL, evts = [];
+                    if (ev.length > 0) if (void 0 === handler) for (hndx = 0, hndL = eventRegistry[ev][namespace].length; hndx < hndL; hndx++) evts.push({
+                        ev: ev,
+                        namespace: namespace && namespace.length > 0 ? namespace : "global",
+                        handler: eventRegistry[ev][namespace][hndx]
+                    }); else evts.push({
+                        ev: ev,
+                        namespace: namespace && namespace.length > 0 ? namespace : "global",
+                        handler: handler
+                    }); else if (namespace.length > 0) for (var evNdx in eventRegistry) for (var nmsp in eventRegistry[evNdx]) if (nmsp === namespace) if (void 0 === handler) for (hndx = 0, 
+                    hndL = eventRegistry[evNdx][nmsp].length; hndx < hndL; hndx++) evts.push({
+                        ev: evNdx,
+                        namespace: nmsp,
+                        handler: eventRegistry[evNdx][nmsp][hndx]
+                    }); else evts.push({
+                        ev: evNdx,
+                        namespace: nmsp,
+                        handler: handler
+                    });
+                    return evts;
+                }
+                for (var _events = events.split(" "), endx = 0; endx < _events.length; endx++) for (var nsEvent = _events[endx].split("."), offEvents = resolveNamespace(nsEvent[0], nsEvent[1]), i = 0, offEventsL = offEvents.length; i < offEventsL; i++) removeEvent(offEvents[i].ev, offEvents[i].namespace, offEvents[i].handler);
+            }
             return this;
         },
         trigger: function(events) {
@@ -93,7 +94,10 @@
     }, DependencyLib.isFunction = function(obj) {
         return "function" == typeof obj;
     }, DependencyLib.noop = function() {}, DependencyLib.isArray = Array.isArray, DependencyLib.inArray = function(elem, arr, i) {
-        return null == arr ? -1 : indexOf(arr, elem);
+        return null == arr ? -1 : function(list, elem) {
+            for (var i = 0, len = list.length; i < len; i++) if (list[i] === elem) return i;
+            return -1;
+        }(arr, elem);
     }, DependencyLib.valHooks = void 0, DependencyLib.isPlainObject = function(obj) {
         return "object" == typeof obj && !obj.nodeType && !isWindow(obj) && !(obj.constructor && !Object.hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf"));
     }, DependencyLib.extend = function() {
@@ -107,7 +111,10 @@
         return target;
     }, DependencyLib.each = function(obj, callback) {
         var i = 0;
-        if (isArraylike(obj)) for (var length = obj.length; i < length && !1 !== callback.call(obj[i], i, obj[i]); i++) ; else for (i in obj) if (!1 === callback.call(obj[i], i, obj[i])) break;
+        if (function(obj) {
+            var length = "length" in obj && obj.length, ltype = typeof obj;
+            return "function" !== ltype && !isWindow(obj) && (!(1 !== obj.nodeType || !length) || "array" === ltype || 0 === length || "number" == typeof length && length > 0 && length - 1 in obj);
+        }(obj)) for (var length = obj.length; i < length && !1 !== callback.call(obj[i], i, obj[i]); i++) ; else for (i in obj) if (!1 === callback.call(obj[i], i, obj[i])) break;
         return obj;
     }, DependencyLib.data = function(owner, key, value) {
         if (void 0 === value) return owner.__data ? owner.__data[key] : null;

+ 1 - 1
dist/inputmask/global/document.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.0-103
+* Version: 4.0.0-beta.1
 */
 
 "function" == typeof define && define.amd ? define(function() {

+ 1 - 1
dist/inputmask/global/window.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.0-103
+* Version: 4.0.0-beta.1
 */
 
 "function" == typeof define && define.amd ? define(function() {

+ 51 - 52
dist/inputmask/inputmask.date.extensions.js

@@ -3,59 +3,12 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.0-103
+* Version: 4.0.0-beta.1
 */
 
 !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);
 }(function($, Inputmask) {
-    function getTokenizer(opts) {
-        if (!opts.tokenizer) {
-            var tokens = [];
-            for (var ndx in formatCode) -1 === tokens.indexOf(ndx[0]) && tokens.push(ndx[0]);
-            opts.tokenizer = "(" + tokens.join("+|") + ")+?|.", opts.tokenizer = new RegExp(opts.tokenizer, "g");
-        }
-        return opts.tokenizer;
-    }
-    function isValidDate(dateParts, currentResult) {
-        return (!isFinite(dateParts.day) || "29" == dateParts.day && !isFinite(dateParts.rawyear) || new Date(dateParts.date.getFullYear(), isFinite(dateParts.month) ? dateParts.month : dateParts.date.getMonth() + 1, 0).getDate() >= dateParts.day) && currentResult;
-    }
-    function isDateInRange(maskDate, opts) {
-        var result = !0;
-        return opts.min && opts.min.date.getTime() === opts.min.date.getTime() && (result = result && opts.min.date.getTime() <= maskDate.getTime()), 
-        opts.max && opts.max.date.getTime() === opts.max.date.getTime() && (result = result && opts.max.date.getTime() >= maskDate.getTime()), 
-        result;
-    }
-    function parse(format, dateObjValue, opts) {
-        for (var match, mask = ""; match = getTokenizer(opts).exec(format); ) void 0 === dateObjValue ? mask += formatCode[match[0]] ? "(" + formatCode[match[0]][0] + ")" : Inputmask.escapeRegex(match[0]) : formatCode[match[0]] ? mask += formatCode[match[0]][3].call(dateObjValue.date) : mask += match[0];
-        return mask;
-    }
-    function pad(val, len) {
-        for (val = String(val), len = len || 2; val.length < len; ) val = "0" + val;
-        return val;
-    }
-    function analyseMask(maskString, format, opts) {
-        function extendYear(year) {
-            var correctedyear = 4 === year.length ? year : new Date().getFullYear().toString().substr(0, 4 - year.length) + year;
-            return opts.min && opts.min.year && opts.max && opts.max.year ? (correctedyear = correctedyear.replace(/[^0-9]/g, ""), 
-            correctedyear = year.charAt(0) === opts.max.year.charAt(0) ? year.replace(/[^0-9]/g, "0") : correctedyear + opts.min.year.substr(correctedyear.length)) : correctedyear = correctedyear.replace(/[^0-9]/g, "0"), 
-            correctedyear;
-        }
-        var targetProp, match, dateOperation, dateObj = {
-            date: new Date(1, 0, 1)
-        }, mask = maskString;
-        if ("string" == typeof mask) {
-            for (;match = getTokenizer(opts).exec(format); ) {
-                var value = mask.slice(0, match[0].length);
-                formatCode.hasOwnProperty(match[0]) && (targetProp = formatCode[match[0]][2], dateOperation = formatCode[match[0]][1], 
-                function(dateObj, value, opts) {
-                    "year" === targetProp ? (dateObj[targetProp] = extendYear(value), dateObj["raw" + targetProp] = value) : dateObj[targetProp] = opts.min && value.match(/[^0-9]/) ? opts.min[targetProp] : value, 
-                    void 0 !== dateOperation && dateOperation.call(dateObj.date, "month" == targetProp ? parseInt(dateObj[targetProp]) - 1 : dateObj[targetProp]);
-                }(dateObj, value, opts)), mask = mask.slice(value.length);
-            }
-            return dateObj;
-        }
-    }
     var formatCode = {
         d: [ "[1-9]|[12][0-9]|3[01]", Date.prototype.setDate, "day", Date.prototype.getDate ],
         dd: [ "0[1-9]|[12][0-9]|3[01]", Date.prototype.setDate, "day", function() {
@@ -114,6 +67,47 @@
         isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
         isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
     };
+    function getTokenizer(opts) {
+        if (!opts.tokenizer) {
+            var tokens = [];
+            for (var ndx in formatCode) -1 === tokens.indexOf(ndx[0]) && tokens.push(ndx[0]);
+            opts.tokenizer = "(" + tokens.join("+|") + ")+?|.", opts.tokenizer = new RegExp(opts.tokenizer, "g");
+        }
+        return opts.tokenizer;
+    }
+    function parse(format, dateObjValue, opts) {
+        for (var match, mask = ""; match = getTokenizer(opts).exec(format); ) {
+            if (void 0 === dateObjValue) mask += formatCode[match[0]] ? "(" + formatCode[match[0]][0] + ")" : Inputmask.escapeRegex(match[0]); else if (formatCode[match[0]]) mask += formatCode[match[0]][3].call(dateObjValue.date); else mask += match[0];
+        }
+        return mask;
+    }
+    function pad(val, len) {
+        for (val = String(val), len = len || 2; val.length < len; ) val = "0" + val;
+        return val;
+    }
+    function analyseMask(maskString, format, opts) {
+        var targetProp, match, dateOperation, dateObj = {
+            date: new Date(1, 0, 1)
+        }, mask = maskString;
+        function extendYear(year) {
+            var correctedyear = 4 === year.length ? year : new Date().getFullYear().toString().substr(0, 4 - year.length) + year;
+            return opts.min && opts.min.year && opts.max && opts.max.year ? (correctedyear = correctedyear.replace(/[^0-9]/g, ""), 
+            correctedyear = year.charAt(0) === opts.max.year.charAt(0) ? year.replace(/[^0-9]/g, "0") : correctedyear + opts.min.year.substr(correctedyear.length)) : correctedyear = correctedyear.replace(/[^0-9]/g, "0"), 
+            correctedyear;
+        }
+        function setValue(dateObj, value, opts) {
+            "year" === targetProp ? (dateObj[targetProp] = extendYear(value), dateObj["raw" + targetProp] = value) : dateObj[targetProp] = opts.min && value.match(/[^0-9]/) ? opts.min[targetProp] : value, 
+            void 0 !== dateOperation && dateOperation.call(dateObj.date, "month" == targetProp ? parseInt(dateObj[targetProp]) - 1 : dateObj[targetProp]);
+        }
+        if ("string" == typeof mask) {
+            for (;match = getTokenizer(opts).exec(format); ) {
+                var value = mask.slice(0, match[0].length);
+                formatCode.hasOwnProperty(match[0]) && (targetProp = formatCode[match[0]][2], dateOperation = formatCode[match[0]][1], 
+                setValue(dateObj, value, opts)), mask = mask.slice(value.length);
+            }
+            return dateObj;
+        }
+    }
     return Inputmask.extendAliases({
         datetime: {
             mask: function(opts) {
@@ -134,14 +128,19 @@
             },
             postValidation: function(buffer, currentResult, opts) {
                 var result = currentResult, dateParts = analyseMask(buffer.join(""), opts.inputFormat, opts);
-                return result && dateParts.date.getTime() === dateParts.date.getTime() && (result = (result = isValidDate(dateParts, result)) && isDateInRange(dateParts.date, opts)), 
-                result;
+                return result && dateParts.date.getTime() == dateParts.date.getTime() && (result = (result = function(dateParts, currentResult) {
+                    return (!isFinite(dateParts.day) || "29" == dateParts.day && !isFinite(dateParts.rawyear) || new Date(dateParts.date.getFullYear(), isFinite(dateParts.month) ? dateParts.month : dateParts.date.getMonth() + 1, 0).getDate() >= dateParts.day) && currentResult;
+                }(dateParts, result)) && function(maskDate, opts) {
+                    var result = !0;
+                    return opts.min && opts.min.date.getTime() == opts.min.date.getTime() && (result = result && opts.min.date.getTime() <= maskDate.getTime()), 
+                    opts.max && opts.max.date.getTime() == opts.max.date.getTime() && (result = result && opts.max.date.getTime() >= maskDate.getTime()), 
+                    result;
+                }(dateParts.date, opts)), result;
             },
             onKeyDown: function(e, buffer, caretPos, opts) {
-                var input = this;
                 if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {
                     for (var match, today = new Date(), date = ""; match = getTokenizer(opts).exec(opts.inputFormat); ) "d" === match[0].charAt(0) ? date += pad(today.getDate(), match[0].length) : "m" === match[0].charAt(0) ? date += pad(today.getMonth() + 1, match[0].length) : "yyyy" === match[0] ? date += today.getFullYear().toString() : "y" === match[0].charAt(0) && (date += pad(today.getYear(), match[0].length));
-                    input.inputmask._valueSet(date), $(input).trigger("setvalue");
+                    this.inputmask._valueSet(date), $(this).trigger("setvalue");
                 }
             },
             onUnMask: function(maskedValue, unmaskedValue, opts) {

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

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.0-103
+* Version: 4.0.0-beta.1
 */
 
 !function(factory) {

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


+ 9 - 12
dist/inputmask/inputmask.numeric.extensions.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.0-103
+* Version: 4.0.0-beta.1
 */
 
 !function(factory) {
@@ -67,7 +67,7 @@
             autoUnmask: !1,
             unmaskAsNumber: !1,
             inputmode: "numeric",
-            preValidation: function(buffer, pos, c, isSelection, opts) {
+            preValidation: function(buffer, pos, c, isSelection, opts, maskset) {
                 if ("-" === c || c === opts.negationSymbol.front) return !0 === opts.allowMinus && (opts.isNegative = opts.isNegative === undefined || !opts.isNegative, 
                 "" === buffer.join("") || {
                     caret: pos,
@@ -75,7 +75,7 @@
                 });
                 if (!1 === isSelection && c === opts.radixPoint && opts.digits !== undefined && (isNaN(opts.digits) || parseInt(opts.digits) > 0)) {
                     var radixPos = $.inArray(opts.radixPoint, buffer);
-                    if (-1 !== radixPos) return !0 === opts.numericInput ? pos === radixPos : {
+                    if (-1 !== radixPos && maskset.validPositions[radixPos] !== undefined) return !0 === opts.numericInput ? pos === radixPos : {
                         caret: radixPos + 1
                     };
                 }
@@ -93,9 +93,7 @@
                 opts.prefix.length > 0 && caretPos >= (!1 === opts.isNegative ? 1 : 0) && caretPos < opts.prefix.length - 1 + (!1 === opts.isNegative ? 1 : 0) ? prefix[caretPos - (!1 === opts.isNegative ? 1 : 0)] = "?" : opts.suffix.length > 0 && caretPos >= maskedValue.length - opts.suffix.length - (!1 === opts.isNegative ? 1 : 0) && (suffix[caretPos - (maskedValue.length - opts.suffix.length - (!1 === opts.isNegative ? 1 : 0))] = "?")), 
                 prefix = prefix.join(""), suffix = suffix.join("");
                 var processValue = maskedValue.join("").replace(prefix, "");
-                if (processValue = processValue.replace(suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""), 
-                processValue = processValue.replace(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"), ""), 
-                processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), ""), 
+                if (processValue = (processValue = (processValue = (processValue = processValue.replace(suffix, "")).replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), "")).replace(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"), "")).replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), ""), 
                 isNaN(opts.placeholder) && (processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.placeholder), "g"), "")), 
                 processValue.length > 1 && 1 !== processValue.indexOf(opts.radixPoint) && ("0" === charAtPos && (processValue = processValue.replace(/^\?/g, "")), 
                 processValue = processValue.replace(/^0/g, "")), processValue.charAt(0) === opts.radixPoint && "" !== opts.radixPoint && !0 !== opts.numericInput && (processValue = "0" + processValue), 
@@ -204,8 +202,8 @@
                         if (!0 === isValid) {
                             if (!0 !== opts.numericInput && maskset.validPositions[pos] !== undefined && "~" === maskset.validPositions[pos].match.def && !isSelection) {
                                 var processValue = maskset.buffer.join(""), pvRadixSplit = (processValue = (processValue = processValue.replace(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"), "")).replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "")).split(opts.radixPoint);
-                                pvRadixSplit.length > 1 && (pvRadixSplit[1] = pvRadixSplit[1].replace(/0/g, opts.placeholder.charAt(0))), 
-                                "0" === pvRadixSplit[0] && (pvRadixSplit[0] = pvRadixSplit[0].replace(/0/g, opts.placeholder.charAt(0))), 
+                                pvRadixSplit.length > 1 && (pvRadixSplit[1] = pvRadixSplit[1].replace(/0/g, opts.placeholder.charAt(0) || "0")), 
+                                "0" === pvRadixSplit[0] && (pvRadixSplit[0] = pvRadixSplit[0].replace(/0/g, opts.placeholder.charAt(0) || "0")), 
                                 processValue = pvRadixSplit[0] + opts.radixPoint + pvRadixSplit[1] || "";
                                 var bufferTemplate = maskset._buffer.join("");
                                 for (processValue === opts.radixPoint && (processValue = bufferTemplate); null === processValue.match(Inputmask.escapeRegex(bufferTemplate) + "$"); ) bufferTemplate = bufferTemplate.slice(1);
@@ -254,18 +252,17 @@
             onUnMask: function(maskedValue, unmaskedValue, opts) {
                 if ("" === unmaskedValue && !0 === opts.nullable) return unmaskedValue;
                 var processValue = maskedValue.replace(opts.prefix, "");
-                return processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""), 
+                return processValue = (processValue = processValue.replace(opts.suffix, "")).replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""), 
                 "" !== opts.placeholder.charAt(0) && (processValue = processValue.replace(new RegExp(opts.placeholder.charAt(0), "g"), "0")), 
                 opts.unmaskAsNumber ? ("" !== opts.radixPoint && -1 !== processValue.indexOf(opts.radixPoint) && (processValue = processValue.replace(Inputmask.escapeRegex.call(this, opts.radixPoint), ".")), 
-                processValue = processValue.replace(new RegExp("^" + Inputmask.escapeRegex(opts.negationSymbol.front)), "-"), 
-                processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), ""), 
+                processValue = (processValue = processValue.replace(new RegExp("^" + Inputmask.escapeRegex(opts.negationSymbol.front)), "-")).replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), ""), 
                 Number(processValue)) : processValue;
             },
             isComplete: function(buffer, opts) {
                 var maskedValue = buffer.join("");
                 if (buffer.slice().join("") !== maskedValue) return !1;
                 var processValue = maskedValue.replace(opts.prefix, "");
-                return processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator) + "([0-9]{3})", "g"), "$1"), 
+                return processValue = (processValue = processValue.replace(opts.suffix, "")).replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator) + "([0-9]{3})", "g"), "$1"), 
                 "," === opts.radixPoint && (processValue = processValue.replace(Inputmask.escapeRegex(opts.radixPoint), ".")), 
                 isFinite(processValue);
             },

+ 6 - 8
dist/inputmask/inputmask.phone.extensions.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.0-103
+* Version: 4.0.0-beta.1
 */
 
 !function(factory) {
@@ -15,22 +15,20 @@
     }
     var analyseMaskBase = Inputmask.prototype.analyseMask;
     return Inputmask.prototype.analyseMask = function(mask, regexMask, opts) {
-        function reduceVariations(masks, previousVariation, previousmaskGroup) {
+        var maskGroups = {};
+        return opts.phoneCodes && (opts.phoneCodes && opts.phoneCodes.length > 1e3 && (function reduceVariations(masks, previousVariation, previousmaskGroup) {
             previousVariation = previousVariation || "", previousmaskGroup = previousmaskGroup || maskGroups, 
             "" !== previousVariation && (previousmaskGroup[previousVariation] = {});
             for (var variation = "", maskGroup = previousmaskGroup[previousVariation] || previousmaskGroup, i = masks.length - 1; i >= 0; i--) maskGroup[variation = (mask = masks[i].mask || masks[i]).substr(0, 1)] = maskGroup[variation] || [], 
             maskGroup[variation].unshift(mask.substr(1)), masks.splice(i, 1);
             for (var ndx in maskGroup) maskGroup[ndx].length > 500 && reduceVariations(maskGroup[ndx].slice(), ndx, maskGroup);
-        }
-        function rebuild(maskGroup) {
+        }((mask = mask.substr(1, mask.length - 2)).split(opts.groupmarker[1] + opts.alternatormarker + opts.groupmarker[0])), 
+        mask = function rebuild(maskGroup) {
             var mask = "", submasks = [];
             for (var ndx in maskGroup) $.isArray(maskGroup[ndx]) ? 1 === maskGroup[ndx].length ? submasks.push(ndx + maskGroup[ndx]) : submasks.push(ndx + opts.groupmarker[0] + maskGroup[ndx].join(opts.groupmarker[1] + opts.alternatormarker + opts.groupmarker[0]) + opts.groupmarker[1]) : submasks.push(ndx + rebuild(maskGroup[ndx]));
             return 1 === submasks.length ? mask += submasks[0] : mask += opts.groupmarker[0] + submasks.join(opts.groupmarker[1] + opts.alternatormarker + opts.groupmarker[0]) + opts.groupmarker[1], 
             mask;
-        }
-        var maskGroups = {};
-        return opts.phoneCodes && (opts.phoneCodes && opts.phoneCodes.length > 1e3 && (reduceVariations((mask = mask.substr(1, mask.length - 2)).split(opts.groupmarker[1] + opts.alternatormarker + opts.groupmarker[0])), 
-        mask = rebuild(maskGroups)), mask = mask.replace(/9/g, "\\9")), analyseMaskBase.call(this, mask, regexMask, opts);
+        }(maskGroups)), mask = mask.replace(/9/g, "\\9")), analyseMaskBase.call(this, mask, regexMask, opts);
     }, Inputmask.extendAliases({
         abstractphone: {
             groupmarker: [ "<", ">" ],

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

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.0-103
+* Version: 4.0.0-beta.1
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/phone-codes/phone-be.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.0-103
+* Version: 4.0.0-beta.1
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/phone-codes/phone-ca.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.0-103
+* Version: 4.0.0-beta.1
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/phone-codes/phone-hu.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.0-103
+* Version: 4.0.0-beta.1
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/phone-codes/phone-mx.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.0-103
+* Version: 4.0.0-beta.1
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/phone-codes/phone-nl.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.0-103
+* Version: 4.0.0-beta.1
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/phone-codes/phone-ru.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.0-103
+* Version: 4.0.0-beta.1
 */
 
 !function(factory) {

+ 1 - 1
dist/inputmask/phone-codes/phone-uk.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.0-103
+* Version: 4.0.0-beta.1
 */
 
 !function(factory) {

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


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


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


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


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


+ 1 - 1
dist/min/inputmask/dependencyLibs/inputmask.dependencyLib.jquery.min.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.0-103
+* Version: 4.0.0-beta.1
 */
 
 !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):window.dependencyLib=e(jQuery)}(function(e){return e});

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


+ 1 - 1
dist/min/inputmask/global/document.min.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.0-103
+* Version: 4.0.0-beta.1
 */
 
 "function"==typeof define&&define.amd?define(function(){return document}):"object"==typeof exports&&(module.exports=document);

+ 1 - 1
dist/min/inputmask/global/window.min.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.0-103
+* Version: 4.0.0-beta.1
 */
 
 "function"==typeof define&&define.amd?define(function(){return window}):"object"==typeof exports&&(module.exports=window);

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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


+ 2 - 2
js/inputmask.js

@@ -1616,7 +1616,7 @@
                         }
                     }
                     for (var ps = originalPos; ps < newPos; ps++) {
-                        if (getMaskSet().validPositions[ps] === undefined && (!isMask(ps, true) || getPlaceholder(ps, getTestTemplate(ps), true) === opts.radixPoint)) {
+                        if (getMaskSet().validPositions[ps] === undefined && !isMask(ps, true)) {
                             var vp = ps == 0 ? getTest(ps) : getMaskSet().validPositions[ps - 1];
                             if (vp) {
                                 var targetLocator = getLocator(vp), tests = getTests(ps).slice(),
@@ -1705,7 +1705,7 @@
                     positionsClone = $.extend(true, {}, getMaskSet().validPositions); //clone the currentPositions
 
                 if ($.isFunction(opts.preValidation) && !strict && fromSetValid !== true && validateOnly !== true) {
-                    result = opts.preValidation(getBuffer(), maskPos, c, isSelection(pos), opts);
+                    result = opts.preValidation(getBuffer(), maskPos, c, isSelection(pos), opts, getMaskSet());
                 }
                 if (result === true) {
                     trackbackPositions(undefined, maskPos, true);

+ 6 - 3
js/inputmask.numeric.extensions.js

@@ -136,7 +136,7 @@
             autoUnmask: false,
             unmaskAsNumber: false,
             inputmode: "numeric",
-            preValidation: function (buffer, pos, c, isSelection, opts) {
+            preValidation: function (buffer, pos, c, isSelection, opts, maskset) {
                 if (c === "-" || c === opts.negationSymbol.front) {
                     if (opts.allowMinus !== true) return false;
                     opts.isNegative = opts.isNegative === undefined ? true : !opts.isNegative;
@@ -148,7 +148,7 @@
                 }
                 if (isSelection === false && c === opts.radixPoint && (opts.digits !== undefined && (isNaN(opts.digits) || parseInt(opts.digits) > 0))) {
                     var radixPos = $.inArray(opts.radixPoint, buffer);
-                    if (radixPos !== -1) {
+                    if (radixPos !== -1 && maskset.validPositions[radixPos] !== undefined) {
                         if (opts.numericInput === true) {
                             return pos === radixPos;
                         }
@@ -423,7 +423,9 @@
                                 while (processValue.match(Inputmask.escapeRegex(bufferTemplate) + "$") === null) {
                                     bufferTemplate = bufferTemplate.slice(1);
                                 }
-                                processValue = processValue.replace(bufferTemplate, "");
+                                // if (processValue !== opts.radixPoint) {
+                                    processValue = processValue.replace(bufferTemplate, "");
+                                // }
                                 processValue = processValue.split("");
 
                                 if (processValue[pos] === undefined) {
@@ -472,6 +474,7 @@
                                 "caret": pos + 1
                             };
                         }
+
                         return isValid;
                     },
                     cardinality: 1,

+ 17 - 18
package.json

@@ -1,6 +1,6 @@
 {
   "name": "inputmask",
-  "version": "4.0.0-103",
+  "version": "4.0.0-beta.1",
   "description": "Inputmask is a javascript library which creates an input mask.  Inputmask can run against vanilla javascript, jQuery and jqlite.",
   "main": "index.js",
   "files": [
@@ -35,44 +35,43 @@
   },
   "homepage": "https://github.com/RobinHerbots/Inputmask",
   "devDependencies": {
-    "awesome-typescript-loader": "^3.2.3",
+    "awesome-typescript-loader": "^3.4.1",
     "babel-core": "^6.26.0",
     "babel-helpers": "^6.24.1",
     "babel-loader": "^7.1.2",
-    "babel-preset-env": "^1.6.0",
-    "caniuse-db": "^1.0.30000744",
-    "css-loader": "^0.28.7",
+    "babel-preset-env": "^1.6.1",
+    "caniuse-db": "^1.0.30000800",
+    "css-loader": "^0.28.9",
     "grunt": "^1.0.1",
     "grunt-available-tasks": "^0.6.3",
     "grunt-bump": "^0.8.0",
     "grunt-cli": "^1.2.0",
     "grunt-contrib-clean": "^1.1.0",
-    "grunt-contrib-uglify": "^3.1.0",
+    "grunt-contrib-uglify": "^3.3.0",
     "grunt-eslint": "^20.1.0",
     "grunt-karma": "^2.0.0",
     "grunt-nuget": "^0.3.0",
     "grunt-release": "^0.14.0",
-    "grunt-shell": "^2.1.0",
     "grunt-webpack": "^3.0.2",
     "jqlite": "^0.2.42",
     "jquery": "^2.2.4",
-    "karma": "^1.7.1",
+    "karma": "^2.0.0",
     "karma-chrome-launcher": "^2.2.0",
-    "karma-firefox-launcher": "^1.0.1",
+    "karma-firefox-launcher": "^1.1.0",
     "karma-ie-launcher": "^1.0.0",
     "karma-phantomjs-launcher": "^1.0.4",
     "karma-qunit": "^1.2.1",
     "load-grunt-tasks": "^3.5.2",
     "loader-utils": "^1.1.0",
-    "phantomjs-prebuilt": "^2.1.15",
-    "postcss": "^6.0.13",
-    "postcss-cssnext": "^3.0.2",
-    "postcss-loader": "^2.0.6",
-    "qunitjs": "^2.4.0",
-    "source-map-loader": "^0.2.2",
-    "style-loader": "^0.19.0",
-    "typescript": "^2.5.3",
-    "webpack": "^3.6.0"
+    "phantomjs-prebuilt": "^2.1.16",
+    "postcss": "^6.0.17",
+    "postcss-cssnext": "^3.1.0",
+    "postcss-loader": "^2.1.0",
+    "qunitjs": "^2.4.1",
+    "source-map-loader": "^0.2.3",
+    "style-loader": "^0.20.1",
+    "typescript": "^2.7.1",
+    "webpack": "^3.10.0"
   },
   "dependencies": {}
 }