Skip to content

Commit 9bd8523

Browse files
authored
fix(material/legacy-core): name all ts symbols to reflect legacy-ness (#25673)
1 parent 8ca3155 commit 9bd8523

17 files changed

+233
-234
lines changed

src/material/legacy-autocomplete/autocomplete.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import {
3636
tick,
3737
} from '@angular/core/testing';
3838
import {FormControl, FormsModule, ReactiveFormsModule} from '@angular/forms';
39-
import {MatLegacyOption, MatOptionSelectionChange} from '@angular/material/legacy-core';
39+
import {MatLegacyOption, MatLegacyOptionSelectionChange} from '@angular/material/legacy-core';
4040
import {MatLegacyFormField, MatLegacyFormFieldModule} from '@angular/material/legacy-form-field';
4141
import {By} from '@angular/platform-browser';
4242
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
@@ -2352,7 +2352,7 @@ describe('MatAutocomplete', () => {
23522352
fixture.detectChanges();
23532353
zone.simulateZoneExit();
23542354

2355-
expect(spy).toHaveBeenCalledWith(jasmine.any(MatOptionSelectionChange));
2355+
expect(spy).toHaveBeenCalledWith(jasmine.any(MatLegacyOptionSelectionChange));
23562356
subscription!.unsubscribe();
23572357
}));
23582358

@@ -2483,7 +2483,7 @@ describe('MatAutocomplete', () => {
24832483

24842484
expect(closingActionSpy).not.toHaveBeenCalled();
24852485
option.click();
2486-
expect(closingActionSpy).toHaveBeenCalledWith(jasmine.any(MatOptionSelectionChange));
2486+
expect(closingActionSpy).toHaveBeenCalledWith(jasmine.any(MatLegacyOptionSelectionChange));
24872487
});
24882488

24892489
it('should close the panel when pressing escape', () => {

src/material/legacy-autocomplete/autocomplete.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ import {
1414
ViewEncapsulation,
1515
} from '@angular/core';
1616
import {
17-
MAT_OPTGROUP,
18-
MAT_OPTION_PARENT_COMPONENT,
19-
_MatOptgroupBase,
20-
_MatOptionBase,
17+
MAT_LEGACY_OPTGROUP,
18+
MAT_LEGACY_OPTION_PARENT_COMPONENT,
2119
MatLegacyOption,
2220
MatLegacyOptgroup,
2321
} from '@angular/material/legacy-core';
@@ -38,11 +36,12 @@ import {_MatAutocompleteBase} from '@angular/material/autocomplete';
3836
host: {
3937
'class': 'mat-autocomplete',
4038
},
41-
providers: [{provide: MAT_OPTION_PARENT_COMPONENT, useExisting: MatLegacyAutocomplete}],
39+
providers: [{provide: MAT_LEGACY_OPTION_PARENT_COMPONENT, useExisting: MatLegacyAutocomplete}],
4240
})
4341
export class MatLegacyAutocomplete extends _MatAutocompleteBase {
4442
/** Reference to all option groups within the autocomplete. */
45-
@ContentChildren(MAT_OPTGROUP, {descendants: true}) optionGroups: QueryList<MatLegacyOptgroup>;
43+
@ContentChildren(MAT_LEGACY_OPTGROUP, {descendants: true})
44+
optionGroups: QueryList<MatLegacyOptgroup>;
4645
/** Reference to all options within the autocomplete. */
4746
@ContentChildren(MatLegacyOption, {descendants: true}) options: QueryList<MatLegacyOption>;
4847
protected _visibleClass = 'mat-autocomplete-visible';

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import {HarnessPredicate} from '@angular/cdk/testing';
1010
import {
1111
MatLegacyOptgroupHarness,
1212
MatLegacyOptionHarness,
13-
OptgroupHarnessFilters,
14-
OptionHarnessFilters,
13+
LegacyOptgroupHarnessFilters,
14+
LegacyOptionHarnessFilters,
1515
} from '@angular/material/legacy-core/testing';
1616
import {_MatAutocompleteHarnessBase} from '@angular/material/autocomplete/testing';
1717
import {LegacyAutocompleteHarnessFilters} from './autocomplete-harness-filters';
@@ -24,10 +24,10 @@ import {LegacyAutocompleteHarnessFilters} from './autocomplete-harness-filters';
2424
export class MatLegacyAutocompleteHarness extends _MatAutocompleteHarnessBase<
2525
typeof MatLegacyOptionHarness,
2626
MatLegacyOptionHarness,
27-
OptionHarnessFilters,
27+
LegacyOptionHarnessFilters,
2828
typeof MatLegacyOptgroupHarness,
2929
MatLegacyOptgroupHarness,
30-
OptgroupHarnessFilters
30+
LegacyOptgroupHarnessFilters
3131
> {
3232
protected _prefix = 'mat';
3333
protected _optionClass = MatLegacyOptionHarness;

src/material/legacy-core/option/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,47 +31,47 @@ export {
3131
* @deprecated Use `MAT_OPTGROUP` from `@angular/material/core` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
3232
* @breaking-change 17.0.0
3333
*/
34-
MAT_OPTGROUP,
34+
MAT_OPTGROUP as MAT_LEGACY_OPTGROUP,
3535

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

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

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

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

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

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

7272
/**
7373
* @deprecated Use `_MatOptgroupBase` from `@angular/material/core` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
7474
* @breaking-change 17.0.0
7575
*/
76-
_MatOptgroupBase,
76+
_MatOptgroupBase as _MatLegacyOptgroupBase,
7777
} from '@angular/material/core';

src/material/legacy-core/option/option.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
dispatchEvent,
99
} from '../../../cdk/testing/private';
1010
import {SPACE, ENTER} from '@angular/cdk/keycodes';
11-
import {MatLegacyOption, MatLegacyOptionModule, MAT_OPTION_PARENT_COMPONENT} from './index';
11+
import {MatLegacyOption, MatLegacyOptionModule, MAT_LEGACY_OPTION_PARENT_COMPONENT} from './index';
1212

1313
describe('MatLegacyOption component', () => {
1414
beforeEach(waitForAsync(() => {
@@ -217,7 +217,7 @@ describe('MatLegacyOption component', () => {
217217
declarations: [InsideGroup],
218218
providers: [
219219
{
220-
provide: MAT_OPTION_PARENT_COMPONENT,
220+
provide: MAT_LEGACY_OPTION_PARENT_COMPONENT,
221221
useValue: {inertGroups: true},
222222
},
223223
],

0 commit comments

Comments
 (0)