devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
54 lines (53 loc) • 1.39 kB
JavaScript
/**
* DevExtreme (esm/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/
*/
import {
addToStyles
} from "../workspaces/utils";
export var getAppointmentStyles = item => {
var {
geometry: {
height: height,
left: left,
top: top,
width: width
},
info: {
resourceColor: resourceColor
}
} = item;
var result = 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 = addToStyles([{
attr: "backgroundColor",
value: resourceColor
}], result)
}
return result
};
export var getAppointmentKey = geometry => {
var {
height: height,
left: left,
top: top,
width: width
} = geometry;
return "".concat(left, "-").concat(top, "-").concat(width, "-").concat(height)
};