chips.mjs 214 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196
  1. import { FocusMonitor, _IdGenerator, FocusKeyManager } from '@angular/cdk/a11y';
  2. import { ENTER, SPACE, BACKSPACE, DELETE, TAB, hasModifierKey, UP_ARROW, DOWN_ARROW } from '@angular/cdk/keycodes';
  3. import { _CdkPrivateStyleLoader, _VisuallyHiddenLoader } from '@angular/cdk/private';
  4. import { DOCUMENT } from '@angular/common';
  5. import * as i0 from '@angular/core';
  6. import { InjectionToken, inject, ElementRef, booleanAttribute, numberAttribute, Directive, Input, ChangeDetectorRef, NgZone, EventEmitter, Injector, ANIMATION_MODULE_TYPE, Component, ViewEncapsulation, ChangeDetectionStrategy, ContentChildren, Output, ContentChild, ViewChild, afterNextRender, QueryList, forwardRef, NgModule } from '@angular/core';
  7. import { Subject, merge } from 'rxjs';
  8. import { _ as _StructuralStylesLoader } from './structural-styles-BQUT6wsL.mjs';
  9. import { a as MAT_RIPPLE_GLOBAL_OPTIONS } from './ripple-BT3tzh6F.mjs';
  10. import { M as MatRippleLoader } from './ripple-loader-Ce3DAhPW.mjs';
  11. import { takeUntil, startWith, switchMap } from 'rxjs/operators';
  12. import { Directionality } from '@angular/cdk/bidi';
  13. import { NG_VALUE_ACCESSOR, NgControl, Validators, NgForm, FormGroupDirective } from '@angular/forms';
  14. import { E as ErrorStateMatcher } from './error-options-Dm2JJUbF.mjs';
  15. import { _ as _ErrorStateTracker } from './error-state-Dtb1IHM-.mjs';
  16. import { k as MatFormFieldControl, h as MAT_FORM_FIELD } from './form-field-DqPi4knt.mjs';
  17. import { M as MatCommonModule } from './common-module-WayjW0Pb.mjs';
  18. import { M as MatRippleModule } from './index-SYVYjXwK.mjs';
  19. import '@angular/cdk/platform';
  20. import '@angular/cdk/coercion';
  21. import '@angular/cdk/observers/private';
  22. /** Injection token to be used to override the default options for the chips module. */
  23. const MAT_CHIPS_DEFAULT_OPTIONS = new InjectionToken('mat-chips-default-options', {
  24. providedIn: 'root',
  25. factory: () => ({
  26. separatorKeyCodes: [ENTER],
  27. }),
  28. });
  29. /**
  30. * Injection token that can be used to reference instances of `MatChipAvatar`. It serves as
  31. * alternative token to the actual `MatChipAvatar` class which could cause unnecessary
  32. * retention of the class and its directive metadata.
  33. */
  34. const MAT_CHIP_AVATAR = new InjectionToken('MatChipAvatar');
  35. /**
  36. * Injection token that can be used to reference instances of `MatChipTrailingIcon`. It serves as
  37. * alternative token to the actual `MatChipTrailingIcon` class which could cause unnecessary
  38. * retention of the class and its directive metadata.
  39. */
  40. const MAT_CHIP_TRAILING_ICON = new InjectionToken('MatChipTrailingIcon');
  41. /**
  42. * Injection token that can be used to reference instances of `MatChipRemove`. It serves as
  43. * alternative token to the actual `MatChipRemove` class which could cause unnecessary
  44. * retention of the class and its directive metadata.
  45. */
  46. const MAT_CHIP_REMOVE = new InjectionToken('MatChipRemove');
  47. /**
  48. * Injection token used to avoid a circular dependency between the `MatChip` and `MatChipAction`.
  49. */
  50. const MAT_CHIP = new InjectionToken('MatChip');
  51. /**
  52. * Section within a chip.
  53. * @docs-private
  54. */
  55. class MatChipAction {
  56. _elementRef = inject(ElementRef);
  57. _parentChip = inject(MAT_CHIP);
  58. /** Whether the action is interactive. */
  59. isInteractive = true;
  60. /** Whether this is the primary action in the chip. */
  61. _isPrimary = true;
  62. /** Whether the action is disabled. */
  63. get disabled() {
  64. return this._disabled || this._parentChip?.disabled || false;
  65. }
  66. set disabled(value) {
  67. this._disabled = value;
  68. }
  69. _disabled = false;
  70. /** Tab index of the action. */
  71. tabIndex = -1;
  72. /**
  73. * Private API to allow focusing this chip when it is disabled.
  74. */
  75. _allowFocusWhenDisabled = false;
  76. /**
  77. * Determine the value of the disabled attribute for this chip action.
  78. */
  79. _getDisabledAttribute() {
  80. // When this chip action is disabled and focusing disabled chips is not permitted, return empty
  81. // string to indicate that disabled attribute should be included.
  82. return this.disabled && !this._allowFocusWhenDisabled ? '' : null;
  83. }
  84. /**
  85. * Determine the value of the tabindex attribute for this chip action.
  86. */
  87. _getTabindex() {
  88. return (this.disabled && !this._allowFocusWhenDisabled) || !this.isInteractive
  89. ? null
  90. : this.tabIndex.toString();
  91. }
  92. constructor() {
  93. inject(_CdkPrivateStyleLoader).load(_StructuralStylesLoader);
  94. if (this._elementRef.nativeElement.nodeName === 'BUTTON') {
  95. this._elementRef.nativeElement.setAttribute('type', 'button');
  96. }
  97. }
  98. focus() {
  99. this._elementRef.nativeElement.focus();
  100. }
  101. _handleClick(event) {
  102. if (!this.disabled && this.isInteractive && this._isPrimary) {
  103. event.preventDefault();
  104. this._parentChip._handlePrimaryActionInteraction();
  105. }
  106. }
  107. _handleKeydown(event) {
  108. if ((event.keyCode === ENTER || event.keyCode === SPACE) &&
  109. !this.disabled &&
  110. this.isInteractive &&
  111. this._isPrimary &&
  112. !this._parentChip._isEditing) {
  113. event.preventDefault();
  114. this._parentChip._handlePrimaryActionInteraction();
  115. }
  116. }
  117. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipAction, deps: [], target: i0.ɵɵFactoryTarget.Directive });
  118. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.2.6", type: MatChipAction, isStandalone: true, selector: "[matChipAction]", inputs: { isInteractive: "isInteractive", disabled: ["disabled", "disabled", booleanAttribute], tabIndex: ["tabIndex", "tabIndex", (value) => (value == null ? -1 : numberAttribute(value))], _allowFocusWhenDisabled: "_allowFocusWhenDisabled" }, host: { listeners: { "click": "_handleClick($event)", "keydown": "_handleKeydown($event)" }, properties: { "class.mdc-evolution-chip__action--primary": "_isPrimary", "class.mdc-evolution-chip__action--presentational": "!isInteractive", "class.mdc-evolution-chip__action--trailing": "!_isPrimary", "attr.tabindex": "_getTabindex()", "attr.disabled": "_getDisabledAttribute()", "attr.aria-disabled": "disabled" }, classAttribute: "mdc-evolution-chip__action mat-mdc-chip-action" }, ngImport: i0 });
  119. }
  120. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipAction, decorators: [{
  121. type: Directive,
  122. args: [{
  123. selector: '[matChipAction]',
  124. host: {
  125. 'class': 'mdc-evolution-chip__action mat-mdc-chip-action',
  126. '[class.mdc-evolution-chip__action--primary]': '_isPrimary',
  127. '[class.mdc-evolution-chip__action--presentational]': '!isInteractive',
  128. '[class.mdc-evolution-chip__action--trailing]': '!_isPrimary',
  129. '[attr.tabindex]': '_getTabindex()',
  130. '[attr.disabled]': '_getDisabledAttribute()',
  131. '[attr.aria-disabled]': 'disabled',
  132. '(click)': '_handleClick($event)',
  133. '(keydown)': '_handleKeydown($event)',
  134. },
  135. }]
  136. }], ctorParameters: () => [], propDecorators: { isInteractive: [{
  137. type: Input
  138. }], disabled: [{
  139. type: Input,
  140. args: [{ transform: booleanAttribute }]
  141. }], tabIndex: [{
  142. type: Input,
  143. args: [{
  144. transform: (value) => (value == null ? -1 : numberAttribute(value)),
  145. }]
  146. }], _allowFocusWhenDisabled: [{
  147. type: Input
  148. }] } });
  149. /** Avatar image within a chip. */
  150. class MatChipAvatar {
  151. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipAvatar, deps: [], target: i0.ɵɵFactoryTarget.Directive });
  152. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: MatChipAvatar, isStandalone: true, selector: "mat-chip-avatar, [matChipAvatar]", host: { attributes: { "role": "img" }, classAttribute: "mat-mdc-chip-avatar mdc-evolution-chip__icon mdc-evolution-chip__icon--primary" }, providers: [{ provide: MAT_CHIP_AVATAR, useExisting: MatChipAvatar }], ngImport: i0 });
  153. }
  154. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipAvatar, decorators: [{
  155. type: Directive,
  156. args: [{
  157. selector: 'mat-chip-avatar, [matChipAvatar]',
  158. host: {
  159. 'class': 'mat-mdc-chip-avatar mdc-evolution-chip__icon mdc-evolution-chip__icon--primary',
  160. 'role': 'img',
  161. },
  162. providers: [{ provide: MAT_CHIP_AVATAR, useExisting: MatChipAvatar }],
  163. }]
  164. }] });
  165. /** Non-interactive trailing icon in a chip. */
  166. class MatChipTrailingIcon extends MatChipAction {
  167. /**
  168. * MDC considers all trailing actions as a remove icon,
  169. * but we support non-interactive trailing icons.
  170. */
  171. isInteractive = false;
  172. _isPrimary = false;
  173. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipTrailingIcon, deps: null, target: i0.ɵɵFactoryTarget.Directive });
  174. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: MatChipTrailingIcon, isStandalone: true, selector: "mat-chip-trailing-icon, [matChipTrailingIcon]", host: { attributes: { "aria-hidden": "true" }, classAttribute: "mat-mdc-chip-trailing-icon mdc-evolution-chip__icon mdc-evolution-chip__icon--trailing" }, providers: [{ provide: MAT_CHIP_TRAILING_ICON, useExisting: MatChipTrailingIcon }], usesInheritance: true, ngImport: i0 });
  175. }
  176. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipTrailingIcon, decorators: [{
  177. type: Directive,
  178. args: [{
  179. selector: 'mat-chip-trailing-icon, [matChipTrailingIcon]',
  180. host: {
  181. 'class': 'mat-mdc-chip-trailing-icon mdc-evolution-chip__icon mdc-evolution-chip__icon--trailing',
  182. 'aria-hidden': 'true',
  183. },
  184. providers: [{ provide: MAT_CHIP_TRAILING_ICON, useExisting: MatChipTrailingIcon }],
  185. }]
  186. }] });
  187. /**
  188. * Directive to remove the parent chip when the trailing icon is clicked or
  189. * when the ENTER key is pressed on it.
  190. *
  191. * Recommended for use with the Material Design "cancel" icon
  192. * available at https://material.io/icons/#ic_cancel.
  193. *
  194. * Example:
  195. *
  196. * ```
  197. * <mat-chip>
  198. * <mat-icon matChipRemove>cancel</mat-icon>
  199. * </mat-chip>
  200. * ```
  201. */
  202. class MatChipRemove extends MatChipAction {
  203. _isPrimary = false;
  204. _handleClick(event) {
  205. if (!this.disabled) {
  206. event.stopPropagation();
  207. event.preventDefault();
  208. this._parentChip.remove();
  209. }
  210. }
  211. _handleKeydown(event) {
  212. if ((event.keyCode === ENTER || event.keyCode === SPACE) && !this.disabled) {
  213. event.stopPropagation();
  214. event.preventDefault();
  215. this._parentChip.remove();
  216. }
  217. }
  218. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipRemove, deps: null, target: i0.ɵɵFactoryTarget.Directive });
  219. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: MatChipRemove, isStandalone: true, selector: "[matChipRemove]", host: { attributes: { "role": "button" }, properties: { "attr.aria-hidden": "null" }, classAttribute: "mat-mdc-chip-remove mat-mdc-chip-trailing-icon mat-focus-indicator mdc-evolution-chip__icon mdc-evolution-chip__icon--trailing" }, providers: [{ provide: MAT_CHIP_REMOVE, useExisting: MatChipRemove }], usesInheritance: true, ngImport: i0 });
  220. }
  221. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipRemove, decorators: [{
  222. type: Directive,
  223. args: [{
  224. selector: '[matChipRemove]',
  225. host: {
  226. 'class': 'mat-mdc-chip-remove mat-mdc-chip-trailing-icon mat-focus-indicator ' +
  227. 'mdc-evolution-chip__icon mdc-evolution-chip__icon--trailing',
  228. 'role': 'button',
  229. '[attr.aria-hidden]': 'null',
  230. },
  231. providers: [{ provide: MAT_CHIP_REMOVE, useExisting: MatChipRemove }],
  232. }]
  233. }] });
  234. /**
  235. * Material design styled Chip base component. Used inside the MatChipSet component.
  236. *
  237. * Extended by MatChipOption and MatChipRow for different interaction patterns.
  238. */
  239. class MatChip {
  240. _changeDetectorRef = inject(ChangeDetectorRef);
  241. _elementRef = inject(ElementRef);
  242. _ngZone = inject(NgZone);
  243. _focusMonitor = inject(FocusMonitor);
  244. _globalRippleOptions = inject(MAT_RIPPLE_GLOBAL_OPTIONS, {
  245. optional: true,
  246. });
  247. _document = inject(DOCUMENT);
  248. /** Emits when the chip is focused. */
  249. _onFocus = new Subject();
  250. /** Emits when the chip is blurred. */
  251. _onBlur = new Subject();
  252. /** Whether this chip is a basic (unstyled) chip. */
  253. _isBasicChip;
  254. /** Role for the root of the chip. */
  255. role = null;
  256. /** Whether the chip has focus. */
  257. _hasFocusInternal = false;
  258. /** Whether moving focus into the chip is pending. */
  259. _pendingFocus;
  260. /** Subscription to changes in the chip's actions. */
  261. _actionChanges;
  262. /** Whether animations for the chip are enabled. */
  263. _animationsDisabled;
  264. /** All avatars present in the chip. */
  265. _allLeadingIcons;
  266. /** All trailing icons present in the chip. */
  267. _allTrailingIcons;
  268. /** All remove icons present in the chip. */
  269. _allRemoveIcons;
  270. _hasFocus() {
  271. return this._hasFocusInternal;
  272. }
  273. /** A unique id for the chip. If none is supplied, it will be auto-generated. */
  274. id = inject(_IdGenerator).getId('mat-mdc-chip-');
  275. // TODO(#26104): Consider deprecating and using `_computeAriaAccessibleName` instead.
  276. // `ariaLabel` may be unnecessary, and `_computeAriaAccessibleName` only supports
  277. // datepicker's use case.
  278. /** ARIA label for the content of the chip. */
  279. ariaLabel = null;
  280. // TODO(#26104): Consider deprecating and using `_computeAriaAccessibleName` instead.
  281. // `ariaDescription` may be unnecessary, and `_computeAriaAccessibleName` only supports
  282. // datepicker's use case.
  283. /** ARIA description for the content of the chip. */
  284. ariaDescription = null;
  285. /** Id of a span that contains this chip's aria description. */
  286. _ariaDescriptionId = `${this.id}-aria-description`;
  287. /** Whether the chip list is disabled. */
  288. _chipListDisabled = false;
  289. _textElement;
  290. /**
  291. * The value of the chip. Defaults to the content inside
  292. * the `mat-mdc-chip-action-label` element.
  293. */
  294. get value() {
  295. return this._value !== undefined ? this._value : this._textElement.textContent.trim();
  296. }
  297. set value(value) {
  298. this._value = value;
  299. }
  300. _value;
  301. // TODO: should be typed as `ThemePalette` but internal apps pass in arbitrary strings.
  302. /**
  303. * Theme color of the chip. This API is supported in M2 themes only, it has no
  304. * effect in M3 themes. For color customization in M3, see https://material.angular.dev/components/chips/styling.
  305. *
  306. * For information on applying color variants in M3, see
  307. * https://material.angular.dev/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants
  308. */
  309. color;
  310. /**
  311. * Determines whether or not the chip displays the remove styling and emits (removed) events.
  312. */
  313. removable = true;
  314. /**
  315. * Colors the chip for emphasis as if it were selected.
  316. */
  317. highlighted = false;
  318. /** Whether the ripple effect is disabled or not. */
  319. disableRipple = false;
  320. /** Whether the chip is disabled. */
  321. get disabled() {
  322. return this._disabled || this._chipListDisabled;
  323. }
  324. set disabled(value) {
  325. this._disabled = value;
  326. }
  327. _disabled = false;
  328. /** Emitted when a chip is to be removed. */
  329. removed = new EventEmitter();
  330. /** Emitted when the chip is destroyed. */
  331. destroyed = new EventEmitter();
  332. /** The unstyled chip selector for this component. */
  333. basicChipAttrName = 'mat-basic-chip';
  334. /** The chip's leading icon. */
  335. leadingIcon;
  336. /** The chip's trailing icon. */
  337. trailingIcon;
  338. /** The chip's trailing remove icon. */
  339. removeIcon;
  340. /** Action receiving the primary set of user interactions. */
  341. primaryAction;
  342. /**
  343. * Handles the lazy creation of the MatChip ripple.
  344. * Used to improve initial load time of large applications.
  345. */
  346. _rippleLoader = inject(MatRippleLoader);
  347. _injector = inject(Injector);
  348. constructor() {
  349. const styleLoader = inject(_CdkPrivateStyleLoader);
  350. styleLoader.load(_StructuralStylesLoader);
  351. styleLoader.load(_VisuallyHiddenLoader);
  352. const animationMode = inject(ANIMATION_MODULE_TYPE, { optional: true });
  353. this._animationsDisabled = animationMode === 'NoopAnimations';
  354. this._monitorFocus();
  355. this._rippleLoader?.configureRipple(this._elementRef.nativeElement, {
  356. className: 'mat-mdc-chip-ripple',
  357. disabled: this._isRippleDisabled(),
  358. });
  359. }
  360. ngOnInit() {
  361. // This check needs to happen in `ngOnInit` so the overridden value of
  362. // `basicChipAttrName` coming from base classes can be picked up.
  363. const element = this._elementRef.nativeElement;
  364. this._isBasicChip =
  365. element.hasAttribute(this.basicChipAttrName) ||
  366. element.tagName.toLowerCase() === this.basicChipAttrName;
  367. }
  368. ngAfterViewInit() {
  369. this._textElement = this._elementRef.nativeElement.querySelector('.mat-mdc-chip-action-label');
  370. if (this._pendingFocus) {
  371. this._pendingFocus = false;
  372. this.focus();
  373. }
  374. }
  375. ngAfterContentInit() {
  376. // Since the styling depends on the presence of some
  377. // actions, we have to mark for check on changes.
  378. this._actionChanges = merge(this._allLeadingIcons.changes, this._allTrailingIcons.changes, this._allRemoveIcons.changes).subscribe(() => this._changeDetectorRef.markForCheck());
  379. }
  380. ngDoCheck() {
  381. this._rippleLoader.setDisabled(this._elementRef.nativeElement, this._isRippleDisabled());
  382. }
  383. ngOnDestroy() {
  384. this._focusMonitor.stopMonitoring(this._elementRef);
  385. this._rippleLoader?.destroyRipple(this._elementRef.nativeElement);
  386. this._actionChanges?.unsubscribe();
  387. this.destroyed.emit({ chip: this });
  388. this.destroyed.complete();
  389. }
  390. /**
  391. * Allows for programmatic removal of the chip.
  392. *
  393. * Informs any listeners of the removal request. Does not remove the chip from the DOM.
  394. */
  395. remove() {
  396. if (this.removable) {
  397. this.removed.emit({ chip: this });
  398. }
  399. }
  400. /** Whether or not the ripple should be disabled. */
  401. _isRippleDisabled() {
  402. return (this.disabled ||
  403. this.disableRipple ||
  404. this._animationsDisabled ||
  405. this._isBasicChip ||
  406. !!this._globalRippleOptions?.disabled);
  407. }
  408. /** Returns whether the chip has a trailing icon. */
  409. _hasTrailingIcon() {
  410. return !!(this.trailingIcon || this.removeIcon);
  411. }
  412. /** Handles keyboard events on the chip. */
  413. _handleKeydown(event) {
  414. // Ignore backspace events where the user is holding down the key
  415. // so that we don't accidentally remove too many chips.
  416. if ((event.keyCode === BACKSPACE && !event.repeat) || event.keyCode === DELETE) {
  417. event.preventDefault();
  418. this.remove();
  419. }
  420. }
  421. /** Allows for programmatic focusing of the chip. */
  422. focus() {
  423. if (!this.disabled) {
  424. // If `focus` is called before `ngAfterViewInit`, we won't have access to the primary action.
  425. // This can happen if the consumer tries to focus a chip immediately after it is added.
  426. // Queue the method to be called again on init.
  427. if (this.primaryAction) {
  428. this.primaryAction.focus();
  429. }
  430. else {
  431. this._pendingFocus = true;
  432. }
  433. }
  434. }
  435. /** Gets the action that contains a specific target node. */
  436. _getSourceAction(target) {
  437. return this._getActions().find(action => {
  438. const element = action._elementRef.nativeElement;
  439. return element === target || element.contains(target);
  440. });
  441. }
  442. /** Gets all of the actions within the chip. */
  443. _getActions() {
  444. const result = [];
  445. if (this.primaryAction) {
  446. result.push(this.primaryAction);
  447. }
  448. if (this.removeIcon) {
  449. result.push(this.removeIcon);
  450. }
  451. if (this.trailingIcon) {
  452. result.push(this.trailingIcon);
  453. }
  454. return result;
  455. }
  456. /** Handles interactions with the primary action of the chip. */
  457. _handlePrimaryActionInteraction() {
  458. // Empty here, but is overwritten in child classes.
  459. }
  460. /** Starts the focus monitoring process on the chip. */
  461. _monitorFocus() {
  462. this._focusMonitor.monitor(this._elementRef, true).subscribe(origin => {
  463. const hasFocus = origin !== null;
  464. if (hasFocus !== this._hasFocusInternal) {
  465. this._hasFocusInternal = hasFocus;
  466. if (hasFocus) {
  467. this._onFocus.next({ chip: this });
  468. }
  469. else {
  470. // When animations are enabled, Angular may end up removing the chip from the DOM a little
  471. // earlier than usual, causing it to be blurred and throwing off the logic in the chip list
  472. // that moves focus to the next item. To work around the issue, we defer marking the chip
  473. // as not focused until after the next render.
  474. this._changeDetectorRef.markForCheck();
  475. setTimeout(() => this._ngZone.run(() => this._onBlur.next({ chip: this })));
  476. }
  477. }
  478. });
  479. }
  480. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChip, deps: [], target: i0.ɵɵFactoryTarget.Component });
  481. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: MatChip, isStandalone: true, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: { role: "role", id: "id", ariaLabel: ["aria-label", "ariaLabel"], ariaDescription: ["aria-description", "ariaDescription"], value: "value", color: "color", removable: ["removable", "removable", booleanAttribute], highlighted: ["highlighted", "highlighted", booleanAttribute], disableRipple: ["disableRipple", "disableRipple", booleanAttribute], disabled: ["disabled", "disabled", booleanAttribute] }, outputs: { removed: "removed", destroyed: "destroyed" }, host: { listeners: { "keydown": "_handleKeydown($event)" }, properties: { "class": "\"mat-\" + (color || \"primary\")", "class.mdc-evolution-chip": "!_isBasicChip", "class.mdc-evolution-chip--disabled": "disabled", "class.mdc-evolution-chip--with-trailing-action": "_hasTrailingIcon()", "class.mdc-evolution-chip--with-primary-graphic": "leadingIcon", "class.mdc-evolution-chip--with-primary-icon": "leadingIcon", "class.mdc-evolution-chip--with-avatar": "leadingIcon", "class.mat-mdc-chip-with-avatar": "leadingIcon", "class.mat-mdc-chip-highlighted": "highlighted", "class.mat-mdc-chip-disabled": "disabled", "class.mat-mdc-basic-chip": "_isBasicChip", "class.mat-mdc-standard-chip": "!_isBasicChip", "class.mat-mdc-chip-with-trailing-icon": "_hasTrailingIcon()", "class._mat-animation-noopable": "_animationsDisabled", "id": "id", "attr.role": "role", "attr.aria-label": "ariaLabel" }, classAttribute: "mat-mdc-chip" }, providers: [{ provide: MAT_CHIP, useExisting: MatChip }], queries: [{ propertyName: "leadingIcon", first: true, predicate: MAT_CHIP_AVATAR, descendants: true }, { propertyName: "trailingIcon", first: true, predicate: MAT_CHIP_TRAILING_ICON, descendants: true }, { propertyName: "removeIcon", first: true, predicate: MAT_CHIP_REMOVE, descendants: true }, { propertyName: "_allLeadingIcons", predicate: MAT_CHIP_AVATAR, descendants: true }, { propertyName: "_allTrailingIcons", predicate: MAT_CHIP_TRAILING_ICON, descendants: true }, { propertyName: "_allRemoveIcons", predicate: MAT_CHIP_REMOVE, descendants: true }], viewQueries: [{ propertyName: "primaryAction", first: true, predicate: MatChipAction, descendants: true }], exportAs: ["matChip"], ngImport: i0, template: "<span class=\"mat-mdc-chip-focus-overlay\"></span>\n\n<span class=\"mdc-evolution-chip__cell mdc-evolution-chip__cell--primary\">\n <span matChipAction [isInteractive]=\"false\">\n @if (leadingIcon) {\n <span class=\"mdc-evolution-chip__graphic mat-mdc-chip-graphic\">\n <ng-content select=\"mat-chip-avatar, [matChipAvatar]\"></ng-content>\n </span>\n }\n <span class=\"mdc-evolution-chip__text-label mat-mdc-chip-action-label\">\n <ng-content></ng-content>\n <span class=\"mat-mdc-chip-primary-focus-indicator mat-focus-indicator\"></span>\n </span>\n </span>\n</span>\n\n@if (_hasTrailingIcon()) {\n <span class=\"mdc-evolution-chip__cell mdc-evolution-chip__cell--trailing\">\n <ng-content select=\"mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]\"></ng-content>\n </span>\n}\n", styles: [".mdc-evolution-chip,.mdc-evolution-chip__cell,.mdc-evolution-chip__action{display:inline-flex;align-items:center}.mdc-evolution-chip{position:relative;max-width:100%}.mdc-evolution-chip__cell,.mdc-evolution-chip__action{height:100%}.mdc-evolution-chip__cell--primary{flex-basis:100%;overflow-x:hidden}.mdc-evolution-chip__cell--trailing{flex:1 0 auto}.mdc-evolution-chip__action{align-items:center;background:none;border:none;box-sizing:content-box;cursor:pointer;display:inline-flex;justify-content:center;outline:none;padding:0;text-decoration:none;color:inherit}.mdc-evolution-chip__action--presentational{cursor:auto}.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{pointer-events:none}@media(forced-colors: active){.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{forced-color-adjust:none}}.mdc-evolution-chip__action--primary{font:inherit;letter-spacing:inherit;white-space:inherit;overflow-x:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-outline-width, 1px);border-radius:var(--mdc-chip-container-shape-radius, 8px);box-sizing:border-box;content:\"\";height:100%;left:0;position:absolute;pointer-events:none;top:0;width:100%;z-index:1;border-style:solid}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-outline-color, var(--mat-sys-outline))}.mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus::before{border-color:var(--mdc-chip-focus-outline-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-basic-chip .mdc-evolution-chip__action--primary{font:inherit}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip__action--trailing{position:relative;overflow:visible}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip__text-label{-webkit-user-select:none;user-select:none;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__text-label{font-family:var(--mdc-chip-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mdc-chip-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mdc-chip-label-text-size, var(--mat-sys-label-large-size));font-weight:var(--mdc-chip-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mdc-chip-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-label-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label,.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label{color:var(--mdc-chip-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-evolution-chip__graphic{align-items:center;display:inline-flex;justify-content:center;overflow:hidden;pointer-events:none;position:relative;flex:1 0 auto}.mat-mdc-standard-chip .mdc-evolution-chip__graphic{width:var(--mdc-chip-with-avatar-avatar-size, 24px);height:var(--mdc-chip-with-avatar-avatar-size, 24px);font-size:var(--mdc-chip-with-avatar-avatar-size, 24px)}.mdc-evolution-chip--selecting .mdc-evolution-chip__graphic{transition:width 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selectable:not(.mdc-evolution-chip--selected):not(.mdc-evolution-chip--with-primary-icon) .mdc-evolution-chip__graphic{width:0}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mdc-evolution-chip__checkmark{position:absolute;opacity:0;top:50%;left:50%;height:20px;width:20px}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark{transition:transform 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1);transform:translate(-75%, -50%)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{transform:translate(-50%, -50%);opacity:1}.mdc-evolution-chip__checkmark-svg{display:block}.mdc-evolution-chip__checkmark-path{stroke-width:2px;stroke-dasharray:29.7833385;stroke-dashoffset:29.7833385;stroke:currentColor}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark-path{transition:stroke-dashoffset 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark-path{stroke-dashoffset:0}@media(forced-colors: active){.mdc-evolution-chip__checkmark-path{stroke:CanvasText !important}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--trailing{height:18px;width:18px;font-size:18px}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove{opacity:calc(var(--mat-chip-trailing-action-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove:focus{opacity:calc(var(--mat-chip-trailing-action-focus-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mat-mdc-standard-chip{border-radius:var(--mdc-chip-container-shape-radius, 8px);height:var(--mdc-chip-container-height, 32px)}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-container-color, transparent)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-elevated-disabled-container-color)}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-flat-disabled-selected-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}@media(forced-colors: active){.mat-mdc-standard-chip{outline:solid 1px}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--primary{border-radius:var(--mdc-chip-with-avatar-avatar-shape-radius, 24px);width:var(--mdc-chip-with-icon-icon-size, 18px);height:var(--mdc-chip-with-icon-icon-size, 18px);font-size:var(--mdc-chip-with-icon-icon-size, 18px)}.mdc-evolution-chip--selected .mdc-evolution-chip__icon--primary{opacity:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-highlighted{--mdc-chip-with-icon-icon-color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container));--mdc-chip-elevated-container-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container));--mdc-chip-label-text-color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container));--mdc-chip-outline-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-selected .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-chip:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-hover-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-focus-overlay .mat-mdc-chip-selected:hover,.mat-mdc-chip-highlighted:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-hover-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected.cdk-focused .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-evolution-chip--disabled:not(.mdc-evolution-chip--selected) .mat-mdc-chip-avatar{opacity:var(--mdc-chip-with-avatar-disabled-avatar-opacity, 0.38)}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{opacity:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38)}.mdc-evolution-chip--disabled.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{opacity:var(--mdc-chip-with-icon-disabled-icon-opacity, 0.38)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{opacity:var(--mat-chip-disabled-container-opacity, 1)}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-trailing-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-remove{opacity:var(--mat-chip-trailing-action-opacity, 1)}.mat-mdc-chip-remove:focus{opacity:var(--mat-chip-trailing-action-focus-opacity, 1)}.mat-mdc-chip-remove::after{background-color:var(--mat-chip-trailing-action-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-remove:hover::after{opacity:var(--mat-chip-trailing-action-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-remove:focus::after{opacity:var(--mat-chip-trailing-action-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected .mat-mdc-chip-remove::after,.mat-mdc-chip-highlighted .mat-mdc-chip-remove::after{background-color:var(--mat-chip-selected-trailing-action-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-standard-chip .mdc-evolution-chip__cell--primary,.mat-mdc-standard-chip .mdc-evolution-chip__action--primary,.mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:visible}.mat-mdc-standard-chip .mat-mdc-chip-graphic,.mat-mdc-standard-chip .mat-mdc-chip-trailing-icon{box-sizing:content-box}.mat-mdc-standard-chip._mat-animation-noopable,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__graphic,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark-path{transition-duration:1ms;animation-duration:1ms}.mat-mdc-chip-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;opacity:0;border-radius:inherit;transition:opacity 150ms linear}._mat-animation-noopable .mat-mdc-chip-focus-overlay{transition:none}.mat-mdc-basic-chip .mat-mdc-chip-focus-overlay{display:none}.mat-mdc-chip .mat-ripple.mat-mdc-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-chip-avatar{text-align:center;line-height:1;color:var(--mdc-chip-with-icon-icon-color, currentColor)}.mat-mdc-chip{position:relative;z-index:0}.mat-mdc-chip-action-label{text-align:left;z-index:1}[dir=rtl] .mat-mdc-chip-action-label{text-align:right}.mat-mdc-chip.mdc-evolution-chip--with-trailing-action .mat-mdc-chip-action-label{position:relative}.mat-mdc-chip-action-label .mat-mdc-chip-primary-focus-indicator{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}.mat-mdc-chip-action-label .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-chip-remove::before{margin:calc(var(--mat-focus-indicator-border-width, 3px)*-1);left:8px;right:8px}.mat-mdc-chip-remove::after{content:\"\";display:block;opacity:0;position:absolute;top:-3px;bottom:-3px;left:5px;right:5px;border-radius:50%;box-sizing:border-box;padding:12px;margin:-12px;background-clip:content-box}.mat-mdc-chip-remove .mat-icon{width:18px;height:18px;font-size:18px;box-sizing:content-box}.mat-chip-edit-input{cursor:text;display:inline-block;color:inherit;outline:0}@media(forced-colors: active){.mat-mdc-chip-selected:not(.mat-mdc-chip-multiple){outline-width:3px}}.mat-mdc-chip-action:focus .mat-focus-indicator::before{content:\"\"}.mdc-evolution-chip__icon,.mat-mdc-chip-remove .mat-icon{min-height:fit-content}\n"], dependencies: [{ kind: "directive", type: MatChipAction, selector: "[matChipAction]", inputs: ["isInteractive", "disabled", "tabIndex", "_allowFocusWhenDisabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  482. }
  483. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChip, decorators: [{
  484. type: Component,
  485. args: [{ selector: 'mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]', exportAs: 'matChip', host: {
  486. 'class': 'mat-mdc-chip',
  487. '[class]': '"mat-" + (color || "primary")',
  488. '[class.mdc-evolution-chip]': '!_isBasicChip',
  489. '[class.mdc-evolution-chip--disabled]': 'disabled',
  490. '[class.mdc-evolution-chip--with-trailing-action]': '_hasTrailingIcon()',
  491. '[class.mdc-evolution-chip--with-primary-graphic]': 'leadingIcon',
  492. '[class.mdc-evolution-chip--with-primary-icon]': 'leadingIcon',
  493. '[class.mdc-evolution-chip--with-avatar]': 'leadingIcon',
  494. '[class.mat-mdc-chip-with-avatar]': 'leadingIcon',
  495. '[class.mat-mdc-chip-highlighted]': 'highlighted',
  496. '[class.mat-mdc-chip-disabled]': 'disabled',
  497. '[class.mat-mdc-basic-chip]': '_isBasicChip',
  498. '[class.mat-mdc-standard-chip]': '!_isBasicChip',
  499. '[class.mat-mdc-chip-with-trailing-icon]': '_hasTrailingIcon()',
  500. '[class._mat-animation-noopable]': '_animationsDisabled',
  501. '[id]': 'id',
  502. '[attr.role]': 'role',
  503. '[attr.aria-label]': 'ariaLabel',
  504. '(keydown)': '_handleKeydown($event)',
  505. }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: MAT_CHIP, useExisting: MatChip }], imports: [MatChipAction], template: "<span class=\"mat-mdc-chip-focus-overlay\"></span>\n\n<span class=\"mdc-evolution-chip__cell mdc-evolution-chip__cell--primary\">\n <span matChipAction [isInteractive]=\"false\">\n @if (leadingIcon) {\n <span class=\"mdc-evolution-chip__graphic mat-mdc-chip-graphic\">\n <ng-content select=\"mat-chip-avatar, [matChipAvatar]\"></ng-content>\n </span>\n }\n <span class=\"mdc-evolution-chip__text-label mat-mdc-chip-action-label\">\n <ng-content></ng-content>\n <span class=\"mat-mdc-chip-primary-focus-indicator mat-focus-indicator\"></span>\n </span>\n </span>\n</span>\n\n@if (_hasTrailingIcon()) {\n <span class=\"mdc-evolution-chip__cell mdc-evolution-chip__cell--trailing\">\n <ng-content select=\"mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]\"></ng-content>\n </span>\n}\n", styles: [".mdc-evolution-chip,.mdc-evolution-chip__cell,.mdc-evolution-chip__action{display:inline-flex;align-items:center}.mdc-evolution-chip{position:relative;max-width:100%}.mdc-evolution-chip__cell,.mdc-evolution-chip__action{height:100%}.mdc-evolution-chip__cell--primary{flex-basis:100%;overflow-x:hidden}.mdc-evolution-chip__cell--trailing{flex:1 0 auto}.mdc-evolution-chip__action{align-items:center;background:none;border:none;box-sizing:content-box;cursor:pointer;display:inline-flex;justify-content:center;outline:none;padding:0;text-decoration:none;color:inherit}.mdc-evolution-chip__action--presentational{cursor:auto}.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{pointer-events:none}@media(forced-colors: active){.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{forced-color-adjust:none}}.mdc-evolution-chip__action--primary{font:inherit;letter-spacing:inherit;white-space:inherit;overflow-x:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-outline-width, 1px);border-radius:var(--mdc-chip-container-shape-radius, 8px);box-sizing:border-box;content:\"\";height:100%;left:0;position:absolute;pointer-events:none;top:0;width:100%;z-index:1;border-style:solid}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-outline-color, var(--mat-sys-outline))}.mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus::before{border-color:var(--mdc-chip-focus-outline-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-basic-chip .mdc-evolution-chip__action--primary{font:inherit}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip__action--trailing{position:relative;overflow:visible}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip__text-label{-webkit-user-select:none;user-select:none;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__text-label{font-family:var(--mdc-chip-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mdc-chip-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mdc-chip-label-text-size, var(--mat-sys-label-large-size));font-weight:var(--mdc-chip-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mdc-chip-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-label-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label,.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label{color:var(--mdc-chip-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-evolution-chip__graphic{align-items:center;display:inline-flex;justify-content:center;overflow:hidden;pointer-events:none;position:relative;flex:1 0 auto}.mat-mdc-standard-chip .mdc-evolution-chip__graphic{width:var(--mdc-chip-with-avatar-avatar-size, 24px);height:var(--mdc-chip-with-avatar-avatar-size, 24px);font-size:var(--mdc-chip-with-avatar-avatar-size, 24px)}.mdc-evolution-chip--selecting .mdc-evolution-chip__graphic{transition:width 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selectable:not(.mdc-evolution-chip--selected):not(.mdc-evolution-chip--with-primary-icon) .mdc-evolution-chip__graphic{width:0}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mdc-evolution-chip__checkmark{position:absolute;opacity:0;top:50%;left:50%;height:20px;width:20px}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark{transition:transform 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1);transform:translate(-75%, -50%)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{transform:translate(-50%, -50%);opacity:1}.mdc-evolution-chip__checkmark-svg{display:block}.mdc-evolution-chip__checkmark-path{stroke-width:2px;stroke-dasharray:29.7833385;stroke-dashoffset:29.7833385;stroke:currentColor}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark-path{transition:stroke-dashoffset 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark-path{stroke-dashoffset:0}@media(forced-colors: active){.mdc-evolution-chip__checkmark-path{stroke:CanvasText !important}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--trailing{height:18px;width:18px;font-size:18px}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove{opacity:calc(var(--mat-chip-trailing-action-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove:focus{opacity:calc(var(--mat-chip-trailing-action-focus-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mat-mdc-standard-chip{border-radius:var(--mdc-chip-container-shape-radius, 8px);height:var(--mdc-chip-container-height, 32px)}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-container-color, transparent)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-elevated-disabled-container-color)}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-flat-disabled-selected-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}@media(forced-colors: active){.mat-mdc-standard-chip{outline:solid 1px}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--primary{border-radius:var(--mdc-chip-with-avatar-avatar-shape-radius, 24px);width:var(--mdc-chip-with-icon-icon-size, 18px);height:var(--mdc-chip-with-icon-icon-size, 18px);font-size:var(--mdc-chip-with-icon-icon-size, 18px)}.mdc-evolution-chip--selected .mdc-evolution-chip__icon--primary{opacity:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-highlighted{--mdc-chip-with-icon-icon-color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container));--mdc-chip-elevated-container-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container));--mdc-chip-label-text-color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container));--mdc-chip-outline-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-selected .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-chip:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-hover-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-focus-overlay .mat-mdc-chip-selected:hover,.mat-mdc-chip-highlighted:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-hover-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected.cdk-focused .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-evolution-chip--disabled:not(.mdc-evolution-chip--selected) .mat-mdc-chip-avatar{opacity:var(--mdc-chip-with-avatar-disabled-avatar-opacity, 0.38)}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{opacity:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38)}.mdc-evolution-chip--disabled.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{opacity:var(--mdc-chip-with-icon-disabled-icon-opacity, 0.38)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{opacity:var(--mat-chip-disabled-container-opacity, 1)}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-trailing-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-remove{opacity:var(--mat-chip-trailing-action-opacity, 1)}.mat-mdc-chip-remove:focus{opacity:var(--mat-chip-trailing-action-focus-opacity, 1)}.mat-mdc-chip-remove::after{background-color:var(--mat-chip-trailing-action-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-remove:hover::after{opacity:var(--mat-chip-trailing-action-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-remove:focus::after{opacity:var(--mat-chip-trailing-action-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected .mat-mdc-chip-remove::after,.mat-mdc-chip-highlighted .mat-mdc-chip-remove::after{background-color:var(--mat-chip-selected-trailing-action-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-standard-chip .mdc-evolution-chip__cell--primary,.mat-mdc-standard-chip .mdc-evolution-chip__action--primary,.mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:visible}.mat-mdc-standard-chip .mat-mdc-chip-graphic,.mat-mdc-standard-chip .mat-mdc-chip-trailing-icon{box-sizing:content-box}.mat-mdc-standard-chip._mat-animation-noopable,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__graphic,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark-path{transition-duration:1ms;animation-duration:1ms}.mat-mdc-chip-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;opacity:0;border-radius:inherit;transition:opacity 150ms linear}._mat-animation-noopable .mat-mdc-chip-focus-overlay{transition:none}.mat-mdc-basic-chip .mat-mdc-chip-focus-overlay{display:none}.mat-mdc-chip .mat-ripple.mat-mdc-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-chip-avatar{text-align:center;line-height:1;color:var(--mdc-chip-with-icon-icon-color, currentColor)}.mat-mdc-chip{position:relative;z-index:0}.mat-mdc-chip-action-label{text-align:left;z-index:1}[dir=rtl] .mat-mdc-chip-action-label{text-align:right}.mat-mdc-chip.mdc-evolution-chip--with-trailing-action .mat-mdc-chip-action-label{position:relative}.mat-mdc-chip-action-label .mat-mdc-chip-primary-focus-indicator{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}.mat-mdc-chip-action-label .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-chip-remove::before{margin:calc(var(--mat-focus-indicator-border-width, 3px)*-1);left:8px;right:8px}.mat-mdc-chip-remove::after{content:\"\";display:block;opacity:0;position:absolute;top:-3px;bottom:-3px;left:5px;right:5px;border-radius:50%;box-sizing:border-box;padding:12px;margin:-12px;background-clip:content-box}.mat-mdc-chip-remove .mat-icon{width:18px;height:18px;font-size:18px;box-sizing:content-box}.mat-chip-edit-input{cursor:text;display:inline-block;color:inherit;outline:0}@media(forced-colors: active){.mat-mdc-chip-selected:not(.mat-mdc-chip-multiple){outline-width:3px}}.mat-mdc-chip-action:focus .mat-focus-indicator::before{content:\"\"}.mdc-evolution-chip__icon,.mat-mdc-chip-remove .mat-icon{min-height:fit-content}\n"] }]
  506. }], ctorParameters: () => [], propDecorators: { role: [{
  507. type: Input
  508. }], _allLeadingIcons: [{
  509. type: ContentChildren,
  510. args: [MAT_CHIP_AVATAR, { descendants: true }]
  511. }], _allTrailingIcons: [{
  512. type: ContentChildren,
  513. args: [MAT_CHIP_TRAILING_ICON, { descendants: true }]
  514. }], _allRemoveIcons: [{
  515. type: ContentChildren,
  516. args: [MAT_CHIP_REMOVE, { descendants: true }]
  517. }], id: [{
  518. type: Input
  519. }], ariaLabel: [{
  520. type: Input,
  521. args: ['aria-label']
  522. }], ariaDescription: [{
  523. type: Input,
  524. args: ['aria-description']
  525. }], value: [{
  526. type: Input
  527. }], color: [{
  528. type: Input
  529. }], removable: [{
  530. type: Input,
  531. args: [{ transform: booleanAttribute }]
  532. }], highlighted: [{
  533. type: Input,
  534. args: [{ transform: booleanAttribute }]
  535. }], disableRipple: [{
  536. type: Input,
  537. args: [{ transform: booleanAttribute }]
  538. }], disabled: [{
  539. type: Input,
  540. args: [{ transform: booleanAttribute }]
  541. }], removed: [{
  542. type: Output
  543. }], destroyed: [{
  544. type: Output
  545. }], leadingIcon: [{
  546. type: ContentChild,
  547. args: [MAT_CHIP_AVATAR]
  548. }], trailingIcon: [{
  549. type: ContentChild,
  550. args: [MAT_CHIP_TRAILING_ICON]
  551. }], removeIcon: [{
  552. type: ContentChild,
  553. args: [MAT_CHIP_REMOVE]
  554. }], primaryAction: [{
  555. type: ViewChild,
  556. args: [MatChipAction]
  557. }] } });
  558. /** Event object emitted by MatChipOption when selected or deselected. */
  559. class MatChipSelectionChange {
  560. source;
  561. selected;
  562. isUserInput;
  563. constructor(
  564. /** Reference to the chip that emitted the event. */
  565. source,
  566. /** Whether the chip that emitted the event is selected. */
  567. selected,
  568. /** Whether the selection change was a result of a user interaction. */
  569. isUserInput = false) {
  570. this.source = source;
  571. this.selected = selected;
  572. this.isUserInput = isUserInput;
  573. }
  574. }
  575. /**
  576. * An extension of the MatChip component that supports chip selection. Used with MatChipListbox.
  577. *
  578. * Unlike other chips, the user can focus on disabled chip options inside a MatChipListbox. The
  579. * user cannot click disabled chips.
  580. */
  581. class MatChipOption extends MatChip {
  582. /** Default chip options. */
  583. _defaultOptions = inject(MAT_CHIPS_DEFAULT_OPTIONS, { optional: true });
  584. /** Whether the chip list is selectable. */
  585. chipListSelectable = true;
  586. /** Whether the chip list is in multi-selection mode. */
  587. _chipListMultiple = false;
  588. /** Whether the chip list hides single-selection indicator. */
  589. _chipListHideSingleSelectionIndicator = this._defaultOptions?.hideSingleSelectionIndicator ?? false;
  590. /**
  591. * Whether or not the chip is selectable.
  592. *
  593. * When a chip is not selectable, changes to its selected state are always
  594. * ignored. By default an option chip is selectable, and it becomes
  595. * non-selectable if its parent chip list is not selectable.
  596. */
  597. get selectable() {
  598. return this._selectable && this.chipListSelectable;
  599. }
  600. set selectable(value) {
  601. this._selectable = value;
  602. this._changeDetectorRef.markForCheck();
  603. }
  604. _selectable = true;
  605. /** Whether the chip is selected. */
  606. get selected() {
  607. return this._selected;
  608. }
  609. set selected(value) {
  610. this._setSelectedState(value, false, true);
  611. }
  612. _selected = false;
  613. /**
  614. * The ARIA selected applied to the chip. Conforms to WAI ARIA best practices for listbox
  615. * interaction patterns.
  616. *
  617. * From [WAI ARIA Listbox authoring practices guide](
  618. * https://www.w3.org/WAI/ARIA/apg/patterns/listbox/):
  619. * "If any options are selected, each selected option has either aria-selected or aria-checked
  620. * set to true. All options that are selectable but not selected have either aria-selected or
  621. * aria-checked set to false."
  622. *
  623. * Set `aria-selected="false"` on not-selected listbox options that are selectable to fix
  624. * VoiceOver reading every option as "selected" (#25736).
  625. */
  626. get ariaSelected() {
  627. return this.selectable ? this.selected.toString() : null;
  628. }
  629. /** The unstyled chip selector for this component. */
  630. basicChipAttrName = 'mat-basic-chip-option';
  631. /** Emitted when the chip is selected or deselected. */
  632. selectionChange = new EventEmitter();
  633. ngOnInit() {
  634. super.ngOnInit();
  635. this.role = 'presentation';
  636. }
  637. /** Selects the chip. */
  638. select() {
  639. this._setSelectedState(true, false, true);
  640. }
  641. /** Deselects the chip. */
  642. deselect() {
  643. this._setSelectedState(false, false, true);
  644. }
  645. /** Selects this chip and emits userInputSelection event */
  646. selectViaInteraction() {
  647. this._setSelectedState(true, true, true);
  648. }
  649. /** Toggles the current selected state of this chip. */
  650. toggleSelected(isUserInput = false) {
  651. this._setSelectedState(!this.selected, isUserInput, true);
  652. return this.selected;
  653. }
  654. _handlePrimaryActionInteraction() {
  655. if (!this.disabled) {
  656. // Interacting with the primary action implies that the chip already has focus, however
  657. // there's a bug in Safari where focus ends up lingering on the previous chip (see #27544).
  658. // We work around it by explicitly focusing the primary action of the current chip.
  659. this.focus();
  660. if (this.selectable) {
  661. this.toggleSelected(true);
  662. }
  663. }
  664. }
  665. _hasLeadingGraphic() {
  666. if (this.leadingIcon) {
  667. return true;
  668. }
  669. // The checkmark graphic communicates selected state for both single-select and multi-select.
  670. // Include checkmark in single-select to fix a11y issue where selected state is communicated
  671. // visually only using color (#25886).
  672. return !this._chipListHideSingleSelectionIndicator || this._chipListMultiple;
  673. }
  674. _setSelectedState(isSelected, isUserInput, emitEvent) {
  675. if (isSelected !== this.selected) {
  676. this._selected = isSelected;
  677. if (emitEvent) {
  678. this.selectionChange.emit({
  679. source: this,
  680. isUserInput,
  681. selected: this.selected,
  682. });
  683. }
  684. this._changeDetectorRef.markForCheck();
  685. }
  686. }
  687. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipOption, deps: null, target: i0.ɵɵFactoryTarget.Component });
  688. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: MatChipOption, isStandalone: true, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: { selectable: ["selectable", "selectable", booleanAttribute], selected: ["selected", "selected", booleanAttribute] }, outputs: { selectionChange: "selectionChange" }, host: { properties: { "class.mdc-evolution-chip": "!_isBasicChip", "class.mdc-evolution-chip--filter": "!_isBasicChip", "class.mdc-evolution-chip--selectable": "!_isBasicChip", "class.mat-mdc-chip-selected": "selected", "class.mat-mdc-chip-multiple": "_chipListMultiple", "class.mat-mdc-chip-disabled": "disabled", "class.mat-mdc-chip-with-avatar": "leadingIcon", "class.mdc-evolution-chip--disabled": "disabled", "class.mdc-evolution-chip--selected": "selected", "class.mdc-evolution-chip--selecting": "!_animationsDisabled", "class.mdc-evolution-chip--with-trailing-action": "_hasTrailingIcon()", "class.mdc-evolution-chip--with-primary-icon": "leadingIcon", "class.mdc-evolution-chip--with-primary-graphic": "_hasLeadingGraphic()", "class.mdc-evolution-chip--with-avatar": "leadingIcon", "class.mat-mdc-chip-highlighted": "highlighted", "class.mat-mdc-chip-with-trailing-icon": "_hasTrailingIcon()", "attr.tabindex": "null", "attr.aria-label": "null", "attr.aria-description": "null", "attr.role": "role", "id": "id" }, classAttribute: "mat-mdc-chip mat-mdc-chip-option" }, providers: [
  689. { provide: MatChip, useExisting: MatChipOption },
  690. { provide: MAT_CHIP, useExisting: MatChipOption },
  691. ], usesInheritance: true, ngImport: i0, template: "<span class=\"mat-mdc-chip-focus-overlay\"></span>\n\n<span class=\"mdc-evolution-chip__cell mdc-evolution-chip__cell--primary\">\n <button\n matChipAction\n [_allowFocusWhenDisabled]=\"true\"\n [attr.aria-selected]=\"ariaSelected\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-describedby]=\"_ariaDescriptionId\"\n role=\"option\">\n @if (_hasLeadingGraphic()) {\n <span class=\"mdc-evolution-chip__graphic mat-mdc-chip-graphic\">\n <ng-content select=\"mat-chip-avatar, [matChipAvatar]\"></ng-content>\n <span class=\"mdc-evolution-chip__checkmark\">\n <svg\n class=\"mdc-evolution-chip__checkmark-svg\"\n viewBox=\"-2 -3 30 30\"\n focusable=\"false\"\n aria-hidden=\"true\">\n <path class=\"mdc-evolution-chip__checkmark-path\"\n fill=\"none\" stroke=\"currentColor\" d=\"M1.73,12.91 8.1,19.28 22.79,4.59\" />\n </svg>\n </span>\n </span>\n }\n <span class=\"mdc-evolution-chip__text-label mat-mdc-chip-action-label\">\n <ng-content></ng-content>\n <span class=\"mat-mdc-chip-primary-focus-indicator mat-focus-indicator\"></span>\n </span>\n </button>\n</span>\n\n@if (_hasTrailingIcon()) {\n <span class=\"mdc-evolution-chip__cell mdc-evolution-chip__cell--trailing\">\n <ng-content select=\"mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]\"></ng-content>\n </span>\n}\n\n<span class=\"cdk-visually-hidden\" [id]=\"_ariaDescriptionId\">{{ariaDescription}}</span>\n", styles: [".mdc-evolution-chip,.mdc-evolution-chip__cell,.mdc-evolution-chip__action{display:inline-flex;align-items:center}.mdc-evolution-chip{position:relative;max-width:100%}.mdc-evolution-chip__cell,.mdc-evolution-chip__action{height:100%}.mdc-evolution-chip__cell--primary{flex-basis:100%;overflow-x:hidden}.mdc-evolution-chip__cell--trailing{flex:1 0 auto}.mdc-evolution-chip__action{align-items:center;background:none;border:none;box-sizing:content-box;cursor:pointer;display:inline-flex;justify-content:center;outline:none;padding:0;text-decoration:none;color:inherit}.mdc-evolution-chip__action--presentational{cursor:auto}.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{pointer-events:none}@media(forced-colors: active){.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{forced-color-adjust:none}}.mdc-evolution-chip__action--primary{font:inherit;letter-spacing:inherit;white-space:inherit;overflow-x:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-outline-width, 1px);border-radius:var(--mdc-chip-container-shape-radius, 8px);box-sizing:border-box;content:\"\";height:100%;left:0;position:absolute;pointer-events:none;top:0;width:100%;z-index:1;border-style:solid}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-outline-color, var(--mat-sys-outline))}.mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus::before{border-color:var(--mdc-chip-focus-outline-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-basic-chip .mdc-evolution-chip__action--primary{font:inherit}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip__action--trailing{position:relative;overflow:visible}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip__text-label{-webkit-user-select:none;user-select:none;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__text-label{font-family:var(--mdc-chip-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mdc-chip-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mdc-chip-label-text-size, var(--mat-sys-label-large-size));font-weight:var(--mdc-chip-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mdc-chip-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-label-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label,.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label{color:var(--mdc-chip-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-evolution-chip__graphic{align-items:center;display:inline-flex;justify-content:center;overflow:hidden;pointer-events:none;position:relative;flex:1 0 auto}.mat-mdc-standard-chip .mdc-evolution-chip__graphic{width:var(--mdc-chip-with-avatar-avatar-size, 24px);height:var(--mdc-chip-with-avatar-avatar-size, 24px);font-size:var(--mdc-chip-with-avatar-avatar-size, 24px)}.mdc-evolution-chip--selecting .mdc-evolution-chip__graphic{transition:width 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selectable:not(.mdc-evolution-chip--selected):not(.mdc-evolution-chip--with-primary-icon) .mdc-evolution-chip__graphic{width:0}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mdc-evolution-chip__checkmark{position:absolute;opacity:0;top:50%;left:50%;height:20px;width:20px}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark{transition:transform 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1);transform:translate(-75%, -50%)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{transform:translate(-50%, -50%);opacity:1}.mdc-evolution-chip__checkmark-svg{display:block}.mdc-evolution-chip__checkmark-path{stroke-width:2px;stroke-dasharray:29.7833385;stroke-dashoffset:29.7833385;stroke:currentColor}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark-path{transition:stroke-dashoffset 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark-path{stroke-dashoffset:0}@media(forced-colors: active){.mdc-evolution-chip__checkmark-path{stroke:CanvasText !important}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--trailing{height:18px;width:18px;font-size:18px}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove{opacity:calc(var(--mat-chip-trailing-action-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove:focus{opacity:calc(var(--mat-chip-trailing-action-focus-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mat-mdc-standard-chip{border-radius:var(--mdc-chip-container-shape-radius, 8px);height:var(--mdc-chip-container-height, 32px)}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-container-color, transparent)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-elevated-disabled-container-color)}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-flat-disabled-selected-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}@media(forced-colors: active){.mat-mdc-standard-chip{outline:solid 1px}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--primary{border-radius:var(--mdc-chip-with-avatar-avatar-shape-radius, 24px);width:var(--mdc-chip-with-icon-icon-size, 18px);height:var(--mdc-chip-with-icon-icon-size, 18px);font-size:var(--mdc-chip-with-icon-icon-size, 18px)}.mdc-evolution-chip--selected .mdc-evolution-chip__icon--primary{opacity:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-highlighted{--mdc-chip-with-icon-icon-color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container));--mdc-chip-elevated-container-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container));--mdc-chip-label-text-color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container));--mdc-chip-outline-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-selected .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-chip:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-hover-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-focus-overlay .mat-mdc-chip-selected:hover,.mat-mdc-chip-highlighted:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-hover-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected.cdk-focused .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-evolution-chip--disabled:not(.mdc-evolution-chip--selected) .mat-mdc-chip-avatar{opacity:var(--mdc-chip-with-avatar-disabled-avatar-opacity, 0.38)}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{opacity:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38)}.mdc-evolution-chip--disabled.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{opacity:var(--mdc-chip-with-icon-disabled-icon-opacity, 0.38)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{opacity:var(--mat-chip-disabled-container-opacity, 1)}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-trailing-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-remove{opacity:var(--mat-chip-trailing-action-opacity, 1)}.mat-mdc-chip-remove:focus{opacity:var(--mat-chip-trailing-action-focus-opacity, 1)}.mat-mdc-chip-remove::after{background-color:var(--mat-chip-trailing-action-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-remove:hover::after{opacity:var(--mat-chip-trailing-action-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-remove:focus::after{opacity:var(--mat-chip-trailing-action-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected .mat-mdc-chip-remove::after,.mat-mdc-chip-highlighted .mat-mdc-chip-remove::after{background-color:var(--mat-chip-selected-trailing-action-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-standard-chip .mdc-evolution-chip__cell--primary,.mat-mdc-standard-chip .mdc-evolution-chip__action--primary,.mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:visible}.mat-mdc-standard-chip .mat-mdc-chip-graphic,.mat-mdc-standard-chip .mat-mdc-chip-trailing-icon{box-sizing:content-box}.mat-mdc-standard-chip._mat-animation-noopable,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__graphic,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark-path{transition-duration:1ms;animation-duration:1ms}.mat-mdc-chip-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;opacity:0;border-radius:inherit;transition:opacity 150ms linear}._mat-animation-noopable .mat-mdc-chip-focus-overlay{transition:none}.mat-mdc-basic-chip .mat-mdc-chip-focus-overlay{display:none}.mat-mdc-chip .mat-ripple.mat-mdc-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-chip-avatar{text-align:center;line-height:1;color:var(--mdc-chip-with-icon-icon-color, currentColor)}.mat-mdc-chip{position:relative;z-index:0}.mat-mdc-chip-action-label{text-align:left;z-index:1}[dir=rtl] .mat-mdc-chip-action-label{text-align:right}.mat-mdc-chip.mdc-evolution-chip--with-trailing-action .mat-mdc-chip-action-label{position:relative}.mat-mdc-chip-action-label .mat-mdc-chip-primary-focus-indicator{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}.mat-mdc-chip-action-label .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-chip-remove::before{margin:calc(var(--mat-focus-indicator-border-width, 3px)*-1);left:8px;right:8px}.mat-mdc-chip-remove::after{content:\"\";display:block;opacity:0;position:absolute;top:-3px;bottom:-3px;left:5px;right:5px;border-radius:50%;box-sizing:border-box;padding:12px;margin:-12px;background-clip:content-box}.mat-mdc-chip-remove .mat-icon{width:18px;height:18px;font-size:18px;box-sizing:content-box}.mat-chip-edit-input{cursor:text;display:inline-block;color:inherit;outline:0}@media(forced-colors: active){.mat-mdc-chip-selected:not(.mat-mdc-chip-multiple){outline-width:3px}}.mat-mdc-chip-action:focus .mat-focus-indicator::before{content:\"\"}.mdc-evolution-chip__icon,.mat-mdc-chip-remove .mat-icon{min-height:fit-content}\n"], dependencies: [{ kind: "directive", type: MatChipAction, selector: "[matChipAction]", inputs: ["isInteractive", "disabled", "tabIndex", "_allowFocusWhenDisabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  692. }
  693. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipOption, decorators: [{
  694. type: Component,
  695. args: [{ selector: 'mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]', host: {
  696. 'class': 'mat-mdc-chip mat-mdc-chip-option',
  697. '[class.mdc-evolution-chip]': '!_isBasicChip',
  698. '[class.mdc-evolution-chip--filter]': '!_isBasicChip',
  699. '[class.mdc-evolution-chip--selectable]': '!_isBasicChip',
  700. '[class.mat-mdc-chip-selected]': 'selected',
  701. '[class.mat-mdc-chip-multiple]': '_chipListMultiple',
  702. '[class.mat-mdc-chip-disabled]': 'disabled',
  703. '[class.mat-mdc-chip-with-avatar]': 'leadingIcon',
  704. '[class.mdc-evolution-chip--disabled]': 'disabled',
  705. '[class.mdc-evolution-chip--selected]': 'selected',
  706. // This class enables the transition on the checkmark. Usually MDC adds it when selection
  707. // starts and removes it once the animation is finished. We don't need to go through all
  708. // the trouble, because we only care about the selection animation. MDC needs to do it,
  709. // because they also have an exit animation that we don't care about.
  710. '[class.mdc-evolution-chip--selecting]': '!_animationsDisabled',
  711. '[class.mdc-evolution-chip--with-trailing-action]': '_hasTrailingIcon()',
  712. '[class.mdc-evolution-chip--with-primary-icon]': 'leadingIcon',
  713. '[class.mdc-evolution-chip--with-primary-graphic]': '_hasLeadingGraphic()',
  714. '[class.mdc-evolution-chip--with-avatar]': 'leadingIcon',
  715. '[class.mat-mdc-chip-highlighted]': 'highlighted',
  716. '[class.mat-mdc-chip-with-trailing-icon]': '_hasTrailingIcon()',
  717. '[attr.tabindex]': 'null',
  718. '[attr.aria-label]': 'null',
  719. '[attr.aria-description]': 'null',
  720. '[attr.role]': 'role',
  721. '[id]': 'id',
  722. }, providers: [
  723. { provide: MatChip, useExisting: MatChipOption },
  724. { provide: MAT_CHIP, useExisting: MatChipOption },
  725. ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatChipAction], template: "<span class=\"mat-mdc-chip-focus-overlay\"></span>\n\n<span class=\"mdc-evolution-chip__cell mdc-evolution-chip__cell--primary\">\n <button\n matChipAction\n [_allowFocusWhenDisabled]=\"true\"\n [attr.aria-selected]=\"ariaSelected\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-describedby]=\"_ariaDescriptionId\"\n role=\"option\">\n @if (_hasLeadingGraphic()) {\n <span class=\"mdc-evolution-chip__graphic mat-mdc-chip-graphic\">\n <ng-content select=\"mat-chip-avatar, [matChipAvatar]\"></ng-content>\n <span class=\"mdc-evolution-chip__checkmark\">\n <svg\n class=\"mdc-evolution-chip__checkmark-svg\"\n viewBox=\"-2 -3 30 30\"\n focusable=\"false\"\n aria-hidden=\"true\">\n <path class=\"mdc-evolution-chip__checkmark-path\"\n fill=\"none\" stroke=\"currentColor\" d=\"M1.73,12.91 8.1,19.28 22.79,4.59\" />\n </svg>\n </span>\n </span>\n }\n <span class=\"mdc-evolution-chip__text-label mat-mdc-chip-action-label\">\n <ng-content></ng-content>\n <span class=\"mat-mdc-chip-primary-focus-indicator mat-focus-indicator\"></span>\n </span>\n </button>\n</span>\n\n@if (_hasTrailingIcon()) {\n <span class=\"mdc-evolution-chip__cell mdc-evolution-chip__cell--trailing\">\n <ng-content select=\"mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]\"></ng-content>\n </span>\n}\n\n<span class=\"cdk-visually-hidden\" [id]=\"_ariaDescriptionId\">{{ariaDescription}}</span>\n", styles: [".mdc-evolution-chip,.mdc-evolution-chip__cell,.mdc-evolution-chip__action{display:inline-flex;align-items:center}.mdc-evolution-chip{position:relative;max-width:100%}.mdc-evolution-chip__cell,.mdc-evolution-chip__action{height:100%}.mdc-evolution-chip__cell--primary{flex-basis:100%;overflow-x:hidden}.mdc-evolution-chip__cell--trailing{flex:1 0 auto}.mdc-evolution-chip__action{align-items:center;background:none;border:none;box-sizing:content-box;cursor:pointer;display:inline-flex;justify-content:center;outline:none;padding:0;text-decoration:none;color:inherit}.mdc-evolution-chip__action--presentational{cursor:auto}.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{pointer-events:none}@media(forced-colors: active){.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{forced-color-adjust:none}}.mdc-evolution-chip__action--primary{font:inherit;letter-spacing:inherit;white-space:inherit;overflow-x:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-outline-width, 1px);border-radius:var(--mdc-chip-container-shape-radius, 8px);box-sizing:border-box;content:\"\";height:100%;left:0;position:absolute;pointer-events:none;top:0;width:100%;z-index:1;border-style:solid}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-outline-color, var(--mat-sys-outline))}.mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus::before{border-color:var(--mdc-chip-focus-outline-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-basic-chip .mdc-evolution-chip__action--primary{font:inherit}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip__action--trailing{position:relative;overflow:visible}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip__text-label{-webkit-user-select:none;user-select:none;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__text-label{font-family:var(--mdc-chip-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mdc-chip-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mdc-chip-label-text-size, var(--mat-sys-label-large-size));font-weight:var(--mdc-chip-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mdc-chip-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-label-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label,.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label{color:var(--mdc-chip-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-evolution-chip__graphic{align-items:center;display:inline-flex;justify-content:center;overflow:hidden;pointer-events:none;position:relative;flex:1 0 auto}.mat-mdc-standard-chip .mdc-evolution-chip__graphic{width:var(--mdc-chip-with-avatar-avatar-size, 24px);height:var(--mdc-chip-with-avatar-avatar-size, 24px);font-size:var(--mdc-chip-with-avatar-avatar-size, 24px)}.mdc-evolution-chip--selecting .mdc-evolution-chip__graphic{transition:width 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selectable:not(.mdc-evolution-chip--selected):not(.mdc-evolution-chip--with-primary-icon) .mdc-evolution-chip__graphic{width:0}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mdc-evolution-chip__checkmark{position:absolute;opacity:0;top:50%;left:50%;height:20px;width:20px}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark{transition:transform 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1);transform:translate(-75%, -50%)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{transform:translate(-50%, -50%);opacity:1}.mdc-evolution-chip__checkmark-svg{display:block}.mdc-evolution-chip__checkmark-path{stroke-width:2px;stroke-dasharray:29.7833385;stroke-dashoffset:29.7833385;stroke:currentColor}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark-path{transition:stroke-dashoffset 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark-path{stroke-dashoffset:0}@media(forced-colors: active){.mdc-evolution-chip__checkmark-path{stroke:CanvasText !important}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--trailing{height:18px;width:18px;font-size:18px}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove{opacity:calc(var(--mat-chip-trailing-action-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove:focus{opacity:calc(var(--mat-chip-trailing-action-focus-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mat-mdc-standard-chip{border-radius:var(--mdc-chip-container-shape-radius, 8px);height:var(--mdc-chip-container-height, 32px)}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-container-color, transparent)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-elevated-disabled-container-color)}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-flat-disabled-selected-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}@media(forced-colors: active){.mat-mdc-standard-chip{outline:solid 1px}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--primary{border-radius:var(--mdc-chip-with-avatar-avatar-shape-radius, 24px);width:var(--mdc-chip-with-icon-icon-size, 18px);height:var(--mdc-chip-with-icon-icon-size, 18px);font-size:var(--mdc-chip-with-icon-icon-size, 18px)}.mdc-evolution-chip--selected .mdc-evolution-chip__icon--primary{opacity:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-highlighted{--mdc-chip-with-icon-icon-color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container));--mdc-chip-elevated-container-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container));--mdc-chip-label-text-color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container));--mdc-chip-outline-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-selected .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-chip:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-hover-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-focus-overlay .mat-mdc-chip-selected:hover,.mat-mdc-chip-highlighted:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-hover-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected.cdk-focused .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-evolution-chip--disabled:not(.mdc-evolution-chip--selected) .mat-mdc-chip-avatar{opacity:var(--mdc-chip-with-avatar-disabled-avatar-opacity, 0.38)}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{opacity:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38)}.mdc-evolution-chip--disabled.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{opacity:var(--mdc-chip-with-icon-disabled-icon-opacity, 0.38)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{opacity:var(--mat-chip-disabled-container-opacity, 1)}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-trailing-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-remove{opacity:var(--mat-chip-trailing-action-opacity, 1)}.mat-mdc-chip-remove:focus{opacity:var(--mat-chip-trailing-action-focus-opacity, 1)}.mat-mdc-chip-remove::after{background-color:var(--mat-chip-trailing-action-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-remove:hover::after{opacity:var(--mat-chip-trailing-action-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-remove:focus::after{opacity:var(--mat-chip-trailing-action-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected .mat-mdc-chip-remove::after,.mat-mdc-chip-highlighted .mat-mdc-chip-remove::after{background-color:var(--mat-chip-selected-trailing-action-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-standard-chip .mdc-evolution-chip__cell--primary,.mat-mdc-standard-chip .mdc-evolution-chip__action--primary,.mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:visible}.mat-mdc-standard-chip .mat-mdc-chip-graphic,.mat-mdc-standard-chip .mat-mdc-chip-trailing-icon{box-sizing:content-box}.mat-mdc-standard-chip._mat-animation-noopable,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__graphic,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark-path{transition-duration:1ms;animation-duration:1ms}.mat-mdc-chip-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;opacity:0;border-radius:inherit;transition:opacity 150ms linear}._mat-animation-noopable .mat-mdc-chip-focus-overlay{transition:none}.mat-mdc-basic-chip .mat-mdc-chip-focus-overlay{display:none}.mat-mdc-chip .mat-ripple.mat-mdc-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-chip-avatar{text-align:center;line-height:1;color:var(--mdc-chip-with-icon-icon-color, currentColor)}.mat-mdc-chip{position:relative;z-index:0}.mat-mdc-chip-action-label{text-align:left;z-index:1}[dir=rtl] .mat-mdc-chip-action-label{text-align:right}.mat-mdc-chip.mdc-evolution-chip--with-trailing-action .mat-mdc-chip-action-label{position:relative}.mat-mdc-chip-action-label .mat-mdc-chip-primary-focus-indicator{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}.mat-mdc-chip-action-label .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-chip-remove::before{margin:calc(var(--mat-focus-indicator-border-width, 3px)*-1);left:8px;right:8px}.mat-mdc-chip-remove::after{content:\"\";display:block;opacity:0;position:absolute;top:-3px;bottom:-3px;left:5px;right:5px;border-radius:50%;box-sizing:border-box;padding:12px;margin:-12px;background-clip:content-box}.mat-mdc-chip-remove .mat-icon{width:18px;height:18px;font-size:18px;box-sizing:content-box}.mat-chip-edit-input{cursor:text;display:inline-block;color:inherit;outline:0}@media(forced-colors: active){.mat-mdc-chip-selected:not(.mat-mdc-chip-multiple){outline-width:3px}}.mat-mdc-chip-action:focus .mat-focus-indicator::before{content:\"\"}.mdc-evolution-chip__icon,.mat-mdc-chip-remove .mat-icon{min-height:fit-content}\n"] }]
  726. }], propDecorators: { selectable: [{
  727. type: Input,
  728. args: [{ transform: booleanAttribute }]
  729. }], selected: [{
  730. type: Input,
  731. args: [{ transform: booleanAttribute }]
  732. }], selectionChange: [{
  733. type: Output
  734. }] } });
  735. /**
  736. * A directive that makes a span editable and exposes functions to modify and retrieve the
  737. * element's contents.
  738. */
  739. class MatChipEditInput {
  740. _elementRef = inject(ElementRef);
  741. _document = inject(DOCUMENT);
  742. constructor() { }
  743. initialize(initialValue) {
  744. this.getNativeElement().focus();
  745. this.setValue(initialValue);
  746. }
  747. getNativeElement() {
  748. return this._elementRef.nativeElement;
  749. }
  750. setValue(value) {
  751. this.getNativeElement().textContent = value;
  752. this._moveCursorToEndOfInput();
  753. }
  754. getValue() {
  755. return this.getNativeElement().textContent || '';
  756. }
  757. _moveCursorToEndOfInput() {
  758. const range = this._document.createRange();
  759. range.selectNodeContents(this.getNativeElement());
  760. range.collapse(false);
  761. const sel = window.getSelection();
  762. sel.removeAllRanges();
  763. sel.addRange(range);
  764. }
  765. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipEditInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
  766. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: MatChipEditInput, isStandalone: true, selector: "span[matChipEditInput]", host: { attributes: { "role": "textbox", "tabindex": "-1", "contenteditable": "true" }, classAttribute: "mat-chip-edit-input" }, ngImport: i0 });
  767. }
  768. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipEditInput, decorators: [{
  769. type: Directive,
  770. args: [{
  771. selector: 'span[matChipEditInput]',
  772. host: {
  773. 'class': 'mat-chip-edit-input',
  774. 'role': 'textbox',
  775. 'tabindex': '-1',
  776. 'contenteditable': 'true',
  777. },
  778. }]
  779. }], ctorParameters: () => [] });
  780. /**
  781. * An extension of the MatChip component used with MatChipGrid and
  782. * the matChipInputFor directive.
  783. */
  784. class MatChipRow extends MatChip {
  785. basicChipAttrName = 'mat-basic-chip-row';
  786. /**
  787. * The editing action has to be triggered in a timeout. While we're waiting on it, a blur
  788. * event might occur which will interrupt the editing. This flag is used to avoid interruptions
  789. * while the editing action is being initialized.
  790. */
  791. _editStartPending = false;
  792. editable = false;
  793. /** Emitted when the chip is edited. */
  794. edited = new EventEmitter();
  795. /** The default chip edit input that is used if none is projected into this chip row. */
  796. defaultEditInput;
  797. /** The projected chip edit input. */
  798. contentEditInput;
  799. _isEditing = false;
  800. constructor() {
  801. super();
  802. this.role = 'row';
  803. this._onBlur.pipe(takeUntil(this.destroyed)).subscribe(() => {
  804. if (this._isEditing && !this._editStartPending) {
  805. this._onEditFinish();
  806. }
  807. });
  808. }
  809. _hasTrailingIcon() {
  810. // The trailing icon is hidden while editing.
  811. return !this._isEditing && super._hasTrailingIcon();
  812. }
  813. /** Sends focus to the first gridcell when the user clicks anywhere inside the chip. */
  814. _handleFocus() {
  815. if (!this._isEditing && !this.disabled) {
  816. this.focus();
  817. }
  818. }
  819. _handleKeydown(event) {
  820. if (event.keyCode === ENTER && !this.disabled) {
  821. if (this._isEditing) {
  822. event.preventDefault();
  823. this._onEditFinish();
  824. }
  825. else if (this.editable) {
  826. this._startEditing(event);
  827. }
  828. }
  829. else if (this._isEditing) {
  830. // Stop the event from reaching the chip set in order to avoid navigating.
  831. event.stopPropagation();
  832. }
  833. else {
  834. super._handleKeydown(event);
  835. }
  836. }
  837. _handleDoubleclick(event) {
  838. if (!this.disabled && this.editable) {
  839. this._startEditing(event);
  840. }
  841. }
  842. _startEditing(event) {
  843. if (!this.primaryAction ||
  844. (this.removeIcon && this._getSourceAction(event.target) === this.removeIcon)) {
  845. return;
  846. }
  847. // The value depends on the DOM so we need to extract it before we flip the flag.
  848. const value = this.value;
  849. this._isEditing = this._editStartPending = true;
  850. // Defer initializing the input until after it has been added to the DOM.
  851. afterNextRender(() => {
  852. this._getEditInput().initialize(value);
  853. this._editStartPending = false;
  854. }, { injector: this._injector });
  855. }
  856. _onEditFinish() {
  857. this._isEditing = this._editStartPending = false;
  858. this.edited.emit({ chip: this, value: this._getEditInput().getValue() });
  859. // If the edit input is still focused or focus was returned to the body after it was destroyed,
  860. // return focus to the chip contents.
  861. if (this._document.activeElement === this._getEditInput().getNativeElement() ||
  862. this._document.activeElement === this._document.body) {
  863. this.primaryAction.focus();
  864. }
  865. }
  866. _isRippleDisabled() {
  867. return super._isRippleDisabled() || this._isEditing;
  868. }
  869. /**
  870. * Gets the projected chip edit input, or the default input if none is projected in. One of these
  871. * two values is guaranteed to be defined.
  872. */
  873. _getEditInput() {
  874. return this.contentEditInput || this.defaultEditInput;
  875. }
  876. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipRow, deps: [], target: i0.ɵɵFactoryTarget.Component });
  877. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: MatChipRow, isStandalone: true, selector: "mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]", inputs: { editable: "editable" }, outputs: { edited: "edited" }, host: { listeners: { "focus": "_handleFocus()", "dblclick": "_handleDoubleclick($event)" }, properties: { "class.mat-mdc-chip-with-avatar": "leadingIcon", "class.mat-mdc-chip-disabled": "disabled", "class.mat-mdc-chip-editing": "_isEditing", "class.mat-mdc-chip-editable": "editable", "class.mdc-evolution-chip--disabled": "disabled", "class.mdc-evolution-chip--with-trailing-action": "_hasTrailingIcon()", "class.mdc-evolution-chip--with-primary-graphic": "leadingIcon", "class.mdc-evolution-chip--with-primary-icon": "leadingIcon", "class.mdc-evolution-chip--with-avatar": "leadingIcon", "class.mat-mdc-chip-highlighted": "highlighted", "class.mat-mdc-chip-with-trailing-icon": "_hasTrailingIcon()", "id": "id", "attr.tabindex": "disabled ? null : -1", "attr.aria-label": "null", "attr.aria-description": "null", "attr.role": "role" }, classAttribute: "mat-mdc-chip mat-mdc-chip-row mdc-evolution-chip" }, providers: [
  878. { provide: MatChip, useExisting: MatChipRow },
  879. { provide: MAT_CHIP, useExisting: MatChipRow },
  880. ], queries: [{ propertyName: "contentEditInput", first: true, predicate: MatChipEditInput, descendants: true }], viewQueries: [{ propertyName: "defaultEditInput", first: true, predicate: MatChipEditInput, descendants: true }], usesInheritance: true, ngImport: i0, template: "@if (!_isEditing) {\n <span class=\"mat-mdc-chip-focus-overlay\"></span>\n}\n\n<span class=\"mdc-evolution-chip__cell mdc-evolution-chip__cell--primary\" role=\"gridcell\"\n matChipAction\n [disabled]=\"disabled\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-describedby]=\"_ariaDescriptionId\">\n @if (leadingIcon) {\n <span class=\"mdc-evolution-chip__graphic mat-mdc-chip-graphic\">\n <ng-content select=\"mat-chip-avatar, [matChipAvatar]\"></ng-content>\n </span>\n }\n\n <span class=\"mdc-evolution-chip__text-label mat-mdc-chip-action-label\">\n @if (_isEditing) {\n @if (contentEditInput) {\n <ng-content select=\"[matChipEditInput]\"></ng-content>\n } @else {\n <span matChipEditInput></span>\n }\n } @else {\n <ng-content></ng-content>\n }\n\n <span class=\"mat-mdc-chip-primary-focus-indicator mat-focus-indicator\" aria-hidden=\"true\"></span>\n </span>\n</span>\n\n@if (_hasTrailingIcon()) {\n <span\n class=\"mdc-evolution-chip__cell mdc-evolution-chip__cell--trailing\"\n role=\"gridcell\">\n <ng-content select=\"mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]\"></ng-content>\n </span>\n}\n\n<span class=\"cdk-visually-hidden\" [id]=\"_ariaDescriptionId\">{{ariaDescription}}</span>\n", styles: [".mdc-evolution-chip,.mdc-evolution-chip__cell,.mdc-evolution-chip__action{display:inline-flex;align-items:center}.mdc-evolution-chip{position:relative;max-width:100%}.mdc-evolution-chip__cell,.mdc-evolution-chip__action{height:100%}.mdc-evolution-chip__cell--primary{flex-basis:100%;overflow-x:hidden}.mdc-evolution-chip__cell--trailing{flex:1 0 auto}.mdc-evolution-chip__action{align-items:center;background:none;border:none;box-sizing:content-box;cursor:pointer;display:inline-flex;justify-content:center;outline:none;padding:0;text-decoration:none;color:inherit}.mdc-evolution-chip__action--presentational{cursor:auto}.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{pointer-events:none}@media(forced-colors: active){.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{forced-color-adjust:none}}.mdc-evolution-chip__action--primary{font:inherit;letter-spacing:inherit;white-space:inherit;overflow-x:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-outline-width, 1px);border-radius:var(--mdc-chip-container-shape-radius, 8px);box-sizing:border-box;content:\"\";height:100%;left:0;position:absolute;pointer-events:none;top:0;width:100%;z-index:1;border-style:solid}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-outline-color, var(--mat-sys-outline))}.mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus::before{border-color:var(--mdc-chip-focus-outline-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-basic-chip .mdc-evolution-chip__action--primary{font:inherit}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip__action--trailing{position:relative;overflow:visible}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip__text-label{-webkit-user-select:none;user-select:none;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__text-label{font-family:var(--mdc-chip-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mdc-chip-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mdc-chip-label-text-size, var(--mat-sys-label-large-size));font-weight:var(--mdc-chip-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mdc-chip-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-label-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label,.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label{color:var(--mdc-chip-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-evolution-chip__graphic{align-items:center;display:inline-flex;justify-content:center;overflow:hidden;pointer-events:none;position:relative;flex:1 0 auto}.mat-mdc-standard-chip .mdc-evolution-chip__graphic{width:var(--mdc-chip-with-avatar-avatar-size, 24px);height:var(--mdc-chip-with-avatar-avatar-size, 24px);font-size:var(--mdc-chip-with-avatar-avatar-size, 24px)}.mdc-evolution-chip--selecting .mdc-evolution-chip__graphic{transition:width 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selectable:not(.mdc-evolution-chip--selected):not(.mdc-evolution-chip--with-primary-icon) .mdc-evolution-chip__graphic{width:0}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mdc-evolution-chip__checkmark{position:absolute;opacity:0;top:50%;left:50%;height:20px;width:20px}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark{transition:transform 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1);transform:translate(-75%, -50%)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{transform:translate(-50%, -50%);opacity:1}.mdc-evolution-chip__checkmark-svg{display:block}.mdc-evolution-chip__checkmark-path{stroke-width:2px;stroke-dasharray:29.7833385;stroke-dashoffset:29.7833385;stroke:currentColor}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark-path{transition:stroke-dashoffset 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark-path{stroke-dashoffset:0}@media(forced-colors: active){.mdc-evolution-chip__checkmark-path{stroke:CanvasText !important}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--trailing{height:18px;width:18px;font-size:18px}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove{opacity:calc(var(--mat-chip-trailing-action-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove:focus{opacity:calc(var(--mat-chip-trailing-action-focus-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mat-mdc-standard-chip{border-radius:var(--mdc-chip-container-shape-radius, 8px);height:var(--mdc-chip-container-height, 32px)}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-container-color, transparent)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-elevated-disabled-container-color)}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-flat-disabled-selected-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}@media(forced-colors: active){.mat-mdc-standard-chip{outline:solid 1px}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--primary{border-radius:var(--mdc-chip-with-avatar-avatar-shape-radius, 24px);width:var(--mdc-chip-with-icon-icon-size, 18px);height:var(--mdc-chip-with-icon-icon-size, 18px);font-size:var(--mdc-chip-with-icon-icon-size, 18px)}.mdc-evolution-chip--selected .mdc-evolution-chip__icon--primary{opacity:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-highlighted{--mdc-chip-with-icon-icon-color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container));--mdc-chip-elevated-container-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container));--mdc-chip-label-text-color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container));--mdc-chip-outline-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-selected .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-chip:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-hover-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-focus-overlay .mat-mdc-chip-selected:hover,.mat-mdc-chip-highlighted:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-hover-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected.cdk-focused .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-evolution-chip--disabled:not(.mdc-evolution-chip--selected) .mat-mdc-chip-avatar{opacity:var(--mdc-chip-with-avatar-disabled-avatar-opacity, 0.38)}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{opacity:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38)}.mdc-evolution-chip--disabled.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{opacity:var(--mdc-chip-with-icon-disabled-icon-opacity, 0.38)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{opacity:var(--mat-chip-disabled-container-opacity, 1)}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-trailing-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-remove{opacity:var(--mat-chip-trailing-action-opacity, 1)}.mat-mdc-chip-remove:focus{opacity:var(--mat-chip-trailing-action-focus-opacity, 1)}.mat-mdc-chip-remove::after{background-color:var(--mat-chip-trailing-action-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-remove:hover::after{opacity:var(--mat-chip-trailing-action-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-remove:focus::after{opacity:var(--mat-chip-trailing-action-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected .mat-mdc-chip-remove::after,.mat-mdc-chip-highlighted .mat-mdc-chip-remove::after{background-color:var(--mat-chip-selected-trailing-action-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-standard-chip .mdc-evolution-chip__cell--primary,.mat-mdc-standard-chip .mdc-evolution-chip__action--primary,.mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:visible}.mat-mdc-standard-chip .mat-mdc-chip-graphic,.mat-mdc-standard-chip .mat-mdc-chip-trailing-icon{box-sizing:content-box}.mat-mdc-standard-chip._mat-animation-noopable,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__graphic,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark-path{transition-duration:1ms;animation-duration:1ms}.mat-mdc-chip-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;opacity:0;border-radius:inherit;transition:opacity 150ms linear}._mat-animation-noopable .mat-mdc-chip-focus-overlay{transition:none}.mat-mdc-basic-chip .mat-mdc-chip-focus-overlay{display:none}.mat-mdc-chip .mat-ripple.mat-mdc-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-chip-avatar{text-align:center;line-height:1;color:var(--mdc-chip-with-icon-icon-color, currentColor)}.mat-mdc-chip{position:relative;z-index:0}.mat-mdc-chip-action-label{text-align:left;z-index:1}[dir=rtl] .mat-mdc-chip-action-label{text-align:right}.mat-mdc-chip.mdc-evolution-chip--with-trailing-action .mat-mdc-chip-action-label{position:relative}.mat-mdc-chip-action-label .mat-mdc-chip-primary-focus-indicator{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}.mat-mdc-chip-action-label .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-chip-remove::before{margin:calc(var(--mat-focus-indicator-border-width, 3px)*-1);left:8px;right:8px}.mat-mdc-chip-remove::after{content:\"\";display:block;opacity:0;position:absolute;top:-3px;bottom:-3px;left:5px;right:5px;border-radius:50%;box-sizing:border-box;padding:12px;margin:-12px;background-clip:content-box}.mat-mdc-chip-remove .mat-icon{width:18px;height:18px;font-size:18px;box-sizing:content-box}.mat-chip-edit-input{cursor:text;display:inline-block;color:inherit;outline:0}@media(forced-colors: active){.mat-mdc-chip-selected:not(.mat-mdc-chip-multiple){outline-width:3px}}.mat-mdc-chip-action:focus .mat-focus-indicator::before{content:\"\"}.mdc-evolution-chip__icon,.mat-mdc-chip-remove .mat-icon{min-height:fit-content}\n"], dependencies: [{ kind: "directive", type: MatChipAction, selector: "[matChipAction]", inputs: ["isInteractive", "disabled", "tabIndex", "_allowFocusWhenDisabled"] }, { kind: "directive", type: MatChipEditInput, selector: "span[matChipEditInput]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  881. }
  882. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipRow, decorators: [{
  883. type: Component,
  884. args: [{ selector: 'mat-chip-row, [mat-chip-row], mat-basic-chip-row, [mat-basic-chip-row]', host: {
  885. 'class': 'mat-mdc-chip mat-mdc-chip-row mdc-evolution-chip',
  886. '[class.mat-mdc-chip-with-avatar]': 'leadingIcon',
  887. '[class.mat-mdc-chip-disabled]': 'disabled',
  888. '[class.mat-mdc-chip-editing]': '_isEditing',
  889. '[class.mat-mdc-chip-editable]': 'editable',
  890. '[class.mdc-evolution-chip--disabled]': 'disabled',
  891. '[class.mdc-evolution-chip--with-trailing-action]': '_hasTrailingIcon()',
  892. '[class.mdc-evolution-chip--with-primary-graphic]': 'leadingIcon',
  893. '[class.mdc-evolution-chip--with-primary-icon]': 'leadingIcon',
  894. '[class.mdc-evolution-chip--with-avatar]': 'leadingIcon',
  895. '[class.mat-mdc-chip-highlighted]': 'highlighted',
  896. '[class.mat-mdc-chip-with-trailing-icon]': '_hasTrailingIcon()',
  897. '[id]': 'id',
  898. // Has to have a negative tabindex in order to capture
  899. // focus and redirect it to the primary action.
  900. '[attr.tabindex]': 'disabled ? null : -1',
  901. '[attr.aria-label]': 'null',
  902. '[attr.aria-description]': 'null',
  903. '[attr.role]': 'role',
  904. '(focus)': '_handleFocus()',
  905. '(dblclick)': '_handleDoubleclick($event)',
  906. }, providers: [
  907. { provide: MatChip, useExisting: MatChipRow },
  908. { provide: MAT_CHIP, useExisting: MatChipRow },
  909. ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatChipAction, MatChipEditInput], template: "@if (!_isEditing) {\n <span class=\"mat-mdc-chip-focus-overlay\"></span>\n}\n\n<span class=\"mdc-evolution-chip__cell mdc-evolution-chip__cell--primary\" role=\"gridcell\"\n matChipAction\n [disabled]=\"disabled\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-describedby]=\"_ariaDescriptionId\">\n @if (leadingIcon) {\n <span class=\"mdc-evolution-chip__graphic mat-mdc-chip-graphic\">\n <ng-content select=\"mat-chip-avatar, [matChipAvatar]\"></ng-content>\n </span>\n }\n\n <span class=\"mdc-evolution-chip__text-label mat-mdc-chip-action-label\">\n @if (_isEditing) {\n @if (contentEditInput) {\n <ng-content select=\"[matChipEditInput]\"></ng-content>\n } @else {\n <span matChipEditInput></span>\n }\n } @else {\n <ng-content></ng-content>\n }\n\n <span class=\"mat-mdc-chip-primary-focus-indicator mat-focus-indicator\" aria-hidden=\"true\"></span>\n </span>\n</span>\n\n@if (_hasTrailingIcon()) {\n <span\n class=\"mdc-evolution-chip__cell mdc-evolution-chip__cell--trailing\"\n role=\"gridcell\">\n <ng-content select=\"mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]\"></ng-content>\n </span>\n}\n\n<span class=\"cdk-visually-hidden\" [id]=\"_ariaDescriptionId\">{{ariaDescription}}</span>\n", styles: [".mdc-evolution-chip,.mdc-evolution-chip__cell,.mdc-evolution-chip__action{display:inline-flex;align-items:center}.mdc-evolution-chip{position:relative;max-width:100%}.mdc-evolution-chip__cell,.mdc-evolution-chip__action{height:100%}.mdc-evolution-chip__cell--primary{flex-basis:100%;overflow-x:hidden}.mdc-evolution-chip__cell--trailing{flex:1 0 auto}.mdc-evolution-chip__action{align-items:center;background:none;border:none;box-sizing:content-box;cursor:pointer;display:inline-flex;justify-content:center;outline:none;padding:0;text-decoration:none;color:inherit}.mdc-evolution-chip__action--presentational{cursor:auto}.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{pointer-events:none}@media(forced-colors: active){.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{forced-color-adjust:none}}.mdc-evolution-chip__action--primary{font:inherit;letter-spacing:inherit;white-space:inherit;overflow-x:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-outline-width, 1px);border-radius:var(--mdc-chip-container-shape-radius, 8px);box-sizing:border-box;content:\"\";height:100%;left:0;position:absolute;pointer-events:none;top:0;width:100%;z-index:1;border-style:solid}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-outline-color, var(--mat-sys-outline))}.mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus::before{border-color:var(--mdc-chip-focus-outline-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-basic-chip .mdc-evolution-chip__action--primary{font:inherit}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip__action--trailing{position:relative;overflow:visible}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip__text-label{-webkit-user-select:none;user-select:none;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__text-label{font-family:var(--mdc-chip-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mdc-chip-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mdc-chip-label-text-size, var(--mat-sys-label-large-size));font-weight:var(--mdc-chip-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mdc-chip-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-label-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label,.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label{color:var(--mdc-chip-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-evolution-chip__graphic{align-items:center;display:inline-flex;justify-content:center;overflow:hidden;pointer-events:none;position:relative;flex:1 0 auto}.mat-mdc-standard-chip .mdc-evolution-chip__graphic{width:var(--mdc-chip-with-avatar-avatar-size, 24px);height:var(--mdc-chip-with-avatar-avatar-size, 24px);font-size:var(--mdc-chip-with-avatar-avatar-size, 24px)}.mdc-evolution-chip--selecting .mdc-evolution-chip__graphic{transition:width 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selectable:not(.mdc-evolution-chip--selected):not(.mdc-evolution-chip--with-primary-icon) .mdc-evolution-chip__graphic{width:0}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mdc-evolution-chip__checkmark{position:absolute;opacity:0;top:50%;left:50%;height:20px;width:20px}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark{transition:transform 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1);transform:translate(-75%, -50%)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{transform:translate(-50%, -50%);opacity:1}.mdc-evolution-chip__checkmark-svg{display:block}.mdc-evolution-chip__checkmark-path{stroke-width:2px;stroke-dasharray:29.7833385;stroke-dashoffset:29.7833385;stroke:currentColor}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark-path{transition:stroke-dashoffset 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark-path{stroke-dashoffset:0}@media(forced-colors: active){.mdc-evolution-chip__checkmark-path{stroke:CanvasText !important}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--trailing{height:18px;width:18px;font-size:18px}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove{opacity:calc(var(--mat-chip-trailing-action-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove:focus{opacity:calc(var(--mat-chip-trailing-action-focus-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mat-mdc-standard-chip{border-radius:var(--mdc-chip-container-shape-radius, 8px);height:var(--mdc-chip-container-height, 32px)}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-container-color, transparent)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-elevated-disabled-container-color)}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-flat-disabled-selected-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}@media(forced-colors: active){.mat-mdc-standard-chip{outline:solid 1px}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--primary{border-radius:var(--mdc-chip-with-avatar-avatar-shape-radius, 24px);width:var(--mdc-chip-with-icon-icon-size, 18px);height:var(--mdc-chip-with-icon-icon-size, 18px);font-size:var(--mdc-chip-with-icon-icon-size, 18px)}.mdc-evolution-chip--selected .mdc-evolution-chip__icon--primary{opacity:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-highlighted{--mdc-chip-with-icon-icon-color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container));--mdc-chip-elevated-container-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container));--mdc-chip-label-text-color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container));--mdc-chip-outline-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-selected .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-chip:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-hover-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-focus-overlay .mat-mdc-chip-selected:hover,.mat-mdc-chip-highlighted:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-hover-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected.cdk-focused .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-evolution-chip--disabled:not(.mdc-evolution-chip--selected) .mat-mdc-chip-avatar{opacity:var(--mdc-chip-with-avatar-disabled-avatar-opacity, 0.38)}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{opacity:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38)}.mdc-evolution-chip--disabled.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{opacity:var(--mdc-chip-with-icon-disabled-icon-opacity, 0.38)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{opacity:var(--mat-chip-disabled-container-opacity, 1)}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-trailing-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-remove{opacity:var(--mat-chip-trailing-action-opacity, 1)}.mat-mdc-chip-remove:focus{opacity:var(--mat-chip-trailing-action-focus-opacity, 1)}.mat-mdc-chip-remove::after{background-color:var(--mat-chip-trailing-action-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-remove:hover::after{opacity:var(--mat-chip-trailing-action-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-remove:focus::after{opacity:var(--mat-chip-trailing-action-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected .mat-mdc-chip-remove::after,.mat-mdc-chip-highlighted .mat-mdc-chip-remove::after{background-color:var(--mat-chip-selected-trailing-action-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-standard-chip .mdc-evolution-chip__cell--primary,.mat-mdc-standard-chip .mdc-evolution-chip__action--primary,.mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:visible}.mat-mdc-standard-chip .mat-mdc-chip-graphic,.mat-mdc-standard-chip .mat-mdc-chip-trailing-icon{box-sizing:content-box}.mat-mdc-standard-chip._mat-animation-noopable,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__graphic,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark-path{transition-duration:1ms;animation-duration:1ms}.mat-mdc-chip-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;opacity:0;border-radius:inherit;transition:opacity 150ms linear}._mat-animation-noopable .mat-mdc-chip-focus-overlay{transition:none}.mat-mdc-basic-chip .mat-mdc-chip-focus-overlay{display:none}.mat-mdc-chip .mat-ripple.mat-mdc-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-chip-avatar{text-align:center;line-height:1;color:var(--mdc-chip-with-icon-icon-color, currentColor)}.mat-mdc-chip{position:relative;z-index:0}.mat-mdc-chip-action-label{text-align:left;z-index:1}[dir=rtl] .mat-mdc-chip-action-label{text-align:right}.mat-mdc-chip.mdc-evolution-chip--with-trailing-action .mat-mdc-chip-action-label{position:relative}.mat-mdc-chip-action-label .mat-mdc-chip-primary-focus-indicator{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}.mat-mdc-chip-action-label .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-chip-remove::before{margin:calc(var(--mat-focus-indicator-border-width, 3px)*-1);left:8px;right:8px}.mat-mdc-chip-remove::after{content:\"\";display:block;opacity:0;position:absolute;top:-3px;bottom:-3px;left:5px;right:5px;border-radius:50%;box-sizing:border-box;padding:12px;margin:-12px;background-clip:content-box}.mat-mdc-chip-remove .mat-icon{width:18px;height:18px;font-size:18px;box-sizing:content-box}.mat-chip-edit-input{cursor:text;display:inline-block;color:inherit;outline:0}@media(forced-colors: active){.mat-mdc-chip-selected:not(.mat-mdc-chip-multiple){outline-width:3px}}.mat-mdc-chip-action:focus .mat-focus-indicator::before{content:\"\"}.mdc-evolution-chip__icon,.mat-mdc-chip-remove .mat-icon{min-height:fit-content}\n"] }]
  910. }], ctorParameters: () => [], propDecorators: { editable: [{
  911. type: Input
  912. }], edited: [{
  913. type: Output
  914. }], defaultEditInput: [{
  915. type: ViewChild,
  916. args: [MatChipEditInput]
  917. }], contentEditInput: [{
  918. type: ContentChild,
  919. args: [MatChipEditInput]
  920. }] } });
  921. /**
  922. * Basic container component for the MatChip component.
  923. *
  924. * Extended by MatChipListbox and MatChipGrid for different interaction patterns.
  925. */
  926. class MatChipSet {
  927. _elementRef = inject(ElementRef);
  928. _changeDetectorRef = inject(ChangeDetectorRef);
  929. _dir = inject(Directionality, { optional: true });
  930. /** Index of the last destroyed chip that had focus. */
  931. _lastDestroyedFocusedChipIndex = null;
  932. /** Used to manage focus within the chip list. */
  933. _keyManager;
  934. /** Subject that emits when the component has been destroyed. */
  935. _destroyed = new Subject();
  936. /** Role to use if it hasn't been overwritten by the user. */
  937. _defaultRole = 'presentation';
  938. /** Combined stream of all of the child chips' focus events. */
  939. get chipFocusChanges() {
  940. return this._getChipStream(chip => chip._onFocus);
  941. }
  942. /** Combined stream of all of the child chips' destroy events. */
  943. get chipDestroyedChanges() {
  944. return this._getChipStream(chip => chip.destroyed);
  945. }
  946. /** Combined stream of all of the child chips' remove events. */
  947. get chipRemovedChanges() {
  948. return this._getChipStream(chip => chip.removed);
  949. }
  950. /** Whether the chip set is disabled. */
  951. get disabled() {
  952. return this._disabled;
  953. }
  954. set disabled(value) {
  955. this._disabled = value;
  956. this._syncChipsState();
  957. }
  958. _disabled = false;
  959. /** Whether the chip list contains chips or not. */
  960. get empty() {
  961. return !this._chips || this._chips.length === 0;
  962. }
  963. /** The ARIA role applied to the chip set. */
  964. get role() {
  965. if (this._explicitRole) {
  966. return this._explicitRole;
  967. }
  968. return this.empty ? null : this._defaultRole;
  969. }
  970. /** Tabindex of the chip set. */
  971. tabIndex = 0;
  972. set role(value) {
  973. this._explicitRole = value;
  974. }
  975. _explicitRole = null;
  976. /** Whether any of the chips inside of this chip-set has focus. */
  977. get focused() {
  978. return this._hasFocusedChip();
  979. }
  980. /** The chips that are part of this chip set. */
  981. _chips;
  982. /** Flat list of all the actions contained within the chips. */
  983. _chipActions = new QueryList();
  984. constructor() { }
  985. ngAfterViewInit() {
  986. this._setUpFocusManagement();
  987. this._trackChipSetChanges();
  988. this._trackDestroyedFocusedChip();
  989. }
  990. ngOnDestroy() {
  991. this._keyManager?.destroy();
  992. this._chipActions.destroy();
  993. this._destroyed.next();
  994. this._destroyed.complete();
  995. }
  996. /** Checks whether any of the chips is focused. */
  997. _hasFocusedChip() {
  998. return this._chips && this._chips.some(chip => chip._hasFocus());
  999. }
  1000. /** Syncs the chip-set's state with the individual chips. */
  1001. _syncChipsState() {
  1002. this._chips?.forEach(chip => {
  1003. chip._chipListDisabled = this._disabled;
  1004. chip._changeDetectorRef.markForCheck();
  1005. });
  1006. }
  1007. /** Dummy method for subclasses to override. Base chip set cannot be focused. */
  1008. focus() { }
  1009. /** Handles keyboard events on the chip set. */
  1010. _handleKeydown(event) {
  1011. if (this._originatesFromChip(event)) {
  1012. this._keyManager.onKeydown(event);
  1013. }
  1014. }
  1015. /**
  1016. * Utility to ensure all indexes are valid.
  1017. *
  1018. * @param index The index to be checked.
  1019. * @returns True if the index is valid for our list of chips.
  1020. */
  1021. _isValidIndex(index) {
  1022. return index >= 0 && index < this._chips.length;
  1023. }
  1024. /**
  1025. * Removes the `tabindex` from the chip set and resets it back afterwards, allowing the
  1026. * user to tab out of it. This prevents the set from capturing focus and redirecting
  1027. * it back to the first chip, creating a focus trap, if it user tries to tab away.
  1028. */
  1029. _allowFocusEscape() {
  1030. const previous = this._elementRef.nativeElement.tabIndex;
  1031. if (previous !== -1) {
  1032. // Set the tabindex directly on the element, instead of going through
  1033. // the data binding, because we aren't guaranteed that change detection
  1034. // will run quickly enough to allow focus to escape.
  1035. this._elementRef.nativeElement.tabIndex = -1;
  1036. // Note that this needs to be a `setTimeout`, because a `Promise.resolve`
  1037. // doesn't allow enough time for the focus to escape.
  1038. setTimeout(() => (this._elementRef.nativeElement.tabIndex = previous));
  1039. }
  1040. }
  1041. /**
  1042. * Gets a stream of events from all the chips within the set.
  1043. * The stream will automatically incorporate any newly-added chips.
  1044. */
  1045. _getChipStream(mappingFunction) {
  1046. return this._chips.changes.pipe(startWith(null), switchMap(() => merge(...this._chips.map(mappingFunction))));
  1047. }
  1048. /** Checks whether an event comes from inside a chip element. */
  1049. _originatesFromChip(event) {
  1050. let currentElement = event.target;
  1051. while (currentElement && currentElement !== this._elementRef.nativeElement) {
  1052. if (currentElement.classList.contains('mat-mdc-chip')) {
  1053. return true;
  1054. }
  1055. currentElement = currentElement.parentElement;
  1056. }
  1057. return false;
  1058. }
  1059. /** Sets up the chip set's focus management logic. */
  1060. _setUpFocusManagement() {
  1061. // Create a flat `QueryList` containing the actions of all of the chips.
  1062. // This allows us to navigate both within the chip and move to the next/previous
  1063. // one using the existing `ListKeyManager`.
  1064. this._chips.changes.pipe(startWith(this._chips)).subscribe((chips) => {
  1065. const actions = [];
  1066. chips.forEach(chip => chip._getActions().forEach(action => actions.push(action)));
  1067. this._chipActions.reset(actions);
  1068. this._chipActions.notifyOnChanges();
  1069. });
  1070. this._keyManager = new FocusKeyManager(this._chipActions)
  1071. .withVerticalOrientation()
  1072. .withHorizontalOrientation(this._dir ? this._dir.value : 'ltr')
  1073. .withHomeAndEnd()
  1074. .skipPredicate(action => this._skipPredicate(action));
  1075. // Keep the manager active index in sync so that navigation picks
  1076. // up from the current chip if the user clicks into the list directly.
  1077. this.chipFocusChanges.pipe(takeUntil(this._destroyed)).subscribe(({ chip }) => {
  1078. const action = chip._getSourceAction(document.activeElement);
  1079. if (action) {
  1080. this._keyManager.updateActiveItem(action);
  1081. }
  1082. });
  1083. this._dir?.change
  1084. .pipe(takeUntil(this._destroyed))
  1085. .subscribe(direction => this._keyManager.withHorizontalOrientation(direction));
  1086. }
  1087. /**
  1088. * Determines if key manager should avoid putting a given chip action in the tab index. Skip
  1089. * non-interactive and disabled actions since the user can't do anything with them.
  1090. */
  1091. _skipPredicate(action) {
  1092. // Skip chips that the user cannot interact with. `mat-chip-set` does not permit focusing disabled
  1093. // chips.
  1094. return !action.isInteractive || action.disabled;
  1095. }
  1096. /** Listens to changes in the chip set and syncs up the state of the individual chips. */
  1097. _trackChipSetChanges() {
  1098. this._chips.changes.pipe(startWith(null), takeUntil(this._destroyed)).subscribe(() => {
  1099. if (this.disabled) {
  1100. // Since this happens after the content has been
  1101. // checked, we need to defer it to the next tick.
  1102. Promise.resolve().then(() => this._syncChipsState());
  1103. }
  1104. this._redirectDestroyedChipFocus();
  1105. });
  1106. }
  1107. /** Starts tracking the destroyed chips in order to capture the focused one. */
  1108. _trackDestroyedFocusedChip() {
  1109. this.chipDestroyedChanges.pipe(takeUntil(this._destroyed)).subscribe((event) => {
  1110. const chipArray = this._chips.toArray();
  1111. const chipIndex = chipArray.indexOf(event.chip);
  1112. // If the focused chip is destroyed, save its index so that we can move focus to the next
  1113. // chip. We only save the index here, rather than move the focus immediately, because we want
  1114. // to wait until the chip is removed from the chip list before focusing the next one. This
  1115. // allows us to keep focus on the same index if the chip gets swapped out.
  1116. if (this._isValidIndex(chipIndex) && event.chip._hasFocus()) {
  1117. this._lastDestroyedFocusedChipIndex = chipIndex;
  1118. }
  1119. });
  1120. }
  1121. /**
  1122. * Finds the next appropriate chip to move focus to,
  1123. * if the currently-focused chip is destroyed.
  1124. */
  1125. _redirectDestroyedChipFocus() {
  1126. if (this._lastDestroyedFocusedChipIndex == null) {
  1127. return;
  1128. }
  1129. if (this._chips.length) {
  1130. const newIndex = Math.min(this._lastDestroyedFocusedChipIndex, this._chips.length - 1);
  1131. const chipToFocus = this._chips.toArray()[newIndex];
  1132. if (chipToFocus.disabled) {
  1133. // If we're down to one disabled chip, move focus back to the set.
  1134. if (this._chips.length === 1) {
  1135. this.focus();
  1136. }
  1137. else {
  1138. this._keyManager.setPreviousItemActive();
  1139. }
  1140. }
  1141. else {
  1142. chipToFocus.focus();
  1143. }
  1144. }
  1145. else {
  1146. this.focus();
  1147. }
  1148. this._lastDestroyedFocusedChipIndex = null;
  1149. }
  1150. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipSet, deps: [], target: i0.ɵɵFactoryTarget.Component });
  1151. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.2.6", type: MatChipSet, isStandalone: true, selector: "mat-chip-set", inputs: { disabled: ["disabled", "disabled", booleanAttribute], role: "role", tabIndex: ["tabIndex", "tabIndex", (value) => (value == null ? 0 : numberAttribute(value))] }, host: { listeners: { "keydown": "_handleKeydown($event)" }, properties: { "attr.role": "role" }, classAttribute: "mat-mdc-chip-set mdc-evolution-chip-set" }, queries: [{ propertyName: "_chips", predicate: MatChip, descendants: true }], ngImport: i0, template: `
  1152. <div class="mdc-evolution-chip-set__chips" role="presentation">
  1153. <ng-content></ng-content>
  1154. </div>
  1155. `, isInline: true, styles: [".mat-mdc-chip-set{display:flex}.mat-mdc-chip-set:focus{outline:none}.mat-mdc-chip-set .mdc-evolution-chip-set__chips{min-width:100%;margin-left:-8px;margin-right:0}.mat-mdc-chip-set .mdc-evolution-chip{margin:4px 0 4px 8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip-set__chips{margin-left:0;margin-right:-8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip{margin-left:0;margin-right:8px}.mdc-evolution-chip-set__chips{display:flex;flex-flow:wrap;min-width:0}.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}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  1156. }
  1157. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipSet, decorators: [{
  1158. type: Component,
  1159. args: [{ selector: 'mat-chip-set', template: `
  1160. <div class="mdc-evolution-chip-set__chips" role="presentation">
  1161. <ng-content></ng-content>
  1162. </div>
  1163. `, host: {
  1164. 'class': 'mat-mdc-chip-set mdc-evolution-chip-set',
  1165. '(keydown)': '_handleKeydown($event)',
  1166. '[attr.role]': 'role',
  1167. }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".mat-mdc-chip-set{display:flex}.mat-mdc-chip-set:focus{outline:none}.mat-mdc-chip-set .mdc-evolution-chip-set__chips{min-width:100%;margin-left:-8px;margin-right:0}.mat-mdc-chip-set .mdc-evolution-chip{margin:4px 0 4px 8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip-set__chips{margin-left:0;margin-right:-8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip{margin-left:0;margin-right:8px}.mdc-evolution-chip-set__chips{display:flex;flex-flow:wrap;min-width:0}.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}\n"] }]
  1168. }], ctorParameters: () => [], propDecorators: { disabled: [{
  1169. type: Input,
  1170. args: [{ transform: booleanAttribute }]
  1171. }], role: [{
  1172. type: Input
  1173. }], tabIndex: [{
  1174. type: Input,
  1175. args: [{
  1176. transform: (value) => (value == null ? 0 : numberAttribute(value)),
  1177. }]
  1178. }], _chips: [{
  1179. type: ContentChildren,
  1180. args: [MatChip, {
  1181. // We need to use `descendants: true`, because Ivy will no longer match
  1182. // indirect descendants if it's left as false.
  1183. descendants: true,
  1184. }]
  1185. }] } });
  1186. /** Change event object that is emitted when the chip listbox value has changed. */
  1187. class MatChipListboxChange {
  1188. source;
  1189. value;
  1190. constructor(
  1191. /** Chip listbox that emitted the event. */
  1192. source,
  1193. /** Value of the chip listbox when the event was emitted. */
  1194. value) {
  1195. this.source = source;
  1196. this.value = value;
  1197. }
  1198. }
  1199. /**
  1200. * Provider Expression that allows mat-chip-listbox to register as a ControlValueAccessor.
  1201. * This allows it to support [(ngModel)].
  1202. * @docs-private
  1203. */
  1204. const MAT_CHIP_LISTBOX_CONTROL_VALUE_ACCESSOR = {
  1205. provide: NG_VALUE_ACCESSOR,
  1206. useExisting: forwardRef(() => MatChipListbox),
  1207. multi: true,
  1208. };
  1209. /**
  1210. * An extension of the MatChipSet component that supports chip selection.
  1211. * Used with MatChipOption chips.
  1212. */
  1213. class MatChipListbox extends MatChipSet {
  1214. /**
  1215. * Function when touched. Set as part of ControlValueAccessor implementation.
  1216. * @docs-private
  1217. */
  1218. _onTouched = () => { };
  1219. /**
  1220. * Function when changed. Set as part of ControlValueAccessor implementation.
  1221. * @docs-private
  1222. */
  1223. _onChange = () => { };
  1224. // TODO: MDC uses `grid` here
  1225. _defaultRole = 'listbox';
  1226. /** Default chip options. */
  1227. _defaultOptions = inject(MAT_CHIPS_DEFAULT_OPTIONS, { optional: true });
  1228. /** Whether the user should be allowed to select multiple chips. */
  1229. get multiple() {
  1230. return this._multiple;
  1231. }
  1232. set multiple(value) {
  1233. this._multiple = value;
  1234. this._syncListboxProperties();
  1235. }
  1236. _multiple = false;
  1237. /** The array of selected chips inside the chip listbox. */
  1238. get selected() {
  1239. const selectedChips = this._chips.toArray().filter(chip => chip.selected);
  1240. return this.multiple ? selectedChips : selectedChips[0];
  1241. }
  1242. /** Orientation of the chip list. */
  1243. ariaOrientation = 'horizontal';
  1244. /**
  1245. * Whether or not this chip listbox is selectable.
  1246. *
  1247. * When a chip listbox is not selectable, the selected states for all
  1248. * the chips inside the chip listbox are always ignored.
  1249. */
  1250. get selectable() {
  1251. return this._selectable;
  1252. }
  1253. set selectable(value) {
  1254. this._selectable = value;
  1255. this._syncListboxProperties();
  1256. }
  1257. _selectable = true;
  1258. /**
  1259. * A function to compare the option values with the selected values. The first argument
  1260. * is a value from an option. The second is a value from the selection. A boolean
  1261. * should be returned.
  1262. */
  1263. compareWith = (o1, o2) => o1 === o2;
  1264. /** Whether this chip listbox is required. */
  1265. required = false;
  1266. /** Whether checkmark indicator for single-selection options is hidden. */
  1267. get hideSingleSelectionIndicator() {
  1268. return this._hideSingleSelectionIndicator;
  1269. }
  1270. set hideSingleSelectionIndicator(value) {
  1271. this._hideSingleSelectionIndicator = value;
  1272. this._syncListboxProperties();
  1273. }
  1274. _hideSingleSelectionIndicator = this._defaultOptions?.hideSingleSelectionIndicator ?? false;
  1275. /** Combined stream of all of the child chips' selection change events. */
  1276. get chipSelectionChanges() {
  1277. return this._getChipStream(chip => chip.selectionChange);
  1278. }
  1279. /** Combined stream of all of the child chips' blur events. */
  1280. get chipBlurChanges() {
  1281. return this._getChipStream(chip => chip._onBlur);
  1282. }
  1283. /** The value of the listbox, which is the combined value of the selected chips. */
  1284. get value() {
  1285. return this._value;
  1286. }
  1287. set value(value) {
  1288. if (this._chips && this._chips.length) {
  1289. this._setSelectionByValue(value, false);
  1290. }
  1291. this._value = value;
  1292. }
  1293. _value;
  1294. /** Event emitted when the selected chip listbox value has been changed by the user. */
  1295. change = new EventEmitter();
  1296. _chips = undefined;
  1297. ngAfterContentInit() {
  1298. this._chips.changes.pipe(startWith(null), takeUntil(this._destroyed)).subscribe(() => {
  1299. if (this.value !== undefined) {
  1300. Promise.resolve().then(() => {
  1301. this._setSelectionByValue(this.value, false);
  1302. });
  1303. }
  1304. // Update listbox selectable/multiple properties on chips
  1305. this._syncListboxProperties();
  1306. });
  1307. this.chipBlurChanges.pipe(takeUntil(this._destroyed)).subscribe(() => this._blur());
  1308. this.chipSelectionChanges.pipe(takeUntil(this._destroyed)).subscribe(event => {
  1309. if (!this.multiple) {
  1310. this._chips.forEach(chip => {
  1311. if (chip !== event.source) {
  1312. chip._setSelectedState(false, false, false);
  1313. }
  1314. });
  1315. }
  1316. if (event.isUserInput) {
  1317. this._propagateChanges();
  1318. }
  1319. });
  1320. }
  1321. /**
  1322. * Focuses the first selected chip in this chip listbox, or the first non-disabled chip when there
  1323. * are no selected chips.
  1324. */
  1325. focus() {
  1326. if (this.disabled) {
  1327. return;
  1328. }
  1329. const firstSelectedChip = this._getFirstSelectedChip();
  1330. if (firstSelectedChip && !firstSelectedChip.disabled) {
  1331. firstSelectedChip.focus();
  1332. }
  1333. else if (this._chips.length > 0) {
  1334. this._keyManager.setFirstItemActive();
  1335. }
  1336. else {
  1337. this._elementRef.nativeElement.focus();
  1338. }
  1339. }
  1340. /**
  1341. * Implemented as part of ControlValueAccessor.
  1342. * @docs-private
  1343. */
  1344. writeValue(value) {
  1345. if (value != null) {
  1346. this.value = value;
  1347. }
  1348. else {
  1349. this.value = undefined;
  1350. }
  1351. }
  1352. /**
  1353. * Implemented as part of ControlValueAccessor.
  1354. * @docs-private
  1355. */
  1356. registerOnChange(fn) {
  1357. this._onChange = fn;
  1358. }
  1359. /**
  1360. * Implemented as part of ControlValueAccessor.
  1361. * @docs-private
  1362. */
  1363. registerOnTouched(fn) {
  1364. this._onTouched = fn;
  1365. }
  1366. /**
  1367. * Implemented as part of ControlValueAccessor.
  1368. * @docs-private
  1369. */
  1370. setDisabledState(isDisabled) {
  1371. this.disabled = isDisabled;
  1372. }
  1373. /** Selects all chips with value. */
  1374. _setSelectionByValue(value, isUserInput = true) {
  1375. this._clearSelection();
  1376. if (Array.isArray(value)) {
  1377. value.forEach(currentValue => this._selectValue(currentValue, isUserInput));
  1378. }
  1379. else {
  1380. this._selectValue(value, isUserInput);
  1381. }
  1382. }
  1383. /** When blurred, marks the field as touched when focus moved outside the chip listbox. */
  1384. _blur() {
  1385. if (!this.disabled) {
  1386. // Wait to see if focus moves to an individual chip.
  1387. setTimeout(() => {
  1388. if (!this.focused) {
  1389. this._markAsTouched();
  1390. }
  1391. });
  1392. }
  1393. }
  1394. _keydown(event) {
  1395. if (event.keyCode === TAB) {
  1396. super._allowFocusEscape();
  1397. }
  1398. }
  1399. /** Marks the field as touched */
  1400. _markAsTouched() {
  1401. this._onTouched();
  1402. this._changeDetectorRef.markForCheck();
  1403. }
  1404. /** Emits change event to set the model value. */
  1405. _propagateChanges() {
  1406. let valueToEmit = null;
  1407. if (Array.isArray(this.selected)) {
  1408. valueToEmit = this.selected.map(chip => chip.value);
  1409. }
  1410. else {
  1411. valueToEmit = this.selected ? this.selected.value : undefined;
  1412. }
  1413. this._value = valueToEmit;
  1414. this.change.emit(new MatChipListboxChange(this, valueToEmit));
  1415. this._onChange(valueToEmit);
  1416. this._changeDetectorRef.markForCheck();
  1417. }
  1418. /**
  1419. * Deselects every chip in the listbox.
  1420. * @param skip Chip that should not be deselected.
  1421. */
  1422. _clearSelection(skip) {
  1423. this._chips.forEach(chip => {
  1424. if (chip !== skip) {
  1425. chip.deselect();
  1426. }
  1427. });
  1428. }
  1429. /**
  1430. * Finds and selects the chip based on its value.
  1431. * @returns Chip that has the corresponding value.
  1432. */
  1433. _selectValue(value, isUserInput) {
  1434. const correspondingChip = this._chips.find(chip => {
  1435. return chip.value != null && this.compareWith(chip.value, value);
  1436. });
  1437. if (correspondingChip) {
  1438. isUserInput ? correspondingChip.selectViaInteraction() : correspondingChip.select();
  1439. }
  1440. return correspondingChip;
  1441. }
  1442. /** Syncs the chip-listbox selection state with the individual chips. */
  1443. _syncListboxProperties() {
  1444. if (this._chips) {
  1445. // Defer setting the value in order to avoid the "Expression
  1446. // has changed after it was checked" errors from Angular.
  1447. Promise.resolve().then(() => {
  1448. this._chips.forEach(chip => {
  1449. chip._chipListMultiple = this.multiple;
  1450. chip.chipListSelectable = this._selectable;
  1451. chip._chipListHideSingleSelectionIndicator = this.hideSingleSelectionIndicator;
  1452. chip._changeDetectorRef.markForCheck();
  1453. });
  1454. });
  1455. }
  1456. }
  1457. /** Returns the first selected chip in this listbox, or undefined if no chips are selected. */
  1458. _getFirstSelectedChip() {
  1459. if (Array.isArray(this.selected)) {
  1460. return this.selected.length ? this.selected[0] : undefined;
  1461. }
  1462. else {
  1463. return this.selected;
  1464. }
  1465. }
  1466. /**
  1467. * Determines if key manager should avoid putting a given chip action in the tab index. Skip
  1468. * non-interactive actions since the user can't do anything with them.
  1469. */
  1470. _skipPredicate(action) {
  1471. // Override the skip predicate in the base class to avoid skipping disabled chips. Allow
  1472. // disabled chip options to receive focus to align with WAI ARIA recommendation. Normally WAI
  1473. // ARIA's instructions are to exclude disabled items from the tab order, but it makes a few
  1474. // exceptions for compound widgets.
  1475. //
  1476. // From [Developing a Keyboard Interface](
  1477. // https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/):
  1478. // "For the following composite widget elements, keep them focusable when disabled: Options in a
  1479. // Listbox..."
  1480. return !action.isInteractive;
  1481. }
  1482. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipListbox, deps: null, target: i0.ɵɵFactoryTarget.Component });
  1483. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.2.6", type: MatChipListbox, isStandalone: true, selector: "mat-chip-listbox", inputs: { multiple: ["multiple", "multiple", booleanAttribute], ariaOrientation: ["aria-orientation", "ariaOrientation"], selectable: ["selectable", "selectable", booleanAttribute], compareWith: "compareWith", required: ["required", "required", booleanAttribute], hideSingleSelectionIndicator: ["hideSingleSelectionIndicator", "hideSingleSelectionIndicator", booleanAttribute], value: "value" }, outputs: { change: "change" }, host: { listeners: { "focus": "focus()", "blur": "_blur()", "keydown": "_keydown($event)" }, properties: { "attr.role": "role", "tabIndex": "(disabled || empty) ? -1 : tabIndex", "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: `
  1484. <div class="mdc-evolution-chip-set__chips" role="presentation">
  1485. <ng-content></ng-content>
  1486. </div>
  1487. `, isInline: true, styles: [".mat-mdc-chip-set{display:flex}.mat-mdc-chip-set:focus{outline:none}.mat-mdc-chip-set .mdc-evolution-chip-set__chips{min-width:100%;margin-left:-8px;margin-right:0}.mat-mdc-chip-set .mdc-evolution-chip{margin:4px 0 4px 8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip-set__chips{margin-left:0;margin-right:-8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip{margin-left:0;margin-right:8px}.mdc-evolution-chip-set__chips{display:flex;flex-flow:wrap;min-width:0}.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}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  1488. }
  1489. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipListbox, decorators: [{
  1490. type: Component,
  1491. args: [{ selector: 'mat-chip-listbox', template: `
  1492. <div class="mdc-evolution-chip-set__chips" role="presentation">
  1493. <ng-content></ng-content>
  1494. </div>
  1495. `, host: {
  1496. 'class': 'mdc-evolution-chip-set mat-mdc-chip-listbox',
  1497. '[attr.role]': 'role',
  1498. '[tabIndex]': '(disabled || empty) ? -1 : tabIndex',
  1499. '[attr.aria-required]': 'role ? required : null',
  1500. '[attr.aria-disabled]': 'disabled.toString()',
  1501. '[attr.aria-multiselectable]': 'multiple',
  1502. '[attr.aria-orientation]': 'ariaOrientation',
  1503. '[class.mat-mdc-chip-list-disabled]': 'disabled',
  1504. '[class.mat-mdc-chip-list-required]': 'required',
  1505. '(focus)': 'focus()',
  1506. '(blur)': '_blur()',
  1507. '(keydown)': '_keydown($event)',
  1508. }, providers: [MAT_CHIP_LISTBOX_CONTROL_VALUE_ACCESSOR], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".mat-mdc-chip-set{display:flex}.mat-mdc-chip-set:focus{outline:none}.mat-mdc-chip-set .mdc-evolution-chip-set__chips{min-width:100%;margin-left:-8px;margin-right:0}.mat-mdc-chip-set .mdc-evolution-chip{margin:4px 0 4px 8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip-set__chips{margin-left:0;margin-right:-8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip{margin-left:0;margin-right:8px}.mdc-evolution-chip-set__chips{display:flex;flex-flow:wrap;min-width:0}.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}\n"] }]
  1509. }], propDecorators: { multiple: [{
  1510. type: Input,
  1511. args: [{ transform: booleanAttribute }]
  1512. }], ariaOrientation: [{
  1513. type: Input,
  1514. args: ['aria-orientation']
  1515. }], selectable: [{
  1516. type: Input,
  1517. args: [{ transform: booleanAttribute }]
  1518. }], compareWith: [{
  1519. type: Input
  1520. }], required: [{
  1521. type: Input,
  1522. args: [{ transform: booleanAttribute }]
  1523. }], hideSingleSelectionIndicator: [{
  1524. type: Input,
  1525. args: [{ transform: booleanAttribute }]
  1526. }], value: [{
  1527. type: Input
  1528. }], change: [{
  1529. type: Output
  1530. }], _chips: [{
  1531. type: ContentChildren,
  1532. args: [MatChipOption, {
  1533. // We need to use `descendants: true`, because Ivy will no longer match
  1534. // indirect descendants if it's left as false.
  1535. descendants: true,
  1536. }]
  1537. }] } });
  1538. /** Change event object that is emitted when the chip grid value has changed. */
  1539. class MatChipGridChange {
  1540. source;
  1541. value;
  1542. constructor(
  1543. /** Chip grid that emitted the event. */
  1544. source,
  1545. /** Value of the chip grid when the event was emitted. */
  1546. value) {
  1547. this.source = source;
  1548. this.value = value;
  1549. }
  1550. }
  1551. /**
  1552. * An extension of the MatChipSet component used with MatChipRow chips and
  1553. * the matChipInputFor directive.
  1554. */
  1555. class MatChipGrid extends MatChipSet {
  1556. ngControl = inject(NgControl, { optional: true, self: true });
  1557. /**
  1558. * Implemented as part of MatFormFieldControl.
  1559. * @docs-private
  1560. */
  1561. controlType = 'mat-chip-grid';
  1562. /** The chip input to add more chips */
  1563. _chipInput;
  1564. _defaultRole = 'grid';
  1565. _errorStateTracker;
  1566. /**
  1567. * List of element ids to propagate to the chipInput's aria-describedby attribute.
  1568. */
  1569. _ariaDescribedbyIds = [];
  1570. /**
  1571. * Function when touched. Set as part of ControlValueAccessor implementation.
  1572. * @docs-private
  1573. */
  1574. _onTouched = () => { };
  1575. /**
  1576. * Function when changed. Set as part of ControlValueAccessor implementation.
  1577. * @docs-private
  1578. */
  1579. _onChange = () => { };
  1580. /**
  1581. * Implemented as part of MatFormFieldControl.
  1582. * @docs-private
  1583. */
  1584. get disabled() {
  1585. return this.ngControl ? !!this.ngControl.disabled : this._disabled;
  1586. }
  1587. set disabled(value) {
  1588. this._disabled = value;
  1589. this._syncChipsState();
  1590. this.stateChanges.next();
  1591. }
  1592. /**
  1593. * Implemented as part of MatFormFieldControl.
  1594. * @docs-private
  1595. */
  1596. get id() {
  1597. return this._chipInput.id;
  1598. }
  1599. /**
  1600. * Implemented as part of MatFormFieldControl.
  1601. * @docs-private
  1602. */
  1603. get empty() {
  1604. return ((!this._chipInput || this._chipInput.empty) && (!this._chips || this._chips.length === 0));
  1605. }
  1606. /**
  1607. * Implemented as part of MatFormFieldControl.
  1608. * @docs-private
  1609. */
  1610. get placeholder() {
  1611. return this._chipInput ? this._chipInput.placeholder : this._placeholder;
  1612. }
  1613. set placeholder(value) {
  1614. this._placeholder = value;
  1615. this.stateChanges.next();
  1616. }
  1617. _placeholder;
  1618. /** Whether any chips or the matChipInput inside of this chip-grid has focus. */
  1619. get focused() {
  1620. return this._chipInput.focused || this._hasFocusedChip();
  1621. }
  1622. /**
  1623. * Implemented as part of MatFormFieldControl.
  1624. * @docs-private
  1625. */
  1626. get required() {
  1627. return this._required ?? this.ngControl?.control?.hasValidator(Validators.required) ?? false;
  1628. }
  1629. set required(value) {
  1630. this._required = value;
  1631. this.stateChanges.next();
  1632. }
  1633. _required;
  1634. /**
  1635. * Implemented as part of MatFormFieldControl.
  1636. * @docs-private
  1637. */
  1638. get shouldLabelFloat() {
  1639. return !this.empty || this.focused;
  1640. }
  1641. /**
  1642. * Implemented as part of MatFormFieldControl.
  1643. * @docs-private
  1644. */
  1645. get value() {
  1646. return this._value;
  1647. }
  1648. set value(value) {
  1649. this._value = value;
  1650. }
  1651. _value = [];
  1652. /** An object used to control when error messages are shown. */
  1653. get errorStateMatcher() {
  1654. return this._errorStateTracker.matcher;
  1655. }
  1656. set errorStateMatcher(value) {
  1657. this._errorStateTracker.matcher = value;
  1658. }
  1659. /** Combined stream of all of the child chips' blur events. */
  1660. get chipBlurChanges() {
  1661. return this._getChipStream(chip => chip._onBlur);
  1662. }
  1663. /** Emits when the chip grid value has been changed by the user. */
  1664. change = new EventEmitter();
  1665. /**
  1666. * Emits whenever the raw value of the chip-grid changes. This is here primarily
  1667. * to facilitate the two-way binding for the `value` input.
  1668. * @docs-private
  1669. */
  1670. valueChange = new EventEmitter();
  1671. _chips = undefined;
  1672. /**
  1673. * Emits whenever the component state changes and should cause the parent
  1674. * form-field to update. Implemented as part of `MatFormFieldControl`.
  1675. * @docs-private
  1676. */
  1677. stateChanges = new Subject();
  1678. /** Whether the chip grid is in an error state. */
  1679. get errorState() {
  1680. return this._errorStateTracker.errorState;
  1681. }
  1682. set errorState(value) {
  1683. this._errorStateTracker.errorState = value;
  1684. }
  1685. constructor() {
  1686. super();
  1687. const parentForm = inject(NgForm, { optional: true });
  1688. const parentFormGroup = inject(FormGroupDirective, { optional: true });
  1689. const defaultErrorStateMatcher = inject(ErrorStateMatcher);
  1690. if (this.ngControl) {
  1691. this.ngControl.valueAccessor = this;
  1692. }
  1693. this._errorStateTracker = new _ErrorStateTracker(defaultErrorStateMatcher, this.ngControl, parentFormGroup, parentForm, this.stateChanges);
  1694. }
  1695. ngAfterContentInit() {
  1696. this.chipBlurChanges.pipe(takeUntil(this._destroyed)).subscribe(() => {
  1697. this._blur();
  1698. this.stateChanges.next();
  1699. });
  1700. merge(this.chipFocusChanges, this._chips.changes)
  1701. .pipe(takeUntil(this._destroyed))
  1702. .subscribe(() => this.stateChanges.next());
  1703. }
  1704. ngAfterViewInit() {
  1705. super.ngAfterViewInit();
  1706. if (!this._chipInput && (typeof ngDevMode === 'undefined' || ngDevMode)) {
  1707. throw Error('mat-chip-grid must be used in combination with matChipInputFor.');
  1708. }
  1709. }
  1710. ngDoCheck() {
  1711. if (this.ngControl) {
  1712. // We need to re-evaluate this on every change detection cycle, because there are some
  1713. // error triggers that we can't subscribe to (e.g. parent form submissions). This means
  1714. // that whatever logic is in here has to be super lean or we risk destroying the performance.
  1715. this.updateErrorState();
  1716. }
  1717. }
  1718. ngOnDestroy() {
  1719. super.ngOnDestroy();
  1720. this.stateChanges.complete();
  1721. }
  1722. /** Associates an HTML input element with this chip grid. */
  1723. registerInput(inputElement) {
  1724. this._chipInput = inputElement;
  1725. this._chipInput.setDescribedByIds(this._ariaDescribedbyIds);
  1726. }
  1727. /**
  1728. * Implemented as part of MatFormFieldControl.
  1729. * @docs-private
  1730. */
  1731. onContainerClick(event) {
  1732. if (!this.disabled && !this._originatesFromChip(event)) {
  1733. this.focus();
  1734. }
  1735. }
  1736. /**
  1737. * Focuses the first chip in this chip grid, or the associated input when there
  1738. * are no eligible chips.
  1739. */
  1740. focus() {
  1741. if (this.disabled || this._chipInput.focused) {
  1742. return;
  1743. }
  1744. if (!this._chips.length || this._chips.first.disabled) {
  1745. // Delay until the next tick, because this can cause a "changed after checked"
  1746. // error if the input does something on focus (e.g. opens an autocomplete).
  1747. Promise.resolve().then(() => this._chipInput.focus());
  1748. }
  1749. else {
  1750. const activeItem = this._keyManager.activeItem;
  1751. if (activeItem) {
  1752. activeItem.focus();
  1753. }
  1754. else {
  1755. this._keyManager.setFirstItemActive();
  1756. }
  1757. }
  1758. this.stateChanges.next();
  1759. }
  1760. /**
  1761. * Implemented as part of MatFormFieldControl.
  1762. * @docs-private
  1763. */
  1764. setDescribedByIds(ids) {
  1765. // We must keep this up to date to handle the case where ids are set
  1766. // before the chip input is registered.
  1767. this._ariaDescribedbyIds = ids;
  1768. this._chipInput?.setDescribedByIds(ids);
  1769. }
  1770. /**
  1771. * Implemented as part of ControlValueAccessor.
  1772. * @docs-private
  1773. */
  1774. writeValue(value) {
  1775. // The user is responsible for creating the child chips, so we just store the value.
  1776. this._value = value;
  1777. }
  1778. /**
  1779. * Implemented as part of ControlValueAccessor.
  1780. * @docs-private
  1781. */
  1782. registerOnChange(fn) {
  1783. this._onChange = fn;
  1784. }
  1785. /**
  1786. * Implemented as part of ControlValueAccessor.
  1787. * @docs-private
  1788. */
  1789. registerOnTouched(fn) {
  1790. this._onTouched = fn;
  1791. }
  1792. /**
  1793. * Implemented as part of ControlValueAccessor.
  1794. * @docs-private
  1795. */
  1796. setDisabledState(isDisabled) {
  1797. this.disabled = isDisabled;
  1798. this.stateChanges.next();
  1799. }
  1800. /** Refreshes the error state of the chip grid. */
  1801. updateErrorState() {
  1802. this._errorStateTracker.updateErrorState();
  1803. }
  1804. /** When blurred, mark the field as touched when focus moved outside the chip grid. */
  1805. _blur() {
  1806. if (!this.disabled) {
  1807. // Check whether the focus moved to chip input.
  1808. // If the focus is not moved to chip input, mark the field as touched. If the focus moved
  1809. // to chip input, do nothing.
  1810. // Timeout is needed to wait for the focus() event trigger on chip input.
  1811. setTimeout(() => {
  1812. if (!this.focused) {
  1813. this._propagateChanges();
  1814. this._markAsTouched();
  1815. }
  1816. });
  1817. }
  1818. }
  1819. /**
  1820. * Removes the `tabindex` from the chip grid and resets it back afterwards, allowing the
  1821. * user to tab out of it. This prevents the grid from capturing focus and redirecting
  1822. * it back to the first chip, creating a focus trap, if it user tries to tab away.
  1823. */
  1824. _allowFocusEscape() {
  1825. if (!this._chipInput.focused) {
  1826. super._allowFocusEscape();
  1827. }
  1828. }
  1829. /** Handles custom keyboard events. */
  1830. _handleKeydown(event) {
  1831. const keyCode = event.keyCode;
  1832. const activeItem = this._keyManager.activeItem;
  1833. if (keyCode === TAB) {
  1834. if (this._chipInput.focused &&
  1835. hasModifierKey(event, 'shiftKey') &&
  1836. this._chips.length &&
  1837. !this._chips.last.disabled) {
  1838. event.preventDefault();
  1839. if (activeItem) {
  1840. this._keyManager.setActiveItem(activeItem);
  1841. }
  1842. else {
  1843. this._focusLastChip();
  1844. }
  1845. }
  1846. else {
  1847. // Use the super method here since it doesn't check for the input
  1848. // focused state. This allows focus to escape if there's only one
  1849. // disabled chip left in the list.
  1850. super._allowFocusEscape();
  1851. }
  1852. }
  1853. else if (!this._chipInput.focused) {
  1854. // The up and down arrows are supposed to navigate between the individual rows in the grid.
  1855. // We do this by filtering the actions down to the ones that have the same `_isPrimary`
  1856. // flag as the active action and moving focus between them ourseles instead of delegating
  1857. // to the key manager. For more information, see #29359 and:
  1858. // https://www.w3.org/WAI/ARIA/apg/patterns/grid/examples/layout-grids/#ex2_label
  1859. if ((keyCode === UP_ARROW || keyCode === DOWN_ARROW) && activeItem) {
  1860. const eligibleActions = this._chipActions.filter(action => action._isPrimary === activeItem._isPrimary && !this._skipPredicate(action));
  1861. const currentIndex = eligibleActions.indexOf(activeItem);
  1862. const delta = event.keyCode === UP_ARROW ? -1 : 1;
  1863. event.preventDefault();
  1864. if (currentIndex > -1 && this._isValidIndex(currentIndex + delta)) {
  1865. this._keyManager.setActiveItem(eligibleActions[currentIndex + delta]);
  1866. }
  1867. }
  1868. else {
  1869. super._handleKeydown(event);
  1870. }
  1871. }
  1872. this.stateChanges.next();
  1873. }
  1874. _focusLastChip() {
  1875. if (this._chips.length) {
  1876. this._chips.last.focus();
  1877. }
  1878. }
  1879. /** Emits change event to set the model value. */
  1880. _propagateChanges() {
  1881. const valueToEmit = this._chips.length ? this._chips.toArray().map(chip => chip.value) : [];
  1882. this._value = valueToEmit;
  1883. this.change.emit(new MatChipGridChange(this, valueToEmit));
  1884. this.valueChange.emit(valueToEmit);
  1885. this._onChange(valueToEmit);
  1886. this._changeDetectorRef.markForCheck();
  1887. }
  1888. /** Mark the field as touched */
  1889. _markAsTouched() {
  1890. this._onTouched();
  1891. this._changeDetectorRef.markForCheck();
  1892. this.stateChanges.next();
  1893. }
  1894. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipGrid, deps: [], target: i0.ɵɵFactoryTarget.Component });
  1895. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.2.6", type: MatChipGrid, isStandalone: true, selector: "mat-chip-grid", inputs: { disabled: ["disabled", "disabled", booleanAttribute], placeholder: "placeholder", required: ["required", "required", booleanAttribute], value: "value", errorStateMatcher: "errorStateMatcher" }, outputs: { change: "change", valueChange: "valueChange" }, host: { listeners: { "focus": "focus()", "blur": "_blur()" }, properties: { "attr.role": "role", "attr.tabindex": "(disabled || (_chips && _chips.length === 0)) ? -1 : tabIndex", "attr.aria-disabled": "disabled.toString()", "attr.aria-invalid": "errorState", "class.mat-mdc-chip-list-disabled": "disabled", "class.mat-mdc-chip-list-invalid": "errorState", "class.mat-mdc-chip-list-required": "required" }, classAttribute: "mat-mdc-chip-set mat-mdc-chip-grid mdc-evolution-chip-set" }, providers: [{ provide: MatFormFieldControl, useExisting: MatChipGrid }], queries: [{ propertyName: "_chips", predicate: MatChipRow, descendants: true }], usesInheritance: true, ngImport: i0, template: `
  1896. <div class="mdc-evolution-chip-set__chips" role="presentation">
  1897. <ng-content></ng-content>
  1898. </div>
  1899. `, isInline: true, styles: [".mat-mdc-chip-set{display:flex}.mat-mdc-chip-set:focus{outline:none}.mat-mdc-chip-set .mdc-evolution-chip-set__chips{min-width:100%;margin-left:-8px;margin-right:0}.mat-mdc-chip-set .mdc-evolution-chip{margin:4px 0 4px 8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip-set__chips{margin-left:0;margin-right:-8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip{margin-left:0;margin-right:8px}.mdc-evolution-chip-set__chips{display:flex;flex-flow:wrap;min-width:0}.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}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  1900. }
  1901. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipGrid, decorators: [{
  1902. type: Component,
  1903. args: [{ selector: 'mat-chip-grid', template: `
  1904. <div class="mdc-evolution-chip-set__chips" role="presentation">
  1905. <ng-content></ng-content>
  1906. </div>
  1907. `, host: {
  1908. 'class': 'mat-mdc-chip-set mat-mdc-chip-grid mdc-evolution-chip-set',
  1909. '[attr.role]': 'role',
  1910. '[attr.tabindex]': '(disabled || (_chips && _chips.length === 0)) ? -1 : tabIndex',
  1911. '[attr.aria-disabled]': 'disabled.toString()',
  1912. '[attr.aria-invalid]': 'errorState',
  1913. '[class.mat-mdc-chip-list-disabled]': 'disabled',
  1914. '[class.mat-mdc-chip-list-invalid]': 'errorState',
  1915. '[class.mat-mdc-chip-list-required]': 'required',
  1916. '(focus)': 'focus()',
  1917. '(blur)': '_blur()',
  1918. }, providers: [{ provide: MatFormFieldControl, useExisting: MatChipGrid }], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".mat-mdc-chip-set{display:flex}.mat-mdc-chip-set:focus{outline:none}.mat-mdc-chip-set .mdc-evolution-chip-set__chips{min-width:100%;margin-left:-8px;margin-right:0}.mat-mdc-chip-set .mdc-evolution-chip{margin:4px 0 4px 8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip-set__chips{margin-left:0;margin-right:-8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip{margin-left:0;margin-right:8px}.mdc-evolution-chip-set__chips{display:flex;flex-flow:wrap;min-width:0}.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}\n"] }]
  1919. }], ctorParameters: () => [], propDecorators: { disabled: [{
  1920. type: Input,
  1921. args: [{ transform: booleanAttribute }]
  1922. }], placeholder: [{
  1923. type: Input
  1924. }], required: [{
  1925. type: Input,
  1926. args: [{ transform: booleanAttribute }]
  1927. }], value: [{
  1928. type: Input
  1929. }], errorStateMatcher: [{
  1930. type: Input
  1931. }], change: [{
  1932. type: Output
  1933. }], valueChange: [{
  1934. type: Output
  1935. }], _chips: [{
  1936. type: ContentChildren,
  1937. args: [MatChipRow, {
  1938. // We need to use `descendants: true`, because Ivy will no longer match
  1939. // indirect descendants if it's left as false.
  1940. descendants: true,
  1941. }]
  1942. }] } });
  1943. /**
  1944. * Directive that adds chip-specific behaviors to an input element inside `<mat-form-field>`.
  1945. * May be placed inside or outside of a `<mat-chip-grid>`.
  1946. */
  1947. class MatChipInput {
  1948. _elementRef = inject(ElementRef);
  1949. /** Whether the control is focused. */
  1950. focused = false;
  1951. /** Register input for chip list */
  1952. get chipGrid() {
  1953. return this._chipGrid;
  1954. }
  1955. set chipGrid(value) {
  1956. if (value) {
  1957. this._chipGrid = value;
  1958. this._chipGrid.registerInput(this);
  1959. }
  1960. }
  1961. _chipGrid;
  1962. /**
  1963. * Whether or not the chipEnd event will be emitted when the input is blurred.
  1964. */
  1965. addOnBlur = false;
  1966. /**
  1967. * The list of key codes that will trigger a chipEnd event.
  1968. *
  1969. * Defaults to `[ENTER]`.
  1970. */
  1971. separatorKeyCodes;
  1972. /** Emitted when a chip is to be added. */
  1973. chipEnd = new EventEmitter();
  1974. /** The input's placeholder text. */
  1975. placeholder = '';
  1976. /** Unique id for the input. */
  1977. id = inject(_IdGenerator).getId('mat-mdc-chip-list-input-');
  1978. /** Whether the input is disabled. */
  1979. get disabled() {
  1980. return this._disabled || (this._chipGrid && this._chipGrid.disabled);
  1981. }
  1982. set disabled(value) {
  1983. this._disabled = value;
  1984. }
  1985. _disabled = false;
  1986. /** Whether the input is empty. */
  1987. get empty() {
  1988. return !this.inputElement.value;
  1989. }
  1990. /** The native input element to which this directive is attached. */
  1991. inputElement;
  1992. constructor() {
  1993. const defaultOptions = inject(MAT_CHIPS_DEFAULT_OPTIONS);
  1994. const formField = inject(MAT_FORM_FIELD, { optional: true });
  1995. this.inputElement = this._elementRef.nativeElement;
  1996. this.separatorKeyCodes = defaultOptions.separatorKeyCodes;
  1997. if (formField) {
  1998. this.inputElement.classList.add('mat-mdc-form-field-input-control');
  1999. }
  2000. }
  2001. ngOnChanges() {
  2002. this._chipGrid.stateChanges.next();
  2003. }
  2004. ngOnDestroy() {
  2005. this.chipEnd.complete();
  2006. }
  2007. /** Utility method to make host definition/tests more clear. */
  2008. _keydown(event) {
  2009. if (this.empty && event.keyCode === BACKSPACE) {
  2010. // Ignore events where the user is holding down backspace
  2011. // so that we don't accidentally remove too many chips.
  2012. if (!event.repeat) {
  2013. this._chipGrid._focusLastChip();
  2014. }
  2015. event.preventDefault();
  2016. }
  2017. else {
  2018. this._emitChipEnd(event);
  2019. }
  2020. }
  2021. /** Checks to see if the blur should emit the (chipEnd) event. */
  2022. _blur() {
  2023. if (this.addOnBlur) {
  2024. this._emitChipEnd();
  2025. }
  2026. this.focused = false;
  2027. // Blur the chip list if it is not focused
  2028. if (!this._chipGrid.focused) {
  2029. this._chipGrid._blur();
  2030. }
  2031. this._chipGrid.stateChanges.next();
  2032. }
  2033. _focus() {
  2034. this.focused = true;
  2035. this._chipGrid.stateChanges.next();
  2036. }
  2037. /** Checks to see if the (chipEnd) event needs to be emitted. */
  2038. _emitChipEnd(event) {
  2039. if (!event || (this._isSeparatorKey(event) && !event.repeat)) {
  2040. this.chipEnd.emit({
  2041. input: this.inputElement,
  2042. value: this.inputElement.value,
  2043. chipInput: this,
  2044. });
  2045. event?.preventDefault();
  2046. }
  2047. }
  2048. _onInput() {
  2049. // Let chip list know whenever the value changes.
  2050. this._chipGrid.stateChanges.next();
  2051. }
  2052. /** Focuses the input. */
  2053. focus() {
  2054. this.inputElement.focus();
  2055. }
  2056. /** Clears the input */
  2057. clear() {
  2058. this.inputElement.value = '';
  2059. }
  2060. setDescribedByIds(ids) {
  2061. const element = this._elementRef.nativeElement;
  2062. // Set the value directly in the DOM since this binding
  2063. // is prone to "changed after checked" errors.
  2064. if (ids.length) {
  2065. element.setAttribute('aria-describedby', ids.join(' '));
  2066. }
  2067. else {
  2068. element.removeAttribute('aria-describedby');
  2069. }
  2070. }
  2071. /** Checks whether a keycode is one of the configured separators. */
  2072. _isSeparatorKey(event) {
  2073. return !hasModifierKey(event) && new Set(this.separatorKeyCodes).has(event.keyCode);
  2074. }
  2075. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
  2076. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.2.6", type: MatChipInput, isStandalone: true, selector: "input[matChipInputFor]", inputs: { chipGrid: ["matChipInputFor", "chipGrid"], addOnBlur: ["matChipInputAddOnBlur", "addOnBlur", booleanAttribute], separatorKeyCodes: ["matChipInputSeparatorKeyCodes", "separatorKeyCodes"], placeholder: "placeholder", id: "id", disabled: ["disabled", "disabled", booleanAttribute] }, outputs: { chipEnd: "matChipInputTokenEnd" }, host: { listeners: { "keydown": "_keydown($event)", "blur": "_blur()", "focus": "_focus()", "input": "_onInput()" }, properties: { "id": "id", "attr.disabled": "disabled || null", "attr.placeholder": "placeholder || null", "attr.aria-invalid": "_chipGrid && _chipGrid.ngControl ? _chipGrid.ngControl.invalid : null", "attr.aria-required": "_chipGrid && _chipGrid.required || null", "attr.required": "_chipGrid && _chipGrid.required || null" }, classAttribute: "mat-mdc-chip-input mat-mdc-input-element mdc-text-field__input mat-input-element" }, exportAs: ["matChipInput", "matChipInputFor"], usesOnChanges: true, ngImport: i0 });
  2077. }
  2078. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipInput, decorators: [{
  2079. type: Directive,
  2080. args: [{
  2081. selector: 'input[matChipInputFor]',
  2082. exportAs: 'matChipInput, matChipInputFor',
  2083. host: {
  2084. // TODO: eventually we should remove `mat-input-element` from here since it comes from the
  2085. // non-MDC version of the input. It's currently being kept for backwards compatibility, because
  2086. // the MDC chips were landed initially with it.
  2087. 'class': 'mat-mdc-chip-input mat-mdc-input-element mdc-text-field__input mat-input-element',
  2088. '(keydown)': '_keydown($event)',
  2089. '(blur)': '_blur()',
  2090. '(focus)': '_focus()',
  2091. '(input)': '_onInput()',
  2092. '[id]': 'id',
  2093. '[attr.disabled]': 'disabled || null',
  2094. '[attr.placeholder]': 'placeholder || null',
  2095. '[attr.aria-invalid]': '_chipGrid && _chipGrid.ngControl ? _chipGrid.ngControl.invalid : null',
  2096. '[attr.aria-required]': '_chipGrid && _chipGrid.required || null',
  2097. '[attr.required]': '_chipGrid && _chipGrid.required || null',
  2098. },
  2099. }]
  2100. }], ctorParameters: () => [], propDecorators: { chipGrid: [{
  2101. type: Input,
  2102. args: ['matChipInputFor']
  2103. }], addOnBlur: [{
  2104. type: Input,
  2105. args: [{ alias: 'matChipInputAddOnBlur', transform: booleanAttribute }]
  2106. }], separatorKeyCodes: [{
  2107. type: Input,
  2108. args: ['matChipInputSeparatorKeyCodes']
  2109. }], chipEnd: [{
  2110. type: Output,
  2111. args: ['matChipInputTokenEnd']
  2112. }], placeholder: [{
  2113. type: Input
  2114. }], id: [{
  2115. type: Input
  2116. }], disabled: [{
  2117. type: Input,
  2118. args: [{ transform: booleanAttribute }]
  2119. }] } });
  2120. const CHIP_DECLARATIONS = [
  2121. MatChip,
  2122. MatChipAvatar,
  2123. MatChipEditInput,
  2124. MatChipGrid,
  2125. MatChipInput,
  2126. MatChipListbox,
  2127. MatChipOption,
  2128. MatChipRemove,
  2129. MatChipRow,
  2130. MatChipSet,
  2131. MatChipTrailingIcon,
  2132. ];
  2133. class MatChipsModule {
  2134. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
  2135. static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.6", ngImport: i0, type: MatChipsModule, imports: [MatCommonModule, MatRippleModule, MatChipAction, MatChip,
  2136. MatChipAvatar,
  2137. MatChipEditInput,
  2138. MatChipGrid,
  2139. MatChipInput,
  2140. MatChipListbox,
  2141. MatChipOption,
  2142. MatChipRemove,
  2143. MatChipRow,
  2144. MatChipSet,
  2145. MatChipTrailingIcon], exports: [MatCommonModule, MatChip,
  2146. MatChipAvatar,
  2147. MatChipEditInput,
  2148. MatChipGrid,
  2149. MatChipInput,
  2150. MatChipListbox,
  2151. MatChipOption,
  2152. MatChipRemove,
  2153. MatChipRow,
  2154. MatChipSet,
  2155. MatChipTrailingIcon] });
  2156. static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipsModule, providers: [
  2157. ErrorStateMatcher,
  2158. {
  2159. provide: MAT_CHIPS_DEFAULT_OPTIONS,
  2160. useValue: {
  2161. separatorKeyCodes: [ENTER],
  2162. },
  2163. },
  2164. ], imports: [MatCommonModule, MatRippleModule, MatCommonModule] });
  2165. }
  2166. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatChipsModule, decorators: [{
  2167. type: NgModule,
  2168. args: [{
  2169. imports: [MatCommonModule, MatRippleModule, MatChipAction, CHIP_DECLARATIONS],
  2170. exports: [MatCommonModule, CHIP_DECLARATIONS],
  2171. providers: [
  2172. ErrorStateMatcher,
  2173. {
  2174. provide: MAT_CHIPS_DEFAULT_OPTIONS,
  2175. useValue: {
  2176. separatorKeyCodes: [ENTER],
  2177. },
  2178. },
  2179. ],
  2180. }]
  2181. }] });
  2182. export { MAT_CHIP, MAT_CHIPS_DEFAULT_OPTIONS, MAT_CHIP_AVATAR, MAT_CHIP_LISTBOX_CONTROL_VALUE_ACCESSOR, MAT_CHIP_REMOVE, MAT_CHIP_TRAILING_ICON, MatChip, MatChipAvatar, MatChipEditInput, MatChipGrid, MatChipGridChange, MatChipInput, MatChipListbox, MatChipListboxChange, MatChipOption, MatChipRemove, MatChipRow, MatChipSelectionChange, MatChipSet, MatChipTrailingIcon, MatChipsModule };
  2183. //# sourceMappingURL=chips.mjs.map