intl-tel-input 26.0.1 → 26.0.3
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 +14 -13
- package/angular/README.md +1 -1
- package/angular/build/IntlTelInput.js +17 -7
- package/angular/build/IntlTelInputWithUtils.js +17 -7
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/intlTelInput.js +18 -8
- package/build/js/intlTelInput.min.js +5 -5
- package/build/js/intlTelInputWithUtils.js +18 -8
- package/build/js/intlTelInputWithUtils.min.js +5 -5
- package/package.json +1 -1
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +17 -7
- package/react/build/IntlTelInput.js +17 -7
- package/react/build/IntlTelInputWithUtils.cjs +17 -7
- package/react/build/IntlTelInputWithUtils.js +17 -7
- package/svelte/README.md +1 -1
- package/svelte/build/IntlTelInput.mjs +298 -292
- package/svelte/build/IntlTelInputWithUtils.mjs +319 -313
- package/vue/README.md +1 -1
- package/vue/build/exports/IntlTelInput.mjs +1 -1
- package/vue/build/exports/IntlTelInputWithUtils.mjs +1 -1
- package/vue/build/{intl-tel-input-Bk5kP2Ot.mjs → intl-tel-input-A8ZXud5P.mjs} +49 -43
- package/build/img/globe.png +0 -0
- package/build/img/globe.webp +0 -0
- package/build/img/globe@2x.png +0 -0
- package/build/img/globe@2x.webp +0 -0
- package/build/img/globe_light.png +0 -0
- package/build/img/globe_light.webp +0 -0
- package/build/img/globe_light@2x.png +0 -0
- package/build/img/globe_light@2x.webp +0 -0
package/package.json
CHANGED
package/react/README.md
CHANGED
|
@@ -32,7 +32,7 @@ import "intl-tel-input/styles";
|
|
|
32
32
|
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.
|
|
33
33
|
|
|
34
34
|
## Utils Script
|
|
35
|
-
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 just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@26.0.
|
|
35
|
+
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 just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@26.0.3/build/js/utils.js"`.
|
|
36
36
|
|
|
37
37
|
## Props
|
|
38
38
|
Here's a list of all of the current props you can pass to the IntlTelInput React component.
|
|
@@ -2489,12 +2489,22 @@ var processAllCountries = (options) => {
|
|
|
2489
2489
|
};
|
|
2490
2490
|
var generateCountryNames = (countries, options) => {
|
|
2491
2491
|
const { countryNameLocale, i18n } = options;
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2492
|
+
let displayNames;
|
|
2493
|
+
try {
|
|
2494
|
+
const hasDisplayNames = typeof Intl !== "undefined" && typeof Intl.DisplayNames === "function";
|
|
2495
|
+
if (hasDisplayNames) {
|
|
2496
|
+
displayNames = new Intl.DisplayNames(countryNameLocale, {
|
|
2497
|
+
type: "region"
|
|
2498
|
+
});
|
|
2499
|
+
} else {
|
|
2500
|
+
displayNames = null;
|
|
2501
|
+
}
|
|
2502
|
+
} catch (e) {
|
|
2503
|
+
console.error(e);
|
|
2504
|
+
displayNames = null;
|
|
2505
|
+
}
|
|
2496
2506
|
for (const c of countries) {
|
|
2497
|
-
c.name = i18n[c.iso2] || displayNames?.of(c.iso2.toUpperCase());
|
|
2507
|
+
c.name = i18n[c.iso2] || displayNames?.of(c.iso2.toUpperCase()) || "";
|
|
2498
2508
|
}
|
|
2499
2509
|
};
|
|
2500
2510
|
var processDialCodes = (countries) => {
|
|
@@ -3410,7 +3420,7 @@ var Iti = class _Iti {
|
|
|
3410
3420
|
const { name, dialCode } = this.selectedCountryData;
|
|
3411
3421
|
title = name;
|
|
3412
3422
|
ariaLabel = i18n.selectedCountryAriaLabel.replace("${countryName}", name).replace("${dialCode}", `+${dialCode}`);
|
|
3413
|
-
selectedCountryInner = "";
|
|
3423
|
+
selectedCountryInner = showFlags ? "" : buildGlobeIcon();
|
|
3414
3424
|
} else {
|
|
3415
3425
|
title = i18n.noCountrySelected;
|
|
3416
3426
|
ariaLabel = i18n.noCountrySelected;
|
|
@@ -3856,7 +3866,7 @@ var intlTelInput = Object.assign(
|
|
|
3856
3866
|
attachUtils,
|
|
3857
3867
|
startedLoadingUtilsScript: false,
|
|
3858
3868
|
startedLoadingAutoCountry: false,
|
|
3859
|
-
version: "26.0.
|
|
3869
|
+
version: "26.0.3"
|
|
3860
3870
|
}
|
|
3861
3871
|
);
|
|
3862
3872
|
var intl_tel_input_default = intlTelInput;
|
|
@@ -2453,12 +2453,22 @@ var processAllCountries = (options) => {
|
|
|
2453
2453
|
};
|
|
2454
2454
|
var generateCountryNames = (countries, options) => {
|
|
2455
2455
|
const { countryNameLocale, i18n } = options;
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2456
|
+
let displayNames;
|
|
2457
|
+
try {
|
|
2458
|
+
const hasDisplayNames = typeof Intl !== "undefined" && typeof Intl.DisplayNames === "function";
|
|
2459
|
+
if (hasDisplayNames) {
|
|
2460
|
+
displayNames = new Intl.DisplayNames(countryNameLocale, {
|
|
2461
|
+
type: "region"
|
|
2462
|
+
});
|
|
2463
|
+
} else {
|
|
2464
|
+
displayNames = null;
|
|
2465
|
+
}
|
|
2466
|
+
} catch (e) {
|
|
2467
|
+
console.error(e);
|
|
2468
|
+
displayNames = null;
|
|
2469
|
+
}
|
|
2460
2470
|
for (const c of countries) {
|
|
2461
|
-
c.name = i18n[c.iso2] || displayNames?.of(c.iso2.toUpperCase());
|
|
2471
|
+
c.name = i18n[c.iso2] || displayNames?.of(c.iso2.toUpperCase()) || "";
|
|
2462
2472
|
}
|
|
2463
2473
|
};
|
|
2464
2474
|
var processDialCodes = (countries) => {
|
|
@@ -3374,7 +3384,7 @@ var Iti = class _Iti {
|
|
|
3374
3384
|
const { name, dialCode } = this.selectedCountryData;
|
|
3375
3385
|
title = name;
|
|
3376
3386
|
ariaLabel = i18n.selectedCountryAriaLabel.replace("${countryName}", name).replace("${dialCode}", `+${dialCode}`);
|
|
3377
|
-
selectedCountryInner = "";
|
|
3387
|
+
selectedCountryInner = showFlags ? "" : buildGlobeIcon();
|
|
3378
3388
|
} else {
|
|
3379
3389
|
title = i18n.noCountrySelected;
|
|
3380
3390
|
ariaLabel = i18n.noCountrySelected;
|
|
@@ -3820,7 +3830,7 @@ var intlTelInput = Object.assign(
|
|
|
3820
3830
|
attachUtils,
|
|
3821
3831
|
startedLoadingUtilsScript: false,
|
|
3822
3832
|
startedLoadingAutoCountry: false,
|
|
3823
|
-
version: "26.0.
|
|
3833
|
+
version: "26.0.3"
|
|
3824
3834
|
}
|
|
3825
3835
|
);
|
|
3826
3836
|
var intl_tel_input_default = intlTelInput;
|
|
@@ -2489,12 +2489,22 @@ var processAllCountries = (options) => {
|
|
|
2489
2489
|
};
|
|
2490
2490
|
var generateCountryNames = (countries, options) => {
|
|
2491
2491
|
const { countryNameLocale, i18n } = options;
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2492
|
+
let displayNames;
|
|
2493
|
+
try {
|
|
2494
|
+
const hasDisplayNames = typeof Intl !== "undefined" && typeof Intl.DisplayNames === "function";
|
|
2495
|
+
if (hasDisplayNames) {
|
|
2496
|
+
displayNames = new Intl.DisplayNames(countryNameLocale, {
|
|
2497
|
+
type: "region"
|
|
2498
|
+
});
|
|
2499
|
+
} else {
|
|
2500
|
+
displayNames = null;
|
|
2501
|
+
}
|
|
2502
|
+
} catch (e) {
|
|
2503
|
+
console.error(e);
|
|
2504
|
+
displayNames = null;
|
|
2505
|
+
}
|
|
2496
2506
|
for (const c of countries) {
|
|
2497
|
-
c.name = i18n[c.iso2] || displayNames?.of(c.iso2.toUpperCase());
|
|
2507
|
+
c.name = i18n[c.iso2] || displayNames?.of(c.iso2.toUpperCase()) || "";
|
|
2498
2508
|
}
|
|
2499
2509
|
};
|
|
2500
2510
|
var processDialCodes = (countries) => {
|
|
@@ -3410,7 +3420,7 @@ var Iti = class _Iti {
|
|
|
3410
3420
|
const { name, dialCode } = this.selectedCountryData;
|
|
3411
3421
|
title = name;
|
|
3412
3422
|
ariaLabel = i18n.selectedCountryAriaLabel.replace("${countryName}", name).replace("${dialCode}", `+${dialCode}`);
|
|
3413
|
-
selectedCountryInner = "";
|
|
3423
|
+
selectedCountryInner = showFlags ? "" : buildGlobeIcon();
|
|
3414
3424
|
} else {
|
|
3415
3425
|
title = i18n.noCountrySelected;
|
|
3416
3426
|
ariaLabel = i18n.noCountrySelected;
|
|
@@ -3856,7 +3866,7 @@ var intlTelInput = Object.assign(
|
|
|
3856
3866
|
attachUtils,
|
|
3857
3867
|
startedLoadingUtilsScript: false,
|
|
3858
3868
|
startedLoadingAutoCountry: false,
|
|
3859
|
-
version: "26.0.
|
|
3869
|
+
version: "26.0.3"
|
|
3860
3870
|
}
|
|
3861
3871
|
);
|
|
3862
3872
|
var intl_tel_input_default = intlTelInput;
|
|
@@ -2453,12 +2453,22 @@ var processAllCountries = (options) => {
|
|
|
2453
2453
|
};
|
|
2454
2454
|
var generateCountryNames = (countries, options) => {
|
|
2455
2455
|
const { countryNameLocale, i18n } = options;
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2456
|
+
let displayNames;
|
|
2457
|
+
try {
|
|
2458
|
+
const hasDisplayNames = typeof Intl !== "undefined" && typeof Intl.DisplayNames === "function";
|
|
2459
|
+
if (hasDisplayNames) {
|
|
2460
|
+
displayNames = new Intl.DisplayNames(countryNameLocale, {
|
|
2461
|
+
type: "region"
|
|
2462
|
+
});
|
|
2463
|
+
} else {
|
|
2464
|
+
displayNames = null;
|
|
2465
|
+
}
|
|
2466
|
+
} catch (e) {
|
|
2467
|
+
console.error(e);
|
|
2468
|
+
displayNames = null;
|
|
2469
|
+
}
|
|
2460
2470
|
for (const c of countries) {
|
|
2461
|
-
c.name = i18n[c.iso2] || displayNames?.of(c.iso2.toUpperCase());
|
|
2471
|
+
c.name = i18n[c.iso2] || displayNames?.of(c.iso2.toUpperCase()) || "";
|
|
2462
2472
|
}
|
|
2463
2473
|
};
|
|
2464
2474
|
var processDialCodes = (countries) => {
|
|
@@ -3374,7 +3384,7 @@ var Iti = class _Iti {
|
|
|
3374
3384
|
const { name, dialCode } = this.selectedCountryData;
|
|
3375
3385
|
title = name;
|
|
3376
3386
|
ariaLabel = i18n.selectedCountryAriaLabel.replace("${countryName}", name).replace("${dialCode}", `+${dialCode}`);
|
|
3377
|
-
selectedCountryInner = "";
|
|
3387
|
+
selectedCountryInner = showFlags ? "" : buildGlobeIcon();
|
|
3378
3388
|
} else {
|
|
3379
3389
|
title = i18n.noCountrySelected;
|
|
3380
3390
|
ariaLabel = i18n.noCountrySelected;
|
|
@@ -3820,7 +3830,7 @@ var intlTelInput = Object.assign(
|
|
|
3820
3830
|
attachUtils,
|
|
3821
3831
|
startedLoadingUtilsScript: false,
|
|
3822
3832
|
startedLoadingAutoCountry: false,
|
|
3823
|
-
version: "26.0.
|
|
3833
|
+
version: "26.0.3"
|
|
3824
3834
|
}
|
|
3825
3835
|
);
|
|
3826
3836
|
var intl_tel_input_default = intlTelInput;
|
package/svelte/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Try it for yourself by downloading and building the project yourself in 3 simple
|
|
|
28
28
|
|
|
29
29
|
See the [Validation demo](https://github.com/jackocnr/intl-tel-input/blob/master/svelte/demo/validation/App.svelte) 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/svelteWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/svelte"` 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@26.0.
|
|
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/svelteWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/svelte"` 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@26.0.3/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 Svelte component.
|