UNPKG

3.23 kBJavaScriptView Raw
1System.register(["./p-b2d01686.system.js"],(function(e){"use strict";var t,n,o,r,i;return{setters:[function(e){t=e.r;n=e.c;o=e.h;r=e.H;i=e.g}],execute:function(){var a='@charset "UTF-8";.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:"";-webkit-transform:translate(-50%, -48%) scale(0.73);transform:translate(-50%, -48%) scale(0.73);speak:none}';var c=e("taro_checkbox_core",function(){function e(e){var o=this;t(this,e);this.onChange=n(this,"checkboxchange",7);this.value="";this.checked=false;this.disabled=false;this.nativeProps={};this.isWillLoadCalled=false;this.handleChange=function(e){e.stopPropagation();o.onChange.emit({value:o.value})}}e.prototype.watchId=function(e){if(!this.isWillLoadCalled)return;if(e)this.inputEl.setAttribute("id",e)};e.prototype.componentWillLoad=function(){this.isWillLoadCalled=true};e.prototype.componentDidRender=function(){this.id&&this.el.removeAttribute("id")};e.prototype.render=function(){var e=this;var t=this,n=t.checked,i=t.name,a=t.color,c=t.value,l=t.disabled,u=t.nativeProps;return o(r,{className:"weui-cells_checkbox"},o("input",Object.assign({ref:function(t){if(!t)return;e.inputEl=t;if(e.id)t.setAttribute("id",e.id)},type:"checkbox",value:c,name:i,class:"taro-checkbox_checked",style:{color:a},checked:n,disabled:l,onChange:this.handleChange},u)),o("slot",null))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{id:["watchId"]}},enumerable:false,configurable:true});return e}());c.style=a;var l=e("taro_checkbox_group_core",function(){function e(e){t(this,e);this.onChange=n(this,"change",7);this.uniqueName=Date.now().toString(36)}e.prototype.function=function(e){e.stopPropagation();if(e.target.tagName!=="TARO-CHECKBOX-CORE")return;var t=this.el.querySelectorAll("taro-checkbox-core");this.value=this.getValues(t);this.onChange.emit({value:this.value})};e.prototype.componentDidLoad=function(){var e=this;var t=this.el.querySelectorAll("taro-checkbox-core");t.forEach((function(t){t.setAttribute("name",e.name||e.uniqueName)}));Object.defineProperty(this.el,"value",{get:function(){if(!e.value){var t=e.el.querySelectorAll("taro-checkbox-core");e.value=e.getValues(t)}return e.value},configurable:true})};e.prototype.getValues=function(e){return Array.from(e).filter((function(e){var t=e.querySelector("input");return t===null||t===void 0?void 0:t.checked})).map((function(e){return e.value}))};e.prototype.render=function(){return o(r,null)};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});return e}())}}}));
\No newline at end of file