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 { FocusKeyManager } from '@angular/cdk/a11y';
|
---|
9 | import { Directionality } from '@angular/cdk/bidi';
|
---|
10 | import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
---|
11 | import { SelectionModel } from '@angular/cdk/collections';
|
---|
12 | import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChildren, ElementRef, EventEmitter, Input, Optional, Output, QueryList, Self, ViewEncapsulation, } from '@angular/core';
|
---|
13 | import { FormGroupDirective, NgControl, NgForm } from '@angular/forms';
|
---|
14 | import { ErrorStateMatcher, mixinErrorState, } from '@angular/material/core';
|
---|
15 | import { MatFormFieldControl } from '@angular/material/form-field';
|
---|
16 | import { merge, Subject } from 'rxjs';
|
---|
17 | import { startWith, takeUntil } from 'rxjs/operators';
|
---|
18 | import { MatChip } from './chip';
|
---|
19 | // Boilerplate for applying mixins to MatChipList.
|
---|
20 | /** @docs-private */
|
---|
21 | const _MatChipListBase = mixinErrorState(class {
|
---|
22 | constructor(_defaultErrorStateMatcher, _parentForm, _parentFormGroup,
|
---|
23 | /** @docs-private */
|
---|
24 | ngControl) {
|
---|
25 | this._defaultErrorStateMatcher = _defaultErrorStateMatcher;
|
---|
26 | this._parentForm = _parentForm;
|
---|
27 | this._parentFormGroup = _parentFormGroup;
|
---|
28 | this.ngControl = ngControl;
|
---|
29 | }
|
---|
30 | });
|
---|
31 | // Increasing integer for generating unique ids for chip-list components.
|
---|
32 | let nextUniqueId = 0;
|
---|
33 | /** Change event object that is emitted when the chip list value has changed. */
|
---|
34 | export class MatChipListChange {
|
---|
35 | constructor(
|
---|
36 | /** Chip list that emitted the event. */
|
---|
37 | source,
|
---|
38 | /** Value of the chip list when the event was emitted. */
|
---|
39 | value) {
|
---|
40 | this.source = source;
|
---|
41 | this.value = value;
|
---|
42 | }
|
---|
43 | }
|
---|
44 | /**
|
---|
45 | * A material design chips component (named ChipList for its similarity to the List component).
|
---|
46 | */
|
---|
47 | export class MatChipList extends _MatChipListBase {
|
---|
48 | constructor(_elementRef, _changeDetectorRef, _dir, _parentForm, _parentFormGroup, _defaultErrorStateMatcher, ngControl) {
|
---|
49 | super(_defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl);
|
---|
50 | this._elementRef = _elementRef;
|
---|
51 | this._changeDetectorRef = _changeDetectorRef;
|
---|
52 | this._dir = _dir;
|
---|
53 | /**
|
---|
54 | * Implemented as part of MatFormFieldControl.
|
---|
55 | * @docs-private
|
---|
56 | */
|
---|
57 | this.controlType = 'mat-chip-list';
|
---|
58 | /**
|
---|
59 | * When a chip is destroyed, we store the index of the destroyed chip until the chips
|
---|
60 | * query list notifies about the update. This is necessary because we cannot determine an
|
---|
61 | * appropriate chip that should receive focus until the array of chips updated completely.
|
---|
62 | */
|
---|
63 | this._lastDestroyedChipIndex = null;
|
---|
64 | /** Subject that emits when the component has been destroyed. */
|
---|
65 | this._destroyed = new Subject();
|
---|
66 | /** Uid of the chip list */
|
---|
67 | this._uid = `mat-chip-list-${nextUniqueId++}`;
|
---|
68 | /** Tab index for the chip list. */
|
---|
69 | this._tabIndex = 0;
|
---|
70 | /**
|
---|
71 | * User defined tab index.
|
---|
72 | * When it is not null, use user defined tab index. Otherwise use _tabIndex
|
---|
73 | */
|
---|
74 | this._userTabIndex = null;
|
---|
75 | /** Function when touched */
|
---|
76 | this._onTouched = () => { };
|
---|
77 | /** Function when changed */
|
---|
78 | this._onChange = () => { };
|
---|
79 | this._multiple = false;
|
---|
80 | this._compareWith = (o1, o2) => o1 === o2;
|
---|
81 | this._required = false;
|
---|
82 | this._disabled = false;
|
---|
83 | /** Orientation of the chip list. */
|
---|
84 | this.ariaOrientation = 'horizontal';
|
---|
85 | this._selectable = true;
|
---|
86 | /** Event emitted when the selected chip list value has been changed by the user. */
|
---|
87 | this.change = new EventEmitter();
|
---|
88 | /**
|
---|
89 | * Event that emits whenever the raw value of the chip-list changes. This is here primarily
|
---|
90 | * to facilitate the two-way binding for the `value` input.
|
---|
91 | * @docs-private
|
---|
92 | */
|
---|
93 | this.valueChange = new EventEmitter();
|
---|
94 | if (this.ngControl) {
|
---|
95 | this.ngControl.valueAccessor = this;
|
---|
96 | }
|
---|
97 | }
|
---|
98 | /** The array of selected chips inside chip list. */
|
---|
99 | get selected() {
|
---|
100 | var _a, _b;
|
---|
101 | return this.multiple ? (((_a = this._selectionModel) === null || _a === void 0 ? void 0 : _a.selected) || []) :
|
---|
102 | (_b = this._selectionModel) === null || _b === void 0 ? void 0 : _b.selected[0];
|
---|
103 | }
|
---|
104 | /** The ARIA role applied to the chip list. */
|
---|
105 | get role() { return this.empty ? null : 'listbox'; }
|
---|
106 | /** Whether the user should be allowed to select multiple chips. */
|
---|
107 | get multiple() { return this._multiple; }
|
---|
108 | set multiple(value) {
|
---|
109 | this._multiple = coerceBooleanProperty(value);
|
---|
110 | this._syncChipsState();
|
---|
111 | }
|
---|
112 | /**
|
---|
113 | * A function to compare the option values with the selected values. The first argument
|
---|
114 | * is a value from an option. The second is a value from the selection. A boolean
|
---|
115 | * should be returned.
|
---|
116 | */
|
---|
117 | get compareWith() { return this._compareWith; }
|
---|
118 | set compareWith(fn) {
|
---|
119 | this._compareWith = fn;
|
---|
120 | if (this._selectionModel) {
|
---|
121 | // A different comparator means the selection could change.
|
---|
122 | this._initializeSelection();
|
---|
123 | }
|
---|
124 | }
|
---|
125 | /**
|
---|
126 | * Implemented as part of MatFormFieldControl.
|
---|
127 | * @docs-private
|
---|
128 | */
|
---|
129 | get value() { return this._value; }
|
---|
130 | set value(value) {
|
---|
131 | this.writeValue(value);
|
---|
132 | this._value = value;
|
---|
133 | }
|
---|
134 | /**
|
---|
135 | * Implemented as part of MatFormFieldControl.
|
---|
136 | * @docs-private
|
---|
137 | */
|
---|
138 | get id() {
|
---|
139 | return this._chipInput ? this._chipInput.id : this._uid;
|
---|
140 | }
|
---|
141 | /**
|
---|
142 | * Implemented as part of MatFormFieldControl.
|
---|
143 | * @docs-private
|
---|
144 | */
|
---|
145 | get required() { return this._required; }
|
---|
146 | set required(value) {
|
---|
147 | this._required = coerceBooleanProperty(value);
|
---|
148 | this.stateChanges.next();
|
---|
149 | }
|
---|
150 | /**
|
---|
151 | * Implemented as part of MatFormFieldControl.
|
---|
152 | * @docs-private
|
---|
153 | */
|
---|
154 | get placeholder() {
|
---|
155 | return this._chipInput ? this._chipInput.placeholder : this._placeholder;
|
---|
156 | }
|
---|
157 | set placeholder(value) {
|
---|
158 | this._placeholder = value;
|
---|
159 | this.stateChanges.next();
|
---|
160 | }
|
---|
161 | /** Whether any chips or the matChipInput inside of this chip-list has focus. */
|
---|
162 | get focused() {
|
---|
163 | return (this._chipInput && this._chipInput.focused) || this._hasFocusedChip();
|
---|
164 | }
|
---|
165 | /**
|
---|
166 | * Implemented as part of MatFormFieldControl.
|
---|
167 | * @docs-private
|
---|
168 | */
|
---|
169 | get empty() {
|
---|
170 | return (!this._chipInput || this._chipInput.empty) && (!this.chips || this.chips.length === 0);
|
---|
171 | }
|
---|
172 | /**
|
---|
173 | * Implemented as part of MatFormFieldControl.
|
---|
174 | * @docs-private
|
---|
175 | */
|
---|
176 | get shouldLabelFloat() { return !this.empty || this.focused; }
|
---|
177 | /**
|
---|
178 | * Implemented as part of MatFormFieldControl.
|
---|
179 | * @docs-private
|
---|
180 | */
|
---|
181 | get disabled() { return this.ngControl ? !!this.ngControl.disabled : this._disabled; }
|
---|
182 | set disabled(value) {
|
---|
183 | this._disabled = coerceBooleanProperty(value);
|
---|
184 | this._syncChipsState();
|
---|
185 | }
|
---|
186 | /**
|
---|
187 | * Whether or not this chip list is selectable. When a chip list is not selectable,
|
---|
188 | * the selected states for all the chips inside the chip list are always ignored.
|
---|
189 | */
|
---|
190 | get selectable() { return this._selectable; }
|
---|
191 | set selectable(value) {
|
---|
192 | this._selectable = coerceBooleanProperty(value);
|
---|
193 | if (this.chips) {
|
---|
194 | this.chips.forEach(chip => chip.chipListSelectable = this._selectable);
|
---|
195 | }
|
---|
196 | }
|
---|
197 | set tabIndex(value) {
|
---|
198 | this._userTabIndex = value;
|
---|
199 | this._tabIndex = value;
|
---|
200 | }
|
---|
201 | /** Combined stream of all of the child chips' selection change events. */
|
---|
202 | get chipSelectionChanges() {
|
---|
203 | return merge(...this.chips.map(chip => chip.selectionChange));
|
---|
204 | }
|
---|
205 | /** Combined stream of all of the child chips' focus change events. */
|
---|
206 | get chipFocusChanges() {
|
---|
207 | return merge(...this.chips.map(chip => chip._onFocus));
|
---|
208 | }
|
---|
209 | /** Combined stream of all of the child chips' blur change events. */
|
---|
210 | get chipBlurChanges() {
|
---|
211 | return merge(...this.chips.map(chip => chip._onBlur));
|
---|
212 | }
|
---|
213 | /** Combined stream of all of the child chips' remove change events. */
|
---|
214 | get chipRemoveChanges() {
|
---|
215 | return merge(...this.chips.map(chip => chip.destroyed));
|
---|
216 | }
|
---|
217 | ngAfterContentInit() {
|
---|
218 | this._keyManager = new FocusKeyManager(this.chips)
|
---|
219 | .withWrap()
|
---|
220 | .withVerticalOrientation()
|
---|
221 | .withHomeAndEnd()
|
---|
222 | .withHorizontalOrientation(this._dir ? this._dir.value : 'ltr');
|
---|
223 | if (this._dir) {
|
---|
224 | this._dir.change
|
---|
225 | .pipe(takeUntil(this._destroyed))
|
---|
226 | .subscribe(dir => this._keyManager.withHorizontalOrientation(dir));
|
---|
227 | }
|
---|
228 | this._keyManager.tabOut.pipe(takeUntil(this._destroyed)).subscribe(() => {
|
---|
229 | this._allowFocusEscape();
|
---|
230 | });
|
---|
231 | // When the list changes, re-subscribe
|
---|
232 | this.chips.changes.pipe(startWith(null), takeUntil(this._destroyed)).subscribe(() => {
|
---|
233 | if (this.disabled) {
|
---|
234 | // Since this happens after the content has been
|
---|
235 | // checked, we need to defer it to the next tick.
|
---|
236 | Promise.resolve().then(() => {
|
---|
237 | this._syncChipsState();
|
---|
238 | });
|
---|
239 | }
|
---|
240 | this._resetChips();
|
---|
241 | // Reset chips selected/deselected status
|
---|
242 | this._initializeSelection();
|
---|
243 | // Check to see if we need to update our tab index
|
---|
244 | this._updateTabIndex();
|
---|
245 | // Check to see if we have a destroyed chip and need to refocus
|
---|
246 | this._updateFocusForDestroyedChips();
|
---|
247 | this.stateChanges.next();
|
---|
248 | });
|
---|
249 | }
|
---|
250 | ngOnInit() {
|
---|
251 | this._selectionModel = new SelectionModel(this.multiple, undefined, false);
|
---|
252 | this.stateChanges.next();
|
---|
253 | }
|
---|
254 | ngDoCheck() {
|
---|
255 | if (this.ngControl) {
|
---|
256 | // We need to re-evaluate this on every change detection cycle, because there are some
|
---|
257 | // error triggers that we can't subscribe to (e.g. parent form submissions). This means
|
---|
258 | // that whatever logic is in here has to be super lean or we risk destroying the performance.
|
---|
259 | this.updateErrorState();
|
---|
260 | if (this.ngControl.disabled !== this._disabled) {
|
---|
261 | this.disabled = !!this.ngControl.disabled;
|
---|
262 | }
|
---|
263 | }
|
---|
264 | }
|
---|
265 | ngOnDestroy() {
|
---|
266 | this._destroyed.next();
|
---|
267 | this._destroyed.complete();
|
---|
268 | this.stateChanges.complete();
|
---|
269 | this._dropSubscriptions();
|
---|
270 | }
|
---|
271 | /** Associates an HTML input element with this chip list. */
|
---|
272 | registerInput(inputElement) {
|
---|
273 | this._chipInput = inputElement;
|
---|
274 | // We use this attribute to match the chip list to its input in test harnesses.
|
---|
275 | // Set the attribute directly here to avoid "changed after checked" errors.
|
---|
276 | this._elementRef.nativeElement.setAttribute('data-mat-chip-input', inputElement.id);
|
---|
277 | }
|
---|
278 | /**
|
---|
279 | * Implemented as part of MatFormFieldControl.
|
---|
280 | * @docs-private
|
---|
281 | */
|
---|
282 | setDescribedByIds(ids) { this._ariaDescribedby = ids.join(' '); }
|
---|
283 | // Implemented as part of ControlValueAccessor.
|
---|
284 | writeValue(value) {
|
---|
285 | if (this.chips) {
|
---|
286 | this._setSelectionByValue(value, false);
|
---|
287 | }
|
---|
288 | }
|
---|
289 | // Implemented as part of ControlValueAccessor.
|
---|
290 | registerOnChange(fn) {
|
---|
291 | this._onChange = fn;
|
---|
292 | }
|
---|
293 | // Implemented as part of ControlValueAccessor.
|
---|
294 | registerOnTouched(fn) {
|
---|
295 | this._onTouched = fn;
|
---|
296 | }
|
---|
297 | // Implemented as part of ControlValueAccessor.
|
---|
298 | setDisabledState(isDisabled) {
|
---|
299 | this.disabled = isDisabled;
|
---|
300 | this.stateChanges.next();
|
---|
301 | }
|
---|
302 | /**
|
---|
303 | * Implemented as part of MatFormFieldControl.
|
---|
304 | * @docs-private
|
---|
305 | */
|
---|
306 | onContainerClick(event) {
|
---|
307 | if (!this._originatesFromChip(event)) {
|
---|
308 | this.focus();
|
---|
309 | }
|
---|
310 | }
|
---|
311 | /**
|
---|
312 | * Focuses the first non-disabled chip in this chip list, or the associated input when there
|
---|
313 | * are no eligible chips.
|
---|
314 | */
|
---|
315 | focus(options) {
|
---|
316 | if (this.disabled) {
|
---|
317 | return;
|
---|
318 | }
|
---|
319 | // TODO: ARIA says this should focus the first `selected` chip if any are selected.
|
---|
320 | // Focus on first element if there's no chipInput inside chip-list
|
---|
321 | if (this._chipInput && this._chipInput.focused) {
|
---|
322 | // do nothing
|
---|
323 | }
|
---|
324 | else if (this.chips.length > 0) {
|
---|
325 | this._keyManager.setFirstItemActive();
|
---|
326 | this.stateChanges.next();
|
---|
327 | }
|
---|
328 | else {
|
---|
329 | this._focusInput(options);
|
---|
330 | this.stateChanges.next();
|
---|
331 | }
|
---|
332 | }
|
---|
333 | /** Attempt to focus an input if we have one. */
|
---|
334 | _focusInput(options) {
|
---|
335 | if (this._chipInput) {
|
---|
336 | this._chipInput.focus(options);
|
---|
337 | }
|
---|
338 | }
|
---|
339 | /**
|
---|
340 | * Pass events to the keyboard manager. Available here for tests.
|
---|
341 | */
|
---|
342 | _keydown(event) {
|
---|
343 | const target = event.target;
|
---|
344 | if (target && target.classList.contains('mat-chip')) {
|
---|
345 | this._keyManager.onKeydown(event);
|
---|
346 | this.stateChanges.next();
|
---|
347 | }
|
---|
348 | }
|
---|
349 | /**
|
---|
350 | * Check the tab index as you should not be allowed to focus an empty list.
|
---|
351 | */
|
---|
352 | _updateTabIndex() {
|
---|
353 | // If we have 0 chips, we should not allow keyboard focus
|
---|
354 | this._tabIndex = this._userTabIndex || (this.chips.length === 0 ? -1 : 0);
|
---|
355 | }
|
---|
356 | /**
|
---|
357 | * If the amount of chips changed, we need to update the
|
---|
358 | * key manager state and focus the next closest chip.
|
---|
359 | */
|
---|
360 | _updateFocusForDestroyedChips() {
|
---|
361 | // Move focus to the closest chip. If no other chips remain, focus the chip-list itself.
|
---|
362 | if (this._lastDestroyedChipIndex != null) {
|
---|
363 | if (this.chips.length) {
|
---|
364 | const newChipIndex = Math.min(this._lastDestroyedChipIndex, this.chips.length - 1);
|
---|
365 | this._keyManager.setActiveItem(newChipIndex);
|
---|
366 | }
|
---|
367 | else {
|
---|
368 | this.focus();
|
---|
369 | }
|
---|
370 | }
|
---|
371 | this._lastDestroyedChipIndex = null;
|
---|
372 | }
|
---|
373 | /**
|
---|
374 | * Utility to ensure all indexes are valid.
|
---|
375 | *
|
---|
376 | * @param index The index to be checked.
|
---|
377 | * @returns True if the index is valid for our list of chips.
|
---|
378 | */
|
---|
379 | _isValidIndex(index) {
|
---|
380 | return index >= 0 && index < this.chips.length;
|
---|
381 | }
|
---|
382 | _setSelectionByValue(value, isUserInput = true) {
|
---|
383 | this._clearSelection();
|
---|
384 | this.chips.forEach(chip => chip.deselect());
|
---|
385 | if (Array.isArray(value)) {
|
---|
386 | value.forEach(currentValue => this._selectValue(currentValue, isUserInput));
|
---|
387 | this._sortValues();
|
---|
388 | }
|
---|
389 | else {
|
---|
390 | const correspondingChip = this._selectValue(value, isUserInput);
|
---|
391 | // Shift focus to the active item. Note that we shouldn't do this in multiple
|
---|
392 | // mode, because we don't know what chip the user interacted with last.
|
---|
393 | if (correspondingChip) {
|
---|
394 | if (isUserInput) {
|
---|
395 | this._keyManager.setActiveItem(correspondingChip);
|
---|
396 | }
|
---|
397 | }
|
---|
398 | }
|
---|
399 | }
|
---|
400 | /**
|
---|
401 | * Finds and selects the chip based on its value.
|
---|
402 | * @returns Chip that has the corresponding value.
|
---|
403 | */
|
---|
404 | _selectValue(value, isUserInput = true) {
|
---|
405 | const correspondingChip = this.chips.find(chip => {
|
---|
406 | return chip.value != null && this._compareWith(chip.value, value);
|
---|
407 | });
|
---|
408 | if (correspondingChip) {
|
---|
409 | isUserInput ? correspondingChip.selectViaInteraction() : correspondingChip.select();
|
---|
410 | this._selectionModel.select(correspondingChip);
|
---|
411 | }
|
---|
412 | return correspondingChip;
|
---|
413 | }
|
---|
414 | _initializeSelection() {
|
---|
415 | // Defer setting the value in order to avoid the "Expression
|
---|
416 | // has changed after it was checked" errors from Angular.
|
---|
417 | Promise.resolve().then(() => {
|
---|
418 | if (this.ngControl || this._value) {
|
---|
419 | this._setSelectionByValue(this.ngControl ? this.ngControl.value : this._value, false);
|
---|
420 | this.stateChanges.next();
|
---|
421 | }
|
---|
422 | });
|
---|
423 | }
|
---|
424 | /**
|
---|
425 | * Deselects every chip in the list.
|
---|
426 | * @param skip Chip that should not be deselected.
|
---|
427 | */
|
---|
428 | _clearSelection(skip) {
|
---|
429 | this._selectionModel.clear();
|
---|
430 | this.chips.forEach(chip => {
|
---|
431 | if (chip !== skip) {
|
---|
432 | chip.deselect();
|
---|
433 | }
|
---|
434 | });
|
---|
435 | this.stateChanges.next();
|
---|
436 | }
|
---|
437 | /**
|
---|
438 | * Sorts the model values, ensuring that they keep the same
|
---|
439 | * order that they have in the panel.
|
---|
440 | */
|
---|
441 | _sortValues() {
|
---|
442 | if (this._multiple) {
|
---|
443 | this._selectionModel.clear();
|
---|
444 | this.chips.forEach(chip => {
|
---|
445 | if (chip.selected) {
|
---|
446 | this._selectionModel.select(chip);
|
---|
447 | }
|
---|
448 | });
|
---|
449 | this.stateChanges.next();
|
---|
450 | }
|
---|
451 | }
|
---|
452 | /** Emits change event to set the model value. */
|
---|
453 | _propagateChanges(fallbackValue) {
|
---|
454 | let valueToEmit = null;
|
---|
455 | if (Array.isArray(this.selected)) {
|
---|
456 | valueToEmit = this.selected.map(chip => chip.value);
|
---|
457 | }
|
---|
458 | else {
|
---|
459 | valueToEmit = this.selected ? this.selected.value : fallbackValue;
|
---|
460 | }
|
---|
461 | this._value = valueToEmit;
|
---|
462 | this.change.emit(new MatChipListChange(this, valueToEmit));
|
---|
463 | this.valueChange.emit(valueToEmit);
|
---|
464 | this._onChange(valueToEmit);
|
---|
465 | this._changeDetectorRef.markForCheck();
|
---|
466 | }
|
---|
467 | /** When blurred, mark the field as touched when focus moved outside the chip list. */
|
---|
468 | _blur() {
|
---|
469 | if (!this._hasFocusedChip()) {
|
---|
470 | this._keyManager.setActiveItem(-1);
|
---|
471 | }
|
---|
472 | if (!this.disabled) {
|
---|
473 | if (this._chipInput) {
|
---|
474 | // If there's a chip input, we should check whether the focus moved to chip input.
|
---|
475 | // If the focus is not moved to chip input, mark the field as touched. If the focus moved
|
---|
476 | // to chip input, do nothing.
|
---|
477 | // Timeout is needed to wait for the focus() event trigger on chip input.
|
---|
478 | setTimeout(() => {
|
---|
479 | if (!this.focused) {
|
---|
480 | this._markAsTouched();
|
---|
481 | }
|
---|
482 | });
|
---|
483 | }
|
---|
484 | else {
|
---|
485 | // If there's no chip input, then mark the field as touched.
|
---|
486 | this._markAsTouched();
|
---|
487 | }
|
---|
488 | }
|
---|
489 | }
|
---|
490 | /** Mark the field as touched */
|
---|
491 | _markAsTouched() {
|
---|
492 | this._onTouched();
|
---|
493 | this._changeDetectorRef.markForCheck();
|
---|
494 | this.stateChanges.next();
|
---|
495 | }
|
---|
496 | /**
|
---|
497 | * Removes the `tabindex` from the chip list and resets it back afterwards, allowing the
|
---|
498 | * user to tab out of it. This prevents the list from capturing focus and redirecting
|
---|
499 | * it back to the first chip, creating a focus trap, if it user tries to tab away.
|
---|
500 | */
|
---|
501 | _allowFocusEscape() {
|
---|
502 | if (this._tabIndex !== -1) {
|
---|
503 | this._tabIndex = -1;
|
---|
504 | setTimeout(() => {
|
---|
505 | this._tabIndex = this._userTabIndex || 0;
|
---|
506 | this._changeDetectorRef.markForCheck();
|
---|
507 | });
|
---|
508 | }
|
---|
509 | }
|
---|
510 | _resetChips() {
|
---|
511 | this._dropSubscriptions();
|
---|
512 | this._listenToChipsFocus();
|
---|
513 | this._listenToChipsSelection();
|
---|
514 | this._listenToChipsRemoved();
|
---|
515 | }
|
---|
516 | _dropSubscriptions() {
|
---|
517 | if (this._chipFocusSubscription) {
|
---|
518 | this._chipFocusSubscription.unsubscribe();
|
---|
519 | this._chipFocusSubscription = null;
|
---|
520 | }
|
---|
521 | if (this._chipBlurSubscription) {
|
---|
522 | this._chipBlurSubscription.unsubscribe();
|
---|
523 | this._chipBlurSubscription = null;
|
---|
524 | }
|
---|
525 | if (this._chipSelectionSubscription) {
|
---|
526 | this._chipSelectionSubscription.unsubscribe();
|
---|
527 | this._chipSelectionSubscription = null;
|
---|
528 | }
|
---|
529 | if (this._chipRemoveSubscription) {
|
---|
530 | this._chipRemoveSubscription.unsubscribe();
|
---|
531 | this._chipRemoveSubscription = null;
|
---|
532 | }
|
---|
533 | }
|
---|
534 | /** Listens to user-generated selection events on each chip. */
|
---|
535 | _listenToChipsSelection() {
|
---|
536 | this._chipSelectionSubscription = this.chipSelectionChanges.subscribe(event => {
|
---|
537 | event.source.selected
|
---|
538 | ? this._selectionModel.select(event.source)
|
---|
539 | : this._selectionModel.deselect(event.source);
|
---|
540 | // For single selection chip list, make sure the deselected value is unselected.
|
---|
541 | if (!this.multiple) {
|
---|
542 | this.chips.forEach(chip => {
|
---|
543 | if (!this._selectionModel.isSelected(chip) && chip.selected) {
|
---|
544 | chip.deselect();
|
---|
545 | }
|
---|
546 | });
|
---|
547 | }
|
---|
548 | if (event.isUserInput) {
|
---|
549 | this._propagateChanges();
|
---|
550 | }
|
---|
551 | });
|
---|
552 | }
|
---|
553 | /** Listens to user-generated selection events on each chip. */
|
---|
554 | _listenToChipsFocus() {
|
---|
555 | this._chipFocusSubscription = this.chipFocusChanges.subscribe(event => {
|
---|
556 | let chipIndex = this.chips.toArray().indexOf(event.chip);
|
---|
557 | if (this._isValidIndex(chipIndex)) {
|
---|
558 | this._keyManager.updateActiveItem(chipIndex);
|
---|
559 | }
|
---|
560 | this.stateChanges.next();
|
---|
561 | });
|
---|
562 | this._chipBlurSubscription = this.chipBlurChanges.subscribe(() => {
|
---|
563 | this._blur();
|
---|
564 | this.stateChanges.next();
|
---|
565 | });
|
---|
566 | }
|
---|
567 | _listenToChipsRemoved() {
|
---|
568 | this._chipRemoveSubscription = this.chipRemoveChanges.subscribe(event => {
|
---|
569 | const chip = event.chip;
|
---|
570 | const chipIndex = this.chips.toArray().indexOf(event.chip);
|
---|
571 | // In case the chip that will be removed is currently focused, we temporarily store
|
---|
572 | // the index in order to be able to determine an appropriate sibling chip that will
|
---|
573 | // receive focus.
|
---|
574 | if (this._isValidIndex(chipIndex) && chip._hasFocus) {
|
---|
575 | this._lastDestroyedChipIndex = chipIndex;
|
---|
576 | }
|
---|
577 | });
|
---|
578 | }
|
---|
579 | /** Checks whether an event comes from inside a chip element. */
|
---|
580 | _originatesFromChip(event) {
|
---|
581 | let currentElement = event.target;
|
---|
582 | while (currentElement && currentElement !== this._elementRef.nativeElement) {
|
---|
583 | if (currentElement.classList.contains('mat-chip')) {
|
---|
584 | return true;
|
---|
585 | }
|
---|
586 | currentElement = currentElement.parentElement;
|
---|
587 | }
|
---|
588 | return false;
|
---|
589 | }
|
---|
590 | /** Checks whether any of the chips is focused. */
|
---|
591 | _hasFocusedChip() {
|
---|
592 | return this.chips && this.chips.some(chip => chip._hasFocus);
|
---|
593 | }
|
---|
594 | /** Syncs the list's state with the individual chips. */
|
---|
595 | _syncChipsState() {
|
---|
596 | if (this.chips) {
|
---|
597 | this.chips.forEach(chip => {
|
---|
598 | chip._chipListDisabled = this._disabled;
|
---|
599 | chip._chipListMultiple = this.multiple;
|
---|
600 | });
|
---|
601 | }
|
---|
602 | }
|
---|
603 | }
|
---|
604 | MatChipList.decorators = [
|
---|
605 | { type: Component, args: [{
|
---|
606 | selector: 'mat-chip-list',
|
---|
607 | template: `<div class="mat-chip-list-wrapper"><ng-content></ng-content></div>`,
|
---|
608 | exportAs: 'matChipList',
|
---|
609 | host: {
|
---|
610 | '[attr.tabindex]': 'disabled ? null : _tabIndex',
|
---|
611 | '[attr.aria-describedby]': '_ariaDescribedby || null',
|
---|
612 | '[attr.aria-required]': 'role ? required : null',
|
---|
613 | '[attr.aria-disabled]': 'disabled.toString()',
|
---|
614 | '[attr.aria-invalid]': 'errorState',
|
---|
615 | '[attr.aria-multiselectable]': 'multiple',
|
---|
616 | '[attr.role]': 'role',
|
---|
617 | '[class.mat-chip-list-disabled]': 'disabled',
|
---|
618 | '[class.mat-chip-list-invalid]': 'errorState',
|
---|
619 | '[class.mat-chip-list-required]': 'required',
|
---|
620 | '[attr.aria-orientation]': 'ariaOrientation',
|
---|
621 | 'class': 'mat-chip-list',
|
---|
622 | '(focus)': 'focus()',
|
---|
623 | '(blur)': '_blur()',
|
---|
624 | '(keydown)': '_keydown($event)',
|
---|
625 | '[id]': '_uid',
|
---|
626 | },
|
---|
627 | providers: [{ provide: MatFormFieldControl, useExisting: MatChipList }],
|
---|
628 | encapsulation: ViewEncapsulation.None,
|
---|
629 | changeDetection: ChangeDetectionStrategy.OnPush,
|
---|
630 | styles: [".mat-chip{position:relative;box-sizing:border-box;-webkit-tap-highlight-color:transparent;transform:translateZ(0);border:none;-webkit-appearance:none;-moz-appearance:none}.mat-standard-chip{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);display:inline-flex;padding:7px 12px;border-radius:16px;align-items:center;cursor:default;min-height:32px;height:1px}._mat-animation-noopable.mat-standard-chip{transition:none;animation:none}.mat-standard-chip .mat-chip-remove{border:none;-webkit-appearance:none;-moz-appearance:none;padding:0;background:none}.mat-standard-chip .mat-chip-remove.mat-icon,.mat-standard-chip .mat-chip-remove .mat-icon{width:18px;height:18px;font-size:18px}.mat-standard-chip::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;opacity:0;content:\"\";pointer-events:none;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-standard-chip:hover::after{opacity:.12}.mat-standard-chip:focus{outline:none}.mat-standard-chip:focus::after{opacity:.16}.cdk-high-contrast-active .mat-standard-chip{outline:solid 1px}.cdk-high-contrast-active .mat-standard-chip:focus{outline:dotted 2px}.mat-standard-chip.mat-chip-disabled::after{opacity:0}.mat-standard-chip.mat-chip-disabled .mat-chip-remove,.mat-standard-chip.mat-chip-disabled .mat-chip-trailing-icon{cursor:default}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar,.mat-standard-chip.mat-chip-with-avatar{padding-top:0;padding-bottom:0}.mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-right:8px;padding-left:0}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon.mat-chip-with-avatar{padding-left:8px;padding-right:0}.mat-standard-chip.mat-chip-with-trailing-icon{padding-top:7px;padding-bottom:7px;padding-right:8px;padding-left:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-trailing-icon{padding-left:8px;padding-right:12px}.mat-standard-chip.mat-chip-with-avatar{padding-left:0;padding-right:12px}[dir=rtl] .mat-standard-chip.mat-chip-with-avatar{padding-right:0;padding-left:12px}.mat-standard-chip .mat-chip-avatar{width:24px;height:24px;margin-right:8px;margin-left:4px}[dir=rtl] .mat-standard-chip .mat-chip-avatar{margin-left:8px;margin-right:4px}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{width:18px;height:18px;cursor:pointer}.mat-standard-chip .mat-chip-remove,.mat-standard-chip .mat-chip-trailing-icon{margin-left:8px;margin-right:0}[dir=rtl] .mat-standard-chip .mat-chip-remove,[dir=rtl] .mat-standard-chip .mat-chip-trailing-icon{margin-right:8px;margin-left:0}.mat-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit;overflow:hidden}.mat-chip-list-wrapper{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;margin:-4px}.mat-chip-list-wrapper input.mat-input-element,.mat-chip-list-wrapper .mat-standard-chip{margin:4px}.mat-chip-list-stacked .mat-chip-list-wrapper{flex-direction:column;align-items:flex-start}.mat-chip-list-stacked .mat-chip-list-wrapper .mat-standard-chip{width:100%}.mat-chip-avatar{border-radius:50%;justify-content:center;align-items:center;display:flex;overflow:hidden;object-fit:cover}input.mat-chip-input{width:150px;margin:4px;flex:1 0 150px}\n"]
|
---|
631 | },] }
|
---|
632 | ];
|
---|
633 | MatChipList.ctorParameters = () => [
|
---|
634 | { type: ElementRef },
|
---|
635 | { type: ChangeDetectorRef },
|
---|
636 | { type: Directionality, decorators: [{ type: Optional }] },
|
---|
637 | { type: NgForm, decorators: [{ type: Optional }] },
|
---|
638 | { type: FormGroupDirective, decorators: [{ type: Optional }] },
|
---|
639 | { type: ErrorStateMatcher },
|
---|
640 | { type: NgControl, decorators: [{ type: Optional }, { type: Self }] }
|
---|
641 | ];
|
---|
642 | MatChipList.propDecorators = {
|
---|
643 | errorStateMatcher: [{ type: Input }],
|
---|
644 | multiple: [{ type: Input }],
|
---|
645 | compareWith: [{ type: Input }],
|
---|
646 | value: [{ type: Input }],
|
---|
647 | required: [{ type: Input }],
|
---|
648 | placeholder: [{ type: Input }],
|
---|
649 | disabled: [{ type: Input }],
|
---|
650 | ariaOrientation: [{ type: Input, args: ['aria-orientation',] }],
|
---|
651 | selectable: [{ type: Input }],
|
---|
652 | tabIndex: [{ type: Input }],
|
---|
653 | change: [{ type: Output }],
|
---|
654 | valueChange: [{ type: Output }],
|
---|
655 | chips: [{ type: ContentChildren, args: [MatChip, {
|
---|
656 | // We need to use `descendants: true`, because Ivy will no longer match
|
---|
657 | // indirect descendants if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