UNPKG

@syncfusion/ej2-react-schedule

Version:

Flexible scheduling library with more built-in features and enhanced customization options similar to outlook and google calendar, allowing the users to plan and manage their appointments with efficient data-binding support. for React

152 lines (144 loc) 5.36 kB
import { ComplexBase, applyMixins, ComponentBase } from '@syncfusion/ej2-react-base'; export { Inject } from '@syncfusion/ej2-react-base'; import { createElement, Component } from 'react'; import { Schedule, RecurrenceEditor } from '@syncfusion/ej2-schedule'; export * from '@syncfusion/ej2-schedule'; /** * `ViewsDirective` represent a view of the react Schedule. * It must be contained in a Schedule component(`SchduleComponent`). * ```tsx * <ScheduleComponent> * <ViewsDirective> * <ViewDirective option='day' dateFormat='dd MMM'></ViewDirective> * <ViewDirective option='week'></ViewDirective> * <ViewsDirective> * </ScheduleComponent> * ``` */ class ViewDirective extends ComplexBase { } ViewDirective.moduleName = 'view'; ViewDirective.complexTemplate = { 'timeScale.minorSlotTemplate': 'timeScale.minorSlotTemplate', 'timeScale.majorSlotTemplate': 'timeScale.majorSlotTemplate', 'group.headerTooltipTemplate': 'group.headerTooltipTemplate' }; class ViewsDirective extends ComplexBase { } ViewsDirective.propertyName = 'views'; ViewsDirective.moduleName = 'views'; /** * `ResourcesDirective` represent a resource of the react Schedule. * It must be contained in a Schedule component(`SchduleComponent`). * ```tsx * <ScheduleComponent> * <ResourcesDirective> * <ResourceDirective field='RoomId' name='Rooms'></ResourceDirective> * <ResourceDirective field='OwnerId' name='Owners'></ResourceDirective> * <ResourcesDirective> * </ScheduleComponent> * ``` */ class ResourceDirective extends ComplexBase { } ResourceDirective.moduleName = 'resource'; class ResourcesDirective extends ComplexBase { } ResourcesDirective.propertyName = 'resources'; ResourcesDirective.moduleName = 'resources'; /** * `HeaderRowsDirective` represent a header rows of the react Schedule. * It must be contained in a Schedule component(`SchduleComponent`). * ```tsx * <ScheduleComponent> * <HeaderRowsDirective> * <HeaderRowDirective option='Week'></HeaderRowDirective> * <HeaderRowDirective option='Date'></HeaderRowDirective> * <HeaderRowsDirective> * </ScheduleComponent> * ``` */ class HeaderRowDirective extends ComplexBase { } HeaderRowDirective.moduleName = 'headerRow'; class HeaderRowsDirective extends ComplexBase { } HeaderRowsDirective.propertyName = 'headerRows'; HeaderRowsDirective.moduleName = 'headerRows'; /** * `ToolbarItemsDirective` represent a custom toolbar items of the react Schedule. * It must be contained in a Schedule component(`SchduleComponent`). * ```tsx * <ScheduleComponent> * <ToolbarItemsDirective> * <ToolbarItemDirective name= 'Today'></ToolbarItemDirective> * <ToolbarItemDirective name= 'DateRangeText'></ToolbarItemDirective> * <ToolbarItemDirective prefixIcon='e-icons e-cut' text='Cut'></ToolbarItemDirective> * <ToolbarItemsDirective> * </ScheduleComponent> * ``` */ class ToolbarItemDirective extends ComplexBase { } ToolbarItemDirective.moduleName = 'toolbarItem'; class ToolbarItemsDirective extends ComplexBase { } ToolbarItemsDirective.propertyName = 'toolbarItems'; ToolbarItemsDirective.moduleName = 'toolbarItems'; /** * `ScheduleComponent` represents the react Schedule. * ```tsx * <ScheduleComponent/> * ``` */ class ScheduleComponent extends Schedule { constructor(props) { super(props); this.initRenderCalled = false; this.checkInjectedModules = true; this.directivekeys = { 'views': 'view', 'resources': 'resource', 'headerRows': 'headerRow', 'toolbarItems': 'toolbarItem' }; this.statelessTemplateProps = null; this.templateProps = null; this.immediateRender = false; this.isReactMock = true; this.portals = []; } render() { this.isReactMock = false; if (((this.element && !this.initRenderCalled) || this.refreshing) && !this.isReactForeceUpdate) { super.render(); this.initRenderCalled = true; } else { return createElement('div', this.getDefaultAttributes(), [].concat(this.props.children, this.portals)); } } } applyMixins(ScheduleComponent, [ComponentBase, Component]); /** * `RecurrenceEditorComponent` represents the react RecurrenceEditor. * ```tsx * <RecurrenceEditorComponent/> * ``` */ class RecurrenceEditorComponent extends RecurrenceEditor { constructor(props) { super(props); this.initRenderCalled = false; this.checkInjectedModules = false; this.statelessTemplateProps = null; this.templateProps = null; this.immediateRender = true; this.isReactMock = true; this.portals = []; } render() { this.isReactMock = false; if (((this.element && !this.initRenderCalled) || this.refreshing) && !this.isReactForeceUpdate) { super.render(); this.initRenderCalled = true; } else { return createElement('div', this.getDefaultAttributes(), [].concat(this.props.children, this.portals)); } } } applyMixins(RecurrenceEditorComponent, [ComponentBase, Component]); export { HeaderRowDirective, HeaderRowsDirective, RecurrenceEditorComponent, ResourceDirective, ResourcesDirective, ScheduleComponent, ToolbarItemDirective, ToolbarItemsDirective, ViewDirective, ViewsDirective }; //# sourceMappingURL=ej2-react-schedule.es2015.js.map