Skip to content

Commit 4bb3554

Browse files
committed
fix(material/legacy-select): deprecate all ts symbols
1 parent bbb9130 commit 4bb3554

File tree

9 files changed

+100
-20
lines changed

9 files changed

+100
-20
lines changed

src/material/legacy-select/public-api.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,39 @@ export {matLegacySelectAnimations} from './select-animations';
1111
export {MatLegacySelectChange, MatLegacySelect, MatLegacySelectTrigger} from './select';
1212

1313
export {
14+
/**
15+
* @deprecated Use `MAT_SELECT_CONFIG` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
16+
* @breaking-change 17.0.0
17+
*/
1418
MAT_SELECT_CONFIG as MAT_LEGACY_SELECT_CONFIG,
19+
20+
/**
21+
* @deprecated Use `MAT_SELECT_SCROLL_STRATEGY` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
22+
* @breaking-change 17.0.0
23+
*/
1524
MAT_SELECT_SCROLL_STRATEGY as MAT_LEGACY_SELECT_SCROLL_STRATEGY,
25+
26+
/**
27+
* @deprecated Use `MAT_SELECT_SCROLL_STRATEGY_PROVIDER` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
28+
* @breaking-change 17.0.0
29+
*/
1630
MAT_SELECT_SCROLL_STRATEGY_PROVIDER as MAT_LEGACY_SELECT_SCROLL_STRATEGY_PROVIDER,
31+
32+
/**
33+
* @deprecated Use `MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
34+
* @breaking-change 17.0.0
35+
*/
1736
MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY as MAT_LEGACY_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY,
37+
38+
/**
39+
* @deprecated Use `MAT_SELECT_TRIGGER` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
40+
* @breaking-change 17.0.0
41+
*/
1842
MAT_SELECT_TRIGGER as MAT_LEGACY_SELECT_TRIGGER,
43+
44+
/**
45+
* @deprecated Use `MatSelectConfig` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
46+
* @breaking-change 17.0.0
47+
*/
1948
MatSelectConfig as MatLegacySelectConfig,
2049
} from '@angular/material/select';

