errrr
This commit is contained in:
1 parent
99ae905cb0
commit
3e0c5d2ecc
114 files changed
+9278
-929
No files matched your search
@@ -0,0 +1 @@
|
||||
(()=>{var V=Math.min,S=Math.max,X=Math.round,U=Math.floor,T=t=>({x:t,y:t}),Ht={left:"right",right:"left",bottom:"top",top:"bottom"},zt={start:"end",end:"start"};function ot(t,e,n){return S(t,V(e,n))}function q(t,e){return typeof t=="function"?t(e):t}function L(t){return t.split("-")[0]}function J(t){return t.split("-")[1]}function it(t){return t==="x"?"y":"x"}function st(t){return t==="y"?"height":"width"}function K(t){return["top","bottom"].includes(L(t))?"y":"x"}function rt(t){return it(K(t))}function pt(t,e,n){n===void 0&&(n=!1);let o=J(t),i=rt(t),s=st(i),r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=$(r)),[r,$(r)]}function xt(t){let e=$(t);return[tt(t),e,tt(e)]}function tt(t){return t.replace(/start|end/g,e=>zt[e])}function It(t,e,n){let o=["left","right"],i=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?s:r;default:return[]}}function wt(t,e,n,o){let i=J(t),s=It(L(t),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(tt)))),s}function $(t){return t.replace(/left|right|bottom|top/g,e=>Ht[e])}function jt(t){return{top:0,right:0,bottom:0,left:0,...t}}function yt(t){return typeof t!="number"?jt(t):{top:t,right:t,bottom:t,left:t}}function _(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function vt(t,e,n){let{reference:o,floating:i}=t,s=K(e),r=rt(e),c=st(r),l=L(e),f=s==="y",m=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,p=o[c]/2-i[c]/2,a;switch(l){case"top":a={x:m,y:o.y-i.height};break;case"bottom":a={x:m,y:o.y+o.height};break;case"right":a={x:o.x+o.width,y:u};break;case"left":a={x:o.x-i.width,y:u};break;default:a={x:o.x,y:o.y}}switch(J(e)){case"start":a[r]-=p*(n&&f?-1:1);break;case"end":a[r]+=p*(n&&f?-1:1);break}return a}var bt=async(t,e,n)=>{let{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,c=s.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(e)),f=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:m,y:u}=vt(f,o,l),p=o,a={},d=0;for(let g=0;g<c.length;g++){let{name:x,fn:h}=c[g],{x:w,y,data:O,reset:v}=await h({x:m,y:u,initialPlacement:o,placement:p,strategy:i,middlewareData:a,rects:f,platform:r,elements:{reference:t,floating:e}});if(m=w??m,u=y??u,a={...a,[x]:{...a[x],...O}},v&&d<=50){d++,typeof v=="object"&&(v.placement&&(p=v.placement),v.rects&&(f=v.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):v.rects),{x:m,y:u}=vt(f,p,l)),g=-1;continue}}return{x:m,y:u,placement:p,strategy:i,middlewareData:a}};async function ct(t,e){var n;e===void 0&&(e={});let{x:o,y:i,platform:s,rects:r,elements:c,strategy:l}=t,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:u="floating",altBoundary:p=!1,padding:a=0}=q(e,t),d=yt(a),x=c[p?u==="floating"?"reference":"floating":u],h=_(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:f,rootBoundary:m,strategy:l})),w=u==="floating"?{...r.floating,x:o,y:i}:r.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),O=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},v=_(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:y,strategy:l}):w);return{top:(h.top-v.top+d.top)/O.y,bottom:(v.bottom-h.bottom+d.bottom)/O.y,left:(h.left-v.left+d.left)/O.x,right:(v.right-h.right+d.right)/O.x}}var lt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;let{placement:i,middlewareData:s,rects:r,initialPlacement:c,platform:l,elements:f}=e,{mainAxis:m=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:a="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:g=!0,...x}=q(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};let h=L(i),w=L(c)===c,y=await(l.isRTL==null?void 0:l.isRTL(f.floating)),O=p||(w||!g?[$(c)]:xt(c));!p&&d!=="none"&&O.push(...wt(c,g,d,y));let v=[c,...O],D=await ct(e,x),Z=[],I=((o=s.flip)==null?void 0:o.overflows)||[];if(m&&Z.push(D[h]),u){let k=pt(i,r,y);Z.push(D[k[0]],D[k[1]])}if(I=[...I,{placement:i,overflows:Z}],!Z.every(k=>k<=0)){var dt,mt;let k=(((dt=s.flip)==null?void 0:dt.index)||0)+1,ht=v[k];if(ht)return{data:{index:k,overflows:I},reset:{placement:ht}};let j=(mt=I.filter(B=>B.overflows[0]<=0).sort((B,F)=>B.overflows[1]-F.overflows[1])[0])==null?void 0:mt.placement;if(!j)switch(a){case"bestFit":{var gt;let B=(gt=I.map(F=>[F.placement,F.overflows.filter(Y=>Y>0).reduce((Y,Wt)=>Y+Wt,0)]).sort((F,Y)=>F[1]-Y[1])[0])==null?void 0:gt[0];B&&(j=B);break}case"initialPlacement":j=c;break}if(i!==j)return{reset:{placement:j}}}return{}}}};async function Yt(t,e){let{placement:n,platform:o,elements:i}=t,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),rLine truncated
|
||||
Reference in new issue
Block a user