index.d.ts 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  1. import { _AbstractConstructor } from '@angular/material/core';
  2. import { AfterContentInit } from '@angular/core';
  3. import { BooleanInput } from '@angular/cdk/coercion';
  4. import { CanColor } from '@angular/material/core';
  5. import { CanDisable } from '@angular/material/core';
  6. import { CanDisableRipple } from '@angular/material/core';
  7. import { CanUpdateErrorState } from '@angular/material/core';
  8. import { ChangeDetectorRef } from '@angular/core';
  9. import { _Constructor } from '@angular/material/core';
  10. import { ControlValueAccessor } from '@angular/forms';
  11. import { Directionality } from '@angular/cdk/bidi';
  12. import { DoCheck } from '@angular/core';
  13. import { ElementRef } from '@angular/core';
  14. import { ErrorStateMatcher } from '@angular/material/core';
  15. import { EventEmitter } from '@angular/core';
  16. import { FocusableOption } from '@angular/cdk/a11y';
  17. import { FocusKeyManager } from '@angular/cdk/a11y';
  18. import { FormGroupDirective } from '@angular/forms';
  19. import { HasTabIndex } from '@angular/material/core';
  20. import * as i0 from '@angular/core';
  21. import * as i4 from '@angular/material/core';
  22. import { InjectionToken } from '@angular/core';
  23. import { MatLegacyFormFieldControl } from '@angular/material/legacy-form-field';
  24. import { NgControl } from '@angular/forms';
  25. import { NgForm } from '@angular/forms';
  26. import { NgZone } from '@angular/core';
  27. import { Observable } from 'rxjs';
  28. import { OnChanges } from '@angular/core';
  29. import { OnDestroy } from '@angular/core';
  30. import { OnInit } from '@angular/core';
  31. import { Platform } from '@angular/cdk/platform';
  32. import { QueryList } from '@angular/core';
  33. import { RippleConfig } from '@angular/material/core';
  34. import { RippleGlobalOptions } from '@angular/material/core';
  35. import { RippleTarget } from '@angular/material/core';
  36. import { SelectionModel } from '@angular/cdk/collections';
  37. import { Subject } from 'rxjs';
  38. declare namespace i1 {
  39. export {
  40. MatLegacyChipListChange,
  41. MatLegacyChipList
  42. }
  43. }
  44. declare namespace i2 {
  45. export {
  46. MatLegacyChipEvent,
  47. MatLegacyChipSelectionChange,
  48. MAT_LEGACY_CHIP_REMOVE,
  49. MAT_LEGACY_CHIP_AVATAR,
  50. MAT_LEGACY_CHIP_TRAILING_ICON,
  51. MatLegacyChipAvatar,
  52. MatLegacyChipTrailingIcon,
  53. MatLegacyChip,
  54. MatLegacyChipRemove
  55. }
  56. }
  57. declare namespace i3 {
  58. export {
  59. MatLegacyChipInputEvent,
  60. MatLegacyChipInput
  61. }
  62. }
  63. /**
  64. * Injection token that can be used to reference instances of `MatChipAvatar`. It serves as
  65. * alternative token to the actual `MatChipAvatar` class which could cause unnecessary
  66. * retention of the class and its directive metadata.
  67. * @deprecated Use `MAT_CHIP_AVATAR` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  68. * @breaking-change 17.0.0
  69. */
  70. export declare const MAT_LEGACY_CHIP_AVATAR: InjectionToken<MatLegacyChipAvatar>;
  71. /**
  72. * Injection token that can be used to reference instances of `MatChipRemove`. It serves as
  73. * alternative token to the actual `MatChipRemove` class which could cause unnecessary
  74. * retention of the class and its directive metadata.
  75. * @deprecated Use `MAT_CHIP_REMOVE` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  76. * @breaking-change 17.0.0
  77. */
  78. export declare const MAT_LEGACY_CHIP_REMOVE: InjectionToken<MatLegacyChipRemove>;
  79. /**
  80. * Injection token that can be used to reference instances of `MatChipTrailingIcon`. It serves as
  81. * alternative token to the actual `MatChipTrailingIcon` class which could cause unnecessary
  82. * retention of the class and its directive metadata.
  83. * @deprecated Use `MAT_CHIP_TRAILING_ICON` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  84. * @breaking-change 17.0.0
  85. */
  86. export declare const MAT_LEGACY_CHIP_TRAILING_ICON: InjectionToken<MatLegacyChipTrailingIcon>;
  87. /**
  88. * Injection token to be used to override the default options for the chips module.
  89. * @deprecated Use `MAT_CHIPS_DEFAULT_OPTIONS` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  90. * @breaking-change 17.0.0
  91. */
  92. export declare const MAT_LEGACY_CHIPS_DEFAULT_OPTIONS: InjectionToken<MatLegacyChipsDefaultOptions>;
  93. /** @docs-private */
  94. declare abstract class MatChipBase {
  95. _elementRef: ElementRef;
  96. abstract disabled: boolean;
  97. constructor(_elementRef: ElementRef);
  98. }
  99. /** @docs-private */
  100. declare const _MatChipListBase: _Constructor<CanUpdateErrorState> & _AbstractConstructor<CanUpdateErrorState> & {
  101. new (_defaultErrorStateMatcher: ErrorStateMatcher, _parentForm: NgForm, _parentFormGroup: FormGroupDirective, ngControl: NgControl): {
  102. /**
  103. * Emits whenever the component state changes and should cause the parent
  104. * form-field to update. Implemented as part of `MatFormFieldControl`.
  105. * @docs-private
  106. */
  107. readonly stateChanges: Subject<void>;
  108. _defaultErrorStateMatcher: ErrorStateMatcher;
  109. _parentForm: NgForm;
  110. _parentFormGroup: FormGroupDirective;
  111. /**
  112. * Form control bound to the component.
  113. * Implemented as part of `MatFormFieldControl`.
  114. * @docs-private
  115. */
  116. ngControl: NgControl;
  117. };
  118. };
  119. declare const _MatChipMixinBase: _Constructor<HasTabIndex> & _AbstractConstructor<HasTabIndex> & _Constructor<CanColor> & _AbstractConstructor<CanColor> & _Constructor<CanDisableRipple> & _AbstractConstructor<CanDisableRipple> & typeof MatChipBase;
  120. /**
  121. * Material Design styled chip directive. Used inside the MatChipList component.
  122. * @deprecated Use `MatChip` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  123. * @breaking-change 17.0.0
  124. */
  125. export declare class MatLegacyChip extends _MatChipMixinBase implements FocusableOption, OnDestroy, CanColor, CanDisableRipple, RippleTarget, HasTabIndex, CanDisable {
  126. private _ngZone;
  127. private _changeDetectorRef;
  128. /** Reference to the RippleRenderer for the chip. */
  129. private _chipRipple;
  130. /**
  131. * Reference to the element that acts as the chip's ripple target. This element is
  132. * dynamically added as a child node of the chip. The chip itself cannot be used as the
  133. * ripple target because it must be the host of the focus indicator.
  134. */
  135. private _chipRippleTarget;
  136. /**
  137. * Ripple configuration for ripples that are launched on pointer down. The ripple config
  138. * is set to the global ripple options since we don't have any configurable options for
  139. * the chip ripples.
  140. * @docs-private
  141. */
  142. rippleConfig: RippleConfig & RippleGlobalOptions;
  143. /**
  144. * Whether ripples are disabled on interaction
  145. * @docs-private
  146. */
  147. get rippleDisabled(): boolean;
  148. /** Whether the chip has focus. */
  149. _hasFocus: boolean;
  150. /** Whether animations for the chip are enabled. */
  151. _animationsDisabled: boolean;
  152. /** Whether the chip list is selectable */
  153. chipListSelectable: boolean;
  154. /** Whether the chip list is in multi-selection mode. */
  155. _chipListMultiple: boolean;
  156. /** Whether the chip list as a whole is disabled. */
  157. _chipListDisabled: boolean;
  158. /** The chip avatar */
  159. avatar: MatLegacyChipAvatar;
  160. /** The chip's trailing icon. */
  161. trailingIcon: MatLegacyChipTrailingIcon;
  162. /** The chip's remove toggler. */
  163. removeIcon: MatLegacyChipRemove;
  164. /** ARIA role that should be applied to the chip. */
  165. role: string;
  166. /** Whether the chip is selected. */
  167. get selected(): boolean;
  168. set selected(value: BooleanInput);
  169. protected _selected: boolean;
  170. /** The value of the chip. Defaults to the content inside `<mat-chip>` tags. */
  171. get value(): any;
  172. set value(value: any);
  173. protected _value: any;
  174. /**
  175. * Whether or not the chip is selectable. When a chip is not selectable,
  176. * changes to its selected state are always ignored. By default a chip is
  177. * selectable, and it becomes non-selectable if its parent chip list is
  178. * not selectable.
  179. */
  180. get selectable(): boolean;
  181. set selectable(value: BooleanInput);
  182. protected _selectable: boolean;
  183. /** Whether the chip is disabled. */
  184. get disabled(): boolean;
  185. set disabled(value: BooleanInput);
  186. protected _disabled: boolean;
  187. /**
  188. * Determines whether or not the chip displays the remove styling and emits (removed) events.
  189. */
  190. get removable(): boolean;
  191. set removable(value: BooleanInput);
  192. protected _removable: boolean;
  193. /** Emits when the chip is focused. */
  194. readonly _onFocus: Subject<MatLegacyChipEvent>;
  195. /** Emits when the chip is blurred. */
  196. readonly _onBlur: Subject<MatLegacyChipEvent>;
  197. /** Emitted when the chip is selected or deselected. */
  198. readonly selectionChange: EventEmitter<MatLegacyChipSelectionChange>;
  199. /** Emitted when the chip is destroyed. */
  200. readonly destroyed: EventEmitter<MatLegacyChipEvent>;
  201. /** Emitted when a chip is to be removed. */
  202. readonly removed: EventEmitter<MatLegacyChipEvent>;
  203. /** The ARIA selected applied to the chip. */
  204. get ariaSelected(): string | null;
  205. constructor(elementRef: ElementRef<HTMLElement>, _ngZone: NgZone, platform: Platform, globalRippleOptions: RippleGlobalOptions | null, _changeDetectorRef: ChangeDetectorRef, _document: any, animationMode?: string, tabIndex?: string);
  206. _addHostClassName(): void;
  207. ngOnDestroy(): void;
  208. /** Selects the chip. */
  209. select(): void;
  210. /** Deselects the chip. */
  211. deselect(): void;
  212. /** Select this chip and emit selected event */
  213. selectViaInteraction(): void;
  214. /** Toggles the current selected state of this chip. */
  215. toggleSelected(isUserInput?: boolean): boolean;
  216. /** Allows for programmatic focusing of the chip. */
  217. focus(): void;
  218. /**
  219. * Allows for programmatic removal of the chip. Called by the MatChipList when the DELETE or
  220. * BACKSPACE keys are pressed.
  221. *
  222. * Informs any listeners of the removal request. Does not remove the chip from the DOM.
  223. */
  224. remove(): void;
  225. /** Handles click events on the chip. */
  226. _handleClick(event: Event): void;
  227. /** Handle custom key presses. */
  228. _handleKeydown(event: KeyboardEvent): void;
  229. _blur(): void;
  230. private _dispatchSelectionChange;
  231. static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyChip, [null, null, null, { optional: true; }, null, null, { optional: true; }, { attribute: "tabindex"; }]>;
  232. static ɵdir: i0.ɵɵDirectiveDeclaration<MatLegacyChip, "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", ["matChip"], { "color": { "alias": "color"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "role": { "alias": "role"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "value": { "alias": "value"; "required": false; }; "selectable": { "alias": "selectable"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "removable": { "alias": "removable"; "required": false; }; }, { "selectionChange": "selectionChange"; "destroyed": "destroyed"; "removed": "removed"; }, ["avatar", "trailingIcon", "removeIcon"], never, false, never>;
  233. }
  234. /**
  235. * Dummy directive to add CSS class to chip avatar.
  236. * @docs-private
  237. * @deprecated Use `MatChipAvatar` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  238. * @breaking-change 17.0.0
  239. */
  240. export declare class MatLegacyChipAvatar {
  241. static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyChipAvatar, never>;
  242. static ɵdir: i0.ɵɵDirectiveDeclaration<MatLegacyChipAvatar, "mat-chip-avatar, [matChipAvatar]", never, {}, {}, never, never, false, never>;
  243. }
  244. /**
  245. * Represents an event fired on an individual `mat-chip`.
  246. * @deprecated Use `MatChipEvent` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  247. * @breaking-change 17.0.0
  248. */
  249. export declare interface MatLegacyChipEvent {
  250. /** The chip the event was fired on. */
  251. chip: MatLegacyChip;
  252. }
  253. /**
  254. * Directive that adds chip-specific behaviors to an input element inside `<mat-form-field>`.
  255. * May be placed inside or outside of an `<mat-chip-list>`.
  256. * @deprecated Use `MatChipInput` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  257. * @breaking-change 17.0.0
  258. */
  259. export declare class MatLegacyChipInput implements MatLegacyChipTextControl, OnChanges, OnDestroy, AfterContentInit {
  260. protected _elementRef: ElementRef<HTMLInputElement>;
  261. /** Used to prevent focus moving to chips while user is holding backspace */
  262. private _focusLastChipOnBackspace;
  263. /** Whether the control is focused. */
  264. focused: boolean;
  265. _chipList: MatLegacyChipList;
  266. /** Register input for chip list */
  267. set chipList(value: MatLegacyChipList);
  268. /**
  269. * Whether or not the chipEnd event will be emitted when the input is blurred.
  270. */
  271. get addOnBlur(): boolean;
  272. set addOnBlur(value: BooleanInput);
  273. _addOnBlur: boolean;
  274. /**
  275. * The list of key codes that will trigger a chipEnd event.
  276. *
  277. * Defaults to `[ENTER]`.
  278. */
  279. separatorKeyCodes: readonly number[] | ReadonlySet<number>;
  280. /** Emitted when a chip is to be added. */
  281. readonly chipEnd: EventEmitter<MatLegacyChipInputEvent>;
  282. /** The input's placeholder text. */
  283. placeholder: string;
  284. /** Unique id for the input. */
  285. id: string;
  286. /** Whether the input is disabled. */
  287. get disabled(): boolean;
  288. set disabled(value: BooleanInput);
  289. private _disabled;
  290. /** Whether the input is empty. */
  291. get empty(): boolean;
  292. /** The native input element to which this directive is attached. */
  293. readonly inputElement: HTMLInputElement;
  294. constructor(_elementRef: ElementRef<HTMLInputElement>, defaultOptions: MatLegacyChipsDefaultOptions);
  295. ngOnChanges(): void;
  296. ngOnDestroy(): void;
  297. ngAfterContentInit(): void;
  298. /** Utility method to make host definition/tests more clear. */
  299. _keydown(event?: KeyboardEvent): void;
  300. /**
  301. * Pass events to the keyboard manager. Available here for tests.
  302. */
  303. _keyup(event: KeyboardEvent): void;
  304. /** Checks to see if the blur should emit the (chipEnd) event. */
  305. _blur(): void;
  306. _focus(): void;
  307. /** Checks to see if the (chipEnd) event needs to be emitted. */
  308. _emitChipEnd(event?: KeyboardEvent): void;
  309. _onInput(): void;
  310. /** Focuses the input. */
  311. focus(options?: FocusOptions): void;
  312. /** Clears the input */
  313. clear(): void;
  314. /** Checks whether a keycode is one of the configured separators. */
  315. private _isSeparatorKey;
  316. static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyChipInput, never>;
  317. static ɵdir: i0.ɵɵDirectiveDeclaration<MatLegacyChipInput, "input[matChipInputFor]", ["matChipInput", "matChipInputFor"], { "chipList": { "alias": "matChipInputFor"; "required": false; }; "addOnBlur": { "alias": "matChipInputAddOnBlur"; "required": false; }; "separatorKeyCodes": { "alias": "matChipInputSeparatorKeyCodes"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "id": { "alias": "id"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "chipEnd": "matChipInputTokenEnd"; }, never, never, false, never>;
  318. }
  319. /**
  320. * Represents an input event on a `matChipInput`.
  321. * @deprecated Use `MatChipInputEvent` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  322. * @breaking-change 17.0.0
  323. */
  324. export declare interface MatLegacyChipInputEvent {
  325. /**
  326. * The native `<input>` element that the event is being fired for.
  327. * @deprecated Use `MatChipInputEvent#chipInput.inputElement` instead.
  328. * @breaking-change 13.0.0 This property will be removed.
  329. */
  330. input: HTMLInputElement;
  331. /** The value of the input. */
  332. value: string;
  333. /** Reference to the chip input that emitted the event. */
  334. chipInput: MatLegacyChipInput;
  335. }
  336. /**
  337. * A material design chips component (named ChipList for its similarity to the List component).
  338. * @deprecated Use `MatChipList` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  339. * @breaking-change 17.0.0
  340. */
  341. export declare class MatLegacyChipList extends _MatChipListBase implements MatLegacyFormFieldControl<any>, ControlValueAccessor, AfterContentInit, DoCheck, OnInit, OnDestroy, CanUpdateErrorState {
  342. protected _elementRef: ElementRef<HTMLElement>;
  343. private _changeDetectorRef;
  344. private _dir;
  345. /**
  346. * Implemented as part of MatFormFieldControl.
  347. * @docs-private
  348. */
  349. readonly controlType: string;
  350. /**
  351. * When a chip is destroyed, we store the index of the destroyed chip until the chips
  352. * query list notifies about the update. This is necessary because we cannot determine an
  353. * appropriate chip that should receive focus until the array of chips updated completely.
  354. */
  355. private _lastDestroyedChipIndex;
  356. /** Subject that emits when the component has been destroyed. */
  357. private readonly _destroyed;
  358. /** Subscription to focus changes in the chips. */
  359. private _chipFocusSubscription;
  360. /** Subscription to blur changes in the chips. */
  361. private _chipBlurSubscription;
  362. /** Subscription to selection changes in chips. */
  363. private _chipSelectionSubscription;
  364. /** Subscription to remove changes in chips. */
  365. private _chipRemoveSubscription;
  366. /** The chip input to add more chips */
  367. protected _chipInput: MatLegacyChipTextControl;
  368. /** Uid of the chip list */
  369. _uid: string;
  370. /** Tab index for the chip list. */
  371. _tabIndex: number;
  372. /**
  373. * User defined tab index.
  374. * When it is not null, use user defined tab index. Otherwise use _tabIndex
  375. */
  376. _userTabIndex: number | null;
  377. /** The FocusKeyManager which handles focus. */
  378. _keyManager: FocusKeyManager<MatLegacyChip>;
  379. /** Function when touched */
  380. _onTouched: () => void;
  381. /** Function when changed */
  382. _onChange: (value: any) => void;
  383. _selectionModel: SelectionModel<MatLegacyChip>;
  384. /** The array of selected chips inside chip list. */
  385. get selected(): MatLegacyChip[] | MatLegacyChip;
  386. /** The ARIA role applied to the chip list. */
  387. get role(): string | null;
  388. set role(role: string | null);
  389. private _explicitRole?;
  390. /**
  391. * Implemented as part of MatFormFieldControl.
  392. * @docs-private
  393. */
  394. userAriaDescribedBy: string;
  395. /** An object used to control when error messages are shown. */
  396. errorStateMatcher: ErrorStateMatcher;
  397. /** Whether the user should be allowed to select multiple chips. */
  398. get multiple(): boolean;
  399. set multiple(value: BooleanInput);
  400. private _multiple;
  401. /**
  402. * A function to compare the option values with the selected values. The first argument
  403. * is a value from an option. The second is a value from the selection. A boolean
  404. * should be returned.
  405. */
  406. get compareWith(): (o1: any, o2: any) => boolean;
  407. set compareWith(fn: (o1: any, o2: any) => boolean);
  408. private _compareWith;
  409. /**
  410. * Implemented as part of MatFormFieldControl.
  411. * @docs-private
  412. */
  413. get value(): any;
  414. set value(value: any);
  415. protected _value: any;
  416. /**
  417. * Implemented as part of MatFormFieldControl.
  418. * @docs-private
  419. */
  420. get id(): string;
  421. /**
  422. * Implemented as part of MatFormFieldControl.
  423. * @docs-private
  424. */
  425. get required(): boolean;
  426. set required(value: BooleanInput);
  427. protected _required: boolean | undefined;
  428. /**
  429. * Implemented as part of MatFormFieldControl.
  430. * @docs-private
  431. */
  432. get placeholder(): string;
  433. set placeholder(value: string);
  434. protected _placeholder: string;
  435. /** Whether any chips or the matChipInput inside of this chip-list has focus. */
  436. get focused(): boolean;
  437. /**
  438. * Implemented as part of MatFormFieldControl.
  439. * @docs-private
  440. */
  441. get empty(): boolean;
  442. /**
  443. * Implemented as part of MatFormFieldControl.
  444. * @docs-private
  445. */
  446. get shouldLabelFloat(): boolean;
  447. /**
  448. * Implemented as part of MatFormFieldControl.
  449. * @docs-private
  450. */
  451. get disabled(): boolean;
  452. set disabled(value: BooleanInput);
  453. protected _disabled: boolean;
  454. /** Orientation of the chip list. */
  455. ariaOrientation: 'horizontal' | 'vertical';
  456. /**
  457. * Whether or not this chip list is selectable. When a chip list is not selectable,
  458. * the selected states for all the chips inside the chip list are always ignored.
  459. */
  460. get selectable(): boolean;
  461. set selectable(value: BooleanInput);
  462. protected _selectable: boolean;
  463. set tabIndex(value: number);
  464. /** Combined stream of all of the child chips' selection change events. */
  465. get chipSelectionChanges(): Observable<MatLegacyChipSelectionChange>;
  466. /** Combined stream of all of the child chips' focus change events. */
  467. get chipFocusChanges(): Observable<MatLegacyChipEvent>;
  468. /** Combined stream of all of the child chips' blur change events. */
  469. get chipBlurChanges(): Observable<MatLegacyChipEvent>;
  470. /** Combined stream of all of the child chips' remove change events. */
  471. get chipRemoveChanges(): Observable<MatLegacyChipEvent>;
  472. /** Event emitted when the selected chip list value has been changed by the user. */
  473. readonly change: EventEmitter<MatLegacyChipListChange>;
  474. /**
  475. * Event that emits whenever the raw value of the chip-list changes. This is here primarily
  476. * to facilitate the two-way binding for the `value` input.
  477. * @docs-private
  478. */
  479. readonly valueChange: EventEmitter<any>;
  480. /** The chips contained within this chip list. */
  481. chips: QueryList<MatLegacyChip>;
  482. constructor(_elementRef: ElementRef<HTMLElement>, _changeDetectorRef: ChangeDetectorRef, _dir: Directionality, _parentForm: NgForm, _parentFormGroup: FormGroupDirective, _defaultErrorStateMatcher: ErrorStateMatcher, ngControl: NgControl);
  483. ngAfterContentInit(): void;
  484. ngOnInit(): void;
  485. ngDoCheck(): void;
  486. ngOnDestroy(): void;
  487. /** Associates an HTML input element with this chip list. */
  488. registerInput(inputElement: MatLegacyChipTextControl): void;
  489. /**
  490. * Implemented as part of MatFormFieldControl.
  491. * @docs-private
  492. */
  493. setDescribedByIds(ids: string[]): void;
  494. writeValue(value: any): void;
  495. registerOnChange(fn: (value: any) => void): void;
  496. registerOnTouched(fn: () => void): void;
  497. setDisabledState(isDisabled: boolean): void;
  498. /**
  499. * Implemented as part of MatFormFieldControl.
  500. * @docs-private
  501. */
  502. onContainerClick(event: MouseEvent): void;
  503. /**
  504. * Focuses the first non-disabled chip in this chip list, or the associated input when there
  505. * are no eligible chips.
  506. */
  507. focus(options?: FocusOptions): void;
  508. /** Attempt to focus an input if we have one. */
  509. _focusInput(options?: FocusOptions): void;
  510. /**
  511. * Pass events to the keyboard manager. Available here for tests.
  512. */
  513. _keydown(event: KeyboardEvent): void;
  514. /**
  515. * Check the tab index as you should not be allowed to focus an empty list.
  516. */
  517. protected _updateTabIndex(): void;
  518. /**
  519. * If the amount of chips changed, we need to update the
  520. * key manager state and focus the next closest chip.
  521. */
  522. protected _updateFocusForDestroyedChips(): void;
  523. /**
  524. * Utility to ensure all indexes are valid.
  525. *
  526. * @param index The index to be checked.
  527. * @returns True if the index is valid for our list of chips.
  528. */
  529. private _isValidIndex;
  530. _setSelectionByValue(value: any, isUserInput?: boolean): void;
  531. /**
  532. * Finds and selects the chip based on its value.
  533. * @returns Chip that has the corresponding value.
  534. */
  535. private _selectValue;
  536. private _initializeSelection;
  537. /**
  538. * Deselects every chip in the list.
  539. * @param skip Chip that should not be deselected.
  540. */
  541. private _clearSelection;
  542. /**
  543. * Sorts the model values, ensuring that they keep the same
  544. * order that they have in the panel.
  545. */
  546. private _sortValues;
  547. /** Emits change event to set the model value. */
  548. private _propagateChanges;
  549. /** When blurred, mark the field as touched when focus moved outside the chip list. */
  550. _blur(): void;
  551. /** Mark the field as touched */
  552. _markAsTouched(): void;
  553. /**
  554. * Removes the `tabindex` from the chip list and resets it back afterwards, allowing the
  555. * user to tab out of it. This prevents the list from capturing focus and redirecting
  556. * it back to the first chip, creating a focus trap, if it user tries to tab away.
  557. */
  558. _allowFocusEscape(): void;
  559. private _resetChips;
  560. private _dropSubscriptions;
  561. /** Listens to user-generated selection events on each chip. */
  562. private _listenToChipsSelection;
  563. /** Listens to user-generated selection events on each chip. */
  564. private _listenToChipsFocus;
  565. private _listenToChipsRemoved;
  566. /** Checks whether an event comes from inside a chip element. */
  567. private _originatesFromChip;
  568. /** Checks whether any of the chips is focused. */
  569. private _hasFocusedChip;
  570. /** Syncs the list's state with the individual chips. */
  571. private _syncChipsState;
  572. static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyChipList, [null, null, { optional: true; }, { optional: true; }, { optional: true; }, null, { optional: true; self: true; }]>;
  573. static ɵcmp: i0.ɵɵComponentDeclaration<MatLegacyChipList, "mat-chip-list", ["matChipList"], { "role": { "alias": "role"; "required": false; }; "userAriaDescribedBy": { "alias": "aria-describedby"; "required": false; }; "errorStateMatcher": { "alias": "errorStateMatcher"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "compareWith": { "alias": "compareWith"; "required": false; }; "value": { "alias": "value"; "required": false; }; "required": { "alias": "required"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "ariaOrientation": { "alias": "aria-orientation"; "required": false; }; "selectable": { "alias": "selectable"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; }, { "change": "change"; "valueChange": "valueChange"; }, ["chips"], ["*"], false, never>;
  574. }
  575. /**
  576. * Change event object that is emitted when the chip list value has changed.
  577. * @deprecated Use `MatChipListChange` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  578. * @breaking-change 17.0.0
  579. */
  580. export declare class MatLegacyChipListChange {
  581. /** Chip list that emitted the event. */
  582. source: MatLegacyChipList;
  583. /** Value of the chip list when the event was emitted. */
  584. value: any;
  585. constructor(
  586. /** Chip list that emitted the event. */
  587. source: MatLegacyChipList,
  588. /** Value of the chip list when the event was emitted. */
  589. value: any);
  590. }
  591. /**
  592. * Applies proper (click) support and adds styling for use with the Material Design "cancel" icon
  593. * available at https://material.io/icons/#ic_cancel.
  594. *
  595. * Example:
  596. *
  597. * `<mat-chip>
  598. * <mat-icon matChipRemove>cancel</mat-icon>
  599. * </mat-chip>`
  600. *
  601. * You *may* use a custom icon, but you may need to override the `mat-chip-remove` positioning
  602. * styles to properly center the icon within the chip.
  603. *
  604. * @deprecated Use `MatChipRemove` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  605. * @breaking-change 17.0.0
  606. */
  607. export declare class MatLegacyChipRemove {
  608. protected _parentChip: MatLegacyChip;
  609. constructor(_parentChip: MatLegacyChip, elementRef: ElementRef<HTMLElement>);
  610. /** Calls the parent chip's public `remove()` method if applicable. */
  611. _handleClick(event: Event): void;
  612. static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyChipRemove, never>;
  613. static ɵdir: i0.ɵɵDirectiveDeclaration<MatLegacyChipRemove, "[matChipRemove]", never, {}, {}, never, never, false, never>;
  614. }
  615. /**
  616. * Default options, for the chips module, that can be overridden.
  617. * @deprecated Use `MatChipsDefaultOptions` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  618. * @breaking-change 17.0.0
  619. */
  620. export declare interface MatLegacyChipsDefaultOptions {
  621. /** The list of key codes that will trigger a chipEnd event. */
  622. separatorKeyCodes: readonly number[] | ReadonlySet<number>;
  623. }
  624. /**
  625. * Event object emitted by MatChip when selected or deselected.
  626. * @deprecated Use `MatChipSelectionChange` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  627. * @breaking-change 17.0.0
  628. */
  629. export declare class MatLegacyChipSelectionChange {
  630. /** Reference to the chip that emitted the event. */
  631. source: MatLegacyChip;
  632. /** Whether the chip that emitted the event is selected. */
  633. selected: boolean;
  634. /** Whether the selection change was a result of a user interaction. */
  635. isUserInput: boolean;
  636. constructor(
  637. /** Reference to the chip that emitted the event. */
  638. source: MatLegacyChip,
  639. /** Whether the chip that emitted the event is selected. */
  640. selected: boolean,
  641. /** Whether the selection change was a result of a user interaction. */
  642. isUserInput?: boolean);
  643. }
  644. /**
  645. * @deprecated Use `MatChipsModule` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  646. * @breaking-change 17.0.0
  647. */
  648. export declare class MatLegacyChipsModule {
  649. static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyChipsModule, never>;
  650. static ɵmod: i0.ɵɵNgModuleDeclaration<MatLegacyChipsModule, [typeof i1.MatLegacyChipList, typeof i2.MatLegacyChip, typeof i3.MatLegacyChipInput, typeof i2.MatLegacyChipRemove, typeof i2.MatLegacyChipAvatar, typeof i2.MatLegacyChipTrailingIcon], [typeof i4.MatCommonModule], [typeof i1.MatLegacyChipList, typeof i2.MatLegacyChip, typeof i3.MatLegacyChipInput, typeof i2.MatLegacyChipRemove, typeof i2.MatLegacyChipAvatar, typeof i2.MatLegacyChipTrailingIcon]>;
  651. static ɵinj: i0.ɵɵInjectorDeclaration<MatLegacyChipsModule>;
  652. }
  653. /**
  654. * Interface for a text control that is used to drive interaction with a mat-chip-list.
  655. * @deprecated Use `MatChipTextControl` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  656. * @breaking-change 17.0.0
  657. */
  658. declare interface MatLegacyChipTextControl {
  659. /** Unique identifier for the text control. */
  660. id: string;
  661. /** The text control's placeholder text. */
  662. placeholder: string;
  663. /** Whether the text control has browser focus. */
  664. focused: boolean;
  665. /** Whether the text control is empty. */
  666. empty: boolean;
  667. /** Focuses the text control. */
  668. focus(options?: FocusOptions): void;
  669. }
  670. /**
  671. * Dummy directive to add CSS class to chip trailing icon.
  672. * @docs-private
  673. * @deprecated Use `MatChipTrailingIcon` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  674. * @breaking-change 17.0.0
  675. */
  676. export declare class MatLegacyChipTrailingIcon {
  677. static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyChipTrailingIcon, never>;
  678. static ɵdir: i0.ɵɵDirectiveDeclaration<MatLegacyChipTrailingIcon, "mat-chip-trailing-icon, [matChipTrailingIcon]", never, {}, {}, never, never, false, never>;
  679. }
  680. export { }