@1771technologies/lytenyte-pro
Version:
Blazingly fast headless React data grid with 100s of features.
18 lines (17 loc) • 487 B
JavaScript
export function dataRectFromCellPosition(position) {
if (position.root) {
const r = position.root;
return {
rowStart: r.rowIndex,
rowEnd: r.rowIndex + r.rowSpan,
columnStart: r.colIndex,
columnEnd: r.colIndex + r.colSpan,
};
}
return {
rowStart: position.rowIndex,
rowEnd: position.rowIndex + 1,
columnStart: position.colIndex,
columnEnd: position.colIndex + 1,
};
}