react-tooltip 5.25.1-beta.1145.0 → 5.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react-tooltip.cjs +19 -5
- package/dist/react-tooltip.cjs.map +1 -1
- package/dist/react-tooltip.min.cjs +1 -1
- package/dist/react-tooltip.min.cjs.map +1 -1
- package/dist/react-tooltip.min.mjs +1 -1
- package/dist/react-tooltip.min.mjs.map +1 -1
- package/dist/react-tooltip.mjs +19 -5
- package/dist/react-tooltip.mjs.map +1 -1
- package/dist/react-tooltip.umd.js +19 -5
- package/dist/react-tooltip.umd.js.map +1 -1
- package/dist/react-tooltip.umd.min.js +2 -2
- package/dist/react-tooltip.umd.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
* @copyright ReactTooltip Team
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@floating-ui/dom"),require("classnames")):"function"==typeof define&&define.amd?define(["exports","react","@floating-ui/dom","classnames"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactTooltip={},e.React,e.FloatingUIDOM,e.classNames)}(this,(function(e,t,o,l){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=r(t),c=r(l);const s="react-tooltip-core-styles",i="react-tooltip-base-styles",a={core:!1,base:!1};function u({css:e,id:t=i,type:o="base",ref:l}){var r,n;if(!e||"undefined"==typeof document||a[o])return;if("core"===o&&"undefined"!=typeof process&&(null===(r=null===process||void 0===process?void 0:process.env)||void 0===r?void 0:r.REACT_TOOLTIP_DISABLE_CORE_STYLES))return;if("base"!==o&&"undefined"!=typeof process&&(null===(n=null===process||void 0===process?void 0:process.env)||void 0===n?void 0:n.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;"core"===o&&(t=s),l||(l={});const{insertAt:c}=l;if(document.getElementById(t))return void console.warn(`[react-tooltip] Element with id '${t}' already exists. Call \`removeStyle()\` first`);const u=document.head||document.getElementsByTagName("head")[0],d=document.createElement("style");d.id=t,d.type="text/css","top"===c&&u.firstChild?u.insertBefore(d,u.firstChild):u.appendChild(d),d.styleSheet?d.styleSheet.cssText=e:d.appendChild(document.createTextNode(e)),a[o]=!0}const d=(e,t,o)=>{let l=null;return function(...r){const n=()=>{l=null,o||e.apply(this,r)};o&&!l&&(e.apply(this,r),l=setTimeout(n,t)),o||(l&&clearTimeout(l),l=setTimeout(n,t))}},p="DEFAULT_TOOLTIP_ID",f={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},v={getTooltipData:()=>f},m=t.createContext(v);function y(e=p){return t.useContext(m).getTooltipData(e)}const h="undefined"!=typeof window?t.useLayoutEffect:t.useEffect,w=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some((e=>{const o=t.getPropertyValue(e);return"auto"===o||"scroll"===o}))},S=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(w(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},E=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:l=null,place:r="top",offset:n=10,strategy:c="absolute",middlewares:s=[o.offset(Number(n)),o.flip(),o.shift({padding:5})],border:i})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};const a=s;return l?(a.push(o.arrow({element:l,padding:5})),o.computePosition(e,t,{placement:r,strategy:c,middleware:a}).then((({x:e,y:t,placement:o,middlewareData:l})=>{var r,n;const c={left:`${e}px`,top:`${t}px`,border:i},{x:s,y:a}=null!==(r=l.arrow)&&void 0!==r?r:{x:0,y:0},u=null!==(n={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]])&&void 0!==n?n:"bottom",d=i&&{borderBottom:i,borderRight:i};let p=0;if(i){const e=`${i}`.match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:c,tooltipArrowStyles:{left:null!=s?`${s}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",...d,[u]:`-${4+p}px`},place:o}}))):o.computePosition(e,t,{placement:"bottom",strategy:c,middleware:a}).then((({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o})))};var b={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},g={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const _=({forwardRef:e,id:l,className:r,classNameArrow:s,variant:i="dark",anchorId:a,anchorSelect:u,place:p="top",offset:f=10,events:v=["hover"],openOnClick:m=!1,positionStrategy:w="absolute",middlewares:_,wrapper:A,delayShow:O=0,delayHide:T=0,float:k=!1,hidden:R=!1,noArrow:C=!1,clickable:L=!1,closeOnEsc:x=!1,closeOnScroll:N=!1,closeOnResize:$=!1,openEvents:j,closeEvents:I,globalCloseEvents:B,imperativeModeOnly:q,style:z,position:D,afterShow:M,afterHide:H,content:P,contentWrapperRef:W,isOpen:F,setIsOpen:U,activeAnchor:K,setActiveAnchor:V,border:X,opacity:Y,arrowColor:G,role:Z="tooltip"})=>{var J;const Q=t.useRef(null),ee=t.useRef(null),te=t.useRef(null),oe=t.useRef(null),le=t.useRef(null),[re,ne]=t.useState(p),[ce,se]=t.useState({}),[ie,ae]=t.useState({}),[ue,de]=t.useState(!1),[pe,fe]=t.useState(!1),[ve,me]=t.useState(null),ye=t.useRef(!1),he=t.useRef(null),{anchorRefs:we,setActiveAnchor:Se}=y(l),Ee=t.useRef(!1),[be,ge]=t.useState([]),_e=t.useRef(!1),Ae=m||v.includes("click"),Oe=Ae||(null==j?void 0:j.click)||(null==j?void 0:j.dblclick)||(null==j?void 0:j.mousedown),Te=j?{...j}:{mouseenter:!0,focus:!0,click:!1,dblclick:!1,mousedown:!1};!j&&Ae&&Object.assign(Te,{mouseenter:!1,focus:!1,click:!0});const ke=I?{...I}:{mouseleave:!0,blur:!0,click:!1,dblclick:!1,mouseup:!1};!I&&Ae&&Object.assign(ke,{mouseleave:!1,blur:!1});const Re=B?{...B}:{escape:x||!1,scroll:N||!1,resize:$||!1,clickOutsideAnchor:Oe||!1};q&&(Object.assign(Te,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(ke,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(Re,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),h((()=>(_e.current=!0,()=>{_e.current=!1})),[]);const Ce=e=>{_e.current&&(e&&fe(!0),setTimeout((()=>{_e.current&&(null==U||U(e),void 0===F&&de(e))}),10))};t.useEffect((()=>{if(void 0===F)return()=>null;F&&fe(!0);const e=setTimeout((()=>{de(F)}),10);return()=>{clearTimeout(e)}}),[F]),t.useEffect((()=>{if(ue!==ye.current)if(le.current&&clearTimeout(le.current),ye.current=ue,ue)null==M||M();else{const e=(e=>{const t=e.match(/^([\d.]+)(m?s?)$/);if(!t)return 0;const[,o,l]=t;return"s"!==l&&"ms"!==l?0:Number(o)*("ms"===l?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));le.current=setTimeout((()=>{fe(!1),me(null),null==H||H()}),e+25)}}),[ue]);const Le=(e=O)=>{te.current&&clearTimeout(te.current),te.current=setTimeout((()=>{Ce(!0)}),e)},xe=(e=T)=>{oe.current&&clearTimeout(oe.current),oe.current=setTimeout((()=>{Ee.current||Ce(!1)}),e)},Ne=e=>{var t;if(!e)return;const o=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==o?void 0:o.isConnected))return V(null),void Se({current:null});O?Le():Ce(!0),V(o),Se({current:o}),oe.current&&clearTimeout(oe.current)},$e=()=>{L?xe(T||100):T?xe():Ce(!1),te.current&&clearTimeout(te.current)},je=({x:e,y:t})=>{var o;const l={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};E({place:null!==(o=null==ve?void 0:ve.place)&&void 0!==o?o:p,offset:f,elementReference:l,tooltipReference:Q.current,tooltipArrowReference:ee.current,strategy:w,middlewares:_,border:X}).then((e=>{Object.keys(e.tooltipStyles).length&&se(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&ae(e.tooltipArrowStyles),ne(e.place)}))},Ie=e=>{if(!e)return;const t=e,o={x:t.clientX,y:t.clientY};je(o),he.current=o},Be=e=>{var t;if(!ue)return;const o=e.target;if(null===(t=Q.current)||void 0===t?void 0:t.contains(o))return;[document.querySelector(`[id='${a}']`),...be].some((e=>null==e?void 0:e.contains(o)))||(Ce(!1),te.current&&clearTimeout(te.current))},qe=d(Ne,50,!0),ze=d($e,50,!0),De=t.useCallback((()=>{var e,t;const o=null!==(e=null==ve?void 0:ve.position)&&void 0!==e?e:D;o?je(o):k?he.current&&je(he.current):(null==K?void 0:K.isConnected)&&E({place:null!==(t=null==ve?void 0:ve.place)&&void 0!==t?t:p,offset:f,elementReference:K,tooltipReference:Q.current,tooltipArrowReference:ee.current,strategy:w,middlewares:_,border:X}).then((e=>{_e.current&&(Object.keys(e.tooltipStyles).length&&se(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&ae(e.tooltipArrowStyles),ne(e.place))}))}),[ue,K,P,z,p,null==ve?void 0:ve.place,f,w,D,null==ve?void 0:ve.position,k]);t.useEffect((()=>{var e,t;const l=new Set(we);be.forEach((e=>{l.add({current:e})}));const r=document.querySelector(`[id='${a}']`);r&&l.add({current:r});const n=()=>{Ce(!1)},c=S(K),s=S(Q.current);Re.scroll&&(window.addEventListener("scroll",n),null==c||c.addEventListener("scroll",n),null==s||s.addEventListener("scroll",n));let i=null;Re.resize?window.addEventListener("resize",n):K&&Q.current&&(i=o.autoUpdate(K,Q.current,De,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const u=e=>{"Escape"===e.key&&Ce(!1)};Re.escape&&window.addEventListener("keydown",u),Re.clickOutsideAnchor&&window.addEventListener("click",Be);const d=[],p=e=>{ue||Ne(e)},f=()=>{ue&&$e()},v=["mouseenter","mouseleave","focus","blur"],m=["click","dblclick","mousedown","mouseup"];Object.entries(Te).forEach((([e,t])=>{t&&(v.includes(e)?d.push({event:e,listener:qe}):m.includes(e)&&d.push({event:e,listener:p}))})),Object.entries(ke).forEach((([e,t])=>{t&&(v.includes(e)?d.push({event:e,listener:ze}):m.includes(e)&&d.push({event:e,listener:f}))})),k&&d.push({event:"mousemove",listener:Ie});const y=()=>{Ee.current=!0},h=()=>{Ee.current=!1,$e()};return L&&!Oe&&(null===(e=Q.current)||void 0===e||e.addEventListener("mouseenter",y),null===(t=Q.current)||void 0===t||t.addEventListener("mouseleave",h)),d.forEach((({event:e,listener:t})=>{l.forEach((o=>{var l;null===(l=o.current)||void 0===l||l.addEventListener(e,t)}))})),()=>{var e,t;Re.scroll&&(window.removeEventListener("scroll",n),null==c||c.removeEventListener("scroll",n),null==s||s.removeEventListener("scroll",n)),Re.resize?window.removeEventListener("resize",n):null==i||i(),Re.clickOutsideAnchor&&window.removeEventListener("click",Be),Re.escape&&window.removeEventListener("keydown",u),L&&!Oe&&(null===(e=Q.current)||void 0===e||e.removeEventListener("mouseenter",y),null===(t=Q.current)||void 0===t||t.removeEventListener("mouseleave",h)),d.forEach((({event:e,listener:t})=>{l.forEach((o=>{var l;null===(l=o.current)||void 0===l||l.removeEventListener(e,t)}))}))}}),[K,De,pe,we,be,j,I,B,Ae]),t.useEffect((()=>{var e,t;let o=null!==(t=null!==(e=null==ve?void 0:ve.anchorSelect)&&void 0!==e?e:u)&&void 0!==t?t:"";!o&&l&&(o=`[data-tooltip-id='${l}']`);const r=new MutationObserver((e=>{const t=[],r=[];e.forEach((e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName){e.target.getAttribute("data-tooltip-id")===l&&t.push(e.target)}if("childList"===e.type){if(K){const t=[...e.removedNodes].filter((e=>1===e.nodeType));if(o)try{r.push(...t.filter((e=>e.matches(o)))),r.push(...t.flatMap((e=>[...e.querySelectorAll(o)])))}catch(e){}t.some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,K))&&(fe(!1),Ce(!1),V(null),te.current&&clearTimeout(te.current),oe.current&&clearTimeout(oe.current),!0)}))}if(o)try{const l=[...e.addedNodes].filter((e=>1===e.nodeType));t.push(...l.filter((e=>e.matches(o)))),t.push(...l.flatMap((e=>[...e.querySelectorAll(o)])))}catch(e){}}})),(t.length||r.length)&&ge((e=>[...e.filter((e=>!r.includes(e))),...t]))}));return r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"]}),()=>{r.disconnect()}}),[l,u,null==ve?void 0:ve.anchorSelect,K]),t.useEffect((()=>{De()}),[De]),t.useEffect((()=>{if(!(null==W?void 0:W.current))return()=>null;const e=new ResizeObserver((()=>{De()}));return e.observe(W.current),()=>{e.disconnect()}}),[P,null==W?void 0:W.current]),t.useEffect((()=>{var e;const t=document.querySelector(`[id='${a}']`),o=[...be,t];K&&o.includes(K)||V(null!==(e=be[0])&&void 0!==e?e:t)}),[a,be,K]),t.useEffect((()=>()=>{te.current&&clearTimeout(te.current),oe.current&&clearTimeout(oe.current)}),[]),t.useEffect((()=>{var e;let t=null!==(e=null==ve?void 0:ve.anchorSelect)&&void 0!==e?e:u;if(!t&&l&&(t=`[data-tooltip-id='${l}']`),t)try{const e=Array.from(document.querySelectorAll(t));ge(e)}catch(e){ge([])}}),[l,u,null==ve?void 0:ve.anchorSelect]);const Me=null!==(J=null==ve?void 0:ve.content)&&void 0!==J?J:P,He=ue&&Object.keys(ce).length>0;return t.useImperativeHandle(e,(()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect)}catch(t){return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`)}me(null!=e?e:null),(null==e?void 0:e.delay)?Le(e.delay):Ce(!0)},close:e=>{(null==e?void 0:e.delay)?xe(e.delay):Ce(!1)},activeAnchor:K,place:re,isOpen:Boolean(pe&&!R&&Me&&He)}))),pe&&!R&&Me?n.default.createElement(A,{id:l,role:Z,className:c.default("react-tooltip",b.tooltip,g.tooltip,g[i],r,`react-tooltip__place-${re}`,b[He?"show":"closing"],He?"react-tooltip__show":"react-tooltip__closing","fixed"===w&&b.fixed,L&&b.clickable),onTransitionEnd:e=>{le.current&&clearTimeout(le.current),ue||"opacity"!==e.propertyName||(fe(!1),me(null),null==H||H())},style:{...z,...ce,opacity:void 0!==Y&&He?Y:void 0},ref:Q},Me,n.default.createElement(A,{className:c.default("react-tooltip-arrow",b.arrow,g.arrow,s,C&&b.noArrow),style:{...ie,background:G?`linear-gradient(to right bottom, transparent 50%, ${G} 50%)`:void 0},ref:ee})):null},A=({content:e})=>n.default.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),O=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),T=n.default.forwardRef((({id:e,anchorId:o,anchorSelect:l,content:r,html:s,render:i,className:a,classNameArrow:u,variant:d="dark",place:p="top",offset:f=10,wrapper:v="div",children:m=null,events:h=["hover"],openOnClick:w=!1,positionStrategy:S="absolute",middlewares:E,delayShow:b=0,delayHide:g=0,float:T=!1,hidden:k=!1,noArrow:R=!1,clickable:C=!1,closeOnEsc:L=!1,closeOnScroll:x=!1,closeOnResize:N=!1,openEvents:$,closeEvents:j,globalCloseEvents:I,imperativeModeOnly:B=!1,style:q,position:z,isOpen:D,disableStyleInjection:M=!1,border:H,opacity:P,arrowColor:W,setIsOpen:F,afterShow:U,afterHide:K,role:V="tooltip"},X)=>{const[Y,G]=t.useState(r),[Z,J]=t.useState(s),[Q,ee]=t.useState(p),[te,oe]=t.useState(d),[le,re]=t.useState(f),[ne,ce]=t.useState(b),[se,ie]=t.useState(g),[ae,ue]=t.useState(T),[de,pe]=t.useState(k),[fe,ve]=t.useState(v),[me,ye]=t.useState(h),[he,we]=t.useState(S),[Se,Ee]=t.useState(null),[be,ge]=t.useState(null),_e=t.useRef(M),{anchorRefs:Ae,activeAnchor:Oe}=y(e),Te=e=>null==e?void 0:e.getAttributeNames().reduce(((t,o)=>{var l;if(o.startsWith("data-tooltip-")){t[o.replace(/^data-tooltip-/,"")]=null!==(l=null==e?void 0:e.getAttribute(o))&&void 0!==l?l:null}return t}),{}),ke=e=>{const t={place:e=>{var t;ee(null!==(t=e)&&void 0!==t?t:p)},content:e=>{G(null!=e?e:r)},html:e=>{J(null!=e?e:s)},variant:e=>{var t;oe(null!==(t=e)&&void 0!==t?t:d)},offset:e=>{re(null===e?f:Number(e))},wrapper:e=>{var t;ve(null!==(t=e)&&void 0!==t?t:v)},events:e=>{const t=null==e?void 0:e.split(" ");ye(null!=t?t:h)},"position-strategy":e=>{var t;we(null!==(t=e)&&void 0!==t?t:S)},"delay-show":e=>{ce(null===e?b:Number(e))},"delay-hide":e=>{ie(null===e?g:Number(e))},float:e=>{ue(null===e?T:"true"===e)},hidden:e=>{pe(null===e?k:"true"===e)},"class-name":e=>{Ee(e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,o])=>{var l;null===(l=t[e])||void 0===l||l.call(t,o)}))};t.useEffect((()=>{G(r)}),[r]),t.useEffect((()=>{J(s)}),[s]),t.useEffect((()=>{ee(p)}),[p]),t.useEffect((()=>{oe(d)}),[d]),t.useEffect((()=>{re(f)}),[f]),t.useEffect((()=>{ce(b)}),[b]),t.useEffect((()=>{ie(g)}),[g]),t.useEffect((()=>{ue(T)}),[T]),t.useEffect((()=>{pe(k)}),[k]),t.useEffect((()=>{we(S)}),[S]),t.useEffect((()=>{_e.current!==M&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[M]),t.useEffect((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===M,disableBase:M}}))}),[]),t.useEffect((()=>{var t;const r=new Set(Ae);let n=l;if(!n&&e&&(n=`[data-tooltip-id='${e}']`),n)try{document.querySelectorAll(n).forEach((e=>{r.add({current:e})}))}catch(e){console.warn(`[react-tooltip] "${n}" is not a valid CSS selector`)}const c=document.querySelector(`[id='${o}']`);if(c&&r.add({current:c}),!r.size)return()=>null;const s=null!==(t=null!=be?be:c)&&void 0!==t?t:Oe.current,i=new MutationObserver((e=>{e.forEach((e=>{var t;if(!s||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const o=Te(s);ke(o)}))})),a={attributes:!0,childList:!1,subtree:!1};if(s){const e=Te(s);ke(e),i.observe(s,a)}return()=>{i.disconnect()}}),[Ae,Oe,be,o,l]),t.useEffect((()=>{(null==q?void 0:q.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),H&&!O("border",`${H}`)&&console.warn(`[react-tooltip] "${H}" is not a valid \`border\`.`),(null==q?void 0:q.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),P&&!O("opacity",`${P}`)&&console.warn(`[react-tooltip] "${P}" is not a valid \`opacity\`.`)}),[]);let Re=m;const Ce=t.useRef(null);if(i){const e=i({content:null!=Y?Y:null,activeAnchor:be});Re=e?n.default.createElement("div",{ref:Ce,className:"react-tooltip-content-wrapper"},e):null}else Y&&(Re=Y);Z&&(Re=n.default.createElement(A,{content:Z}));const Le={forwardRef:X,id:e,anchorId:o,anchorSelect:l,className:c.default(a,Se),classNameArrow:u,content:Re,contentWrapperRef:Ce,place:Q,variant:te,offset:le,wrapper:fe,events:me,openOnClick:w,positionStrategy:he,middlewares:E,delayShow:ne,delayHide:se,float:ae,hidden:de,noArrow:R,clickable:C,closeOnEsc:L,closeOnScroll:x,closeOnResize:N,openEvents:$,closeEvents:j,globalCloseEvents:I,imperativeModeOnly:B,style:q,position:z,isOpen:D,border:H,opacity:P,arrowColor:W,setIsOpen:F,afterShow:U,afterHide:K,activeAnchor:be,setActiveAnchor:e=>ge(e),role:V};return n.default.createElement(_,{...Le})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||u({css:`:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}`,type:"core"}),e.detail.disableBase||u({css:`
|
|
8
|
-
.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"})})),e.Tooltip=
|
|
7
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@floating-ui/dom"),require("classnames")):"function"==typeof define&&define.amd?define(["exports","react","@floating-ui/dom","classnames"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactTooltip={},e.React,e.FloatingUIDOM,e.classNames)}(this,(function(e,t,o,l){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=r(t),c=r(l);const s="react-tooltip-core-styles",i="react-tooltip-base-styles",a={core:!1,base:!1};function u({css:e,id:t=i,type:o="base",ref:l}){var r,n;if(!e||"undefined"==typeof document||a[o])return;if("core"===o&&"undefined"!=typeof process&&(null===(r=null===process||void 0===process?void 0:process.env)||void 0===r?void 0:r.REACT_TOOLTIP_DISABLE_CORE_STYLES))return;if("base"!==o&&"undefined"!=typeof process&&(null===(n=null===process||void 0===process?void 0:process.env)||void 0===n?void 0:n.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;"core"===o&&(t=s),l||(l={});const{insertAt:c}=l;if(document.getElementById(t))return void console.warn(`[react-tooltip] Element with id '${t}' already exists. Call \`removeStyle()\` first`);const u=document.head||document.getElementsByTagName("head")[0],d=document.createElement("style");d.id=t,d.type="text/css","top"===c&&u.firstChild?u.insertBefore(d,u.firstChild):u.appendChild(d),d.styleSheet?d.styleSheet.cssText=e:d.appendChild(document.createTextNode(e)),a[o]=!0}const d=(e,t,o)=>{let l=null;return function(...r){const n=()=>{l=null,o||e.apply(this,r)};o&&!l&&(e.apply(this,r),l=setTimeout(n,t)),o||(l&&clearTimeout(l),l=setTimeout(n,t))}},p="DEFAULT_TOOLTIP_ID",f={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},v={getTooltipData:()=>f},m=t.createContext(v);function y(e=p){return t.useContext(m).getTooltipData(e)}const h="undefined"!=typeof window?t.useLayoutEffect:t.useEffect,w=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some((e=>{const o=t.getPropertyValue(e);return"auto"===o||"scroll"===o}))},S=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(w(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},b=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:l=null,place:r="top",offset:n=10,strategy:c="absolute",middlewares:s=[o.offset(Number(n)),o.flip({fallbackAxisSideDirection:"start"}),o.shift({padding:5})],border:i})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};const a=s;return l?(a.push(o.arrow({element:l,padding:5})),o.computePosition(e,t,{placement:r,strategy:c,middleware:a}).then((({x:e,y:t,placement:o,middlewareData:l})=>{var r,n;const c={left:`${e}px`,top:`${t}px`,border:i},{x:s,y:a}=null!==(r=l.arrow)&&void 0!==r?r:{x:0,y:0},u=null!==(n={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]])&&void 0!==n?n:"bottom",d=i&&{borderBottom:i,borderRight:i};let p=0;if(i){const e=`${i}`.match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:c,tooltipArrowStyles:{left:null!=s?`${s}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",...d,[u]:`-${4+p}px`},place:o}}))):o.computePosition(e,t,{placement:"bottom",strategy:c,middleware:a}).then((({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o})))};var E={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},g={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const _=({forwardRef:e,id:l,className:r,classNameArrow:s,variant:i="dark",anchorId:a,anchorSelect:u,place:p="top",offset:f=10,events:v=["hover"],openOnClick:m=!1,positionStrategy:w="absolute",middlewares:_,wrapper:A,delayShow:T=0,delayHide:O=0,float:k=!1,hidden:R=!1,noArrow:C=!1,clickable:L=!1,closeOnEsc:x=!1,closeOnScroll:N=!1,closeOnResize:$=!1,openEvents:j,closeEvents:I,globalCloseEvents:B,imperativeModeOnly:D,style:q,position:z,afterShow:M,afterHide:H,content:P,contentWrapperRef:W,isOpen:F,setIsOpen:U,activeAnchor:K,setActiveAnchor:V,border:X,opacity:Y,arrowColor:G,role:Z="tooltip"})=>{var J;const Q=t.useRef(null),ee=t.useRef(null),te=t.useRef(null),oe=t.useRef(null),le=t.useRef(null),[re,ne]=t.useState(p),[ce,se]=t.useState({}),[ie,ae]=t.useState({}),[ue,de]=t.useState(!1),[pe,fe]=t.useState(!1),[ve,me]=t.useState(null),ye=t.useRef(!1),he=t.useRef(null),{anchorRefs:we,setActiveAnchor:Se}=y(l),be=t.useRef(!1),[Ee,ge]=t.useState([]),_e=t.useRef(!1),Ae=m||v.includes("click"),Te=Ae||(null==j?void 0:j.click)||(null==j?void 0:j.dblclick)||(null==j?void 0:j.mousedown),Oe=j?{...j}:{mouseenter:!0,focus:!0,click:!1,dblclick:!1,mousedown:!1};!j&&Ae&&Object.assign(Oe,{mouseenter:!1,focus:!1,click:!0});const ke=I?{...I}:{mouseleave:!0,blur:!0,click:!1,dblclick:!1,mouseup:!1};!I&&Ae&&Object.assign(ke,{mouseleave:!1,blur:!1});const Re=B?{...B}:{escape:x||!1,scroll:N||!1,resize:$||!1,clickOutsideAnchor:Te||!1};D&&(Object.assign(Oe,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(ke,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(Re,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),h((()=>(_e.current=!0,()=>{_e.current=!1})),[]);const Ce=e=>{_e.current&&(e&&fe(!0),setTimeout((()=>{_e.current&&(null==U||U(e),void 0===F&&de(e))}),10))};t.useEffect((()=>{if(void 0===F)return()=>null;F&&fe(!0);const e=setTimeout((()=>{de(F)}),10);return()=>{clearTimeout(e)}}),[F]),t.useEffect((()=>{if(ue!==ye.current)if(le.current&&clearTimeout(le.current),ye.current=ue,ue)null==M||M();else{const e=(e=>{const t=e.match(/^([\d.]+)(m?s?)$/);if(!t)return 0;const[,o,l]=t;return"s"!==l&&"ms"!==l?0:Number(o)*("ms"===l?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));le.current=setTimeout((()=>{fe(!1),me(null),null==H||H()}),e+25)}}),[ue]);const Le=(e=T)=>{te.current&&clearTimeout(te.current),te.current=setTimeout((()=>{Ce(!0)}),e)},xe=(e=O)=>{oe.current&&clearTimeout(oe.current),oe.current=setTimeout((()=>{be.current||Ce(!1)}),e)},Ne=e=>{var t;if(!e)return;const o=null!==(t=e.currentTarget)&&void 0!==t?t:e.target;if(!(null==o?void 0:o.isConnected))return V(null),void Se({current:null});T?Le():Ce(!0),V(o),Se({current:o}),oe.current&&clearTimeout(oe.current)},$e=()=>{L?xe(O||100):O?xe():Ce(!1),te.current&&clearTimeout(te.current)},je=({x:e,y:t})=>{var o;const l={getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})};b({place:null!==(o=null==ve?void 0:ve.place)&&void 0!==o?o:p,offset:f,elementReference:l,tooltipReference:Q.current,tooltipArrowReference:ee.current,strategy:w,middlewares:_,border:X}).then((e=>{Object.keys(e.tooltipStyles).length&&se(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&ae(e.tooltipArrowStyles),ne(e.place)}))},Ie=e=>{if(!e)return;const t=e,o={x:t.clientX,y:t.clientY};je(o),he.current=o},Be=e=>{var t;if(!ue)return;const o=e.target;if(null===(t=Q.current)||void 0===t?void 0:t.contains(o))return;[document.querySelector(`[id='${a}']`),...Ee].some((e=>null==e?void 0:e.contains(o)))||(Ce(!1),te.current&&clearTimeout(te.current))},De=d(Ne,50,!0),qe=d($e,50,!0),ze=t.useCallback((()=>{var e,t;const o=null!==(e=null==ve?void 0:ve.position)&&void 0!==e?e:z;o?je(o):k?he.current&&je(he.current):(null==K?void 0:K.isConnected)&&b({place:null!==(t=null==ve?void 0:ve.place)&&void 0!==t?t:p,offset:f,elementReference:K,tooltipReference:Q.current,tooltipArrowReference:ee.current,strategy:w,middlewares:_,border:X}).then((e=>{_e.current&&(Object.keys(e.tooltipStyles).length&&se(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&ae(e.tooltipArrowStyles),ne(e.place))}))}),[ue,K,P,q,p,null==ve?void 0:ve.place,f,w,z,null==ve?void 0:ve.position,k]);t.useEffect((()=>{var e,t;const l=new Set(we);Ee.forEach((e=>{l.add({current:e})}));const r=document.querySelector(`[id='${a}']`);r&&l.add({current:r});const n=()=>{Ce(!1)},c=S(K),s=S(Q.current);Re.scroll&&(window.addEventListener("scroll",n),null==c||c.addEventListener("scroll",n),null==s||s.addEventListener("scroll",n));let i=null;Re.resize?window.addEventListener("resize",n):K&&Q.current&&(i=o.autoUpdate(K,Q.current,ze,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const u=e=>{"Escape"===e.key&&Ce(!1)};Re.escape&&window.addEventListener("keydown",u),Re.clickOutsideAnchor&&window.addEventListener("click",Be);const d=[],p=e=>{ue&&(null==e?void 0:e.target)===K||Ne(e)},f=e=>{ue&&(null==e?void 0:e.target)===K&&$e()},v=["mouseenter","mouseleave","focus","blur"],m=["click","dblclick","mousedown","mouseup"];Object.entries(Oe).forEach((([e,t])=>{t&&(v.includes(e)?d.push({event:e,listener:De}):m.includes(e)&&d.push({event:e,listener:p}))})),Object.entries(ke).forEach((([e,t])=>{t&&(v.includes(e)?d.push({event:e,listener:qe}):m.includes(e)&&d.push({event:e,listener:f}))})),k&&d.push({event:"mousemove",listener:Ie});const y=()=>{be.current=!0},h=()=>{be.current=!1,$e()};return L&&!Te&&(null===(e=Q.current)||void 0===e||e.addEventListener("mouseenter",y),null===(t=Q.current)||void 0===t||t.addEventListener("mouseleave",h)),d.forEach((({event:e,listener:t})=>{l.forEach((o=>{var l;null===(l=o.current)||void 0===l||l.addEventListener(e,t)}))})),()=>{var e,t;Re.scroll&&(window.removeEventListener("scroll",n),null==c||c.removeEventListener("scroll",n),null==s||s.removeEventListener("scroll",n)),Re.resize?window.removeEventListener("resize",n):null==i||i(),Re.clickOutsideAnchor&&window.removeEventListener("click",Be),Re.escape&&window.removeEventListener("keydown",u),L&&!Te&&(null===(e=Q.current)||void 0===e||e.removeEventListener("mouseenter",y),null===(t=Q.current)||void 0===t||t.removeEventListener("mouseleave",h)),d.forEach((({event:e,listener:t})=>{l.forEach((o=>{var l;null===(l=o.current)||void 0===l||l.removeEventListener(e,t)}))}))}}),[K,ze,pe,we,Ee,j,I,B,Ae]),t.useEffect((()=>{var e,t;let o=null!==(t=null!==(e=null==ve?void 0:ve.anchorSelect)&&void 0!==e?e:u)&&void 0!==t?t:"";!o&&l&&(o=`[data-tooltip-id='${l}']`);const r=new MutationObserver((e=>{const t=[],r=[];e.forEach((e=>{if("attributes"===e.type&&"data-tooltip-id"===e.attributeName){e.target.getAttribute("data-tooltip-id")===l&&t.push(e.target)}if("childList"===e.type){if(K){const t=[...e.removedNodes].filter((e=>1===e.nodeType));if(o)try{r.push(...t.filter((e=>e.matches(o)))),r.push(...t.flatMap((e=>[...e.querySelectorAll(o)])))}catch(e){}t.some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,K))&&(fe(!1),Ce(!1),V(null),te.current&&clearTimeout(te.current),oe.current&&clearTimeout(oe.current),!0)}))}if(o)try{const l=[...e.addedNodes].filter((e=>1===e.nodeType));t.push(...l.filter((e=>e.matches(o)))),t.push(...l.flatMap((e=>[...e.querySelectorAll(o)])))}catch(e){}}})),(t.length||r.length)&&ge((e=>[...e.filter((e=>!r.includes(e))),...t]))}));return r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"]}),()=>{r.disconnect()}}),[l,u,null==ve?void 0:ve.anchorSelect,K]),t.useEffect((()=>{ze()}),[ze]),t.useEffect((()=>{if(!(null==W?void 0:W.current))return()=>null;const e=new ResizeObserver((()=>{setTimeout((()=>ze()))}));return e.observe(W.current),()=>{e.disconnect()}}),[P,null==W?void 0:W.current]),t.useEffect((()=>{var e;const t=document.querySelector(`[id='${a}']`),o=[...Ee,t];K&&o.includes(K)||V(null!==(e=Ee[0])&&void 0!==e?e:t)}),[a,Ee,K]),t.useEffect((()=>()=>{te.current&&clearTimeout(te.current),oe.current&&clearTimeout(oe.current)}),[]),t.useEffect((()=>{var e;let t=null!==(e=null==ve?void 0:ve.anchorSelect)&&void 0!==e?e:u;if(!t&&l&&(t=`[data-tooltip-id='${l}']`),t)try{const e=Array.from(document.querySelectorAll(t));ge(e)}catch(e){ge([])}}),[l,u,null==ve?void 0:ve.anchorSelect]);const Me=null!==(J=null==ve?void 0:ve.content)&&void 0!==J?J:P,He=ue&&Object.keys(ce).length>0;return t.useImperativeHandle(e,(()=>({open:e=>{if(null==e?void 0:e.anchorSelect)try{document.querySelector(e.anchorSelect)}catch(t){return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`)}me(null!=e?e:null),(null==e?void 0:e.delay)?Le(e.delay):Ce(!0)},close:e=>{(null==e?void 0:e.delay)?xe(e.delay):Ce(!1)},activeAnchor:K,place:re,isOpen:Boolean(pe&&!R&&Me&&He)}))),pe&&!R&&Me?n.default.createElement(A,{id:l,role:Z,className:c.default("react-tooltip",E.tooltip,g.tooltip,g[i],r,`react-tooltip__place-${re}`,E[He?"show":"closing"],He?"react-tooltip__show":"react-tooltip__closing","fixed"===w&&E.fixed,L&&E.clickable),onTransitionEnd:e=>{le.current&&clearTimeout(le.current),ue||"opacity"!==e.propertyName||(fe(!1),me(null),null==H||H())},style:{...q,...ce,opacity:void 0!==Y&&He?Y:void 0},ref:Q},Me,n.default.createElement(A,{className:c.default("react-tooltip-arrow",E.arrow,g.arrow,s,C&&E.noArrow),style:{...ie,background:G?`linear-gradient(to right bottom, transparent 50%, ${G} 50%)`:void 0},ref:ee})):null},A=({content:e})=>n.default.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),T=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),O=n.default.forwardRef((({id:e,anchorId:o,anchorSelect:l,content:r,html:s,render:i,className:a,classNameArrow:u,variant:d="dark",place:p="top",offset:f=10,wrapper:v="div",children:m=null,events:h=["hover"],openOnClick:w=!1,positionStrategy:S="absolute",middlewares:b,delayShow:E=0,delayHide:g=0,float:O=!1,hidden:k=!1,noArrow:R=!1,clickable:C=!1,closeOnEsc:L=!1,closeOnScroll:x=!1,closeOnResize:N=!1,openEvents:$,closeEvents:j,globalCloseEvents:I,imperativeModeOnly:B=!1,style:D,position:q,isOpen:z,disableStyleInjection:M=!1,border:H,opacity:P,arrowColor:W,setIsOpen:F,afterShow:U,afterHide:K,role:V="tooltip"},X)=>{const[Y,G]=t.useState(r),[Z,J]=t.useState(s),[Q,ee]=t.useState(p),[te,oe]=t.useState(d),[le,re]=t.useState(f),[ne,ce]=t.useState(E),[se,ie]=t.useState(g),[ae,ue]=t.useState(O),[de,pe]=t.useState(k),[fe,ve]=t.useState(v),[me,ye]=t.useState(h),[he,we]=t.useState(S),[Se,be]=t.useState(null),[Ee,ge]=t.useState(null),_e=t.useRef(M),{anchorRefs:Ae,activeAnchor:Te}=y(e),Oe=e=>null==e?void 0:e.getAttributeNames().reduce(((t,o)=>{var l;if(o.startsWith("data-tooltip-")){t[o.replace(/^data-tooltip-/,"")]=null!==(l=null==e?void 0:e.getAttribute(o))&&void 0!==l?l:null}return t}),{}),ke=e=>{const t={place:e=>{var t;ee(null!==(t=e)&&void 0!==t?t:p)},content:e=>{G(null!=e?e:r)},html:e=>{J(null!=e?e:s)},variant:e=>{var t;oe(null!==(t=e)&&void 0!==t?t:d)},offset:e=>{re(null===e?f:Number(e))},wrapper:e=>{var t;ve(null!==(t=e)&&void 0!==t?t:v)},events:e=>{const t=null==e?void 0:e.split(" ");ye(null!=t?t:h)},"position-strategy":e=>{var t;we(null!==(t=e)&&void 0!==t?t:S)},"delay-show":e=>{ce(null===e?E:Number(e))},"delay-hide":e=>{ie(null===e?g:Number(e))},float:e=>{ue(null===e?O:"true"===e)},hidden:e=>{pe(null===e?k:"true"===e)},"class-name":e=>{be(e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,o])=>{var l;null===(l=t[e])||void 0===l||l.call(t,o)}))};t.useEffect((()=>{G(r)}),[r]),t.useEffect((()=>{J(s)}),[s]),t.useEffect((()=>{ee(p)}),[p]),t.useEffect((()=>{oe(d)}),[d]),t.useEffect((()=>{re(f)}),[f]),t.useEffect((()=>{ce(E)}),[E]),t.useEffect((()=>{ie(g)}),[g]),t.useEffect((()=>{ue(O)}),[O]),t.useEffect((()=>{pe(k)}),[k]),t.useEffect((()=>{we(S)}),[S]),t.useEffect((()=>{_e.current!==M&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[M]),t.useEffect((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===M,disableBase:M}}))}),[]),t.useEffect((()=>{var t;const r=new Set(Ae);let n=l;if(!n&&e&&(n=`[data-tooltip-id='${e}']`),n)try{document.querySelectorAll(n).forEach((e=>{r.add({current:e})}))}catch(e){console.warn(`[react-tooltip] "${n}" is not a valid CSS selector`)}const c=document.querySelector(`[id='${o}']`);if(c&&r.add({current:c}),!r.size)return()=>null;const s=null!==(t=null!=Ee?Ee:c)&&void 0!==t?t:Te.current,i=new MutationObserver((e=>{e.forEach((e=>{var t;if(!s||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const o=Oe(s);ke(o)}))})),a={attributes:!0,childList:!1,subtree:!1};if(s){const e=Oe(s);ke(e),i.observe(s,a)}return()=>{i.disconnect()}}),[Ae,Te,Ee,o,l]),t.useEffect((()=>{(null==D?void 0:D.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),H&&!T("border",`${H}`)&&console.warn(`[react-tooltip] "${H}" is not a valid \`border\`.`),(null==D?void 0:D.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),P&&!T("opacity",`${P}`)&&console.warn(`[react-tooltip] "${P}" is not a valid \`opacity\`.`)}),[]);let Re=m;const Ce=t.useRef(null);if(i){const e=i({content:null!=Y?Y:null,activeAnchor:Ee});Re=e?n.default.createElement("div",{ref:Ce,className:"react-tooltip-content-wrapper"},e):null}else Y&&(Re=Y);Z&&(Re=n.default.createElement(A,{content:Z}));const Le={forwardRef:X,id:e,anchorId:o,anchorSelect:l,className:c.default(a,Se),classNameArrow:u,content:Re,contentWrapperRef:Ce,place:Q,variant:te,offset:le,wrapper:fe,events:me,openOnClick:w,positionStrategy:he,middlewares:b,delayShow:ne,delayHide:se,float:ae,hidden:de,noArrow:R,clickable:C,closeOnEsc:L,closeOnScroll:x,closeOnResize:N,openEvents:$,closeEvents:j,globalCloseEvents:I,imperativeModeOnly:B,style:D,position:q,isOpen:z,border:H,opacity:P,arrowColor:W,setIsOpen:F,afterShow:U,afterHide:K,activeAnchor:Ee,setActiveAnchor:e=>ge(e),role:V};return n.default.createElement(_,{...Le})}));"undefined"!=typeof window&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||u({css:`:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}`,type:"core"}),e.detail.disableBase||u({css:`
|
|
8
|
+
.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"})})),e.Tooltip=O,e.TooltipProvider=({children:e})=>{const[o,l]=t.useState({[p]:new Set}),[r,c]=t.useState({[p]:{current:null}}),s=(e,...t)=>{l((o=>{var l;const r=null!==(l=o[e])&&void 0!==l?l:new Set;return t.forEach((e=>r.add(e))),{...o,[e]:new Set(r)}}))},i=(e,...t)=>{l((o=>{const l=o[e];return l?(t.forEach((e=>l.delete(e))),{...o}):o}))},a=t.useCallback(((e=p)=>{var t,l;return{anchorRefs:null!==(t=o[e])&&void 0!==t?t:new Set,activeAnchor:null!==(l=r[e])&&void 0!==l?l:{current:null},attach:(...t)=>s(e,...t),detach:(...t)=>i(e,...t),setActiveAnchor:t=>((e,t)=>{c((o=>{var l;return(null===(l=o[e])||void 0===l?void 0:l.current)===t.current?o:{...o,[e]:t}}))})(e,t)}}),[o,r,s,i]),u=t.useMemo((()=>({getTooltipData:a})),[a]);return n.default.createElement(m.Provider,{value:u},e)},e.TooltipWrapper=({tooltipId:e,children:o,className:l,place:r,content:s,html:i,variant:a,offset:u,wrapper:d,events:p,positionStrategy:f,delayShow:v,delayHide:m})=>{const{attach:h,detach:w}=y(e),S=t.useRef(null);return t.useEffect((()=>(h(S),()=>{w(S)})),[]),n.default.createElement("span",{ref:S,className:c.default("react-tooltip-wrapper",l),"data-tooltip-place":r,"data-tooltip-content":s,"data-tooltip-html":i,"data-tooltip-variant":a,"data-tooltip-offset":u,"data-tooltip-wrapper":d,"data-tooltip-events":p,"data-tooltip-position-strategy":f,"data-tooltip-delay-show":v,"data-tooltip-delay-hide":m},o)},e.removeStyle=function({type:e="base",id:t=i}={}){if(!a[e])return;"core"===e&&(t=s);const o=document.getElementById(t);"style"===(null==o?void 0:o.tagName)?null==o||o.remove():console.warn(`[react-tooltip] Failed to remove 'style' element with id '${t}'. Call \`injectStyle()\` first`),a[e]=!1},Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-tooltip.umd.min.js","sources":["../src/utils/handle-style.ts","../src/utils/debounce.ts","../src/components/TooltipProvider/TooltipProvider.tsx","../src/components/TooltipProvider/TooltipWrapper.tsx","../src/utils/use-isomorphic-layout-effect.ts","../src/utils/get-scroll-parent.ts","../src/utils/compute-positions.ts","../src/components/Tooltip/Tooltip.tsx","../src/utils/css-time-to-ms.ts","../src/components/TooltipContent/TooltipContent.tsx","../src/utils/css-supports.ts","../src/components/TooltipController/TooltipController.tsx","../src/index.tsx"],"sourcesContent":["// This is the ID for the core styles of ReactTooltip\nconst REACT_TOOLTIP_CORE_STYLES_ID = 'react-tooltip-core-styles'\n// This is the ID for the visual styles of ReactTooltip\nconst REACT_TOOLTIP_BASE_STYLES_ID = 'react-tooltip-base-styles'\n\nconst injected = {\n core: false,\n base: false,\n}\n\nfunction injectStyle({\n css,\n id = REACT_TOOLTIP_BASE_STYLES_ID,\n type = 'base',\n ref,\n}: {\n css: string\n id?: string\n type?: 'core' | 'base'\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref?: any\n}) {\n if (!css || typeof document === 'undefined' || injected[type]) {\n return\n }\n\n if (\n type === 'core' &&\n typeof process !== 'undefined' && // this validation prevents docs from breaking even with `process?`\n process?.env?.REACT_TOOLTIP_DISABLE_CORE_STYLES\n ) {\n return\n }\n\n if (\n type !== 'base' &&\n typeof process !== 'undefined' && // this validation prevents docs from breaking even with `process?`\n process?.env?.REACT_TOOLTIP_DISABLE_BASE_STYLES\n ) {\n return\n }\n\n if (type === 'core') {\n // eslint-disable-next-line no-param-reassign\n id = REACT_TOOLTIP_CORE_STYLES_ID\n }\n\n if (!ref) {\n // eslint-disable-next-line no-param-reassign\n ref = {}\n }\n const { insertAt } = ref\n\n if (document.getElementById(id)) {\n // this should never happen because of `injected[type]`\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(\n `[react-tooltip] Element with id '${id}' already exists. Call \\`removeStyle()\\` first`,\n )\n }\n return\n }\n\n const head = document.head || document.getElementsByTagName('head')[0]\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const style: any = document.createElement('style')\n style.id = id\n style.type = 'text/css'\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n\n injected[type] = true\n}\n\n/**\n * @deprecated Use the `disableStyleInjection` tooltip prop instead.\n * See https://react-tooltip.com/docs/examples/styling#disabling-reacttooltip-css\n */\nfunction removeStyle({\n type = 'base',\n id = REACT_TOOLTIP_BASE_STYLES_ID,\n}: {\n type?: 'core' | 'base'\n id?: string\n} = {}) {\n if (!injected[type]) {\n return\n }\n\n if (type === 'core') {\n // eslint-disable-next-line no-param-reassign\n id = REACT_TOOLTIP_CORE_STYLES_ID\n }\n\n const style = document.getElementById(id)\n if (style?.tagName === 'style') {\n style?.remove()\n } else if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(\n `[react-tooltip] Failed to remove 'style' element with id '${id}'. Call \\`injectStyle()\\` first`,\n )\n }\n\n injected[type] = false\n}\n\nexport { injectStyle, removeStyle }\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * This function debounce the received function\n * @param { function } \tfunc\t\t\t\tFunction to be debounced\n * @param { number } \t\twait\t\t\t\tTime to wait before execut the function\n * @param { boolean } \timmediate\t\tParam to define if the function will be executed immediately\n */\nconst debounce = (func: (...args: any[]) => void, wait?: number, immediate?: boolean) => {\n let timeout: NodeJS.Timeout | null = null\n\n return function debounced(this: typeof func, ...args: any[]) {\n const later = () => {\n timeout = null\n if (!immediate) {\n func.apply(this, args)\n }\n }\n\n if (immediate && !timeout) {\n /**\n * there's not need to clear the timeout\n * since we expect it to resolve and set `timeout = null`\n */\n func.apply(this, args)\n timeout = setTimeout(later, wait)\n }\n\n if (!immediate) {\n if (timeout) {\n clearTimeout(timeout)\n }\n timeout = setTimeout(later, wait)\n }\n }\n}\n\nexport default debounce\n","import React, {\n createContext,\n PropsWithChildren,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from 'react'\n\nimport type {\n AnchorRef,\n TooltipContextData,\n TooltipContextDataWrapper,\n} from './TooltipProviderTypes'\n\nconst DEFAULT_TOOLTIP_ID = 'DEFAULT_TOOLTIP_ID'\nconst DEFAULT_CONTEXT_DATA: TooltipContextData = {\n anchorRefs: new Set(),\n activeAnchor: { current: null },\n attach: () => {\n /* attach anchor element */\n },\n detach: () => {\n /* detach anchor element */\n },\n setActiveAnchor: () => {\n /* set active anchor */\n },\n}\n\nconst DEFAULT_CONTEXT_DATA_WRAPPER: TooltipContextDataWrapper = {\n getTooltipData: () => DEFAULT_CONTEXT_DATA,\n}\n\nconst TooltipContext = createContext<TooltipContextDataWrapper>(DEFAULT_CONTEXT_DATA_WRAPPER)\n\n/**\n * @deprecated Use the `data-tooltip-id` attribute, or the `anchorSelect` prop instead.\n * See https://react-tooltip.com/docs/getting-started\n */\nconst TooltipProvider: React.FC<PropsWithChildren<void>> = ({ children }) => {\n const [anchorRefMap, setAnchorRefMap] = useState<Record<string, Set<AnchorRef>>>({\n [DEFAULT_TOOLTIP_ID]: new Set(),\n })\n const [activeAnchorMap, setActiveAnchorMap] = useState<Record<string, AnchorRef>>({\n [DEFAULT_TOOLTIP_ID]: { current: null },\n })\n\n const attach = (tooltipId: string, ...refs: AnchorRef[]) => {\n setAnchorRefMap((oldMap) => {\n const tooltipRefs = oldMap[tooltipId] ?? new Set()\n refs.forEach((ref) => tooltipRefs.add(ref))\n // create new object to trigger re-render\n return { ...oldMap, [tooltipId]: new Set(tooltipRefs) }\n })\n }\n\n const detach = (tooltipId: string, ...refs: AnchorRef[]) => {\n setAnchorRefMap((oldMap) => {\n const tooltipRefs = oldMap[tooltipId]\n if (!tooltipRefs) {\n // tooltip not found\n // maybe thow error?\n return oldMap\n }\n refs.forEach((ref) => tooltipRefs.delete(ref))\n // create new object to trigger re-render\n return { ...oldMap }\n })\n }\n\n const setActiveAnchor = (tooltipId: string, ref: React.RefObject<HTMLElement>) => {\n setActiveAnchorMap((oldMap) => {\n if (oldMap[tooltipId]?.current === ref.current) {\n return oldMap\n }\n // create new object to trigger re-render\n return { ...oldMap, [tooltipId]: ref }\n })\n }\n\n const getTooltipData = useCallback(\n (tooltipId = DEFAULT_TOOLTIP_ID) => ({\n anchorRefs: anchorRefMap[tooltipId] ?? new Set(),\n activeAnchor: activeAnchorMap[tooltipId] ?? { current: null },\n attach: (...refs: AnchorRef[]) => attach(tooltipId, ...refs),\n detach: (...refs: AnchorRef[]) => detach(tooltipId, ...refs),\n setActiveAnchor: (ref: AnchorRef) => setActiveAnchor(tooltipId, ref),\n }),\n [anchorRefMap, activeAnchorMap, attach, detach],\n )\n\n const context = useMemo(() => {\n return {\n getTooltipData,\n }\n }, [getTooltipData])\n\n return <TooltipContext.Provider value={context}>{children}</TooltipContext.Provider>\n}\n\nexport function useTooltip(tooltipId = DEFAULT_TOOLTIP_ID) {\n return useContext(TooltipContext).getTooltipData(tooltipId)\n}\n\nexport default TooltipProvider\n","import React, { useEffect, useRef } from 'react'\nimport classNames from 'classnames'\nimport { useTooltip } from './TooltipProvider'\nimport type { ITooltipWrapper } from './TooltipProviderTypes'\n\n/**\n * @deprecated Use the `data-tooltip-id` attribute, or the `anchorSelect` prop instead.\n * See https://react-tooltip.com/docs/getting-started\n */\nconst TooltipWrapper = ({\n tooltipId,\n children,\n className,\n place,\n content,\n html,\n variant,\n offset,\n wrapper,\n events,\n positionStrategy,\n delayShow,\n delayHide,\n}: ITooltipWrapper) => {\n const { attach, detach } = useTooltip(tooltipId)\n const anchorRef = useRef<HTMLElement | null>(null)\n\n useEffect(() => {\n attach(anchorRef)\n return () => {\n detach(anchorRef)\n }\n }, [])\n\n return (\n <span\n ref={anchorRef}\n className={classNames('react-tooltip-wrapper', className)}\n data-tooltip-place={place}\n data-tooltip-content={content}\n data-tooltip-html={html}\n data-tooltip-variant={variant}\n data-tooltip-offset={offset}\n data-tooltip-wrapper={wrapper}\n data-tooltip-events={events}\n data-tooltip-position-strategy={positionStrategy}\n data-tooltip-delay-show={delayShow}\n data-tooltip-delay-hide={delayHide}\n >\n {children}\n </span>\n )\n}\n\nexport default TooltipWrapper\n","import { useLayoutEffect, useEffect } from 'react'\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect\n\nexport default useIsomorphicLayoutEffect\n","const isScrollable = (node: Element) => {\n if (!(node instanceof HTMLElement || node instanceof SVGElement)) {\n return false\n }\n const style = getComputedStyle(node)\n return ['overflow', 'overflow-x', 'overflow-y'].some((propertyName) => {\n const value = style.getPropertyValue(propertyName)\n return value === 'auto' || value === 'scroll'\n })\n}\n\nexport const getScrollParent = (node: Element | null) => {\n if (!node) {\n return null\n }\n let currentParent = node.parentElement\n while (currentParent) {\n if (isScrollable(currentParent)) {\n return currentParent\n }\n currentParent = currentParent.parentElement\n }\n return document.scrollingElement || document.documentElement\n}\n","import { computePosition, offset, shift, arrow, flip } from '@floating-ui/dom'\nimport type { IComputePositions } from './compute-positions-types'\n\nexport const computeTooltipPosition = async ({\n elementReference = null,\n tooltipReference = null,\n tooltipArrowReference = null,\n place = 'top',\n offset: offsetValue = 10,\n strategy = 'absolute',\n middlewares = [offset(Number(offsetValue)), flip(), shift({ padding: 5 })],\n border,\n}: IComputePositions) => {\n if (!elementReference) {\n // elementReference can be null or undefined and we will not compute the position\n // eslint-disable-next-line no-console\n // console.error('The reference element for tooltip was not defined: ', elementReference)\n return { tooltipStyles: {}, tooltipArrowStyles: {}, place }\n }\n\n if (tooltipReference === null) {\n return { tooltipStyles: {}, tooltipArrowStyles: {}, place }\n }\n\n const middleware = middlewares\n\n if (tooltipArrowReference) {\n middleware.push(arrow({ element: tooltipArrowReference as HTMLElement, padding: 5 }))\n\n return computePosition(elementReference as HTMLElement, tooltipReference as HTMLElement, {\n placement: place,\n strategy,\n middleware,\n }).then(({ x, y, placement, middlewareData }) => {\n const styles = { left: `${x}px`, top: `${y}px`, border }\n\n const { x: arrowX, y: arrowY } = middlewareData.arrow ?? { x: 0, y: 0 }\n\n const staticSide =\n {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }[placement.split('-')[0]] ?? 'bottom'\n\n const borderSide = border && {\n borderBottom: border,\n borderRight: border,\n }\n\n let borderWidth = 0\n if (border) {\n const match = `${border}`.match(/(\\d+)px/)\n if (match?.[1]) {\n borderWidth = Number(match[1])\n } else {\n /**\n * this means `border` was set without `width`, or non-px value\n */\n borderWidth = 1\n }\n }\n\n const arrowStyle = {\n left: arrowX != null ? `${arrowX}px` : '',\n top: arrowY != null ? `${arrowY}px` : '',\n right: '',\n bottom: '',\n ...borderSide,\n [staticSide]: `-${4 + borderWidth}px`,\n }\n\n return { tooltipStyles: styles, tooltipArrowStyles: arrowStyle, place: placement }\n })\n }\n\n return computePosition(elementReference as HTMLElement, tooltipReference as HTMLElement, {\n placement: 'bottom',\n strategy,\n middleware,\n }).then(({ x, y, placement }) => {\n const styles = { left: `${x}px`, top: `${y}px` }\n\n return { tooltipStyles: styles, tooltipArrowStyles: {}, place: placement }\n })\n}\n","import React, { useEffect, useState, useRef, useCallback, useImperativeHandle } from 'react'\nimport { autoUpdate } from '@floating-ui/dom'\nimport classNames from 'classnames'\nimport debounce from 'utils/debounce'\nimport { useTooltip } from 'components/TooltipProvider'\nimport useIsomorphicLayoutEffect from 'utils/use-isomorphic-layout-effect'\nimport { getScrollParent } from 'utils/get-scroll-parent'\nimport { computeTooltipPosition } from 'utils/compute-positions'\nimport { cssTimeToMs } from 'utils/css-time-to-ms'\nimport coreStyles from './core-styles.module.css'\nimport styles from './styles.module.css'\nimport type {\n AnchorCloseEvents,\n AnchorOpenEvents,\n GlobalCloseEvents,\n IPosition,\n ITooltip,\n PlacesType,\n TooltipImperativeOpenOptions,\n} from './TooltipTypes'\n\nconst Tooltip = ({\n // props\n forwardRef,\n id,\n className,\n classNameArrow,\n variant = 'dark',\n anchorId,\n anchorSelect,\n place = 'top',\n offset = 10,\n events = ['hover'],\n openOnClick = false,\n positionStrategy = 'absolute',\n middlewares,\n wrapper: WrapperElement,\n delayShow = 0,\n delayHide = 0,\n float = false,\n hidden = false,\n noArrow = false,\n clickable = false,\n closeOnEsc = false,\n closeOnScroll = false,\n closeOnResize = false,\n openEvents,\n closeEvents,\n globalCloseEvents,\n imperativeModeOnly,\n style: externalStyles,\n position,\n afterShow,\n afterHide,\n // props handled by controller\n content,\n contentWrapperRef,\n isOpen,\n setIsOpen,\n activeAnchor,\n setActiveAnchor,\n border,\n opacity,\n arrowColor,\n role = 'tooltip',\n}: ITooltip) => {\n const tooltipRef = useRef<HTMLElement>(null)\n const tooltipArrowRef = useRef<HTMLElement>(null)\n const tooltipShowDelayTimerRef = useRef<NodeJS.Timeout | null>(null)\n const tooltipHideDelayTimerRef = useRef<NodeJS.Timeout | null>(null)\n const missedTransitionTimerRef = useRef<NodeJS.Timeout | null>(null)\n const [actualPlacement, setActualPlacement] = useState(place)\n const [inlineStyles, setInlineStyles] = useState({})\n const [inlineArrowStyles, setInlineArrowStyles] = useState({})\n const [show, setShow] = useState(false)\n const [rendered, setRendered] = useState(false)\n const [imperativeOptions, setImperativeOptions] = useState<TooltipImperativeOpenOptions | null>(\n null,\n )\n const wasShowing = useRef(false)\n const lastFloatPosition = useRef<IPosition | null>(null)\n /**\n * @todo Remove this in a future version (provider/wrapper method is deprecated)\n */\n const { anchorRefs, setActiveAnchor: setProviderActiveAnchor } = useTooltip(id)\n const hoveringTooltip = useRef(false)\n const [anchorsBySelect, setAnchorsBySelect] = useState<HTMLElement[]>([])\n const mounted = useRef(false)\n\n /**\n * @todo Update when deprecated stuff gets removed.\n */\n const shouldOpenOnClick = openOnClick || events.includes('click')\n const hasClickEvent =\n shouldOpenOnClick || openEvents?.click || openEvents?.dblclick || openEvents?.mousedown\n const actualOpenEvents: AnchorOpenEvents = openEvents\n ? { ...openEvents }\n : {\n mouseenter: true,\n focus: true,\n click: false,\n dblclick: false,\n mousedown: false,\n }\n if (!openEvents && shouldOpenOnClick) {\n Object.assign(actualOpenEvents, {\n mouseenter: false,\n focus: false,\n click: true,\n })\n }\n const actualCloseEvents: AnchorCloseEvents = closeEvents\n ? { ...closeEvents }\n : {\n mouseleave: true,\n blur: true,\n click: false,\n dblclick: false,\n mouseup: false,\n }\n if (!closeEvents && shouldOpenOnClick) {\n Object.assign(actualCloseEvents, {\n mouseleave: false,\n blur: false,\n })\n }\n const actualGlobalCloseEvents: GlobalCloseEvents = globalCloseEvents\n ? { ...globalCloseEvents }\n : {\n escape: closeOnEsc || false,\n scroll: closeOnScroll || false,\n resize: closeOnResize || false,\n clickOutsideAnchor: hasClickEvent || false,\n }\n\n if (imperativeModeOnly) {\n Object.assign(actualOpenEvents, {\n mouseenter: false,\n focus: false,\n click: false,\n dblclick: false,\n mousedown: false,\n })\n Object.assign(actualCloseEvents, {\n mouseleave: false,\n blur: false,\n click: false,\n dblclick: false,\n mouseup: false,\n })\n Object.assign(actualGlobalCloseEvents, {\n escape: false,\n scroll: false,\n resize: false,\n clickOutsideAnchor: false,\n })\n }\n\n /**\n * useLayoutEffect runs before useEffect,\n * but should be used carefully because of caveats\n * https://beta.reactjs.org/reference/react/useLayoutEffect#caveats\n */\n useIsomorphicLayoutEffect(() => {\n mounted.current = true\n return () => {\n mounted.current = false\n }\n }, [])\n\n const handleShow = (value: boolean) => {\n if (!mounted.current) {\n return\n }\n if (value) {\n setRendered(true)\n }\n /**\n * wait for the component to render and calculate position\n * before actually showing\n */\n setTimeout(() => {\n if (!mounted.current) {\n return\n }\n setIsOpen?.(value)\n if (isOpen === undefined) {\n setShow(value)\n }\n }, 10)\n }\n\n /**\n * this replicates the effect from `handleShow()`\n * when `isOpen` is changed from outside\n */\n useEffect(() => {\n if (isOpen === undefined) {\n return () => null\n }\n if (isOpen) {\n setRendered(true)\n }\n const timeout = setTimeout(() => {\n setShow(isOpen)\n }, 10)\n return () => {\n clearTimeout(timeout)\n }\n }, [isOpen])\n\n useEffect(() => {\n if (show === wasShowing.current) {\n return\n }\n if (missedTransitionTimerRef.current) {\n clearTimeout(missedTransitionTimerRef.current)\n }\n wasShowing.current = show\n if (show) {\n afterShow?.()\n } else {\n /**\n * see `onTransitionEnd` on tooltip wrapper\n */\n const style = getComputedStyle(document.body)\n const transitionShowDelay = cssTimeToMs(style.getPropertyValue('--rt-transition-show-delay'))\n missedTransitionTimerRef.current = setTimeout(() => {\n /**\n * if the tooltip switches from `show === true` to `show === false` too fast\n * the transition never runs, so `onTransitionEnd` callback never gets fired\n */\n setRendered(false)\n setImperativeOptions(null)\n afterHide?.()\n // +25ms just to make sure `onTransitionEnd` (if it gets fired) has time to run\n }, transitionShowDelay + 25)\n }\n }, [show])\n\n const handleShowTooltipDelayed = (delay = delayShow) => {\n if (tooltipShowDelayTimerRef.current) {\n clearTimeout(tooltipShowDelayTimerRef.current)\n }\n\n tooltipShowDelayTimerRef.current = setTimeout(() => {\n handleShow(true)\n }, delay)\n }\n\n const handleHideTooltipDelayed = (delay = delayHide) => {\n if (tooltipHideDelayTimerRef.current) {\n clearTimeout(tooltipHideDelayTimerRef.current)\n }\n\n tooltipHideDelayTimerRef.current = setTimeout(() => {\n if (hoveringTooltip.current) {\n return\n }\n handleShow(false)\n }, delay)\n }\n\n const handleShowTooltip = (event?: Event) => {\n if (!event) {\n return\n }\n const target = (event.currentTarget ?? event.target) as HTMLElement | null\n if (!target?.isConnected) {\n /**\n * this happens when the target is removed from the DOM\n * at the same time the tooltip gets triggered\n */\n setActiveAnchor(null)\n setProviderActiveAnchor({ current: null })\n return\n }\n if (delayShow) {\n handleShowTooltipDelayed()\n } else {\n handleShow(true)\n }\n setActiveAnchor(target)\n setProviderActiveAnchor({ current: target })\n\n if (tooltipHideDelayTimerRef.current) {\n clearTimeout(tooltipHideDelayTimerRef.current)\n }\n }\n\n const handleHideTooltip = () => {\n if (clickable) {\n // allow time for the mouse to reach the tooltip, in case there's a gap\n handleHideTooltipDelayed(delayHide || 100)\n } else if (delayHide) {\n handleHideTooltipDelayed()\n } else {\n handleShow(false)\n }\n\n if (tooltipShowDelayTimerRef.current) {\n clearTimeout(tooltipShowDelayTimerRef.current)\n }\n }\n\n const handleTooltipPosition = ({ x, y }: IPosition) => {\n const virtualElement = {\n getBoundingClientRect() {\n return {\n x,\n y,\n width: 0,\n height: 0,\n top: y,\n left: x,\n right: x,\n bottom: y,\n }\n },\n } as Element\n computeTooltipPosition({\n place: imperativeOptions?.place ?? place,\n offset,\n elementReference: virtualElement,\n tooltipReference: tooltipRef.current,\n tooltipArrowReference: tooltipArrowRef.current,\n strategy: positionStrategy,\n middlewares,\n border,\n }).then((computedStylesData) => {\n if (Object.keys(computedStylesData.tooltipStyles).length) {\n setInlineStyles(computedStylesData.tooltipStyles)\n }\n if (Object.keys(computedStylesData.tooltipArrowStyles).length) {\n setInlineArrowStyles(computedStylesData.tooltipArrowStyles)\n }\n setActualPlacement(computedStylesData.place as PlacesType)\n })\n }\n\n const handleMouseMove = (event?: Event) => {\n if (!event) {\n return\n }\n const mouseEvent = event as MouseEvent\n const mousePosition = {\n x: mouseEvent.clientX,\n y: mouseEvent.clientY,\n }\n handleTooltipPosition(mousePosition)\n lastFloatPosition.current = mousePosition\n }\n\n const handleClickOutsideAnchors = (event: MouseEvent) => {\n if (!show) {\n return\n }\n const target = event.target as HTMLElement\n if (tooltipRef.current?.contains(target)) {\n return\n }\n const anchorById = document.querySelector<HTMLElement>(`[id='${anchorId}']`)\n const anchors = [anchorById, ...anchorsBySelect]\n if (anchors.some((anchor) => anchor?.contains(target))) {\n return\n }\n handleShow(false)\n if (tooltipShowDelayTimerRef.current) {\n clearTimeout(tooltipShowDelayTimerRef.current)\n }\n }\n\n // debounce handler to prevent call twice when\n // mouse enter and focus events being triggered toggether\n const debouncedHandleShowTooltip = debounce(handleShowTooltip, 50, true)\n const debouncedHandleHideTooltip = debounce(handleHideTooltip, 50, true)\n const updateTooltipPosition = useCallback(() => {\n const actualPosition = imperativeOptions?.position ?? position\n if (actualPosition) {\n // if `position` is set, override regular and `float` positioning\n handleTooltipPosition(actualPosition)\n return\n }\n\n if (float) {\n if (lastFloatPosition.current) {\n /*\n Without this, changes to `content`, `place`, `offset`, ..., will only\n trigger a position calculation after a `mousemove` event.\n\n To see why this matters, comment this line, run `yarn dev` and click the\n \"Hover me!\" anchor.\n */\n handleTooltipPosition(lastFloatPosition.current)\n }\n // if `float` is set, override regular positioning\n return\n }\n\n if (!activeAnchor?.isConnected) {\n return\n }\n\n computeTooltipPosition({\n place: imperativeOptions?.place ?? place,\n offset,\n elementReference: activeAnchor,\n tooltipReference: tooltipRef.current,\n tooltipArrowReference: tooltipArrowRef.current,\n strategy: positionStrategy,\n middlewares,\n border,\n }).then((computedStylesData) => {\n if (!mounted.current) {\n // invalidate computed positions after remount\n return\n }\n if (Object.keys(computedStylesData.tooltipStyles).length) {\n setInlineStyles(computedStylesData.tooltipStyles)\n }\n if (Object.keys(computedStylesData.tooltipArrowStyles).length) {\n setInlineArrowStyles(computedStylesData.tooltipArrowStyles)\n }\n setActualPlacement(computedStylesData.place as PlacesType)\n })\n }, [\n show,\n activeAnchor,\n content,\n externalStyles,\n place,\n imperativeOptions?.place,\n offset,\n positionStrategy,\n position,\n imperativeOptions?.position,\n float,\n ])\n\n useEffect(() => {\n const elementRefs = new Set(anchorRefs)\n\n anchorsBySelect.forEach((anchor) => {\n elementRefs.add({ current: anchor })\n })\n\n const anchorById = document.querySelector<HTMLElement>(`[id='${anchorId}']`)\n if (anchorById) {\n elementRefs.add({ current: anchorById })\n }\n\n const handleScrollResize = () => {\n handleShow(false)\n }\n\n const anchorScrollParent = getScrollParent(activeAnchor)\n const tooltipScrollParent = getScrollParent(tooltipRef.current)\n\n if (actualGlobalCloseEvents.scroll) {\n window.addEventListener('scroll', handleScrollResize)\n anchorScrollParent?.addEventListener('scroll', handleScrollResize)\n tooltipScrollParent?.addEventListener('scroll', handleScrollResize)\n }\n let updateTooltipCleanup: null | (() => void) = null\n if (actualGlobalCloseEvents.resize) {\n window.addEventListener('resize', handleScrollResize)\n } else if (activeAnchor && tooltipRef.current) {\n updateTooltipCleanup = autoUpdate(\n activeAnchor as HTMLElement,\n tooltipRef.current as HTMLElement,\n updateTooltipPosition,\n {\n ancestorResize: true,\n elementResize: true,\n layoutShift: true,\n },\n )\n }\n\n const handleEsc = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') {\n return\n }\n handleShow(false)\n }\n if (actualGlobalCloseEvents.escape) {\n window.addEventListener('keydown', handleEsc)\n }\n\n if (actualGlobalCloseEvents.clickOutsideAnchor) {\n window.addEventListener('click', handleClickOutsideAnchors)\n }\n\n const enabledEvents: { event: string; listener: (event?: Event) => void }[] = []\n\n const handleClickOpenTooltipAnchor = (event?: Event) => {\n if (show) {\n return\n }\n handleShowTooltip(event)\n }\n const handleClickCloseTooltipAnchor = () => {\n if (!show) {\n return\n }\n handleHideTooltip()\n }\n\n const regularEvents = ['mouseenter', 'mouseleave', 'focus', 'blur']\n const clickEvents = ['click', 'dblclick', 'mousedown', 'mouseup']\n\n Object.entries(actualOpenEvents).forEach(([event, enabled]) => {\n if (!enabled) {\n return\n }\n if (regularEvents.includes(event)) {\n enabledEvents.push({ event, listener: debouncedHandleShowTooltip })\n } else if (clickEvents.includes(event)) {\n enabledEvents.push({ event, listener: handleClickOpenTooltipAnchor })\n } else {\n // never happens\n }\n })\n\n Object.entries(actualCloseEvents).forEach(([event, enabled]) => {\n if (!enabled) {\n return\n }\n if (regularEvents.includes(event)) {\n enabledEvents.push({ event, listener: debouncedHandleHideTooltip })\n } else if (clickEvents.includes(event)) {\n enabledEvents.push({ event, listener: handleClickCloseTooltipAnchor })\n } else {\n // never happens\n }\n })\n\n if (float) {\n enabledEvents.push({\n event: 'mousemove',\n listener: handleMouseMove,\n })\n }\n\n const handleMouseEnterTooltip = () => {\n hoveringTooltip.current = true\n }\n const handleMouseLeaveTooltip = () => {\n hoveringTooltip.current = false\n handleHideTooltip()\n }\n\n if (clickable && !hasClickEvent) {\n // used to keep the tooltip open when hovering content.\n // not needed if using click events.\n tooltipRef.current?.addEventListener('mouseenter', handleMouseEnterTooltip)\n tooltipRef.current?.addEventListener('mouseleave', handleMouseLeaveTooltip)\n }\n\n enabledEvents.forEach(({ event, listener }) => {\n elementRefs.forEach((ref) => {\n ref.current?.addEventListener(event, listener)\n })\n })\n\n return () => {\n if (actualGlobalCloseEvents.scroll) {\n window.removeEventListener('scroll', handleScrollResize)\n anchorScrollParent?.removeEventListener('scroll', handleScrollResize)\n tooltipScrollParent?.removeEventListener('scroll', handleScrollResize)\n }\n if (actualGlobalCloseEvents.resize) {\n window.removeEventListener('resize', handleScrollResize)\n } else {\n updateTooltipCleanup?.()\n }\n if (actualGlobalCloseEvents.clickOutsideAnchor) {\n window.removeEventListener('click', handleClickOutsideAnchors)\n }\n if (actualGlobalCloseEvents.escape) {\n window.removeEventListener('keydown', handleEsc)\n }\n if (clickable && !hasClickEvent) {\n tooltipRef.current?.removeEventListener('mouseenter', handleMouseEnterTooltip)\n tooltipRef.current?.removeEventListener('mouseleave', handleMouseLeaveTooltip)\n }\n enabledEvents.forEach(({ event, listener }) => {\n elementRefs.forEach((ref) => {\n ref.current?.removeEventListener(event, listener)\n })\n })\n }\n /**\n * rendered is also a dependency to ensure anchor observers are re-registered\n * since `tooltipRef` becomes stale after removing/adding the tooltip to the DOM\n */\n }, [\n activeAnchor,\n updateTooltipPosition,\n rendered,\n anchorRefs,\n anchorsBySelect,\n // the effect uses the `actual*Events` objects, but this should work\n openEvents,\n closeEvents,\n globalCloseEvents,\n shouldOpenOnClick,\n ])\n\n useEffect(() => {\n let selector = imperativeOptions?.anchorSelect ?? anchorSelect ?? ''\n if (!selector && id) {\n selector = `[data-tooltip-id='${id}']`\n }\n const documentObserverCallback: MutationCallback = (mutationList) => {\n const newAnchors: HTMLElement[] = []\n const removedAnchors: HTMLElement[] = []\n mutationList.forEach((mutation) => {\n if (mutation.type === 'attributes' && mutation.attributeName === 'data-tooltip-id') {\n const newId = (mutation.target as HTMLElement).getAttribute('data-tooltip-id')\n if (newId === id) {\n newAnchors.push(mutation.target as HTMLElement)\n }\n }\n if (mutation.type !== 'childList') {\n return\n }\n if (activeAnchor) {\n const elements = [...mutation.removedNodes].filter((node) => node.nodeType === 1)\n if (selector) {\n try {\n removedAnchors.push(\n // the element itself is an anchor\n ...(elements.filter((element) =>\n (element as HTMLElement).matches(selector),\n ) as HTMLElement[]),\n )\n removedAnchors.push(\n // the element has children which are anchors\n ...elements.flatMap(\n (element) =>\n [...(element as HTMLElement).querySelectorAll(selector)] as HTMLElement[],\n ),\n )\n } catch {\n /**\n * invalid CSS selector.\n * already warned on tooltip controller\n */\n }\n }\n elements.some((node) => {\n if (node?.contains?.(activeAnchor)) {\n setRendered(false)\n handleShow(false)\n setActiveAnchor(null)\n if (tooltipShowDelayTimerRef.current) {\n clearTimeout(tooltipShowDelayTimerRef.current)\n }\n if (tooltipHideDelayTimerRef.current) {\n clearTimeout(tooltipHideDelayTimerRef.current)\n }\n return true\n }\n return false\n })\n }\n if (!selector) {\n return\n }\n try {\n const elements = [...mutation.addedNodes].filter((node) => node.nodeType === 1)\n newAnchors.push(\n // the element itself is an anchor\n ...(elements.filter((element) =>\n (element as HTMLElement).matches(selector),\n ) as HTMLElement[]),\n )\n newAnchors.push(\n // the element has children which are anchors\n ...elements.flatMap(\n (element) =>\n [...(element as HTMLElement).querySelectorAll(selector)] as HTMLElement[],\n ),\n )\n } catch {\n /**\n * invalid CSS selector.\n * already warned on tooltip controller\n */\n }\n })\n if (newAnchors.length || removedAnchors.length) {\n setAnchorsBySelect((anchors) => [\n ...anchors.filter((anchor) => !removedAnchors.includes(anchor)),\n ...newAnchors,\n ])\n }\n }\n const documentObserver = new MutationObserver(documentObserverCallback)\n // watch for anchor being removed from the DOM\n documentObserver.observe(document.body, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['data-tooltip-id'],\n })\n return () => {\n documentObserver.disconnect()\n }\n }, [id, anchorSelect, imperativeOptions?.anchorSelect, activeAnchor])\n\n useEffect(() => {\n updateTooltipPosition()\n }, [updateTooltipPosition])\n\n useEffect(() => {\n if (!contentWrapperRef?.current) {\n return () => null\n }\n const contentObserver = new ResizeObserver(() => {\n updateTooltipPosition()\n })\n contentObserver.observe(contentWrapperRef.current)\n return () => {\n contentObserver.disconnect()\n }\n }, [content, contentWrapperRef?.current])\n\n useEffect(() => {\n const anchorById = document.querySelector<HTMLElement>(`[id='${anchorId}']`)\n const anchors = [...anchorsBySelect, anchorById]\n if (!activeAnchor || !anchors.includes(activeAnchor)) {\n /**\n * if there is no active anchor,\n * or if the current active anchor is not amongst the allowed ones,\n * reset it\n */\n setActiveAnchor(anchorsBySelect[0] ?? anchorById)\n }\n }, [anchorId, anchorsBySelect, activeAnchor])\n\n useEffect(() => {\n return () => {\n if (tooltipShowDelayTimerRef.current) {\n clearTimeout(tooltipShowDelayTimerRef.current)\n }\n if (tooltipHideDelayTimerRef.current) {\n clearTimeout(tooltipHideDelayTimerRef.current)\n }\n }\n }, [])\n\n useEffect(() => {\n let selector = imperativeOptions?.anchorSelect ?? anchorSelect\n if (!selector && id) {\n selector = `[data-tooltip-id='${id}']`\n }\n if (!selector) {\n return\n }\n try {\n const anchors = Array.from(document.querySelectorAll<HTMLElement>(selector))\n setAnchorsBySelect(anchors)\n } catch {\n // warning was already issued in the controller\n setAnchorsBySelect([])\n }\n }, [id, anchorSelect, imperativeOptions?.anchorSelect])\n\n const actualContent = imperativeOptions?.content ?? content\n const canShow = show && Object.keys(inlineStyles).length > 0\n\n useImperativeHandle(forwardRef, () => ({\n open: (options) => {\n if (options?.anchorSelect) {\n try {\n document.querySelector(options.anchorSelect)\n } catch {\n if (!process.env.NODE_ENV || process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(`[react-tooltip] \"${options.anchorSelect}\" is not a valid CSS selector`)\n }\n return\n }\n }\n setImperativeOptions(options ?? null)\n if (options?.delay) {\n handleShowTooltipDelayed(options.delay)\n } else {\n handleShow(true)\n }\n },\n close: (options) => {\n if (options?.delay) {\n handleHideTooltipDelayed(options.delay)\n } else {\n handleShow(false)\n }\n },\n activeAnchor,\n place: actualPlacement,\n isOpen: Boolean(rendered && !hidden && actualContent && canShow),\n }))\n\n return rendered && !hidden && actualContent ? (\n <WrapperElement\n id={id}\n role={role}\n className={classNames(\n 'react-tooltip',\n coreStyles['tooltip'],\n styles['tooltip'],\n styles[variant],\n className,\n `react-tooltip__place-${actualPlacement}`,\n coreStyles[canShow ? 'show' : 'closing'],\n canShow ? 'react-tooltip__show' : 'react-tooltip__closing',\n positionStrategy === 'fixed' && coreStyles['fixed'],\n clickable && coreStyles['clickable'],\n )}\n onTransitionEnd={(event: TransitionEvent) => {\n if (missedTransitionTimerRef.current) {\n clearTimeout(missedTransitionTimerRef.current)\n }\n if (show || event.propertyName !== 'opacity') {\n return\n }\n setRendered(false)\n setImperativeOptions(null)\n afterHide?.()\n }}\n style={{\n ...externalStyles,\n ...inlineStyles,\n opacity: opacity !== undefined && canShow ? opacity : undefined,\n }}\n ref={tooltipRef}\n >\n {actualContent}\n <WrapperElement\n className={classNames(\n 'react-tooltip-arrow',\n coreStyles['arrow'],\n styles['arrow'],\n classNameArrow,\n noArrow && coreStyles['noArrow'],\n )}\n style={{\n ...inlineArrowStyles,\n background: arrowColor\n ? `linear-gradient(to right bottom, transparent 50%, ${arrowColor} 50%)`\n : undefined,\n }}\n ref={tooltipArrowRef}\n />\n </WrapperElement>\n ) : null\n}\n\nexport default Tooltip\n","export const cssTimeToMs = (time: string): number => {\n const match = time.match(/^([\\d.]+)(m?s?)$/)\n if (!match) {\n return 0\n }\n const [, amount, unit] = match\n if (unit !== 's' && unit !== 'ms') {\n return 0\n }\n return Number(amount) * (unit === 'ms' ? 1 : 1000)\n}\n","/* eslint-disable react/no-danger */\nimport React from 'react'\nimport type { ITooltipContent } from './TooltipContentTypes'\n\nconst TooltipContent = ({ content }: ITooltipContent) => {\n return <span dangerouslySetInnerHTML={{ __html: content }} />\n}\n\nexport default TooltipContent\n","const cssSupports = (property: string, value: string): boolean => {\n const hasCssSupports = 'CSS' in window && 'supports' in window.CSS\n return hasCssSupports ? window.CSS.supports(property, value) : true\n}\n\nexport default cssSupports\n","import React, { useEffect, useRef, useState } from 'react'\nimport { Tooltip } from 'components/Tooltip'\nimport type {\n EventsType,\n PositionStrategy,\n PlacesType,\n VariantType,\n WrapperType,\n DataAttribute,\n ITooltip,\n ChildrenType,\n TooltipRefProps,\n} from 'components/Tooltip/TooltipTypes'\nimport { useTooltip } from 'components/TooltipProvider'\nimport { TooltipContent } from 'components/TooltipContent'\nimport cssSupports from 'utils/css-supports'\nimport classNames from 'classnames'\nimport type { ITooltipController } from './TooltipControllerTypes'\n\nconst TooltipController = React.forwardRef<TooltipRefProps, ITooltipController>(\n (\n {\n id,\n anchorId,\n anchorSelect,\n content,\n html,\n render,\n className,\n classNameArrow,\n variant = 'dark',\n place = 'top',\n offset = 10,\n wrapper = 'div',\n children = null,\n events = ['hover'],\n openOnClick = false,\n positionStrategy = 'absolute',\n middlewares,\n delayShow = 0,\n delayHide = 0,\n float = false,\n hidden = false,\n noArrow = false,\n clickable = false,\n closeOnEsc = false,\n closeOnScroll = false,\n closeOnResize = false,\n openEvents,\n closeEvents,\n globalCloseEvents,\n imperativeModeOnly = false,\n style,\n position,\n isOpen,\n disableStyleInjection = false,\n border,\n opacity,\n arrowColor,\n setIsOpen,\n afterShow,\n afterHide,\n role = 'tooltip',\n }: ITooltipController,\n ref,\n ) => {\n const [tooltipContent, setTooltipContent] = useState(content)\n const [tooltipHtml, setTooltipHtml] = useState(html)\n const [tooltipPlace, setTooltipPlace] = useState(place)\n const [tooltipVariant, setTooltipVariant] = useState(variant)\n const [tooltipOffset, setTooltipOffset] = useState(offset)\n const [tooltipDelayShow, setTooltipDelayShow] = useState(delayShow)\n const [tooltipDelayHide, setTooltipDelayHide] = useState(delayHide)\n const [tooltipFloat, setTooltipFloat] = useState(float)\n const [tooltipHidden, setTooltipHidden] = useState(hidden)\n const [tooltipWrapper, setTooltipWrapper] = useState<WrapperType>(wrapper)\n const [tooltipEvents, setTooltipEvents] = useState(events)\n const [tooltipPositionStrategy, setTooltipPositionStrategy] = useState(positionStrategy)\n const [tooltipClassName, setTooltipClassName] = useState<string | null>(null)\n const [activeAnchor, setActiveAnchor] = useState<HTMLElement | null>(null)\n const styleInjectionRef = useRef(disableStyleInjection)\n /**\n * @todo Remove this in a future version (provider/wrapper method is deprecated)\n */\n const { anchorRefs, activeAnchor: providerActiveAnchor } = useTooltip(id)\n\n const getDataAttributesFromAnchorElement = (elementReference: HTMLElement) => {\n const dataAttributes = elementReference?.getAttributeNames().reduce((acc, name) => {\n if (name.startsWith('data-tooltip-')) {\n const parsedAttribute = name.replace(/^data-tooltip-/, '') as DataAttribute\n acc[parsedAttribute] = elementReference?.getAttribute(name) ?? null\n }\n return acc\n }, {} as Record<DataAttribute, string | null>)\n\n return dataAttributes\n }\n\n const applyAllDataAttributesFromAnchorElement = (\n dataAttributes: Record<string, string | null>,\n ) => {\n const handleDataAttributes: Record<DataAttribute, (value: string | null) => void> = {\n place: (value) => {\n setTooltipPlace((value as PlacesType) ?? place)\n },\n content: (value) => {\n setTooltipContent(value ?? content)\n },\n html: (value) => {\n setTooltipHtml(value ?? html)\n },\n variant: (value) => {\n setTooltipVariant((value as VariantType) ?? variant)\n },\n offset: (value) => {\n setTooltipOffset(value === null ? offset : Number(value))\n },\n wrapper: (value) => {\n setTooltipWrapper((value as WrapperType) ?? wrapper)\n },\n events: (value) => {\n const parsed = value?.split(' ') as EventsType[]\n setTooltipEvents(parsed ?? events)\n },\n 'position-strategy': (value) => {\n setTooltipPositionStrategy((value as PositionStrategy) ?? positionStrategy)\n },\n 'delay-show': (value) => {\n setTooltipDelayShow(value === null ? delayShow : Number(value))\n },\n 'delay-hide': (value) => {\n setTooltipDelayHide(value === null ? delayHide : Number(value))\n },\n float: (value) => {\n setTooltipFloat(value === null ? float : value === 'true')\n },\n hidden: (value) => {\n setTooltipHidden(value === null ? hidden : value === 'true')\n },\n 'class-name': (value) => {\n setTooltipClassName(value)\n },\n }\n // reset unset data attributes to default values\n // without this, data attributes from the last active anchor will still be used\n Object.values(handleDataAttributes).forEach((handler) => handler(null))\n Object.entries(dataAttributes).forEach(([key, value]) => {\n handleDataAttributes[key as DataAttribute]?.(value)\n })\n }\n\n useEffect(() => {\n setTooltipContent(content)\n }, [content])\n\n useEffect(() => {\n setTooltipHtml(html)\n }, [html])\n\n useEffect(() => {\n setTooltipPlace(place)\n }, [place])\n\n useEffect(() => {\n setTooltipVariant(variant)\n }, [variant])\n\n useEffect(() => {\n setTooltipOffset(offset)\n }, [offset])\n\n useEffect(() => {\n setTooltipDelayShow(delayShow)\n }, [delayShow])\n\n useEffect(() => {\n setTooltipDelayHide(delayHide)\n }, [delayHide])\n\n useEffect(() => {\n setTooltipFloat(float)\n }, [float])\n\n useEffect(() => {\n setTooltipHidden(hidden)\n }, [hidden])\n\n useEffect(() => {\n setTooltipPositionStrategy(positionStrategy)\n }, [positionStrategy])\n\n useEffect(() => {\n if (styleInjectionRef.current === disableStyleInjection) {\n return\n }\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn('[react-tooltip] Do not change `disableStyleInjection` dynamically.')\n }\n }, [disableStyleInjection])\n\n useEffect(() => {\n if (typeof window !== 'undefined') {\n window.dispatchEvent(\n new CustomEvent('react-tooltip-inject-styles', {\n detail: {\n disableCore: disableStyleInjection === 'core',\n disableBase: disableStyleInjection,\n },\n }),\n )\n }\n }, [])\n\n useEffect(() => {\n const elementRefs = new Set(anchorRefs)\n\n let selector = anchorSelect\n if (!selector && id) {\n selector = `[data-tooltip-id='${id}']`\n }\n if (selector) {\n try {\n const anchorsBySelect = document.querySelectorAll<HTMLElement>(selector)\n anchorsBySelect.forEach((anchor) => {\n elementRefs.add({ current: anchor })\n })\n } catch {\n if (!process.env.NODE_ENV || process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(`[react-tooltip] \"${selector}\" is not a valid CSS selector`)\n }\n }\n }\n\n const anchorById = document.querySelector<HTMLElement>(`[id='${anchorId}']`)\n if (anchorById) {\n elementRefs.add({ current: anchorById })\n }\n\n if (!elementRefs.size) {\n return () => null\n }\n\n const anchorElement = activeAnchor ?? anchorById ?? providerActiveAnchor.current\n\n const observerCallback: MutationCallback = (mutationList) => {\n mutationList.forEach((mutation) => {\n if (\n !anchorElement ||\n mutation.type !== 'attributes' ||\n !mutation.attributeName?.startsWith('data-tooltip-')\n ) {\n return\n }\n // make sure to get all set attributes, since all unset attributes are reset\n const dataAttributes = getDataAttributesFromAnchorElement(anchorElement)\n applyAllDataAttributesFromAnchorElement(dataAttributes)\n })\n }\n\n // Create an observer instance linked to the callback function\n const observer = new MutationObserver(observerCallback)\n\n // do not check for subtree and childrens, we only want to know attribute changes\n // to stay watching `data-attributes-*` from anchor element\n const observerConfig = { attributes: true, childList: false, subtree: false }\n\n if (anchorElement) {\n const dataAttributes = getDataAttributesFromAnchorElement(anchorElement)\n applyAllDataAttributesFromAnchorElement(dataAttributes)\n // Start observing the target node for configured mutations\n observer.observe(anchorElement, observerConfig)\n }\n\n return () => {\n // Remove the observer when the tooltip is destroyed\n observer.disconnect()\n }\n }, [anchorRefs, providerActiveAnchor, activeAnchor, anchorId, anchorSelect])\n\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') {\n return\n }\n if (style?.border) {\n // eslint-disable-next-line no-console\n console.warn('[react-tooltip] Do not set `style.border`. Use `border` prop instead.')\n }\n if (border && !cssSupports('border', `${border}`)) {\n // eslint-disable-next-line no-console\n console.warn(`[react-tooltip] \"${border}\" is not a valid \\`border\\`.`)\n }\n if (style?.opacity) {\n // eslint-disable-next-line no-console\n console.warn('[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead.')\n }\n if (opacity && !cssSupports('opacity', `${opacity}`)) {\n // eslint-disable-next-line no-console\n console.warn(`[react-tooltip] \"${opacity}\" is not a valid \\`opacity\\`.`)\n }\n }, [])\n\n /**\n * content priority: children < render or content < html\n * children should be lower priority so that it can be used as the \"default\" content\n */\n let renderedContent: ChildrenType = children\n const contentWrapperRef = useRef<HTMLDivElement>(null)\n if (render) {\n const rendered = render({ content: tooltipContent ?? null, activeAnchor }) as React.ReactNode\n renderedContent = rendered ? (\n <div ref={contentWrapperRef} className=\"react-tooltip-content-wrapper\">\n {rendered}\n </div>\n ) : null\n } else if (tooltipContent) {\n renderedContent = tooltipContent\n }\n if (tooltipHtml) {\n renderedContent = <TooltipContent content={tooltipHtml} />\n }\n\n const props: ITooltip = {\n forwardRef: ref,\n id,\n anchorId,\n anchorSelect,\n className: classNames(className, tooltipClassName),\n classNameArrow,\n content: renderedContent,\n contentWrapperRef,\n place: tooltipPlace,\n variant: tooltipVariant,\n offset: tooltipOffset,\n wrapper: tooltipWrapper,\n events: tooltipEvents,\n openOnClick,\n positionStrategy: tooltipPositionStrategy,\n middlewares,\n delayShow: tooltipDelayShow,\n delayHide: tooltipDelayHide,\n float: tooltipFloat,\n hidden: tooltipHidden,\n noArrow,\n clickable,\n closeOnEsc,\n closeOnScroll,\n closeOnResize,\n openEvents,\n closeEvents,\n globalCloseEvents,\n imperativeModeOnly,\n style,\n position,\n isOpen,\n border,\n opacity,\n arrowColor,\n setIsOpen,\n afterShow,\n afterHide,\n activeAnchor,\n setActiveAnchor: (anchor: HTMLElement | null) => setActiveAnchor(anchor),\n role,\n }\n\n return <Tooltip {...props} />\n },\n)\n\nexport default TooltipController\n","import './tokens.css'\n\nimport { injectStyle } from 'utils/handle-style'\n\nimport type {\n ChildrenType,\n DataAttribute,\n EventsType,\n PlacesType,\n PositionStrategy,\n VariantType,\n WrapperType,\n IPosition,\n Middleware,\n TooltipRefProps,\n} from './components/Tooltip/TooltipTypes'\nimport type { ITooltipController } from './components/TooltipController/TooltipControllerTypes'\nimport type { ITooltipWrapper } from './components/TooltipProvider/TooltipProviderTypes'\n\n// those content will be replaced in build time with the `react-tooltip.css` builded content\nconst TooltipCoreStyles = 'react-tooltip-core-css-placeholder'\nconst TooltipStyles = 'react-tooltip-css-placeholder'\n\nif (typeof window !== 'undefined') {\n window.addEventListener('react-tooltip-inject-styles', ((\n event: CustomEvent<{ disableCore: boolean; disableBase: boolean }>,\n ) => {\n if (!event.detail.disableCore) {\n injectStyle({ css: TooltipCoreStyles, type: 'core' })\n }\n if (!event.detail.disableBase) {\n injectStyle({ css: TooltipStyles, type: 'base' })\n }\n }) as EventListener)\n}\n\nexport { TooltipController as Tooltip } from './components/TooltipController'\nexport { TooltipProvider, TooltipWrapper } from './components/TooltipProvider'\nexport type {\n ChildrenType,\n DataAttribute,\n EventsType,\n PlacesType,\n PositionStrategy,\n VariantType,\n WrapperType,\n ITooltipController as ITooltip,\n ITooltipWrapper,\n IPosition,\n Middleware,\n TooltipRefProps,\n}\n\nexport { removeStyle } from './utils/handle-style'\n"],"names":["REACT_TOOLTIP_CORE_STYLES_ID","REACT_TOOLTIP_BASE_STYLES_ID","injected","core","base","injectStyle","css","id","type","ref","document","process","_a","env","REACT_TOOLTIP_DISABLE_CORE_STYLES","_b","REACT_TOOLTIP_DISABLE_BASE_STYLES","insertAt","getElementById","console","warn","head","getElementsByTagName","style","createElement","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","debounce","func","wait","immediate","timeout","args","later","apply","this","setTimeout","clearTimeout","DEFAULT_TOOLTIP_ID","DEFAULT_CONTEXT_DATA","anchorRefs","Set","activeAnchor","current","attach","detach","setActiveAnchor","DEFAULT_CONTEXT_DATA_WRAPPER","getTooltipData","TooltipContext","createContext","useTooltip","tooltipId","useContext","useIsomorphicLayoutEffect","window","useLayoutEffect","useEffect","isScrollable","node","HTMLElement","SVGElement","getComputedStyle","some","propertyName","value","getPropertyValue","getScrollParent","currentParent","parentElement","scrollingElement","documentElement","computeTooltipPosition","async","elementReference","tooltipReference","tooltipArrowReference","place","offset","offsetValue","strategy","middlewares","Number","flip","shift","padding","border","tooltipStyles","tooltipArrowStyles","middleware","push","arrow","element","computePosition","placement","then","x","y","middlewareData","styles","left","top","arrowX","arrowY","staticSide","right","bottom","split","borderSide","borderBottom","borderRight","borderWidth","match","Tooltip","forwardRef","className","classNameArrow","variant","anchorId","anchorSelect","events","openOnClick","positionStrategy","wrapper","WrapperElement","delayShow","delayHide","float","hidden","noArrow","clickable","closeOnEsc","closeOnScroll","closeOnResize","openEvents","closeEvents","globalCloseEvents","imperativeModeOnly","externalStyles","position","afterShow","afterHide","content","contentWrapperRef","isOpen","setIsOpen","opacity","arrowColor","role","tooltipRef","useRef","tooltipArrowRef","tooltipShowDelayTimerRef","tooltipHideDelayTimerRef","missedTransitionTimerRef","actualPlacement","setActualPlacement","useState","inlineStyles","setInlineStyles","inlineArrowStyles","setInlineArrowStyles","show","setShow","rendered","setRendered","imperativeOptions","setImperativeOptions","wasShowing","lastFloatPosition","setProviderActiveAnchor","hoveringTooltip","anchorsBySelect","setAnchorsBySelect","mounted","shouldOpenOnClick","includes","hasClickEvent","click","dblclick","mousedown","actualOpenEvents","mouseenter","focus","Object","assign","actualCloseEvents","mouseleave","blur","mouseup","actualGlobalCloseEvents","escape","scroll","resize","clickOutsideAnchor","handleShow","undefined","transitionShowDelay","time","amount","unit","cssTimeToMs","body","handleShowTooltipDelayed","delay","handleHideTooltipDelayed","handleShowTooltip","event","target","currentTarget","isConnected","handleHideTooltip","handleTooltipPosition","virtualElement","getBoundingClientRect","width","height","computedStylesData","keys","length","handleMouseMove","mouseEvent","mousePosition","clientX","clientY","handleClickOutsideAnchors","contains","querySelector","anchor","debouncedHandleShowTooltip","debouncedHandleHideTooltip","updateTooltipPosition","useCallback","actualPosition","elementRefs","forEach","add","anchorById","handleScrollResize","anchorScrollParent","tooltipScrollParent","addEventListener","updateTooltipCleanup","autoUpdate","ancestorResize","elementResize","layoutShift","handleEsc","key","enabledEvents","handleClickOpenTooltipAnchor","handleClickCloseTooltipAnchor","regularEvents","clickEvents","entries","enabled","listener","handleMouseEnterTooltip","handleMouseLeaveTooltip","removeEventListener","selector","documentObserver","MutationObserver","mutationList","newAnchors","removedAnchors","mutation","attributeName","getAttribute","elements","removedNodes","filter","nodeType","matches","flatMap","querySelectorAll","call","addedNodes","anchors","observe","childList","subtree","attributes","attributeFilter","disconnect","contentObserver","ResizeObserver","Array","from","actualContent","canShow","useImperativeHandle","open","options","close","Boolean","React","classNames","coreStyles","onTransitionEnd","background","TooltipContent","dangerouslySetInnerHTML","__html","cssSupports","property","CSS","supports","TooltipController","html","render","children","disableStyleInjection","tooltipContent","setTooltipContent","tooltipHtml","setTooltipHtml","tooltipPlace","setTooltipPlace","tooltipVariant","setTooltipVariant","tooltipOffset","setTooltipOffset","tooltipDelayShow","setTooltipDelayShow","tooltipDelayHide","setTooltipDelayHide","tooltipFloat","setTooltipFloat","tooltipHidden","setTooltipHidden","tooltipWrapper","setTooltipWrapper","tooltipEvents","setTooltipEvents","tooltipPositionStrategy","setTooltipPositionStrategy","tooltipClassName","setTooltipClassName","styleInjectionRef","providerActiveAnchor","getDataAttributesFromAnchorElement","getAttributeNames","reduce","acc","name","startsWith","replace","applyAllDataAttributesFromAnchorElement","dataAttributes","handleDataAttributes","parsed","values","handler","dispatchEvent","CustomEvent","detail","disableCore","disableBase","size","anchorElement","observer","observerConfig","renderedContent","props","anchorRefMap","setAnchorRefMap","activeAnchorMap","setActiveAnchorMap","refs","oldMap","tooltipRefs","delete","context","useMemo","Provider","anchorRef","tagName","remove"],"mappings":";;;;;;oeACA,MAAMA,EAA+B,4BAE/BC,EAA+B,4BAE/BC,EAAW,CACfC,MAAM,EACNC,MAAM,GAGR,SAASC,GAAYC,IACnBA,EAAGC,GACHA,EAAKN,EAA4BO,KACjCA,EAAO,OAAMC,IACbA,YAQA,IAAKH,GAA2B,oBAAbI,UAA4BR,EAASM,GACtD,OAGF,GACW,SAATA,GACmB,oBAAZG,UACK,QAAZC,E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EAASM,IAAQ,CACnB"}
|
|
1
|
+
{"version":3,"file":"react-tooltip.umd.min.js","sources":["../src/utils/handle-style.ts","../src/utils/debounce.ts","../src/components/TooltipProvider/TooltipProvider.tsx","../src/components/TooltipProvider/TooltipWrapper.tsx","../src/utils/use-isomorphic-layout-effect.ts","../src/utils/get-scroll-parent.ts","../src/utils/compute-positions.ts","../src/components/Tooltip/Tooltip.tsx","../src/utils/css-time-to-ms.ts","../src/components/TooltipContent/TooltipContent.tsx","../src/utils/css-supports.ts","../src/components/TooltipController/TooltipController.tsx","../src/index.tsx"],"sourcesContent":["// This is the ID for the core styles of ReactTooltip\nconst REACT_TOOLTIP_CORE_STYLES_ID = 'react-tooltip-core-styles'\n// This is the ID for the visual styles of ReactTooltip\nconst REACT_TOOLTIP_BASE_STYLES_ID = 'react-tooltip-base-styles'\n\nconst injected = {\n core: false,\n base: false,\n}\n\nfunction injectStyle({\n css,\n id = REACT_TOOLTIP_BASE_STYLES_ID,\n type = 'base',\n ref,\n}: {\n css: string\n id?: string\n type?: 'core' | 'base'\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref?: any\n}) {\n if (!css || typeof document === 'undefined' || injected[type]) {\n return\n }\n\n if (\n type === 'core' &&\n typeof process !== 'undefined' && // this validation prevents docs from breaking even with `process?`\n process?.env?.REACT_TOOLTIP_DISABLE_CORE_STYLES\n ) {\n return\n }\n\n if (\n type !== 'base' &&\n typeof process !== 'undefined' && // this validation prevents docs from breaking even with `process?`\n process?.env?.REACT_TOOLTIP_DISABLE_BASE_STYLES\n ) {\n return\n }\n\n if (type === 'core') {\n // eslint-disable-next-line no-param-reassign\n id = REACT_TOOLTIP_CORE_STYLES_ID\n }\n\n if (!ref) {\n // eslint-disable-next-line no-param-reassign\n ref = {}\n }\n const { insertAt } = ref\n\n if (document.getElementById(id)) {\n // this should never happen because of `injected[type]`\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(\n `[react-tooltip] Element with id '${id}' already exists. Call \\`removeStyle()\\` first`,\n )\n }\n return\n }\n\n const head = document.head || document.getElementsByTagName('head')[0]\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const style: any = document.createElement('style')\n style.id = id\n style.type = 'text/css'\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n\n injected[type] = true\n}\n\n/**\n * @deprecated Use the `disableStyleInjection` tooltip prop instead.\n * See https://react-tooltip.com/docs/examples/styling#disabling-reacttooltip-css\n */\nfunction removeStyle({\n type = 'base',\n id = REACT_TOOLTIP_BASE_STYLES_ID,\n}: {\n type?: 'core' | 'base'\n id?: string\n} = {}) {\n if (!injected[type]) {\n return\n }\n\n if (type === 'core') {\n // eslint-disable-next-line no-param-reassign\n id = REACT_TOOLTIP_CORE_STYLES_ID\n }\n\n const style = document.getElementById(id)\n if (style?.tagName === 'style') {\n style?.remove()\n } else if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(\n `[react-tooltip] Failed to remove 'style' element with id '${id}'. Call \\`injectStyle()\\` first`,\n )\n }\n\n injected[type] = false\n}\n\nexport { injectStyle, removeStyle }\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * This function debounce the received function\n * @param { function } \tfunc\t\t\t\tFunction to be debounced\n * @param { number } \t\twait\t\t\t\tTime to wait before execut the function\n * @param { boolean } \timmediate\t\tParam to define if the function will be executed immediately\n */\nconst debounce = (func: (...args: any[]) => void, wait?: number, immediate?: boolean) => {\n let timeout: NodeJS.Timeout | null = null\n\n return function debounced(this: typeof func, ...args: any[]) {\n const later = () => {\n timeout = null\n if (!immediate) {\n func.apply(this, args)\n }\n }\n\n if (immediate && !timeout) {\n /**\n * there's not need to clear the timeout\n * since we expect it to resolve and set `timeout = null`\n */\n func.apply(this, args)\n timeout = setTimeout(later, wait)\n }\n\n if (!immediate) {\n if (timeout) {\n clearTimeout(timeout)\n }\n timeout = setTimeout(later, wait)\n }\n }\n}\n\nexport default debounce\n","import React, {\n createContext,\n PropsWithChildren,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from 'react'\n\nimport type {\n AnchorRef,\n TooltipContextData,\n TooltipContextDataWrapper,\n} from './TooltipProviderTypes'\n\nconst DEFAULT_TOOLTIP_ID = 'DEFAULT_TOOLTIP_ID'\nconst DEFAULT_CONTEXT_DATA: TooltipContextData = {\n anchorRefs: new Set(),\n activeAnchor: { current: null },\n attach: () => {\n /* attach anchor element */\n },\n detach: () => {\n /* detach anchor element */\n },\n setActiveAnchor: () => {\n /* set active anchor */\n },\n}\n\nconst DEFAULT_CONTEXT_DATA_WRAPPER: TooltipContextDataWrapper = {\n getTooltipData: () => DEFAULT_CONTEXT_DATA,\n}\n\nconst TooltipContext = createContext<TooltipContextDataWrapper>(DEFAULT_CONTEXT_DATA_WRAPPER)\n\n/**\n * @deprecated Use the `data-tooltip-id` attribute, or the `anchorSelect` prop instead.\n * See https://react-tooltip.com/docs/getting-started\n */\nconst TooltipProvider: React.FC<PropsWithChildren<void>> = ({ children }) => {\n const [anchorRefMap, setAnchorRefMap] = useState<Record<string, Set<AnchorRef>>>({\n [DEFAULT_TOOLTIP_ID]: new Set(),\n })\n const [activeAnchorMap, setActiveAnchorMap] = useState<Record<string, AnchorRef>>({\n [DEFAULT_TOOLTIP_ID]: { current: null },\n })\n\n const attach = (tooltipId: string, ...refs: AnchorRef[]) => {\n setAnchorRefMap((oldMap) => {\n const tooltipRefs = oldMap[tooltipId] ?? new Set()\n refs.forEach((ref) => tooltipRefs.add(ref))\n // create new object to trigger re-render\n return { ...oldMap, [tooltipId]: new Set(tooltipRefs) }\n })\n }\n\n const detach = (tooltipId: string, ...refs: AnchorRef[]) => {\n setAnchorRefMap((oldMap) => {\n const tooltipRefs = oldMap[tooltipId]\n if (!tooltipRefs) {\n // tooltip not found\n // maybe thow error?\n return oldMap\n }\n refs.forEach((ref) => tooltipRefs.delete(ref))\n // create new object to trigger re-render\n return { ...oldMap }\n })\n }\n\n const setActiveAnchor = (tooltipId: string, ref: React.RefObject<HTMLElement>) => {\n setActiveAnchorMap((oldMap) => {\n if (oldMap[tooltipId]?.current === ref.current) {\n return oldMap\n }\n // create new object to trigger re-render\n return { ...oldMap, [tooltipId]: ref }\n })\n }\n\n const getTooltipData = useCallback(\n (tooltipId = DEFAULT_TOOLTIP_ID) => ({\n anchorRefs: anchorRefMap[tooltipId] ?? new Set(),\n activeAnchor: activeAnchorMap[tooltipId] ?? { current: null },\n attach: (...refs: AnchorRef[]) => attach(tooltipId, ...refs),\n detach: (...refs: AnchorRef[]) => detach(tooltipId, ...refs),\n setActiveAnchor: (ref: AnchorRef) => setActiveAnchor(tooltipId, ref),\n }),\n [anchorRefMap, activeAnchorMap, attach, detach],\n )\n\n const context = useMemo(() => {\n return {\n getTooltipData,\n }\n }, [getTooltipData])\n\n return <TooltipContext.Provider value={context}>{children}</TooltipContext.Provider>\n}\n\nexport function useTooltip(tooltipId = DEFAULT_TOOLTIP_ID) {\n return useContext(TooltipContext).getTooltipData(tooltipId)\n}\n\nexport default TooltipProvider\n","import React, { useEffect, useRef } from 'react'\nimport classNames from 'classnames'\nimport { useTooltip } from './TooltipProvider'\nimport type { ITooltipWrapper } from './TooltipProviderTypes'\n\n/**\n * @deprecated Use the `data-tooltip-id` attribute, or the `anchorSelect` prop instead.\n * See https://react-tooltip.com/docs/getting-started\n */\nconst TooltipWrapper = ({\n tooltipId,\n children,\n className,\n place,\n content,\n html,\n variant,\n offset,\n wrapper,\n events,\n positionStrategy,\n delayShow,\n delayHide,\n}: ITooltipWrapper) => {\n const { attach, detach } = useTooltip(tooltipId)\n const anchorRef = useRef<HTMLElement | null>(null)\n\n useEffect(() => {\n attach(anchorRef)\n return () => {\n detach(anchorRef)\n }\n }, [])\n\n return (\n <span\n ref={anchorRef}\n className={classNames('react-tooltip-wrapper', className)}\n data-tooltip-place={place}\n data-tooltip-content={content}\n data-tooltip-html={html}\n data-tooltip-variant={variant}\n data-tooltip-offset={offset}\n data-tooltip-wrapper={wrapper}\n data-tooltip-events={events}\n data-tooltip-position-strategy={positionStrategy}\n data-tooltip-delay-show={delayShow}\n data-tooltip-delay-hide={delayHide}\n >\n {children}\n </span>\n )\n}\n\nexport default TooltipWrapper\n","import { useLayoutEffect, useEffect } from 'react'\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect\n\nexport default useIsomorphicLayoutEffect\n","const isScrollable = (node: Element) => {\n if (!(node instanceof HTMLElement || node instanceof SVGElement)) {\n return false\n }\n const style = getComputedStyle(node)\n return ['overflow', 'overflow-x', 'overflow-y'].some((propertyName) => {\n const value = style.getPropertyValue(propertyName)\n return value === 'auto' || value === 'scroll'\n })\n}\n\nexport const getScrollParent = (node: Element | null) => {\n if (!node) {\n return null\n }\n let currentParent = node.parentElement\n while (currentParent) {\n if (isScrollable(currentParent)) {\n return currentParent\n }\n currentParent = currentParent.parentElement\n }\n return document.scrollingElement || document.documentElement\n}\n","import { computePosition, offset, shift, arrow, flip } from '@floating-ui/dom'\nimport type { IComputePositions } from './compute-positions-types'\n\nexport const computeTooltipPosition = async ({\n elementReference = null,\n tooltipReference = null,\n tooltipArrowReference = null,\n place = 'top',\n offset: offsetValue = 10,\n strategy = 'absolute',\n middlewares = [\n offset(Number(offsetValue)),\n flip({\n fallbackAxisSideDirection: 'start',\n }),\n shift({ padding: 5 }),\n ],\n border,\n}: IComputePositions) => {\n if (!elementReference) {\n // elementReference can be null or undefined and we will not compute the position\n // eslint-disable-next-line no-console\n // console.error('The reference element for tooltip was not defined: ', elementReference)\n return { tooltipStyles: {}, tooltipArrowStyles: {}, place }\n }\n\n if (tooltipReference === null) {\n return { tooltipStyles: {}, tooltipArrowStyles: {}, place }\n }\n\n const middleware = middlewares\n\n if (tooltipArrowReference) {\n middleware.push(arrow({ element: tooltipArrowReference as HTMLElement, padding: 5 }))\n\n return computePosition(elementReference as HTMLElement, tooltipReference as HTMLElement, {\n placement: place,\n strategy,\n middleware,\n }).then(({ x, y, placement, middlewareData }) => {\n const styles = { left: `${x}px`, top: `${y}px`, border }\n\n const { x: arrowX, y: arrowY } = middlewareData.arrow ?? { x: 0, y: 0 }\n\n const staticSide =\n {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }[placement.split('-')[0]] ?? 'bottom'\n\n const borderSide = border && {\n borderBottom: border,\n borderRight: border,\n }\n\n let borderWidth = 0\n if (border) {\n const match = `${border}`.match(/(\\d+)px/)\n if (match?.[1]) {\n borderWidth = Number(match[1])\n } else {\n /**\n * this means `border` was set without `width`, or non-px value\n */\n borderWidth = 1\n }\n }\n\n const arrowStyle = {\n left: arrowX != null ? `${arrowX}px` : '',\n top: arrowY != null ? `${arrowY}px` : '',\n right: '',\n bottom: '',\n ...borderSide,\n [staticSide]: `-${4 + borderWidth}px`,\n }\n\n return { tooltipStyles: styles, tooltipArrowStyles: arrowStyle, place: placement }\n })\n }\n\n return computePosition(elementReference as HTMLElement, tooltipReference as HTMLElement, {\n placement: 'bottom',\n strategy,\n middleware,\n }).then(({ x, y, placement }) => {\n const styles = { left: `${x}px`, top: `${y}px` }\n\n return { tooltipStyles: styles, tooltipArrowStyles: {}, place: placement }\n })\n}\n","import React, { useEffect, useState, useRef, useCallback, useImperativeHandle } from 'react'\nimport { autoUpdate } from '@floating-ui/dom'\nimport classNames from 'classnames'\nimport debounce from 'utils/debounce'\nimport { useTooltip } from 'components/TooltipProvider'\nimport useIsomorphicLayoutEffect from 'utils/use-isomorphic-layout-effect'\nimport { getScrollParent } from 'utils/get-scroll-parent'\nimport { computeTooltipPosition } from 'utils/compute-positions'\nimport { cssTimeToMs } from 'utils/css-time-to-ms'\nimport coreStyles from './core-styles.module.css'\nimport styles from './styles.module.css'\nimport type {\n AnchorCloseEvents,\n AnchorOpenEvents,\n GlobalCloseEvents,\n IPosition,\n ITooltip,\n PlacesType,\n TooltipImperativeOpenOptions,\n} from './TooltipTypes'\n\nconst Tooltip = ({\n // props\n forwardRef,\n id,\n className,\n classNameArrow,\n variant = 'dark',\n anchorId,\n anchorSelect,\n place = 'top',\n offset = 10,\n events = ['hover'],\n openOnClick = false,\n positionStrategy = 'absolute',\n middlewares,\n wrapper: WrapperElement,\n delayShow = 0,\n delayHide = 0,\n float = false,\n hidden = false,\n noArrow = false,\n clickable = false,\n closeOnEsc = false,\n closeOnScroll = false,\n closeOnResize = false,\n openEvents,\n closeEvents,\n globalCloseEvents,\n imperativeModeOnly,\n style: externalStyles,\n position,\n afterShow,\n afterHide,\n // props handled by controller\n content,\n contentWrapperRef,\n isOpen,\n setIsOpen,\n activeAnchor,\n setActiveAnchor,\n border,\n opacity,\n arrowColor,\n role = 'tooltip',\n}: ITooltip) => {\n const tooltipRef = useRef<HTMLElement>(null)\n const tooltipArrowRef = useRef<HTMLElement>(null)\n const tooltipShowDelayTimerRef = useRef<NodeJS.Timeout | null>(null)\n const tooltipHideDelayTimerRef = useRef<NodeJS.Timeout | null>(null)\n const missedTransitionTimerRef = useRef<NodeJS.Timeout | null>(null)\n const [actualPlacement, setActualPlacement] = useState(place)\n const [inlineStyles, setInlineStyles] = useState({})\n const [inlineArrowStyles, setInlineArrowStyles] = useState({})\n const [show, setShow] = useState(false)\n const [rendered, setRendered] = useState(false)\n const [imperativeOptions, setImperativeOptions] = useState<TooltipImperativeOpenOptions | null>(\n null,\n )\n const wasShowing = useRef(false)\n const lastFloatPosition = useRef<IPosition | null>(null)\n /**\n * @todo Remove this in a future version (provider/wrapper method is deprecated)\n */\n const { anchorRefs, setActiveAnchor: setProviderActiveAnchor } = useTooltip(id)\n const hoveringTooltip = useRef(false)\n const [anchorsBySelect, setAnchorsBySelect] = useState<HTMLElement[]>([])\n const mounted = useRef(false)\n\n /**\n * @todo Update when deprecated stuff gets removed.\n */\n const shouldOpenOnClick = openOnClick || events.includes('click')\n const hasClickEvent =\n shouldOpenOnClick || openEvents?.click || openEvents?.dblclick || openEvents?.mousedown\n const actualOpenEvents: AnchorOpenEvents = openEvents\n ? { ...openEvents }\n : {\n mouseenter: true,\n focus: true,\n click: false,\n dblclick: false,\n mousedown: false,\n }\n if (!openEvents && shouldOpenOnClick) {\n Object.assign(actualOpenEvents, {\n mouseenter: false,\n focus: false,\n click: true,\n })\n }\n const actualCloseEvents: AnchorCloseEvents = closeEvents\n ? { ...closeEvents }\n : {\n mouseleave: true,\n blur: true,\n click: false,\n dblclick: false,\n mouseup: false,\n }\n if (!closeEvents && shouldOpenOnClick) {\n Object.assign(actualCloseEvents, {\n mouseleave: false,\n blur: false,\n })\n }\n const actualGlobalCloseEvents: GlobalCloseEvents = globalCloseEvents\n ? { ...globalCloseEvents }\n : {\n escape: closeOnEsc || false,\n scroll: closeOnScroll || false,\n resize: closeOnResize || false,\n clickOutsideAnchor: hasClickEvent || false,\n }\n\n if (imperativeModeOnly) {\n Object.assign(actualOpenEvents, {\n mouseenter: false,\n focus: false,\n click: false,\n dblclick: false,\n mousedown: false,\n })\n Object.assign(actualCloseEvents, {\n mouseleave: false,\n blur: false,\n click: false,\n dblclick: false,\n mouseup: false,\n })\n Object.assign(actualGlobalCloseEvents, {\n escape: false,\n scroll: false,\n resize: false,\n clickOutsideAnchor: false,\n })\n }\n\n /**\n * useLayoutEffect runs before useEffect,\n * but should be used carefully because of caveats\n * https://beta.reactjs.org/reference/react/useLayoutEffect#caveats\n */\n useIsomorphicLayoutEffect(() => {\n mounted.current = true\n return () => {\n mounted.current = false\n }\n }, [])\n\n const handleShow = (value: boolean) => {\n if (!mounted.current) {\n return\n }\n if (value) {\n setRendered(true)\n }\n /**\n * wait for the component to render and calculate position\n * before actually showing\n */\n setTimeout(() => {\n if (!mounted.current) {\n return\n }\n setIsOpen?.(value)\n if (isOpen === undefined) {\n setShow(value)\n }\n }, 10)\n }\n\n /**\n * this replicates the effect from `handleShow()`\n * when `isOpen` is changed from outside\n */\n useEffect(() => {\n if (isOpen === undefined) {\n return () => null\n }\n if (isOpen) {\n setRendered(true)\n }\n const timeout = setTimeout(() => {\n setShow(isOpen)\n }, 10)\n return () => {\n clearTimeout(timeout)\n }\n }, [isOpen])\n\n useEffect(() => {\n if (show === wasShowing.current) {\n return\n }\n if (missedTransitionTimerRef.current) {\n clearTimeout(missedTransitionTimerRef.current)\n }\n wasShowing.current = show\n if (show) {\n afterShow?.()\n } else {\n /**\n * see `onTransitionEnd` on tooltip wrapper\n */\n const style = getComputedStyle(document.body)\n const transitionShowDelay = cssTimeToMs(style.getPropertyValue('--rt-transition-show-delay'))\n missedTransitionTimerRef.current = setTimeout(() => {\n /**\n * if the tooltip switches from `show === true` to `show === false` too fast\n * the transition never runs, so `onTransitionEnd` callback never gets fired\n */\n setRendered(false)\n setImperativeOptions(null)\n afterHide?.()\n // +25ms just to make sure `onTransitionEnd` (if it gets fired) has time to run\n }, transitionShowDelay + 25)\n }\n }, [show])\n\n const handleShowTooltipDelayed = (delay = delayShow) => {\n if (tooltipShowDelayTimerRef.current) {\n clearTimeout(tooltipShowDelayTimerRef.current)\n }\n\n tooltipShowDelayTimerRef.current = setTimeout(() => {\n handleShow(true)\n }, delay)\n }\n\n const handleHideTooltipDelayed = (delay = delayHide) => {\n if (tooltipHideDelayTimerRef.current) {\n clearTimeout(tooltipHideDelayTimerRef.current)\n }\n\n tooltipHideDelayTimerRef.current = setTimeout(() => {\n if (hoveringTooltip.current) {\n return\n }\n handleShow(false)\n }, delay)\n }\n\n const handleShowTooltip = (event?: Event) => {\n if (!event) {\n return\n }\n const target = (event.currentTarget ?? event.target) as HTMLElement | null\n if (!target?.isConnected) {\n /**\n * this happens when the target is removed from the DOM\n * at the same time the tooltip gets triggered\n */\n setActiveAnchor(null)\n setProviderActiveAnchor({ current: null })\n return\n }\n if (delayShow) {\n handleShowTooltipDelayed()\n } else {\n handleShow(true)\n }\n setActiveAnchor(target)\n setProviderActiveAnchor({ current: target })\n\n if (tooltipHideDelayTimerRef.current) {\n clearTimeout(tooltipHideDelayTimerRef.current)\n }\n }\n\n const handleHideTooltip = () => {\n if (clickable) {\n // allow time for the mouse to reach the tooltip, in case there's a gap\n handleHideTooltipDelayed(delayHide || 100)\n } else if (delayHide) {\n handleHideTooltipDelayed()\n } else {\n handleShow(false)\n }\n\n if (tooltipShowDelayTimerRef.current) {\n clearTimeout(tooltipShowDelayTimerRef.current)\n }\n }\n\n const handleTooltipPosition = ({ x, y }: IPosition) => {\n const virtualElement = {\n getBoundingClientRect() {\n return {\n x,\n y,\n width: 0,\n height: 0,\n top: y,\n left: x,\n right: x,\n bottom: y,\n }\n },\n } as Element\n computeTooltipPosition({\n place: imperativeOptions?.place ?? place,\n offset,\n elementReference: virtualElement,\n tooltipReference: tooltipRef.current,\n tooltipArrowReference: tooltipArrowRef.current,\n strategy: positionStrategy,\n middlewares,\n border,\n }).then((computedStylesData) => {\n if (Object.keys(computedStylesData.tooltipStyles).length) {\n setInlineStyles(computedStylesData.tooltipStyles)\n }\n if (Object.keys(computedStylesData.tooltipArrowStyles).length) {\n setInlineArrowStyles(computedStylesData.tooltipArrowStyles)\n }\n setActualPlacement(computedStylesData.place as PlacesType)\n })\n }\n\n const handleMouseMove = (event?: Event) => {\n if (!event) {\n return\n }\n const mouseEvent = event as MouseEvent\n const mousePosition = {\n x: mouseEvent.clientX,\n y: mouseEvent.clientY,\n }\n handleTooltipPosition(mousePosition)\n lastFloatPosition.current = mousePosition\n }\n\n const handleClickOutsideAnchors = (event: MouseEvent) => {\n if (!show) {\n return\n }\n const target = event.target as HTMLElement\n if (tooltipRef.current?.contains(target)) {\n return\n }\n const anchorById = document.querySelector<HTMLElement>(`[id='${anchorId}']`)\n const anchors = [anchorById, ...anchorsBySelect]\n if (anchors.some((anchor) => anchor?.contains(target))) {\n return\n }\n handleShow(false)\n if (tooltipShowDelayTimerRef.current) {\n clearTimeout(tooltipShowDelayTimerRef.current)\n }\n }\n\n // debounce handler to prevent call twice when\n // mouse enter and focus events being triggered toggether\n const debouncedHandleShowTooltip = debounce(handleShowTooltip, 50, true)\n const debouncedHandleHideTooltip = debounce(handleHideTooltip, 50, true)\n const updateTooltipPosition = useCallback(() => {\n const actualPosition = imperativeOptions?.position ?? position\n if (actualPosition) {\n // if `position` is set, override regular and `float` positioning\n handleTooltipPosition(actualPosition)\n return\n }\n\n if (float) {\n if (lastFloatPosition.current) {\n /*\n Without this, changes to `content`, `place`, `offset`, ..., will only\n trigger a position calculation after a `mousemove` event.\n\n To see why this matters, comment this line, run `yarn dev` and click the\n \"Hover me!\" anchor.\n */\n handleTooltipPosition(lastFloatPosition.current)\n }\n // if `float` is set, override regular positioning\n return\n }\n\n if (!activeAnchor?.isConnected) {\n return\n }\n\n computeTooltipPosition({\n place: imperativeOptions?.place ?? place,\n offset,\n elementReference: activeAnchor,\n tooltipReference: tooltipRef.current,\n tooltipArrowReference: tooltipArrowRef.current,\n strategy: positionStrategy,\n middlewares,\n border,\n }).then((computedStylesData) => {\n if (!mounted.current) {\n // invalidate computed positions after remount\n return\n }\n if (Object.keys(computedStylesData.tooltipStyles).length) {\n setInlineStyles(computedStylesData.tooltipStyles)\n }\n if (Object.keys(computedStylesData.tooltipArrowStyles).length) {\n setInlineArrowStyles(computedStylesData.tooltipArrowStyles)\n }\n setActualPlacement(computedStylesData.place as PlacesType)\n })\n }, [\n show,\n activeAnchor,\n content,\n externalStyles,\n place,\n imperativeOptions?.place,\n offset,\n positionStrategy,\n position,\n imperativeOptions?.position,\n float,\n ])\n\n useEffect(() => {\n const elementRefs = new Set(anchorRefs)\n\n anchorsBySelect.forEach((anchor) => {\n elementRefs.add({ current: anchor })\n })\n\n const anchorById = document.querySelector<HTMLElement>(`[id='${anchorId}']`)\n if (anchorById) {\n elementRefs.add({ current: anchorById })\n }\n\n const handleScrollResize = () => {\n handleShow(false)\n }\n\n const anchorScrollParent = getScrollParent(activeAnchor)\n const tooltipScrollParent = getScrollParent(tooltipRef.current)\n\n if (actualGlobalCloseEvents.scroll) {\n window.addEventListener('scroll', handleScrollResize)\n anchorScrollParent?.addEventListener('scroll', handleScrollResize)\n tooltipScrollParent?.addEventListener('scroll', handleScrollResize)\n }\n let updateTooltipCleanup: null | (() => void) = null\n if (actualGlobalCloseEvents.resize) {\n window.addEventListener('resize', handleScrollResize)\n } else if (activeAnchor && tooltipRef.current) {\n updateTooltipCleanup = autoUpdate(\n activeAnchor as HTMLElement,\n tooltipRef.current as HTMLElement,\n updateTooltipPosition,\n {\n ancestorResize: true,\n elementResize: true,\n layoutShift: true,\n },\n )\n }\n\n const handleEsc = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') {\n return\n }\n handleShow(false)\n }\n if (actualGlobalCloseEvents.escape) {\n window.addEventListener('keydown', handleEsc)\n }\n\n if (actualGlobalCloseEvents.clickOutsideAnchor) {\n window.addEventListener('click', handleClickOutsideAnchors)\n }\n\n const enabledEvents: { event: string; listener: (event?: Event) => void }[] = []\n\n const handleClickOpenTooltipAnchor = (event?: Event) => {\n if (show && event?.target === activeAnchor) {\n /**\n * ignore clicking the anchor that was used to open the tooltip.\n * this avoids conflict with the click close event.\n */\n return\n }\n handleShowTooltip(event)\n }\n const handleClickCloseTooltipAnchor = (event?: Event) => {\n if (!show || event?.target !== activeAnchor) {\n /**\n * ignore clicking the anchor that was NOT used to open the tooltip.\n * this avoids closing the tooltip when clicking on a new anchor with the tooltip already open.\n */\n return\n }\n handleHideTooltip()\n }\n\n const regularEvents = ['mouseenter', 'mouseleave', 'focus', 'blur']\n const clickEvents = ['click', 'dblclick', 'mousedown', 'mouseup']\n\n Object.entries(actualOpenEvents).forEach(([event, enabled]) => {\n if (!enabled) {\n return\n }\n if (regularEvents.includes(event)) {\n enabledEvents.push({ event, listener: debouncedHandleShowTooltip })\n } else if (clickEvents.includes(event)) {\n enabledEvents.push({ event, listener: handleClickOpenTooltipAnchor })\n } else {\n // never happens\n }\n })\n\n Object.entries(actualCloseEvents).forEach(([event, enabled]) => {\n if (!enabled) {\n return\n }\n if (regularEvents.includes(event)) {\n enabledEvents.push({ event, listener: debouncedHandleHideTooltip })\n } else if (clickEvents.includes(event)) {\n enabledEvents.push({ event, listener: handleClickCloseTooltipAnchor })\n } else {\n // never happens\n }\n })\n\n if (float) {\n enabledEvents.push({\n event: 'mousemove',\n listener: handleMouseMove,\n })\n }\n\n const handleMouseEnterTooltip = () => {\n hoveringTooltip.current = true\n }\n const handleMouseLeaveTooltip = () => {\n hoveringTooltip.current = false\n handleHideTooltip()\n }\n\n if (clickable && !hasClickEvent) {\n // used to keep the tooltip open when hovering content.\n // not needed if using click events.\n tooltipRef.current?.addEventListener('mouseenter', handleMouseEnterTooltip)\n tooltipRef.current?.addEventListener('mouseleave', handleMouseLeaveTooltip)\n }\n\n enabledEvents.forEach(({ event, listener }) => {\n elementRefs.forEach((ref) => {\n ref.current?.addEventListener(event, listener)\n })\n })\n\n return () => {\n if (actualGlobalCloseEvents.scroll) {\n window.removeEventListener('scroll', handleScrollResize)\n anchorScrollParent?.removeEventListener('scroll', handleScrollResize)\n tooltipScrollParent?.removeEventListener('scroll', handleScrollResize)\n }\n if (actualGlobalCloseEvents.resize) {\n window.removeEventListener('resize', handleScrollResize)\n } else {\n updateTooltipCleanup?.()\n }\n if (actualGlobalCloseEvents.clickOutsideAnchor) {\n window.removeEventListener('click', handleClickOutsideAnchors)\n }\n if (actualGlobalCloseEvents.escape) {\n window.removeEventListener('keydown', handleEsc)\n }\n if (clickable && !hasClickEvent) {\n tooltipRef.current?.removeEventListener('mouseenter', handleMouseEnterTooltip)\n tooltipRef.current?.removeEventListener('mouseleave', handleMouseLeaveTooltip)\n }\n enabledEvents.forEach(({ event, listener }) => {\n elementRefs.forEach((ref) => {\n ref.current?.removeEventListener(event, listener)\n })\n })\n }\n /**\n * rendered is also a dependency to ensure anchor observers are re-registered\n * since `tooltipRef` becomes stale after removing/adding the tooltip to the DOM\n */\n }, [\n activeAnchor,\n updateTooltipPosition,\n rendered,\n anchorRefs,\n anchorsBySelect,\n // the effect uses the `actual*Events` objects, but this should work\n openEvents,\n closeEvents,\n globalCloseEvents,\n shouldOpenOnClick,\n ])\n\n useEffect(() => {\n let selector = imperativeOptions?.anchorSelect ?? anchorSelect ?? ''\n if (!selector && id) {\n selector = `[data-tooltip-id='${id}']`\n }\n const documentObserverCallback: MutationCallback = (mutationList) => {\n const newAnchors: HTMLElement[] = []\n const removedAnchors: HTMLElement[] = []\n mutationList.forEach((mutation) => {\n if (mutation.type === 'attributes' && mutation.attributeName === 'data-tooltip-id') {\n const newId = (mutation.target as HTMLElement).getAttribute('data-tooltip-id')\n if (newId === id) {\n newAnchors.push(mutation.target as HTMLElement)\n }\n }\n if (mutation.type !== 'childList') {\n return\n }\n if (activeAnchor) {\n const elements = [...mutation.removedNodes].filter((node) => node.nodeType === 1)\n if (selector) {\n try {\n removedAnchors.push(\n // the element itself is an anchor\n ...(elements.filter((element) =>\n (element as HTMLElement).matches(selector),\n ) as HTMLElement[]),\n )\n removedAnchors.push(\n // the element has children which are anchors\n ...elements.flatMap(\n (element) =>\n [...(element as HTMLElement).querySelectorAll(selector)] as HTMLElement[],\n ),\n )\n } catch {\n /**\n * invalid CSS selector.\n * already warned on tooltip controller\n */\n }\n }\n elements.some((node) => {\n if (node?.contains?.(activeAnchor)) {\n setRendered(false)\n handleShow(false)\n setActiveAnchor(null)\n if (tooltipShowDelayTimerRef.current) {\n clearTimeout(tooltipShowDelayTimerRef.current)\n }\n if (tooltipHideDelayTimerRef.current) {\n clearTimeout(tooltipHideDelayTimerRef.current)\n }\n return true\n }\n return false\n })\n }\n if (!selector) {\n return\n }\n try {\n const elements = [...mutation.addedNodes].filter((node) => node.nodeType === 1)\n newAnchors.push(\n // the element itself is an anchor\n ...(elements.filter((element) =>\n (element as HTMLElement).matches(selector),\n ) as HTMLElement[]),\n )\n newAnchors.push(\n // the element has children which are anchors\n ...elements.flatMap(\n (element) =>\n [...(element as HTMLElement).querySelectorAll(selector)] as HTMLElement[],\n ),\n )\n } catch {\n /**\n * invalid CSS selector.\n * already warned on tooltip controller\n */\n }\n })\n if (newAnchors.length || removedAnchors.length) {\n setAnchorsBySelect((anchors) => [\n ...anchors.filter((anchor) => !removedAnchors.includes(anchor)),\n ...newAnchors,\n ])\n }\n }\n const documentObserver = new MutationObserver(documentObserverCallback)\n // watch for anchor being removed from the DOM\n documentObserver.observe(document.body, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['data-tooltip-id'],\n })\n return () => {\n documentObserver.disconnect()\n }\n }, [id, anchorSelect, imperativeOptions?.anchorSelect, activeAnchor])\n\n useEffect(() => {\n updateTooltipPosition()\n }, [updateTooltipPosition])\n\n useEffect(() => {\n if (!contentWrapperRef?.current) {\n return () => null\n }\n const contentObserver = new ResizeObserver(() => {\n setTimeout(() => updateTooltipPosition())\n })\n contentObserver.observe(contentWrapperRef.current)\n return () => {\n contentObserver.disconnect()\n }\n }, [content, contentWrapperRef?.current])\n\n useEffect(() => {\n const anchorById = document.querySelector<HTMLElement>(`[id='${anchorId}']`)\n const anchors = [...anchorsBySelect, anchorById]\n if (!activeAnchor || !anchors.includes(activeAnchor)) {\n /**\n * if there is no active anchor,\n * or if the current active anchor is not amongst the allowed ones,\n * reset it\n */\n setActiveAnchor(anchorsBySelect[0] ?? anchorById)\n }\n }, [anchorId, anchorsBySelect, activeAnchor])\n\n useEffect(() => {\n return () => {\n if (tooltipShowDelayTimerRef.current) {\n clearTimeout(tooltipShowDelayTimerRef.current)\n }\n if (tooltipHideDelayTimerRef.current) {\n clearTimeout(tooltipHideDelayTimerRef.current)\n }\n }\n }, [])\n\n useEffect(() => {\n let selector = imperativeOptions?.anchorSelect ?? anchorSelect\n if (!selector && id) {\n selector = `[data-tooltip-id='${id}']`\n }\n if (!selector) {\n return\n }\n try {\n const anchors = Array.from(document.querySelectorAll<HTMLElement>(selector))\n setAnchorsBySelect(anchors)\n } catch {\n // warning was already issued in the controller\n setAnchorsBySelect([])\n }\n }, [id, anchorSelect, imperativeOptions?.anchorSelect])\n\n const actualContent = imperativeOptions?.content ?? content\n const canShow = show && Object.keys(inlineStyles).length > 0\n\n useImperativeHandle(forwardRef, () => ({\n open: (options) => {\n if (options?.anchorSelect) {\n try {\n document.querySelector(options.anchorSelect)\n } catch {\n if (!process.env.NODE_ENV || process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(`[react-tooltip] \"${options.anchorSelect}\" is not a valid CSS selector`)\n }\n return\n }\n }\n setImperativeOptions(options ?? null)\n if (options?.delay) {\n handleShowTooltipDelayed(options.delay)\n } else {\n handleShow(true)\n }\n },\n close: (options) => {\n if (options?.delay) {\n handleHideTooltipDelayed(options.delay)\n } else {\n handleShow(false)\n }\n },\n activeAnchor,\n place: actualPlacement,\n isOpen: Boolean(rendered && !hidden && actualContent && canShow),\n }))\n\n return rendered && !hidden && actualContent ? (\n <WrapperElement\n id={id}\n role={role}\n className={classNames(\n 'react-tooltip',\n coreStyles['tooltip'],\n styles['tooltip'],\n styles[variant],\n className,\n `react-tooltip__place-${actualPlacement}`,\n coreStyles[canShow ? 'show' : 'closing'],\n canShow ? 'react-tooltip__show' : 'react-tooltip__closing',\n positionStrategy === 'fixed' && coreStyles['fixed'],\n clickable && coreStyles['clickable'],\n )}\n onTransitionEnd={(event: TransitionEvent) => {\n if (missedTransitionTimerRef.current) {\n clearTimeout(missedTransitionTimerRef.current)\n }\n if (show || event.propertyName !== 'opacity') {\n return\n }\n setRendered(false)\n setImperativeOptions(null)\n afterHide?.()\n }}\n style={{\n ...externalStyles,\n ...inlineStyles,\n opacity: opacity !== undefined && canShow ? opacity : undefined,\n }}\n ref={tooltipRef}\n >\n {actualContent}\n <WrapperElement\n className={classNames(\n 'react-tooltip-arrow',\n coreStyles['arrow'],\n styles['arrow'],\n classNameArrow,\n noArrow && coreStyles['noArrow'],\n )}\n style={{\n ...inlineArrowStyles,\n background: arrowColor\n ? `linear-gradient(to right bottom, transparent 50%, ${arrowColor} 50%)`\n : undefined,\n }}\n ref={tooltipArrowRef}\n />\n </WrapperElement>\n ) : null\n}\n\nexport default Tooltip\n","export const cssTimeToMs = (time: string): number => {\n const match = time.match(/^([\\d.]+)(m?s?)$/)\n if (!match) {\n return 0\n }\n const [, amount, unit] = match\n if (unit !== 's' && unit !== 'ms') {\n return 0\n }\n return Number(amount) * (unit === 'ms' ? 1 : 1000)\n}\n","/* eslint-disable react/no-danger */\nimport React from 'react'\nimport type { ITooltipContent } from './TooltipContentTypes'\n\nconst TooltipContent = ({ content }: ITooltipContent) => {\n return <span dangerouslySetInnerHTML={{ __html: content }} />\n}\n\nexport default TooltipContent\n","const cssSupports = (property: string, value: string): boolean => {\n const hasCssSupports = 'CSS' in window && 'supports' in window.CSS\n return hasCssSupports ? window.CSS.supports(property, value) : true\n}\n\nexport default cssSupports\n","import React, { useEffect, useRef, useState } from 'react'\nimport { Tooltip } from 'components/Tooltip'\nimport type {\n EventsType,\n PositionStrategy,\n PlacesType,\n VariantType,\n WrapperType,\n DataAttribute,\n ITooltip,\n ChildrenType,\n TooltipRefProps,\n} from 'components/Tooltip/TooltipTypes'\nimport { useTooltip } from 'components/TooltipProvider'\nimport { TooltipContent } from 'components/TooltipContent'\nimport cssSupports from 'utils/css-supports'\nimport classNames from 'classnames'\nimport type { ITooltipController } from './TooltipControllerTypes'\n\nconst TooltipController = React.forwardRef<TooltipRefProps, ITooltipController>(\n (\n {\n id,\n anchorId,\n anchorSelect,\n content,\n html,\n render,\n className,\n classNameArrow,\n variant = 'dark',\n place = 'top',\n offset = 10,\n wrapper = 'div',\n children = null,\n events = ['hover'],\n openOnClick = false,\n positionStrategy = 'absolute',\n middlewares,\n delayShow = 0,\n delayHide = 0,\n float = false,\n hidden = false,\n noArrow = false,\n clickable = false,\n closeOnEsc = false,\n closeOnScroll = false,\n closeOnResize = false,\n openEvents,\n closeEvents,\n globalCloseEvents,\n imperativeModeOnly = false,\n style,\n position,\n isOpen,\n disableStyleInjection = false,\n border,\n opacity,\n arrowColor,\n setIsOpen,\n afterShow,\n afterHide,\n role = 'tooltip',\n }: ITooltipController,\n ref,\n ) => {\n const [tooltipContent, setTooltipContent] = useState(content)\n const [tooltipHtml, setTooltipHtml] = useState(html)\n const [tooltipPlace, setTooltipPlace] = useState(place)\n const [tooltipVariant, setTooltipVariant] = useState(variant)\n const [tooltipOffset, setTooltipOffset] = useState(offset)\n const [tooltipDelayShow, setTooltipDelayShow] = useState(delayShow)\n const [tooltipDelayHide, setTooltipDelayHide] = useState(delayHide)\n const [tooltipFloat, setTooltipFloat] = useState(float)\n const [tooltipHidden, setTooltipHidden] = useState(hidden)\n const [tooltipWrapper, setTooltipWrapper] = useState<WrapperType>(wrapper)\n const [tooltipEvents, setTooltipEvents] = useState(events)\n const [tooltipPositionStrategy, setTooltipPositionStrategy] = useState(positionStrategy)\n const [tooltipClassName, setTooltipClassName] = useState<string | null>(null)\n const [activeAnchor, setActiveAnchor] = useState<HTMLElement | null>(null)\n const styleInjectionRef = useRef(disableStyleInjection)\n /**\n * @todo Remove this in a future version (provider/wrapper method is deprecated)\n */\n const { anchorRefs, activeAnchor: providerActiveAnchor } = useTooltip(id)\n\n const getDataAttributesFromAnchorElement = (elementReference: HTMLElement) => {\n const dataAttributes = elementReference?.getAttributeNames().reduce((acc, name) => {\n if (name.startsWith('data-tooltip-')) {\n const parsedAttribute = name.replace(/^data-tooltip-/, '') as DataAttribute\n acc[parsedAttribute] = elementReference?.getAttribute(name) ?? null\n }\n return acc\n }, {} as Record<DataAttribute, string | null>)\n\n return dataAttributes\n }\n\n const applyAllDataAttributesFromAnchorElement = (\n dataAttributes: Record<string, string | null>,\n ) => {\n const handleDataAttributes: Record<DataAttribute, (value: string | null) => void> = {\n place: (value) => {\n setTooltipPlace((value as PlacesType) ?? place)\n },\n content: (value) => {\n setTooltipContent(value ?? content)\n },\n html: (value) => {\n setTooltipHtml(value ?? html)\n },\n variant: (value) => {\n setTooltipVariant((value as VariantType) ?? variant)\n },\n offset: (value) => {\n setTooltipOffset(value === null ? offset : Number(value))\n },\n wrapper: (value) => {\n setTooltipWrapper((value as WrapperType) ?? wrapper)\n },\n events: (value) => {\n const parsed = value?.split(' ') as EventsType[]\n setTooltipEvents(parsed ?? events)\n },\n 'position-strategy': (value) => {\n setTooltipPositionStrategy((value as PositionStrategy) ?? positionStrategy)\n },\n 'delay-show': (value) => {\n setTooltipDelayShow(value === null ? delayShow : Number(value))\n },\n 'delay-hide': (value) => {\n setTooltipDelayHide(value === null ? delayHide : Number(value))\n },\n float: (value) => {\n setTooltipFloat(value === null ? float : value === 'true')\n },\n hidden: (value) => {\n setTooltipHidden(value === null ? hidden : value === 'true')\n },\n 'class-name': (value) => {\n setTooltipClassName(value)\n },\n }\n // reset unset data attributes to default values\n // without this, data attributes from the last active anchor will still be used\n Object.values(handleDataAttributes).forEach((handler) => handler(null))\n Object.entries(dataAttributes).forEach(([key, value]) => {\n handleDataAttributes[key as DataAttribute]?.(value)\n })\n }\n\n useEffect(() => {\n setTooltipContent(content)\n }, [content])\n\n useEffect(() => {\n setTooltipHtml(html)\n }, [html])\n\n useEffect(() => {\n setTooltipPlace(place)\n }, [place])\n\n useEffect(() => {\n setTooltipVariant(variant)\n }, [variant])\n\n useEffect(() => {\n setTooltipOffset(offset)\n }, [offset])\n\n useEffect(() => {\n setTooltipDelayShow(delayShow)\n }, [delayShow])\n\n useEffect(() => {\n setTooltipDelayHide(delayHide)\n }, [delayHide])\n\n useEffect(() => {\n setTooltipFloat(float)\n }, [float])\n\n useEffect(() => {\n setTooltipHidden(hidden)\n }, [hidden])\n\n useEffect(() => {\n setTooltipPositionStrategy(positionStrategy)\n }, [positionStrategy])\n\n useEffect(() => {\n if (styleInjectionRef.current === disableStyleInjection) {\n return\n }\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn('[react-tooltip] Do not change `disableStyleInjection` dynamically.')\n }\n }, [disableStyleInjection])\n\n useEffect(() => {\n if (typeof window !== 'undefined') {\n window.dispatchEvent(\n new CustomEvent('react-tooltip-inject-styles', {\n detail: {\n disableCore: disableStyleInjection === 'core',\n disableBase: disableStyleInjection,\n },\n }),\n )\n }\n }, [])\n\n useEffect(() => {\n const elementRefs = new Set(anchorRefs)\n\n let selector = anchorSelect\n if (!selector && id) {\n selector = `[data-tooltip-id='${id}']`\n }\n if (selector) {\n try {\n const anchorsBySelect = document.querySelectorAll<HTMLElement>(selector)\n anchorsBySelect.forEach((anchor) => {\n elementRefs.add({ current: anchor })\n })\n } catch {\n if (!process.env.NODE_ENV || process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(`[react-tooltip] \"${selector}\" is not a valid CSS selector`)\n }\n }\n }\n\n const anchorById = document.querySelector<HTMLElement>(`[id='${anchorId}']`)\n if (anchorById) {\n elementRefs.add({ current: anchorById })\n }\n\n if (!elementRefs.size) {\n return () => null\n }\n\n const anchorElement = activeAnchor ?? anchorById ?? providerActiveAnchor.current\n\n const observerCallback: MutationCallback = (mutationList) => {\n mutationList.forEach((mutation) => {\n if (\n !anchorElement ||\n mutation.type !== 'attributes' ||\n !mutation.attributeName?.startsWith('data-tooltip-')\n ) {\n return\n }\n // make sure to get all set attributes, since all unset attributes are reset\n const dataAttributes = getDataAttributesFromAnchorElement(anchorElement)\n applyAllDataAttributesFromAnchorElement(dataAttributes)\n })\n }\n\n // Create an observer instance linked to the callback function\n const observer = new MutationObserver(observerCallback)\n\n // do not check for subtree and childrens, we only want to know attribute changes\n // to stay watching `data-attributes-*` from anchor element\n const observerConfig = { attributes: true, childList: false, subtree: false }\n\n if (anchorElement) {\n const dataAttributes = getDataAttributesFromAnchorElement(anchorElement)\n applyAllDataAttributesFromAnchorElement(dataAttributes)\n // Start observing the target node for configured mutations\n observer.observe(anchorElement, observerConfig)\n }\n\n return () => {\n // Remove the observer when the tooltip is destroyed\n observer.disconnect()\n }\n }, [anchorRefs, providerActiveAnchor, activeAnchor, anchorId, anchorSelect])\n\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') {\n return\n }\n if (style?.border) {\n // eslint-disable-next-line no-console\n console.warn('[react-tooltip] Do not set `style.border`. Use `border` prop instead.')\n }\n if (border && !cssSupports('border', `${border}`)) {\n // eslint-disable-next-line no-console\n console.warn(`[react-tooltip] \"${border}\" is not a valid \\`border\\`.`)\n }\n if (style?.opacity) {\n // eslint-disable-next-line no-console\n console.warn('[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead.')\n }\n if (opacity && !cssSupports('opacity', `${opacity}`)) {\n // eslint-disable-next-line no-console\n console.warn(`[react-tooltip] \"${opacity}\" is not a valid \\`opacity\\`.`)\n }\n }, [])\n\n /**\n * content priority: children < render or content < html\n * children should be lower priority so that it can be used as the \"default\" content\n */\n let renderedContent: ChildrenType = children\n const contentWrapperRef = useRef<HTMLDivElement>(null)\n if (render) {\n const rendered = render({ content: tooltipContent ?? null, activeAnchor }) as React.ReactNode\n renderedContent = rendered ? (\n <div ref={contentWrapperRef} className=\"react-tooltip-content-wrapper\">\n {rendered}\n </div>\n ) : null\n } else if (tooltipContent) {\n renderedContent = tooltipContent\n }\n if (tooltipHtml) {\n renderedContent = <TooltipContent content={tooltipHtml} />\n }\n\n const props: ITooltip = {\n forwardRef: ref,\n id,\n anchorId,\n anchorSelect,\n className: classNames(className, tooltipClassName),\n classNameArrow,\n content: renderedContent,\n contentWrapperRef,\n place: tooltipPlace,\n variant: tooltipVariant,\n offset: tooltipOffset,\n wrapper: tooltipWrapper,\n events: tooltipEvents,\n openOnClick,\n positionStrategy: tooltipPositionStrategy,\n middlewares,\n delayShow: tooltipDelayShow,\n delayHide: tooltipDelayHide,\n float: tooltipFloat,\n hidden: tooltipHidden,\n noArrow,\n clickable,\n closeOnEsc,\n closeOnScroll,\n closeOnResize,\n openEvents,\n closeEvents,\n globalCloseEvents,\n imperativeModeOnly,\n style,\n position,\n isOpen,\n border,\n opacity,\n arrowColor,\n setIsOpen,\n afterShow,\n afterHide,\n activeAnchor,\n setActiveAnchor: (anchor: HTMLElement | null) => setActiveAnchor(anchor),\n role,\n }\n\n return <Tooltip {...props} />\n },\n)\n\nexport default TooltipController\n","import './tokens.css'\n\nimport { injectStyle } from 'utils/handle-style'\n\nimport type {\n ChildrenType,\n DataAttribute,\n EventsType,\n PlacesType,\n PositionStrategy,\n VariantType,\n WrapperType,\n IPosition,\n Middleware,\n TooltipRefProps,\n} from './components/Tooltip/TooltipTypes'\nimport type { ITooltipController } from './components/TooltipController/TooltipControllerTypes'\nimport type { ITooltipWrapper } from './components/TooltipProvider/TooltipProviderTypes'\n\n// those content will be replaced in build time with the `react-tooltip.css` builded content\nconst TooltipCoreStyles = 'react-tooltip-core-css-placeholder'\nconst TooltipStyles = 'react-tooltip-css-placeholder'\n\nif (typeof window !== 'undefined') {\n window.addEventListener('react-tooltip-inject-styles', ((\n event: CustomEvent<{ disableCore: boolean; disableBase: boolean }>,\n ) => {\n if (!event.detail.disableCore) {\n injectStyle({ css: TooltipCoreStyles, type: 'core' })\n }\n if (!event.detail.disableBase) {\n injectStyle({ css: TooltipStyles, type: 'base' })\n }\n }) as EventListener)\n}\n\nexport { TooltipController as Tooltip } from './components/TooltipController'\nexport { TooltipProvider, TooltipWrapper } from './components/TooltipProvider'\nexport type {\n ChildrenType,\n DataAttribute,\n EventsType,\n PlacesType,\n PositionStrategy,\n VariantType,\n WrapperType,\n ITooltipController as ITooltip,\n ITooltipWrapper,\n IPosition,\n Middleware,\n TooltipRefProps,\n}\n\nexport { removeStyle } from './utils/handle-style'\n"],"names":["REACT_TOOLTIP_CORE_STYLES_ID","REACT_TOOLTIP_BASE_STYLES_ID","injected","core","base","injectStyle","css","id","type","ref","document","process","_a","env","REACT_TOOLTIP_DISABLE_CORE_STYLES","_b","REACT_TOOLTIP_DISABLE_BASE_STYLES","insertAt","getElementById","console","warn","head","getElementsByTagName","style","createElement","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","debounce","func","wait","immediate","timeout","args","later","apply","this","setTimeout","clearTimeout","DEFAULT_TOOLTIP_ID","DEFAULT_CONTEXT_DATA","anchorRefs","Set","activeAnchor","current","attach","detach","setActiveAnchor","DEFAULT_CONTEXT_DATA_WRAPPER","getTooltipData","TooltipContext","createContext","useTooltip","tooltipId","useContext","useIsomorphicLayoutEffect","window","useLayoutEffect","useEffect","isScrollable","node","HTMLElement","SVGElement","getComputedStyle","some","propertyName","value","getPropertyValue","getScrollParent","currentParent","parentElement","scrollingElement","documentElement","computeTooltipPosition","async","elementReference","tooltipReference","tooltipArrowReference","place","offset","offsetValue","strategy","middlewares","Number","flip","fallbackAxisSideDirection","shift","padding","border","tooltipStyles","tooltipArrowStyles","middleware","push","arrow","element","computePosition","placement","then","x","y","middlewareData","styles","left","top","arrowX","arrowY","staticSide","right","bottom","split","borderSide","borderBottom","borderRight","borderWidth","match","Tooltip","forwardRef","className","classNameArrow","variant","anchorId","anchorSelect","events","openOnClick","positionStrategy","wrapper","WrapperElement","delayShow","delayHide","float","hidden","noArrow","clickable","closeOnEsc","closeOnScroll","closeOnResize","openEvents","closeEvents","globalCloseEvents","imperativeModeOnly","externalStyles","position","afterShow","afterHide","content","contentWrapperRef","isOpen","setIsOpen","opacity","arrowColor","role","tooltipRef","useRef","tooltipArrowRef","tooltipShowDelayTimerRef","tooltipHideDelayTimerRef","missedTransitionTimerRef","actualPlacement","setActualPlacement","useState","inlineStyles","setInlineStyles","inlineArrowStyles","setInlineArrowStyles","show","setShow","rendered","setRendered","imperativeOptions","setImperativeOptions","wasShowing","lastFloatPosition","setProviderActiveAnchor","hoveringTooltip","anchorsBySelect","setAnchorsBySelect","mounted","shouldOpenOnClick","includes","hasClickEvent","click","dblclick","mousedown","actualOpenEvents","mouseenter","focus","Object","assign","actualCloseEvents","mouseleave","blur","mouseup","actualGlobalCloseEvents","escape","scroll","resize","clickOutsideAnchor","handleShow","undefined","transitionShowDelay","time","amount","unit","cssTimeToMs","body","handleShowTooltipDelayed","delay","handleHideTooltipDelayed","handleShowTooltip","event","target","currentTarget","isConnected","handleHideTooltip","handleTooltipPosition","virtualElement","getBoundingClientRect","width","height","computedStylesData","keys","length","handleMouseMove","mouseEvent","mousePosition","clientX","clientY","handleClickOutsideAnchors","contains","querySelector","anchor","debouncedHandleShowTooltip","debouncedHandleHideTooltip","updateTooltipPosition","useCallback","actualPosition","elementRefs","forEach","add","anchorById","handleScrollResize","anchorScrollParent","tooltipScrollParent","addEventListener","updateTooltipCleanup","autoUpdate","ancestorResize","elementResize","layoutShift","handleEsc","key","enabledEvents","handleClickOpenTooltipAnchor","handleClickCloseTooltipAnchor","regularEvents","clickEvents","entries","enabled","listener","handleMouseEnterTooltip","handleMouseLeaveTooltip","removeEventListener","selector","documentObserver","MutationObserver","mutationList","newAnchors","removedAnchors","mutation","attributeName","getAttribute","elements","removedNodes","filter","nodeType","matches","flatMap","querySelectorAll","call","addedNodes","anchors","observe","childList","subtree","attributes","attributeFilter","disconnect","contentObserver","ResizeObserver","Array","from","actualContent","canShow","useImperativeHandle","open","options","close","Boolean","React","classNames","coreStyles","onTransitionEnd","background","TooltipContent","dangerouslySetInnerHTML","__html","cssSupports","property","CSS","supports","TooltipController","html","render","children","disableStyleInjection","tooltipContent","setTooltipContent","tooltipHtml","setTooltipHtml","tooltipPlace","setTooltipPlace","tooltipVariant","setTooltipVariant","tooltipOffset","setTooltipOffset","tooltipDelayShow","setTooltipDelayShow","tooltipDelayHide","setTooltipDelayHide","tooltipFloat","setTooltipFloat","tooltipHidden","setTooltipHidden","tooltipWrapper","setTooltipWrapper","tooltipEvents","setTooltipEvents","tooltipPositionStrategy","setTooltipPositionStrategy","tooltipClassName","setTooltipClassName","styleInjectionRef","providerActiveAnchor","getDataAttributesFromAnchorElement","getAttributeNames","reduce","acc","name","startsWith","replace","applyAllDataAttributesFromAnchorElement","dataAttributes","handleDataAttributes","parsed","values","handler","dispatchEvent","CustomEvent","detail","disableCore","disableBase","size","anchorElement","observer","observerConfig","renderedContent","props","anchorRefMap","setAnchorRefMap","activeAnchorMap","setActiveAnchorMap","refs","oldMap","tooltipRefs","delete","context","useMemo","Provider","anchorRef","tagName","remove"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EAAO,oBACVuK,EAAI,uBACDhM,EACD,sBAAAxC,EACC,uBAAA8C,wBACDH,EAAM,iCACKE,EAAgB,0BACvBG,EACA,0BAAAC,GAExByL,EAEJ,gBH0CH,UAAqBpT,KACnBA,EAAO,OAAMD,GACbA,EAAKN,GAIH,IACF,IAAKC,EAASM,GACZ,OAGW,SAATA,IAEFD,EAAKP,GAGP,MAAMuB,EAAQb,SAASQ,eAAeX,GACf,WAAnBgB,aAAK,EAALA,EAAOuW,SACTvW,SAAAA,EAAOwW,SAGP5W,QAAQC,KACN,6DAA6Db,oCAIjEL,EAASM,IAAQ,CACnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-tooltip",
|
|
3
|
-
"version": "5.25.1
|
|
3
|
+
"version": "5.25.1",
|
|
4
4
|
"description": "react tooltip component",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev-rollup": "node ./prebuild.js --env=development && node --max_old_space_size=2048 ./node_modules/rollup/dist/bin/rollup -c rollup.config.dev.js --watch",
|