@aotearoan/neon
Version:
Neon is a lightweight design library of Vue 3 components with minimal dependencies.
3 lines (2 loc) • 911 B
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class c{static calculateAvailableSpace(e,o,i,n){const t=e.getBoundingClientRect(),a={top:t.top,bottom:i-t.bottom,left:t.left,right:o-t.right};if(n){const h=n.getBoundingClientRect(),l={top:Math.max(t.top-h.top,0),bottom:Math.max(h.bottom-t.bottom,0),left:Math.max(t.left-h.left,0),right:Math.max(h.right-t.right,0)};return{top:Math.min(a.top,l.top),bottom:Math.min(a.bottom,l.bottom),left:Math.min(a.left,l.left),right:Math.min(a.right,l.right)}}return a}static calculateBounds(e){const o=document.documentElement,i=document.body.getBoundingClientRect(),n=i.height+i.y,t=i.width+i.x;return{maxWidth:e?Math.min(e.offsetWidth,o.clientWidth,t):Math.min(o.clientWidth,t),maxHeight:e?Math.min(e.offsetHeight,o.clientHeight,n):Math.min(o.clientHeight,n)}}}exports.NeonPlacementUtils=c;
//# sourceMappingURL=NeonPlacementUtils.cjs.js.map