@legion-ui-kit/react-core
Version:
<div align="center"> <img height="108" width="116" src="https://legion.digitaltelkom.id/favicon.svg?v=4643a71fb65fa61a5f2b266b769ea7b1" /> <h1 align="center">Legion UI Kit - React Core</h1> </div>
3 lines (2 loc) • 1 kB
JavaScript
;var t=require("./Tooltip.constant.cjs");exports.getTooltipPosition=e=>{const{position:O,tooltipHeight:o,tooltipWidth:r,targetHeight:T,targetWidth:I,targetTop:p,targetLeft:P}=e;switch(O){case t.TOOLTIP_POSITION["top-left"]:return{top:p-o,left:P};case t.TOOLTIP_POSITION["top-right"]:return{top:p-o,left:P+I-r};case t.TOOLTIP_POSITION["right-top"]:return{top:p,left:P+I};case t.TOOLTIP_POSITION["right-center"]:return{top:p+T/2-o/2,left:P+I};case t.TOOLTIP_POSITION["right-bottom"]:return{top:p+T-o,left:P+I};case t.TOOLTIP_POSITION["bottom-left"]:return{top:p+T,left:P};case t.TOOLTIP_POSITION["bottom-center"]:return{top:p+T,left:P+I/2-r/2};case t.TOOLTIP_POSITION["bottom-right"]:return{top:p+T,left:P+I-r};case t.TOOLTIP_POSITION["left-top"]:return{top:p,left:P-r};case t.TOOLTIP_POSITION["left-center"]:return{top:p+T/2-o/2,left:P-r};case t.TOOLTIP_POSITION["left-bottom"]:return{top:p+T-o,left:P-r};default:return{top:p-o,left:P+I/2-r/2}}};
//# sourceMappingURL=Tooltip.helper.cjs.map