igniteui-angular-sovn
Version:
Ignite UI for Angular is a dependency-free Angular toolkit for building modern web apps
63 lines (50 loc) • 1.74 kB
text/typescript
import { ContentChild, Directive, EventEmitter, Input, Output, TemplateRef, ViewChild } from '@angular/core';
import { Direction, IgxSlideComponentBase } from '../carousel/carousel-base';
import { IgxTabHeaderBase, IgxTabItemBase, IgxTabContentBase, IgxTabsBase } from './tabs.base';
export abstract class IgxTabItemDirective implements IgxTabItemBase, IgxSlideComponentBase {
/** @hidden */
public headerComponent: IgxTabHeaderBase;
/** @hidden */
public panelComponent: IgxTabContentBase;
/** @hidden */
public headerTemplate: TemplateRef<any>;
/** @hidden */
public panelTemplate: TemplateRef<any>;
/**
* Output to enable support for two-way binding on [(selected)]
*/
public selectedChange = new EventEmitter<boolean>();
/**
* An @Input property that allows you to enable/disable the item.
*/
public disabled = false;
/** @hidden */
public direction = Direction.NONE;
/** @hidden */
public previous: boolean;
private _selected = false;
/**
* An @Input property which determines whether an item is selected.
*/
public get selected(): boolean {
return this._selected;
}
public set selected(value: boolean) {
if (this._selected !== value) {
this._selected = value;
this.tabs.selectTab(this, this._selected);
this.selectedChange.emit(this._selected);
}
}
/** @hidden */
constructor(private tabs: IgxTabsBase) {
}
}