!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")},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:()=>x});var n=t(6031),l=t.n(n),a=t(2462),i=t.n(a),u=t(2015),s=t.n(u),p=t(9825),d=t.n(p),c=t(8619);const m=require("@mui/icons-material/Clear");var b=t.n(m),f=t(3294);const y=["name","label","placeholder","children","isClearable"],h=e=>{let{name:r,label:t,placeholder:o,children:n,isClearable:a}=e,u=i()(e,y);const[p,d,m]=(0,f.useField)(r),h=(null==p?void 0:p.value)&&""!==p.value||Boolean(o);return s().createElement(c.FormControl,{fullWidth:!0,error:d.touched&&Boolean(d.error)},t&&s().createElement(c.InputLabel,{htmlFor:r,id:`${r}-label`,shrink:h},t),s().createElement(c.Select,l()({name:r,id:r},p,{labelId:`${r}-label`,label:t,notched:h,displayEmpty:!0,renderValue:e=>e&&""!==e?e:s().createElement("span",{style:{color:"#aaa"}},o),endAdornment:a&&p.value?s().createElement(c.InputAdornment,{position:"end",sx:{mr:2}},s().createElement(c.IconButton,{size:"small",onClick:e=>{e.stopPropagation(),m.setValue("")}},s().createElement(b(),{fontSize:"small"}))):null},u),n),d.touched&&d.error&&s().createElement(c.FormHelperText,null,d.error))};h.propTypes={name:d().string.isRequired,children:d().node.isRequired,placeholder:d().string,isClearable:d().bool};const x=h;return o})()));
//# sourceMappingURL=select.js.map