lucid-ui
Version:
A UI component library from AppNexus.
84 lines (83 loc) • 2.89 kB
TypeScript
import React from 'react';
import { StandardProps } from '../../util/component-types';
export interface ICalendarProps extends StandardProps {
/** The offset of the rendered month, where 0 is the \`initialMonth\`.
* Negative values will show previous months.
*/
monthOffset: number;
/**Sets the month of the calendar. The 0 value for the \`monthOffset\` prop
* refers to this month.
*/
initialMonth: Date;
/** Set the cursor to target date. Primarily used to preview expected ranges
* when the cursor is on a target date.
*/
cursor: Date | null;
/** Sets the start date in a date range.
*/
from?: Date | null;
/** Sets the end date in a date range.
*/
to?: Date | null;
/** The next selection that is expected. Primarily used to preview expected
* ranges when the cursor is on a target date.
*/
selectMode: 'day' | 'from' | 'to';
/** Used to skip re-rendering of this component when true. Primarily used for
* CalendarMonths which are rendered out of view.
*/
shouldComponentUpdate: boolean;
/** These are values that we've allowed our API to accept, which will go directly
* into the `modifers` object that we pass to DayPicker.
*/
modifiers?: any;
/** Sets selected days. Passed through to \`CalendarMonth\` ->
\`react-day-picker\`. */
selectedDays?: Date | ((date: Date) => boolean | Date | Date[]) | null;
/** Sets disabled days. Passed through to \`CalendarMonth\` ->
\`react-day-picker\`.*/
disabledDays?: (date: Date) => boolean | Date | Date[];
/** Highlight dates and ranges based on cursor position. */
showCursorHighlight?: boolean;
key?: string | number;
onDayClick?: (day: Date, { disabled }: {
disabled: boolean;
}, event: React.MouseEvent) => void;
onDayMouseEnter?: (day: Date, { disabled }: {
disabled: boolean;
}) => void;
onDayMouseLeave?: () => void;
}
declare class CalendarMonth extends React.Component<ICalendarProps, {}, {}> {
static _isPrivate: boolean;
static displayName: string;
static peek: {
description: string;
categories: string[];
};
static propTypes: {
className: any;
monthOffset: any;
initialMonth: any;
cursor: any;
from: any;
to: any;
selectMode: any;
shouldComponentUpdate: any;
};
static defaultProps: {
monthOffset: number;
initialMonth: Date;
cursor: null;
from: null;
to: null;
selectMode: string;
shouldComponentUpdate: boolean;
};
modifierRange: (day: Date) => boolean;
modifierFrom: (day: Date) => boolean;
modifierTo: (day: Date) => boolean;
shouldComponentUpdate(): boolean;
render(): React.ReactNode;
}
export default CalendarMonth;