jquery.inputmask.numeric.extensions.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. /*
  2. Input Mask plugin extensions
  3. http://github.com/RobinHerbots/jquery.inputmask
  4. Copyright (c) 2010 - 2014 Robin Herbots
  5. Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
  6. Version: 0.0.0
  7. Optional extensions on the jquery.inputmask base
  8. */
  9. (function ($) {
  10. //number aliases
  11. $.extend($.inputmask.defaults.aliases, {
  12. 'numeric': {
  13. mask: function (opts) {
  14. function autoEscape(txt) {
  15. var escapedTxt = "";
  16. for (var i = 0; i < txt.length; i++) {
  17. escapedTxt += opts.definitions[txt[i]] ? "\\" + txt[i] : txt[i];
  18. }
  19. return escapedTxt;
  20. }
  21. if (opts.repeat !== 0 && isNaN(opts.integerDigits)) {
  22. opts.integerDigits = opts.repeat;
  23. }
  24. opts.repeat = 0;
  25. if (opts.groupSeparator == opts.radixPoint) { //treat equal separator and radixpoint
  26. if (opts.radixPoint == ".")
  27. opts.groupSeparator = ",";
  28. else if (opts.radixPoint == ",")
  29. opts.groupSeparator = ".";
  30. else opts.groupSeparator = "";
  31. }
  32. if (opts.groupSeparator === " ") { //prevent conflict with default skipOptionalPartCharacter
  33. opts.skipOptionalPartCharacter = undefined;
  34. }
  35. opts.autoGroup = opts.autoGroup && opts.groupSeparator != "";
  36. if (opts.autoGroup) {
  37. if (typeof opts.groupSize == "string" && isFinite(opts.groupSize)) opts.groupSize = parseInt(opts.groupSize);
  38. if (isFinite(opts.integerDigits)) {
  39. var seps = Math.floor(opts.integerDigits / opts.groupSize);
  40. var mod = opts.integerDigits % opts.groupSize;
  41. opts.integerDigits = parseInt(opts.integerDigits) + (mod == 0 ? seps - 1 : seps);
  42. }
  43. }
  44. //only allow radixfocus when placeholder = 0
  45. opts.radixFocus = opts.radixFocus && opts.placeholder == "0";
  46. opts.definitions[";"] = opts.definitions["~"]; //clone integer def for decimals
  47. var mask = autoEscape(opts.prefix);
  48. mask += "[+]";
  49. mask += "~{1," + opts.integerDigits + "}";
  50. if (opts.digits != undefined && (isNaN(opts.digits) || parseInt(opts.digits) > 0)) {
  51. if (opts.digitsOptional)
  52. mask += "[" + (opts.decimalProtect ? ":" : opts.radixPoint) + ";{" + opts.digits + "}]";
  53. else mask += (opts.decimalProtect ? ":" : opts.radixPoint) + ";{" + opts.digits + "}";
  54. }
  55. mask += "[-]";
  56. mask += autoEscape(opts.suffix);
  57. opts.greedy = false; //enforce greedy false
  58. return mask;
  59. },
  60. placeholder: "",
  61. greedy: false,
  62. digits: "*", //number of fractionalDigits
  63. digitsOptional: true,
  64. groupSeparator: "",//",", // | "."
  65. radixPoint: ".",
  66. radixFocus: true,
  67. groupSize: 3,
  68. autoGroup: false,
  69. allowPlus: true,
  70. allowMinus: true,
  71. negationSymbol: {
  72. front: "-", //"("
  73. back: "" //")"
  74. },
  75. integerDigits: "+", //number of integerDigits
  76. prefix: "",
  77. suffix: "",
  78. rightAlign: true,
  79. decimalProtect: true, //do not allow assumption of decimals input without entering the radixpoint
  80. min: undefined, //minimum value
  81. max: undefined, //maximum value
  82. postFormat: function (buffer, pos, reformatOnly, opts) { //this needs to be removed // this is crap
  83. console.log("input " + buffer);
  84. var negationStrip = false;
  85. var suffixStripped = false;
  86. if (buffer.length >= opts.suffix.length && buffer.join('').indexOf(opts.suffix) == (buffer.length - opts.suffix.length)) {
  87. buffer.length = buffer.length - opts.suffix.length; //strip suffix
  88. suffixStripped = true;
  89. }
  90. //position overflow corrections
  91. pos = pos >= buffer.length ? buffer.length - 1 : (pos < opts.prefix.length ? opts.prefix.length : pos);
  92. var needsRefresh = false, charAtPos = buffer[pos];
  93. if (opts.groupSeparator == "" ||
  94. ($.inArray(opts.radixPoint, buffer) != -1 && pos >= $.inArray(opts.radixPoint, buffer)) ||
  95. new RegExp('[' + $.inputmask.escapeRegex(opts.negationSymbol.front) + '\+]').test(charAtPos)
  96. ) {
  97. if (suffixStripped) {
  98. for (var i = 0, l = opts.suffix.length; i < l; i++) {
  99. buffer.push(opts.suffix.charAt(i));
  100. }
  101. }
  102. console.log("return input " + buffer);
  103. return { pos: pos };
  104. }
  105. var cbuf = buffer.slice();
  106. if (charAtPos == opts.groupSeparator) {
  107. cbuf.splice(pos--, 1);
  108. charAtPos = cbuf[pos];
  109. }
  110. if (reformatOnly) cbuf[pos] = "?"; else cbuf.splice(pos, 0, "?"); //set position indicator
  111. var bufVal = cbuf.join(''), bufValOrigin = bufVal;
  112. if (bufVal.length > 0 && opts.autoGroup || (reformatOnly && bufVal.indexOf(opts.groupSeparator) != -1)) {
  113. var escapedGroupSeparator = $.inputmask.escapeRegex(opts.groupSeparator);
  114. needsRefresh = bufVal.indexOf(opts.groupSeparator) == 0;
  115. bufVal = bufVal.replace(new RegExp(escapedGroupSeparator, "g"), '');
  116. var radixSplit = bufVal.split(opts.radixPoint);
  117. bufVal = opts.radixPoint == "" ? bufVal : radixSplit[0];
  118. if (bufVal != (opts.prefix + "?0") && bufVal.length >= (opts.groupSize + opts.prefix.length)) {
  119. //needsRefresh = true;
  120. var reg = new RegExp('([-\+]?[\\d\?]+)([\\d\?]{' + opts.groupSize + '})');
  121. while (reg.test(bufVal)) {
  122. bufVal = bufVal.replace(reg, '$1' + opts.groupSeparator + '$2');
  123. bufVal = bufVal.replace(opts.groupSeparator + opts.groupSeparator, opts.groupSeparator);
  124. }
  125. }
  126. if (opts.radixPoint != "" && radixSplit.length > 1)
  127. bufVal += opts.radixPoint + radixSplit[1];
  128. }
  129. needsRefresh = bufValOrigin != bufVal;
  130. buffer.length = bufVal.length; //align the length
  131. for (var i = 0, l = bufVal.length; i < l; i++) {
  132. buffer[i] = bufVal.charAt(i);
  133. }
  134. var newPos = $.inArray("?", buffer);
  135. if (reformatOnly) buffer[newPos] = charAtPos; else buffer.splice(newPos, 1);
  136. if (!needsRefresh && suffixStripped) {
  137. for (var i = 0, l = opts.suffix.length; i < l; i++) {
  138. buffer.push(opts.suffix.charAt(i));
  139. }
  140. }
  141. console.log("formatted " + buffer + " refresh " + needsRefresh);
  142. return { pos: newPos, "refreshFromBuffer": needsRefresh, "buffer": buffer };
  143. },
  144. onBeforeWrite: function (e, buffer, caretPos, opts) {
  145. if (e && e.type == "blur") {
  146. //handle minvalue
  147. var maskedValue = buffer.join(''),
  148. processValue = maskedValue.replace(opts.prefix, "");
  149. processValue = processValue.replace(opts.suffix, "");
  150. processValue = processValue.replace(new RegExp($.inputmask.escapeRegex(opts.groupSeparator), "g"), "");
  151. processValue = processValue.replace($.inputmask.escapeRegex(opts.radixPoint), ".");
  152. if (isFinite(processValue)) {
  153. if (isFinite(opts.min) && parseFloat(processValue) < parseFloat(opts.min)) {
  154. return opts.postFormat((opts.prefix + opts.min).split(''), 0, true, opts);
  155. }
  156. }
  157. var tmpBufSplit = opts.radixPoint != "" ? buffer.join('').split(opts.radixPoint) : [buffer.join('')],
  158. matchRslt = tmpBufSplit[0].match(opts.regex.integerPart(opts)),
  159. matchRsltDigits = tmpBufSplit.length == 2 ? tmpBufSplit[1].match(opts.regex.integerNPart(opts)) : undefined;
  160. if (matchRslt && (matchRslt[0] == opts.negationSymbol.front + "0" || matchRslt[0] == opts.negationSymbol.front || matchRslt[0] == "+") && (matchRsltDigits == undefined || matchRsltDigits[0].match(/^0+$/))) {
  161. buffer.splice(matchRslt.index, 1);
  162. }
  163. var radixPosition = $.inArray(opts.radixPoint, buffer);
  164. if (radixPosition != -1 && isFinite(opts.digits) && !opts.digitsOptional) {
  165. for (var i = 1; i <= opts.digits; i++) {
  166. if (buffer[radixPosition + i] == undefined || buffer[radixPosition + i] == opts.placeholder.charAt(0)) buffer[radixPosition + i] = "0";
  167. }
  168. return { "refreshFromBuffer": true, "buffer": buffer };
  169. }
  170. }
  171. if (opts.autoGroup) {
  172. var rslt = opts.postFormat(buffer, caretPos - 1, true, opts);
  173. rslt.caret = caretPos <= opts.prefix.length ? rslt.pos : rslt.pos + 1;
  174. return rslt;
  175. }
  176. },
  177. regex: {
  178. integerPart: function (opts) { return new RegExp('[' + $.inputmask.escapeRegex(opts.negationSymbol.front) + '\+]?\\d+'); },
  179. integerNPart: function (opts) { return new RegExp('[\\d' + $.inputmask.escapeRegex(opts.groupSeparator) + ']+'); }
  180. },
  181. signHandler: function (chrs, maskset, pos, strict, opts) {
  182. if (!strict && (opts.allowMinus && chrs === "-") || (opts.allowPlus && chrs === "+")) {
  183. var matchRslt = maskset.buffer.join('').match(opts.regex.integerPart(opts));
  184. if (matchRslt && matchRslt[0].length > 0) {
  185. if (maskset.buffer[matchRslt.index] == (chrs === "-" ? "+" : opts.negationSymbol.front)) {
  186. if (chrs == "-") {
  187. return { "pos": matchRslt.index, "c": opts.negationSymbol.front, "remove": matchRslt.index, "caret": pos, "insert": { "pos": maskset["buffer"].length - opts.suffix.length - 1, "c": opts.negationSymbol.back } };
  188. } else {
  189. return { "pos": matchRslt.index, "c": "+", "remove": [matchRslt.index, maskset["buffer"].length - opts.suffix.length - 1], "caret": pos };
  190. }
  191. } else if (maskset.buffer[matchRslt.index] == (chrs === "-" ? opts.negationSymbol.front : "+")) {
  192. if (chrs == "-") {
  193. return { "remove": [matchRslt.index, maskset["buffer"].length - opts.suffix.length - 1], "caret": pos - 1 };
  194. } else {
  195. return { "remove": matchRslt.index, "caret": pos - 1 };
  196. }
  197. } else {
  198. if (chrs == "-") {
  199. return { "pos": matchRslt.index, "c": opts.negationSymbol.front, "caret": pos + 1, "insert": { "pos": maskset["buffer"].length - opts.suffix.length, "c": opts.negationSymbol.back } };
  200. } else {
  201. return { "pos": matchRslt.index, "c": chrs, "caret": pos + 1 };
  202. }
  203. }
  204. }
  205. }
  206. return false;
  207. },
  208. radixHandler: function (chrs, maskset, pos, strict, opts) {
  209. if (!strict && chrs === opts.radixPoint && opts.digits > 0) {
  210. var radixPos = $.inArray(opts.radixPoint, maskset.buffer), integerValue = maskset.buffer.join('').match(opts.regex.integerPart(opts));
  211. if (radixPos != -1 && maskset["validPositions"][radixPos]) {
  212. if (maskset["validPositions"][radixPos - 1])
  213. return { "caret": radixPos + 1 };
  214. else return { "pos": integerValue.index, c: integerValue[0], "caret": radixPos + 1 };
  215. } else if (!integerValue || (integerValue["0"] == "0" && (integerValue.index + 1) != pos)) {
  216. maskset.buffer[integerValue ? integerValue.index : pos] = "0";
  217. return { "pos": (integerValue ? integerValue.index : pos) + 1 };
  218. }
  219. }
  220. return false;
  221. },
  222. leadingZeroHandler: function (chrs, maskset, pos, strict, opts) {
  223. var matchRslt = maskset.buffer.join('').match(opts.regex.integerNPart(opts)), radixPosition = $.inArray(opts.radixPoint, maskset.buffer);
  224. if (matchRslt && !strict && (radixPosition == -1 || pos <= radixPosition)) {
  225. if (matchRslt["0"].indexOf("0") == 0) {
  226. if (pos < opts.prefix.length) pos = matchRslt.index; //position
  227. var _radixPosition = $.inArray(opts.radixPoint, maskset._buffer);
  228. var digitsMatch = maskset._buffer && maskset.buffer.slice(radixPosition).join('') == maskset._buffer.slice(_radixPosition).join('') || parseInt(maskset.buffer.slice(radixPosition + 1).join('')) == 0;
  229. var integerMatch = maskset._buffer && maskset.buffer.slice(matchRslt.index, radixPosition).join('') == maskset._buffer.slice(opts.prefix.length, _radixPosition).join('') || maskset.buffer.slice(matchRslt.index, radixPosition).join('') == "0";
  230. if (radixPosition == -1 || digitsMatch && integerMatch) {
  231. maskset.buffer.splice(matchRslt.index, 1);
  232. pos = pos > matchRslt.index ? pos - 1 : matchRslt.index;
  233. return { "pos": pos, "remove": matchRslt.index };
  234. } else if (matchRslt.index + 1 == pos || chrs == "0") {
  235. maskset.buffer.splice(matchRslt.index, 1);
  236. pos = matchRslt.index;
  237. return { "pos": pos, "remove": matchRslt.index };
  238. }
  239. } else if (chrs === "0" && pos <= matchRslt.index && matchRslt["0"] != opts.groupSeparator) {
  240. return false;
  241. }
  242. }
  243. return true;
  244. },
  245. postValidation: function (buffer, opts) {
  246. //handle maxvalue
  247. var isValid = true,
  248. maskedValue = buffer.join(''),
  249. processValue = maskedValue.replace(opts.prefix, "");
  250. processValue = processValue.replace(opts.suffix, "");
  251. processValue = processValue.replace(new RegExp($.inputmask.escapeRegex(opts.groupSeparator), "g"), "");
  252. processValue = processValue.replace($.inputmask.escapeRegex(opts.radixPoint), ".");
  253. //handle negation symbol
  254. processValue = processValue.replace(new RegExp("^" + $.inputmask.escapeRegex(opts.negationSymbol.front)), "-");
  255. processValue = processValue.replace(new RegExp($.inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "");
  256. if (isFinite(processValue)) {
  257. if (isFinite(opts.max)) {
  258. isValid = parseFloat(processValue) <= parseFloat(opts.max);
  259. }
  260. }
  261. return isValid;
  262. },
  263. definitions: {
  264. '~': {
  265. validator: function (chrs, maskset, pos, strict, opts) {
  266. var isValid = opts.signHandler(chrs, maskset, pos, strict, opts);
  267. if (!isValid) {
  268. isValid = opts.radixHandler(chrs, maskset, pos, strict, opts);
  269. if (!isValid) {
  270. isValid = strict ? new RegExp("[0-9" + $.inputmask.escapeRegex(opts.groupSeparator) + "]").test(chrs) : new RegExp("[0-9]").test(chrs);
  271. if (isValid === true) {
  272. isValid = opts.leadingZeroHandler(chrs, maskset, pos, strict, opts);
  273. if (isValid === true) {
  274. //handle overwrite when fixed precision
  275. var radixPosition = $.inArray(opts.radixPoint, maskset.buffer);
  276. if (opts.digitsOptional === false && pos > radixPosition && !strict) {
  277. isValid = { "pos": pos, "remove": pos };
  278. } else isValid = { pos: pos };
  279. }
  280. }
  281. }
  282. }
  283. return isValid;
  284. },
  285. cardinality: 1,
  286. prevalidator: null
  287. },
  288. '+': {
  289. validator: function (chrs, maskset, pos, strict, opts) {
  290. var isValid = opts.signHandler(chrs, maskset, pos, strict, opts), nbl;
  291. if (!isValid && ((strict && opts.allowMinus && chrs === opts.negationSymbol.front) || (opts.allowMinus && chrs == "-") || (opts.allowPlus && chrs == "+"))) {
  292. if (chrs == "-") {
  293. isValid = { "pos": pos, "c": chrs === "-" ? opts.negationSymbol.front : "+", "caret": pos + 1, "insert": { "pos": maskset["buffer"].length, "c": opts.negationSymbol.back } };
  294. } else {
  295. isValid = true;
  296. }
  297. }
  298. return isValid;
  299. },
  300. cardinality: 1,
  301. prevalidator: null,
  302. placeholder: ''
  303. },
  304. '-': {
  305. validator: function (chrs, maskset, pos, strict, opts) {
  306. var isValid = opts.signHandler(chrs, maskset, pos, strict, opts);
  307. if (!isValid && strict && opts.allowMinus && chrs === opts.negationSymbol.back) {
  308. isValid = true;
  309. }
  310. return isValid;
  311. },
  312. cardinality: 1,
  313. prevalidator: null,
  314. placeholder: ''
  315. },
  316. ':': {
  317. validator: function (chrs, maskset, pos, strict, opts) {
  318. var isValid = opts.signHandler(chrs, maskset, pos, strict, opts);
  319. if (!isValid) {
  320. var radix = "[" + $.inputmask.escapeRegex(opts.radixPoint) + "]";
  321. isValid = new RegExp(radix).test(chrs);
  322. if (isValid && maskset["validPositions"][pos] && maskset["validPositions"][pos]["match"].placeholder == opts.radixPoint) {
  323. isValid = { "caret": pos + 1 };
  324. }
  325. }
  326. return isValid;
  327. },
  328. cardinality: 1,
  329. prevalidator: null,
  330. placeholder: function (opts) { return opts.radixPoint; }
  331. }
  332. },
  333. insertMode: true,
  334. autoUnmask: false,
  335. onUnMask: function (maskedValue, unmaskedValue, opts) {
  336. var processValue = maskedValue.replace(opts.prefix, "");
  337. processValue = processValue.replace(opts.suffix, "");
  338. processValue = processValue.replace(new RegExp($.inputmask.escapeRegex(opts.groupSeparator), "g"), "");
  339. //processValue = processValue.replace($.inputmask.escapeRegex.call(this, opts.radixPoint), ".");
  340. return processValue;
  341. },
  342. isComplete: function (buffer, opts) {
  343. var maskedValue = buffer.join(''), bufClone = buffer.slice();
  344. //verify separator positions
  345. opts.postFormat(bufClone, 0, true, opts);
  346. if (bufClone.join('') != maskedValue) return false;
  347. var processValue = maskedValue.replace(opts.prefix, "");
  348. processValue = processValue.replace(opts.suffix, "");
  349. processValue = processValue.replace(new RegExp($.inputmask.escapeRegex(opts.groupSeparator), "g"), "");
  350. if (opts.radixPoint === ",") processValue = processValue.replace($.inputmask.escapeRegex(opts.radixPoint), ".");
  351. return isFinite(processValue);
  352. },
  353. onBeforeMask: function (initialValue, opts) {
  354. if (opts.radixPoint != "" && isFinite(initialValue)) {
  355. initialValue = initialValue.toString().replace(".", opts.radixPoint);
  356. } else {
  357. var kommaMatches = initialValue.match(/,/g);
  358. var dotMatches = initialValue.match(/\./g);
  359. if (dotMatches && kommaMatches) {
  360. if (dotMatches.length > kommaMatches.length) {
  361. initialValue = initialValue.replace(/\./g, "");
  362. initialValue = initialValue.replace(",", opts.radixPoint);
  363. } else if (kommaMatches.length > dotMatches.length) {
  364. initialValue = initialValue.replace(/,/g, "");
  365. initialValue = initialValue.replace(".", opts.radixPoint);
  366. } else { //equal
  367. initialValue = initialValue.indexOf(".") < initialValue.indexOf(",") ? initialValue.replace(/\./g, "") : initialValue = initialValue.replace(/,/g, "");
  368. }
  369. } else {
  370. initialValue = initialValue.replace(new RegExp($.inputmask.escapeRegex(opts.groupSeparator), "g"), "");
  371. }
  372. }
  373. if (opts.digits == 0) {
  374. if (initialValue.indexOf(".") != -1) {
  375. initialValue = initialValue.substring(0, initialValue.indexOf("."));
  376. } else if (initialValue.indexOf(",") != -1) {
  377. initialValue = initialValue.substring(0, initialValue.indexOf(","));
  378. }
  379. }
  380. return initialValue;
  381. },
  382. canClearPosition: function (maskset, position, lvp, strict, opts) {
  383. var positionInput = maskset["validPositions"][position].input,
  384. canClear = (positionInput != opts.radixPoint && isFinite(positionInput)) ||
  385. position == lvp ||
  386. positionInput == opts.groupSeparator ||
  387. positionInput == opts.negationSymbol.front ||
  388. positionInput == opts.negationSymbol.back,
  389. posOffset = 0;
  390. if (canClear && isFinite(positionInput)) {
  391. var matchRslt = maskset["buffer"].join('').substr(0, position).match(opts.regex.integerNPart(opts));
  392. if (!strict) {
  393. var pos = position + 1, isNull = matchRslt == null || parseInt(matchRslt["0"].replace(new RegExp($.inputmask.escapeRegex(opts.groupSeparator), "g"), "")) == 0;
  394. if (isNull) {
  395. while (maskset["validPositions"][pos] && (maskset["validPositions"][pos].input == opts.groupSeparator || maskset["validPositions"][pos].input == "0")) {
  396. delete maskset["validPositions"][pos];
  397. pos++;
  398. }
  399. }
  400. }
  401. var buffer = [];
  402. //build new buffer from validPositions
  403. for (var vp in maskset.validPositions) {
  404. buffer.push(maskset.validPositions[vp].input);
  405. }
  406. matchRslt = buffer.join('').match(opts.regex.integerNPart(opts));
  407. var radixPosition = $.inArray(opts.radixPoint, maskset.buffer);
  408. if (matchRslt && (radixPosition == -1 || position <= radixPosition)) {
  409. if (matchRslt["0"].indexOf("0") == 0) {
  410. canClear = matchRslt.index != position || radixPosition == -1;
  411. } else {
  412. var intPart = parseInt(matchRslt["0"].replace(new RegExp($.inputmask.escapeRegex(opts.groupSeparator), "g"), ""));
  413. if (radixPosition != -1 && intPart < 10 && opts.placeholder.charAt(0) == "0") {
  414. maskset["validPositions"][position].input = "0";
  415. maskset["p"] = opts.prefix.length + 1;
  416. canClear = false;
  417. }
  418. }
  419. }
  420. }
  421. return canClear;
  422. }
  423. },
  424. 'currency': {
  425. prefix: "$ ",
  426. groupSeparator: ",",
  427. alias: "numeric",
  428. placeholder: "0",
  429. autoGroup: true,
  430. digits: 2,
  431. digitsOptional: false,
  432. clearMaskOnLostFocus: false
  433. },
  434. 'decimal': {
  435. alias: "numeric"
  436. },
  437. 'integer': {
  438. alias: "numeric",
  439. digits: "0",
  440. radixPoint: ""
  441. }
  442. });
  443. return $.fn.inputmask;
  444. })(jQuery);