intl-tel-input 19.2.19 → 19.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/intlTelInput-jquery.js +11 -9
- package/build/js/intlTelInput-jquery.min.js +3 -3
- package/build/js/intlTelInput.js +11 -9
- package/build/js/intlTelInput.min.js +3 -3
- package/composer.json +1 -1
- package/demo.html +2 -1
- package/package.json +1 -1
- package/react/build/IntlTelInput.cjs.js +2 -2
- package/react/build/IntlTelInput.cjs.js.map +3 -3
- package/react/build/IntlTelInput.esm.js +2 -2
- package/react/build/IntlTelInput.esm.js.map +3 -3
- package/react/demo/simple-bundle.js +54 -54
- package/react/demo/validation-bundle.js +54 -54
- package/src/js/intlTelInput.js +9 -7
|
@@ -24326,10 +24326,10 @@ var R = et((at, T) => {
|
|
|
24326
24326
|
return s;
|
|
24327
24327
|
}
|
|
24328
24328
|
function N(s, n, t) {
|
|
24329
|
-
return n =
|
|
24329
|
+
return n = A(n), n in s ? Object.defineProperty(s, n, { value: t, enumerable: true, configurable: true, writable: true }) : s[n] = t, s;
|
|
24330
24330
|
}
|
|
24331
24331
|
function F(s, n) {
|
|
24332
|
-
return _(s) ||
|
|
24332
|
+
return _(s) || I(s, n) || x(s, n) || P();
|
|
24333
24333
|
}
|
|
24334
24334
|
function P() {
|
|
24335
24335
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
@@ -24338,21 +24338,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24338
24338
|
function x(s, n) {
|
|
24339
24339
|
if (s) {
|
|
24340
24340
|
if (typeof s == "string")
|
|
24341
|
-
return
|
|
24341
|
+
return D(s, n);
|
|
24342
24342
|
var t = Object.prototype.toString.call(s).slice(8, -1);
|
|
24343
24343
|
if (t === "Object" && s.constructor && (t = s.constructor.name), t === "Map" || t === "Set")
|
|
24344
24344
|
return Array.from(s);
|
|
24345
24345
|
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
|
|
24346
|
-
return
|
|
24346
|
+
return D(s, n);
|
|
24347
24347
|
}
|
|
24348
24348
|
}
|
|
24349
|
-
function
|
|
24349
|
+
function D(s, n) {
|
|
24350
24350
|
(n == null || n > s.length) && (n = s.length);
|
|
24351
24351
|
for (var t = 0, e = new Array(n); t < n; t++)
|
|
24352
24352
|
e[t] = s[t];
|
|
24353
24353
|
return e;
|
|
24354
24354
|
}
|
|
24355
|
-
function
|
|
24355
|
+
function I(s, n) {
|
|
24356
24356
|
var t = s == null ? null : typeof Symbol < "u" && s[Symbol.iterator] || s["@@iterator"];
|
|
24357
24357
|
if (t != null) {
|
|
24358
24358
|
var e, i, o, r, a = [], l = true, u = false;
|
|
@@ -24382,20 +24382,20 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24382
24382
|
if (Array.isArray(s))
|
|
24383
24383
|
return s;
|
|
24384
24384
|
}
|
|
24385
|
-
function
|
|
24385
|
+
function L(s, n) {
|
|
24386
24386
|
if (!(s instanceof n))
|
|
24387
24387
|
throw new TypeError("Cannot call a class as a function");
|
|
24388
24388
|
}
|
|
24389
24389
|
function b(s, n) {
|
|
24390
24390
|
for (var t = 0; t < n.length; t++) {
|
|
24391
24391
|
var e = n[t];
|
|
24392
|
-
e.enumerable = e.enumerable || false, e.configurable = true, "value" in e && (e.writable = true), Object.defineProperty(s,
|
|
24392
|
+
e.enumerable = e.enumerable || false, e.configurable = true, "value" in e && (e.writable = true), Object.defineProperty(s, A(e.key), e);
|
|
24393
24393
|
}
|
|
24394
24394
|
}
|
|
24395
24395
|
function O(s, n, t) {
|
|
24396
24396
|
return n && b(s.prototype, n), t && b(s, t), Object.defineProperty(s, "prototype", { writable: false }), s;
|
|
24397
24397
|
}
|
|
24398
|
-
function
|
|
24398
|
+
function A(s) {
|
|
24399
24399
|
var n = V(s, "string");
|
|
24400
24400
|
return typeof n == "symbol" ? n : String(n);
|
|
24401
24401
|
}
|
|
@@ -24411,14 +24411,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24411
24411
|
}
|
|
24412
24412
|
return (n === "string" ? String : Number)(s);
|
|
24413
24413
|
}
|
|
24414
|
-
var
|
|
24414
|
+
var S = { getInstance: function(n) {
|
|
24415
24415
|
var t = n.getAttribute("data-intl-tel-input-id");
|
|
24416
24416
|
return window.intlTelInputGlobals.instances[t];
|
|
24417
24417
|
}, instances: {}, documentReady: function() {
|
|
24418
24418
|
return document.readyState === "complete";
|
|
24419
24419
|
} };
|
|
24420
|
-
typeof window == "object" && (window.intlTelInputGlobals =
|
|
24421
|
-
var H = 0, M = { allowDropdown: true, autoInsertDialCode: false, autoPlaceholder: "polite", countrySearch: true, containerClass: "", customPlaceholder: null, dropdownContainer: null, excludeCountries: [], fixDropdownWidth: true, formatAsYouType: true, formatOnDisplay: true, geoIpLookup: null, hiddenInput: null, i18n: {}, initialCountry: "", nationalMode: true, onlyCountries: [], placeholderNumberType: "MOBILE", preferredCountries: [], showFlags: true, showSelectedDialCode: false, useFullscreenPopup: typeof navigator < "u" && typeof window < "u" ? /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 500 : false, utilsScript: "" }, W = ["800", "822", "833", "844", "855", "866", "877", "880", "881", "882", "883", "884", "885", "886", "887", "888", "889"],
|
|
24420
|
+
typeof window == "object" && (window.intlTelInputGlobals = S);
|
|
24421
|
+
var H = 0, M = { allowDropdown: true, autoInsertDialCode: false, autoPlaceholder: "polite", countrySearch: true, containerClass: "", customPlaceholder: null, defaultToFirstCountry: true, dropdownContainer: null, excludeCountries: [], fixDropdownWidth: true, formatAsYouType: true, formatOnDisplay: true, geoIpLookup: null, hiddenInput: null, i18n: {}, initialCountry: "", nationalMode: true, onlyCountries: [], placeholderNumberType: "MOBILE", preferredCountries: [], showFlags: true, showSelectedDialCode: false, useFullscreenPopup: typeof navigator < "u" && typeof window < "u" ? /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 500 : false, utilsScript: "" }, W = ["800", "822", "833", "844", "855", "866", "877", "880", "881", "882", "883", "884", "885", "886", "887", "888", "889"], k = function(n) {
|
|
24422
24422
|
var t = window.intlTelInputGlobals.instances;
|
|
24423
24423
|
Object.values(t).forEach(function(e) {
|
|
24424
24424
|
return e[n]();
|
|
@@ -24426,7 +24426,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24426
24426
|
}, q = function() {
|
|
24427
24427
|
function s(n) {
|
|
24428
24428
|
var t = arguments.length > 1 && arguments[1] !== c ? arguments[1] : {};
|
|
24429
|
-
|
|
24429
|
+
L(this, s), this.id = H++, this.telInput = n, this.activeItem = null, this.highlightedItem = null, this.options = Object.assign({}, M, t), this.hadInitialPlaceholder = !!n.getAttribute("placeholder");
|
|
24430
24430
|
}
|
|
24431
24431
|
return O(s, [{ key: "_init", value: function() {
|
|
24432
24432
|
var t = this;
|
|
@@ -24508,23 +24508,23 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24508
24508
|
}), i && i.appendChild(o), o;
|
|
24509
24509
|
} }, { key: "_generateMarkup", value: function() {
|
|
24510
24510
|
this.telInput.classList.add("iti__tel-input"), !this.telInput.hasAttribute("autocomplete") && !(this.telInput.form && this.telInput.form.hasAttribute("autocomplete")) && this.telInput.setAttribute("autocomplete", "off");
|
|
24511
|
-
var t = this.options, e = t.allowDropdown, i = t.showSelectedDialCode, o = t.showFlags, r = t.containerClass, a = t.hiddenInput, l = t.dropdownContainer, u = t.fixDropdownWidth, h = t.useFullscreenPopup,
|
|
24511
|
+
var t = this.options, e = t.allowDropdown, i = t.showSelectedDialCode, o = t.showFlags, r = t.containerClass, a = t.hiddenInput, l = t.dropdownContainer, u = t.fixDropdownWidth, h = t.useFullscreenPopup, g = t.countrySearch, f = "iti";
|
|
24512
24512
|
e && (f += " iti--allow-dropdown"), i && (f += " iti--show-selected-dial-code"), o && (f += " iti--show-flags"), r && (f += " ".concat(r)), h || (f += " iti--inline-dropdown");
|
|
24513
|
-
var
|
|
24514
|
-
this.telInput.parentNode.insertBefore(
|
|
24515
|
-
var
|
|
24516
|
-
if (
|
|
24513
|
+
var v = this._createEl("div", { class: f });
|
|
24514
|
+
this.telInput.parentNode.insertBefore(v, this.telInput);
|
|
24515
|
+
var w = e || o || i;
|
|
24516
|
+
if (w && (this.flagsContainer = this._createEl("div", { class: "iti__flag-container" }, v)), v.appendChild(this.telInput), w && (this.selectedFlag = this._createEl("div", C({ class: "iti__selected-flag" }, e && { role: "combobox", "aria-haspopup": "listbox", "aria-controls": "iti-".concat(this.id, "__country-listbox"), "aria-expanded": "false", "aria-label": this.options.i18n.selectedCountryAriaLabel || "Selected country" }), this.flagsContainer)), o && (this.selectedFlagInner = this._createEl("div", { class: "iti__flag" }, this.selectedFlag)), this.selectedFlag && this.telInput.disabled && this.selectedFlag.setAttribute("aria-disabled", "true"), i && (this.selectedDialCode = this._createEl("div", { class: "iti__selected-dial-code" }, this.selectedFlag)), e) {
|
|
24517
24517
|
this.telInput.disabled || this.selectedFlag.setAttribute("tabindex", "0"), this.dropdownArrow = this._createEl("div", { class: "iti__arrow" }, this.selectedFlag);
|
|
24518
24518
|
var Y = u ? "" : "iti--flexible-dropdown-width";
|
|
24519
|
-
if (this.dropdownContent = this._createEl("div", { class: "iti__dropdown-content iti__hide ".concat(Y) }),
|
|
24519
|
+
if (this.dropdownContent = this._createEl("div", { class: "iti__dropdown-content iti__hide ".concat(Y) }), g && (this.searchInput = this._createEl("input", { type: "text", class: "iti__search-input", placeholder: this.options.i18n.searchPlaceholder || "Search" }, this.dropdownContent)), this.countryList = this._createEl("ul", { class: "iti__country-list", id: "iti-".concat(this.id, "__country-listbox"), role: "listbox", "aria-label": this.options.i18n.countryListAriaLabel || "List of countries" }, this.dropdownContent), this.preferredCountries.length && !g && (this._appendListItems(this.preferredCountries, "iti__preferred", true), this._createEl("li", { class: "iti__divider", "aria-hidden": "true" }, this.countryList)), this._appendListItems(this.countries, "iti__standard"), l) {
|
|
24520
24520
|
var E = "iti iti--container";
|
|
24521
|
-
h ? E += " iti--fullscreen-popup" : E += " iti--inline-dropdown",
|
|
24521
|
+
h ? E += " iti--fullscreen-popup" : E += " iti--inline-dropdown", g && (E += " iti--country-search"), this.dropdown = this._createEl("div", { class: E }), this.dropdown.appendChild(this.dropdownContent);
|
|
24522
24522
|
} else
|
|
24523
24523
|
this.flagsContainer.appendChild(this.dropdownContent);
|
|
24524
24524
|
}
|
|
24525
24525
|
if (a) {
|
|
24526
24526
|
var J = this.telInput.getAttribute("name"), j = a(J);
|
|
24527
|
-
this.hiddenInput = this._createEl("input", { type: "hidden", name: j }),
|
|
24527
|
+
this.hiddenInput = this._createEl("input", { type: "hidden", name: j }), v.appendChild(this.hiddenInput), this.hiddenInputCountry = this._createEl("input", { type: "hidden", name: "".concat(j, "_country") }), v.appendChild(this.hiddenInputCountry);
|
|
24528
24528
|
}
|
|
24529
24529
|
} }, { key: "_appendListItems", value: function(t, e, i) {
|
|
24530
24530
|
for (var o = 0; o < t.length; o++) {
|
|
@@ -24534,12 +24534,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24534
24534
|
this.options.showFlags && (u += "<div class='iti__flag-box'><div class='iti__flag iti__".concat(r.iso2, "'></div></div>")), u += "<span class='iti__country-name'>".concat(r.name, "</span>"), u += "<span class='iti__dial-code'>+".concat(r.dialCode, "</span>"), l.insertAdjacentHTML("beforeend", u);
|
|
24535
24535
|
}
|
|
24536
24536
|
} }, { key: "_setInitialState", value: function() {
|
|
24537
|
-
var t = arguments.length > 0 && arguments[0] !== c ? arguments[0] : false, e = this.telInput.getAttribute("value"), i = this.telInput.value, o = e && e.charAt(0) === "+" && (!i || i.charAt(0) !== "+"), r = o ? e : i, a = this._getDialCode(r), l = this._isRegionlessNanp(r), u = this.options, h = u.initialCountry,
|
|
24537
|
+
var t = arguments.length > 0 && arguments[0] !== c ? arguments[0] : false, e = this.telInput.getAttribute("value"), i = this.telInput.value, o = e && e.charAt(0) === "+" && (!i || i.charAt(0) !== "+"), r = o ? e : i, a = this._getDialCode(r), l = this._isRegionlessNanp(r), u = this.options, h = u.initialCountry, g = u.autoInsertDialCode, f = u.defaultToFirstCountry;
|
|
24538
24538
|
if (a && !l)
|
|
24539
24539
|
this._updateFlagFromNumber(r);
|
|
24540
24540
|
else if (h !== "auto" || t) {
|
|
24541
|
-
var
|
|
24542
|
-
|
|
24541
|
+
var v = h ? h.toLowerCase() : "", w = v && this._getCountryData(v, true);
|
|
24542
|
+
w ? this._setFlag(v) : a && l ? this._setFlag("us") : f && (this.defaultCountry = this.preferredCountries.length ? this.preferredCountries[0].iso2 : this.countries[0].iso2, r || this._setFlag(this.defaultCountry)), !r && g && (this.telInput.value = "+".concat(this.selectedCountryData.dialCode));
|
|
24543
24543
|
}
|
|
24544
24544
|
r && this._updateValFromNumber(r);
|
|
24545
24545
|
} }, { key: "_initListeners", value: function() {
|
|
@@ -24569,12 +24569,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24569
24569
|
} }, { key: "_loadAutoCountry", value: function() {
|
|
24570
24570
|
var t = this;
|
|
24571
24571
|
window.intlTelInputGlobals.autoCountry ? this.handleAutoCountry() : window.intlTelInputGlobals.startedLoadingAutoCountry || (window.intlTelInputGlobals.startedLoadingAutoCountry = true, typeof this.options.geoIpLookup == "function" && this.options.geoIpLookup(function() {
|
|
24572
|
-
var e = arguments.length > 0 && arguments[0] !== c ? arguments[0] : "", i = e.toLowerCase(), o =
|
|
24572
|
+
var e = arguments.length > 0 && arguments[0] !== c ? arguments[0] : "", i = e.toLowerCase(), o = i && t._getCountryData(i, true);
|
|
24573
24573
|
o ? (window.intlTelInputGlobals.autoCountry = i, setTimeout(function() {
|
|
24574
|
-
return
|
|
24575
|
-
})) : (t._setInitialState(true),
|
|
24574
|
+
return k("handleAutoCountry");
|
|
24575
|
+
})) : (t._setInitialState(true), k("rejectAutoCountryPromise"));
|
|
24576
24576
|
}, function() {
|
|
24577
|
-
return
|
|
24577
|
+
return k("rejectAutoCountryPromise");
|
|
24578
24578
|
}));
|
|
24579
24579
|
} }, { key: "_initKeyListeners", value: function() {
|
|
24580
24580
|
var t = this, e = false;
|
|
@@ -24704,11 +24704,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24704
24704
|
i && r && i.charAt(0) !== "+" && (i.charAt(0) !== "1" && (i = "1".concat(i)), i = "+".concat(i)), this.options.showSelectedDialCode && o && i.charAt(0) !== "+" && (i = "+".concat(o).concat(i));
|
|
24705
24705
|
var a = this._getDialCode(i, true), l = this._getNumeric(i), u = null;
|
|
24706
24706
|
if (a) {
|
|
24707
|
-
var h = this.countryCodes[this._getNumeric(a)],
|
|
24708
|
-
if (!f && !
|
|
24709
|
-
for (var
|
|
24710
|
-
if (h[
|
|
24711
|
-
u = h[
|
|
24707
|
+
var h = this.countryCodes[this._getNumeric(a)], g = h.indexOf(this.selectedCountryData.iso2) !== -1 && l.length <= a.length - 1, f = o === "1" && this._isRegionlessNanp(l);
|
|
24708
|
+
if (!f && !g) {
|
|
24709
|
+
for (var v = 0; v < h.length; v++)
|
|
24710
|
+
if (h[v]) {
|
|
24711
|
+
u = h[v];
|
|
24712
24712
|
break;
|
|
24713
24713
|
}
|
|
24714
24714
|
}
|
|
@@ -24741,8 +24741,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24741
24741
|
this.isRTL ? this.telInput.style.paddingRight = "".concat(h + 6, "px") : this.telInput.style.paddingLeft = "".concat(h + 6, "px");
|
|
24742
24742
|
}
|
|
24743
24743
|
if (this._updatePlaceholder(), i && !a) {
|
|
24744
|
-
var
|
|
24745
|
-
if (
|
|
24744
|
+
var g = this.activeItem;
|
|
24745
|
+
if (g && (g.classList.remove("iti__active"), g.setAttribute("aria-selected", "false")), t) {
|
|
24746
24746
|
var f = this.countryList.querySelector("#iti-".concat(this.id, "__item-").concat(t, "-preferred")) || this.countryList.querySelector("#iti-".concat(this.id, "__item-").concat(t));
|
|
24747
24747
|
f.setAttribute("aria-selected", "true"), f.classList.add("iti__active"), this.activeItem = f;
|
|
24748
24748
|
}
|
|
@@ -24774,13 +24774,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24774
24774
|
} }, { key: "_closeDropdown", value: function() {
|
|
24775
24775
|
this.dropdownContent.classList.add("iti__hide"), this.selectedFlag.setAttribute("aria-expanded", "false"), this.selectedFlag.removeAttribute("aria-activedescendant"), this.dropdownArrow.classList.remove("iti__arrow--up"), document.removeEventListener("keydown", this._handleKeydownOnDropdown), this.options.countrySearch && this.searchInput.removeEventListener("input", this._handleSearchChange), document.documentElement.removeEventListener("click", this._handleClickOffToClose), this.countryList.removeEventListener("mouseover", this._handleMouseoverCountryList), this.countryList.removeEventListener("click", this._handleClickCountryList), this.options.dropdownContainer && (this.options.useFullscreenPopup || window.removeEventListener("scroll", this._handleWindowScroll), this.dropdown.parentNode && this.dropdown.parentNode.removeChild(this.dropdown)), this._trigger("close:countrydropdown");
|
|
24776
24776
|
} }, { key: "_scrollTo", value: function(t, e) {
|
|
24777
|
-
var i = this.countryList, o = document.documentElement.scrollTop, r = i.offsetHeight, a = i.getBoundingClientRect().top + o, l = a + r, u = t.offsetHeight, h = t.getBoundingClientRect().top + o,
|
|
24777
|
+
var i = this.countryList, o = document.documentElement.scrollTop, r = i.offsetHeight, a = i.getBoundingClientRect().top + o, l = a + r, u = t.offsetHeight, h = t.getBoundingClientRect().top + o, g = h + u, f = h - a + i.scrollTop, v = r / 2 - u / 2;
|
|
24778
24778
|
if (h < a)
|
|
24779
|
-
e && (f -=
|
|
24780
|
-
else if (
|
|
24781
|
-
e && (f +=
|
|
24782
|
-
var
|
|
24783
|
-
i.scrollTop = f -
|
|
24779
|
+
e && (f -= v), i.scrollTop = f;
|
|
24780
|
+
else if (g > l) {
|
|
24781
|
+
e && (f += v);
|
|
24782
|
+
var w = r - u;
|
|
24783
|
+
i.scrollTop = f - w;
|
|
24784
24784
|
}
|
|
24785
24785
|
} }, { key: "_updateDialCode", value: function(t) {
|
|
24786
24786
|
var e = this.telInput.value, i = "+".concat(t), o;
|
|
@@ -24877,18 +24877,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24877
24877
|
this.options.placeholderNumberType = t, this._updatePlaceholder();
|
|
24878
24878
|
} }]), s;
|
|
24879
24879
|
}();
|
|
24880
|
-
|
|
24880
|
+
S.getCountryData = function() {
|
|
24881
24881
|
return p;
|
|
24882
24882
|
};
|
|
24883
24883
|
var B = function(n, t, e) {
|
|
24884
24884
|
var i = document.createElement("script");
|
|
24885
24885
|
i.onload = function() {
|
|
24886
|
-
|
|
24886
|
+
k("handleUtils"), t && t();
|
|
24887
24887
|
}, i.onerror = function() {
|
|
24888
|
-
|
|
24888
|
+
k("rejectUtilsScriptPromise"), e && e();
|
|
24889
24889
|
}, i.className = "iti-load-utils", i.async = true, i.src = n, document.body.appendChild(i);
|
|
24890
24890
|
};
|
|
24891
|
-
return
|
|
24891
|
+
return S.loadUtils = function(s) {
|
|
24892
24892
|
if (!window.intlTelInputUtils && !window.intlTelInputGlobals.startedLoadingUtilsScript) {
|
|
24893
24893
|
if (window.intlTelInputGlobals.startedLoadingUtilsScript = true, typeof Promise < "u")
|
|
24894
24894
|
return new Promise(function(n, t) {
|
|
@@ -24897,7 +24897,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24897
24897
|
B(s);
|
|
24898
24898
|
}
|
|
24899
24899
|
return null;
|
|
24900
|
-
},
|
|
24900
|
+
}, S.defaults = M, S.version = "19.3.0", function(s, n) {
|
|
24901
24901
|
var t = new q(s, n);
|
|
24902
24902
|
return t._init(), s.setAttribute("data-intl-tel-input-id", t.id), window.intlTelInputGlobals.instances[t.id] = t, t;
|
|
24903
24903
|
};
|
|
@@ -24905,22 +24905,22 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24905
24905
|
});
|
|
24906
24906
|
});
|
|
24907
24907
|
var z = nt(R());
|
|
24908
|
-
var U = ({ initialValue: c, onChangeNumber: p, onChangeCountry: y, onChangeValidity: m, onChangeErrorCode: C, initOptions: N, className: F, disabled: P, onFocus: x, onBlur:
|
|
24909
|
-
let
|
|
24908
|
+
var U = ({ initialValue: c, onChangeNumber: p, onChangeCountry: y, onChangeValidity: m, onChangeErrorCode: C, initOptions: N, className: F, disabled: P, onFocus: x, onBlur: D }) => {
|
|
24909
|
+
let I = (0, import_react.useRef)(null), _ = (0, import_react.useRef)(null), L = () => {
|
|
24910
24910
|
let b = _.current.getNumber(), O = _.current.getSelectedCountryData().iso2;
|
|
24911
24911
|
if (p(b), y(O), _.current.isValidNumber())
|
|
24912
24912
|
m(true), C(null);
|
|
24913
24913
|
else {
|
|
24914
|
-
let
|
|
24915
|
-
m(false), C(
|
|
24914
|
+
let A = _.current.getValidationError();
|
|
24915
|
+
m(false), C(A);
|
|
24916
24916
|
}
|
|
24917
24917
|
};
|
|
24918
24918
|
return (0, import_react.useEffect)(() => {
|
|
24919
|
-
let b =
|
|
24920
|
-
return _.current = (0, z.default)(
|
|
24921
|
-
b.removeEventListener("countrychange",
|
|
24919
|
+
let b = I.current;
|
|
24920
|
+
return _.current = (0, z.default)(I.current, N), b.addEventListener("countrychange", L), () => {
|
|
24921
|
+
b.removeEventListener("countrychange", L), _.current.destroy();
|
|
24922
24922
|
};
|
|
24923
|
-
}, []), import_react.default.createElement("input", { type: "tel", ref:
|
|
24923
|
+
}, []), import_react.default.createElement("input", { type: "tel", ref: I, onInput: L, defaultValue: c, className: F, disabled: P, onFocus: x, onBlur: D });
|
|
24924
24924
|
};
|
|
24925
24925
|
U.propTypes = { initialValue: import_prop_types.default.string, onChangeNumber: import_prop_types.default.func, onChangeCountry: import_prop_types.default.func, onChangeValidity: import_prop_types.default.func, onChangeErrorCode: import_prop_types.default.func, initOptions: import_prop_types.default.shape({ allowDropdown: import_prop_types.default.bool, autoInsertDialCode: import_prop_types.default.bool, autoPlaceholder: import_prop_types.default.string, containerClass: import_prop_types.default.string, countrySearch: import_prop_types.default.bool, customPlaceholder: import_prop_types.default.func, dropdownContainer: import_prop_types.default.node, excludeCountries: import_prop_types.default.arrayOf(import_prop_types.default.string), fixDropdownWidth: import_prop_types.default.bool, formatAsYouType: import_prop_types.default.bool, formatOnDisplay: import_prop_types.default.bool, geoIpLookup: import_prop_types.default.func, hiddenInput: import_prop_types.default.func, i18n: import_prop_types.default.objectOf(import_prop_types.default.string), initialCountry: import_prop_types.default.string, nationalMode: import_prop_types.default.bool, onlyCountries: import_prop_types.default.arrayOf(import_prop_types.default.string), placeholderNumberType: import_prop_types.default.string, preferredCountries: import_prop_types.default.arrayOf(import_prop_types.default.string), showFlags: import_prop_types.default.bool, showSelectedDialCode: import_prop_types.default.bool, useFullscreenPopup: import_prop_types.default.bool, utilsScript: import_prop_types.default.string }), className: import_prop_types.default.string, disabled: import_prop_types.default.bool, onFocus: import_prop_types.default.func, onBlur: import_prop_types.default.func };
|
|
24926
24926
|
U.defaultProps = { initialValue: "", onChangeNumber: () => {
|
|
@@ -24326,10 +24326,10 @@ var R = et((at, T) => {
|
|
|
24326
24326
|
return s;
|
|
24327
24327
|
}
|
|
24328
24328
|
function N(s, n, t) {
|
|
24329
|
-
return n =
|
|
24329
|
+
return n = A(n), n in s ? Object.defineProperty(s, n, { value: t, enumerable: true, configurable: true, writable: true }) : s[n] = t, s;
|
|
24330
24330
|
}
|
|
24331
24331
|
function F(s, n) {
|
|
24332
|
-
return _(s) ||
|
|
24332
|
+
return _(s) || I(s, n) || x(s, n) || P();
|
|
24333
24333
|
}
|
|
24334
24334
|
function P() {
|
|
24335
24335
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
@@ -24338,21 +24338,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24338
24338
|
function x(s, n) {
|
|
24339
24339
|
if (s) {
|
|
24340
24340
|
if (typeof s == "string")
|
|
24341
|
-
return
|
|
24341
|
+
return D(s, n);
|
|
24342
24342
|
var t = Object.prototype.toString.call(s).slice(8, -1);
|
|
24343
24343
|
if (t === "Object" && s.constructor && (t = s.constructor.name), t === "Map" || t === "Set")
|
|
24344
24344
|
return Array.from(s);
|
|
24345
24345
|
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
|
|
24346
|
-
return
|
|
24346
|
+
return D(s, n);
|
|
24347
24347
|
}
|
|
24348
24348
|
}
|
|
24349
|
-
function
|
|
24349
|
+
function D(s, n) {
|
|
24350
24350
|
(n == null || n > s.length) && (n = s.length);
|
|
24351
24351
|
for (var t = 0, e = new Array(n); t < n; t++)
|
|
24352
24352
|
e[t] = s[t];
|
|
24353
24353
|
return e;
|
|
24354
24354
|
}
|
|
24355
|
-
function
|
|
24355
|
+
function I(s, n) {
|
|
24356
24356
|
var t = s == null ? null : typeof Symbol < "u" && s[Symbol.iterator] || s["@@iterator"];
|
|
24357
24357
|
if (t != null) {
|
|
24358
24358
|
var e, i, o, r, a = [], l = true, u = false;
|
|
@@ -24382,20 +24382,20 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24382
24382
|
if (Array.isArray(s))
|
|
24383
24383
|
return s;
|
|
24384
24384
|
}
|
|
24385
|
-
function
|
|
24385
|
+
function L(s, n) {
|
|
24386
24386
|
if (!(s instanceof n))
|
|
24387
24387
|
throw new TypeError("Cannot call a class as a function");
|
|
24388
24388
|
}
|
|
24389
24389
|
function b(s, n) {
|
|
24390
24390
|
for (var t = 0; t < n.length; t++) {
|
|
24391
24391
|
var e = n[t];
|
|
24392
|
-
e.enumerable = e.enumerable || false, e.configurable = true, "value" in e && (e.writable = true), Object.defineProperty(s,
|
|
24392
|
+
e.enumerable = e.enumerable || false, e.configurable = true, "value" in e && (e.writable = true), Object.defineProperty(s, A(e.key), e);
|
|
24393
24393
|
}
|
|
24394
24394
|
}
|
|
24395
24395
|
function O(s, n, t) {
|
|
24396
24396
|
return n && b(s.prototype, n), t && b(s, t), Object.defineProperty(s, "prototype", { writable: false }), s;
|
|
24397
24397
|
}
|
|
24398
|
-
function
|
|
24398
|
+
function A(s) {
|
|
24399
24399
|
var n = V(s, "string");
|
|
24400
24400
|
return typeof n == "symbol" ? n : String(n);
|
|
24401
24401
|
}
|
|
@@ -24411,14 +24411,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24411
24411
|
}
|
|
24412
24412
|
return (n === "string" ? String : Number)(s);
|
|
24413
24413
|
}
|
|
24414
|
-
var
|
|
24414
|
+
var S = { getInstance: function(n) {
|
|
24415
24415
|
var t = n.getAttribute("data-intl-tel-input-id");
|
|
24416
24416
|
return window.intlTelInputGlobals.instances[t];
|
|
24417
24417
|
}, instances: {}, documentReady: function() {
|
|
24418
24418
|
return document.readyState === "complete";
|
|
24419
24419
|
} };
|
|
24420
|
-
typeof window == "object" && (window.intlTelInputGlobals =
|
|
24421
|
-
var H = 0, M = { allowDropdown: true, autoInsertDialCode: false, autoPlaceholder: "polite", countrySearch: true, containerClass: "", customPlaceholder: null, dropdownContainer: null, excludeCountries: [], fixDropdownWidth: true, formatAsYouType: true, formatOnDisplay: true, geoIpLookup: null, hiddenInput: null, i18n: {}, initialCountry: "", nationalMode: true, onlyCountries: [], placeholderNumberType: "MOBILE", preferredCountries: [], showFlags: true, showSelectedDialCode: false, useFullscreenPopup: typeof navigator < "u" && typeof window < "u" ? /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 500 : false, utilsScript: "" }, W = ["800", "822", "833", "844", "855", "866", "877", "880", "881", "882", "883", "884", "885", "886", "887", "888", "889"],
|
|
24420
|
+
typeof window == "object" && (window.intlTelInputGlobals = S);
|
|
24421
|
+
var H = 0, M = { allowDropdown: true, autoInsertDialCode: false, autoPlaceholder: "polite", countrySearch: true, containerClass: "", customPlaceholder: null, defaultToFirstCountry: true, dropdownContainer: null, excludeCountries: [], fixDropdownWidth: true, formatAsYouType: true, formatOnDisplay: true, geoIpLookup: null, hiddenInput: null, i18n: {}, initialCountry: "", nationalMode: true, onlyCountries: [], placeholderNumberType: "MOBILE", preferredCountries: [], showFlags: true, showSelectedDialCode: false, useFullscreenPopup: typeof navigator < "u" && typeof window < "u" ? /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 500 : false, utilsScript: "" }, W = ["800", "822", "833", "844", "855", "866", "877", "880", "881", "882", "883", "884", "885", "886", "887", "888", "889"], k = function(n) {
|
|
24422
24422
|
var t = window.intlTelInputGlobals.instances;
|
|
24423
24423
|
Object.values(t).forEach(function(e) {
|
|
24424
24424
|
return e[n]();
|
|
@@ -24426,7 +24426,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24426
24426
|
}, q = function() {
|
|
24427
24427
|
function s(n) {
|
|
24428
24428
|
var t = arguments.length > 1 && arguments[1] !== c ? arguments[1] : {};
|
|
24429
|
-
|
|
24429
|
+
L(this, s), this.id = H++, this.telInput = n, this.activeItem = null, this.highlightedItem = null, this.options = Object.assign({}, M, t), this.hadInitialPlaceholder = !!n.getAttribute("placeholder");
|
|
24430
24430
|
}
|
|
24431
24431
|
return O(s, [{ key: "_init", value: function() {
|
|
24432
24432
|
var t = this;
|
|
@@ -24508,23 +24508,23 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24508
24508
|
}), i && i.appendChild(o), o;
|
|
24509
24509
|
} }, { key: "_generateMarkup", value: function() {
|
|
24510
24510
|
this.telInput.classList.add("iti__tel-input"), !this.telInput.hasAttribute("autocomplete") && !(this.telInput.form && this.telInput.form.hasAttribute("autocomplete")) && this.telInput.setAttribute("autocomplete", "off");
|
|
24511
|
-
var t = this.options, e = t.allowDropdown, i = t.showSelectedDialCode, o = t.showFlags, r = t.containerClass, a = t.hiddenInput, l = t.dropdownContainer, u = t.fixDropdownWidth, h = t.useFullscreenPopup,
|
|
24511
|
+
var t = this.options, e = t.allowDropdown, i = t.showSelectedDialCode, o = t.showFlags, r = t.containerClass, a = t.hiddenInput, l = t.dropdownContainer, u = t.fixDropdownWidth, h = t.useFullscreenPopup, g = t.countrySearch, f = "iti";
|
|
24512
24512
|
e && (f += " iti--allow-dropdown"), i && (f += " iti--show-selected-dial-code"), o && (f += " iti--show-flags"), r && (f += " ".concat(r)), h || (f += " iti--inline-dropdown");
|
|
24513
|
-
var
|
|
24514
|
-
this.telInput.parentNode.insertBefore(
|
|
24515
|
-
var
|
|
24516
|
-
if (
|
|
24513
|
+
var v = this._createEl("div", { class: f });
|
|
24514
|
+
this.telInput.parentNode.insertBefore(v, this.telInput);
|
|
24515
|
+
var w = e || o || i;
|
|
24516
|
+
if (w && (this.flagsContainer = this._createEl("div", { class: "iti__flag-container" }, v)), v.appendChild(this.telInput), w && (this.selectedFlag = this._createEl("div", C({ class: "iti__selected-flag" }, e && { role: "combobox", "aria-haspopup": "listbox", "aria-controls": "iti-".concat(this.id, "__country-listbox"), "aria-expanded": "false", "aria-label": this.options.i18n.selectedCountryAriaLabel || "Selected country" }), this.flagsContainer)), o && (this.selectedFlagInner = this._createEl("div", { class: "iti__flag" }, this.selectedFlag)), this.selectedFlag && this.telInput.disabled && this.selectedFlag.setAttribute("aria-disabled", "true"), i && (this.selectedDialCode = this._createEl("div", { class: "iti__selected-dial-code" }, this.selectedFlag)), e) {
|
|
24517
24517
|
this.telInput.disabled || this.selectedFlag.setAttribute("tabindex", "0"), this.dropdownArrow = this._createEl("div", { class: "iti__arrow" }, this.selectedFlag);
|
|
24518
24518
|
var Y = u ? "" : "iti--flexible-dropdown-width";
|
|
24519
|
-
if (this.dropdownContent = this._createEl("div", { class: "iti__dropdown-content iti__hide ".concat(Y) }),
|
|
24519
|
+
if (this.dropdownContent = this._createEl("div", { class: "iti__dropdown-content iti__hide ".concat(Y) }), g && (this.searchInput = this._createEl("input", { type: "text", class: "iti__search-input", placeholder: this.options.i18n.searchPlaceholder || "Search" }, this.dropdownContent)), this.countryList = this._createEl("ul", { class: "iti__country-list", id: "iti-".concat(this.id, "__country-listbox"), role: "listbox", "aria-label": this.options.i18n.countryListAriaLabel || "List of countries" }, this.dropdownContent), this.preferredCountries.length && !g && (this._appendListItems(this.preferredCountries, "iti__preferred", true), this._createEl("li", { class: "iti__divider", "aria-hidden": "true" }, this.countryList)), this._appendListItems(this.countries, "iti__standard"), l) {
|
|
24520
24520
|
var E = "iti iti--container";
|
|
24521
|
-
h ? E += " iti--fullscreen-popup" : E += " iti--inline-dropdown",
|
|
24521
|
+
h ? E += " iti--fullscreen-popup" : E += " iti--inline-dropdown", g && (E += " iti--country-search"), this.dropdown = this._createEl("div", { class: E }), this.dropdown.appendChild(this.dropdownContent);
|
|
24522
24522
|
} else
|
|
24523
24523
|
this.flagsContainer.appendChild(this.dropdownContent);
|
|
24524
24524
|
}
|
|
24525
24525
|
if (a) {
|
|
24526
24526
|
var J = this.telInput.getAttribute("name"), j = a(J);
|
|
24527
|
-
this.hiddenInput = this._createEl("input", { type: "hidden", name: j }),
|
|
24527
|
+
this.hiddenInput = this._createEl("input", { type: "hidden", name: j }), v.appendChild(this.hiddenInput), this.hiddenInputCountry = this._createEl("input", { type: "hidden", name: "".concat(j, "_country") }), v.appendChild(this.hiddenInputCountry);
|
|
24528
24528
|
}
|
|
24529
24529
|
} }, { key: "_appendListItems", value: function(t, e, i) {
|
|
24530
24530
|
for (var o = 0; o < t.length; o++) {
|
|
@@ -24534,12 +24534,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24534
24534
|
this.options.showFlags && (u += "<div class='iti__flag-box'><div class='iti__flag iti__".concat(r.iso2, "'></div></div>")), u += "<span class='iti__country-name'>".concat(r.name, "</span>"), u += "<span class='iti__dial-code'>+".concat(r.dialCode, "</span>"), l.insertAdjacentHTML("beforeend", u);
|
|
24535
24535
|
}
|
|
24536
24536
|
} }, { key: "_setInitialState", value: function() {
|
|
24537
|
-
var t = arguments.length > 0 && arguments[0] !== c ? arguments[0] : false, e = this.telInput.getAttribute("value"), i = this.telInput.value, o = e && e.charAt(0) === "+" && (!i || i.charAt(0) !== "+"), r = o ? e : i, a = this._getDialCode(r), l = this._isRegionlessNanp(r), u = this.options, h = u.initialCountry,
|
|
24537
|
+
var t = arguments.length > 0 && arguments[0] !== c ? arguments[0] : false, e = this.telInput.getAttribute("value"), i = this.telInput.value, o = e && e.charAt(0) === "+" && (!i || i.charAt(0) !== "+"), r = o ? e : i, a = this._getDialCode(r), l = this._isRegionlessNanp(r), u = this.options, h = u.initialCountry, g = u.autoInsertDialCode, f = u.defaultToFirstCountry;
|
|
24538
24538
|
if (a && !l)
|
|
24539
24539
|
this._updateFlagFromNumber(r);
|
|
24540
24540
|
else if (h !== "auto" || t) {
|
|
24541
|
-
var
|
|
24542
|
-
|
|
24541
|
+
var v = h ? h.toLowerCase() : "", w = v && this._getCountryData(v, true);
|
|
24542
|
+
w ? this._setFlag(v) : a && l ? this._setFlag("us") : f && (this.defaultCountry = this.preferredCountries.length ? this.preferredCountries[0].iso2 : this.countries[0].iso2, r || this._setFlag(this.defaultCountry)), !r && g && (this.telInput.value = "+".concat(this.selectedCountryData.dialCode));
|
|
24543
24543
|
}
|
|
24544
24544
|
r && this._updateValFromNumber(r);
|
|
24545
24545
|
} }, { key: "_initListeners", value: function() {
|
|
@@ -24569,12 +24569,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24569
24569
|
} }, { key: "_loadAutoCountry", value: function() {
|
|
24570
24570
|
var t = this;
|
|
24571
24571
|
window.intlTelInputGlobals.autoCountry ? this.handleAutoCountry() : window.intlTelInputGlobals.startedLoadingAutoCountry || (window.intlTelInputGlobals.startedLoadingAutoCountry = true, typeof this.options.geoIpLookup == "function" && this.options.geoIpLookup(function() {
|
|
24572
|
-
var e = arguments.length > 0 && arguments[0] !== c ? arguments[0] : "", i = e.toLowerCase(), o =
|
|
24572
|
+
var e = arguments.length > 0 && arguments[0] !== c ? arguments[0] : "", i = e.toLowerCase(), o = i && t._getCountryData(i, true);
|
|
24573
24573
|
o ? (window.intlTelInputGlobals.autoCountry = i, setTimeout(function() {
|
|
24574
|
-
return
|
|
24575
|
-
})) : (t._setInitialState(true),
|
|
24574
|
+
return k("handleAutoCountry");
|
|
24575
|
+
})) : (t._setInitialState(true), k("rejectAutoCountryPromise"));
|
|
24576
24576
|
}, function() {
|
|
24577
|
-
return
|
|
24577
|
+
return k("rejectAutoCountryPromise");
|
|
24578
24578
|
}));
|
|
24579
24579
|
} }, { key: "_initKeyListeners", value: function() {
|
|
24580
24580
|
var t = this, e = false;
|
|
@@ -24704,11 +24704,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24704
24704
|
i && r && i.charAt(0) !== "+" && (i.charAt(0) !== "1" && (i = "1".concat(i)), i = "+".concat(i)), this.options.showSelectedDialCode && o && i.charAt(0) !== "+" && (i = "+".concat(o).concat(i));
|
|
24705
24705
|
var a = this._getDialCode(i, true), l = this._getNumeric(i), u = null;
|
|
24706
24706
|
if (a) {
|
|
24707
|
-
var h = this.countryCodes[this._getNumeric(a)],
|
|
24708
|
-
if (!f && !
|
|
24709
|
-
for (var
|
|
24710
|
-
if (h[
|
|
24711
|
-
u = h[
|
|
24707
|
+
var h = this.countryCodes[this._getNumeric(a)], g = h.indexOf(this.selectedCountryData.iso2) !== -1 && l.length <= a.length - 1, f = o === "1" && this._isRegionlessNanp(l);
|
|
24708
|
+
if (!f && !g) {
|
|
24709
|
+
for (var v = 0; v < h.length; v++)
|
|
24710
|
+
if (h[v]) {
|
|
24711
|
+
u = h[v];
|
|
24712
24712
|
break;
|
|
24713
24713
|
}
|
|
24714
24714
|
}
|
|
@@ -24741,8 +24741,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24741
24741
|
this.isRTL ? this.telInput.style.paddingRight = "".concat(h + 6, "px") : this.telInput.style.paddingLeft = "".concat(h + 6, "px");
|
|
24742
24742
|
}
|
|
24743
24743
|
if (this._updatePlaceholder(), i && !a) {
|
|
24744
|
-
var
|
|
24745
|
-
if (
|
|
24744
|
+
var g = this.activeItem;
|
|
24745
|
+
if (g && (g.classList.remove("iti__active"), g.setAttribute("aria-selected", "false")), t) {
|
|
24746
24746
|
var f = this.countryList.querySelector("#iti-".concat(this.id, "__item-").concat(t, "-preferred")) || this.countryList.querySelector("#iti-".concat(this.id, "__item-").concat(t));
|
|
24747
24747
|
f.setAttribute("aria-selected", "true"), f.classList.add("iti__active"), this.activeItem = f;
|
|
24748
24748
|
}
|
|
@@ -24774,13 +24774,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24774
24774
|
} }, { key: "_closeDropdown", value: function() {
|
|
24775
24775
|
this.dropdownContent.classList.add("iti__hide"), this.selectedFlag.setAttribute("aria-expanded", "false"), this.selectedFlag.removeAttribute("aria-activedescendant"), this.dropdownArrow.classList.remove("iti__arrow--up"), document.removeEventListener("keydown", this._handleKeydownOnDropdown), this.options.countrySearch && this.searchInput.removeEventListener("input", this._handleSearchChange), document.documentElement.removeEventListener("click", this._handleClickOffToClose), this.countryList.removeEventListener("mouseover", this._handleMouseoverCountryList), this.countryList.removeEventListener("click", this._handleClickCountryList), this.options.dropdownContainer && (this.options.useFullscreenPopup || window.removeEventListener("scroll", this._handleWindowScroll), this.dropdown.parentNode && this.dropdown.parentNode.removeChild(this.dropdown)), this._trigger("close:countrydropdown");
|
|
24776
24776
|
} }, { key: "_scrollTo", value: function(t, e) {
|
|
24777
|
-
var i = this.countryList, o = document.documentElement.scrollTop, r = i.offsetHeight, a = i.getBoundingClientRect().top + o, l = a + r, u = t.offsetHeight, h = t.getBoundingClientRect().top + o,
|
|
24777
|
+
var i = this.countryList, o = document.documentElement.scrollTop, r = i.offsetHeight, a = i.getBoundingClientRect().top + o, l = a + r, u = t.offsetHeight, h = t.getBoundingClientRect().top + o, g = h + u, f = h - a + i.scrollTop, v = r / 2 - u / 2;
|
|
24778
24778
|
if (h < a)
|
|
24779
|
-
e && (f -=
|
|
24780
|
-
else if (
|
|
24781
|
-
e && (f +=
|
|
24782
|
-
var
|
|
24783
|
-
i.scrollTop = f -
|
|
24779
|
+
e && (f -= v), i.scrollTop = f;
|
|
24780
|
+
else if (g > l) {
|
|
24781
|
+
e && (f += v);
|
|
24782
|
+
var w = r - u;
|
|
24783
|
+
i.scrollTop = f - w;
|
|
24784
24784
|
}
|
|
24785
24785
|
} }, { key: "_updateDialCode", value: function(t) {
|
|
24786
24786
|
var e = this.telInput.value, i = "+".concat(t), o;
|
|
@@ -24877,18 +24877,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24877
24877
|
this.options.placeholderNumberType = t, this._updatePlaceholder();
|
|
24878
24878
|
} }]), s;
|
|
24879
24879
|
}();
|
|
24880
|
-
|
|
24880
|
+
S.getCountryData = function() {
|
|
24881
24881
|
return p;
|
|
24882
24882
|
};
|
|
24883
24883
|
var B = function(n, t, e) {
|
|
24884
24884
|
var i = document.createElement("script");
|
|
24885
24885
|
i.onload = function() {
|
|
24886
|
-
|
|
24886
|
+
k("handleUtils"), t && t();
|
|
24887
24887
|
}, i.onerror = function() {
|
|
24888
|
-
|
|
24888
|
+
k("rejectUtilsScriptPromise"), e && e();
|
|
24889
24889
|
}, i.className = "iti-load-utils", i.async = true, i.src = n, document.body.appendChild(i);
|
|
24890
24890
|
};
|
|
24891
|
-
return
|
|
24891
|
+
return S.loadUtils = function(s) {
|
|
24892
24892
|
if (!window.intlTelInputUtils && !window.intlTelInputGlobals.startedLoadingUtilsScript) {
|
|
24893
24893
|
if (window.intlTelInputGlobals.startedLoadingUtilsScript = true, typeof Promise < "u")
|
|
24894
24894
|
return new Promise(function(n, t) {
|
|
@@ -24897,7 +24897,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24897
24897
|
B(s);
|
|
24898
24898
|
}
|
|
24899
24899
|
return null;
|
|
24900
|
-
},
|
|
24900
|
+
}, S.defaults = M, S.version = "19.3.0", function(s, n) {
|
|
24901
24901
|
var t = new q(s, n);
|
|
24902
24902
|
return t._init(), s.setAttribute("data-intl-tel-input-id", t.id), window.intlTelInputGlobals.instances[t.id] = t, t;
|
|
24903
24903
|
};
|
|
@@ -24905,22 +24905,22 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24905
24905
|
});
|
|
24906
24906
|
});
|
|
24907
24907
|
var z = nt(R());
|
|
24908
|
-
var U = ({ initialValue: c, onChangeNumber: p, onChangeCountry: y, onChangeValidity: m, onChangeErrorCode: C, initOptions: N, className: F, disabled: P, onFocus: x, onBlur:
|
|
24909
|
-
let
|
|
24908
|
+
var U = ({ initialValue: c, onChangeNumber: p, onChangeCountry: y, onChangeValidity: m, onChangeErrorCode: C, initOptions: N, className: F, disabled: P, onFocus: x, onBlur: D }) => {
|
|
24909
|
+
let I = (0, import_react.useRef)(null), _ = (0, import_react.useRef)(null), L = () => {
|
|
24910
24910
|
let b = _.current.getNumber(), O = _.current.getSelectedCountryData().iso2;
|
|
24911
24911
|
if (p(b), y(O), _.current.isValidNumber())
|
|
24912
24912
|
m(true), C(null);
|
|
24913
24913
|
else {
|
|
24914
|
-
let
|
|
24915
|
-
m(false), C(
|
|
24914
|
+
let A = _.current.getValidationError();
|
|
24915
|
+
m(false), C(A);
|
|
24916
24916
|
}
|
|
24917
24917
|
};
|
|
24918
24918
|
return (0, import_react.useEffect)(() => {
|
|
24919
|
-
let b =
|
|
24920
|
-
return _.current = (0, z.default)(
|
|
24921
|
-
b.removeEventListener("countrychange",
|
|
24919
|
+
let b = I.current;
|
|
24920
|
+
return _.current = (0, z.default)(I.current, N), b.addEventListener("countrychange", L), () => {
|
|
24921
|
+
b.removeEventListener("countrychange", L), _.current.destroy();
|
|
24922
24922
|
};
|
|
24923
|
-
}, []), import_react.default.createElement("input", { type: "tel", ref:
|
|
24923
|
+
}, []), import_react.default.createElement("input", { type: "tel", ref: I, onInput: L, defaultValue: c, className: F, disabled: P, onFocus: x, onBlur: D });
|
|
24924
24924
|
};
|
|
24925
24925
|
U.propTypes = { initialValue: import_prop_types.default.string, onChangeNumber: import_prop_types.default.func, onChangeCountry: import_prop_types.default.func, onChangeValidity: import_prop_types.default.func, onChangeErrorCode: import_prop_types.default.func, initOptions: import_prop_types.default.shape({ allowDropdown: import_prop_types.default.bool, autoInsertDialCode: import_prop_types.default.bool, autoPlaceholder: import_prop_types.default.string, containerClass: import_prop_types.default.string, countrySearch: import_prop_types.default.bool, customPlaceholder: import_prop_types.default.func, dropdownContainer: import_prop_types.default.node, excludeCountries: import_prop_types.default.arrayOf(import_prop_types.default.string), fixDropdownWidth: import_prop_types.default.bool, formatAsYouType: import_prop_types.default.bool, formatOnDisplay: import_prop_types.default.bool, geoIpLookup: import_prop_types.default.func, hiddenInput: import_prop_types.default.func, i18n: import_prop_types.default.objectOf(import_prop_types.default.string), initialCountry: import_prop_types.default.string, nationalMode: import_prop_types.default.bool, onlyCountries: import_prop_types.default.arrayOf(import_prop_types.default.string), placeholderNumberType: import_prop_types.default.string, preferredCountries: import_prop_types.default.arrayOf(import_prop_types.default.string), showFlags: import_prop_types.default.bool, showSelectedDialCode: import_prop_types.default.bool, useFullscreenPopup: import_prop_types.default.bool, utilsScript: import_prop_types.default.string }), className: import_prop_types.default.string, disabled: import_prop_types.default.bool, onFocus: import_prop_types.default.func, onBlur: import_prop_types.default.func };
|
|
24926
24926
|
U.defaultProps = { initialValue: "", onChangeNumber: () => {
|