Socket
Socket
Sign inDemoInstall

rc-tree

Package Overview
Dependencies
5
Maintainers
11
Versions
305
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.3.6 to 5.3.7

1

es/Tree.d.ts

@@ -200,2 +200,3 @@ import * as React from 'react';

onNodeDrop: (event: React.DragEvent<HTMLDivElement>, node: any, outsideTree?: boolean) => void;
resetDragState(): void;
cleanDragState: () => void;

@@ -202,0 +203,0 @@ onNodeClick: NodeMouseEventHandler;

67

es/Tree.js

@@ -137,2 +137,8 @@ import _extends from "@babel/runtime/helpers/esm/extends";

if (!dragNode) {
_this.resetDragState();
return;
}
var _calcDropPosition = calcDropPosition(event, dragNode, node, indent, _this.dragStartMousePosition, allowDrop, flattenNodes, keyEntities, expandedKeys, direction),

@@ -147,14 +153,6 @@ dropPosition = _calcDropPosition.dropPosition,

if (!dragNode || // don't allow drop inside its children
if ( // don't allow drop inside its children
dragChildrenKeys.indexOf(dropTargetKey) !== -1 || // don't allow drop when drop is not allowed caculated by calcDropPosition
!dropAllowed) {
_this.setState({
dragOverNodeKey: null,
dropPosition: null,
dropLevelOffset: null,
dropTargetKey: null,
dropContainerKey: null,
dropTargetPos: null,
dropAllowed: false
});
_this.resetDragState();

@@ -206,11 +204,3 @@ return;

if (dragNode.props.eventKey === dropTargetKey && dropLevelOffset === 0) {
_this.setState({
dragOverNodeKey: null,
dropPosition: null,
dropLevelOffset: null,
dropTargetKey: null,
dropContainerKey: null,
dropTargetPos: null,
dropAllowed: false
});
_this.resetDragState();

@@ -255,2 +245,6 @@ return;

if (!dragNode) {
return;
}
var _calcDropPosition2 = calcDropPosition(event, dragNode, node, indent, _this.dragStartMousePosition, allowDrop, flattenNodes, keyEntities, expandedKeys, direction),

@@ -265,3 +259,3 @@ dropPosition = _calcDropPosition2.dropPosition,

if (!dragNode || dragChildrenKeys.indexOf(dropTargetKey) !== -1 || !dropAllowed) {
if (dragChildrenKeys.indexOf(dropTargetKey) !== -1 || !dropAllowed) {
// don't allow drop inside its children

@@ -275,11 +269,3 @@ // don't allow drop when drop is not allowed caculated by calcDropPosition

if (!(_this.state.dropPosition === null && _this.state.dropLevelOffset === null && _this.state.dropTargetKey === null && _this.state.dropContainerKey === null && _this.state.dropTargetPos === null && _this.state.dropAllowed === false && _this.state.dragOverNodeKey === null)) {
_this.setState({
dropPosition: null,
dropLevelOffset: null,
dropTargetKey: null,
dropContainerKey: null,
dropTargetPos: null,
dropAllowed: false,
dragOverNodeKey: null
});
_this.resetDragState();
}

@@ -310,11 +296,3 @@ } else if (!(dropPosition === _this.state.dropPosition && dropLevelOffset === _this.state.dropLevelOffset && dropTargetKey === _this.state.dropTargetKey && dropContainerKey === _this.state.dropContainerKey && dropTargetPos === _this.state.dropTargetPos && dropAllowed === _this.state.dropAllowed && dragOverNodeKey === _this.state.dragOverNodeKey)) {

if (_this.currentMouseOverDroppableNodeKey === node.props.eventKey && !event.currentTarget.contains(event.relatedTarget)) {
_this.setState({
dropPosition: null,
dropLevelOffset: null,
dropTargetKey: null,
dropContainerKey: null,
dropTargetPos: null,
dropAllowed: false,
dragOverNodeKey: null
});
_this.resetDragState();

@@ -1002,2 +980,15 @@ _this.currentMouseOverDroppableNodeKey = null;

}, {
key: "resetDragState",
value: function resetDragState() {
this.setState({
dragOverNodeKey: null,
dropPosition: null,
dropLevelOffset: null,
dropTargetKey: null,
dropContainerKey: null,
dropTargetPos: null,
dropAllowed: false
});
}
}, {
key: "render",

@@ -1004,0 +995,0 @@ value: function render() {

@@ -200,2 +200,3 @@ import * as React from 'react';

onNodeDrop: (event: React.DragEvent<HTMLDivElement>, node: any, outsideTree?: boolean) => void;
resetDragState(): void;
cleanDragState: () => void;

@@ -202,0 +203,0 @@ onNodeClick: NodeMouseEventHandler;

@@ -170,2 +170,8 @@ "use strict";

if (!dragNode) {
_this.resetDragState();
return;
}
var _calcDropPosition = (0, _util.calcDropPosition)(event, dragNode, node, indent, _this.dragStartMousePosition, allowDrop, flattenNodes, keyEntities, expandedKeys, direction),

@@ -180,14 +186,6 @@ dropPosition = _calcDropPosition.dropPosition,

if (!dragNode || // don't allow drop inside its children
if ( // don't allow drop inside its children
dragChildrenKeys.indexOf(dropTargetKey) !== -1 || // don't allow drop when drop is not allowed caculated by calcDropPosition
!dropAllowed) {
_this.setState({
dragOverNodeKey: null,
dropPosition: null,
dropLevelOffset: null,
dropTargetKey: null,
dropContainerKey: null,
dropTargetPos: null,
dropAllowed: false
});
_this.resetDragState();

@@ -237,11 +235,3 @@ return;

if (dragNode.props.eventKey === dropTargetKey && dropLevelOffset === 0) {
_this.setState({
dragOverNodeKey: null,
dropPosition: null,
dropLevelOffset: null,
dropTargetKey: null,
dropContainerKey: null,
dropTargetPos: null,
dropAllowed: false
});
_this.resetDragState();

@@ -286,2 +276,6 @@ return;

if (!dragNode) {
return;
}
var _calcDropPosition2 = (0, _util.calcDropPosition)(event, dragNode, node, indent, _this.dragStartMousePosition, allowDrop, flattenNodes, keyEntities, expandedKeys, direction),

@@ -296,3 +290,3 @@ dropPosition = _calcDropPosition2.dropPosition,

if (!dragNode || dragChildrenKeys.indexOf(dropTargetKey) !== -1 || !dropAllowed) {
if (dragChildrenKeys.indexOf(dropTargetKey) !== -1 || !dropAllowed) {
// don't allow drop inside its children

@@ -306,11 +300,3 @@ // don't allow drop when drop is not allowed caculated by calcDropPosition

if (!(_this.state.dropPosition === null && _this.state.dropLevelOffset === null && _this.state.dropTargetKey === null && _this.state.dropContainerKey === null && _this.state.dropTargetPos === null && _this.state.dropAllowed === false && _this.state.dragOverNodeKey === null)) {
_this.setState({
dropPosition: null,
dropLevelOffset: null,
dropTargetKey: null,
dropContainerKey: null,
dropTargetPos: null,
dropAllowed: false,
dragOverNodeKey: null
});
_this.resetDragState();
}

@@ -341,11 +327,3 @@ } else if (!(dropPosition === _this.state.dropPosition && dropLevelOffset === _this.state.dropLevelOffset && dropTargetKey === _this.state.dropTargetKey && dropContainerKey === _this.state.dropContainerKey && dropTargetPos === _this.state.dropTargetPos && dropAllowed === _this.state.dropAllowed && dragOverNodeKey === _this.state.dragOverNodeKey)) {

if (_this.currentMouseOverDroppableNodeKey === node.props.eventKey && !event.currentTarget.contains(event.relatedTarget)) {
_this.setState({
dropPosition: null,
dropLevelOffset: null,
dropTargetKey: null,
dropContainerKey: null,
dropTargetPos: null,
dropAllowed: false,
dragOverNodeKey: null
});
_this.resetDragState();

@@ -1031,2 +1009,15 @@ _this.currentMouseOverDroppableNodeKey = null;

}, {
key: "resetDragState",
value: function resetDragState() {
this.setState({
dragOverNodeKey: null,
dropPosition: null,
dropLevelOffset: null,
dropTargetKey: null,
dropContainerKey: null,
dropTargetPos: null,
dropAllowed: false
});
}
}, {
key: "render",

@@ -1033,0 +1024,0 @@ value: function render() {

{
"name": "rc-tree",
"version": "5.3.6",
"version": "5.3.7",
"description": "tree ui component for react",

@@ -5,0 +5,0 @@ "engines": {

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc