stable-diffusion-webui
/
extensions
/sd-webui-infinite-image-browsing
/vue
/dist
/assets
/MatchedImageGrid-623cc422.js
import{d as j,l as H,ay as J,o as r,y as g,c as n,n as o,r as e,s as V,p as c,t as K,v as m,x as $,m as D,L as Y,C as f,N as F,Q as Z,R as ee,V as te,X as se}from"./index-7c0f3f3a.js";import{L as ie,R as le,f as ne,S as oe}from"./fullScreenContextMenu-780774ab.js";import{g as ae,F as re}from"./FileItem-39204ab7.js";import{g as de}from"./db-90de1b1b.js";import{c as ce,u as me}from"./hook-32698bdc.js";import{o as ue}from"./functionalCallableComp-6d05295c.js";import"./index-00c5caf5.js";/* empty css */const pe={class:"hint"},ge={key:1},fe={class:"no-res-hint"},ve={class:"hint"},Ie={key:2,class:"preview-switch"},ke=j({__name:"MatchedImageGrid",props:{tabIdx:{},paneIdx:{},selectedTagIds:{},id:{}},setup(z){const v=z,u=ce(s=>de(v.selectedTagIds,s)),{queue:B,images:l,onContextMenuClickU:I,stackViewEl:R,previewIdx:a,previewing:k,onPreviewVisibleChange:N,previewImgMove:w,canPreview:C,itemSize:_,gridItems:G,showGenInfo:d,imageGenInfo:h,q:A,multiSelectedIdxs:x,onFileItemClick:E,scroller:y,showMenuIdx:p,onFileDragStart:P,onFileDragEnd:U,cellWidth:L,onScroll:b}=me(u);return H(()=>v.selectedTagIds,async()=>{var s;await u.reset(),await J(),(s=y.value)==null||s.scrollToItem(0),b()},{immediate:!0}),(s,t)=>{const O=Z,q=ee,Q=te,W=oe;return r(),g("div",{class:"container",ref_key:"stackViewEl",ref:R},[n(W,{size:"large",spinning:!e(B).isIdle},{default:o(()=>{var M,S;return[n(q,{visible:e(d),"onUpdate:visible":t[1]||(t[1]=i=>V(d)?d.value=i:null),width:"70vw","mask-closable":"",onOk:t[2]||(t[2]=i=>d.value=!1)},{cancelText:o(()=>[]),default:o(()=>[n(O,{active:"",loading:!e(A).isIdle},{default:o(()=>[c("div",{style:{width:"100%","word-break":"break-all","white-space":"pre-line","max-height":"70vh",overflow:"auto"},onDblclick:t[0]||(t[0]=i=>e(K)(e(h)))},[c("div",pe,m(s.$t("doubleClickToCopy")),1),$(" "+m(e(h)),1)],32)]),_:1},8,["loading"])]),_:1},8,["visible"]),(M=e(l))!=null&&M.length?(r(),D(e(ae),{key:0,ref_key:"scroller",ref:y,class:"file-list",items:e(l),"item-size":e(_).first,"key-field":"fullpath","item-secondary-size":e(_).second,gridItems:e(G),onScroll:e(b)},{default:o(({item:i,index:T})=>[n(re,{idx:T,file:i,"cell-width":e(L),"show-menu-idx":e(p),"onUpdate:showMenuIdx":t[3]||(t[3]=X=>V(p)?p.value=X:null),onDragstart:e(P),onDragend:e(U),onFileItemClick:e(E),"full-screen-preview-image-url":e(l)[e(a)]?e(Y)(e(l)[e(a)]):"",selected:e(x).includes(T),onContextMenuClick:e(I),onPreviewVisibleChange:e(N),"is-selected-mutil-files":e(x).length>1},null,8,["idx","file","cell-width","show-menu-idx","onDragstart","onDragend","onFileItemClick","full-screen-preview-image-url","selected","onContextMenuClick","onPreviewVisibleChange","is-selected-mutil-files"])]),_:1},8,["items","item-size","item-secondary-size","gridItems","onScroll"])):e(u).load&&s.selectedTagIds.and_tags.length===1&&!((S=s.selectedTagIds.folder_paths_str)!=null&&S.trim())?(r(),g("div",ge,[c("div",fe,[c("p",ve,m(s.$t("tagSearchNoResultsMessage")),1),n(Q,{onClick:t[4]||(t[4]=i=>e(ue)()),type:"primary"},{default:o(()=>[$(m(s.$t("rebuildImageIndex")),1)]),_:1})])])):f("",!0),e(k)?(r(),g("div",Ie,[n(e(ie),{onClick:t[5]||(t[5]=i=>e(w)("prev")),class:F({disable:!e(C)("prev")})},null,8,["class"]),n(e(le),{onClick:t[6]||(t[6]=i=>e(w)("next")),class:F({disable:!e(C)("next")})},null,8,["class"])])):f("",!0)]}),_:1},8,["spinning"]),e(k)&&e(l)&&e(l)[e(a)]?(r(),D(ne,{key:0,file:e(l)[e(a)],idx:e(a),onContextMenuClick:e(I)},null,8,["file","idx","onContextMenuClick"])):f("",!0)],512)}}});const Se=se(ke,[["__scopeId","data-v-c4827cd4"]]);export{Se as default}; | |