@intl-tel-input/react 29.5.8 → 29.5.9
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/dist/IntlTelInput.js +11 -21
- package/dist/IntlTelInputWithUtils.js +11 -21
- package/package.json +2 -2
package/dist/IntlTelInput.js
CHANGED
|
@@ -4529,33 +4529,23 @@ var Iti = class _Iti {
|
|
|
4529
4529
|
}
|
|
4530
4530
|
//* Update the maximum valid number length for the currently selected country.
|
|
4531
4531
|
#updateMaxCoreNumberLength() {
|
|
4532
|
-
const { strictMode,
|
|
4532
|
+
const { strictMode, allowedNumberTypes } = this.#options;
|
|
4533
4533
|
if (!strictMode || !intlTelInput.utils) {
|
|
4534
4534
|
return;
|
|
4535
4535
|
}
|
|
4536
|
-
|
|
4537
|
-
if (!iso2) {
|
|
4536
|
+
if (!this.#selectedCountry) {
|
|
4538
4537
|
this.#maxCoreNumberLength = null;
|
|
4539
4538
|
return;
|
|
4540
4539
|
}
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
);
|
|
4546
|
-
let validNumber = exampleNumber;
|
|
4547
|
-
while (intlTelInput.utils.isValidNumber(
|
|
4548
|
-
exampleNumber,
|
|
4549
|
-
iso2,
|
|
4550
|
-
allowedNumberTypes
|
|
4551
|
-
)) {
|
|
4552
|
-
validNumber = exampleNumber;
|
|
4553
|
-
exampleNumber += "0";
|
|
4540
|
+
const { iso2, dialCode } = this.#selectedCountry;
|
|
4541
|
+
let number = `+${dialCode}${"9".repeat(E164_MAX_DIGITS)}`;
|
|
4542
|
+
while (number.length > dialCode.length + 1 && !intlTelInput.utils.isValidNumber(number, iso2, allowedNumberTypes)) {
|
|
4543
|
+
number = number.slice(0, -1);
|
|
4554
4544
|
}
|
|
4555
|
-
const coreNumber = intlTelInput.utils.getCoreNumber(
|
|
4556
|
-
this.#maxCoreNumberLength = coreNumber.length;
|
|
4557
|
-
if (iso2 === "by") {
|
|
4558
|
-
this.#maxCoreNumberLength
|
|
4545
|
+
const coreNumber = intlTelInput.utils.getCoreNumber(number, iso2);
|
|
4546
|
+
this.#maxCoreNumberLength = coreNumber.length || null;
|
|
4547
|
+
if (iso2 === "by" && this.#maxCoreNumberLength) {
|
|
4548
|
+
this.#maxCoreNumberLength += 1;
|
|
4559
4549
|
}
|
|
4560
4550
|
}
|
|
4561
4551
|
//* Update the input placeholder to an example number from the currently selected country.
|
|
@@ -5014,7 +5004,7 @@ var intlTelInput = Object.assign(
|
|
|
5014
5004
|
attachUtils,
|
|
5015
5005
|
startedLoadingUtils: false,
|
|
5016
5006
|
startedLoadingAutoCountry: false,
|
|
5017
|
-
version: "29.5.
|
|
5007
|
+
version: "29.5.9",
|
|
5018
5008
|
NUMBER_FORMAT,
|
|
5019
5009
|
NUMBER_TYPE,
|
|
5020
5010
|
VALIDATION_ERROR,
|
|
@@ -4529,33 +4529,23 @@ var Iti = class _Iti {
|
|
|
4529
4529
|
}
|
|
4530
4530
|
//* Update the maximum valid number length for the currently selected country.
|
|
4531
4531
|
#updateMaxCoreNumberLength() {
|
|
4532
|
-
const { strictMode,
|
|
4532
|
+
const { strictMode, allowedNumberTypes } = this.#options;
|
|
4533
4533
|
if (!strictMode || !intlTelInput.utils) {
|
|
4534
4534
|
return;
|
|
4535
4535
|
}
|
|
4536
|
-
|
|
4537
|
-
if (!iso2) {
|
|
4536
|
+
if (!this.#selectedCountry) {
|
|
4538
4537
|
this.#maxCoreNumberLength = null;
|
|
4539
4538
|
return;
|
|
4540
4539
|
}
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
);
|
|
4546
|
-
let validNumber = exampleNumber;
|
|
4547
|
-
while (intlTelInput.utils.isValidNumber(
|
|
4548
|
-
exampleNumber,
|
|
4549
|
-
iso2,
|
|
4550
|
-
allowedNumberTypes
|
|
4551
|
-
)) {
|
|
4552
|
-
validNumber = exampleNumber;
|
|
4553
|
-
exampleNumber += "0";
|
|
4540
|
+
const { iso2, dialCode } = this.#selectedCountry;
|
|
4541
|
+
let number = `+${dialCode}${"9".repeat(E164_MAX_DIGITS)}`;
|
|
4542
|
+
while (number.length > dialCode.length + 1 && !intlTelInput.utils.isValidNumber(number, iso2, allowedNumberTypes)) {
|
|
4543
|
+
number = number.slice(0, -1);
|
|
4554
4544
|
}
|
|
4555
|
-
const coreNumber = intlTelInput.utils.getCoreNumber(
|
|
4556
|
-
this.#maxCoreNumberLength = coreNumber.length;
|
|
4557
|
-
if (iso2 === "by") {
|
|
4558
|
-
this.#maxCoreNumberLength
|
|
4545
|
+
const coreNumber = intlTelInput.utils.getCoreNumber(number, iso2);
|
|
4546
|
+
this.#maxCoreNumberLength = coreNumber.length || null;
|
|
4547
|
+
if (iso2 === "by" && this.#maxCoreNumberLength) {
|
|
4548
|
+
this.#maxCoreNumberLength += 1;
|
|
4559
4549
|
}
|
|
4560
4550
|
}
|
|
4561
4551
|
//* Update the input placeholder to an example number from the currently selected country.
|
|
@@ -5014,7 +5004,7 @@ var intlTelInput = Object.assign(
|
|
|
5014
5004
|
attachUtils,
|
|
5015
5005
|
startedLoadingUtils: false,
|
|
5016
5006
|
startedLoadingAutoCountry: false,
|
|
5017
|
-
version: "29.5.
|
|
5007
|
+
version: "29.5.9",
|
|
5018
5008
|
NUMBER_FORMAT,
|
|
5019
5009
|
NUMBER_TYPE,
|
|
5020
5010
|
VALIDATION_ERROR,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intl-tel-input/react",
|
|
3
|
-
"version": "29.5.
|
|
3
|
+
"version": "29.5.9",
|
|
4
4
|
"description": "A React component for intl-tel-input, for entering, formatting, and validating international telephone numbers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"README.md"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"intl-tel-input": "^29.5.
|
|
37
|
+
"intl-tel-input": "^29.5.9"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"react": ">=18",
|