intl-tel-input 25.4.7 → 25.5.0
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/README.md +5 -5
- package/angular/build/IntlTelInput.cjs +9 -9
- package/angular/build/IntlTelInput.d.ts +1 -1
- package/angular/build/IntlTelInput.js +9 -9
- package/angular/build/IntlTelInputWithUtils.cjs +9 -9
- package/angular/build/IntlTelInputWithUtils.js +9 -9
- package/angular/build/intl-tel-input/angular.js +205 -0
- package/angular/build/intl-tel-input/angularWithUtils.js +206 -0
- package/angular/build/intl-tel-input/data.js +1096 -0
- package/angular/build/intl-tel-input/i18n/ar/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/ar/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/ar/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/bg/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/bg/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/bg/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/bn/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/bn/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/bn/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/bs/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/bs/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/bs/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/ca/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/ca/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/ca/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/cs/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/cs/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/cs/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/da/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/da/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/da/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/de/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/de/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/de/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/ee/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/ee/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/ee/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/el/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/el/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/el/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/en/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/en/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/en/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/es/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/es/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/es/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/fa/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/fa/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/fa/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/fi/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/fi/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/fi/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/fr/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/fr/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/fr/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/hi/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/hi/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/hi/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/hr/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/hr/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/hr/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/hu/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/hu/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/hu/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/id/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/id/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/id/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/index.js +40 -0
- package/angular/build/intl-tel-input/i18n/it/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/it/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/it/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/ja/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/ja/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/ja/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/ko/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/ko/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/ko/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/mr/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/mr/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/mr/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/nl/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/nl/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/nl/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/no/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/no/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/no/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/pl/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/pl/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/pl/interface.js +24 -0
- package/angular/build/intl-tel-input/i18n/pt/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/pt/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/pt/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/ro/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/ro/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/ro/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/ru/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/ru/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/ru/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/sk/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/sk/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/sk/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/sv/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/sv/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/sv/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/te/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/te/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/te/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/th/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/th/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/th/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/tr/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/tr/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/tr/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/types.js +1 -0
- package/angular/build/intl-tel-input/i18n/uk/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/uk/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/uk/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/ur/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/ur/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/ur/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/uz/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/uz/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/uz/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/vi/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/vi/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/vi/interface.js +13 -0
- package/angular/build/intl-tel-input/i18n/zh/countries.js +245 -0
- package/angular/build/intl-tel-input/i18n/zh/index.js +5 -0
- package/angular/build/intl-tel-input/i18n/zh/interface.js +13 -0
- package/angular/build/intl-tel-input/intlTelInputWithUtils.js +4 -0
- package/angular/build/intl-tel-input/utils.js +1341 -0
- package/angular/build/intl-tel-input.js +1812 -0
- package/angular/build/types/intl-tel-input/angular.d.ts +40 -0
- package/angular/build/types/intl-tel-input/angularWithUtils.d.ts +40 -0
- package/angular/build/types/intl-tel-input/data.d.ts +11 -0
- package/angular/build/types/intl-tel-input/i18n/ar/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ar/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/ar/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/bg/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/bg/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/bg/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/bn/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/bn/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/bn/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/bs/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/bs/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/bs/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ca/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ca/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/ca/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/cs/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/cs/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/cs/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/da/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/da/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/da/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/de/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/de/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/de/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ee/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ee/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/ee/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/el/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/el/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/el/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/en/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/en/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/en/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/es/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/es/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/es/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/fa/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/fa/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/fa/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/fi/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/fi/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/fi/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/fr/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/fr/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/fr/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/hi/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/hi/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/hi/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/hr/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/hr/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/hr/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/hu/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/hu/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/hu/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/id/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/id/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/id/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/index.d.ts +39 -0
- package/angular/build/types/intl-tel-input/i18n/it/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/it/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/it/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ja/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ja/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/ja/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ko/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ko/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/ko/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/mr/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/mr/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/mr/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/nl/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/nl/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/nl/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/no/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/no/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/no/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/pl/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/pl/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/pl/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/pt/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/pt/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/pt/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ro/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ro/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/ro/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ru/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ru/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/ru/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/sk/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/sk/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/sk/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/sv/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/sv/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/sv/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/te/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/te/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/te/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/th/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/th/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/th/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/tr/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/tr/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/tr/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/types.d.ts +254 -0
- package/angular/build/types/intl-tel-input/i18n/uk/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/uk/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/uk/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ur/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/ur/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/ur/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/uz/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/uz/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/uz/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/vi/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/vi/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/vi/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/zh/countries.d.ts +3 -0
- package/angular/build/types/intl-tel-input/i18n/zh/index.d.ts +6 -0
- package/angular/build/types/intl-tel-input/i18n/zh/interface.d.ts +3 -0
- package/angular/build/types/intl-tel-input/intlTelInputWithUtils.d.ts +2 -0
- package/angular/build/types/intl-tel-input/utils.d.ts +2 -0
- package/angular/build/types/intl-tel-input.d.ts +199 -0
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/intlTelInput.d.ts +1 -1
- package/build/js/intlTelInput.js +46 -17
- package/build/js/intlTelInput.min.js +2 -2
- package/build/js/intlTelInputWithUtils.js +46 -17
- package/build/js/intlTelInputWithUtils.min.js +2 -2
- package/package.json +5 -7
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +45 -16
- package/react/build/IntlTelInput.d.ts +1 -1
- package/react/build/IntlTelInput.js +45 -16
- package/react/build/IntlTelInputWithUtils.cjs +45 -16
- package/react/build/IntlTelInputWithUtils.js +45 -16
- package/vue/README.md +1 -1
- package/vue/build/IntlTelInput.mjs +160 -153
- package/vue/build/IntlTelInputWithUtils.mjs +543 -536
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intl-tel-input",
|
|
3
|
-
"version": "25.
|
|
3
|
+
"version": "25.5.0",
|
|
4
4
|
"description": "A JavaScript plugin for entering and validating international telephone numbers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"international",
|
|
@@ -146,14 +146,12 @@
|
|
|
146
146
|
"import": "./vue/build/IntlTelInputWithUtils.mjs"
|
|
147
147
|
},
|
|
148
148
|
"./angular": {
|
|
149
|
-
"types": "./angular/build/
|
|
150
|
-
"
|
|
151
|
-
"default": "./angular/build/IntlTelInput.js"
|
|
149
|
+
"types": "./angular/build/types/intl-tel-input/angular.d.ts",
|
|
150
|
+
"default": "./angular/build/intl-tel-input/angular.js"
|
|
152
151
|
},
|
|
153
152
|
"./angularWithUtils": {
|
|
154
|
-
"types": "./angular/build/
|
|
155
|
-
"
|
|
156
|
-
"default": "./angular/build/IntlTelInputWithUtils.js"
|
|
153
|
+
"types": "./angular/build/types/intl-tel-input/angularWithUtils.d.ts",
|
|
154
|
+
"default": "./angular/build/intl-tel-input/angularWithUtils.js"
|
|
157
155
|
},
|
|
158
156
|
"./i18n": {
|
|
159
157
|
"types": "./build/js/intlTelInput.d.ts",
|
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.
|
|
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.5.0/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.
|
|
@@ -2334,12 +2334,8 @@ var Iti = class {
|
|
|
2334
2334
|
const newFullNumber = this._getFullNumber(newValue);
|
|
2335
2335
|
const coreNumber = intlTelInput.utils.getCoreNumber(newFullNumber, this.selectedCountryData.iso2);
|
|
2336
2336
|
const hasExceededMaxLength = this.maxCoreNumberLength && coreNumber.length > this.maxCoreNumberLength;
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
const currentCountry = this.selectedCountryData.iso2;
|
|
2340
|
-
const newCountry = this._getCountryFromNumber(newFullNumber);
|
|
2341
|
-
isChangingDialCode = newCountry !== currentCountry;
|
|
2342
|
-
}
|
|
2337
|
+
const newCountry = this._getNewCountryFromNumber(newFullNumber);
|
|
2338
|
+
const isChangingDialCode = newCountry !== null;
|
|
2343
2339
|
if (!isAllowedChar || hasExceededMaxLength && !isChangingDialCode && !isInitialPlus) {
|
|
2344
2340
|
e.preventDefault();
|
|
2345
2341
|
}
|
|
@@ -2498,16 +2494,45 @@ var Iti = class {
|
|
|
2498
2494
|
let noCountriesAddedYet = true;
|
|
2499
2495
|
this.countryList.innerHTML = "";
|
|
2500
2496
|
const normalisedQuery = normaliseString(query);
|
|
2497
|
+
const queryLength = normalisedQuery.length;
|
|
2498
|
+
const iso2Matches = [];
|
|
2499
|
+
const nameStartWith = [];
|
|
2500
|
+
const nameContains = [];
|
|
2501
|
+
const dialCodeMatches = [];
|
|
2502
|
+
const dialCodeContains = [];
|
|
2503
|
+
const initialsMatches = [];
|
|
2501
2504
|
for (let i = 0; i < this.countries.length; i++) {
|
|
2502
2505
|
const c = this.countries[i];
|
|
2503
2506
|
const normalisedCountryName = normaliseString(c.name);
|
|
2504
2507
|
const countryInitials = c.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((word) => word[0]).join("").toLowerCase();
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2508
|
+
if (isReset || queryLength === 0) {
|
|
2509
|
+
nameContains.push(c);
|
|
2510
|
+
} else if (c.iso2.toLowerCase() === normalisedQuery) {
|
|
2511
|
+
iso2Matches.push(c);
|
|
2512
|
+
} else if (normalisedCountryName.startsWith(normalisedQuery)) {
|
|
2513
|
+
nameStartWith.push(c);
|
|
2514
|
+
} else if (normalisedCountryName.includes(normalisedQuery)) {
|
|
2515
|
+
nameContains.push(c);
|
|
2516
|
+
} else if (normalisedQuery === c.dialCode || normalisedQuery === `+${c.dialCode}`) {
|
|
2517
|
+
dialCodeMatches.push(c);
|
|
2518
|
+
} else if (`+${c.dialCode}`.includes(normalisedQuery)) {
|
|
2519
|
+
dialCodeContains.push(c);
|
|
2520
|
+
} else if (countryInitials.includes(normalisedQuery)) {
|
|
2521
|
+
initialsMatches.push(c);
|
|
2522
|
+
}
|
|
2523
|
+
}
|
|
2524
|
+
const matchedCountries = [
|
|
2525
|
+
...iso2Matches.sort((a, b) => a.priority - b.priority),
|
|
2526
|
+
...nameStartWith.sort((a, b) => a.priority - b.priority),
|
|
2527
|
+
...nameContains.sort((a, b) => a.priority - b.priority),
|
|
2528
|
+
...dialCodeMatches.sort((a, b) => a.priority - b.priority),
|
|
2529
|
+
...dialCodeContains.sort((a, b) => a.priority - b.priority),
|
|
2530
|
+
...initialsMatches.sort((a, b) => a.priority - b.priority)
|
|
2531
|
+
];
|
|
2532
|
+
for (const c of matchedCountries) {
|
|
2533
|
+
const listItem = c.nodeById[this.id];
|
|
2534
|
+
if (listItem) {
|
|
2535
|
+
this.countryList.appendChild(listItem);
|
|
2511
2536
|
if (noCountriesAddedYet) {
|
|
2512
2537
|
this._highlightListItem(listItem, false);
|
|
2513
2538
|
noCountriesAddedYet = false;
|
|
@@ -2575,7 +2600,7 @@ var Iti = class {
|
|
|
2575
2600
|
//* Check if need to select a new country based on the given number
|
|
2576
2601
|
//* Note: called from _setInitialState, keyup handler, setNumber.
|
|
2577
2602
|
_updateCountryFromNumber(fullNumber) {
|
|
2578
|
-
const iso2 = this.
|
|
2603
|
+
const iso2 = this._getNewCountryFromNumber(fullNumber);
|
|
2579
2604
|
if (iso2 !== null) {
|
|
2580
2605
|
return this._setCountry(iso2);
|
|
2581
2606
|
}
|
|
@@ -2591,7 +2616,10 @@ var Iti = class {
|
|
|
2591
2616
|
const cleanNumber = hasPrefix ? number.substring(1) : number;
|
|
2592
2617
|
return `+${dialCode}${cleanNumber}`;
|
|
2593
2618
|
}
|
|
2594
|
-
|
|
2619
|
+
// Get the country ISO2 code from the given number
|
|
2620
|
+
// BUT ONLY IF ITS CHANGED FROM THE CURRENTLY SELECTED COUNTRY
|
|
2621
|
+
// NOTE: consider refactoring this to be more clear
|
|
2622
|
+
_getNewCountryFromNumber(fullNumber) {
|
|
2595
2623
|
const plusIndex = fullNumber.indexOf("+");
|
|
2596
2624
|
let number = plusIndex ? fullNumber.substring(plusIndex) : fullNumber;
|
|
2597
2625
|
const selectedIso2 = this.selectedCountryData.iso2;
|
|
@@ -2605,7 +2633,8 @@ var Iti = class {
|
|
|
2605
2633
|
if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
|
|
2606
2634
|
return this.defaultCountry;
|
|
2607
2635
|
}
|
|
2608
|
-
const
|
|
2636
|
+
const hasAreaCodesButNoneMatched = this.selectedCountryData.areaCodes && numeric.length > dialCodeMatchNumeric.length;
|
|
2637
|
+
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && !hasAreaCodesButNoneMatched;
|
|
2609
2638
|
const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
|
|
2610
2639
|
if (!isRegionlessNanpNumber && !alreadySelected) {
|
|
2611
2640
|
for (let j = 0; j < iso2Codes.length; j++) {
|
|
@@ -3173,7 +3202,7 @@ var intlTelInput = Object.assign(
|
|
|
3173
3202
|
attachUtils,
|
|
3174
3203
|
startedLoadingUtilsScript: false,
|
|
3175
3204
|
startedLoadingAutoCountry: false,
|
|
3176
|
-
version: "25.
|
|
3205
|
+
version: "25.5.0"
|
|
3177
3206
|
}
|
|
3178
3207
|
);
|
|
3179
3208
|
var intl_tel_input_default = intlTelInput;
|
|
@@ -448,7 +448,7 @@ declare module "intl-tel-input" {
|
|
|
448
448
|
private _updateValFromNumber;
|
|
449
449
|
private _updateCountryFromNumber;
|
|
450
450
|
private _ensureHasDialCode;
|
|
451
|
-
private
|
|
451
|
+
private _getNewCountryFromNumber;
|
|
452
452
|
private _highlightListItem;
|
|
453
453
|
private _getCountryData;
|
|
454
454
|
private _setCountry;
|
|
@@ -2298,12 +2298,8 @@ var Iti = class {
|
|
|
2298
2298
|
const newFullNumber = this._getFullNumber(newValue);
|
|
2299
2299
|
const coreNumber = intlTelInput.utils.getCoreNumber(newFullNumber, this.selectedCountryData.iso2);
|
|
2300
2300
|
const hasExceededMaxLength = this.maxCoreNumberLength && coreNumber.length > this.maxCoreNumberLength;
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
const currentCountry = this.selectedCountryData.iso2;
|
|
2304
|
-
const newCountry = this._getCountryFromNumber(newFullNumber);
|
|
2305
|
-
isChangingDialCode = newCountry !== currentCountry;
|
|
2306
|
-
}
|
|
2301
|
+
const newCountry = this._getNewCountryFromNumber(newFullNumber);
|
|
2302
|
+
const isChangingDialCode = newCountry !== null;
|
|
2307
2303
|
if (!isAllowedChar || hasExceededMaxLength && !isChangingDialCode && !isInitialPlus) {
|
|
2308
2304
|
e.preventDefault();
|
|
2309
2305
|
}
|
|
@@ -2462,16 +2458,45 @@ var Iti = class {
|
|
|
2462
2458
|
let noCountriesAddedYet = true;
|
|
2463
2459
|
this.countryList.innerHTML = "";
|
|
2464
2460
|
const normalisedQuery = normaliseString(query);
|
|
2461
|
+
const queryLength = normalisedQuery.length;
|
|
2462
|
+
const iso2Matches = [];
|
|
2463
|
+
const nameStartWith = [];
|
|
2464
|
+
const nameContains = [];
|
|
2465
|
+
const dialCodeMatches = [];
|
|
2466
|
+
const dialCodeContains = [];
|
|
2467
|
+
const initialsMatches = [];
|
|
2465
2468
|
for (let i = 0; i < this.countries.length; i++) {
|
|
2466
2469
|
const c = this.countries[i];
|
|
2467
2470
|
const normalisedCountryName = normaliseString(c.name);
|
|
2468
2471
|
const countryInitials = c.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((word) => word[0]).join("").toLowerCase();
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2472
|
+
if (isReset || queryLength === 0) {
|
|
2473
|
+
nameContains.push(c);
|
|
2474
|
+
} else if (c.iso2.toLowerCase() === normalisedQuery) {
|
|
2475
|
+
iso2Matches.push(c);
|
|
2476
|
+
} else if (normalisedCountryName.startsWith(normalisedQuery)) {
|
|
2477
|
+
nameStartWith.push(c);
|
|
2478
|
+
} else if (normalisedCountryName.includes(normalisedQuery)) {
|
|
2479
|
+
nameContains.push(c);
|
|
2480
|
+
} else if (normalisedQuery === c.dialCode || normalisedQuery === `+${c.dialCode}`) {
|
|
2481
|
+
dialCodeMatches.push(c);
|
|
2482
|
+
} else if (`+${c.dialCode}`.includes(normalisedQuery)) {
|
|
2483
|
+
dialCodeContains.push(c);
|
|
2484
|
+
} else if (countryInitials.includes(normalisedQuery)) {
|
|
2485
|
+
initialsMatches.push(c);
|
|
2486
|
+
}
|
|
2487
|
+
}
|
|
2488
|
+
const matchedCountries = [
|
|
2489
|
+
...iso2Matches.sort((a, b) => a.priority - b.priority),
|
|
2490
|
+
...nameStartWith.sort((a, b) => a.priority - b.priority),
|
|
2491
|
+
...nameContains.sort((a, b) => a.priority - b.priority),
|
|
2492
|
+
...dialCodeMatches.sort((a, b) => a.priority - b.priority),
|
|
2493
|
+
...dialCodeContains.sort((a, b) => a.priority - b.priority),
|
|
2494
|
+
...initialsMatches.sort((a, b) => a.priority - b.priority)
|
|
2495
|
+
];
|
|
2496
|
+
for (const c of matchedCountries) {
|
|
2497
|
+
const listItem = c.nodeById[this.id];
|
|
2498
|
+
if (listItem) {
|
|
2499
|
+
this.countryList.appendChild(listItem);
|
|
2475
2500
|
if (noCountriesAddedYet) {
|
|
2476
2501
|
this._highlightListItem(listItem, false);
|
|
2477
2502
|
noCountriesAddedYet = false;
|
|
@@ -2539,7 +2564,7 @@ var Iti = class {
|
|
|
2539
2564
|
//* Check if need to select a new country based on the given number
|
|
2540
2565
|
//* Note: called from _setInitialState, keyup handler, setNumber.
|
|
2541
2566
|
_updateCountryFromNumber(fullNumber) {
|
|
2542
|
-
const iso2 = this.
|
|
2567
|
+
const iso2 = this._getNewCountryFromNumber(fullNumber);
|
|
2543
2568
|
if (iso2 !== null) {
|
|
2544
2569
|
return this._setCountry(iso2);
|
|
2545
2570
|
}
|
|
@@ -2555,7 +2580,10 @@ var Iti = class {
|
|
|
2555
2580
|
const cleanNumber = hasPrefix ? number.substring(1) : number;
|
|
2556
2581
|
return `+${dialCode}${cleanNumber}`;
|
|
2557
2582
|
}
|
|
2558
|
-
|
|
2583
|
+
// Get the country ISO2 code from the given number
|
|
2584
|
+
// BUT ONLY IF ITS CHANGED FROM THE CURRENTLY SELECTED COUNTRY
|
|
2585
|
+
// NOTE: consider refactoring this to be more clear
|
|
2586
|
+
_getNewCountryFromNumber(fullNumber) {
|
|
2559
2587
|
const plusIndex = fullNumber.indexOf("+");
|
|
2560
2588
|
let number = plusIndex ? fullNumber.substring(plusIndex) : fullNumber;
|
|
2561
2589
|
const selectedIso2 = this.selectedCountryData.iso2;
|
|
@@ -2569,7 +2597,8 @@ var Iti = class {
|
|
|
2569
2597
|
if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
|
|
2570
2598
|
return this.defaultCountry;
|
|
2571
2599
|
}
|
|
2572
|
-
const
|
|
2600
|
+
const hasAreaCodesButNoneMatched = this.selectedCountryData.areaCodes && numeric.length > dialCodeMatchNumeric.length;
|
|
2601
|
+
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && !hasAreaCodesButNoneMatched;
|
|
2573
2602
|
const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
|
|
2574
2603
|
if (!isRegionlessNanpNumber && !alreadySelected) {
|
|
2575
2604
|
for (let j = 0; j < iso2Codes.length; j++) {
|
|
@@ -3137,7 +3166,7 @@ var intlTelInput = Object.assign(
|
|
|
3137
3166
|
attachUtils,
|
|
3138
3167
|
startedLoadingUtilsScript: false,
|
|
3139
3168
|
startedLoadingAutoCountry: false,
|
|
3140
|
-
version: "25.
|
|
3169
|
+
version: "25.5.0"
|
|
3141
3170
|
}
|
|
3142
3171
|
);
|
|
3143
3172
|
var intl_tel_input_default = intlTelInput;
|
|
@@ -2334,12 +2334,8 @@ var Iti = class {
|
|
|
2334
2334
|
const newFullNumber = this._getFullNumber(newValue);
|
|
2335
2335
|
const coreNumber = intlTelInput.utils.getCoreNumber(newFullNumber, this.selectedCountryData.iso2);
|
|
2336
2336
|
const hasExceededMaxLength = this.maxCoreNumberLength && coreNumber.length > this.maxCoreNumberLength;
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
const currentCountry = this.selectedCountryData.iso2;
|
|
2340
|
-
const newCountry = this._getCountryFromNumber(newFullNumber);
|
|
2341
|
-
isChangingDialCode = newCountry !== currentCountry;
|
|
2342
|
-
}
|
|
2337
|
+
const newCountry = this._getNewCountryFromNumber(newFullNumber);
|
|
2338
|
+
const isChangingDialCode = newCountry !== null;
|
|
2343
2339
|
if (!isAllowedChar || hasExceededMaxLength && !isChangingDialCode && !isInitialPlus) {
|
|
2344
2340
|
e.preventDefault();
|
|
2345
2341
|
}
|
|
@@ -2498,16 +2494,45 @@ var Iti = class {
|
|
|
2498
2494
|
let noCountriesAddedYet = true;
|
|
2499
2495
|
this.countryList.innerHTML = "";
|
|
2500
2496
|
const normalisedQuery = normaliseString(query);
|
|
2497
|
+
const queryLength = normalisedQuery.length;
|
|
2498
|
+
const iso2Matches = [];
|
|
2499
|
+
const nameStartWith = [];
|
|
2500
|
+
const nameContains = [];
|
|
2501
|
+
const dialCodeMatches = [];
|
|
2502
|
+
const dialCodeContains = [];
|
|
2503
|
+
const initialsMatches = [];
|
|
2501
2504
|
for (let i = 0; i < this.countries.length; i++) {
|
|
2502
2505
|
const c = this.countries[i];
|
|
2503
2506
|
const normalisedCountryName = normaliseString(c.name);
|
|
2504
2507
|
const countryInitials = c.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((word) => word[0]).join("").toLowerCase();
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2508
|
+
if (isReset || queryLength === 0) {
|
|
2509
|
+
nameContains.push(c);
|
|
2510
|
+
} else if (c.iso2.toLowerCase() === normalisedQuery) {
|
|
2511
|
+
iso2Matches.push(c);
|
|
2512
|
+
} else if (normalisedCountryName.startsWith(normalisedQuery)) {
|
|
2513
|
+
nameStartWith.push(c);
|
|
2514
|
+
} else if (normalisedCountryName.includes(normalisedQuery)) {
|
|
2515
|
+
nameContains.push(c);
|
|
2516
|
+
} else if (normalisedQuery === c.dialCode || normalisedQuery === `+${c.dialCode}`) {
|
|
2517
|
+
dialCodeMatches.push(c);
|
|
2518
|
+
} else if (`+${c.dialCode}`.includes(normalisedQuery)) {
|
|
2519
|
+
dialCodeContains.push(c);
|
|
2520
|
+
} else if (countryInitials.includes(normalisedQuery)) {
|
|
2521
|
+
initialsMatches.push(c);
|
|
2522
|
+
}
|
|
2523
|
+
}
|
|
2524
|
+
const matchedCountries = [
|
|
2525
|
+
...iso2Matches.sort((a, b) => a.priority - b.priority),
|
|
2526
|
+
...nameStartWith.sort((a, b) => a.priority - b.priority),
|
|
2527
|
+
...nameContains.sort((a, b) => a.priority - b.priority),
|
|
2528
|
+
...dialCodeMatches.sort((a, b) => a.priority - b.priority),
|
|
2529
|
+
...dialCodeContains.sort((a, b) => a.priority - b.priority),
|
|
2530
|
+
...initialsMatches.sort((a, b) => a.priority - b.priority)
|
|
2531
|
+
];
|
|
2532
|
+
for (const c of matchedCountries) {
|
|
2533
|
+
const listItem = c.nodeById[this.id];
|
|
2534
|
+
if (listItem) {
|
|
2535
|
+
this.countryList.appendChild(listItem);
|
|
2511
2536
|
if (noCountriesAddedYet) {
|
|
2512
2537
|
this._highlightListItem(listItem, false);
|
|
2513
2538
|
noCountriesAddedYet = false;
|
|
@@ -2575,7 +2600,7 @@ var Iti = class {
|
|
|
2575
2600
|
//* Check if need to select a new country based on the given number
|
|
2576
2601
|
//* Note: called from _setInitialState, keyup handler, setNumber.
|
|
2577
2602
|
_updateCountryFromNumber(fullNumber) {
|
|
2578
|
-
const iso2 = this.
|
|
2603
|
+
const iso2 = this._getNewCountryFromNumber(fullNumber);
|
|
2579
2604
|
if (iso2 !== null) {
|
|
2580
2605
|
return this._setCountry(iso2);
|
|
2581
2606
|
}
|
|
@@ -2591,7 +2616,10 @@ var Iti = class {
|
|
|
2591
2616
|
const cleanNumber = hasPrefix ? number.substring(1) : number;
|
|
2592
2617
|
return `+${dialCode}${cleanNumber}`;
|
|
2593
2618
|
}
|
|
2594
|
-
|
|
2619
|
+
// Get the country ISO2 code from the given number
|
|
2620
|
+
// BUT ONLY IF ITS CHANGED FROM THE CURRENTLY SELECTED COUNTRY
|
|
2621
|
+
// NOTE: consider refactoring this to be more clear
|
|
2622
|
+
_getNewCountryFromNumber(fullNumber) {
|
|
2595
2623
|
const plusIndex = fullNumber.indexOf("+");
|
|
2596
2624
|
let number = plusIndex ? fullNumber.substring(plusIndex) : fullNumber;
|
|
2597
2625
|
const selectedIso2 = this.selectedCountryData.iso2;
|
|
@@ -2605,7 +2633,8 @@ var Iti = class {
|
|
|
2605
2633
|
if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
|
|
2606
2634
|
return this.defaultCountry;
|
|
2607
2635
|
}
|
|
2608
|
-
const
|
|
2636
|
+
const hasAreaCodesButNoneMatched = this.selectedCountryData.areaCodes && numeric.length > dialCodeMatchNumeric.length;
|
|
2637
|
+
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && !hasAreaCodesButNoneMatched;
|
|
2609
2638
|
const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
|
|
2610
2639
|
if (!isRegionlessNanpNumber && !alreadySelected) {
|
|
2611
2640
|
for (let j = 0; j < iso2Codes.length; j++) {
|
|
@@ -3173,7 +3202,7 @@ var intlTelInput = Object.assign(
|
|
|
3173
3202
|
attachUtils,
|
|
3174
3203
|
startedLoadingUtilsScript: false,
|
|
3175
3204
|
startedLoadingAutoCountry: false,
|
|
3176
|
-
version: "25.
|
|
3205
|
+
version: "25.5.0"
|
|
3177
3206
|
}
|
|
3178
3207
|
);
|
|
3179
3208
|
var intl_tel_input_default = intlTelInput;
|
|
@@ -2298,12 +2298,8 @@ var Iti = class {
|
|
|
2298
2298
|
const newFullNumber = this._getFullNumber(newValue);
|
|
2299
2299
|
const coreNumber = intlTelInput.utils.getCoreNumber(newFullNumber, this.selectedCountryData.iso2);
|
|
2300
2300
|
const hasExceededMaxLength = this.maxCoreNumberLength && coreNumber.length > this.maxCoreNumberLength;
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
const currentCountry = this.selectedCountryData.iso2;
|
|
2304
|
-
const newCountry = this._getCountryFromNumber(newFullNumber);
|
|
2305
|
-
isChangingDialCode = newCountry !== currentCountry;
|
|
2306
|
-
}
|
|
2301
|
+
const newCountry = this._getNewCountryFromNumber(newFullNumber);
|
|
2302
|
+
const isChangingDialCode = newCountry !== null;
|
|
2307
2303
|
if (!isAllowedChar || hasExceededMaxLength && !isChangingDialCode && !isInitialPlus) {
|
|
2308
2304
|
e.preventDefault();
|
|
2309
2305
|
}
|
|
@@ -2462,16 +2458,45 @@ var Iti = class {
|
|
|
2462
2458
|
let noCountriesAddedYet = true;
|
|
2463
2459
|
this.countryList.innerHTML = "";
|
|
2464
2460
|
const normalisedQuery = normaliseString(query);
|
|
2461
|
+
const queryLength = normalisedQuery.length;
|
|
2462
|
+
const iso2Matches = [];
|
|
2463
|
+
const nameStartWith = [];
|
|
2464
|
+
const nameContains = [];
|
|
2465
|
+
const dialCodeMatches = [];
|
|
2466
|
+
const dialCodeContains = [];
|
|
2467
|
+
const initialsMatches = [];
|
|
2465
2468
|
for (let i = 0; i < this.countries.length; i++) {
|
|
2466
2469
|
const c = this.countries[i];
|
|
2467
2470
|
const normalisedCountryName = normaliseString(c.name);
|
|
2468
2471
|
const countryInitials = c.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((word) => word[0]).join("").toLowerCase();
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2472
|
+
if (isReset || queryLength === 0) {
|
|
2473
|
+
nameContains.push(c);
|
|
2474
|
+
} else if (c.iso2.toLowerCase() === normalisedQuery) {
|
|
2475
|
+
iso2Matches.push(c);
|
|
2476
|
+
} else if (normalisedCountryName.startsWith(normalisedQuery)) {
|
|
2477
|
+
nameStartWith.push(c);
|
|
2478
|
+
} else if (normalisedCountryName.includes(normalisedQuery)) {
|
|
2479
|
+
nameContains.push(c);
|
|
2480
|
+
} else if (normalisedQuery === c.dialCode || normalisedQuery === `+${c.dialCode}`) {
|
|
2481
|
+
dialCodeMatches.push(c);
|
|
2482
|
+
} else if (`+${c.dialCode}`.includes(normalisedQuery)) {
|
|
2483
|
+
dialCodeContains.push(c);
|
|
2484
|
+
} else if (countryInitials.includes(normalisedQuery)) {
|
|
2485
|
+
initialsMatches.push(c);
|
|
2486
|
+
}
|
|
2487
|
+
}
|
|
2488
|
+
const matchedCountries = [
|
|
2489
|
+
...iso2Matches.sort((a, b) => a.priority - b.priority),
|
|
2490
|
+
...nameStartWith.sort((a, b) => a.priority - b.priority),
|
|
2491
|
+
...nameContains.sort((a, b) => a.priority - b.priority),
|
|
2492
|
+
...dialCodeMatches.sort((a, b) => a.priority - b.priority),
|
|
2493
|
+
...dialCodeContains.sort((a, b) => a.priority - b.priority),
|
|
2494
|
+
...initialsMatches.sort((a, b) => a.priority - b.priority)
|
|
2495
|
+
];
|
|
2496
|
+
for (const c of matchedCountries) {
|
|
2497
|
+
const listItem = c.nodeById[this.id];
|
|
2498
|
+
if (listItem) {
|
|
2499
|
+
this.countryList.appendChild(listItem);
|
|
2475
2500
|
if (noCountriesAddedYet) {
|
|
2476
2501
|
this._highlightListItem(listItem, false);
|
|
2477
2502
|
noCountriesAddedYet = false;
|
|
@@ -2539,7 +2564,7 @@ var Iti = class {
|
|
|
2539
2564
|
//* Check if need to select a new country based on the given number
|
|
2540
2565
|
//* Note: called from _setInitialState, keyup handler, setNumber.
|
|
2541
2566
|
_updateCountryFromNumber(fullNumber) {
|
|
2542
|
-
const iso2 = this.
|
|
2567
|
+
const iso2 = this._getNewCountryFromNumber(fullNumber);
|
|
2543
2568
|
if (iso2 !== null) {
|
|
2544
2569
|
return this._setCountry(iso2);
|
|
2545
2570
|
}
|
|
@@ -2555,7 +2580,10 @@ var Iti = class {
|
|
|
2555
2580
|
const cleanNumber = hasPrefix ? number.substring(1) : number;
|
|
2556
2581
|
return `+${dialCode}${cleanNumber}`;
|
|
2557
2582
|
}
|
|
2558
|
-
|
|
2583
|
+
// Get the country ISO2 code from the given number
|
|
2584
|
+
// BUT ONLY IF ITS CHANGED FROM THE CURRENTLY SELECTED COUNTRY
|
|
2585
|
+
// NOTE: consider refactoring this to be more clear
|
|
2586
|
+
_getNewCountryFromNumber(fullNumber) {
|
|
2559
2587
|
const plusIndex = fullNumber.indexOf("+");
|
|
2560
2588
|
let number = plusIndex ? fullNumber.substring(plusIndex) : fullNumber;
|
|
2561
2589
|
const selectedIso2 = this.selectedCountryData.iso2;
|
|
@@ -2569,7 +2597,8 @@ var Iti = class {
|
|
|
2569
2597
|
if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
|
|
2570
2598
|
return this.defaultCountry;
|
|
2571
2599
|
}
|
|
2572
|
-
const
|
|
2600
|
+
const hasAreaCodesButNoneMatched = this.selectedCountryData.areaCodes && numeric.length > dialCodeMatchNumeric.length;
|
|
2601
|
+
const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && !hasAreaCodesButNoneMatched;
|
|
2573
2602
|
const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
|
|
2574
2603
|
if (!isRegionlessNanpNumber && !alreadySelected) {
|
|
2575
2604
|
for (let j = 0; j < iso2Codes.length; j++) {
|
|
@@ -3137,7 +3166,7 @@ var intlTelInput = Object.assign(
|
|
|
3137
3166
|
attachUtils,
|
|
3138
3167
|
startedLoadingUtilsScript: false,
|
|
3139
3168
|
startedLoadingAutoCountry: false,
|
|
3140
|
-
version: "25.
|
|
3169
|
+
version: "25.5.0"
|
|
3141
3170
|
}
|
|
3142
3171
|
);
|
|
3143
3172
|
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.
|
|
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.5.0/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.
|