index-legacy.d39f6f47.js 1.9 KB

1
  1. System.register(["./index-legacy.eb062188.js","./Checker-legacy.9bbda964.js"],(function(e){"use strict";var l,n,a,o,t,u,d,c,i,r,s,p,m,h,b,g,V,k,f;return{setters:[function(e){l=e.t,n=e.z,a=e.u,o=e.av,t=e.d,u=e.x,d=e.Z,c=e.W,i=e.b8,r=e.c,s=e.N,p=e.v,m=e.C,h=e.y,b=e.am,g=e.E,V=e.D},function(e){k=e.c,f=e.s}],execute:function(){const[v,x]=l("checkbox-group"),y={max:n,shape:a("round"),disabled:Boolean,iconSize:n,direction:String,modelValue:o(),checkedColor:String},G=Symbol(v);e("s",t({name:v,props:y,emits:["change","update:modelValue"],setup(e,{emit:l,slots:n}){const{children:a,linkChildren:o}=u(G),t=e=>l("update:modelValue",e);return d((()=>e.modelValue),(e=>l("change",e))),c({toggleAll:(e={})=>{"boolean"==typeof e&&(e={checked:e});const{checked:l,skipDisabled:n}=e,o=a.filter((e=>!!e.props.bindGroup&&(e.props.disabled&&n?e.checked.value:null!=l?l:!e.checked.value))).map((e=>e.name));t(o)}}),i((()=>e.modelValue)),o({props:e,updateValue:t}),()=>{var l;return r("div",{class:x([e.direction])},[null==(l=n.default)?void 0:l.call(n)])}}}));const[S,C]=l("checkbox"),j=s({},k,{shape:String,bindGroup:p,indeterminate:{type:Boolean,default:null}});var z=t({name:S,props:j,emits:["change","update:modelValue"],setup(e,{emit:l,slots:n}){const{parent:a}=m(G),o=h((()=>a&&e.bindGroup?-1!==a.props.modelValue.indexOf(e.name):!!e.modelValue)),t=(n=!o.value)=>{a&&e.bindGroup?(l=>{const{name:n}=e,{max:o,modelValue:t}=a.props,u=t.slice();if(l)o&&u.length>=+o||u.includes(n)||(u.push(n),e.bindGroup&&a.updateValue(u));else{const l=u.indexOf(n);-1!==l&&(u.splice(l,1),e.bindGroup&&a.updateValue(u))}})(n):l("update:modelValue",n),null!==e.indeterminate&&l("change",n)};return d((()=>e.modelValue),(n=>{null===e.indeterminate&&l("change",n)})),c({toggle:t,props:e,checked:o}),i((()=>e.modelValue)),()=>r(f,g({bem:C,role:"checkbox",parent:a,checked:o.value,onToggle:t},e),b(n,["default","icon"]))}});e("C",V(z))}}}));