UNPKG

e-virt-table

Version:

A powerful data table based on canvas. You can use it as data grid、Microsoft Excel or Google sheets. It supports virtual scroll、cell edit etc.

42 lines 1.51 kB
export function resolveResizeColumnDividerColor(config) { return config.ENABLE_RESIZE_COLUMN ? config.RESIZE_COLUMN_DIVIDER_COLOR : undefined; } export function normalizeBorderStyle(value) { if (value === true) return 'default'; if (value === false) return 'inner'; return value; } export function shouldDrawFullCellBorder(value) { return normalizeBorderStyle(value) === 'default'; } export function shouldDrawInternalHorizontalBorder(value) { const style = normalizeBorderStyle(value); return style === 'default' || style === 'inner'; } export function getColumnDividerSide(fixed, x, width, sectionWidth, boundaries = {}) { const { fixedLeftEnd = sectionWidth, fixedRightStart = 0 } = boundaries; if (fixed === 'right') { return x > fixedRightStart + 0.01 ? 'left' : null; } if (fixed === 'left') { return x + width < fixedLeftEnd - 0.01 ? 'right' : null; } return x + width < sectionWidth - 0.01 ? 'right' : null; } export function shouldDrawOuterBorder(value) { const style = normalizeBorderStyle(value); return style === 'default' || style === 'outer'; } export function shouldDrawScrollerBorder(value) { return normalizeBorderStyle(value) === 'default'; } export function shouldDrawScrollerTrack(value, hasScrollbar) { return shouldDrawScrollerBorder(value) || hasScrollbar; } export function shouldDrawRightBoundaryBorder(value) { void value; return false; } //# sourceMappingURL=BorderStyle.js.map