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

export default class CoUxAtag extends Component {
    constructor(parent) {
      let selector = 'ux-a-tag';
      super(parent, selector);
     //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/src/lib/ux-components/atomic/ux-a-tag/ux-a-tag.component.html?at=support/10.x
    }
    get tagDataDiv() {
      let path = '//div[@data-e2e="ux-a-tag"]';
      return this.currentPath + path;
    }
    get tagLabel() {
      let path = '//span[contains(@class,"ux-a-tag__label")]';
      return this.tagDataDiv + path;
    }
    get tagSubLabel() {
      const path = '//span[contains(@class,"ux-a-tag__sub-label")]';
      return this.tagDataDiv + path;
    }
    async typeClass() {
      return await (await $(this.currentPath)).getAttribute('typeclass');
    }
    async label() {
      return await (await $(this.currentPath)).getAttribute('label');
    }
    async sublabel() {
      return await (await $(this.currentPath)).getAttribute('sublabel');
    }
    async isRounded() {
      return await elementAttributeContains(this.tagDataDiv, 'class', 'ux-a-tag--rounded');
    }
    async isSmall() {
      return await elementAttributeContains(this.tagDataDiv, 'class', 'ux-a-tag--small');
    }
    async tabindex() {
      return await (await $(this.tagDataDiv)).getAttribute('tabindex');
    }
}


