svelte-tel-input 3.3.8 → 3.4.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/dist/assets/examplePhoneNumbers.d.ts +2 -247
- package/dist/components/input/TelInput.svelte +21 -15
- package/dist/components/input/TelInput.svelte.d.ts +14 -12
- package/dist/stores/index.d.ts +0 -1
- package/dist/types/index.d.ts +5 -5
- package/dist/utils/helpers.d.ts +6 -6
- package/dist/utils/helpers.js +29 -29
- package/package.json +35 -35
|
@@ -1,248 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
readonly AD: "312345";
|
|
4
|
-
readonly AE: "501234567";
|
|
5
|
-
readonly AF: "701234567";
|
|
6
|
-
readonly AG: "2684641234";
|
|
7
|
-
readonly AI: "2642351234";
|
|
8
|
-
readonly AL: "672123456";
|
|
9
|
-
readonly AM: "77123456";
|
|
10
|
-
readonly AO: "923123456";
|
|
11
|
-
readonly AR: "91123456789";
|
|
12
|
-
readonly AS: "6847331234";
|
|
13
|
-
readonly AT: "664123456";
|
|
14
|
-
readonly AU: "412345678";
|
|
15
|
-
readonly AW: "5601234";
|
|
16
|
-
readonly AX: "412345678";
|
|
17
|
-
readonly AZ: "401234567";
|
|
18
|
-
readonly BA: "61123456";
|
|
19
|
-
readonly BB: "2462501234";
|
|
20
|
-
readonly BD: "1812345678";
|
|
21
|
-
readonly BE: "470123456";
|
|
22
|
-
readonly BF: "70123456";
|
|
23
|
-
readonly BG: "43012345";
|
|
24
|
-
readonly BH: "36001234";
|
|
25
|
-
readonly BI: "79561234";
|
|
26
|
-
readonly BJ: "90011234";
|
|
27
|
-
readonly BL: "690001234";
|
|
28
|
-
readonly BM: "4413701234";
|
|
29
|
-
readonly BN: "7123456";
|
|
30
|
-
readonly BO: "71234567";
|
|
31
|
-
readonly BQ: "3181234";
|
|
32
|
-
readonly BR: "11961234567";
|
|
33
|
-
readonly BS: "2423591234";
|
|
34
|
-
readonly BT: "17123456";
|
|
35
|
-
readonly BW: "71123456";
|
|
36
|
-
readonly BY: "294911911";
|
|
37
|
-
readonly BZ: "6221234";
|
|
38
|
-
readonly CA: "5062345678";
|
|
39
|
-
readonly CC: "412345678";
|
|
40
|
-
readonly CD: "991234567";
|
|
41
|
-
readonly CF: "70012345";
|
|
42
|
-
readonly CG: "061234567";
|
|
43
|
-
readonly CH: "781234567";
|
|
44
|
-
readonly CI: "0123456789";
|
|
45
|
-
readonly CK: "71234";
|
|
46
|
-
readonly CL: "221234567";
|
|
47
|
-
readonly CM: "671234567";
|
|
48
|
-
readonly CN: "13123456789";
|
|
49
|
-
readonly CO: "3211234567";
|
|
50
|
-
readonly CR: "83123456";
|
|
51
|
-
readonly CU: "51234567";
|
|
52
|
-
readonly CV: "9911234";
|
|
53
|
-
readonly CW: "95181234";
|
|
54
|
-
readonly CX: "412345678";
|
|
55
|
-
readonly CY: "96123456";
|
|
56
|
-
readonly CZ: "601123456";
|
|
57
|
-
readonly DE: "15123456789";
|
|
58
|
-
readonly DJ: "77831001";
|
|
59
|
-
readonly DK: "32123456";
|
|
60
|
-
readonly DM: "7672251234";
|
|
61
|
-
readonly DO: "8092345678";
|
|
62
|
-
readonly DZ: "551234567";
|
|
63
|
-
readonly EC: "991234567";
|
|
64
|
-
readonly EE: "51234567";
|
|
65
|
-
readonly EG: "1001234567";
|
|
66
|
-
readonly EH: "650123456";
|
|
67
|
-
readonly ER: "7123456";
|
|
68
|
-
readonly ES: "612345678";
|
|
69
|
-
readonly ET: "911234567";
|
|
70
|
-
readonly FI: "412345678";
|
|
71
|
-
readonly FJ: "7012345";
|
|
72
|
-
readonly FK: "51234";
|
|
73
|
-
readonly FM: "3501234";
|
|
74
|
-
readonly FO: "211234";
|
|
75
|
-
readonly FR: "612345678";
|
|
76
|
-
readonly GA: "06031234";
|
|
77
|
-
readonly GB: "7400123456";
|
|
78
|
-
readonly GD: "4734031234";
|
|
79
|
-
readonly GE: "555123456";
|
|
80
|
-
readonly GF: "694201234";
|
|
81
|
-
readonly GG: "7781123456";
|
|
82
|
-
readonly GH: "231234567";
|
|
83
|
-
readonly GI: "57123456";
|
|
84
|
-
readonly GL: "221234";
|
|
85
|
-
readonly GM: "3012345";
|
|
86
|
-
readonly GN: "601123456";
|
|
87
|
-
readonly GP: "690001234";
|
|
88
|
-
readonly GQ: "222123456";
|
|
89
|
-
readonly GR: "6912345678";
|
|
90
|
-
readonly GT: "51234567";
|
|
91
|
-
readonly GU: "6713001234";
|
|
92
|
-
readonly GW: "955012345";
|
|
93
|
-
readonly GY: "6091234";
|
|
94
|
-
readonly HK: "51234567";
|
|
95
|
-
readonly HN: "91234567";
|
|
96
|
-
readonly HR: "921234567";
|
|
97
|
-
readonly HT: "34101234";
|
|
98
|
-
readonly HU: "201234567";
|
|
99
|
-
readonly ID: "812345678";
|
|
100
|
-
readonly IE: "850123456";
|
|
101
|
-
readonly IL: "502345678";
|
|
102
|
-
readonly IM: "7924123456";
|
|
103
|
-
readonly IN: "8123456789";
|
|
104
|
-
readonly IO: "3801234";
|
|
105
|
-
readonly IQ: "7912345678";
|
|
106
|
-
readonly IR: "9123456789";
|
|
107
|
-
readonly IS: "6111234";
|
|
108
|
-
readonly IT: "3123456789";
|
|
109
|
-
readonly JE: "7797712345";
|
|
110
|
-
readonly JM: "8762101234";
|
|
111
|
-
readonly JO: "790123456";
|
|
112
|
-
readonly JP: "9012345678";
|
|
113
|
-
readonly KE: "712123456";
|
|
114
|
-
readonly KG: "700123456";
|
|
115
|
-
readonly KH: "91234567";
|
|
116
|
-
readonly KI: "72001234";
|
|
117
|
-
readonly KM: "3212345";
|
|
118
|
-
readonly KN: "8697652917";
|
|
119
|
-
readonly KP: "1921234567";
|
|
120
|
-
readonly KR: "1020000000";
|
|
121
|
-
readonly KW: "50012345";
|
|
122
|
-
readonly KY: "3453231234";
|
|
123
|
-
readonly KZ: "7710009998";
|
|
124
|
-
readonly LA: "2023123456";
|
|
125
|
-
readonly LB: "71123456";
|
|
126
|
-
readonly LC: "7582845678";
|
|
127
|
-
readonly LI: "660234567";
|
|
128
|
-
readonly LK: "712345678";
|
|
129
|
-
readonly LR: "770123456";
|
|
130
|
-
readonly LS: "50123456";
|
|
131
|
-
readonly LT: "61234567";
|
|
132
|
-
readonly LU: "628123456";
|
|
133
|
-
readonly LV: "21234567";
|
|
134
|
-
readonly LY: "912345678";
|
|
135
|
-
readonly MA: "650123456";
|
|
136
|
-
readonly MC: "612345678";
|
|
137
|
-
readonly MD: "62112345";
|
|
138
|
-
readonly ME: "67622901";
|
|
139
|
-
readonly MF: "690001234";
|
|
140
|
-
readonly MG: "321234567";
|
|
141
|
-
readonly MH: "2351234";
|
|
142
|
-
readonly MK: "72345678";
|
|
143
|
-
readonly ML: "65012345";
|
|
144
|
-
readonly MM: "92123456";
|
|
145
|
-
readonly MN: "88123456";
|
|
146
|
-
readonly MO: "66123456";
|
|
147
|
-
readonly MP: "6702345678";
|
|
148
|
-
readonly MQ: "696201234";
|
|
149
|
-
readonly MR: "22123456";
|
|
150
|
-
readonly MS: "6644923456";
|
|
151
|
-
readonly MT: "96961234";
|
|
152
|
-
readonly MU: "52512345";
|
|
153
|
-
readonly MV: "7712345";
|
|
154
|
-
readonly MW: "991234567";
|
|
155
|
-
readonly MX: "12221234567";
|
|
156
|
-
readonly MY: "123456789";
|
|
157
|
-
readonly MZ: "821234567";
|
|
158
|
-
readonly NA: "811234567";
|
|
159
|
-
readonly NC: "751234";
|
|
160
|
-
readonly NE: "93123456";
|
|
161
|
-
readonly NF: "381234";
|
|
162
|
-
readonly NG: "8021234567";
|
|
163
|
-
readonly NI: "81234567";
|
|
164
|
-
readonly NL: "612345678";
|
|
165
|
-
readonly NO: "40612345";
|
|
166
|
-
readonly NP: "9841234567";
|
|
167
|
-
readonly NR: "5551234";
|
|
168
|
-
readonly NU: "8884012";
|
|
169
|
-
readonly NZ: "211234567";
|
|
170
|
-
readonly OM: "92123456";
|
|
171
|
-
readonly PA: "61234567";
|
|
172
|
-
readonly PE: "912345678";
|
|
173
|
-
readonly PF: "87123456";
|
|
174
|
-
readonly PG: "70123456";
|
|
175
|
-
readonly PH: "9051234567";
|
|
176
|
-
readonly PK: "3012345678";
|
|
177
|
-
readonly PL: "512345678";
|
|
178
|
-
readonly PM: "551234";
|
|
179
|
-
readonly PR: "7872345678";
|
|
180
|
-
readonly PS: "599123456";
|
|
181
|
-
readonly PT: "912345678";
|
|
182
|
-
readonly PW: "6201234";
|
|
183
|
-
readonly PY: "961456789";
|
|
184
|
-
readonly QA: "33123456";
|
|
185
|
-
readonly RE: "692123456";
|
|
186
|
-
readonly RO: "712034567";
|
|
187
|
-
readonly RS: "601234567";
|
|
188
|
-
readonly RU: "9123456789";
|
|
189
|
-
readonly RW: "720123456";
|
|
190
|
-
readonly SA: "512345678";
|
|
191
|
-
readonly SB: "7421234";
|
|
192
|
-
readonly SC: "2510123";
|
|
193
|
-
readonly SD: "911231234";
|
|
194
|
-
readonly SE: "701234567";
|
|
195
|
-
readonly SG: "81234567";
|
|
196
|
-
readonly SH: "51234";
|
|
197
|
-
readonly SI: "31234567";
|
|
198
|
-
readonly SJ: "41234567";
|
|
199
|
-
readonly SK: "912123456";
|
|
200
|
-
readonly SL: "25123456";
|
|
201
|
-
readonly SM: "66661212";
|
|
202
|
-
readonly SN: "701234567";
|
|
203
|
-
readonly SO: "71123456";
|
|
204
|
-
readonly SR: "7412345";
|
|
205
|
-
readonly SS: "977123456";
|
|
206
|
-
readonly ST: "9812345";
|
|
207
|
-
readonly SV: "70123456";
|
|
208
|
-
readonly SX: "7215205678";
|
|
209
|
-
readonly SY: "944567890";
|
|
210
|
-
readonly SZ: "76123456";
|
|
211
|
-
readonly TA: "8999";
|
|
212
|
-
readonly TC: "6492311234";
|
|
213
|
-
readonly TD: "63012345";
|
|
214
|
-
readonly TG: "90112345";
|
|
215
|
-
readonly TH: "812345678";
|
|
216
|
-
readonly TJ: "917123456";
|
|
217
|
-
readonly TK: "7290";
|
|
218
|
-
readonly TL: "77212345";
|
|
219
|
-
readonly TM: "66123456";
|
|
220
|
-
readonly TN: "20123456";
|
|
221
|
-
readonly TO: "7715123";
|
|
222
|
-
readonly TR: "5012345678";
|
|
223
|
-
readonly TT: "8682911234";
|
|
224
|
-
readonly TV: "901234";
|
|
225
|
-
readonly TW: "912345678";
|
|
226
|
-
readonly TZ: "621234567";
|
|
227
|
-
readonly UA: "501234567";
|
|
228
|
-
readonly UG: "712345678";
|
|
229
|
-
readonly US: "2015550123";
|
|
230
|
-
readonly UY: "94231234";
|
|
231
|
-
readonly UZ: "912345678";
|
|
232
|
-
readonly VA: "3123456789";
|
|
233
|
-
readonly VC: "7844301234";
|
|
234
|
-
readonly VE: "4121234567";
|
|
235
|
-
readonly VG: "2843001234";
|
|
236
|
-
readonly VI: "3406421234";
|
|
237
|
-
readonly VN: "912345678";
|
|
238
|
-
readonly VU: "5912345";
|
|
239
|
-
readonly WF: "821234";
|
|
240
|
-
readonly WS: "7212345";
|
|
241
|
-
readonly XK: "43201234";
|
|
242
|
-
readonly YE: "712345678";
|
|
243
|
-
readonly YT: "639012345";
|
|
244
|
-
readonly ZA: "711234567";
|
|
245
|
-
readonly ZM: "955123456";
|
|
246
|
-
readonly ZW: "712345678";
|
|
247
|
-
};
|
|
1
|
+
import type { Examples } from 'libphonenumber-js';
|
|
2
|
+
declare const _default: Examples;
|
|
248
3
|
export default _default;
|
|
@@ -36,8 +36,7 @@ const combinedOptions = {
|
|
|
36
36
|
...options
|
|
37
37
|
};
|
|
38
38
|
const handleInputAction = (value2) => {
|
|
39
|
-
if (disabled || readonly)
|
|
40
|
-
return;
|
|
39
|
+
if (disabled || readonly) return;
|
|
41
40
|
handleParsePhoneNumber(value2, country);
|
|
42
41
|
};
|
|
43
42
|
const updateCountry = (countryCode) => {
|
|
@@ -48,7 +47,8 @@ const updateCountry = (countryCode) => {
|
|
|
48
47
|
}
|
|
49
48
|
return country;
|
|
50
49
|
};
|
|
51
|
-
const handleParsePhoneNumber = (
|
|
50
|
+
const handleParsePhoneNumber = (rawInput, currCountry = null) => {
|
|
51
|
+
const input = rawInput;
|
|
52
52
|
if (input !== null) {
|
|
53
53
|
const numberHasCountry = getCountryForPartialE164Number(input);
|
|
54
54
|
if (numberHasCountry && numberHasCountry !== prevCountry) {
|
|
@@ -110,19 +110,25 @@ const countryChangeWatchFunction = () => {
|
|
|
110
110
|
countryWatchInitRun = false;
|
|
111
111
|
};
|
|
112
112
|
const countryChangeWatch = watcher(null, countryChangeWatchFunction);
|
|
113
|
-
$:
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
113
|
+
$: $countryChangeWatch = country;
|
|
114
|
+
$: getPlaceholder = combinedOptions.autoPlaceholder && country ? generatePlaceholder(country, {
|
|
115
|
+
format: combinedOptions.format,
|
|
116
|
+
spaces: combinedOptions.spaces
|
|
117
|
+
}) : placeholder;
|
|
118
|
+
$: if (value === null && inputValue !== null && detailedValue !== null) {
|
|
119
|
+
inputValue = null;
|
|
120
|
+
detailedValue = null;
|
|
121
|
+
dispatch("updateDetailedValue", detailedValue);
|
|
122
|
+
}
|
|
123
|
+
export const updateValue = (newValue, newCountry) => {
|
|
124
|
+
const castedValue = newValue;
|
|
125
|
+
if (castedValue) {
|
|
126
|
+
handleParsePhoneNumber(
|
|
127
|
+
castedValue,
|
|
128
|
+
getCountryForPartialE164Number(castedValue) || newCountry
|
|
129
|
+
);
|
|
125
130
|
}
|
|
131
|
+
};
|
|
126
132
|
onMount(() => {
|
|
127
133
|
if (value) {
|
|
128
134
|
handleParsePhoneNumber(value, getCountryForPartialE164Number(value) || country);
|
|
@@ -2,20 +2,21 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
import type { DetailedValue, CountryCode, E164Number, TelInputOptions } from '../../types';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
autocomplete?: string | null
|
|
6
|
-
/** You can set the classes of the input field*/ class?: string
|
|
7
|
-
/** You can disable the component and set the disabled attribute of the input field */ disabled?: boolean
|
|
8
|
-
/** You can set the id attribute of the input field */ id?: string
|
|
9
|
-
/** You can set the name attribute of the input field */ name?: string | null
|
|
10
|
-
/** It will overwrite the autoPlaceholder ! */ placeholder?: string | null
|
|
11
|
-
/** You can set the readonly attribute of the input field */ readonly?: boolean | null
|
|
12
|
-
/** Set the required attribute on the input element */ required?: boolean | null
|
|
13
|
-
/** You can set the size attribute of the input field */ size?: number | null
|
|
5
|
+
autocomplete?: string | null;
|
|
6
|
+
/** You can set the classes of the input field*/ class?: string;
|
|
7
|
+
/** You can disable the component and set the disabled attribute of the input field */ disabled?: boolean;
|
|
8
|
+
/** You can set the id attribute of the input field */ id?: string;
|
|
9
|
+
/** You can set the name attribute of the input field */ name?: string | null;
|
|
10
|
+
/** It will overwrite the autoPlaceholder ! */ placeholder?: string | null;
|
|
11
|
+
/** You can set the readonly attribute of the input field */ readonly?: boolean | null;
|
|
12
|
+
/** Set the required attribute on the input element */ required?: boolean | null;
|
|
13
|
+
/** You can set the size attribute of the input field */ size?: number | null;
|
|
14
14
|
/** The core value of the input, this is the only one what you can store. It's an E164 phone number.*/ value: E164Number | null;
|
|
15
15
|
/** It's accept any Country Code Alpha-2 (ISO 3166) */ country: CountryCode | null;
|
|
16
|
-
/** Detailed parse of the E164 phone number */ detailedValue?: Partial<DetailedValue> | null
|
|
17
|
-
/** Validity of the input based on the config settings.*/ valid?: boolean
|
|
18
|
-
/** You can turn on and off certain features by this object */ options?: TelInputOptions
|
|
16
|
+
/** Detailed parse of the E164 phone number */ detailedValue?: Partial<DetailedValue> | null;
|
|
17
|
+
/** Validity of the input based on the config settings.*/ valid?: boolean;
|
|
18
|
+
/** You can turn on and off certain features by this object */ options?: TelInputOptions;
|
|
19
|
+
updateValue?: (newValue: string | E164Number | null, newCountry: CountryCode | null) => void;
|
|
19
20
|
};
|
|
20
21
|
events: {
|
|
21
22
|
beforeinput: InputEvent;
|
|
@@ -42,5 +43,6 @@ export type TelInputProps = typeof __propDef.props;
|
|
|
42
43
|
export type TelInputEvents = typeof __propDef.events;
|
|
43
44
|
export type TelInputSlots = typeof __propDef.slots;
|
|
44
45
|
export default class TelInput extends SvelteComponentTyped<TelInputProps, TelInputEvents, TelInputSlots> {
|
|
46
|
+
get updateValue(): (newValue: string | E164Number | null, newCountry: CountryCode | null) => void;
|
|
45
47
|
}
|
|
46
48
|
export {};
|
package/dist/stores/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="svelte" />
|
|
2
1
|
export declare const watcher: (initialValue: string | null, watchFunction: (oldVal: string | null, newVal: string | null) => void) => {
|
|
3
2
|
subscribe: (this: void, run: import("svelte/store").Subscriber<string | null>, invalidate?: import("svelte/store").Invalidator<string | null> | undefined) => import("svelte/store").Unsubscriber;
|
|
4
3
|
set: (value: string | null) => void;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -39,11 +39,11 @@ export interface DetailedValue {
|
|
|
39
39
|
isValid: boolean;
|
|
40
40
|
phoneNumber: string | null;
|
|
41
41
|
countryCallingCode: CountryCallingCode | null;
|
|
42
|
-
formattedNumber:
|
|
43
|
-
formatOriginal:
|
|
44
|
-
nationalNumber:
|
|
45
|
-
formatInternational:
|
|
46
|
-
formatNational:
|
|
42
|
+
formattedNumber: E164Number | null;
|
|
43
|
+
formatOriginal: E164Number | null;
|
|
44
|
+
nationalNumber: E164Number | null;
|
|
45
|
+
formatInternational: E164Number | null;
|
|
46
|
+
formatNational: E164Number | null;
|
|
47
47
|
uri: string | null;
|
|
48
48
|
e164: E164Number | null;
|
|
49
49
|
error?: string;
|
package/dist/utils/helpers.d.ts
CHANGED
|
@@ -6,12 +6,12 @@ export declare const normalizeTelInput: (input?: PhoneNumber) => {
|
|
|
6
6
|
[k: string]: string | boolean | import("libphonenumber-js/types").NationalNumber | E164Number | import("libphonenumber-js/types").CountryCallingCode | null | undefined;
|
|
7
7
|
};
|
|
8
8
|
export declare const generatePlaceholder: (country: CountryCode, { format, spaces }?: {
|
|
9
|
-
format:
|
|
9
|
+
format: "international" | "national";
|
|
10
10
|
spaces: boolean;
|
|
11
11
|
}) => string;
|
|
12
12
|
export declare const isSelected: <T extends {
|
|
13
13
|
id: string;
|
|
14
|
-
}>(itemToSelect:
|
|
14
|
+
}>(itemToSelect: T | string, selectedItem: (T | undefined | null) | string) => boolean;
|
|
15
15
|
export declare const getInternationalPhoneNumberPrefix: (country: CountryCode) => string;
|
|
16
16
|
/**
|
|
17
17
|
* Trims phone number digits if they exceed the maximum possible length
|
|
@@ -32,9 +32,9 @@ export declare const getMaxNumberLength: (country: CountryCode) => number;
|
|
|
32
32
|
* @return {string?}
|
|
33
33
|
*/
|
|
34
34
|
export declare const getCountryForPartialE164Number: (partialE164Number: E164Number, { country, countries, required }?: {
|
|
35
|
-
country?: CountryCode
|
|
36
|
-
countries?: Countries[]
|
|
37
|
-
required?: boolean
|
|
35
|
+
country?: CountryCode;
|
|
36
|
+
countries?: Countries[];
|
|
37
|
+
required?: boolean;
|
|
38
38
|
}) => CountryCode | undefined;
|
|
39
39
|
/**
|
|
40
40
|
* Determines the country for a given (possibly incomplete) E.164 phone number.
|
|
@@ -67,7 +67,7 @@ export declare const isSupportedCountry: (country: CountryCode, metadata: Metada
|
|
|
67
67
|
* @returns {string}
|
|
68
68
|
*/
|
|
69
69
|
export declare const allowedCharacters: (character: string, { spaces }?: {
|
|
70
|
-
spaces?: boolean
|
|
70
|
+
spaces?: boolean;
|
|
71
71
|
}) => string;
|
|
72
72
|
export declare const inputParser: (text: string, { allowSpaces, parseCharacter }: {
|
|
73
73
|
allowSpaces: boolean;
|
package/dist/utils/helpers.js
CHANGED
|
@@ -224,35 +224,35 @@ export const allowedCharacters = (character, { spaces } = {
|
|
|
224
224
|
'7': '7',
|
|
225
225
|
'8': '8',
|
|
226
226
|
'9': '9',
|
|
227
|
-
'\uFF10': '0',
|
|
228
|
-
'\uFF11': '1',
|
|
229
|
-
'\uFF12': '2',
|
|
230
|
-
'\uFF13': '3',
|
|
231
|
-
'\uFF14': '4',
|
|
232
|
-
'\uFF15': '5',
|
|
233
|
-
'\uFF16': '6',
|
|
234
|
-
'\uFF17': '7',
|
|
235
|
-
'\uFF18': '8',
|
|
236
|
-
'\uFF19': '9',
|
|
237
|
-
'\u0660': '0',
|
|
238
|
-
'\u0661': '1',
|
|
239
|
-
'\u0662': '2',
|
|
240
|
-
'\u0663': '3',
|
|
241
|
-
'\u0664': '4',
|
|
242
|
-
'\u0665': '5',
|
|
243
|
-
'\u0666': '6',
|
|
244
|
-
'\u0667': '7',
|
|
245
|
-
'\u0668': '8',
|
|
246
|
-
'\u0669': '9',
|
|
247
|
-
'\u06F0': '0',
|
|
248
|
-
'\u06F1': '1',
|
|
249
|
-
'\u06F2': '2',
|
|
250
|
-
'\u06F3': '3',
|
|
251
|
-
'\u06F4': '4',
|
|
252
|
-
'\u06F5': '5',
|
|
253
|
-
'\u06F6': '6',
|
|
254
|
-
'\u06F7': '7',
|
|
255
|
-
'\u06F8': '8',
|
|
227
|
+
'\uFF10': '0', // Fullwidth digit 0
|
|
228
|
+
'\uFF11': '1', // Fullwidth digit 1
|
|
229
|
+
'\uFF12': '2', // Fullwidth digit 2
|
|
230
|
+
'\uFF13': '3', // Fullwidth digit 3
|
|
231
|
+
'\uFF14': '4', // Fullwidth digit 4
|
|
232
|
+
'\uFF15': '5', // Fullwidth digit 5
|
|
233
|
+
'\uFF16': '6', // Fullwidth digit 6
|
|
234
|
+
'\uFF17': '7', // Fullwidth digit 7
|
|
235
|
+
'\uFF18': '8', // Fullwidth digit 8
|
|
236
|
+
'\uFF19': '9', // Fullwidth digit 9
|
|
237
|
+
'\u0660': '0', // Arabic-indic digit 0
|
|
238
|
+
'\u0661': '1', // Arabic-indic digit 1
|
|
239
|
+
'\u0662': '2', // Arabic-indic digit 2
|
|
240
|
+
'\u0663': '3', // Arabic-indic digit 3
|
|
241
|
+
'\u0664': '4', // Arabic-indic digit 4
|
|
242
|
+
'\u0665': '5', // Arabic-indic digit 5
|
|
243
|
+
'\u0666': '6', // Arabic-indic digit 6
|
|
244
|
+
'\u0667': '7', // Arabic-indic digit 7
|
|
245
|
+
'\u0668': '8', // Arabic-indic digit 8
|
|
246
|
+
'\u0669': '9', // Arabic-indic digit 9
|
|
247
|
+
'\u06F0': '0', // Eastern-Arabic digit 0
|
|
248
|
+
'\u06F1': '1', // Eastern-Arabic digit 1
|
|
249
|
+
'\u06F2': '2', // Eastern-Arabic digit 2
|
|
250
|
+
'\u06F3': '3', // Eastern-Arabic digit 3
|
|
251
|
+
'\u06F4': '4', // Eastern-Arabic digit 4
|
|
252
|
+
'\u06F5': '5', // Eastern-Arabic digit 5
|
|
253
|
+
'\u06F6': '6', // Eastern-Arabic digit 6
|
|
254
|
+
'\u06F7': '7', // Eastern-Arabic digit 7
|
|
255
|
+
'\u06F8': '8', // Eastern-Arabic digit 8
|
|
256
256
|
'\u06F9': '9' // Eastern-Arabic digit 9,
|
|
257
257
|
};
|
|
258
258
|
// Allow spaces
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-tel-input",
|
|
3
3
|
"description": "svelte-tel-input",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.4.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/gyurielf/svelte-tel-input.git"
|
|
@@ -30,38 +30,39 @@
|
|
|
30
30
|
"svelte": "^3.58.0 || ^4.0.0"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"libphonenumber-js": "
|
|
33
|
+
"libphonenumber-js": "1.10.43"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@sveltejs/adapter-auto": "2.
|
|
37
|
-
"@sveltejs/kit": "^
|
|
38
|
-
"@sveltejs/package": "^2.
|
|
39
|
-
"@
|
|
40
|
-
"@testing-library/
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
43
|
-
"@typescript-eslint/
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"eslint
|
|
49
|
-
"eslint-
|
|
50
|
-
"eslint-plugin-
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"prettier
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"svelte
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
36
|
+
"@sveltejs/adapter-auto": "3.2.2",
|
|
37
|
+
"@sveltejs/kit": "^2.5.17",
|
|
38
|
+
"@sveltejs/package": "^2.3.2",
|
|
39
|
+
"@sveltejs/vite-plugin-svelte": "^3.1.1",
|
|
40
|
+
"@testing-library/svelte": "^5.1.0",
|
|
41
|
+
"@testing-library/user-event": "^14.5.2",
|
|
42
|
+
"@types/micromatch": "^4.0.8",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^7.14.1",
|
|
44
|
+
"@typescript-eslint/parser": "^7.14.1",
|
|
45
|
+
"autoprefixer": "^10.4.19",
|
|
46
|
+
"cssnano": "^7.0.3",
|
|
47
|
+
"dotenv": "^16.4.5",
|
|
48
|
+
"eslint": "^8.57.0",
|
|
49
|
+
"eslint-config-prettier": "^9.1.0",
|
|
50
|
+
"eslint-plugin-import": "^2.29.1",
|
|
51
|
+
"eslint-plugin-svelte": "^2.41.0",
|
|
52
|
+
"jsdom": "^24.1.0",
|
|
53
|
+
"micromatch": "^4.0.7",
|
|
54
|
+
"postcss": "^8.4.38",
|
|
55
|
+
"prettier": "^3.3.2",
|
|
56
|
+
"prettier-plugin-svelte": "^3.2.5",
|
|
57
|
+
"publint": "^0.2.8",
|
|
58
|
+
"svelte": "^4.2.18",
|
|
59
|
+
"svelte-check": "^3.8.4",
|
|
60
|
+
"svelte2tsx": "^0.7.13",
|
|
61
|
+
"tailwindcss": "^3.4.4",
|
|
62
|
+
"tslib": "^2.6.3",
|
|
63
|
+
"typescript": "^5.5.2",
|
|
64
|
+
"vite": "^5.3.1",
|
|
65
|
+
"vitest": "^1.6.0"
|
|
65
66
|
},
|
|
66
67
|
"type": "module",
|
|
67
68
|
"license": "MIT",
|
|
@@ -87,8 +88,7 @@
|
|
|
87
88
|
"exports": {
|
|
88
89
|
".": {
|
|
89
90
|
"types": "./dist/index.d.ts",
|
|
90
|
-
"svelte": "./dist/index.js"
|
|
91
|
-
"default": "./dist/index.js"
|
|
91
|
+
"svelte": "./dist/index.js"
|
|
92
92
|
},
|
|
93
93
|
"./types": {
|
|
94
94
|
"types": "./dist/types/index.d.ts",
|
|
@@ -113,8 +113,8 @@
|
|
|
113
113
|
"lint:fix": "pnpm run eslint:fix && pnpm run prettier:fix",
|
|
114
114
|
"package:watch": "svelte-kit sync && svelte-package --watch",
|
|
115
115
|
"package": "svelte-kit sync && pnpm run convert && svelte-package && pnpm run check:publint",
|
|
116
|
-
"prettier:check": "prettier --check
|
|
117
|
-
"prettier:fix": "prettier --write
|
|
116
|
+
"prettier:check": "prettier --check .",
|
|
117
|
+
"prettier:fix": "prettier --write .",
|
|
118
118
|
"svelte-check": "svelte-kit sync && svelte-check --ignore 'dist,build,coverage,.svelte-kit,package' --fail-on-warnings",
|
|
119
119
|
"sync": "svelte-kit sync",
|
|
120
120
|
"test": "vitest",
|