import _Box from "@alifd/next/es/box";
import _NumberPicker from "@alifd/next/es/number-picker";
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import React from 'react';
import { bizCssPrefix } from "../../variables";
import "./index.scss";
var CommonNumberInput = /*#__PURE__*/function (_React$Component) {
  _inheritsLoose(CommonNumberInput, _React$Component);
  function CommonNumberInput(props) {
    var _this;
    _this = _React$Component.call(this, props) || this;
    _this.onChange = function (value) {
      _this.props.onChange && _this.props.onChange(value);
    };
    _this.renderColumn = function () {
      var _this$props = _this.props,
        isEdit = _this$props.isEdit,
        precision = _this$props.precision,
        defaultValue = _this$props.defaultValue;
      return /*#__PURE__*/React.createElement(_NumberPicker, {
        precision: precision,
        onChange: function onChange(e) {
          return _this.onChange(e);
        },
        defaultValue: defaultValue,
        disabled: isEdit
      });
    };
    return _this;
  }
  var _proto = CommonNumberInput.prototype;
  _proto.render = function render() {
    return /*#__PURE__*/React.createElement(_Box, {
      direction: "row",
      align: "center",
      className: bizCssPrefix + '-numberinput'
    }, this.renderColumn());
  };
  return CommonNumberInput;
}(React.Component);
CommonNumberInput.displayName = 'CommonNumberInput';
CommonNumberInput.displayName = 'CommonNumberInput';
export default CommonNumberInput;