diff --git a/build/js/intlTelInput.js b/build/js/intlTelInput.js index b1ae36665..ac4441cd4 100644 --- a/build/js/intlTelInput.js +++ b/build/js/intlTelInput.js @@ -1,5 +1,5 @@ /* - * International Telephone Input v8.4.6 + * International Telephone Input v8.4.7 * https://github.com/jackocnr/intl-tel-input.git * Licensed under the MIT license */ @@ -1053,7 +1053,7 @@ } }; // version - $.fn[pluginName].version = "8.4.6"; + $.fn[pluginName].version = "8.4.7"; // 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 a80e74a81..f20d17c32 100644 --- a/build/js/intlTelInput.min.js +++ b/build/js/intlTelInput.min.js @@ -1,6 +1,6 @@ /* - * International Telephone Input v8.4.6 + * International Telephone Input v8.4.7 * 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).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).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(){var c=b.Cookies?Cookies.get("itiAutoCountry"):"";c&&(a.fn[f].autoCountry=c),a.fn[f].autoCountry?this.handleAutoCountry():a.fn[f].startedLoadingAutoCountry||(a.fn[f].startedLoadingAutoCountry=!0,"function"==typeof this.b.g&&this.b.g(function(c){a.fn[f].autoCountry=c.toLowerCase(),b.Cookies&&Cookies.set("itiAutoCountry",a.fn[f].autoCountry,{path:"/"}),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+" keyup"+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 a=this;this.a.on("mousedown"+this.ns,function(b){a.a.is(":focus")||a.a.val()||(b.preventDefault(),a.a.focus())}),this.a.on("focus"+this.ns,function(){a.a.val()||a.a.prop("readonly")||!a.s.dialCode||(a.a.val("+"+a.s.dialCode),a.a.one("keypress.plus"+a.ns,function(b){b.which==i.f&&a.a.val("")}),setTimeout(function(){var b=a.a[0];if(a.d){var c=a.a.val().length;b.setSelectionRange(c,c)}}))}),this.a.on("blur"+this.ns,function(){var b=a.a.val(),c="+"==b.charAt(0);if(c){var d=a._m(b);d&&a.s.dialCode!=d||a.a.val("")}a.a.off("keypress.plus"+a.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).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(){var c=b.Cookies?Cookies.get("itiAutoCountry"):"";c&&(a.fn[f].autoCountry=c),a.fn[f].autoCountry?this.handleAutoCountry():a.fn[f].startedLoadingAutoCountry||(a.fn[f].startedLoadingAutoCountry=!0,"function"==typeof this.b.g&&this.b.g(function(c){a.fn[f].autoCountry=c.toLowerCase(),b.Cookies&&Cookies.set("itiAutoCountry",a.fn[f].autoCountry,{path:"/"}),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+" keyup"+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 a=this;this.a.on("mousedown"+this.ns,function(b){a.a.is(":focus")||a.a.val()||(b.preventDefault(),a.a.focus())}),this.a.on("focus"+this.ns,function(){a.a.val()||a.a.prop("readonly")||!a.s.dialCode||(a.a.val("+"+a.s.dialCode),a.a.one("keypress.plus"+a.ns,function(b){b.which==i.f&&a.a.val("")}),setTimeout(function(){var b=a.a[0];if(a.d){var c=a.a.val().length;b.setSelectionRange(c,c)}}))}),this.a.on("blur"+this.ns,function(){var b=a.a.val(),c="+"==b.charAt(0);if(c){var d=a._m(b);d&&a.s.dialCode!=d||a.a.val("")}a.a.off("keypress.plus"+a.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