Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected createAdapter(): MDCTabScrollerAdapter {
return {
...addHasRemoveClass(this.mdcRoot),
eventTargetMatchesSelector: (evtTarget: EventTarget, selector: string) =>
matches(evtTarget as Element, selector),
addScrollAreaClass: (className: string) =>
this.scrollAreaElement.classList.add(className),
setScrollAreaStyleProperty: (prop: string, value: string) =>
this.scrollAreaElement.style.setProperty(prop, value),
setScrollContentStyleProperty: (prop: string, value: string) =>
this.scrollContentElement.style.setProperty(prop, value),
getScrollContentStyleValue: (propName: string) =>
window.getComputedStyle(this.scrollContentElement)
.getPropertyValue(propName),
setScrollAreaScrollLeft: (scrollX: number) =>
this.scrollAreaElement.scrollLeft = scrollX,
getScrollAreaScrollLeft: () => this.scrollAreaElement.scrollLeft,
getScrollContentOffsetWidth: () => this.scrollContentElement.offsetWidth,
getScrollAreaOffsetWidth: () => this.scrollAreaElement.offsetWidth,
protected createAdapter(): MDCTopAppBarAdapter {
return {
...addHasRemoveClass(this.mdcRoot),
setStyle: (property: string, value: string) =>
this.mdcRoot.style.setProperty(property, value),
getTopAppBarHeight: () => this.mdcRoot.clientHeight,
notifyNavigationIconClicked: () => {
this.dispatchEvent(new Event(
strings.NAVIGATION_EVENT, {bubbles: true, cancelable: true}));
},
getViewportScrollY: () => this.scrollTarget instanceof Window ?
this.scrollTarget.pageYOffset :
this.scrollTarget.scrollTop,
getTotalActionItems: () => (this._actionItemsSlot as HTMLSlotElement)
.assignedNodes({flatten: true})
.length,
};
}