!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")},692:e=>{e.exports=require("@mui/icons-material/Clear")},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 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:()=>h});var l=t(6031),n=t.n(l),a=t(2462),i=t.n(a),u=t(2015),s=t.n(u),p=t(9825),d=t.n(p),c=t(8619),m=t(692),b=t.n(m),f=t(3294);const x=["name","label","placeholder","children","isClearable"],y=e=>{let{name:r,label:t,placeholder:o,children:l,isClearable:a}=e,u=i()(e,x);const[p,d,m]=(0,f.useField)(r),y=(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:y},t),s().createElement(c.Select,n()({name:r,id:r},p,{labelId:`${r}-label`,label:t,notched:y,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),l),d.touched&&d.error&&s().createElement(c.FormHelperText,null,d.error))};y.propTypes={name:d().string.isRequired,children:d().node.isRequired,placeholder:d().string,isClearable:d().bool};const h=y;return o})()));
//# sourceMappingURL=select.js.map