@salla.sa/twilight-components 2.12.40 → 2.12.41
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/dist/cjs/app-globals-fe89d834.js.map +1 -1
- package/dist/cjs/salla-add-product-button_41.cjs.entry.js +321 -123
- package/dist/cjs/salla-add-product-button_41.cjs.entry.js.map +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/salla-tel-input2.js +321 -123
- package/dist/components/salla-tel-input2.js.map +1 -1
- package/dist/esm/app-globals-4359b023.js.map +1 -1
- package/dist/esm/salla-add-product-button_41.entry.js +321 -123
- package/dist/esm/salla-add-product-button_41.entry.js.map +1 -1
- package/dist/esm-es5/app-globals-4359b023.js.map +1 -1
- package/dist/esm-es5/salla-add-product-button_41.entry.js +4 -4
- package/dist/esm-es5/salla-add-product-button_41.entry.js.map +1 -1
- package/dist/twilight/{p-e5c8f9dc.system.entry.js → p-25fc9949.system.entry.js} +5 -5
- package/dist/twilight/p-25fc9949.system.entry.js.map +1 -0
- package/dist/twilight/p-a04e6e5e.system.js +1 -1
- package/dist/twilight/p-a527f060.system.js.map +1 -1
- package/dist/twilight/p-ab4c6cc3.js.map +1 -1
- package/dist/twilight/{p-c53f2b8f.entry.js → p-e23a4e3f.entry.js} +8 -8
- package/dist/twilight/p-e23a4e3f.entry.js.map +1 -0
- package/dist/twilight/twilight.esm.js +1 -1
- package/package.json +5 -5
- package/dist/twilight/p-c53f2b8f.entry.js.map +0 -1
- package/dist/twilight/p-e5c8f9dc.system.entry.js.map +0 -1
|
@@ -6,7 +6,7 @@ import { a as createCommonjsModule } from './_commonjsHelpers.js';
|
|
|
6
6
|
|
|
7
7
|
var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
8
8
|
/*
|
|
9
|
-
* International Telephone Input
|
|
9
|
+
* International Telephone Input v18.2.1
|
|
10
10
|
* https://github.com/jackocnr/intl-tel-input.git
|
|
11
11
|
* Licensed under the MIT license
|
|
12
12
|
*/
|
|
@@ -30,7 +30,7 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
30
30
|
// Order (if >1 country with same dial code),
|
|
31
31
|
// Area codes
|
|
32
32
|
// ]
|
|
33
|
-
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" ], [ "
|
|
33
|
+
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", "263", "289", "306", "343", "354", "365", "367", "368", "382", "387", "403", "416", "418", "428", "431", "437", "438", "450", "584", "468", "474", "506", "514", "519", "548", "579", "581", "584", "587", "604", "613", "639", "647", "672", "683", "705", "709", "742", "753", "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" ] ] ];
|
|
34
34
|
// loop over all of the countries above, restructuring the data to be objects with named keys
|
|
35
35
|
for (var i = 0; i < allCountries.length; i++) {
|
|
36
36
|
var c = allCountries[i];
|
|
@@ -42,6 +42,35 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
42
42
|
areaCodes: c[4] || null
|
|
43
43
|
};
|
|
44
44
|
}
|
|
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 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
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$1) {
|
|
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");
|
|
@@ -72,14 +118,17 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
72
118
|
return document.readyState === "complete";
|
|
73
119
|
}
|
|
74
120
|
};
|
|
75
|
-
if (typeof window === "object")
|
|
121
|
+
if (typeof window === "object") {
|
|
122
|
+
window.intlTelInputGlobals = intlTelInputGlobals;
|
|
123
|
+
}
|
|
76
124
|
// these vars persist through all instances of the plugin
|
|
77
125
|
var id = 0;
|
|
78
126
|
var defaults = {
|
|
79
127
|
// whether or not to allow the dropdown
|
|
80
128
|
allowDropdown: true,
|
|
81
|
-
//
|
|
82
|
-
|
|
129
|
+
// auto insert dial code (A) on init, (B) on user selecting a country, (C) on calling setCountry
|
|
130
|
+
// also listen for blur/submit and auto remove dial code if that's all there is
|
|
131
|
+
autoInsertDialCode: false,
|
|
83
132
|
// add a placeholder in the input with an example number for the selected country
|
|
84
133
|
autoPlaceholder: "polite",
|
|
85
134
|
// modify the parentClass
|
|
@@ -100,7 +149,7 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
100
149
|
initialCountry: "",
|
|
101
150
|
// localized country names e.g. { 'de': 'Deutschland' }
|
|
102
151
|
localizedCountries: null,
|
|
103
|
-
//
|
|
152
|
+
// national vs international formatting for numbers e.g. placeholders and displaying existing numbers
|
|
104
153
|
nationalMode: true,
|
|
105
154
|
// display only these countries
|
|
106
155
|
onlyCountries: [],
|
|
@@ -108,8 +157,10 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
108
157
|
placeholderNumberType: "MOBILE",
|
|
109
158
|
// the countries at the top of the list. defaults to united states and united kingdom
|
|
110
159
|
preferredCountries: [ "us", "gb" ],
|
|
111
|
-
// display the country dial code next to the selected flag
|
|
160
|
+
// display the country dial code next to the selected flag
|
|
112
161
|
separateDialCode: false,
|
|
162
|
+
// option to hide the flags - must be used with separateDialCode, or allowDropdown=false
|
|
163
|
+
showFlags: true,
|
|
113
164
|
// specify the path to the libphonenumber script to enable validation/formatting
|
|
114
165
|
utilsScript: ""
|
|
115
166
|
};
|
|
@@ -131,8 +182,7 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
131
182
|
};
|
|
132
183
|
// this is our plugin class that we will create an instance of
|
|
133
184
|
// eslint-disable-next-line no-unused-vars
|
|
134
|
-
var Iti = /*#__PURE__*/
|
|
135
|
-
function() {
|
|
185
|
+
var Iti = /*#__PURE__*/ function() {
|
|
136
186
|
function Iti(input, options) {
|
|
137
187
|
var _this = this;
|
|
138
188
|
_classCallCheck(this, Iti);
|
|
@@ -153,13 +203,19 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
153
203
|
key: "_init",
|
|
154
204
|
value: function _init() {
|
|
155
205
|
var _this2 = this;
|
|
156
|
-
// if in nationalMode,
|
|
157
|
-
if (this.options.nationalMode)
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
//
|
|
206
|
+
// if in nationalMode, do not insert dial codes
|
|
207
|
+
if (this.options.nationalMode) {
|
|
208
|
+
this.options.autoInsertDialCode = false;
|
|
209
|
+
}
|
|
210
|
+
// if separateDialCode enabled, do not insert dial codes
|
|
161
211
|
if (this.options.separateDialCode) {
|
|
162
|
-
this.options.
|
|
212
|
+
this.options.autoInsertDialCode = false;
|
|
213
|
+
}
|
|
214
|
+
// force showFlags=true if there's a dropdown and we're not displaying the dial code,
|
|
215
|
+
// as otherwise you just have a down arrow on it's own which doesn't make sense
|
|
216
|
+
var forceShowFlags = this.options.allowDropdown && !this.options.separateDialCode;
|
|
217
|
+
if (!this.options.showFlags && forceShowFlags) {
|
|
218
|
+
this.options.showFlags = true;
|
|
163
219
|
}
|
|
164
220
|
// we cannot just test screen size as some smartphones/website meta tags will report desktop
|
|
165
221
|
// resolutions
|
|
@@ -171,8 +227,12 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
171
227
|
// trigger the mobile dropdown css
|
|
172
228
|
document.body.classList.add("iti-mobile");
|
|
173
229
|
// on mobile, we want a full screen dropdown, so we must append it to the body
|
|
174
|
-
if (!this.options.dropdownContainer)
|
|
230
|
+
if (!this.options.dropdownContainer) {
|
|
231
|
+
this.options.dropdownContainer = document.body;
|
|
232
|
+
}
|
|
175
233
|
}
|
|
234
|
+
// check if input has one parent with RTL
|
|
235
|
+
this.isRTL = !!this.telInput.closest("[dir=rtl]");
|
|
176
236
|
// these promises get resolved when their individual requests complete
|
|
177
237
|
// this way the dev can do something like iti.promise.then(...) to know when all requests are
|
|
178
238
|
// complete
|
|
@@ -200,7 +260,7 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
200
260
|
this._generateMarkup();
|
|
201
261
|
// set the initial state of the input value and the selected flag
|
|
202
262
|
this._setInitialState();
|
|
203
|
-
// start all of the event listeners:
|
|
263
|
+
// start all of the event listeners: autoInsertDialCode, input keydown, selectedFlag click
|
|
204
264
|
this._initListeners();
|
|
205
265
|
// utils script, and auto country
|
|
206
266
|
this._initRequests();
|
|
@@ -215,7 +275,9 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
215
275
|
// process the preferredCountries
|
|
216
276
|
this._processPreferredCountries();
|
|
217
277
|
// translate countries according to localizedCountries option
|
|
218
|
-
if (this.options.localizedCountries)
|
|
278
|
+
if (this.options.localizedCountries) {
|
|
279
|
+
this._translateCountriesByLocale();
|
|
280
|
+
}
|
|
219
281
|
// sort countries by name
|
|
220
282
|
if (this.options.onlyCountries.length || this.options.localizedCountries) {
|
|
221
283
|
this.countries.sort(this._countryNameSort);
|
|
@@ -232,7 +294,9 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
232
294
|
}
|
|
233
295
|
// bail if we already have this country for this countryCode
|
|
234
296
|
for (var i = 0; i < this.countryCodes[countryCode].length; i++) {
|
|
235
|
-
if (this.countryCodes[countryCode][i] === iso2)
|
|
297
|
+
if (this.countryCodes[countryCode][i] === iso2) {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
236
300
|
}
|
|
237
301
|
// check for undefined as 0 is falsy
|
|
238
302
|
var index = priority !== undefined$1 ? priority : this.countryCodes[countryCode].length;
|
|
@@ -272,7 +336,13 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
272
336
|
}, {
|
|
273
337
|
key: "_countryNameSort",
|
|
274
338
|
value: function _countryNameSort(a, b) {
|
|
275
|
-
|
|
339
|
+
if (a.name < b.name) {
|
|
340
|
+
return -1;
|
|
341
|
+
}
|
|
342
|
+
if (a.name > b.name) {
|
|
343
|
+
return 1;
|
|
344
|
+
}
|
|
345
|
+
return 0;
|
|
276
346
|
}
|
|
277
347
|
}, {
|
|
278
348
|
key: "_processCountryCodes",
|
|
@@ -285,7 +355,9 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
285
355
|
// first: add dial codes
|
|
286
356
|
for (var i = 0; i < this.countries.length; i++) {
|
|
287
357
|
var c = this.countries[i];
|
|
288
|
-
if (!this.dialCodes[c.dialCode])
|
|
358
|
+
if (!this.dialCodes[c.dialCode]) {
|
|
359
|
+
this.dialCodes[c.dialCode] = true;
|
|
360
|
+
}
|
|
289
361
|
this._addCountryCode(c.iso2, c.dialCode, c.priority);
|
|
290
362
|
}
|
|
291
363
|
// next: add area codes
|
|
@@ -320,17 +392,23 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
320
392
|
for (var i = 0; i < this.options.preferredCountries.length; i++) {
|
|
321
393
|
var countryCode = this.options.preferredCountries[i].toLowerCase();
|
|
322
394
|
var countryData = this._getCountryData(countryCode, false, true);
|
|
323
|
-
if (countryData)
|
|
395
|
+
if (countryData) {
|
|
396
|
+
this.preferredCountries.push(countryData);
|
|
397
|
+
}
|
|
324
398
|
}
|
|
325
399
|
}
|
|
326
400
|
}, {
|
|
327
401
|
key: "_createEl",
|
|
328
402
|
value: function _createEl(name, attrs, container) {
|
|
329
403
|
var el = document.createElement(name);
|
|
330
|
-
if (attrs)
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
404
|
+
if (attrs) {
|
|
405
|
+
forEachProp(attrs, function(key, value) {
|
|
406
|
+
return el.setAttribute(key, value);
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
if (container) {
|
|
410
|
+
container.appendChild(el);
|
|
411
|
+
}
|
|
334
412
|
return el;
|
|
335
413
|
}
|
|
336
414
|
}, {
|
|
@@ -339,45 +417,69 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
339
417
|
// if autocomplete does not exist on the element and its form, then
|
|
340
418
|
// prevent autocomplete as there's no safe, cross-browser event we can react to, so it can
|
|
341
419
|
// easily put the plugin in an inconsistent state e.g. the wrong flag selected for the
|
|
342
|
-
// autocompleted number, which on submit could mean wrong number is saved
|
|
420
|
+
// autocompleted number, which on submit could mean wrong number is saved
|
|
343
421
|
if (!this.telInput.hasAttribute("autocomplete") && !(this.telInput.form && this.telInput.form.hasAttribute("autocomplete"))) {
|
|
344
422
|
this.telInput.setAttribute("autocomplete", "off");
|
|
345
423
|
}
|
|
424
|
+
var _this$options = this.options, allowDropdown = _this$options.allowDropdown, separateDialCode = _this$options.separateDialCode, showFlags = _this$options.showFlags, customContainer = _this$options.customContainer, hiddenInput = _this$options.hiddenInput, dropdownContainer = _this$options.dropdownContainer;
|
|
346
425
|
// containers (mostly for positioning)
|
|
347
426
|
var parentClass = "iti";
|
|
348
|
-
if (
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
parentClass +=
|
|
427
|
+
if (allowDropdown) {
|
|
428
|
+
parentClass += " iti--allow-dropdown";
|
|
429
|
+
}
|
|
430
|
+
if (separateDialCode) {
|
|
431
|
+
parentClass += " iti--separate-dial-code";
|
|
432
|
+
}
|
|
433
|
+
if (showFlags) {
|
|
434
|
+
parentClass += " iti--show-flags";
|
|
435
|
+
}
|
|
436
|
+
if (customContainer) {
|
|
437
|
+
parentClass += " ".concat(customContainer);
|
|
353
438
|
}
|
|
354
439
|
var wrapper = this._createEl("div", {
|
|
355
440
|
"class": parentClass
|
|
356
441
|
});
|
|
357
442
|
this.telInput.parentNode.insertBefore(wrapper, this.telInput);
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
443
|
+
// only hide the flagsContainer if allowDropdown, showFlags and separateDialCode are all false
|
|
444
|
+
var showFlagsContainer = allowDropdown || showFlags || separateDialCode;
|
|
445
|
+
if (showFlagsContainer) {
|
|
446
|
+
this.flagsContainer = this._createEl("div", {
|
|
447
|
+
"class": "iti__flag-container"
|
|
448
|
+
}, wrapper);
|
|
449
|
+
}
|
|
361
450
|
wrapper.appendChild(this.telInput);
|
|
362
451
|
// selected flag (displayed to left of input)
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
452
|
+
// using Aria tags for "Select-Only Combobox Example"
|
|
453
|
+
// https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/
|
|
454
|
+
if (showFlagsContainer) {
|
|
455
|
+
this.selectedFlag = this._createEl("div", _objectSpread({
|
|
456
|
+
"class": "iti__selected-flag"
|
|
457
|
+
}, allowDropdown && {
|
|
458
|
+
role: "combobox",
|
|
459
|
+
"aria-haspopup": "listbox",
|
|
460
|
+
"aria-controls": "iti-".concat(this.id, "__country-listbox"),
|
|
461
|
+
"aria-expanded": "false",
|
|
462
|
+
"aria-label": "Telephone country code"
|
|
463
|
+
}), this.flagsContainer);
|
|
464
|
+
}
|
|
465
|
+
if (showFlags) {
|
|
466
|
+
this.selectedFlagInner = this._createEl("div", {
|
|
467
|
+
"class": "iti__flag"
|
|
468
|
+
}, this.selectedFlag);
|
|
469
|
+
}
|
|
470
|
+
if (this.selectedFlag && this.telInput.disabled) {
|
|
471
|
+
this.selectedFlag.setAttribute("aria-disabled", "true");
|
|
472
|
+
}
|
|
473
|
+
if (separateDialCode) {
|
|
374
474
|
this.selectedDialCode = this._createEl("div", {
|
|
375
475
|
"class": "iti__selected-dial-code"
|
|
376
476
|
}, this.selectedFlag);
|
|
377
477
|
}
|
|
378
|
-
if (
|
|
379
|
-
|
|
380
|
-
|
|
478
|
+
if (allowDropdown) {
|
|
479
|
+
if (!this.telInput.disabled) {
|
|
480
|
+
// make element focusable and tab navigable
|
|
481
|
+
this.selectedFlag.setAttribute("tabindex", "0");
|
|
482
|
+
}
|
|
381
483
|
this.dropdownArrow = this._createEl("div", {
|
|
382
484
|
"class": "iti__arrow"
|
|
383
485
|
}, this.selectedFlag);
|
|
@@ -398,7 +500,7 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
398
500
|
}
|
|
399
501
|
this._appendListItems(this.countries, "iti__standard");
|
|
400
502
|
// create dropdownContainer markup
|
|
401
|
-
if (
|
|
503
|
+
if (dropdownContainer) {
|
|
402
504
|
this.dropdown = this._createEl("div", {
|
|
403
505
|
"class": "iti iti--container"
|
|
404
506
|
});
|
|
@@ -407,14 +509,16 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
407
509
|
this.flagsContainer.appendChild(this.countryList);
|
|
408
510
|
}
|
|
409
511
|
}
|
|
410
|
-
if (
|
|
411
|
-
var hiddenInputName =
|
|
512
|
+
if (hiddenInput) {
|
|
513
|
+
var hiddenInputName = hiddenInput;
|
|
412
514
|
var name = this.telInput.getAttribute("name");
|
|
413
515
|
if (name) {
|
|
414
516
|
var i = name.lastIndexOf("[");
|
|
415
517
|
// if input name contains square brackets, then give the hidden input the same name,
|
|
416
518
|
// replacing the contents of the last set of brackets with the given hiddenInput name
|
|
417
|
-
if (i !== -1)
|
|
519
|
+
if (i !== -1) {
|
|
520
|
+
hiddenInputName = "".concat(name.substr(0, i), "[").concat(hiddenInputName, "]");
|
|
521
|
+
}
|
|
418
522
|
}
|
|
419
523
|
this.hiddenInput = this._createEl("input", {
|
|
420
524
|
type: "hidden",
|
|
@@ -436,7 +540,9 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
436
540
|
// open the list item
|
|
437
541
|
tmp += "<li class='iti__country ".concat(className, "' tabIndex='-1' id='iti-").concat(this.id, "__item-").concat(c.iso2).concat(idSuffix, "' role='option' data-dial-code='").concat(c.dialCode, "' data-country-code='").concat(c.iso2, "' aria-selected='false'>");
|
|
438
542
|
// add the flag
|
|
439
|
-
|
|
543
|
+
if (this.options.showFlags) {
|
|
544
|
+
tmp += "<div class='iti__flag-box'><div class='iti__flag iti__".concat(c.iso2, "'></div></div>");
|
|
545
|
+
}
|
|
440
546
|
// and the country name and dial code
|
|
441
547
|
tmp += "<span class='iti__country-name'>".concat(c.name, "</span>");
|
|
442
548
|
tmp += "<span class='iti__dial-code'>+".concat(c.dialCode, "</span>");
|
|
@@ -457,7 +563,7 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
457
563
|
var val = useAttribute ? attributeValue : inputValue;
|
|
458
564
|
var dialCode = this._getDialCode(val);
|
|
459
565
|
var isRegionlessNanp = this._isRegionlessNanp(val);
|
|
460
|
-
var _this$
|
|
566
|
+
var _this$options2 = this.options, initialCountry = _this$options2.initialCountry, autoInsertDialCode = _this$options2.autoInsertDialCode;
|
|
461
567
|
// if we already have a dial code, and it's not a regionlessNanp, we can go ahead and set the
|
|
462
568
|
// flag, else fall back to the default country
|
|
463
569
|
if (dialCode && !isRegionlessNanp) {
|
|
@@ -478,22 +584,30 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
478
584
|
}
|
|
479
585
|
}
|
|
480
586
|
}
|
|
481
|
-
// if empty and
|
|
482
|
-
if (!val &&
|
|
587
|
+
// if empty and autoInsertDialCode then insert the dial code
|
|
588
|
+
if (!val && autoInsertDialCode) {
|
|
483
589
|
this.telInput.value = "+".concat(this.selectedCountryData.dialCode);
|
|
484
590
|
}
|
|
485
591
|
}
|
|
486
592
|
// NOTE: if initialCountry is set to auto, that will be handled separately
|
|
487
593
|
// format - note this wont be run after _updateDialCode as that's only called if no val
|
|
488
|
-
if (val)
|
|
594
|
+
if (val) {
|
|
595
|
+
this._updateValFromNumber(val);
|
|
596
|
+
}
|
|
489
597
|
}
|
|
490
598
|
}, {
|
|
491
599
|
key: "_initListeners",
|
|
492
600
|
value: function _initListeners() {
|
|
493
601
|
this._initKeyListeners();
|
|
494
|
-
if (this.options.
|
|
495
|
-
|
|
496
|
-
|
|
602
|
+
if (this.options.autoInsertDialCode) {
|
|
603
|
+
this._initBlurListeners();
|
|
604
|
+
}
|
|
605
|
+
if (this.options.allowDropdown) {
|
|
606
|
+
this._initDropdownListeners();
|
|
607
|
+
}
|
|
608
|
+
if (this.hiddenInput) {
|
|
609
|
+
this._initHiddenInputListener();
|
|
610
|
+
}
|
|
497
611
|
}
|
|
498
612
|
}, {
|
|
499
613
|
key: "_initHiddenInputListener",
|
|
@@ -502,7 +616,9 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
502
616
|
this._handleHiddenInputSubmit = function() {
|
|
503
617
|
_this3.hiddenInput.value = _this3.getNumber();
|
|
504
618
|
};
|
|
505
|
-
if (this.telInput.form)
|
|
619
|
+
if (this.telInput.form) {
|
|
620
|
+
this.telInput.form.addEventListener("submit", this._handleHiddenInputSubmit);
|
|
621
|
+
}
|
|
506
622
|
}
|
|
507
623
|
}, {
|
|
508
624
|
key: "_getClosestLabel",
|
|
@@ -522,10 +638,16 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
522
638
|
// close it again
|
|
523
639
|
this._handleLabelClick = function(e) {
|
|
524
640
|
// if the dropdown is closed, then focus the input, else ignore the click
|
|
525
|
-
if (_this4.countryList.classList.contains("iti__hide"))
|
|
641
|
+
if (_this4.countryList.classList.contains("iti__hide")) {
|
|
642
|
+
_this4.telInput.focus();
|
|
643
|
+
} else {
|
|
644
|
+
e.preventDefault();
|
|
645
|
+
}
|
|
526
646
|
};
|
|
527
647
|
var label = this._getClosestLabel();
|
|
528
|
-
if (label)
|
|
648
|
+
if (label) {
|
|
649
|
+
label.addEventListener("click", this._handleLabelClick);
|
|
650
|
+
}
|
|
529
651
|
// toggle country dropdown on click
|
|
530
652
|
this._handleClickSelectedFlag = function() {
|
|
531
653
|
// only intercept this event if we're opening the dropdown
|
|
@@ -547,7 +669,9 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
547
669
|
_this4._showDropdown();
|
|
548
670
|
}
|
|
549
671
|
// allow navigation from dropdown to input on TAB
|
|
550
|
-
if (e.key === "Tab")
|
|
672
|
+
if (e.key === "Tab") {
|
|
673
|
+
_this4._closeDropdown();
|
|
674
|
+
}
|
|
551
675
|
};
|
|
552
676
|
this.flagsContainer.addEventListener("keydown", this._handleFlagsContainerKeydown);
|
|
553
677
|
}
|
|
@@ -566,8 +690,14 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
566
690
|
window.intlTelInputGlobals.loadUtils(_this5.options.utilsScript);
|
|
567
691
|
});
|
|
568
692
|
}
|
|
569
|
-
} else
|
|
570
|
-
|
|
693
|
+
} else {
|
|
694
|
+
this.resolveUtilsScriptPromise();
|
|
695
|
+
}
|
|
696
|
+
if (this.options.initialCountry === "auto") {
|
|
697
|
+
this._loadAutoCountry();
|
|
698
|
+
} else {
|
|
699
|
+
this.resolveAutoCountryPromise();
|
|
700
|
+
}
|
|
571
701
|
}
|
|
572
702
|
}, {
|
|
573
703
|
key: "_loadAutoCountry",
|
|
@@ -632,7 +762,9 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
632
762
|
this._handleSubmitOrBlurEvent = function() {
|
|
633
763
|
_this7._removeEmptyDialCode();
|
|
634
764
|
};
|
|
635
|
-
if (this.telInput.form)
|
|
765
|
+
if (this.telInput.form) {
|
|
766
|
+
this.telInput.form.addEventListener("submit", this._handleSubmitOrBlurEvent);
|
|
767
|
+
}
|
|
636
768
|
this.telInput.addEventListener("blur", this._handleSubmitOrBlurEvent);
|
|
637
769
|
}
|
|
638
770
|
}, {
|
|
@@ -680,7 +812,11 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
680
812
|
}, {
|
|
681
813
|
key: "_toggleClass",
|
|
682
814
|
value: function _toggleClass(el, className, shouldHaveClass) {
|
|
683
|
-
if (shouldHaveClass && !el.classList.contains(className))
|
|
815
|
+
if (shouldHaveClass && !el.classList.contains(className)) {
|
|
816
|
+
el.classList.add(className);
|
|
817
|
+
} else if (!shouldHaveClass && el.classList.contains(className)) {
|
|
818
|
+
el.classList.remove(className);
|
|
819
|
+
}
|
|
684
820
|
}
|
|
685
821
|
}, {
|
|
686
822
|
key: "_setDropdownPosition",
|
|
@@ -736,13 +872,17 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
736
872
|
this._handleMouseoverCountryList = function(e) {
|
|
737
873
|
// handle event delegation, as we're listening for this event on the countryList
|
|
738
874
|
var listItem = _this9._getClosestListItem(e.target);
|
|
739
|
-
if (listItem)
|
|
875
|
+
if (listItem) {
|
|
876
|
+
_this9._highlightListItem(listItem, false);
|
|
877
|
+
}
|
|
740
878
|
};
|
|
741
879
|
this.countryList.addEventListener("mouseover", this._handleMouseoverCountryList);
|
|
742
880
|
// listen for country selection
|
|
743
881
|
this._handleClickCountryList = function(e) {
|
|
744
882
|
var listItem = _this9._getClosestListItem(e.target);
|
|
745
|
-
if (listItem)
|
|
883
|
+
if (listItem) {
|
|
884
|
+
_this9._selectListItem(listItem);
|
|
885
|
+
}
|
|
746
886
|
};
|
|
747
887
|
this.countryList.addEventListener("click", this._handleClickCountryList);
|
|
748
888
|
// click off to close
|
|
@@ -750,7 +890,9 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
750
890
|
// we cannot just stopPropagation as it may be needed to close another instance
|
|
751
891
|
var isOpening = true;
|
|
752
892
|
this._handleClickOffToClose = function() {
|
|
753
|
-
if (!isOpening)
|
|
893
|
+
if (!isOpening) {
|
|
894
|
+
_this9._closeDropdown();
|
|
895
|
+
}
|
|
754
896
|
isOpening = false;
|
|
755
897
|
};
|
|
756
898
|
document.documentElement.addEventListener("click", this._handleClickOffToClose);
|
|
@@ -765,9 +907,17 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
765
907
|
// and enter key from submitting a form etc
|
|
766
908
|
e.preventDefault();
|
|
767
909
|
// up and down to navigate
|
|
768
|
-
if (e.key === "ArrowUp" || e.key === "Up" || e.key === "ArrowDown" || e.key === "Down")
|
|
910
|
+
if (e.key === "ArrowUp" || e.key === "Up" || e.key === "ArrowDown" || e.key === "Down") {
|
|
911
|
+
_this9._handleUpDownKey(e.key);
|
|
912
|
+
} else if (e.key === "Enter") {
|
|
913
|
+
_this9._handleEnterKey();
|
|
914
|
+
} else if (e.key === "Escape") {
|
|
915
|
+
_this9._closeDropdown();
|
|
916
|
+
} else if (/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(e.key)) {
|
|
769
917
|
// jump to countries that start with the query string
|
|
770
|
-
if (queryTimer)
|
|
918
|
+
if (queryTimer) {
|
|
919
|
+
clearTimeout(queryTimer);
|
|
920
|
+
}
|
|
771
921
|
query += e.key.toLowerCase();
|
|
772
922
|
_this9._searchForCountry(query);
|
|
773
923
|
// if the timer hits 1 second, reset the query
|
|
@@ -793,7 +943,9 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
793
943
|
}, {
|
|
794
944
|
key: "_handleEnterKey",
|
|
795
945
|
value: function _handleEnterKey() {
|
|
796
|
-
if (this.highlightedItem)
|
|
946
|
+
if (this.highlightedItem) {
|
|
947
|
+
this._selectListItem(this.highlightedItem);
|
|
948
|
+
}
|
|
797
949
|
}
|
|
798
950
|
}, {
|
|
799
951
|
key: "_searchForCountry",
|
|
@@ -818,7 +970,7 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
818
970
|
value: function _updateValFromNumber(originalNumber) {
|
|
819
971
|
var number = originalNumber;
|
|
820
972
|
if (this.options.formatOnDisplay && window.intlTelInputUtils && this.selectedCountryData) {
|
|
821
|
-
var useNational =
|
|
973
|
+
var useNational = this.options.nationalMode || number.charAt(0) !== "+" && !this.options.separateDialCode;
|
|
822
974
|
var _intlTelInputUtils$nu = intlTelInputUtils.numberFormat, NATIONAL = _intlTelInputUtils$nu.NATIONAL, INTERNATIONAL = _intlTelInputUtils$nu.INTERNATIONAL;
|
|
823
975
|
var format = useNational ? NATIONAL : INTERNATIONAL;
|
|
824
976
|
number = intlTelInputUtils.formatNumber(number, this.selectedCountryData.iso2, format);
|
|
@@ -829,7 +981,7 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
829
981
|
}, {
|
|
830
982
|
key: "_updateFlagFromNumber",
|
|
831
983
|
value: function _updateFlagFromNumber(originalNumber) {
|
|
832
|
-
// if we
|
|
984
|
+
// if we already have US/Canada selected, make sure the number starts
|
|
833
985
|
// with a +1 so _getDialCode will be able to extract the area code
|
|
834
986
|
// update: if we dont yet have selectedCountryData, but we're here (trying to update the flag
|
|
835
987
|
// from the number), that means we're initialising the plugin with a number that already has a
|
|
@@ -837,11 +989,13 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
837
989
|
var number = originalNumber;
|
|
838
990
|
var selectedDialCode = this.selectedCountryData.dialCode;
|
|
839
991
|
var isNanp = selectedDialCode === "1";
|
|
840
|
-
if (number &&
|
|
841
|
-
if (number.charAt(0) !== "1")
|
|
992
|
+
if (number && isNanp && number.charAt(0) !== "+") {
|
|
993
|
+
if (number.charAt(0) !== "1") {
|
|
994
|
+
number = "1".concat(number);
|
|
995
|
+
}
|
|
842
996
|
number = "+".concat(number);
|
|
843
997
|
}
|
|
844
|
-
//
|
|
998
|
+
// if separateDialCode enabled, then consider the selected dial code to be part of the number
|
|
845
999
|
if (this.options.separateDialCode && selectedDialCode && number.charAt(0) !== "+") {
|
|
846
1000
|
number = "+".concat(selectedDialCode).concat(number);
|
|
847
1001
|
}
|
|
@@ -899,10 +1053,15 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
899
1053
|
key: "_highlightListItem",
|
|
900
1054
|
value: function _highlightListItem(listItem, shouldFocus) {
|
|
901
1055
|
var prevItem = this.highlightedItem;
|
|
902
|
-
if (prevItem)
|
|
1056
|
+
if (prevItem) {
|
|
1057
|
+
prevItem.classList.remove("iti__highlight");
|
|
1058
|
+
}
|
|
903
1059
|
this.highlightedItem = listItem;
|
|
904
1060
|
this.highlightedItem.classList.add("iti__highlight");
|
|
905
|
-
|
|
1061
|
+
this.selectedFlag.setAttribute("aria-activedescendant", listItem.getAttribute("id"));
|
|
1062
|
+
if (shouldFocus) {
|
|
1063
|
+
this.highlightedItem.focus();
|
|
1064
|
+
}
|
|
906
1065
|
}
|
|
907
1066
|
}, {
|
|
908
1067
|
key: "_getCountryData",
|
|
@@ -921,6 +1080,7 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
921
1080
|
}, {
|
|
922
1081
|
key: "_setFlag",
|
|
923
1082
|
value: function _setFlag(countryCode) {
|
|
1083
|
+
var _this$options3 = this.options, allowDropdown = _this$options3.allowDropdown, separateDialCode = _this$options3.separateDialCode, showFlags = _this$options3.showFlags;
|
|
924
1084
|
var prevCountry = this.selectedCountryData.iso2 ? this.selectedCountryData : {};
|
|
925
1085
|
// do this first as it will throw an error and stop if countryCode is invalid
|
|
926
1086
|
this.selectedCountryData = countryCode ? this._getCountryData(countryCode, false, false) : {};
|
|
@@ -928,22 +1088,26 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
928
1088
|
if (this.selectedCountryData.iso2) {
|
|
929
1089
|
this.defaultCountry = this.selectedCountryData.iso2;
|
|
930
1090
|
}
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
this.
|
|
935
|
-
if (
|
|
1091
|
+
if (showFlags) {
|
|
1092
|
+
this.selectedFlagInner.setAttribute("class", "iti__flag iti__".concat(countryCode));
|
|
1093
|
+
}
|
|
1094
|
+
this._setSelectedCountryFlagTitleAttribute(countryCode, separateDialCode);
|
|
1095
|
+
if (separateDialCode) {
|
|
936
1096
|
var dialCode = this.selectedCountryData.dialCode ? "+".concat(this.selectedCountryData.dialCode) : "";
|
|
937
1097
|
this.selectedDialCode.innerHTML = dialCode;
|
|
938
1098
|
// offsetWidth is zero if input is in a hidden container during initialisation
|
|
939
1099
|
var selectedFlagWidth = this.selectedFlag.offsetWidth || this._getHiddenSelectedFlagWidth();
|
|
940
1100
|
// add 6px of padding after the grey selected-dial-code box, as this is what we use in the css
|
|
941
|
-
this.
|
|
1101
|
+
if (this.isRTL) {
|
|
1102
|
+
this.telInput.style.paddingRight = "".concat(selectedFlagWidth + 6, "px");
|
|
1103
|
+
} else {
|
|
1104
|
+
this.telInput.style.paddingLeft = "".concat(selectedFlagWidth + 6, "px");
|
|
1105
|
+
}
|
|
942
1106
|
}
|
|
943
1107
|
// and the input's placeholder
|
|
944
1108
|
this._updatePlaceholder();
|
|
945
1109
|
// update the active list item
|
|
946
|
-
if (
|
|
1110
|
+
if (allowDropdown) {
|
|
947
1111
|
var prevItem = this.activeItem;
|
|
948
1112
|
if (prevItem) {
|
|
949
1113
|
prevItem.classList.remove("iti__active");
|
|
@@ -955,12 +1119,29 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
955
1119
|
nextItem.setAttribute("aria-selected", "true");
|
|
956
1120
|
nextItem.classList.add("iti__active");
|
|
957
1121
|
this.activeItem = nextItem;
|
|
958
|
-
this.selectedFlag.setAttribute("aria-activedescendant", nextItem.getAttribute("id"));
|
|
959
1122
|
}
|
|
960
1123
|
}
|
|
961
1124
|
// return if the flag has changed or not
|
|
962
1125
|
return prevCountry.iso2 !== countryCode;
|
|
963
1126
|
}
|
|
1127
|
+
}, {
|
|
1128
|
+
key: "_setSelectedCountryFlagTitleAttribute",
|
|
1129
|
+
value: function _setSelectedCountryFlagTitleAttribute(countryCode, separateDialCode) {
|
|
1130
|
+
if (!this.selectedFlag) {
|
|
1131
|
+
return;
|
|
1132
|
+
}
|
|
1133
|
+
var title;
|
|
1134
|
+
if (countryCode && !separateDialCode) {
|
|
1135
|
+
title = "".concat(this.selectedCountryData.name, ": +").concat(this.selectedCountryData.dialCode);
|
|
1136
|
+
} else if (countryCode) {
|
|
1137
|
+
// For screen reader output, we don't want to include the dial code in the reader output twice
|
|
1138
|
+
// so just use the selected country name here:
|
|
1139
|
+
title = this.selectedCountryData.name;
|
|
1140
|
+
} else {
|
|
1141
|
+
title = "Unknown";
|
|
1142
|
+
}
|
|
1143
|
+
this.selectedFlag.setAttribute("title", title);
|
|
1144
|
+
}
|
|
964
1145
|
}, {
|
|
965
1146
|
key: "_getHiddenSelectedFlagWidth",
|
|
966
1147
|
value: function _getHiddenSelectedFlagWidth() {
|
|
@@ -997,11 +1178,11 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
997
1178
|
// update selected flag and active list item
|
|
998
1179
|
var flagChanged = this._setFlag(listItem.getAttribute("data-country-code"));
|
|
999
1180
|
this._closeDropdown();
|
|
1000
|
-
this._updateDialCode(listItem.getAttribute("data-dial-code")
|
|
1181
|
+
this._updateDialCode(listItem.getAttribute("data-dial-code"));
|
|
1001
1182
|
// focus the input
|
|
1002
1183
|
this.telInput.focus();
|
|
1003
|
-
// put cursor at end - this fix is required for FF and IE11 (with
|
|
1004
|
-
//
|
|
1184
|
+
// put cursor at end - this fix is required for FF and IE11 (with auto inserting dial code),
|
|
1185
|
+
// who try to put the cursor at the beginning the first time
|
|
1005
1186
|
var len = this.telInput.value.length;
|
|
1006
1187
|
this.telInput.setSelectionRange(len, len);
|
|
1007
1188
|
if (flagChanged) {
|
|
@@ -1013,6 +1194,7 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
1013
1194
|
value: function _closeDropdown() {
|
|
1014
1195
|
this.countryList.classList.add("iti__hide");
|
|
1015
1196
|
this.selectedFlag.setAttribute("aria-expanded", "false");
|
|
1197
|
+
this.selectedFlag.removeAttribute("aria-activedescendant");
|
|
1016
1198
|
// update the arrow
|
|
1017
1199
|
this.dropdownArrow.classList.remove("iti__arrow--up");
|
|
1018
1200
|
// unbind key events
|
|
@@ -1022,8 +1204,12 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
1022
1204
|
this.countryList.removeEventListener("click", this._handleClickCountryList);
|
|
1023
1205
|
// remove menu from container
|
|
1024
1206
|
if (this.options.dropdownContainer) {
|
|
1025
|
-
if (!this.isMobile)
|
|
1026
|
-
|
|
1207
|
+
if (!this.isMobile) {
|
|
1208
|
+
window.removeEventListener("scroll", this._handleWindowScroll);
|
|
1209
|
+
}
|
|
1210
|
+
if (this.dropdown.parentNode) {
|
|
1211
|
+
this.dropdown.parentNode.removeChild(this.dropdown);
|
|
1212
|
+
}
|
|
1027
1213
|
}
|
|
1028
1214
|
this._trigger("close:countrydropdown");
|
|
1029
1215
|
}
|
|
@@ -1043,24 +1229,28 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
1043
1229
|
var middleOffset = containerHeight / 2 - elementHeight / 2;
|
|
1044
1230
|
if (elementTop < containerTop) {
|
|
1045
1231
|
// scroll up
|
|
1046
|
-
if (middle)
|
|
1232
|
+
if (middle) {
|
|
1233
|
+
newScrollTop -= middleOffset;
|
|
1234
|
+
}
|
|
1047
1235
|
container.scrollTop = newScrollTop;
|
|
1048
1236
|
} else if (elementBottom > containerBottom) {
|
|
1049
1237
|
// scroll down
|
|
1050
|
-
if (middle)
|
|
1238
|
+
if (middle) {
|
|
1239
|
+
newScrollTop += middleOffset;
|
|
1240
|
+
}
|
|
1051
1241
|
var heightDifference = containerHeight - elementHeight;
|
|
1052
1242
|
container.scrollTop = newScrollTop - heightDifference;
|
|
1053
1243
|
}
|
|
1054
1244
|
}
|
|
1055
1245
|
}, {
|
|
1056
1246
|
key: "_updateDialCode",
|
|
1057
|
-
value: function _updateDialCode(newDialCodeBare
|
|
1247
|
+
value: function _updateDialCode(newDialCodeBare) {
|
|
1058
1248
|
var inputVal = this.telInput.value;
|
|
1059
1249
|
// save having to pass this every time
|
|
1060
1250
|
var newDialCode = "+".concat(newDialCodeBare);
|
|
1061
1251
|
var newNumber;
|
|
1062
1252
|
if (inputVal.charAt(0) === "+") {
|
|
1063
|
-
// there's a plus so we're dealing with a replacement
|
|
1253
|
+
// there's a plus so we're dealing with a replacement
|
|
1064
1254
|
var prevDialCode = this._getDialCode(inputVal);
|
|
1065
1255
|
if (prevDialCode) {
|
|
1066
1256
|
// current number contains a valid dial code, so replace it
|
|
@@ -1070,23 +1260,16 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
1070
1260
|
// (no way to determine where the invalid dial code ends and the rest of the number begins)
|
|
1071
1261
|
newNumber = newDialCode;
|
|
1072
1262
|
}
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
return;
|
|
1076
|
-
} else {
|
|
1077
|
-
// nationalMode is disabled
|
|
1263
|
+
this.telInput.value = newNumber;
|
|
1264
|
+
} else if (this.options.autoInsertDialCode) {
|
|
1078
1265
|
if (inputVal) {
|
|
1079
1266
|
// there is an existing value with no dial code: prefix the new dial code
|
|
1080
1267
|
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
1268
|
} else {
|
|
1086
|
-
|
|
1269
|
+
newNumber = newDialCode;
|
|
1087
1270
|
}
|
|
1271
|
+
this.telInput.value = newNumber;
|
|
1088
1272
|
}
|
|
1089
|
-
this.telInput.value = newNumber;
|
|
1090
1273
|
}
|
|
1091
1274
|
}, {
|
|
1092
1275
|
key: "_getDialCode",
|
|
@@ -1201,13 +1384,19 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
1201
1384
|
this.flagsContainer.removeEventListener("keydown", this._handleFlagsContainerKeydown);
|
|
1202
1385
|
// label click hack
|
|
1203
1386
|
var label = this._getClosestLabel();
|
|
1204
|
-
if (label)
|
|
1387
|
+
if (label) {
|
|
1388
|
+
label.removeEventListener("click", this._handleLabelClick);
|
|
1389
|
+
}
|
|
1205
1390
|
}
|
|
1206
1391
|
// unbind hiddenInput listeners
|
|
1207
|
-
if (this.hiddenInput && form)
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1392
|
+
if (this.hiddenInput && form) {
|
|
1393
|
+
form.removeEventListener("submit", this._handleHiddenInputSubmit);
|
|
1394
|
+
}
|
|
1395
|
+
// unbind autoInsertDialCode listeners
|
|
1396
|
+
if (this.options.autoInsertDialCode) {
|
|
1397
|
+
if (form) {
|
|
1398
|
+
form.removeEventListener("submit", this._handleSubmitOrBlurEvent);
|
|
1399
|
+
}
|
|
1211
1400
|
this.telInput.removeEventListener("blur", this._handleSubmitOrBlurEvent);
|
|
1212
1401
|
}
|
|
1213
1402
|
// unbind key events, and cut/paste events
|
|
@@ -1265,17 +1454,22 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
1265
1454
|
key: "isValidNumber",
|
|
1266
1455
|
value: function isValidNumber() {
|
|
1267
1456
|
var val = this._getFullNumber().trim();
|
|
1268
|
-
|
|
1269
|
-
|
|
1457
|
+
return window.intlTelInputUtils ? intlTelInputUtils.isValidNumber(val, this.selectedCountryData.iso2) : null;
|
|
1458
|
+
}
|
|
1459
|
+
}, {
|
|
1460
|
+
key: "isPossibleNumber",
|
|
1461
|
+
value: function isPossibleNumber() {
|
|
1462
|
+
var val = this._getFullNumber().trim();
|
|
1463
|
+
return window.intlTelInputUtils ? intlTelInputUtils.isPossibleNumber(val, this.selectedCountryData.iso2) : null;
|
|
1270
1464
|
}
|
|
1271
1465
|
}, {
|
|
1272
1466
|
key: "setCountry",
|
|
1273
1467
|
value: function setCountry(originalCountryCode) {
|
|
1274
1468
|
var countryCode = originalCountryCode.toLowerCase();
|
|
1275
1469
|
// check if already selected
|
|
1276
|
-
if (
|
|
1470
|
+
if (this.selectedCountryData.iso2 !== countryCode) {
|
|
1277
1471
|
this._setFlag(countryCode);
|
|
1278
|
-
this._updateDialCode(this.selectedCountryData.dialCode
|
|
1472
|
+
this._updateDialCode(this.selectedCountryData.dialCode);
|
|
1279
1473
|
this._triggerCountryChange();
|
|
1280
1474
|
}
|
|
1281
1475
|
}
|
|
@@ -1312,11 +1506,15 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
1312
1506
|
var script = document.createElement("script");
|
|
1313
1507
|
script.onload = function() {
|
|
1314
1508
|
forEachInstance("handleUtils");
|
|
1315
|
-
if (handleSuccess)
|
|
1509
|
+
if (handleSuccess) {
|
|
1510
|
+
handleSuccess();
|
|
1511
|
+
}
|
|
1316
1512
|
};
|
|
1317
1513
|
script.onerror = function() {
|
|
1318
1514
|
forEachInstance("rejectUtilsScriptPromise");
|
|
1319
|
-
if (handleFailure)
|
|
1515
|
+
if (handleFailure) {
|
|
1516
|
+
handleFailure();
|
|
1517
|
+
}
|
|
1320
1518
|
};
|
|
1321
1519
|
script.className = "iti-load-utils";
|
|
1322
1520
|
script.async = true;
|
|
@@ -1345,7 +1543,7 @@ var intlTelInput$1 = createCommonjsModule(function (module) {
|
|
|
1345
1543
|
// default options
|
|
1346
1544
|
intlTelInputGlobals.defaults = defaults;
|
|
1347
1545
|
// version
|
|
1348
|
-
intlTelInputGlobals.version = "
|
|
1546
|
+
intlTelInputGlobals.version = "18.2.1";
|
|
1349
1547
|
// convenience wrapper
|
|
1350
1548
|
return function(input, options) {
|
|
1351
1549
|
var iti = new Iti(input, options);
|