intl-tel-input 25.11.0 → 25.11.1
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 +349 -200
- package/angular/build/IntlTelInputWithUtils.js +349 -200
- package/angular/build/types/intl-tel-input/data.d.ts +3 -3
- package/angular/build/types/intl-tel-input.d.ts +5 -1
- package/angular/build/types/modules/constants.d.ts +84 -0
- package/angular/build/types/modules/core/countrySearch.d.ts +17 -0
- package/angular/build/types/modules/core/icons.d.ts +7 -0
- package/angular/build/types/modules/core/options.d.ts +2 -1
- package/angular/build/types/modules/data/country-data.d.ts +5 -5
- package/angular/build/types/modules/format/caret.d.ts +1 -1
- package/angular/build/types/modules/format/formatting.d.ts +2 -2
- package/angular/build/types/modules/types/events.d.ts +5 -4
- package/build/js/data.js +8 -2
- package/build/js/data.min.js +2 -2
- package/build/js/intlTelInput.d.ts +137 -17
- package/build/js/intlTelInput.js +397 -226
- package/build/js/intlTelInput.min.js +13 -13
- package/build/js/intlTelInputWithUtils.js +397 -226
- package/build/js/intlTelInputWithUtils.min.js +13 -13
- package/package.json +2 -1
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +396 -225
- package/react/build/IntlTelInput.d.ts +137 -17
- package/react/build/IntlTelInput.js +396 -225
- package/react/build/IntlTelInputWithUtils.cjs +396 -225
- package/react/build/IntlTelInputWithUtils.js +396 -225
- package/vue/README.md +1 -1
- package/vue/build/IntlTelInput.mjs +514 -390
- package/vue/build/IntlTelInputWithUtils.mjs +923 -799
package/build/js/intlTelInput.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* International Telephone Input v25.11.
|
|
2
|
+
* International Telephone Input v25.11.1
|
|
3
3
|
* https://github.com/jackocnr/intl-tel-input.git
|
|
4
4
|
* Licensed under the MIT license
|
|
5
5
|
*/
|
|
@@ -1729,7 +1729,13 @@ var factoryOutput = (() => {
|
|
|
1729
1729
|
areaCodes: c[3] || null,
|
|
1730
1730
|
nodeById: {},
|
|
1731
1731
|
// populated by the plugin
|
|
1732
|
-
nationalPrefix: c[4] || null
|
|
1732
|
+
nationalPrefix: c[4] || null,
|
|
1733
|
+
normalisedName: "",
|
|
1734
|
+
// populated in the plugin
|
|
1735
|
+
initials: "",
|
|
1736
|
+
// populated in the plugin
|
|
1737
|
+
dialCodePlus: ""
|
|
1738
|
+
// populated in the plugin
|
|
1733
1739
|
});
|
|
1734
1740
|
}
|
|
1735
1741
|
var data_default = allCountries;
|
|
@@ -2001,13 +2007,111 @@ var factoryOutput = (() => {
|
|
|
2001
2007
|
var allTranslations = { ...countries_default, ...interface_default };
|
|
2002
2008
|
var en_default = allTranslations;
|
|
2003
2009
|
|
|
2004
|
-
// src/js/modules/
|
|
2005
|
-
var
|
|
2006
|
-
|
|
2010
|
+
// src/js/modules/constants.ts
|
|
2011
|
+
var EVENTS = {
|
|
2012
|
+
OPEN_COUNTRY_DROPDOWN: "open:countrydropdown",
|
|
2013
|
+
CLOSE_COUNTRY_DROPDOWN: "close:countrydropdown",
|
|
2014
|
+
COUNTRY_CHANGE: "countrychange",
|
|
2015
|
+
INPUT: "input"
|
|
2016
|
+
// used for synthetic input trigger
|
|
2017
|
+
};
|
|
2018
|
+
var CLASSES = {
|
|
2019
|
+
HIDE: "iti__hide",
|
|
2020
|
+
V_HIDE: "iti__v-hide",
|
|
2021
|
+
ARROW_UP: "iti__arrow--up",
|
|
2022
|
+
GLOBE: "iti__globe",
|
|
2023
|
+
FLAG: "iti__flag",
|
|
2024
|
+
COUNTRY_ITEM: "iti__country",
|
|
2025
|
+
HIGHLIGHT: "iti__highlight"
|
|
2026
|
+
};
|
|
2027
|
+
var KEYS = {
|
|
2028
|
+
ARROW_UP: "ArrowUp",
|
|
2029
|
+
ARROW_DOWN: "ArrowDown",
|
|
2030
|
+
SPACE: " ",
|
|
2031
|
+
ENTER: "Enter",
|
|
2032
|
+
ESC: "Escape",
|
|
2033
|
+
TAB: "Tab"
|
|
2034
|
+
};
|
|
2035
|
+
var INPUT_TYPES = {
|
|
2036
|
+
PASTE: "insertFromPaste",
|
|
2037
|
+
DELETE_FWD: "deleteContentForward"
|
|
2038
|
+
};
|
|
2039
|
+
var REGEX = {
|
|
2040
|
+
ALPHA_UNICODE: /\p{L}/u,
|
|
2041
|
+
// any kind of letter from any language
|
|
2042
|
+
NON_PLUS_NUMERIC: /[^+0-9]/,
|
|
2043
|
+
// chars that are NOT + or digit
|
|
2044
|
+
NON_PLUS_NUMERIC_GLOBAL: /[^+0-9]/g,
|
|
2045
|
+
// chars that are NOT + or digit (global)
|
|
2046
|
+
HIDDEN_SEARCH_CHAR: /^[a-zA-ZÀ-ÿа-яА-Я ]$/
|
|
2047
|
+
// single acceptable hidden-search char
|
|
2048
|
+
};
|
|
2049
|
+
var TIMINGS = {
|
|
2050
|
+
SEARCH_DEBOUNCE_MS: 100,
|
|
2051
|
+
HIDDEN_SEARCH_RESET_MS: 1e3,
|
|
2052
|
+
NEXT_TICK: 0
|
|
2053
|
+
};
|
|
2054
|
+
var SENTINELS = {
|
|
2055
|
+
UNKNOWN_NUMBER_TYPE: -99,
|
|
2056
|
+
UNKNOWN_VALIDATION_ERROR: -99
|
|
2057
|
+
};
|
|
2058
|
+
var LAYOUT = {
|
|
2059
|
+
SANE_SELECTED_WITH_DIAL_WIDTH: 78,
|
|
2060
|
+
// px width fallback when separateDialCode enabled
|
|
2061
|
+
SANE_SELECTED_NO_DIAL_WIDTH: 42,
|
|
2062
|
+
// px width fallback when no separate dial code
|
|
2063
|
+
INPUT_PADDING_EXTRA_LEFT: 6
|
|
2064
|
+
// px gap between selected country container and input text
|
|
2065
|
+
};
|
|
2066
|
+
var DIAL = {
|
|
2067
|
+
PLUS: "+",
|
|
2068
|
+
NANP: "1"
|
|
2069
|
+
// North American Numbering Plan
|
|
2070
|
+
};
|
|
2071
|
+
var UK = {
|
|
2072
|
+
ISO2: "gb",
|
|
2073
|
+
DIAL_CODE: "44",
|
|
2074
|
+
// +44 United Kingdom
|
|
2075
|
+
MOBILE_PREFIX: "7",
|
|
2076
|
+
// UK mobile numbers start with 7 after national trunk (0) or core section
|
|
2077
|
+
MOBILE_CORE_LENGTH: 10
|
|
2078
|
+
// core number length (excluding dial code / national prefix) for mobiles
|
|
2079
|
+
};
|
|
2080
|
+
var US = {
|
|
2081
|
+
ISO2: "us",
|
|
2082
|
+
DIAL_CODE: "1"
|
|
2083
|
+
// +1 United States
|
|
2084
|
+
};
|
|
2085
|
+
var PLACEHOLDER_MODES = {
|
|
2086
|
+
AGGRESSIVE: "aggressive",
|
|
2087
|
+
POLITE: "polite"
|
|
2007
2088
|
};
|
|
2089
|
+
var INITIAL_COUNTRY = {
|
|
2090
|
+
AUTO: "auto"
|
|
2091
|
+
};
|
|
2092
|
+
var DATA_KEYS = {
|
|
2093
|
+
COUNTRY_CODE: "countryCode",
|
|
2094
|
+
DIAL_CODE: "dialCode"
|
|
2095
|
+
};
|
|
2096
|
+
var ARIA = {
|
|
2097
|
+
EXPANDED: "aria-expanded",
|
|
2098
|
+
LABEL: "aria-label",
|
|
2099
|
+
SELECTED: "aria-selected",
|
|
2100
|
+
ACTIVE_DESCENDANT: "aria-activedescendant",
|
|
2101
|
+
HASPOPUP: "aria-haspopup",
|
|
2102
|
+
CONTROLS: "aria-controls",
|
|
2103
|
+
HIDDEN: "aria-hidden",
|
|
2104
|
+
AUTOCOMPLETE: "aria-autocomplete",
|
|
2105
|
+
MODAL: "aria-modal"
|
|
2106
|
+
};
|
|
2107
|
+
|
|
2108
|
+
// src/js/modules/core/options.ts
|
|
2109
|
+
var mq = (q) => typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia(q).matches;
|
|
2008
2110
|
var computeDefaultUseFullscreenPopup = () => {
|
|
2009
2111
|
if (typeof navigator !== "undefined" && typeof window !== "undefined") {
|
|
2010
|
-
const isMobileUserAgent = /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
|
2112
|
+
const isMobileUserAgent = /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
|
2113
|
+
navigator.userAgent
|
|
2114
|
+
);
|
|
2011
2115
|
const isNarrowViewport = mq("(max-width: 500px)");
|
|
2012
2116
|
const isShortViewport = mq("(max-height: 600px)");
|
|
2013
2117
|
const isCoarsePointer = mq("(pointer: coarse)");
|
|
@@ -2021,7 +2125,7 @@ var factoryOutput = (() => {
|
|
|
2021
2125
|
//* Whether or not to allow the dropdown.
|
|
2022
2126
|
allowDropdown: true,
|
|
2023
2127
|
//* Add a placeholder in the input with an example number for the selected country.
|
|
2024
|
-
autoPlaceholder:
|
|
2128
|
+
autoPlaceholder: PLACEHOLDER_MODES.POLITE,
|
|
2025
2129
|
//* Modify the parentClass.
|
|
2026
2130
|
containerClass: "",
|
|
2027
2131
|
//* The order of the countries in the dropdown. Defaults to alphabetical.
|
|
@@ -2067,7 +2171,7 @@ var factoryOutput = (() => {
|
|
|
2067
2171
|
//* The number type to enforce during validation.
|
|
2068
2172
|
validationNumberTypes: ["MOBILE"]
|
|
2069
2173
|
};
|
|
2070
|
-
|
|
2174
|
+
var applyOptionSideEffects = (o, defaultEnglishStrings) => {
|
|
2071
2175
|
if (o.useFullscreenPopup) {
|
|
2072
2176
|
o.fixDropdownWidth = false;
|
|
2073
2177
|
}
|
|
@@ -2083,19 +2187,66 @@ var factoryOutput = (() => {
|
|
|
2083
2187
|
if (o.useFullscreenPopup && !o.dropdownContainer) {
|
|
2084
2188
|
o.dropdownContainer = document.body;
|
|
2085
2189
|
}
|
|
2086
|
-
o.i18n = { ...
|
|
2087
|
-
}
|
|
2190
|
+
o.i18n = { ...defaultEnglishStrings, ...o.i18n };
|
|
2191
|
+
};
|
|
2088
2192
|
|
|
2089
2193
|
// src/js/modules/utils/string.ts
|
|
2090
2194
|
var getNumeric = (s) => s.replace(/\D/g, "");
|
|
2091
2195
|
var normaliseString = (s = "") => s.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
|
|
2092
2196
|
|
|
2197
|
+
// src/js/modules/core/countrySearch.ts
|
|
2198
|
+
var getMatchedCountries = (countries, query) => {
|
|
2199
|
+
const normalisedQuery = normaliseString(query);
|
|
2200
|
+
const iso2Matches = [];
|
|
2201
|
+
const nameStartWith = [];
|
|
2202
|
+
const nameContains = [];
|
|
2203
|
+
const dialCodeMatches = [];
|
|
2204
|
+
const dialCodeContains = [];
|
|
2205
|
+
const initialsMatches = [];
|
|
2206
|
+
for (const c of countries) {
|
|
2207
|
+
if (c.iso2 === normalisedQuery) {
|
|
2208
|
+
iso2Matches.push(c);
|
|
2209
|
+
} else if (c.normalisedName.startsWith(normalisedQuery)) {
|
|
2210
|
+
nameStartWith.push(c);
|
|
2211
|
+
} else if (c.normalisedName.includes(normalisedQuery)) {
|
|
2212
|
+
nameContains.push(c);
|
|
2213
|
+
} else if (normalisedQuery === c.dialCode || normalisedQuery === c.dialCodePlus) {
|
|
2214
|
+
dialCodeMatches.push(c);
|
|
2215
|
+
} else if (c.dialCodePlus.includes(normalisedQuery)) {
|
|
2216
|
+
dialCodeContains.push(c);
|
|
2217
|
+
} else if (c.initials.includes(normalisedQuery)) {
|
|
2218
|
+
initialsMatches.push(c);
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
const sortByPriority = (a, b) => a.priority - b.priority;
|
|
2222
|
+
return [
|
|
2223
|
+
...iso2Matches.sort(sortByPriority),
|
|
2224
|
+
...nameStartWith.sort(sortByPriority),
|
|
2225
|
+
...nameContains.sort(sortByPriority),
|
|
2226
|
+
...dialCodeMatches.sort(sortByPriority),
|
|
2227
|
+
...dialCodeContains.sort(sortByPriority),
|
|
2228
|
+
...initialsMatches.sort(sortByPriority)
|
|
2229
|
+
];
|
|
2230
|
+
};
|
|
2231
|
+
var findFirstCountryStartingWith = (countries, query) => {
|
|
2232
|
+
const lowerQuery = query.toLowerCase();
|
|
2233
|
+
for (const c of countries) {
|
|
2234
|
+
const lowerName = c.name.toLowerCase();
|
|
2235
|
+
if (lowerName.startsWith(lowerQuery)) {
|
|
2236
|
+
return c;
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
return null;
|
|
2240
|
+
};
|
|
2241
|
+
|
|
2093
2242
|
// src/js/modules/utils/dom.ts
|
|
2094
2243
|
var buildClassNames = (flags) => Object.keys(flags).filter((k) => Boolean(flags[k])).join(" ");
|
|
2095
2244
|
var createEl = (tagName, attrs, container) => {
|
|
2096
2245
|
const el = document.createElement(tagName);
|
|
2097
2246
|
if (attrs) {
|
|
2098
|
-
Object.entries(attrs).forEach(
|
|
2247
|
+
Object.entries(attrs).forEach(
|
|
2248
|
+
([key, value]) => el.setAttribute(key, value)
|
|
2249
|
+
);
|
|
2099
2250
|
}
|
|
2100
2251
|
if (container) {
|
|
2101
2252
|
container.appendChild(el);
|
|
@@ -2103,6 +2254,24 @@ var factoryOutput = (() => {
|
|
|
2103
2254
|
return el;
|
|
2104
2255
|
};
|
|
2105
2256
|
|
|
2257
|
+
// src/js/modules/core/icons.ts
|
|
2258
|
+
var buildSearchIcon = () => `
|
|
2259
|
+
<svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${ARIA.HIDDEN}="true">
|
|
2260
|
+
<circle cx="11" cy="11" r="7" />
|
|
2261
|
+
<line x1="21" y1="21" x2="16.65" y2="16.65" />
|
|
2262
|
+
</svg>`;
|
|
2263
|
+
var buildClearIcon = (id2) => {
|
|
2264
|
+
const maskId = `iti-${id2}-clear-mask`;
|
|
2265
|
+
return `
|
|
2266
|
+
<svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" ${ARIA.HIDDEN}="true" focusable="false">
|
|
2267
|
+
<mask id="${maskId}" maskUnits="userSpaceOnUse">
|
|
2268
|
+
<rect width="16" height="16" fill="white" />
|
|
2269
|
+
<path d="M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8" stroke="black" stroke-linecap="round" class="iti__search-clear-x" />
|
|
2270
|
+
</mask>
|
|
2271
|
+
<circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${maskId})" />
|
|
2272
|
+
</svg>`;
|
|
2273
|
+
};
|
|
2274
|
+
|
|
2106
2275
|
// src/js/modules/core/ui.ts
|
|
2107
2276
|
var UI = class {
|
|
2108
2277
|
constructor(input, options, id2) {
|
|
@@ -2134,12 +2303,7 @@ var factoryOutput = (() => {
|
|
|
2134
2303
|
}
|
|
2135
2304
|
}
|
|
2136
2305
|
_createWrapperAndInsert() {
|
|
2137
|
-
const {
|
|
2138
|
-
allowDropdown,
|
|
2139
|
-
showFlags,
|
|
2140
|
-
containerClass,
|
|
2141
|
-
useFullscreenPopup
|
|
2142
|
-
} = this.options;
|
|
2306
|
+
const { allowDropdown, showFlags, containerClass, useFullscreenPopup } = this.options;
|
|
2143
2307
|
const parentClasses = buildClassNames({
|
|
2144
2308
|
iti: true,
|
|
2145
2309
|
"iti--allow-dropdown": allowDropdown,
|
|
@@ -2160,7 +2324,7 @@ var factoryOutput = (() => {
|
|
|
2160
2324
|
this.countryContainer = createEl(
|
|
2161
2325
|
"div",
|
|
2162
2326
|
// visibly hidden until we measure it's width to set the input padding correctly
|
|
2163
|
-
{ class:
|
|
2327
|
+
{ class: `iti__country-container ${CLASSES.V_HIDE}` },
|
|
2164
2328
|
wrapper
|
|
2165
2329
|
);
|
|
2166
2330
|
if (allowDropdown) {
|
|
@@ -2169,10 +2333,10 @@ var factoryOutput = (() => {
|
|
|
2169
2333
|
{
|
|
2170
2334
|
type: "button",
|
|
2171
2335
|
class: "iti__selected-country",
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2336
|
+
[ARIA.EXPANDED]: "false",
|
|
2337
|
+
[ARIA.LABEL]: this.options.i18n.noCountrySelected,
|
|
2338
|
+
[ARIA.HASPOPUP]: "dialog",
|
|
2339
|
+
[ARIA.CONTROLS]: `iti-${this.id}__dropdown-content`
|
|
2176
2340
|
},
|
|
2177
2341
|
this.countryContainer
|
|
2178
2342
|
);
|
|
@@ -2193,13 +2357,13 @@ var factoryOutput = (() => {
|
|
|
2193
2357
|
);
|
|
2194
2358
|
this.selectedCountryInner = createEl(
|
|
2195
2359
|
"div",
|
|
2196
|
-
{ class:
|
|
2360
|
+
{ class: CLASSES.FLAG },
|
|
2197
2361
|
selectedCountryPrimary
|
|
2198
2362
|
);
|
|
2199
2363
|
if (allowDropdown) {
|
|
2200
2364
|
this.dropdownArrow = createEl(
|
|
2201
2365
|
"div",
|
|
2202
|
-
{ class: "iti__arrow",
|
|
2366
|
+
{ class: "iti__arrow", [ARIA.HIDDEN]: "true" },
|
|
2203
2367
|
selectedCountryPrimary
|
|
2204
2368
|
);
|
|
2205
2369
|
}
|
|
@@ -2227,9 +2391,9 @@ var factoryOutput = (() => {
|
|
|
2227
2391
|
const extraClasses = fixDropdownWidth ? "" : "iti--flexible-dropdown-width";
|
|
2228
2392
|
this.dropdownContent = createEl("div", {
|
|
2229
2393
|
id: `iti-${this.id}__dropdown-content`,
|
|
2230
|
-
class: `iti__dropdown-content
|
|
2394
|
+
class: `iti__dropdown-content ${CLASSES.HIDE} ${extraClasses}`,
|
|
2231
2395
|
role: "dialog",
|
|
2232
|
-
|
|
2396
|
+
[ARIA.MODAL]: "true"
|
|
2233
2397
|
});
|
|
2234
2398
|
if (this.isRTL) {
|
|
2235
2399
|
this.dropdownContent.setAttribute("dir", "rtl");
|
|
@@ -2243,12 +2407,12 @@ var factoryOutput = (() => {
|
|
|
2243
2407
|
class: "iti__country-list",
|
|
2244
2408
|
id: `iti-${this.id}__country-listbox`,
|
|
2245
2409
|
role: "listbox",
|
|
2246
|
-
|
|
2410
|
+
[ARIA.LABEL]: i18n.countryListAriaLabel
|
|
2247
2411
|
},
|
|
2248
2412
|
this.dropdownContent
|
|
2249
2413
|
);
|
|
2250
2414
|
this._appendListItems();
|
|
2251
|
-
if (
|
|
2415
|
+
if (countrySearch) {
|
|
2252
2416
|
this.updateSearchResultsA11yText();
|
|
2253
2417
|
}
|
|
2254
2418
|
if (dropdownContainer) {
|
|
@@ -2276,15 +2440,11 @@ var factoryOutput = (() => {
|
|
|
2276
2440
|
"span",
|
|
2277
2441
|
{
|
|
2278
2442
|
class: "iti__search-icon",
|
|
2279
|
-
|
|
2443
|
+
[ARIA.HIDDEN]: "true"
|
|
2280
2444
|
},
|
|
2281
2445
|
searchWrapper
|
|
2282
2446
|
);
|
|
2283
|
-
this.searchIcon.innerHTML =
|
|
2284
|
-
<svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" aria-hidden="true">
|
|
2285
|
-
<circle cx="11" cy="11" r="7" />
|
|
2286
|
-
<line x1="21" y1="21" x2="16.65" y2="16.65" />
|
|
2287
|
-
</svg>`;
|
|
2447
|
+
this.searchIcon.innerHTML = buildSearchIcon();
|
|
2288
2448
|
this.searchInput = createEl(
|
|
2289
2449
|
"input",
|
|
2290
2450
|
{
|
|
@@ -2295,10 +2455,10 @@ var factoryOutput = (() => {
|
|
|
2295
2455
|
placeholder: i18n.searchPlaceholder,
|
|
2296
2456
|
// role=combobox + aria-autocomplete=list + aria-activedescendant allows maintaining focus on the search input while allowing users to navigate search results with up/down keyboard keys
|
|
2297
2457
|
role: "combobox",
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2458
|
+
[ARIA.EXPANDED]: "true",
|
|
2459
|
+
[ARIA.LABEL]: i18n.searchPlaceholder,
|
|
2460
|
+
[ARIA.CONTROLS]: `iti-${this.id}__country-listbox`,
|
|
2461
|
+
[ARIA.AUTOCOMPLETE]: "list",
|
|
2302
2462
|
autocomplete: "off"
|
|
2303
2463
|
},
|
|
2304
2464
|
searchWrapper
|
|
@@ -2307,21 +2467,13 @@ var factoryOutput = (() => {
|
|
|
2307
2467
|
"button",
|
|
2308
2468
|
{
|
|
2309
2469
|
type: "button",
|
|
2310
|
-
class:
|
|
2311
|
-
|
|
2470
|
+
class: `iti__search-clear ${CLASSES.HIDE}`,
|
|
2471
|
+
[ARIA.LABEL]: i18n.clearSearchAriaLabel,
|
|
2312
2472
|
tabindex: "-1"
|
|
2313
2473
|
},
|
|
2314
2474
|
searchWrapper
|
|
2315
2475
|
);
|
|
2316
|
-
|
|
2317
|
-
this.searchClearButton.innerHTML = `
|
|
2318
|
-
<svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" aria-hidden="true" focusable="false">
|
|
2319
|
-
<mask id="${maskId}" maskUnits="userSpaceOnUse">
|
|
2320
|
-
<rect width="16" height="16" fill="white" />
|
|
2321
|
-
<path d="M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8" stroke="black" stroke-linecap="round" class="iti__search-clear-x" />
|
|
2322
|
-
</mask>
|
|
2323
|
-
<circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${maskId})" />
|
|
2324
|
-
</svg>`;
|
|
2476
|
+
this.searchClearButton.innerHTML = buildClearIcon(this.id);
|
|
2325
2477
|
this.searchResultsA11yText = createEl(
|
|
2326
2478
|
"span",
|
|
2327
2479
|
{ class: "iti__a11y-text" },
|
|
@@ -2330,8 +2482,8 @@ var factoryOutput = (() => {
|
|
|
2330
2482
|
this.searchNoResults = createEl(
|
|
2331
2483
|
"div",
|
|
2332
2484
|
{
|
|
2333
|
-
class:
|
|
2334
|
-
|
|
2485
|
+
class: `iti__no-results ${CLASSES.HIDE}`,
|
|
2486
|
+
[ARIA.HIDDEN]: "true"
|
|
2335
2487
|
// all a11y messaging happens in this.searchResultsA11yText
|
|
2336
2488
|
},
|
|
2337
2489
|
this.dropdownContent
|
|
@@ -2341,7 +2493,7 @@ var factoryOutput = (() => {
|
|
|
2341
2493
|
_maybeUpdateInputPaddingAndReveal() {
|
|
2342
2494
|
if (this.countryContainer) {
|
|
2343
2495
|
this.updateInputPadding();
|
|
2344
|
-
this.countryContainer.classList.remove(
|
|
2496
|
+
this.countryContainer.classList.remove(CLASSES.V_HIDE);
|
|
2345
2497
|
}
|
|
2346
2498
|
}
|
|
2347
2499
|
_maybeBuildHiddenInputs(wrapper) {
|
|
@@ -2385,21 +2537,21 @@ var factoryOutput = (() => {
|
|
|
2385
2537
|
for (let i = 0; i < this.countries.length; i++) {
|
|
2386
2538
|
const c = this.countries[i];
|
|
2387
2539
|
const liClass = buildClassNames({
|
|
2388
|
-
|
|
2389
|
-
|
|
2540
|
+
[CLASSES.COUNTRY_ITEM]: true,
|
|
2541
|
+
[CLASSES.HIGHLIGHT]: i === 0
|
|
2390
2542
|
});
|
|
2391
2543
|
const listItem = createEl("li", {
|
|
2392
2544
|
id: `iti-${this.id}__item-${c.iso2}`,
|
|
2393
2545
|
class: liClass,
|
|
2394
2546
|
tabindex: "-1",
|
|
2395
2547
|
role: "option",
|
|
2396
|
-
|
|
2548
|
+
[ARIA.SELECTED]: "false"
|
|
2397
2549
|
});
|
|
2398
2550
|
listItem.dataset.dialCode = c.dialCode;
|
|
2399
2551
|
listItem.dataset.countryCode = c.iso2;
|
|
2400
2552
|
c.nodeById[this.id] = listItem;
|
|
2401
2553
|
if (this.options.showFlags) {
|
|
2402
|
-
createEl("div", { class:
|
|
2554
|
+
createEl("div", { class: `${CLASSES.FLAG} iti__${c.iso2}` }, listItem);
|
|
2403
2555
|
}
|
|
2404
2556
|
const nameEl = createEl("span", { class: "iti__country-name" }, listItem);
|
|
2405
2557
|
nameEl.textContent = c.name;
|
|
@@ -2415,9 +2567,9 @@ var factoryOutput = (() => {
|
|
|
2415
2567
|
//* Update the input padding to make space for the selected country/dial code.
|
|
2416
2568
|
updateInputPadding() {
|
|
2417
2569
|
if (this.selectedCountry) {
|
|
2418
|
-
const
|
|
2419
|
-
const selectedCountryWidth = this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth() ||
|
|
2420
|
-
const inputPadding = selectedCountryWidth +
|
|
2570
|
+
const fallbackWidth = this.options.separateDialCode ? LAYOUT.SANE_SELECTED_WITH_DIAL_WIDTH : LAYOUT.SANE_SELECTED_NO_DIAL_WIDTH;
|
|
2571
|
+
const selectedCountryWidth = this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth() || fallbackWidth;
|
|
2572
|
+
const inputPadding = selectedCountryWidth + LAYOUT.INPUT_PADDING_EXTRA_LEFT;
|
|
2421
2573
|
this.telInput.style.paddingLeft = `${inputPadding}px`;
|
|
2422
2574
|
}
|
|
2423
2575
|
}
|
|
@@ -2493,19 +2645,16 @@ var factoryOutput = (() => {
|
|
|
2493
2645
|
highlightListItem(listItem, shouldFocus) {
|
|
2494
2646
|
const prevItem = this.highlightedItem;
|
|
2495
2647
|
if (prevItem) {
|
|
2496
|
-
prevItem.classList.remove(
|
|
2497
|
-
prevItem.setAttribute(
|
|
2648
|
+
prevItem.classList.remove(CLASSES.HIGHLIGHT);
|
|
2649
|
+
prevItem.setAttribute(ARIA.SELECTED, "false");
|
|
2498
2650
|
}
|
|
2499
2651
|
this.highlightedItem = listItem;
|
|
2500
2652
|
if (this.highlightedItem) {
|
|
2501
|
-
this.highlightedItem.classList.add(
|
|
2502
|
-
this.highlightedItem.setAttribute(
|
|
2653
|
+
this.highlightedItem.classList.add(CLASSES.HIGHLIGHT);
|
|
2654
|
+
this.highlightedItem.setAttribute(ARIA.SELECTED, "true");
|
|
2503
2655
|
if (this.options.countrySearch) {
|
|
2504
2656
|
const activeDescendant = this.highlightedItem.getAttribute("id") || "";
|
|
2505
|
-
this.searchInput.setAttribute(
|
|
2506
|
-
"aria-activedescendant",
|
|
2507
|
-
activeDescendant
|
|
2508
|
-
);
|
|
2657
|
+
this.searchInput.setAttribute(ARIA.ACTIVE_DESCENDANT, activeDescendant);
|
|
2509
2658
|
}
|
|
2510
2659
|
}
|
|
2511
2660
|
if (shouldFocus) {
|
|
@@ -2529,10 +2678,10 @@ var factoryOutput = (() => {
|
|
|
2529
2678
|
if (noCountriesAddedYet) {
|
|
2530
2679
|
this.highlightListItem(null, false);
|
|
2531
2680
|
if (this.searchNoResults) {
|
|
2532
|
-
this.searchNoResults.classList.remove(
|
|
2681
|
+
this.searchNoResults.classList.remove(CLASSES.HIDE);
|
|
2533
2682
|
}
|
|
2534
2683
|
} else if (this.searchNoResults) {
|
|
2535
|
-
this.searchNoResults.classList.add(
|
|
2684
|
+
this.searchNoResults.classList.add(CLASSES.HIDE);
|
|
2536
2685
|
}
|
|
2537
2686
|
this.countryList.scrollTop = 0;
|
|
2538
2687
|
this.updateSearchResultsA11yText();
|
|
@@ -2571,26 +2720,34 @@ var factoryOutput = (() => {
|
|
|
2571
2720
|
};
|
|
2572
2721
|
|
|
2573
2722
|
// src/js/modules/data/country-data.ts
|
|
2574
|
-
|
|
2723
|
+
var processAllCountries = (options) => {
|
|
2575
2724
|
const { onlyCountries, excludeCountries } = options;
|
|
2576
2725
|
if (onlyCountries.length) {
|
|
2577
|
-
const lowerCaseOnlyCountries = onlyCountries.map(
|
|
2578
|
-
|
|
2726
|
+
const lowerCaseOnlyCountries = onlyCountries.map(
|
|
2727
|
+
(country) => country.toLowerCase()
|
|
2728
|
+
);
|
|
2729
|
+
return data_default.filter(
|
|
2730
|
+
(country) => lowerCaseOnlyCountries.includes(country.iso2)
|
|
2731
|
+
);
|
|
2579
2732
|
} else if (excludeCountries.length) {
|
|
2580
|
-
const lowerCaseExcludeCountries = excludeCountries.map(
|
|
2581
|
-
|
|
2733
|
+
const lowerCaseExcludeCountries = excludeCountries.map(
|
|
2734
|
+
(country) => country.toLowerCase()
|
|
2735
|
+
);
|
|
2736
|
+
return data_default.filter(
|
|
2737
|
+
(country) => !lowerCaseExcludeCountries.includes(country.iso2)
|
|
2738
|
+
);
|
|
2582
2739
|
}
|
|
2583
2740
|
return data_default;
|
|
2584
|
-
}
|
|
2585
|
-
|
|
2741
|
+
};
|
|
2742
|
+
var translateCountryNames = (countries, options) => {
|
|
2586
2743
|
for (const c of countries) {
|
|
2587
2744
|
const iso2 = c.iso2.toLowerCase();
|
|
2588
2745
|
if (options.i18n[iso2]) {
|
|
2589
2746
|
c.name = options.i18n[iso2];
|
|
2590
2747
|
}
|
|
2591
2748
|
}
|
|
2592
|
-
}
|
|
2593
|
-
|
|
2749
|
+
};
|
|
2750
|
+
var processDialCodes = (countries, options) => {
|
|
2594
2751
|
const dialCodes = /* @__PURE__ */ new Set();
|
|
2595
2752
|
let dialCodeMaxLen = 0;
|
|
2596
2753
|
const dialCodeToIso2Map = {};
|
|
@@ -2641,10 +2798,12 @@ var factoryOutput = (() => {
|
|
|
2641
2798
|
}
|
|
2642
2799
|
}
|
|
2643
2800
|
return { dialCodes, dialCodeMaxLen, dialCodeToIso2Map };
|
|
2644
|
-
}
|
|
2645
|
-
|
|
2801
|
+
};
|
|
2802
|
+
var sortCountries = (countries, options) => {
|
|
2646
2803
|
if (options.countryOrder) {
|
|
2647
|
-
options.countryOrder = options.countryOrder.map(
|
|
2804
|
+
options.countryOrder = options.countryOrder.map(
|
|
2805
|
+
(iso2) => iso2.toLowerCase()
|
|
2806
|
+
);
|
|
2648
2807
|
}
|
|
2649
2808
|
countries.sort((a, b) => {
|
|
2650
2809
|
const { countryOrder } = options;
|
|
@@ -2662,17 +2821,17 @@ var factoryOutput = (() => {
|
|
|
2662
2821
|
}
|
|
2663
2822
|
return a.name.localeCompare(b.name);
|
|
2664
2823
|
});
|
|
2665
|
-
}
|
|
2666
|
-
|
|
2824
|
+
};
|
|
2825
|
+
var cacheSearchTokens = (countries) => {
|
|
2667
2826
|
for (const c of countries) {
|
|
2668
2827
|
c.normalisedName = normaliseString(c.name);
|
|
2669
|
-
c.initials = c.
|
|
2828
|
+
c.initials = c.normalisedName.split(/[^a-z]/).map((word) => word[0]).join("");
|
|
2670
2829
|
c.dialCodePlus = `+${c.dialCode}`;
|
|
2671
2830
|
}
|
|
2672
|
-
}
|
|
2831
|
+
};
|
|
2673
2832
|
|
|
2674
2833
|
// src/js/modules/format/formatting.ts
|
|
2675
|
-
|
|
2834
|
+
var beforeSetNumber = (fullNumber, dialCode, separateDialCode, selectedCountryData) => {
|
|
2676
2835
|
let number = fullNumber;
|
|
2677
2836
|
if (separateDialCode) {
|
|
2678
2837
|
if (dialCode) {
|
|
@@ -2682,8 +2841,8 @@ var factoryOutput = (() => {
|
|
|
2682
2841
|
}
|
|
2683
2842
|
}
|
|
2684
2843
|
return number;
|
|
2685
|
-
}
|
|
2686
|
-
|
|
2844
|
+
};
|
|
2845
|
+
var formatNumberAsYouType = (fullNumber, telInputValue, utils, selectedCountryData, separateDialCode) => {
|
|
2687
2846
|
const result = utils ? utils.formatNumberAsYouType(fullNumber, selectedCountryData.iso2) : fullNumber;
|
|
2688
2847
|
const { dialCode } = selectedCountryData;
|
|
2689
2848
|
if (separateDialCode && telInputValue.charAt(0) !== "+" && result.includes(`+${dialCode}`)) {
|
|
@@ -2691,10 +2850,10 @@ var factoryOutput = (() => {
|
|
|
2691
2850
|
return afterDialCode.trim();
|
|
2692
2851
|
}
|
|
2693
2852
|
return result;
|
|
2694
|
-
}
|
|
2853
|
+
};
|
|
2695
2854
|
|
|
2696
2855
|
// src/js/modules/format/caret.ts
|
|
2697
|
-
|
|
2856
|
+
var translateCursorPosition = (relevantChars, formattedValue, prevCaretPos, isDeleteForwards) => {
|
|
2698
2857
|
if (prevCaretPos === 0 && !isDeleteForwards) {
|
|
2699
2858
|
return 0;
|
|
2700
2859
|
}
|
|
@@ -2711,7 +2870,7 @@ var factoryOutput = (() => {
|
|
|
2711
2870
|
}
|
|
2712
2871
|
}
|
|
2713
2872
|
return formattedValue.length;
|
|
2714
|
-
}
|
|
2873
|
+
};
|
|
2715
2874
|
|
|
2716
2875
|
// src/js/modules/data/nanp-regionless.ts
|
|
2717
2876
|
var regionlessNanpNumbers = [
|
|
@@ -2735,7 +2894,7 @@ var factoryOutput = (() => {
|
|
|
2735
2894
|
];
|
|
2736
2895
|
var isRegionlessNanp = (number) => {
|
|
2737
2896
|
const numeric = getNumeric(number);
|
|
2738
|
-
if (numeric.
|
|
2897
|
+
if (numeric.startsWith(DIAL.NANP) && numeric.length >= 4) {
|
|
2739
2898
|
const areaCode = numeric.substring(1, 4);
|
|
2740
2899
|
return regionlessNanpNumbers.includes(areaCode);
|
|
2741
2900
|
}
|
|
@@ -2744,7 +2903,7 @@ var factoryOutput = (() => {
|
|
|
2744
2903
|
|
|
2745
2904
|
// src/js/intl-tel-input.ts
|
|
2746
2905
|
for (const c of data_default) {
|
|
2747
|
-
c.name =
|
|
2906
|
+
c.name = en_default[c.iso2];
|
|
2748
2907
|
}
|
|
2749
2908
|
var id = 0;
|
|
2750
2909
|
var iso2Set = new Set(data_default.map((c) => c.iso2));
|
|
@@ -2753,7 +2912,7 @@ var factoryOutput = (() => {
|
|
|
2753
2912
|
constructor(input, customOptions = {}) {
|
|
2754
2913
|
this.id = id++;
|
|
2755
2914
|
this.options = { ...defaults, ...customOptions };
|
|
2756
|
-
applyOptionSideEffects(this.options);
|
|
2915
|
+
applyOptionSideEffects(this.options, en_default);
|
|
2757
2916
|
this.ui = new UI(input, this.options, this.id);
|
|
2758
2917
|
this.isAndroid = _Iti._getIsAndroid();
|
|
2759
2918
|
this.promise = this._createInitPromises();
|
|
@@ -2812,7 +2971,7 @@ var factoryOutput = (() => {
|
|
|
2812
2971
|
const dialCode = this._getDialCode(val);
|
|
2813
2972
|
const isRegionlessNanpNumber = isRegionlessNanp(val);
|
|
2814
2973
|
const { initialCountry, geoIpLookup } = this.options;
|
|
2815
|
-
const isAutoCountry = initialCountry ===
|
|
2974
|
+
const isAutoCountry = initialCountry === INITIAL_COUNTRY.AUTO && geoIpLookup;
|
|
2816
2975
|
if (dialCode && !isRegionlessNanpNumber) {
|
|
2817
2976
|
this._updateCountryFromNumber(val);
|
|
2818
2977
|
} else if (!isAutoCountry || overrideAutoCountry) {
|
|
@@ -2821,7 +2980,7 @@ var factoryOutput = (() => {
|
|
|
2821
2980
|
this._setCountry(lowerInitialCountry);
|
|
2822
2981
|
} else {
|
|
2823
2982
|
if (dialCode && isRegionlessNanpNumber) {
|
|
2824
|
-
this._setCountry(
|
|
2983
|
+
this._setCountry(US.ISO2);
|
|
2825
2984
|
} else {
|
|
2826
2985
|
this._setCountry("");
|
|
2827
2986
|
}
|
|
@@ -2859,7 +3018,7 @@ var factoryOutput = (() => {
|
|
|
2859
3018
|
_initDropdownListeners() {
|
|
2860
3019
|
const signal = this.abortController.signal;
|
|
2861
3020
|
const handleLabelClick = (e) => {
|
|
2862
|
-
if (this.ui.dropdownContent.classList.contains(
|
|
3021
|
+
if (this.ui.dropdownContent.classList.contains(CLASSES.HIDE)) {
|
|
2863
3022
|
this.ui.telInput.focus();
|
|
2864
3023
|
} else {
|
|
2865
3024
|
e.preventDefault();
|
|
@@ -2870,22 +3029,30 @@ var factoryOutput = (() => {
|
|
|
2870
3029
|
label.addEventListener("click", handleLabelClick, { signal });
|
|
2871
3030
|
}
|
|
2872
3031
|
const handleClickSelectedCountry = () => {
|
|
2873
|
-
const dropdownClosed = this.ui.dropdownContent.classList.contains(
|
|
3032
|
+
const dropdownClosed = this.ui.dropdownContent.classList.contains(
|
|
3033
|
+
CLASSES.HIDE
|
|
3034
|
+
);
|
|
2874
3035
|
if (dropdownClosed && !this.ui.telInput.disabled && !this.ui.telInput.readOnly) {
|
|
2875
3036
|
this._openDropdown();
|
|
2876
3037
|
}
|
|
2877
3038
|
};
|
|
2878
|
-
this.ui.selectedCountry.addEventListener(
|
|
2879
|
-
|
|
2880
|
-
|
|
3039
|
+
this.ui.selectedCountry.addEventListener(
|
|
3040
|
+
"click",
|
|
3041
|
+
handleClickSelectedCountry,
|
|
3042
|
+
{
|
|
3043
|
+
signal
|
|
3044
|
+
}
|
|
3045
|
+
);
|
|
2881
3046
|
const handleCountryContainerKeydown = (e) => {
|
|
2882
|
-
const isDropdownHidden = this.ui.dropdownContent.classList.contains(
|
|
2883
|
-
|
|
3047
|
+
const isDropdownHidden = this.ui.dropdownContent.classList.contains(
|
|
3048
|
+
CLASSES.HIDE
|
|
3049
|
+
);
|
|
3050
|
+
if (isDropdownHidden && [KEYS.ARROW_UP, KEYS.ARROW_DOWN, KEYS.SPACE, KEYS.ENTER].includes(e.key)) {
|
|
2884
3051
|
e.preventDefault();
|
|
2885
3052
|
e.stopPropagation();
|
|
2886
3053
|
this._openDropdown();
|
|
2887
3054
|
}
|
|
2888
|
-
if (e.key ===
|
|
3055
|
+
if (e.key === KEYS.TAB) {
|
|
2889
3056
|
this._closeDropdown();
|
|
2890
3057
|
}
|
|
2891
3058
|
};
|
|
@@ -2916,7 +3083,7 @@ var factoryOutput = (() => {
|
|
|
2916
3083
|
} else {
|
|
2917
3084
|
this.resolveUtilsScriptPromise();
|
|
2918
3085
|
}
|
|
2919
|
-
const isAutoCountry = initialCountry ===
|
|
3086
|
+
const isAutoCountry = initialCountry === INITIAL_COUNTRY.AUTO && geoIpLookup;
|
|
2920
3087
|
if (isAutoCountry && !this.selectedCountryData.iso2) {
|
|
2921
3088
|
this._loadAutoCountry();
|
|
2922
3089
|
} else {
|
|
@@ -2969,7 +3136,7 @@ var factoryOutput = (() => {
|
|
|
2969
3136
|
countrySearch
|
|
2970
3137
|
} = this.options;
|
|
2971
3138
|
let userOverrideFormatting = false;
|
|
2972
|
-
if (
|
|
3139
|
+
if (REGEX.ALPHA_UNICODE.test(this.ui.telInput.value)) {
|
|
2973
3140
|
userOverrideFormatting = true;
|
|
2974
3141
|
}
|
|
2975
3142
|
const handleInputEvent = (e) => {
|
|
@@ -2987,11 +3154,11 @@ var factoryOutput = (() => {
|
|
|
2987
3154
|
if (this._updateCountryFromNumber(this.ui.telInput.value)) {
|
|
2988
3155
|
this._triggerCountryChange();
|
|
2989
3156
|
}
|
|
2990
|
-
const isFormattingChar = e?.data &&
|
|
2991
|
-
const isPaste = e?.inputType ===
|
|
3157
|
+
const isFormattingChar = e?.data && REGEX.NON_PLUS_NUMERIC.test(e.data);
|
|
3158
|
+
const isPaste = e?.inputType === INPUT_TYPES.PASTE && this.ui.telInput.value;
|
|
2992
3159
|
if (isFormattingChar || isPaste && !strictMode) {
|
|
2993
3160
|
userOverrideFormatting = true;
|
|
2994
|
-
} else if (
|
|
3161
|
+
} else if (!REGEX.NON_PLUS_NUMERIC.test(this.ui.telInput.value)) {
|
|
2995
3162
|
userOverrideFormatting = false;
|
|
2996
3163
|
}
|
|
2997
3164
|
const isSetNumber = e?.detail && e.detail["isSetNumber"];
|
|
@@ -3002,10 +3169,10 @@ var factoryOutput = (() => {
|
|
|
3002
3169
|
currentCaretPos
|
|
3003
3170
|
);
|
|
3004
3171
|
const relevantCharsBeforeCaret = valueBeforeCaret.replace(
|
|
3005
|
-
|
|
3172
|
+
REGEX.NON_PLUS_NUMERIC_GLOBAL,
|
|
3006
3173
|
""
|
|
3007
3174
|
).length;
|
|
3008
|
-
const isDeleteForwards = e?.inputType ===
|
|
3175
|
+
const isDeleteForwards = e?.inputType === INPUT_TYPES.DELETE_FWD;
|
|
3009
3176
|
const fullNumber = this._getFullNumber();
|
|
3010
3177
|
const formattedValue = formatNumberAsYouType(
|
|
3011
3178
|
fullNumber,
|
|
@@ -3024,9 +3191,13 @@ var factoryOutput = (() => {
|
|
|
3024
3191
|
this.ui.telInput.setSelectionRange(newCaretPos, newCaretPos);
|
|
3025
3192
|
}
|
|
3026
3193
|
};
|
|
3027
|
-
this.ui.telInput.addEventListener(
|
|
3028
|
-
|
|
3029
|
-
|
|
3194
|
+
this.ui.telInput.addEventListener(
|
|
3195
|
+
"input",
|
|
3196
|
+
handleInputEvent,
|
|
3197
|
+
{
|
|
3198
|
+
signal: this.abortController.signal
|
|
3199
|
+
}
|
|
3200
|
+
);
|
|
3030
3201
|
}
|
|
3031
3202
|
_maybeBindKeydownListener() {
|
|
3032
3203
|
const { strictMode, separateDialCode, allowDropdown, countrySearch } = this.options;
|
|
@@ -3077,7 +3248,7 @@ var factoryOutput = (() => {
|
|
|
3077
3248
|
const pasted = e.clipboardData.getData("text");
|
|
3078
3249
|
const initialCharSelected = selStart === 0 && selEnd > 0;
|
|
3079
3250
|
const allowLeadingPlus = !input.value.startsWith("+") || initialCharSelected;
|
|
3080
|
-
const allowedChars = pasted.replace(
|
|
3251
|
+
const allowedChars = pasted.replace(REGEX.NON_PLUS_NUMERIC_GLOBAL, "");
|
|
3081
3252
|
const hasLeadingPlus = allowedChars.startsWith("+");
|
|
3082
3253
|
const numerics = allowedChars.replace(/\+/g, "");
|
|
3083
3254
|
const sanitised = hasLeadingPlus && allowLeadingPlus ? `+${numerics}` : numerics;
|
|
@@ -3129,8 +3300,8 @@ var factoryOutput = (() => {
|
|
|
3129
3300
|
if (fixDropdownWidth) {
|
|
3130
3301
|
this.ui.dropdownContent.style.width = `${this.ui.telInput.offsetWidth}px`;
|
|
3131
3302
|
}
|
|
3132
|
-
this.ui.dropdownContent.classList.remove(
|
|
3133
|
-
this.ui.selectedCountry.setAttribute(
|
|
3303
|
+
this.ui.dropdownContent.classList.remove(CLASSES.HIDE);
|
|
3304
|
+
this.ui.selectedCountry.setAttribute(ARIA.EXPANDED, "true");
|
|
3134
3305
|
this._setDropdownPosition();
|
|
3135
3306
|
if (countrySearch) {
|
|
3136
3307
|
const firstCountryItem = this.ui.countryList.firstElementChild;
|
|
@@ -3141,8 +3312,8 @@ var factoryOutput = (() => {
|
|
|
3141
3312
|
this.ui.searchInput.focus();
|
|
3142
3313
|
}
|
|
3143
3314
|
this._bindDropdownListeners();
|
|
3144
|
-
this.ui.dropdownArrow.classList.add(
|
|
3145
|
-
this._trigger(
|
|
3315
|
+
this.ui.dropdownArrow.classList.add(CLASSES.ARROW_UP);
|
|
3316
|
+
this._trigger(EVENTS.OPEN_COUNTRY_DROPDOWN);
|
|
3146
3317
|
}
|
|
3147
3318
|
//* Set the dropdown position
|
|
3148
3319
|
_setDropdownPosition() {
|
|
@@ -3165,20 +3336,38 @@ var factoryOutput = (() => {
|
|
|
3165
3336
|
//* We only bind dropdown listeners when the dropdown is open.
|
|
3166
3337
|
_bindDropdownListeners() {
|
|
3167
3338
|
const signal = this.dropdownAbortController.signal;
|
|
3339
|
+
this._bindDropdownMouseoverListener(signal);
|
|
3340
|
+
this._bindDropdownCountryClickListener(signal);
|
|
3341
|
+
this._bindDropdownClickOffListener(signal);
|
|
3342
|
+
this._bindDropdownKeydownListener(signal);
|
|
3343
|
+
if (this.options.countrySearch) {
|
|
3344
|
+
this._bindDropdownSearchListeners(signal);
|
|
3345
|
+
}
|
|
3346
|
+
}
|
|
3347
|
+
//* When mouse over a list item, just highlight that one
|
|
3348
|
+
//* we add the class "highlight", so if they hit "enter" we know which one to select.
|
|
3349
|
+
_bindDropdownMouseoverListener(signal) {
|
|
3168
3350
|
const handleMouseoverCountryList = (e) => {
|
|
3169
3351
|
const listItem = e.target?.closest(
|
|
3170
|
-
|
|
3352
|
+
`.${CLASSES.COUNTRY_ITEM}`
|
|
3171
3353
|
);
|
|
3172
3354
|
if (listItem) {
|
|
3173
3355
|
this.ui.highlightListItem(listItem, false);
|
|
3174
3356
|
}
|
|
3175
3357
|
};
|
|
3176
|
-
this.ui.countryList.addEventListener(
|
|
3177
|
-
|
|
3178
|
-
|
|
3358
|
+
this.ui.countryList.addEventListener(
|
|
3359
|
+
"mouseover",
|
|
3360
|
+
handleMouseoverCountryList,
|
|
3361
|
+
{
|
|
3362
|
+
signal
|
|
3363
|
+
}
|
|
3364
|
+
);
|
|
3365
|
+
}
|
|
3366
|
+
//* Listen for country selection.
|
|
3367
|
+
_bindDropdownCountryClickListener(signal) {
|
|
3179
3368
|
const handleClickCountryList = (e) => {
|
|
3180
3369
|
const listItem = e.target?.closest(
|
|
3181
|
-
|
|
3370
|
+
`.${CLASSES.COUNTRY_ITEM}`
|
|
3182
3371
|
);
|
|
3183
3372
|
if (listItem) {
|
|
3184
3373
|
this._selectListItem(listItem);
|
|
@@ -3187,6 +3376,10 @@ var factoryOutput = (() => {
|
|
|
3187
3376
|
this.ui.countryList.addEventListener("click", handleClickCountryList, {
|
|
3188
3377
|
signal
|
|
3189
3378
|
});
|
|
3379
|
+
}
|
|
3380
|
+
//* Click off to close (except when this initial opening click is bubbling up).
|
|
3381
|
+
//* We cannot just stopPropagation as it may be needed to close another instance.
|
|
3382
|
+
_bindDropdownClickOffListener(signal) {
|
|
3190
3383
|
const handleClickOffToClose = (e) => {
|
|
3191
3384
|
const target = e.target;
|
|
3192
3385
|
const clickedInsideDropdown = !!target.closest(
|
|
@@ -3203,21 +3396,33 @@ var factoryOutput = (() => {
|
|
|
3203
3396
|
{ signal }
|
|
3204
3397
|
);
|
|
3205
3398
|
}, 0);
|
|
3399
|
+
}
|
|
3400
|
+
//* Listen for up/down scrolling, enter to select, or escape to close.
|
|
3401
|
+
//* Use keydown as keypress doesn't fire for non-char keys and we want to catch if they
|
|
3402
|
+
//* just hit down and hold it to scroll down (no keyup event).
|
|
3403
|
+
//* Listen on the document because that's where key events are triggered if no input has focus.
|
|
3404
|
+
_bindDropdownKeydownListener(signal) {
|
|
3206
3405
|
let query = "";
|
|
3207
3406
|
let queryTimer = null;
|
|
3208
3407
|
const handleKeydownOnDropdown = (e) => {
|
|
3209
|
-
|
|
3408
|
+
const allowedKeys = [
|
|
3409
|
+
KEYS.ARROW_UP,
|
|
3410
|
+
KEYS.ARROW_DOWN,
|
|
3411
|
+
KEYS.ENTER,
|
|
3412
|
+
KEYS.ESC
|
|
3413
|
+
];
|
|
3414
|
+
if (allowedKeys.includes(e.key)) {
|
|
3210
3415
|
e.preventDefault();
|
|
3211
3416
|
e.stopPropagation();
|
|
3212
|
-
if (e.key ===
|
|
3417
|
+
if (e.key === KEYS.ARROW_UP || e.key === KEYS.ARROW_DOWN) {
|
|
3213
3418
|
this._handleUpDownKey(e.key);
|
|
3214
|
-
} else if (e.key ===
|
|
3419
|
+
} else if (e.key === KEYS.ENTER) {
|
|
3215
3420
|
this._handleEnterKey();
|
|
3216
|
-
} else if (e.key ===
|
|
3421
|
+
} else if (e.key === KEYS.ESC) {
|
|
3217
3422
|
this._closeDropdown();
|
|
3218
3423
|
}
|
|
3219
3424
|
}
|
|
3220
|
-
if (!this.options.countrySearch &&
|
|
3425
|
+
if (!this.options.countrySearch && REGEX.HIDDEN_SEARCH_CHAR.test(e.key)) {
|
|
3221
3426
|
e.stopPropagation();
|
|
3222
3427
|
if (queryTimer) {
|
|
3223
3428
|
clearTimeout(queryTimer);
|
|
@@ -3226,53 +3431,51 @@ var factoryOutput = (() => {
|
|
|
3226
3431
|
this._searchForCountry(query);
|
|
3227
3432
|
queryTimer = setTimeout(() => {
|
|
3228
3433
|
query = "";
|
|
3229
|
-
},
|
|
3434
|
+
}, TIMINGS.HIDDEN_SEARCH_RESET_MS);
|
|
3230
3435
|
}
|
|
3231
3436
|
};
|
|
3232
3437
|
document.addEventListener("keydown", handleKeydownOnDropdown, { signal });
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
keyupTimer
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
}, 100);
|
|
3252
|
-
};
|
|
3253
|
-
this.ui.searchInput.addEventListener("input", handleSearchChange, {
|
|
3254
|
-
signal
|
|
3255
|
-
});
|
|
3256
|
-
const handleSearchClear = () => {
|
|
3257
|
-
this.ui.searchInput.value = "";
|
|
3258
|
-
this.ui.searchInput.focus();
|
|
3438
|
+
}
|
|
3439
|
+
//* Search input listeners when countrySearch enabled.
|
|
3440
|
+
_bindDropdownSearchListeners(signal) {
|
|
3441
|
+
const doFilter = () => {
|
|
3442
|
+
const inputQuery = this.ui.searchInput.value.trim();
|
|
3443
|
+
this._filterCountriesByQuery(inputQuery);
|
|
3444
|
+
if (this.ui.searchInput.value) {
|
|
3445
|
+
this.ui.searchClearButton.classList.remove(CLASSES.HIDE);
|
|
3446
|
+
} else {
|
|
3447
|
+
this.ui.searchClearButton.classList.add(CLASSES.HIDE);
|
|
3448
|
+
}
|
|
3449
|
+
};
|
|
3450
|
+
let keyupTimer = null;
|
|
3451
|
+
const handleSearchChange = () => {
|
|
3452
|
+
if (keyupTimer) {
|
|
3453
|
+
clearTimeout(keyupTimer);
|
|
3454
|
+
}
|
|
3455
|
+
keyupTimer = setTimeout(() => {
|
|
3259
3456
|
doFilter();
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3457
|
+
keyupTimer = null;
|
|
3458
|
+
}, 100);
|
|
3459
|
+
};
|
|
3460
|
+
this.ui.searchInput.addEventListener("input", handleSearchChange, {
|
|
3461
|
+
signal
|
|
3462
|
+
});
|
|
3463
|
+
const handleSearchClear = () => {
|
|
3464
|
+
this.ui.searchInput.value = "";
|
|
3465
|
+
this.ui.searchInput.focus();
|
|
3466
|
+
doFilter();
|
|
3467
|
+
};
|
|
3468
|
+
this.ui.searchClearButton.addEventListener("click", handleSearchClear, {
|
|
3469
|
+
signal
|
|
3470
|
+
});
|
|
3265
3471
|
}
|
|
3266
3472
|
//* Hidden search (countrySearch disabled): Find the first list item whose name starts with the query string.
|
|
3267
3473
|
_searchForCountry(query) {
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
this.ui.scrollTo(listItem);
|
|
3274
|
-
break;
|
|
3275
|
-
}
|
|
3474
|
+
const match = findFirstCountryStartingWith(this.countries, query);
|
|
3475
|
+
if (match) {
|
|
3476
|
+
const listItem = match.nodeById[this.id];
|
|
3477
|
+
this.ui.highlightListItem(listItem, false);
|
|
3478
|
+
this.ui.scrollTo(listItem);
|
|
3276
3479
|
}
|
|
3277
3480
|
}
|
|
3278
3481
|
//* Country search: Filter the countries according to the search query.
|
|
@@ -3281,47 +3484,15 @@ var factoryOutput = (() => {
|
|
|
3281
3484
|
if (query === "") {
|
|
3282
3485
|
matchedCountries = this.countries;
|
|
3283
3486
|
} else {
|
|
3284
|
-
matchedCountries = this.
|
|
3487
|
+
matchedCountries = getMatchedCountries(this.countries, query);
|
|
3285
3488
|
}
|
|
3286
3489
|
this.ui.filterCountries(matchedCountries);
|
|
3287
3490
|
}
|
|
3288
|
-
_getMatchedCountries(query) {
|
|
3289
|
-
const normalisedQuery = normaliseString(query);
|
|
3290
|
-
const iso2Matches = [];
|
|
3291
|
-
const nameStartWith = [];
|
|
3292
|
-
const nameContains = [];
|
|
3293
|
-
const dialCodeMatches = [];
|
|
3294
|
-
const dialCodeContains = [];
|
|
3295
|
-
const initialsMatches = [];
|
|
3296
|
-
for (const c of this.countries) {
|
|
3297
|
-
if (c.iso2 === normalisedQuery) {
|
|
3298
|
-
iso2Matches.push(c);
|
|
3299
|
-
} else if (c.normalisedName.startsWith(normalisedQuery)) {
|
|
3300
|
-
nameStartWith.push(c);
|
|
3301
|
-
} else if (c.normalisedName.includes(normalisedQuery)) {
|
|
3302
|
-
nameContains.push(c);
|
|
3303
|
-
} else if (normalisedQuery === c.dialCode || normalisedQuery === c.dialCodePlus) {
|
|
3304
|
-
dialCodeMatches.push(c);
|
|
3305
|
-
} else if (c.dialCodePlus.includes(normalisedQuery)) {
|
|
3306
|
-
dialCodeContains.push(c);
|
|
3307
|
-
} else if (c.initials.includes(normalisedQuery)) {
|
|
3308
|
-
initialsMatches.push(c);
|
|
3309
|
-
}
|
|
3310
|
-
}
|
|
3311
|
-
return [
|
|
3312
|
-
...iso2Matches.sort((a, b) => a.priority - b.priority),
|
|
3313
|
-
...nameStartWith.sort((a, b) => a.priority - b.priority),
|
|
3314
|
-
...nameContains.sort((a, b) => a.priority - b.priority),
|
|
3315
|
-
...dialCodeMatches.sort((a, b) => a.priority - b.priority),
|
|
3316
|
-
...dialCodeContains.sort((a, b) => a.priority - b.priority),
|
|
3317
|
-
...initialsMatches.sort((a, b) => a.priority - b.priority)
|
|
3318
|
-
];
|
|
3319
|
-
}
|
|
3320
3491
|
//* Highlight the next/prev item in the list (and ensure it is visible).
|
|
3321
3492
|
_handleUpDownKey(key) {
|
|
3322
|
-
let next = key ===
|
|
3493
|
+
let next = key === KEYS.ARROW_UP ? this.ui.highlightedItem?.previousElementSibling : this.ui.highlightedItem?.nextElementSibling;
|
|
3323
3494
|
if (!next && this.ui.countryList.childElementCount > 1) {
|
|
3324
|
-
next = key ===
|
|
3495
|
+
next = key === KEYS.ARROW_UP ? this.ui.countryList.lastElementChild : this.ui.countryList.firstElementChild;
|
|
3325
3496
|
}
|
|
3326
3497
|
if (next) {
|
|
3327
3498
|
this.ui.scrollTo(next);
|
|
@@ -3394,7 +3565,7 @@ var factoryOutput = (() => {
|
|
|
3394
3565
|
if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
|
|
3395
3566
|
return this.defaultCountry;
|
|
3396
3567
|
}
|
|
3397
|
-
const isRegionlessNanpNumber = selectedDialCode ===
|
|
3568
|
+
const isRegionlessNanpNumber = selectedDialCode === DIAL.NANP && isRegionlessNanp(numeric);
|
|
3398
3569
|
if (isRegionlessNanpNumber) {
|
|
3399
3570
|
return null;
|
|
3400
3571
|
}
|
|
@@ -3433,7 +3604,7 @@ var factoryOutput = (() => {
|
|
|
3433
3604
|
this.defaultCountry = this.selectedCountryData.iso2;
|
|
3434
3605
|
}
|
|
3435
3606
|
if (this.ui.selectedCountry) {
|
|
3436
|
-
const flagClass = iso2 && showFlags ?
|
|
3607
|
+
const flagClass = iso2 && showFlags ? `${CLASSES.FLAG} iti__${iso2}` : `${CLASSES.FLAG} ${CLASSES.GLOBE}`;
|
|
3437
3608
|
let ariaLabel, title;
|
|
3438
3609
|
if (iso2) {
|
|
3439
3610
|
const { name, dialCode } = this.selectedCountryData;
|
|
@@ -3445,7 +3616,7 @@ var factoryOutput = (() => {
|
|
|
3445
3616
|
}
|
|
3446
3617
|
this.ui.selectedCountryInner.className = flagClass;
|
|
3447
3618
|
this.ui.selectedCountry.setAttribute("title", title);
|
|
3448
|
-
this.ui.selectedCountry.setAttribute(
|
|
3619
|
+
this.ui.selectedCountry.setAttribute(ARIA.LABEL, ariaLabel);
|
|
3449
3620
|
}
|
|
3450
3621
|
if (separateDialCode) {
|
|
3451
3622
|
const dialCode = this.selectedCountryData.dialCode ? `+${this.selectedCountryData.dialCode}` : "";
|
|
@@ -3513,10 +3684,10 @@ var factoryOutput = (() => {
|
|
|
3513
3684
|
}
|
|
3514
3685
|
//* Called when the user selects a list item from the dropdown.
|
|
3515
3686
|
_selectListItem(listItem) {
|
|
3516
|
-
const iso2 = listItem.dataset.
|
|
3687
|
+
const iso2 = listItem.dataset[DATA_KEYS.COUNTRY_CODE];
|
|
3517
3688
|
const countryChanged = this._setCountry(iso2);
|
|
3518
3689
|
this._closeDropdown();
|
|
3519
|
-
const dialCode = listItem.dataset.
|
|
3690
|
+
const dialCode = listItem.dataset[DATA_KEYS.DIAL_CODE];
|
|
3520
3691
|
this._updateDialCode(dialCode);
|
|
3521
3692
|
if (this.options.formatOnDisplay) {
|
|
3522
3693
|
this._updateValFromNumber(this.ui.telInput.value);
|
|
@@ -3528,24 +3699,24 @@ var factoryOutput = (() => {
|
|
|
3528
3699
|
}
|
|
3529
3700
|
//* Close the dropdown and unbind any listeners.
|
|
3530
3701
|
_closeDropdown() {
|
|
3531
|
-
if (this.ui.dropdownContent.classList.contains(
|
|
3702
|
+
if (this.ui.dropdownContent.classList.contains(CLASSES.HIDE)) {
|
|
3532
3703
|
return;
|
|
3533
3704
|
}
|
|
3534
|
-
this.ui.dropdownContent.classList.add(
|
|
3535
|
-
this.ui.selectedCountry.setAttribute(
|
|
3705
|
+
this.ui.dropdownContent.classList.add(CLASSES.HIDE);
|
|
3706
|
+
this.ui.selectedCountry.setAttribute(ARIA.EXPANDED, "false");
|
|
3536
3707
|
if (this.ui.highlightedItem) {
|
|
3537
|
-
this.ui.highlightedItem.setAttribute(
|
|
3708
|
+
this.ui.highlightedItem.setAttribute(ARIA.SELECTED, "false");
|
|
3538
3709
|
}
|
|
3539
3710
|
if (this.options.countrySearch) {
|
|
3540
|
-
this.ui.searchInput.removeAttribute(
|
|
3711
|
+
this.ui.searchInput.removeAttribute(ARIA.ACTIVE_DESCENDANT);
|
|
3541
3712
|
}
|
|
3542
|
-
this.ui.dropdownArrow.classList.remove(
|
|
3713
|
+
this.ui.dropdownArrow.classList.remove(CLASSES.ARROW_UP);
|
|
3543
3714
|
this.dropdownAbortController.abort();
|
|
3544
3715
|
this.dropdownAbortController = null;
|
|
3545
3716
|
if (this.options.dropdownContainer) {
|
|
3546
3717
|
this.ui.dropdown.remove();
|
|
3547
3718
|
}
|
|
3548
|
-
this._trigger(
|
|
3719
|
+
this._trigger(EVENTS.CLOSE_COUNTRY_DROPDOWN);
|
|
3549
3720
|
}
|
|
3550
3721
|
//* Replace any existing dial code with the new one
|
|
3551
3722
|
//* Note: called from _selectListItem and setCountry
|
|
@@ -3617,16 +3788,16 @@ var factoryOutput = (() => {
|
|
|
3617
3788
|
}
|
|
3618
3789
|
//* Trigger the 'countrychange' event.
|
|
3619
3790
|
_triggerCountryChange() {
|
|
3620
|
-
this._trigger(
|
|
3791
|
+
this._trigger(EVENTS.COUNTRY_CHANGE);
|
|
3621
3792
|
}
|
|
3622
3793
|
//**************************
|
|
3623
3794
|
//* SECRET PUBLIC METHODS
|
|
3624
3795
|
//**************************
|
|
3625
3796
|
//* This is called when the geoip call returns.
|
|
3626
3797
|
handleAutoCountry() {
|
|
3627
|
-
if (this.options.initialCountry ===
|
|
3798
|
+
if (this.options.initialCountry === INITIAL_COUNTRY.AUTO && intlTelInput.autoCountry) {
|
|
3628
3799
|
this.defaultCountry = intlTelInput.autoCountry;
|
|
3629
|
-
const hasSelectedCountryOrGlobe = this.selectedCountryData.iso2 || this.ui.selectedCountryInner.classList.contains(
|
|
3800
|
+
const hasSelectedCountryOrGlobe = this.selectedCountryData.iso2 || this.ui.selectedCountryInner.classList.contains(CLASSES.GLOBE);
|
|
3630
3801
|
if (!hasSelectedCountryOrGlobe) {
|
|
3631
3802
|
this.setCountry(this.defaultCountry);
|
|
3632
3803
|
}
|
|
@@ -3696,7 +3867,7 @@ var factoryOutput = (() => {
|
|
|
3696
3867
|
this.selectedCountryData.iso2
|
|
3697
3868
|
);
|
|
3698
3869
|
}
|
|
3699
|
-
return
|
|
3870
|
+
return SENTINELS.UNKNOWN_NUMBER_TYPE;
|
|
3700
3871
|
}
|
|
3701
3872
|
//* Get the country data for the currently selected country.
|
|
3702
3873
|
getSelectedCountryData() {
|
|
@@ -3708,15 +3879,15 @@ var factoryOutput = (() => {
|
|
|
3708
3879
|
const { iso2 } = this.selectedCountryData;
|
|
3709
3880
|
return intlTelInput.utils.getValidationError(this._getFullNumber(), iso2);
|
|
3710
3881
|
}
|
|
3711
|
-
return
|
|
3882
|
+
return SENTINELS.UNKNOWN_VALIDATION_ERROR;
|
|
3712
3883
|
}
|
|
3713
3884
|
//* Validate the input val using number length only
|
|
3714
3885
|
isValidNumber() {
|
|
3715
3886
|
const { dialCode, iso2 } = this.selectedCountryData;
|
|
3716
|
-
if (dialCode ===
|
|
3887
|
+
if (dialCode === UK.DIAL_CODE && intlTelInput.utils) {
|
|
3717
3888
|
const number = this._getFullNumber();
|
|
3718
3889
|
const coreNumber = intlTelInput.utils.getCoreNumber(number, iso2);
|
|
3719
|
-
if (coreNumber[0] ===
|
|
3890
|
+
if (coreNumber[0] === UK.MOBILE_PREFIX && coreNumber.length !== UK.MOBILE_CORE_LENGTH) {
|
|
3720
3891
|
return false;
|
|
3721
3892
|
}
|
|
3722
3893
|
}
|
|
@@ -3743,7 +3914,7 @@ var factoryOutput = (() => {
|
|
|
3743
3914
|
}
|
|
3744
3915
|
const testValidity = (s) => precise ? this._utilsIsValidNumber(s) : this._utilsIsPossibleNumber(s);
|
|
3745
3916
|
const val = this._getFullNumber();
|
|
3746
|
-
const alphaCharPosition = val.search(
|
|
3917
|
+
const alphaCharPosition = val.search(REGEX.ALPHA_UNICODE);
|
|
3747
3918
|
const hasAlphaChar = alphaCharPosition > -1;
|
|
3748
3919
|
if (hasAlphaChar && !this.options.allowPhonewords) {
|
|
3749
3920
|
const beforeAlphaChar = val.substring(0, alphaCharPosition);
|
|
@@ -3784,7 +3955,7 @@ var factoryOutput = (() => {
|
|
|
3784
3955
|
if (countryChanged) {
|
|
3785
3956
|
this._triggerCountryChange();
|
|
3786
3957
|
}
|
|
3787
|
-
this._trigger(
|
|
3958
|
+
this._trigger(EVENTS.INPUT, { isSetNumber: true });
|
|
3788
3959
|
}
|
|
3789
3960
|
//* Set the placeholder number typ
|
|
3790
3961
|
setPlaceholderNumberType(type) {
|
|
@@ -3865,7 +4036,7 @@ var factoryOutput = (() => {
|
|
|
3865
4036
|
attachUtils,
|
|
3866
4037
|
startedLoadingUtilsScript: false,
|
|
3867
4038
|
startedLoadingAutoCountry: false,
|
|
3868
|
-
version: "25.11.
|
|
4039
|
+
version: "25.11.1"
|
|
3869
4040
|
}
|
|
3870
4041
|
);
|
|
3871
4042
|
var intl_tel_input_default = intlTelInput;
|