Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jackocnr/intl-tel-input
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v25.2.0
Choose a base ref
...
head repository: jackocnr/intl-tel-input
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Dec 8, 2024

  1. Update README.md

    jackocnr authored Dec 8, 2024
    Copy the full SHA
    289d22a View commit details
  2. Release v25.2.0

    jackocnr committed Dec 8, 2024
    Copy the full SHA
    38296c6 View commit details

Commits on Dec 10, 2024

  1. Cleanup old code

    jackocnr committed Dec 10, 2024
    Copy the full SHA
    4a36d48 View commit details
  2. Cleanup old jasmine helpers

    jackocnr committed Dec 10, 2024
    Copy the full SHA
    8f4e48a View commit details
  3. Readme: use fat arrow syntax

    jackocnr committed Dec 10, 2024
    Copy the full SHA
    e4e4eab View commit details
  4. Copy the full SHA
    a63e82a View commit details
  5. Copy the full SHA
    772a18f View commit details
  6. Copy the full SHA
    214feb2 View commit details
  7. Tweak

    jackocnr committed Dec 10, 2024
    Copy the full SHA
    4734e48 View commit details
  8. Whitespace cleanup

    jackocnr committed Dec 10, 2024
    Copy the full SHA
    568fd90 View commit details
  9. Fix typo

    jackocnr committed Dec 10, 2024
    Copy the full SHA
    4290eec View commit details
  10. Copy the full SHA
    6679c75 View commit details

Commits on Dec 31, 2024

  1. Update interface.ts

    hasan-ozbey authored and jackocnr committed Dec 31, 2024
    Copy the full SHA
    c359dca View commit details
  2. Translation build file

    jackocnr committed Dec 31, 2024
    Copy the full SHA
    6aa469a View commit details
  3. Copy the full SHA
    f5f7273 View commit details
  4. Release v25.2.1

    jackocnr committed Dec 31, 2024
    Copy the full SHA
    4535f07 View commit details

Commits on Jan 30, 2025

  1. Update interface.js

    Updated Danish localisation
    the-lazy-god authored and jackocnr committed Jan 30, 2025
    Copy the full SHA
    0d5b770 View commit details
  2. Fix korean translation

    - fixed awkward expression due to Google Translate
    - unified the wording for one search result and several search results
    - fixed the Ascension Island that was misinterpreted as 'Seungcheon Island(승천섬)'
    moozeh authored and jackocnr committed Jan 30, 2025
    Copy the full SHA
    3588d29 View commit details
  3. translation build files

    jackocnr committed Jan 30, 2025
    Copy the full SHA
    e80a9cd View commit details

