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

react-hint

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-hint - npm Package Compare versions

Comparing version 3.1.0 to 3.1.1

1

lib/index.js

@@ -209,2 +209,3 @@ 'use strict';

},
role: 'tooltip',
style: { top: top, left: left } },

@@ -211,0 +212,0 @@ onRenderContent ? onRenderContent(target, content) : createElement(

4

package.json
{
"name": "react-hint",
"version": "3.1.0",
"version": "3.1.1",
"license": "MIT",

@@ -16,3 +16,3 @@ "description": "Tooltip component for React, Preact, Inferno",

"devDependencies": {
"nwb": "0.21.x",
"nwb": "0.22.x",
"react": "16.x",

@@ -19,0 +19,0 @@ "react-dom": "16.x"

@@ -184,2 +184,3 @@ export default ({Component, createElement}) =>

ref={(ref) => this._hint = ref}
role="tooltip"
style={{top, left}}>

@@ -186,0 +187,0 @@ {onRenderContent

/*!
* react-hint v3.1.0 - https://react-hint.js.org
* react-hint v3.1.1 - https://react-hint.js.org
* MIT Licensed

@@ -14,3 +14,3 @@ */

root["ReactHintFactory"] = factory();
})(typeof self !== 'undefined' ? self : this, function() {
})(window, function() {
return /******/ (function(modules) { // webpackBootstrap

@@ -62,2 +62,7 @@ /******/ // The module cache

/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules

@@ -78,4 +83,5 @@ /******/ __webpack_require__.n = function(module) {

/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ return __webpack_require__(__webpack_require__.s = 1);
/******/ })

@@ -85,13 +91,6 @@ /************************************************************************/

/* 0 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(1);
/***/ }),
/* 1 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
__webpack_require__.r(__webpack_exports__);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -301,2 +300,3 @@

},
role: 'tooltip',
style: { top: top, left: left } },

@@ -325,4 +325,11 @@ onRenderContent ? onRenderContent(target, content) : createElement(

/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(0);
/***/ })
/******/ ])["default"];
});

@@ -1,6 +0,2 @@

