123 |
- /*! NanoPop 2.2.0 MIT | https://github.com/Simonwep/nanopop */
- const t="2.2.0",e={variantFlipOrder:{start:"sme",middle:"mse",end:"ems"},positionFlipOrder:{top:"tbrl",right:"rltb",bottom:"btrl",left:"lrbt"},position:"bottom",margin:8,padding:0},r=(t,r,o)=>{const{container:n,margin:i,padding:p,position:s,variantFlipOrder:l,positionFlipOrder:c}={container:document.documentElement.getBoundingClientRect(),...e,...o},{left:f,top:m}=r.style;r.style.left="0",r.style.top="0";const d=t.getBoundingClientRect(),a=r.getBoundingClientRect(),b={t:d.top-a.height-i,b:d.bottom+i,r:d.right+i,l:d.left-a.width-i},g={vs:d.left,vm:d.left+d.width/2+-a.width/2,ve:d.left+d.width-a.width,hs:d.top,hm:d.bottom-d.height/2-a.height/2,he:d.bottom-a.height},[h,u="middle"]=s.split("-"),v=c[h],O=l[u],{top:F,left:x,bottom:j,right:w}=n;for(const t of v){const e="t"===t||"b"===t,o=b[t],[n,i]=e?["top","left"]:["left","top"],[s,l]=e?[a.height,a.width]:[a.width,a.height],[c,f]=e?[j,w]:[w,j],[m,d]=e?[F,x]:[x,F];if(!(o<m||o+s+p>c))for(const s of O){const c=g[(e?"v":"h")+s];if(!(c<d||c+l+p>f))return r.style[i]=c-a[i]+"px",r.style[n]=o-a[n]+"px",t+s}}return r.style.left=f,r.style.top=m,null},o=(t,e,o)=>{const n="object"!=typeof t||t instanceof HTMLElement?{reference:t,popper:e,...o}:t;return{update(t=n){const{reference:e,popper:o}=Object.assign(n,t);if(!o||!e)throw new Error("Popper- or reference-element missing.");return r(e,o,n)}}};export{o as createPopper,e as defaults,r as reposition,t as version};
- //# sourceMappingURL=nanopop.min.mjs.map
|