Initial commit
This commit is contained in:
1
wwwroot/lib/popper.js/esm/utils/computeOffsets.min.js
vendored
Normal file
1
wwwroot/lib/popper.js/esm/utils/computeOffsets.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import getBasePlacement from"./getBasePlacement.js";import getVariation from"./getVariation.js";import getMainAxisFromPlacement from"./getMainAxisFromPlacement.js";import{top,right,bottom,left,start,end}from"../enums.js";export default function computeOffsets(e){var t,a=e.reference,i=e.element,e=e.placement,r=e?getBasePlacement(e):null,e=e?getVariation(e):null,n=a.x+a.width/2-i.width/2,m=a.y+a.height/2-i.height/2;switch(r){case top:t={x:n,y:a.y-i.height};break;case bottom:t={x:n,y:a.y+a.height};break;case right:t={x:a.x+a.width,y:m};break;case left:t={x:a.x-i.width,y:m};break;default:t={x:a.x,y:a.y}}var o=r?getMainAxisFromPlacement(r):null;if(null!=o){var s="y"===o?"height":"width";switch(e){case start:t[o]=t[o]-(a[s]/2-i[s]/2);break;case end:t[o]=t[o]+(a[s]/2-i[s]/2)}}return t}
|
||||
Reference in New Issue
Block a user