Avatar-BwnmljiT.js 1.7 KB

1
  1. import{s as E,v,w as h,f as m,Z as z,z as p,P as f,Q as n,D as L,$ as R}from"./index-DT8qTvyx.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,w=e.draggable,C=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 v(o)&&(o=h(o,u,"| raw")),v(l)&&(l=h(l,u)),v(d)&&(d=h(d,u)),m.createElement(z,{style:s,className:i,classnames:b,src:o||_,icon:d,fit:F,shape:A,size:M,text:l,gap:x,alt:O,draggable:w,crossOrigin:C,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),P=function(r){E(a,r);function a(){return r!==null&&r.apply(this,arguments)||this}return a=p([L({type:"avatar"}),R],a),a}(j);export{j as AvatarField,P as AvatarFieldRenderer};