Files
ghostfolio/libs/ui/src/lib/value/value.component.html
Thomas Kaul 5fd413e57e Feature/setup storybook (#332)
* Setup ui library with storybook

* Add value component with story

* Update changelog
2021-09-04 22:12:54 +02:00

46 lines
1.4 KiB
HTML

<ng-container *ngIf="value || value === 0 || value === null">
<div
class="d-flex"
[ngClass]="position === 'end' ? 'justify-content-end' : ''"
>
<ng-container *ngIf="isNumber || value === null">
<div *ngIf="colorizeSign && value > 0" class="mr-1 text-success">+</div>
<div *ngIf="colorizeSign && value < 0" class="mr-1 text-danger">-</div>
<div *ngIf="isPercent" [ngClass]="size === 'medium' ? 'h4 mb-0' : ''">
{{ formattedValue }}%
</div>
<div *ngIf="!isPercent" [ngClass]="size === 'medium' ? 'h4 mb-0' : ''">
<ng-container *ngIf="value === null">
<span class="text-monospace text-muted">***</span>
</ng-container>
<ng-container *ngIf="value !== null">
{{ formattedValue }}
</ng-container>
</div>
<small *ngIf="currency && size === 'medium'" class="ml-1">
{{ currency }}
</small>
<div *ngIf="currency && size !== 'medium'" class="ml-1">
{{ currency }}
</div>
</ng-container>
<ng-container *ngIf="isDate">
<div [ngClass]="size === 'medium' ? 'h4 mb-0' : ''">
{{ formattedDate }}
</div>
</ng-container>
</div>
<small *ngIf="label">
{{ label }}
</small>
</ng-container>
<ngx-skeleton-loader
*ngIf="value === undefined"
animation="pulse"
[theme]="{
height: '1.5rem',
width: '5rem'
}"
></ngx-skeleton-loader>