inputmask.numeric.extensions.js 25 KB

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