|
@@ -774,7 +774,7 @@
|
|
|
var pend = pos.end;
|
|
var pend = pos.end;
|
|
|
pos.end = pos.begin, pos.begin = pend;
|
|
pos.end = pos.begin, pos.begin = pend;
|
|
|
}
|
|
}
|
|
|
- if (k == $.inputmask.keyCode.BACKSPACE && (pos.end - pos.begin < 1 || 0 == opts.insertMode) ? pos.begin = seekPrevious(pos.begin) : k == $.inputmask.keyCode.DELETE && pos.begin == pos.end && pos.end++,
|
|
|
|
|
|
|
+ if (k == $.inputmask.keyCode.BACKSPACE && (pos.end - pos.begin < 1 || 0 == opts.insertMode) ? pos.begin = seekPrevious(pos.begin) : k == $.inputmask.keyCode.DELETE && pos.begin == pos.end && (pos.end = isMask(pos.end) ? pos.end + 1 : seekNext(pos.end) + 1),
|
|
|
stripValidPositions(pos.begin, pos.end, !1, strict), strict !== !0) {
|
|
stripValidPositions(pos.begin, pos.end, !1, strict), strict !== !0) {
|
|
|
generalize();
|
|
generalize();
|
|
|
var lvp = getLastValidPosition(pos.begin);
|
|
var lvp = getLastValidPosition(pos.begin);
|
|
@@ -1896,7 +1896,7 @@
|
|
|
}
|
|
}
|
|
|
if (opts.autoGroup) {
|
|
if (opts.autoGroup) {
|
|
|
var rslt = opts.postFormat(buffer, caretPos - 1, !0, opts);
|
|
var rslt = opts.postFormat(buffer, caretPos - 1, !0, opts);
|
|
|
- return rslt.caret = 0 == caretPos ? caretPos : rslt.pos + 1, rslt;
|
|
|
|
|
|
|
+ return rslt.caret = caretPos <= opts.prefix.length ? rslt.pos : rslt.pos + 1, rslt;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
regex: {
|
|
regex: {
|
|
@@ -2038,7 +2038,7 @@
|
|
|
if (opts.postFormat(bufClone, 0, !0, opts), bufClone.join("") != maskedValue) return !1;
|
|
if (opts.postFormat(bufClone, 0, !0, opts), bufClone.join("") != maskedValue) return !1;
|
|
|
var processValue = maskedValue.replace(opts.prefix, "");
|
|
var processValue = maskedValue.replace(opts.prefix, "");
|
|
|
return processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp($.inputmask.escapeRegex.call(this, opts.groupSeparator), "g"), ""),
|
|
return processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp($.inputmask.escapeRegex.call(this, opts.groupSeparator), "g"), ""),
|
|
|
- processValue = processValue.replace($.inputmask.escapeRegex.call(this, opts.radixPoint), "."),
|
|
|
|
|
|
|
+ "," === opts.radixPoint && (processValue = processValue.replace($.inputmask.escapeRegex.call(this, opts.radixPoint), ".")),
|
|
|
isFinite(processValue);
|
|
isFinite(processValue);
|
|
|
},
|
|
},
|
|
|
onBeforeMask: function(initialValue, opts) {
|
|
onBeforeMask: function(initialValue, opts) {
|
|
@@ -2052,7 +2052,7 @@
|
|
|
initialValue;
|
|
initialValue;
|
|
|
},
|
|
},
|
|
|
canClearPosition: function(maskset, position, lvp, strict, opts) {
|
|
canClearPosition: function(maskset, position, lvp, strict, opts) {
|
|
|
- var positionInput = maskset.validPositions[position].input, canClear = positionInput != opts.radixPoint && isFinite(positionInput) || position == lvp || positionInput == opts.groupSeparator;
|
|
|
|
|
|
|
+ var positionInput = maskset.validPositions[position].input, canClear = positionInput != opts.radixPoint && isFinite(positionInput) || position == lvp || positionInput == opts.groupSeparator || positionInput == opts.negationSymbol.front || positionInput == opts.negationSymbol.back;
|
|
|
if (canClear && isFinite(positionInput)) {
|
|
if (canClear && isFinite(positionInput)) {
|
|
|
var matchRslt = maskset.buffer.join("").substr(0, position).match(opts.regex.integerNPart(opts));
|
|
var matchRslt = maskset.buffer.join("").substr(0, position).match(opts.regex.integerNPart(opts));
|
|
|
if (!strict) {
|
|
if (!strict) {
|
|
@@ -2062,8 +2062,9 @@
|
|
|
}
|
|
}
|
|
|
var buffer = [];
|
|
var buffer = [];
|
|
|
for (var vp in maskset.validPositions) buffer.push(maskset.validPositions[vp].input);
|
|
for (var vp in maskset.validPositions) buffer.push(maskset.validPositions[vp].input);
|
|
|
- if (matchRslt = buffer.join("").match(opts.regex.integerNPart(opts)), radixPosition = $.inArray(opts.radixPoint, maskset.buffer),
|
|
|
|
|
- matchRslt && (-1 == radixPosition || position <= radixPosition)) if (0 == matchRslt[0].indexOf("0")) canClear = matchRslt.index != position || -1 == radixPosition; else {
|
|
|
|
|
|
|
+ matchRslt = buffer.join("").match(opts.regex.integerNPart(opts));
|
|
|
|
|
+ var radixPosition = $.inArray(opts.radixPoint, maskset.buffer);
|
|
|
|
|
+ if (matchRslt && (-1 == radixPosition || radixPosition >= position)) if (0 == matchRslt[0].indexOf("0")) canClear = matchRslt.index != position || -1 == radixPosition; else {
|
|
|
var intPart = parseInt(matchRslt[0].replace(new RegExp($.inputmask.escapeRegex.call(this, opts.groupSeparator), "g"), ""));
|
|
var intPart = parseInt(matchRslt[0].replace(new RegExp($.inputmask.escapeRegex.call(this, opts.groupSeparator), "g"), ""));
|
|
|
-1 != radixPosition && 10 > intPart && "0" == opts.placeholder.charAt(0) && (maskset.validPositions[position].input = "0",
|
|
-1 != radixPosition && 10 > intPart && "0" == opts.placeholder.charAt(0) && (maskset.validPositions[position].input = "0",
|
|
|
maskset.p = opts.prefix.length + 1, canClear = !1);
|
|
maskset.p = opts.prefix.length + 1, canClear = !1);
|