Skip to content

Commit

Permalink
fix(material/legacy-core): name all ts symbols to reflect legacy-ness (
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalerba committed Sep 22, 2022
1 parent 8ca3155 commit 9bd8523
Show file tree
Hide file tree
Showing 17 changed files with 233 additions and 234 deletions.
6 changes: 3 additions & 3 deletions src/material/legacy-autocomplete/autocomplete.spec.ts
Expand Up @@ -36,7 +36,7 @@ import {
tick,
} from '@angular/core/testing';
import {FormControl, FormsModule, ReactiveFormsModule} from '@angular/forms';
import {MatLegacyOption, MatOptionSelectionChange} from '@angular/material/legacy-core';
import {MatLegacyOption, MatLegacyOptionSelectionChange} from '@angular/material/legacy-core';
import {MatLegacyFormField, MatLegacyFormFieldModule} from '@angular/material/legacy-form-field';
import {By} from '@angular/platform-browser';
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
Expand Down Expand Up @@ -2352,7 +2352,7 @@ describe('MatAutocomplete', () => {
fixture.detectChanges();
zone.simulateZoneExit();

expect(spy).toHaveBeenCalledWith(jasmine.any(MatOptionSelectionChange));
expect(spy).toHaveBeenCalledWith(jasmine.any(MatLegacyOptionSelectionChange));
subscription!.unsubscribe();
}));

Expand Down Expand Up @@ -2483,7 +2483,7 @@ describe('MatAutocomplete', () => {

expect(closingActionSpy).not.toHaveBeenCalled();
option.click();
expect(closingActionSpy).toHaveBeenCalledWith(jasmine.any(MatOptionSelectionChange));
expect(closingActionSpy).toHaveBeenCalledWith(jasmine.any(MatLegacyOptionSelectionChange));
});

it('should close the panel when pressing escape', () => {
Expand Down
11 changes: 5 additions & 6 deletions src/material/legacy-autocomplete/autocomplete.ts
Expand Up @@ -14,10 +14,8 @@ import {
ViewEncapsulation,
} from '@angular/core';
import {
MAT_OPTGROUP,
MAT_OPTION_PARENT_COMPONENT,
_MatOptgroupBase,
_MatOptionBase,
MAT_LEGACY_OPTGROUP,
MAT_LEGACY_OPTION_PARENT_COMPONENT,
MatLegacyOption,
MatLegacyOptgroup,
} from '@angular/material/legacy-core';
Expand All @@ -38,11 +36,12 @@ import {_MatAutocompleteBase} from '@angular/material/autocomplete';
host: {
'class': 'mat-autocomplete',
},
providers: [{provide: MAT_OPTION_PARENT_COMPONENT, useExisting: MatLegacyAutocomplete}],
providers: [{provide: MAT_LEGACY_OPTION_PARENT_COMPONENT, useExisting: MatLegacyAutocomplete}],
})
export class MatLegacyAutocomplete extends _MatAutocompleteBase {
/** Reference to all option groups within the autocomplete. */
@ContentChildren(MAT_OPTGROUP, {descendants: true}) optionGroups: QueryList<MatLegacyOptgroup>;
@ContentChildren(MAT_LEGACY_OPTGROUP, {descendants: true})
optionGroups: QueryList<MatLegacyOptgroup>;
/** Reference to all options within the autocomplete. */
@ContentChildren(MatLegacyOption, {descendants: true}) options: QueryList<MatLegacyOption>;
protected _visibleClass = 'mat-autocomplete-visible';
Expand Down
Expand Up @@ -10,8 +10,8 @@ import {HarnessPredicate} from '@angular/cdk/testing';
import {
MatLegacyOptgroupHarness,
MatLegacyOptionHarness,
OptgroupHarnessFilters,
OptionHarnessFilters,
LegacyOptgroupHarnessFilters,
LegacyOptionHarnessFilters,
} from '@angular/material/legacy-core/testing';
import {_MatAutocompleteHarnessBase} from '@angular/material/autocomplete/testing';
import {LegacyAutocompleteHarnessFilters} from './autocomplete-harness-filters';
Expand All @@ -24,10 +24,10 @@ import {LegacyAutocompleteHarnessFilters} from './autocomplete-harness-filters';
export class MatLegacyAutocompleteHarness extends _MatAutocompleteHarnessBase<
typeof MatLegacyOptionHarness,
MatLegacyOptionHarness,
OptionHarnessFilters,
LegacyOptionHarnessFilters,
typeof MatLegacyOptgroupHarness,
MatLegacyOptgroupHarness,
OptgroupHarnessFilters
LegacyOptgroupHarnessFilters
> {
protected _prefix = 'mat';
protected _optionClass = MatLegacyOptionHarness;
Expand Down
16 changes: 8 additions & 8 deletions src/material/legacy-core/option/index.ts
Expand Up @@ -31,47 +31,47 @@ export {
* @deprecated Use `MAT_OPTGROUP` from `@angular/material/core` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
MAT_OPTGROUP,
MAT_OPTGROUP as MAT_LEGACY_OPTGROUP,

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

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

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

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

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

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

/**
* @deprecated Use `_MatOptgroupBase` from `@angular/material/core` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
_MatOptgroupBase,
_MatOptgroupBase as _MatLegacyOptgroupBase,
} from '@angular/material/core';
4 changes: 2 additions & 2 deletions src/material/legacy-core/option/option.spec.ts
Expand Up @@ -8,7 +8,7 @@ import {
dispatchEvent,
} from '../../../cdk/testing/private';
import {SPACE, ENTER} from '@angular/cdk/keycodes';
import {MatLegacyOption, MatLegacyOptionModule, MAT_OPTION_PARENT_COMPONENT} from './index';
import {MatLegacyOption, MatLegacyOptionModule, MAT_LEGACY_OPTION_PARENT_COMPONENT} from './index';

describe('MatLegacyOption component', () => {
beforeEach(waitForAsync(() => {
Expand Down Expand Up @@ -217,7 +217,7 @@ describe('MatLegacyOption component', () => {
declarations: [InsideGroup],
providers: [
{
provide: MAT_OPTION_PARENT_COMPONENT,
provide: MAT_LEGACY_OPTION_PARENT_COMPONENT,
useValue: {inertGroups: true},
},
],
Expand Down

0 comments on commit 9bd8523

Please sign in to comment.