"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _react = _interopRequireWildcard(require("react"));

var _components = require("@alicloudfe/components");

var _classnames = _interopRequireDefault(require("classnames"));

var _theme = _interopRequireDefault(require("../theme"));

var BDesignNumberPicker = function BDesignNumberPicker(props) {
  (0, _react.useEffect)(function () {
    var inp = document.querySelectorAll('input');

    if (inp && inp.length) {
      inp.forEach(function (item) {
        item.onfocus = function () {
          item.parentNode.parentElement.classList.add("next-input-group-blue"); //添加类名
        };

        item.onblur = function () {
          item.parentNode.parentElement.classList.remove("next-input-group-blue"); //移除类名
        };
      });
    }
  });
  var className = props.className,
      theme = props.theme,
      shape = props.shape,
      state = props.state,
      _props$size = props.size,
      size = _props$size === void 0 ? 'large' : _props$size,
      rest = (0, _objectWithoutProperties2.default)(props, ["className", "theme", "shape", "state", "size"]);
  return /*#__PURE__*/_react.default.createElement(_theme.default, {
    theme: theme
  }, function (theme) {
    return /*#__PURE__*/_react.default.createElement(_components.NumberPicker, (0, _extends2.default)({
      size: size,
      className: (0, _classnames.default)(className, {
        'next-number-picker-error': state === 'error',
        'b-design_icon__container': true,
        'next-number-picker-primary': shape === "primary",
        'next-number-picker-dark': theme === "dark"
      })
    }, rest));
  });
};

var _default = BDesignNumberPicker;
exports.default = _default;