Skip to content

Commit 9fcd1e9

Browse files
committed
refactor(material/legacy-checkbox): rename ts symbols
1 parent b6cada5 commit 9fcd1e9

File tree

8 files changed

+55
-48
lines changed

8 files changed

+55
-48
lines changed

src/dev-app/checkbox/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ ng_module(
1111
":checkbox_demo_scss",
1212
],
1313
deps = [
14-
"//src/material/checkbox",
1514
"//src/material/core",
1615
"//src/material/form-field",
1716
"//src/material/input",
17+
"//src/material/legacy-checkbox",
1818
"//src/material/select",
1919
"@npm//@angular/forms",
2020
],

src/dev-app/checkbox/checkbox-demo.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
*/
88

99
import {Component, Directive} from '@angular/core';
10-
import {MAT_CHECKBOX_DEFAULT_OPTIONS, MatCheckboxModule} from '@angular/material/checkbox';
10+
import {
11+
MatLegacyCheckboxModule,
12+
MAT_LEGACY_CHECKBOX_DEFAULT_OPTIONS,
13+
} from '@angular/material/legacy-checkbox';
1114
import {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';
1215
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
1316
import {MatPseudoCheckboxModule, ThemePalette} from '@angular/material/core';
@@ -23,14 +26,14 @@ export interface Task {
2326

2427
@Directive({
2528
selector: '[clickActionNoop]',
26-
providers: [{provide: MAT_CHECKBOX_DEFAULT_OPTIONS, useValue: {clickAction: 'noop'}}],
29+
providers: [{provide: MAT_LEGACY_CHECKBOX_DEFAULT_OPTIONS, useValue: {clickAction: 'noop'}}],
2730
standalone: true,
2831
})
2932
export class ClickActionNoop {}
3033

3134
@Directive({
3235
selector: '[clickActionCheck]',
33-
providers: [{provide: MAT_CHECKBOX_DEFAULT_OPTIONS, useValue: {clickAction: 'check'}}],
36+
providers: [{provide: MAT_LEGACY_CHECKBOX_DEFAULT_OPTIONS, useValue: {clickAction: 'check'}}],
3437
standalone: true,
3538
})
3639
export class ClickActionCheck {}
@@ -53,7 +56,7 @@ export class AnimationsNoop {}
5356
],
5457
templateUrl: 'nested-checklist.html',
5558
standalone: true,
56-
imports: [CommonModule, MatCheckboxModule, FormsModule],
59+
imports: [CommonModule, MatLegacyCheckboxModule, FormsModule],
5760
})
5861
export class MatCheckboxDemoNestedChecklist {
5962
tasks: Task[] = [
@@ -107,7 +110,7 @@ export class MatCheckboxDemoNestedChecklist {
107110
imports: [
108111
CommonModule,
109112
FormsModule,
110-
MatCheckboxModule,
113+
MatLegacyCheckboxModule,
111114
MatInputModule,
112115
MatSelectModule,
113116
MatPseudoCheckboxModule,

src/dev-app/legacy-checkbox/legacy-checkbox-demo.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import {Component, Directive} from '@angular/core';
1010
import {
1111
MatLegacyCheckboxModule,
12-
MAT_CHECKBOX_DEFAULT_OPTIONS,
12+
MAT_LEGACY_CHECKBOX_DEFAULT_OPTIONS,
1313
} from '@angular/material/legacy-checkbox';
1414
import {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';
1515
import {MatPseudoCheckboxModule, ThemePalette} from '@angular/material/core';
@@ -27,14 +27,14 @@ export interface Task {
2727

2828
@Directive({
2929
selector: '[clickActionNoop]',
30-
providers: [{provide: MAT_CHECKBOX_DEFAULT_OPTIONS, useValue: {clickAction: 'noop'}}],
30+
providers: [{provide: MAT_LEGACY_CHECKBOX_DEFAULT_OPTIONS, useValue: {clickAction: 'noop'}}],
3131
standalone: true,
3232
})
3333
export class ClickActionNoop {}
3434

3535
@Directive({
3636
selector: '[clickActionCheck]',
37-
providers: [{provide: MAT_CHECKBOX_DEFAULT_OPTIONS, useValue: {clickAction: 'check'}}],
37+
providers: [{provide: MAT_LEGACY_CHECKBOX_DEFAULT_OPTIONS, useValue: {clickAction: 'check'}}],
3838
standalone: true,
3939
})
4040
export class ClickActionCheck {}

src/material/legacy-checkbox/checkbox.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class MatLegacyCheckboxChange {
4141
* This allows it to support [(ngModel)].
4242
* @docs-private
4343
*/
44-
export const MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR: any = {
44+
export const MAT_LEGACY_CHECKBOX_CONTROL_VALUE_ACCESSOR: any = {
4545
provide: NG_VALUE_ACCESSOR,
4646
useExisting: forwardRef(() => MatLegacyCheckbox),
4747
multi: true,
@@ -72,7 +72,7 @@ export const MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR: any = {
7272
'[class.mat-checkbox-label-before]': 'labelPosition == "before"',
7373
'[class._mat-animation-noopable]': `_animationMode === 'NoopAnimations'`,
7474
},
75-
providers: [MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR],
75+
providers: [MAT_LEGACY_CHECKBOX_CONTROL_VALUE_ACCESSOR],
7676
inputs: ['disableRipple', 'color', 'tabIndex'],
7777
encapsulation: ViewEncapsulation.None,
7878
changeDetection: ChangeDetectionStrategy.OnPush,

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

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,24 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
export * from './checkbox';
10-
export * from './checkbox-module';
9+
export {
10+
MatLegacyCheckboxChange,
11+
MAT_LEGACY_CHECKBOX_CONTROL_VALUE_ACCESSOR,
12+
MatLegacyCheckbox,
13+
} from './checkbox';
14+
export {MatLegacyCheckboxModule} from './checkbox-module';
1115

1216
export {
13-
MAT_CHECKBOX_REQUIRED_VALIDATOR,
14-
MatCheckboxClickAction,
15-
MatCheckboxRequiredValidator,
16-
_MatCheckboxRequiredValidatorModule,
17+
MAT_CHECKBOX_REQUIRED_VALIDATOR as MAT_LEGACY_CHECKBOX_REQUIRED_VALIDATOR,
18+
MatCheckboxClickAction as MatLegacyCheckboxClickAction,
19+
MatCheckboxRequiredValidator as MatLegacyCheckboxRequiredValidator,
20+
_MatCheckboxRequiredValidatorModule as _MatLegacyCheckboxRequiredValidatorModule,
1721
/**
1822
* @deprecated
1923
* @breaking-change 9.0.0
2024
*/
21-
TransitionCheckState,
22-
MAT_CHECKBOX_DEFAULT_OPTIONS_FACTORY,
23-
MatCheckboxDefaultOptions,
24-
MAT_CHECKBOX_DEFAULT_OPTIONS,
25+
TransitionCheckState as LegacyTransitionCheckState,
26+
MAT_CHECKBOX_DEFAULT_OPTIONS_FACTORY as MAT_LEGACY_CHECKBOX_DEFAULT_OPTIONS_FACTORY,
27+
MatCheckboxDefaultOptions as MatLegacyCheckboxDefaultOptions,
28+
MAT_CHECKBOX_DEFAULT_OPTIONS as MAT_LEGACY_CHECKBOX_DEFAULT_OPTIONS,
2529
} from '@angular/material/checkbox';

src/material/legacy-checkbox/testing/public-api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
export * from './checkbox-harness';
10-
export {CheckboxHarnessFilters} from '@angular/material/checkbox/testing';
9+
export {MatLegacyCheckboxHarness} from './checkbox-harness';
10+
export {CheckboxHarnessFilters as LegacyCheckboxHarnessFilters} from '@angular/material/checkbox/testing';

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
```ts
66

77
import { AsyncFactoryFn } from '@angular/cdk/testing';
8-
import { CheckboxHarnessFilters } from '@angular/material/checkbox/testing';
98
import { HarnessPredicate } from '@angular/cdk/testing';
9+
import { CheckboxHarnessFilters as LegacyCheckboxHarnessFilters } from '@angular/material/checkbox/testing';
1010
import { _MatCheckboxHarnessBase } from '@angular/material/checkbox/testing';
1111
import { TestElement } from '@angular/cdk/testing';
1212

13-
export { CheckboxHarnessFilters }
13+
export { LegacyCheckboxHarnessFilters }
1414

1515
// @public
1616
export class MatLegacyCheckboxHarness extends _MatCheckboxHarnessBase {
@@ -21,7 +21,7 @@ export class MatLegacyCheckboxHarness extends _MatCheckboxHarnessBase {
2121
protected _label: AsyncFactoryFn<TestElement>;
2222
// (undocumented)
2323
toggle(): Promise<void>;
24-
static with(options?: CheckboxHarnessFilters): HarnessPredicate<MatLegacyCheckboxHarness>;
24+
static with(options?: LegacyCheckboxHarnessFilters): HarnessPredicate<MatLegacyCheckboxHarness>;
2525
}
2626

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

tools/public_api_guard/material/legacy-checkbox.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,32 @@ import * as i0 from '@angular/core';
1313
import * as i2 from '@angular/material/core';
1414
import * as i3 from '@angular/cdk/observers';
1515
import * as i4 from '@angular/material/checkbox';
16-
import { MAT_CHECKBOX_DEFAULT_OPTIONS } from '@angular/material/checkbox';
17-
import { MAT_CHECKBOX_DEFAULT_OPTIONS_FACTORY } from '@angular/material/checkbox';
18-
import { MAT_CHECKBOX_REQUIRED_VALIDATOR } from '@angular/material/checkbox';
16+
import { TransitionCheckState as LegacyTransitionCheckState } from '@angular/material/checkbox';
17+
import { MAT_CHECKBOX_DEFAULT_OPTIONS as MAT_LEGACY_CHECKBOX_DEFAULT_OPTIONS } from '@angular/material/checkbox';
18+
import { MAT_CHECKBOX_DEFAULT_OPTIONS_FACTORY as MAT_LEGACY_CHECKBOX_DEFAULT_OPTIONS_FACTORY } from '@angular/material/checkbox';
19+
import { MAT_CHECKBOX_REQUIRED_VALIDATOR as MAT_LEGACY_CHECKBOX_REQUIRED_VALIDATOR } from '@angular/material/checkbox';
1920
import { _MatCheckboxBase } from '@angular/material/checkbox';
20-
import { MatCheckboxClickAction } from '@angular/material/checkbox';
21-
import { MatCheckboxDefaultOptions } from '@angular/material/checkbox';
22-
import { MatCheckboxRequiredValidator } from '@angular/material/checkbox';
23-
import { _MatCheckboxRequiredValidatorModule } from '@angular/material/checkbox';
21+
import { MatCheckboxClickAction as MatLegacyCheckboxClickAction } from '@angular/material/checkbox';
22+
import { MatCheckboxDefaultOptions as MatLegacyCheckboxDefaultOptions } from '@angular/material/checkbox';
23+
import { MatCheckboxRequiredValidator as MatLegacyCheckboxRequiredValidator } from '@angular/material/checkbox';
24+
import { _MatCheckboxRequiredValidatorModule as _MatLegacyCheckboxRequiredValidatorModule } from '@angular/material/checkbox';
2425
import { NgZone } from '@angular/core';
2526
import { OnDestroy } from '@angular/core';
26-
import { TransitionCheckState } from '@angular/material/checkbox';
2727

28-
// @public
29-
export const MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR: any;
30-
31-
export { MAT_CHECKBOX_DEFAULT_OPTIONS }
32-
33-
export { MAT_CHECKBOX_DEFAULT_OPTIONS_FACTORY }
34-
35-
export { MAT_CHECKBOX_REQUIRED_VALIDATOR }
28+
export { LegacyTransitionCheckState }
3629

37-
export { MatCheckboxClickAction }
30+
// @public
31+
export const MAT_LEGACY_CHECKBOX_CONTROL_VALUE_ACCESSOR: any;
3832

39-
export { MatCheckboxDefaultOptions }
33+
export { MAT_LEGACY_CHECKBOX_DEFAULT_OPTIONS }
4034

41-
export { MatCheckboxRequiredValidator }
35+
export { MAT_LEGACY_CHECKBOX_DEFAULT_OPTIONS_FACTORY }
4236

43-
export { _MatCheckboxRequiredValidatorModule }
37+
export { MAT_LEGACY_CHECKBOX_REQUIRED_VALIDATOR }
4438

4539
// @public
4640
export class MatLegacyCheckbox extends _MatCheckboxBase<MatLegacyCheckboxChange> implements AfterViewInit, OnDestroy {
47-
constructor(elementRef: ElementRef<HTMLElement>, changeDetectorRef: ChangeDetectorRef, _focusMonitor: FocusMonitor, ngZone: NgZone, tabIndex: string, animationMode?: string, options?: MatCheckboxDefaultOptions);
41+
constructor(elementRef: ElementRef<HTMLElement>, changeDetectorRef: ChangeDetectorRef, _focusMonitor: FocusMonitor, ngZone: NgZone, tabIndex: string, animationMode?: string, options?: MatLegacyCheckboxDefaultOptions);
4842
// (undocumented)
4943
protected _animationClasses: {
5044
uncheckedToChecked: string;
@@ -76,6 +70,10 @@ export class MatLegacyCheckboxChange {
7670
source: MatLegacyCheckbox;
7771
}
7872

73+
export { MatLegacyCheckboxClickAction }
74+
75+
export { MatLegacyCheckboxDefaultOptions }
76+
7977
// @public (undocumented)
8078
export class MatLegacyCheckboxModule {
8179
// (undocumented)
@@ -86,7 +84,9 @@ export class MatLegacyCheckboxModule {
8684
static ɵmod: i0.ɵɵNgModuleDeclaration<MatLegacyCheckboxModule, [typeof i1.MatLegacyCheckbox], [typeof i2.MatRippleModule, typeof i2.MatCommonModule, typeof i3.ObserversModule, typeof i4._MatCheckboxRequiredValidatorModule], [typeof i1.MatLegacyCheckbox, typeof i2.MatCommonModule, typeof i4._MatCheckboxRequiredValidatorModule]>;
8785
}
8886

89-
export { TransitionCheckState }
87+
export { MatLegacyCheckboxRequiredValidator }
88+
89+
export { _MatLegacyCheckboxRequiredValidatorModule }
9090

9191
// (No @packageDocumentation comment for this package)
9292

0 commit comments

Comments
 (0)