4 lines
1.9 KiB
JavaScript
4 lines
1.9 KiB
JavaScript
/*! NanoPop 2.4.2 MIT | https://github.com/Simonwep/nanopop */
|
|
(function(i,l){typeof exports=="object"&&typeof module<"u"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(i=typeof globalThis<"u"?globalThis:i||self,l(i.NanoPop={}))})(this,function(i){"use strict";const l="2.4.2",O={variantFlipOrder:{start:"sme",middle:"mse",end:"ems"},positionFlipOrder:{top:"tbrl",right:"rltb",bottom:"btrl",left:"lrbt"},position:"bottom",margin:8,padding:0},B=(s,e,u)=>{const{container:a,arrow:c,margin:n,padding:f,position:j,variantFlipOrder:F,positionFlipOrder:K}={container:document.documentElement.getBoundingClientRect(),...O,...u},{left:R,top:$}=e.style;e.style.left="0",e.style.top="0";const t=s.getBoundingClientRect(),o=e.getBoundingClientRect(),E={t:t.top-o.height-n,b:t.bottom+n,r:t.right+n,l:t.left-o.width-n},L={vs:t.left,vm:t.left+t.width/2-o.width/2,ve:t.left+t.width-o.width,hs:t.top,hm:t.bottom-t.height/2-o.height/2,he:t.bottom-o.height},[z,H="middle"]=j.split("-"),N=K[z],k=F[H],{top:S,left:P,bottom:M,right:V}=a;for(const d of N){const r=d==="t"||d==="b";let p=E[d];const[g,b]=r?["top","left"]:["left","top"],[v,y]=r?[o.height,o.width]:[o.width,o.height],[q,A]=r?[M,V]:[V,M],[D,G]=r?[S,P]:[P,S];if(!(p<D||p+v+f>q))for(const w of k){let h=L[(r?"v":"h")+w];if(!(h<G||h+y+f>A)){if(h-=o[b],p-=o[g],e.style[b]=`${h}px`,e.style[g]=`${p}px`,c){const x=r?t.width/2:t.height/2,m=y/2,C=x>m,I={s:C?m:x,m,e:C?m:y-x},J={t:v,b:0,r:0,l:v},Q=h+I[w],U=p+J[d];c.style[b]=`${Q}px`,c.style[g]=`${U}px`}return d+w}}}return e.style.left=R,e.style.top=$,null},T=(s,e,u)=>{const a=typeof s=="object"&&!(s instanceof HTMLElement)?s:{reference:s,popper:e,...u};return{update(c=a){const{reference:n,popper:f}=Object.assign(a,c);if(!f||!n)throw new Error("Popper- or reference-element missing.");return B(n,f,a)}}};i.createPopper=T,i.defaults=O,i.reposition=B,i.version=l,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|
|
//# sourceMappingURL=nanopop.umd.js.map
|