|
|
@@ -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.21
|
|
|
+* Version: 4.0.0-beta.22
|
|
|
*/
|
|
|
|
|
|
!function(modules) {
|
|
|
@@ -795,7 +795,7 @@
|
|
|
},
|
|
|
setValueEvent: function(e) {
|
|
|
this.inputmask.refreshValue = !1;
|
|
|
- var value = e.detail || arguments[1] || this.inputmask._valueGet(!0);
|
|
|
+ var value = e.detail[0] || arguments[1] || this.inputmask._valueGet(!0);
|
|
|
$.isFunction(opts.onBeforeMask) && (value = opts.onBeforeMask.call(inputmask, value, opts) || value),
|
|
|
value = value.split(""), checkVal(this, !0, !1, isRTL ? value.reverse() : value),
|
|
|
undoValue = getBuffer().join(""), (opts.clearMaskOnLostFocus || opts.clearIncomplete) && this.inputmask._valueGet() === getBufferTemplate().join("") && this.inputmask._valueSet("");
|
|
|
@@ -2145,7 +2145,8 @@
|
|
|
isFinite(processValue);
|
|
|
},
|
|
|
onBeforeMask: function(initialValue, opts) {
|
|
|
- if (opts.isNegative = undefined, initialValue = initialValue.toString().charAt(initialValue.length - 1) === opts.radixPoint ? initialValue.toString().substr(0, initialValue.length - 1) : initialValue.toString(),
|
|
|
+ if (opts.isNegative = undefined, "number" == typeof initialValue && "" !== opts.radixPoint && (initialValue = initialValue.toString().replace(".", opts.radixPoint)),
|
|
|
+ initialValue = initialValue.toString().charAt(initialValue.length - 1) === opts.radixPoint ? initialValue.toString().substr(0, initialValue.length - 1) : initialValue.toString(),
|
|
|
"" !== opts.radixPoint && isFinite(initialValue)) {
|
|
|
var vs = initialValue.split("."), groupSize = "" !== opts.groupSeparator ? parseInt(opts.groupSize) : 0;
|
|
|
2 === vs.length && (vs[0].length > groupSize || vs[1].length > groupSize || vs[0].length <= groupSize && vs[1].length < groupSize) && (initialValue = initialValue.replace(".", opts.radixPoint));
|