ngx-tethys 20.0.0 → 20.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/select/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { OnInit, ElementRef, InjectionToken, AfterViewInit, AfterContentInit, OnDestroy, Signal, TemplateRef, QueryList } from '@angular/core';
2
+ import { OnInit, ElementRef, InjectionToken, AfterViewInit, OnDestroy, Signal, WritableSignal, TemplateRef, QueryList } from '@angular/core';
3
3
  import * as i1$1 from '@angular/common';
4
4
  import * as i2 from '@angular/forms';
5
5
  import { ControlValueAccessor } from '@angular/forms';
@@ -8,15 +8,15 @@ import * as i4 from '@angular/cdk/overlay';
8
8
  import { ScrollStrategy, Overlay, ConnectionPositionPair, CdkConnectedOverlay } from '@angular/cdk/overlay';
9
9
  import * as i5 from 'ngx-tethys/loading';
10
10
  import * as i6 from 'ngx-tethys/shared';
11
- import { IThyOptionParentComponent, ThyOption, ThyOptionSelectionChangeEvent, SelectControlSize, ThySelectOptionGroup } from 'ngx-tethys/shared';
11
+ import { SelectControlSize, ThyOption, SelectOptionBase, ThyOptionRender } from 'ngx-tethys/shared';
12
12
  import * as i7 from 'ngx-tethys/icon';
13
13
  import * as i8 from 'ngx-tethys/empty';
14
14
  import { TabIndexDisabledControlValueAccessorMixin, ThyPlacement } from 'ngx-tethys/core';
15
- import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';
16
- import { SelectionModel } from '@angular/cdk/collections';
17
15
  import * as i1 from 'ngx-tethys/util';
18
16
  import { FunctionProp } from 'ngx-tethys/util';
19
17
  import { Observable } from 'rxjs';
18
+ import { SafeAny } from 'ngx-tethys/types';
19
+ import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
20
20
 
21
21
  type InputSize = 'xs' | 'sm' | 'md' | 'lg' | '';
22
22
  /**
@@ -84,15 +84,23 @@ interface ThySelectOptionModel {
84
84
  icon?: string;
85
85
  groupLabel?: string;
86
86
  }
87
- interface ThyOptionGroupModel extends ThySelectOptionModel {
88
- children?: ThySelectOptionModel[];
87
+ interface ThySelectFlattedItem {
88
+ type: 'option' | 'group';
89
+ value?: string | number;
90
+ rawValue?: any;
91
+ label?: string;
92
+ showOptionCustom?: boolean;
93
+ template?: TemplateRef<any>;
94
+ disabled?: boolean;
95
+ searchKey?: string;
96
+ groupLabel?: string;
89
97
  }
90
98
  /**
91
99
  * 下拉选择组件
92
100
  * @name thy-select,thy-custom-select
93
101
  * @order 10
94
102
  */
