import Component  from '../component.js'
import ButtonComponent from '../button.js'
import CoEuiDropdownButtonMenuItems from './eui-dropdown-button-menu-Items.js'
import CdkOverlayContainer from '../cdk-overlay-container.js'
import MatMenu from '../material/14.x/mat-menu.js'

export default class CoEuiDropdownButtonMenu extends Component {
  overlayContainer;
  constructor(parent) {
    let selector = 'eui-dropdown-button-menu';
    super(parent, selector);
    this.overlayContainer = new CdkOverlayContainer('//body');
    //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 matMenuTrigger() {
    return this.currentPath + '//div';
  }
  async isDisabled() {
    return await (await $(this.currentPath + '//div[contains(@class, "eui-dropdown-button-menu__disabled")]')).isExisting();
  }
  get buttonCO() {
    return new ButtonComponent(this.matMenuTrigger);
  }
  get matMenuCO() {
    return new MatMenu(this.currentPath);
  }
  get euiDropdownButtonMenuItemsCO() {
    return new CoEuiDropdownButtonMenuItems(this.matMenuCO);
  }
}


