import{slicedToArray as e}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import o,{useState as n}from"react";import l from"../hooks/useDropdownCombobox.js";import t from"../components/DropdownWrapperUI.js";var i=function(i){var u=i.options,r=i.isMenuOpen,s=i.autoFocus,a=i.closeMenuOnSelect,d=void 0===a||a,c=i.defaultValue,p=i.value,g=i.inputValue,m=i.onChange,v=i.onInputChange,f=i.onMenuClose,O=i.onMenuOpen,b=i.onOptionSelect,I=i.filterOption,h=i.showSelectedOptions,P=void 0===h||h,M=i.clearable,w=void 0===M||M,j=i.searchable,x=void 0===j||j,B=i.multi,C=void 0!==B&&B,S=i.dropdownRef,y=i.onFocus,D=i.onBlur,F=i.onKeyDown,V=i.onClear,K=i.loading,R=void 0!==K&&K,T=i.size,z=void 0===T?"medium":T,L=i.id,_=i.readOnly,k=i.disabled,A=n(!1),E=e(A,2),H=E[0],U=E[1],W=l(u,r,s,d,c,p,g,m,v,f,O,(function(e){null==b||b(e),e&&U(!1)}),I,P,L),q=W.isOpen,G=W.inputValue,J=W.highlightedIndex,N=W.getToggleButtonProps,Q=W.getLabelProps,X=W.getMenuProps,Y=W.getItemProps,Z=W.getInputProps,$=W.reset,ee=W.filteredOptions,oe=W.selectedItem,ne=W.toggleMenu,le=Object.assign(Object.assign({},i),{isOpen:q,inputValue:null!=G?G:null,highlightedIndex:J,selectedItem:oe,selectedItems:[],filteredOptions:ee,getToggleButtonProps:N,getLabelProps:Q,getMenuProps:X,getItemProps:Y,getInputProps:function(e){return Z(Object.assign(Object.assign({},e||{}),{disabled:_||k,onFocus:function(o){var n;U(!0),null==y||y(o),null===(n=null==e?void 0:e.onFocus)||void 0===n||n.call(e,o)},onBlur:function(o){var n;U(!1),null==D||D(o),null===(n=null==e?void 0:e.onBlur)||void 0===n||n.call(e,o)},onKeyDown:function(o){var n;null==F||F(o),null===(n=null==e?void 0:e.onKeyDown)||void 0===n||n.call(e,o)}}))},reset:$,contextOnClear:function(){$(),null==V||V()},contextOnOptionRemove:function(){},addSelectedItem:void 0,removeSelectedItem:void 0,isFocused:H,clearable:w,searchable:x,multi:C,closeMenuOnSelect:d,size:z,toggleMenu:ne,loading:R});return o.createElement(t,{contextValue:le,dropdownRef:S})};export{i as default};
//# sourceMappingURL=DropdownComboboxController.js.map
