index-legacy.32d1c54d.js 3.7 KB

1
  1. !function(){var e=document.createElement("style");e.innerHTML=":root{--van-checkbox-size: .53333rem;--van-checkbox-border-color: var(--van-gray-5);--van-checkbox-transition-duration: var(--van-animation-duration-fast);--van-checkbox-label-margin: var(--van-padding-xs);--van-checkbox-label-color: var(--van-text-color);--van-checkbox-checked-icon-color: var(--van-primary-color);--van-checkbox-disabled-icon-color: var(--van-gray-5);--van-checkbox-disabled-label-color: var(--van-text-color-3);--van-checkbox-disabled-background-color: var(--van-border-color)}.van-checkbox{display:flex;align-items:center;overflow:hidden;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.van-checkbox--disabled{cursor:not-allowed}.van-checkbox--label-disabled{cursor:default}.van-checkbox--horizontal{margin-right:var(--van-padding-sm)}.van-checkbox__icon{flex:none;height:1em;font-size:var(--van-checkbox-size);line-height:1em;cursor:pointer}.van-checkbox__icon .van-icon{display:block;box-sizing:border-box;width:1.25em;height:1.25em;color:transparent;font-size:.8em;line-height:1.25;text-align:center;border:.02667rem solid var(--van-checkbox-border-color);transition-duration:var(--van-checkbox-transition-duration);transition-property:color,border-color,background-color}.van-checkbox__icon--round .van-icon{border-radius:100%}.van-checkbox__icon--checked .van-icon{color:var(--van-white);background-color:var(--van-checkbox-checked-icon-color);border-color:var(--van-checkbox-checked-icon-color)}.van-checkbox__icon--disabled{cursor:not-allowed}.van-checkbox__icon--disabled .van-icon{background-color:var(--van-checkbox-disabled-background-color);border-color:var(--van-checkbox-disabled-icon-color)}.van-checkbox__icon--disabled.van-checkbox__icon--checked .van-icon{color:var(--van-checkbox-disabled-icon-color)}.van-checkbox__label{margin-left:var(--van-checkbox-label-margin);color:var(--van-checkbox-label-color);line-height:var(--van-checkbox-size)}.van-checkbox__label--left{margin:0 var(--van-checkbox-label-margin) 0 0}.van-checkbox__label--disabled{color:var(--van-checkbox-disabled-label-color)}\n",document.head.appendChild(e),System.register(["./index-legacy.fba2875c.js"],(function(e){"use strict";var o,c,a,n,r,l,i,d,t,b,v,s;return{setters:[function(e){o=e.H,c=e.$,a=e.E,n=e.d,r=e.I,l=e.aw,i=e.G,d=e.S,t=e.V,b=e.j,v=e.M,s=e.a1}],execute:function(){var h=e("c",{name:o,shape:c("round"),disabled:Boolean,iconSize:a,modelValue:o,checkedColor:String,labelPosition:String,labelDisabled:Boolean});e("s",n({props:r({},h,{bem:l(Function),role:String,parent:Object,checked:Boolean,bindGroup:i}),emits:["click","toggle"],setup:function(e,o){var c=o.emit,a=o.slots,n=d(),r=function(o){if(e.parent&&e.bindGroup)return e.parent.props[o]},l=t((function(){return r("disabled")||e.disabled})),i=t((function(){return r("direction")})),h=t((function(){var o=e.checkedColor||r("checkedColor");if(o&&e.checked&&!l.value)return{borderColor:o,backgroundColor:o}})),u=function(o){var a=o.target,r=n.value,i=r===a||(null==r?void 0:r.contains(a));l.value||!i&&e.labelDisabled||c("toggle"),c("click",o)},k=function(){var o=e.bem,c=e.shape,i=e.checked,d=e.iconSize||r("iconSize");return b("div",{ref:n,class:o("icon",[c,{disabled:l.value,checked:i}]),style:{fontSize:s(d)}},[a.icon?a.icon({checked:i,disabled:l.value}):b(v,{name:"success",style:h.value},null)])},x=function(){if(a.default)return b("span",{class:e.bem("label",[e.labelPosition,{disabled:l.value}])},[a.default()])};return function(){var o="left"===e.labelPosition?[x(),k()]:[k(),x()];return b("div",{role:e.role,class:e.bem([{disabled:l.value,"label-disabled":e.labelDisabled},i.value]),tabindex:l.value?void 0:0,"aria-checked":e.checked,onClick:u},[o])}}}))}}}))}();