import{defineComponent as v,inject as $,createVNode as R}from"vue";import _ from"../../_util/BaseInput.mjs";import z from"../../_util/classNames.mjs";import{cloneElement as A}from"../../_util/vnode.mjs";import e from"../../_util/vue-types/index.mjs";const k={inputRef:e.any,prefixCls:String,id:String,inputElement:e.VueNode,disabled:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},autocomplete:String,editable:{type:Boolean,default:void 0},activeDescendantId:String,value:String,open:{type:Boolean,default:void 0},tabindex:e.oneOfType([e.number,e.string]),attrs:e.object,onKeydown:{type:Function},onMousedown:{type:Function},onChange:{type:Function},onPaste:{type:Function},onCompositionstart:{type:Function},onCompositionend:{type:Function},onFocus:{type:Function},onBlur:{type:Function}},Q=v({compatConfig:{MODE:3},name:"SelectInput",inheritAttrs:!1,props:k,setup(b){let s=null;const u=$("VCSelectContainerEvent");return()=>{const{prefixCls:g,id:i,inputElement:F,disabled:w,tabindex:B,autofocus:O,autocomplete:x,editable:t,activeDescendantId:S,value:I,onKeydown:h,onMousedown:E,onChange:M,onPaste:D,onCompositionstart:K,onCompositionend:P,onFocus:a,onBlur:p,open:T,inputRef:N,attrs:V}=b;let n=F||R(_,null,null);const r=n.props||{},{onKeydown:l,onInput:c,onFocus:d,onBlur:m,onMousedown:f,onCompositionstart:y,onCompositionend:C,style:j}=r;return n=A(n,Object.assign({type:"search",...r,id:i,ref:N,disabled:w,tabindex:B,lazy:!1,autocomplete:x||"off",autofocus:O,class:z(`${g}-selection-search-input`,n?.props?.class),role:"combobox","aria-expanded":T,"aria-haspopup":"listbox","aria-owns":`${i}_list`,"aria-autocomplete":"list","aria-controls":`${i}_list`,"aria-activedescendant":S,...V,value:t?I:"",readonly:!t,unselectable:t?null:"on",style:{...j,opacity:t?null:0},onKeydown:o=>{h(o),l&&l(o)},onMousedown:o=>{E(o),f&&f(o)},onInput:o=>{M(o),c&&c(o)},onCompositionstart(o){K(o),y&&y(o)},onCompositionend(o){P(o),C&&C(o)},onPaste:D,onFocus:(...o)=>{clearTimeout(s),d&&d(o[0]),a&&a(o[0]),u?.focus(o[0])},onBlur:(...o)=>{s=setTimeout(()=>{m&&m(o[0]),p&&p(o[0]),u?.blur(o[0])},100)}},n.type==="textarea"?{}:{type:"search"}),!0,!0),n}}});export{Q as default,k as inputProps};
