react-konva-grid
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -272,6 +272,12 @@ "use strict"; | ||
/* Draw merged cells */ | ||
const mergedCellAreas = react_1.useMemo(() => { | ||
const [mergedCellAreas, frozenColumnMergedCellAreas, frozenRowMergedCellAreas, frozenIntersectionMergedCells,] = react_1.useMemo(() => { | ||
const areas = []; | ||
const frozenColumnAreas = []; | ||
const frozenRowAreas = []; | ||
const frozenIntersectionCells = []; | ||
for (let i = 0; i < mergedCells.length; i++) { | ||
const { top: rowIndex, left: columnIndex, right, bottom } = mergedCells[i]; | ||
const isLeftBoundFrozen = columnIndex < frozenColumns; | ||
const isTopBoundFrozen = rowIndex < frozenRows; | ||
const isIntersectionFrozen = rowIndex < frozenRows && columnIndex < frozenColumns; | ||
const x = helpers_1.getColumnOffset({ | ||
@@ -301,3 +307,3 @@ index: columnIndex, | ||
}) - y; | ||
areas.push(itemRenderer({ | ||
const cellRenderer = itemRenderer({ | ||
x, | ||
@@ -310,5 +316,19 @@ y, | ||
key: helpers_1.itemKey({ rowIndex, columnIndex }), | ||
})); | ||
}); | ||
if (isLeftBoundFrozen) { | ||
frozenColumnAreas.push(cellRenderer); | ||
} | ||
if (isTopBoundFrozen) { | ||
frozenRowAreas.push(cellRenderer); | ||
} | ||
if (isIntersectionFrozen) | ||
[frozenIntersectionCells.push(cellRenderer)]; | ||
areas.push(cellRenderer); | ||
} | ||
return areas; | ||
return [ | ||
areas, | ||
frozenColumnAreas, | ||
frozenRowAreas, | ||
frozenIntersectionCells, | ||
]; | ||
}, [ | ||
@@ -569,7 +589,13 @@ mergedCells, | ||
react_1.default.createElement(ReactKonvaCore_1.Group, { offsetY: scrollTop, offsetX: scrollLeft, listening: false }, selectionAreas), | ||
react_1.default.createElement(ReactKonvaCore_1.Group, { offsetY: scrollTop, offsetX: 0 }, frozenColumnCells), | ||
react_1.default.createElement(ReactKonvaCore_1.Group, { offsetY: scrollTop, offsetX: 0 }, | ||
frozenColumnCells, | ||
frozenColumnMergedCellAreas), | ||
react_1.default.createElement(ReactKonvaCore_1.Group, { offsetY: scrollTop, offsetX: 0, listening: false }, selectionAreasFrozenColumns), | ||
react_1.default.createElement(ReactKonvaCore_1.Group, { offsetY: 0, offsetX: scrollLeft }, frozenRowCells), | ||
react_1.default.createElement(ReactKonvaCore_1.Group, { offsetY: 0, offsetX: scrollLeft }, | ||
frozenRowCells, | ||
frozenRowMergedCellAreas), | ||
react_1.default.createElement(ReactKonvaCore_1.Group, { offsetY: 0, offsetX: scrollLeft, listening: false }, selectionAreasFrozenRows), | ||
react_1.default.createElement(ReactKonvaCore_1.Group, { offsetY: 0, offsetX: 0 }, frozenIntersectionCells), | ||
react_1.default.createElement(ReactKonvaCore_1.Group, { offsetY: 0, offsetX: 0 }, | ||
frozenIntersectionCells, | ||
frozenIntersectionMergedCells), | ||
react_1.default.createElement(ReactKonvaCore_1.Group, { offsetY: 0, offsetX: 0, listening: false }, selectionAreasIntersection)))), | ||
@@ -576,0 +602,0 @@ showScrollbar ? (react_1.default.createElement(react_1.default.Fragment, null, |
{ | ||
"name": "react-konva-grid", | ||
"description": "Canvas grid to render large set of tabular data with virtualization.", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14630259
17366