@mvf/external-components 3.32.1-dev.0 → 3.32.1-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Components/Molecules/PhoneNumberTextFieldCustom/IPhoneNumberTextFieldProps.d.ts +1 -0
- package/Components/Molecules/PhoneNumberTextFieldCustom/PhoneNumberTextField.js +4 -3
- package/Components/Molecules/PhoneNumberTextFieldCustom/PhoneNumberTextField.js.map +1 -1
- package/Components/Molecules/PhoneNumberTextFieldCustom/PhoneNumberTextField.test.js +0 -27
- package/Components/Molecules/PhoneNumberTextFieldCustom/PhoneNumberTextField.test.js.map +1 -1
- package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/components/ui/CountryDropdown.d.ts +1 -0
- package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/components/ui/CountryDropdown.js +2 -2
- package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/components/ui/CountryDropdown.js.map +1 -1
- package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/components/ui/CountryModal.d.ts +1 -0
- package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/components/ui/CountryModal.js +2 -2
- package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/components/ui/CountryModal.js.map +1 -1
- package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/hooks/usePhoneNumber.d.ts +2 -1
- package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/hooks/usePhoneNumber.js +32 -6
- package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/hooks/usePhoneNumber.js.map +1 -1
- package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/stories/PhoneNumberTextFieldStory.d.ts +1 -0
- package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/stories/PhoneNumberTextFieldStory.js +2 -2
- package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/stories/PhoneNumberTextFieldStory.js.map +1 -1
- package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/utils/countryData.d.ts +234 -3
- package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/utils/countryData.js +35 -244
- package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/utils/countryData.js.map +1 -1
- package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/utils/phoneValidation.d.ts +5 -0
- package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/utils/phoneValidation.js +94 -2
- package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/utils/phoneValidation.js.map +1 -1
- package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/utils/phoneValidation.test.js +81 -0
- package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/utils/phoneValidation.test.js.map +1 -1
- package/Components/Molecules/PhoneNumberTextFieldCustom/defaultProps.d.ts +1 -0
- package/Components/Molecules/PhoneNumberTextFieldCustom/defaultProps.js +1 -0
- package/Components/Molecules/PhoneNumberTextFieldCustom/defaultProps.js.map +1 -1
- package/package.json +1 -1
@@ -1,12 +1,243 @@
|
|
1
|
-
declare const
|
2
|
-
|
1
|
+
declare const allCountryNames: {
|
2
|
+
AD: string;
|
3
|
+
AE: string;
|
4
|
+
AF: string;
|
5
|
+
AG: string;
|
6
|
+
AI: string;
|
7
|
+
AL: string;
|
8
|
+
AM: string;
|
9
|
+
AO: string;
|
10
|
+
AR: string;
|
11
|
+
AS: string;
|
12
|
+
AT: string;
|
13
|
+
AU: string;
|
14
|
+
AW: string;
|
15
|
+
AZ: string;
|
16
|
+
BA: string;
|
17
|
+
BB: string;
|
18
|
+
BD: string;
|
19
|
+
BE: string;
|
20
|
+
BF: string;
|
21
|
+
BG: string;
|
22
|
+
BH: string;
|
23
|
+
BI: string;
|
24
|
+
BJ: string;
|
25
|
+
BL: string;
|
26
|
+
BM: string;
|
27
|
+
BN: string;
|
28
|
+
BO: string;
|
29
|
+
BR: string;
|
30
|
+
BS: string;
|
31
|
+
BT: string;
|
32
|
+
BW: string;
|
33
|
+
BY: string;
|
34
|
+
BZ: string;
|
35
|
+
CA: string;
|
36
|
+
CD: string;
|
37
|
+
CF: string;
|
38
|
+
CG: string;
|
39
|
+
CH: string;
|
40
|
+
CI: string;
|
41
|
+
CL: string;
|
42
|
+
CM: string;
|
43
|
+
CN: string;
|
44
|
+
CO: string;
|
45
|
+
CR: string;
|
46
|
+
CU: string;
|
47
|
+
CV: string;
|
48
|
+
CY: string;
|
49
|
+
CZ: string;
|
50
|
+
DE: string;
|
51
|
+
DJ: string;
|
52
|
+
DK: string;
|
53
|
+
DM: string;
|
54
|
+
DO: string;
|
55
|
+
DZ: string;
|
56
|
+
EC: string;
|
57
|
+
EE: string;
|
58
|
+
EG: string;
|
59
|
+
EH: string;
|
60
|
+
ER: string;
|
61
|
+
ES: string;
|
62
|
+
ET: string;
|
63
|
+
FI: string;
|
64
|
+
FJ: string;
|
65
|
+
FK: string;
|
66
|
+
FM: string;
|
67
|
+
FO: string;
|
68
|
+
FR: string;
|
69
|
+
GA: string;
|
70
|
+
GB: string;
|
71
|
+
GD: string;
|
72
|
+
GE: string;
|
73
|
+
GF: string;
|
74
|
+
GH: string;
|
75
|
+
GI: string;
|
76
|
+
GL: string;
|
77
|
+
GM: string;
|
78
|
+
GN: string;
|
79
|
+
GP: string;
|
80
|
+
GQ: string;
|
81
|
+
GR: string;
|
82
|
+
GT: string;
|
83
|
+
GU: string;
|
84
|
+
GW: string;
|
85
|
+
GY: string;
|
86
|
+
HK: string;
|
87
|
+
HN: string;
|
88
|
+
HR: string;
|
89
|
+
HT: string;
|
90
|
+
HU: string;
|
91
|
+
ID: string;
|
92
|
+
IE: string;
|
93
|
+
IL: string;
|
94
|
+
IN: string;
|
95
|
+
IQ: string;
|
96
|
+
IR: string;
|
97
|
+
IS: string;
|
98
|
+
IT: string;
|
99
|
+
JM: string;
|
100
|
+
JO: string;
|
101
|
+
JP: string;
|
102
|
+
KE: string;
|
103
|
+
KG: string;
|
104
|
+
KH: string;
|
105
|
+
KI: string;
|
106
|
+
KM: string;
|
107
|
+
KN: string;
|
108
|
+
KP: string;
|
109
|
+
KR: string;
|
110
|
+
KW: string;
|
111
|
+
KY: string;
|
112
|
+
KZ: string;
|
113
|
+
LA: string;
|
114
|
+
LB: string;
|
115
|
+
LC: string;
|
116
|
+
LI: string;
|
117
|
+
LK: string;
|
118
|
+
LR: string;
|
119
|
+
LS: string;
|
120
|
+
LT: string;
|
121
|
+
LU: string;
|
122
|
+
LV: string;
|
123
|
+
LY: string;
|
124
|
+
MA: string;
|
125
|
+
MC: string;
|
126
|
+
MD: string;
|
127
|
+
ME: string;
|
128
|
+
MF: string;
|
129
|
+
MG: string;
|
130
|
+
MH: string;
|
131
|
+
MK: string;
|
132
|
+
ML: string;
|
133
|
+
MM: string;
|
134
|
+
MN: string;
|
135
|
+
MO: string;
|
136
|
+
MP: string;
|
137
|
+
MQ: string;
|
138
|
+
MR: string;
|
139
|
+
MS: string;
|
140
|
+
MT: string;
|
141
|
+
MU: string;
|
142
|
+
MV: string;
|
143
|
+
MW: string;
|
144
|
+
MX: string;
|
145
|
+
MY: string;
|
146
|
+
MZ: string;
|
147
|
+
NA: string;
|
148
|
+
NC: string;
|
149
|
+
NE: string;
|
150
|
+
NF: string;
|
151
|
+
NG: string;
|
152
|
+
NI: string;
|
153
|
+
NL: string;
|
154
|
+
NO: string;
|
155
|
+
NP: string;
|
156
|
+
NR: string;
|
157
|
+
NU: string;
|
158
|
+
NZ: string;
|
159
|
+
OM: string;
|
160
|
+
PA: string;
|
161
|
+
PE: string;
|
162
|
+
PF: string;
|
163
|
+
PG: string;
|
164
|
+
PH: string;
|
165
|
+
PK: string;
|
166
|
+
PL: string;
|
167
|
+
PM: string;
|
168
|
+
PR: string;
|
169
|
+
PS: string;
|
170
|
+
PT: string;
|
171
|
+
PW: string;
|
172
|
+
PY: string;
|
173
|
+
QA: string;
|
174
|
+
RE: string;
|
175
|
+
RO: string;
|
176
|
+
RS: string;
|
177
|
+
RU: string;
|
178
|
+
RW: string;
|
179
|
+
SA: string;
|
180
|
+
SB: string;
|
181
|
+
SC: string;
|
182
|
+
SD: string;
|
183
|
+
SE: string;
|
184
|
+
SG: string;
|
185
|
+
SH: string;
|
186
|
+
SI: string;
|
187
|
+
SJ: string;
|
188
|
+
SK: string;
|
189
|
+
SL: string;
|
190
|
+
SM: string;
|
191
|
+
SN: string;
|
192
|
+
SO: string;
|
193
|
+
SR: string;
|
194
|
+
ST: string;
|
195
|
+
SV: string;
|
196
|
+
SY: string;
|
197
|
+
SZ: string;
|
198
|
+
TC: string;
|
199
|
+
TD: string;
|
200
|
+
TG: string;
|
201
|
+
TH: string;
|
202
|
+
TJ: string;
|
203
|
+
TK: string;
|
204
|
+
TL: string;
|
205
|
+
TM: string;
|
206
|
+
TN: string;
|
207
|
+
TO: string;
|
208
|
+
TR: string;
|
209
|
+
TT: string;
|
210
|
+
TV: string;
|
211
|
+
TW: string;
|
212
|
+
TZ: string;
|
213
|
+
UA: string;
|
214
|
+
UG: string;
|
215
|
+
US: string;
|
216
|
+
UY: string;
|
217
|
+
UZ: string;
|
218
|
+
VA: string;
|
219
|
+
VC: string;
|
220
|
+
VE: string;
|
221
|
+
VG: string;
|
222
|
+
VI: string;
|
223
|
+
VN: string;
|
224
|
+
VU: string;
|
225
|
+
WF: string;
|
226
|
+
WS: string;
|
227
|
+
YE: string;
|
228
|
+
YT: string;
|
229
|
+
ZA: string;
|
230
|
+
ZM: string;
|
231
|
+
ZW: string;
|
232
|
+
};
|
233
|
+
export type CountryCode = keyof typeof allCountryNames;
|
3
234
|
export interface CountryData {
|
4
235
|
code: CountryCode;
|
5
236
|
name: string;
|
6
237
|
dialCode: string;
|
7
238
|
example: string;
|
8
239
|
}
|
9
|
-
export declare const getCountryData: () => CountryData[];
|
240
|
+
export declare const getCountryData: (preferredCountries?: string[]) => CountryData[];
|
10
241
|
export declare const getCountryByCode: (code: CountryCode) => CountryData | undefined;
|
11
242
|
export declare const getCountryByDialCode: (dialCode: string) => CountryData | undefined;
|
12
243
|
export {};
|
@@ -2,231 +2,6 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.getCountryByDialCode = exports.getCountryByCode = exports.getCountryData = void 0;
|
4
4
|
var google_libphonenumber_1 = require("google-libphonenumber");
|
5
|
-
// Define a comprehensive list of supported countries
|
6
|
-
var supportedCountries = [
|
7
|
-
'US',
|
8
|
-
'GB',
|
9
|
-
'CA',
|
10
|
-
'AU',
|
11
|
-
'DE',
|
12
|
-
'FR',
|
13
|
-
'IT',
|
14
|
-
'ES',
|
15
|
-
'NL',
|
16
|
-
'BE',
|
17
|
-
'SE',
|
18
|
-
'NO',
|
19
|
-
'DK',
|
20
|
-
'FI',
|
21
|
-
'CH',
|
22
|
-
'AT',
|
23
|
-
'IE',
|
24
|
-
'NZ',
|
25
|
-
'JP',
|
26
|
-
'KR',
|
27
|
-
'CN',
|
28
|
-
'IN',
|
29
|
-
'BR',
|
30
|
-
'MX',
|
31
|
-
'AR',
|
32
|
-
'CL',
|
33
|
-
'CO',
|
34
|
-
'PE',
|
35
|
-
'VE',
|
36
|
-
'EC',
|
37
|
-
'BO',
|
38
|
-
'PY',
|
39
|
-
'UY',
|
40
|
-
'GY',
|
41
|
-
'SR',
|
42
|
-
'FK',
|
43
|
-
'GF',
|
44
|
-
'AD',
|
45
|
-
'AE',
|
46
|
-
'AF',
|
47
|
-
'AG',
|
48
|
-
'AI',
|
49
|
-
'AL',
|
50
|
-
'AM',
|
51
|
-
'AO',
|
52
|
-
'AS',
|
53
|
-
'AW',
|
54
|
-
'AZ',
|
55
|
-
'BA',
|
56
|
-
'BB',
|
57
|
-
'BD',
|
58
|
-
'BF',
|
59
|
-
'BG',
|
60
|
-
'BH',
|
61
|
-
'BI',
|
62
|
-
'BJ',
|
63
|
-
'BL',
|
64
|
-
'BM',
|
65
|
-
'BN',
|
66
|
-
'BS',
|
67
|
-
'BT',
|
68
|
-
'BW',
|
69
|
-
'BY',
|
70
|
-
'BZ',
|
71
|
-
'CD',
|
72
|
-
'CF',
|
73
|
-
'CG',
|
74
|
-
'CI',
|
75
|
-
'CM',
|
76
|
-
'CR',
|
77
|
-
'CU',
|
78
|
-
'CV',
|
79
|
-
'CY',
|
80
|
-
'CZ',
|
81
|
-
'DJ',
|
82
|
-
'DM',
|
83
|
-
'DO',
|
84
|
-
'DZ',
|
85
|
-
'EG',
|
86
|
-
'EH',
|
87
|
-
'ER',
|
88
|
-
'ET',
|
89
|
-
'FJ',
|
90
|
-
'FM',
|
91
|
-
'FO',
|
92
|
-
'GA',
|
93
|
-
'GD',
|
94
|
-
'GE',
|
95
|
-
'GH',
|
96
|
-
'GI',
|
97
|
-
'GL',
|
98
|
-
'GM',
|
99
|
-
'GN',
|
100
|
-
'GP',
|
101
|
-
'GQ',
|
102
|
-
'GT',
|
103
|
-
'GU',
|
104
|
-
'GW',
|
105
|
-
'HK',
|
106
|
-
'HN',
|
107
|
-
'HR',
|
108
|
-
'HT',
|
109
|
-
'HU',
|
110
|
-
'ID',
|
111
|
-
'IL',
|
112
|
-
'IQ',
|
113
|
-
'IR',
|
114
|
-
'IS',
|
115
|
-
'JM',
|
116
|
-
'JO',
|
117
|
-
'KE',
|
118
|
-
'KG',
|
119
|
-
'KH',
|
120
|
-
'KI',
|
121
|
-
'KM',
|
122
|
-
'KN',
|
123
|
-
'KP',
|
124
|
-
'KW',
|
125
|
-
'KY',
|
126
|
-
'KZ',
|
127
|
-
'LA',
|
128
|
-
'LB',
|
129
|
-
'LC',
|
130
|
-
'LI',
|
131
|
-
'LK',
|
132
|
-
'LR',
|
133
|
-
'LS',
|
134
|
-
'LT',
|
135
|
-
'LU',
|
136
|
-
'LV',
|
137
|
-
'LY',
|
138
|
-
'MA',
|
139
|
-
'MC',
|
140
|
-
'MD',
|
141
|
-
'ME',
|
142
|
-
'MF',
|
143
|
-
'MG',
|
144
|
-
'MH',
|
145
|
-
'MK',
|
146
|
-
'ML',
|
147
|
-
'MM',
|
148
|
-
'MN',
|
149
|
-
'MO',
|
150
|
-
'MP',
|
151
|
-
'MQ',
|
152
|
-
'MR',
|
153
|
-
'MS',
|
154
|
-
'MT',
|
155
|
-
'MU',
|
156
|
-
'MV',
|
157
|
-
'MW',
|
158
|
-
'MY',
|
159
|
-
'MZ',
|
160
|
-
'NA',
|
161
|
-
'NC',
|
162
|
-
'NE',
|
163
|
-
'NF',
|
164
|
-
'NG',
|
165
|
-
'NI',
|
166
|
-
'NP',
|
167
|
-
'NR',
|
168
|
-
'NU',
|
169
|
-
'OM',
|
170
|
-
'PA',
|
171
|
-
'PF',
|
172
|
-
'PG',
|
173
|
-
'PH',
|
174
|
-
'PK',
|
175
|
-
'PL',
|
176
|
-
'PM',
|
177
|
-
'PR',
|
178
|
-
'PS',
|
179
|
-
'PW',
|
180
|
-
'QA',
|
181
|
-
'RE',
|
182
|
-
'RO',
|
183
|
-
'RS',
|
184
|
-
'RU',
|
185
|
-
'RW',
|
186
|
-
'SA',
|
187
|
-
'SB',
|
188
|
-
'SC',
|
189
|
-
'SD',
|
190
|
-
'SG',
|
191
|
-
'SH',
|
192
|
-
'SI',
|
193
|
-
'SJ',
|
194
|
-
'SK',
|
195
|
-
'SL',
|
196
|
-
'SM',
|
197
|
-
'SN',
|
198
|
-
'SO',
|
199
|
-
'ST',
|
200
|
-
'SV',
|
201
|
-
'SY',
|
202
|
-
'TC',
|
203
|
-
'TD',
|
204
|
-
'TG',
|
205
|
-
'TH',
|
206
|
-
'TJ',
|
207
|
-
'TK',
|
208
|
-
'TL',
|
209
|
-
'TM',
|
210
|
-
'TN',
|
211
|
-
'TO',
|
212
|
-
'TR',
|
213
|
-
'TT',
|
214
|
-
'TV',
|
215
|
-
'TW',
|
216
|
-
'UA',
|
217
|
-
'UG',
|
218
|
-
'VA',
|
219
|
-
'VC',
|
220
|
-
'VG',
|
221
|
-
'VI',
|
222
|
-
'VN',
|
223
|
-
'VU',
|
224
|
-
'WF',
|
225
|
-
'WS',
|
226
|
-
'YE',
|
227
|
-
'YT',
|
228
|
-
'ZM',
|
229
|
-
];
|
230
5
|
// All country names
|
231
6
|
var allCountryNames = {
|
232
7
|
AD: 'Andorra',
|
@@ -460,11 +235,10 @@ var allCountryNames = {
|
|
460
235
|
ZM: 'Zambia',
|
461
236
|
ZW: 'Zimbabwe',
|
462
237
|
};
|
463
|
-
//
|
464
|
-
var
|
465
|
-
|
466
|
-
|
467
|
-
]; }));
|
238
|
+
// Use all countries from allCountryNames
|
239
|
+
var supportedCountries = Object.keys(allCountryNames);
|
240
|
+
// Use allCountryNames directly
|
241
|
+
var countryNames = allCountryNames;
|
468
242
|
// Initialize phoneUtil with error handling
|
469
243
|
var phoneUtil;
|
470
244
|
try {
|
@@ -473,8 +247,9 @@ try {
|
|
473
247
|
catch (error) {
|
474
248
|
console.error('Failed to initialize PhoneNumberUtil:', error);
|
475
249
|
}
|
476
|
-
//
|
477
|
-
var
|
250
|
+
// Helper function to create country data with custom sorting
|
251
|
+
var createCountryData = function (preferredCountries) {
|
252
|
+
if (preferredCountries === void 0) { preferredCountries = ['US', 'GB']; }
|
478
253
|
return supportedCountries
|
479
254
|
.map(function (code) {
|
480
255
|
try {
|
@@ -501,28 +276,44 @@ var COUNTRY_DATA = (function () {
|
|
501
276
|
}
|
502
277
|
})
|
503
278
|
.sort(function (a, b) {
|
504
|
-
// Sort by
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
279
|
+
// Sort by preferred countries first, then alphabetically
|
280
|
+
var aIndex = preferredCountries.indexOf(a.code);
|
281
|
+
var bIndex = preferredCountries.indexOf(b.code);
|
282
|
+
// If both are preferred countries, sort by their order in preferredCountries
|
283
|
+
if (aIndex !== -1 && bIndex !== -1) {
|
284
|
+
return aIndex - bIndex;
|
285
|
+
}
|
286
|
+
// If only a is preferred, it comes first
|
287
|
+
if (aIndex !== -1)
|
510
288
|
return -1;
|
511
|
-
|
289
|
+
// If only b is preferred, it comes first
|
290
|
+
if (bIndex !== -1)
|
512
291
|
return 1;
|
292
|
+
// Neither is preferred, sort alphabetically
|
513
293
|
return a.name.localeCompare(b.name);
|
514
294
|
});
|
515
|
-
}
|
516
|
-
|
517
|
-
|
295
|
+
};
|
296
|
+
// Pre-compute default country data for better performance (backward compatibility)
|
297
|
+
var DEFAULT_COUNTRY_DATA = createCountryData();
|
298
|
+
var getCountryData = function (preferredCountries) {
|
299
|
+
// If no preferred countries specified, return the pre-computed default
|
300
|
+
if (!preferredCountries ||
|
301
|
+
(preferredCountries.length === 2 &&
|
302
|
+
preferredCountries[0] === 'US' &&
|
303
|
+
preferredCountries[1] === 'GB')) {
|
304
|
+
return DEFAULT_COUNTRY_DATA;
|
305
|
+
}
|
306
|
+
// Filter to only valid country codes and create new sorted data
|
307
|
+
var validPreferredCountries = preferredCountries.filter(function (code) { return code in allCountryNames; });
|
308
|
+
return createCountryData(validPreferredCountries);
|
518
309
|
};
|
519
310
|
exports.getCountryData = getCountryData;
|
520
311
|
var getCountryByCode = function (code) {
|
521
|
-
return
|
312
|
+
return DEFAULT_COUNTRY_DATA.find(function (country) { return country.code === code; });
|
522
313
|
};
|
523
314
|
exports.getCountryByCode = getCountryByCode;
|
524
315
|
var getCountryByDialCode = function (dialCode) {
|
525
|
-
return
|
316
|
+
return DEFAULT_COUNTRY_DATA.find(function (country) { return country.dialCode === dialCode; });
|
526
317
|
};
|
527
318
|
exports.getCountryByDialCode = getCountryByDialCode;
|
528
319
|
//# sourceMappingURL=countryData.js.map
|
package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/utils/countryData.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"countryData.js","sourceRoot":"","sources":["../../../../../../src/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/utils/countryData.ts"],"names":[],"mappings":";;;AAAA,+DAA2E;AAE3E,
|
1
|
+
{"version":3,"file":"countryData.js","sourceRoot":"","sources":["../../../../../../src/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/utils/countryData.ts"],"names":[],"mappings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AC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,mFAAmF;AACnF,IAAM,oBAAoB,GAAkB,iBAAiB,EAAE,CAAC;AAEzD,IAAM,cAAc,GAAG,UAC5B,kBAA6B;IAE7B,uEAAuE;IACvE,IACE,CAAC,kBAAkB;QACnB,CAAC,kBAAkB,CAAC,MAAM,KAAK,CAAC;YAC9B,kBAAkB,CAAC,CAAC,CAAC,KAAK,IAAI;YAC9B,kBAAkB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,EACjC,CAAC;QACD,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IAED,gEAAgE;IAChE,IAAM,uBAAuB,GAAG,kBAAkB,CAAC,MAAM,CACvD,UAAC,IAAI,IAA0B,OAAA,IAAI,IAAI,eAAe,EAAvB,CAAuB,CACvD,CAAC;IAEF,OAAO,iBAAiB,CAAC,uBAAuB,CAAC,CAAC;AACpD,CAAC,CAAC;AAnBW,QAAA,cAAc,kBAmBzB;AAEK,IAAM,gBAAgB,GAAG,UAC9B,IAAiB;IAEjB,OAAO,oBAAoB,CAAC,IAAI,CAAC,UAAC,OAAO,IAAK,OAAA,OAAO,CAAC,IAAI,KAAK,IAAI,EAArB,CAAqB,CAAC,CAAC;AACvE,CAAC,CAAC;AAJW,QAAA,gBAAgB,oBAI3B;AAEK,IAAM,oBAAoB,GAAG,UAClC,QAAgB;IAEhB,OAAO,oBAAoB,CAAC,IAAI,CAAC,UAAC,OAAO,IAAK,OAAA,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAA7B,CAA6B,CAAC,CAAC;AAC/E,CAAC,CAAC;AAJW,QAAA,oBAAoB,wBAI/B"}
|
package/Components/Molecules/PhoneNumberTextFieldCustom/__helpers__/utils/phoneValidation.d.ts
CHANGED
@@ -14,3 +14,8 @@ export declare const formatAsYouType: (phoneNumber: string, countryCode: Country
|
|
14
14
|
export declare const calculateCursorPosition: (oldValue: string, newValue: string, oldCursorPos: number) => number;
|
15
15
|
export declare const getExampleForCountry: (countryCode: CountryCode) => string;
|
16
16
|
export declare const extractCountryCodeFromNumber: (phoneNumber: string, defaultCountry?: CountryCode) => CountryCode | undefined;
|
17
|
+
/**
|
18
|
+
* Extracts the national number from a phone number and reformats it with a new country's dial code.
|
19
|
+
* This is used when manually changing countries to properly swap dial codes.
|
20
|
+
*/
|
21
|
+
export declare const swapDialCode: (phoneNumber: string, fromCountryCode: CountryCode, toCountryCode: CountryCode) => string;
|