Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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';
},
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);
}