浏览代码

revert Regex extention removal

Robin Herbots 8 年之前
父节点
当前提交
6a143cca7c
共有 60 个文件被更改,包括 595 次插入84 次删除
  1. 3 0
      CHANGELOG.md
  2. 2 2
      bower.json
  3. 3 1
      bundle.js
  4. 2 2
      component.json
  5. 1 1
      composer.json
  6. 1 1
      dist/inputmask/bindings/inputmask.binding.js
  7. 1 1
      dist/inputmask/dependencyLibs/inputmask.dependencyLib.jqlite.js
  8. 1 1
      dist/inputmask/dependencyLibs/inputmask.dependencyLib.jquery.js
  9. 1 1
      dist/inputmask/dependencyLibs/inputmask.dependencyLib.js
  10. 1 1
      dist/inputmask/global/document.js
  11. 1 1
      dist/inputmask/global/window.js
  12. 1 1
      dist/inputmask/inputmask.date.extensions.js
  13. 1 1
      dist/inputmask/inputmask.extensions.js
  14. 2 2
      dist/inputmask/inputmask.js
  15. 1 1
      dist/inputmask/inputmask.numeric.extensions.js
  16. 1 1
      dist/inputmask/inputmask.phone.extensions.js
  17. 115 0
      dist/inputmask/inputmask.regex.extensions.js
  18. 8 0
      dist/inputmask/integrations/angular.inputmask.js
  19. 3 3
      dist/inputmask/jquery.inputmask.js
  20. 8 0
      dist/inputmask/integrations/react.inputmask.js
  21. 8 0
      dist/inputmask/integrations/vue.inputmask.js
  22. 1 1
      dist/inputmask/phone-codes/phone-be.js
  23. 1 1
      dist/inputmask/phone-codes/phone-nl.js
  24. 1 1
      dist/inputmask/phone-codes/phone-ru.js
  25. 1 1
      dist/inputmask/phone-codes/phone-uk.js
  26. 1 1
      dist/inputmask/phone-codes/phone.js
  27. 126 14
      dist/jquery.inputmask.bundle.js
  28. 1 1
      dist/min/inputmask/bindings/inputmask.binding.min.js
  29. 1 1
      dist/min/inputmask/dependencyLibs/inputmask.dependencyLib.jqlite.min.js
  30. 1 1
      dist/min/inputmask/dependencyLibs/inputmask.dependencyLib.jquery.min.js
  31. 1 1
      dist/min/inputmask/dependencyLibs/inputmask.dependencyLib.min.js
  32. 1 1
      dist/min/inputmask/global/document.min.js
  33. 1 1
      dist/min/inputmask/global/window.min.js
  34. 1 1
      dist/min/inputmask/inputmask.date.extensions.min.js
  35. 1 1
      dist/min/inputmask/inputmask.extensions.min.js
  36. 3 3
      dist/min/inputmask/inputmask.min.js
  37. 1 1
      dist/min/inputmask/inputmask.numeric.extensions.min.js
  38. 1 1
      dist/min/inputmask/inputmask.phone.extensions.min.js
  39. 9 0
      dist/min/inputmask/inputmask.regex.extensions.min.js
  40. 8 0
      dist/min/inputmask/integrations/angular.inputmask.min.js
  41. 9 0
      dist/min/inputmask/integrations/jquery.inputmask.min.js
  42. 8 0
      dist/min/inputmask/integrations/react.inputmask.min.js
  43. 8 0
      dist/min/inputmask/integrations/vue.inputmask.min.js
  44. 0 9
      dist/min/inputmask/jquery.inputmask.min.js
  45. 1 1
      dist/min/inputmask/phone-codes/phone-be.min.js
  46. 1 1
      dist/min/inputmask/phone-codes/phone-nl.min.js
  47. 1 1
      dist/min/inputmask/phone-codes/phone-ru.min.js
  48. 1 1
      dist/min/inputmask/phone-codes/phone-uk.min.js
  49. 1 1
      dist/min/inputmask/phone-codes/phone.min.js
  50. 5 5
      dist/min/jquery.inputmask.bundle.min.js
  51. 1 1
      js/inputmask.js
  52. 217 0
      js/inputmask.regex.extensions.js
  53. 1 0
      js/integrations/angular.inputmask.js
  54. 2 2
      js/jquery.inputmask.js
  55. 1 0
      js/integrations/react.inputmask.js
  56. 1 0
      js/integrations/vue.inputmask.js
  57. 4 2
      nuspecs/Inputmask.nuspec
  58. 1 1
      nuspecs/Readme.txt
  59. 1 1
      package.json
  60. 5 5
      qunit/index.js

