import { elementAttributeContains } from '../../core/utils.js';
import Component from '../component.js';
import SpanComponent from '../span.js';

export default class CoEuiButton extends Component {
  constructor(parent) {
    let selector = '*[self::a[@euibutton] or self::button[@euibutton]]';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-button/eui-button.component.html?at=master
  }
  get containerCO() {
    return new SpanComponent(this.currentPath).addPredicateClassContains('eui-button__container');
  }
  async isBasic() {
    return await elementAttributeContains(this.currentPath, 'class', 'eui-button--basic');
  }
  async isBlock() {
    return await elementAttributeContains(this.currentPath, 'class', 'eui-button--block');
  }
  async isIconOnly() {
    return await elementAttributeContains(this.currentPath, 'class', 'eui-button--icon-only');
  }
  async isLineWrap() {
    return await elementAttributeContains(this.currentPath, 'class', 'eui-button--line-wrap');
  }
}
