UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

50 lines (49 loc) 1.72 kB
/** * DevExtreme (cjs/renovation/ui/scheduler/appointment/overflow_indicator/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/ */ "use strict"; exports.getOverflowIndicatorStyles = exports.getOverflowIndicatorColor = void 0; var _utils = require("../../workspaces/utils"); var getOverflowIndicatorStyles = function(viewModel) { var color = viewModel.color, _viewModel$geometry = viewModel.geometry, height = _viewModel$geometry.height, left = _viewModel$geometry.left, top = _viewModel$geometry.top, width = _viewModel$geometry.width; var result = (0, _utils.addToStyles)([{ attr: "left", value: "".concat(left, "px") }, { attr: "top", value: "".concat(top, "px") }, { attr: "width", value: "".concat(width, "px") }, { attr: "height", value: "".concat(height, "px") }]); if (color) { result = (0, _utils.addToStyles)([{ attr: "backgroundColor", value: color }, { attr: "boxShadow", value: "inset ".concat(width, "px 0 0 0 rgba(0, 0, 0, 0.3)") }], result) } return result }; exports.getOverflowIndicatorStyles = getOverflowIndicatorStyles; var getOverflowIndicatorColor = function(color, colors) { return !colors.length || 0 === colors.filter((function(item) { return item !== color })).length ? color : void 0 }; exports.getOverflowIndicatorColor = getOverflowIndicatorColor;