Launch Week Day 5: Introducing Reachability for PHP.Learn More
Socket
Book a DemoSign in
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
1.0.0
to
1.0.1
+5
-5
lib/index.js

@@ -88,2 +88,4 @@ 'use strict';

}
}, _this.setHintRef = function (ref) {
_this._hint = ref;
}, _this.onHover = function (_ref) {

@@ -115,7 +117,5 @@ var target = _ref.target;

var target = this.state.target;
var hint = this.refs.hint;
if (!target || !hint) return;
this.setState(this.getHintPosition(hint, target));
if (!target || !this._hint) return;
this.setState(this.getHintPosition(this._hint, target));
};

@@ -141,3 +141,3 @@

style: { top: top, left: left },
ref: 'hint' },
ref: this.setHintRef },
_react2.default.createElement(

@@ -144,0 +144,0 @@ 'div',

{
"name": "react-hint",
"version": "1.0.0",
"version": "1.0.1",
"description": "a simple tooltip component for React",

@@ -32,2 +32,3 @@ "author": "Vladimir Simonov <slmgc@ya.ru>",

"keywords": [
"inferno",
"preact",

@@ -34,0 +35,0 @@ "react",

react-hint
==========
**react-hint** is a small tooltip component for [React](https://github.com/facebook/react) which is developed with simplicity and performance in mind. It doesn't include any fancy stuff, but it gets the job done. It also plays nicely with [Preact](https://github.com/developit/preact).
**react-hint** is a small tooltip component for [React](https://github.com/facebook/react) which is developed with simplicity and performance in mind. It doesn't include any fancy stuff, but it gets the job done. It also plays nicely with [Preact](https://github.com/developit/preact) and [Inferno](https://github.com/trueadm/inferno) (1.0.0-beta3).

@@ -15,2 +15,5 @@ ![react-hint tooltip](demo/react-hint.gif)

----------
`<ReactHint />` is a singleton component which should be placed in the root component. To show a tooltip on any DOM element and its children add `data-rh` attribute to the element. The default placement of a tooltip is at the top, but you can add `data-rh-at` attribute to change the placement. Supported values are: `top`, `left`, `right`, `bottom`. You can completely override tooltip style by passing `className` property to `<ReactHint />`.
```jsx

@@ -17,0 +20,0 @@ import React from 'react'

@@ -42,6 +42,4 @@ import React from 'react'

const {target} = this.state
const {hint} = this.refs
if (!target || !hint) return
this.setState(this.getHintPosition(hint, target))
if (!target || !this._hint) return
this.setState(this.getHintPosition(this._hint, target))
}

@@ -95,2 +93,6 @@

setHintRef = (ref) => {
this._hint = ref
}
onHover = ({target}) => {

@@ -107,3 +109,3 @@ this.setState({target: this.findHint(target)})

style={{top, left}}
ref="hint">
ref={this.setHintRef}>
<div className={`${className}__content`}>

@@ -110,0 +112,0 @@ {target.getAttribute('data-rh')}

/*!
* react-hint v1.0.0 - https://github.com/slmgc/react-hint
* react-hint v1.0.1 - https://github.com/slmgc/react-hint
* MIT Licensed

@@ -157,2 +157,4 @@ */

}
}, _this.setHintRef = function (ref) {
_this._hint = ref;
}, _this.onHover = function (_ref) {

@@ -184,7 +186,5 @@ var target = _ref.target;

var target = this.state.target;
var hint = this.refs.hint;
if (!target || !hint) return;
this.setState(this.getHintPosition(hint, target));
if (!target || !this._hint) return;
this.setState(this.getHintPosition(this._hint, target));
};

@@ -210,5 +210,5 @@

style: { top: top, left: left },
ref: 'hint', __source: {
ref: this.setHintRef, __source: {
fileName: _jsxFileName,
lineNumber: 103
lineNumber: 105
},

@@ -221,3 +221,3 @@ __self: this

fileName: _jsxFileName,
lineNumber: 106
lineNumber: 108
},

@@ -224,0 +224,0 @@ __self: this

/*!
* react-hint v1.0.0 - https://github.com/slmgc/react-hint
* react-hint v1.0.1 - https://github.com/slmgc/react-hint
* MIT Licensed
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.ReactHint=e(require("react")):t.ReactHint=e(t.React)}(this,function(t){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(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}function i(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.__esModule=!0,e.default=void 0;var s,u,c=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),f=n(2),l=o(f),p=(u=s=function(t){function e(){var n,o,i;r(this,e);for(var s=arguments.length,u=Array(s),c=0;c<s;c++)u[c]=arguments[c];return n=o=a(this,t.call.apply(t,[this].concat(u))),o.state={target:null,at:"top",top:0,left:0},o.findHint=function(t){for(;t&&t!==document;){if(t.hasAttribute("data-rh"))return t;t=t.parentNode}return null},o.getHintPosition=function(t,e){var n=t.offsetWidth,o=t.offsetHeight,r=e.getBoundingClientRect(),a=r.width,i=r.height,s=r.top,u=r.left,c=e.getAttribute("data-rh-at");switch(c){case"left":return{at:c,top:s+(i-o>>1),left:u-n};case"right":return{at:c,top:s+(i-o>>1),left:u+a};case"bottom":return{at:c,top:s+i,left:u+(a-n>>1)};case"top":default:return{at:"top",top:s-o,left:u+(a-n>>1)}}},o.onHover=function(t){var e=t.target;o.setState({target:o.findHint(e)})},i=n,a(o,i)}return i(e,t),e.prototype.shouldComponentUpdate=function(t,e){var n=t.className,o=e.target,r=e.at,a=e.top,i=e.left,s=this.props,u=this.state;return o!==u.target||r!==u.at||Math.abs(a-u.top)>1||Math.abs(i-u.left)>1||n!==s.className},e.prototype.componentDidMount=function(){e.instance=this,document.addEventListener("mouseover",this.onHover)},e.prototype.componentDidUpdate=function(){var t=this.state.target,e=this.refs.hint;t&&e&&this.setState(this.getHintPosition(e,t))},e.prototype.componentWillUnmout=function(){e.instance=null,document.removeEventListener("mouseover",this.onHover)},e.prototype.render=function(){var t=this.props.className,e=this.state,n=e.target,o=e.at,r=e.top,a=e.left;return n&&l.default.createElement("div",{className:t+" "+t+"--"+o,style:{top:r,left:a},ref:"hint"},l.default.createElement("div",{className:t+"__content"},n.getAttribute("data-rh")))},c(e,null,[{key:"instance",get:function(){return e._instance},set:function(t){if(e._instance)throw new Error("Only one instance of ReactHint is allowed.");e._instance=t}}]),e}(l.default.Component),s._instance=null,s.defaultProps={className:"react-hint"},u);e.default=p},function(e,n){e.exports=t}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.ReactHint=e(require("react")):t.ReactHint=e(t.React)}(this,function(t){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(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}function a(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.__esModule=!0,e.default=void 0;var s,u,c=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),f=n(2),l=o(f),p=(u=s=function(t){function e(){var n,o,a;r(this,e);for(var s=arguments.length,u=Array(s),c=0;c<s;c++)u[c]=arguments[c];return n=o=i(this,t.call.apply(t,[this].concat(u))),o.state={target:null,at:"top",top:0,left:0},o.findHint=function(t){for(;t&&t!==document;){if(t.hasAttribute("data-rh"))return t;t=t.parentNode}return null},o.getHintPosition=function(t,e){var n=t.offsetWidth,o=t.offsetHeight,r=e.getBoundingClientRect(),i=r.width,a=r.height,s=r.top,u=r.left,c=e.getAttribute("data-rh-at");switch(c){case"left":return{at:c,top:s+(a-o>>1),left:u-n};case"right":return{at:c,top:s+(a-o>>1),left:u+i};case"bottom":return{at:c,top:s+a,left:u+(i-n>>1)};case"top":default:return{at:"top",top:s-o,left:u+(i-n>>1)}}},o.setHintRef=function(t){o._hint=t},o.onHover=function(t){var e=t.target;o.setState({target:o.findHint(e)})},a=n,i(o,a)}return a(e,t),e.prototype.shouldComponentUpdate=function(t,e){var n=t.className,o=e.target,r=e.at,i=e.top,a=e.left,s=this.props,u=this.state;return o!==u.target||r!==u.at||Math.abs(i-u.top)>1||Math.abs(a-u.left)>1||n!==s.className},e.prototype.componentDidMount=function(){e.instance=this,document.addEventListener("mouseover",this.onHover)},e.prototype.componentDidUpdate=function(){var t=this.state.target;t&&this._hint&&this.setState(this.getHintPosition(this._hint,t))},e.prototype.componentWillUnmout=function(){e.instance=null,document.removeEventListener("mouseover",this.onHover)},e.prototype.render=function(){var t=this.props.className,e=this.state,n=e.target,o=e.at,r=e.top,i=e.left;return n&&l.default.createElement("div",{className:t+" "+t+"--"+o,style:{top:r,left:i},ref:this.setHintRef},l.default.createElement("div",{className:t+"__content"},n.getAttribute("data-rh")))},c(e,null,[{key:"instance",get:function(){return e._instance},set:function(t){if(e._instance)throw new Error("Only one instance of ReactHint is allowed.");e._instance=t}}]),e}(l.default.Component),s._instance=null,s.defaultProps={className:"react-hint"},u);e.default=p},function(e,n){e.exports=t}])});
//# sourceMappingURL=react-hint.min.js.map

@@ -1,1 +0,1 @@

{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///react-hint.min.js","webpack:///webpack/bootstrap 79fed93a7d5f15646e9a","webpack:///./src/index.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_2__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","_interopRequireDefault","obj","__esModule","default","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","prototype","Object","create","constructor","value","enumerable","writable","configurable","setPrototypeOf","__proto__","undefined","_class","_temp2","_createClass","defineProperties","target","props","i","length","descriptor","defineProperty","key","protoProps","staticProps","_react","_react2","ReactHint","_React$Component","_temp","_this","_ret","_len","arguments","args","Array","_key","apply","concat","state","at","top","left","findHint","el","document","hasAttribute","parentNode","getHintPosition","hint","offsetWidth","offsetHeight","_target$getBoundingCl","getBoundingClientRect","width","height","getAttribute","onHover","_ref","setState","shouldComponentUpdate","_ref2","_ref3","className","Math","abs","componentDidMount","addEventListener","componentDidUpdate","refs","componentWillUnmout","removeEventListener","render","_state","createElement","style","ref","get","_instance","set","Error","Component","defaultProps"],"mappings":";;;;CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,UACA,kBAAAC,gBAAAC,IACAD,QAAA,SAAAJ,GACA,gBAAAC,SACAA,QAAA,UAAAD,EAAAG,QAAA,UAEAJ,EAAA,UAAAC,EAAAD,EAAA,QACCO,KAAA,SAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAT,OAGA,IAAAC,GAAAS,EAAAD,IACAT,WACAW,GAAAF,EAC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,IACNU,EAAApC,QAAAoF,cAAA,OAAKX,UAAcA,EAAd,IAA2BA,EAA3B,KAAyCvB,EAC7CmC,OAAQlC,MAAKC,QACbkC,IAAI,QACHlD,EAAApC,QAAAoF,cAAA,OAAKX,UAAcA,EAAd,aACH/C,EAAOwC,aAAa,cFwGzB1C,EAAaa,EAAW,OACvBL,IAAK,WACLuD,IAAK,WE9MN,MAAOlD,GAAUmD,WFiNhBC,IAAK,SE9MavF,GACnB,GAAImC,EAAUmD,UAAW,KAAM,IAAIE,OAAM,6CACzCrD,GAAUmD,UAAYtF,MFkNfmC,GE3N8BD,EAAApC,QAAM2F,WF4NdrE,EE3NvBkE,UAAY,KF2NoClE,EEhNhDsE,cACNnB,UAAW,cFiNTlD,EACH3C,GAAQoB,QE/NYqC,GFmOf,SAASxD,EAAQD,GGrOvBC,EAAAD,QAAAM","file":"react-hint.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ReactHint\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"ReactHint\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ReactHint\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"ReactHint\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(1);\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\texports.default = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _class, _temp2;\n\t\n\tvar _react = __webpack_require__(2);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar ReactHint = (_temp2 = _class = function (_React$Component) {\n\t\t_inherits(ReactHint, _React$Component);\n\t\n\t\tfunction ReactHint() {\n\t\t\tvar _temp, _this, _ret;\n\t\n\t\t\t_classCallCheck(this, ReactHint);\n\t\n\t\t\tfor (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t\t\t\targs[_key] = arguments[_key];\n\t\t\t}\n\t\n\t\t\treturn _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {\n\t\t\t\ttarget: null,\n\t\t\t\tat: 'top',\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0\n\t\t\t}, _this.findHint = function (el) {\n\t\t\t\twhile (el) {\n\t\t\t\t\tif (el === document) break;\n\t\t\t\t\tif (el.hasAttribute('data-rh')) return el;\n\t\t\t\t\tel = el.parentNode;\n\t\t\t\t}return null;\n\t\t\t}, _this.getHintPosition = function (hint, target) {\n\t\t\t\tvar offsetWidth = hint.offsetWidth;\n\t\t\t\tvar offsetHeight = hint.offsetHeight;\n\t\n\t\t\t\tvar _target$getBoundingCl = target.getBoundingClientRect();\n\t\n\t\t\t\tvar width = _target$getBoundingCl.width;\n\t\t\t\tvar height = _target$getBoundingCl.height;\n\t\t\t\tvar top = _target$getBoundingCl.top;\n\t\t\t\tvar left = _target$getBoundingCl.left;\n\t\n\t\t\t\tvar at = target.getAttribute('data-rh-at');\n\t\n\t\t\t\tswitch (at) {\n\t\t\t\t\tcase 'left':\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tat: at,\n\t\t\t\t\t\t\ttop: top + (height - offsetHeight >> 1),\n\t\t\t\t\t\t\tleft: left - offsetWidth\n\t\t\t\t\t\t};\n\t\n\t\t\t\t\tcase 'right':\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tat: at,\n\t\t\t\t\t\t\ttop: top + (height - offsetHeight >> 1),\n\t\t\t\t\t\t\tleft: left + width\n\t\t\t\t\t\t};\n\t\n\t\t\t\t\tcase 'bottom':\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tat: at,\n\t\t\t\t\t\t\ttop: top + height,\n\t\t\t\t\t\t\tleft: left + (width - offsetWidth >> 1)\n\t\t\t\t\t\t};\n\t\n\t\t\t\t\tcase 'top':\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tat: 'top',\n\t\t\t\t\t\t\ttop: top - offsetHeight,\n\t\t\t\t\t\t\tleft: left + (width - offsetWidth >> 1)\n\t\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}, _this.onHover = function (_ref) {\n\t\t\t\tvar target = _ref.target;\n\t\n\t\t\t\t_this.setState({ target: _this.findHint(target) });\n\t\t\t}, _temp), _possibleConstructorReturn(_this, _ret);\n\t\t}\n\t\n\t\tReactHint.prototype.shouldComponentUpdate = function shouldComponentUpdate(_ref2, _ref3) {\n\t\t\tvar className = _ref2.className;\n\t\t\tvar target = _ref3.target;\n\t\t\tvar at = _ref3.at;\n\t\t\tvar top = _ref3.top;\n\t\t\tvar left = _ref3.left;\n\t\t\tvar props = this.props;\n\t\t\tvar state = this.state;\n\t\n\t\t\treturn target !== state.target || at !== state.at || Math.abs(top - state.top) > 1 || Math.abs(left - state.left) > 1 || className !== props.className;\n\t\t};\n\t\n\t\tReactHint.prototype.componentDidMount = function componentDidMount() {\n\t\t\tReactHint.instance = this;\n\t\t\tdocument.addEventListener('mouseover', this.onHover);\n\t\t};\n\t\n\t\tReactHint.prototype.componentDidUpdate = function componentDidUpdate() {\n\t\t\tvar target = this.state.target;\n\t\t\tvar hint = this.refs.hint;\n\t\n\t\n\t\t\tif (!target || !hint) return;\n\t\t\tthis.setState(this.getHintPosition(hint, target));\n\t\t};\n\t\n\t\tReactHint.prototype.componentWillUnmout = function componentWillUnmout() {\n\t\t\tReactHint.instance = null;\n\t\t\tdocument.removeEventListener('mouseover', this.onHover);\n\t\t};\n\t\n\t\tReactHint.prototype.render = function render() {\n\t\t\tvar className = this.props.className;\n\t\t\tvar _state = this.state;\n\t\t\tvar target = _state.target;\n\t\t\tvar at = _state.at;\n\t\t\tvar top = _state.top;\n\t\t\tvar left = _state.left;\n\t\n\t\n\t\t\treturn target && _react2.default.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ className: className + ' ' + className + '--' + at,\n\t\t\t\t\tstyle: { top: top, left: left },\n\t\t\t\t\tref: 'hint' },\n\t\t\t\t_react2.default.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: className + '__content' },\n\t\t\t\t\ttarget.getAttribute('data-rh')\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\n\t\t_createClass(ReactHint, null, [{\n\t\t\tkey: 'instance',\n\t\t\tget: function get() {\n\t\t\t\treturn ReactHint._instance;\n\t\t\t},\n\t\t\tset: function set(instance) {\n\t\t\t\tif (ReactHint._instance) throw new Error('Only one instance of ReactHint is allowed.');\n\t\t\t\tReactHint._instance = instance;\n\t\t\t}\n\t\t}]);\n\t\n\t\treturn ReactHint;\n\t}(_react2.default.Component), _class._instance = null, _class.defaultProps = {\n\t\tclassName: 'react-hint'\n\t}, _temp2);\n\texports.default = ReactHint;\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** react-hint.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 79fed93a7d5f15646e9a\n **/","import React from 'react'\n\nexport default class ReactHint extends React.Component {\n\tstatic _instance = null\n\n\tstatic get instance() {\n\t\treturn ReactHint._instance\n\t}\n\n\tstatic set instance(instance) {\n\t\tif (ReactHint._instance) throw new Error('Only one instance of ReactHint is allowed.')\n\t\tReactHint._instance = instance\n\t}\n\n\tstatic defaultProps = {\n\t\tclassName: 'react-hint'\n\t}\n\n\tstate = {\n\t\ttarget: null,\n\t\tat: 'top',\n\t\ttop: 0,\n\t\tleft: 0\n\t}\n\n\tshouldComponentUpdate({className}, {target, at, top, left}) {\n\t\tconst {props, state} = this\n\t\treturn target !== state.target\n\t\t\t|| at !== state.at\n\t\t\t|| Math.abs(top - state.top) > 1\n\t\t\t|| Math.abs(left - state.left) > 1\n\t\t\t|| className !== props.className\n\t}\n\n\tcomponentDidMount() {\n\t\tReactHint.instance = this\n\t\tdocument.addEventListener('mouseover', this.onHover)\n\t}\n\n\tcomponentDidUpdate() {\n\t\tconst {target} = this.state\n\t\tconst {hint} = this.refs\n\n\t\tif (!target || !hint) return\n\t\tthis.setState(this.getHintPosition(hint, target))\n\t}\n\n\tcomponentWillUnmout() {\n\t\tReactHint.instance = null\n\t\tdocument.removeEventListener('mouseover', this.onHover)\n\t}\n\n\tfindHint = (el) => {\n\t\twhile (el) {\n\t\t\tif (el === document) break\n\t\t\tif (el.hasAttribute('data-rh')) return el\n\t\t\tel = el.parentNode\n\t\t} return null\n\t}\n\n\tgetHintPosition = (hint, target) => {\n\t\tconst {offsetWidth, offsetHeight} = hint\n\t\tconst {width, height, top, left} = target.getBoundingClientRect()\n\t\tconst at = target.getAttribute('data-rh-at')\n\n\t\tswitch (at) {\n\t\t\tcase 'left': return {\n\t\t\t\tat,\n\t\t\t\ttop: top + (height - offsetHeight >> 1),\n\t\t\t\tleft: left - offsetWidth\n\t\t\t}\n\n\t\t\tcase 'right': return {\n\t\t\t\tat,\n\t\t\t\ttop: top + (height - offsetHeight >> 1),\n\t\t\t\tleft: left + width\n\t\t\t}\n\n\t\t\tcase 'bottom': return {\n\t\t\t\tat,\n\t\t\t\ttop: top + height,\n\t\t\t\tleft: left + (width - offsetWidth >> 1)\n\t\t\t}\n\n\t\t\tcase 'top':\n\t\t\tdefault: return {\n\t\t\t\tat: 'top',\n\t\t\t\ttop: top - offsetHeight,\n\t\t\t\tleft: left + (width - offsetWidth >> 1)\n\t\t\t}\n\t\t}\n\t}\n\n\tonHover = ({target}) => {\n\t\tthis.setState({target: this.findHint(target)})\n\t}\n\n\trender() {\n\t\tconst {className} = this.props\n\t\tconst {target, at, top, left} = this.state\n\n\t\treturn target &&\n\t\t\t<div className={`${className} ${className}--${at}`}\n\t\t\t\tstyle={{top, left}}\n\t\t\t\tref=\"hint\">\n\t\t\t\t\t<div className={`${className}__content`}>\n\t\t\t\t\t\t{target.getAttribute('data-rh')}\n\t\t\t\t\t</div>\n\t\t\t</div>\n\t}\n}\n\n\n/** WEBPACK FOOTER **\n ** ./src/index.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n ** module id = 2\n ** module chunks = 0\n **/"],"sourceRoot":""}
{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///react-hint.min.js","webpack:///webpack/bootstrap 1292235d0d6b9d457d8e","webpack:///./src/index.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_2__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","_interopRequireDefault","obj","__esModule","default","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","prototype","Object","create","constructor","value","enumerable","writable","configurable","setPrototypeOf","__proto__","undefined","_class","_temp2","_createClass","defineProperties","target","props","i","length","descriptor","defineProperty","key","protoProps","staticProps","_react","_react2","ReactHint","_React$Component","_temp","_this","_ret","_len","arguments","args","Array","_key","apply","concat","state","at","top","left","findHint","el","document","hasAttribute","parentNode","getHintPosition","hint","offsetWidth","offsetHeight","_target$getBoundingCl","getBoundingClientRect","width","height","getAttribute","setHintRef","ref","_hint","onHover","_ref","setState","shouldComponentUpdate","_ref2","_ref3","className","Math","abs","componentDidMount","addEventListener","componentDidUpdate","componentWillUnmout","removeEventListener","render","_state","createElement","style","get","_instance","set","Error","Component","defaultProps"],"mappings":";;;;CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,UACA,kBAAAC,gBAAAC,IACAD,QAAA,SAAAJ,G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AUnC,SAAW,KACrBqD,SAAS4B,oBAAoB,YAAalG,KAAKqF,UF6I/CjC,EAAU1B,UEzFXyE,OFyF8B,WEzFrB,GACDR,GAAa3F,KAAK0C,MAAlBiD,UADCS,EAEwBpG,KAAKgE,MAA9BvB,EAFC2D,EAED3D,OAAQwB,EAFPmC,EAEOnC,GAAIC,EAFXkC,EAEWlC,IAAKC,EAFhBiC,EAEgBjC,IAExB,OAAO1B,IACNU,EAAApC,QAAAsF,cAAA,OAAKV,UAAcA,EAAd,IAA2BA,EAA3B,KAAyC1B,EAC7CqC,OAAQpC,MAAKC,QACbgB,IAAKnF,KAAKkF,YACT/B,EAAApC,QAAAsF,cAAA,OAAKV,UAAcA,EAAd,aACHlD,EAAOwC,aAAa,cFsGzB1C,EAAaa,EAAW,OACvBL,IAAK,WACLwD,IAAK,WE9MN,MAAOnD,GAAUoD,WFiNhBC,IAAK,SE9MaxF,GACnB,GAAImC,EAAUoD,UAAW,KAAM,IAAIE,OAAM,6CACzCtD,GAAUoD,UAAYvF,MFkNfmC,GE3N8BD,EAAApC,QAAM4F,WF4NdtE,EE3NvBmE,UAAY,KF2NoCnE,EEhNhDuE,cACNjB,UAAW,cFiNTrD,EACH3C,GAAQoB,QE/NYqC,GFmOf,SAASxD,EAAQD,GGrOvBC,EAAAD,QAAAM","file":"react-hint.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ReactHint\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"ReactHint\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ReactHint\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"ReactHint\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(1);\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\texports.default = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _class, _temp2;\n\t\n\tvar _react = __webpack_require__(2);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar ReactHint = (_temp2 = _class = function (_React$Component) {\n\t\t_inherits(ReactHint, _React$Component);\n\t\n\t\tfunction ReactHint() {\n\t\t\tvar _temp, _this, _ret;\n\t\n\t\t\t_classCallCheck(this, ReactHint);\n\t\n\t\t\tfor (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t\t\t\targs[_key] = arguments[_key];\n\t\t\t}\n\t\n\t\t\treturn _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {\n\t\t\t\ttarget: null,\n\t\t\t\tat: 'top',\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0\n\t\t\t}, _this.findHint = function (el) {\n\t\t\t\twhile (el) {\n\t\t\t\t\tif (el === document) break;\n\t\t\t\t\tif (el.hasAttribute('data-rh')) return el;\n\t\t\t\t\tel = el.parentNode;\n\t\t\t\t}return null;\n\t\t\t}, _this.getHintPosition = function (hint, target) {\n\t\t\t\tvar offsetWidth = hint.offsetWidth;\n\t\t\t\tvar offsetHeight = hint.offsetHeight;\n\t\n\t\t\t\tvar _target$getBoundingCl = target.getBoundingClientRect();\n\t\n\t\t\t\tvar width = _target$getBoundingCl.width;\n\t\t\t\tvar height = _target$getBoundingCl.height;\n\t\t\t\tvar top = _target$getBoundingCl.top;\n\t\t\t\tvar left = _target$getBoundingCl.left;\n\t\n\t\t\t\tvar at = target.getAttribute('data-rh-at');\n\t\n\t\t\t\tswitch (at) {\n\t\t\t\t\tcase 'left':\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tat: at,\n\t\t\t\t\t\t\ttop: top + (height - offsetHeight >> 1),\n\t\t\t\t\t\t\tleft: left - offsetWidth\n\t\t\t\t\t\t};\n\t\n\t\t\t\t\tcase 'right':\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tat: at,\n\t\t\t\t\t\t\ttop: top + (height - offsetHeight >> 1),\n\t\t\t\t\t\t\tleft: left + width\n\t\t\t\t\t\t};\n\t\n\t\t\t\t\tcase 'bottom':\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tat: at,\n\t\t\t\t\t\t\ttop: top + height,\n\t\t\t\t\t\t\tleft: left + (width - offsetWidth >> 1)\n\t\t\t\t\t\t};\n\t\n\t\t\t\t\tcase 'top':\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tat: 'top',\n\t\t\t\t\t\t\ttop: top - offsetHeight,\n\t\t\t\t\t\t\tleft: left + (width - offsetWidth >> 1)\n\t\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}, _this.setHintRef = function (ref) {\n\t\t\t\t_this._hint = ref;\n\t\t\t}, _this.onHover = function (_ref) {\n\t\t\t\tvar target = _ref.target;\n\t\n\t\t\t\t_this.setState({ target: _this.findHint(target) });\n\t\t\t}, _temp), _possibleConstructorReturn(_this, _ret);\n\t\t}\n\t\n\t\tReactHint.prototype.shouldComponentUpdate = function shouldComponentUpdate(_ref2, _ref3) {\n\t\t\tvar className = _ref2.className;\n\t\t\tvar target = _ref3.target;\n\t\t\tvar at = _ref3.at;\n\t\t\tvar top = _ref3.top;\n\t\t\tvar left = _ref3.left;\n\t\t\tvar props = this.props;\n\t\t\tvar state = this.state;\n\t\n\t\t\treturn target !== state.target || at !== state.at || Math.abs(top - state.top) > 1 || Math.abs(left - state.left) > 1 || className !== props.className;\n\t\t};\n\t\n\t\tReactHint.prototype.componentDidMount = function componentDidMount() {\n\t\t\tReactHint.instance = this;\n\t\t\tdocument.addEventListener('mouseover', this.onHover);\n\t\t};\n\t\n\t\tReactHint.prototype.componentDidUpdate = function componentDidUpdate() {\n\t\t\tvar target = this.state.target;\n\t\n\t\t\tif (!target || !this._hint) return;\n\t\t\tthis.setState(this.getHintPosition(this._hint, target));\n\t\t};\n\t\n\t\tReactHint.prototype.componentWillUnmout = function componentWillUnmout() {\n\t\t\tReactHint.instance = null;\n\t\t\tdocument.removeEventListener('mouseover', this.onHover);\n\t\t};\n\t\n\t\tReactHint.prototype.render = function render() {\n\t\t\tvar className = this.props.className;\n\t\t\tvar _state = this.state;\n\t\t\tvar target = _state.target;\n\t\t\tvar at = _state.at;\n\t\t\tvar top = _state.top;\n\t\t\tvar left = _state.left;\n\t\n\t\n\t\t\treturn target && _react2.default.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ className: className + ' ' + className + '--' + at,\n\t\t\t\t\tstyle: { top: top, left: left },\n\t\t\t\t\tref: this.setHintRef },\n\t\t\t\t_react2.default.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ className: className + '__content' },\n\t\t\t\t\ttarget.getAttribute('data-rh')\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\n\t\t_createClass(ReactHint, null, [{\n\t\t\tkey: 'instance',\n\t\t\tget: function get() {\n\t\t\t\treturn ReactHint._instance;\n\t\t\t},\n\t\t\tset: function set(instance) {\n\t\t\t\tif (ReactHint._instance) throw new Error('Only one instance of ReactHint is allowed.');\n\t\t\t\tReactHint._instance = instance;\n\t\t\t}\n\t\t}]);\n\t\n\t\treturn ReactHint;\n\t}(_react2.default.Component), _class._instance = null, _class.defaultProps = {\n\t\tclassName: 'react-hint'\n\t}, _temp2);\n\texports.default = ReactHint;\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** react-hint.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 1292235d0d6b9d457d8e\n **/","import React from 'react'\n\nexport default class ReactHint extends React.Component {\n\tstatic _instance = null\n\n\tstatic get instance() {\n\t\treturn ReactHint._instance\n\t}\n\n\tstatic set instance(instance) {\n\t\tif (ReactHint._instance) throw new Error('Only one instance of ReactHint is allowed.')\n\t\tReactHint._instance = instance\n\t}\n\n\tstatic defaultProps = {\n\t\tclassName: 'react-hint'\n\t}\n\n\tstate = {\n\t\ttarget: null,\n\t\tat: 'top',\n\t\ttop: 0,\n\t\tleft: 0\n\t}\n\n\tshouldComponentUpdate({className}, {target, at, top, left}) {\n\t\tconst {props, state} = this\n\t\treturn target !== state.target\n\t\t\t|| at !== state.at\n\t\t\t|| Math.abs(top - state.top) > 1\n\t\t\t|| Math.abs(left - state.left) > 1\n\t\t\t|| className !== props.className\n\t}\n\n\tcomponentDidMount() {\n\t\tReactHint.instance = this\n\t\tdocument.addEventListener('mouseover', this.onHover)\n\t}\n\n\tcomponentDidUpdate() {\n\t\tconst {target} = this.state\n\t\tif (!target || !this._hint) return\n\t\tthis.setState(this.getHintPosition(this._hint, target))\n\t}\n\n\tcomponentWillUnmout() {\n\t\tReactHint.instance = null\n\t\tdocument.removeEventListener('mouseover', this.onHover)\n\t}\n\n\tfindHint = (el) => {\n\t\twhile (el) {\n\t\t\tif (el === document) break\n\t\t\tif (el.hasAttribute('data-rh')) return el\n\t\t\tel = el.parentNode\n\t\t} return null\n\t}\n\n\tgetHintPosition = (hint, target) => {\n\t\tconst {offsetWidth, offsetHeight} = hint\n\t\tconst {width, height, top, left} = target.getBoundingClientRect()\n\t\tconst at = target.getAttribute('data-rh-at')\n\n\t\tswitch (at) {\n\t\t\tcase 'left': return {\n\t\t\t\tat,\n\t\t\t\ttop: top + (height - offsetHeight >> 1),\n\t\t\t\tleft: left - offsetWidth\n\t\t\t}\n\n\t\t\tcase 'right': return {\n\t\t\t\tat,\n\t\t\t\ttop: top + (height - offsetHeight >> 1),\n\t\t\t\tleft: left + width\n\t\t\t}\n\n\t\t\tcase 'bottom': return {\n\t\t\t\tat,\n\t\t\t\ttop: top + height,\n\t\t\t\tleft: left + (width - offsetWidth >> 1)\n\t\t\t}\n\n\t\t\tcase 'top':\n\t\t\tdefault: return {\n\t\t\t\tat: 'top',\n\t\t\t\ttop: top - offsetHeight,\n\t\t\t\tleft: left + (width - offsetWidth >> 1)\n\t\t\t}\n\t\t}\n\t}\n\n\tsetHintRef = (ref) => {\n\t\tthis._hint = ref\n\t}\n\n\tonHover = ({target}) => {\n\t\tthis.setState({target: this.findHint(target)})\n\t}\n\n\trender() {\n\t\tconst {className} = this.props\n\t\tconst {target, at, top, left} = this.state\n\n\t\treturn target &&\n\t\t\t<div className={`${className} ${className}--${at}`}\n\t\t\t\tstyle={{top, left}}\n\t\t\t\tref={this.setHintRef}>\n\t\t\t\t\t<div className={`${className}__content`}>\n\t\t\t\t\t\t{target.getAttribute('data-rh')}\n\t\t\t\t\t</div>\n\t\t\t</div>\n\t}\n}\n\n\n/** WEBPACK FOOTER **\n ** ./src/index.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n ** module id = 2\n ** module chunks = 0\n **/"],"sourceRoot":""}