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

export default class CoEuiInputRadio extends Component {
    constructor(parent) {
      let selector = 'input[@euiInputRadio]' ;
      super(parent, selector);
      // https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components-next/src/lib/components/eui-input-radio/eui-input-radio.component.ts?at=support%2Fdevelop-10.x
    }
    async hasNoLabel() {
      return await elementAttributeContains(this.currentPath, 'class', 'eui-input-radio--nolabel');
    }
    async isInvalid() {
      return await elementAttributeContains(this.currentPath, 'class', 'eui-input-radio--invalid');
    }
    async isDisabled() {
      return await elementAttributeContains(this.currentPath, 'class', 'eui-input-radio--disabled');
    }
    async isReadOnly() {
      return await (await $(this.currentPath + '/self::input[@readonly]')).isExisting();
    }
    async labelCO(){
      return await new LabelComponent(this.parent).byFor(await (await this.element()).getAttribute('id'));
    }
}


