blob: 568ae1c865b2ac3fe0a791a7dbe9554b76fdd138 [file] [log] [blame]
{"version":3,"file":"material-chips.umd.min.js","sources":["../../node_modules/tslib/tslib.es6.js","../../src/material/chips/chip.ts","../../src/material/chips/chip-default-options.ts","../../src/material/chips/chip-list.ts","../../src/material/chips/chip-input.ts","../../src/material/chips/chips-module.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {FocusableOption} from '@angular/cdk/a11y';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {BACKSPACE, DELETE, SPACE} from '@angular/cdk/keycodes';\nimport {Platform} from '@angular/cdk/platform';\nimport {\n ContentChild,\n Directive,\n ElementRef,\n EventEmitter,\n forwardRef,\n Inject,\n Input,\n NgZone,\n OnDestroy,\n Optional,\n Output,\n} from '@angular/core';\nimport {\n CanColor,\n CanColorCtor,\n CanDisable,\n CanDisableCtor,\n CanDisableRipple,\n CanDisableRippleCtor,\n MAT_RIPPLE_GLOBAL_OPTIONS,\n mixinColor,\n mixinDisabled,\n mixinDisableRipple,\n RippleConfig,\n RippleGlobalOptions,\n RippleRenderer,\n RippleTarget,\n} from '@angular/material/core';\nimport {Subject} from 'rxjs';\nimport {take} from 'rxjs/operators';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\n\n\n/** Represents an event fired on an individual `mat-chip`. */\nexport interface MatChipEvent {\n /** The chip the event was fired on. */\n chip: MatChip;\n}\n\n/** Event object emitted by MatChip when selected or deselected. */\nexport class MatChipSelectionChange {\n constructor(\n /** Reference to the chip that emitted the event. */\n public source: MatChip,\n /** Whether the chip that emitted the event is selected. */\n public selected: boolean,\n /** Whether the selection change was a result of a user interaction. */\n public isUserInput = false) { }\n}\n\n\n// Boilerplate for applying mixins to MatChip.\n/** @docs-private */\nclass MatChipBase {\n constructor(public _elementRef: ElementRef) {}\n}\n\nconst _MatChipMixinBase: CanColorCtor & CanDisableRippleCtor & CanDisableCtor & typeof MatChipBase =\n mixinColor(mixinDisableRipple(mixinDisabled(MatChipBase)), 'primary');\n\n/**\n * Dummy directive to add CSS class to chip avatar.\n * @docs-private\n */\n@Directive({\n selector: 'mat-chip-avatar, [matChipAvatar]',\n host: {'class': 'mat-chip-avatar'}\n})\nexport class MatChipAvatar {}\n\n/**\n * Dummy directive to add CSS class to chip trailing icon.\n * @docs-private\n */\n@Directive({\n selector: 'mat-chip-trailing-icon, [matChipTrailingIcon]',\n host: {'class': 'mat-chip-trailing-icon'}\n})\nexport class MatChipTrailingIcon {}\n\n/**\n * Material design styled Chip component. Used inside the MatChipList component.\n */\n@Directive({\n selector: `mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]`,\n inputs: ['color', 'disabled', 'disableRipple'],\n exportAs: 'matChip',\n host: {\n 'class': 'mat-chip',\n '[attr.tabindex]': 'disabled ? null : -1',\n 'role': 'option',\n '[class.mat-chip-selected]': 'selected',\n '[class.mat-chip-with-avatar]': 'avatar',\n '[class.mat-chip-with-trailing-icon]': 'trailingIcon || removeIcon',\n '[class.mat-chip-disabled]': 'disabled',\n '[class._mat-animation-noopable]': '_animationsDisabled',\n '[attr.disabled]': 'disabled || null',\n '[attr.aria-disabled]': 'disabled.toString()',\n '[attr.aria-selected]': 'ariaSelected',\n '(click)': '_handleClick($event)',\n '(keydown)': '_handleKeydown($event)',\n '(focus)': 'focus()',\n '(blur)': '_blur()',\n },\n})\nexport class MatChip extends _MatChipMixinBase implements FocusableOption, OnDestroy, CanColor,\n CanDisable, CanDisableRipple, RippleTarget {\n\n /** Reference to the RippleRenderer for the chip. */\n private _chipRipple: RippleRenderer;\n\n /**\n * Ripple configuration for ripples that are launched on pointer down. The ripple config\n * is set to the global ripple options since we don't have any configurable options for\n * the chip ripples.\n * @docs-private\n */\n rippleConfig: RippleConfig & RippleGlobalOptions;\n\n /**\n * Whether ripples are disabled on interaction\n * @docs-private\n */\n get rippleDisabled(): boolean {\n return this.disabled || this.disableRipple || !!this.rippleConfig.disabled;\n }\n\n /** Whether the chip has focus. */\n _hasFocus: boolean = false;\n\n /** Whether animations for the chip are enabled. */\n _animationsDisabled: boolean;\n\n /** Whether the chip list is selectable */\n chipListSelectable: boolean = true;\n\n /** Whether the chip list is in multi-selection mode. */\n _chipListMultiple: boolean = false;\n\n /** The chip avatar */\n @ContentChild(MatChipAvatar, {static: false}) avatar: MatChipAvatar;\n\n /** The chip's trailing icon. */\n @ContentChild(MatChipTrailingIcon, {static: false}) trailingIcon: MatChipTrailingIcon;\n\n /** The chip's remove toggler. */\n @ContentChild(forwardRef(() => MatChipRemove), {static: false}) removeIcon: MatChipRemove;\n\n /** Whether the chip is selected. */\n @Input()\n get selected(): boolean { return this._selected; }\n set selected(value: boolean) {\n const coercedValue = coerceBooleanProperty(value);\n\n if (coercedValue !== this._selected) {\n this._selected = coercedValue;\n this._dispatchSelectionChange();\n }\n }\n protected _selected: boolean = false;\n\n /** The value of the chip. Defaults to the content inside `<mat-chip>` tags. */\n @Input()\n get value(): any {\n return this._value != undefined\n ? this._value\n : this._elementRef.nativeElement.textContent;\n }\n set value(value: any) { this._value = value; }\n protected _value: any;\n\n /**\n * Whether or not the chip is selectable. When a chip is not selectable,\n * changes to its selected state are always ignored. By default a chip is\n * selectable, and it becomes non-selectable if its parent chip list is\n * not selectable.\n */\n @Input()\n get selectable(): boolean { return this._selectable && this.chipListSelectable; }\n set selectable(value: boolean) {\n this._selectable = coerceBooleanProperty(value);\n }\n protected _selectable: boolean = true;\n\n /**\n * Determines whether or not the chip displays the remove styling and emits (removed) events.\n */\n @Input()\n get removable(): boolean { return this._removable; }\n set removable(value: boolean) {\n this._removable = coerceBooleanProperty(value);\n }\n protected _removable: boolean = true;\n\n /** Emits when the chip is focused. */\n readonly _onFocus = new Subject<MatChipEvent>();\n\n /** Emits when the chip is blured. */\n readonly _onBlur = new Subject<MatChipEvent>();\n\n /** Emitted when the chip is selected or deselected. */\n @Output() readonly selectionChange: EventEmitter<MatChipSelectionChange> =\n new EventEmitter<MatChipSelectionChange>();\n\n /** Emitted when the chip is destroyed. */\n @Output() readonly destroyed: EventEmitter<MatChipEvent> = new EventEmitter<MatChipEvent>();\n\n /** Emitted when a chip is to be removed. */\n @Output() readonly removed: EventEmitter<MatChipEvent> = new EventEmitter<MatChipEvent>();\n\n /** The ARIA selected applied to the chip. */\n get ariaSelected(): string | null {\n // Remove the `aria-selected` when the chip is deselected in single-selection mode, because\n // it adds noise to NVDA users where \"not selected\" will be read out for each chip.\n return this.selectable && (this._chipListMultiple || this.selected) ?\n this.selected.toString() : null;\n }\n\n constructor(public _elementRef: ElementRef<HTMLElement>,\n private _ngZone: NgZone,\n platform: Platform,\n @Optional() @Inject(MAT_RIPPLE_GLOBAL_OPTIONS)\n globalRippleOptions: RippleGlobalOptions | null,\n // @breaking-change 8.0.0 `animationMode` parameter to become required.\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string) {\n super(_elementRef);\n\n this._addHostClassName();\n\n this._chipRipple = new RippleRenderer(this, _ngZone, _elementRef, platform);\n this._chipRipple.setupTriggerEvents(_elementRef.nativeElement);\n this.rippleConfig = globalRippleOptions || {};\n this._animationsDisabled = animationMode === 'NoopAnimations';\n }\n\n _addHostClassName() {\n const basicChipAttrName = 'mat-basic-chip';\n const element = this._elementRef.nativeElement as HTMLElement;\n\n if (element.hasAttribute(basicChipAttrName) ||\n element.tagName.toLowerCase() === basicChipAttrName) {\n element.classList.add(basicChipAttrName);\n return;\n } else {\n element.classList.add('mat-standard-chip');\n }\n }\n\n ngOnDestroy() {\n this.destroyed.emit({chip: this});\n this._chipRipple._removeTriggerEvents();\n }\n\n /** Selects the chip. */\n select(): void {\n if (!this._selected) {\n this._selected = true;\n this._dispatchSelectionChange();\n }\n }\n\n /** Deselects the chip. */\n deselect(): void {\n if (this._selected) {\n this._selected = false;\n this._dispatchSelectionChange();\n }\n }\n\n /** Select this chip and emit selected event */\n selectViaInteraction(): void {\n if (!this._selected) {\n this._selected = true;\n this._dispatchSelectionChange(true);\n }\n }\n\n /** Toggles the current selected state of this chip. */\n toggleSelected(isUserInput: boolean = false): boolean {\n this._selected = !this.selected;\n this._dispatchSelectionChange(isUserInput);\n return this.selected;\n }\n\n /** Allows for programmatic focusing of the chip. */\n focus(): void {\n if (!this._hasFocus) {\n this._elementRef.nativeElement.focus();\n this._onFocus.next({chip: this});\n }\n this._hasFocus = true;\n }\n\n /**\n * Allows for programmatic removal of the chip. Called by the MatChipList when the DELETE or\n * BACKSPACE keys are pressed.\n *\n * Informs any listeners of the removal request. Does not remove the chip from the DOM.\n */\n remove(): void {\n if (this.removable) {\n this.removed.emit({chip: this});\n }\n }\n\n /** Handles click events on the chip. */\n _handleClick(event: Event) {\n if (this.disabled) {\n event.preventDefault();\n } else {\n event.stopPropagation();\n }\n }\n\n /** Handle custom key presses. */\n _handleKeydown(event: KeyboardEvent): void {\n if (this.disabled) {\n return;\n }\n\n switch (event.keyCode) {\n case DELETE:\n case BACKSPACE:\n // If we are removable, remove the focused chip\n this.remove();\n // Always prevent so page navigation does not occur\n event.preventDefault();\n break;\n case SPACE:\n // If we are selectable, toggle the focused chip\n if (this.selectable) {\n this.toggleSelected(true);\n }\n\n // Always prevent space from scrolling the page since the list has focus\n event.preventDefault();\n break;\n }\n }\n\n _blur(): void {\n // When animations are enabled, Angular may end up removing the chip from the DOM a little\n // earlier than usual, causing it to be blurred and throwing off the logic in the chip list\n // that moves focus not the next item. To work around the issue, we defer marking the chip\n // as not focused until the next time the zone stabilizes.\n this._ngZone.onStable\n .asObservable()\n .pipe(take(1))\n .subscribe(() => {\n this._ngZone.run(() => {\n this._hasFocus = false;\n this._onBlur.next({chip: this});\n });\n });\n }\n\n private _dispatchSelectionChange(isUserInput = false) {\n this.selectionChange.emit({\n source: this,\n isUserInput,\n selected: this._selected\n });\n }\n}\n\n\n/**\n * Applies proper (click) support and adds styling for use with the Material Design \"cancel\" icon\n * available at https://material.io/icons/#ic_cancel.\n *\n * Example:\n *\n * `<mat-chip>\n * <mat-icon matChipRemove>cancel</mat-icon>\n * </mat-chip>`\n *\n * You *may* use a custom icon, but you may need to override the `mat-chip-remove` positioning\n * styles to properly center the icon within the chip.\n */\n@Directive({\n selector: '[matChipRemove]',\n host: {\n 'class': 'mat-chip-remove mat-chip-trailing-icon',\n '(click)': '_handleClick($event)',\n }\n})\nexport class MatChipRemove {\n constructor(protected _parentChip: MatChip) {}\n\n /** Calls the parent chip's public `remove()` method if applicable. */\n _handleClick(event: Event): void {\n const parentChip = this._parentChip;\n\n if (parentChip.removable && !parentChip.disabled) {\n parentChip.remove();\n }\n\n // We need to stop event propagation because otherwise the event will bubble up to the\n // form field and cause the `onContainerClick` method to be invoked. This method would then\n // reset the focused chip that has been focused after chip removal. Usually the parent\n // the parent click listener of the `MatChip` would prevent propagation, but it can happen\n // that the chip is being removed before the event bubbles up.\n event.stopPropagation();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '@angular/core';\n\n/** Default options, for the chips module, that can be overridden. */\nexport interface MatChipsDefaultOptions {\n /** The list of key codes that will trigger a chipEnd event. */\n separatorKeyCodes: number[] | Set<number>;\n}\n\n/** Injection token to be used to override the default options for the chips module. */\nexport const MAT_CHIPS_DEFAULT_OPTIONS =\n new InjectionToken<MatChipsDefaultOptions>('mat-chips-default-options');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {FocusKeyManager} from '@angular/cdk/a11y';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {SelectionModel} from '@angular/cdk/collections';\nimport {BACKSPACE, END, HOME} from '@angular/cdk/keycodes';\nimport {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n DoCheck,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n QueryList,\n Self,\n ViewEncapsulation,\n} from '@angular/core';\nimport {ControlValueAccessor, FormGroupDirective, NgControl, NgForm} from '@angular/forms';\nimport {\n CanUpdateErrorState,\n CanUpdateErrorStateCtor,\n ErrorStateMatcher,\n mixinErrorState,\n} from '@angular/material/core';\nimport {MatFormFieldControl} from '@angular/material/form-field';\nimport {merge, Observable, Subject, Subscription} from 'rxjs';\nimport {startWith, takeUntil} from 'rxjs/operators';\nimport {MatChip, MatChipEvent, MatChipSelectionChange} from './chip';\nimport {MatChipTextControl} from './chip-text-control';\n\n\n// Boilerplate for applying mixins to MatChipList.\n/** @docs-private */\nclass MatChipListBase {\n constructor(public _defaultErrorStateMatcher: ErrorStateMatcher,\n public _parentForm: NgForm,\n public _parentFormGroup: FormGroupDirective,\n /** @docs-private */\n public ngControl: NgControl) {}\n}\nconst _MatChipListMixinBase: CanUpdateErrorStateCtor & typeof MatChipListBase =\n mixinErrorState(MatChipListBase);\n\n\n// Increasing integer for generating unique ids for chip-list components.\nlet nextUniqueId = 0;\n\n/** Change event object that is emitted when the chip list value has changed. */\nexport class MatChipListChange {\n constructor(\n /** Chip list that emitted the event. */\n public source: MatChipList,\n /** Value of the chip list when the event was emitted. */\n public value: any) { }\n}\n\n\n/**\n * A material design chips component (named ChipList for its similarity to the List component).\n */\n@Component({\n moduleId: module.id,\n selector: 'mat-chip-list',\n template: `<div class=\"mat-chip-list-wrapper\"><ng-content></ng-content></div>`,\n exportAs: 'matChipList',\n host: {\n '[attr.tabindex]': 'disabled ? null : _tabIndex',\n '[attr.aria-describedby]': '_ariaDescribedby || null',\n '[attr.aria-required]': 'required.toString()',\n '[attr.aria-disabled]': 'disabled.toString()',\n '[attr.aria-invalid]': 'errorState',\n '[attr.aria-multiselectable]': 'multiple',\n '[attr.role]': 'role',\n '[class.mat-chip-list-disabled]': 'disabled',\n '[class.mat-chip-list-invalid]': 'errorState',\n '[class.mat-chip-list-required]': 'required',\n '[attr.aria-orientation]': 'ariaOrientation',\n 'class': 'mat-chip-list',\n '(focus)': 'focus()',\n '(blur)': '_blur()',\n '(keydown)': '_keydown($event)',\n '[id]': '_uid',\n },\n providers: [{provide: MatFormFieldControl, useExisting: MatChipList}],\n styleUrls: ['chips.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MatChipList extends _MatChipListMixinBase implements MatFormFieldControl<any>,\n ControlValueAccessor, AfterContentInit, DoCheck, OnInit, OnDestroy, CanUpdateErrorState {\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n readonly controlType: string = 'mat-chip-list';\n\n /**\n * When a chip is destroyed, we store the index of the destroyed chip until the chips\n * query list notifies about the update. This is necessary because we cannot determine an\n * appropriate chip that should receive focus until the array of chips updated completely.\n */\n private _lastDestroyedChipIndex: number | null = null;\n\n /** Subject that emits when the component has been destroyed. */\n private _destroyed = new Subject<void>();\n\n /** Subscription to focus changes in the chips. */\n private _chipFocusSubscription: Subscription | null;\n\n /** Subscription to blur changes in the chips. */\n private _chipBlurSubscription: Subscription | null;\n\n /** Subscription to selection changes in chips. */\n private _chipSelectionSubscription: Subscription | null;\n\n /** Subscription to remove changes in chips. */\n private _chipRemoveSubscription: Subscription | null;\n\n /** The chip input to add more chips */\n protected _chipInput: MatChipTextControl;\n\n /** Uid of the chip list */\n _uid: string = `mat-chip-list-${nextUniqueId++}`;\n\n /** The aria-describedby attribute on the chip list for improved a11y. */\n _ariaDescribedby: string;\n\n /** Tab index for the chip list. */\n _tabIndex = 0;\n\n /**\n * User defined tab index.\n * When it is not null, use user defined tab index. Otherwise use _tabIndex\n */\n _userTabIndex: number | null = null;\n\n /** The FocusKeyManager which handles focus. */\n _keyManager: FocusKeyManager<MatChip>;\n\n /** Function when touched */\n _onTouched = () => {};\n\n /** Function when changed */\n _onChange: (value: any) => void = () => {};\n\n _selectionModel: SelectionModel<MatChip>;\n\n /** The array of selected chips inside chip list. */\n get selected(): MatChip[] | MatChip {\n return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];\n }\n\n /** The ARIA role applied to the chip list. */\n get role(): string | null { return this.empty ? null : 'listbox'; }\n\n /** An object used to control when error messages are shown. */\n @Input() errorStateMatcher: ErrorStateMatcher;\n\n /** Whether the user should be allowed to select multiple chips. */\n @Input()\n get multiple(): boolean { return this._multiple; }\n set multiple(value: boolean) {\n this._multiple = coerceBooleanProperty(value);\n this._syncChipsState();\n }\n private _multiple: boolean = false;\n\n /**\n * A function to compare the option values with the selected values. The first argument\n * is a value from an option. The second is a value from the selection. A boolean\n * should be returned.\n */\n @Input()\n get compareWith(): (o1: any, o2: any) => boolean { return this._compareWith; }\n set compareWith(fn: (o1: any, o2: any) => boolean) {\n this._compareWith = fn;\n if (this._selectionModel) {\n // A different comparator means the selection could change.\n this._initializeSelection();\n }\n }\n private _compareWith = (o1: any, o2: any) => o1 === o2;\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n @Input()\n get value(): any { return this._value; }\n set value(value: any) {\n this.writeValue(value);\n this._value = value;\n }\n protected _value: any;\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n get id(): string {\n return this._chipInput ? this._chipInput.id : this._uid;\n }\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n @Input()\n get required(): boolean { return this._required; }\n set required(value: boolean) {\n this._required = coerceBooleanProperty(value);\n this.stateChanges.next();\n }\n protected _required: boolean = false;\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n @Input()\n get placeholder(): string {\n return this._chipInput ? this._chipInput.placeholder : this._placeholder;\n }\n set placeholder(value: string) {\n this._placeholder = value;\n this.stateChanges.next();\n }\n protected _placeholder: string;\n\n /** Whether any chips or the matChipInput inside of this chip-list has focus. */\n get focused(): boolean {\n return (this._chipInput && this._chipInput.focused) || this._hasFocusedChip();\n }\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n get empty(): boolean {\n return (!this._chipInput || this._chipInput.empty) && this.chips.length === 0;\n }\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n get shouldLabelFloat(): boolean { return !this.empty || this.focused; }\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n @Input()\n get disabled(): boolean { return this.ngControl ? !!this.ngControl.disabled : this._disabled; }\n set disabled(value: boolean) {\n this._disabled = coerceBooleanProperty(value);\n this._syncChipsState();\n }\n protected _disabled: boolean = false;\n\n /** Orientation of the chip list. */\n @Input('aria-orientation') ariaOrientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /**\n * Whether or not this chip list is selectable. When a chip list is not selectable,\n * the selected states for all the chips inside the chip list are always ignored.\n */\n @Input()\n get selectable(): boolean { return this._selectable; }\n set selectable(value: boolean) {\n this._selectable = coerceBooleanProperty(value);\n\n if (this.chips) {\n this.chips.forEach(chip => chip.chipListSelectable = this._selectable);\n }\n }\n protected _selectable: boolean = true;\n\n @Input()\n set tabIndex(value: number) {\n this._userTabIndex = value;\n this._tabIndex = value;\n }\n\n /** Combined stream of all of the child chips' selection change events. */\n get chipSelectionChanges(): Observable<MatChipSelectionChange> {\n return merge(...this.chips.map(chip => chip.selectionChange));\n }\n\n /** Combined stream of all of the child chips' focus change events. */\n get chipFocusChanges(): Observable<MatChipEvent> {\n return merge(...this.chips.map(chip => chip._onFocus));\n }\n\n /** Combined stream of all of the child chips' blur change events. */\n get chipBlurChanges(): Observable<MatChipEvent> {\n return merge(...this.chips.map(chip => chip._onBlur));\n }\n\n /** Combined stream of all of the child chips' remove change events. */\n get chipRemoveChanges(): Observable<MatChipEvent> {\n return merge(...this.chips.map(chip => chip.destroyed));\n }\n\n /** Event emitted when the selected chip list value has been changed by the user. */\n @Output() readonly change: EventEmitter<MatChipListChange> =\n new EventEmitter<MatChipListChange>();\n\n /**\n * Event that emits whenever the raw value of the chip-list changes. This is here primarily\n * to facilitate the two-way binding for the `value` input.\n * @docs-private\n */\n @Output() readonly valueChange: EventEmitter<any> = new EventEmitter<any>();\n\n /** The chip components contained within this chip list. */\n @ContentChildren(MatChip, {\n // We need to use `descendants: true`, because Ivy will no longer match\n // indirect descendants if it's left as false.\n descendants: true\n }) chips: QueryList<MatChip>;\n\n constructor(protected _elementRef: ElementRef<HTMLElement>,\n private _changeDetectorRef: ChangeDetectorRef,\n @Optional() private _dir: Directionality,\n @Optional() _parentForm: NgForm,\n @Optional() _parentFormGroup: FormGroupDirective,\n _defaultErrorStateMatcher: ErrorStateMatcher,\n /** @docs-private */\n @Optional() @Self() public ngControl: NgControl) {\n super(_defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl);\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n ngAfterContentInit() {\n this._keyManager = new FocusKeyManager<MatChip>(this.chips)\n .withWrap()\n .withVerticalOrientation()\n .withHorizontalOrientation(this._dir ? this._dir.value : 'ltr');\n\n if (this._dir) {\n this._dir.change\n .pipe(takeUntil(this._destroyed))\n .subscribe(dir => this._keyManager.withHorizontalOrientation(dir));\n }\n\n this._keyManager.tabOut.pipe(takeUntil(this._destroyed)).subscribe(() => {\n this._allowFocusEscape();\n });\n\n // When the list changes, re-subscribe\n this.chips.changes.pipe(startWith(null), takeUntil(this._destroyed)).subscribe(() => {\n if (this.disabled) {\n // Since this happens after the content has been\n // checked, we need to defer it to the next tick.\n Promise.resolve().then(() => {\n this._syncChipsState();\n });\n }\n\n this._resetChips();\n\n // Reset chips selected/deselected status\n this._initializeSelection();\n\n // Check to see if we need to update our tab index\n this._updateTabIndex();\n\n // Check to see if we have a destroyed chip and need to refocus\n this._updateFocusForDestroyedChips();\n\n this.stateChanges.next();\n });\n }\n\n ngOnInit() {\n this._selectionModel = new SelectionModel<MatChip>(this.multiple, undefined, false);\n this.stateChanges.next();\n }\n\n ngDoCheck() {\n if (this.ngControl) {\n // We need to re-evaluate this on every change detection cycle, because there are some\n // error triggers that we can't subscribe to (e.g. parent form submissions). This means\n // that whatever logic is in here has to be super lean or we risk destroying the performance.\n this.updateErrorState();\n }\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n this.stateChanges.complete();\n\n this._dropSubscriptions();\n }\n\n\n /** Associates an HTML input element with this chip list. */\n registerInput(inputElement: MatChipTextControl): void {\n this._chipInput = inputElement;\n }\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n setDescribedByIds(ids: string[]) { this._ariaDescribedby = ids.join(' '); }\n\n // Implemented as part of ControlValueAccessor.\n writeValue(value: any): void {\n if (this.chips) {\n this._setSelectionByValue(value, false);\n }\n }\n\n // Implemented as part of ControlValueAccessor.\n registerOnChange(fn: (value: any) => void): void {\n this._onChange = fn;\n }\n\n // Implemented as part of ControlValueAccessor.\n registerOnTouched(fn: () => void): void {\n this._onTouched = fn;\n }\n\n // Implemented as part of ControlValueAccessor.\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.stateChanges.next();\n }\n\n /**\n * Implemented as part of MatFormFieldControl.\n * @docs-private\n */\n onContainerClick(event: MouseEvent) {\n if (!this._originatesFromChip(event)) {\n this.focus();\n }\n }\n\n /**\n * Focuses the first non-disabled chip in this chip list, or the associated input when there\n * are no eligible chips.\n */\n focus(): void {\n if (this.disabled) {\n return;\n }\n\n // TODO: ARIA says this should focus the first `selected` chip if any are selected.\n // Focus on first element if there's no chipInput inside chip-list\n if (this._chipInput && this._chipInput.focused) {\n // do nothing\n } else if (this.chips.length > 0) {\n this._keyManager.setFirstItemActive();\n this.stateChanges.next();\n } else {\n this._focusInput();\n this.stateChanges.next();\n }\n }\n\n /** Attempt to focus an input if we have one. */\n _focusInput() {\n if (this._chipInput) {\n this._chipInput.focus();\n }\n }\n\n /**\n * Pass events to the keyboard manager. Available here for tests.\n */\n _keydown(event: KeyboardEvent) {\n const target = event.target as HTMLElement;\n\n // If they are on an empty input and hit backspace, focus the last chip\n if (event.keyCode === BACKSPACE && this._isInputEmpty(target)) {\n this._keyManager.setLastItemActive();\n event.preventDefault();\n } else if (target && target.classList.contains('mat-chip')) {\n if (event.keyCode === HOME) {\n this._keyManager.setFirstItemActive();\n event.preventDefault();\n } else if (event.keyCode === END) {\n this._keyManager.setLastItemActive();\n event.preventDefault();\n } else {\n this._keyManager.onKeydown(event);\n }\n\n this.stateChanges.next();\n }\n }\n\n\n /**\n * Check the tab index as you should not be allowed to focus an empty list.\n */\n protected _updateTabIndex(): void {\n // If we have 0 chips, we should not allow keyboard focus\n this._tabIndex = this._userTabIndex || (this.chips.length === 0 ? -1 : 0);\n }\n\n /**\n * If the amount of chips changed, we need to update the\n * key manager state and focus the next closest chip.\n */\n protected _updateFocusForDestroyedChips() {\n // Move focus to the closest chip. If no other chips remain, focus the chip-list itself.\n if (this._lastDestroyedChipIndex != null) {\n if (this.chips.length) {\n const newChipIndex = Math.min(this._lastDestroyedChipIndex, this.chips.length - 1);\n this._keyManager.setActiveItem(newChipIndex);\n } else {\n this.focus();\n }\n }\n\n this._lastDestroyedChipIndex = null;\n }\n\n /**\n * Utility to ensure all indexes are valid.\n *\n * @param index The index to be checked.\n * @returns True if the index is valid for our list of chips.\n */\n private _isValidIndex(index: number): boolean {\n return index >= 0 && index < this.chips.length;\n }\n\n private _isInputEmpty(element: HTMLElement): boolean {\n if (element && element.nodeName.toLowerCase() === 'input') {\n let input = element as HTMLInputElement;\n return !input.value;\n }\n\n return false;\n }\n\n _setSelectionByValue(value: any, isUserInput: boolean = true) {\n this._clearSelection();\n this.chips.forEach(chip => chip.deselect());\n\n if (Array.isArray(value)) {\n value.forEach(currentValue => this._selectValue(currentValue, isUserInput));\n this._sortValues();\n } else {\n const correspondingChip = this._selectValue(value, isUserInput);\n\n // Shift focus to the active item. Note that we shouldn't do this in multiple\n // mode, because we don't know what chip the user interacted with last.\n if (correspondingChip) {\n if (isUserInput) {\n this._keyManager.setActiveItem(correspondingChip);\n }\n }\n }\n }\n\n /**\n * Finds and selects the chip based on its value.\n * @returns Chip that has the corresponding value.\n */\n private _selectValue(value: any, isUserInput: boolean = true): MatChip | undefined {\n\n const correspondingChip = this.chips.find(chip => {\n return chip.value != null && this._compareWith(chip.value, value);\n });\n\n if (correspondingChip) {\n isUserInput ? correspondingChip.selectViaInteraction() : correspondingChip.select();\n this._selectionModel.select(correspondingChip);\n }\n\n return correspondingChip;\n }\n\n private _initializeSelection(): void {\n // Defer setting the value in order to avoid the \"Expression\n // has changed after it was checked\" errors from Angular.\n Promise.resolve().then(() => {\n if (this.ngControl || this._value) {\n this._setSelectionByValue(this.ngControl ? this.ngControl.value : this._value, false);\n this.stateChanges.next();\n }\n });\n }\n\n /**\n * Deselects every chip in the list.\n * @param skip Chip that should not be deselected.\n */\n private _clearSelection(skip?: MatChip): void {\n this._selectionModel.clear();\n this.chips.forEach(chip => {\n if (chip !== skip) {\n chip.deselect();\n }\n });\n this.stateChanges.next();\n }\n\n /**\n * Sorts the model values, ensuring that they keep the same\n * order that they have in the panel.\n */\n private _sortValues(): void {\n if (this._multiple) {\n this._selectionModel.clear();\n\n this.chips.forEach(chip => {\n if (chip.selected) {\n this._selectionModel.select(chip);\n }\n });\n this.stateChanges.next();\n }\n }\n\n /** Emits change event to set the model value. */\n private _propagateChanges(fallbackValue?: any): void {\n let valueToEmit: any = null;\n\n if (Array.isArray(this.selected)) {\n valueToEmit = this.selected.map(chip => chip.value);\n } else {\n valueToEmit = this.selected ? this.selected.value : fallbackValue;\n }\n this._value = valueToEmit;\n this.change.emit(new MatChipListChange(this, valueToEmit));\n this.valueChange.emit(valueToEmit);\n this._onChange(valueToEmit);\n this._changeDetectorRef.markForCheck();\n }\n\n /** When blurred, mark the field as touched when focus moved outside the chip list. */\n _blur() {\n if (!this._hasFocusedChip()) {\n this._keyManager.setActiveItem(-1);\n }\n\n if (!this.disabled) {\n if (this._chipInput) {\n // If there's a chip input, we should check whether the focus moved to chip input.\n // If the focus is not moved to chip input, mark the field as touched. If the focus moved\n // to chip input, do nothing.\n // Timeout is needed to wait for the focus() event trigger on chip input.\n setTimeout(() => {\n if (!this.focused) {\n this._markAsTouched();\n }\n });\n } else {\n // If there's no chip input, then mark the field as touched.\n this._markAsTouched();\n }\n }\n }\n\n /** Mark the field as touched */\n _markAsTouched() {\n this._onTouched();\n this._changeDetectorRef.markForCheck();\n this.stateChanges.next();\n }\n\n /**\n * Removes the `tabindex` from the chip list and resets it back afterwards, allowing the\n * user to tab out of it. This prevents the list from capturing focus and redirecting\n * it back to the first chip, creating a focus trap, if it user tries to tab away.\n */\n _allowFocusEscape() {\n if (this._tabIndex !== -1) {\n this._tabIndex = -1;\n\n setTimeout(() => {\n this._tabIndex = this._userTabIndex || 0;\n this._changeDetectorRef.markForCheck();\n });\n }\n }\n\n private _resetChips() {\n this._dropSubscriptions();\n this._listenToChipsFocus();\n this._listenToChipsSelection();\n this._listenToChipsRemoved();\n }\n\n private _dropSubscriptions() {\n if (this._chipFocusSubscription) {\n this._chipFocusSubscription.unsubscribe();\n this._chipFocusSubscription = null;\n }\n\n if (this._chipBlurSubscription) {\n this._chipBlurSubscription.unsubscribe();\n this._chipBlurSubscription = null;\n }\n\n if (this._chipSelectionSubscription) {\n this._chipSelectionSubscription.unsubscribe();\n this._chipSelectionSubscription = null;\n }\n\n if (this._chipRemoveSubscription) {\n this._chipRemoveSubscription.unsubscribe();\n this._chipRemoveSubscription = null;\n }\n }\n\n /** Listens to user-generated selection events on each chip. */\n private _listenToChipsSelection(): void {\n this._chipSelectionSubscription = this.chipSelectionChanges.subscribe(event => {\n event.source.selected\n ? this._selectionModel.select(event.source)\n : this._selectionModel.deselect(event.source);\n\n // For single selection chip list, make sure the deselected value is unselected.\n if (!this.multiple) {\n this.chips.forEach(chip => {\n if (!this._selectionModel.isSelected(chip) && chip.selected) {\n chip.deselect();\n }\n });\n }\n\n if (event.isUserInput) {\n this._propagateChanges();\n }\n });\n }\n\n /** Listens to user-generated selection events on each chip. */\n private _listenToChipsFocus(): void {\n this._chipFocusSubscription = this.chipFocusChanges.subscribe(event => {\n let chipIndex: number = this.chips.toArray().indexOf(event.chip);\n\n if (this._isValidIndex(chipIndex)) {\n this._keyManager.updateActiveItemIndex(chipIndex);\n }\n this.stateChanges.next();\n });\n\n this._chipBlurSubscription = this.chipBlurChanges.subscribe(() => {\n this._blur();\n this.stateChanges.next();\n });\n }\n\n private _listenToChipsRemoved(): void {\n this._chipRemoveSubscription = this.chipRemoveChanges.subscribe(event => {\n const chip = event.chip;\n const chipIndex = this.chips.toArray().indexOf(event.chip);\n\n // In case the chip that will be removed is currently focused, we temporarily store\n // the index in order to be able to determine an appropriate sibling chip that will\n // receive focus.\n if (this._isValidIndex(chipIndex) && chip._hasFocus) {\n this._lastDestroyedChipIndex = chipIndex;\n }\n });\n }\n\n /** Checks whether an event comes from inside a chip element. */\n private _originatesFromChip(event: Event): boolean {\n let currentElement = event.target as HTMLElement | null;\n\n while (currentElement && currentElement !== this._elementRef.nativeElement) {\n if (currentElement.classList.contains('mat-chip')) {\n return true;\n }\n\n currentElement = currentElement.parentElement;\n }\n\n return false;\n }\n\n /** Checks whether any of the chips is focused. */\n private _hasFocusedChip() {\n return this.chips.some(chip => chip._hasFocus);\n }\n\n /** Syncs the list's state with the individual chips. */\n private _syncChipsState() {\n if (this.chips) {\n this.chips.forEach(chip => {\n chip.disabled = this._disabled;\n chip._chipListMultiple = this.multiple;\n });\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {Directive, ElementRef, EventEmitter, Inject, Input, OnChanges, Output} from '@angular/core';\nimport {hasModifierKey, TAB} from '@angular/cdk/keycodes';\nimport {MAT_CHIPS_DEFAULT_OPTIONS, MatChipsDefaultOptions} from './chip-default-options';\nimport {MatChipList} from './chip-list';\nimport {MatChipTextControl} from './chip-text-control';\n\n\n/** Represents an input event on a `matChipInput`. */\nexport interface MatChipInputEvent {\n /** The native `<input>` element that the event is being fired for. */\n input: HTMLInputElement;\n\n /** The value of the input. */\n value: string;\n}\n\n// Increasing integer for generating unique ids.\nlet nextUniqueId = 0;\n\n/**\n * Directive that adds chip-specific behaviors to an input element inside `<mat-form-field>`.\n * May be placed inside or outside of an `<mat-chip-list>`.\n */\n@Directive({\n selector: 'input[matChipInputFor]',\n exportAs: 'matChipInput, matChipInputFor',\n host: {\n 'class': 'mat-chip-input mat-input-element',\n '(keydown)': '_keydown($event)',\n '(blur)': '_blur()',\n '(focus)': '_focus()',\n '(input)': '_onInput()',\n '[id]': 'id',\n '[attr.disabled]': 'disabled || null',\n '[attr.placeholder]': 'placeholder || null',\n '[attr.aria-invalid]': '_chipList && _chipList.ngControl ? _chipList.ngControl.invalid : null',\n }\n})\nexport class MatChipInput implements MatChipTextControl, OnChanges {\n /** Whether the control is focused. */\n focused: boolean = false;\n _chipList: MatChipList;\n\n /** Register input for chip list */\n @Input('matChipInputFor')\n set chipList(value: MatChipList) {\n if (value) {\n this._chipList = value;\n this._chipList.registerInput(this);\n }\n }\n\n /**\n * Whether or not the chipEnd event will be emitted when the input is blurred.\n */\n @Input('matChipInputAddOnBlur')\n get addOnBlur(): boolean { return this._addOnBlur; }\n set addOnBlur(value: boolean) { this._addOnBlur = coerceBooleanProperty(value); }\n _addOnBlur: boolean = false;\n\n /**\n * The list of key codes that will trigger a chipEnd event.\n *\n * Defaults to `[ENTER]`.\n */\n @Input('matChipInputSeparatorKeyCodes')\n separatorKeyCodes: number[] | Set<number> = this._defaultOptions.separatorKeyCodes;\n\n /** Emitted when a chip is to be added. */\n @Output('matChipInputTokenEnd')\n chipEnd: EventEmitter<MatChipInputEvent> = new EventEmitter<MatChipInputEvent>();\n\n /** The input's placeholder text. */\n @Input() placeholder: string = '';\n\n /** Unique id for the input. */\n @Input() id: string = `mat-chip-list-input-${nextUniqueId++}`;\n\n /** Whether the input is disabled. */\n @Input()\n get disabled(): boolean { return this._disabled || (this._chipList && this._chipList.disabled); }\n set disabled(value: boolean) { this._disabled = coerceBooleanProperty(value); }\n private _disabled: boolean = false;\n\n /** Whether the input is empty. */\n get empty(): boolean { return !this._inputElement.value; }\n\n /** The native input element to which this directive is attached. */\n protected _inputElement: HTMLInputElement;\n\n constructor(\n protected _elementRef: ElementRef<HTMLInputElement>,\n @Inject(MAT_CHIPS_DEFAULT_OPTIONS) private _defaultOptions: MatChipsDefaultOptions) {\n this._inputElement = this._elementRef.nativeElement as HTMLInputElement;\n }\n\n ngOnChanges() {\n this._chipList.stateChanges.next();\n }\n\n /** Utility method to make host definition/tests more clear. */\n _keydown(event?: KeyboardEvent) {\n // Allow the user's focus to escape when they're tabbing forward. Note that we don't\n // want to do this when going backwards, because focus should go back to the first chip.\n if (event && event.keyCode === TAB && !hasModifierKey(event, 'shiftKey')) {\n this._chipList._allowFocusEscape();\n }\n\n this._emitChipEnd(event);\n }\n\n /** Checks to see if the blur should emit the (chipEnd) event. */\n _blur() {\n if (this.addOnBlur) {\n this._emitChipEnd();\n }\n this.focused = false;\n // Blur the chip list if it is not focused\n if (!this._chipList.focused) {\n this._chipList._blur();\n }\n this._chipList.stateChanges.next();\n }\n\n _focus() {\n this.focused = true;\n this._chipList.stateChanges.next();\n }\n\n /** Checks to see if the (chipEnd) event needs to be emitted. */\n _emitChipEnd(event?: KeyboardEvent) {\n if (!this._inputElement.value && !!event) {\n this._chipList._keydown(event);\n }\n if (!event || this._isSeparatorKey(event)) {\n this.chipEnd.emit({ input: this._inputElement, value: this._inputElement.value });\n\n if (event) {\n event.preventDefault();\n }\n }\n }\n\n _onInput() {\n // Let chip list know whenever the value changes.\n this._chipList.stateChanges.next();\n }\n\n /** Focuses the input. */\n focus(): void {\n this._inputElement.focus();\n }\n\n /** Checks whether a keycode is one of the configured separators. */\n private _isSeparatorKey(event: KeyboardEvent) {\n if (hasModifierKey(event)) {\n return false;\n }\n\n const separators = this.separatorKeyCodes;\n const keyCode = event.keyCode;\n return Array.isArray(separators) ? separators.indexOf(keyCode) > -1 : separators.has(keyCode);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ENTER} from '@angular/cdk/keycodes';\nimport {NgModule} from '@angular/core';\nimport {ErrorStateMatcher} from '@angular/material/core';\nimport {MatChip, MatChipAvatar, MatChipRemove, MatChipTrailingIcon} from './chip';\nimport {MAT_CHIPS_DEFAULT_OPTIONS, MatChipsDefaultOptions} from './chip-default-options';\nimport {MatChipInput} from './chip-input';\nimport {MatChipList} from './chip-list';\n\nconst CHIP_DECLARATIONS = [\n MatChipList,\n MatChip,\n MatChipInput,\n MatChipRemove,\n MatChipAvatar,\n MatChipTrailingIcon,\n];\n\n@NgModule({\n exports: CHIP_DECLARATIONS,\n declarations: CHIP_DECLARATIONS,\n providers: [\n ErrorStateMatcher,\n {\n provide: MAT_CHIPS_DEFAULT_OPTIONS,\n useValue: {\n separatorKeyCodes: [ENTER]\n } as MatChipsDefaultOptions\n }\n ]\n})\nexport class MatChipsModule {}\n"],"names":["__extends","d","b","__","this","constructor","extendStatics","prototype","Object","create","setPrototypeOf","__proto__","Array","p","hasOwnProperty","MatChipSelectionChange","source","selected","isUserInput","MatChipBase","_elementRef","_MatChipMixinBase","mixinColor","mixinDisableRipple","mixinDisabled","MatChipAvatar","type","Directive","args","selector","host","class","MatChipTrailingIcon","MatChip","_super","_ngZone","platform","globalRippleOptions","animationMode","_this","call","_hasFocus","chipListSelectable","_chipListMultiple","_selected","_selectable","_removable","_onFocus","Subject","_onBlur","selectionChange","EventEmitter","destroyed","removed","_addHostClassName","_chipRipple","RippleRenderer","setupTriggerEvents","nativeElement","rippleConfig","_animationsDisabled","tslib_1.__extends","defineProperty","disabled","disableRipple","value","coercedValue","coerceBooleanProperty","_dispatchSelectionChange","undefined","_value","textContent","selectable","toString","element","hasAttribute","tagName","toLowerCase","classList","add","ngOnDestroy","emit","chip","_removeTriggerEvents","select","deselect","selectViaInteraction","toggleSelected","focus","next","remove","removable","_handleClick","event","preventDefault","stopPropagation","_handleKeydown","keyCode","DELETE","BACKSPACE","SPACE","_blur","onStable","asObservable","pipe","take","subscribe","run","inputs","exportAs","[attr.tabindex]","role","[class.mat-chip-selected]","[class.mat-chip-with-avatar]","[class.mat-chip-with-trailing-icon]","[class.mat-chip-disabled]","[class._mat-animation-noopable]","[attr.disabled]","[attr.aria-disabled]","[attr.aria-selected]","(click)","(keydown)","(focus)","(blur)","ElementRef","NgZone","Platform","decorators","Optional","Inject","MAT_RIPPLE_GLOBAL_OPTIONS","String","ANIMATION_MODULE_TYPE","avatar","ContentChild","static","trailingIcon","removeIcon","forwardRef","MatChipRemove","Input","Output","_parentChip","parentChip","MAT_CHIPS_DEFAULT_OPTIONS","InjectionToken","MatChipListBase","_defaultErrorStateMatcher","_parentForm","_parentFormGroup","ngControl","_MatChipListMixinBase","mixinErrorState","nextUniqueId","MatChipListChange","MatChipList","_changeDetectorRef","_dir","controlType","_lastDestroyedChipIndex","_destroyed","_uid","_tabIndex","_userTabIndex","_onTouched","_onChange","_multiple","_compareWith","o1","o2","_required","_disabled","ariaOrientation","change","valueChange","valueAccessor","multiple","_selectionModel","empty","_syncChipsState","fn","_initializeSelection","writeValue","_chipInput","id","stateChanges","placeholder","_placeholder","focused","_hasFocusedChip","chips","length","forEach","merge","apply","map","ngAfterContentInit","_keyManager","FocusKeyManager","withWrap","withVerticalOrientation","withHorizontalOrientation","takeUntil","dir","tabOut","_allowFocusEscape","changes","startWith","Promise","resolve","then","_resetChips","_updateTabIndex","_updateFocusForDestroyedChips","ngOnInit","SelectionModel","ngDoCheck","updateErrorState","complete","_dropSubscriptions","registerInput","inputElement","setDescribedByIds","ids","_ariaDescribedby","join","_setSelectionByValue","registerOnChange","registerOnTouched","setDisabledState","isDisabled","onContainerClick","_originatesFromChip","setFirstItemActive","_focusInput","_keydown","target","_isInputEmpty","setLastItemActive","contains","HOME","END","onKeydown","newChipIndex","Math","min","setActiveItem","_isValidIndex","index","nodeName","_clearSelection","isArray","currentValue","_selectValue","_sortValues","correspondingChip","find","skip","clear","_propagateChanges","fallbackValue","valueToEmit","markForCheck","setTimeout","_markAsTouched","_listenToChipsFocus","_listenToChipsSelection","_listenToChipsRemoved","_chipFocusSubscription","unsubscribe","_chipBlurSubscription","_chipSelectionSubscription","_chipRemoveSubscription","chipSelectionChanges","isSelected","chipFocusChanges","chipIndex","toArray","indexOf","updateActiveItemIndex","chipBlurChanges","chipRemoveChanges","currentElement","parentElement","some","Component","template","[attr.aria-describedby]","[attr.aria-required]","[attr.aria-invalid]","[attr.aria-multiselectable]","[attr.role]","[class.mat-chip-list-disabled]","[class.mat-chip-list-invalid]","[class.mat-chip-list-required]","[attr.aria-orientation]","[id]","providers","provide","MatFormFieldControl","useExisting","styles","encapsulation","ViewEncapsulation","None","changeDetection","ChangeDetectionStrategy","OnPush","Directionality","NgForm","FormGroupDirective","ErrorStateMatcher","NgControl","Self","propDecorators","compareWith","required","tabIndex","ContentChildren","MatChipInput","_defaultOptions","_addOnBlur","separatorKeyCodes","chipEnd","_inputElement","_chipList","ngOnChanges","TAB","hasModifierKey","_emitChipEnd","addOnBlur","_focus","_isSeparatorKey","input","_onInput","separators","has","(input)","[attr.placeholder]","chipList","CHIP_DECLARATIONS","ɵ0","ENTER","MatChipsModule","NgModule","exports","declarations","useValue"],"mappings":";;;;;;;isCAuBA,SAAgBA,GAAUC,EAAGC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