import e from"@babel/runtime/helpers/defineProperty";import r from"prop-types";import{Grid as i,FormControl as l,Tooltip as s,InputLabel as t,Select as n,MenuItem as a,FormHelperText as o}from"@material-ui/core";import{useStyles as u}from"../sharedStyles.js";import{isMobileDetected as d}from"../../../../../utils/mobileDetect.js";import{getUnitDisplay as m}from"../../../../../utils/index.js";import{jsx as c,jsxs as p}from"react/jsx-runtime";function b(r){var b=r.type,f=r.options,h=r.label,g=r.unit,y=r.value,q=r.error,v=r.disabled,x=r.onChangeField,R=r.xs,N=r.className,j=u({isMobile:d}),C=q||" ",F=!!q,L=g?"".concat(h," (").concat(m(g),")"):h;return c(i,{item:!0,xs:R,className:e({},j.cellInnerMobile,d),classes:{"grid-xs-2":N},children:p(l,{fullWidth:!0,error:F,disabled:v,children:[h&&c(s,{title:L,children:c(t,{className:j.inputLabel,children:L})}),c(n,{value:y||"",onChange:function(e){x(b,e.target.value)},children:f.map((function(e){var r=e.name,i=e.type;return c(a,{value:i,children:r},i)}))}),q&&c(s,{title:q||"",children:c(o,{className:j.inputLabel,children:C})})]})})}b.propTypes={type:r.string.isRequired,options:r.arrayOf(r.shape({})).isRequired,label:r.string.isRequired,unit:r.string,value:r.any.isRequired,error:r.string.isRequired,disabled:r.bool,onChangeField:r.func.isRequired,xs:r.number.isRequired,className:r.string},b.defaultProps={unit:null,disabled:!1,className:null};export{b as SelectField};
//# sourceMappingURL=SelectField.js.map
