From 19a8a6709c8034f27c80df172c9d2e616227f258 Mon Sep 17 00:00:00 2001 From: Robert Gary Date: Tue, 28 Aug 2018 10:33:26 -0700 Subject: [PATCH] feat: Small bug fix to previous commit Fix an issue in my first commit that caused a dereference of the incorrect "this" object. --- src/index.js | 6 ++--- standalone/react-tooltip.js | 40 ++++++++++++++++----------------- standalone/react-tooltip.min.js | 2 +- 3 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/index.js b/src/index.js index be7d1843..0af994f0 100644 --- a/src/index.js +++ b/src/index.js @@ -327,11 +327,11 @@ class ReactTooltip extends React.Component { self.updateTooltip(e) if (getContent && Array.isArray(getContent)) { - this.intervalUpdateContent = setInterval(() => { + self.intervalUpdateContent = setInterval(() => { if (self.mount) { - const {getContent} = this.props + const {getContent} = self.props const placeholder = getTipContent(originTooltip, '', getContent[0](), isMultiline) - const isEmptyTip = this.isEmptyTip(placeholder) + const isEmptyTip = self.isEmptyTip(placeholder) self.setState({ isEmptyTip }) diff --git a/standalone/react-tooltip.js b/standalone/react-tooltip.js index fc665de6..b6615b64 100644 --- a/standalone/react-tooltip.js +++ b/standalone/react-tooltip.js @@ -1908,8 +1908,6 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de var self = this; var updateState = function updateState() { - var _this5 = this; - self.setState({ originTooltip: originTooltip, isMultiline: isMultiline, @@ -1931,12 +1929,12 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de self.updateTooltip(e); if (getContent && Array.isArray(getContent)) { - _this5.intervalUpdateContent = setInterval(function () { + self.intervalUpdateContent = setInterval(function () { if (self.mount) { - var _getContent = _this5.props.getContent; + var _getContent = self.props.getContent; var placeholder = (0, _getTipContent2.default)(originTooltip, '', _getContent[0](), isMultiline); - var isEmptyTip = _this5.isEmptyTip(placeholder); + var isEmptyTip = self.isEmptyTip(placeholder); self.setState({ isEmptyTip: isEmptyTip }); @@ -1962,7 +1960,7 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de }, { key: 'updateTooltip', value: function updateTooltip(e) { - var _this6 = this; + var _this5 = this; var _state = this.state, delayShow = _state.delayShow, @@ -1981,13 +1979,13 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de if (this.isEmptyTip(placeholder) || disable) return; // if the tooltip is empty, disable the tooltip var updateState = function updateState() { if (Array.isArray(placeholder) && placeholder.length > 0 || placeholder) { - var isInvisible = !_this6.state.show; - _this6.setState({ + var isInvisible = !_this5.state.show; + _this5.setState({ currentEvent: e, currentTarget: eventTarget, show: true }, function () { - _this6.updatePosition(); + _this5.updatePosition(); if (isInvisible && afterShow) afterShow(); }); } @@ -2033,7 +2031,7 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de }, { key: 'hideTooltip', value: function hideTooltip(e, hasTarget) { - var _this7 = this; + var _this6 = this; var _state2 = this.state, delayHide = _state2.delayHide, @@ -2053,18 +2051,18 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de } var resetState = function resetState() { - var isVisible = _this7.state.show; + var isVisible = _this6.state.show; // Check if the mouse is actually over the tooltip, if so don't hide the tooltip - if (_this7.mouseOnToolTip()) { - _this7.listenForTooltipExit(); + if (_this6.mouseOnToolTip()) { + _this6.listenForTooltipExit(); return; } - _this7.removeListenerForTooltipExit(); + _this6.removeListenerForTooltipExit(); - _this7.setState({ + _this6.setState({ show: false }, function () { - _this7.removeScrollListener(); + _this6.removeScrollListener(); if (isVisible && afterHide) afterHide(); }); }; @@ -2099,7 +2097,7 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de }, { key: 'updatePosition', value: function updatePosition() { - var _this8 = this; + var _this7 = this; var _state3 = this.state, currentEvent = _state3.currentEvent, @@ -2115,7 +2113,7 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de if (result.isNewState) { // Switch to reverse placement return this.setState(result.newState, function () { - _this8.updatePosition(); + _this7.updatePosition(); }); } // Set tooltip position @@ -2155,7 +2153,7 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de }, { key: 'render', value: function render() { - var _this9 = this; + var _this8 = this; var _state4 = this.state, extraClass = _state4.extraClass, @@ -2176,7 +2174,7 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de return _react2.default.createElement(Wrapper, _extends({ className: tooltipClass + ' ' + extraClass, id: this.props.id, ref: function ref(_ref) { - return _this9.tooltipRef = _ref; + return _this8.tooltipRef = _ref; } }, ariaProps, { 'data-id': 'tooltip', @@ -2188,7 +2186,7 @@ var ReactTooltip = (0, _staticMethods2.default)(_class = (0, _windowListener2.de id: this.props.id }, ariaProps, { ref: function ref(_ref2) { - return _this9.tooltipRef = _ref2; + return _this8.tooltipRef = _ref2; }, 'data-id': 'tooltip' }), placeholder diff --git a/standalone/react-tooltip.min.js b/standalone/react-tooltip.min.js index 781cf9d4..357fe40a 100644 --- a/standalone/react-tooltip.min.js +++ b/standalone/react-tooltip.min.js @@ -1,2 +1,2 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ReactTooltip=f()}})(function(){var define,module,exports;return function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key]}var argIndex=0;var message="Warning: "+format.replace(/%s/g,function(){return args[argIndex++]});if(typeof console!=="undefined"){console.error(message)}try{throw new Error(message)}catch(x){}};warning=function warning(condition,format){if(format===undefined){throw new Error("`warning(condition, format, ...args)` requires a warning "+"message argument")}if(format.indexOf("Failed Composite propType: ")===0){return}if(!condition){for(var _len2=arguments.length,args=Array(_len2>2?_len2-2:0),_key2=2;_key2<_len2;_key2++){args[_key2-2]=arguments[_key2]}printWarning.apply(undefined,[format].concat(args))}}}module.exports=warning}).call(this,require("_process"))},{"./emptyFunction":2,_process:6}],5:[function(require,module,exports){"use strict";var getOwnPropertySymbols=Object.getOwnPropertySymbols;var hasOwnProperty=Object.prototype.hasOwnProperty;var propIsEnumerable=Object.prototype.propertyIsEnumerable;function toObject(val){if(val===null||val===undefined){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(val)}function shouldUseNative(){try{if(!Object.assign){return false}var test1=new String("abc");test1[5]="de";if(Object.getOwnPropertyNames(test1)[0]==="5"){return false}var test2={};for(var i=0;i<10;i++){test2["_"+String.fromCharCode(i)]=i}var order2=Object.getOwnPropertyNames(test2).map(function(n){return test2[n]});if(order2.join("")!=="0123456789"){return false}var test3={};"abcdefghijklmnopqrst".split("").forEach(function(letter){test3[letter]=letter});if(Object.keys(Object.assign({},test3)).join("")!=="abcdefghijklmnopqrst"){return false}return true}catch(err){return false}}module.exports=shouldUseNative()?Object.assign:function(target,source){var from;var to=toObject(target);var symbols;for(var s=1;s1){for(var i=1;i0||placeholder){var isInvisible=!_this6.state.show;_this6.setState({currentEvent:e,currentTarget:eventTarget,show:true},function(){_this6.updatePosition();if(isInvisible&&afterShow)afterShow()})}};clearTimeout(this.delayShowLoop);if(delayShow){this.delayShowLoop=setTimeout(updateState,delayTime)}else{updateState()}}},{key:"listenForTooltipExit",value:function listenForTooltipExit(){var show=this.state.show;if(show&&this.tooltipRef){this.tooltipRef.addEventListener("mouseleave",this.hideTooltip)}}},{key:"removeListenerForTooltipExit",value:function removeListenerForTooltipExit(){var show=this.state.show;if(show&&this.tooltipRef){this.tooltipRef.removeEventListener("mouseleave",this.hideTooltip)}}},{key:"hideTooltip",value:function hideTooltip(e,hasTarget){var _this7=this;var _state2=this.state,delayHide=_state2.delayHide,disable=_state2.disable;var afterHide=this.props.afterHide;var placeholder=this.getTooltipContent();if(!this.mount)return;if(this.isEmptyTip(placeholder)||disable)return;if(hasTarget){var targetArray=this.getTargetArray(this.props.id);var isMyElement=targetArray.some(function(ele){return ele===e.currentTarget});if(!isMyElement||!this.state.show)return}var resetState=function resetState(){var isVisible=_this7.state.show;if(_this7.mouseOnToolTip()){_this7.listenForTooltipExit();return}_this7.removeListenerForTooltipExit();_this7.setState({show:false},function(){_this7.removeScrollListener();if(isVisible&&afterHide)afterHide()})};this.clearTimer();if(delayHide){this.delayHideLoop=setTimeout(resetState,parseInt(delayHide,10))}else{resetState()}}},{key:"addScrollListener",value:function addScrollListener(currentTarget){var isCaptureMode=this.isCapture(currentTarget);window.addEventListener("scroll",this.hideTooltip,isCaptureMode)}},{key:"removeScrollListener",value:function removeScrollListener(){window.removeEventListener("scroll",this.hideTooltip)}},{key:"updatePosition",value:function updatePosition(){var _this8=this;var _state3=this.state,currentEvent=_state3.currentEvent,currentTarget=_state3.currentTarget,place=_state3.place,desiredPlace=_state3.desiredPlace,effect=_state3.effect,offset=_state3.offset;var node=_reactDom2.default.findDOMNode(this);var result=(0,_getPosition2.default)(currentEvent,currentTarget,node,place,desiredPlace,effect,offset);if(result.isNewState){return this.setState(result.newState,function(){_this8.updatePosition()})}node.style.left=result.position.left+"px";node.style.top=result.position.top+"px"}},{key:"setStyleHeader",value:function setStyleHeader(){var head=document.getElementsByTagName("head")[0];if(!head.querySelector('style[id="react-tooltip"]')){var tag=document.createElement("style");tag.id="react-tooltip";tag.innerHTML=_style2.default;head.insertBefore(tag,head.firstChild)}}},{key:"clearTimer",value:function clearTimer(){clearTimeout(this.delayShowLoop);clearTimeout(this.delayHideLoop);clearTimeout(this.delayReshow);clearInterval(this.intervalUpdateContent)}},{key:"render",value:function render(){var _this9=this;var _state4=this.state,extraClass=_state4.extraClass,html=_state4.html,ariaProps=_state4.ariaProps,disable=_state4.disable;var placeholder=this.getTooltipContent();var isEmptyTip=this.isEmptyTip(placeholder);var tooltipClass=(0,_classnames2.default)("__react_component_tooltip",{show:this.state.show&&!disable&&!isEmptyTip},{border:this.state.border},{"place-top":this.state.place==="top"},{"place-bottom":this.state.place==="bottom"},{"place-left":this.state.place==="left"},{"place-right":this.state.place==="right"},{"type-dark":this.state.type==="dark"},{"type-success":this.state.type==="success"},{"type-warning":this.state.type==="warning"},{"type-error":this.state.type==="error"},{"type-info":this.state.type==="info"},{"type-light":this.state.type==="light"},{allow_hover:this.props.delayUpdate});var Wrapper=this.props.wrapper;if(ReactTooltip.supportedWrappers.indexOf(Wrapper)<0){Wrapper=ReactTooltip.defaultProps.wrapper}if(html){return _react2.default.createElement(Wrapper,_extends({className:tooltipClass+" "+extraClass,id:this.props.id,ref:function ref(_ref){return _this9.tooltipRef=_ref}},ariaProps,{"data-id":"tooltip",dangerouslySetInnerHTML:{__html:placeholder}}))}else{return _react2.default.createElement(Wrapper,_extends({className:tooltipClass+" "+extraClass,id:this.props.id},ariaProps,{ref:function ref(_ref2){return _this9.tooltipRef=_ref2},"data-id":"tooltip"}),placeholder)}}}]);return ReactTooltip}(_react2.default.Component),_class2.propTypes={children:_propTypes2.default.any,place:_propTypes2.default.string,type:_propTypes2.default.string,effect:_propTypes2.default.string,offset:_propTypes2.default.object,multiline:_propTypes2.default.bool,border:_propTypes2.default.bool,insecure:_propTypes2.default.bool,class:_propTypes2.default.string,className:_propTypes2.default.string,id:_propTypes2.default.string,html:_propTypes2.default.bool,delayHide:_propTypes2.default.number,delayUpdate:_propTypes2.default.number,delayShow:_propTypes2.default.number,event:_propTypes2.default.string,eventOff:_propTypes2.default.string,watchWindow:_propTypes2.default.bool,isCapture:_propTypes2.default.bool,globalEventOff:_propTypes2.default.string,getContent:_propTypes2.default.any,afterShow:_propTypes2.default.func,afterHide:_propTypes2.default.func,disable:_propTypes2.default.bool,scrollHide:_propTypes2.default.bool,resizeHide:_propTypes2.default.bool,wrapper:_propTypes2.default.string},_class2.defaultProps={insecure:true,resizeHide:true,wrapper:"div"},_class2.supportedWrappers=["div","span"],_class2.displayName="ReactTooltip",_temp))||_class)||_class)||_class)||_class)||_class)||_class;module.exports=ReactTooltip}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./decorators/customEvent":13,"./decorators/getEffect":14,"./decorators/isCapture":15,"./decorators/staticMethods":16,"./decorators/trackRemoval":17,"./decorators/windowListener":18,"./style":20,"./utils/aria":21,"./utils/getPosition":22,"./utils/getTipContent":23,"./utils/nodeListToArray":24,classnames:1,"prop-types":10}],20:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default='.__react_component_tooltip{border-radius:3px;display:inline-block;font-size:13px;left:-999em;opacity:0;padding:8px 21px;position:fixed;pointer-events:none;transition:opacity 0.3s ease-out;top:-999em;visibility:hidden;z-index:999}.__react_component_tooltip.allow_hover{pointer-events:auto}.__react_component_tooltip:before,.__react_component_tooltip:after{content:"";width:0;height:0;position:absolute}.__react_component_tooltip.show{opacity:0.9;margin-top:0px;margin-left:0px;visibility:visible}.__react_component_tooltip.type-dark{color:#fff;background-color:#222}.__react_component_tooltip.type-dark.place-top:after{border-top-color:#222;border-top-style:solid;border-top-width:6px}.__react_component_tooltip.type-dark.place-bottom:after{border-bottom-color:#222;border-bottom-style:solid;border-bottom-width:6px}.__react_component_tooltip.type-dark.place-left:after{border-left-color:#222;border-left-style:solid;border-left-width:6px}.__react_component_tooltip.type-dark.place-right:after{border-right-color:#222;border-right-style:solid;border-right-width:6px}.__react_component_tooltip.type-dark.border{border:1px solid #fff}.__react_component_tooltip.type-dark.border.place-top:before{border-top:8px solid #fff}.__react_component_tooltip.type-dark.border.place-bottom:before{border-bottom:8px solid #fff}.__react_component_tooltip.type-dark.border.place-left:before{border-left:8px solid #fff}.__react_component_tooltip.type-dark.border.place-right:before{border-right:8px solid #fff}.__react_component_tooltip.type-success{color:#fff;background-color:#8DC572}.__react_component_tooltip.type-success.place-top:after{border-top-color:#8DC572;border-top-style:solid;border-top-width:6px}.__react_component_tooltip.type-success.place-bottom:after{border-bottom-color:#8DC572;border-bottom-style:solid;border-bottom-width:6px}.__react_component_tooltip.type-success.place-left:after{border-left-color:#8DC572;border-left-style:solid;border-left-width:6px}.__react_component_tooltip.type-success.place-right:after{border-right-color:#8DC572;border-right-style:solid;border-right-width:6px}.__react_component_tooltip.type-success.border{border:1px solid #fff}.__react_component_tooltip.type-success.border.place-top:before{border-top:8px solid #fff}.__react_component_tooltip.type-success.border.place-bottom:before{border-bottom:8px solid #fff}.__react_component_tooltip.type-success.border.place-left:before{border-left:8px solid #fff}.__react_component_tooltip.type-success.border.place-right:before{border-right:8px solid #fff}.__react_component_tooltip.type-warning{color:#fff;background-color:#F0AD4E}.__react_component_tooltip.type-warning.place-top:after{border-top-color:#F0AD4E;border-top-style:solid;border-top-width:6px}.__react_component_tooltip.type-warning.place-bottom:after{border-bottom-color:#F0AD4E;border-bottom-style:solid;border-bottom-width:6px}.__react_component_tooltip.type-warning.place-left:after{border-left-color:#F0AD4E;border-left-style:solid;border-left-width:6px}.__react_component_tooltip.type-warning.place-right:after{border-right-color:#F0AD4E;border-right-style:solid;border-right-width:6px}.__react_component_tooltip.type-warning.border{border:1px solid #fff}.__react_component_tooltip.type-warning.border.place-top:before{border-top:8px solid #fff}.__react_component_tooltip.type-warning.border.place-bottom:before{border-bottom:8px solid #fff}.__react_component_tooltip.type-warning.border.place-left:before{border-left:8px solid #fff}.__react_component_tooltip.type-warning.border.place-right:before{border-right:8px solid #fff}.__react_component_tooltip.type-error{color:#fff;background-color:#BE6464}.__react_component_tooltip.type-error.place-top:after{border-top-color:#BE6464;border-top-style:solid;border-top-width:6px}.__react_component_tooltip.type-error.place-bottom:after{border-bottom-color:#BE6464;border-bottom-style:solid;border-bottom-width:6px}.__react_component_tooltip.type-error.place-left:after{border-left-color:#BE6464;border-left-style:solid;border-left-width:6px}.__react_component_tooltip.type-error.place-right:after{border-right-color:#BE6464;border-right-style:solid;border-right-width:6px}.__react_component_tooltip.type-error.border{border:1px solid #fff}.__react_component_tooltip.type-error.border.place-top:before{border-top:8px solid #fff}.__react_component_tooltip.type-error.border.place-bottom:before{border-bottom:8px solid #fff}.__react_component_tooltip.type-error.border.place-left:before{border-left:8px solid #fff}.__react_component_tooltip.type-error.border.place-right:before{border-right:8px solid #fff}.__react_component_tooltip.type-info{color:#fff;background-color:#337AB7}.__react_component_tooltip.type-info.place-top:after{border-top-color:#337AB7;border-top-style:solid;border-top-width:6px}.__react_component_tooltip.type-info.place-bottom:after{border-bottom-color:#337AB7;border-bottom-style:solid;border-bottom-width:6px}.__react_component_tooltip.type-info.place-left:after{border-left-color:#337AB7;border-left-style:solid;border-left-width:6px}.__react_component_tooltip.type-info.place-right:after{border-right-color:#337AB7;border-right-style:solid;border-right-width:6px}.__react_component_tooltip.type-info.border{border:1px solid #fff}.__react_component_tooltip.type-info.border.place-top:before{border-top:8px solid #fff}.__react_component_tooltip.type-info.border.place-bottom:before{border-bottom:8px solid #fff}.__react_component_tooltip.type-info.border.place-left:before{border-left:8px solid #fff}.__react_component_tooltip.type-info.border.place-right:before{border-right:8px solid #fff}.__react_component_tooltip.type-light{color:#222;background-color:#fff}.__react_component_tooltip.type-light.place-top:after{border-top-color:#fff;border-top-style:solid;border-top-width:6px}.__react_component_tooltip.type-light.place-bottom:after{border-bottom-color:#fff;border-bottom-style:solid;border-bottom-width:6px}.__react_component_tooltip.type-light.place-left:after{border-left-color:#fff;border-left-style:solid;border-left-width:6px}.__react_component_tooltip.type-light.place-right:after{border-right-color:#fff;border-right-style:solid;border-right-width:6px}.__react_component_tooltip.type-light.border{border:1px solid #222}.__react_component_tooltip.type-light.border.place-top:before{border-top:8px solid #222}.__react_component_tooltip.type-light.border.place-bottom:before{border-bottom:8px solid #222}.__react_component_tooltip.type-light.border.place-left:before{border-left:8px solid #222}.__react_component_tooltip.type-light.border.place-right:before{border-right:8px solid #222}.__react_component_tooltip.place-top{margin-top:-10px}.__react_component_tooltip.place-top:before{border-left:10px solid transparent;border-right:10px solid transparent;bottom:-8px;left:50%;margin-left:-10px}.__react_component_tooltip.place-top:after{border-left:8px solid transparent;border-right:8px solid transparent;bottom:-6px;left:50%;margin-left:-8px}.__react_component_tooltip.place-bottom{margin-top:10px}.__react_component_tooltip.place-bottom:before{border-left:10px solid transparent;border-right:10px solid transparent;top:-8px;left:50%;margin-left:-10px}.__react_component_tooltip.place-bottom:after{border-left:8px solid transparent;border-right:8px solid transparent;top:-6px;left:50%;margin-left:-8px}.__react_component_tooltip.place-left{margin-left:-10px}.__react_component_tooltip.place-left:before{border-top:6px solid transparent;border-bottom:6px solid transparent;right:-8px;top:50%;margin-top:-5px}.__react_component_tooltip.place-left:after{border-top:5px solid transparent;border-bottom:5px solid transparent;right:-6px;top:50%;margin-top:-4px}.__react_component_tooltip.place-right{margin-left:10px}.__react_component_tooltip.place-right:before{border-top:6px solid transparent;border-bottom:6px solid transparent;left:-8px;top:50%;margin-top:-5px}.__react_component_tooltip.place-right:after{border-top:5px solid transparent;border-bottom:5px solid transparent;left:-6px;top:50%;margin-top:-4px}.__react_component_tooltip .multi-line{display:block;padding:2px 0px;text-align:center}'},{}],21:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.parseAria=parseAria;function parseAria(props){var ariaObj={};Object.keys(props).filter(function(prop){return/(^aria-\w+$|^role$)/.test(prop)}).forEach(function(prop){ariaObj[prop]=props[prop]});return ariaObj}},{}],22:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=function(e,target,node,place,desiredPlace,effect,offset){var _getDimensions=getDimensions(node),tipWidth=_getDimensions.width,tipHeight=_getDimensions.height;var _getDimensions2=getDimensions(target),targetWidth=_getDimensions2.width,targetHeight=_getDimensions2.height;var _getCurrentOffset=getCurrentOffset(e,target,effect),mouseX=_getCurrentOffset.mouseX,mouseY=_getCurrentOffset.mouseY;var defaultOffset=getDefaultPosition(effect,targetWidth,targetHeight,tipWidth,tipHeight);var _calculateOffset=calculateOffset(offset),extraOffset_X=_calculateOffset.extraOffset_X,extraOffset_Y=_calculateOffset.extraOffset_Y;var windowWidth=window.innerWidth;var windowHeight=window.innerHeight;var _getParent=getParent(node),parentTop=_getParent.parentTop,parentLeft=_getParent.parentLeft;var getTipOffsetLeft=function getTipOffsetLeft(place){var offset_X=defaultOffset[place].l;return mouseX+offset_X+extraOffset_X};var getTipOffsetRight=function getTipOffsetRight(place){var offset_X=defaultOffset[place].r;return mouseX+offset_X+extraOffset_X};var getTipOffsetTop=function getTipOffsetTop(place){var offset_Y=defaultOffset[place].t;return mouseY+offset_Y+extraOffset_Y};var getTipOffsetBottom=function getTipOffsetBottom(place){var offset_Y=defaultOffset[place].b;return mouseY+offset_Y+extraOffset_Y};var outsideLeft=function outsideLeft(p){return getTipOffsetLeft(p)<0};var outsideRight=function outsideRight(p){return getTipOffsetRight(p)>windowWidth};var outsideTop=function outsideTop(p){return getTipOffsetTop(p)<0};var outsideBottom=function outsideBottom(p){return getTipOffsetBottom(p)>windowHeight};var outside=function outside(p){return outsideLeft(p)||outsideRight(p)||outsideTop(p)||outsideBottom(p)};var inside=function inside(p){return!outside(p)};var placesList=["top","bottom","left","right"];var insideList=[];for(var i=0;i<4;i++){var p=placesList[i];if(inside(p)){insideList.push(p)}}var isNewState=false;var newPlace=void 0;if(inside(desiredPlace)&&desiredPlace!==place){isNewState=true;newPlace=desiredPlace}else if(insideList.length>0&&outside(desiredPlace)&&outside(place)){isNewState=true;newPlace=insideList[0]}if(isNewState){return{isNewState:true,newState:{place:newPlace}}}return{isNewState:false,position:{left:parseInt(getTipOffsetLeft(place)-parentLeft,10),top:parseInt(getTipOffsetTop(place)-parentTop,10)}}};var getDimensions=function getDimensions(node){var _node$getBoundingClie=node.getBoundingClientRect(),height=_node$getBoundingClie.height,width=_node$getBoundingClie.width;return{height:parseInt(height,10),width:parseInt(width,10)}};var getCurrentOffset=function getCurrentOffset(e,currentTarget,effect){var boundingClientRect=currentTarget.getBoundingClientRect();var targetTop=boundingClientRect.top;var targetLeft=boundingClientRect.left;var _getDimensions3=getDimensions(currentTarget),targetWidth=_getDimensions3.width,targetHeight=_getDimensions3.height;if(effect==="float"){return{mouseX:e.clientX,mouseY:e.clientY}}return{mouseX:targetLeft+targetWidth/2,mouseY:targetTop+targetHeight/2}};var getDefaultPosition=function getDefaultPosition(effect,targetWidth,targetHeight,tipWidth,tipHeight){var top=void 0;var right=void 0;var bottom=void 0;var left=void 0;var disToMouse=3;var triangleHeight=2;var cursorHeight=12;if(effect==="float"){top={l:-(tipWidth/2),r:tipWidth/2,t:-(tipHeight+disToMouse+triangleHeight),b:-disToMouse};bottom={l:-(tipWidth/2),r:tipWidth/2,t:disToMouse+cursorHeight,b:tipHeight+disToMouse+triangleHeight+cursorHeight};left={l:-(tipWidth+disToMouse+triangleHeight),r:-disToMouse,t:-(tipHeight/2),b:tipHeight/2};right={l:disToMouse,r:tipWidth+disToMouse+triangleHeight,t:-(tipHeight/2),b:tipHeight/2}}else if(effect==="solid"){top={l:-(tipWidth/2),r:tipWidth/2,t:-(targetHeight/2+tipHeight+triangleHeight),b:-(targetHeight/2)};bottom={l:-(tipWidth/2),r:tipWidth/2,t:targetHeight/2,b:targetHeight/2+tipHeight+triangleHeight};left={l:-(tipWidth+targetWidth/2+triangleHeight),r:-(targetWidth/2),t:-(tipHeight/2),b:tipHeight/2};right={l:targetWidth/2,r:tipWidth+targetWidth/2+triangleHeight,t:-(tipHeight/2),b:tipHeight/2}}return{top:top,bottom:bottom,left:left,right:right}};var calculateOffset=function calculateOffset(offset){var extraOffset_X=0;var extraOffset_Y=0;if(Object.prototype.toString.apply(offset)==="[object String]"){offset=JSON.parse(offset.toString().replace(/\'/g,'"'))}for(var key in offset){if(key==="top"){extraOffset_Y-=parseInt(offset[key],10)}else if(key==="bottom"){extraOffset_Y+=parseInt(offset[key],10)}else if(key==="left"){extraOffset_X-=parseInt(offset[key],10)}else if(key==="right"){extraOffset_X+=parseInt(offset[key],10)}}return{extraOffset_X:extraOffset_X,extraOffset_Y:extraOffset_Y}};var getParent=function getParent(currentTarget){var currentParent=currentTarget;while(currentParent){if(window.getComputedStyle(currentParent).getPropertyValue("transform")!=="none")break;currentParent=currentParent.parentElement}var parentTop=currentParent&¤tParent.getBoundingClientRect().top||0;var parentLeft=currentParent&¤tParent.getBoundingClientRect().left||0;return{parentTop:parentTop,parentLeft:parentLeft}}},{}],23:[function(require,module,exports){(function(global){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=function(tip,children,getContent,multiline){if(children)return children;if(getContent!==undefined&&getContent!==null)return getContent;if(getContent===null)return null;var regexp=//;if(!multiline||multiline==="false"||!regexp.test(tip)){return tip}return tip.split(regexp).map(function(d,i){return _react2.default.createElement("span",{key:i,className:"multi-line"},d)})};var _react=typeof window!=="undefined"?window["React"]:typeof global!=="undefined"?global["React"]:null;var _react2=_interopRequireDefault(_react);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],24:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=function(nodeList){var length=nodeList.length;if(nodeList.hasOwnProperty){return Array.prototype.slice.call(nodeList)}return new Array(length).fill().map(function(index){return nodeList[index]})}},{}]},{},[19])(19)}); +;var _classnames=require("classnames");var _classnames2=_interopRequireDefault(_classnames);var _staticMethods=require("./decorators/staticMethods");var _staticMethods2=_interopRequireDefault(_staticMethods);var _windowListener=require("./decorators/windowListener");var _windowListener2=_interopRequireDefault(_windowListener);var _customEvent=require("./decorators/customEvent");var _customEvent2=_interopRequireDefault(_customEvent);var _isCapture=require("./decorators/isCapture");var _isCapture2=_interopRequireDefault(_isCapture);var _getEffect=require("./decorators/getEffect");var _getEffect2=_interopRequireDefault(_getEffect);var _trackRemoval=require("./decorators/trackRemoval");var _trackRemoval2=_interopRequireDefault(_trackRemoval);var _getPosition=require("./utils/getPosition");var _getPosition2=_interopRequireDefault(_getPosition);var _getTipContent=require("./utils/getTipContent");var _getTipContent2=_interopRequireDefault(_getTipContent);var _aria=require("./utils/aria");var _nodeListToArray=require("./utils/nodeListToArray");var _nodeListToArray2=_interopRequireDefault(_nodeListToArray);var _style=require("./style");var _style2=_interopRequireDefault(_style);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _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}function _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}var ReactTooltip=(0,_staticMethods2.default)(_class=(0,_windowListener2.default)(_class=(0,_customEvent2.default)(_class=(0,_isCapture2.default)(_class=(0,_getEffect2.default)(_class=(0,_trackRemoval2.default)(_class=(_temp=_class2=function(_React$Component){_inherits(ReactTooltip,_React$Component);function ReactTooltip(props){_classCallCheck(this,ReactTooltip);var _this=_possibleConstructorReturn(this,(ReactTooltip.__proto__||Object.getPrototypeOf(ReactTooltip)).call(this,props));_this.state={place:"top",type:"dark",effect:"float",show:false,border:false,offset:{},extraClass:"",html:false,delayHide:0,delayShow:0,event:props.event||null,eventOff:props.eventOff||null,currentEvent:null,currentTarget:null,ariaProps:(0,_aria.parseAria)(props),isEmptyTip:false,disable:false,originTooltip:null,isMultiline:false};_this.bind(["showTooltip","updateTooltip","hideTooltip","getTooltipContent","globalRebuild","globalShow","globalHide","onWindowResize","mouseOnToolTip"]);_this.mount=true;_this.delayShowLoop=null;_this.delayHideLoop=null;_this.delayReshow=null;_this.intervalUpdateContent=null;return _this}_createClass(ReactTooltip,[{key:"bind",value:function bind(methodArray){var _this2=this;methodArray.forEach(function(method){_this2[method]=_this2[method].bind(_this2)})}},{key:"componentDidMount",value:function componentDidMount(){var _props=this.props,insecure=_props.insecure,resizeHide=_props.resizeHide;if(insecure){this.setStyleHeader()}this.bindListener();this.bindWindowEvents(resizeHide)}},{key:"componentWillReceiveProps",value:function componentWillReceiveProps(props){var ariaProps=this.state.ariaProps;var newAriaProps=(0,_aria.parseAria)(props);var isChanged=Object.keys(newAriaProps).some(function(props){return newAriaProps[props]!==ariaProps[props]});if(isChanged){this.setState({ariaProps:newAriaProps})}}},{key:"componentWillUnmount",value:function componentWillUnmount(){this.mount=false;this.clearTimer();this.unbindListener();this.removeScrollListener();this.unbindWindowEvents()}},{key:"mouseOnToolTip",value:function mouseOnToolTip(){var show=this.state.show;if(show&&this.tooltipRef){if(!this.tooltipRef.matches){this.tooltipRef.matches=this.tooltipRef.msMatchesSelector}return this.tooltipRef.matches(":hover")}return false}},{key:"getTargetArray",value:function getTargetArray(id){var targetArray=void 0;if(!id){targetArray=document.querySelectorAll("[data-tip]:not([data-for])")}else{var escaped=id.replace(/\\/g,"\\\\").replace(/"/g,'\\"');targetArray=document.querySelectorAll('[data-tip][data-for="'+escaped+'"]')}return(0,_nodeListToArray2.default)(targetArray)}},{key:"bindListener",value:function bindListener(){var _this3=this;var _props2=this.props,id=_props2.id,globalEventOff=_props2.globalEventOff;var targetArray=this.getTargetArray(id);targetArray.forEach(function(target){var isCaptureMode=_this3.isCapture(target);var effect=_this3.getEffect(target);if(target.getAttribute("currentItem")===null){target.setAttribute("currentItem","false")}_this3.unbindBasicListener(target);if(_this3.isCustomEvent(target)){_this3.customBindListener(target);return}target.addEventListener("mouseenter",_this3.showTooltip,isCaptureMode);if(effect==="float"){target.addEventListener("mousemove",_this3.updateTooltip,isCaptureMode)}target.addEventListener("mouseleave",_this3.hideTooltip,isCaptureMode)});if(globalEventOff){window.removeEventListener(globalEventOff,this.hideTooltip);window.addEventListener(globalEventOff,this.hideTooltip,false)}this.bindRemovalTracker()}},{key:"unbindListener",value:function unbindListener(){var _this4=this;var _props3=this.props,id=_props3.id,globalEventOff=_props3.globalEventOff;var targetArray=this.getTargetArray(id);targetArray.forEach(function(target){_this4.unbindBasicListener(target);if(_this4.isCustomEvent(target))_this4.customUnbindListener(target)});if(globalEventOff)window.removeEventListener(globalEventOff,this.hideTooltip);this.unbindRemovalTracker()}},{key:"unbindBasicListener",value:function unbindBasicListener(target){var isCaptureMode=this.isCapture(target);target.removeEventListener("mouseenter",this.showTooltip,isCaptureMode);target.removeEventListener("mousemove",this.updateTooltip,isCaptureMode);target.removeEventListener("mouseleave",this.hideTooltip,isCaptureMode)}},{key:"getTooltipContent",value:function getTooltipContent(){var _props4=this.props,getContent=_props4.getContent,children=_props4.children;var content=void 0;if(getContent){if(Array.isArray(getContent)){content=getContent[0]&&getContent[0](this.state.originTooltip)}else{content=getContent(this.state.originTooltip)}}return(0,_getTipContent2.default)(this.state.originTooltip,children,content,this.state.isMultiline)}},{key:"isEmptyTip",value:function isEmptyTip(placeholder){return typeof placeholder==="string"&&placeholder===""||placeholder===null}},{key:"showTooltip",value:function showTooltip(e,isGlobalCall){if(isGlobalCall){var targetArray=this.getTargetArray(this.props.id);var isMyElement=targetArray.some(function(ele){return ele===e.currentTarget});if(!isMyElement)return}var _props5=this.props,multiline=_props5.multiline,getContent=_props5.getContent;var originTooltip=e.currentTarget.getAttribute("data-tip");var isMultiline=e.currentTarget.getAttribute("data-multiline")||multiline||false;var switchToSolid=e instanceof window.FocusEvent||isGlobalCall;var scrollHide=true;if(e.currentTarget.getAttribute("data-scroll-hide")){scrollHide=e.currentTarget.getAttribute("data-scroll-hide")==="true"}else if(this.props.scrollHide!=null){scrollHide=this.props.scrollHide}this.clearTimer();var target=e.currentTarget;var reshowDelay=this.state.show?target.getAttribute("data-delay-update")||this.props.delayUpdate:0;var self=this;var updateState=function updateState(){self.setState({originTooltip:originTooltip,isMultiline:isMultiline,desiredPlace:target.getAttribute("data-place")||self.props.place||"top",place:target.getAttribute("data-place")||self.props.place||"top",type:target.getAttribute("data-type")||self.props.type||"dark",effect:switchToSolid&&"solid"||self.getEffect(target),offset:target.getAttribute("data-offset")||self.props.offset||{},html:target.getAttribute("data-html")?target.getAttribute("data-html")==="true":self.props.html||false,delayShow:target.getAttribute("data-delay-show")||self.props.delayShow||0,delayHide:target.getAttribute("data-delay-hide")||self.props.delayHide||0,delayUpdate:target.getAttribute("data-delay-update")||self.props.delayUpdate||0,border:target.getAttribute("data-border")?target.getAttribute("data-border")==="true":self.props.border||false,extraClass:target.getAttribute("data-class")||self.props.class||self.props.className||"",disable:target.getAttribute("data-tip-disable")?target.getAttribute("data-tip-disable")==="true":self.props.disable||false,currentTarget:target},function(){if(scrollHide)self.addScrollListener(self.state.currentTarget);self.updateTooltip(e);if(getContent&&Array.isArray(getContent)){self.intervalUpdateContent=setInterval(function(){if(self.mount){var _getContent=self.props.getContent;var placeholder=(0,_getTipContent2.default)(originTooltip,"",_getContent[0](),isMultiline);var isEmptyTip=self.isEmptyTip(placeholder);self.setState({isEmptyTip:isEmptyTip});self.updatePosition()}},getContent[1])}})};if(reshowDelay){this.delayReshow=setTimeout(updateState,reshowDelay)}else{updateState()}}},{key:"updateTooltip",value:function updateTooltip(e){var _this5=this;var _state=this.state,delayShow=_state.delayShow,disable=_state.disable;var afterShow=this.props.afterShow;var placeholder=this.getTooltipContent();var delayTime=parseInt(delayShow,10);var eventTarget=e.currentTarget||e.target;if(this.mouseOnToolTip()){return}if(this.isEmptyTip(placeholder)||disable)return;var updateState=function updateState(){if(Array.isArray(placeholder)&&placeholder.length>0||placeholder){var isInvisible=!_this5.state.show;_this5.setState({currentEvent:e,currentTarget:eventTarget,show:true},function(){_this5.updatePosition();if(isInvisible&&afterShow)afterShow()})}};clearTimeout(this.delayShowLoop);if(delayShow){this.delayShowLoop=setTimeout(updateState,delayTime)}else{updateState()}}},{key:"listenForTooltipExit",value:function listenForTooltipExit(){var show=this.state.show;if(show&&this.tooltipRef){this.tooltipRef.addEventListener("mouseleave",this.hideTooltip)}}},{key:"removeListenerForTooltipExit",value:function removeListenerForTooltipExit(){var show=this.state.show;if(show&&this.tooltipRef){this.tooltipRef.removeEventListener("mouseleave",this.hideTooltip)}}},{key:"hideTooltip",value:function hideTooltip(e,hasTarget){var _this6=this;var _state2=this.state,delayHide=_state2.delayHide,disable=_state2.disable;var afterHide=this.props.afterHide;var placeholder=this.getTooltipContent();if(!this.mount)return;if(this.isEmptyTip(placeholder)||disable)return;if(hasTarget){var targetArray=this.getTargetArray(this.props.id);var isMyElement=targetArray.some(function(ele){return ele===e.currentTarget});if(!isMyElement||!this.state.show)return}var resetState=function resetState(){var isVisible=_this6.state.show;if(_this6.mouseOnToolTip()){_this6.listenForTooltipExit();return}_this6.removeListenerForTooltipExit();_this6.setState({show:false},function(){_this6.removeScrollListener();if(isVisible&&afterHide)afterHide()})};this.clearTimer();if(delayHide){this.delayHideLoop=setTimeout(resetState,parseInt(delayHide,10))}else{resetState()}}},{key:"addScrollListener",value:function addScrollListener(currentTarget){var isCaptureMode=this.isCapture(currentTarget);window.addEventListener("scroll",this.hideTooltip,isCaptureMode)}},{key:"removeScrollListener",value:function removeScrollListener(){window.removeEventListener("scroll",this.hideTooltip)}},{key:"updatePosition",value:function updatePosition(){var _this7=this;var _state3=this.state,currentEvent=_state3.currentEvent,currentTarget=_state3.currentTarget,place=_state3.place,desiredPlace=_state3.desiredPlace,effect=_state3.effect,offset=_state3.offset;var node=_reactDom2.default.findDOMNode(this);var result=(0,_getPosition2.default)(currentEvent,currentTarget,node,place,desiredPlace,effect,offset);if(result.isNewState){return this.setState(result.newState,function(){_this7.updatePosition()})}node.style.left=result.position.left+"px";node.style.top=result.position.top+"px"}},{key:"setStyleHeader",value:function setStyleHeader(){var head=document.getElementsByTagName("head")[0];if(!head.querySelector('style[id="react-tooltip"]')){var tag=document.createElement("style");tag.id="react-tooltip";tag.innerHTML=_style2.default;head.insertBefore(tag,head.firstChild)}}},{key:"clearTimer",value:function clearTimer(){clearTimeout(this.delayShowLoop);clearTimeout(this.delayHideLoop);clearTimeout(this.delayReshow);clearInterval(this.intervalUpdateContent)}},{key:"render",value:function render(){var _this8=this;var _state4=this.state,extraClass=_state4.extraClass,html=_state4.html,ariaProps=_state4.ariaProps,disable=_state4.disable;var placeholder=this.getTooltipContent();var isEmptyTip=this.isEmptyTip(placeholder);var tooltipClass=(0,_classnames2.default)("__react_component_tooltip",{show:this.state.show&&!disable&&!isEmptyTip},{border:this.state.border},{"place-top":this.state.place==="top"},{"place-bottom":this.state.place==="bottom"},{"place-left":this.state.place==="left"},{"place-right":this.state.place==="right"},{"type-dark":this.state.type==="dark"},{"type-success":this.state.type==="success"},{"type-warning":this.state.type==="warning"},{"type-error":this.state.type==="error"},{"type-info":this.state.type==="info"},{"type-light":this.state.type==="light"},{allow_hover:this.props.delayUpdate});var Wrapper=this.props.wrapper;if(ReactTooltip.supportedWrappers.indexOf(Wrapper)<0){Wrapper=ReactTooltip.defaultProps.wrapper}if(html){return _react2.default.createElement(Wrapper,_extends({className:tooltipClass+" "+extraClass,id:this.props.id,ref:function ref(_ref){return _this8.tooltipRef=_ref}},ariaProps,{"data-id":"tooltip",dangerouslySetInnerHTML:{__html:placeholder}}))}else{return _react2.default.createElement(Wrapper,_extends({className:tooltipClass+" "+extraClass,id:this.props.id},ariaProps,{ref:function ref(_ref2){return _this8.tooltipRef=_ref2},"data-id":"tooltip"}),placeholder)}}}]);return ReactTooltip}(_react2.default.Component),_class2.propTypes={children:_propTypes2.default.any,place:_propTypes2.default.string,type:_propTypes2.default.string,effect:_propTypes2.default.string,offset:_propTypes2.default.object,multiline:_propTypes2.default.bool,border:_propTypes2.default.bool,insecure:_propTypes2.default.bool,class:_propTypes2.default.string,className:_propTypes2.default.string,id:_propTypes2.default.string,html:_propTypes2.default.bool,delayHide:_propTypes2.default.number,delayUpdate:_propTypes2.default.number,delayShow:_propTypes2.default.number,event:_propTypes2.default.string,eventOff:_propTypes2.default.string,watchWindow:_propTypes2.default.bool,isCapture:_propTypes2.default.bool,globalEventOff:_propTypes2.default.string,getContent:_propTypes2.default.any,afterShow:_propTypes2.default.func,afterHide:_propTypes2.default.func,disable:_propTypes2.default.bool,scrollHide:_propTypes2.default.bool,resizeHide:_propTypes2.default.bool,wrapper:_propTypes2.default.string},_class2.defaultProps={insecure:true,resizeHide:true,wrapper:"div"},_class2.supportedWrappers=["div","span"],_class2.displayName="ReactTooltip",_temp))||_class)||_class)||_class)||_class)||_class)||_class;module.exports=ReactTooltip}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./decorators/customEvent":13,"./decorators/getEffect":14,"./decorators/isCapture":15,"./decorators/staticMethods":16,"./decorators/trackRemoval":17,"./decorators/windowListener":18,"./style":20,"./utils/aria":21,"./utils/getPosition":22,"./utils/getTipContent":23,"./utils/nodeListToArray":24,classnames:1,"prop-types":10}],20:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default='.__react_component_tooltip{border-radius:3px;display:inline-block;font-size:13px;left:-999em;opacity:0;padding:8px 21px;position:fixed;pointer-events:none;transition:opacity 0.3s ease-out;top:-999em;visibility:hidden;z-index:999}.__react_component_tooltip.allow_hover{pointer-events:auto}.__react_component_tooltip:before,.__react_component_tooltip:after{content:"";width:0;height:0;position:absolute}.__react_component_tooltip.show{opacity:0.9;margin-top:0px;margin-left:0px;visibility:visible}.__react_component_tooltip.type-dark{color:#fff;background-color:#222}.__react_component_tooltip.type-dark.place-top:after{border-top-color:#222;border-top-style:solid;border-top-width:6px}.__react_component_tooltip.type-dark.place-bottom:after{border-bottom-color:#222;border-bottom-style:solid;border-bottom-width:6px}.__react_component_tooltip.type-dark.place-left:after{border-left-color:#222;border-left-style:solid;border-left-width:6px}.__react_component_tooltip.type-dark.place-right:after{border-right-color:#222;border-right-style:solid;border-right-width:6px}.__react_component_tooltip.type-dark.border{border:1px solid #fff}.__react_component_tooltip.type-dark.border.place-top:before{border-top:8px solid #fff}.__react_component_tooltip.type-dark.border.place-bottom:before{border-bottom:8px solid #fff}.__react_component_tooltip.type-dark.border.place-left:before{border-left:8px solid #fff}.__react_component_tooltip.type-dark.border.place-right:before{border-right:8px solid #fff}.__react_component_tooltip.type-success{color:#fff;background-color:#8DC572}.__react_component_tooltip.type-success.place-top:after{border-top-color:#8DC572;border-top-style:solid;border-top-width:6px}.__react_component_tooltip.type-success.place-bottom:after{border-bottom-color:#8DC572;border-bottom-style:solid;border-bottom-width:6px}.__react_component_tooltip.type-success.place-left:after{border-left-color:#8DC572;border-left-style:solid;border-left-width:6px}.__react_component_tooltip.type-success.place-right:after{border-right-color:#8DC572;border-right-style:solid;border-right-width:6px}.__react_component_tooltip.type-success.border{border:1px solid #fff}.__react_component_tooltip.type-success.border.place-top:before{border-top:8px solid #fff}.__react_component_tooltip.type-success.border.place-bottom:before{border-bottom:8px solid #fff}.__react_component_tooltip.type-success.border.place-left:before{border-left:8px solid #fff}.__react_component_tooltip.type-success.border.place-right:before{border-right:8px solid #fff}.__react_component_tooltip.type-warning{color:#fff;background-color:#F0AD4E}.__react_component_tooltip.type-warning.place-top:after{border-top-color:#F0AD4E;border-top-style:solid;border-top-width:6px}.__react_component_tooltip.type-warning.place-bottom:after{border-bottom-color:#F0AD4E;border-bottom-style:solid;border-bottom-width:6px}.__react_component_tooltip.type-warning.place-left:after{border-left-color:#F0AD4E;border-left-style:solid;border-left-width:6px}.__react_component_tooltip.type-warning.place-right:after{border-right-color:#F0AD4E;border-right-style:solid;border-right-width:6px}.__react_component_tooltip.type-warning.border{border:1px solid #fff}.__react_component_tooltip.type-warning.border.place-top:before{border-top:8px solid #fff}.__react_component_tooltip.type-warning.border.place-bottom:before{border-bottom:8px solid #fff}.__react_component_tooltip.type-warning.border.place-left:before{border-left:8px solid #fff}.__react_component_tooltip.type-warning.border.place-right:before{border-right:8px solid #fff}.__react_component_tooltip.type-error{color:#fff;background-color:#BE6464}.__react_component_tooltip.type-error.place-top:after{border-top-color:#BE6464;border-top-style:solid;border-top-width:6px}.__react_component_tooltip.type-error.place-bottom:after{border-bottom-color:#BE6464;border-bottom-style:solid;border-bottom-width:6px}.__react_component_tooltip.type-error.place-left:after{border-left-color:#BE6464;border-left-style:solid;border-left-width:6px}.__react_component_tooltip.type-error.place-right:after{border-right-color:#BE6464;border-right-style:solid;border-right-width:6px}.__react_component_tooltip.type-error.border{border:1px solid #fff}.__react_component_tooltip.type-error.border.place-top:before{border-top:8px solid #fff}.__react_component_tooltip.type-error.border.place-bottom:before{border-bottom:8px solid #fff}.__react_component_tooltip.type-error.border.place-left:before{border-left:8px solid #fff}.__react_component_tooltip.type-error.border.place-right:before{border-right:8px solid #fff}.__react_component_tooltip.type-info{color:#fff;background-color:#337AB7}.__react_component_tooltip.type-info.place-top:after{border-top-color:#337AB7;border-top-style:solid;border-top-width:6px}.__react_component_tooltip.type-info.place-bottom:after{border-bottom-color:#337AB7;border-bottom-style:solid;border-bottom-width:6px}.__react_component_tooltip.type-info.place-left:after{border-left-color:#337AB7;border-left-style:solid;border-left-width:6px}.__react_component_tooltip.type-info.place-right:after{border-right-color:#337AB7;border-right-style:solid;border-right-width:6px}.__react_component_tooltip.type-info.border{border:1px solid #fff}.__react_component_tooltip.type-info.border.place-top:before{border-top:8px solid #fff}.__react_component_tooltip.type-info.border.place-bottom:before{border-bottom:8px solid #fff}.__react_component_tooltip.type-info.border.place-left:before{border-left:8px solid #fff}.__react_component_tooltip.type-info.border.place-right:before{border-right:8px solid #fff}.__react_component_tooltip.type-light{color:#222;background-color:#fff}.__react_component_tooltip.type-light.place-top:after{border-top-color:#fff;border-top-style:solid;border-top-width:6px}.__react_component_tooltip.type-light.place-bottom:after{border-bottom-color:#fff;border-bottom-style:solid;border-bottom-width:6px}.__react_component_tooltip.type-light.place-left:after{border-left-color:#fff;border-left-style:solid;border-left-width:6px}.__react_component_tooltip.type-light.place-right:after{border-right-color:#fff;border-right-style:solid;border-right-width:6px}.__react_component_tooltip.type-light.border{border:1px solid #222}.__react_component_tooltip.type-light.border.place-top:before{border-top:8px solid #222}.__react_component_tooltip.type-light.border.place-bottom:before{border-bottom:8px solid #222}.__react_component_tooltip.type-light.border.place-left:before{border-left:8px solid #222}.__react_component_tooltip.type-light.border.place-right:before{border-right:8px solid #222}.__react_component_tooltip.place-top{margin-top:-10px}.__react_component_tooltip.place-top:before{border-left:10px solid transparent;border-right:10px solid transparent;bottom:-8px;left:50%;margin-left:-10px}.__react_component_tooltip.place-top:after{border-left:8px solid transparent;border-right:8px solid transparent;bottom:-6px;left:50%;margin-left:-8px}.__react_component_tooltip.place-bottom{margin-top:10px}.__react_component_tooltip.place-bottom:before{border-left:10px solid transparent;border-right:10px solid transparent;top:-8px;left:50%;margin-left:-10px}.__react_component_tooltip.place-bottom:after{border-left:8px solid transparent;border-right:8px solid transparent;top:-6px;left:50%;margin-left:-8px}.__react_component_tooltip.place-left{margin-left:-10px}.__react_component_tooltip.place-left:before{border-top:6px solid transparent;border-bottom:6px solid transparent;right:-8px;top:50%;margin-top:-5px}.__react_component_tooltip.place-left:after{border-top:5px solid transparent;border-bottom:5px solid transparent;right:-6px;top:50%;margin-top:-4px}.__react_component_tooltip.place-right{margin-left:10px}.__react_component_tooltip.place-right:before{border-top:6px solid transparent;border-bottom:6px solid transparent;left:-8px;top:50%;margin-top:-5px}.__react_component_tooltip.place-right:after{border-top:5px solid transparent;border-bottom:5px solid transparent;left:-6px;top:50%;margin-top:-4px}.__react_component_tooltip .multi-line{display:block;padding:2px 0px;text-align:center}'},{}],21:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.parseAria=parseAria;function parseAria(props){var ariaObj={};Object.keys(props).filter(function(prop){return/(^aria-\w+$|^role$)/.test(prop)}).forEach(function(prop){ariaObj[prop]=props[prop]});return ariaObj}},{}],22:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=function(e,target,node,place,desiredPlace,effect,offset){var _getDimensions=getDimensions(node),tipWidth=_getDimensions.width,tipHeight=_getDimensions.height;var _getDimensions2=getDimensions(target),targetWidth=_getDimensions2.width,targetHeight=_getDimensions2.height;var _getCurrentOffset=getCurrentOffset(e,target,effect),mouseX=_getCurrentOffset.mouseX,mouseY=_getCurrentOffset.mouseY;var defaultOffset=getDefaultPosition(effect,targetWidth,targetHeight,tipWidth,tipHeight);var _calculateOffset=calculateOffset(offset),extraOffset_X=_calculateOffset.extraOffset_X,extraOffset_Y=_calculateOffset.extraOffset_Y;var windowWidth=window.innerWidth;var windowHeight=window.innerHeight;var _getParent=getParent(node),parentTop=_getParent.parentTop,parentLeft=_getParent.parentLeft;var getTipOffsetLeft=function getTipOffsetLeft(place){var offset_X=defaultOffset[place].l;return mouseX+offset_X+extraOffset_X};var getTipOffsetRight=function getTipOffsetRight(place){var offset_X=defaultOffset[place].r;return mouseX+offset_X+extraOffset_X};var getTipOffsetTop=function getTipOffsetTop(place){var offset_Y=defaultOffset[place].t;return mouseY+offset_Y+extraOffset_Y};var getTipOffsetBottom=function getTipOffsetBottom(place){var offset_Y=defaultOffset[place].b;return mouseY+offset_Y+extraOffset_Y};var outsideLeft=function outsideLeft(p){return getTipOffsetLeft(p)<0};var outsideRight=function outsideRight(p){return getTipOffsetRight(p)>windowWidth};var outsideTop=function outsideTop(p){return getTipOffsetTop(p)<0};var outsideBottom=function outsideBottom(p){return getTipOffsetBottom(p)>windowHeight};var outside=function outside(p){return outsideLeft(p)||outsideRight(p)||outsideTop(p)||outsideBottom(p)};var inside=function inside(p){return!outside(p)};var placesList=["top","bottom","left","right"];var insideList=[];for(var i=0;i<4;i++){var p=placesList[i];if(inside(p)){insideList.push(p)}}var isNewState=false;var newPlace=void 0;if(inside(desiredPlace)&&desiredPlace!==place){isNewState=true;newPlace=desiredPlace}else if(insideList.length>0&&outside(desiredPlace)&&outside(place)){isNewState=true;newPlace=insideList[0]}if(isNewState){return{isNewState:true,newState:{place:newPlace}}}return{isNewState:false,position:{left:parseInt(getTipOffsetLeft(place)-parentLeft,10),top:parseInt(getTipOffsetTop(place)-parentTop,10)}}};var getDimensions=function getDimensions(node){var _node$getBoundingClie=node.getBoundingClientRect(),height=_node$getBoundingClie.height,width=_node$getBoundingClie.width;return{height:parseInt(height,10),width:parseInt(width,10)}};var getCurrentOffset=function getCurrentOffset(e,currentTarget,effect){var boundingClientRect=currentTarget.getBoundingClientRect();var targetTop=boundingClientRect.top;var targetLeft=boundingClientRect.left;var _getDimensions3=getDimensions(currentTarget),targetWidth=_getDimensions3.width,targetHeight=_getDimensions3.height;if(effect==="float"){return{mouseX:e.clientX,mouseY:e.clientY}}return{mouseX:targetLeft+targetWidth/2,mouseY:targetTop+targetHeight/2}};var getDefaultPosition=function getDefaultPosition(effect,targetWidth,targetHeight,tipWidth,tipHeight){var top=void 0;var right=void 0;var bottom=void 0;var left=void 0;var disToMouse=3;var triangleHeight=2;var cursorHeight=12;if(effect==="float"){top={l:-(tipWidth/2),r:tipWidth/2,t:-(tipHeight+disToMouse+triangleHeight),b:-disToMouse};bottom={l:-(tipWidth/2),r:tipWidth/2,t:disToMouse+cursorHeight,b:tipHeight+disToMouse+triangleHeight+cursorHeight};left={l:-(tipWidth+disToMouse+triangleHeight),r:-disToMouse,t:-(tipHeight/2),b:tipHeight/2};right={l:disToMouse,r:tipWidth+disToMouse+triangleHeight,t:-(tipHeight/2),b:tipHeight/2}}else if(effect==="solid"){top={l:-(tipWidth/2),r:tipWidth/2,t:-(targetHeight/2+tipHeight+triangleHeight),b:-(targetHeight/2)};bottom={l:-(tipWidth/2),r:tipWidth/2,t:targetHeight/2,b:targetHeight/2+tipHeight+triangleHeight};left={l:-(tipWidth+targetWidth/2+triangleHeight),r:-(targetWidth/2),t:-(tipHeight/2),b:tipHeight/2};right={l:targetWidth/2,r:tipWidth+targetWidth/2+triangleHeight,t:-(tipHeight/2),b:tipHeight/2}}return{top:top,bottom:bottom,left:left,right:right}};var calculateOffset=function calculateOffset(offset){var extraOffset_X=0;var extraOffset_Y=0;if(Object.prototype.toString.apply(offset)==="[object String]"){offset=JSON.parse(offset.toString().replace(/\'/g,'"'))}for(var key in offset){if(key==="top"){extraOffset_Y-=parseInt(offset[key],10)}else if(key==="bottom"){extraOffset_Y+=parseInt(offset[key],10)}else if(key==="left"){extraOffset_X-=parseInt(offset[key],10)}else if(key==="right"){extraOffset_X+=parseInt(offset[key],10)}}return{extraOffset_X:extraOffset_X,extraOffset_Y:extraOffset_Y}};var getParent=function getParent(currentTarget){var currentParent=currentTarget;while(currentParent){if(window.getComputedStyle(currentParent).getPropertyValue("transform")!=="none")break;currentParent=currentParent.parentElement}var parentTop=currentParent&¤tParent.getBoundingClientRect().top||0;var parentLeft=currentParent&¤tParent.getBoundingClientRect().left||0;return{parentTop:parentTop,parentLeft:parentLeft}}},{}],23:[function(require,module,exports){(function(global){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=function(tip,children,getContent,multiline){if(children)return children;if(getContent!==undefined&&getContent!==null)return getContent;if(getContent===null)return null;var regexp=//;if(!multiline||multiline==="false"||!regexp.test(tip)){return tip}return tip.split(regexp).map(function(d,i){return _react2.default.createElement("span",{key:i,className:"multi-line"},d)})};var _react=typeof window!=="undefined"?window["React"]:typeof global!=="undefined"?global["React"]:null;var _react2=_interopRequireDefault(_react);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],24:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=function(nodeList){var length=nodeList.length;if(nodeList.hasOwnProperty){return Array.prototype.slice.call(nodeList)}return new Array(length).fill().map(function(index){return nodeList[index]})}},{}]},{},[19])(19)});