1 | import * as React from 'react';
|
2 | import { IRefObject } from '../../Utilities';
|
3 | import { ICalendarStrings, ICalendarIconStrings, ICalendarFormatDateCallbacks } from './Calendar.types';
|
4 | import { DayOfWeek, FirstWeekOfYear, DateRangeType } from '../../utilities/dateValues/DateValues';
|
5 | export interface IDayInfo {
|
6 | key: string;
|
7 | date: string;
|
8 | originalDate: Date;
|
9 | isInMonth: boolean;
|
10 | isToday: boolean;
|
11 | isSelected: boolean;
|
12 | isInBounds: boolean;
|
13 | onSelected: (ev: React.SyntheticEvent<HTMLElement>) => void;
|
14 | }
|
15 | export interface ICalendarDay {
|
16 | focus(): void;
|
17 | }
|
18 | export interface ICalendarDayProps extends React.ClassAttributes<CalendarDay> {
|
19 | componentRef?: IRefObject<ICalendarDay>;
|
20 | strings: ICalendarStrings;
|
21 | selectedDate: Date;
|
22 | navigatedDate: Date;
|
23 | onSelectDate: (date: Date, selectedDateRangeArray?: Date[]) => void;
|
24 | onNavigateDate: (date: Date, focusOnNavigatedDay: boolean) => void;
|
25 | onDismiss?: () => void;
|
26 | firstDayOfWeek: DayOfWeek;
|
27 | dateRangeType: DateRangeType;
|
28 | autoNavigateOnSelection: boolean;
|
29 | navigationIcons: ICalendarIconStrings;
|
30 | today?: Date;
|
31 | onHeaderSelect?: (focus: boolean) => void;
|
32 | showWeekNumbers?: boolean;
|
33 | firstWeekOfYear: FirstWeekOfYear;
|
34 | dateTimeFormatter: ICalendarFormatDateCallbacks;
|
35 | showSixWeeksByDefault?: boolean;
|
36 | minDate?: Date;
|
37 | maxDate?: Date;
|
38 | restrictedDates?: Date[];
|
39 | workWeekDays?: DayOfWeek[];
|
40 | showCloseButton?: boolean;
|
41 | allFocusable?: boolean;
|
42 | }
|
43 | export interface ICalendarDayState {
|
44 | activeDescendantId?: string;
|
45 | weeks?: IDayInfo[][];
|
46 | }
|
47 | export declare class CalendarDay extends React.Component<ICalendarDayProps, ICalendarDayState> {
|
48 | private navigatedDay;
|
49 | private days;
|
50 | constructor(props: ICalendarDayProps);
|
51 | UNSAFE_componentWillReceiveProps(nextProps: ICalendarDayProps): void;
|
52 | render(): JSX.Element;
|
53 | focus(): void;
|
54 | private _setDayRef;
|
55 | private _setDayCellRef;
|
56 | private _getWeekCornerStyles;
|
57 | private _getHighlightedCornerStyle;
|
58 | private _navigateMonthEdge;
|
59 | private _onKeyDown;
|
60 | private _onDayKeyDown;
|
61 | private _onDayMouseDown;
|
62 | private _onDayMouseUp;
|
63 | private _onDayMouseOver;
|
64 | private _onDayMouseLeave;
|
65 | private _onTableMouseLeave;
|
66 | private _onTableMouseUp;
|
67 | private _applyFunctionToDayRefs;
|
68 | private _onSelectDate;
|
69 | private _onSelectNextMonth;
|
70 | private _onSelectPrevMonth;
|
71 | private _onClose;
|
72 | private _onHeaderSelect;
|
73 | private _onHeaderKeyDown;
|
74 | private _onPrevMonthKeyDown;
|
75 | private _onNextMonthKeyDown;
|
76 | private _onCloseButtonKeyDown;
|
77 | private _getWeeks;
|
78 | private _getIsRestrictedDate;
|
79 | private _getBoundedDateRange;
|
80 | /**
|
81 | * Returns the index of the last element in the array where the predicate is true, and -1
|
82 | * otherwise
|
83 | * @param items Array of items to be iterated over using the predicate
|
84 | * @param predicate find calls predicate once for each element of the array, in descending
|
85 | * order, until it finds one where predicate returns true if such an element is found.
|
86 | */
|
87 | private _findLastIndex;
|
88 | }
|