autocomplete.component.d.ts 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /**
  2. * Use of this source code is governed by an MIT-style license that can be
  3. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  4. */
  5. import { AnimationEvent } from '@angular/animations';
  6. import { Direction, Directionality } from '@angular/cdk/bidi';
  7. import { AfterContentInit, AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, QueryList, SimpleChanges, TemplateRef } from '@angular/core';
  8. import { NzNoAnimationDirective } from 'ng-zorro-antd/core/no-animation';
  9. import { CompareWith, NzSafeAny } from 'ng-zorro-antd/core/types';
  10. import { NzAutocompleteOptionComponent } from './autocomplete-option.component';
  11. import * as i0 from "@angular/core";
  12. export interface AutocompleteDataSourceItem {
  13. value: string;
  14. label: string;
  15. }
  16. export type AutocompleteDataSource = Array<AutocompleteDataSourceItem | string | number>;
  17. export declare class NzAutocompleteComponent implements AfterContentInit, AfterViewInit, OnDestroy, OnInit, OnChanges {
  18. private changeDetectorRef;
  19. private directionality;
  20. nzWidth?: number;
  21. nzOverlayClassName: string;
  22. nzOverlayStyle: Record<string, string>;
  23. nzDefaultActiveFirstOption: boolean;
  24. nzBackfill: boolean;
  25. compareWith: CompareWith;
  26. nzDataSource?: AutocompleteDataSource;
  27. readonly selectionChange: EventEmitter<NzAutocompleteOptionComponent>;
  28. showPanel: boolean;
  29. isOpen: boolean;
  30. activeItem: NzAutocompleteOptionComponent | null;
  31. dir: Direction;
  32. normalizedDataSource: AutocompleteDataSourceItem[];
  33. private destroy$;
  34. animationStateChange: EventEmitter<AnimationEvent>;
  35. /**
  36. * Options accessor, its source may be content or dataSource
  37. */
  38. get options(): QueryList<NzAutocompleteOptionComponent>;
  39. /** Provided by content */
  40. fromContentOptions: QueryList<NzAutocompleteOptionComponent>;
  41. /** Provided by dataSource */
  42. fromDataSourceOptions: QueryList<NzAutocompleteOptionComponent>;
  43. /** cdk-overlay */
  44. template?: TemplateRef<{}>;
  45. panel?: ElementRef;
  46. content?: ElementRef;
  47. private activeItemIndex;
  48. private selectionChangeSubscription;
  49. private optionMouseEnterSubscription;
  50. private dataSourceChangeSubscription;
  51. /** Options changes listener */
  52. private readonly optionSelectionChanges;
  53. private readonly optionMouseEnter;
  54. private afterNextRender$;
  55. noAnimation: NzNoAnimationDirective | null;
  56. constructor(changeDetectorRef: ChangeDetectorRef, directionality: Directionality);
  57. ngOnInit(): void;
  58. ngOnChanges(changes: SimpleChanges): void;
  59. onAnimationEvent(event: AnimationEvent): void;
  60. ngAfterContentInit(): void;
  61. ngAfterViewInit(): void;
  62. ngOnDestroy(): void;
  63. setVisibility(): void;
  64. setActiveItem(index: number): void;
  65. setNextItemActive(): void;
  66. setPreviousItemActive(): void;
  67. getOptionIndex(value: NzSafeAny): number;
  68. getOption(value: NzSafeAny): NzAutocompleteOptionComponent | null;
  69. private optionsInit;
  70. /**
  71. * Clear the status of options
  72. */
  73. clearSelectedOptions(skip?: NzAutocompleteOptionComponent | null, deselect?: boolean): void;
  74. private subscribeOptionChanges;
  75. static ɵfac: i0.ɵɵFactoryDeclaration<NzAutocompleteComponent, never>;
  76. static ɵcmp: i0.ɵɵComponentDeclaration<NzAutocompleteComponent, "nz-autocomplete", ["nzAutocomplete"], { "nzWidth": { "alias": "nzWidth"; "required": false; }; "nzOverlayClassName": { "alias": "nzOverlayClassName"; "required": false; }; "nzOverlayStyle": { "alias": "nzOverlayStyle"; "required": false; }; "nzDefaultActiveFirstOption": { "alias": "nzDefaultActiveFirstOption"; "required": false; }; "nzBackfill": { "alias": "nzBackfill"; "required": false; }; "compareWith": { "alias": "compareWith"; "required": false; }; "nzDataSource": { "alias": "nzDataSource"; "required": false; }; }, { "selectionChange": "selectionChange"; }, ["fromContentOptions"], ["*"], true, never>;
  77. static ngAcceptInputType_nzWidth: unknown;
  78. static ngAcceptInputType_nzDefaultActiveFirstOption: unknown;
  79. static ngAcceptInputType_nzBackfill: unknown;
  80. }