import * as _angular_core from '@angular/core'; import { OnInit, ElementRef, InjectionToken, AfterViewInit, OnDestroy, Signal, WritableSignal, TemplateRef, QueryList } from '@angular/core'; import * as i1$1 from '@angular/common'; import * as i2 from '@angular/forms'; import { ControlValueAccessor } from '@angular/forms'; import * as i3 from 'ngx-tethys/input'; import * as i4 from '@angular/cdk/overlay'; import { ScrollStrategy, Overlay, ConnectionPositionPair, CdkConnectedOverlay } from '@angular/cdk/overlay'; import * as i5 from 'ngx-tethys/loading'; import * as i6 from 'ngx-tethys/shared'; import { ThyOption, SelectOptionBase, ThyOptionRender } from 'ngx-tethys/shared'; import * as i7 from 'ngx-tethys/icon'; import * as i8 from 'ngx-tethys/empty'; import { TabIndexDisabledControlValueAccessorMixin, ThyFormControlSize, ThyFormControlAppearance, ThyPlacement, ThyGlobalConfig } from 'ngx-tethys/core'; import * as i1 from 'ngx-tethys/util'; import { FunctionProp } from 'ngx-tethys/util'; import { Observable } from 'rxjs'; import { SafeAny } from 'ngx-tethys/types'; import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling'; /** * 下拉选择 * @name thy-native-select * @order 20 */ declare class ThyNativeSelect extends TabIndexDisabledControlValueAccessorMixin implements ControlValueAccessor, OnInit { readonly selectElement: _angular_core.Signal>; readonly innerValue: _angular_core.ModelSignal; readonly disabled: _angular_core.WritableSignal; private hostRenderer; 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 name: _angular_core.InputSignal; readonly thyClearable: _angular_core.InputSignalWithTransform; /** * @deprecated please use thyClearable, will be removed in v23 */ readonly thyAllowClear: _angular_core.InputSignalWithTransform; readonly clearable: _angular_core.Signal; writeValue(obj: any): void; setDisabledState?(isDisabled: boolean): void; constructor(); ngModelChange(): void; ngOnInit(): void; onBlur(event: FocusEvent): void; onFocus(event?: Event): void; clearSelectValue(event: Event): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare const THY_SELECT_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>; declare const THY_SELECT_SCROLL_STRATEGY_FACTORY: (overlay: Overlay) => () => ScrollStrategy; declare const THY_SELECT_SCROLL_STRATEGY_PROVIDER: { provide: InjectionToken<() => ScrollStrategy>; deps: (typeof Overlay)[]; useFactory: (overlay: Overlay) => () => ScrollStrategy; }; type ThyDropdownWidthMode = 'match-select' | 'min-width' | { minWidth: number; }; /** * 打开select下拉菜单的配置 * @public * @order 30 */ interface ThySelectConfig { /** * 下拉菜单的最小宽度 */ dropdownWidthMode?: ThyDropdownWidthMode; /** * 下拉菜单的弹出位置 */ placement?: ThyPlacement; } declare const DEFAULT_SELECT_CONFIG: ThySelectConfig; declare const THY_SELECT_CONFIG: InjectionToken; declare const THY_SELECT_CONFIG_PROVIDER: { provide: InjectionToken; useValue: ThySelectConfig; }; /** * 下拉选择模式(已废弃,将在 v23 彻底删除),请使用 `thyMultiple`(`boolean`)代替 `'multiple' | ''` * @deprecated please use thyMultiple, will be removed in v23 */ type SelectMode = 'multiple' | ''; interface ThySelectOptionModel { value?: string | number; disabled?: boolean; label?: string; icon?: string; groupLabel?: string; } interface ThySelectFlattedItem { type: 'option' | 'group'; value?: string | number; rawValue?: any; label?: string; icon?: string; showOptionCustom?: boolean; template?: TemplateRef; disabled?: boolean; searchKey?: string; groupLabel?: string; } /** * 下拉选择组件 * @name thy-select,thy-custom-select * @order 10 */ declare class ThySelect extends TabIndexDisabledControlValueAccessorMixin implements ControlValueAccessor, OnInit, AfterViewInit, OnDestroy { private ngZone; private elementRef; private changeDetectorRef; private overlay; private thyClickDispatcher; private platformId; private locale; scrollStrategyFactory: FunctionProp; selectConfig: ThySelectConfig | null; globalConfig: ThyGlobalConfig | null; emptyIcon: Signal; disabled: boolean; scrollTop: number; defaultOffset: number; readonly dropDownClass: Signal<{ [key: string]: boolean; }>; readonly dropDownMinWidth: Signal; /** * 设置下拉框的最小宽度,默认值 `match-select`,表示与输入框的宽度一致;`min-width` 表示最小宽度为200px;支持自定义最小宽度,比如传 `{minWidth: 150}` 表示最小宽度为150px * @default match-select */ readonly thyDropdownWidthMode: _angular_core.InputSignal; readonly placement: Signal; readonly flexiblePosition: Signal; readonly animateEnterClass: Signal; readonly animateLeaveClass: Signal; readonly dropDownPositions: Signal; /** * 选项高度,当 thyVirtualScroll 为 true 时,选项高度会根据此值计算,默认值为 40 * @type number * @default 40 */ thyItemSize: _angular_core.InputSignalWithTransform; readonly virtualHeight: Signal; /** * 出现滚动条时,视觉上能看到的最大选项个数 */ private maxItemLength; triggerRectWidth: WritableSignal; scrollStrategy?: ScrollStrategy; private resizeSubscription?; /** * 手动聚焦中的标识 */ private manualFocusing; private config; private destroyRef; readonly cdkConnectedOverlay: Signal; panelOpen: boolean; /** * 搜索输入变化时回调 */ readonly thyInputChange: _angular_core.OutputEmitterRef; /** * 搜索时回调(已废弃,将在 v23 彻底删除),请使用 `thyInputChange` * @deprecated please use thyInputChange, will be removed in v23 */ readonly thyOnSearch: _angular_core.OutputEmitterRef; /** * 下拉菜单滚动到底部事件,可以用这个事件实现滚动加载 */ readonly thyScrollToBottom: _angular_core.OutputEmitterRef; /** * 下拉菜单滚动到底部事件(已废弃,将在 v23 彻底删除),请使用 `thyScrollToBottom` * @deprecated please use thyScrollToBottom, will be removed in v23 */ readonly thyOnScrollToBottom: _angular_core.OutputEmitterRef; /** * 下拉菜单展开和折叠状态事件 */ readonly thyExpandStatusChange: _angular_core.OutputEmitterRef; /** * 下拉菜单展开和折叠状态事件(已废弃,将在 v23 彻底删除),请使用 `thyExpandStatusChange` * @deprecated please use thyExpandStatusChange, will be removed in v23 */ readonly thyOnExpandStatusChange: _angular_core.OutputEmitterRef; /** * 下拉列表是否显示搜索框 */ readonly thySearchable: _angular_core.InputSignalWithTransform; /** * 下拉列表是否显示搜索框(已废弃,将在 v23 彻底删除),请使用 `thySearchable` * @deprecated please use thySearchable, will be removed in v23 */ readonly thyShowSearch: _angular_core.InputSignalWithTransform; /** * 选择框默认文字 */ readonly thyPlaceholder: _angular_core.InputSignal; /** * 是否使用服务端搜索,当为 true 时,将不再在前端进行过滤 */ readonly thyServerSearchable: _angular_core.InputSignalWithTransform; /** * 是否使用服务端搜索(已废弃,将在 v23 彻底删除),请使用 `thyServerSearchable` * @deprecated please use thyServerSearchable, will be removed in v23 */ readonly thyServerSearch: _angular_core.InputSignalWithTransform; /** * 是否处于异步加载中 */ readonly thyLoading: _angular_core.InputSignalWithTransform; /** * 异步加载 loading 状态(已废弃,将在 v23 彻底删除),请使用 `thyLoading`,与 `thyLoading` 语义相反 * @deprecated please use thyLoading, will be removed in v23 */ readonly thyLoadState: _angular_core.InputSignalWithTransform; /** * 是否自动设置选项第一条为高亮状态 */ readonly thyAutoActiveFirstItem: _angular_core.InputSignalWithTransform; /** * 是否多选 */ readonly thyMultiple: _angular_core.InputSignalWithTransform; /** * 下拉选择模式(已废弃,将在 v23 彻底删除),请使用 `thyMultiple` * @deprecated please use thyMultiple, will be removed in v23 * @type 'multiple' | '' */ readonly thyMode: _angular_core.InputSignal; /** * 操作图标类型 * @type primary | success | danger | warning * @default primary */ 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 thyEmptyStateText: _angular_core.InputSignalWithTransform; /** * 搜索结果为空时显示的提示文字 */ readonly thySearchEmptyText: _angular_core.InputSignal; /** * 搜索结果为空时显示的提示文字(已废弃,将在 v23 彻底删除),请使用 `thySearchEmptyText` * @deprecated please use thySearchEmptyText, will be removed in v23 */ readonly thyEmptySearchMessageText: _angular_core.InputSignalWithTransform; /** * 滚动加载是否可用,只有为 true 时才会触发 `thyScrollToBottom` */ readonly thyEnableScrollLoad: _angular_core.InputSignalWithTransform; /** * 单选(非多选)时,选择框支持清除 */ readonly thyClearable: _angular_core.InputSignalWithTransform; /** * 单选时选择框支持清除(已废弃,将在 v23 彻底删除),请使用 `thyClearable` * @deprecated please use thyClearable, will be removed in v23 */ readonly thyAllowClear: _angular_core.InputSignalWithTransform; readonly isMultiple: Signal; readonly searchable: Signal; readonly serverSearchable: Signal; readonly clearable: Signal; readonly isLoading: Signal; readonly searchEmptyText: Signal; /** * 是否禁用 * @default false */ set thyDisabled(value: boolean); get thyDisabled(): boolean; /** * 排序比较函数 */ readonly thySortComparator: _angular_core.InputSignal<((a: ThyOption, b: ThyOption, options: ThyOption[]) => number) | undefined>; /** * Footer 模板,默认值为空不显示 Footer */ readonly thyFooterTemplate: _angular_core.InputSignal | undefined>; /** * 弹出位置 * @type ThyPlacement */ readonly thyPlacement: _angular_core.InputSignal; /** * 自定义 Overlay Origin */ readonly thyOrigin: _angular_core.InputSignal | undefined>; /** * 自定义 Footer 模板容器 class */ readonly thyFooterClass: _angular_core.InputSignal; /** * @private */ readonly selectedValueDisplayRef: Signal | undefined>; /** * 初始化时,是否展开面板 */ readonly thyAutoExpand: _angular_core.InputSignalWithTransform; /** * 是否弹出透明遮罩,如果显示遮罩则会阻止滚动区域滚动 */ readonly thyHasBackdrop: _angular_core.InputSignalWithTransform; /** * 设置多选时最大显示的标签数量,0 表示不限制,'auto' 表示自动计算显示数量,默认值为 0 */ readonly thyMaxTagCount: _angular_core.InputSignalWithTransform; /** * 是否隐藏选择框边框(已废弃,将在 v23 彻底删除),请使用 `thyAppearance="ghost"` * @deprecated please use thyAppearance="ghost", will be removed in v23 */ readonly thyBorderless: _angular_core.InputSignalWithTransform; readonly appearance: Signal; readonly panel: Signal | undefined>; /** * 是否启用虚拟滚动,默认值为 false */ readonly thyVirtualScroll: _angular_core.InputSignalWithTransform; private scrolledIndex; readonly cdkVirtualScrollViewport: Signal; private shouldActivateOption; /** * option 列表 */ readonly thyOptions: _angular_core.InputSignalWithTransform; readonly keywords: WritableSignal; /** * 目前只支持多选选中项的展示,默认为空,渲染文字模板,传入tag,渲染展示模板, * @default ''|tag */ readonly thyPreset: _angular_core.InputSignal; trigger: ElementRef; private readonly options; private readonly groups; /** * 所有分组和选项 */ private readonly allGroupsAndOptions; /** * 渲染的分组和选项,基于 keywords 过滤后 */ readonly filteredGroupsAndOptions: Signal; /** * 渲染的选项 */ private readonly filteredOptions; private readonly filteredOptionsMap; /** * 当前选中的值 */ readonly selectedValues: WritableSignal; readonly selectedValuesMap: Signal>; /** * 传给 selectControl 指令的选中值 */ readonly selectedOptions: WritableSignal; optionRenders: QueryList; keydown(event: KeyboardEvent): void; get optionsChanges$(): Observable; private buildScrollStrategy; constructor(); writeValue(value: SafeAny): void; ngOnInit(): void; ngAfterViewInit(): void; private setup; private buildAllGroupsAndOptions; private allGroupsAndOptionsByReactive; private allGroupsAndOptionsByTemplate; private buildFilteredGroupsAndOptions; private updateSelectedOptions; optionsVirtualScrolled(index: number): void; optionsScrolled(elementRef: ElementRef): void; search(keywords: string): void; onBlur(event?: FocusEvent): void; onFocus(event?: FocusEvent): void; focus(options?: FocusOptions): void; remove($event: { item: SelectOptionBase; $eventOrigin: Event; }): void; clearSelectValue(event?: Event): void; updateCdkConnectedOverlayPositions(): void; readonly empty: Signal; activatedValue: WritableSignal; toggle(event: MouseEvent): void; open(): void; close(): void; private emitModelValueChange; private scrollToActivatedOption; private handleKeydown; optionClick(event: { value: SafeAny; isUserInput: boolean; }): void; optionHover(value: SafeAny): void; mouseLeaveOptions(): void; private getOriginRectWidth; private subscribeTriggerResize; private unsubscribeTriggerResize; trackByFn(index: number, item: ThySelectFlattedItem): SafeAny; ngOnDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; static ngAcceptInputType_thyDisabled: i1.ThyBooleanInput; } declare class ThySelectModule { static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵmod: _angular_core.ɵɵNgModuleDeclaration; static ɵinj: _angular_core.ɵɵInjectorDeclaration; } export { DEFAULT_SELECT_CONFIG, THY_SELECT_CONFIG, THY_SELECT_CONFIG_PROVIDER, THY_SELECT_SCROLL_STRATEGY, THY_SELECT_SCROLL_STRATEGY_FACTORY, THY_SELECT_SCROLL_STRATEGY_PROVIDER, ThyNativeSelect, ThySelect, ThySelectModule }; export type { SelectMode, ThyDropdownWidthMode, ThySelectConfig, ThySelectOptionModel };