How to use the @material/textfield.MDCTextFieldFoundation.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
constructor(...args) {
    super(...args);

    this.$element.addClass(MDCTextFieldFoundation.cssClasses.ROOT);

    this.root_ = this.$element[0];
    this.setupInput_();
  }
github fintechstudios / angularjs-mdc / src / mdc-text-field / text-field / component.js View on Github external
setupDense_() {
    this.$element.toggleClass(MDCTextFieldFoundation.cssClasses.DENSE, !this.isTextArea && Boolean(this.dense));
  }
github fintechstudios / angularjs-mdc / src / mdc-text-field / text-field / component.js View on Github external
setupOutlinedAndBox_() {
    const outlineElement = this.root_.getElementsByClassName('mdc-text-field__outline')[0];
    const idleOutlineElement = this.root_.getElementsByClassName('mdc-text-field__idle-outline')[0];
    const bottomLineElement = this.root_.getElementsByClassName('mdc-line-ripple')[0];

    this.$element.toggleClass(MDCTextFieldFoundation.cssClasses.OUTLINED, Boolean(this.outlined) && !this.isTextArea);
    this.$element.toggleClass(MDCTextFieldFoundation.cssClasses.BOX, !Boolean(this.outlined) && Boolean(this.box));

    const wantsOutline = this.outlined && !this.isTextArea;
    const wantsBottomLine = !this.outlined && !this.isTextArea;

    if (wantsOutline && !outlineElement) {
      if (!outlineElement) {
        this.$element.append(outlineTemplate);
      }
    } else if (!wantsOutline) {
      if (outlineElement) {
        outlineElement.remove();
      }
      if (idleOutlineElement) {
        idleOutlineElement.remove();
      }
    }