/**
 * DevExtreme (esm/__internal/scheduler/r1/components/base/date_header_cell.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 {
    createVNode,
    createFragment,
    createComponentVNode
} from "inferno";
import {
    BaseInfernoComponent
} from "@devextreme/runtime/inferno";
import {
    getTemplate
} from "../../../../core/r1/utils/index";
import {
    renderUtils
} from "../../utils/index";
import {
    CellBaseDefaultProps
} from "./cell";
import {
    DateHeaderText
} from "./date_header_text";
export var DateHeaderCellDefaultProps = _extends(_extends({}, CellBaseDefaultProps), {
    today: false,
    colSpan: 1,
    isWeekDayCell: false,
    splitText: false,
    isTimeCellTemplate: false
});
export class DateHeaderCell extends BaseInfernoComponent {
    render() {
        var {
            colSpan: colSpan,
            dateCellTemplate: dateCellTemplate,
            groupIndex: groupIndex,
            groups: groups,
            index: index,
            isTimeCellTemplate: isTimeCellTemplate,
            splitText: splitText,
            startDate: startDate,
            text: text,
            timeCellTemplate: timeCellTemplate,
            className: className,
            isFirstGroupCell: isFirstGroupCell,
            isLastGroupCell: isLastGroupCell,
            isWeekDayCell: isWeekDayCell,
            today: today
        } = this.props;
        var cellClasses = renderUtils.combineClasses({
            "dx-scheduler-header-panel-cell": true,
            "dx-scheduler-cell-sizes-horizontal": true,
            "dx-scheduler-header-panel-current-time-cell": today,
            "dx-scheduler-header-panel-week-cell": isWeekDayCell,
            [null !== className && void 0 !== className ? className : ""]: !!className
        });
        var classes = renderUtils.getGroupCellClasses(isFirstGroupCell, isLastGroupCell, cellClasses);
        var useTemplate = !isTimeCellTemplate && !!dateCellTemplate || isTimeCellTemplate && !!timeCellTemplate;
        var TimeCellTemplateComponent = getTemplate(timeCellTemplate);
        var DateCellTemplateComponent = getTemplate(dateCellTemplate);
        var children = useTemplate ? createFragment([isTimeCellTemplate && TimeCellTemplateComponent && TimeCellTemplateComponent({
            data: {
                date: startDate,
                text: text,
                groups: groups,
                groupIndex: groupIndex
            },
            index: index
        }), !isTimeCellTemplate && DateCellTemplateComponent && DateCellTemplateComponent({
            data: {
                date: startDate,
                text: text,
                groups: groups,
                groupIndex: groupIndex
            },
            index: index
        })], 0) : createComponentVNode(2, DateHeaderText, {
            splitText: splitText,
            text: text
        });
        return createVNode(1, "th", classes, children, 0, {
            colSpan: colSpan,
            title: text
        })
    }
}
DateHeaderCell.defaultProps = DateHeaderCellDefaultProps;
