react-native-international-phone-number 0.4.8 → 0.4.10

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 CHANGED
@@ -492,13 +492,13 @@ export default function App() {
492
492
 
493
493
  </br>
494
494
 
495
- ## Props
495
+ ## Component Props ([PhoneInputProps](https://github.com/AstrOOnauta/react-native-international-phone-number/blob/master/lib/interfaces/phoneInputProps.ts))
496
496
 
497
497
  - `defaultValue?:` string;
498
498
  - `value:` string;
499
499
  - `onChangePhoneNumber:` (phoneNumber: string) => void;
500
- - `selectedCountry:` undefined | ICountry;
501
- - `onChangeSelectedCountry:` (country: ICountry) => void;
500
+ - `selectedCountry:` undefined | [ICountry](https://github.com/AstrOOnauta/react-native-international-phone-number/blob/master/lib/interfaces/country.ts);
501
+ - `onChangeSelectedCountry:` (country: [ICountry](https://github.com/AstrOOnauta/react-native-international-phone-number/blob/master/lib/interfaces/country.ts)) => void;
502
502
  - `disabled?:` boolean;
503
503
  - `withDarkTheme?:` boolean;
504
504
  - `containerStyle?:` StyleProp<[ViewStyle](https://reactnative.dev/docs/view-style-props)>;
@@ -509,11 +509,11 @@ export default function App() {
509
509
 
510
510
  ## Functions
511
511
 
512
- - `getAllCountries:` () => ICountry[];
513
- - `getCountryByPhoneNumber:` (phoneNumber: string) => ICountry | undefined;
514
- - `getCountryByCca2:` (phoneNumber: string) => ICountry | undefined;
515
- - `getCountriesByCallingCode:` (phoneNumber: string) => ICountry[] | undefined;
516
- - `getCountriesByName:` (phoneNumber: string) => ICountry[] | undefined;
512
+ - `getAllCountries:` () => [ICountry](https://github.com/AstrOOnauta/react-native-international-phone-number/blob/master/lib/interfaces/country.ts)[];
513
+ - `getCountryByPhoneNumber:` (phoneNumber: string) => [ICountry](https://github.com/AstrOOnauta/react-native-international-phone-number/blob/master/lib/interfaces/country.ts) | undefined;
514
+ - `getCountryByCca2:` (phoneNumber: string) => [ICountry](https://github.com/AstrOOnauta/react-native-international-phone-number/blob/master/lib/interfaces/country.ts) | undefined;
515
+ - `getCountriesByCallingCode:` (phoneNumber: string) => [ICountry](https://github.com/AstrOOnauta/react-native-international-phone-number/blob/master/lib/interfaces/country.ts)[] | undefined;
516
+ - `getCountriesByName:` (phoneNumber: string) => [ICountry](https://github.com/AstrOOnauta/react-native-international-phone-number/blob/master/lib/interfaces/country.ts)[] | undefined;
517
517
 
518
518
  </br>
519
519
 
package/lib/index.d.ts CHANGED
@@ -1,31 +1,5 @@
1
- import {
2
- StyleProp,
3
- TextInputProps,
4
- TextStyle,
5
- ViewStyle,
6
- } from 'react-native';
7
-
8
- interface ICountry {
9
- callingCode: string;
10
- cca2: string;
11
- flag: string;
12
- name: string;
13
- }
14
-
15
- interface PhoneInputProps extends TextInputProps {
16
- placeholder?: string;
17
- placeholderTextColor?: string;
18
- containerStyle?: StyleProp<ViewStyle>;
19
- flagContainerStyle?: StyleProp<ViewStyle>;
20
- inputStyle?: StyleProp<TextStyle>;
21
- withDarkTheme?: boolean;
22
- disabled?: boolean;
23
- defaultValue?: string;
24
- value: string;
25
- onChangePhoneNumber: (phoneNumber: string) => void;
26
- selectedCountry: undefined | ICountry;
27
- onChangeSelectedCountry: (country: ICountry) => void;
28
- }
1
+ import { ICountry } from './interfaces/country';
2
+ import { PhoneInputProps } from './interfaces/phoneInputProps';
29
3
 
30
4
  declare function PhoneInput(props: PhoneInputProps): JSX.Element;
31
5
 
@@ -49,10 +23,11 @@ declare function getCountriesByName(
49
23
 
50
24
  export {
51
25
  PhoneInput,
52
- ICountry,
53
26
  getAllCountries,
54
27
  getCountryByPhoneNumber,
55
28
  getCountryByCca2,
56
29
  getCountriesByCallingCode,
57
30
  getCountriesByName,
31
+ ICountry,
32
+ PhoneInputProps,
58
33
  };
@@ -0,0 +1,6 @@
1
+ export interface ICountry {
2
+ callingCode: string;
3
+ cca2: string;
4
+ flag: string;
5
+ name: string;
6
+ }
@@ -0,0 +1,23 @@
1
+ import {
2
+ StyleProp,
3
+ TextInputProps,
4
+ TextStyle,
5
+ ViewStyle,
6
+ } from 'react-native';
7
+
8
+ import { ICountry } from './country';
9
+
10
+ export interface PhoneInputProps extends TextInputProps {
11
+ placeholder?: string;
12
+ placeholderTextColor?: string;
13
+ containerStyle?: StyleProp<ViewStyle>;
14
+ flagContainerStyle?: StyleProp<ViewStyle>;
15
+ inputStyle?: StyleProp<TextStyle>;
16
+ withDarkTheme?: boolean;
17
+ disabled?: boolean;
18
+ defaultValue?: string;
19
+ value: string;
20
+ onChangePhoneNumber: (phoneNumber: string) => void;
21
+ selectedCountry: undefined | ICountry;
22
+ onChangeSelectedCountry: (country: ICountry) => void;
23
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-international-phone-number",
3
3
  "author": "AstrOOnauta (https://github.com/AstrOOnauta)",
4
- "version": "0.4.8",
4
+ "version": "0.4.10",
5
5
  "description": "International mobile phone input component with mask for React Native",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",