|
@@ -3,7 +3,7 @@
|
|
|
* https://github.com/RobinHerbots/jquery.inputmask
|
|
* https://github.com/RobinHerbots/jquery.inputmask
|
|
|
* Copyright (c) 2010 - 2016 Robin Herbots
|
|
* Copyright (c) 2010 - 2016 Robin Herbots
|
|
|
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
|
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
|
|
|
-* Version: 3.3.4-54
|
|
|
|
|
|
|
+* Version: 3.3.4-56
|
|
|
*/
|
|
*/
|
|
|
!function($) {
|
|
!function($) {
|
|
|
function Inputmask(alias, options) {
|
|
function Inputmask(alias, options) {
|
|
@@ -1042,7 +1042,7 @@
|
|
|
}
|
|
}
|
|
|
if (caretPos.begin > inputValue.length && (caret(input, inputValue.length), caretPos = caret(input)),
|
|
if (caretPos.begin > inputValue.length && (caret(input, inputValue.length), caretPos = caret(input)),
|
|
|
getBuffer().length - inputValue.length !== 1 || inputValue.charAt(caretPos.begin) === getBuffer()[caretPos.begin] || inputValue.charAt(caretPos.begin + 1) === getBuffer()[caretPos.begin] || isMask(caretPos.begin)) {
|
|
getBuffer().length - inputValue.length !== 1 || inputValue.charAt(caretPos.begin) === getBuffer()[caretPos.begin] || inputValue.charAt(caretPos.begin + 1) === getBuffer()[caretPos.begin] || isMask(caretPos.begin)) {
|
|
|
- for (var lvp = getLastValidPosition() + 1, bufferTemplate = getBuffer().slice(lvp).join(""); null === inputValue.match(Inputmask.escapeRegex(bufferTemplate) + "$"); ) bufferTemplate = bufferTemplate.slice(1);
|
|
|
|
|
|
|
+ for (var lvp = getLastValidPosition() + 1, bufferTemplate = getBufferTemplate().join(""); null === inputValue.match(Inputmask.escapeRegex(bufferTemplate) + "$"); ) bufferTemplate = bufferTemplate.slice(1);
|
|
|
inputValue = inputValue.replace(bufferTemplate, ""), inputValue = inputValue.split(""),
|
|
inputValue = inputValue.replace(bufferTemplate, ""), inputValue = inputValue.split(""),
|
|
|
checkVal(input, !0, !1, inputValue, e, caretPos.begin < lvp), isComplete(getBuffer()) === !0 && $(input).trigger("complete");
|
|
checkVal(input, !0, !1, inputValue, e, caretPos.begin < lvp), isComplete(getBuffer()) === !0 && $(input).trigger("complete");
|
|
|
} else e.keyCode = Inputmask.keyCode.BACKSPACE, keydownEvent.call(input, e);
|
|
} else e.keyCode = Inputmask.keyCode.BACKSPACE, keydownEvent.call(input, e);
|
|
@@ -1056,7 +1056,7 @@
|
|
|
}
|
|
}
|
|
|
function focusEvent(e) {
|
|
function focusEvent(e) {
|
|
|
var input = this, nptValue = input.inputmask._valueGet();
|
|
var input = this, nptValue = input.inputmask._valueGet();
|
|
|
- opts.showMaskOnFocus && (!opts.showMaskOnHover || opts.showMaskOnHover && "" === nptValue) ? input.inputmask._valueGet() !== getBuffer().join("") && writeBuffer(input, getBuffer(), seekNext(getLastValidPosition())) : mouseEnter === !1 && caret(input, seekNext(getLastValidPosition())),
|
|
|
|
|
|
|
+ opts.showMaskOnFocus && (!opts.showMaskOnHover || opts.showMaskOnHover && "" === nptValue) && (input.inputmask._valueGet() !== getBuffer().join("") ? writeBuffer(input, getBuffer(), seekNext(getLastValidPosition())) : mouseEnter === !1 && caret(input, seekNext(getLastValidPosition()))),
|
|
|
opts.positionCaretOnTab === !0 && setTimeout(function() {
|
|
opts.positionCaretOnTab === !0 && setTimeout(function() {
|
|
|
clickEvent.apply(this, [ e ]);
|
|
clickEvent.apply(this, [ e ]);
|
|
|
}, 0), undoValue = getBuffer().join("");
|
|
}, 0), undoValue = getBuffer().join("");
|
|
@@ -1240,7 +1240,7 @@
|
|
|
writeBuffer(el, buffer), document.activeElement === el && caret(el, seekNext(getLastValidPosition()));
|
|
writeBuffer(el, buffer), document.activeElement === el && caret(el, seekNext(getLastValidPosition()));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- var undoValue, el, $el, maxLength, colorMask, valueBuffer, isRTL = !1, skipKeyPressEvent = !1, skipInputEvent = !1, ignorable = !1, mouseEnter = !0, EventRuler = {
|
|
|
|
|
|
|
+ var undoValue, el, $el, maxLength, colorMask, valueBuffer, isRTL = !1, skipKeyPressEvent = !1, skipInputEvent = !1, ignorable = !1, mouseEnter = !1, EventRuler = {
|
|
|
on: function(input, eventName, eventHandler) {
|
|
on: function(input, eventName, eventHandler) {
|
|
|
var ev = function(e) {
|
|
var ev = function(e) {
|
|
|
if (void 0 === this.inputmask && "FORM" !== this.nodeName) {
|
|
if (void 0 === this.inputmask && "FORM" !== this.nodeName) {
|
|
@@ -2594,10 +2594,19 @@
|
|
|
countrycode: "",
|
|
countrycode: "",
|
|
|
phoneCodes: [],
|
|
phoneCodes: [],
|
|
|
mask: function(opts) {
|
|
mask: function(opts) {
|
|
|
|
|
+ function regionize() {
|
|
|
|
|
+ opts.regions = {
|
|
|
|
|
+ base: []
|
|
|
|
|
+ }, $.each(opts.phoneCodes, function(ndx, phoneCode) {
|
|
|
|
|
+ var region = phoneCode.region;
|
|
|
|
|
+ void 0 === region ? opts.regions.base.push(phoneCode) : void 0 === opts.regions[region] ? (opts.regions[region] = [],
|
|
|
|
|
+ opts.regions.base.push(phoneCode), opts.regions[region].push(phoneCode)) : opts.regions[region].push(phoneCode);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
opts.definitions = {
|
|
opts.definitions = {
|
|
|
"#": opts.definitions[9]
|
|
"#": opts.definitions[9]
|
|
|
- };
|
|
|
|
|
- var masks = opts.phoneCodes.sort(function(a, b) {
|
|
|
|
|
|
|
+ }, regionize();
|
|
|
|
|
+ var masks = opts.regions.base.sort(function(a, b) {
|
|
|
var maska = (a.mask || a).replace(/#/g, "9").replace(/[\+\(\)#-]/g, ""), maskb = (b.mask || b).replace(/#/g, "9").replace(/[\+\(\)#-]/g, ""), maskas = (a.mask || a).split("#")[0], maskbs = (b.mask || b).split("#")[0];
|
|
var maska = (a.mask || a).replace(/#/g, "9").replace(/[\+\(\)#-]/g, ""), maskb = (b.mask || b).replace(/#/g, "9").replace(/[\+\(\)#-]/g, ""), maskas = (a.mask || a).split("#")[0], maskbs = (b.mask || b).split("#")[0];
|
|
|
return 0 === maskbs.indexOf(maskas) ? -1 : 0 === maskas.indexOf(maskbs) ? 1 : maska.localeCompare(maskb);
|
|
return 0 === maskbs.indexOf(maskas) ? -1 : 0 === maskas.indexOf(maskbs) ? 1 : maska.localeCompare(maskb);
|
|
|
});
|
|
});
|