@konturio/ui-kit
Advanced tools
Comparing version 3.0.0-alpha.42 to 3.0.0-alpha.43
{ | ||
"name": "@konturio/ui-kit", | ||
"version": "3.0.0-alpha.42", | ||
"version": "3.0.0-alpha.43", | ||
"repository": { | ||
@@ -28,3 +28,3 @@ "type": "git", | ||
}, | ||
"gitHead": "e1abf245523efc0b74affb2ead4a58ab8f01b3ed" | ||
"gitHead": "3d4aa42f63c1a90c9974675ca43093ae6bde12fa" | ||
} |
@@ -21,5 +21,7 @@ /// <reference types="react" /> | ||
}; | ||
onCellPointerOver?: (e: MouseEvent, cell: Cell, i: number) => void; | ||
onCellPointerLeave?: (e: MouseEvent, cell: Cell, i: number) => void; | ||
} | ||
export declare const Legend: ({ cells, size, axis, title, showAxisLabels }: LegendProps) => JSX.Element; | ||
export declare const Legend: ({ cells, size, axis, title, showAxisLabels, onCellPointerOver, onCellPointerLeave, }: LegendProps) => JSX.Element; | ||
export {}; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -14,3 +14,3 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; | ||
const ArrowHead = ({ className, type }) => (_jsx("div", Object.assign({ className: className }, { children: type === 'horizontal' ? (_jsx("svg", Object.assign({ width: "6", height: "12", viewBox: "0 0 6 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M6,6L0,0l0,2.4L3.6,6L0,9.6L0,12L6,6z", fill: "currentColor" }) }))) : (_jsx("svg", Object.assign({ width: "12", height: "6", viewBox: "0 0 12 6", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M6,0L0,6l2.4,0L6,2.4L9.6,6L12,6L6,0z", fill: "currentColor" }) }))) }))); | ||
export const Legend = ({ cells, size, axis, title, showAxisLabels = false }) => { | ||
export const Legend = ({ cells, size, axis, title, showAxisLabels = false, onCellPointerOver, onCellPointerLeave, }) => { | ||
const TEMPLATE = useMemo(() => [ | ||
@@ -30,7 +30,3 @@ `y ${new Array(size + 1).fill('.').join(' ')}`, | ||
})), | ||
c: cells.map((cell) => ({ | ||
label: _jsx("span", { children: cell.label }), | ||
className: cn(styles.cell, styles.colorCell), | ||
style: { backgroundColor: cell.color }, | ||
})), | ||
c: cells.map((cell, i) => (Object.assign(Object.assign({ label: _jsx("span", { children: cell.label }), className: cn(styles.cell, styles.colorCell), style: { backgroundColor: cell.color } }, (onCellPointerOver && { onPointerOver: (e) => onCellPointerOver(e, cell, i) })), (onCellPointerLeave && { onPointerLeave: (e) => onCellPointerLeave(e, cell, i) })))), | ||
}); | ||
@@ -40,3 +36,3 @@ return (_jsxs("div", { children: [title && _jsx("div", Object.assign({ className: styles.legendTitle }, { children: title })), _jsxs("div", Object.assign({ className: styles.grid, style: { | ||
gridTemplateRows: `repeat(${size + 2}, auto)`, | ||
} }, { children: [showAxisLabels && axis.x.label ? _jsx("div", Object.assign({ className: styles.axisLabelX }, { children: axis.x.label })) : null, showAxisLabels && axis.y.label ? _jsx("div", Object.assign({ className: styles.axisLabelY }, { children: axis.y.label })) : null, _jsx("div", Object.assign({ className: styles.arrowX }, { children: _jsx(ArrowHead, { type: "horizontal", className: styles.arrowHeadX }) })), _jsx("div", Object.assign({ className: styles.arrowY }, { children: _jsx(ArrowHead, { type: "vertical", className: cn({ [styles.arrowHeadY]: true, [styles.arrowHeadY_angle0]: !showAxisLabels }) }) })), gridCells.map((cell) => (_jsx("div", Object.assign({ style: Object.assign(getCellPositionStyle(cell._position.x, cell._position.y), cell.style), className: cn(cell.className, styles.cell) }, { children: cell.label }), `${cell._position.x}|${cell._position.y}`)))] }))] })); | ||
} }, { children: [showAxisLabels && axis.x.label ? _jsx("div", Object.assign({ className: styles.axisLabelX }, { children: axis.x.label })) : null, showAxisLabels && axis.y.label ? _jsx("div", Object.assign({ className: styles.axisLabelY }, { children: axis.y.label })) : null, _jsx("div", Object.assign({ className: styles.arrowX }, { children: _jsx(ArrowHead, { type: "horizontal", className: styles.arrowHeadX }) })), _jsx("div", Object.assign({ className: styles.arrowY }, { children: _jsx(ArrowHead, { type: "vertical", className: cn({ [styles.arrowHeadY]: true, [styles.arrowHeadY_angle0]: !showAxisLabels }) }) })), gridCells.map((cell) => (_jsx("div", Object.assign({ style: Object.assign(getCellPositionStyle(cell._position.x, cell._position.y), cell.style), className: cn(cell.className, styles.cell), onPointerOver: cell.onPointerOver, onPointerLeave: cell.onPointerLeave }, { children: cell.label }), `${cell._position.x}|${cell._position.y}`)))] }))] })); | ||
}; |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
137357
0
2494