"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _numberPicker = _interopRequireDefault(require("@alifd/next/lib/number-picker"));
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
var React = _interopRequireWildcard(require("react"));
require("./index.less");
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
var NumberSetter = exports["default"] = /*#__PURE__*/function (_React$PureComponent) {
  function NumberSetter() {
    return _React$PureComponent.apply(this, arguments) || this;
  }
  (0, _inheritsLoose2["default"])(NumberSetter, _React$PureComponent);
  var _proto = NumberSetter.prototype;
  _proto.render = function render() {
    var _this$props = this.props,
      _onChange = _this$props.onChange,
      _this$props$min = _this$props.min,
      min = _this$props$min === void 0 ? Number.MIN_SAFE_INTEGER : _this$props$min,
      _this$props$max = _this$props.max,
      max = _this$props$max === void 0 ? Number.MAX_SAFE_INTEGER : _this$props$max,
      _this$props$step = _this$props.step,
      step = _this$props$step === void 0 ? 1 : _this$props$step,
      _this$props$units = _this$props.units,
      units = _this$props$units === void 0 ? '' : _this$props$units,
      _this$props$precision = _this$props.precision,
      precision = _this$props$precision === void 0 ? 0 : _this$props$precision,
      value = _this$props.value;
    return /*#__PURE__*/React.createElement(_numberPicker["default"], {
      size: "small",
      style: {
        width: '100%'
      },
      className: "lowcode-setter-number",
      value: value,
      min: min,
      max: max,
      precision: precision,
      step: step,
      innerAfter: units,
      onChange: function onChange(val) {
        _onChange(!val ? 0 : val);
      }
    });
  };
  return NumberSetter;
}(React.PureComponent);
NumberSetter.displayName = 'NumberSetter';