intl-tel-input 24.3.0 → 24.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intl-tel-input",
3
- "version": "24.3.0",
3
+ "version": "24.3.1",
4
4
  "description": "A JavaScript plugin for entering and validating international telephone numbers",
5
5
  "keywords": [
6
6
  "international",
package/react/README.md CHANGED
@@ -29,7 +29,7 @@ import "intl-tel-input/styles";
29
29
 
30
30
  See the [Validation demo](https://github.com/jackocnr/intl-tel-input/blob/master/react/demo/ValidationApp.tsx) for a more fleshed-out example of how to handle validation.
31
31
 
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/reactWithUtils"` instead, 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.0/build/js/utils.js"`.
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/reactWithUtils"` instead, 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.1/build/js/utils.js"`.
33
33
 
34
34
  ## Props
35
35
  Here's a list of all of the current props you can pass to the IntlTelInput react component.
@@ -2634,12 +2634,14 @@ var Iti = class {
2634
2634
  }
2635
2635
  //* Update the input padding to make space for the selected country/dial code.
2636
2636
  _updateInputPadding() {
2637
- const selectedCountryWidth = this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth();
2638
- const inputPadding = selectedCountryWidth + 6;
2639
- if (this.showSelectedCountryOnLeft) {
2640
- this.telInput.style.paddingLeft = `${inputPadding}px`;
2641
- } else {
2642
- this.telInput.style.paddingRight = `${inputPadding}px`;
2637
+ if (this.selectedCountry) {
2638
+ const selectedCountryWidth = this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth();
2639
+ const inputPadding = selectedCountryWidth + 6;
2640
+ if (this.showSelectedCountryOnLeft) {
2641
+ this.telInput.style.paddingLeft = `${inputPadding}px`;
2642
+ } else {
2643
+ this.telInput.style.paddingRight = `${inputPadding}px`;
2644
+ }
2643
2645
  }
2644
2646
  }
2645
2647
  //* Update the maximum valid number length for the currently selected country.
@@ -3091,7 +3093,7 @@ var intlTelInput = Object.assign(
3091
3093
  //* A map from instance ID to instance object.
3092
3094
  instances: {},
3093
3095
  loadUtils,
3094
- version: "24.3.0"
3096
+ version: "24.3.1"
3095
3097
  }
3096
3098
  );
3097
3099
  var intl_tel_input_default = intlTelInput;
@@ -2598,12 +2598,14 @@ var Iti = class {
2598
2598
  }
2599
2599
  //* Update the input padding to make space for the selected country/dial code.
2600
2600
  _updateInputPadding() {
2601
- const selectedCountryWidth = this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth();
2602
- const inputPadding = selectedCountryWidth + 6;
2603
- if (this.showSelectedCountryOnLeft) {
2604
- this.telInput.style.paddingLeft = `${inputPadding}px`;
2605
- } else {
2606
- this.telInput.style.paddingRight = `${inputPadding}px`;
2601
+ if (this.selectedCountry) {
2602
+ const selectedCountryWidth = this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth();
2603
+ const inputPadding = selectedCountryWidth + 6;
2604
+ if (this.showSelectedCountryOnLeft) {
2605
+ this.telInput.style.paddingLeft = `${inputPadding}px`;
2606
+ } else {
2607
+ this.telInput.style.paddingRight = `${inputPadding}px`;
2608
+ }
2607
2609
  }
2608
2610
  }
2609
2611
  //* Update the maximum valid number length for the currently selected country.
@@ -3055,7 +3057,7 @@ var intlTelInput = Object.assign(
3055
3057
  //* A map from instance ID to instance object.
3056
3058
  instances: {},
3057
3059
  loadUtils,
3058
- version: "24.3.0"
3060
+ version: "24.3.1"
3059
3061
  }
3060
3062
  );
3061
3063
  var intl_tel_input_default = intlTelInput;
@@ -2634,12 +2634,14 @@ var Iti = class {
2634
2634
  }
2635
2635
  //* Update the input padding to make space for the selected country/dial code.
2636
2636
  _updateInputPadding() {
2637
- const selectedCountryWidth = this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth();
2638
- const inputPadding = selectedCountryWidth + 6;
2639
- if (this.showSelectedCountryOnLeft) {
2640
- this.telInput.style.paddingLeft = `${inputPadding}px`;
2641
- } else {
2642
- this.telInput.style.paddingRight = `${inputPadding}px`;
2637
+ if (this.selectedCountry) {
2638
+ const selectedCountryWidth = this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth();
2639
+ const inputPadding = selectedCountryWidth + 6;
2640
+ if (this.showSelectedCountryOnLeft) {
2641
+ this.telInput.style.paddingLeft = `${inputPadding}px`;
2642
+ } else {
2643
+ this.telInput.style.paddingRight = `${inputPadding}px`;
2644
+ }
2643
2645
  }
2644
2646
  }
2645
2647
  //* Update the maximum valid number length for the currently selected country.
@@ -3091,7 +3093,7 @@ var intlTelInput = Object.assign(
3091
3093
  //* A map from instance ID to instance object.
3092
3094
  instances: {},
3093
3095
  loadUtils,
3094
- version: "24.3.0"
3096
+ version: "24.3.1"
3095
3097
  }
3096
3098
  );
3097
3099
  var intl_tel_input_default = intlTelInput;
@@ -2598,12 +2598,14 @@ var Iti = class {
2598
2598
  }
2599
2599
  //* Update the input padding to make space for the selected country/dial code.
2600
2600
  _updateInputPadding() {
2601
- const selectedCountryWidth = this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth();
2602
- const inputPadding = selectedCountryWidth + 6;
2603
- if (this.showSelectedCountryOnLeft) {
2604
- this.telInput.style.paddingLeft = `${inputPadding}px`;
2605
- } else {
2606
- this.telInput.style.paddingRight = `${inputPadding}px`;
2601
+ if (this.selectedCountry) {
2602
+ const selectedCountryWidth = this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth();
2603
+ const inputPadding = selectedCountryWidth + 6;
2604
+ if (this.showSelectedCountryOnLeft) {
2605
+ this.telInput.style.paddingLeft = `${inputPadding}px`;
2606
+ } else {
2607
+ this.telInput.style.paddingRight = `${inputPadding}px`;
2608
+ }
2607
2609
  }
2608
2610
  }
2609
2611
  //* Update the maximum valid number length for the currently selected country.
@@ -3055,7 +3057,7 @@ var intlTelInput = Object.assign(
3055
3057
  //* A map from instance ID to instance object.
3056
3058
  instances: {},
3057
3059
  loadUtils,
3058
- version: "24.3.0"
3060
+ version: "24.3.1"
3059
3061
  }
3060
3062
  );
3061
3063
  var intl_tel_input_default = intlTelInput;