UNPKG

ll-package

Version:

2 lines (1 loc) 2.44 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),g=require("../../../hooks/useDesign.js"),C=e.defineComponent({name:"LlAvatar"}),B=e.defineComponent({...C,props:{type:{default:"single"},groupList:{default:()=>[]},avatarProps:{},avatarGroupProps:{},isCanUpload:{type:Boolean,default:!1},uploadDragProps:{}},emits:["click"],setup(i,{emit:u}){const{prefixCls:k}=g.useDesign("avatar-wrapper"),t=i,m=u,l=(o,n)=>{m("click",o,n)};return(o,n)=>{const s=e.resolveComponent("ll-icon"),c=e.resolveComponent("a-avatar"),p=e.resolveComponent("a-avatar-group"),d=e.resolveComponent("ll-upload-drag");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(k))},[o.isCanUpload?(e.openBlock(),e.createBlock(d,e.normalizeProps(e.mergeProps({key:0},o.uploadDragProps)),{buttonContent:e.withCtx(()=>[o.type==="single"?(e.openBlock(),e.createBlock(c,e.mergeProps({key:0},t.avatarProps,{onClick:n[0]||(n[0]=r=>l(t.avatarProps))}),{icon:e.withCtx(()=>[e.renderSlot(o.$slots,"icon",{},()=>[e.createVNode(s,{"icon-name":"icon-avatar"})],!0)]),_:3},16)):(e.openBlock(),e.createBlock(p,e.normalizeProps(e.mergeProps({key:1},t.avatarGroupProps)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.groupList,(r,a)=>(e.openBlock(),e.createBlock(c,e.mergeProps(r,{key:a,onClick:v=>l(r,a)}),{icon:e.withCtx(()=>[e.renderSlot(o.$slots,"icon",{},()=>[e.createVNode(s,{"icon-name":"icon-avatar"})],!0)]),_:2},1040,["onClick"]))),128))],!0)]),_:3},16))]),_:3},16)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[o.type==="single"?(e.openBlock(),e.createBlock(c,e.mergeProps({key:0},t.avatarProps,{onClick:n[1]||(n[1]=r=>l(t.avatarProps))}),{icon:e.withCtx(()=>[e.renderSlot(o.$slots,"icon",{},()=>[e.createVNode(s,{"icon-name":"icon-avatar"})],!0)]),_:3},16)):(e.openBlock(),e.createBlock(p,e.normalizeProps(e.mergeProps({key:1},t.avatarGroupProps)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.groupList,(r,a)=>(e.openBlock(),e.createBlock(c,e.mergeProps(r,{shape:"square",key:a,onClick:v=>l(r,a)}),{icon:e.withCtx(()=>[e.renderSlot(o.$slots,"icon",{},()=>[e.createVNode(s,{"icon-name":"icon-avatar"})],!0)]),_:2},1040,["onClick"]))),128))],!0)]),_:3},16))],64))],2)}}});exports.default=B;