UNPKG

amis-playground

Version:

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

2 lines (1 loc) 1.01 kB
import{a as o,R as i,I as l,f as r,p as v,q as a,h as g}from"./index-7c288cb3.js";var h=function(s){o(e,s);function e(){var t=s!==null&&s.apply(this,arguments)||this;return t.state={visible:!1},t}return e.prototype.toggleVisible=function(){this.setState({visible:!this.state.visible})},e.prototype.render=function(){var t=this.props,c=t.classnames,d=t.className,p=t.style,n=t.mosaicText,m=n===void 0?"********":n,u=t.value;return i.createElement("span",{className:c("Password-field",d),style:p},this.state.visible?u:m,this.state.visible?i.createElement(l,{icon:"view",className:"icon",onClick:this.toggleVisible}):i.createElement(l,{icon:"invisible",className:"icon",onClick:this.toggleVisible}))},r([v,a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",void 0)],e.prototype,"toggleVisible",null),e}(i.Component),y=function(s){o(e,s);function e(){return s!==null&&s.apply(this,arguments)||this}return e=r([g({type:"password"})],e),e}(h);export{h as PasswordField,y as PasswordFieldRenderer};