!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={6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},8619:e=>{e.exports=require("@mui/material")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")}},r={};function t(o){var l=r[o];if(void 0!==l)return l.exports;var n=r[o]={exports:{}};return e[o](n,n.exports,t),n.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={};t.r(o),t.d(o,{default:()=>v});var l=t(6031),n=t.n(l),a=t(2462),i=t.n(a),u=t(2015),s=t.n(u),p=t(6842),d=t.n(p),c=t(8619),b=t(9825),f=t.n(b);const m=["id","value","options","placeholder","label","onChange"],y=e=>{let{id:r,value:t,options:o,placeholder:l,label:a,onChange:u}=e,p=i()(e,m);const b=l||d().translate("placeholders.select"),f=o??[];return s().createElement(c.FormControl,{fullWidth:!0},a&&s().createElement(c.InputLabel,{id:`${r}-label`,shrink:!0},a),s().createElement(c.Select,n()({value:t,label:a,onChange:u,labelId:`${r}-label`,displayEmpty:!0},p,{renderValue:e=>{if(null==e||""===e||Array.isArray(e)&&0===e.length)return s().createElement("em",null,b);if(Array.isArray(e)){const r=Object.fromEntries(f.map((e=>[e.value,e.label])));return e.map((e=>r[e])).filter(Boolean).join(", ")}const r=f.find((({value:r})=>r===e));return r?r.label:""}}),f.map((e=>s().createElement(c.MenuItem,{key:`selectop-${e.value}`,value:e.value,disabled:e.disabled},e.label)))))};y.propTypes={id:f().string.isRequired,value:f().oneOfType([f().string,f().number,f().array]),options:f().arrayOf(f().shape({value:f().oneOfType([f().string,f().number]).isRequired,label:f().string.isRequired,disabled:f().bool})),label:f().string,placeholder:f().string,onChange:f().func.isRequired},y.defaultProps={value:null,label:"",placeholder:"",options:[]};const v=y;return o})()));
//# sourceMappingURL=dropdown.js.map