95
- declare class ThySelect extends TabIndexDisabledControlValueAccessorMixin implements ControlValueAccessor, IThyOptionParentComponent, OnInit, AfterViewInit, AfterContentInit, OnDestroy {
103
+ declare class ThySelect extends TabIndexDisabledControlValueAccessorMixin implements ControlValueAccessor, OnInit, AfterViewInit, OnDestroy {
96
104
  private ngZone;
97
105
  private elementRef;
98
106
  private changeDetectorRef;
@@ -106,32 +114,34 @@ declare class ThySelect extends TabIndexDisabledControlValueAccessorMixin implem
106
114
  disabled: boolean;
107
115
  mode: SelectMode;
108
116
  scrollTop: number;
109
- modalValue: any;
110
117
  defaultOffset: number;
111
- dropDownClass: {
118
+ readonly dropDownClass: Signal<{
112
119
  [key: string]: boolean;
113
- };
114
- dropDownMinWidth: number | null;
120
+ }>;
121
+ readonly dropDownMinWidth: Signal<number>;
115
122
  /**
116
123
  * 设置下拉框的最小宽度,默认值 `match-select`,表示与输入框的宽度一致;`min-width` 表示最小宽度为200px;支持自定义最小宽度,比如传 `{minWidth: 150}` 表示最小宽度为150px
117
124
  * @default match-select
118
125
  */
119
126
  readonly thyDropdownWidthMode: _angular_core.InputSignal<ThyDropdownWidthMode>;
120
- dropDownPositions: ConnectionPositionPair[];
121
- selectionModel: SelectionModel<ThyOption>;
122
- triggerRectWidth: number;
127
+ readonly placement: Signal<ThyPlacement>;
128
+ readonly dropDownPositions: Signal<ConnectionPositionPair[]>;
129
+ itemSize: number;
130
+ readonly virtualHeight: Signal<number>;
131
+ /**
132
+ * 视觉上能看到的最大选项个数
133
+ */
134
+ private maxItemLength;
135
+ triggerRectWidth: WritableSignal<number>;
123
136
  scrollStrategy: ScrollStrategy;
124
137
  private resizeSubscription;
125
- private selectionModelSubscription;
126
138
  /**
127
139
  * 手动聚焦中的标识
128
140
  */
129
141
  private manualFocusing;
130
142
  private config;
131
- private readonly destroy$;
132
- readonly optionSelectionChanges: Observable<ThyOptionSelectionChangeEvent>;
143
+ private destroyRef;
133
144
  readonly cdkConnectedOverlay: Signal<CdkConnectedOverlay>;
134
- keyManager: ActiveDescendantKeyManager<ThyOption>;
135
145
  panelOpen: boolean;
136
146
  /**
137
147
  * 搜索时回调
@@ -239,86 +249,91 @@ declare class ThySelect extends TabIndexDisabledControlValueAccessorMixin implem
239
249
  * 是否隐藏选择框边框
240
250
  */
241
251
  readonly thyBorderless: _angular_core.InputSignalWithTransform<boolean, unknown>;
242
- isReactiveDriven: boolean;
243
- innerOptions: ThySelectOptionModel[];
244
- optionGroups: ThyOptionGroupModel[];
252
+ private scrolledIndex;
253
+ readonly cdkVirtualScrollViewport: Signal<CdkVirtualScrollViewport>;
254
+ private shouldActivateOption;
245
255
  /**
246
256
  * option 列表
247
257
  */
248
258
  readonly thyOptions: _angular_core.InputSignalWithTransform<ThySelectOptionModel[], ThySelectOptionModel[]>;
249
- options: QueryList<ThyOption>;
259
+ readonly keywords: WritableSignal<string>;
250
260
  /**
251
261
  * 目前只支持多选选中项的展示,默认为空,渲染文字模板,传入tag,渲染展示模板,
252
262
  * @default ''|tag
253
263
  */
254
264
  readonly thyPreset: _angular_core.InputSignal<string>;
255
265
  trigger: ElementRef<HTMLElement>;
256
- readonly panel: Signal<ElementRef<HTMLElement>>;
266
+ private readonly options;
267
+ private readonly groups;
257
268
  /**
258
- * @private
269
+ * 所有分组和选项
259
270
  */
260
- contentOptions: QueryList<ThyOption>;
261
- viewOptions: QueryList<ThyOption>;
271
+ private readonly allGroupsAndOptions;
262
272
  /**
263
- * @private
273
+ * 渲染的分组和选项,基于 keywords 过滤后
264
274
  */
265
- readonly contentGroups: Signal<readonly ThySelectOptionGroup[]>;
266
- readonly viewGroups: Signal<readonly ThySelectOptionGroup[]>;
267
- handleKeydown(event: KeyboardEvent): void;
268
- get optionsChanges$(): Observable<ThyOption[]>;
275
+ readonly filteredGroupsAndOptions: Signal<ThySelectFlattedItem[]>;
276
+ /**
277
+ * 渲染的选项
278
+ */
279
+ private readonly filteredOptions;
280
+ private readonly filteredOptionsMap;
281
+ /**
282
+ * 当前选中的值
283
+ */
284
+ readonly selectedValues: WritableSignal<any[]>;
285
+ readonly selectedValuesMap: Signal<Map<any, boolean>>;
286
+ /**
287
+ * 传给 selectControl 指令的选中值
288
+ */
289
+ readonly selectedOptions: WritableSignal<SelectOptionBase | SelectOptionBase[]>;
290
+ optionRenders: QueryList<ThyOptionRender>;
291
+ keydown(event: KeyboardEvent): void;
292
+ get optionsChanges$(): Observable<ThyOptionRender[]>;
269
293
  private buildScrollStrategy;
270
- private isSearching;
271
- groupBy: (item: ThySelectOptionModel) => string;
272
- get placement(): ThyPlacement;
273
294
  constructor();
274
- writeValue(value: any): void;
295
+ writeValue(value: SafeAny): void;
275
296
  ngOnInit(): void;
276
- buildOptionGroups(options: ThySelectOptionModel[]): ThyOptionGroupModel[];
277
- buildReactiveOptions(): void;
278
- getDropdownMinWidth(): number | null;
279
297
  ngAfterViewInit(): void;
280
- ngAfterContentInit(): void;
281
- setup(): void;
282
- get isHiddenOptions(): boolean;
283
- onAttached(): void;
284
- dropDownMouseMove(event: MouseEvent): void;
285
- onOptionsScrolled(elementRef: ElementRef): void;
286
- onSearchFilter(searchText: string): void;
298
+ private setup;
299
+ private buildAllGroupsAndOptions;
300
+ private allGroupsAndOptionsByReactive;
301
+ private allGroupsAndOptionsByTemplate;
302
+ private buildFilteredGroupsAndOptions;
303
+ private updateSelectedOptions;
304
+ optionsScrolled(index: number): void;
305
+ search(keywords: string): void;
287
306
  onBlur(event?: FocusEvent): void;
288
307
  onFocus(event?: FocusEvent): void;
289
308
  focus(options?: FocusOptions): void;
290
309
  remove($event: {
291
- item: ThyOption;
310
+ item: SelectOptionBase;
292
311
  $eventOrigin: Event;
293
312
  }): void;
294
313
  clearSelectValue(event?: Event): void;
295
314
  updateCdkConnectedOverlayPositions(): void;
296
- get selected(): ThyOption | ThyOption[];
297
- get isMultiple(): boolean;
298
- get empty(): boolean;
299
- getItemCount(): number;
315
+ readonly isMultiple: Signal<boolean>;
316
+ readonly empty: Signal<boolean>;
317
+ activatedValue: WritableSignal<any>;
300
318
  toggle(event: MouseEvent): void;
301
319
  open(): void;
302
320
  close(): void;
303
321
  private emitModelValueChange;
304
- private highlightCorrectOption;
305
- private initKeyManager;
306
- private handleClosedKeydown;
307
- private handleOpenKeydown;
308
- private getPositions;
309
- private instanceSelectionModel;
310
- private resetOptions;
311
- private initializeSelection;
312
- private setDropDownClass;
313
- private setSelectionByModelValue;
314
- private onSelect;
315
- private sortValues;
322
+ private scrollToActivatedOption;
323
+ private handleKeydown;
324
+ optionClick(event: {
325
+ value: SafeAny;
326
+ isUserInput: boolean;
327
+ }): void;
328
+ optionHover(value: SafeAny): void;
329
+ mouseLeaveOptions(): void;
316
330
  private getOriginRectWidth;
317
331
  private subscribeTriggerResize;
318
332
  private unsubscribeTriggerResize;
333
+ trackByFn(index: number, item: ThySelectFlattedItem): SafeAny;
319
334
  ngOnDestroy(): void;
320
335
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThySelect, never>;
321
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThySelect, "thy-select,thy-custom-select", ["thySelect"], { "thyDropdownWidthMode": { "alias": "thyDropdownWidthMode"; "required": false; "isSignal": true; }; "thyShowSearch": { "alias": "thyShowSearch"; "required": false; "isSignal": true; }; "thyPlaceHolder": { "alias": "thyPlaceHolder"; "required": false; "isSignal": true; }; "thyServerSearch": { "alias": "thyServerSearch"; "required": false; "isSignal": true; }; "thyLoadState": { "alias": "thyLoadState"; "required": false; "isSignal": true; }; "thyAutoActiveFirstItem": { "alias": "thyAutoActiveFirstItem"; "required": false; "isSignal": true; }; "thyMode": { "alias": "thyMode"; "required": false; "isSignal": true; }; "thySize": { "alias": "thySize"; "required": false; "isSignal": true; }; "thyEmptyStateText": { "alias": "thyEmptyStateText"; "required": false; "isSignal": true; }; "thyEmptySearchMessageText": { "alias": "thyEmptySearchMessageText"; "required": false; "isSignal": true; }; "thyEnableScrollLoad": { "alias": "thyEnableScrollLoad"; "required": false; "isSignal": true; }; "thyAllowClear": { "alias": "thyAllowClear"; "required": false; "isSignal": true; }; "thyDisabled": { "alias": "thyDisabled"; "required": false; }; "thySortComparator": { "alias": "thySortComparator"; "required": false; "isSignal": true; }; "thyFooterTemplate": { "alias": "thyFooterTemplate"; "required": false; "isSignal": true; }; "thyPlacement": { "alias": "thyPlacement"; "required": false; "isSignal": true; }; "thyOrigin": { "alias": "thyOrigin"; "required": false; "isSignal": true; }; "thyFooterClass": { "alias": "thyFooterClass"; "required": false; "isSignal": true; }; "thyAutoExpand": { "alias": "thyAutoExpand"; "required": false; "isSignal": true; }; "thyHasBackdrop": { "alias": "thyHasBackdrop"; "required": false; "isSignal": true; }; "thyMaxTagCount": { "alias": "thyMaxTagCount"; "required": false; "isSignal": true; }; "thyBorderless": { "alias": "thyBorderless"; "required": false; "isSignal": true; }; "thyOptions": { "alias": "thyOptions"; "required": false; "isSignal": true; }; "thyPreset": { "alias": "thyPreset"; "required": false; "isSignal": true; }; }, { "thyOnSearch": "thyOnSearch"; "thyOnScrollToBottom": "thyOnScrollToBottom"; "thyOnExpandStatusChange": "thyOnExpandStatusChange"; }, ["selectedValueDisplayRef", "contentGroups", "contentOptions"], ["*"], true, never>;
336
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThySelect, "thy-select,thy-custom-select", ["thySelect"], { "thyDropdownWidthMode": { "alias": "thyDropdownWidthMode"; "required": false; "isSignal": true; }; "thyShowSearch": { "alias": "thyShowSearch"; "required": false; "isSignal": true; }; "thyPlaceHolder": { "alias": "thyPlaceHolder"; "required": false; "isSignal": true; }; "thyServerSearch": { "alias": "thyServerSearch"; "required": false; "isSignal": true; }; "thyLoadState": { "alias": "thyLoadState"; "required": false; "isSignal": true; }; "thyAutoActiveFirstItem": { "alias": "thyAutoActiveFirstItem"; "required": false; "isSignal": true; }; "thyMode": { "alias": "thyMode"; "required": false; "isSignal": true; }; "thySize": { "alias": "thySize"; "required": false; "isSignal": true; }; "thyEmptyStateText": { "alias": "thyEmptyStateText"; "required": false; "isSignal": true; }; "thyEmptySearchMessageText": { "alias": "thyEmptySearchMessageText"; "required": false; "isSignal": true; }; "thyEnableScrollLoad": { "alias": "thyEnableScrollLoad"; "required": false; "isSignal": true; }; "thyAllowClear": { "alias": "thyAllowClear"; "required": false; "isSignal": true; }; "thyDisabled": { "alias": "thyDisabled"; "required": false; }; "thySortComparator": { "alias": "thySortComparator"; "required": false; "isSignal": true; }; "thyFooterTemplate": { "alias": "thyFooterTemplate"; "required": false; "isSignal": true; }; "thyPlacement": { "alias": "thyPlacement"; "required": false; "isSignal": true; }; "thyOrigin": { "alias": "thyOrigin"; "required": false; "isSignal": true; }; "thyFooterClass": { "alias": "thyFooterClass"; "required": false; "isSignal": true; }; "thyAutoExpand": { "alias": "thyAutoExpand"; "required": false; "isSignal": true; }; "thyHasBackdrop": { "alias": "thyHasBackdrop"; "required": false; "isSignal": true; }; "thyMaxTagCount": { "alias": "thyMaxTagCount"; "required": false; "isSignal": true; }; "thyBorderless": { "alias": "thyBorderless"; "required": false; "isSignal": true; }; "thyOptions": { "alias": "thyOptions"; "required": false; "isSignal": true; }; "thyPreset": { "alias": "thyPreset"; "required": false; "isSignal": true; }; }, { "thyOnSearch": "thyOnSearch"; "thyOnScrollToBottom": "thyOnScrollToBottom"; "thyOnExpandStatusChange": "thyOnExpandStatusChange"; }, ["selectedValueDisplayRef", "options", "groups"], ["*"], true, never>;
322
337
  static ngAcceptInputType_thyDisabled: i1.ThyBooleanInput;
323
338
  }
324
339
 
package/shared/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { Type, TemplateRef, ViewContainerRef, OnInit, OnDestroy, ElementRef, AfterContentInit, QueryList, ChangeDetectorRef, AfterViewInit, Signal, InputSignal, InjectionToken, WritableSignal } from '@angular/core';
2
+ import { Type, TemplateRef, ViewContainerRef, OnInit, OnDestroy, ElementRef, AfterContentInit, QueryList, ChangeDetectorRef, AfterViewInit, Signal, InputSignal, InjectionToken } from '@angular/core';
3
3
  import { CdkDrag } from '@angular/cdk/drag-drop';
4
4
  import * as i2 from '@angular/forms';
5
5
  import { ControlValueAccessor } from '@angular/forms';
@@ -13,7 +13,7 @@ import { ThyTagSize } from 'ngx-tethys/tag';
13
13
  import { ThySharedLocale } from 'ngx-tethys/i18n';
14
14
  import * as ngx_tethys_shared from 'ngx-tethys/shared';
15
15
  import { Highlightable } from '@angular/cdk/a11y';
16
- import { Subject, Observable } from 'rxjs';
16
+ import { SafeAny } from 'ngx-tethys/types';
17
17
 
18
18
  /**
19
19
  * 视图 Outlet 组件,取代 NgComponentOutlet 和 NgTemplateOutlet
@@ -364,9 +364,6 @@ declare class ThySelectCommonModule {
364
364
  static ɵinj: _angular_core.ɵɵInjectorDeclaration<ThySelectCommonModule>;
365
365
  }
366
366
 
367
- interface IThyOptionParentComponent {
368
- isMultiple: boolean;
369
- }
370
367
  interface IThyOptionGroupComponent {
371
368
  hidden: boolean;
372
369
  }
@@ -383,10 +380,6 @@ interface IThyListOptionParentComponent {
383
380
  scrollIntoView(option: IThyOptionComponent): void;
384
381
  isSelected(option: IThyOptionComponent): boolean;
385
382
  }
386
- /**
387
- * Injection token used to provide the parent component to options.
388
- */
389
- declare const THY_OPTION_PARENT_COMPONENT: InjectionToken<IThyOptionParentComponent>;
390
383
  /**
391
384
  * Injection token used to provide the parent component to options.
392
385
  */
@@ -436,81 +429,159 @@ declare class ThyOptionSelectionChangeEvent {
436
429
  isUserInput: boolean;
437
430
  constructor(option: ThyOption, isUserInput?: boolean);
438
431
  }
439
- declare class ThyOptionVisibleChangeEvent {
440
- option: ThyOption;
432
+ /**
433
+ * 选项组件
434
+ * @name thy-option
435
+ */
436
+ declare class ThyOption {
437
+ /**
438
+ * 选项的值,具有唯一性
439
+ */
440
+ readonly thyValue: _angular_core.InputSignal<any>;
441
+ /**
442
+ * 选项的原始值
443
+ */
444
+ readonly thyRawValue: _angular_core.InputSignal<any>;
445
+ /**
446
+ * 选项的文本
447
+ */
448
+ readonly thyLabelText: _angular_core.InputSignal<string>;
449
+ /**
450
+ * 是否显示自定义模板
451
+ */
452
+ readonly thyShowOptionCustom: _angular_core.InputSignal<boolean>;
453
+ /**
454
+ * 搜索关键字
455
+ */
456
+ readonly thySearchKey: _angular_core.InputSignal<string>;
457
+ /**
458
+ * 是否禁用
459
+ */
460
+ readonly thyDisabled: _angular_core.InputSignal<boolean>;
461
+ /**
462
+ * 是否选中,会跟随 ThyOptionSelectionChangeEvent 抛出去
463
+ */
464
+ readonly selected: _angular_core.WritableSignal<boolean>;
465
+ /**
466
+ * 选项被选中时的回调
467
+ */
468
+ readonly selectionChange: _angular_core.OutputEmitterRef<ThyOptionSelectionChangeEvent>;
469
+ /**
470
+ * 模板
471
+ */
472
+ readonly template: _angular_core.Signal<TemplateRef<any>>;
473
+ private readonly optionGroupComponent;
474
+ get groupLabel(): string;
475
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThyOption, never>;
476
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThyOption, "thy-option", never, { "thyValue": { "alias": "thyValue"; "required": false; "isSignal": true; }; "thyRawValue": { "alias": "thyRawValue"; "required": false; "isSignal": true; }; "thyLabelText": { "alias": "thyLabelText"; "required": false; "isSignal": true; }; "thyShowOptionCustom": { "alias": "thyShowOptionCustom"; "required": false; "isSignal": true; }; "thySearchKey": { "alias": "thySearchKey"; "required": false; "isSignal": true; }; "thyDisabled": { "alias": "thyDisabled"; "required": false; "isSignal": true; }; }, { "selectionChange": "selectionChange"; }, never, ["*"], true, never>;
441
477
  }
478
+
442
479
  /**
480
+ * 选项渲染组件
443
481
  * @private
444
- * @order 20
482
+ * @name thy-option-render
445
483
  */
446
- declare class ThyOption extends SelectOptionBase implements OnDestroy, Highlightable {
484
+ declare class ThyOptionRender implements Highlightable {
447
485
  element: ElementRef<HTMLElement>;
448
- parent: ngx_tethys_shared.IThyOptionParentComponent;
449
- private cdr;
450
- thyValue: any;
451
- thyRawValue: any;
452
- thyLabelText: string;
453
- readonly thyShowOptionCustom: _angular_core.InputSignal<boolean>;
486
+ private hostRenderer;
487
+ /**
488
+ * 选项的值,具有唯一性
489
+ */
490
+ readonly thyValue: _angular_core.InputSignal<any>;
491
+ /**
492
+ * 选项的原始值
493
+ */
494
+ readonly thyRawValue: _angular_core.InputSignal<any>;
495
+ /**
496
+ * 选项的文本
497
+ */
498
+ readonly thyLabelText: _angular_core.InputSignal<string>;
499
+ /**
500
+ * 搜索关键字
501
+ */
454
502
  readonly thySearchKey: _angular_core.InputSignal<string>;
455
- readonly template: _angular_core.Signal<TemplateRef<any>>;
503
+ /**
504
+ * 是否禁用
505
+ */
456
506
  readonly thyDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
457
- readonly hidden: WritableSignal<boolean>;
458
- get disabled(): boolean;
459
- get tabIndex(): string;
460
- readonly selected: WritableSignal<boolean>;
461
- readonly selectionChange: _angular_core.OutputEmitterRef<ThyOptionSelectionChangeEvent>;
462
- readonly visibleChange: _angular_core.OutputEmitterRef<ThyOptionVisibleChangeEvent>;
507
+ /**
508
+ * 是否显示自定义模板
509
+ */
510
+ readonly thyShowOptionCustom: _angular_core.InputSignalWithTransform<boolean, unknown>;
511
+ /**
512
+ * 模板
513
+ */
514
+ readonly thyTemplate: _angular_core.InputSignal<TemplateRef<any>>;
515
+ /**
516
+ * 模板上下文
517
+ */
518
+ readonly thyTemplateContext: _angular_core.InputSignal<any>;
519
+ /**
520
+ * 被选中时,是否显示勾选图标
521
+ */
522
+ readonly thyShowCheckedIcon: _angular_core.InputSignalWithTransform<boolean, unknown>;
523
+ /**
524
+ * Select 组件选中的值
525
+ */
526
+ readonly thySelectedValuesMap: _angular_core.InputSignal<Map<any, boolean>>;
527
+ /**
528
+ * 当前高亮选项的值
529
+ */
530
+ readonly thyActivatedValue: _angular_core.InputSignal<any>;
531
+ /**
532
+ * 点击选项时的回调
533
+ */
534
+ readonly optionClick: _angular_core.OutputEmitterRef<{
535
+ value: SafeAny;
536
+ isUserInput?: boolean;
537
+ }>;
538
+ /**
539
+ * 鼠标悬浮时的回调
540
+ */
541
+ readonly optionHover: _angular_core.OutputEmitterRef<any>;
542
+ /**
543
+ * 是否被选中
544
+ */
545
+ readonly selected: _angular_core.Signal<boolean>;
546
+ /**
547
+ * 是否高亮
548
+ */
549
+ readonly activated: _angular_core.Signal<boolean>;
550
+ readonly tabIndex: _angular_core.Signal<"0" | "-1">;
463
551
  constructor();
464
- getHostElement(): HTMLElement;
465
- onClick(event: Event): void;
552
+ mouseEnter(): void;
466
553
  handleKeydown(event: KeyboardEvent): void;
467
554
  selectViaInteraction(): void;
468
- select(event?: Event): void;
555
+ select(): void;
469
556
  deselect(): void;
470
- hideOption(): void;
471
- showOption(): void;
472
- matchSearchText(searchText: string): boolean;
473
557
  setActiveStyles(): void;
474
558
  setInactiveStyles(): void;
475
- getLabel(): string;
476
- private emitSelectionChangeEvent;
477
- ngOnDestroy(): void;
478
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThyOption, never>;
479
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThyOption, "thy-option", never, { "thyValue": { "alias": "thyValue"; "required": false; }; "thyRawValue": { "alias": "thyRawValue"; "required": false; }; "thyLabelText": { "alias": "thyLabelText"; "required": false; }; "thyShowOptionCustom": { "alias": "thyShowOptionCustom"; "required": false; "isSignal": true; }; "thySearchKey": { "alias": "thySearchKey"; "required": false; "isSignal": true; }; "thyDisabled": { "alias": "thyDisabled"; "required": false; "isSignal": true; }; }, { "selectionChange": "selectionChange"; "visibleChange": "visibleChange"; }, never, ["*"], true, never>;
559
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThyOptionRender, never>;
560
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThyOptionRender, "thy-option-render", never, { "thyValue": { "alias": "thyValue"; "required": false; "isSignal": true; }; "thyRawValue": { "alias": "thyRawValue"; "required": false; "isSignal": true; }; "thyLabelText": { "alias": "thyLabelText"; "required": false; "isSignal": true; }; "thySearchKey": { "alias": "thySearchKey"; "required": false; "isSignal": true; }; "thyDisabled": { "alias": "thyDisabled"; "required": false; "isSignal": true; }; "thyShowOptionCustom": { "alias": "thyShowOptionCustom"; "required": false; "isSignal": true; }; "thyTemplate": { "alias": "thyTemplate"; "required": false; "isSignal": true; }; "thyTemplateContext": { "alias": "thyTemplateContext"; "required": false; "isSignal": true; }; "thyShowCheckedIcon": { "alias": "thyShowCheckedIcon"; "required": false; "isSignal": true; }; "thySelectedValuesMap": { "alias": "thySelectedValuesMap"; "required": false; "isSignal": true; }; "thyActivatedValue": { "alias": "thyActivatedValue"; "required": false; "isSignal": true; }; }, { "optionClick": "optionClick"; "optionHover": "optionHover"; }, never, never, true, never>;
480
561
  }
481
562
 
482
- /**
483
- * @private
484
- */
485
- declare class ThySelectOptionGroup implements OnDestroy, AfterContentInit {
486
- private _ngZone;
487
- private cdr;
488
- readonly thyDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
489
- readonly hidden: WritableSignal<boolean>;
563
+ declare class ThySelectOptionGroup {
490
564
  readonly thyGroupLabel: _angular_core.InputSignal<string>;
491
- options: QueryList<ThyOption>;
492
- _destroy$: Subject<void>;
493
- optionVisibleChanges: Observable<ThyOptionVisibleChangeEvent>;
494
- ngAfterContentInit(): void;
495
- _resetOptions(): void;
496
- ngOnDestroy(): void;
565
+ readonly thyDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
497
566
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThySelectOptionGroup, never>;
498
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThySelectOptionGroup, "thy-option-group", never, { "thyDisabled": { "alias": "thyDisabled"; "required": false; "isSignal": true; }; "thyGroupLabel": { "alias": "thyGroupLabel"; "required": false; "isSignal": true; }; }, {}, ["options"], ["*"], true, never>;
567
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThySelectOptionGroup, "thy-option-group", never, { "thyGroupLabel": { "alias": "thyGroupLabel"; "required": false; "isSignal": true; }; "thyDisabled": { "alias": "thyDisabled"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
499
568
  }
500
569
 
501
- declare class ThyOptionsContainer implements OnInit {
502
- readonly optionsTemplate: _angular_core.Signal<TemplateRef<any>>;
503
- constructor();
504
- ngOnInit(): void;
505
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThyOptionsContainer, never>;
506
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThyOptionsContainer, "thy-options-container", never, {}, {}, never, ["*"], true, never>;
570
+ /**
571
+ * @private
572
+ */
573
+ declare class ThyOptionGroupRender {
574
+ readonly thyGroupLabel: _angular_core.InputSignal<string>;
575
+ readonly thyDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
576
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThyOptionGroupRender, never>;
577
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThyOptionGroupRender, "thy-option-group-render", never, { "thyGroupLabel": { "alias": "thyGroupLabel"; "required": false; "isSignal": true; }; "thyDisabled": { "alias": "thyDisabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
507
578
  }
508
579
 
509
580
  declare class ThyOptionModule {
510
581
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThyOptionModule, never>;
511
- static ɵmod: _angular_core.ɵɵNgModuleDeclaration<ThyOptionModule, never, [typeof i1$1.CommonModule, typeof i3.ThyIconModule, typeof ThyListOption, typeof ThyOptionGroup, typeof ThyOption, typeof ThySelectOptionGroup, typeof ThyOptionsContainer], [typeof ThyListOption, typeof ThyOptionGroup, typeof ThyOption, typeof ThySelectOptionGroup, typeof ThyOptionsContainer]>;
582
+ static ɵmod: _angular_core.ɵɵNgModuleDeclaration<ThyOptionModule, never, [typeof i1$1.CommonModule, typeof i3.ThyIconModule, typeof ThyListOption, typeof ThyOptionGroup, typeof ThyOption, typeof ThyOptionRender, typeof ThySelectOptionGroup, typeof ThyOptionGroupRender], [typeof ThyListOption, typeof ThyOptionGroup, typeof ThyOption, typeof ThyOptionRender, typeof ThySelectOptionGroup, typeof ThyOptionGroupRender]>;
512
583
  static ɵinj: _angular_core.ɵɵInjectorDeclaration<ThyOptionModule>;
513
584
  }
514
585
 
515
- export { SelectOptionBase, THY_LIST_OPTION_PARENT_COMPONENT, THY_OPTION_PARENT_COMPONENT, ThyAutofocusDirective, ThyContextMenuDirective, ThyCtrlEnterDirective, ThyDragDropDirective, ThyEnterDirective, ThyFormCheckBaseComponent, ThyListOption, ThyOption, ThyOptionGroup, ThyOptionModule, ThyOptionSelectionChangeEvent, ThyOptionVisibleChangeEvent, ThyOptionsContainer, ThyScrollDirective, ThySelectCommonModule, ThySelectControl, ThySelectOptionGroup, ThySharedModule, ThyShowDirective, ThyStopPropagationDirective, ThyStringOrTemplateOutletDirective, ThyTranscludeDirective, ThyViewOutletDirective };
516
- export type { IThyListOptionParentComponent, IThyOptionComponent, IThyOptionGroupComponent, IThyOptionParentComponent, SelectControlSize, ThyListLayout };
586
+ 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 };
587
+ export type { IThyListOptionParentComponent, IThyOptionComponent, IThyOptionGroupComponent, SelectControlSize, ThyListLayout };
@@ -57,16 +57,6 @@
57
57
  background: rgba(variables.$primary, 0.1);
58
58
  color: variables.$primary;
59
59
 
60
- // &.hover,
61
- // &:hover {
62
- // background: $hover-bg-color;
63
- // color: $body-color;
64
-
65
- // .prefix-icon {
66
- // color: $gray-300;
67
- // }
68
- // }
69
-
70
60
  .prefix-icon {
71
61
  color: variables.$primary;
72
62
  }
@@ -6,29 +6,30 @@ $optionsSize: 'sm', 'default', 'md', 'lg';
6
6
 
7
7
  .thy-select-dropdown-options {
8
8
  @include select.thy-select-options-container();
9
+ &-with-virtual-scroll {
10
+ overflow-y: hidden;
11
+ .cdk-virtual-scroll-content-wrapper {
12
+ width: 100%;
13
+ }
14
+ }
9
15
 
10
16
  .loading-more {
11
17
  min-height: auto;
12
18
  text-align: center;
13
19
  }
14
20
 
15
- .thy-option-item-group {
21
+ .thy-option-group-render {
16
22
  @include option.thy-option-common-layout();
17
23
  }
18
24
 
19
25
  .thy-option-item {
20
26
  @include option.thy-option();
21
- &.hidden {
22
- display: none;
23
- }
24
27
  }
25
28
 
26
- .thy-option-item-group {
29
+ .thy-option-group-render {
27
30
  flex-direction: column;
28
-
29
- &.thy-select-option-group-hidden {
30
- display: none;
31
- }
31
+ height: 40px;
32
+ padding: 5px 0;
32
33
 
33
34
  .group-name {
34
35
  width: 100%;