1 | import * as React from 'react';
|
2 |
|
3 | import { Modifiers, Modifier, DayModifiers } from './Modifiers';
|
4 | import { ClassNames, InputClassNames } from './ClassNames';
|
5 | import { LocaleUtils } from './LocaleUtils';
|
6 | import DayPickerInput from './DayPickerInput';
|
7 |
|
8 | export interface CaptionElementProps {
|
9 | date: Date;
|
10 | classNames: ClassNames;
|
11 | localeUtils: LocaleUtils;
|
12 | locale: string;
|
13 | months?: string[];
|
14 | onClick?: React.MouseEventHandler<HTMLElement>;
|
15 | }
|
16 |
|
17 | export interface NavbarElementProps {
|
18 | className: string;
|
19 | classNames: ClassNames;
|
20 | month: Date;
|
21 | previousMonth: Date;
|
22 | nextMonth: Date;
|
23 | showPreviousButton: boolean;
|
24 | showNextButton: boolean;
|
25 | onPreviousClick(callback?: () => void): void;
|
26 | onNextClick(callback?: () => void): void;
|
27 | dir?: string;
|
28 | labels: { previousMonth: string; nextMonth: string };
|
29 | localeUtils: LocaleUtils;
|
30 | locale: string;
|
31 | }
|
32 |
|
33 | export interface WeekdayElementProps {
|
34 | weekday: number;
|
35 | className: string;
|
36 | localeUtils: LocaleUtils;
|
37 | locale: string;
|
38 | weekdaysLong?: string[];
|
39 | weekdaysShort?: string[];
|
40 | }
|
41 |
|
42 | export interface DayPickerProps {
|
43 | canChangeMonth?: boolean;
|
44 | captionElement?:
|
45 | | React.ReactElement<Partial<CaptionElementProps>>
|
46 | | React.ComponentClass<CaptionElementProps>
|
47 | | React.SFC<CaptionElementProps>;
|
48 | className?: string;
|
49 | classNames?: ClassNames;
|
50 | containerProps?: React.DetailedHTMLProps<
|
51 | React.HTMLAttributes<HTMLDivElement>,
|
52 | HTMLDivElement
|
53 | >;
|
54 | dir?: string;
|
55 | disabledDays?: Modifier | Modifier[];
|
56 | showOutsideDays?: boolean;
|
57 | enableOutsideDaysClick?: boolean;
|
58 | firstDayOfWeek?: number;
|
59 | fixedWeeks?: boolean;
|
60 | fromMonth?: Date;
|
61 | initialMonth?: Date;
|
62 | labels?: { previousMonth: string; nextMonth: string };
|
63 | locale?: string;
|
64 | localeUtils?: LocaleUtils;
|
65 | modifiers?: Partial<Modifiers>;
|
66 | modifiersStyles?: object;
|
67 | month?: Date;
|
68 | months?: string[];
|
69 | navbarElement?:
|
70 | | React.ReactElement<Partial<NavbarElementProps>>
|
71 | | React.ComponentClass<NavbarElementProps>
|
72 | | React.SFC<NavbarElementProps>;
|
73 | numberOfMonths?: number;
|
74 | onBlur?: (e: React.FocusEvent<HTMLDivElement>) => void;
|
75 | onCaptionClick?: (month: Date, e: React.MouseEvent<HTMLDivElement>) => void;
|
76 | onDayClick?: (
|
77 | day: Date,
|
78 | modifiers: DayModifiers,
|
79 | e: React.MouseEvent<HTMLDivElement>
|
80 | ) => void;
|
81 | onDayKeyDown?: (
|
82 | day: Date,
|
83 | modifiers: DayModifiers,
|
84 | e: React.KeyboardEvent<HTMLDivElement>
|
85 | ) => void;
|
86 | onDayMouseEnter?: (
|
87 | day: Date,
|
88 | modifiers: DayModifiers,
|
89 | e: React.MouseEvent<HTMLDivElement>
|
90 | ) => void;
|
91 | onDayMouseLeave?: (
|
92 | day: Date,
|
93 | modifiers: DayModifiers,
|
94 | e: React.MouseEvent<HTMLDivElement>
|
95 | ) => void;
|
96 | onDayMouseDown?: (
|
97 | day: Date,
|
98 | modifiers: DayModifiers,
|
99 | e: React.MouseEvent<HTMLDivElement>
|
100 | ) => void;
|
101 | onDayMouseUp?: (
|
102 | day: Date,
|
103 | modifiers: DayModifiers,
|
104 | e: React.MouseEvent<HTMLDivElement>
|
105 | ) => void;
|
106 | onDayTouchEnd?: (
|
107 | day: Date,
|
108 | modifiers: DayModifiers,
|
109 | e: React.TouchEvent<HTMLDivElement>
|
110 | ) => void;
|
111 | onDayTouchStart?: (
|
112 | day: Date,
|
113 | modifiers: DayModifiers,
|
114 | e: React.TouchEvent<HTMLDivElement>
|
115 | ) => void;
|
116 | onFocus?: (e: React.FocusEvent<HTMLDivElement>) => void;
|
117 | onKeyDown?: (e: React.KeyboardEvent<HTMLDivElement>) => void;
|
118 | onMonthChange?: (month: Date) => void;
|
119 | onTodayButtonClick?: (
|
120 | day: Date,
|
121 | modifiers: DayModifiers,
|
122 | e: React.MouseEvent<HTMLButtonElement>
|
123 | ) => void;
|
124 | onWeekClick?: (
|
125 | weekNumber: number,
|
126 | days: Date[],
|
127 | e: React.MouseEvent<HTMLDivElement>
|
128 | ) => void;
|
129 | pagedNavigation?: boolean;
|
130 | renderDay?: (date: Date, modifiers: DayModifiers) => React.ReactNode;
|
131 | renderWeek?: (
|
132 | weekNumber: number,
|
133 | week: Date[],
|
134 | month: Date
|
135 | ) => React.ReactNode;
|
136 | reverseMonths?: boolean;
|
137 | selectedDays?: Modifier | Modifier[];
|
138 | showWeekNumbers?: boolean;
|
139 | showWeekDays?: boolean;
|
140 | todayButton?: string;
|
141 | toMonth?: Date;
|
142 | weekdayElement?:
|
143 | | React.ReactElement<Partial<WeekdayElementProps>>
|
144 | | React.ComponentClass<WeekdayElementProps>
|
145 | | React.SFC<WeekdayElementProps>;
|
146 | weekdaysLong?: string[];
|
147 | weekdaysShort?: string[];
|
148 | tabIndex?: number;
|
149 | }
|
150 |
|
151 | export interface DayPickerInputProps {
|
152 | value?: string | Date;
|
153 | format?: string | string[];
|
154 | placeholder?: string;
|
155 | style?: object;
|
156 |
|
157 | dayPickerProps?: DayPickerProps;
|
158 | inputProps?: object;
|
159 |
|
160 | formatDate?: (date: Date, format: string, locale: string) => string;
|
161 | parseDate?: (str: string, format: string, locale: string) => Date | void;
|
162 |
|
163 | hideOnDayClick?: boolean;
|
164 | clickUnselectsDay?: boolean;
|
165 | showOverlay?: boolean;
|
166 | keepFocus?: boolean;
|
167 |
|
168 | component?: any;
|
169 | overlayComponent?: any;
|
170 |
|
171 | classNames?: InputClassNames;
|
172 |
|
173 | onDayChange?: (
|
174 | day: Date,
|
175 | DayModifiers: DayModifiers,
|
176 | dayPickerInput: DayPickerInput
|
177 | ) => void;
|
178 | onDayPickerHide?: () => void;
|
179 | onDayPickerShow?: () => void;
|
180 | onChange?: (e: React.FocusEvent<HTMLDivElement>) => void;
|
181 | onClick?: (e: React.FocusEvent<HTMLDivElement>) => void;
|
182 | onFocus?: (e: React.FocusEvent<HTMLDivElement>) => void;
|
183 | onBlur?: (e: React.FocusEvent<HTMLDivElement>) => void;
|
184 | onKeyUp?: (e: React.FocusEvent<HTMLDivElement>) => void;
|
185 | }
|