UNPKG

@orca-fe/antd-plus

Version:
44 lines (43 loc) 1.66 kB
import type { Moment } from 'moment'; import moment from 'moment'; import React from 'react'; import type { WeeklyCalendarDataType } from './def'; export interface WeeklyCalendarProps<T extends WeeklyCalendarDataType = WeeklyCalendarDataType> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'placeholder'> { /** 需要显示的日期 */ current?: moment.Moment; /** 日程数据 */ data?: T[]; /** 时间精度(分钟) */ precision?: number; /** 选中的数据下标 */ checked?: number; /** 展示模式:周视图/日视图 */ mode?: 'week' | 'day'; /** 是否展示当前时间 */ showNow?: boolean | moment.Moment; /** 当前时间的颜色 */ showNowColor?: string; /** 占位日程 */ placeholder?: WeeklyCalendarDataType; /** 渲染占位日程 */ renderPlaceholder?: (item: { start: moment.Moment; end: moment.Moment; }) => React.ReactNode; /** 渲染任务数据 */ children?: (item: T & { start: moment.Moment; end: moment.Moment; }, index: number) => React.ReactNode; /** 任务数据点击事件 */ onDataClick?: (item: T, index: number) => void; /** 空白区域点击事件 */ onEmptyClick?: (time: moment.Moment) => void; /** 左上角时间段的文本 */ timelineHeader?: string; renderHeader?: (element: React.ReactElement, date: Moment, options: { isToday: boolean; }) => React.ReactNode; } declare const WeeklyCalendar: <T extends WeeklyCalendarDataType>(props: WeeklyCalendarProps<T>) => import("react/jsx-runtime").JSX.Element; export default WeeklyCalendar;