Skip to content

Commit e37da31

Browse files
committed
Add distinct property
1 parent 31c6fe1 commit e37da31

File tree

8 files changed

+14
-1
lines changed

8 files changed

+14
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ Apart from the phone-specific properties described below, all [Input](https://mu
9999
|--------------------|-------------------------------------------------------------------------------------------------------------------------------|---------------------------|
100100
| value | An object containing a parsed phone number or the raw number. | [object](#value) / string |
101101
| country | Country code to be selected by default. By default, it will show the flag of the user's country. | string |
102+
| distinct | Show the distinct list of country codes not listing all area codes. | boolean |
102103
| enableArrow | Shows an arrow next to the country flag. Default value is `false`. | boolean |
103104
| enableSearch | Enables search in the country selection dropdown menu. Default value is `false`. | boolean |
104105
| searchVariant | Accepts an Input variant, and values depend on the chosen Material distribution. | TextFieldVariants |

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"react": "^16.8.6 || ^17.0.0 || ^18.0.0"
4949
},
5050
"dependencies": {
51-
"react-phone-hooks": "^0.1.12"
51+
"react-phone-hooks": "^0.1.14"
5252
},
5353
"devDependencies": {
5454
"@babel/core": "^7.26.0",

src/core/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const PhoneInput = forwardRef(({
2828
variant = undefined,
2929
searchVariant = undefined,
3030
country = getDefaultISO2Code(),
31+
distinct = false,
3132
disabled = false,
3233
enableArrow = false,
3334
enableSearch = false,
@@ -70,6 +71,7 @@ const PhoneInput = forwardRef(({
7071
query,
7172
locale,
7273
country,
74+
distinct,
7375
countryCode,
7476
initialValue,
7577
onlyCountries,

src/core/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export interface PhoneInputProps extends Omit<TextFieldProps, "onChange"> {
1313

1414
country?: string;
1515

16+
distinct?: boolean;
17+
1618
enableArrow?: boolean;
1719

1820
enableSearch?: boolean;

src/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const PhoneInput = forwardRef(({
2727
variant = undefined,
2828
searchVariant = undefined,
2929
country = getDefaultISO2Code(),
30+
distinct = false,
3031
disabled = false,
3132
enableArrow = false,
3233
enableSearch = false,
@@ -69,6 +70,7 @@ const PhoneInput = forwardRef(({
6970
query,
7071
locale,
7172
country,
73+
distinct,
7274
countryCode,
7375
initialValue,
7476
onlyCountries,

src/joy/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const PhoneInput = forwardRef(({
2727
variant = undefined,
2828
searchVariant = undefined,
2929
country = getDefaultISO2Code(),
30+
distinct = false,
3031
disabled = false,
3132
enableArrow = false,
3233
enableSearch = false,
@@ -69,6 +70,7 @@ const PhoneInput = forwardRef(({
6970
query,
7071
locale,
7172
country,
73+
distinct,
7274
countryCode,
7375
initialValue,
7476
onlyCountries,

src/joy/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export interface PhoneInputProps extends Omit<InputProps, "value" | "onChange">
1313

1414
country?: string;
1515

16+
distinct?: boolean;
17+
1618
enableArrow?: boolean;
1719

1820
enableSearch?: boolean;

src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export interface PhoneInputProps extends Omit<TextFieldProps, "onChange"> {
1313

1414
country?: string;
1515

16+
distinct?: boolean;
17+
1618
enableArrow?: boolean;
1719

1820
enableSearch?: boolean;

0 commit comments

Comments
 (0)