intl-tel-input 18.0.0 → 18.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -8
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/intlTelInput-jquery.js +2 -2
- package/build/js/intlTelInput-jquery.min.js +2 -2
- package/build/js/intlTelInput.js +2 -2
- package/build/js/intlTelInput.min.js +2 -2
- package/composer.json +1 -1
- package/demo.html +4 -4
- package/demo_rtl.html +0 -20
- package/examples/gen/country-sync.html +6 -6
- package/examples/gen/default-country-ip.html +17 -11
- package/examples/gen/display-number.html +5 -5
- package/examples/gen/hidden-input.html +5 -5
- package/examples/gen/init-promise.html +5 -5
- package/examples/gen/is-valid-number.html +6 -6
- package/examples/gen/js/countrySync.js +1 -1
- package/examples/gen/js/defaultCountryIp.js +5 -5
- package/examples/gen/js/displayNumber.js +1 -1
- package/examples/gen/js/hiddenInput.js +1 -1
- package/examples/gen/js/initPromise.js +1 -1
- package/examples/gen/js/isValidNumber.js +1 -1
- package/examples/gen/js/modifyCountryData.js +1 -1
- package/examples/gen/js/multipleInstances.js +2 -2
- package/examples/gen/js/nationalMode.js +1 -1
- package/examples/gen/js/onlyCountriesEurope.js +1 -1
- package/examples/gen/modify-country-data.html +5 -5
- package/examples/gen/multiple-instances.html +6 -6
- package/examples/gen/national-mode.html +5 -5
- package/examples/gen/only-countries-europe.html +7 -7
- package/examples/js/defaultCountryIp.js.ejs +4 -4
- package/examples/partials/defaultCountryIp.html +4 -1
- package/grunt/template.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# International Telephone Input [](https://app.travis-ci.com/jackocnr/intl-tel-input) <img src="https://img.shields.io/github/package-json/v/jackocnr/intl-tel-input.svg" /> <img src="https://img.shields.io/npm/dm/intl-tel-input.svg" />
|
|
2
2
|
A JavaScript plugin for entering and validating international telephone numbers. It adds a flag dropdown to any input, detects the user's country, displays a relevant placeholder and provides formatting/validation methods.
|
|
3
3
|
|
|
4
|
-
<img src="https://raw.github.com/jackocnr/intl-tel-input/master/screenshots/vanilla.png" width="
|
|
5
|
-
|
|
4
|
+
<img src="https://raw.github.com/jackocnr/intl-tel-input/master/screenshots/vanilla.png" alt="Screenshot" width="424px" style="max-width: 100%" />
|
|
5
|
+
|
|
6
6
|
If you like it, please consider making a donation, which you can do from [the demo page](http://intl-tel-input.com).
|
|
7
7
|
|
|
8
8
|
## Sponsored by
|
|
@@ -167,16 +167,15 @@ Here is an example using the [ip-api.com](https://ip-api.com/docs/api:json) serv
|
|
|
167
167
|
```js
|
|
168
168
|
intlTelInput(input, {
|
|
169
169
|
initialCountry: "auto",
|
|
170
|
-
geoIpLookup: callback
|
|
170
|
+
geoIpLookup: function(callback) {
|
|
171
171
|
fetch("http://ip-api.com/json")
|
|
172
|
-
.then(res
|
|
173
|
-
.then(data
|
|
174
|
-
.catch(()
|
|
172
|
+
.then(function(res) { return res.json(); })
|
|
173
|
+
.then(function(data) { callback(data.countryCode); })
|
|
174
|
+
.catch(function() { callback("us"); });
|
|
175
175
|
}
|
|
176
176
|
})
|
|
177
177
|
```
|
|
178
|
-
_Note that the callback must still be called in the event of an error, Hence the use of `catch()` in this example._
|
|
179
|
-
_Tip: store the result in a cookie to avoid repeat lookups!_
|
|
178
|
+
_Note that the callback must still be called in the event of an error, Hence the use of `catch()` in this example. Also `fetch` is not supported in IE11 and so requires [polyfilling](https://github.com/github/fetch) along with `Promise`. Tip: store the result in a cookie to avoid repeat lookups!_
|
|
180
179
|
|
|
181
180
|
**hiddenInput**
|
|
182
181
|
Type: `String` Default: `""`
|
package/build/js/data.js
CHANGED
package/build/js/data.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* International Telephone Input v18.0.
|
|
2
|
+
* International Telephone Input v18.0.2
|
|
3
3
|
* https://github.com/jackocnr/intl-tel-input.git
|
|
4
4
|
* Licensed under the MIT license
|
|
5
5
|
*/
|
|
@@ -1393,7 +1393,7 @@
|
|
|
1393
1393
|
// default options
|
|
1394
1394
|
intlTelInputGlobals.defaults = defaults;
|
|
1395
1395
|
// version
|
|
1396
|
-
intlTelInputGlobals.version = "18.0.
|
|
1396
|
+
intlTelInputGlobals.version = "18.0.2";
|
|
1397
1397
|
var pluginName = "intlTelInput";
|
|
1398
1398
|
// A really lightweight plugin wrapper around the constructor,
|
|
1399
1399
|
// preventing against multiple instantiations
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* International Telephone Input v18.0.
|
|
2
|
+
* International Telephone Input v18.0.2
|
|
3
3
|
* https://github.com/jackocnr/intl-tel-input.git
|
|
4
4
|
* Licensed under the MIT license
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
!function(a){"object"==typeof module&&module.exports?module.exports=a(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],function(b){a(b)}):a(jQuery)}(function(a,b){"use strict";function c(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?Object(arguments[b]):{},e=Object.keys(c);"function"==typeof Object.getOwnPropertySymbols&&e.push.apply(e,Object.getOwnPropertySymbols(c).filter(function(a){return Object.getOwnPropertyDescriptor(c,a).enumerable})),e.forEach(function(b){d(a,b,c[b])})}return a}function d(a,b,c){return b=h(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,h(d.key),d)}}function g(a,b,c){return b&&f(a.prototype,b),c&&f(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function h(a){var b=i(a,"string");return"symbol"==typeof b?b:String(b)}function i(a,c){if("object"!=typeof a||null===a)return a;var d=a[Symbol.toPrimitive];if(d!==b){var e=d.call(a,c||"default");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===c?String:Number)(a)}for(var j=[["Afghanistan (افغانستان)","af","93"],["Albania (Shqipëri)","al","355"],["Algeria (الجزائر)","dz","213"],["American Samoa","as","1",5,["684"]],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1",6,["264"]],["Antigua and Barbuda","ag","1",7,["268"]],["Argentina","ar","54"],["Armenia (Հայաստան)","am","374"],["Aruba","aw","297"],["Ascension Island","ac","247"],["Australia","au","61",0],["Austria (Österreich)","at","43"],["Azerbaijan (Azərbaycan)","az","994"],["Bahamas","bs","1",8,["242"]],["Bahrain (البحرين)","bh","973"],["Bangladesh (বাংলাদেশ)","bd","880"],["Barbados","bb","1",9,["246"]],["Belarus (Беларусь)","by","375"],["Belgium (België)","be","32"],["Belize","bz","501"],["Benin (Bénin)","bj","229"],["Bermuda","bm","1",10,["441"]],["Bhutan (འབྲུག)","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina (Босна и Херцеговина)","ba","387"],["Botswana","bw","267"],["Brazil (Brasil)","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1",11,["284"]],["Brunei","bn","673"],["Bulgaria (България)","bg","359"],["Burkina Faso","bf","226"],["Burundi (Uburundi)","bi","257"],["Cambodia (កម្ពុជា)","kh","855"],["Cameroon (Cameroun)","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","289","306","343","365","367","368","387","403","416","418","431","437","438","450","474","506","514","519","548","579","581","584","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)","cv","238"],["Caribbean Netherlands","bq","599",1,["3","4","7"]],["Cayman Islands","ky","1",12,["345"]],["Central African Republic (République centrafricaine)","cf","236"],["Chad (Tchad)","td","235"],["Chile","cl","56"],["China (中国)","cn","86"],["Christmas Island","cx","61",2,["89164"]],["Cocos (Keeling) Islands","cc","61",1,["89162"]],["Colombia","co","57"],["Comoros (جزر القمر)","km","269"],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)","cd","243"],["Congo (Republic) (Congo-Brazzaville)","cg","242"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia (Hrvatska)","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus (Κύπρος)","cy","357"],["Czech Republic (Česká republika)","cz","420"],["Denmark (Danmark)","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1",13,["767"]],["Dominican Republic (República Dominicana)","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt (مصر)","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea (Guinea Ecuatorial)","gq","240"],["Eritrea","er","291"],["Estonia (Eesti)","ee","372"],["Eswatini","sz","268"],["Ethiopia","et","251"],["Falkland Islands (Islas Malvinas)","fk","500"],["Faroe Islands (Føroyar)","fo","298"],["Fiji","fj","679"],["Finland (Suomi)","fi","358",0],["France","fr","33"],["French Guiana (Guyane française)","gf","594"],["French Polynesia (Polynésie française)","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia (საქართველო)","ge","995"],["Germany (Deutschland)","de","49"],["Ghana (Gaana)","gh","233"],["Gibraltar","gi","350"],["Greece (Ελλάδα)","gr","30"],["Greenland (Kalaallit Nunaat)","gl","299"],["Grenada","gd","1",14,["473"]],["Guadeloupe","gp","590",0],["Guam","gu","1",15,["671"]],["Guatemala","gt","502"],["Guernsey","gg","44",1,["1481","7781","7839","7911"]],["Guinea (Guinée)","gn","224"],["Guinea-Bissau (Guiné Bissau)","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong (香港)","hk","852"],["Hungary (Magyarország)","hu","36"],["Iceland (Ísland)","is","354"],["India (भारत)","in","91"],["Indonesia","id","62"],["Iran (ایران)","ir","98"],["Iraq (العراق)","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2,["1624","74576","7524","7924","7624"]],["Israel (ישראל)","il","972"],["Italy (Italia)","it","39",0],["Jamaica","jm","1",4,["876","658"]],["Japan (日本)","jp","81"],["Jersey","je","44",3,["1534","7509","7700","7797","7829","7937"]],["Jordan (الأردن)","jo","962"],["Kazakhstan (Казахстан)","kz","7",1,["33","7"]],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait (الكويت)","kw","965"],["Kyrgyzstan (Кыргызстан)","kg","996"],["Laos (ລາວ)","la","856"],["Latvia (Latvija)","lv","371"],["Lebanon (لبنان)","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya (ليبيا)","ly","218"],["Liechtenstein","li","423"],["Lithuania (Lietuva)","lt","370"],["Luxembourg","lu","352"],["Macau (澳門)","mo","853"],["Madagascar (Madagasikara)","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania (موريتانيا)","mr","222"],["Mauritius (Moris)","mu","230"],["Mayotte","yt","262",1,["269","639"]],["Mexico (México)","mx","52"],["Micronesia","fm","691"],["Moldova (Republica Moldova)","md","373"],["Monaco","mc","377"],["Mongolia (Монгол)","mn","976"],["Montenegro (Crna Gora)","me","382"],["Montserrat","ms","1",16,["664"]],["Morocco (المغرب)","ma","212",0],["Mozambique (Moçambique)","mz","258"],["Myanmar (Burma) (မြန်မာ)","mm","95"],["Namibia (Namibië)","na","264"],["Nauru","nr","674"],["Nepal (नेपाल)","np","977"],["Netherlands (Nederland)","nl","31"],["New Caledonia (Nouvelle-Calédonie)","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger (Nijar)","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea (조선 민주주의 인민 공화국)","kp","850"],["North Macedonia (Северна Македонија)","mk","389"],["Northern Mariana Islands","mp","1",17,["670"]],["Norway (Norge)","no","47",0],["Oman (عُمان)","om","968"],["Pakistan (پاکستان)","pk","92"],["Palau","pw","680"],["Palestine (فلسطين)","ps","970"],["Panama (Panamá)","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru (Perú)","pe","51"],["Philippines","ph","63"],["Poland (Polska)","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar (قطر)","qa","974"],["Réunion (La Réunion)","re","262",0],["Romania (România)","ro","40"],["Russia (Россия)","ru","7",0],["Rwanda","rw","250"],["Saint Barthélemy","bl","590",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1",18,["869"]],["Saint Lucia","lc","1",19,["758"]],["Saint Martin (Saint-Martin (partie française))","mf","590",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)","pm","508"],["Saint Vincent and the Grenadines","vc","1",20,["784"]],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and Príncipe (São Tomé e Príncipe)","st","239"],["Saudi Arabia (المملكة العربية السعودية)","sa","966"],["Senegal (Sénégal)","sn","221"],["Serbia (Србија)","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1",21,["721"]],["Slovakia (Slovensko)","sk","421"],["Slovenia (Slovenija)","si","386"],["Solomon Islands","sb","677"],["Somalia (Soomaaliya)","so","252"],["South Africa","za","27"],["South Korea (대한민국)","kr","82"],["South Sudan (جنوب السودان)","ss","211"],["Spain (España)","es","34"],["Sri Lanka (ශ්රී ලංකාව)","lk","94"],["Sudan (السودان)","sd","249"],["Suriname","sr","597"],["Svalbard and Jan Mayen","sj","47",1,["79"]],["Sweden (Sverige)","se","46"],["Switzerland (Schweiz)","ch","41"],["Syria (سوريا)","sy","963"],["Taiwan (台灣)","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand (ไทย)","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad and Tobago","tt","1",22,["868"]],["Tunisia (تونس)","tn","216"],["Turkey (Türkiye)","tr","90"],["Turkmenistan","tm","993"],["Turks and Caicos Islands","tc","1",23,["649"]],["Tuvalu","tv","688"],["U.S. Virgin Islands","vi","1",24,["340"]],["Uganda","ug","256"],["Ukraine (Україна)","ua","380"],["United Arab Emirates (الإمارات العربية المتحدة)","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["Uzbekistan (Oʻzbekiston)","uz","998"],["Vanuatu","vu","678"],["Vatican City (Città del Vaticano)","va","39",1,["06698"]],["Venezuela","ve","58"],["Vietnam (Việt Nam)","vn","84"],["Wallis and Futuna (Wallis-et-Futuna)","wf","681"],["Western Sahara (الصحراء الغربية)","eh","212",1,["5288","5289"]],["Yemen (اليمن)","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1,["18"]]],k=0;k<j.length;k++){var l=j[k];j[k]={name:l[0],iso2:l[1],dialCode:l[2],priority:l[3]||0,areaCodes:l[4]||null}}var m={getInstance:function(a){var b=a.getAttribute("data-intl-tel-input-id");return window.intlTelInputGlobals.instances[b]},instances:{},documentReady:function(){return"complete"===document.readyState}};"object"==typeof window&&(window.intlTelInputGlobals=m);var n=0,o={allowDropdown:!0,autoInsertDialCode:!1,autoPlaceholder:"polite",customContainer:"",customPlaceholder:null,dropdownContainer:null,excludeCountries:[],formatOnDisplay:!0,geoIpLookup:null,hiddenInput:"",initialCountry:"",localizedCountries:null,nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",preferredCountries:["us","gb"],separateDialCode:!1,utilsScript:""},p=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],q=function(a,b){for(var c=Object.keys(a),d=0;d<c.length;d++)b(c[d],a[c[d]])},r=function(a){q(window.intlTelInputGlobals.instances,function(b){window.intlTelInputGlobals.instances[b][a]()})},s=function(){function a(b,c){var d=this;e(this,a),this.id=n++,this.a=b,this.b=null,this.c=null;var f=c||{};this.d={},q(o,function(a,b){d.d[a]=f.hasOwnProperty(a)?f[a]:b}),this.e=Boolean(b.getAttribute("placeholder"))}return g(a,[{key:"_init",value:function(){var a=this;if(this.d.nationalMode&&(this.d.autoInsertDialCode=!1),this.d.separateDialCode&&(this.d.autoInsertDialCode=!1),this.g=/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),this.g&&(document.body.classList.add("iti-mobile"),this.d.dropdownContainer||(this.d.dropdownContainer=document.body)),"undefined"!=typeof Promise){var b=new Promise(function(b,c){a.h=b,a.i=c}),c=new Promise(function(b,c){a.i0=b,a.i1=c});this.promise=Promise.all([b,c])}else this.h=this.i=function(){},this.i0=this.i1=function(){};this.s={},this._b(),this._f(),this._h(),this._i(),this._i3()}},{key:"_b",value:function(){this._d(),this._d2(),this._e(),this.d.localizedCountries&&this._d0(),(this.d.onlyCountries.length||this.d.localizedCountries)&&this.p.sort(this._d1)}},{key:"_c",value:function(a,c,d){c.length>this.countryCodeMaxLen&&(this.countryCodeMaxLen=c.length),this.q.hasOwnProperty(c)||(this.q[c]=[]);for(var e=0;e<this.q[c].length;e++)if(this.q[c][e]===a)return;var f=d!==b?d:this.q[c].length;this.q[c][f]=a}},{key:"_d",value:function(){if(this.d.onlyCountries.length){var a=this.d.onlyCountries.map(function(a){return a.toLowerCase()});this.p=j.filter(function(b){return a.indexOf(b.iso2)>-1})}else if(this.d.excludeCountries.length){var b=this.d.excludeCountries.map(function(a){return a.toLowerCase()});this.p=j.filter(function(a){return-1===b.indexOf(a.iso2)})}else this.p=j}},{key:"_d0",value:function(){for(var a=0;a<this.p.length;a++){var b=this.p[a].iso2.toLowerCase();this.d.localizedCountries.hasOwnProperty(b)&&(this.p[a].name=this.d.localizedCountries[b])}}},{key:"_d1",value:function(a,b){return a.name<b.name?-1:a.name>b.name?1:0}},{key:"_d2",value:function(){this.countryCodeMaxLen=0,this.dialCodes={},this.q={};for(var a=0;a<this.p.length;a++){var b=this.p[a];this.dialCodes[b.dialCode]||(this.dialCodes[b.dialCode]=!0),this._c(b.iso2,b.dialCode,b.priority)}for(var c=0;c<this.p.length;c++){var d=this.p[c];if(d.areaCodes)for(var e=this.q[d.dialCode][0],f=0;f<d.areaCodes.length;f++){for(var g=d.areaCodes[f],h=1;h<g.length;h++){var i=d.dialCode+g.substr(0,h);this._c(e,i),this._c(d.iso2,i)}this._c(d.iso2,d.dialCode+g)}}}},{key:"_e",value:function(){this.preferredCountries=[];for(var a=0;a<this.d.preferredCountries.length;a++){var b=this.d.preferredCountries[a].toLowerCase(),c=this._y(b,!1,!0);c&&this.preferredCountries.push(c)}}},{key:"_e2",value:function(a,b,c){var d=document.createElement(a);return b&&q(b,function(a,b){return d.setAttribute(a,b)}),c&&c.appendChild(d),d}},{key:"_f",value:function(){this.a.hasAttribute("autocomplete")||this.a.form&&this.a.form.hasAttribute("autocomplete")||this.a.setAttribute("autocomplete","off");var a="iti";this.d.allowDropdown&&(a+=" iti--allow-dropdown"),this.d.separateDialCode&&(a+=" iti--separate-dial-code"),this.d.customContainer&&(a+=" ",a+=this.d.customContainer);var b=this._e2("div",{"class":a});if(this.a.parentNode.insertBefore(b,this.a),this.k=this._e2("div",{"class":"iti__flag-container"},b),b.appendChild(this.a),this.selectedFlag=this._e2("div",c({"class":"iti__selected-flag"},this.d.allowDropdown&&{role:"combobox","aria-haspopup":"listbox","aria-controls":"iti-".concat(this.id,"__country-listbox"),"aria-owns":"iti-".concat(this.id,"__country-listbox"),"aria-expanded":"false","aria-label":"Telephone country code"}),this.k),this.l=this._e2("div",{"class":"iti__flag"},this.selectedFlag),this.a.disabled&&this.selectedFlag.setAttribute("aria-disabled","true"),this.d.separateDialCode&&(this.t=this._e2("div",{"class":"iti__selected-dial-code"},this.selectedFlag)),this.d.allowDropdown&&(this.a.disabled||this.selectedFlag.setAttribute("tabindex","0"),this.u=this._e2("div",{"class":"iti__arrow"},this.selectedFlag),this.m=this._e2("ul",{"class":"iti__country-list iti__hide",id:"iti-".concat(this.id,"__country-listbox"),role:"listbox","aria-label":"List of countries"}),this.preferredCountries.length&&(this._g(this.preferredCountries,"iti__preferred",!0),this._e2("li",{"class":"iti__divider",role:"separator","aria-disabled":"true"},this.m)),this._g(this.p,"iti__standard"),this.d.dropdownContainer?(this.dropdown=this._e2("div",{"class":"iti iti--container"}),this.dropdown.appendChild(this.m)):this.k.appendChild(this.m)),this.d.hiddenInput){var d=this.d.hiddenInput,e=this.a.getAttribute("name");if(e){var f=e.lastIndexOf("[");-1!==f&&(d="".concat(e.substr(0,f),"[").concat(d,"]"))}this.hiddenInput=this._e2("input",{type:"hidden",name:d}),b.appendChild(this.hiddenInput)}}},{key:"_g",value:function(a,b,c){for(var d="",e=0;e<a.length;e++){var f=a[e],g=c?"-preferred":"";d+="<li class='iti__country ".concat(b,"' tabIndex='-1' id='iti-").concat(this.id,"__item-").concat(f.iso2).concat(g,"' role='option' data-dial-code='").concat(f.dialCode,"' data-country-code='").concat(f.iso2,"' aria-selected='false'>"),d+="<div class='iti__flag-box'><div class='iti__flag iti__".concat(f.iso2,"'></div></div>"),d+="<span class='iti__country-name'>".concat(f.name,"</span>"),d+="<span class='iti__dial-code'>+".concat(f.dialCode,"</span>"),d+="</li>"}this.m.insertAdjacentHTML("beforeend",d)}},{key:"_h",value:function(){var a=this.a.getAttribute("value"),b=this.a.value,c=a&&"+"===a.charAt(0)&&(!b||"+"!==b.charAt(0)),d=c?a:b,e=this._5(d),f=this._w(d),g=this.d,h=g.initialCountry,i=g.autoInsertDialCode;e&&!f?this._v(d):"auto"!==h&&(h?this._z(h.toLowerCase()):e&&f?this._z("us"):(this.j=this.preferredCountries.length?this.preferredCountries[0].iso2:this.p[0].iso2,d||this._z(this.j)),!d&&i&&(this.a.value="+".concat(this.s.dialCode))),d&&this._u(d)}},{key:"_i",value:function(){this._j(),this.d.autoInsertDialCode&&this._l(),this.d.allowDropdown&&this._i2(),this.hiddenInput&&this._i0()}},{key:"_i0",value:function(){var a=this;this._a14=function(){a.hiddenInput.value=a.getNumber()},this.a.form&&this.a.form.addEventListener("submit",this._a14)}},{key:"_i1",value:function(){for(var a=this.a;a&&"LABEL"!==a.tagName;)a=a.parentNode;return a}},{key:"_i2",value:function(){var a=this;this._a9=function(b){a.m.classList.contains("iti__hide")?a.a.focus():b.preventDefault()};var b=this._i1();b&&b.addEventListener("click",this._a9),this._a10=function(){!a.m.classList.contains("iti__hide")||a.a.disabled||a.a.readOnly||a._n()},this.selectedFlag.addEventListener("click",this._a10),this._a11=function(b){a.m.classList.contains("iti__hide")&&-1!==["ArrowUp","Up","ArrowDown","Down"," ","Enter"].indexOf(b.key)&&(b.preventDefault(),b.stopPropagation(),a._n()),"Tab"===b.key&&a._2()},this.k.addEventListener("keydown",this._a11)}},{key:"_i3",value:function(){var a=this;this.d.utilsScript&&!window.intlTelInputUtils?window.intlTelInputGlobals.documentReady()?window.intlTelInputGlobals.loadUtils(this.d.utilsScript):window.addEventListener("load",function(){window.intlTelInputGlobals.loadUtils(a.d.utilsScript)}):this.i0(),"auto"===this.d.initialCountry?this._i4():this.h()}},{key:"_i4",value:function(){window.intlTelInputGlobals.autoCountry?this.handleAutoCountry():window.intlTelInputGlobals.startedLoadingAutoCountry||(window.intlTelInputGlobals.startedLoadingAutoCountry=!0,"function"==typeof this.d.geoIpLookup&&this.d.geoIpLookup(function(a){window.intlTelInputGlobals.autoCountry=a.toLowerCase(),setTimeout(function(){return r("handleAutoCountry")})},function(){return r("rejectAutoCountryPromise")}))}},{key:"_j",value:function(){var a=this;this._a12=function(){a._v(a.a.value)&&a._m2CountryChange()},this.a.addEventListener("keyup",this._a12),this._a13=function(){setTimeout(a._a12)},this.a.addEventListener("cut",this._a13),this.a.addEventListener("paste",this._a13)}},{key:"_j2",value:function(a){var b=this.a.getAttribute("maxlength");return b&&a.length>b?a.substr(0,b):a}},{key:"_l",value:function(){var a=this;this._a8=function(){a._l2()},this.a.form&&this.a.form.addEventListener("submit",this._a8),this.a.addEventListener("blur",this._a8)}},{key:"_l2",value:function(){if("+"===this.a.value.charAt(0)){var a=this._m(this.a.value);a&&this.s.dialCode!==a||(this.a.value="")}}},{key:"_m",value:function(a){return a.replace(/\D/g,"")}},{key:"_m2",value:function(a){var b=document.createEvent("Event");b.initEvent(a,!0,!0),this.a.dispatchEvent(b)}},{key:"_n",value:function(){this.m.classList.remove("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","true"),this._o(),this.b&&(this._x(this.b,!1),this._3(this.b,!0)),this._p(),this.u.classList.add("iti__arrow--up"),this._m2("open:countrydropdown")}},{key:"_n2",value:function(a,b,c){c&&!a.classList.contains(b)?a.classList.add(b):!c&&a.classList.contains(b)&&a.classList.remove(b)}},{key:"_o",value:function(){var a=this;if(this.d.dropdownContainer&&this.d.dropdownContainer.appendChild(this.dropdown),!this.g){var b=this.a.getBoundingClientRect(),c=window.pageYOffset||document.documentElement.scrollTop,d=b.top+c,e=this.m.offsetHeight,f=d+this.a.offsetHeight+e<c+window.innerHeight,g=d-e>c;if(this._n2(this.m,"iti__country-list--dropup",!f&&g),this.d.dropdownContainer){var h=!f&&g?0:this.a.offsetHeight;this.dropdown.style.top="".concat(d+h,"px"),this.dropdown.style.left="".concat(b.left+document.body.scrollLeft,"px"),this._a4=function(){return a._2()},window.addEventListener("scroll",this._a4)}}}},{key:"_o2",value:function(a){for(var b=a;b&&b!==this.m&&!b.classList.contains("iti__country");)b=b.parentNode;return b===this.m?null:b}},{key:"_p",value:function(){var a=this;this._a0=function(b){var c=a._o2(b.target);c&&a._x(c,!1)},this.m.addEventListener("mouseover",this._a0),this._a1=function(b){var c=a._o2(b.target);c&&a._1(c)},this.m.addEventListener("click",this._a1);var b=!0;this._a2=function(){b||a._2(),b=!1},document.documentElement.addEventListener("click",this._a2);var c="",d=null;this._a3=function(b){b.preventDefault(),"ArrowUp"===b.key||"Up"===b.key||"ArrowDown"===b.key||"Down"===b.key?a._q(b.key):"Enter"===b.key?a._r():"Escape"===b.key?a._2():/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(b.key)&&(d&&clearTimeout(d),c+=b.key.toLowerCase(),a._s(c),d=setTimeout(function(){c=""},1e3))},document.addEventListener("keydown",this._a3)}},{key:"_q",value:function(a){var b="ArrowUp"===a||"Up"===a?this.c.previousElementSibling:this.c.nextElementSibling;b&&(b.classList.contains("iti__divider")&&(b="ArrowUp"===a||"Up"===a?b.previousElementSibling:b.nextElementSibling),this._x(b,!0))}},{key:"_r",value:function(){this.c&&this._1(this.c)}},{key:"_s",value:function(a){for(var b=0;b<this.p.length;b++)if(this._t(this.p[b].name,a)){var c=this.m.querySelector("#iti-".concat(this.id,"__item-").concat(this.p[b].iso2));this._x(c,!1),this._3(c,!0);break}}},{key:"_t",value:function(a,b){return a.substr(0,b.length).toLowerCase()===b}},{key:"_u",value:function(a){var b=a;if(this.d.formatOnDisplay&&window.intlTelInputUtils&&this.s){var c=this.d.nationalMode||"+"!==b.charAt(0)&&!this.d.separateDialCode,d=intlTelInputUtils.numberFormat,e=d.NATIONAL,f=d.INTERNATIONAL,g=c?e:f;b=intlTelInputUtils.formatNumber(b,this.s.iso2,g)}b=this._7(b),this.a.value=b}},{key:"_v",value:function(a){var b=a,c=this.s.dialCode,d="1"===c;b&&this.d.nationalMode&&d&&"+"!==b.charAt(0)&&("1"!==b.charAt(0)&&(b="1".concat(b)),b="+".concat(b)),this.d.separateDialCode&&c&&"+"!==b.charAt(0)&&(b="+".concat(c).concat(b));var e=this._5(b,!0),f=this._m(b),g=null;if(e){var h=this.q[this._m(e)],i=-1!==h.indexOf(this.s.iso2)&&f.length<=e.length-1;if(!("1"===c&&this._w(f))&&!i)for(var j=0;j<h.length;j++)if(h[j]){g=h[j];break}}else"+"===b.charAt(0)&&f.length?g="":b&&"+"!==b||(g=this.j);return null!==g&&this._z(g)}},{key:"_w",value:function(a){var b=this._m(a);if("1"===b.charAt(0)){var c=b.substr(1,3);return-1!==p.indexOf(c)}return!1}},{key:"_x",value:function(a,b){var c=this.c;c&&c.classList.remove("iti__highlight"),this.c=a,this.c.classList.add("iti__highlight"),this.selectedFlag.setAttribute("aria-activedescendant",a.getAttribute("id")),b&&this.c.focus()}},{key:"_y",value:function(a,b,c){for(var d=b?j:this.p,e=0;e<d.length;e++)if(d[e].iso2===a)return d[e];if(c)return null;throw new Error("No country data for '".concat(a,"'"))}},{key:"_z",value:function(a){var b=this.s.iso2?this.s:{};this.s=a?this._y(a,!1,!1):{},this.s.iso2&&(this.j=this.s.iso2),this.l.setAttribute("class","iti__flag iti__".concat(a));var c=a?"".concat(this.s.name,": +").concat(this.s.dialCode):"Unknown";if(this.selectedFlag.setAttribute("title",c),this.d.separateDialCode){var d=this.s.dialCode?"+".concat(this.s.dialCode):"";this.t.innerHTML=d;var e=this.selectedFlag.offsetWidth||this._z2();this.a.style.paddingLeft="".concat(e+6,"px")}if(this._0(),this.d.allowDropdown){var f=this.b;if(f&&(f.classList.remove("iti__active"),f.setAttribute("aria-selected","false")),a){var g=this.m.querySelector("#iti-".concat(this.id,"__item-").concat(a,"-preferred"))||this.m.querySelector("#iti-".concat(this.id,"__item-").concat(a));g.setAttribute("aria-selected","true"),g.classList.add("iti__active"),this.b=g}}return b.iso2!==a}},{key:"_z2",value:function(){var a=this.a.parentNode.cloneNode();a.style.visibility="hidden",document.body.appendChild(a);var b=this.k.cloneNode();a.appendChild(b);var c=this.selectedFlag.cloneNode(!0);b.appendChild(c);var d=c.offsetWidth;return a.parentNode.removeChild(a),d}},{key:"_0",value:function(){var a="aggressive"===this.d.autoPlaceholder||!this.e&&"polite"===this.d.autoPlaceholder;if(window.intlTelInputUtils&&a){var b=intlTelInputUtils.numberType[this.d.placeholderNumberType],c=this.s.iso2?intlTelInputUtils.getExampleNumber(this.s.iso2,this.d.nationalMode,b):"";c=this._7(c),"function"==typeof this.d.customPlaceholder&&(c=this.d.customPlaceholder(c,this.s)),this.a.setAttribute("placeholder",c)}}},{key:"_1",value:function(a){var b=this._z(a.getAttribute("data-country-code"));this._2(),this._4(a.getAttribute("data-dial-code")),this.a.focus();var c=this.a.value.length;this.a.setSelectionRange(c,c),b&&this._m2CountryChange()}},{key:"_2",value:function(){this.m.classList.add("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","false"),this.selectedFlag.removeAttribute("aria-activedescendant"),this.u.classList.remove("iti__arrow--up"),document.removeEventListener("keydown",this._a3),document.documentElement.removeEventListener("click",this._a2),this.m.removeEventListener("mouseover",this._a0),this.m.removeEventListener("click",this._a1),this.d.dropdownContainer&&(this.g||window.removeEventListener("scroll",this._a4),this.dropdown.parentNode&&this.dropdown.parentNode.removeChild(this.dropdown)),this._m2("close:countrydropdown")}},{key:"_3",value:function(a,b){var c=this.m,d=window.pageYOffset||document.documentElement.scrollTop,e=c.offsetHeight,f=c.getBoundingClientRect().top+d,g=f+e,h=a.offsetHeight,i=a.getBoundingClientRect().top+d,j=i+h,k=i-f+c.scrollTop,l=e/2-h/2;if(i<f)b&&(k-=l),c.scrollTop=k;else if(j>g){b&&(k+=l);var m=e-h;c.scrollTop=k-m}}},{key:"_4",value:function(a){var b,c=this.a.value,d="+".concat(a);if("+"===c.charAt(0)){var e=this._5(c);b=e?c.replace(e,d):d,this.a.value=b}else this.d.autoInsertDialCode&&(b=c?d+c:d,this.a.value=b)}},{key:"_5",value:function(a,b){var c="";if("+"===a.charAt(0))for(var d="",e=0;e<a.length;e++){var f=a.charAt(e);if(!isNaN(parseInt(f,10))){if(d+=f,b)this.q[d]&&(c=a.substr(0,e+1));else if(this.dialCodes[d]){c=a.substr(0,e+1);break}if(d.length===this.countryCodeMaxLen)break}}return c}},{key:"_6",value:function(){var a=this.a.value.trim(),b=this.s.dialCode,c=this._m(a);return(this.d.separateDialCode&&"+"!==a.charAt(0)&&b&&c?"+".concat(b):"")+a}},{key:"_7",value:function(a){var b=a;if(this.d.separateDialCode){var c=this._5(b);if(c){c="+".concat(this.s.dialCode);var d=" "===b[c.length]||"-"===b[c.length]?c.length+1:c.length;b=b.substr(d)}}return this._j2(b)}},{key:"_m2CountryChange",value:function(){this._m2("countrychange")}},{key:"handleAutoCountry",value:function(){"auto"===this.d.initialCountry&&(this.j=window.intlTelInputGlobals.autoCountry,this.a.value||this.setCountry(this.j),this.h())}},{key:"handleUtils",value:function(){window.intlTelInputUtils&&(this.a.value&&this._u(this.a.value),this._0()),this.i0()}},{key:"destroy",value:function(){var a=this.a.form;if(this.d.allowDropdown){this._2(),this.selectedFlag.removeEventListener("click",this._a10),
|
|
8
|
-
this.k.removeEventListener("keydown",this._a11);var b=this._i1();b&&b.removeEventListener("click",this._a9)}this.hiddenInput&&a&&a.removeEventListener("submit",this._a14),this.d.autoInsertDialCode&&(a&&a.removeEventListener("submit",this._a8),this.a.removeEventListener("blur",this._a8)),this.a.removeEventListener("keyup",this._a12),this.a.removeEventListener("cut",this._a13),this.a.removeEventListener("paste",this._a13),this.a.removeAttribute("data-intl-tel-input-id");var c=this.a.parentNode;c.parentNode.insertBefore(this.a,c),c.parentNode.removeChild(c),delete window.intlTelInputGlobals.instances[this.id]}},{key:"getExtension",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getExtension(this._6(),this.s.iso2):""}},{key:"getNumber",value:function(a){if(window.intlTelInputUtils){var b=this.s.iso2;return intlTelInputUtils.formatNumber(this._6(),b,a)}return""}},{key:"getNumberType",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getNumberType(this._6(),this.s.iso2):-99}},{key:"getSelectedCountryData",value:function(){return this.s}},{key:"getValidationError",value:function(){if(window.intlTelInputUtils){var a=this.s.iso2;return intlTelInputUtils.getValidationError(this._6(),a)}return-99}},{key:"isValidNumber",value:function(){var a=this._6().trim(),b=this.d.nationalMode?this.s.iso2:"";return window.intlTelInputUtils?intlTelInputUtils.isValidNumber(a,b):null}},{key:"setCountry",value:function(a){var b=a.toLowerCase();this.l.classList.contains("iti__".concat(b))||(this._z(b),this._4(this.s.dialCode),this._m2CountryChange())}},{key:"setNumber",value:function(a){var b=this._v(a);this._u(a),b&&this._m2CountryChange()}},{key:"setPlaceholderNumberType",value:function(a){this.d.placeholderNumberType=a,this._0()}}]),a}();m.getCountryData=function(){return j};var t=function(a,b,c){var d=document.createElement("script");d.onload=function(){r("handleUtils"),b&&b()},d.onerror=function(){r("rejectUtilsScriptPromise"),c&&c()},d.className="iti-load-utils",d.async=!0,d.src=a,document.body.appendChild(d)};m.loadUtils=function(a){if(!window.intlTelInputUtils&&!window.intlTelInputGlobals.startedLoadingUtilsScript){if(window.intlTelInputGlobals.startedLoadingUtilsScript=!0,"undefined"!=typeof Promise)return new Promise(function(b,c){return t(a,b,c)});t(a)}return null},m.defaults=o,m.version="18.0.
|
|
8
|
+
this.k.removeEventListener("keydown",this._a11);var b=this._i1();b&&b.removeEventListener("click",this._a9)}this.hiddenInput&&a&&a.removeEventListener("submit",this._a14),this.d.autoInsertDialCode&&(a&&a.removeEventListener("submit",this._a8),this.a.removeEventListener("blur",this._a8)),this.a.removeEventListener("keyup",this._a12),this.a.removeEventListener("cut",this._a13),this.a.removeEventListener("paste",this._a13),this.a.removeAttribute("data-intl-tel-input-id");var c=this.a.parentNode;c.parentNode.insertBefore(this.a,c),c.parentNode.removeChild(c),delete window.intlTelInputGlobals.instances[this.id]}},{key:"getExtension",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getExtension(this._6(),this.s.iso2):""}},{key:"getNumber",value:function(a){if(window.intlTelInputUtils){var b=this.s.iso2;return intlTelInputUtils.formatNumber(this._6(),b,a)}return""}},{key:"getNumberType",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getNumberType(this._6(),this.s.iso2):-99}},{key:"getSelectedCountryData",value:function(){return this.s}},{key:"getValidationError",value:function(){if(window.intlTelInputUtils){var a=this.s.iso2;return intlTelInputUtils.getValidationError(this._6(),a)}return-99}},{key:"isValidNumber",value:function(){var a=this._6().trim(),b=this.d.nationalMode?this.s.iso2:"";return window.intlTelInputUtils?intlTelInputUtils.isValidNumber(a,b):null}},{key:"setCountry",value:function(a){var b=a.toLowerCase();this.l.classList.contains("iti__".concat(b))||(this._z(b),this._4(this.s.dialCode),this._m2CountryChange())}},{key:"setNumber",value:function(a){var b=this._v(a);this._u(a),b&&this._m2CountryChange()}},{key:"setPlaceholderNumberType",value:function(a){this.d.placeholderNumberType=a,this._0()}}]),a}();m.getCountryData=function(){return j};var t=function(a,b,c){var d=document.createElement("script");d.onload=function(){r("handleUtils"),b&&b()},d.onerror=function(){r("rejectUtilsScriptPromise"),c&&c()},d.className="iti-load-utils",d.async=!0,d.src=a,document.body.appendChild(d)};m.loadUtils=function(a){if(!window.intlTelInputUtils&&!window.intlTelInputGlobals.startedLoadingUtilsScript){if(window.intlTelInputGlobals.startedLoadingUtilsScript=!0,"undefined"!=typeof Promise)return new Promise(function(b,c){return t(a,b,c)});t(a)}return null},m.defaults=o,m.version="18.0.2";a.fn.intlTelInput=function(c){var d=arguments;if(c===b||"object"==typeof c)return this.each(function(){if(!a.data(this,"plugin_intlTelInput")){var b=new s(this,c);b._init(),window.intlTelInputGlobals.instances[b.id]=b,a.data(this,"plugin_intlTelInput",b)}});if("string"==typeof c&&"_"!==c[0]){var e;return this.each(function(){var b=a.data(this,"plugin_intlTelInput");b instanceof s&&"function"==typeof b[c]&&(e=b[c].apply(b,Array.prototype.slice.call(d,1))),"destroy"===c&&a.data(this,"plugin_intlTelInput",null)}),e!==b?e:this}}});
|
package/build/js/intlTelInput.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* International Telephone Input v18.0.
|
|
2
|
+
* International Telephone Input v18.0.2
|
|
3
3
|
* https://github.com/jackocnr/intl-tel-input.git
|
|
4
4
|
* Licensed under the MIT license
|
|
5
5
|
*/
|
|
@@ -1388,7 +1388,7 @@
|
|
|
1388
1388
|
// default options
|
|
1389
1389
|
intlTelInputGlobals.defaults = defaults;
|
|
1390
1390
|
// version
|
|
1391
|
-
intlTelInputGlobals.version = "18.0.
|
|
1391
|
+
intlTelInputGlobals.version = "18.0.2";
|
|
1392
1392
|
// convenience wrapper
|
|
1393
1393
|
return function(input, options) {
|
|
1394
1394
|
var iti = new Iti(input, options);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* International Telephone Input v18.0.
|
|
2
|
+
* International Telephone Input v18.0.2
|
|
3
3
|
* https://github.com/jackocnr/intl-tel-input.git
|
|
4
4
|
* Licensed under the MIT license
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
!function(a){"object"==typeof module&&module.exports?module.exports=a():window.intlTelInput=a()}(function(a){"use strict";return function(){function b(a){for(var b=1;b<arguments.length;b++){var d=null!=arguments[b]?Object(arguments[b]):{},e=Object.keys(d);"function"==typeof Object.getOwnPropertySymbols&&e.push.apply(e,Object.getOwnPropertySymbols(d).filter(function(a){return Object.getOwnPropertyDescriptor(d,a).enumerable})),e.forEach(function(b){c(a,b,d[b])})}return a}function c(a,b,c){return b=g(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,g(d.key),d)}}function f(a,b,c){return b&&e(a.prototype,b),c&&e(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function g(a){var b=h(a,"string");return"symbol"==typeof b?b:String(b)}function h(b,c){if("object"!=typeof b||null===b)return b;var d=b[Symbol.toPrimitive];if(d!==a){var e=d.call(b,c||"default");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===c?String:Number)(b)}for(var i=[["Afghanistan (افغانستان)","af","93"],["Albania (Shqipëri)","al","355"],["Algeria (الجزائر)","dz","213"],["American Samoa","as","1",5,["684"]],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1",6,["264"]],["Antigua and Barbuda","ag","1",7,["268"]],["Argentina","ar","54"],["Armenia (Հայաստան)","am","374"],["Aruba","aw","297"],["Ascension Island","ac","247"],["Australia","au","61",0],["Austria (Österreich)","at","43"],["Azerbaijan (Azərbaycan)","az","994"],["Bahamas","bs","1",8,["242"]],["Bahrain (البحرين)","bh","973"],["Bangladesh (বাংলাদেশ)","bd","880"],["Barbados","bb","1",9,["246"]],["Belarus (Беларусь)","by","375"],["Belgium (België)","be","32"],["Belize","bz","501"],["Benin (Bénin)","bj","229"],["Bermuda","bm","1",10,["441"]],["Bhutan (འབྲུག)","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina (Босна и Херцеговина)","ba","387"],["Botswana","bw","267"],["Brazil (Brasil)","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1",11,["284"]],["Brunei","bn","673"],["Bulgaria (България)","bg","359"],["Burkina Faso","bf","226"],["Burundi (Uburundi)","bi","257"],["Cambodia (កម្ពុជា)","kh","855"],["Cameroon (Cameroun)","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","289","306","343","365","367","368","387","403","416","418","431","437","438","450","474","506","514","519","548","579","581","584","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)","cv","238"],["Caribbean Netherlands","bq","599",1,["3","4","7"]],["Cayman Islands","ky","1",12,["345"]],["Central African Republic (République centrafricaine)","cf","236"],["Chad (Tchad)","td","235"],["Chile","cl","56"],["China (中国)","cn","86"],["Christmas Island","cx","61",2,["89164"]],["Cocos (Keeling) Islands","cc","61",1,["89162"]],["Colombia","co","57"],["Comoros (جزر القمر)","km","269"],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)","cd","243"],["Congo (Republic) (Congo-Brazzaville)","cg","242"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia (Hrvatska)","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus (Κύπρος)","cy","357"],["Czech Republic (Česká republika)","cz","420"],["Denmark (Danmark)","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1",13,["767"]],["Dominican Republic (República Dominicana)","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt (مصر)","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea (Guinea Ecuatorial)","gq","240"],["Eritrea","er","291"],["Estonia (Eesti)","ee","372"],["Eswatini","sz","268"],["Ethiopia","et","251"],["Falkland Islands (Islas Malvinas)","fk","500"],["Faroe Islands (Føroyar)","fo","298"],["Fiji","fj","679"],["Finland (Suomi)","fi","358",0],["France","fr","33"],["French Guiana (Guyane française)","gf","594"],["French Polynesia (Polynésie française)","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia (საქართველო)","ge","995"],["Germany (Deutschland)","de","49"],["Ghana (Gaana)","gh","233"],["Gibraltar","gi","350"],["Greece (Ελλάδα)","gr","30"],["Greenland (Kalaallit Nunaat)","gl","299"],["Grenada","gd","1",14,["473"]],["Guadeloupe","gp","590",0],["Guam","gu","1",15,["671"]],["Guatemala","gt","502"],["Guernsey","gg","44",1,["1481","7781","7839","7911"]],["Guinea (Guinée)","gn","224"],["Guinea-Bissau (Guiné Bissau)","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong (香港)","hk","852"],["Hungary (Magyarország)","hu","36"],["Iceland (Ísland)","is","354"],["India (भारत)","in","91"],["Indonesia","id","62"],["Iran (ایران)","ir","98"],["Iraq (العراق)","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2,["1624","74576","7524","7924","7624"]],["Israel (ישראל)","il","972"],["Italy (Italia)","it","39",0],["Jamaica","jm","1",4,["876","658"]],["Japan (日本)","jp","81"],["Jersey","je","44",3,["1534","7509","7700","7797","7829","7937"]],["Jordan (الأردن)","jo","962"],["Kazakhstan (Казахстан)","kz","7",1,["33","7"]],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait (الكويت)","kw","965"],["Kyrgyzstan (Кыргызстан)","kg","996"],["Laos (ລາວ)","la","856"],["Latvia (Latvija)","lv","371"],["Lebanon (لبنان)","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya (ليبيا)","ly","218"],["Liechtenstein","li","423"],["Lithuania (Lietuva)","lt","370"],["Luxembourg","lu","352"],["Macau (澳門)","mo","853"],["Madagascar (Madagasikara)","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania (موريتانيا)","mr","222"],["Mauritius (Moris)","mu","230"],["Mayotte","yt","262",1,["269","639"]],["Mexico (México)","mx","52"],["Micronesia","fm","691"],["Moldova (Republica Moldova)","md","373"],["Monaco","mc","377"],["Mongolia (Монгол)","mn","976"],["Montenegro (Crna Gora)","me","382"],["Montserrat","ms","1",16,["664"]],["Morocco (المغرب)","ma","212",0],["Mozambique (Moçambique)","mz","258"],["Myanmar (Burma) (မြန်မာ)","mm","95"],["Namibia (Namibië)","na","264"],["Nauru","nr","674"],["Nepal (नेपाल)","np","977"],["Netherlands (Nederland)","nl","31"],["New Caledonia (Nouvelle-Calédonie)","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger (Nijar)","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea (조선 민주주의 인민 공화국)","kp","850"],["North Macedonia (Северна Македонија)","mk","389"],["Northern Mariana Islands","mp","1",17,["670"]],["Norway (Norge)","no","47",0],["Oman (عُمان)","om","968"],["Pakistan (پاکستان)","pk","92"],["Palau","pw","680"],["Palestine (فلسطين)","ps","970"],["Panama (Panamá)","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru (Perú)","pe","51"],["Philippines","ph","63"],["Poland (Polska)","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar (قطر)","qa","974"],["Réunion (La Réunion)","re","262",0],["Romania (România)","ro","40"],["Russia (Россия)","ru","7",0],["Rwanda","rw","250"],["Saint Barthélemy","bl","590",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1",18,["869"]],["Saint Lucia","lc","1",19,["758"]],["Saint Martin (Saint-Martin (partie française))","mf","590",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)","pm","508"],["Saint Vincent and the Grenadines","vc","1",20,["784"]],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and Príncipe (São Tomé e Príncipe)","st","239"],["Saudi Arabia (المملكة العربية السعودية)","sa","966"],["Senegal (Sénégal)","sn","221"],["Serbia (Србија)","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1",21,["721"]],["Slovakia (Slovensko)","sk","421"],["Slovenia (Slovenija)","si","386"],["Solomon Islands","sb","677"],["Somalia (Soomaaliya)","so","252"],["South Africa","za","27"],["South Korea (대한민국)","kr","82"],["South Sudan (جنوب السودان)","ss","211"],["Spain (España)","es","34"],["Sri Lanka (ශ්රී ලංකාව)","lk","94"],["Sudan (السودان)","sd","249"],["Suriname","sr","597"],["Svalbard and Jan Mayen","sj","47",1,["79"]],["Sweden (Sverige)","se","46"],["Switzerland (Schweiz)","ch","41"],["Syria (سوريا)","sy","963"],["Taiwan (台灣)","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand (ไทย)","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad and Tobago","tt","1",22,["868"]],["Tunisia (تونس)","tn","216"],["Turkey (Türkiye)","tr","90"],["Turkmenistan","tm","993"],["Turks and Caicos Islands","tc","1",23,["649"]],["Tuvalu","tv","688"],["U.S. Virgin Islands","vi","1",24,["340"]],["Uganda","ug","256"],["Ukraine (Україна)","ua","380"],["United Arab Emirates (الإمارات العربية المتحدة)","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["Uzbekistan (Oʻzbekiston)","uz","998"],["Vanuatu","vu","678"],["Vatican City (Città del Vaticano)","va","39",1,["06698"]],["Venezuela","ve","58"],["Vietnam (Việt Nam)","vn","84"],["Wallis and Futuna (Wallis-et-Futuna)","wf","681"],["Western Sahara (الصحراء الغربية)","eh","212",1,["5288","5289"]],["Yemen (اليمن)","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1,["18"]]],j=0;j<i.length;j++){var k=i[j];i[j]={name:k[0],iso2:k[1],dialCode:k[2],priority:k[3]||0,areaCodes:k[4]||null}}var l={getInstance:function(a){var b=a.getAttribute("data-intl-tel-input-id");return window.intlTelInputGlobals.instances[b]},instances:{},documentReady:function(){return"complete"===document.readyState}};"object"==typeof window&&(window.intlTelInputGlobals=l);var m=0,n={allowDropdown:!0,autoInsertDialCode:!1,autoPlaceholder:"polite",customContainer:"",customPlaceholder:null,dropdownContainer:null,excludeCountries:[],formatOnDisplay:!0,geoIpLookup:null,hiddenInput:"",initialCountry:"",localizedCountries:null,nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",preferredCountries:["us","gb"],separateDialCode:!1,utilsScript:""},o=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],p=function(a,b){for(var c=Object.keys(a),d=0;d<c.length;d++)b(c[d],a[c[d]])},q=function(a){p(window.intlTelInputGlobals.instances,function(b){window.intlTelInputGlobals.instances[b][a]()})},r=function(){function c(a,b){var e=this;d(this,c),this.id=m++,this.a=a,this.b=null,this.c=null;var f=b||{};this.d={},p(n,function(a,b){e.d[a]=f.hasOwnProperty(a)?f[a]:b}),this.e=Boolean(a.getAttribute("placeholder"))}return f(c,[{key:"_init",value:function(){var a=this;if(this.d.nationalMode&&(this.d.autoInsertDialCode=!1),this.d.separateDialCode&&(this.d.autoInsertDialCode=!1),this.g=/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),this.g&&(document.body.classList.add("iti-mobile"),this.d.dropdownContainer||(this.d.dropdownContainer=document.body)),"undefined"!=typeof Promise){var b=new Promise(function(b,c){a.h=b,a.i=c}),c=new Promise(function(b,c){a.i0=b,a.i1=c});this.promise=Promise.all([b,c])}else this.h=this.i=function(){},this.i0=this.i1=function(){};this.s={},this._b(),this._f(),this._h(),this._i(),this._i3()}},{key:"_b",value:function(){this._d(),this._d2(),this._e(),this.d.localizedCountries&&this._d0(),(this.d.onlyCountries.length||this.d.localizedCountries)&&this.p.sort(this._d1)}},{key:"_c",value:function(b,c,d){c.length>this.countryCodeMaxLen&&(this.countryCodeMaxLen=c.length),this.q.hasOwnProperty(c)||(this.q[c]=[]);for(var e=0;e<this.q[c].length;e++)if(this.q[c][e]===b)return;var f=d!==a?d:this.q[c].length;this.q[c][f]=b}},{key:"_d",value:function(){if(this.d.onlyCountries.length){var a=this.d.onlyCountries.map(function(a){return a.toLowerCase()});this.p=i.filter(function(b){return a.indexOf(b.iso2)>-1})}else if(this.d.excludeCountries.length){var b=this.d.excludeCountries.map(function(a){return a.toLowerCase()});this.p=i.filter(function(a){return-1===b.indexOf(a.iso2)})}else this.p=i}},{key:"_d0",value:function(){for(var a=0;a<this.p.length;a++){var b=this.p[a].iso2.toLowerCase();this.d.localizedCountries.hasOwnProperty(b)&&(this.p[a].name=this.d.localizedCountries[b])}}},{key:"_d1",value:function(a,b){return a.name<b.name?-1:a.name>b.name?1:0}},{key:"_d2",value:function(){this.countryCodeMaxLen=0,this.dialCodes={},this.q={};for(var a=0;a<this.p.length;a++){var b=this.p[a];this.dialCodes[b.dialCode]||(this.dialCodes[b.dialCode]=!0),this._c(b.iso2,b.dialCode,b.priority)}for(var c=0;c<this.p.length;c++){var d=this.p[c];if(d.areaCodes)for(var e=this.q[d.dialCode][0],f=0;f<d.areaCodes.length;f++){for(var g=d.areaCodes[f],h=1;h<g.length;h++){var i=d.dialCode+g.substr(0,h);this._c(e,i),this._c(d.iso2,i)}this._c(d.iso2,d.dialCode+g)}}}},{key:"_e",value:function(){this.preferredCountries=[];for(var a=0;a<this.d.preferredCountries.length;a++){var b=this.d.preferredCountries[a].toLowerCase(),c=this._y(b,!1,!0);c&&this.preferredCountries.push(c)}}},{key:"_e2",value:function(a,b,c){var d=document.createElement(a);return b&&p(b,function(a,b){return d.setAttribute(a,b)}),c&&c.appendChild(d),d}},{key:"_f",value:function(){this.a.hasAttribute("autocomplete")||this.a.form&&this.a.form.hasAttribute("autocomplete")||this.a.setAttribute("autocomplete","off");var a="iti";this.d.allowDropdown&&(a+=" iti--allow-dropdown"),this.d.separateDialCode&&(a+=" iti--separate-dial-code"),this.d.customContainer&&(a+=" ",a+=this.d.customContainer);var c=this._e2("div",{"class":a});if(this.a.parentNode.insertBefore(c,this.a),this.k=this._e2("div",{"class":"iti__flag-container"},c),c.appendChild(this.a),this.selectedFlag=this._e2("div",b({"class":"iti__selected-flag"},this.d.allowDropdown&&{role:"combobox","aria-haspopup":"listbox","aria-controls":"iti-".concat(this.id,"__country-listbox"),"aria-owns":"iti-".concat(this.id,"__country-listbox"),"aria-expanded":"false","aria-label":"Telephone country code"}),this.k),this.l=this._e2("div",{"class":"iti__flag"},this.selectedFlag),this.a.disabled&&this.selectedFlag.setAttribute("aria-disabled","true"),this.d.separateDialCode&&(this.t=this._e2("div",{"class":"iti__selected-dial-code"},this.selectedFlag)),this.d.allowDropdown&&(this.a.disabled||this.selectedFlag.setAttribute("tabindex","0"),this.u=this._e2("div",{"class":"iti__arrow"},this.selectedFlag),this.m=this._e2("ul",{"class":"iti__country-list iti__hide",id:"iti-".concat(this.id,"__country-listbox"),role:"listbox","aria-label":"List of countries"}),this.preferredCountries.length&&(this._g(this.preferredCountries,"iti__preferred",!0),this._e2("li",{"class":"iti__divider",role:"separator","aria-disabled":"true"},this.m)),this._g(this.p,"iti__standard"),this.d.dropdownContainer?(this.dropdown=this._e2("div",{"class":"iti iti--container"}),this.dropdown.appendChild(this.m)):this.k.appendChild(this.m)),this.d.hiddenInput){var d=this.d.hiddenInput,e=this.a.getAttribute("name");if(e){var f=e.lastIndexOf("[");-1!==f&&(d="".concat(e.substr(0,f),"[").concat(d,"]"))}this.hiddenInput=this._e2("input",{type:"hidden",name:d}),c.appendChild(this.hiddenInput)}}},{key:"_g",value:function(a,b,c){for(var d="",e=0;e<a.length;e++){var f=a[e],g=c?"-preferred":"";d+="<li class='iti__country ".concat(b,"' tabIndex='-1' id='iti-").concat(this.id,"__item-").concat(f.iso2).concat(g,"' role='option' data-dial-code='").concat(f.dialCode,"' data-country-code='").concat(f.iso2,"' aria-selected='false'>"),d+="<div class='iti__flag-box'><div class='iti__flag iti__".concat(f.iso2,"'></div></div>"),d+="<span class='iti__country-name'>".concat(f.name,"</span>"),d+="<span class='iti__dial-code'>+".concat(f.dialCode,"</span>"),d+="</li>"}this.m.insertAdjacentHTML("beforeend",d)}},{key:"_h",value:function(){var a=this.a.getAttribute("value"),b=this.a.value,c=a&&"+"===a.charAt(0)&&(!b||"+"!==b.charAt(0)),d=c?a:b,e=this._5(d),f=this._w(d),g=this.d,h=g.initialCountry,i=g.autoInsertDialCode;e&&!f?this._v(d):"auto"!==h&&(h?this._z(h.toLowerCase()):e&&f?this._z("us"):(this.j=this.preferredCountries.length?this.preferredCountries[0].iso2:this.p[0].iso2,d||this._z(this.j)),!d&&i&&(this.a.value="+".concat(this.s.dialCode))),d&&this._u(d)}},{key:"_i",value:function(){this._j(),this.d.autoInsertDialCode&&this._l(),this.d.allowDropdown&&this._i2(),this.hiddenInput&&this._i0()}},{key:"_i0",value:function(){var a=this;this._a14=function(){a.hiddenInput.value=a.getNumber()},this.a.form&&this.a.form.addEventListener("submit",this._a14)}},{key:"_i1",value:function(){for(var a=this.a;a&&"LABEL"!==a.tagName;)a=a.parentNode;return a}},{key:"_i2",value:function(){var a=this;this._a9=function(b){a.m.classList.contains("iti__hide")?a.a.focus():b.preventDefault()};var b=this._i1();b&&b.addEventListener("click",this._a9),this._a10=function(){!a.m.classList.contains("iti__hide")||a.a.disabled||a.a.readOnly||a._n()},this.selectedFlag.addEventListener("click",this._a10),this._a11=function(b){a.m.classList.contains("iti__hide")&&-1!==["ArrowUp","Up","ArrowDown","Down"," ","Enter"].indexOf(b.key)&&(b.preventDefault(),b.stopPropagation(),a._n()),"Tab"===b.key&&a._2()},this.k.addEventListener("keydown",this._a11)}},{key:"_i3",value:function(){var a=this;this.d.utilsScript&&!window.intlTelInputUtils?window.intlTelInputGlobals.documentReady()?window.intlTelInputGlobals.loadUtils(this.d.utilsScript):window.addEventListener("load",function(){window.intlTelInputGlobals.loadUtils(a.d.utilsScript)}):this.i0(),"auto"===this.d.initialCountry?this._i4():this.h()}},{key:"_i4",value:function(){window.intlTelInputGlobals.autoCountry?this.handleAutoCountry():window.intlTelInputGlobals.startedLoadingAutoCountry||(window.intlTelInputGlobals.startedLoadingAutoCountry=!0,"function"==typeof this.d.geoIpLookup&&this.d.geoIpLookup(function(a){window.intlTelInputGlobals.autoCountry=a.toLowerCase(),setTimeout(function(){return q("handleAutoCountry")})},function(){return q("rejectAutoCountryPromise")}))}},{key:"_j",value:function(){var a=this;this._a12=function(){a._v(a.a.value)&&a._m2CountryChange()},this.a.addEventListener("keyup",this._a12),this._a13=function(){setTimeout(a._a12)},this.a.addEventListener("cut",this._a13),this.a.addEventListener("paste",this._a13)}},{key:"_j2",value:function(a){var b=this.a.getAttribute("maxlength");return b&&a.length>b?a.substr(0,b):a}},{key:"_l",value:function(){var a=this;this._a8=function(){a._l2()},this.a.form&&this.a.form.addEventListener("submit",this._a8),this.a.addEventListener("blur",this._a8)}},{key:"_l2",value:function(){if("+"===this.a.value.charAt(0)){var a=this._m(this.a.value);a&&this.s.dialCode!==a||(this.a.value="")}}},{key:"_m",value:function(a){return a.replace(/\D/g,"")}},{key:"_m2",value:function(a){var b=document.createEvent("Event");b.initEvent(a,!0,!0),this.a.dispatchEvent(b)}},{key:"_n",value:function(){this.m.classList.remove("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","true"),this._o(),this.b&&(this._x(this.b,!1),this._3(this.b,!0)),this._p(),this.u.classList.add("iti__arrow--up"),this._m2("open:countrydropdown")}},{key:"_n2",value:function(a,b,c){c&&!a.classList.contains(b)?a.classList.add(b):!c&&a.classList.contains(b)&&a.classList.remove(b)}},{key:"_o",value:function(){var a=this;if(this.d.dropdownContainer&&this.d.dropdownContainer.appendChild(this.dropdown),!this.g){var b=this.a.getBoundingClientRect(),c=window.pageYOffset||document.documentElement.scrollTop,d=b.top+c,e=this.m.offsetHeight,f=d+this.a.offsetHeight+e<c+window.innerHeight,g=d-e>c;if(this._n2(this.m,"iti__country-list--dropup",!f&&g),this.d.dropdownContainer){var h=!f&&g?0:this.a.offsetHeight;this.dropdown.style.top="".concat(d+h,"px"),this.dropdown.style.left="".concat(b.left+document.body.scrollLeft,"px"),this._a4=function(){return a._2()},window.addEventListener("scroll",this._a4)}}}},{key:"_o2",value:function(a){for(var b=a;b&&b!==this.m&&!b.classList.contains("iti__country");)b=b.parentNode;return b===this.m?null:b}},{key:"_p",value:function(){var a=this;this._a0=function(b){var c=a._o2(b.target);c&&a._x(c,!1)},this.m.addEventListener("mouseover",this._a0),this._a1=function(b){var c=a._o2(b.target);c&&a._1(c)},this.m.addEventListener("click",this._a1);var b=!0;this._a2=function(){b||a._2(),b=!1},document.documentElement.addEventListener("click",this._a2);var c="",d=null;this._a3=function(b){b.preventDefault(),"ArrowUp"===b.key||"Up"===b.key||"ArrowDown"===b.key||"Down"===b.key?a._q(b.key):"Enter"===b.key?a._r():"Escape"===b.key?a._2():/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(b.key)&&(d&&clearTimeout(d),c+=b.key.toLowerCase(),a._s(c),d=setTimeout(function(){c=""},1e3))},document.addEventListener("keydown",this._a3)}},{key:"_q",value:function(a){var b="ArrowUp"===a||"Up"===a?this.c.previousElementSibling:this.c.nextElementSibling;b&&(b.classList.contains("iti__divider")&&(b="ArrowUp"===a||"Up"===a?b.previousElementSibling:b.nextElementSibling),this._x(b,!0))}},{key:"_r",value:function(){this.c&&this._1(this.c)}},{key:"_s",value:function(a){for(var b=0;b<this.p.length;b++)if(this._t(this.p[b].name,a)){var c=this.m.querySelector("#iti-".concat(this.id,"__item-").concat(this.p[b].iso2));this._x(c,!1),this._3(c,!0);break}}},{key:"_t",value:function(a,b){return a.substr(0,b.length).toLowerCase()===b}},{key:"_u",value:function(a){var b=a;if(this.d.formatOnDisplay&&window.intlTelInputUtils&&this.s){var c=this.d.nationalMode||"+"!==b.charAt(0)&&!this.d.separateDialCode,d=intlTelInputUtils.numberFormat,e=d.NATIONAL,f=d.INTERNATIONAL,g=c?e:f;b=intlTelInputUtils.formatNumber(b,this.s.iso2,g)}b=this._7(b),this.a.value=b}},{key:"_v",value:function(a){var b=a,c=this.s.dialCode,d="1"===c;b&&this.d.nationalMode&&d&&"+"!==b.charAt(0)&&("1"!==b.charAt(0)&&(b="1".concat(b)),b="+".concat(b)),this.d.separateDialCode&&c&&"+"!==b.charAt(0)&&(b="+".concat(c).concat(b));var e=this._5(b,!0),f=this._m(b),g=null;if(e){var h=this.q[this._m(e)],i=-1!==h.indexOf(this.s.iso2)&&f.length<=e.length-1;if(!("1"===c&&this._w(f))&&!i)for(var j=0;j<h.length;j++)if(h[j]){g=h[j];break}}else"+"===b.charAt(0)&&f.length?g="":b&&"+"!==b||(g=this.j);return null!==g&&this._z(g)}},{key:"_w",value:function(a){var b=this._m(a);if("1"===b.charAt(0)){var c=b.substr(1,3);return-1!==o.indexOf(c)}return!1}},{key:"_x",value:function(a,b){var c=this.c;c&&c.classList.remove("iti__highlight"),this.c=a,this.c.classList.add("iti__highlight"),this.selectedFlag.setAttribute("aria-activedescendant",a.getAttribute("id")),b&&this.c.focus()}},{key:"_y",value:function(a,b,c){for(var d=b?i:this.p,e=0;e<d.length;e++)if(d[e].iso2===a)return d[e];if(c)return null;throw new Error("No country data for '".concat(a,"'"))}},{key:"_z",value:function(a){var b=this.s.iso2?this.s:{};this.s=a?this._y(a,!1,!1):{},this.s.iso2&&(this.j=this.s.iso2),this.l.setAttribute("class","iti__flag iti__".concat(a));var c=a?"".concat(this.s.name,": +").concat(this.s.dialCode):"Unknown";if(this.selectedFlag.setAttribute("title",c),this.d.separateDialCode){var d=this.s.dialCode?"+".concat(this.s.dialCode):"";this.t.innerHTML=d;var e=this.selectedFlag.offsetWidth||this._z2();this.a.style.paddingLeft="".concat(e+6,"px")}if(this._0(),this.d.allowDropdown){var f=this.b;if(f&&(f.classList.remove("iti__active"),f.setAttribute("aria-selected","false")),a){var g=this.m.querySelector("#iti-".concat(this.id,"__item-").concat(a,"-preferred"))||this.m.querySelector("#iti-".concat(this.id,"__item-").concat(a));g.setAttribute("aria-selected","true"),g.classList.add("iti__active"),this.b=g}}return b.iso2!==a}},{key:"_z2",value:function(){var a=this.a.parentNode.cloneNode();a.style.visibility="hidden",document.body.appendChild(a);var b=this.k.cloneNode();a.appendChild(b);var c=this.selectedFlag.cloneNode(!0);b.appendChild(c);var d=c.offsetWidth;return a.parentNode.removeChild(a),d}},{key:"_0",value:function(){var a="aggressive"===this.d.autoPlaceholder||!this.e&&"polite"===this.d.autoPlaceholder;if(window.intlTelInputUtils&&a){var b=intlTelInputUtils.numberType[this.d.placeholderNumberType],c=this.s.iso2?intlTelInputUtils.getExampleNumber(this.s.iso2,this.d.nationalMode,b):"";c=this._7(c),"function"==typeof this.d.customPlaceholder&&(c=this.d.customPlaceholder(c,this.s)),this.a.setAttribute("placeholder",c)}}},{key:"_1",value:function(a){var b=this._z(a.getAttribute("data-country-code"));this._2(),this._4(a.getAttribute("data-dial-code")),this.a.focus();var c=this.a.value.length;this.a.setSelectionRange(c,c),b&&this._m2CountryChange()}},{key:"_2",value:function(){this.m.classList.add("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","false"),this.selectedFlag.removeAttribute("aria-activedescendant"),this.u.classList.remove("iti__arrow--up"),document.removeEventListener("keydown",this._a3),document.documentElement.removeEventListener("click",this._a2),this.m.removeEventListener("mouseover",this._a0),this.m.removeEventListener("click",this._a1),this.d.dropdownContainer&&(this.g||window.removeEventListener("scroll",this._a4),this.dropdown.parentNode&&this.dropdown.parentNode.removeChild(this.dropdown)),this._m2("close:countrydropdown")}},{key:"_3",value:function(a,b){var c=this.m,d=window.pageYOffset||document.documentElement.scrollTop,e=c.offsetHeight,f=c.getBoundingClientRect().top+d,g=f+e,h=a.offsetHeight,i=a.getBoundingClientRect().top+d,j=i+h,k=i-f+c.scrollTop,l=e/2-h/2;if(i<f)b&&(k-=l),c.scrollTop=k;else if(j>g){b&&(k+=l);var m=e-h;c.scrollTop=k-m}}},{key:"_4",value:function(a){var b,c=this.a.value,d="+".concat(a);if("+"===c.charAt(0)){var e=this._5(c);b=e?c.replace(e,d):d,this.a.value=b}else this.d.autoInsertDialCode&&(b=c?d+c:d,this.a.value=b)}},{key:"_5",value:function(a,b){var c="";if("+"===a.charAt(0))for(var d="",e=0;e<a.length;e++){var f=a.charAt(e);if(!isNaN(parseInt(f,10))){if(d+=f,b)this.q[d]&&(c=a.substr(0,e+1));else if(this.dialCodes[d]){c=a.substr(0,e+1);break}if(d.length===this.countryCodeMaxLen)break}}return c}},{key:"_6",value:function(){var a=this.a.value.trim(),b=this.s.dialCode,c=this._m(a);return(this.d.separateDialCode&&"+"!==a.charAt(0)&&b&&c?"+".concat(b):"")+a}},{key:"_7",value:function(a){var b=a;if(this.d.separateDialCode){var c=this._5(b);if(c){c="+".concat(this.s.dialCode);var d=" "===b[c.length]||"-"===b[c.length]?c.length+1:c.length;b=b.substr(d)}}return this._j2(b)}},{key:"_m2CountryChange",value:function(){this._m2("countrychange")}},{key:"handleAutoCountry",value:function(){"auto"===this.d.initialCountry&&(this.j=window.intlTelInputGlobals.autoCountry,this.a.value||this.setCountry(this.j),this.h())}},{key:"handleUtils",value:function(){window.intlTelInputUtils&&(this.a.value&&this._u(this.a.value),this._0()),this.i0()}},{key:"destroy",value:function(){var a=this.a.form;if(this.d.allowDropdown){this._2(),this.selectedFlag.removeEventListener("click",this._a10),this.k.removeEventListener("keydown",this._a11)
|
|
8
|
-
;var b=this._i1();b&&b.removeEventListener("click",this._a9)}this.hiddenInput&&a&&a.removeEventListener("submit",this._a14),this.d.autoInsertDialCode&&(a&&a.removeEventListener("submit",this._a8),this.a.removeEventListener("blur",this._a8)),this.a.removeEventListener("keyup",this._a12),this.a.removeEventListener("cut",this._a13),this.a.removeEventListener("paste",this._a13),this.a.removeAttribute("data-intl-tel-input-id");var c=this.a.parentNode;c.parentNode.insertBefore(this.a,c),c.parentNode.removeChild(c),delete window.intlTelInputGlobals.instances[this.id]}},{key:"getExtension",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getExtension(this._6(),this.s.iso2):""}},{key:"getNumber",value:function(a){if(window.intlTelInputUtils){var b=this.s.iso2;return intlTelInputUtils.formatNumber(this._6(),b,a)}return""}},{key:"getNumberType",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getNumberType(this._6(),this.s.iso2):-99}},{key:"getSelectedCountryData",value:function(){return this.s}},{key:"getValidationError",value:function(){if(window.intlTelInputUtils){var a=this.s.iso2;return intlTelInputUtils.getValidationError(this._6(),a)}return-99}},{key:"isValidNumber",value:function(){var a=this._6().trim(),b=this.d.nationalMode?this.s.iso2:"";return window.intlTelInputUtils?intlTelInputUtils.isValidNumber(a,b):null}},{key:"setCountry",value:function(a){var b=a.toLowerCase();this.l.classList.contains("iti__".concat(b))||(this._z(b),this._4(this.s.dialCode),this._m2CountryChange())}},{key:"setNumber",value:function(a){var b=this._v(a);this._u(a),b&&this._m2CountryChange()}},{key:"setPlaceholderNumberType",value:function(a){this.d.placeholderNumberType=a,this._0()}}]),c}();l.getCountryData=function(){return i};var s=function(a,b,c){var d=document.createElement("script");d.onload=function(){q("handleUtils"),b&&b()},d.onerror=function(){q("rejectUtilsScriptPromise"),c&&c()},d.className="iti-load-utils",d.async=!0,d.src=a,document.body.appendChild(d)};return l.loadUtils=function(a){if(!window.intlTelInputUtils&&!window.intlTelInputGlobals.startedLoadingUtilsScript){if(window.intlTelInputGlobals.startedLoadingUtilsScript=!0,"undefined"!=typeof Promise)return new Promise(function(b,c){return s(a,b,c)});s(a)}return null},l.defaults=n,l.version="18.0.
|
|
8
|
+
;var b=this._i1();b&&b.removeEventListener("click",this._a9)}this.hiddenInput&&a&&a.removeEventListener("submit",this._a14),this.d.autoInsertDialCode&&(a&&a.removeEventListener("submit",this._a8),this.a.removeEventListener("blur",this._a8)),this.a.removeEventListener("keyup",this._a12),this.a.removeEventListener("cut",this._a13),this.a.removeEventListener("paste",this._a13),this.a.removeAttribute("data-intl-tel-input-id");var c=this.a.parentNode;c.parentNode.insertBefore(this.a,c),c.parentNode.removeChild(c),delete window.intlTelInputGlobals.instances[this.id]}},{key:"getExtension",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getExtension(this._6(),this.s.iso2):""}},{key:"getNumber",value:function(a){if(window.intlTelInputUtils){var b=this.s.iso2;return intlTelInputUtils.formatNumber(this._6(),b,a)}return""}},{key:"getNumberType",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getNumberType(this._6(),this.s.iso2):-99}},{key:"getSelectedCountryData",value:function(){return this.s}},{key:"getValidationError",value:function(){if(window.intlTelInputUtils){var a=this.s.iso2;return intlTelInputUtils.getValidationError(this._6(),a)}return-99}},{key:"isValidNumber",value:function(){var a=this._6().trim(),b=this.d.nationalMode?this.s.iso2:"";return window.intlTelInputUtils?intlTelInputUtils.isValidNumber(a,b):null}},{key:"setCountry",value:function(a){var b=a.toLowerCase();this.l.classList.contains("iti__".concat(b))||(this._z(b),this._4(this.s.dialCode),this._m2CountryChange())}},{key:"setNumber",value:function(a){var b=this._v(a);this._u(a),b&&this._m2CountryChange()}},{key:"setPlaceholderNumberType",value:function(a){this.d.placeholderNumberType=a,this._0()}}]),c}();l.getCountryData=function(){return i};var s=function(a,b,c){var d=document.createElement("script");d.onload=function(){q("handleUtils"),b&&b()},d.onerror=function(){q("rejectUtilsScriptPromise"),c&&c()},d.className="iti-load-utils",d.async=!0,d.src=a,document.body.appendChild(d)};return l.loadUtils=function(a){if(!window.intlTelInputUtils&&!window.intlTelInputGlobals.startedLoadingUtilsScript){if(window.intlTelInputGlobals.startedLoadingUtilsScript=!0,"undefined"!=typeof Promise)return new Promise(function(b,c){return s(a,b,c)});s(a)}return null},l.defaults=n,l.version="18.0.2",function(a,b){var c=new r(a,b);return c._init(),a.setAttribute("data-intl-tel-input-id",c.id),window.intlTelInputGlobals.instances[c.id]=c,c}}()});
|
package/composer.json
CHANGED
package/demo.html
CHANGED
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
// dropdownContainer: document.body,
|
|
26
26
|
// excludeCountries: ["us"],
|
|
27
27
|
// formatOnDisplay: false,
|
|
28
|
-
// geoIpLookup: callback
|
|
28
|
+
// geoIpLookup: function(callback) {
|
|
29
29
|
// fetch("http://ip-api.com/json")
|
|
30
|
-
// .then(res
|
|
31
|
-
// .then(data
|
|
32
|
-
// .catch(()
|
|
30
|
+
// .then(function(res) { return res.json(); })
|
|
31
|
+
// .then(function(data) { callback(data.countryCode); })
|
|
32
|
+
// .catch(function() { callback("us"); });
|
|
33
33
|
// },
|
|
34
34
|
// hiddenInput: "full_number",
|
|
35
35
|
// initialCountry: "auto",
|
package/demo_rtl.html
CHANGED
|
@@ -19,26 +19,6 @@
|
|
|
19
19
|
<script>
|
|
20
20
|
var input = document.querySelector("#phone");
|
|
21
21
|
window.intlTelInput(input, {
|
|
22
|
-
// allowDropdown: false,
|
|
23
|
-
// autoInsertDialCode: false,
|
|
24
|
-
// autoPlaceholder: "off",
|
|
25
|
-
// dropdownContainer: document.body,
|
|
26
|
-
// excludeCountries: ["us"],
|
|
27
|
-
// formatOnDisplay: false,
|
|
28
|
-
// geoIpLookup: function(callback) {
|
|
29
|
-
// $.get("http://ipinfo.io", function() {}, "jsonp").always(function(resp) {
|
|
30
|
-
// var countryCode = (resp && resp.country) ? resp.country : "";
|
|
31
|
-
// callback(countryCode);
|
|
32
|
-
// });
|
|
33
|
-
// },
|
|
34
|
-
// hiddenInput: "full_number",
|
|
35
|
-
// initialCountry: "auto",
|
|
36
|
-
// localizedCountries: { 'de': 'Deutschland' },
|
|
37
|
-
// nationalMode: false,
|
|
38
|
-
// onlyCountries: ['us', 'gb', 'ch', 'ca', 'do'],
|
|
39
|
-
// placeholderNumberType: "MOBILE",
|
|
40
|
-
// preferredCountries: ['cn', 'jp'],
|
|
41
|
-
// separateDialCode: true,
|
|
42
22
|
utilsScript: "build/js/utils.js",
|
|
43
23
|
});
|
|
44
24
|
</script>
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<title>Example: Country sync</title>
|
|
6
6
|
<link rel="stylesheet" href="../css/prism.css">
|
|
7
|
-
<link rel="stylesheet" href="../../build/css/intlTelInput.css?
|
|
8
|
-
<link rel="stylesheet" href="../../build/css/demo.css?
|
|
7
|
+
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1680992740399">
|
|
8
|
+
<link rel="stylesheet" href="../../build/css/demo.css?1680992740399">
|
|
9
9
|
|
|
10
|
-
<link rel="stylesheet" href="../css/countrySync.css?
|
|
10
|
+
<link rel="stylesheet" href="../css/countrySync.css?1680992740399">
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
|
@@ -48,7 +48,7 @@ var countryData = window.intlTelInputGlobals.getCountryData(),
|
|
|
48
48
|
|
|
49
49
|
// init plugin
|
|
50
50
|
var iti = window.intlTelInput(input, {
|
|
51
|
-
utilsScript: "../../build/js/utils.js?
|
|
51
|
+
utilsScript: "../../build/js/utils.js?1680992740399" // just for formatting/placeholders etc
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
// populate the country dropdown
|
|
@@ -92,7 +92,7 @@ addressDropdown.addEventListener('change', function() {
|
|
|
92
92
|
</div>
|
|
93
93
|
|
|
94
94
|
<script src="../js/prism.js"></script>
|
|
95
|
-
<script src="../../build/js/intlTelInput.js?
|
|
96
|
-
<script src="./js/countrySync.js?
|
|
95
|
+
<script src="../../build/js/intlTelInput.js?1680992740399"></script>
|
|
96
|
+
<script src="./js/countrySync.js?1680992740399"></script>
|
|
97
97
|
</body>
|
|
98
98
|
</html>
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<title>Example: Lookup user's country</title>
|
|
6
6
|
<link rel="stylesheet" href="../css/prism.css">
|
|
7
|
-
<link rel="stylesheet" href="../../build/css/intlTelInput.css?
|
|
8
|
-
<link rel="stylesheet" href="../../build/css/demo.css?
|
|
7
|
+
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1680992740399">
|
|
8
|
+
<link rel="stylesheet" href="../../build/css/demo.css?1680992740399">
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
|
@@ -24,7 +24,10 @@
|
|
|
24
24
|
<p>Set initialCountry to 'auto' and pass in a function for geoIpLookup to perform a JSONP request to ipinfo.io, which returns the user's country based on their IP address.</p>
|
|
25
25
|
|
|
26
26
|
<h2>Markup</h2>
|
|
27
|
-
<pre><code class="language-markup"><
|
|
27
|
+
<pre><code class="language-markup"><!-- fetch and Promise polyfills for IE11 -->
|
|
28
|
+
<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"></script>
|
|
29
|
+
<script src="https://cdn.jsdelivr.net/npm/whatwg-fetch@3.6.2/dist/fetch.umd.min.js"></script>
|
|
30
|
+
|
|
28
31
|
<input id="phone" type="tel">
|
|
29
32
|
</code></pre>
|
|
30
33
|
|
|
@@ -33,24 +36,27 @@
|
|
|
33
36
|
window.intlTelInput(input, {
|
|
34
37
|
initialCountry: "auto",
|
|
35
38
|
geoIpLookup: function(callback) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
callback(countryCode);
|
|
39
|
-
|
|
39
|
+
fetch("http://ip-api.com/json")
|
|
40
|
+
.then(function(res) { return res.json(); })
|
|
41
|
+
.then(function(data) { callback(data.countryCode); })
|
|
42
|
+
.catch(function() { callback("us"); });
|
|
40
43
|
},
|
|
41
|
-
utilsScript: "../../build/js/utils.js?
|
|
44
|
+
utilsScript: "../../build/js/utils.js?1680992740399" // just for formatting/placeholders etc
|
|
42
45
|
});
|
|
43
46
|
</code></pre>
|
|
44
47
|
|
|
45
48
|
<h2>Result</h2>
|
|
46
49
|
<div id="result">
|
|
47
|
-
|
|
50
|
+
<!-- fetch and Promise polyfills for IE11 -->
|
|
51
|
+
<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"></script>
|
|
52
|
+
<script src="https://cdn.jsdelivr.net/npm/whatwg-fetch@3.6.2/dist/fetch.umd.min.js"></script>
|
|
53
|
+
|
|
48
54
|
<input id="phone" type="tel">
|
|
49
55
|
|
|
50
56
|
</div>
|
|
51
57
|
|
|
52
58
|
<script src="../js/prism.js"></script>
|
|
53
|
-
<script src="../../build/js/intlTelInput.js?
|
|
54
|
-
<script src="./js/defaultCountryIp.js?
|
|
59
|
+
<script src="../../build/js/intlTelInput.js?1680992740399"></script>
|
|
60
|
+
<script src="./js/defaultCountryIp.js?1680992740399"></script>
|
|
55
61
|
</body>
|
|
56
62
|
</html>
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<title>Example: Display an existing number</title>
|
|
6
6
|
<link rel="stylesheet" href="../css/prism.css">
|
|
7
|
-
<link rel="stylesheet" href="../../build/css/intlTelInput.css?
|
|
8
|
-
<link rel="stylesheet" href="../../build/css/demo.css?
|
|
7
|
+
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1680992740399">
|
|
8
|
+
<link rel="stylesheet" href="../../build/css/demo.css?1680992740399">
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<h2>Code</h2>
|
|
31
31
|
<pre><code class="language-javascript">var input = document.querySelector("#phone");
|
|
32
32
|
window.intlTelInput(input, {
|
|
33
|
-
utilsScript: "../../build/js/utils.js?
|
|
33
|
+
utilsScript: "../../build/js/utils.js?1680992740399" // just for formatting/placeholders etc
|
|
34
34
|
});
|
|
35
35
|
</code></pre>
|
|
36
36
|
|
|
@@ -41,7 +41,7 @@ window.intlTelInput(input, {
|
|
|
41
41
|
</div>
|
|
42
42
|
|
|
43
43
|
<script src="../js/prism.js"></script>
|
|
44
|
-
<script src="../../build/js/intlTelInput.js?
|
|
45
|
-
<script src="./js/displayNumber.js?
|
|
44
|
+
<script src="../../build/js/intlTelInput.js?1680992740399"></script>
|
|
45
|
+
<script src="./js/displayNumber.js?1680992740399"></script>
|
|
46
46
|
</body>
|
|
47
47
|
</html>
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<title>Example: Submitting the full international number using a hidden input</title>
|
|
6
6
|
<link rel="stylesheet" href="../css/prism.css">
|
|
7
|
-
<link rel="stylesheet" href="../../build/css/intlTelInput.css?
|
|
8
|
-
<link rel="stylesheet" href="../../build/css/demo.css?
|
|
7
|
+
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1680992740399">
|
|
8
|
+
<link rel="stylesheet" href="../../build/css/demo.css?1680992740399">
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
<pre><code class="language-javascript">var input = document.querySelector("#phone");
|
|
35
35
|
window.intlTelInput(input, {
|
|
36
36
|
hiddenInput: "full_phone",
|
|
37
|
-
utilsScript: "../../build/js/utils.js?
|
|
37
|
+
utilsScript: "../../build/js/utils.js?1680992740399" // just for formatting/placeholders etc
|
|
38
38
|
});
|
|
39
39
|
</code></pre>
|
|
40
40
|
|
|
@@ -48,7 +48,7 @@ window.intlTelInput(input, {
|
|
|
48
48
|
</div>
|
|
49
49
|
|
|
50
50
|
<script src="../js/prism.js"></script>
|
|
51
|
-
<script src="../../build/js/intlTelInput.js?
|
|
52
|
-
<script src="./js/hiddenInput.js?
|
|
51
|
+
<script src="../../build/js/intlTelInput.js?1680992740399"></script>
|
|
52
|
+
<script src="./js/hiddenInput.js?1680992740399"></script>
|
|
53
53
|
</body>
|
|
54
54
|
</html>
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<title>Example: Using the promise returned from initialisation</title>
|
|
6
6
|
<link rel="stylesheet" href="../css/prism.css">
|
|
7
|
-
<link rel="stylesheet" href="../../build/css/intlTelInput.css?
|
|
8
|
-
<link rel="stylesheet" href="../../build/css/demo.css?
|
|
7
|
+
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1680992740399">
|
|
8
|
+
<link rel="stylesheet" href="../../build/css/demo.css?1680992740399">
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
var statusElement = document.querySelector("#status");
|
|
40
40
|
|
|
41
41
|
var iti = window.intlTelInput(input, {
|
|
42
|
-
utilsScript: "../../build/js/utils.js?
|
|
42
|
+
utilsScript: "../../build/js/utils.js?1680992740399",
|
|
43
43
|
});
|
|
44
44
|
iti.promise.then(function() {
|
|
45
45
|
statusElement.innerHTML = "Initialised!";
|
|
@@ -60,7 +60,7 @@ iti.promise.then(function() {
|
|
|
60
60
|
</div>
|
|
61
61
|
|
|
62
62
|
<script src="../js/prism.js"></script>
|
|
63
|
-
<script src="../../build/js/intlTelInput.js?
|
|
64
|
-
<script src="./js/initPromise.js?
|
|
63
|
+
<script src="../../build/js/intlTelInput.js?1680992740399"></script>
|
|
64
|
+
<script src="./js/initPromise.js?1680992740399"></script>
|
|
65
65
|
</body>
|
|
66
66
|
</html>
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<title>Example: Validation</title>
|
|
6
6
|
<link rel="stylesheet" href="../css/prism.css">
|
|
7
|
-
<link rel="stylesheet" href="../../build/css/intlTelInput.css?
|
|
8
|
-
<link rel="stylesheet" href="../../build/css/demo.css?
|
|
7
|
+
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1680992740399">
|
|
8
|
+
<link rel="stylesheet" href="../../build/css/demo.css?1680992740399">
|
|
9
9
|
|
|
10
|
-
<link rel="stylesheet" href="../css/isValidNumber.css?
|
|
10
|
+
<link rel="stylesheet" href="../css/isValidNumber.css?1680992740399">
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
|
@@ -41,7 +41,7 @@ var errorMap = ["Invalid number", "Invalid country code", &q
|
|
|
41
41
|
|
|
42
42
|
// initialise plugin
|
|
43
43
|
var iti = window.intlTelInput(input, {
|
|
44
|
-
utilsScript: "../../build/js/utils.js?
|
|
44
|
+
utilsScript: "../../build/js/utils.js?1680992740399"
|
|
45
45
|
});
|
|
46
46
|
|
|
47
47
|
var reset = function() {
|
|
@@ -80,7 +80,7 @@ input.addEventListener('keyup', reset);
|
|
|
80
80
|
</div>
|
|
81
81
|
|
|
82
82
|
<script src="../js/prism.js"></script>
|
|
83
|
-
<script src="../../build/js/intlTelInput.js?
|
|
84
|
-
<script src="./js/isValidNumber.js?
|
|
83
|
+
<script src="../../build/js/intlTelInput.js?1680992740399"></script>
|
|
84
|
+
<script src="./js/isValidNumber.js?1680992740399"></script>
|
|
85
85
|
</body>
|
|
86
86
|
</html>
|
|
@@ -5,7 +5,7 @@ var countryData = window.intlTelInputGlobals.getCountryData(),
|
|
|
5
5
|
|
|
6
6
|
// init plugin
|
|
7
7
|
var iti = window.intlTelInput(input, {
|
|
8
|
-
utilsScript: "../../build/js/utils.js?
|
|
8
|
+
utilsScript: "../../build/js/utils.js?1680992740399" // just for formatting/placeholders etc
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
// populate the country dropdown
|
|
@@ -2,10 +2,10 @@ var input = document.querySelector("#phone");
|
|
|
2
2
|
window.intlTelInput(input, {
|
|
3
3
|
initialCountry: "auto",
|
|
4
4
|
geoIpLookup: function(callback) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
callback(countryCode);
|
|
8
|
-
|
|
5
|
+
fetch("http://ip-api.com/json")
|
|
6
|
+
.then(function(res) { return res.json(); })
|
|
7
|
+
.then(function(data) { callback(data.countryCode); })
|
|
8
|
+
.catch(function() { callback("us"); });
|
|
9
9
|
},
|
|
10
|
-
utilsScript: "../../build/js/utils.js?
|
|
10
|
+
utilsScript: "../../build/js/utils.js?1680992740399" // just for formatting/placeholders etc
|
|
11
11
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
var input = document.querySelector("#phone");
|
|
2
2
|
window.intlTelInput(input, {
|
|
3
|
-
utilsScript: "../../build/js/utils.js?
|
|
3
|
+
utilsScript: "../../build/js/utils.js?1680992740399" // just for formatting/placeholders etc
|
|
4
4
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var input = document.querySelector("#phone");
|
|
2
2
|
window.intlTelInput(input, {
|
|
3
3
|
hiddenInput: "full_phone",
|
|
4
|
-
utilsScript: "../../build/js/utils.js?
|
|
4
|
+
utilsScript: "../../build/js/utils.js?1680992740399" // just for formatting/placeholders etc
|
|
5
5
|
});
|
|
@@ -2,7 +2,7 @@ var input = document.querySelector("#phone");
|
|
|
2
2
|
var statusElement = document.querySelector("#status");
|
|
3
3
|
|
|
4
4
|
var iti = window.intlTelInput(input, {
|
|
5
|
-
utilsScript: "../../build/js/utils.js?
|
|
5
|
+
utilsScript: "../../build/js/utils.js?1680992740399",
|
|
6
6
|
});
|
|
7
7
|
iti.promise.then(function() {
|
|
8
8
|
statusElement.innerHTML = "Initialised!";
|
|
@@ -7,7 +7,7 @@ var errorMap = ["Invalid number", "Invalid country code", "Too short", "Too long
|
|
|
7
7
|
|
|
8
8
|
// initialise plugin
|
|
9
9
|
var iti = window.intlTelInput(input, {
|
|
10
|
-
utilsScript: "../../build/js/utils.js?
|
|
10
|
+
utilsScript: "../../build/js/utils.js?1680992740399"
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
var reset = function() {
|
|
@@ -7,5 +7,5 @@ for (var i = 0; i < countryData.length; i++) {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
window.intlTelInput(input, {
|
|
10
|
-
utilsScript: "../../build/js/utils.js?
|
|
10
|
+
utilsScript: "../../build/js/utils.js?1680992740399" // just for formatting/placeholders etc
|
|
11
11
|
});
|
|
@@ -4,10 +4,10 @@ var inputMobile = document.querySelector("#mobile");
|
|
|
4
4
|
window.intlTelInput(inputHome, {
|
|
5
5
|
initialCountry: 'gb',
|
|
6
6
|
placeholderNumberType: 'FIXED_LINE',
|
|
7
|
-
utilsScript: "../../build/js/utils.js?
|
|
7
|
+
utilsScript: "../../build/js/utils.js?1680992740399" // just for formatting/placeholders etc
|
|
8
8
|
});
|
|
9
9
|
window.intlTelInput(inputMobile, {
|
|
10
10
|
initialCountry: 'gb',
|
|
11
11
|
placeholderNumberType: 'MOBILE',
|
|
12
|
-
utilsScript: "../../build/js/utils.js?
|
|
12
|
+
utilsScript: "../../build/js/utils.js?1680992740399"
|
|
13
13
|
});
|
|
@@ -3,7 +3,7 @@ var input = document.querySelector("#phone"),
|
|
|
3
3
|
|
|
4
4
|
var iti = window.intlTelInput(input, {
|
|
5
5
|
nationalMode: true,
|
|
6
|
-
utilsScript: "../../build/js/utils.js?
|
|
6
|
+
utilsScript: "../../build/js/utils.js?1680992740399" // just for formatting/placeholders etc
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
var handleChange = function() {
|
|
@@ -4,5 +4,5 @@ window.intlTelInput(input, {
|
|
|
4
4
|
"ee", "fo", "fi", "fr", "de", "gi", "gr", "va", "hu", "is", "ie", "it", "lv",
|
|
5
5
|
"li", "lt", "lu", "mk", "mt", "md", "mc", "me", "nl", "no", "pl", "pt", "ro",
|
|
6
6
|
"ru", "sm", "rs", "sk", "si", "es", "se", "ch", "ua", "gb"],
|
|
7
|
-
utilsScript: "../../build/js/utils.js?
|
|
7
|
+
utilsScript: "../../build/js/utils.js?1680992740399" // just for formatting/placeholders etc
|
|
8
8
|
});
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<title>Example: Modify country data</title>
|
|
6
6
|
<link rel="stylesheet" href="../css/prism.css">
|
|
7
|
-
<link rel="stylesheet" href="../../build/css/intlTelInput.css?
|
|
8
|
-
<link rel="stylesheet" href="../../build/css/demo.css?
|
|
7
|
+
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1680992740399">
|
|
8
|
+
<link rel="stylesheet" href="../../build/css/demo.css?1680992740399">
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
|
@@ -36,7 +36,7 @@ for (var i = 0; i < countryData.length; i++) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
window.intlTelInput(input, {
|
|
39
|
-
utilsScript: "../../build/js/utils.js?
|
|
39
|
+
utilsScript: "../../build/js/utils.js?1680992740399" // just for formatting/placeholders etc
|
|
40
40
|
});
|
|
41
41
|
</code></pre>
|
|
42
42
|
|
|
@@ -46,7 +46,7 @@ window.intlTelInput(input, {
|
|
|
46
46
|
</div>
|
|
47
47
|
|
|
48
48
|
<script src="../js/prism.js"></script>
|
|
49
|
-
<script src="../../build/js/intlTelInput.js?
|
|
50
|
-
<script src="./js/modifyCountryData.js?
|
|
49
|
+
<script src="../../build/js/intlTelInput.js?1680992740399"></script>
|
|
50
|
+
<script src="./js/modifyCountryData.js?1680992740399"></script>
|
|
51
51
|
</body>
|
|
52
52
|
</html>
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<title>Example: Multiple Instances</title>
|
|
6
6
|
<link rel="stylesheet" href="../css/prism.css">
|
|
7
|
-
<link rel="stylesheet" href="../../build/css/intlTelInput.css?
|
|
8
|
-
<link rel="stylesheet" href="../../build/css/demo.css?
|
|
7
|
+
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1680992740399">
|
|
8
|
+
<link rel="stylesheet" href="../../build/css/demo.css?1680992740399">
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
|
@@ -36,12 +36,12 @@ var inputMobile = document.querySelector("#mobile");
|
|
|
36
36
|
window.intlTelInput(inputHome, {
|
|
37
37
|
initialCountry: 'gb',
|
|
38
38
|
placeholderNumberType: 'FIXED_LINE',
|
|
39
|
-
utilsScript: "../../build/js/utils.js?
|
|
39
|
+
utilsScript: "../../build/js/utils.js?1680992740399" // just for formatting/placeholders etc
|
|
40
40
|
});
|
|
41
41
|
window.intlTelInput(inputMobile, {
|
|
42
42
|
initialCountry: 'gb',
|
|
43
43
|
placeholderNumberType: 'MOBILE',
|
|
44
|
-
utilsScript: "../../build/js/utils.js?
|
|
44
|
+
utilsScript: "../../build/js/utils.js?1680992740399"
|
|
45
45
|
});
|
|
46
46
|
</code></pre>
|
|
47
47
|
|
|
@@ -54,7 +54,7 @@ Mobile: <input id="mobile" type="tel">
|
|
|
54
54
|
</div>
|
|
55
55
|
|
|
56
56
|
<script src="../js/prism.js"></script>
|
|
57
|
-
<script src="../../build/js/intlTelInput.js?
|
|
58
|
-
<script src="./js/multipleInstances.js?
|
|
57
|
+
<script src="../../build/js/intlTelInput.js?1680992740399"></script>
|
|
58
|
+
<script src="./js/multipleInstances.js?1680992740399"></script>
|
|
59
59
|
</body>
|
|
60
60
|
</html>
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<title>Example: National Mode</title>
|
|
6
6
|
<link rel="stylesheet" href="../css/prism.css">
|
|
7
|
-
<link rel="stylesheet" href="../../build/css/intlTelInput.css?
|
|
8
|
-
<link rel="stylesheet" href="../../build/css/demo.css?
|
|
7
|
+
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1680992740399">
|
|
8
|
+
<link rel="stylesheet" href="../../build/css/demo.css?1680992740399">
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
|
|
35
35
|
var iti = window.intlTelInput(input, {
|
|
36
36
|
nationalMode: true,
|
|
37
|
-
utilsScript: "../../build/js/utils.js?
|
|
37
|
+
utilsScript: "../../build/js/utils.js?1680992740399" // just for formatting/placeholders etc
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
var handleChange = function() {
|
|
@@ -57,7 +57,7 @@ input.addEventListener('keyup', handleChange);
|
|
|
57
57
|
</div>
|
|
58
58
|
|
|
59
59
|
<script src="../js/prism.js"></script>
|
|
60
|
-
<script src="../../build/js/intlTelInput.js?
|
|
61
|
-
<script src="./js/nationalMode.js?
|
|
60
|
+
<script src="../../build/js/intlTelInput.js?1680992740399"></script>
|
|
61
|
+
<script src="./js/nationalMode.js?1680992740399"></script>
|
|
62
62
|
</body>
|
|
63
63
|
</html>
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8">
|
|
5
|
-
<title>Example:
|
|
5
|
+
<title>Example: Only countries option</title>
|
|
6
6
|
<link rel="stylesheet" href="../css/prism.css">
|
|
7
|
-
<link rel="stylesheet" href="../../build/css/intlTelInput.css?
|
|
8
|
-
<link rel="stylesheet" href="../../build/css/demo.css?
|
|
7
|
+
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1680992740399">
|
|
8
|
+
<link rel="stylesheet" href="../../build/css/demo.css?1680992740399">
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
<!-- Global site tag (gtag.js) - Google Analytics -->
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
<body>
|
|
22
22
|
<a href="/">Back</a>
|
|
23
|
-
<h1>Example:
|
|
23
|
+
<h1>Example: Only countries option</h1>
|
|
24
24
|
<p>Set onlyCountries option to just European country codes.</p>
|
|
25
25
|
|
|
26
26
|
<h2>Markup</h2>
|
|
@@ -33,7 +33,7 @@ window.intlTelInput(input, {
|
|
|
33
33
|
"ee", "fo", "fi", "fr", "de", "gi", "gr", "va", "hu", "is", "ie", "it", "lv",
|
|
34
34
|
"li", "lt", "lu", "mk", "mt", "md", "mc", "me", "nl", "no", "pl", "pt", "ro",
|
|
35
35
|
"ru", "sm", "rs", "sk", "si", "es", "se", "ch", "ua", "gb"],
|
|
36
|
-
utilsScript: "../../build/js/utils.js?
|
|
36
|
+
utilsScript: "../../build/js/utils.js?1680992740399" // just for formatting/placeholders etc
|
|
37
37
|
});
|
|
38
38
|
</code></pre>
|
|
39
39
|
|
|
@@ -43,7 +43,7 @@ window.intlTelInput(input, {
|
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
<script src="../js/prism.js"></script>
|
|
46
|
-
<script src="../../build/js/intlTelInput.js?
|
|
47
|
-
<script src="./js/onlyCountriesEurope.js?
|
|
46
|
+
<script src="../../build/js/intlTelInput.js?1680992740399"></script>
|
|
47
|
+
<script src="./js/onlyCountriesEurope.js?1680992740399"></script>
|
|
48
48
|
</body>
|
|
49
49
|
</html>
|
|
@@ -2,10 +2,10 @@ var input = document.querySelector("#phone");
|
|
|
2
2
|
window.intlTelInput(input, {
|
|
3
3
|
initialCountry: "auto",
|
|
4
4
|
geoIpLookup: function(callback) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
callback(countryCode);
|
|
8
|
-
|
|
5
|
+
fetch("http://ip-api.com/json")
|
|
6
|
+
.then(function(res) { return res.json(); })
|
|
7
|
+
.then(function(data) { callback(data.countryCode); })
|
|
8
|
+
.catch(function() { callback("us"); });
|
|
9
9
|
},
|
|
10
10
|
utilsScript: "../../build/js/utils.js?<%= time %>" // just for formatting/placeholders etc
|
|
11
11
|
});
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- fetch and Promise polyfills for IE11 -->
|
|
2
|
+
<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"></script>
|
|
3
|
+
<script src="https://cdn.jsdelivr.net/npm/whatwg-fetch@3.6.2/dist/fetch.umd.min.js"></script>
|
|
4
|
+
|
|
2
5
|
<input id="phone" type="tel">
|
package/grunt/template.js
CHANGED
|
@@ -169,7 +169,7 @@ module.exports = function(grunt) {
|
|
|
169
169
|
data: function() {
|
|
170
170
|
return {
|
|
171
171
|
time: time,
|
|
172
|
-
title: "
|
|
172
|
+
title: "Only countries option",
|
|
173
173
|
desc: "Set onlyCountries option to just European country codes.",
|
|
174
174
|
stylesheet: "",
|
|
175
175
|
markup: grunt.file.read('examples/partials/simpleInput.html'),
|