Browse Source

Task/widen input types on value component (#7953)

Widen input types
main
Kenrick Tandrian 3 hours ago
committed by GitHub
parent
commit
ca47dbfa40
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      libs/ui/src/lib/value/value.component.html
  2. 13
      libs/ui/src/lib/value/value.component.ts

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

@ -46,7 +46,7 @@
[class.justify-content-end]="position === 'end'"
>
@if (isNumber || value === null) {
@if (colorizeSign && !useAbsoluteValue) {
@if (colorizeSign && !useAbsoluteValue && value !== null) {
@if (+value > 0) {
<div class="mr-1 text-success">+</div>
}

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

@ -42,12 +42,12 @@ export class GfValueComponent implements AfterViewInit, OnChanges, OnDestroy {
@Input() isCurrency = false;
@Input() isDate = false;
@Input() isPercent = false;
@Input() locale: string;
@Input() locale?: string;
@Input() position = '';
@Input() size: 'large' | 'medium' | 'small' = 'small';
@Input() subLabel = '';
@Input() unit = '';
@Input() value: number | string = '';
@Input() subLabel?: string = '';
@Input() unit?: string | null = '';
@Input() value?: number | string | null = '';
@ViewChild('labelContent', { static: false })
labelContent!: ElementRef<HTMLSpanElement>;
@ -219,11 +219,14 @@ export class GfValueComponent implements AfterViewInit, OnChanges, OnDestroy {
this.isCopied = false;
this.isNumber = false;
this.isString = false;
this.locale = this.locale || getLocale();
this.useAbsoluteValue = false;
if (this.copyToClipboardTimeout) {
clearTimeout(this.copyToClipboardTimeout);
}
if (this.locale === undefined || this.locale === '') {
this.locale = getLocale();
}
}
}

Loading…
Cancel
Save