intl-tel-input 27.3.0 → 28.0.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.
Files changed (38) hide show
  1. package/dist/css/intlTelInput-no-assets.css +2 -2
  2. package/dist/css/intlTelInput.css +3 -3
  3. package/dist/js/data.d.ts +1 -4
  4. package/dist/js/data.js +3 -9
  5. package/dist/js/data.min.js +2 -2
  6. package/dist/js/data.mjs +2 -8
  7. package/dist/js/i18n.d.ts +1 -1592
  8. package/dist/js/intlTelInput.d.ts +62 -49
  9. package/dist/js/intlTelInput.js +221 -182
  10. package/dist/js/intlTelInput.min.js +6 -6
  11. package/dist/js/intlTelInput.mjs +219 -180
  12. package/dist/js/intlTelInputWithUtils.js +622 -568
  13. package/dist/js/intlTelInputWithUtils.min.js +6 -6
  14. package/dist/js/intlTelInputWithUtils.mjs +620 -566
  15. package/dist/js/utils.js +56 -55
  16. package/package.json +14 -181
  17. package/CHANGELOG.md +0 -33
  18. package/angular/README.md +0 -13
  19. package/angular/dist/IntlTelInput.d.ts +0 -110
  20. package/angular/dist/IntlTelInput.js +0 -5096
  21. package/angular/dist/IntlTelInputWithUtils.d.ts +0 -3
  22. package/angular/dist/IntlTelInputWithUtils.js +0 -11435
  23. package/react/README.md +0 -13
  24. package/react/dist/IntlTelInput.d.ts +0 -25
  25. package/react/dist/IntlTelInput.js +0 -4788
  26. package/react/dist/IntlTelInputWithUtils.d.ts +0 -4
  27. package/react/dist/IntlTelInputWithUtils.js +0 -11127
  28. package/svelte/README.md +0 -14
  29. package/svelte/src/IntlTelInput.svelte +0 -233
  30. package/svelte/src/IntlTelInput.svelte.d.ts +0 -36
  31. package/svelte/src/IntlTelInputWithUtils.svelte +0 -24
  32. package/vue/README.md +0 -14
  33. package/vue/dist/IntlTelInput-jw1tkqdD.js +0 -2657
  34. package/vue/dist/IntlTelInput.js +0 -5
  35. package/vue/dist/IntlTelInput.vue.d.ts +0 -43
  36. package/vue/dist/IntlTelInputWithUtils.js +0 -49403
  37. package/vue/dist/index.d.ts +0 -4
  38. package/vue/dist/indexWithUtils.d.ts +0 -3
@@ -1592,17 +1592,14 @@ declare const rawCountryData: readonly [
1592
1592
  ];
1593
1593
  export type Iso2 = (typeof rawCountryData)[number][0];
1594
1594
  export type Country = {
1595
+ name: string;
1595
1596
  iso2: Iso2;
1596
1597
  dialCode: string;
1597
1598
  priority: number;
1598
1599
  areaCodes: readonly string[] | null;
1599
1600
  nationalPrefix: string | null;
1600
- name: string;
1601
- normalisedName: string;
1602
- initials: string;
1603
- dialCodePlus: string;
1604
1601
  };
