From 214e44e35f21b7529697e7a710f6321181a7cfb1 Mon Sep 17 00:00:00 2001 From: Fynn Feldpausch Date: Tue, 23 Jan 2024 12:00:10 +0100 Subject: [PATCH] feat(angular): add panelClass to dialogs --- .../projects/catalyst/src/lib/dialog/dialog.service.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/angular/projects/catalyst/src/lib/dialog/dialog.service.ts b/angular/projects/catalyst/src/lib/dialog/dialog.service.ts index ea73e8e4..405fb3bd 100644 --- a/angular/projects/catalyst/src/lib/dialog/dialog.service.ts +++ b/angular/projects/catalyst/src/lib/dialog/dialog.service.ts @@ -6,7 +6,10 @@ import { Observable } from 'rxjs'; /** * Configuration options for modal dialogs. */ -export type CatDialogConfig = Pick, 'data' | 'disableClose' | 'height' | 'role' | 'width'>; +export type CatDialogConfig = Pick< + DialogConfig, + 'data' | 'disableClose' | 'height' | 'role' | 'width' | 'panelClass' +>; /** * A service for managing modal dialogs. @@ -28,9 +31,10 @@ export class CatDialogService { component: ComponentType, config?: CatDialogConfig ): Observable { + const panelClass = config?.panelClass ?? []; return this.dialog.open(component, { backdropClass: 'cat-backdrop', - panelClass: 'cat-dialog-pane', + panelClass: ['cat-dialog-pane', ...(Array.isArray(panelClass) ? panelClass : [panelClass])], width: '600px', minWidth: 'clamp(240px, 100vw - 16px, 320px)', minHeight: 'clamp(144px, 100vh - 16px, 160px)',