Browse Source

Merge branch 'main' into feature/improve-language-localization-for-german

pull/1809/head
Thomas Kaul 3 years ago
committed by GitHub
parent
commit
20715df209
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      CHANGELOG.md
  2. 25
      libs/ui/src/lib/value/value.component.html
  3. 10
      libs/ui/src/lib/value/value.component.ts

5
CHANGELOG.md

@ -9,8 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Improved the value component by always showing the label (also while loading)
- Improved the language localization for German (`de`) - Improved the language localization for German (`de`)
### Fixed
- Fixed an issue with the algebraic sign in the value component
## 1.248.0 - 2023-03-25 ## 1.248.0 - 2023-03-25
### Added ### Added

25
libs/ui/src/lib/value/value.component.html

@ -48,17 +48,6 @@
</div> </div>
</ng-container> </ng-container>
</div> </div>
<ng-container>
<div *ngIf="size === 'large'">
<span class="h6"
><ng-container *ngTemplateOutlet="label"></ng-container
></span>
<span *ngIf="subLabel" class="text-muted"> {{ subLabel }}</span>
</div>
<small *ngIf="size !== 'large'">
<ng-container *ngTemplateOutlet="label"></ng-container>
</small>
</ng-container>
</ng-container> </ng-container>
<ngx-skeleton-loader <ngx-skeleton-loader
@ -66,8 +55,20 @@
animation="pulse" animation="pulse"
[theme]="{ [theme]="{
height: height:
size === 'large' ? '2.5rem' : size === 'medium' ? '2rem' : '1.5rem', size === 'large' ? '2rem' : size === 'medium' ? '1.8rem' : '1.5rem',
width: '5rem' width: '5rem'
}" }"
></ngx-skeleton-loader> ></ngx-skeleton-loader>
<ng-container>
<div *ngIf="size === 'large'">
<span class="h6"
><ng-container *ngTemplateOutlet="label"></ng-container
></span>
<span *ngIf="subLabel" class="text-muted"> {{ subLabel }}</span>
</div>
<small *ngIf="size !== 'large'">
<ng-container *ngTemplateOutlet="label"></ng-container>
</small>
</ng-container>
</div> </div>

10
libs/ui/src/lib/value/value.component.ts

@ -37,6 +37,8 @@ export class ValueComponent implements OnChanges {
public constructor() {} public constructor() {}
public ngOnChanges() { public ngOnChanges() {
this.initializeVariables();
if (this.value || this.value === 0) { if (this.value || this.value === 0) {
if (isNumber(this.value)) { if (isNumber(this.value)) {
this.isNumber = true; this.isNumber = true;
@ -120,4 +122,12 @@ export class ValueComponent implements OnChanges {
this.useAbsoluteValue = true; this.useAbsoluteValue = true;
} }
} }
private initializeVariables() {
this.absoluteValue = 0;
this.formattedValue = '';
this.isNumber = false;
this.isString = false;
this.useAbsoluteValue = false;
}
} }

Loading…
Cancel
Save