intl-tel-input 25.10.6 → 25.10.8

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.
Files changed (35) hide show
  1. package/README.md +5 -5
  2. package/angular/README.md +1 -1
  3. package/angular/build/IntlTelInput.js +415 -316
  4. package/angular/build/IntlTelInputWithUtils.js +466 -338
  5. package/angular/build/types/intl-tel-input/angular.d.ts +2 -1
  6. package/angular/build/types/intl-tel-input/angularWithUtils.d.ts +2 -1
  7. package/angular/build/types/intl-tel-input/data.d.ts +3 -1
  8. package/angular/build/types/intl-tel-input/i18n/types.d.ts +2 -245
  9. package/angular/build/types/intl-tel-input.d.ts +17 -87
  10. package/angular/build/types/modules/core/options.d.ts +3 -0
  11. package/angular/build/types/modules/data/country-data.d.ts +12 -0
  12. package/angular/build/types/modules/data/nanp-regionless.d.ts +2 -0
  13. package/angular/build/types/modules/format/caret.d.ts +1 -0
  14. package/angular/build/types/modules/format/formatting.d.ts +3 -0
  15. package/angular/build/types/modules/types/public-api.d.ts +79 -0
  16. package/angular/build/types/modules/utils/dom.d.ts +1 -0
  17. package/angular/build/types/modules/utils/string.d.ts +2 -0
  18. package/build/js/data.js +3 -2
  19. package/build/js/data.min.js +2 -2
  20. package/build/js/intlTelInput.d.ts +100 -292
  21. package/build/js/intlTelInput.js +461 -357
  22. package/build/js/intlTelInput.min.js +13 -13
  23. package/build/js/intlTelInputWithUtils.js +512 -379
  24. package/build/js/intlTelInputWithUtils.min.js +13 -13
  25. package/build/js/utils.js +18 -15
  26. package/package.json +1 -1
  27. package/react/README.md +1 -1
  28. package/react/build/IntlTelInput.cjs +460 -356
  29. package/react/build/IntlTelInput.d.ts +104 -294
  30. package/react/build/IntlTelInput.js +460 -356
  31. package/react/build/IntlTelInputWithUtils.cjs +511 -378
  32. package/react/build/IntlTelInputWithUtils.js +511 -378
  33. package/vue/README.md +1 -1
  34. package/vue/build/IntlTelInput.mjs +506 -452
  35. package/vue/build/IntlTelInputWithUtils.mjs +1096 -1013
@@ -1,7 +1,8 @@
1
1
  import intlTelInput from "../intl-tel-input";
2
- import { Iti, SomeOptions } from "../intl-tel-input";
2
+ import { Iti } from "../intl-tel-input";
3
3
  import { OnInit, OnDestroy, ElementRef, EventEmitter, AfterViewInit, OnChanges, SimpleChanges } from "@angular/core";
4
4
  import { ControlValueAccessor, Validator, AbstractControl, ValidationErrors } from "@angular/forms";
5
+ import { SomeOptions } from "../modules/types/public-api";
5
6
  import * as i0 from "@angular/core";
6
7
  export { intlTelInput };
7
8
  export declare const PHONE_ERROR_MESSAGES: string[];
@@ -1,7 +1,8 @@
1
1
  import intlTelInput from "./intlTelInputWithUtils";
2
- import { Iti, SomeOptions } from "../intl-tel-input";
2
+ import { Iti } from "../intl-tel-input";
3
3
  import { OnInit, OnDestroy, ElementRef, EventEmitter, AfterViewInit, OnChanges, SimpleChanges } from "@angular/core";
4
4
  import { ControlValueAccessor, Validator, AbstractControl, ValidationErrors } from "@angular/forms";
5
+ import { SomeOptions } from "../modules/types/public-api";
5
6
  import * as i0 from "@angular/core";
6
7
  export { intlTelInput };
7
8
  export declare const PHONE_ERROR_MESSAGES: string[];
