1 |
- System.register(["./index-legacy.90c82f08.js"],(function(e){"use strict";var l,n,i,a,o,c,t,r,u,d,s,b;return{setters:[function(e){l=e.O,n=e.u,i=e.z,a=e.d,o=e.N,c=e.aB,t=e.v,r=e.R,u=e.y,d=e.c,s=e.a5,b=e.U}],execute:function(){var v=e("c",{name:l,shape:n("round"),disabled:Boolean,iconSize:i,modelValue:l,checkedColor:String,labelPosition:String,labelDisabled:Boolean});e("s",a({props:o({},v,{bem:c(Function),role:String,parent:Object,checked:Boolean,bindGroup:t}),emits:["click","toggle"],setup:function(e,l){var n=l.emit,i=l.slots,a=r(),o=function(l){if(e.parent&&e.bindGroup)return e.parent.props[l]},c=u((function(){return o("disabled")||e.disabled})),t=u((function(){return o("direction")})),v=u((function(){var l=e.checkedColor||o("checkedColor");if(l&&e.checked&&!c.value)return{borderColor:l,backgroundColor:l}})),f=function(l){var i=l.target,o=a.value,t=o===i||(null==o?void 0:o.contains(i));c.value||!t&&e.labelDisabled||n("toggle"),n("click",l)},k=function(){var l=e.bem,n=e.shape,t=e.checked,r=e.iconSize||o("iconSize");return d("div",{ref:a,class:l("icon",[n,{disabled:c.value,checked:t}]),style:{fontSize:b(r)}},[i.icon?i.icon({checked:t,disabled:c.value}):d(s,{name:"success",style:v.value},null)])},p=function(){if(i.default)return d("span",{class:e.bem("label",[e.labelPosition,{disabled:c.value}])},[i.default()])};return function(){var l="left"===e.labelPosition?[p(),k()]:[k(),p()];return d("div",{role:e.role,class:e.bem([{disabled:c.value,"label-disabled":e.labelDisabled},t.value]),tabindex:c.value?void 0:0,"aria-checked":e.checked,onClick:f},[l])}}}))}}}));
|