!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")},3294:e=>{e.exports=require("formik")},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 n=r[o];if(void 0!==n)return n.exports;var l=r[o]={exports:{}};return e[o](l,l.exports,t),l.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 n=t(6031),l=t.n(n),a=t(2462),i=t.n(a),u=t(2015),p=t.n(u),s=t(9825),d=t.n(s),c=t(6842),m=t.n(c),f=t(8619),b=t(3294);const y=["name","label","placeholder","options","required"],x=e=>{let{name:r,label:t,placeholder:o,options:n,required:a}=e,u=i()(e,y);const[s,d]=(0,b.useField)(r),c=o||m().translate("placeholders.select");return p().createElement(f.FormControl,{fullWidth:!0,error:d.touched&&Boolean(d.error),required:a},t&&p().createElement(f.InputLabel,{shrink:!0,id:`${r}-label`},t),p().createElement(f.Select,l()({name:r,label:t,labelId:`${r}-label`,displayEmpty:!0},s,u,{renderValue:e=>{if(null==e||""===e)return p().createElement("em",null,c);const r=n.find((({value:r})=>r===e));return r?r.label:""}}),n.map((e=>p().createElement(f.MenuItem,{key:`selectop-${e.value}`,value:e.value},e.label)))),d.touched&&d.error&&p().createElement(f.FormHelperText,null,d.error))};x.propTypes={name:d().string.isRequired,options:d().array.isRequired};const v=x;return o})()));
//# sourceMappingURL=select-v2.js.map