Browse Source

Different behaviour configuration by attribute vs initialization #2530

Robin Herbots 4 years ago
parent
commit
3104f03c5f

+ 1 - 0
CHANGELOG.md

@@ -16,6 +16,7 @@
 - clear masktemplate before submitting regardsless of the clearMaskOnLostFocus option
 
 ### Fixed
+- Different behaviour configuration by attribute vs initialization #2530
 - The requested module './inputmask.js' does not provide an export named 'default' #2560
 - Issue with leapday #2546
 - Not removing the decimal separator in suffixed inputs #2511

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "inputmask",
-  "version": "5.0.7-beta.30",
+  "version": "5.0.7-beta.32",
   "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": "5.0.7-beta.30",
+  "version": "5.0.7-beta.32",
   "type": "library",
   "keywords": ["jquery", "plugins", "input", "form", "inputmask", "mask"],
   "homepage": "http://robinherbots.github.io/Inputmask",

+ 5 - 5
dist/inputmask.js

@@ -3,7 +3,7 @@
  * https://github.com/RobinHerbots/Inputmask
  * Copyright (c) 2010 - 2021 Robin Herbots
  * Licensed under the MIT license
- * Version: 5.0.7-beta.30
+ * Version: 5.0.7-beta.32
  */
 !function(e, t) {
     if ("object" == typeof exports && "object" == typeof module) module.exports = t(); else if ("function" == typeof define && define.amd) define([], t); else {
@@ -881,8 +881,8 @@
                         },
                         placeholder: "",
                         inputFormat: "isoDateTime",
-                        displayFormat: void 0,
-                        outputFormat: void 0,
+                        displayFormat: null,
+                        outputFormat: null,
                         min: null,
                         max: null,
                         skipOptionalPartCharacter: "",
@@ -1051,11 +1051,11 @@
                     email: {
                         mask: function(e) {
                             var t = "*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]";
-                            return void 0 !== e.separator ? "".concat(t, "[").concat(e.separator).concat(t, "]") : t;
+                            return e.separator ? "".concat(t, "[").concat(e.separator).concat(t, "]") : t;
                         },
                         greedy: !1,
                         casing: "lower",
-                        separator: void 0,
+                        separator: null,
                         skipOptionalPartCharacter: "",
                         onBeforePaste: function(e, t) {
                             return (e = e.toLowerCase()).replace("mailto:", "");

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


+ 5 - 5
dist/jquery.inputmask.js

@@ -3,7 +3,7 @@
  * https://github.com/RobinHerbots/Inputmask
  * Copyright (c) 2010 - 2021 Robin Herbots
  * Licensed under the MIT license
- * Version: 5.0.7-beta.30
+ * Version: 5.0.7-beta.32
  */
 !function(e, t) {
     if ("object" == typeof exports && "object" == typeof module) module.exports = t(require("jquery")); else if ("function" == typeof define && define.amd) define([ "jquery" ], t); else {
@@ -755,8 +755,8 @@
                         },
                         placeholder: "",
                         inputFormat: "isoDateTime",
-                        displayFormat: void 0,
-                        outputFormat: void 0,
+                        displayFormat: null,
+                        outputFormat: null,
                         min: null,
                         max: null,
                         skipOptionalPartCharacter: "",
@@ -925,11 +925,11 @@
                     email: {
                         mask: function(e) {
                             var t = "*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]";
-                            return void 0 !== e.separator ? "".concat(t, "[").concat(e.separator).concat(t, "]") : t;
+                            return e.separator ? "".concat(t, "[").concat(e.separator).concat(t, "]") : t;
                         },
                         greedy: !1,
                         casing: "lower",
-                        separator: void 0,
+                        separator: null,
                         skipOptionalPartCharacter: "",
                         onBeforePaste: function(e, t) {
                             return (e = e.toLowerCase()).replace("mailto:", "");

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


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

@@ -430,8 +430,8 @@ Inputmask.extendAliases({
 		},
 		placeholder: "", //set default as none (~ auto); when a custom placeholder is passed it will be used
 		inputFormat: "isoDateTime", //format used to input the date
-		displayFormat: undefined, //visual format when the input looses focus
-		outputFormat: undefined, //unmasking format
+		displayFormat: null, //visual format when the input looses focus
+		outputFormat: null, //unmasking format
 		min: null, //needs to be in the same format as the inputfornat
 		max: null, //needs to be in the same format as the inputfornat,
 		skipOptionalPartCharacter: "",

+ 3 - 3
lib/extensions/inputmask.extensions.js

@@ -73,12 +73,12 @@ Inputmask.extendAliases({
 		//should be extended with the toplevel domains at the end
 		mask: function (opts) {
 			var emailMask = "*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]";
-			return opts.separator !== undefined ? `${emailMask}[${opts.separator}${emailMask}]` : emailMask;
-			return opts.separator !== undefined ? `${emailMask}(${opts.separator}${emailMask}){*}` : emailMask;
+			return opts.separator ? `${emailMask}[${opts.separator}${emailMask}]` : emailMask;
+			return opts.separator ? `${emailMask}(${opts.separator}${emailMask}){*}` : emailMask;
 		},
 		greedy: false,
 		casing: "lower",
-		separator: undefined,
+		separator: null,
 		skipOptionalPartCharacter: "",
 		onBeforePaste: function (pastedValue, opts) {
 			pastedValue = pastedValue.toLowerCase();

+ 1 - 1
package.json

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