license import { MDCTabIndicatorFoundation } from './foundation' ; export class MDCSlidingTabIndicatorFoundation extends MDCTabIndicatorFoundation { activate ( previousIndicatorClientRect ? ) { if ( ! previousIndicatorClientRect ) { this . adapter . addClass ( MDCTabIndicatorFoundation . cssClasses . ACTIVE ) ; return ; } const currentClientRect = this . computeContentClientRect ( ) ; const widthDelta = previousIndicatorClientRect . width / currentClientRect . width ; const xPosition = previousIndicatorClientRect . left - currentClientRect . left ; this . adapter . addClass ( MDCTabIndicatorFoundation . cssClasses . NO_TRANSITION ) ; this . adapter . setContentStyleProperty ( 'transform' , `translateX(${ xPosition }px) scaleX(${ widthDelta })` ) ; this . computeContentClientRect ( ) ; this . adapter . removeClass ( MDCTabIndicatorFoundation . cssClasses . NO_TRANSITION ) ; this . adapter . addClass ( MDCTabIndicatorFoundation . cssClasses . ACTIVE ) ; this . adapter . setContentStyleProperty ( 'transform' , '' ) ; } deactivate ( ) { this . adapter . removeClass ( MDCTabIndicatorFoundation . cssClasses . ACTIVE ) ; } } export default MDCSlidingTabIndicatorFoundation ;