|
|
@@ -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.0-beta.39
|
|
|
+* Version: 4.0.0-beta.42
|
|
|
*/
|
|
|
|
|
|
!function(factory) {
|
|
|
@@ -333,13 +333,13 @@
|
|
|
decisionPos = parseInt(lastAlt), getMaskSet().excludes[decisionPos] = getMaskSet().excludes[decisionPos] || [],
|
|
|
!0 !== pos && getMaskSet().excludes[decisionPos].push(getDecisionTaker(prevAltPos));
|
|
|
var validInputsClone = [], staticInputsBeforePos = 0;
|
|
|
- for (i = decisionPos; i < getLastValidPosition(undefined, !0) + 1; i++) (validPos = getMaskSet().validPositions[i]) && !0 !== validPos.generatedInput && /[0-9a-bA-Z]/.test(validPos.input) ? validInputsClone.push(validPos.input) : i < pos && staticInputsBeforePos++,
|
|
|
+ for (i = decisionPos; i < getLastValidPosition(undefined, !0) + 1; i++) (validPos = getMaskSet().validPositions[i]) && !0 !== validPos.generatedInput ? validInputsClone.push(validPos.input) : i < pos && staticInputsBeforePos++,
|
|
|
delete getMaskSet().validPositions[i];
|
|
|
for (;getMaskSet().excludes[decisionPos] && getMaskSet().excludes[decisionPos].length < 10; ) {
|
|
|
var posOffset = -1 * staticInputsBeforePos, validInputs = validInputsClone.slice();
|
|
|
for (getMaskSet().tests[decisionPos] = undefined, resetMaskSet(!0), isValidRslt = !0; validInputs.length > 0; ) {
|
|
|
var input = validInputs.shift();
|
|
|
- if (input !== opts.skipOptionalPartCharacter && !(isValidRslt = isValid(getLastValidPosition(undefined, !0) + 1, input, !1, fromSetValid, !0))) break;
|
|
|
+ if (!(isValidRslt = isValid(getLastValidPosition(undefined, !0) + 1, input, !1, fromSetValid, !0))) break;
|
|
|
}
|
|
|
if (isValidRslt && c !== undefined) {
|
|
|
var targetLvp = getLastValidPosition(pos) + 1;
|
|
|
@@ -971,7 +971,10 @@
|
|
|
getMaskSet().validPositions[pos.begin] !== undefined && getMaskSet().validPositions[pos.begin].input === opts.groupSeparator && pos.end++),
|
|
|
revalidateMask(pos), !0 !== strict && !1 !== opts.keepStatic || null !== opts.regex) {
|
|
|
var result = alternate(!0);
|
|
|
- result && (pos.begin = result.caret !== undefined ? result.caret : result.pos ? seekNext(result.pos.begin ? result.pos.begin : result.pos) : getLastValidPosition(-1, !0));
|
|
|
+ if (result) {
|
|
|
+ var newPos = result.caret !== undefined ? result.caret : result.pos ? seekNext(result.pos.begin ? result.pos.begin : result.pos) : getLastValidPosition(-1, !0);
|
|
|
+ (k !== Inputmask.keyCode.DELETE || pos.begin > newPos) && pos.begin;
|
|
|
+ }
|
|
|
}
|
|
|
var lvp = getLastValidPosition(pos.begin, !0);
|
|
|
if (lvp < pos.begin || -1 === pos.begin) getMaskSet().p = seekNext(lvp); else if (!0 !== strict && (getMaskSet().p = pos.begin,
|
|
|
@@ -1161,7 +1164,8 @@
|
|
|
var buffer = getBuffer().slice();
|
|
|
undoValue = buffer.join(""), !1 === isComplete(buffer) && opts.clearIncomplete && resetMaskSet(),
|
|
|
opts.clearMaskOnLostFocus && document.activeElement !== el && (-1 === getLastValidPosition() ? buffer = [] : clearOptionalTail(buffer)),
|
|
|
- writeBuffer(el, buffer), document.activeElement === el && caret(el, seekNext(getLastValidPosition()));
|
|
|
+ (!1 === opts.clearMaskOnLostFocus || opts.showMaskOnFocus && document.activeElement === el || "" !== el.inputmask._valueGet(!0)) && writeBuffer(el, buffer),
|
|
|
+ document.activeElement === el && caret(el, seekNext(getLastValidPosition()));
|
|
|
}
|
|
|
}(el);
|
|
|
break;
|