function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

/*
 * @Author: codingfly
 * @Description:
 * @Date: 2021-08-16 10:02:21
 * @LastEditTime: 2021-09-06 09:05:06
 * @FilePath: \young\components\textarea\index.tsx
 */
import * as React from 'react';
import { View, Textarea } from 'remax/one';
import classNames from 'classnames';
import { getPrefixCls } from './../common';
var prefixCls = getPrefixCls('textarea');

var ATextarea = function ATextarea(props) {
  var _classNames;

  var _props$className = props.className,
      className = _props$className === void 0 ? '' : _props$className,
      name = props.name,
      value = props.value,
      placeholder = props.placeholder,
      disabled = props.disabled,
      maxlength = props.maxlength,
      focus = props.focus,
      autoHeight = props.autoHeight,
      showCount = props.showCount,
      _props$rows = props.rows,
      rows = _props$rows === void 0 ? 3 : _props$rows,
      _props$controlled = props.controlled,
      controlled = _props$controlled === void 0 ? false : _props$controlled,
      onChange = props.onChange,
      onFocus = props.onFocus,
      onBlur = props.onBlur,
      onConfirm = props.onConfirm;

  var handleChangeInput = function handleChangeInput(e) {
    onChange === null || onChange === void 0 ? void 0 : onChange(e);
  };

  return /*#__PURE__*/React.createElement(View, {
    className: prefixCls
  }, /*#__PURE__*/React.createElement(Textarea, {
    className: classNames((_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-default"), true), _defineProperty(_classNames, className, true), _classNames)),
    // @ts-ignore
    placeholderClass: "".concat(prefixCls, "-placeholder"),
    name: name,
    value: value,
    placeholder: placeholder,
    disabled: disabled,
    maxlength: maxlength,
    focus: focus,
    autoHeight: autoHeight,
    showCount: showCount,
    controlled: controlled,
    onInput: handleChangeInput,
    onFocus: onFocus,
    onBlur: onBlur,
    onConfirm: onConfirm,
    rows: rows
  }));
};

export default ATextarea;