react-tooltip
Advanced tools
Comparing version 5.19.0-beta.1052.0 to 5.19.0
@@ -171,2 +171,11 @@ import React, { ElementType, ReactNode, CSSProperties, PropsWithChildren } from 'react'; | ||
export { ChildrenType, DataAttribute, EventsType, IPosition, ITooltipController as ITooltip, ITooltipWrapper, Middleware, PlacesType, PositionStrategy, TooltipController as Tooltip, TooltipProvider, TooltipWrapper, VariantType, WrapperType }; | ||
/** | ||
* @deprecated Use the `disableStyleInjection` tooltip prop instead. | ||
* See https://react-tooltip.com/docs/examples/styling#disabling-reacttooltip-css | ||
*/ | ||
declare function removeStyle({ type, id, }?: { | ||
type?: 'core' | 'base'; | ||
id?: string; | ||
}): void; | ||
export { ChildrenType, DataAttribute, EventsType, IPosition, ITooltipController as ITooltip, ITooltipWrapper, Middleware, PlacesType, PositionStrategy, TooltipController as Tooltip, TooltipProvider, TooltipWrapper, VariantType, WrapperType, removeStyle }; |
@@ -28,2 +28,16 @@ | ||
function injectStyle({ css, id = REACT_TOOLTIP_BASE_STYLES_ID, type = 'base', ref, }) { | ||
var _a, _b; | ||
if (!css || typeof document === 'undefined' || injected[type]) { | ||
return; | ||
} | ||
if (type === 'core' && | ||
typeof process !== 'undefined' && // this validation prevents docs from breaking even with `process?` | ||
((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.REACT_TOOLTIP_DISABLE_CORE_STYLES)) { | ||
return; | ||
} | ||
if (type !== 'base' && | ||
typeof process !== 'undefined' && // this validation prevents docs from breaking even with `process?` | ||
((_b = process === null || process === void 0 ? void 0 : process.env) === null || _b === void 0 ? void 0 : _b.REACT_TOOLTIP_DISABLE_BASE_STYLES)) { | ||
return; | ||
} | ||
if (type === 'core') { | ||
@@ -38,5 +52,2 @@ // eslint-disable-next-line no-param-reassign | ||
const { insertAt } = ref; | ||
if (!css || typeof document === 'undefined' || injected[type]) { | ||
return; | ||
} | ||
if (document.getElementById(id)) { | ||
@@ -74,2 +85,24 @@ // this should never happen because of `injected[type]` | ||
} | ||
/** | ||
* @deprecated Use the `disableStyleInjection` tooltip prop instead. | ||
* See https://react-tooltip.com/docs/examples/styling#disabling-reacttooltip-css | ||
*/ | ||
function removeStyle({ type = 'base', id = REACT_TOOLTIP_BASE_STYLES_ID, } = {}) { | ||
if (!injected[type]) { | ||
return; | ||
} | ||
if (type === 'core') { | ||
// eslint-disable-next-line no-param-reassign | ||
id = REACT_TOOLTIP_CORE_STYLES_ID; | ||
} | ||
const style = document.getElementById(id); | ||
if ((style === null || style === void 0 ? void 0 : style.tagName) === 'style') { | ||
style === null || style === void 0 ? void 0 : style.remove(); | ||
} | ||
else { | ||
// eslint-disable-next-line no-console | ||
console.warn(`[react-tooltip] Failed to remove 'style' element with id '${id}'. Call \`injectStyle()\` first`); | ||
} | ||
injected[type] = false; | ||
} | ||
@@ -1195,2 +1228,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
exports.TooltipWrapper = TooltipWrapper; | ||
exports.removeStyle = removeStyle; | ||
@@ -1197,0 +1231,0 @@ Object.defineProperty(exports, '__esModule', { value: true }); |
@@ -7,3 +7,3 @@ /* | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("classnames"),require("@floating-ui/dom")):"function"==typeof define&&define.amd?define(["exports","react","classnames","@floating-ui/dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactTooltip={},e.React,e.classNames,e.FloatingUIDOM)}(this,(function(e,t,o,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=n(t),s=n(o);const c="react-tooltip-core-styles",a="react-tooltip-base-styles",i={core:!1,base:!1};function u({css:e,id:t=a,type:o="base",ref:r}){"core"===o&&(t=c),r||(r={});const{insertAt:n}=r;if(!e||"undefined"==typeof document||i[o])return;if(document.getElementById(t))return void console.warn(`[react-tooltip] Element with id '${t}' already exists. Call \`removeStyle()\` first`);const l=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.id=t,s.type="text/css","top"===n&&l.firstChild?l.insertBefore(s,l.firstChild):l.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e)),i[o]=!0}const d=(e,t,o)=>{let r=null;return function(...n){const l=()=>{r=null,o||e.apply(this,n)};o&&!r&&(e.apply(this,n),r=setTimeout(l,t)),o||(r&&clearTimeout(r),r=setTimeout(l,t))}},p="DEFAULT_TOOLTIP_ID",f={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},m={getTooltipData:()=>f},v=t.createContext(m);function y(e=p){return t.useContext(v).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}))},E=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(w(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},S=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:o=null,place:n="top",offset:l=10,strategy:s="absolute",middlewares:c=[r.offset(Number(l)),r.flip(),r.shift({padding:5})],border:a})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};const i=c;return o?(i.push(r.arrow({element:o,padding:5})),r.computePosition(e,t,{placement:n,strategy:s,middleware:i}).then((({x:e,y:t,placement:o,middlewareData:r})=>{var n,l;const s={left:`${e}px`,top:`${t}px`,border:a},{x:c,y:i}=null!==(n=r.arrow)&&void 0!==n?n:{x:0,y:0},u=null!==(l={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]])&&void 0!==l?l:"bottom",d=a&&{top:{borderBottom:a,borderRight:a},right:{borderBottom:a,borderLeft:a},bottom:{borderTop:a,borderLeft:a},left:{borderTop:a,borderRight:a}}[o.split("-")[0]];let p=0;if(a){const e=`${a}`.match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:s,tooltipArrowStyles:{left:null!=c?`${c}px`:"",top:null!=i?`${i}px`:"",right:"",bottom:"",...d,[u]:`-${4+p}px`},place:o}}))):r.computePosition(e,t,{placement:"bottom",strategy:s,middleware:i}).then((({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o})))};var b="core-styles-module_tooltip__3vRRp",g="core-styles-module_fixed__pcSol",_="core-styles-module_arrow__cvMwQ",A="core-styles-module_noArrow__xock6",T="core-styles-module_clickable__ZuTTB",R="core-styles-module_show__Nt9eE",O={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 L=({id:e,className:o,classNameArrow:r,variant:n="dark",anchorId:c,anchorSelect:a,place:i="top",offset:u=10,events:p=["hover"],openOnClick:f=!1,positionStrategy:m="absolute",middlewares:v,wrapper:w,delayShow:L=0,delayHide:x=0,float:N=!1,hidden:k=!1,noArrow:$=!1,clickable:C=!1,closeOnEsc:j=!1,closeOnScroll:I=!1,closeOnResize:q=!1,style:D,position:B,afterShow:H,afterHide:M,content:W,contentWrapperRef:z,isOpen:P,setIsOpen:U,activeAnchor:F,setActiveAnchor:K,border:X,opacity:V})=>{const Z=t.useRef(null),G=t.useRef(null),J=t.useRef(null),Q=t.useRef(null),[Y,ee]=t.useState(i),[te,oe]=t.useState({}),[re,ne]=t.useState({}),[le,se]=t.useState(!1),[ce,ae]=t.useState(!1),ie=t.useRef(!1),ue=t.useRef(null),{anchorRefs:de,setActiveAnchor:pe}=y(e),fe=t.useRef(!1),[me,ve]=t.useState([]),ye=t.useRef(!1),he=f||p.includes("click");h((()=>(ye.current=!0,()=>{ye.current=!1})),[]),t.useEffect((()=>{if(!le){const e=setTimeout((()=>{ae(!1)}),150);return()=>{clearTimeout(e)}}return()=>null}),[le]);const we=e=>{ye.current&&(e&&ae(!0),setTimeout((()=>{ye.current&&(null==U||U(e),void 0===P&&se(e))}),10))};t.useEffect((()=>{if(void 0===P)return()=>null;P&&ae(!0);const e=setTimeout((()=>{se(P)}),10);return()=>{clearTimeout(e)}}),[P]),t.useEffect((()=>{le!==ie.current&&(ie.current=le,le?null==H||H():null==M||M())}),[le]);const Ee=(e=x)=>{Q.current&&clearTimeout(Q.current),Q.current=setTimeout((()=>{fe.current||we(!1)}),e)},Se=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 K(null),void pe({current:null});L?(J.current&&clearTimeout(J.current),J.current=setTimeout((()=>{we(!0)}),L)):we(!0),K(o),pe({current:o}),Q.current&&clearTimeout(Q.current)},be=()=>{C?Ee(x||100):x?Ee():we(!1),J.current&&clearTimeout(J.current)},ge=({x:e,y:t})=>{S({place:i,offset:u,elementReference:{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})},tooltipReference:Z.current,tooltipArrowReference:G.current,strategy:m,middlewares:v,border:X}).then((e=>{Object.keys(e.tooltipStyles).length&&oe(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&ne(e.tooltipArrowStyles),ee(e.place)}))},_e=e=>{if(!e)return;const t=e,o={x:t.clientX,y:t.clientY};ge(o),ue.current=o},Ae=e=>{Se(e),x&&Ee()},Te=e=>{var t;[document.querySelector(`[id='${c}']`),...me].some((t=>null==t?void 0:t.contains(e.target)))||(null===(t=Z.current)||void 0===t?void 0:t.contains(e.target))||(we(!1),J.current&&clearTimeout(J.current))},Re=d(Se,50,!0),Oe=d(be,50,!0);t.useEffect((()=>{var e,t;const o=new Set(de);me.forEach((e=>{o.add({current:e})}));const r=document.querySelector(`[id='${c}']`);r&&o.add({current:r});const n=()=>{we(!1)},l=E(F),s=E(Z.current);I&&(window.addEventListener("scroll",n),null==l||l.addEventListener("scroll",n),null==s||s.addEventListener("scroll",n)),q&&window.addEventListener("resize",n);const a=e=>{"Escape"===e.key&&we(!1)};j&&window.addEventListener("keydown",a);const i=[];he?(window.addEventListener("click",Te),i.push({event:"click",listener:Ae})):(i.push({event:"mouseenter",listener:Re},{event:"mouseleave",listener:Oe},{event:"focus",listener:Re},{event:"blur",listener:Oe}),N&&i.push({event:"mousemove",listener:_e}));const u=()=>{fe.current=!0},d=()=>{fe.current=!1,be()};return C&&!he&&(null===(e=Z.current)||void 0===e||e.addEventListener("mouseenter",u),null===(t=Z.current)||void 0===t||t.addEventListener("mouseleave",d)),i.forEach((({event:e,listener:t})=>{o.forEach((o=>{var r;null===(r=o.current)||void 0===r||r.addEventListener(e,t)}))})),()=>{var e,t;I&&(window.removeEventListener("scroll",n),null==l||l.removeEventListener("scroll",n),null==s||s.removeEventListener("scroll",n)),q&&window.removeEventListener("resize",n),he&&window.removeEventListener("click",Te),j&&window.removeEventListener("keydown",a),C&&!he&&(null===(e=Z.current)||void 0===e||e.removeEventListener("mouseenter",u),null===(t=Z.current)||void 0===t||t.removeEventListener("mouseleave",d)),i.forEach((({event:e,listener:t})=>{o.forEach((o=>{var r;null===(r=o.current)||void 0===r||r.removeEventListener(e,t)}))}))}}),[ce,de,me,j,p]),t.useEffect((()=>{let t=null!=a?a:"";!t&&e&&(t=`[data-tooltip-id='${e}']`);const o=new MutationObserver((o=>{const r=[];o.forEach((o=>{if("attributes"===o.type&&"data-tooltip-id"===o.attributeName){o.target.getAttribute("data-tooltip-id")===e&&r.push(o.target)}if("childList"===o.type&&(F&&[...o.removedNodes].some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,F))&&(ae(!1),we(!1),K(null),J.current&&clearTimeout(J.current),Q.current&&clearTimeout(Q.current),!0)})),t))try{const e=[...o.addedNodes].filter((e=>1===e.nodeType));r.push(...e.filter((e=>e.matches(t)))),r.push(...e.flatMap((e=>[...e.querySelectorAll(t)])))}catch(e){}})),r.length&&ve((e=>[...e,...r]))}));return o.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"]}),()=>{o.disconnect()}}),[e,a,F]);const Le=()=>{B?ge(B):N?ue.current&&ge(ue.current):S({place:i,offset:u,elementReference:F,tooltipReference:Z.current,tooltipArrowReference:G.current,strategy:m,middlewares:v,border:X}).then((e=>{ye.current&&(Object.keys(e.tooltipStyles).length&&oe(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&ne(e.tooltipArrowStyles),ee(e.place))}))};t.useEffect((()=>{Le()}),[le,F,W,D,i,u,m,B]),t.useEffect((()=>{if(!(null==z?void 0:z.current))return()=>null;const e=new ResizeObserver((()=>{Le()}));return e.observe(z.current),()=>{e.disconnect()}}),[W,null==z?void 0:z.current]),t.useEffect((()=>{var e;const t=document.querySelector(`[id='${c}']`),o=[...me,t];F&&o.includes(F)||K(null!==(e=me[0])&&void 0!==e?e:t)}),[c,me,F]),t.useEffect((()=>()=>{J.current&&clearTimeout(J.current),Q.current&&clearTimeout(Q.current)}),[]),t.useEffect((()=>{let t=a;if(!t&&e&&(t=`[data-tooltip-id='${e}']`),t)try{const e=Array.from(document.querySelectorAll(t));ve(e)}catch(e){ve([])}}),[e,a]);const xe=!k&&W&&le&&Object.keys(te).length>0;return ce?l.default.createElement(w,{id:e,role:"tooltip",className:s.default("react-tooltip",b,O.tooltip,O[n],o,`react-tooltip__place-${Y}`,{[R]:xe,[g]:"fixed"===m,[T]:C}),style:{...D,...te,opacity:void 0!==V&&xe?V:void 0},ref:Z},W,l.default.createElement(w,{className:s.default("react-tooltip-arrow",_,O.arrow,r,{[A]:$}),style:re,ref:G})):null},x=({content:e})=>l.default.createElement("span",{dangerouslySetInnerHTML:{__html:e}});"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}.core-styles-module_tooltip__3vRRp{visibility:hidden;position:absolute;top:0;left:0;pointer-events:none;opacity:0;transition:opacity 0.3s ease-out;will-change:opacity,visibility}.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{visibility:visible;opacity:var(--rt-opacity)}`,type:"core"}),e.detail.disableBase||u({css:` | ||
.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px;transform:rotate(45deg)}.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=({id:e,anchorId:o,anchorSelect:r,content:n,html:s,render:c,className:a,classNameArrow:i,variant:u="dark",place:d="top",offset:p=10,wrapper:f="div",children:m=null,events:v=["hover"],openOnClick:h=!1,positionStrategy:w="absolute",middlewares:E,delayShow:S=0,delayHide:b=0,float:g=!1,hidden:_=!1,noArrow:A=!1,clickable:T=!1,closeOnEsc:R=!1,closeOnScroll:O=!1,closeOnResize:N=!1,style:k,position:$,isOpen:C,disableStyleInjection:j=!1,border:I,opacity:q,setIsOpen:D,afterShow:B,afterHide:H})=>{const[M,W]=t.useState(n),[z,P]=t.useState(s),[U,F]=t.useState(d),[K,X]=t.useState(u),[V,Z]=t.useState(p),[G,J]=t.useState(S),[Q,Y]=t.useState(b),[ee,te]=t.useState(g),[oe,re]=t.useState(_),[ne,le]=t.useState(f),[se,ce]=t.useState(v),[ae,ie]=t.useState(w),[ue,de]=t.useState(null),pe=t.useRef(j),{anchorRefs:fe,activeAnchor:me}=y(e),ve=e=>null==e?void 0:e.getAttributeNames().reduce(((t,o)=>{var r;if(o.startsWith("data-tooltip-")){t[o.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(o))&&void 0!==r?r:null}return t}),{}),ye=e=>{const t={place:e=>{var t;F(null!==(t=e)&&void 0!==t?t:d)},content:e=>{W(null!=e?e:n)},html:e=>{P(null!=e?e:s)},variant:e=>{var t;X(null!==(t=e)&&void 0!==t?t:u)},offset:e=>{Z(null===e?p:Number(e))},wrapper:e=>{var t;le(null!==(t=e)&&void 0!==t?t:f)},events:e=>{const t=null==e?void 0:e.split(" ");ce(null!=t?t:v)},"position-strategy":e=>{var t;ie(null!==(t=e)&&void 0!==t?t:w)},"delay-show":e=>{J(null===e?S:Number(e))},"delay-hide":e=>{Y(null===e?b:Number(e))},float:e=>{te(null===e?g:"true"===e)},hidden:e=>{re(null===e?_:"true"===e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,o])=>{var r;null===(r=t[e])||void 0===r||r.call(t,o)}))};t.useEffect((()=>{W(n)}),[n]),t.useEffect((()=>{P(s)}),[s]),t.useEffect((()=>{F(d)}),[d]),t.useEffect((()=>{X(u)}),[u]),t.useEffect((()=>{Z(p)}),[p]),t.useEffect((()=>{J(S)}),[S]),t.useEffect((()=>{Y(b)}),[b]),t.useEffect((()=>{te(g)}),[g]),t.useEffect((()=>{re(_)}),[_]),t.useEffect((()=>{ie(w)}),[w]),t.useEffect((()=>{pe.current!==j&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[j]),t.useEffect((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===j,disableBase:j}}))}),[]),t.useEffect((()=>{var t;const n=new Set(fe);let l=r;if(!l&&e&&(l=`[data-tooltip-id='${e}']`),l)try{document.querySelectorAll(l).forEach((e=>{n.add({current:e})}))}catch(e){console.warn(`[react-tooltip] "${l}" is not a valid CSS selector`)}const s=document.querySelector(`[id='${o}']`);if(s&&n.add({current:s}),!n.size)return()=>null;const c=null!==(t=null!=ue?ue:s)&&void 0!==t?t:me.current,a=new MutationObserver((e=>{e.forEach((e=>{var t;if(!c||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const o=ve(c);ye(o)}))})),i={attributes:!0,childList:!1,subtree:!1};if(c){const e=ve(c);ye(e),a.observe(c,i)}return()=>{a.disconnect()}}),[fe,me,ue,o,r]),t.useEffect((()=>{(null==k?void 0:k.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),I&&!CSS.supports("border",`${I}`)&&console.warn(`[react-tooltip] "${I}" is not a valid \`border\`.`),(null==k?void 0:k.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),q&&!CSS.supports("opacity",`${q}`)&&console.warn(`[react-tooltip] "${q}" is not a valid \`opacity\`.`)}),[]);let he=m;const we=t.useRef(null);if(c){const e=c({content:null!=M?M:null,activeAnchor:ue});he=e?l.default.createElement("div",{ref:we,className:"react-tooltip-content-wrapper"},e):null}else M&&(he=M);z&&(he=l.default.createElement(x,{content:z}));const Ee={id:e,anchorId:o,anchorSelect:r,className:a,classNameArrow:i,content:he,contentWrapperRef:we,place:U,variant:K,offset:V,wrapper:ne,events:se,openOnClick:h,positionStrategy:ae,middlewares:E,delayShow:G,delayHide:Q,float:ee,hidden:oe,noArrow:A,clickable:T,closeOnEsc:R,closeOnScroll:O,closeOnResize:N,style:k,position:$,isOpen:C,border:I,opacity:q,setIsOpen:D,afterShow:B,afterHide:H,activeAnchor:ue,setActiveAnchor:e=>de(e)};return l.default.createElement(L,{...Ee})},e.TooltipProvider=({children:e})=>{const[o,r]=t.useState({[p]:new Set}),[n,s]=t.useState({[p]:{current:null}}),c=(e,...t)=>{r((o=>{var r;const n=null!==(r=o[e])&&void 0!==r?r:new Set;return t.forEach((e=>n.add(e))),{...o,[e]:new Set(n)}}))},a=(e,...t)=>{r((o=>{const r=o[e];return r?(t.forEach((e=>r.delete(e))),{...o}):o}))},i=t.useCallback(((e=p)=>{var t,r;return{anchorRefs:null!==(t=o[e])&&void 0!==t?t:new Set,activeAnchor:null!==(r=n[e])&&void 0!==r?r:{current:null},attach:(...t)=>c(e,...t),detach:(...t)=>a(e,...t),setActiveAnchor:t=>((e,t)=>{s((o=>{var r;return(null===(r=o[e])||void 0===r?void 0:r.current)===t.current?o:{...o,[e]:t}}))})(e,t)}}),[o,n,c,a]),u=t.useMemo((()=>({getTooltipData:i})),[i]);return l.default.createElement(v.Provider,{value:u},e)},e.TooltipWrapper=({tooltipId:e,children:o,className:r,place:n,content:c,html:a,variant:i,offset:u,wrapper:d,events:p,positionStrategy:f,delayShow:m,delayHide:v})=>{const{attach:h,detach:w}=y(e),E=t.useRef(null);return t.useEffect((()=>(h(E),()=>{w(E)})),[]),l.default.createElement("span",{ref:E,className:s.default("react-tooltip-wrapper",r),"data-tooltip-place":n,"data-tooltip-content":c,"data-tooltip-html":a,"data-tooltip-variant":i,"data-tooltip-offset":u,"data-tooltip-wrapper":d,"data-tooltip-events":p,"data-tooltip-position-strategy":f,"data-tooltip-delay-show":m,"data-tooltip-delay-hide":v},o)},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("classnames"),require("@floating-ui/dom")):"function"==typeof define&&define.amd?define(["exports","react","classnames","@floating-ui/dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactTooltip={},e.React,e.classNames,e.FloatingUIDOM)}(this,(function(e,t,o,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=n(t),s=n(o);const c="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:r}){var n,l;if(!e||"undefined"==typeof document||a[o])return;if("core"===o&&"undefined"!=typeof process&&(null===(n=null===process||void 0===process?void 0:process.env)||void 0===n?void 0:n.REACT_TOOLTIP_DISABLE_CORE_STYLES))return;if("base"!==o&&"undefined"!=typeof process&&(null===(l=null===process||void 0===process?void 0:process.env)||void 0===l?void 0:l.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;"core"===o&&(t=c),r||(r={});const{insertAt:s}=r;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"===s&&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 r=null;return function(...n){const l=()=>{r=null,o||e.apply(this,n)};o&&!r&&(e.apply(this,n),r=setTimeout(l,t)),o||(r&&clearTimeout(r),r=setTimeout(l,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}))},E=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(w(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},S=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:o=null,place:n="top",offset:l=10,strategy:s="absolute",middlewares:c=[r.offset(Number(l)),r.flip(),r.shift({padding:5})],border:i})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};const a=c;return o?(a.push(r.arrow({element:o,padding:5})),r.computePosition(e,t,{placement:n,strategy:s,middleware:a}).then((({x:e,y:t,placement:o,middlewareData:r})=>{var n,l;const s={left:`${e}px`,top:`${t}px`,border:i},{x:c,y:a}=null!==(n=r.arrow)&&void 0!==n?n:{x:0,y:0},u=null!==(l={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]])&&void 0!==l?l:"bottom",d=i&&{top:{borderBottom:i,borderRight:i},right:{borderBottom:i,borderLeft:i},bottom:{borderTop:i,borderLeft:i},left:{borderTop:i,borderRight:i}}[o.split("-")[0]];let p=0;if(i){const e=`${i}`.match(/(\d+)px/);p=(null==e?void 0:e[1])?Number(e[1]):1}return{tooltipStyles:s,tooltipArrowStyles:{left:null!=c?`${c}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",...d,[u]:`-${4+p}px`},place:o}}))):r.computePosition(e,t,{placement:"bottom",strategy:s,middleware:a}).then((({x:e,y:t,placement:o})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:o})))};var b="core-styles-module_tooltip__3vRRp",g="core-styles-module_fixed__pcSol",_="core-styles-module_arrow__cvMwQ",T="core-styles-module_noArrow__xock6",A="core-styles-module_clickable__ZuTTB",R="core-styles-module_show__Nt9eE",O={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 L=({id:e,className:o,classNameArrow:r,variant:n="dark",anchorId:c,anchorSelect:i,place:a="top",offset:u=10,events:p=["hover"],openOnClick:f=!1,positionStrategy:v="absolute",middlewares:m,wrapper:w,delayShow:L=0,delayHide:x=0,float:N=!1,hidden:k=!1,noArrow:C=!1,clickable:$=!1,closeOnEsc:I=!1,closeOnScroll:j=!1,closeOnResize:B=!1,style:D,position:q,afterShow:H,afterHide:M,content:P,contentWrapperRef:W,isOpen:z,setIsOpen:F,activeAnchor:U,setActiveAnchor:K,border:X,opacity:Y})=>{const V=t.useRef(null),Z=t.useRef(null),G=t.useRef(null),J=t.useRef(null),[Q,ee]=t.useState(a),[te,oe]=t.useState({}),[re,ne]=t.useState({}),[le,se]=t.useState(!1),[ce,ie]=t.useState(!1),ae=t.useRef(!1),ue=t.useRef(null),{anchorRefs:de,setActiveAnchor:pe}=y(e),fe=t.useRef(!1),[ve,me]=t.useState([]),ye=t.useRef(!1),he=f||p.includes("click");h((()=>(ye.current=!0,()=>{ye.current=!1})),[]),t.useEffect((()=>{if(!le){const e=setTimeout((()=>{ie(!1)}),150);return()=>{clearTimeout(e)}}return()=>null}),[le]);const we=e=>{ye.current&&(e&&ie(!0),setTimeout((()=>{ye.current&&(null==F||F(e),void 0===z&&se(e))}),10))};t.useEffect((()=>{if(void 0===z)return()=>null;z&&ie(!0);const e=setTimeout((()=>{se(z)}),10);return()=>{clearTimeout(e)}}),[z]),t.useEffect((()=>{le!==ae.current&&(ae.current=le,le?null==H||H():null==M||M())}),[le]);const Ee=(e=x)=>{J.current&&clearTimeout(J.current),J.current=setTimeout((()=>{fe.current||we(!1)}),e)},Se=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 K(null),void pe({current:null});L?(G.current&&clearTimeout(G.current),G.current=setTimeout((()=>{we(!0)}),L)):we(!0),K(o),pe({current:o}),J.current&&clearTimeout(J.current)},be=()=>{$?Ee(x||100):x?Ee():we(!1),G.current&&clearTimeout(G.current)},ge=({x:e,y:t})=>{S({place:a,offset:u,elementReference:{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})},tooltipReference:V.current,tooltipArrowReference:Z.current,strategy:v,middlewares:m,border:X}).then((e=>{Object.keys(e.tooltipStyles).length&&oe(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&ne(e.tooltipArrowStyles),ee(e.place)}))},_e=e=>{if(!e)return;const t=e,o={x:t.clientX,y:t.clientY};ge(o),ue.current=o},Te=e=>{Se(e),x&&Ee()},Ae=e=>{var t;[document.querySelector(`[id='${c}']`),...ve].some((t=>null==t?void 0:t.contains(e.target)))||(null===(t=V.current)||void 0===t?void 0:t.contains(e.target))||(we(!1),G.current&&clearTimeout(G.current))},Re=d(Se,50,!0),Oe=d(be,50,!0);t.useEffect((()=>{var e,t;const o=new Set(de);ve.forEach((e=>{o.add({current:e})}));const r=document.querySelector(`[id='${c}']`);r&&o.add({current:r});const n=()=>{we(!1)},l=E(U),s=E(V.current);j&&(window.addEventListener("scroll",n),null==l||l.addEventListener("scroll",n),null==s||s.addEventListener("scroll",n)),B&&window.addEventListener("resize",n);const i=e=>{"Escape"===e.key&&we(!1)};I&&window.addEventListener("keydown",i);const a=[];he?(window.addEventListener("click",Ae),a.push({event:"click",listener:Te})):(a.push({event:"mouseenter",listener:Re},{event:"mouseleave",listener:Oe},{event:"focus",listener:Re},{event:"blur",listener:Oe}),N&&a.push({event:"mousemove",listener:_e}));const u=()=>{fe.current=!0},d=()=>{fe.current=!1,be()};return $&&!he&&(null===(e=V.current)||void 0===e||e.addEventListener("mouseenter",u),null===(t=V.current)||void 0===t||t.addEventListener("mouseleave",d)),a.forEach((({event:e,listener:t})=>{o.forEach((o=>{var r;null===(r=o.current)||void 0===r||r.addEventListener(e,t)}))})),()=>{var e,t;j&&(window.removeEventListener("scroll",n),null==l||l.removeEventListener("scroll",n),null==s||s.removeEventListener("scroll",n)),B&&window.removeEventListener("resize",n),he&&window.removeEventListener("click",Ae),I&&window.removeEventListener("keydown",i),$&&!he&&(null===(e=V.current)||void 0===e||e.removeEventListener("mouseenter",u),null===(t=V.current)||void 0===t||t.removeEventListener("mouseleave",d)),a.forEach((({event:e,listener:t})=>{o.forEach((o=>{var r;null===(r=o.current)||void 0===r||r.removeEventListener(e,t)}))}))}}),[ce,de,ve,I,p]),t.useEffect((()=>{let t=null!=i?i:"";!t&&e&&(t=`[data-tooltip-id='${e}']`);const o=new MutationObserver((o=>{const r=[];o.forEach((o=>{if("attributes"===o.type&&"data-tooltip-id"===o.attributeName){o.target.getAttribute("data-tooltip-id")===e&&r.push(o.target)}if("childList"===o.type&&(U&&[...o.removedNodes].some((e=>{var t;return!!(null===(t=null==e?void 0:e.contains)||void 0===t?void 0:t.call(e,U))&&(ie(!1),we(!1),K(null),G.current&&clearTimeout(G.current),J.current&&clearTimeout(J.current),!0)})),t))try{const e=[...o.addedNodes].filter((e=>1===e.nodeType));r.push(...e.filter((e=>e.matches(t)))),r.push(...e.flatMap((e=>[...e.querySelectorAll(t)])))}catch(e){}})),r.length&&me((e=>[...e,...r]))}));return o.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"]}),()=>{o.disconnect()}}),[e,i,U]);const Le=()=>{q?ge(q):N?ue.current&&ge(ue.current):S({place:a,offset:u,elementReference:U,tooltipReference:V.current,tooltipArrowReference:Z.current,strategy:v,middlewares:m,border:X}).then((e=>{ye.current&&(Object.keys(e.tooltipStyles).length&&oe(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&ne(e.tooltipArrowStyles),ee(e.place))}))};t.useEffect((()=>{Le()}),[le,U,P,D,a,u,v,q]),t.useEffect((()=>{if(!(null==W?void 0:W.current))return()=>null;const e=new ResizeObserver((()=>{Le()}));return e.observe(W.current),()=>{e.disconnect()}}),[P,null==W?void 0:W.current]),t.useEffect((()=>{var e;const t=document.querySelector(`[id='${c}']`),o=[...ve,t];U&&o.includes(U)||K(null!==(e=ve[0])&&void 0!==e?e:t)}),[c,ve,U]),t.useEffect((()=>()=>{G.current&&clearTimeout(G.current),J.current&&clearTimeout(J.current)}),[]),t.useEffect((()=>{let t=i;if(!t&&e&&(t=`[data-tooltip-id='${e}']`),t)try{const e=Array.from(document.querySelectorAll(t));me(e)}catch(e){me([])}}),[e,i]);const xe=!k&&P&&le&&Object.keys(te).length>0;return ce?l.default.createElement(w,{id:e,role:"tooltip",className:s.default("react-tooltip",b,O.tooltip,O[n],o,`react-tooltip__place-${Q}`,{[R]:xe,[g]:"fixed"===v,[A]:$}),style:{...D,...te,opacity:void 0!==Y&&xe?Y:void 0},ref:V},P,l.default.createElement(w,{className:s.default("react-tooltip-arrow",_,O.arrow,r,{[T]:C}),style:re,ref:Z})):null},x=({content:e})=>l.default.createElement("span",{dangerouslySetInnerHTML:{__html:e}});"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}.core-styles-module_tooltip__3vRRp{visibility:hidden;position:absolute;top:0;left:0;pointer-events:none;opacity:0;transition:opacity 0.3s ease-out;will-change:opacity,visibility}.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{visibility:visible;opacity:var(--rt-opacity)}`,type:"core"}),e.detail.disableBase||u({css:` | ||
.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px;transform:rotate(45deg)}.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=({id:e,anchorId:o,anchorSelect:r,content:n,html:s,render:c,className:i,classNameArrow:a,variant:u="dark",place:d="top",offset:p=10,wrapper:f="div",children:v=null,events:m=["hover"],openOnClick:h=!1,positionStrategy:w="absolute",middlewares:E,delayShow:S=0,delayHide:b=0,float:g=!1,hidden:_=!1,noArrow:T=!1,clickable:A=!1,closeOnEsc:R=!1,closeOnScroll:O=!1,closeOnResize:N=!1,style:k,position:C,isOpen:$,disableStyleInjection:I=!1,border:j,opacity:B,setIsOpen:D,afterShow:q,afterHide:H})=>{const[M,P]=t.useState(n),[W,z]=t.useState(s),[F,U]=t.useState(d),[K,X]=t.useState(u),[Y,V]=t.useState(p),[Z,G]=t.useState(S),[J,Q]=t.useState(b),[ee,te]=t.useState(g),[oe,re]=t.useState(_),[ne,le]=t.useState(f),[se,ce]=t.useState(m),[ie,ae]=t.useState(w),[ue,de]=t.useState(null),pe=t.useRef(I),{anchorRefs:fe,activeAnchor:ve}=y(e),me=e=>null==e?void 0:e.getAttributeNames().reduce(((t,o)=>{var r;if(o.startsWith("data-tooltip-")){t[o.replace(/^data-tooltip-/,"")]=null!==(r=null==e?void 0:e.getAttribute(o))&&void 0!==r?r:null}return t}),{}),ye=e=>{const t={place:e=>{var t;U(null!==(t=e)&&void 0!==t?t:d)},content:e=>{P(null!=e?e:n)},html:e=>{z(null!=e?e:s)},variant:e=>{var t;X(null!==(t=e)&&void 0!==t?t:u)},offset:e=>{V(null===e?p:Number(e))},wrapper:e=>{var t;le(null!==(t=e)&&void 0!==t?t:f)},events:e=>{const t=null==e?void 0:e.split(" ");ce(null!=t?t:m)},"position-strategy":e=>{var t;ae(null!==(t=e)&&void 0!==t?t:w)},"delay-show":e=>{G(null===e?S:Number(e))},"delay-hide":e=>{Q(null===e?b:Number(e))},float:e=>{te(null===e?g:"true"===e)},hidden:e=>{re(null===e?_:"true"===e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,o])=>{var r;null===(r=t[e])||void 0===r||r.call(t,o)}))};t.useEffect((()=>{P(n)}),[n]),t.useEffect((()=>{z(s)}),[s]),t.useEffect((()=>{U(d)}),[d]),t.useEffect((()=>{X(u)}),[u]),t.useEffect((()=>{V(p)}),[p]),t.useEffect((()=>{G(S)}),[S]),t.useEffect((()=>{Q(b)}),[b]),t.useEffect((()=>{te(g)}),[g]),t.useEffect((()=>{re(_)}),[_]),t.useEffect((()=>{ae(w)}),[w]),t.useEffect((()=>{pe.current!==I&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[I]),t.useEffect((()=>{"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:"core"===I,disableBase:I}}))}),[]),t.useEffect((()=>{var t;const n=new Set(fe);let l=r;if(!l&&e&&(l=`[data-tooltip-id='${e}']`),l)try{document.querySelectorAll(l).forEach((e=>{n.add({current:e})}))}catch(e){console.warn(`[react-tooltip] "${l}" is not a valid CSS selector`)}const s=document.querySelector(`[id='${o}']`);if(s&&n.add({current:s}),!n.size)return()=>null;const c=null!==(t=null!=ue?ue:s)&&void 0!==t?t:ve.current,i=new MutationObserver((e=>{e.forEach((e=>{var t;if(!c||"attributes"!==e.type||!(null===(t=e.attributeName)||void 0===t?void 0:t.startsWith("data-tooltip-")))return;const o=me(c);ye(o)}))})),a={attributes:!0,childList:!1,subtree:!1};if(c){const e=me(c);ye(e),i.observe(c,a)}return()=>{i.disconnect()}}),[fe,ve,ue,o,r]),t.useEffect((()=>{(null==k?void 0:k.border)&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),j&&!CSS.supports("border",`${j}`)&&console.warn(`[react-tooltip] "${j}" is not a valid \`border\`.`),(null==k?void 0:k.opacity)&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),B&&!CSS.supports("opacity",`${B}`)&&console.warn(`[react-tooltip] "${B}" is not a valid \`opacity\`.`)}),[]);let he=v;const we=t.useRef(null);if(c){const e=c({content:null!=M?M:null,activeAnchor:ue});he=e?l.default.createElement("div",{ref:we,className:"react-tooltip-content-wrapper"},e):null}else M&&(he=M);W&&(he=l.default.createElement(x,{content:W}));const Ee={id:e,anchorId:o,anchorSelect:r,className:i,classNameArrow:a,content:he,contentWrapperRef:we,place:F,variant:K,offset:Y,wrapper:ne,events:se,openOnClick:h,positionStrategy:ie,middlewares:E,delayShow:Z,delayHide:J,float:ee,hidden:oe,noArrow:T,clickable:A,closeOnEsc:R,closeOnScroll:O,closeOnResize:N,style:k,position:C,isOpen:$,border:j,opacity:B,setIsOpen:D,afterShow:q,afterHide:H,activeAnchor:ue,setActiveAnchor:e=>de(e)};return l.default.createElement(L,{...Ee})},e.TooltipProvider=({children:e})=>{const[o,r]=t.useState({[p]:new Set}),[n,s]=t.useState({[p]:{current:null}}),c=(e,...t)=>{r((o=>{var r;const n=null!==(r=o[e])&&void 0!==r?r:new Set;return t.forEach((e=>n.add(e))),{...o,[e]:new Set(n)}}))},i=(e,...t)=>{r((o=>{const r=o[e];return r?(t.forEach((e=>r.delete(e))),{...o}):o}))},a=t.useCallback(((e=p)=>{var t,r;return{anchorRefs:null!==(t=o[e])&&void 0!==t?t:new Set,activeAnchor:null!==(r=n[e])&&void 0!==r?r:{current:null},attach:(...t)=>c(e,...t),detach:(...t)=>i(e,...t),setActiveAnchor:t=>((e,t)=>{s((o=>{var r;return(null===(r=o[e])||void 0===r?void 0:r.current)===t.current?o:{...o,[e]:t}}))})(e,t)}}),[o,n,c,i]),u=t.useMemo((()=>({getTooltipData:a})),[a]);return l.default.createElement(m.Provider,{value:u},e)},e.TooltipWrapper=({tooltipId:e,children:o,className:r,place:n,content:c,html:i,variant:a,offset:u,wrapper:d,events:p,positionStrategy:f,delayShow:v,delayHide:m})=>{const{attach:h,detach:w}=y(e),E=t.useRef(null);return t.useEffect((()=>(h(E),()=>{w(E)})),[]),l.default.createElement("span",{ref:E,className:s.default("react-tooltip-wrapper",r),"data-tooltip-place":n,"data-tooltip-content":c,"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=c);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})})); |
{ | ||
"name": "react-tooltip", | ||
"version": "5.19.0-beta.1052.0", | ||
"version": "5.19.0", | ||
"description": "react tooltip component", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -31,3 +31,3 @@ # react-tooltip | ||
[![Edit ReactTooltip](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/still-monad-yfi4fn?fontsize=14&hidenavigation=1&theme=dark) | ||
[![Edit ReactTooltip](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/gallant-leftpad-8kvtn7?file=/src/App.js) | ||
@@ -34,0 +34,0 @@ Documentation for V4 - [Github Page](https://reacttooltip.github.io/react-tooltip/). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
695576
4306
2
13