fix clone
This commit is contained in:
1 parent
82ee9d2dcf
commit
9a5ad32315
33 files changed
+654
-496
No files matched your search
@@ -1,4 +1,4 @@
|
||||
var Ht=Math.min,vt=Math.max,Wt=Math.round;var st=i=>({x:i,y:i}),Ji={left:"right",right:"left",bottom:"top",top:"bottom"};function Ce(i,t,e){return vt(i,Ht(t,e))}function Vt(i,t){return typeof i=="function"?i(t):i}function yt(i){return i.split("-")[0]}function zt(i){return i.split("-")[1]}function Le(i){return i==="x"?"y":"x"}function Ie(i){return i==="y"?"height":"width"}function ut(i){let t=i[0];return t==="t"||t==="b"?"y":"x"}function Te(i){return Le(ut(i))}function Ze(i,t,e){e===void 0&&(e=!1);let n=zt(i),o=Te(i),s=Ie(o),r=o==="x"?n===(e?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=Ft(r)),[r,Ft(r)]}function ti(i){let t=Ft(i);return[oe(i),t,oe(t)]}function oe(i){return i.includes("start")?i.replace("start","end"):i.replace("end","start")}var Je=["left","right"],Qe=["right","left"],Qi=["top","bottom"],Zi=["bottom","top"];function tn(i,t,e){switch(i){case"top":case"bottom":return e?t?Qe:Je:t?Je:Qe;case"left":case"right":return t?Qi:Zi;default:return[]}}function ei(i,t,e,n){let o=zt(i),s=tn(yt(i),e==="start",n);return o&&(s=s.map(r=>r+"-"+o),t&&(s=s.concat(s.map(oe)))),s}function Ft(i){let t=yt(i);return Ji[t]+i.slice(t.length)}function en(i){return{top:0,right:0,bottom:0,left:0,...i}}function ii(i){return typeof i!="number"?en(i):{top:i,right:i,bottom:i,left:i}}function Et(i){let{x:t,y:e,width:n,height:o}=i;return{width:n,height:o,top:e,left:t,right:t+n,bottom:e+o,x:t,y:e}}function ni(i,t,e){let{reference:n,floating:o}=i,s=ut(t),r=Te(t),a=Ie(r),l=yt(t),c=s==="y",h=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,f=n[a]/2-o[a]/2,p;switch(l){case"top":p={x:h,y:n.y-o.height};break;case"bottom":p={x:h,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-o.width,y:d};break;default:p={x:n.x,y:n.y}}switch(zt(t)){case"start":p[r]-=f*(e&&c?-1:1);break;case"end":p[r]+=f*(e&&c?-1:1);break}return p}async function oi(i,t){var e;t===void 0&&(t={});let{x:n,y:o,platform:s,rects:r,elements:a,strategy:l}=i,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Vt(t,i),g=ii(p),x=a[f?d==="floating"?"reference":"floating":d],D=Et(await s.getClippingRect({element:(e=await(s.isElement==null?void 0:s.isElement(x)))==null||e?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),w=d==="floating"?{x:n,y:o,width:r.floating.width,height:r.floating.height}:r.reference,A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),O=await(s.isElement==null?void 0:s.isElement(A))?await(s.getScale==null?void 0:s.getScale(A))||{x:1,y:1}:{x:1,y:1},_=Et(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:A,strategy:l}):w);return{top:(D.top-_.top+g.top)/O.y,bottom:(_.bottom-D.bottom+g.bottom)/O.y,left:(D.left-_.left+g.left)/O.x,right:(_.right-D.right+g.right)/O.x}}var nn=50,si=async(i,t,e)=>{let{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=e,a=r.detectOverflow?r:{...r,detectOverflow:oi},l=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:i,floating:t,strategy:o}),{x:h,y:d}=ni(c,n,l),f=n,p=0,g={};for(let m=0;m<s.length;m++){let x=s[m];if(!x)continue;let{name:D,fn:w}=x,{x:A,y:O,data:_,reset:C}=await w({x:h,y:d,initialPlacement:n,placement:f,strategy:o,middlewareData:g,rects:c,platform:a,elements:{reference:i,floating:t}});h=A??h,d=O??d,g[D]={...g[D],..._},C&&p<nn&&(p++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(c=C.rects===!0?await r.getElementRects({reference:i,floating:t,strategy:o}):C.rects),{x:h,y:d}=ni(c,f,l)),m=-1)}return{x:h,y:d,placement:f,strategy:o,middlewareData:g}};var ri=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(t){var e,n;let{placement:o,middlewareData:s,rects:r,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...x}=Vt(i,t);if((e=s.arrow)!=null&&e.alignmentOffset)return{};let D=yt(o),w=ut(a),A=yt(a)===a,O=await(l.isRTL==null?void 0:l.isRTL(c.floating)),_=f||(A||!m?[Ft(a)]:ti(a)),C=g!=="none";!f&&C&&_.push(...ei(a,m,g,O));let J=[a,..._],Q=await l.detectOverflow(t,x),R=[],z=((n=s.flip)==null?void 0:n.overflows)||[];if(h&&R.push(Q[D]),d){let P=Ze(o,r,O);R.push(Q[P[0]],Q[P[1]])}if(z=[...z,{placement:o,overflows:R}],!R.every(P=>P<=0)){var Y,N;let P=(((Y=s.flip)==null?void 0:Y.index)||0)+1,et=J[P];if(et&&(!(d==="alignment"?w!==ut(et):!1)||z.every(k=>ut(k.placement)===w?k.overflows[0]>0:!0)))return{data:{index:P,overflows:z},reset:{placement:et}};let W=(N=z.filter($=>$.overflows[0]<=0).sort(($,k)=>$.overflows[1]-k.overflows[1])[0])==null?void 0:N.placement;if(!W)switch(p){case"bestFit":{var H;let $=(H=z.filter(k=>{if(C){let K=ut(k.placement);return K===w||K==="y"}return!0}).map(k=>[k.placemenLine truncated
|
||||
var Vt=Math.min,yt=Math.max,$t=Math.round;var st=i=>({x:i,y:i}),tn={left:"right",right:"left",bottom:"top",top:"bottom"};function Ce(i,t,e){return yt(i,Vt(t,e))}function zt(i,t){return typeof i=="function"?i(t):i}function wt(i){return i.split("-")[0]}function Kt(i){return i.split("-")[1]}function Le(i){return i==="x"?"y":"x"}function Ie(i){return i==="y"?"height":"width"}function ut(i){let t=i[0];return t==="t"||t==="b"?"y":"x"}function Te(i){return Le(ut(i))}function Ze(i,t,e){e===void 0&&(e=!1);let n=Kt(i),o=Te(i),s=Ie(o),r=o==="x"?n===(e?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=Wt(r)),[r,Wt(r)]}function ti(i){let t=Wt(i);return[oe(i),t,oe(t)]}function oe(i){return i.includes("start")?i.replace("start","end"):i.replace("end","start")}var Je=["left","right"],Qe=["right","left"],en=["top","bottom"],nn=["bottom","top"];function on(i,t,e){switch(i){case"top":case"bottom":return e?t?Qe:Je:t?Je:Qe;case"left":case"right":return t?en:nn;default:return[]}}function ei(i,t,e,n){let o=Kt(i),s=on(wt(i),e==="start",n);return o&&(s=s.map(r=>r+"-"+o),t&&(s=s.concat(s.map(oe)))),s}function Wt(i){let t=wt(i);return tn[t]+i.slice(t.length)}function sn(i){return{top:0,right:0,bottom:0,left:0,...i}}function ii(i){return typeof i!="number"?sn(i):{top:i,right:i,bottom:i,left:i}}function Ot(i){let{x:t,y:e,width:n,height:o}=i;return{width:n,height:o,top:e,left:t,right:t+n,bottom:e+o,x:t,y:e}}function ni(i,t,e){let{reference:n,floating:o}=i,s=ut(t),r=Te(t),a=Ie(r),l=wt(t),c=s==="y",h=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,f=n[a]/2-o[a]/2,p;switch(l){case"top":p={x:h,y:n.y-o.height};break;case"bottom":p={x:h,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-o.width,y:d};break;default:p={x:n.x,y:n.y}}switch(Kt(t)){case"start":p[r]-=f*(e&&c?-1:1);break;case"end":p[r]+=f*(e&&c?-1:1);break}return p}async function oi(i,t){var e;t===void 0&&(t={});let{x:n,y:o,platform:s,rects:r,elements:a,strategy:l}=i,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=zt(t,i),g=ii(p),x=a[f?d==="floating"?"reference":"floating":d],D=Ot(await s.getClippingRect({element:(e=await(s.isElement==null?void 0:s.isElement(x)))==null||e?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),w=d==="floating"?{x:n,y:o,width:r.floating.width,height:r.floating.height}:r.reference,A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),O=await(s.isElement==null?void 0:s.isElement(A))?await(s.getScale==null?void 0:s.getScale(A))||{x:1,y:1}:{x:1,y:1},N=Ot(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:A,strategy:l}):w);return{top:(D.top-N.top+g.top)/O.y,bottom:(N.bottom-D.bottom+g.bottom)/O.y,left:(D.left-N.left+g.left)/O.x,right:(N.right-D.right+g.right)/O.x}}var rn=50,si=async(i,t,e)=>{let{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=e,a=r.detectOverflow?r:{...r,detectOverflow:oi},l=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:i,floating:t,strategy:o}),{x:h,y:d}=ni(c,n,l),f=n,p=0,g={};for(let m=0;m<s.length;m++){let x=s[m];if(!x)continue;let{name:D,fn:w}=x,{x:A,y:O,data:N,reset:L}=await w({x:h,y:d,initialPlacement:n,placement:f,strategy:o,middlewareData:g,rects:c,platform:a,elements:{reference:i,floating:t}});h=A??h,d=O??d,g[D]={...g[D],...N},L&&p<rn&&(p++,typeof L=="object"&&(L.placement&&(f=L.placement),L.rects&&(c=L.rects===!0?await r.getElementRects({reference:i,floating:t,strategy:o}):L.rects),{x:h,y:d}=ni(c,f,l)),m=-1)}return{x:h,y:d,placement:f,strategy:o,middlewareData:g}};var ri=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(t){var e,n;let{placement:o,middlewareData:s,rects:r,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...x}=zt(i,t);if((e=s.arrow)!=null&&e.alignmentOffset)return{};let D=wt(o),w=ut(a),A=wt(a)===a,O=await(l.isRTL==null?void 0:l.isRTL(c.floating)),N=f||(A||!m?[Wt(a)]:ti(a)),L=g!=="none";!f&&L&&N.push(...ei(a,m,g,O));let J=[a,...N],Q=await l.detectOverflow(t,x),M=[],W=((n=s.flip)==null?void 0:n.overflows)||[];if(h&&M.push(Q[D]),d){let C=Ze(o,r,O);M.push(Q[C[0]],Q[C[1]])}if(W=[...W,{placement:o,overflows:M}],!M.every(C=>C<=0)){var z,et;let C=(((z=s.flip)==null?void 0:z.index)||0)+1,K=J[C];if(K&&(!(d==="alignment"?w!==ut(K):!1)||W.every(k=>ut(k.placement)===w?k.overflows[0]>0:!0)))return{data:{index:C,overflows:W},reset:{placement:K}};let P=(et=W.filter(X=>X.overflows[0]<=0).sort((X,k)=>X.overflows[1]-k.overflows[1])[0])==null?void 0:et.placement;if(!P)switch(p){case"bestFit":{var V;let X=(V=W.filter(k=>{if(L){let U=ut(k.placement);return U===w||U==="y"}return!0}).map(k=>[k.placementLine truncated
|
||||
/*! Bundled license information:
|
||||
|
||||
sortablejs/modular/sortable.esm.js:
|
||||
|
||||
Reference in new issue
Block a user