devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
48 lines (47 loc) • 2.03 kB
JavaScript
/**
* DevExtreme (cjs/__internal/scheduler/__tests__/__mock__/model/scheduler.js)
* Version: 25.1.5
* Build date: Wed Sep 03 2025
*
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createSchedulerModel = void 0;
const getAppointmentColor = container => {
const appointment = container.querySelector(".dx-scheduler-appointment");
return appointment.style.backgroundColor
};
const getAgendaAppointmentColor = container => {
const appointment = container.querySelector(".dx-scheduler-agenda-appointment-marker");
return appointment.style.backgroundColor
};
const getTexts = cells => Array.from(cells).map((cell => {
var _cell$textContent;
return (null === (_cell$textContent = cell.textContent) || void 0 === _cell$textContent ? void 0 : _cell$textContent.trim()) ?? ""
}));
const createSchedulerModel = container => ({
getAppointment: () => container.querySelector(".dx-scheduler-appointment"),
getAppointments: () => container.querySelectorAll(".dx-scheduler-appointment"),
getAppointmentColor: view => "agenda" === view ? getAgendaAppointmentColor(container) : getAppointmentColor(container),
getDateTableContent() {
const cells = container.querySelectorAll(".dx-scheduler-date-table-cell");
return getTexts(cells)
},
getHeaderPanelContent() {
const cells = container.querySelectorAll(".dx-scheduler-header-panel-cell");
return getTexts(cells)
},
getTimePanelContent() {
const cells = container.querySelectorAll(".dx-scheduler-time-panel-cell");
return getTexts(cells)
},
getGroupTableContent() {
const cells = container.querySelectorAll(".dx-scheduler-group-header");
return getTexts(cells)
}
});
exports.createSchedulerModel = createSchedulerModel;