intl-tel-input 25.10.11 → 25.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -59
- package/angular/README.md +1 -1
- package/angular/build/IntlTelInput.js +671 -624
- package/angular/build/IntlTelInputWithUtils.js +674 -627
- package/angular/build/types/intl-tel-input.d.ts +17 -71
- package/angular/build/types/modules/core/ui.d.ts +44 -0
- package/angular/build/types/modules/format/formatting.d.ts +3 -3
- package/angular/build/types/modules/types/events.d.ts +8 -0
- package/angular/build/types/modules/types/public-api.d.ts +3 -0
- package/angular/build/types/modules/utils/dom.d.ts +5 -0
- package/build/css/intlTelInput.css +1 -13
- package/build/css/intlTelInput.min.css +1 -1
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/intlTelInput.d.ts +83 -74
- package/build/js/intlTelInput.js +759 -669
- package/build/js/intlTelInput.min.js +4 -4
- package/build/js/intlTelInputWithUtils.js +763 -673
- package/build/js/intlTelInputWithUtils.min.js +4 -4
- package/build/js/utils.js +4 -4
- package/package.json +2 -1
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +758 -668
- package/react/build/IntlTelInput.d.ts +83 -74
- package/react/build/IntlTelInput.js +758 -668
- package/react/build/IntlTelInputWithUtils.cjs +762 -672
- package/react/build/IntlTelInputWithUtils.js +762 -672
- package/vue/README.md +1 -1
- package/vue/build/IntlTelInput.mjs +710 -600
- package/vue/build/IntlTelInputWithUtils.mjs +989 -879
|
@@ -123,6 +123,8 @@ declare module "modules/types/public-api" {
|
|
|
123
123
|
version: string | undefined;
|
|
124
124
|
utils?: ItiUtils;
|
|
125
125
|
}
|
|
126
|
+
type EmptyObject = Record<string, never>;
|
|
127
|
+
export type SelectedCountryData = Country | EmptyObject;
|
|
126
128
|
}
|
|
127
129
|
declare module "modules/core/options" {
|
|
128
130
|
import type { AllOptions } from "modules/types/public-api";
|
|
@@ -134,8 +136,59 @@ declare module "modules/utils/string" {
|
|
|
134
136
|
export const normaliseString: (s?: string) => string;
|
|
135
137
|
}
|
|
136
138
|
declare module "modules/utils/dom" {
|
|
139
|
+
/**
|
|
140
|
+
* Build a space-delimited class string from an object map of className -> truthy/falsey.
|
|
141
|
+
* Only keys with truthy values are included.
|
|
142
|
+
*/
|
|
143
|
+
export const buildClassNames: (flags: Record<string, unknown>) => string;
|
|
137
144
|
export const createEl: (tagName: string, attrs?: object | null, container?: HTMLElement) => HTMLElement;
|
|
138
145
|
}
|
|
146
|
+
declare module "modules/core/ui" {
|
|
147
|
+
import { Country } from "intl-tel-input/data";
|
|
148
|
+
import { AllOptions } from "modules/types/public-api";
|
|
149
|
+
export default class UI {
|
|
150
|
+
private readonly options;
|
|
151
|
+
private readonly id;
|
|
152
|
+
private readonly isRTL;
|
|
153
|
+
private readonly originalPaddingLeft;
|
|
154
|
+
private countries;
|
|
155
|
+
telInput: HTMLInputElement;
|
|
156
|
+
countryContainer: HTMLElement;
|
|
157
|
+
selectedCountry: HTMLElement;
|
|
158
|
+
selectedCountryInner: HTMLElement;
|
|
159
|
+
selectedDialCode: HTMLElement;
|
|
160
|
+
dropdownArrow: HTMLElement;
|
|
161
|
+
dropdownContent: HTMLElement;
|
|
162
|
+
searchInput: HTMLInputElement;
|
|
163
|
+
searchIcon: HTMLElement;
|
|
164
|
+
searchClearButton: HTMLButtonElement;
|
|
165
|
+
searchNoResults: HTMLElement;
|
|
166
|
+
searchResultsA11yText: HTMLElement;
|
|
167
|
+
countryList: HTMLElement;
|
|
168
|
+
dropdown: HTMLElement;
|
|
169
|
+
hiddenInput: HTMLInputElement;
|
|
170
|
+
hiddenInputCountry: HTMLInputElement;
|
|
171
|
+
highlightedItem: HTMLElement | null;
|
|
172
|
+
readonly hadInitialPlaceholder: boolean;
|
|
173
|
+
constructor(input: HTMLInputElement, options: AllOptions, id: number);
|
|
174
|
+
generateMarkup(countries: Country[]): void;
|
|
175
|
+
private _prepareTelInput;
|
|
176
|
+
private _createWrapperAndInsert;
|
|
177
|
+
private _maybeBuildCountryContainer;
|
|
178
|
+
private _buildDropdownContent;
|
|
179
|
+
private _buildSearchUI;
|
|
180
|
+
private _maybeUpdateInputPaddingAndReveal;
|
|
181
|
+
private _maybeBuildHiddenInputs;
|
|
182
|
+
private _appendListItems;
|
|
183
|
+
updateInputPadding(): void;
|
|
184
|
+
private _getHiddenSelectedCountryWidth;
|
|
185
|
+
updateSearchResultsA11yText(): void;
|
|
186
|
+
scrollTo(element: HTMLElement): void;
|
|
187
|
+
highlightListItem(listItem: HTMLElement | null, shouldFocus: boolean): void;
|
|
188
|
+
filterCountries(matchedCountries: Country[]): void;
|
|
189
|
+
destroy(): void;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
139
192
|
declare module "modules/data/country-data" {
|
|
140
193
|
import { Country, Iso2 } from "intl-tel-input/data";
|
|
141
194
|
import type { AllOptions } from "modules/types/public-api";
|
|
@@ -151,9 +204,9 @@ declare module "modules/data/country-data" {
|
|
|
151
204
|
export function cacheSearchTokens(countries: Country[]): void;
|
|
152
205
|
}
|
|
153
206
|
declare module "modules/format/formatting" {
|
|
154
|
-
import {
|
|
155
|
-
export function beforeSetNumber(fullNumber: string, dialCode: string, separateDialCode: boolean, selectedCountryData:
|
|
156
|
-
export function formatNumberAsYouType(fullNumber: string, telInputValue: string, utils: any, selectedCountryData:
|
|
207
|
+
import { SelectedCountryData } from "modules/types/public-api";
|
|
208
|
+
export function beforeSetNumber(fullNumber: string, dialCode: string, separateDialCode: boolean, selectedCountryData: SelectedCountryData): string;
|
|
209
|
+
export function formatNumberAsYouType(fullNumber: string, telInputValue: string, utils: any, selectedCountryData: SelectedCountryData, separateDialCode: boolean): string;
|
|
157
210
|
}
|
|
158
211
|
declare module "modules/format/caret" {
|
|
159
212
|
export function translateCursorPosition(relevantChars: number, formattedValue: string, prevCaretPos: number, isDeleteForwards: boolean): number;
|
|
@@ -162,88 +215,49 @@ declare module "modules/data/nanp-regionless" {
|
|
|
162
215
|
export const regionlessNanpNumbers: string[];
|
|
163
216
|
export const isRegionlessNanp: (number: string) => boolean;
|
|
164
217
|
}
|
|
218
|
+
declare module "modules/types/events" {
|
|
219
|
+
export type ItiEventMap = {
|
|
220
|
+
"countrychange": Record<string, never>;
|
|
221
|
+
"open:countrydropdown": Record<string, never>;
|
|
222
|
+
"close:countrydropdown": Record<string, never>;
|
|
223
|
+
"input": {
|
|
224
|
+
isSetNumber?: boolean;
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
}
|
|
165
228
|
declare module "intl-tel-input" {
|
|
166
|
-
import {
|
|
167
|
-
import type { NumberType, SomeOptions, IntlTelInputInterface } from "modules/types/public-api";
|
|
229
|
+
import { Iso2 } from "intl-tel-input/data";
|
|
230
|
+
import type { NumberType, SomeOptions, IntlTelInputInterface, SelectedCountryData } from "modules/types/public-api";
|
|
168
231
|
global {
|
|
169
232
|
interface HTMLInputElement {
|
|
170
233
|
iti?: Iti;
|
|
171
234
|
}
|
|
172
235
|
}
|
|
173
236
|
export class Iti {
|
|
174
|
-
id: number;
|
|
175
|
-
promise: Promise<[unknown, unknown]>;
|
|
176
|
-
private
|
|
177
|
-
private
|
|
178
|
-
private
|
|
179
|
-
private
|
|
180
|
-
private
|
|
181
|
-
private
|
|
182
|
-
private
|
|
237
|
+
readonly id: number;
|
|
238
|
+
readonly promise: Promise<[unknown, unknown]>;
|
|
239
|
+
private readonly ui;
|
|
240
|
+
private readonly options;
|
|
241
|
+
private readonly isAndroid;
|
|
242
|
+
private readonly countries;
|
|
243
|
+
private readonly dialCodeMaxLen;
|
|
244
|
+
private readonly dialCodeToIso2Map;
|
|
245
|
+
private readonly dialCodes;
|
|
246
|
+
private readonly countryByIso2;
|
|
183
247
|
private selectedCountryData;
|
|
184
|
-
private countries;
|
|
185
|
-
private dialCodeMaxLen;
|
|
186
|
-
private dialCodeToIso2Map;
|
|
187
|
-
private dialCodes;
|
|
188
|
-
private countryByIso2;
|
|
189
|
-
private countryContainer;
|
|
190
|
-
private selectedCountry;
|
|
191
|
-
private selectedCountryInner;
|
|
192
|
-
private selectedDialCode;
|
|
193
|
-
private dropdownArrow;
|
|
194
|
-
private dropdownContent;
|
|
195
|
-
private searchInput;
|
|
196
|
-
private searchIcon;
|
|
197
|
-
private searchClearButton;
|
|
198
|
-
private searchNoResults;
|
|
199
|
-
private searchResultsA11yText;
|
|
200
|
-
private countryList;
|
|
201
|
-
private dropdown;
|
|
202
|
-
private hiddenInput;
|
|
203
|
-
private hiddenInputCountry;
|
|
204
248
|
private maxCoreNumberLength;
|
|
205
249
|
private defaultCountry;
|
|
206
|
-
private
|
|
207
|
-
private
|
|
208
|
-
private _handleHiddenInputSubmit;
|
|
209
|
-
private _handleLabelClick;
|
|
210
|
-
private _handleClickSelectedCountry;
|
|
211
|
-
private _handleCountryContainerKeydown;
|
|
212
|
-
private _handleInputEvent;
|
|
213
|
-
private _handleKeydownEvent;
|
|
214
|
-
private _handlePasteEvent;
|
|
215
|
-
private _handleWindowScroll;
|
|
216
|
-
private _handleMouseoverCountryList;
|
|
217
|
-
private _handleClickCountryList;
|
|
218
|
-
private _handleClickOffToClose;
|
|
219
|
-
private _handleKeydownOnDropdown;
|
|
220
|
-
private _handleSearchChange;
|
|
221
|
-
private _handleSearchClear;
|
|
222
|
-
private _handlePageLoad;
|
|
223
|
-
private _doAttachUtils;
|
|
250
|
+
private abortController;
|
|
251
|
+
private dropdownAbortController;
|
|
224
252
|
private resolveAutoCountryPromise;
|
|
225
253
|
private rejectAutoCountryPromise;
|
|
226
254
|
private resolveUtilsScriptPromise;
|
|
227
255
|
private rejectUtilsScriptPromise;
|
|
228
|
-
/**
|
|
229
|
-
* Build a space-delimited class string from an object map of className -> truthy/falsey.
|
|
230
|
-
* Only keys with truthy values are included.
|
|
231
|
-
*/
|
|
232
|
-
private static _buildClassNames;
|
|
233
256
|
constructor(input: HTMLInputElement, customOptions?: SomeOptions);
|
|
234
|
-
private
|
|
257
|
+
private static _getIsAndroid;
|
|
235
258
|
private _createInitPromises;
|
|
236
259
|
_init(): void;
|
|
237
260
|
private _processCountryData;
|
|
238
|
-
private _generateMarkup;
|
|
239
|
-
private _prepareTelInput;
|
|
240
|
-
private _createWrapperAndInsert;
|
|
241
|
-
private _maybeBuildCountryContainer;
|
|
242
|
-
private _buildDropdownContent;
|
|
243
|
-
private _buildSearchUI;
|
|
244
|
-
private _maybeUpdateInputPaddingAndReveal;
|
|
245
|
-
private _maybeBuildHiddenInputs;
|
|
246
|
-
private _appendListItems;
|
|
247
261
|
private _setInitialState;
|
|
248
262
|
private _initListeners;
|
|
249
263
|
private _initHiddenInputListener;
|
|
@@ -261,24 +275,19 @@ declare module "intl-tel-input" {
|
|
|
261
275
|
private _setDropdownPosition;
|
|
262
276
|
private _bindDropdownListeners;
|
|
263
277
|
private _searchForCountry;
|
|
264
|
-
private
|
|
278
|
+
private _filterCountriesByQuery;
|
|
265
279
|
private _getMatchedCountries;
|
|
266
|
-
private _updateSearchResultsA11yText;
|
|
267
280
|
private _handleUpDownKey;
|
|
268
281
|
private _handleEnterKey;
|
|
269
282
|
private _updateValFromNumber;
|
|
270
283
|
private _updateCountryFromNumber;
|
|
271
284
|
private _ensureHasDialCode;
|
|
272
285
|
private _getNewCountryFromNumber;
|
|
273
|
-
private _highlightListItem;
|
|
274
286
|
private _setCountry;
|
|
275
|
-
private _updateInputPadding;
|
|
276
287
|
private _updateMaxLength;
|
|
277
|
-
private _getHiddenSelectedCountryWidth;
|
|
278
288
|
private _updatePlaceholder;
|
|
279
289
|
private _selectListItem;
|
|
280
290
|
private _closeDropdown;
|
|
281
|
-
private _scrollTo;
|
|
282
291
|
private _updateDialCode;
|
|
283
292
|
private _getDialCode;
|
|
284
293
|
private _getFullNumber;
|
|
@@ -290,7 +299,7 @@ declare module "intl-tel-input" {
|
|
|
290
299
|
getExtension(): string;
|
|
291
300
|
getNumber(format?: number): string;
|
|
292
301
|
getNumberType(): number;
|
|
293
|
-
getSelectedCountryData():
|
|
302
|
+
getSelectedCountryData(): SelectedCountryData;
|
|
294
303
|
getValidationError(): number;
|
|
295
304
|
isValidNumber(): boolean | null;
|
|
296
305
|
isValidNumberPrecise(): boolean | null;
|