How to use the @material/linear-progress/foundation function in @material/linear-progress

To help you get started, we’ve selected a few @material/linear-progress 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 pgbross / vue-material-adapter / packages / mcwv-linear-progress / mdc-linear-progress.js View on Github external
mounted() {
    const adapter = {
      addClass: className => {
        this.$set(this.classes, className, true);
      },
      getPrimaryBar: () => this.$refs.primary,
      getBuffer: () => this.$refs.buffer,
      hasClass: className => this.$el.classList.contains(className),
      removeClass: className => this.$delete(this.classes, className),
      setStyle: (el, styleProperty, value) => (el.style[styleProperty] = value),
    };

    this.foundation = new MDCLinearProgressFoundation(adapter);
    this.foundation.init();

    this.foundation.setReverse(this.reversed);
    this.foundation.setProgress(Number(this.progress));
    this.foundation.setBuffer(Number(this.buffer));
    this.foundation.setDeterminate(!this.indeterminate);

    if (this.open) {
      this.foundation.open();
    } else {
      this.foundation.close();
    }
  },
  beforeDestroy() {
github pgbross / vue-material-adapter / packages / mcwv-linear-progress / linear-progress.js View on Github external
mounted() {
    const adapter = {
      addClass: className => {
        this.$set(this.classes, className, true);
      },
      forceLayout: () => this.$el.offsetWidth,
      getPrimaryBar: () => this.$refs.primary,
      getBuffer: () => this.$refs.buffer,
      hasClass: className => this.$el.classList.contains(className),
      removeClass: className => this.$delete(this.classes, className),
      setStyle: (el, styleProperty, value) => (el.style[styleProperty] = value),
    };

    this.foundation = new MDCLinearProgressFoundation(adapter);
    this.foundation.init();

    this.foundation.setReverse(this.reversed);
    this.foundation.setProgress(Number(this.progress));
    this.foundation.setBuffer(Number(this.buffer));
    this.foundation.setDeterminate(!this.indeterminate);

    if (this.open) {
      this.foundation.open();
    } else {
      this.foundation.close();
    }
  },
  beforeDestroy() {