inputmask.numeric.extensions.js 25 KB

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