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),S=a[f?d==="floating"?"reference":"floating":d],D=Et(await s.getClippingRect({element:(e=await(s.isElement==null?void 0:s.isElement(S)))==null||e?S:S.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 S=s[m];if(!S)continue;let{name:D,fn:w}=S,{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,...S}=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 q=[a,..._],J=await l.detectOverflow(t,S),R=[],$=((n=s.flip)==null?void 0:n.overflows)||[];if(h&&R.push(J[D]),d){let B=Ze(o,r,O);R.push(J[B[0]],J[B[1]])}if($=[...$,{placement:o,overflows:R}],!R.every(B=>B<=0)){var X,et;let B=(((X=s.flip)==null?void 0:X.index)||0)+1,Q=q[B];if(Q&&(!(d==="alignment"?w!==ut(Q):!1)||$.every(P=>ut(P.placement)===w?P.overflows[0]>0:!0)))return{data:{index:B,overflows:$},reset:{placement:Q}};let F=(et=$.filter(W=>W.overflows[0]<=0).sort((W,P)=>W.overflows[1]-P.overflows[1])[0])==null?void 0:et.placement;if(!F)switch(p){case"bestFit":{var H;let W=(H=$.filter(P=>{if(C){let V=ut(P.placement);return V===w||V==="y"}return!0}).map(P=>[P.placementLine truncated
|
||||
var zt=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,zt(t,e))}function Kt(i,t){return typeof i=="function"?i(t):i}function wt(i){return i.split("-")[0]}function Xt(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=Xt(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=Vt(r)),[r,Vt(r)]}function ti(i){let t=Vt(i);return[se(i),t,se(t)]}function se(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=Xt(i),s=on(wt(i),e==="start",n);return o&&(s=s.map(r=>r+"-"+o),t&&(s=s.concat(s.map(se)))),s}function Vt(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(Xt(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}=Kt(t,i),g=ii(p),S=a[f?d==="floating"?"reference":"floating":d],D=Ot(await s.getClippingRect({element:(e=await(s.isElement==null?void 0:s.isElement(S)))==null||e?S:S.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},_=Ot(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 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 S=s[m];if(!S)continue;let{name:D,fn:w}=S,{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<rn&&(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,...S}=Kt(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)),_=f||(A||!m?[Vt(a)]:ti(a)),C=g!=="none";!f&&C&&_.push(...ei(a,m,g,O));let q=[a,..._],J=await l.detectOverflow(t,S),R=[],W=((n=s.flip)==null?void 0:n.overflows)||[];if(h&&R.push(J[D]),d){let N=Ze(o,r,O);R.push(J[N[0]],J[N[1]])}if(W=[...W,{placement:o,overflows:R}],!R.every(N=>N<=0)){var K,et;let N=(((K=s.flip)==null?void 0:K.index)||0)+1,Q=q[N];if(Q&&(!(d==="alignment"?w!==ut(Q):!1)||W.every(P=>ut(P.placement)===w?P.overflows[0]>0:!0)))return{data:{index:N,overflows:W},reset:{placement:Q}};let F=(et=W.filter(z=>z.overflows[0]<=0).sort((z,P)=>z.overflows[1]-P.overflows[1])[0])==null?void 0:et.placement;if(!F)switch(p){case"bestFit":{var V;let z=(V=W.filter(P=>{if(C){let X=ut(P.placement);return X===w||X==="y"}return!0}).map(P=>[P.placementLine truncated
|
||||
/*! Bundled license information:
|
||||
|
||||
sortablejs/modular/sortable.esm.js:
|
||||
|
||||
Reference in new issue
Block a user