index-legacy-f3022676.js 1.7 KB

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