/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { ApplicationRef, ComponentFactoryResolver, ElementRef, InjectionToken, Injector } from '@angular/core'; import { PopupSettings } from './models/popup-settings'; import { PopupRef } from './models/popup-ref'; import * as i0 from "@angular/core"; /** * Injects the Popup container. If not set, uses the first root component of the application. * * > Use `POPUP_CONTAINER` only with the `PopupService` class ([see example](slug:service_popup)). * * In standalone components: * * @example * ```ts * import { Component } from '@angular/core'; * import { KENDO_POPUP, PopupService } from '@progress/kendo-angular-popup'; * * @Component({ * standalone: true, * imports: [KENDO_POPUP], * providers: [PopupService, { * provide: POPUP_CONTAINER, * useFactory: () => { * //return the container ElementRef, where the popup will be injected * return { nativeElement: document.body } as ElementRef; * } * }], * selector: 'app-root', * templateUrl: './app.component.html', * }) * export class AppComponent {} * ``` * * In NgModule-based applications: * * @example * ```ts * import { PopupModule, POPUP_CONTAINER } from '@progress/kendo-angular-popup'; * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; * import { ElementRef, NgModule } from '@angular/core'; * import { AppComponent } from './app.component'; * * _@NgModule({ * declarations: [AppComponent], * imports: [BrowserModule, PopupModule], * bootstrap: [AppComponent], * providers: [{ * provide: POPUP_CONTAINER, * useFactory: () => { * //return the container ElementRef, where the popup will be injected * return { nativeElement: document.body } as ElementRef; * } * }] * }) * export class AppModule {} * * platformBrowserDynamic().bootstrapModule(AppModule); * ``` */ export declare const POPUP_CONTAINER: InjectionToken>; /** * Provides a service for opening Popup components dynamically ([see example]({% slug service_popup %})). * * @export * @class PopupService */ export declare class PopupService { private applicationRef; private componentFactoryResolver; private injector; private container; /** * Gets the root view container for injecting the component. * * @returns {ComponentRef} The root view container reference. */ private get rootViewContainer(); /** * Gets the HTML element of the root component container. * * @returns {HTMLElement} The root container HTML element. */ get rootViewContainerNode(): HTMLElement; constructor(applicationRef: ApplicationRef, componentFactoryResolver: ComponentFactoryResolver, injector: Injector, container: ElementRef); /** * Opens a Popup component. The Popup mounts in the DOM under the root application component. * * @param {PopupSettings} options - The options for the Popup. * @returns {ComponentRef} A reference to the Popup object. */ open(options?: PopupSettings): PopupRef; private appendPopup; /** * Gets the HTML element for a component reference. * * @param {ComponentRef} componentRef The component reference. * @returns {HTMLElement} The root HTML element of the component. */ private getComponentRootNode; /** * Gets the `ComponentFactory` instance by type. * * @param {*} componentClass The component class. * @returns {ComponentFactory} The component factory instance. */ private getComponentFactory; /** * Creates a component reference from a `Component` class. * * @param {*} componentClass The component class. * @param {*} nodes The nodes to project. * @param {ViewContainerRef} container The container to use. * @returns {ComponentRef} The created component reference. */ private createComponent; /** * Projects the input options onto the component instance. * * @param {ComponentRef} component The component reference. * @param {*} options The options to project. * @returns {ComponentRef} The updated component reference. */ private projectComponentInputs; /** * Gets the component and nodes to append from the `content` option. * * @param {*} content The content to use. * @returns {any} The component and nodes for projection. */ private contentFrom; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }