/*-------------------------------------------------------------------------------------------------------------- * Copyright (c) insite-gmbh. All rights reserved. * Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------------------------*/ import { Component, Input, Output, Inject } from '@angular/core'; import { IExpandablePanel, IExpandablePanelCollection, IEXPANDABLEPANELCOLLECTIONSERVICE_TOKEN } from '../interfaces/index'; @Component({ selector: 'panel-expander', templateUrl: './@inax/commonUi/src/expandablePanel/standardPanelExpanderComponent/standardPanelExpander.component.html', styleUrls: ['./@inax/commonUi/src/expandablePanel/standardPanelExpanderComponent/standardPanelExpander.component.css'] }) export class StandardPanelExpanderComponent { @Input() panel: string; get panelExpanded(): boolean { let p: IExpandablePanel = this._expandablePanelCollection.get(this.panel); if (p) { return p.isExpanded; } return false; } constructor(@Inject(IEXPANDABLEPANELCOLLECTIONSERVICE_TOKEN) private _expandablePanelCollection: IExpandablePanelCollection) {} onBtnClick() { let p: IExpandablePanel = this._expandablePanelCollection.get(this.panel); if (p) { p.expand(); } } }