How to use the @material/mwc-base/form-element.js.classMap function in @material/mwc-base

To help you get started, we’ve selected a few @material/mwc-base 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 material-components / material-components-web-components / packages / textfield / src / mwc-textfield-base-element.ts View on Github external
protected renderHelperText() {
    const classes = {
      'mdc-text-field-helper-text--persistent': this.helperPersistent,
    };
    return html`
      <div class="mdc-text-field-helper-line">
        <div class="mdc-text-field-helper-text ${classMap(classes)}">${this.helper}</div>
        ${this.charCounter ? html`<div class="mdc-text-field-character-counter"></div>` : ''}
      </div>
    `;
  }
github material-components / material-components-web-components / packages / textarea / src / mwc-textarea-base.ts View on Github external
render() {
    const classes = {
      'mdc-text-field--disabled': this.disabled,
      'mdc-text-field--no-label': !this.label,
      'mdc-text-field--outlined': this.outlined,
      'mdc-text-field--fullwidth': this.fullWidth,
    };
    return html`
      <div class="mdc-text-field mdc-text-field--textarea ${classMap(classes)}">
        ${
        this.charCounter ? html`<div></div>` :
                           ''}
        ${this.renderInput()}
        ${this.outlined ? this.renderOutlined() : this.renderLabelText()}
      </div>
      ${this.helper ? this.renderHelperText() : ''}
    `;
  }