UNPKG

vxe-gantt

Version:
38 lines (37 loc) • 1.12 kB
export function getRefElem(refEl) { if (refEl) { const rest = refEl.value; if (rest) { return (rest.$el || rest); } } return null; } export function getCalcHeight(height) { if (height === 'unset') { return 0; } return height || 0; } export function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) { return rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight; } export function getTaskBarLeft(chartRest, viewCellWidth) { return chartRest ? viewCellWidth * chartRest.oLeftSize : 0; } export 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 }; export function hasMilestoneTask(type) { return type === 'milestone'; } export function hasSubviewTask(type) { return type === 'subview'; } export function getTaskType(type) { return taskTypeMaps[type] ? type : 'default'; }