Files
ISA-Frontend/libs/ui/dialog/src/lib/dialog.component.ts
Lorenz Hilpert d84bc276d5 chore: update dependencies and add new path mappings
- Updated @nx/js from 20.4.6 to 20.8.1
- Updated angular-eslint from 19.1.0 to 19.2.0
- Added path mapping for @isa/common/print in tsconfig.base.json
- Added path mapping for @isa/ui/dialog in tsconfig.base.json
- Added path mapping for @isa/ui/list in tsconfig.base.json
2025-05-21 14:38:24 +02:00

31 lines
1.1 KiB
TypeScript

import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
import { DialogContentDirective } from './dialog-content.directive';
import { DIALOG_CONTENT, DIALOG_TITLE } from './tokens';
import { ComponentType } from '@angular/cdk/portal';
import { NgComponentOutlet } from '@angular/common';
/**
* Base dialog component that serves as a container for dialog content
* Handles the outer dialog shell including title and content projection
*
* @template D Type of data passed to the dialog
* @template R Type of result returned from the dialog
* @template C Type of content component displayed in the dialog
*/
@Component({
selector: 'ui-dialog',
templateUrl: './dialog.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [NgComponentOutlet],
host: {
'[class]': '["ui-dialog"]',
},
})
export class DialogComponent<D, R, C extends DialogContentDirective<D, R>> {
/** The title to display at the top of the dialog */
title = inject(DIALOG_TITLE);
/** The component type to instantiate as the dialog content */
readonly component = inject(DIALOG_CONTENT) as ComponentType<C>;
}