import Component from '../../component.js'
import MatChip from '../../material/mat-chip.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-next/src/lib/components/eui-chip/eui-chip.component.html?at=refs%2Fheads%2Fsupport%2F10.x
    }
    get matChipCO() {
      return new MatChip(this.currentPath);
    }
    get container() {
      let path = '//div[contains(@class,"eui-chip__content-container")]';
      return this.matChipCO.currentPath + path;
    }
    get removeIcon() {
      let path = '//span[contains(@iconClass,"eui-chip__remove-icon")]';
      return this.matChipCO.currentPath + path;
    }
    async isChipRemovable() {
      return await (await $(this.removeIcon)).isExisting();
    }
}

