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