react-konva-grid
Advanced tools
Comparing version 2.8.11 to 2.8.12
@@ -38,7 +38,6 @@ "use strict"; | ||
context.fillStyle = textColor; | ||
const lineTranslateX = align === "center" ? (width || 0) / 2 : x; | ||
const lineTranslateX = align === "center" ? (width || 0) / 2 : padding; | ||
// @ts-ignore | ||
context.textAlign = align; | ||
context.fillText(value, lineTranslateX, (height || 0) - padding); | ||
// context.fillText(value, padding, (height || 0) - padding); | ||
} })) : null)); | ||
@@ -45,0 +44,0 @@ }); |
@@ -15,4 +15,4 @@ "use strict"; | ||
const [selections, setSelections] = react_1.useState(initialSelections); | ||
const selectionStart = react_1.useRef(); | ||
const selectionEnd = react_1.useRef(); | ||
const selectionStart = react_1.useRef(null); | ||
const selectionEnd = react_1.useRef(null); | ||
const isSelecting = react_1.useRef(); | ||
@@ -496,2 +496,11 @@ const firstActiveCell = react_1.useRef(null); | ||
}, [rowCount, columnCount, activeCell, selections]); | ||
/** | ||
* User modified active cell deliberately | ||
*/ | ||
const handleSetActiveCell = react_1.useCallback((coords) => { | ||
selectionStart.current = coords; | ||
firstActiveCell.current = coords; | ||
selectionEnd.current = coords; | ||
setActiveCell(coords); | ||
}, []); | ||
return { | ||
@@ -504,3 +513,3 @@ activeCell, | ||
setSelections, | ||
setActiveCell, | ||
setActiveCell: handleSetActiveCell, | ||
}; | ||
@@ -507,0 +516,0 @@ }; |
{ | ||
"name": "react-konva-grid", | ||
"description": "Declarative React Canvas Grid primitive for Data table, Pivot table, Excel Worksheets", | ||
"version": "2.8.11", | ||
"version": "2.8.12", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -102,4 +102,4 @@ import React, { useState, useCallback, useRef, useEffect } from "react"; | ||
); | ||
const selectionStart = useRef<CellInterface>(); | ||
const selectionEnd = useRef<CellInterface>(); | ||
const selectionStart = useRef<CellInterface | null>(null); | ||
const selectionEnd = useRef<CellInterface | null>(null); | ||
const isSelecting = useRef<boolean>(); | ||
@@ -414,2 +414,3 @@ const firstActiveCell = useRef<CellInterface | null>(null); | ||
return; | ||
var { rowIndex, columnIndex } = modify | ||
@@ -656,2 +657,12 @@ ? selectionEnd.current | ||
/** | ||
* User modified active cell deliberately | ||
*/ | ||
const handleSetActiveCell = useCallback((coords: CellInterface | null) => { | ||
selectionStart.current = coords; | ||
firstActiveCell.current = coords; | ||
selectionEnd.current = coords; | ||
setActiveCell(coords); | ||
}, []); | ||
return { | ||
@@ -664,3 +675,3 @@ activeCell, | ||
setSelections, | ||
setActiveCell, | ||
setActiveCell: handleSetActiveCell, | ||
}; | ||
@@ -667,0 +678,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
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
368145
7989