import Component  from '../component.js'

export default class CoEuiDashboardCard extends Component {
  constructor(parent) {
    let selector = 'eui-dashboard-card';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-dashboard-card/eui-dashboard-card.component.html
  }
  get container() {
    return this.currentPath + '//div[contains(@class,"eui-dashboard-card")]';
  }
  async isHorizontalLayout() {
    return await elementAttributeContains(this.container, 'class', 'row');
  }
  async isClickable() {
    return await elementAttributeContains(this.container, 'class', 'eui-dashboard-card--clickable');
  }
  async isIconCompact() {
    return await elementAttributeContains(this.container, 'class', 'eui-dashboard-card--icon-compact');
  }
  async isIconCompactAndHorizontalLayout() {
    return await elementAttributeContains(this.container, 'class', 'eui-dashboard-card--horizontal--icon-compact');
  }
  get iconContainer() {
    return this.container + '//div[contains(@class, "eui-dashboard-card__icon-container")]';
  }
  async hasIconClass() {
    return await (await $(this.iconContainer)).isExisting();
  }
  get iconWrapper() {
    return this.iconContainer + '//div[contains(@class, "eui-dashboard-card__icon-wrapper")]';
  }
  get iconWrapperIcon() {
    return this.iconWrapper + '//span[contains(@class, "eui-dashboard-card__icon-wrapper-icon")]';
  }
  get imageContainer() {
    return this.container + '//div[contains(@class, "eui-dashboard-card__image-container")]';
  }
  async hasImageUrl() {
    return await (await $(this.imageContainer)).isExisting();
  }
  get imageWrapper() {
    return this.imageContainer + '//div[contains(@class, "eui-dashboard-card__image-wrapper")]';
  }
  get image() {
    return this.imageWrapper + '//img';
  }
  get contentWrapper() {
    return this.container + '//div[contains(@class, "eui-dashboard-card__content-wrapper")]';
  }
  get contentWrapperContent() {
    return this.contentWrapper + '//div[contains(@class, "eui-dashboard-card__content")]';
  }
  get label() {
    return this.contentWrapperContent + '//div[contains(@class, "eui-dashboard-card__content-label")]';
  }
  get sublabel() {
    return this.contentWrapperContent + '//div[contains(@class, "eui-dashboard-card__content-sub-label")]';
  }
  get link() {
    return this.contentWrapperContent + '//div[contains(@class, "eui-dashboard-card__content-link")]';
  }
  get urlExternal() {
    return this.link + '//a[@href]';
  }
  get url() {
    return this.link + '//a[not(@href)]';
  }
  async hasUrl() {
    return await (await $(this.url)).isExisting();
  }
}


