@moddi3/ngx-intl-tel-input 3.3.7 → 16.0.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 +50 -51
- package/esm2022/lib/data/country-code.mjs +325 -0
- package/esm2022/lib/directives/native-element-injector.directive.mjs +33 -0
- package/{esm2020 → esm2022}/lib/enums/country-iso.enum.mjs +1 -1
- package/{esm2020 → esm2022}/lib/enums/phone-number-format.enum.mjs +1 -1
- package/{esm2020 → esm2022}/lib/enums/search-country-field.enum.mjs +1 -1
- package/{esm2020 → esm2022}/lib/interfaces/change-data.mjs +1 -1
- package/esm2022/lib/ngx-intl-tel-input.component.mjs +515 -0
- package/esm2022/lib/ngx-intl-tel-input.module.mjs +23 -0
- package/esm2022/lib/ngx-intl-tel-input.validator.mjs +59 -0
- package/fesm2022/moddi3-ngx-intl-tel-input.mjs +1208 -0
- package/fesm2022/moddi3-ngx-intl-tel-input.mjs.map +1 -0
- package/lib/data/country-code.d.ts.map +1 -1
- package/lib/directives/native-element-injector.directive.d.ts.map +1 -1
- package/lib/enums/country-iso.enum.d.ts.map +1 -1
- package/lib/enums/phone-number-format.enum.d.ts.map +1 -1
- package/lib/enums/search-country-field.enum.d.ts.map +1 -1
- package/lib/interfaces/change-data.d.ts.map +1 -1
- package/lib/ngx-intl-tel-input.component.d.ts +1 -1
- package/lib/ngx-intl-tel-input.component.d.ts.map +1 -1
- package/lib/ngx-intl-tel-input.module.d.ts.map +1 -1
- package/lib/ngx-intl-tel-input.validator.d.ts.map +1 -1
- package/moddi3-ngx-intl-tel-input-16.0.0.tgz +0 -0
- package/package.json +11 -16
- package/esm2020/lib/data/country-code.mjs +0 -1333
- package/esm2020/lib/directives/native-element-injector.directive.mjs +0 -33
- package/esm2020/lib/ngx-intl-tel-input.component.mjs +0 -525
- package/esm2020/lib/ngx-intl-tel-input.module.mjs +0 -33
- package/esm2020/lib/ngx-intl-tel-input.validator.mjs +0 -61
- package/fesm2015/moddi3-ngx-intl-tel-input.mjs +0 -2238
- package/fesm2015/moddi3-ngx-intl-tel-input.mjs.map +0 -1
- package/fesm2020/moddi3-ngx-intl-tel-input.mjs +0 -2238
- package/fesm2020/moddi3-ngx-intl-tel-input.mjs.map +0 -1
- package/moddi3-ngx-intl-tel-input-3.3.7.tgz +0 -0
- /package/{esm2020 → esm2022}/lib/model/country.model.mjs +0 -0
- /package/{esm2020 → esm2022}/moddi3-ngx-intl-tel-input.mjs +0 -0
- /package/{esm2020 → esm2022}/public_api.mjs +0 -0
|
@@ -0,0 +1,1208 @@
|
|
|
1
|
+
import * as lpn from 'google-libphonenumber';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Injectable, Directive, EventEmitter, forwardRef, Component, Input, Output, ViewChild, NgModule } from '@angular/core';
|
|
4
|
+
import * as i3 from '@angular/forms';
|
|
5
|
+
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
6
|
+
import * as i2 from '@angular/common';
|
|
7
|
+
import { CommonModule } from '@angular/common';
|
|
8
|
+
import * as i4 from 'ngx-bootstrap/dropdown';
|
|
9
|
+
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
|
|
10
|
+
|
|
11
|
+
var CountryISO;
|
|
12
|
+
(function (CountryISO) {
|
|
13
|
+
CountryISO["Afghanistan"] = "af";
|
|
14
|
+
CountryISO["Albania"] = "al";
|
|
15
|
+
CountryISO["Algeria"] = "dz";
|
|
16
|
+
CountryISO["AmericanSamoa"] = "as";
|
|
17
|
+
CountryISO["Andorra"] = "ad";
|
|
18
|
+
CountryISO["Angola"] = "ao";
|
|
19
|
+
CountryISO["Anguilla"] = "ai";
|
|
20
|
+
CountryISO["AntiguaAndBarbuda"] = "ag";
|
|
21
|
+
CountryISO["Argentina"] = "ar";
|
|
22
|
+
CountryISO["Armenia"] = "am";
|
|
23
|
+
CountryISO["Aruba"] = "aw";
|
|
24
|
+
CountryISO["Australia"] = "au";
|
|
25
|
+
CountryISO["Austria"] = "at";
|
|
26
|
+
CountryISO["Azerbaijan"] = "az";
|
|
27
|
+
CountryISO["Bahamas"] = "bs";
|
|
28
|
+
CountryISO["Bahrain"] = "bh";
|
|
29
|
+
CountryISO["Bangladesh"] = "bd";
|
|
30
|
+
CountryISO["Barbados"] = "bb";
|
|
31
|
+
CountryISO["Belarus"] = "by";
|
|
32
|
+
CountryISO["Belgium"] = "be";
|
|
33
|
+
CountryISO["Belize"] = "bz";
|
|
34
|
+
CountryISO["Benin"] = "bj";
|
|
35
|
+
CountryISO["Bermuda"] = "bm";
|
|
36
|
+
CountryISO["Bhutan"] = "bt";
|
|
37
|
+
CountryISO["Bolivia"] = "bo";
|
|
38
|
+
CountryISO["BosniaAndHerzegovina"] = "ba";
|
|
39
|
+
CountryISO["Botswana"] = "bw";
|
|
40
|
+
CountryISO["Brazil"] = "br";
|
|
41
|
+
CountryISO["BritishIndianOceanTerritory"] = "io";
|
|
42
|
+
CountryISO["BritishVirginIslands"] = "vg";
|
|
43
|
+
CountryISO["Brunei"] = "bn";
|
|
44
|
+
CountryISO["Bulgaria"] = "bg";
|
|
45
|
+
CountryISO["BurkinaFaso"] = "bf";
|
|
46
|
+
CountryISO["Burundi"] = "bi";
|
|
47
|
+
CountryISO["Cambodia"] = "kh";
|
|
48
|
+
CountryISO["Cameroon"] = "cm";
|
|
49
|
+
CountryISO["Canada"] = "ca";
|
|
50
|
+
CountryISO["CapeVerde"] = "cv";
|
|
51
|
+
CountryISO["CaribbeanNetherlands"] = "bq";
|
|
52
|
+
CountryISO["CaymanIslands"] = "ky";
|
|
53
|
+
CountryISO["CentralAfricanRepublic"] = "cf";
|
|
54
|
+
CountryISO["Chad"] = "td";
|
|
55
|
+
CountryISO["Chile"] = "cl";
|
|
56
|
+
CountryISO["China"] = "cn";
|
|
57
|
+
CountryISO["ChristmasIsland"] = "cx";
|
|
58
|
+
CountryISO["Cocos"] = "cc";
|
|
59
|
+
CountryISO["Colombia"] = "co";
|
|
60
|
+
CountryISO["Comoros"] = "km";
|
|
61
|
+
CountryISO["CongoDRCJamhuriYaKidemokrasiaYaKongo"] = "cd";
|
|
62
|
+
CountryISO["CongoRepublicCongoBrazzaville"] = "cg";
|
|
63
|
+
CountryISO["CookIslands"] = "ck";
|
|
64
|
+
CountryISO["CostaRica"] = "cr";
|
|
65
|
+
CountryISO["C\u00F4teDIvoire"] = "ci";
|
|
66
|
+
CountryISO["Croatia"] = "hr";
|
|
67
|
+
CountryISO["Cuba"] = "cu";
|
|
68
|
+
CountryISO["Cura\u00E7ao"] = "cw";
|
|
69
|
+
CountryISO["Cyprus"] = "cy";
|
|
70
|
+
CountryISO["CzechRepublic"] = "cz";
|
|
71
|
+
CountryISO["Denmark"] = "dk";
|
|
72
|
+
CountryISO["Djibouti"] = "dj";
|
|
73
|
+
CountryISO["Dominica"] = "dm";
|
|
74
|
+
CountryISO["DominicanRepublic"] = "do";
|
|
75
|
+
CountryISO["Ecuador"] = "ec";
|
|
76
|
+
CountryISO["Egypt"] = "eg";
|
|
77
|
+
CountryISO["ElSalvador"] = "sv";
|
|
78
|
+
CountryISO["EquatorialGuinea"] = "gq";
|
|
79
|
+
CountryISO["Eritrea"] = "er";
|
|
80
|
+
CountryISO["Estonia"] = "ee";
|
|
81
|
+
CountryISO["Ethiopia"] = "et";
|
|
82
|
+
CountryISO["FalklandIslands"] = "fk";
|
|
83
|
+
CountryISO["FaroeIslands"] = "fo";
|
|
84
|
+
CountryISO["Fiji"] = "fj";
|
|
85
|
+
CountryISO["Finland"] = "fi";
|
|
86
|
+
CountryISO["France"] = "fr";
|
|
87
|
+
CountryISO["FrenchGuiana"] = "gf";
|
|
88
|
+
CountryISO["FrenchPolynesia"] = "pf";
|
|
89
|
+
CountryISO["Gabon"] = "ga";
|
|
90
|
+
CountryISO["Gambia"] = "gm";
|
|
91
|
+
CountryISO["Georgia"] = "ge";
|
|
92
|
+
CountryISO["Germany"] = "de";
|
|
93
|
+
CountryISO["Ghana"] = "gh";
|
|
94
|
+
CountryISO["Gibraltar"] = "gi";
|
|
95
|
+
CountryISO["Greece"] = "gr";
|
|
96
|
+
CountryISO["Greenland"] = "gl";
|
|
97
|
+
CountryISO["Grenada"] = "gd";
|
|
98
|
+
CountryISO["Guadeloupe"] = "gp";
|
|
99
|
+
CountryISO["Guam"] = "gu";
|
|
100
|
+
CountryISO["Guatemala"] = "gt";
|
|
101
|
+
CountryISO["Guernsey"] = "gg";
|
|
102
|
+
CountryISO["Guinea"] = "gn";
|
|
103
|
+
CountryISO["GuineaBissau"] = "gw";
|
|
104
|
+
CountryISO["Guyana"] = "gy";
|
|
105
|
+
CountryISO["Haiti"] = "ht";
|
|
106
|
+
CountryISO["Honduras"] = "hn";
|
|
107
|
+
CountryISO["HongKong"] = "hk";
|
|
108
|
+
CountryISO["Hungary"] = "hu";
|
|
109
|
+
CountryISO["Iceland"] = "is";
|
|
110
|
+
CountryISO["India"] = "in";
|
|
111
|
+
CountryISO["Indonesia"] = "id";
|
|
112
|
+
CountryISO["Iran"] = "ir";
|
|
113
|
+
CountryISO["Iraq"] = "iq";
|
|
114
|
+
CountryISO["Ireland"] = "ie";
|
|
115
|
+
CountryISO["IsleOfMan"] = "im";
|
|
116
|
+
CountryISO["Israel"] = "il";
|
|
117
|
+
CountryISO["Italy"] = "it";
|
|
118
|
+
CountryISO["Jamaica"] = "jm";
|
|
119
|
+
CountryISO["Japan"] = "jp";
|
|
120
|
+
CountryISO["Jersey"] = "je";
|
|
121
|
+
CountryISO["Jordan"] = "jo";
|
|
122
|
+
CountryISO["Kazakhstan"] = "kz";
|
|
123
|
+
CountryISO["Kenya"] = "ke";
|
|
124
|
+
CountryISO["Kiribati"] = "ki";
|
|
125
|
+
CountryISO["Kosovo"] = "xk";
|
|
126
|
+
CountryISO["Kuwait"] = "kw";
|
|
127
|
+
CountryISO["Kyrgyzstan"] = "kg";
|
|
128
|
+
CountryISO["Laos"] = "la";
|
|
129
|
+
CountryISO["Latvia"] = "lv";
|
|
130
|
+
CountryISO["Lebanon"] = "lb";
|
|
131
|
+
CountryISO["Lesotho"] = "ls";
|
|
132
|
+
CountryISO["Liberia"] = "lr";
|
|
133
|
+
CountryISO["Libya"] = "ly";
|
|
134
|
+
CountryISO["Liechtenstein"] = "li";
|
|
135
|
+
CountryISO["Lithuania"] = "lt";
|
|
136
|
+
CountryISO["Luxembourg"] = "lu";
|
|
137
|
+
CountryISO["Macau"] = "mo";
|
|
138
|
+
CountryISO["Macedonia"] = "mk";
|
|
139
|
+
CountryISO["Madagascar"] = "mg";
|
|
140
|
+
CountryISO["Malawi"] = "mw";
|
|
141
|
+
CountryISO["Malaysia"] = "my";
|
|
142
|
+
CountryISO["Maldives"] = "mv";
|
|
143
|
+
CountryISO["Mali"] = "ml";
|
|
144
|
+
CountryISO["Malta"] = "mt";
|
|
145
|
+
CountryISO["MarshallIslands"] = "mh";
|
|
146
|
+
CountryISO["Martinique"] = "mq";
|
|
147
|
+
CountryISO["Mauritania"] = "mr";
|
|
148
|
+
CountryISO["Mauritius"] = "mu";
|
|
149
|
+
CountryISO["Mayotte"] = "yt";
|
|
150
|
+
CountryISO["Mexico"] = "mx";
|
|
151
|
+
CountryISO["Micronesia"] = "fm";
|
|
152
|
+
CountryISO["Moldova"] = "md";
|
|
153
|
+
CountryISO["Monaco"] = "mc";
|
|
154
|
+
CountryISO["Mongolia"] = "mn";
|
|
155
|
+
CountryISO["Montenegro"] = "me";
|
|
156
|
+
CountryISO["Montserrat"] = "ms";
|
|
157
|
+
CountryISO["Morocco"] = "ma";
|
|
158
|
+
CountryISO["Mozambique"] = "mz";
|
|
159
|
+
CountryISO["Myanmar"] = "mm";
|
|
160
|
+
CountryISO["Namibia"] = "na";
|
|
161
|
+
CountryISO["Nauru"] = "nr";
|
|
162
|
+
CountryISO["Nepal"] = "np";
|
|
163
|
+
CountryISO["Netherlands"] = "nl";
|
|
164
|
+
CountryISO["NewCaledonia"] = "nc";
|
|
165
|
+
CountryISO["NewZealand"] = "nz";
|
|
166
|
+
CountryISO["Nicaragua"] = "ni";
|
|
167
|
+
CountryISO["Niger"] = "ne";
|
|
168
|
+
CountryISO["Nigeria"] = "ng";
|
|
169
|
+
CountryISO["Niue"] = "nu";
|
|
170
|
+
CountryISO["NorfolkIsland"] = "nf";
|
|
171
|
+
CountryISO["NorthKorea"] = "kp";
|
|
172
|
+
CountryISO["NorthernMarianaIslands"] = "mp";
|
|
173
|
+
CountryISO["Norway"] = "no";
|
|
174
|
+
CountryISO["Oman"] = "om";
|
|
175
|
+
CountryISO["Pakistan"] = "pk";
|
|
176
|
+
CountryISO["Palau"] = "pw";
|
|
177
|
+
CountryISO["Palestine"] = "ps";
|
|
178
|
+
CountryISO["Panama"] = "pa";
|
|
179
|
+
CountryISO["PapuaNewGuinea"] = "pg";
|
|
180
|
+
CountryISO["Paraguay"] = "py";
|
|
181
|
+
CountryISO["Peru"] = "pe";
|
|
182
|
+
CountryISO["Philippines"] = "ph";
|
|
183
|
+
CountryISO["Poland"] = "pl";
|
|
184
|
+
CountryISO["Portugal"] = "pt";
|
|
185
|
+
CountryISO["PuertoRico"] = "pr";
|
|
186
|
+
CountryISO["Qatar"] = "qa";
|
|
187
|
+
CountryISO["R\u00E9union"] = "re";
|
|
188
|
+
CountryISO["Romania"] = "ro";
|
|
189
|
+
CountryISO["Russia"] = "ru";
|
|
190
|
+
CountryISO["Rwanda"] = "rw";
|
|
191
|
+
CountryISO["SaintBarth\u00E9lemy"] = "bl";
|
|
192
|
+
CountryISO["SaintHelena"] = "sh";
|
|
193
|
+
CountryISO["SaintKittsAndNevis"] = "kn";
|
|
194
|
+
CountryISO["SaintLucia"] = "lc";
|
|
195
|
+
CountryISO["SaintMartin"] = "mf";
|
|
196
|
+
CountryISO["SaintPierreAndMiquelon"] = "pm";
|
|
197
|
+
CountryISO["SaintVincentAndTheGrenadines"] = "vc";
|
|
198
|
+
CountryISO["Samoa"] = "ws";
|
|
199
|
+
CountryISO["SanMarino"] = "sm";
|
|
200
|
+
CountryISO["S\u00E3oTom\u00E9AndPr\u00EDncipe"] = "st";
|
|
201
|
+
CountryISO["SaudiArabia"] = "sa";
|
|
202
|
+
CountryISO["Senegal"] = "sn";
|
|
203
|
+
CountryISO["Serbia"] = "rs";
|
|
204
|
+
CountryISO["Seychelles"] = "sc";
|
|
205
|
+
CountryISO["SierraLeone"] = "sl";
|
|
206
|
+
CountryISO["Singapore"] = "sg";
|
|
207
|
+
CountryISO["SintMaarten"] = "sx";
|
|
208
|
+
CountryISO["Slovakia"] = "sk";
|
|
209
|
+
CountryISO["Slovenia"] = "si";
|
|
210
|
+
CountryISO["SolomonIslands"] = "sb";
|
|
211
|
+
CountryISO["Somalia"] = "so";
|
|
212
|
+
CountryISO["SouthAfrica"] = "za";
|
|
213
|
+
CountryISO["SouthKorea"] = "kr";
|
|
214
|
+
CountryISO["SouthSudan"] = "ss";
|
|
215
|
+
CountryISO["Spain"] = "es";
|
|
216
|
+
CountryISO["SriLanka"] = "lk";
|
|
217
|
+
CountryISO["Sudan"] = "sd";
|
|
218
|
+
CountryISO["Suriname"] = "sr";
|
|
219
|
+
CountryISO["SvalbardAndJanMayen"] = "sj";
|
|
220
|
+
CountryISO["Swaziland"] = "sz";
|
|
221
|
+
CountryISO["Sweden"] = "se";
|
|
222
|
+
CountryISO["Switzerland"] = "ch";
|
|
223
|
+
CountryISO["Syria"] = "sy";
|
|
224
|
+
CountryISO["Taiwan"] = "tw";
|
|
225
|
+
CountryISO["Tajikistan"] = "tj";
|
|
226
|
+
CountryISO["Tanzania"] = "tz";
|
|
227
|
+
CountryISO["Thailand"] = "th";
|
|
228
|
+
CountryISO["TimorLeste"] = "tl";
|
|
229
|
+
CountryISO["Togo"] = "tg";
|
|
230
|
+
CountryISO["Tokelau"] = "tk";
|
|
231
|
+
CountryISO["Tonga"] = "to";
|
|
232
|
+
CountryISO["TrinidadAndTobago"] = "tt";
|
|
233
|
+
CountryISO["Tunisia"] = "tn";
|
|
234
|
+
CountryISO["Turkey"] = "tr";
|
|
235
|
+
CountryISO["Turkmenistan"] = "tm";
|
|
236
|
+
CountryISO["TurksAndCaicosIslands"] = "tc";
|
|
237
|
+
CountryISO["Tuvalu"] = "tv";
|
|
238
|
+
CountryISO["USVirginIslands"] = "vi";
|
|
239
|
+
CountryISO["Uganda"] = "ug";
|
|
240
|
+
CountryISO["Ukraine"] = "ua";
|
|
241
|
+
CountryISO["UnitedArabEmirates"] = "ae";
|
|
242
|
+
CountryISO["UnitedKingdom"] = "gb";
|
|
243
|
+
CountryISO["UnitedStates"] = "us";
|
|
244
|
+
CountryISO["Uruguay"] = "uy";
|
|
245
|
+
CountryISO["Uzbekistan"] = "uz";
|
|
246
|
+
CountryISO["Vanuatu"] = "vu";
|
|
247
|
+
CountryISO["VaticanCity"] = "va";
|
|
248
|
+
CountryISO["Venezuela"] = "ve";
|
|
249
|
+
CountryISO["Vietnam"] = "vn";
|
|
250
|
+
CountryISO["WallisAndFutuna"] = "wf";
|
|
251
|
+
CountryISO["WesternSahara"] = "eh";
|
|
252
|
+
CountryISO["Yemen"] = "ye";
|
|
253
|
+
CountryISO["Zambia"] = "zm";
|
|
254
|
+
CountryISO["Zimbabwe"] = "zw";
|
|
255
|
+
CountryISO["\u00C5landIslands"] = "ax";
|
|
256
|
+
})(CountryISO || (CountryISO = {}));
|
|
257
|
+
|
|
258
|
+
class CountryCode {
|
|
259
|
+
constructor() {
|
|
260
|
+
this.allCountries = [
|
|
261
|
+
['Afghanistan (افغانستان)', CountryISO.Afghanistan, '93'],
|
|
262
|
+
['Albania (Shqipëri)', CountryISO.Albania, '355'],
|
|
263
|
+
['Algeria (الجزائر)', CountryISO.Algeria, '213'],
|
|
264
|
+
['American Samoa', 'as', '1', 1, ['684']],
|
|
265
|
+
['Andorra', CountryISO.Andorra, '376'],
|
|
266
|
+
['Angola', CountryISO.Angola, '244'],
|
|
267
|
+
['Anguilla', 'ai', '1', 1, ['264']],
|
|
268
|
+
['Antigua and Barbuda', 'ag', '1', 1, ['268']],
|
|
269
|
+
['Argentina', CountryISO.Argentina, '54'],
|
|
270
|
+
['Armenia (Հայաստան)', CountryISO.Armenia, '374'],
|
|
271
|
+
['Aruba', CountryISO.Aruba, '297'],
|
|
272
|
+
['Australia', CountryISO.Australia, '61', 0],
|
|
273
|
+
['Austria (Österreich)', CountryISO.Austria, '43'],
|
|
274
|
+
['Azerbaijan (Azərbaycan)', CountryISO.Azerbaijan, '994'],
|
|
275
|
+
['Bahamas', 'bs', '1', 1, ['242']],
|
|
276
|
+
['Bahrain (البحرين)', CountryISO.Bahrain, '973'],
|
|
277
|
+
['Bangladesh (বাংলাদেশ)', CountryISO.Bangladesh, '880'],
|
|
278
|
+
['Barbados', 'bb', '1', 1, ['246']],
|
|
279
|
+
['Belarus (Беларусь)', CountryISO.Belarus, '375'],
|
|
280
|
+
['Belgium (België)', CountryISO.Belgium, '32'],
|
|
281
|
+
['Belize', CountryISO.Belize, '501'],
|
|
282
|
+
['Benin (Bénin)', CountryISO.Benin, '229'],
|
|
283
|
+
['Bermuda', 'bm', '1', 1, ['441']],
|
|
284
|
+
['Bhutan (འབྲུག)', CountryISO.Bhutan, '975'],
|
|
285
|
+
['Bolivia', CountryISO.Bolivia, '591'],
|
|
286
|
+
['Bosnia and Herzegovina (Босна и Херцеговина)', CountryISO.BosniaAndHerzegovina, '387'],
|
|
287
|
+
['Botswana', CountryISO.Botswana, '267'],
|
|
288
|
+
['Brazil (Brasil)', CountryISO.Brazil, '55'],
|
|
289
|
+
['British Indian Ocean Territory', CountryISO.BritishIndianOceanTerritory, '246'],
|
|
290
|
+
['British Virgin Islands', 'vg', '1', 1, ['284']],
|
|
291
|
+
['Brunei', CountryISO.Brunei, '673'],
|
|
292
|
+
['Bulgaria (България)', CountryISO.Bulgaria, '359'],
|
|
293
|
+
['Burkina Faso', CountryISO.BurkinaFaso, '226'],
|
|
294
|
+
['Burundi (Uburundi)', CountryISO.Burundi, '257'],
|
|
295
|
+
['Cambodia (កម្ពុជា)', CountryISO.Cambodia, '855'],
|
|
296
|
+
['Cameroon (Cameroun)', CountryISO.Cameroon, '237'],
|
|
297
|
+
[
|
|
298
|
+
'Canada',
|
|
299
|
+
CountryISO.Canada,
|
|
300
|
+
'1',
|
|
301
|
+
1,
|
|
302
|
+
[
|
|
303
|
+
'204',
|
|
304
|
+
'226',
|
|
305
|
+
'236',
|
|
306
|
+
'249',
|
|
307
|
+
'250',
|
|
308
|
+
'289',
|
|
309
|
+
'306',
|
|
310
|
+
'343',
|
|
311
|
+
'365',
|
|
312
|
+
'387',
|
|
313
|
+
'403',
|
|
314
|
+
'416',
|
|
315
|
+
'418',
|
|
316
|
+
'431',
|
|
317
|
+
'437',
|
|
318
|
+
'438',
|
|
319
|
+
'450',
|
|
320
|
+
'506',
|
|
321
|
+
'514',
|
|
322
|
+
'519',
|
|
323
|
+
'548',
|
|
324
|
+
'579',
|
|
325
|
+
'581',
|
|
326
|
+
'587',
|
|
327
|
+
'604',
|
|
328
|
+
'613',
|
|
329
|
+
'639',
|
|
330
|
+
'647',
|
|
331
|
+
'672',
|
|
332
|
+
'705',
|
|
333
|
+
'709',
|
|
334
|
+
'742',
|
|
335
|
+
'778',
|
|
336
|
+
'780',
|
|
337
|
+
'782',
|
|
338
|
+
'807',
|
|
339
|
+
'819',
|
|
340
|
+
'825',
|
|
341
|
+
'867',
|
|
342
|
+
'873',
|
|
343
|
+
'902',
|
|
344
|
+
'905',
|
|
345
|
+
],
|
|
346
|
+
],
|
|
347
|
+
['Cape Verde (Kabu Verdi)', CountryISO.CapeVerde, '238'],
|
|
348
|
+
['Caribbean Netherlands', CountryISO.CaribbeanNetherlands, '599', 1],
|
|
349
|
+
['Cayman Islands', 'ky', '1', 1, ['345']],
|
|
350
|
+
[
|
|
351
|
+
'Central African Republic (République centrafricaine)',
|
|
352
|
+
CountryISO.CentralAfricanRepublic,
|
|
353
|
+
'236',
|
|
354
|
+
],
|
|
355
|
+
['Chad (Tchad)', CountryISO.Chad, '235'],
|
|
356
|
+
['Chile', CountryISO.Chile, '56'],
|
|
357
|
+
['China (中国)', CountryISO.China, '86'],
|
|
358
|
+
['Christmas Island', CountryISO.ChristmasIsland, '61', 2],
|
|
359
|
+
['Cocos (Keeling) Islands', CountryISO.Cocos, '61', 1],
|
|
360
|
+
['Colombia', CountryISO.Colombia, '57'],
|
|
361
|
+
['Comoros (جزر القمر)', CountryISO.Comoros, '269'],
|
|
362
|
+
[
|
|
363
|
+
'Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)',
|
|
364
|
+
CountryISO.CongoDRCJamhuriYaKidemokrasiaYaKongo,
|
|
365
|
+
'243',
|
|
366
|
+
],
|
|
367
|
+
['Congo (Republic) (Congo-Brazzaville)', CountryISO.CongoRepublicCongoBrazzaville, '242'],
|
|
368
|
+
['Cook Islands', CountryISO.CookIslands, '682'],
|
|
369
|
+
['Costa Rica', CountryISO.CostaRica, '506'],
|
|
370
|
+
['Côte d’Ivoire', CountryISO.CôteDIvoire, '225'],
|
|
371
|
+
['Croatia (Hrvatska)', CountryISO.Croatia, '385'],
|
|
372
|
+
['Cuba', CountryISO.Cuba, '53'],
|
|
373
|
+
['Curaçao', CountryISO.Curaçao, '599', 0],
|
|
374
|
+
['Cyprus (Κύπρος)', CountryISO.Cyprus, '357'],
|
|
375
|
+
['Czech Republic (Česká republika)', CountryISO.CzechRepublic, '420'],
|
|
376
|
+
['Denmark (Danmark)', CountryISO.Denmark, '45'],
|
|
377
|
+
['Djibouti', CountryISO.Djibouti, '253'],
|
|
378
|
+
['Dominica', CountryISO.Dominica, '1767'],
|
|
379
|
+
[
|
|
380
|
+
'Dominican Republic (República Dominicana)',
|
|
381
|
+
CountryISO.DominicanRepublic,
|
|
382
|
+
'1',
|
|
383
|
+
2,
|
|
384
|
+
['809', '829', '849'],
|
|
385
|
+
],
|
|
386
|
+
['Ecuador', CountryISO.Ecuador, '593'],
|
|
387
|
+
['Egypt (مصر)', CountryISO.Egypt, '20'],
|
|
388
|
+
['El Salvador', CountryISO.ElSalvador, '503'],
|
|
389
|
+
['Equatorial Guinea (Guinea Ecuatorial)', CountryISO.EquatorialGuinea, '240'],
|
|
390
|
+
['Eritrea', CountryISO.Eritrea, '291'],
|
|
391
|
+
['Estonia (Eesti)', CountryISO.Estonia, '372'],
|
|
392
|
+
['Ethiopia', CountryISO.Ethiopia, '251'],
|
|
393
|
+
['Falkland Islands (Islas Malvinas)', CountryISO.FalklandIslands, '500'],
|
|
394
|
+
['Faroe Islands (Føroyar)', CountryISO.FaroeIslands, '298'],
|
|
395
|
+
['Fiji', CountryISO.Fiji, '679'],
|
|
396
|
+
['Finland (Suomi)', CountryISO.Finland, '358', 0],
|
|
397
|
+
['France', CountryISO.France, '33'],
|
|
398
|
+
['French Guiana (Guyane française)', CountryISO.FrenchGuiana, '594'],
|
|
399
|
+
['French Polynesia (Polynésie française)', CountryISO.FrenchPolynesia, '689'],
|
|
400
|
+
['Gabon', CountryISO.Gabon, '241'],
|
|
401
|
+
['Gambia', CountryISO.Gambia, '220'],
|
|
402
|
+
['Georgia (საქართველო)', CountryISO.Georgia, '995'],
|
|
403
|
+
['Germany (Deutschland)', CountryISO.Germany, '49'],
|
|
404
|
+
['Ghana (Gaana)', CountryISO.Ghana, '233'],
|
|
405
|
+
['Gibraltar', CountryISO.Gibraltar, '350'],
|
|
406
|
+
['Greece (Ελλάδα)', CountryISO.Greece, '30'],
|
|
407
|
+
['Greenland (Kalaallit Nunaat)', CountryISO.Greenland, '299'],
|
|
408
|
+
['Grenada', CountryISO.Grenada, '1473'],
|
|
409
|
+
['Guadeloupe', CountryISO.Guadeloupe, '590', 0],
|
|
410
|
+
['Guam', 'gu', '1', 1, ['671']],
|
|
411
|
+
['Guatemala', CountryISO.Guatemala, '502'],
|
|
412
|
+
['Guernsey', CountryISO.Guernsey, '44', 1, [1481]],
|
|
413
|
+
['Guinea (Guinée)', CountryISO.Guinea, '224'],
|
|
414
|
+
['Guinea-Bissau (Guiné Bissau)', CountryISO.GuineaBissau, '245'],
|
|
415
|
+
['Guyana', CountryISO.Guyana, '592'],
|
|
416
|
+
['Haiti', CountryISO.Haiti, '509'],
|
|
417
|
+
['Honduras', CountryISO.Honduras, '504'],
|
|
418
|
+
['Hong Kong (香港)', CountryISO.HongKong, '852'],
|
|
419
|
+
['Hungary (Magyarország)', CountryISO.Hungary, '36'],
|
|
420
|
+
['Iceland (Ísland)', CountryISO.Iceland, '354'],
|
|
421
|
+
['India (भारत)', CountryISO.India, '91'],
|
|
422
|
+
['Indonesia', CountryISO.Indonesia, '62'],
|
|
423
|
+
['Iran (ایران)', CountryISO.Iran, '98'],
|
|
424
|
+
['Iraq (العراق)', CountryISO.Iraq, '964'],
|
|
425
|
+
['Ireland', CountryISO.Ireland, '353'],
|
|
426
|
+
['Isle of Man', CountryISO.IsleOfMan, '44', 2, [1624]],
|
|
427
|
+
['Israel (ישראל)', CountryISO.Israel, '972'],
|
|
428
|
+
['Italy (Italia)', CountryISO.Italy, '39', 0],
|
|
429
|
+
['Jamaica', 'jm', '1', 1, ['876']],
|
|
430
|
+
['Japan (日本)', CountryISO.Japan, '81'],
|
|
431
|
+
['Jersey', CountryISO.Jersey, '44', 3, [1534]],
|
|
432
|
+
['Jordan (الأردن)', CountryISO.Jordan, '962'],
|
|
433
|
+
['Kazakhstan (Казахстан)', CountryISO.Kazakhstan, '7', 1],
|
|
434
|
+
['Kenya', CountryISO.Kenya, '254'],
|
|
435
|
+
['Kiribati', CountryISO.Kiribati, '686'],
|
|
436
|
+
['Kosovo', CountryISO.Kosovo, '383'],
|
|
437
|
+
['Kuwait (الكويت)', CountryISO.Kuwait, '965'],
|
|
438
|
+
['Kyrgyzstan (Кыргызстан)', CountryISO.Kyrgyzstan, '996'],
|
|
439
|
+
['Laos (ລາວ)', CountryISO.Laos, '856'],
|
|
440
|
+
['Latvia (Latvija)', CountryISO.Latvia, '371'],
|
|
441
|
+
['Lebanon (لبنان)', CountryISO.Lebanon, '961'],
|
|
442
|
+
['Lesotho', CountryISO.Lesotho, '266'],
|
|
443
|
+
['Liberia', CountryISO.Liberia, '231'],
|
|
444
|
+
['Libya (ليبيا)', CountryISO.Libya, '218'],
|
|
445
|
+
['Liechtenstein', CountryISO.Liechtenstein, '423'],
|
|
446
|
+
['Lithuania (Lietuva)', CountryISO.Lithuania, '370'],
|
|
447
|
+
['Luxembourg', CountryISO.Luxembourg, '352'],
|
|
448
|
+
['Macau (澳門)', CountryISO.Macau, '853'],
|
|
449
|
+
['Macedonia (FYROM) (Македонија)', CountryISO.Macedonia, '389'],
|
|
450
|
+
['Madagascar (Madagasikara)', CountryISO.Madagascar, '261'],
|
|
451
|
+
['Malawi', CountryISO.Malawi, '265'],
|
|
452
|
+
['Malaysia', CountryISO.Malaysia, '60'],
|
|
453
|
+
['Maldives', CountryISO.Maldives, '960'],
|
|
454
|
+
['Mali', CountryISO.Mali, '223'],
|
|
455
|
+
['Malta', CountryISO.Malta, '356'],
|
|
456
|
+
['Marshall Islands', CountryISO.MarshallIslands, '692'],
|
|
457
|
+
['Martinique', CountryISO.Martinique, '596'],
|
|
458
|
+
['Mauritania (موريتانيا)', CountryISO.Mauritania, '222'],
|
|
459
|
+
['Mauritius (Moris)', CountryISO.Mauritius, '230'],
|
|
460
|
+
['Mayotte', CountryISO.Mayotte, '262', 1],
|
|
461
|
+
['Mexico (México)', CountryISO.Mexico, '52'],
|
|
462
|
+
['Micronesia', CountryISO.Micronesia, '691'],
|
|
463
|
+
['Moldova (Republica Moldova)', CountryISO.Moldova, '373'],
|
|
464
|
+
['Monaco', CountryISO.Monaco, '377'],
|
|
465
|
+
['Mongolia (Монгол)', CountryISO.Mongolia, '976'],
|
|
466
|
+
['Montenegro (Crna Gora)', CountryISO.Montenegro, '382'],
|
|
467
|
+
['Montserrat', 'ms', '1', 1, ['664']],
|
|
468
|
+
['Morocco (المغرب)', CountryISO.Morocco, '212', 0],
|
|
469
|
+
['Mozambique (Moçambique)', CountryISO.Mozambique, '258'],
|
|
470
|
+
['Myanmar (Burma) (မြန်မာ)', CountryISO.Myanmar, '95'],
|
|
471
|
+
['Namibia (Namibië)', CountryISO.Namibia, '264'],
|
|
472
|
+
['Nauru', CountryISO.Nauru, '674'],
|
|
473
|
+
['Nepal (नेपाल)', CountryISO.Nepal, '977'],
|
|
474
|
+
['Netherlands (Nederland)', CountryISO.Netherlands, '31'],
|
|
475
|
+
['New Caledonia (Nouvelle-Calédonie)', CountryISO.NewCaledonia, '687'],
|
|
476
|
+
['New Zealand', CountryISO.NewZealand, '64'],
|
|
477
|
+
['Nicaragua', CountryISO.Nicaragua, '505'],
|
|
478
|
+
['Niger (Nijar)', CountryISO.Niger, '227'],
|
|
479
|
+
['Nigeria', CountryISO.Nigeria, '234'],
|
|
480
|
+
['Niue', CountryISO.Niue, '683'],
|
|
481
|
+
['Norfolk Island', CountryISO.NorfolkIsland, '672'],
|
|
482
|
+
['North Korea (조선 민주주의 인민 공화국)', CountryISO.NorthKorea, '850'],
|
|
483
|
+
['Northern Mariana Islands', CountryISO.NorthernMarianaIslands, '1670'],
|
|
484
|
+
['Norway (Norge)', CountryISO.Norway, '47', 0],
|
|
485
|
+
['Oman (عُمان)', CountryISO.Oman, '968'],
|
|
486
|
+
['Pakistan (پاکستان)', CountryISO.Pakistan, '92'],
|
|
487
|
+
['Palau', CountryISO.Palau, '680'],
|
|
488
|
+
['Palestine (فلسطين)', CountryISO.Palestine, '970'],
|
|
489
|
+
['Panama (Panamá)', CountryISO.Panama, '507'],
|
|
490
|
+
['Papua New Guinea', CountryISO.PapuaNewGuinea, '675'],
|
|
491
|
+
['Paraguay', CountryISO.Paraguay, '595'],
|
|
492
|
+
['Peru (Perú)', CountryISO.Peru, '51'],
|
|
493
|
+
['Philippines', CountryISO.Philippines, '63'],
|
|
494
|
+
['Poland (Polska)', CountryISO.Poland, '48'],
|
|
495
|
+
['Portugal', CountryISO.Portugal, '351'],
|
|
496
|
+
['Puerto Rico', CountryISO.PuertoRico, '1', 3, ['787', '939']],
|
|
497
|
+
['Qatar (قطر)', CountryISO.Qatar, '974'],
|
|
498
|
+
['Réunion (La Réunion)', CountryISO.Réunion, '262', 0],
|
|
499
|
+
['Romania (România)', CountryISO.Romania, '40'],
|
|
500
|
+
['Russia (Россия)', CountryISO.Russia, '7', 0],
|
|
501
|
+
['Rwanda', CountryISO.Rwanda, '250'],
|
|
502
|
+
['Saint Barthélemy (Saint-Barthélemy)', CountryISO.SaintBarthélemy, '590', 1],
|
|
503
|
+
['Saint Helena', CountryISO.SaintHelena, '290'],
|
|
504
|
+
['Saint Kitts and Nevis', CountryISO.SaintKittsAndNevis, '1869'],
|
|
505
|
+
['Saint Lucia', 'lc', '1', 1, ['758']],
|
|
506
|
+
['Saint Martin (Saint-Martin (partie française))', CountryISO.SaintMartin, '590', 2],
|
|
507
|
+
[
|
|
508
|
+
'Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)',
|
|
509
|
+
CountryISO.SaintPierreAndMiquelon,
|
|
510
|
+
'508',
|
|
511
|
+
],
|
|
512
|
+
['Saint Vincent and the Grenadines', 'vc', '1', 1, ['784']],
|
|
513
|
+
['Samoa', CountryISO.Samoa, '685'],
|
|
514
|
+
['San Marino', CountryISO.SanMarino, '378'],
|
|
515
|
+
['São Tomé and Príncipe (São Tomé e Príncipe)', CountryISO.SãoToméAndPríncipe, '239'],
|
|
516
|
+
['Saudi Arabia (المملكة العربية السعودية)', CountryISO.SaudiArabia, '966'],
|
|
517
|
+
['Senegal (Sénégal)', CountryISO.Senegal, '221'],
|
|
518
|
+
['Serbia (Србија)', CountryISO.Serbia, '381'],
|
|
519
|
+
['Seychelles', CountryISO.Seychelles, '248'],
|
|
520
|
+
['Sierra Leone', CountryISO.SierraLeone, '232'],
|
|
521
|
+
['Singapore', CountryISO.Singapore, '65'],
|
|
522
|
+
['Sint Maarten', 'sx', '1', 1, ['721']],
|
|
523
|
+
['Slovakia (Slovensko)', CountryISO.Slovakia, '421'],
|
|
524
|
+
['Slovenia (Slovenija)', CountryISO.Slovenia, '386'],
|
|
525
|
+
['Solomon Islands', CountryISO.SolomonIslands, '677'],
|
|
526
|
+
['Somalia (Soomaaliya)', CountryISO.Somalia, '252'],
|
|
527
|
+
['South Africa', CountryISO.SouthAfrica, '27'],
|
|
528
|
+
['South Korea (대한민국)', CountryISO.SouthKorea, '82'],
|
|
529
|
+
['South Sudan (جنوب السودان)', CountryISO.SouthSudan, '211'],
|
|
530
|
+
['Spain (España)', CountryISO.Spain, '34'],
|
|
531
|
+
['Sri Lanka (ශ්රී ලංකාව)', CountryISO.SriLanka, '94'],
|
|
532
|
+
['Sudan (السودان)', CountryISO.Sudan, '249'],
|
|
533
|
+
['Suriname', CountryISO.Suriname, '597'],
|
|
534
|
+
['Svalbard and Jan Mayen', CountryISO.SvalbardAndJanMayen, '47', 1],
|
|
535
|
+
['Swaziland', CountryISO.Swaziland, '268'],
|
|
536
|
+
['Sweden (Sverige)', CountryISO.Sweden, '46'],
|
|
537
|
+
['Switzerland (Schweiz)', CountryISO.Switzerland, '41'],
|
|
538
|
+
['Syria (سوريا)', CountryISO.Syria, '963'],
|
|
539
|
+
['Taiwan (台灣)', CountryISO.Taiwan, '886'],
|
|
540
|
+
['Tajikistan', CountryISO.Tajikistan, '992'],
|
|
541
|
+
['Tanzania', CountryISO.Tanzania, '255'],
|
|
542
|
+
['Thailand (ไทย)', CountryISO.Thailand, '66'],
|
|
543
|
+
['Timor-Leste', CountryISO.TimorLeste, '670'],
|
|
544
|
+
['Togo', CountryISO.Togo, '228'],
|
|
545
|
+
['Tokelau', CountryISO.Tokelau, '690'],
|
|
546
|
+
['Tonga', CountryISO.Tonga, '676'],
|
|
547
|
+
['Trinidad and Tobago', 'tt', '1', 1, ['868']],
|
|
548
|
+
['Tunisia (تونس)', CountryISO.Tunisia, '216'],
|
|
549
|
+
['Turkey (Türkiye)', CountryISO.Turkey, '90'],
|
|
550
|
+
['Turkmenistan', CountryISO.Turkmenistan, '993'],
|
|
551
|
+
['Turks and Caicos Islands', CountryISO.TurksAndCaicosIslands, '1649'],
|
|
552
|
+
['Tuvalu', CountryISO.Tuvalu, '688'],
|
|
553
|
+
['U.S. Virgin Islands', 'vi', '1', 1, ['340']],
|
|
554
|
+
['Uganda', CountryISO.Uganda, '256'],
|
|
555
|
+
['Ukraine (Україна)', CountryISO.Ukraine, '380'],
|
|
556
|
+
['United Arab Emirates (الإمارات العربية المتحدة)', CountryISO.UnitedArabEmirates, '971'],
|
|
557
|
+
['United Kingdom', CountryISO.UnitedKingdom, '44', 0],
|
|
558
|
+
['United States', CountryISO.UnitedStates, '1', 0],
|
|
559
|
+
['Uruguay', CountryISO.Uruguay, '598'],
|
|
560
|
+
['Uzbekistan (Oʻzbekiston)', CountryISO.Uzbekistan, '998'],
|
|
561
|
+
['Vanuatu', CountryISO.Vanuatu, '678'],
|
|
562
|
+
['Vatican City (Città del Vaticano)', CountryISO.VaticanCity, '39', 1],
|
|
563
|
+
['Venezuela', CountryISO.Venezuela, '58'],
|
|
564
|
+
['Vietnam (Việt Nam)', CountryISO.Vietnam, '84'],
|
|
565
|
+
['Wallis and Futuna', CountryISO.WallisAndFutuna, '681'],
|
|
566
|
+
['Western Sahara (الصحراء الغربية)', CountryISO.WesternSahara, '212', 1],
|
|
567
|
+
['Yemen (اليمن)', CountryISO.Yemen, '967'],
|
|
568
|
+
['Zambia', CountryISO.Zambia, '260'],
|
|
569
|
+
['Zimbabwe', CountryISO.Zimbabwe, '263'],
|
|
570
|
+
['Åland Islands', CountryISO.ÅlandIslands, '358', 1],
|
|
571
|
+
];
|
|
572
|
+
}
|
|
573
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CountryCode, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
574
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CountryCode }); }
|
|
575
|
+
}
|
|
576
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CountryCode, decorators: [{
|
|
577
|
+
type: Injectable
|
|
578
|
+
}] });
|
|
579
|
+
|
|
580
|
+
var SearchCountryField;
|
|
581
|
+
(function (SearchCountryField) {
|
|
582
|
+
SearchCountryField["DialCode"] = "dialCode";
|
|
583
|
+
SearchCountryField["Iso2"] = "iso2";
|
|
584
|
+
SearchCountryField["Name"] = "name";
|
|
585
|
+
SearchCountryField["All"] = "all";
|
|
586
|
+
})(SearchCountryField || (SearchCountryField = {}));
|
|
587
|
+
|
|
588
|
+
/*
|
|
589
|
+
We use "control: any" instead of "control: FormControl" to silence:
|
|
590
|
+
"Property 'nativeElement' does not exist on type 'FormControl'".
|
|
591
|
+
This happens because I've expanded control with nativeElement via
|
|
592
|
+
'NativeElementInjectorDirective' to get an access to the element.
|
|
593
|
+
More about this approach and reasons for this:
|
|
594
|
+
https://github.com/angular/angular/issues/18025
|
|
595
|
+
https://stackoverflow.com/a/54075119/1617590
|
|
596
|
+
*/
|
|
597
|
+
const phoneNumberValidator = (control) => {
|
|
598
|
+
if (!control.value) {
|
|
599
|
+
return;
|
|
600
|
+
}
|
|
601
|
+
// Find <input> inside injected nativeElement and get its "id".
|
|
602
|
+
const el = control.nativeElement;
|
|
603
|
+
const inputBox = el ? el.querySelector('input[type="tel"]') : undefined;
|
|
604
|
+
if (inputBox) {
|
|
605
|
+
const id = inputBox.id;
|
|
606
|
+
const isCheckValidation = inputBox.getAttribute('validation');
|
|
607
|
+
if (isCheckValidation === 'true') {
|
|
608
|
+
const isRequired = control.errors && control.errors.required === true;
|
|
609
|
+
const error = { validatePhoneNumber: { valid: false } };
|
|
610
|
+
inputBox.setCustomValidity('Invalid field.');
|
|
611
|
+
let number;
|
|
612
|
+
try {
|
|
613
|
+
number = lpn.PhoneNumberUtil.getInstance().parse(control.value.number, control.value.countryCode);
|
|
614
|
+
}
|
|
615
|
+
catch (e) {
|
|
616
|
+
if (isRequired) {
|
|
617
|
+
return error;
|
|
618
|
+
}
|
|
619
|
+
else {
|
|
620
|
+
inputBox.setCustomValidity('');
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
if (control.value) {
|
|
624
|
+
// @ts-ignore
|
|
625
|
+
if (!number) {
|
|
626
|
+
return error;
|
|
627
|
+
}
|
|
628
|
+
else {
|
|
629
|
+
if (!lpn.PhoneNumberUtil.getInstance().isValidNumberForRegion(number, control.value.countryCode)) {
|
|
630
|
+
return error;
|
|
631
|
+
}
|
|
632
|
+
else {
|
|
633
|
+
inputBox.setCustomValidity('');
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
else if (isCheckValidation === 'false') {
|
|
639
|
+
inputBox.setCustomValidity('');
|
|
640
|
+
control.clearValidators();
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
return;
|
|
644
|
+
};
|
|
645
|
+
|
|
646
|
+
var PhoneNumberFormat;
|
|
647
|
+
(function (PhoneNumberFormat) {
|
|
648
|
+
PhoneNumberFormat["International"] = "INTERNATIONAL";
|
|
649
|
+
PhoneNumberFormat["National"] = "NATIONAL";
|
|
650
|
+
})(PhoneNumberFormat || (PhoneNumberFormat = {}));
|
|
651
|
+
|
|
652
|
+
/*
|
|
653
|
+
"Property 'nativeElement' does not exist on type 'FormControl'".
|
|
654
|
+
'NativeElementInjectorDirective' injects nativeElement to each control,
|
|
655
|
+
so we can access it from inside validator for example.
|
|
656
|
+
More about this approach and reasons for this:
|
|
657
|
+
https://github.com/angular/angular/issues/18025
|
|
658
|
+
https://stackoverflow.com/a/54075119/1617590
|
|
659
|
+
*/
|
|
660
|
+
class NativeElementInjectorDirective {
|
|
661
|
+
constructor(controlDir, host) {
|
|
662
|
+
this.controlDir = controlDir;
|
|
663
|
+
this.host = host;
|
|
664
|
+
}
|
|
665
|
+
ngOnInit() {
|
|
666
|
+
if (this.controlDir.control) {
|
|
667
|
+
// @ts-ignore
|
|
668
|
+
this.controlDir.control['nativeElement'] = this.host.nativeElement;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NativeElementInjectorDirective, deps: [{ token: i3.NgControl }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
672
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: NativeElementInjectorDirective, selector: "[ngModel], [formControl], [formControlName]", ngImport: i0 }); }
|
|
673
|
+
}
|
|
674
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NativeElementInjectorDirective, decorators: [{
|
|
675
|
+
type: Directive,
|
|
676
|
+
args: [{
|
|
677
|
+
// tslint:disable-next-line: directive-selector
|
|
678
|
+
selector: '[ngModel], [formControl], [formControlName]',
|
|
679
|
+
}]
|
|
680
|
+
}], ctorParameters: function () { return [{ type: i3.NgControl }, { type: i0.ElementRef }]; } });
|
|
681
|
+
|
|
682
|
+
class NgxIntlTelInputComponent {
|
|
683
|
+
constructor(countryCodeData) {
|
|
684
|
+
this.countryCodeData = countryCodeData;
|
|
685
|
+
this.value = '';
|
|
686
|
+
this.preferredCountries = [];
|
|
687
|
+
this.enablePlaceholder = true;
|
|
688
|
+
this.numberFormat = PhoneNumberFormat.International;
|
|
689
|
+
this.cssClass = 'form-control';
|
|
690
|
+
this.onlyCountries = [];
|
|
691
|
+
this.enableAutoCountrySelect = true;
|
|
692
|
+
this.searchCountryFlag = false;
|
|
693
|
+
this.searchCountryField = [SearchCountryField.All];
|
|
694
|
+
this.searchCountryPlaceholder = 'Search Country';
|
|
695
|
+
this.selectFirstCountry = true;
|
|
696
|
+
this.phoneValidation = true;
|
|
697
|
+
this.inputId = 'phone';
|
|
698
|
+
this.separateDialCode = false;
|
|
699
|
+
this.excludeCountries = [];
|
|
700
|
+
this.countryChange = new EventEmitter();
|
|
701
|
+
this.selectedCountry = {
|
|
702
|
+
areaCodes: undefined,
|
|
703
|
+
dialCode: '',
|
|
704
|
+
htmlId: '',
|
|
705
|
+
flagClass: '',
|
|
706
|
+
iso2: '',
|
|
707
|
+
name: '',
|
|
708
|
+
placeHolder: '',
|
|
709
|
+
priority: 0,
|
|
710
|
+
};
|
|
711
|
+
this.phoneNumber = '';
|
|
712
|
+
this.allCountries = [];
|
|
713
|
+
this.preferredCountriesInDropDown = [];
|
|
714
|
+
// Has to be 'any' to prevent a need to install @types/google-libphonenumber by the package user...
|
|
715
|
+
this.phoneUtil = lpn.PhoneNumberUtil.getInstance();
|
|
716
|
+
this.disabled = false;
|
|
717
|
+
this.errors = ['Phone number is required.'];
|
|
718
|
+
this.countrySearchText = '';
|
|
719
|
+
this.onTouched = () => { };
|
|
720
|
+
this.propagateChange = (_) => { };
|
|
721
|
+
// If this is not set, ngx-bootstrap will try to use the bs3 CSS (which is not what we've embedded) and will
|
|
722
|
+
// Add the wrong classes and such
|
|
723
|
+
// setTheme('bs4');
|
|
724
|
+
}
|
|
725
|
+
ngOnInit() {
|
|
726
|
+
this.init();
|
|
727
|
+
}
|
|
728
|
+
ngOnChanges(changes) {
|
|
729
|
+
const selectedISO = changes['selectedCountryISO'];
|
|
730
|
+
if (this.allCountries &&
|
|
731
|
+
selectedISO &&
|
|
732
|
+
selectedISO.currentValue !== selectedISO.previousValue) {
|
|
733
|
+
this.updateSelectedCountry();
|
|
734
|
+
}
|
|
735
|
+
if (changes['preferredCountries']) {
|
|
736
|
+
this.updatePreferredCountries();
|
|
737
|
+
}
|
|
738
|
+
this.checkSeparateDialCodeStyle();
|
|
739
|
+
}
|
|
740
|
+
/*
|
|
741
|
+
This is a wrapper method to avoid calling this.ngOnInit() in writeValue().
|
|
742
|
+
Ref: http://codelyzer.com/rules/no-life-cycle-call/
|
|
743
|
+
*/
|
|
744
|
+
init() {
|
|
745
|
+
this.fetchCountryData();
|
|
746
|
+
if (this.excludeCountries.length) {
|
|
747
|
+
this.allCountries = this.allCountries.filter((c) => !this.excludeCountries.includes(c.iso2));
|
|
748
|
+
}
|
|
749
|
+
if (this.preferredCountries.length) {
|
|
750
|
+
this.updatePreferredCountries();
|
|
751
|
+
}
|
|
752
|
+
if (this.onlyCountries.length) {
|
|
753
|
+
this.allCountries = this.allCountries.filter((c) => this.onlyCountries.includes(c.iso2));
|
|
754
|
+
}
|
|
755
|
+
if (this.selectFirstCountry) {
|
|
756
|
+
if (this.preferredCountriesInDropDown.length) {
|
|
757
|
+
this.setSelectedCountry(this.preferredCountriesInDropDown[0]);
|
|
758
|
+
}
|
|
759
|
+
else {
|
|
760
|
+
this.setSelectedCountry(this.allCountries[0]);
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
this.updateSelectedCountry();
|
|
764
|
+
this.checkSeparateDialCodeStyle();
|
|
765
|
+
}
|
|
766
|
+
setSelectedCountry(country) {
|
|
767
|
+
this.selectedCountry = country;
|
|
768
|
+
this.countryChange.emit(country);
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
* Search country based on country name, iso2, dialCode or all of them.
|
|
772
|
+
*/
|
|
773
|
+
searchCountry() {
|
|
774
|
+
if (!this.countrySearchText) {
|
|
775
|
+
this.countryList.nativeElement.querySelector('.iti__country-list li').scrollIntoView({
|
|
776
|
+
behavior: 'smooth',
|
|
777
|
+
block: 'nearest',
|
|
778
|
+
inline: 'nearest',
|
|
779
|
+
});
|
|
780
|
+
return;
|
|
781
|
+
}
|
|
782
|
+
const countrySearchTextLower = this.countrySearchText.toLowerCase();
|
|
783
|
+
// @ts-ignore
|
|
784
|
+
const country = this.allCountries.filter(c => {
|
|
785
|
+
if (this.searchCountryField.indexOf(SearchCountryField.All) > -1) {
|
|
786
|
+
// Search in all fields
|
|
787
|
+
if (c.iso2.toLowerCase().startsWith(countrySearchTextLower)) {
|
|
788
|
+
return c;
|
|
789
|
+
}
|
|
790
|
+
if (c.name.toLowerCase().startsWith(countrySearchTextLower)) {
|
|
791
|
+
return c;
|
|
792
|
+
}
|
|
793
|
+
if (c.dialCode.startsWith(this.countrySearchText)) {
|
|
794
|
+
return c;
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
else {
|
|
798
|
+
// Or search by specific SearchCountryField(s)
|
|
799
|
+
if (this.searchCountryField.indexOf(SearchCountryField.Iso2) > -1) {
|
|
800
|
+
if (c.iso2.toLowerCase().startsWith(countrySearchTextLower)) {
|
|
801
|
+
return c;
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
if (this.searchCountryField.indexOf(SearchCountryField.Name) > -1) {
|
|
805
|
+
if (c.name.toLowerCase().startsWith(countrySearchTextLower)) {
|
|
806
|
+
return c;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
if (this.searchCountryField.indexOf(SearchCountryField.DialCode) > -1) {
|
|
810
|
+
if (c.dialCode.startsWith(this.countrySearchText)) {
|
|
811
|
+
return c;
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
});
|
|
816
|
+
if (country.length > 0) {
|
|
817
|
+
const el = this.countryList.nativeElement.querySelector('#' + country[0].htmlId);
|
|
818
|
+
if (el) {
|
|
819
|
+
el.scrollIntoView({
|
|
820
|
+
behavior: 'smooth',
|
|
821
|
+
block: 'nearest',
|
|
822
|
+
inline: 'nearest',
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
this.checkSeparateDialCodeStyle();
|
|
827
|
+
}
|
|
828
|
+
onPhoneNumberChange() {
|
|
829
|
+
let countryCode;
|
|
830
|
+
// Handle the case where the user sets the value programatically based on a persisted ChangeData obj.
|
|
831
|
+
if (this.phoneNumber && typeof this.phoneNumber === 'object') {
|
|
832
|
+
const numberObj = this.phoneNumber;
|
|
833
|
+
this.phoneNumber = numberObj.number;
|
|
834
|
+
countryCode = numberObj.countryCode;
|
|
835
|
+
}
|
|
836
|
+
this.value = this.phoneNumber;
|
|
837
|
+
countryCode = countryCode || this.selectedCountry.iso2;
|
|
838
|
+
// @ts-ignore
|
|
839
|
+
const number = this.getParsedNumber(this.phoneNumber, countryCode);
|
|
840
|
+
// auto select country based on the extension (and areaCode if needed) (e.g select Canada if number starts with +1 416)
|
|
841
|
+
if (this.enableAutoCountrySelect) {
|
|
842
|
+
countryCode =
|
|
843
|
+
number && number.getCountryCode()
|
|
844
|
+
? // @ts-ignore
|
|
845
|
+
this.getCountryIsoCode(number.getCountryCode(), number)
|
|
846
|
+
: this.selectedCountry.iso2;
|
|
847
|
+
if (countryCode && countryCode !== this.selectedCountry.iso2) {
|
|
848
|
+
const newCountry = this.allCountries
|
|
849
|
+
.slice()
|
|
850
|
+
.sort((a, b) => {
|
|
851
|
+
return a.priority - b.priority;
|
|
852
|
+
})
|
|
853
|
+
.find(c => c.iso2 === countryCode);
|
|
854
|
+
if (newCountry) {
|
|
855
|
+
this.selectedCountry = newCountry;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
countryCode = countryCode ? countryCode : this.selectedCountry.iso2;
|
|
860
|
+
this.checkSeparateDialCodeStyle();
|
|
861
|
+
if (!this.value) {
|
|
862
|
+
// Reason: avoid https://stackoverflow.com/a/54358133/1617590
|
|
863
|
+
// tslint:disable-next-line: no-null-keyword
|
|
864
|
+
// @ts-ignore
|
|
865
|
+
this.propagateChange(null);
|
|
866
|
+
}
|
|
867
|
+
else {
|
|
868
|
+
const intlNo = number
|
|
869
|
+
? this.phoneUtil.format(number, lpn.PhoneNumberFormat.INTERNATIONAL)
|
|
870
|
+
: '';
|
|
871
|
+
// parse phoneNumber if separate dial code is needed
|
|
872
|
+
if (this.separateDialCode && intlNo) {
|
|
873
|
+
this.value = this.removeDialCode(intlNo);
|
|
874
|
+
}
|
|
875
|
+
this.propagateChange({
|
|
876
|
+
number: this.value,
|
|
877
|
+
internationalNumber: intlNo,
|
|
878
|
+
nationalNumber: number ? this.phoneUtil.format(number, lpn.PhoneNumberFormat.NATIONAL) : '',
|
|
879
|
+
e164Number: number ? this.phoneUtil.format(number, lpn.PhoneNumberFormat.E164) : '',
|
|
880
|
+
countryCode: countryCode.toUpperCase(),
|
|
881
|
+
dialCode: '+' + this.selectedCountry.dialCode,
|
|
882
|
+
});
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
onCountrySelect(country, el) {
|
|
886
|
+
this.setSelectedCountry(country);
|
|
887
|
+
this.checkSeparateDialCodeStyle();
|
|
888
|
+
if (this.phoneNumber && this.phoneNumber.length > 0) {
|
|
889
|
+
this.value = this.phoneNumber;
|
|
890
|
+
const number = this.getParsedNumber(this.phoneNumber, this.selectedCountry.iso2);
|
|
891
|
+
const intlNo = number
|
|
892
|
+
? this.phoneUtil.format(number, lpn.PhoneNumberFormat.INTERNATIONAL)
|
|
893
|
+
: '';
|
|
894
|
+
// parse phoneNumber if separate dial code is needed
|
|
895
|
+
if (this.separateDialCode && intlNo) {
|
|
896
|
+
this.value = this.removeDialCode(intlNo);
|
|
897
|
+
}
|
|
898
|
+
this.propagateChange({
|
|
899
|
+
number: this.value,
|
|
900
|
+
internationalNumber: intlNo,
|
|
901
|
+
nationalNumber: number ? this.phoneUtil.format(number, lpn.PhoneNumberFormat.NATIONAL) : '',
|
|
902
|
+
e164Number: number ? this.phoneUtil.format(number, lpn.PhoneNumberFormat.E164) : '',
|
|
903
|
+
countryCode: this.selectedCountry.iso2.toUpperCase(),
|
|
904
|
+
dialCode: '+' + this.selectedCountry.dialCode,
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
else {
|
|
908
|
+
// Reason: avoid https://stackoverflow.com/a/54358133/1617590
|
|
909
|
+
// tslint:disable-next-line: no-null-keyword
|
|
910
|
+
// @ts-ignore
|
|
911
|
+
this.propagateChange(null);
|
|
912
|
+
}
|
|
913
|
+
el.focus();
|
|
914
|
+
}
|
|
915
|
+
onInputKeyPress(event) {
|
|
916
|
+
const allowedChars = /[0-9\+\-\(\)\ ]/;
|
|
917
|
+
const allowedCtrlChars = /[axcv]/; // Allows copy-pasting
|
|
918
|
+
const allowedOtherKeys = [
|
|
919
|
+
'ArrowLeft',
|
|
920
|
+
'ArrowUp',
|
|
921
|
+
'ArrowRight',
|
|
922
|
+
'ArrowDown',
|
|
923
|
+
'Home',
|
|
924
|
+
'End',
|
|
925
|
+
'Insert',
|
|
926
|
+
'Delete',
|
|
927
|
+
'Backspace',
|
|
928
|
+
];
|
|
929
|
+
if (!allowedChars.test(event.key) &&
|
|
930
|
+
!(event.ctrlKey && allowedCtrlChars.test(event.key)) &&
|
|
931
|
+
!allowedOtherKeys.includes(event.key)) {
|
|
932
|
+
event.preventDefault();
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
registerOnChange(fn) {
|
|
936
|
+
this.propagateChange = fn;
|
|
937
|
+
}
|
|
938
|
+
registerOnTouched(fn) {
|
|
939
|
+
this.onTouched = fn;
|
|
940
|
+
}
|
|
941
|
+
setDisabledState(isDisabled) {
|
|
942
|
+
this.disabled = isDisabled;
|
|
943
|
+
}
|
|
944
|
+
writeValue(obj) {
|
|
945
|
+
if (obj === undefined) {
|
|
946
|
+
this.init();
|
|
947
|
+
}
|
|
948
|
+
this.phoneNumber = obj;
|
|
949
|
+
setTimeout(() => {
|
|
950
|
+
this.onPhoneNumberChange();
|
|
951
|
+
}, 1);
|
|
952
|
+
}
|
|
953
|
+
resolvePlaceholder() {
|
|
954
|
+
let placeholder = '';
|
|
955
|
+
if (this.customPlaceholder) {
|
|
956
|
+
placeholder = this.customPlaceholder;
|
|
957
|
+
}
|
|
958
|
+
else if (this.selectedCountry.placeHolder) {
|
|
959
|
+
placeholder = this.selectedCountry.placeHolder;
|
|
960
|
+
if (this.separateDialCode) {
|
|
961
|
+
placeholder = this.removeDialCode(placeholder);
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
return placeholder;
|
|
965
|
+
}
|
|
966
|
+
/* --------------------------------- Helpers -------------------------------- */
|
|
967
|
+
/**
|
|
968
|
+
* Returns parse PhoneNumber object.
|
|
969
|
+
* @param phoneNumber string
|
|
970
|
+
* @param countryCode string
|
|
971
|
+
*/
|
|
972
|
+
getParsedNumber(phoneNumber, countryCode) {
|
|
973
|
+
let number;
|
|
974
|
+
try {
|
|
975
|
+
number = this.phoneUtil.parse(phoneNumber, countryCode.toUpperCase());
|
|
976
|
+
}
|
|
977
|
+
catch (e) { }
|
|
978
|
+
// @ts-ignore
|
|
979
|
+
return number;
|
|
980
|
+
}
|
|
981
|
+
/**
|
|
982
|
+
* Adjusts input alignment based on the dial code presentation style.
|
|
983
|
+
*/
|
|
984
|
+
checkSeparateDialCodeStyle() {
|
|
985
|
+
if (this.separateDialCode && this.selectedCountry) {
|
|
986
|
+
const cntryCd = this.selectedCountry.dialCode;
|
|
987
|
+
this.separateDialCodeClass = 'separate-dial-code iti-sdc-' + (cntryCd.length + 1);
|
|
988
|
+
}
|
|
989
|
+
else {
|
|
990
|
+
this.separateDialCodeClass = '';
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
/**
|
|
994
|
+
* Cleans dialcode from phone number string.
|
|
995
|
+
* @param phoneNumber string
|
|
996
|
+
*/
|
|
997
|
+
removeDialCode(phoneNumber) {
|
|
998
|
+
const number = this.getParsedNumber(phoneNumber, this.selectedCountry.iso2);
|
|
999
|
+
phoneNumber = this.phoneUtil.format(number, lpn.PhoneNumberFormat[this.numberFormat]);
|
|
1000
|
+
if (this.selectedCountry.iso2 === 'ua') {
|
|
1001
|
+
phoneNumber = '+380 31 123 4567';
|
|
1002
|
+
}
|
|
1003
|
+
if (phoneNumber.startsWith('+') && this.separateDialCode) {
|
|
1004
|
+
phoneNumber = phoneNumber.substr(phoneNumber.indexOf(' ') + 1);
|
|
1005
|
+
}
|
|
1006
|
+
return phoneNumber;
|
|
1007
|
+
}
|
|
1008
|
+
/**
|
|
1009
|
+
* Sifts through all countries and returns iso code of the primary country
|
|
1010
|
+
* based on the number provided.
|
|
1011
|
+
* @param countryCode country code in number format
|
|
1012
|
+
* @param number PhoneNumber object
|
|
1013
|
+
*/
|
|
1014
|
+
getCountryIsoCode(countryCode, number) {
|
|
1015
|
+
// Will use this to match area code from the first numbers
|
|
1016
|
+
// @ts-ignore
|
|
1017
|
+
const rawNumber = number['values_']['2'].toString();
|
|
1018
|
+
// List of all countries with countryCode (can be more than one. e.x. US, CA, DO, PR all have +1 countryCode)
|
|
1019
|
+
const countries = this.allCountries.filter(c => c.dialCode === countryCode.toString());
|
|
1020
|
+
// Main country is the country, which has no areaCodes specified in country-code.ts file.
|
|
1021
|
+
const mainCountry = countries.find(c => c.areaCodes === undefined);
|
|
1022
|
+
// Secondary countries are all countries, which have areaCodes specified in country-code.ts file.
|
|
1023
|
+
const secondaryCountries = countries.filter(c => c.areaCodes !== undefined);
|
|
1024
|
+
let matchedCountry = mainCountry ? mainCountry.iso2 : undefined;
|
|
1025
|
+
/*
|
|
1026
|
+
Iterate over each secondary country and check if nationalNumber starts with any of areaCodes available.
|
|
1027
|
+
If no matches found, fallback to the main country.
|
|
1028
|
+
*/
|
|
1029
|
+
secondaryCountries.forEach(country => {
|
|
1030
|
+
// @ts-ignore
|
|
1031
|
+
country.areaCodes.forEach(areaCode => {
|
|
1032
|
+
if (rawNumber.startsWith(areaCode)) {
|
|
1033
|
+
matchedCountry = country.iso2;
|
|
1034
|
+
}
|
|
1035
|
+
});
|
|
1036
|
+
});
|
|
1037
|
+
return matchedCountry;
|
|
1038
|
+
}
|
|
1039
|
+
/**
|
|
1040
|
+
* Gets formatted example phone number from phoneUtil.
|
|
1041
|
+
* @param countryCode string
|
|
1042
|
+
*/
|
|
1043
|
+
getPhoneNumberPlaceHolder(countryCode) {
|
|
1044
|
+
try {
|
|
1045
|
+
return this.phoneUtil.format(this.phoneUtil.getExampleNumber(countryCode), lpn.PhoneNumberFormat[this.numberFormat]);
|
|
1046
|
+
}
|
|
1047
|
+
catch (e) {
|
|
1048
|
+
// @ts-ignore
|
|
1049
|
+
return e;
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
/**
|
|
1053
|
+
* Clearing the list to avoid duplicates (https://github.com/webcat12345/ngx-intl-tel-input/issues/248)
|
|
1054
|
+
*/
|
|
1055
|
+
fetchCountryData() {
|
|
1056
|
+
this.allCountries = [];
|
|
1057
|
+
this.countryCodeData.allCountries.forEach((c) => {
|
|
1058
|
+
const country = {
|
|
1059
|
+
name: c[0].toString(),
|
|
1060
|
+
iso2: c[1],
|
|
1061
|
+
dialCode: c[2].toString(),
|
|
1062
|
+
priority: +c[3] || 0,
|
|
1063
|
+
areaCodes: c[4] || undefined,
|
|
1064
|
+
htmlId: `iti-0__item-${c[1].toString()}`,
|
|
1065
|
+
flagClass: `iti__${c[1].toString().toLocaleLowerCase()}`,
|
|
1066
|
+
placeHolder: '',
|
|
1067
|
+
};
|
|
1068
|
+
if (this.enablePlaceholder) {
|
|
1069
|
+
country.placeHolder = this.getPhoneNumberPlaceHolder(country.iso2.toUpperCase());
|
|
1070
|
+
if (country.iso2 === 'ua') {
|
|
1071
|
+
country.placeHolder = '+380 31 123 4567';
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
this.allCountries.push(country);
|
|
1075
|
+
});
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* Populates preferredCountriesInDropDown with prefferred countries.
|
|
1079
|
+
*/
|
|
1080
|
+
updatePreferredCountries() {
|
|
1081
|
+
if (this.preferredCountries.length) {
|
|
1082
|
+
this.preferredCountriesInDropDown = this.allCountries.filter((c) => {
|
|
1083
|
+
return this.preferredCountries.includes(c.iso2) && !this.excludeCountries.includes(c.iso2);
|
|
1084
|
+
});
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
/**
|
|
1088
|
+
* Updates selectedCountry.
|
|
1089
|
+
*/
|
|
1090
|
+
updateSelectedCountry() {
|
|
1091
|
+
if (this.selectedCountryISO && !this.excludeCountries.includes(this.selectedCountryISO)) {
|
|
1092
|
+
// @ts-ignore
|
|
1093
|
+
this.selectedCountry = this.allCountries.find((c) => {
|
|
1094
|
+
return c.iso2.toLowerCase() === this.selectedCountryISO.toLowerCase();
|
|
1095
|
+
});
|
|
1096
|
+
if (this.selectedCountry) {
|
|
1097
|
+
if (this.phoneNumber) {
|
|
1098
|
+
this.onPhoneNumberChange();
|
|
1099
|
+
}
|
|
1100
|
+
else {
|
|
1101
|
+
// Reason: avoid https://stackoverflow.com/a/54358133/1617590
|
|
1102
|
+
// tslint:disable-next-line: no-null-keyword
|
|
1103
|
+
// @ts-ignore
|
|
1104
|
+
this.propagateChange(null);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgxIntlTelInputComponent, deps: [{ token: CountryCode }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1110
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NgxIntlTelInputComponent, selector: "ngx-intl-tel-input", inputs: { value: "value", preferredCountries: "preferredCountries", enablePlaceholder: "enablePlaceholder", customPlaceholder: "customPlaceholder", numberFormat: "numberFormat", cssClass: "cssClass", onlyCountries: "onlyCountries", enableAutoCountrySelect: "enableAutoCountrySelect", searchCountryFlag: "searchCountryFlag", searchCountryField: "searchCountryField", searchCountryPlaceholder: "searchCountryPlaceholder", maxLength: "maxLength", selectFirstCountry: "selectFirstCountry", selectedCountryISO: "selectedCountryISO", phoneValidation: "phoneValidation", inputId: "inputId", separateDialCode: "separateDialCode", excludeCountries: "excludeCountries" }, outputs: { countryChange: "countryChange" }, providers: [
|
|
1111
|
+
CountryCode,
|
|
1112
|
+
{
|
|
1113
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1114
|
+
// tslint:disable-next-line:no-forward-ref
|
|
1115
|
+
useExisting: forwardRef(() => NgxIntlTelInputComponent),
|
|
1116
|
+
multi: true,
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
provide: NG_VALIDATORS,
|
|
1120
|
+
useValue: phoneNumberValidator,
|
|
1121
|
+
multi: true,
|
|
1122
|
+
},
|
|
1123
|
+
], viewQueries: [{ propertyName: "countryList", first: true, predicate: ["countryList"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"iti iti--allow-dropdown\" [ngClass]=\"separateDialCodeClass\">\n <div\n class=\"iti__flag-container\"\n dropdown\n [ngClass]=\"{ disabled: disabled }\"\n [isDisabled]=\"disabled\"\n >\n <div class=\"iti__selected-flag dropdown-toggle\" dropdownToggle>\n <div class=\"iti__flag\" [ngClass]=\"selectedCountry.flagClass || ''\"></div>\n <div *ngIf=\"separateDialCode\" class=\"selected-dial-code\">+{{ selectedCountry.dialCode }}</div>\n <div class=\"iti__arrow\"></div>\n </div>\n <div *dropdownMenu class=\"dropdown-menu iti__dropdown-content\">\n <div class=\"search-container\" *ngIf=\"searchCountryFlag && searchCountryField\">\n <input\n id=\"country-search-box\"\n [(ngModel)]=\"countrySearchText\"\n (keyup)=\"searchCountry()\"\n (click)=\"$event.stopPropagation()\"\n [placeholder]=\"searchCountryPlaceholder\"\n autofocus\n />\n </div>\n <ul class=\"iti__country-list\" #countryList>\n <li\n class=\"iti__country iti__preferred\"\n *ngFor=\"let country of preferredCountriesInDropDown\"\n (click)=\"onCountrySelect(country, focusable)\"\n [id]=\"country.htmlId + '-preferred'\"\n >\n <div class=\"iti__flag-box\">\n <div class=\"iti__flag\" [ngClass]=\"country.flagClass\"></div>\n </div>\n <span class=\"iti__country-name\">{{ country.name }}</span>\n <span class=\"iti__dial-code\">+{{ country.dialCode }}</span>\n </li>\n <li class=\"iti__divider\" *ngIf=\"preferredCountriesInDropDown?.length\"></li>\n <li\n class=\"iti__country iti__standard\"\n *ngFor=\"let country of allCountries\"\n (click)=\"onCountrySelect(country, focusable)\"\n [id]=\"country.htmlId\"\n >\n <div class=\"iti__flag-box\">\n <div class=\"iti__flag\" [ngClass]=\"country.flagClass\"></div>\n </div>\n <span class=\"iti__country-name\">{{ country.name }}</span>\n <span class=\"iti__dial-code\">+{{ country.dialCode }}</span>\n </li>\n </ul>\n </div>\n </div>\n <input\n type=\"tel\"\n [id]=\"inputId\"\n autocomplete=\"off\"\n class=\"iti__tel-input\"\n [ngClass]=\"cssClass\"\n (blur)=\"onTouched()\"\n (keypress)=\"onInputKeyPress($event)\"\n [(ngModel)]=\"phoneNumber\"\n (ngModelChange)=\"onPhoneNumberChange()\"\n [disabled]=\"disabled\"\n [placeholder]=\"resolvePlaceholder()\"\n [attr.maxLength]=\"maxLength\"\n [attr.validation]=\"phoneValidation\"\n #focusable\n />\n</div>\n", styles: [".caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid \\\t;border-right:4px solid transparent;border-left:4px solid transparent}.dropup,.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:14px;text-align:left;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;box-shadow:0 6px 12px #0000002d;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#262626;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;outline:0;background-color:#337ab7}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#777}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;inset:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px dashed;border-bottom:4px solid \\\t;content:\"\"}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width: 768px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}\n", "li.iti__country:hover{background-color:#0000000d}.iti__selected-flag.dropdown-toggle:after{content:none}.iti__flag-container.disabled{cursor:default!important}.iti.iti--allow-dropdown .flag-container.disabled:hover .iti__selected-flag{background:none}.iti__dropdown-content{border:1px solid #ccc;width:-moz-fit-content;width:fit-content;padding:1px;border-collapse:collapse}.search-container{position:relative}.search-container input{width:100%;border:none;border-bottom:1px solid #ccc;padding-left:10px}.search-icon{position:absolute;z-index:2;width:25px;margin:1px 10px}.iti__country-list{position:relative;border:none}.iti input#country-search-box{padding-left:6px}.iti .selected-dial-code{margin-left:6px}.iti.separate-dial-code .iti__selected-flag,.iti.separate-dial-code.iti--allow-dropdown.iti-sdc-2 .iti__selected-flag,.iti.separate-dial-code.iti--allow-dropdown.iti-sdc-3 .iti__selected-flag,.iti.separate-dial-code.iti--allow-dropdown.iti-sdc-4 .iti__selected-flag{width:93px}.iti.separate-dial-code input,.iti.separate-dial-code.iti--allow-dropdown.iti-sdc-2 input,.iti.separate-dial-code.iti--allow-dropdown.iti-sdc-3 input,.iti.separate-dial-code.iti--allow-dropdown.iti-sdc-4 input{padding-left:98px}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.BsDropdownMenuDirective, selector: "[bsDropdownMenu],[dropdownMenu]", exportAs: ["bs-dropdown-menu"] }, { kind: "directive", type: i4.BsDropdownToggleDirective, selector: "[bsDropdownToggle],[dropdownToggle]", exportAs: ["bs-dropdown-toggle"] }, { kind: "directive", type: i4.BsDropdownDirective, selector: "[bsDropdown], [dropdown]", inputs: ["placement", "triggers", "container", "dropup", "autoClose", "isAnimated", "insideClick", "isDisabled", "isOpen"], outputs: ["isOpenChange", "onShown", "onHidden"], exportAs: ["bs-dropdown"] }, { kind: "directive", type: NativeElementInjectorDirective, selector: "[ngModel], [formControl], [formControlName]" }] }); }
|
|
1124
|
+
}
|
|
1125
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgxIntlTelInputComponent, decorators: [{
|
|
1126
|
+
type: Component,
|
|
1127
|
+
args: [{ selector: 'ngx-intl-tel-input', providers: [
|
|
1128
|
+
CountryCode,
|
|
1129
|
+
{
|
|
1130
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1131
|
+
// tslint:disable-next-line:no-forward-ref
|
|
1132
|
+
useExisting: forwardRef(() => NgxIntlTelInputComponent),
|
|
1133
|
+
multi: true,
|
|
1134
|
+
},
|
|
1135
|
+
{
|
|
1136
|
+
provide: NG_VALIDATORS,
|
|
1137
|
+
useValue: phoneNumberValidator,
|
|
1138
|
+
multi: true,
|
|
1139
|
+
},
|
|
1140
|
+
], template: "<div class=\"iti iti--allow-dropdown\" [ngClass]=\"separateDialCodeClass\">\n <div\n class=\"iti__flag-container\"\n dropdown\n [ngClass]=\"{ disabled: disabled }\"\n [isDisabled]=\"disabled\"\n >\n <div class=\"iti__selected-flag dropdown-toggle\" dropdownToggle>\n <div class=\"iti__flag\" [ngClass]=\"selectedCountry.flagClass || ''\"></div>\n <div *ngIf=\"separateDialCode\" class=\"selected-dial-code\">+{{ selectedCountry.dialCode }}</div>\n <div class=\"iti__arrow\"></div>\n </div>\n <div *dropdownMenu class=\"dropdown-menu iti__dropdown-content\">\n <div class=\"search-container\" *ngIf=\"searchCountryFlag && searchCountryField\">\n <input\n id=\"country-search-box\"\n [(ngModel)]=\"countrySearchText\"\n (keyup)=\"searchCountry()\"\n (click)=\"$event.stopPropagation()\"\n [placeholder]=\"searchCountryPlaceholder\"\n autofocus\n />\n </div>\n <ul class=\"iti__country-list\" #countryList>\n <li\n class=\"iti__country iti__preferred\"\n *ngFor=\"let country of preferredCountriesInDropDown\"\n (click)=\"onCountrySelect(country, focusable)\"\n [id]=\"country.htmlId + '-preferred'\"\n >\n <div class=\"iti__flag-box\">\n <div class=\"iti__flag\" [ngClass]=\"country.flagClass\"></div>\n </div>\n <span class=\"iti__country-name\">{{ country.name }}</span>\n <span class=\"iti__dial-code\">+{{ country.dialCode }}</span>\n </li>\n <li class=\"iti__divider\" *ngIf=\"preferredCountriesInDropDown?.length\"></li>\n <li\n class=\"iti__country iti__standard\"\n *ngFor=\"let country of allCountries\"\n (click)=\"onCountrySelect(country, focusable)\"\n [id]=\"country.htmlId\"\n >\n <div class=\"iti__flag-box\">\n <div class=\"iti__flag\" [ngClass]=\"country.flagClass\"></div>\n </div>\n <span class=\"iti__country-name\">{{ country.name }}</span>\n <span class=\"iti__dial-code\">+{{ country.dialCode }}</span>\n </li>\n </ul>\n </div>\n </div>\n <input\n type=\"tel\"\n [id]=\"inputId\"\n autocomplete=\"off\"\n class=\"iti__tel-input\"\n [ngClass]=\"cssClass\"\n (blur)=\"onTouched()\"\n (keypress)=\"onInputKeyPress($event)\"\n [(ngModel)]=\"phoneNumber\"\n (ngModelChange)=\"onPhoneNumberChange()\"\n [disabled]=\"disabled\"\n [placeholder]=\"resolvePlaceholder()\"\n [attr.maxLength]=\"maxLength\"\n [attr.validation]=\"phoneValidation\"\n #focusable\n />\n</div>\n", styles: [".caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid \\\t;border-right:4px solid transparent;border-left:4px solid transparent}.dropup,.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:14px;text-align:left;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;box-shadow:0 6px 12px #0000002d;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#262626;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;outline:0;background-color:#337ab7}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#777}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;inset:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px dashed;border-bottom:4px solid \\\t;content:\"\"}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width: 768px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}\n", "li.iti__country:hover{background-color:#0000000d}.iti__selected-flag.dropdown-toggle:after{content:none}.iti__flag-container.disabled{cursor:default!important}.iti.iti--allow-dropdown .flag-container.disabled:hover .iti__selected-flag{background:none}.iti__dropdown-content{border:1px solid #ccc;width:-moz-fit-content;width:fit-content;padding:1px;border-collapse:collapse}.search-container{position:relative}.search-container input{width:100%;border:none;border-bottom:1px solid #ccc;padding-left:10px}.search-icon{position:absolute;z-index:2;width:25px;margin:1px 10px}.iti__country-list{position:relative;border:none}.iti input#country-search-box{padding-left:6px}.iti .selected-dial-code{margin-left:6px}.iti.separate-dial-code .iti__selected-flag,.iti.separate-dial-code.iti--allow-dropdown.iti-sdc-2 .iti__selected-flag,.iti.separate-dial-code.iti--allow-dropdown.iti-sdc-3 .iti__selected-flag,.iti.separate-dial-code.iti--allow-dropdown.iti-sdc-4 .iti__selected-flag{width:93px}.iti.separate-dial-code input,.iti.separate-dial-code.iti--allow-dropdown.iti-sdc-2 input,.iti.separate-dial-code.iti--allow-dropdown.iti-sdc-3 input,.iti.separate-dial-code.iti--allow-dropdown.iti-sdc-4 input{padding-left:98px}\n"] }]
|
|
1141
|
+
}], ctorParameters: function () { return [{ type: CountryCode }]; }, propDecorators: { value: [{
|
|
1142
|
+
type: Input
|
|
1143
|
+
}], preferredCountries: [{
|
|
1144
|
+
type: Input
|
|
1145
|
+
}], enablePlaceholder: [{
|
|
1146
|
+
type: Input
|
|
1147
|
+
}], customPlaceholder: [{
|
|
1148
|
+
type: Input
|
|
1149
|
+
}], numberFormat: [{
|
|
1150
|
+
type: Input
|
|
1151
|
+
}], cssClass: [{
|
|
1152
|
+
type: Input
|
|
1153
|
+
}], onlyCountries: [{
|
|
1154
|
+
type: Input
|
|
1155
|
+
}], enableAutoCountrySelect: [{
|
|
1156
|
+
type: Input
|
|
1157
|
+
}], searchCountryFlag: [{
|
|
1158
|
+
type: Input
|
|
1159
|
+
}], searchCountryField: [{
|
|
1160
|
+
type: Input
|
|
1161
|
+
}], searchCountryPlaceholder: [{
|
|
1162
|
+
type: Input
|
|
1163
|
+
}], maxLength: [{
|
|
1164
|
+
type: Input
|
|
1165
|
+
}], selectFirstCountry: [{
|
|
1166
|
+
type: Input
|
|
1167
|
+
}], selectedCountryISO: [{
|
|
1168
|
+
type: Input
|
|
1169
|
+
}], phoneValidation: [{
|
|
1170
|
+
type: Input
|
|
1171
|
+
}], inputId: [{
|
|
1172
|
+
type: Input
|
|
1173
|
+
}], separateDialCode: [{
|
|
1174
|
+
type: Input
|
|
1175
|
+
}], excludeCountries: [{
|
|
1176
|
+
type: Input
|
|
1177
|
+
}], countryChange: [{
|
|
1178
|
+
type: Output
|
|
1179
|
+
}], countryList: [{
|
|
1180
|
+
type: ViewChild,
|
|
1181
|
+
args: ['countryList']
|
|
1182
|
+
}] } });
|
|
1183
|
+
|
|
1184
|
+
const dropdownModuleForRoot = BsDropdownModule.forRoot();
|
|
1185
|
+
class NgxIntlTelInputModule {
|
|
1186
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgxIntlTelInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1187
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: NgxIntlTelInputModule, declarations: [NgxIntlTelInputComponent, NativeElementInjectorDirective], imports: [CommonModule, FormsModule, ReactiveFormsModule, i4.BsDropdownModule], exports: [NgxIntlTelInputComponent, NativeElementInjectorDirective] }); }
|
|
1188
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgxIntlTelInputModule, imports: [CommonModule, FormsModule, ReactiveFormsModule, dropdownModuleForRoot] }); }
|
|
1189
|
+
}
|
|
1190
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NgxIntlTelInputModule, decorators: [{
|
|
1191
|
+
type: NgModule,
|
|
1192
|
+
args: [{
|
|
1193
|
+
declarations: [NgxIntlTelInputComponent, NativeElementInjectorDirective],
|
|
1194
|
+
imports: [CommonModule, FormsModule, ReactiveFormsModule, dropdownModuleForRoot],
|
|
1195
|
+
exports: [NgxIntlTelInputComponent, NativeElementInjectorDirective],
|
|
1196
|
+
}]
|
|
1197
|
+
}] });
|
|
1198
|
+
|
|
1199
|
+
/*
|
|
1200
|
+
* Public API Surface of ngx-intl-tel-input
|
|
1201
|
+
*/
|
|
1202
|
+
|
|
1203
|
+
/**
|
|
1204
|
+
* Generated bundle index. Do not edit.
|
|
1205
|
+
*/
|
|
1206
|
+
|
|
1207
|
+
export { CountryISO, NativeElementInjectorDirective, NgxIntlTelInputComponent, NgxIntlTelInputModule, PhoneNumberFormat, SearchCountryField, dropdownModuleForRoot };
|
|
1208
|
+
//# sourceMappingURL=moddi3-ngx-intl-tel-input.mjs.map
|