UNPKG

devextreme

Version:

JavaScript/TypeScript Component Suite for Responsive Web Development

68 lines (66 loc) 2.64 kB
/** * DevExtreme (cjs/__internal/scheduler/appointments_new/appointment/grid_appointment.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/ */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GridAppointmentView = void 0; var _renderer = _interopRequireDefault(require("../../../../core/renderer")); var _const = require("../const"); var _base_appointment = require("./base_appointment"); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e } } class GridAppointmentView extends _base_appointment.BaseAppointmentView { _initMarkup() { super._initMarkup(); void this.applyElementColor() } resize(geometry) { const newGeometry = geometry ?? this.option().geometry; const { top: top, left: left, width: width, height: height } = newGeometry; this.$element().css({ height: height, width: width, top: top, left: left }) } applyElementClasses() { super.applyElementClasses(); this.$element().toggleClass(_const.APPOINTMENT_TYPE_CLASSES.EMPTY, this.option().modifiers.empty) } defaultAppointmentContent($container) { (0, _renderer.default)("<div>").text(this.getTitleText()).addClass(_const.APPOINTMENT_CLASSES.TITLE).appendTo($container); if (this.isRecurring()) { (0, _renderer.default)("<span>").addClass(`${_const.APPOINTMENT_CLASSES.RECURRENCE_ICON} dx-icon-repeat`).attr("aria-label", _const.RECURRING_LABEL).attr("role", "img").appendTo($container) } const $contentDetails = (0, _renderer.default)("<div>").addClass(_const.APPOINTMENT_CLASSES.DETAILS).appendTo($container); (0, _renderer.default)("<div>").addClass(_const.APPOINTMENT_CLASSES.DATE).text(this.getDateText()).appendTo($contentDetails); if (this.isAllDay()) { (0, _renderer.default)("<div>").text(_const.ALL_DAY_TEXT).addClass(_const.APPOINTMENT_CLASSES.ALL_DAY_TEXT).prependTo($contentDetails) } return $container } async applyElementColor() { const color = await this.option().getResourceColor(); if (color) { this.$element().addClass(_const.APPOINTMENT_TYPE_CLASSES.HAS_RESOURCE); this.$element().css("backgroundColor", color) } } } exports.GridAppointmentView = GridAppointmentView;