@aplus-frontend/ui
Version:
52 lines (51 loc) • 1.84 kB
JavaScript
import { defineComponent as v, createBlock as l, openBlock as a, unref as e, normalizeClass as s, withCtx as d, createElementVNode as r, createVNode as f, toDisplayString as y, createElementBlock as g, Fragment as k, renderList as _ } from "vue";
import { Flex as h, Divider as C } from "@aplus-frontend/antdv";
import "../../../../config-provider/index.mjs";
import { useInjectApColumnSetting as L } from "../context.mjs";
import "./item.vue.mjs";
import { useLocale as x } from "../../../../config-provider/hooks/use-locale.mjs";
import { useNamespace as z } from "../../../../config-provider/hooks/use-namespace.mjs";
import A from "./item.vue2.mjs";
const j = /* @__PURE__ */ v({
__name: "index",
props: {
customizeTemplateList: {},
persistenceKey: {},
onActiveChange: { type: Function }
},
setup(B, { expose: c }) {
const { t: m } = x(), { b: o } = z("ap-column-setting-template-list"), { activeKey: n } = L();
function p(t) {
n.value = t;
}
function u(t) {
n.value = t;
}
return c({ updateActiveKey: u }), (t, F) => (a(), l(e(h), {
vertical: "",
class: s(e(o)())
}, {
default: d(() => [
r("div", {
class: s(e(o)("title"))
}, y(e(m)("ap.apTable.setting.templateSetting")), 3),
f(e(C), { style: { margin: "0" } }),
r("div", {
class: s(e(o)("content"))
}, [
(a(!0), g(k, null, _(t.customizeTemplateList, (i) => (a(), l(A, {
key: i.key,
value: i,
"is-active": e(n) === i.key,
"should-remove": t.customizeTemplateList.length > 1,
onClick: () => p(i.key)
}, null, 8, ["value", "is-active", "should-remove", "onClick"]))), 128))
], 2)
]),
_: 1
}, 8, ["class"]));
}
});
export {
j as default
};