import { DateValidationError } from '@mui/x-date-pickers/internals'; import { Dayjs } from 'dayjs'; import { TextFieldProps } from '../../../../../tedi/components/form/textfield/textfield'; export type DatepickerValue = Dayjs | null; /** * @deprecated Use `DateField` from `@tedi-design-system/react/tedi` instead. */ export interface DatePickerProps extends Omit { /** * Datepicker initial value. Accepts a dayjs date object. */ defaultValue?: DatepickerValue; /** * Currently selected value. Accepts a dayjs date object. * Used only if onChange is also defined */ value?: DatepickerValue; /** * onChange handler. * Triggers each time when new value is selected from datepicker. */ onChange?: (value: DatepickerValue) => void; /** * minDate to set minDate user can select. * If want to disable past dates use disablePast boolean. */ minDate?: Dayjs; /** * maxDate to set maxDate user can select. * If want to disable future dates use disableFuture boolean. */ maxDate?: Dayjs; /** * Controls the date the picker is opened to */ referenceDate?: Dayjs; /** * If true future days are disabled. */ disableFuture?: boolean; /** * If true past days are disabled. */ disablePast?: boolean; /** * If true, today's date is rendering without highlighting with circle. */ disableHighlightToday?: boolean; /** * Disable specific date. */ shouldDisableDate?: (day: DatepickerValue) => boolean; /** * Disable specific months dynamically. Works like shouldDisableDate but for month selection view */ shouldDisableMonth?: (month: DatepickerValue) => boolean; /** * Disable specific years dynamically. Works like shouldDisableDate but for year selection view */ shouldDisableYear?: (month: DatepickerValue) => boolean; /** * Mobile picker title, displaying in the toolbar. Default from LabelProvider */ toolbarTitle?: string; /** * Format string. * @Default DD.MM.YYYY */ inputFormat?: string; /** * If true renders LoadingComponent in calendar instead of calendar view. Can be used to preload information and show it in calendar. */ loading?: boolean; /** * Callback that fired when input value or new value prop validation returns new validation error (or value is valid after error). * In case of validation error detected reason prop return non-null value and TextField must be displayed in error state. * This can be used to render appropriate form error. * Read the guide about form integration and error displaying (https://next.material-ui-pickers.dev/guides/forms). */ onError?: (reason: DateValidationError, value: DatepickerValue) => void; /** * Array of views to show. * @default ['year', 'day'] */ views?: Array<'day' | 'month' | 'year'>; /** * Callback fired when the popup requests to be closed. */ onClose?: () => void; } /** * @deprecated Use `DateField` from `@tedi-design-system/react/tedi` instead. */ export declare const DatePicker: (props: DatePickerProps) => JSX.Element; export default DatePicker;