2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
import{d as K,u as oe,g as U,_ as Ce,c as a,a as ee,P as X,D as ye,f as we,w as Ue,b as Le,e as qe,h as _e,M as te,i as Ke,j as Ge,F as ne,k as Qe,r as We,o as C,l as A,m as i,n as e,p as j,q as p,t as y,s as J,I as He,v as he,x as Je,y as Xe,z as F,A as x,B as Ye,C as W,E as Z,G as Ze,H as et,S as be,J as tt,K as H,L as nt,N as at,O as ke,Q as ot,R as rt,T as st,U as lt,V as it,W as ut}from"./index-2ccb5782.js";import{D as Ie,S as L,s as dt,a as ct,f as pt,L as mt,R as vt,b as ft}from"./fullScreenContextMenu-01ffa640.js";import{F as R,_ as _t}from"./index-6f28cdca.js";import{u as bt,a as kt,b as gt,c as Ct,d as yt,e as wt,f as ht,s as It,v as xt,t as St}from"./hook-dadee24a.js";/* empty css *//* empty css */import"./db-89fdf46d.js";var Pt=["class","style"],Mt=function(){return{prefixCls:String,href:String,separator:X.any,overlay:X.any,onClick:Function}};const q=K({compatConfig:{MODE:3},name:"ABreadcrumbItem",inheritAttrs:!1,__ANT_BREADCRUMB_ITEM:!0,props:Mt(),slots:["separator","overlay"],setup:function(o,k){var u=k.slots,d=k.attrs,g=oe("breadcrumb",o),_=g.prefixCls,v=function(h,l){var s=U(u,o,"overlay");return s?a(Ie,{overlay:s,placement:"bottom"},{default:function(){return[a("span",{class:"".concat(l,"-overlay-link")},[h,a(ye,null,null)])]}}):h};return function(){var w,h=(w=U(u,o,"separator"))!==null&&w!==void 0?w:"/",l=U(u,o),s=d.class,b=d.style,f=Ce(d,Pt),m;return o.href!==void 0?m=a("a",ee({class:"".concat(_.value,"-link"),onClick:o.onClick},f),[l]):m=a("span",ee({class:"".concat(_.value,"-link"),onClick:o.onClick},f),[l]),m=v(m,_.value),l?a("span",{class:s,style:b},[m,h&&a("span",{class:"".concat(_.value,"-separator")},[h])]):null}}});var $t=function(){return{prefixCls:String,routes:{type:Array},params:X.any,separator:X.any,itemRender:{type:Function}}};function At(r,o){if(!r.breadcrumbName)return null;var k=Object.keys(o).join("|"),u=r.breadcrumbName.replace(new RegExp(":(".concat(k,")"),"g"),function(d,g){return o[g]||d});return u}function ge(r){var o=r.route,k=r.params,u=r.routes,d=r.paths,g=u.indexOf(o)===u.length-1,_=At(o,k);return g?a("span",null,[_]):a("a",{href:"#/".concat(d.join("/"))},[_])}const V=K({compatConfig:{MODE:3},name:"ABreadcrumb",props:$t(),slots:["separator","itemRender"],setup:function(o,k){var u=k.slots,d=oe("breadcrumb",o),g=d.prefixCls,_=d.direction,v=function(s,b){return s=(s||"").replace(/^\//,""),Object.keys(b).forEach(function(f){s=s.replace(":".concat(f),b[f])}),s},w=function(s,b,f){var m=Ke(s),S=v(b||"",f);return S&&m.push(S),m},h=function(s){var b=s.routes,f=b===void 0?[]:b,m=s.params,S=m===void 0?{}:m,E=s.separator,P=s.itemRender,B=P===void 0?ge:P,T=[];return f.map(function(I){var M=v(I.path,S);M&&T.push(M);var N=[].concat(T),O=null;return I.children&&I.children.length&&(O=a(te,null,{default:function(){return[I.children.map(function(D){return a(te.Item,{key:D.path||D.breadcrumbName},{default:function(){return[B({route:D,params:S,routes:f,paths:w(N,D.path,S)})]}})})]}})),a(q,{overlay:O,separator:E,key:M||I.breadcrumbName},{default:function(){return[B({route:I,params:S,routes:f,paths:N})]}})})};return function(){var l,s,b,f=o.routes,m=o.params,S=m===void 0?{}:m,E=we(U(u,o)),P=(l=U(u,o,"separator"))!==null&&l!==void 0?l:"/",B=o.itemRender||u.itemRender||ge;f&&f.length>0?b=h({routes:f,params:S,separator:P,itemRender:B}):E.length&&(b=E.map(function(I,M){return Ue(Le(I.type)==="object"&&(I.type.__ANT_BREADCRUMB_ITEM||I.type.__ANT_BREADCRUMB_SEPARATOR),"Breadcrumb","Only accepts Breadcrumb.Item and Breadcrumb.Separator as it's children"),qe(I,{separator:P,key:M})}));var T=(s={},_e(s,g.value,!0),_e(s,"".concat(g.value,"-rtl"),_.value==="rtl"),s);return a("div",{class:T},[b])}}});var Rt=["separator","class"],Bt=function(){return{prefixCls:String}};const ae=K({compatConfig:{MODE:3},name:"ABreadcrumbSeparator",__ANT_BREADCRUMB_SEPARATOR:!0,inheritAttrs:!1,props:Bt(),setup:function(o,k){var u=k.slots,d=k.attrs,g=oe("breadcrumb",o),_=g.prefixCls;return function(){var v;d.separator;var w=d.class,h=Ce(d,Rt),l=we((v=u.default)===null||v===void 0?void 0:v.call(u));return a("span",ee({class:["".concat(_.value,"-separator"),w]},h),[l.length>0?l:"/"])}}});V.Item=q;V.Separator=ae;V.install=function(r){return r.component(V.name,V),r.component(q.name,q),r.component(ae.name,ae),r};R.useInjectFormItemContext=Ge;R.ItemRest=ne;R.install=function(r){return r.component(R.name,R),r.component(R.Item.name,R.Item),r.component(ne.name,ne),r};L.setDefaultIndicator=dt;L.install=function(r){return r.component(L.name,L),r};const Nt=K({__name:"folderNavigator",props:{loc:{}},emits:["to"],setup(r,{emit:o}){const k=r,u=Qe(()=>k.loc),d=We(!1),g=()=>{d.value=!1,o("to",u.value)};return(_,v)=>{const w=He,h=he;return C(),A(J,null,[a(h,{visible:d.value,"onUpdate:visible":v[1]||(v[1]=l=>d.value=l),title:_.$t("inputAddressAndPressEnter"),onOk:g},{default:i(()=>[a(w,{onPressEnter:g,value:e(u),"onUpdate:value":v[0]||(v[0]=l=>j(u)?u.value=l:null),style:{width:"100%"},"allow-clear":""},null,8,["value"])]),_:1},8,["visible","title"]),p("a",{onClick:v[2]||(v[2]=l=>d.value=!0)},y(_.$t("go")),1)],64)}}}),Dt={class:"hint"},Ft={class:"location-bar"},Et={class:"breadcrumb"},Tt=["onClick"],Ot={class:"actions"},zt=["onClick"],jt={style:{width:"512px",background:"var(--zp-primary-background)",padding:"16px","border-radius":"4px","box-shadow":"0 0 4px var(--zp-secondary-background)",border:"1px solid var(--zp-secondary-background)"}},Vt={style:{padding:"4px"}},Ut={style:{padding:"4px"}},Lt={style:{padding:"4px"}},qt={style:{padding:"4px"}},Kt={key:0,class:"view"},Gt={key:0,class:"preview-switch"},Qt=K({__name:"stackView",props:{tabIdx:{},paneIdx:{},path:{},walkModePath:{},stackKey:{}},setup(r){const o=r,k=Je(),{scroller:u,stackViewEl:d,props:g,multiSelectedIdxs:_,spinning:v}=bt().toRefs(),{currLocation:w,currPage:h,refresh:l,copyLocation:s,back:b,openNext:f,stack:m,to:S,quickMoveTo:E,addToSearchScanPathAndQuickMove:P,searchPathInfo:B}=kt(o),{gridItems:T,sortMethodConv:I,moreActionsDropdownShow:M,sortedFiles:N,sortMethod:O,viewMode:z,itemSize:D,loadNextDir:re,loadNextDirLoading:xe,canLoadNext:Se,onScroll:Pe}=gt(o),{onDrop:Me,onFileDragStart:$e}=Ct(),{onFileItemClick:Ae,onContextMenuClick:se,showGenInfo:G,imageGenInfo:le,q:Re}=yt(o,{openNext:f}),{previewIdx:Q,onPreviewVisibleChange:Be,previewing:ie,previewImgMove:ue,canPreview:de}=wt(o),{showMenuIdx:Y}=ht();return Xe(()=>o,()=>{g.value=o;const c=It.get(o.stackKey??"");c&&(m.value=c.slice())},{immediate:!0}),(c,t)=>{const Ne=ot,De=rt,Fe=he,ce=q,pe=V,Ee=st,Te=lt,Oe=te,me=Ie,ve=_t,ze=R,je=it,Ve=L;return C(),F(Ve,{spinning:e(v),size:"large"},{default:i(()=>[a(Ne,{style:{display:"none"}}),p("div",{ref_key:"stackViewEl",ref:d,onDragover:t[18]||(t[18]=x(()=>{},["prevent"])),onDrop:t[19]||(t[19]=x(n=>e(Me)(n),["prevent"])),class:"container"},[a(Fe,{visible:e(G),"onUpdate:visible":t[1]||(t[1]=n=>j(G)?G.value=n:null),width:"70vw","mask-closable":"",onOk:t[2]||(t[2]=n=>G.value=!1)},{cancelText:i(()=>[]),default:i(()=>[a(De,{active:"",loading:!e(Re).isIdle},{default:i(()=>[p("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto","z-index":"9999"},onDblclick:t[0]||(t[0]=n=>e(Ye)(e(le)))},[p("div",Dt,y(c.$t("doubleClickToCopy")),1),W(" "+y(e(le)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),p("div",Ft,[p("div",Et,[o.walkModePath?(C(),F(Ee,{key:0},{title:i(()=>[W(y(c.$t("walk-mode-move-message")),1)]),default:i(()=>[a(pe,{style:{flex:"1"}},{default:i(()=>[(C(!0),A(J,null,Z(e(m),(n,$)=>(C(),F(ce,{key:$},{default:i(()=>[p("span",null,y(n.curr==="/"?c.$t("root"):n.curr.replace(/:\/$/,c.$t("drive"))),1)]),_:2},1024))),128))]),_:1})]),_:1})):(C(),F(pe,{key:1,style:{flex:"1"}},{default:i(()=>[(C(!0),A(J,null,Z(e(m),(n,$)=>(C(),F(ce,{key:$},{default:i(()=>[p("a",{onClick:x(fe=>e(b)($),["prevent"])},y(n.curr==="/"?c.$t("root"):n.curr.replace(/:\/$/,c.$t("drive"))),9,Tt)]),_:2},1024))),128))]),_:1}))]),p("div",Ot,[p("a",{class:"opt",onClick:t[3]||(t[3]=x((...n)=>e(l)&&e(l)(...n),["prevent"]))},y(c.$t("refresh")),1),a(me,null,{overlay:i(()=>[a(Oe,null,{default:i(()=>[(C(!0),A(J,null,Z(e(k).quickMovePaths,n=>(C(),F(Te,{key:n.dir},{default:i(()=>[p("a",{onClick:x($=>e(E)(n.dir),["prevent"])},y(n.zh),9,zt)]),_:2},1024))),128))]),_:1})]),default:i(()=>[p("a",{class:"opt",onClick:t[4]||(t[4]=x(()=>{},["prevent"]))},[W(y(c.$t("quickMove"))+" ",1),a(e(ye))])]),_:1}),a(me,{trigger:["click"],visible:e(M),"onUpdate:visible":t[14]||(t[14]=n=>j(M)?M.value=n:null),placement:"bottomLeft",getPopupContainer:n=>n.parentNode},{overlay:i(()=>[p("div",jt,[a(ze,Ze(et({labelCol:{span:6},wrapperCol:{span:18}})),{default:i(()=>[a(ve,{label:c.$t("viewMode")},{default:i(()=>[a(e(be),{value:e(z),"onUpdate:value":t[6]||(t[6]=n=>j(z)?z.value=n:null),onClick:t[7]||(t[7]=x(()=>{},["stop"])),conv:{value:n=>n,text:n=>c.$t(n)},options:e(xt)},null,8,["value","conv","options"])]),_:1},8,["label"]),a(ve,{label:c.$t("sortingMethod")},{default:i(()=>[a(e(be),{value:e(O),"onUpdate:value":t[8]||(t[8]=n=>j(O)?O.value=n:null),onClick:t[9]||(t[9]=x(()=>{},["stop"])),conv:e(I),options:e(tt)},null,8,["value","conv","options"])]),_:1},8,["label"]),p("div",Vt,[p("a",{onClick:t[10]||(t[10]=x((...n)=>e(s)&&e(s)(...n),["prevent"]))},y(c.$t("copyPath")),1)]),p("div",Ut,[a(Nt,{loc:e(w),onTo:e(S)},null,8,["loc","onTo"])]),p("div",Lt,[e(B)?e(B).can_delete?(C(),A("a",{key:1,onClick:t[12]||(t[12]=x((...n)=>e(P)&&e(P)(...n),["prevent"]))},y(c.$t("removeFromSearchScanPathAndQuickMove")),1)):H("",!0):(C(),A("a",{key:0,onClick:t[11]||(t[11]=x((...n)=>e(P)&&e(P)(...n),["prevent"]))},y(c.$t("addToSearchScanPathAndQuickMove")),1))]),p("div",qt,[p("a",{onClick:t[13]||(t[13]=x(n=>e(nt)(e(w)+"/"),["prevent"]))},y(c.$t("openWithLocalFileBrowser")),1)])]),_:1},16)])]),default:i(()=>[p("a",{class:"opt",onClick:t[5]||(t[5]=x(()=>{},["prevent"]))},y(c.$t("more")),1)]),_:1},8,["visible","getPopupContainer"])])]),e(h)?(C(),A("div",Kt,[a(e(ct),{class:"file-list",items:e(N),ref_key:"scroller",ref:u,onScroll:e(Pe),"item-size":e(D).first,"key-field":"fullpath","item-secondary-size":e(D).second,gridItems:e(T)},at({default:i(({item:n,index:$})=>[a(pt,{idx:$,file:n,"full-screen-preview-image-url":e(N)[e(Q)]?e(St)(e(N)[e(Q)]):"","show-menu-idx":e(Y),"onUpdate:showMenuIdx":t[15]||(t[15]=fe=>j(Y)?Y.value=fe:null),selected:e(_).includes($),"view-mode":e(z),onFileItemClick:e(Ae),onDragstart:e($e),onPreviewVisibleChange:e(Be),onContextMenuClick:e(se)},null,8,["idx","file","full-screen-preview-image-url","show-menu-idx","selected","view-mode","onFileItemClick","onDragstart","onPreviewVisibleChange","onContextMenuClick"])]),_:2},[o.walkModePath?{name:"after",fn:i(()=>[a(je,{onClick:e(re),loading:e(xe),block:"",type:"primary",disabled:!e(Se),ghost:""},{default:i(()=>[W(y(c.$t("loadNextPage")),1)]),_:1},8,["onClick","loading","disabled"])]),key:"0"}:void 0]),1032,["items","onScroll","item-size","item-secondary-size","gridItems"]),e(ie)?(C(),A("div",Gt,[a(e(mt),{onClick:t[16]||(t[16]=n=>e(ue)("prev")),class:ke({disable:!e(de)("prev")})},null,8,["class"]),a(e(vt),{onClick:t[17]||(t[17]=n=>e(ue)("next")),class:ke({disable:!e(de)("next")})},null,8,["class"])])):H("",!0)])):H("",!0)],544),e(ie)?(C(),F(ft,{key:0,file:e(N)[e(Q)],idx:e(Q),onContextMenuClick:e(se)},null,8,["file","idx","onContextMenuClick"])):H("",!0)]),_:1},8,["spinning"])}}});const tn=ut(Qt,[["__scopeId","data-v-316d8b15"]]);export{tn as default};
|