UNPKG

rp-data-chart

Version:

Rabbitpre data-chart components lib

56 lines (55 loc) 1.47 kB
import React from 'react'; import { Moment } from 'moment'; import 'moment/locale/zh-cn'; import { FocusedInputShape } from 'react-dates'; import 'react-dates/initialize'; import 'react-dates/lib/css/_datepicker.css'; import './theme.less'; import './date-range-picker.less'; declare type DateRangeType = { startDate: Moment | null; endDate: Moment | null; }; declare type SelectType = { type: number; text: string; start?: string; end?: string; }; interface IProps { publishDate: string; onChange?: Function; } interface IState { focusedInput: FocusedInputShape | null; startDate: Moment | null; endDate: Moment | null; select: boolean; } export default class DRP extends React.Component<IProps, IState> { state: IState; constructor(props: IProps); /** * 初始化数据 */ init(): void; onDatesChange({ startDate, endDate }: DateRangeType): void; /** * 监听用户焦点变化 * @param focusedInput */ onFocusChange(focusedInput: FocusedInputShape | null): void; /** * 生成日历头部提示信息 */ renderTopTips(): JSX.Element; /** * 判断日期是否可选 * @param day */ isOutsideRange(day: Moment): boolean; onSelect(select: SelectType): void; mathDays(end?: string | null, start?: string | null): number | null; render(): JSX.Element; } export {};