import Component  from '../component.js'
import ButtonComponent from '../button.js'
import CoEuiDropdownButtonChildMenu from './eui-dropdown-button-child-menu.js'

export default class CoEuiDropdownButtonMenuItems extends Component {
    constructor(parent) {
      let selector = 'div[contains(@class,"mat-menu-content")]';
      super(parent, selector);
      //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-dropdown-button-menu/eui-dropdown-button-menu.component.html?at=support/13.x
    }
    get buttonCO() {
      return new ButtonComponent(this.currentPath);
    }
    async hasChildren() {
      return await (await $(this.euiDropdownButtonChildMenuCO.currentPath)).isExisting();
    }
    get categoryIcon() {
      return this.buttonCO.currentPath + '//span[contains(@class, "eui-menu-item__category-icon")]';
    }
    async hasIconClass() {
      return await (await $(this.categoryIcon)).isExisting();
    }
    get euiDropdownButtonChildMenuCO() {
      return new CoEuiDropdownButtonChildMenu(this.currentPath);
    }

}


