intl-tel-input 26.0.1 → 26.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -13
- package/angular/README.md +1 -1
- package/angular/build/IntlTelInput.js +17 -7
- package/angular/build/IntlTelInputWithUtils.js +17 -7
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/intlTelInput.js +18 -8
- package/build/js/intlTelInput.min.js +5 -5
- package/build/js/intlTelInputWithUtils.js +18 -8
- package/build/js/intlTelInputWithUtils.min.js +5 -5
- package/package.json +1 -1
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +17 -7
- package/react/build/IntlTelInput.js +17 -7
- package/react/build/IntlTelInputWithUtils.cjs +17 -7
- package/react/build/IntlTelInputWithUtils.js +17 -7
- package/svelte/README.md +1 -1
- package/svelte/build/IntlTelInput.mjs +298 -292
- package/svelte/build/IntlTelInputWithUtils.mjs +319 -313
- package/vue/README.md +1 -1
- package/vue/build/exports/IntlTelInput.mjs +1 -1
- package/vue/build/exports/IntlTelInputWithUtils.mjs +1 -1
- package/vue/build/{intl-tel-input-Bk5kP2Ot.mjs → intl-tel-input-A8ZXud5P.mjs} +49 -43
- package/build/img/globe.png +0 -0
- package/build/img/globe.webp +0 -0
- package/build/img/globe@2x.png +0 -0
- package/build/img/globe@2x.webp +0 -0
- package/build/img/globe_light.png +0 -0
- package/build/img/globe_light.webp +0 -0
- package/build/img/globe_light@2x.png +0 -0
- package/build/img/globe_light@2x.webp +0 -0
package/vue/README.md
CHANGED
|
@@ -32,7 +32,7 @@ Alternatively, download and build the project yourself in 3 simple steps. You ju
|
|
|
32
32
|
|
|
33
33
|
See the [Validation demo](https://github.com/jackocnr/intl-tel-input/blob/master/vue/demo/validation/App.vue) for a more fleshed-out example of how to handle validation. See the instructions above for how to run this demo (and others) yourself.
|
|
34
34
|
|
|
35
|
-
A note on the utils script (~260KB): if you're lazy loading the IntlTelInput chunk (and so less worried about filesize), then you can just import IntlTelInput from `"intl-tel-input/vueWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/vue"` import, then you should couple this with the `loadUtils` initialisation option - you will need to host the [utils.js](https://github.com/jackocnr/intl-tel-input/blob/master/build/js/utils.js) file, and then set the `loadUtils` option to that URL, or alternatively just point it to a CDN-hosted version, e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@26.0.
|
|
35
|
+
A note on the utils script (~260KB): if you're lazy loading the IntlTelInput chunk (and so less worried about filesize), then you can just import IntlTelInput from `"intl-tel-input/vueWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/vue"` import, then you should couple this with the `loadUtils` initialisation option - you will need to host the [utils.js](https://github.com/jackocnr/intl-tel-input/blob/master/build/js/utils.js) file, and then set the `loadUtils` option to that URL, or alternatively just point it to a CDN-hosted version, e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@26.0.3/build/js/utils.js"`.
|
|
36
36
|
|
|
37
37
|
## Props
|
|
38
38
|
Here's a list of all of the current props you can pass to the IntlTelInput Vue component.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as g, mergeModels as m, useModel as b, ref as r, onMounted as h, watch as C, onUnmounted as P, withDirectives as N, createElementBlock as M, openBlock as B, mergeProps as D, vModelText as E } from "vue";
|
|
2
|
-
import { i as I } from "../intl-tel-input-
|
|
2
|
+
import { i as I } from "../intl-tel-input-A8ZXud5P.mjs";
|
|
3
3
|
const x = /* @__PURE__ */ g({
|
|
4
4
|
inheritAttrs: !1,
|
|
5
5
|
__name: "IntlTelInput",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as T2, mergeModels as k1, useModel as v2, ref as a1, onMounted as M2, watch as I2, onUnmounted as N2, withDirectives as A2, createElementBlock as R2, openBlock as G2, mergeProps as _2, vModelText as L2 } from "vue";
|
|
2
|
-
import { i as z1 } from "../intl-tel-input-
|
|
2
|
+
import { i as z1 } from "../intl-tel-input-A8ZXud5P.mjs";
|
|
3
3
|
(function() {
|
|
4
4
|
var P = this || self;
|
|
5
5
|
function p(d, $) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const X = [
|
|
2
2
|
[
|
|
3
3
|
"af",
|
|
4
4
|
// Afghanistan
|
|
@@ -1676,7 +1676,7 @@ const q = [
|
|
|
1676
1676
|
"0"
|
|
1677
1677
|
]
|
|
1678
1678
|
], A = [];
|
|
1679
|
-
for (const l of
|
|
1679
|
+
for (const l of X)
|
|
1680
1680
|
A.push({
|
|
1681
1681
|
name: "",
|
|
1682
1682
|
// populated in the plugin
|
|
@@ -1727,7 +1727,7 @@ const S = {
|
|
|
1727
1727
|
// chars that are NOT + or digit (global)
|
|
1728
1728
|
HIDDEN_SEARCH_CHAR: /^[a-zA-ZÀ-ÿа-яА-Я ]$/
|
|
1729
1729
|
// single acceptable hidden-search char
|
|
1730
|
-
},
|
|
1730
|
+
}, Q = {
|
|
1731
1731
|
HIDDEN_SEARCH_RESET_MS: 1e3
|
|
1732
1732
|
}, F = {
|
|
1733
1733
|
UNKNOWN_NUMBER_TYPE: -99,
|
|
@@ -1739,7 +1739,7 @@ const S = {
|
|
|
1739
1739
|
// px width fallback when no separate dial code
|
|
1740
1740
|
INPUT_PADDING_EXTRA_LEFT: 6
|
|
1741
1741
|
// px gap between selected country container and input text
|
|
1742
|
-
},
|
|
1742
|
+
}, K = {
|
|
1743
1743
|
NANP: "1"
|
|
1744
1744
|
// North American Numbering Plan
|
|
1745
1745
|
}, R = {
|
|
@@ -1749,7 +1749,7 @@ const S = {
|
|
|
1749
1749
|
// UK mobile numbers start with 7 after national trunk (0) or core section
|
|
1750
1750
|
MOBILE_CORE_LENGTH: 10
|
|
1751
1751
|
// core number length (excluding dial code / national prefix) for mobiles
|
|
1752
|
-
},
|
|
1752
|
+
}, Z = {
|
|
1753
1753
|
ISO2: "us"
|
|
1754
1754
|
}, M = {
|
|
1755
1755
|
AGGRESSIVE: "aggressive",
|
|
@@ -1769,7 +1769,7 @@ const S = {
|
|
|
1769
1769
|
HIDDEN: "aria-hidden",
|
|
1770
1770
|
AUTOCOMPLETE: "aria-autocomplete",
|
|
1771
1771
|
MODAL: "aria-modal"
|
|
1772
|
-
},
|
|
1772
|
+
}, J = {
|
|
1773
1773
|
selectedCountryAriaLabel: "Change country, selected ${countryName} (${dialCode})",
|
|
1774
1774
|
noCountrySelected: "Select country",
|
|
1775
1775
|
countryListAriaLabel: "List of countries",
|
|
@@ -1779,13 +1779,13 @@ const S = {
|
|
|
1779
1779
|
searchSummaryAria(l) {
|
|
1780
1780
|
return l === 0 ? "No results found" : l === 1 ? "1 result found" : `${l} results found`;
|
|
1781
1781
|
}
|
|
1782
|
-
}, U = (l) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(l).matches,
|
|
1782
|
+
}, U = (l) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(l).matches, tt = () => {
|
|
1783
1783
|
if (typeof navigator < "u" && typeof window < "u") {
|
|
1784
1784
|
const l = U("(max-width: 500px)"), t = U("(max-height: 600px)"), e = U("(pointer: coarse)");
|
|
1785
1785
|
return l || e && t;
|
|
1786
1786
|
}
|
|
1787
1787
|
return !1;
|
|
1788
|
-
},
|
|
1788
|
+
}, Y = {
|
|
1789
1789
|
//* Whether or not to allow the dropdown.
|
|
1790
1790
|
allowDropdown: !0,
|
|
1791
1791
|
//* Whether or not to allow extensions after the main number.
|
|
@@ -1837,13 +1837,13 @@ const S = {
|
|
|
1837
1837
|
//* Only allow certain chars e.g. a plus followed by numeric digits, and cap at max valid length.
|
|
1838
1838
|
strictMode: !1,
|
|
1839
1839
|
//* Use full screen popup instead of dropdown for country list.
|
|
1840
|
-
useFullscreenPopup:
|
|
1840
|
+
useFullscreenPopup: tt(),
|
|
1841
1841
|
//* The number type to enforce during validation.
|
|
1842
1842
|
allowedNumberTypes: ["MOBILE", "FIXED_LINE"]
|
|
1843
|
-
},
|
|
1844
|
-
l.useFullscreenPopup && (l.fixDropdownWidth = !1), l.onlyCountries.length === 1 && (l.initialCountry = l.onlyCountries[0]), l.separateDialCode && (l.nationalMode = !1), l.allowDropdown && !l.showFlags && !l.separateDialCode && (l.nationalMode = !1), l.useFullscreenPopup && !l.dropdownContainer && (l.dropdownContainer = document.body), l.i18n = { ...
|
|
1845
|
-
}, P = (l) => l.replace(/\D/g, ""),
|
|
1846
|
-
const e =
|
|
1843
|
+
}, et = (l) => {
|
|
1844
|
+
l.useFullscreenPopup && (l.fixDropdownWidth = !1), l.onlyCountries.length === 1 && (l.initialCountry = l.onlyCountries[0]), l.separateDialCode && (l.nationalMode = !1), l.allowDropdown && !l.showFlags && !l.separateDialCode && (l.nationalMode = !1), l.useFullscreenPopup && !l.dropdownContainer && (l.dropdownContainer = document.body), l.i18n = { ...J, ...l.i18n };
|
|
1845
|
+
}, P = (l) => l.replace(/\D/g, ""), z = (l = "") => l.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), st = (l, t) => {
|
|
1846
|
+
const e = z(t), s = [], i = [], o = [], n = [], r = [], a = [];
|
|
1847
1847
|
for (const c of l)
|
|
1848
1848
|
c.iso2 === e ? s.push(c) : c.normalisedName.startsWith(e) ? i.push(c) : c.normalisedName.includes(e) ? o.push(c) : e === c.dialCode || e === c.dialCodePlus ? n.push(c) : c.dialCodePlus.includes(e) ? r.push(c) : c.initials.includes(e) && a.push(c);
|
|
1849
1849
|
const d = (c, m) => c.priority - m.priority;
|
|
@@ -1855,7 +1855,7 @@ const S = {
|
|
|
1855
1855
|
...r.sort(d),
|
|
1856
1856
|
...a.sort(d)
|
|
1857
1857
|
];
|
|
1858
|
-
},
|
|
1858
|
+
}, it = (l, t) => {
|
|
1859
1859
|
const e = t.toLowerCase();
|
|
1860
1860
|
for (const s of l)
|
|
1861
1861
|
if (s.name.toLowerCase().startsWith(e))
|
|
@@ -1866,11 +1866,11 @@ const S = {
|
|
|
1866
1866
|
return t && Object.entries(t).forEach(
|
|
1867
1867
|
([i, o]) => s.setAttribute(i, o)
|
|
1868
1868
|
), e && e.appendChild(s), s;
|
|
1869
|
-
},
|
|
1869
|
+
}, nt = () => `
|
|
1870
1870
|
<svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${p.HIDDEN}="true">
|
|
1871
1871
|
<circle cx="11" cy="11" r="7" />
|
|
1872
1872
|
<line x1="21" y1="21" x2="16.65" y2="16.65" />
|
|
1873
|
-
</svg>`,
|
|
1873
|
+
</svg>`, ot = (l) => {
|
|
1874
1874
|
const t = `iti-${l}-clear-mask`;
|
|
1875
1875
|
return `
|
|
1876
1876
|
<svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" ${p.HIDDEN}="true" focusable="false">
|
|
@@ -1880,7 +1880,7 @@ const S = {
|
|
|
1880
1880
|
</mask>
|
|
1881
1881
|
<circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${t})" />
|
|
1882
1882
|
</svg>`;
|
|
1883
|
-
},
|
|
1883
|
+
}, $ = () => `
|
|
1884
1884
|
<svg width="256" height="256" viewBox="0 0 512 512" class="iti__globe-svg">
|
|
1885
1885
|
<path d="M508 213a240 240 0 0 0-449-87l-2 5-2 5c-8 14-13 30-17 46a65 65 0 0 1 56 4c16-10 35-19 56-27l9-3c-6 23-10 48-10 74h-16l4 6c3 4 5 8 6 13h6c0 22 3 44 8 65l2 10-25-10-4 5 12 18 9 3 6 2 8 3 9 26 1 2 16-7h1l-5-13-1-2c24 6 49 9 75 10v26l11 10 7 7v-30l1-13c22 0 44-3 65-8l10-2-21 48-1 1a317 317 0 0 1-14 23l-21 5h-2c6 16 7 33 1 50a240 240 0 0 0 211-265m-401-56-11 6c19-44 54-79 98-98-11 20-21 44-29 69-21 6-40 15-58 23m154 182v4c-29-1-57-6-81-13-7-25-12-52-13-81h94zm0-109h-94c1-29 6-56 13-81 24-7 52-12 81-13zm0-112c-22 1-44 4-65 8l-10 2 12-30 9-17 1-2a332 332 0 0 1 13-23c13-4 26-6 40-7zm187 69 6 4c4 12 6 25 6 38v1h-68c-1-26-4-51-10-74l48 20 1 1 14 8zm-14-44 10 20c-20-11-43-21-68-29-8-25-18-49-29-69 37 16 67 44 87 78M279 49h1c13 1 27 3 39 7l14 23 1 2a343 343 0 0 1 12 26l2 5 6 16c-23-6-48-9-74-10h-1zm0 87h1c29 1 56 6 81 13 7 24 12 51 12 80v1h-94zm2 207h-2v-94h95c-1 29-6 56-13 81-24 7-51 12-80 13m86 60-20 10c11-20 21-43 29-68 25-8 48-18 68-29-16 37-43 67-77 87m87-115-7 5-16 9-2 1a337 337 0 0 1-47 21c6-24 9-49 10-75h68c0 13-2 27-6 39"/>
|
|
1886
1886
|
<path d="m261 428-2-2-22-21a40 40 0 0 0-32-11h-1a37 37 0 0 0-18 8l-1 1-4 2-2 2-5 4c-9-3-36-31-47-44s-32-45-34-55l3-2a151 151 0 0 0 11-9v-1a39 39 0 0 0 5-48l-3-3-11-19-3-4-5-7h-1l-3-3-4-3-5-2a35 35 0 0 0-16-3h-5c-4 1-14 5-24 11l-4 2-4 3-4 2c-9 8-17 17-18 27a380 380 0 0 0 212 259h3c12 0 25-10 36-21l10-12 6-11a39 39 0 0 0-8-40"/>
|
|
@@ -1997,7 +1997,7 @@ class lt {
|
|
|
1997
1997
|
[p.HIDDEN]: "true"
|
|
1998
1998
|
},
|
|
1999
1999
|
e
|
|
2000
|
-
), this.searchIcon.innerHTML =
|
|
2000
|
+
), this.searchIcon.innerHTML = nt(), this.searchInput = C(
|
|
2001
2001
|
"input",
|
|
2002
2002
|
{
|
|
2003
2003
|
id: `iti-${this.id}__search-input`,
|
|
@@ -2023,7 +2023,7 @@ class lt {
|
|
|
2023
2023
|
tabindex: "-1"
|
|
2024
2024
|
},
|
|
2025
2025
|
e
|
|
2026
|
-
), this.searchClearButton.innerHTML =
|
|
2026
|
+
), this.searchClearButton.innerHTML = ot(this.id), this.searchResultsA11yText = C(
|
|
2027
2027
|
"span",
|
|
2028
2028
|
{ class: "iti__a11y-text" },
|
|
2029
2029
|
this.dropdownContent
|
|
@@ -2190,11 +2190,17 @@ const rt = (l) => {
|
|
|
2190
2190
|
}
|
|
2191
2191
|
return A;
|
|
2192
2192
|
}, at = (l, t) => {
|
|
2193
|
-
const { countryNameLocale: e, i18n: s } = t
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2193
|
+
const { countryNameLocale: e, i18n: s } = t;
|
|
2194
|
+
let i;
|
|
2195
|
+
try {
|
|
2196
|
+
typeof Intl < "u" && typeof Intl.DisplayNames == "function" ? i = new Intl.DisplayNames(e, {
|
|
2197
|
+
type: "region"
|
|
2198
|
+
}) : i = null;
|
|
2199
|
+
} catch (o) {
|
|
2200
|
+
console.error(o), i = null;
|
|
2201
|
+
}
|
|
2202
|
+
for (const o of l)
|
|
2203
|
+
o.name = s[o.iso2] || (i == null ? void 0 : i.of(o.iso2.toUpperCase())) || "";
|
|
2198
2204
|
}, ut = (l) => {
|
|
2199
2205
|
const t = /* @__PURE__ */ new Set();
|
|
2200
2206
|
let e = 0;
|
|
@@ -2237,8 +2243,8 @@ const rt = (l) => {
|
|
|
2237
2243
|
});
|
|
2238
2244
|
}, ct = (l) => {
|
|
2239
2245
|
for (const t of l)
|
|
2240
|
-
t.normalisedName =
|
|
2241
|
-
},
|
|
2246
|
+
t.normalisedName = z(t.name), t.initials = t.normalisedName.split(/[^a-z]/).map((e) => e[0]).join(""), t.dialCodePlus = `+${t.dialCode}`;
|
|
2247
|
+
}, G = (l, t, e, s) => {
|
|
2242
2248
|
let i = l;
|
|
2243
2249
|
if (e && t) {
|
|
2244
2250
|
const o = `+${s.dialCode}`, n = i[o.length] === " " || i[o.length] === "-" ? o.length + 1 : o.length;
|
|
@@ -2277,9 +2283,9 @@ const rt = (l) => {
|
|
|
2277
2283
|
"887",
|
|
2278
2284
|
"888",
|
|
2279
2285
|
"889"
|
|
2280
|
-
],
|
|
2286
|
+
], j = (l) => {
|
|
2281
2287
|
const t = P(l);
|
|
2282
|
-
if (t.startsWith(
|
|
2288
|
+
if (t.startsWith(K.NANP) && t.length >= 4) {
|
|
2283
2289
|
const e = t.substring(1, 4);
|
|
2284
2290
|
return Ct.includes(e);
|
|
2285
2291
|
}
|
|
@@ -2289,7 +2295,7 @@ let mt = 0;
|
|
|
2289
2295
|
const ft = new Set(A.map((l) => l.iso2)), k = (l) => ft.has(l);
|
|
2290
2296
|
class W {
|
|
2291
2297
|
constructor(t, e = {}) {
|
|
2292
|
-
this.id = mt++, this.options = { ...
|
|
2298
|
+
this.id = mt++, this.options = { ...Y, ...e }, et(this.options), this.ui = new lt(t, this.options, this.id), this.isAndroid = W._getIsAndroid(), this.promise = this._createInitPromises(), this.countries = rt(this.options);
|
|
2293
2299
|
const { dialCodes: s, dialCodeMaxLen: i, dialCodeToIso2Map: o } = ut(
|
|
2294
2300
|
this.countries
|
|
2295
2301
|
);
|
|
@@ -2346,12 +2352,12 @@ class W {
|
|
|
2346
2352
|
//* 1. Extracting a dial code from the given number
|
|
2347
2353
|
//* 2. Using explicit initialCountry
|
|
2348
2354
|
_setInitialState(t = !1) {
|
|
2349
|
-
const e = this.ui.telInput.getAttribute("value"), s = this._normaliseNumerals(e), i = this._getTelInputValue(), n = s && s.startsWith("+") && (!i || !i.startsWith("+")) ? s : i, r = this._getDialCode(n), a =
|
|
2355
|
+
const e = this.ui.telInput.getAttribute("value"), s = this._normaliseNumerals(e), i = this._getTelInputValue(), n = s && s.startsWith("+") && (!i || !i.startsWith("+")) ? s : i, r = this._getDialCode(n), a = j(n), { initialCountry: d, geoIpLookup: c } = this.options, m = d === x.AUTO && c;
|
|
2350
2356
|
if (r && !a)
|
|
2351
2357
|
this._updateCountryFromNumber(n);
|
|
2352
2358
|
else if (!m || t) {
|
|
2353
2359
|
const g = d ? d.toLowerCase() : "";
|
|
2354
|
-
k(g) ? this._setCountry(g) : r && a ? this._setCountry(
|
|
2360
|
+
k(g) ? this._setCountry(g) : r && a ? this._setCountry(Z.ISO2) : this._setCountry("");
|
|
2355
2361
|
}
|
|
2356
2362
|
n && this._updateValFromNumber(n);
|
|
2357
2363
|
}
|
|
@@ -2483,7 +2489,7 @@ class W {
|
|
|
2483
2489
|
this._setTelInputValue(w), this.ui.telInput.setSelectionRange(b, b);
|
|
2484
2490
|
}
|
|
2485
2491
|
if (s && d.startsWith("+") && this.selectedCountryData.dialCode) {
|
|
2486
|
-
const _ =
|
|
2492
|
+
const _ = G(d, !0, s, this.selectedCountryData);
|
|
2487
2493
|
this._setTelInputValue(_);
|
|
2488
2494
|
}
|
|
2489
2495
|
};
|
|
@@ -2508,8 +2514,8 @@ class W {
|
|
|
2508
2514
|
const r = this._getTelInputValue(), d = !r.startsWith("+") && this.ui.telInput.selectionStart === 0 && n.key === "+", c = this._normaliseNumerals(n.key), m = /^[0-9]$/.test(c), g = e ? m : d || m, E = this.ui.telInput, _ = E.selectionStart, N = E.selectionEnd, I = r.slice(0, _), D = r.slice(N), f = I + n.key + D, w = this._getFullNumber(f), b = u.utils.getCoreNumber(
|
|
2509
2515
|
w,
|
|
2510
2516
|
this.selectedCountryData.iso2
|
|
2511
|
-
), O = this.maxCoreNumberLength && b.length > this.maxCoreNumberLength,
|
|
2512
|
-
(!g || O && !
|
|
2517
|
+
), O = this.maxCoreNumberLength && b.length > this.maxCoreNumberLength, q = this._getNewCountryFromNumber(w) !== null;
|
|
2518
|
+
(!g || O && !q && !d) && n.preventDefault();
|
|
2513
2519
|
}
|
|
2514
2520
|
}
|
|
2515
2521
|
};
|
|
@@ -2648,7 +2654,7 @@ class W {
|
|
|
2648
2654
|
y.ESC
|
|
2649
2655
|
].includes(o.key) && (o.preventDefault(), o.stopPropagation(), o.key === y.ARROW_UP || o.key === y.ARROW_DOWN ? this._handleUpDownKey(o.key) : o.key === y.ENTER ? this._handleEnterKey() : o.key === y.ESC && (this._closeDropdown(), this.ui.selectedCountry.focus())), !this.options.countrySearch && L.HIDDEN_SEARCH_CHAR.test(o.key) && (o.stopPropagation(), s && clearTimeout(s), e += o.key.toLowerCase(), this._searchForCountry(e), s = setTimeout(() => {
|
|
2650
2656
|
e = "";
|
|
2651
|
-
},
|
|
2657
|
+
}, Q.HIDDEN_SEARCH_RESET_MS));
|
|
2652
2658
|
};
|
|
2653
2659
|
document.addEventListener("keydown", i, { signal: t });
|
|
2654
2660
|
}
|
|
@@ -2676,7 +2682,7 @@ class W {
|
|
|
2676
2682
|
}
|
|
2677
2683
|
//* Hidden search (countrySearch disabled): Find the first list item whose name starts with the query string.
|
|
2678
2684
|
_searchForCountry(t) {
|
|
2679
|
-
const e =
|
|
2685
|
+
const e = it(this.countries, t);
|
|
2680
2686
|
if (e) {
|
|
2681
2687
|
const s = e.nodeById[this.id];
|
|
2682
2688
|
this.ui.highlightListItem(s, !1), this.ui.scrollTo(s);
|
|
@@ -2685,7 +2691,7 @@ class W {
|
|
|
2685
2691
|
//* Country search: Filter the countries according to the search query.
|
|
2686
2692
|
_filterCountriesByQuery(t) {
|
|
2687
2693
|
let e;
|
|
2688
|
-
t === "" ? e = this.countries : e =
|
|
2694
|
+
t === "" ? e = this.countries : e = st(this.countries, t), this.ui.filterCountries(e);
|
|
2689
2695
|
}
|
|
2690
2696
|
//* Highlight the next/prev item in the list (and ensure it is visible).
|
|
2691
2697
|
_handleUpDownKey(t) {
|
|
@@ -2740,7 +2746,7 @@ class W {
|
|
|
2740
2746
|
return d[0] === i ? null : d[0];
|
|
2741
2747
|
if (!i && this.defaultCountry && d.includes(this.defaultCountry))
|
|
2742
2748
|
return this.defaultCountry;
|
|
2743
|
-
if (o ===
|
|
2749
|
+
if (o === K.NANP && j(r))
|
|
2744
2750
|
return null;
|
|
2745
2751
|
const { areaCodes: m, priority: g } = this.selectedCountryData;
|
|
2746
2752
|
if (m) {
|
|
@@ -2770,9 +2776,9 @@ class W {
|
|
|
2770
2776
|
let a, d, c;
|
|
2771
2777
|
if (t) {
|
|
2772
2778
|
const { name: m, dialCode: g } = this.selectedCountryData;
|
|
2773
|
-
d = m, a = i.selectedCountryAriaLabel.replace("${countryName}", m).replace("${dialCode}", `+${g}`), c = "";
|
|
2779
|
+
d = m, a = i.selectedCountryAriaLabel.replace("${countryName}", m).replace("${dialCode}", `+${g}`), c = s ? "" : $();
|
|
2774
2780
|
} else
|
|
2775
|
-
d = i.noCountrySelected, a = i.noCountrySelected, c =
|
|
2781
|
+
d = i.noCountrySelected, a = i.noCountrySelected, c = $();
|
|
2776
2782
|
this.ui.selectedCountryInner.className = r, this.ui.selectedCountry.setAttribute("title", d), this.ui.selectedCountry.setAttribute(p.LABEL, a), this.ui.selectedCountryInner.innerHTML = c;
|
|
2777
2783
|
}
|
|
2778
2784
|
if (e) {
|
|
@@ -2878,7 +2884,7 @@ class W {
|
|
|
2878
2884
|
}
|
|
2879
2885
|
//* Remove the dial code if separateDialCode is enabled also cap the length if the input has a maxlength attribute
|
|
2880
2886
|
_beforeSetNumber(t) {
|
|
2881
|
-
const e = !!this._getDialCode(t), s =
|
|
2887
|
+
const e = !!this._getDialCode(t), s = G(
|
|
2882
2888
|
t,
|
|
2883
2889
|
e,
|
|
2884
2890
|
this.options.separateDialCode,
|
|
@@ -3058,7 +3064,7 @@ const yt = (l) => {
|
|
|
3058
3064
|
return u.instances[e.id] = e, l.iti = e, e;
|
|
3059
3065
|
},
|
|
3060
3066
|
{
|
|
3061
|
-
defaults:
|
|
3067
|
+
defaults: Y,
|
|
3062
3068
|
//* Using a static var like this allows us to mock it in the tests.
|
|
3063
3069
|
documentReady: () => document.readyState === "complete",
|
|
3064
3070
|
//* Get the country data object.
|
|
@@ -3073,7 +3079,7 @@ const yt = (l) => {
|
|
|
3073
3079
|
attachUtils: yt,
|
|
3074
3080
|
startedLoadingUtilsScript: !1,
|
|
3075
3081
|
startedLoadingAutoCountry: !1,
|
|
3076
|
-
version: "26.0.
|
|
3082
|
+
version: "26.0.3"
|
|
3077
3083
|
}
|
|
3078
3084
|
);
|
|
3079
3085
|
export {
|
package/build/img/globe.png
DELETED
|
Binary file
|
package/build/img/globe.webp
DELETED
|
Binary file
|
package/build/img/globe@2x.png
DELETED
|
Binary file
|
package/build/img/globe@2x.webp
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|