import React from 'react';
import { Calendar } from '@bryntum/calendar';
import { createWidget, shouldComponentUpdate, processWidgetContent } from './WrapperHelper.js';
export class BryntumCalendar extends React.Component {
    constructor() {
        super(...arguments);
        this.processWidgetContent = processWidgetContent;
        this.portalContainerClass = 'b-react-portal-container';
        this.state = {
            portals: new Map(),
            generation: 0
        };
        this.projectStores = true;
        this.dataStores = {
            'assignmentStore': 'assignments',
            'dependencyStore': 'dependencies',
            'eventStore': 'events',
            'resourceStore': 'resources',
            'resourceTimeRangeStore': 'resourceTimeRanges',
            'timeRangeStore': 'timeRanges'
        };
    }
    componentDidMount() {
        this.instance = createWidget(this);
    }
    componentWillUnmount() {
        var _a, _b;
        (_b = (_a = this.instance) === null || _a === void 0 ? void 0 : _a.destroy) === null || _b === void 0 ? void 0 : _b.call(_a);
    }
    shouldComponentUpdate(nextProps, nextState) {
        return shouldComponentUpdate(this, nextProps, nextState);
    }
    render() {
        const className = `b-react-calendar-container`;
        return (React.createElement(React.Fragment, null,
            React.createElement("div", { className: className, ref: (element) => (this.element = element) }, Array.from(this.state.portals).map((item) => item[1])),
            React.createElement("div", { ref: el => (this.portalsCache = el), className: "b-react-portals-cache", style: { display: 'none' } })));
    }
}
BryntumCalendar.instanceClass = Calendar;
BryntumCalendar.instanceName = 'Calendar';
BryntumCalendar.isView = true;
BryntumCalendar.featureNames = [
    'dragFeature',
    'eventBufferFeature',
    'eventCopyPasteFeature',
    'eventEditFeature',
    'eventMenuFeature',
    'eventTooltipFeature',
    'excelExporterFeature',
    'externalEventSourceFeature',
    'loadOnDemandFeature',
    'printFeature',
    'scheduleMenuFeature',
    'scheduleTooltipFeature',
    'timeRangesFeature',
    'weekExpanderFeature'
];
BryntumCalendar.configNames = [
    'adopt',
    'align',
    'anchor',
    'ariaDescription',
    'ariaLabel',
    'assignmentStore',
    'autoCreate',
    'bbar',
    'bodyCls',
    'bubbleEvents',
    'centered',
    'collapsible',
    'color',
    'config',
    'constrainTo',
    'contentElementCls',
    'contextMenuTriggerEvent',
    'crudManagerClass',
    'dataField',
    'datePicker',
    'defaultBindProperty',
    'defaultFocus',
    'defaults',
    'deselectOnClick',
    'destroyStores',
    'detectCSSCompatibilityIssues',
    'dock',
    'draggable',
    'drawer',
    'elementAttributes',
    'enableDeleteKey',
    'enableRecurringEvents',
    'enableUndoRedoKeys',
    'eventSelectionDisabled',
    'eventStore',
    'filterEventResources',
    'floating',
    'footer',
    'header',
    'hideAnimation',
    'hideWhenEmpty',
    'highlightDate',
    'highlightPredecessors',
    'highlightSuccessors',
    'icon',
    'ignoreParentReadOnly',
    'includeWeekendsButton',
    'itemCls',
    'lazyItems',
    'listeners',
    'loadMask',
    'loadMaskDefaults',
    'loadMaskError',
    'localeClass',
    'localizable',
    'localizableProperties',
    'maintainSelectionOnDatasetChange',
    'maskDefaults',
    'masked',
    'monitorResize',
    'multiEventSelect',
    'namedItems',
    'navigatorPlacement',
    'overlaySidebar',
    'owner',
    'positioned',
    'preventTooltipOnTouch',
    'propagatedConfigs',
    'relayStoreEvents',
    'resourceImagePath',
    'resourceStore',
    'resourceTimeRangeStore',
    'responsive',
    'responsiveRoot',
    'responsiveState',
    'responsiveTarget',
    'ripple',
    'rootElement',
    'scrollAction',
    'showAnimation',
    'showRecurringUI',
    'showTooltipWhenDisabled',
    'sidebar',
    'stateful',
    'statefulEvents',
    'stateId',
    'stateProvider',
    'strips',
    'syncMask',
    'tab',
    'tabBarItems',
    'tag',
    'tbar',
    'textAlign',
    'timeRangeStore',
    'timeZone',
    'trapFocus',
    'triggerSelectionChangeOnRemove',
    'type',
    'ui',
    'viewContainer',
    'weekStartDay',
    'weight'
];
BryntumCalendar.propertyConfigNames = [
    'activeDateCls',
    'alignSelf',
    'appendTo',
    'assignments',
    'callOnFunctions',
    'catchEventHandlerExceptions',
    'cls',
    'collapsed',
    'column',
    'crudManager',
    'dataset',
    'date',
    'dateFormat',
    'defaultCalendar',
    'deselectAllOnScheduleClick',
    'disabled',
    'events',
    'extraData',
    'flex',
    'height',
    'hidden',
    'hideNonWorkingDays',
    'id',
    'inputFieldAlign',
    'insertBefore',
    'insertFirst',
    'isEventSelectable',
    'items',
    'keyMap',
    'labelPosition',
    'layout',
    'layoutStyle',
    'margin',
    'maxDate',
    'maxHeight',
    'maximizeOnMobile',
    'maxWidth',
    'minDate',
    'minHeight',
    'minWidth',
    'mode',
    'modeDefaults',
    'modes',
    'nonWorkingDays',
    'onActiveItemChange',
    'onAfterEventEdit',
    'onAfterEventSave',
    'onBeforeActiveItemChange',
    'onBeforeAssignmentDelete',
    'onBeforeAssignmentSelectionChange',
    'onBeforeAutoCreate',
    'onBeforeCopy',
    'onBeforeCreateMode',
    'onBeforeCSVExport',
    'onBeforeDestroy',
    'onBeforeDragCreate',
    'onBeforeDragCreateEnd',
    'onBeforeDragMove',
    'onBeforeDragMoveEnd',
    'onBeforeDragResize',
    'onBeforeDragResizeEnd',
    'onBeforeDropExternal',
    'onBeforeEventDelete',
    'onBeforeEventEdit',
    'onBeforeEventEditShow',
    'onBeforeEventSave',
    'onBeforeEventSelectionChange',
    'onBeforeExcelExport',
    'onBeforeHide',
    'onBeforePaste',
    'onBeforePrint',
    'onBeforeResponsiveStateChange',
    'onBeforeSetRecord',
    'onBeforeShow',
    'onBeforeStateApply',
    'onBeforeStateSave',
    'onCatchAll',
    'onCellOverflowClick',
    'onCollapse',
    'onContextMenuItem',
    'onContextMenuToggleItem',
    'onCopy',
    'onCurrentTimelineUpdate',
    'onDataChange',
    'onDateChange',
    'onDateRangeChange',
    'onDateRangeLoad',
    'onDateRangeRequested',
    'onDayCellPopulated',
    'onDayNumberClick',
    'onDestroy',
    'onDirtyStateChange',
    'onDragCreateEnd',
    'onDragMoveEnd',
    'onDragMoveExternal',
    'onDragResizeEnd',
    'onDropExternal',
    'onElementCreated',
    'onEmptyCellClick',
    'onEventAutoCreated',
    'onEventClick',
    'onEventContextMenu',
    'onEventDblClick',
    'onEventEditBeforeSetRecord',
    'onEventKeyDown',
    'onEventMenuBeforeShow',
    'onEventMenuItem',
    'onEventMenuShow',
    'onEventMouseDown',
    'onEventMouseEnter',
    'onEventMouseLeave',
    'onEventMouseOut',
    'onEventMouseOver',
    'onEventMouseUp',
    'onEventPropagate',
    'onExpand',
    'onFocusIn',
    'onFocusOut',
    'onHide',
    'onLoadOnDemandFail',
    'onMonthNameClick',
    'onNavigate',
    'onPaint',
    'onPaste',
    'onPasteNotAllowed',
    'onReadOnly',
    'onRecompose',
    'onRefresh',
    'onResize',
    'onResourceClick',
    'onResponsiveStateChange',
    'onScheduleClick',
    'onScheduleContextMenu',
    'onScheduleDblClick',
    'onScheduleMenuBeforeShow',
    'onScheduleMenuItem',
    'onScheduleMenuShow',
    'onScheduleMouseDown',
    'onScheduleMouseOut',
    'onScheduleMouseOver',
    'onScheduleMouseUp',
    'onSelectionChange',
    'onShow',
    'onSidebarCollapse',
    'onSidebarExpand',
    'onTimeAxisClick',
    'onTimeRangeHeaderClick',
    'onTimeRangeHeaderContextMenu',
    'onTimeRangeHeaderDblClick',
    'onToolClick',
    'onViewPaint',
    'onWeekNumberClick',
    'project',
    'readOnly',
    'recurrenceConfirmationPopup',
    'rendition',
    'resources',
    'resourceTimeRanges',
    'rtl',
    'scrollable',
    'selectResourceOnEventNavigate',
    'selectResourceOnScheduleClick',
    'span',
    'strictRecordMapping',
    'timeRanges',
    'title',
    'tools',
    'tooltip',
    'useContextualRecurrenceRules',
    'width',
    'x',
    'y'
];
BryntumCalendar.propertyNames = [
    'activeSubView',
    'activeView',
    'anchorSize',
    'focusVisible',
    'hasChanges',
    'isEngineReady',
    'isSettingValues',
    'isValid',
    'parent',
    'record',
    'selectedEvents',
    'state',
    'values',
    'views'
];
//# sourceMappingURL=BryntumCalendar.js.map