"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _box = _interopRequireDefault(require("@alifd/next/lib/box"));
var _numberPicker = _interopRequireDefault(require("@alifd/next/lib/number-picker"));
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
var _react = _interopRequireDefault(require("react"));
var _variables = require("../../variables");
require("./index.scss");
var CommonNumberInput = /*#__PURE__*/function (_React$Component) {
  (0, _inheritsLoose2["default"])(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["default"].createElement(_numberPicker["default"], {
        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["default"].createElement(_box["default"], {
      direction: "row",
      align: "center",
      className: _variables.bizCssPrefix + '-numberinput'
    }, this.renderColumn());
  };
  return CommonNumberInput;
}(_react["default"].Component);
CommonNumberInput.displayName = 'CommonNumberInput';
CommonNumberInput.displayName = 'CommonNumberInput';
var _default = CommonNumberInput;
exports["default"] = _default;