Browse Source

Can't remove placeholder from datetime alias #2438

Robin Herbots 5 years ago
parent
commit
3405830069
9 changed files with 16 additions and 15 deletions
  1. 1 0
      CHANGELOG.md
  2. 1 1
      bower.json
  3. 1 1
      composer.json
  4. 2 2
      dist/inputmask.js
  5. 2 2
      dist/inputmask.min.js
  6. 2 2
      dist/jquery.inputmask.js
  7. 2 2
      dist/jquery.inputmask.min.js
  8. 4 4
      lib/validation-tests.js
  9. 1 1
      package.json

+ 1 - 0
CHANGELOG.md

@@ -5,6 +5,7 @@
 - enhance alternation logic
  
 ### Fixed
+- Can't remove "placeholder" from datetime alias #2438
 - showMaskOnFocus: false causes 'Illegal invocation' error #2436
 - Input Mask for search fields (partially filled mask) #2425
 - HandleNativePlaceholder function prevents use of dynamic placeholders. #2433

+ 1 - 1
bower.json

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

+ 2 - 2
dist/inputmask.js

@@ -3,7 +3,7 @@
  * https://github.com/RobinHerbots/Inputmask
  * Copyright (c) 2010 - 2020 Robin Herbots
  * Licensed under the MIT license
- * Version: 5.0.6-beta.24
+ * Version: 5.0.6-beta.25
  */
 !function webpackUniversalModuleDefinition(root, factory) {
     if ("object" == typeof exports && "object" == typeof module) module.exports = factory(); else if ("function" == typeof define && define.amd) define([], factory); else {
@@ -398,7 +398,7 @@
                     testPos = getTestTemplate.call(this, pos, ndxIntlzr, pos - 1), test = testPos.match, 
                     ndxIntlzr = testPos.locator.slice();
                     var jitMasking = !0 !== noJit && (!1 !== opts.jitMasking ? opts.jitMasking : test.jit);
-                    jitRenderStatic = jitRenderStatic && test.static && test.def !== opts.groupSeparator && null === test.fn || maskset.validPositions[pos - 1] && test.static && test.def !== opts.groupSeparator && null === test.fn, 
+                    jitRenderStatic = (jitRenderStatic && test.static && test.def !== opts.groupSeparator && null === test.fn || maskset.validPositions[pos - 1] && test.static && test.def !== opts.groupSeparator && null === test.fn) && maskset.tests[pos] && 1 === maskset.tests[pos].length, 
                     jitRenderStatic || !1 === jitMasking || void 0 === jitMasking || "number" == typeof jitMasking && isFinite(jitMasking) && pos < jitMasking ? maskTemplate.push(!1 === includeMode ? test.nativeDef : getPlaceholder.call(this, pos, test)) : jitRenderStatic = !1;
                 }
                 pos++;

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


+ 2 - 2
dist/jquery.inputmask.js

@@ -3,7 +3,7 @@
  * https://github.com/RobinHerbots/Inputmask
  * Copyright (c) 2010 - 2020 Robin Herbots
  * Licensed under the MIT license
- * Version: 5.0.6-beta.24
+ * Version: 5.0.6-beta.25
  */
 !function webpackUniversalModuleDefinition(root, factory) {
     if ("object" == typeof exports && "object" == typeof module) module.exports = factory(require("jquery")); else if ("function" == typeof define && define.amd) define([ "jquery" ], factory); else {
@@ -398,7 +398,7 @@
                     testPos = getTestTemplate.call(this, pos, ndxIntlzr, pos - 1), test = testPos.match, 
                     ndxIntlzr = testPos.locator.slice();
                     var jitMasking = !0 !== noJit && (!1 !== opts.jitMasking ? opts.jitMasking : test.jit);
-                    jitRenderStatic = jitRenderStatic && test.static && test.def !== opts.groupSeparator && null === test.fn || maskset.validPositions[pos - 1] && test.static && test.def !== opts.groupSeparator && null === test.fn, 
+                    jitRenderStatic = (jitRenderStatic && test.static && test.def !== opts.groupSeparator && null === test.fn || maskset.validPositions[pos - 1] && test.static && test.def !== opts.groupSeparator && null === test.fn) && maskset.tests[pos] && 1 === maskset.tests[pos].length, 
                     jitRenderStatic || !1 === jitMasking || void 0 === jitMasking || "number" == typeof jitMasking && isFinite(jitMasking) && pos < jitMasking ? maskTemplate.push(!1 === includeMode ? test.nativeDef : getPlaceholder.call(this, pos, test)) : jitRenderStatic = !1;
                 }
                 pos++;

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


+ 4 - 4
lib/validation-tests.js

@@ -80,7 +80,7 @@ function getMaskTemplate(baseOnInput, minimalPos, includeMode, noJit, clearOptio
 			ndxIntlzr = testPos.locator.slice();
 			var jitMasking = noJit === true ? false : (opts.jitMasking !== false ? opts.jitMasking : test.jit);
 			//check for groupSeparator is a hack for the numerics as we don't want the render of the groupSeparator beforehand
-			jitRenderStatic = (jitRenderStatic && test.static && test.def !== opts.groupSeparator && test.fn === null) || (maskset.validPositions[pos - 1] && test.static && test.def !== opts.groupSeparator && test.fn === null);
+			jitRenderStatic = ((jitRenderStatic && test.static && test.def !== opts.groupSeparator && test.fn === null) || (maskset.validPositions[pos - 1] && test.static && test.def !== opts.groupSeparator && test.fn === null)) && maskset.tests[pos] && maskset.tests[pos].length === 1;
 			if (jitRenderStatic || jitMasking === false || jitMasking === undefined /*|| pos < lvp*/ || (typeof jitMasking === "number" && isFinite(jitMasking) && jitMasking > pos)) {
 				maskTemplate.push(includeMode === false ? test.nativeDef : getPlaceholder.call(inputmask, pos, test));
 			} else {
@@ -318,7 +318,7 @@ function getTests(pos, ndxIntlzr, tstPs) {
 						maltMatches,
 						currentMatches = matches.slice(),
 						loopNdxCnt = loopNdx.length,
-					    unMatchedAlternation = false;
+						unMatchedAlternation = false;
 					var altIndex = ndxInitializer.length > 0 ? ndxInitializer.shift() : -1;
 					if (altIndex === -1 || typeof altIndex === "string") {
 						var currentPos = testPos,
@@ -356,10 +356,10 @@ function getTests(pos, ndxIntlzr, tstPs) {
 							if (tokenMatch && handleMatch(tokenMatch, [amndx].concat(loopNdx), quantifierRecurse)) {
 								match = true;
 							} else {
-								if(ndx === 0) {
+								if (ndx === 0) {
 									unMatchedAlternation = true;
 								}
-								if (tokenMatch && tokenMatch.matches && tokenMatch.matches.length >  alternateToken.matches[0].matches.length) {
+								if (tokenMatch && tokenMatch.matches && tokenMatch.matches.length > alternateToken.matches[0].matches.length) {
 									break;
 								}
 							}

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "inputmask",
-  "version": "5.0.6-beta.24",
+  "version": "5.0.6-beta.25",
   "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": [