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