rc-tree
Advanced tools
Comparing version 5.3.6 to 5.3.7
@@ -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; |
@@ -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": { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
340968
7282
1