diff --git a/src/utils/getPosition.js b/src/utils/getPosition.js index 109eb7fc9..8e4cb354d 100644 --- a/src/utils/getPosition.js +++ b/src/utils/getPosition.js @@ -21,54 +21,116 @@ export default function (e, target, node, place, effect, offset) { const defaultOffset = getDefaultPosition(effect, target.clientWidth, target.clientHeight, tipWidth, tipHeight) const {extraOffset_X, extraOffset_Y} = calculateOffset(offset) - const widnowWidth = window.innerWidth + const windowWidth = window.innerWidth const windowHeight = window.innerHeight // Get the edge offset of the tooltip const getTipOffsetLeft = (place) => { - const offset_X = defaultOffset[place].x + const offset_X = defaultOffset[place].l + return mouseX + offset_X + extraOffset_X + } + const getTipOffsetRight = (place) => { + const offset_X = defaultOffset[place].r return mouseX + offset_X + extraOffset_X } const getTipOffsetTop = (place) => { - const offset_Y = defaultOffset[place].y + const offset_Y = defaultOffset[place].t + return mouseY + offset_Y + extraOffset_Y + } + const getTipOffsetBottom = (place) => { + const offset_Y = defaultOffset[place].b return mouseY + offset_Y + extraOffset_Y } // Judge if the tooltip has over the window(screen) + const outsideVertical = () => { + // Check for horazontal tooltip, if their vertical out of screen + let result = false + let newPlace + if (getTipOffsetTop('left') < 0 && getTipOffsetBottom('left') <= windowHeight) { + result = true + newPlace = 'bottom' + } else if (getTipOffsetBottom('left') > windowHeight && getTipOffsetTop('left') >= 0) { + result = true + newPlace = 'top' + } + if (result && outsideHorizontal().result) result = false + return {result, newPlace} + } const outsideLeft = () => { - // if switch to right will out of screen, return false because switch placement doesn't make sense - return getTipOffsetLeft('left') < 0 && getTipOffsetLeft('right') <= widnowWidth + // For horizontal tooltip, if vertical out of screen, change the vertical place + let {result, newPlace} = outsideVertical() + if (!result && getTipOffsetLeft('left') < 0 && getTipOffsetRight('right') <= windowWidth) { + result = true + newPlace = 'right' + } + return {result, newPlace} } const outsideRight = () => { - return getTipOffsetLeft('right') > widnowWidth && getTipOffsetLeft('left') >= 0 + let {result, newPlace} = outsideVertical() + if (!result && getTipOffsetRight('right') > windowWidth && getTipOffsetLeft('left') >= 0) { + result = true + newPlace = 'left' + } + return {result, newPlace} + } + + const outsideHorizontal = () => { + let result = false + let newPlace + if (getTipOffsetLeft('top') < 0 && getTipOffsetRight('top') <= windowWidth) { + result = true + newPlace = 'right' + } else if (getTipOffsetRight('top') > windowWidth && getTipOffsetLeft('top') >= 0) { + result = true + newPlace = 'left' + } + + if (result && outsideVertical().result) result = false + return {result, newPlace} } const outsideTop = () => { - return getTipOffsetTop('top') < 0 && getTipOffsetTop('bottom') + tipHeight <= windowHeight + let {result, newPlace} = outsideHorizontal() + if (!result && getTipOffsetTop('top') < 0 && getTipOffsetBottom('bottom') <= windowHeight) { + result = true + newPlace = 'bottom' + } + return {result, newPlace} } const outsideBottom = () => { - return getTipOffsetTop('bottom') + tipHeight > windowHeight && getTipOffsetTop('top') >= 0 + let {result, newPlace} = outsideHorizontal() + if (!result && getTipOffsetBottom('bottom') > windowHeight && getTipOffsetTop('top') >= 0) { + result = true + newPlace = 'top' + } + return {result, newPlace} } // Return new state to change the placement to the reverse if possible - if (place === 'left' && outsideLeft()) { + const outsideLeftResult = outsideLeft() + const outsideRightResult = outsideRight() + const outsideTopResult = outsideTop() + const outsideBottomResult = outsideBottom() + + if (place === 'left' && outsideLeftResult.result) { return { isNewState: true, - newState: {place: 'right'} + newState: {place: outsideLeftResult.newPlace} } - } else if (place === 'right' && outsideRight()) { + } else if (place === 'right' && outsideRightResult.result) { return { isNewState: true, - newState: {place: 'left'} + newState: {place: outsideRightResult.newPlace} } - } else if (place === 'top' && outsideTop()) { + } else if (place === 'top' && outsideTopResult.result) { return { isNewState: true, - newState: {place: 'bottom'} + newState: {place: outsideTopResult.newPlace} } - } else if (place === 'bottom' && outsideBottom()) { + } else if (place === 'bottom' && outsideBottomResult.result) { return { isNewState: true, - newState: {place: 'top'} + newState: {place: outsideBottomResult.newPlace} } } @@ -109,19 +171,59 @@ const getDefaultPosition = (effect, targetWidth, targetHeight, tipWidth, tipHeig let right let bottom let left - const disToMouse = 15 - const triangleHeight = 5 + const disToMouse = 8 + const triangleHeight = 2 if (effect === 'float') { - top = {x: -(tipWidth / 2), y: -(tipHeight + disToMouse - triangleHeight)} - bottom = {x: -(tipWidth / 2), y: disToMouse} - left = {x: -(tipWidth + disToMouse - triangleHeight), y: -(tipHeight / 2)} - right = {x: disToMouse, y: -(tipHeight / 2)} + top = { + l: -(tipWidth / 2), + r: tipWidth / 2, + t: -(tipHeight + disToMouse + triangleHeight), + b: -disToMouse + } + bottom = { + l: -(tipWidth / 2), + r: tipWidth / 2, + t: disToMouse, + b: tipHeight + disToMouse + triangleHeight + } + 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 = {x: -(tipWidth / 2), y: -(targetHeight / 2 + tipHeight)} - bottom = {x: -(tipWidth / 2), y: targetHeight / 2} - left = {x: -(tipWidth + targetWidth / 2), y: -(tipHeight / 2)} - right = {x: targetWidth / 2, y: -(tipHeight / 2)} + 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, bottom, left, right} diff --git a/standalone/react-tooltip.js b/standalone/react-tooltip.js index d043b89f2..9436f843b 100644 --- a/standalone/react-tooltip.js +++ b/standalone/react-tooltip.js @@ -714,54 +714,133 @@ exports.default = function (e, target, node, place, effect, offset) { var extraOffset_Y = _calculateOffset.extraOffset_Y; - var widnowWidth = window.innerWidth; + var windowWidth = window.innerWidth; var windowHeight = window.innerHeight; // Get the edge offset of the tooltip var getTipOffsetLeft = function getTipOffsetLeft(place) { - var offset_X = defaultOffset[place].x; + 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].y; + 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; }; // Judge if the tooltip has over the window(screen) + var outsideVertical = function outsideVertical() { + // Check for horazontal tooltip, if their vertical out of screen + var result = false; + var newPlace = void 0; + if (getTipOffsetTop('left') < 0 && getTipOffsetBottom('left') <= windowHeight) { + result = true; + newPlace = 'bottom'; + } else if (getTipOffsetBottom('left') > windowHeight && getTipOffsetTop('left') >= 0) { + result = true; + newPlace = 'top'; + } + if (result && outsideHorizontal().result) result = false; + return { result: result, newPlace: newPlace }; + }; var outsideLeft = function outsideLeft() { - // if switch to right will out of screen, return false because switch placement doesn't make sense - return getTipOffsetLeft('left') < 0 && getTipOffsetLeft('right') <= widnowWidth; + // For horizontal tooltip, if vertical out of screen, change the vertical place + + var _outsideVertical = outsideVertical(); + + var result = _outsideVertical.result; + var newPlace = _outsideVertical.newPlace; + + if (!result && getTipOffsetLeft('left') < 0 && getTipOffsetRight('right') <= windowWidth) { + result = true; + newPlace = 'right'; + } + return { result: result, newPlace: newPlace }; }; var outsideRight = function outsideRight() { - return getTipOffsetLeft('right') > widnowWidth && getTipOffsetLeft('left') >= 0; + var _outsideVertical2 = outsideVertical(); + + var result = _outsideVertical2.result; + var newPlace = _outsideVertical2.newPlace; + + if (!result && getTipOffsetRight('right') > windowWidth && getTipOffsetLeft('left') >= 0) { + result = true; + newPlace = 'left'; + } + return { result: result, newPlace: newPlace }; + }; + + var outsideHorizontal = function outsideHorizontal() { + var result = false; + var newPlace = void 0; + if (getTipOffsetLeft('top') < 0 && getTipOffsetRight('top') <= windowWidth) { + result = true; + newPlace = 'right'; + } else if (getTipOffsetRight('top') > windowWidth && getTipOffsetLeft('top') >= 0) { + result = true; + newPlace = 'left'; + } + + if (result && outsideVertical().result) result = false; + return { result: result, newPlace: newPlace }; }; var outsideTop = function outsideTop() { - return getTipOffsetTop('top') < 0 && getTipOffsetTop('bottom') + tipHeight <= windowHeight; + var _outsideHorizontal = outsideHorizontal(); + + var result = _outsideHorizontal.result; + var newPlace = _outsideHorizontal.newPlace; + + if (!result && getTipOffsetTop('top') < 0 && getTipOffsetBottom('bottom') <= windowHeight) { + result = true; + newPlace = 'bottom'; + } + return { result: result, newPlace: newPlace }; }; var outsideBottom = function outsideBottom() { - return getTipOffsetTop('bottom') + tipHeight > windowHeight && getTipOffsetTop('top') >= 0; + var _outsideHorizontal2 = outsideHorizontal(); + + var result = _outsideHorizontal2.result; + var newPlace = _outsideHorizontal2.newPlace; + + if (!result && getTipOffsetBottom('bottom') > windowHeight && getTipOffsetTop('top') >= 0) { + result = true; + newPlace = 'top'; + } + return { result: result, newPlace: newPlace }; }; // Return new state to change the placement to the reverse if possible - if (place === 'left' && outsideLeft()) { + var outsideLeftResult = outsideLeft(); + var outsideRightResult = outsideRight(); + var outsideTopResult = outsideTop(); + var outsideBottomResult = outsideBottom(); + + if (place === 'left' && outsideLeftResult.result) { return { isNewState: true, - newState: { place: 'right' } + newState: { place: outsideLeftResult.newPlace } }; - } else if (place === 'right' && outsideRight()) { + } else if (place === 'right' && outsideRightResult.result) { return { isNewState: true, - newState: { place: 'left' } + newState: { place: outsideRightResult.newPlace } }; - } else if (place === 'top' && outsideTop()) { + } else if (place === 'top' && outsideTopResult.result) { return { isNewState: true, - newState: { place: 'bottom' } + newState: { place: outsideTopResult.newPlace } }; - } else if (place === 'bottom' && outsideBottom()) { + } else if (place === 'bottom' && outsideBottomResult.result) { return { isNewState: true, - newState: { place: 'top' } + newState: { place: outsideBottomResult.newPlace } }; } @@ -818,19 +897,59 @@ var getDefaultPosition = function getDefaultPosition(effect, targetWidth, target var right = void 0; var bottom = void 0; var left = void 0; - var disToMouse = 15; - var triangleHeight = 5; + var disToMouse = 8; + var triangleHeight = 2; if (effect === 'float') { - top = { x: -(tipWidth / 2), y: -(tipHeight + disToMouse - triangleHeight) }; - bottom = { x: -(tipWidth / 2), y: disToMouse }; - left = { x: -(tipWidth + disToMouse - triangleHeight), y: -(tipHeight / 2) }; - right = { x: disToMouse, y: -(tipHeight / 2) }; + top = { + l: -(tipWidth / 2), + r: tipWidth / 2, + t: -(tipHeight + disToMouse + triangleHeight), + b: -disToMouse + }; + bottom = { + l: -(tipWidth / 2), + r: tipWidth / 2, + t: disToMouse, + b: tipHeight + disToMouse + triangleHeight + }; + 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 = { x: -(tipWidth / 2), y: -(targetHeight / 2 + tipHeight) }; - bottom = { x: -(tipWidth / 2), y: targetHeight / 2 }; - left = { x: -(tipWidth + targetWidth / 2), y: -(tipHeight / 2) }; - right = { x: targetWidth / 2, y: -(tipHeight / 2) }; + 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 }; diff --git a/standalone/react-tooltip.min.js b/standalone/react-tooltip.min.js index 282a55631..56c50065c 100644 --- a/standalone/react-tooltip.min.js +++ b/standalone/react-tooltip.min.js @@ -1 +1,3 @@ -(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 e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o0||placeholder){_this5.setState({currentEvent:e,currentTarget:eventTarget,show:true},function(){_this5.updatePosition()})}},delayTime)}},{key:"hideTooltip",value:function hideTooltip(){var _this6=this;var delayHide=this.state.delayHide;if(!this.mount)return;clearTimeout(this.delayShowLoop);clearTimeout(this.delayHideLoop);this.delayHideLoop=setTimeout(function(){_this6.setState({show:false});_this6.removeScrollListener()},parseInt(delayHide,10))}},{key:"addScrollListener",value:function addScrollListener(e){var isCaptureMode=this.isCapture(e.currentTarget);window.addEventListener("scroll",this.hideTooltip.bind(this),isCaptureMode)}},{key:"removeScrollListener",value:function removeScrollListener(){window.removeEventListener("scroll",this.hideTooltip)}},{key:"updatePosition",value:function updatePosition(){var _this7=this;var _state2=this.state;var currentEvent=_state2.currentEvent;var currentTarget=_state2.currentTarget;var place=_state2.place;var effect=_state2.effect;var offset=_state2.offset;var node=_reactDom2.default.findDOMNode(this);var result=(0,_getPosition2.default)(currentEvent,currentTarget,node,place,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(){if(!document.getElementsByTagName("head")[0].querySelector('style[id="react-tooltip"]')){var tag=document.createElement("style");tag.id="react-tooltip";tag.innerHTML=_style2.default;document.getElementsByTagName("head")[0].appendChild(tag)}}},{key:"render",value:function render(){var _state3=this.state;var placeholder=_state3.placeholder;var extraClass=_state3.extraClass;var html=_state3.html;var tooltipClass=(0,_classnames2.default)("__react_component_tooltip",{show:this.state.show},{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"});if(html){return _react2.default.createElement("div",{className:tooltipClass+" "+extraClass,"data-id":"tooltip",dangerouslySetInnerHTML:{__html:placeholder}})}else{return _react2.default.createElement("div",{className:tooltipClass+" "+extraClass,"data-id":"tooltip"},placeholder)}}}]);return ReactTooltip}(_react.Component),_class2.propTypes={children:_react.PropTypes.any,place:_react.PropTypes.string,type:_react.PropTypes.string,effect:_react.PropTypes.string,offset:_react.PropTypes.object,multiline:_react.PropTypes.bool,border:_react.PropTypes.bool,"class":_react.PropTypes.string,id:_react.PropTypes.string,html:_react.PropTypes.bool,delayHide:_react.PropTypes.number,delayShow:_react.PropTypes.number,event:_react.PropTypes.string,eventOff:_react.PropTypes.string,watchWindow:_react.PropTypes.bool,isCapture:_react.PropTypes.bool,globalEventOff:_react.PropTypes.string},_temp))||_class)||_class)||_class)||_class;module.exports=ReactTooltip}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./decorators/customEvent":3,"./decorators/isCapture":4,"./decorators/staticMethods":5,"./decorators/windowListener":6,"./style":8,"./utils/getPosition":9,"./utils/getTipContent":10,classnames:1}],8:[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 , margin-top 0.3s ease-out, margin-left 0.3s ease-out;top:-999em;visibility:hidden;z-index:999}.__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}'},{}],9:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=function(e,target,node,place,effect,offset){var tipWidth=node.clientWidth;var tipHeight=node.clientHeight;var _getCurrentOffset=getCurrentOffset(e,target,effect);var mouseX=_getCurrentOffset.mouseX;var mouseY=_getCurrentOffset.mouseY;var defaultOffset=getDefaultPosition(effect,target.clientWidth,target.clientHeight,tipWidth,tipHeight);var _calculateOffset=calculateOffset(offset);var extraOffset_X=_calculateOffset.extraOffset_X;var extraOffset_Y=_calculateOffset.extraOffset_Y;var widnowWidth=window.innerWidth;var windowHeight=window.innerHeight;var getTipOffsetLeft=function getTipOffsetLeft(place){var offset_X=defaultOffset[place].x;return mouseX+offset_X+extraOffset_X};var getTipOffsetTop=function getTipOffsetTop(place){var offset_Y=defaultOffset[place].y;return mouseY+offset_Y+extraOffset_Y};var outsideLeft=function outsideLeft(){return getTipOffsetLeft("left")<0&&getTipOffsetLeft("right")<=widnowWidth};var outsideRight=function outsideRight(){return getTipOffsetLeft("right")>widnowWidth&&getTipOffsetLeft("left")>=0};var outsideTop=function outsideTop(){return getTipOffsetTop("top")<0&&getTipOffsetTop("bottom")+tipHeight<=windowHeight};var outsideBottom=function outsideBottom(){return getTipOffsetTop("bottom")+tipHeight>windowHeight&&getTipOffsetTop("top")>=0};if(place==="left"&&outsideLeft()){return{isNewState:true,newState:{place:"right"}}}else if(place==="right"&&outsideRight()){return{isNewState:true,newState:{place:"left"}}}else if(place==="top"&&outsideTop()){return{isNewState:true,newState:{place:"bottom"}}}else if(place==="bottom"&&outsideBottom()){return{isNewState:true,newState:{place:"top"}}}return{isNewState:false,position:{left:getTipOffsetLeft(place),top:getTipOffsetTop(place)}}};var getCurrentOffset=function getCurrentOffset(e,currentTarget,effect){var boundingClientRect=currentTarget.getBoundingClientRect();var targetTop=boundingClientRect.top;var targetLeft=boundingClientRect.left;var targetWidth=currentTarget.clientWidth;var targetHeight=currentTarget.clientHeight;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=15;var triangleHeight=5;if(effect==="float"){top={x:-(tipWidth/2),y:-(tipHeight+disToMouse-triangleHeight)};bottom={x:-(tipWidth/2),y:disToMouse};left={x:-(tipWidth+disToMouse-triangleHeight),y:-(tipHeight/2)};right={x:disToMouse,y:-(tipHeight/2)}}else if(effect==="solid"){top={x:-(tipWidth/2),y:-(targetHeight/2+tipHeight)};bottom={x:-(tipWidth/2),y:targetHeight/2};left={x:-(tipWidth+targetWidth/2),y:-(tipHeight/2)};right={x:targetWidth/2,y:-(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}}},{}],10:[function(require,module,exports){(function(global){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=function(tip,children,multiline){if(children)return children;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:{})},{}]},{},[7])(7)}); \ No newline at end of file +(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 e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o0||placeholder){_this5.setState({currentEvent:e,currentTarget:eventTarget,show:true},function(){_this5.updatePosition()})}},delayTime)}},{key:"hideTooltip",value:function hideTooltip(){var _this6=this;var delayHide=this.state.delayHide;if(!this.mount)return;clearTimeout(this.delayShowLoop);clearTimeout(this.delayHideLoop);this.delayHideLoop=setTimeout(function(){_this6.setState({show:false});_this6.removeScrollListener()},parseInt(delayHide,10))}},{key:"addScrollListener",value:function addScrollListener(e){var isCaptureMode=this.isCapture(e.currentTarget);window.addEventListener("scroll",this.hideTooltip.bind(this),isCaptureMode)}},{key:"removeScrollListener",value:function removeScrollListener(){window.removeEventListener("scroll",this.hideTooltip)}},{key:"updatePosition",value:function updatePosition(){var _this7=this;var _state2=this.state;var currentEvent=_state2.currentEvent;var currentTarget=_state2.currentTarget;var place=_state2.place;var effect=_state2.effect;var offset=_state2.offset;var node=_reactDom2.default.findDOMNode(this);var result=(0,_getPosition2.default)(currentEvent,currentTarget,node,place,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(){if(!document.getElementsByTagName("head")[0].querySelector('style[id="react-tooltip"]')){var tag=document.createElement("style");tag.id="react-tooltip";tag.innerHTML=_style2.default;document.getElementsByTagName("head")[0].appendChild(tag)}}},{key:"render",value:function render(){var _state3=this.state;var placeholder=_state3.placeholder;var extraClass=_state3.extraClass;var html=_state3.html;var tooltipClass=(0,_classnames2.default)("__react_component_tooltip",{show:this.state.show},{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"});if(html){return _react2.default.createElement("div",{className:tooltipClass+" "+extraClass,"data-id":"tooltip",dangerouslySetInnerHTML:{__html:placeholder}})}else{return _react2.default.createElement("div",{className:tooltipClass+" "+extraClass,"data-id":"tooltip"},placeholder)}}}]);return ReactTooltip}(_react.Component),_class2.propTypes={children:_react.PropTypes.any,place:_react.PropTypes.string,type:_react.PropTypes.string,effect:_react.PropTypes.string,offset:_react.PropTypes.object,multiline:_react.PropTypes.bool,border:_react.PropTypes.bool,"class":_react.PropTypes.string,id:_react.PropTypes.string,html:_react.PropTypes.bool,delayHide:_react.PropTypes.number,delayShow:_react.PropTypes.number,event:_react.PropTypes.string,eventOff:_react.PropTypes.string,watchWindow:_react.PropTypes.bool,isCapture:_react.PropTypes.bool,globalEventOff:_react.PropTypes.string},_temp))||_class)||_class)||_class)||_class;module.exports=ReactTooltip}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./decorators/customEvent":3,"./decorators/isCapture":4,"./decorators/staticMethods":5,"./decorators/windowListener":6,"./style":8,"./utils/getPosition":9,"./utils/getTipContent":10,classnames:1}],8:[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 , margin-top 0.3s ease-out, margin-left 0.3s ease-out;top:-999em;visibility:hidden;z-index:999}.__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}'},{}],9:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=function(e,target,node,place,effect,offset){var tipWidth=node.clientWidth;var tipHeight=node.clientHeight;var _getCurrentOffset=getCurrentOffset(e,target,effect);var mouseX=_getCurrentOffset.mouseX;var mouseY=_getCurrentOffset.mouseY;var defaultOffset=getDefaultPosition(effect,target.clientWidth,target.clientHeight,tipWidth,tipHeight);var _calculateOffset=calculateOffset(offset);var extraOffset_X=_calculateOffset.extraOffset_X;var extraOffset_Y=_calculateOffset.extraOffset_Y;var windowWidth=window.innerWidth;var windowHeight=window.innerHeight;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 outsideVertical=function outsideVertical(){var result=false;var newPlace=void 0;if(getTipOffsetTop("left")<0&&getTipOffsetBottom("left")<=windowHeight){result=true;newPlace="bottom"}else if(getTipOffsetBottom("left")>windowHeight&&getTipOffsetTop("left")>=0){result=true;newPlace="top"}if(result&&outsideHorizontal().result)result=false;return{result:result,newPlace:newPlace}};var outsideLeft=function outsideLeft(){var _outsideVertical=outsideVertical();var result=_outsideVertical.result;var newPlace=_outsideVertical.newPlace;if(!result&&getTipOffsetLeft("left")<0&&getTipOffsetRight("right")<=windowWidth){result=true;newPlace="right"}return{result:result,newPlace:newPlace}};var outsideRight=function outsideRight(){var _outsideVertical2=outsideVertical();var result=_outsideVertical2.result;var newPlace=_outsideVertical2.newPlace;if(!result&&getTipOffsetRight("right")>windowWidth&&getTipOffsetLeft("left")>=0){result=true;newPlace="left"}return{result:result,newPlace:newPlace}};var outsideHorizontal=function outsideHorizontal(){var result=false;var newPlace=void 0;if(getTipOffsetLeft("top")<0&&getTipOffsetRight("top")<=windowWidth){result=true;newPlace="right"}else if(getTipOffsetRight("top")>windowWidth&&getTipOffsetLeft("top")>=0){result=true;newPlace="left"}if(result&&outsideVertical().result)result=false;return{result:result,newPlace:newPlace}};var outsideTop=function outsideTop(){var _outsideHorizontal=outsideHorizontal();var result=_outsideHorizontal.result;var newPlace=_outsideHorizontal.newPlace;if(!result&&getTipOffsetTop("top")<0&&getTipOffsetBottom("bottom")<=windowHeight){result=true;newPlace="bottom"}return{result:result,newPlace:newPlace}};var outsideBottom=function outsideBottom(){var _outsideHorizontal2=outsideHorizontal();var result=_outsideHorizontal2.result;var newPlace=_outsideHorizontal2.newPlace;if(!result&&getTipOffsetBottom("bottom")>windowHeight&&getTipOffsetTop("top")>=0){result=true;newPlace="top"}return{result:result,newPlace:newPlace}};var outsideLeftResult=outsideLeft();var outsideRightResult=outsideRight();var outsideTopResult=outsideTop();var outsideBottomResult=outsideBottom();if(place==="left"&&outsideLeftResult.result){return{isNewState:true,newState:{place:outsideLeftResult.newPlace}}}else if(place==="right"&&outsideRightResult.result){return{isNewState:true,newState:{place:outsideRightResult.newPlace}}}else if(place==="top"&&outsideTopResult.result){return{isNewState:true,newState:{place:outsideTopResult.newPlace}}}else if(place==="bottom"&&outsideBottomResult.result){return{isNewState:true,newState:{place:outsideBottomResult.newPlace}}}return{isNewState:false,position:{left:getTipOffsetLeft(place),top:getTipOffsetTop(place)}}};var getCurrentOffset=function getCurrentOffset(e,currentTarget,effect){var boundingClientRect=currentTarget.getBoundingClientRect();var targetTop=boundingClientRect.top;var targetLeft=boundingClientRect.left;var targetWidth=currentTarget.clientWidth;var targetHeight=currentTarget.clientHeight;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=8;var triangleHeight=2;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,b:tipHeight+disToMouse+triangleHeight};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}}},{}],10:[function(require,module,exports){(function(global){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=function(tip,children,multiline){if(children)return children;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:{}); + +},{}]},{},[7])(7)}); \ No newline at end of file