Files
ISA-Frontend/libs/ui/dialog/src/lib/dialog.component.ts
Lorenz Hilpert 998946157a chore: update dependencies and add vitest configuration
- Added @analogjs/vite-plugin-angular and @analogjs/vitest-angular to devDependencies.
- Updated @nx/vite to version 20.1.4.
- Added @vitest/coverage-v8 and @vitest/ui to devDependencies.
- Added jsdom to devDependencies.
- Added vite and vitest to devDependencies.
- Updated tsconfig.base.json to include new paths for shared libraries.
- Created vitest.workspace.ts for vitest configuration.

Refs: #5135
2025-06-26 22:09:21 +02:00

36 lines
1.1 KiB
TypeScript

import {
ChangeDetectionStrategy,
Component,
inject,
signal,
} 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 = signal(inject(DIALOG_TITLE));
/** The component type to instantiate as the dialog content */
readonly component = inject(DIALOG_CONTENT) as ComponentType<C>;
}