@aplus-frontend/ui
Version:
73 lines (72 loc) • 2.25 kB
JavaScript
import { defineComponent as w, computed as v, unref as r, createElementBlock as u, openBlock as o, createVNode as c, withCtx as a, Fragment as f, renderList as b, createBlock as d, mergeProps as x, resolveDynamicComponent as B } from "vue";
import { Row as V, Col as m, Checkbox as I } from "@aplus-frontend/antdv";
import "../select-group/index.vue.mjs";
import { useInjectApTable as L } from "../../../context.mjs";
import { getLabelNode as N } from "../utils.mjs";
import P from "../select-group/index.vue2.mjs";
const F = /* @__PURE__ */ w({
__name: "index",
props: {
value: {}
},
setup(p) {
const i = p, { columnsBackup: h, renderConfig: k } = L(), g = v(() => [...r(h) || []].sort((e, t) => e.children?.length && !t.children?.length ? 1 : !e.children?.length && t.children?.length ? -1 : 0));
function s(n) {
return i.value.find((e) => e.key === n.key);
}
function C(n) {
const e = s(n);
return {
checked: e?.show,
disabled: e?.disabled
};
}
function _(n, e) {
const l = i.value?.find((y) => y.key === n);
l && (l.show = e);
}
return (n, e) => (o(), u("div", null, [
c(r(V), {
gutter: [24, 12],
align: "middle"
}, {
default: a(() => [
(o(!0), u(f, null, b(g.value, (t) => (o(), u(f, {
key: t.key
}, [
t.children?.length ? (o(), d(r(m), {
key: 1,
span: 24
}, {
default: a(() => [
c(P, {
value: s(t)
}, null, 8, ["value"])
]),
_: 2
}, 1024)) : (o(), d(r(m), {
key: 0,
span: 8
}, {
default: a(() => [
c(r(I), x({ ref_for: !0 }, C(t), {
"onUpdate:checked": (l) => _(t.key, l)
}), {
default: a(() => [
(o(), d(B(r(N)(t, r(k)))))
]),
_: 2
}, 1040, ["onUpdate:checked"])
]),
_: 2
}, 1024))
], 64))), 128))
]),
_: 1
})
]));
}
});
export {
F as default
};