Skip to content

Commit

Permalink
feat(angular): add panelClass to dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
fynnfeldpausch committed Jan 23, 2024
1 parent 829cb5d commit 214e44e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions angular/projects/catalyst/src/lib/dialog/dialog.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import { Observable } from 'rxjs';
/**
* Configuration options for modal dialogs.
*/
export type CatDialogConfig<D = unknown> = Pick<DialogConfig<D>, 'data' | 'disableClose' | 'height' | 'role' | 'width'>;
export type CatDialogConfig<D = unknown> = Pick<
DialogConfig<D>,
'data' | 'disableClose' | 'height' | 'role' | 'width' | 'panelClass'
>;

/**
* A service for managing modal dialogs.
Expand All @@ -28,9 +31,10 @@ export class CatDialogService {
component: ComponentType<unknown>,
config?: CatDialogConfig<D>
): Observable<R | undefined> {
const panelClass = config?.panelClass ?? [];
return this.dialog.open<R, D>(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)',
Expand Down

0 comments on commit 214e44e

Please sign in to comment.