-
Notifications
You must be signed in to change notification settings - Fork 20
Panel header
FilipLeitner edited this page Mar 5, 2024
·
4 revisions
Panel header consits of 3 configurable parts:
- one or more tabs which are used to title panel component or its subsections.
- main action button (optional)
- drop-down menu of additional panel actions
- configured by
panelTabs
input as a single translation string[panelTabs]="'COMPOSITIONS'"
or comma-separated ones[panelTabs]="'catalogue,url,file'"
- atempt to translate each tab title will be made using 'PANEL_HEADER' translation module. If the translation is not defined on this module use
translationModule
input to override the value
@Input({transform: toArray}) panelTabs: string[];
@Input() translationModule: string = 'PANEL_HEADER';
- active tab is determined by the value of
@Input() selectedTab$: BehaviorSubject<string>;
. Selecting a tab emmits a new value to the provided subject
-
Buttons are provided via projected content.
-
Main button is not hidden in a dropdown and provides easy access of an action. Projected via
<ng-content select="[mainButton]"/>
eg. needsmainButton
directive to be indentified -
extra-buttons are projected via
<ng-content select="extra-buttons"/>
eg. as a part ofextra-buttons
element. As projected content is placed inside of the ng-bootstrap dropdown it is expected that each action wil havedropdown-item
class.
<hs-panel-header name="custom" [panelTabs]="'My Cool Panel'" [translationModule]="''">
<button mainButton [disabled]="!hsConfig.panelsEnabled['custom']"
class="btn btn-sm btn-outline-primary"
(click)="mainButtonAction()"> {{'PANEL_HEADER.CUSTOM' | translateHs}}
<i class="glyphicon icon-save-floppy"></i>
</button>
<extra-buttons>
<a class="dropdown-item" (click)="actionA()">
<i class="icon-fatredo"></i> {{'CUSTOM.actionA' | translateHs}}
</a>
<a class="dropdown-item" (click)="actionB()">
<i class="icon-plus"></i> {{'CUSTOM.actionB'|translateHs}}
</a>
</extra-buttons>
</hs-panel-header>
Quick Links: Home ➖ App configuration ➖ Layer configuration ➖ Cesium configuration ➖ Composition schema (separate repo)