diff --git a/build/js/intlTelInput.js b/build/js/intlTelInput.js index b97f9c14f..4058585b9 100644 --- a/build/js/intlTelInput.js +++ b/build/js/intlTelInput.js @@ -1,5 +1,5 @@ /* - * International Telephone Input v9.0.2 + * International Telephone Input v9.0.3 * https://github.com/jackocnr/intl-tel-input.git * Licensed under the MIT license */ @@ -1057,7 +1057,7 @@ } }; // version - $.fn[pluginName].version = "9.0.2"; + $.fn[pluginName].version = "9.0.3"; // Tell JSHint to ignore this warning: "character may get silently deleted by one or more browsers" // jshint -W100 // Array of country objects for the flag dropdown. diff --git a/build/js/intlTelInput.min.js b/build/js/intlTelInput.min.js index 277980016..cc41b3232 100644 --- a/build/js/intlTelInput.min.js +++ b/build/js/intlTelInput.min.js @@ -1,6 +1,6 @@ /* - * International Telephone Input v9.0.2 + * International Telephone Input v9.0.3 * https://github.com/jackocnr/intl-tel-input.git * Licensed under the MIT license */ -!function(a){"function"==typeof define&&define.amd?define(["jquery"],function(b){a(b,window,document)}):"object"==typeof module&&module.exports?module.exports=a(require("jquery"),window,document):a(jQuery,window,document)}(function(a,b,c,d){"use strict";function e(b,c){this.a=a(b),c&&(a.extend(c,c,{a:c.allowDropdown,b:c.autoHideDialCode,c:c.autoPlaceholder,c2:c.customPlaceholder,d:c.dropdownContainer,e:c.excludeCountries,f:c.formatOnInit,g:c.geoIpLookup,h:c.initialCountry,i:c.nationalMode,j:c.numberType,k:c.onlyCountries,l:c.preferredCountries,m:c.separateDialCode,n:c.utilsScript})),this.b=a.extend({},h,c),this.ns="."+f+g++,this.d=Boolean(b.setSelectionRange),this.e=Boolean(a(b).attr("placeholder"))}var f="intlTelInput",g=1,h={a:!0,b:!0,c:!0,c2:null,d:"",e:[],f:!0,g:null,h:"",i:!0,j:"MOBILE",k:[],l:["us","gb"],m:!1,n:""},i={b:38,c:40,d:13,e:27,f:43,A:65,Z:90,j:32,k:9};a(b).on("load",function(){a.fn[f].windowLoaded=!0}),e.prototype={_a:function(){return this.b.i&&(this.b.b=!1),this.b.m&&(this.b.b=this.b.i=!1,this.b.a=!0),this.g=/Android.+Mobile|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),this.g&&(a("body").addClass("iti-mobile"),this.b.d||(this.b.d="body")),this.h=new a.Deferred,this.i=new a.Deferred,this._b(),this._f(),this._h(),this._i(),this._i2(),[this.h,this.i]},_b:function(){this._d(),this._d2(),this._e()},_c:function(a,b,c){b in this.q||(this.q[b]=[]);var d=c||0;this.q[b][d]=a},_c2:function(b,c){var d;for(d=0;d",{"class":b})),this.k=a("
",{"class":"flag-container"}).insertBefore(this.a);var c=a("
",{"class":"selected-flag"});c.appendTo(this.k),this.l=a("
",{"class":"iti-flag"}).appendTo(c),this.b.m&&(this.t=a("
",{"class":"selected-dial-code"}).appendTo(c)),this.b.a?(c.attr("tabindex","0"),a("
",{"class":"iti-arrow"}).appendTo(c),this.m=a("
    ",{"class":"country-list hide"}),this.r.length&&(this._g(this.r,"preferred"),a("
  • ",{"class":"divider"}).appendTo(this.m)),this._g(this.p,""),this.o=this.m.children(".country"),this.b.d?this.dropdown=a("
    ",{"class":"intl-tel-input iti-container"}).append(this.m):this.m.appendTo(this.k)):this.o=a()},_g:function(a,b){for(var c="",d=0;d",c+="
    ",c+=""+e.name+"",c+="+"+e.dialCode+"",c+="
  • "}this.m.append(c)},_h:function(){var a=this.a.val();this._af(a)?this._v(a,!0):"auto"!==this.b.h&&(this.b.h?this._z(this.b.h,!0):(this.j=this.r.length?this.r[0].iso2:this.p[0].iso2,a||this._z(this.j,!0)),a||this.b.i||this.b.b||this.b.m||this.a.val("+"+this.s.dialCode)),a&&this._u(a,this.b.f)},_i:function(){this._j(),this.b.b&&this._l(),this.b.a&&this._i1()},_i1:function(){var a=this,b=this.a.closest("label");b.length&&b.on("click"+this.ns,function(b){a.m.hasClass("hide")?a.a.focus():b.preventDefault()});var c=this.l.parent();c.on("click"+this.ns,function(){!a.m.hasClass("hide")||a.a.prop("disabled")||a.a.prop("readonly")||a._n()}),this.k.on("keydown"+a.ns,function(b){var c=a.m.hasClass("hide");!c||b.which!=i.b&&b.which!=i.c&&b.which!=i.j&&b.which!=i.d||(b.preventDefault(),b.stopPropagation(),a._n()),b.which==i.k&&a._ac()})},_i2:function(){var c=this;this.b.n?a.fn[f].windowLoaded?a.fn[f].loadUtils(this.b.n,this.i):a(b).on("load",function(){a.fn[f].loadUtils(c.b.n,c.i)}):this.i.resolve(),"auto"===this.b.h?this._i3():this.h.resolve()},_i3:function(){a.fn[f].autoCountry?this.handleAutoCountry():a.fn[f].startedLoadingAutoCountry||(a.fn[f].startedLoadingAutoCountry=!0,"function"==typeof this.b.g&&this.b.g(function(b){a.fn[f].autoCountry=b.toLowerCase(),setTimeout(function(){a(".intl-tel-input input").intlTelInput("handleAutoCountry")})}))},_j:function(){var a=this;this.a.on("keyup"+this.ns,function(){a._v(a.a.val())}),this.a.on("cut"+this.ns+" paste"+this.ns,function(){setTimeout(function(){a._v(a.a.val())})})},_j2:function(a){var b=this.a.attr("maxlength");return b&&a.length>b?a.substr(0,b):a},_l:function(){var b=this;this.a.on("mousedown"+this.ns,function(a){b.a.is(":focus")||b.a.val()||(a.preventDefault(),b.a.focus())}),this.a.on("focus"+this.ns,function(){b.a.val()||b.a.prop("readonly")||!b.s.dialCode||(b.a.val("+"+b.s.dialCode),b.a.one("keypress.plus"+b.ns,function(a){a.which==i.f&&b.a.val("")}),setTimeout(function(){var a=b.a[0];if(b.d){var c=b.a.val().length;a.setSelectionRange(c,c)}}))});var c=this.a.prop("form");c&&a(c).on("submit"+this.ns,function(){b._removeEmptyDialCode()}),this.a.on("blur"+this.ns,function(){b._removeEmptyDialCode()})},_removeEmptyDialCode:function(){var a=this.a.val(),b="+"==a.charAt(0);if(b){var c=this._m(a);c&&this.s.dialCode!=c||this.a.val("")}this.a.off("keypress.plus"+this.ns)},_m:function(a){return a.replace(/\D/g,"")},_n:function(){this._o();var a=this.m.children(".active");a.length&&(this._x(a),this._ad(a)),this._p(),this.l.children(".iti-arrow").addClass("up")},_o:function(){var c=this;if(this.b.d&&this.dropdown.appendTo(this.b.d),this.n=this.m.removeClass("hide").outerHeight(),!this.g){var d=this.a.offset(),e=d.top,f=a(b).scrollTop(),g=e+this.a.outerHeight()+this.nf;if(this.m.toggleClass("dropup",!g&&h),this.b.d){var i=!g&&h?0:this.a.innerHeight();this.dropdown.css({top:e+i,left:d.left}),a(b).on("scroll"+this.ns,function(){c._ac()})}}},_p:function(){var b=this;this.m.on("mouseover"+this.ns,".country",function(){b._x(a(this))}),this.m.on("click"+this.ns,".country",function(){b._ab(a(this))});var d=!0;a("html").on("click"+this.ns,function(){d||b._ac(),d=!1});var e="",f=null;a(c).on("keydown"+this.ns,function(a){a.preventDefault(),a.which==i.b||a.which==i.c?b._q(a.which):a.which==i.d?b._r():a.which==i.e?b._ac():(a.which>=i.A&&a.which<=i.Z||a.which==i.j)&&(f&&clearTimeout(f),e+=String.fromCharCode(a.which),b._s(e),f=setTimeout(function(){e=""},1e3))})},_q:function(a){var b=this.m.children(".highlight").first(),c=a==i.b?b.prev():b.next();c.length&&(c.hasClass("divider")&&(c=a==i.b?c.prev():c.next()),this._x(c),this._ad(c))},_r:function(){var a=this.m.children(".highlight").first();a.length&&this._ab(a)},_s:function(a){for(var b=0;b=4},_x:function(a){this.o.removeClass("highlight"),a.addClass("highlight")},_y:function(a,b,c){for(var d=b?j:this.p,e=0;eh)b&&(j-=k),c.scrollTop(j);else if(i>f){b&&(j+=k);var l=d-g;c.scrollTop(j-l)}},_ae:function(a,b){var c,d=this.a.val();if(a="+"+a,"+"==d.charAt(0)){var e=this._af(d);c=e?d.replace(e,a):a}else{if(this.b.i||this.b.m)return;if(d)c=a+d;else{if(!b&&this.b.b)return;c=a}}this.a.val(c)},_af:function(b){var c="";if("+"==b.charAt(0))for(var d="",e=0;e",{"class":b})),this.k=a("
    ",{"class":"flag-container"}).insertBefore(this.a);var c=a("
    ",{"class":"selected-flag"});c.appendTo(this.k),this.l=a("
    ",{"class":"iti-flag"}).appendTo(c),this.b.m&&(this.t=a("
    ",{"class":"selected-dial-code"}).appendTo(c)),this.b.a?(c.attr("tabindex","0"),a("
    ",{"class":"iti-arrow"}).appendTo(c),this.m=a("
      ",{"class":"country-list hide"}),this.r.length&&(this._g(this.r,"preferred"),a("
    • ",{"class":"divider"}).appendTo(this.m)),this._g(this.p,""),this.o=this.m.children(".country"),this.b.d?this.dropdown=a("
      ",{"class":"intl-tel-input iti-container"}).append(this.m):this.m.appendTo(this.k)):this.o=a()},_g:function(a,b){for(var c="",d=0;d",c+="
      ",c+=""+e.name+"",c+="+"+e.dialCode+"",c+="
    • "}this.m.append(c)},_h:function(){var a=this.a.val();this._af(a)?this._v(a,!0):"auto"!==this.b.h&&(this.b.h?this._z(this.b.h,!0):(this.j=this.r.length?this.r[0].iso2:this.p[0].iso2,a||this._z(this.j,!0)),a||this.b.i||this.b.b||this.b.m||this.a.val("+"+this.s.dialCode)),a&&this._u(a,this.b.f)},_i:function(){this._j(),this.b.b&&this._l(),this.b.a&&this._i1()},_i1:function(){var a=this,b=this.a.closest("label");b.length&&b.on("click"+this.ns,function(b){a.m.hasClass("hide")?a.a.focus():b.preventDefault()});var c=this.l.parent();c.on("click"+this.ns,function(){!a.m.hasClass("hide")||a.a.prop("disabled")||a.a.prop("readonly")||a._n()}),this.k.on("keydown"+a.ns,function(b){var c=a.m.hasClass("hide");!c||b.which!=i.b&&b.which!=i.c&&b.which!=i.j&&b.which!=i.d||(b.preventDefault(),b.stopPropagation(),a._n()),b.which==i.k&&a._ac()})},_i2:function(){var c=this;this.b.n?a.fn[f].windowLoaded?a.fn[f].loadUtils(this.b.n,this.i):a(b).on("load",function(){a.fn[f].loadUtils(c.b.n,c.i)}):this.i.resolve(),"auto"===this.b.h?this._i3():this.h.resolve()},_i3:function(){a.fn[f].autoCountry?this.handleAutoCountry():a.fn[f].startedLoadingAutoCountry||(a.fn[f].startedLoadingAutoCountry=!0,"function"==typeof this.b.g&&this.b.g(function(b){a.fn[f].autoCountry=b.toLowerCase(),setTimeout(function(){a(".intl-tel-input input").intlTelInput("handleAutoCountry")})}))},_j:function(){var a=this;this.a.on("keyup"+this.ns,function(){a._v(a.a.val())}),this.a.on("cut"+this.ns+" paste"+this.ns,function(){setTimeout(function(){a._v(a.a.val())})})},_j2:function(a){var b=this.a.attr("maxlength");return b&&a.length>b?a.substr(0,b):a},_l:function(){var b=this;this.a.on("mousedown"+this.ns,function(a){b.a.is(":focus")||b.a.val()||(a.preventDefault(),b.a.focus())}),this.a.on("focus"+this.ns,function(){b.a.val()||b.a.prop("readonly")||!b.s.dialCode||(b.a.val("+"+b.s.dialCode),b.a.one("keypress.plus"+b.ns,function(a){a.which==i.f&&b.a.val("")}),setTimeout(function(){var a=b.a[0];if(b.d){var c=b.a.val().length;a.setSelectionRange(c,c)}}))});var c=this.a.prop("form");c&&a(c).on("submit"+this.ns,function(){b._removeEmptyDialCode()}),this.a.on("blur"+this.ns,function(){b._removeEmptyDialCode()})},_removeEmptyDialCode:function(){var a=this.a.val(),b="+"==a.charAt(0);if(b){var c=this._m(a);c&&this.s.dialCode!=c||this.a.val("")}this.a.off("keypress.plus"+this.ns)},_m:function(a){return a.replace(/\D/g,"")},_n:function(){this._o();var a=this.m.children(".active");a.length&&(this._x(a),this._ad(a)),this._p(),this.l.children(".iti-arrow").addClass("up")},_o:function(){var c=this;if(this.b.d&&this.dropdown.appendTo(this.b.d),this.n=this.m.removeClass("hide").outerHeight(),!this.g){var d=this.a.offset(),e=d.top,f=a(b).scrollTop(),g=e+this.a.outerHeight()+this.nf;if(this.m.toggleClass("dropup",!g&&h),this.b.d){var i=!g&&h?0:this.a.innerHeight();this.dropdown.css({top:e+i,left:d.left}),a(b).on("scroll"+this.ns,function(){c._ac()})}}},_p:function(){var b=this;this.m.on("mouseover"+this.ns,".country",function(){b._x(a(this))}),this.m.on("click"+this.ns,".country",function(){b._ab(a(this))});var d=!0;a("html").on("click"+this.ns,function(){d||b._ac(),d=!1});var e="",f=null;a(c).on("keydown"+this.ns,function(a){a.preventDefault(),a.which==i.b||a.which==i.c?b._q(a.which):a.which==i.d?b._r():a.which==i.e?b._ac():(a.which>=i.A&&a.which<=i.Z||a.which==i.j)&&(f&&clearTimeout(f),e+=String.fromCharCode(a.which),b._s(e),f=setTimeout(function(){e=""},1e3))})},_q:function(a){var b=this.m.children(".highlight").first(),c=a==i.b?b.prev():b.next();c.length&&(c.hasClass("divider")&&(c=a==i.b?c.prev():c.next()),this._x(c),this._ad(c))},_r:function(){var a=this.m.children(".highlight").first();a.length&&this._ab(a)},_s:function(a){for(var b=0;b=4},_x:function(a){this.o.removeClass("highlight"),a.addClass("highlight")},_y:function(a,b,c){for(var d=b?j:this.p,e=0;eh)b&&(j-=k),c.scrollTop(j);else if(i>f){b&&(j+=k);var l=d-g;c.scrollTop(j-l)}},_ae:function(a,b){var c,d=this.a.val();if(a="+"+a,"+"==d.charAt(0)){var e=this._af(d);c=e?d.replace(e,a):a}else{if(this.b.i||this.b.m)return;if(d)c=a+d;else{if(!b&&this.b.b)return;c=a}}this.a.val(c)},_af:function(b){var c="";if("+"==b.charAt(0))for(var d="",e=0;e