import{r as e,c as t,h as i,H as o,g as n}from"./p-78e3ebb9.js";const s='.taro-checkbox{display:inline-block;position:relative}.taro-checkbox_checked{display:inline-block;position:relative;top:5px;border:1px solid #d1d1d1;border-radius:3px;width:23px;height:23px;min-height:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0;background-color:#fff;vertical-align:0;font-size:23px;color:#1aad19}.taro-checkbox_checked:checked::before{display:inline-block;position:absolute;left:50%;top:50%;vertical-align:middle;text-decoration:inherit;text-align:center;text-transform:none;font-family:weui;font-style:normal;font-weight:normal;font-variant:normal;font-size:inherit;color:inherit;content:"\\ea08";-webkit-transform:translate(-50%, -48%) scale(0.73);transform:translate(-50%, -48%) scale(0.73);speak:none}';const r=class{constructor(i){e(this,i);this.onChange=t(this,"checkboxchange",7);this.handleChange=e=>{e.stopPropagation();this.onChange.emit({value:this.value})};this.name=undefined;this.value="";this.color=undefined;this.id=undefined;this.checked=false;this.disabled=false;this.nativeProps={};this.isWillLoadCalled=false}watchId(e){if(!this.isWillLoadCalled)return;if(e)this.inputEl.setAttribute("id",e)}componentWillLoad(){this.isWillLoadCalled=true}componentDidRender(){this.id&&this.el.removeAttribute("id")}render(){const{checked:e,name:t,color:n,value:s,disabled:r,nativeProps:c}=this;return i(o,{className:"weui-cells_checkbox"},i("input",Object.assign({ref:e=>{if(!e)return;this.inputEl=e;if(this.id)e.setAttribute("id",this.id)},type:"checkbox",value:s,name:t,class:"taro-checkbox_checked",style:{color:n},checked:e,disabled:r,onChange:this.handleChange},c)),i("slot",null))}get el(){return n(this)}static get watchers(){return{id:["watchId"]}}};r.style=s;const c=class{constructor(i){e(this,i);this.onChange=t(this,"change",7);this.uniqueName=Date.now().toString(36);this.name=undefined}function(e){e.stopPropagation();if(e.target.tagName!=="TARO-CHECKBOX-CORE")return;const t=this.el.querySelectorAll("taro-checkbox-core");this.value=this.getValues(t);this.onChange.emit({value:this.value})}componentDidLoad(){const e=this.el.querySelectorAll("taro-checkbox-core");e.forEach((e=>{e.setAttribute("name",this.name||this.uniqueName)}));Object.defineProperty(this.el,"value",{get:()=>{if(!this.value){const e=this.el.querySelectorAll("taro-checkbox-core");this.value=this.getValues(e)}return this.value},configurable:true})}getValues(e){return Array.from(e).filter((e=>{const t=e.querySelector("input");return t===null||t===void 0?void 0:t.checked})).map((e=>e.value))}render(){return i(o,null)}get el(){return n(this)}};export{r as taro_checkbox_core,c as taro_checkbox_group_core};
//# sourceMappingURL=p-b313c11a.entry.js.map