'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 sidebarControlAtom = require('./sidebar-control-atom-d22b0a7a.js');

//
var script = {
  name: 'VNavSidebarSubMenu',
  props: {
    disabled: {
      type: Boolean,
      default: false
    },
    label: {
      type: String,
      required: true
    },
    icon: {
      type: String,
      default: null
    }
  },
  data: function data() {
    return {
      isExpanded: false
    };
  },
  computed: {
    vNavSidebarSubMenuCssClass: function vNavSidebarSubMenuCssClass() {
      return Object.assign(this.themeCssClass, {
        'v-nav-sidebar-sub-menu': true,
        'is-expanded': this.isExpanded,
        'is-iconed': this.isWithIcon
      });
    },
    currentIcon: function currentIcon() {
      if (this.isExpanded) {
        return 'chevron-up';
      }

      return 'chevron-down';
    },
    isIconSlotFilled: function isIconSlotFilled() {
      return !!this.$slots.icon;
    },
    isWithIcon: function isWithIcon() {
      return this.isIconSlotFilled || this.icon;
    }
  },
  methods: {
    handleContentToggle: function handleContentToggle() {
      this.isExpanded = !this.isExpanded;
    }
  },
  mixins: [ThemeMixin.ThemeMixin],
  components: {
    NavigationSidebarControl: sidebarControlAtom.NavigationSidebarControl,
    SvgAtom: svgAtom.SvgAtom
  }
};

/* 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('section',{class:_vm.vNavSidebarSubMenuCssClass},[_c('navigation-sidebar-control',{attrs:{"disabled":_vm.disabled},on:{"click":_vm.handleContentToggle}},[(_vm.isWithIcon)?_c('i',{staticClass:"v-nav-sidebar-sub-menu-icon additional"},[_vm._t("icon"),_vm._v(" "),(!_vm.isIconSlotFilled)?_c('svg-atom',{attrs:{"name":_vm.icon}}):_vm._e()],2):_vm._e(),_vm._v("\n    "+_vm._s(_vm.label)+"\n    "),_c('i',{staticClass:"v-nav-sidebar-sub-menu-icon chevron"},[_c('svg-atom',{attrs:{"name":_vm.currentIcon}})],1)]),_vm._v(" "),_c('section',{staticClass:"v-nav-sidebar-sub-menu-content"},[_vm._t("default")],2)],1)};
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 VNavSidebarSubMenu = 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
  );

exports.default = VNavSidebarSubMenu;
