UNPKG

vxe-gantt

Version:
50 lines (49 loc) • 1.41 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getCalcHeight = getCalcHeight; exports.getCellRestHeight = getCellRestHeight; exports.getRefElem = getRefElem; exports.getTaskBarLeft = getTaskBarLeft; exports.getTaskBarWidth = getTaskBarWidth; exports.getTaskType = getTaskType; exports.hasMilestoneTask = hasMilestoneTask; exports.hasSubviewTask = hasSubviewTask; function getRefElem(refEl) { if (refEl) { const rest = refEl.value; if (rest) { return rest.$el || rest; } } return null; } function getCalcHeight(height) { if (height === 'unset') { return 0; } return height || 0; } function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) { return rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight; } function getTaskBarLeft(chartRest, viewCellWidth) { return chartRest ? viewCellWidth * chartRest.oLeftSize : 0; } function getTaskBarWidth(chartRest, viewCellWidth) { return chartRest && chartRest.oWidthSize ? Math.max(1, chartRest ? Math.floor(viewCellWidth * chartRest.oWidthSize) - 1 : 0) : 0; } const taskTypeMaps = { milestone: true, subview: true }; function hasMilestoneTask(type) { return type === 'milestone'; } function hasSubviewTask(type) { return type === 'subview'; } function getTaskType(type) { return taskTypeMaps[type] ? type : 'default'; }