import Component from '../../component.js'
import CoUxButtonGroupCheckboxButton from './ux-button-group-checkbox-button.js'
import CoUxButtonGroupRadioButton from './ux-button-group-radio-button.js'
import CoUxButtonGroupIconButton from './ux-button-group-icon-button.js'
import CoUxButtonGroupNormalButton from './ux-button-group-normal-button.js'

export default class CoUxButtonGroup extends Component {
    constructor(parent) {
      let selector = 'ux-button-group';
      super(parent, selector);
      //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/src/lib/ux-components/ux-button-group/ux-button-group.component.html?at=support/10.x
    }
    get dataE2E(){
      let path = '//div[@data-e2e = "ux-button-group"]';
      return  this.currentPath + path;
    }
    get buttonGroupCheckboxButtonCO(){
      return new CoUxButtonGroupCheckboxButton(this.dataE2E);
    }
    get buttonGroupRadioButtonCO(){
      return new CoUxButtonGroupRadioButton(this.dataE2E);
    }
    get buttonGroupIconButtonCO(){
      return new CoUxButtonGroupIconButton(this.dataE2E);
    }
    get buttonGroupNormalButtonCO(){
      return new CoUxButtonGroupNormalButton(this.dataE2E);
    }
    async isCheckboxButtons() {
      return  await (await $(this.buttonGroupCheckboxButtonCO.inputCheckbox)).isExisting();
    }
    async isRadioButtons() {
      return  await (await $(this.buttonGroupRadioButtonCO.inputRadio)).isExisting();
    }
    async hasPairedIcon() {
      return  await (await $(this.buttonGroupIconButtonCO.buttonIconOnly)).isExisting();
    }
}


