@gem-mine/rmc-calendar
Version:
React Mobile Calendar Component(web and react-native)
62 lines (61 loc) • 2.04 kB
TypeScript
import React from 'react';
import Header from './panel/Header';
import { Models } from './panel/DataTypes';
import PropsType from './CalendarProps';
export declare type ExtraData = Models.ExtraData;
export declare type CellData = Models.CellData;
declare type OriginStyle = {
position: string;
overflowY: string;
width: string;
height: string;
marginTop: string;
scrollTop: number;
};
export { PropsType };
export declare class StateType {
returnToday?: boolean;
showDatePicker?: boolean;
showDate?: Date;
headerTitle?: string;
startDate?: Date;
endDate?: Date;
disConfirmBtn?: boolean;
clientHight?: number;
}
export default class Calendar extends React.PureComponent<PropsType, StateType> {
static DefaultHeader: typeof Header;
static defaultProps: PropsType;
state: StateType;
datePicker: any;
bodyElement: HTMLElement | null;
documentElement: HTMLElement | null;
originStyle: OriginStyle | null;
constructor(props: PropsType);
componentWillReceiveProps(nextProps: PropsType): void;
componentDidMount(): void;
componentWillUnmount(): void;
selectDate: (date: Date | undefined, oldState?: {
startDate?: Date | undefined;
endDate?: Date | undefined;
showDate?: Date | undefined;
headerTitle?: string | undefined;
returnToday?: boolean | undefined;
}, props?: Readonly<PropsType> & Readonly<{
children?: React.ReactNode;
}>) => StateType;
onSelectedDate: (date: Date) => void;
onSelectMonth: () => void;
onClose: () => void;
onCancel: () => void;
onOk: () => void;
onTimeOk: (date: Date) => void;
onTimeCancel: () => void;
onChangeShowDateInfo: (showDate?: Date, headerTitle?: string) => void;
onChangeMonth: (monthData: Models.MonthData) => void;
onComeToday: () => void;
onClear: () => void;
setClientHeight: (height: number) => void;
getShowDate: (defaultDate: Date, firstDayOfMonth: number) => Date;
render(): JSX.Element;
}