"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("@aplus-frontend/antdv"),u=require("../../../../ap-form/index.js");require("../../../../config-provider/index.js");const c=require("../../../../config-provider/hooks/use-locale.js"),s=require("../../../../ap-form/items/text/index.js"),f=e.defineComponent({__name:"edit-form",props:{onConfirm:{type:Function},onCancel:{type:Function},initialValues:{},isEdit:{type:Boolean}},setup(a){const o=a,{t}=c.useLocale(),l=e.ref();async function r(){const i=await l.value?.validateFields();o.onConfirm(i?.label)}return(i,d)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(u.ApForm),{ref_key:"formRef",ref:l,colon:!1,"label-col":{span:24},"initial-values":a.initialValues},{default:e.withCtx(()=>[e.createVNode(e.unref(s.ApFormItemText),{rules:[{required:!0,message:e.unref(t)("ap.apTable.setting.templateNamePlaceholder")}],name:"label",label:a.isEdit?e.unref(t)("ap.apTable.setting.templateName"):e.unref(t)("ap.apTable.setting.newTemplateName")},null,8,["rules","label"])]),_:1},8,["initial-values"]),e.createVNode(e.unref(n.Flex),{justify:"end",gap:8},{default:e.withCtx(()=>[e.createVNode(e.unref(n.Button),{style:{height:"24px"},onClick:a.onCancel},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("ap.common.cancelText")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(n.Button),{style:{height:"24px"},type:"primary",onClick:r},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("ap.common.save")),1)]),_:1})]),_:1})]))}});exports.default=f;
