jquery.inputmask.min.js 1.7 KB

123456789
  1. /*!
  2. * jquery.inputmask.min.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.25
  7. */
  8. !function(t){"function"==typeof define&&define.amd?define(["jquery","./inputmask"],t):"object"==typeof exports?module.exports=t(require("jquery"),require("./inputmask")):t(jQuery,window.Inputmask)}(function(a,s){return void 0===a.fn.inputmask&&(a.fn.inputmask=function(t,e){var i,n=this[0];if(void 0===e&&(e={}),"string"==typeof t)switch(t){case"unmaskedvalue":return n&&n.inputmask?n.inputmask.unmaskedvalue():a(n).val();case"remove":return this.each(function(){this.inputmask&&this.inputmask.remove()});case"getemptymask":return n&&n.inputmask?n.inputmask.getemptymask():"";case"hasMaskedValue":return!(!n||!n.inputmask)&&n.inputmask.hasMaskedValue();case"isComplete":return!n||!n.inputmask||n.inputmask.isComplete();case"getmetadata":return n&&n.inputmask?n.inputmask.getmetadata():void 0;case"setvalue":s.setValue(n,e);break;case"option":if("string"!=typeof e)return this.each(function(){if(void 0!==this.inputmask)return this.inputmask.option(e)});if(n&&void 0!==n.inputmask)return n.inputmask.option(e);break;default:return e.alias=t,i=new s(e),this.each(function(){i.mask(this)})}else{if(Array.isArray(t))return e.alias=t,i=new s(e),this.each(function(){i.mask(this)});if("object"==typeof t)return i=new s(t),void 0===t.mask&&void 0===t.alias?this.each(function(){if(void 0!==this.inputmask)return this.inputmask.option(t);i.mask(this)}):this.each(function(){i.mask(this)});if(void 0===t)return this.each(function(){(i=new s(e)).mask(this)})}}),a.fn.inputmask});