intl-tel-input 25.3.1 → 25.4.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 +18 -8
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/i18n/ee/countries.js +239 -239
- package/build/js/i18n/index.js +1 -0
- package/build/js/i18n/pl/interface.js +11 -3
- package/build/js/i18n/uz/countries.js +245 -0
- package/build/js/i18n/uz/index.js +5 -0
- package/build/js/i18n/uz/interface.js +13 -0
- package/build/js/intlTelInput.d.ts +26 -1
- package/build/js/intlTelInput.js +13 -7
- package/build/js/intlTelInput.min.js +2 -2
- package/build/js/intlTelInputWithUtils.js +627 -542
- package/build/js/intlTelInputWithUtils.min.js +2 -2
- package/build/js/utils.js +140 -136
- package/package.json +21 -6
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +12 -6
- package/react/build/IntlTelInput.d.ts +26 -1
- package/react/build/IntlTelInput.js +12 -6
- package/react/build/IntlTelInputWithUtils.cjs +626 -541
- package/react/build/IntlTelInputWithUtils.js +626 -541
- package/vue/README.md +1 -1
- package/vue/build/IntlTelInput.mjs +7 -6
- package/vue/build/IntlTelInputWithUtils.mjs +674 -595
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intl-tel-input",
|
|
3
|
-
"version": "25.
|
|
3
|
+
"version": "25.4.0",
|
|
4
4
|
"description": "A JavaScript plugin for entering and validating international telephone numbers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"international",
|
|
@@ -24,6 +24,9 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"author": "Jack O'Connor (http://jackocnr.com)",
|
|
26
26
|
"devDependencies": {
|
|
27
|
+
"@angular/compiler": "^19.1.4",
|
|
28
|
+
"@angular/core": "^19.1.4",
|
|
29
|
+
"@angular/platform-browser": "^19.1.4",
|
|
27
30
|
"@babel/plugin-transform-modules-commonjs": "^7.25.7",
|
|
28
31
|
"@testing-library/jest-dom": "^6.4.6",
|
|
29
32
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -31,10 +34,10 @@
|
|
|
31
34
|
"@types/react-dom": "^18.2.24",
|
|
32
35
|
"@typescript-eslint/eslint-plugin": "^8.1.0",
|
|
33
36
|
"@typescript-eslint/parser": "^8.1.0",
|
|
34
|
-
"@vitejs/plugin-vue": "^5.1
|
|
37
|
+
"@vitejs/plugin-vue": "^5.2.1",
|
|
35
38
|
"babel-plugin-add-module-exports": "^1.0.4",
|
|
36
39
|
"cspell": "^8.6.1",
|
|
37
|
-
"esbuild": "^0.
|
|
40
|
+
"esbuild": "^0.25.0",
|
|
38
41
|
"eslint": "^8.57.0",
|
|
39
42
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
40
43
|
"eslint-plugin-import": "^2.29.1",
|
|
@@ -63,12 +66,13 @@
|
|
|
63
66
|
"prettier": "^3.2.5",
|
|
64
67
|
"react": "^18.3.1",
|
|
65
68
|
"react-dom": "^18.3.1",
|
|
66
|
-
"sass": "^1.
|
|
69
|
+
"sass": "^1.83.1",
|
|
67
70
|
"sharp": "^0.33.5",
|
|
68
71
|
"time-grunt": "^2.0.0",
|
|
69
72
|
"typescript": "^5.5.3",
|
|
70
|
-
"vite": "^
|
|
71
|
-
"vue": "^3.4.38"
|
|
73
|
+
"vite": "^6.1.0",
|
|
74
|
+
"vue": "^3.4.38",
|
|
75
|
+
"zone.js": "^0.15.0"
|
|
72
76
|
},
|
|
73
77
|
"files": [
|
|
74
78
|
"build/*",
|
|
@@ -101,6 +105,7 @@
|
|
|
101
105
|
"build:img": "grunt img",
|
|
102
106
|
"build:react": "grunt react",
|
|
103
107
|
"build:vue": "grunt vue",
|
|
108
|
+
"build:angular": "grunt angular",
|
|
104
109
|
"vue:demo": "vite --config vue/demo/validation/vite.config.js",
|
|
105
110
|
"server": "grunt jasmine:interactive"
|
|
106
111
|
},
|
|
@@ -134,6 +139,16 @@
|
|
|
134
139
|
"./vueWithUtils": {
|
|
135
140
|
"import": "./vue/build/IntlTelInputWithUtils.mjs"
|
|
136
141
|
},
|
|
142
|
+
"./angular": {
|
|
143
|
+
"types": "./angular/build/IntlTelInput.d.ts",
|
|
144
|
+
"require": "./angular/build/IntlTelInput.cjs",
|
|
145
|
+
"default": "./angular/build/IntlTelInput.js"
|
|
146
|
+
},
|
|
147
|
+
"./angularWithUtils": {
|
|
148
|
+
"types": "./angular/build/IntlTelInput.d.ts",
|
|
149
|
+
"require": "./angular/build/IntlTelInputWithUtils.cjs",
|
|
150
|
+
"default": "./angular/build/IntlTelInputWithUtils.js"
|
|
151
|
+
},
|
|
137
152
|
"./i18n": {
|
|
138
153
|
"types": "./build/js/intlTelInput.d.ts",
|
|
139
154
|
"default": "./build/js/i18n/index.js"
|
package/react/README.md
CHANGED
|
@@ -28,7 +28,7 @@ import "intl-tel-input/styles";
|
|
|
28
28
|
|
|
29
29
|
See the [Validation demo](https://github.com/jackocnr/intl-tel-input/blob/master/react/demo/validation/ValidationApp.tsx) for a more fleshed-out example of how to handle validation.
|
|
30
30
|
|
|
31
|
-
A note on the utils script (~260KB): if you're lazy loading the IntlTelInput chunk (and so less worried about filesize) then you can just import IntlTelInput from `"intl-tel-input/reactWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/react"` import, then you should couple this with the `loadUtils` initialisation option - you will need to host the [utils.js](https://github.com/jackocnr/intl-tel-input/blob/master/build/js/utils.js) file, and then set the `loadUtils` option to that URL, or alternatively just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@25.
|
|
31
|
+
A note on the utils script (~260KB): if you're lazy loading the IntlTelInput chunk (and so less worried about filesize) then you can just import IntlTelInput from `"intl-tel-input/reactWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/react"` import, then you should couple this with the `loadUtils` initialisation option - you will need to host the [utils.js](https://github.com/jackocnr/intl-tel-input/blob/master/build/js/utils.js) file, and then set the `loadUtils` option to that URL, or alternatively just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@25.4.0/build/js/utils.js"`.
|
|
32
32
|
|
|
33
33
|
## Props
|
|
34
34
|
Here's a list of all of the current props you can pass to the IntlTelInput React component.
|
|
@@ -2522,12 +2522,16 @@ var Iti = class {
|
|
|
2522
2522
|
const { i18n } = this.options;
|
|
2523
2523
|
const count = this.countryList.childElementCount;
|
|
2524
2524
|
let searchText;
|
|
2525
|
-
if (
|
|
2526
|
-
searchText = i18n.
|
|
2527
|
-
} else if (count === 1) {
|
|
2528
|
-
searchText = i18n.oneSearchResult;
|
|
2525
|
+
if ("searchResultsText" in i18n) {
|
|
2526
|
+
searchText = i18n.searchResultsText(count);
|
|
2529
2527
|
} else {
|
|
2530
|
-
|
|
2528
|
+
if (count === 0) {
|
|
2529
|
+
searchText = i18n.zeroSearchResults;
|
|
2530
|
+
} else if (count === 1) {
|
|
2531
|
+
searchText = i18n.oneSearchResult;
|
|
2532
|
+
} else {
|
|
2533
|
+
searchText = i18n.multipleSearchResults.replace("${count}", count.toString());
|
|
2534
|
+
}
|
|
2531
2535
|
}
|
|
2532
2536
|
this.searchResultsA11yText.textContent = searchText;
|
|
2533
2537
|
}
|
|
@@ -2961,6 +2965,7 @@ var Iti = class {
|
|
|
2961
2965
|
//********************
|
|
2962
2966
|
//* Remove plugin.
|
|
2963
2967
|
destroy() {
|
|
2968
|
+
this.telInput.iti = void 0;
|
|
2964
2969
|
const { allowDropdown, separateDialCode } = this.options;
|
|
2965
2970
|
if (allowDropdown) {
|
|
2966
2971
|
this._closeDropdown();
|
|
@@ -3146,6 +3151,7 @@ var intlTelInput = Object.assign(
|
|
|
3146
3151
|
iti._init();
|
|
3147
3152
|
input.setAttribute("data-intl-tel-input-id", iti.id.toString());
|
|
3148
3153
|
intlTelInput.instances[iti.id] = iti;
|
|
3154
|
+
input.iti = iti;
|
|
3149
3155
|
return iti;
|
|
3150
3156
|
},
|
|
3151
3157
|
{
|
|
@@ -3164,7 +3170,7 @@ var intlTelInput = Object.assign(
|
|
|
3164
3170
|
attachUtils,
|
|
3165
3171
|
startedLoadingUtilsScript: false,
|
|
3166
3172
|
startedLoadingAutoCountry: false,
|
|
3167
|
-
version: "25.
|
|
3173
|
+
version: "25.4.0"
|
|
3168
3174
|
}
|
|
3169
3175
|
);
|
|
3170
3176
|
var intl_tel_input_default = intlTelInput;
|
|
@@ -264,6 +264,7 @@ declare module "intl-tel-input/i18n/types" {
|
|
|
264
264
|
multipleSearchResults?: string;
|
|
265
265
|
noCountrySelected?: string;
|
|
266
266
|
zeroSearchResults?: string;
|
|
267
|
+
searchResultsText?: (count: number) => string;
|
|
267
268
|
};
|
|
268
269
|
}
|
|
269
270
|
declare module "intl-tel-input/i18n/en/countries" {
|
|
@@ -287,6 +288,11 @@ declare module "intl-tel-input/i18n/en" {
|
|
|
287
288
|
declare module "intl-tel-input" {
|
|
288
289
|
import { Country } from "intl-tel-input/data";
|
|
289
290
|
import { I18n } from "intl-tel-input/i18n/types";
|
|
291
|
+
global {
|
|
292
|
+
interface HTMLInputElement {
|
|
293
|
+
iti?: Iti;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
290
296
|
type UtilsLoader = () => Promise<{
|
|
291
297
|
default: ItiUtils;
|
|
292
298
|
}>;
|
|
@@ -503,7 +509,7 @@ declare module "intl-tel-input/react" {
|
|
|
503
509
|
const IntlTelInput: React.ForwardRefExoticComponent<ItiProps & React.RefAttributes<IntlTelInputRef>>;
|
|
504
510
|
export default IntlTelInput;
|
|
505
511
|
}
|
|
506
|
-
declare module "intl-tel-input/utils
|
|
512
|
+
declare module "intl-tel-input/utils" {
|
|
507
513
|
export default utils;
|
|
508
514
|
const utils: any;
|
|
509
515
|
}
|
|
@@ -1164,6 +1170,24 @@ declare module "intl-tel-input/i18n/ur" {
|
|
|
1164
1170
|
const allTranslations: I18n;
|
|
1165
1171
|
export default allTranslations;
|
|
1166
1172
|
}
|
|
1173
|
+
declare module "intl-tel-input/i18n/uz/countries" {
|
|
1174
|
+
import { I18n } from "intl-tel-input/i18n/types";
|
|
1175
|
+
const countryTranslations: I18n;
|
|
1176
|
+
export default countryTranslations;
|
|
1177
|
+
}
|
|
1178
|
+
declare module "intl-tel-input/i18n/uz/interface" {
|
|
1179
|
+
import { I18n } from "intl-tel-input/i18n/types";
|
|
1180
|
+
const interfaceTranslations: I18n;
|
|
1181
|
+
export default interfaceTranslations;
|
|
1182
|
+
}
|
|
1183
|
+
declare module "intl-tel-input/i18n/uz" {
|
|
1184
|
+
import { I18n } from "intl-tel-input/i18n/types";
|
|
1185
|
+
import countryTranslations from "intl-tel-input/i18n/uz/countries";
|
|
1186
|
+
import interfaceTranslations from "intl-tel-input/i18n/uz/interface";
|
|
1187
|
+
export { countryTranslations, interfaceTranslations };
|
|
1188
|
+
const allTranslations: I18n;
|
|
1189
|
+
export default allTranslations;
|
|
1190
|
+
}
|
|
1167
1191
|
declare module "intl-tel-input/i18n/vi/countries" {
|
|
1168
1192
|
import { I18n } from "intl-tel-input/i18n/types";
|
|
1169
1193
|
const countryTranslations: I18n;
|
|
@@ -1237,6 +1261,7 @@ declare module "intl-tel-input/i18n" {
|
|
|
1237
1261
|
export { default as tr, countryTranslations as trCountryTranslations, interfaceTranslations as trInterfaceTranslations } from "intl-tel-input/i18n/tr";
|
|
1238
1262
|
export { default as uk, countryTranslations as ukCountryTranslations, interfaceTranslations as ukInterfaceTranslations } from "intl-tel-input/i18n/uk";
|
|
1239
1263
|
export { default as ur, countryTranslations as urCountryTranslations, interfaceTranslations as urInterfaceTranslations } from "intl-tel-input/i18n/ur";
|
|
1264
|
+
export { default as uz, countryTranslations as uzCountryTranslations, interfaceTranslations as uzInterfaceTranslations } from "intl-tel-input/i18n/uz";
|
|
1240
1265
|
export { default as vi, countryTranslations as viCountryTranslations, interfaceTranslations as viInterfaceTranslations } from "intl-tel-input/i18n/vi";
|
|
1241
1266
|
export { default as zh, countryTranslations as zhCountryTranslations, interfaceTranslations as zhInterfaceTranslations } from "intl-tel-input/i18n/zh";
|
|
1242
1267
|
}
|
|
@@ -2486,12 +2486,16 @@ var Iti = class {
|
|
|
2486
2486
|
const { i18n } = this.options;
|
|
2487
2487
|
const count = this.countryList.childElementCount;
|
|
2488
2488
|
let searchText;
|
|
2489
|
-
if (
|
|
2490
|
-
searchText = i18n.
|
|
2491
|
-
} else if (count === 1) {
|
|
2492
|
-
searchText = i18n.oneSearchResult;
|
|
2489
|
+
if ("searchResultsText" in i18n) {
|
|
2490
|
+
searchText = i18n.searchResultsText(count);
|
|
2493
2491
|
} else {
|
|
2494
|
-
|
|
2492
|
+
if (count === 0) {
|
|
2493
|
+
searchText = i18n.zeroSearchResults;
|
|
2494
|
+
} else if (count === 1) {
|
|
2495
|
+
searchText = i18n.oneSearchResult;
|
|
2496
|
+
} else {
|
|
2497
|
+
searchText = i18n.multipleSearchResults.replace("${count}", count.toString());
|
|
2498
|
+
}
|
|
2495
2499
|
}
|
|
2496
2500
|
this.searchResultsA11yText.textContent = searchText;
|
|
2497
2501
|
}
|
|
@@ -2925,6 +2929,7 @@ var Iti = class {
|
|
|
2925
2929
|
//********************
|
|
2926
2930
|
//* Remove plugin.
|
|
2927
2931
|
destroy() {
|
|
2932
|
+
this.telInput.iti = void 0;
|
|
2928
2933
|
const { allowDropdown, separateDialCode } = this.options;
|
|
2929
2934
|
if (allowDropdown) {
|
|
2930
2935
|
this._closeDropdown();
|
|
@@ -3110,6 +3115,7 @@ var intlTelInput = Object.assign(
|
|
|
3110
3115
|
iti._init();
|
|
3111
3116
|
input.setAttribute("data-intl-tel-input-id", iti.id.toString());
|
|
3112
3117
|
intlTelInput.instances[iti.id] = iti;
|
|
3118
|
+
input.iti = iti;
|
|
3113
3119
|
return iti;
|
|
3114
3120
|
},
|
|
3115
3121
|
{
|
|
@@ -3128,7 +3134,7 @@ var intlTelInput = Object.assign(
|
|
|
3128
3134
|
attachUtils,
|
|
3129
3135
|
startedLoadingUtilsScript: false,
|
|
3130
3136
|
startedLoadingAutoCountry: false,
|
|
3131
|
-
version: "25.
|
|
3137
|
+
version: "25.4.0"
|
|
3132
3138
|
}
|
|
3133
3139
|
);
|
|
3134
3140
|
var intl_tel_input_default = intlTelInput;
|