intl-tel-input 25.0.1 → 25.1.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 +9 -9
- package/build/js/data.js +35 -17
- package/build/js/data.min.js +2 -2
- package/build/js/intlTelInput.d.ts +6 -1
- package/build/js/intlTelInput.js +61 -32
- package/build/js/intlTelInput.min.js +2 -2
- package/build/js/intlTelInputWithUtils.js +61 -32
- package/build/js/intlTelInputWithUtils.min.js +2 -2
- package/package.json +1 -1
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +60 -31
- package/react/build/IntlTelInput.d.ts +6 -1
- package/react/build/IntlTelInput.js +60 -31
- package/react/build/IntlTelInputWithUtils.cjs +60 -31
- package/react/build/IntlTelInputWithUtils.js +60 -31
- package/vue/README.md +1 -1
- package/vue/build/IntlTelInput.mjs +140 -108
- package/vue/build/IntlTelInputWithUtils.mjs +527 -495
package/README.md
CHANGED
|
@@ -75,16 +75,16 @@ _Note: We have now dropped support for all versions of Internet Explorer because
|
|
|
75
75
|
## Getting Started (Using a CDN)
|
|
76
76
|
1. Add the CSS
|
|
77
77
|
```html
|
|
78
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/intl-tel-input@25.0
|
|
78
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/intl-tel-input@25.1.0/build/css/intlTelInput.css">
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
2. Add the plugin script and initialise it on your input element
|
|
82
82
|
```html
|
|
83
|
-
<script src="https://cdn.jsdelivr.net/npm/intl-tel-input@25.0
|
|
83
|
+
<script src="https://cdn.jsdelivr.net/npm/intl-tel-input@25.1.0/build/js/intlTelInput.min.js"></script>
|
|
84
84
|
<script>
|
|
85
85
|
const input = document.querySelector("#phone");
|
|
86
86
|
window.intlTelInput(input, {
|
|
87
|
-
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.0
|
|
87
|
+
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.1.0/build/js/utils.js"),
|
|
88
88
|
});
|
|
89
89
|
</script>
|
|
90
90
|
```
|
|
@@ -317,7 +317,7 @@ The `loadUtils` option takes a function which returns a Promise which resolves t
|
|
|
317
317
|
```js
|
|
318
318
|
// (A) import utils module from a CDN
|
|
319
319
|
intlTelInput(htmlInputElement, {
|
|
320
|
-
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.0
|
|
320
|
+
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.1.0/build/js/utils.js"),
|
|
321
321
|
});
|
|
322
322
|
|
|
323
323
|
// (B) import utils module from your own hosted version of utils.js
|
|
@@ -366,8 +366,8 @@ Type: `Boolean` Default: `true on mobile devices, false otherwise`
|
|
|
366
366
|
Control when the country list appears as a fullscreen popup vs an inline dropdown. By default, it will appear as a fullscreen popup on mobile devices (based on user-agent and screen width), to make better use of the limited space (similar to how a native `<select>` works), and as an inline dropdown on larger devices/screens. Play with this option on [Storybook](https://intl-tel-input.com/storybook/?path=/docs/intltelinput--usefullscreenpopup) (using the React component).
|
|
367
367
|
|
|
368
368
|
**validationNumberTypes**
|
|
369
|
-
Type: `String` Default: `["MOBILE"]`
|
|
370
|
-
Specify an array of [the keys](https://github.com/jackocnr/intl-tel-input/blob/master/src/js/utils.js#
|
|
369
|
+
Type: `String[]` Default: `["MOBILE"]`
|
|
370
|
+
Specify an array of [the keys](https://github.com/jackocnr/intl-tel-input/blob/master/src/js/utils.js#L198) from the enum `intlTelInput.utils.numberType` to set the number type(s) to enforce during validation, as well as the number length to enforce with `strictMode`. Set it to `null` to not enforce any particular type. By default, it's set to `["MOBILE"]` so `isValidNumber` will only return `true` for mobile numbers. Alternatively, you could set it to, for example, `["TOLL_FREE", "PREMIUM_RATE"]` to get `isValidNumber` to return `true` for only those kinds of numbers.
|
|
371
371
|
|
|
372
372
|
## Instance Methods
|
|
373
373
|
In these examples, `iti` refers to the plugin instance which gets returned when you initialise the plugin e.g.
|
|
@@ -437,14 +437,14 @@ if (error === intlTelInput.utils.validationError.TOO_SHORT) {
|
|
|
437
437
|
```
|
|
438
438
|
|
|
439
439
|
**isValidNumber**
|
|
440
|
-
Check if the current number is valid based on its length - [see example](https://intl-tel-input.com/examples/validation-practical.html), which should be sufficient for most use cases. See `isValidNumberPrecise` (DANGEROUS) for more precise validation, but the advantage of `isValidNumber` is that it is much more future-proof as while countries around the world regularly update their number rules, they rarely change their number lengths. If this method returns `false`, you can use `getValidationError` to get more information. Respects the `validationNumberTypes` option (which is set to `["MOBILE"]` by default). Requires the [utils script to be loaded](#loading-the-utilities-script).
|
|
440
|
+
Check if the current number is valid based on its length - [see example](https://intl-tel-input.com/examples/validation-practical.html), which should be sufficient for most use cases. See `isValidNumberPrecise` (DANGEROUS) for more precise validation, but the advantage of `isValidNumber` is that it is much more future-proof as while countries around the world regularly update their number rules, they rarely change their number lengths. If this method returns `false`, you can use `getValidationError` to get more information. Respects the `validationNumberTypes` option (which is set to `["MOBILE"]` by default, meaning `isValidNumber` will only return `true` for mobile numbers). Requires the [utils script to be loaded](#loading-the-utilities-script).
|
|
441
441
|
```js
|
|
442
442
|
const isValid = iti.isValidNumber();
|
|
443
443
|
```
|
|
444
444
|
Returns: `true`/`false`
|
|
445
445
|
|
|
446
446
|
**isValidNumberPrecise** ⚠️ DANGEROUS
|
|
447
|
-
Check if the current number is valid using precise matching rules for each country/area code etc - [see example](https://intl-tel-input.com/examples/validation.html). Note that these rules change each month for various countries around the world, so you need to be careful to constantly keep the plugin up-to-date (e.g. via an automated script) else <ins>you will start rejecting valid numbers</ins>. For a simpler and more future-proof form of validation, see `isValidNumber` above. If validation fails, you can use `getValidationError` to get more information. Respects the `validationNumberTypes` option (which is set to `["MOBILE"]` by default). Requires the [utils script to be loaded](#loading-the-utilities-script).
|
|
447
|
+
Check if the current number is valid using precise matching rules for each country/area code etc - [see example](https://intl-tel-input.com/examples/validation.html). Note that these rules change each month for various countries around the world, so you need to be careful to constantly keep the plugin up-to-date (e.g. via an automated script) else <ins>you will start rejecting valid numbers</ins>. For a simpler and more future-proof form of validation, see `isValidNumber` above. If validation fails, you can use `getValidationError` to get more information. Respects the `validationNumberTypes` option (which is set to `["MOBILE"]` by default, meaning `isValidNumberPrecise` will only return `true` for mobile numbers). Requires the [utils script to be loaded](#loading-the-utilities-script).
|
|
448
448
|
```js
|
|
449
449
|
const isValid = iti.isValidNumberPrecise();
|
|
450
450
|
```
|
|
@@ -598,7 +598,7 @@ The `loadUtils` option takes a function which returns a Promise which resolves t
|
|
|
598
598
|
```js
|
|
599
599
|
// (A) import utils module from a CDN
|
|
600
600
|
intlTelInput(htmlInputElement, {
|
|
601
|
-
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.0
|
|
601
|
+
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.1.0/build/js/utils.js"),
|
|
602
602
|
});
|
|
603
603
|
|
|
604
604
|
// (B) import utils module from your own hosted version of utils.js
|
package/build/js/data.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* International Telephone Input v25.0
|
|
2
|
+
* International Telephone Input v25.1.0
|
|
3
3
|
* https://github.com/jackocnr/intl-tel-input.git
|
|
4
4
|
* Licensed under the MIT license
|
|
5
5
|
*/
|
|
@@ -47,8 +47,7 @@ var factoryOutput = (() => {
|
|
|
47
47
|
"ax",
|
|
48
48
|
// Åland Islands
|
|
49
49
|
"358",
|
|
50
|
-
1
|
|
51
|
-
["18"]
|
|
50
|
+
1
|
|
52
51
|
],
|
|
53
52
|
[
|
|
54
53
|
"al",
|
|
@@ -115,7 +114,9 @@ var factoryOutput = (() => {
|
|
|
115
114
|
"au",
|
|
116
115
|
// Australia
|
|
117
116
|
"61",
|
|
118
|
-
0
|
|
117
|
+
0,
|
|
118
|
+
null,
|
|
119
|
+
"0"
|
|
119
120
|
],
|
|
120
121
|
[
|
|
121
122
|
"at",
|
|
@@ -296,14 +297,16 @@ var factoryOutput = (() => {
|
|
|
296
297
|
// Christmas Island
|
|
297
298
|
"61",
|
|
298
299
|
2,
|
|
299
|
-
["89164"]
|
|
300
|
+
["89164"],
|
|
301
|
+
"0"
|
|
300
302
|
],
|
|
301
303
|
[
|
|
302
304
|
"cc",
|
|
303
305
|
// Cocos (Keeling) Islands
|
|
304
306
|
"61",
|
|
305
307
|
1,
|
|
306
|
-
["89162"]
|
|
308
|
+
["89162"],
|
|
309
|
+
"0"
|
|
307
310
|
],
|
|
308
311
|
[
|
|
309
312
|
"co",
|
|
@@ -536,7 +539,8 @@ var factoryOutput = (() => {
|
|
|
536
539
|
// Guernsey
|
|
537
540
|
"44",
|
|
538
541
|
1,
|
|
539
|
-
["1481", "7781", "7839", "7911"]
|
|
542
|
+
["1481", "7781", "7839", "7911"],
|
|
543
|
+
"0"
|
|
540
544
|
],
|
|
541
545
|
[
|
|
542
546
|
"gn",
|
|
@@ -608,7 +612,8 @@ var factoryOutput = (() => {
|
|
|
608
612
|
// Isle of Man
|
|
609
613
|
"44",
|
|
610
614
|
2,
|
|
611
|
-
["1624", "74576", "7524", "7924", "7624"]
|
|
615
|
+
["1624", "74576", "7524", "7924", "7624"],
|
|
616
|
+
"0"
|
|
612
617
|
],
|
|
613
618
|
[
|
|
614
619
|
"il",
|
|
@@ -638,7 +643,8 @@ var factoryOutput = (() => {
|
|
|
638
643
|
// Jersey
|
|
639
644
|
"44",
|
|
640
645
|
3,
|
|
641
|
-
["1534", "7509", "7700", "7797", "7829", "7937"]
|
|
646
|
+
["1534", "7509", "7700", "7797", "7829", "7937"],
|
|
647
|
+
"0"
|
|
642
648
|
],
|
|
643
649
|
[
|
|
644
650
|
"jo",
|
|
@@ -650,7 +656,8 @@ var factoryOutput = (() => {
|
|
|
650
656
|
// Kazakhstan
|
|
651
657
|
"7",
|
|
652
658
|
1,
|
|
653
|
-
["33", "7"]
|
|
659
|
+
["33", "7"],
|
|
660
|
+
"8"
|
|
654
661
|
],
|
|
655
662
|
[
|
|
656
663
|
"ke",
|
|
@@ -782,7 +789,8 @@ var factoryOutput = (() => {
|
|
|
782
789
|
// Mayotte
|
|
783
790
|
"262",
|
|
784
791
|
1,
|
|
785
|
-
["269", "639"]
|
|
792
|
+
["269", "639"],
|
|
793
|
+
"0"
|
|
786
794
|
],
|
|
787
795
|
[
|
|
788
796
|
"mx",
|
|
@@ -825,7 +833,9 @@ var factoryOutput = (() => {
|
|
|
825
833
|
"ma",
|
|
826
834
|
// Morocco
|
|
827
835
|
"212",
|
|
828
|
-
0
|
|
836
|
+
0,
|
|
837
|
+
null,
|
|
838
|
+
"0"
|
|
829
839
|
],
|
|
830
840
|
[
|
|
831
841
|
"mz",
|
|
@@ -986,7 +996,9 @@ var factoryOutput = (() => {
|
|
|
986
996
|
"re",
|
|
987
997
|
// Réunion
|
|
988
998
|
"262",
|
|
989
|
-
0
|
|
999
|
+
0,
|
|
1000
|
+
null,
|
|
1001
|
+
"0"
|
|
990
1002
|
],
|
|
991
1003
|
[
|
|
992
1004
|
"ro",
|
|
@@ -997,7 +1009,9 @@ var factoryOutput = (() => {
|
|
|
997
1009
|
"ru",
|
|
998
1010
|
// Russia
|
|
999
1011
|
"7",
|
|
1000
|
-
0
|
|
1012
|
+
0,
|
|
1013
|
+
null,
|
|
1014
|
+
"8"
|
|
1001
1015
|
],
|
|
1002
1016
|
[
|
|
1003
1017
|
"rw",
|
|
@@ -1269,7 +1283,9 @@ var factoryOutput = (() => {
|
|
|
1269
1283
|
"gb",
|
|
1270
1284
|
// United Kingdom
|
|
1271
1285
|
"44",
|
|
1272
|
-
0
|
|
1286
|
+
0,
|
|
1287
|
+
null,
|
|
1288
|
+
"0"
|
|
1273
1289
|
],
|
|
1274
1290
|
[
|
|
1275
1291
|
"us",
|
|
@@ -1326,7 +1342,8 @@ var factoryOutput = (() => {
|
|
|
1326
1342
|
// Western Sahara
|
|
1327
1343
|
"212",
|
|
1328
1344
|
1,
|
|
1329
|
-
["5288", "5289"]
|
|
1345
|
+
["5288", "5289"],
|
|
1346
|
+
"0"
|
|
1330
1347
|
],
|
|
1331
1348
|
[
|
|
1332
1349
|
"ye",
|
|
@@ -1354,7 +1371,8 @@ var factoryOutput = (() => {
|
|
|
1354
1371
|
dialCode: c[1],
|
|
1355
1372
|
priority: c[2] || 0,
|
|
1356
1373
|
areaCodes: c[3] || null,
|
|
1357
|
-
nodeById: {}
|
|
1374
|
+
nodeById: {},
|
|
1375
|
+
nationalPrefix: c[4] || null
|
|
1358
1376
|
};
|
|
1359
1377
|
}
|
|
1360
1378
|
var data_default = allCountries;
|
package/build/js/data.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* International Telephone Input v25.0
|
|
2
|
+
* International Telephone Input v25.1.0
|
|
3
3
|
* https://github.com/jackocnr/intl-tel-input.git
|
|
4
4
|
* Licensed under the MIT license
|
|
5
5
|
*/
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
}(() => {
|
|
15
15
|
|
|
16
|
-
var factoryOutput=(()=>{var
|
|
16
|
+
var factoryOutput=(()=>{var l=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var c=(t,n)=>{for(var s in n)l(t,s,{get:n[s],enumerable:!0})},u=(t,n,s,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of g(n))!o.call(t,r)&&r!==s&&l(t,r,{get:()=>n[r],enumerable:!(a=m(n,r))||a.enumerable});return t};var b=t=>u(l({},"__esModule",{value:!0}),t);var p={};c(p,{default:()=>d});var e=[["af","93"],["ax","358",1],["al","355"],["dz","213"],["as","1",5,["684"]],["ad","376"],["ao","244"],["ai","1",6,["264"]],["ag","1",7,["268"]],["ar","54"],["am","374"],["aw","297"],["ac","247"],["au","61",0,null,"0"],["at","43"],["az","994"],["bs","1",8,["242"]],["bh","973"],["bd","880"],["bb","1",9,["246"]],["by","375"],["be","32"],["bz","501"],["bj","229"],["bm","1",10,["441"]],["bt","975"],["bo","591"],["ba","387"],["bw","267"],["br","55"],["io","246"],["vg","1",11,["284"]],["bn","673"],["bg","359"],["bf","226"],["bi","257"],["kh","855"],["cm","237"],["ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","879","902","905"]],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"]],["cf","236"],["td","235"],["cl","56"],["cn","86"],["cx","61",2,["89164"],"0"],["cc","61",1,["89162"],"0"],["co","57"],["km","269"],["cg","242"],["cd","243"],["ck","682"],["cr","506"],["ci","225"],["hr","385"],["cu","53"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"]],["do","1",2,["809","829","849"]],["ec","593"],["eg","20"],["sv","503"],["gq","240"],["er","291"],["ee","372"],["sz","268"],["et","251"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0],["fr","33"],["gf","594"],["pf","689"],["ga","241"],["gm","220"],["ge","995"],["de","49"],["gh","233"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"]],["gp","590",0],["gu","1",15,["671"]],["gt","502"],["gg","44",1,["1481","7781","7839","7911"],"0"],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36"],["is","354"],["in","91"],["id","62"],["ir","98"],["iq","964"],["ie","353"],["im","44",2,["1624","74576","7524","7924","7624"],"0"],["il","972"],["it","39",0],["jm","1",4,["876","658"]],["jp","81"],["je","44",3,["1534","7509","7700","7797","7829","7937"],"0"],["jo","962"],["kz","7",1,["33","7"],"8"],["ke","254"],["ki","686"],["xk","383"],["kw","965"],["kg","996"],["la","856"],["lv","371"],["lb","961"],["ls","266"],["lr","231"],["ly","218"],["li","423"],["lt","370"],["lu","352"],["mo","853"],["mg","261"],["mw","265"],["my","60"],["mv","960"],["ml","223"],["mt","356"],["mh","692"],["mq","596"],["mr","222"],["mu","230"],["yt","262",1,["269","639"],"0"],["mx","52"],["fm","691"],["md","373"],["mc","377"],["mn","976"],["me","382"],["ms","1",16,["664"]],["ma","212",0,null,"0"],["mz","258"],["mm","95"],["na","264"],["nr","674"],["np","977"],["nl","31"],["nc","687"],["nz","64"],["ni","505"],["ne","227"],["ng","234"],["nu","683"],["nf","672"],["kp","850"],["mk","389"],["mp","1",17,["670"]],["no","47",0],["om","968"],["pk","92"],["pw","680"],["ps","970"],["pa","507"],["pg","675"],["py","595"],["pe","51"],["ph","63"],["pl","48"],["pt","351"],["pr","1",3,["787","939"]],["qa","974"],["re","262",0,null,"0"],["ro","40"],["ru","7",0,null,"8"],["rw","250"],["ws","685"],["sm","378"],["st","239"],["sa","966"],["sn","221"],["rs","381"],["sc","248"],["sl","232"],["sg","65"],["sx","1",21,["721"]],["sk","421"],["si","386"],["sb","677"],["so","252"],["za","27"],["kr","82"],["ss","211"],["es","34"],["lk","94"],["bl","590",1],["sh","290"],["kn","1",18,["869"]],["lc","1",19,["758"]],["mf","590",2],["pm","508"],["vc","1",20,["784"]],["sd","249"],["sr","597"],["sj","47",1,["79"]],["se","46"],["ch","41"],["sy","963"],["tw","886"],["tj","992"],["tz","255"],["th","66"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"]],["tn","216"],["tr","90"],["tm","993"],["tc","1",23,["649"]],["tv","688"],["ug","256"],["ua","380"],["ae","971"],["gb","44",0,null,"0"],["us","1",0],["uy","598"],["vi","1",24,["340"]],["uz","998"],["vu","678"],["va","39",1,["06698"]],["ve","58"],["vn","84"],["wf","681"],["eh","212",1,["5288","5289"],"0"],["ye","967"],["zm","260"],["zw","263"]],i=[];for(let t=0;t<e.length;t++){let n=e[t];i[t]={name:"",iso2:n[0],dialCode:n[1],priority:n[2]||0,areaCodes:n[3]||null,nodeById:{},nationalPrefix:n[4]||null}}var d=i;return b(p);})();
|
|
17
17
|
|
|
18
18
|
// UMD
|
|
19
19
|
return factoryOutput.default;
|
|
@@ -6,6 +6,7 @@ declare module "intl-tel-input/data" {
|
|
|
6
6
|
priority: number;
|
|
7
7
|
areaCodes: string[] | null;
|
|
8
8
|
nodeById: object;
|
|
9
|
+
nationalPrefix: string | null;
|
|
9
10
|
};
|
|
10
11
|
const allCountries: Country[];
|
|
11
12
|
export default allCountries;
|
|
@@ -324,10 +325,12 @@ declare module "intl-tel-input" {
|
|
|
324
325
|
numberType: object;
|
|
325
326
|
};
|
|
326
327
|
type NumberType = "FIXED_LINE_OR_MOBILE" | "FIXED_LINE" | "MOBILE" | "PAGER" | "PERSONAL_NUMBER" | "PREMIUM_RATE" | "SHARED_COST" | "TOLL_FREE" | "UAN" | "UNKNOWN" | "VOICEMAIL" | "VOIP";
|
|
327
|
-
type SelectedCountryData =
|
|
328
|
+
type SelectedCountryData = {
|
|
328
329
|
name?: string;
|
|
329
330
|
iso2?: string;
|
|
330
331
|
dialCode?: string;
|
|
332
|
+
areaCodes?: string[];
|
|
333
|
+
nationalPrefix?: string;
|
|
331
334
|
};
|
|
332
335
|
interface AllOptions {
|
|
333
336
|
allowDropdown: boolean;
|
|
@@ -391,6 +394,7 @@ declare module "intl-tel-input" {
|
|
|
391
394
|
private defaultCountry;
|
|
392
395
|
private originalPaddingRight;
|
|
393
396
|
private originalPaddingLeft;
|
|
397
|
+
private prevDialCodeMatch;
|
|
394
398
|
private _handleHiddenInputSubmit;
|
|
395
399
|
private _handleLabelClick;
|
|
396
400
|
private _handleClickSelectedCountry;
|
|
@@ -438,6 +442,7 @@ declare module "intl-tel-input" {
|
|
|
438
442
|
private _handleEnterKey;
|
|
439
443
|
private _updateValFromNumber;
|
|
440
444
|
private _updateCountryFromNumber;
|
|
445
|
+
private _ensureHasDialCode;
|
|
441
446
|
private _getCountryFromNumber;
|
|
442
447
|
private _highlightListItem;
|
|
443
448
|
private _getCountryData;
|
package/build/js/intlTelInput.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* International Telephone Input v25.0
|
|
2
|
+
* International Telephone Input v25.1.0
|
|
3
3
|
* https://github.com/jackocnr/intl-tel-input.git
|
|
4
4
|
* Licensed under the MIT license
|
|
5
5
|
*/
|
|
@@ -50,8 +50,7 @@ var factoryOutput = (() => {
|
|
|
50
50
|
"ax",
|
|
51
51
|
// Åland Islands
|
|
52
52
|
"358",
|
|
53
|
-
1
|
|
54
|
-
["18"]
|
|
53
|
+
1
|
|
55
54
|
],
|
|
56
55
|
[
|
|
57
56
|
"al",
|
|
@@ -118,7 +117,9 @@ var factoryOutput = (() => {
|
|
|
118
117
|
"au",
|
|
119
118
|
// Australia
|
|
120
119
|
"61",
|
|
121
|
-
0
|
|
120
|
+
0,
|
|
121
|
+
null,
|
|
122
|
+
"0"
|
|
122
123
|
],
|
|
123
124
|
[
|
|
124
125
|
"at",
|
|
@@ -299,14 +300,16 @@ var factoryOutput = (() => {
|
|
|
299
300
|
// Christmas Island
|
|
300
301
|
"61",
|
|
301
302
|
2,
|
|
302
|
-
["89164"]
|
|
303
|
+
["89164"],
|
|
304
|
+
"0"
|
|
303
305
|
],
|
|
304
306
|
[
|
|
305
307
|
"cc",
|
|
306
308
|
// Cocos (Keeling) Islands
|
|
307
309
|
"61",
|
|
308
310
|
1,
|
|
309
|
-
["89162"]
|
|
311
|
+
["89162"],
|
|
312
|
+
"0"
|
|
310
313
|
],
|
|
311
314
|
[
|
|
312
315
|
"co",
|
|
@@ -539,7 +542,8 @@ var factoryOutput = (() => {
|
|
|
539
542
|
// Guernsey
|
|
540
543
|
"44",
|
|
541
544
|
1,
|
|
542
|
-
["1481", "7781", "7839", "7911"]
|
|
545
|
+
["1481", "7781", "7839", "7911"],
|
|
546
|
+
"0"
|
|
543
547
|
],
|
|
544
548
|
[
|
|
545
549
|
"gn",
|
|
@@ -611,7 +615,8 @@ var factoryOutput = (() => {
|
|
|
611
615
|
// Isle of Man
|
|
612
616
|
"44",
|
|
613
617
|
2,
|
|
614
|
-
["1624", "74576", "7524", "7924", "7624"]
|
|
618
|
+
["1624", "74576", "7524", "7924", "7624"],
|
|
619
|
+
"0"
|
|
615
620
|
],
|
|
616
621
|
[
|
|
617
622
|
"il",
|
|
@@ -641,7 +646,8 @@ var factoryOutput = (() => {
|
|
|
641
646
|
// Jersey
|
|
642
647
|
"44",
|
|
643
648
|
3,
|
|
644
|
-
["1534", "7509", "7700", "7797", "7829", "7937"]
|
|
649
|
+
["1534", "7509", "7700", "7797", "7829", "7937"],
|
|
650
|
+
"0"
|
|
645
651
|
],
|
|
646
652
|
[
|
|
647
653
|
"jo",
|
|
@@ -653,7 +659,8 @@ var factoryOutput = (() => {
|
|
|
653
659
|
// Kazakhstan
|
|
654
660
|
"7",
|
|
655
661
|
1,
|
|
656
|
-
["33", "7"]
|
|
662
|
+
["33", "7"],
|
|
663
|
+
"8"
|
|
657
664
|
],
|
|
658
665
|
[
|
|
659
666
|
"ke",
|
|
@@ -785,7 +792,8 @@ var factoryOutput = (() => {
|
|
|
785
792
|
// Mayotte
|
|
786
793
|
"262",
|
|
787
794
|
1,
|
|
788
|
-
["269", "639"]
|
|
795
|
+
["269", "639"],
|
|
796
|
+
"0"
|
|
789
797
|
],
|
|
790
798
|
[
|
|
791
799
|
"mx",
|
|
@@ -828,7 +836,9 @@ var factoryOutput = (() => {
|
|
|
828
836
|
"ma",
|
|
829
837
|
// Morocco
|
|
830
838
|
"212",
|
|
831
|
-
0
|
|
839
|
+
0,
|
|
840
|
+
null,
|
|
841
|
+
"0"
|
|
832
842
|
],
|
|
833
843
|
[
|
|
834
844
|
"mz",
|
|
@@ -989,7 +999,9 @@ var factoryOutput = (() => {
|
|
|
989
999
|
"re",
|
|
990
1000
|
// Réunion
|
|
991
1001
|
"262",
|
|
992
|
-
0
|
|
1002
|
+
0,
|
|
1003
|
+
null,
|
|
1004
|
+
"0"
|
|
993
1005
|
],
|
|
994
1006
|
[
|
|
995
1007
|
"ro",
|
|
@@ -1000,7 +1012,9 @@ var factoryOutput = (() => {
|
|
|
1000
1012
|
"ru",
|
|
1001
1013
|
// Russia
|
|
1002
1014
|
"7",
|
|
1003
|
-
0
|
|
1015
|
+
0,
|
|
1016
|
+
null,
|
|
1017
|
+
"8"
|
|
1004
1018
|
],
|
|
1005
1019
|
[
|
|
1006
1020
|
"rw",
|
|
@@ -1272,7 +1286,9 @@ var factoryOutput = (() => {
|
|
|
1272
1286
|
"gb",
|
|
1273
1287
|
// United Kingdom
|
|
1274
1288
|
"44",
|
|
1275
|
-
0
|
|
1289
|
+
0,
|
|
1290
|
+
null,
|
|
1291
|
+
"0"
|
|
1276
1292
|
],
|
|
1277
1293
|
[
|
|
1278
1294
|
"us",
|
|
@@ -1329,7 +1345,8 @@ var factoryOutput = (() => {
|
|
|
1329
1345
|
// Western Sahara
|
|
1330
1346
|
"212",
|
|
1331
1347
|
1,
|
|
1332
|
-
["5288", "5289"]
|
|
1348
|
+
["5288", "5289"],
|
|
1349
|
+
"0"
|
|
1333
1350
|
],
|
|
1334
1351
|
[
|
|
1335
1352
|
"ye",
|
|
@@ -1357,7 +1374,8 @@ var factoryOutput = (() => {
|
|
|
1357
1374
|
dialCode: c[1],
|
|
1358
1375
|
priority: c[2] || 0,
|
|
1359
1376
|
areaCodes: c[3] || null,
|
|
1360
|
-
nodeById: {}
|
|
1377
|
+
nodeById: {},
|
|
1378
|
+
nationalPrefix: c[4] || null
|
|
1361
1379
|
};
|
|
1362
1380
|
}
|
|
1363
1381
|
var data_default = allCountries;
|
|
@@ -1900,7 +1918,8 @@ var factoryOutput = (() => {
|
|
|
1900
1918
|
for (let j = 0; j < c.areaCodes.length; j++) {
|
|
1901
1919
|
const areaCode = c.areaCodes[j];
|
|
1902
1920
|
for (let k = 1; k < areaCode.length; k++) {
|
|
1903
|
-
const
|
|
1921
|
+
const partialAreaCode = areaCode.substr(0, k);
|
|
1922
|
+
const partialDialCode = c.dialCode + partialAreaCode;
|
|
1904
1923
|
this._addToDialCodeMap(rootIso2Code, partialDialCode);
|
|
1905
1924
|
this._addToDialCodeMap(c.iso2, partialDialCode);
|
|
1906
1925
|
}
|
|
@@ -2560,25 +2579,35 @@ var factoryOutput = (() => {
|
|
|
2560
2579
|
}
|
|
2561
2580
|
return false;
|
|
2562
2581
|
}
|
|
2582
|
+
_ensureHasDialCode(number) {
|
|
2583
|
+
const { dialCode, nationalPrefix } = this.selectedCountryData;
|
|
2584
|
+
const alreadyHasPlus = number.charAt(0) === "+";
|
|
2585
|
+
if (alreadyHasPlus || !dialCode) {
|
|
2586
|
+
return number;
|
|
2587
|
+
}
|
|
2588
|
+
const hasPrefix = nationalPrefix && number.charAt(0) === nationalPrefix && !this.options.separateDialCode;
|
|
2589
|
+
const cleanNumber = hasPrefix ? number.substring(1) : number;
|
|
2590
|
+
return `+${dialCode}${cleanNumber}`;
|
|
2591
|
+
}
|
|
2563
2592
|
_getCountryFromNumber(fullNumber) {
|
|
2564
2593
|
const plusIndex = fullNumber.indexOf("+");
|
|
2565
2594
|
let number = plusIndex ? fullNumber.substring(plusIndex) : fullNumber;
|
|
2595
|
+
const selectedIso2 = this.selectedCountryData.iso2;
|
|
2566
2596
|
const selectedDialCode = this.selectedCountryData.dialCode;
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
}
|
|
2572
|
-
number = `+${number}`;
|
|
2573
|
-
}
|
|
2574
|
-
if (this.options.separateDialCode && selectedDialCode && number.charAt(0) !== "+") {
|
|
2575
|
-
number = `+${selectedDialCode}${number}`;
|
|
2597
|
+
number = this._ensureHasDialCode(number);
|
|
2598
|
+
const dialCodeMatch = this._getDialCode(number, true);
|
|
2599
|
+
if (dialCodeMatch && dialCodeMatch === this.prevDialCodeMatch) {
|
|
2600
|
+
return null;
|
|
2576
2601
|
}
|
|
2577
|
-
|
|
2602
|
+
this.prevDialCodeMatch = dialCodeMatch;
|
|
2578
2603
|
const numeric = getNumeric(number);
|
|
2579
|
-
if (
|
|
2580
|
-
const
|
|
2581
|
-
const
|
|
2604
|
+
if (dialCodeMatch) {
|
|
2605
|
+
const dialCodeMatchNumeric = getNumeric(dialCodeMatch);
|
|
2606
|
+
const iso2Codes = this.dialCodeToIso2Map[dialCodeMatchNumeric];
|
|
2607
|
+
if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
|
|
2608
|
+
return this.defaultCountry;
|
|
2609
|
+
}
|
|
2610
|
+
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && numeric.length === dialCodeMatchNumeric.length;
|
|
2582
2611
|
const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
|
|
2583
2612
|
if (!isRegionlessNanpNumber && !alreadySelected) {
|
|
2584
2613
|
for (let j = 0; j < iso2Codes.length; j++) {
|
|
@@ -3144,7 +3173,7 @@ var factoryOutput = (() => {
|
|
|
3144
3173
|
attachUtils,
|
|
3145
3174
|
startedLoadingUtilsScript: false,
|
|
3146
3175
|
startedLoadingAutoCountry: false,
|
|
3147
|
-
version: "25.0
|
|
3176
|
+
version: "25.1.0"
|
|
3148
3177
|
}
|
|
3149
3178
|
);
|
|
3150
3179
|
var intl_tel_input_default = intlTelInput;
|