@awsui/components-react
Version:
On July 19th, 2022, we launched [Cloudscape Design System](https://cloudscape.design). Cloudscape is an evolution of AWS-UI. It consists of user interface guidelines, front-end components, design resources, and development tools for building intuitive, en
44 lines • 1.55 kB
TypeScript
import { CalendarProps } from '../../../calendar/interfaces';
import { DateRangePickerProps, DayIndex } from '../../interfaces';
export interface GridBaseProps {
baseDate: Date;
selectedStartDate: Date | null;
selectedEndDate: Date | null;
focusedDate: Date | null;
onFocusedDateChange: React.Dispatch<React.SetStateAction<Date | null>>;
onSelectDate: (date: Date) => void;
isDateEnabled: DateRangePickerProps.IsDateEnabledFunction;
dateDisabledReason: DateRangePickerProps.DateDisabledReasonFunction;
locale: string;
}
export interface GridProps extends GridBaseProps, Required<Pick<CalendarProps, 'granularity'>> {
rangeStartDate: Date | null;
rangeEndDate: Date | null;
focusedDateRef: React.RefObject<HTMLTableCellElement>;
onGridKeyDownHandler: (e: React.KeyboardEvent<HTMLElement>) => void;
ariaLabelledby: string;
className?: string;
/**
* Used to only add the dates of previous and next months outside the month pages
*/
padDates: 'before' | 'after';
currentMonthAriaLabel?: string;
startOfWeek?: DayIndex;
todayAriaLabel?: string;
}
export interface SelectGridProps extends GridBaseProps, Pick<CalendarProps, 'granularity'> {
/**
* changes the page/view of the calendar. Doing so will change to another month or year
* @param date
* @returns
*/
onPageChange: (date: Date) => void;
isSingleGrid: boolean;
headingIdPrefix: string;
/**
* not needed for grids with a month granularity
*/
startOfWeek?: DayIndex;
todayAriaLabel?: string;
currentMonthAriaLabel?: string;
}