import Component from '../../component.js'
import { elementAttributeContains } from '../../../core/utils.js'
import CoEuiIcon from './eui-icon.js'

export default class CoEuiTableSelectableHeader extends Component {
    constructor(parent) {
      let selector = 'th[contains(@class, "eui-u-color-grey-light") and contains(@class, "eui-u-cursor-pointer")]';
      super(parent, selector);
      //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components-next/src/lib/components/eui-table/selectable-header/eui-table-selectable-header.component.html
    }
    get euiIconCO() {
      return new CoEuiIcon(this.currentPath);
    }
    async isChecked() {
      let cl = await (await $(this.euiIconCO.currentPath)).getAttribute('class');
      if(await cl.includes('eui-icon-checkbox-outline')) {
        return false;
      } else {
        return true;
      }
    }
}


