UNPKG

ng-hub-ui-portal

Version:

A flexible Angular portal library for dynamic content rendering with advanced positioning and interaction control

55 lines (54 loc) 2.39 kB
import { HubPortalOptions } from './portal-config'; import { HubPortalRef } from './portal-ref'; import * as i0 from "@angular/core"; /** * A service for opening portal windows. * * Creating a portal is straightforward: create a component or a template and pass it as an argument to * the `.open()` method. */ export declare class HubPortal { private _injector; private _portalStack; private _config; /** * Opens a new portal window with the specified content and supplied options. * * Content can be provided as a `TemplateRef` or a component type. If you pass a component type as content, * then instances of those components can be injected with an instance of the `HubActivePortal` class. You can then * use `HubActivePortal` methods to close / dismiss portals from "inside" of your component. * * Also see the [`HubPortalOptions`](#/components/portal/api#HubPortalOptions) for the list of supported options. */ open(content: any, options?: HubPortalOptions): HubPortalRef; /** * The function `toggle` opens a portal with specified content and options while dismissing any existing portals. * * @param {any} content - The `content` parameter in the `toggle` function is the content that you want to display within the * portal. This can be any type of content such as a component, template, or any other HTML element that you want to show in the * portal. * @param {HubPortalOptions} options - The `options` parameter in the `toggle` function is an object that allows you to customize * the behavior of the portal. * * @returns The `toggle` function is returning a `HubPortalRef` object. */ toggle(content: any, options?: HubPortalOptions): HubPortalRef; /** * Returns an observable that holds the active portal instances. */ get activeInstances(): import("@angular/core").EventEmitter<HubPortalRef[]>; /** * Dismisses all currently displayed portal windows with the supplied reason. * * @since 3.1.0 */ dismissAll(reason?: any): void; /** * Indicates if there are currently any open portal windows in the application. * * @since 3.3.0 */ hasOpenPortals(): boolean; static ɵfac: i0.ɵɵFactoryDeclaration<HubPortal, never>; static ɵprov: i0.ɵɵInjectableDeclaration<HubPortal>; }