import React from 'react';
import { Grid } from '@bryntum/calendar';
import { createWidget, shouldComponentUpdate, processWidgetContent } from './WrapperHelper.js';
export class BryntumGrid extends React.Component {
    constructor() {
        super(...arguments);
        this.processWidgetContent = processWidgetContent;
        this.portalContainerClass = 'b-react-portal-container';
        this.state = {
            portals: new Map(),
            generation: 0
        };
        this.projectStores = false;
        this.dataStores = {
            'originalStore': 'originals',
            'store': 'data'
        };
    }
    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-grid-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' } })));
    }
}
BryntumGrid.instanceClass = Grid;
BryntumGrid.instanceName = 'Grid';
BryntumGrid.isView = true;
BryntumGrid.featureNames = [
    'aiFilterFeature',
    'cellCopyPasteFeature',
    'cellEditFeature',
    'cellMenuFeature',
    'cellTooltipFeature',
    'chartsFeature',
    'columnAutoWidthFeature',
    'columnDragToolbarFeature',
    'columnPickerFeature',
    'columnRenameFeature',
    'columnReorderFeature',
    'columnResizeFeature',
    'excelExporterFeature',
    'fileDropFeature',
    'fillHandleFeature',
    'filterFeature',
    'filterBarFeature',
    'groupFeature',
    'groupSummaryFeature',
    'headerMenuFeature',
    'lockRowsFeature',
    'mergeCellsFeature',
    'pdfExportFeature',
    'pinColumnsFeature',
    'printFeature',
    'quickFindFeature',
    'regionResizeFeature',
    'rowCopyPasteFeature',
    'rowEditFeature',
    'rowExpanderFeature',
    'rowReorderFeature',
    'rowResizeFeature',
    'searchFeature',
    'sortFeature',
    'splitFeature',
    'stickyCellsFeature',
    'stripeFeature',
    'summaryFeature',
    'treeFeature',
    'treeGroupFeature'
];
BryntumGrid.configNames = [
    'adopt',
    'animateFilterRemovals',
    'animateRemovingRows',
    'ariaDescription',
    'ariaLabel',
    'autoHeight',
    'bbar',
    'bodyCls',
    'bubbleEvents',
    'collapsible',
    'color',
    'config',
    'contentElementCls',
    'contextMenuTriggerEvent',
    'dataField',
    'defaultRegion',
    'destroyStore',
    'detectCSSCompatibilityIssues',
    'disableGridColumnIdWarning',
    'disableGridRowModelWarning',
    'dock',
    'drawer',
    'elementAttributes',
    'enableSticky',
    'enableTextSelection',
    'fillLastColumn',
    'fixedRowHeight',
    'footer',
    'formulaProviders',
    'fullRowRefresh',
    'getRowHeight',
    'header',
    'hideHorizontalScrollbar',
    'hoverCls',
    'icon',
    'ignoreParentReadOnly',
    'listeners',
    'loadMask',
    'loadMaskDefaults',
    'loadMaskError',
    'localizable',
    'maskDefaults',
    'masked',
    'monitorResize',
    'owner',
    'plugins',
    'preserveFocusOnDatasetChange',
    'preserveScrollOnDatasetChange',
    'preventTooltipOnTouch',
    'relayStoreEvents',
    'resizable',
    'resizeToFitIncludesHeader',
    'responsiveLevels',
    'ripple',
    'rootElement',
    'scrollerClass',
    'scrollManager',
    'showDirty',
    'stateful',
    'statefulEvents',
    'stateId',
    'stateProvider',
    'strips',
    'subGridConfigs',
    'syncMask',
    'tab',
    'tabBarItems',
    'tbar',
    'type',
    'ui',
    'weight'
];
BryntumGrid.propertyConfigNames = [
    'alignSelf',
    'animateTreeNodeToggle',
    'appendTo',
    'callOnFunctions',
    'catchEventHandlerExceptions',
    'cellEllipsis',
    'cls',
    'collapsed',
    'column',
    'columnLines',
    'columns',
    'data',
    'dataset',
    'disabled',
    'emptyText',
    'enableUndoRedoKeys',
    'extraData',
    'flex',
    'height',
    'hidden',
    'hideFooters',
    'hideHeaders',
    'id',
    'inputFieldAlign',
    'insertBefore',
    'insertFirst',
    'keyMap',
    'labelPosition',
    'longPressTime',
    'margin',
    'maxHeight',
    'maxWidth',
    'minHeight',
    'minWidth',
    'onBeforeCancelCellEdit',
    'onBeforeCancelRowEdit',
    'onBeforeCellEditStart',
    'onBeforeCellRangeDelete',
    'onBeforeCellRangeEdit',
    'onBeforeColumnDragStart',
    'onBeforeColumnDropFinalize',
    'onBeforeColumnResize',
    'onBeforeCopy',
    'onBeforeCSVExport',
    'onBeforeDestroy',
    'onBeforeExcelExport',
    'onBeforeFillHandleDragStart',
    'onBeforeFinishCellEdit',
    'onBeforeFinishRowEdit',
    'onBeforeHide',
    'onBeforePaste',
    'onBeforePdfExport',
    'onBeforeRenderRow',
    'onBeforeRenderRows',
    'onBeforeRowCollapse',
    'onBeforeRowExpand',
    'onBeforeSelectionChange',
    'onBeforeSetRecord',
    'onBeforeShow',
    'onBeforeStartRowEdit',
    'onBeforeStateApply',
    'onBeforeStateSave',
    'onBeforeToggleGroup',
    'onBeforeToggleNode',
    'onCancelCellEdit',
    'onCatchAll',
    'onCellClick',
    'onCellContextMenu',
    'onCellDblClick',
    'onCellMenuBeforeShow',
    'onCellMenuItem',
    'onCellMenuShow',
    'onCellMenuToggleItem',
    'onCellMouseEnter',
    'onCellMouseLeave',
    'onCellMouseOut',
    'onCellMouseOver',
    'onCollapse',
    'onCollapseNode',
    'onColumnDrag',
    'onColumnDragStart',
    'onColumnDrop',
    'onColumnResize',
    'onColumnResizeStart',
    'onContextMenuItem',
    'onContextMenuToggleItem',
    'onCopy',
    'onDataChange',
    'onDestroy',
    'onDirtyStateChange',
    'onDragSelecting',
    'onElementCreated',
    'onExpand',
    'onExpandNode',
    'onFileDrop',
    'onFillHandleBeforeDragFinalize',
    'onFillHandleDrag',
    'onFillHandleDragAbort',
    'onFillHandleDragEnd',
    'onFillHandleDragStart',
    'onFinishCellEdit',
    'onFinishRowEdit',
    'onFocusIn',
    'onFocusOut',
    'onGridRowBeforeDragStart',
    'onGridRowBeforeDropFinalize',
    'onGridRowDrag',
    'onGridRowDragAbort',
    'onGridRowDragStart',
    'onGridRowDrop',
    'onHeaderClick',
    'onHeaderMenuBeforeShow',
    'onHeaderMenuItem',
    'onHeaderMenuShow',
    'onHeaderMenuToggleItem',
    'onHide',
    'onLockRows',
    'onMouseOut',
    'onMouseOver',
    'onPaint',
    'onPaste',
    'onPdfExport',
    'onReadOnly',
    'onRecompose',
    'onRenderRow',
    'onRenderRows',
    'onResize',
    'onResponsive',
    'onRowCollapse',
    'onRowExpand',
    'onRowMouseEnter',
    'onRowMouseLeave',
    'onScroll',
    'onSelectionChange',
    'onSelectionModeChange',
    'onShow',
    'onSplit',
    'onSplitterCollapseClick',
    'onSplitterDragEnd',
    'onSplitterDragStart',
    'onSplitterExpandClick',
    'onStartCellEdit',
    'onStartRowEdit',
    'onSubGridCollapse',
    'onSubGridExpand',
    'onToggleGroup',
    'onToggleNode',
    'onToolClick',
    'onUnlockRows',
    'onUnsplit',
    'preserveScroll',
    'readOnly',
    'rendition',
    'rowHeight',
    'rowLines',
    'rtl',
    'scrollable',
    'selectionMode',
    'span',
    'stateSettings',
    'store',
    'title',
    'tools',
    'transition',
    'transitionDuration',
    'width'
];
BryntumGrid.propertyNames = [
    'focusVisible',
    'hasChanges',
    'originalStore',
    'parent',
    'selectedCell',
    'selectedCells',
    'selectedRecord',
    'selectedRecords',
    'selectedRows',
    'state',
    'tooltip'
];
//# sourceMappingURL=BryntumGrid.js.map