<commit_before>part of nest_ui;

class FormFieldComponentBehaviors extends BaseComponentBehaviors {

  Component component;
  FormFieldComponentBehaviors(c) : super(c) {
    this.component = c;
  }

  showErrors() {
    this.dom_element.classes.add('errors');
    if(this.validation_errors_summary_element != null)
      this.validation_errors_summary_element.style.display = 'block';
  }

  hideErrors() {
    this.dom_element.classes.remove('errors');
    if(this.validation_errors_summary_element != null)
      this.validation_errors_summary_element.style.display = 'none';
  }

  disable() {
    this.component.value_holder_element.attributes["disabled"] = "disabled";
    this.component.disabled = true;
  }

  enable() {
    this.component.value_holder_element.attributes.remove("disabled");
    this.component.disabled = false;
  }

  get validation_errors_summary_element {
    return this.component.firstDomDescendantOrSelfWithAttr(
      this.dom_element, attr_name: 'data-component-property', attr_value: 'validation_errors_summary'
    );
  }

}
<commit_msg>showErrors()/hideErrors() in FormFieldComponentBehaviors calls the same behavior on component's children<commit_after>part of nest_ui;

class FormFieldComponentBehaviors extends BaseComponentBehaviors {

  Component component;
  FormFieldComponentBehaviors(c) : super(c) {
    this.component = c;
  }

  showErrors() {
    this.component.children.forEach((c) => c.behave("showErrors"));
    this.dom_element.classes.add('errors');
    if(this.validation_errors_summary_element != null)
      this.validation_errors_summary_element.style.display = 'block';
  }

  hideErrors() {
    this.component.children.forEach((c) => c.behave("hideErrors"));
    this.dom_element.classes.remove('errors');
    if(this.validation_errors_summary_element != null)
      this.validation_errors_summary_element.style.display = 'none';
  }

  disable() {
    this.component.value_holder_element.attributes["disabled"] = "disabled";
    this.component.disabled = true;
  }

  enable() {
    this.component.value_holder_element.attributes.remove("disabled");
    this.component.disabled = false;
  }

  get validation_errors_summary_element {
    return this.component.firstDomDescendantOrSelfWithAttr(
      this.dom_element, attr_name: 'data-component-property', attr_value: 'validation_errors_summary'
    );
  }

}

{'fraction_non_alphanumeric': 0.11566061629379484, 'fraction_numerical': 0.0, 'mean_word_length': 4.629453681710213, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1363815', 'n_tokens_mistral': 717, 'n_tokens_neox': 703, 'n_words': 99}