@progress/kendo-react-tooltip
Version:
React Tooltips library represents popups with information that is related to a UI element. KendoReact Tooltips package
9 lines (8 loc) • 1.71 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=10,n=10,p=(i,o,r,s,u)=>{switch(u){case"bottom":return s==="pointer"?i-o/2:r.left-o/2+r.width/2;case"left":return s==="pointer"?i-o-t:r.left-o-t;case"right":return s==="pointer"?i+t:r.right+t;case"top":return s==="pointer"?i-o/2:r.left-o/2+r.width/2;default:return s==="pointer"?i<window.screen.availWidth/2?i-t:i-o+t:i<window.screen.availWidth/2?r.left:r.right-o}},w=(i,o,r,s,u)=>{switch(u){case"bottom":return s==="pointer"?i+n:o.bottom+n;case"left":return s==="pointer"?i-r/2:o.top-r/2+o.height/2;case"right":return s==="pointer"?i-r/2:o.top-r/2+o.height/2;case"top":return s==="pointer"?i-r-n:o.top-r-n;default:return s==="pointer"?i<window.innerHeight/2?i+t:i-r-t:i<window.innerHeight/2?o.bottom+n:o.top-r-n}},d=i=>i!==null?i.getBoundingClientRect():document.body.getBoundingClientRect(),c=["k-tooltip-content","k-animation-container","k-tooltip","k-tooltip-title","k-tooltip k-tooltip-closable","k-icon k-i-close"],f=i=>{if(i===null)return!1;let o=i;for(;o;){if(o!==null&&o.classList&&o.classList.contains("k-tooltip"))return!0;o.parentNode!==null?o=o.parentNode:o=!1}return c.filter(r=>r===i.className).length>0};exports.getDomRect=d;exports.getLeftPosition=p;exports.getTopPosition=w;exports.isTooltipElement=f;exports.toolTipSelectors=c;