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::eui-sublabel or self::a[@euiSublabel]]';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/atoms/eui-label/eui-label.component.ts?at=support/13.x
  }
  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');
  }
}


