Skip to content

Commit

Permalink
fix(material/legacy-select): deprecate all ts symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalerba committed Sep 7, 2022
1 parent bbb9130 commit 4bb3554
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 20 deletions.
29 changes: 29 additions & 0 deletions src/material/legacy-select/public-api.ts
Expand Up @@ -11,10 +11,39 @@ export {matLegacySelectAnimations} from './select-animations';
export {MatLegacySelectChange, MatLegacySelect, MatLegacySelectTrigger} from './select';

export {
/**
* @deprecated Use `MAT_SELECT_CONFIG` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
MAT_SELECT_CONFIG as MAT_LEGACY_SELECT_CONFIG,

/**
* @deprecated Use `MAT_SELECT_SCROLL_STRATEGY` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
MAT_SELECT_SCROLL_STRATEGY as MAT_LEGACY_SELECT_SCROLL_STRATEGY,

/**
* @deprecated Use `MAT_SELECT_SCROLL_STRATEGY_PROVIDER` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
MAT_SELECT_SCROLL_STRATEGY_PROVIDER as MAT_LEGACY_SELECT_SCROLL_STRATEGY_PROVIDER,

/**
* @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.
* @breaking-change 17.0.0
*/
MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY as MAT_LEGACY_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY,

/**
* @deprecated Use `MAT_SELECT_TRIGGER` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
MAT_SELECT_TRIGGER as MAT_LEGACY_SELECT_TRIGGER,

/**
* @deprecated Use `MatSelectConfig` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
MatSelectConfig as MatLegacySelectConfig,
} from '@angular/material/select';
2 changes: 2 additions & 0 deletions src/material/legacy-select/select-animations.ts
Expand Up @@ -23,6 +23,8 @@ import {
*
* The values below match the implementation of the AngularJS Material mat-select animation.
* @docs-private
* @deprecated Use `matSelectAnimations` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export const matLegacySelectAnimations: {
readonly transformPanelWrap: AnimationTriggerMetadata;
Expand Down
6 changes: 6 additions & 0 deletions src/material/legacy-select/select-errors.ts
Expand Up @@ -10,6 +10,8 @@
* Returns an exception to be thrown when attempting to change a select's `multiple` option
* after initialization.
* @docs-private
* @deprecated Use `getMatSelectDynamicMultipleError` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export function getMatSelectDynamicMultipleError(): Error {
return Error('Cannot change `multiple` mode of select after initialization.');
Expand All @@ -20,6 +22,8 @@ export function getMatSelectDynamicMultipleError(): Error {
* in `multiple` mode. Note that `undefined` and `null` are still valid values to allow for
* resetting the value.
* @docs-private
* @deprecated Use `getMatSelectNonArrayValueError` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export function getMatSelectNonArrayValueError(): Error {
return Error('Value must be an array in multiple-selection mode.');
Expand All @@ -29,6 +33,8 @@ export function getMatSelectNonArrayValueError(): Error {
* Returns an exception to be thrown when assigning a non-function value to the comparator
* used to determine if a value corresponds to an option. Note that whether the function
* actually takes two values and returns a boolean is not checked.
* @deprecated Use `getMatSelectNonFunctionValueError` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export function getMatSelectNonFunctionValueError(): Error {
return Error('`compareWith` must be a function.');
Expand Down
4 changes: 4 additions & 0 deletions src/material/legacy-select/select-module.ts
Expand Up @@ -16,6 +16,10 @@ import {CdkScrollableModule} from '@angular/cdk/scrolling';
import {MAT_SELECT_SCROLL_STRATEGY_PROVIDER} from '@angular/material/select';
import {MatLegacySelect, MatLegacySelectTrigger} from './select';

/**
* @deprecated Use `MatSelectModule` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
@NgModule({
imports: [CommonModule, OverlayModule, MatLegacyOptionModule, MatCommonModule],
exports: [
Expand Down
41 changes: 36 additions & 5 deletions src/material/legacy-select/select.ts
Expand Up @@ -37,16 +37,32 @@ import {matLegacySelectAnimations} from './select-animations';
* the trigger element.
*/

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

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

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

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

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

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

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

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

/**
* @deprecated Use `MatSelect` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
@Component({
selector: 'mat-select',
exportAs: 'matSelect',
Expand Down
6 changes: 5 additions & 1 deletion src/material/legacy-select/testing/select-harness-filters.ts
Expand Up @@ -8,5 +8,9 @@

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

/** A set of criteria that can be used to filter a list of `MatSelectHarness` instances. */
/**
* A set of criteria that can be used to filter a list of `MatSelectHarness` instances.
* @deprecated Use `SelectHarnessFilters` from `@angular/material/select/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export interface LegacySelectHarnessFilters extends BaseHarnessFilters {}
6 changes: 5 additions & 1 deletion src/material/legacy-select/testing/select-harness.ts
Expand Up @@ -16,7 +16,11 @@ import {
} from '@angular/material/legacy-core/testing';
import {LegacySelectHarnessFilters} from './select-harness-filters';

/** Harness for interacting with a standard mat-select in tests. */
/**
* Harness for interacting with a standard mat-select in tests.
* @deprecated Use `MatSelectHarness` from `@angular/material/select/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export class MatLegacySelectHarness extends _MatSelectHarnessBase<
typeof MatLegacyOptionHarness,
MatLegacyOptionHarness,
Expand Down
4 changes: 2 additions & 2 deletions tools/public_api_guard/material/legacy-select-testing.md
Expand Up @@ -12,11 +12,11 @@ import { _MatSelectHarnessBase } from '@angular/material/select/testing';
import { OptgroupHarnessFilters } from '@angular/material/legacy-core/testing';
import { OptionHarnessFilters } from '@angular/material/legacy-core/testing';

// @public
// @public @deprecated
export interface LegacySelectHarnessFilters extends BaseHarnessFilters {
}

// @public
// @public @deprecated
export class MatLegacySelectHarness extends _MatSelectHarnessBase<typeof MatLegacyOptionHarness, MatLegacyOptionHarness, OptionHarnessFilters, typeof MatLegacyOptgroupHarness, MatLegacyOptgroupHarness, OptgroupHarnessFilters> {
// (undocumented)
static hostSelector: string;
Expand Down
22 changes: 11 additions & 11 deletions tools/public_api_guard/material/legacy-select.md
Expand Up @@ -35,7 +35,7 @@ export { MAT_LEGACY_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY }

export { MAT_LEGACY_SELECT_TRIGGER }

// @public (undocumented)
// @public @deprecated (undocumented)
export class MatLegacySelect extends _MatSelectBase<MatLegacySelectChange> implements OnInit {
_calculateOverlayScroll(selectedIndex: number, scrollBuffer: number, maxScroll: number): number;
// (undocumented)
Expand Down Expand Up @@ -68,13 +68,13 @@ export class MatLegacySelect extends _MatSelectBase<MatLegacySelectChange> imple
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacySelect, never>;
}

// @public
// @public @deprecated
export const matLegacySelectAnimations: {
readonly transformPanelWrap: AnimationTriggerMetadata;
readonly transformPanel: AnimationTriggerMetadata;
};

// @public
// @public @deprecated
export class MatLegacySelectChange {
constructor(
source: MatLegacySelect,
Expand All @@ -85,7 +85,7 @@ export class MatLegacySelectChange {

export { MatLegacySelectConfig }

// @public (undocumented)
// @public @deprecated (undocumented)
export class MatLegacySelectModule {
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacySelectModule, never>;
Expand All @@ -95,30 +95,30 @@ export class MatLegacySelectModule {
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]>;
}

// @public
// @public @deprecated
export class MatLegacySelectTrigger {
// (undocumented)
static ɵdir: i0.ɵɵDirectiveDeclaration<MatLegacySelectTrigger, "mat-select-trigger", never, {}, {}, never, never, false>;
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacySelectTrigger, never>;
}

// @public
// @public @deprecated
const SELECT_ITEM_HEIGHT_EM = 3;

// @public
// @public @deprecated
const SELECT_MULTIPLE_PANEL_PADDING_X: number;

// @public
// @public @deprecated
const SELECT_PANEL_INDENT_PADDING_X: number;

// @public
// @public @deprecated
const SELECT_PANEL_MAX_HEIGHT = 256;

// @public
// @public @deprecated
const SELECT_PANEL_PADDING_X = 16;

// @public
// @public @deprecated
const SELECT_PANEL_VIEWPORT_PADDING = 8;

// (No @packageDocumentation comment for this package)
Expand Down

0 comments on commit 4bb3554

Please sign in to comment.