1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { ActiveDescendantKeyManager, LiveAnnouncer } from '@angular/cdk/a11y';
|
---|
9 | import { Directionality } from '@angular/cdk/bidi';
|
---|
10 | import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
|
---|
11 | import { SelectionModel } from '@angular/cdk/collections';
|
---|
12 | import { A, DOWN_ARROW, ENTER, hasModifierKey, LEFT_ARROW, RIGHT_ARROW, SPACE, UP_ARROW, } from '@angular/cdk/keycodes';
|
---|
13 | import { CdkConnectedOverlay, Overlay, } from '@angular/cdk/overlay';
|
---|
14 | import { ViewportRuler } from '@angular/cdk/scrolling';
|
---|
15 | import { Attribute, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ContentChildren, Directive, ElementRef, EventEmitter, Inject, InjectionToken, Input, NgZone, Optional, Output, QueryList, Self, ViewChild, ViewEncapsulation, } from '@angular/core';
|
---|
16 | import { FormGroupDirective, NgControl, NgForm } from '@angular/forms';
|
---|
17 | import { _countGroupLabelsBeforeOption, _getOptionScrollPosition, ErrorStateMatcher, MAT_OPTGROUP, MAT_OPTION_PARENT_COMPONENT, MatOption, mixinDisabled, mixinDisableRipple, mixinErrorState, mixinTabIndex, } from '@angular/material/core';
|
---|
18 | import { MAT_FORM_FIELD, MatFormField, MatFormFieldControl } from '@angular/material/form-field';
|
---|
19 | import { defer, merge, Observable, Subject } from 'rxjs';
|
---|
20 | import { distinctUntilChanged, filter, map, startWith, switchMap, take, takeUntil, } from 'rxjs/operators';
|
---|
21 | import { matSelectAnimations } from './select-animations';
|
---|
22 | import { getMatSelectDynamicMultipleError, getMatSelectNonArrayValueError, getMatSelectNonFunctionValueError, } from './select-errors';
|
---|
23 | let nextUniqueId = 0;
|
---|
24 | /**
|
---|
25 | * The following style constants are necessary to save here in order
|
---|
26 | * to properly calculate the alignment of the selected option over
|
---|
27 | * the trigger element.
|
---|
28 | */
|
---|
29 | /** The max height of the select's overlay panel. */
|
---|
30 | export const SELECT_PANEL_MAX_HEIGHT = 256;
|
---|
31 | /** The panel's padding on the x-axis. */
|
---|
32 | export const SELECT_PANEL_PADDING_X = 16;
|
---|
33 | /** The panel's x axis padding if it is indented (e.g. there is an option group). */
|
---|
34 | export const SELECT_PANEL_INDENT_PADDING_X = SELECT_PANEL_PADDING_X * 2;
|
---|
35 | /** The height of the select items in `em` units. */
|
---|
36 | export const SELECT_ITEM_HEIGHT_EM = 3;
|
---|
37 | // TODO(josephperrott): Revert to a constant after 2018 spec updates are fully merged.
|
---|
38 | /**
|
---|
39 | * Distance between the panel edge and the option text in
|
---|
40 | * multi-selection mode.
|
---|
41 | *
|
---|
42 | * Calculated as:
|
---|
43 | * (SELECT_PANEL_PADDING_X * 1.5) + 16 = 40
|
---|
44 | * The padding is multiplied by 1.5 because the checkbox's margin is half the padding.
|
---|
45 | * The checkbox width is 16px.
|
---|
46 | */
|
---|
47 | export const SELECT_MULTIPLE_PANEL_PADDING_X = SELECT_PANEL_PADDING_X * 1.5 + 16;
|
---|
48 | /**
|
---|
49 | * The select panel will only "fit" inside the viewport if it is positioned at
|
---|
50 | * this value or more away from the viewport boundary.
|
---|
51 | */
|
---|
52 | export const SELECT_PANEL_VIEWPORT_PADDING = 8;
|
---|
53 | /** Injection token that determines the scroll handling while a select is open. */
|
---|
54 | export const MAT_SELECT_SCROLL_STRATEGY = new InjectionToken('mat-select-scroll-strategy');
|
---|
55 | /** @docs-private */
|
---|
56 | export function MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {
|
---|
57 | return () => overlay.scrollStrategies.reposition();
|
---|
58 | }
|
---|
59 | /** Injection token that can be used to provide the default options the select module. */
|
---|
60 | export const MAT_SELECT_CONFIG = new InjectionToken('MAT_SELECT_CONFIG');
|
---|
61 | /** @docs-private */
|
---|
62 | export const MAT_SELECT_SCROLL_STRATEGY_PROVIDER = {
|
---|
63 | provide: MAT_SELECT_SCROLL_STRATEGY,
|
---|
64 | deps: [Overlay],
|
---|
65 | useFactory: MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY,
|
---|
66 | };
|
---|
67 | /** Change event object that is emitted when the select value has changed. */
|
---|
68 | export class MatSelectChange {
|
---|
69 | constructor(
|
---|
70 | /** Reference to the select that emitted the change event. */
|
---|
71 | source,
|
---|
72 | /** Current value of the select that emitted the event. */
|
---|
73 | value) {
|
---|
74 | this.source = source;
|
---|
75 | this.value = value;
|
---|
76 | }
|
---|
77 | }
|
---|
78 | // Boilerplate for applying mixins to MatSelect.
|
---|
79 | /** @docs-private */
|
---|
80 | const _MatSelectMixinBase = mixinDisableRipple(mixinTabIndex(mixinDisabled(mixinErrorState(class {
|
---|
81 | constructor(_elementRef, _defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl) {
|
---|
82 | this._elementRef = _elementRef;
|
---|
83 | this._defaultErrorStateMatcher = _defaultErrorStateMatcher;
|
---|
84 | this._parentForm = _parentForm;
|
---|
85 | this._parentFormGroup = _parentFormGroup;
|
---|
86 | this.ngControl = ngControl;
|
---|
87 | }
|
---|
88 | }))));
|
---|
89 | /**
|
---|
90 | * Injection token that can be used to reference instances of `MatSelectTrigger`. It serves as
|
---|
91 | * alternative token to the actual `MatSelectTrigger` class which could cause unnecessary
|
---|
92 | * retention of the class and its directive metadata.
|
---|
93 | */
|
---|
94 | export const MAT_SELECT_TRIGGER = new InjectionToken('MatSelectTrigger');
|
---|
95 | /**
|
---|
96 | * Allows the user to customize the trigger that is displayed when the select has a value.
|
---|
97 | */
|
---|
98 | export class MatSelectTrigger {
|
---|
99 | }
|
---|
100 | MatSelectTrigger.decorators = [
|
---|
101 | { type: Directive, args: [{
|
---|
102 | selector: 'mat-select-trigger',
|
---|
103 | providers: [{ provide: MAT_SELECT_TRIGGER, useExisting: MatSelectTrigger }],
|
---|
104 | },] }
|
---|
105 | ];
|
---|
106 | /** Base class with all of the `MatSelect` functionality. */
|
---|
107 | export class _MatSelectBase extends _MatSelectMixinBase {
|
---|
108 | constructor(_viewportRuler, _changeDetectorRef, _ngZone, _defaultErrorStateMatcher, elementRef, _dir, _parentForm, _parentFormGroup, _parentFormField, ngControl, tabIndex, scrollStrategyFactory, _liveAnnouncer, _defaultOptions) {
|
---|
109 | var _a, _b, _c;
|
---|
110 | super(elementRef, _defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl);
|
---|
111 | this._viewportRuler = _viewportRuler;
|
---|
112 | this._changeDetectorRef = _changeDetectorRef;
|
---|
113 | this._ngZone = _ngZone;
|
---|
114 | this._dir = _dir;
|
---|
115 | this._parentFormField = _parentFormField;
|
---|
116 | this._liveAnnouncer = _liveAnnouncer;
|
---|
117 | this._defaultOptions = _defaultOptions;
|
---|
118 | /** Whether or not the overlay panel is open. */
|
---|
119 | this._panelOpen = false;
|
---|
120 | /** Comparison function to specify which option is displayed. Defaults to object equality. */
|
---|
121 | this._compareWith = (o1, o2) => o1 === o2;
|
---|
122 | /** Unique id for this input. */
|
---|
123 | this._uid = `mat-select-${nextUniqueId++}`;
|
---|
124 | /** Current `ariar-labelledby` value for the select trigger. */
|
---|
125 | this._triggerAriaLabelledBy = null;
|
---|
126 | /** Emits whenever the component is destroyed. */
|
---|
127 | this._destroy = new Subject();
|
---|
128 | /** `View -> model callback called when value changes` */
|
---|
129 | this._onChange = () => { };
|
---|
130 | /** `View -> model callback called when select has been touched` */
|
---|
131 | this._onTouched = () => { };
|
---|
132 | /** ID for the DOM node containing the select's value. */
|
---|
133 | this._valueId = `mat-select-value-${nextUniqueId++}`;
|
---|
134 | /** Emits when the panel element is finished transforming in. */
|
---|
135 | this._panelDoneAnimatingStream = new Subject();
|
---|
136 | this._overlayPanelClass = ((_a = this._defaultOptions) === null || _a === void 0 ? void 0 : _a.overlayPanelClass) || '';
|
---|
137 | this._focused = false;
|
---|
138 | /** A name for this control that can be used by `mat-form-field`. */
|
---|
139 | this.controlType = 'mat-select';
|
---|
140 | this._required = false;
|
---|
141 | this._multiple = false;
|
---|
142 | this._disableOptionCentering = (_c = (_b = this._defaultOptions) === null || _b === void 0 ? void 0 : _b.disableOptionCentering) !== null && _c !== void 0 ? _c : false;
|
---|
143 | /** Aria label of the select. */
|
---|
144 | this.ariaLabel = '';
|
---|
145 | /** Combined stream of all of the child options' change events. */
|
---|
146 | this.optionSelectionChanges = defer(() => {
|
---|
147 | const options = this.options;
|
---|
148 | if (options) {
|
---|
149 | return options.changes.pipe(startWith(options), switchMap(() => merge(...options.map(option => option.onSelectionChange))));
|
---|
150 | }
|
---|
151 | return this._ngZone.onStable
|
---|
152 | .pipe(take(1), switchMap(() => this.optionSelectionChanges));
|
---|
153 | });
|
---|
154 | /** Event emitted when the select panel has been toggled. */
|
---|
155 | this.openedChange = new EventEmitter();
|
---|
156 | /** Event emitted when the select has been opened. */
|
---|
157 | this._openedStream = this.openedChange.pipe(filter(o => o), map(() => { }));
|
---|
158 | /** Event emitted when the select has been closed. */
|
---|
159 | this._closedStream = this.openedChange.pipe(filter(o => !o), map(() => { }));
|
---|
160 | /** Event emitted when the selected value has been changed by the user. */
|
---|
161 | this.selectionChange = new EventEmitter();
|
---|
162 | /**
|
---|
163 | * Event that emits whenever the raw value of the select changes. This is here primarily
|
---|
164 | * to facilitate the two-way binding for the `value` input.
|
---|
165 | * @docs-private
|
---|
166 | */
|
---|
167 | this.valueChange = new EventEmitter();
|
---|
168 | if (this.ngControl) {
|
---|
169 | // Note: we provide the value accessor through here, instead of
|
---|
170 | // the `providers` to avoid running into a circular import.
|
---|
171 | this.ngControl.valueAccessor = this;
|
---|
172 | }
|
---|
173 | // Note that we only want to set this when the defaults pass it in, otherwise it should
|
---|
174 | // stay as `undefined` so that it falls back to the default in the key manager.
|
---|
175 | if ((_defaultOptions === null || _defaultOptions === void 0 ? void 0 : _defaultOptions.typeaheadDebounceInterval) != null) {
|
---|
176 | this._typeaheadDebounceInterval = _defaultOptions.typeaheadDebounceInterval;
|
---|
177 | }
|
---|
178 | this._scrollStrategyFactory = scrollStrategyFactory;
|
---|
179 | this._scrollStrategy = this._scrollStrategyFactory();
|
---|
180 | this.tabIndex = parseInt(tabIndex) || 0;
|
---|
181 | // Force setter to be called in case id was not specified.
|
---|
182 | this.id = this.id;
|
---|
183 | }
|
---|
184 | /** Whether the select is focused. */
|
---|
185 | get focused() {
|
---|
186 | return this._focused || this._panelOpen;
|
---|
187 | }
|
---|
188 | /** Placeholder to be shown if no value has been selected. */
|
---|
189 | get placeholder() { return this._placeholder; }
|
---|
190 | set placeholder(value) {
|
---|
191 | this._placeholder = value;
|
---|
192 | this.stateChanges.next();
|
---|
193 | }
|
---|
194 | /** Whether the component is required. */
|
---|
195 | get required() { return this._required; }
|
---|
196 | set required(value) {
|
---|
197 | this._required = coerceBooleanProperty(value);
|
---|
198 | this.stateChanges.next();
|
---|
199 | }
|
---|
200 | /** Whether the user should be allowed to select multiple options. */
|
---|
201 | get multiple() { return this._multiple; }
|
---|
202 | set multiple(value) {
|
---|
203 | if (this._selectionModel && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
---|
204 | throw getMatSelectDynamicMultipleError();
|
---|
205 | }
|
---|
206 | this._multiple = coerceBooleanProperty(value);
|
---|
207 | }
|
---|
208 | /** Whether to center the active option over the trigger. */
|
---|
209 | get disableOptionCentering() { return this._disableOptionCentering; }
|
---|
210 | set disableOptionCentering(value) {
|
---|
211 | this._disableOptionCentering = coerceBooleanProperty(value);
|
---|
212 | }
|
---|
213 | /**
|
---|
214 | * Function to compare the option values with the selected values. The first argument
|
---|
215 | * is a value from an option. The second is a value from the selection. A boolean
|
---|
216 | * should be returned.
|
---|
217 | */
|
---|
218 | get compareWith() { return this._compareWith; }
|
---|
219 | set compareWith(fn) {
|
---|
220 | if (typeof fn !== 'function' && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
---|
221 | throw getMatSelectNonFunctionValueError();
|
---|
222 | }
|
---|
223 | this._compareWith = fn;
|
---|
224 | if (this._selectionModel) {
|
---|
225 | // A different comparator means the selection could change.
|
---|
226 | this._initializeSelection();
|
---|
227 | }
|
---|
228 | }
|
---|
229 | /** Value of the select control. */
|
---|
230 | get value() { return this._value; }
|
---|
231 | set value(newValue) {
|
---|
232 | // Always re-assign an array, because it might have been mutated.
|
---|
233 | if (newValue !== this._value || (this._multiple && Array.isArray(newValue))) {
|
---|
234 | if (this.options) {
|
---|
235 | this._setSelectionByValue(newValue);
|
---|
236 | }
|
---|
237 | this._value = newValue;
|
---|
238 | }
|
---|
239 | }
|
---|
240 | /** Time to wait in milliseconds after the last keystroke before moving focus to an item. */
|
---|
241 | get typeaheadDebounceInterval() { return this._typeaheadDebounceInterval; }
|
---|
242 | set typeaheadDebounceInterval(value) {
|
---|
243 | this._typeaheadDebounceInterval = coerceNumberProperty(value);
|
---|
244 | }
|
---|
245 | /** Unique id of the element. */
|
---|
246 | get id() { return this._id; }
|
---|
247 | set id(value) {
|
---|
248 | this._id = value || this._uid;
|
---|
249 | this.stateChanges.next();
|
---|
250 | }
|
---|
251 | ngOnInit() {
|
---|
252 | this._selectionModel = new SelectionModel(this.multiple);
|
---|
253 | this.stateChanges.next();
|
---|
254 | // We need `distinctUntilChanged` here, because some browsers will
|
---|
255 | // fire the animation end event twice for the same animation. See:
|
---|
256 | // https://github.com/angular/angular/issues/24084
|
---|
257 | this._panelDoneAnimatingStream
|
---|
258 | .pipe(distinctUntilChanged(), takeUntil(this._destroy))
|
---|
259 | .subscribe(() => this._panelDoneAnimating(this.panelOpen));
|
---|
260 | }
|
---|
261 | ngAfterContentInit() {
|
---|
262 | this._initKeyManager();
|
---|
263 | this._selectionModel.changed.pipe(takeUntil(this._destroy)).subscribe(event => {
|
---|
264 | event.added.forEach(option => option.select());
|
---|
265 | event.removed.forEach(option => option.deselect());
|
---|
266 | });
|
---|
267 | this.options.changes.pipe(startWith(null), takeUntil(this._destroy)).subscribe(() => {
|
---|
268 | this._resetOptions();
|
---|
269 | this._initializeSelection();
|
---|
270 | });
|
---|
271 | }
|
---|
272 | ngDoCheck() {
|
---|
273 | const newAriaLabelledby = this._getTriggerAriaLabelledby();
|
---|
274 | // We have to manage setting the `aria-labelledby` ourselves, because part of its value
|
---|
275 | // is computed as a result of a content query which can cause this binding to trigger a
|
---|
276 | // "changed after checked" error.
|
---|
277 | if (newAriaLabelledby !== this._triggerAriaLabelledBy) {
|
---|
278 | const element = this._elementRef.nativeElement;
|
---|
279 | this._triggerAriaLabelledBy = newAriaLabelledby;
|
---|
280 | if (newAriaLabelledby) {
|
---|
281 | element.setAttribute('aria-labelledby', newAriaLabelledby);
|
---|
282 | }
|
---|
283 | else {
|
---|
284 | element.removeAttribute('aria-labelledby');
|
---|
285 | }
|
---|
286 | }
|
---|
287 | if (this.ngControl) {
|
---|
288 | this.updateErrorState();
|
---|
289 | }
|
---|
290 | }
|
---|
291 | ngOnChanges(changes) {
|
---|
292 | // Updating the disabled state is handled by `mixinDisabled`, but we need to additionally let
|
---|
293 | // the parent form field know to run change detection when the disabled state changes.
|
---|
294 | if (changes['disabled']) {
|
---|
295 | this.stateChanges.next();
|
---|
296 | }
|
---|
297 | if (changes['typeaheadDebounceInterval'] && this._keyManager) {
|
---|
298 | this._keyManager.withTypeAhead(this._typeaheadDebounceInterval);
|
---|
299 | }
|
---|
300 | }
|
---|
301 | ngOnDestroy() {
|
---|
302 | this._destroy.next();
|
---|
303 | this._destroy.complete();
|
---|
304 | this.stateChanges.complete();
|
---|
305 | }
|
---|
306 | /** Toggles the overlay panel open or closed. */
|
---|
307 | toggle() {
|
---|
308 | this.panelOpen ? this.close() : this.open();
|
---|
309 | }
|
---|
310 | /** Opens the overlay panel. */
|
---|
311 | open() {
|
---|
312 | if (this._canOpen()) {
|
---|
313 | this._panelOpen = true;
|
---|
314 | this._keyManager.withHorizontalOrientation(null);
|
---|
315 | this._highlightCorrectOption();
|
---|
316 | this._changeDetectorRef.markForCheck();
|
---|
317 | }
|
---|
318 | }
|
---|
319 | /** Closes the overlay panel and focuses the host element. */
|
---|
320 | close() {
|
---|
321 | if (this._panelOpen) {
|
---|
322 | this._panelOpen = false;
|
---|
323 | this._keyManager.withHorizontalOrientation(this._isRtl() ? 'rtl' : 'ltr');
|
---|
324 | this._changeDetectorRef.markForCheck();
|
---|
325 | this._onTouched();
|
---|
326 | }
|
---|
327 | }
|
---|
328 | /**
|
---|
329 | * Sets the select's value. Part of the ControlValueAccessor interface
|
---|
330 | * required to integrate with Angular's core forms API.
|
---|
331 | *
|
---|
332 | * @param value New value to be written to the model.
|
---|
333 | */
|
---|
334 | writeValue(value) {
|
---|
335 | this.value = value;
|
---|
336 | }
|
---|
337 | /**
|
---|
338 | * Saves a callback function to be invoked when the select's value
|
---|
339 | * changes from user input. Part of the ControlValueAccessor interface
|
---|
340 | * required to integrate with Angular's core forms API.
|
---|
341 | *
|
---|
342 | * @param fn Callback to be triggered when the value changes.
|
---|
343 | */
|
---|
344 | registerOnChange(fn) {
|
---|
345 | this._onChange = fn;
|
---|
346 | }
|
---|
347 | /**
|
---|
348 | * Saves a callback function to be invoked when the select is blurred
|
---|
349 | * by the user. Part of the ControlValueAccessor interface required
|
---|
350 | * to integrate with Angular's core forms API.
|
---|
351 | *
|
---|
352 | * @param fn Callback to be triggered when the component has been touched.
|
---|
353 | */
|
---|
354 | registerOnTouched(fn) {
|
---|
355 | this._onTouched = fn;
|
---|
356 | }
|
---|
357 | /**
|
---|
358 | * Disables the select. Part of the ControlValueAccessor interface required
|
---|
359 | * to integrate with Angular's core forms API.
|
---|
360 | *
|
---|
361 | * @param isDisabled Sets whether the component is disabled.
|
---|
362 | */
|
---|
363 | setDisabledState(isDisabled) {
|
---|
364 | this.disabled = isDisabled;
|
---|
365 | this._changeDetectorRef.markForCheck();
|
---|
366 | this.stateChanges.next();
|
---|
367 | }
|
---|
368 | /** Whether or not the overlay panel is open. */
|
---|
369 | get panelOpen() {
|
---|
370 | return this._panelOpen;
|
---|
371 | }
|
---|
372 | /** The currently selected option. */
|
---|
373 | get selected() {
|
---|
374 | var _a, _b;
|
---|
375 | return this.multiple ? (((_a = this._selectionModel) === null || _a === void 0 ? void 0 : _a.selected) || []) :
|
---|
376 | (_b = this._selectionModel) === null || _b === void 0 ? void 0 : _b.selected[0];
|
---|
377 | }
|
---|
378 | /** The value displayed in the trigger. */
|
---|
379 | get triggerValue() {
|
---|
380 | if (this.empty) {
|
---|
381 | return '';
|
---|
382 | }
|
---|
383 | if (this._multiple) {
|
---|
384 | const selectedOptions = this._selectionModel.selected.map(option => option.viewValue);
|
---|
385 | if (this._isRtl()) {
|
---|
386 | selectedOptions.reverse();
|
---|
387 | }
|
---|
388 | // TODO(crisbeto): delimiter should be configurable for proper localization.
|
---|
389 | return selectedOptions.join(', ');
|
---|
390 | }
|
---|
391 | return this._selectionModel.selected[0].viewValue;
|
---|
392 | }
|
---|
393 | /** Whether the element is in RTL mode. */
|
---|
394 | _isRtl() {
|
---|
395 | return this._dir ? this._dir.value === 'rtl' : false;
|
---|
396 | }
|
---|
397 | /** Handles all keydown events on the select. */
|
---|
398 | _handleKeydown(event) {
|
---|
399 | if (!this.disabled) {
|
---|
400 | this.panelOpen ? this._handleOpenKeydown(event) : this._handleClosedKeydown(event);
|
---|
401 | }
|
---|
402 | }
|
---|
403 | /** Handles keyboard events while the select is closed. */
|
---|
404 | _handleClosedKeydown(event) {
|
---|
405 | const keyCode = event.keyCode;
|
---|
406 | const isArrowKey = keyCode === DOWN_ARROW || keyCode === UP_ARROW ||
|
---|
407 | keyCode === LEFT_ARROW || keyCode === RIGHT_ARROW;
|
---|
408 | const isOpenKey = keyCode === ENTER || keyCode === SPACE;
|
---|
409 | const manager = this._keyManager;
|
---|
410 | // Open the select on ALT + arrow key to match the native <select>
|
---|
411 | if (!manager.isTyping() && (isOpenKey && !hasModifierKey(event)) ||
|
---|
412 | ((this.multiple || event.altKey) && isArrowKey)) {
|
---|
413 | event.preventDefault(); // prevents the page from scrolling down when pressing space
|
---|
414 | this.open();
|
---|
415 | }
|
---|
416 | else if (!this.multiple) {
|
---|
417 | const previouslySelectedOption = this.selected;
|
---|
418 | manager.onKeydown(event);
|
---|
419 | const selectedOption = this.selected;
|
---|
420 | // Since the value has changed, we need to announce it ourselves.
|
---|
421 | if (selectedOption && previouslySelectedOption !== selectedOption) {
|
---|
422 | // We set a duration on the live announcement, because we want the live element to be
|
---|
423 | // cleared after a while so that users can't navigate to it using the arrow keys.
|
---|
424 | this._liveAnnouncer.announce(selectedOption.viewValue, 10000);
|
---|
425 | }
|
---|
426 | }
|
---|
427 | }
|
---|
428 | /** Handles keyboard events when the selected is open. */
|
---|
429 | _handleOpenKeydown(event) {
|
---|
430 | const manager = this._keyManager;
|
---|
431 | const keyCode = event.keyCode;
|
---|
432 | const isArrowKey = keyCode === DOWN_ARROW || keyCode === UP_ARROW;
|
---|
433 | const isTyping = manager.isTyping();
|
---|
434 | if (isArrowKey && event.altKey) {
|
---|
435 | // Close the select on ALT + arrow key to match the native <select>
|
---|
436 | event.preventDefault();
|
---|
437 | this.close();
|
---|
438 | // Don't do anything in this case if the user is typing,
|
---|
439 | // because the typing sequence can include the space key.
|
---|
440 | }
|
---|
441 | else if (!isTyping && (keyCode === ENTER || keyCode === SPACE) && manager.activeItem &&
|
---|
442 | !hasModifierKey(event)) {
|
---|
443 | event.preventDefault();
|
---|
444 | manager.activeItem._selectViaInteraction();
|
---|
445 | }
|
---|
446 | else if (!isTyping && this._multiple && keyCode === A && event.ctrlKey) {
|
---|
447 | event.preventDefault();
|
---|
448 | const hasDeselectedOptions = this.options.some(opt => !opt.disabled && !opt.selected);
|
---|
449 | this.options.forEach(option => {
|
---|
450 | if (!option.disabled) {
|
---|
451 | hasDeselectedOptions ? option.select() : option.deselect();
|
---|
452 | }
|
---|
453 | });
|
---|
454 | }
|
---|
455 | else {
|
---|
456 | const previouslyFocusedIndex = manager.activeItemIndex;
|
---|
457 | manager.onKeydown(event);
|
---|
458 | if (this._multiple && isArrowKey && event.shiftKey && manager.activeItem &&
|
---|
459 | manager.activeItemIndex !== previouslyFocusedIndex) {
|
---|
460 | manager.activeItem._selectViaInteraction();
|
---|
461 | }
|
---|
462 | }
|
---|
463 | }
|
---|
464 | _onFocus() {
|
---|
465 | if (!this.disabled) {
|
---|
466 | this._focused = true;
|
---|
467 | this.stateChanges.next();
|
---|
468 | }
|
---|
469 | }
|
---|
470 | /**
|
---|
471 | * Calls the touched callback only if the panel is closed. Otherwise, the trigger will
|
---|
472 | * "blur" to the panel when it opens, causing a false positive.
|
---|
473 | */
|
---|
474 | _onBlur() {
|
---|
475 | this._focused = false;
|
---|
476 | if (!this.disabled && !this.panelOpen) {
|
---|
477 | this._onTouched();
|
---|
478 | this._changeDetectorRef.markForCheck();
|
---|
479 | this.stateChanges.next();
|
---|
480 | }
|
---|
481 | }
|
---|
482 | /**
|
---|
483 | * Callback that is invoked when the overlay panel has been attached.
|
---|
484 | */
|
---|
485 | _onAttached() {
|
---|
486 | this._overlayDir.positionChange.pipe(take(1)).subscribe(() => {
|
---|
487 | this._changeDetectorRef.detectChanges();
|
---|
488 | this._positioningSettled();
|
---|
489 | });
|
---|
490 | }
|
---|
491 | /** Returns the theme to be used on the panel. */
|
---|
492 | _getPanelTheme() {
|
---|
493 | return this._parentFormField ? `mat-${this._parentFormField.color}` : '';
|
---|
494 | }
|
---|
495 | /** Whether the select has a value. */
|
---|
496 | get empty() {
|
---|
497 | return !this._selectionModel || this._selectionModel.isEmpty();
|
---|
498 | }
|
---|
499 | _initializeSelection() {
|
---|
500 | // Defer setting the value in order to avoid the "Expression
|
---|
501 | // has changed after it was checked" errors from Angular.
|
---|
502 | Promise.resolve().then(() => {
|
---|
503 | this._setSelectionByValue(this.ngControl ? this.ngControl.value : this._value);
|
---|
504 | this.stateChanges.next();
|
---|
505 | });
|
---|
506 | }
|
---|
507 | /**
|
---|
508 | * Sets the selected option based on a value. If no option can be
|
---|
509 | * found with the designated value, the select trigger is cleared.
|
---|
510 | */
|
---|
511 | _setSelectionByValue(value) {
|
---|
512 | this._selectionModel.selected.forEach(option => option.setInactiveStyles());
|
---|
513 | this._selectionModel.clear();
|
---|
514 | if (this.multiple && value) {
|
---|
515 | if (!Array.isArray(value) && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
---|
516 | throw getMatSelectNonArrayValueError();
|
---|
517 | }
|
---|
518 | value.forEach((currentValue) => this._selectValue(currentValue));
|
---|
519 | this._sortValues();
|
---|
520 | }
|
---|
521 | else {
|
---|
522 | const correspondingOption = this._selectValue(value);
|
---|
523 | // Shift focus to the active item. Note that we shouldn't do this in multiple
|
---|
524 | // mode, because we don't know what option the user interacted with last.
|
---|
525 | if (correspondingOption) {
|
---|
526 | this._keyManager.updateActiveItem(correspondingOption);
|
---|
527 | }
|
---|
528 | else if (!this.panelOpen) {
|
---|
529 | // Otherwise reset the highlighted option. Note that we only want to do this while
|
---|
530 | // closed, because doing it while open can shift the user's focus unnecessarily.
|
---|
531 | this._keyManager.updateActiveItem(-1);
|
---|
532 | }
|
---|
533 | }
|
---|
534 | this._changeDetectorRef.markForCheck();
|
---|
535 | }
|
---|
536 | /**
|
---|
537 | * Finds and selects and option based on its value.
|
---|
538 | * @returns Option that has the corresponding value.
|
---|
539 | */
|
---|
540 | _selectValue(value) {
|
---|
541 | const correspondingOption = this.options.find((option) => {
|
---|
542 | // Skip options that are already in the model. This allows us to handle cases
|
---|
543 | // where the same primitive value is selected multiple times.
|
---|
544 | if (this._selectionModel.isSelected(option)) {
|
---|
545 | return false;
|
---|
546 | }
|
---|
547 | try {
|
---|
548 | // Treat null as a special reset value.
|
---|
549 | return option.value != null && this._compareWith(option.value, value);
|
---|
550 | }
|
---|
551 | catch (error) {
|
---|
552 | if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
---|
553 | // Notify developers of errors in their comparator.
|
---|
554 | console.warn(error);
|
---|
555 | }
|
---|
556 | return false;
|
---|
557 | }
|
---|
558 | });
|
---|
559 | if (correspondingOption) {
|
---|
560 | this._selectionModel.select(correspondingOption);
|
---|
561 | }
|
---|
562 | return correspondingOption;
|
---|
563 | }
|
---|
564 | /** Sets up a key manager to listen to keyboard events on the overlay panel. */
|
---|
565 | _initKeyManager() {
|
---|
566 | this._keyManager = new ActiveDescendantKeyManager(this.options)
|
---|
567 | .withTypeAhead(this._typeaheadDebounceInterval)
|
---|
568 | .withVerticalOrientation()
|
---|
569 | .withHorizontalOrientation(this._isRtl() ? 'rtl' : 'ltr')
|
---|
570 | .withHomeAndEnd()
|
---|
571 | .withAllowedModifierKeys(['shiftKey']);
|
---|
572 | this._keyManager.tabOut.pipe(takeUntil(this._destroy)).subscribe(() => {
|
---|
573 | if (this.panelOpen) {
|
---|
574 | // Select the active item when tabbing away. This is consistent with how the native
|
---|
575 | // select behaves. Note that we only want to do this in single selection mode.
|
---|
576 | if (!this.multiple && this._keyManager.activeItem) {
|
---|
577 | this._keyManager.activeItem._selectViaInteraction();
|
---|
578 | }
|
---|
579 | // Restore focus to the trigger before closing. Ensures that the focus
|
---|
580 | // position won't be lost if the user got focus into the overlay.
|
---|
581 | this.focus();
|
---|
582 | this.close();
|
---|
583 | }
|
---|
584 | });
|
---|
585 | this._keyManager.change.pipe(takeUntil(this._destroy)).subscribe(() => {
|
---|
586 | if (this._panelOpen && this.panel) {
|
---|
587 | this._scrollOptionIntoView(this._keyManager.activeItemIndex || 0);
|
---|
588 | }
|
---|
589 | else if (!this._panelOpen && !this.multiple && this._keyManager.activeItem) {
|
---|
590 | this._keyManager.activeItem._selectViaInteraction();
|
---|
591 | }
|
---|
592 | });
|
---|
593 | }
|
---|
594 | /** Drops current option subscriptions and IDs and resets from scratch. */
|
---|
595 | _resetOptions() {
|
---|
596 | const changedOrDestroyed = merge(this.options.changes, this._destroy);
|
---|
597 | this.optionSelectionChanges.pipe(takeUntil(changedOrDestroyed)).subscribe(event => {
|
---|
598 | this._onSelect(event.source, event.isUserInput);
|
---|
599 | if (event.isUserInput && !this.multiple && this._panelOpen) {
|
---|
600 | this.close();
|
---|
601 | this.focus();
|
---|
602 | }
|
---|
603 | });
|
---|
604 | // Listen to changes in the internal state of the options and react accordingly.
|
---|
605 | // Handles cases like the labels of the selected options changing.
|
---|
606 | merge(...this.options.map(option => option._stateChanges))
|
---|
607 | .pipe(takeUntil(changedOrDestroyed))
|
---|
608 | .subscribe(() => {
|
---|
609 | this._changeDetectorRef.markForCheck();
|
---|
610 | this.stateChanges.next();
|
---|
611 | });
|
---|
612 | }
|
---|
613 | /** Invoked when an option is clicked. */
|
---|
614 | _onSelect(option, isUserInput) {
|
---|
615 | const wasSelected = this._selectionModel.isSelected(option);
|
---|
616 | if (option.value == null && !this._multiple) {
|
---|
617 | option.deselect();
|
---|
618 | this._selectionModel.clear();
|
---|
619 | if (this.value != null) {
|
---|
620 | this._propagateChanges(option.value);
|
---|
621 | }
|
---|
622 | }
|
---|
623 | else {
|
---|
624 | if (wasSelected !== option.selected) {
|
---|
625 | option.selected ? this._selectionModel.select(option) :
|
---|
626 | this._selectionModel.deselect(option);
|
---|
627 | }
|
---|
628 | if (isUserInput) {
|
---|
629 | this._keyManager.setActiveItem(option);
|
---|
630 | }
|
---|
631 | if (this.multiple) {
|
---|
632 | this._sortValues();
|
---|
633 | if (isUserInput) {
|
---|
634 | // In case the user selected the option with their mouse, we
|
---|
635 | // want to restore focus back to the trigger, in order to
|
---|
636 | // prevent the select keyboard controls from clashing with
|
---|
637 | // the ones from `mat-option`.
|
---|
638 | this.focus();
|
---|
639 | }
|
---|
640 | }
|
---|
641 | }
|
---|
642 | if (wasSelected !== this._selectionModel.isSelected(option)) {
|
---|
643 | this._propagateChanges();
|
---|
644 | }
|
---|
645 | this.stateChanges.next();
|
---|
646 | }
|
---|
647 | /** Sorts the selected values in the selected based on their order in the panel. */
|
---|
648 | _sortValues() {
|
---|
649 | if (this.multiple) {
|
---|
650 | const options = this.options.toArray();
|
---|
651 | this._selectionModel.sort((a, b) => {
|
---|
652 | return this.sortComparator ? this.sortComparator(a, b, options) :
|
---|
653 | options.indexOf(a) - options.indexOf(b);
|
---|
654 | });
|
---|
655 | this.stateChanges.next();
|
---|
656 | }
|
---|
657 | }
|
---|
658 | /** Emits change event to set the model value. */
|
---|
659 | _propagateChanges(fallbackValue) {
|
---|
660 | let valueToEmit = null;
|
---|
661 | if (this.multiple) {
|
---|
662 | valueToEmit = this.selected.map(option => option.value);
|
---|
663 | }
|
---|
664 | else {
|
---|
665 | valueToEmit = this.selected ? this.selected.value : fallbackValue;
|
---|
666 | }
|
---|
667 | this._value = valueToEmit;
|
---|
668 | this.valueChange.emit(valueToEmit);
|
---|
669 | this._onChange(valueToEmit);
|
---|
670 | this.selectionChange.emit(this._getChangeEvent(valueToEmit));
|
---|
671 | this._changeDetectorRef.markForCheck();
|
---|
672 | }
|
---|
673 | /**
|
---|
674 | * Highlights the selected item. If no option is selected, it will highlight
|
---|
675 | * the first item instead.
|
---|
676 | */
|
---|
677 | _highlightCorrectOption() {
|
---|
678 | if (this._keyManager) {
|
---|
679 | if (this.empty) {
|
---|
680 | this._keyManager.setFirstItemActive();
|
---|
681 | }
|
---|
682 | else {
|
---|
683 | this._keyManager.setActiveItem(this._selectionModel.selected[0]);
|
---|
684 | }
|
---|
685 | }
|
---|
686 | }
|
---|
687 | /** Whether the panel is allowed to open. */
|
---|
688 | _canOpen() {
|
---|
689 | var _a;
|
---|
690 | return !this._panelOpen && !this.disabled && ((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
---|
691 | }
|
---|
692 | /** Focuses the select element. */
|
---|
693 | focus(options) {
|
---|
694 | this._elementRef.nativeElement.focus(options);
|
---|
695 | }
|
---|
696 | /** Gets the aria-labelledby for the select panel. */
|
---|
697 | _getPanelAriaLabelledby() {
|
---|
698 | var _a;
|
---|
699 | if (this.ariaLabel) {
|
---|
700 | return null;
|
---|
701 | }
|
---|
702 | const labelId = (_a = this._parentFormField) === null || _a === void 0 ? void 0 : _a.getLabelId();
|
---|
703 | const labelExpression = (labelId ? labelId + ' ' : '');
|
---|
704 | return this.ariaLabelledby ? labelExpression + this.ariaLabelledby : labelId;
|
---|
705 | }
|
---|
706 | /** Determines the `aria-activedescendant` to be set on the host. */
|
---|
707 | _getAriaActiveDescendant() {
|
---|
708 | if (this.panelOpen && this._keyManager && this._keyManager.activeItem) {
|
---|
709 | return this._keyManager.activeItem.id;
|
---|
710 | }
|
---|
711 | return null;
|
---|
712 | }
|
---|
713 | /** Gets the aria-labelledby of the select component trigger. */
|
---|
714 | _getTriggerAriaLabelledby() {
|
---|
715 | var _a;
|
---|
716 | if (this.ariaLabel) {
|
---|
717 | return null;
|
---|
718 | }
|
---|
719 | const labelId = (_a = this._parentFormField) === null || _a === void 0 ? void 0 : _a.getLabelId();
|
---|
720 | let value = (labelId ? labelId + ' ' : '') + this._valueId;
|
---|
721 | if (this.ariaLabelledby) {
|
---|
722 | value += ' ' + this.ariaLabelledby;
|
---|
723 | }
|
---|
724 | return value;
|
---|
725 | }
|
---|
726 | /** Called when the overlay panel is done animating. */
|
---|
727 | _panelDoneAnimating(isOpen) {
|
---|
728 | this.openedChange.emit(isOpen);
|
---|
729 | }
|
---|
730 | /**
|
---|
731 | * Implemented as part of MatFormFieldControl.
|
---|
732 | * @docs-private
|
---|
733 | */
|
---|
734 | setDescribedByIds(ids) {
|
---|
735 | this._ariaDescribedby = ids.join(' ');
|
---|
736 | }
|
---|
737 | /**
|
---|
738 | * Implemented as part of MatFormFieldControl.
|
---|
739 | * @docs-private
|
---|
740 | */
|
---|
741 | onContainerClick() {
|
---|
742 | this.focus();
|
---|
743 | this.open();
|
---|
744 | }
|
---|
745 | /**
|
---|
746 | * Implemented as part of MatFormFieldControl.
|
---|
747 | * @docs-private
|
---|
748 | */
|
---|
749 | get shouldLabelFloat() {
|
---|
750 | return this._panelOpen || !this.empty || (this._focused && !!this._placeholder);
|
---|
751 | }
|
---|
752 | }
|
---|
753 | _MatSelectBase.decorators = [
|
---|
754 | { type: Directive }
|
---|
755 | ];
|
---|
756 | _MatSelectBase.ctorParameters = () => [
|
---|
757 | { type: ViewportRuler },
|
---|
758 | { type: ChangeDetectorRef },
|
---|
759 | { type: NgZone },
|
---|
760 | { type: ErrorStateMatcher },
|
---|
761 | { type: ElementRef },
|
---|
762 | { type: Directionality, decorators: [{ type: Optional }] },
|
---|
763 | { type: NgForm, decorators: [{ type: Optional }] },
|
---|
764 | { type: FormGroupDirective, decorators: [{ type: Optional }] },
|
---|
765 | { type: MatFormField, decorators: [{ type: Optional }, { type: Inject, args: [MAT_FORM_FIELD,] }] },
|
---|
766 | { type: NgControl, decorators: [{ type: Self }, { type: Optional }] },
|
---|
767 | { type: String, decorators: [{ type: Attribute, args: ['tabindex',] }] },
|
---|
768 | { type: undefined, decorators: [{ type: Inject, args: [MAT_SELECT_SCROLL_STRATEGY,] }] },
|
---|
769 | { type: LiveAnnouncer },
|
---|
770 | { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_SELECT_CONFIG,] }] }
|
---|
771 | ];
|
---|
772 | _MatSelectBase.propDecorators = {
|
---|
773 | trigger: [{ type: ViewChild, args: ['trigger',] }],
|
---|
774 | panel: [{ type: ViewChild, args: ['panel',] }],
|
---|
775 | _overlayDir: [{ type: ViewChild, args: [CdkConnectedOverlay,] }],
|
---|
776 | panelClass: [{ type: Input }],
|
---|
777 | placeholder: [{ type: Input }],
|
---|
778 | required: [{ type: Input }],
|
---|
779 | multiple: [{ type: Input }],
|
---|
780 | disableOptionCentering: [{ type: Input }],
|
---|
781 | compareWith: [{ type: Input }],
|
---|
782 | value: [{ type: Input }],
|
---|
783 | ariaLabel: [{ type: Input, args: ['aria-label',] }],
|
---|
784 | ariaLabelledby: [{ type: Input, args: ['aria-labelledby',] }],
|
---|
785 | errorStateMatcher: [{ type: Input }],
|
---|
786 | typeaheadDebounceInterval: [{ type: Input }],
|
---|
787 | sortComparator: [{ type: Input }],
|
---|
788 | id: [{ type: Input }],
|
---|
789 | openedChange: [{ type: Output }],
|
---|
790 | _openedStream: [{ type: Output, args: ['opened',] }],
|
---|
791 | _closedStream: [{ type: Output, args: ['closed',] }],
|
---|
792 | selectionChange: [{ type: Output }],
|
---|
793 | valueChange: [{ type: Output }]
|
---|
794 | };
|
---|
795 | export class MatSelect extends _MatSelectBase {
|
---|
796 | constructor() {
|
---|
797 | super(...arguments);
|
---|
798 | /** The scroll position of the overlay panel, calculated to center the selected option. */
|
---|
799 | this._scrollTop = 0;
|
---|
800 | /** The cached font-size of the trigger element. */
|
---|
801 | this._triggerFontSize = 0;
|
---|
802 | /** The value of the select panel's transform-origin property. */
|
---|
803 | this._transformOrigin = 'top';
|
---|
804 | /**
|
---|
805 | * The y-offset of the overlay panel in relation to the trigger's top start corner.
|
---|
806 | * This must be adjusted to align the selected option text over the trigger text.
|
---|
807 | * when the panel opens. Will change based on the y-position of the selected option.
|
---|
808 | */
|
---|
809 | this._offsetY = 0;
|
---|
810 | this._positions = [
|
---|
811 | {
|
---|
812 | originX: 'start',
|
---|
813 | originY: 'top',
|
---|
814 | overlayX: 'start',
|
---|
815 | overlayY: 'top',
|
---|
816 | },
|
---|
817 | {
|
---|
818 | originX: 'start',
|
---|
819 | originY: 'bottom',
|
---|
820 | overlayX: 'start',
|
---|
821 | overlayY: 'bottom',
|
---|
822 | },
|
---|
823 | ];
|
---|
824 | }
|
---|
825 | /**
|
---|
826 | * Calculates the scroll position of the select's overlay panel.
|
---|
827 | *
|
---|
828 | * Attempts to center the selected option in the panel. If the option is
|
---|
829 | * too high or too low in the panel to be scrolled to the center, it clamps the
|
---|
830 | * scroll position to the min or max scroll positions respectively.
|
---|
831 | */
|
---|
832 | _calculateOverlayScroll(selectedIndex, scrollBuffer, maxScroll) {
|
---|
833 | const itemHeight = this._getItemHeight();
|
---|
834 | const optionOffsetFromScrollTop = itemHeight * selectedIndex;
|
---|
835 | const halfOptionHeight = itemHeight / 2;
|
---|
836 | // Starts at the optionOffsetFromScrollTop, which scrolls the option to the top of the
|
---|
837 | // scroll container, then subtracts the scroll buffer to scroll the option down to
|
---|
838 | // the center of the overlay panel. Half the option height must be re-added to the
|
---|
839 | // scrollTop so the option is centered based on its middle, not its top edge.
|
---|
840 | const optimalScrollPosition = optionOffsetFromScrollTop - scrollBuffer + halfOptionHeight;
|
---|
841 | return Math.min(Math.max(0, optimalScrollPosition), maxScroll);
|
---|
842 | }
|
---|
843 | ngOnInit() {
|
---|
844 | super.ngOnInit();
|
---|
845 | this._viewportRuler.change().pipe(takeUntil(this._destroy)).subscribe(() => {
|
---|
846 | if (this.panelOpen) {
|
---|
847 | this._triggerRect = this.trigger.nativeElement.getBoundingClientRect();
|
---|
848 | this._changeDetectorRef.markForCheck();
|
---|
849 | }
|
---|
850 | });
|
---|
851 | }
|
---|
852 | open() {
|
---|
853 | if (super._canOpen()) {
|
---|
854 | super.open();
|
---|
855 | this._triggerRect = this.trigger.nativeElement.getBoundingClientRect();
|
---|
856 | // Note: The computed font-size will be a string pixel value (e.g. "16px").
|
---|
857 | // `parseInt` ignores the trailing 'px' and converts this to a number.
|
---|
858 | this._triggerFontSize =
|
---|
859 | parseInt(getComputedStyle(this.trigger.nativeElement).fontSize || '0');
|
---|
860 | this._calculateOverlayPosition();
|
---|
861 | // Set the font size on the panel element once it exists.
|
---|
862 | this._ngZone.onStable.pipe(take(1)).subscribe(() => {
|
---|
863 | if (this._triggerFontSize && this._overlayDir.overlayRef &&
|
---|
864 | this._overlayDir.overlayRef.overlayElement) {
|
---|
865 | this._overlayDir.overlayRef.overlayElement.style.fontSize = `${this._triggerFontSize}px`;
|
---|
866 | }
|
---|
867 | });
|
---|
868 | }
|
---|
869 | }
|
---|
870 | /** Scrolls the active option into view. */
|
---|
871 | _scrollOptionIntoView(index) {
|
---|
872 | const labelCount = _countGroupLabelsBeforeOption(index, this.options, this.optionGroups);
|
---|
873 | const itemHeight = this._getItemHeight();
|
---|
874 | if (index === 0 && labelCount === 1) {
|
---|
875 | // If we've got one group label before the option and we're at the top option,
|
---|
876 | // scroll the list to the top. This is better UX than scrolling the list to the
|
---|
877 | // top of the option, because it allows the user to read the top group's label.
|
---|
878 | this.panel.nativeElement.scrollTop = 0;
|
---|
879 | }
|
---|
880 | else {
|
---|
881 | this.panel.nativeElement.scrollTop = _getOptionScrollPosition((index + labelCount) * itemHeight, itemHeight, this.panel.nativeElement.scrollTop, SELECT_PANEL_MAX_HEIGHT);
|
---|
882 | }
|
---|
883 | }
|
---|
884 | _positioningSettled() {
|
---|
885 | this._calculateOverlayOffsetX();
|
---|
886 | this.panel.nativeElement.scrollTop = this._scrollTop;
|
---|
887 | }
|
---|
888 | _panelDoneAnimating(isOpen) {
|
---|
889 | if (this.panelOpen) {
|
---|
890 | this._scrollTop = 0;
|
---|
891 | }
|
---|
892 | else {
|
---|
893 | this._overlayDir.offsetX = 0;
|
---|
894 | this._changeDetectorRef.markForCheck();
|
---|
895 | }
|
---|
896 | super._panelDoneAnimating(isOpen);
|
---|
897 | }
|
---|
898 | _getChangeEvent(value) {
|
---|
899 | return new MatSelectChange(this, value);
|
---|
900 | }
|
---|
901 | /**
|
---|
902 | * Sets the x-offset of the overlay panel in relation to the trigger's top start corner.
|
---|
903 | * This must be adjusted to align the selected option text over the trigger text when
|
---|
904 | * the panel opens. Will change based on LTR or RTL text direction. Note that the offset
|
---|
905 | * can't be calculated until the panel has been attached, because we need to know the
|
---|
906 | * content width in order to constrain the panel within the viewport.
|
---|
907 | */
|
---|
908 | _calculateOverlayOffsetX() {
|
---|
909 | const overlayRect = this._overlayDir.overlayRef.overlayElement.getBoundingClientRect();
|
---|
910 | const viewportSize = this._viewportRuler.getViewportSize();
|
---|
911 | const isRtl = this._isRtl();
|
---|
912 | const paddingWidth = this.multiple ? SELECT_MULTIPLE_PANEL_PADDING_X + SELECT_PANEL_PADDING_X :
|
---|
913 | SELECT_PANEL_PADDING_X * 2;
|
---|
914 | let offsetX;
|
---|
915 | // Adjust the offset, depending on the option padding.
|
---|
916 | if (this.multiple) {
|
---|
917 | offsetX = SELECT_MULTIPLE_PANEL_PADDING_X;
|
---|
918 | }
|
---|
919 | else if (this.disableOptionCentering) {
|
---|
920 | offsetX = SELECT_PANEL_PADDING_X;
|
---|
921 | }
|
---|
922 | else {
|
---|
923 | let selected = this._selectionModel.selected[0] || this.options.first;
|
---|
924 | offsetX = selected && selected.group ? SELECT_PANEL_INDENT_PADDING_X : SELECT_PANEL_PADDING_X;
|
---|
925 | }
|
---|
926 | // Invert the offset in LTR.
|
---|
927 | if (!isRtl) {
|
---|
928 | offsetX *= -1;
|
---|
929 | }
|
---|
930 | // Determine how much the select overflows on each side.
|
---|
931 | const leftOverflow = 0 - (overlayRect.left + offsetX - (isRtl ? paddingWidth : 0));
|
---|
932 | const rightOverflow = overlayRect.right + offsetX - viewportSize.width
|
---|
933 | + (isRtl ? 0 : paddingWidth);
|
---|
934 | // If the element overflows on either side, reduce the offset to allow it to fit.
|
---|
935 | if (leftOverflow > 0) {
|
---|
936 | offsetX += leftOverflow + SELECT_PANEL_VIEWPORT_PADDING;
|
---|
937 | }
|
---|
938 | else if (rightOverflow > 0) {
|
---|
939 | offsetX -= rightOverflow + SELECT_PANEL_VIEWPORT_PADDING;
|
---|
940 | }
|
---|
941 | // Set the offset directly in order to avoid having to go through change detection and
|
---|
942 | // potentially triggering "changed after it was checked" errors. Round the value to avoid
|
---|
943 | // blurry content in some browsers.
|
---|
944 | this._overlayDir.offsetX = Math.round(offsetX);
|
---|
945 | this._overlayDir.overlayRef.updatePosition();
|
---|
946 | }
|
---|
947 | /**
|
---|
948 | * Calculates the y-offset of the select's overlay panel in relation to the
|
---|
949 | * top start corner of the trigger. It has to be adjusted in order for the
|
---|
950 | * selected option to be aligned over the trigger when the panel opens.
|
---|
951 | */
|
---|
952 | _calculateOverlayOffsetY(selectedIndex, scrollBuffer, maxScroll) {
|
---|
953 | const itemHeight = this._getItemHeight();
|
---|
954 | const optionHeightAdjustment = (itemHeight - this._triggerRect.height) / 2;
|
---|
955 | const maxOptionsDisplayed = Math.floor(SELECT_PANEL_MAX_HEIGHT / itemHeight);
|
---|
956 | let optionOffsetFromPanelTop;
|
---|
957 | // Disable offset if requested by user by returning 0 as value to offset
|
---|
958 | if (this.disableOptionCentering) {
|
---|
959 | return 0;
|
---|
960 | }
|
---|
961 | if (this._scrollTop === 0) {
|
---|
962 | optionOffsetFromPanelTop = selectedIndex * itemHeight;
|
---|
963 | }
|
---|
964 | else if (this._scrollTop === maxScroll) {
|
---|
965 | const firstDisplayedIndex = this._getItemCount() - maxOptionsDisplayed;
|
---|
966 | const selectedDisplayIndex = selectedIndex - firstDisplayedIndex;
|
---|
967 | // The first item is partially out of the viewport. Therefore we need to calculate what
|
---|
968 | // portion of it is shown in the viewport and account for it in our offset.
|
---|
969 | let partialItemHeight = itemHeight - (this._getItemCount() * itemHeight - SELECT_PANEL_MAX_HEIGHT) % itemHeight;
|
---|
970 | // Because the panel height is longer than the height of the options alone,
|
---|
971 | // there is always extra padding at the top or bottom of the panel. When
|
---|
972 | // scrolled to the very bottom, this padding is at the top of the panel and
|
---|
973 | // must be added to the offset.
|
---|
974 | optionOffsetFromPanelTop = selectedDisplayIndex * itemHeight + partialItemHeight;
|
---|
975 | }
|
---|
976 | else {
|
---|
977 | // If the option was scrolled to the middle of the panel using a scroll buffer,
|
---|
978 | // its offset will be the scroll buffer minus the half height that was added to
|
---|
979 | // center it.
|
---|
980 | optionOffsetFromPanelTop = scrollBuffer - itemHeight / 2;
|
---|
981 | }
|
---|
982 | // The final offset is the option's offset from the top, adjusted for the height difference,
|
---|
983 | // multiplied by -1 to ensure that the overlay moves in the correct direction up the page.
|
---|
984 | // The value is rounded to prevent some browsers from blurring the content.
|
---|
985 | return Math.round(optionOffsetFromPanelTop * -1 - optionHeightAdjustment);
|
---|
986 | }
|
---|
987 | /**
|
---|
988 | * Checks that the attempted overlay position will fit within the viewport.
|
---|
989 | * If it will not fit, tries to adjust the scroll position and the associated
|
---|
990 | * y-offset so the panel can open fully on-screen. If it still won't fit,
|
---|
991 | * sets the offset back to 0 to allow the fallback position to take over.
|
---|
992 | */
|
---|
993 | _checkOverlayWithinViewport(maxScroll) {
|
---|
994 | const itemHeight = this._getItemHeight();
|
---|
995 | const viewportSize = this._viewportRuler.getViewportSize();
|
---|
996 | const topSpaceAvailable = this._triggerRect.top - SELECT_PANEL_VIEWPORT_PADDING;
|
---|
997 | const bottomSpaceAvailable = viewportSize.height - this._triggerRect.bottom - SELECT_PANEL_VIEWPORT_PADDING;
|
---|
998 | const panelHeightTop = Math.abs(this._offsetY);
|
---|
999 | const totalPanelHeight = Math.min(this._getItemCount() * itemHeight, SELECT_PANEL_MAX_HEIGHT);
|
---|
1000 | const panelHeightBottom = totalPanelHeight - panelHeightTop - this._triggerRect.height;
|
---|
1001 | if (panelHeightBottom > bottomSpaceAvailable) {
|
---|
1002 | this._adjustPanelUp(panelHeightBottom, bottomSpaceAvailable);
|
---|
1003 | }
|
---|
1004 | else if (panelHeightTop > topSpaceAvailable) {
|
---|
1005 | this._adjustPanelDown(panelHeightTop, topSpaceAvailable, maxScroll);
|
---|
1006 | }
|
---|
1007 | else {
|
---|
1008 | this._transformOrigin = this._getOriginBasedOnOption();
|
---|
1009 | }
|
---|
1010 | }
|
---|
1011 | /** Adjusts the overlay panel up to fit in the viewport. */
|
---|
1012 | _adjustPanelUp(panelHeightBottom, bottomSpaceAvailable) {
|
---|
1013 | // Browsers ignore fractional scroll offsets, so we need to round.
|
---|
1014 | const distanceBelowViewport = Math.round(panelHeightBottom - bottomSpaceAvailable);
|
---|
1015 | // Scrolls the panel up by the distance it was extending past the boundary, then
|
---|
1016 | // adjusts the offset by that amount to move the panel up into the viewport.
|
---|
1017 | this._scrollTop -= distanceBelowViewport;
|
---|
1018 | this._offsetY -= distanceBelowViewport;
|
---|
1019 | this._transformOrigin = this._getOriginBasedOnOption();
|
---|
1020 | // If the panel is scrolled to the very top, it won't be able to fit the panel
|
---|
1021 | // by scrolling, so set the offset to 0 to allow the fallback position to take
|
---|
1022 | // effect.
|
---|
1023 | if (this._scrollTop <= 0) {
|
---|
1024 | this._scrollTop = 0;
|
---|
1025 | this._offsetY = 0;
|
---|
1026 | this._transformOrigin = `50% bottom 0px`;
|
---|
1027 | }
|
---|
1028 | }
|
---|
1029 | /** Adjusts the overlay panel down to fit in the viewport. */
|
---|
1030 | _adjustPanelDown(panelHeightTop, topSpaceAvailable, maxScroll) {
|
---|
1031 | // Browsers ignore fractional scroll offsets, so we need to round.
|
---|
1032 | const distanceAboveViewport = Math.round(panelHeightTop - topSpaceAvailable);
|
---|
1033 | // Scrolls the panel down by the distance it was extending past the boundary, then
|
---|
1034 | // adjusts the offset by that amount to move the panel down into the viewport.
|
---|
1035 | this._scrollTop += distanceAboveViewport;
|
---|
1036 | this._offsetY += distanceAboveViewport;
|
---|
1037 | this._transformOrigin = this._getOriginBasedOnOption();
|
---|
1038 | // If the panel is scrolled to the very bottom, it won't be able to fit the
|
---|
1039 | // panel by scrolling, so set the offset to 0 to allow the fallback position
|
---|
1040 | // to take effect.
|
---|
1041 | if (this._scrollTop >= maxScroll) {
|
---|
1042 | this._scrollTop = maxScroll;
|
---|
1043 | this._offsetY = 0;
|
---|
1044 | this._transformOrigin = `50% top 0px`;
|
---|
1045 | return;
|
---|
1046 | }
|
---|
1047 | }
|
---|
1048 | /** Calculates the scroll position and x- and y-offsets of the overlay panel. */
|
---|
1049 | _calculateOverlayPosition() {
|
---|
1050 | const itemHeight = this._getItemHeight();
|
---|
1051 | const items = this._getItemCount();
|
---|
1052 | const panelHeight = Math.min(items * itemHeight, SELECT_PANEL_MAX_HEIGHT);
|
---|
1053 | const scrollContainerHeight = items * itemHeight;
|
---|
1054 | // The farthest the panel can be scrolled before it hits the bottom
|
---|
1055 | const maxScroll = scrollContainerHeight - panelHeight;
|
---|
1056 | // If no value is selected we open the popup to the first item.
|
---|
1057 | let selectedOptionOffset;
|
---|
1058 | if (this.empty) {
|
---|
1059 | selectedOptionOffset = 0;
|
---|
1060 | }
|
---|
1061 | else {
|
---|
1062 | selectedOptionOffset =
|
---|
1063 | Math.max(this.options.toArray().indexOf(this._selectionModel.selected[0]), 0);
|
---|
1064 | }
|
---|
1065 | selectedOptionOffset += _countGroupLabelsBeforeOption(selectedOptionOffset, this.options, this.optionGroups);
|
---|
1066 | // We must maintain a scroll buffer so the selected option will be scrolled to the
|
---|
1067 | // center of the overlay panel rather than the top.
|
---|
1068 | const scrollBuffer = panelHeight / 2;
|
---|
1069 | this._scrollTop = this._calculateOverlayScroll(selectedOptionOffset, scrollBuffer, maxScroll);
|
---|
1070 | this._offsetY = this._calculateOverlayOffsetY(selectedOptionOffset, scrollBuffer, maxScroll);
|
---|
1071 | this._checkOverlayWithinViewport(maxScroll);
|
---|
1072 | }
|
---|
1073 | /** Sets the transform origin point based on the selected option. */
|
---|
1074 | _getOriginBasedOnOption() {
|
---|
1075 | const itemHeight = this._getItemHeight();
|
---|
1076 | const optionHeightAdjustment = (itemHeight - this._triggerRect.height) / 2;
|
---|
1077 | const originY = Math.abs(this._offsetY) - optionHeightAdjustment + itemHeight / 2;
|
---|
1078 | return `50% ${originY}px 0px`;
|
---|
1079 | }
|
---|
1080 | /** Calculates the height of the select's options. */
|
---|
1081 | _getItemHeight() {
|
---|
1082 | return this._triggerFontSize * SELECT_ITEM_HEIGHT_EM;
|
---|
1083 | }
|
---|
1084 | /** Calculates the amount of items in the select. This includes options and group labels. */
|
---|
1085 | _getItemCount() {
|
---|
1086 | return this.options.length + this.optionGroups.length;
|
---|
1087 | }
|
---|
1088 | }
|
---|
1089 | MatSelect.decorators = [
|
---|
1090 | { type: Component, args: [{
|
---|
1091 | selector: 'mat-select',
|
---|
1092 | exportAs: 'matSelect',
|
---|
1093 | template: "<!--\n Note that the select trigger element specifies `aria-owns` pointing to the listbox overlay.\n While aria-owns is not required for the ARIA 1.2 `role=\"combobox\"` interaction pattern,\n it fixes an issue with VoiceOver when the select appears inside of an `aria-model=\"true\"`\n element (e.g. a dialog). Without this `aria-owns`, the `aria-modal` on a dialog prevents\n VoiceOver from \"seeing\" the select's listbox overlay for aria-activedescendant.\n Using `aria-owns` re-parents the select overlay so that it works again.\n See https://github.com/angular/components/issues/20694\n-->\n<div cdk-overlay-origin\n [attr.aria-owns]=\"panelOpen ? id + '-panel' : null\"\n class=\"mat-select-trigger\"\n (click)=\"toggle()\"\n #origin=\"cdkOverlayOrigin\"\n #trigger>\n <div class=\"mat-select-value\" [ngSwitch]=\"empty\" [attr.id]=\"_valueId\">\n <span class=\"mat-select-placeholder mat-select-min-line\" *ngSwitchCase=\"true\">{{placeholder}}</span>\n <span class=\"mat-select-value-text\" *ngSwitchCase=\"false\" [ngSwitch]=\"!!customTrigger\">\n <span class=\"mat-select-min-line\" *ngSwitchDefault>{{triggerValue}}</span>\n <ng-content select=\"mat-select-trigger\" *ngSwitchCase=\"true\"></ng-content>\n </span>\n </div>\n\n <div class=\"mat-select-arrow-wrapper\"><div class=\"mat-select-arrow\"></div></div>\n</div>\n\n<ng-template\n cdk-connected-overlay\n cdkConnectedOverlayLockPosition\n cdkConnectedOverlayHasBackdrop\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayPanelClass]=\"_overlayPanelClass\"\n [cdkConnectedOverlayScrollStrategy]=\"_scrollStrategy\"\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"panelOpen\"\n [cdkConnectedOverlayPositions]=\"_positions\"\n [cdkConnectedOverlayMinWidth]=\"_triggerRect?.width!\"\n [cdkConnectedOverlayOffsetY]=\"_offsetY\"\n (backdropClick)=\"close()\"\n (attach)=\"_onAttached()\"\n (detach)=\"close()\">\n <div class=\"mat-select-panel-wrap\" [@transformPanelWrap]>\n <div\n #panel\n role=\"listbox\"\n tabindex=\"-1\"\n class=\"mat-select-panel {{ _getPanelTheme() }}\"\n [attr.id]=\"id + '-panel'\"\n [attr.aria-multiselectable]=\"multiple\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"_getPanelAriaLabelledby()\"\n [ngClass]=\"panelClass\"\n [@transformPanel]=\"multiple ? 'showing-multiple' : 'showing'\"\n (@transformPanel.done)=\"_panelDoneAnimatingStream.next($event.toState)\"\n [style.transformOrigin]=\"_transformOrigin\"\n [style.font-size.px]=\"_triggerFontSize\"\n (keydown)=\"_handleKeydown($event)\">\n <ng-content></ng-content>\n </div>\n </div>\n</ng-template>\n",
|
---|
1094 | inputs: ['disabled', 'disableRipple', 'tabIndex'],
|
---|
1095 | encapsulation: ViewEncapsulation.None,
|
---|
1096 | changeDetection: ChangeDetectionStrategy.OnPush,
|
---|
1097 | host: {
|
---|
1098 | 'role': 'combobox',
|
---|
1099 | 'aria-autocomplete': 'none',
|
---|
1100 | // TODO(crisbeto): the value for aria-haspopup should be `listbox`, but currently it's difficult
|
---|
1101 | // to sync into Google, because of an outdated automated a11y check which flags it as an invalid
|
---|
1102 | // value. At some point we should try to switch it back to being `listbox`.
|
---|
1103 | 'aria-haspopup': 'true',
|
---|
1104 | 'class': 'mat-select',
|
---|
1105 | '[attr.id]': 'id',
|
---|
1106 | '[attr.tabindex]': 'tabIndex',
|
---|
1107 | '[attr.aria-controls]': 'panelOpen ? id + "-panel" : null',
|
---|
1108 | '[attr.aria-expanded]': 'panelOpen',
|
---|
1109 | '[attr.aria-label]': 'ariaLabel || null',
|
---|
1110 | '[attr.aria-required]': 'required.toString()',
|
---|
1111 | '[attr.aria-disabled]': 'disabled.toString()',
|
---|
1112 | '[attr.aria-invalid]': 'errorState',
|
---|
1113 | '[attr.aria-describedby]': '_ariaDescribedby || null',
|
---|
1114 | '[attr.aria-activedescendant]': '_getAriaActiveDescendant()',
|
---|
1115 | '[class.mat-select-disabled]': 'disabled',
|
---|
1116 | '[class.mat-select-invalid]': 'errorState',
|
---|
1117 | '[class.mat-select-required]': 'required',
|
---|
1118 | '[class.mat-select-empty]': 'empty',
|
---|
1119 | '[class.mat-select-multiple]': 'multiple',
|
---|
1120 | '(keydown)': '_handleKeydown($event)',
|
---|
1121 | '(focus)': '_onFocus()',
|
---|
1122 | '(blur)': '_onBlur()',
|
---|
1123 | },
|
---|
1124 | animations: [
|
---|
1125 | matSelectAnimations.transformPanelWrap,
|
---|
1126 | matSelectAnimations.transformPanel
|
---|
1127 | ],
|
---|
1128 | providers: [
|
---|
1129 | { provide: MatFormFieldControl, useExisting: MatSelect },
|
---|
1130 | { provide: MAT_OPTION_PARENT_COMPONENT, useExisting: MatSelect }
|
---|
1131 | ],
|
---|
1132 | styles: [".mat-select{display:inline-block;width:100%;outline:none}.mat-select-trigger{display:inline-table;cursor:pointer;position:relative;box-sizing:border-box}.mat-select-disabled .mat-select-trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.mat-select-value{display:table-cell;max-width:0;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-select-arrow-wrapper{display:table-cell;vertical-align:middle}.mat-form-field-appearance-fill .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:translateY(-25%)}.mat-form-field-appearance-standard.mat-form-field-has-label .mat-select:not(.mat-select-empty) .mat-select-arrow-wrapper{transform:translateY(-50%)}.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable.mat-form-field-appearance-standard .mat-select.mat-select-empty .mat-select-arrow-wrapper{transition:none}.mat-select-arrow{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;margin:0 4px}.mat-select-panel-wrap{flex-basis:100%}.mat-select-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;padding-top:0;padding-bottom:0;max-height:256px;min-width:100%;border-radius:4px;outline:0}.cdk-high-contrast-active .mat-select-panel{outline:solid 1px}.mat-select-panel .mat-optgroup-label,.mat-select-panel .mat-option{font-size:inherit;line-height:3em;height:3em}.mat-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-form-field-flex{cursor:pointer}.mat-form-field-type-mat-select .mat-form-field-label{width:calc(100% - 18px)}.mat-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}._mat-animation-noopable .mat-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-select-placeholder{color:transparent;-webkit-text-fill-color:transparent;transition:none;display:block}.mat-select-min-line:empty::before{content:\" \";white-space:pre;width:1px;display:inline-block;opacity:0}\n"]
|
---|
1133 | },] }
|
---|
1134 | ];
|
---|
1135 | MatSelect.propDecorators = {
|
---|
1136 | options: [{ type: ContentChildren, args: [MatOption, { descendants: true },] }],
|
---|
1137 | optionGroups: [{ type: ContentChildren, args: [MAT_OPTGROUP, { descendants: true },] }],
|
---|
1138 | customTrigger: [{ type: ContentChild, args: [MAT_SELECT_TRIGGER,] }]
|
---|
1139 | };
|
---|
1140 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VsZWN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21hdGVyaWFsL3NlbGVjdC9zZWxlY3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFDLDBCQUEwQixFQUFFLGFBQWEsRUFBQyxNQUFNLG1CQUFtQixDQUFDO0FBQzVFLE9BQU8sRUFBQyxjQUFjLEVBQUMsTUFBTSxtQkFBbUIsQ0FBQztBQUNqRCxPQUFPLEVBRUwscUJBQXFCLEVBQ3JCLG9CQUFvQixFQUVyQixNQUFNLHVCQUF1QixDQUFDO0FBQy9CLE9BQU8sRUFBQyxjQUFjLEVBQUMsTUFBTSwwQkFBMEIsQ0FBQztBQUN4RCxPQUFPLEVBQ0wsQ0FBQyxFQUNELFVBQVUsRUFDVixLQUFLLEVBQ0wsY0FBYyxFQUNkLFVBQVUsRUFDVixXQUF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