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