UNPKG

amis-playground

Version:

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

2 lines (1 loc) 1.65 kB
import{a as v,D as l,Y as C,R as d,n as M,f as o,p as c,q as a,h as _}from"./index-7c288cb3.js";var x=function(i){v(t,i);function t(){return i!==null&&i.apply(this,arguments)||this}return t.prototype.handleClick=function(e){var n=this.props,r=n.dispatchEvent,p=n.data;r("click",l(p,{nativeEvent:e}))},t.prototype.handleMouseEnter=function(e){var n=this.props,r=n.dispatchEvent,p=n.data;r(e,l(p,{nativeEvent:e}))},t.prototype.handleMouseLeave=function(e){var n=this.props,r=n.dispatchEvent,p=n.data;r(e,l(p,{nativeEvent:e}))},t.prototype.render=function(){var e=this.props,n=e.className,r=e.style,p=e.wrapperComponent,u=e.text,y=e.data,h=e.tpl,m=e.inline,f=e.placeholder,E=e.classnames,s=C(this.props),g=p||(m?"span":"div");return d.createElement(g,{className:E("PlainField",n),style:r,onClick:this.handleClick,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},h||u?M(h||u,y):typeof s>"u"||s===""||s===null?d.createElement("span",{className:"text-muted"},f):String(s))},t.defaultProps={wrapperComponent:"",inline:!0,placeholder:"-"},o([c,a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",void 0)],t.prototype,"handleClick",null),o([c,a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",void 0)],t.prototype,"handleMouseEnter",null),o([c,a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",void 0)],t.prototype,"handleMouseLeave",null),t}(d.Component),b=function(i){v(t,i);function t(){return i!==null&&i.apply(this,arguments)||this}return t=o([_({type:"plain",alias:["text"],name:"plain"})],t),t}(x);export{x as Plain,b as PlainRenderer};