ソースを参照

fix integer mask

Robin Herbots 12 年 前
コミット
53fff1c328

BIN
dist/jQuery.InputMask.1.3.9.nupkg


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

@@ -1729,7 +1729,7 @@ Optional extensions on the jquery.inputmask base
                 if (!greedy && repeat > 1) {
                     calculatedLength += (buffer.length * (repeat - 1));
                 }
-                
+
                 var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator);
                 var escapedRadixPoint = $.inputmask.escapeRegex.call(this, opts.radixPoint);
                 var currentBufferStr = currentBuffer.join(''), strippedBufferStr = currentBufferStr.replace(new RegExp(escapedGroupSeparator, "g"), "").replace(new RegExp(escapedRadixPoint), ""),
@@ -1854,7 +1854,10 @@ Optional extensions on the jquery.inputmask base
         },
         'integer': {
             regex: {
-                number: function (groupSeparator, groupSize) { return new RegExp("^([\+\-]?\\d*)$"); }
+                number: function (groupSeparator, groupSize) {
+                    var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, groupSeparator);
+                    return new RegExp("^[\+-]?(\\d+|\\d{1," + groupSize + "}((" + escapedGroupSeparator + "\\d{" + groupSize + "})?)+)$");
+                }
             },
             alias: "decimal"
         }

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


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


+ 5 - 2
js/jquery.inputmask.numeric.extensions.js

@@ -27,7 +27,7 @@ Optional extensions on the jquery.inputmask base
                 if (!greedy && repeat > 1) {
                     calculatedLength += (buffer.length * (repeat - 1));
                 }
-                
+
                 var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator);
                 var escapedRadixPoint = $.inputmask.escapeRegex.call(this, opts.radixPoint);
                 var currentBufferStr = currentBuffer.join(''), strippedBufferStr = currentBufferStr.replace(new RegExp(escapedGroupSeparator, "g"), "").replace(new RegExp(escapedRadixPoint), ""),
@@ -152,7 +152,10 @@ Optional extensions on the jquery.inputmask base
         },
         'integer': {
             regex: {
-                number: function (groupSeparator, groupSize) { return new RegExp("^([\+\-]?\\d*)$"); }
+                number: function (groupSeparator, groupSize) {
+                    var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, groupSeparator);
+                    return new RegExp("^[\+-]?(\\d+|\\d{1," + groupSize + "}((" + escapedGroupSeparator + "\\d{" + groupSize + "})?)+)$");
+                }
             },
             alias: "decimal"
         }