import Component  from '../component.js'
import { elementAttributeContains } from '../../core/utils.js'

export default class MatChip extends Component {
    constructor(parent) {
      let selector = '*[self::mat-basic-chip or self::*[@mat-basic-chip] or self::*[@mat-chip] or self::*[@mat-chip]]';
      super(parent, selector);
      // https://github.com/angular/components/blob/master/src/material/chips/chip.ts
    }
    async isSelected() {
      return await elementAttributeContains(this.currentPath, 'class', 'mat-chip-selected');
    }
    async hasAvatar() {
      return await elementAttributeContains(this.currentPath, 'class', 'mat-chip-with-avatar');
    }
    async hasTrailingIcon() {
      return await elementAttributeContains(this.currentPath, 'class', 'mat-chip-with-trailing-icon');
    }
    async isDisabled() {
      return await elementAttributeContains(this.currentPath, 'class', 'mat-chip-disabled');
    }
    async hasAnimationDisabled() {
      return await elementAttributeContains(this.currentPath, 'class', '_mat-animation-noopable');
    }
}

