intl-tel-input 23.7.0 → 23.7.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": "23.7.0",
3
+ "version": "23.7.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@23.7.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@23.7.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.
@@ -1563,12 +1563,13 @@ var Iti = class {
1563
1563
  this._processAllCountries();
1564
1564
  this._processDialCodes();
1565
1565
  this._translateCountryNames();
1566
- if (this.options.countryOrder) {
1567
- this.options.countryOrder = this.options.countryOrder.map((country) => country.toLowerCase());
1568
- }
1569
1566
  this._sortCountries();
1570
1567
  }
1568
+ //* Sort countries by countryOrder option (if present), then name.
1571
1569
  _sortCountries() {
1570
+ if (this.options.countryOrder) {
1571
+ this.options.countryOrder = this.options.countryOrder.map((country) => country.toLowerCase());
1572
+ }
1572
1573
  this.countries.sort((a, b) => {
1573
1574
  const { countryOrder } = this.options;
1574
1575
  if (countryOrder) {
@@ -1583,13 +1584,7 @@ var Iti = class {
1583
1584
  return aIndexExists ? -1 : 1;
1584
1585
  }
1585
1586
  }
1586
- if (a.name < b.name) {
1587
- return -1;
1588
- }
1589
- if (a.name > b.name) {
1590
- return 1;
1591
- }
1592
- return 0;
1587
+ return a.name.localeCompare(b.name);
1593
1588
  });
1594
1589
  }
1595
1590
  //* Add a dial code to this.dialCodeToIso2Map.
@@ -2817,7 +2812,7 @@ var intlTelInput = Object.assign(
2817
2812
  //* A map from instance ID to instance object.
2818
2813
  instances: {},
2819
2814
  loadUtils,
2820
- version: "23.7.0"
2815
+ version: "23.7.1"
2821
2816
  }
2822
2817
  );
2823
2818
  var intl_tel_input_default = intlTelInput;
@@ -1527,12 +1527,13 @@ var Iti = class {
1527
1527
  this._processAllCountries();
1528
1528
  this._processDialCodes();
1529
1529
  this._translateCountryNames();
1530
- if (this.options.countryOrder) {
1531
- this.options.countryOrder = this.options.countryOrder.map((country) => country.toLowerCase());
1532
- }
1533
1530
  this._sortCountries();
1534
1531
  }
1532
+ //* Sort countries by countryOrder option (if present), then name.
1535
1533
  _sortCountries() {
1534
+ if (this.options.countryOrder) {
1535
+ this.options.countryOrder = this.options.countryOrder.map((country) => country.toLowerCase());
1536
+ }
1536
1537
  this.countries.sort((a, b) => {
1537
1538
  const { countryOrder } = this.options;
1538
1539
  if (countryOrder) {
@@ -1547,13 +1548,7 @@ var Iti = class {
1547
1548
  return aIndexExists ? -1 : 1;
1548
1549
  }
1549
1550
  }
1550
- if (a.name < b.name) {
1551
- return -1;
1552
- }
1553
- if (a.name > b.name) {
1554
- return 1;
1555
- }
1556
- return 0;
1551
+ return a.name.localeCompare(b.name);
1557
1552
  });
1558
1553
  }
1559
1554
  //* Add a dial code to this.dialCodeToIso2Map.
@@ -2781,7 +2776,7 @@ var intlTelInput = Object.assign(
2781
2776
  //* A map from instance ID to instance object.
2782
2777
  instances: {},
2783
2778
  loadUtils,
2784
- version: "23.7.0"
2779
+ version: "23.7.1"
2785
2780
  }
2786
2781
  );
2787
2782
  var intl_tel_input_default = intlTelInput;
@@ -1563,12 +1563,13 @@ var Iti = class {
1563
1563
  this._processAllCountries();
1564
1564
  this._processDialCodes();
1565
1565
  this._translateCountryNames();
1566
- if (this.options.countryOrder) {
1567
- this.options.countryOrder = this.options.countryOrder.map((country) => country.toLowerCase());
1568
- }
1569
1566
  this._sortCountries();
1570
1567
  }
1568
+ //* Sort countries by countryOrder option (if present), then name.
1571
1569
  _sortCountries() {
1570
+ if (this.options.countryOrder) {
1571
+ this.options.countryOrder = this.options.countryOrder.map((country) => country.toLowerCase());
1572
+ }
1572
1573
  this.countries.sort((a, b) => {
1573
1574
  const { countryOrder } = this.options;
1574
1575
  if (countryOrder) {
@@ -1583,13 +1584,7 @@ var Iti = class {
1583
1584
  return aIndexExists ? -1 : 1;
1584
1585
  }
1585
1586
  }
1586
- if (a.name < b.name) {
1587
- return -1;
1588
- }
1589
- if (a.name > b.name) {
1590
- return 1;
1591
- }
1592
- return 0;
1587
+ return a.name.localeCompare(b.name);
1593
1588
  });
1594
1589
  }
1595
1590
  //* Add a dial code to this.dialCodeToIso2Map.
@@ -2817,7 +2812,7 @@ var intlTelInput = Object.assign(
2817
2812
  //* A map from instance ID to instance object.
2818
2813
  instances: {},
2819
2814
  loadUtils,
2820
- version: "23.7.0"
2815
+ version: "23.7.1"
2821
2816
  }
2822
2817
  );
2823
2818
  var intl_tel_input_default = intlTelInput;
@@ -1527,12 +1527,13 @@ var Iti = class {
1527
1527
  this._processAllCountries();
1528
1528
  this._processDialCodes();
1529
1529
  this._translateCountryNames();
1530
- if (this.options.countryOrder) {
1531
- this.options.countryOrder = this.options.countryOrder.map((country) => country.toLowerCase());
1532
- }
1533
1530
  this._sortCountries();
1534
1531
  }
1532
+ //* Sort countries by countryOrder option (if present), then name.
1535
1533
  _sortCountries() {
1534
+ if (this.options.countryOrder) {
1535
+ this.options.countryOrder = this.options.countryOrder.map((country) => country.toLowerCase());
1536
+ }
1536
1537
  this.countries.sort((a, b) => {
1537
1538
  const { countryOrder } = this.options;
1538
1539
  if (countryOrder) {
@@ -1547,13 +1548,7 @@ var Iti = class {
1547
1548
  return aIndexExists ? -1 : 1;
1548
1549
  }
1549
1550
  }
1550
- if (a.name < b.name) {
1551
- return -1;
1552
- }
1553
- if (a.name > b.name) {
1554
- return 1;
1555
- }
1556
- return 0;
1551
+ return a.name.localeCompare(b.name);
1557
1552
  });
1558
1553
  }
1559
1554
  //* Add a dial code to this.dialCodeToIso2Map.
@@ -2781,7 +2776,7 @@ var intlTelInput = Object.assign(
2781
2776
  //* A map from instance ID to instance object.
2782
2777
  instances: {},
2783
2778
  loadUtils,
2784
- version: "23.7.0"
2779
+ version: "23.7.1"
2785
2780
  }
2786
2781
  );
2787
2782
  var intl_tel_input_default = intlTelInput;