import Component from '../../component.js';
import DivComponent from '../div.js';
import SpanComponent from '../span.js';

export default class CoEuiProgressCircle extends Component {
  constructor(parent) {
    let selector = 'eui-progress-circle';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-progress-circle/eui-progress-circle.component.html?at=master
  }
  get contentCO() {
    return new DivComponent(this.currentPath).addSelectorPredicate('[contains(@class,"eui-progress-circle-content") and not(contains(@class,"eui-progress-circle-content__"))]');
  }
  async isProgressCircleOver50() {
    return await (await $(this.contentCO.currentPath + '/self::*[contains(@class,"eui-progress-circle-content--over50")]')).isExisting();
  }
  get contentLabelCO() {
    return new SpanComponent(this.contentCO).addPredicateClassContains('eui-progress-circle-content__label');
  }
  get contentLabelValueCO() {
    return new SpanComponent(this.contentLabelCO);
  }
  get contentLeftHalfClipperCO() {
    return new DivComponent(this.contentCO).addPredicateClassContains('eui-progress-circle-content__left-half-clipper');
  }
  get first50BarCO() {
    return new DivComponent(this.contentLeftHalfClipperCO).addPredicateClassContains('eui-progress-circle-content__first50-bar');
  }
  get valueBarCO() {
    return new DivComponent(this.contentLeftHalfClipperCO).addPredicateClassContains('eui-progress-circle-content__value-bar');
  }
  get bottomLabelCO() {
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-progress-circle-content__bottom-label');
  }
  async isLongLabelOrHasBottomLabel() {
    return await (await this.bottomLabelCO.element()).isExisting();
  }
  get bottomLabelValueCO() {
    return new SpanComponent(this.bottomLabelCO).addPredicateClassContains('label');
  }
  get iconLabelCO() {
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-progress-circle-content__icon-label');
  }
  async hasIconLabel() {
    return await (await this.iconLabelCO.element()).isExisting();
  }
  get iconLabelSpanCO() {
    return new SpanComponent(this.iconLabelCO);
  }
}

