"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("@ant-design/icons-vue"),c=require("@aplus-frontend/antdv");require("../../../../config-provider/index.js");const p=require("../context.js");require("./edit-form.vue.js");const f=require("../../../../config-provider/hooks/use-namespace.js"),v=require("./edit-form.vue2.js"),C=e.defineComponent({__name:"item",props:{value:{},isActive:{type:Boolean},onClick:{type:Function},shouldRemove:{type:Boolean}},setup(n){const r=n,{b:l}=f.useNamespace("ap-column-setting-template-item"),o=e.ref(!1),{deleteTemplate:m,cacheConfig:u}=p.useInjectApColumnSetting();function d(a){if(!a||a===r.value.label)return;const t=r.value;t.label=a,u.value?.onChange?.(t.columnState,t),o.value=!1}return(a,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(l)(),{[e.unref(l)("active")]:n.isActive}]),onClick:t[4]||(t[4]=(...i)=>n.onClick&&n.onClick(...i))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(l)("label"))},e.toDisplayString(n.value.label),3),e.unref(u).persistenceKey?(e.openBlock(),e.createBlock(e.unref(c.Flex),{key:0,gap:8,class:e.normalizeClass(e.unref(l)("action-wrapper"))},{default:e.withCtx(()=>[e.createVNode(e.unref(c.Popover),{open:o.value,"onUpdate:open":t[2]||(t[2]=i=>o.value=i),trigger:"click",arrow:!1,placement:"bottom","destroy-tooltip-on-hide":""},{content:e.withCtx(()=>[e.createVNode(v.default,{"is-edit":"","initial-values":{label:n.value.label},onConfirm:d,onCancel:t[1]||(t[1]=()=>o.value=!1)},null,8,["initial-values"])]),default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(e.unref(l)("icon-wrapper")),onClick:t[0]||(t[0]=e.withModifiers(i=>o.value=!0,["stop"]))},[e.createVNode(e.unref(s.EditOutlined))],2)]),_:1},8,["open"]),n.shouldRemove?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(l)("icon-wrapper")),onClick:t[3]||(t[3]=e.withModifiers(()=>e.unref(m)(n.value.key),["stop"]))},[e.createVNode(e.unref(s.DeleteOutlined))],2)):e.createCommentVNode("",!0)]),_:1},8,["class"])):e.createCommentVNode("",!0)],2))}});exports.default=C;
