"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 _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

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

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

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

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

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

console.log(_objectSpread({}, _components.Input));

var BDesignInput = function BDesignInput(props) {
  (0, _react.useEffect)(function () {
    var area = document.querySelectorAll('textarea');

    if (area && area.length) {
      area.forEach(function (item) {
        item.style.setProperty('resize', 'a');

        if (item.getAttribute('type') === 'noborder') {
          item.parentElement.setAttribute('style', 'border-color:#F3F3F3;'); //添加类名
        }
      });
    }
  });
  var className = props.className,
      theme = props.theme,
      type = props.type,
      _props$size = props.size,
      size = _props$size === void 0 ? 'large' : _props$size,
      rest = (0, _objectWithoutProperties2.default)(props, ["className", "theme", "type", "size"]);
  return /*#__PURE__*/_react.default.createElement(_theme.default, {
    theme: theme
  }, function (theme) {
    return /*#__PURE__*/_react.default.createElement(_components.Input, (0, _extends2.default)({
      size: size,
      className: (0, _classnames.default)(className, {
        'b-design_icon__container': true,
        'next-input-dark': theme === 'dark',
        'next-input-noborder': type === 'noborder',
        'next-input-line': type === 'line'
      })
    }, rest));
  });
};

BDesignInput.Group = _components.Input.Group;
BDesignInput.Password = _components.Input.Password;
BDesignInput.TextArea = _components.Input.TextArea;
var _default = BDesignInput;
exports.default = _default;