ImageCard-945f8c53.js 1.7 KB

1
  1. import{_ as g}from"./_plugin-vue_export-helper-1b428a4d.js";import{e as n,z as y,aA as b,o as v,c as x,k as l,ax as s,aG as f,ao as w,__tla as _}from"./index-1e808f2e.js";let c,S=Promise.all([(()=>{try{return _}catch{}})()]).then(async()=>{let o;o=["src"],c=g({__name:"ImageCard",props:{url:{type:String,required:!0},width:{type:[String,Number],required:!0},height:{type:[String,Number],required:!0},radius:{type:[String,Number],default:5},containerStyle:{type:Object,default:()=>({})},imgContainerStyle:{type:Object,default:()=>({})},textContainerStyle:{type:Object,default:()=>({})}},setup(t){const e=t,u=n(()=>`min(${e.width}px, 80vw)`),h=n(()=>typeof e.height=="number"?`${e.height}px`:e.height),m=n(()=>typeof e.radius=="number"?`${e.radius}px`:e.radius),r=()=>{w(()=>{const a=document.querySelectorAll(".card-img");let i=1/0;a.forEach(p=>{const d=p.clientWidth;d<i&&(i=d)}),i!==1/0&&(minWidth.value=i)})};return y(()=>{r(),window.addEventListener("resize",r)}),b(()=>{window.removeEventListener("resize",r)}),(a,i)=>(v(),x("div",{class:"",style:s([{display:"flex","align-items":"center"},{...t.containerStyle}])},[l("div",{class:"img-container",style:s({width:u.value,height:h.value,marginRight:"10px",border:"1px solid rgb(220 223 231)",borderRadius:m.value,display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",...t.imgContainerStyle})},[l("img",{src:t.url,class:"card-img",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}},null,8,o)],4),l("div",{class:"text-container",style:s([{"flex-grow":"1","min-width":"50px","line-height":"25px"},{...t.textContainerStyle}])},[f(a.$slots,"label",{},void 0,!0)],4)],4))}},[["__scopeId","data-v-aecbc8da"]])});export{c as I,S as __tla};