import * as i0 from '@angular/core'; import { InjectionToken, OnDestroy, EventEmitter, OnInit, Signal, TemplateRef, StaticProvider } from '@angular/core'; import * as i1$1 from '@angular/common'; import * as i2 from 'ngx-tethys/shared'; import * as i3 from '@angular/cdk/portal'; import { ComponentType } from '@angular/cdk/portal'; import * as i4 from '@angular/cdk/overlay'; import { ScrollStrategy, OverlayConfig, OverlayRef } from '@angular/cdk/overlay'; import * as i5 from 'ngx-tethys/button'; import * as i6 from 'ngx-tethys/icon'; import * as i7 from 'ngx-tethys/form'; import { ThyFormGroupFooterAlign } from 'ngx-tethys/form'; import * as i8 from '@angular/forms'; import * as i9 from 'ngx-tethys/action'; import { ThyAbstractOverlayConfig, ThyAbstractOverlayPosition, ThyAbstractOverlayContainer, ThyPortalOutlet, ThyAbstractOverlayRef, ThyAbstractOverlayService } from 'ngx-tethys/core'; import { Observable } from 'rxjs'; import { AnimationEvent, AnimationTriggerMetadata } from '@angular/animations'; import * as i1 from '@angular/cdk/scrolling'; import { ThyI18nService } from 'ngx-tethys/i18n'; /** Valid ARIA roles for a dialog element. */ type ThyDialogRole = 'dialog' | 'alertdialog'; interface ThyDialogHeaderIcon { name: string; color?: string; } interface ThyDialogHeaderConfig { title?: string; icon?: string | ThyDialogHeaderIcon; } declare enum ThyDialogSizes { lg = "lg", superLg = "super-lg", maxLg = "max-lg", md = "md", sm = "sm", full = "full" } /** * 通过ThyDialog服务端打开模态框的配置 * @description.en-us Configuration for opening a modal dialog with the ThyDialog service. * @public * @order 20 */ declare class ThyDialogConfig extends ThyAbstractOverlayConfig { /** * 模态框头部配置,设置后会在内容前显示默认头部 * @description.en-us Dialog header config. When set, a default header will be rendered before the dialog content. */ header?: ThyDialogHeaderConfig; /** * 对话框元素的 ARIA 角色 * @description.en-us The ARIA role of the dialog element. */ role?: ThyDialogRole; /** * 定位模态框的弹出位置 * @description.en-us Position overrides. */ position?: ThyAbstractOverlayPosition; /** * 模态框的大小,ThyDialogSizes: sm (400)、md (660)、lg (800)、maxLg (980)、superLg (94vw)、full (全屏) * @default md * @description.en-us Dialog size md, lg, sm */ size?: ThyDialogSizes; /** * 用于模态框的滚动策略 * @description.en-us Scroll strategy to be used for the dialog. */ scrollStrategy?: ScrollStrategy; } /** Injection token that can be used to specify default dialog options. */ declare const THY_DIALOG_DEFAULT_OPTIONS: InjectionToken>; declare const THY_DIALOG_DEFAULT_OPTIONS_PROVIDER: { provide: InjectionToken>; useValue: { role: string; hasBackdrop: boolean; backdropClass: string; panelClass: string; backdropClosable: boolean; closeOnNavigation: boolean; autoFocus: boolean; restoreFocus: boolean; restoreFocusOptions: { preventScroll: boolean; }; hostClass: string; }; }; type ThyDialogFooterAlign = 'left' | 'right' | 'center'; declare class ThyDialogLayoutConfig { footerAlign?: ThyDialogFooterAlign; footerDivided?: boolean; } declare const THY_DIALOG_LAYOUT_CONFIG: InjectionToken; declare const THY_DIALOG_LAYOUT_CONFIG_PROVIDER: { provide: InjectionToken; useValue: { footerAlign: string; footerDivided: boolean; }; }; /** * @private */ declare class ThyDialogContainer extends ThyAbstractOverlayContainer implements OnDestroy { private elementRef; private document; config: ThyDialogConfig; private clickPositioner; private focusTrapFactory; private ngZone; private renderer; animationOpeningDone: Observable; animationClosingDone: Observable; portalOutlet: ThyPortalOutlet; id: string; /** State of the dialog animation. */ animationState: 'void' | 'enter' | 'exit'; /** Emits when an animation state changes. */ animationStateChanged: EventEmitter; /** ID of the element that should be considered as the dialog's label. */ ariaLabelledBy: string | null; /** Element that was focused before the dialog was opened. Save this to restore upon close. */ private elementFocusedBeforeDialogWasOpened; /** The class that traps and manages focus within the dialog. */ private focusTrap; private savePreviouslyFocusedElement; /** Moves the focus inside the focus trap. */ private trapFocus; private restoreFocus; private setTransformOrigin; constructor(); beforeAttachPortal(): 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; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * 模态框头部组件 * @name thy-dialog-header * @order 40 */ declare class ThyDialogHeader implements OnInit { private elementRef; private dialog; private translate; private dialogContainer; /** * 自定义头部模板 */ readonly headerTemplate: Signal | undefined>; /** * 标题 */ readonly thyTitle: i0.InputSignal; /** * 大小,只有大的详情页场景会使用 lg,左右 padding 缩小至 20px * @type lg | md */ readonly thySize: i0.InputSignal<"md" | "lg">; /** * 是否显示分割线 */ readonly thyDivided: i0.InputSignalWithTransform; /** * 标题的多语言 Key */ readonly thyTitleTranslationKey: i0.InputSignal; readonly title: Signal; /** * 头部图标 */ readonly thyIcon: i0.InputSignal; readonly iconName: Signal; readonly iconColor: Signal; /** * 关闭事件 */ readonly thyOnClose: i0.OutputEmitterRef; ngOnInit(): void; close(event?: Event): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * 模态框的主体组件 * @name thy-dialog-body * @order 50 */ declare class ThyDialogBody { /** * 清除间距 */ readonly thyClearPadding: i0.InputSignalWithTransform; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * 模态框底部组件 * @name thy-dialog-footer * @order 60 */ declare class ThyDialogFooter implements OnInit { private dialogLayoutConfig; /** * 自定义弹出框底部的描述模板 * @type TemplateRef */ readonly description: i0.Signal | undefined>; /** * 底部是否有分割线,可全局配置默认值 * @type boolean */ readonly thyDivided: i0.InputSignalWithTransform; divided: i0.Signal; /** * 对齐方式,可全局配置默认值 * @type left | right | center */ readonly thyAlign: i0.InputSignal; readonly align: i0.Signal; private hostRenderer; constructor(); ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * 确认框配置 * @public * @order 70 */ interface ThyConfirmConfig { /** * 标题 */ title?: string; /** * 提示内容 */ content: string; /** * 确认按钮的文案 */ okText?: string; /** * 确认按钮的类型,primary | danger */ okType?: 'primary' | 'danger'; /** * 确认按钮处于提交状态时的文案 */ okLoadingText?: string; /** * 底部对齐方式,left | center | right */ footerAlign?: ThyFormGroupFooterAlign; /** * 确认后的回调事件 */ onOk?: () => Observable | void; /** * 取消按钮的文案 */ cancelText?: string; /** * 取消后的回调事件 */ onCancel?: () => void; } declare const THY_CONFIRM_DEFAULT_OPTIONS: InjectionToken; /** * @deprecated */ declare const THY_CONFIRM_DEFAULT_OPTIONS_VALUE: { title: string; okText: string; okType: string; cancelText: string; footerAlign: string; }; declare function useConfirmDefaultOptions(): { title: string; okText: string; okType: string; cancelText: string; footerAlign: string; }; declare const THY_CONFIRM_DEFAULT_OPTIONS_PROVIDER: { provide: InjectionToken; useFactory: typeof useConfirmDefaultOptions; deps: (typeof ThyI18nService)[]; }; /** * @private */ declare class ThyConfirm implements OnInit, OnDestroy { private dialogRef; private changeDetectorRef; private defaultConfig; private locale; loading: boolean; readonly options: i0.InputSignal; title: string | undefined; content: string; okText: string | undefined; okType: string | undefined; cancelText: string | undefined; okLoadingText: string | undefined; footerAlign: ThyFormGroupFooterAlign | undefined; constructor(); ngOnInit(): void; confirm(): void; close(): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ThyDialogModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } interface ThyConfirmAbstractComponent { okText: string; okType: string; cancelText: string; okLoadingText: string; } declare abstract class ThyDialogRef extends ThyAbstractOverlayRef { } /** * @public * @order 10 */ declare class ThyDialog extends ThyAbstractOverlayService implements OnDestroy { private confirmComponentType; private overlayKeyboardDispatcher; private overlayContainer; protected buildOverlayConfig(config: ThyDialogConfig): OverlayConfig; protected attachOverlayContainer(overlay: OverlayRef, config: ThyDialogConfig): ThyDialogContainer; protected createAbstractOverlayRef(overlayRef: OverlayRef, containerInstance: ThyDialogContainer, config: ThyDialogConfig): ThyAbstractOverlayRef; protected createInjectorProviders(dialogRef: ThyDialogRef, dialogContainer: ThyDialogContainer): StaticProvider[]; constructor(); /** * 打开 Dialog */ open(componentOrTemplateRef: ComponentType | TemplateRef, config?: ThyDialogConfig): ThyDialogRef; /** * 打开 Confirm */ confirm(options: ThyConfirmConfig): ThyDialogRef; /** * 根据 id 获取 Dialog */ getDialogById(id: string): ThyDialogRef | undefined; /** * 获取所有打开的 Dialog */ getOpenedDialogs(): ThyDialogRef[]; /** * @description.en-us Finds the closest ThyDialogRef to an element by looking at the DOM. * @description 获取与指定元素最接近的 ThyDialogRef */ getClosestDialog(element: HTMLElement): ThyDialogRef | undefined | null; /** * Update dialog to top */ toTop(idOrOverlayRef: string | ThyDialogRef): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Animations used by MatDialog. * @docs-private */ declare const thyDialogAnimations: { readonly dialogContainer: AnimationTriggerMetadata; }; export { THY_CONFIRM_DEFAULT_OPTIONS, THY_CONFIRM_DEFAULT_OPTIONS_PROVIDER, THY_CONFIRM_DEFAULT_OPTIONS_VALUE, THY_DIALOG_DEFAULT_OPTIONS, THY_DIALOG_DEFAULT_OPTIONS_PROVIDER, THY_DIALOG_LAYOUT_CONFIG, THY_DIALOG_LAYOUT_CONFIG_PROVIDER, ThyConfirm as ThyConfirmComponent$1, ThyDialog, ThyDialogBody, ThyDialogConfig, ThyDialogContainer, ThyDialogFooter, ThyDialogHeader, ThyDialogLayoutConfig, ThyDialogModule, ThyDialogRef, ThyDialogSizes, thyDialogAnimations }; export type { ThyConfirmConfig, ThyDialogFooterAlign, ThyDialogHeaderConfig, ThyDialogHeaderIcon, ThyDialogRole };