import{r as t,c as e,h as s,g as i}from"./p-78e3ebb9.js";const h="taro-switch-core{display:inline-block;width:52px;height:32px}taro-switch-core .weui-switch{display:block;width:100%;height:100%}";const c=class{constructor(s){t(this,s);this.onChange=e(this,"change",7);this.switchChange=t=>{t.stopPropagation();const e=t.target.checked;this.isChecked=e;this.onChange.emit({value:e})};this.type="switch";this.checked=false;this.color="#04BE02";this.name=undefined;this.disabled=false;this.nativeProps={};this.isChecked=undefined;this.isWillLoadCalled=false}function(t,e){if(!this.isWillLoadCalled)return;if(t!==e)this.isChecked=t}componentWillLoad(){this.isWillLoadCalled=true;this.isChecked=this.checked}componentDidLoad(){Object.defineProperty(this.el,"value",{get:()=>this.isChecked,configurable:true})}render(){const{type:t,color:e,isChecked:i,name:h,disabled:c,nativeProps:o}=this;const n=i?{borderColor:e||"04BE02",backgroundColor:e||"04BE02"}:{};return s("input",Object.assign({type:"checkbox",class:`weui-${t}`,style:n,checked:i,name:h,disabled:c,onChange:this.switchChange},o))}get el(){return i(this)}static get watchers(){return{checked:["function"]}}};c.style=h;export{c as taro_switch_core};
//# sourceMappingURL=p-fec6746d.entry.js.map