How to use @material/linear-progress - 10 common examples

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 angular / components / src / material-experimental / mdc-progress-bar / progress-bar.ts View on Github external
ngAfterViewInit() {
    const element = this._elementRef.nativeElement;

    this._rootElement = element.querySelector('.mdc-linear-progress') as HTMLElement;
    this._primaryBar = element.querySelector('.mdc-linear-progress__primary-bar') as HTMLElement;
    this._bufferBar = element.querySelector('.mdc-linear-progress__buffer') as HTMLElement;

    this._foundation = new MDCLinearProgressFoundation(this._adapter);
    this._foundation.init();
    this._syncFoundation();

    if (!this._isNoopAnimation) {
      // Run outside angular so change detection didn't get triggered on every transition end
      // instead only on the animation that we care about (primary value bar's transitionend)
      this._ngZone.runOutsideAngular((() => {
        this._animationEndSubscription =
            (fromEvent(this._primaryBar, 'transitionend') as Observable)
              .pipe(filter(((e: TransitionEvent) => e.target === this._primaryBar)))
              .subscribe(() => this._ngZone.run(() => this._emitAnimationEnd()));
      }));
    }
  }
github Tencent / omi / packages / omim / src / linear-progress / index.tsx View on Github external
installed() {

    new MDCLinearProgress(this.shadowRoot.querySelector('.mdc-linear-progress'));
    // progress.listen('MDCSlider:change', () => {
    //   this.fire('change', { value: slider.progress })
    // });
  }
github grow / grow / grow / ui / js / editor / editor.js View on Github external
this._isEditingSource = false

    this.autosaveEl.addEventListener('click', this.handleAutosaveClick.bind(this))
    this.saveEl.addEventListener('click', () => { this.save(true) })
    this.podPathEl.addEventListener('change', () => { this.load(this.podPath) })
    this.podPathEl.addEventListener('keyup', () => { this.delayPodPath() })

    this.mobileToggleMd = MDCIconToggle.attachTo(this.mobileToggleEl)
    this.mobileToggleEl.addEventListener(
      'MDCIconToggle:change', this.handleMobileClick.bind(this))
    this.sourceToggleMd = MDCIconToggle.attachTo(this.sourceToggleEl)
    this.sourceToggleEl.addEventListener(
      'MDCIconToggle:change', this.handleSourceClick.bind(this))
    this.podPathMd = new MDCTextField(
      this.containerEl.querySelector('.content__path .mdc-text-field'))
    this.saveProgressMd = MDCLinearProgress.attachTo(
      this.containerEl.querySelector('.sidebar__save .mdc-linear-progress'))
    this.saveProgressMd.close()

    this.api = new EditorApi({
      host: this.host,
      port: this.port,
    })
    this.partials = new Partials(this.api)

    // Default to loading with the UI.
    this.load(this.podPath)

    // TODO Start the autosave depending on local storage.
    // this.startAutosave()
  }
github gutenye / react-mc / src / LinearProgress / LinearProgress.js View on Github external
getDefaultFoundation() {
    // prettier-ignore
    return new MDCLinearProgressFoundation({
      addClass: helper.addClass('rootProps', this),
      getPrimaryBar: () => this.root_.querySelector(MDCLinearProgressFoundation.strings.PRIMARY_BAR_SELECTOR),
      getBuffer: () => this.root_.querySelector(MDCLinearProgressFoundation.strings.BUFFER_SELECTOR),
      hasClass: helper.hasClass('rootProps', this),
      removeClass: helper.removeClass('rootProps', this),
      setStyle: (el, styleProperty, value) => el.style[styleProperty] = value,
    })
  }
github src-zone / material / bundle / src / components / linear-progress / mdc.linear-progress.directive.ts View on Github external
hasClass: (className: string) => {
            if (className === CLASS_INDETERMINATE)
                return this._indeterminate;
            if (className === CLASS_REVERSED)
                return this._reverse;
            return this._root.nativeElement.classList.contains(className);
        },
        removeClass: (className: string) => {
            if (className !== CLASS_INDETERMINATE && className != CLASS_REVERSED)
                this._rndr.removeClass(this._root.nativeElement, className);
        },
        setStyle: (el: Element, styleProperty: string, value: number) => {
            this._rndr.setStyle(el, styleProperty, value);
        }
    };
    private foundation: MdcLinearProgressFoundationInterface = new MDCLinearProgressFoundation(this.mdcAdapter);

    constructor(private _rndr: Renderer2, private _root: ElementRef, private _registry: MdcEventRegistry) {
    }

    ngAfterContentInit() {
        this.initElements();
        this.foundation.init();
        this._initialized = true;
        this.foundation.setProgress(this._progress);
        this.foundation.setBuffer(this._buffer);
        if (this._closed)
            this.foundation.close();
    }

    ngOnDestroy() {
        this.foundation.destroy();
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() {
github prateekbh / preact-material-components / ts / LinearProgress / index.tsx View on Github external
public componentDidMount() {
    super.componentDidMount();
    if (this.control) {
      this.MDComponent = new MDCLinearProgress(this.control);
      this.MDComponent.determinate = !this.props.indeterminate;
      this.MDComponent.reverse = !!this.props.reversed;
    }
    this.afterComponentDidMount();
  }
github prateekbh / preact-material-components / LinearProgress / index.js View on Github external
componentDidMount() {
    this.MDComponent = new MDCLinearProgress(this.control);
  }
  componentWillUnmount() {
github cdr / code-server / packages / app / common / src / containers.tsx View on Github external
<div role="progressbar"> {
						if (d) new MDCLinearProgress(d)}}&gt;
						<div></div></div>