react-konva-grid
Advanced tools
Comparing version 2.5.3 to 2.5.4
@@ -146,29 +146,2 @@ "use strict"; | ||
/** | ||
* Resize one or more columns | ||
*/ | ||
const resizeColumns = react_1.useCallback((indexes) => { | ||
const leftMost = Math.min(...indexes); | ||
resetAfterIndices({ columnIndex: leftMost }, false); | ||
instanceProps.current.recalcColumnIndexes = indexes; | ||
forceRender(); | ||
}, []); | ||
/* Always reset after a render: TODO: Find a better way */ | ||
react_1.useEffect(() => { | ||
if (instanceProps.current.recalcColumnIndexes.length) { | ||
instanceProps.current.recalcColumnIndexes.length = 0; | ||
} | ||
if (instanceProps.current.recalcRowIndexes.length) { | ||
instanceProps.current.recalcRowIndexes.length = 0; | ||
} | ||
}); | ||
/** | ||
* Resize one or more rows | ||
*/ | ||
const resizeRows = react_1.useCallback((indexes) => { | ||
const topMost = Math.min(...indexes); | ||
resetAfterIndices({ rowIndex: topMost }, false); | ||
instanceProps.current.recalcRowIndexes = indexes; | ||
forceRender(); | ||
}, []); | ||
/** | ||
* Create a map of merged cells | ||
@@ -240,2 +213,29 @@ * [rowIndex, columnindex] => [parentRowIndex, parentColumnIndex] | ||
const estimatedTotalWidth = helpers_1.getEstimatedTotalWidth(columnCount, instanceProps.current); | ||
/** | ||
* Resize one or more columns | ||
*/ | ||
const resizeColumns = react_1.useCallback((indexes) => { | ||
const leftMost = Math.min(...indexes); | ||
resetAfterIndices({ columnIndex: leftMost }, false); | ||
instanceProps.current.recalcColumnIndexes = indexes; | ||
forceRender(); | ||
}, []); | ||
/** | ||
* Resize one or more rows | ||
*/ | ||
const resizeRows = react_1.useCallback((indexes) => { | ||
const topMost = Math.min(...indexes); | ||
resetAfterIndices({ rowIndex: topMost }, false); | ||
instanceProps.current.recalcRowIndexes = indexes; | ||
forceRender(); | ||
}, []); | ||
/* Always if the viewport changes */ | ||
react_1.useEffect(() => { | ||
if (instanceProps.current.recalcColumnIndexes.length) { | ||
instanceProps.current.recalcColumnIndexes.length = 0; | ||
} | ||
if (instanceProps.current.recalcRowIndexes.length) { | ||
instanceProps.current.recalcRowIndexes.length = 0; | ||
} | ||
}, [rowStopIndex, columnStopIndex]); | ||
/* Handle vertical scroll */ | ||
@@ -242,0 +242,0 @@ const handleScroll = react_1.useCallback((e) => { |
{ | ||
"name": "react-konva-grid", | ||
"description": "Declarative React Canvas Grid primitive for Data table, Pivot table, Excel Worksheets", | ||
"version": "2.5.3", | ||
"version": "2.5.4", | ||
"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
14727918
19852