UNPKG

devextreme

Version:

JavaScript/TypeScript Component Suite for Responsive Web Development

53 lines (52 loc) 1.59 kB
/** * DevExtreme (cjs/__internal/scheduler/appointments_new/resizing/get_resizable_config.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/ */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getResizableConfig = void 0; const HORIZONTAL_HANDLES = "left right"; const VERTICAL_HANDLES = "top bottom"; const getReducedHandles = (reduced, rtlEnabled) => { switch (reduced) { case "head": return rtlEnabled ? "right" : "left"; case "tail": return rtlEnabled ? "left" : "right"; case "body": return ""; default: return "left right" } }; const getHorizontalRule = options => ({ handles: getReducedHandles(options.reduced, options.rtlEnabled), minWidth: options.cellWidth, minHeight: 0, step: String(options.resizableStep), roundStepValue: false }); const getVerticalRule = options => { const height = Math.round(options.cellHeight); return { handles: "top bottom", minWidth: 0, minHeight: height, step: String(height), roundStepValue: true } }; const getResizableConfig = options => { const rule = "vertical" === options.direction ? getVerticalRule(options) : getHorizontalRule(options); if (!options.isGroupedByDate) { rule.stepPrecision = "strict" } return rule }; exports.getResizableConfig = getResizableConfig;