|
|
@@ -3,13 +3,13 @@
|
|
|
* 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
|
|
|
+* Version: 4.0.1-beta.0
|
|
|
*/
|
|
|
|
|
|
!function(factory) {
|
|
|
"function" == typeof define && define.amd ? define([ "./dependencyLibs/inputmask.dependencyLib", "./global/window", "./global/document" ], factory) : "object" == typeof exports ? module.exports = factory(require("./dependencyLibs/inputmask.dependencyLib"), require("./global/window"), require("./global/document")) : window.Inputmask = factory(window.dependencyLib || jQuery, window, document);
|
|
|
}(function($, window, document, undefined) {
|
|
|
- var ua = navigator.userAgent, mobile = isInputEventSupported("touchstart"), iemobile = /iemobile/i.test(ua), iphone = /iphone/i.test(ua) && !iemobile;
|
|
|
+ var ua = navigator.userAgent, mobile = isInputEventSupported("touchstart"), iemobile = /iemobile/i.test(ua), iphone = !0;
|
|
|
function Inputmask(alias, options, internal) {
|
|
|
if (!(this instanceof Inputmask)) return new Inputmask(alias, options, internal);
|
|
|
this.el = undefined, this.events = {}, this.maskset = undefined, this.refreshValue = !1,
|
|
|
@@ -73,7 +73,7 @@
|
|
|
el = null, isSupported;
|
|
|
}
|
|
|
function maskScope(actionObj, maskset, opts) {
|
|
|
- maskset = maskset || this.maskset, opts = opts || this.opts;
|
|
|
+ maskset = maskset || this.maskset, (opts = opts || this.opts).insertMode = iphone || opts.insertMode;
|
|
|
var undoValue, $el, maxLength, colorMask, inputmask = this, el = this.el, isRTL = this.isRTL, skipKeyPressEvent = !1, skipInputEvent = !1, ignorable = !1, mouseEnter = !1;
|
|
|
function getMaskTemplate(baseOnInput, minimalPos, includeMode, noJit, clearOptionalTail) {
|
|
|
!0 !== noJit && (undefined, 0);
|
|
|
@@ -658,7 +658,7 @@
|
|
|
}, 0) : k === Inputmask.keyCode.LEFT && setTimeout(function() {
|
|
|
var caretPos = caret(input);
|
|
|
caret(input, isRTL ? caretPos.begin + 1 : caretPos.begin - 1);
|
|
|
- }, 0)) : (opts.insertMode = !opts.insertMode, caret(input, opts.insertMode || pos.begin !== getMaskSet().maskLength ? pos.begin : pos.begin - 1));
|
|
|
+ }, 0)) : (opts.insertMode = iphone || !opts.insertMode, caret(input, opts.insertMode || pos.begin !== getMaskSet().maskLength ? pos.begin : pos.begin - 1));
|
|
|
opts.onKeyDown.call(this, e, getBuffer(), caret(input).begin, opts), ignorable = -1 !== $.inArray(k, opts.ignorables);
|
|
|
},
|
|
|
keypressEvent: function(e, checkval, writeOut, strict, ndx) {
|
|
|
@@ -745,7 +745,7 @@
|
|
|
selection.begin === selection.end - 1 ? caret(input, selection.begin) : caret(input, selection.begin, selection.end));
|
|
|
var keydown = new $.Event("keydown");
|
|
|
keydown.keyCode = opts.numericInput ? Inputmask.keyCode.BACKSPACE : Inputmask.keyCode.DELETE,
|
|
|
- EventHandlers.keydownEvent.call(input, keydown), iphone || !1 !== opts.insertMode || caret(input, caret(input).begin - 1);
|
|
|
+ EventHandlers.keydownEvent.call(input, keydown), !1 === opts.insertMode && caret(input, caret(input).begin - 1);
|
|
|
}
|
|
|
e.preventDefault();
|
|
|
}
|
|
|
@@ -939,7 +939,7 @@
|
|
|
"number" == typeof begin) {
|
|
|
begin = notranslate ? begin : translatePosition(begin), end = "number" == typeof (end = notranslate ? end : translatePosition(end)) ? end : begin;
|
|
|
var scrollCalc = parseInt(((input.ownerDocument.defaultView || window).getComputedStyle ? (input.ownerDocument.defaultView || window).getComputedStyle(input, null) : input.currentStyle).fontSize) * end;
|
|
|
- if (input.scrollLeft = scrollCalc > input.scrollWidth ? scrollCalc : 0, iphone || !1 !== opts.insertMode || begin !== end || end++,
|
|
|
+ if (input.scrollLeft = scrollCalc > input.scrollWidth ? scrollCalc : 0, !1 === opts.insertMode && begin === end && end++,
|
|
|
input.inputmask.caretPos = {
|
|
|
begin: begin,
|
|
|
end: end
|