UNPKG

@material-ui/lab

Version:

Material-UI Lab - Incubator for Material-UI React components.

49 lines (48 loc) 2.48 kB
import * as React from 'react'; import { WithStyles, Theme } from '@material-ui/core/styles'; import { PickersDayProps } from '../PickersDay/PickersDay'; import { PickerOnChangeFn } from '../internal/pickers/hooks/useViews'; import { SlideDirection, SlideTransitionProps } from './PickersSlideTransition'; export interface ExportedCalendarProps<TDate> extends Pick<PickersDayProps<TDate>, 'disableHighlightToday' | 'showDaysOutsideCurrentMonth' | 'allowSameDateSelection'> { /** * Calendar onChange. */ onChange: PickerOnChangeFn<TDate>; /** * Custom renderer for day. Check [DayComponentProps api](https://material-ui-pickers.dev/api/Day) @DateIOType. */ renderDay?: (day: TDate, selectedDates: Array<TDate | null>, DayComponentProps: PickersDayProps<TDate>) => JSX.Element; /** * Enables keyboard listener for moving between days in calendar. * @default currentWrapper !== 'static' */ allowKeyboardControl?: boolean; /** * If `true` renders `LoadingComponent` in calendar instead of calendar view. * Can be used to preload information and show it in calendar. * @default false */ loading?: boolean; /** * Component displaying when passed `loading` true. * @default () => "..." */ renderLoading?: () => React.ReactNode; } export interface PickersCalendarProps<TDate> extends ExportedCalendarProps<TDate> { date: TDate | null | Array<TDate | null>; isDateDisabled: (day: TDate) => boolean; slideDirection: SlideDirection; currentMonth: TDate; reduceAnimations: boolean; focusedDay: TDate | null; onFocusedDayChange: (newFocusedDay: TDate) => void; isMonthSwitchingAnimating: boolean; onMonthSwitchingAnimationEnd: () => void; TransitionProps?: Partial<SlideTransitionProps>; className?: string; } export declare const styles: (theme: Theme) => Record<"root" | "loadingContainer" | "weekContainer" | "week" | "iconButton" | "previousMonthButton" | "daysHeader" | "weekDayLabel", import("../../../material-ui-styles/src").CSSProperties | import("../../../material-ui-styles/src").CreateCSSProperties<{}> | import("../../../material-ui-styles/src").PropsFunc<{}, import("../../../material-ui-styles/src").CreateCSSProperties<{}>>>; export declare type PickersCalendarClassKey = keyof WithStyles<typeof styles>['classes']; declare const _default: <TDate>(props: PickersCalendarProps<TDate>) => JSX.Element; export default _default;