index-a27d7671.js 1.6 KB

1
  1. import{j as L,A as y,aK as D,d as I,aL as B,g as n,n as V,t as o,v as _,x as u,ay as s,I as f,D as A}from"./index-1d4a9afa.js";const[q,i]=L("cell"),z={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({},z,D);var R=I({name:q,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])])},w=()=>{if(a.icon)return a.icon();if(e.icon)return n(f,{name:e.icon,class:i("left-icon"),classPrefix:e.iconPrefix},null)},C=()=>{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:P,border:k,isLink:S,required:x}=e,c=(l=e.clickable)!=null?l:S,d={center:P,required:x,clickable:c,borderless:!k};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[w(),h(),m(),C(),(b=a.extra)==null?void 0:b.call(a)]}})}}});const K=A(R);export{K as C,z as c};