intl-tel-input 25.5.2 → 25.8.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/CHANGELOG.md +29 -1
- package/README.md +15 -15
- package/angular/README.md +1 -1
- package/angular/build/IntlTelInput.js +170 -116
- package/angular/build/IntlTelInputWithUtils.js +235 -202
- package/angular/build/types/intl-tel-input/data.d.ts +7 -2
- package/angular/build/types/intl-tel-input/i18n/types.d.ts +1 -0
- package/angular/build/types/intl-tel-input.d.ts +14 -2
- package/build/css/intlTelInput.css +67 -6
- package/build/css/intlTelInput.min.css +1 -1
- package/build/js/data.js +6 -6
- package/build/js/data.min.js +2 -2
- package/build/js/i18n/en/interface.js +1 -0
- package/build/js/intlTelInput.d.ts +22 -4
- package/build/js/intlTelInput.js +187 -119
- package/build/js/intlTelInput.min.js +13 -2
- package/build/js/intlTelInputWithUtils.js +251 -204
- package/build/js/intlTelInputWithUtils.min.js +13 -2
- package/build/js/utils.js +22 -21
- package/package.json +9 -12
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +186 -118
- package/react/build/IntlTelInput.d.ts +22 -4
- package/react/build/IntlTelInput.js +186 -118
- package/react/build/IntlTelInputWithUtils.cjs +250 -203
- package/react/build/IntlTelInputWithUtils.js +250 -203
- package/vue/README.md +1 -1
- package/vue/build/IntlTelInput.mjs +333 -274
- package/vue/build/IntlTelInputWithUtils.mjs +800 -763
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
1
|
See the Github Releases page for changelog: https://github.com/jackocnr/intl-tel-input/releases
|
|
2
2
|
|
|
3
|
-
Or to
|
|
3
|
+
Or to view a specific version, e.g. v20.0.0, update the URL accordingly, e.g. https://github.com/jackocnr/intl-tel-input/releases/tag/v20.0.0
|
|
4
|
+
|
|
5
|
+
## Breaking changes
|
|
6
|
+
|
|
7
|
+
- v25.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v25.0.0
|
|
8
|
+
- v24.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v24.0.0
|
|
9
|
+
- v23.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v23.0.0
|
|
10
|
+
- v22.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v22.0.0
|
|
11
|
+
- v21.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v21.0.0
|
|
12
|
+
- v20.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v20.0.0
|
|
13
|
+
- v19.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v19.0.0
|
|
14
|
+
- v18.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v18.0.0
|
|
15
|
+
- v17.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v17.0.0
|
|
16
|
+
- v16.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v16.0.0
|
|
17
|
+
- v15.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v15.0.0
|
|
18
|
+
- v14.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v14.0.0
|
|
19
|
+
- v13.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v13.0.0
|
|
20
|
+
- v12.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v12.0.0
|
|
21
|
+
- v11.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v11.0.0
|
|
22
|
+
- v10.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v10.0.0
|
|
23
|
+
- v9.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v9.0.0
|
|
24
|
+
- v8.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v8.0.0
|
|
25
|
+
- v7.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v7.0.0
|
|
26
|
+
- v6.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v6.0.0
|
|
27
|
+
- v5.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v5.0.0
|
|
28
|
+
- v4.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v4.0.0
|
|
29
|
+
- v3.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v3.0.0
|
|
30
|
+
- v2.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v2.0.0
|
|
31
|
+
- v1.0.0 https://github.com/jackocnr/intl-tel-input/releases/tag/v1.0.0
|
package/README.md
CHANGED
|
@@ -77,16 +77,16 @@ _Note: We have now dropped support for all versions of Internet Explorer because
|
|
|
77
77
|
## Getting Started (Using a CDN)
|
|
78
78
|
1. Add the CSS
|
|
79
79
|
```html
|
|
80
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/intl-tel-input@25.
|
|
80
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/intl-tel-input@25.8.0/build/css/intlTelInput.css">
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
2. Add the plugin script and initialise it on your input element
|
|
84
84
|
```html
|
|
85
|
-
<script src="https://cdn.jsdelivr.net/npm/intl-tel-input@25.
|
|
85
|
+
<script src="https://cdn.jsdelivr.net/npm/intl-tel-input@25.8.0/build/js/intlTelInput.min.js"></script>
|
|
86
86
|
<script>
|
|
87
87
|
const input = document.querySelector("#phone");
|
|
88
88
|
window.intlTelInput(input, {
|
|
89
|
-
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.
|
|
89
|
+
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.8.0/build/js/utils.js"),
|
|
90
90
|
});
|
|
91
91
|
</script>
|
|
92
92
|
```
|
|
@@ -229,9 +229,9 @@ _Note that the `failure` callback must be called in the event of an error, hence
|
|
|
229
229
|
|
|
230
230
|
**hiddenInput**
|
|
231
231
|
Type: `Function` Default: `null`
|
|
232
|
-
Allows the creation of hidden input fields within a form
|
|
232
|
+
Allows the creation of hidden input fields within a form, which, on submit, get populated with the (1) full international telephone number and (2) the selected country code. It accepts a function that receives the name of the main telephone input as an argument. This function should return an object with `phone` and (optionally) `country` properties to specify the names of the hidden inputs for the phone number and country code, respectively. This is useful for non-Ajax form submissions to ensure the full international number and country code are captured, especially when `nationalMode` is enabled.
|
|
233
233
|
|
|
234
|
-
***Note**: This feature requires the input to be inside a `<form>` element, as it listens for the `submit` event on the closest form element. Also note that since this uses `getNumber` internally, firstly it requires the [utils script to be loaded](#loading-the-utilities-script), and secondly it expects a valid number and so will only work correctly if you have used `isValidNumber` to validate the number before allowing the form submit to go through.
|
|
234
|
+
***Note**: This feature requires the input to be inside a `<form>` element, as it listens for the `submit` event on the closest form element. Also note that since this uses `getNumber` internally, firstly it requires the [utils script to be loaded](#loading-the-utilities-script), and secondly, it expects a valid number and so will only work correctly if you have used `isValidNumber` to validate the number before allowing the form submit to go through.
|
|
235
235
|
|
|
236
236
|
```js
|
|
237
237
|
intlTelInput(input, {
|
|
@@ -251,7 +251,7 @@ This will generate the following (hidden) elements, which will be automatically
|
|
|
251
251
|
|
|
252
252
|
**i18n**
|
|
253
253
|
Type: `Object` Default: `{}`
|
|
254
|
-
|
|
254
|
+
Allows you to specify translation strings for the 200+ country names, as well as other user interface text (e.g. the placeholder text for the country search input). The easiest way to do this is to import one of the [provided translation modules](https://github.com/jackocnr/intl-tel-input/tree/master/build/js/i18n) and set `i18n` to that value (see option 1 below). You can also override one or more individual keys this way (see option 1 below). Alternatively, you can provide your own custom translations (see option 2 below). If providing your own, you will need to specify all the country names (which can be copied from the country-list project, e.g. here are the [country names in French](https://github.com/umpirsky/country-list/blob/master/data/fr/country.json)), as well as a few UI strings (listed below). [See example](https://intl-tel-input.com/examples/localise-countries.html).
|
|
255
255
|
|
|
256
256
|
If we don't currently support a language you need, it's easy to [contribute this](https://github.com/jackocnr/intl-tel-input/blob/master/.github/CONTRIBUTING.md#adding-a-new-translation) yourself - you only need to provide a handful of UI translation strings, as we automatically pull in the country names from the country-list project.
|
|
257
257
|
|
|
@@ -297,7 +297,7 @@ intlTelInput(input, {
|
|
|
297
297
|
oneSearchResult: "1 result found",
|
|
298
298
|
// Screen reader text for when the search produces multiple results
|
|
299
299
|
multipleSearchResults: "${count} results found",
|
|
300
|
-
// For more complex pluralisation cases e.g. Polish or Arabic, you can implement your own logic
|
|
300
|
+
// For more complex pluralisation cases, e.g. Polish or Arabic, you can implement your own logic
|
|
301
301
|
// Note that if this function is defined, the plugin will ignore the "zero", "one" and "multiple" keys listed above
|
|
302
302
|
searchResultsText(count) {
|
|
303
303
|
if (count === 0) return "No results found";
|
|
@@ -322,7 +322,7 @@ The `loadUtils` option takes a function which returns a Promise which resolves t
|
|
|
322
322
|
```js
|
|
323
323
|
// (A) import utils module from a CDN
|
|
324
324
|
intlTelInput(htmlInputElement, {
|
|
325
|
-
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.
|
|
325
|
+
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.8.0/build/js/utils.js"),
|
|
326
326
|
});
|
|
327
327
|
|
|
328
328
|
// (B) import utils module from your own hosted version of utils.js
|
|
@@ -464,6 +464,12 @@ Change the selected country. It should be rare, if ever, that you need to do thi
|
|
|
464
464
|
iti.setCountry("gb");
|
|
465
465
|
```
|
|
466
466
|
|
|
467
|
+
**setDisabled**
|
|
468
|
+
Updates the disabled attribute of both the telephone input and the selected country button. Accepts a boolean value. _Note: we recommend using this instead of updating the disabled attribute of the input directly._
|
|
469
|
+
```js
|
|
470
|
+
iti.setDisabled(true);
|
|
471
|
+
```
|
|
472
|
+
|
|
467
473
|
**setNumber**
|
|
468
474
|
Insert a number, and update the selected country accordingly. _Note that if `formatOnDisplay` is enabled, this will attempt to format the number to either national or international format according to the `nationalMode` option._
|
|
469
475
|
```js
|
|
@@ -476,12 +482,6 @@ Change the placeholderNumberType option.
|
|
|
476
482
|
iti.setPlaceholderNumberType("FIXED_LINE");
|
|
477
483
|
```
|
|
478
484
|
|
|
479
|
-
**setDisabled**
|
|
480
|
-
Updates the disabled attribute of both the telephone input and the selected country button. Accepts a boolean value. _Note: we recommend using this instead of updating the disabled attribute of the input directly._
|
|
481
|
-
```js
|
|
482
|
-
iti.setDisabled(true);
|
|
483
|
-
```
|
|
484
|
-
|
|
485
485
|
## Static Methods
|
|
486
486
|
|
|
487
487
|
**getCountryData**
|
|
@@ -606,7 +606,7 @@ The `loadUtils` option takes a function which returns a Promise which resolves t
|
|
|
606
606
|
```js
|
|
607
607
|
// (A) import utils module from a CDN
|
|
608
608
|
intlTelInput(htmlInputElement, {
|
|
609
|
-
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.
|
|
609
|
+
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.8.0/build/js/utils.js"),
|
|
610
610
|
});
|
|
611
611
|
|
|
612
612
|
// (B) import utils module from your own hosted version of utils.js
|
package/angular/README.md
CHANGED
|
@@ -29,7 +29,7 @@ import "intl-tel-input/styles";
|
|
|
29
29
|
|
|
30
30
|
See the [Validation demo](https://github.com/jackocnr/intl-tel-input/blob/master/angular/demo/validation/validation.component.ts) for a more fleshed-out example of how to handle validation.
|
|
31
31
|
|
|
32
|
-
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/angularWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/angular"` 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.
|
|
32
|
+
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/angularWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/angular"` 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.8.0/build/js/utils.js"`.
|
|
33
33
|
|
|
34
34
|
## Props
|
|
35
35
|
Here's a list of all of the current props you can pass to the IntlTelInput Angular component.
|