intl-tel-input 18.1.1 → 18.1.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.
@@ -8,7 +8,7 @@ In order to build the project, you will first need to install [npm](https://www.
8
8
 
9
9
  In most cases, you will only need to make changes to the JavaScript, in which case you can just run `npm run build:js` to build the JavaScript before committing.
10
10
 
11
- If you want to make changes to the CSS or the flags sprite, you will need to globally install a package called evenizer with `npm install -g evenizer` and then run `npm run build` to build all of the assets (warning: this can take a while), before committing.
11
+ If you want to make changes to the CSS or the flags sprite, you will need to globally install a package called evenizer with `npm install -g evenizer` and ImageMagick with `brew install imagemagick`, then run `npm run build` to build all of the assets (warning: this can take a while), before committing.
12
12
 
13
13
  ### Updating to a new version of libphonenumber
14
14
 
@@ -3,6 +3,5 @@
3
3
  "editor.formatOnPaste": false, // required
4
4
  "editor.formatOnType": false, // required
5
5
  "editor.formatOnSaveMode": "file", // required to format on save
6
- "files.autoSave": "onFocusChange", // optional but recommended
7
6
  "vs-code-prettier-eslint.prettierLast": "false" // set as "true" to run 'prettier' last not first
8
7
  }
package/README.md CHANGED
@@ -49,6 +49,23 @@ You can view [a live demo](https://intl-tel-input.com) and see some examples of
49
49
 
50
50
  _Note: In v12.0.0 we dropped support for IE9 and IE10, because they are [no longer supported](https://www.xfive.co/blog/stop-supporting-ie10-ie9-ie8/) by any version of Windows._
51
51
 
52
+ ## Getting Started (Using a CDN)
53
+ 1. Add the CSS
54
+ ```html
55
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/intl-tel-input@18.1.1/build/css/intlTelInput.css">
56
+ ```
57
+
58
+ 2. Add the plugin script and initialise it on your input element
59
+ ```html
60
+ <script src="https://cdn.jsdelivr.net/npm/intl-tel-input@18.1.1/build/js/intlTelInput.min.js"></script>
61
+ <script>
62
+ var input = document.querySelector("#phone");
63
+ window.intlTelInput(input, {
64
+ utilsScript: "https://cdn.jsdelivr.net/npm/intl-tel-input@18.1.1/build/js/utils.js",
65
+ });
66
+ </script>
67
+ ```
68
+
52
69
  ## Getting Started (Using a bundler e.g. Webpack)
53
70
  1. Install with npm: `npm install intl-tel-input --save` or yarn: `yarn add intl-tel-input`
54
71
 
@@ -69,16 +86,14 @@ _Note: In v12.0.0 we dropped support for IE9 and IE10, because they are [no long
69
86
 
70
87
  const input = document.querySelector("#phone");
71
88
  intlTelInput(input, {
72
- // any initialisation options go here
89
+ utilsScript: "path/to/utils.js"
73
90
  });
74
91
  ```
75
92
 
76
- 5. **Recommended:** initialise the plugin with the `utilsScript` option to enable formatting/validation, and to allow you to extract full international numbers using `getNumber`.
77
-
78
93
  ## Getting Started (Not using a bundler)
79
94
  1. Download the [latest release](https://github.com/jackocnr/intl-tel-input/releases/latest), or better yet install it with [npm](https://www.npmjs.com/package/intl-tel-input)
80
95
 
81
- 2. Include the stylesheet
96
+ 2. Add the stylesheet
82
97
  ```html
83
98
  <link rel="stylesheet" href="path/to/intlTelInput.css">
84
99
  ```
@@ -98,14 +113,11 @@ _Note: In v12.0.0 we dropped support for IE9 and IE10, because they are [no long
98
113
  <script>
99
114
  var input = document.querySelector("#phone");
100
115
  window.intlTelInput(input, {
101
- // any initialisation options go here
116
+ utilsScript: "path/to/utils.js"
102
117
  });
103
118
  </script>
104
119
  ```
105
120
 
106
- 5. **Recommended:** initialise the plugin with the `utilsScript` option to enable formatting/validation, and to allow you to extract full international numbers using `getNumber`.
107
-
108
-
109
121
  ## Recommended Usage
110
122
  We highly recommend you (lazy) load the included utils.js using the `utilsScript` option. Then the plugin is built to always deal with numbers in the full international format (e.g. "+17024181234") and convert them accordingly - even when `nationalMode` or `separateDialCode` is enabled. We recommend you get, store, and set numbers exclusively in this format for simplicity - then you don't have to deal with handling the country code separately, as full international numbers include the country code information.
111
123
 
@@ -187,10 +199,20 @@ If you leave `initialCountry` blank, it will default to the first country in the
187
199
 
188
200
  **localizedCountries**
189
201
  Type: `Object` Default: `{}`
190
- Allows to translate the countries by its given iso code e.g.:
202
+ Allow localisation of country names. For each country, the key should be the iso2 country code, and the value should be the localised country name. [See example](https://intl-tel-input.com/examples/localise-countries.html).
191
203
 
192
204
  ```js
193
- { 'de': 'Deutschland' }
205
+ // Country names in German
206
+ {
207
+ fr: "Frankreich",
208
+ de: "Deutschland",
209
+ es: "Spanien",
210
+ it: "Italien",
211
+ ch: "Schweiz",
212
+ nl: "Niederlande",
213
+ at: "Österreich",
214
+ dk: "Dänemark",
215
+ }
194
216
  ```
195
217
 
196
218
  **nationalMode**
@@ -317,7 +339,7 @@ iti.setPlaceholderNumberType("FIXED_LINE");
317
339
  ## Static Methods
318
340
 
319
341
  **getCountryData**
320
- Get all of the plugin's country data - either to re-use elsewhere e.g. to populate a country dropdown - [see example](https://intl-tel-input.com/examples/country-sync.html), or to modify - [see example](https://intl-tel-input.com/examples/modify-country-data.html). Note that any modifications must be done before initialising the plugin.
342
+ Retrieve the plugin's country data - either to re-use elsewhere e.g. to generate your own country dropdown - [see example](https://intl-tel-input.com/examples/country-sync.html), or alternatively, you could use it to modify the country data. Note that any modifications must be done before initialising the plugin.
321
343
  ```js
322
344
  var countryData = window.intlTelInputGlobals.getCountryData();
323
345
  ```
@@ -1,19 +1,18 @@
1
1
  * {
2
2
  box-sizing: border-box;
3
- -moz-box-sizing: border-box; }
3
+ }
4
4
 
5
5
  body {
6
6
  margin: 20px;
7
7
  font-size: 14px;
8
- font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
9
- color: #555; }
10
-
11
- .iti__hide {
12
- display: none; }
8
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
9
+ color: #555;
10
+ }
13
11
 
14
12
  pre {
15
13
  margin: 0 !important;
16
- display: inline-block; }
14
+ display: inline-block;
15
+ }
17
16
 
18
17
  .token.operator,
19
18
  .token.entity,
@@ -21,42 +20,42 @@ pre {
21
20
  .language-css .token.string,
22
21
  .style .token.string,
23
22
  .token.variable {
24
- background: none; }
23
+ background: none;
24
+ }
25
25
 
26
- input, button {
26
+ input,
27
+ button {
27
28
  height: 35px;
28
29
  margin: 0;
29
30
  padding: 6px 12px;
30
31
  border-radius: 2px;
31
32
  font-family: inherit;
32
33
  font-size: 100%;
33
- color: inherit; }
34
- input[disabled], button[disabled] {
35
- background-color: #eee; }
36
-
37
- input, select {
38
- border: 1px solid #CCC;
39
- width: 250px; }
40
-
41
- ::-webkit-input-placeholder {
42
- color: #BBB; }
43
-
44
- ::-moz-placeholder {
45
- /* Firefox 19+ */
46
- color: #BBB;
47
- opacity: 1; }
48
-
34
+ color: inherit;
35
+ }
36
+ input[disabled],
37
+ button[disabled] {
38
+ background-color: #eee;
39
+ }
40
+
41
+ input,
42
+ select {
43
+ border: 1px solid #ccc;
44
+ width: 250px;
45
+ }
46
+
47
+ ::placeholder,
49
48
  :-ms-input-placeholder {
50
- color: #BBB; }
49
+ color: #bbb;
50
+ }
51
51
 
52
52
  button {
53
- color: #FFF;
54
- background-color: #428BCA;
55
- border: 1px solid #357EBD; }
56
- button:hover {
57
- background-color: #3276B1;
58
- border-color: #285E8E;
59
- cursor: pointer; }
60
-
61
- #result {
62
- margin-bottom: 100px; }
53
+ color: #fff;
54
+ background-color: #428bca;
55
+ border: 1px solid #357ebd;
56
+ }
57
+ button:hover {
58
+ background-color: #3276b1;
59
+ border-color: #285e8e;
60
+ cursor: pointer;
61
+ }