@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.2 kB
JavaScript
;var t=require("./Dropdown.constant.cjs");exports.getDropdownPosition=O=>{const{position:e,dropdownHeight:r,dropdownWidth:D,triggerHeight:P,triggerWidth:o,triggerTop:N,triggerLeft:W}=O;switch(e){case t.DROPDOWN_POSITION["top-left"]:return{top:N-r-t.DROPDOWN_GAP,left:W};case t.DROPDOWN_POSITION["top-right"]:return{top:N-r-t.DROPDOWN_GAP,left:W+o-D};case t.DROPDOWN_POSITION["right-top"]:return{top:N,left:W+o+t.DROPDOWN_GAP};case t.DROPDOWN_POSITION["right-center"]:return{top:N+P/2-r/2,left:W+o+t.DROPDOWN_GAP};case t.DROPDOWN_POSITION["right-bottom"]:return{top:N+P-r,left:W+o+t.DROPDOWN_GAP};case t.DROPDOWN_POSITION["bottom-left"]:return{top:N+P+t.DROPDOWN_GAP,left:W};case t.DROPDOWN_POSITION["bottom-center"]:return{top:N+P+t.DROPDOWN_GAP,left:W+o/2-D/2};case t.DROPDOWN_POSITION["bottom-right"]:return{top:N+P+t.DROPDOWN_GAP,left:W+o-D};case t.DROPDOWN_POSITION["left-top"]:return{top:N,left:W-D-t.DROPDOWN_GAP};case t.DROPDOWN_POSITION["left-center"]:return{top:N+P/2-r/2,left:W-D-t.DROPDOWN_GAP};case t.DROPDOWN_POSITION["left-bottom"]:return{top:N+P-r,left:W-D-t.DROPDOWN_GAP};default:return{top:N-r-t.DROPDOWN_GAP,left:W+o/2-D/2}}};
//# sourceMappingURL=Dropdown.helper.cjs.map