import _NumberPicker from "@alifd/next/es/number-picker";
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import * as React from 'react';
import './index.less';
var NumberSetter = /*#__PURE__*/function (_React$PureComponent) {
  function NumberSetter() {
    return _React$PureComponent.apply(this, arguments) || this;
  }
  _inheritsLoose(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, {
      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';
export { NumberSetter as default };