intl-tel-input 25.15.0 → 26.0.0-beta.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.
Files changed (214) hide show
  1. package/README.md +22 -38
  2. package/angular/build/IntlTelInput.js +78 -324
  3. package/angular/build/IntlTelInputWithUtils.js +78 -324
  4. package/angular/build/types/intl-tel-input/i18n/ar/index.d.ts +3 -6
  5. package/angular/build/types/intl-tel-input/i18n/bg/index.d.ts +3 -6
  6. package/angular/build/types/intl-tel-input/i18n/bn/index.d.ts +3 -6
  7. package/angular/build/types/intl-tel-input/i18n/bs/index.d.ts +3 -6
  8. package/angular/build/types/intl-tel-input/i18n/ca/index.d.ts +3 -6
  9. package/angular/build/types/intl-tel-input/i18n/cs/index.d.ts +3 -6
  10. package/angular/build/types/intl-tel-input/i18n/da/index.d.ts +3 -6
  11. package/angular/build/types/intl-tel-input/i18n/de/index.d.ts +3 -6
  12. package/angular/build/types/intl-tel-input/i18n/ee/index.d.ts +3 -6
  13. package/angular/build/types/intl-tel-input/i18n/el/index.d.ts +3 -6
  14. package/angular/build/types/intl-tel-input/i18n/en/index.d.ts +3 -6
  15. package/angular/build/types/intl-tel-input/i18n/es/index.d.ts +3 -6
  16. package/angular/build/types/intl-tel-input/i18n/fa/index.d.ts +3 -6
  17. package/angular/build/types/intl-tel-input/i18n/fi/index.d.ts +3 -6
  18. package/angular/build/types/intl-tel-input/i18n/fr/index.d.ts +3 -6
  19. package/angular/build/types/intl-tel-input/i18n/hi/index.d.ts +3 -6
  20. package/angular/build/types/intl-tel-input/i18n/hr/index.d.ts +3 -6
  21. package/angular/build/types/intl-tel-input/i18n/hu/index.d.ts +3 -6
  22. package/angular/build/types/intl-tel-input/i18n/id/index.d.ts +3 -6
  23. package/angular/build/types/intl-tel-input/i18n/index.d.ts +43 -43
  24. package/angular/build/types/intl-tel-input/i18n/it/index.d.ts +3 -6
  25. package/angular/build/types/intl-tel-input/i18n/ja/index.d.ts +3 -6
  26. package/angular/build/types/intl-tel-input/i18n/ko/index.d.ts +3 -6
  27. package/angular/build/types/intl-tel-input/i18n/lt/index.d.ts +3 -6
  28. package/angular/build/types/intl-tel-input/i18n/mr/index.d.ts +3 -6
  29. package/angular/build/types/intl-tel-input/i18n/nl/index.d.ts +3 -6
  30. package/angular/build/types/intl-tel-input/i18n/no/index.d.ts +3 -6
  31. package/angular/build/types/intl-tel-input/i18n/pl/index.d.ts +3 -6
  32. package/angular/build/types/intl-tel-input/i18n/pt/index.d.ts +3 -6
  33. package/angular/build/types/intl-tel-input/i18n/ro/index.d.ts +3 -6
  34. package/angular/build/types/intl-tel-input/i18n/ru/index.d.ts +3 -6
  35. package/angular/build/types/intl-tel-input/i18n/sk/index.d.ts +3 -6
  36. package/angular/build/types/intl-tel-input/i18n/sl/index.d.ts +3 -6
  37. package/angular/build/types/intl-tel-input/i18n/sq/index.d.ts +3 -6
  38. package/angular/build/types/intl-tel-input/i18n/sr/index.d.ts +3 -6
  39. package/angular/build/types/intl-tel-input/i18n/sv/index.d.ts +3 -6
  40. package/angular/build/types/intl-tel-input/i18n/te/index.d.ts +3 -6
  41. package/angular/build/types/intl-tel-input/i18n/th/index.d.ts +3 -6
  42. package/angular/build/types/intl-tel-input/i18n/tr/index.d.ts +3 -6
  43. package/angular/build/types/intl-tel-input/i18n/types.d.ts +2 -4
  44. package/angular/build/types/intl-tel-input/i18n/uk/index.d.ts +3 -6
  45. package/angular/build/types/intl-tel-input/i18n/ur/index.d.ts +3 -6
  46. package/angular/build/types/intl-tel-input/i18n/uz/index.d.ts +3 -6
  47. package/angular/build/types/intl-tel-input/i18n/vi/index.d.ts +3 -6
  48. package/angular/build/types/intl-tel-input/i18n/zh/index.d.ts +3 -6
  49. package/angular/build/types/intl-tel-input.d.ts +1 -1
  50. package/angular/build/types/modules/constants.d.ts +1 -1
  51. package/angular/build/types/modules/core/icons.d.ts +2 -0
  52. package/angular/build/types/modules/core/options.d.ts +1 -2
  53. package/angular/build/types/modules/core/ui.d.ts +2 -3
  54. package/angular/build/types/modules/data/country-data.d.ts +2 -2
  55. package/angular/build/types/modules/format/formatting.d.ts +2 -2
  56. package/angular/build/types/modules/types/public-api.d.ts +3 -1
  57. package/build/css/demo.css +1 -3
  58. package/build/css/intlTelInput-no-assets.css +17 -19
  59. package/build/css/intlTelInput-no-assets.min.css +1 -1
  60. package/build/css/intlTelInput.css +18 -21
  61. package/build/css/intlTelInput.min.css +1 -1
  62. package/build/js/data.js +1 -1
  63. package/build/js/data.min.js +1 -1
  64. package/build/js/i18n/ar/index.js +23 -5
  65. package/build/js/i18n/bg/index.js +17 -5
  66. package/build/js/i18n/bn/index.js +17 -5
  67. package/build/js/i18n/bs/index.js +23 -5
  68. package/build/js/i18n/ca/index.js +17 -5
  69. package/build/js/i18n/cs/index.js +20 -5
  70. package/build/js/i18n/da/index.js +17 -5
  71. package/build/js/i18n/de/index.js +17 -5
  72. package/build/js/i18n/ee/index.js +17 -5
  73. package/build/js/i18n/el/index.js +17 -5
  74. package/build/js/i18n/en/index.js +18 -5
  75. package/build/js/i18n/es/index.js +17 -5
  76. package/build/js/i18n/fa/index.js +17 -5
  77. package/build/js/i18n/fi/index.js +17 -5
  78. package/build/js/i18n/fr/index.js +17 -5
  79. package/build/js/i18n/hi/index.js +17 -5
  80. package/build/js/i18n/hr/index.js +23 -5
  81. package/build/js/i18n/hu/index.js +17 -5
  82. package/build/js/i18n/id/index.js +17 -5
  83. package/build/js/i18n/index.js +43 -43
  84. package/build/js/i18n/it/index.js +17 -5
  85. package/build/js/i18n/ja/index.js +17 -5
  86. package/build/js/i18n/ko/index.js +17 -5
  87. package/build/js/i18n/lt/index.js +26 -5
  88. package/build/js/i18n/mr/index.js +17 -5
  89. package/build/js/i18n/nl/index.js +17 -5
  90. package/build/js/i18n/no/index.js +17 -5
  91. package/build/js/i18n/pl/index.js +21 -5
  92. package/build/js/i18n/pt/index.js +17 -5
  93. package/build/js/i18n/ro/index.js +21 -5
  94. package/build/js/i18n/ru/index.js +23 -5
  95. package/build/js/i18n/sk/index.js +23 -5
  96. package/build/js/i18n/sl/index.js +25 -5
  97. package/build/js/i18n/sq/index.js +18 -5
  98. package/build/js/i18n/sr/index.js +24 -5
  99. package/build/js/i18n/sv/index.js +17 -5
  100. package/build/js/i18n/te/index.js +17 -5
  101. package/build/js/i18n/th/index.js +17 -5
  102. package/build/js/i18n/tr/index.js +17 -5
  103. package/build/js/i18n/uk/index.js +23 -5
  104. package/build/js/i18n/ur/index.js +17 -5
  105. package/build/js/i18n/uz/index.js +17 -5
  106. package/build/js/i18n/vi/index.js +17 -5
  107. package/build/js/i18n/zh/index.js +17 -5
  108. package/build/js/intlTelInput.d.ts +118 -677
  109. package/build/js/intlTelInput.js +79 -329
  110. package/build/js/intlTelInput.min.js +8 -4
  111. package/build/js/intlTelInputWithUtils.js +79 -329
  112. package/build/js/intlTelInputWithUtils.min.js +7 -3
  113. package/package.json +10 -4
  114. package/react/build/IntlTelInput.cjs +78 -328
  115. package/react/build/IntlTelInput.d.ts +118 -677
  116. package/react/build/IntlTelInput.js +78 -328
  117. package/react/build/IntlTelInputWithUtils.cjs +78 -328
  118. package/react/build/IntlTelInputWithUtils.js +78 -328
  119. package/svelte/build/IntlTelInput.mjs +1170 -1413
  120. package/svelte/build/IntlTelInputWithUtils.mjs +935 -1178
  121. package/vue/build/exports/IntlTelInput.mjs +1 -1
  122. package/vue/build/exports/IntlTelInputWithUtils.mjs +1 -1
  123. package/vue/build/{intl-tel-input-Db39yQmC.mjs → intl-tel-input-BY4WpieT.mjs} +136 -138
  124. package/vue/build/modules/core/ui.d.ts +0 -1
  125. package/vue/build/modules/format/formatting.d.ts +1 -1
  126. package/vue/build/modules/types/public-api.d.ts +2 -1
  127. package/build/js/i18n/ar/countries.js +0 -245
  128. package/build/js/i18n/ar/interface.js +0 -23
  129. package/build/js/i18n/bg/countries.js +0 -245
  130. package/build/js/i18n/bg/interface.js +0 -13
  131. package/build/js/i18n/bn/countries.js +0 -245
  132. package/build/js/i18n/bn/interface.js +0 -13
  133. package/build/js/i18n/bs/countries.js +0 -245
  134. package/build/js/i18n/bs/interface.js +0 -20
  135. package/build/js/i18n/ca/countries.js +0 -245
  136. package/build/js/i18n/ca/interface.js +0 -13
  137. package/build/js/i18n/cs/countries.js +0 -245
  138. package/build/js/i18n/cs/interface.js +0 -20
  139. package/build/js/i18n/da/countries.js +0 -245
  140. package/build/js/i18n/da/interface.js +0 -13
  141. package/build/js/i18n/de/countries.js +0 -245
  142. package/build/js/i18n/de/interface.js +0 -13
  143. package/build/js/i18n/ee/countries.js +0 -245
  144. package/build/js/i18n/ee/interface.js +0 -13
  145. package/build/js/i18n/el/countries.js +0 -245
  146. package/build/js/i18n/el/interface.js +0 -13
  147. package/build/js/i18n/en/countries.js +0 -245
  148. package/build/js/i18n/en/interface.js +0 -14
  149. package/build/js/i18n/es/countries.js +0 -245
  150. package/build/js/i18n/es/interface.js +0 -13
  151. package/build/js/i18n/fa/countries.js +0 -245
  152. package/build/js/i18n/fa/interface.js +0 -13
  153. package/build/js/i18n/fi/countries.js +0 -245
  154. package/build/js/i18n/fi/interface.js +0 -13
  155. package/build/js/i18n/fr/countries.js +0 -245
  156. package/build/js/i18n/fr/interface.js +0 -13
  157. package/build/js/i18n/hi/countries.js +0 -245
  158. package/build/js/i18n/hi/interface.js +0 -13
  159. package/build/js/i18n/hr/countries.js +0 -245
  160. package/build/js/i18n/hr/interface.js +0 -20
  161. package/build/js/i18n/hu/countries.js +0 -245
  162. package/build/js/i18n/hu/interface.js +0 -13
  163. package/build/js/i18n/id/countries.js +0 -245
  164. package/build/js/i18n/id/interface.js +0 -13
  165. package/build/js/i18n/it/countries.js +0 -245
  166. package/build/js/i18n/it/interface.js +0 -13
  167. package/build/js/i18n/ja/countries.js +0 -245
  168. package/build/js/i18n/ja/interface.js +0 -13
  169. package/build/js/i18n/ko/countries.js +0 -245
  170. package/build/js/i18n/ko/interface.js +0 -13
  171. package/build/js/i18n/lt/countries.js +0 -245
  172. package/build/js/i18n/lt/interface.js +0 -26
  173. package/build/js/i18n/mr/countries.js +0 -245
  174. package/build/js/i18n/mr/interface.js +0 -13
  175. package/build/js/i18n/nl/countries.js +0 -245
  176. package/build/js/i18n/nl/interface.js +0 -13
  177. package/build/js/i18n/no/countries.js +0 -245
  178. package/build/js/i18n/no/interface.js +0 -13
  179. package/build/js/i18n/pl/countries.js +0 -245
  180. package/build/js/i18n/pl/interface.js +0 -19
  181. package/build/js/i18n/pt/countries.js +0 -245
  182. package/build/js/i18n/pt/interface.js +0 -13
  183. package/build/js/i18n/ro/countries.js +0 -245
  184. package/build/js/i18n/ro/interface.js +0 -18
  185. package/build/js/i18n/ru/countries.js +0 -245
  186. package/build/js/i18n/ru/interface.js +0 -20
  187. package/build/js/i18n/sk/countries.js +0 -245
  188. package/build/js/i18n/sk/interface.js +0 -20
  189. package/build/js/i18n/sl/countries.js +0 -245
  190. package/build/js/i18n/sl/interface.js +0 -25
  191. package/build/js/i18n/sq/countries.js +0 -245
  192. package/build/js/i18n/sq/interface.js +0 -14
  193. package/build/js/i18n/sr/countries.js +0 -245
  194. package/build/js/i18n/sr/interface.js +0 -21
  195. package/build/js/i18n/sv/countries.js +0 -245
  196. package/build/js/i18n/sv/interface.js +0 -13
  197. package/build/js/i18n/te/countries.js +0 -245
  198. package/build/js/i18n/te/interface.js +0 -13
  199. package/build/js/i18n/th/countries.js +0 -245
  200. package/build/js/i18n/th/interface.js +0 -13
  201. package/build/js/i18n/tr/countries.js +0 -245
  202. package/build/js/i18n/tr/interface.js +0 -13
  203. package/build/js/i18n/uk/countries.js +0 -245
  204. package/build/js/i18n/uk/interface.js +0 -20
  205. package/build/js/i18n/ur/countries.js +0 -245
  206. package/build/js/i18n/ur/interface.js +0 -13
  207. package/build/js/i18n/uz/countries.js +0 -245
  208. package/build/js/i18n/uz/interface.js +0 -13
  209. package/build/js/i18n/vi/countries.js +0 -245
  210. package/build/js/i18n/vi/interface.js +0 -13
  211. package/build/js/i18n/zh/countries.js +0 -245
  212. package/build/js/i18n/zh/interface.js +0 -13
  213. package/vue/build/IntlTelInput.mjs +0 -3398
  214. package/vue/build/IntlTelInputWithUtils.mjs +0 -9540
