@angular-mdc/web
Version:
82 lines (81 loc) • 2.9 kB
TypeScript
import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, InjectionToken, NgZone, OnDestroy, OnInit } from '@angular/core';
import { MDCComponent } from '@angular-mdc/web/base';
import { MdcRipple, MDCRippleCapableSurface } from '@angular-mdc/web/ripple';
import { MdcTabIndicator } from '@angular-mdc/web/tab-indicator';
import { MDCTabFoundation } from '@material/tab';
/**
* Describes a parent MdcTabBar component.
* Contains properties that MdcTab can inherit.
*/
export interface MdcTabBarParentComponent {
activateTab(index: number): void;
getTabIndex(tab: MdcTab): number;
}
/**
* Injection token used to provide the parent MdcTabBar component to MdcTab.
*/
export declare const MDC_TAB_BAR_PARENT_COMPONENT: InjectionToken<MdcTabBarParentComponent>;
export interface MdcTabInteractedEvent {
detail: {
tabId: string;
tab: MdcTab;
};
}
export declare class MdcTabLabel {
elementRef: ElementRef;
constructor(elementRef: ElementRef);
}
export declare class MdcTabIcon {
elementRef: ElementRef;
constructor(elementRef: ElementRef);
}
export declare class MdcTab extends MDCComponent<MDCTabFoundation> implements AfterViewInit, OnInit, OnDestroy, MDCRippleCapableSurface {
private _ngZone;
private _changeDetectorRef;
private _ripple;
elementRef: ElementRef<HTMLElement>;
private _parent;
/** Emits whenever the component is destroyed. */
private _destroy;
_root: Element;
private _uniqueId;
id: string;
label?: string;
icon?: string;
get stacked(): boolean;
set stacked(value: boolean);
private _stacked;
get fixed(): boolean;
set fixed(value: boolean);
private _fixed;
get disabled(): boolean;
set disabled(value: boolean);
private _disabled;
get focusOnActivate(): boolean;
set focusOnActivate(value: boolean);
private _focusOnActivate;
readonly interacted: EventEmitter<MdcTabInteractedEvent>;
content: ElementRef;
rippleSurface: ElementRef;
tabIndicator: MdcTabIndicator;
getDefaultFoundation(): MDCTabFoundation;
constructor(_ngZone: NgZone, _changeDetectorRef: ChangeDetectorRef, _ripple: MdcRipple, elementRef: ElementRef<HTMLElement>, _parent: MdcTabBarParentComponent);
ngOnInit(): void;
ngAfterViewInit(): void;
ngOnDestroy(): void;
/** Getter for the active state of the tab */
get active(): boolean;
/** Activates the tab */
activate(computeIndicatorClientRect?: ClientRect): void;
/** Deactivates the tab */
deactivate(): void;
/** Returns the indicator's client rect */
computeIndicatorClientRect(): ClientRect;
computeDimensions(): any;
getTabBarParent(): MdcTabBarParentComponent;
focus(): void;
private _createRipple;
private _loadListeners;
/** Retrieves the DOM element of the component host. */
private _getHostElement;
}