jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
67 lines (66 loc) • 2.58 kB
TypeScript
import type { ReactNode } from 'react';
import type { CalendarProps, PickerOption } from '../../types';
import type { CalendarPartBaseProps, DateBoundary, DateType, TimeConstraints } from './Calendar.types';
export * from './Calendar.types';
export * from './DatePicker.types';
export * from './DateRangePicker.types';
export * from './CalendarMobile.types';
export interface CustomDaysViewProps extends CalendarPartBaseProps {
prevIcon?: string;
nextIcon?: string;
embed?: boolean;
timeFormat: string;
requiredConfirm?: boolean;
isEndDate?: boolean;
renderDay?: Function;
schedules?: Array<{
startTime: Date;
endTime: Date;
content: any;
className?: string;
}>;
largeMode?: boolean;
todayActiveStyle?: React.CSSProperties;
timeConstraints?: TimeConstraints;
disableMonthSwitch?: boolean;
renderYearSwitch: () => ReactNode;
renderMonthSwitch: () => ReactNode;
showTime?: () => void;
setTime?: (type: string, amount: number) => void;
scrollToTop?: (type: string, amount: number, i: number, lable?: string) => void;
handleClickOutside?: () => void;
onScheduleClick?: (scheduleData: any) => void;
getColumns: (types: DateType[], dateBoundary: DateBoundary) => {
options: PickerOption[];
}[];
getDateBoundary: (currentDate: moment.Moment) => any;
}
export interface CustomMonthsViewProps extends CalendarPartBaseProps {
renderYearSwitch: () => ReactNode;
onClick?: () => void;
updateSelectedMonth?: () => void;
renderMonth?: (props: any, month: number, year: number, date: any) => any;
getColumns: (types: DateType[], dateBoundary: DateBoundary) => {
options: PickerOption[];
}[];
timeCell: (value: number, type: DateType) => string;
getDateBoundary: (currentDate: moment.Moment) => DateBoundary;
}
export interface QuarterViewProps extends CalendarPartBaseProps {
renderQuarter?: CalendarProps['renderQuarter'];
renderYearSwitch: () => ReactNode;
}
export interface CustomYearsViewProps extends CalendarPartBaseProps {
renderYear?: (props: any, year: number) => JSX.Element;
}
export interface CustomTimeViewProps extends CalendarPartBaseProps {
dateFormat: boolean | string;
timeFormat: string;
requiredConfirm?: boolean;
isEndDate?: boolean;
showToolbar?: boolean;
timeRangeHeader?: string;
timeConstraints?: TimeConstraints;
setTime: (type: string, amount: number) => void;
scrollToTop: (type: string, amount: number, i: number, lable?: string) => void;
}