vue-amazing-ui
Version:
An Amazing Vue3 UI Components Library, Using TypeScript.
2 lines (1 loc) • 2.71 kB
JavaScript
;Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("../../avatar/index.cjs"),c=require("../../utils/index.cjs"),d={class:"list-item-wrap"},u={class:"list-item-main"},m={key:0,class:"list-item-meta"},v={key:1,class:"list-item-content"},y=e.defineComponent({__name:"ListItem",props:{avatar:{default:void 0},avatarProps:{default:()=>({})},title:{default:void 0},description:{default:void 0},actions:{type:Function,default:void 0},extra:{default:void 0},avatarStyle:{default:()=>({})},titleStyle:{default:()=>({})},descriptionStyle:{default:()=>({})},contentStyle:{default:()=>({})},actionsStyle:{default:()=>({})},extraStyle:{default:()=>({})}},setup(t){const o=t,a=c.useSlotsExist(["avatar","title","description","default","actions","extra"]),r=e.computed(()=>a.avatar||o.avatar||JSON.stringify(o.avatarProps)!=="{}"),i=e.computed(()=>a.title||a.description||o.title||o.description),n=e.computed(()=>a.extra||o.extra);return(l,S)=>(e.openBlock(),e.createElementBlock("div",d,[e.createElementVNode("div",u,[r.value||i.value?(e.openBlock(),e.createElementBlock("div",m,[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"list-item-avatar",style:e.normalizeStyle(t.avatarStyle)},[e.renderSlot(l.$slots,"avatar",{},()=>[e.createVNode(e.unref(s.default),e.normalizeProps(e.guardReactiveProps(t.avatarProps)),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.avatar),1)]),_:1},16)],!0)],4)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("p",{class:"list-item-title",style:e.normalizeStyle(t.titleStyle)},[e.renderSlot(l.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)],!0)],4),e.createElementVNode("div",{class:"list-item-description",style:e.normalizeStyle(t.descriptionStyle)},[e.renderSlot(l.$slots,"description",{},()=>[e.createTextVNode(e.toDisplayString(t.description),1)],!0)],4)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.unref(a).default?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(t.contentStyle)},[e.renderSlot(l.$slots,"default",{},void 0,!0)],4)):e.createCommentVNode("",!0),e.unref(a).actions?(e.openBlock(),e.createElementBlock("div",{key:2,class:"list-item-actions",style:e.normalizeStyle(t.actionsStyle)},[e.renderSlot(l.$slots,"actions",{},void 0,!0)],4)):e.createCommentVNode("",!0)]),n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"list-item-extra",style:e.normalizeStyle(t.extraStyle)},[e.renderSlot(l.$slots,"extra",{},()=>[e.createTextVNode(e.toDisplayString(t.extra),1)],!0)],4)):e.createCommentVNode("",!0)]))}});exports.default=y;