intl-tel-input 18.1.0 → 18.1.2
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/.eslintrc +2 -8
- package/.github/CONTRIBUTING.md +1 -1
- package/.vscode/settings.json +7 -0
- package/CHANGELOG.md +3 -0
- package/Gruntfile.js +0 -2
- package/README.md +46 -35
- package/build/css/demo.css +16 -27
- package/build/css/intlTelInput.css +19 -9
- package/build/css/intlTelInput.min.css +1 -1
- package/build/js/data.js +2 -2
- package/build/js/data.min.js +2 -2
- package/build/js/intlTelInput-jquery.js +161 -60
- package/build/js/intlTelInput-jquery.min.js +3 -3
- package/build/js/intlTelInput.js +161 -60
- package/build/js/intlTelInput.min.js +3 -3
- package/composer.json +1 -1
- package/demo.html +42 -44
- package/demo_rtl.html +21 -23
- package/grunt/template.js +2 -265
- package/package.json +5 -2
- package/src/css/demo.scss +13 -29
- package/src/css/intlTelInput.scss +21 -21
- package/src/js/data.js +1 -1
- package/src/js/intlTelInput.js +563 -333
- package/examples/css/countrySync.css +0 -10
- package/examples/css/isValidNumber.css +0 -12
- package/examples/css/prism.css +0 -126
- package/examples/gen/country-sync.html +0 -98
- package/examples/gen/default-country-ip.html +0 -62
- package/examples/gen/display-number.html +0 -47
- package/examples/gen/hidden-input.html +0 -54
- package/examples/gen/init-promise.html +0 -66
- package/examples/gen/is-valid-number.html +0 -86
- package/examples/gen/js/countrySync.js +0 -31
- package/examples/gen/js/defaultCountryIp.js +0 -11
- package/examples/gen/js/displayNumber.js +0 -4
- package/examples/gen/js/hiddenInput.js +0 -5
- package/examples/gen/js/initPromise.js +0 -9
- package/examples/gen/js/isValidNumber.js +0 -37
- package/examples/gen/js/modifyCountryData.js +0 -11
- package/examples/gen/js/multipleInstances.js +0 -13
- package/examples/gen/js/nationalMode.js +0 -18
- package/examples/gen/js/onlyCountriesEurope.js +0 -8
- package/examples/gen/modify-country-data.html +0 -52
- package/examples/gen/multiple-instances.html +0 -60
- package/examples/gen/national-mode.html +0 -63
- package/examples/gen/only-countries-europe.html +0 -49
- package/examples/js/countrySync.js.ejs +0 -31
- package/examples/js/defaultCountryIp.js.ejs +0 -11
- package/examples/js/displayNumber.js.ejs +0 -4
- package/examples/js/hiddenInput.js.ejs +0 -5
- package/examples/js/initPromise.js.ejs +0 -9
- package/examples/js/isValidNumber.js.ejs +0 -37
- package/examples/js/modifyCountryData.js.ejs +0 -11
- package/examples/js/multipleInstances.js.ejs +0 -13
- package/examples/js/nationalMode.js.ejs +0 -18
- package/examples/js/onlyCountriesEurope.js.ejs +0 -8
- package/examples/js/prism.js +0 -11
- package/examples/partials/countrySync.html +0 -13
- package/examples/partials/defaultCountryIp.html +0 -5
- package/examples/partials/displayNumber.html +0 -1
- package/examples/partials/hiddenInput.html +0 -4
- package/examples/partials/initPromise.html +0 -8
- package/examples/partials/isValidNumber.html +0 -3
- package/examples/partials/multipleInstances.html +0 -3
- package/examples/partials/nationalMode.html +0 -2
- package/examples/partials/simpleInput.html +0 -1
- package/examples/template.html.ejs +0 -43
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intl-tel-input",
|
|
3
|
-
"version": "18.1.
|
|
3
|
+
"version": "18.1.2",
|
|
4
4
|
"description": "A JavaScript plugin for entering and validating international telephone numbers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"international",
|
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
"babel-eslint": "^9.0.0",
|
|
22
22
|
"custom-event-polyfill": "^1.0.6",
|
|
23
23
|
"es6-promise": "^4.2.5",
|
|
24
|
+
"eslint": "^8.38.0",
|
|
24
25
|
"eslint-config-airbnb": "^17.1.0",
|
|
26
|
+
"eslint-config-prettier": "^8.8.0",
|
|
25
27
|
"eslint-plugin-import": "^2.14.0",
|
|
26
28
|
"eslint-plugin-jsx-a11y": "^6.1.1",
|
|
27
29
|
"eslint-plugin-react": "^7.11.1",
|
|
@@ -32,7 +34,7 @@
|
|
|
32
34
|
"grunt-cli": "^1.2.0",
|
|
33
35
|
"grunt-contrib-concat": "^1.0.1",
|
|
34
36
|
"grunt-contrib-cssmin": "^2.2.1",
|
|
35
|
-
"grunt-contrib-imagemin": "^
|
|
37
|
+
"grunt-contrib-imagemin": "^4.0.0",
|
|
36
38
|
"grunt-contrib-jasmine": "^3.0.0",
|
|
37
39
|
"grunt-contrib-uglify": "^2.1.0",
|
|
38
40
|
"grunt-contrib-watch": "^1.1.0",
|
|
@@ -48,6 +50,7 @@
|
|
|
48
50
|
"jquery": "^3.1.1",
|
|
49
51
|
"load-grunt-config": "^0.19.2",
|
|
50
52
|
"node-sass": "^6.0.1",
|
|
53
|
+
"prettier": "^2.8.7",
|
|
51
54
|
"region-flags": "^1.1.0",
|
|
52
55
|
"time-grunt": "^1.4.0"
|
|
53
56
|
},
|
package/src/css/demo.scss
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
* {
|
|
2
2
|
box-sizing: border-box;
|
|
3
|
-
-moz-box-sizing: border-box;
|
|
4
3
|
}
|
|
5
|
-
|
|
6
4
|
body {
|
|
7
5
|
margin: 20px;
|
|
8
|
-
|
|
9
6
|
font-size: 14px;
|
|
10
|
-
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
|
|
7
|
+
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
11
8
|
color: #555;
|
|
12
9
|
}
|
|
13
10
|
|
|
14
|
-
.iti__hide {
|
|
15
|
-
display: none;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
11
|
// example code blocks
|
|
19
12
|
pre {
|
|
20
13
|
margin: 0 !important; // override prism.css
|
|
@@ -31,7 +24,8 @@ pre {
|
|
|
31
24
|
}
|
|
32
25
|
|
|
33
26
|
// general form styling
|
|
34
|
-
input,
|
|
27
|
+
input,
|
|
28
|
+
button {
|
|
35
29
|
height: 35px;
|
|
36
30
|
margin: 0;
|
|
37
31
|
padding: 6px 12px;
|
|
@@ -48,34 +42,24 @@ input, button {
|
|
|
48
42
|
}
|
|
49
43
|
|
|
50
44
|
// select useful for examples
|
|
51
|
-
input,
|
|
52
|
-
|
|
45
|
+
input,
|
|
46
|
+
select {
|
|
47
|
+
border: 1px solid #ccc;
|
|
53
48
|
width: 250px;
|
|
54
49
|
}
|
|
55
|
-
|
|
56
|
-
color: #BBB;
|
|
57
|
-
}
|
|
58
|
-
::-moz-placeholder { /* Firefox 19+ */
|
|
59
|
-
color: #BBB;
|
|
60
|
-
opacity: 1;
|
|
61
|
-
}
|
|
50
|
+
::placeholder,
|
|
62
51
|
:-ms-input-placeholder {
|
|
63
|
-
|
|
52
|
+
color: #bbb;
|
|
64
53
|
}
|
|
65
54
|
|
|
66
55
|
// borrowed from bootstrap
|
|
67
56
|
button {
|
|
68
|
-
color: #
|
|
69
|
-
background-color: #
|
|
70
|
-
border: 1px solid #
|
|
57
|
+
color: #fff;
|
|
58
|
+
background-color: #428bca;
|
|
59
|
+
border: 1px solid #357ebd;
|
|
71
60
|
&:hover {
|
|
72
|
-
background-color: #
|
|
73
|
-
border-color: #
|
|
61
|
+
background-color: #3276b1;
|
|
62
|
+
border-color: #285e8e;
|
|
74
63
|
cursor: pointer;
|
|
75
64
|
}
|
|
76
65
|
}
|
|
77
|
-
|
|
78
|
-
// examples
|
|
79
|
-
#result {
|
|
80
|
-
margin-bottom: 100px;
|
|
81
|
-
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// the border-highlighting some browsers give the input on focus
|
|
7
7
|
$hoverColor: rgba(0, 0, 0, 0.05) !default;
|
|
8
8
|
$greyText: #999 !default;
|
|
9
|
-
$greyBorder: #
|
|
9
|
+
$greyBorder: #ccc !default;
|
|
10
10
|
|
|
11
11
|
$flagHeight: 15px !default;
|
|
12
12
|
$flagWidth: 20px !default;
|
|
@@ -17,13 +17,14 @@ $borderWidth: 1px !default;
|
|
|
17
17
|
|
|
18
18
|
$arrowHeight: 4px !default;
|
|
19
19
|
$arrowWidth: 6px !default;
|
|
20
|
-
$triangleBorder:
|
|
21
|
-
$arrowPadding:
|
|
20
|
+
$triangleBorder: $arrowWidth / 2 !default;
|
|
21
|
+
$arrowPadding: $arrowWidth !default;
|
|
22
22
|
$arrowColor: #555 !default;
|
|
23
23
|
|
|
24
24
|
$inputPadding: 6px !default;
|
|
25
25
|
$selectedFlagWidth: $flagWidth + (2 * $flagPadding) !default;
|
|
26
|
-
$selectedFlagArrowWidth: $flagWidth + $flagPadding + $arrowWidth +
|
|
26
|
+
$selectedFlagArrowWidth: $flagWidth + $flagPadding + $arrowWidth +
|
|
27
|
+
(2 * $arrowPadding) !default;
|
|
27
28
|
|
|
28
29
|
// image related variables
|
|
29
30
|
$flagsImagePath: "../img/" !default;
|
|
@@ -55,7 +56,9 @@ $mobilePopupMargin: 30px !default;
|
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
// specify types to increase specificity e.g. to override bootstrap v2.3
|
|
58
|
-
input,
|
|
59
|
+
input,
|
|
60
|
+
input[type="text"],
|
|
61
|
+
input[type="tel"] {
|
|
59
62
|
position: relative;
|
|
60
63
|
// input is bottom level, below selected flag and dropdown
|
|
61
64
|
z-index: 0;
|
|
@@ -110,7 +113,7 @@ $mobilePopupMargin: 30px !default;
|
|
|
110
113
|
border-right: $triangleBorder solid transparent;
|
|
111
114
|
border-top: $arrowHeight solid $arrowColor;
|
|
112
115
|
|
|
113
|
-
[dir=rtl] & {
|
|
116
|
+
[dir="rtl"] & {
|
|
114
117
|
margin-right: $arrowPadding;
|
|
115
118
|
margin-left: 0;
|
|
116
119
|
}
|
|
@@ -140,7 +143,7 @@ $mobilePopupMargin: 30px !default;
|
|
|
140
143
|
// margin-left to compensate for the padding on the parent
|
|
141
144
|
margin: 0 0 0 (-$borderWidth);
|
|
142
145
|
|
|
143
|
-
box-shadow: 1px 1px 4px rgba(0,0,0,0.2);
|
|
146
|
+
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
|
|
144
147
|
background-color: white;
|
|
145
148
|
border: $borderWidth solid $greyBorder;
|
|
146
149
|
|
|
@@ -192,23 +195,27 @@ $mobilePopupMargin: 30px !default;
|
|
|
192
195
|
}
|
|
193
196
|
|
|
194
197
|
// spacing between country flag, name and dial code
|
|
195
|
-
&__flag-box,
|
|
198
|
+
&__flag-box,
|
|
199
|
+
&__country-name {
|
|
196
200
|
margin-right: 6px;
|
|
197
201
|
|
|
198
|
-
[dir=rtl] & {
|
|
202
|
+
[dir="rtl"] & {
|
|
199
203
|
margin-right: 0;
|
|
200
204
|
margin-left: 6px;
|
|
201
205
|
}
|
|
202
206
|
}
|
|
203
207
|
|
|
204
208
|
// these settings are independent of each other, but both move selected flag to left of input
|
|
205
|
-
&--allow-dropdown,
|
|
206
|
-
|
|
209
|
+
&--allow-dropdown,
|
|
210
|
+
&--separate-dial-code {
|
|
211
|
+
input,
|
|
212
|
+
input[type="text"],
|
|
213
|
+
input[type="tel"] {
|
|
207
214
|
padding-right: $inputPadding;
|
|
208
215
|
padding-left: $selectedFlagArrowWidth + $inputPadding;
|
|
209
216
|
margin-left: 0;
|
|
210
217
|
|
|
211
|
-
[dir=rtl] & {
|
|
218
|
+
[dir="rtl"] & {
|
|
212
219
|
padding-right: $selectedFlagArrowWidth + $inputPadding;
|
|
213
220
|
padding-left: $inputPadding;
|
|
214
221
|
margin-right: 0;
|
|
@@ -218,7 +225,7 @@ $mobilePopupMargin: 30px !default;
|
|
|
218
225
|
right: auto;
|
|
219
226
|
left: 0;
|
|
220
227
|
|
|
221
|
-
[dir=rtl] & {
|
|
228
|
+
[dir="rtl"] & {
|
|
222
229
|
right: 0;
|
|
223
230
|
left: auto;
|
|
224
231
|
}
|
|
@@ -288,11 +295,6 @@ $mobilePopupMargin: 30px !default;
|
|
|
288
295
|
}
|
|
289
296
|
}
|
|
290
297
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
298
|
@import "sprite";
|
|
297
299
|
|
|
298
300
|
.iti__flag {
|
|
@@ -301,7 +303,7 @@ $mobilePopupMargin: 30px !default;
|
|
|
301
303
|
background-image: url("#{$flagsImagePath}#{$flagsImageName}.#{$flagsImageExtension}");
|
|
302
304
|
background-repeat: no-repeat;
|
|
303
305
|
// empty state
|
|
304
|
-
background-color: #
|
|
306
|
+
background-color: #dbdbdb;
|
|
305
307
|
background-position: $flagWidth 0;
|
|
306
308
|
|
|
307
309
|
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
@@ -309,8 +311,6 @@ $mobilePopupMargin: 30px !default;
|
|
|
309
311
|
}
|
|
310
312
|
}
|
|
311
313
|
|
|
312
|
-
|
|
313
|
-
|
|
314
314
|
// hack for Nepal which is the only flag that is not square/rectangle, so it has transparency, so you can see the default grey behind it
|
|
315
315
|
.iti__flag.iti__np {
|
|
316
316
|
background-color: transparent;
|
package/src/js/data.js
CHANGED
|
@@ -220,7 +220,7 @@ var allCountries = [
|
|
|
220
220
|
"ca",
|
|
221
221
|
"1",
|
|
222
222
|
1,
|
|
223
|
-
["204", "226", "236", "249", "250", "289", "306", "343", "365", "367", "368", "387", "403", "416", "418", "431", "437", "438", "450", "474", "506", "514", "519", "548", "579", "581", "584", "587", "604", "613", "639", "647", "672", "705", "709", "742", "778", "780", "782", "807", "819", "825", "867", "873", "902", "905"]
|
|
223
|
+
["204", "226", "236", "249", "250", "263", "289", "306", "343", "354", "365", "367", "368", "382", "387", "403", "416", "418", "428", "431", "437", "438", "450", "584", "468", "474", "506", "514", "519", "548", "579", "581", "584", "587", "604", "613", "639", "647", "672", "683", "705", "709", "742", "753", "778", "780", "782", "807", "819", "825", "867", "873", "902", "905"]
|
|
224
224
|
],
|
|
225
225
|
[
|
|
226
226
|
"Cape Verde (Kabu Verdi)",
|