How to use the @material/textfield.MDCTextFieldHelperTextFoundation.cssClasses function in @material/textfield

To help you get started, we’ve selected a few @material/textfield examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fintechstudios / angularjs-mdc / src / mdc-text-field / text-field / component.js View on Github external
this.helperTextElement_.textContent = this.helperText;

      if (this.helperTextPersistent) {
        this.helperTextElement_.classList.add(
          MDCTextFieldHelperTextFoundation.cssClasses.HELPER_TEXT_PERSISTENT
        );
      } else {
        this.helperTextElement_.classList.remove(
          MDCTextFieldHelperTextFoundation.cssClasses.HELPER_TEXT_PERSISTENT
        );
      }

      if (this.helperTextValidation) {
        this.helperTextElement_.classList.add(
          MDCTextFieldHelperTextFoundation.cssClasses.HELPER_TEXT_VALIDATION_MSG
        );
      } else {
        this.helperTextElement_.classList.remove(
          MDCTextFieldHelperTextFoundation.cssClasses.HELPER_TEXT_VALIDATION_MSG
        );
      }
    } else if (!wantsHelpText && this.helperTextElement_) {
      this.helperTextElement_.remove();
      delete this.helperTextElement_;
      this.inputElement_.removeAttribute('aria-controls');
    }
  }
github fintechstudios / angularjs-mdc / src / mdc-text-field / text-field / component.js View on Github external
if (wantsHelpText) {
      if (!this.helperTextElement_) {
        this.helperTextElement_ = this.$document[0].createElement('p');
        this.helperTextElement_.className = 'mdc-text-field-helper-text';
        this.helperTextElement_.id = `${this.inputElement_.id}--help`;

        this.inputElement_.setAttribute('aria-controls', this.helperTextElement_.id);
        this.root_.insertAdjacentElement('afterend', this.helperTextElement_);
      }

      this.helperTextElement_.textContent = this.helperText;

      if (this.helperTextPersistent) {
        this.helperTextElement_.classList.add(
          MDCTextFieldHelperTextFoundation.cssClasses.HELPER_TEXT_PERSISTENT
        );
      } else {
        this.helperTextElement_.classList.remove(
          MDCTextFieldHelperTextFoundation.cssClasses.HELPER_TEXT_PERSISTENT
        );
      }

      if (this.helperTextValidation) {
        this.helperTextElement_.classList.add(
          MDCTextFieldHelperTextFoundation.cssClasses.HELPER_TEXT_VALIDATION_MSG
        );
      } else {
        this.helperTextElement_.classList.remove(
          MDCTextFieldHelperTextFoundation.cssClasses.HELPER_TEXT_VALIDATION_MSG
        );
      }