@douyinfe/semi-ui
Version:
A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.
53 lines (52 loc) • 2.71 kB
TypeScript
import React from 'react';
import PropTypes from 'prop-types';
import CalendarFoundation, { CalendarAdapter, ParsedEventsWithArray } from '@douyinfe/semi-foundation/lib/cjs/calendar/foundation';
import BaseComponent from '../_base/baseComponent';
import { Locale } from '../locale/interface';
import { DayCalendarProps } from './interface';
import '@douyinfe/semi-foundation/lib/cjs/calendar/calendar.css';
export interface DayCalendarState {
scrollHeight: number;
parsedEvents: ParsedEventsWithArray;
cachedKeys: Array<string>;
}
export default class DayCalendar extends BaseComponent<DayCalendarProps, DayCalendarState> {
static propTypes: {
displayValue: PropTypes.Requireable<Date>;
events: PropTypes.Requireable<any[]>;
header: PropTypes.Requireable<PropTypes.ReactNodeLike>;
showCurrTime: PropTypes.Requireable<boolean>;
onClick: PropTypes.Requireable<(...args: any[]) => any>;
mode: PropTypes.Requireable<string>;
renderTimeDisplay: PropTypes.Requireable<(...args: any[]) => any>;
markWeekend: PropTypes.Requireable<boolean>;
minEventHeight: PropTypes.Requireable<number>;
scrollTop: PropTypes.Requireable<number>;
width: PropTypes.Requireable<NonNullable<string | number>>;
height: PropTypes.Requireable<NonNullable<string | number>>;
style: PropTypes.Requireable<object>;
className: PropTypes.Requireable<string>;
dateGridRender: PropTypes.Requireable<(...args: any[]) => any>;
allDayEventsRender: PropTypes.Requireable<(...args: any[]) => any>;
};
static defaultProps: {
events: import("@douyinfe/semi-foundation/lib/cjs/calendar/foundation").EventObject[];
displayValue: Date;
mode: string;
};
static contextType: React.Context<Locale>;
dom: React.RefObject<HTMLDivElement>;
scrollDom: React.RefObject<HTMLDivElement>;
isWeekend: boolean;
foundation: CalendarFoundation;
constructor(props: DayCalendarProps);
get adapter(): CalendarAdapter<DayCalendarProps, DayCalendarState>;
componentDidMount(): void;
componentDidUpdate(prevProps: DayCalendarProps, prevState: DayCalendarState): void;
componentWillUnmount(): void;
checkWeekend: (val: Date) => boolean;
renderAllDayEvents: (events: ParsedEventsWithArray['allDay']) => string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.JSX.Element[];
handleClick: (e: React.MouseEvent, val: [Date, number, number, number]) => void;
renderAllDay: (events: ParsedEventsWithArray['allDay']) => React.JSX.Element;
render(): React.JSX.Element;
}