@angular/material 21.0.0-next.9 → 21.0.0-rc.0
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/core/tokens/_classes.scss +1 -1
- package/core/tokens/m2/_md-sys-color.scss +17 -17
- package/fesm2022/_animation-chunk.mjs +10 -16
- package/fesm2022/_animation-chunk.mjs.map +1 -1
- package/fesm2022/_date-formats-chunk.mjs +68 -164
- package/fesm2022/_date-formats-chunk.mjs.map +1 -1
- package/fesm2022/_date-range-input-harness-chunk.mjs +284 -463
- package/fesm2022/_date-range-input-harness-chunk.mjs.map +1 -1
- package/fesm2022/_error-options-chunk.mjs +56 -19
- package/fesm2022/_error-options-chunk.mjs.map +1 -1
- package/fesm2022/_error-state-chunk.mjs +24 -31
- package/fesm2022/_error-state-chunk.mjs.map +1 -1
- package/fesm2022/_form-field-chunk.mjs +1224 -1017
- package/fesm2022/_form-field-chunk.mjs.map +1 -1
- package/fesm2022/_icon-button-chunk.mjs +243 -187
- package/fesm2022/_icon-button-chunk.mjs.map +1 -1
- package/fesm2022/_icon-registry-chunk.mjs +350 -575
- package/fesm2022/_icon-registry-chunk.mjs.map +1 -1
- package/fesm2022/_input-harness-chunk.mjs +56 -107
- package/fesm2022/_input-harness-chunk.mjs.map +1 -1
- package/fesm2022/_input-value-accessor-chunk.mjs +0 -6
- package/fesm2022/_input-value-accessor-chunk.mjs.map +1 -1
- package/fesm2022/_internal-form-field-chunk.mjs +59 -19
- package/fesm2022/_internal-form-field-chunk.mjs.map +1 -1
- package/fesm2022/_line-chunk.mjs +83 -43
- package/fesm2022/_line-chunk.mjs.map +1 -1
- package/fesm2022/_option-chunk.mjs +348 -311
- package/fesm2022/_option-chunk.mjs.map +1 -1
- package/fesm2022/_option-harness-chunk.mjs +23 -39
- package/fesm2022/_option-harness-chunk.mjs.map +1 -1
- package/fesm2022/_option-module-chunk.mjs +36 -10
- package/fesm2022/_option-module-chunk.mjs.map +1 -1
- package/fesm2022/_pseudo-checkbox-chunk.mjs +79 -44
- package/fesm2022/_pseudo-checkbox-chunk.mjs.map +1 -1
- package/fesm2022/_pseudo-checkbox-module-chunk.mjs +36 -10
- package/fesm2022/_pseudo-checkbox-module-chunk.mjs.map +1 -1
- package/fesm2022/_public-api-chunk.mjs +71 -134
- package/fesm2022/_public-api-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-chunk.mjs +504 -600
- package/fesm2022/_ripple-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-loader-chunk.mjs +120 -138
- package/fesm2022/_ripple-loader-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-module-chunk.mjs +36 -10
- package/fesm2022/_ripple-module-chunk.mjs.map +1 -1
- package/fesm2022/_structural-styles-chunk.mjs +37 -10
- package/fesm2022/_structural-styles-chunk.mjs.map +1 -1
- package/fesm2022/_tooltip-chunk.mjs +810 -888
- package/fesm2022/_tooltip-chunk.mjs.map +1 -1
- package/fesm2022/autocomplete-testing.mjs +62 -86
- package/fesm2022/autocomplete-testing.mjs.map +1 -1
- package/fesm2022/autocomplete.mjs +965 -1126
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge-testing.mjs +38 -54
- package/fesm2022/badge-testing.mjs.map +1 -1
- package/fesm2022/badge.mjs +321 -272
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet-testing.mjs +10 -24
- package/fesm2022/bottom-sheet-testing.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +349 -344
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button-testing.mjs +60 -94
- package/fesm2022/button-testing.mjs.map +1 -1
- package/fesm2022/button-toggle-testing.mjs +76 -125
- package/fesm2022/button-toggle-testing.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +752 -662
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +263 -158
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card-testing.mjs +19 -33
- package/fesm2022/card-testing.mjs.map +1 -1
- package/fesm2022/card.mjs +576 -272
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox-testing.mjs +71 -123
- package/fesm2022/checkbox-testing.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +515 -477
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips-testing.mjs +201 -344
- package/fesm2022/chips-testing.mjs.map +1 -1
- package/fesm2022/chips.mjs +2552 -2289
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core-testing.mjs +14 -28
- package/fesm2022/core-testing.mjs.map +1 -1
- package/fesm2022/core.mjs +357 -328
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker-testing.mjs +15 -25
- package/fesm2022/datepicker-testing.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +4826 -4563
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog-testing.mjs +93 -129
- package/fesm2022/dialog-testing.mjs.map +1 -1
- package/fesm2022/dialog.mjs +810 -829
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider-testing.mjs +10 -11
- package/fesm2022/divider-testing.mjs.map +1 -1
- package/fesm2022/divider.mjs +119 -43
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/expansion-testing.mjs +74 -130
- package/fesm2022/expansion-testing.mjs.map +1 -1
- package/fesm2022/expansion.mjs +703 -515
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field-testing-control.mjs +16 -33
- package/fesm2022/form-field-testing-control.mjs.map +1 -1
- package/fesm2022/form-field-testing.mjs +118 -179
- package/fesm2022/form-field-testing.mjs.map +1 -1
- package/fesm2022/form-field.mjs +36 -10
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list-testing.mjs +65 -113
- package/fesm2022/grid-list-testing.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +559 -494
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon-testing.mjs +148 -127
- package/fesm2022/icon-testing.mjs.map +1 -1
- package/fesm2022/icon.mjs +325 -351
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/input-testing.mjs +59 -99
- package/fesm2022/input-testing.mjs.map +1 -1
- package/fesm2022/input.mjs +457 -520
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/list-testing.mjs +251 -434
- package/fesm2022/list-testing.mjs.map +1 -1
- package/fesm2022/list.mjs +1522 -1204
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/material.mjs +0 -5
- package/fesm2022/material.mjs.map +1 -1
- package/fesm2022/menu-testing.mjs +159 -228
- package/fesm2022/menu-testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +1338 -1343
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator-testing.mjs +55 -79
- package/fesm2022/paginator-testing.mjs.map +1 -1
- package/fesm2022/paginator.mjs +381 -309
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar-testing.mjs +12 -21
- package/fesm2022/progress-bar-testing.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +224 -169
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner-testing.mjs +13 -23
- package/fesm2022/progress-spinner-testing.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +235 -160
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/radio-testing.mjs +133 -208
- package/fesm2022/radio-testing.mjs.map +1 -1
- package/fesm2022/radio.mjs +712 -679
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/select-testing.mjs +83 -117
- package/fesm2022/select-testing.mjs.map +1 -1
- package/fesm2022/select.mjs +1116 -1246
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav-testing.mjs +54 -120
- package/fesm2022/sidenav-testing.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +1078 -995
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle-testing.mjs +57 -92
- package/fesm2022/slide-toggle-testing.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +369 -279
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider-testing.mjs +90 -138
- package/fesm2022/slider-testing.mjs.map +1 -1
- package/fesm2022/slider.mjs +1651 -1716
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar-testing.mjs +40 -87
- package/fesm2022/snack-bar-testing.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +763 -714
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort-testing.mjs +45 -66
- package/fesm2022/sort-testing.mjs.map +1 -1
- package/fesm2022/sort.mjs +419 -344
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper-testing.mjs +78 -154
- package/fesm2022/stepper-testing.mjs.map +1 -1
- package/fesm2022/stepper.mjs +790 -498
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table-testing.mjs +120 -213
- package/fesm2022/table-testing.mjs.map +1 -1
- package/fesm2022/table.mjs +1026 -684
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs-testing.mjs +125 -197
- package/fesm2022/tabs-testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs +2351 -2028
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker-testing.mjs +113 -172
- package/fesm2022/timepicker-testing.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +1019 -826
- package/fesm2022/timepicker.mjs.map +1 -1
- package/fesm2022/toolbar-testing.mjs +16 -27
- package/fesm2022/toolbar-testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +163 -78
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip-testing.mjs +41 -52
- package/fesm2022/tooltip-testing.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +36 -10
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree-testing.mjs +86 -162
- package/fesm2022/tree-testing.mjs.map +1 -1
- package/fesm2022/tree.mjs +638 -466
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +2 -2
- package/schematics/ng-add/index.js +1 -1
- package/types/expansion.d.ts +4 -2
- package/types/menu-testing.d.ts +2 -0
- package/types/select.d.ts +1 -1
- package/types/timepicker.d.ts +1 -0
|
@@ -26,1200 +26,1039 @@ import '@angular/cdk/observers/private';
|
|
|
26
26
|
import './_ripple-module-chunk.mjs';
|
|
27
27
|
import './_pseudo-checkbox-module-chunk.mjs';
|
|
28
28
|
|
|
29
|
-
/** Event object that is emitted when an autocomplete option is selected. */
|
|
30
29
|
class MatAutocompleteSelectedEvent {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
option) {
|
|
38
|
-
this.source = source;
|
|
39
|
-
this.option = option;
|
|
40
|
-
}
|
|
30
|
+
source;
|
|
31
|
+
option;
|
|
32
|
+
constructor(source, option) {
|
|
33
|
+
this.source = source;
|
|
34
|
+
this.option = option;
|
|
35
|
+
}
|
|
41
36
|
}
|
|
42
|
-
/** Injection token to be used to override the default options for `mat-autocomplete`. */
|
|
43
37
|
const MAT_AUTOCOMPLETE_DEFAULT_OPTIONS = new InjectionToken('mat-autocomplete-default-options', {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
38
|
+
providedIn: 'root',
|
|
39
|
+
factory: () => ({
|
|
40
|
+
autoActiveFirstOption: false,
|
|
41
|
+
autoSelectActiveOption: false,
|
|
42
|
+
hideSingleSelectionIndicator: false,
|
|
43
|
+
requireSelection: false,
|
|
44
|
+
hasBackdrop: false
|
|
45
|
+
})
|
|
52
46
|
});
|
|
53
|
-
/** Autocomplete component. */
|
|
54
47
|
class MatAutocomplete {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
* interacting or selecting a value, the initial value will be kept.
|
|
107
|
-
*/
|
|
108
|
-
requireSelection;
|
|
109
|
-
/**
|
|
110
|
-
* Specify the width of the autocomplete panel. Can be any CSS sizing value, otherwise it will
|
|
111
|
-
* match the width of its host.
|
|
112
|
-
*/
|
|
113
|
-
panelWidth;
|
|
114
|
-
/** Whether ripples are disabled within the autocomplete panel. */
|
|
115
|
-
disableRipple;
|
|
116
|
-
/** Event that is emitted whenever an option from the list is selected. */
|
|
117
|
-
optionSelected = new EventEmitter();
|
|
118
|
-
/** Event that is emitted when the autocomplete panel is opened. */
|
|
119
|
-
opened = new EventEmitter();
|
|
120
|
-
/** Event that is emitted when the autocomplete panel is closed. */
|
|
121
|
-
closed = new EventEmitter();
|
|
122
|
-
/** Emits whenever an option is activated. */
|
|
123
|
-
optionActivated = new EventEmitter();
|
|
124
|
-
/**
|
|
125
|
-
* Takes classes set on the host mat-autocomplete element and applies them to the panel
|
|
126
|
-
* inside the overlay container to allow for easy styling.
|
|
127
|
-
*/
|
|
128
|
-
set classList(value) {
|
|
129
|
-
this._classList = value;
|
|
130
|
-
this._elementRef.nativeElement.className = '';
|
|
48
|
+
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
49
|
+
_elementRef = inject(ElementRef);
|
|
50
|
+
_defaults = inject(MAT_AUTOCOMPLETE_DEFAULT_OPTIONS);
|
|
51
|
+
_animationsDisabled = _animationsDisabled();
|
|
52
|
+
_activeOptionChanges = Subscription.EMPTY;
|
|
53
|
+
_keyManager;
|
|
54
|
+
showPanel = false;
|
|
55
|
+
get isOpen() {
|
|
56
|
+
return this._isOpen && this.showPanel;
|
|
57
|
+
}
|
|
58
|
+
_isOpen = false;
|
|
59
|
+
_latestOpeningTrigger;
|
|
60
|
+
_setColor(value) {
|
|
61
|
+
this._color = value;
|
|
62
|
+
this._changeDetectorRef.markForCheck();
|
|
63
|
+
}
|
|
64
|
+
_color;
|
|
65
|
+
template;
|
|
66
|
+
panel;
|
|
67
|
+
options;
|
|
68
|
+
optionGroups;
|
|
69
|
+
ariaLabel;
|
|
70
|
+
ariaLabelledby;
|
|
71
|
+
displayWith = null;
|
|
72
|
+
autoActiveFirstOption;
|
|
73
|
+
autoSelectActiveOption;
|
|
74
|
+
requireSelection;
|
|
75
|
+
panelWidth;
|
|
76
|
+
disableRipple;
|
|
77
|
+
optionSelected = new EventEmitter();
|
|
78
|
+
opened = new EventEmitter();
|
|
79
|
+
closed = new EventEmitter();
|
|
80
|
+
optionActivated = new EventEmitter();
|
|
81
|
+
set classList(value) {
|
|
82
|
+
this._classList = value;
|
|
83
|
+
this._elementRef.nativeElement.className = '';
|
|
84
|
+
}
|
|
85
|
+
_classList;
|
|
86
|
+
get hideSingleSelectionIndicator() {
|
|
87
|
+
return this._hideSingleSelectionIndicator;
|
|
88
|
+
}
|
|
89
|
+
set hideSingleSelectionIndicator(value) {
|
|
90
|
+
this._hideSingleSelectionIndicator = value;
|
|
91
|
+
this._syncParentProperties();
|
|
92
|
+
}
|
|
93
|
+
_hideSingleSelectionIndicator;
|
|
94
|
+
_syncParentProperties() {
|
|
95
|
+
if (this.options) {
|
|
96
|
+
for (const option of this.options) {
|
|
97
|
+
option._changeDetectorRef.markForCheck();
|
|
98
|
+
}
|
|
131
99
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
_hideSingleSelectionIndicator;
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
/** Unique ID to be used by autocomplete trigger's "aria-owns" property. */
|
|
151
|
-
id = inject(_IdGenerator).getId('mat-autocomplete-');
|
|
152
|
-
/**
|
|
153
|
-
* Tells any descendant `mat-optgroup` to use the inert a11y pattern.
|
|
154
|
-
* @docs-private
|
|
155
|
-
*/
|
|
156
|
-
inertGroups;
|
|
157
|
-
constructor() {
|
|
158
|
-
const platform = inject(Platform);
|
|
159
|
-
// TODO(crisbeto): the problem that the `inertGroups` option resolves is only present on
|
|
160
|
-
// Safari using VoiceOver. We should occasionally check back to see whether the bug
|
|
161
|
-
// wasn't resolved in VoiceOver, and if it has, we can remove this and the `inertGroups`
|
|
162
|
-
// option altogether.
|
|
163
|
-
this.inertGroups = platform?.SAFARI || false;
|
|
164
|
-
this.autoActiveFirstOption = !!this._defaults.autoActiveFirstOption;
|
|
165
|
-
this.autoSelectActiveOption = !!this._defaults.autoSelectActiveOption;
|
|
166
|
-
this.requireSelection = !!this._defaults.requireSelection;
|
|
167
|
-
this._hideSingleSelectionIndicator = this._defaults.hideSingleSelectionIndicator ?? false;
|
|
168
|
-
}
|
|
169
|
-
ngAfterContentInit() {
|
|
170
|
-
this._keyManager = new ActiveDescendantKeyManager(this.options)
|
|
171
|
-
.withWrap()
|
|
172
|
-
.skipPredicate(this._skipPredicate);
|
|
173
|
-
this._activeOptionChanges = this._keyManager.change.subscribe(index => {
|
|
174
|
-
if (this.isOpen) {
|
|
175
|
-
this.optionActivated.emit({ source: this, option: this.options.toArray()[index] || null });
|
|
176
|
-
}
|
|
100
|
+
}
|
|
101
|
+
id = inject(_IdGenerator).getId('mat-autocomplete-');
|
|
102
|
+
inertGroups;
|
|
103
|
+
constructor() {
|
|
104
|
+
const platform = inject(Platform);
|
|
105
|
+
this.inertGroups = platform?.SAFARI || false;
|
|
106
|
+
this.autoActiveFirstOption = !!this._defaults.autoActiveFirstOption;
|
|
107
|
+
this.autoSelectActiveOption = !!this._defaults.autoSelectActiveOption;
|
|
108
|
+
this.requireSelection = !!this._defaults.requireSelection;
|
|
109
|
+
this._hideSingleSelectionIndicator = this._defaults.hideSingleSelectionIndicator ?? false;
|
|
110
|
+
}
|
|
111
|
+
ngAfterContentInit() {
|
|
112
|
+
this._keyManager = new ActiveDescendantKeyManager(this.options).withWrap().skipPredicate(this._skipPredicate);
|
|
113
|
+
this._activeOptionChanges = this._keyManager.change.subscribe(index => {
|
|
114
|
+
if (this.isOpen) {
|
|
115
|
+
this.optionActivated.emit({
|
|
116
|
+
source: this,
|
|
117
|
+
option: this.options.toArray()[index] || null
|
|
177
118
|
});
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
_setScrollTop(scrollTop) {
|
|
190
|
-
if (this.panel) {
|
|
191
|
-
this.panel.nativeElement.scrollTop = scrollTop;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
/** Returns the panel's scrollTop. */
|
|
195
|
-
_getScrollTop() {
|
|
196
|
-
return this.panel ? this.panel.nativeElement.scrollTop : 0;
|
|
197
|
-
}
|
|
198
|
-
/** Panel should hide itself when the option list is empty. */
|
|
199
|
-
_setVisibility() {
|
|
200
|
-
this.showPanel = !!this.options?.length;
|
|
201
|
-
this._changeDetectorRef.markForCheck();
|
|
202
|
-
}
|
|
203
|
-
/** Emits the `select` event. */
|
|
204
|
-
_emitSelectEvent(option) {
|
|
205
|
-
const event = new MatAutocompleteSelectedEvent(this, option);
|
|
206
|
-
this.optionSelected.emit(event);
|
|
207
|
-
}
|
|
208
|
-
/** Gets the aria-labelledby for the autocomplete panel. */
|
|
209
|
-
_getPanelAriaLabelledby(labelId) {
|
|
210
|
-
if (this.ariaLabel) {
|
|
211
|
-
return null;
|
|
212
|
-
}
|
|
213
|
-
const labelExpression = labelId ? labelId + ' ' : '';
|
|
214
|
-
return this.ariaLabelledby ? labelExpression + this.ariaLabelledby : labelId;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
this._setVisibility();
|
|
122
|
+
}
|
|
123
|
+
ngOnDestroy() {
|
|
124
|
+
this._keyManager?.destroy();
|
|
125
|
+
this._activeOptionChanges.unsubscribe();
|
|
126
|
+
}
|
|
127
|
+
_setScrollTop(scrollTop) {
|
|
128
|
+
if (this.panel) {
|
|
129
|
+
this.panel.nativeElement.scrollTop = scrollTop;
|
|
215
130
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
return false;
|
|
131
|
+
}
|
|
132
|
+
_getScrollTop() {
|
|
133
|
+
return this.panel ? this.panel.nativeElement.scrollTop : 0;
|
|
134
|
+
}
|
|
135
|
+
_setVisibility() {
|
|
136
|
+
this.showPanel = !!this.options?.length;
|
|
137
|
+
this._changeDetectorRef.markForCheck();
|
|
138
|
+
}
|
|
139
|
+
_emitSelectEvent(option) {
|
|
140
|
+
const event = new MatAutocompleteSelectedEvent(this, option);
|
|
141
|
+
this.optionSelected.emit(event);
|
|
142
|
+
}
|
|
143
|
+
_getPanelAriaLabelledby(labelId) {
|
|
144
|
+
if (this.ariaLabel) {
|
|
145
|
+
return null;
|
|
232
146
|
}
|
|
233
|
-
|
|
234
|
-
|
|
147
|
+
const labelExpression = labelId ? labelId + ' ' : '';
|
|
148
|
+
return this.ariaLabelledby ? labelExpression + this.ariaLabelledby : labelId;
|
|
149
|
+
}
|
|
150
|
+
_skipPredicate() {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
154
|
+
minVersion: "12.0.0",
|
|
155
|
+
version: "20.2.0-next.2",
|
|
156
|
+
ngImport: i0,
|
|
157
|
+
type: MatAutocomplete,
|
|
158
|
+
deps: [],
|
|
159
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
160
|
+
});
|
|
161
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
162
|
+
minVersion: "16.1.0",
|
|
163
|
+
version: "20.2.0-next.2",
|
|
164
|
+
type: MatAutocomplete,
|
|
165
|
+
isStandalone: true,
|
|
166
|
+
selector: "mat-autocomplete",
|
|
167
|
+
inputs: {
|
|
168
|
+
ariaLabel: ["aria-label", "ariaLabel"],
|
|
169
|
+
ariaLabelledby: ["aria-labelledby", "ariaLabelledby"],
|
|
170
|
+
displayWith: "displayWith",
|
|
171
|
+
autoActiveFirstOption: ["autoActiveFirstOption", "autoActiveFirstOption", booleanAttribute],
|
|
172
|
+
autoSelectActiveOption: ["autoSelectActiveOption", "autoSelectActiveOption", booleanAttribute],
|
|
173
|
+
requireSelection: ["requireSelection", "requireSelection", booleanAttribute],
|
|
174
|
+
panelWidth: "panelWidth",
|
|
175
|
+
disableRipple: ["disableRipple", "disableRipple", booleanAttribute],
|
|
176
|
+
classList: ["class", "classList"],
|
|
177
|
+
hideSingleSelectionIndicator: ["hideSingleSelectionIndicator", "hideSingleSelectionIndicator", booleanAttribute]
|
|
178
|
+
},
|
|
179
|
+
outputs: {
|
|
180
|
+
optionSelected: "optionSelected",
|
|
181
|
+
opened: "opened",
|
|
182
|
+
closed: "closed",
|
|
183
|
+
optionActivated: "optionActivated"
|
|
184
|
+
},
|
|
185
|
+
host: {
|
|
186
|
+
classAttribute: "mat-mdc-autocomplete"
|
|
187
|
+
},
|
|
188
|
+
providers: [{
|
|
189
|
+
provide: MAT_OPTION_PARENT_COMPONENT,
|
|
190
|
+
useExisting: MatAutocomplete
|
|
191
|
+
}],
|
|
192
|
+
queries: [{
|
|
193
|
+
propertyName: "options",
|
|
194
|
+
predicate: MatOption,
|
|
195
|
+
descendants: true
|
|
196
|
+
}, {
|
|
197
|
+
propertyName: "optionGroups",
|
|
198
|
+
predicate: MAT_OPTGROUP,
|
|
199
|
+
descendants: true
|
|
200
|
+
}],
|
|
201
|
+
viewQueries: [{
|
|
202
|
+
propertyName: "template",
|
|
203
|
+
first: true,
|
|
204
|
+
predicate: TemplateRef,
|
|
205
|
+
descendants: true,
|
|
206
|
+
static: true
|
|
207
|
+
}, {
|
|
208
|
+
propertyName: "panel",
|
|
209
|
+
first: true,
|
|
210
|
+
predicate: ["panel"],
|
|
211
|
+
descendants: true
|
|
212
|
+
}],
|
|
213
|
+
exportAs: ["matAutocomplete"],
|
|
214
|
+
ngImport: i0,
|
|
215
|
+
template: "<ng-template let-formFieldId=\"id\">\n <div\n class=\"mat-mdc-autocomplete-panel mdc-menu-surface mdc-menu-surface--open\"\n role=\"listbox\"\n [id]=\"id\"\n [class]=\"_classList\"\n [class.mat-mdc-autocomplete-visible]=\"showPanel\"\n [class.mat-mdc-autocomplete-hidden]=\"!showPanel\"\n [class.mat-autocomplete-panel-animations-enabled]=\"!_animationsDisabled\"\n [class.mat-primary]=\"_color === 'primary'\"\n [class.mat-accent]=\"_color === 'accent'\"\n [class.mat-warn]=\"_color === 'warn'\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"_getPanelAriaLabelledby(formFieldId)\"\n #panel>\n <ng-content></ng-content>\n </div>\n</ng-template>\n",
|
|
216
|
+
styles: ["div.mat-mdc-autocomplete-panel{width:100%;max-height:256px;visibility:hidden;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:relative;border-radius:var(--mat-autocomplete-container-shape, var(--mat-sys-corner-extra-small));box-shadow:var(--mat-autocomplete-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));background-color:var(--mat-autocomplete-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-autocomplete-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel{border-top-left-radius:0;border-top-right-radius:0}.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:center bottom}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible{visibility:visible}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden{visibility:hidden;pointer-events:none}@keyframes _mat-autocomplete-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}.mat-autocomplete-panel-animations-enabled{animation:_mat-autocomplete-enter 120ms cubic-bezier(0, 0, 0.2, 1)}mat-autocomplete{display:none}\n"],
|
|
217
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
218
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
219
|
+
});
|
|
235
220
|
}
|
|
236
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
221
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
222
|
+
minVersion: "12.0.0",
|
|
223
|
+
version: "20.2.0-next.2",
|
|
224
|
+
ngImport: i0,
|
|
225
|
+
type: MatAutocomplete,
|
|
226
|
+
decorators: [{
|
|
227
|
+
type: Component,
|
|
228
|
+
args: [{
|
|
229
|
+
selector: 'mat-autocomplete',
|
|
230
|
+
encapsulation: ViewEncapsulation.None,
|
|
231
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
232
|
+
exportAs: 'matAutocomplete',
|
|
233
|
+
host: {
|
|
234
|
+
'class': 'mat-mdc-autocomplete'
|
|
235
|
+
},
|
|
236
|
+
providers: [{
|
|
237
|
+
provide: MAT_OPTION_PARENT_COMPONENT,
|
|
238
|
+
useExisting: MatAutocomplete
|
|
239
|
+
}],
|
|
240
|
+
template: "<ng-template let-formFieldId=\"id\">\n <div\n class=\"mat-mdc-autocomplete-panel mdc-menu-surface mdc-menu-surface--open\"\n role=\"listbox\"\n [id]=\"id\"\n [class]=\"_classList\"\n [class.mat-mdc-autocomplete-visible]=\"showPanel\"\n [class.mat-mdc-autocomplete-hidden]=\"!showPanel\"\n [class.mat-autocomplete-panel-animations-enabled]=\"!_animationsDisabled\"\n [class.mat-primary]=\"_color === 'primary'\"\n [class.mat-accent]=\"_color === 'accent'\"\n [class.mat-warn]=\"_color === 'warn'\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"_getPanelAriaLabelledby(formFieldId)\"\n #panel>\n <ng-content></ng-content>\n </div>\n</ng-template>\n",
|
|
241
|
+
styles: ["div.mat-mdc-autocomplete-panel{width:100%;max-height:256px;visibility:hidden;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:relative;border-radius:var(--mat-autocomplete-container-shape, var(--mat-sys-corner-extra-small));box-shadow:var(--mat-autocomplete-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));background-color:var(--mat-autocomplete-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-autocomplete-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel{border-top-left-radius:0;border-top-right-radius:0}.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:center bottom}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible{visibility:visible}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden{visibility:hidden;pointer-events:none}@keyframes _mat-autocomplete-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}.mat-autocomplete-panel-animations-enabled{animation:_mat-autocomplete-enter 120ms cubic-bezier(0, 0, 0.2, 1)}mat-autocomplete{display:none}\n"]
|
|
242
|
+
}]
|
|
243
|
+
}],
|
|
244
|
+
ctorParameters: () => [],
|
|
245
|
+
propDecorators: {
|
|
246
|
+
template: [{
|
|
247
|
+
type: ViewChild,
|
|
248
|
+
args: [TemplateRef, {
|
|
249
|
+
static: true
|
|
250
|
+
}]
|
|
251
|
+
}],
|
|
252
|
+
panel: [{
|
|
253
|
+
type: ViewChild,
|
|
254
|
+
args: ['panel']
|
|
255
|
+
}],
|
|
256
|
+
options: [{
|
|
257
|
+
type: ContentChildren,
|
|
258
|
+
args: [MatOption, {
|
|
259
|
+
descendants: true
|
|
260
|
+
}]
|
|
261
|
+
}],
|
|
262
|
+
optionGroups: [{
|
|
263
|
+
type: ContentChildren,
|
|
264
|
+
args: [MAT_OPTGROUP, {
|
|
265
|
+
descendants: true
|
|
266
|
+
}]
|
|
267
|
+
}],
|
|
268
|
+
ariaLabel: [{
|
|
269
|
+
type: Input,
|
|
270
|
+
args: ['aria-label']
|
|
271
|
+
}],
|
|
272
|
+
ariaLabelledby: [{
|
|
273
|
+
type: Input,
|
|
274
|
+
args: ['aria-labelledby']
|
|
275
|
+
}],
|
|
276
|
+
displayWith: [{
|
|
277
|
+
type: Input
|
|
278
|
+
}],
|
|
279
|
+
autoActiveFirstOption: [{
|
|
280
|
+
type: Input,
|
|
281
|
+
args: [{
|
|
282
|
+
transform: booleanAttribute
|
|
283
|
+
}]
|
|
284
|
+
}],
|
|
285
|
+
autoSelectActiveOption: [{
|
|
286
|
+
type: Input,
|
|
287
|
+
args: [{
|
|
288
|
+
transform: booleanAttribute
|
|
289
|
+
}]
|
|
290
|
+
}],
|
|
291
|
+
requireSelection: [{
|
|
292
|
+
type: Input,
|
|
293
|
+
args: [{
|
|
294
|
+
transform: booleanAttribute
|
|
295
|
+
}]
|
|
296
|
+
}],
|
|
297
|
+
panelWidth: [{
|
|
298
|
+
type: Input
|
|
299
|
+
}],
|
|
300
|
+
disableRipple: [{
|
|
301
|
+
type: Input,
|
|
302
|
+
args: [{
|
|
303
|
+
transform: booleanAttribute
|
|
304
|
+
}]
|
|
305
|
+
}],
|
|
306
|
+
optionSelected: [{
|
|
307
|
+
type: Output
|
|
308
|
+
}],
|
|
309
|
+
opened: [{
|
|
310
|
+
type: Output
|
|
311
|
+
}],
|
|
312
|
+
closed: [{
|
|
313
|
+
type: Output
|
|
314
|
+
}],
|
|
315
|
+
optionActivated: [{
|
|
316
|
+
type: Output
|
|
317
|
+
}],
|
|
318
|
+
classList: [{
|
|
319
|
+
type: Input,
|
|
320
|
+
args: ['class']
|
|
321
|
+
}],
|
|
322
|
+
hideSingleSelectionIndicator: [{
|
|
323
|
+
type: Input,
|
|
324
|
+
args: [{
|
|
325
|
+
transform: booleanAttribute
|
|
326
|
+
}]
|
|
327
|
+
}]
|
|
328
|
+
}
|
|
329
|
+
});
|
|
290
330
|
|
|
291
|
-
/**
|
|
292
|
-
* Directive applied to an element to make it usable
|
|
293
|
-
* as a connection point for an autocomplete panel.
|
|
294
|
-
*/
|
|
295
331
|
class MatAutocompleteOrigin {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
332
|
+
elementRef = inject(ElementRef);
|
|
333
|
+
constructor() {}
|
|
334
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
335
|
+
minVersion: "12.0.0",
|
|
336
|
+
version: "20.2.0-next.2",
|
|
337
|
+
ngImport: i0,
|
|
338
|
+
type: MatAutocompleteOrigin,
|
|
339
|
+
deps: [],
|
|
340
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
341
|
+
});
|
|
342
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
343
|
+
minVersion: "14.0.0",
|
|
344
|
+
version: "20.2.0-next.2",
|
|
345
|
+
type: MatAutocompleteOrigin,
|
|
346
|
+
isStandalone: true,
|
|
347
|
+
selector: "[matAutocompleteOrigin]",
|
|
348
|
+
exportAs: ["matAutocompleteOrigin"],
|
|
349
|
+
ngImport: i0
|
|
350
|
+
});
|
|
300
351
|
}
|
|
301
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
352
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
353
|
+
minVersion: "12.0.0",
|
|
354
|
+
version: "20.2.0-next.2",
|
|
355
|
+
ngImport: i0,
|
|
356
|
+
type: MatAutocompleteOrigin,
|
|
357
|
+
decorators: [{
|
|
358
|
+
type: Directive,
|
|
359
|
+
args: [{
|
|
360
|
+
selector: '[matAutocompleteOrigin]',
|
|
361
|
+
exportAs: 'matAutocompleteOrigin'
|
|
362
|
+
}]
|
|
363
|
+
}],
|
|
364
|
+
ctorParameters: () => []
|
|
365
|
+
});
|
|
308
366
|
|
|
309
|
-
/**
|
|
310
|
-
* Provider that allows the autocomplete to register as a ControlValueAccessor.
|
|
311
|
-
* @docs-private
|
|
312
|
-
*/
|
|
313
367
|
const MAT_AUTOCOMPLETE_VALUE_ACCESSOR = {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
368
|
+
provide: NG_VALUE_ACCESSOR,
|
|
369
|
+
useExisting: forwardRef(() => MatAutocompleteTrigger),
|
|
370
|
+
multi: true
|
|
317
371
|
};
|
|
318
|
-
/**
|
|
319
|
-
* Creates an error to be thrown when attempting to use an autocomplete trigger without a panel.
|
|
320
|
-
* @docs-private
|
|
321
|
-
*/
|
|
322
372
|
function getMatAutocompleteMissingPanelError() {
|
|
323
|
-
|
|
324
|
-
'Make sure that the id passed to the `matAutocomplete` is correct and that ' +
|
|
325
|
-
"you're attempting to open it after the ngAfterContentInit hook.");
|
|
373
|
+
return Error('Attempting to open an undefined instance of `mat-autocomplete`. ' + 'Make sure that the id passed to the `matAutocomplete` is correct and that ' + "you're attempting to open it after the ngAfterContentInit hook.");
|
|
326
374
|
}
|
|
327
|
-
/** Injection token that determines the scroll handling while the autocomplete panel is open. */
|
|
328
375
|
const MAT_AUTOCOMPLETE_SCROLL_STRATEGY = new InjectionToken('mat-autocomplete-scroll-strategy', {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
376
|
+
providedIn: 'root',
|
|
377
|
+
factory: () => {
|
|
378
|
+
const injector = inject(Injector);
|
|
379
|
+
return () => createRepositionScrollStrategy(injector);
|
|
380
|
+
}
|
|
334
381
|
});
|
|
335
|
-
/** Base class with all of the `MatAutocompleteTrigger` functionality. */
|
|
336
382
|
class MatAutocompleteTrigger {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
_canOpenOnNextFocus =
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
this.
|
|
400
|
-
|
|
401
|
-
/** `View -> model callback called when value changes` */
|
|
402
|
-
_onChange = () => { };
|
|
403
|
-
/** `View -> model callback called when autocomplete has been touched` */
|
|
404
|
-
_onTouched = () => { };
|
|
405
|
-
/** The autocomplete panel to be attached to this trigger. */
|
|
406
|
-
autocomplete;
|
|
407
|
-
/**
|
|
408
|
-
* Position of the autocomplete panel relative to the trigger element. A position of `auto`
|
|
409
|
-
* will render the panel underneath the trigger if there is enough space for it to fit in
|
|
410
|
-
* the viewport, otherwise the panel will be shown above it. If the position is set to
|
|
411
|
-
* `above` or `below`, the panel will always be shown above or below the trigger. no matter
|
|
412
|
-
* whether it fits completely in the viewport.
|
|
413
|
-
*/
|
|
414
|
-
position = 'auto';
|
|
415
|
-
/**
|
|
416
|
-
* Reference relative to which to position the autocomplete panel.
|
|
417
|
-
* Defaults to the autocomplete trigger element.
|
|
418
|
-
*/
|
|
419
|
-
connectedTo;
|
|
420
|
-
/**
|
|
421
|
-
* `autocomplete` attribute to be set on the input element.
|
|
422
|
-
* @docs-private
|
|
423
|
-
*/
|
|
424
|
-
autocompleteAttribute = 'off';
|
|
425
|
-
/**
|
|
426
|
-
* Whether the autocomplete is disabled. When disabled, the element will
|
|
427
|
-
* act as a regular input and the user won't be able to open the panel.
|
|
428
|
-
*/
|
|
429
|
-
autocompleteDisabled;
|
|
430
|
-
constructor() { }
|
|
431
|
-
/** Class to apply to the panel when it's above the input. */
|
|
432
|
-
_aboveClass = 'mat-mdc-autocomplete-panel-above';
|
|
433
|
-
ngAfterViewInit() {
|
|
434
|
-
this._initialized.next();
|
|
435
|
-
this._initialized.complete();
|
|
436
|
-
this._cleanupWindowBlur = this._renderer.listen('window', 'blur', this._windowBlurHandler);
|
|
437
|
-
}
|
|
438
|
-
ngOnChanges(changes) {
|
|
439
|
-
if (changes['position'] && this._positionStrategy) {
|
|
440
|
-
this._setStrategyPositions(this._positionStrategy);
|
|
441
|
-
if (this.panelOpen) {
|
|
442
|
-
this._overlayRef.updatePosition();
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
ngOnDestroy() {
|
|
447
|
-
this._cleanupWindowBlur?.();
|
|
448
|
-
this._handsetLandscapeSubscription.unsubscribe();
|
|
449
|
-
this._viewportSubscription.unsubscribe();
|
|
450
|
-
this._componentDestroyed = true;
|
|
451
|
-
this._destroyPanel();
|
|
452
|
-
this._closeKeyEventStream.complete();
|
|
453
|
-
this._clearFromModal();
|
|
454
|
-
}
|
|
455
|
-
/** Whether or not the autocomplete panel is open. */
|
|
456
|
-
get panelOpen() {
|
|
457
|
-
return this._overlayAttached && this.autocomplete.showPanel;
|
|
458
|
-
}
|
|
459
|
-
_overlayAttached = false;
|
|
460
|
-
/** Opens the autocomplete suggestion panel. */
|
|
461
|
-
openPanel() {
|
|
462
|
-
this._openPanelInternal();
|
|
383
|
+
_environmentInjector = inject(EnvironmentInjector);
|
|
384
|
+
_element = inject(ElementRef);
|
|
385
|
+
_injector = inject(Injector);
|
|
386
|
+
_viewContainerRef = inject(ViewContainerRef);
|
|
387
|
+
_zone = inject(NgZone);
|
|
388
|
+
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
389
|
+
_dir = inject(Directionality, {
|
|
390
|
+
optional: true
|
|
391
|
+
});
|
|
392
|
+
_formField = inject(MAT_FORM_FIELD, {
|
|
393
|
+
optional: true,
|
|
394
|
+
host: true
|
|
395
|
+
});
|
|
396
|
+
_viewportRuler = inject(ViewportRuler);
|
|
397
|
+
_scrollStrategy = inject(MAT_AUTOCOMPLETE_SCROLL_STRATEGY);
|
|
398
|
+
_renderer = inject(Renderer2);
|
|
399
|
+
_animationsDisabled = _animationsDisabled();
|
|
400
|
+
_defaults = inject(MAT_AUTOCOMPLETE_DEFAULT_OPTIONS, {
|
|
401
|
+
optional: true
|
|
402
|
+
});
|
|
403
|
+
_overlayRef;
|
|
404
|
+
_portal;
|
|
405
|
+
_componentDestroyed = false;
|
|
406
|
+
_initialized = new Subject();
|
|
407
|
+
_keydownSubscription;
|
|
408
|
+
_outsideClickSubscription;
|
|
409
|
+
_cleanupWindowBlur;
|
|
410
|
+
_previousValue;
|
|
411
|
+
_valueOnAttach;
|
|
412
|
+
_valueOnLastKeydown;
|
|
413
|
+
_positionStrategy;
|
|
414
|
+
_manuallyFloatingLabel = false;
|
|
415
|
+
_closingActionsSubscription;
|
|
416
|
+
_viewportSubscription = Subscription.EMPTY;
|
|
417
|
+
_breakpointObserver = inject(BreakpointObserver);
|
|
418
|
+
_handsetLandscapeSubscription = Subscription.EMPTY;
|
|
419
|
+
_canOpenOnNextFocus = true;
|
|
420
|
+
_valueBeforeAutoSelection;
|
|
421
|
+
_pendingAutoselectedOption;
|
|
422
|
+
_closeKeyEventStream = new Subject();
|
|
423
|
+
_overlayPanelClass = coerceArray(this._defaults?.overlayPanelClass || []);
|
|
424
|
+
_windowBlurHandler = () => {
|
|
425
|
+
this._canOpenOnNextFocus = this.panelOpen || !this._hasFocus();
|
|
426
|
+
};
|
|
427
|
+
_onChange = () => {};
|
|
428
|
+
_onTouched = () => {};
|
|
429
|
+
autocomplete;
|
|
430
|
+
position = 'auto';
|
|
431
|
+
connectedTo;
|
|
432
|
+
autocompleteAttribute = 'off';
|
|
433
|
+
autocompleteDisabled;
|
|
434
|
+
constructor() {}
|
|
435
|
+
_aboveClass = 'mat-mdc-autocomplete-panel-above';
|
|
436
|
+
ngAfterViewInit() {
|
|
437
|
+
this._initialized.next();
|
|
438
|
+
this._initialized.complete();
|
|
439
|
+
this._cleanupWindowBlur = this._renderer.listen('window', 'blur', this._windowBlurHandler);
|
|
440
|
+
}
|
|
441
|
+
ngOnChanges(changes) {
|
|
442
|
+
if (changes['position'] && this._positionStrategy) {
|
|
443
|
+
this._setStrategyPositions(this._positionStrategy);
|
|
444
|
+
if (this.panelOpen) {
|
|
445
|
+
this._overlayRef.updatePosition();
|
|
446
|
+
}
|
|
463
447
|
}
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
this._overlayAttached = false;
|
|
486
|
-
this._pendingAutoselectedOption = null;
|
|
487
|
-
if (this._overlayRef && this._overlayRef.hasAttached()) {
|
|
488
|
-
this._overlayRef.detach();
|
|
489
|
-
this._closingActionsSubscription.unsubscribe();
|
|
490
|
-
}
|
|
491
|
-
this._updatePanelState();
|
|
492
|
-
// Note that in some cases this can end up being called after the component is destroyed.
|
|
493
|
-
// Add a check to ensure that we don't try to run change detection on a destroyed view.
|
|
494
|
-
if (!this._componentDestroyed) {
|
|
495
|
-
// We need to trigger change detection manually, because
|
|
496
|
-
// `fromEvent` doesn't seem to do it at the proper time.
|
|
497
|
-
// This ensures that the label is reset when the
|
|
498
|
-
// user clicks outside.
|
|
499
|
-
this._changeDetectorRef.detectChanges();
|
|
500
|
-
}
|
|
501
|
-
// Remove aria-owns attribute when the autocomplete is no longer visible.
|
|
502
|
-
if (this._trackedModal) {
|
|
503
|
-
removeAriaReferencedId(this._trackedModal, 'aria-owns', this.autocomplete.id);
|
|
504
|
-
}
|
|
448
|
+
}
|
|
449
|
+
ngOnDestroy() {
|
|
450
|
+
this._cleanupWindowBlur?.();
|
|
451
|
+
this._handsetLandscapeSubscription.unsubscribe();
|
|
452
|
+
this._viewportSubscription.unsubscribe();
|
|
453
|
+
this._componentDestroyed = true;
|
|
454
|
+
this._destroyPanel();
|
|
455
|
+
this._closeKeyEventStream.complete();
|
|
456
|
+
this._clearFromModal();
|
|
457
|
+
}
|
|
458
|
+
get panelOpen() {
|
|
459
|
+
return this._overlayAttached && this.autocomplete.showPanel;
|
|
460
|
+
}
|
|
461
|
+
_overlayAttached = false;
|
|
462
|
+
openPanel() {
|
|
463
|
+
this._openPanelInternal();
|
|
464
|
+
}
|
|
465
|
+
closePanel() {
|
|
466
|
+
this._resetLabel();
|
|
467
|
+
if (!this._overlayAttached) {
|
|
468
|
+
return;
|
|
505
469
|
}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
updatePosition() {
|
|
511
|
-
if (this._overlayAttached) {
|
|
512
|
-
this._overlayRef.updatePosition();
|
|
513
|
-
}
|
|
470
|
+
if (this.panelOpen) {
|
|
471
|
+
this._zone.run(() => {
|
|
472
|
+
this.autocomplete.closed.emit();
|
|
473
|
+
});
|
|
514
474
|
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
*/
|
|
519
|
-
get panelClosingActions() {
|
|
520
|
-
return merge(this.optionSelections, this.autocomplete._keyManager.tabOut.pipe(filter(() => this._overlayAttached)), this._closeKeyEventStream, this._getOutsideClickStream(), this._overlayRef
|
|
521
|
-
? this._overlayRef.detachments().pipe(filter(() => this._overlayAttached))
|
|
522
|
-
: of()).pipe(
|
|
523
|
-
// Normalize the output so we return a consistent type.
|
|
524
|
-
map(event => (event instanceof MatOptionSelectionChange ? event : null)));
|
|
475
|
+
if (this.autocomplete._latestOpeningTrigger === this) {
|
|
476
|
+
this.autocomplete._isOpen = false;
|
|
477
|
+
this.autocomplete._latestOpeningTrigger = null;
|
|
525
478
|
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
}
|
|
532
|
-
// If there are any subscribers before `ngAfterViewInit`, the `autocomplete` will be undefined.
|
|
533
|
-
// Return a stream that we'll replace with the real one once everything is in place.
|
|
534
|
-
return this._initialized.pipe(switchMap(() => this.optionSelections));
|
|
535
|
-
});
|
|
536
|
-
/** The currently active option, coerced to MatOption type. */
|
|
537
|
-
get activeOption() {
|
|
538
|
-
if (this.autocomplete && this.autocomplete._keyManager) {
|
|
539
|
-
return this.autocomplete._keyManager.activeItem;
|
|
540
|
-
}
|
|
541
|
-
return null;
|
|
479
|
+
this._overlayAttached = false;
|
|
480
|
+
this._pendingAutoselectedOption = null;
|
|
481
|
+
if (this._overlayRef && this._overlayRef.hasAttached()) {
|
|
482
|
+
this._overlayRef.detach();
|
|
483
|
+
this._closingActionsSubscription.unsubscribe();
|
|
542
484
|
}
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
const listener = (event) => {
|
|
547
|
-
// If we're in the Shadow DOM, the event target will be the shadow root, so we have to
|
|
548
|
-
// fall back to check the first element in the path of the click event.
|
|
549
|
-
const clickTarget = _getEventTarget(event);
|
|
550
|
-
const formField = this._formField
|
|
551
|
-
? this._formField.getConnectedOverlayOrigin().nativeElement
|
|
552
|
-
: null;
|
|
553
|
-
const customOrigin = this.connectedTo ? this.connectedTo.elementRef.nativeElement : null;
|
|
554
|
-
if (this._overlayAttached &&
|
|
555
|
-
clickTarget !== this._element.nativeElement &&
|
|
556
|
-
// Normally focus moves inside `mousedown` so this condition will almost always be
|
|
557
|
-
// true. Its main purpose is to handle the case where the input is focused from an
|
|
558
|
-
// outside click which propagates up to the `body` listener within the same sequence
|
|
559
|
-
// and causes the panel to close immediately (see #3106).
|
|
560
|
-
!this._hasFocus() &&
|
|
561
|
-
(!formField || !formField.contains(clickTarget)) &&
|
|
562
|
-
(!customOrigin || !customOrigin.contains(clickTarget)) &&
|
|
563
|
-
!!this._overlayRef &&
|
|
564
|
-
!this._overlayRef.overlayElement.contains(clickTarget)) {
|
|
565
|
-
observer.next(event);
|
|
566
|
-
}
|
|
567
|
-
};
|
|
568
|
-
const cleanups = [
|
|
569
|
-
this._renderer.listen('document', 'click', listener),
|
|
570
|
-
this._renderer.listen('document', 'auxclick', listener),
|
|
571
|
-
this._renderer.listen('document', 'touchend', listener),
|
|
572
|
-
];
|
|
573
|
-
return () => {
|
|
574
|
-
cleanups.forEach(current => current());
|
|
575
|
-
};
|
|
576
|
-
});
|
|
485
|
+
this._updatePanelState();
|
|
486
|
+
if (!this._componentDestroyed) {
|
|
487
|
+
this._changeDetectorRef.detectChanges();
|
|
577
488
|
}
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
Promise.resolve(null).then(() => this._assignOptionValue(value));
|
|
489
|
+
if (this._trackedModal) {
|
|
490
|
+
removeAriaReferencedId(this._trackedModal, 'aria-owns', this.autocomplete.id);
|
|
581
491
|
}
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
492
|
+
}
|
|
493
|
+
updatePosition() {
|
|
494
|
+
if (this._overlayAttached) {
|
|
495
|
+
this._overlayRef.updatePosition();
|
|
585
496
|
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
497
|
+
}
|
|
498
|
+
get panelClosingActions() {
|
|
499
|
+
return merge(this.optionSelections, this.autocomplete._keyManager.tabOut.pipe(filter(() => this._overlayAttached)), this._closeKeyEventStream, this._getOutsideClickStream(), this._overlayRef ? this._overlayRef.detachments().pipe(filter(() => this._overlayAttached)) : of()).pipe(map(event => event instanceof MatOptionSelectionChange ? event : null));
|
|
500
|
+
}
|
|
501
|
+
optionSelections = defer(() => {
|
|
502
|
+
const options = this.autocomplete ? this.autocomplete.options : null;
|
|
503
|
+
if (options) {
|
|
504
|
+
return options.changes.pipe(startWith(options), switchMap(() => merge(...options.map(option => option.onSelectionChange))));
|
|
589
505
|
}
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
506
|
+
return this._initialized.pipe(switchMap(() => this.optionSelections));
|
|
507
|
+
});
|
|
508
|
+
get activeOption() {
|
|
509
|
+
if (this.autocomplete && this.autocomplete._keyManager) {
|
|
510
|
+
return this.autocomplete._keyManager.activeItem;
|
|
593
511
|
}
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
if (
|
|
603
|
-
|
|
604
|
-
}
|
|
605
|
-
this._valueOnLastKeydown = this._element.nativeElement.value;
|
|
606
|
-
if (this.activeOption && keyCode === ENTER && this.panelOpen && !hasModifier) {
|
|
607
|
-
this.activeOption._selectViaInteraction();
|
|
608
|
-
this._resetActiveItem();
|
|
609
|
-
event.preventDefault();
|
|
610
|
-
}
|
|
611
|
-
else if (this.autocomplete) {
|
|
612
|
-
const prevActiveItem = this.autocomplete._keyManager.activeItem;
|
|
613
|
-
const isArrowKey = keyCode === UP_ARROW || keyCode === DOWN_ARROW;
|
|
614
|
-
if (keyCode === TAB || (isArrowKey && !hasModifier && this.panelOpen)) {
|
|
615
|
-
this.autocomplete._keyManager.onKeydown(event);
|
|
616
|
-
}
|
|
617
|
-
else if (isArrowKey && this._canOpen()) {
|
|
618
|
-
this._openPanelInternal(this._valueOnLastKeydown);
|
|
619
|
-
}
|
|
620
|
-
if (isArrowKey || this.autocomplete._keyManager.activeItem !== prevActiveItem) {
|
|
621
|
-
this._scrollToOption(this.autocomplete._keyManager.activeItemIndex || 0);
|
|
622
|
-
if (this.autocomplete.autoSelectActiveOption && this.activeOption) {
|
|
623
|
-
if (!this._pendingAutoselectedOption) {
|
|
624
|
-
this._valueBeforeAutoSelection = this._valueOnLastKeydown;
|
|
625
|
-
}
|
|
626
|
-
this._pendingAutoselectedOption = this.activeOption;
|
|
627
|
-
this._assignOptionValue(this.activeOption.value);
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
_handleInput(event) {
|
|
633
|
-
let target = event.target;
|
|
634
|
-
let value = target.value;
|
|
635
|
-
// Based on `NumberValueAccessor` from forms.
|
|
636
|
-
if (target.type === 'number') {
|
|
637
|
-
value = value == '' ? null : parseFloat(value);
|
|
638
|
-
}
|
|
639
|
-
// If the input has a placeholder, IE will fire the `input` event on page load,
|
|
640
|
-
// focus and blur, in addition to when the user actually changed the value. To
|
|
641
|
-
// filter out all of the extra events, we save the value on focus and between
|
|
642
|
-
// `input` events, and we check whether it changed.
|
|
643
|
-
// See: https://connect.microsoft.com/IE/feedback/details/885747/
|
|
644
|
-
if (this._previousValue !== value) {
|
|
645
|
-
this._previousValue = value;
|
|
646
|
-
this._pendingAutoselectedOption = null;
|
|
647
|
-
// If selection is required we don't write to the CVA while the user is typing.
|
|
648
|
-
// At the end of the selection either the user will have picked something
|
|
649
|
-
// or we'll reset the value back to null.
|
|
650
|
-
if (!this.autocomplete || !this.autocomplete.requireSelection) {
|
|
651
|
-
this._onChange(value);
|
|
652
|
-
}
|
|
653
|
-
if (!value) {
|
|
654
|
-
this._clearPreviousSelectedOption(null, false);
|
|
655
|
-
}
|
|
656
|
-
else if (this.panelOpen && !this.autocomplete.requireSelection) {
|
|
657
|
-
// Note that we don't reset this when `requireSelection` is enabled,
|
|
658
|
-
// because the option will be reset when the panel is closed.
|
|
659
|
-
const selectedOption = this.autocomplete.options?.find(option => option.selected);
|
|
660
|
-
if (selectedOption) {
|
|
661
|
-
const display = this._getDisplayValue(selectedOption.value);
|
|
662
|
-
if (value !== display) {
|
|
663
|
-
selectedOption.deselect(false);
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
if (this._canOpen() && this._hasFocus()) {
|
|
668
|
-
// When the `input` event fires, the input's value will have already changed. This means
|
|
669
|
-
// that if we take the `this._element.nativeElement.value` directly, it'll be one keystroke
|
|
670
|
-
// behind. This can be a problem when the user selects a value, changes a character while
|
|
671
|
-
// the input still has focus and then clicks away (see #28432). To work around it, we
|
|
672
|
-
// capture the value in `keydown` so we can use it here.
|
|
673
|
-
const valueOnAttach = this._valueOnLastKeydown ?? this._element.nativeElement.value;
|
|
674
|
-
this._valueOnLastKeydown = null;
|
|
675
|
-
this._openPanelInternal(valueOnAttach);
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
_handleFocus() {
|
|
680
|
-
if (!this._canOpenOnNextFocus) {
|
|
681
|
-
this._canOpenOnNextFocus = true;
|
|
682
|
-
}
|
|
683
|
-
else if (this._canOpen()) {
|
|
684
|
-
this._previousValue = this._element.nativeElement.value;
|
|
685
|
-
this._attachOverlay(this._previousValue);
|
|
686
|
-
this._floatLabel(true);
|
|
512
|
+
return null;
|
|
513
|
+
}
|
|
514
|
+
_getOutsideClickStream() {
|
|
515
|
+
return new Observable(observer => {
|
|
516
|
+
const listener = event => {
|
|
517
|
+
const clickTarget = _getEventTarget(event);
|
|
518
|
+
const formField = this._formField ? this._formField.getConnectedOverlayOrigin().nativeElement : null;
|
|
519
|
+
const customOrigin = this.connectedTo ? this.connectedTo.elementRef.nativeElement : null;
|
|
520
|
+
if (this._overlayAttached && clickTarget !== this._element.nativeElement && !this._hasFocus() && (!formField || !formField.contains(clickTarget)) && (!customOrigin || !customOrigin.contains(clickTarget)) && !!this._overlayRef && !this._overlayRef.overlayElement.contains(clickTarget)) {
|
|
521
|
+
observer.next(event);
|
|
687
522
|
}
|
|
523
|
+
};
|
|
524
|
+
const cleanups = [this._renderer.listen('document', 'click', listener), this._renderer.listen('document', 'auxclick', listener), this._renderer.listen('document', 'touchend', listener)];
|
|
525
|
+
return () => {
|
|
526
|
+
cleanups.forEach(current => current());
|
|
527
|
+
};
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
writeValue(value) {
|
|
531
|
+
Promise.resolve(null).then(() => this._assignOptionValue(value));
|
|
532
|
+
}
|
|
533
|
+
registerOnChange(fn) {
|
|
534
|
+
this._onChange = fn;
|
|
535
|
+
}
|
|
536
|
+
registerOnTouched(fn) {
|
|
537
|
+
this._onTouched = fn;
|
|
538
|
+
}
|
|
539
|
+
setDisabledState(isDisabled) {
|
|
540
|
+
this._element.nativeElement.disabled = isDisabled;
|
|
541
|
+
}
|
|
542
|
+
_handleKeydown(e) {
|
|
543
|
+
const event = e;
|
|
544
|
+
const keyCode = event.keyCode;
|
|
545
|
+
const hasModifier = hasModifierKey(event);
|
|
546
|
+
if (keyCode === ESCAPE && !hasModifier) {
|
|
547
|
+
event.preventDefault();
|
|
688
548
|
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
549
|
+
this._valueOnLastKeydown = this._element.nativeElement.value;
|
|
550
|
+
if (this.activeOption && keyCode === ENTER && this.panelOpen && !hasModifier) {
|
|
551
|
+
this.activeOption._selectViaInteraction();
|
|
552
|
+
this._resetActiveItem();
|
|
553
|
+
event.preventDefault();
|
|
554
|
+
} else if (this.autocomplete) {
|
|
555
|
+
const prevActiveItem = this.autocomplete._keyManager.activeItem;
|
|
556
|
+
const isArrowKey = keyCode === UP_ARROW || keyCode === DOWN_ARROW;
|
|
557
|
+
if (keyCode === TAB || isArrowKey && !hasModifier && this.panelOpen) {
|
|
558
|
+
this.autocomplete._keyManager.onKeydown(event);
|
|
559
|
+
} else if (isArrowKey && this._canOpen()) {
|
|
560
|
+
this._openPanelInternal(this._valueOnLastKeydown);
|
|
561
|
+
}
|
|
562
|
+
if (isArrowKey || this.autocomplete._keyManager.activeItem !== prevActiveItem) {
|
|
563
|
+
this._scrollToOption(this.autocomplete._keyManager.activeItemIndex || 0);
|
|
564
|
+
if (this.autocomplete.autoSelectActiveOption && this.activeOption) {
|
|
565
|
+
if (!this._pendingAutoselectedOption) {
|
|
566
|
+
this._valueBeforeAutoSelection = this._valueOnLastKeydown;
|
|
567
|
+
}
|
|
568
|
+
this._pendingAutoselectedOption = this.activeOption;
|
|
569
|
+
this._assignOptionValue(this.activeOption.value);
|
|
692
570
|
}
|
|
571
|
+
}
|
|
693
572
|
}
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
573
|
+
}
|
|
574
|
+
_handleInput(event) {
|
|
575
|
+
let target = event.target;
|
|
576
|
+
let value = target.value;
|
|
577
|
+
if (target.type === 'number') {
|
|
578
|
+
value = value == '' ? null : parseFloat(value);
|
|
697
579
|
}
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
580
|
+
if (this._previousValue !== value) {
|
|
581
|
+
this._previousValue = value;
|
|
582
|
+
this._pendingAutoselectedOption = null;
|
|
583
|
+
if (!this.autocomplete || !this.autocomplete.requireSelection) {
|
|
584
|
+
this._onChange(value);
|
|
585
|
+
}
|
|
586
|
+
if (!value) {
|
|
587
|
+
this._clearPreviousSelectedOption(null, false);
|
|
588
|
+
} else if (this.panelOpen && !this.autocomplete.requireSelection) {
|
|
589
|
+
const selectedOption = this.autocomplete.options?.find(option => option.selected);
|
|
590
|
+
if (selectedOption) {
|
|
591
|
+
const display = this._getDisplayValue(selectedOption.value);
|
|
592
|
+
if (value !== display) {
|
|
593
|
+
selectedOption.deselect(false);
|
|
594
|
+
}
|
|
713
595
|
}
|
|
596
|
+
}
|
|
597
|
+
if (this._canOpen() && this._hasFocus()) {
|
|
598
|
+
const valueOnAttach = this._valueOnLastKeydown ?? this._element.nativeElement.value;
|
|
599
|
+
this._valueOnLastKeydown = null;
|
|
600
|
+
this._openPanelInternal(valueOnAttach);
|
|
601
|
+
}
|
|
714
602
|
}
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
603
|
+
}
|
|
604
|
+
_handleFocus() {
|
|
605
|
+
if (!this._canOpenOnNextFocus) {
|
|
606
|
+
this._canOpenOnNextFocus = true;
|
|
607
|
+
} else if (this._canOpen()) {
|
|
608
|
+
this._previousValue = this._element.nativeElement.value;
|
|
609
|
+
this._attachOverlay(this._previousValue);
|
|
610
|
+
this._floatLabel(true);
|
|
723
611
|
}
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
_subscribeToClosingActions() {
|
|
729
|
-
const initialRender = new Observable(subscriber => {
|
|
730
|
-
afterNextRender(() => {
|
|
731
|
-
subscriber.next();
|
|
732
|
-
}, { injector: this._environmentInjector });
|
|
733
|
-
});
|
|
734
|
-
const optionChanges = this.autocomplete.options?.changes.pipe(tap(() => this._positionStrategy.reapplyLastPosition()),
|
|
735
|
-
// Defer emitting to the stream until the next tick, because changing
|
|
736
|
-
// bindings in here will cause "changed after checked" errors.
|
|
737
|
-
delay(0)) ?? of();
|
|
738
|
-
// When the options are initially rendered, and when the option list changes...
|
|
739
|
-
return (merge(initialRender, optionChanges)
|
|
740
|
-
.pipe(
|
|
741
|
-
// create a new stream of panelClosingActions, replacing any previous streams
|
|
742
|
-
// that were created, and flatten it so our stream only emits closing events...
|
|
743
|
-
switchMap(() => this._zone.run(() => {
|
|
744
|
-
// `afterNextRender` always runs outside of the Angular zone, thus we have to re-enter
|
|
745
|
-
// the Angular zone. This will lead to change detection being called outside of the Angular
|
|
746
|
-
// zone and the `autocomplete.opened` will also emit outside of the Angular.
|
|
747
|
-
const wasOpen = this.panelOpen;
|
|
748
|
-
this._resetActiveItem();
|
|
749
|
-
this._updatePanelState();
|
|
750
|
-
this._changeDetectorRef.detectChanges();
|
|
751
|
-
if (this.panelOpen) {
|
|
752
|
-
this._overlayRef.updatePosition();
|
|
753
|
-
}
|
|
754
|
-
if (wasOpen !== this.panelOpen) {
|
|
755
|
-
// If the `panelOpen` state changed, we need to make sure to emit the `opened` or
|
|
756
|
-
// `closed` event, because we may not have emitted it. This can happen
|
|
757
|
-
// - if the users opens the panel and there are no options, but the
|
|
758
|
-
// options come in slightly later or as a result of the value changing,
|
|
759
|
-
// - if the panel is closed after the user entered a string that did not match any
|
|
760
|
-
// of the available options,
|
|
761
|
-
// - if a valid string is entered after an invalid one.
|
|
762
|
-
if (this.panelOpen) {
|
|
763
|
-
this._emitOpened();
|
|
764
|
-
}
|
|
765
|
-
else {
|
|
766
|
-
this.autocomplete.closed.emit();
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
return this.panelClosingActions;
|
|
770
|
-
})),
|
|
771
|
-
// when the first closing event occurs...
|
|
772
|
-
take(1))
|
|
773
|
-
// set the value, close the panel, and complete.
|
|
774
|
-
.subscribe(event => this._setValueAndClose(event)));
|
|
612
|
+
}
|
|
613
|
+
_handleClick() {
|
|
614
|
+
if (this._canOpen() && !this.panelOpen) {
|
|
615
|
+
this._openPanelInternal();
|
|
775
616
|
}
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
617
|
+
}
|
|
618
|
+
_hasFocus() {
|
|
619
|
+
return _getFocusedElementPierceShadowDom() === this._element.nativeElement;
|
|
620
|
+
}
|
|
621
|
+
_floatLabel(shouldAnimate = false) {
|
|
622
|
+
if (this._formField && this._formField.floatLabel === 'auto') {
|
|
623
|
+
if (shouldAnimate) {
|
|
624
|
+
this._formField._animateAndLockLabel();
|
|
625
|
+
} else {
|
|
626
|
+
this._formField.floatLabel = 'always';
|
|
627
|
+
}
|
|
628
|
+
this._manuallyFloatingLabel = true;
|
|
782
629
|
}
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
630
|
+
}
|
|
631
|
+
_resetLabel() {
|
|
632
|
+
if (this._manuallyFloatingLabel) {
|
|
633
|
+
if (this._formField) {
|
|
634
|
+
this._formField.floatLabel = 'auto';
|
|
635
|
+
}
|
|
636
|
+
this._manuallyFloatingLabel = false;
|
|
790
637
|
}
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
638
|
+
}
|
|
639
|
+
_subscribeToClosingActions() {
|
|
640
|
+
const initialRender = new Observable(subscriber => {
|
|
641
|
+
afterNextRender(() => {
|
|
642
|
+
subscriber.next();
|
|
643
|
+
}, {
|
|
644
|
+
injector: this._environmentInjector
|
|
645
|
+
});
|
|
646
|
+
});
|
|
647
|
+
const optionChanges = this.autocomplete.options?.changes.pipe(tap(() => this._positionStrategy.reapplyLastPosition()), delay(0)) ?? of();
|
|
648
|
+
return merge(initialRender, optionChanges).pipe(switchMap(() => this._zone.run(() => {
|
|
649
|
+
const wasOpen = this.panelOpen;
|
|
650
|
+
this._resetActiveItem();
|
|
651
|
+
this._updatePanelState();
|
|
652
|
+
this._changeDetectorRef.detectChanges();
|
|
653
|
+
if (this.panelOpen) {
|
|
654
|
+
this._overlayRef.updatePosition();
|
|
655
|
+
}
|
|
656
|
+
if (wasOpen !== this.panelOpen) {
|
|
657
|
+
if (this.panelOpen) {
|
|
658
|
+
this._emitOpened();
|
|
659
|
+
} else {
|
|
660
|
+
this.autocomplete.closed.emit();
|
|
800
661
|
}
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
662
|
+
}
|
|
663
|
+
return this.panelClosingActions;
|
|
664
|
+
})), take(1)).subscribe(event => this._setValueAndClose(event));
|
|
665
|
+
}
|
|
666
|
+
_emitOpened() {
|
|
667
|
+
this.autocomplete.opened.emit();
|
|
668
|
+
}
|
|
669
|
+
_destroyPanel() {
|
|
670
|
+
if (this._overlayRef) {
|
|
671
|
+
this.closePanel();
|
|
672
|
+
this._overlayRef.dispose();
|
|
673
|
+
this._overlayRef = null;
|
|
804
674
|
}
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
this._previousValue = value;
|
|
675
|
+
}
|
|
676
|
+
_getDisplayValue(value) {
|
|
677
|
+
const autocomplete = this.autocomplete;
|
|
678
|
+
return autocomplete && autocomplete.displayWith ? autocomplete.displayWith(value) : value;
|
|
679
|
+
}
|
|
680
|
+
_assignOptionValue(value) {
|
|
681
|
+
const toDisplay = this._getDisplayValue(value);
|
|
682
|
+
if (value == null) {
|
|
683
|
+
this._clearPreviousSelectedOption(null, false);
|
|
815
684
|
}
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
const toSelect = event ? event.source : this._pendingAutoselectedOption;
|
|
824
|
-
if (toSelect) {
|
|
825
|
-
this._clearPreviousSelectedOption(toSelect);
|
|
826
|
-
this._assignOptionValue(toSelect.value);
|
|
827
|
-
// TODO(crisbeto): this should wait until the animation is done, otherwise the value
|
|
828
|
-
// gets reset while the panel is still animating which looks glitchy. It'll likely break
|
|
829
|
-
// some tests to change it at this point.
|
|
830
|
-
this._onChange(toSelect.value);
|
|
831
|
-
panel._emitSelectEvent(toSelect);
|
|
832
|
-
this._element.nativeElement.focus();
|
|
833
|
-
}
|
|
834
|
-
else if (panel.requireSelection &&
|
|
835
|
-
this._element.nativeElement.value !== this._valueOnAttach) {
|
|
836
|
-
this._clearPreviousSelectedOption(null);
|
|
837
|
-
this._assignOptionValue(null);
|
|
838
|
-
this._onChange(null);
|
|
839
|
-
}
|
|
840
|
-
this.closePanel();
|
|
685
|
+
this._updateNativeInputValue(toDisplay != null ? toDisplay : '');
|
|
686
|
+
}
|
|
687
|
+
_updateNativeInputValue(value) {
|
|
688
|
+
if (this._formField) {
|
|
689
|
+
this._formField._control.value = value;
|
|
690
|
+
} else {
|
|
691
|
+
this._element.nativeElement.value = value;
|
|
841
692
|
}
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
693
|
+
this._previousValue = value;
|
|
694
|
+
}
|
|
695
|
+
_setValueAndClose(event) {
|
|
696
|
+
const panel = this.autocomplete;
|
|
697
|
+
const toSelect = event ? event.source : this._pendingAutoselectedOption;
|
|
698
|
+
if (toSelect) {
|
|
699
|
+
this._clearPreviousSelectedOption(toSelect);
|
|
700
|
+
this._assignOptionValue(toSelect.value);
|
|
701
|
+
this._onChange(toSelect.value);
|
|
702
|
+
panel._emitSelectEvent(toSelect);
|
|
703
|
+
this._element.nativeElement.focus();
|
|
704
|
+
} else if (panel.requireSelection && this._element.nativeElement.value !== this._valueOnAttach) {
|
|
705
|
+
this._clearPreviousSelectedOption(null);
|
|
706
|
+
this._assignOptionValue(null);
|
|
707
|
+
this._onChange(null);
|
|
853
708
|
}
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
709
|
+
this.closePanel();
|
|
710
|
+
}
|
|
711
|
+
_clearPreviousSelectedOption(skip, emitEvent) {
|
|
712
|
+
this.autocomplete?.options?.forEach(option => {
|
|
713
|
+
if (option !== skip && option.selected) {
|
|
714
|
+
option.deselect(emitEvent);
|
|
715
|
+
}
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
_openPanelInternal(valueOnAttach = this._element.nativeElement.value) {
|
|
719
|
+
this._attachOverlay(valueOnAttach);
|
|
720
|
+
this._floatLabel();
|
|
721
|
+
if (this._trackedModal) {
|
|
722
|
+
const panelId = this.autocomplete.id;
|
|
723
|
+
addAriaReferencedId(this._trackedModal, 'aria-owns', panelId);
|
|
862
724
|
}
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
let overlayRef = this._overlayRef;
|
|
868
|
-
if (!overlayRef) {
|
|
869
|
-
this._portal = new TemplatePortal(this.autocomplete.template, this._viewContainerRef, {
|
|
870
|
-
id: this._formField?.getLabelId(),
|
|
871
|
-
});
|
|
872
|
-
overlayRef = createOverlayRef(this._injector, this._getOverlayConfig());
|
|
873
|
-
this._overlayRef = overlayRef;
|
|
874
|
-
this._viewportSubscription = this._viewportRuler.change().subscribe(() => {
|
|
875
|
-
if (this.panelOpen && overlayRef) {
|
|
876
|
-
overlayRef.updateSize({ width: this._getPanelWidth() });
|
|
877
|
-
}
|
|
878
|
-
});
|
|
879
|
-
// Subscribe to the breakpoint events stream to detect when screen is in
|
|
880
|
-
// handsetLandscape.
|
|
881
|
-
this._handsetLandscapeSubscription = this._breakpointObserver
|
|
882
|
-
.observe(Breakpoints.HandsetLandscape)
|
|
883
|
-
.subscribe(result => {
|
|
884
|
-
const isHandsetLandscape = result.matches;
|
|
885
|
-
// Check if result.matches Breakpoints.HandsetLandscape. Apply HandsetLandscape
|
|
886
|
-
// settings to prevent overlay cutoff in that breakpoint. Fixes b/284148377
|
|
887
|
-
if (isHandsetLandscape) {
|
|
888
|
-
this._positionStrategy
|
|
889
|
-
.withFlexibleDimensions(true)
|
|
890
|
-
.withGrowAfterOpen(true)
|
|
891
|
-
.withViewportMargin(8);
|
|
892
|
-
}
|
|
893
|
-
else {
|
|
894
|
-
this._positionStrategy
|
|
895
|
-
.withFlexibleDimensions(false)
|
|
896
|
-
.withGrowAfterOpen(false)
|
|
897
|
-
.withViewportMargin(0);
|
|
898
|
-
}
|
|
899
|
-
});
|
|
900
|
-
}
|
|
901
|
-
else {
|
|
902
|
-
// Update the trigger, panel width and direction, in case anything has changed.
|
|
903
|
-
this._positionStrategy.setOrigin(this._getConnectedElement());
|
|
904
|
-
overlayRef.updateSize({ width: this._getPanelWidth() });
|
|
905
|
-
}
|
|
906
|
-
if (overlayRef && !overlayRef.hasAttached()) {
|
|
907
|
-
overlayRef.attach(this._portal);
|
|
908
|
-
this._valueOnAttach = valueOnAttach;
|
|
909
|
-
this._valueOnLastKeydown = null;
|
|
910
|
-
this._closingActionsSubscription = this._subscribeToClosingActions();
|
|
911
|
-
}
|
|
912
|
-
const wasOpen = this.panelOpen;
|
|
913
|
-
this.autocomplete._isOpen = this._overlayAttached = true;
|
|
914
|
-
this.autocomplete._latestOpeningTrigger = this;
|
|
915
|
-
this.autocomplete._setColor(this._formField?.color);
|
|
916
|
-
this._updatePanelState();
|
|
917
|
-
this._applyModalPanelOwnership();
|
|
918
|
-
// We need to do an extra `panelOpen` check in here, because the
|
|
919
|
-
// autocomplete won't be shown if there are no options.
|
|
920
|
-
if (this.panelOpen && wasOpen !== this.panelOpen) {
|
|
921
|
-
this._emitOpened();
|
|
922
|
-
}
|
|
725
|
+
}
|
|
726
|
+
_attachOverlay(valueOnAttach) {
|
|
727
|
+
if (!this.autocomplete && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
728
|
+
throw getMatAutocompleteMissingPanelError();
|
|
923
729
|
}
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
this._closeKeyEventStream.next();
|
|
937
|
-
this._resetActiveItem();
|
|
938
|
-
// We need to stop propagation, otherwise the event will eventually
|
|
939
|
-
// reach the input itself and cause the overlay to be reopened.
|
|
940
|
-
event.stopPropagation();
|
|
941
|
-
event.preventDefault();
|
|
942
|
-
}
|
|
943
|
-
};
|
|
944
|
-
/** Updates the panel's visibility state and any trigger state tied to id. */
|
|
945
|
-
_updatePanelState() {
|
|
946
|
-
this.autocomplete._setVisibility();
|
|
947
|
-
// Note that here we subscribe and unsubscribe based on the panel's visiblity state,
|
|
948
|
-
// because the act of subscribing will prevent events from reaching other overlays and
|
|
949
|
-
// we don't want to block the events if there are no options.
|
|
950
|
-
if (this.panelOpen) {
|
|
951
|
-
const overlayRef = this._overlayRef;
|
|
952
|
-
if (!this._keydownSubscription) {
|
|
953
|
-
// Use the `keydownEvents` in order to take advantage of
|
|
954
|
-
// the overlay event targeting provided by the CDK overlay.
|
|
955
|
-
this._keydownSubscription = overlayRef.keydownEvents().subscribe(this._handlePanelKeydown);
|
|
956
|
-
}
|
|
957
|
-
if (!this._outsideClickSubscription) {
|
|
958
|
-
// Subscribe to the pointer events stream so that it doesn't get picked up by other overlays.
|
|
959
|
-
// TODO(crisbeto): we should switch `_getOutsideClickStream` eventually to use this stream,
|
|
960
|
-
// but the behvior isn't exactly the same and it ends up breaking some internal tests.
|
|
961
|
-
this._outsideClickSubscription = overlayRef.outsidePointerEvents().subscribe();
|
|
962
|
-
}
|
|
730
|
+
let overlayRef = this._overlayRef;
|
|
731
|
+
if (!overlayRef) {
|
|
732
|
+
this._portal = new TemplatePortal(this.autocomplete.template, this._viewContainerRef, {
|
|
733
|
+
id: this._formField?.getLabelId()
|
|
734
|
+
});
|
|
735
|
+
overlayRef = createOverlayRef(this._injector, this._getOverlayConfig());
|
|
736
|
+
this._overlayRef = overlayRef;
|
|
737
|
+
this._viewportSubscription = this._viewportRuler.change().subscribe(() => {
|
|
738
|
+
if (this.panelOpen && overlayRef) {
|
|
739
|
+
overlayRef.updateSize({
|
|
740
|
+
width: this._getPanelWidth()
|
|
741
|
+
});
|
|
963
742
|
}
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
743
|
+
});
|
|
744
|
+
this._handsetLandscapeSubscription = this._breakpointObserver.observe(Breakpoints.HandsetLandscape).subscribe(result => {
|
|
745
|
+
const isHandsetLandscape = result.matches;
|
|
746
|
+
if (isHandsetLandscape) {
|
|
747
|
+
this._positionStrategy.withFlexibleDimensions(true).withGrowAfterOpen(true).withViewportMargin(8);
|
|
748
|
+
} else {
|
|
749
|
+
this._positionStrategy.withFlexibleDimensions(false).withGrowAfterOpen(false).withViewportMargin(0);
|
|
968
750
|
}
|
|
751
|
+
});
|
|
752
|
+
} else {
|
|
753
|
+
this._positionStrategy.setOrigin(this._getConnectedElement());
|
|
754
|
+
overlayRef.updateSize({
|
|
755
|
+
width: this._getPanelWidth()
|
|
756
|
+
});
|
|
969
757
|
}
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
direction: this._dir ?? undefined,
|
|
976
|
-
hasBackdrop: this._defaults?.hasBackdrop,
|
|
977
|
-
backdropClass: this._defaults?.backdropClass || 'cdk-overlay-transparent-backdrop',
|
|
978
|
-
panelClass: this._overlayPanelClass,
|
|
979
|
-
disableAnimations: this._animationsDisabled,
|
|
980
|
-
});
|
|
758
|
+
if (overlayRef && !overlayRef.hasAttached()) {
|
|
759
|
+
overlayRef.attach(this._portal);
|
|
760
|
+
this._valueOnAttach = valueOnAttach;
|
|
761
|
+
this._valueOnLastKeydown = null;
|
|
762
|
+
this._closingActionsSubscription = this._subscribeToClosingActions();
|
|
981
763
|
}
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
764
|
+
const wasOpen = this.panelOpen;
|
|
765
|
+
this.autocomplete._isOpen = this._overlayAttached = true;
|
|
766
|
+
this.autocomplete._latestOpeningTrigger = this;
|
|
767
|
+
this.autocomplete._setColor(this._formField?.color);
|
|
768
|
+
this._updatePanelState();
|
|
769
|
+
this._applyModalPanelOwnership();
|
|
770
|
+
if (this.panelOpen && wasOpen !== this.panelOpen) {
|
|
771
|
+
this._emitOpened();
|
|
990
772
|
}
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
const panelClass = this._aboveClass;
|
|
1003
|
-
const abovePositions = [
|
|
1004
|
-
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', panelClass },
|
|
1005
|
-
{ originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', panelClass },
|
|
1006
|
-
];
|
|
1007
|
-
let positions;
|
|
1008
|
-
if (this.position === 'above') {
|
|
1009
|
-
positions = abovePositions;
|
|
1010
|
-
}
|
|
1011
|
-
else if (this.position === 'below') {
|
|
1012
|
-
positions = belowPositions;
|
|
1013
|
-
}
|
|
1014
|
-
else {
|
|
1015
|
-
positions = [...belowPositions, ...abovePositions];
|
|
1016
|
-
}
|
|
1017
|
-
positionStrategy.withPositions(positions);
|
|
773
|
+
}
|
|
774
|
+
_handlePanelKeydown = event => {
|
|
775
|
+
if (event.keyCode === ESCAPE && !hasModifierKey(event) || event.keyCode === UP_ARROW && hasModifierKey(event, 'altKey')) {
|
|
776
|
+
if (this._pendingAutoselectedOption) {
|
|
777
|
+
this._updateNativeInputValue(this._valueBeforeAutoSelection ?? '');
|
|
778
|
+
this._pendingAutoselectedOption = null;
|
|
779
|
+
}
|
|
780
|
+
this._closeKeyEventStream.next();
|
|
781
|
+
this._resetActiveItem();
|
|
782
|
+
event.stopPropagation();
|
|
783
|
+
event.preventDefault();
|
|
1018
784
|
}
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
785
|
+
};
|
|
786
|
+
_updatePanelState() {
|
|
787
|
+
this.autocomplete._setVisibility();
|
|
788
|
+
if (this.panelOpen) {
|
|
789
|
+
const overlayRef = this._overlayRef;
|
|
790
|
+
if (!this._keydownSubscription) {
|
|
791
|
+
this._keydownSubscription = overlayRef.keydownEvents().subscribe(this._handlePanelKeydown);
|
|
792
|
+
}
|
|
793
|
+
if (!this._outsideClickSubscription) {
|
|
794
|
+
this._outsideClickSubscription = overlayRef.outsidePointerEvents().subscribe();
|
|
795
|
+
}
|
|
796
|
+
} else {
|
|
797
|
+
this._keydownSubscription?.unsubscribe();
|
|
798
|
+
this._outsideClickSubscription?.unsubscribe();
|
|
799
|
+
this._keydownSubscription = this._outsideClickSubscription = null;
|
|
1024
800
|
}
|
|
1025
|
-
|
|
1026
|
-
|
|
801
|
+
}
|
|
802
|
+
_getOverlayConfig() {
|
|
803
|
+
return new OverlayConfig({
|
|
804
|
+
positionStrategy: this._getOverlayPosition(),
|
|
805
|
+
scrollStrategy: this._scrollStrategy(),
|
|
806
|
+
width: this._getPanelWidth(),
|
|
807
|
+
direction: this._dir ?? undefined,
|
|
808
|
+
hasBackdrop: this._defaults?.hasBackdrop,
|
|
809
|
+
backdropClass: this._defaults?.backdropClass || 'cdk-overlay-transparent-backdrop',
|
|
810
|
+
panelClass: this._overlayPanelClass,
|
|
811
|
+
disableAnimations: this._animationsDisabled
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
_getOverlayPosition() {
|
|
815
|
+
const strategy = createFlexibleConnectedPositionStrategy(this._injector, this._getConnectedElement()).withFlexibleDimensions(false).withPush(false);
|
|
816
|
+
this._setStrategyPositions(strategy);
|
|
817
|
+
this._positionStrategy = strategy;
|
|
818
|
+
return strategy;
|
|
819
|
+
}
|
|
820
|
+
_setStrategyPositions(positionStrategy) {
|
|
821
|
+
const belowPositions = [{
|
|
822
|
+
originX: 'start',
|
|
823
|
+
originY: 'bottom',
|
|
824
|
+
overlayX: 'start',
|
|
825
|
+
overlayY: 'top'
|
|
826
|
+
}, {
|
|
827
|
+
originX: 'end',
|
|
828
|
+
originY: 'bottom',
|
|
829
|
+
overlayX: 'end',
|
|
830
|
+
overlayY: 'top'
|
|
831
|
+
}];
|
|
832
|
+
const panelClass = this._aboveClass;
|
|
833
|
+
const abovePositions = [{
|
|
834
|
+
originX: 'start',
|
|
835
|
+
originY: 'top',
|
|
836
|
+
overlayX: 'start',
|
|
837
|
+
overlayY: 'bottom',
|
|
838
|
+
panelClass
|
|
839
|
+
}, {
|
|
840
|
+
originX: 'end',
|
|
841
|
+
originY: 'top',
|
|
842
|
+
overlayX: 'end',
|
|
843
|
+
overlayY: 'bottom',
|
|
844
|
+
panelClass
|
|
845
|
+
}];
|
|
846
|
+
let positions;
|
|
847
|
+
if (this.position === 'above') {
|
|
848
|
+
positions = abovePositions;
|
|
849
|
+
} else if (this.position === 'below') {
|
|
850
|
+
positions = belowPositions;
|
|
851
|
+
} else {
|
|
852
|
+
positions = [...belowPositions, ...abovePositions];
|
|
1027
853
|
}
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
854
|
+
positionStrategy.withPositions(positions);
|
|
855
|
+
}
|
|
856
|
+
_getConnectedElement() {
|
|
857
|
+
if (this.connectedTo) {
|
|
858
|
+
return this.connectedTo.elementRef;
|
|
1031
859
|
}
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
firstEnabledOptionIndex = index;
|
|
1050
|
-
break;
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
autocomplete._keyManager.setActiveItem(firstEnabledOptionIndex);
|
|
1054
|
-
}
|
|
1055
|
-
else {
|
|
1056
|
-
autocomplete._keyManager.setActiveItem(-1);
|
|
860
|
+
return this._formField ? this._formField.getConnectedOverlayOrigin() : this._element;
|
|
861
|
+
}
|
|
862
|
+
_getPanelWidth() {
|
|
863
|
+
return this.autocomplete.panelWidth || this._getHostWidth();
|
|
864
|
+
}
|
|
865
|
+
_getHostWidth() {
|
|
866
|
+
return this._getConnectedElement().nativeElement.getBoundingClientRect().width;
|
|
867
|
+
}
|
|
868
|
+
_resetActiveItem() {
|
|
869
|
+
const autocomplete = this.autocomplete;
|
|
870
|
+
if (autocomplete.autoActiveFirstOption) {
|
|
871
|
+
let firstEnabledOptionIndex = -1;
|
|
872
|
+
for (let index = 0; index < autocomplete.options.length; index++) {
|
|
873
|
+
const option = autocomplete.options.get(index);
|
|
874
|
+
if (!option.disabled) {
|
|
875
|
+
firstEnabledOptionIndex = index;
|
|
876
|
+
break;
|
|
1057
877
|
}
|
|
878
|
+
}
|
|
879
|
+
autocomplete._keyManager.setActiveItem(firstEnabledOptionIndex);
|
|
880
|
+
} else {
|
|
881
|
+
autocomplete._keyManager.setActiveItem(-1);
|
|
1058
882
|
}
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
883
|
+
}
|
|
884
|
+
_canOpen() {
|
|
885
|
+
const element = this._element.nativeElement;
|
|
886
|
+
return !element.readOnly && !element.disabled && !this.autocompleteDisabled;
|
|
887
|
+
}
|
|
888
|
+
_scrollToOption(index) {
|
|
889
|
+
const autocomplete = this.autocomplete;
|
|
890
|
+
const labelCount = _countGroupLabelsBeforeOption(index, autocomplete.options, autocomplete.optionGroups);
|
|
891
|
+
if (index === 0 && labelCount === 1) {
|
|
892
|
+
autocomplete._setScrollTop(0);
|
|
893
|
+
} else if (autocomplete.panel) {
|
|
894
|
+
const option = autocomplete.options.toArray()[index];
|
|
895
|
+
if (option) {
|
|
896
|
+
const element = option._getHostElement();
|
|
897
|
+
const newScrollPosition = _getOptionScrollPosition(element.offsetTop, element.offsetHeight, autocomplete._getScrollTop(), autocomplete.panel.nativeElement.offsetHeight);
|
|
898
|
+
autocomplete._setScrollTop(newScrollPosition);
|
|
899
|
+
}
|
|
1063
900
|
}
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
// bottom of the panel. If that offset is above the top of the visible panel, the new scrollTop
|
|
1071
|
-
// will become the offset. If that offset is visible within the panel already, the scrollTop is
|
|
1072
|
-
// not adjusted.
|
|
1073
|
-
const autocomplete = this.autocomplete;
|
|
1074
|
-
const labelCount = _countGroupLabelsBeforeOption(index, autocomplete.options, autocomplete.optionGroups);
|
|
1075
|
-
if (index === 0 && labelCount === 1) {
|
|
1076
|
-
// If we've got one group label before the option and we're at the top option,
|
|
1077
|
-
// scroll the list to the top. This is better UX than scrolling the list to the
|
|
1078
|
-
// top of the option, because it allows the user to read the top group's label.
|
|
1079
|
-
autocomplete._setScrollTop(0);
|
|
1080
|
-
}
|
|
1081
|
-
else if (autocomplete.panel) {
|
|
1082
|
-
const option = autocomplete.options.toArray()[index];
|
|
1083
|
-
if (option) {
|
|
1084
|
-
const element = option._getHostElement();
|
|
1085
|
-
const newScrollPosition = _getOptionScrollPosition(element.offsetTop, element.offsetHeight, autocomplete._getScrollTop(), autocomplete.panel.nativeElement.offsetHeight);
|
|
1086
|
-
autocomplete._setScrollTop(newScrollPosition);
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
901
|
+
}
|
|
902
|
+
_trackedModal = null;
|
|
903
|
+
_applyModalPanelOwnership() {
|
|
904
|
+
const modal = this._element.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');
|
|
905
|
+
if (!modal) {
|
|
906
|
+
return;
|
|
1089
907
|
}
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
* panel. Track the modal we have changed so we can undo the changes on destroy.
|
|
1094
|
-
*/
|
|
1095
|
-
_trackedModal = null;
|
|
1096
|
-
/**
|
|
1097
|
-
* If the autocomplete trigger is inside of an `aria-modal` element, connect
|
|
1098
|
-
* that modal to the options panel with `aria-owns`.
|
|
1099
|
-
*
|
|
1100
|
-
* For some browser + screen reader combinations, when navigation is inside
|
|
1101
|
-
* of an `aria-modal` element, the screen reader treats everything outside
|
|
1102
|
-
* of that modal as hidden or invisible.
|
|
1103
|
-
*
|
|
1104
|
-
* This causes a problem when the combobox trigger is _inside_ of a modal, because the
|
|
1105
|
-
* options panel is rendered _outside_ of that modal, preventing screen reader navigation
|
|
1106
|
-
* from reaching the panel.
|
|
1107
|
-
*
|
|
1108
|
-
* We can work around this issue by applying `aria-owns` to the modal with the `id` of
|
|
1109
|
-
* the options panel. This effectively communicates to assistive technology that the
|
|
1110
|
-
* options panel is part of the same interaction as the modal.
|
|
1111
|
-
*
|
|
1112
|
-
* At time of this writing, this issue is present in VoiceOver.
|
|
1113
|
-
* See https://github.com/angular/components/issues/20694
|
|
1114
|
-
*/
|
|
1115
|
-
_applyModalPanelOwnership() {
|
|
1116
|
-
// TODO(http://github.com/angular/components/issues/26853): consider de-duplicating this with
|
|
1117
|
-
// the `LiveAnnouncer` and any other usages.
|
|
1118
|
-
//
|
|
1119
|
-
// Note that the selector here is limited to CDK overlays at the moment in order to reduce the
|
|
1120
|
-
// section of the DOM we need to look through. This should cover all the cases we support, but
|
|
1121
|
-
// the selector can be expanded if it turns out to be too narrow.
|
|
1122
|
-
const modal = this._element.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');
|
|
1123
|
-
if (!modal) {
|
|
1124
|
-
// Most commonly, the autocomplete trigger is not inside a modal.
|
|
1125
|
-
return;
|
|
1126
|
-
}
|
|
1127
|
-
const panelId = this.autocomplete.id;
|
|
1128
|
-
if (this._trackedModal) {
|
|
1129
|
-
removeAriaReferencedId(this._trackedModal, 'aria-owns', panelId);
|
|
1130
|
-
}
|
|
1131
|
-
addAriaReferencedId(modal, 'aria-owns', panelId);
|
|
1132
|
-
this._trackedModal = modal;
|
|
908
|
+
const panelId = this.autocomplete.id;
|
|
909
|
+
if (this._trackedModal) {
|
|
910
|
+
removeAriaReferencedId(this._trackedModal, 'aria-owns', panelId);
|
|
1133
911
|
}
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
912
|
+
addAriaReferencedId(modal, 'aria-owns', panelId);
|
|
913
|
+
this._trackedModal = modal;
|
|
914
|
+
}
|
|
915
|
+
_clearFromModal() {
|
|
916
|
+
if (this._trackedModal) {
|
|
917
|
+
const panelId = this.autocomplete.id;
|
|
918
|
+
removeAriaReferencedId(this._trackedModal, 'aria-owns', panelId);
|
|
919
|
+
this._trackedModal = null;
|
|
1141
920
|
}
|
|
1142
|
-
|
|
1143
|
-
|
|
921
|
+
}
|
|
922
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
923
|
+
minVersion: "12.0.0",
|
|
924
|
+
version: "20.2.0-next.2",
|
|
925
|
+
ngImport: i0,
|
|
926
|
+
type: MatAutocompleteTrigger,
|
|
927
|
+
deps: [],
|
|
928
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
929
|
+
});
|
|
930
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
931
|
+
minVersion: "16.1.0",
|
|
932
|
+
version: "20.2.0-next.2",
|
|
933
|
+
type: MatAutocompleteTrigger,
|
|
934
|
+
isStandalone: true,
|
|
935
|
+
selector: "input[matAutocomplete], textarea[matAutocomplete]",
|
|
936
|
+
inputs: {
|
|
937
|
+
autocomplete: ["matAutocomplete", "autocomplete"],
|
|
938
|
+
position: ["matAutocompletePosition", "position"],
|
|
939
|
+
connectedTo: ["matAutocompleteConnectedTo", "connectedTo"],
|
|
940
|
+
autocompleteAttribute: ["autocomplete", "autocompleteAttribute"],
|
|
941
|
+
autocompleteDisabled: ["matAutocompleteDisabled", "autocompleteDisabled", booleanAttribute]
|
|
942
|
+
},
|
|
943
|
+
host: {
|
|
944
|
+
listeners: {
|
|
945
|
+
"focusin": "_handleFocus()",
|
|
946
|
+
"blur": "_onTouched()",
|
|
947
|
+
"input": "_handleInput($event)",
|
|
948
|
+
"keydown": "_handleKeydown($event)",
|
|
949
|
+
"click": "_handleClick()"
|
|
950
|
+
},
|
|
951
|
+
properties: {
|
|
952
|
+
"attr.autocomplete": "autocompleteAttribute",
|
|
953
|
+
"attr.role": "autocompleteDisabled ? null : \"combobox\"",
|
|
954
|
+
"attr.aria-autocomplete": "autocompleteDisabled ? null : \"list\"",
|
|
955
|
+
"attr.aria-activedescendant": "(panelOpen && activeOption) ? activeOption.id : null",
|
|
956
|
+
"attr.aria-expanded": "autocompleteDisabled ? null : panelOpen.toString()",
|
|
957
|
+
"attr.aria-controls": "(autocompleteDisabled || !panelOpen) ? null : autocomplete?.id",
|
|
958
|
+
"attr.aria-haspopup": "autocompleteDisabled ? null : \"listbox\""
|
|
959
|
+
},
|
|
960
|
+
classAttribute: "mat-mdc-autocomplete-trigger"
|
|
961
|
+
},
|
|
962
|
+
providers: [MAT_AUTOCOMPLETE_VALUE_ACCESSOR],
|
|
963
|
+
exportAs: ["matAutocompleteTrigger"],
|
|
964
|
+
usesOnChanges: true,
|
|
965
|
+
ngImport: i0
|
|
966
|
+
});
|
|
1144
967
|
}
|
|
1145
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
968
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
969
|
+
minVersion: "12.0.0",
|
|
970
|
+
version: "20.2.0-next.2",
|
|
971
|
+
ngImport: i0,
|
|
972
|
+
type: MatAutocompleteTrigger,
|
|
973
|
+
decorators: [{
|
|
974
|
+
type: Directive,
|
|
975
|
+
args: [{
|
|
976
|
+
selector: `input[matAutocomplete], textarea[matAutocomplete]`,
|
|
977
|
+
host: {
|
|
978
|
+
'class': 'mat-mdc-autocomplete-trigger',
|
|
979
|
+
'[attr.autocomplete]': 'autocompleteAttribute',
|
|
980
|
+
'[attr.role]': 'autocompleteDisabled ? null : "combobox"',
|
|
981
|
+
'[attr.aria-autocomplete]': 'autocompleteDisabled ? null : "list"',
|
|
982
|
+
'[attr.aria-activedescendant]': '(panelOpen && activeOption) ? activeOption.id : null',
|
|
983
|
+
'[attr.aria-expanded]': 'autocompleteDisabled ? null : panelOpen.toString()',
|
|
984
|
+
'[attr.aria-controls]': '(autocompleteDisabled || !panelOpen) ? null : autocomplete?.id',
|
|
985
|
+
'[attr.aria-haspopup]': 'autocompleteDisabled ? null : "listbox"',
|
|
986
|
+
'(focusin)': '_handleFocus()',
|
|
987
|
+
'(blur)': '_onTouched()',
|
|
988
|
+
'(input)': '_handleInput($event)',
|
|
989
|
+
'(keydown)': '_handleKeydown($event)',
|
|
990
|
+
'(click)': '_handleClick()'
|
|
991
|
+
},
|
|
992
|
+
exportAs: 'matAutocompleteTrigger',
|
|
993
|
+
providers: [MAT_AUTOCOMPLETE_VALUE_ACCESSOR]
|
|
994
|
+
}]
|
|
995
|
+
}],
|
|
996
|
+
ctorParameters: () => [],
|
|
997
|
+
propDecorators: {
|
|
998
|
+
autocomplete: [{
|
|
999
|
+
type: Input,
|
|
1000
|
+
args: ['matAutocomplete']
|
|
1001
|
+
}],
|
|
1002
|
+
position: [{
|
|
1003
|
+
type: Input,
|
|
1004
|
+
args: ['matAutocompletePosition']
|
|
1005
|
+
}],
|
|
1006
|
+
connectedTo: [{
|
|
1007
|
+
type: Input,
|
|
1008
|
+
args: ['matAutocompleteConnectedTo']
|
|
1009
|
+
}],
|
|
1010
|
+
autocompleteAttribute: [{
|
|
1011
|
+
type: Input,
|
|
1012
|
+
args: ['autocomplete']
|
|
1013
|
+
}],
|
|
1014
|
+
autocompleteDisabled: [{
|
|
1015
|
+
type: Input,
|
|
1016
|
+
args: [{
|
|
1017
|
+
alias: 'matAutocompleteDisabled',
|
|
1018
|
+
transform: booleanAttribute
|
|
1019
|
+
}]
|
|
1020
|
+
}]
|
|
1021
|
+
}
|
|
1022
|
+
});
|
|
1185
1023
|
|
|
1186
1024
|
class MatAutocompleteModule {
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1025
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1026
|
+
minVersion: "12.0.0",
|
|
1027
|
+
version: "20.2.0-next.2",
|
|
1028
|
+
ngImport: i0,
|
|
1029
|
+
type: MatAutocompleteModule,
|
|
1030
|
+
deps: [],
|
|
1031
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
1032
|
+
});
|
|
1033
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({
|
|
1034
|
+
minVersion: "14.0.0",
|
|
1035
|
+
version: "20.2.0-next.2",
|
|
1036
|
+
ngImport: i0,
|
|
1037
|
+
type: MatAutocompleteModule,
|
|
1038
|
+
imports: [OverlayModule, MatOptionModule, MatAutocomplete, MatAutocompleteTrigger, MatAutocompleteOrigin],
|
|
1039
|
+
exports: [CdkScrollableModule, MatAutocomplete, MatOptionModule, BidiModule, MatAutocompleteTrigger, MatAutocompleteOrigin]
|
|
1040
|
+
});
|
|
1041
|
+
static ɵinj = i0.ɵɵngDeclareInjector({
|
|
1042
|
+
minVersion: "12.0.0",
|
|
1043
|
+
version: "20.2.0-next.2",
|
|
1044
|
+
ngImport: i0,
|
|
1045
|
+
type: MatAutocompleteModule,
|
|
1046
|
+
imports: [OverlayModule, MatOptionModule, CdkScrollableModule, MatOptionModule, BidiModule]
|
|
1047
|
+
});
|
|
1202
1048
|
}
|
|
1203
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
MatOptionModule,
|
|
1217
|
-
BidiModule,
|
|
1218
|
-
MatAutocompleteTrigger,
|
|
1219
|
-
MatAutocompleteOrigin,
|
|
1220
|
-
],
|
|
1221
|
-
}]
|
|
1222
|
-
}] });
|
|
1049
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1050
|
+
minVersion: "12.0.0",
|
|
1051
|
+
version: "20.2.0-next.2",
|
|
1052
|
+
ngImport: i0,
|
|
1053
|
+
type: MatAutocompleteModule,
|
|
1054
|
+
decorators: [{
|
|
1055
|
+
type: NgModule,
|
|
1056
|
+
args: [{
|
|
1057
|
+
imports: [OverlayModule, MatOptionModule, MatAutocomplete, MatAutocompleteTrigger, MatAutocompleteOrigin],
|
|
1058
|
+
exports: [CdkScrollableModule, MatAutocomplete, MatOptionModule, BidiModule, MatAutocompleteTrigger, MatAutocompleteOrigin]
|
|
1059
|
+
}]
|
|
1060
|
+
}]
|
|
1061
|
+
});
|
|
1223
1062
|
|
|
1224
1063
|
export { MAT_AUTOCOMPLETE_DEFAULT_OPTIONS, MAT_AUTOCOMPLETE_SCROLL_STRATEGY, MAT_AUTOCOMPLETE_VALUE_ACCESSOR, MatAutocomplete, MatAutocompleteModule, MatAutocompleteOrigin, MatAutocompleteSelectedEvent, MatAutocompleteTrigger, MatOption, getMatAutocompleteMissingPanelError };
|
|
1225
1064
|
//# sourceMappingURL=autocomplete.mjs.map
|