"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("@aplus-frontend/antdv");require("../../../../config-provider/index.js");const g=require("../../../context.js"),m=require("../utils.js"),y=require("../../../../config-provider/hooks/use-namespace.js"),B=e.defineComponent({__name:"index",props:{value:{}},setup(u){const r=u,{b:d}=y.useNamespace("ap-column-setting-select-group"),a=e.ref(!1),{columnsBackup:k,renderConfig:i}=g.useInjectApTable(),h=e.computed(()=>e.unref(k)?.find(o=>o.key===r.value?.key));function v(t){const o=r.value.children.find(n=>n.key===t.key);return{checked:o?.show,disabled:r.value.disabled||o?.disabled}}function p(t){const o=r.value;o.children.forEach(n=>n.show=t),o.show=t,a.value=!1}function w(t,o){const n=r.value,l=n.children.find(c=>c.key===t);if(!l)return;l.show=o;const f=n.children.every(c=>c.show),b=n.children.some(c=>c.show);n.show=f,a.value=b&&!f}const C=e.computed(()=>r.value.disabled||r.value.children.every(t=>t.disabled));return e.watch(()=>r.value,t=>{const o=t.children.every(l=>l.show),n=t.children.some(l=>l.show);a.value=n&&!o,t.show!==o&&(t.show=o)},{deep:!0,immediate:!0}),(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(d)())},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(d)("header"))},[e.createVNode(e.unref(s.Checkbox),{indeterminate:a.value,checked:u.value?.show,disabled:C.value,"onUpdate:checked":p},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(m.getLabelNode)(h.value,e.unref(i)))))]),_:1},8,["indeterminate","checked","disabled"])],2),e.createElementVNode("div",null,[e.createVNode(e.unref(s.Row),{align:"middle",gutter:24},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.children,n=>(e.openBlock(),e.createBlock(e.unref(s.Col),{key:n.key,span:12},{default:e.withCtx(()=>[e.createVNode(e.unref(s.Checkbox),e.mergeProps({ref_for:!0},v(n),{"onUpdate:checked":l=>w(n.key,l)}),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(m.getLabelNode)(n,e.unref(i)))))]),_:2},1040,["onUpdate:checked"])]),_:2},1024))),128))]),_:1})])],2))}});exports.default=B;
