forked from angular/components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autocomplete.ts
49 lines (47 loc) · 1.63 KB
/
autocomplete.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {
ChangeDetectionStrategy,
Component,
ContentChildren,
QueryList,
ViewEncapsulation,
} from '@angular/core';
import {
MAT_LEGACY_OPTGROUP,
MAT_LEGACY_OPTION_PARENT_COMPONENT,
MatLegacyOption,
MatLegacyOptgroup,
} from '@angular/material/legacy-core';
import {_MatAutocompleteBase} from '@angular/material/autocomplete';
/**
* @deprecated Use `MatAutocomplete` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
@Component({
selector: 'mat-autocomplete',
templateUrl: 'autocomplete.html',
styleUrls: ['autocomplete.css'],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
exportAs: 'matAutocomplete',
inputs: ['disableRipple'],
host: {
'class': 'mat-autocomplete',
},
providers: [{provide: MAT_LEGACY_OPTION_PARENT_COMPONENT, useExisting: MatLegacyAutocomplete}],
})
export class MatLegacyAutocomplete extends _MatAutocompleteBase {
/** Reference to all option groups within the autocomplete. */
@ContentChildren(MAT_LEGACY_OPTGROUP, {descendants: true})
optionGroups: QueryList<MatLegacyOptgroup>;
/** Reference to all options within the autocomplete. */
@ContentChildren(MatLegacyOption, {descendants: true}) options: QueryList<MatLegacyOption>;
protected _visibleClass = 'mat-autocomplete-visible';
protected _hiddenClass = 'mat-autocomplete-hidden';
}