devextreme
Version:
JavaScript/TypeScript Component Suite for Responsive Web Development
125 lines (123 loc) • 4.33 kB
JavaScript
/**
* DevExtreme (cjs/__internal/scheduler/workspaces/work_space_month.js)
* Version: 26.1.3
* Build date: Wed Jun 10 2026
*
* Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _component_registrator = _interopRequireDefault(require("../../../core/component_registrator"));
var _common = require("../../../core/utils/common");
var _date = _interopRequireDefault(require("../../../core/utils/date"));
var _position = require("../../../core/utils/position");
var _window = require("../../../core/utils/window");
var _index = require("../../scheduler/r1/components/index");
var _index2 = require("../../scheduler/r1/utils/index");
var _m_utils = require("../m_utils");
var _constants_view = require("../utils/options/constants_view");
var _work_space_indicator = _interopRequireDefault(require("./work_space_indicator"));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const MONTH_CLASS = "dx-scheduler-work-space-month";
const toMs = _date.default.dateToMilliseconds;
class SchedulerWorkSpaceMonth extends _work_space_indicator.default {
get type() {
return _constants_view.VIEWS.MONTH
}
getElementClass() {
return MONTH_CLASS
}
getFormat() {
return _index2.formatWeekday
}
getIntervalBetween(currentDate) {
const firstViewDate = this.getStartViewDate();
const timeZoneOffset = _date.default.getTimezonesDifference(firstViewDate, currentDate);
const startDayHour = this.option("startDayHour");
return currentDate.getTime() - (firstViewDate.getTime() - 36e5 * startDayHour) - timeZoneOffset
}
getDateGenerationOptions() {
return Object.assign({}, super.getDateGenerationOptions(), {
cellCountInDay: 1
})
}
getCellWidth() {
const cellWidth = this.cache.memo("cellWidth", () => {
let averageWidth = 0;
const cells = this.getCells().slice(0, 7);
cells.each((index, element) => {
averageWidth += (0, _window.hasWindow)() ? (0, _position.getBoundingRect)(element).width : 0
});
return 0 === cells.length ? void 0 : averageWidth / 7
});
return cellWidth
}
insertAllDayRowsIntoDateTable() {
return false
}
getCellCoordinatesByIndex(index) {
const rowIndex = Math.floor(index / this.getCellCount());
const columnIndex = index - this.getCellCount() * rowIndex;
return {
rowIndex: rowIndex,
columnIndex: columnIndex
}
}
needCreateCrossScrolling() {
return this.option("crossScrollingEnabled") || this.isVerticalGroupedWorkSpace()
}
getViewStartByOptions() {
return _index2.monthUtils.getViewStartByOptions(this.option("startDate"), this.option("currentDate"), this.option("intervalCount"), _date.default.getFirstMonthDate(this.option("startDate")))
}
updateIndex(index) {
return index
}
isIndicationAvailable() {
return false
}
getIntervalDuration() {
return toMs("day")
}
getTimePanelWidth() {
return 0
}
supportAllDayRow() {
return false
}
keepOriginalHours() {
return true
}
getWorkSpaceLeftOffset() {
return 0
}
needApplyCollectorOffset() {
return true
}
getHeaderDate() {
return this.getViewStartByOptions()
}
renderRAllDayPanel() {}
renderRTimeTable() {}
renderRDateTable() {
_m_utils.utils.renovation.renderComponent(this, this.$dateTable, _index.DateTableMonthComponent, "renovatedDateTable", this.getRDateTableProps())
}
createWorkSpaceElements() {
if (this.isVerticalGroupedWorkSpace()) {
this.createWorkSpaceScrollableElements()
} else {
super.createWorkSpaceElements()
}
}
updateAllDayVisibility() {
return (0, _common.noop)()
}
}(0, _component_registrator.default)("dxSchedulerWorkSpaceMonth", SchedulerWorkSpaceMonth);
var _default = exports.default = SchedulerWorkSpaceMonth;