index-4bcfa431.js 1.6 KB

1
  1. import{c as L,ac as y,aq as D,d as I,ar as B,a as n,m as V,n as o,t as _,a4 as u,X as s,I as f,k as q}from"./index-5e5e4ebc.js";const[z,i]=L("cell"),A={tag:V("div"),icon:String,size:String,title:o,value:o,label:o,center:Boolean,isLink:Boolean,border:_,required:Boolean,iconPrefix:String,valueClass:u,labelClass:u,titleClass:u,titleStyle:null,arrowDirection:String,clickable:{type:Boolean,default:null}},N=y({},A,D);var R=I({name:z,props:N,setup(e,{slots:a}){const v=B(),g=()=>{if(a.label||s(e.label))return n("div",{class:[i("label"),e.labelClass]},[a.label?a.label():e.label])},h=()=>{var l;if(a.title||s(e.title)){const t=(l=a.title)==null?void 0:l.call(a);return Array.isArray(t)&&t.length===0?void 0:n("div",{class:[i("title"),e.titleClass],style:e.titleStyle},[t||n("span",null,[e.title]),g()])}},m=()=>{const l=a.value||a.default;if(l||s(e.value))return n("div",{class:[i("value"),e.valueClass]},[l?l():n("span",null,[e.value])])},k=()=>{if(a.icon)return a.icon();if(e.icon)return n(f,{name:e.icon,class:i("left-icon"),classPrefix:e.iconPrefix},null)},w=()=>{if(a["right-icon"])return a["right-icon"]();if(e.isLink){const l=e.arrowDirection&&e.arrowDirection!=="right"?`arrow-${e.arrowDirection}`:"arrow";return n(f,{name:l,class:i("right-icon")},null)}};return()=>{var l;const{tag:t,size:r,center:C,border:P,isLink:S,required:x}=e,c=(l=e.clickable)!=null?l:S,d={center:C,required:x,clickable:c,borderless:!P};return r&&(d[r]=!!r),n(t,{class:i(d),role:c?"button":void 0,tabindex:c?0:void 0,onClick:v},{default:()=>{var b;return[k(),h(),m(),w(),(b=a.extra)==null?void 0:b.call(a)]}})}}});const X=q(R);export{X as C,A as c};