From 4028ddc545f58b150a6c30e32539d85e27f59e98 Mon Sep 17 00:00:00 2001 From: Taneli Tuomola Date: Mon, 25 Mar 2024 08:05:21 +0200 Subject: [PATCH 1/2] fix #15144 DynamicDialog get closeAriaLabel --- src/app/components/dynamicdialog/dynamicdialog.ts | 4 ++++ src/app/showcase/doc/dynamicdialog/exampledoc.ts | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/components/dynamicdialog/dynamicdialog.ts b/src/app/components/dynamicdialog/dynamicdialog.ts index 638b447da46..8139f9589bc 100755 --- a/src/app/components/dynamicdialog/dynamicdialog.ts +++ b/src/app/components/dynamicdialog/dynamicdialog.ts @@ -199,6 +199,10 @@ export class DynamicDialogComponent implements AfterViewInit, OnDestroy { return this.config.position!; } + get closeAriaLabel(): string { + return this.config.closeAriaLabel!; + } + set style(value: any) { if (value) { this._style = { ...value }; diff --git a/src/app/showcase/doc/dynamicdialog/exampledoc.ts b/src/app/showcase/doc/dynamicdialog/exampledoc.ts index dde25566de9..83c2d801a11 100644 --- a/src/app/showcase/doc/dynamicdialog/exampledoc.ts +++ b/src/app/showcase/doc/dynamicdialog/exampledoc.ts @@ -32,6 +32,7 @@ export class ExampleDoc implements OnDestroy { header: 'Select a Product', width: '50vw', contentStyle: { overflow: 'auto' }, + closeAriaLabel: "Close", breakpoints: { '960px': '75vw', '640px': '90vw' @@ -87,7 +88,7 @@ import { Footer } from './footer'; providers: [DialogService, MessageService] }) export class DynamicDialogExampleDemo implements OnDestroy { - + constructor(public dialogService: DialogService, public messageService: MessageService) {} ref: DynamicDialogRef | undefined; @@ -97,6 +98,7 @@ export class DynamicDialogExampleDemo implements OnDestroy { header: 'Select a Product', width: '50vw', contentStyle: { overflow: 'auto' }, + closeAriaLabel: "Close", breakpoints: { '960px': '75vw', '640px': '90vw' From c47985987eeae13551a6176ba17f6390fcad14b7 Mon Sep 17 00:00:00 2001 From: Taneli Tuomola Date: Tue, 2 Apr 2024 08:38:13 +0300 Subject: [PATCH 2/2] Use 'Close' TranslationKey instead of new parameter --- src/app/components/dynamicdialog/dynamicdialog.ts | 4 ++-- src/app/showcase/doc/dynamicdialog/exampledoc.ts | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/app/components/dynamicdialog/dynamicdialog.ts b/src/app/components/dynamicdialog/dynamicdialog.ts index 8139f9589bc..2a0eda830d7 100755 --- a/src/app/components/dynamicdialog/dynamicdialog.ts +++ b/src/app/components/dynamicdialog/dynamicdialog.ts @@ -20,7 +20,7 @@ import { ViewEncapsulation, ViewRef } from '@angular/core'; -import { PrimeNGConfig, SharedModule } from 'primeng/api'; +import { PrimeNGConfig, SharedModule, TranslationKeys } from 'primeng/api'; import { DomHandler } from 'primeng/dom'; import { TimesIcon } from 'primeng/icons/times'; import { WindowMaximizeIcon } from 'primeng/icons/windowmaximize'; @@ -200,7 +200,7 @@ export class DynamicDialogComponent implements AfterViewInit, OnDestroy { } get closeAriaLabel(): string { - return this.config.closeAriaLabel!; + return this.primeNGConfig.getTranslation(TranslationKeys.ARIA)['close']; } set style(value: any) { diff --git a/src/app/showcase/doc/dynamicdialog/exampledoc.ts b/src/app/showcase/doc/dynamicdialog/exampledoc.ts index 83c2d801a11..a23c78198ae 100644 --- a/src/app/showcase/doc/dynamicdialog/exampledoc.ts +++ b/src/app/showcase/doc/dynamicdialog/exampledoc.ts @@ -32,7 +32,6 @@ export class ExampleDoc implements OnDestroy { header: 'Select a Product', width: '50vw', contentStyle: { overflow: 'auto' }, - closeAriaLabel: "Close", breakpoints: { '960px': '75vw', '640px': '90vw' @@ -98,7 +97,6 @@ export class DynamicDialogExampleDemo implements OnDestroy { header: 'Select a Product', width: '50vw', contentStyle: { overflow: 'auto' }, - closeAriaLabel: "Close", breakpoints: { '960px': '75vw', '640px': '90vw'