/*!
* react-hint v3.1.0 - https://react-hint.js.org
* MIT Licensed
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ReactHintFactory=e():t.ReactHintFactory=e()}("undefined"!=typeof self?self:this,function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:o})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){"use strict";function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e,n,r=t.Component,i=t.createElement;return n=e=function(t){function e(){var n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var i=arguments.length,u=Array(i),a=0;a<i;a++)u[a]=arguments[a];return n=r=o(this,t.call.apply(t,[this].concat(u))),r.state={target:null},r._containerStyle={position:"relative"},r.toggleEvents=function(t,e){var n=t.events,o=t.events,i=o.click,u=o.focus,a=o.hover,c=e?"addEventListener":"removeEventListener",s=!0===n;(i||s)&&document[c]("click",r.toggleHint),(u||s)&&document[c]("focusin",r.toggleHint),(a||s)&&document[c]("mouseover",r.toggleHint),(i||a||s)&&document[c]("touchend",r.toggleHint)},r.toggleHint=function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,e=void 0===t?null:t;clearTimeout(r._timeout),r._timeout=setTimeout(function(){return r.setState(function(){return{target:r.getHint(e)}})},r.props.delay)},r.getHint=function(t){for(var e=r.props,n=e.attribute,o=e.persist,i=r.state.target;t&&t!==document;){if(o&&t===r._hint)return i;if(t.hasAttribute(n))return t;t=t.parentNode}return null},r.shallowEqual=function(t,e){var n=Object.keys(t);return n.length===Object.keys(e).length&&n.reduce(function(n,o){return n&&("function"==typeof t[o]&&"function"==typeof e[o]||t[o]===e[o])},!0)},r.getHintData=function(t,e){var n=t.target,o=e.attribute,i=e.autoPosition,u=e.position,a=n.getAttribute(o)||"",c=n.getAttribute(o+"-at")||u,s=r._container.getBoundingClientRect(),l=s.top,f=s.left,p=r._hint.getBoundingClientRect(),h=p.width,d=p.height,g=n.getBoundingClientRect(),m=g.top,b=g.left,y=g.width,v=g.height;if(i){var _=["left","right"].includes(c),w=document.documentElement,E=w.clientHeight,j=w.clientWidth,H={left:(_?b-h:b+(y-h>>1))>0,right:(_?b+y+h:b+(y+h>>1))<j,bottom:(_?m+(v+d>>1):m+v+d)<E,top:(_?m-(d>>1):m-d)>0};switch(c){case"left":H.left||(c="right"),H.top||(c="bottom"),H.bottom||(c="top");break;case"right":H.right||(c="left"),H.top||(c="bottom"),H.bottom||(c="top");break;case"bottom":H.bottom||(c="top"),H.left||(c="right"),H.right||(c="left");break;case"top":default:H.top||(c="bottom"),H.left||(c="right"),H.right||(c="left")}}var x=void 0,O=void 0;switch(c){case"left":x=v-d>>1,O=-h;break;case"right":x=v-d>>1,O=y;break;case"bottom":x=v,O=y-h>>1;break;case"top":default:x=-d,O=y-h>>1}return{content:a,at:c,top:x+m-l|0,left:O+b-f|0}},o(r,n)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidMount=function(){this.toggleEvents(this.props,!0)},e.prototype.componentWillUnmount=function(){this.toggleEvents(this.props,!1),clearTimeout(this._timeout)},e.prototype.shouldComponentUpdate=function(t,e){return!this.shallowEqual(e,this.state)||!this.shallowEqual(t,this.props)},e.prototype.componentDidUpdate=function(){this.state.target&&this.setState(this.getHintData)},e.prototype.render=function(){var t=this,e=this.props,n=e.className,o=e.onRenderContent,r=this.state,u=r.target,a=r.content,c=r.at,s=r.top,l=r.left;return i("div",{ref:function(e){return t._container=e},style:this._containerStyle},u&&i("div",{className:n+" "+n+"--"+c,ref:function(e){return t._hint=e},style:{top:s,left:l}},o?o(u,a):i("div",{className:n+"__content"},a)))},e}(r),e.defaultProps={attribute:"data-rh",autoPosition:!1,className:"react-hint",delay:0,events:!1,onRenderContent:null,persist:!1,position:"top"},n}}]).default});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ReactHintFactory=e():t.ReactHintFactory=e()}(window,function(){return function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},o.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=1)}([function(t,e,o){"use strict";function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}o.r(e),e.default=function(t){var e,o,r=t.Component,i=t.createElement;return o=e=function(t){function e(){var o,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var i=arguments.length,u=Array(i),a=0;a<i;a++)u[a]=arguments[a];return o=r=n(this,t.call.apply(t,[this].concat(u))),r.state={target:null},r._containerStyle={position:"relative"},r.toggleEvents=function(t,e){var o=t.events,n=t.events,i=n.click,u=n.focus,a=n.hover,c=e?"addEventListener":"removeEventListener",s=!0===o;(i||s)&&document[c]("click",r.toggleHint),(u||s)&&document[c]("focusin",r.toggleHint),(a||s)&&document[c]("mouseover",r.toggleHint),(i||a||s)&&document[c]("touchend",r.toggleHint)},r.toggleHint=function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,e=void 0===t?null:t;clearTimeout(r._timeout),r._timeout=setTimeout(function(){return r.setState(function(){return{target:r.getHint(e)}})},r.props.delay)},r.getHint=function(t){for(var e=r.props,o=e.attribute,n=e.persist,i=r.state.target;t&&t!==document;){if(n&&t===r._hint)return i;if(t.hasAttribute(o))return t;t=t.parentNode}return null},r.shallowEqual=function(t,e){var o=Object.keys(t);return o.length===Object.keys(e).length&&o.reduce(function(o,n){return o&&("function"==typeof t[n]&&"function"==typeof e[n]||t[n]===e[n])},!0)},r.getHintData=function(t,e){var o=t.target,n=e.attribute,i=e.autoPosition,u=e.position,a=o.getAttribute(n)||"",c=o.getAttribute(n+"-at")||u,s=r._container.getBoundingClientRect(),l=s.top,f=s.left,p=r._hint.getBoundingClientRect(),h=p.width,d=p.height,g=o.getBoundingClientRect(),m=g.top,b=g.left,y=g.width,v=g.height;if(i){var _=["left","right"].includes(c),w=document.documentElement,E=w.clientHeight,j=w.clientWidth,H={left:(_?b-h:b+(y-h>>1))>0,right:(_?b+y+h:b+(y+h>>1))<j,bottom:(_?m+(v+d>>1):m+v+d)<E,top:(_?m-(d>>1):m-d)>0};switch(c){case"left":H.left||(c="right"),H.top||(c="bottom"),H.bottom||(c="top");break;case"right":H.right||(c="left"),H.top||(c="bottom"),H.bottom||(c="top");break;case"bottom":H.bottom||(c="top"),H.left||(c="right"),H.right||(c="left");break;case"top":default:H.top||(c="bottom"),H.left||(c="right"),H.right||(c="left")}}var x=void 0,O=void 0;switch(c){case"left":x=v-d>>1,O=-h;break;case"right":x=v-d>>1,O=y;break;case"bottom":x=v,O=y-h>>1;break;case"top":default:x=-d,O=y-h>>1}return{content:a,at:c,top:x+m-l|0,left:O+b-f|0}},n(r,o)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentDidMount=function(){this.toggleEvents(this.props,!0)},e.prototype.componentWillUnmount=function(){this.toggleEvents(this.props,!1),clearTimeout(this._timeout)},e.prototype.shouldComponentUpdate=function(t,e){return!this.shallowEqual(e,this.state)||!this.shallowEqual(t,this.props)},e.prototype.componentDidUpdate=function(){this.state.target&&this.setState(this.getHintData)},e.prototype.render=function(){var t=this,e=this.props,o=e.className,n=e.onRenderContent,r=this.state,u=r.target,a=r.content,c=r.at,s=r.top,l=r.left;return i("div",{ref:function(e){return t._container=e},style:this._containerStyle},u&&i("div",{className:o+" "+o+"--"+c,ref:function(e){return t._hint=e},role:"tooltip",style:{top:s,left:l}},n?n(u,a):i("div",{className:o+"__content"},a)))},e}(r),e.defaultProps={attribute:"data-rh",autoPosition:!1,className:"react-hint",delay:0,events:!1,onRenderContent:null,persist:!1,position:"top"},o}},function(t,e,o){t.exports=o(0)}]).default});
//# sourceMappingURL=react-hint.min.js.map

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