intl-tel-input 17.0.21 → 18.0.1
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/CHANGELOG.md +19 -15
- package/README.md +16 -17
- package/build/css/intlTelInput.css +16 -5
- package/build/css/intlTelInput.min.css +1 -1
- package/build/js/data.js +2 -2
- package/build/js/data.min.js +2 -2
- package/build/js/intlTelInput-jquery.js +97 -49
- package/build/js/intlTelInput-jquery.min.js +3 -3
- package/build/js/intlTelInput.js +97 -49
- package/build/js/intlTelInput.min.js +3 -3
- package/composer.json +1 -1
- package/demo.html +5 -5
- package/demo_rtl.html +27 -0
- 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/spec.html +1 -1
- package/src/css/intlTelInput.scss +23 -6
- package/src/js/data.js +1 -1
- package/src/js/intlTelInput.js +53 -50
- package/src/spec/tests/core/dropdownShortcuts.js +3 -2
- package/src/spec/tests/core/multipleInstances.js +8 -7
- package/src/spec/tests/core/usingDropdown.js +30 -10
- package/src/spec/tests/methods/destroy.js +2 -2
- package/src/spec/tests/options/allowDropdown.js +8 -0
- package/src/spec/tests/options/{autoHideDialCode.js → autoInsertDialCode.js} +18 -28
- package/src/spec/tests/options/separateDialCode.js +42 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* International Telephone Input
|
|
2
|
+
* International Telephone Input v18.0.1
|
|
3
3
|
* https://github.com/jackocnr/intl-tel-input.git
|
|
4
4
|
* Licensed under the MIT license
|
|
5
5
|
*/
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
// Order (if >1 country with same dial code),
|
|
30
30
|
// Area codes
|
|
31
31
|
// ]
|
|
32
|
-
var allCountries = [ [ "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", "387", "403", "416", "418", "431", "437", "438", "450", "506", "514", "519", "548", "579", "581", "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" ] ] ];
|
|
32
|
+
var allCountries = [ [ "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" ] ] ];
|
|
33
33
|
// loop over all of the countries above, restructuring the data to be objects with named keys
|
|
34
34
|
for (var i = 0; i < allCountries.length; i++) {
|
|
35
35
|
var c = allCountries[i];
|
|
@@ -42,6 +42,35 @@
|
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
"use strict";
|
|
45
|
+
function _objectSpread(target) {
|
|
46
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
47
|
+
var source = arguments[i] != null ? Object(arguments[i]) : {};
|
|
48
|
+
var ownKeys = Object.keys(source);
|
|
49
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
50
|
+
ownKeys.push.apply(ownKeys, Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
51
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
ownKeys.forEach(function(key) {
|
|
55
|
+
_defineProperty(target, key, source[key]);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return target;
|
|
59
|
+
}
|
|
60
|
+
function _defineProperty(obj, key, value) {
|
|
61
|
+
key = _toPropertyKey(key);
|
|
62
|
+
if (key in obj) {
|
|
63
|
+
Object.defineProperty(obj, key, {
|
|
64
|
+
value: value,
|
|
65
|
+
enumerable: true,
|
|
66
|
+
configurable: true,
|
|
67
|
+
writable: true
|
|
68
|
+
});
|
|
69
|
+
} else {
|
|
70
|
+
obj[key] = value;
|
|
71
|
+
}
|
|
72
|
+
return obj;
|
|
73
|
+
}
|
|
45
74
|
function _classCallCheck(instance, Constructor) {
|
|
46
75
|
if (!(instance instanceof Constructor)) {
|
|
47
76
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -53,14 +82,31 @@
|
|
|
53
82
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
54
83
|
descriptor.configurable = true;
|
|
55
84
|
if ("value" in descriptor) descriptor.writable = true;
|
|
56
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
85
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
57
86
|
}
|
|
58
87
|
}
|
|
59
88
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
60
89
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
61
90
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
91
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
92
|
+
writable: false
|
|
93
|
+
});
|
|
62
94
|
return Constructor;
|
|
63
95
|
}
|
|
96
|
+
function _toPropertyKey(arg) {
|
|
97
|
+
var key = _toPrimitive(arg, "string");
|
|
98
|
+
return typeof key === "symbol" ? key : String(key);
|
|
99
|
+
}
|
|
100
|
+
function _toPrimitive(input, hint) {
|
|
101
|
+
if (typeof input !== "object" || input === null) return input;
|
|
102
|
+
var prim = input[Symbol.toPrimitive];
|
|
103
|
+
if (prim !== undefined) {
|
|
104
|
+
var res = prim.call(input, hint || "default");
|
|
105
|
+
if (typeof res !== "object") return res;
|
|
106
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
107
|
+
}
|
|
108
|
+
return (hint === "string" ? String : Number)(input);
|
|
109
|
+
}
|
|
64
110
|
var intlTelInputGlobals = {
|
|
65
111
|
getInstance: function getInstance(input) {
|
|
66
112
|
var id = input.getAttribute("data-intl-tel-input-id");
|
|
@@ -78,8 +124,9 @@
|
|
|
78
124
|
var defaults = {
|
|
79
125
|
// whether or not to allow the dropdown
|
|
80
126
|
allowDropdown: true,
|
|
81
|
-
//
|
|
82
|
-
|
|
127
|
+
// auto insert dial code (A) on init, (B) on user selecting a country, (C) on calling setCountry
|
|
128
|
+
// also listen for blur/submit and auto remove dial code if that's all there is
|
|
129
|
+
autoInsertDialCode: false,
|
|
83
130
|
// add a placeholder in the input with an example number for the selected country
|
|
84
131
|
autoPlaceholder: "polite",
|
|
85
132
|
// modify the parentClass
|
|
@@ -100,7 +147,7 @@
|
|
|
100
147
|
initialCountry: "",
|
|
101
148
|
// localized country names e.g. { 'de': 'Deutschland' }
|
|
102
149
|
localizedCountries: null,
|
|
103
|
-
//
|
|
150
|
+
// deal with national numbers instead of international numbers
|
|
104
151
|
nationalMode: true,
|
|
105
152
|
// display only these countries
|
|
106
153
|
onlyCountries: [],
|
|
@@ -108,7 +155,7 @@
|
|
|
108
155
|
placeholderNumberType: "MOBILE",
|
|
109
156
|
// the countries at the top of the list. defaults to united states and united kingdom
|
|
110
157
|
preferredCountries: [ "us", "gb" ],
|
|
111
|
-
// display the country dial code next to the selected flag
|
|
158
|
+
// display the country dial code next to the selected flag
|
|
112
159
|
separateDialCode: false,
|
|
113
160
|
// specify the path to the libphonenumber script to enable validation/formatting
|
|
114
161
|
utilsScript: ""
|
|
@@ -131,8 +178,7 @@
|
|
|
131
178
|
};
|
|
132
179
|
// this is our plugin class that we will create an instance of
|
|
133
180
|
// eslint-disable-next-line no-unused-vars
|
|
134
|
-
var Iti = /*#__PURE__*/
|
|
135
|
-
function() {
|
|
181
|
+
var Iti = /*#__PURE__*/ function() {
|
|
136
182
|
function Iti(input, options) {
|
|
137
183
|
var _this = this;
|
|
138
184
|
_classCallCheck(this, Iti);
|
|
@@ -153,14 +199,10 @@
|
|
|
153
199
|
key: "_init",
|
|
154
200
|
value: function _init() {
|
|
155
201
|
var _this2 = this;
|
|
156
|
-
// if in nationalMode,
|
|
157
|
-
if (this.options.nationalMode) this.options.
|
|
158
|
-
// if separateDialCode
|
|
159
|
-
|
|
160
|
-
// dial code next to them)
|
|
161
|
-
if (this.options.separateDialCode) {
|
|
162
|
-
this.options.autoHideDialCode = this.options.nationalMode = false;
|
|
163
|
-
}
|
|
202
|
+
// if in nationalMode, do not insert dial codes
|
|
203
|
+
if (this.options.nationalMode) this.options.autoInsertDialCode = false;
|
|
204
|
+
// if separateDialCode enabled, do not insert dial codes
|
|
205
|
+
if (this.options.separateDialCode) this.options.autoInsertDialCode = false;
|
|
164
206
|
// we cannot just test screen size as some smartphones/website meta tags will report desktop
|
|
165
207
|
// resolutions
|
|
166
208
|
// Note: for some reason jasmine breaks if you put this in the main Plugin function with the
|
|
@@ -200,7 +242,7 @@
|
|
|
200
242
|
this._generateMarkup();
|
|
201
243
|
// set the initial state of the input value and the selected flag
|
|
202
244
|
this._setInitialState();
|
|
203
|
-
// start all of the event listeners:
|
|
245
|
+
// start all of the event listeners: autoInsertDialCode, input keydown, selectedFlag click
|
|
204
246
|
this._initListeners();
|
|
205
247
|
// utils script, and auto country
|
|
206
248
|
this._initRequests();
|
|
@@ -272,7 +314,9 @@
|
|
|
272
314
|
}, {
|
|
273
315
|
key: "_countryNameSort",
|
|
274
316
|
value: function _countryNameSort(a, b) {
|
|
275
|
-
|
|
317
|
+
if (a.name < b.name) return -1;
|
|
318
|
+
if (a.name > b.name) return 1;
|
|
319
|
+
return 0;
|
|
276
320
|
}
|
|
277
321
|
}, {
|
|
278
322
|
key: "_processCountryCodes",
|
|
@@ -360,24 +404,34 @@
|
|
|
360
404
|
}, wrapper);
|
|
361
405
|
wrapper.appendChild(this.telInput);
|
|
362
406
|
// selected flag (displayed to left of input)
|
|
363
|
-
|
|
364
|
-
|
|
407
|
+
// using Aria tags for "Select-Only Combobox Example"
|
|
408
|
+
// https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/
|
|
409
|
+
this.selectedFlag = this._createEl("div", _objectSpread({
|
|
410
|
+
"class": "iti__selected-flag"
|
|
411
|
+
}, this.options.allowDropdown && {
|
|
365
412
|
role: "combobox",
|
|
413
|
+
"aria-haspopup": "listbox",
|
|
366
414
|
"aria-controls": "iti-".concat(this.id, "__country-listbox"),
|
|
367
415
|
"aria-owns": "iti-".concat(this.id, "__country-listbox"),
|
|
368
|
-
"aria-expanded": "false"
|
|
369
|
-
|
|
416
|
+
"aria-expanded": "false",
|
|
417
|
+
"aria-label": "Telephone country code"
|
|
418
|
+
}), this.flagsContainer);
|
|
370
419
|
this.selectedFlagInner = this._createEl("div", {
|
|
371
420
|
"class": "iti__flag"
|
|
372
421
|
}, this.selectedFlag);
|
|
422
|
+
if (this.telInput.disabled) {
|
|
423
|
+
this.selectedFlag.setAttribute("aria-disabled", "true");
|
|
424
|
+
}
|
|
373
425
|
if (this.options.separateDialCode) {
|
|
374
426
|
this.selectedDialCode = this._createEl("div", {
|
|
375
427
|
"class": "iti__selected-dial-code"
|
|
376
428
|
}, this.selectedFlag);
|
|
377
429
|
}
|
|
378
430
|
if (this.options.allowDropdown) {
|
|
379
|
-
|
|
380
|
-
|
|
431
|
+
if (!this.telInput.disabled) {
|
|
432
|
+
// make element focusable and tab navigable
|
|
433
|
+
this.selectedFlag.setAttribute("tabindex", "0");
|
|
434
|
+
}
|
|
381
435
|
this.dropdownArrow = this._createEl("div", {
|
|
382
436
|
"class": "iti__arrow"
|
|
383
437
|
}, this.selectedFlag);
|
|
@@ -457,7 +511,7 @@
|
|
|
457
511
|
var val = useAttribute ? attributeValue : inputValue;
|
|
458
512
|
var dialCode = this._getDialCode(val);
|
|
459
513
|
var isRegionlessNanp = this._isRegionlessNanp(val);
|
|
460
|
-
var _this$options = this.options, initialCountry = _this$options.initialCountry,
|
|
514
|
+
var _this$options = this.options, initialCountry = _this$options.initialCountry, autoInsertDialCode = _this$options.autoInsertDialCode;
|
|
461
515
|
// if we already have a dial code, and it's not a regionlessNanp, we can go ahead and set the
|
|
462
516
|
// flag, else fall back to the default country
|
|
463
517
|
if (dialCode && !isRegionlessNanp) {
|
|
@@ -478,8 +532,8 @@
|
|
|
478
532
|
}
|
|
479
533
|
}
|
|
480
534
|
}
|
|
481
|
-
// if empty and
|
|
482
|
-
if (!val &&
|
|
535
|
+
// if empty and autoInsertDialCode then insert the dial code
|
|
536
|
+
if (!val && autoInsertDialCode) {
|
|
483
537
|
this.telInput.value = "+".concat(this.selectedCountryData.dialCode);
|
|
484
538
|
}
|
|
485
539
|
}
|
|
@@ -491,7 +545,7 @@
|
|
|
491
545
|
key: "_initListeners",
|
|
492
546
|
value: function _initListeners() {
|
|
493
547
|
this._initKeyListeners();
|
|
494
|
-
if (this.options.
|
|
548
|
+
if (this.options.autoInsertDialCode) this._initBlurListeners();
|
|
495
549
|
if (this.options.allowDropdown) this._initDropdownListeners();
|
|
496
550
|
if (this.hiddenInput) this._initHiddenInputListener();
|
|
497
551
|
}
|
|
@@ -818,7 +872,7 @@
|
|
|
818
872
|
value: function _updateValFromNumber(originalNumber) {
|
|
819
873
|
var number = originalNumber;
|
|
820
874
|
if (this.options.formatOnDisplay && window.intlTelInputUtils && this.selectedCountryData) {
|
|
821
|
-
var useNational =
|
|
875
|
+
var useNational = this.options.nationalMode || number.charAt(0) !== "+" && !this.options.separateDialCode;
|
|
822
876
|
var _intlTelInputUtils$nu = intlTelInputUtils.numberFormat, NATIONAL = _intlTelInputUtils$nu.NATIONAL, INTERNATIONAL = _intlTelInputUtils$nu.INTERNATIONAL;
|
|
823
877
|
var format = useNational ? NATIONAL : INTERNATIONAL;
|
|
824
878
|
number = intlTelInputUtils.formatNumber(number, this.selectedCountryData.iso2, format);
|
|
@@ -841,7 +895,7 @@
|
|
|
841
895
|
if (number.charAt(0) !== "1") number = "1".concat(number);
|
|
842
896
|
number = "+".concat(number);
|
|
843
897
|
}
|
|
844
|
-
//
|
|
898
|
+
// if separateDialCode enabled, then consider the selected dial code to be part of the number
|
|
845
899
|
if (this.options.separateDialCode && selectedDialCode && number.charAt(0) !== "+") {
|
|
846
900
|
number = "+".concat(selectedDialCode).concat(number);
|
|
847
901
|
}
|
|
@@ -902,6 +956,7 @@
|
|
|
902
956
|
if (prevItem) prevItem.classList.remove("iti__highlight");
|
|
903
957
|
this.highlightedItem = listItem;
|
|
904
958
|
this.highlightedItem.classList.add("iti__highlight");
|
|
959
|
+
this.selectedFlag.setAttribute("aria-activedescendant", listItem.getAttribute("id"));
|
|
905
960
|
if (shouldFocus) this.highlightedItem.focus();
|
|
906
961
|
}
|
|
907
962
|
}, {
|
|
@@ -955,7 +1010,6 @@
|
|
|
955
1010
|
nextItem.setAttribute("aria-selected", "true");
|
|
956
1011
|
nextItem.classList.add("iti__active");
|
|
957
1012
|
this.activeItem = nextItem;
|
|
958
|
-
this.selectedFlag.setAttribute("aria-activedescendant", nextItem.getAttribute("id"));
|
|
959
1013
|
}
|
|
960
1014
|
}
|
|
961
1015
|
// return if the flag has changed or not
|
|
@@ -997,7 +1051,7 @@
|
|
|
997
1051
|
// update selected flag and active list item
|
|
998
1052
|
var flagChanged = this._setFlag(listItem.getAttribute("data-country-code"));
|
|
999
1053
|
this._closeDropdown();
|
|
1000
|
-
this._updateDialCode(listItem.getAttribute("data-dial-code")
|
|
1054
|
+
this._updateDialCode(listItem.getAttribute("data-dial-code"));
|
|
1001
1055
|
// focus the input
|
|
1002
1056
|
this.telInput.focus();
|
|
1003
1057
|
// put cursor at end - this fix is required for FF and IE11 (with nationalMode=false i.e. auto
|
|
@@ -1013,6 +1067,7 @@
|
|
|
1013
1067
|
value: function _closeDropdown() {
|
|
1014
1068
|
this.countryList.classList.add("iti__hide");
|
|
1015
1069
|
this.selectedFlag.setAttribute("aria-expanded", "false");
|
|
1070
|
+
this.selectedFlag.removeAttribute("aria-activedescendant");
|
|
1016
1071
|
// update the arrow
|
|
1017
1072
|
this.dropdownArrow.classList.remove("iti__arrow--up");
|
|
1018
1073
|
// unbind key events
|
|
@@ -1054,7 +1109,7 @@
|
|
|
1054
1109
|
}
|
|
1055
1110
|
}, {
|
|
1056
1111
|
key: "_updateDialCode",
|
|
1057
|
-
value: function _updateDialCode(newDialCodeBare
|
|
1112
|
+
value: function _updateDialCode(newDialCodeBare) {
|
|
1058
1113
|
var inputVal = this.telInput.value;
|
|
1059
1114
|
// save having to pass this every time
|
|
1060
1115
|
var newDialCode = "+".concat(newDialCodeBare);
|
|
@@ -1070,23 +1125,16 @@
|
|
|
1070
1125
|
// (no way to determine where the invalid dial code ends and the rest of the number begins)
|
|
1071
1126
|
newNumber = newDialCode;
|
|
1072
1127
|
}
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
return;
|
|
1076
|
-
} else {
|
|
1077
|
-
// nationalMode is disabled
|
|
1128
|
+
this.telInput.value = newNumber;
|
|
1129
|
+
} else if (this.options.autoInsertDialCode) {
|
|
1078
1130
|
if (inputVal) {
|
|
1079
1131
|
// there is an existing value with no dial code: prefix the new dial code
|
|
1080
1132
|
newNumber = newDialCode + inputVal;
|
|
1081
|
-
} else if (hasSelectedListItem || !this.options.autoHideDialCode) {
|
|
1082
|
-
// no existing value and either they've just selected a list item, or autoHideDialCode is
|
|
1083
|
-
// disabled: insert new dial code
|
|
1084
|
-
newNumber = newDialCode;
|
|
1085
1133
|
} else {
|
|
1086
|
-
|
|
1134
|
+
newNumber = newDialCode;
|
|
1087
1135
|
}
|
|
1136
|
+
this.telInput.value = newNumber;
|
|
1088
1137
|
}
|
|
1089
|
-
this.telInput.value = newNumber;
|
|
1090
1138
|
}
|
|
1091
1139
|
}, {
|
|
1092
1140
|
key: "_getDialCode",
|
|
@@ -1205,8 +1253,8 @@
|
|
|
1205
1253
|
}
|
|
1206
1254
|
// unbind hiddenInput listeners
|
|
1207
1255
|
if (this.hiddenInput && form) form.removeEventListener("submit", this._handleHiddenInputSubmit);
|
|
1208
|
-
// unbind
|
|
1209
|
-
if (this.options.
|
|
1256
|
+
// unbind autoInsertDialCode listeners
|
|
1257
|
+
if (this.options.autoInsertDialCode) {
|
|
1210
1258
|
if (form) form.removeEventListener("submit", this._handleSubmitOrBlurEvent);
|
|
1211
1259
|
this.telInput.removeEventListener("blur", this._handleSubmitOrBlurEvent);
|
|
1212
1260
|
}
|
|
@@ -1275,7 +1323,7 @@
|
|
|
1275
1323
|
// check if already selected
|
|
1276
1324
|
if (!this.selectedFlagInner.classList.contains("iti__".concat(countryCode))) {
|
|
1277
1325
|
this._setFlag(countryCode);
|
|
1278
|
-
this._updateDialCode(this.selectedCountryData.dialCode
|
|
1326
|
+
this._updateDialCode(this.selectedCountryData.dialCode);
|
|
1279
1327
|
this._triggerCountryChange();
|
|
1280
1328
|
}
|
|
1281
1329
|
}
|
|
@@ -1345,7 +1393,7 @@
|
|
|
1345
1393
|
// default options
|
|
1346
1394
|
intlTelInputGlobals.defaults = defaults;
|
|
1347
1395
|
// version
|
|
1348
|
-
intlTelInputGlobals.version = "
|
|
1396
|
+
intlTelInputGlobals.version = "18.0.1";
|
|
1349
1397
|
var pluginName = "intlTelInput";
|
|
1350
1398
|
// A really lightweight plugin wrapper around the constructor,
|
|
1351
1399
|
// preventing against multiple instantiations
|