add more card variatns to dashboard statistic card
This commit is contained in:
+28
-11
@@ -1,13 +1,4 @@
|
||||
<a
|
||||
class="statistics-card"
|
||||
[routerLink]="disabled() ? null : link()"
|
||||
[queryParams]="queryParams()"
|
||||
[class.disabled]="disabled()"
|
||||
[attr.aria-disabled]="disabled() || null"
|
||||
[attr.aria-label]="ariaLabel()"
|
||||
[attr.tabindex]="disabled() ? -1 : null"
|
||||
[matTooltip]="tooltip()"
|
||||
matTooltipPosition="above">
|
||||
<ng-template #content>
|
||||
<div class="statistics-icon" [class]="'statistics-icon--' + variant()">
|
||||
<mat-icon>{{ icon() }}</mat-icon>
|
||||
</div>
|
||||
@@ -15,4 +6,30 @@
|
||||
<span>{{ label() }}</span>
|
||||
<strong>{{ loading() ? '…' : ((value() | number) ?? '–') }}</strong>
|
||||
</div>
|
||||
</a>
|
||||
</ng-template>
|
||||
|
||||
@if (link()) {
|
||||
<a
|
||||
class="statistics-card"
|
||||
[routerLink]="disabled() ? null : link()"
|
||||
[queryParams]="queryParams()"
|
||||
[class.disabled]="disabled()"
|
||||
[attr.aria-disabled]="disabled() || null"
|
||||
[attr.aria-label]="ariaLabel()"
|
||||
[attr.tabindex]="disabled() ? -1 : null"
|
||||
[matTooltip]="tooltip()"
|
||||
matTooltipClass="sg-tooltip-wide"
|
||||
matTooltipPosition="above">
|
||||
<ng-container *ngTemplateOutlet="content" />
|
||||
</a>
|
||||
} @else {
|
||||
<div
|
||||
class="statistics-card statistics-card--static"
|
||||
role="group"
|
||||
[attr.aria-label]="ariaLabel()"
|
||||
[matTooltip]="tooltip()"
|
||||
matTooltipClass="sg-tooltip-wide"
|
||||
matTooltipPosition="above">
|
||||
<ng-container *ngTemplateOutlet="content" />
|
||||
</div>
|
||||
}
|
||||
|
||||
+22
-1
@@ -34,6 +34,16 @@
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
&--static {
|
||||
cursor: default;
|
||||
|
||||
&:hover {
|
||||
border-color: var(--sg-border);
|
||||
box-shadow: var(--sg-shadow-sm);
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
span {
|
||||
display: block;
|
||||
color: var(--sg-text-muted);
|
||||
@@ -69,8 +79,19 @@
|
||||
}
|
||||
|
||||
&--bund-projects,
|
||||
&--dfg-projects {
|
||||
&--dfg-projects,
|
||||
&--shortlist {
|
||||
background: var(--sg-warning-soft);
|
||||
color: var(--sg-warning);
|
||||
}
|
||||
|
||||
&--founders {
|
||||
background: var(--sg-primary-soft);
|
||||
color: var(--sg-blue-highlight);
|
||||
}
|
||||
|
||||
&--quality {
|
||||
background: var(--sg-success-soft);
|
||||
color: var(--sg-success);
|
||||
}
|
||||
}
|
||||
|
||||
+12
-3
@@ -1,4 +1,4 @@
|
||||
import { DecimalPipe } from '@angular/common';
|
||||
import { DecimalPipe, NgTemplateOutlet } from '@angular/common';
|
||||
import { Component, input } from '@angular/core';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
@@ -10,11 +10,20 @@ export type DashboardStatisticCardVariant =
|
||||
| 'patents'
|
||||
| 'eu-projects'
|
||||
| 'bund-projects'
|
||||
| 'dfg-projects';
|
||||
| 'dfg-projects'
|
||||
| 'founders'
|
||||
| 'quality'
|
||||
| 'shortlist';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dashboard-statistic-card',
|
||||
imports: [DecimalPipe, MatIconModule, MatTooltipModule, RouterLink],
|
||||
imports: [
|
||||
DecimalPipe,
|
||||
NgTemplateOutlet,
|
||||
MatIconModule,
|
||||
MatTooltipModule,
|
||||
RouterLink,
|
||||
],
|
||||
templateUrl: './dashboard-statistic-card.component.html',
|
||||
styleUrl: './dashboard-statistic-card.component.scss',
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user