import { ThyAbstractOverlayConfig, ThyPlacement, ThyAbstractOverlayContainer, ThyPortalOutlet, ThyAbstractInternalOverlayRef, ThyAbstractOverlayRef, ThyAbstractOverlayOptions, ThyAbstractOverlayService, ComponentTypeOrTemplateRef, ThyOverlayDirectiveBase, ThyOverlayTrigger } from 'ngx-tethys/core'; import * as i2 from '@angular/cdk/overlay'; import { ScrollStrategy, Overlay, OverlayRef, OverlayConfig } from '@angular/cdk/overlay'; import * as _angular_core from '@angular/core'; import { InjectionToken, ElementRef, EnvironmentProviders, AfterViewInit, OnDestroy, EventEmitter, StaticProvider, OnInit, TemplateRef } from '@angular/core'; import { Observable } from 'rxjs'; import { AnimationEvent, AnimationTriggerMetadata } from '@angular/animations'; import { SafeAny } from 'ngx-tethys/types'; import * as i1$1 from '@angular/common'; import * as i3 from '@angular/cdk/portal'; import { ComponentType } from '@angular/cdk/portal'; import * as i4 from 'ngx-tethys/icon'; import * as i1 from 'ngx-tethys/util'; /** * @public * @order 20 */ declare class ThyPopoverConfig extends ThyAbstractOverlayConfig { /** * 弹出悬浮层位置计算的 Origin Element,Connected Element * @description.en-us Origin Element, for overlay flexible connected to */ origin: ElementRef | HTMLElement; /** * 源点位置 * @description.en-us Origin point, default use origin's boundingClientRect */ originPosition?: { x: number; y: number; } & { width?: number; height?: number; }; /** * 相对于源点的位置,可选值:topCenter, topLeft, topRight, bottomCenter, bottomLeft, bottomRight ... * @description.en-us Placement be relative to origin, topCenter, topLeft, topRight, bottomCenter, bottomLeft, bottomRight ... */ placement?: ThyPlacement; /** * 点击popover内部是否自动关闭弹出框 * @description.en-us Click inside can been close */ insideClosable?: boolean; /** * 相对于源点的偏移量 * @description.en-us Offset be relative to origin, default is 0 * @default 0 */ offset?: number; /** * 是否只能手动关闭,唯一标识为origin * @description.en-us Manually close it, default rules is which auto close last popover when open a new unless set manualClosure as true */ manualClosure?: boolean; /** * 对弹出悬浮层位置计算的 Origin Element,Connected Element 添加 class * @description.en-us Origin active class when popover is opened * @default thy-popover-origin-active */ originActiveClass?: string | string[]; /** * 滚动策略 */ scrollStrategy?: ScrollStrategy; /** * 点击popover外部是否自动关闭弹出框,hasBackdrop=false 时该参数起作用 * @description.en-us Click outside can been close */ outsideClosable?: boolean; /** * 是否开启自动适配大小模式,开启后当弹出框内容宽高发生变化后自动更新位置 * @description.en-us autoAdaptive is true when height change can auto update position */ autoAdaptive?: boolean; /** * 是否禁用动画 * @default false */ animationDisabled?: boolean; } declare const THY_POPOVER_DEFAULT_CONFIG: InjectionToken>; declare const THY_POPOVER_DEFAULT_CONFIG_VALUE: { hasBackdrop: boolean; backdropClass: string; panelClass: string; offset: number; backdropClosable: boolean; closeOnNavigation: boolean; placement: ThyPlacement; insideClosable: boolean; manualClosure: boolean; originActiveClass: string; autoAdaptive: boolean; minWidth: string; }; declare const THY_POPOVER_DEFAULT_CONFIG_PROVIDER: { provide: InjectionToken>; useValue: { hasBackdrop: boolean; backdropClass: string; panelClass: string; offset: number; backdropClosable: boolean; closeOnNavigation: boolean; placement: ThyPlacement; insideClosable: boolean; manualClosure: boolean; originActiveClass: string; autoAdaptive: boolean; minWidth: string; }; }; declare const THY_POPOVER_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>; declare const THY_POPOVER_SCROLL_STRATEGY_FACTORY: (overlay: Overlay) => () => ScrollStrategy; declare const THY_POPOVER_SCROLL_STRATEGY_PROVIDER: { provide: InjectionToken<() => ScrollStrategy>; deps: (typeof Overlay)[]; useFactory: (overlay: Overlay) => () => ScrollStrategy; }; declare function withPopoverConfig(config?: Partial): EnvironmentProviders; /** * @internal */ declare class ThyPopoverContainer extends ThyAbstractOverlayContainer implements AfterViewInit, OnDestroy { private elementRef; config: ThyPopoverConfig; private thyClickDispatcher; private contentObserver; private ngZone; private injector; portalOutlet: ThyPortalOutlet; /** State of the popover animation. */ animationState: 'void' | 'enter' | 'exit'; /** Emits when an animation state changes. */ animationStateChanged: EventEmitter; animationOpeningDone: Observable; animationClosingDone: Observable; insideClicked: EventEmitter; updatePosition: EventEmitter; outsideClicked: EventEmitter; beforeAttachPortal(): void; constructor(); ngAfterViewInit(): void; /** Callback, invoked whenever an animation on the host completes. */ onAnimationDone(event: AnimationEvent): void; /** Callback, invoked when an animation on the host starts. */ onAnimationStart(event: AnimationEvent): void; startExitAnimation(): void; onInsideClick(): void; ngOnDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵcmp: _angular_core.ɵɵComponentDeclaration, "thy-popover-container", never, {}, {}, never, never, true, never>; } declare abstract class ThyPopoverRef extends ThyAbstractOverlayRef, TResult> { } declare class ThyInternalPopoverRef extends ThyAbstractInternalOverlayRef implements ThyPopoverRef { protected get options(): ThyAbstractOverlayOptions; constructor(); initialize(overlayRef: OverlayRef, containerInstance: ThyPopoverContainer, config: ThyPopoverConfig): void; /** * Updates the popover's position. * @param position New popover position. */ updatePosition(): this; } /** * @public * @order 10 */ declare class ThyPopover extends ThyAbstractOverlayService implements OnDestroy { private ngZone; private _viewportRuler; private _document; private _platform; private _overlayContainer; private globalConfig; private readonly ngUnsubscribe$; private originInstancesMap; private buildPositionStrategy; private buildScrollStrategy; protected buildOverlayConfig(config: ThyPopoverConfig): OverlayConfig; protected attachOverlayContainer(overlay: OverlayRef, config: ThyPopoverConfig): ThyPopoverContainer; protected createAbstractOverlayRef(overlayRef: OverlayRef, containerInstance: ThyPopoverContainer, config: ThyPopoverConfig): ThyAbstractOverlayRef; protected createInjectorProviders(popoverRef: ThyPopoverRef, popoverContainer: ThyPopoverContainer): StaticProvider[]; private originElementAddActiveClass; private originElementRemoveActiveClass; constructor(); private ensureCloseClosest; /** * 打开悬浮层 */ open(componentOrTemplateRef: ComponentTypeOrTemplateRef, config?: ThyPopoverConfig): ThyPopoverRef | undefined; /** * 根据Id获取打开的悬浮层 */ getPopoverById(id: string): ThyPopoverRef | undefined; /** * 获取已经打开的悬浮层 */ getOpenedPopovers(): ThyPopoverRef[]; /** * @description.en-us Finds the closest ThyPopoverRef to an element by looking at the DOM. * @description 通过 Dom 元素查找最近弹出的悬浮层 */ getClosestPopover(element: HTMLElement): ThyPopoverRef | undefined | null; /** * 关闭悬浮层 */ close(result?: T, force?: boolean): void; /** * @internal */ ngOnDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵprov: _angular_core.ɵɵInjectableDeclaration; } /** * 弹出悬浮层指令 * @name thyPopover * @order 50 */ declare class ThyPopoverDirective extends ThyOverlayDirectiveBase implements OnInit, OnDestroy { elementRef: ElementRef; private popover; private viewContainerRef; private cdr; popoverOpened: boolean; /** * 悬浮组件或者模板 */ readonly content: _angular_core.InputSignal | ComponentType | undefined>; /** * 弹出悬浮层的触发方式 */ readonly thyTrigger: _angular_core.InputSignal; /** * 弹出悬浮层的位置 * @type top | topLeft | topRight | bottom | bottomLeft | bottomRight | left | leftTop | leftBottom | right | rightTop | rightBottom */ readonly thyPlacement: _angular_core.InputSignal; /** * 弹出悬浮层的偏移量 */ readonly thyOffset: _angular_core.InputSignalWithTransform; /** * 弹出悬浮层的配置 */ readonly thyConfig: _angular_core.InputSignal | undefined>; /** * 显示延迟时间 */ readonly thyShowDelay: _angular_core.InputSignalWithTransform; /** * 隐藏延迟时间 */ readonly thyHideDelay: _angular_core.InputSignalWithTransform; /** * 自动适配内容变化重新计算位置 */ readonly thyAutoAdaptive: _angular_core.InputSignalWithTransform; /** * 是否禁用打开悬浮层 * @default false */ set thyDisabled(value: boolean); private popoverRef?; constructor(); ngOnInit(): void; createOverlay(): OverlayRef; show(delay?: number): void; hide(delay?: number): void; ngOnDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; static ngAcceptInputType_thyDisabled: i1.ThyBooleanInput; } /** * 悬浮层头部组件 * @name thy-popover-header * @order 30 */ declare class ThyPopoverHeader { private translate; private thyPopover; /** * 头部标题 */ readonly thyTitle: _angular_core.InputSignal; /** * 标题的多语言 Key */ readonly thyTitleTranslationKey: _angular_core.InputSignal; protected readonly titleSignal: _angular_core.Signal; /** * 自定义头部模板 * @type TemplateRef */ headerTemplate: _angular_core.Signal | undefined>; /** * @internal */ readonly thyClosed: _angular_core.OutputEmitterRef; /** * @internal */ close(event: Event): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } /** * 悬浮层内容组件 * @name thy-popover-body * @order 40 */ declare class ThyPopoverBody { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class ThyPopoverModule { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵmod: _angular_core.ɵɵNgModuleDeclaration; static ɵinj: _angular_core.ɵɵInjectorDeclaration; } /** * Animations used by ThyPopover. * @docs-private */ declare const thyPopoverAnimations: { readonly popoverContainer: AnimationTriggerMetadata; }; export { THY_POPOVER_DEFAULT_CONFIG, THY_POPOVER_DEFAULT_CONFIG_PROVIDER, THY_POPOVER_DEFAULT_CONFIG_VALUE, THY_POPOVER_SCROLL_STRATEGY, THY_POPOVER_SCROLL_STRATEGY_FACTORY, THY_POPOVER_SCROLL_STRATEGY_PROVIDER, ThyInternalPopoverRef, ThyPopover, ThyPopoverBody, ThyPopoverConfig, ThyPopoverContainer, ThyPopoverDirective, ThyPopoverHeader, ThyPopoverModule, ThyPopoverRef, thyPopoverAnimations, withPopoverConfig };