From 29ed93a1001189f252faa759251802e29692c861 Mon Sep 17 00:00:00 2001 From: Miles Malerba Date: Sat, 3 Sep 2022 20:01:42 +0000 Subject: [PATCH] fix(material/legacy-autocomplete): deprecate all ts symbols --- .../autocomplete-module.ts | 4 ++ .../autocomplete-origin.ts | 2 + .../autocomplete-trigger.ts | 6 +++ .../legacy-autocomplete/autocomplete.ts | 4 ++ .../legacy-autocomplete/public-api.ts | 45 ++++++++++++++++++- .../testing/autocomplete-harness-filters.ts | 6 ++- .../testing/autocomplete-harness.ts | 6 ++- .../material/legacy-autocomplete-testing.md | 4 +- .../material/legacy-autocomplete.md | 10 ++--- 9 files changed, 77 insertions(+), 10 deletions(-) diff --git a/src/material/legacy-autocomplete/autocomplete-module.ts b/src/material/legacy-autocomplete/autocomplete-module.ts index 90ad1f6cfebb..4d837f969379 100644 --- a/src/material/legacy-autocomplete/autocomplete-module.ts +++ b/src/material/legacy-autocomplete/autocomplete-module.ts @@ -17,6 +17,10 @@ import {MatLegacyAutocomplete} from './autocomplete'; import {MatLegacyAutocompleteTrigger} from './autocomplete-trigger'; import {MatLegacyAutocompleteOrigin} from './autocomplete-origin'; +/** + * @deprecated Use `MatAutocompleteModule` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 + */ @NgModule({ imports: [OverlayModule, MatLegacyOptionModule, MatCommonModule, CommonModule], exports: [ diff --git a/src/material/legacy-autocomplete/autocomplete-origin.ts b/src/material/legacy-autocomplete/autocomplete-origin.ts index 3b453a399295..98f84a6e0544 100644 --- a/src/material/legacy-autocomplete/autocomplete-origin.ts +++ b/src/material/legacy-autocomplete/autocomplete-origin.ts @@ -12,6 +12,8 @@ import {_MatAutocompleteOriginBase} from '@angular/material/autocomplete'; /** * Directive applied to an element to make it usable * as a connection point for an autocomplete panel. + * @deprecated Use `MatAutocompleteOrigin` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 */ @Directive({ selector: '[matAutocompleteOrigin]', diff --git a/src/material/legacy-autocomplete/autocomplete-trigger.ts b/src/material/legacy-autocomplete/autocomplete-trigger.ts index ce1bae702633..1dc84a41b373 100644 --- a/src/material/legacy-autocomplete/autocomplete-trigger.ts +++ b/src/material/legacy-autocomplete/autocomplete-trigger.ts @@ -16,6 +16,8 @@ import { /** * Provider that allows the autocomplete to register as a ControlValueAccessor. * @docs-private + * @deprecated Use `MAT_AUTOCOMPLETE_VALUE_ACCESSOR` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 */ export const MAT_LEGACY_AUTOCOMPLETE_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -23,6 +25,10 @@ export const MAT_LEGACY_AUTOCOMPLETE_VALUE_ACCESSOR: any = { multi: true, }; +/** + * @deprecated Use `MatAutocompleteTrigger` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 + */ @Directive({ selector: `input[matAutocomplete], textarea[matAutocomplete]`, host: { diff --git a/src/material/legacy-autocomplete/autocomplete.ts b/src/material/legacy-autocomplete/autocomplete.ts index 821f20bdb754..40a58388a337 100644 --- a/src/material/legacy-autocomplete/autocomplete.ts +++ b/src/material/legacy-autocomplete/autocomplete.ts @@ -23,6 +23,10 @@ import { } from '@angular/material/legacy-core'; import {_MatAutocompleteBase} from '@angular/material/autocomplete'; +/** + * @deprecated Use `MatAutocomplete` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 + */ @Component({ selector: 'mat-autocomplete', templateUrl: 'autocomplete.html', diff --git a/src/material/legacy-autocomplete/public-api.ts b/src/material/legacy-autocomplete/public-api.ts index f1ab830d92e5..5385362ff4af 100644 --- a/src/material/legacy-autocomplete/public-api.ts +++ b/src/material/legacy-autocomplete/public-api.ts @@ -14,15 +14,58 @@ export { } from './autocomplete-trigger'; export {MatLegacyAutocompleteOrigin} from './autocomplete-origin'; -// Everything from `material/autocomplete`, except for `MatAutcomplete` and `MatAutocompleteModule`. export { + /** + * @deprecated Use `getMatAutocompleteMissingPanelError` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 + */ getMatAutocompleteMissingPanelError as getMatLegacyAutocompleteMissingPanelError, + + /** + * @deprecated Use `MAT_AUTOCOMPLETE_DEFAULT_OPTIONS` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 + */ MAT_AUTOCOMPLETE_DEFAULT_OPTIONS as MAT_LEGACY_AUTOCOMPLETE_DEFAULT_OPTIONS, + + /** + * @deprecated Use `MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 + */ MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY as MAT_LEGACY_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY, + + /** + * @deprecated Use `MAT_AUTOCOMPLETE_SCROLL_STRATEGY` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 + */ MAT_AUTOCOMPLETE_SCROLL_STRATEGY as MAT_LEGACY_AUTOCOMPLETE_SCROLL_STRATEGY, + + /** + * @deprecated Use `MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 + */ MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY as MAT_LEGACY_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY, + + /** + * @deprecated Use `MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 + */ MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER as MAT_LEGACY_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER, + + /** + * @deprecated Use `MatAutocompleteActivatedEvent` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 + */ MatAutocompleteActivatedEvent as MatLegacyAutocompleteActivatedEvent, + + /** + * @deprecated Use `MatAutocompleteDefaultOptions` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 + */ MatAutocompleteDefaultOptions as MatLegacyAutocompleteDefaultOptions, + + /** + * @deprecated Use `MatAutocompleteSelectedEvent` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 + */ MatAutocompleteSelectedEvent as MatLegacyAutocompleteSelectedEvent, } from '@angular/material/autocomplete'; diff --git a/src/material/legacy-autocomplete/testing/autocomplete-harness-filters.ts b/src/material/legacy-autocomplete/testing/autocomplete-harness-filters.ts index 721a8c7e0a52..f1419f26113f 100644 --- a/src/material/legacy-autocomplete/testing/autocomplete-harness-filters.ts +++ b/src/material/legacy-autocomplete/testing/autocomplete-harness-filters.ts @@ -8,7 +8,11 @@ import {BaseHarnessFilters} from '@angular/cdk/testing'; -/** A set of criteria that can be used to filter a list of `MatAutocompleteHarness` instances. */ +/** + * A set of criteria that can be used to filter a list of `MatAutocompleteHarness` instances. + * @deprecated Use `AutocompleteHarnessFilters` from `@angular/material/autocomplete/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 + */ export interface LegacyAutocompleteHarnessFilters extends BaseHarnessFilters { /** Only find instances whose associated input element matches the given value. */ value?: string | RegExp; diff --git a/src/material/legacy-autocomplete/testing/autocomplete-harness.ts b/src/material/legacy-autocomplete/testing/autocomplete-harness.ts index 1c149dc72397..f84724faacee 100644 --- a/src/material/legacy-autocomplete/testing/autocomplete-harness.ts +++ b/src/material/legacy-autocomplete/testing/autocomplete-harness.ts @@ -16,7 +16,11 @@ import { import {_MatAutocompleteHarnessBase} from '@angular/material/autocomplete/testing'; import {LegacyAutocompleteHarnessFilters} from './autocomplete-harness-filters'; -/** Harness for interacting with a standard mat-autocomplete in tests. */ +/** + * Harness for interacting with a standard mat-autocomplete in tests. + * @deprecated Use `MatAutocompleteHarness` from `@angular/material/autocomplete/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 + */ export class MatLegacyAutocompleteHarness extends _MatAutocompleteHarnessBase< typeof MatLegacyOptionHarness, MatLegacyOptionHarness, diff --git a/tools/public_api_guard/material/legacy-autocomplete-testing.md b/tools/public_api_guard/material/legacy-autocomplete-testing.md index 58d76419466f..9107bb1cc982 100644 --- a/tools/public_api_guard/material/legacy-autocomplete-testing.md +++ b/tools/public_api_guard/material/legacy-autocomplete-testing.md @@ -12,12 +12,12 @@ import { MatLegacyOptionHarness } from '@angular/material/legacy-core/testing'; import { OptgroupHarnessFilters } from '@angular/material/legacy-core/testing'; import { OptionHarnessFilters } from '@angular/material/legacy-core/testing'; -// @public +// @public @deprecated export interface LegacyAutocompleteHarnessFilters extends BaseHarnessFilters { value?: string | RegExp; } -// @public +// @public @deprecated export class MatLegacyAutocompleteHarness extends _MatAutocompleteHarnessBase { static hostSelector: string; // (undocumented) diff --git a/tools/public_api_guard/material/legacy-autocomplete.md b/tools/public_api_guard/material/legacy-autocomplete.md index c3bb9aac856d..d0c5387535f2 100644 --- a/tools/public_api_guard/material/legacy-autocomplete.md +++ b/tools/public_api_guard/material/legacy-autocomplete.md @@ -38,10 +38,10 @@ export { MAT_LEGACY_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY } export { MAT_LEGACY_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER } -// @public +// @public @deprecated export const MAT_LEGACY_AUTOCOMPLETE_VALUE_ACCESSOR: any; -// @public (undocumented) +// @public @deprecated (undocumented) export class MatLegacyAutocomplete extends _MatAutocompleteBase { // (undocumented) protected _hiddenClass: string; @@ -59,7 +59,7 @@ export { MatLegacyAutocompleteActivatedEvent } export { MatLegacyAutocompleteDefaultOptions } -// @public (undocumented) +// @public @deprecated (undocumented) export class MatLegacyAutocompleteModule { // (undocumented) static ɵfac: i0.ɵɵFactoryDeclaration; @@ -69,7 +69,7 @@ export class MatLegacyAutocompleteModule { static ɵmod: i0.ɵɵNgModuleDeclaration; } -// @public +// @public @deprecated export class MatLegacyAutocompleteOrigin extends _MatAutocompleteOriginBase { // (undocumented) static ɵdir: i0.ɵɵDirectiveDeclaration; @@ -79,7 +79,7 @@ export class MatLegacyAutocompleteOrigin extends _MatAutocompleteOriginBase { export { MatLegacyAutocompleteSelectedEvent } -// @public (undocumented) +// @public @deprecated (undocumented) export class MatLegacyAutocompleteTrigger extends _MatAutocompleteTriggerBase { // (undocumented) protected _aboveClass: string;