import * as React from 'react'; import { OverrideProps } from '@mui/types'; import { SlotComponentProps } from '@mui/utils'; import { DatePickerVariant, DatePickerView, ViewStyle } from '../types'; import { PickerDateType } from '../models/pickers'; import { FormProps } from '../models/formProps'; import { ExportedValidateDateProps } from '../models/validation'; import { SxProps } from '../../types/theme'; import { ExportedDayCalendarProps } from '../DayCalendar/DayCalendar.types'; import { ExportedMonthCalendarProps } from '../MonthCalendar/MonthCalendar.types'; import { ExportedYearCalendarProps } from '../YearCalendar/YearCalendar.types'; /** * Slots for DateCalendar component - combines all child component slots */ export interface DateCalendarSlots { /** * The component used for the root element. * @default 'div' */ root?: React.ElementType; } /** * Slot props for DateCalendar component */ export interface DateCalendarSlotProps { root?: SlotComponentProps<'div', object, DateCalendarOwnerState>; } /** * Props exported by DateCalendar for use by parent components * Follows MUI's pattern of inheriting from all child component exports */ export interface ExportedDateCalendarProps extends ExportedDayCalendarProps, ExportedMonthCalendarProps, ExportedYearCalendarProps, ExportedValidateDateProps, FormProps { /** * Callback fired on year change. * @param {PickerDateType} year The new year. */ onYearChange?: (year: PickerDateType) => void; /** * Callback fired on month change. * @param {PickerDateType} month The new month. */ onMonthChange?: (month: PickerDateType) => void; } export interface DateCalendarComponentProps extends ExportedDateCalendarProps { /** * The currently selected date. */ date: PickerDateType; /** * The month to display in the calendar. */ viewDate: PickerDateType; /** * Callback for when a date is selected. */ onDateChange: (date: PickerDateType) => void; /** * Callback for when the view date is change */ onViewDateChange: (date: PickerDateType) => void; /** * The current view of the date picker. */ view: DatePickerView; /** * Callback for when the view changes. */ onViewChange: (view: DatePickerView) => void; /** * Available views. * @default ['day', 'month', 'year'] */ views?: readonly DatePickerView[]; /** * The variant of the date picker. * @default 'docked' */ variant?: DatePickerVariant; /** * The style of the calendar view. * @default 'grid' */ viewStyle?: ViewStyle; /** * The system prop that allows defining system overrides as well as additional CSS styles. */ sx?: SxProps; } export interface DateCalendarTypeMap

{ props: P & DateCalendarComponentProps & { /** * The slots for customizing the component appearance. */ slots?: DateCalendarSlots; /** * The props used for each slot. */ slotProps?: DateCalendarSlotProps; }; defaultComponent: D; } export type DateCalendarProps = OverrideProps, D> & { component?: D; }; export type DateCalendarOwnerState = DateCalendarProps;