@blox/material
Version:
Material Components for Angular
73 lines (72 loc) • 2.85 kB
TypeScript
import { AfterContentInit, EventEmitter, ElementRef, OnDestroy, Renderer2 } from '@angular/core';
import { AbstractMdcRipple } from '../ripple/abstract.mdc.ripple';
import { MdcEventRegistry } from '../../utils/mdc.event.registry';
/**
* The interface for events send by the <code>activate</code> output of an
* `mdcTab` directive, or by the <code>tabChange</code> output of an <code>mdcTabBar</code>.
*/
export interface MdcTabChange {
/**
* A reference to the tab that sends the event.
*/
tab: AbstractMdcTabDirective;
/**
* The index of the tab that sends the event.
*/
tabIndex: number;
}
/**
* Directive for an optional icon when having a tab bar with icons.
* This directive must be used as a child of an `mdcTabContent`, and as a sibbling
* to a following `mdcTabLabel`.
*/
export declare class MdcTabIconDirective {
}
/**
* Directive for the text label of a tab.
* This directive must be used as a child of an `mdcTabContent`.
* It can be preceded by an optional `mdcTabIcon`.
*/
export declare class MdcTabLabelDirective {
}
/**
* Directive for the content (label and optional icon of the tab).
* This directive must be used as a child of an `mdcTab`, and
* can contain an (optional) `mdcTabIcon` and an `mdcTabLabel`.
*/
export declare class MdcTabContentDirective {
_root: ElementRef;
constructor(_root: ElementRef);
}
export declare abstract class AbstractMdcTabDirective extends AbstractMdcRipple implements OnDestroy, AfterContentInit {
protected _rndr: Renderer2;
_root: ElementRef;
protected _registry: MdcEventRegistry;
private onDestroy$;
/**
* Event called when the tab is activated.
*/
readonly activate: EventEmitter<MdcTabChange>;
private activationRequest;
constructor(_rndr: Renderer2, _root: ElementRef, _registry: MdcEventRegistry, doc: any);
ngAfterContentInit(): void;
ngOnDestroy(): void;
private destroyFoundation;
private initFoundation;
}
/**
* Directive for a tab. This directive must be used as a child of <code>mdcTabBar</code>.
* When using tabs in combination with angular routes, add a `routerLink` property, so that
* the `MdcTabRouterDirective` is selected instead of this directive.
*/
export declare class MdcTabDirective extends AbstractMdcTabDirective {
constructor(rndr: Renderer2, root: ElementRef, registry: MdcEventRegistry, doc: any);
/**
* Input for activating the tab. Assign a truthy value to activate the tab. A falsy value
* will have no effect. In order to deactivate the tab, you must activate another tab.
*/
get active(): boolean;
set active(value: boolean);
static ngAcceptInputType_active: boolean | '';
}
export declare const TAB_DIRECTIVES: (typeof MdcTabLabelDirective | typeof MdcTabContentDirective | typeof MdcTabDirective)[];