Skip to content

Revert "fix: workaround for es2015 inheritance not always working (#1… #13868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Bug Fixes

* **build:** material not working with ES2015 ([#13709](https://github.com/angular/material2/issues/13709)) ([e9103a6](https://github.com/angular/material2/commit/e9103a6)), closes [#12760](https://github.com/angular/material2/issues/12760) [#13695](https://github.com/angular/material2/issues/13695)
* **button-toggle:** webkit tap highlight conflicting with ripples ([#13721](https://github.com/angular/material2/issues/13721)) ([abd0278](https://github.com/angular/material2/commit/abd0278))
* **cdk-platform:** pass `{}` to `@NgModule` since passing nothing breaks ([#13792](https://github.com/angular/material2/issues/13792)) ([5abb644](https://github.com/angular/material2/commit/5abb644))
* **checkbox:** disabled property not being coerced ([#13755](https://github.com/angular/material2/issues/13755)) ([cee8c65](https://github.com/angular/material2/commit/cee8c65)), closes [#13739](https://github.com/angular/material2/issues/13739)
Expand Down
21 changes: 0 additions & 21 deletions src/lib/core/constructor-metadata-inherit.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/lib/core/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ export * from './selection/index';

// TODO: don't have this
export * from './testing/month-constants';
export * from './constructor-metadata-inherit';
4 changes: 2 additions & 2 deletions src/lib/input/autosize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import {CdkTextareaAutosize} from '@angular/cdk/text-field';
import {Directive, Input} from '@angular/core';
import {_inheritCtorParametersMetadata} from '@angular/material/core';

/**
* Directive to automatically resize a textarea to fit its content.
Expand Down Expand Up @@ -46,4 +45,5 @@ export class MatTextareaAutosize extends CdkTextareaAutosize {
}

// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
_inheritCtorParametersMetadata(MatTextareaAutosize, CdkTextareaAutosize);
(MatTextareaAutosize as any)['ctorParameters'] = () =>
(CdkTextareaAutosize as any)['ctorParameters'];
3 changes: 1 addition & 2 deletions src/lib/stepper/step-label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@

import {Directive} from '@angular/core';
import {CdkStepLabel} from '@angular/cdk/stepper';
import {_inheritCtorParametersMetadata} from '@angular/material/core';

@Directive({
selector: '[matStepLabel]',
})
export class MatStepLabel extends CdkStepLabel {}

// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
_inheritCtorParametersMetadata(MatStepLabel, CdkStepLabel);
(MatStepLabel as any)['ctorParameters'] = () => (CdkStepLabel as any)['ctorParameters'];
6 changes: 3 additions & 3 deletions src/lib/stepper/stepper-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import {Directive} from '@angular/core';
import {CdkStepper, CdkStepperNext, CdkStepperPrevious} from '@angular/cdk/stepper';
import {MatStepper} from './stepper';
import {_inheritCtorParametersMetadata} from '@angular/material/core';

/** Button that moves to the next step in a stepper workflow. */
@Directive({
Expand All @@ -36,5 +35,6 @@ export class MatStepperNext extends CdkStepperNext {}
export class MatStepperPrevious extends CdkStepperPrevious {}

// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
_inheritCtorParametersMetadata(MatStepperNext, CdkStepperNext);
_inheritCtorParametersMetadata(MatStepperPrevious, CdkStepperPrevious);
(MatStepperNext as any)['ctorParameters'] = () => (CdkStepperNext as any)['ctorParameters'];
(MatStepperPrevious as any)['ctorParameters'] = () =>
(CdkStepperPrevious as any)['ctorParameters'];
4 changes: 2 additions & 2 deletions src/lib/stepper/stepper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import {
} from '@angular/core';
import {FormControl, FormGroupDirective, NgForm} from '@angular/forms';
import {DOCUMENT} from '@angular/common';
import {_inheritCtorParametersMetadata, ErrorStateMatcher} from '@angular/material/core';
import {ErrorStateMatcher} from '@angular/material/core';
import {Subject} from 'rxjs';
import {takeUntil, distinctUntilChanged} from 'rxjs/operators';

Expand Down Expand Up @@ -124,7 +124,7 @@ export class MatStepper extends CdkStepper implements AfterContentInit {
}

// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
_inheritCtorParametersMetadata(MatStepper, CdkStepper);
(MatStepper as any)['ctorParameters'] = () => (CdkStepper as any)['ctorParameters'];

@Component({
moduleId: module.id,
Expand Down
8 changes: 4 additions & 4 deletions src/lib/table/cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
CdkHeaderCell,
CdkHeaderCellDef,
} from '@angular/cdk/table';
import {_inheritCtorParametersMetadata} from '@angular/material/core';

/**
* Cell definition for the mat-table.
Expand Down Expand Up @@ -47,9 +46,10 @@ export class MatHeaderCellDef extends CdkHeaderCellDef {}
export class MatFooterCellDef extends CdkFooterCellDef {}

// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
_inheritCtorParametersMetadata(MatCellDef, CdkCellDef);
_inheritCtorParametersMetadata(MatHeaderCellDef, CdkHeaderCellDef);
_inheritCtorParametersMetadata(MatFooterCellDef, CdkFooterCellDef);
(MatCellDef as any)['ctorParameters'] = () => (CdkCellDef as any)['ctorParameters'];
(MatHeaderCellDef as any)['ctorParameters'] = () => (CdkHeaderCellDef as any)['ctorParameters'];
(MatFooterCellDef as any)['ctorParameters'] = () => (MatFooterCellDef as any)['ctorParameters'];

/**
* Column definition for the mat-table.
* Defines a set of cells available for a table column.
Expand Down
7 changes: 3 additions & 4 deletions src/lib/table/row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
CdkRow,
CdkRowDef,
} from '@angular/cdk/table';
import {_inheritCtorParametersMetadata} from '@angular/material/core';

/**
* Header row definition for the mat-table.
Expand Down Expand Up @@ -56,9 +55,9 @@ export class MatFooterRowDef extends CdkFooterRowDef {}
export class MatRowDef<T> extends CdkRowDef<T> {}

// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
_inheritCtorParametersMetadata(MatHeaderRowDef, CdkHeaderRowDef);
_inheritCtorParametersMetadata(MatFooterRowDef, CdkFooterRowDef);
_inheritCtorParametersMetadata(MatRowDef, CdkRowDef);
(MatHeaderRowDef as any)['ctorParameters'] = () => (CdkHeaderRowDef as any)['ctorParameters'];
(MatFooterRowDef as any)['ctorParameters'] = () => (CdkFooterRowDef as any)['ctorParameters'];
(MatRowDef as any)['ctorParameters'] = () => (CdkRowDef as any)['ctorParameters'];

/** Footer template container that contains the cell outlet. Adds the right class and role. */
@Component({
Expand Down
3 changes: 1 addition & 2 deletions src/lib/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import {CDK_TABLE_TEMPLATE, CdkTable} from '@angular/cdk/table';
import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core';
import {_inheritCtorParametersMetadata} from '@angular/material/core';

/**
* Wrapper for the CdkTable with Material design styles.
Expand All @@ -31,4 +30,4 @@ export class MatTable<T> extends CdkTable<T> {
}

// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
_inheritCtorParametersMetadata(MatTable, CdkTable);
(MatTable as any)['ctorParameters'] = () => (CdkTable as any)['ctorParameters'];
3 changes: 1 addition & 2 deletions src/lib/tabs/tab-label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import {Directive} from '@angular/core';
import {CdkPortal} from '@angular/cdk/portal';
import {_inheritCtorParametersMetadata} from '@angular/material/core';

/** Used to flag tab labels for use with the portal directive */
@Directive({
Expand All @@ -17,4 +16,4 @@ import {_inheritCtorParametersMetadata} from '@angular/material/core';
export class MatTabLabel extends CdkPortal {}

// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
_inheritCtorParametersMetadata(MatTabLabel, CdkPortal);
(MatTabLabel as any)['ctorParameters'] = () => (CdkPortal as any)['ctorParameters'];
3 changes: 1 addition & 2 deletions src/lib/tree/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
QueryList,
} from '@angular/core';
import {
_inheritCtorParametersMetadata,
CanDisable, CanDisableCtor,
HasTabIndex,
HasTabIndexCtor,
Expand Down Expand Up @@ -78,7 +77,7 @@ export class MatTreeNodeDef<T> extends CdkTreeNodeDef<T> {
}

// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
_inheritCtorParametersMetadata(MatTreeNodeDef, CdkTreeNodeDef);
(MatTreeNodeDef as any)['ctorParameters'] = () => (CdkTreeNodeDef as any)['ctorParameters'];

/**
* Wrapper for the CdkTree nested node with Material design styles.
Expand Down
4 changes: 2 additions & 2 deletions src/lib/tree/padding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/
import {CdkTreeNodePadding} from '@angular/cdk/tree';
import {Directive, Input} from '@angular/core';
import {_inheritCtorParametersMetadata} from '@angular/material/core';

/**
* Wrapper for the CdkTree padding with Material design styles.
Expand All @@ -26,4 +25,5 @@ export class MatTreeNodePadding<T> extends CdkTreeNodePadding<T> {
}

// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
_inheritCtorParametersMetadata(MatTreeNodePadding, CdkTreeNodePadding);
(MatTreeNodePadding as any)['ctorParameters'] = () =>
(CdkTreeNodePadding as any)['ctorParameters'];
3 changes: 1 addition & 2 deletions src/lib/tree/toggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import {CdkTreeNodeToggle} from '@angular/cdk/tree';
import {Directive, Input} from '@angular/core';
import {_inheritCtorParametersMetadata} from '@angular/material/core';

/**
* Wrapper for the CdkTree's toggle with Material design styles.
Expand All @@ -25,4 +24,4 @@ export class MatTreeNodeToggle<T> extends CdkTreeNodeToggle<T> {
}

// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
_inheritCtorParametersMetadata(MatTreeNodeToggle, CdkTreeNodeToggle);
(MatTreeNodeToggle as any)['ctorParameters'] = () => (CdkTreeNodeToggle as any)['ctorParameters'];
3 changes: 1 addition & 2 deletions src/lib/tree/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import {CdkTree} from '@angular/cdk/tree';
import {ChangeDetectionStrategy, Component, ViewChild, ViewEncapsulation} from '@angular/core';
import {MatTreeNodeOutlet} from './outlet';
import {_inheritCtorParametersMetadata} from '@angular/material/core';

/**
* Wrapper for the CdkTable with Material design styles.
Expand All @@ -34,4 +33,4 @@ export class MatTree<T> extends CdkTree<T> {
}

// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
_inheritCtorParametersMetadata(MatTree, CdkTree);
(MatTree as any)['ctorParameters'] = () => (CdkTree as any)['ctorParameters'];