/**
 * DevExtreme (esm/__internal/scheduler/r1/components/base/date_table.js)
 * Version: 23.2.6 (build 24140-0112)
 * Build date: Sun May 19 2024
 *
 * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
 * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
 */
import _extends from "@babel/runtime/helpers/esm/extends";
import {
    createComponentVNode,
    normalizeProps
} from "inferno";
var __rest = this && this.__rest || function(s, e) {
    var t = {};
    for (var p in s) {
        if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) {
            t[p] = s[p]
        }
    }
    if (null != s && "function" === typeof Object.getOwnPropertySymbols) {
        var i = 0;
        for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) {
                t[p[i]] = s[p[i]]
            }
        }
    }
    return t
};
import {
    createReRenderEffect,
    InfernoWrapperComponent
} from "@devextreme/runtime/inferno";
import {
    getTemplate
} from "../../../../core/r1/utils/index";
import {
    DateTableBody,
    DateTableBodyDefaultProps
} from "./date_table_body";
import {
    DateTableCellBase
} from "./date_table_cell_base";
import {
    LayoutDefaultProps
} from "./layout_props";
import {
    Table
} from "./table";
export var DateTableDefaultProps = _extends(_extends({}, LayoutDefaultProps), {
    cellTemplate: DateTableCellBase
});
export class DateTable extends InfernoWrapperComponent {
    createEffects() {
        return [createReRenderEffect()]
    }
    render() {
        var _a, _b, _c, _d;
        var _e = this.props,
            {
                addDateTableClass: addDateTableClass,
                tableRef: tableRef,
                viewData: viewData,
                width: width,
                cellTemplate: cellTemplate,
                dataCellTemplate: dataCellTemplate,
                groupOrientation: groupOrientation,
                addVerticalSizesClassToRows: addVerticalSizesClassToRows
            } = _e,
            restProps = __rest(_e, ["addDateTableClass", "tableRef", "viewData", "width", "cellTemplate", "dataCellTemplate", "groupOrientation", "addVerticalSizesClassToRows"]);
        var classes = addDateTableClass ? "dx-scheduler-date-table" : void 0;
        var topVirtualRowHeight = null !== (_a = viewData.topVirtualRowHeight) && void 0 !== _a ? _a : 0;
        var bottomVirtualRowHeight = null !== (_b = viewData.bottomVirtualRowHeight) && void 0 !== _b ? _b : 0;
        var leftVirtualCellWidth = null !== (_c = viewData.leftVirtualCellWidth) && void 0 !== _c ? _c : 0;
        var rightVirtualCellWidth = null !== (_d = viewData.rightVirtualCellWidth) && void 0 !== _d ? _d : 0;
        var virtualCellsCount = viewData.groupedData[0].dateTable[0].cells.length;
        var CellTemplateComponent = getTemplate(cellTemplate);
        var DataCellTemplateComponent = getTemplate(dataCellTemplate);
        return normalizeProps(createComponentVNode(2, Table, _extends({}, restProps, {
            tableRef: tableRef,
            topVirtualRowHeight: topVirtualRowHeight,
            bottomVirtualRowHeight: bottomVirtualRowHeight,
            leftVirtualCellWidth: leftVirtualCellWidth,
            rightVirtualCellWidth: rightVirtualCellWidth,
            leftVirtualCellCount: viewData.leftVirtualCellCount,
            rightVirtualCellCount: viewData.rightVirtualCellCount,
            virtualCellsCount: virtualCellsCount,
            className: classes,
            width: width,
            children: createComponentVNode(2, DateTableBody, {
                cellTemplate: CellTemplateComponent,
                viewData: viewData,
                dataCellTemplate: DataCellTemplateComponent,
                leftVirtualCellWidth: leftVirtualCellWidth,
                rightVirtualCellWidth: rightVirtualCellWidth,
                groupOrientation: groupOrientation,
                addVerticalSizesClassToRows: addVerticalSizesClassToRows,
                topVirtualRowHeight: DateTableBodyDefaultProps.topVirtualRowHeight,
                bottomVirtualRowHeight: DateTableBodyDefaultProps.bottomVirtualRowHeight,
                addDateTableClass: DateTableBodyDefaultProps.addDateTableClass
            })
        })))
    }
}
DateTable.defaultProps = DateTableDefaultProps;
