Skip to content

Commit d527ddf

Browse files
committed
fix(material/legacy-form-field): deprecate all ts symbols
1 parent 5afe24d commit d527ddf

File tree

12 files changed

+135
-27
lines changed

12 files changed

+135
-27
lines changed

src/material/legacy-form-field/error.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ import {MAT_ERROR} from '@angular/material/form-field';
1111

1212
let nextUniqueId = 0;
1313

14-
/** Single error message to be shown underneath the form field. */
14+
/**
15+
* Single error message to be shown underneath the form field.
16+
* @deprecated Use `MatError` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
17+
* @breaking-change 17.0.0
18+
*/
1519
@Directive({
1620
selector: 'mat-error',
1721
host: {

src/material/legacy-form-field/form-field-module.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ import {MatLegacyPlaceholder} from './placeholder';
1818
import {MatLegacyPrefix} from './prefix';
1919
import {MatLegacySuffix} from './suffix';
2020

21+
/**
22+
* @deprecated Use `MatFormFieldModule` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
23+
* @breaking-change 17.0.0
24+
*/
2125
@NgModule({
2226
declarations: [
2327
MatLegacyError,

src/material/legacy-form-field/form-field.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,25 @@ const _MatFormFieldBase = mixinColor(
6767
'primary',
6868
);
6969

70-
/** Possible appearance styles for the form field. */
70+
/**
71+
* Possible appearance styles for the form field.
72+
* @deprecated Use `MatFormFieldAppearance` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
73+
* @breaking-change 17.0.0
74+
*/
7175
export type MatLegacyFormFieldAppearance = 'legacy' | 'standard' | 'fill' | 'outline';
7276

73-
/** Possible values for the "floatLabel" form field input. */
77+
/**
78+
* Possible values for the "floatLabel" form field input.
79+
* @deprecated Use `FloatLabelType` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
80+
* @breaking-change 17.0.0
81+
*/
7482
export type LegacyFloatLabelType = 'always' | 'never' | 'auto';
7583

7684
/**
7785
* Represents the default options for the form field that can be configured
7886
* using the `MAT_FORM_FIELD_DEFAULT_OPTIONS` injection token.
87+
* @deprecated Use `MatFormFieldDefaultOptions` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
88+
* @breaking-change 17.0.0
7989
*/
8090
export interface MatLegacyFormFieldDefaultOptions {
8191
/** Default form field appearance style. */
@@ -94,11 +104,17 @@ export interface MatLegacyFormFieldDefaultOptions {
94104
/**
95105
* Injection token that can be used to configure the
96106
* default options for all form field within an app.
107+
* @deprecated Use `MAT_FORM_FIELD_DEFAULT_OPTIONS` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
108+
* @breaking-change 17.0.0
97109
*/
98110
export const MAT_LEGACY_FORM_FIELD_DEFAULT_OPTIONS =
99111
new InjectionToken<MatLegacyFormFieldDefaultOptions>('MAT_FORM_FIELD_DEFAULT_OPTIONS');
100112

101-
/** Container for form controls that applies Material Design styling and behavior. */
113+
/**
114+
* Container for form controls that applies Material Design styling and behavior.
115+
* @deprecated Use `MatFormField` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
116+
* @breaking-change 17.0.0
117+
*/
102118
@Component({
103119
selector: 'mat-form-field',
104120
exportAs: 'matFormField',

src/material/legacy-form-field/hint.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,17 @@ let nextUniqueId = 0;
1717
*
1818
* *Note*: This is not part of the public API as the MDC-based form-field will not
1919
* need a lightweight token for `MatHint` and we want to reduce breaking changes.
20+
*
21+
* @deprecated Use `_MAT_HINT` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
22+
* @breaking-change 17.0.0
2023
*/
2124
export const _MAT_LEGACY_HINT = new InjectionToken<MatLegacyHint>('MatHint');
2225

23-
/** Hint text to be shown underneath the form field control. */
26+
/**
27+
* Hint text to be shown underneath the form field control.
28+
* @deprecated Use `MatHint` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
29+
* @breaking-change 17.0.0
30+
*/
2431
@Directive({
2532
selector: 'mat-hint',
2633
host: {

src/material/legacy-form-field/label.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88

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

11-
/** The floating label for a `mat-form-field`. */
11+
/**
12+
* The floating label for a `mat-form-field`.
13+
* @deprecated Use `MatLabel` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
14+
* @breaking-change 17.0.0
15+
*/
1216
@Directive({
1317
selector: 'mat-label',
1418
})

src/material/legacy-form-field/prefix.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
import {Directive} from '@angular/core';
1010
import {MAT_PREFIX} from '@angular/material/form-field';
1111

12-
/** Prefix to be placed in front of the form field. */
12+
/**
13+
* Prefix to be placed in front of the form field.
14+
* @deprecated Use `MatPrefix` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
15+
* @breaking-change 17.0.0
16+
*/
1317
@Directive({
1418
selector: '[matPrefix]',
1519
providers: [{provide: MAT_PREFIX, useExisting: MatLegacyPrefix}],

src/material/legacy-form-field/public-api.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,57 @@ export {MatLegacySuffix} from './suffix';
2222
export {MatLegacyLabel} from './label';
2323

2424
export {
25+
/**
26+
* @deprecated Use `MAT_FORM_FIELD` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
27+
* @breaking-change 17.0.0
28+
*/
2529
MAT_FORM_FIELD as MAT_LEGACY_FORM_FIELD,
30+
31+
/**
32+
* @deprecated Use `MatFormFieldControl` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
33+
* @breaking-change 17.0.0
34+
*/
2635
MatFormFieldControl as MatLegacyFormFieldControl,
36+
37+
/**
38+
* @deprecated Use `getMatFormFieldDuplicatedHintError` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
39+
* @breaking-change 17.0.0
40+
*/
2741
getMatFormFieldDuplicatedHintError as getMatLegacyFormFieldDuplicatedHintError,
42+
43+
/**
44+
* @deprecated Use `getMatFormFieldMissingControlError` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
45+
* @breaking-change 17.0.0
46+
*/
2847
getMatFormFieldMissingControlError as getMatLegacyFormFieldMissingControlError,
48+
49+
/**
50+
* @deprecated Use `getMatFormFieldPlaceholderConflictError` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
51+
* @breaking-change 17.0.0
52+
*/
2953
getMatFormFieldPlaceholderConflictError as getMatLegacyFormFieldPlaceholderConflictError,
54+
55+
/**
56+
* @deprecated Use `matFormFieldAnimations` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
57+
* @breaking-change 17.0.0
58+
*/
3059
matFormFieldAnimations as matLegacyFormFieldAnimations,
60+
61+
/**
62+
* @deprecated Use `MAT_SUFFIX` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
63+
* @breaking-change 17.0.0
64+
*/
3165
MAT_SUFFIX as MAT_LEGACY_SUFFIX,
66+
67+
/**
68+
* @deprecated Use `MAT_ERROR` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
69+
* @breaking-change 17.0.0
70+
*/
3271
MAT_ERROR as MAT_LEGACY_ERROR,
72+
73+
/**
74+
* @deprecated Use `MAT_PREFIX` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
75+
* @breaking-change 17.0.0
76+
*/
3377
MAT_PREFIX as MAT_LEGACY_PREFIX,
3478
} from '@angular/material/form-field';

src/material/legacy-form-field/suffix.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
import {Directive} from '@angular/core';
1010
import {MAT_SUFFIX} from '@angular/material/form-field';
1111

12-
/** Suffix to be placed at the end of the form field. */
12+
/**
13+
* Suffix to be placed at the end of the form field.
14+
* @deprecated Use `MatSuffix` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
15+
* @breaking-change 17.0.0
16+
*/
1317
@Directive({
1418
selector: '[matSuffix]',
1519
providers: [{provide: MAT_SUFFIX, useExisting: MatLegacySuffix}],

src/material/legacy-form-field/testing/form-field-harness.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,22 @@ import {MatLegacyInputHarness} from '@angular/material/legacy-input/testing';
1919
import {MatLegacySelectHarness} from '@angular/material/legacy-select/testing';
2020

2121
// TODO(devversion): support support chip list harness
22-
/** Possible harnesses of controls which can be bound to a form-field. */
22+
/**
23+
* Possible harnesses of controls which can be bound to a form-field.
24+
* @deprecated Use `FormFieldControlHarness` from `@angular/material/form-field/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
25+
* @breaking-change 17.0.0
26+
*/
2327
export type LegacyFormFieldControlHarness =
2428
| MatLegacyInputHarness
2529
| MatLegacySelectHarness
2630
| MatDatepickerInputHarness
2731
| MatDateRangeInputHarness;
2832

29-
/** Harness for interacting with a standard Material form-field's in tests. */
33+
/**
34+
* Harness for interacting with a standard Material form-field's in tests.
35+
* @deprecated Use `MatFormFieldHarness` from `@angular/material/form-field/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
36+
* @breaking-change 17.0.0
37+
*/
3038
export class MatLegacyFormFieldHarness extends _MatFormFieldHarnessBase<LegacyFormFieldControlHarness> {
3139
static hostSelector = '.mat-form-field';
3240

src/material/legacy-form-field/testing/public-api.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,23 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9+
export {LegacyFormFieldControlHarness, MatLegacyFormFieldHarness} from './form-field-harness';
10+
911
// Re-export the base control harness from the "form-field/testing/control" entry-point. To
1012
// avoid circular dependencies, harnesses for form-field controls (i.e. input, select)
1113
// need to import the base form-field control harness through a separate entry-point.
12-
export {MatFormFieldControlHarness as MatLegacyFormFieldControlHarness} from '@angular/material/form-field/testing/control';
14+
export {
15+
/**
16+
* @deprecated Use `MatFormFieldControlHarness` from `@angular/material/form-field/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
17+
* @breaking-change 17.0.0
18+
*/
19+
MatFormFieldControlHarness as MatLegacyFormFieldControlHarness,
20+
} from '@angular/material/form-field/testing/control';
1321

14-
export {LegacyFormFieldControlHarness, MatLegacyFormFieldHarness} from './form-field-harness';
15-
export {FormFieldHarnessFilters as LegacyFormFieldHarnessFilters} from '@angular/material/form-field/testing';
22+
export {
23+
/**
24+
* @deprecated Use `FormFieldHarnessFilters` from `@angular/material/form-field/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
25+
* @breaking-change 17.0.0
26+
*/
27+
FormFieldHarnessFilters as LegacyFormFieldHarnessFilters,
28+
} from '@angular/material/form-field/testing';

0 commit comments

Comments
 (0)