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