UNPKG

amis-playground

Version:

amis-playground 是一个amis在线代码编辑器可实时预览运行效果

2 lines (1 loc) 1.73 kB
import{a as E,i as h,r as v,R as m,y as w,f as p,p as f,q as n,h as z,z as L}from"./index-7c288cb3.js";var j=function(r){E(a,r);function a(){return r!==null&&r.apply(this,arguments)||this}return a.prototype.handleClick=function(e){var t=this.props,s=t.dispatchEvent,i=t.data;s(e,i)},a.prototype.handleMouseEnter=function(e){var t=this.props,s=t.dispatchEvent,i=t.data;s(e,i)},a.prototype.handleMouseLeave=function(e){var t=this.props,s=t.dispatchEvent,i=t.data;s(e,i)},a.prototype.render=function(){var e=this.props,t=e.style,s=t===void 0?{}:t,i=e.className,b=e.classnames,o=e.src,_=e.defaultAvatar,g=e.icon,d=g===void 0?"fa fa-user":g,F=e.fit,A=e.shape,M=e.size,l=e.text,x=e.gap,O=e.alt,C=e.draggable,R=e.crossOrigin,c=e.onError,u=e.data,y=function(){return!1};if(typeof c=="string")try{y=new Function("event",c)}catch(k){console.warn(c,k)}return h(o)&&(o=v(o,u,"| raw")),h(l)&&(l=v(l,u)),h(d)&&(d=v(d,u)),m.createElement(w,{style:s,className:i,classnames:b,src:o||_,icon:d,fit:F,shape:A,size:M,text:l,gap:x,alt:O,draggable:C,crossOrigin:R,onError:y,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave})},p([f,n("design:type",Function),n("design:paramtypes",[Object]),n("design:returntype",void 0)],a.prototype,"handleClick",null),p([f,n("design:type",Function),n("design:paramtypes",[Object]),n("design:returntype",void 0)],a.prototype,"handleMouseEnter",null),p([f,n("design:type",Function),n("design:paramtypes",[Object]),n("design:returntype",void 0)],a.prototype,"handleMouseLeave",null),a}(m.Component),V=function(r){E(a,r);function a(){return r!==null&&r.apply(this,arguments)||this}return a=p([z({type:"avatar"}),L],a),a}(j);export{j as AvatarField,V as AvatarFieldRenderer};