/**
* @file CalendarMobile
* @description 移动端日历组件
* @author hongyang03
*/
///
import React from 'react';
import moment from 'moment';
import { ThemeProps } from 'amis-core';
import { LocaleProps } from 'amis-core';
export interface CalendarMobileProps extends ThemeProps, LocaleProps {
className?: string;
timeFormat?: string;
inputFormat?: string;
startDate?: moment.Moment;
endDate?: moment.Moment;
minDate?: moment.Moment;
maxDate?: moment.Moment;
minDuration?: moment.Duration;
maxDuration?: moment.Duration;
dateFormat?: string;
embed?: boolean;
viewMode?: 'days' | 'months' | 'years' | 'time' | 'quarters';
close?: () => void;
confirm?: (startDate?: any, endTime?: any) => void;
onChange?: (data: any, callback?: () => void) => void;
footerExtra?: JSX.Element | null;
showViewMode?: 'years' | 'months';
isDatePicker?: boolean;
timeConstraints?: {
hours?: {
min: number;
max: number;
step: number;
};
minutes?: {
min: number;
max: number;
step: number;
};
seconds: {
min: number;
max: number;
step: number;
};
};
defaultDate?: moment.Moment;
}
export interface CalendarMobileState {
startDate?: moment.Moment;
endDate?: moment.Moment;
monthHeights?: number[];
currentDate: moment.Moment;
showToast: boolean;
isScrollToBottom: boolean;
dateTime: any;
minDate?: moment.Moment;
maxDate?: moment.Moment;
}
export declare class CalendarMobile extends React.Component {
mobileBody: any;
mobileHeader: any;
timer: any;
static defaultProps: Pick;
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;
onMobileBodyScroll(e: any): 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: any): 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;
}
declare const _default: {
new (props: Omit & {
locale?: string | undefined;
translate?: ((str: string, ...args: any[]) => string) | undefined;
} & ThemeProps, keyof ThemeProps> & import("amis-core/lib/theme").ThemeOutterProps): {
ref: any;
childRef(ref: any): void;
getWrappedInstance(): any;
render(): JSX.Element;
context: any;
setState(state: {} | ((prevState: Readonly<{}>, props: Readonly & {
locale?: string | undefined;
translate?: ((str: string, ...args: any[]) => string) | undefined;
} & ThemeProps, keyof ThemeProps> & import("amis-core/lib/theme").ThemeOutterProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly & {
locale?: string | undefined;
translate?: ((str: string, ...args: any[]) => string) | undefined;
} & ThemeProps, keyof ThemeProps> & import("amis-core/lib/theme").ThemeOutterProps> & Readonly<{
children?: import("react").ReactNode;
}>;
state: Readonly<{}>;
refs: {
[key: string]: import("react").ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly & {
locale?: string | undefined;
translate?: ((str: string, ...args: any[]) => string) | undefined;
} & ThemeProps, keyof ThemeProps> & import("amis-core/lib/theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly & {
locale?: string | undefined;
translate?: ((str: string, ...args: any[]) => string) | undefined;
} & ThemeProps, keyof ThemeProps> & import("amis-core/lib/theme").ThemeOutterProps>, prevState: Readonly<{}>): any;
componentDidUpdate?(prevProps: Readonly & {
locale?: string | undefined;
translate?: ((str: string, ...args: any[]) => string) | undefined;
} & ThemeProps, keyof ThemeProps> & import("amis-core/lib/theme").ThemeOutterProps>, prevState: Readonly<{}>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly & {
locale?: string | undefined;
translate?: ((str: string, ...args: any[]) => string) | undefined;
} & ThemeProps, keyof ThemeProps> & import("amis-core/lib/theme").ThemeOutterProps>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly & {
locale?: string | undefined;
translate?: ((str: string, ...args: any[]) => string) | undefined;
} & ThemeProps, keyof ThemeProps> & import("amis-core/lib/theme").ThemeOutterProps>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly & {
locale?: string | undefined;
translate?: ((str: string, ...args: any[]) => string) | undefined;
} & ThemeProps, keyof ThemeProps> & import("amis-core/lib/theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly & {
locale?: string | undefined;
translate?: ((str: string, ...args: any[]) => string) | undefined;
} & ThemeProps, keyof ThemeProps> & import("amis-core/lib/theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
};
displayName: string;
contextType: import("react").Context;
ComposedComponent: import("react").ComponentType & {
locale?: string | undefined;
translate?: ((str: string, ...args: any[]) => string) | undefined;
} & ThemeProps> & {
themeKey?: string | undefined;
}>;
} & import("hoist-non-react-statics").NonReactStatics & {
locale?: string | undefined;
translate?: ((str: string, ...args: any[]) => string) | undefined;
} & ThemeProps> & {
themeKey?: string | undefined;
}, {}> & {
ComposedComponent: import("react").ComponentType & {
locale?: string | undefined;
translate?: ((str: string, ...args: any[]) => string) | undefined;
} & ThemeProps> & {
themeKey?: string | undefined;
};
};
export default _default;