import Component from '../component.js';
import DivComponent from '../div.js';
import SpanComponent from '../span.js';
import CoEuiIconSvg from './eui-icon-svg.js';

export default class CoEuiWizardTab extends Component {
    constructor(parent) {
        let selector = 'div[contains(@class,"eui-wizard-step")]';
        super(parent, selector);
        //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-wizard/eui-wizard.component.html?at=master
    }
    async isCompleted() {
        return await (await $(this.currentPath + '/self::*[contains(@class,"eui-wizard-step--completed")]')).isExisting();
    }
    async isNotAllowed() {
        return await (await $(this.currentPath + '/self::*[contains(@class,"eui-wizard-step--notallowed")]')).isExisting();
    }
    async isActive() {
        return await (await $(this.currentPath + '/self::*[contains(@class,"eui-wizard-step--active")]')).isExisting();
    }
    async isDisabled() {
        return await (await $(this.currentPath + '/self::*[contains(@class,"eui-wizard-step--disabled")]')).isExisting();
    }
    async isInvalid() {
        return await (await $(this.currentPath + '/self::*[contains(@class,"eui-wizard-step--error")]')).isExisting();
    }
    async isWarning() {
        return await (await $(this.currentPath + '/self::*[contains(@class,"eui-wizard-step--warning")]')).isExisting();
    }
    get euiWizardStepIndicatorWrapperCO() {
        return new DivComponent(this.currentPath).addPredicateClassContains('eui-wizard-step__indicator-wrapper');
    }
    get euiWizardStepBulletItemCO() {
        return new DivComponent(this.currentPath).addPredicateClassContains('eui-wizard-step__bullet-item');
    }
    get euiWizardStepBulletItemIconCO() {
        return new SpanComponent(this.euiWizardStepBulletItemCO).addPredicateClassContains('eui-wizard-step__bullet-item-icon');
    }
    get checkIconSvgCO() {
        return new CoEuiIconSvg(this.euiWizardStepBulletItemIconCO).addPredicateIconContains('eui-check');
    }
    get exclamationIconSvgCO() {
        return new CoEuiIconSvg(this.euiWizardStepBulletItemIconCO).addPredicateIconContains('eui-exclamation');
    }
    get createIconSvgCO() {
        return new CoEuiIconSvg(this.euiWizardStepBulletItemIconCO).addPredicateIconContains('eui-create');
    }
    get indexIconClassSpanCO() {
        return new SpanComponent(this.euiWizardStepBulletItemCO).addPredicateAttributeContains('role', 'presentation');
    }
    async isIndexIconClass() {
        return await (await this.euiWizardStepIcon.element()).isExisting();
    }
    get euiWizardStepIcon() {
        return new SpanComponent(this.indexIconClassSpanCO).addPredicateClassContains('eui-wizard-step__icon');
    }
    async isIndexIconSvgName() {
        return await (await this.indexIconSvgNameCO.element()).isExisting();
    }
    get indexIconSvgNameCO() {
        return new CoEuiIconSvg(this.indexIconClassSpanCO).addPredicateClassContains('eui-wizard-step__icon');
    }
    get euiWizardStepLabelWrapperCO() {
        return new DivComponent(this.currentPath).addPredicateClassContains('eui-wizard-step__label-wrapper');
    }
    get euiWizardStepLabelWrapperLabelCO() {
        return new DivComponent(this.euiWizardStepLabelWrapperCO).addPredicateClassContains('eui-wizard-step__label-wrapper-label');
    }
    get euiWizardStepLabelWrapperSubLabelCO() {
        return new DivComponent(this.euiWizardStepLabelWrapperCO).addPredicateClassContains('eui-wizard-step__label-wrapper-sub-label');
    }
    get euiWizardStepCurrentMarkerCO() {
        return new DivComponent(this.currentPath).addPredicateClassContains('eui-wizard-step__current-marker');
    }
    async isCurrentMarkerActive() {
        return await (await this.euiWizardStepCurrentMarkerCO.element()).isExisting();
    }
    get currentMarkerIconSvgCO() {
        return new CoEuiIconSvg(this.euiWizardStepCurrentMarkerCO).addPredicateClassContains('eui-wizard-step__current-marker-icon');
    }
}

