"use strict";const e=require("../../../../common/vendor.js"),l=require("../composables/useCell.js"),s=require("../composables/useParent.js"),t=require("../wd-form/types.js"),r=require("./types.js"),i=require("../common/util.js");Math||o();const o=()=>"../wd-icon/wd-icon.js",a=e.defineComponent({name:"wd-cell",options:{addGlobalClass:!0,virtualHost:!0,styleIsolation:"shared"},props:r.cellProps,emits:["click"],setup(r,{emit:o}){const a=r,c=o,n=e.useSlots(),u=l.useCell(),d=e.computed((()=>Boolean(i.isDef(a.border)?a.border:u.border.value))),{parent:p}=s.useParent(t.FORM_KEY),m=e.computed((()=>p&&a.prop&&p.errorMessages&&p.errorMessages[a.prop]?p.errorMessages[a.prop]:"")),v=e.computed((()=>{let e=!1;if(p&&p.props.rules){const l=p.props.rules;for(const s in l)Object.prototype.hasOwnProperty.call(l,s)&&s===a.prop&&Array.isArray(l[s])&&(e=l[s].some((e=>e.required)))}return a.required||a.rules.some((e=>e.required))||e})),b=e.computed((()=>{const e=n.icon||a.icon,l=n.title&&a.useTitleSlot||a.title,s=n.label||a.label;return e||l||s}));function w(){const l=a.to;(a.clickable||a.isLink)&&c("click"),l&&a.isLink&&(a.replace?e.index.redirectTo({url:l}):e.index.navigateTo({url:l}))}return(l,s)=>e.e({a:b.value},b.value?e.e({b:v.value&&"before"===l.markerSide},(v.value&&l.markerSide,{}),{c:l.icon},l.icon?{d:e.p({name:l.icon,size:l.iconSize,"custom-class":`wd-cell__icon  ${l.customIconClass}`})}:{},{e:l.useTitleSlot&&l.$slots.title},l.useTitleSlot&&l.$slots.title?{}:l.title?{g:e.t(l.title),h:e.n(l.customTitleClass)}:{},{f:l.title,i:l.label},l.label?{j:e.t(l.label),k:e.n(`wd-cell__label ${l.customLabelClass}`)}:{},{l:v.value&&"after"===l.markerSide},(v.value&&l.markerSide,{}),{m:e.s(l.titleWidth?"min-width:"+l.titleWidth+";max-width:"+l.titleWidth+";":"")}):{},{n:e.t(l.value),o:e.n(`wd-cell__value ${l.customValueClass} wd-cell__value--${l.valueAlign} ${l.ellipsis?"wd-cell__value--ellipsis":""}`),p:l.isLink},l.isLink?{q:e.p({"custom-class":"wd-cell__arrow-right",name:"arrow-right"})}:{},{r:m.value},m.value?{s:e.t(m.value)}:{},{t:e.n(l.vertical?"is-vertical":""),v:e.n(d.value?"is-border":""),w:e.n(l.size?"is-"+l.size:""),x:e.n(l.center?"is-center":""),y:e.n(l.customClass),z:e.s(l.customStyle),A:l.isLink||l.clickable?"is-hover":"none",B:e.o(w)})}}),c=e._export_sfc(a,[["__scopeId","data-v-7aeca375"]]);wx.createComponent(c);
