1 |
- import{t as L,u as y,z as o,v as D,O as u,N as B,ae as I,d as V,af as _,c as n,a1 as s,a5 as b,D as z}from"./index.5f7ffb46.js";const[N,i]=L("cell"),q={tag:y("div"),icon:String,size:String,title:o,value:o,label:o,center:Boolean,isLink:Boolean,border:D,required:Boolean,iconPrefix:String,valueClass:u,labelClass:u,titleClass:u,titleStyle:null,arrowDirection:String,clickable:{type:Boolean,default:null}},A=B({},q,I);var R=V({name:N,props:A,setup(e,{slots:a}){const v=_(),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(b,{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(b,{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 f;return[w(),h(),m(),C(),(f=a.extra)==null?void 0:f.call(a)]}})}}});const T=z(R);export{T as C,q as c};
|