UNPKG

@abbl/material-calendar

Version:

Calendar component build with React and Material-UI

42 lines (41 loc) 1.54 kB
import { ComponentClass, FunctionComponent } from 'react'; import CalendarEvent from '../common/api/CalendarEvent'; import CalendarEventStorage from '../common/api/CalendarEventStorage'; import { CalendarView } from '../common/api/CalendarView'; export interface MaterialCalendarProps { /** * List of views that will be used by the calendar. * If none are provided, It will use the default ones. */ views?: CalendarView[]; /** * If set to true calendar will only request data when It's needed, * minimizing data requests and store requested data in memory. * * Otherwise calendar will load data each time the view is changed. * @default true */ lazyLoading: boolean; /** * Content of the popout displayed after event selection. * * If left undefined popout won't be displayed. */ globalEventPopoutContent?: FunctionComponent<any> | ComponentClass<any, any>; /** * Function requesting data from specific range of time, which will be displayed in calendar. * (There is no need to sort the data before passing it to the calendar.) */ onDataRequest: (from: Date, till: Date) => Promise<CalendarEvent[]>; /** * Returns instance of CalendarEventStorage * * TODO: Write explanation why this useful. * * NOT IMPLEMENTED YET */ getCalendarEventStorage?: (calendarEventStorage: CalendarEventStorage) => void; } /** */ export default function MaterialCalendar(props: MaterialCalendarProps): JSX.Element;