From 4d81f6da06a8dff3f00b064429ce21525fb4c92e Mon Sep 17 00:00:00 2001 From: "mikerodonnell89@gmail.com" Date: Wed, 22 Jan 2025 11:39:50 -0500 Subject: [PATCH] feat(platform): add option for configuring VHD dialog title heading level --- .../value-help-dialog.component.html | 22 ++++++++++++++----- .../value-help-dialog.component.ts | 14 +++++++++++- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/libs/platform/value-help-dialog/value-help-dialog/value-help-dialog.component.html b/libs/platform/value-help-dialog/value-help-dialog/value-help-dialog.component.html index a9a4cee23c1..2959b660112 100644 --- a/libs/platform/value-help-dialog/value-help-dialog/value-help-dialog.component.html +++ b/libs/platform/value-help-dialog/value-help-dialog/value-help-dialog.component.html @@ -28,14 +28,20 @@ class="fdp-value-help-dialog__row fdp-value-help-dialog__selection-row" [attr.aria-label]="'platformVHD.selectedAndConditionLabel' | fdTranslate" > -
+ @if (hasSelectedAndConditions) { {{ 'platformVHD.selectedAndConditionLabel' | fdTranslate }} ({{ selectedItems.length + validConditions.length }}) } @else { {{ 'platformVHD.selectedEmptyLabel' | fdTranslate }} } -
+
@@ -284,7 +290,7 @@
-
{{ dialogTitle }}
+ {{ dialogTitle }}
@if (selectedTab === type && showSelectionTab && showDefineTab) { @@ -295,7 +301,7 @@
{{ dialogTitle }}
(click)="switchTab()" [title]="'platformVHD.selectMobileTabBackBtnTitle' | fdTranslate" > -
{{ title }}
+ {{ title }} } @if (selectedTab !== type) { {{ title }}
-
{{ 'platformVHD.searchAdvancedSearchLabel' | fdTranslate }}
+ {{ + 'platformVHD.searchAdvancedSearchLabel' | fdTranslate + }}
@@ -321,7 +329,9 @@
{{ 'platformVHD.searchAdvancedSearchLabel' | fdTranslate }}
@if (hasSelectedTab) { } @else { -
{{ dialogTitle }}
+ {{ + dialogTitle + }} }
diff --git a/libs/platform/value-help-dialog/value-help-dialog/value-help-dialog.component.ts b/libs/platform/value-help-dialog/value-help-dialog/value-help-dialog.component.ts index 4f9d64ee118..82186a0ae8f 100644 --- a/libs/platform/value-help-dialog/value-help-dialog/value-help-dialog.component.ts +++ b/libs/platform/value-help-dialog/value-help-dialog/value-help-dialog.component.ts @@ -17,7 +17,8 @@ import { ViewChild, ViewEncapsulation, computed, - inject + inject, + input } from '@angular/core'; import { Observable, Subject, Subscription, filter, isObservable, of, take, tap } from 'rxjs'; @@ -49,6 +50,7 @@ import { FormControlComponent, FormLabelComponent } from '@fundamental-ngx/core/ import { LayoutGridColDirective, LayoutGridComponent, LayoutGridRowDirective } from '@fundamental-ngx/core/layout-grid'; import { ListIconDirective, ListLinkDirective, ListTitleDirective } from '@fundamental-ngx/core/list'; import { ScrollbarDirective } from '@fundamental-ngx/core/scrollbar'; +import { HeadingLevel } from '@fundamental-ngx/core/shared'; import { SkeletonComponent } from '@fundamental-ngx/core/skeleton'; import { TabItemDirective, TabLinkDirective, TabNavComponent, TabTagDirective } from '@fundamental-ngx/core/tabs'; import { TitleComponent } from '@fundamental-ngx/core/title'; @@ -293,6 +295,16 @@ export class PlatformValueHelpDialogComponent extends VhdComponent impl @ViewChild('container', { read: TemplateRef }) dialogContainer: TemplateRef; + /** + * Heading level of the dialog title. + */ + headingLevel = input(5); + + /** @hidden */ + _headingLevel = computed(() => + this.headingLevel() ? Number.parseInt(`${this.headingLevel()}`.replace(/\D/g, ''), 10) : undefined + ); + /** @hidden */ activeDialog?: DialogRef;