export default {
  name: 'BaseTextarea',
  inheritAttrs: false,
  props: {
    name: {
      type: String,
    },
    label: {
      type: String,
    },
    description: {
      type: String,
    },
    value: {
      type: String | Number,
    },
    error: {
      type: String,
    },
    valid: {
      type: Boolean,
      default: false,
    },
    disabled: {
      type: Boolean,
      default: false,
    },
    required: {
      type: Boolean,
      default: false,
    },
    count: {
      type: Boolean,
      default: false,
    }
  },
  computed: {
    classObject() {
      return {
        'field-disabled': this.disabled,
        'field-required': this.required,
        'field-error': this.error,
        'field-valid': this.valid,
      };
    },
    inputListeners() {
      return Object.assign({}, this.$listeners, {
        input: event => {
          this.$emit('input', event.target.value);
        },
      });
    },
  },
};
