How to use @material/tab-scroller - 10 common examples

To help you get started, we’ve selected a few @material/tab-scroller 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-react / packages / tab-scroller / index.tsx View on Github external
componentDidMount() {
    this.foundation = new MDCTabScrollerFoundation(this.adapter);
    this.foundation.init();
  }
github jamesmfriedman / rmwc / src / tabs / tab-scroller-foundation.tsx View on Github external
computeHorizontalScrollbarHeight: () =>
          scrollerUtil.computeHorizontalScrollbarHeight(document)
      });
github trimox / angular-mdc-web / packages / tab-scroller / tab-scroller.ts View on Github external
computeHorizontalScrollbarHeight: () =>
        this._platform.isBrowser ? util.computeHorizontalScrollbarHeight(document) : 0
    };
github jamesmfriedman / rmwc / src / tabs / tab-scroller.tsx View on Github external
computeHorizontalScrollbarHeight: () =>
        scrollerUtil.computeHorizontalScrollbarHeight(document)
    });
github jamesmfriedman / rmwc / src / tabs / tab-scroller.tsx View on Github external
getDefaultFoundation() {
    return new MDCTabScrollerFoundation({
      eventTargetMatchesSelector: (evtTarget: EventTarget, selector: string) =>
        matches(evtTarget as HTMLElement, selector),
      addClass: (className: string) => this.root.addClass(className),
      removeClass: (className: string) => this.root.removeClass(className),
      addScrollAreaClass: (className: string) => this.area.addClass(className),
      setScrollAreaStyleProperty: (prop: string, value: string) =>
        this.area.setStyle(prop, value),
      setScrollContentStyleProperty: (prop: string, value: string) =>
        this.content.setStyle(prop, value),
      getScrollContentStyleValue: (propName: string) => {
        const val =
          this.content.ref &&
          window.getComputedStyle(this.content.ref).getPropertyValue(propName);

        return val || 'none';
      },
github trimox / angular-mdc-web / packages / tab-scroller / tab-scroller.ts View on Github external
setScrollContentStyleProperty: (propName: string, value: string) =>
        this.content.nativeElement.style.setProperty(propName, value),
      getScrollContentStyleValue: (propName: string) =>
        this._platform.isBrowser ? window.getComputedStyle(this.content.nativeElement).getPropertyValue(propName) : '',
      setScrollAreaScrollLeft: (scrollX: number) => this.area.nativeElement.scrollLeft = scrollX,
      getScrollAreaScrollLeft: () => this.area.nativeElement.scrollLeft,
      getScrollContentOffsetWidth: () => this.content.nativeElement.offsetWidth,
      getScrollAreaOffsetWidth: () => this.area.nativeElement.offsetWidth,
      computeScrollAreaClientRect: () =>
        this._platform.isBrowser ? this.area.nativeElement.getBoundingClientRect() : {},
      computeScrollContentClientRect: () =>
        this._platform.isBrowser ? this.content.nativeElement.getBoundingClientRect() : {},
      computeHorizontalScrollbarHeight: () =>
        this._platform.isBrowser ? util.computeHorizontalScrollbarHeight(document) : 0
    };
    return new MDCTabScrollerFoundation(adapter);
  }
github matsp / material-components-vue / components / tabs / TabScroller.vue View on Github external
mounted () {
    if (this.getTabScroller instanceof Function) {
      this.$nextTick(() => {
        this.mdcTabScroller = this.getTabScroller()
      })
    } else {
      this.mdcTabScroller = MDCTabScroller.attachTo(this.$el)
    }
  },
  beforeDestroy () {
github material-components / material-components-web / packages / mdc-tab-bar / component.ts View on Github external
      tabScrollerFactory: MDCTabScrollerFactory = (el) => new MDCTabScroller(el),
  ) {
github pgbross / vue-material-adapter / packages / mcwv-tabs / tab-scroller.js View on Github external
mounted() {
    this.foundation = new MDCTabScrollerFoundation({
      eventTargetMatchesSelector: (evtTarget, selector) => {
        return matches(evtTarget, selector);
      },
      addClass: className => this.$set(this.classes, className, true),

      removeClass: className => this.$delete(this.classes, className),
      addScrollAreaClass: className =>
        this.$set(this.areaClasses, className, true),
      setScrollAreaStyleProperty: (prop, value) =>
        this.$set(this.areaStyles, prop, value),
      setScrollContentStyleProperty: (prop, value) =>
        this.$set(this.contentStyles, prop, value),
      getScrollContentStyleValue: propName =>
        window.getComputedStyle(this.$refs.content).getPropertyValue(propName),
      setScrollAreaScrollLeft: scrollX =>
        (this.$refs.area.scrollLeft = scrollX),
github pgbross / vue-material-adapter / packages / mcwv-tabs / tab-scroller.js View on Github external
computeHorizontalScrollbarHeight: () =>
        util.computeHorizontalScrollbarHeight(document),
    });