From ca47dbfa40f46e037da1704e0511d0364acdfdcd Mon Sep 17 00:00:00 2001 From: Kenrick Tandrian <60643640+KenTandrian@users.noreply.github.com> Date: Mon, 28 Sep 2026 19:47:20 +0700 Subject: [PATCH] Task/widen input types on value component (#7953) Widen input types --- libs/ui/src/lib/value/value.component.html | 2 +- libs/ui/src/lib/value/value.component.ts | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/libs/ui/src/lib/value/value.component.html b/libs/ui/src/lib/value/value.component.html index 3ab711f7e6..c5ebe4e2cf 100644 --- a/libs/ui/src/lib/value/value.component.html +++ b/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) {
+
} diff --git a/libs/ui/src/lib/value/value.component.ts b/libs/ui/src/lib/value/value.component.ts index cc08e5a248..c2c7d4621d 100644 --- a/libs/ui/src/lib/value/value.component.ts +++ b/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; @@ -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(); + } } }