Skip to content

Commit 2cadc90

Browse files
committed
fix(material/legacy-chips): deprecate all ts symbols
1 parent ab22cab commit 2cadc90

16 files changed

+164
-51
lines changed

src/material/legacy-chips/chip-default-options.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,21 @@
88

99
import {InjectionToken} from '@angular/core';
1010

11-
/** Default options, for the chips module, that can be overridden. */
11+
/**
12+
* Default options, for the chips module, that can be overridden.
13+
* @deprecated Use `MatChipsDefaultOptions` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
14+
* @breaking-change 17.0.0
15+
*/
1216
export interface MatLegacyChipsDefaultOptions {
1317
/** The list of key codes that will trigger a chipEnd event. */
1418
separatorKeyCodes: readonly number[] | ReadonlySet<number>;
1519
}
1620

17-
/** Injection token to be used to override the default options for the chips module. */
21+
/**
22+
* Injection token to be used to override the default options for the chips module.
23+
* @deprecated Use `MAT_CHIPS_DEFAULT_OPTIONS` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
24+
* @breaking-change 17.0.0
25+
*/
1826
export const MAT_LEGACY_CHIPS_DEFAULT_OPTIONS = new InjectionToken<MatLegacyChipsDefaultOptions>(
1927
'mat-chips-default-options',
2028
);