+ 3 - 0
CHANGELOG.md

@@ -6,10 +6,13 @@ All notable changes to this project will be documented in this file.
 - allow custom operation in casing option by callback #1565
 
 ### Updates
+- move to jquery.inputmask.js to integrations
+- put back Regex alias extension for legacy support #1611
 - postvalidation cannot set pos of undefined
 - fix undoValue initialization 
 
 ### Fixed
+- Major issue with regex #1611
 - React onChange event doesn't work with Inputmask #1377
 - Currency digits and delete #1351
 - Decimal editing problems #1603

+ 2 - 2
bower.json

@@ -1,13 +1,13 @@
 {
   "name": "inputmask",
-  "version": "3.3.7-29",
+  "version": "3.3.7-35",
   "main": [
 	  "./dist/inputmask/inputmask.js",
 	  "./dist/inputmask/inputmask.extensions.js",
 	  "./dist/inputmask/inputmask.date.extensions.js",
 	  "./dist/inputmask/inputmask.numeric.extensions.js",
 	  "./dist/inputmask/inputmask.phone.extensions.js",
-	  "./dist/inputmask/jquery.inputmask.js",
+	  "./dist/inputmask/integrations/jquery.inputmask.js",
 	  "./dist/inputmask/global/document.js",
 	  "./dist/inputmask/global/window.js",
 	  "./dist/inputmask/phone-codes/phone.js",

+ 3 - 1
bundle.js

@@ -4,6 +4,8 @@ import "./js/inputmask.date.extensions";
 import "./js/inputmask.extensions";
 import "./js/inputmask.numeric.extensions";
 import "./js/inputmask.phone.extensions";
+//remove me later
+import "./js/inputmask.regex.extensions";
 
 // import "./js/phone-codes/phone-be";
 // import "./js/phone-codes/phone-nl";
@@ -15,7 +17,7 @@ import im from "./js/inputmask.js";
 import dependencyLib from "./js/dependencyLibs/inputmask.dependencyLib";
 import jQuery from "jquery";
 if (dependencyLib === jQuery) {
-    require("./js/jquery.inputmask");
+    require("./js/integrations/jquery.inputmask");
 }
 window.Inputmask = im;
 

+ 2 - 2
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": "3.3.7-29",
+	"version": "3.3.7-35",
 	"keywords": [
 		"jquery",
 		"plugins",
@@ -18,7 +18,7 @@
 		"./dist/inputmask/inputmask.date.extensions.js",
 		"./dist/inputmask/inputmask.numeric.extensions.js",
 		"./dist/inputmask/inputmask.phone.extensions.js",
-		"./dist/inputmask/jquery.inputmask.js",
+		"./dist/inputmask/integrations/jquery.inputmask.js",
 		"./dist/inputmask/global/document.js",
 		"./dist/inputmask/global/window.js",
 		"./dist/inputmask/phone-codes/phone.js",

+ 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": "3.3.7-29",
+  "version": "3.3.7-35",
   "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 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.7-29
+* Version: 3.3.7-35
 */
 
 !function(factory) {

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

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

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

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

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

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

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

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.7-29
+* Version: 3.3.7-35
 */
 
 "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 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.7-29
+* Version: 3.3.7-35
 */
 
 "function" == typeof define && define.amd ? define(function() {

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

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

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

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

+ 2 - 2
dist/inputmask/inputmask.js

@@ -3,7 +3,7 @@
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.7-29
+* Version: 3.3.7-35
 */
 
 !function(factory) {
@@ -283,7 +283,7 @@
                 locator: [],
                 cd: cacheDependency
             }), ndxIntlzr !== undefined && getMaskSet().tests[pos] ? filterTests($.extend(!0, [], matches)) : (getMaskSet().tests[pos] = $.extend(!0, [], matches), 
-            filterTests(getMaskSet().tests[pos]));
+            console.log(pos + " - " + JSON.stringify(matches)), filterTests(getMaskSet().tests[pos]));
         }
         function getBufferTemplate() {
             return getMaskSet()._buffer === undefined && (getMaskSet()._buffer = getMaskTemplate(!1, 1), 

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

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

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

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

+ 115 - 0
dist/inputmask/inputmask.regex.extensions.js

@@ -0,0 +1,115 @@
+/*!
+* inputmask.regex.extensions.js
+* https://github.com/RobinHerbots/Inputmask
+* Copyright (c) 2010 - 2017 Robin Herbots
+* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+* Version: 3.3.7-35
+*/
+
+!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) {
+    return Inputmask.extendAliases({
+        Regex: {
+            mask: "r",
+            greedy: !1,
+            repeat: "*",
+            regex: null,
+            regexTokens: null,
+            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, opts.casing ? "i" : "").test(buffer.join(""));
+            },
+            definitions: {
+                r: {
+                    validator: function(chrs, maskset, pos, strict, opts) {
+                        function RegexToken(isGroup, isQuantifier) {
+                            this.matches = [], this.isGroup = isGroup || !1, this.isQuantifier = isQuantifier || !1, 
+                            this.quantifier = {
+                                min: 1,
+                                max: 1
+                            }, this.repeaterPart = void 0;
+                        }
+                        function validateRegexToken(token, fromGroup) {
+                            var isvalid = !1;
+                            fromGroup && (regexPart += "(", openGroupCount++);
+                            for (var mndx = 0; mndx < token.matches.length; mndx++) {
+                                var matchToken = token.matches[mndx];
+                                if (!0 === matchToken.isGroup) isvalid = validateRegexToken(matchToken, !0); else if (!0 === matchToken.isQuantifier) {
+                                    var crrntndx = $.inArray(matchToken, token.matches), matchGroup = token.matches[crrntndx - 1], regexPartBak = regexPart;
+                                    if (isNaN(matchToken.quantifier.max)) {
+                                        for (;matchToken.repeaterPart && matchToken.repeaterPart !== regexPart && matchToken.repeaterPart.length > regexPart.length && !(isvalid = validateRegexToken(matchGroup, !0)); ) ;
+                                        isvalid = isvalid || validateRegexToken(matchGroup, !0), isvalid && (matchToken.repeaterPart = regexPart), 
+                                        regexPart = regexPartBak + matchToken.quantifier.max;
+                                    } else {
+                                        for (var i = 0, qm = matchToken.quantifier.max - 1; i < qm && !(isvalid = validateRegexToken(matchGroup, !0)); i++) ;
+                                        regexPart = regexPartBak + "{" + matchToken.quantifier.min + "," + matchToken.quantifier.max + "}";
+                                    }
+                                } else if (void 0 !== matchToken.matches) for (var k = 0; k < matchToken.length && !(isvalid = validateRegexToken(matchToken[k], fromGroup)); k++) ; else {
+                                    var testExp;
+                                    if ("[" == matchToken.charAt(0)) {
+                                        testExp = regexPart, testExp += matchToken;
+                                        for (var j = 0; j < openGroupCount; j++) 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 + ")$", opts.casing ? "i" : "");
+                                        if (isvalid = exp.test(bufferStr)) break;
+                                    }
+                                    regexPart += matchToken;
+                                }
+                                if (isvalid) break;
+                            }
+                            return fromGroup && (regexPart += ")", openGroupCount--), isvalid;
+                        }
+                        var bufferStr, groupToken, cbuffer = maskset.buffer.slice(), regexPart = "", isValid = !1, openGroupCount = 0;
+                        null === opts.regexTokens && function() {
+                            var match, m, currentToken = new RegexToken(), opengroups = [];
+                            for (opts.regexTokens = []; match = opts.tokenizer.exec(opts.regex); ) switch (m = match[0], 
+                            m.charAt(0)) {
+                              case "(":
+                                opengroups.push(new RegexToken(!0));
+                                break;
+
+                              case ")":
+                                groupToken = opengroups.pop(), opengroups.length > 0 ? opengroups[opengroups.length - 1].matches.push(groupToken) : currentToken.matches.push(groupToken);
+                                break;
+
+                              case "{":
+                              case "+":
+                              case "*":
+                                var quantifierToken = new RegexToken(!1, !0);
+                                m = m.replace(/[{}]/g, "");
+                                var mq = m.split(","), mq0 = isNaN(mq[0]) ? mq[0] : parseInt(mq[0]), mq1 = 1 === mq.length ? mq0 : isNaN(mq[1]) ? mq[1] : parseInt(mq[1]);
+                                if (quantifierToken.quantifier = {
+                                    min: mq0,
+                                    max: mq1
+                                }, opengroups.length > 0) {
+                                    var matches = opengroups[opengroups.length - 1].matches;
+                                    match = matches.pop(), match.isGroup || (groupToken = new RegexToken(!0), groupToken.matches.push(match), 
+                                    match = groupToken), matches.push(match), matches.push(quantifierToken);
+                                } else match = currentToken.matches.pop(), match.isGroup || (groupToken = new RegexToken(!0), 
+                                groupToken.matches.push(match), match = groupToken), currentToken.matches.push(match), 
+                                currentToken.matches.push(quantifierToken);
+                                break;
+
+                              default:
+                                opengroups.length > 0 ? opengroups[opengroups.length - 1].matches.push(m) : currentToken.matches.push(m);
+                            }
+                            currentToken.matches.length > 0 && opts.regexTokens.push(currentToken);
+                        }(), cbuffer.splice(pos, 0, chrs), bufferStr = cbuffer.join("");
+                        for (var i = 0; i < opts.regexTokens.length; i++) {
+                            var regexToken = opts.regexTokens[i];
+                            if (isValid = validateRegexToken(regexToken, regexToken.isGroup)) break;
+                        }
+                        return isValid;
+                    },
+                    cardinality: 1
+                }
+            }
+        }
+    }), Inputmask;
+});

