import Component from '../../component.js'

export default class CoUxChip extends Component {
    constructor(parent) {
      let selector = 'mat-chip[contains(@class, "mat-chip")]';
      super(parent, selector);
    }
    get chipLabel() {
      let path = '//span[contains(@class, "ux-chips-list__chip-label")]';
      return this.currentPath + path;
    }
    get isLabelTruncated() {
      let cl = this.chipLabel.getAttribute('class');
      if (cl.includes('ux-chips-list__chip-label-truncated')) {
         return true;
      } else {
         return false;
      }
    }
    get removeIcon() {
      let path = '//span[contains(@class, "ux-chip--remove-icon")]';
      return this.currentPath + path;
    }
    async isDraggable() {
      let cl = await (await this.element()).getAttribute('class');
      if (cl.includes('ux-chip--draggable')) {
         return true;
      } else {
         return false;
      }
    }
}

