1 | import * as React from 'react';
|
2 | import { Theme } from '@material-ui/core';
|
3 | import { IconButtonProps } from '@material-ui/core/IconButton';
|
4 | import { WithStyles } from '@material-ui/core/styles/withStyles';
|
5 | import { WithUtilsProps } from '../../_shared/WithUtils';
|
6 | import { DateType } from '../../constants/prop-types';
|
7 | import { MaterialUiPickersDate } from '../../typings/date';
|
8 | import { SlideDirection } from './SlideTransition';
|
9 | export declare type RenderDay = (day: MaterialUiPickersDate, selectedDate: MaterialUiPickersDate, dayInCurrentMonth: boolean, dayComponent: React.ReactElement<IconButtonProps>) => JSX.Element;
|
10 | export interface CalendarProps extends WithUtilsProps, WithStyles<typeof styles, true> {
|
11 | date: MaterialUiPickersDate;
|
12 | minDate: DateType;
|
13 | maxDate: DateType;
|
14 | onChange: (date: MaterialUiPickersDate, isFinish?: boolean) => void;
|
15 | disablePast?: boolean;
|
16 | disableFuture?: boolean;
|
17 | leftArrowIcon?: React.ReactNode;
|
18 | rightArrowIcon?: React.ReactNode;
|
19 | renderDay?: RenderDay;
|
20 | allowKeyboardControl?: boolean;
|
21 | onMonthChange?: (date: MaterialUiPickersDate) => void;
|
22 | shouldDisableDate?: (day: MaterialUiPickersDate) => boolean;
|
23 | }
|
24 | export interface CalendarState {
|
25 | slideDirection: SlideDirection;
|
26 | currentMonth: MaterialUiPickersDate;
|
27 | lastDate?: MaterialUiPickersDate;
|
28 | }
|
29 | export declare class Calendar extends React.Component<CalendarProps, CalendarState> {
|
30 | static propTypes: any;
|
31 | static defaultProps: {
|
32 | minDate: Date;
|
33 | maxDate: Date;
|
34 | disablePast: boolean;
|
35 | disableFuture: boolean;
|
36 | allowKeyboardControl: boolean;
|
37 | };
|
38 | static getDerivedStateFromProps(nextProps: CalendarProps, state: CalendarState): {
|
39 | lastDate: any;
|
40 | currentMonth: any;
|
41 | slideDirection: SlideDirection;
|
42 | } | null;
|
43 | state: CalendarState;
|
44 | componentDidMount(): void;
|
45 | onDateSelect: (day: any, isFinish?: boolean) => void;
|
46 | handleChangeMonth: (newMonth: any, slideDirection: SlideDirection) => void;
|
47 | validateMinMaxDate: (day: any) => boolean;
|
48 | shouldDisablePrevMonth: () => boolean;
|
49 | shouldDisableNextMonth: () => boolean;
|
50 | shouldDisableDate: (day: any) => boolean;
|
51 | moveToDay: (day: any) => void;
|
52 | handleKeyDown: (event: KeyboardEvent) => void;
|
53 | renderWeeks: () => JSX.Element[];
|
54 | renderDays: (week: any[]) => JSX.Element[];
|
55 | render(): JSX.Element;
|
56 | }
|
57 | export declare const styles: (theme: Theme) => {
|
58 | transitionContainer: {
|
59 | minHeight: number;
|
60 | marginTop: number;
|
61 | };
|
62 | week: {
|
63 | display: string;
|
64 | justifyContent: string;
|
65 | };
|
66 | };
|
67 | declare const _default: React.ComponentType<Pick<React.PropsWithChildren<Pick<CalendarProps, "onChange" | "date" | "classes" | "theme" | "maxDate" | "minDate" | "disablePast" | "disableFuture" | "shouldDisableDate" | "onMonthChange" | "leftArrowIcon" | "rightArrowIcon" | "renderDay" | "allowKeyboardControl">>, "children" | "onChange" | "date" | "maxDate" | "minDate" | "disablePast" | "disableFuture" | "shouldDisableDate" | "onMonthChange" | "leftArrowIcon" | "rightArrowIcon" | "renderDay" | "allowKeyboardControl"> & import("@material-ui/core").StyledComponentProps<"transitionContainer" | "week">>;
|
68 | export default _default;
|