ソースを参照

Can not read property join of undefined when using Inputmask.format #2019

Robin Herbots 7 年 前
コミット
a1a4c64f9d

+ 1 - 0
CHANGELOG.md

@@ -5,6 +5,7 @@
 ### Updates
 
 ### Fixed
+- "Can not read property 'join' of undefined" when using Inputmask.format #2019
 - Inputmask numeric does no round up when digits is 0 #2018
 - Strange Calendar popup issue in IE Only when used with Daterangepicker #1965
 - incorrect work min max date - #2011, #2013

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "inputmask",
-  "version": "4.0.3-beta.2",
+  "version": "4.0.3-beta.3",
   "main": [
 	  "./index.js",
     "./css/inputmask.css"

+ 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.3-beta.2",
+  "version": "4.0.3-beta.3",
   "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.3-beta.2
+* Version: 4.0.3-beta.3
 */
 
 (function(factory) {

+ 1 - 1
dist/inputmask/dependencyLibs/inputmask.dependencyLib.jqlite.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.3-beta.2
+* Version: 4.0.3-beta.3
 */
 
 (function(factory) {

+ 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.3-beta.2
+* Version: 4.0.3-beta.3
 */
 
 (function(factory) {

+ 1 - 1
dist/inputmask/dependencyLibs/inputmask.dependencyLib.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.3-beta.2
+* Version: 4.0.3-beta.3
 */
 
 (function(factory) {

+ 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.3-beta.2
+* Version: 4.0.3-beta.3
 */
 
 if (typeof define === "function" && define.amd) define(function() {

+ 1 - 1
dist/inputmask/inputmask.date.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.3-beta.2
+* Version: 4.0.3-beta.3
 */
 
 (function(factory) {

+ 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.3-beta.2
+* Version: 4.0.3-beta.3
 */
 
 (function(factory) {

+ 5 - 3
dist/inputmask/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.3-beta.2
+* Version: 4.0.3-beta.3
 */
 
 (function(factory) {
@@ -95,7 +95,8 @@
             inputmode: "verbatim",
             colorMask: false,
             disablePredictiveText: false,
-            importDataAttributes: true
+            importDataAttributes: true,
+            shiftPositions: true
         },
         definitions: {
             9: {
@@ -1129,6 +1130,7 @@
         function getBuffer(noCache) {
             if (getMaskSet().buffer === undefined || noCache === true) {
                 getMaskSet().buffer = getMaskTemplate(true, getLastValidPosition(), true);
+                if (getMaskSet()._buffer === undefined) getMaskSet()._buffer = getMaskSet().buffer.slice();
             }
             return getMaskSet().buffer;
         }
@@ -1458,7 +1460,7 @@
                                 trackbackPositions(undefined, posMatch, true);
                                 j = posMatch + 1;
                                 valid = true;
-                            } else if (positionCanMatchDefinition(posMatch, t.match.def)) {
+                            } else if (opts.shiftPositions && positionCanMatchDefinition(posMatch, t.match.def)) {
                                 var result = isValid(posMatch, t.input, true, true);
                                 valid = result !== false;
                                 j = result.caret || result.insert ? getLastValidPosition() : posMatch + 1;

+ 1 - 1
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.3-beta.2
+* Version: 4.0.3-beta.3
 */
 
 (function(factory) {

+ 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.3-beta.2
+* Version: 4.0.3-beta.3
 */
 
 (function(factory) {

+ 7 - 4
dist/jquery.inputmask.bundle.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.3-beta.2
+* Version: 4.0.3-beta.3
 */
 
 (function(modules) {
@@ -280,7 +280,8 @@
                 inputmode: "verbatim",
                 colorMask: false,
                 disablePredictiveText: false,
-                importDataAttributes: true
+                importDataAttributes: true,
+                shiftPositions: true
             },
             definitions: {
                 9: {
@@ -1318,6 +1319,7 @@
             function getBuffer(noCache) {
                 if (getMaskSet().buffer === undefined || noCache === true) {
                     getMaskSet().buffer = getMaskTemplate(true, getLastValidPosition(), true);
+                    if (getMaskSet()._buffer === undefined) getMaskSet()._buffer = getMaskSet().buffer.slice();
                 }
                 return getMaskSet().buffer;
             }
@@ -1649,7 +1651,7 @@
                                     trackbackPositions(undefined, posMatch, true);
                                     j = posMatch + 1;
                                     valid = true;
-                                } else if (positionCanMatchDefinition(posMatch, t.match.def)) {
+                                } else if (opts.shiftPositions && positionCanMatchDefinition(posMatch, t.match.def)) {
                                     var result = isValid(posMatch, t.input, true, true);
                                     valid = result !== false;
                                     j = result.caret || result.insert ? getLastValidPosition() : posMatch + 1;
@@ -3208,7 +3210,8 @@
                     if (test.nativeDef.indexOf("[AP]") == 0) return elem.toUpperCase();
                     return elem;
                 },
-                insertMode: false
+                insertMode: false,
+                shiftPositions: false
             }
         });
         return Inputmask;

ファイルの差分が大きいため隠しています
+ 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 - 2018 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 4.0.3-beta.2
+* Version: 4.0.3-beta.3
 */
 
 (function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else if(typeof exports==="object"){module.exports=factory(require("jquery"))}else{window.dependencyLib=factory(jQuery)}})(function($){return $});

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


+ 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.3-beta.2
+* Version: 4.0.3-beta.3
 */
 
 if(typeof define==="function"&&define.amd)define(function(){return window||new(eval("require('jsdom')")("").window)});else if(typeof exports==="object")module.exports=window||new(eval("require('jsdom')")("").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


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


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


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


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

@@ -292,7 +292,8 @@
                     if (test.nativeDef.indexOf("[AP]") == 0) return elem.toUpperCase();
                     return elem;
                 },
-                insertMode: false
+                insertMode: false,
+                shiftPositions: false
             }
         });
 

+ 2 - 1
js/inputmask.js

@@ -1331,6 +1331,7 @@
             function getBuffer(noCache) {
                 if (getMaskSet().buffer === undefined || noCache === true) {
                     getMaskSet().buffer = getMaskTemplate(true, getLastValidPosition(), true);
+                    if (getMaskSet()._buffer === undefined) getMaskSet()._buffer = getMaskSet().buffer.slice();
                 }
                 return getMaskSet().buffer;
             }
@@ -1728,7 +1729,7 @@
                                     trackbackPositions(undefined, posMatch, true);
                                     j = posMatch + 1;
                                     valid = true;
-                                } else if (positionCanMatchDefinition(posMatch, t.match.def)) { //validated match
+                                } else if (opts.shiftPositions && positionCanMatchDefinition(posMatch, t.match.def)) { //validated match
                                     var result = isValid(posMatch, t.input, true, true);
                                     valid = result !== false;
                                     j = (result.caret || result.insert) ? getLastValidPosition() : posMatch + 1;

+ 1 - 1
package.json

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