import * as _angular_core from '@angular/core'; import { Signal, TemplateRef, ElementRef, OnInit, OnDestroy, InjectionToken, AfterViewInit, EventEmitter, StaticProvider } from '@angular/core'; import * as i1 from '@angular/common'; import * as i2 from '@angular/forms'; import * as i3 from 'ngx-tethys/input'; import * as i4 from '@angular/cdk/overlay'; import { OverlayRef, ScrollStrategy, OverlayConfig, ComponentType } from '@angular/cdk/overlay'; import * as i5 from '@angular/cdk/portal'; import * as i6 from 'ngx-tethys/loading'; import * as i7 from 'ngx-tethys/shared'; import { ThyOptionRender, ThyOption, ThyOptionSelectionChangeEvent } from 'ngx-tethys/shared'; import * as i8 from 'ngx-tethys/icon'; import * as i9 from 'ngx-tethys/empty'; import { ThyPlacement, ThyFormControlAppearance, ThyAbstractOverlayConfig, ThyAbstractOverlayContainer, ThyPortalOutlet, ThyAbstractInternalOverlayRef, ThyAbstractOverlayRef, ThyAbstractOverlayOptions, ThyAbstractOverlayService } from 'ngx-tethys/core'; import { ActiveDescendantKeyManager } from '@angular/cdk/a11y'; import { SafeAny } from 'ngx-tethys/types'; import { Observable } from 'rxjs'; import { AnimationEvent, AnimationTriggerMetadata } from '@angular/animations'; /** Event object that is emitted when an autocomplete option is activated. */ interface ThyAutocompleteActivatedEvent { /** Reference to the autocomplete panel that emitted the event. */ source: ThyAutocomplete; /** Option that was selected. */ option: ThyOption | null; } /** * 自动完成组件 * @name thy-autocomplete */ declare class ThyAutocomplete { private changeDetectorRef; private destroyRef; private locale; emptyIcon: Signal; dropDownClass: { [key: string]: boolean; }; isOpened: boolean; readonly selectedValues: _angular_core.WritableSignal; readonly selectedValuesMap: Signal>; /** Manages active item in option list based on key events. */ keyManager?: ActiveDescendantKeyManager; readonly contentTemplateRef: Signal | undefined>; readonly optionsContainer: Signal | undefined>; /** * @private */ readonly options: Signal; readonly optionRenders: Signal; /** * 空选项时的文本 * @default 没有任何数据 */ readonly thyEmptyText: _angular_core.InputSignal; /** * 是否默认高亮第一个选项 */ readonly thyAutoActiveFirstOption: _angular_core.InputSignalWithTransform; /** * 被选中时调用,参数包含选中项的 value 值 */ readonly thyOptionSelected: _angular_core.OutputEmitterRef; /** * 只读,展开下拉菜单的回调 */ readonly thyOpened: _angular_core.OutputEmitterRef; /** * 只读,关闭下拉菜单的回调 */ readonly thyClosed: _angular_core.OutputEmitterRef; /** Emits whenever an option is activated using the keyboard. */ /** * 只读,option 激活状态变化时,调用此函数 */ readonly thyOptionActivated: _angular_core.OutputEmitterRef; constructor(); initKeyManager(): void; open(): void; close(): void; optionClick(event: { value: SafeAny; isUserInput?: boolean; }): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } /** * 自动完成触发指令 * @name thyAutocomplete */ declare class ThyAutocompleteTriggerDirective implements OnInit, OnDestroy { private elementRef; private ngZone; private overlay; private autocompleteService; private viewContainerRef; private document; private cdr; private injector; protected overlayRef: OverlayRef | null; private autocompleteRef; private readonly closeKeyEventStream; private closingActionsSubscription; panelOpened: boolean; /** * 下拉菜单组件实例 * @type ThyAutocomplete */ readonly thyAutocomplete: _angular_core.InputSignal; /** * 弹出框默认 offset */ readonly thyOffset: _angular_core.InputSignalWithTransform; /** * 下拉菜单的宽度,不设置默认与输入框同宽 */ readonly thyAutocompleteWidth: _angular_core.InputSignalWithTransform; /** * 下拉菜单的显示位置,'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight' | 'left' | 'leftTop' | 'leftBottom' | 'right' | 'rightTop' | 'rightBottom' */ readonly thyPlacement: _angular_core.InputSignal; /** * 是否允许聚焦时打开下拉菜单 */ readonly thyIsFocusOpen: _angular_core.InputSignalWithTransform; /** * 输入框外观。`outline`: 灰色边框、白色底,hover/focus 时蓝色边框;`fill`: 灰色底、灰色边框(同 ellipse),hover/focus 时白色底、蓝色边框,禁用同 outline;`subtle`: 无边框,hover/focus 时蓝色边框;`ghost`: 无边框,hover/focus 时也无边框 * @type outline | fill | subtle | ghost * @default outline */ readonly thyAppearance: _angular_core.InputSignalWithTransform; readonly activeOption: Signal; get panelClosingActions(): Observable; ngOnInit(): void; onFocus(): void; onKeydown(event: KeyboardEvent): void; handleInput(event: KeyboardEvent): void; openPanel(): void; closePanel(): void; createOverlay(): OverlayRef; /** * This method listens to a stream of panel closing actions and resets the * stream every time the option list changes. */ private subscribeToClosingActions; private setValueAndClose; /** Stream of clicks outside of the autocomplete panel. */ private getOutsideClickStream; private setValue; private canOpen; private resetActiveItem; private destroyPanel; ngOnDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class ThyAutocompleteConfig extends ThyAbstractOverlayConfig { /** Origin Element, for overlay flexible connected to */ origin: ElementRef | HTMLElement; /** Placement be relative to origin, topCenter, topLeft, topRight, bottomCenter, bottomLeft, bottomRight ...*/ placement?: ThyPlacement; /** Click inside can been close */ insideClosable?: boolean; /** Offset be relative to origin, default is 4*/ offset?: number; /** Manually close it, default rules is which auto close last autocomplete when open a new unless set manualClosure as true */ manualClosure?: boolean; /** Origin active class when autocomplete is opened */ originActiveClass?: string | string[]; /** * 滚动策略 */ scrollStrategy?: ScrollStrategy; /** Click outside can been close */ outsideClosable?: boolean; } declare const THY_AUTOCOMPLETE_DEFAULT_CONFIG: InjectionToken>; declare const THY_AUTOCOMPLETE_DEFAULT_CONFIG_PROVIDER: { provide: InjectionToken>; useValue: { hasBackdrop: boolean; panelClass: string; closeOnNavigation: boolean; insideClosable: boolean; manualClosure: boolean; outsideClosable: boolean; originActiveClass: string; }; }; /** * @private */ declare class ThyAutocompleteContainer extends ThyAbstractOverlayContainer implements AfterViewInit { private elementRef; private document; config: ThyAutocompleteConfig; private thyClickDispatcher; private ngZone; portalOutlet: ThyPortalOutlet; /** State of the autocomplete animation. */ animationState: 'void' | 'enter' | 'exit'; /** Emits when an animation state changes. */ animationStateChanged: EventEmitter; animationOpeningDone: Observable; animationClosingDone: Observable; 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; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class ThyAutocompleteModule { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵmod: _angular_core.ɵɵNgModuleDeclaration; static ɵinj: _angular_core.ɵɵInjectorDeclaration; } declare abstract class ThyAutocompleteRef extends ThyAbstractOverlayRef { } declare class ThyInternalAutocompleteRef extends ThyAbstractInternalOverlayRef implements ThyAutocompleteRef { constructor(); protected get options(): ThyAbstractOverlayOptions; /** * Updates the autocomplete's position. * @param position New autocomplete position. */ updatePosition(): this; } /** * @private */ declare class ThyAutocompleteService extends ThyAbstractOverlayService implements OnDestroy { private scrollDispatcher; private ngZone; private _viewportRuler; private _document; private _platform; private _overlayContainer; private globalConfig; private readonly ngUnsubscribe$; private originInstancesMap; private buildPositionStrategy; protected buildOverlayConfig(config: ThyAutocompleteConfig): OverlayConfig; protected attachOverlayContainer(overlay: OverlayRef, config: ThyAutocompleteConfig): ThyAutocompleteContainer; protected createAbstractOverlayRef(overlayRef: OverlayRef, containerInstance: ThyAutocompleteContainer, config: ThyAutocompleteConfig): ThyInternalAutocompleteRef; protected createInjectorProviders(autocompleteRef: ThyAutocompleteRef, autocompleteContainer: ThyAutocompleteContainer): StaticProvider[]; private originElementAddActiveClass; private originElementRemoveActiveClass; constructor(); open(componentOrTemplateRef: ComponentType | TemplateRef, config?: ThyAutocompleteConfig): ThyAutocompleteRef; ngOnDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵprov: _angular_core.ɵɵInjectableDeclaration; } /** * Animations used by ThyAutocomplete. * @docs-private */ declare const thyAutocompleteAnimations: { readonly autocompleteContainer: AnimationTriggerMetadata; }; export { THY_AUTOCOMPLETE_DEFAULT_CONFIG, THY_AUTOCOMPLETE_DEFAULT_CONFIG_PROVIDER, ThyAutocomplete, ThyAutocompleteConfig, ThyAutocompleteContainer, ThyAutocompleteModule, ThyAutocompleteService, ThyAutocompleteTriggerDirective, thyAutocompleteAnimations }; export type { ThyAutocompleteActivatedEvent };