Commits on Feb 1, 2025

  1. Bump flag-icons from 7.2.3 to 7.3.2

    Bumps [flag-icons](https://github.com/lipis/flag-icons) from 7.2.3 to 7.3.2.
    - [Release notes](https://github.com/lipis/flag-icons/releases)
    - [Changelog](https://github.com/lipis/flag-icons/blob/main/CHANGELOG.md)
    - [Commits](lipis/flag-icons@v7.2.3...v7.3.2)
    
    ---
    updated-dependencies:
    - dependency-name: flag-icons
      dependency-type: direct:development
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and jackocnr committed Feb 1, 2025
    Copy the full SHA
    35bb453 View commit details
  2. Updated flag sprites

    jackocnr committed Feb 1, 2025
    Copy the full SHA
    03176dd View commit details
  3. Copy the full SHA
    1ae2d01 View commit details
  4. Release v25.3.0

    jackocnr committed Feb 1, 2025
    Copy the full SHA
    c3f58b8 View commit details

Commits on Feb 12, 2025

  1. add Estonian language

    4matic authored and jackocnr committed Feb 12, 2025
    Copy the full SHA
    869972d View commit details

Commits on Mar 28, 2025

  1. Copy the full SHA
    8c68481 View commit details
  2. Copy the full SHA
    a0c7fc1 View commit details
  3. Copy the full SHA
    8898389 View commit details
  4. Copy the full SHA
    a5bc935 View commit details
  5. Copy the full SHA
    7cbb588 View commit details
  6. Update package lock

    jackocnr committed Mar 28, 2025
    Copy the full SHA
    eb3b3ce View commit details
  7. Release v25.3.1

    jackocnr committed Mar 28, 2025
    Copy the full SHA
    fe81a15 View commit details

Commits on Mar 29, 2025

  1. Update README.md

    jackocnr authored Mar 29, 2025
    Copy the full SHA
    cea5666 View commit details
  2. Update README.md

    jackocnr authored Mar 29, 2025
    Copy the full SHA
    bff6b87 View commit details

Commits on May 1, 2025

  1. Copy the full SHA
    b9f78b8 View commit details
Showing with 5,297 additions and 3,216 deletions.
  1. +1 −1 .github/ISSUE_TEMPLATE.md
  2. +0 −9 .github/dependabot.yml
  3. +4 −1 .vscode/settings.json
  4. +22 −24 README.md
  5. BIN build/img/flags.png
  6. BIN build/img/flags.webp
  7. BIN build/img/flags@2x.png
  8. BIN build/img/flags@2x.webp
  9. +1 −1 build/js/data.js
  10. +1 −1 build/js/data.min.js
  11. +1 −1 build/js/i18n/da/interface.js
  12. +245 −0 build/js/i18n/ee/countries.js
  13. +5 −0 build/js/i18n/ee/index.js
  14. +13 −0 build/js/i18n/ee/interface.js
  15. +1 −0 build/js/i18n/index.js
  16. +3 −3 build/js/i18n/ko/interface.js
  17. +2 −2 build/js/i18n/tr/interface.js
  18. +19 −0 build/js/intlTelInput.d.ts
  19. +5 −5 build/js/intlTelInput.js
  20. +2 −2 build/js/intlTelInput.min.js
  21. +510 −323 build/js/intlTelInputWithUtils.js
  22. +2 −2 build/js/intlTelInputWithUtils.min.js
  23. +99 −97 build/js/utils.js
  24. +1 −1 composer.json
  25. +5 −3 grunt/generate-sprite.js
  26. +10 −9 package-lock.json
  27. +2 −2 package.json
  28. +1 −1 react/README.md
  29. +4 −4 react/build/IntlTelInput.cjs
  30. +19 −0 react/build/IntlTelInput.d.ts
  31. +4 −4 react/build/IntlTelInput.js
  32. +509 −322 react/build/IntlTelInputWithUtils.cjs
  33. +509 −322 react/build/IntlTelInputWithUtils.js
  34. +510 −323 react/demo/set-number/set-number-bundle.js
  35. +510 −323 react/demo/simple/simple-bundle.js
  36. +510 −323 react/demo/toggle-disabled/toggle-disabled-bundle.js
  37. +510 −323 react/demo/validation/validation-bundle.js
  38. +0 −2 spec.html
  39. +11 −11 src/js/intl-tel-input.ts
  40. +2 −2 src/js/intl-tel-input/i18n/da/interface.ts
  41. +249 −0 src/js/intl-tel-input/i18n/ee/countries.ts
  42. +9 −0 src/js/intl-tel-input/i18n/ee/index.ts
  43. +18 −0 src/js/intl-tel-input/i18n/ee/interface.ts
  44. +1 −0 src/js/intl-tel-input/i18n/index.ts
  45. +4 −4 src/js/intl-tel-input/i18n/ko/interface.ts
  46. +3 −3 src/js/intl-tel-input/i18n/tr/interface.ts
  47. +0 −10 src/spec/.eslintrc.js
  48. +0 −111 src/spec/helpers/helpers.js
  49. +47 −0 src/spec/tests/options/nationalMode.js
  50. +0 −123 src/spec/tests/options/separateDialCode.js
  51. +11 −2 tests/helpers/helpers.js
  52. +170 −0 tests/options/separateDialCode.test.js
  53. +34 −5 tests/options/strictMode.test.js
  54. +1 −1 third_party/libphonenumber
  55. +1 −1 vue/README.md
  56. +6 −6 vue/build/IntlTelInput.mjs
  57. +690 −503 vue/build/IntlTelInputWithUtils.mjs
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- IMPORTANT: please read the New Issue Checklist before creating a new issue: https://github.com/jackocnr/intl-tel-input/wiki/New-Issue-Checklist -->

### Plugin version
e.g. v25.1.1 (please try latest version)
e.g. v25.3.1 (please try latest version)

### Steps to reproduce
1.
9 changes: 0 additions & 9 deletions .github/dependabot.yml

This file was deleted.

5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -53,5 +53,8 @@
"COBOL",
"ACUCOBOL"
],
"files.trimTrailingWhitespace": false
"files.trimTrailingWhitespace": true,
"[markdown]": {
"files.trimTrailingWhitespace": false
}
}
46 changes: 22 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -75,16 +75,16 @@ _Note: We have now dropped support for all versions of Internet Explorer because
## Getting Started (Using a CDN)
1. Add the CSS
```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/intl-tel-input@25.1.1/build/css/intlTelInput.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/intl-tel-input@25.3.1/build/css/intlTelInput.css">
```

2. Add the plugin script and initialise it on your input element
```html
<script src="https://cdn.jsdelivr.net/npm/intl-tel-input@25.1.1/build/js/intlTelInput.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/intl-tel-input@25.3.1/build/js/intlTelInput.min.js"></script>
<script>
const input = document.querySelector("#phone");
window.intlTelInput(input, {
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.1.1/build/js/utils.js"),
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.3.1/build/js/utils.js"),
});
</script>
```
@@ -171,7 +171,7 @@ Additional classes to add to the (injected) wrapper `<div>`.

**countryOrder**
Type: `Array` Default: `null`
Specify the ordering for the country list with an array of iso2 country codes. Any omitted countries will appear after those specified e.g. setting `countryOrder` to `["jp", "kr"]` will result in the list: Japan, South Korea, Afghanistan, Albania, Algeria etc...
Specify the ordering for the country list with an array of iso2 country codes. Any omitted countries will appear after those specified, in alphabetical order e.g. setting `countryOrder` to `["jp", "kr"]` will result in the list: Japan, South Korea, Afghanistan, Albania, Algeria etc...

**countrySearch**
Type: `Boolean` Default: `true`
@@ -183,9 +183,7 @@ Change the placeholder generated by autoPlaceholder. Must return a string.

```js
intlTelInput(input, {
customPlaceholder: function(selectedCountryPlaceholder, selectedCountryData) {
return "e.g. " + selectedCountryPlaceholder;
},
customPlaceholder: (selectedCountryPlaceholder, selectedCountryData) => "e.g. " + selectedCountryPlaceholder,
});
```

@@ -217,11 +215,11 @@ Here is an example using the [ipapi](https://ipapi.co/api/?javascript#location-o
```js
intlTelInput(input, {
initialCountry: "auto",
geoIpLookup: function(success, failure) {
geoIpLookup: (success, failure) => {
fetch("https://ipapi.co/json")
.then(function(res) { return res.json(); })
.then(function(data) { success(data.country_code); })
.catch(function() { failure(); });
.then((res) => res.json())
.then((data) => success(data.country_code))
.catch(() => failure());
}
});
```
@@ -235,12 +233,10 @@ Allows the creation of hidden input fields within a form to store the full inter

```js
intlTelInput(input, {
hiddenInput: function(telInputName) {
return {
phone: "phone_full",
country: "country_code"
};
}
hiddenInput: (telInputName) => ({
phone: "phone_full",
country: "country_code"
}),
});
```

@@ -317,7 +313,7 @@ The `loadUtils` option takes a function which returns a Promise which resolves t
```js
// (A) import utils module from a CDN
intlTelInput(htmlInputElement, {
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.1.1/build/js/utils.js"),
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.3.1/build/js/utils.js"),
});

// (B) import utils module from your own hosted version of utils.js
@@ -437,14 +433,16 @@ if (error === intlTelInput.utils.validationError.TOO_SHORT) {
```

**isValidNumber**
Check if the current number is valid based on its length - [see example](https://intl-tel-input.com/examples/validation-practical.html), which should be sufficient for most use cases. See `isValidNumberPrecise` (DANGEROUS) for more precise validation, but the advantage of `isValidNumber` is that it is much more future-proof as while countries around the world regularly update their number rules, they rarely change their number lengths. If this method returns `false`, you can use `getValidationError` to get more information. Respects the `validationNumberTypes` option (which is set to `["MOBILE"]` by default, meaning `isValidNumber` will only return `true` for mobile numbers). Requires the [utils script to be loaded](#loading-the-utilities-script).
(Note: only returns `true` for valid <ins>mobile numbers</ins> by default - see `validationNumberTypes`)
Check if the current number is valid based on its length - [see example](https://intl-tel-input.com/examples/validation-practical.html), which should be sufficient for most use cases. See `isValidNumberPrecise` (DANGEROUS) for more precise validation, but the advantage of `isValidNumber` is that it is much more future-proof, as while countries around the world regularly update their number rules, they rarely change their number lengths. If this method returns `false`, you can use `getValidationError` to get more information. Requires the [utils script to be loaded](#loading-the-utilities-script).
```js
const isValid = iti.isValidNumber();
```
Returns: `true`/`false`

**isValidNumberPrecise** ⚠️ DANGEROUS
Check if the current number is valid using precise matching rules for each country/area code etc - [see example](https://intl-tel-input.com/examples/validation.html). Note that these rules change each month for various countries around the world, so you need to be careful to constantly keep the plugin up-to-date (e.g. via an automated script) else <ins>you will start rejecting valid numbers</ins>. For a simpler and more future-proof form of validation, see `isValidNumber` above. If validation fails, you can use `getValidationError` to get more information. Respects the `validationNumberTypes` option (which is set to `["MOBILE"]` by default, meaning `isValidNumberPrecise` will only return `true` for mobile numbers). Requires the [utils script to be loaded](#loading-the-utilities-script).
(Note: only returns `true` for valid <ins>mobile numbers</ins> by default - see `validationNumberTypes`)
Check if the current number is valid using precise matching rules for each country/area code etc - [see example](https://intl-tel-input.com/examples/validation.html). Note that these rules change each month for various countries around the world, so you need to constantly keep the plugin up-to-date (e.g. via an automated script) else <ins>you will start rejecting valid numbers</ins>. For a simpler and more future-proof form of validation, see `isValidNumber` above. If validation fails, you can use `getValidationError` to get more information. Requires the [utils script to be loaded](#loading-the-utilities-script).
```js
const isValid = iti.isValidNumberPrecise();
```
@@ -511,7 +509,7 @@ You can listen for the following events triggered on the input element.
**countrychange**
This is triggered when the selected country is updated e.g. if the user selects a country from the dropdown, or they type a different dial code into the input, or you call `setCountry` etc.
```js
input.addEventListener("countrychange", function() {
input.addEventListener("countrychange", () => {
// do something with iti.getSelectedCountryData()
});
```
@@ -566,7 +564,7 @@ Example:
## Translations
We provide [translations](https://github.com/jackocnr/intl-tel-input/tree/master/build/js/i18n) for the 200+ country names, as well as other user interface text (e.g. the placeholder text for the country search input) in over 30 languages. See the `i18n` option for details on how to use them. [See them in action](https://intl-tel-input.com/storybook/?path=/docs/intltelinput--i18n).

Supported languages: Arabic, Bengali, Bosnian, Bulgarian, Catalan, Chinese, Croatian, Czech, Danish, Dutch, Norwegian, English, Farsi, Finnish, French, German, Greek, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, Marathi, Polish, Portuguese, Romanian, Russian, Slovak, Spanish, Swedish, Telugu, Thai, Turkish, Urdu, Vietnamese.
Supported languages: Arabic, Bengali, Bosnian, Bulgarian, Catalan, Chinese, Croatian, Czech, Danish, Dutch, Norwegian, English, Farsi, Finnish, French, German, Greek, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, Marathi, Polish, Portuguese, Romanian, Russian, Slovak, Spanish, Swedish, Telugu, Thai, Turkish, Ukrainian, Urdu, Vietnamese.

If we don't currently support a language you need, it's easy to [contribute this](https://github.com/jackocnr/intl-tel-input/blob/master/.github/CONTRIBUTING.md#adding-a-new-translation) yourself - you only need to provide a handful of UI translation strings, as we automatically pull in the country names from the country-list project.

@@ -598,7 +596,7 @@ The `loadUtils` option takes a function which returns a Promise which resolves t
```js
// (A) import utils module from a CDN
intlTelInput(htmlInputElement, {
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.1.1/build/js/utils.js"),
loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.3.1/build/js/utils.js"),
});

// (B) import utils module from your own hosted version of utils.js
@@ -627,7 +625,7 @@ If you want your input to be full-width, you need to set the container to be the
If you have a scrolling container other than `window` which is causing problems by not closing the dropdown on scroll, simply listen for the scroll event on that element, and trigger a scroll event on `window`, which in turn will close the dropdown e.g.

```js
scrollingElement.addEventListener("scroll", function() {
scrollingElement.addEventListener("scroll", () => {
const e = document.createEvent('Event');
e.initEvent("scroll", true, true);
window.dispatchEvent(e);
Binary file modified build/img/flags.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified build/img/flags.webp
Binary file not shown.
Binary file modified build/img/flags@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified build/img/flags@2x.webp
Binary file not shown.
2 changes: 1 addition & 1 deletion build/js/data.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* International Telephone Input v25.1.1
* International Telephone Input v25.3.1
* https://github.com/jackocnr/intl-tel-input.git
* Licensed under the MIT license
*/
2 changes: 1 addition & 1 deletion build/js/data.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/js/i18n/da/interface.js
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ const interfaceTranslations = {
selectedCountryAriaLabel: "Valgt land",
noCountrySelected: "Intet land er valgt",
countryListAriaLabel: "Liste over lande",
searchPlaceholder: "Søge",
searchPlaceholder: "Søg",
zeroSearchResults: "Ingen resultater fundet",
oneSearchResult: "1 resultat fundet",
multipleSearchResults: "${count} resultater fundet",
Loading