123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400 |
- /*!
- * inputmask.numeric.extensions.js
- * https://github.com/RobinHerbots/jquery.inputmask
- * Copyright (c) 2010 - 2016 Robin Herbots
- * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
- * Version: 3.3.4
- */
- !function(factory) {
- "function" == typeof define && define.amd ? define([ "inputmask.dependencyLib", "inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("./inputmask.dependencyLib"), require("./inputmask")) : factory(window.dependencyLib || jQuery, window.Inputmask);
- }(function($, Inputmask) {
- return Inputmask.extendAliases({
- numeric: {
- mask: function(opts) {
- function autoEscape(txt) {
- for (var escapedTxt = "", i = 0; i < txt.length; i++) escapedTxt += opts.definitions[txt.charAt(i)] || opts.optionalmarker.start === txt.charAt(i) || opts.optionalmarker.end === txt.charAt(i) || opts.quantifiermarker.start === txt.charAt(i) || opts.quantifiermarker.end === txt.charAt(i) || opts.groupmarker.start === txt.charAt(i) || opts.groupmarker.end === txt.charAt(i) || opts.alternatormarker === txt.charAt(i) ? "\\" + txt.charAt(i) : txt.charAt(i);
- return escapedTxt;
- }
- if (0 !== opts.repeat && isNaN(opts.integerDigits) && (opts.integerDigits = opts.repeat),
- opts.repeat = 0, opts.groupSeparator === opts.radixPoint && ("." === opts.radixPoint ? opts.groupSeparator = "," : "," === opts.radixPoint ? opts.groupSeparator = "." : opts.groupSeparator = ""),
- " " === opts.groupSeparator && (opts.skipOptionalPartCharacter = void 0), opts.autoGroup = opts.autoGroup && "" !== opts.groupSeparator,
- opts.autoGroup && ("string" == typeof opts.groupSize && isFinite(opts.groupSize) && (opts.groupSize = parseInt(opts.groupSize)),
- isFinite(opts.integerDigits))) {
- var seps = Math.floor(opts.integerDigits / opts.groupSize), mod = opts.integerDigits % opts.groupSize;
- opts.integerDigits = parseInt(opts.integerDigits) + (0 === mod ? seps - 1 : seps),
- opts.integerDigits < 1 && (opts.integerDigits = "*");
- }
- opts.placeholder.length > 1 && (opts.placeholder = opts.placeholder.charAt(0)),
- "radixFocus" === opts.positionCaretOnClick && "" === opts.placeholder && opts.integerOptional === !1 && (opts.positionCaretOnClick = "lvp"),
- opts.definitions[";"] = opts.definitions["~"], opts.definitions[";"].definitionSymbol = "~",
- opts.numericInput === !0 && (opts.positionCaretOnClick = "radixFocus" === opts.positionCaretOnClick ? "lvp" : opts.positionCaretOnClick,
- opts.digitsOptional = !1, isNaN(opts.digits) && (opts.digits = 2), opts.decimalProtect = !1);
- var mask = "[+]";
- if (mask += autoEscape(opts.prefix), mask += opts.integerOptional === !0 ? "~{1," + opts.integerDigits + "}" : "~{" + opts.integerDigits + "}",
- void 0 !== opts.digits) {
- opts.decimalProtect && (opts.radixPointDefinitionSymbol = ":");
- var dq = opts.digits.toString().split(",");
- isFinite(dq[0] && dq[1] && isFinite(dq[1])) ? mask += (opts.decimalProtect ? ":" : opts.radixPoint) + ";{" + opts.digits + "}" : (isNaN(opts.digits) || parseInt(opts.digits) > 0) && (mask += opts.digitsOptional ? "[" + (opts.decimalProtect ? ":" : opts.radixPoint) + ";{1," + opts.digits + "}]" : (opts.decimalProtect ? ":" : opts.radixPoint) + ";{" + opts.digits + "}");
- }
- return mask += autoEscape(opts.suffix), mask += "[-]", opts.greedy = !1, null !== opts.min && (opts.min = opts.min.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
- "," === opts.radixPoint && (opts.min = opts.min.replace(opts.radixPoint, "."))),
- null !== opts.max && (opts.max = opts.max.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
- "," === opts.radixPoint && (opts.max = opts.max.replace(opts.radixPoint, "."))),
- mask;
- },
- placeholder: "",
- greedy: !1,
- digits: "*",
- digitsOptional: !0,
- radixPoint: ".",
- positionCaretOnClick: "radixFocus",
- groupSize: 3,
- groupSeparator: "",
- autoGroup: !1,
- allowPlus: !0,
- allowMinus: !0,
- negationSymbol: {
- front: "-",
- back: ""
- },
- integerDigits: "+",
- integerOptional: !0,
- prefix: "",
- suffix: "",
- rightAlign: !0,
- decimalProtect: !0,
- min: null,
- max: null,
- step: 1,
- insertMode: !0,
- autoUnmask: !1,
- unmaskAsNumber: !1,
- inputmode: "numeric",
- postFormat: function(buffer, pos, opts) {
- opts.numericInput === !0 && (buffer = buffer.reverse(), isFinite(pos) && (pos = buffer.join("").length - pos - 1));
- var i, l;
- pos = pos >= buffer.length ? buffer.length - 1 : pos < 0 ? 0 : pos;
- var charAtPos = buffer[pos], cbuf = buffer.slice();
- charAtPos === opts.groupSeparator && (cbuf.splice(pos--, 1), charAtPos = cbuf[pos]);
- var isNegative = cbuf.join("").match(new RegExp("^" + Inputmask.escapeRegex(opts.negationSymbol.front)));
- isNegative = null !== isNegative && 1 === isNegative.length, pos > (isNegative ? opts.negationSymbol.front.length : 0) + opts.prefix.length && pos < cbuf.length - opts.suffix.length && (cbuf[pos] = "!");
- var bufVal = cbuf.join(""), bufValOrigin = cbuf.join();
- if (isNegative && (bufVal = bufVal.replace(new RegExp("^" + Inputmask.escapeRegex(opts.negationSymbol.front)), ""),
- bufVal = bufVal.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "")),
- bufVal = bufVal.replace(new RegExp(Inputmask.escapeRegex(opts.suffix) + "$"), ""),
- bufVal = bufVal.replace(new RegExp("^" + Inputmask.escapeRegex(opts.prefix)), ""),
- bufVal.length > 0 && opts.autoGroup || bufVal.indexOf(opts.groupSeparator) !== -1) {
- var escapedGroupSeparator = Inputmask.escapeRegex(opts.groupSeparator);
- bufVal = bufVal.replace(new RegExp(escapedGroupSeparator, "g"), "");
- var radixSplit = bufVal.split(charAtPos === opts.radixPoint ? "!" : opts.radixPoint);
- if (bufVal = "" === opts.radixPoint ? bufVal : radixSplit[0], charAtPos !== opts.negationSymbol.front && (bufVal = bufVal.replace("!", "?")),
- bufVal.length > opts.groupSize) for (var reg = new RegExp("([-+]?[\\d?]+)([\\d?]{" + opts.groupSize + "})"); reg.test(bufVal) && "" !== opts.groupSeparator; ) bufVal = bufVal.replace(reg, "$1" + opts.groupSeparator + "$2"),
- bufVal = bufVal.replace(opts.groupSeparator + opts.groupSeparator, opts.groupSeparator);
- bufVal = bufVal.replace("?", "!"), "" !== opts.radixPoint && radixSplit.length > 1 && (bufVal += (charAtPos === opts.radixPoint ? "!" : opts.radixPoint) + radixSplit[1]);
- }
- bufVal = opts.prefix + bufVal + opts.suffix, isNegative && (bufVal = opts.negationSymbol.front + bufVal + opts.negationSymbol.back);
- var needsRefresh = bufValOrigin !== bufVal.split("").join(), newPos = $.inArray("!", bufVal);
- if (newPos === -1 && (newPos = pos), needsRefresh) {
- for (buffer.length = bufVal.length, i = 0, l = bufVal.length; i < l; i++) buffer[i] = bufVal.charAt(i);
- buffer[newPos] = charAtPos;
- }
- return newPos = opts.numericInput && isFinite(pos) ? buffer.join("").length - newPos - 1 : newPos,
- opts.numericInput && (buffer = buffer.reverse(), $.inArray(opts.radixPoint, buffer) < newPos && buffer.join("").length - opts.suffix.length !== newPos && (newPos -= 1)),
- {
- pos: newPos,
- refreshFromBuffer: needsRefresh,
- buffer: buffer,
- isNegative: isNegative
- };
- },
- onBeforeWrite: function(e, buffer, caretPos, opts) {
- var rslt;
- if (e && ("blur" === e.type || "checkval" === e.type || "keydown" === e.type)) {
- var maskedValue = opts.numericInput ? buffer.slice().reverse().join("") : buffer.join(""), processValue = maskedValue.replace(opts.prefix, "");
- processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
- "," === opts.radixPoint && (processValue = processValue.replace(opts.radixPoint, "."));
- var isNegative = processValue.match(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"));
- if (isNegative = null !== isNegative && 1 === isNegative.length, processValue = processValue.replace(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"), ""),
- processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), ""),
- isNaN(opts.placeholder) && (processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.placeholder), "g"), "")),
- processValue = processValue === opts.negationSymbol.front ? processValue + "0" : processValue,
- "" !== processValue && isFinite(processValue)) {
- var floatValue = parseFloat(processValue), signedFloatValue = isNegative ? floatValue * -1 : floatValue;
- if (null !== opts.min && isFinite(opts.min) && signedFloatValue < parseFloat(opts.min) ? (floatValue = Math.abs(opts.min),
- isNegative = opts.min < 0, maskedValue = void 0) : null !== opts.max && isFinite(opts.max) && signedFloatValue > parseFloat(opts.max) && (floatValue = Math.abs(opts.max),
- isNegative = opts.max < 0, maskedValue = void 0), processValue = floatValue.toString().replace(".", opts.radixPoint).split(""),
- isFinite(opts.digits)) {
- var radixPosition = $.inArray(opts.radixPoint, processValue), rpb = $.inArray(opts.radixPoint, maskedValue);
- radixPosition === -1 && (processValue.push(opts.radixPoint), radixPosition = processValue.length - 1);
- for (var i = 1; i <= opts.digits; i++) opts.digitsOptional || void 0 !== processValue[radixPosition + i] && processValue[radixPosition + i] !== opts.placeholder.charAt(0) ? rpb !== -1 && void 0 !== maskedValue[rpb + i] && (processValue[radixPosition + i] = processValue[radixPosition + i] || maskedValue[rpb + i]) : processValue[radixPosition + i] = "0";
- processValue[processValue.length - 1] === opts.radixPoint && delete processValue[processValue.length - 1];
- }
- if (floatValue.toString() !== processValue && floatValue.toString() + "." !== processValue || isNegative) return processValue = (opts.prefix + processValue.join("")).split(""),
- !isNegative || 0 === floatValue && "blur" === e.type || (processValue.unshift(opts.negationSymbol.front),
- processValue.push(opts.negationSymbol.back)), opts.numericInput && (processValue = processValue.reverse()),
- rslt = opts.postFormat(processValue, opts.numericInput ? caretPos : caretPos - 1, opts),
- rslt.buffer && (rslt.refreshFromBuffer = rslt.buffer.join("") !== buffer.join("")),
- rslt;
- }
- }
- if (opts.autoGroup) return rslt = opts.postFormat(buffer, opts.numericInput ? caretPos : caretPos - 1, opts),
- rslt.caret = caretPos < (rslt.isNegative ? opts.negationSymbol.front.length : 0) + opts.prefix.length || caretPos > rslt.buffer.length - (rslt.isNegative ? opts.negationSymbol.back.length : 0) ? rslt.pos : rslt.pos + 1,
- rslt;
- },
- regex: {
- integerPart: function(opts) {
- return new RegExp("[" + Inputmask.escapeRegex(opts.negationSymbol.front) + "+]?\\d+");
- },
- integerNPart: function(opts) {
- return new RegExp("[\\d" + Inputmask.escapeRegex(opts.groupSeparator) + Inputmask.escapeRegex(opts.placeholder.charAt(0)) + "]+");
- }
- },
- signHandler: function(chrs, maskset, pos, strict, opts) {
- if (!strict && opts.allowMinus && "-" === chrs || opts.allowPlus && "+" === chrs) {
- var matchRslt = maskset.buffer.join("").match(opts.regex.integerPart(opts));
- if (matchRslt && matchRslt[0].length > 0) return maskset.buffer[matchRslt.index] === ("-" === chrs ? "+" : opts.negationSymbol.front) ? "-" === chrs ? "" !== opts.negationSymbol.back ? {
- pos: 0,
- c: opts.negationSymbol.front,
- remove: 0,
- caret: pos,
- insert: {
- pos: maskset.buffer.length - 1,
- c: opts.negationSymbol.back
- }
- } : {
- pos: 0,
- c: opts.negationSymbol.front,
- remove: 0,
- caret: pos
- } : "" !== opts.negationSymbol.back ? {
- pos: 0,
- c: "+",
- remove: [ 0, maskset.buffer.length - 1 ],
- caret: pos
- } : {
- pos: 0,
- c: "+",
- remove: 0,
- caret: pos
- } : maskset.buffer[0] === ("-" === chrs ? opts.negationSymbol.front : "+") ? "-" === chrs && "" !== opts.negationSymbol.back ? {
- remove: [ 0, maskset.buffer.length - 1 ],
- caret: pos - 1
- } : {
- remove: 0,
- caret: pos - 1
- } : "-" === chrs ? "" !== opts.negationSymbol.back ? {
- pos: 0,
- c: opts.negationSymbol.front,
- caret: pos + 1,
- insert: {
- pos: maskset.buffer.length,
- c: opts.negationSymbol.back
- }
- } : {
- pos: 0,
- c: opts.negationSymbol.front,
- caret: pos + 1
- } : {
- pos: 0,
- c: chrs,
- caret: pos + 1
- };
- }
- return !1;
- },
- radixHandler: function(chrs, maskset, pos, strict, opts) {
- if (!strict && opts.numericInput !== !0 && chrs === opts.radixPoint && void 0 !== opts.digits && (isNaN(opts.digits) || parseInt(opts.digits) > 0)) {
- var radixPos = $.inArray(opts.radixPoint, maskset.buffer), integerValue = maskset.buffer.join("").match(opts.regex.integerPart(opts));
- if (radixPos !== -1 && maskset.validPositions[radixPos]) return maskset.validPositions[radixPos - 1] ? {
- caret: radixPos + 1
- } : {
- pos: integerValue.index,
- c: integerValue[0],
- caret: radixPos + 1
- };
- if (!integerValue || "0" === integerValue[0] && integerValue.index + 1 !== pos) return maskset.buffer[integerValue ? integerValue.index : pos] = "0",
- {
- pos: (integerValue ? integerValue.index : pos) + 1,
- c: opts.radixPoint
- };
- }
- return !1;
- },
- leadingZeroHandler: function(chrs, maskset, pos, strict, opts, isSelection) {
- if (!strict) {
- var buffer = maskset.buffer.slice("");
- if (buffer.splice(0, opts.prefix.length), buffer.splice(buffer.length - opts.suffix.length, opts.suffix.length),
- opts.numericInput === !0) {
- var buffer = buffer.reverse(), bufferChar = buffer[0];
- if ("0" === bufferChar && void 0 === maskset.validPositions[pos - 1]) return {
- pos: pos,
- remove: buffer.length - 1
- };
- } else {
- pos -= opts.prefix.length;
- var radixPosition = $.inArray(opts.radixPoint, buffer), matchRslt = buffer.slice(0, radixPosition !== -1 ? radixPosition : void 0).join("").match(opts.regex.integerNPart(opts));
- if (matchRslt && (radixPosition === -1 || pos <= radixPosition)) {
- var decimalPart = radixPosition === -1 ? 0 : parseInt(buffer.slice(radixPosition + 1).join(""));
- if (0 === matchRslt[0].indexOf("" !== opts.placeholder ? opts.placeholder.charAt(0) : "0") && (matchRslt.index + 1 === pos || isSelection !== !0 && 0 === decimalPart)) return maskset.buffer.splice(matchRslt.index + opts.prefix.length, 1),
- {
- pos: matchRslt.index + opts.prefix.length,
- remove: matchRslt.index + opts.prefix.length
- };
- if ("0" === chrs && pos <= matchRslt.index && matchRslt[0] !== opts.groupSeparator) return !1;
- }
- }
- }
- return !0;
- },
- definitions: {
- "~": {
- validator: function(chrs, maskset, pos, strict, opts, isSelection) {
- var isValid = opts.signHandler(chrs, maskset, pos, strict, opts);
- if (!isValid && (isValid = opts.radixHandler(chrs, maskset, pos, strict, opts),
- !isValid && (isValid = strict ? new RegExp("[0-9" + Inputmask.escapeRegex(opts.groupSeparator) + "]").test(chrs) : new RegExp("[0-9]").test(chrs),
- isValid === !0 && (isValid = opts.leadingZeroHandler(chrs, maskset, pos, strict, opts, isSelection),
- isValid === !0)))) {
- var radixPosition = $.inArray(opts.radixPoint, maskset.buffer);
- isValid = radixPosition !== -1 && (opts.digitsOptional === !1 || maskset.validPositions[pos]) && opts.numericInput !== !0 && pos > radixPosition && !strict ? {
- pos: pos,
- remove: pos
- } : {
- pos: pos
- };
- }
- return isValid;
- },
- cardinality: 1
- },
- "+": {
- validator: function(chrs, maskset, pos, strict, opts) {
- var isValid = opts.signHandler(chrs, maskset, pos, strict, opts);
- return !isValid && (strict && opts.allowMinus && chrs === opts.negationSymbol.front || opts.allowMinus && "-" === chrs || opts.allowPlus && "+" === chrs) && (isValid = !(!strict && "-" === chrs) || ("" !== opts.negationSymbol.back ? {
- pos: pos,
- c: "-" === chrs ? opts.negationSymbol.front : "+",
- caret: pos + 1,
- insert: {
- pos: maskset.buffer.length,
- c: opts.negationSymbol.back
- }
- } : {
- pos: pos,
- c: "-" === chrs ? opts.negationSymbol.front : "+",
- caret: pos + 1
- })), isValid;
- },
- cardinality: 1,
- placeholder: ""
- },
- "-": {
- validator: function(chrs, maskset, pos, strict, opts) {
- var isValid = opts.signHandler(chrs, maskset, pos, strict, opts);
- return !isValid && strict && opts.allowMinus && chrs === opts.negationSymbol.back && (isValid = !0),
- isValid;
- },
- cardinality: 1,
- placeholder: ""
- },
- ":": {
- validator: function(chrs, maskset, pos, strict, opts) {
- var isValid = opts.signHandler(chrs, maskset, pos, strict, opts);
- if (!isValid) {
- var radix = "[" + Inputmask.escapeRegex(opts.radixPoint) + "]";
- isValid = new RegExp(radix).test(chrs), isValid && maskset.validPositions[pos] && maskset.validPositions[pos].match.placeholder === opts.radixPoint && (isValid = {
- caret: pos + 1
- });
- }
- return isValid;
- },
- cardinality: 1,
- placeholder: function(opts) {
- return opts.radixPoint;
- }
- }
- },
- onUnMask: function(maskedValue, unmaskedValue, opts) {
- if ("" === unmaskedValue && opts.nullable === !0) return unmaskedValue;
- var processValue = maskedValue.replace(opts.prefix, "");
- return processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
- opts.unmaskAsNumber ? ("" !== opts.radixPoint && processValue.indexOf(opts.radixPoint) !== -1 && (processValue = processValue.replace(Inputmask.escapeRegex.call(this, opts.radixPoint), ".")),
- Number(processValue)) : processValue;
- },
- isComplete: function(buffer, opts) {
- var maskedValue = buffer.join(""), bufClone = buffer.slice();
- if (opts.postFormat(bufClone, 0, opts), bufClone.join("") !== maskedValue) return !1;
- var processValue = maskedValue.replace(opts.prefix, "");
- return processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
- "," === opts.radixPoint && (processValue = processValue.replace(Inputmask.escapeRegex(opts.radixPoint), ".")),
- isFinite(processValue);
- },
- onBeforeMask: function(initialValue, opts) {
- if (opts.numericInput === !0 && (initialValue = initialValue.split("").reverse().join("")),
- "" !== 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) && (initialValue = initialValue.toString().replace(".", opts.radixPoint));
- }
- var kommaMatches = initialValue.match(/,/g), dotMatches = initialValue.match(/\./g);
- if (dotMatches && kommaMatches ? dotMatches.length > kommaMatches.length ? (initialValue = initialValue.replace(/\./g, ""),
- initialValue = initialValue.replace(",", opts.radixPoint)) : kommaMatches.length > dotMatches.length ? (initialValue = initialValue.replace(/,/g, ""),
- initialValue = initialValue.replace(".", opts.radixPoint)) : initialValue = initialValue.indexOf(".") < initialValue.indexOf(",") ? initialValue.replace(/\./g, "") : initialValue = initialValue.replace(/,/g, "") : initialValue = initialValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
- 0 === opts.digits && (initialValue.indexOf(".") !== -1 ? initialValue = initialValue.substring(0, initialValue.indexOf(".")) : initialValue.indexOf(",") !== -1 && (initialValue = initialValue.substring(0, initialValue.indexOf(",")))),
- "" !== opts.radixPoint && isFinite(opts.digits) && initialValue.indexOf(opts.radixPoint) !== -1) {
- var valueParts = initialValue.split(opts.radixPoint), decPart = valueParts[1].match(new RegExp("\\d*"))[0];
- if (parseInt(opts.digits) < decPart.toString().length) {
- var digitsFactor = Math.pow(10, parseInt(opts.digits));
- initialValue = initialValue.replace(Inputmask.escapeRegex(opts.radixPoint), "."),
- initialValue = Math.round(parseFloat(initialValue) * digitsFactor) / digitsFactor,
- initialValue = initialValue.toString().replace(".", opts.radixPoint);
- }
- }
- return opts.numericInput === !0 && (initialValue = initialValue.split("").reverse().join("")),
- initialValue.toString();
- },
- canClearPosition: function(maskset, position, lvp, strict, opts) {
- var positionInput = maskset.validPositions[position].input, canClear = positionInput !== opts.radixPoint || null !== maskset.validPositions[position].match.fn && opts.decimalProtect === !1 || isFinite(positionInput) || position === lvp || positionInput === opts.groupSeparator || positionInput === opts.negationSymbol.front || positionInput === opts.negationSymbol.back;
- return canClear;
- },
- onKeyDown: function(e, buffer, caretPos, opts) {
- var $input = $(this);
- if (e.ctrlKey) switch (e.keyCode) {
- case Inputmask.keyCode.UP:
- $input.val(parseFloat(this.inputmask.unmaskedvalue()) + parseInt(opts.step)), $input.trigger("setvalue");
- break;
- case Inputmask.keyCode.DOWN:
- $input.val(parseFloat(this.inputmask.unmaskedvalue()) - parseInt(opts.step)), $input.trigger("setvalue");
- }
- }
- },
- currency: {
- prefix: "$ ",
- groupSeparator: ",",
- alias: "numeric",
- placeholder: "0",
- autoGroup: !0,
- digits: 2,
- digitsOptional: !1,
- clearMaskOnLostFocus: !1
- },
- decimal: {
- alias: "numeric"
- },
- integer: {
- alias: "numeric",
- digits: 0,
- radixPoint: ""
- },
- percentage: {
- alias: "numeric",
- digits: 2,
- radixPoint: ".",
- placeholder: "0",
- autoGroup: !1,
- min: 0,
- max: 100,
- suffix: " %",
- allowPlus: !1,
- allowMinus: !1
- }
- }), Inputmask;
- });
|