react-konva-grid
Advanced tools
Comparing version 2.8.15 to 2.8.16
@@ -21,2 +21,13 @@ "use strict"; | ||
}; | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -26,2 +37,3 @@ exports.Cell = exports.CellRenderer = void 0; | ||
const react_konva_1 = require("react-konva"); | ||
const helpers_1 = require("./helpers"); | ||
/** | ||
@@ -32,6 +44,6 @@ * Default cell component | ||
const Cell = react_1.memo((props) => { | ||
const { x, y, width, height, value, fill = "white", strokeWidth = 0.5, stroke = "#aaa", align = "left", verticalAlign = "middle", textColor = "#333", padding = 5, fontFamily = "Arial, sans-serif", fontSize = 12, onClick, children, } = props; | ||
return (react_1.default.createElement(react_1.default.Fragment, null, | ||
const { x, y, width, height, value, fill = "white", strokeWidth = 0.5, stroke = "#aaa", align = "left", verticalAlign = "middle", textColor = "#333", padding = 5, fontFamily = "Arial, sans-serif", fontSize = 12, children, wrap = "none" } = props, rest = __rest(props, ["x", "y", "width", "height", "value", "fill", "strokeWidth", "stroke", "align", "verticalAlign", "textColor", "padding", "fontFamily", "fontSize", "children", "wrap"]); | ||
return (react_1.default.createElement(react_konva_1.Group, Object.assign({}, rest), | ||
react_1.default.createElement(react_konva_1.Rect, { x: x, y: y, height: height, width: width, fill: fill, stroke: stroke, strokeWidth: strokeWidth, shadowForStrokeEnabled: false, hitStrokeWidth: 0, strokeHitEnabled: false }), | ||
value === void 0 ? null : (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, wrap: "none", hitStrokeWidth: 0, strokeHitEnabled: false })), | ||
helpers_1.isNull(value) ? null : (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, wrap: wrap, hitStrokeWidth: 0, strokeHitEnabled: false })), | ||
children)); | ||
@@ -38,0 +50,0 @@ }); |
@@ -119,2 +119,3 @@ import { ItemSizer, InstanceInterface, AreaProps, CellInterface, CellMetaData, SelectionArea } from "./Grid"; | ||
}; | ||
export declare const isNull: (value: any) => boolean; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.AutoSizerCanvas = 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.isNull = exports.AutoSizerCanvas = 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; | ||
const types_1 = require("./types"); | ||
@@ -575,2 +575,4 @@ var Align; | ||
}; | ||
/* Check if a value is null */ | ||
exports.isNull = (value) => value === void 0 || value === null || value === ""; | ||
//# sourceMappingURL=helpers.js.map |
{ | ||
"name": "react-konva-grid", | ||
"description": "Declarative React Canvas Grid primitive for Data table, Pivot table, Excel Worksheets", | ||
"version": "2.8.15", | ||
"version": "2.8.16", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -805,1 +805,5 @@ // Utilities extracted from https://github.com/bvaughn/react-window | ||
}; | ||
/* Check if a value is null */ | ||
export const isNull = (value: any) => | ||
value === void 0 || value === null || value === ""; |
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
368721
8001