Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-konva-grid

Package Overview
Dependencies
Maintainers
1
Versions
146
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-konva-grid - npm Package Compare versions

Comparing version 2.8.7 to 2.8.8

23

dist/hooks/useSelection.js

@@ -141,6 +141,12 @@ "use strict";

/* Exit early if grid is not initialized */
if (!gridRef ||
!gridRef.current ||
e.nativeEvent.which === types_1.MouseButtonCodes.right)
if (!gridRef || !gridRef.current)
return;
const coords = gridRef.current.getCellCoordsFromOffset(e.clientX, e.clientY);
/* Check if its context menu click */
const isContextMenuClick = e.nativeEvent.which === types_1.MouseButtonCodes.right;
if (isContextMenuClick) {
const cellIndex = cellIndexInSelection(coords, selections);
if (cellIndex !== -1)
return;
}
const isShiftKey = e.nativeEvent.shiftKey;

@@ -153,12 +159,9 @@ const isMetaKey = e.nativeEvent.ctrlKey || e.nativeEvent.metaKey;

/* Attaching mousemove to document, so we can detect drag move */
document.addEventListener("mousemove", handleMouseMove);
if (!isContextMenuClick) {
/* Prevent mousemove if its contextmenu click */
document.addEventListener("mousemove", handleMouseMove);
}
document.addEventListener("mouseup", handleMouseUp);
/* Activate selection mode */
isSelecting.current = true;
const { rowIndex, columnIndex } = gridRef.current.getCellCoordsFromOffset(e.clientX, e.clientY);
/**
* Save the initial Selection in ref
* so we can adjust the bounds in mousemove
*/
const coords = { rowIndex, columnIndex };
/* Shift key */

@@ -165,0 +168,0 @@ if (isShiftKey) {

{
"name": "react-konva-grid",
"description": "Declarative React Canvas Grid primitive for Data table, Pivot table, Excel Worksheets",
"version": "2.8.7",
"version": "2.8.8",
"main": "dist/index.js",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -251,8 +251,13 @@ import React, { useState, useCallback, useRef, useEffect } from "react";

/* Exit early if grid is not initialized */
if (
!gridRef ||
!gridRef.current ||
e.nativeEvent.which === MouseButtonCodes.right
)
return;
if (!gridRef || !gridRef.current) return;
const coords = gridRef.current.getCellCoordsFromOffset(
e.clientX,
e.clientY
);
/* Check if its context menu click */
const isContextMenuClick = e.nativeEvent.which === MouseButtonCodes.right;
if (isContextMenuClick) {
const cellIndex = cellIndexInSelection(coords, selections);
if (cellIndex !== -1) return;
}
const isShiftKey = e.nativeEvent.shiftKey;

@@ -267,3 +272,6 @@ const isMetaKey = e.nativeEvent.ctrlKey || e.nativeEvent.metaKey;

/* Attaching mousemove to document, so we can detect drag move */
document.addEventListener("mousemove", handleMouseMove);
if (!isContextMenuClick) {
/* Prevent mousemove if its contextmenu click */
document.addEventListener("mousemove", handleMouseMove);
}
document.addEventListener("mouseup", handleMouseUp);

@@ -274,13 +282,2 @@

const { rowIndex, columnIndex } = gridRef.current.getCellCoordsFromOffset(
e.clientX,
e.clientY
);
/**
* Save the initial Selection in ref
* so we can adjust the bounds in mousemove
*/
const coords = { rowIndex, columnIndex };
/* Shift key */

@@ -287,0 +284,0 @@ if (isShiftKey) {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc