react-konva-grid
Advanced tools
Comparing version 2.8.9 to 2.8.10
@@ -31,6 +31,11 @@ "use strict"; | ||
const { x, y, width, height, value, fill = "white", strokeWidth = 0.5, stroke = "#aaa", align = "center", verticalAlign = "middle", textColor = "#333", padding = 5, fontFamily = "Arial, sans-serif", fontSize = 12, onClick, children, } = props; | ||
return (react_1.default.createElement(react_konva_1.Group, { onClick: onClick }, | ||
return (react_1.default.createElement(react_1.default.Fragment, null, | ||
react_1.default.createElement(react_konva_1.Rect, { x: x, y: y, height: height, width: width, fill: fill, stroke: stroke, strokeWidth: strokeWidth, shadowForStrokeEnabled: false }), | ||
react_1.default.createElement(react_konva_1.Text, { x: x, y: y, height: height, width: width, text: value, fill: textColor, verticalAlign: verticalAlign, align: align, fontFamily: fontFamily, fontSize: fontSize, padding: padding }), | ||
children)); | ||
value !== void 0 ? (react_1.default.createElement(react_konva_1.Shape, { strokeWidth: 0, hitStrokeWidth: 0, perfectDrawEnabled: false, shadowForStrokeEnabled: false, x: x, y: y, height: height, width: width, sceneFunc: (context) => { | ||
// @ts-ignore | ||
context.font = `${fontSize}px ${fontFamily}`; | ||
// @ts-ignore | ||
context.fillStyle = textColor; | ||
context.fillText(value, padding, (height || 0) - padding); | ||
} })) : null)); | ||
}); | ||
@@ -37,0 +42,0 @@ exports.Cell = Cell; |
@@ -43,3 +43,3 @@ "use strict"; | ||
const borderWidth = 2; | ||
const padding = 20; | ||
const padding = 16; | ||
const textSizer = react_1.useRef(helpers_1.AutoSizerCanvas("12px Arial")); | ||
@@ -46,0 +46,0 @@ const inputRef = react_1.useRef(null); |
{ | ||
"name": "react-konva-grid", | ||
"description": "Declarative React Canvas Grid primitive for Data table, Pivot table, Excel Worksheets", | ||
"version": "2.8.9", | ||
"version": "2.8.10", | ||
"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
366730
7964