import{A as C,f as E}from"./fields-DdKV2UAS.js";import{_ as k,x as T,Z as b,a as $,r as p,e as A,o as a,g as v,f as u,w as s,V as d,F as h,c as n,J as g,p as w,B as S,ah as B}from"./app-DGDivIsO.js";const D=T({props:{btnType:{default:"default"},tooltip:{default:!0},customType:{default:"button"}},emits:["onAddSuccess"],components:{PlusOutlined:b,AddEdit:C},setup(e,{emit:c}){const{permsArray:m}=$(),{initData:l,addEditUrl:f}=E(),o=p(!1),i=p("add"),t=p({...l});return{permsArray:m,visible:o,addEditType:i,addEditUrl:f,formData:t,addEditSuccess:()=>{o.value=!1,t.value={...l},c("onAddSuccess")},onClose:()=>{o.value=!1},showAdd:()=>{o.value=!0}}}}),L={key:0};function O(e,c,m,l,f,o){const i=w,t=A("PlusOutlined"),r=S,y=B,_=A("AddEdit");return e.permsArray.includes("leave_types_create")||e.permsArray.includes("admin")?(a(),v("div",L,[e.customType=="menu"?(a(),u(i,{onClick:e.showAdd,key:"leave_types"},{icon:s(()=>[d(e.$slots,"icon")]),default:s(()=>[d(e.$slots,"default")]),_:3},8,["onClick"])):(a(),v(h,{key:1},[e.tooltip?(a(),u(y,{key:0,placement:"topLeft",title:e.$t("leave_type.add"),"arrow-point-at-center":""},{default:s(()=>[n(r,{onClick:e.showAdd,class:"ml-5 no-border-radius",type:e.btnType},{icon:s(()=>[n(t)]),default:s(()=>[d(e.$slots,"default")]),_:3},8,["onClick","type"])]),_:3},8,["title"])):(a(),u(r,{key:1,onClick:e.showAdd,class:"ml-5 no-border-radius",type:e.btnType},{icon:s(()=>[n(t)]),default:s(()=>[d(e.$slots,"default")]),_:3},8,["onClick","type"]))],64)),n(_,{addEditType:e.addEditType,visible:e.visible,url:e.addEditUrl,onAddEditSuccess:e.addEditSuccess,onClosed:e.onClose,formData:e.formData,data:e.formData,pageTitle:e.$t("leave_type.add"),successMessage:e.$t("leave_type.created")},null,8,["addEditType","visible","url","onAddEditSuccess","onClosed","formData","data","pageTitle","successMessage"])])):g("",!0)}const F=k(D,[["render",O]]);export{F as L};
