import CoEuiButton from './eui-button.js';
import Component  from '../component.js'
import CoEuiLabel from './eui-label.js';
import CoEuiIconSvg from './eui-icon-svg.js';

export default class CoEuiChipListExpandButton extends Component {
    constructor(parent) {
      let selector = 'div[contains(@class, "eui-chip-list__expand-button-wrapper")]';
      super(parent, selector);
      // https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-chip-list/eui-chip-list.component.html?at=master
    }
    get expandButtonCollapseCO() {
      return new CoEuiButton(this.currentPath).byChildSelector('eui-icon-svg[contains(@icon,"eui-chevron-back")]');
    }
    get expandButtonCollapseIconCO() {
      return new CoEuiIconSvg(this.currentPath).addPredicateIconContains('eui-chevron-back');
    }
    get expandButtonCollapseLabelCO() {
      return new CoEuiLabel(this.expandButtonCollapseCO);
    }
    async isMaxVisibleChipsOpened() {
      return await (await (await this.expandButtonCollapseLabelCO()).element()).isExisting();
    }
    get expandButtonExpandCO() {
      return new CoEuiButton(this.currentPath).byChildSelector('eui-icon-svg[contains(@icon,"eui-chevron-forward")]');
    }
    get expandButtonExpandIconCO() {
      return new CoEuiIconSvg(this.currentPath).addPredicateIconContains("eui-chevron-forward");
    }
    get expandButtonExpandLabelCO() {
      return new CoEuiLabel(this.expandButtonExpandCO);
    }
}