+ 8 - 0
dist/inputmask/integrations/angular.inputmask.js

@@ -0,0 +1,8 @@
+/*!
+* integrations/angular.inputmask.js
+* https://github.com/RobinHerbots/Inputmask
+* Copyright (c) 2010 - 2017 Robin Herbots
+* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+* Version: 3.3.7-35
+*/
+

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

@@ -1,13 +1,13 @@
 /*!
-* jquery.inputmask.js
+* integrations/jquery.inputmask.js
 * https://github.com/RobinHerbots/Inputmask
 * Copyright (c) 2010 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.7-29
+* Version: 3.3.7-35
 */
 
 !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);
+    "function" == typeof define && define.amd ? define([ "jquery", "../inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("../inputmask")) : factory(jQuery, window.Inputmask);
 }(function($, Inputmask) {
     return void 0 === $.fn.inputmask && ($.fn.inputmask = function(fn, options) {
         var nptmask, input = this[0];

+ 8 - 0
dist/inputmask/integrations/react.inputmask.js

@@ -0,0 +1,8 @@
+/*!
+* integrations/react.inputmask.js
+* https://github.com/RobinHerbots/Inputmask
+* Copyright (c) 2010 - 2017 Robin Herbots
+* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+* Version: 3.3.7-35
+*/
+

+ 8 - 0
dist/inputmask/integrations/vue.inputmask.js

@@ -0,0 +1,8 @@
+/*!
+* integrations/vue.inputmask.js
+* https://github.com/RobinHerbots/Inputmask
+* Copyright (c) 2010 - 2017 Robin Herbots
+* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+* Version: 3.3.7-35
+*/
+

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

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

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

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

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

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

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

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

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

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

文件差异内容过多而无法显示
+ 126 - 14
dist/jquery.inputmask.bundle.js


文件差异内容过多而无法显示
+ 1 - 1
dist/min/inputmask/bindings/inputmask.binding.min.js


文件差异内容过多而无法显示
+ 1 - 1
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 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.7-29
+* Version: 3.3.7-35
 */
 
 !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):window.dependencyLib=a(jQuery)}(function(a){return a});

文件差异内容过多而无法显示
+ 1 - 1
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 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.7-29
+* Version: 3.3.7-35
 */
 
 "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 - 2017 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.3.7-29
+* Version: 3.3.7-35
 */
 
 "function"==typeof define&&define.amd?define(function(){return window}):"object"==typeof exports&&(module.exports=window);

文件差异内容过多而无法显示
+ 1 - 1
dist/min/inputmask/inputmask.date.extensions.min.js


文件差异内容过多而无法显示
+ 1 - 1
dist/min/inputmask/inputmask.extensions.min.js


文件差异内容过多而无法显示
+ 3 - 3
dist/min/inputmask/inputmask.min.js


文件差异内容过多而无法显示
+ 1 - 1
dist/min/inputmask/inputmask.numeric.extensions.min.js


文件差异内容过多而无法显示
+ 1 - 1
dist/min/inputmask/inputmask.phone.extensions.min.js


文件差异内容过多而无法显示
+ 9 - 0
dist/min/inputmask/inputmask.regex.extensions.min.js


+ 8 - 0
dist/min/inputmask/integrations/angular.inputmask.min.js

@@ -0,0 +1,8 @@
+/*!
+* integrations/angular.inputmask.min.js
+* https://github.com/RobinHerbots/Inputmask
+* Copyright (c) 2010 - 2017 Robin Herbots
+* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+* Version: 3.3.7-35
+*/
+

文件差异内容过多而无法显示
+ 9 - 0
dist/min/inputmask/integrations/jquery.inputmask.min.js


+ 8 - 0
dist/min/inputmask/integrations/react.inputmask.min.js

@@ -0,0 +1,8 @@
+/*!
+* integrations/react.inputmask.min.js
+* https://github.com/RobinHerbots/Inputmask
+* Copyright (c) 2010 - 2017 Robin Herbots
+* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+* Version: 3.3.7-35
+*/
+

+ 8 - 0
dist/min/inputmask/integrations/vue.inputmask.min.js

@@ -0,0 +1,8 @@
+/*!
+* integrations/vue.inputmask.min.js
+* https://github.com/RobinHerbots/Inputmask
+* Copyright (c) 2010 - 2017 Robin Herbots
+* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+* Version: 3.3.7-35
+*/
+

文件差异内容过多而无法显示
+ 0 - 9
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-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


文件差异内容过多而无法显示
+ 1 - 1
dist/min/inputmask/phone-codes/phone.min.js


文件差异内容过多而无法显示
+ 5 - 5
dist/min/jquery.inputmask.bundle.min.js


+ 1 - 1
js/inputmask.js

@@ -1330,7 +1330,7 @@
                     return filterTests($.extend(true, [], matches));
                 }
                 getMaskSet().tests[pos] = $.extend(true, [], matches); //set a clone to prevent overwriting some props
-// console.log(pos + " - " + JSON.stringify(matches));
+                console.log(pos + " - " + JSON.stringify(matches));
                 return filterTests(getMaskSet().tests[pos]);
             }
 

+ 217 - 0
js/inputmask.regex.extensions.js

@@ -0,0 +1,217 @@
+/*
+ Input Mask plugin extensions
+ http://github.com/RobinHerbots/jquery.inputmask
+ Copyright (c) 2010 -  Robin Herbots
+ Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+ Version: 0.0.0-dev
+
+ Regex extensions on the jquery.inputmask base
+ Allows for using regular expressions as a mask
+
+ This file is only for legacy support
+ */
+(function (factory) {
+    if (typeof define === "function" && define.amd) {
+        define(["./dependencyLibs/inputmask.dependencyLib", "./inputmask"], factory);
+    } else if (typeof exports === "object") {
+        module.exports = factory(require("./dependencyLibs/inputmask.dependencyLib"), require("./inputmask"));
+    } else {
+        factory(window.dependencyLib || jQuery, window.Inputmask);
+    }
+}
+(function ($, Inputmask) {
+    Inputmask.extendAliases({ // $(selector).inputmask("Regex", { regex: "[0-9]*"}
+        "Regex": {
+            mask: "r",
+            greedy: false,
+            repeat: "*",
+            regex: null,
+            regexTokens: null,
+            //Thx to https://github.com/slevithan/regex-colorizer for the tokenizer regex
+            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, opts.casing ? "i" : "").test(buffer.join(""));
+            },
+            definitions: {
+                "r": {
+                    validator: function (chrs, maskset, pos, strict, opts) {
+                        var cbuffer = maskset.buffer.slice(),
+                            bufferStr,
+                            regexPart = "",
+                            isValid = false,
+                            openGroupCount = 0,
+                            groupToken;
+
+                        function RegexToken(isGroup, isQuantifier) {
+                            this.matches = [];
+                            this.isGroup = isGroup || false;
+                            this.isQuantifier = isQuantifier || false;
+                            this.quantifier = {
+                                min: 1,
+                                max: 1
+                            };
+                            this.repeaterPart = undefined;
+                        }
+
+                        function analyseRegex() {
+                            var currentToken = new RegexToken(),
+                                match, m, opengroups = [];
+
+                            opts.regexTokens = [];
+
+                            // The tokenizer regex does most of the tokenization grunt work
+                            while (match = opts.tokenizer.exec(opts.regex)) {
+                                m = match[0];
+                                switch (m.charAt(0)) {
+                                    case "(": // Group opening
+                                        opengroups.push(new RegexToken(true));
+                                        break;
+                                    case ")": // Group closing
+                                        groupToken = opengroups.pop();
+                                        if (opengroups.length > 0) {
+                                            opengroups[opengroups.length - 1].matches.push(groupToken);
+                                        } else {
+                                            currentToken.matches.push(groupToken);
+                                        }
+                                        break;
+                                    case "{":
+                                    case "+":
+                                    case "*": //Quantifier
+                                        var quantifierToken = new RegexToken(false, true);
+                                        m = m.replace(/[{}]/g, "");
+                                        var mq = m.split(","),
+                                            mq0 = isNaN(mq[0]) ? mq[0] : parseInt(mq[0]),
+                                            mq1 = mq.length === 1 ? mq0 : (isNaN(mq[1]) ? mq[1] : parseInt(mq[1]));
+                                        quantifierToken.quantifier = {
+                                            min: mq0,
+                                            max: mq1
+                                        };
+                                        if (opengroups.length > 0) {
+                                            var matches = opengroups[opengroups.length - 1].matches;
+                                            match = matches.pop();
+                                            if (!match.isGroup) {
+                                                groupToken = new RegexToken(true);
+                                                groupToken.matches.push(match);
+                                                match = groupToken;
+                                            }
+                                            matches.push(match);
+                                            matches.push(quantifierToken);
+                                        } else {
+                                            match = currentToken.matches.pop();
+                                            if (!match.isGroup) {
+                                                groupToken = new RegexToken(true);
+                                                groupToken.matches.push(match);
+                                                match = groupToken;
+                                            }
+                                            currentToken.matches.push(match);
+                                            currentToken.matches.push(quantifierToken);
+                                        }
+                                        break;
+                                    default:
+                                        if (opengroups.length > 0) {
+                                            opengroups[opengroups.length - 1].matches.push(m);
+                                        } else {
+                                            currentToken.matches.push(m);
+                                        }
+                                        break;
+                                }
+                            }
+
+                            if (currentToken.matches.length > 0) {
+                                opts.regexTokens.push(currentToken);
+                            }
+                        }
+
+                        function validateRegexToken(token, fromGroup) {
+                            var isvalid = false;
+                            if (fromGroup) {
+                                regexPart += "(";
+                                openGroupCount++;
+                            }
+                            for (var mndx = 0; mndx < token.matches.length; mndx++) {
+                                var matchToken = token.matches[mndx];
+                                if (matchToken.isGroup === true) {
+                                    isvalid = validateRegexToken(matchToken, true);
+                                } else if (matchToken.isQuantifier === true) {
+                                    var crrntndx = $.inArray(matchToken, token.matches),
+                                        matchGroup = token.matches[crrntndx - 1];
+                                    var regexPartBak = regexPart;
+                                    if (isNaN(matchToken.quantifier.max)) {
+                                        while (matchToken.repeaterPart && matchToken.repeaterPart !== regexPart && matchToken.repeaterPart.length > regexPart.length) {
+                                            isvalid = validateRegexToken(matchGroup, true);
+                                            if (isvalid) break;
+                                        }
+                                        isvalid = isvalid || validateRegexToken(matchGroup, true);
+                                        if (isvalid) matchToken.repeaterPart = regexPart;
+                                        regexPart = regexPartBak + matchToken.quantifier.max;
+                                    } else {
+                                        for (var i = 0, qm = matchToken.quantifier.max - 1; i < qm; i++) {
+                                            isvalid = validateRegexToken(matchGroup, true);
+                                            if (isvalid) break;
+                                        }
+                                        regexPart = regexPartBak + "{" + matchToken.quantifier.min + "," + matchToken.quantifier.max + "}";
+                                    }
+                                } else if (matchToken.matches !== undefined) {
+                                    for (var k = 0; k < matchToken.length; k++) {
+                                        isvalid = validateRegexToken(matchToken[k], fromGroup);
+                                        if (isvalid) break;
+                                    }
+                                } else {
+                                    var testExp;
+                                    if (matchToken.charAt(0) == "[") {
+                                        testExp = regexPart;
+                                        testExp += matchToken;
+                                        for (var j = 0; j < openGroupCount; j++) {
+                                            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) === "\\") continue;
+                                            testExp = regexPart;
+                                            testExp += matchToken.substr(0, l + 1);
+                                            testExp = testExp.replace(/\|$/, "");
+                                            for (var j = 0; j < openGroupCount; j++) {
+                                                testExp += ")";
+                                            }
+                                            var exp = new RegExp("^(" + testExp + ")$", opts.casing ? "i" : "");
+                                            isvalid = exp.test(bufferStr);
+                                            if (isvalid) break;
+                                        }
+                                    }
+                                    regexPart += matchToken;
+                                }
+                                if (isvalid) break;
+                            }
+
+                            if (fromGroup) {
+                                regexPart += ")";
+                                openGroupCount--;
+                            }
+
+                            return isvalid;
+                        }
+
+                        if (opts.regexTokens === null) {
+                            analyseRegex();
+                        }
+
+                        cbuffer.splice(pos, 0, chrs);
+                        bufferStr = cbuffer.join("");
+                        for (var i = 0; i < opts.regexTokens.length; i++) {
+                            var regexToken = opts.regexTokens[i];
+                            isValid = validateRegexToken(regexToken, regexToken.isGroup);
+                            if (isValid) break;
+                        }
+
+                        return isValid;
+                    },
+                    cardinality: 1
+                }
+            }
+        }
+    });
+    return Inputmask;
+}));

