import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";

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) { _defineProperty(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; }

import React, { useEffect } from 'react';
import { Input } from '@alicloudfe/components';
import cls from 'classnames';
import BDesignTheme from '../theme';
console.log(_objectSpread({}, Input));

var BDesignInput = function BDesignInput(props) {
  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 = _objectWithoutProperties(props, ["className", "theme", "type", "size"]);

  return /*#__PURE__*/React.createElement(BDesignTheme, {
    theme: theme
  }, function (theme) {
    return /*#__PURE__*/React.createElement(Input, _extends({
      size: size,
      className: cls(className, {
        'b-design_icon__container': true,
        'next-input-dark': theme === 'dark',
        'next-input-noborder': type === 'noborder',
        'next-input-line': type === 'line'
      })
    }, rest));
  });
};

BDesignInput.Group = Input.Group;
BDesignInput.Password = Input.Password;
BDesignInput.TextArea = Input.TextArea;
export default BDesignInput;