Skip to content

Commit 7e5f2da

Browse files
devversiontinayuangao
authored andcommitted
chore: remove class re-export workaround (#8641)
Removes cross-package class re-exports that have been created in favor of working around: angular/angular#17849.
1 parent dd3094f commit 7e5f2da

File tree

11 files changed

+20
-61
lines changed

11 files changed

+20
-61
lines changed

src/lib/checkbox/checkbox-required-validator.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import {
1616
NG_VALIDATORS,
1717
} from '@angular/forms';
1818

19-
export const _MatCheckboxRequiredValidator = CheckboxRequiredValidator;
20-
2119
export const MAT_CHECKBOX_REQUIRED_VALIDATOR: Provider = {
2220
provide: NG_VALIDATORS,
2321
useExisting: forwardRef(() => MatCheckboxRequiredValidator),
@@ -35,4 +33,4 @@ export const MAT_CHECKBOX_REQUIRED_VALIDATOR: Provider = {
3533
providers: [MAT_CHECKBOX_REQUIRED_VALIDATOR],
3634
host: {'[attr.required]': 'required ? "" : null'}
3735
})
38-
export class MatCheckboxRequiredValidator extends _MatCheckboxRequiredValidator {}
36+
export class MatCheckboxRequiredValidator extends CheckboxRequiredValidator {}

src/lib/expansion/accordion.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ import {Directive, Input} from '@angular/core';
1010
import {coerceBooleanProperty} from '@angular/cdk/coercion';
1111
import {CdkAccordion} from '@angular/cdk/accordion';
1212

13-
/** Workaround for https://github.com/angular/angular/issues/17849 */
14-
export const _CdkAccordion = CdkAccordion;
15-
1613
/** MatAccordion's display modes. */
1714
export type MatAccordionDisplayMode = 'default' | 'flat';
1815

@@ -26,7 +23,7 @@ export type MatAccordionDisplayMode = 'default' | 'flat';
2623
class: 'mat-accordion'
2724
}
2825
})
29-
export class MatAccordion extends _CdkAccordion {
26+
export class MatAccordion extends CdkAccordion {
3027
/** Whether the expansion indicator should be hidden. */
3128
@Input() get hideToggle(): boolean { return this._hideToggle; }
3229
set hideToggle(show: boolean) { this._hideToggle = coerceBooleanProperty(show); }

src/lib/expansion/expansion-panel.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ import {Subject} from 'rxjs/Subject';
2828
import {MatAccordion} from './accordion';
2929
import {coerceBooleanProperty} from '@angular/cdk/coercion';
3030

31-
/** Workaround for https://github.com/angular/angular/issues/17849 */
32-
export const _CdkAccordionItem = CdkAccordionItem;
33-
3431
/** Time and timing curve for expansion panel animations. */
3532
export const EXPANSION_PANEL_ANIMATION_TIMING = '225ms cubic-bezier(0.4,0.0,0.2,1)';
3633

@@ -43,7 +40,7 @@ export const EXPANSION_PANEL_ANIMATION_TIMING = '225ms cubic-bezier(0.4,0.0,0.2,
4340
preserveWhitespaces: false,
4441
changeDetection: ChangeDetectionStrategy.OnPush,
4542
})
46-
export class MatExpansionPanelBase extends _CdkAccordionItem {
43+
export class MatExpansionPanelBase extends CdkAccordionItem {
4744
constructor(accordion: MatAccordion,
4845
_changeDetectorRef: ChangeDetectorRef,
4946
_uniqueSelectionDispatcher: UniqueSelectionDispatcher) {

src/lib/stepper/step-label.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,10 @@
99
import {Directive, TemplateRef} from '@angular/core';
1010
import {CdkStepLabel} from '@angular/cdk/stepper';
1111

12-
/** Workaround for https://github.com/angular/angular/issues/17849 */
13-
export const _MatStepLabel = CdkStepLabel;
14-
1512
@Directive({
1613
selector: '[matStepLabel]',
1714
})
18-
export class MatStepLabel extends _MatStepLabel {
15+
export class MatStepLabel extends CdkStepLabel {
1916
constructor(template: TemplateRef<any>) {
2017
super(template);
2118
}

src/lib/stepper/stepper-button.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,18 @@ import {Directive} from '@angular/core';
1010
import {CdkStepper, CdkStepperNext, CdkStepperPrevious} from '@angular/cdk/stepper';
1111
import {MatStepper} from './stepper';
1212

13-
/** Workaround for https://github.com/angular/angular/issues/17849 */
14-
export const _MatStepperNext = CdkStepperNext;
15-
export const _MatStepperPrevious = CdkStepperPrevious;
16-
1713
/** Button that moves to the next step in a stepper workflow. */
1814
@Directive({
1915
selector: 'button[matStepperNext]',
2016
host: {'(click)': '_stepper.next()'},
2117
providers: [{provide: CdkStepper, useExisting: MatStepper}]
2218
})
23-
export class MatStepperNext extends _MatStepperNext { }
19+
export class MatStepperNext extends CdkStepperNext { }
2420

2521
/** Button that moves to the previous step in a stepper workflow. */
2622
@Directive({
2723
selector: 'button[matStepperPrevious]',
2824
host: {'(click)': '_stepper.previous()'},
2925
providers: [{provide: CdkStepper, useExisting: MatStepper}]
3026
})
31-
export class MatStepperPrevious extends _MatStepperPrevious { }
27+
export class MatStepperPrevious extends CdkStepperPrevious { }

src/lib/stepper/stepper.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ import {MatStepHeader} from './step-header';
2929
import {MatStepLabel} from './step-label';
3030
import {takeUntil} from 'rxjs/operators/takeUntil';
3131

32-
/** Workaround for https://github.com/angular/angular/issues/17849 */
33-
export const _MatStep = CdkStep;
34-
export const _MatStepper = CdkStepper;
35-
3632
@Component({
3733
moduleId: module.id,
3834
selector: 'mat-step',
@@ -43,7 +39,7 @@ export const _MatStepper = CdkStepper;
4339
preserveWhitespaces: false,
4440
changeDetection: ChangeDetectionStrategy.OnPush,
4541
})
46-
export class MatStep extends _MatStep implements ErrorStateMatcher {
42+
export class MatStep extends CdkStep implements ErrorStateMatcher {
4743
/** Content for step label given by <ng-template matStepLabel>. */
4844
@ContentChild(MatStepLabel) stepLabel: MatStepLabel;
4945

@@ -68,7 +64,7 @@ export class MatStep extends _MatStep implements ErrorStateMatcher {
6864
@Directive({
6965
selector: '[matStepper]'
7066
})
71-
export class MatStepper extends _MatStepper implements AfterContentInit {
67+
export class MatStepper extends CdkStepper implements AfterContentInit {
7268
/** The list of step headers of the steps in the stepper. */
7369
@ViewChildren(MatStepHeader, {read: ElementRef}) _stepHeader: QueryList<ElementRef>;
7470

src/lib/table/cell.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ import {
1515
CdkHeaderCellDef,
1616
} from '@angular/cdk/table';
1717

18-
/** Workaround for https://github.com/angular/angular/issues/17849 */
19-
export const _MatCellDef = CdkCellDef;
20-
export const _MatHeaderCellDef = CdkHeaderCellDef;
21-
export const _MatColumnDef = CdkColumnDef;
22-
export const _MatHeaderCell = CdkHeaderCell;
23-
export const _MatCell = CdkCell;
24-
2518
/**
2619
* Cell definition for the mat-table.
2720
* Captures the template of a column's data row cell as well as cell-specific properties.
@@ -30,7 +23,7 @@ export const _MatCell = CdkCell;
3023
selector: '[matCellDef]',
3124
providers: [{provide: CdkCellDef, useExisting: MatCellDef}]
3225
})
33-
export class MatCellDef extends _MatCellDef { }
26+
export class MatCellDef extends CdkCellDef { }
3427

3528
/**
3629
* Header cell definition for the mat-table.
@@ -40,7 +33,7 @@ export class MatCellDef extends _MatCellDef { }
4033
selector: '[matHeaderCellDef]',
4134
providers: [{provide: CdkHeaderCellDef, useExisting: MatHeaderCellDef}]
4235
})
43-
export class MatHeaderCellDef extends _MatHeaderCellDef { }
36+
export class MatHeaderCellDef extends CdkHeaderCellDef { }
4437

4538
/**
4639
* Column definition for the mat-table.
@@ -50,7 +43,7 @@ export class MatHeaderCellDef extends _MatHeaderCellDef { }
5043
selector: '[matColumnDef]',
5144
providers: [{provide: CdkColumnDef, useExisting: MatColumnDef}],
5245
})
53-
export class MatColumnDef extends _MatColumnDef {
46+
export class MatColumnDef extends CdkColumnDef {
5447
/** Unique name for this column. */
5548
@Input('matColumnDef') name: string;
5649
}
@@ -63,7 +56,7 @@ export class MatColumnDef extends _MatColumnDef {
6356
'role': 'columnheader',
6457
},
6558
})
66-
export class MatHeaderCell extends _MatHeaderCell {
59+
export class MatHeaderCell extends CdkHeaderCell {
6760
constructor(columnDef: CdkColumnDef,
6861
elementRef: ElementRef) {
6962
super(columnDef, elementRef);
@@ -79,7 +72,7 @@ export class MatHeaderCell extends _MatHeaderCell {
7972
'role': 'gridcell',
8073
},
8174
})
82-
export class MatCell extends _MatCell {
75+
export class MatCell extends CdkCell {
8376
constructor(columnDef: CdkColumnDef,
8477
elementRef: ElementRef) {
8578
super(columnDef, elementRef);

src/lib/table/row.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ import {
1515
CdkRowDef,
1616
} from '@angular/cdk/table';
1717

18-
/** Workaround for https://github.com/angular/angular/issues/17849 */
19-
export const _MatHeaderRowDef = CdkHeaderRowDef;
20-
export const _MatCdkRowDef = CdkRowDef;
21-
export const _MatHeaderRow = CdkHeaderRow;
22-
export const _MatRow = CdkRow;
23-
2418
/**
2519
* Header row definition for the mat-table.
2620
* Captures the header row's template and other header properties such as the columns to display.
@@ -30,7 +24,7 @@ export const _MatRow = CdkRow;
3024
providers: [{provide: CdkHeaderRowDef, useExisting: MatHeaderRowDef}],
3125
inputs: ['columns: matHeaderRowDef'],
3226
})
33-
export class MatHeaderRowDef extends _MatHeaderRowDef { }
27+
export class MatHeaderRowDef extends CdkHeaderRowDef { }
3428

3529
/**
3630
* Data row definition for the mat-table.
@@ -42,7 +36,7 @@ export class MatHeaderRowDef extends _MatHeaderRowDef { }
4236
providers: [{provide: CdkRowDef, useExisting: MatRowDef}],
4337
inputs: ['columns: matRowDefColumns', 'when: matRowDefWhen'],
4438
})
45-
export class MatRowDef<T> extends _MatCdkRowDef<T> {
39+
export class MatRowDef<T> extends CdkRowDef<T> {
4640
}
4741

4842
/** Header template container that contains the cell outlet. Adds the right class and role. */
@@ -59,7 +53,7 @@ export class MatRowDef<T> extends _MatCdkRowDef<T> {
5953
exportAs: 'matHeaderRow',
6054
preserveWhitespaces: false,
6155
})
62-
export class MatHeaderRow extends _MatHeaderRow { }
56+
export class MatHeaderRow extends CdkHeaderRow { }
6357

6458
/** Data row template container that contains the cell outlet. Adds the right class and role. */
6559
@Component({
@@ -75,4 +69,4 @@ export class MatHeaderRow extends _MatHeaderRow { }
7569
exportAs: 'matRow',
7670
preserveWhitespaces: false,
7771
})
78-
export class MatRow extends _MatRow { }
72+
export class MatRow extends CdkRow { }

src/lib/table/table.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core';
1010
import {CDK_TABLE_TEMPLATE, CdkTable} from '@angular/cdk/table';
1111

12-
/** Workaround for https://github.com/angular/angular/issues/17849 */
13-
export const _MatTable = CdkTable;
14-
1512
/**
1613
* Wrapper for the CdkTable with Material design styles.
1714
*/
@@ -28,4 +25,4 @@ export const _MatTable = CdkTable;
2825
preserveWhitespaces: false,
2926
changeDetection: ChangeDetectionStrategy.OnPush,
3027
})
31-
export class MatTable<T> extends _MatTable<T> { }
28+
export class MatTable<T> extends CdkTable<T> { }

src/lib/tabs/tab-body.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ import {TemplatePortal, CdkPortalOutlet} from '@angular/cdk/portal';
3535
import {Directionality, Direction} from '@angular/cdk/bidi';
3636
import {Subscription} from 'rxjs/Subscription';
3737

38-
/** Workaround for https://github.com/angular/angular/issues/17849 */
39-
export const _MatTabBodyPortalBaseClass = CdkPortalOutlet;
40-
4138
/**
4239
* These position states are used internally as animation states for the tab body. Setting the
4340
* position state to left, right, or center will transition the tab body from its current
@@ -66,7 +63,7 @@ export type MatTabBodyOriginState = 'left' | 'right';
6663
@Directive({
6764
selector: '[matTabBodyHost]'
6865
})
69-
export class MatTabBodyPortal extends _MatTabBodyPortalBaseClass implements OnInit, OnDestroy {
66+
export class MatTabBodyPortal extends CdkPortalOutlet implements OnInit, OnDestroy {
7067
/** A subscription to events for when the tab body begins centering. */
7168
private _centeringSub: Subscription;
7269

src/lib/tabs/tab-label.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@
99
import {Directive, TemplateRef, ViewContainerRef} from '@angular/core';
1010
import {CdkPortal} from '@angular/cdk/portal';
1111

12-
/** Workaround for https://github.com/angular/angular/issues/17849 */
13-
export const _MatTabLabelBaseClass = CdkPortal;
14-
1512
/** Used to flag tab labels for use with the portal directive */
1613
@Directive({
1714
selector: '[mat-tab-label], [matTabLabel]',
1815
})
19-
export class MatTabLabel extends _MatTabLabelBaseClass {
16+
export class MatTabLabel extends CdkPortal {
2017
constructor(templateRef: TemplateRef<any>, viewContainerRef: ViewContainerRef) {
2118
super(templateRef, viewContainerRef);
2219
}

0 commit comments

Comments
 (0)