!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8213:e=>{e.exports=require("@babel/runtime/helpers/extends")},3838:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},6689:e=>{e.exports=require("react")},1929:e=>{e.exports=require("react-select")}},r={};function t(o){var n=r[o];if(void 0!==n)return n.exports;var a=r[o]={exports:{}};return e[o](a,a.exports,t),a.exports}(()=>{t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r}})(),(()=>{t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})}})(),(()=>{t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};return(()=>{t.r(o),t.d(o,{default:()=>f});var e=t(8213),r=t.n(e),n=t(8779),a=t.n(n),l=t(3838),s=t.n(l),i=t(6689),p=t.n(i),u=t(1929),c=t.n(u);const d=["onChange","value","className","error","clearable","disabled","overrideCSS","ariaLabelledBy"];function b(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function h(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?b(Object(t),!0).forEach((function(r){a()(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):b(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}class f extends p().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this)}handleChange(e){let r=null;r=this.props.isMulti?e?e.map((e=>e.value)):null:e?e.value:null;let t={target:{id:this.props.id,value:r,type:"dropdown"}};this.props.onChange(t)}render(){let e=this.props,{onChange:t,value:o,className:n,error:a,clearable:l,disabled:i,overrideCSS:u,ariaLabelledBy:b}=e,f=s()(e,d),y=this.props.hasOwnProperty("error")&&""!=a,O=this.props.hasOwnProperty("clearable"),m=this.props.hasOwnProperty("disabled")&&1==i,v=null,g=n;this.props.hasOwnProperty("overrideCSS")&&0!=u||(g="dropdown "+n+" "+(y?"error":"")),v=this.props.isMulti?this.props.options.filter((e=>o.includes(e.value))):o instanceof Object||null==o?o:this.props.options.find((e=>e.value==o));const j={menu:e=>h(h({},e),{},{zIndex:999})};return p().createElement("div",null,p().createElement(c(),r()({className:g,value:v,onChange:this.handleChange,isClearable:O,isDisabled:m,styles:j,"aria-labelledby":b,formatOptionLabel:e=>p().createElement("span",{dangerouslySetInnerHTML:{__html:e.label}})},f)),y&&p().createElement("p",{className:"error-label"},a))}}f.defaultProps={ariaLabelledBy:null}})(),o})()));
//# sourceMappingURL=dropdown.js.map