UNPKG

@appello/web-ui

Version:

Web ui library for a better development experience

21 lines (20 loc) 1.32 kB
import { ForwardedRef, ReactElement } from 'react'; import { Control, FieldPathByValue, FieldValues } from 'react-hook-form'; import { FieldProps } from '../../../components/form/Field'; import { SelectProps, SelectRefProps } from '../../../components/form/Select'; type AllowedFieldProps = Pick<FieldProps, 'label' | 'className' | 'required' | 'labelChildren' | 'labelClassName'>; type AllowedSelectProps<TValue, TIsMulti extends boolean, TIsClearable extends boolean, TIsCreatable extends boolean> = Pick<SelectProps<TValue, TIsMulti, TIsClearable, TIsCreatable>, 'inputSize' | 'placeholder' | 'disabled' | 'components' | 'menuPortalTarget' | 'closeMenuOnScroll' | 'formatOptionLabel'>; export interface TimeFieldProps<TName, TFormValues extends FieldValues> extends AllowedFieldProps, AllowedSelectProps<TimeFieldValue, false, false, false> { labelFormat?: string; valueFormat?: string; name: TName; control: Control<TFormValues>; step?: number; defaultStartDate?: Date; defaultEndDate?: Date; } type TimeFieldValue = string | null; export declare const TimeField: <TFormValues extends FieldValues, TName extends FieldPathByValue<TFormValues, TimeFieldValue>>(props: TimeFieldProps<TName, TFormValues> & { ref?: ForwardedRef<SelectRefProps<TimeFieldValue>>; }) => ReactElement; export {};