import{d as h,aa as g,w,i as _,j as e,aC as b,t as s,C,c,g as N,J as n,_ as B,P as H,B as k,am as y,Q as D}from"./index-DOFLUERq.js";import{_ as S}from"./_plugin-vue_export-helper-DlAUqK2U.js";const M={class:"dialog-content"},P={class:"form-field"},V={class:"field-label"},A=h({__name:"HeaderDialog",props:{show:{type:Boolean},values:{}},emits:["update:show","submit"],setup(m,{emit:p}){const o=m,u=p,v=g(),l=c({get:()=>o.show,set:a=>u("update:show",a)}),r=c(()=>!!o.values?.name),t=D({text:"",name:""});w(()=>o.show,a=>{a&&(o.values?(t.text=o.values.text||"",t.name=o.values.name||""):(t.text="",t.name=""))},{immediate:!0});function f(){if(!t.text.trim())return v.error(s("Please enter header text")),!1;const a={...t};return!r.value&&!a.name&&(a.name=`header-${Math.random().toString(36).substring(2,12)}`),u("submit",a),l.value=!1,!0}function x(){l.value=!1}return(a,i)=>(N(),_(e(b),{show:l.value,"onUpdate:show":i[1]||(i[1]=d=>l.value=d),preset:"dialog",title:r.value?e(s)("Edit Header"):e(s)("Add Header"),"positive-text":r.value?e(s)("Save"):e(s)("Add"),"negative-text":e(s)("Cancel"),onPositiveClick:f,onNegativeClick:x,style:{width:"500px"}},{default:C(()=>[n("div",M,[n("div",P,[n("label",V,[B(H(e(s)("Header Text"))+" ",1),i[2]||(i[2]=n("span",{class:"required"},"*",-1))]),k(e(y),{value:t.text,"onUpdate:value":i[0]||(i[0]=d=>t.text=d),type:"textarea",rows:2,placeholder:e(s)("Enter header text")},null,8,["value","placeholder"])])])]),_:1},8,["show","title","positive-text","negative-text"]))}}),T=S(A,[["__scopeId","data-v-4cb5a647"]]);export{T as default};
