import Component from '../component.js'
import CoEuiMenu from './eui-menu.js'
import { elementAttributeContains } from '../../core/utils.js'
import DivComponent from '../div.js';

export default class CoEuiSidebarMenu extends Component {
  constructor(parent) {
    let selector = 'eui-sidebar-menu';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-sidebar-menu/eui-sidebar-menu.component.html
  }
  get containerCO() {
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-sidebar-menu__container');
  }
  async isCollapsed() {
    return await elementAttributeContains(this.containerCO.currentPath, 'class', 'eui-sidebar-menu__container--collapsed');
  }
  get contentCO() {
    return new DivComponent(this.containerCO).addPredicateClassContains('eui-sidebar-menu__content');
  }
  get euiMenuCO() {
    return new CoEuiMenu(this.contentCO);
  }
}

