@salla.sa/twilight-components 2.12.39 → 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
|
@@ -26556,7 +26556,7 @@ SallaTabs.style = sallaTabsCss;
|
|
|
26556
26556
|
|
|
26557
26557
|
var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
26558
26558
|
/*
|
|
26559
|
-
* International Telephone Input
|
|
26559
|
+
* International Telephone Input v18.2.1
|
|
26560
26560
|
* https://github.com/jackocnr/intl-tel-input.git
|
|
26561
26561
|
* Licensed under the MIT license
|
|
26562
26562
|
*/
|
|
@@ -26580,7 +26580,7 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
26580
26580
|
// Order (if >1 country with same dial code),
|
|
26581
26581
|
// Area codes
|
|
26582
26582
|
// ]
|
|
26583
|
-
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" ], [ "
|
|
26583
|
+
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" ] ] ];
|
|
26584
26584
|
// loop over all of the countries above, restructuring the data to be objects with named keys
|
|
26585
26585
|
for (var i = 0; i < allCountries.length; i++) {
|
|
26586
26586
|
var c = allCountries[i];
|
|
@@ -26592,6 +26592,35 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
26592
26592
|
areaCodes: c[4] || null
|
|
26593
26593
|
};
|
|
26594
26594
|
}
|
|
26595
|
+
function _objectSpread(target) {
|
|
26596
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
26597
|
+
var source = arguments[i] != null ? Object(arguments[i]) : {};
|
|
26598
|
+
var ownKeys = Object.keys(source);
|
|
26599
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
26600
|
+
ownKeys.push.apply(ownKeys, Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
26601
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
26602
|
+
}));
|
|
26603
|
+
}
|
|
26604
|
+
ownKeys.forEach(function(key) {
|
|
26605
|
+
_defineProperty(target, key, source[key]);
|
|
26606
|
+
});
|
|
26607
|
+
}
|
|
26608
|
+
return target;
|
|
26609
|
+
}
|
|
26610
|
+
function _defineProperty(obj, key, value) {
|
|
26611
|
+
key = _toPropertyKey(key);
|
|
26612
|
+
if (key in obj) {
|
|
26613
|
+
Object.defineProperty(obj, key, {
|
|
26614
|
+
value: value,
|
|
26615
|
+
enumerable: true,
|
|
26616
|
+
configurable: true,
|
|
26617
|
+
writable: true
|
|
26618
|
+
});
|
|
26619
|
+
} else {
|
|
26620
|
+
obj[key] = value;
|
|
26621
|
+
}
|
|
26622
|
+
return obj;
|
|
26623
|
+
}
|
|
26595
26624
|
function _classCallCheck(instance, Constructor) {
|
|
26596
26625
|
if (!(instance instanceof Constructor)) {
|
|
26597
26626
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -26603,14 +26632,31 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
26603
26632
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
26604
26633
|
descriptor.configurable = true;
|
|
26605
26634
|
if ("value" in descriptor) descriptor.writable = true;
|
|
26606
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
26635
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
26607
26636
|
}
|
|
26608
26637
|
}
|
|
26609
26638
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
26610
26639
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
26611
26640
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
26641
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
26642
|
+
writable: false
|
|
26643
|
+
});
|
|
26612
26644
|
return Constructor;
|
|
26613
26645
|
}
|
|
26646
|
+
function _toPropertyKey(arg) {
|
|
26647
|
+
var key = _toPrimitive(arg, "string");
|
|
26648
|
+
return typeof key === "symbol" ? key : String(key);
|
|
26649
|
+
}
|
|
26650
|
+
function _toPrimitive(input, hint) {
|
|
26651
|
+
if (typeof input !== "object" || input === null) return input;
|
|
26652
|
+
var prim = input[Symbol.toPrimitive];
|
|
26653
|
+
if (prim !== undefined$1) {
|
|
26654
|
+
var res = prim.call(input, hint || "default");
|
|
26655
|
+
if (typeof res !== "object") return res;
|
|
26656
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
26657
|
+
}
|
|
26658
|
+
return (hint === "string" ? String : Number)(input);
|
|
26659
|
+
}
|
|
26614
26660
|
var intlTelInputGlobals = {
|
|
26615
26661
|
getInstance: function getInstance(input) {
|
|
26616
26662
|
var id = input.getAttribute("data-intl-tel-input-id");
|
|
@@ -26622,14 +26668,17 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
26622
26668
|
return document.readyState === "complete";
|
|
26623
26669
|
}
|
|
26624
26670
|
};
|
|
26625
|
-
if (typeof window === "object")
|
|
26671
|
+
if (typeof window === "object") {
|
|
26672
|
+
window.intlTelInputGlobals = intlTelInputGlobals;
|
|
26673
|
+
}
|
|
26626
26674
|
// these vars persist through all instances of the plugin
|
|
26627
26675
|
var id = 0;
|
|
26628
26676
|
var defaults = {
|
|
26629
26677
|
// whether or not to allow the dropdown
|
|
26630
26678
|
allowDropdown: true,
|
|
26631
|
-
//
|
|
26632
|
-
|
|
26679
|
+
// auto insert dial code (A) on init, (B) on user selecting a country, (C) on calling setCountry
|
|
26680
|
+
// also listen for blur/submit and auto remove dial code if that's all there is
|
|
26681
|
+
autoInsertDialCode: false,
|
|
26633
26682
|
// add a placeholder in the input with an example number for the selected country
|
|
26634
26683
|
autoPlaceholder: "polite",
|
|
26635
26684
|
// modify the parentClass
|
|
@@ -26650,7 +26699,7 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
26650
26699
|
initialCountry: "",
|
|
26651
26700
|
// localized country names e.g. { 'de': 'Deutschland' }
|
|
26652
26701
|
localizedCountries: null,
|
|
26653
|
-
//
|
|
26702
|
+
// national vs international formatting for numbers e.g. placeholders and displaying existing numbers
|
|
26654
26703
|
nationalMode: true,
|
|
26655
26704
|
// display only these countries
|
|
26656
26705
|
onlyCountries: [],
|
|
@@ -26658,8 +26707,10 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
26658
26707
|
placeholderNumberType: "MOBILE",
|
|
26659
26708
|
// the countries at the top of the list. defaults to united states and united kingdom
|
|
26660
26709
|
preferredCountries: [ "us", "gb" ],
|
|
26661
|
-
// display the country dial code next to the selected flag
|
|
26710
|
+
// display the country dial code next to the selected flag
|
|
26662
26711
|
separateDialCode: false,
|
|
26712
|
+
// option to hide the flags - must be used with separateDialCode, or allowDropdown=false
|
|
26713
|
+
showFlags: true,
|
|
26663
26714
|
// specify the path to the libphonenumber script to enable validation/formatting
|
|
26664
26715
|
utilsScript: ""
|
|
26665
26716
|
};
|
|
@@ -26681,8 +26732,7 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
26681
26732
|
};
|
|
26682
26733
|
// this is our plugin class that we will create an instance of
|
|
26683
26734
|
// eslint-disable-next-line no-unused-vars
|
|
26684
|
-
var Iti = /*#__PURE__*/
|
|
26685
|
-
function() {
|
|
26735
|
+
var Iti = /*#__PURE__*/ function() {
|
|
26686
26736
|
function Iti(input, options) {
|
|
26687
26737
|
var _this = this;
|
|
26688
26738
|
_classCallCheck(this, Iti);
|
|
@@ -26703,13 +26753,19 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
26703
26753
|
key: "_init",
|
|
26704
26754
|
value: function _init() {
|
|
26705
26755
|
var _this2 = this;
|
|
26706
|
-
// if in nationalMode,
|
|
26707
|
-
if (this.options.nationalMode)
|
|
26708
|
-
|
|
26709
|
-
|
|
26710
|
-
//
|
|
26756
|
+
// if in nationalMode, do not insert dial codes
|
|
26757
|
+
if (this.options.nationalMode) {
|
|
26758
|
+
this.options.autoInsertDialCode = false;
|
|
26759
|
+
}
|
|
26760
|
+
// if separateDialCode enabled, do not insert dial codes
|
|
26711
26761
|
if (this.options.separateDialCode) {
|
|
26712
|
-
this.options.
|
|
26762
|
+
this.options.autoInsertDialCode = false;
|
|
26763
|
+
}
|
|
26764
|
+
// force showFlags=true if there's a dropdown and we're not displaying the dial code,
|
|
26765
|
+
// as otherwise you just have a down arrow on it's own which doesn't make sense
|
|
26766
|
+
var forceShowFlags = this.options.allowDropdown && !this.options.separateDialCode;
|
|
26767
|
+
if (!this.options.showFlags && forceShowFlags) {
|
|
26768
|
+
this.options.showFlags = true;
|
|
26713
26769
|
}
|
|
26714
26770
|
// we cannot just test screen size as some smartphones/website meta tags will report desktop
|
|
26715
26771
|
// resolutions
|
|
@@ -26721,8 +26777,12 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
26721
26777
|
// trigger the mobile dropdown css
|
|
26722
26778
|
document.body.classList.add("iti-mobile");
|
|
26723
26779
|
// on mobile, we want a full screen dropdown, so we must append it to the body
|
|
26724
|
-
if (!this.options.dropdownContainer)
|
|
26780
|
+
if (!this.options.dropdownContainer) {
|
|
26781
|
+
this.options.dropdownContainer = document.body;
|
|
26782
|
+
}
|
|
26725
26783
|
}
|
|
26784
|
+
// check if input has one parent with RTL
|
|
26785
|
+
this.isRTL = !!this.telInput.closest("[dir=rtl]");
|
|
26726
26786
|
// these promises get resolved when their individual requests complete
|
|
26727
26787
|
// this way the dev can do something like iti.promise.then(...) to know when all requests are
|
|
26728
26788
|
// complete
|
|
@@ -26750,7 +26810,7 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
26750
26810
|
this._generateMarkup();
|
|
26751
26811
|
// set the initial state of the input value and the selected flag
|
|
26752
26812
|
this._setInitialState();
|
|
26753
|
-
// start all of the event listeners:
|
|
26813
|
+
// start all of the event listeners: autoInsertDialCode, input keydown, selectedFlag click
|
|
26754
26814
|
this._initListeners();
|
|
26755
26815
|
// utils script, and auto country
|
|
26756
26816
|
this._initRequests();
|
|
@@ -26765,7 +26825,9 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
26765
26825
|
// process the preferredCountries
|
|
26766
26826
|
this._processPreferredCountries();
|
|
26767
26827
|
// translate countries according to localizedCountries option
|
|
26768
|
-
if (this.options.localizedCountries)
|
|
26828
|
+
if (this.options.localizedCountries) {
|
|
26829
|
+
this._translateCountriesByLocale();
|
|
26830
|
+
}
|
|
26769
26831
|
// sort countries by name
|
|
26770
26832
|
if (this.options.onlyCountries.length || this.options.localizedCountries) {
|
|
26771
26833
|
this.countries.sort(this._countryNameSort);
|
|
@@ -26782,7 +26844,9 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
26782
26844
|
}
|
|
26783
26845
|
// bail if we already have this country for this countryCode
|
|
26784
26846
|
for (var i = 0; i < this.countryCodes[countryCode].length; i++) {
|
|
26785
|
-
if (this.countryCodes[countryCode][i] === iso2)
|
|
26847
|
+
if (this.countryCodes[countryCode][i] === iso2) {
|
|
26848
|
+
return;
|
|
26849
|
+
}
|
|
26786
26850
|
}
|
|
26787
26851
|
// check for undefined as 0 is falsy
|
|
26788
26852
|
var index = priority !== undefined$1 ? priority : this.countryCodes[countryCode].length;
|
|
@@ -26822,7 +26886,13 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
26822
26886
|
}, {
|
|
26823
26887
|
key: "_countryNameSort",
|
|
26824
26888
|
value: function _countryNameSort(a, b) {
|
|
26825
|
-
|
|
26889
|
+
if (a.name < b.name) {
|
|
26890
|
+
return -1;
|
|
26891
|
+
}
|
|
26892
|
+
if (a.name > b.name) {
|
|
26893
|
+
return 1;
|
|
26894
|
+
}
|
|
26895
|
+
return 0;
|
|
26826
26896
|
}
|
|
26827
26897
|
}, {
|
|
26828
26898
|
key: "_processCountryCodes",
|
|
@@ -26835,7 +26905,9 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
26835
26905
|
// first: add dial codes
|
|
26836
26906
|
for (var i = 0; i < this.countries.length; i++) {
|
|
26837
26907
|
var c = this.countries[i];
|
|
26838
|
-
if (!this.dialCodes[c.dialCode])
|
|
26908
|
+
if (!this.dialCodes[c.dialCode]) {
|
|
26909
|
+
this.dialCodes[c.dialCode] = true;
|
|
26910
|
+
}
|
|
26839
26911
|
this._addCountryCode(c.iso2, c.dialCode, c.priority);
|
|
26840
26912
|
}
|
|
26841
26913
|
// next: add area codes
|
|
@@ -26870,17 +26942,23 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
26870
26942
|
for (var i = 0; i < this.options.preferredCountries.length; i++) {
|
|
26871
26943
|
var countryCode = this.options.preferredCountries[i].toLowerCase();
|
|
26872
26944
|
var countryData = this._getCountryData(countryCode, false, true);
|
|
26873
|
-
if (countryData)
|
|
26945
|
+
if (countryData) {
|
|
26946
|
+
this.preferredCountries.push(countryData);
|
|
26947
|
+
}
|
|
26874
26948
|
}
|
|
26875
26949
|
}
|
|
26876
26950
|
}, {
|
|
26877
26951
|
key: "_createEl",
|
|
26878
26952
|
value: function _createEl(name, attrs, container) {
|
|
26879
26953
|
var el = document.createElement(name);
|
|
26880
|
-
if (attrs)
|
|
26881
|
-
|
|
26882
|
-
|
|
26883
|
-
|
|
26954
|
+
if (attrs) {
|
|
26955
|
+
forEachProp(attrs, function(key, value) {
|
|
26956
|
+
return el.setAttribute(key, value);
|
|
26957
|
+
});
|
|
26958
|
+
}
|
|
26959
|
+
if (container) {
|
|
26960
|
+
container.appendChild(el);
|
|
26961
|
+
}
|
|
26884
26962
|
return el;
|
|
26885
26963
|
}
|
|
26886
26964
|
}, {
|
|
@@ -26889,45 +26967,69 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
26889
26967
|
// if autocomplete does not exist on the element and its form, then
|
|
26890
26968
|
// prevent autocomplete as there's no safe, cross-browser event we can react to, so it can
|
|
26891
26969
|
// easily put the plugin in an inconsistent state e.g. the wrong flag selected for the
|
|
26892
|
-
// autocompleted number, which on submit could mean wrong number is saved
|
|
26970
|
+
// autocompleted number, which on submit could mean wrong number is saved
|
|
26893
26971
|
if (!this.telInput.hasAttribute("autocomplete") && !(this.telInput.form && this.telInput.form.hasAttribute("autocomplete"))) {
|
|
26894
26972
|
this.telInput.setAttribute("autocomplete", "off");
|
|
26895
26973
|
}
|
|
26974
|
+
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;
|
|
26896
26975
|
// containers (mostly for positioning)
|
|
26897
26976
|
var parentClass = "iti";
|
|
26898
|
-
if (
|
|
26899
|
-
|
|
26900
|
-
|
|
26901
|
-
|
|
26902
|
-
parentClass +=
|
|
26977
|
+
if (allowDropdown) {
|
|
26978
|
+
parentClass += " iti--allow-dropdown";
|
|
26979
|
+
}
|
|
26980
|
+
if (separateDialCode) {
|
|
26981
|
+
parentClass += " iti--separate-dial-code";
|
|
26982
|
+
}
|
|
26983
|
+
if (showFlags) {
|
|
26984
|
+
parentClass += " iti--show-flags";
|
|
26985
|
+
}
|
|
26986
|
+
if (customContainer) {
|
|
26987
|
+
parentClass += " ".concat(customContainer);
|
|
26903
26988
|
}
|
|
26904
26989
|
var wrapper = this._createEl("div", {
|
|
26905
26990
|
"class": parentClass
|
|
26906
26991
|
});
|
|
26907
26992
|
this.telInput.parentNode.insertBefore(wrapper, this.telInput);
|
|
26908
|
-
|
|
26909
|
-
|
|
26910
|
-
|
|
26993
|
+
// only hide the flagsContainer if allowDropdown, showFlags and separateDialCode are all false
|
|
26994
|
+
var showFlagsContainer = allowDropdown || showFlags || separateDialCode;
|
|
26995
|
+
if (showFlagsContainer) {
|
|
26996
|
+
this.flagsContainer = this._createEl("div", {
|
|
26997
|
+
"class": "iti__flag-container"
|
|
26998
|
+
}, wrapper);
|
|
26999
|
+
}
|
|
26911
27000
|
wrapper.appendChild(this.telInput);
|
|
26912
27001
|
// selected flag (displayed to left of input)
|
|
26913
|
-
|
|
26914
|
-
|
|
26915
|
-
|
|
26916
|
-
|
|
26917
|
-
|
|
26918
|
-
|
|
26919
|
-
|
|
26920
|
-
|
|
26921
|
-
|
|
26922
|
-
|
|
26923
|
-
|
|
27002
|
+
// using Aria tags for "Select-Only Combobox Example"
|
|
27003
|
+
// https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/
|
|
27004
|
+
if (showFlagsContainer) {
|
|
27005
|
+
this.selectedFlag = this._createEl("div", _objectSpread({
|
|
27006
|
+
"class": "iti__selected-flag"
|
|
27007
|
+
}, allowDropdown && {
|
|
27008
|
+
role: "combobox",
|
|
27009
|
+
"aria-haspopup": "listbox",
|
|
27010
|
+
"aria-controls": "iti-".concat(this.id, "__country-listbox"),
|
|
27011
|
+
"aria-expanded": "false",
|
|
27012
|
+
"aria-label": "Telephone country code"
|
|
27013
|
+
}), this.flagsContainer);
|
|
27014
|
+
}
|
|
27015
|
+
if (showFlags) {
|
|
27016
|
+
this.selectedFlagInner = this._createEl("div", {
|
|
27017
|
+
"class": "iti__flag"
|
|
27018
|
+
}, this.selectedFlag);
|
|
27019
|
+
}
|
|
27020
|
+
if (this.selectedFlag && this.telInput.disabled) {
|
|
27021
|
+
this.selectedFlag.setAttribute("aria-disabled", "true");
|
|
27022
|
+
}
|
|
27023
|
+
if (separateDialCode) {
|
|
26924
27024
|
this.selectedDialCode = this._createEl("div", {
|
|
26925
27025
|
"class": "iti__selected-dial-code"
|
|
26926
27026
|
}, this.selectedFlag);
|
|
26927
27027
|
}
|
|
26928
|
-
if (
|
|
26929
|
-
|
|
26930
|
-
|
|
27028
|
+
if (allowDropdown) {
|
|
27029
|
+
if (!this.telInput.disabled) {
|
|
27030
|
+
// make element focusable and tab navigable
|
|
27031
|
+
this.selectedFlag.setAttribute("tabindex", "0");
|
|
27032
|
+
}
|
|
26931
27033
|
this.dropdownArrow = this._createEl("div", {
|
|
26932
27034
|
"class": "iti__arrow"
|
|
26933
27035
|
}, this.selectedFlag);
|
|
@@ -26948,7 +27050,7 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
26948
27050
|
}
|
|
26949
27051
|
this._appendListItems(this.countries, "iti__standard");
|
|
26950
27052
|
// create dropdownContainer markup
|
|
26951
|
-
if (
|
|
27053
|
+
if (dropdownContainer) {
|
|
26952
27054
|
this.dropdown = this._createEl("div", {
|
|
26953
27055
|
"class": "iti iti--container"
|
|
26954
27056
|
});
|
|
@@ -26957,14 +27059,16 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
26957
27059
|
this.flagsContainer.appendChild(this.countryList);
|
|
26958
27060
|
}
|
|
26959
27061
|
}
|
|
26960
|
-
if (
|
|
26961
|
-
var hiddenInputName =
|
|
27062
|
+
if (hiddenInput) {
|
|
27063
|
+
var hiddenInputName = hiddenInput;
|
|
26962
27064
|
var name = this.telInput.getAttribute("name");
|
|
26963
27065
|
if (name) {
|
|
26964
27066
|
var i = name.lastIndexOf("[");
|
|
26965
27067
|
// if input name contains square brackets, then give the hidden input the same name,
|
|
26966
27068
|
// replacing the contents of the last set of brackets with the given hiddenInput name
|
|
26967
|
-
if (i !== -1)
|
|
27069
|
+
if (i !== -1) {
|
|
27070
|
+
hiddenInputName = "".concat(name.substr(0, i), "[").concat(hiddenInputName, "]");
|
|
27071
|
+
}
|
|
26968
27072
|
}
|
|
26969
27073
|
this.hiddenInput = this._createEl("input", {
|
|
26970
27074
|
type: "hidden",
|
|
@@ -26986,7 +27090,9 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
26986
27090
|
// open the list item
|
|
26987
27091
|
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'>");
|
|
26988
27092
|
// add the flag
|
|
26989
|
-
|
|
27093
|
+
if (this.options.showFlags) {
|
|
27094
|
+
tmp += "<div class='iti__flag-box'><div class='iti__flag iti__".concat(c.iso2, "'></div></div>");
|
|
27095
|
+
}
|
|
26990
27096
|
// and the country name and dial code
|
|
26991
27097
|
tmp += "<span class='iti__country-name'>".concat(c.name, "</span>");
|
|
26992
27098
|
tmp += "<span class='iti__dial-code'>+".concat(c.dialCode, "</span>");
|
|
@@ -27007,7 +27113,7 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27007
27113
|
var val = useAttribute ? attributeValue : inputValue;
|
|
27008
27114
|
var dialCode = this._getDialCode(val);
|
|
27009
27115
|
var isRegionlessNanp = this._isRegionlessNanp(val);
|
|
27010
|
-
var _this$
|
|
27116
|
+
var _this$options2 = this.options, initialCountry = _this$options2.initialCountry, autoInsertDialCode = _this$options2.autoInsertDialCode;
|
|
27011
27117
|
// if we already have a dial code, and it's not a regionlessNanp, we can go ahead and set the
|
|
27012
27118
|
// flag, else fall back to the default country
|
|
27013
27119
|
if (dialCode && !isRegionlessNanp) {
|
|
@@ -27028,22 +27134,30 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27028
27134
|
}
|
|
27029
27135
|
}
|
|
27030
27136
|
}
|
|
27031
|
-
// if empty and
|
|
27032
|
-
if (!val &&
|
|
27137
|
+
// if empty and autoInsertDialCode then insert the dial code
|
|
27138
|
+
if (!val && autoInsertDialCode) {
|
|
27033
27139
|
this.telInput.value = "+".concat(this.selectedCountryData.dialCode);
|
|
27034
27140
|
}
|
|
27035
27141
|
}
|
|
27036
27142
|
// NOTE: if initialCountry is set to auto, that will be handled separately
|
|
27037
27143
|
// format - note this wont be run after _updateDialCode as that's only called if no val
|
|
27038
|
-
if (val)
|
|
27144
|
+
if (val) {
|
|
27145
|
+
this._updateValFromNumber(val);
|
|
27146
|
+
}
|
|
27039
27147
|
}
|
|
27040
27148
|
}, {
|
|
27041
27149
|
key: "_initListeners",
|
|
27042
27150
|
value: function _initListeners() {
|
|
27043
27151
|
this._initKeyListeners();
|
|
27044
|
-
if (this.options.
|
|
27045
|
-
|
|
27046
|
-
|
|
27152
|
+
if (this.options.autoInsertDialCode) {
|
|
27153
|
+
this._initBlurListeners();
|
|
27154
|
+
}
|
|
27155
|
+
if (this.options.allowDropdown) {
|
|
27156
|
+
this._initDropdownListeners();
|
|
27157
|
+
}
|
|
27158
|
+
if (this.hiddenInput) {
|
|
27159
|
+
this._initHiddenInputListener();
|
|
27160
|
+
}
|
|
27047
27161
|
}
|
|
27048
27162
|
}, {
|
|
27049
27163
|
key: "_initHiddenInputListener",
|
|
@@ -27052,7 +27166,9 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27052
27166
|
this._handleHiddenInputSubmit = function() {
|
|
27053
27167
|
_this3.hiddenInput.value = _this3.getNumber();
|
|
27054
27168
|
};
|
|
27055
|
-
if (this.telInput.form)
|
|
27169
|
+
if (this.telInput.form) {
|
|
27170
|
+
this.telInput.form.addEventListener("submit", this._handleHiddenInputSubmit);
|
|
27171
|
+
}
|
|
27056
27172
|
}
|
|
27057
27173
|
}, {
|
|
27058
27174
|
key: "_getClosestLabel",
|
|
@@ -27072,10 +27188,16 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27072
27188
|
// close it again
|
|
27073
27189
|
this._handleLabelClick = function(e) {
|
|
27074
27190
|
// if the dropdown is closed, then focus the input, else ignore the click
|
|
27075
|
-
if (_this4.countryList.classList.contains("iti__hide"))
|
|
27191
|
+
if (_this4.countryList.classList.contains("iti__hide")) {
|
|
27192
|
+
_this4.telInput.focus();
|
|
27193
|
+
} else {
|
|
27194
|
+
e.preventDefault();
|
|
27195
|
+
}
|
|
27076
27196
|
};
|
|
27077
27197
|
var label = this._getClosestLabel();
|
|
27078
|
-
if (label)
|
|
27198
|
+
if (label) {
|
|
27199
|
+
label.addEventListener("click", this._handleLabelClick);
|
|
27200
|
+
}
|
|
27079
27201
|
// toggle country dropdown on click
|
|
27080
27202
|
this._handleClickSelectedFlag = function() {
|
|
27081
27203
|
// only intercept this event if we're opening the dropdown
|
|
@@ -27097,7 +27219,9 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27097
27219
|
_this4._showDropdown();
|
|
27098
27220
|
}
|
|
27099
27221
|
// allow navigation from dropdown to input on TAB
|
|
27100
|
-
if (e.key === "Tab")
|
|
27222
|
+
if (e.key === "Tab") {
|
|
27223
|
+
_this4._closeDropdown();
|
|
27224
|
+
}
|
|
27101
27225
|
};
|
|
27102
27226
|
this.flagsContainer.addEventListener("keydown", this._handleFlagsContainerKeydown);
|
|
27103
27227
|
}
|
|
@@ -27116,8 +27240,14 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27116
27240
|
window.intlTelInputGlobals.loadUtils(_this5.options.utilsScript);
|
|
27117
27241
|
});
|
|
27118
27242
|
}
|
|
27119
|
-
} else
|
|
27120
|
-
|
|
27243
|
+
} else {
|
|
27244
|
+
this.resolveUtilsScriptPromise();
|
|
27245
|
+
}
|
|
27246
|
+
if (this.options.initialCountry === "auto") {
|
|
27247
|
+
this._loadAutoCountry();
|
|
27248
|
+
} else {
|
|
27249
|
+
this.resolveAutoCountryPromise();
|
|
27250
|
+
}
|
|
27121
27251
|
}
|
|
27122
27252
|
}, {
|
|
27123
27253
|
key: "_loadAutoCountry",
|
|
@@ -27182,7 +27312,9 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27182
27312
|
this._handleSubmitOrBlurEvent = function() {
|
|
27183
27313
|
_this7._removeEmptyDialCode();
|
|
27184
27314
|
};
|
|
27185
|
-
if (this.telInput.form)
|
|
27315
|
+
if (this.telInput.form) {
|
|
27316
|
+
this.telInput.form.addEventListener("submit", this._handleSubmitOrBlurEvent);
|
|
27317
|
+
}
|
|
27186
27318
|
this.telInput.addEventListener("blur", this._handleSubmitOrBlurEvent);
|
|
27187
27319
|
}
|
|
27188
27320
|
}, {
|
|
@@ -27230,7 +27362,11 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27230
27362
|
}, {
|
|
27231
27363
|
key: "_toggleClass",
|
|
27232
27364
|
value: function _toggleClass(el, className, shouldHaveClass) {
|
|
27233
|
-
if (shouldHaveClass && !el.classList.contains(className))
|
|
27365
|
+
if (shouldHaveClass && !el.classList.contains(className)) {
|
|
27366
|
+
el.classList.add(className);
|
|
27367
|
+
} else if (!shouldHaveClass && el.classList.contains(className)) {
|
|
27368
|
+
el.classList.remove(className);
|
|
27369
|
+
}
|
|
27234
27370
|
}
|
|
27235
27371
|
}, {
|
|
27236
27372
|
key: "_setDropdownPosition",
|
|
@@ -27286,13 +27422,17 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27286
27422
|
this._handleMouseoverCountryList = function(e) {
|
|
27287
27423
|
// handle event delegation, as we're listening for this event on the countryList
|
|
27288
27424
|
var listItem = _this9._getClosestListItem(e.target);
|
|
27289
|
-
if (listItem)
|
|
27425
|
+
if (listItem) {
|
|
27426
|
+
_this9._highlightListItem(listItem, false);
|
|
27427
|
+
}
|
|
27290
27428
|
};
|
|
27291
27429
|
this.countryList.addEventListener("mouseover", this._handleMouseoverCountryList);
|
|
27292
27430
|
// listen for country selection
|
|
27293
27431
|
this._handleClickCountryList = function(e) {
|
|
27294
27432
|
var listItem = _this9._getClosestListItem(e.target);
|
|
27295
|
-
if (listItem)
|
|
27433
|
+
if (listItem) {
|
|
27434
|
+
_this9._selectListItem(listItem);
|
|
27435
|
+
}
|
|
27296
27436
|
};
|
|
27297
27437
|
this.countryList.addEventListener("click", this._handleClickCountryList);
|
|
27298
27438
|
// click off to close
|
|
@@ -27300,7 +27440,9 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27300
27440
|
// we cannot just stopPropagation as it may be needed to close another instance
|
|
27301
27441
|
var isOpening = true;
|
|
27302
27442
|
this._handleClickOffToClose = function() {
|
|
27303
|
-
if (!isOpening)
|
|
27443
|
+
if (!isOpening) {
|
|
27444
|
+
_this9._closeDropdown();
|
|
27445
|
+
}
|
|
27304
27446
|
isOpening = false;
|
|
27305
27447
|
};
|
|
27306
27448
|
document.documentElement.addEventListener("click", this._handleClickOffToClose);
|
|
@@ -27315,9 +27457,17 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27315
27457
|
// and enter key from submitting a form etc
|
|
27316
27458
|
e.preventDefault();
|
|
27317
27459
|
// up and down to navigate
|
|
27318
|
-
if (e.key === "ArrowUp" || e.key === "Up" || e.key === "ArrowDown" || e.key === "Down")
|
|
27460
|
+
if (e.key === "ArrowUp" || e.key === "Up" || e.key === "ArrowDown" || e.key === "Down") {
|
|
27461
|
+
_this9._handleUpDownKey(e.key);
|
|
27462
|
+
} else if (e.key === "Enter") {
|
|
27463
|
+
_this9._handleEnterKey();
|
|
27464
|
+
} else if (e.key === "Escape") {
|
|
27465
|
+
_this9._closeDropdown();
|
|
27466
|
+
} else if (/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(e.key)) {
|
|
27319
27467
|
// jump to countries that start with the query string
|
|
27320
|
-
if (queryTimer)
|
|
27468
|
+
if (queryTimer) {
|
|
27469
|
+
clearTimeout(queryTimer);
|
|
27470
|
+
}
|
|
27321
27471
|
query += e.key.toLowerCase();
|
|
27322
27472
|
_this9._searchForCountry(query);
|
|
27323
27473
|
// if the timer hits 1 second, reset the query
|
|
@@ -27343,7 +27493,9 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27343
27493
|
}, {
|
|
27344
27494
|
key: "_handleEnterKey",
|
|
27345
27495
|
value: function _handleEnterKey() {
|
|
27346
|
-
if (this.highlightedItem)
|
|
27496
|
+
if (this.highlightedItem) {
|
|
27497
|
+
this._selectListItem(this.highlightedItem);
|
|
27498
|
+
}
|
|
27347
27499
|
}
|
|
27348
27500
|
}, {
|
|
27349
27501
|
key: "_searchForCountry",
|
|
@@ -27368,7 +27520,7 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27368
27520
|
value: function _updateValFromNumber(originalNumber) {
|
|
27369
27521
|
var number = originalNumber;
|
|
27370
27522
|
if (this.options.formatOnDisplay && window.intlTelInputUtils && this.selectedCountryData) {
|
|
27371
|
-
var useNational =
|
|
27523
|
+
var useNational = this.options.nationalMode || number.charAt(0) !== "+" && !this.options.separateDialCode;
|
|
27372
27524
|
var _intlTelInputUtils$nu = intlTelInputUtils.numberFormat, NATIONAL = _intlTelInputUtils$nu.NATIONAL, INTERNATIONAL = _intlTelInputUtils$nu.INTERNATIONAL;
|
|
27373
27525
|
var format = useNational ? NATIONAL : INTERNATIONAL;
|
|
27374
27526
|
number = intlTelInputUtils.formatNumber(number, this.selectedCountryData.iso2, format);
|
|
@@ -27379,7 +27531,7 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27379
27531
|
}, {
|
|
27380
27532
|
key: "_updateFlagFromNumber",
|
|
27381
27533
|
value: function _updateFlagFromNumber(originalNumber) {
|
|
27382
|
-
// if we
|
|
27534
|
+
// if we already have US/Canada selected, make sure the number starts
|
|
27383
27535
|
// with a +1 so _getDialCode will be able to extract the area code
|
|
27384
27536
|
// update: if we dont yet have selectedCountryData, but we're here (trying to update the flag
|
|
27385
27537
|
// from the number), that means we're initialising the plugin with a number that already has a
|
|
@@ -27387,11 +27539,13 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27387
27539
|
var number = originalNumber;
|
|
27388
27540
|
var selectedDialCode = this.selectedCountryData.dialCode;
|
|
27389
27541
|
var isNanp = selectedDialCode === "1";
|
|
27390
|
-
if (number &&
|
|
27391
|
-
if (number.charAt(0) !== "1")
|
|
27542
|
+
if (number && isNanp && number.charAt(0) !== "+") {
|
|
27543
|
+
if (number.charAt(0) !== "1") {
|
|
27544
|
+
number = "1".concat(number);
|
|
27545
|
+
}
|
|
27392
27546
|
number = "+".concat(number);
|
|
27393
27547
|
}
|
|
27394
|
-
//
|
|
27548
|
+
// if separateDialCode enabled, then consider the selected dial code to be part of the number
|
|
27395
27549
|
if (this.options.separateDialCode && selectedDialCode && number.charAt(0) !== "+") {
|
|
27396
27550
|
number = "+".concat(selectedDialCode).concat(number);
|
|
27397
27551
|
}
|
|
@@ -27449,10 +27603,15 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27449
27603
|
key: "_highlightListItem",
|
|
27450
27604
|
value: function _highlightListItem(listItem, shouldFocus) {
|
|
27451
27605
|
var prevItem = this.highlightedItem;
|
|
27452
|
-
if (prevItem)
|
|
27606
|
+
if (prevItem) {
|
|
27607
|
+
prevItem.classList.remove("iti__highlight");
|
|
27608
|
+
}
|
|
27453
27609
|
this.highlightedItem = listItem;
|
|
27454
27610
|
this.highlightedItem.classList.add("iti__highlight");
|
|
27455
|
-
|
|
27611
|
+
this.selectedFlag.setAttribute("aria-activedescendant", listItem.getAttribute("id"));
|
|
27612
|
+
if (shouldFocus) {
|
|
27613
|
+
this.highlightedItem.focus();
|
|
27614
|
+
}
|
|
27456
27615
|
}
|
|
27457
27616
|
}, {
|
|
27458
27617
|
key: "_getCountryData",
|
|
@@ -27471,6 +27630,7 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27471
27630
|
}, {
|
|
27472
27631
|
key: "_setFlag",
|
|
27473
27632
|
value: function _setFlag(countryCode) {
|
|
27633
|
+
var _this$options3 = this.options, allowDropdown = _this$options3.allowDropdown, separateDialCode = _this$options3.separateDialCode, showFlags = _this$options3.showFlags;
|
|
27474
27634
|
var prevCountry = this.selectedCountryData.iso2 ? this.selectedCountryData : {};
|
|
27475
27635
|
// do this first as it will throw an error and stop if countryCode is invalid
|
|
27476
27636
|
this.selectedCountryData = countryCode ? this._getCountryData(countryCode, false, false) : {};
|
|
@@ -27478,22 +27638,26 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27478
27638
|
if (this.selectedCountryData.iso2) {
|
|
27479
27639
|
this.defaultCountry = this.selectedCountryData.iso2;
|
|
27480
27640
|
}
|
|
27481
|
-
|
|
27482
|
-
|
|
27483
|
-
|
|
27484
|
-
this.
|
|
27485
|
-
if (
|
|
27641
|
+
if (showFlags) {
|
|
27642
|
+
this.selectedFlagInner.setAttribute("class", "iti__flag iti__".concat(countryCode));
|
|
27643
|
+
}
|
|
27644
|
+
this._setSelectedCountryFlagTitleAttribute(countryCode, separateDialCode);
|
|
27645
|
+
if (separateDialCode) {
|
|
27486
27646
|
var dialCode = this.selectedCountryData.dialCode ? "+".concat(this.selectedCountryData.dialCode) : "";
|
|
27487
27647
|
this.selectedDialCode.innerHTML = dialCode;
|
|
27488
27648
|
// offsetWidth is zero if input is in a hidden container during initialisation
|
|
27489
27649
|
var selectedFlagWidth = this.selectedFlag.offsetWidth || this._getHiddenSelectedFlagWidth();
|
|
27490
27650
|
// add 6px of padding after the grey selected-dial-code box, as this is what we use in the css
|
|
27491
|
-
this.
|
|
27651
|
+
if (this.isRTL) {
|
|
27652
|
+
this.telInput.style.paddingRight = "".concat(selectedFlagWidth + 6, "px");
|
|
27653
|
+
} else {
|
|
27654
|
+
this.telInput.style.paddingLeft = "".concat(selectedFlagWidth + 6, "px");
|
|
27655
|
+
}
|
|
27492
27656
|
}
|
|
27493
27657
|
// and the input's placeholder
|
|
27494
27658
|
this._updatePlaceholder();
|
|
27495
27659
|
// update the active list item
|
|
27496
|
-
if (
|
|
27660
|
+
if (allowDropdown) {
|
|
27497
27661
|
var prevItem = this.activeItem;
|
|
27498
27662
|
if (prevItem) {
|
|
27499
27663
|
prevItem.classList.remove("iti__active");
|
|
@@ -27505,12 +27669,29 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27505
27669
|
nextItem.setAttribute("aria-selected", "true");
|
|
27506
27670
|
nextItem.classList.add("iti__active");
|
|
27507
27671
|
this.activeItem = nextItem;
|
|
27508
|
-
this.selectedFlag.setAttribute("aria-activedescendant", nextItem.getAttribute("id"));
|
|
27509
27672
|
}
|
|
27510
27673
|
}
|
|
27511
27674
|
// return if the flag has changed or not
|
|
27512
27675
|
return prevCountry.iso2 !== countryCode;
|
|
27513
27676
|
}
|
|
27677
|
+
}, {
|
|
27678
|
+
key: "_setSelectedCountryFlagTitleAttribute",
|
|
27679
|
+
value: function _setSelectedCountryFlagTitleAttribute(countryCode, separateDialCode) {
|
|
27680
|
+
if (!this.selectedFlag) {
|
|
27681
|
+
return;
|
|
27682
|
+
}
|
|
27683
|
+
var title;
|
|
27684
|
+
if (countryCode && !separateDialCode) {
|
|
27685
|
+
title = "".concat(this.selectedCountryData.name, ": +").concat(this.selectedCountryData.dialCode);
|
|
27686
|
+
} else if (countryCode) {
|
|
27687
|
+
// For screen reader output, we don't want to include the dial code in the reader output twice
|
|
27688
|
+
// so just use the selected country name here:
|
|
27689
|
+
title = this.selectedCountryData.name;
|
|
27690
|
+
} else {
|
|
27691
|
+
title = "Unknown";
|
|
27692
|
+
}
|
|
27693
|
+
this.selectedFlag.setAttribute("title", title);
|
|
27694
|
+
}
|
|
27514
27695
|
}, {
|
|
27515
27696
|
key: "_getHiddenSelectedFlagWidth",
|
|
27516
27697
|
value: function _getHiddenSelectedFlagWidth() {
|
|
@@ -27547,11 +27728,11 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27547
27728
|
// update selected flag and active list item
|
|
27548
27729
|
var flagChanged = this._setFlag(listItem.getAttribute("data-country-code"));
|
|
27549
27730
|
this._closeDropdown();
|
|
27550
|
-
this._updateDialCode(listItem.getAttribute("data-dial-code")
|
|
27731
|
+
this._updateDialCode(listItem.getAttribute("data-dial-code"));
|
|
27551
27732
|
// focus the input
|
|
27552
27733
|
this.telInput.focus();
|
|
27553
|
-
// put cursor at end - this fix is required for FF and IE11 (with
|
|
27554
|
-
//
|
|
27734
|
+
// put cursor at end - this fix is required for FF and IE11 (with auto inserting dial code),
|
|
27735
|
+
// who try to put the cursor at the beginning the first time
|
|
27555
27736
|
var len = this.telInput.value.length;
|
|
27556
27737
|
this.telInput.setSelectionRange(len, len);
|
|
27557
27738
|
if (flagChanged) {
|
|
@@ -27563,6 +27744,7 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27563
27744
|
value: function _closeDropdown() {
|
|
27564
27745
|
this.countryList.classList.add("iti__hide");
|
|
27565
27746
|
this.selectedFlag.setAttribute("aria-expanded", "false");
|
|
27747
|
+
this.selectedFlag.removeAttribute("aria-activedescendant");
|
|
27566
27748
|
// update the arrow
|
|
27567
27749
|
this.dropdownArrow.classList.remove("iti__arrow--up");
|
|
27568
27750
|
// unbind key events
|
|
@@ -27572,8 +27754,12 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27572
27754
|
this.countryList.removeEventListener("click", this._handleClickCountryList);
|
|
27573
27755
|
// remove menu from container
|
|
27574
27756
|
if (this.options.dropdownContainer) {
|
|
27575
|
-
if (!this.isMobile)
|
|
27576
|
-
|
|
27757
|
+
if (!this.isMobile) {
|
|
27758
|
+
window.removeEventListener("scroll", this._handleWindowScroll);
|
|
27759
|
+
}
|
|
27760
|
+
if (this.dropdown.parentNode) {
|
|
27761
|
+
this.dropdown.parentNode.removeChild(this.dropdown);
|
|
27762
|
+
}
|
|
27577
27763
|
}
|
|
27578
27764
|
this._trigger("close:countrydropdown");
|
|
27579
27765
|
}
|
|
@@ -27593,24 +27779,28 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27593
27779
|
var middleOffset = containerHeight / 2 - elementHeight / 2;
|
|
27594
27780
|
if (elementTop < containerTop) {
|
|
27595
27781
|
// scroll up
|
|
27596
|
-
if (middle)
|
|
27782
|
+
if (middle) {
|
|
27783
|
+
newScrollTop -= middleOffset;
|
|
27784
|
+
}
|
|
27597
27785
|
container.scrollTop = newScrollTop;
|
|
27598
27786
|
} else if (elementBottom > containerBottom) {
|
|
27599
27787
|
// scroll down
|
|
27600
|
-
if (middle)
|
|
27788
|
+
if (middle) {
|
|
27789
|
+
newScrollTop += middleOffset;
|
|
27790
|
+
}
|
|
27601
27791
|
var heightDifference = containerHeight - elementHeight;
|
|
27602
27792
|
container.scrollTop = newScrollTop - heightDifference;
|
|
27603
27793
|
}
|
|
27604
27794
|
}
|
|
27605
27795
|
}, {
|
|
27606
27796
|
key: "_updateDialCode",
|
|
27607
|
-
value: function _updateDialCode(newDialCodeBare
|
|
27797
|
+
value: function _updateDialCode(newDialCodeBare) {
|
|
27608
27798
|
var inputVal = this.telInput.value;
|
|
27609
27799
|
// save having to pass this every time
|
|
27610
27800
|
var newDialCode = "+".concat(newDialCodeBare);
|
|
27611
27801
|
var newNumber;
|
|
27612
27802
|
if (inputVal.charAt(0) === "+") {
|
|
27613
|
-
// there's a plus so we're dealing with a replacement
|
|
27803
|
+
// there's a plus so we're dealing with a replacement
|
|
27614
27804
|
var prevDialCode = this._getDialCode(inputVal);
|
|
27615
27805
|
if (prevDialCode) {
|
|
27616
27806
|
// current number contains a valid dial code, so replace it
|
|
@@ -27620,23 +27810,16 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27620
27810
|
// (no way to determine where the invalid dial code ends and the rest of the number begins)
|
|
27621
27811
|
newNumber = newDialCode;
|
|
27622
27812
|
}
|
|
27623
|
-
|
|
27624
|
-
|
|
27625
|
-
return;
|
|
27626
|
-
} else {
|
|
27627
|
-
// nationalMode is disabled
|
|
27813
|
+
this.telInput.value = newNumber;
|
|
27814
|
+
} else if (this.options.autoInsertDialCode) {
|
|
27628
27815
|
if (inputVal) {
|
|
27629
27816
|
// there is an existing value with no dial code: prefix the new dial code
|
|
27630
27817
|
newNumber = newDialCode + inputVal;
|
|
27631
|
-
} else if (hasSelectedListItem || !this.options.autoHideDialCode) {
|
|
27632
|
-
// no existing value and either they've just selected a list item, or autoHideDialCode is
|
|
27633
|
-
// disabled: insert new dial code
|
|
27634
|
-
newNumber = newDialCode;
|
|
27635
27818
|
} else {
|
|
27636
|
-
|
|
27819
|
+
newNumber = newDialCode;
|
|
27637
27820
|
}
|
|
27821
|
+
this.telInput.value = newNumber;
|
|
27638
27822
|
}
|
|
27639
|
-
this.telInput.value = newNumber;
|
|
27640
27823
|
}
|
|
27641
27824
|
}, {
|
|
27642
27825
|
key: "_getDialCode",
|
|
@@ -27751,13 +27934,19 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27751
27934
|
this.flagsContainer.removeEventListener("keydown", this._handleFlagsContainerKeydown);
|
|
27752
27935
|
// label click hack
|
|
27753
27936
|
var label = this._getClosestLabel();
|
|
27754
|
-
if (label)
|
|
27937
|
+
if (label) {
|
|
27938
|
+
label.removeEventListener("click", this._handleLabelClick);
|
|
27939
|
+
}
|
|
27755
27940
|
}
|
|
27756
27941
|
// unbind hiddenInput listeners
|
|
27757
|
-
if (this.hiddenInput && form)
|
|
27758
|
-
|
|
27759
|
-
|
|
27760
|
-
|
|
27942
|
+
if (this.hiddenInput && form) {
|
|
27943
|
+
form.removeEventListener("submit", this._handleHiddenInputSubmit);
|
|
27944
|
+
}
|
|
27945
|
+
// unbind autoInsertDialCode listeners
|
|
27946
|
+
if (this.options.autoInsertDialCode) {
|
|
27947
|
+
if (form) {
|
|
27948
|
+
form.removeEventListener("submit", this._handleSubmitOrBlurEvent);
|
|
27949
|
+
}
|
|
27761
27950
|
this.telInput.removeEventListener("blur", this._handleSubmitOrBlurEvent);
|
|
27762
27951
|
}
|
|
27763
27952
|
// unbind key events, and cut/paste events
|
|
@@ -27815,17 +28004,22 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27815
28004
|
key: "isValidNumber",
|
|
27816
28005
|
value: function isValidNumber() {
|
|
27817
28006
|
var val = this._getFullNumber().trim();
|
|
27818
|
-
|
|
27819
|
-
|
|
28007
|
+
return window.intlTelInputUtils ? intlTelInputUtils.isValidNumber(val, this.selectedCountryData.iso2) : null;
|
|
28008
|
+
}
|
|
28009
|
+
}, {
|
|
28010
|
+
key: "isPossibleNumber",
|
|
28011
|
+
value: function isPossibleNumber() {
|
|
28012
|
+
var val = this._getFullNumber().trim();
|
|
28013
|
+
return window.intlTelInputUtils ? intlTelInputUtils.isPossibleNumber(val, this.selectedCountryData.iso2) : null;
|
|
27820
28014
|
}
|
|
27821
28015
|
}, {
|
|
27822
28016
|
key: "setCountry",
|
|
27823
28017
|
value: function setCountry(originalCountryCode) {
|
|
27824
28018
|
var countryCode = originalCountryCode.toLowerCase();
|
|
27825
28019
|
// check if already selected
|
|
27826
|
-
if (
|
|
28020
|
+
if (this.selectedCountryData.iso2 !== countryCode) {
|
|
27827
28021
|
this._setFlag(countryCode);
|
|
27828
|
-
this._updateDialCode(this.selectedCountryData.dialCode
|
|
28022
|
+
this._updateDialCode(this.selectedCountryData.dialCode);
|
|
27829
28023
|
this._triggerCountryChange();
|
|
27830
28024
|
}
|
|
27831
28025
|
}
|
|
@@ -27862,11 +28056,15 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27862
28056
|
var script = document.createElement("script");
|
|
27863
28057
|
script.onload = function() {
|
|
27864
28058
|
forEachInstance("handleUtils");
|
|
27865
|
-
if (handleSuccess)
|
|
28059
|
+
if (handleSuccess) {
|
|
28060
|
+
handleSuccess();
|
|
28061
|
+
}
|
|
27866
28062
|
};
|
|
27867
28063
|
script.onerror = function() {
|
|
27868
28064
|
forEachInstance("rejectUtilsScriptPromise");
|
|
27869
|
-
if (handleFailure)
|
|
28065
|
+
if (handleFailure) {
|
|
28066
|
+
handleFailure();
|
|
28067
|
+
}
|
|
27870
28068
|
};
|
|
27871
28069
|
script.className = "iti-load-utils";
|
|
27872
28070
|
script.async = true;
|
|
@@ -27895,7 +28093,7 @@ var intlTelInput$1 = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
|
27895
28093
|
// default options
|
|
27896
28094
|
intlTelInputGlobals.defaults = defaults;
|
|
27897
28095
|
// version
|
|
27898
|
-
intlTelInputGlobals.version = "
|
|
28096
|
+
intlTelInputGlobals.version = "18.2.1";
|
|
27899
28097
|
// convenience wrapper
|
|
27900
28098
|
return function(input, options) {
|
|
27901
28099
|
var iti = new Iti(input, options);
|