react-popper-tooltip
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -1,1 +0,2 @@ | ||
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});var _TooltipTrigger=require('./TooltipTrigger'),_TooltipTrigger2=_interopRequireDefault(_TooltipTrigger);function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}exports.default=_TooltipTrigger2.default; | ||
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});var _TooltipTrigger=require('./TooltipTrigger'),_TooltipTrigger2=_interopRequireDefault(_TooltipTrigger);function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}exports.default=_TooltipTrigger2.default; | ||
//# sourceMappingURL=index.js.map |
@@ -1,1 +0,2 @@ | ||
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});var _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_createClass=function(){function a(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,'value'in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),_react=require('react'),_react2=_interopRequireDefault(_react),_reactDom=require('react-dom'),_propTypes=require('prop-types'),_propTypes2=_interopRequireDefault(_propTypes),_classnames=require('classnames'),_classnames2=_interopRequireDefault(_classnames),_TooltipTrigger=require('./TooltipTrigger'),_utils=require('./utils'),_TooltipTriggerComponents=require('./TooltipTriggerComponents');function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')}function _possibleConstructorReturn(a,b){if(!a)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return b&&('object'==typeof b||'function'==typeof b)?b:a}function _inherits(a,b){if('function'!=typeof b&&null!==b)throw new TypeError('Super expression must either be null or a function, not '+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var MUTATION_OBSERVER_CONFIG={childList:!0,subtree:!0},Tooltip=function(a){function b(){var a,c,d,e;_classCallCheck(this,b);for(var f=arguments.length,g=Array(f),h=0;h<f;h++)g[h]=arguments[h];return e=(c=(d=_possibleConstructorReturn(this,(a=b.__proto__||Object.getPrototypeOf(b)).call.apply(a,[this].concat(g))),d),d._handleOutsideClick=function(a){if(!(0,_reactDom.findDOMNode)(d).contains(a.target)){var b=d.props,c=b.hideTooltip,e=b.clearScheduled,f=b.parentOutsideClickHandler;e(),c(),f&&f(a)}},d._addOutsideClickHandler=function(){return document.addEventListener('click',d._handleOutsideClick)},d._removeOutsideClickHandler=function(){return document.removeEventListener('click',d._handleOutsideClick)},c),_possibleConstructorReturn(d,e)}return _inherits(b,a),_createClass(b,[{key:'componentDidMount',value:function e(){var a=this,b=this.props.trigger,c=this.observer=new MutationObserver(function(){a.props.scheduleUpdate()});if(c.observe((0,_reactDom.findDOMNode)(this),MUTATION_OBSERVER_CONFIG),'click'===b||'right-click'===b){var d=this.props.removeParentOutsideClickHandler;document.addEventListener('click',this._handleOutsideClick),d&&d()}}},{key:'componentWillUnmount',value:function c(){var a=this.props.trigger;if(this.observer.disconnect(),'click'===a||'right-click'===a){var b=this.props.addParentOutsideClickHandler;document.removeEventListener('click',this._handleOutsideClick),b&&b()}}},{key:'componentDidUpdate',value:function a(){this.props.closeOnOutOfBoundaries&&this.props.outOfBoundaries&&this.props.hideTooltip()}},{key:'render',value:function o(){var a=this.props,b=a.innerRef,c=a.style,d=a.showArrow,e=a.arrowProps,f=a.placement,g=a.trigger,h=a.clearScheduled,i=a.scheduleHide,j=a.tooltipClassName,k=a.tooltipStyle,l=a.tooltip,m='hover'===g,n={onMouseEnter:m?h:void 0,onMouseLeave:m?i:void 0};return _react2.default.createElement(_TooltipTriggerComponents.TransitionedPopperBox,{className:'tooltip',innerRef:b,style:c},d&&_react2.default.createElement(_TooltipTriggerComponents.Arrow,{innerRef:e.ref,"data-placement":f,style:e.style}),_react2.default.createElement('span',_extends({className:(0,_classnames2.default)('tooltip-body',j),style:k},n),_react2.default.createElement(_TooltipTrigger.TooltipContext.Provider,{value:{addParentOutsideClickHandler:this._addOutsideClickHandler,removeParentOutsideClickHandler:this._removeOutsideClickHandler,parentOutsideClickHandler:this._handleOutsideClick}},(0,_utils.renderSlot)(l))))}}]),b}(_react.PureComponent);Tooltip.propTypes={innerRef:_propTypes2.default.func,style:_propTypes2.default.object,showArrow:_propTypes2.default.bool,arrowProps:_propTypes2.default.object,placement:_propTypes2.default.string,trigger:_propTypes2.default.string,clearScheduled:_propTypes2.default.func,scheduleHide:_propTypes2.default.func,tooltipClassName:_propTypes2.default.string,tooltipStyle:_propTypes2.default.object,tooltip:_propTypes2.default.node,hideTooltip:_propTypes2.default.func,parentOutsideClickHandler:_propTypes2.default.func,scheduleUpdate:_propTypes2.default.func,removeParentOutsideClickHandler:_propTypes2.default.func,addParentOutsideClickHandler:_propTypes2.default.func,closeOnOutOfBoundaries:_propTypes2.default.bool,outOfBoundaries:_propTypes2.default.bool},exports.default=Tooltip; | ||
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});var _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_createClass=function(){function a(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,'value'in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),_react=require('react'),_react2=_interopRequireDefault(_react),_reactDom=require('react-dom'),_propTypes=require('prop-types'),_propTypes2=_interopRequireDefault(_propTypes),_classnames=require('classnames'),_classnames2=_interopRequireDefault(_classnames),_TooltipTrigger=require('./TooltipTrigger'),_utils=require('./utils'),_TooltipTriggerComponents=require('./TooltipTriggerComponents');function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')}function _possibleConstructorReturn(a,b){if(!a)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return b&&('object'==typeof b||'function'==typeof b)?b:a}function _inherits(a,b){if('function'!=typeof b&&null!==b)throw new TypeError('Super expression must either be null or a function, not '+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var MUTATION_OBSERVER_CONFIG={childList:!0,subtree:!0},Tooltip=function(a){function b(){var a,c,d,e;_classCallCheck(this,b);for(var f=arguments.length,g=Array(f),h=0;h<f;h++)g[h]=arguments[h];return e=(c=(d=_possibleConstructorReturn(this,(a=b.__proto__||Object.getPrototypeOf(b)).call.apply(a,[this].concat(g))),d),d._handleOutsideClick=function(a){if(!(0,_reactDom.findDOMNode)(d).contains(a.target)){var b=d.props,c=b.hideTooltip,e=b.clearScheduled,f=b.parentOutsideClickHandler;e(),c(),f&&f(a)}},d._addOutsideClickHandler=function(){return document.addEventListener('click',d._handleOutsideClick)},d._removeOutsideClickHandler=function(){return document.removeEventListener('click',d._handleOutsideClick)},c),_possibleConstructorReturn(d,e)}return _inherits(b,a),_createClass(b,[{key:'componentDidMount',value:function e(){var a=this,b=this.props.trigger,c=this.observer=new MutationObserver(function(){a.props.scheduleUpdate()});if(c.observe((0,_reactDom.findDOMNode)(this),MUTATION_OBSERVER_CONFIG),'click'===b||'right-click'===b){var d=this.props.removeParentOutsideClickHandler;document.addEventListener('click',this._handleOutsideClick),d&&d()}}},{key:'componentWillUnmount',value:function c(){var a=this.props.trigger;if(this.observer.disconnect(),'click'===a||'right-click'===a){var b=this.props.addParentOutsideClickHandler;document.removeEventListener('click',this._handleOutsideClick),b&&b()}}},{key:'componentDidUpdate',value:function a(){this.props.closeOnOutOfBoundaries&&this.props.outOfBoundaries&&this.props.hideTooltip()}},{key:'render',value:function o(){var a=this.props,b=a.innerRef,c=a.style,d=a.showArrow,e=a.arrowProps,f=a.placement,g=a.trigger,h=a.clearScheduled,i=a.scheduleHide,j=a.tooltipClassName,k=a.tooltipStyle,l=a.tooltip,m='hover'===g,n={onMouseEnter:m?h:void 0,onMouseLeave:m?i:void 0};return _react2.default.createElement(_TooltipTriggerComponents.TransitionedPopperBox,{className:'tooltip',innerRef:b,style:c},d&&_react2.default.createElement(_TooltipTriggerComponents.Arrow,{innerRef:e.ref,"data-placement":f,style:e.style}),_react2.default.createElement('span',_extends({className:(0,_classnames2.default)('tooltip-body',j),style:k},n),_react2.default.createElement(_TooltipTrigger.TooltipContext.Provider,{value:{addParentOutsideClickHandler:this._addOutsideClickHandler,removeParentOutsideClickHandler:this._removeOutsideClickHandler,parentOutsideClickHandler:this._handleOutsideClick}},(0,_utils.renderSlot)(l))))}}]),b}(_react.PureComponent);Tooltip.propTypes={innerRef:_propTypes2.default.func,style:_propTypes2.default.object,showArrow:_propTypes2.default.bool,arrowProps:_propTypes2.default.object,placement:_propTypes2.default.string,trigger:_propTypes2.default.string,clearScheduled:_propTypes2.default.func,scheduleHide:_propTypes2.default.func,tooltipClassName:_propTypes2.default.string,tooltipStyle:_propTypes2.default.object,tooltip:_propTypes2.default.node,hideTooltip:_propTypes2.default.func,parentOutsideClickHandler:_propTypes2.default.func,scheduleUpdate:_propTypes2.default.func,removeParentOutsideClickHandler:_propTypes2.default.func,addParentOutsideClickHandler:_propTypes2.default.func,closeOnOutOfBoundaries:_propTypes2.default.bool,outOfBoundaries:_propTypes2.default.bool},exports.default=Tooltip; | ||
//# sourceMappingURL=Tooltip.js.map |
@@ -1,1 +0,2 @@ | ||
'use strict';Object.defineProperty(exports,'__esModule',{value:!0}),exports.TooltipContext=void 0;var _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_createClass=function(){function a(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,'value'in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),_react=require('react'),_react2=_interopRequireDefault(_react),_reactDom=require('react-dom'),_propTypes=require('prop-types'),_propTypes2=_interopRequireDefault(_propTypes),_classnames=require('classnames'),_classnames2=_interopRequireDefault(_classnames),_reactPopper=require('react-popper'),_utils=require('./utils'),_Tooltip=require('./Tooltip'),_Tooltip2=_interopRequireDefault(_Tooltip);function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')}function _possibleConstructorReturn(a,b){if(!a)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return b&&('object'==typeof b||'function'==typeof b)?b:a}function _inherits(a,b){if('function'!=typeof b&&null!==b)throw new TypeError('Super expression must either be null or a function, not '+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var AVG_REACTION_TIME=250,DEFAULT_MODIFIERS={preventOverflow:{boundariesElement:'viewport',padding:0}},TooltipContext=exports.TooltipContext=_react2.default.createContext({}),TooltipTrigger=function(a){function b(){var a,c,d,e;_classCallCheck(this,b);for(var f=arguments.length,g=Array(f),h=0;h<f;h++)g[h]=arguments[h];return e=(c=(d=_possibleConstructorReturn(this,(a=b.__proto__||Object.getPrototypeOf(b)).call.apply(a,[this].concat(g))),d),d.state={tooltipShown:d.props.isOpen},d.showTooltip=function(){return d.setState({tooltipShown:!0})},d.hideTooltip=function(){return d.setState({tooltipShown:!1})},d._getDelayHide=function(){var a=d.props,b=a.trigger,c=a.delayHide;return'hover'===b&&c<AVG_REACTION_TIME?AVG_REACTION_TIME:c},d._clearScheduled=function(){clearTimeout(d._hideTimeout),clearTimeout(d._showTimeout)},d._scheduleShow=function(a){a.preventDefault(),d._clearScheduled(),d._showTimeout=setTimeout(d.showTooltip,d.props.delayShow)},d._scheduleHide=function(a){a.preventDefault(),d._clearScheduled(),d._hideTimeout=setTimeout(d.hideTooltip,d._getDelayHide())},d._scheduleToggle=function(a){d.state.tooltipShown?d._scheduleHide(a):d._scheduleShow(a)},c),_possibleConstructorReturn(d,e)}return _inherits(b,a),_createClass(b,[{key:'componentWillUnmount',value:function a(){this._clearScheduled()}},{key:'render',value:function p(){var a=this,b=this.props,c=b.children,d=b.tooltip,e=b.placement,f=b.showArrow,g=b.trigger,h=b.modifiers,i=b.triggerClassName,j=b.triggerStyle,k=b.tooltipClassName,l=b.tooltipStyle,m=b.closeOnOutOfBoundaries,n='hover'===g,o={onClick:'click'===g?this._scheduleToggle:void 0,onContextMenu:'right-click'===g?this._scheduleToggle:void 0,onMouseEnter:n?this._scheduleShow:void 0,onMouseLeave:n?this._scheduleHide:void 0};return _react2.default.createElement(_reactPopper.Manager,null,_react2.default.createElement(_reactPopper.Reference,null,function(a){var b=a.ref;return _react2.default.createElement('span',_extends({ref:b,className:(0,_classnames2.default)('trigger',i),style:j},o),(0,_utils.renderSlot)(c))}),this.state.tooltipShown&&(0,_reactDom.createPortal)(_react2.default.createElement(_reactPopper.Popper,{placement:e,modifiers:_extends({},DEFAULT_MODIFIERS,h)},function(b){var c=b.ref,e=b.style,h=b.placement,i=b.outOfBoundaries,j=b.scheduleUpdate,n=b.arrowProps;return _react2.default.createElement(TooltipContext.Consumer,null,function(b){var o=b.addParentOutsideClickHandler,p=b.removeParentOutsideClickHandler,q=b.parentOutsideClickHandler;return _react2.default.createElement(_Tooltip2.default,_extends({style:e,showArrow:f,arrowProps:n,placement:h,trigger:g,closeOnOutOfBoundaries:m,tooltipClassName:k,tooltipStyle:l,tooltip:d,addParentOutsideClickHandler:o,removeParentOutsideClickHandler:p,parentOutsideClickHandler:q,outOfBoundaries:i,scheduleUpdate:j},{innerRef:c,hideTooltip:a.hideTooltip,clearScheduled:a._clearScheduled,scheduleHide:a._scheduleHide}))})}),document.querySelector('body')))}}]),b}(_react.PureComponent);TooltipTrigger.propTypes={children:_propTypes2.default.node.isRequired,tooltip:_propTypes2.default.node.isRequired,triggerClassName:_propTypes2.default.string,triggerStyle:_propTypes2.default.object,tooltipClassName:_propTypes2.default.string,tooltipStyle:_propTypes2.default.object,isTooltipShown:_propTypes2.default.bool,delayShow:_propTypes2.default.number,delayHide:_propTypes2.default.number,showArrow:_propTypes2.default.bool,placement:_propTypes2.default.string,trigger:_propTypes2.default.oneOf(['click','hover','right-click','none']),closeOnOutOfBoundaries:_propTypes2.default.bool,modifiers:_propTypes2.default.object},TooltipTrigger.defaultProps={delayShow:0,delayHide:0,isOpen:!1,showArrow:!0,placement:'right',trigger:'hover',closeOnOutOfBoundaries:!0},exports.default=TooltipTrigger; | ||
'use strict';Object.defineProperty(exports,'__esModule',{value:!0}),exports.TooltipContext=void 0;var _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a},_createClass=function(){function a(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,'value'in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),_react=require('react'),_react2=_interopRequireDefault(_react),_reactDom=require('react-dom'),_propTypes=require('prop-types'),_propTypes2=_interopRequireDefault(_propTypes),_classnames=require('classnames'),_classnames2=_interopRequireDefault(_classnames),_reactPopper=require('react-popper'),_utils=require('./utils'),_Tooltip=require('./Tooltip'),_Tooltip2=_interopRequireDefault(_Tooltip);function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')}function _possibleConstructorReturn(a,b){if(!a)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return b&&('object'==typeof b||'function'==typeof b)?b:a}function _inherits(a,b){if('function'!=typeof b&&null!==b)throw new TypeError('Super expression must either be null or a function, not '+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var AVG_REACTION_TIME=250,DEFAULT_MODIFIERS={preventOverflow:{boundariesElement:'viewport',padding:0}},TooltipContext=exports.TooltipContext=_react2.default.createContext({}),TooltipTrigger=function(a){function b(){var a,c,d,e;_classCallCheck(this,b);for(var f=arguments.length,g=Array(f),h=0;h<f;h++)g[h]=arguments[h];return e=(c=(d=_possibleConstructorReturn(this,(a=b.__proto__||Object.getPrototypeOf(b)).call.apply(a,[this].concat(g))),d),d.state={tooltipShown:d.props.isTooltipShown},d.showTooltip=function(){return d.setState({tooltipShown:!0})},d.hideTooltip=function(){return d.setState({tooltipShown:!1})},d._getDelayHide=function(){var a=d.props,b=a.trigger,c=a.delayHide;return'hover'===b&&c<AVG_REACTION_TIME?AVG_REACTION_TIME:c},d._clearScheduled=function(){clearTimeout(d._hideTimeout),clearTimeout(d._showTimeout)},d._scheduleShow=function(a){a.preventDefault(),d._clearScheduled(),d._showTimeout=setTimeout(d.showTooltip,d.props.delayShow)},d._scheduleHide=function(a){a.preventDefault(),d._clearScheduled(),d._hideTimeout=setTimeout(d.hideTooltip,d._getDelayHide())},d._scheduleToggle=function(a){d.state.tooltipShown?d._scheduleHide(a):d._scheduleShow(a)},c),_possibleConstructorReturn(d,e)}return _inherits(b,a),_createClass(b,[{key:'componentWillUnmount',value:function a(){this._clearScheduled()}},{key:'render',value:function p(){var a=this,b=this.props,c=b.children,d=b.tooltip,e=b.placement,f=b.showArrow,g=b.trigger,h=b.modifiers,i=b.triggerClassName,j=b.triggerStyle,k=b.tooltipClassName,l=b.tooltipStyle,m=b.closeOnOutOfBoundaries,n='hover'===g,o={onClick:'click'===g?this._scheduleToggle:void 0,onContextMenu:'right-click'===g?this._scheduleToggle:void 0,onMouseEnter:n?this._scheduleShow:void 0,onMouseLeave:n?this._scheduleHide:void 0};return _react2.default.createElement(_reactPopper.Manager,null,_react2.default.createElement(_reactPopper.Reference,null,function(a){var b=a.ref;return _react2.default.createElement('span',_extends({ref:b,className:(0,_classnames2.default)('trigger',i),style:j},o),(0,_utils.renderSlot)(c))}),this.state.tooltipShown&&(0,_reactDom.createPortal)(_react2.default.createElement(_reactPopper.Popper,{placement:e,modifiers:_extends({},DEFAULT_MODIFIERS,h)},function(b){var c=b.ref,e=b.style,h=b.placement,i=b.outOfBoundaries,j=b.scheduleUpdate,n=b.arrowProps;return _react2.default.createElement(TooltipContext.Consumer,null,function(b){var o=b.addParentOutsideClickHandler,p=b.removeParentOutsideClickHandler,q=b.parentOutsideClickHandler;return _react2.default.createElement(_Tooltip2.default,_extends({style:e,showArrow:f,arrowProps:n,placement:h,trigger:g,closeOnOutOfBoundaries:m,tooltipClassName:k,tooltipStyle:l,tooltip:d,addParentOutsideClickHandler:o,removeParentOutsideClickHandler:p,parentOutsideClickHandler:q,outOfBoundaries:i,scheduleUpdate:j},{innerRef:c,hideTooltip:a.hideTooltip,clearScheduled:a._clearScheduled,scheduleHide:a._scheduleHide}))})}),document.querySelector('body')))}}]),b}(_react.PureComponent);TooltipTrigger.propTypes={children:_propTypes2.default.node.isRequired,tooltip:_propTypes2.default.node.isRequired,triggerClassName:_propTypes2.default.string,triggerStyle:_propTypes2.default.object,tooltipClassName:_propTypes2.default.string,tooltipStyle:_propTypes2.default.object,isTooltipShown:_propTypes2.default.bool,delayShow:_propTypes2.default.number,delayHide:_propTypes2.default.number,showArrow:_propTypes2.default.bool,placement:_propTypes2.default.string,trigger:_propTypes2.default.oneOf(['click','hover','right-click','none']),closeOnOutOfBoundaries:_propTypes2.default.bool,modifiers:_propTypes2.default.object},TooltipTrigger.defaultProps={delayShow:0,delayHide:0,isOpen:!1,showArrow:!0,placement:'right',trigger:'hover',closeOnOutOfBoundaries:!0},exports.default=TooltipTrigger; | ||
//# sourceMappingURL=TooltipTrigger.js.map |
@@ -1,1 +0,2 @@ | ||
'use strict';Object.defineProperty(exports,'__esModule',{value:!0}),exports.Arrow=exports.TransitionedPopperBox=exports.PopperBox=void 0;var _templateObject=_taggedTemplateLiteral(['\n z-index: 999;\n display: flex;\n flex-direction: column;\n justify-content: center;\n background-color: white;\n border: 1px solid silver;\n border-radius: 3px;\n margin: 0.4rem;\n box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);\n ',';\n'],['\n z-index: 999;\n display: flex;\n flex-direction: column;\n justify-content: center;\n background-color: white;\n border: 1px solid silver;\n border-radius: 3px;\n margin: 0.4rem;\n box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);\n ',';\n']),_templateObject2=_taggedTemplateLiteral(['\n transition: opacity 0.3s;\n'],['\n transition: opacity 0.3s;\n']),_templateObject3=_taggedTemplateLiteral(['\n position: absolute;\n width: 1rem;\n height: 1rem;\n &[data-placement*=\'bottom\'] {\n top: 0;\n left: 0;\n margin-top: -0.4rem;\n width: 1rem;\n height: 1rem;\n &::before {\n border-width: 0 0.5rem 0.4rem 0.5rem;\n border-color: transparent transparent silver transparent;\n position: absolute;\n top: -1px;\n }\n &::after {\n border-width: 0 0.5rem 0.4rem 0.5rem;\n border-color: transparent transparent white transparent;\n }\n }\n &[data-placement*=\'top\'] {\n bottom: 0;\n left: 0;\n margin-bottom: -1rem;\n width: 1rem;\n height: 1rem;\n &::before {\n border-width: 0.4rem 0.5rem 0 0.5rem;\n border-color: silver transparent transparent transparent;\n position: absolute;\n top: 1px;\n }\n &::after {\n border-width: 0.4rem 0.5rem 0 0.5rem;\n border-color: white transparent transparent transparent;\n }\n }\n &[data-placement*=\'right\'] {\n left: 0;\n margin-left: -0.7rem;\n height: 1rem;\n width: 1rem;\n &::before {\n border-width: 0.5rem 0.4rem 0.5rem 0;\n border-color: transparent silver transparent transparent;\n }\n &::after {\n border-width: 0.5rem 0.4rem 0.5rem 0;\n border-color: transparent white transparent transparent;\n top: 0px;\n left: 6px;\n }\n }\n &[data-placement*=\'left\'] {\n right: 0;\n margin-right: -0.7rem;\n height: 1rem;\n width: 1rem;\n &::before {\n border-width: 0.5rem 0 0.5rem 0.4em;\n border-color: transparent transparent transparent silver;\n }\n &::after {\n border-width: 0.5rem 0 0.5rem 0.4em;\n border-color: transparent transparent transparent white;\n top: 0;\n left: 4px;\n }\n }\n &::before {\n content: \'\';\n margin: auto;\n display: block;\n width: 0;\n height: 0;\n border-style: solid;\n }\n &::after {\n content: \'\';\n margin: auto;\n display: block;\n width: 0;\n height: 0;\n border-style: solid;\n position: absolute;\n }\n'],['\n position: absolute;\n width: 1rem;\n height: 1rem;\n &[data-placement*=\'bottom\'] {\n top: 0;\n left: 0;\n margin-top: -0.4rem;\n width: 1rem;\n height: 1rem;\n &::before {\n border-width: 0 0.5rem 0.4rem 0.5rem;\n border-color: transparent transparent silver transparent;\n position: absolute;\n top: -1px;\n }\n &::after {\n border-width: 0 0.5rem 0.4rem 0.5rem;\n border-color: transparent transparent white transparent;\n }\n }\n &[data-placement*=\'top\'] {\n bottom: 0;\n left: 0;\n margin-bottom: -1rem;\n width: 1rem;\n height: 1rem;\n &::before {\n border-width: 0.4rem 0.5rem 0 0.5rem;\n border-color: silver transparent transparent transparent;\n position: absolute;\n top: 1px;\n }\n &::after {\n border-width: 0.4rem 0.5rem 0 0.5rem;\n border-color: white transparent transparent transparent;\n }\n }\n &[data-placement*=\'right\'] {\n left: 0;\n margin-left: -0.7rem;\n height: 1rem;\n width: 1rem;\n &::before {\n border-width: 0.5rem 0.4rem 0.5rem 0;\n border-color: transparent silver transparent transparent;\n }\n &::after {\n border-width: 0.5rem 0.4rem 0.5rem 0;\n border-color: transparent white transparent transparent;\n top: 0px;\n left: 6px;\n }\n }\n &[data-placement*=\'left\'] {\n right: 0;\n margin-right: -0.7rem;\n height: 1rem;\n width: 1rem;\n &::before {\n border-width: 0.5rem 0 0.5rem 0.4em;\n border-color: transparent transparent transparent silver;\n }\n &::after {\n border-width: 0.5rem 0 0.5rem 0.4em;\n border-color: transparent transparent transparent white;\n top: 0;\n left: 4px;\n }\n }\n &::before {\n content: \'\';\n margin: auto;\n display: block;\n width: 0;\n height: 0;\n border-style: solid;\n }\n &::after {\n content: \'\';\n margin: auto;\n display: block;\n width: 0;\n height: 0;\n border-style: solid;\n position: absolute;\n }\n']),_reactEmotion=require('react-emotion'),_reactEmotion2=_interopRequireDefault(_reactEmotion);function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _taggedTemplateLiteral(a,b){return Object.freeze(Object.defineProperties(a,{raw:{value:Object.freeze(b)}}))}var PopperBox=exports.PopperBox=(0,_reactEmotion2.default)('div')(_templateObject,function(a){return a.popperStyle}),TransitionedPopperBox=exports.TransitionedPopperBox=(0,_reactEmotion2.default)(PopperBox)(_templateObject2),Arrow=exports.Arrow=(0,_reactEmotion2.default)('div')(_templateObject3); | ||
'use strict';Object.defineProperty(exports,'__esModule',{value:!0}),exports.Arrow=exports.TransitionedPopperBox=exports.PopperBox=void 0;var _templateObject=_taggedTemplateLiteral(['\n z-index: 999;\n display: flex;\n flex-direction: column;\n justify-content: center;\n background-color: white;\n border: 1px solid silver;\n border-radius: 3px;\n margin: 0.4rem;\n box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);\n ',';\n'],['\n z-index: 999;\n display: flex;\n flex-direction: column;\n justify-content: center;\n background-color: white;\n border: 1px solid silver;\n border-radius: 3px;\n margin: 0.4rem;\n box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);\n ',';\n']),_templateObject2=_taggedTemplateLiteral(['\n transition: opacity 0.3s;\n'],['\n transition: opacity 0.3s;\n']),_templateObject3=_taggedTemplateLiteral(['\n position: absolute;\n width: 1rem;\n height: 1rem;\n &[data-placement*=\'bottom\'] {\n top: 0;\n left: 0;\n margin-top: -0.4rem;\n width: 1rem;\n height: 1rem;\n &::before {\n border-width: 0 0.5rem 0.4rem 0.5rem;\n border-color: transparent transparent silver transparent;\n position: absolute;\n top: -1px;\n }\n &::after {\n border-width: 0 0.5rem 0.4rem 0.5rem;\n border-color: transparent transparent white transparent;\n }\n }\n &[data-placement*=\'top\'] {\n bottom: 0;\n left: 0;\n margin-bottom: -1rem;\n width: 1rem;\n height: 1rem;\n &::before {\n border-width: 0.4rem 0.5rem 0 0.5rem;\n border-color: silver transparent transparent transparent;\n position: absolute;\n top: 1px;\n }\n &::after {\n border-width: 0.4rem 0.5rem 0 0.5rem;\n border-color: white transparent transparent transparent;\n }\n }\n &[data-placement*=\'right\'] {\n left: 0;\n margin-left: -0.7rem;\n height: 1rem;\n width: 1rem;\n &::before {\n border-width: 0.5rem 0.4rem 0.5rem 0;\n border-color: transparent silver transparent transparent;\n }\n &::after {\n border-width: 0.5rem 0.4rem 0.5rem 0;\n border-color: transparent white transparent transparent;\n top: 0px;\n left: 6px;\n }\n }\n &[data-placement*=\'left\'] {\n right: 0;\n margin-right: -0.7rem;\n height: 1rem;\n width: 1rem;\n &::before {\n border-width: 0.5rem 0 0.5rem 0.4em;\n border-color: transparent transparent transparent silver;\n }\n &::after {\n border-width: 0.5rem 0 0.5rem 0.4em;\n border-color: transparent transparent transparent white;\n top: 0;\n left: 4px;\n }\n }\n &::before {\n content: \'\';\n margin: auto;\n display: block;\n width: 0;\n height: 0;\n border-style: solid;\n }\n &::after {\n content: \'\';\n margin: auto;\n display: block;\n width: 0;\n height: 0;\n border-style: solid;\n position: absolute;\n }\n'],['\n position: absolute;\n width: 1rem;\n height: 1rem;\n &[data-placement*=\'bottom\'] {\n top: 0;\n left: 0;\n margin-top: -0.4rem;\n width: 1rem;\n height: 1rem;\n &::before {\n border-width: 0 0.5rem 0.4rem 0.5rem;\n border-color: transparent transparent silver transparent;\n position: absolute;\n top: -1px;\n }\n &::after {\n border-width: 0 0.5rem 0.4rem 0.5rem;\n border-color: transparent transparent white transparent;\n }\n }\n &[data-placement*=\'top\'] {\n bottom: 0;\n left: 0;\n margin-bottom: -1rem;\n width: 1rem;\n height: 1rem;\n &::before {\n border-width: 0.4rem 0.5rem 0 0.5rem;\n border-color: silver transparent transparent transparent;\n position: absolute;\n top: 1px;\n }\n &::after {\n border-width: 0.4rem 0.5rem 0 0.5rem;\n border-color: white transparent transparent transparent;\n }\n }\n &[data-placement*=\'right\'] {\n left: 0;\n margin-left: -0.7rem;\n height: 1rem;\n width: 1rem;\n &::before {\n border-width: 0.5rem 0.4rem 0.5rem 0;\n border-color: transparent silver transparent transparent;\n }\n &::after {\n border-width: 0.5rem 0.4rem 0.5rem 0;\n border-color: transparent white transparent transparent;\n top: 0px;\n left: 6px;\n }\n }\n &[data-placement*=\'left\'] {\n right: 0;\n margin-right: -0.7rem;\n height: 1rem;\n width: 1rem;\n &::before {\n border-width: 0.5rem 0 0.5rem 0.4em;\n border-color: transparent transparent transparent silver;\n }\n &::after {\n border-width: 0.5rem 0 0.5rem 0.4em;\n border-color: transparent transparent transparent white;\n top: 0;\n left: 4px;\n }\n }\n &::before {\n content: \'\';\n margin: auto;\n display: block;\n width: 0;\n height: 0;\n border-style: solid;\n }\n &::after {\n content: \'\';\n margin: auto;\n display: block;\n width: 0;\n height: 0;\n border-style: solid;\n position: absolute;\n }\n']),_reactEmotion=require('react-emotion'),_reactEmotion2=_interopRequireDefault(_reactEmotion);function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _taggedTemplateLiteral(a,b){return Object.freeze(Object.defineProperties(a,{raw:{value:Object.freeze(b)}}))}var PopperBox=exports.PopperBox=(0,_reactEmotion2.default)('div')(_templateObject,function(a){return a.popperStyle}),TransitionedPopperBox=exports.TransitionedPopperBox=(0,_reactEmotion2.default)(PopperBox)(_templateObject2),Arrow=exports.Arrow=(0,_reactEmotion2.default)('div')(_templateObject3); | ||
//# sourceMappingURL=TooltipTriggerComponents.js.map |
@@ -1,1 +0,2 @@ | ||
'use strict';Object.defineProperty(exports,'__esModule',{value:!0}),exports.renderSlot=void 0;var _react=require('react'),_react2=_interopRequireDefault(_react),_classnames=require('classnames'),_classnames2=_interopRequireDefault(_classnames),_lodash=require('lodash'),_lodash2=_interopRequireDefault(_lodash);function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}var renderSlot=exports.renderSlot=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};if(_lodash2.default.isFunction(a)){var c=b;return _lodash2.default.isFunction(b)&&(c=c()),_react2.default.createElement(a,c)}if(_react2.default.isValidElement(a)){var d=b;return _lodash2.default.isFunction(b)?d=d(a.props):d.className&&(d.className=(0,_classnames2.default)(d.className,a.props.className)),_react2.default.cloneElement(a,d)}return a}; | ||
'use strict';Object.defineProperty(exports,'__esModule',{value:!0}),exports.renderSlot=void 0;var _react=require('react'),_react2=_interopRequireDefault(_react),_classnames=require('classnames'),_classnames2=_interopRequireDefault(_classnames),_lodash=require('lodash'),_lodash2=_interopRequireDefault(_lodash);function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}var renderSlot=exports.renderSlot=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};if(_lodash2.default.isFunction(a)){var c=b;return _lodash2.default.isFunction(b)&&(c=c()),_react2.default.createElement(a,c)}if(_react2.default.isValidElement(a)){var d=b;return _lodash2.default.isFunction(b)?d=d(a.props):d.className&&(d.className=(0,_classnames2.default)(d.className,a.props.className)),_react2.default.cloneElement(a,d)}return a}; | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "react-popper-tooltip", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "React tooltip library built around react-popper", | ||
@@ -12,3 +12,3 @@ "homepage": "https://codesandbox.io/s/pykkz77z5j", | ||
"scripts": { | ||
"prepare": "babel src -d dist" | ||
"prepare": "babel src -d dist -s" | ||
}, | ||
@@ -15,0 +15,0 @@ "keywords": [ |
@@ -104,3 +104,3 @@ /** | ||
state = { | ||
tooltipShown: this.props.isOpen | ||
tooltipShown: this.props.isTooltipShown | ||
}; | ||
@@ -107,0 +107,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
57949
21
543
4