inputmask.numeric.extensions.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. /*!
  2. * inputmask.numeric.extensions.js
  3. * https://github.com/RobinHerbots/Inputmask
  4. * Copyright (c) 2010 - 2017 Robin Herbots
  5. * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
  6. * Version: 4.0.1-22
  7. */
  8. !function(factory) {
  9. "function" == typeof define && define.amd ? define([ "./dependencyLibs/inputmask.dependencyLib", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("./dependencyLibs/inputmask.dependencyLib"), require("./inputmask")) : factory(window.dependencyLib || jQuery, window.Inputmask);
  10. }(function($, Inputmask, undefined) {
  11. function autoEscape(txt, opts) {
  12. for (var escapedTxt = "", i = 0; i < txt.length; i++) Inputmask.prototype.definitions[txt.charAt(i)] || 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) ? escapedTxt += "\\" + txt.charAt(i) : escapedTxt += txt.charAt(i);
  13. return escapedTxt;
  14. }
  15. return Inputmask.extendAliases({
  16. numeric: {
  17. mask: function(opts) {
  18. if (0 !== opts.repeat && isNaN(opts.integerDigits) && (opts.integerDigits = opts.repeat),
  19. opts.repeat = 0, opts.groupSeparator === opts.radixPoint && ("." === opts.radixPoint ? opts.groupSeparator = "," : "," === opts.radixPoint ? opts.groupSeparator = "." : opts.groupSeparator = ""),
  20. " " === opts.groupSeparator && (opts.skipOptionalPartCharacter = undefined), opts.autoGroup = opts.autoGroup && "" !== opts.groupSeparator,
  21. opts.autoGroup && ("string" == typeof opts.groupSize && isFinite(opts.groupSize) && (opts.groupSize = parseInt(opts.groupSize)),
  22. isFinite(opts.integerDigits))) {
  23. var seps = Math.floor(opts.integerDigits / opts.groupSize), mod = opts.integerDigits % opts.groupSize;
  24. opts.integerDigits = parseInt(opts.integerDigits) + (0 === mod ? seps - 1 : seps),
  25. opts.integerDigits < 1 && (opts.integerDigits = "*");
  26. }
  27. opts.placeholder.length > 1 && (opts.placeholder = opts.placeholder.charAt(0)),
  28. "radixFocus" === opts.positionCaretOnClick && "" === opts.placeholder && !1 === opts.integerOptional && (opts.positionCaretOnClick = "lvp"),
  29. opts.definitions[";"] = opts.definitions["~"], opts.definitions[";"].definitionSymbol = "~",
  30. !0 === opts.numericInput && (opts.positionCaretOnClick = "radixFocus" === opts.positionCaretOnClick ? "lvp" : opts.positionCaretOnClick,
  31. opts.digitsOptional = !1, isNaN(opts.digits) && (opts.digits = 2), opts.decimalProtect = !1);
  32. var mask = "[+]";
  33. if (mask += autoEscape(opts.prefix, opts), !0 === opts.integerOptional ? mask += "~{1," + opts.integerDigits + "}" : mask += "~{" + opts.integerDigits + "}",
  34. opts.digits !== undefined) {
  35. opts.radixPointDefinitionSymbol = opts.decimalProtect ? ":" : opts.radixPoint;
  36. var dq = opts.digits.toString().split(",");
  37. isFinite(dq[0] && dq[1] && isFinite(dq[1])) ? mask += opts.radixPointDefinitionSymbol + ";{" + opts.digits + "}" : (isNaN(opts.digits) || parseInt(opts.digits) > 0) && (opts.digitsOptional ? mask += "[" + opts.radixPointDefinitionSymbol + ";{1," + opts.digits + "}]" : mask += opts.radixPointDefinitionSymbol + ";{" + opts.digits + "}");
  38. }
  39. return mask += autoEscape(opts.suffix, opts), mask += "[-]", opts.greedy = !1, mask;
  40. },
  41. placeholder: "",
  42. greedy: !1,
  43. digits: "*",
  44. digitsOptional: !0,
  45. enforceDigitsOnBlur: !1,
  46. radixPoint: ".",
  47. positionCaretOnClick: "radixFocus",
  48. groupSize: 3,
  49. groupSeparator: "",
  50. autoGroup: !1,
  51. allowMinus: !0,
  52. negationSymbol: {
  53. front: "-",
  54. back: ""
  55. },
  56. integerDigits: "+",
  57. integerOptional: !0,
  58. prefix: "",
  59. suffix: "",
  60. rightAlign: !0,
  61. decimalProtect: !0,
  62. min: null,
  63. max: null,
  64. step: 1,
  65. insertMode: !0,
  66. autoUnmask: !1,
  67. unmaskAsNumber: !1,
  68. inputmode: "numeric",
  69. preValidation: function(buffer, pos, c, isSelection, opts) {
  70. if ("-" === c || c == opts.negationSymbol.front) return !0 === opts.allowMinus && (opts.isNegative = opts.isNegative === undefined || !opts.isNegative,
  71. "" === buffer.join("") || {
  72. caret: pos,
  73. dopost: !0
  74. });
  75. if (!1 === isSelection && c === opts.radixPoint && opts.digits !== undefined && (isNaN(opts.digits) || parseInt(opts.digits) > 0)) {
  76. var radixPos = $.inArray(opts.radixPoint, buffer);
  77. if (-1 !== radixPos) return !0 === opts.numericInput ? pos === radixPos : {
  78. caret: radixPos + 1
  79. };
  80. }
  81. return !0;
  82. },
  83. postValidation: function(buffer, currentResult, opts) {
  84. var suffix = opts.suffix.split(""), prefix = opts.prefix.split("");
  85. if (currentResult.pos == undefined && currentResult.caret !== undefined && !0 !== currentResult.dopost) return currentResult;
  86. var caretPos = currentResult.caret != undefined ? currentResult.caret : currentResult.pos, maskedValue = buffer.slice();
  87. opts.numericInput && (caretPos = maskedValue.length - caretPos - 1, maskedValue = maskedValue.reverse());
  88. var charAtPos = maskedValue[caretPos];
  89. if (charAtPos === opts.groupSeparator && (caretPos += 1, charAtPos = maskedValue[caretPos]),
  90. caretPos == maskedValue.length - opts.suffix.length - 1 && charAtPos === opts.radixPoint) return currentResult;
  91. charAtPos !== undefined && charAtPos !== opts.radixPoint && charAtPos !== opts.negationSymbol.front && charAtPos !== opts.negationSymbol.back && (maskedValue[caretPos] = "?",
  92. opts.prefix.length > 0 && caretPos >= (!1 === opts.isNegative ? 1 : 0) && caretPos < opts.prefix.length - 1 + (!1 === opts.isNegative ? 1 : 0) ? prefix[caretPos - (!1 === opts.isNegative ? 1 : 0)] = "?" : opts.suffix.length > 0 && caretPos >= maskedValue.length - opts.suffix.length - (!1 === opts.isNegative ? 1 : 0) && (suffix[caretPos - (maskedValue.length - opts.suffix.length - (!1 === opts.isNegative ? 1 : 0))] = "?")),
  93. prefix = prefix.join(""), suffix = suffix.join("");
  94. var processValue = maskedValue.join("").replace(prefix, "");
  95. if (processValue = processValue.replace(suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
  96. processValue = processValue.replace(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"), ""),
  97. processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), ""),
  98. isNaN(opts.placeholder) && (processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.placeholder), "g"), "")),
  99. processValue.length > 1 && 1 !== processValue.indexOf(opts.radixPoint) && ("0" == charAtPos && (processValue = processValue.replace(/^\?/g, "")),
  100. processValue = processValue.replace(/^0/g, "")), processValue.charAt(0) === opts.radixPoint && "" !== opts.radixPoint && !0 !== opts.numericInput && (processValue = "0" + processValue),
  101. "" !== processValue) {
  102. if (processValue = processValue.split(""), (!opts.digitsOptional || opts.enforceDigitsOnBlur && "blur" === currentResult.event) && isFinite(opts.digits)) {
  103. var radixPosition = $.inArray(opts.radixPoint, processValue), rpb = $.inArray(opts.radixPoint, maskedValue);
  104. -1 === radixPosition && (processValue.push(opts.radixPoint), radixPosition = processValue.length - 1);
  105. for (var i = 1; i <= opts.digits; i++) opts.digitsOptional && (!opts.enforceDigitsOnBlur || "blur" !== currentResult.event) || processValue[radixPosition + i] !== undefined && processValue[radixPosition + i] !== opts.placeholder.charAt(0) ? -1 !== rpb && maskedValue[rpb + i] !== undefined && (processValue[radixPosition + i] = processValue[radixPosition + i] || maskedValue[rpb + i]) : processValue[radixPosition + i] = currentResult.placeholder || opts.placeholder.charAt(0);
  106. }
  107. if (!0 !== opts.autoGroup || "" === opts.groupSeparator || charAtPos === opts.radixPoint && currentResult.pos === undefined && !currentResult.dopost) processValue = processValue.join(""); else {
  108. var addRadix = processValue[processValue.length - 1] === opts.radixPoint && currentResult.c === opts.radixPoint;
  109. processValue = Inputmask(function(buffer, opts) {
  110. var postMask = "";
  111. if (postMask += "(" + opts.groupSeparator + "*{" + opts.groupSize + "}){*}", "" !== opts.radixPoint) {
  112. var radixSplit = buffer.join("").split(opts.radixPoint);
  113. radixSplit[1] && (postMask += opts.radixPoint + "*{" + radixSplit[1].match(/^\d*\??\d*/)[0].length + "}");
  114. }
  115. return postMask;
  116. }(processValue, opts), {
  117. numericInput: !0,
  118. jitMasking: !0,
  119. definitions: {
  120. "*": {
  121. validator: "[0-9?]",
  122. cardinality: 1
  123. }
  124. }
  125. }).format(processValue.join("")), addRadix && (processValue += opts.radixPoint),
  126. processValue.charAt(0) === opts.groupSeparator && processValue.substr(1);
  127. }
  128. }
  129. if (opts.isNegative && "blur" === currentResult.event && (opts.isNegative = "0" !== processValue),
  130. processValue = prefix + processValue, processValue += suffix, opts.isNegative && (processValue = opts.negationSymbol.front + processValue,
  131. processValue += opts.negationSymbol.back), processValue = processValue.split(""),
  132. charAtPos !== undefined) if (charAtPos !== opts.radixPoint && charAtPos !== opts.negationSymbol.front && charAtPos !== opts.negationSymbol.back) caretPos = $.inArray("?", processValue),
  133. caretPos > -1 ? processValue[caretPos] = charAtPos : caretPos = currentResult.caret || 0; else if (charAtPos === opts.radixPoint || charAtPos === opts.negationSymbol.front || charAtPos === opts.negationSymbol.back) {
  134. var newCaretPos = $.inArray(charAtPos, processValue);
  135. -1 !== newCaretPos && (caretPos = newCaretPos);
  136. }
  137. opts.numericInput && (caretPos = processValue.length - caretPos - 1, processValue = processValue.reverse());
  138. var rslt = {
  139. caret: charAtPos === undefined || currentResult.pos !== undefined ? caretPos + (opts.numericInput ? -1 : 1) : caretPos,
  140. buffer: processValue,
  141. refreshFromBuffer: currentResult.dopost || buffer.join("") !== processValue.join("")
  142. };
  143. return rslt.refreshFromBuffer ? rslt : currentResult;
  144. },
  145. onBeforeWrite: function(e, buffer, caretPos, opts) {
  146. if (e) switch (e.type) {
  147. case "keydown":
  148. return opts.postValidation(buffer, {
  149. caret: caretPos,
  150. dopost: !0
  151. }, opts);
  152. case "blur":
  153. case "checkval":
  154. var unmasked;
  155. if (function(opts) {
  156. opts.parseMinMaxOptions === undefined && (null !== opts.min && (opts.min = opts.min.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
  157. "," === opts.radixPoint && (opts.min = opts.min.replace(opts.radixPoint, ".")),
  158. opts.min = isFinite(opts.min) ? parseFloat(opts.min) : NaN, isNaN(opts.min) && (opts.min = Number.MIN_VALUE)),
  159. null !== opts.max && (opts.max = opts.max.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
  160. "," === opts.radixPoint && (opts.max = opts.max.replace(opts.radixPoint, ".")),
  161. opts.max = isFinite(opts.max) ? parseFloat(opts.max) : NaN, isNaN(opts.max) && (opts.max = Number.MAX_VALUE)),
  162. opts.parseMinMaxOptions = "done");
  163. }(opts), null !== opts.min || null !== opts.max) {
  164. if (unmasked = opts.onUnMask(buffer.join(""), undefined, $.extend({}, opts, {
  165. unmaskAsNumber: !0
  166. })), null !== opts.min && unmasked < opts.min) return opts.isNegative = opts.min < 0,
  167. opts.postValidation(opts.min.toString().replace(".", opts.radixPoint).split(""), {
  168. caret: caretPos,
  169. dopost: !0,
  170. placeholder: "0"
  171. }, opts);
  172. if (null !== opts.max && unmasked > opts.max) return opts.isNegative = opts.max < 0,
  173. opts.postValidation(opts.max.toString().replace(".", opts.radixPoint).split(""), {
  174. caret: caretPos,
  175. dopost: !0,
  176. placeholder: "0"
  177. }, opts);
  178. }
  179. return opts.postValidation(buffer, {
  180. caret: caretPos,
  181. dopost: !0,
  182. placeholder: "0",
  183. event: "blur"
  184. }, opts);
  185. case "_checkval":
  186. return {
  187. caret: caretPos
  188. };
  189. }
  190. },
  191. regex: {
  192. integerPart: function(opts, emptyCheck) {
  193. return emptyCheck ? new RegExp("[" + Inputmask.escapeRegex(opts.negationSymbol.front) + "+]?") : new RegExp("[" + Inputmask.escapeRegex(opts.negationSymbol.front) + "+]?\\d+");
  194. },
  195. integerNPart: function(opts) {
  196. return new RegExp("[\\d" + Inputmask.escapeRegex(opts.groupSeparator) + Inputmask.escapeRegex(opts.placeholder.charAt(0)) + "]+");
  197. }
  198. },
  199. definitions: {
  200. "~": {
  201. validator: function(chrs, maskset, pos, strict, opts, isSelection) {
  202. var isValid = strict ? new RegExp("[0-9" + Inputmask.escapeRegex(opts.groupSeparator) + "]").test(chrs) : new RegExp("[0-9]").test(chrs);
  203. if (!0 === isValid) {
  204. if (!0 !== opts.numericInput && maskset.validPositions[pos] !== undefined && "~" === maskset.validPositions[pos].match.def && !isSelection) {
  205. var processValue = maskset.buffer.join("");
  206. processValue = processValue.replace(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"), ""),
  207. processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "");
  208. var pvRadixSplit = processValue.split(opts.radixPoint);
  209. pvRadixSplit.length > 1 && (pvRadixSplit[1] = pvRadixSplit[1].replace(/0/g, opts.placeholder.charAt(0))),
  210. "0" === pvRadixSplit[0] && (pvRadixSplit[0] = pvRadixSplit[0].replace(/0/g, opts.placeholder.charAt(0))),
  211. processValue = pvRadixSplit[0] + opts.radixPoint + pvRadixSplit[1] || "";
  212. var bufferTemplate = maskset._buffer.join("");
  213. for (processValue === opts.radixPoint && (processValue = bufferTemplate); null === processValue.match(Inputmask.escapeRegex(bufferTemplate) + "$"); ) bufferTemplate = bufferTemplate.slice(1);
  214. processValue = processValue.replace(bufferTemplate, ""), processValue = processValue.split(""),
  215. isValid = processValue[pos] === undefined ? {
  216. pos: pos,
  217. remove: pos
  218. } : {
  219. pos: pos
  220. };
  221. }
  222. } else strict || chrs !== opts.radixPoint || maskset.validPositions[pos - 1] !== undefined || (maskset.buffer[pos] = "0",
  223. isValid = {
  224. pos: pos + 1
  225. });
  226. return isValid;
  227. },
  228. cardinality: 1
  229. },
  230. "+": {
  231. validator: function(chrs, maskset, pos, strict, opts) {
  232. return opts.allowMinus && ("-" === chrs || chrs === opts.negationSymbol.front);
  233. },
  234. cardinality: 1,
  235. placeholder: ""
  236. },
  237. "-": {
  238. validator: function(chrs, maskset, pos, strict, opts) {
  239. return opts.allowMinus && chrs === opts.negationSymbol.back;
  240. },
  241. cardinality: 1,
  242. placeholder: ""
  243. },
  244. ":": {
  245. validator: function(chrs, maskset, pos, strict, opts) {
  246. var radix = "[" + Inputmask.escapeRegex(opts.radixPoint) + "]", isValid = new RegExp(radix).test(chrs);
  247. return isValid && maskset.validPositions[pos] && maskset.validPositions[pos].match.placeholder === opts.radixPoint && (isValid = {
  248. caret: pos + 1
  249. }), isValid;
  250. },
  251. cardinality: 1,
  252. placeholder: function(opts) {
  253. return opts.radixPoint;
  254. }
  255. }
  256. },
  257. onUnMask: function(maskedValue, unmaskedValue, opts) {
  258. if ("" === unmaskedValue && !0 === opts.nullable) return unmaskedValue;
  259. var processValue = maskedValue.replace(opts.prefix, "");
  260. return processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
  261. "" !== opts.placeholder.charAt(0) && (processValue = processValue.replace(new RegExp(opts.placeholder.charAt(0), "g"), "0")),
  262. opts.unmaskAsNumber ? ("" !== opts.radixPoint && -1 !== processValue.indexOf(opts.radixPoint) && (processValue = processValue.replace(Inputmask.escapeRegex.call(this, opts.radixPoint), ".")),
  263. processValue = processValue.replace(new RegExp("^" + Inputmask.escapeRegex(opts.negationSymbol.front)), "-"),
  264. processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), ""),
  265. Number(processValue)) : processValue;
  266. },
  267. isComplete: function(buffer, opts) {
  268. var maskedValue = buffer.join("");
  269. if (buffer.slice().join("") !== maskedValue) return !1;
  270. var processValue = maskedValue.replace(opts.prefix, "");
  271. return processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
  272. "," === opts.radixPoint && (processValue = processValue.replace(Inputmask.escapeRegex(opts.radixPoint), ".")),
  273. isFinite(processValue);
  274. },
  275. onBeforeMask: function(initialValue, opts) {
  276. if (opts.isNegative = undefined, initialValue = initialValue.toString().charAt(initialValue.length - 1) === opts.radixPoint ? initialValue.toString().substr(0, initialValue.length - 1) : initialValue.toString(),
  277. "" !== opts.radixPoint && isFinite(initialValue)) {
  278. var vs = initialValue.split("."), groupSize = "" !== opts.groupSeparator ? parseInt(opts.groupSize) : 0;
  279. 2 === vs.length && (vs[0].length > groupSize || vs[1].length > groupSize || vs[0].length <= groupSize && vs[1].length < groupSize) && (initialValue = initialValue.replace(".", opts.radixPoint));
  280. }
  281. var kommaMatches = initialValue.match(/,/g), dotMatches = initialValue.match(/\./g);
  282. if (dotMatches && kommaMatches ? dotMatches.length > kommaMatches.length ? (initialValue = initialValue.replace(/\./g, ""),
  283. initialValue = initialValue.replace(",", opts.radixPoint)) : kommaMatches.length > dotMatches.length ? (initialValue = initialValue.replace(/,/g, ""),
  284. 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"), ""),
  285. 0 === opts.digits && (-1 !== initialValue.indexOf(".") ? initialValue = initialValue.substring(0, initialValue.indexOf(".")) : -1 !== initialValue.indexOf(",") && (initialValue = initialValue.substring(0, initialValue.indexOf(",")))),
  286. "" !== opts.radixPoint && isFinite(opts.digits) && -1 !== initialValue.indexOf(opts.radixPoint)) {
  287. var valueParts = initialValue.split(opts.radixPoint), decPart = valueParts[1].match(new RegExp("\\d*"))[0];
  288. if (parseInt(opts.digits) < decPart.toString().length) {
  289. var digitsFactor = Math.pow(10, parseInt(opts.digits));
  290. initialValue = initialValue.replace(Inputmask.escapeRegex(opts.radixPoint), "."),
  291. initialValue = Math.round(parseFloat(initialValue) * digitsFactor) / digitsFactor,
  292. initialValue = initialValue.toString().replace(".", opts.radixPoint);
  293. }
  294. }
  295. return initialValue;
  296. },
  297. canClearPosition: function(maskset, position, lvp, strict, opts) {
  298. var vp = maskset.validPositions[position], canClear = vp.input !== opts.radixPoint || null !== maskset.validPositions[position].match.fn && !1 === opts.decimalProtect || vp.input === opts.radixPoint && maskset.validPositions[position + 1] && null === maskset.validPositions[position + 1].match.fn || isFinite(vp.input) || position === lvp || vp.input === opts.groupSeparator || vp.input === opts.negationSymbol.front || vp.input === opts.negationSymbol.back;
  299. return !canClear || "+" != vp.match.nativeDef && "-" != vp.match.nativeDef || (opts.isNegative = !1),
  300. canClear;
  301. },
  302. onKeyDown: function(e, buffer, caretPos, opts) {
  303. var $input = $(this);
  304. if (e.ctrlKey) switch (e.keyCode) {
  305. case Inputmask.keyCode.UP:
  306. $input.val(parseFloat(this.inputmask.unmaskedvalue()) + parseInt(opts.step)), $input.trigger("setvalue");
  307. break;
  308. case Inputmask.keyCode.DOWN:
  309. $input.val(parseFloat(this.inputmask.unmaskedvalue()) - parseInt(opts.step)), $input.trigger("setvalue");
  310. }
  311. }
  312. },
  313. currency: {
  314. prefix: "$ ",
  315. groupSeparator: ",",
  316. alias: "numeric",
  317. placeholder: "0",
  318. autoGroup: !0,
  319. digits: 2,
  320. digitsOptional: !1,
  321. clearMaskOnLostFocus: !1
  322. },
  323. decimal: {
  324. alias: "numeric"
  325. },
  326. integer: {
  327. alias: "numeric",
  328. digits: 0,
  329. radixPoint: ""
  330. },
  331. percentage: {
  332. alias: "numeric",
  333. digits: 2,
  334. digitsOptional: !0,
  335. radixPoint: ".",
  336. placeholder: "0",
  337. autoGroup: !1,
  338. min: 0,
  339. max: 100,
  340. suffix: " %",
  341. allowMinus: !1
  342. }
  343. }), Inputmask;
  344. });