jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
55 lines (54 loc) • 2.14 kB
TypeScript
/**
* 移动端日历组件
*/
import React from 'react';
import moment from 'moment';
import type { CalendarMobileProps } from './types';
interface CalendarMobileState {
startDate?: moment.Moment;
endDate?: moment.Moment;
monthHeights?: number[];
currentDate: moment.Moment;
showToast: boolean;
isScrollToBottom: boolean;
minDate: moment.Moment;
maxDate: moment.Moment;
timeMode: 'start' | 'end';
}
export declare class CalendarMobile extends React.Component<CalendarMobileProps, CalendarMobileState> {
mobileBody: React.RefObject<HTMLDivElement>;
mobileHeader: React.RefObject<HTMLDivElement>;
timer: any;
static defaultProps: Partial<CalendarMobileProps>;
constructor(props: CalendarMobileProps);
getDateRange: (minDate?: moment.Moment, maxDate?: moment.Moment, defaultDate?: moment.Moment) => {
currentDate: moment.Moment;
minDate: moment.Moment;
maxDate: moment.Moment;
};
componentDidMount(): void;
componentDidUpdate(prevProps: CalendarMobileProps): void;
componentWillUnmount(): void;
initMonths: () => void;
scollToDate(date: moment.Moment): void;
handleScrollBody: import("lodash").DebouncedFunc<(e: React.UIEvent<HTMLElement>) => void>;
scrollPreYear: () => void;
scrollAfterYear: () => void;
getDaysOfWeek(): string[];
handleCalendarClick(isDisabled: boolean): void;
getRenderProps(props: any, currentDate: moment.Moment): {
props: any;
footerText: string;
rdtDisabled: boolean;
};
handleTimeChange: (newTime: [number, number, number?]) => void;
checkIsValidDate(currentDate: moment.Moment): boolean;
renderMobileDay: (props: any, currentDate: moment.Moment) => JSX.Element;
renderMonth: (props: any, month: number, year: number) => JSX.Element;
renderQuarter: (props: any, quarter: number, year: number) => JSX.Element;
handleMobileChange: (newValue: moment.Moment) => void;
renderMobileCalendarBody: () => JSX.Element | undefined;
renderMobileTimePicker: () => JSX.Element;
render(): JSX.Element;
}
export default CalendarMobile;