1605
- export type I18n = Partial<Record<Iso2, string>> & {
1602
+ export type I18n = {
1606
1603
  selectedCountryAriaLabel?: string;
1607
1604
  searchPlaceholder?: string;
1608
1605
  clearSearchAriaLabel?: string;
@@ -1616,6 +1613,12 @@ declare const PLACEHOLDER_MODES: {
1616
1613
  readonly POLITE: "polite";
1617
1614
  readonly OFF: "off";
1618
1615
  };
1616
+ declare const NUMBER_FORMATS: readonly [
1617
+ "E164",
1618
+ "INTERNATIONAL",
1619
+ "NATIONAL",
1620
+ "RFC3966"
1621
+ ];
1619
1622
  declare const NUMBER_TYPES: readonly [
1620
1623
  "FIXED_LINE",
1621
1624
  "MOBILE",
@@ -1630,54 +1633,60 @@ declare const NUMBER_TYPES: readonly [
1630
1633
  "VOICEMAIL",
1631
1634
  "UNKNOWN"
1632
1635
  ];
1633
- declare const NUMBER_TYPE_SET: ReadonlySet<(typeof NUMBER_TYPES)[number]> & {
1634
- has(value: string): boolean;
1635
- };
1636
+ declare const VALIDATION_ERRORS: readonly [
1637
+ "IS_POSSIBLE",
1638
+ "INVALID_COUNTRY_CODE",
1639
+ "TOO_SHORT",
1640
+ "TOO_LONG",
1641
+ "IS_POSSIBLE_LOCAL_ONLY",
1642
+ "INVALID_LENGTH"
1643
+ ];
1644
+ export declare const NUMBER_FORMAT: Readonly<{
1645
+ E164: "E164";
1646
+ INTERNATIONAL: "INTERNATIONAL";
1647
+ NATIONAL: "NATIONAL";
1648
+ RFC3966: "RFC3966";
1649
+ }>;
1650
+ export declare const NUMBER_TYPE: Readonly<{
1651
+ FIXED_LINE: "FIXED_LINE";
1652
+ MOBILE: "MOBILE";
1653
+ FIXED_LINE_OR_MOBILE: "FIXED_LINE_OR_MOBILE";
1654
+ TOLL_FREE: "TOLL_FREE";
1655
+ PREMIUM_RATE: "PREMIUM_RATE";
1656
+ SHARED_COST: "SHARED_COST";
1657
+ VOIP: "VOIP";
1658
+ PERSONAL_NUMBER: "PERSONAL_NUMBER";
1659
+ PAGER: "PAGER";
1660
+ UAN: "UAN";
1661
+ VOICEMAIL: "VOICEMAIL";
1662
+ UNKNOWN: "UNKNOWN";
1663
+ }>;
1664
+ export declare const VALIDATION_ERROR: Readonly<{
1665
+ IS_POSSIBLE: "IS_POSSIBLE";
1666
+ INVALID_COUNTRY_CODE: "INVALID_COUNTRY_CODE";
1667
+ TOO_SHORT: "TOO_SHORT";
1668
+ TOO_LONG: "TOO_LONG";
1669
+ IS_POSSIBLE_LOCAL_ONLY: "IS_POSSIBLE_LOCAL_ONLY";
1670
+ INVALID_LENGTH: "INVALID_LENGTH";
1671
+ }>;
1636
1672
  export type UtilsLoader = () => Promise<{
1637
1673
  default: ItiUtils;
1638
1674
  }>;
1639
1675
  export type ItiUtils = {
1640
- formatNumber(number: string, iso2: string | undefined, format?: number): string;
1676
+ formatNumber(number: string, iso2: string | undefined, format?: NumberFormat): string;
1641
1677
  formatNumberAsYouType(number: string, iso2: string | undefined): string;
1642
1678
  getCoreNumber(number: string, iso2: string | undefined): string;
1643
- getExampleNumber(iso2: string | undefined, nationalMode: boolean, numberType: number, useE164?: boolean): string;
1679
+ getExampleNumber(iso2: string | undefined, nationalMode: boolean, numberType: NumberType, useE164?: boolean): string;
1644
1680
  getExtension(number: string, iso2: string | undefined): string;
1645
- getNumberType(number: string, iso2: string | undefined): number;
1646
- getValidationError(number: string, iso2: string | undefined): number;
1681
+ getNumberType(number: string, iso2: string | undefined): NumberType | null;
1682
+ getValidationError(number: string, iso2: string | undefined): ValidationError | null;
1647
1683
  isPossibleNumber(number: string, iso2: string | undefined, numberType?: NumberType[] | null): boolean;
1648
1684
  isValidNumber(number: string, iso2: string | undefined, numberType?: NumberType[] | null): boolean;
1649
- numberFormat: {
1650
- NATIONAL: number;
1651
- INTERNATIONAL: number;
1652
- E164: number;
1653
- RFC3966: number;
1654
- };
1655
- numberType: {
1656
- [key: string]: number;
1657
- FIXED_LINE: number;
1658
- MOBILE: number;
1659
- FIXED_LINE_OR_MOBILE: number;
1660
- TOLL_FREE: number;
1661
- PREMIUM_RATE: number;
1662
- SHARED_COST: number;
1663
- VOIP: number;
1664
- PERSONAL_NUMBER: number;
1665
- PAGER: number;
1666
- UAN: number;
1667
- VOICEMAIL: number;
1668
- UNKNOWN: number;
1669
- };
1670
- validationError: {
1671
- IS_POSSIBLE: number;
1672
- INVALID_COUNTRY_CODE: number;
1673
- TOO_SHORT: number;
1674
- TOO_LONG: number;
1675
- IS_POSSIBLE_LOCAL_ONLY: number;
1676
- INVALID_LENGTH: number;
1677
- };
1678
1685
  };
1679
- export type SetValues<T> = T extends ReadonlySet<infer U> ? U : never;
1680
- export type NumberType = SetValues<typeof NUMBER_TYPE_SET>;
1686
+ export type ArrayValues<T extends readonly unknown[]> = T[number];
1687
+ export type NumberFormat = ArrayValues<typeof NUMBER_FORMATS>;
1688
+ export type NumberType = ArrayValues<typeof NUMBER_TYPES>;
1689
+ export type ValidationError = ArrayValues<typeof VALIDATION_ERRORS>;
1681
1690
  export type ValueOf<T> = T[keyof T];
1682
1691
  export interface AllOptions {
1683
1692
  allowDropdown: boolean;
@@ -1687,6 +1696,7 @@ export interface AllOptions {
1687
1696
  autoPlaceholder: ValueOf<typeof PLACEHOLDER_MODES>;
1688
1697
  containerClass: string;
1689
1698
  countryNameLocale: string;
1699
+ countryNameOverrides: Partial<Record<Iso2, string>>;
1690
1700
  countryOrder: Iso2[] | null;
1691
1701
  countrySearch: boolean;
1692
1702
  customPlaceholder: ((selectedCountryPlaceholder: string, selectedCountryData: SelectedCountryData) => string) | null;
@@ -1696,7 +1706,7 @@ export interface AllOptions {
1696
1706
  fixDropdownWidth: boolean;
1697
1707
  formatAsYouType: boolean;
1698
1708
  formatOnDisplay: boolean;
1699
- geoIpLookup: ((success: (iso2: Iso2) => void, failure: () => void) => void) | null;
1709
+ geoIpLookup: (() => Promise<Iso2>) | null;
1700
1710
  hiddenInput: ((telInputName: string) => {
1701
1711
  phone: string;
1702
1712
  country?: string;
@@ -1715,7 +1725,7 @@ export interface AllOptions {
1715
1725
  useFullscreenPopup: boolean;
1716
1726
  }
1717
1727
  export type SomeOptions = Partial<AllOptions>;
1718
- export type SelectedCountryData = Pick<Country, "iso2" | "dialCode" | "name"> | null;
1728
+ export type SelectedCountryData = Country | null;
1719
1729
  export type ForEachInstanceArgsMap = {
1720
1730
  handleUtilsLoaded: [
1721
1731
  ];
@@ -1735,10 +1745,10 @@ export declare class Iti {
1735
1745
  destroy(): void;
1736
1746
  isActive(): boolean;
1737
1747
  getExtension(): string;
1738
- getNumber(format?: number): string;
1739
- getNumberType(): number;
1748
+ getNumber(format?: NumberFormat): string;
1749
+ getNumberType(): NumberType | null;
1740
1750
  getSelectedCountryData(): SelectedCountryData;
1741
- getValidationError(): number;
1751
+ getValidationError(): ValidationError | null;
1742
1752
  isValidNumber(): boolean | null;
1743
1753
  isValidNumberPrecise(): boolean | null;
1744
1754
  setCountry(iso2: Iso2): void;
@@ -1756,11 +1766,14 @@ export interface IntlTelInputInterface {
1756
1766
  getCountryData: () => Country[];
1757
1767
  getInstance: (input: HTMLInputElement) => Iti | null;
1758
1768
  instances: Map<string, Iti>;
1759
- attachUtils: (source: UtilsLoader) => Promise<unknown> | null;
1769
+ attachUtils: (source: UtilsLoader) => Promise<boolean | null>;
1760
1770
  startedLoadingAutoCountry: boolean;
1761
1771
  startedLoadingUtils: boolean;
1762
1772
  version: string | undefined;
1763
1773
  utils?: ItiUtils;
1774
+ NUMBER_FORMAT: typeof NUMBER_FORMAT;
1775
+ NUMBER_TYPE: typeof NUMBER_TYPE;
1776
+ VALIDATION_ERROR: typeof VALIDATION_ERROR;
1764
1777
  }
1765
1778
  declare const intlTelInput: IntlTelInputInterface;
1766
1779