devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
49 lines (48 loc) • 1.6 kB
JavaScript
/**
* DevExtreme (cjs/renovation/ui/scheduler/appointment/utils.js)
* Version: 21.2.4
* Build date: Mon Dec 06 2021
*
* Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
;
exports.getAppointmentStyles = exports.getAppointmentKey = void 0;
var _utils = require("../workspaces/utils");
var getAppointmentStyles = function(item) {
var _item$geometry = item.geometry,
height = _item$geometry.height,
left = _item$geometry.left,
top = _item$geometry.top,
width = _item$geometry.width,
resourceColor = item.info.resourceColor;
var result = (0, _utils.addToStyles)([{
attr: "height",
value: "".concat(height || 50, "px")
}, {
attr: "width",
value: "".concat(width || 50, "px")
}, {
attr: "top",
value: "".concat(top, "px")
}, {
attr: "left",
value: "".concat(left, "px")
}]);
if (resourceColor) {
result = (0, _utils.addToStyles)([{
attr: "backgroundColor",
value: resourceColor
}], result)
}
return result
};
exports.getAppointmentStyles = getAppointmentStyles;
var getAppointmentKey = function(geometry) {
var height = geometry.height,
left = geometry.left,
top = geometry.top,
width = geometry.width;
return "".concat(left, "-").concat(top, "-").concat(width, "-").concat(height)
};
exports.getAppointmentKey = getAppointmentKey;