var x=Object.defineProperty,V=Object.defineProperties;var b=Object.getOwnPropertyDescriptors;var m=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var u=(t,e,o)=>e in t?x(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,d=(t,e)=>{for(var o in e||(e={}))y.call(e,o)&&u(t,o,e[o]);if(m)for(var o of m(e))h.call(e,o)&&u(t,o,e[o]);return t},c=(t,e)=>V(t,b(e));import{H as w,I as _}from"./bootstrap-Bqxdt4iG.js";import k from"./index-32EZ6Zls.js";import D from"./index-DL4Zx5Zk.js";import{a1 as M,aW as R,aK as A,aX as B,L as I,E as P,ai as S,ag as T,a9 as f,f as n,aj as j}from"../jse/index-index-BUJ_4tQs.js";import"./index-BZFH0uEW.js";import"./Trigger-CftQioxV.js";import"./ResizeObserver.es-CDE7jhPe.js";import"./BaseInput-hWv8kcd0.js";import"./css-BPcmMxJM.js";import"./Overflow-CeWBpt44.js";import"./index-BNdxtbnh.js";import"./isMobile-8sZ0LT6r.js";import"./DownOutlined-Dq3ZoN1L.js";import"./CheckOutlined-CyOADmg7.js";import"./SearchOutlined-D1HVVwei.js";import"./move-DY-9c5GY.js";import"./slide-DUltH_8g.js";import"./useMergedState-mzgb8Um4.js";import"./FormItemContext-DjC4AFm9.js";import"./statusUtils-BYtfCLmZ.js";const ae=M({name:"ApiSelectCreatable",__name:"api-select-creatable",props:R({createText:{default:"新建"},onCreate:{type:Function,default:void 0},showCreate:{type:Boolean,default:!0}},{modelValue:{default:void 0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,o=A(),l=B(t,"modelValue"),p=I(null),v=r=>{var a,i,s;r.preventDefault(),r.stopPropagation(),(i=(a=p.value)==null?void 0:a.getComponentRef())==null||i.blur(),(s=e.onCreate)==null||s.call(e)},C=({menuNode:r})=>!e.showCreate||!e.onCreate?r:n("div",[n("div",{class:"flex cursor-pointer items-center gap-2 px-3 py-2 text-primary hover:bg-accent",onMousedown:a=>a.preventDefault(),onClick:v},[n(_,{icon:"ant-design:plus-outlined",class:"size-4"}),n("span",e.createText)]),n(D,{style:{margin:"4px 0"}}),r]),g=P(()=>c(d({},o),{dropdownRender:C}));return(r,a)=>(j(),S(f(w),T({ref_key:"apiComponentRef",ref:p,modelValue:l.value,"onUpdate:modelValue":a[0]||(a[0]=i=>l.value=i),component:f(k),"loading-slot":"suffixIcon","model-prop-name":"value","visible-event":"onDropdownVisibleChange"},g.value),null,16,["modelValue","component"]))}});export{ae as default};
