inputmask.phone.extensions.min.js 1.3 KB

1234567891011121314151617181920
  1. /*!
  2. * inputmask.phone.extensions.min.js
  3. * https://github.com/RobinHerbots/jquery.inputmask
  4. * Copyright (c) 2010 - 2016 Robin Herbots
  5. * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
  6. * Version: 3.3.2-80
  7. */
  8. /*
  9. Input Mask plugin extensions
  10. http://github.com/RobinHerbots/jquery.inputmask
  11. Copyright (c) 2010 - Robin Herbots
  12. Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
  13. Version: 0.0.0-dev
  14. Phone extension.
  15. */
  16. !function(a){"function"==typeof define&&define.amd?define(["inputmask.dependencyLib","inputmask"],a):"object"==typeof exports?module.exports=a(require("./inputmask.dependencyLib.jquery"),require("./inputmask")):a(window.dependencyLib||jQuery,window.Inputmask)}(function(a,b){return b.extendAliases({abstractphone:{countrycode:"",phoneCodes:[],mask:function(a){a.definitions={"#":a.definitions[9]};var b=a.phoneCodes.sort(function(a,b){var c=(a.mask||a).replace(/#/g,"0").replace(/[\+\(\)#-]/g,""),d=(b.mask||b).replace(/#/g,"0").replace(/[\+\(\)#-]/g,"");return c<d?-1:1});return b},keepStatic:!0,onBeforeMask:function(a,b){var c=a.replace(/^0{1,2}/,"").replace(/[\s]/g,"");return(c.indexOf(b.countrycode)>1||c.indexOf(b.countrycode)===-1)&&(c="+"+b.countrycode+c),c},onUnMask:function(a,b,c){
  17. //implement me
  18. return b}}}),b});