import * as i0 from '@angular/core'; import { Type } from '@angular/core'; import { TWorkspaceWidth } from '@talenra/ngx-base/app-layout'; import { Observable } from 'rxjs'; /** * Backdrop to cover underlying content when a (custom) overlay is displayed. * * ```html * *
Your custom overlay content goes here
* * ``` * * ### Import * * ```typescript * import { BackdropComponent } from '@talenra/ngx-base/overlay'; * ``` * */ declare class BackdropComponent { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Renders a close button as used in Overlay Layout. * * ```html * * ``` * * ### Import * * ```typescript * import { CloseOverlayComponent } from '@talenra/ngx-base/overlay'; * ``` */ declare class CloseOverlayComponent { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * The `OverlayRef` is a reference to an overlay that has been created using the `OverlayService`. */ declare class OverlayRef { private readonly _onHide; private readonly _onReveal; private readonly _onClose; private readonly _onDestroy; private _closeCallback?; /** * Closes the overlay. * * @param result The result to be passed to the onClose observable. * * The result can be accessed in the overlay component as follows: * * ```typescript * const overlayRef = this.overlayService.open(OverlayComponent); * * overlayRef.onClose.subscribe((myString) => { * console.log('[OverlayDemo] onClose Subscription: ', myString); * }); * ``` * */ close(result?: any): void; /** * Registers a custom close callback. * * @param callback The callback to be called when the overlay is closed. * * The callback must return a promise that resolves to a boolean value. * * Can be used to show the user a confirmation dialog before closing the overlay, e.g. if the form is invalid * * If the promise resolves to true, the overlay will be closed. * If the promise resolves to false, the overlay will not be closed. * * ```typescript * overlayRef.registerCloseCallback(() => { * return new Promise((resolve, _reject) => { * resolve(true); * }) as Promise; * }); * ``` * */ registerCloseCallback(callback: () => Promise): void; /** * Removes the custom close callback * */ clearCloseCallback(): void; /** * Destroys the overlay. * * This method is called by the `OverlayService` when the overlay is destroyed and does not need be called by the consumer. */ destroy(): void; /** * Hides the overlay. * * This method is called by the `OverlayService` when the overlay is hidden behind another overlay and does not need be called by the consumer. */ hide(): void; /** * Reveals the overlay. * * This method is called by the `OverlayService` when the overlay is revealed by closing the topmost overlay and does not need be called by the consumer. */ reveal(): void; /** @internal */ onHide: Observable; /** @internal */ onReveal: Observable; /** @internal */ onClose: Observable; /** @internal */ onDestroy: Observable; } /** * The overlay layout component is a layout component that can be used to display the content of an overlay * * ```html * * * ... * * * ... * * * ... * * * ``` * * ### Import * * ```typescript * import { OverlayModule } from '@talenra/ngx-base/overlay'; * ``` * */ declare class OverlayLayoutComponent { /** * Reference to overlay component */ overlayRef?: OverlayRef; /** * The title displayed to the user */ title: string; /** * The subtitle displayed to the user */ subtitle: string; /** * A numeric counter value attached to the title (visually represented as badge/call-out). Typically a number that * represents the number of items contained in this section. * * ```html * * ``` */ counter: i0.InputSignalWithTransform; /** * The maximum value of the counter. If the counter value exceeds this limit, "+" will be displayed (e.g. * "99+"). * * ```html * * ``` */ counterMax: i0.InputSignalWithTransform; /** * Determines the maximum width of the layout. Defaults to `WorkspaceWidth.L`. * * ```html * * ``` * * @see {@link WorkspaceWidth} */ width: TWorkspaceWidth; /** * Determines whether the overlay uses a header element. * * @see {@link ContentLayoutComponent#useHeader} for more information. * * * ```html * * *
My header
*
* ``` */ useHeader: boolean; /** * Determines whether the overlay uses a sticky bar element. * * @see {@link ContentLayoutComponent#useStickyBar} for more information. * * ```html * * *
My sticky bar
*
* ``` */ useStickyBar: boolean; /** * Determines whether the overlay uses a sticky footer element. * * @see {@link ContentLayoutComponent#useStickyFooter} for more information. * * ```html * * *
My sticky footer
*
* ``` */ useStickyFooter: boolean; /** * Determines whether the content is allowed to take the full height and to cover the * header when scrolled. * * @see {@link ContentLayoutComponent#overscrollHeader} for more information. * * ```html * *
My header
*
My scrollable Content
*
* ``` */ overscrollHeader: boolean; /** @internal */ close(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Values accepted by `IConfirmationConfig`'s `level` property. `ConfirmationLevel` represents the different levels of * confirmation dialogs. * * ```typescript * private config: IConfirmationConfig = { * level: ConfirmationLevel.Info, * message: 'My Confirmation Message', * confirm: { * label: 'Button Label', * action: () => { * console.log('Confirm clicked'); * }, * }, * }; * ``` * * ### Import * * ```typescript * import { ConfigurationLevel } from '@talenra/ngx-base/overlay'; * ``` * * @see {@link ConfirmationComponent} */ declare const ConfirmationLevel: { readonly Info: "information"; readonly Warning: "warning"; readonly Error: "error"; }; /** * Type of values accepted by `ConfirmationConfig`'s `level` property. `ConfirmationLevel` represents the different * levels of confirmation dialogs. * * ### Import * * ```typescript * import { TConfirmationLevel } from '@talenra/ngx-base/overlay'; * ``` * * @see {@link ConfirmationLevel} * @see {@link ConfirmationComponent} */ type TConfirmationLevel = (typeof ConfirmationLevel)[keyof typeof ConfirmationLevel]; /** * Configuration of the buttons in the dialog. * * ### Import * * ```typescript * import { IConfirmationButtonConfig } from '@talenra/ngx-base/overlay'; * ``` * @see {@link IConfirmationConfig} * @see {@link ConfirmationComponent} */ interface IConfirmationButtonConfig { /** The label of the button. */ label: string; /** The action to be executed when the button is clicked. */ action: () => void; } /** * Configuration of the confirmation dialog. * * ```typescript * private config: IConfirmationConfig = { * level: ConfirmationLevel.Info, * message: 'My Confirmation Message', * confirm: { * label: 'Button Label', * action: () => { * console.log('Confirm clicked'); * }, * }, * }; * ``` * * ### Import * * ```typescript * import { IConfirmationConfig } from '@talenra/ngx-base/overlay'; * ``` * * @see {@link ConfirmationComponent} */ interface IConfirmationConfig { /** The name of the icon to be displayed in the dialog. */ level: TConfirmationLevel; /** The main text to be displayed in the dialog. */ message?: string; /** The additional information to be displayed in the dialog. */ additionalInformation?: string; /** Whether additional information's visibility can be toggled. */ isAdditionalInformationCollapsible?: boolean; /** Whether a CopyContent button is shown. */ isContentCopyable?: boolean; /** The configuration for the confirm button. */ confirm: IConfirmationButtonConfig; /** The configuration for the additional action button. */ additionalConfirm?: IConfirmationButtonConfig; /** The configuration for the cancel button. */ cancel?: IConfirmationButtonConfig; /** The configuration for the additional cancel button. */ additionalCancel?: IConfirmationButtonConfig; } /** * Component representing a confirmation dialog. * * ### Import * * ```typescript * import { ConfirmationComponent } from '@talenra/ngx-base/overlay'; * ``` */ declare class ConfirmationComponent { private overlayRef; private overlayConfig; /** @internal */ dialogConfig: i0.WritableSignal; protected additionalInformationExpanded: i0.WritableSignal; protected additionalInformationTruncated: i0.Signal; /** @internal */ constructor(); /** Additional information: Toggle expanded state */ protected toggleExpanded(): void; protected close(): void; protected handle(buttonConfig: IConfirmationButtonConfig): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Configuration for the overlay service. * @see {@link OverlayService#open} for more information. */ declare class OverlayConfig { /** * Prevents the overlay to be closed by hitting the 'Escape' key. * @default false (not set) * * If set to true, the overlay will not be closed by hitting the 'Escape' key but only by calling the close() method on the overlayRef. */ preventCloseOnEscape?: boolean; /** * Additional data to be passed to the overlay component. * * ```typescript * const overlayRef = this.overlayService.open(OverlayComponent, { * data: { * title: 'Overlay Demo Title', * subTitle: 'Overlay Demo Subtitle', * }, * }); * ``` * * The data can be accessed in the overlay component as follows: * * ```typescript * export class OverlayComponent { * constructor(private overlayRef: OverlayRef, config: OverlayConfig) { * console.log(config.data.title); // 'Overlay Demo Title' * console.log(config.data.subTitle); // 'Overlay Demo Subtitle' * } * } * ``` */ data?: T; } /** * The `OverlayService` is a service that provides an overlay for displaying content on top of other content. * * ```typescript * displayOverlay() { * this.overlayRef = this.overlayService.open(CustomOverlayComponent, { * data: { * title: 'title', * }, * }); * this.overlayRef.onClose.subscribe((myString) => { * console.log('[OverlayDemo] onClose Subscription: ', myString); * }); * } * ``` * * ### Import * * ```typescript * import { OverlayModule } from '@talenra/ngx-base/overlay'; * ``` * */ declare class OverlayService { private overlayComponentRefMap; private overlayStack; private talenraOverlayContainer; private renderer; private appRef; private injector; private domHandler; private zone; /** @internal */ constructor(); /** * Opens an overlay with a given component type and configuration. * * @param componentType The type of the component to load into the overlay. * @param config The configuration for the overlay (can be null). * @returns A reference to the newly-opened overlay. * * ```typescript * const overlayRef = this.overlayService.open(CustomComponentForOverlayComponent, { * data: { * title: 'Overlay Demo Title', * subTitle: 'Overlay Demo Subtitle', * }, * }); * ``` */ open(componentType: Type, config?: OverlayConfig): OverlayRef; private appendDialogComponentToAppFrame; private removeDialogComponentFromAppFrame; private revealTopOverlay; /** * Handles DOM manipulations required by other components (currently AppFrame only). Setting classes/attributes * directly has the advantage that consuming components don't need to import the OverlayService (they might not * even make use of overlays). */ private updateDom; private closePotentiallyOpenElementsOnTheCdkOverlayLayer; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { BackdropComponent, CloseOverlayComponent, ConfirmationComponent, ConfirmationLevel, OverlayConfig, OverlayLayoutComponent, OverlayRef, OverlayService }; export type { IConfirmationButtonConfig, IConfirmationConfig, TConfirmationLevel };