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


export default class CoEuiChip extends Component {
  constructor(parent) {
    let selector = '*[self::eui-chip or self::span[@euiChip] or self::li[@euiChip]]';

    super(parent, selector);
    // https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-chip/eui-chip.component.html
  }
  get wrapperCO() {
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-chip-wrapper');
  }
  get containerCO() {
    return new DivComponent(this.wrapperCO).addPredicateClassContains('eui-chip__content-container');
  }
  get removeIconCO() {
    return new CoEuiIconSvg(this.wrapperCO);
  }
  async isChipRemovable() {
    return await (await this.removeIconCO.element()).isExisting();
  }
}


