Socket
Socket
Sign inDemoInstall

@vx/tooltip

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vx/tooltip - npm Package Compare versions

Comparing version 0.0.143 to 0.0.147

14

build/tooltips/TooltipWithBounds.js

@@ -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 @@

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