import _extends from "@babel/runtime/helpers/extends";
import React from "react";
export default (function (props) {
  var value = props.value,
    setValue = props.setValue,
    config = props.config,
    readonly = props.readonly,
    min = props.min,
    max = props.max,
    step = props.step,
    placeholder = props.placeholder,
    customProps = props.customProps;
  var onChange = function onChange(e) {
    var val = e.target.value;
    if (val === "" || val === null) val = undefined;else val = Number(val);
    setValue(val);
  };
  var numberValue = value == undefined ? "" : value;
  return /*#__PURE__*/React.createElement("input", _extends({
    type: "number",
    value: numberValue,
    placeholder: placeholder,
    disabled: readonly,
    min: min,
    max: max,
    step: step,
    onChange: onChange
  }, customProps));
});