+ 1 - 0
js/integrations/angular.inputmask.js

@@ -0,0 +1 @@
+//TODO IMPLEMENT ME

+ 2 - 2
js/jquery.inputmask.js

@@ -8,9 +8,9 @@
 
 (function (factory) {
 	if (typeof define === "function" && define.amd) {
-		define(["jquery", "./inputmask"], factory);
+		define(["jquery", "../inputmask"], factory);
 	} else if (typeof exports === "object") {
-		module.exports = factory(require("jquery"), require("./inputmask"));
+		module.exports = factory(require("jquery"), require("../inputmask"));
 	} else {
 		factory(jQuery, window.Inputmask);
 	}

+ 1 - 0
js/integrations/react.inputmask.js

@@ -0,0 +1 @@
+//TODO IMPLEMENT ME

+ 1 - 0
js/integrations/vue.inputmask.js

@@ -0,0 +1 @@
+//TODO IMPLEMENT ME

+ 4 - 2
nuspecs/Inputmask.nuspec

@@ -46,8 +46,10 @@
         <file src="..\dist\min\inputmask\inputmask.numeric.extensions.min.js" target="content\Scripts\inputmask\inputmask.numeric.extensions.min.js" />
         <file src="..\dist\inputmask\inputmask.phone.extensions.js" target="content\Scripts\inputmask\inputmask.phone.extensions.js" />
         <file src="..\dist\min\inputmask\inputmask.phone.extensions.min.js" target="content\Scripts\inputmask\inputmask.phone.extensions.min.js" />
-        <file src="..\dist\inputmask\jquery.inputmask.js" target="content\Scripts\inputmask\jquery.inputmask.js" />
-        <file src="..\dist\min\inputmask\jquery.inputmask.min.js" target="content\Scripts\inputmask\jquery.inputmask.min.js" />
+        <file src="..\dist\inputmask\inputmask.regex.extensions.js" target="content\Scripts\inputmask\inputmask.regex.extensions.js" />
+        <file src="..\dist\min\inputmask\inputmask.regex.extensions.min.js" target="content\Scripts\inputmask\inputmask.regex.extensions.min.js" />
+        <file src="..\dist\inputmask\integrations\jquery.inputmask.js" target="content\Scripts\inputmask\integrations\jquery.inputmask.js" />
+        <file src="..\dist\min\inputmask\integrations\jquery.inputmask.min.js" target="content\Scripts\inputmask\integrations\jquery.inputmask.min.js" />
         <file src="..\dist\jquery.inputmask.bundle.js" target="content\Scripts\jquery.inputmask.bundle.js" />
         <file src="..\dist\min\jquery.inputmask.bundle.min.js" target="content\Scripts\jquery.inputmask.bundle.min.js" />
         <file src="Readme.txt" target="Readme.txt" />

+ 1 - 1
nuspecs/Readme.txt

@@ -10,7 +10,7 @@ In App_Start, BundleConfig.cs
 bundles.Add(new ScriptBundle("~/bundles/inputmask").Include(
             //~/Scripts/Inputmask/dependencyLibs/inputmask.dependencyLib.js",  //if not using jquery
             "~/Scripts/Inputmask/inputmask.js",
-            "~/Scripts/Inputmask/jquery.inputmask.js",
+            "~/Scripts/Inputmask/integrations/jquery.inputmask.js",
             "~/Scripts/Inputmask/inputmask.extensions.js",
             "~/Scripts/Inputmask/inputmask.date.extensions.js",
             //and other extensions you want to include

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "inputmask",
-  "version": "3.3.7-29",
+  "version": "3.3.7-35",
   "description": "Inputmask is a javascript library which creates an input mask.  Inputmask can run against vanilla javascript, jQuery and jqlite.",
   "main": "index.js",
   "files": [

+ 5 - 5
qunit/index.js

@@ -11,7 +11,7 @@ import "../js/phone-codes/phone-nl";
 import "../js/phone-codes/phone-ru";
 import "../js/phone-codes/phone-uk";
 import "../js/phone-codes/phone";
-import "../js/jquery.inputmask";
+import "../js/integrations/jquery.inputmask";
 
 import  Inputmask from "../js/inputmask";
 import dependencyLib from "../js/dependencyLibs/inputmask.dependencyLib";
@@ -25,10 +25,10 @@ import simulator from "./simulator.js";
 
 
 // android testing
-Inputmask.extendDefaults({
-   inputEventOnly: true
-});
-window.Inputmask = Inputmask; //inject globally for the simulator to detect inputeventonly
+// Inputmask.extendDefaults({
+//    inputEventOnly: true
+// });
+// window.Inputmask = Inputmask; //inject globally for the simulator to detect inputeventonly
 
 import tests_alternations from "./tests_alternations";
 import tests_attributes from "./tests_attributes";