import CoEuiDropdownButtonMenuItem from './eui-dropdown-button-menu-item.js';
import ButtonComponent from '../button.js';
import Component from '../component.js';
import DivComponent from '../div.js';
import MatMenu from '../material/15.x/mat-menu.js';

export default class CoEuiDropdownButtonMenu extends Component {
    constructor(parent) {
      let selector = 'eui-dropdown-button-menu';
      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=master
    }
    get menuContentCO(){
      return new DivComponent(this.currentPath);
    }
    async isDisabled() {
      return await (await $(this.menuContentCO.currentPath + '/self::div[contains(@class, "eui-dropdown-button-menu__disabled")]')).isExisting();
    }
    get menuButtonCO(){
      return new ButtonComponent(this.menuContentCO);
    }
    get matMenuCO(){
      return new MatMenu(this.currentPath);
    }
    get menuItemCO(){
      return new CoEuiDropdownButtonMenuItem(this.matMenuCO)
    }

}
