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

export default class CoEuiLabel extends Component {
  constructor(parent) {
    let selector = '*[self::label[@euilabel] or self::span[@euilabel] or self::div[@euilabel] or self::a[@euilabel] or self::eui-label or ' +
    'self::label[@euisublabel] or self::span[@euisublabel] or self::div[@euisublabel] or self::a[@euisublabel] or self::eui-sublabel]';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-label/eui-label.component.ts
  }
  async isRequired() {
    return await elementAttributeContains(this.currentPath, 'class', 'eui-label--required');
  }
  async isReadOnly() {
    return await elementAttributeContains(this.currentPath, 'class', 'eui-label--readonly');
  }
  async isSubLabel() {
    return await elementAttributeContains(this.currentPath, 'class', 'eui-label__sublabel');
  }
}


