/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { coerceBooleanProperty } from '@angular/cdk/coercion'; import { TAB } from '@angular/cdk/keycodes'; import { ChangeDetectionStrategy, Component, ContentChildren, EventEmitter, forwardRef, inject, Input, Output, QueryList, ViewEncapsulation, } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { startWith, takeUntil } from 'rxjs/operators'; import { MatChipOption } from './chip-option'; import { MatChipSet } from './chip-set'; import { MAT_CHIPS_DEFAULT_OPTIONS } from './tokens'; import * as i0 from "@angular/core"; /** Change event object that is emitted when the chip listbox value has changed. */ export class MatChipListboxChange { constructor( /** Chip listbox that emitted the event. */ source, /** Value of the chip listbox when the event was emitted. */ value) { this.source = source; this.value = value; } } /** * Provider Expression that allows mat-chip-listbox to register as a ControlValueAccessor. * This allows it to support [(ngModel)]. * @docs-private */ export const MAT_CHIP_LISTBOX_CONTROL_VALUE_ACCESSOR = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => MatChipListbox), multi: true, }; /** * An extension of the MatChipSet component that supports chip selection. * Used with MatChipOption chips. */ export class MatChipListbox extends MatChipSet { constructor() { super(...arguments); /** * Function when touched. Set as part of ControlValueAccessor implementation. * @docs-private */ this._onTouched = () => { }; /** * Function when changed. Set as part of ControlValueAccessor implementation. * @docs-private */ this._onChange = () => { }; // TODO: MDC uses `grid` here this._defaultRole = 'listbox'; /** Default chip options. */ this._defaultOptions = inject(MAT_CHIPS_DEFAULT_OPTIONS, { optional: true }); this._multiple = false; /** Orientation of the chip list. */ this.ariaOrientation = 'horizontal'; this._selectable = true; /** * A function to compare the option values with the selected values. The first argument * is a value from an option. The second is a value from the selection. A boolean * should be returned. */ this.compareWith = (o1, o2) => o1 === o2; this._required = false; this._hideSingleSelectionIndicator = this._defaultOptions?.hideSingleSelectionIndicator ?? false; /** Event emitted when the selected chip listbox value has been changed by the user. */ this.change = new EventEmitter(); this._chips = undefined; } /** Whether the user should be allowed to select multiple chips. */ get multiple() { return this._multiple; } set multiple(value) { this._multiple = coerceBooleanProperty(value); this._syncListboxProperties(); } /** The array of selected chips inside the chip listbox. */ get selected() { const selectedChips = this._chips.toArray().filter(chip => chip.selected); return this.multiple ? selectedChips : selectedChips[0]; } /** * Whether or not this chip listbox is selectable. * * When a chip listbox is not selectable, the selected states for all * the chips inside the chip listbox are always ignored. */ get selectable() { return this._selectable; } set selectable(value) { this._selectable = coerceBooleanProperty(value); this._syncListboxProperties(); } /** Whether this chip listbox is required. */ get required() { return this._required; } set required(value) { this._required = coerceBooleanProperty(value); } /** Whether checkmark indicator for single-selection options is hidden. */ get hideSingleSelectionIndicator() { return this._hideSingleSelectionIndicator; } set hideSingleSelectionIndicator(value) { this._hideSingleSelectionIndicator = coerceBooleanProperty(value); this._syncListboxProperties(); } /** Combined stream of all of the child chips' selection change events. */ get chipSelectionChanges() { return this._getChipStream(chip => chip.selectionChange); } /** Combined stream of all of the child chips' blur events. */ get chipBlurChanges() { return this._getChipStream(chip => chip._onBlur); } /** The value of the listbox, which is the combined value of the selected chips. */ get value() { return this._value; } set value(value) { this.writeValue(value); this._value = value; } ngAfterContentInit() { if (this._pendingInitialValue !== undefined) { Promise.resolve().then(() => { this._setSelectionByValue(this._pendingInitialValue, false); this._pendingInitialValue = undefined; }); } this._chips.changes.pipe(startWith(null), takeUntil(this._destroyed)).subscribe(() => { // Update listbox selectable/multiple properties on chips this._syncListboxProperties(); }); this.chipBlurChanges.pipe(takeUntil(this._destroyed)).subscribe(() => this._blur()); this.chipSelectionChanges.pipe(takeUntil(this._destroyed)).subscribe(event => { if (!this.multiple) { this._chips.forEach(chip => { if (chip !== event.source) { chip._setSelectedState(false, false, false); } }); } if (event.isUserInput) { this._propagateChanges(); } }); } /** * Focuses the first selected chip in this chip listbox, or the first non-disabled chip when there * are no selected chips. */ focus() { if (this.disabled) { return; } const firstSelectedChip = this._getFirstSelectedChip(); if (firstSelectedChip && !firstSelectedChip.disabled) { firstSelectedChip.focus(); } else if (this._chips.length > 0) { this._keyManager.setFirstItemActive(); } else { this._elementRef.nativeElement.focus(); } } /** * Implemented as part of ControlValueAccessor. * @docs-private */ writeValue(value) { if (this._chips) { this._setSelectionByValue(value, false); } else if (value != null) { this._pendingInitialValue = value; } } /** * Implemented as part of ControlValueAccessor. * @docs-private */ registerOnChange(fn) { this._onChange = fn; } /** * Implemented as part of ControlValueAccessor. * @docs-private */ registerOnTouched(fn) { this._onTouched = fn; } /** * Implemented as part of ControlValueAccessor. * @docs-private */ setDisabledState(isDisabled) { this.disabled = isDisabled; } /** Selects all chips with value. */ _setSelectionByValue(value, isUserInput = true) { this._clearSelection(); if (Array.isArray(value)) { value.forEach(currentValue => this._selectValue(currentValue, isUserInput)); } else { this._selectValue(value, isUserInput); } } /** When blurred, marks the field as touched when focus moved outside the chip listbox. */ _blur() { if (!this.disabled) { // Wait to see if focus moves to an individual chip. setTimeout(() => { if (!this.focused) { this._markAsTouched(); } }); } } _keydown(event) { if (event.keyCode === TAB) { super._allowFocusEscape(); } } /** Marks the field as touched */ _markAsTouched() { this._onTouched(); this._changeDetectorRef.markForCheck(); } /** Emits change event to set the model value. */ _propagateChanges() { let valueToEmit = null; if (Array.isArray(this.selected)) { valueToEmit = this.selected.map(chip => chip.value); } else { valueToEmit = this.selected ? this.selected.value : undefined; } this._value = valueToEmit; this.change.emit(new MatChipListboxChange(this, valueToEmit)); this._onChange(valueToEmit); this._changeDetectorRef.markForCheck(); } /** * Deselects every chip in the listbox. * @param skip Chip that should not be deselected. */ _clearSelection(skip) { this._chips.forEach(chip => { if (chip !== skip) { chip.deselect(); } }); } /** * Finds and selects the chip based on its value. * @returns Chip that has the corresponding value. */ _selectValue(value, isUserInput) { const correspondingChip = this._chips.find(chip => { return chip.value != null && this.compareWith(chip.value, value); }); if (correspondingChip) { isUserInput ? correspondingChip.selectViaInteraction() : correspondingChip.select(); } return correspondingChip; } /** Syncs the chip-listbox selection state with the individual chips. */ _syncListboxProperties() { if (this._chips) { // Defer setting the value in order to avoid the "Expression // has changed after it was checked" errors from Angular. Promise.resolve().then(() => { this._chips.forEach(chip => { chip._chipListMultiple = this.multiple; chip.chipListSelectable = this._selectable; chip._chipListHideSingleSelectionIndicator = this.hideSingleSelectionIndicator; chip._changeDetectorRef.markForCheck(); }); }); } } /** Returns the first selected chip in this listbox, or undefined if no chips are selected. */ _getFirstSelectedChip() { if (Array.isArray(this.selected)) { return this.selected.length ? this.selected[0] : undefined; } else { return this.selected; } } /** * Determines if key manager should avoid putting a given chip action in the tab index. Skip * non-interactive actions since the user can't do anything with them. */ _skipPredicate(action) { // Override the skip predicate in the base class to avoid skipping disabled chips. Allow // disabled chip options to receive focus to align with WAI ARIA recommendation. Normally WAI // ARIA's instructions are to exclude disabled items from the tab order, but it makes a few // exceptions for compound widgets. // // From [Developing a Keyboard Interface]( // https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/): // "For the following composite widget elements, keep them focusable when disabled: Options in a // Listbox..." return !action.isInteractive; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatChipListbox, deps: null, target: i0.ɵɵFactoryTarget.Component }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.1", type: MatChipListbox, selector: "mat-chip-listbox", inputs: { tabIndex: "tabIndex", multiple: "multiple", ariaOrientation: ["aria-orientation", "ariaOrientation"], selectable: "selectable", compareWith: "compareWith", required: "required", hideSingleSelectionIndicator: "hideSingleSelectionIndicator", value: "value" }, outputs: { change: "change" }, host: { attributes: { "ngSkipHydration": "" }, listeners: { "focus": "focus()", "blur": "_blur()", "keydown": "_keydown($event)" }, properties: { "attr.role": "role", "tabIndex": "empty ? -1 : tabIndex", "attr.aria-describedby": "_ariaDescribedby || null", "attr.aria-required": "role ? required : null", "attr.aria-disabled": "disabled.toString()", "attr.aria-multiselectable": "multiple", "attr.aria-orientation": "ariaOrientation", "class.mat-mdc-chip-list-disabled": "disabled", "class.mat-mdc-chip-list-required": "required" }, classAttribute: "mdc-evolution-chip-set mat-mdc-chip-listbox" }, providers: [MAT_CHIP_LISTBOX_CONTROL_VALUE_ACCESSOR], queries: [{ propertyName: "_chips", predicate: MatChipOption, descendants: true }], usesInheritance: true, ngImport: i0, template: ` `, isInline: true, styles: [".mdc-evolution-chip-set{display:flex}.mdc-evolution-chip-set:focus{outline:none}.mdc-evolution-chip-set__chips{display:flex;flex-flow:wrap;min-width:0}.mdc-evolution-chip-set--overflow .mdc-evolution-chip-set__chips{flex-flow:nowrap}.mdc-evolution-chip-set .mdc-evolution-chip-set__chips{margin-left:-8px;margin-right:0}[dir=rtl] .mdc-evolution-chip-set .mdc-evolution-chip-set__chips,.mdc-evolution-chip-set .mdc-evolution-chip-set__chips[dir=rtl]{margin-left:0;margin-right:-8px}.mdc-evolution-chip-set .mdc-evolution-chip{margin-left:8px;margin-right:0}[dir=rtl] .mdc-evolution-chip-set .mdc-evolution-chip,.mdc-evolution-chip-set .mdc-evolution-chip[dir=rtl]{margin-left:0;margin-right:8px}.mdc-evolution-chip-set .mdc-evolution-chip{margin-top:4px;margin-bottom:4px}.mat-mdc-chip-set .mdc-evolution-chip-set__chips{min-width:100%}.mat-mdc-chip-set-stacked{flex-direction:column;align-items:flex-start}.mat-mdc-chip-set-stacked .mat-mdc-chip{width:100%}.mat-mdc-chip-set-stacked .mdc-evolution-chip__graphic{flex-grow:0}.mat-mdc-chip-set-stacked .mdc-evolution-chip__action--primary{flex-basis:100%;justify-content:start}input.mat-mdc-chip-input{flex:1 0 150px;margin-left:8px}[dir=rtl] input.mat-mdc-chip-input{margin-left:0;margin-right:8px}"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatChipListbox, decorators: [{ type: Component, args: [{ selector: 'mat-chip-listbox', template: ` `, inputs: ['tabIndex'], host: { 'class': 'mdc-evolution-chip-set mat-mdc-chip-listbox', '[attr.role]': 'role', '[tabIndex]': 'empty ? -1 : tabIndex', // TODO: replace this binding with use of AriaDescriber '[attr.aria-describedby]': '_ariaDescribedby || null', '[attr.aria-required]': 'role ? required : null', '[attr.aria-disabled]': 'disabled.toString()', '[attr.aria-multiselectable]': 'multiple', '[attr.aria-orientation]': 'ariaOrientation', 'ngSkipHydration': '', '[class.mat-mdc-chip-list-disabled]': 'disabled', '[class.mat-mdc-chip-list-required]': 'required', '(focus)': 'focus()', '(blur)': '_blur()', '(keydown)': '_keydown($event)', }, providers: [MAT_CHIP_LISTBOX_CONTROL_VALUE_ACCESSOR], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".mdc-evolution-chip-set{display:flex}.mdc-evolution-chip-set:focus{outline:none}.mdc-evolution-chip-set__chips{display:flex;flex-flow:wrap;min-width:0}.mdc-evolution-chip-set--overflow .mdc-evolution-chip-set__chips{flex-flow:nowrap}.mdc-evolution-chip-set .mdc-evolution-chip-set__chips{margin-left:-8px;margin-right:0}[dir=rtl] .mdc-evolution-chip-set .mdc-evolution-chip-set__chips,.mdc-evolution-chip-set .mdc-evolution-chip-set__chips[dir=rtl]{margin-left:0;margin-right:-8px}.mdc-evolution-chip-set .mdc-evolution-chip{margin-left:8px;margin-right:0}[dir=rtl] .mdc-evolution-chip-set .mdc-evolution-chip,.mdc-evolution-chip-set .mdc-evolution-chip[dir=rtl]{margin-left:0;margin-right:8px}.mdc-evolution-chip-set .mdc-evolution-chip{margin-top:4px;margin-bottom:4px}.mat-mdc-chip-set .mdc-evolution-chip-set__chips{min-width:100%}.mat-mdc-chip-set-stacked{flex-direction:column;align-items:flex-start}.mat-mdc-chip-set-stacked .mat-mdc-chip{width:100%}.mat-mdc-chip-set-stacked .mdc-evolution-chip__graphic{flex-grow:0}.mat-mdc-chip-set-stacked .mdc-evolution-chip__action--primary{flex-basis:100%;justify-content:start}input.mat-mdc-chip-input{flex:1 0 150px;margin-left:8px}[dir=rtl] input.mat-mdc-chip-input{margin-left:0;margin-right:8px}"] }] }], propDecorators: { multiple: [{ type: Input }], ariaOrientation: [{ type: Input, args: ['aria-orientation'] }], selectable: [{ type: Input }], compareWith: [{ type: Input }], required: [{ type: Input }], hideSingleSelectionIndicator: [{ type: Input }], value: [{ type: Input }], change: [{ type: Output }], _chips: [{ type: ContentChildren, args: [MatChipOption, { // We need to use `descendants: true`, because Ivy will no longer match // indirect descendants if it's left as false. descendants: true, }] }] } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hpcC1saXN0Ym94LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21hdGVyaWFsL2NoaXBzL2NoaXAtbGlzdGJveC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFFSCxPQUFPLEVBQWUscUJBQXFCLEVBQUMsTUFBTSx1QkFBdUIsQ0FBQztBQUUxRSxPQUFPLEVBQUMsR0FBRyxFQUFDLE1BQU0sdUJBQXVCLENBQUM7QUFDMUMsT0FBTyxFQUVMLHVCQUF1QixFQUN2QixTQUFTLEVBQ1QsZUFBZSxFQUNmLFlBQVksRUFDWixVQUFVLEVBQ1YsTUFBTSxFQUNOLEtBQUssRUFFTCxNQUFNLEVBQ04sU0FBUyxFQUNULGlCQUFpQixHQUNsQixNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBQXVCLGlCQUFpQixFQUFDLE1BQU0sZ0JBQWdCLENBQUM7QUFFdkUsT0FBTyxFQUFDLFNBQVMsRUFBRSxTQUFTLEVBQUMsTUFBTSxnQkFBZ0IsQ0FBQztBQUVwRCxPQUFPLEVBQUMsYUFBYSxFQUF5QixNQUFNLGVBQWUsQ0FBQztBQUNwRSxPQUFPLEVBQUMsVUFBVSxFQUFDLE1BQ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