|
|
@@ -3,7 +3,7 @@
|
|
|
* https://github.com/RobinHerbots/Inputmask
|
|
|
* Copyright (c) 2010 - 2019 Robin Herbots
|
|
|
* Licensed under the MIT license
|
|
|
- * Version: 5.0.1-beta.8
|
|
|
+ * Version: 5.0.1-beta.9
|
|
|
*/
|
|
|
!function webpackUniversalModuleDefinition(root, factory) {
|
|
|
if ("object" == typeof exports && "object" == typeof module) module.exports = factory(require("jquery")); else if ("function" == typeof define && define.amd) define([ "jquery" ], factory); else {
|
|
|
@@ -629,7 +629,7 @@
|
|
|
test = testPos.match, ndxIntlzr = testPos.locator.slice(), maskTemplate.push(!0 === includeMode ? testPos.input : !1 === includeMode ? test.nativeDef : getPlaceholder(pos, test)); else {
|
|
|
testPos = getTestTemplate(pos, ndxIntlzr, pos - 1), test = testPos.match, ndxIntlzr = testPos.locator.slice();
|
|
|
var jitMasking = !0 !== noJit && (!1 !== opts.jitMasking ? opts.jitMasking : test.jit);
|
|
|
- jitRenderStatic = jitRenderStatic && test.static && test.def !== opts.groupSeparator || maskset.validPositions[pos - 1] && test.static && test.def !== opts.groupSeparator,
|
|
|
+ jitRenderStatic = jitRenderStatic && test.static && test.def !== opts.groupSeparator && null === test.fn || maskset.validPositions[pos - 1] && test.static && test.def !== opts.groupSeparator && null === test.fn,
|
|
|
jitRenderStatic || !1 === jitMasking || void 0 === jitMasking || "number" == typeof jitMasking && isFinite(jitMasking) && pos < jitMasking ? maskTemplate.push(!1 === includeMode ? test.nativeDef : getPlaceholder(pos, test)) : jitRenderStatic = !1;
|
|
|
}
|
|
|
pos++;
|
|
|
@@ -2319,18 +2319,17 @@
|
|
|
},
|
|
|
onBeforeMask: function onBeforeMask(initialValue, opts) {
|
|
|
var radixPoint = opts.radixPoint || ",";
|
|
|
- "number" != typeof initialValue && "number" !== opts.inputType || "" === radixPoint || (initialValue = initialValue.toString().replace(".", radixPoint));
|
|
|
+ isFinite(opts.digits) && (opts.digits = parseInt(opts.digits)), "number" != typeof initialValue && "number" !== opts.inputType || "" === radixPoint || (initialValue = initialValue.toString().replace(".", radixPoint));
|
|
|
var valueParts = initialValue.split(radixPoint), integerPart = valueParts[0].replace(/[^\-0-9]/g, ""), decimalPart = 1 < valueParts.length ? valueParts[1].replace(/[^0-9]/g, "") : "", forceDigits = 1 < valueParts.length;
|
|
|
initialValue = integerPart + ("" !== decimalPart ? radixPoint + decimalPart : decimalPart);
|
|
|
var digits = 0;
|
|
|
- if ("" !== radixPoint && (digits = decimalPart.length, "" !== decimalPart || !opts.digitsOptional)) {
|
|
|
+ if ("" !== radixPoint && (digits = opts.digitsOptional ? opts.digits < decimalPart.length ? opts.digits : decimalPart.length : opts.digits,
|
|
|
+ "" !== decimalPart || !opts.digitsOptional)) {
|
|
|
var digitsFactor = Math.pow(10, digits || 1);
|
|
|
- !opts.digitsOptional && isFinite(opts.digits) && (digits = parseInt(opts.digits),
|
|
|
- digitsFactor = Math.pow(10, digits)), initialValue = initialValue.replace(Inputmask.escapeRegex(radixPoint), "."),
|
|
|
- isFinite(initialValue) && (initialValue = (opts.roundingFN(parseFloat(initialValue) * digitsFactor) / digitsFactor).toFixed(digits)),
|
|
|
+ initialValue = initialValue.replace(Inputmask.escapeRegex(radixPoint), "."), isFinite(initialValue) && (initialValue = (opts.roundingFN(parseFloat(initialValue) * digitsFactor) / digitsFactor).toFixed(digits)),
|
|
|
initialValue = initialValue.toString().replace(".", radixPoint);
|
|
|
}
|
|
|
- if (0 === opts.digits && -1 !== initialValue.indexOf(Inputmask.escapeRegex(radixPoint)) && (initialValue = initialValue.substring(0, initialValue.indexOf(Inputmask.escapeRegex(radixPoint)))),
|
|
|
+ if (0 === opts.digits && -1 !== initialValue.indexOf(radixPoint) && (initialValue = initialValue.substring(0, initialValue.indexOf(radixPoint))),
|
|
|
null !== opts.min || null !== opts.max) {
|
|
|
var numberValue = initialValue.toString().replace(radixPoint, ".");
|
|
|
null !== opts.min && numberValue < opts.min ? initialValue = opts.min.toString().replace(".", radixPoint) : null !== opts.max && numberValue > opts.max && (initialValue = opts.max.toString().replace(".", radixPoint));
|