import Component from '../component.js';
import CoEuiButton from './eui-button.js';
import CoEuiIconInput from './eui-icon-input.js';
import CoEuiIconSvg from './eui-icon-svg.js';
import CoEuiInputText from './eui-input-text.js';

export default class CoEuiTreeListToolbar extends Component {

  constructor(parent) {
    let selector = 'eui-tree-list-toolbar';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-tree-list/toolbar/toolbar.component.html
  }
  get iconInputCO(){
    return new CoEuiIconInput(this.currentPath);
  }
  get searchIconCO(){
    return new CoEuiIconSvg(this.iconInputCO).addPredicateIconContains('eui-ecl-search');
  }
  get filterInputCO(){
    return new CoEuiInputText(this.iconInputCO);
  }
  get expandAllBtnCO(){
    return new CoEuiButton(this.currentPath).addPredicateAttributeContains('aria-label', 'Expand all');
  }
  get expandAllBtnIconCO(){
    return new CoEuiIconSvg(this.expandAllBtnCO).addPredicateIconContains('eui-level-down');
  }
  async isToggleNotExpanded(){
    return await (await this.expandAllBtnCO.element()).isExisting();
  }
  get collapsedAllBtnCO(){
    return new CoEuiButton(this.currentPath).addPredicateAttributeContains('aria-label', 'Collapse all');
  }
  get collapseAllBtnIconCO(){
    return new CoEuiIconSvg(this.expandAllBtnCO).addPredicateIconContains('eui-level-up');
  }
}


