/** @jsxImportSource react */ import "../../ui/Format"; import { VDOM } from "../../ui/Widget"; import { Field, FieldConfig, FieldInstance } from "./Field"; import type { Instance } from "../../ui/Instance"; import type { RenderingContext } from "../../ui/RenderingContext"; import { BooleanProp, DataRecord, Prop } from "../../ui/Prop"; interface DayInfo { mod?: string; className?: string; style?: DataRecord | string; unselectable?: boolean; disabled?: boolean; } interface DayData { [day: string]: DayInfo; } export interface CalendarConfig extends FieldConfig { /** Selected date. This should be a `Date` object or a valid date string consumable by `Date.parse` function. */ value?: Prop; /** View reference date. If no date is selected, this date is used to determine which month to show in the calendar. */ refDate?: Prop; /** Minimum date value. This should be a `Date` object or a valid date string consumable by `Date.parse` function. */ minValue?: Prop; /** Set to `true` to disallow the `minValue`. Default value is `false`. */ minExclusive?: BooleanProp; /** Maximum date value. This should be a `Date` object or a valid date string consumable by `Date.parse` function. */ maxValue?: Prop; /** Set to `true` to disallow the `maxValue`. Default value is `false`. */ maxExclusive?: BooleanProp; /** Base CSS class to be applied to the calendar. Defaults to `calendar`. */ baseClass?: string; /** Highlight today's date. Default is true. */ highlightToday?: boolean; /** Maximum value error text. */ maxValueErrorText?: string; /** Maximum exclusive value error text. */ maxExclusiveErrorText?: string; /** Minimum value error text. */ minValueErrorText?: string; /** Minimum exclusive value error text. */ minExclusiveErrorText?: string; /** The function that will be used to convert Date objects before writing data to the store. * Default implementation is Date.toISOString. * See also Culture.setDefaultDateEncoding. */ encoding?: (date: Date) => any; /** Set to true to show the button for quickly selecting today's date. */ showTodayButton?: boolean; /** Localizable text for the todayButton. Defaults to `"Today"`. */ todayButtonText?: string; /** Defines which days of week should be displayed as disabled, i.e. `[0, 6]` will make Sunday and Saturday unselectable. */ disabledDaysOfWeek?: number[]; /** Set to true to show weeks starting from Monday. */ startWithMonday?: boolean; /** Map of days to additional day information such as style, className, mod, unselectable and disabled. */ dayData?: Prop; } export declare class Calendar extends Field { baseClass: string; unfocusable?: boolean; focusable?: boolean; highlightToday?: boolean; maxValueErrorText?: string; maxExclusiveErrorText?: string; minValueErrorText?: string; minExclusiveErrorText?: string; disabledDaysOfWeekErrorText?: string; showTodayButton?: boolean; todayButtonText?: string; startWithMonday?: boolean; onBeforeSelect?: string | ((e: React.MouseEvent, instance: Instance, date: Date) => boolean | void); onSelect?: string | ((e: React.MouseEvent, instance: Instance, date: Date) => void); onBlur?: string | ((e: React.FocusEvent, instance: Instance) => void); onFocusOut?: string | ((instance: Instance) => void); disabledDaysOfWeek?: number[]; partial?: boolean; encoding?: (date: Date) => string; constructor(config?: CalendarConfig); declareData(...args: Record[]): void; init(): void; prepareData(context: RenderingContext, instance: FieldInstance, ...args: any[]): void; validate(context: RenderingContext, instance: FieldInstance): void; renderInput(context: RenderingContext, instance: any, key: string): React.ReactElement; handleSelect(e: React.MouseEvent, instance: any, date: Date): void; } interface CalendarCmpProps { instance: FieldInstance; handleSelect: (e: React.MouseEvent, date: Date) => void; } interface CalendarState { hover: boolean; focus: boolean; cursor: Date; activeView: string; refDate: Date; startDate: Date; endDate: Date; yearPickerHeight?: number; } export declare class CalendarCmp extends VDOM.Component { el: HTMLElement | null; unsubscribeWheel?: () => void; constructor(props: CalendarCmpProps); getPage(refDate: Date): { refDate: Date; startDate: Date; endDate: Date; }; moveCursor(e: React.SyntheticEvent | React.KeyboardEvent, date: Date, options?: { movePage?: boolean; }): void; move(e: React.MouseEvent, period: string, delta: number): void; handleKeyPress(e: React.KeyboardEvent): void; handleWheel(e: WheelEvent): void; handleBlur(e: React.FocusEvent): void; handleFocus(e: React.FocusEvent): void; handleFocusOut(): void; handleMouseLeave(e: React.MouseEvent): void; handleMouseEnter(e: React.MouseEvent): void; handleMouseMove(e: React.MouseEvent): void; handleMouseDown(e: React.MouseEvent): void; componentDidMount(): void; UNSAFE_componentWillReceiveProps(props: CalendarCmpProps): void; componentWillUnmount(): void; showYearDropdown(): void; handleYearSelect(e: React.MouseEvent, year: number): void; renderYearPicker(): React.ReactElement; render(): React.ReactElement; } export {}; //# sourceMappingURL=Calendar.d.ts.map