intl-tel-input 17.0.21 → 18.0.0
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 +14 -14
- 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 +6 -6
- package/demo_rtl.html +47 -0
- package/examples/gen/country-sync.html +6 -6
- package/examples/gen/default-country-ip.html +5 -5
- 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 +1 -1
- 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 +5 -5
- 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
package/build/js/intlTelInput.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* International Telephone Input
|
|
2
|
+
* International Telephone Input v18.0.0
|
|
3
3
|
* https://github.com/jackocnr/intl-tel-input.git
|
|
4
4
|
* Licensed under the MIT license
|
|
5
5
|
*/
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
// Order (if >1 country with same dial code),
|
|
25
25
|
// Area codes
|
|
26
26
|
// ]
|
|
27
|
-
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" ] ] ];
|
|
27
|
+
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" ] ] ];
|
|
28
28
|
// loop over all of the countries above, restructuring the data to be objects with named keys
|
|
29
29
|
for (var i = 0; i < allCountries.length; i++) {
|
|
30
30
|
var c = allCountries[i];
|
|
@@ -37,6 +37,35 @@
|
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
"use strict";
|
|
40
|
+
function _objectSpread(target) {
|
|
41
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
42
|
+
var source = arguments[i] != null ? Object(arguments[i]) : {};
|
|
43
|
+
var ownKeys = Object.keys(source);
|
|
44
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
45
|
+
ownKeys.push.apply(ownKeys, Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
46
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
ownKeys.forEach(function(key) {
|
|
50
|
+
_defineProperty(target, key, source[key]);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return target;
|
|
54
|
+
}
|
|
55
|
+
function _defineProperty(obj, key, value) {
|
|
56
|
+
key = _toPropertyKey(key);
|
|
57
|
+
if (key in obj) {
|
|
58
|
+
Object.defineProperty(obj, key, {
|
|
59
|
+
value: value,
|
|
60
|
+
enumerable: true,
|
|
61
|
+
configurable: true,
|
|
62
|
+
writable: true
|
|
63
|
+
});
|
|
64
|
+
} else {
|
|
65
|
+
obj[key] = value;
|
|
66
|
+
}
|
|
67
|
+
return obj;
|
|
68
|
+
}
|
|
40
69
|
function _classCallCheck(instance, Constructor) {
|
|
41
70
|
if (!(instance instanceof Constructor)) {
|
|
42
71
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -48,14 +77,31 @@
|
|
|
48
77
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
49
78
|
descriptor.configurable = true;
|
|
50
79
|
if ("value" in descriptor) descriptor.writable = true;
|
|
51
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
80
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
52
81
|
}
|
|
53
82
|
}
|
|
54
83
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
55
84
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
56
85
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
86
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
87
|
+
writable: false
|
|
88
|
+
});
|
|
57
89
|
return Constructor;
|
|
58
90
|
}
|
|
91
|
+
function _toPropertyKey(arg) {
|
|
92
|
+
var key = _toPrimitive(arg, "string");
|
|
93
|
+
return typeof key === "symbol" ? key : String(key);
|
|
94
|
+
}
|
|
95
|
+
function _toPrimitive(input, hint) {
|
|
96
|
+
if (typeof input !== "object" || input === null) return input;
|
|
97
|
+
var prim = input[Symbol.toPrimitive];
|
|
98
|
+
if (prim !== undefined) {
|
|
99
|
+
var res = prim.call(input, hint || "default");
|
|
100
|
+
if (typeof res !== "object") return res;
|
|
101
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
102
|
+
}
|
|
103
|
+
return (hint === "string" ? String : Number)(input);
|
|
104
|
+
}
|
|
59
105
|
var intlTelInputGlobals = {
|
|
60
106
|
getInstance: function getInstance(input) {
|
|
61
107
|
var id = input.getAttribute("data-intl-tel-input-id");
|
|
@@ -73,8 +119,9 @@
|
|
|
73
119
|
var defaults = {
|
|
74
120
|
// whether or not to allow the dropdown
|
|
75
121
|
allowDropdown: true,
|
|
76
|
-
//
|
|
77
|
-
|
|
122
|
+
// auto insert dial code (A) on init, (B) on user selecting a country, (C) on calling setCountry
|
|
123
|
+
// also listen for blur/submit and auto remove dial code if that's all there is
|
|
124
|
+
autoInsertDialCode: false,
|
|
78
125
|
// add a placeholder in the input with an example number for the selected country
|
|
79
126
|
autoPlaceholder: "polite",
|
|
80
127
|
// modify the parentClass
|
|
@@ -95,7 +142,7 @@
|
|
|
95
142
|
initialCountry: "",
|
|
96
143
|
// localized country names e.g. { 'de': 'Deutschland' }
|
|
97
144
|
localizedCountries: null,
|
|
98
|
-
//
|
|
145
|
+
// deal with national numbers instead of international numbers
|
|
99
146
|
nationalMode: true,
|
|
100
147
|
// display only these countries
|
|
101
148
|
onlyCountries: [],
|
|
@@ -103,7 +150,7 @@
|
|
|
103
150
|
placeholderNumberType: "MOBILE",
|
|
104
151
|
// the countries at the top of the list. defaults to united states and united kingdom
|
|
105
152
|
preferredCountries: [ "us", "gb" ],
|
|
106
|
-
// display the country dial code next to the selected flag
|
|
153
|
+
// display the country dial code next to the selected flag
|
|
107
154
|
separateDialCode: false,
|
|
108
155
|
// specify the path to the libphonenumber script to enable validation/formatting
|
|
109
156
|
utilsScript: ""
|
|
@@ -126,8 +173,7 @@
|
|
|
126
173
|
};
|
|
127
174
|
// this is our plugin class that we will create an instance of
|
|
128
175
|
// eslint-disable-next-line no-unused-vars
|
|
129
|
-
var Iti = /*#__PURE__*/
|
|
130
|
-
function() {
|
|
176
|
+
var Iti = /*#__PURE__*/ function() {
|
|
131
177
|
function Iti(input, options) {
|
|
132
178
|
var _this = this;
|
|
133
179
|
_classCallCheck(this, Iti);
|
|
@@ -148,14 +194,10 @@
|
|
|
148
194
|
key: "_init",
|
|
149
195
|
value: function _init() {
|
|
150
196
|
var _this2 = this;
|
|
151
|
-
// if in nationalMode,
|
|
152
|
-
if (this.options.nationalMode) this.options.
|
|
153
|
-
// if separateDialCode
|
|
154
|
-
|
|
155
|
-
// dial code next to them)
|
|
156
|
-
if (this.options.separateDialCode) {
|
|
157
|
-
this.options.autoHideDialCode = this.options.nationalMode = false;
|
|
158
|
-
}
|
|
197
|
+
// if in nationalMode, do not insert dial codes
|
|
198
|
+
if (this.options.nationalMode) this.options.autoInsertDialCode = false;
|
|
199
|
+
// if separateDialCode enabled, do not insert dial codes
|
|
200
|
+
if (this.options.separateDialCode) this.options.autoInsertDialCode = false;
|
|
159
201
|
// we cannot just test screen size as some smartphones/website meta tags will report desktop
|
|
160
202
|
// resolutions
|
|
161
203
|
// Note: for some reason jasmine breaks if you put this in the main Plugin function with the
|
|
@@ -195,7 +237,7 @@
|
|
|
195
237
|
this._generateMarkup();
|
|
196
238
|
// set the initial state of the input value and the selected flag
|
|
197
239
|
this._setInitialState();
|
|
198
|
-
// start all of the event listeners:
|
|
240
|
+
// start all of the event listeners: autoInsertDialCode, input keydown, selectedFlag click
|
|
199
241
|
this._initListeners();
|
|
200
242
|
// utils script, and auto country
|
|
201
243
|
this._initRequests();
|
|
@@ -267,7 +309,9 @@
|
|
|
267
309
|
}, {
|
|
268
310
|
key: "_countryNameSort",
|
|
269
311
|
value: function _countryNameSort(a, b) {
|
|
270
|
-
|
|
312
|
+
if (a.name < b.name) return -1;
|
|
313
|
+
if (a.name > b.name) return 1;
|
|
314
|
+
return 0;
|
|
271
315
|
}
|
|
272
316
|
}, {
|
|
273
317
|
key: "_processCountryCodes",
|
|
@@ -355,24 +399,34 @@
|
|
|
355
399
|
}, wrapper);
|
|
356
400
|
wrapper.appendChild(this.telInput);
|
|
357
401
|
// selected flag (displayed to left of input)
|
|
358
|
-
|
|
359
|
-
|
|
402
|
+
// using Aria tags for "Select-Only Combobox Example"
|
|
403
|
+
// https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/
|
|
404
|
+
this.selectedFlag = this._createEl("div", _objectSpread({
|
|
405
|
+
"class": "iti__selected-flag"
|
|
406
|
+
}, this.options.allowDropdown && {
|
|
360
407
|
role: "combobox",
|
|
408
|
+
"aria-haspopup": "listbox",
|
|
361
409
|
"aria-controls": "iti-".concat(this.id, "__country-listbox"),
|
|
362
410
|
"aria-owns": "iti-".concat(this.id, "__country-listbox"),
|
|
363
|
-
"aria-expanded": "false"
|
|
364
|
-
|
|
411
|
+
"aria-expanded": "false",
|
|
412
|
+
"aria-label": "Telephone country code"
|
|
413
|
+
}), this.flagsContainer);
|
|
365
414
|
this.selectedFlagInner = this._createEl("div", {
|
|
366
415
|
"class": "iti__flag"
|
|
367
416
|
}, this.selectedFlag);
|
|
417
|
+
if (this.telInput.disabled) {
|
|
418
|
+
this.selectedFlag.setAttribute("aria-disabled", "true");
|
|
419
|
+
}
|
|
368
420
|
if (this.options.separateDialCode) {
|
|
369
421
|
this.selectedDialCode = this._createEl("div", {
|
|
370
422
|
"class": "iti__selected-dial-code"
|
|
371
423
|
}, this.selectedFlag);
|
|
372
424
|
}
|
|
373
425
|
if (this.options.allowDropdown) {
|
|
374
|
-
|
|
375
|
-
|
|
426
|
+
if (!this.telInput.disabled) {
|
|
427
|
+
// make element focusable and tab navigable
|
|
428
|
+
this.selectedFlag.setAttribute("tabindex", "0");
|
|
429
|
+
}
|
|
376
430
|
this.dropdownArrow = this._createEl("div", {
|
|
377
431
|
"class": "iti__arrow"
|
|
378
432
|
}, this.selectedFlag);
|
|
@@ -452,7 +506,7 @@
|
|
|
452
506
|
var val = useAttribute ? attributeValue : inputValue;
|
|
453
507
|
var dialCode = this._getDialCode(val);
|
|
454
508
|
var isRegionlessNanp = this._isRegionlessNanp(val);
|
|
455
|
-
var _this$options = this.options, initialCountry = _this$options.initialCountry,
|
|
509
|
+
var _this$options = this.options, initialCountry = _this$options.initialCountry, autoInsertDialCode = _this$options.autoInsertDialCode;
|
|
456
510
|
// if we already have a dial code, and it's not a regionlessNanp, we can go ahead and set the
|
|
457
511
|
// flag, else fall back to the default country
|
|
458
512
|
if (dialCode && !isRegionlessNanp) {
|
|
@@ -473,8 +527,8 @@
|
|
|
473
527
|
}
|
|
474
528
|
}
|
|
475
529
|
}
|
|
476
|
-
// if empty and
|
|
477
|
-
if (!val &&
|
|
530
|
+
// if empty and autoInsertDialCode then insert the dial code
|
|
531
|
+
if (!val && autoInsertDialCode) {
|
|
478
532
|
this.telInput.value = "+".concat(this.selectedCountryData.dialCode);
|
|
479
533
|
}
|
|
480
534
|
}
|
|
@@ -486,7 +540,7 @@
|
|
|
486
540
|
key: "_initListeners",
|
|
487
541
|
value: function _initListeners() {
|
|
488
542
|
this._initKeyListeners();
|
|
489
|
-
if (this.options.
|
|
543
|
+
if (this.options.autoInsertDialCode) this._initBlurListeners();
|
|
490
544
|
if (this.options.allowDropdown) this._initDropdownListeners();
|
|
491
545
|
if (this.hiddenInput) this._initHiddenInputListener();
|
|
492
546
|
}
|
|
@@ -813,7 +867,7 @@
|
|
|
813
867
|
value: function _updateValFromNumber(originalNumber) {
|
|
814
868
|
var number = originalNumber;
|
|
815
869
|
if (this.options.formatOnDisplay && window.intlTelInputUtils && this.selectedCountryData) {
|
|
816
|
-
var useNational =
|
|
870
|
+
var useNational = this.options.nationalMode || number.charAt(0) !== "+" && !this.options.separateDialCode;
|
|
817
871
|
var _intlTelInputUtils$nu = intlTelInputUtils.numberFormat, NATIONAL = _intlTelInputUtils$nu.NATIONAL, INTERNATIONAL = _intlTelInputUtils$nu.INTERNATIONAL;
|
|
818
872
|
var format = useNational ? NATIONAL : INTERNATIONAL;
|
|
819
873
|
number = intlTelInputUtils.formatNumber(number, this.selectedCountryData.iso2, format);
|
|
@@ -836,7 +890,7 @@
|
|
|
836
890
|
if (number.charAt(0) !== "1") number = "1".concat(number);
|
|
837
891
|
number = "+".concat(number);
|
|
838
892
|
}
|
|
839
|
-
//
|
|
893
|
+
// if separateDialCode enabled, then consider the selected dial code to be part of the number
|
|
840
894
|
if (this.options.separateDialCode && selectedDialCode && number.charAt(0) !== "+") {
|
|
841
895
|
number = "+".concat(selectedDialCode).concat(number);
|
|
842
896
|
}
|
|
@@ -897,6 +951,7 @@
|
|
|
897
951
|
if (prevItem) prevItem.classList.remove("iti__highlight");
|
|
898
952
|
this.highlightedItem = listItem;
|
|
899
953
|
this.highlightedItem.classList.add("iti__highlight");
|
|
954
|
+
this.selectedFlag.setAttribute("aria-activedescendant", listItem.getAttribute("id"));
|
|
900
955
|
if (shouldFocus) this.highlightedItem.focus();
|
|
901
956
|
}
|
|
902
957
|
}, {
|
|
@@ -950,7 +1005,6 @@
|
|
|
950
1005
|
nextItem.setAttribute("aria-selected", "true");
|
|
951
1006
|
nextItem.classList.add("iti__active");
|
|
952
1007
|
this.activeItem = nextItem;
|
|
953
|
-
this.selectedFlag.setAttribute("aria-activedescendant", nextItem.getAttribute("id"));
|
|
954
1008
|
}
|
|
955
1009
|
}
|
|
956
1010
|
// return if the flag has changed or not
|
|
@@ -992,7 +1046,7 @@
|
|
|
992
1046
|
// update selected flag and active list item
|
|
993
1047
|
var flagChanged = this._setFlag(listItem.getAttribute("data-country-code"));
|
|
994
1048
|
this._closeDropdown();
|
|
995
|
-
this._updateDialCode(listItem.getAttribute("data-dial-code")
|
|
1049
|
+
this._updateDialCode(listItem.getAttribute("data-dial-code"));
|
|
996
1050
|
// focus the input
|
|
997
1051
|
this.telInput.focus();
|
|
998
1052
|
// put cursor at end - this fix is required for FF and IE11 (with nationalMode=false i.e. auto
|
|
@@ -1008,6 +1062,7 @@
|
|
|
1008
1062
|
value: function _closeDropdown() {
|
|
1009
1063
|
this.countryList.classList.add("iti__hide");
|
|
1010
1064
|
this.selectedFlag.setAttribute("aria-expanded", "false");
|
|
1065
|
+
this.selectedFlag.removeAttribute("aria-activedescendant");
|
|
1011
1066
|
// update the arrow
|
|
1012
1067
|
this.dropdownArrow.classList.remove("iti__arrow--up");
|
|
1013
1068
|
// unbind key events
|
|
@@ -1049,7 +1104,7 @@
|
|
|
1049
1104
|
}
|
|
1050
1105
|
}, {
|
|
1051
1106
|
key: "_updateDialCode",
|
|
1052
|
-
value: function _updateDialCode(newDialCodeBare
|
|
1107
|
+
value: function _updateDialCode(newDialCodeBare) {
|
|
1053
1108
|
var inputVal = this.telInput.value;
|
|
1054
1109
|
// save having to pass this every time
|
|
1055
1110
|
var newDialCode = "+".concat(newDialCodeBare);
|
|
@@ -1065,23 +1120,16 @@
|
|
|
1065
1120
|
// (no way to determine where the invalid dial code ends and the rest of the number begins)
|
|
1066
1121
|
newNumber = newDialCode;
|
|
1067
1122
|
}
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
return;
|
|
1071
|
-
} else {
|
|
1072
|
-
// nationalMode is disabled
|
|
1123
|
+
this.telInput.value = newNumber;
|
|
1124
|
+
} else if (this.options.autoInsertDialCode) {
|
|
1073
1125
|
if (inputVal) {
|
|
1074
1126
|
// there is an existing value with no dial code: prefix the new dial code
|
|
1075
1127
|
newNumber = newDialCode + inputVal;
|
|
1076
|
-
} else if (hasSelectedListItem || !this.options.autoHideDialCode) {
|
|
1077
|
-
// no existing value and either they've just selected a list item, or autoHideDialCode is
|
|
1078
|
-
// disabled: insert new dial code
|
|
1079
|
-
newNumber = newDialCode;
|
|
1080
1128
|
} else {
|
|
1081
|
-
|
|
1129
|
+
newNumber = newDialCode;
|
|
1082
1130
|
}
|
|
1131
|
+
this.telInput.value = newNumber;
|
|
1083
1132
|
}
|
|
1084
|
-
this.telInput.value = newNumber;
|
|
1085
1133
|
}
|
|
1086
1134
|
}, {
|
|
1087
1135
|
key: "_getDialCode",
|
|
@@ -1200,8 +1248,8 @@
|
|
|
1200
1248
|
}
|
|
1201
1249
|
// unbind hiddenInput listeners
|
|
1202
1250
|
if (this.hiddenInput && form) form.removeEventListener("submit", this._handleHiddenInputSubmit);
|
|
1203
|
-
// unbind
|
|
1204
|
-
if (this.options.
|
|
1251
|
+
// unbind autoInsertDialCode listeners
|
|
1252
|
+
if (this.options.autoInsertDialCode) {
|
|
1205
1253
|
if (form) form.removeEventListener("submit", this._handleSubmitOrBlurEvent);
|
|
1206
1254
|
this.telInput.removeEventListener("blur", this._handleSubmitOrBlurEvent);
|
|
1207
1255
|
}
|
|
@@ -1270,7 +1318,7 @@
|
|
|
1270
1318
|
// check if already selected
|
|
1271
1319
|
if (!this.selectedFlagInner.classList.contains("iti__".concat(countryCode))) {
|
|
1272
1320
|
this._setFlag(countryCode);
|
|
1273
|
-
this._updateDialCode(this.selectedCountryData.dialCode
|
|
1321
|
+
this._updateDialCode(this.selectedCountryData.dialCode);
|
|
1274
1322
|
this._triggerCountryChange();
|
|
1275
1323
|
}
|
|
1276
1324
|
}
|
|
@@ -1340,7 +1388,7 @@
|
|
|
1340
1388
|
// default options
|
|
1341
1389
|
intlTelInputGlobals.defaults = defaults;
|
|
1342
1390
|
// version
|
|
1343
|
-
intlTelInputGlobals.version = "
|
|
1391
|
+
intlTelInputGlobals.version = "18.0.0";
|
|
1344
1392
|
// convenience wrapper
|
|
1345
1393
|
return function(input, options) {
|
|
1346
1394
|
var iti = new Iti(input, options);
|