1
- import { useContext , ReactNode } from 'react' ;
1
+ import { useContext , type ReactNode } from 'react' ;
2
2
import {
3
- FieldValues ,
4
- Path ,
5
3
Controller ,
6
- Control ,
7
- RegisterOptions
4
+ type FieldValues ,
5
+ type Path ,
6
+ type Control ,
7
+ type RegisterOptions
8
8
} from 'react-hook-form' ;
9
9
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider' ;
10
10
import {
11
11
DateTimePicker as MuiDateTimePicker ,
12
- DateTimePickerProps ,
13
- PickerValidDate ,
14
- DateTimeValidationError ,
15
- PickerChangeHandlerContext
12
+ type DateTimePickerProps ,
13
+ type PickerValidDate ,
14
+ type DateTimeValidationError ,
15
+ type PickerChangeHandlerContext
16
16
} from '@mui/x-date-pickers' ;
17
17
import { RHFMuiConfigContext } from '@/config/ConfigProvider' ;
18
18
import { FormControl , FormLabel , FormLabelText , FormHelperText } from '@/mui/common' ;
19
- import { FormLabelProps , FormHelperTextProps } from '@/types' ;
19
+ import type { FormLabelProps , FormHelperTextProps } from '@/types' ;
20
20
import { fieldNameToLabel , keepLabelAboveFormField } from '@/utils' ;
21
21
22
22
export type RHFDateTimePickerProps < T extends FieldValues > = {
@@ -25,9 +25,10 @@ export type RHFDateTimePickerProps<T extends FieldValues> = {
25
25
registerOptions ?: RegisterOptions < T , Path < T > > ;
26
26
required ?: boolean ;
27
27
onValueChange ?: (
28
- newValue : PickerValidDate | null ,
28
+ newValue : PickerValidDate ,
29
29
context : PickerChangeHandlerContext < DateTimeValidationError >
30
- ) => void ; showLabelAboveFormField ?: boolean ;
30
+ ) => void ;
31
+ showLabelAboveFormField ?: boolean ;
31
32
formLabelProps ?: FormLabelProps ;
32
33
helperText ?: ReactNode ;
33
34
errorMessage ?: ReactNode ;
0 commit comments