@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) • 883 B
JavaScript
import{DROPDOWN_GAP as t,DROPDOWN_POSITION as e}from"./Dropdown.constant.js";const r=r=>{const{position:o,dropdownHeight:n,dropdownWidth:p,triggerHeight:f,triggerWidth:c,triggerTop:l,triggerLeft:i}=r;switch(o){case e["top-left"]:return{top:l-n-t,left:i};case e["top-right"]:return{top:l-n-t,left:i+c-p};case e["right-top"]:return{top:l,left:i+c+t};case e["right-center"]:return{top:l+f/2-n/2,left:i+c+t};case e["right-bottom"]:return{top:l+f-n,left:i+c+t};case e["bottom-left"]:return{top:l+f+t,left:i};case e["bottom-center"]:return{top:l+f+t,left:i+c/2-p/2};case e["bottom-right"]:return{top:l+f+t,left:i+c-p};case e["left-top"]:return{top:l,left:i-p-t};case e["left-center"]:return{top:l+f/2-n/2,left:i-p-t};case e["left-bottom"]:return{top:l+f-n,left:i-p-t};default:return{top:l-n-t,left:i+c/2-p/2}}};export{r as getDropdownPosition};
//# sourceMappingURL=Dropdown.helper.js.map