import * as i0 from '@angular/core'; import { AfterViewInit, OnDestroy, Injector, Type, OnInit, OnChanges } from '@angular/core'; import { ConnectedOverlayOptions } from '@odx/angular/cdk/connected-overlay'; import { DynamicContent } from '@odx/angular/cdk/dynamic-view'; import * as _odx_angular_utils from '@odx/angular/utils'; import { NgChanges } from '@odx/angular/utils'; /** * Enables tooltips on disabled elements by implementing a "soft disabled" state. * * Some projects require descriptive tooltips on disabled elements. Since the `disabled` * attribute natively blocks all interaction, this directive implements a focusable * disabled state that allows tooltips to function while preventing actual operation. * Although the element regains focusable state, it remains non-operable. */ declare class TooltipDisabledFocusable implements AfterViewInit, OnDestroy { static readonly attributeName = "data-disabled-focusable"; private readonly element; ngAfterViewInit(): void; ngOnDestroy(): void; protected onClick(event: MouseEvent): void; protected onKeydown(event: Event): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } type TooltipSize = typeof TooltipSize[keyof typeof TooltipSize]; declare const TooltipSize: { readonly AUTO: "auto"; readonly SMALL: "small"; readonly MEDIUM: "medium"; readonly LARGE: "large"; }; type TooltipTrigger = 'hover' | 'click'; interface TooltipOptions extends Pick { trigger: TooltipTrigger; delayIn: number; delayOut: number; size: TooltipSize; } declare const DefaultTooltipOptions: TooltipOptions; /** * @internal * Resolves the appropriate event names for the provided tooltip trigger. * * @param {TooltipTrigger} trigger - The trigger to resolve. * @returns {[string, string | null]} - The event names for the trigger. */ declare function resolveTooltipTriggerEvents(trigger: TooltipTrigger): [string, string | null]; /** /** * TooltipComponent displays contextual information related to an element when the user hovers over * or focuses on the element. It supports dynamic content and can be styled with different sizes. * * The component uses dynamic content rendering to provide flexible display options including text, * templates, or even other Angular components, making it highly customizable. */ declare class TooltipComponent { private readonly config; protected readonly injector: Injector; readonly element: i0.ElementRef; /** * The ID attribute of the tooltip, used for accessibility purposes to link the tooltip with its owner element. * * @type {string | null} * @default null */ id: string | null; /** * The content to be displayed within the tooltip. This can be text, a template reference, or a dynamic component. * * @type {DynamicContent | null} */ content?: Exclude> | null; /** * Determines the size of the tooltip. It can adjust based on the content size or be set to specific dimensions. * The size influences the CSS class applied to the tooltip, allowing for custom styles. * * @type {TooltipSize} * @default TooltipSize.AUTO from the configuration */ size: TooltipSize; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Utility functions generated by `createConfigTokens` to handle injection and provision of `TooltipConfig`. * These include tokens and functions to access and provide the default configuration for tooltips. * * `TooltipDefaultConfig` provides the default settings for tooltips. * `TooltipConfig` is a token that can be used to inject tooltip configuration settings. * `injectTooltipConfig` is a function that retrieves the current tooltip configuration. * `provideTooltipConfig` is a function used to specify a custom configuration for tooltips. * * @example * ```ts * // In module providers: * providers: [ * provideTooltipConfig({ // ... global module configuration }), * ] * * // In a component or service: * constructor(@Inject(TooltipConfig) private readonly config: TooltipConfig) {} * * // Or using the `injectTooltipConfig` function: * @Component({ ... }) * export class MyComponent { * private readonly config = injectTooltipConfig(); * } * ``` */ declare const TooltipDefaultConfig: TooltipOptions; type TooltipConfig = TooltipOptions; declare const TooltipConfig: i0.InjectionToken>; declare const injectTooltipConfig: () => TooltipOptions; declare const provideTooltipConfig: >>(config: _odx_angular_utils.ConfigProvider, D>) => i0.FactoryProvider | i0.ValueProvider; /** * TooltipDirective manages tooltips for host elements by creating overlay components dynamically. * It provides configuration options such as content, delay timings, visibility, and tooltip sizing. * This directive uses Angular's connected overlay system to position and manage tooltip visibility. */ declare class TooltipDirective implements OnInit, OnChanges, OnDestroy { private readonly eventManager; private readonly connectedOverlayService; private readonly showTrigger$$; private readonly hideTrigger$$; private readonly document; private readonly injector; private readonly ngZone; private connectedOverlayRef; private tooltipOptions; private ignoreNextTooltipTrigger; protected tooltipId: string | null; readonly element: i0.ElementRef; /** * Input for dynamic content to display in the tooltip. * This content is reactive and can change dynamically. * * @type {DynamicContent | null} * @default null */ content?: Exclude> | null; /** * Controls whether the tooltip is disabled. A disabled tooltip will not be displayed. * * @type {boolean} * @default false */ disabled: boolean; /** * Configuration options for the tooltip. * It allows setting various behaviors like delay and positioning. * * @param {Partial | null | undefined} */ set options(value: Partial | null | undefined); /** * Sets the size of the tooltip. * * @type {TooltipSize} * @default null */ size?: TooltipSize | null; /** * Controls the visibility of the tooltip. * Useful for programmatically toggling the tooltip display. * * @type {boolean} * @default false */ visible: boolean; /** * Indicates whether the tooltip is currently open. * * @returns {boolean} */ get isOpen(): boolean; constructor(); ngOnInit(): void; ngOnChanges(changes: NgChanges): void; ngOnDestroy(): void; /** * Shows the tooltip, creating and attaching the overlay to the host element. */ show(): void; /** * Hides the tooltip, detaching the overlay from the host element. */ hide(force?: boolean): void; private registerEvents; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; static ngAcceptInputType_disabled: unknown; static ngAcceptInputType_visible: unknown; } export { DefaultTooltipOptions, TooltipComponent, TooltipConfig, TooltipDefaultConfig, TooltipDirective, TooltipDisabledFocusable, TooltipSize, injectTooltipConfig, provideTooltipConfig, resolveTooltipTriggerEvents }; export type { TooltipOptions, TooltipTrigger };