react-tooltip-lite
Advanced tools
Comparing version 1.10.0 to 1.11.0
@@ -28,2 +28,4 @@ declare module 'react-tooltip-lite' { | ||
useDefaultStyles?: boolean; | ||
zIndex: number; | ||
onToggle: (showTip: boolean) => void; | ||
} | ||
@@ -30,0 +32,0 @@ |
@@ -93,2 +93,6 @@ "use strict"; | ||
_this.handleResizeScroll = _this.handleResizeScroll.bind(_assertThisInitialized(_this)); | ||
_this.bodyTouchStart = _this.bodyTouchStart.bind(_assertThisInitialized(_this)); | ||
_this.bodyTouchEnd = _this.bodyTouchEnd.bind(_assertThisInitialized(_this)); | ||
_this.targetTouchStart = _this.targetTouchStart.bind(_assertThisInitialized(_this)); | ||
_this.targetTouchEnd = _this.targetTouchEnd.bind(_assertThisInitialized(_this)); | ||
return _this; | ||
@@ -111,2 +115,4 @@ } | ||
window.addEventListener('scroll', this.listenResizeScroll); | ||
window.addEventListener('touchstart', this.bodyTouchStart); | ||
window.addEventListener('touchEnd', this.bodyTouchEnd); | ||
} | ||
@@ -136,2 +142,4 @@ }, { | ||
window.removeEventListener('scroll', this.listenResizeScroll); | ||
window.removeEventListener('touchstart', this.bodyTouchStart); | ||
window.removeEventListener('touchEnd', this.bodyTouchEnd); | ||
clearTimeout(this.debounceTimeout); | ||
@@ -145,2 +153,8 @@ clearTimeout(this.hoverTimeout); | ||
this.debounceTimeout = setTimeout(this.handleResizeScroll, resizeThrottle); | ||
if (this.state.targetTouch) { | ||
this.setState({ | ||
targetTouch: undefined | ||
}); | ||
} | ||
} | ||
@@ -159,2 +173,33 @@ }, { | ||
}, { | ||
key: "targetTouchStart", | ||
value: function targetTouchStart() { | ||
this.setState({ | ||
targetTouch: true | ||
}); | ||
} | ||
}, { | ||
key: "targetTouchEnd", | ||
value: function targetTouchEnd() { | ||
if (this.state.targetTouch) { | ||
this.toggleTip(); | ||
} | ||
} | ||
}, { | ||
key: "bodyTouchEnd", | ||
value: function bodyTouchEnd() { | ||
if (this.state.targetTouch) { | ||
this.setState({ | ||
targetTouch: undefined | ||
}); | ||
} | ||
} | ||
}, { | ||
key: "bodyTouchStart", | ||
value: function bodyTouchStart(e) { | ||
// if it's a controlled tip we don't want to auto-dismiss, otherwise we just ignore taps inside the tip | ||
if (!(this.target && this.target.contains(e.target)) && !(this.tip && this.tip.contains(e.target)) && !this.props.isOpen) { | ||
this.hideTip(); | ||
} | ||
} | ||
}, { | ||
key: "toggleTip", | ||
@@ -167,2 +212,4 @@ value: function toggleTip() { | ||
value: function showTip() { | ||
var _this2 = this; | ||
if (!this.state.hasBeenShown) { | ||
@@ -177,2 +224,6 @@ // this will render once, then fire componentDidUpdate, which will show the tip | ||
showTip: true | ||
}, function () { | ||
if (typeof _this2.props.onToggle === 'function') { | ||
_this2.props.onToggle(_this2.state.showTip); | ||
} | ||
}); | ||
@@ -183,2 +234,4 @@ } | ||
value: function hideTip() { | ||
var _this3 = this; | ||
this.setState({ | ||
@@ -189,2 +242,6 @@ hasHover: false | ||
showTip: false | ||
}, function () { | ||
if (typeof _this3.props.onToggle === 'function') { | ||
_this3.props.onToggle(_this3.state.showTip); | ||
} | ||
}); | ||
@@ -220,3 +277,3 @@ } | ||
value: function render() { | ||
var _this2 = this; | ||
var _this4 = this; | ||
@@ -256,3 +313,3 @@ var _this$props = this.props, | ||
ref: function ref(target) { | ||
_this2.target = target; | ||
_this4.target = target; | ||
}, | ||
@@ -279,3 +336,4 @@ className: className | ||
props.onMouseLeave = tipContentHover || mouseOutDelay ? this.endHover : this.hideTip; | ||
props.onTouchStart = this.toggleTip; | ||
props.onTouchStart = this.targetTouchStart; | ||
props.onTouchEnd = this.targetTouchEnd; | ||
@@ -307,3 +365,3 @@ if (tipContentHover) { | ||
boxSizing: 'border-box', | ||
zIndex: 1000, | ||
zIndex: this.props.zIndex, | ||
position: 'absolute', | ||
@@ -317,3 +375,3 @@ display: 'inline-block' | ||
height: '0px', | ||
zIndex: 1001 | ||
zIndex: this.props.zIndex + 1 | ||
}); | ||
@@ -327,3 +385,3 @@ | ||
ref: function ref(tip) { | ||
_this2.tip = tip; | ||
_this4.tip = tip; | ||
} | ||
@@ -366,3 +424,5 @@ }, content), _react["default"].createElement("span", { | ||
useDefaultStyles: _propTypes["default"].bool, | ||
useHover: _propTypes["default"].bool | ||
useHover: _propTypes["default"].bool, | ||
zIndex: _propTypes["default"].number, | ||
onToggle: _propTypes["default"].func | ||
}); | ||
@@ -391,3 +451,5 @@ | ||
useDefaultStyles: false, | ||
useHover: true | ||
useHover: true, | ||
zIndex: 1000, | ||
onToggle: undefined | ||
}); | ||
@@ -394,0 +456,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["React","ReactDOM"],t):"object"==typeof exports?exports.ReactToolTipLite=t(require("React"),require("ReactDOM")):e.ReactToolTipLite=t(e.React,e.ReactDOM)}(window,function(e,t){return function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=3)}([function(e,t,o){e.exports=o(4)()},function(t,o){t.exports=e},function(e,o){e.exports=t},function(e,t,o){e.exports=o(8)},function(e,t,o){"use strict";var n=o(5),r=o(6),i=o(7);e.exports=function(){function e(e,t,o,n,a,s){s!==i&&r(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var o={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return o.checkPropTypes=n,o.PropTypes=o,o}},function(e,t,o){"use strict";function n(e){return function(){return e}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,o){"use strict";var n=function(e){};e.exports=function(e,t,o,r,i,a,s,u){if(n(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[o,r,i,a,s,u],f=0;(c=new Error(t.replace(/%s/g,function(){return l[f++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(e,t,o){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,o){"use strict";o.r(t);var n=o(1),r=o.n(n),i=o(0),a=o.n(i),s=o(2),u=o.n(s);function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function f(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var h="function"==typeof u.a.createPortal,m="undefined"!=typeof window,b=function(e){function t(e){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),o=f(this,p(t).call(this,e)),m&&(o.container=document.createElement("div"),document.body.appendChild(o.container),o.renderLayer()),o}var o,n,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(t,r.a.Component),o=t,(n=[{key:"componentDidUpdate",value:function(){this.renderLayer()}},{key:"componentWillUnmount",value:function(){h||u.a.unmountComponentAtNode(this.container),document.body.removeChild(this.container)}},{key:"renderLayer",value:function(){h||u.a.unstable_renderSubtreeIntoContainer(this,this.props.children,this.container)}},{key:"render",value:function(){return h?u.a.createPortal(this.props.children,this.container):null}}])&&l(o.prototype,n),i&&l(o,i),t}();b.propTypes={children:a.a.node.isRequired};var v=b;function y(e,t,o,n){var r=t.getBoundingClientRect(),i=Math.min(r.left,document.documentElement.clientWidth-r.right);return e.offsetWidth+t.offsetWidth+o+n+i<document.documentElement.clientWidth}function w(e,t,o){var n=e.getBoundingClientRect(),r=n.bottom>window.innerHeight,i=n.top<0;if(i&&r)return!0;if(e.offsetHeight>t.offsetHeight){var a=e.offsetHeight/2,s=o.arrowSize+O,u=n.bottom-window.innerHeight,c=-n.top;return a-u>=s&&a-c>=s}return!r&&!i}function g(e,t,o){var n=k(),r=t.left-n>o,i=t.left+2*e.arrowSize<n+document.documentElement.clientWidth-o;return!r||!i}function S(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{},n=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),n.forEach(function(t){T(e,t,o[t])})}return e}function T(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var O=5,x=10,z=3;function R(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0}function k(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0}function H(){return"undefined"!=typeof document?document.documentElement.clientWidth-2*x:1e3}function j(e){var t=e.arrow?e.arrowSize:z;return"number"==typeof e.distance?e.distance:t}function P(e,t,o,n,r){if(!e||!r.arrow)return{top:"0",left:"-10000000px"};var i=e.getBoundingClientRect(),a=Math.round(e.offsetHeight/2),s=Math.round(e.offsetWidth/2),u=R(),c=k(),l=j(r),f={};switch(o){case"right":return f.borderTop="".concat(r.arrowSize,"px solid transparent"),f.borderBottom="".concat(r.arrowSize,"px solid transparent"),r.background?f.borderRight="".concat(r.arrowSize,"px solid ").concat(r.background):(f.borderRightWidth="".concat(r.arrowSize,"px"),f.borderRightStyle="solid"),S({},f,{top:n.showTip&&t?i.top+u+a-r.arrowSize:"-10000000px",left:i.right+c+l-r.arrowSize});case"left":return f.borderTop="".concat(r.arrowSize,"px solid transparent"),f.borderBottom="".concat(r.arrowSize,"px solid transparent"),r.background?f.borderLeft="".concat(r.arrowSize,"px solid ").concat(r.background):(f.borderLeftWidth="".concat(r.arrowSize,"px"),f.borderLeftStyle="solid"),S({},f,{top:n.showTip&&t?i.top+u+a-r.arrowSize:"-10000000px",left:i.left+c-l-1});case"up":return f.borderLeft="".concat(r.arrowSize,"px solid transparent"),f.borderRight="".concat(r.arrowSize,"px solid transparent"),r.background?f.borderTop="".concat(r.arrowSize,"px solid ").concat(r.background):(f.borderTopWidth="".concat(r.arrowSize,"px"),f.borderTopStyle="solid"),S({},f,{left:n.showTip&&t?i.left+c+s-r.arrowSize:"-10000000px",top:i.top+u-l});case"down":default:return f.borderLeft="".concat(r.arrowSize,"px solid transparent"),f.borderRight="".concat(r.arrowSize,"px solid transparent"),r.background?f.borderBottom="10px solid ".concat(r.background):(f.borderBottomWidth="".concat(r.arrowSize,"px"),f.borderBottomStyle="solid"),S({},f,{left:n.showTip&&t?i.left+c+s-r.arrowSize:"-10000000px",top:i.bottom+u+l-r.arrowSize})}}function E(e,t,o,n,r,i){var a=function(e){var t=e.split("-");return t.length>1?t[1]:"middle"}(e),s=e.split("-")[0],u=s;if(!t&&o){var c=i.arrow&&P(n,o,s,r,i);u=function e(t,o,n,r,i,a,s){if(!n)return t;var u=n.getBoundingClientRect(),c=j(r),l=o.offsetHeight+c+i,f=window.innerHeight-u.bottom>=l,p=u.top>=l;switch(t){case"right":return y(o,n,c,i)&&w(n,o,r)?document.documentElement.clientWidth-u.right<o.offsetWidth+c+i?"left":"right":e("up",o,n,c,i,a,!0);case"left":return y(o,n,c,i)&&w(n,o,r)?u.left<o.offsetWidth+c+i?"right":"left":e("up",o,n,c,i,a,!0);case"up":if(!s&&a&&g(r,a,i))return e("left",o,n,c,i,a,!0);if(!p){if(f)return"down";if(!s&&y(o,n,c,i))return e("right",o,n,c,i,a,!0)}return"up";case"down":default:if(!s&&a&&g(r,a,i))return e("right",o,n,c,i,a,!0);if(!f){if(p)return"up";if(!s&&y(o,n,c,i))return e("right",o,n,c,i,a,!0)}return"down"}}(s,o,n,i,x,c)}var l,f=H();if(o){var p=o.style.width?0:1;l=Math.min(o.offsetWidth,f)+p}return{tip:S({},"up"===u||"down"===u?function(e,t,o,n,r,i){var a,s=-1e7,u=o.showTip?void 0:"translateX(-10000000px)",c=j(i);if(e){var l=k(),f=t.getBoundingClientRect(),p=f.left+l,d=Math.round(t.offsetWidth/2),h=Math.min(H(),e.offsetWidth),m=p+d,b=m-i.arrowSize,v=m+i.arrowSize;if("start"===r)s=i.arrow?Math.min(b,p):p;else if("end"===r){var y=Math.max(v,p+t.offsetWidth),w=i.arrow?y:p+t.offsetWidth;s=Math.max(w-h,x+l)}else{var g=p+d-Math.round(h/2),S=x+l;s=Math.max(g,S)}var T=s+h-(l+document.documentElement.clientWidth-x);T>0&&(s-=T),a="up"===n?f.top+R()-(e.offsetHeight+c):f.bottom+R()+c}return{left:s,top:a,transform:u}}(o,n,r,u,a,i):function(e,t,o,n,r,i){var a=-1e7,s=0,u=o.showTip?void 0:"translateX(-10000000px)",c=j(i),l=i.arrow?O:0;if(e){var f=R(),p=k(),d=t.getBoundingClientRect(),h=d.top+f,m=Math.round(t.offsetHeight/2),b=h+m-i.arrowSize,v=d.top+f+m+i.arrowSize;if("start"===r)s=i.arrow?Math.min(h,b):h;else if("end"===r){var y=d.bottom+f-e.offsetHeight;s=i.arrow?Math.max(y,v-e.offsetHeight):y}else{var w=Math.max(h+m-Math.round(e.offsetHeight/2),x+f);s=Math.min(w,b-l)}var g=s-f+e.offsetHeight+x-window.innerHeight;g>0&&(s=Math.max(s-g,v+l-e.offsetHeight)),a="right"===n?d.right+c+p:d.left-c-e.offsetWidth+p}return{left:a,top:s,transform:u}}(o,n,r,u,a,i),{maxWidth:f,width:l}),arrow:P(n,o,u,r,i),realDirection:u}}function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _(){return(_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(this,arguments)}function D(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{},n=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),n.forEach(function(t){q(e,t,o[t])})}return e}function W(e){return(W=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function C(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function B(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function L(e,t,o){return t&&B(e.prototype,t),o&&B(e,o),e}function N(e,t){return(N=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function q(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var I=function(e){return e.stopPropagation()},U=function(e){function t(){var e,o,n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),o=this,e=!(n=W(t).call(this))||"object"!==M(n)&&"function"!=typeof n?C(o):n,q(C(e),"debounceTimeout",!1),q(C(e),"hoverTimeout",!1),e.state={showTip:!1,hasHover:!1,ignoreShow:!1,hasBeenShown:!1},e.showTip=e.showTip.bind(C(e)),e.hideTip=e.hideTip.bind(C(e)),e.checkHover=e.checkHover.bind(C(e)),e.toggleTip=e.toggleTip.bind(C(e)),e.startHover=e.startHover.bind(C(e)),e.endHover=e.endHover.bind(C(e)),e.listenResizeScroll=e.listenResizeScroll.bind(C(e)),e.handleResizeScroll=e.handleResizeScroll.bind(C(e)),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&N(e,t)}(t,r.a.Component),L(t,null,[{key:"getDerivedStateFromProps",value:function(e){return m&&e.isOpen?{hasBeenShown:!0}:null}}]),L(t,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.setState({isOpen:!0}),window.addEventListener("resize",this.listenResizeScroll),window.addEventListener("scroll",this.listenResizeScroll)}},{key:"componentDidUpdate",value:function(e,t){if(!this.state.hasBeenShown&&this.props.isOpen)return this.setState({hasBeenShown:!0}),setTimeout(this.showTip,0);!t.hasBeenShown&&this.state.hasBeenShown&&this.showTip()}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.listenResizeScroll),window.removeEventListener("scroll",this.listenResizeScroll),clearTimeout(this.debounceTimeout),clearTimeout(this.hoverTimeout)}},{key:"listenResizeScroll",value:function(){clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(this.handleResizeScroll,100)}},{key:"handleResizeScroll",value:function(){if(this.state.showTip){var e=5*Math.round(document.documentElement.clientWidth/5);this.setState({clientWidth:e})}}},{key:"toggleTip",value:function(){this.state.showTip?this.hideTip():this.showTip()}},{key:"showTip",value:function(){if(!this.state.hasBeenShown)return this.setState({hasBeenShown:!0});this.setState({showTip:!0})}},{key:"hideTip",value:function(){this.setState({hasHover:!1}),this.setState({showTip:!1})}},{key:"startHover",value:function(){this.state.ignoreShow||(this.setState({hasHover:!0}),clearTimeout(this.hoverTimeout),this.hoverTimeout=setTimeout(this.checkHover,this.props.hoverDelay))}},{key:"endHover",value:function(){this.setState({hasHover:!1}),clearTimeout(this.hoverTimeout),this.hoverTimeout=setTimeout(this.checkHover,this.props.mouseOutDelay||this.props.hoverDelay)}},{key:"checkHover",value:function(){this.state.hasHover?this.showTip():this.hideTip()}},{key:"render",value:function(){var e,t=this,o=this.props,n=o.arrow,i=o.arrowSize,a=o.background,s=o.className,u=o.children,c=o.color,l=o.content,f=o.direction,p=o.distance,d=o.eventOff,h=o.eventOn,m=o.eventToggle,b=o.forceDirection,y=o.isOpen,w=o.mouseOutDelay,g=o.padding,S=o.styles,T=o.tagName,O=o.tipContentHover,x=o.tipContentClassName,z=o.useDefaultStyles,R=o.useHover,k=null!=y,H=k?y:this.state.showTip,j={style:D({position:"relative"},S),ref:function(e){t.target=e},className:s},P={onClick:I};if(d&&(j[d]=this.hideTip),h&&(j[h]=this.showTip),m?j[m]=this.toggleTip:R&&!k&&(j.onMouseEnter=this.startHover,j.onMouseLeave=O||w?this.endHover:this.hideTip,j.onTouchStart=this.toggleTip,O&&(P.onMouseEnter=this.startHover,P.onMouseLeave=this.endHover,P.onTouchStart=I)),this.state.hasBeenShown){var M=E(f,b,this.tip,this.target,D({},this.state,{showTip:H}),{background:z?"#333":a,arrow:n,arrowSize:i,distance:p}),W=D({},M.tip,{background:z?"#333":a,color:z?"#fff":c,padding:g,boxSizing:"border-box",zIndex:1e3,position:"absolute",display:"inline-block"}),C=D({},M.arrow,{position:"absolute",width:"0px",height:"0px",zIndex:1001});e=r.a.createElement(v,null,r.a.createElement("div",_({},P,{className:void 0!==x?x:s}),r.a.createElement("span",{className:"react-tooltip-lite",style:W,ref:function(e){t.tip=e}},l),r.a.createElement("span",{className:"react-tooltip-lite-arrow react-tooltip-lite-".concat(M.realDirection,"-arrow"),style:C})))}return r.a.createElement(T,j,u,e)}}]),t}();q(U,"propTypes",{arrow:a.a.bool,arrowSize:a.a.number,background:a.a.string,children:a.a.node.isRequired,className:a.a.string,color:a.a.string,content:a.a.node.isRequired,direction:a.a.string,distance:a.a.number,eventOff:a.a.string,eventOn:a.a.string,eventToggle:a.a.string,forceDirection:a.a.bool,hoverDelay:a.a.number,isOpen:a.a.bool,mouseOutDelay:a.a.number,padding:a.a.string,styles:a.a.object,tagName:a.a.string,tipContentHover:a.a.bool,tipContentClassName:a.a.string,useDefaultStyles:a.a.bool,useHover:a.a.bool}),q(U,"defaultProps",{arrow:!0,arrowSize:10,background:"",className:"",color:"",direction:"up",distance:void 0,eventOff:void 0,eventOn:void 0,eventToggle:void 0,forceDirection:!1,hoverDelay:200,isOpen:void 0,mouseOutDelay:void 0,padding:"10px",styles:{},tagName:"div",tipContentHover:!1,tipContentClassName:void 0,useDefaultStyles:!1,useHover:!0});t.default=U}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("React"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["React","ReactDOM"],e):"object"==typeof exports?exports.ReactToolTipLite=e(require("React"),require("ReactDOM")):t.ReactToolTipLite=e(t.React,t.ReactDOM)}(window,function(t,e){return function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=3)}([function(t,e,o){t.exports=o(4)()},function(e,o){e.exports=t},function(t,o){t.exports=e},function(t,e,o){t.exports=o(8)},function(t,e,o){"use strict";var n=o(5),r=o(6),i=o(7);t.exports=function(){function t(t,e,o,n,a,s){s!==i&&r(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var o={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return o.checkPropTypes=n,o.PropTypes=o,o}},function(t,e,o){"use strict";function n(t){return function(){return t}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(t){return t},t.exports=r},function(t,e,o){"use strict";var n=function(t){};t.exports=function(t,e,o,r,i,a,s,u){if(n(e),!t){var c;if(void 0===e)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[o,r,i,a,s,u],f=0;(c=new Error(e.replace(/%s/g,function(){return l[f++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(t,e,o){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,o){"use strict";o.r(e);var n=o(1),r=o.n(n),i=o(0),a=o.n(i),s=o(2),u=o.n(s);function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function f(t,e){return!e||"object"!==c(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var d="function"==typeof u.a.createPortal,b="undefined"!=typeof window,m=function(t){function e(t){var o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),o=f(this,h(e).call(this,t)),b&&(o.container=document.createElement("div"),document.body.appendChild(o.container),o.renderLayer()),o}var o,n,i;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e)}(e,r.a.Component),o=e,(n=[{key:"componentDidUpdate",value:function(){this.renderLayer()}},{key:"componentWillUnmount",value:function(){d||u.a.unmountComponentAtNode(this.container),document.body.removeChild(this.container)}},{key:"renderLayer",value:function(){d||u.a.unstable_renderSubtreeIntoContainer(this,this.props.children,this.container)}},{key:"render",value:function(){return d?u.a.createPortal(this.props.children,this.container):null}}])&&l(o.prototype,n),i&&l(o,i),e}();m.propTypes={children:a.a.node.isRequired};var v=m;function y(t,e,o,n){var r=e.getBoundingClientRect(),i=Math.min(r.left,document.documentElement.clientWidth-r.right);return t.offsetWidth+e.offsetWidth+o+n+i<document.documentElement.clientWidth}function g(t,e,o){var n=t.getBoundingClientRect(),r=n.bottom>window.innerHeight,i=n.top<0;if(i&&r)return!0;if(t.offsetHeight>e.offsetHeight){var a=t.offsetHeight/2,s=o.arrowSize+O,u=n.bottom-window.innerHeight,c=-n.top;return a-u>=s&&a-c>=s}return!r&&!i}function w(t,e,o){var n=k(),r=e.left-n>o,i=e.left+2*t.arrowSize<n+document.documentElement.clientWidth-o;return!r||!i}function T(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{},n=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(t){return Object.getOwnPropertyDescriptor(o,t).enumerable}))),n.forEach(function(e){S(t,e,o[e])})}return t}function S(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}var O=5,x=10,z=3;function E(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0}function k(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0}function R(){return"undefined"!=typeof document?document.documentElement.clientWidth-2*x:1e3}function H(t){var e=t.arrow?t.arrowSize:z;return"number"==typeof t.distance?t.distance:e}function j(t,e,o,n,r){if(!t||!r.arrow)return{top:"0",left:"-10000000px"};var i=t.getBoundingClientRect(),a=Math.round(t.offsetHeight/2),s=Math.round(t.offsetWidth/2),u=E(),c=k(),l=H(r),f={};switch(o){case"right":return f.borderTop="".concat(r.arrowSize,"px solid transparent"),f.borderBottom="".concat(r.arrowSize,"px solid transparent"),r.background?f.borderRight="".concat(r.arrowSize,"px solid ").concat(r.background):(f.borderRightWidth="".concat(r.arrowSize,"px"),f.borderRightStyle="solid"),T({},f,{top:n.showTip&&e?i.top+u+a-r.arrowSize:"-10000000px",left:i.right+c+l-r.arrowSize});case"left":return f.borderTop="".concat(r.arrowSize,"px solid transparent"),f.borderBottom="".concat(r.arrowSize,"px solid transparent"),r.background?f.borderLeft="".concat(r.arrowSize,"px solid ").concat(r.background):(f.borderLeftWidth="".concat(r.arrowSize,"px"),f.borderLeftStyle="solid"),T({},f,{top:n.showTip&&e?i.top+u+a-r.arrowSize:"-10000000px",left:i.left+c-l-1});case"up":return f.borderLeft="".concat(r.arrowSize,"px solid transparent"),f.borderRight="".concat(r.arrowSize,"px solid transparent"),r.background?f.borderTop="".concat(r.arrowSize,"px solid ").concat(r.background):(f.borderTopWidth="".concat(r.arrowSize,"px"),f.borderTopStyle="solid"),T({},f,{left:n.showTip&&e?i.left+c+s-r.arrowSize:"-10000000px",top:i.top+u-l});case"down":default:return f.borderLeft="".concat(r.arrowSize,"px solid transparent"),f.borderRight="".concat(r.arrowSize,"px solid transparent"),r.background?f.borderBottom="10px solid ".concat(r.background):(f.borderBottomWidth="".concat(r.arrowSize,"px"),f.borderBottomStyle="solid"),T({},f,{left:n.showTip&&e?i.left+c+s-r.arrowSize:"-10000000px",top:i.bottom+u+l-r.arrowSize})}}function P(t,e,o,n,r,i){var a=function(t){var e=t.split("-");return e.length>1?e[1]:"middle"}(t),s=t.split("-")[0],u=s;if(!e&&o){var c=i.arrow&&j(n,o,s,r,i);u=function t(e,o,n,r,i,a,s){if(!n)return e;var u=n.getBoundingClientRect(),c=H(r),l=o.offsetHeight+c+i,f=window.innerHeight-u.bottom>=l,h=u.top>=l;switch(e){case"right":return y(o,n,c,i)&&g(n,o,r)?document.documentElement.clientWidth-u.right<o.offsetWidth+c+i?"left":"right":t("up",o,n,c,i,a,!0);case"left":return y(o,n,c,i)&&g(n,o,r)?u.left<o.offsetWidth+c+i?"right":"left":t("up",o,n,c,i,a,!0);case"up":if(!s&&a&&w(r,a,i))return t("left",o,n,c,i,a,!0);if(!h){if(f)return"down";if(!s&&y(o,n,c,i))return t("right",o,n,c,i,a,!0)}return"up";case"down":default:if(!s&&a&&w(r,a,i))return t("right",o,n,c,i,a,!0);if(!f){if(h)return"up";if(!s&&y(o,n,c,i))return t("right",o,n,c,i,a,!0)}return"down"}}(s,o,n,i,x,c)}var l,f=R();if(o){var h=o.style.width?0:1;l=Math.min(o.offsetWidth,f)+h}return{tip:T({},"up"===u||"down"===u?function(t,e,o,n,r,i){var a,s=-1e7,u=o.showTip?void 0:"translateX(-10000000px)",c=H(i);if(t){var l=k(),f=e.getBoundingClientRect(),h=f.left+l,p=Math.round(e.offsetWidth/2),d=Math.min(R(),t.offsetWidth),b=h+p,m=b-i.arrowSize,v=b+i.arrowSize;if("start"===r)s=i.arrow?Math.min(m,h):h;else if("end"===r){var y=Math.max(v,h+e.offsetWidth),g=i.arrow?y:h+e.offsetWidth;s=Math.max(g-d,x+l)}else{var w=h+p-Math.round(d/2),T=x+l;s=Math.max(w,T)}var S=s+d-(l+document.documentElement.clientWidth-x);S>0&&(s-=S),a="up"===n?f.top+E()-(t.offsetHeight+c):f.bottom+E()+c}return{left:s,top:a,transform:u}}(o,n,r,u,a,i):function(t,e,o,n,r,i){var a=-1e7,s=0,u=o.showTip?void 0:"translateX(-10000000px)",c=H(i),l=i.arrow?O:0;if(t){var f=E(),h=k(),p=e.getBoundingClientRect(),d=p.top+f,b=Math.round(e.offsetHeight/2),m=d+b-i.arrowSize,v=p.top+f+b+i.arrowSize;if("start"===r)s=i.arrow?Math.min(d,m):d;else if("end"===r){var y=p.bottom+f-t.offsetHeight;s=i.arrow?Math.max(y,v-t.offsetHeight):y}else{var g=Math.max(d+b-Math.round(t.offsetHeight/2),x+f);s=Math.min(g,m-l)}var w=s-f+t.offsetHeight+x-window.innerHeight;w>0&&(s=Math.max(s-w,v+l-t.offsetHeight)),a="right"===n?p.right+c+h:p.left-c-t.offsetWidth+h}return{left:a,top:s,transform:u}}(o,n,r,u,a,i),{maxWidth:f,width:l}),arrow:j(n,o,u,r,i),realDirection:u}}function M(t){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _(){return(_=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t}).apply(this,arguments)}function D(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{},n=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(t){return Object.getOwnPropertyDescriptor(o,t).enumerable}))),n.forEach(function(e){I(t,e,o[e])})}return t}function W(t){return(W=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function C(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function L(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function B(t,e,o){return e&&L(t.prototype,e),o&&L(t,o),t}function N(t,e){return(N=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function I(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}var q=function(t){return t.stopPropagation()},U=function(t){function e(){var t,o,n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),o=this,t=!(n=W(e).call(this))||"object"!==M(n)&&"function"!=typeof n?C(o):n,I(C(t),"debounceTimeout",!1),I(C(t),"hoverTimeout",!1),t.state={showTip:!1,hasHover:!1,ignoreShow:!1,hasBeenShown:!1},t.showTip=t.showTip.bind(C(t)),t.hideTip=t.hideTip.bind(C(t)),t.checkHover=t.checkHover.bind(C(t)),t.toggleTip=t.toggleTip.bind(C(t)),t.startHover=t.startHover.bind(C(t)),t.endHover=t.endHover.bind(C(t)),t.listenResizeScroll=t.listenResizeScroll.bind(C(t)),t.handleResizeScroll=t.handleResizeScroll.bind(C(t)),t.bodyTouchStart=t.bodyTouchStart.bind(C(t)),t.bodyTouchEnd=t.bodyTouchEnd.bind(C(t)),t.targetTouchStart=t.targetTouchStart.bind(C(t)),t.targetTouchEnd=t.targetTouchEnd.bind(C(t)),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&N(t,e)}(e,r.a.Component),B(e,null,[{key:"getDerivedStateFromProps",value:function(t){return b&&t.isOpen?{hasBeenShown:!0}:null}}]),B(e,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.setState({isOpen:!0}),window.addEventListener("resize",this.listenResizeScroll),window.addEventListener("scroll",this.listenResizeScroll),window.addEventListener("touchstart",this.bodyTouchStart),window.addEventListener("touchEnd",this.bodyTouchEnd)}},{key:"componentDidUpdate",value:function(t,e){if(!this.state.hasBeenShown&&this.props.isOpen)return this.setState({hasBeenShown:!0}),setTimeout(this.showTip,0);!e.hasBeenShown&&this.state.hasBeenShown&&this.showTip()}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.listenResizeScroll),window.removeEventListener("scroll",this.listenResizeScroll),window.removeEventListener("touchstart",this.bodyTouchStart),window.removeEventListener("touchEnd",this.bodyTouchEnd),clearTimeout(this.debounceTimeout),clearTimeout(this.hoverTimeout)}},{key:"listenResizeScroll",value:function(){clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(this.handleResizeScroll,100),this.state.targetTouch&&this.setState({targetTouch:void 0})}},{key:"handleResizeScroll",value:function(){if(this.state.showTip){var t=5*Math.round(document.documentElement.clientWidth/5);this.setState({clientWidth:t})}}},{key:"targetTouchStart",value:function(){this.setState({targetTouch:!0})}},{key:"targetTouchEnd",value:function(){this.state.targetTouch&&this.toggleTip()}},{key:"bodyTouchEnd",value:function(){this.state.targetTouch&&this.setState({targetTouch:void 0})}},{key:"bodyTouchStart",value:function(t){this.target&&this.target.contains(t.target)||this.tip&&this.tip.contains(t.target)||this.props.isOpen||this.hideTip()}},{key:"toggleTip",value:function(){this.state.showTip?this.hideTip():this.showTip()}},{key:"showTip",value:function(){var t=this;if(!this.state.hasBeenShown)return this.setState({hasBeenShown:!0});this.setState({showTip:!0},function(){"function"==typeof t.props.onToggle&&t.props.onToggle(t.state.showTip)})}},{key:"hideTip",value:function(){var t=this;this.setState({hasHover:!1}),this.setState({showTip:!1},function(){"function"==typeof t.props.onToggle&&t.props.onToggle(t.state.showTip)})}},{key:"startHover",value:function(){this.state.ignoreShow||(this.setState({hasHover:!0}),clearTimeout(this.hoverTimeout),this.hoverTimeout=setTimeout(this.checkHover,this.props.hoverDelay))}},{key:"endHover",value:function(){this.setState({hasHover:!1}),clearTimeout(this.hoverTimeout),this.hoverTimeout=setTimeout(this.checkHover,this.props.mouseOutDelay||this.props.hoverDelay)}},{key:"checkHover",value:function(){this.state.hasHover?this.showTip():this.hideTip()}},{key:"render",value:function(){var t,e=this,o=this.props,n=o.arrow,i=o.arrowSize,a=o.background,s=o.className,u=o.children,c=o.color,l=o.content,f=o.direction,h=o.distance,p=o.eventOff,d=o.eventOn,b=o.eventToggle,m=o.forceDirection,y=o.isOpen,g=o.mouseOutDelay,w=o.padding,T=o.styles,S=o.tagName,O=o.tipContentHover,x=o.tipContentClassName,z=o.useDefaultStyles,E=o.useHover,k=null!=y,R=k?y:this.state.showTip,H={style:D({position:"relative"},T),ref:function(t){e.target=t},className:s},j={onClick:q};if(p&&(H[p]=this.hideTip),d&&(H[d]=this.showTip),b?H[b]=this.toggleTip:E&&!k&&(H.onMouseEnter=this.startHover,H.onMouseLeave=O||g?this.endHover:this.hideTip,H.onTouchStart=this.targetTouchStart,H.onTouchEnd=this.targetTouchEnd,O&&(j.onMouseEnter=this.startHover,j.onMouseLeave=this.endHover,j.onTouchStart=q)),this.state.hasBeenShown){var M=P(f,m,this.tip,this.target,D({},this.state,{showTip:R}),{background:z?"#333":a,arrow:n,arrowSize:i,distance:h}),W=D({},M.tip,{background:z?"#333":a,color:z?"#fff":c,padding:w,boxSizing:"border-box",zIndex:this.props.zIndex,position:"absolute",display:"inline-block"}),C=D({},M.arrow,{position:"absolute",width:"0px",height:"0px",zIndex:this.props.zIndex+1});t=r.a.createElement(v,null,r.a.createElement("div",_({},j,{className:void 0!==x?x:s}),r.a.createElement("span",{className:"react-tooltip-lite",style:W,ref:function(t){e.tip=t}},l),r.a.createElement("span",{className:"react-tooltip-lite-arrow react-tooltip-lite-".concat(M.realDirection,"-arrow"),style:C})))}return r.a.createElement(S,H,u,t)}}]),e}();I(U,"propTypes",{arrow:a.a.bool,arrowSize:a.a.number,background:a.a.string,children:a.a.node.isRequired,className:a.a.string,color:a.a.string,content:a.a.node.isRequired,direction:a.a.string,distance:a.a.number,eventOff:a.a.string,eventOn:a.a.string,eventToggle:a.a.string,forceDirection:a.a.bool,hoverDelay:a.a.number,isOpen:a.a.bool,mouseOutDelay:a.a.number,padding:a.a.string,styles:a.a.object,tagName:a.a.string,tipContentHover:a.a.bool,tipContentClassName:a.a.string,useDefaultStyles:a.a.bool,useHover:a.a.bool,zIndex:a.a.number,onToggle:a.a.func}),I(U,"defaultProps",{arrow:!0,arrowSize:10,background:"",className:"",color:"",direction:"up",distance:void 0,eventOff:void 0,eventOn:void 0,eventToggle:void 0,forceDirection:!1,hoverDelay:200,isOpen:void 0,mouseOutDelay:void 0,padding:"10px",styles:{},tagName:"div",tipContentHover:!1,tipContentClassName:void 0,useDefaultStyles:!1,useHover:!0,zIndex:1e3,onToggle:void 0});e.default=U}])}); |
@@ -61,2 +61,6 @@ import React from 'react'; | ||
</Tooltip> | ||
<Tooltip onToggle={(isOpen) => {alert(`Is tooltip open ? \n Answer : ${isOpen? 'Yes' : 'No' }`) }} content="alert shown" className="target" tipContentClassName=""> | ||
Hover Me | ||
</Tooltip> | ||
</div> | ||
@@ -63,0 +67,0 @@ </section> |
{ | ||
"name": "react-tooltip-lite", | ||
"version": "1.10.0", | ||
"version": "1.11.0", | ||
"description": "React tooltip, focused on simplicity and performance", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -177,2 +177,12 @@ # React tooltip-lite | ||
</tr> | ||
<tr> | ||
<td>zIndex</td> | ||
<td>number</td> | ||
<td>The zIndex of the tooltip, defaults to 1000</td> | ||
</tr> | ||
<tr> | ||
<td>onToggle</td> | ||
<td>function</td> | ||
<td>if passed, this is called when the visibility of the tooltip changes.</td> | ||
</tr> | ||
</tbody> | ||
@@ -179,0 +189,0 @@ </table> |
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
1845403
21
21916
218