@ajuhos/react-flow-chart
Advanced tools
Comparing version 0.0.46 to 0.0.47
{ | ||
"name": "@ajuhos/react-flow-chart", | ||
"version": "0.0.46", | ||
"version": "0.0.47", | ||
"description": "A flexible, stateless flow chart library for react.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -58,5 +58,7 @@ "use strict"; | ||
(node.size && node.size.height) !== el.offsetHeight) { | ||
var newSize = { width: el.offsetWidth, height: el.offsetHeight }; | ||
setSize(newSize); | ||
onNodeSizeChange({ config: config, nodeId: node.id, size: newSize }); | ||
var newSize_1 = { width: el.offsetWidth, height: el.offsetHeight }; | ||
setSize(newSize_1); | ||
window.setTimeout(function () { | ||
onNodeSizeChange({ config: config, nodeId: node.id, size: newSize_1 }); | ||
}, 200); | ||
} | ||
@@ -63,0 +65,0 @@ } |
@@ -34,5 +34,4 @@ import * as React from 'react'; | ||
render(): JSX.Element; | ||
private updatePortPositionTimer; | ||
private updatePortPosition; | ||
private portsOfType; | ||
} |
@@ -117,18 +117,12 @@ "use strict"; | ||
PortWrapper.prototype.updatePortPosition = function () { | ||
var _this = this; | ||
if (this.updatePortPositionTimer) | ||
window.clearTimeout(this.updatePortPositionTimer); | ||
this.updatePortPositionTimer = window.setTimeout(function () { | ||
_this.updatePortPositionTimer = null; | ||
var el = _this.nodeRef.current; | ||
if (el) { | ||
// Ports component should be positions absolute | ||
// Factor this in so we get position relative to the node | ||
var nodesEl = el.parentElement | ||
? el.parentElement | ||
: { offsetLeft: 0, offsetTop: 0 }; | ||
// update port position after node size has been determined | ||
_this.props.onPortPositionChange({ config: _this.props.config, node: _this.props.node, port: _this.props.port, el: el, nodesEl: nodesEl }); | ||
} | ||
}, 200); | ||
var el = this.nodeRef.current; | ||
if (el) { | ||
// Ports component should be positions absolute | ||
// Factor this in so we get position relative to the node | ||
var nodesEl = el.parentElement | ||
? el.parentElement | ||
: { offsetLeft: 0, offsetTop: 0 }; | ||
// update port position after node size has been determined | ||
this.props.onPortPositionChange({ config: this.props.config, node: this.props.node, port: this.props.port, el: el, nodesEl: nodesEl }); | ||
} | ||
}; | ||
@@ -135,0 +129,0 @@ PortWrapper.prototype.portsOfType = function (props) { |
Sorry, the diff of this file is not supported yet
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
188969
2802