mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-1574] Info Drawer - Add a mechanism to know the current active tab (#2352)
* [ADF-1574] Info Drawer - Add a mechanism to know the current active tab * Added a output event in adf-info-drawer component to get the currently active tab * [ADF-1574] Info Drawer - Add a mechanism to know the current active tab * Added a output event in adf-info-drawer component to get the currently active tab * Added unit test file * Updated info-drawer.md
This commit is contained in:
committed by
Maurizio Vitale
parent
a3020897ed
commit
c8743dacc6
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, ContentChildren, Input, QueryList, TemplateRef, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { Component, ContentChildren, EventEmitter, Input, Output, QueryList, TemplateRef, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
@Component({
|
||||
selector: 'adf-info-drawer-tab',
|
||||
template: '<ng-template><ng-content></ng-content></ng-template>'
|
||||
@@ -36,10 +36,18 @@ export class InfoDrawerComponent {
|
||||
@Input()
|
||||
title: string|null = null;
|
||||
|
||||
@Output()
|
||||
currentTab: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
@ContentChildren(InfoDrawerTabComponent)
|
||||
contentBlocks: QueryList<InfoDrawerTabComponent>;
|
||||
|
||||
showTabLayout(): boolean {
|
||||
return this.contentBlocks.length > 0;
|
||||
}
|
||||
|
||||
onTabChange(event: any) {
|
||||
const tab = event.tab;
|
||||
this.currentTab.emit(tab.textLabel);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user