@@ -1,5 +1,7 @@
1
+ export declare const rawCountryData: readonly [readonly ["af", "93"], readonly ["ax", "358", 1], readonly ["al", "355"], readonly ["dz", "213"], readonly ["as", "1", 5, readonly ["684"]], readonly ["ad", "376"], readonly ["ao", "244"], readonly ["ai", "1", 6, readonly ["264"]], readonly ["ag", "1", 7, readonly ["268"]], readonly ["ar", "54"], readonly ["am", "374"], readonly ["aw", "297"], readonly ["ac", "247"], readonly ["au", "61", 0, any, "0"], readonly ["at", "43"], readonly ["az", "994"], readonly ["bs", "1", 8, readonly ["242"]], readonly ["bh", "973"], readonly ["bd", "880"], readonly ["bb", "1", 9, readonly ["246"]], readonly ["by", "375"], readonly ["be", "32"], readonly ["bz", "501"], readonly ["bj", "229"], readonly ["bm", "1", 10, readonly ["441"]], readonly ["bt", "975"], readonly ["bo", "591"], readonly ["ba", "387"], readonly ["bw", "267"], readonly ["br", "55"], readonly ["io", "246"], readonly ["vg", "1", 11, readonly ["284"]], readonly ["bn", "673"], readonly ["bg", "359"], readonly ["bf", "226"], readonly ["bi", "257"], readonly ["kh", "855"], readonly ["cm", "237"], readonly ["ca", "1", 1, readonly ["204", "226", "236", "249", "250", "263", "289", "306", "343", "354", "365", "367", "368", "382", "387", "403", "416", "418", "428", "431", "437", "438", "450", "584", "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"]], readonly ["cv", "238"], readonly ["bq", "599", 1, readonly ["3", "4", "7"]], readonly ["ky", "1", 12, readonly ["345"]], readonly ["cf", "236"], readonly ["td", "235"], readonly ["cl", "56"], readonly ["cn", "86"], readonly ["cx", "61", 2, readonly ["89164"], "0"], readonly ["cc", "61", 1, readonly ["89162"], "0"], readonly ["co", "57"], readonly ["km", "269"], readonly ["cg", "242"], readonly ["cd", "243"], readonly ["ck", "682"], readonly ["cr", "506"], readonly ["ci", "225"], readonly ["hr", "385"], readonly ["cu", "53"], readonly ["cw", "599", 0], readonly ["cy", "357"], readonly ["cz", "420"], readonly ["dk", "45"], readonly ["dj", "253"], readonly ["dm", "1", 13, readonly ["767"]], readonly ["do", "1", 2, readonly ["809", "829", "849"]], readonly ["ec", "593"], readonly ["eg", "20"], readonly ["sv", "503"], readonly ["gq", "240"], readonly ["er", "291"], readonly ["ee", "372"], readonly ["sz", "268"], readonly ["et", "251"], readonly ["fk", "500"], readonly ["fo", "298"], readonly ["fj", "679"], readonly ["fi", "358", 0], readonly ["fr", "33"], readonly ["gf", "594"], readonly ["pf", "689"], readonly ["ga", "241"], readonly ["gm", "220"], readonly ["ge", "995"], readonly ["de", "49"], readonly ["gh", "233"], readonly ["gi", "350"], readonly ["gr", "30"], readonly ["gl", "299"], readonly ["gd", "1", 14, readonly ["473"]], readonly ["gp", "590", 0], readonly ["gu", "1", 15, readonly ["671"]], readonly ["gt", "502"], readonly ["gg", "44", 1, readonly ["1481", "7781", "7839", "7911"], "0"], readonly ["gn", "224"], readonly ["gw", "245"], readonly ["gy", "592"], readonly ["ht", "509"], readonly ["hn", "504"], readonly ["hk", "852"], readonly ["hu", "36"], readonly ["is", "354"], readonly ["in", "91"], readonly ["id", "62"], readonly ["ir", "98"], readonly ["iq", "964"], readonly ["ie", "353"], readonly ["im", "44", 2, readonly ["1624", "74576", "7524", "7924", "7624"], "0"], readonly ["il", "972"], readonly ["it", "39", 0], readonly ["jm", "1", 4, readonly ["876", "658"]], readonly ["jp", "81"], readonly ["je", "44", 3, readonly ["1534", "7509", "7700", "7797", "7829", "7937"], "0"], readonly ["jo", "962"], readonly ["kz", "7", 1, readonly ["33", "7"], "8"], readonly ["ke", "254"], readonly ["ki", "686"], readonly ["xk", "383"], readonly ["kw", "965"], readonly ["kg", "996"], readonly ["la", "856"], readonly ["lv", "371"], readonly ["lb", "961"], readonly ["ls", "266"], readonly ["lr", "231"], readonly ["ly", "218"], readonly ["li", "423"], readonly ["lt", "370"], readonly ["lu", "352"], readonly ["mo", "853"], readonly ["mg", "261"], readonly ["mw", "265"], readonly ["my", "60"], readonly ["mv", "960"], readonly ["ml", "223"], readonly ["mt", "356"], readonly ["mh", "692"], readonly ["mq", "596"], readonly ["mr", "222"], readonly ["mu", "230"], readonly ["yt", "262", 1, readonly ["269", "639"], "0"], readonly ["mx", "52"], readonly ["fm", "691"], readonly ["md", "373"], readonly ["mc", "377"], readonly ["mn", "976"], readonly ["me", "382"], readonly ["ms", "1", 16, readonly ["664"]], readonly ["ma", "212", 0, any, "0"], readonly ["mz", "258"], readonly ["mm", "95"], readonly ["na", "264"], readonly ["nr", "674"], readonly ["np", "977"], readonly ["nl", "31"], readonly ["nc", "687"], readonly ["nz", "64"], readonly ["ni", "505"], readonly ["ne", "227"], readonly ["ng", "234"], readonly ["nu", "683"], readonly ["nf", "672"], readonly ["kp", "850"], readonly ["mk", "389"], readonly ["mp", "1", 17, readonly ["670"]], readonly ["no", "47", 0], readonly ["om", "968"], readonly ["pk", "92"], readonly ["pw", "680"], readonly ["ps", "970"], readonly ["pa", "507"], readonly ["pg", "675"], readonly ["py", "595"], readonly ["pe", "51"], readonly ["ph", "63"], readonly ["pl", "48"], readonly ["pt", "351"], readonly ["pr", "1", 3, readonly ["787", "939"]], readonly ["qa", "974"], readonly ["re", "262", 0, any, "0"], readonly ["ro", "40"], readonly ["ru", "7", 0, any, "8"], readonly ["rw", "250"], readonly ["ws", "685"], readonly ["sm", "378"], readonly ["st", "239"], readonly ["sa", "966"], readonly ["sn", "221"], readonly ["rs", "381"], readonly ["sc", "248"], readonly ["sl", "232"], readonly ["sg", "65"], readonly ["sx", "1", 21, readonly ["721"]], readonly ["sk", "421"], readonly ["si", "386"], readonly ["sb", "677"], readonly ["so", "252"], readonly ["za", "27"], readonly ["kr", "82"], readonly ["ss", "211"], readonly ["es", "34"], readonly ["lk", "94"], readonly ["bl", "590", 1], readonly ["sh", "290"], readonly ["kn", "1", 18, readonly ["869"]], readonly ["lc", "1", 19, readonly ["758"]], readonly ["mf", "590", 2], readonly ["pm", "508"], readonly ["vc", "1", 20, readonly ["784"]], readonly ["sd", "249"], readonly ["sr", "597"], readonly ["sj", "47", 1, readonly ["79"]], readonly ["se", "46"], readonly ["ch", "41"], readonly ["sy", "963"], readonly ["tw", "886"], readonly ["tj", "992"], readonly ["tz", "255"], readonly ["th", "66"], readonly ["tl", "670"], readonly ["tg", "228"], readonly ["tk", "690"], readonly ["to", "676"], readonly ["tt", "1", 22, readonly ["868"]], readonly ["tn", "216"], readonly ["tr", "90"], readonly ["tm", "993"], readonly ["tc", "1", 23, readonly ["649"]], readonly ["tv", "688"], readonly ["vi", "1", 24, readonly ["340"]], readonly ["ug", "256"], readonly ["ua", "380"], readonly ["ae", "971"], readonly ["gb", "44", 0, any, "0"], readonly ["us", "1", 0], readonly ["uy", "598"], readonly ["uz", "998"], readonly ["vu", "678"], readonly ["va", "39", 1, readonly ["06698"]], readonly ["ve", "58"], readonly ["vn", "84"], readonly ["wf", "681"], readonly ["eh", "212", 1, readonly ["5288", "5289"], "0"], readonly ["ye", "967"], readonly ["zm", "260"], readonly ["zw", "263"]];
2
+ export type Iso2 = typeof rawCountryData[number][0];
1
3
  export type Country = {
2
- iso2: string;
4
+ iso2: Iso2;
3
5
  dialCode: string;
4
6
  priority: number;
5
7
  areaCodes: string[] | null;
@@ -1,248 +1,5 @@
1
- export type I18n = {
2
- af?: string;
3
- al?: string;
4
- dz?: string;
5
- as?: string;
6
- ad?: string;
7
- ao?: string;
8
- ai?: string;
9
- ag?: string;
10
- ar?: string;
11
- am?: string;
12
- aw?: string;
13
- ac?: string;
14
- au?: string;
15
- at?: string;
16
- az?: string;
17
- bs?: string;
18
- bh?: string;
19
- bd?: string;
20
- bb?: string;
21
- by?: string;
22
- be?: string;
23
- bz?: string;
24
- bj?: string;
25
- bm?: string;
26
- bt?: string;
27
- bo?: string;
28
- ba?: string;
29
- bw?: string;
30
- br?: string;
31
- io?: string;
32
- vg?: string;
33
- bn?: string;
34
- bg?: string;
35
- bf?: string;
36
- bi?: string;
37
- kh?: string;
38
- cm?: string;
39
- ca?: string;
40
- cv?: string;
41
- bq?: string;
42
- ky?: string;
43
- cf?: string;
44
- td?: string;
45
- cl?: string;
46
- cn?: string;
47
- cx?: string;
48
- cc?: string;
49
- co?: string;
50
- km?: string;
51
- cg?: string;
52
- cd?: string;
53
- ck?: string;
54
- cr?: string;
55
- hr?: string;
56
- cu?: string;
57
- cw?: string;
58
- cy?: string;
59
- cz?: string;
60
- ci?: string;
61
- dk?: string;
62
- dj?: string;
63
- dm?: string;
64
- do?: string;
65
- ec?: string;
66
- eg?: string;
67
- sv?: string;
68
- gq?: string;
69
- er?: string;
70
- ee?: string;
71
- sz?: string;
72
- et?: string;
73
- fk?: string;
74
- fo?: string;
75
- fj?: string;
76
- fi?: string;
77
- fr?: string;
78
- gf?: string;
79
- pf?: string;
80
- ga?: string;
81
- gm?: string;
82
- ge?: string;
83
- de?: string;
84
- gh?: string;
85
- gi?: string;
86
- gr?: string;
87
- gl?: string;
88
- gd?: string;
89
- gp?: string;
90
- gu?: string;
91
- gt?: string;
92
- gg?: string;
93
- gn?: string;
94
- gw?: string;
95
- gy?: string;
96
- ht?: string;
97
- hn?: string;
98
- hk?: string;
99
- hu?: string;
100
- is?: string;
101
- in?: string;
102
- id?: string;
103
- ir?: string;
104
- iq?: string;
105
- ie?: string;
106
- im?: string;
107
- il?: string;
108
- it?: string;
109
- jm?: string;
110
- jp?: string;
111
- je?: string;
112
- jo?: string;
113
- kz?: string;
114
- ke?: string;
115
- ki?: string;
116
- xk?: string;
117
- kw?: string;
118
- kg?: string;
119
- la?: string;
120
- lv?: string;
121
- lb?: string;
122
- ls?: string;
123
- lr?: string;
124
- ly?: string;
125
- li?: string;
126
- lt?: string;
127
- lu?: string;
128
- mo?: string;
129
- mg?: string;
130
- mw?: string;
131
- my?: string;
132
- mv?: string;
133
- ml?: string;
134
- mt?: string;
135
- mh?: string;
136
- mq?: string;
137
- mr?: string;
138
- mu?: string;
139
- yt?: string;
140
- mx?: string;
141
- fm?: string;
142
- md?: string;
143
- mc?: string;
144
- mn?: string;
145
- me?: string;
146
- ms?: string;
147
- ma?: string;
148
- mz?: string;
149
- mm?: string;
150
- na?: string;
151
- nr?: string;
152
- np?: string;
153
- nl?: string;
154
- nc?: string;
155
- nz?: string;
156
- ni?: string;
157
- ne?: string;
158
- ng?: string;
159
- nu?: string;
160
- nf?: string;
161
- kp?: string;
162
- mk?: string;
163
- mp?: string;
164
- no?: string;
165
- om?: string;
166
- pk?: string;
167
- pw?: string;
168
- ps?: string;
169
- pa?: string;
170
- pg?: string;
171
- py?: string;
172
- pe?: string;
173
- ph?: string;
174
- pl?: string;
175
- pt?: string;
176
- pr?: string;
177
- qa?: string;
178
- ro?: string;
179
- ru?: string;
180
- rw?: string;
181
- re?: string;
182
- ws?: string;
183
- sm?: string;
184
- sa?: string;
185
- sn?: string;
186
- rs?: string;
187
- sc?: string;
188
- sl?: string;
189
- sg?: string;
190
- sx?: string;
191
- sk?: string;
192
- si?: string;
193
- sb?: string;
194
- so?: string;
195
- za?: string;
196
- kr?: string;
197
- ss?: string;
198
- es?: string;
199
- lk?: string;
200
- bl?: string;
201
- sh?: string;
202
- kn?: string;
203
- lc?: string;
204
- mf?: string;
205
- pm?: string;
206
- vc?: string;
207
- sd?: string;
208
- sr?: string;
209
- sj?: string;
210
- se?: string;
211
- ch?: string;
212
- sy?: string;
213
- st?: string;
214
- tw?: string;
215
- tj?: string;
216
- tz?: string;
217
- th?: string;
218
- tl?: string;
219
- tg?: string;
220
- tk?: string;
221
- to?: string;
222
- tt?: string;
223
- tn?: string;
224
- tr?: string;
225
- tm?: string;
226
- tc?: string;
227
- tv?: string;
228
- vi?: string;
229
- ug?: string;
230
- ua?: string;
231
- ae?: string;
232
- gb?: string;
233
- us?: string;
234
- uy?: string;
235
- uz?: string;
236
- vu?: string;
237
- va?: string;
238
- ve?: string;
239
- vn?: string;
240
- wf?: string;
241
- eh?: string;
242
- ye?: string;
243
- zm?: string;
244
- zw?: string;
245
- ax?: string;
1
+ import type { Iso2 } from "../data";
2
+ export type I18n = Partial<Record<Iso2, string>> & {
246
3
  selectedCountryAriaLabel?: string;
247
4
  searchPlaceholder?: string;
248
5
  clearSearchAriaLabel?: string;
@@ -1,86 +1,10 @@
1
- import { Country } from "./intl-tel-input/data";
2
- import { I18n } from "./intl-tel-input/i18n/types";
1
+ import { Iso2 } from "./intl-tel-input/data";
2
+ import type { NumberType, SelectedCountryData, SomeOptions, IntlTelInputInterface } from "./modules/types/public-api";
3
3
  declare global {
4
4
  interface HTMLInputElement {
5
5
  iti?: Iti;
6
6
  }
7
7
  }
8
- type UtilsLoader = () => Promise<{
9
- default: ItiUtils;
10
- }>;
11
- interface IntlTelInputInterface {
12
- (input: HTMLInputElement, options?: SomeOptions): Iti;
13
- autoCountry?: string;
14
- defaults: AllOptions;
15
- documentReady: () => boolean;
16
- getCountryData: () => Country[];
17
- getInstance: (input: HTMLInputElement) => Iti | null;
18
- instances: {
19
- [key: string]: Iti;
20
- };
21
- attachUtils: (source: UtilsLoader) => Promise<unknown> | null;
22
- startedLoadingAutoCountry: boolean;
23
- startedLoadingUtilsScript: boolean;
24
- version: string | undefined;
25
- utils?: ItiUtils;
26
- }
27
- type ItiUtils = {
28
- formatNumber(number: string, iso2: string | undefined, format?: number): string;
29
- formatNumberAsYouType(number: string, iso2: string | undefined): string;
30
- getCoreNumber(number: string, iso2: string | undefined): string;
31
- getExampleNumber(iso2: string | undefined, nationalMode: boolean, numberType: number, useE164?: boolean): string;
32
- getExtension(number: string, iso2: string | undefined): string;
33
- getNumberType(number: string, iso2: string | undefined): number;
34
- getValidationError(number: string, iso2: string | undefined): number;
35
- isPossibleNumber(number: string, iso2: string | undefined, numberType?: NumberType[] | null): boolean;
36
- isValidNumber(number: string, iso2: string | undefined, numberType?: NumberType[] | null): boolean;
37
- numberFormat: {
38
- NATIONAL: number;
39
- INTERNATIONAL: number;
40
- E164: number;
41
- RFC3966: number;
42
- };
43
- numberType: object;
44
- };
45
- type NumberType = "FIXED_LINE_OR_MOBILE" | "FIXED_LINE" | "MOBILE" | "PAGER" | "PERSONAL_NUMBER" | "PREMIUM_RATE" | "SHARED_COST" | "TOLL_FREE" | "UAN" | "UNKNOWN" | "VOICEMAIL" | "VOIP";
46
- type SelectedCountryData = {
47
- name?: string;
48
- iso2?: string;
49
- dialCode?: string;
50
- areaCodes?: string[];
51
- nationalPrefix?: string;
52
- };
53
- interface AllOptions {
54
- allowDropdown: boolean;
55
- allowPhonewords: boolean;
56
- autoPlaceholder: string;
57
- containerClass: string;
58
- countryOrder: string[];
59
- countrySearch: boolean;
60
- customPlaceholder: ((selectedCountryPlaceholder: string, selectedCountryData: object) => string) | null;
61
- dropdownContainer: HTMLElement | null;
62
- excludeCountries: string[];
63
- fixDropdownWidth: boolean;
64
- formatAsYouType: boolean;
65
- formatOnDisplay: boolean;
66
- geoIpLookup: ((success: (iso2: string) => void, failure: () => void) => void) | null;
67
- hiddenInput: ((telInputName: string) => {
68
- phone: string;
69
- country?: string;
70
- }) | null;
71
- i18n: I18n;
72
- initialCountry: string;
73
- loadUtils: UtilsLoader;
74
- nationalMode: boolean;
75
- onlyCountries: string[];
76
- placeholderNumberType: NumberType;
77
- showFlags: boolean;
78
- separateDialCode: boolean;
79
- strictMode: boolean;
80
- useFullscreenPopup: boolean;
81
- validationNumberTypes: NumberType[] | null;
82
- }
83
- export type SomeOptions = Partial<AllOptions>;
84
8
  export declare class Iti {
85
9
  id: number;
86
10
  promise: Promise<[unknown, unknown]>;
@@ -122,6 +46,7 @@ export declare class Iti {
122
46
  private _handleCountryContainerKeydown;
123
47
  private _handleInputEvent;
124
48
  private _handleKeydownEvent;
49
+ private _handlePasteEvent;
125
50
  private _handleWindowScroll;
126
51
  private _handleMouseoverCountryList;
127
52
  private _handleClickCountryList;
@@ -140,15 +65,18 @@ export declare class Iti {
140
65
  */
141
66
  private static _buildClassNames;
142
67
  constructor(input: HTMLInputElement, customOptions?: SomeOptions);
68
+ private _detectEnvironmentAndLayout;
69
+ private _createInitPromises;
143
70
  _init(): void;
144
71
  private _processCountryData;
145
- private _cacheSearchTokens;
146
- private _sortCountries;
147
- private _addToDialCodeMap;
148
- private _processAllCountries;
149
- private _translateCountryNames;
150
- private _processDialCodes;
151
72
  private _generateMarkup;
73
+ private _prepareTelInput;
74
+ private _createWrapperAndInsert;
75
+ private _maybeBuildCountryContainer;
76
+ private _buildDropdownContent;
77
+ private _buildSearchUI;
78
+ private _maybeUpdateInputPaddingAndReveal;
79
+ private _maybeBuildHiddenInputs;
152
80
  private _appendListItems;
153
81
  private _setInitialState;
154
82
  private _initListeners;
@@ -158,6 +86,9 @@ export declare class Iti {
158
86
  private _loadAutoCountry;
159
87
  private _openDropdownWithPlus;
160
88
  private _initTelInputListeners;
89
+ private _bindInputListener;
90
+ private _maybeBindKeydownListener;
91
+ private _maybeBindPasteListener;
161
92
  private _cap;
162
93
  private _trigger;
163
94
  private _openDropdown;
@@ -165,6 +96,7 @@ export declare class Iti {
165
96
  private _bindDropdownListeners;
166
97
  private _searchForCountry;
167
98
  private _filterCountries;
99
+ private _getMatchedCountries;
168
100
  private _updateSearchResultsA11yText;
169
101
  private _handleUpDownKey;
170
102
  private _handleEnterKey;
@@ -173,7 +105,6 @@ export declare class Iti {
173
105
  private _ensureHasDialCode;
174
106
  private _getNewCountryFromNumber;
175
107
  private _highlightListItem;
176
- private _getCountryData;
177
108
  private _setCountry;
178
109
  private _updateInputPadding;
179
110
  private _updateMaxLength;
@@ -187,7 +118,6 @@ export declare class Iti {
187
118
  private _getFullNumber;
188
119
  private _beforeSetNumber;
189
120
  private _triggerCountryChange;
190
- private _formatNumberAsYouType;
191
121
  handleAutoCountry(): void;
192
122
  handleUtils(): void;
193
123
  destroy(): void;
@@ -201,7 +131,7 @@ export declare class Iti {
201
131
  private _utilsIsPossibleNumber;
202
132
  private _validateNumber;
203
133
  private _utilsIsValidNumber;
204
- setCountry(iso2: string): void;
134
+ setCountry(iso2: Iso2): void;
205
135
  setNumber(number: string): void;
206
136
  setPlaceholderNumberType(type: NumberType): void;
207
137
  setDisabled(disabled: boolean): void;
@@ -0,0 +1,3 @@
1
+ import type { AllOptions } from "../types/public-api";
2
+ export declare const defaults: AllOptions;
3
+ export declare function applyOptionSideEffects(o: AllOptions): void;
@@ -0,0 +1,12 @@
1
+ import { Country, Iso2 } from "../../intl-tel-input/data";
2
+ import type { AllOptions } from "../types/public-api";
3
+ export interface DialCodeProcessingResult {
4
+ dialCodes: Set<string>;
5
+ dialCodeMaxLen: number;
6
+ dialCodeToIso2Map: Record<string, Iso2[]>;
7
+ }
8
+ export declare function processAllCountries(options: AllOptions): Country[];
9
+ export declare function translateCountryNames(countries: Country[], options: AllOptions): void;
10
+ export declare function processDialCodes(countries: Country[], options: AllOptions): DialCodeProcessingResult;
11
+ export declare function sortCountries(countries: Country[], options: AllOptions): void;
12
+ export declare function cacheSearchTokens(countries: Country[]): void;
@@ -0,0 +1,2 @@
1
+ export declare const regionlessNanpNumbers: string[];
2
+ export declare const isRegionlessNanp: (number: string) => boolean;
@@ -0,0 +1 @@
1
+ export declare function translateCursorPosition(relevantChars: number, formattedValue: string, prevCaretPos: number, isDeleteForwards: boolean): number;
@@ -0,0 +1,3 @@
1
+ import { SelectedCountryData } from "../types/public-api";
2
+ export declare function beforeSetNumber(fullNumber: string, dialCode: string, separateDialCode: boolean, selectedCountryData: SelectedCountryData): string;
3
+ export declare function formatNumberAsYouType(fullNumber: string, telInputValue: string, utils: any, selectedCountryData: SelectedCountryData, separateDialCode: boolean): string;
@@ -0,0 +1,79 @@
1
+ import type { Country, Iso2 } from "../../intl-tel-input/data";
2
+ import type { I18n } from "../../intl-tel-input/i18n/types";
3
+ import type { Iti } from "../../intl-tel-input";
4
+ export type UtilsLoader = () => Promise<{
5
+ default: ItiUtils;
6
+ }>;
7
+ export type ItiUtils = {
8
+ formatNumber(number: string, iso2: string | undefined, format?: number): string;
9
+ formatNumberAsYouType(number: string, iso2: string | undefined): string;
10
+ getCoreNumber(number: string, iso2: string | undefined): string;
11
+ getExampleNumber(iso2: string | undefined, nationalMode: boolean, numberType: number, useE164?: boolean): string;
12
+ getExtension(number: string, iso2: string | undefined): string;
13
+ getNumberType(number: string, iso2: string | undefined): number;
14
+ getValidationError(number: string, iso2: string | undefined): number;
15
+ isPossibleNumber(number: string, iso2: string | undefined, numberType?: NumberType[] | null): boolean;
16
+ isValidNumber(number: string, iso2: string | undefined, numberType?: NumberType[] | null): boolean;
17
+ numberFormat: {
18
+ NATIONAL: number;
19
+ INTERNATIONAL: number;
20
+ E164: number;
21
+ RFC3966: number;
22
+ };
23
+ numberType: Record<string, number>;
24
+ };
25
+ export type NumberType = "FIXED_LINE_OR_MOBILE" | "FIXED_LINE" | "MOBILE" | "PAGER" | "PERSONAL_NUMBER" | "PREMIUM_RATE" | "SHARED_COST" | "TOLL_FREE" | "UAN" | "UNKNOWN" | "VOICEMAIL" | "VOIP";
26
+ export type SelectedCountryData = {
27
+ name?: string;
28
+ iso2?: Iso2;
29
+ dialCode?: string;
30
+ areaCodes?: string[];
31
+ nationalPrefix?: string;
32
+ };
33
+ export interface AllOptions {
34
+ allowDropdown: boolean;
35
+ allowPhonewords: boolean;
36
+ autoPlaceholder: string;
37
+ containerClass: string;
38
+ countryOrder: Iso2[] | null;
39
+ countrySearch: boolean;
40
+ customPlaceholder: ((selectedCountryPlaceholder: string, selectedCountryData: object) => string) | null;
41
+ dropdownContainer: HTMLElement | null;
42
+ excludeCountries: Iso2[];
43
+ fixDropdownWidth: boolean;
44
+ formatAsYouType: boolean;
45
+ formatOnDisplay: boolean;
46
+ geoIpLookup: ((success: (iso2: Iso2) => void, failure: () => void) => void) | null;
47
+ hiddenInput: ((telInputName: string) => {
48
+ phone: string;
49
+ country?: string;
50
+ }) | null;
51
+ i18n: I18n;
52
+ initialCountry: Iso2 | "auto" | "";
53
+ loadUtils: UtilsLoader | null;
54
+ nationalMode: boolean;
55
+ onlyCountries: Iso2[];
56
+ placeholderNumberType: NumberType;
57
+ showFlags: boolean;
58
+ separateDialCode: boolean;
59
+ strictMode: boolean;
60
+ useFullscreenPopup: boolean;
61
+ validationNumberTypes: NumberType[] | null;
62
+ }
63
+ export type SomeOptions = Partial<AllOptions>;
64
+ export interface IntlTelInputInterface {
65
+ (input: HTMLInputElement, options?: SomeOptions): Iti;
66
+ autoCountry?: Iso2;
67
+ defaults: AllOptions;
68
+ documentReady: () => boolean;
69
+ getCountryData: () => Country[];
70
+ getInstance: (input: HTMLInputElement) => Iti | null;
71
+ instances: {
72
+ [key: string]: Iti;
73
+ };
74
+ attachUtils: (source: UtilsLoader) => Promise<unknown> | null;
75
+ startedLoadingAutoCountry: boolean;
76
+ startedLoadingUtilsScript: boolean;
77
+ version: string | undefined;
78
+ utils?: ItiUtils;
79
+ }
@@ -0,0 +1 @@
1
+ export declare const createEl: (tagName: string, attrs?: object | null, container?: HTMLElement) => HTMLElement;
@@ -0,0 +1,2 @@
1
+ export declare const getNumeric: (s: string) => string;
2
+ export declare const normaliseString: (s?: string) => string;
package/build/js/data.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * International Telephone Input v25.10.6
2
+ * International Telephone Input v25.10.8
3
3
  * https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
@@ -35,7 +35,8 @@ var factoryOutput = (() => {
35
35
  // src/js/intl-tel-input/data.ts
36
36
  var data_exports = {};
37
37
  __export(data_exports, {
38
- default: () => data_default
38
+ default: () => data_default,
39
+ rawCountryData: () => rawCountryData
39
40
  });
40
41
  var rawCountryData = [
41
42
  [
@@ -1,5 +1,5 @@
1
1
  /*
2
- * International Telephone Input v25.10.6
2
+ * International Telephone Input v25.10.8
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 a=Object.defineProperty;var e=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var o=(n,t)=>{for(var r in t)a(n,r,{get:t[r],enumerable:!0})},u=(n,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of m(t))!g.call(n,s)&&s!==r&&a(n,s,{get:()=>t[s],enumerable:!(i=e(t,s))||i.enumerable});return n};var c=n=>u(a({},"__esModule",{value:!0}),n);var p={};o(p,{default:()=>b});var d=[["af","93"],["ax","358",1],["al","355"],["dz","213"],["as","1",5,["684"]],["ad","376"],["ao","244"],["ai","1",6,["264"]],["ag","1",7,["268"]],["ar","54"],["am","374"],["aw","297"],["ac","247"],["au","61",0,null,"0"],["at","43"],["az","994"],["bs","1",8,["242"]],["bh","973"],["bd","880"],["bb","1",9,["246"]],["by","375"],["be","32"],["bz","501"],["bj","229"],["bm","1",10,["441"]],["bt","975"],["bo","591"],["ba","387"],["bw","267"],["br","55"],["io","246"],["vg","1",11,["284"]],["bn","673"],["bg","359"],["bf","226"],["bi","257"],["kh","855"],["cm","237"],["ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","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"]],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"]],["cf","236"],["td","235"],["cl","56"],["cn","86"],["cx","61",2,["89164"],"0"],["cc","61",1,["89162"],"0"],["co","57"],["km","269"],["cg","242"],["cd","243"],["ck","682"],["cr","506"],["ci","225"],["hr","385"],["cu","53"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"]],["do","1",2,["809","829","849"]],["ec","593"],["eg","20"],["sv","503"],["gq","240"],["er","291"],["ee","372"],["sz","268"],["et","251"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0],["fr","33"],["gf","594"],["pf","689"],["ga","241"],["gm","220"],["ge","995"],["de","49"],["gh","233"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"]],["gp","590",0],["gu","1",15,["671"]],["gt","502"],["gg","44",1,["1481","7781","7839","7911"],"0"],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36"],["is","354"],["in","91"],["id","62"],["ir","98"],["iq","964"],["ie","353"],["im","44",2,["1624","74576","7524","7924","7624"],"0"],["il","972"],["it","39",0],["jm","1",4,["876","658"]],["jp","81"],["je","44",3,["1534","7509","7700","7797","7829","7937"],"0"],["jo","962"],["kz","7",1,["33","7"],"8"],["ke","254"],["ki","686"],["xk","383"],["kw","965"],["kg","996"],["la","856"],["lv","371"],["lb","961"],["ls","266"],["lr","231"],["ly","218"],["li","423"],["lt","370"],["lu","352"],["mo","853"],["mg","261"],["mw","265"],["my","60"],["mv","960"],["ml","223"],["mt","356"],["mh","692"],["mq","596"],["mr","222"],["mu","230"],["yt","262",1,["269","639"],"0"],["mx","52"],["fm","691"],["md","373"],["mc","377"],["mn","976"],["me","382"],["ms","1",16,["664"]],["ma","212",0,null,"0"],["mz","258"],["mm","95"],["na","264"],["nr","674"],["np","977"],["nl","31"],["nc","687"],["nz","64"],["ni","505"],["ne","227"],["ng","234"],["nu","683"],["nf","672"],["kp","850"],["mk","389"],["mp","1",17,["670"]],["no","47",0],["om","968"],["pk","92"],["pw","680"],["ps","970"],["pa","507"],["pg","675"],["py","595"],["pe","51"],["ph","63"],["pl","48"],["pt","351"],["pr","1",3,["787","939"]],["qa","974"],["re","262",0,null,"0"],["ro","40"],["ru","7",0,null,"8"],["rw","250"],["ws","685"],["sm","378"],["st","239"],["sa","966"],["sn","221"],["rs","381"],["sc","248"],["sl","232"],["sg","65"],["sx","1",21,["721"]],["sk","421"],["si","386"],["sb","677"],["so","252"],["za","27"],["kr","82"],["ss","211"],["es","34"],["lk","94"],["bl","590",1],["sh","290"],["kn","1",18,["869"]],["lc","1",19,["758"]],["mf","590",2],["pm","508"],["vc","1",20,["784"]],["sd","249"],["sr","597"],["sj","47",1,["79"]],["se","46"],["ch","41"],["sy","963"],["tw","886"],["tj","992"],["tz","255"],["th","66"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"]],["tn","216"],["tr","90"],["tm","993"],["tc","1",23,["649"]],["tv","688"],["vi","1",24,["340"]],["ug","256"],["ua","380"],["ae","971"],["gb","44",0,null,"0"],["us","1",0],["uy","598"],["uz","998"],["vu","678"],["va","39",1,["06698"]],["ve","58"],["vn","84"],["wf","681"],["eh","212",1,["5288","5289"],"0"],["ye","967"],["zm","260"],["zw","263"]],l=[];for(let n of d)l.push({name:"",iso2:n[0],dialCode:n[1],priority:n[2]||0,areaCodes:n[3]||null,nodeById:{},nationalPrefix:n[4]||null});var b=l;return c(p);})();
16
+ var factoryOutput=(()=>{var e=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var c=(n,t)=>{for(var a in t)e(n,a,{get:t[a],enumerable:!0})},u=(n,t,a,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of o(t))!g.call(n,s)&&s!==a&&e(n,s,{get:()=>t[s],enumerable:!(l=m(t,s))||l.enumerable});return n};var d=n=>u(e({},"__esModule",{value:!0}),n);var b={};c(b,{default:()=>p,rawCountryData:()=>r});var r=[["af","93"],["ax","358",1],["al","355"],["dz","213"],["as","1",5,["684"]],["ad","376"],["ao","244"],["ai","1",6,["264"]],["ag","1",7,["268"]],["ar","54"],["am","374"],["aw","297"],["ac","247"],["au","61",0,null,"0"],["at","43"],["az","994"],["bs","1",8,["242"]],["bh","973"],["bd","880"],["bb","1",9,["246"]],["by","375"],["be","32"],["bz","501"],["bj","229"],["bm","1",10,["441"]],["bt","975"],["bo","591"],["ba","387"],["bw","267"],["br","55"],["io","246"],["vg","1",11,["284"]],["bn","673"],["bg","359"],["bf","226"],["bi","257"],["kh","855"],["cm","237"],["ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","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"]],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"]],["cf","236"],["td","235"],["cl","56"],["cn","86"],["cx","61",2,["89164"],"0"],["cc","61",1,["89162"],"0"],["co","57"],["km","269"],["cg","242"],["cd","243"],["ck","682"],["cr","506"],["ci","225"],["hr","385"],["cu","53"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"]],["do","1",2,["809","829","849"]],["ec","593"],["eg","20"],["sv","503"],["gq","240"],["er","291"],["ee","372"],["sz","268"],["et","251"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0],["fr","33"],["gf","594"],["pf","689"],["ga","241"],["gm","220"],["ge","995"],["de","49"],["gh","233"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"]],["gp","590",0],["gu","1",15,["671"]],["gt","502"],["gg","44",1,["1481","7781","7839","7911"],"0"],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36"],["is","354"],["in","91"],["id","62"],["ir","98"],["iq","964"],["ie","353"],["im","44",2,["1624","74576","7524","7924","7624"],"0"],["il","972"],["it","39",0],["jm","1",4,["876","658"]],["jp","81"],["je","44",3,["1534","7509","7700","7797","7829","7937"],"0"],["jo","962"],["kz","7",1,["33","7"],"8"],["ke","254"],["ki","686"],["xk","383"],["kw","965"],["kg","996"],["la","856"],["lv","371"],["lb","961"],["ls","266"],["lr","231"],["ly","218"],["li","423"],["lt","370"],["lu","352"],["mo","853"],["mg","261"],["mw","265"],["my","60"],["mv","960"],["ml","223"],["mt","356"],["mh","692"],["mq","596"],["mr","222"],["mu","230"],["yt","262",1,["269","639"],"0"],["mx","52"],["fm","691"],["md","373"],["mc","377"],["mn","976"],["me","382"],["ms","1",16,["664"]],["ma","212",0,null,"0"],["mz","258"],["mm","95"],["na","264"],["nr","674"],["np","977"],["nl","31"],["nc","687"],["nz","64"],["ni","505"],["ne","227"],["ng","234"],["nu","683"],["nf","672"],["kp","850"],["mk","389"],["mp","1",17,["670"]],["no","47",0],["om","968"],["pk","92"],["pw","680"],["ps","970"],["pa","507"],["pg","675"],["py","595"],["pe","51"],["ph","63"],["pl","48"],["pt","351"],["pr","1",3,["787","939"]],["qa","974"],["re","262",0,null,"0"],["ro","40"],["ru","7",0,null,"8"],["rw","250"],["ws","685"],["sm","378"],["st","239"],["sa","966"],["sn","221"],["rs","381"],["sc","248"],["sl","232"],["sg","65"],["sx","1",21,["721"]],["sk","421"],["si","386"],["sb","677"],["so","252"],["za","27"],["kr","82"],["ss","211"],["es","34"],["lk","94"],["bl","590",1],["sh","290"],["kn","1",18,["869"]],["lc","1",19,["758"]],["mf","590",2],["pm","508"],["vc","1",20,["784"]],["sd","249"],["sr","597"],["sj","47",1,["79"]],["se","46"],["ch","41"],["sy","963"],["tw","886"],["tj","992"],["tz","255"],["th","66"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"]],["tn","216"],["tr","90"],["tm","993"],["tc","1",23,["649"]],["tv","688"],["vi","1",24,["340"]],["ug","256"],["ua","380"],["ae","971"],["gb","44",0,null,"0"],["us","1",0],["uy","598"],["uz","998"],["vu","678"],["va","39",1,["06698"]],["ve","58"],["vn","84"],["wf","681"],["eh","212",1,["5288","5289"],"0"],["ye","967"],["zm","260"],["zw","263"]],i=[];for(let n of r)i.push({name:"",iso2:n[0],dialCode:n[1],priority:n[2]||0,areaCodes:n[3]||null,nodeById:{},nationalPrefix:n[4]||null});var p=i;return d(b);})();
17
17
 
18
18
  // UMD
19
19
  return factoryOutput.default;