intl-tel-input 25.11.2 → 25.11.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 +5 -5
- package/angular/README.md +1 -1
- package/angular/build/IntlTelInput.js +4 -3
- package/angular/build/IntlTelInputWithUtils.js +13 -12
- package/angular/build/types/modules/constants.d.ts +1 -0
- package/angular/build/types/modules/types/public-api.d.ts +4 -2
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/intlTelInput.d.ts +5 -2
- package/build/js/intlTelInput.js +5 -4
- package/build/js/intlTelInput.min.js +3 -3
- package/build/js/intlTelInputWithUtils.js +14 -13
- package/build/js/intlTelInputWithUtils.min.js +3 -3
- package/build/js/utils.js +9 -9
- package/package.json +1 -1
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +4 -3
- package/react/build/IntlTelInput.d.ts +5 -2
- package/react/build/IntlTelInput.js +4 -3
- package/react/build/IntlTelInputWithUtils.cjs +13 -12
- package/react/build/IntlTelInputWithUtils.js +13 -12
- package/vue/README.md +1 -1
- package/vue/build/IntlTelInput.mjs +65 -64
- package/vue/build/IntlTelInputWithUtils.mjs +166 -165
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { mergeModels as
|
|
2
|
-
const
|
|
1
|
+
import { mergeModels as B, useModel as Y, ref as S, onMounted as q, watch as X, onUnmounted as Q, withDirectives as J, createElementBlock as Z, openBlock as tt, mergeProps as et, vModelText as it } from "vue";
|
|
2
|
+
const st = [
|
|
3
3
|
[
|
|
4
4
|
"af",
|
|
5
5
|
// Afghanistan
|
|
@@ -1676,9 +1676,9 @@ const it = [
|
|
|
1676
1676
|
null,
|
|
1677
1677
|
"0"
|
|
1678
1678
|
]
|
|
1679
|
-
],
|
|
1680
|
-
for (const l of
|
|
1681
|
-
|
|
1679
|
+
], E = [];
|
|
1680
|
+
for (const l of st)
|
|
1681
|
+
E.push({
|
|
1682
1682
|
name: "",
|
|
1683
1683
|
// populated in the plugin
|
|
1684
1684
|
iso2: l[0],
|
|
@@ -1695,7 +1695,7 @@ for (const l of it)
|
|
|
1695
1695
|
dialCodePlus: ""
|
|
1696
1696
|
// populated in the plugin
|
|
1697
1697
|
});
|
|
1698
|
-
const
|
|
1698
|
+
const nt = {
|
|
1699
1699
|
ad: "Andorra",
|
|
1700
1700
|
ae: "United Arab Emirates",
|
|
1701
1701
|
af: "Afghanistan",
|
|
@@ -1938,7 +1938,7 @@ const st = {
|
|
|
1938
1938
|
za: "South Africa",
|
|
1939
1939
|
zm: "Zambia",
|
|
1940
1940
|
zw: "Zimbabwe"
|
|
1941
|
-
},
|
|
1941
|
+
}, ot = {
|
|
1942
1942
|
selectedCountryAriaLabel: "Change country, selected ${countryName} (${dialCode})",
|
|
1943
1943
|
noCountrySelected: "Select country",
|
|
1944
1944
|
countryListAriaLabel: "List of countries",
|
|
@@ -1950,7 +1950,7 @@ const st = {
|
|
|
1950
1950
|
// additional countries (not supported by country-list library)
|
|
1951
1951
|
ac: "Ascension Island",
|
|
1952
1952
|
xk: "Kosovo"
|
|
1953
|
-
},
|
|
1953
|
+
}, $ = { ...nt, ...ot }, A = {
|
|
1954
1954
|
OPEN_COUNTRY_DROPDOWN: "open:countrydropdown",
|
|
1955
1955
|
CLOSE_COUNTRY_DROPDOWN: "close:countrydropdown",
|
|
1956
1956
|
COUNTRY_CHANGE: "countrychange",
|
|
@@ -1971,7 +1971,7 @@ const st = {
|
|
|
1971
1971
|
ENTER: "Enter",
|
|
1972
1972
|
ESC: "Escape",
|
|
1973
1973
|
TAB: "Tab"
|
|
1974
|
-
},
|
|
1974
|
+
}, H = {
|
|
1975
1975
|
PASTE: "insertFromPaste",
|
|
1976
1976
|
DELETE_FWD: "deleteContentForward"
|
|
1977
1977
|
}, D = {
|
|
@@ -1983,19 +1983,19 @@ const st = {
|
|
|
1983
1983
|
// chars that are NOT + or digit (global)
|
|
1984
1984
|
HIDDEN_SEARCH_CHAR: /^[a-zA-ZÀ-ÿа-яА-Я ]$/
|
|
1985
1985
|
// single acceptable hidden-search char
|
|
1986
|
-
},
|
|
1986
|
+
}, lt = {
|
|
1987
1987
|
HIDDEN_SEARCH_RESET_MS: 1e3
|
|
1988
|
-
},
|
|
1988
|
+
}, W = {
|
|
1989
1989
|
UNKNOWN_NUMBER_TYPE: -99,
|
|
1990
1990
|
UNKNOWN_VALIDATION_ERROR: -99
|
|
1991
|
-
},
|
|
1991
|
+
}, T = {
|
|
1992
1992
|
SANE_SELECTED_WITH_DIAL_WIDTH: 78,
|
|
1993
1993
|
// px width fallback when separateDialCode enabled
|
|
1994
1994
|
SANE_SELECTED_NO_DIAL_WIDTH: 42,
|
|
1995
1995
|
// px width fallback when no separate dial code
|
|
1996
1996
|
INPUT_PADDING_EXTRA_LEFT: 6
|
|
1997
1997
|
// px gap between selected country container and input text
|
|
1998
|
-
},
|
|
1998
|
+
}, G = {
|
|
1999
1999
|
NANP: "1"
|
|
2000
2000
|
// North American Numbering Plan
|
|
2001
2001
|
}, P = {
|
|
@@ -2005,13 +2005,14 @@ const st = {
|
|
|
2005
2005
|
// UK mobile numbers start with 7 after national trunk (0) or core section
|
|
2006
2006
|
MOBILE_CORE_LENGTH: 10
|
|
2007
2007
|
// core number length (excluding dial code / national prefix) for mobiles
|
|
2008
|
-
}, lt = {
|
|
2009
|
-
ISO2: "us"
|
|
2010
2008
|
}, rt = {
|
|
2009
|
+
ISO2: "us"
|
|
2010
|
+
}, x = {
|
|
2011
|
+
AGGRESSIVE: "aggressive",
|
|
2011
2012
|
POLITE: "polite"
|
|
2012
2013
|
}, O = {
|
|
2013
2014
|
AUTO: "auto"
|
|
2014
|
-
},
|
|
2015
|
+
}, F = {
|
|
2015
2016
|
COUNTRY_CODE: "countryCode",
|
|
2016
2017
|
DIAL_CODE: "dialCode"
|
|
2017
2018
|
}, C = {
|
|
@@ -2032,13 +2033,13 @@ const st = {
|
|
|
2032
2033
|
return l || t || i && e;
|
|
2033
2034
|
}
|
|
2034
2035
|
return !1;
|
|
2035
|
-
},
|
|
2036
|
+
}, z = {
|
|
2036
2037
|
// Allow alphanumeric "phonewords" (e.g. +1 800 FLOWERS) as valid numbers
|
|
2037
2038
|
allowPhonewords: !1,
|
|
2038
2039
|
//* Whether or not to allow the dropdown.
|
|
2039
2040
|
allowDropdown: !0,
|
|
2040
2041
|
//* Add a placeholder in the input with an example number for the selected country.
|
|
2041
|
-
autoPlaceholder:
|
|
2042
|
+
autoPlaceholder: x.POLITE,
|
|
2042
2043
|
//* Modify the parentClass.
|
|
2043
2044
|
containerClass: "",
|
|
2044
2045
|
//* The order of the countries in the dropdown. Defaults to alphabetical.
|
|
@@ -2085,8 +2086,8 @@ const st = {
|
|
|
2085
2086
|
validationNumberTypes: ["MOBILE"]
|
|
2086
2087
|
}, ut = (l, t) => {
|
|
2087
2088
|
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 = { ...t, ...l.i18n };
|
|
2088
|
-
}, v = (l) => l.replace(/\D/g, ""),
|
|
2089
|
-
const e =
|
|
2089
|
+
}, v = (l) => l.replace(/\D/g, ""), j = (l = "") => l.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), dt = (l, t) => {
|
|
2090
|
+
const e = j(t), i = [], s = [], o = [], n = [], r = [], a = [];
|
|
2090
2091
|
for (const c of l)
|
|
2091
2092
|
c.iso2 === e ? i.push(c) : c.normalisedName.startsWith(e) ? s.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);
|
|
2092
2093
|
const d = (c, f) => c.priority - f.priority;
|
|
@@ -2333,7 +2334,7 @@ class Ct {
|
|
|
2333
2334
|
//* Update the input padding to make space for the selected country/dial code.
|
|
2334
2335
|
updateInputPadding() {
|
|
2335
2336
|
if (this.selectedCountry) {
|
|
2336
|
-
const t = this.options.separateDialCode ?
|
|
2337
|
+
const t = this.options.separateDialCode ? T.SANE_SELECTED_WITH_DIAL_WIDTH : T.SANE_SELECTED_NO_DIAL_WIDTH, i = (this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth() || t) + T.INPUT_PADDING_EXTRA_LEFT;
|
|
2337
2338
|
this.telInput.style.paddingLeft = `${i}px`;
|
|
2338
2339
|
}
|
|
2339
2340
|
}
|
|
@@ -2417,18 +2418,18 @@ const mt = (l) => {
|
|
|
2417
2418
|
const i = t.map(
|
|
2418
2419
|
(s) => s.toLowerCase()
|
|
2419
2420
|
);
|
|
2420
|
-
return
|
|
2421
|
+
return E.filter(
|
|
2421
2422
|
(s) => i.includes(s.iso2)
|
|
2422
2423
|
);
|
|
2423
2424
|
} else if (e.length) {
|
|
2424
2425
|
const i = e.map(
|
|
2425
2426
|
(s) => s.toLowerCase()
|
|
2426
2427
|
);
|
|
2427
|
-
return
|
|
2428
|
+
return E.filter(
|
|
2428
2429
|
(s) => !i.includes(s.iso2)
|
|
2429
2430
|
);
|
|
2430
2431
|
}
|
|
2431
|
-
return
|
|
2432
|
+
return E;
|
|
2432
2433
|
}, ft = (l, t) => {
|
|
2433
2434
|
for (const e of l) {
|
|
2434
2435
|
const i = e.iso2.toLowerCase();
|
|
@@ -2484,7 +2485,7 @@ const mt = (l) => {
|
|
|
2484
2485
|
});
|
|
2485
2486
|
}, bt = (l) => {
|
|
2486
2487
|
for (const t of l)
|
|
2487
|
-
t.normalisedName =
|
|
2488
|
+
t.normalisedName = j(t.name), t.initials = t.normalisedName.split(/[^a-z]/).map((e) => e[0]).join(""), t.dialCodePlus = `+${t.dialCode}`;
|
|
2488
2489
|
}, It = (l, t, e, i) => {
|
|
2489
2490
|
let s = l;
|
|
2490
2491
|
if (e && t) {
|
|
@@ -2525,21 +2526,21 @@ const mt = (l) => {
|
|
|
2525
2526
|
"887",
|
|
2526
2527
|
"888",
|
|
2527
2528
|
"889"
|
|
2528
|
-
],
|
|
2529
|
+
], V = (l) => {
|
|
2529
2530
|
const t = v(l);
|
|
2530
|
-
if (t.startsWith(
|
|
2531
|
+
if (t.startsWith(G.NANP) && t.length >= 4) {
|
|
2531
2532
|
const e = t.substring(1, 4);
|
|
2532
2533
|
return Nt.includes(e);
|
|
2533
2534
|
}
|
|
2534
2535
|
return !1;
|
|
2535
2536
|
};
|
|
2536
|
-
for (const l of
|
|
2537
|
-
l.name =
|
|
2537
|
+
for (const l of E)
|
|
2538
|
+
l.name = $[l.iso2];
|
|
2538
2539
|
let Dt = 0;
|
|
2539
|
-
const
|
|
2540
|
-
class
|
|
2540
|
+
const Et = new Set(E.map((l) => l.iso2)), M = (l) => Et.has(l);
|
|
2541
|
+
class U {
|
|
2541
2542
|
constructor(t, e = {}) {
|
|
2542
|
-
this.id = Dt++, this.options = { ...
|
|
2543
|
+
this.id = Dt++, this.options = { ...z, ...e }, ut(this.options, $), this.ui = new Ct(t, this.options, this.id), this.isAndroid = U._getIsAndroid(), this.promise = this._createInitPromises(), this.countries = mt(this.options);
|
|
2543
2544
|
const { dialCodes: i, dialCodeMaxLen: s, dialCodeToIso2Map: o } = yt(
|
|
2544
2545
|
this.countries,
|
|
2545
2546
|
this.options
|
|
@@ -2572,12 +2573,12 @@ class x {
|
|
|
2572
2573
|
//* 1. Extracting a dial code from the given number
|
|
2573
2574
|
//* 2. Using explicit initialCountry
|
|
2574
2575
|
_setInitialState(t = !1) {
|
|
2575
|
-
const e = this.ui.telInput.getAttribute("value"), i = this.ui.telInput.value, o = e && e.startsWith("+") && (!i || !i.startsWith("+")) ? e : i, n = this._getDialCode(o), r =
|
|
2576
|
+
const e = this.ui.telInput.getAttribute("value"), i = this.ui.telInput.value, o = e && e.startsWith("+") && (!i || !i.startsWith("+")) ? e : i, n = this._getDialCode(o), r = V(o), { initialCountry: a, geoIpLookup: d } = this.options, c = a === O.AUTO && d;
|
|
2576
2577
|
if (n && !r)
|
|
2577
2578
|
this._updateCountryFromNumber(o);
|
|
2578
2579
|
else if (!c || t) {
|
|
2579
2580
|
const f = a ? a.toLowerCase() : "";
|
|
2580
|
-
M(f) ? this._setCountry(f) : n && r ? this._setCountry(
|
|
2581
|
+
M(f) ? this._setCountry(f) : n && r ? this._setCountry(rt.ISO2) : this._setCountry("");
|
|
2581
2582
|
}
|
|
2582
2583
|
o && this._updateValFromNumber(o);
|
|
2583
2584
|
}
|
|
@@ -2652,10 +2653,10 @@ class x {
|
|
|
2652
2653
|
u.autoCountry ? this.handleAutoCountry() : u.startedLoadingAutoCountry || (u.startedLoadingAutoCountry = !0, typeof this.options.geoIpLookup == "function" && this.options.geoIpLookup(
|
|
2653
2654
|
(t = "") => {
|
|
2654
2655
|
const e = t.toLowerCase();
|
|
2655
|
-
M(e) ? (u.autoCountry = e, setTimeout(() =>
|
|
2656
|
+
M(e) ? (u.autoCountry = e, setTimeout(() => L("handleAutoCountry"))) : (this._setInitialState(!0), L("rejectAutoCountryPromise"));
|
|
2656
2657
|
},
|
|
2657
2658
|
() => {
|
|
2658
|
-
this._setInitialState(!0),
|
|
2659
|
+
this._setInitialState(!0), L("rejectAutoCountryPromise");
|
|
2659
2660
|
}
|
|
2660
2661
|
));
|
|
2661
2662
|
}
|
|
@@ -2686,7 +2687,7 @@ class x {
|
|
|
2686
2687
|
return;
|
|
2687
2688
|
}
|
|
2688
2689
|
this._updateCountryFromNumber(this.ui.telInput.value) && this._triggerCountryChange();
|
|
2689
|
-
const d = (a == null ? void 0 : a.data) && D.NON_PLUS_NUMERIC.test(a.data), c = (a == null ? void 0 : a.inputType) ===
|
|
2690
|
+
const d = (a == null ? void 0 : a.data) && D.NON_PLUS_NUMERIC.test(a.data), c = (a == null ? void 0 : a.inputType) === H.PASTE && this.ui.telInput.value;
|
|
2690
2691
|
d || c && !t ? n = !0 : D.NON_PLUS_NUMERIC.test(this.ui.telInput.value) || (n = !1);
|
|
2691
2692
|
const f = (a == null ? void 0 : a.detail) && a.detail.isSetNumber;
|
|
2692
2693
|
if (e && !n && !f) {
|
|
@@ -2696,7 +2697,7 @@ class x {
|
|
|
2696
2697
|
).replace(
|
|
2697
2698
|
D.NON_PLUS_NUMERIC_GLOBAL,
|
|
2698
2699
|
""
|
|
2699
|
-
).length, w = (a == null ? void 0 : a.inputType) ===
|
|
2700
|
+
).length, w = (a == null ? void 0 : a.inputType) === H.DELETE_FWD, I = this._getFullNumber(), _ = _t(
|
|
2700
2701
|
I,
|
|
2701
2702
|
this.ui.telInput.value,
|
|
2702
2703
|
u.utils,
|
|
@@ -2754,8 +2755,8 @@ class x {
|
|
|
2754
2755
|
return;
|
|
2755
2756
|
if (this.maxCoreNumberLength && _.length > this.maxCoreNumberLength)
|
|
2756
2757
|
if (i.selectionEnd === i.value.length) {
|
|
2757
|
-
const
|
|
2758
|
-
I = I.slice(0, I.length -
|
|
2758
|
+
const K = _.length - this.maxCoreNumberLength;
|
|
2759
|
+
I = I.slice(0, I.length - K);
|
|
2759
2760
|
} else
|
|
2760
2761
|
return;
|
|
2761
2762
|
i.value = I;
|
|
@@ -2869,7 +2870,7 @@ class x {
|
|
|
2869
2870
|
g.ESC
|
|
2870
2871
|
].includes(o.key) && (o.preventDefault(), o.stopPropagation(), o.key === g.ARROW_UP || o.key === g.ARROW_DOWN ? this._handleUpDownKey(o.key) : o.key === g.ENTER ? this._handleEnterKey() : o.key === g.ESC && this._closeDropdown()), !this.options.countrySearch && D.HIDDEN_SEARCH_CHAR.test(o.key) && (o.stopPropagation(), i && clearTimeout(i), e += o.key.toLowerCase(), this._searchForCountry(e), i = setTimeout(() => {
|
|
2871
2872
|
e = "";
|
|
2872
|
-
},
|
|
2873
|
+
}, lt.HIDDEN_SEARCH_RESET_MS));
|
|
2873
2874
|
};
|
|
2874
2875
|
document.addEventListener("keydown", s, { signal: t });
|
|
2875
2876
|
}
|
|
@@ -2961,7 +2962,7 @@ class x {
|
|
|
2961
2962
|
return d[0] === s ? null : d[0];
|
|
2962
2963
|
if (!s && this.defaultCountry && d.includes(this.defaultCountry))
|
|
2963
2964
|
return this.defaultCountry;
|
|
2964
|
-
if (o ===
|
|
2965
|
+
if (o === G.NANP && V(r))
|
|
2965
2966
|
return null;
|
|
2966
2967
|
const { areaCodes: f, priority: b } = this.selectedCountryData;
|
|
2967
2968
|
if (f) {
|
|
@@ -3033,7 +3034,7 @@ class x {
|
|
|
3033
3034
|
placeholderNumberType: e,
|
|
3034
3035
|
nationalMode: i,
|
|
3035
3036
|
customPlaceholder: s
|
|
3036
|
-
} = this.options, o = t ===
|
|
3037
|
+
} = this.options, o = t === x.AGGRESSIVE || !this.ui.hadInitialPlaceholder && t === x.POLITE;
|
|
3037
3038
|
if (u.utils && o) {
|
|
3038
3039
|
const n = u.utils.numberType[e];
|
|
3039
3040
|
let r = this.selectedCountryData.iso2 ? u.utils.getExampleNumber(
|
|
@@ -3046,9 +3047,9 @@ class x {
|
|
|
3046
3047
|
}
|
|
3047
3048
|
//* Called when the user selects a list item from the dropdown.
|
|
3048
3049
|
_selectListItem(t) {
|
|
3049
|
-
const e = t.dataset[
|
|
3050
|
+
const e = t.dataset[F.COUNTRY_CODE], i = this._setCountry(e);
|
|
3050
3051
|
this._closeDropdown();
|
|
3051
|
-
const s = t.dataset[
|
|
3052
|
+
const s = t.dataset[F.DIAL_CODE];
|
|
3052
3053
|
this._updateDialCode(s), this.options.formatOnDisplay && this._updateValFromNumber(this.ui.telInput.value), this.ui.telInput.focus(), i && this._triggerCountryChange();
|
|
3053
3054
|
}
|
|
3054
3055
|
//* Close the dropdown and unbind any listeners.
|
|
@@ -3152,7 +3153,7 @@ class x {
|
|
|
3152
3153
|
return u.utils ? u.utils.getNumberType(
|
|
3153
3154
|
this._getFullNumber(),
|
|
3154
3155
|
this.selectedCountryData.iso2
|
|
3155
|
-
) :
|
|
3156
|
+
) : W.UNKNOWN_NUMBER_TYPE;
|
|
3156
3157
|
}
|
|
3157
3158
|
//* Get the country data for the currently selected country.
|
|
3158
3159
|
getSelectedCountryData() {
|
|
@@ -3164,7 +3165,7 @@ class x {
|
|
|
3164
3165
|
const { iso2: t } = this.selectedCountryData;
|
|
3165
3166
|
return u.utils.getValidationError(this._getFullNumber(), t);
|
|
3166
3167
|
}
|
|
3167
|
-
return
|
|
3168
|
+
return W.UNKNOWN_VALIDATION_ERROR;
|
|
3168
3169
|
}
|
|
3169
3170
|
//* Validate the input val using number length only
|
|
3170
3171
|
isValidNumber() {
|
|
@@ -3228,7 +3229,7 @@ class x {
|
|
|
3228
3229
|
this.ui.telInput.disabled = t, t ? this.ui.selectedCountry.setAttribute("disabled", "true") : this.ui.selectedCountry.removeAttribute("disabled");
|
|
3229
3230
|
}
|
|
3230
3231
|
}
|
|
3231
|
-
const
|
|
3232
|
+
const Lt = (l) => {
|
|
3232
3233
|
if (!u.utils && !u.startedLoadingUtilsScript) {
|
|
3233
3234
|
let t;
|
|
3234
3235
|
if (typeof l == "function")
|
|
@@ -3249,28 +3250,28 @@ const Et = (l) => {
|
|
|
3249
3250
|
throw new TypeError(
|
|
3250
3251
|
"The loader function passed to attachUtils did not resolve to a module object with utils as its default export."
|
|
3251
3252
|
);
|
|
3252
|
-
return u.utils = i,
|
|
3253
|
+
return u.utils = i, L("handleUtils"), !0;
|
|
3253
3254
|
}).catch((e) => {
|
|
3254
|
-
throw
|
|
3255
|
+
throw L("rejectUtilsScriptPromise", e), e;
|
|
3255
3256
|
});
|
|
3256
3257
|
}
|
|
3257
3258
|
return null;
|
|
3258
|
-
},
|
|
3259
|
+
}, L = (l, ...t) => {
|
|
3259
3260
|
Object.values(u.instances).forEach((e) => {
|
|
3260
3261
|
const i = e[l];
|
|
3261
3262
|
typeof i == "function" && i.apply(e, t);
|
|
3262
3263
|
});
|
|
3263
3264
|
}, u = Object.assign(
|
|
3264
3265
|
(l, t) => {
|
|
3265
|
-
const e = new
|
|
3266
|
+
const e = new U(l, t);
|
|
3266
3267
|
return u.instances[e.id] = e, l.iti = e, e;
|
|
3267
3268
|
},
|
|
3268
3269
|
{
|
|
3269
|
-
defaults:
|
|
3270
|
+
defaults: z,
|
|
3270
3271
|
//* Using a static var like this allows us to mock it in the tests.
|
|
3271
3272
|
documentReady: () => document.readyState === "complete",
|
|
3272
3273
|
//* Get the country data object.
|
|
3273
|
-
getCountryData: () =>
|
|
3274
|
+
getCountryData: () => E,
|
|
3274
3275
|
//* A getter for the plugin instance.
|
|
3275
3276
|
getInstance: (l) => {
|
|
3276
3277
|
const t = l.dataset.intlTelInputId;
|
|
@@ -3278,14 +3279,14 @@ const Et = (l) => {
|
|
|
3278
3279
|
},
|
|
3279
3280
|
//* A map from instance ID to instance object.
|
|
3280
3281
|
instances: {},
|
|
3281
|
-
attachUtils:
|
|
3282
|
+
attachUtils: Lt,
|
|
3282
3283
|
startedLoadingUtilsScript: !1,
|
|
3283
3284
|
startedLoadingAutoCountry: !1,
|
|
3284
|
-
version: "25.11.
|
|
3285
|
+
version: "25.11.3"
|
|
3285
3286
|
}
|
|
3286
3287
|
), vt = {
|
|
3287
3288
|
__name: "IntlTelInput",
|
|
3288
|
-
props: /* @__PURE__ */
|
|
3289
|
+
props: /* @__PURE__ */ B({
|
|
3289
3290
|
disabled: {
|
|
3290
3291
|
type: Boolean,
|
|
3291
3292
|
default: !1
|
|
@@ -3309,14 +3310,14 @@ const Et = (l) => {
|
|
|
3309
3310
|
},
|
|
3310
3311
|
modelModifiers: {}
|
|
3311
3312
|
}),
|
|
3312
|
-
emits: /* @__PURE__ */
|
|
3313
|
+
emits: /* @__PURE__ */ B([
|
|
3313
3314
|
"changeNumber",
|
|
3314
3315
|
"changeCountry",
|
|
3315
3316
|
"changeValidity",
|
|
3316
3317
|
"changeErrorCode"
|
|
3317
3318
|
], ["update:modelValue"]),
|
|
3318
3319
|
setup(l, { expose: t, emit: e }) {
|
|
3319
|
-
const i =
|
|
3320
|
+
const i = Y(l, "modelValue"), s = l, o = e, n = S(), r = S(), a = S(!1), d = () => r.value ? s.options.strictMode ? r.value.isValidNumberPrecise() : r.value.isValidNumber() : null, c = () => {
|
|
3320
3321
|
let p = d();
|
|
3321
3322
|
a.value !== p && (a.value = p, o("changeValidity", !!p), o(
|
|
3322
3323
|
"changeErrorCode",
|
|
@@ -3329,18 +3330,18 @@ const Et = (l) => {
|
|
|
3329
3330
|
var p;
|
|
3330
3331
|
o("changeCountry", ((p = r.value) == null ? void 0 : p.getSelectedCountryData().iso2) ?? ""), f(), c();
|
|
3331
3332
|
};
|
|
3332
|
-
return
|
|
3333
|
+
return q(() => {
|
|
3333
3334
|
n.value && (r.value = u(n.value, s.options), s.value && r.value.setNumber(s.value), s.disabled && r.value.setDisabled(s.disabled), a.value = d());
|
|
3334
|
-
}),
|
|
3335
|
+
}), X(
|
|
3335
3336
|
() => s.disabled,
|
|
3336
3337
|
(p) => {
|
|
3337
3338
|
var y;
|
|
3338
3339
|
return (y = r.value) == null ? void 0 : y.setDisabled(p);
|
|
3339
3340
|
}
|
|
3340
|
-
),
|
|
3341
|
+
), Q(() => {
|
|
3341
3342
|
var p;
|
|
3342
3343
|
return (p = r.value) == null ? void 0 : p.destroy();
|
|
3343
|
-
}), t({ instance: r, input: n }), (p, y) =>
|
|
3344
|
+
}), t({ instance: r, input: n }), (p, y) => J((tt(), Z("input", et({
|
|
3344
3345
|
ref_key: "input",
|
|
3345
3346
|
ref: n,
|
|
3346
3347
|
"onUpdate:modelValue": y[0] || (y[0] = (w) => i.value = w),
|
|
@@ -3349,7 +3350,7 @@ const Et = (l) => {
|
|
|
3349
3350
|
onInput: f
|
|
3350
3351
|
}, l.inputProps), null, 16)), [
|
|
3351
3352
|
[
|
|
3352
|
-
|
|
3353
|
+
it,
|
|
3353
3354
|
i.value,
|
|
3354
3355
|
void 0,
|
|
3355
3356
|
{ lazy: !0 }
|