1 | import * as React from 'react';
|
2 | import { SlideDirection } from './SlideTransition';
|
3 | import { Theme } from '@material-ui/core/styles';
|
4 | import { MaterialUiPickersDate } from '../../typings/date';
|
5 | import { IconButtonProps } from '@material-ui/core/IconButton';
|
6 | import { WithStyles } from '@material-ui/core/styles';
|
7 | import { WithUtilsProps } from '../../_shared/WithUtils';
|
8 | export interface OutterCalendarProps {
|
9 |
|
10 | leftArrowIcon?: React.ReactNode;
|
11 |
|
12 | rightArrowIcon?: React.ReactNode;
|
13 |
|
14 | renderDay?: (day: MaterialUiPickersDate, selectedDate: MaterialUiPickersDate, dayInCurrentMonth: boolean, dayComponent: JSX.Element) => JSX.Element;
|
15 | |
16 |
|
17 |
|
18 |
|
19 | allowKeyboardControl?: boolean;
|
20 | |
21 |
|
22 |
|
23 |
|
24 | leftArrowButtonProps?: Partial<IconButtonProps>;
|
25 | |
26 |
|
27 |
|
28 |
|
29 | rightArrowButtonProps?: Partial<IconButtonProps>;
|
30 |
|
31 | shouldDisableDate?: (day: MaterialUiPickersDate) => boolean;
|
32 |
|
33 | onMonthChange?: (date: MaterialUiPickersDate) => void | Promise<void>;
|
34 |
|
35 | loadingIndicator?: JSX.Element;
|
36 | }
|
37 | export interface CalendarProps extends OutterCalendarProps, WithUtilsProps, WithStyles<typeof styles, true> {
|
38 |
|
39 | date: MaterialUiPickersDate;
|
40 |
|
41 | onChange: (date: MaterialUiPickersDate, isFinish?: boolean) => void;
|
42 |
|
43 | minDate?: MaterialUiPickersDate;
|
44 |
|
45 | maxDate?: MaterialUiPickersDate;
|
46 |
|
47 | disablePast?: boolean;
|
48 |
|
49 | disableFuture?: boolean;
|
50 | }
|
51 | export interface CalendarState {
|
52 | slideDirection: SlideDirection;
|
53 | currentMonth: MaterialUiPickersDate;
|
54 | lastDate?: MaterialUiPickersDate;
|
55 | loadingQueue: number;
|
56 | }
|
57 | export declare class Calendar extends React.Component<CalendarProps, CalendarState> {
|
58 | static contextType: React.Context<"dialog" | "inline" | "static" | null>;
|
59 | static propTypes: any;
|
60 | static defaultProps: Partial<CalendarProps>;
|
61 | static getDerivedStateFromProps(nextProps: CalendarProps, state: CalendarState): {
|
62 | lastDate: MaterialUiPickersDate;
|
63 | currentMonth: MaterialUiPickersDate;
|
64 | slideDirection: SlideDirection;
|
65 | } | null;
|
66 | state: CalendarState;
|
67 | componentDidMount(): void;
|
68 | private pushToLoadingQueue;
|
69 | private popFromLoadingQueue;
|
70 | handleChangeMonth: (newMonth: MaterialUiPickersDate, slideDirection: SlideDirection) => void;
|
71 | validateMinMaxDate: (day: MaterialUiPickersDate) => boolean;
|
72 | shouldDisablePrevMonth: () => boolean;
|
73 | shouldDisableNextMonth: () => boolean;
|
74 | shouldDisableDate: (day: MaterialUiPickersDate) => boolean;
|
75 | handleDaySelect: (day: MaterialUiPickersDate, isFinish?: boolean) => void;
|
76 | moveToDay: (day: MaterialUiPickersDate) => void;
|
77 | handleKeyDown: (event: KeyboardEvent) => void;
|
78 | private renderWeeks;
|
79 | private renderDays;
|
80 | render(): JSX.Element;
|
81 | }
|
82 | export declare const styles: (theme: Theme) => {
|
83 | transitionContainer: {
|
84 | minHeight: number;
|
85 | marginTop: number;
|
86 | };
|
87 | progressContainer: {
|
88 | width: string;
|
89 | height: string;
|
90 | display: string;
|
91 | justifyContent: string;
|
92 | alignItems: string;
|
93 | };
|
94 | week: {
|
95 | display: string;
|
96 | justifyContent: string;
|
97 | };
|
98 | };
|
99 | declare const _default: React.ComponentType<Pick<React.PropsWithChildren<Pick<CalendarProps, "classes" | "theme" | "onChange" | "date" | "onMonthChange" | "leftArrowIcon" | "rightArrowIcon" | "leftArrowButtonProps" | "rightArrowButtonProps" | "minDate" | "maxDate" | "disablePast" | "disableFuture" | "renderDay" | "allowKeyboardControl" | "shouldDisableDate" | "loadingIndicator">>, "children" | "onChange" | "date" | "onMonthChange" | "leftArrowIcon" | "rightArrowIcon" | "leftArrowButtonProps" | "rightArrowButtonProps" | "minDate" | "maxDate" | "disablePast" | "disableFuture" | "renderDay" | "allowKeyboardControl" | "shouldDisableDate" | "loadingIndicator"> & import("@material-ui/core/styles").StyledComponentProps<"transitionContainer" | "progressContainer" | "week">>;
|
100 | export default _default;
|