Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-overflow-tooltip

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-overflow-tooltip - npm Package Compare versions

Comparing version 1.0.2 to 2.0.0

11

lib/index.js

@@ -9,3 +9,3 @@ 'use strict';

var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };

@@ -22,2 +22,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

var _reactDom = require('react-dom');
var _reactDom2 = _interopRequireDefault(_reactDom);
function isTextOverflow(element) {

@@ -58,3 +62,3 @@ return element.clientWidth < element.scrollWidth;

value: function checkOverflow() {
var element = _react2['default'].findDOMNode(this);
var element = _reactDom2['default'].findDOMNode(this);

@@ -85,4 +89,5 @@ var overflow = isTextOverflow(element);

OverflowTooltip.propTypes = {
title: _react2['default'].PropTypes.string.isRequired
title: _react2['default'].PropTypes.string.isRequired,
children: _react2['default'].PropTypes.node.isRequired
};
module.exports = exports['default'];
{
"name": "react-overflow-tooltip",
"description": "A React component that shows a tooltip only if the text is overflow",
"version": "1.0.2",
"version": "2.0.0",
"author": "Kazato Sugimoto <uiureo@gmail.com>",

@@ -10,6 +10,9 @@ "bugs": {

"devDependencies": {
"ava": "^0.5.0",
"babel": "^5.8.21",
"standard": "*",
"tap-spec": "^4.0.2",
"tape": "^4.0.0"
"babel-core": "^5.8.34",
"jsdom": "^7.0.2",
"react": "^0.14.3",
"react-dom": "^0.14.3",
"standard": "*"
},

@@ -28,9 +31,6 @@ "homepage": "https://github.com/uiureo/react-overflow-tooltip",

"scripts": {
"test": "standard && tape test/*.js | tap-spec",
"test": "standard && ava",
"build": "babel src -d lib",
"prepublish": "npm run build"
},
"dependencies": {
"react": "*"
}
}

@@ -1,9 +0,26 @@

require('babel/register')
require('babel-core/register')
var OverflowTooltip = require('../src/index.js')
var test = require('tape')
const test = require('ava')
const jsdom = require('jsdom').jsdom
test(function (t) {
t.ok(OverflowTooltip)
const React = require('react')
const ReactDOM = require('react-dom')
const OverflowTooltip = require('../src/index.js')
global.document = jsdom()
global.window = document.defaultView
test((t) => {
const container = document.createElement('div')
ReactDOM.render(
<OverflowTooltip title='too long text...'>
<div>too long text</div>
</OverflowTooltip>,
container
)
t.true(/too long text/.test(container.textContent))
t.end()
})

Sorry, the diff of this file is not supported yet

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