- label={getInputLabel(input)}
- component={TextField}
- parse={value => toNumber(value)}
- format={value => isNaN(value) ? '' : JSON.stringify(value)}
- validate={[isNumber]} />;
+ commandInput={input}
+ component={Input}
+ parse={parseFloat}
+ format={format}
+ validate={getValidation(input)} />;
+
+const format = (value: any) => isNaN(value) ? '' : JSON.stringify(value);
+
+const getValidation = memoize(
+ (input: FloatCommandInputParameter) => ([
+ isRequiredInput(input)
+ ? isNumber
+ : () => undefined,])
+);
+
+const Input = (props: GenericInputProps) =>
+ <GenericInput
+ component={InputComponent}
+ {...props} />;
+
+const InputComponent = ({ input, meta, commandInput }: GenericInputProps) =>
+ <FloatInputComponent
+ fullWidth
+ error={meta.touched && !!meta.error}
+ disabled={commandInput.disabled}
+ {...input} />;