intl-tel-input 27.0.2 → 27.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/angular/dist/IntlTelInput.js +4 -4
- package/angular/dist/IntlTelInputWithUtils.js +4 -4
- package/dist/js/data.js +1 -1
- package/dist/js/data.min.js +1 -1
- package/dist/js/intlTelInput.js +5 -5
- package/dist/js/intlTelInput.min.js +3 -3
- package/dist/js/intlTelInput.mjs +4 -4
- package/dist/js/intlTelInputWithUtils.js +5 -5
- package/dist/js/intlTelInputWithUtils.min.js +2 -2
- package/dist/js/intlTelInputWithUtils.mjs +4 -4
- package/package.json +1 -1
- package/react/dist/IntlTelInput.js +4 -4
- package/react/dist/IntlTelInputWithUtils.js +4 -4
- package/vue/dist/{IntlTelInput-D7BKnLyx.js → IntlTelInput-DksRM5_Z.js} +38 -38
- package/vue/dist/IntlTelInput.js +1 -1
- package/vue/dist/IntlTelInputWithUtils.js +1 -1
|
@@ -2371,7 +2371,6 @@ var UI = class _UI {
|
|
|
2371
2371
|
const wrapper = this.#createWrapperAndInsert();
|
|
2372
2372
|
this.#maybeBuildCountryContainer(wrapper);
|
|
2373
2373
|
wrapper.appendChild(this.telInput);
|
|
2374
|
-
this.#maybeEnsureDropdownWidthSet();
|
|
2375
2374
|
this.#maybeUpdateInputPaddingAndReveal();
|
|
2376
2375
|
this.#maybeBuildHiddenInputs(wrapper);
|
|
2377
2376
|
}
|
|
@@ -2453,7 +2452,7 @@ var UI = class _UI {
|
|
|
2453
2452
|
this.#buildDropdownContent();
|
|
2454
2453
|
}
|
|
2455
2454
|
}
|
|
2456
|
-
|
|
2455
|
+
maybeEnsureDropdownWidthSet() {
|
|
2457
2456
|
const { fixDropdownWidth, allowDropdown } = this.#options;
|
|
2458
2457
|
if (!allowDropdown || !fixDropdownWidth || this.#dropdownContent.style.width) {
|
|
2459
2458
|
return;
|
|
@@ -2861,7 +2860,7 @@ var UI = class _UI {
|
|
|
2861
2860
|
// UI: Open the dropdown (DOM only).
|
|
2862
2861
|
openDropdown() {
|
|
2863
2862
|
const { countrySearch, dropdownAlwaysOpen, dropdownContainer } = this.#options;
|
|
2864
|
-
this
|
|
2863
|
+
this.maybeEnsureDropdownWidthSet();
|
|
2865
2864
|
if (dropdownContainer) {
|
|
2866
2865
|
this.#handleDropdownContainer();
|
|
2867
2866
|
} else {
|
|
@@ -3336,6 +3335,7 @@ var Iti = class _Iti {
|
|
|
3336
3335
|
this.#processCountryData();
|
|
3337
3336
|
this.#ui.generateMarkup(this.#countries);
|
|
3338
3337
|
this.#setInitialState();
|
|
3338
|
+
this.#ui.maybeEnsureDropdownWidthSet();
|
|
3339
3339
|
this.#initListeners();
|
|
3340
3340
|
this.#initRequests();
|
|
3341
3341
|
if (this.#options.dropdownAlwaysOpen) {
|
|
@@ -4502,7 +4502,7 @@ var intlTelInput = Object.assign(
|
|
|
4502
4502
|
attachUtils,
|
|
4503
4503
|
startedLoadingUtilsScript: false,
|
|
4504
4504
|
startedLoadingAutoCountry: false,
|
|
4505
|
-
version: "27.0.
|
|
4505
|
+
version: "27.0.4"
|
|
4506
4506
|
}
|
|
4507
4507
|
);
|
|
4508
4508
|
var intl_tel_input_default = intlTelInput;
|
package/package.json
CHANGED
|
@@ -2353,7 +2353,6 @@ var UI = class _UI {
|
|
|
2353
2353
|
const wrapper = this.#createWrapperAndInsert();
|
|
2354
2354
|
this.#maybeBuildCountryContainer(wrapper);
|
|
2355
2355
|
wrapper.appendChild(this.telInput);
|
|
2356
|
-
this.#maybeEnsureDropdownWidthSet();
|
|
2357
2356
|
this.#maybeUpdateInputPaddingAndReveal();
|
|
2358
2357
|
this.#maybeBuildHiddenInputs(wrapper);
|
|
2359
2358
|
}
|
|
@@ -2435,7 +2434,7 @@ var UI = class _UI {
|
|
|
2435
2434
|
this.#buildDropdownContent();
|
|
2436
2435
|
}
|
|
2437
2436
|
}
|
|
2438
|
-
|
|
2437
|
+
maybeEnsureDropdownWidthSet() {
|
|
2439
2438
|
const { fixDropdownWidth, allowDropdown } = this.#options;
|
|
2440
2439
|
if (!allowDropdown || !fixDropdownWidth || this.#dropdownContent.style.width) {
|
|
2441
2440
|
return;
|
|
@@ -2843,7 +2842,7 @@ var UI = class _UI {
|
|
|
2843
2842
|
// UI: Open the dropdown (DOM only).
|
|
2844
2843
|
openDropdown() {
|
|
2845
2844
|
const { countrySearch, dropdownAlwaysOpen, dropdownContainer } = this.#options;
|
|
2846
|
-
this
|
|
2845
|
+
this.maybeEnsureDropdownWidthSet();
|
|
2847
2846
|
if (dropdownContainer) {
|
|
2848
2847
|
this.#handleDropdownContainer();
|
|
2849
2848
|
} else {
|
|
@@ -3304,6 +3303,7 @@ var Iti = class _Iti {
|
|
|
3304
3303
|
this.#processCountryData();
|
|
3305
3304
|
this.#ui.generateMarkup(this.#countries);
|
|
3306
3305
|
this.#setInitialState();
|
|
3306
|
+
this.#ui.maybeEnsureDropdownWidthSet();
|
|
3307
3307
|
this.#initListeners();
|
|
3308
3308
|
this.#initRequests();
|
|
3309
3309
|
if (this.#options.dropdownAlwaysOpen) {
|
|
@@ -4470,7 +4470,7 @@ var intlTelInput = Object.assign(
|
|
|
4470
4470
|
attachUtils,
|
|
4471
4471
|
startedLoadingUtilsScript: false,
|
|
4472
4472
|
startedLoadingAutoCountry: false,
|
|
4473
|
-
version: "27.0.
|
|
4473
|
+
version: "27.0.4"
|
|
4474
4474
|
}
|
|
4475
4475
|
);
|
|
4476
4476
|
var intl_tel_input_default = intlTelInput;
|
|
@@ -2353,7 +2353,6 @@ var UI = class _UI {
|
|
|
2353
2353
|
const wrapper = this.#createWrapperAndInsert();
|
|
2354
2354
|
this.#maybeBuildCountryContainer(wrapper);
|
|
2355
2355
|
wrapper.appendChild(this.telInput);
|
|
2356
|
-
this.#maybeEnsureDropdownWidthSet();
|
|
2357
2356
|
this.#maybeUpdateInputPaddingAndReveal();
|
|
2358
2357
|
this.#maybeBuildHiddenInputs(wrapper);
|
|
2359
2358
|
}
|
|
@@ -2435,7 +2434,7 @@ var UI = class _UI {
|
|
|
2435
2434
|
this.#buildDropdownContent();
|
|
2436
2435
|
}
|
|
2437
2436
|
}
|
|
2438
|
-
|
|
2437
|
+
maybeEnsureDropdownWidthSet() {
|
|
2439
2438
|
const { fixDropdownWidth, allowDropdown } = this.#options;
|
|
2440
2439
|
if (!allowDropdown || !fixDropdownWidth || this.#dropdownContent.style.width) {
|
|
2441
2440
|
return;
|
|
@@ -2843,7 +2842,7 @@ var UI = class _UI {
|
|
|
2843
2842
|
// UI: Open the dropdown (DOM only).
|
|
2844
2843
|
openDropdown() {
|
|
2845
2844
|
const { countrySearch, dropdownAlwaysOpen, dropdownContainer } = this.#options;
|
|
2846
|
-
this
|
|
2845
|
+
this.maybeEnsureDropdownWidthSet();
|
|
2847
2846
|
if (dropdownContainer) {
|
|
2848
2847
|
this.#handleDropdownContainer();
|
|
2849
2848
|
} else {
|
|
@@ -3304,6 +3303,7 @@ var Iti = class _Iti {
|
|
|
3304
3303
|
this.#processCountryData();
|
|
3305
3304
|
this.#ui.generateMarkup(this.#countries);
|
|
3306
3305
|
this.#setInitialState();
|
|
3306
|
+
this.#ui.maybeEnsureDropdownWidthSet();
|
|
3307
3307
|
this.#initListeners();
|
|
3308
3308
|
this.#initRequests();
|
|
3309
3309
|
if (this.#options.dropdownAlwaysOpen) {
|
|
@@ -4470,7 +4470,7 @@ var intlTelInput = Object.assign(
|
|
|
4470
4470
|
attachUtils,
|
|
4471
4471
|
startedLoadingUtilsScript: false,
|
|
4472
4472
|
startedLoadingAutoCountry: false,
|
|
4473
|
-
version: "27.0.
|
|
4473
|
+
version: "27.0.4"
|
|
4474
4474
|
}
|
|
4475
4475
|
);
|
|
4476
4476
|
var intl_tel_input_default = intlTelInput;
|
|
@@ -1538,7 +1538,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1538
1538
|
generateMarkup(e) {
|
|
1539
1539
|
this.#i = e, this.telInput.classList.add("iti__tel-input"), this.telInput.hasAttribute("type") || this.telInput.setAttribute("type", "tel"), this.telInput.hasAttribute("autocomplete") || this.telInput.setAttribute("autocomplete", "tel"), this.telInput.hasAttribute("inputmode") || this.telInput.setAttribute("inputmode", "tel");
|
|
1540
1540
|
let t = this.#g();
|
|
1541
|
-
this.#_(t), t.appendChild(this.telInput), this.#
|
|
1541
|
+
this.#_(t), t.appendChild(this.telInput), this.#b(), this.#x(t);
|
|
1542
1542
|
}
|
|
1543
1543
|
#g() {
|
|
1544
1544
|
let { allowDropdown: e, showFlags: t, containerClass: n, useFullscreenPopup: r } = this.#e, i = U("div", { class: H({
|
|
@@ -1565,27 +1565,27 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1565
1565
|
this.selectedCountryInner = U("div", { class: _.FLAG }, i), t && (this.#c = U("div", {
|
|
1566
1566
|
class: "iti__arrow",
|
|
1567
1567
|
[j.HIDDEN]: "true"
|
|
1568
|
-
}, i)), n && (this.#s = U("div", { class: "iti__selected-dial-code" }, this.selectedCountry)), t && this.#
|
|
1568
|
+
}, i)), n && (this.#s = U("div", { class: "iti__selected-dial-code" }, this.selectedCountry)), t && this.#v();
|
|
1569
1569
|
}
|
|
1570
|
-
|
|
1570
|
+
maybeEnsureDropdownWidthSet() {
|
|
1571
1571
|
let { fixDropdownWidth: e, allowDropdown: t } = this.#e;
|
|
1572
1572
|
if (!t || !e || this.#l.style.width) return;
|
|
1573
1573
|
let n = this.telInput.offsetWidth;
|
|
1574
1574
|
n > 0 && (this.#l.style.width = `${n}px`);
|
|
1575
1575
|
}
|
|
1576
|
-
#
|
|
1576
|
+
#v() {
|
|
1577
1577
|
let { fixDropdownWidth: e, useFullscreenPopup: t, countrySearch: n, i18n: r, dropdownContainer: i, containerClass: a } = this.#e, o = e ? "" : "iti--flexible-dropdown-width";
|
|
1578
1578
|
this.#l = U("div", {
|
|
1579
1579
|
id: `iti-${this.#t}__dropdown-content`,
|
|
1580
1580
|
class: `iti__dropdown-content ${_.HIDE} ${o}`,
|
|
1581
1581
|
role: "dialog",
|
|
1582
1582
|
[j.MODAL]: "true"
|
|
1583
|
-
}), this.#n && this.#l.setAttribute("dir", "rtl"), n && this.#
|
|
1583
|
+
}), this.#n && this.#l.setAttribute("dir", "rtl"), n && this.#y(), this.countryList = U("ul", {
|
|
1584
1584
|
class: "iti__country-list",
|
|
1585
1585
|
id: `iti-${this.#t}__country-listbox`,
|
|
1586
1586
|
role: "listbox",
|
|
1587
1587
|
[j.LABEL]: r.countryListAriaLabel
|
|
1588
|
-
}, this.#l), this.#
|
|
1588
|
+
}, this.#l), this.#S(), n && this.#D(), t || (this.#o = this.#E(), n && (this.#l.style.height = `${this.#o}px`)), i ? (this.#p = U("div", { class: H({
|
|
1589
1589
|
iti: !0,
|
|
1590
1590
|
"iti--container": !0,
|
|
1591
1591
|
"iti--fullscreen-popup": t,
|
|
@@ -1593,7 +1593,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1593
1593
|
[a]: !!a
|
|
1594
1594
|
}) }), this.#p.appendChild(this.#l)) : this.countryContainer.appendChild(this.#l);
|
|
1595
1595
|
}
|
|
1596
|
-
#
|
|
1596
|
+
#y() {
|
|
1597
1597
|
let { i18n: e, searchInputClass: t } = this.#e, n = U("div", { class: "iti__search-input-wrapper" }, this.#l);
|
|
1598
1598
|
this.#u = U("span", {
|
|
1599
1599
|
class: "iti__search-icon",
|
|
@@ -1619,10 +1619,10 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1619
1619
|
[j.HIDDEN]: "true"
|
|
1620
1620
|
}, this.#l), this.#d.textContent = e.searchEmptyState ?? null;
|
|
1621
1621
|
}
|
|
1622
|
-
#
|
|
1623
|
-
this.countryContainer && (this.#
|
|
1622
|
+
#b() {
|
|
1623
|
+
this.countryContainer && (this.#C(), this.countryContainer.classList.remove(_.V_HIDE));
|
|
1624
1624
|
}
|
|
1625
|
-
#
|
|
1625
|
+
#x(e) {
|
|
1626
1626
|
let { hiddenInput: t } = this.#e;
|
|
1627
1627
|
if (!t) return;
|
|
1628
1628
|
let n = t(this.telInput.getAttribute("name") || "");
|
|
@@ -1641,7 +1641,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1641
1641
|
}), e.appendChild(this.hiddenInputCountry));
|
|
1642
1642
|
}
|
|
1643
1643
|
}
|
|
1644
|
-
#
|
|
1644
|
+
#S() {
|
|
1645
1645
|
let e = document.createDocumentFragment();
|
|
1646
1646
|
for (let t = 0; t < this.#i.length; t++) {
|
|
1647
1647
|
let n = this.#i[t], r = H({ [_.COUNTRY_ITEM]: !0 }), i = U("li", {
|
|
@@ -1659,13 +1659,13 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1659
1659
|
}
|
|
1660
1660
|
this.countryList.appendChild(e);
|
|
1661
1661
|
}
|
|
1662
|
-
#
|
|
1662
|
+
#C() {
|
|
1663
1663
|
if (this.selectedCountry) {
|
|
1664
|
-
let e = this.#e.separateDialCode ? C.SANE_SELECTED_WITH_DIAL_WIDTH : C.SANE_SELECTED_NO_DIAL_WIDTH, t = (this.selectedCountry.offsetWidth || this.#
|
|
1664
|
+
let e = this.#e.separateDialCode ? C.SANE_SELECTED_WITH_DIAL_WIDTH : C.SANE_SELECTED_NO_DIAL_WIDTH, t = (this.selectedCountry.offsetWidth || this.#T() || e) + C.INPUT_PADDING_EXTRA_LEFT;
|
|
1665
1665
|
this.telInput.style.paddingLeft = `${t}px`;
|
|
1666
1666
|
}
|
|
1667
1667
|
}
|
|
1668
|
-
static #
|
|
1668
|
+
static #w() {
|
|
1669
1669
|
let e;
|
|
1670
1670
|
try {
|
|
1671
1671
|
e = window.top.document.body;
|
|
@@ -1674,9 +1674,9 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1674
1674
|
}
|
|
1675
1675
|
return e;
|
|
1676
1676
|
}
|
|
1677
|
-
#
|
|
1677
|
+
#T() {
|
|
1678
1678
|
if (!this.telInput.parentNode) return 0;
|
|
1679
|
-
let t = e.#
|
|
1679
|
+
let t = e.#w(), n = this.telInput.parentNode.cloneNode(!1);
|
|
1680
1680
|
n.style.visibility = "hidden", t.appendChild(n);
|
|
1681
1681
|
let r = this.countryContainer.cloneNode();
|
|
1682
1682
|
n.appendChild(r);
|
|
@@ -1685,33 +1685,33 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1685
1685
|
let a = i.offsetWidth;
|
|
1686
1686
|
return t.removeChild(n), a;
|
|
1687
1687
|
}
|
|
1688
|
-
#
|
|
1689
|
-
let t = e.#
|
|
1688
|
+
#E() {
|
|
1689
|
+
let t = e.#w();
|
|
1690
1690
|
this.#l.classList.remove(_.HIDE);
|
|
1691
1691
|
let n = U("div", { class: "iti iti--inline-dropdown" });
|
|
1692
1692
|
n.appendChild(this.#l), n.style.visibility = "hidden", t.appendChild(n);
|
|
1693
1693
|
let r = this.#l.offsetHeight;
|
|
1694
1694
|
return t.removeChild(n), n.style.visibility = "", this.#l.classList.add(_.HIDE), r > 0 ? r : C.SANE_DROPDOWN_HEIGHT;
|
|
1695
1695
|
}
|
|
1696
|
-
#
|
|
1696
|
+
#D() {
|
|
1697
1697
|
let { i18n: e } = this.#e, t = this.countryList.childElementCount;
|
|
1698
1698
|
this.#f.textContent = e.searchSummaryAria(t);
|
|
1699
1699
|
}
|
|
1700
1700
|
filterCountriesByQuery(e) {
|
|
1701
1701
|
let t;
|
|
1702
|
-
t = e === "" ? this.#i : ce(this.#i, e), this.#
|
|
1702
|
+
t = e === "" ? this.#i : ce(this.#i, e), this.#A(t);
|
|
1703
1703
|
}
|
|
1704
|
-
#
|
|
1704
|
+
#O() {
|
|
1705
1705
|
let e = this.searchInput.value.trim();
|
|
1706
1706
|
this.filterCountriesByQuery(e), this.searchInput.value ? this.searchClearButton.classList.remove(_.HIDE) : this.searchClearButton.classList.add(_.HIDE);
|
|
1707
1707
|
}
|
|
1708
1708
|
handleSearchChange() {
|
|
1709
1709
|
this.#a && clearTimeout(this.#a), this.#a = setTimeout(() => {
|
|
1710
|
-
this.#
|
|
1710
|
+
this.#O(), this.#a = null;
|
|
1711
1711
|
}, x.SEARCH_DEBOUNCE_MS);
|
|
1712
1712
|
}
|
|
1713
1713
|
handleSearchClear() {
|
|
1714
|
-
this.searchInput.value = "", this.searchInput.focus(), this.#
|
|
1714
|
+
this.searchInput.value = "", this.searchInput.focus(), this.#O();
|
|
1715
1715
|
}
|
|
1716
1716
|
scrollCountryListToItem(e) {
|
|
1717
1717
|
let t = this.countryList, n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), i = r.top - n.top + t.scrollTop;
|
|
@@ -1731,7 +1731,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1731
1731
|
let t = e === v.ARROW_UP ? this.highlightedItem?.previousElementSibling : this.highlightedItem?.nextElementSibling;
|
|
1732
1732
|
!t && this.countryList.childElementCount > 1 && (t = e === v.ARROW_UP ? this.countryList.lastElementChild : this.countryList.firstElementChild), t && (this.scrollCountryListToItem(t), this.highlightListItem(t, !1));
|
|
1733
1733
|
}
|
|
1734
|
-
#
|
|
1734
|
+
#k(e) {
|
|
1735
1735
|
if (this.#m && this.#m.dataset.countryCode !== e && (this.#m.setAttribute(j.SELECTED, "false"), this.#m.querySelector(".iti__country-check")?.remove(), this.#m = null), e && !this.#m) {
|
|
1736
1736
|
let t = this.countryList.querySelector(`[data-country-code="${e}"]`);
|
|
1737
1737
|
if (t) {
|
|
@@ -1744,14 +1744,14 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1744
1744
|
}
|
|
1745
1745
|
}
|
|
1746
1746
|
}
|
|
1747
|
-
#
|
|
1747
|
+
#A(e) {
|
|
1748
1748
|
this.countryList.replaceChildren();
|
|
1749
1749
|
let t = !0;
|
|
1750
1750
|
for (let n of e) {
|
|
1751
1751
|
let e = n.nodeById[this.#t];
|
|
1752
1752
|
e && (this.countryList.appendChild(e), t &&= (this.highlightListItem(e, !1), !1));
|
|
1753
1753
|
}
|
|
1754
|
-
t ? (this.highlightListItem(null, !1), this.#d && this.#d.classList.remove(_.HIDE)) : this.#d && this.#d.classList.add(_.HIDE), this.countryList.scrollTop = 0, this.#
|
|
1754
|
+
t ? (this.highlightListItem(null, !1), this.#d && this.#d.classList.remove(_.HIDE)) : this.#d && this.#d.classList.add(_.HIDE), this.countryList.scrollTop = 0, this.#D();
|
|
1755
1755
|
}
|
|
1756
1756
|
destroy() {
|
|
1757
1757
|
this.telInput.iti = void 0, delete this.telInput.dataset.intlTelInputId, this.#e.separateDialCode && (this.telInput.style.paddingLeft = this.#r);
|
|
@@ -1761,27 +1761,27 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1761
1761
|
}
|
|
1762
1762
|
openDropdown() {
|
|
1763
1763
|
let { countrySearch: e, dropdownAlwaysOpen: t, dropdownContainer: n } = this.#e;
|
|
1764
|
-
if (this
|
|
1764
|
+
if (this.maybeEnsureDropdownWidthSet(), n) this.#M();
|
|
1765
1765
|
else {
|
|
1766
|
-
let e = this.#
|
|
1766
|
+
let e = this.#j(), t = this.telInput.offsetHeight + C.DROPDOWN_MARGIN;
|
|
1767
1767
|
e ? this.#l.style.top = `${t}px` : this.#l.style.bottom = `${t}px`;
|
|
1768
1768
|
}
|
|
1769
1769
|
this.#l.classList.remove(_.HIDE), this.selectedCountry.setAttribute(j.EXPANDED, "true");
|
|
1770
1770
|
let r = this.#m ?? this.countryList.firstElementChild;
|
|
1771
1771
|
r && (this.highlightListItem(r, !1), this.scrollCountryListToItem(r)), e && !t && this.searchInput.focus(), this.#e.useFullscreenPopup && this.#p && window.visualViewport && (this.#h = () => {
|
|
1772
|
-
this.#
|
|
1772
|
+
this.#N(), this.highlightedItem && this.scrollCountryListToItem(this.highlightedItem);
|
|
1773
1773
|
}, window.visualViewport.addEventListener("resize", this.#h)), this.#c.classList.add(_.ARROW_UP);
|
|
1774
1774
|
}
|
|
1775
1775
|
closeDropdown() {
|
|
1776
1776
|
let { countrySearch: e, dropdownContainer: t } = this.#e;
|
|
1777
|
-
this.#l.classList.add(_.HIDE), this.selectedCountry.setAttribute(j.EXPANDED, "false"), e && (this.searchInput.removeAttribute(j.ACTIVE_DESCENDANT), this.searchInput.value = "", this.#
|
|
1777
|
+
this.#l.classList.add(_.HIDE), this.selectedCountry.setAttribute(j.EXPANDED, "false"), e && (this.searchInput.removeAttribute(j.ACTIVE_DESCENDANT), this.searchInput.value = "", this.#O(), this.highlightedItem &&= (this.highlightedItem.classList.remove(_.HIGHLIGHT), null)), this.#c.classList.remove(_.ARROW_UP), this.#h && window.visualViewport && (window.visualViewport.removeEventListener("resize", this.#h), this.#h = null), t ? (this.#p.remove(), this.#p.style.top = "", this.#p.style.bottom = "", this.#p.style.paddingLeft = "", this.#p.style.paddingRight = "") : (this.#l.style.top = "", this.#l.style.bottom = "");
|
|
1778
1778
|
}
|
|
1779
|
-
#
|
|
1779
|
+
#j() {
|
|
1780
1780
|
if (this.#e.dropdownAlwaysOpen) return !0;
|
|
1781
1781
|
let e = this.telInput.getBoundingClientRect(), t = e.top, n = window.innerHeight - e.bottom;
|
|
1782
1782
|
return n >= this.#o || n >= t;
|
|
1783
1783
|
}
|
|
1784
|
-
#
|
|
1784
|
+
#M() {
|
|
1785
1785
|
let { dropdownContainer: e, useFullscreenPopup: t } = this.#e;
|
|
1786
1786
|
if (t) {
|
|
1787
1787
|
if (window.innerWidth >= C.NARROW_VIEWPORT_WIDTH) {
|
|
@@ -1790,11 +1790,11 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1790
1790
|
}
|
|
1791
1791
|
} else {
|
|
1792
1792
|
let e = this.telInput.getBoundingClientRect();
|
|
1793
|
-
this.#p.style.left = `${e.left}px`, this.#
|
|
1793
|
+
this.#p.style.left = `${e.left}px`, this.#j() ? this.#p.style.top = `${e.bottom + C.DROPDOWN_MARGIN}px` : (this.#p.style.top = "unset", this.#p.style.bottom = `${window.innerHeight - e.top + C.DROPDOWN_MARGIN}px`);
|
|
1794
1794
|
}
|
|
1795
1795
|
e.appendChild(this.#p);
|
|
1796
1796
|
}
|
|
1797
|
-
#
|
|
1797
|
+
#N() {
|
|
1798
1798
|
let e = window.visualViewport;
|
|
1799
1799
|
if (!e || !this.#p) return;
|
|
1800
1800
|
let t = window.innerHeight - e.height;
|
|
@@ -1805,13 +1805,13 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1805
1805
|
}
|
|
1806
1806
|
setCountry(e) {
|
|
1807
1807
|
let { allowDropdown: t, showFlags: n, separateDialCode: r, i18n: i } = this.#e, a = e?.name, o = e?.dialCode, s = e?.iso2 ?? "";
|
|
1808
|
-
if (t && this.#
|
|
1808
|
+
if (t && this.#k(s), this.selectedCountry) {
|
|
1809
1809
|
let e = s && n ? `${_.FLAG} iti__${s}` : `${_.FLAG} ${_.GLOBE}`, t, r, c;
|
|
1810
1810
|
s ? (r = a, t = i.selectedCountryAriaLabel.replace("${countryName}", a).replace("${dialCode}", `+${o}`), c = n ? "" : W()) : (r = i.noCountrySelected, t = i.noCountrySelected, c = W()), this.selectedCountryInner.className = e, this.selectedCountry.setAttribute("title", r), this.selectedCountry.setAttribute(j.LABEL, t), this.selectedCountryInner.innerHTML = c;
|
|
1811
1811
|
}
|
|
1812
1812
|
if (r) {
|
|
1813
1813
|
let e = o ? `+${o}` : "";
|
|
1814
|
-
this.#s.textContent = e, this.#
|
|
1814
|
+
this.#s.textContent = e, this.#C();
|
|
1815
1815
|
}
|
|
1816
1816
|
}
|
|
1817
1817
|
}, pe = (e) => {
|
|
@@ -1992,7 +1992,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
1992
1992
|
return i && (this.#h = X()), a && (this.#g = X()), Promise.all([this.#h?.promise, this.#g?.promise]).then(() => {});
|
|
1993
1993
|
}
|
|
1994
1994
|
#b() {
|
|
1995
|
-
this.#f = new AbortController(), this.#x(), this.#e.generateMarkup(this.#r), this.#S(), this.#C(), this.#E(), this.#t.dropdownAlwaysOpen && this.#F();
|
|
1995
|
+
this.#f = new AbortController(), this.#x(), this.#e.generateMarkup(this.#r), this.#S(), this.#e.maybeEnsureDropdownWidthSet(), this.#C(), this.#E(), this.#t.dropdownAlwaysOpen && this.#F();
|
|
1996
1996
|
}
|
|
1997
1997
|
#x() {
|
|
1998
1998
|
me(this.#r, this.#t), ge(this.#r, this.#t), _e(this.#r);
|
|
@@ -2464,7 +2464,7 @@ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
|
|
|
2464
2464
|
},
|
|
2465
2465
|
startedLoadingUtilsScript: !1,
|
|
2466
2466
|
startedLoadingAutoCountry: !1,
|
|
2467
|
-
version: "27.0.
|
|
2467
|
+
version: "27.0.4"
|
|
2468
2468
|
}), $ = Q, we = /* @__PURE__ */ n({
|
|
2469
2469
|
inheritAttrs: !1,
|
|
2470
2470
|
__name: "IntlTelInput",
|
package/vue/dist/IntlTelInput.js
CHANGED