'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var normalizeComponent = require('./normalize-component-6fa50395.js');
var ThemeMixin = require('./ThemeMixin-a2f817cd.js');
var svgAtom = require('./svg-atom-d2541b7d.js');
var iconAtom = require('./icon-atom-65241b51.js');
require('./hover-atom-17a12a07.js');
require('./tooltip-atom-8f536df5.js');
var fieldAtom = require('./field-atom-fe4b7c7b.js');
var errorAtom = require('./error-atom-2f5dc7b9.js');
var labelMolecule = require('./label-molecule-9793dd9f.js');
var descriptionAtom = require('./description-atom-34b2b8a7.js');

var script = {
  name: 'TextareaAtom',
  inheritAttrs: false,
  props: {
    value: {
      type: [String, Number],
      default: null
    },
    disabled: {
      type: Boolean,
      default: false
    }
  },
  computed: {
    listeners: function listeners() {
      var _this = this;

      return ThemeMixin._objectSpread2(ThemeMixin._objectSpread2({}, this.$listeners), {}, {
        input: function input(e) {
          _this.$emit('input', e.target.value);
        }
      });
    },
    textareaAtomCssClass: function textareaAtomCssClass() {
      return Object.assign(this.themeCssClass, {
        'is-error': this.$attrs['is-error']
      });
    }
  },
  mixins: [ThemeMixin.ThemeMixin]
};

/* script */
const __vue_script__ = script;

/* template */
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{staticClass:"textarea-atom",class:_vm.textareaAtomCssClass,attrs:{"disabled":_vm.disabled}},[_c('textarea',_vm._g(_vm._b({staticClass:"textarea-atom-control",attrs:{"disabled":_vm.disabled},domProps:{"value":_vm.value}},'textarea',_vm.$attrs,false),_vm.listeners)),_vm._v(" "),_vm._t("default")],2)};
var __vue_staticRenderFns__ = [];

  /* style */
  const __vue_inject_styles__ = undefined;
  /* scoped */
  const __vue_scope_id__ = undefined;
  /* module identifier */
  const __vue_module_identifier__ = undefined;
  /* functional template */
  const __vue_is_functional_template__ = false;
  /* style inject */
  
  /* style inject SSR */
  

  
  var TextareaAtom = normalizeComponent.__vue_normalize__(
    { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
    __vue_inject_styles__,
    __vue_script__,
    __vue_scope_id__,
    __vue_is_functional_template__,
    __vue_module_identifier__,
    undefined,
    undefined
  );

//
var script$1 = {
  name: 'VTextarea',
  inheritAttrs: false,
  props: {
    label: {
      type: String,
      default: null
    },
    tooltipLabel: {
      type: String,
      default: null
    },
    value: {
      type: [String, Number],
      default: null
    },
    error: {
      type: String,
      default: null
    },
    description: {
      type: String,
      default: null
    },
    skin: {
      type: String,
      default: 'default',
      validator: function validator(value) {
        return ['default', 'white'].indexOf(value) !== -1;
      }
    },
    disabled: {
      type: Boolean,
      default: false
    }
  },
  computed: {
    isError: function isError() {
      return !!this.error;
    },
    skinCssClass: function skinCssClass() {
      return "skin-".concat(this.skin);
    }
  },
  components: {
    LabelMolecule: labelMolecule.LabelMolecule,
    TextareaAtom: TextareaAtom,
    FieldAtom: fieldAtom.FieldAtom,
    ErrorAtom: errorAtom.ErrorAtom,
    DescriptionAtom: descriptionAtom.DescriptionAtom,
    IconAtom: iconAtom.IconAtom,
    SvgAtom: svgAtom.SvgAtom
  },
  model: {
    event: 'input',
    prop: 'value'
  }
};

/* script */
const __vue_script__$1 = script$1;

/* template */
var __vue_render__$1 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('field-atom',[(_vm.label)?_c('label-molecule',{attrs:{"label":_vm.label,"tooltip-label":_vm.tooltipLabel,"disabled":_vm.disabled}}):_vm._e(),_vm._v(" "),(_vm.description)?_c('description-atom',_vm._b({attrs:{"description":_vm.description}},'description-atom',_vm.$attrs,false)):_vm._e(),_vm._v(" "),_c('textarea-atom',_vm._g(_vm._b({class:_vm.skinCssClass,attrs:{"value":_vm.value,"is-error":_vm.isError,"disabled":_vm.disabled}},'textarea-atom',_vm.$attrs,false),_vm.$listeners),[(_vm.isError)?_c('icon-atom',{attrs:{"is-error":_vm.isError}},[_c('svg-atom',{attrs:{"name":"error"}})],1):_vm._e()],1),_vm._v(" "),(_vm.isError)?_c('error-atom',{attrs:{"error":_vm.error}}):_vm._e()],1)};
var __vue_staticRenderFns__$1 = [];

  /* style */
  const __vue_inject_styles__$1 = undefined;
  /* scoped */
  const __vue_scope_id__$1 = undefined;
  /* module identifier */
  const __vue_module_identifier__$1 = undefined;
  /* functional template */
  const __vue_is_functional_template__$1 = false;
  /* style inject */
  
  /* style inject SSR */
  

  
  var VTextarea = normalizeComponent.__vue_normalize__(
    { render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
    __vue_inject_styles__$1,
    __vue_script__$1,
    __vue_scope_id__$1,
    __vue_is_functional_template__$1,
    __vue_module_identifier__$1,
    undefined,
    undefined
  );

exports.default = VTextarea;
