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