@vx/tooltip
Advanced tools
Comparing version 0.0.143 to 0.0.147
@@ -26,3 +26,6 @@ 'use strict'; | ||
var propTypes = _extends({}, _bounds.withBoundingRectsProps, _Tooltip2.default.propTypes); | ||
var propTypes = _extends({}, _bounds.withBoundingRectsProps, _Tooltip2.default.propTypes, { | ||
offsetLeft: _propTypes2.default.number, | ||
offsetTop: _propTypes2.default.number | ||
}); | ||
@@ -34,2 +37,6 @@ var defaultProps = {}; | ||
initialTop = _ref.top, | ||
_ref$offsetLeft = _ref.offsetLeft, | ||
offsetLeft = _ref$offsetLeft === undefined ? 10 : _ref$offsetLeft, | ||
_ref$offsetTop = _ref.offsetTop, | ||
offsetTop = _ref$offsetTop === undefined ? 10 : _ref$offsetTop, | ||
rect = _ref.rect, | ||
@@ -44,4 +51,5 @@ parentRect = _ref.parentRect, | ||
if (rect && parentRect) { | ||
left = rect.right > parentRect.right ? left - rect.width : left; | ||
top = rect.bottom > parentRect.bottom ? top - rect.height : top; | ||
left = offsetLeft + rect.right > parentRect.right ? left - rect.width - offsetLeft : left + offsetLeft; | ||
top = offsetTop + rect.bottom > parentRect.bottom ? top - rect.height - offsetTop : top + offsetTop; | ||
} | ||
@@ -48,0 +56,0 @@ |
{ | ||
"name": "@vx/tooltip", | ||
"version": "0.0.143", | ||
"version": "0.0.147", | ||
"description": "vx tooltip", | ||
@@ -29,3 +29,3 @@ "main": "build/index.js", | ||
"dependencies": { | ||
"@vx/bounds": "0.0.143", | ||
"@vx/bounds": "0.0.147", | ||
"classnames": "^2.2.5", | ||
@@ -32,0 +32,0 @@ "prop-types": "^15.5.10" |
@@ -11,2 +11,4 @@ /* eslint react/forbid-prop-types: 0 */ | ||
...Tooltip.propTypes, | ||
offsetLeft: PropTypes.number, | ||
offsetTop: PropTypes.number, | ||
}; | ||
@@ -19,2 +21,4 @@ | ||
top: initialTop, | ||
offsetLeft = 10, | ||
offsetTop = 10, | ||
rect, | ||
@@ -29,4 +33,7 @@ parentRect, | ||
if (rect && parentRect) { | ||
left = rect.right > parentRect.right ? (left - rect.width) : left; | ||
top = rect.bottom > parentRect.bottom ? (top - rect.height) : top; | ||
left = (offsetLeft + rect.right) > parentRect.right | ||
? (left - rect.width - offsetLeft) : left + offsetLeft; | ||
top = (offsetTop + rect.bottom) > parentRect.bottom | ||
? (top - rect.height - offsetTop) : top + offsetTop; | ||
} | ||
@@ -33,0 +40,0 @@ |
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
16302
378
+ Added@vx/bounds@0.0.147(transitive)
- Removed@vx/bounds@0.0.143(transitive)
Updated@vx/bounds@0.0.147