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
|
@@ -10,9 +10,9 @@ export type Country = {
|
|
|
10
10
|
nodeById: {
|
|
11
11
|
[instanceId: number]: HTMLElement;
|
|
12
12
|
};
|
|
13
|
-
normalisedName
|
|
14
|
-
initials
|
|
15
|
-
dialCodePlus
|
|
13
|
+
normalisedName: string;
|
|
14
|
+
initials: string;
|
|
15
|
+
dialCodePlus: string;
|
|
16
16
|
};
|
|
17
17
|
declare const allCountries: Country[];
|
|
18
18
|
export default allCountries;
|
|
@@ -46,9 +46,13 @@ export declare class Iti {
|
|
|
46
46
|
private _openDropdown;
|
|
47
47
|
private _setDropdownPosition;
|
|
48
48
|
private _bindDropdownListeners;
|
|
49
|
+
private _bindDropdownMouseoverListener;
|
|
50
|
+
private _bindDropdownCountryClickListener;
|
|
51
|
+
private _bindDropdownClickOffListener;
|
|
52
|
+
private _bindDropdownKeydownListener;
|
|
53
|
+
private _bindDropdownSearchListeners;
|
|
49
54
|
private _searchForCountry;
|
|
50
55
|
private _filterCountriesByQuery;
|
|
51
|
-
private _getMatchedCountries;
|
|
52
56
|
private _handleUpDownKey;
|
|
53
57
|
private _handleEnterKey;
|
|
54
58
|
private _updateValFromNumber;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Iso2 } from "../intl-tel-input/data";
|
|
2
|
+
export declare const EVENTS: {
|
|
3
|
+
readonly OPEN_COUNTRY_DROPDOWN: "open:countrydropdown";
|
|
4
|
+
readonly CLOSE_COUNTRY_DROPDOWN: "close:countrydropdown";
|
|
5
|
+
readonly COUNTRY_CHANGE: "countrychange";
|
|
6
|
+
readonly INPUT: "input";
|
|
7
|
+
};
|
|
8
|
+
export declare const CLASSES: {
|
|
9
|
+
readonly HIDE: "iti__hide";
|
|
10
|
+
readonly V_HIDE: "iti__v-hide";
|
|
11
|
+
readonly ARROW_UP: "iti__arrow--up";
|
|
12
|
+
readonly GLOBE: "iti__globe";
|
|
13
|
+
readonly FLAG: "iti__flag";
|
|
14
|
+
readonly COUNTRY_ITEM: "iti__country";
|
|
15
|
+
readonly HIGHLIGHT: "iti__highlight";
|
|
16
|
+
};
|
|
17
|
+
export declare const KEYS: {
|
|
18
|
+
readonly ARROW_UP: "ArrowUp";
|
|
19
|
+
readonly ARROW_DOWN: "ArrowDown";
|
|
20
|
+
readonly SPACE: " ";
|
|
21
|
+
readonly ENTER: "Enter";
|
|
22
|
+
readonly ESC: "Escape";
|
|
23
|
+
readonly TAB: "Tab";
|
|
24
|
+
};
|
|
25
|
+
export declare const INPUT_TYPES: {
|
|
26
|
+
readonly PASTE: "insertFromPaste";
|
|
27
|
+
readonly DELETE_FWD: "deleteContentForward";
|
|
28
|
+
};
|
|
29
|
+
export declare const REGEX: {
|
|
30
|
+
readonly ALPHA_UNICODE: RegExp;
|
|
31
|
+
readonly NON_PLUS_NUMERIC: RegExp;
|
|
32
|
+
readonly NON_PLUS_NUMERIC_GLOBAL: RegExp;
|
|
33
|
+
readonly HIDDEN_SEARCH_CHAR: RegExp;
|
|
34
|
+
};
|
|
35
|
+
export declare const TIMINGS: {
|
|
36
|
+
readonly SEARCH_DEBOUNCE_MS: 100;
|
|
37
|
+
readonly HIDDEN_SEARCH_RESET_MS: 1000;
|
|
38
|
+
readonly NEXT_TICK: 0;
|
|
39
|
+
};
|
|
40
|
+
export declare const SENTINELS: {
|
|
41
|
+
readonly UNKNOWN_NUMBER_TYPE: -99;
|
|
42
|
+
readonly UNKNOWN_VALIDATION_ERROR: -99;
|
|
43
|
+
};
|
|
44
|
+
export declare const LAYOUT: {
|
|
45
|
+
readonly SANE_SELECTED_WITH_DIAL_WIDTH: 78;
|
|
46
|
+
readonly SANE_SELECTED_NO_DIAL_WIDTH: 42;
|
|
47
|
+
readonly INPUT_PADDING_EXTRA_LEFT: 6;
|
|
48
|
+
};
|
|
49
|
+
export declare const DIAL: {
|
|
50
|
+
readonly PLUS: "+";
|
|
51
|
+
readonly NANP: "1";
|
|
52
|
+
};
|
|
53
|
+
export declare const UK: {
|
|
54
|
+
readonly ISO2: Iso2;
|
|
55
|
+
readonly DIAL_CODE: "44";
|
|
56
|
+
readonly MOBILE_PREFIX: "7";
|
|
57
|
+
readonly MOBILE_CORE_LENGTH: 10;
|
|
58
|
+
};
|
|
59
|
+
export declare const US: {
|
|
60
|
+
ISO2: Iso2;
|
|
61
|
+
DIAL_CODE: string;
|
|
62
|
+
};
|
|
63
|
+
export declare const PLACEHOLDER_MODES: {
|
|
64
|
+
readonly AGGRESSIVE: "aggressive";
|
|
65
|
+
readonly POLITE: "polite";
|
|
66
|
+
};
|
|
67
|
+
export declare const INITIAL_COUNTRY: {
|
|
68
|
+
readonly AUTO: "auto";
|
|
69
|
+
};
|
|
70
|
+
export declare const DATA_KEYS: {
|
|
71
|
+
readonly COUNTRY_CODE: "countryCode";
|
|
72
|
+
readonly DIAL_CODE: "dialCode";
|
|
73
|
+
};
|
|
74
|
+
export declare const ARIA: {
|
|
75
|
+
readonly EXPANDED: "aria-expanded";
|
|
76
|
+
readonly LABEL: "aria-label";
|
|
77
|
+
readonly SELECTED: "aria-selected";
|
|
78
|
+
readonly ACTIVE_DESCENDANT: "aria-activedescendant";
|
|
79
|
+
readonly HASPOPUP: "aria-haspopup";
|
|
80
|
+
readonly CONTROLS: "aria-controls";
|
|
81
|
+
readonly HIDDEN: "aria-hidden";
|
|
82
|
+
readonly AUTOCOMPLETE: "aria-autocomplete";
|
|
83
|
+
readonly MODAL: "aria-modal";
|
|
84
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Country } from "../../intl-tel-input/data";
|
|
2
|
+
/**
|
|
3
|
+
* Country search: Given raw query, return ordered list of countries by priority buckets.
|
|
4
|
+
* Buckets (in order):
|
|
5
|
+
* 1. exact ISO2 matches
|
|
6
|
+
* 2. name starts with
|
|
7
|
+
* 3. name contains
|
|
8
|
+
* 4. dial code exact match (bare or with plus)
|
|
9
|
+
* 5. dial code contains (with plus form)
|
|
10
|
+
* 6. initials match
|
|
11
|
+
* Each bucket preserves country.priority ordering.
|
|
12
|
+
*/
|
|
13
|
+
export declare const getMatchedCountries: (countries: Country[], query: string) => Country[];
|
|
14
|
+
/**
|
|
15
|
+
* Hidden search (when countrySearch disabled): find first whose name starts with query (case-insensitive).
|
|
16
|
+
*/
|
|
17
|
+
export declare const findFirstCountryStartingWith: (countries: Country[], query: string) => Country | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { I18n } from "../../intl-tel-input/i18n/types";
|
|
1
2
|
import type { AllOptions } from "../types/public-api";
|
|
2
3
|
export declare const defaults: AllOptions;
|
|
3
|
-
export declare
|
|
4
|
+
export declare const applyOptionSideEffects: (o: AllOptions, defaultEnglishStrings: I18n) => void;
|
|
@@ -5,8 +5,8 @@ export interface DialCodeProcessingResult {
|
|
|
5
5
|
dialCodeMaxLen: number;
|
|
6
6
|
dialCodeToIso2Map: Record<string, Iso2[]>;
|
|
7
7
|
}
|
|
8
|
-
export declare
|
|
9
|
-
export declare
|
|
10
|
-
export declare
|
|
11
|
-
export declare
|
|
12
|
-
export declare
|
|
8
|
+
export declare const processAllCountries: (options: AllOptions) => Country[];
|
|
9
|
+
export declare const translateCountryNames: (countries: Country[], options: AllOptions) => void;
|
|
10
|
+
export declare const processDialCodes: (countries: Country[], options: AllOptions) => DialCodeProcessingResult;
|
|
11
|
+
export declare const sortCountries: (countries: Country[], options: AllOptions) => void;
|
|
12
|
+
export declare const cacheSearchTokens: (countries: Country[]) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare const translateCursorPosition: (relevantChars: number, formattedValue: string, prevCaretPos: number, isDeleteForwards: boolean) => number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SelectedCountryData } from "../types/public-api";
|
|
2
|
-
export declare
|
|
3
|
-
export declare
|
|
2
|
+
export declare const beforeSetNumber: (fullNumber: string, dialCode: string, separateDialCode: boolean, selectedCountryData: SelectedCountryData) => string;
|
|
3
|
+
export declare const formatNumberAsYouType: (fullNumber: string, telInputValue: string, utils: any, selectedCountryData: SelectedCountryData, separateDialCode: boolean) => string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { EVENTS } from "../constants";
|
|
1
2
|
export type ItiEventMap = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
[EVENTS.COUNTRY_CHANGE]: Record<string, never>;
|
|
4
|
+
[EVENTS.OPEN_COUNTRY_DROPDOWN]: Record<string, never>;
|
|
5
|
+
[EVENTS.CLOSE_COUNTRY_DROPDOWN]: Record<string, never>;
|
|
6
|
+
[EVENTS.INPUT]: {
|
|
6
7
|
isSetNumber?: boolean;
|
|
7
8
|
};
|
|
8
9
|
};
|
package/build/js/data.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
|
*/
|
|
@@ -1727,7 +1727,13 @@ var factoryOutput = (() => {
|
|
|
1727
1727
|
areaCodes: c[3] || null,
|
|
1728
1728
|
nodeById: {},
|
|
1729
1729
|
// populated by the plugin
|
|
1730
|
-
nationalPrefix: c[4] || null
|
|
1730
|
+
nationalPrefix: c[4] || null,
|
|
1731
|
+
normalisedName: "",
|
|
1732
|
+
// populated in the plugin
|
|
1733
|
+
initials: "",
|
|
1734
|
+
// populated in the plugin
|
|
1735
|
+
dialCodePlus: ""
|
|
1736
|
+
// populated in the plugin
|
|
1731
1737
|
});
|
|
1732
1738
|
}
|
|
1733
1739
|
var data_default = allCountries;
|
package/build/js/data.min.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
|
*/
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
}(() => {
|
|
15
15
|
|
|
16
|
-
var factoryOutput=(()=>{var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var g=(l,n)=>{for(var t in n)s(l,t,{get:n[t],enumerable:!0})},c=(l,n,t,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let u of m(n))!o.call(l,u)&&u!==t&&s(l,u,{get:()=>n[u],enumerable:!(a=i(n,u))||a.enumerable});return l};var d=l=>c(s({},"__esModule",{value:!0}),l);var b={};g(b,{default:()=>p,rawCountryData:()=>e});var e=[["af","93",0,null,"0"],["ax","358",1,["18","4"],"0"],["al","355",0,null,"0"],["dz","213",0,null,"0"],["as","1",5,["684"],"1"],["ad","376"],["ao","244"],["ai","1",6,["264"],"1"],["ag","1",7,["268"],"1"],["ar","54",0,null,"0"],["am","374",0,null,"0"],["aw","297"],["ac","247"],["au","61",0,["4"],"0"],["at","43",0,null,"0"],["az","994",0,null,"0"],["bs","1",8,["242"],"1"],["bh","973"],["bd","880",0,null,"0"],["bb","1",9,["246"],"1"],["by","375",0,null,"8"],["be","32",0,null,"0"],["bz","501"],["bj","229"],["bm","1",10,["441"],"1"],["bt","975"],["bo","591",0,null,"0"],["ba","387",0,null,"0"],["bw","267"],["br","55",0,null,"0"],["io","246"],["vg","1",11,["284"],"1"],["bn","673"],["bg","359",0,null,"0"],["bf","226"],["bi","257"],["kh","855",0,null,"0"],["cm","237"],["ca","1",1,["204","226","236","249","250","257","263","289","306","343","354","365","367","368","382","403","416","418","428","431","437","438","450","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","879","902","905","942"],"1"],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"],"1"],["cf","236"],["td","235"],["cl","56"],["cn","86",0,null,"0"],["cx","61",2,["4","89164"],"0"],["cc","61",1,["4","89162"],"0"],["co","57",0,null,"0"],["km","269"],["cg","242"],["cd","243",0,null,"0"],["ck","682"],["cr","506"],["ci","225"],["hr","385",0,null,"0"],["cu","53",0,null,"0"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"],"1"],["do","1",2,["809","829","849"],"1"],["ec","593",0,null,"0"],["eg","20",0,null,"0"],["sv","503"],["gq","240"],["er","291",0,null,"0"],["ee","372"],["sz","268"],["et","251",0,null,"0"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0,["4"],"0"],["fr","33",0,null,"0"],["gf","594",0,null,"0"],["pf","689"],["ga","241"],["gm","220"],["ge","995",0,null,"0"],["de","49",0,null,"0"],["gh","233",0,null,"0"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"],"1"],["gp","590",0,null,"0"],["gu","1",15,["671"],"1"],["gt","502"],["gg","44",1,["1481","7781","7839","7911"],"0"],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36",0,null,"06"],["is","354"],["in","91",0,null,"0"],["id","62",0,null,"0"],["ir","98",0,null,"0"],["iq","964",0,null,"0"],["ie","353",0,null,"0"],["im","44",2,["1624","74576","7524","7624","7924"],"0"],["il","972",0,null,"0"],["it","39",0,["3"]],["jm","1",4,["658","876"],"1"],["jp","81",0,null,"0"],["je","44",3,["1534","7509","7700","7797","7829","7937"],"0"],["jo","962",0,null,"0"],["kz","7",1,["33","7"],"8"],["ke","254",0,null,"0"],["ki","686",0,null,"0"],["xk","383",0,null,"0"],["kw","965"],["kg","996",0,null,"0"],["la","856",0,null,"0"],["lv","371"],["lb","961",0,null,"0"],["ls","266"],["lr","231",0,null,"0"],["ly","218",0,null,"0"],["li","423",0,null,"0"],["lt","370",0,null,"0"],["lu","352"],["mo","853"],["mg","261",0,null,"0"],["mw","265",0,null,"0"],["my","60",0,null,"0"],["mv","960"],["ml","223"],["mt","356"],["mh","692",0,null,"1"],["mq","596",0,null,"0"],["mr","222"],["mu","230"],["yt","262",1,["269","639"],"0"],["mx","52"],["fm","691"],["md","373",0,null,"0"],["mc","377",0,null,"0"],["mn","976",0,null,"0"],["me","382",0,null,"0"],["ms","1",16,["664"],"1"],["ma","212",0,["6","7"],"0"],["mz","258"],["mm","95",0,null,"0"],["na","264",0,null,"0"],["nr","674"],["np","977",0,null,"0"],["nl","31",0,null,"0"],["nc","687"],["nz","64",0,null,"0"],["ni","505"],["ne","227"],["ng","234",0,null,"0"],["nu","683"],["nf","672"],["kp","850",0,null,"0"],["mk","389",0,null,"0"],["mp","1",17,["670"],"1"],["no","47",0,["4","9"]],["om","968"],["pk","92",0,null,"0"],["pw","680"],["ps","970",0,null,"0"],["pa","507"],["pg","675"],["py","595",0,null,"0"],["pe","51",0,null,"0"],["ph","63",0,null,"0"],["pl","48"],["pt","351"],["pr","1",3,["787","939"],"1"],["qa","974"],["re","262",0,null,"0"],["ro","40",0,null,"0"],["ru","7",0,["33"],"8"],["rw","250",0,null,"0"],["ws","685"],["sm","378"],["st","239"],["sa","966",0,null,"0"],["sn","221"],["rs","381",0,null,"0"],["sc","248"],["sl","232",0,null,"0"],["sg","65"],["sx","1",21,["721"],"1"],["sk","421",0,null,"0"],["si","386",0,null,"0"],["sb","677"],["so","252",0,null,"0"],["za","27",0,null,"0"],["kr","82",0,null,"0"],["ss","211",0,null,"0"],["es","34"],["lk","94",0,null,"0"],["bl","590",1,null,"0"],["sh","290"],["kn","1",18,["869"],"1"],["lc","1",19,["758"],"1"],["mf","590",2,null,"0"],["pm","508",0,null,"0"],["vc","1",20,["784"],"1"],["sd","249",0,null,"0"],["sr","597"],["sj","47",1,["4","79","9"]],["se","46",0,null,"0"],["ch","41",0,null,"0"],["sy","963",0,null,"0"],["tw","886",0,null,"0"],["tj","992"],["tz","255",0,null,"0"],["th","66",0,null,"0"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"],"1"],["tn","216"],["tr","90",0,null,"0"],["tm","993",0,null,"8"],["tc","1",23,["649"],"1"],["tv","688"],["vi","1",24,["340"],"1"],["ug","256",0,null,"0"],["ua","380",0,null,"0"],["ae","971",0,null,"0"],["gb","44",0,null,"0"],["us","1",0,null,"1"],["uy","598",0,null,"0"],["uz","998"],["vu","678"],["va","39",1,["06698","3"]],["ve","58",0,null,"0"],["vn","84",0,null,"0"],["wf","681"],["eh","212",1,["5288","5289","6","7"],"0"],["ye","967",0,null,"0"],["zm","260",0,null,"0"],["zw","263",0,null,"0"]],r=[];for(let l of e)r.push({name:"",iso2:l[0],dialCode:l[1],priority:l[2]||0,areaCodes:l[3]||null,nodeById:{},nationalPrefix:l[4]||null});var p=r;return d(b);})();
|
|
16
|
+
var factoryOutput=(()=>{var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var g=(l,n)=>{for(var t in n)s(l,t,{get:n[t],enumerable:!0})},c=(l,n,t,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let u of m(n))!o.call(l,u)&&u!==t&&s(l,u,{get:()=>n[u],enumerable:!(a=i(n,u))||a.enumerable});return l};var d=l=>c(s({},"__esModule",{value:!0}),l);var b={};g(b,{default:()=>p,rawCountryData:()=>e});var e=[["af","93",0,null,"0"],["ax","358",1,["18","4"],"0"],["al","355",0,null,"0"],["dz","213",0,null,"0"],["as","1",5,["684"],"1"],["ad","376"],["ao","244"],["ai","1",6,["264"],"1"],["ag","1",7,["268"],"1"],["ar","54",0,null,"0"],["am","374",0,null,"0"],["aw","297"],["ac","247"],["au","61",0,["4"],"0"],["at","43",0,null,"0"],["az","994",0,null,"0"],["bs","1",8,["242"],"1"],["bh","973"],["bd","880",0,null,"0"],["bb","1",9,["246"],"1"],["by","375",0,null,"8"],["be","32",0,null,"0"],["bz","501"],["bj","229"],["bm","1",10,["441"],"1"],["bt","975"],["bo","591",0,null,"0"],["ba","387",0,null,"0"],["bw","267"],["br","55",0,null,"0"],["io","246"],["vg","1",11,["284"],"1"],["bn","673"],["bg","359",0,null,"0"],["bf","226"],["bi","257"],["kh","855",0,null,"0"],["cm","237"],["ca","1",1,["204","226","236","249","250","257","263","289","306","343","354","365","367","368","382","403","416","418","428","431","437","438","450","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","879","902","905","942"],"1"],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"],"1"],["cf","236"],["td","235"],["cl","56"],["cn","86",0,null,"0"],["cx","61",2,["4","89164"],"0"],["cc","61",1,["4","89162"],"0"],["co","57",0,null,"0"],["km","269"],["cg","242"],["cd","243",0,null,"0"],["ck","682"],["cr","506"],["ci","225"],["hr","385",0,null,"0"],["cu","53",0,null,"0"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"],"1"],["do","1",2,["809","829","849"],"1"],["ec","593",0,null,"0"],["eg","20",0,null,"0"],["sv","503"],["gq","240"],["er","291",0,null,"0"],["ee","372"],["sz","268"],["et","251",0,null,"0"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0,["4"],"0"],["fr","33",0,null,"0"],["gf","594",0,null,"0"],["pf","689"],["ga","241"],["gm","220"],["ge","995",0,null,"0"],["de","49",0,null,"0"],["gh","233",0,null,"0"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"],"1"],["gp","590",0,null,"0"],["gu","1",15,["671"],"1"],["gt","502"],["gg","44",1,["1481","7781","7839","7911"],"0"],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36",0,null,"06"],["is","354"],["in","91",0,null,"0"],["id","62",0,null,"0"],["ir","98",0,null,"0"],["iq","964",0,null,"0"],["ie","353",0,null,"0"],["im","44",2,["1624","74576","7524","7624","7924"],"0"],["il","972",0,null,"0"],["it","39",0,["3"]],["jm","1",4,["658","876"],"1"],["jp","81",0,null,"0"],["je","44",3,["1534","7509","7700","7797","7829","7937"],"0"],["jo","962",0,null,"0"],["kz","7",1,["33","7"],"8"],["ke","254",0,null,"0"],["ki","686",0,null,"0"],["xk","383",0,null,"0"],["kw","965"],["kg","996",0,null,"0"],["la","856",0,null,"0"],["lv","371"],["lb","961",0,null,"0"],["ls","266"],["lr","231",0,null,"0"],["ly","218",0,null,"0"],["li","423",0,null,"0"],["lt","370",0,null,"0"],["lu","352"],["mo","853"],["mg","261",0,null,"0"],["mw","265",0,null,"0"],["my","60",0,null,"0"],["mv","960"],["ml","223"],["mt","356"],["mh","692",0,null,"1"],["mq","596",0,null,"0"],["mr","222"],["mu","230"],["yt","262",1,["269","639"],"0"],["mx","52"],["fm","691"],["md","373",0,null,"0"],["mc","377",0,null,"0"],["mn","976",0,null,"0"],["me","382",0,null,"0"],["ms","1",16,["664"],"1"],["ma","212",0,["6","7"],"0"],["mz","258"],["mm","95",0,null,"0"],["na","264",0,null,"0"],["nr","674"],["np","977",0,null,"0"],["nl","31",0,null,"0"],["nc","687"],["nz","64",0,null,"0"],["ni","505"],["ne","227"],["ng","234",0,null,"0"],["nu","683"],["nf","672"],["kp","850",0,null,"0"],["mk","389",0,null,"0"],["mp","1",17,["670"],"1"],["no","47",0,["4","9"]],["om","968"],["pk","92",0,null,"0"],["pw","680"],["ps","970",0,null,"0"],["pa","507"],["pg","675"],["py","595",0,null,"0"],["pe","51",0,null,"0"],["ph","63",0,null,"0"],["pl","48"],["pt","351"],["pr","1",3,["787","939"],"1"],["qa","974"],["re","262",0,null,"0"],["ro","40",0,null,"0"],["ru","7",0,["33"],"8"],["rw","250",0,null,"0"],["ws","685"],["sm","378"],["st","239"],["sa","966",0,null,"0"],["sn","221"],["rs","381",0,null,"0"],["sc","248"],["sl","232",0,null,"0"],["sg","65"],["sx","1",21,["721"],"1"],["sk","421",0,null,"0"],["si","386",0,null,"0"],["sb","677"],["so","252",0,null,"0"],["za","27",0,null,"0"],["kr","82",0,null,"0"],["ss","211",0,null,"0"],["es","34"],["lk","94",0,null,"0"],["bl","590",1,null,"0"],["sh","290"],["kn","1",18,["869"],"1"],["lc","1",19,["758"],"1"],["mf","590",2,null,"0"],["pm","508",0,null,"0"],["vc","1",20,["784"],"1"],["sd","249",0,null,"0"],["sr","597"],["sj","47",1,["4","79","9"]],["se","46",0,null,"0"],["ch","41",0,null,"0"],["sy","963",0,null,"0"],["tw","886",0,null,"0"],["tj","992"],["tz","255",0,null,"0"],["th","66",0,null,"0"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"],"1"],["tn","216"],["tr","90",0,null,"0"],["tm","993",0,null,"8"],["tc","1",23,["649"],"1"],["tv","688"],["vi","1",24,["340"],"1"],["ug","256",0,null,"0"],["ua","380",0,null,"0"],["ae","971",0,null,"0"],["gb","44",0,null,"0"],["us","1",0,null,"1"],["uy","598",0,null,"0"],["uz","998"],["vu","678"],["va","39",1,["06698","3"]],["ve","58",0,null,"0"],["vn","84",0,null,"0"],["wf","681"],["eh","212",1,["5288","5289","6","7"],"0"],["ye","967",0,null,"0"],["zm","260",0,null,"0"],["zw","263",0,null,"0"]],r=[];for(let l of e)r.push({name:"",iso2:l[0],dialCode:l[1],priority:l[2]||0,areaCodes:l[3]||null,nodeById:{},nationalPrefix:l[4]||null,normalisedName:"",initials:"",dialCodePlus:""});var p=r;return d(b);})();
|
|
17
17
|
|
|
18
18
|
// UMD
|
|
19
19
|
return factoryOutput.default;
|
|
@@ -11,9 +11,9 @@ declare module "intl-tel-input/data" {
|
|
|
11
11
|
nodeById: {
|
|
12
12
|
[instanceId: number]: HTMLElement;
|
|
13
13
|
};
|
|
14
|
-
normalisedName
|
|
15
|
-
initials
|
|
16
|
-
dialCodePlus
|
|
14
|
+
normalisedName: string;
|
|
15
|
+
initials: string;
|
|
16
|
+
dialCodePlus: string;
|
|
17
17
|
};
|
|
18
18
|
const allCountries: Country[];
|
|
19
19
|
export default allCountries;
|
|
@@ -50,6 +50,92 @@ declare module "intl-tel-input/i18n/en" {
|
|
|
50
50
|
const allTranslations: I18n;
|
|
51
51
|
export default allTranslations;
|
|
52
52
|
}
|
|
53
|
+
declare module "modules/constants" {
|
|
54
|
+
import { Iso2 } from "intl-tel-input/data";
|
|
55
|
+
export const EVENTS: {
|
|
56
|
+
readonly OPEN_COUNTRY_DROPDOWN: "open:countrydropdown";
|
|
57
|
+
readonly CLOSE_COUNTRY_DROPDOWN: "close:countrydropdown";
|
|
58
|
+
readonly COUNTRY_CHANGE: "countrychange";
|
|
59
|
+
readonly INPUT: "input";
|
|
60
|
+
};
|
|
61
|
+
export const CLASSES: {
|
|
62
|
+
readonly HIDE: "iti__hide";
|
|
63
|
+
readonly V_HIDE: "iti__v-hide";
|
|
64
|
+
readonly ARROW_UP: "iti__arrow--up";
|
|
65
|
+
readonly GLOBE: "iti__globe";
|
|
66
|
+
readonly FLAG: "iti__flag";
|
|
67
|
+
readonly COUNTRY_ITEM: "iti__country";
|
|
68
|
+
readonly HIGHLIGHT: "iti__highlight";
|
|
69
|
+
};
|
|
70
|
+
export const KEYS: {
|
|
71
|
+
readonly ARROW_UP: "ArrowUp";
|
|
72
|
+
readonly ARROW_DOWN: "ArrowDown";
|
|
73
|
+
readonly SPACE: " ";
|
|
74
|
+
readonly ENTER: "Enter";
|
|
75
|
+
readonly ESC: "Escape";
|
|
76
|
+
readonly TAB: "Tab";
|
|
77
|
+
};
|
|
78
|
+
export const INPUT_TYPES: {
|
|
79
|
+
readonly PASTE: "insertFromPaste";
|
|
80
|
+
readonly DELETE_FWD: "deleteContentForward";
|
|
81
|
+
};
|
|
82
|
+
export const REGEX: {
|
|
83
|
+
readonly ALPHA_UNICODE: RegExp;
|
|
84
|
+
readonly NON_PLUS_NUMERIC: RegExp;
|
|
85
|
+
readonly NON_PLUS_NUMERIC_GLOBAL: RegExp;
|
|
86
|
+
readonly HIDDEN_SEARCH_CHAR: RegExp;
|
|
87
|
+
};
|
|
88
|
+
export const TIMINGS: {
|
|
89
|
+
readonly SEARCH_DEBOUNCE_MS: 100;
|
|
90
|
+
readonly HIDDEN_SEARCH_RESET_MS: 1000;
|
|
91
|
+
readonly NEXT_TICK: 0;
|
|
92
|
+
};
|
|
93
|
+
export const SENTINELS: {
|
|
94
|
+
readonly UNKNOWN_NUMBER_TYPE: -99;
|
|
95
|
+
readonly UNKNOWN_VALIDATION_ERROR: -99;
|
|
96
|
+
};
|
|
97
|
+
export const LAYOUT: {
|
|
98
|
+
readonly SANE_SELECTED_WITH_DIAL_WIDTH: 78;
|
|
99
|
+
readonly SANE_SELECTED_NO_DIAL_WIDTH: 42;
|
|
100
|
+
readonly INPUT_PADDING_EXTRA_LEFT: 6;
|
|
101
|
+
};
|
|
102
|
+
export const DIAL: {
|
|
103
|
+
readonly PLUS: "+";
|
|
104
|
+
readonly NANP: "1";
|
|
105
|
+
};
|
|
106
|
+
export const UK: {
|
|
107
|
+
readonly ISO2: Iso2;
|
|
108
|
+
readonly DIAL_CODE: "44";
|
|
109
|
+
readonly MOBILE_PREFIX: "7";
|
|
110
|
+
readonly MOBILE_CORE_LENGTH: 10;
|
|
111
|
+
};
|
|
112
|
+
export const US: {
|
|
113
|
+
ISO2: Iso2;
|
|
114
|
+
DIAL_CODE: string;
|
|
115
|
+
};
|
|
116
|
+
export const PLACEHOLDER_MODES: {
|
|
117
|
+
readonly AGGRESSIVE: "aggressive";
|
|
118
|
+
readonly POLITE: "polite";
|
|
119
|
+
};
|
|
120
|
+
export const INITIAL_COUNTRY: {
|
|
121
|
+
readonly AUTO: "auto";
|
|
122
|
+
};
|
|
123
|
+
export const DATA_KEYS: {
|
|
124
|
+
readonly COUNTRY_CODE: "countryCode";
|
|
125
|
+
readonly DIAL_CODE: "dialCode";
|
|
126
|
+
};
|
|
127
|
+
export const ARIA: {
|
|
128
|
+
readonly EXPANDED: "aria-expanded";
|
|
129
|
+
readonly LABEL: "aria-label";
|
|
130
|
+
readonly SELECTED: "aria-selected";
|
|
131
|
+
readonly ACTIVE_DESCENDANT: "aria-activedescendant";
|
|
132
|
+
readonly HASPOPUP: "aria-haspopup";
|
|
133
|
+
readonly CONTROLS: "aria-controls";
|
|
134
|
+
readonly HIDDEN: "aria-hidden";
|
|
135
|
+
readonly AUTOCOMPLETE: "aria-autocomplete";
|
|
136
|
+
readonly MODAL: "aria-modal";
|
|
137
|
+
};
|
|
138
|
+
}
|
|
53
139
|
declare module "modules/types/public-api" {
|
|
54
140
|
import type { Country, Iso2 } from "intl-tel-input/data";
|
|
55
141
|
import type { I18n } from "intl-tel-input/i18n/types";
|
|
@@ -127,14 +213,34 @@ declare module "modules/types/public-api" {
|
|
|
127
213
|
export type SelectedCountryData = Country | EmptyObject;
|
|
128
214
|
}
|
|
129
215
|
declare module "modules/core/options" {
|
|
216
|
+
import { I18n } from "intl-tel-input/i18n/types";
|
|
130
217
|
import type { AllOptions } from "modules/types/public-api";
|
|
131
218
|
export const defaults: AllOptions;
|
|
132
|
-
export
|
|
219
|
+
export const applyOptionSideEffects: (o: AllOptions, defaultEnglishStrings: I18n) => void;
|
|
133
220
|
}
|
|
134
221
|
declare module "modules/utils/string" {
|
|
135
222
|
export const getNumeric: (s: string) => string;
|
|
136
223
|
export const normaliseString: (s?: string) => string;
|
|
137
224
|
}
|
|
225
|
+
declare module "modules/core/countrySearch" {
|
|
226
|
+
import type { Country } from "intl-tel-input/data";
|
|
227
|
+
/**
|
|
228
|
+
* Country search: Given raw query, return ordered list of countries by priority buckets.
|
|
229
|
+
* Buckets (in order):
|
|
230
|
+
* 1. exact ISO2 matches
|
|
231
|
+
* 2. name starts with
|
|
232
|
+
* 3. name contains
|
|
233
|
+
* 4. dial code exact match (bare or with plus)
|
|
234
|
+
* 5. dial code contains (with plus form)
|
|
235
|
+
* 6. initials match
|
|
236
|
+
* Each bucket preserves country.priority ordering.
|
|
237
|
+
*/
|
|
238
|
+
export const getMatchedCountries: (countries: Country[], query: string) => Country[];
|
|
239
|
+
/**
|
|
240
|
+
* Hidden search (when countrySearch disabled): find first whose name starts with query (case-insensitive).
|
|
241
|
+
*/
|
|
242
|
+
export const findFirstCountryStartingWith: (countries: Country[], query: string) => Country | null;
|
|
243
|
+
}
|
|
138
244
|
declare module "modules/utils/dom" {
|
|
139
245
|
/**
|
|
140
246
|
* Build a space-delimited class string from an object map of className -> truthy/falsey.
|
|
@@ -143,6 +249,15 @@ declare module "modules/utils/dom" {
|
|
|
143
249
|
export const buildClassNames: (flags: Record<string, unknown>) => string;
|
|
144
250
|
export const createEl: (tagName: string, attrs?: object | null, container?: HTMLElement) => HTMLElement;
|
|
145
251
|
}
|
|
252
|
+
declare module "modules/core/icons" {
|
|
253
|
+
/** Magnifying glass search icon */
|
|
254
|
+
export const buildSearchIcon: () => string;
|
|
255
|
+
/**
|
|
256
|
+
* Clear (circle with X) icon
|
|
257
|
+
* @param id Instance id used to create a unique mask id.
|
|
258
|
+
*/
|
|
259
|
+
export const buildClearIcon: (id: number) => string;
|
|
260
|
+
}
|
|
146
261
|
declare module "modules/core/ui" {
|
|
147
262
|
import { Country } from "intl-tel-input/data";
|
|
148
263
|
import { AllOptions } from "modules/types/public-api";
|
|
@@ -197,30 +312,31 @@ declare module "modules/data/country-data" {
|
|
|
197
312
|
dialCodeMaxLen: number;
|
|
198
313
|
dialCodeToIso2Map: Record<string, Iso2[]>;
|
|
199
314
|
}
|
|
200
|
-
export
|
|
201
|
-
export
|
|
202
|
-
export
|
|
203
|
-
export
|
|
204
|
-
export
|
|
315
|
+
export const processAllCountries: (options: AllOptions) => Country[];
|
|
316
|
+
export const translateCountryNames: (countries: Country[], options: AllOptions) => void;
|
|
317
|
+
export const processDialCodes: (countries: Country[], options: AllOptions) => DialCodeProcessingResult;
|
|
318
|
+
export const sortCountries: (countries: Country[], options: AllOptions) => void;
|
|
319
|
+
export const cacheSearchTokens: (countries: Country[]) => void;
|
|
205
320
|
}
|
|
206
321
|
declare module "modules/format/formatting" {
|
|
207
322
|
import { SelectedCountryData } from "modules/types/public-api";
|
|
208
|
-
export
|
|
209
|
-
export
|
|
323
|
+
export const beforeSetNumber: (fullNumber: string, dialCode: string, separateDialCode: boolean, selectedCountryData: SelectedCountryData) => string;
|
|
324
|
+
export const formatNumberAsYouType: (fullNumber: string, telInputValue: string, utils: any, selectedCountryData: SelectedCountryData, separateDialCode: boolean) => string;
|
|
210
325
|
}
|
|
211
326
|
declare module "modules/format/caret" {
|
|
212
|
-
export
|
|
327
|
+
export const translateCursorPosition: (relevantChars: number, formattedValue: string, prevCaretPos: number, isDeleteForwards: boolean) => number;
|
|
213
328
|
}
|
|
214
329
|
declare module "modules/data/nanp-regionless" {
|
|
215
330
|
export const regionlessNanpNumbers: string[];
|
|
216
331
|
export const isRegionlessNanp: (number: string) => boolean;
|
|
217
332
|
}
|
|
218
333
|
declare module "modules/types/events" {
|
|
334
|
+
import { EVENTS } from "modules/constants";
|
|
219
335
|
export type ItiEventMap = {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
336
|
+
[EVENTS.COUNTRY_CHANGE]: Record<string, never>;
|
|
337
|
+
[EVENTS.OPEN_COUNTRY_DROPDOWN]: Record<string, never>;
|
|
338
|
+
[EVENTS.CLOSE_COUNTRY_DROPDOWN]: Record<string, never>;
|
|
339
|
+
[EVENTS.INPUT]: {
|
|
224
340
|
isSetNumber?: boolean;
|
|
225
341
|
};
|
|
226
342
|
};
|
|
@@ -274,9 +390,13 @@ declare module "intl-tel-input" {
|
|
|
274
390
|
private _openDropdown;
|
|
275
391
|
private _setDropdownPosition;
|
|
276
392
|
private _bindDropdownListeners;
|
|
393
|
+
private _bindDropdownMouseoverListener;
|
|
394
|
+
private _bindDropdownCountryClickListener;
|
|
395
|
+
private _bindDropdownClickOffListener;
|
|
396
|
+
private _bindDropdownKeydownListener;
|
|
397
|
+
private _bindDropdownSearchListeners;
|
|
277
398
|
private _searchForCountry;
|
|
278
399
|
private _filterCountriesByQuery;
|
|
279
|
-
private _getMatchedCountries;
|
|
280
400
|
private _handleUpDownKey;
|
|
281
401
|
private _handleEnterKey;
|
|
282
402
|
private _updateValFromNumber;
|