src/material/legacy-chips/chip-input.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ import {
2626
import {MatLegacyChipList} from './chip-list';
2727
import {MatLegacyChipTextControl} from './chip-text-control';
2828

29-
/** Represents an input event on a `matChipInput`. */
29+
/**
30+
* Represents an input event on a `matChipInput`.
31+
* @deprecated Use `MatChipInputEvent` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
32+
* @breaking-change 17.0.0
33+
*/
3034
export interface MatLegacyChipInputEvent {
3135
/**
3236
* The native `<input>` element that the event is being fired for.
@@ -48,6 +52,8 @@ let nextUniqueId = 0;
4852
/**
4953
* Directive that adds chip-specific behaviors to an input element inside `<mat-form-field>`.
5054
* May be placed inside or outside of an `<mat-chip-list>`.
55+
* @deprecated Use `MatChipInput` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
56+
* @breaking-change 17.0.0
5157
*/
5258
@Directive({
5359
selector: 'input[matChipInputFor]',

src/material/legacy-chips/chip-list.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ const _MatChipListBase = mixinErrorState(
7070
// Increasing integer for generating unique ids for chip-list components.
7171
let nextUniqueId = 0;
7272

73-
/** Change event object that is emitted when the chip list value has changed. */
73+
/**
74+
* Change event object that is emitted when the chip list value has changed.
75+
* @deprecated Use `MatChipListChange` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
76+
* @breaking-change 17.0.0
77+
*/
7478
export class MatLegacyChipListChange {
7579
constructor(
7680
/** Chip list that emitted the event. */
@@ -82,6 +86,8 @@ export class MatLegacyChipListChange {
8286

8387
/**
8488
* A material design chips component (named ChipList for its similarity to the List component).
89+
* @deprecated Use `MatChipList` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
90+
* @breaking-change 17.0.0
8591
*/
8692
@Component({
8793
selector: 'mat-chip-list',

src/material/legacy-chips/chip-text-control.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
/** Interface for a text control that is used to drive interaction with a mat-chip-list. */
9+
/**
10+
* Interface for a text control that is used to drive interaction with a mat-chip-list.
11+
* @deprecated Use `MatChipTextControl` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
12+
* @breaking-change 17.0.0
13+
*/
1014
export interface MatLegacyChipTextControl {
1115
/** Unique identifier for the text control. */
1216
id: string;

src/material/legacy-chips/chip.ts

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,21 @@ import {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';
4444
import {Subject} from 'rxjs';
4545
import {take} from 'rxjs/operators';
4646

47-
/** Represents an event fired on an individual `mat-chip`. */
47+
/**
48+
* Represents an event fired on an individual `mat-chip`.
49+
* @deprecated Use `MatChipEvent` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
50+
* @breaking-change 17.0.0
51+
*/
4852
export interface MatLegacyChipEvent {
4953
/** The chip the event was fired on. */
5054
chip: MatLegacyChip;
5155
}
5256

53-
/** Event object emitted by MatChip when selected or deselected. */
57+
/**
58+
* Event object emitted by MatChip when selected or deselected.
59+
* @deprecated Use `MatChipSelectionChange` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
60+
* @breaking-change 17.0.0
61+
*/
5462
export class MatLegacyChipSelectionChange {
5563
constructor(
5664
/** Reference to the chip that emitted the event. */
@@ -66,20 +74,26 @@ export class MatLegacyChipSelectionChange {
6674
* Injection token that can be used to reference instances of `MatChipRemove`. It serves as
6775
* alternative token to the actual `MatChipRemove` class which could cause unnecessary
6876
* retention of the class and its directive metadata.
77+
* @deprecated Use `MAT_CHIP_REMOVE` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
78+
* @breaking-change 17.0.0
6979
*/
7080
export const MAT_LEGACY_CHIP_REMOVE = new InjectionToken<MatLegacyChipRemove>('MatChipRemove');
7181

7282
/**
7383
* Injection token that can be used to reference instances of `MatChipAvatar`. It serves as
7484
* alternative token to the actual `MatChipAvatar` class which could cause unnecessary
7585
* retention of the class and its directive metadata.
86+
* @deprecated Use `MAT_CHIP_AVATAR` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
87+
* @breaking-change 17.0.0
7688
*/
7789
export const MAT_LEGACY_CHIP_AVATAR = new InjectionToken<MatLegacyChipAvatar>('MatChipAvatar');
7890

7991
/**
8092
* Injection token that can be used to reference instances of `MatChipTrailingIcon`. It serves as
8193
* alternative token to the actual `MatChipTrailingIcon` class which could cause unnecessary
8294
* retention of the class and its directive metadata.
95+
* @deprecated Use `MAT_CHIP_TRAILING_ICON` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
96+
* @breaking-change 17.0.0
8397
*/
8498
export const MAT_LEGACY_CHIP_TRAILING_ICON = new InjectionToken<MatLegacyChipTrailingIcon>(
8599
'MatChipTrailingIcon',
@@ -97,6 +111,8 @@ const _MatChipMixinBase = mixinTabIndex(mixinColor(mixinDisableRipple(MatChipBas
97111
/**
98112
* Dummy directive to add CSS class to chip avatar.
99113
* @docs-private
114+
* @deprecated Use `MatChipAvatar` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
115+
* @breaking-change 17.0.0
100116
*/
101117
@Directive({
102118
selector: 'mat-chip-avatar, [matChipAvatar]',
@@ -108,6 +124,8 @@ export class MatLegacyChipAvatar {}
108124
/**
109125
* Dummy directive to add CSS class to chip trailing icon.
110126
* @docs-private
127+
* @deprecated Use `MatChipTrailingIcon` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
128+
* @breaking-change 17.0.0
111129
*/
112130
@Directive({
113131
selector: 'mat-chip-trailing-icon, [matChipTrailingIcon]',
@@ -116,7 +134,11 @@ export class MatLegacyChipAvatar {}
116134
})
117135
export class MatLegacyChipTrailingIcon {}
118136

119-
/** Material Design styled chip directive. Used inside the MatChipList component. */
137+
/**
138+
* Material Design styled chip directive. Used inside the MatChipList component.
139+
* @deprecated Use `MatChip` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
140+
* @breaking-change 17.0.0
141+
*/
120142
@Directive({
121143
selector: `mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]`,
122144
inputs: ['color', 'disableRipple', 'tabIndex'],
@@ -470,6 +492,9 @@ export class MatLegacyChip
470492
*
471493
* You *may* use a custom icon, but you may need to override the `mat-chip-remove` positioning
472494
* styles to properly center the icon within the chip.
495+
*
496+
* @deprecated Use `MatChipRemove` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
497+
* @breaking-change 17.0.0
473498
*/
474499
@Directive({
475500
selector: '[matChipRemove]',

src/material/legacy-chips/chips-module.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ const CHIP_DECLARATIONS = [
3131
MatLegacyChipTrailingIcon,
3232
];
3333

34+
/**
35+
* @deprecated Use `MatChipsModule` from `@angular/material/chips` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
36+
* @breaking-change 17.0.0
37+
*/
3438
@NgModule({
3539
imports: [MatCommonModule],
3640
exports: CHIP_DECLARATIONS,

src/material/legacy-chips/testing/chip-avatar-harness.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
import {HarnessPredicate, ComponentHarness} from '@angular/cdk/testing';
1010
import {LegacyChipAvatarHarnessFilters} from './chip-harness-filters';
1111

12-
/** Harness for interacting with a standard Material chip avatar in tests. */
12+
/**
13+
* Harness for interacting with a standard Material chip avatar in tests.
14+
* @deprecated Use `MatChipAvatarHarness` from `@angular/material/chips/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
15+
* @breaking-change 17.0.0
16+
*/
1317
export class MatLegacyChipAvatarHarness extends ComponentHarness {
1418
static hostSelector = '.mat-chip-avatar';
1519

src/material/legacy-chips/testing/chip-harness-filters.ts

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
*/
88
import {BaseHarnessFilters} from '@angular/cdk/testing';
99

10-
/** A set of criteria that can be used to filter a list of chip instances. */
10+
/**
11+
* A set of criteria that can be used to filter a list of chip instances.
12+
* @deprecated Use `ChipHarnessFilters` from `@angular/material/chips/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
13+
* @breaking-change 17.0.0
14+
*/
1115
export interface LegacyChipHarnessFilters extends BaseHarnessFilters {
1216
/** Only find instances whose text matches the given value. */
1317
text?: string | RegExp;
@@ -19,28 +23,52 @@ export interface LegacyChipHarnessFilters extends BaseHarnessFilters {
1923
selected?: boolean;
2024
}
2125

22-
/** A set of criteria that can be used to filter a list of selectable chip instances. */
26+
/**
27+
* A set of criteria that can be used to filter a list of selectable chip instances.
28+
* @deprecated Use `ChipOptionHarnessFilters` from `@angular/material/chips/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
29+
* @breaking-change 17.0.0
30+
*/
2331
export interface LegacyChipOptionHarnessFilters extends LegacyChipHarnessFilters {
2432
/** Only find chip instances whose selected state matches the given value. */
2533
selected?: boolean;
2634
}
2735

28-
/** A set of criteria that can be used to filter chip list instances. */
36+
/**
37+
* A set of criteria that can be used to filter chip list instances.
38+
* @deprecated Use `ChipListHarnessFilters` from `@angular/material/chips/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
39+
* @breaking-change 17.0.0
40+
*/
2941
export interface LegacyChipListHarnessFilters extends BaseHarnessFilters {}
3042

31-
/** A set of criteria that can be used to filter selectable chip list instances. */
43+
/**
44+
* A set of criteria that can be used to filter selectable chip list instances.
45+
* @deprecated Use `ChipListboxHarnessFilters` from `@angular/material/chips/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
46+
* @breaking-change 17.0.0
47+
*/
3248
export interface LegacyChipListboxHarnessFilters extends BaseHarnessFilters {}
3349

34-
/** A set of criteria that can be used to filter a list of `MatChipListInputHarness` instances. */
50+
/**
51+
* A set of criteria that can be used to filter a list of `MatChipListInputHarness` instances.
52+
* @deprecated Use `ChipInputHarnessFilters` from `@angular/material/chips/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
53+
* @breaking-change 17.0.0
54+
*/
3555
export interface LegacyChipInputHarnessFilters extends BaseHarnessFilters {
3656
/** Filters based on the value of the input. */
3757
value?: string | RegExp;
3858
/** Filters based on the placeholder text of the input. */
3959
placeholder?: string | RegExp;
4060
}
4161

42-
/** A set of criteria that can be used to filter a list of `MatChipRemoveHarness` instances. */
62+
/**
63+
* A set of criteria that can be used to filter a list of `MatChipRemoveHarness` instances.
64+
* @deprecated Use `ChipRemoveHarnessFilters` from `@angular/material/chips/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
65+
* @breaking-change 17.0.0
66+
*/
4367
export interface LegacyChipRemoveHarnessFilters extends BaseHarnessFilters {}
4468

45-
/** A set of criteria that can be used to filter a list of `MatChipAvatarHarness` instances. */
69+
/**
70+
* A set of criteria that can be used to filter a list of `MatChipAvatarHarness` instances.
71+
* @deprecated Use `ChipAvatarHarnessFilters` from `@angular/material/chips/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
72+
* @breaking-change 17.0.0
73+
*/
4674
export interface LegacyChipAvatarHarnessFilters extends BaseHarnessFilters {}

src/material/legacy-chips/testing/chip-harness.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ import {
1515
} from './chip-harness-filters';
1616
import {MatLegacyChipRemoveHarness} from './chip-remove-harness';
1717

18-
/** Harness for interacting with a standard selectable Angular Material chip in tests. */
18+
/**
19+
* Harness for interacting with a standard selectable Angular Material chip in tests.
20+
* @deprecated Use `MatChipHarness` from `@angular/material/chips/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
21+
* @breaking-change 17.0.0
22+
*/
1923
export class MatLegacyChipHarness extends ContentContainerComponentHarness {
2024
/** The selector for the host element of a `MatChip` instance. */
2125
static hostSelector = '.mat-chip';

src/material/legacy-chips/testing/chip-input-harness.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
import {HarnessPredicate, ComponentHarness, TestKey} from '@angular/cdk/testing';
1010
import {LegacyChipInputHarnessFilters} from './chip-harness-filters';
1111

12-
/** Harness for interacting with a standard Material chip inputs in tests. */
12+
/**
13+
* Harness for interacting with a standard Material chip inputs in tests.
14+
* @deprecated Use `MatChipInputHarness` from `@angular/material/chips/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
15+
* @breaking-change 17.0.0
16+
*/
1317
export class MatLegacyChipInputHarness extends ComponentHarness {
1418
static hostSelector = '.mat-chip-input';
1519

0 commit comments

Comments
 (0)