Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8a72d3a
export typeahead utils
Michele-Masciave Apr 11, 2025
f8dc2b0
integrate placeholder fix and changelog
Michele-Masciave Apr 16, 2025
a857384
adjust typescript
Michele-Masciave Apr 16, 2025
e1267ef
prepare-pr
Michele-Masciave Apr 28, 2025
12211f1
fixed
Michele-Masciave Apr 30, 2025
92e5c21
Merge branch 'main' of https://github.com/Michele-Masciave/react-hook…
Michele-Masciave Apr 30, 2025
a9347da
Merge branch 'neolution-ch:main' into main
Michele-Masciave May 7, 2025
2987413
Merge branch 'neolution-ch:main' into main
Michele-Masciave Jun 3, 2025
acad69e
Merge branch 'main' of https://github.com/Michele-Masciave/react-hook…
Michele-Masciave Jun 13, 2025
de96e5c
Merge branch 'neolution-ch:main' into main
Michele-Masciave Jun 18, 2025
fbfcc8e
Merge branch 'neolution-ch:main' into main
Michele-Masciave Jun 25, 2025
b5c2533
Merge branch 'main' of https://github.com/Michele-Masciave/react-hook…
Michele-Masciave Jul 7, 2025
7843d38
Merge branch 'neolution-ch:main' into main
Michele-Masciave Jul 16, 2025
6b81771
Merge branch 'neolution-ch:main' into main
Michele-Masciave Sep 26, 2025
743acf1
Merge branch 'neolution-ch:main' into main
Michele-Masciave Sep 29, 2025
022db3c
Merge branch 'neolution-ch:main' into main
Michele-Masciave Oct 1, 2025
bbd78a7
Merge branch 'neolution-ch:main' into main
Michele-Masciave Oct 21, 2025
5d28ea3
Merge branch 'neolution-ch:main' into main
Michele-Masciave Dec 3, 2025
70b5bfe
part 1
Michele-Masciave Dec 10, 2025
c23c7d7
solution 2
Michele-Masciave Dec 10, 2025
ab490ef
do not order pinned regions
Michele-Masciave Dec 10, 2025
3e9f9a7
Merge branch 'neolution-ch:main' into main
Michele-Masciave Dec 10, 2025
76105d6
Merge branch 'main' into feature/telephone-number-fixes
Michele-Masciave Dec 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- support into `requiredFields` property of `Form` component, for nested objects and arrays.
- `form` helper functions
- `form` helper functions.
- `countryMenuWidth` property to `TelephoneNumberInput` in order to customize the country menu width.

### Fixed

- `TelephoneNumberInput` countries order, in order to be alphabetically sorted.
- Required field label on `FormGroupLayoutLabel`, `ColorPicker`, `TelephoneNumberInput`, `TypeaheadTextField` (hence `StaticTypeaheadInput` and `AsyncTypeaheadInput`) in order to display \* also on nested and array fields.

1. `requiredFields` can still accept a `FieldPath<T>[]`
Expand Down
1 change: 1 addition & 0 deletions src/lib/TelephoneNumberInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ interface TelephoneNumberInputProps<T extends FieldValues>
placeholder?: string;
renderAutocompleteField?: (children: ReactNode) => ReactNode;
locale?: string;
countryMenuWidth?: number;
}

const TelephoneNumberInput = <T extends FieldValues>(props: TelephoneNumberInputProps<T>) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import { TextField } from "@mui/material";
import { textFieldBootstrapStyle } from "src/lib/helpers/mui";

interface TelephoneNumberAutocompleteProps<T extends FieldValues>
extends Pick<TelephoneNumberInputProps<T>, "pinnedCountries" | "locale" | "useBootstrapStyle" | "name" | "onChange"> {
extends Pick<
TelephoneNumberInputProps<T>,
"pinnedCountries" | "locale" | "useBootstrapStyle" | "name" | "onChange" | "countryMenuWidth"
> {
popupState: PopupState;
nationalPhoneNumber: string | undefined;
country: Country;
Expand All @@ -24,6 +27,7 @@ const TelephoneNumberAutocomplete = <T extends FieldValues>(props: TelephoneNumb
pinnedCountries = [],
locale,
useBootstrapStyle,
countryMenuWidth = 200,
name,
onChange: propsOnChange,
popupState,
Expand All @@ -42,7 +46,7 @@ const TelephoneNumberAutocomplete = <T extends FieldValues>(props: TelephoneNumb
disableClearable={false}
getOptionDisabled={(option) => option.disabled ?? false}
renderInput={(params) => <TextField {...params} inputRef={inputRef} />}
sx={{ ...(useBootstrapStyle && textFieldBootstrapStyle), width: 200 }}
sx={{ ...(useBootstrapStyle && textFieldBootstrapStyle), width: countryMenuWidth }}
onChange={(_, value, reason) => {
// cannot be cleared
if (reason === "clear") {
Expand Down
6 changes: 5 additions & 1 deletion src/lib/helpers/telephoneNumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ const getCountriesOptions = (pinnedRegions: RegionCode[], locale?: string): Labe
? locale
: undefined;

const supportedRegions = phoneNumberUtil.getSupportedRegions().filter((x) => !pinnedRegions.includes(x));
const supportedRegions = phoneNumberUtil
.getSupportedRegions()
.filter((x) => !pinnedRegions.includes(x))
.sort((a, b) => a.localeCompare(b));

let labelValueOptions = [];

if (pinnedRegions.length > 0) {
Expand Down
Loading