devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
80 lines (79 loc) • 2.89 kB
JavaScript
/**
* DevExtreme (esm/__internal/scheduler/r1/components/base/all_day_panel_table.js)
* Version: 23.2.6
* Build date: Wed May 01 2024
*
* Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import {
createComponentVNode
} from "inferno";
import {
createReRenderEffect,
InfernoWrapperComponent
} from "@devextreme/runtime/inferno";
import {
getTemplate
} from "../../../../core/r1/utils/index";
import {
DefaultSizes
} from "../const";
import {
AllDayPanelTableBody,
AllDayPanelTableBodyDefaultProps
} from "./all_day_panel_table_body";
import {
LayoutDefaultProps
} from "./layout_props";
import {
Table
} from "./table";
export class AllDayTable extends InfernoWrapperComponent {
constructor() {
super(...arguments);
this.allDayPanelData = null
}
createEffects() {
return [createReRenderEffect()]
}
getAllDayPanelData() {
if (null !== this.allDayPanelData) {
return this.allDayPanelData
}
this.allDayPanelData = this.props.viewData.groupedData[0].allDayPanel;
return this.allDayPanelData
}
componentWillUpdate(nextProps) {
super.componentWillUpdate();
if (this.props.viewData !== nextProps.viewData) {
this.allDayPanelData = null
}
}
render() {
var _a, _b;
var {
width: width,
tableRef: tableRef,
viewData: viewData,
dataCellTemplate: dataCellTemplate
} = this.props;
var allDayPanelData = this.getAllDayPanelData();
var DataCellTemplateComponent = getTemplate(dataCellTemplate);
return createComponentVNode(2, Table, {
className: "dx-scheduler-all-day-table",
height: allDayPanelData ? void 0 : DefaultSizes.allDayPanelHeight,
width: width,
tableRef: tableRef,
children: createComponentVNode(2, AllDayPanelTableBody, {
viewData: null !== allDayPanelData && void 0 !== allDayPanelData ? allDayPanelData : AllDayPanelTableBodyDefaultProps.viewData,
leftVirtualCellWidth: null !== (_a = viewData.leftVirtualCellWidth) && void 0 !== _a ? _a : AllDayPanelTableBodyDefaultProps.leftVirtualCellWidth,
rightVirtualCellWidth: null !== (_b = viewData.rightVirtualCellWidth) && void 0 !== _b ? _b : AllDayPanelTableBodyDefaultProps.rightVirtualCellWidth,
leftVirtualCellCount: viewData.leftVirtualCellCount,
rightVirtualCellCount: viewData.rightVirtualCellCount,
dataCellTemplate: DataCellTemplateComponent
})
})
}
}
AllDayTable.defaultProps = LayoutDefaultProps;