"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),S=require("../_util/classNames.js"),y=require("../_util/omit.js"),pe=require("../_util/props-util/initDefaultProps.js"),O=require("../_util/statusUtils.js"),w=require("../_util/transition.js"),l=require("../_util/type.js"),v=require("../_util/vue-types/index.js"),ve=require("../config-provider/DisabledContext.js"),fe=require("../config-provider/hooks/useConfigInject.js"),ge=require("../config-provider/renderEmpty.js"),x=require("../form/FormItemContext.js"),he=require("../space/Compact.js");require("../vc-select/BaseSelect.js");const Ce=require("../vc-select/OptGroup.js"),Ie=require("../vc-select/Option.js"),T=require("../vc-select/Select.js"),be=require("./style/index.js"),Se=require("./utils/iconUtil.js"),q=()=>({...y.default(T.selectProps(),["inputIcon","mode","getInputElement","getRawInputElement","backfill"]),value:l.someType([Array,Object,String,Number]),defaultValue:l.someType([Array,Object,String,Number]),notFoundContent:v.default.any,suffixIcon:v.default.any,itemIcon:v.default.any,size:l.stringType(),mode:l.stringType(),bordered:l.booleanType(!0),transitionName:String,choiceTransitionName:l.stringType(""),popupClassName:String,dropdownClassName:String,placement:l.stringType(),status:l.stringType(),"onUpdate:value":l.functionType()}),N="SECRET_COMBOBOX_MODE_DO_NOT_USE",a=t.defineComponent({compatConfig:{MODE:3},name:"ASelect",Option:Ie.default,OptGroup:Ce.default,inheritAttrs:!1,props:pe.default(q(),{listHeight:256,listItemHeight:24}),SECRET_COMBOBOX_MODE_DO_NOT_USE:N,slots:Object,setup(e,{attrs:f,emit:m,slots:r,expose:E}){const s=t.ref(),p=x.useInjectFormItemContext(),d=x.FormItemInputContext.useInject(),R=t.computed(()=>O.getMergedStatus(d.status,e.status)),F=()=>{s.value?.focus()},D=()=>{s.value?.blur()},P=o=>{s.value?.scrollTo(o)},c=t.computed(()=>{const{mode:o}=e;if(o!=="combobox")return o===N?"combobox":o}),{prefixCls:n,direction:u,renderEmpty:_,size:M,getPrefixCls:A,getPopupContainer:$,disabled:j,select:B}=fe.default("select",e),{compactSize:G,compactItemClassnames:z}=he.useCompactItemContext(n,u),g=t.computed(()=>G.value||M.value),H=ve.useInjectDisabled(),U=t.computed(()=>j.value??H.value),[k,h]=be.default(n),L=t.computed(()=>A()),V=t.computed(()=>e.placement!==void 0?e.placement:u.value==="rtl"?"bottomRight":"bottomLeft"),W=t.computed(()=>w.getTransitionName(L.value,w.getTransitionDirection(V.value),e.transitionName)),X=t.computed(()=>S.default({[`${n.value}-lg`]:g.value==="large",[`${n.value}-sm`]:g.value==="small",[`${n.value}-rtl`]:u.value==="rtl",[`${n.value}-borderless`]:!e.bordered,[`${n.value}-in-form-item`]:d.isFormItemInput},O.getStatusClassNames(n.value,R.value,d.hasFeedback),z.value,h.value)),J=(...o)=>{m("update:value",o[0]),m("change",...o),p.onFieldChange()},K=o=>{m("blur",o),p.onFieldBlur()};E({blur:D,focus:F,scrollTo:P});const C=t.computed(()=>c.value==="multiple"||c.value==="tags"),Q=t.computed(()=>e.showArrow!==void 0?e.showArrow:e.loading||!(C.value||c.value==="combobox"));return()=>{const{notFoundContent:o,listHeight:Y=256,listItemHeight:Z=24,popupClassName:ee,dropdownClassName:te,virtual:oe,dropdownMatchSelectWidth:ne,id:re=p.id.value,placeholder:ae=r.placeholder?.(),showArrow:le}=e,{hasFeedback:I,feedbackIcon:ue}=d;let i;o!==void 0?i=o:r.notFoundContent?i=r.notFoundContent():c.value==="combobox"?i=null:i=_?.("Select")||t.createVNode(ge.DefaultRenderEmpty,{componentName:"Select"},null);const{suffixIcon:ce,itemIcon:ie,removeIcon:se,clearIcon:de}=Se.default({...e,multiple:C.value,prefixCls:n.value,hasFeedback:I,feedbackIcon:ue,showArrow:Q.value},r),b=y.default(e,["prefixCls","suffixIcon","itemIcon","removeIcon","clearIcon","size","bordered","status"]),me=S.default(ee||te,{[`${n.value}-dropdown-${u.value}`]:u.value==="rtl"},h.value);return k(t.createVNode(T.default,{ref:s,virtual:oe,dropdownMatchSelectWidth:ne,...b,...f,showSearch:e.showSearch??B?.value?.showSearch,placeholder:ae,listHeight:Y,listItemHeight:Z,mode:c.value,prefixCls:n.value,direction:u.value,inputIcon:ce,menuItemSelectedIcon:ie,removeIcon:se,clearIcon:de,notFoundContent:i,class:[X.value,f.class],getPopupContainer:$?.value,dropdownClassName:me,onChange:J,onBlur:K,id:re,dropdownRender:b.dropdownRender||r.dropdownRender,transitionName:W.value,children:r.default?.(),tagRender:e.tagRender||r.tagRender,optionLabelRender:r.optionLabel,maxTagPlaceholder:e.maxTagPlaceholder||r.maxTagPlaceholder,showArrow:I||le,disabled:U.value},{option:r.option}))}}});a.install=function(e){return e.component(a.name,a),e.component(a.Option.displayName,a.Option),e.component(a.OptGroup.displayName,a.OptGroup),e};const Oe=a.Option,we=a.OptGroup;exports.SelectOptGroup=we;exports.SelectOption=Oe;exports.default=a;exports.selectProps=q;
