react-konva-grid
Advanced tools
Comparing version 2.7.17 to 2.7.18
@@ -559,2 +559,6 @@ "use strict"; | ||
for (const { rowIndex, columnIndex, toColumnIndex } of cellAreas) { | ||
/* Skip merged cells, Merged cell cannot be extended */ | ||
if (isMergedCell({ rowIndex, columnIndex })) { | ||
continue; | ||
} | ||
const x = helpers_1.getColumnOffset({ | ||
@@ -561,0 +565,0 @@ index: columnIndex, |
@@ -97,8 +97,2 @@ import { ItemSizer, InstanceInterface, AreaProps, CellInterface, CellMetaData, SelectionArea } from "./Grid"; | ||
export declare const findNextCellWithinBounds: (activeCellBounds: AreaProps, selectionBounds: AreaProps, direction?: Movement) => CellInterface | null; | ||
/** | ||
* Get maximum bound of an area, caters to merged cells | ||
* @param area | ||
* @param boundGetter | ||
*/ | ||
export declare const mergedCellBounds: (area: AreaProps, boundGetter: (coords: CellInterface) => AreaProps) => AreaProps; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.mergedCellBounds = exports.findNextCellWithinBounds = exports.prepareClipboardData = exports.numberToAlphabet = exports.selectionFromActiveCell = exports.requestTimeout = exports.cancelTimeout = exports.getOffsetForRowAndAlignment = exports.getOffsetForColumnAndAlignment = exports.getOffsetForIndexAndAlignment = exports.rafThrottle = exports.debounce = exports.throttle = exports.cellIndentifier = exports.getEstimatedTotalWidth = exports.getEstimatedTotalHeight = exports.getItemMetadata = exports.getColumnWidth = exports.getRowHeight = exports.getColumnOffset = exports.getRowOffset = exports.itemKey = exports.getBoundedCells = exports.getColumnStopIndexForStartIndex = exports.getColumnStartIndexForOffset = exports.getRowStopIndexForStartIndex = exports.getRowStartIndexForOffset = exports.ItemType = exports.Align = void 0; | ||
exports.findNextCellWithinBounds = exports.prepareClipboardData = exports.numberToAlphabet = exports.selectionFromActiveCell = exports.requestTimeout = exports.cancelTimeout = exports.getOffsetForRowAndAlignment = exports.getOffsetForColumnAndAlignment = exports.getOffsetForIndexAndAlignment = exports.rafThrottle = exports.debounce = exports.throttle = exports.cellIndentifier = exports.getEstimatedTotalWidth = exports.getEstimatedTotalHeight = exports.getItemMetadata = exports.getColumnWidth = exports.getRowHeight = exports.getColumnOffset = exports.getRowOffset = exports.itemKey = exports.getBoundedCells = exports.getColumnStopIndexForStartIndex = exports.getColumnStartIndexForOffset = exports.getRowStopIndexForStartIndex = exports.getRowStartIndexForOffset = exports.ItemType = exports.Align = void 0; | ||
const types_1 = require("./types"); | ||
@@ -515,28 +515,2 @@ var Align; | ||
}; | ||
/** | ||
* Get maximum bound of an area, caters to merged cells | ||
* @param area | ||
* @param boundGetter | ||
*/ | ||
exports.mergedCellBounds = (area, boundGetter) => { | ||
let top = []; | ||
let left = []; | ||
let right = []; | ||
let bottom = []; | ||
for (let i = area.top; i <= area.bottom; i++) { | ||
for (let j = area.left; j <= area.right; j++) { | ||
const bounds = boundGetter({ rowIndex: i, columnIndex: j }); | ||
top.push(bounds.top); | ||
left.push(bounds.left); | ||
right.push(bounds.right); | ||
bottom.push(bounds.bottom); | ||
} | ||
} | ||
return { | ||
top: Math.min(...top), | ||
left: Math.min(...left), | ||
right: Math.max(...right), | ||
bottom: Math.min(...bottom), | ||
}; | ||
}; | ||
//# sourceMappingURL=helpers.js.map |
@@ -59,10 +59,3 @@ "use strict"; | ||
}; | ||
/* Get max bounds of merged cell */ | ||
const mergeCellBounds = helpers_1.mergedCellBounds(bounds, gridRef.current.getCellBounds); | ||
return { | ||
top: Math.min(mergeCellBounds.top, bounds.top), | ||
bottom: Math.max(mergeCellBounds.bottom, bounds.bottom), | ||
left: Math.min(mergeCellBounds.left, bounds.left), | ||
right: Math.max(mergeCellBounds.right, bounds.right), | ||
}; | ||
return bounds; | ||
}; | ||
@@ -69,0 +62,0 @@ /* Modify current selection */ |
{ | ||
"name": "react-konva-grid", | ||
"description": "Declarative React Canvas Grid primitive for Data table, Pivot table, Excel Worksheets", | ||
"version": "2.7.17", | ||
"version": "2.7.18", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -743,31 +743,1 @@ // Utilities extracted from https://github.com/bvaughn/react-window | ||
}; | ||
/** | ||
* Get maximum bound of an area, caters to merged cells | ||
* @param area | ||
* @param boundGetter | ||
*/ | ||
export const mergedCellBounds = ( | ||
area: AreaProps, | ||
boundGetter: (coords: CellInterface) => AreaProps | ||
): AreaProps => { | ||
let top = []; | ||
let left = []; | ||
let right = []; | ||
let bottom = []; | ||
for (let i = area.top; i <= area.bottom; i++) { | ||
for (let j = area.left; j <= area.right; j++) { | ||
const bounds = boundGetter({ rowIndex: i, columnIndex: j }); | ||
top.push(bounds.top); | ||
left.push(bounds.left); | ||
right.push(bounds.right); | ||
bottom.push(bounds.bottom); | ||
} | ||
} | ||
return { | ||
top: Math.min(...top), | ||
left: Math.min(...left), | ||
right: Math.max(...right), | ||
bottom: Math.min(...bottom), | ||
}; | ||
}; |
@@ -8,3 +8,2 @@ import React, { useState, useCallback, useRef, useEffect } from "react"; | ||
cellIndentifier, | ||
mergedCellBounds, | ||
} from "./../helpers"; | ||
@@ -148,14 +147,3 @@ import { KeyCodes, Direction, Movement } from "./../types"; | ||
}; | ||
/* Get max bounds of merged cell */ | ||
const mergeCellBounds = mergedCellBounds( | ||
bounds, | ||
gridRef.current.getCellBounds | ||
); | ||
return { | ||
top: Math.min(mergeCellBounds.top, bounds.top), | ||
bottom: Math.max(mergeCellBounds.bottom, bounds.bottom), | ||
left: Math.min(mergeCellBounds.left, bounds.left), | ||
right: Math.max(mergeCellBounds.right, bounds.right), | ||
}; | ||
return bounds; | ||
}; | ||
@@ -162,0 +150,0 @@ |
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
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
16857019
25660