import Component from '../component.js'
import CoEuiChipListAppendContent from './eui-chip-list-append-content.js'
import CoEuiChipListChipContainer from './eui-chip-list-chip-container.js'
import CoEuiChipListCustom from './eui-chip-list-custom.js'
import CoEuiChipListExpandButton from './eui-chip-list-expand-button.js'
import DivComponent from '../div.js';

export default class CoEuiChipList extends Component {
  constructor(parent) {
    let selector = '*[self::eui-chip-list or self::div[@euiChipList] or self::ul[@euiChipList]]';
    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 containerCO() {
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-chip-list-container');
  }
  get wrapperCO() {
    return new DivComponent(this.containerCO).addPredicateClassContains('eui-chip-list-wrapper');
  }
  get chipListListCO() {
    return new DivComponent(this.wrapperCO).addPredicateClassContains('eui-chip-list__list');
  }
  get chipListContainerCO() {
    return new CoEuiChipListChipContainer(this.chipListListCO);
  }
  get euiChipListAppendContentCO() {
    return new CoEuiChipListAppendContent(this.chipListListCO);
  }
  get expandButtonWrapperCO() {
    return new CoEuiChipListExpandButton(this.containerCO);
  }
  get gridContainerCO() {
    return new DivComponent(this.wrapperCO).addPredicateClassContains('eui-chip-list__group');
  }
  async isGrid() {
    return await (await $(this.gridContainerCO.currentPath)).isExisting();
  }
  get gridWrapperCO() {
    return new DivComponent(this.gridContainerCO).addPredicateClassContains('eui-chip-list__custom');
  }
  get groupContainerCO() {
    return new DivComponent(this.gridWrapperCO).addPredicateClassContains('eui-chip-list__chip-container');
  }
  get euiChipListCustomCO() {
    return new CoEuiChipListCustom(this.groupContainerCO);
  }
  get euiChipListAppendContentGroupCO() {
    return new CoEuiChipListAppendContent(this.groupContainerCO);
  }
  get expandButtonWrapperGridCO() {
    return new CoEuiChipListExpandButton(this.gridContainerCO);
  }
}


