react-konva-grid
Advanced tools
Comparing version 2.8.12 to 2.8.13
@@ -25,2 +25,14 @@ "use strict"; | ||
const react_konva_1 = require("react-konva"); | ||
var Align; | ||
(function (Align) { | ||
Align["LEFT"] = "left"; | ||
Align["RIGHT"] = "right"; | ||
Align["CENTER"] = "center"; | ||
})(Align || (Align = {})); | ||
const getX = (align, width = 0, padding = 0) => { | ||
if (align === Align.CENTER) | ||
return width / 2; | ||
if (align === Align.LEFT) | ||
return padding; | ||
}; | ||
/** | ||
@@ -35,9 +47,6 @@ * Default cell component | ||
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; | ||
const lineTranslateX = align === "center" ? (width || 0) / 2 : padding; | ||
// @ts-ignore | ||
context.textAlign = align; | ||
context._context.font = `${fontSize}px ${fontFamily}`; | ||
context._context.fillStyle = textColor; | ||
const lineTranslateX = getX(align, width, padding); | ||
context._context.textAlign = align; | ||
context.fillText(value, lineTranslateX, (height || 0) - padding); | ||
@@ -44,0 +53,0 @@ } })) : null)); |
{ | ||
"name": "react-konva-grid", | ||
"description": "Declarative React Canvas Grid primitive for Data table, Pivot table, Excel Worksheets", | ||
"version": "2.8.12", | ||
"version": "2.8.13", | ||
"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
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
368808
8003