form-input-fields
Version:
A customizable form field components built with TypeScript
33 lines • 1.25 kB
TypeScript
import { TextFieldProps } from '@mui/material';
import { FieldProps } from 'formik';
import { Dayjs } from 'dayjs';
export interface FormDateFieldProps {
/**
* Date format string for display
* Uses dayjs format tokens (e.g., 'YYYY-MM-DD', 'DD/MM/YYYY')
* Default: FORM_DATE_FORMAT.short
*/
format?: string;
/** Minimum selectable date */
minDate?: Dayjs;
/** Maximum selectable date */
maxDate?: Dayjs;
/** Disable past dates */
disablePast?: boolean;
/** Disable future dates */
disableFuture?: boolean;
/** Show today button in the picker */
showTodayButton?: boolean;
/** Make the field read-only */
readOnly?: boolean;
/** Custom onChange handler with additional date-related data */
onChange?: (value: Dayjs | null, context: {
validationError: string | null;
formattedValue: string;
}) => void;
/** Show the date format as helper text (default: false) */
showDateFormat?: boolean;
}
export type FormDateFieldComponentProps = FieldProps & TextFieldProps & FormDateFieldProps;
export declare const FormDateField: (props: FormDateFieldComponentProps) => import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=FormDateField.d.ts.map