intl-tel-input 25.15.0 → 26.0.0-beta.1

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 (261) hide show
  1. package/README.md +26 -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/data.d.ts +18 -0
  124. package/vue/build/intl-tel-input/i18n/ar/index.d.ts +3 -0
  125. package/vue/build/intl-tel-input/i18n/bg/index.d.ts +3 -0
  126. package/vue/build/intl-tel-input/i18n/bn/index.d.ts +3 -0
  127. package/vue/build/intl-tel-input/i18n/bs/index.d.ts +3 -0
  128. package/vue/build/intl-tel-input/i18n/ca/index.d.ts +3 -0
  129. package/vue/build/intl-tel-input/i18n/cs/index.d.ts +3 -0
  130. package/vue/build/intl-tel-input/i18n/da/index.d.ts +3 -0
  131. package/vue/build/intl-tel-input/i18n/de/index.d.ts +3 -0
  132. package/vue/build/intl-tel-input/i18n/ee/index.d.ts +3 -0
  133. package/vue/build/intl-tel-input/i18n/el/index.d.ts +3 -0
  134. package/vue/build/intl-tel-input/i18n/en/index.d.ts +3 -0
  135. package/vue/build/intl-tel-input/i18n/es/index.d.ts +3 -0
  136. package/vue/build/intl-tel-input/i18n/fa/index.d.ts +3 -0
  137. package/vue/build/intl-tel-input/i18n/fi/index.d.ts +3 -0
  138. package/vue/build/intl-tel-input/i18n/fr/index.d.ts +3 -0
  139. package/vue/build/intl-tel-input/i18n/hi/index.d.ts +3 -0
  140. package/vue/build/intl-tel-input/i18n/hr/index.d.ts +3 -0
  141. package/vue/build/intl-tel-input/i18n/hu/index.d.ts +3 -0
  142. package/vue/build/intl-tel-input/i18n/id/index.d.ts +3 -0
  143. package/vue/build/intl-tel-input/i18n/index.d.ts +43 -0
  144. package/vue/build/intl-tel-input/i18n/it/index.d.ts +3 -0
  145. package/vue/build/intl-tel-input/i18n/ja/index.d.ts +3 -0
  146. package/vue/build/intl-tel-input/i18n/ko/index.d.ts +3 -0
  147. package/vue/build/intl-tel-input/i18n/lt/index.d.ts +3 -0
  148. package/vue/build/intl-tel-input/i18n/mr/index.d.ts +3 -0
  149. package/vue/build/intl-tel-input/i18n/nl/index.d.ts +3 -0
  150. package/vue/build/intl-tel-input/i18n/no/index.d.ts +3 -0
  151. package/vue/build/intl-tel-input/i18n/pl/index.d.ts +3 -0
  152. package/vue/build/intl-tel-input/i18n/pt/index.d.ts +3 -0
  153. package/vue/build/intl-tel-input/i18n/ro/index.d.ts +3 -0
  154. package/vue/build/intl-tel-input/i18n/ru/index.d.ts +3 -0
  155. package/vue/build/intl-tel-input/i18n/sk/index.d.ts +3 -0
  156. package/vue/build/intl-tel-input/i18n/sl/index.d.ts +3 -0
  157. package/vue/build/intl-tel-input/i18n/sq/index.d.ts +3 -0
  158. package/vue/build/intl-tel-input/i18n/sr/index.d.ts +3 -0
  159. package/vue/build/intl-tel-input/i18n/sv/index.d.ts +3 -0
  160. package/vue/build/intl-tel-input/i18n/te/index.d.ts +3 -0
  161. package/vue/build/intl-tel-input/i18n/th/index.d.ts +3 -0
  162. package/vue/build/intl-tel-input/i18n/tr/index.d.ts +3 -0
  163. package/vue/build/intl-tel-input/i18n/types.d.ts +10 -0
  164. package/vue/build/intl-tel-input/i18n/uk/index.d.ts +3 -0
  165. package/vue/build/intl-tel-input/i18n/ur/index.d.ts +3 -0
  166. package/vue/build/intl-tel-input/i18n/uz/index.d.ts +3 -0
  167. package/vue/build/intl-tel-input/i18n/vi/index.d.ts +3 -0
  168. package/vue/build/intl-tel-input/i18n/zh/index.d.ts +3 -0
  169. package/vue/build/intl-tel-input/intlTelInputWithUtils.d.ts +2 -0
  170. package/vue/build/{intl-tel-input-Db39yQmC.mjs → intl-tel-input-f0-6rrpA.mjs} +136 -138
  171. package/vue/build/modules/core/ui.d.ts +0 -1
  172. package/vue/build/modules/format/formatting.d.ts +1 -1
  173. package/vue/build/modules/types/public-api.d.ts +2 -1
  174. package/build/js/i18n/ar/countries.js +0 -245
  175. package/build/js/i18n/ar/interface.js +0 -23
  176. package/build/js/i18n/bg/countries.js +0 -245
  177. package/build/js/i18n/bg/interface.js +0 -13
  178. package/build/js/i18n/bn/countries.js +0 -245
  179. package/build/js/i18n/bn/interface.js +0 -13
  180. package/build/js/i18n/bs/countries.js +0 -245
  181. package/build/js/i18n/bs/interface.js +0 -20
  182. package/build/js/i18n/ca/countries.js +0 -245
  183. package/build/js/i18n/ca/interface.js +0 -13
  184. package/build/js/i18n/cs/countries.js +0 -245
  185. package/build/js/i18n/cs/interface.js +0 -20
  186. package/build/js/i18n/da/countries.js +0 -245
  187. package/build/js/i18n/da/interface.js +0 -13
  188. package/build/js/i18n/de/countries.js +0 -245
  189. package/build/js/i18n/de/interface.js +0 -13
  190. package/build/js/i18n/ee/countries.js +0 -245
  191. package/build/js/i18n/ee/interface.js +0 -13
  192. package/build/js/i18n/el/countries.js +0 -245
  193. package/build/js/i18n/el/interface.js +0 -13
  194. package/build/js/i18n/en/countries.js +0 -245
  195. package/build/js/i18n/en/interface.js +0 -14
  196. package/build/js/i18n/es/countries.js +0 -245
  197. package/build/js/i18n/es/interface.js +0 -13
  198. package/build/js/i18n/fa/countries.js +0 -245
  199. package/build/js/i18n/fa/interface.js +0 -13
  200. package/build/js/i18n/fi/countries.js +0 -245
  201. package/build/js/i18n/fi/interface.js +0 -13
  202. package/build/js/i18n/fr/countries.js +0 -245
  203. package/build/js/i18n/fr/interface.js +0 -13
  204. package/build/js/i18n/hi/countries.js +0 -245
  205. package/build/js/i18n/hi/interface.js +0 -13
  206. package/build/js/i18n/hr/countries.js +0 -245
  207. package/build/js/i18n/hr/interface.js +0 -20
  208. package/build/js/i18n/hu/countries.js +0 -245
  209. package/build/js/i18n/hu/interface.js +0 -13
  210. package/build/js/i18n/id/countries.js +0 -245
  211. package/build/js/i18n/id/interface.js +0 -13
  212. package/build/js/i18n/it/countries.js +0 -245
  213. package/build/js/i18n/it/interface.js +0 -13
  214. package/build/js/i18n/ja/countries.js +0 -245
  215. package/build/js/i18n/ja/interface.js +0 -13
  216. package/build/js/i18n/ko/countries.js +0 -245
  217. package/build/js/i18n/ko/interface.js +0 -13
  218. package/build/js/i18n/lt/countries.js +0 -245
  219. package/build/js/i18n/lt/interface.js +0 -26
  220. package/build/js/i18n/mr/countries.js +0 -245
  221. package/build/js/i18n/mr/interface.js +0 -13
  222. package/build/js/i18n/nl/countries.js +0 -245
  223. package/build/js/i18n/nl/interface.js +0 -13
  224. package/build/js/i18n/no/countries.js +0 -245
  225. package/build/js/i18n/no/interface.js +0 -13
  226. package/build/js/i18n/pl/countries.js +0 -245
  227. package/build/js/i18n/pl/interface.js +0 -19
  228. package/build/js/i18n/pt/countries.js +0 -245
  229. package/build/js/i18n/pt/interface.js +0 -13
  230. package/build/js/i18n/ro/countries.js +0 -245
  231. package/build/js/i18n/ro/interface.js +0 -18
  232. package/build/js/i18n/ru/countries.js +0 -245
  233. package/build/js/i18n/ru/interface.js +0 -20
  234. package/build/js/i18n/sk/countries.js +0 -245
  235. package/build/js/i18n/sk/interface.js +0 -20
  236. package/build/js/i18n/sl/countries.js +0 -245
  237. package/build/js/i18n/sl/interface.js +0 -25
  238. package/build/js/i18n/sq/countries.js +0 -245
  239. package/build/js/i18n/sq/interface.js +0 -14
  240. package/build/js/i18n/sr/countries.js +0 -245
  241. package/build/js/i18n/sr/interface.js +0 -21
  242. package/build/js/i18n/sv/countries.js +0 -245
  243. package/build/js/i18n/sv/interface.js +0 -13
  244. package/build/js/i18n/te/countries.js +0 -245
  245. package/build/js/i18n/te/interface.js +0 -13
  246. package/build/js/i18n/th/countries.js +0 -245
  247. package/build/js/i18n/th/interface.js +0 -13
  248. package/build/js/i18n/tr/countries.js +0 -245
  249. package/build/js/i18n/tr/interface.js +0 -13
  250. package/build/js/i18n/uk/countries.js +0 -245
  251. package/build/js/i18n/uk/interface.js +0 -20
  252. package/build/js/i18n/ur/countries.js +0 -245
  253. package/build/js/i18n/ur/interface.js +0 -13
  254. package/build/js/i18n/uz/countries.js +0 -245
  255. package/build/js/i18n/uz/interface.js +0 -13
  256. package/build/js/i18n/vi/countries.js +0 -245
  257. package/build/js/i18n/vi/interface.js +0 -13
  258. package/build/js/i18n/zh/countries.js +0 -245
  259. package/build/js/i18n/zh/interface.js +0 -13
  260. package/vue/build/IntlTelInput.mjs +0 -3398
  261. 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".
@@ -181,6 +181,10 @@ Set the input's placeholder to an example number for the selected country, and u
181
181
  Type: `String` Default: `""`
182
182
  Additional classes to add to the (injected) wrapper `<div>`.
183
183
 
184
+ **countryNameLocale**
185
+ Type: `String` Default: `"en"`
186
+ The locale to pass to `Intl.DisplayNames` to generate the country names.
187
+
184
188
  **countryOrder**
185
189
  Type: `Array` Default: `null`
186
190
  Specify the ordering for the country list with an array of iso2 country codes. Any omitted countries will appear after those specified, in alphabetical order, e.g. setting `countryOrder` to `["jp", "kr"]` will result in the list: Japan, South Korea, Afghanistan, Albania, Algeria etc...
@@ -261,9 +265,9 @@ This will generate the following (hidden) elements, which will be automatically
261
265
 
262
266
  **i18n**
263
267
  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).
268
+ 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
269
 
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.
270
+ 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
271
 
268
272
  Option 1: import one of the provided translation modules
269
273
  ```js
@@ -286,13 +290,6 @@ Option 2: define your own custom translations
286
290
  ```js
287
291
  intlTelInput(input, {
288
292
  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
293
  // Aria label for the selected country element, when there is a country selected
297
294
  selectedCountryAriaLabel: "Change country, selected ${countryName} (${dialCode})",
298
295
  // Aria label and title text for the selected country element, when no country is selected
@@ -303,18 +300,13 @@ intlTelInput(input, {
303
300
  searchPlaceholder: "Search",
304
301
  // Aria label for the clear search button
305
302
  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
303
+ // Visible text for when the search produces no results
304
+ searchEmptyState: "No results found",
305
+ // Screen reader summary of search results
306
+ searchSummaryAria(count) {
307
+ if (count === 0) return "No results found";
315
308
  if (count === 1) return "1 result found";
316
- if (count < 5) return `Some ${count} results found`;
317
- return `Many ${count} results found`;
309
+ return `${count} results found`;
318
310
  }
319
311
  }
320
312
  });
@@ -376,15 +368,15 @@ __Note: if the user enters their number with autofill or by copying and pasting
376
368
 
377
369
  **strictMode**
378
370
  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).
371
+ 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
372
 
381
373
  **useFullscreenPopup**
382
374
  Type: `Boolean` Default: `true on mobile devices, false otherwise`
383
375
  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
376
 
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.
377
+ **allowedNumberTypes**
378
+ Type: `String[]` Default: `["MOBILE", "FIXED_LINE"]`
379
+ 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
380
 
389
381
  ## Instance Methods
390
382
  In these examples, `iti` refers to the plugin instance which gets returned when you initialise the plugin, e.g.
@@ -454,7 +446,7 @@ if (error === intlTelInput.utils.validationError.TOO_SHORT) {
454
446
  ```
455
447
 
456
448
  **isValidNumber**
457
- (Note: only returns `true` for valid <ins>mobile numbers</ins> by default - see `validationNumberTypes`)
449
+ (Note: only returns `true` for valid <ins>mobile numbers</ins> by default - see `allowedNumberTypes`)
458
450
  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
451
  ```js
460
452
  const isValid = iti.isValidNumber();
@@ -462,7 +454,7 @@ const isValid = iti.isValidNumber();
462
454
  Returns: `true`/`false`
463
455
 
464
456
  **isValidNumberPrecise** ⚠️ DANGEROUS
465
- (Note: only returns `true` for valid <ins>mobile numbers</ins> by default - see `validationNumberTypes`)
457
+ (Note: only returns `true` for valid <ins>mobile numbers</ins> by default - see `allowedNumberTypes`)
466
458
  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
459
  ```js
468
460
  const isValid = iti.isValidNumberPrecise();
@@ -545,8 +537,6 @@ This is triggered when the user closes the dropdown.
545
537
  ## Theming / Dark Mode
546
538
  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
539
 
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
540
  Dark mode example (with screenshot below):
551
541
  ```css
552
542
  @media (prefers-color-scheme: dark) {
@@ -554,10 +544,8 @@ Dark mode example (with screenshot below):
554
544
  --iti-border-color: #5b5b5b;
555
545
  --iti-dialcode-color: #999999;
556
546
  --iti-dropdown-bg: #0d1117;
557
- --iti-arrow-color: #aaaaaa;
547
+ --iti-icon-color: #aaaaaa;
558
548
  --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
549
  }
562
550
  }
563
551
  ```
@@ -587,7 +575,7 @@ We provide [translations](https://github.com/jackocnr/intl-tel-input/tree/master
587
575
 
588
576
  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
577
 
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.
578
+ 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
579
 
592
580
  ## Utilities Script
593
581
  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: