devextreme
Version:
JavaScript/TypeScript Component Suite for Responsive Web Development
49 lines (48 loc) • 1.74 kB
JavaScript
/**
* DevExtreme (esm/__internal/scheduler/appointments_new/__mock__/base_appointment_view.js)
* Version: 26.1.4
* Build date: Fri Jul 24 2026
*
* Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import $ from "../../../../core/renderer";
import {
EmptyTemplate
} from "../../../core/templates/m_empty_template";
import {
mockAppointmentDataAccessor
} from "../../../scheduler/__mock__/appointment_data_accessor.mock";
import {
BaseAppointmentView
} from "../appointment/base_appointment";
export const getBaseAppointmentViewProperties = (appointmentData, targetedAppointmentData) => {
const normalizedTargetedAppointmentData = targetedAppointmentData ?? Object.assign({}, appointmentData, {
displayStartDate: appointmentData.startDate,
displayEndDate: appointmentData.endDate
});
const config = {
index: 0,
tabIndex: 0,
sortedIndex: 0,
appointmentData: appointmentData,
targetedAppointmentData: normalizedTargetedAppointmentData,
appointmentTemplate: new EmptyTemplate,
onRendered: () => {},
onFocusIn: () => {},
onFocusOut: () => {},
onClick: () => {},
onDblClick: () => {},
onContextMenu: () => {},
onKeyDown: () => {},
getDataAccessor: () => mockAppointmentDataAccessor,
getResourceColor: () => Promise.resolve(void 0)
};
return config
};
export const createBaseAppointment = async properties => {
const $element = $(".root");
const instance = new BaseAppointmentView($element, properties);
await new Promise(process.nextTick);
return instance
};