import * as React from 'react'; import type { Moment } from 'moment'; import { BaseProps } from '../../wui-core/src/iCore'; export type IsArr = K extends string ? T : K extends Array ? T[] : T | T[]; export type QSDir = "horizontal" | "vertical"; export type CalendarType = "hour" | "date" | "month" | "year"; export interface CalendarProps extends BaseProps { onChange?: (value: Moment, flag?: boolean, valueStings?: string[]) => void; value?: IsArr; defaultValue?: IsArr; type?: string; onTypeChange?: (type: CalendarType) => void; onPanelChange?: (type: CalendarType) => void; fullscreen?: boolean; monthCellRender?: (value: Moment, locale: string) => React.ReactElement; dateCellRender?: (current: Moment, value: Moment) => React.ReactElement; hourCellRender?: (item: number, show: boolean) => (React.ReactElement | null); disabledDate?: string | ((current: Moment, value?: Moment) => boolean); monthCellContentRender?: (value: Moment, locale: string) => React.ReactElement; monthFullCellRender?: (value: Moment, locale: string) => React.ReactElement; dateCellContentRender?: (current: Moment, values: Moment[]) => (React.ReactElement | null); dateFullCellRender?: (current: Moment, values: Moment[]) => (React.ReactElement | null); hourCellContentRender?: (item: number, show: boolean) => (React.ReactElement | null); mutiple?: boolean; dateCellHeaderReader?: (current: Moment, selectValues: Moment[], headerChilds: (React.ReactElement | null)[]) => React.ReactElement[]; onSelect?: (value: Moment) => void; headerRender?: React.ReactElement | (() => React.ReactElement); onYearChange?: () => (void | Promise); getDateCellAttr?: (current: Moment, value: Moment) => { [key: string]: any; }; onTimeEventsClick?: (e: React.MouseEvent, value: EventObjectInput, time: Moment) => void; fillSpace?: boolean; onQuickSelect?: ({ changeValues, isChecked, value, direction }: { changeValues: string[]; isChecked: boolean; value: Map; direction: QSDir; }) => void; headerComponent?: React.ReactElement | (() => React.ReactElement); scrollIntoValue?: Moment; defaultScrollIntoValue?: Moment; renderDateHeaderCell: (day: string, xindex: number) => React.ReactElement; layout?: string; operations?: string[]; timeEvents?: EventObject[]; showTimeLine?: boolean; markWeekend?: boolean; defaultType: string; mode: string; locale: string; quickSelect: boolean | number; weekStartsOn?: number; } export interface CalendarState { selectValuesMap: Map; value: Moment; fillSpaceStyle: React.CSSProperties; highLightDate: string[]; type: string; current: Moment; focusedDay: string; } export interface EventObject { start: string | number; end: string | number; content: React.ReactNode; } export interface EventObjectO extends EventObject { start: string; end: string; } export interface EventObjectT extends EventObjectO { date: string; } export interface EventObjectInput { start: string; end?: string; content?: React.ReactNode; } export interface CalendarHeaderProps extends BaseProps { value: Moment; locale: Record; Select: keyof JSX.IntrinsicElements | any; type?: string; showTypeSwitch: boolean; headerComponents?: React.ReactElement | (() => React.ReactElement); prefixCls: string; yearSelectOffset: number; yearSelectTotal: number; onValueChange: (v?: Moment) => void; onTypeChange?: (type?: CalendarType) => void; onPanelChange?: (type?: CalendarType) => void; operations?: string[]; } export interface CalendarHeaderDefaultProps { yearSelectOffset: number; yearSelectTotal: number; onValueChange: (v?: Moment) => void; onTypeChange: (type?: CalendarType) => void; } export interface CalendarSliderProps { value: Moment; prefixCls?: string; lang: string; fieldid?: string; onMonthChange: (v?: Moment) => void; type?: string; onTimeEventsClick?: (e: React.MouseEvent, value: EventObjectInput, time: Moment) => void; showTimeLine?: boolean; hourCellRender?: (item: number, show: boolean) => (React.ReactElement | null); hourCellContentRender?: (item: number, show: boolean) => (React.ReactElement | null); } export interface CalendarHourBodyProps { clsPrefix?: string; fieldid?: string; value: Moment; timeEvents?: EventObject[]; showTimeLine?: boolean; current: Moment; layout?: string; onTimeEventsClick?: (e: React.MouseEvent, value: EventObjectInput, time: Moment) => void; } export interface CalendarNode { arguments: { width: number; left: number; content: React.ReactNode; }; children: CalendarNode[]; data: [{ hour: number; minute: number; }, { hour: number; minute: number; }, number, React.ReactNode, [string, string]]; level: number; maxEnd: number; parent: CalendarNode | null; timeInfo: { begin: number; end: number; }; contains: (v1: CalendarNode, v2: boolean) => boolean; }