text: import React, { Component } from 'react';
  import { Form, InputNumber } from 'antd';
  import { formItemLayout } from 'view/shared/styles/FormWrapper';
  import PropTypes from 'prop-types';
  import FormErrors from 'view/shared/form/formErrors';
  import { FastField } from 'formik';
  
  class InputNumberFormItemNotFast extends Component {
    render() {
      const {
        label,
        name,
        form,
        hint,
        layout,
        size,
        placeholder,
        autoFocus,
        autoComplete,
        prefix,
        formItemProps,
        inputProps,
        errorMessage,
        required,
      } = this.props;
  
      return (
        <Form.Item
          {...layout}
          label={label}
          validateStatus={FormErrors.validateStatus(
            form,
            name,
            errorMessage,
          )}
          required={required}
          help={
            FormErrors.displayableError(
              form,
              name,
              errorMessage,
            ) || hint
          }
          {...formItemProps}
        >
          <InputNumber
            style={{ width: '100%' }}
            id={name}
            onChange={(value) =>
              form.setFieldValue(name, value)
            }
            onBlur={form.handleBlur}
            value={form.values[name]}
            size={size || undefined}
            placeholder={placeholder || undefined}
            autoFocus={autoFocus || false}
            autoComplete={autoComplete || undefined}
            prefix={prefix || undefined}
            {...inputProps}
          />
        </Form.Item>
      );
    }
  }
  
  InputNumberFormItemNotFast.defaultProps = {
    layout: formItemLayout,
    required: false,
  };
  
  InputNumberFormItemNotFast.propTypes = {
    form: PropTypes.object.isRequired,
    name: PropTypes.string.isRequired,
    label: PropTypes.string,
    hint: PropTypes.string,
    autoFocus: PropTypes.bool,
    required: PropTypes.bool,
    size: PropTypes.string,
    prefix: PropTypes.string,
    placeholder: PropTypes.string,
    layout: PropTypes.object,
    errorMessage: PropTypes.string,
    formItemProps: PropTypes.object,
    inputProps: PropTypes.object,
  };
  
  class InputNumberFormItem extends Component {
    render() {
      return (
        <FastField
          name={this.props.name}
          render={({ form }) => (
            <InputNumberFormItemNotFast
              {...this.props}
              form={form}
            />
          )}
        />
      );
    }
  }
  
  export default InputNumberFormItem;
  