package/README.md CHANGED
@@ -100,13 +100,11 @@ _Note: We have now dropped support for all versions of Internet Explorer because
100
100
 
101
101
  2. Import the CSS: `import 'intl-tel-input/build/css/intlTelInput.css';`
102
102
 
103
- 3. Set the path to flags.webp and globe.webp in your CSS, by overriding the CSS variables
103
+ 3. Set the path to flags.webp in your CSS, by overriding the CSS variables
104
104
  ```css
105
105
  .iti {
106
106
  --iti-path-flags-1x: url('path/to/flags.webp');
107
107
  --iti-path-flags-2x: url('path/to/flags@2x.webp');
108
- --iti-path-globe-1x: url('path/to/globe.webp');
109
- --iti-path-globe-2x: url('path/to/globe@2x.webp');
110
108
  }
111
109
  ```
112
110
 
@@ -130,13 +128,11 @@ Most bundlers (such as Webpack, Vite, or Parcel) will see this and place the [ut
130
128
  <link rel="stylesheet" href="path/to/intlTelInput.css">
131
129
  ```
132
130
 
133
- 3. Set the path to flags.webp and globe.webp in your CSS, by overriding the CSS variables
131
+ 3. Set the path to flags.webp in your CSS, by overriding the CSS variables
134
132
  ```css
135
133
  .iti {
136
134
  --iti-path-flags-1x: url('path/to/flags.webp');
137
135
  --iti-path-flags-2x: url('path/to/flags@2x.webp');
138
- --iti-path-globe-1x: url('path/to/globe.webp');
139
- --iti-path-globe-2x: url('path/to/globe@2x.webp');
140
136
  }
141
137
  ```
142
138
 
@@ -169,6 +165,10 @@ When you initialise the plugin, the first argument is the input element, and the
169
165
  Type: `Boolean` Default: `true`
170
166
  Whether or not to allow the dropdown. If disabled, there is no dropdown arrow, and the selected country is not clickable. Also, if showFlags is enabled, we display the selected flag on the right instead, because it is just a marker of state. Note that if `separateDialCode` is enabled, `allowDropdown` is forced to `true` as the dropdown is required when the user types "+" in this case. Play with this option on [Storybook](https://intl-tel-input.com/storybook/?path=/docs/intltelinput--allowdropdown) (using the React component).
171
167
 
168
+ **allowNumberExtensions**.
169
+ Type: `Boolean` Default: `false`
170
+ Whether or not the validation methods return `true` for numbers containing extensions, e.g. "+1 702 123-1234 ext. 1234".
171
+
172
172
  **allowPhonewords**
173
173
  Type: `Boolean` Default: `false`
174
174
  Whether or not the validation methods return `true` for numbers containing phonewords, e.g. "+1 702 FLOWERS".
@@ -261,9 +261,9 @@ This will generate the following (hidden) elements, which will be automatically
261
261
 
262
262
  **i18n**
263
263
  Type: `Object` Default: `{}`
264
- Allows you to specify translation strings for the 200+ country names, as well as other user interface text (e.g. the placeholder text for the country search input). The easiest way to do this is to import one of the [provided translation modules](https://github.com/jackocnr/intl-tel-input/tree/master/src/js/intl-tel-input/i18n) and set `i18n` to that value (see option 1 below). You can also override one or more individual keys this way (see option 1 below). Alternatively, you can provide your own custom translations (see option 2 below). If providing your own, you will need to specify all the country names (which can be copied from the country-list project, e.g. here are the [country names in French](https://github.com/umpirsky/country-list/blob/master/data/fr/country.json)), as well as a few UI strings (listed below). [See example](https://intl-tel-input.com/examples/localise-countries.html).
264
+ Allows you to specify translation strings for the user interface text (e.g. the placeholder text for the country search input) or to override any country names (generated with `Intl.DisplayNames`). The easiest way to do this is to import one of the [provided translation modules](https://github.com/jackocnr/intl-tel-input/tree/master/src/js/intl-tel-input/i18n) and set the `i18n` initialisation option to that value (see option 1 below). You can also override one or more individual keys this way (see option 1 below). Alternatively, you can provide your own custom translations (see option 2 below). If providing your own, see the required UI strings listed below. [See example](https://intl-tel-input.com/examples/localise-countries.html).
265
265
 
266
- If we don't currently support a language you need, it's easy to [contribute this](https://github.com/jackocnr/intl-tel-input/blob/master/.github/CONTRIBUTING.md#adding-a-new-translation) yourself - you only need to provide a handful of UI translation strings, as we automatically pull in the country names from the country-list project.
266
+ If we don't currently support a language you need, it's easy to [contribute this](https://github.com/jackocnr/intl-tel-input/blob/master/.github/CONTRIBUTING.md#adding-a-new-translation) yourself - you only need to provide a handful of UI translation strings.
267
267
 
268
268
  Option 1: import one of the provided translation modules
269
269
  ```js
@@ -286,13 +286,6 @@ Option 2: define your own custom translations
286
286
  ```js
287
287
  intlTelInput(input, {
288
288
  i18n: {
289
- // Country names - see the full list in src/js/intl-tel-input/i18n/en/countries.ts
290
- af: "Afghanistan",
291
- al: "Albania",
292
- dz: "Algeria",
293
- as: "American Samoa",
294
- ad: "Andorra",
295
- ...
296
289
  // Aria label for the selected country element, when there is a country selected
297
290
  selectedCountryAriaLabel: "Change country, selected ${countryName} (${dialCode})",
298
291
  // Aria label and title text for the selected country element, when no country is selected
@@ -303,18 +296,13 @@ intlTelInput(input, {
303
296
  searchPlaceholder: "Search",
304
297
  // Aria label for the clear search button
305
298
  clearSearchAriaLabel: "Clear search",
306
- // Visible text and screen reader message for when the search produces no results
307
- zeroSearchResults: "No results found",
308
- // Screen reader message for when the search produces 1 result
309
- oneSearchResult: "1 result found",
310
- // Screen reader message for when the search produces multiple results
311
- multipleSearchResults: "${count} results found",
312
- // OPTIONAL: For more complex pluralisation cases, e.g. Polish or Arabic, you can implement your own logic, like below. In this case, you can omit the "one" and "multiple" keys above.
313
- searchResultsText(count) {
314
- // NOTE: zero results are always handled by "zeroSearchResults" above
299
+ // Visible text for when the search produces no results
300
+ searchEmptyState: "No results found",
301
+ // Screen reader summary of search results
302
+ searchSummaryAria(count) {
303
+ if (count === 0) return "No results found";
315
304
  if (count === 1) return "1 result found";
316
- if (count < 5) return `Some ${count} results found`;
317
- return `Many ${count} results found`;
305
+ return `${count} results found`;
318
306
  }
319
307
  }
320
308
  });
@@ -376,15 +364,15 @@ __Note: if the user enters their number with autofill or by copying and pasting
376
364
 
377
365
  **strictMode**
378
366
  Type: `Boolean` Default: `false`
379
- As the user types in the input, ignore any irrelevant characters. The user can only enter numeric characters and an optional plus at the beginning. Cap the length at the maximum valid number length (this respects `validationNumberTypes`). Requires the [utils script to be loaded](#loading-the-utilities-script). [See example](https://intl-tel-input.com/examples/strict-mode.html).
367
+ As the user types in the input, ignore any irrelevant characters. The user can only enter numeric characters and an optional plus at the beginning. Cap the length at the maximum valid number length (this respects `allowedNumberTypes`). Requires the [utils script to be loaded](#loading-the-utilities-script). [See example](https://intl-tel-input.com/examples/strict-mode.html).
380
368
 
381
369
  **useFullscreenPopup**
382
370
  Type: `Boolean` Default: `true on mobile devices, false otherwise`
383
371
  Control when the country list appears as a fullscreen popup vs an inline dropdown. By default, it will appear as a fullscreen popup on mobile devices (based on user-agent and screen width), to make better use of the limited space (similar to how a native `<select>` works), and as an inline dropdown on larger devices/screens. Play with this option on [Storybook](https://intl-tel-input.com/storybook/?path=/docs/intltelinput--usefullscreenpopup) (using the React component).
384
372
 
385
- **validationNumberTypes**
386
- Type: `String[]` Default: `["MOBILE"]`
387
- Specify an array of [the keys](https://github.com/jackocnr/intl-tel-input/blob/master/src/js/utils.js#L198) from the enum `intlTelInput.utils.numberType` to set the number type(s) to enforce during validation, as well as the number length to enforce with `strictMode`. Set it to `null` to not enforce any particular type. By default, it's set to `["MOBILE"]` so `isValidNumber` will only return `true` for mobile numbers. Alternatively, you could set it to, for example, `["TOLL_FREE", "PREMIUM_RATE"]` to get `isValidNumber` to return `true` for only those kinds of numbers.
373
+ **allowedNumberTypes**
374
+ Type: `String[]` Default: `["MOBILE", "FIXED_LINE"]`
375
+ Specify an array of [the keys](https://github.com/jackocnr/intl-tel-input/blob/master/src/js/utils.js#L198) from the enum `intlTelInput.utils.numberType` to set the number type(s) to enforce during validation, as well as the number length to enforce with `strictMode`. Set it to `null` to not enforce any particular type. By default, it's set to `["MOBILE", "FIXED_LINE"]` so `isValidNumber` (etc) will only return `true` for those kinds of numbers. Alternatively, you could set it to simply `["MOBILE"]` if you only wanted to accept mobile numbers as valid. _Note: previously named `validationNumberTypes`._
388
376
 
389
377
  ## Instance Methods
390
378
  In these examples, `iti` refers to the plugin instance which gets returned when you initialise the plugin, e.g.
@@ -454,7 +442,7 @@ if (error === intlTelInput.utils.validationError.TOO_SHORT) {
454
442
  ```
455
443
 
456
444
  **isValidNumber**
457
- (Note: only returns `true` for valid <ins>mobile numbers</ins> by default - see `validationNumberTypes`)
445
+ (Note: only returns `true` for valid <ins>mobile numbers</ins> by default - see `allowedNumberTypes`)
458
446
  Check if the current number is valid based on its length - [see example](https://intl-tel-input.com/examples/validation-practical.html), which should be sufficient for most use cases. See `isValidNumberPrecise` (DANGEROUS) for more precise validation, but the advantage of `isValidNumber` is that it is much more future-proof, as while countries around the world regularly update their number rules, they rarely change their number lengths. If this method returns `false`, you can use `getValidationError` to get more information. Requires the [utils script to be loaded](#loading-the-utilities-script).
459
447
  ```js
460
448
  const isValid = iti.isValidNumber();
@@ -462,7 +450,7 @@ const isValid = iti.isValidNumber();
462
450
  Returns: `true`/`false`
463
451
 
464
452
  **isValidNumberPrecise** ⚠️ DANGEROUS
465
- (Note: only returns `true` for valid <ins>mobile numbers</ins> by default - see `validationNumberTypes`)
453
+ (Note: only returns `true` for valid <ins>mobile numbers</ins> by default - see `allowedNumberTypes`)
466
454
  Check if the current number is valid using precise matching rules for each country/area code, etc - [see example](https://intl-tel-input.com/examples/validation.html). Note that these rules change each month for various countries around the world, so you need to constantly keep the plugin up-to-date (e.g. via an automated script) else <ins>you will start rejecting valid numbers</ins>. For a simpler and more future-proof form of validation, see `isValidNumber` above. If validation fails, you can use `getValidationError` to get more information. Requires the [utils script to be loaded](#loading-the-utilities-script).
467
455
  ```js
468
456
  const isValid = iti.isValidNumberPrecise();
@@ -545,8 +533,6 @@ This is triggered when the user closes the dropdown.
545
533
  ## Theming / Dark Mode
546
534
  There are lots of CSS variables available for theming. See [intlTelInput.scss](https://github.com/jackocnr/intl-tel-input/blob/master/src/css/intlTelInput.scss) for the full list.
547
535
 
548
- As for the empty state (globe icon), the default version is dark grey, and we also provide a "light" version that should work better with a dark theme. Alternatively, it's easy to [re-generate the globe icon](https://free-icon-rainbow.com/international-call-free-icon) in whatever colour you need for your theme. We recommend you download it in the highest resolution possible, and then scale the image down to the required sizes (20px wide for the default version and 40px wide for the @2x version).
549
-
550
536
  Dark mode example (with screenshot below):
551
537
  ```css
552
538
  @media (prefers-color-scheme: dark) {
@@ -554,10 +540,8 @@ Dark mode example (with screenshot below):
554
540
  --iti-border-color: #5b5b5b;
555
541
  --iti-dialcode-color: #999999;
556
542
  --iti-dropdown-bg: #0d1117;
557
- --iti-arrow-color: #aaaaaa;
543
+ --iti-icon-color: #aaaaaa;
558
544
  --iti-hover-color: #30363d;
559
- --iti-path-globe-1x: url("path/to/globe_light.webp");
560
- --iti-path-globe-2x: url("path/to/globe_light@2x.webp");
561
545
  }
562
546
  }
563
547
  ```
@@ -587,7 +571,7 @@ We provide [translations](https://github.com/jackocnr/intl-tel-input/tree/master
587
571
 
588
572
  Supported languages: Arabic, Albanian, Bengali, Bosnian, Bulgarian, Catalan, Chinese, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, Lithuanian, Marathi, Norwegian, Persian, Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovenian, Spanish, Swedish, Telugu, Thai, Turkish, Ukrainian, Urdu, Uzbek, Vietnamese.
589
573
 
590
- If we don't currently support a language you need, it's easy to [contribute this](https://github.com/jackocnr/intl-tel-input/blob/master/.github/CONTRIBUTING.md#adding-a-new-translation) yourself - you only need to provide a handful of UI translation strings, as we automatically pull in the country names from the country-list project.
574
+ If we don't currently support a language you need, it's easy to [contribute this](https://github.com/jackocnr/intl-tel-input/blob/master/.github/CONTRIBUTING.md#adding-a-new-translation) yourself - you only need to provide a handful of UI translation strings.
591
575
 
592
576
  ## Utilities Script
593
577
  The utilities script ([build/js/utils.js](build/js/utils.js)) is a custom build of Google's [libphonenumber](https://github.com/googlei18n/libphonenumber) which enables the following features: