intl-tel-input 26.0.0-beta.1 → 26.0.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.
- package/README.md +21 -19
- package/angular/README.md +1 -1
- package/angular/build/IntlTelInput.js +1 -1
- package/angular/build/IntlTelInputWithUtils.js +125 -186
- package/angular/build/types/intl-tel-input/i18n/index.d.ts +1 -0
- package/angular/build/types/intl-tel-input/i18n/zh-hk/index.d.ts +3 -0
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/i18n/ar/countries.js +245 -0
- package/build/js/i18n/ar/index.js +1 -0
- package/build/js/i18n/ar/interface.js +23 -0
- package/build/js/i18n/bg/countries.js +245 -0
- package/build/js/i18n/bg/index.js +1 -0
- package/build/js/i18n/bg/interface.js +13 -0
- package/build/js/i18n/bn/countries.js +245 -0
- package/build/js/i18n/bn/index.js +1 -0
- package/build/js/i18n/bn/interface.js +13 -0
- package/build/js/i18n/bs/countries.js +245 -0
- package/build/js/i18n/bs/index.js +1 -0
- package/build/js/i18n/bs/interface.js +20 -0
- package/build/js/i18n/ca/countries.js +245 -0
- package/build/js/i18n/ca/index.js +1 -0
- package/build/js/i18n/ca/interface.js +13 -0
- package/build/js/i18n/cs/countries.js +245 -0
- package/build/js/i18n/cs/index.js +1 -0
- package/build/js/i18n/cs/interface.js +20 -0
- package/build/js/i18n/da/countries.js +245 -0
- package/build/js/i18n/da/index.js +1 -0
- package/build/js/i18n/da/interface.js +13 -0
- package/build/js/i18n/de/countries.js +245 -0
- package/build/js/i18n/de/index.js +1 -0
- package/build/js/i18n/de/interface.js +13 -0
- package/build/js/i18n/ee/countries.js +245 -0
- package/build/js/i18n/ee/index.js +1 -0
- package/build/js/i18n/ee/interface.js +13 -0
- package/build/js/i18n/el/countries.js +245 -0
- package/build/js/i18n/el/index.js +1 -0
- package/build/js/i18n/el/interface.js +13 -0
- package/build/js/i18n/en/countries.js +245 -0
- package/build/js/i18n/en/interface.js +14 -0
- package/build/js/i18n/es/countries.js +245 -0
- package/build/js/i18n/es/index.js +1 -0
- package/build/js/i18n/es/interface.js +13 -0
- package/build/js/i18n/fa/countries.js +245 -0
- package/build/js/i18n/fa/index.js +1 -0
- package/build/js/i18n/fa/interface.js +13 -0
- package/build/js/i18n/fi/countries.js +245 -0
- package/build/js/i18n/fi/index.js +1 -0
- package/build/js/i18n/fi/interface.js +13 -0
- package/build/js/i18n/fr/countries.js +245 -0
- package/build/js/i18n/fr/index.js +1 -0
- package/build/js/i18n/fr/interface.js +13 -0
- package/build/js/i18n/hi/countries.js +245 -0
- package/build/js/i18n/hi/index.js +1 -0
- package/build/js/i18n/hi/interface.js +13 -0
- package/build/js/i18n/hr/countries.js +245 -0
- package/build/js/i18n/hr/index.js +1 -0
- package/build/js/i18n/hr/interface.js +20 -0
- package/build/js/i18n/hu/countries.js +245 -0
- package/build/js/i18n/hu/index.js +1 -0
- package/build/js/i18n/hu/interface.js +13 -0
- package/build/js/i18n/id/countries.js +245 -0
- package/build/js/i18n/id/index.js +1 -0
- package/build/js/i18n/id/interface.js +13 -0
- package/build/js/i18n/index.js +1 -0
- package/build/js/i18n/it/countries.js +245 -0
- package/build/js/i18n/it/index.js +1 -0
- package/build/js/i18n/it/interface.js +13 -0
- package/build/js/i18n/ja/countries.js +245 -0
- package/build/js/i18n/ja/index.js +1 -0
- package/build/js/i18n/ja/interface.js +13 -0
- package/build/js/i18n/ko/countries.js +245 -0
- package/build/js/i18n/ko/index.js +1 -0
- package/build/js/i18n/ko/interface.js +13 -0
- package/build/js/i18n/lt/countries.js +245 -0
- package/build/js/i18n/lt/interface.js +26 -0
- package/build/js/i18n/mr/countries.js +245 -0
- package/build/js/i18n/mr/index.js +1 -0
- package/build/js/i18n/mr/interface.js +13 -0
- package/build/js/i18n/nl/countries.js +245 -0
- package/build/js/i18n/nl/index.js +1 -0
- package/build/js/i18n/nl/interface.js +13 -0
- package/build/js/i18n/no/countries.js +245 -0
- package/build/js/i18n/no/index.js +1 -0
- package/build/js/i18n/no/interface.js +13 -0
- package/build/js/i18n/pl/countries.js +245 -0
- package/build/js/i18n/pl/index.js +1 -0
- package/build/js/i18n/pl/interface.js +19 -0
- package/build/js/i18n/pt/countries.js +245 -0
- package/build/js/i18n/pt/index.js +1 -0
- package/build/js/i18n/pt/interface.js +13 -0
- package/build/js/i18n/ro/countries.js +245 -0
- package/build/js/i18n/ro/index.js +1 -0
- package/build/js/i18n/ro/interface.js +18 -0
- package/build/js/i18n/ru/countries.js +245 -0
- package/build/js/i18n/ru/index.js +1 -0
- package/build/js/i18n/ru/interface.js +20 -0
- package/build/js/i18n/sk/countries.js +245 -0
- package/build/js/i18n/sk/index.js +1 -0
- package/build/js/i18n/sk/interface.js +20 -0
- package/build/js/i18n/sl/countries.js +245 -0
- package/build/js/i18n/sl/interface.js +25 -0
- package/build/js/i18n/sq/countries.js +245 -0
- package/build/js/i18n/sq/interface.js +14 -0
- package/build/js/i18n/sr/countries.js +245 -0
- package/build/js/i18n/sr/interface.js +21 -0
- package/build/js/i18n/sv/countries.js +245 -0
- package/build/js/i18n/sv/index.js +1 -0
- package/build/js/i18n/sv/interface.js +13 -0
- package/build/js/i18n/te/countries.js +245 -0
- package/build/js/i18n/te/index.js +1 -0
- package/build/js/i18n/te/interface.js +13 -0
- package/build/js/i18n/th/countries.js +245 -0
- package/build/js/i18n/th/index.js +1 -0
- package/build/js/i18n/th/interface.js +13 -0
- package/build/js/i18n/tr/countries.js +245 -0
- package/build/js/i18n/tr/index.js +1 -0
- package/build/js/i18n/tr/interface.js +13 -0
- package/build/js/i18n/uk/countries.js +245 -0
- package/build/js/i18n/uk/index.js +1 -0
- package/build/js/i18n/uk/interface.js +20 -0
- package/build/js/i18n/ur/countries.js +245 -0
- package/build/js/i18n/ur/index.js +1 -0
- package/build/js/i18n/ur/interface.js +13 -0
- package/build/js/i18n/uz/countries.js +245 -0
- package/build/js/i18n/uz/index.js +1 -0
- package/build/js/i18n/uz/interface.js +13 -0
- package/build/js/i18n/vi/countries.js +245 -0
- package/build/js/i18n/vi/index.js +1 -0
- package/build/js/i18n/vi/interface.js +13 -0
- package/build/js/i18n/zh/countries.js +245 -0
- package/build/js/i18n/zh/index.js +1 -0
- package/build/js/i18n/zh/interface.js +13 -0
- package/build/js/i18n/zh-hk/countries.js +245 -0
- package/build/js/i18n/zh-hk/index.js +18 -0
- package/build/js/i18n/zh-hk/interface.js +14 -0
- package/build/js/intlTelInput.d.ts +6 -0
- package/build/js/intlTelInput.js +2 -2
- package/build/js/intlTelInput.min.js +2 -2
- package/build/js/intlTelInputWithUtils.js +126 -187
- package/build/js/intlTelInputWithUtils.min.js +2 -2
- package/build/js/utils.js +53 -54
- package/package.json +2 -2
- package/react/README.md +4 -2
- package/react/build/IntlTelInput.cjs +1 -1
- package/react/build/IntlTelInput.d.ts +6 -0
- package/react/build/IntlTelInput.js +1 -1
- package/react/build/IntlTelInputWithUtils.cjs +125 -186
- package/react/build/IntlTelInputWithUtils.js +125 -186
- package/svelte/README.md +7 -9
- package/svelte/build/IntlTelInput.mjs +1437 -1437
- package/svelte/build/IntlTelInputWithUtils.mjs +1785 -1846
- package/vue/README.md +12 -10
- package/vue/build/IntlTelInput.vue.d.ts +2 -0
- package/vue/build/IntlTelInputWithUtils.vue.d.ts +2 -0
- package/vue/build/exports/IntlTelInput.mjs +17 -16
- package/vue/build/exports/IntlTelInputWithUtils.mjs +176 -236
- package/vue/build/intl-tel-input/i18n/index.d.ts +1 -0
- package/vue/build/intl-tel-input/i18n/zh-hk/index.d.ts +3 -0
- package/vue/build/{intl-tel-input-f0-6rrpA.mjs → intl-tel-input-Bk5kP2Ot.mjs} +1 -1
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# International Telephone Input [](https://github.com/jackocnr/intl-tel-input/actions/workflows/ci.yml) <img src="https://img.shields.io/github/package-json/v/jackocnr/intl-tel-input.svg" alt="version"/> <img src="https://img.shields.io/npm/dm/intl-tel-input.svg" alt="downloads"/>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
🗣️ NEWS: [v26.0.0-beta.0](https://github.com/jackocnr/intl-tel-input/releases/tag/v26.0.0-beta.0) released, with support for:
|
|
4
|
+
- Autocomplete
|
|
5
|
+
- TypeScript types for the Vue component
|
|
6
|
+
- Country names now generated with `Intl.DisplayNames` (reduced bundle size)
|
|
7
|
+
- A more easily customisable globe icon SVG
|
|
8
|
+
- Modernised CSS
|
|
9
|
+
- More control over number extensions
|
|
4
10
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<img src="https://raw.github.com/jackocnr/intl-tel-input/master/screenshots/angular.png" alt="Angular logo" width="16" /> NEWS: we now have our own <a href="https://github.com/jackocnr/intl-tel-input/tree/master/angular">Angular component</a>!
|
|
8
|
-
|
|
9
|
-
🗣️ NEWS: we now provide [translations](#translations) in over 40 languages! [See them in action](https://intl-tel-input.com/storybook/?path=/docs/intltelinput--i18n).
|
|
10
|
-
|
|
11
|
-
International Telephone Input is a JavaScript plugin for entering and validating international telephone numbers. It takes a regular input field, adds a searchable country dropdown, auto-detects the user's country, displays a relevant placeholder number, formats the number as you type, and provides comprehensive validation methods. React, Vue and Angular components are also included.
|
|
11
|
+
International Telephone Input is a JavaScript plugin for entering and validating international telephone numbers. It takes a regular input field, adds a searchable country dropdown, auto-detects the user's country, displays a relevant placeholder number, formats the number as you type, and provides comprehensive validation methods. [React](https://github.com/jackocnr/intl-tel-input/blob/master/react/README.md), [Vue](https://github.com/jackocnr/intl-tel-input/blob/master/vue/README.md), [Angular](https://github.com/jackocnr/intl-tel-input/blob/master/angular/README.md) and [Svelte (beta)](https://github.com/jackocnr/intl-tel-input/blob/master/svelte/README.md) components are also included.
|
|
12
12
|
|
|
13
13
|
<picture>
|
|
14
14
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.github.com/jackocnr/intl-tel-input/master/screenshots/vanilla-dark.png">
|
|
@@ -25,7 +25,7 @@ Use [Twilio's API to build phone verification, SMS 2FA, appointment reminders, m
|
|
|
25
25
|
|
|
26
26
|
## Table of Contents
|
|
27
27
|
|
|
28
|
-
- [React, Vue and
|
|
28
|
+
- [React, Vue, Angular and Svelte Components](#react-vue-angular-and-svelte-components)
|
|
29
29
|
- [Demo and Examples](#demo-and-examples)
|
|
30
30
|
- [Mobile](#mobile)
|
|
31
31
|
- [Features](#features)
|
|
@@ -44,11 +44,13 @@ Use [Twilio's API to build phone verification, SMS 2FA, appointment reminders, m
|
|
|
44
44
|
- [Contributing](#contributing)
|
|
45
45
|
- [Attributions](#attributions)
|
|
46
46
|
|
|
47
|
-
## React, Vue and
|
|
48
|
-
We now provide React, Vue and
|
|
47
|
+
## React, Vue, Angular and Svelte Components
|
|
48
|
+
We now provide React, Vue, Angular and Svelte (beta) components alongside the regular JavaScript plugin. This readme is for the JavaScript plugin. View the [React Component](https://github.com/jackocnr/intl-tel-input/blob/master/react/README.md), the [Vue Component](https://github.com/jackocnr/intl-tel-input/blob/master/vue/README.md) the [Angular Component](https://github.com/jackocnr/intl-tel-input/blob/master/angular/README.md), or the [Svelte component (beta)](https://github.com/jackocnr/intl-tel-input/blob/master/svelte/README.md).
|
|
49
49
|
|
|
50
50
|
## Demo and Examples
|
|
51
|
-
|
|
51
|
+
View the [live demo](https://intl-tel-input.com) for examples of how to use the various options, along with the relevant code snippets. Or play with the options yourself on [Storybook](https://intl-tel-input.com/storybook/?path=/docs/intltelinput--vanilla).
|
|
52
|
+
|
|
53
|
+
Alternatively, download and build the project yourself in 3 simple steps. You just need to initialise the submodules with `git submodule update --init --recursive`, then run `npm install`, and then `npm run build`. You should now be able to open the included demo.html in your browser and have a working plugin!
|
|
52
54
|
|
|
53
55
|
## Mobile
|
|
54
56
|
By default, on mobile devices, we show a fullscreen popup instead of the inline dropdown to make better use of the limited screen space. This is similar to how a native `<select>` element works. You can control this behaviour with the `useFullscreenPopup` option. The popup can be closed by either selecting a country from the list or by tapping on the grey area on the sides. [See example](https://intl-tel-input.com/storybook/?path=/docs/intltelinput--usefullscreenpopup) (using the React component).
|
|
@@ -67,8 +69,8 @@ By default, on mobile devices, we show a fullscreen popup instead of the inline
|
|
|
67
69
|
* Accessibility provided via ARIA tags
|
|
68
70
|
* Typescript type definitions included
|
|
69
71
|
* Easily customise styles by overriding CSS variables, e.g. support dark mode
|
|
70
|
-
* React, Vue, and
|
|
71
|
-
* Translations
|
|
72
|
+
* React, Vue, Angular and Svelte components also included
|
|
73
|
+
* Translations provided in over 40 languages, as well as support for RTL layout and alternative numeral sets
|
|
72
74
|
* Lots of initialisation options for customisation, as well as instance methods/events for interaction
|
|
73
75
|
|
|
74
76
|
## Browser Compatibility
|
|
@@ -81,16 +83,16 @@ _Note: We have now dropped support for all versions of Internet Explorer because
|
|
|
81
83
|
## Getting Started (Using a CDN)
|
|
82
84
|
1. Add the CSS
|
|
83
85
|
```html
|
|
84
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/intl-tel-input@
|
|
86
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/intl-tel-input@26.0.1/build/css/intlTelInput.css">
|
|
85
87
|
```
|
|
86
88
|
|
|
87
89
|
2. Add the plugin script and initialise it on your input element
|
|
88
90
|
```html
|
|
89
|
-
<script src="https://cdn.jsdelivr.net/npm/intl-tel-input@
|
|
91
|
+
<script src="https://cdn.jsdelivr.net/npm/intl-tel-input@26.0.1/build/js/intlTelInput.min.js"></script>
|
|
90
92
|
<script>
|
|
91
93
|
const input = document.querySelector("#phone");
|
|
92
94
|
window.intlTelInput(input, {
|
|
93
|
-
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@
|
|
95
|
+
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@26.0.1/build/js/utils.js"),
|
|
94
96
|
});
|
|
95
97
|
</script>
|
|
96
98
|
```
|
|
@@ -320,12 +322,12 @@ Set the initial country selection by specifying its country code, e.g. `"us"` fo
|
|
|
320
322
|
Type: `() => Promise<module>` Default: `null`
|
|
321
323
|
This is one way to lazy load the included utils.js (to enable formatting/validation, etc) - see [Loading The Utilities Script](#loading-the-utilities-script) for more options.
|
|
322
324
|
|
|
323
|
-
The `loadUtils` option takes a function that returns a Promise resolving to the utils module (see example code below). You can `import` the utils module in different ways: (A) from a CDN, (B) from your own hosted version of [utils.js](https://cdn.jsdelivr.net/npm/intl-tel-input@
|
|
325
|
+
The `loadUtils` option takes a function that returns a Promise resolving to the utils module (see example code below). You can `import` the utils module in different ways: (A) from a CDN, (B) from your own hosted version of [utils.js](https://cdn.jsdelivr.net/npm/intl-tel-input@26.0.1/build/js/utils.js), or (C) if you use a bundler like Webpack, Vite or Parcel, you can import it directly from the package.
|
|
324
326
|
|
|
325
327
|
```js
|
|
326
328
|
// (A) import utils module from a CDN
|
|
327
329
|
intlTelInput(htmlInputElement, {
|
|
328
|
-
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@
|
|
330
|
+
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@26.0.1/build/js/utils.js"),
|
|
329
331
|
});
|
|
330
332
|
|
|
331
333
|
// (B) import utils module from your own hosted version of utils.js
|
package/angular/README.md
CHANGED
|
@@ -54,7 +54,7 @@ import "intl-tel-input/styles";
|
|
|
54
54
|
|
|
55
55
|
See the [validation demo](https://github.com/jackocnr/intl-tel-input/blob/master/angular/demo/validation/validation.component.ts) for a more fleshed-out example of how to handle validation, or check out the [form demo](https://github.com/jackocnr/intl-tel-input/blob/master/angular/demo/form/form.component.ts) for an alternative approach using `ReactiveFormsModule`.
|
|
56
56
|
|
|
57
|
-
A note on the utils script (~260KB): if you're lazy loading the IntlTelInput chunk (and so less worried about filesize) then you can just `import { IntlTelInputComponent } from "intl-tel-input/angularWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/angular"` import, then you should couple this with the `loadUtils` initialisation option - you will need to host the [utils.js](https://github.com/jackocnr/intl-tel-input/blob/master/build/js/utils.js) file, and then set the `loadUtils` option to that URL, or alternatively just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@
|
|
57
|
+
A note on the utils script (~260KB): if you're lazy loading the IntlTelInput chunk (and so less worried about filesize) then you can just `import { IntlTelInputComponent } from "intl-tel-input/angularWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/angular"` import, then you should couple this with the `loadUtils` initialisation option - you will need to host the [utils.js](https://github.com/jackocnr/intl-tel-input/blob/master/build/js/utils.js) file, and then set the `loadUtils` option to that URL, or alternatively just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@26.0.1/build/js/utils.js"`.
|
|
58
58
|
|
|
59
59
|
## Props
|
|
60
60
|
|
|
@@ -3629,7 +3629,7 @@ var intlTelInput = Object.assign((input, options) => {
|
|
|
3629
3629
|
attachUtils,
|
|
3630
3630
|
startedLoadingUtilsScript: false,
|
|
3631
3631
|
startedLoadingAutoCountry: false,
|
|
3632
|
-
version: "26.0.
|
|
3632
|
+
version: "26.0.1"
|
|
3633
3633
|
});
|
|
3634
3634
|
var intl_tel_input_default = intlTelInput;
|
|
3635
3635
|
|