import * as _angular_core from '@angular/core'; import { Type, TemplateRef, ViewContainerRef, OnInit, OnDestroy, ElementRef, ChangeDetectorRef, AfterViewInit, Signal, InputSignal, InjectionToken } from '@angular/core'; import { CdkDrag } from '@angular/cdk/drag-drop'; import * as i2 from '@angular/forms'; import { ControlValueAccessor } from '@angular/forms'; import { TabIndexDisabledControlValueAccessorMixin, ThyTranslate, ThyFormControlSize, ThyFormControlAppearance, ThyCanDisableCtor, MixinBase, ThyCanDisable } from 'ngx-tethys/core'; import * as i1 from 'ngx-tethys/util'; import { ThyBooleanInput } from 'ngx-tethys/util'; import * as i1$1 from '@angular/common'; import * as i3 from 'ngx-tethys/icon'; import * as i4 from 'ngx-tethys/tag'; import { ThyTagSize } from 'ngx-tethys/tag'; import { ThySharedLocale } from 'ngx-tethys/i18n'; import * as ngx_tethys_shared from 'ngx-tethys/shared'; import { Highlightable } from '@angular/cdk/a11y'; import { SafeAny } from 'ngx-tethys/types'; /** * 视图 Outlet 组件,取代 NgComponentOutlet 和 NgTemplateOutlet * @name thyViewOutlet * @order 10 */ declare class ThyViewOutletDirective { private viewContainerRef; private keyValueDiffers; private componentRef; private embeddedViewRef; /** * 组件或者模板 TemplateRef */ readonly thyViewOutlet: _angular_core.InputSignal | TemplateRef | null>; /** * 组件和模板上下文传递数据 */ readonly thyViewOutletContext: _angular_core.InputSignal; private keyValueDiffer?; private readonly isViewOutletChanged; constructor(); private updateContext; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * @private */ declare class ThyTranscludeDirective { viewRef: ViewContainerRef; protected _viewRef: ViewContainerRef; protected _ngTransclude: TemplateRef; readonly thyTransclude: _angular_core.InputSignal | undefined>; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * 自动聚焦指令 * @name input[thyAutofocus],textarea[thyAutofocus] */ declare class ThyAutofocusDirective { private elementRef; private ngZone; /** * 是否自动聚焦 * @default false */ readonly thyAutofocus: _angular_core.InputSignalWithTransform; /** * 是否自动选择 * @default false */ readonly thyAutoSelect: _angular_core.InputSignalWithTransform; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * 与 (keydown.enter) 区别是支持组合键,当按 Ctrl + Enter 或者 Command + Enter 也会触发 * @name thyEnter */ declare class ThyEnterDirective implements OnInit, OnDestroy { private ngZone; private elementRef; private renderer; readonly thyEnter: _angular_core.OutputEmitterRef; onKeydown: (event: KeyboardEvent) => void; private removeKeydownListenerFn; ngOnInit(): void; ngOnDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * @name thyCtrlEnter */ declare class ThyCtrlEnterDirective implements OnInit, OnDestroy { private ngZone; private elementRef; private renderer; readonly thyCtrlEnter: _angular_core.OutputEmitterRef; private removeKeydownListenerFn; onKeydown: (event: KeyboardEvent) => void; ngOnInit(): void; ngOnDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * @name thyShow */ declare class ThyShowDirective implements OnDestroy { private elementRef; private renderer; private ngZone; readonly thyShowChange: _angular_core.OutputEmitterRef; private hostRenderer; private unListenEvent; private unListenDocument; readonly thyShow: _angular_core.InputSignalWithTransform; constructor(); ngOnDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * 阻止事件冒泡 * @name thyStopPropagation */ declare class ThyStopPropagationDirective implements OnDestroy { readonly thyStopPropagation: _angular_core.InputSignal; private readonly _eventName; private readonly _shouldStopPropagation; private _changes$; private _destroy$; constructor(); ngOnDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * @name thyContextMenu */ declare class ThyContextMenuDirective implements OnInit, OnDestroy { private ngZone; private elementRef; private renderer; readonly thyContextMenu: _angular_core.OutputEmitterRef; private removeContextListenerFn; rightClick: (event: Event) => void; ngOnInit(): void; ngOnDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * @name thyScroll */ declare class ThyScrollDirective implements OnInit, OnDestroy { private elementRef; private ngZone; private _destroyed; private _subscription; private _elementScrolled; readonly thyEnable: _angular_core.InputSignalWithTransform; /** * @description * * Note: the `thyOnScrolled` emits outside of the Angular zone since the `scroll` listener * is installed within the `` zone. * * Consumers need to re-enter the Angular zone theirselves when the change detection is needeed to be run: * ```ts * @Component({ * template: '
' * }) * class ThyScrollComponent { * onScrolled(): void { * console.log(Zone.current); // * console.log(NgZone.isInAngularZone()); // false * } * } * ``` */ readonly thyOnScrolled: _angular_core.OutputEmitterRef>; constructor(); ngOnInit(): void; ngOnDestroy(): void; getElementRef(): ElementRef; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * @private */ declare class ThyDragDropDirective { readonly draggables: _angular_core.Signal[]>; private destroyRef; private ngUnsubscribe$; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * @name thyStringOrTemplateOutlet */ declare class ThyStringOrTemplateOutletDirective { private viewContainerRef; private renderer; private viewRef; private textNode; readonly thyStringOrTemplateOutletContext: _angular_core.InputSignal; readonly thyStringOrTemplateOutlet: _angular_core.InputSignal; constructor(); private updateView; private clear; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare class ThySharedModule { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵmod: _angular_core.ɵɵNgModuleDeclaration; static ɵinj: _angular_core.ɵɵInjectorDeclaration; } type ThyListLayout = 'list' | 'grid'; /** * @private */ declare class ThyFormCheckBaseComponent extends TabIndexDisabledControlValueAccessorMixin implements ControlValueAccessor { protected thyTranslate: ThyTranslate; protected changeDetectorRef?: ChangeDetectorRef | undefined; _innerValue: boolean | null; _disabled: boolean; private onTouchedCallback; private onChangeCallback; _isFormCheck: boolean; _isChecked: boolean; /** * 是否同一行展示 * @default false */ readonly thyInline: _angular_core.InputSignalWithTransform; /** * Label 展示文本 */ readonly thyLabelText: _angular_core.InputSignal; /** * Label 文本多语言 key */ readonly thyLabelTextTranslateKey: _angular_core.InputSignal; _labelText: _angular_core.Signal; _isNoText: _angular_core.Signal; disabled: boolean; /** * 是否禁用 * @default false */ set thyDisabled(value: boolean); get thyDisabled(): boolean; writeValue(obj: boolean): void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; setDisabledState(isDisabled: boolean): void; updateValue(value: boolean): void; constructor(); change(): void; markForCheck(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; static ngAcceptInputType_thyDisabled: i1.ThyBooleanInput; } declare abstract class SelectOptionBase { thyLabelText: string; thyRawValue: any; thyValue: any; thyIcon?: string; } /** * @private */ declare class ThySelectControl implements OnInit, AfterViewInit { private renderer; private cdr; private ngZone; private readonly destroyRef; inputValue: _angular_core.ModelSignal; isComposing: _angular_core.WritableSignal; searchInputControlClass: { [key: string]: boolean; }; private isFirstPanelOpenedChange; private hostRenderer; readonly thyPanelOpened: _angular_core.InputSignalWithTransform; readonly thyMultiple: _angular_core.InputSignalWithTransform; /** * @deprecated please use thyMultiple, will be removed in v23 */ readonly thyIsMultiple: _angular_core.InputSignalWithTransform; readonly isMultiple: Signal; readonly thySearchable: _angular_core.InputSignalWithTransform; /** * @deprecated please use thySearchable, will be removed in v23 */ readonly thyShowSearch: _angular_core.InputSignalWithTransform; readonly searchable: Signal; readonly thySelectedOptions: _angular_core.InputSignal; protected readonly previousSelectedOptions: _angular_core.WritableSignal; readonly thyDisabled: _angular_core.InputSignalWithTransform; readonly customDisplayTemplate: _angular_core.InputSignal | undefined>; readonly thyClearable: _angular_core.InputSignalWithTransform; /** * @deprecated please use thyClearable, will be removed in v23 */ readonly thyAllowClear: _angular_core.InputSignalWithTransform; readonly clearable: Signal; readonly thyPlaceholder: _angular_core.InputSignal; readonly thySize: _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 tagSize: Signal; readonly thyMaxTagCount: _angular_core.InputSignalWithTransform; /** * 是否隐藏选择框边框(已废弃,将在 v23 彻底删除),请使用 `thyAppearance="ghost"` * @deprecated please use thyAppearance="ghost", will be removed in v23 */ readonly thyBorderless: _angular_core.InputSignalWithTransform; readonly thyPreset: _angular_core.InputSignal; readonly thyInputChange: _angular_core.OutputEmitterRef; /** * @deprecated please use thyInputChange, will be removed in v23 */ readonly thyOnSearch: _angular_core.OutputEmitterRef; readonly thyRemove: _angular_core.OutputEmitterRef<{ item: SelectOptionBase; $eventOrigin: Event; }>; /** * @deprecated please use thyRemove, will be removed in v23 */ readonly thyOnRemove: _angular_core.OutputEmitterRef<{ item: SelectOptionBase; $eventOrigin: Event; }>; readonly thyClear: _angular_core.OutputEmitterRef; /** * @deprecated please use thyClear, will be removed in v23 */ readonly thyOnClear: _angular_core.OutputEmitterRef; readonly thyBlur: _angular_core.OutputEmitterRef; /** * @deprecated please use thyBlur, will be removed in v23 */ readonly thyOnBlur: _angular_core.OutputEmitterRef; readonly inputElement: Signal | undefined>; locale: Signal; isSelectedValue: Signal; readonly tagsContainer: Signal | undefined>; visibleTagCount: _angular_core.WritableSignal; showClearIcon: Signal; selectedTags: Signal<(SelectOptionBase | undefined)[]>; collapsedSelectedTags: Signal<(SelectOptionBase | undefined)[]>; selectedValueStyle: Signal<{ display: string; }>; placeholderStyle: Signal<{ display: string; }>; constructor(); ngOnInit(): void; ngAfterViewInit(): void; private resizeObserver; /** * 比较两个 thyValue 是否相等 * @param oldThyValue 旧的 thyValue * @param newThyValue 新的 thyValue * @returns 如果 thyValue 相等返回 true,否则返回 false */ private compareThyValue; /** * 比较两个值的 thyValue 是否相等 * @param oldValue 旧值 * @param value 新值 * @returns 如果 thyValue 相等返回 true,否则返回 false */ private compareSelectedOptions; private calculateVisibleTags; setSelectControlClass(): void; setInputValue(value: string): void; handleBackspace(event: Event): void; updateWidth(): void; removeHandle(item: SelectOptionBase, $event: Event): void; clearHandle($event: Event): void; compositionChange(isComposing: boolean): void; trackValue(_index: number, option: SelectOptionBase): any; onBlur(event: Event): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class ThySelectCommonModule { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵmod: _angular_core.ɵɵNgModuleDeclaration; static ɵinj: _angular_core.ɵɵInjectorDeclaration; } interface IThyOptionGroupComponent { hidden: boolean; } interface IThyOptionComponent { thyValue: any; disabled?: boolean; element: ElementRef; } interface IThyListOptionParentComponent { multiple?: InputSignal; layout?: InputSignal; toggleOption(option: IThyOptionComponent, event?: Event): void; setActiveOption(option: IThyOptionComponent, event?: Event): void; scrollIntoView(option: IThyOptionComponent): void; isSelected(option: IThyOptionComponent): boolean; } /** * Injection token used to provide the parent component to options. */ declare const THY_LIST_OPTION_PARENT_COMPONENT: InjectionToken; /** * @private * @order 30 */ declare class ThyListOption implements IThyOptionComponent, Highlightable { element: ElementRef; parentSelectionList: ngx_tethys_shared.IThyListOptionParentComponent; role: string; tabIndex: number; readonly isMultiple: _angular_core.Signal<{}>; readonly isListOption: _angular_core.Signal; readonly isGridOption: _angular_core.Signal; readonly id: _angular_core.InputSignal; readonly thyValue: _angular_core.InputSignal; readonly thyDisabled: _angular_core.InputSignalWithTransform; /** Whether the option is selected. */ get selected(): boolean; onClick(event: Event): void; setActiveStyles(): void; setInactiveStyles(): void; /** * Returns the list item's text label. Implemented as a part of the FocusKeyManager. * @docs-private */ getLabel(): string; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare const _MixinBase: ThyCanDisableCtor & typeof MixinBase; /** * @private */ declare class ThyOptionGroup extends _MixinBase implements ThyCanDisable { set thyDisabled(value: any); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class ThyOptionSelectionChangeEvent { option: ThyOption; isUserInput: boolean; constructor(option: ThyOption, isUserInput?: boolean); } /** * 选项组件 * @name thy-option */ declare class ThyOption { /** * 选项的值,具有唯一性 */ readonly thyValue: _angular_core.InputSignal; /** * 选项的原始值 */ readonly thyRawValue: _angular_core.InputSignal; /** * 选项的文本 */ readonly thyLabelText: _angular_core.InputSignal; /** * 是否显示自定义模板 */ readonly thyShowOptionCustom: _angular_core.InputSignal; /** * 搜索关键字 */ readonly thySearchKey: _angular_core.InputSignal; /** * 是否禁用 */ readonly thyDisabled: _angular_core.InputSignal; /** * 是否选中,会跟随 ThyOptionSelectionChangeEvent 抛出去 */ readonly selected: _angular_core.WritableSignal; /** * 选项被选中时的回调 */ readonly selectionChange: _angular_core.OutputEmitterRef; /** * 模板 */ readonly template: _angular_core.Signal | undefined>; readonly suffixTemplate: _angular_core.Signal | undefined>; private readonly optionGroupComponent; get groupLabel(): string; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } /** * 选项渲染组件 * @private * @name thy-option-render */ declare class ThyOptionRender implements Highlightable { element: ElementRef; private hostRenderer; /** * 选项的值,具有唯一性 */ readonly thyValue: _angular_core.InputSignal; /** * 选项的原始值 */ readonly thyRawValue: _angular_core.InputSignal; /** * 选项的文本 */ readonly thyLabelText: _angular_core.InputSignal; /** * 选项前缀图标名称 */ readonly thyIcon: _angular_core.InputSignal; /** * 搜索关键字 */ readonly thySearchKey: _angular_core.InputSignal; /** * 是否禁用 */ readonly thyDisabled: _angular_core.InputSignalWithTransform; /** * 是否显示自定义模板 */ readonly thyShowOptionCustom: _angular_core.InputSignalWithTransform; /** * 模板 */ readonly thyTemplate: _angular_core.InputSignal | undefined>; /** * 模板上下文 */ readonly thyTemplateContext: _angular_core.InputSignal; /** * 被选中时,是否显示勾选图标 */ readonly thyShowCheckedIcon: _angular_core.InputSignalWithTransform; /** * Select 组件选中的值 */ readonly thySelectedValuesMap: _angular_core.InputSignal>; /** * 当前高亮选项的值 */ readonly thyActivatedValue: _angular_core.InputSignal; /** * 点击选项时的回调 */ readonly optionClick: _angular_core.OutputEmitterRef<{ value: SafeAny; isUserInput?: boolean; }>; /** * 鼠标悬浮时的回调 */ readonly optionHover: _angular_core.OutputEmitterRef; /** * 是否被选中 */ readonly selected: _angular_core.Signal; /** * 是否高亮 */ readonly activated: _angular_core.Signal; readonly tabIndex: _angular_core.Signal<"0" | "-1">; constructor(); mouseEnter(): void; handleKeydown(event: KeyboardEvent): void; selectViaInteraction(): void; select(): void; deselect(): void; setActiveStyles(): void; setInactiveStyles(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class ThySelectOptionGroup { readonly thyGroupLabel: _angular_core.InputSignal; readonly thyDisabled: _angular_core.InputSignalWithTransform; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } /** * @private */ declare class ThyOptionGroupRender { readonly thyGroupLabel: _angular_core.InputSignal; readonly thyDisabled: _angular_core.InputSignalWithTransform; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class ThyOptionModule { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵmod: _angular_core.ɵɵNgModuleDeclaration; static ɵinj: _angular_core.ɵɵInjectorDeclaration; } export { SelectOptionBase, THY_LIST_OPTION_PARENT_COMPONENT, ThyAutofocusDirective, ThyContextMenuDirective, ThyCtrlEnterDirective, ThyDragDropDirective, ThyEnterDirective, ThyFormCheckBaseComponent, ThyListOption, ThyOption, ThyOptionGroup, ThyOptionGroupRender, ThyOptionModule, ThyOptionRender, ThyOptionSelectionChangeEvent, ThyScrollDirective, ThySelectCommonModule, ThySelectControl, ThySelectOptionGroup, ThySharedModule, ThyShowDirective, ThyStopPropagationDirective, ThyStringOrTemplateOutletDirective, ThyTranscludeDirective, ThyViewOutletDirective }; export type { IThyListOptionParentComponent, IThyOptionComponent, IThyOptionGroupComponent, ThyListLayout };