@wix/design-system
Version:
@wix/design-system
61 lines (56 loc) • 1.8 kB
TypeScript
import { KeyboardEvent, FC, PureComponent } from 'react';
import { SupportedWixLocales } from 'wix-design-systems-locale-utils';
export interface dateIndicationProps {
date: Date;
isSelected: boolean;
}
export type LanguageType = SupportedWixLocales;
export interface CalendarProps {
dataHook?: string;
autoFocus?: boolean;
numOfMonths?: 1 | 2;
className?: string;
onChange: (date: Date) => void;
onMonthChange?: (monthStart: Date) => void;
onClose?: () => void;
excludePastDates?: boolean;
filterDate?: (date: Date) => boolean;
onKeyDown?: (event: KeyboardEvent) => void;
value?:
| Date
| {
from?: string | Date;
to?: string | Date;
};
selectionMode?: 'day' | 'range';
showYearDropdown?: boolean;
showMonthDropdown?: boolean;
shouldCloseOnSelect?: boolean;
locale?: SupportedWixLocales;
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
rtl?: boolean;
dateIndication?: FC<dateIndicationProps>;
today?: Date;
leftArrowAriaLabel?: string;
leftArrowAriaLabelledBy?: string;
rightArrowAriaLabel?: string;
rightArrowAriaLabelledBy?: string;
monthDropdownAriaLabel?: string;
monthDropdownAriaLabelledBy?: string;
yearDropdownAriaLabel?: string;
yearDropdownAriaLabelledBy?: string;
size?: 'small' | 'medium';
}
export default class Calendar extends PureComponent<CalendarProps> {
static areValuesEqual: (value1?: {}, value2?: {}) => boolean;
static renderDay: (day: any, modifiers: any) => void;
static optionalParse: (dateOrString: Date | string) => void;
static parseValue: (value: any) => any;
static isSingleDay: (value: any) => Date;
static isRangeValue: (value: any) => boolean;
static getUpdatedMonth: (
nextPropsValue: any,
numOfMonths: number,
currentMonthDate: any,
) => any;
}