import Component  from '../component.js';
import CoEuiIconSvg from './eui-icon-svg.js';

export default class CoEuiToolbarMenuItemSubChild extends Component {
  constructor(parent) {
    let selector = 'li[contains(@class, "child")]';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/layout/eui-toolbar/toolbar-menu/toolbar-menu.component.html
  }
  get routerLink() {
    return this.currentPath + '//a[@routerLink]';
  }
  async routerLinkIsDisabled() {
    return await elementAttributeContains(this.routerLink, 'class', 'disabled');
  }
  get routerLinkIcon() {
    return this.routerLink + '//span[contains(@class, "eui-icon") and contains(@class, "eui-toolbar-menu-item__icon")]';
  }
  async hasSubLinkUrl() {
    return await (await $(this.routerLink)).isExisting();
  }
  get routerLinkSvgIconCO() {
    return new CoEuiIconSvg(this.routerLink).byAttributeContains('class', 'eui-toolbar-menu-item__icon');
  }
  async hasRouterLinkIcon() {
    return await (await $(this.routerLinkIcon)).isExisting();
  }
  get routerLinkLabel() {
    return this.routerLink + '//span[contains(@class, "eui-toolbar-menu-item__label")]';
  }
  get tabIndexLink() {
    return this.currentPath + '//a[not(@routerLink)]';
  }
  async tabIndexLinkIsDisabled() {
    return await elementAttributeContains(this.tabIndexLink, 'class', 'disabled');
  }
  get tabIndexLinkIcon() {
    return this.tabIndexLink + '//span[contains(@class, "eui-icon") and contains(@class, "eui-toolbar-menu-item__icon")]';
  }
  get tabIndexLinkSvgIconCO() {
    return new CoEuiIconSvg(this.tabIndexLink).byAttributeContains('class', 'eui-toolbar-menu-item__icon');
  }
  get tabIndexLinkLabel() {
    return this.tabIndexLink + '//span[contains(@class, "eui-toolbar-menu-item__label")]';
  }
  async hasTabIndexLinkIcon() {
    return await (await $(this.tabIndexLinkIcon)).isExisting();
  }
}


