choerodon-ui
Version:
An enterprise-class UI design language and React-based implementation
73 lines (72 loc) • 2.9 kB
TypeScript
import React, { ReactNode } from 'react';
import moment, { Moment } from 'moment';
import ViewComponent, { ViewComponentProps } from '../core/ViewComponent';
import { DatePickerKeyboardEvent, RenderFunction, TimeStep } from './DatePicker';
import { ViewMode } from './enum';
import { FieldType } from '../data-set/enum';
export declare function alwaysValidDate(): boolean;
export interface DateViewProps extends ViewComponentProps {
date: Moment;
min?: Moment;
max?: Moment;
mode: ViewMode;
format: string;
step: TimeStep;
renderer?: RenderFunction;
isValidDate?: (currentDate: Moment, selected: Moment, mode?: ViewMode) => boolean;
isExistValue?: boolean;
onSelect?: (selectedDate: Moment, expand?: boolean) => void;
onSelectedDateChange?: (selectedDate: Moment, mode?: ViewMode) => void;
onCursorDateChange?: (cursorDate: Moment, selectedDate: Moment, mode?: ViewMode) => void;
onViewModeChange?: (mode: ViewMode) => void;
renderExtraFooter?: () => ReactNode;
extraFooterPlacement?: 'top' | 'bottom';
disabledNow?: boolean;
okButton?: boolean;
onDateMouseEnter?: (date?: Moment) => void;
onDateMouseLeave?: () => void;
}
export default class DaysView<T extends DateViewProps> extends ViewComponent<T> implements DatePickerKeyboardEvent {
static displayName: string;
static defaultProps: {
suffixCls: string;
extraFooterPlacement: string;
};
static type: FieldType;
getViewClassName(): string;
render(): JSX.Element;
handlePrevYearClick(): void;
handlePrevMonthClick(): void;
handleMonthSelect(): void;
handleYearSelect(): void;
handleNextYearClick(): void;
handleNextMonthClick(): void;
handleKeyDownHome(e: any): void;
handleKeyDownEnd(e: any): void;
handleKeyDownLeft(e: any): void;
handleKeyDownRight(e: any): void;
handleKeyDownUp(e: any): void;
handleKeyDownDown(e: any): void;
handleKeyDownPageUp(e: any): void;
handleKeyDownPageDown(e: any): void;
handleKeyDownEnter(e: any): void;
handleCellClick(date: Moment): void;
choose(date: Moment, expand?: boolean): void;
changeSelectedDate(selectedDate: Moment, mode?: ViewMode): void;
changeCursorDate(cursor: Moment, mode?: ViewMode): void;
changeViewMode(mode: ViewMode): void;
renderHeader(): ReactNode;
renderBody(): JSX.Element;
renderPanel(): JSX.Element;
renderPanelHead(): ReactNode;
get customFooter(): JSX.Element | null;
renderFooter(): ReactNode;
renderCell(props: object): ReactNode;
renderInner(text: any): JSX.Element;
getFirstDay(date: any): any;
handleDateMouseEnter: (currentDate?: moment.Moment | undefined) => (event: React.MouseEvent<Element, MouseEvent>) => void;
renderPanelBody(): ReactNode;
getPanelClass(): string;
getDaysOfWeek(): ReactNode[];
getCloneDate(): Moment;
}