index-legacy-cd38aed6.js 2.3 KB

1
  1. System.register(["./index-legacy-66809900.js"],(function(e,l){"use strict";var a,o,n,t,i,d,r,c,s,u,b,p,m,v,g,h,k,f,S,V;return{setters:[e=>{a=e.b6,o=e.d,n=e.b7,t=e.w,i=e.b8,d=e.h,r=e.b9,c=e.ba,s=e.bb,u=e.bc,b=e.bd,p=e.be,m=e.bf,v=e.l,g=e.e,h=e.I,k=e.bg,f=e.bh,S=e.bi,V=e.bj}],execute:function(){const[l,C]=a("radio-group"),y={disabled:Boolean,iconSize:r,direction:String,modelValue:c,checkedColor:String},z=Symbol(l);var B=o({name:l,props:y,emits:["change","update:modelValue"],setup(e,{emit:l,slots:a}){const{linkChildren:o}=n(z);return t((()=>e.modelValue),(e=>l("change",e))),o({props:e,updateValue:e=>l("update:modelValue",e)}),i((()=>e.modelValue)),()=>{var l;return d("div",{class:C([e.direction]),role:"radiogroup"},[null==(l=a.default)?void 0:l.call(a)])}}});e("R",s(B));const j={name:c,shape:u("round"),disabled:Boolean,iconSize:r,modelValue:c,checkedColor:String,labelPosition:String,labelDisabled:Boolean};var x=o({props:b({},j,{bem:p(Function),role:String,parent:Object,checked:Boolean,bindGroup:m}),emits:["click","toggle"],setup(e,{emit:l,slots:a}){const o=v(),n=l=>{if(e.parent&&e.bindGroup)return e.parent.props[l]},t=g((()=>n("disabled")||e.disabled)),i=g((()=>n("direction"))),r=g((()=>{const l=e.checkedColor||n("checkedColor");if(l&&e.checked&&!t.value)return{borderColor:l,backgroundColor:l}})),c=a=>{const{target:n}=a,i=o.value,d=i===n||(null==i?void 0:i.contains(n));t.value||!d&&e.labelDisabled||l("toggle"),l("click",a)},s=()=>{const{bem:l,shape:i,checked:c}=e,s=e.iconSize||n("iconSize");return d("div",{ref:o,class:l("icon",[i,{disabled:t.value,checked:c}]),style:{fontSize:k(s)}},[a.icon?a.icon({checked:c,disabled:t.value}):d(h,{name:"success",style:r.value},null)])},u=()=>{if(a.default)return d("span",{class:e.bem("label",[e.labelPosition,{disabled:t.value}])},[a.default()])};return()=>{const l="left"===e.labelPosition?[u(),s()]:[s(),u()];return d("div",{role:e.role,class:e.bem([{disabled:t.value,"label-disabled":e.labelDisabled},i.value]),tabindex:t.value?void 0:0,"aria-checked":e.checked,onClick:c},[l])}}});const[D,P]=a("radio");var G=o({name:D,props:j,emits:["update:modelValue"],setup(e,{emit:l,slots:a}){const{parent:o}=f(z),n=()=>{o?o.updateValue(e.name):l("update:modelValue",e.name)};return()=>d(x,V({bem:P,role:"radio",parent:o,checked:(o?o.props.modelValue:e.modelValue)===e.name,onToggle:n},e),S(a,["default","icon"]))}});e("a",s(G))}}}));