import Component from '../component.js'
import CoEuiChip from './eui-chip.js'
import CoEuiIcon from './eui-icon.js'
import CoEuiIconSvg from './eui-icon-svg.js'
import SpanComponent from '../span.js';

export default class CoEuiChipListChipContainer extends Component {
  constructor(parent) {
    let selector = 'div[contains(@class, "eui-chip-list__chip-container")]';
    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 euiChipCO() {
    return new CoEuiChip(this.currentPath);
  }
  get euiIconCO() {
    return new CoEuiIcon(this.euiChipCO);
  }
  async hasChipIconClass() {
    return await (await this.euiIconCO.element()).isExisting();
  }
  get euiIconSvgCO() {
    return new CoEuiIconSvg(this.euiChipCO);
  }
  async hasChipIconSvg() {
    return await (await this.euiIconSvgCO.element()).isExisting();
  }
  get titleCO() {
    return new SpanComponent(this.euiChipCO).addSelectorPredicate('[@title]');
  }
  async hasChipsLabelTruncateCount() {
    return await (await this.titleCO.element()).isExisting();
  }
  get chipContentCO() {
    return new SpanComponent(this.euiChipCO).addSelectorPredicate('[not(@title)]');
  }
}


