intl-tel-input 24.3.3 → 24.3.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intl-tel-input",
3
- "version": "24.3.3",
3
+ "version": "24.3.5",
4
4
  "description": "A JavaScript plugin for entering and validating international telephone numbers",
5
5
  "keywords": [
6
6
  "international",
package/react/README.md CHANGED
@@ -28,7 +28,7 @@ import "intl-tel-input/styles";
28
28
 
29
29
  See the [Validation demo](https://github.com/jackocnr/intl-tel-input/blob/master/react/demo/validation/ValidationApp.tsx) for a more fleshed-out example of how to handle validation.
30
30
 
31
- 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 IntlTelInput from `"intl-tel-input/reactWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/react"` import, then you should couple this with the `utilsScript` 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 `utilsScript` option to that URL, or alternatively just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@24.3.3/build/js/utils.js"`.
31
+ 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 IntlTelInput from `"intl-tel-input/reactWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/react"` import, then you should couple this with the `utilsScript` 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 `utilsScript` option to that URL, or alternatively just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@24.3.5/build/js/utils.js"`.
32
32
 
33
33
  ## Props
34
34
  Here's a list of all of the current props you can pass to the IntlTelInput React component.
@@ -43,7 +43,7 @@ The initial value to put in the input. This will get auto-formatted on init (acc
43
43
 
44
44
  **initOptions**
45
45
  Type: `Object`
46
- An object containing all of the [initialisation options](https://github.com/jackocnr/intl-tel-input?tab=readme-ov-file#initialisation-options) to pass to the plugin. You can use these exactly the same as when using the plugin with pure JavaScript.
46
+ An object containing the [initialisation options](https://github.com/jackocnr/intl-tel-input?tab=readme-ov-file#initialisation-options) to pass to the plugin. You can use these exactly the same way as with the main JavaScript plugin.
47
47
 
48
48
  **inputProps**
49
49
  Type: `Object`
@@ -1763,7 +1763,6 @@ var Iti = class {
1763
1763
  }
1764
1764
  if (this.options.separateDialCode) {
1765
1765
  this.options.nationalMode = false;
1766
- this.options.countrySearch = true;
1767
1766
  }
1768
1767
  if (this.options.allowDropdown && !this.options.showFlags && !this.options.separateDialCode) {
1769
1768
  this.options.nationalMode = false;
@@ -2243,13 +2242,13 @@ var Iti = class {
2243
2242
  }
2244
2243
  //* Initialize the tel input listeners.
2245
2244
  _initTelInputListeners() {
2246
- const { strictMode, formatAsYouType, separateDialCode, formatOnDisplay, allowDropdown } = this.options;
2245
+ const { strictMode, formatAsYouType, separateDialCode, formatOnDisplay, allowDropdown, countrySearch } = this.options;
2247
2246
  let userOverrideFormatting = false;
2248
2247
  if (/\p{L}/u.test(this.telInput.value)) {
2249
2248
  userOverrideFormatting = true;
2250
2249
  }
2251
2250
  this._handleInputEvent = (e) => {
2252
- if (this.isAndroid && e?.data === "+" && separateDialCode && allowDropdown) {
2251
+ if (this.isAndroid && e?.data === "+" && separateDialCode && allowDropdown && countrySearch) {
2253
2252
  const currentCaretPos = this.telInput.selectionStart || 0;
2254
2253
  const valueBeforeCaret = this.telInput.value.substring(0, currentCaretPos - 1);
2255
2254
  const valueAfterCaret = this.telInput.value.substring(currentCaretPos);
@@ -2283,7 +2282,7 @@ var Iti = class {
2283
2282
  if (strictMode || separateDialCode) {
2284
2283
  this._handleKeydownEvent = (e) => {
2285
2284
  if (e.key && e.key.length === 1 && !e.altKey && !e.ctrlKey && !e.metaKey) {
2286
- if (separateDialCode && allowDropdown && e.key === "+") {
2285
+ if (separateDialCode && allowDropdown && countrySearch && e.key === "+") {
2287
2286
  e.preventDefault();
2288
2287
  this._openDropdownWithPlus();
2289
2288
  return;
@@ -3099,7 +3098,7 @@ var intlTelInput = Object.assign(
3099
3098
  //* A map from instance ID to instance object.
3100
3099
  instances: {},
3101
3100
  loadUtils,
3102
- version: "24.3.3"
3101
+ version: "24.3.5"
3103
3102
  }
3104
3103
  );
3105
3104
  var intl_tel_input_default = intlTelInput;
@@ -1727,7 +1727,6 @@ var Iti = class {
1727
1727
  }
1728
1728
  if (this.options.separateDialCode) {
1729
1729
  this.options.nationalMode = false;
1730
- this.options.countrySearch = true;
1731
1730
  }
1732
1731
  if (this.options.allowDropdown && !this.options.showFlags && !this.options.separateDialCode) {
1733
1732
  this.options.nationalMode = false;
@@ -2207,13 +2206,13 @@ var Iti = class {
2207
2206
  }
2208
2207
  //* Initialize the tel input listeners.
2209
2208
  _initTelInputListeners() {
2210
- const { strictMode, formatAsYouType, separateDialCode, formatOnDisplay, allowDropdown } = this.options;
2209
+ const { strictMode, formatAsYouType, separateDialCode, formatOnDisplay, allowDropdown, countrySearch } = this.options;
2211
2210
  let userOverrideFormatting = false;
2212
2211
  if (/\p{L}/u.test(this.telInput.value)) {
2213
2212
  userOverrideFormatting = true;
2214
2213
  }
2215
2214
  this._handleInputEvent = (e) => {
2216
- if (this.isAndroid && e?.data === "+" && separateDialCode && allowDropdown) {
2215
+ if (this.isAndroid && e?.data === "+" && separateDialCode && allowDropdown && countrySearch) {
2217
2216
  const currentCaretPos = this.telInput.selectionStart || 0;
2218
2217
  const valueBeforeCaret = this.telInput.value.substring(0, currentCaretPos - 1);
2219
2218
  const valueAfterCaret = this.telInput.value.substring(currentCaretPos);
@@ -2247,7 +2246,7 @@ var Iti = class {
2247
2246
  if (strictMode || separateDialCode) {
2248
2247
  this._handleKeydownEvent = (e) => {
2249
2248
  if (e.key && e.key.length === 1 && !e.altKey && !e.ctrlKey && !e.metaKey) {
2250
- if (separateDialCode && allowDropdown && e.key === "+") {
2249
+ if (separateDialCode && allowDropdown && countrySearch && e.key === "+") {
2251
2250
  e.preventDefault();
2252
2251
  this._openDropdownWithPlus();
2253
2252
  return;
@@ -3063,7 +3062,7 @@ var intlTelInput = Object.assign(
3063
3062
  //* A map from instance ID to instance object.
3064
3063
  instances: {},
3065
3064
  loadUtils,
3066
- version: "24.3.3"
3065
+ version: "24.3.5"
3067
3066
  }
3068
3067
  );
3069
3068
  var intl_tel_input_default = intlTelInput;
@@ -1763,7 +1763,6 @@ var Iti = class {
1763
1763
  }
1764
1764
  if (this.options.separateDialCode) {
1765
1765
  this.options.nationalMode = false;
1766
- this.options.countrySearch = true;
1767
1766
  }
1768
1767
  if (this.options.allowDropdown && !this.options.showFlags && !this.options.separateDialCode) {
1769
1768
  this.options.nationalMode = false;
@@ -2243,13 +2242,13 @@ var Iti = class {
2243
2242
  }
2244
2243
  //* Initialize the tel input listeners.
2245
2244
  _initTelInputListeners() {
2246
- const { strictMode, formatAsYouType, separateDialCode, formatOnDisplay, allowDropdown } = this.options;
2245
+ const { strictMode, formatAsYouType, separateDialCode, formatOnDisplay, allowDropdown, countrySearch } = this.options;
2247
2246
  let userOverrideFormatting = false;
2248
2247
  if (/\p{L}/u.test(this.telInput.value)) {
2249
2248
  userOverrideFormatting = true;
2250
2249
  }
2251
2250
  this._handleInputEvent = (e) => {
2252
- if (this.isAndroid && e?.data === "+" && separateDialCode && allowDropdown) {
2251
+ if (this.isAndroid && e?.data === "+" && separateDialCode && allowDropdown && countrySearch) {
2253
2252
  const currentCaretPos = this.telInput.selectionStart || 0;
2254
2253
  const valueBeforeCaret = this.telInput.value.substring(0, currentCaretPos - 1);
2255
2254
  const valueAfterCaret = this.telInput.value.substring(currentCaretPos);
@@ -2283,7 +2282,7 @@ var Iti = class {
2283
2282
  if (strictMode || separateDialCode) {
2284
2283
  this._handleKeydownEvent = (e) => {
2285
2284
  if (e.key && e.key.length === 1 && !e.altKey && !e.ctrlKey && !e.metaKey) {
2286
- if (separateDialCode && allowDropdown && e.key === "+") {
2285
+ if (separateDialCode && allowDropdown && countrySearch && e.key === "+") {
2287
2286
  e.preventDefault();
2288
2287
  this._openDropdownWithPlus();
2289
2288
  return;
@@ -3099,7 +3098,7 @@ var intlTelInput = Object.assign(
3099
3098
  //* A map from instance ID to instance object.
3100
3099
  instances: {},
3101
3100
  loadUtils,
3102
- version: "24.3.3"
3101
+ version: "24.3.5"
3103
3102
  }
3104
3103
  );
3105
3104
  var intl_tel_input_default = intlTelInput;
@@ -1727,7 +1727,6 @@ var Iti = class {
1727
1727
  }
1728
1728
  if (this.options.separateDialCode) {
1729
1729
  this.options.nationalMode = false;
1730
- this.options.countrySearch = true;
1731
1730
  }
1732
1731
  if (this.options.allowDropdown && !this.options.showFlags && !this.options.separateDialCode) {
1733
1732
  this.options.nationalMode = false;
@@ -2207,13 +2206,13 @@ var Iti = class {
2207
2206
  }
2208
2207
  //* Initialize the tel input listeners.
2209
2208
  _initTelInputListeners() {
2210
- const { strictMode, formatAsYouType, separateDialCode, formatOnDisplay, allowDropdown } = this.options;
2209
+ const { strictMode, formatAsYouType, separateDialCode, formatOnDisplay, allowDropdown, countrySearch } = this.options;
2211
2210
  let userOverrideFormatting = false;
2212
2211
  if (/\p{L}/u.test(this.telInput.value)) {
2213
2212
  userOverrideFormatting = true;
2214
2213
  }
2215
2214
  this._handleInputEvent = (e) => {
2216
- if (this.isAndroid && e?.data === "+" && separateDialCode && allowDropdown) {
2215
+ if (this.isAndroid && e?.data === "+" && separateDialCode && allowDropdown && countrySearch) {
2217
2216
  const currentCaretPos = this.telInput.selectionStart || 0;
2218
2217
  const valueBeforeCaret = this.telInput.value.substring(0, currentCaretPos - 1);
2219
2218
  const valueAfterCaret = this.telInput.value.substring(currentCaretPos);
@@ -2247,7 +2246,7 @@ var Iti = class {
2247
2246
  if (strictMode || separateDialCode) {
2248
2247
  this._handleKeydownEvent = (e) => {
2249
2248
  if (e.key && e.key.length === 1 && !e.altKey && !e.ctrlKey && !e.metaKey) {
2250
- if (separateDialCode && allowDropdown && e.key === "+") {
2249
+ if (separateDialCode && allowDropdown && countrySearch && e.key === "+") {
2251
2250
  e.preventDefault();
2252
2251
  this._openDropdownWithPlus();
2253
2252
  return;
@@ -3063,7 +3062,7 @@ var intlTelInput = Object.assign(
3063
3062
  //* A map from instance ID to instance object.
3064
3063
  instances: {},
3065
3064
  loadUtils,
3066
- version: "24.3.3"
3065
+ version: "24.3.5"
3067
3066
  }
3068
3067
  );
3069
3068
  var intl_tel_input_default = intlTelInput;
package/vue/README.md CHANGED
@@ -2,20 +2,18 @@
2
2
  A Vue component wrapper for the [intl-tel-input](https://github.com/jackocnr/intl-tel-input) JavaScript plugin. View the [source code](https://github.com/jackocnr/intl-tel-input/blob/master/vue/src/intl-tel-input/IntlTelInput.vue).
3
3
 
4
4
  ## Table of Contents
5
- - [Demo and Examples](#demo-and-examples)
5
+ - [Demo](#demo)
6
6
  - [Getting Started](#getting-started)
7
7
  - [Props](#props)
8
- - [Accessing Instance Methods](#accessing-instance-methods)
9
- - [Accessing Static Methods](#accessing-static-methods)
10
- - [Troubleshooting](#troubleshooting)
11
8
 
12
- ## Demo and Examples
9
+ ## Demo
13
10
  Try it for yourself by downloading the project and running `npm install` and then `npm run vue:demo` and then copying the given URL into your browser.
14
11
 
15
12
  ## Getting Started
16
13
  ```vue
17
14
  <script setup>
18
- import IntlTelInput from "../../src/intl-tel-input/IntlTelInputWithUtils.vue";
15
+ import IntlTelInput from "intl-tel-input/vueWithUtils";
16
+ import "intl-tel-input/styles";
19
17
  </script>
20
18
 
21
19
  <template>
@@ -29,13 +27,13 @@ Try it for yourself by downloading the project and running `npm install` and the
29
27
 
30
28
  See the [Validation demo](https://github.com/jackocnr/intl-tel-input/blob/master/vue/demo/validation/App.vue) for a more fleshed-out example of how to handle validation [COMING SOON].
31
29
 
32
- 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 IntlTelInput from `"intl-tel-input/vueWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/vue"` import, then you should couple this with the `utilsScript` 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 `utilsScript` option to that URL, or alternatively just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@24.3.3/build/js/utils.js"`.
30
+ 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 IntlTelInput from `"intl-tel-input/vueWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/vue"` import, then you should couple this with the `utilsScript` 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 `utilsScript` option to that URL, or alternatively just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@24.3.5/build/js/utils.js"`.
33
31
 
34
32
  ## Props
35
33
  Here's a list of all of the current props you can pass to the IntlTelInput Vue component.
36
34
 
37
35
  **options**
38
36
  Type: `Object`
39
- An object containing all of the [initialisation options](https://github.com/jackocnr/intl-tel-input?tab=readme-ov-file#initialisation-options) to pass to the plugin. You can use these exactly the same as when using the plugin with pure JavaScript.
37
+ An object containing the [initialisation options](https://github.com/jackocnr/intl-tel-input?tab=readme-ov-file#initialisation-options) to pass to the plugin. You can use these exactly the same way as with the main JavaScript plugin.
40
38
 
41
- [MORE COMING SOON]
39
+ [MORE COMING SOON]