Files
smartguide/webapp/src/app/shared/ui/topic-legend/topic-legend.component.html
T

101 lines
3.2 KiB
HTML

<section
*ngIf="hasGroups"
class="topic-legend"
[class.topic-legend-compact]="variant === 'compact'"
[class.topic-legend-expanded]="expanded"
[class.topic-legend-selectable]="selectable"
aria-label="Aktuell sichtbare Themenbereiche">
<div *ngIf="hasHeader" class="topic-legend-header">
<div *ngIf="showTitle" class="topic-legend-title">
<span>{{ title }}</span>
<mat-icon
class="topic-legend-info"
[matTooltip]="infoTooltip"
matTooltipPosition="above"
aria-label="Informationen zur Farblegende">
info_outline
</mat-icon>
</div>
<button
*ngIf="showVisibilityToggle"
type="button"
class="topic-legend-visibility-toggle"
[attr.aria-expanded]="visible"
(click)="toggleVisibility()">
<span>{{ visible ? 'Legende ausblenden' : 'Legende einblenden' }}</span>
<mat-icon aria-hidden="true">
{{ visible ? 'expand_less' : 'expand_more' }}
</mat-icon>
</button>
</div>
<div
*ngIf="visible"
class="topic-legend-body"
[class.topic-legend-body-inline-info]="!hasHeader">
<mat-icon
*ngIf="!hasHeader"
class="topic-legend-info topic-legend-info-inline"
[matTooltip]="infoTooltip"
matTooltipPosition="above"
aria-label="Informationen zur Farblegende">
info_outline
</mat-icon>
<div class="topic-legend-content">
<div
*ngFor="let group of visibleGroups; trackBy: trackByGroup"
class="topic-legend-group"
[class.topic-legend-group-active]="isFieldActive(group)"
[style.--legend-color]="group.color">
<button
type="button"
class="topic-legend-field"
[class.topic-legend-entry-active]="isFieldActive(group)"
[attr.aria-pressed]="selectable ? isFieldActive(group) : null"
[matTooltip]="group.tooltip"
[matTooltipDisabled]="!group.tooltip"
matTooltipClass="topic-chip-tooltip"
matTooltipPosition="above"
(click)="toggleField(group)">
<span
class="topic-legend-dot"
[style.background]="group.color"
aria-hidden="true"></span>
<span>{{ group.name }}</span>
</button>
<span class="topic-legend-items">
<button
*ngFor="let item of group.items; trackBy: trackByItem"
type="button"
class="topic-legend-item"
[class.topic-legend-entry-active]="isSubfieldActive(item)"
[attr.aria-pressed]="selectable ? isSubfieldActive(item) : null"
[matTooltip]="item.tooltip"
[matTooltipDisabled]="!item.tooltip"
matTooltipClass="topic-chip-tooltip"
matTooltipPosition="above"
(click)="toggleSubfield(group, item)">
{{ item.name }}
</button>
</span>
</div>
<button
*ngIf="showExpandedToggle"
type="button"
class="topic-legend-more-toggle"
[attr.aria-expanded]="expanded"
(click)="toggleExpanded()">
{{
expanded
? 'Weniger anzeigen'
: '+' + hiddenLegendItemCount + ' weitere'
}}
</button>
</div>
</div>
</section>