intl-tel-input 25.1.0 → 25.1.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": "25.1.0",
3
+ "version": "25.1.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
@@ -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 `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@25.1.0/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 `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@25.1.1/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.
@@ -2591,10 +2591,6 @@ var Iti = class {
2591
2591
  const selectedDialCode = this.selectedCountryData.dialCode;
2592
2592
  number = this._ensureHasDialCode(number);
2593
2593
  const dialCodeMatch = this._getDialCode(number, true);
2594
- if (dialCodeMatch && dialCodeMatch === this.prevDialCodeMatch) {
2595
- return null;
2596
- }
2597
- this.prevDialCodeMatch = dialCodeMatch;
2598
2594
  const numeric = getNumeric(number);
2599
2595
  if (dialCodeMatch) {
2600
2596
  const dialCodeMatchNumeric = getNumeric(dialCodeMatch);
@@ -2602,7 +2598,7 @@ var Iti = class {
2602
2598
  if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
2603
2599
  return this.defaultCountry;
2604
2600
  }
2605
- const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && numeric.length === dialCodeMatchNumeric.length;
2601
+ const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && (numeric.length === dialCodeMatchNumeric.length || !this.selectedCountryData.areaCodes);
2606
2602
  const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
2607
2603
  if (!isRegionlessNanpNumber && !alreadySelected) {
2608
2604
  for (let j = 0; j < iso2Codes.length; j++) {
@@ -3168,7 +3164,7 @@ var intlTelInput = Object.assign(
3168
3164
  attachUtils,
3169
3165
  startedLoadingUtilsScript: false,
3170
3166
  startedLoadingAutoCountry: false,
3171
- version: "25.1.0"
3167
+ version: "25.1.1"
3172
3168
  }
3173
3169
  );
3174
3170
  var intl_tel_input_default = intlTelInput;
@@ -394,7 +394,6 @@ declare module "intl-tel-input" {
394
394
  private defaultCountry;
395
395
  private originalPaddingRight;
396
396
  private originalPaddingLeft;
397
- private prevDialCodeMatch;
398
397
  private _handleHiddenInputSubmit;
399
398
  private _handleLabelClick;
400
399
  private _handleClickSelectedCountry;
@@ -2555,10 +2555,6 @@ var Iti = class {
2555
2555
  const selectedDialCode = this.selectedCountryData.dialCode;
2556
2556
  number = this._ensureHasDialCode(number);
2557
2557
  const dialCodeMatch = this._getDialCode(number, true);
2558
- if (dialCodeMatch && dialCodeMatch === this.prevDialCodeMatch) {
2559
- return null;
2560
- }
2561
- this.prevDialCodeMatch = dialCodeMatch;
2562
2558
  const numeric = getNumeric(number);
2563
2559
  if (dialCodeMatch) {
2564
2560
  const dialCodeMatchNumeric = getNumeric(dialCodeMatch);
@@ -2566,7 +2562,7 @@ var Iti = class {
2566
2562
  if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
2567
2563
  return this.defaultCountry;
2568
2564
  }
2569
- const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && numeric.length === dialCodeMatchNumeric.length;
2565
+ const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && (numeric.length === dialCodeMatchNumeric.length || !this.selectedCountryData.areaCodes);
2570
2566
  const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
2571
2567
  if (!isRegionlessNanpNumber && !alreadySelected) {
2572
2568
  for (let j = 0; j < iso2Codes.length; j++) {
@@ -3132,7 +3128,7 @@ var intlTelInput = Object.assign(
3132
3128
  attachUtils,
3133
3129
  startedLoadingUtilsScript: false,
3134
3130
  startedLoadingAutoCountry: false,
3135
- version: "25.1.0"
3131
+ version: "25.1.1"
3136
3132
  }
3137
3133
  );
3138
3134
  var intl_tel_input_default = intlTelInput;
@@ -2591,10 +2591,6 @@ var Iti = class {
2591
2591
  const selectedDialCode = this.selectedCountryData.dialCode;
2592
2592
  number = this._ensureHasDialCode(number);
2593
2593
  const dialCodeMatch = this._getDialCode(number, true);
2594
- if (dialCodeMatch && dialCodeMatch === this.prevDialCodeMatch) {
2595
- return null;
2596
- }
2597
- this.prevDialCodeMatch = dialCodeMatch;
2598
2594
  const numeric = getNumeric(number);
2599
2595
  if (dialCodeMatch) {
2600
2596
  const dialCodeMatchNumeric = getNumeric(dialCodeMatch);
@@ -2602,7 +2598,7 @@ var Iti = class {
2602
2598
  if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
2603
2599
  return this.defaultCountry;
2604
2600
  }
2605
- const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && numeric.length === dialCodeMatchNumeric.length;
2601
+ const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && (numeric.length === dialCodeMatchNumeric.length || !this.selectedCountryData.areaCodes);
2606
2602
  const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
2607
2603
  if (!isRegionlessNanpNumber && !alreadySelected) {
2608
2604
  for (let j = 0; j < iso2Codes.length; j++) {
@@ -3168,7 +3164,7 @@ var intlTelInput = Object.assign(
3168
3164
  attachUtils,
3169
3165
  startedLoadingUtilsScript: false,
3170
3166
  startedLoadingAutoCountry: false,
3171
- version: "25.1.0"
3167
+ version: "25.1.1"
3172
3168
  }
3173
3169
  );
3174
3170
  var intl_tel_input_default = intlTelInput;
@@ -2555,10 +2555,6 @@ var Iti = class {
2555
2555
  const selectedDialCode = this.selectedCountryData.dialCode;
2556
2556
  number = this._ensureHasDialCode(number);
2557
2557
  const dialCodeMatch = this._getDialCode(number, true);
2558
- if (dialCodeMatch && dialCodeMatch === this.prevDialCodeMatch) {
2559
- return null;
2560
- }
2561
- this.prevDialCodeMatch = dialCodeMatch;
2562
2558
  const numeric = getNumeric(number);
2563
2559
  if (dialCodeMatch) {
2564
2560
  const dialCodeMatchNumeric = getNumeric(dialCodeMatch);
@@ -2566,7 +2562,7 @@ var Iti = class {
2566
2562
  if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
2567
2563
  return this.defaultCountry;
2568
2564
  }
2569
- const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && numeric.length === dialCodeMatchNumeric.length;
2565
+ const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && (numeric.length === dialCodeMatchNumeric.length || !this.selectedCountryData.areaCodes);
2570
2566
  const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
2571
2567
  if (!isRegionlessNanpNumber && !alreadySelected) {
2572
2568
  for (let j = 0; j < iso2Codes.length; j++) {
@@ -3132,7 +3128,7 @@ var intlTelInput = Object.assign(
3132
3128
  attachUtils,
3133
3129
  startedLoadingUtilsScript: false,
3134
3130
  startedLoadingAutoCountry: false,
3135
- version: "25.1.0"
3131
+ version: "25.1.1"
3136
3132
  }
3137
3133
  );
3138
3134
  var intl_tel_input_default = intlTelInput;
package/vue/README.md CHANGED
@@ -34,7 +34,7 @@ See the [Validation demo](https://github.com/jackocnr/intl-tel-input/blob/master
34
34
  "vue:demo": "vite --config vue/demo/[demo variant]/vite.config.js"
35
35
  ```
36
36
 
37
- 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 `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@25.1.0/build/js/utils.js"`.
37
+ 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 `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@25.1.1/build/js/utils.js"`.
38
38
 
39
39
  ## Props
40
40
  Here's a list of all of the current props you can pass to the IntlTelInput Vue component.
@@ -2161,16 +2161,12 @@ class G {
2161
2161
  let i = e ? t.substring(e) : t;
2162
2162
  const s = this.selectedCountryData.iso2, n = this.selectedCountryData.dialCode;
2163
2163
  i = this._ensureHasDialCode(i);
2164
- const o = this._getDialCode(i, !0);
2165
- if (o && o === this.prevDialCodeMatch)
2166
- return null;
2167
- this.prevDialCodeMatch = o;
2168
- const r = v(i);
2164
+ const o = this._getDialCode(i, !0), r = v(i);
2169
2165
  if (o) {
2170
2166
  const a = v(o), c = this.dialCodeToIso2Map[a];
2171
2167
  if (!s && this.defaultCountry && c.includes(this.defaultCountry))
2172
2168
  return this.defaultCountry;
2173
- const d = s && c.includes(s) && r.length === a.length;
2169
+ const d = s && c.includes(s) && (r.length === a.length || !this.selectedCountryData.areaCodes);
2174
2170
  if (!(n === "1" && S(r)) && !d) {
2175
2171
  for (let p = 0; p < c.length; p++)
2176
2172
  if (c[p])
@@ -2533,7 +2529,7 @@ const W = (u) => {
2533
2529
  attachUtils: W,
2534
2530
  startedLoadingUtilsScript: !1,
2535
2531
  startedLoadingAutoCountry: !1,
2536
- version: "25.1.0"
2532
+ version: "25.1.1"
2537
2533
  }
2538
2534
  ), J = {
2539
2535
  __name: "IntlTelInput",
@@ -2161,16 +2161,12 @@ class K2 {
2161
2161
  let r = n ? e.substring(n) : e;
2162
2162
  const o = this.selectedCountryData.iso2, a = this.selectedCountryData.dialCode;
2163
2163
  r = this._ensureHasDialCode(r);
2164
- const c = this._getDialCode(r, !0);
2165
- if (c && c === this.prevDialCodeMatch)
2166
- return null;
2167
- this.prevDialCodeMatch = c;
2168
- const g = c1(r);
2164
+ const c = this._getDialCode(r, !0), g = c1(r);
2169
2165
  if (c) {
2170
2166
  const f = c1(c), S = this.dialCodeToIso2Map[f];
2171
2167
  if (!o && this.defaultCountry && S.includes(this.defaultCountry))
2172
2168
  return this.defaultCountry;
2173
- const _ = o && S.includes(o) && g.length === f.length;
2169
+ const _ = o && S.includes(o) && (g.length === f.length || !this.selectedCountryData.areaCodes);
2174
2170
  if (!(a === "1" && o2(g)) && !_) {
2175
2171
  for (let w = 0; w < S.length; w++)
2176
2172
  if (S[w])
@@ -2533,7 +2529,7 @@ const H2 = (y) => {
2533
2529
  attachUtils: H2,
2534
2530
  startedLoadingUtilsScript: !1,
2535
2531
  startedLoadingAutoCountry: !1,
2536
- version: "25.1.0"
2532
+ version: "25.1.1"
2537
2533
  }
2538
2534
  );
2539
2535
  (function() {