src/material/legacy-select/select-animations.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import {
2323
*
2424
* The values below match the implementation of the AngularJS Material mat-select animation.
2525
* @docs-private
26+
* @deprecated Use `matSelectAnimations` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
27+
* @breaking-change 17.0.0
2628
*/
2729
export const matLegacySelectAnimations: {
2830
readonly transformPanelWrap: AnimationTriggerMetadata;

src/material/legacy-select/select-errors.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* Returns an exception to be thrown when attempting to change a select's `multiple` option
1111
* after initialization.
1212
* @docs-private
13+
* @deprecated Use `getMatSelectDynamicMultipleError` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
14+
* @breaking-change 17.0.0
1315
*/
1416
export function getMatSelectDynamicMultipleError(): Error {
1517
return Error('Cannot change `multiple` mode of select after initialization.');
@@ -20,6 +22,8 @@ export function getMatSelectDynamicMultipleError(): Error {
2022
* in `multiple` mode. Note that `undefined` and `null` are still valid values to allow for
2123
* resetting the value.
2224
* @docs-private
25+
* @deprecated Use `getMatSelectNonArrayValueError` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
26+
* @breaking-change 17.0.0
2327
*/
2428
export function getMatSelectNonArrayValueError(): Error {
2529
return Error('Value must be an array in multiple-selection mode.');
@@ -29,6 +33,8 @@ export function getMatSelectNonArrayValueError(): Error {
2933
* Returns an exception to be thrown when assigning a non-function value to the comparator
3034
* used to determine if a value corresponds to an option. Note that whether the function
3135
* actually takes two values and returns a boolean is not checked.
36+
* @deprecated Use `getMatSelectNonFunctionValueError` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
37+
* @breaking-change 17.0.0
3238
*/
3339
export function getMatSelectNonFunctionValueError(): Error {
3440
return Error('`compareWith` must be a function.');

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ import {CdkScrollableModule} from '@angular/cdk/scrolling';
1616
import {MAT_SELECT_SCROLL_STRATEGY_PROVIDER} from '@angular/material/select';
1717
import {MatLegacySelect, MatLegacySelectTrigger} from './select';
1818

19+
/**
20+
* @deprecated Use `MatSelectModule` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
21+
* @breaking-change 17.0.0
22+
*/
1923
@NgModule({
2024
imports: [CommonModule, OverlayModule, MatLegacyOptionModule, MatCommonModule],
2125
exports: [

src/material/legacy-select/select.ts

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,32 @@ import {matLegacySelectAnimations} from './select-animations';
3737
* the trigger element.
3838
*/
3939

40-
/** The max height of the select's overlay panel. */
40+
/**
41+
* The max height of the select's overlay panel.
42+
* @deprecated Use `SELECT_PANEL_MAX_HEIGHT` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
43+
* @breaking-change 17.0.0
44+
*/
4145
export const SELECT_PANEL_MAX_HEIGHT = 256;
4246

43-
/** The panel's padding on the x-axis. */
47+
/**
48+
* The panel's padding on the x-axis.
49+
* @deprecated Use `SELECT_PANEL_PADDING_X` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
50+
* @breaking-change 17.0.0
51+
*/
4452
export const SELECT_PANEL_PADDING_X = 16;
4553

46-
/** The panel's x axis padding if it is indented (e.g. there is an option group). */
54+
/**
55+
* The panel's x axis padding if it is indented (e.g. there is an option group).
56+
* @deprecated Use `SELECT_PANEL_INDENT_PADDING_X` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
57+
* @breaking-change 17.0.0
58+
*/
4759
export const SELECT_PANEL_INDENT_PADDING_X = SELECT_PANEL_PADDING_X * 2;
4860

49-
/** The height of the select items in `em` units. */
61+
/**
62+
* The height of the select items in `em` units.
63+
* @deprecated Use `SELECT_ITEM_HEIGHT_EM` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
64+
* @breaking-change 17.0.0
65+
*/
5066
export const SELECT_ITEM_HEIGHT_EM = 3;
5167

5268
// TODO(josephperrott): Revert to a constant after 2018 spec updates are fully merged.
@@ -58,16 +74,25 @@ export const SELECT_ITEM_HEIGHT_EM = 3;
5874
* (SELECT_PANEL_PADDING_X * 1.5) + 16 = 40
5975
* The padding is multiplied by 1.5 because the checkbox's margin is half the padding.
6076
* The checkbox width is 16px.
77+
*
78+
* @deprecated Use `SELECT_MULTIPLE_PANEL_PADDING_X` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
79+
* @breaking-change 17.0.0
6180
*/
6281
export const SELECT_MULTIPLE_PANEL_PADDING_X = SELECT_PANEL_PADDING_X * 1.5 + 16;
6382

6483
/**
6584
* The select panel will only "fit" inside the viewport if it is positioned at
6685
* this value or more away from the viewport boundary.
86+
* @deprecated Use `SELECT_PANEL_VIEWPORT_PADDING` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
87+
* @breaking-change 17.0.0
6788
*/
6889
export const SELECT_PANEL_VIEWPORT_PADDING = 8;
6990

70-
/** Change event object that is emitted when the select value has changed. */
91+
/**
92+
* Change event object that is emitted when the select value has changed.
93+
* @deprecated Use `MatSelectChange` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
94+
* @breaking-change 17.0.0
95+
*/
7196
export class MatLegacySelectChange {
7297
constructor(
7398
/** Reference to the select that emitted the change event. */
@@ -79,13 +104,19 @@ export class MatLegacySelectChange {
79104

80105
/**
81106
* Allows the user to customize the trigger that is displayed when the select has a value.
107+
* @deprecated Use `MatSelectTrigger` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
108+
* @breaking-change 17.0.0
82109
*/
83110
@Directive({
84111
selector: 'mat-select-trigger',
85112
providers: [{provide: MAT_SELECT_TRIGGER, useExisting: MatLegacySelectTrigger}],
86113
})
87114
export class MatLegacySelectTrigger {}
88115

116+
/**
117+
* @deprecated Use `MatSelect` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
118+
* @breaking-change 17.0.0
119+
*/
89120
@Component({
90121
selector: 'mat-select',
91122
exportAs: 'matSelect',

src/material/legacy-select/testing/select-harness-filters.ts

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

99
import {BaseHarnessFilters} from '@angular/cdk/testing';
1010

11-
/** A set of criteria that can be used to filter a list of `MatSelectHarness` instances. */
11+
/**
12+
* A set of criteria that can be used to filter a list of `MatSelectHarness` instances.
13+
* @deprecated Use `SelectHarnessFilters` from `@angular/material/select/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
14+
* @breaking-change 17.0.0
15+
*/
1216
export interface LegacySelectHarnessFilters extends BaseHarnessFilters {}

src/material/legacy-select/testing/select-harness.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ import {
1616
} from '@angular/material/legacy-core/testing';
1717
import {LegacySelectHarnessFilters} from './select-harness-filters';
1818

19-
/** Harness for interacting with a standard mat-select in tests. */
19+
/**
20+
* Harness for interacting with a standard mat-select in tests.
21+
* @deprecated Use `MatSelectHarness` from `@angular/material/select/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
22+
* @breaking-change 17.0.0
23+
*/
2024
export class MatLegacySelectHarness extends _MatSelectHarnessBase<
2125
typeof MatLegacyOptionHarness,
2226
MatLegacyOptionHarness,

tools/public_api_guard/material/legacy-select-testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import { _MatSelectHarnessBase } from '@angular/material/select/testing';
1212
import { OptgroupHarnessFilters } from '@angular/material/legacy-core/testing';
1313
import { OptionHarnessFilters } from '@angular/material/legacy-core/testing';
1414

15-
// @public
15+
// @public @deprecated
1616
export interface LegacySelectHarnessFilters extends BaseHarnessFilters {
1717
}
1818

19-
// @public
19+
// @public @deprecated
2020
export class MatLegacySelectHarness extends _MatSelectHarnessBase<typeof MatLegacyOptionHarness, MatLegacyOptionHarness, OptionHarnessFilters, typeof MatLegacyOptgroupHarness, MatLegacyOptgroupHarness, OptgroupHarnessFilters> {
2121
// (undocumented)
2222
static hostSelector: string;

tools/public_api_guard/material/legacy-select.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export { MAT_LEGACY_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY }
3535

3636
export { MAT_LEGACY_SELECT_TRIGGER }
3737

38-
// @public (undocumented)
38+
// @public @deprecated (undocumented)
3939
export class MatLegacySelect extends _MatSelectBase<MatLegacySelectChange> implements OnInit {
4040
_calculateOverlayScroll(selectedIndex: number, scrollBuffer: number, maxScroll: number): number;
4141
// (undocumented)
@@ -68,13 +68,13 @@ export class MatLegacySelect extends _MatSelectBase<MatLegacySelectChange> imple
6868
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacySelect, never>;
6969
}
7070

71-
// @public
71+
// @public @deprecated
7272
export const matLegacySelectAnimations: {
7373
readonly transformPanelWrap: AnimationTriggerMetadata;
7474
readonly transformPanel: AnimationTriggerMetadata;
7575
};
7676

77-
// @public
77+
// @public @deprecated
7878
export class MatLegacySelectChange {
7979
constructor(
8080
source: MatLegacySelect,
@@ -85,7 +85,7 @@ export class MatLegacySelectChange {
8585

8686
export { MatLegacySelectConfig }
8787

88-
// @public (undocumented)
88+
// @public @deprecated (undocumented)
8989
export class MatLegacySelectModule {
9090
// (undocumented)
9191
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacySelectModule, never>;
@@ -95,30 +95,30 @@ export class MatLegacySelectModule {
9595
static ɵmod: i0.ɵɵNgModuleDeclaration<MatLegacySelectModule, [typeof i1.MatLegacySelect, typeof i1.MatLegacySelectTrigger], [typeof i2.CommonModule, typeof i3.OverlayModule, typeof i4.MatLegacyOptionModule, typeof i5.MatCommonModule], [typeof i6.CdkScrollableModule, typeof i7.MatLegacyFormFieldModule, typeof i1.MatLegacySelect, typeof i1.MatLegacySelectTrigger, typeof i4.MatLegacyOptionModule, typeof i5.MatCommonModule]>;
9696
}
9797

98-
// @public
98+
// @public @deprecated
9999
export class MatLegacySelectTrigger {
100100
// (undocumented)
101101
static ɵdir: i0.ɵɵDirectiveDeclaration<MatLegacySelectTrigger, "mat-select-trigger", never, {}, {}, never, never, false>;
102102
// (undocumented)
103103
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacySelectTrigger, never>;
104104
}
105105

106-
// @public
106+
// @public @deprecated
107107
const SELECT_ITEM_HEIGHT_EM = 3;
108108

109-
// @public
109+
// @public @deprecated
110110
const SELECT_MULTIPLE_PANEL_PADDING_X: number;
111111

112-
// @public
112+
// @public @deprecated
113113
const SELECT_PANEL_INDENT_PADDING_X: number;
114114

115-
// @public
115+
// @public @deprecated
116116
const SELECT_PANEL_MAX_HEIGHT = 256;
117117

118-
// @public
118+
// @public @deprecated
119119
const SELECT_PANEL_PADDING_X = 16;
120120

121-
// @public
121+
// @public @deprecated
122122
const SELECT_PANEL_VIEWPORT_PADDING = 8;
123123

124124
// (No @packageDocumentation comment for this package)

0 commit comments

Comments
 (0)