import _extends from "@babel/runtime/helpers/extends";
import React from "react";
export default (function (props) {
  var value = props.value,
    setValue = props.setValue,
    config = props.config,
    readonly = props.readonly,
    placeholder = props.placeholder,
    maxLength = props.maxLength,
    maxRows = props.maxRows,
    fullWidth = props.fullWidth,
    customProps = props.customProps;
  var onChange = function onChange(e) {
    var val = e.target.value;
    if (val === "") val = undefined; // don't allow empty value
    setValue(val);
  };
  var textValue = value || "";
  return /*#__PURE__*/React.createElement("textarea", _extends({
    value: textValue,
    placeholder: placeholder,
    disabled: readonly,
    onChange: onChange,
    maxLength: maxLength,
    style: {
      width: fullWidth ? "100%" : undefined
    }
  }, customProps));
});