import Component from './component.js'

export default class LabelComponent extends Component {
    /**
    * @param {string} parent
    */
    constructor(parent, selector) {
      if (selector) {
          super(parent, selector);
      } else {
          super(parent, 'label');
      }
    }

    /**
    * Sets the current component element to an xpath selector where the given attribute equals the given value [@for="forx"] and returns the updated component.
    * The parent remains unchanged
    * @param forx string
    * @type Component
    */
    byFor(forx) {
      this.currentPath = this.parent + '//' + this.selector + '[@for="' + forx + '"]';
      return this;
    }
}
