react-overflow-tooltip
Advanced tools
Comparing version 1.0.2 to 2.0.0
@@ -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
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
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
7376
0
90
0
7
- Removedreact@*
- Removedjs-tokens@4.0.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedreact@18.3.1(transitive)