intl-tel-input 25.8.3 → 25.8.5
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 +7 -7
- package/angular/README.md +1 -1
- package/angular/build/IntlTelInput.js +10 -4
- package/angular/build/IntlTelInputWithUtils.js +10 -4
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/i18n/index.mjs +0 -0
- package/build/js/intlTelInput.js +11 -5
- package/build/js/intlTelInput.min.js +4 -4
- package/build/js/intlTelInputWithUtils.js +11 -5
- package/build/js/intlTelInputWithUtils.min.js +4 -4
- package/package.json +9 -1
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +10 -4
- package/react/build/IntlTelInput.js +10 -4
- package/react/build/IntlTelInputWithUtils.cjs +10 -4
- package/react/build/IntlTelInputWithUtils.js +10 -4
- package/vue/README.md +1 -1
- package/vue/build/IntlTelInput.mjs +204 -204
- package/vue/build/IntlTelInputWithUtils.mjs +390 -390
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intl-tel-input",
|
|
3
|
-
"version": "25.8.
|
|
3
|
+
"version": "25.8.5",
|
|
4
4
|
"description": "A JavaScript plugin for entering and validating international telephone numbers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"international",
|
|
@@ -118,10 +118,12 @@
|
|
|
118
118
|
"exports": {
|
|
119
119
|
".": {
|
|
120
120
|
"types": "./build/js/intlTelInput.d.ts",
|
|
121
|
+
"import": "./build/js/intlTelInput.js",
|
|
121
122
|
"default": "./build/js/intlTelInput.js"
|
|
122
123
|
},
|
|
123
124
|
"./intlTelInputWithUtils": {
|
|
124
125
|
"types": "./build/js/intlTelInput.d.ts",
|
|
126
|
+
"import": "./build/js/intlTelInputWithUtils.js",
|
|
125
127
|
"default": "./build/js/intlTelInputWithUtils.js"
|
|
126
128
|
},
|
|
127
129
|
"./data": "./build/js/data.js",
|
|
@@ -129,11 +131,13 @@
|
|
|
129
131
|
"./react": {
|
|
130
132
|
"types": "./react/build/IntlTelInput.d.ts",
|
|
131
133
|
"require": "./react/build/IntlTelInput.cjs",
|
|
134
|
+
"import": "./react/build/IntlTelInput.js",
|
|
132
135
|
"default": "./react/build/IntlTelInput.js"
|
|
133
136
|
},
|
|
134
137
|
"./reactWithUtils": {
|
|
135
138
|
"types": "./react/build/IntlTelInput.d.ts",
|
|
136
139
|
"require": "./react/build/IntlTelInputWithUtils.cjs",
|
|
140
|
+
"import": "./react/build/IntlTelInputWithUtils.js",
|
|
137
141
|
"default": "./react/build/IntlTelInputWithUtils.js"
|
|
138
142
|
},
|
|
139
143
|
"./vue": {
|
|
@@ -144,18 +148,22 @@
|
|
|
144
148
|
},
|
|
145
149
|
"./angular": {
|
|
146
150
|
"types": "./angular/build/types/intl-tel-input/angular.d.ts",
|
|
151
|
+
"import": "./angular/build/IntlTelInput.js",
|
|
147
152
|
"default": "./angular/build/IntlTelInput.js"
|
|
148
153
|
},
|
|
149
154
|
"./angularWithUtils": {
|
|
150
155
|
"types": "./angular/build/types/intl-tel-input/angularWithUtils.d.ts",
|
|
156
|
+
"import": "./angular/build/IntlTelInputWithUtils.js",
|
|
151
157
|
"default": "./angular/build/IntlTelInputWithUtils.js"
|
|
152
158
|
},
|
|
153
159
|
"./i18n": {
|
|
154
160
|
"types": "./build/js/intlTelInput.d.ts",
|
|
161
|
+
"import": "./build/js/i18n/index.js",
|
|
155
162
|
"default": "./build/js/i18n/index.js"
|
|
156
163
|
},
|
|
157
164
|
"./i18n/*": {
|
|
158
165
|
"types": "./build/js/intlTelInput.d.ts",
|
|
166
|
+
"import": "./build/js/i18n/*/index.js",
|
|
159
167
|
"default": "./build/js/i18n/*/index.js"
|
|
160
168
|
},
|
|
161
169
|
"./styles": "./build/css/intlTelInput.css",
|
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.8.
|
|
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.8.5/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.
|
|
@@ -2348,7 +2348,7 @@ var Iti = class _Iti {
|
|
|
2348
2348
|
}
|
|
2349
2349
|
//* Initialize the tel input listeners.
|
|
2350
2350
|
_initTelInputListeners() {
|
|
2351
|
-
const { strictMode, formatAsYouType, separateDialCode,
|
|
2351
|
+
const { strictMode, formatAsYouType, separateDialCode, allowDropdown, countrySearch } = this.options;
|
|
2352
2352
|
let userOverrideFormatting = false;
|
|
2353
2353
|
if (/\p{L}/u.test(this.telInput.value)) {
|
|
2354
2354
|
userOverrideFormatting = true;
|
|
@@ -2372,8 +2372,8 @@ var Iti = class _Iti {
|
|
|
2372
2372
|
} else if (!/[^+0-9]/.test(this.telInput.value)) {
|
|
2373
2373
|
userOverrideFormatting = false;
|
|
2374
2374
|
}
|
|
2375
|
-
const
|
|
2376
|
-
if (formatAsYouType && !userOverrideFormatting && !
|
|
2375
|
+
const isSetNumber = e?.detail && e.detail["isSetNumber"];
|
|
2376
|
+
if (formatAsYouType && !userOverrideFormatting && !isSetNumber) {
|
|
2377
2377
|
const currentCaretPos = this.telInput.selectionStart || 0;
|
|
2378
2378
|
const valueBeforeCaret = this.telInput.value.substring(0, currentCaretPos);
|
|
2379
2379
|
const relevantCharsBeforeCaret = valueBeforeCaret.replace(/[^+0-9]/g, "").length;
|
|
@@ -2885,6 +2885,9 @@ var Iti = class _Iti {
|
|
|
2885
2885
|
);
|
|
2886
2886
|
this._closeDropdown();
|
|
2887
2887
|
this._updateDialCode(listItem.getAttribute("data-dial-code"));
|
|
2888
|
+
if (this.options.formatOnDisplay) {
|
|
2889
|
+
this._updateValFromNumber(this.telInput.value);
|
|
2890
|
+
}
|
|
2888
2891
|
this.telInput.focus();
|
|
2889
2892
|
if (countryChanged) {
|
|
2890
2893
|
this._triggerCountryChange();
|
|
@@ -3182,6 +3185,9 @@ var Iti = class _Iti {
|
|
|
3182
3185
|
if (isCountryChange) {
|
|
3183
3186
|
this._setCountry(iso2Lower);
|
|
3184
3187
|
this._updateDialCode(this.selectedCountryData.dialCode);
|
|
3188
|
+
if (this.options.formatOnDisplay) {
|
|
3189
|
+
this._updateValFromNumber(this.telInput.value);
|
|
3190
|
+
}
|
|
3185
3191
|
this._triggerCountryChange();
|
|
3186
3192
|
}
|
|
3187
3193
|
}
|
|
@@ -3261,7 +3267,7 @@ var intlTelInput = Object.assign(
|
|
|
3261
3267
|
attachUtils,
|
|
3262
3268
|
startedLoadingUtilsScript: false,
|
|
3263
3269
|
startedLoadingAutoCountry: false,
|
|
3264
|
-
version: "25.8.
|
|
3270
|
+
version: "25.8.5"
|
|
3265
3271
|
}
|
|
3266
3272
|
);
|
|
3267
3273
|
var intl_tel_input_default = intlTelInput;
|
|
@@ -2312,7 +2312,7 @@ var Iti = class _Iti {
|
|
|
2312
2312
|
}
|
|
2313
2313
|
//* Initialize the tel input listeners.
|
|
2314
2314
|
_initTelInputListeners() {
|
|
2315
|
-
const { strictMode, formatAsYouType, separateDialCode,
|
|
2315
|
+
const { strictMode, formatAsYouType, separateDialCode, allowDropdown, countrySearch } = this.options;
|
|
2316
2316
|
let userOverrideFormatting = false;
|
|
2317
2317
|
if (/\p{L}/u.test(this.telInput.value)) {
|
|
2318
2318
|
userOverrideFormatting = true;
|
|
@@ -2336,8 +2336,8 @@ var Iti = class _Iti {
|
|
|
2336
2336
|
} else if (!/[^+0-9]/.test(this.telInput.value)) {
|
|
2337
2337
|
userOverrideFormatting = false;
|
|
2338
2338
|
}
|
|
2339
|
-
const
|
|
2340
|
-
if (formatAsYouType && !userOverrideFormatting && !
|
|
2339
|
+
const isSetNumber = e?.detail && e.detail["isSetNumber"];
|
|
2340
|
+
if (formatAsYouType && !userOverrideFormatting && !isSetNumber) {
|
|
2341
2341
|
const currentCaretPos = this.telInput.selectionStart || 0;
|
|
2342
2342
|
const valueBeforeCaret = this.telInput.value.substring(0, currentCaretPos);
|
|
2343
2343
|
const relevantCharsBeforeCaret = valueBeforeCaret.replace(/[^+0-9]/g, "").length;
|
|
@@ -2849,6 +2849,9 @@ var Iti = class _Iti {
|
|
|
2849
2849
|
);
|
|
2850
2850
|
this._closeDropdown();
|
|
2851
2851
|
this._updateDialCode(listItem.getAttribute("data-dial-code"));
|
|
2852
|
+
if (this.options.formatOnDisplay) {
|
|
2853
|
+
this._updateValFromNumber(this.telInput.value);
|
|
2854
|
+
}
|
|
2852
2855
|
this.telInput.focus();
|
|
2853
2856
|
if (countryChanged) {
|
|
2854
2857
|
this._triggerCountryChange();
|
|
@@ -3146,6 +3149,9 @@ var Iti = class _Iti {
|
|
|
3146
3149
|
if (isCountryChange) {
|
|
3147
3150
|
this._setCountry(iso2Lower);
|
|
3148
3151
|
this._updateDialCode(this.selectedCountryData.dialCode);
|
|
3152
|
+
if (this.options.formatOnDisplay) {
|
|
3153
|
+
this._updateValFromNumber(this.telInput.value);
|
|
3154
|
+
}
|
|
3149
3155
|
this._triggerCountryChange();
|
|
3150
3156
|
}
|
|
3151
3157
|
}
|
|
@@ -3225,7 +3231,7 @@ var intlTelInput = Object.assign(
|
|
|
3225
3231
|
attachUtils,
|
|
3226
3232
|
startedLoadingUtilsScript: false,
|
|
3227
3233
|
startedLoadingAutoCountry: false,
|
|
3228
|
-
version: "25.8.
|
|
3234
|
+
version: "25.8.5"
|
|
3229
3235
|
}
|
|
3230
3236
|
);
|
|
3231
3237
|
var intl_tel_input_default = intlTelInput;
|
|
@@ -2348,7 +2348,7 @@ var Iti = class _Iti {
|
|
|
2348
2348
|
}
|
|
2349
2349
|
//* Initialize the tel input listeners.
|
|
2350
2350
|
_initTelInputListeners() {
|
|
2351
|
-
const { strictMode, formatAsYouType, separateDialCode,
|
|
2351
|
+
const { strictMode, formatAsYouType, separateDialCode, allowDropdown, countrySearch } = this.options;
|
|
2352
2352
|
let userOverrideFormatting = false;
|
|
2353
2353
|
if (/\p{L}/u.test(this.telInput.value)) {
|
|
2354
2354
|
userOverrideFormatting = true;
|
|
@@ -2372,8 +2372,8 @@ var Iti = class _Iti {
|
|
|
2372
2372
|
} else if (!/[^+0-9]/.test(this.telInput.value)) {
|
|
2373
2373
|
userOverrideFormatting = false;
|
|
2374
2374
|
}
|
|
2375
|
-
const
|
|
2376
|
-
if (formatAsYouType && !userOverrideFormatting && !
|
|
2375
|
+
const isSetNumber = e?.detail && e.detail["isSetNumber"];
|
|
2376
|
+
if (formatAsYouType && !userOverrideFormatting && !isSetNumber) {
|
|
2377
2377
|
const currentCaretPos = this.telInput.selectionStart || 0;
|
|
2378
2378
|
const valueBeforeCaret = this.telInput.value.substring(0, currentCaretPos);
|
|
2379
2379
|
const relevantCharsBeforeCaret = valueBeforeCaret.replace(/[^+0-9]/g, "").length;
|
|
@@ -2885,6 +2885,9 @@ var Iti = class _Iti {
|
|
|
2885
2885
|
);
|
|
2886
2886
|
this._closeDropdown();
|
|
2887
2887
|
this._updateDialCode(listItem.getAttribute("data-dial-code"));
|
|
2888
|
+
if (this.options.formatOnDisplay) {
|
|
2889
|
+
this._updateValFromNumber(this.telInput.value);
|
|
2890
|
+
}
|
|
2888
2891
|
this.telInput.focus();
|
|
2889
2892
|
if (countryChanged) {
|
|
2890
2893
|
this._triggerCountryChange();
|
|
@@ -3182,6 +3185,9 @@ var Iti = class _Iti {
|
|
|
3182
3185
|
if (isCountryChange) {
|
|
3183
3186
|
this._setCountry(iso2Lower);
|
|
3184
3187
|
this._updateDialCode(this.selectedCountryData.dialCode);
|
|
3188
|
+
if (this.options.formatOnDisplay) {
|
|
3189
|
+
this._updateValFromNumber(this.telInput.value);
|
|
3190
|
+
}
|
|
3185
3191
|
this._triggerCountryChange();
|
|
3186
3192
|
}
|
|
3187
3193
|
}
|
|
@@ -3261,7 +3267,7 @@ var intlTelInput = Object.assign(
|
|
|
3261
3267
|
attachUtils,
|
|
3262
3268
|
startedLoadingUtilsScript: false,
|
|
3263
3269
|
startedLoadingAutoCountry: false,
|
|
3264
|
-
version: "25.8.
|
|
3270
|
+
version: "25.8.5"
|
|
3265
3271
|
}
|
|
3266
3272
|
);
|
|
3267
3273
|
var intl_tel_input_default = intlTelInput;
|
|
@@ -2312,7 +2312,7 @@ var Iti = class _Iti {
|
|
|
2312
2312
|
}
|
|
2313
2313
|
//* Initialize the tel input listeners.
|
|
2314
2314
|
_initTelInputListeners() {
|
|
2315
|
-
const { strictMode, formatAsYouType, separateDialCode,
|
|
2315
|
+
const { strictMode, formatAsYouType, separateDialCode, allowDropdown, countrySearch } = this.options;
|
|
2316
2316
|
let userOverrideFormatting = false;
|
|
2317
2317
|
if (/\p{L}/u.test(this.telInput.value)) {
|
|
2318
2318
|
userOverrideFormatting = true;
|
|
@@ -2336,8 +2336,8 @@ var Iti = class _Iti {
|
|
|
2336
2336
|
} else if (!/[^+0-9]/.test(this.telInput.value)) {
|
|
2337
2337
|
userOverrideFormatting = false;
|
|
2338
2338
|
}
|
|
2339
|
-
const
|
|
2340
|
-
if (formatAsYouType && !userOverrideFormatting && !
|
|
2339
|
+
const isSetNumber = e?.detail && e.detail["isSetNumber"];
|
|
2340
|
+
if (formatAsYouType && !userOverrideFormatting && !isSetNumber) {
|
|
2341
2341
|
const currentCaretPos = this.telInput.selectionStart || 0;
|
|
2342
2342
|
const valueBeforeCaret = this.telInput.value.substring(0, currentCaretPos);
|
|
2343
2343
|
const relevantCharsBeforeCaret = valueBeforeCaret.replace(/[^+0-9]/g, "").length;
|
|
@@ -2849,6 +2849,9 @@ var Iti = class _Iti {
|
|
|
2849
2849
|
);
|
|
2850
2850
|
this._closeDropdown();
|
|
2851
2851
|
this._updateDialCode(listItem.getAttribute("data-dial-code"));
|
|
2852
|
+
if (this.options.formatOnDisplay) {
|
|
2853
|
+
this._updateValFromNumber(this.telInput.value);
|
|
2854
|
+
}
|
|
2852
2855
|
this.telInput.focus();
|
|
2853
2856
|
if (countryChanged) {
|
|
2854
2857
|
this._triggerCountryChange();
|
|
@@ -3146,6 +3149,9 @@ var Iti = class _Iti {
|
|
|
3146
3149
|
if (isCountryChange) {
|
|
3147
3150
|
this._setCountry(iso2Lower);
|
|
3148
3151
|
this._updateDialCode(this.selectedCountryData.dialCode);
|
|
3152
|
+
if (this.options.formatOnDisplay) {
|
|
3153
|
+
this._updateValFromNumber(this.telInput.value);
|
|
3154
|
+
}
|
|
3149
3155
|
this._triggerCountryChange();
|
|
3150
3156
|
}
|
|
3151
3157
|
}
|
|
@@ -3225,7 +3231,7 @@ var intlTelInput = Object.assign(
|
|
|
3225
3231
|
attachUtils,
|
|
3226
3232
|
startedLoadingUtilsScript: false,
|
|
3227
3233
|
startedLoadingAutoCountry: false,
|
|
3228
|
-
version: "25.8.
|
|
3234
|
+
version: "25.8.5"
|
|
3229
3235
|
}
|
|
3230
3236
|
);
|
|
3231
3237
|
var intl_tel_input_default = intlTelInput;
|
package/vue/README.md
CHANGED
|
@@ -34,7 +34,7 @@ See the [Validation demo](https://github.com/jackocnr/intl-tel-input/blob/master
|
|
|
34
34
|
"vue:demo": "vite --config vue/demo/[demo variant]/vite.config.js"
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
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/vueWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/vue"` 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.
|
|
37
|
+
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/vueWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/vue"` 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.5/build/js/utils.js"`.
|
|
38
38
|
|
|
39
39
|
## Props
|
|
40
40
|
Here's a list of all of the current props you can pass to the IntlTelInput Vue component.
|