Skip to content

refactor: remove inherited coercion acceptance members #17911

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
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,4 @@ export class CustomStepper extends CdkStepper {
onClick(index: number): void {
this.selectedIndex = index;
}

// These properties are required so that the Ivy template type checker in strict mode knows
// what kind of values are accepted by the `linear` and `selectedIndex` inputs which
// are inherited from `CdkStepper`.
static ngAcceptInputType_linear: boolean | string | null | undefined;
static ngAcceptInputType_selectedIndex: number | string | null | undefined;
}
4 changes: 4 additions & 0 deletions src/material-experimental/mdc-button/button-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {BooleanInput} from '@angular/cdk/coercion';
import {Platform} from '@angular/cdk/platform';
import {Directive, ElementRef, HostListener, NgZone, ViewChild} from '@angular/core';
import {
Expand Down Expand Up @@ -124,6 +125,9 @@ export class MatButtonBase extends _MatButtonBaseMixin implements CanDisable, Ca
_isRippleDisabled() {
return this.disableRipple || this.disabled;
}

static ngAcceptInputType_disabled: BooleanInput;
static ngAcceptInputType_disableRipple: BooleanInput;
}

/** Shared inputs by buttons using the `<a>` tag */
Expand Down
7 changes: 0 additions & 7 deletions src/material-experimental/mdc-button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* found in the LICENSE file at https://angular.io/license
*/

import {BooleanInput} from '@angular/cdk/coercion';
import {Platform} from '@angular/cdk/platform';
import {
ChangeDetectionStrategy,
Expand Down Expand Up @@ -56,9 +55,6 @@ export class MatButton extends MatButtonBase {
@Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string) {
super(elementRef, platform, ngZone, animationMode);
}

static ngAcceptInputType_disabled: BooleanInput;
static ngAcceptInputType_disableRipple: BooleanInput;
}

/**
Expand Down Expand Up @@ -87,7 +83,4 @@ export class MatAnchor extends MatAnchorBase {
@Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string) {
super(elementRef, platform, ngZone, animationMode);
}

static ngAcceptInputType_disabled: BooleanInput;
static ngAcceptInputType_disableRipple: BooleanInput;
}
7 changes: 0 additions & 7 deletions src/material-experimental/mdc-button/fab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* found in the LICENSE file at https://angular.io/license
*/

import {BooleanInput} from '@angular/cdk/coercion';
import {Platform} from '@angular/cdk/platform';
import {
ChangeDetectionStrategy,
Expand Down Expand Up @@ -55,9 +54,6 @@ export class MatFabButton extends MatButtonBase {
@Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string) {
super(elementRef, platform, ngZone, animationMode);
}

static ngAcceptInputType_disabled: BooleanInput;
static ngAcceptInputType_disableRipple: BooleanInput;
}


Expand Down Expand Up @@ -87,7 +83,4 @@ export class MatFabAnchor extends MatAnchor {
@Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string) {
super(elementRef, platform, ngZone, animationMode);
}

static ngAcceptInputType_disabled: BooleanInput;
static ngAcceptInputType_disableRipple: BooleanInput;
}
7 changes: 0 additions & 7 deletions src/material-experimental/mdc-button/icon-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* found in the LICENSE file at https://angular.io/license
*/

import {BooleanInput} from '@angular/cdk/coercion';
import {Platform} from '@angular/cdk/platform';
import {
ChangeDetectionStrategy,
Expand Down Expand Up @@ -52,9 +51,6 @@ export class MatIconButton extends MatButtonBase {
@Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string) {
super(elementRef, platform, ngZone, animationMode);
}

static ngAcceptInputType_disabled: BooleanInput;
static ngAcceptInputType_disableRipple: BooleanInput;
}

/**
Expand All @@ -81,7 +77,4 @@ export class MatIconAnchor extends MatAnchorBase {
@Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string) {
super(elementRef, platform, ngZone, animationMode);
}

static ngAcceptInputType_disabled: BooleanInput;
static ngAcceptInputType_disableRipple: BooleanInput;
}
1 change: 0 additions & 1 deletion src/material-experimental/mdc-chips/chip-listbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,5 @@ export class MatChipListbox extends MatChipSet implements AfterContentInit, Cont
static ngAcceptInputType_multiple: BooleanInput;
static ngAcceptInputType_selectable: BooleanInput;
static ngAcceptInputType_required: BooleanInput;
static ngAcceptInputType_disabled: BooleanInput;
}

4 changes: 0 additions & 4 deletions src/material-experimental/mdc-chips/chip-option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,4 @@ export class MatChipOption extends MatChip {

static ngAcceptInputType_selectable: BooleanInput;
static ngAcceptInputType_selected: BooleanInput;
static ngAcceptInputType_disabled: BooleanInput;
static ngAcceptInputType_removable: BooleanInput;
static ngAcceptInputType_highlighted: BooleanInput;
static ngAcceptInputType_disableRipple: BooleanInput;
}
6 changes: 0 additions & 6 deletions src/material-experimental/mdc-chips/chip-row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* found in the LICENSE file at https://angular.io/license
*/

import {BooleanInput} from '@angular/cdk/coercion';
import {BACKSPACE, DELETE} from '@angular/cdk/keycodes';
import {
AfterContentInit,
Expand Down Expand Up @@ -149,9 +148,4 @@ export class MatChipRow extends MatChip implements AfterContentInit, AfterViewIn
this._handleInteraction(event);
}
}

static ngAcceptInputType_disabled: BooleanInput;
static ngAcceptInputType_removable: BooleanInput;
static ngAcceptInputType_highlighted: BooleanInput;
static ngAcceptInputType_disableRipple: BooleanInput;
}
7 changes: 1 addition & 6 deletions src/material-experimental/mdc-input/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,5 @@ import {MatInput as BaseMatInput} from '@angular/material/input';
},
providers: [{provide: MatFormFieldControl, useExisting: MatInput}],
})
export class MatInput extends BaseMatInput {
static ngAcceptInputType_disabled: boolean | string | null | undefined;
static ngAcceptInputType_readonly: boolean | string | null | undefined;
static ngAcceptInputType_required: boolean | string | null | undefined;
static ngAcceptInputType_value: any;
}
export class MatInput extends BaseMatInput {}

3 changes: 0 additions & 3 deletions src/material-experimental/mdc-menu/menu-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* found in the LICENSE file at https://angular.io/license
*/

import {BooleanInput} from '@angular/cdk/coercion';
import {Component, ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core';
import {MatMenuItem as BaseMatMenuItem} from '@angular/material/menu';

Expand Down Expand Up @@ -37,6 +36,4 @@ import {MatMenuItem as BaseMatMenuItem} from '@angular/material/menu';
]
})
export class MatMenuItem extends BaseMatMenuItem {
static ngAcceptInputType_disabled: BooleanInput;
static ngAcceptInputType_disableRipple: BooleanInput;
}
4 changes: 0 additions & 4 deletions src/material-experimental/mdc-menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* found in the LICENSE file at https://angular.io/license
*/

import {BooleanInput} from '@angular/cdk/coercion';
import {Overlay, ScrollStrategy} from '@angular/cdk/overlay';
import {
ChangeDetectionStrategy,
Expand Down Expand Up @@ -71,7 +70,4 @@ export class MatMenu extends BaseMatMenu {
// - should update the elevation when the same menu is opened at a different depth
// - should not increase the elevation if the user specified a custom one
}

static ngAcceptInputType_overlapTrigger: BooleanInput;
static ngAcceptInputType_hasBackdrop: BooleanInput;
}
1 change: 0 additions & 1 deletion src/material-experimental/mdc-table/cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export class MatColumnDef extends CdkColumnDef {
@Input('matColumnDef') name: string;

static ngAcceptInputType_sticky: BooleanInput;
static ngAcceptInputType_stickyEnd: BooleanInput;
}

/** Header cell template container that adds the right classes and role. */
Expand Down
3 changes: 0 additions & 3 deletions src/material-experimental/mdc-table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import {ChangeDetectionStrategy, Component, OnInit, ViewEncapsulation} from '@angular/core';
import {CDK_TABLE_TEMPLATE, CdkTable} from '@angular/cdk/table';
import {BooleanInput} from '@angular/cdk/coercion';

@Component({
selector: 'table[mat-table]',
Expand All @@ -28,8 +27,6 @@ export class MatTable<T> extends CdkTable<T> implements OnInit {
/** Overrides the sticky CSS class set by the `CdkTable`. */
protected stickyCssClass = 'mat-mdc-table-sticky';

static ngAcceptInputType_multiTemplateDataRows: BooleanInput;

// After ngOnInit, the `CdkTable` has created and inserted the table sections (thead, tbody,
// tfoot). MDC requires the `mdc-data-table__content` class to be added to the body.
ngOnInit() {
Expand Down
3 changes: 0 additions & 3 deletions src/material-experimental/mdc-tabs/tab-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,5 @@ export class MatTabGroup extends _MatTabGroupBase {
}

static ngAcceptInputType_fitInkBarToContent: BooleanInput;
static ngAcceptInputType_dynamicHeight: BooleanInput;
static ngAcceptInputType_animationDuration: NumberInput;
static ngAcceptInputType_selectedIndex: NumberInput;
static ngAcceptInputType_disableRipple: BooleanInput;
}
3 changes: 1 addition & 2 deletions src/material-experimental/mdc-tabs/tab-header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {BooleanInput, NumberInput} from '@angular/cdk/coercion';
import {BooleanInput} from '@angular/cdk/coercion';
import {
ChangeDetectionStrategy,
Component,
Expand Down Expand Up @@ -75,5 +75,4 @@ export class MatTabHeader extends _MatTabHeaderBase implements AfterContentInit
}

static ngAcceptInputType_disableRipple: BooleanInput;
static ngAcceptInputType_selectedIndex: NumberInput;
}
1 change: 0 additions & 1 deletion src/material-experimental/mdc-tabs/tab-label-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,4 @@ export class MatTabLabelWrapper extends BaseMatTabLabelWrapper
}

static ngAcceptInputType_fitInkBarToContent: BooleanInput;
static ngAcceptInputType_disabled: BooleanInput;
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {Directionality} from '@angular/cdk/bidi';
import {ViewportRuler} from '@angular/cdk/scrolling';
import {Platform} from '@angular/cdk/platform';
import {MatInkBar, MatInkBarItem, MatInkBarFoundation} from '../ink-bar';
import {BooleanInput, coerceBooleanProperty, NumberInput} from '@angular/cdk/coercion';
import {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';
import {BehaviorSubject, Subject} from 'rxjs';
import {takeUntil} from 'rxjs/operators';

Expand Down Expand Up @@ -104,7 +104,6 @@ export class MatTabNav extends _MatTabNavBase implements AfterContentInit {

static ngAcceptInputType_fitInkBarToContent: BooleanInput;
static ngAcceptInputType_disableRipple: BooleanInput;
static ngAcceptInputType_selectedIndex: NumberInput;
}

/**
Expand Down Expand Up @@ -156,7 +155,4 @@ export class MatTabLink extends _MatTabLinkBase implements MatInkBarItem, OnInit
super.ngOnDestroy();
this._foundation.destroy();
}

static ngAcceptInputType_disabled: BooleanInput;
static ngAcceptInputType_disableRipple: BooleanInput;
}
3 changes: 0 additions & 3 deletions src/material-experimental/mdc-tabs/tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* found in the LICENSE file at https://angular.io/license
*/

import {BooleanInput} from '@angular/cdk/coercion';
import {
ChangeDetectionStrategy,
Component,
Expand Down Expand Up @@ -39,6 +38,4 @@ export class MatTab extends BaseMatTab {

/** Content for the tab label given by `<ng-template mat-tab-label>`. */
@ContentChild(MatTabLabel) templateLabel: MatTabLabel;

static ngAcceptInputType_disabled: BooleanInput;
}
3 changes: 0 additions & 3 deletions src/material/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,4 @@ export class MatAnchor extends MatButton {
event.stopImmediatePropagation();
}
}

static ngAcceptInputType_disabled: BooleanInput;
static ngAcceptInputType_disableRipple: BooleanInput;
}
1 change: 0 additions & 1 deletion src/material/expansion/accordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,4 @@ export class MatAccordion extends CdkAccordion implements MatAccordionBase, Afte
}

static ngAcceptInputType_hideToggle: BooleanInput;
static ngAcceptInputType_multi: BooleanInput;
}
5 changes: 0 additions & 5 deletions src/material/input/autosize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* found in the LICENSE file at https://angular.io/license
*/

import {BooleanInput, NumberInput} from '@angular/cdk/coercion';
import {CdkTextareaAutosize} from '@angular/cdk/text-field';
import {Directive, Input} from '@angular/core';

Expand Down Expand Up @@ -42,8 +41,4 @@ export class MatTextareaAutosize extends CdkTextareaAutosize {
@Input()
get matTextareaAutosize(): boolean { return this.enabled; }
set matTextareaAutosize(value: boolean) { this.enabled = value; }

static ngAcceptInputType_minRows: NumberInput;
static ngAcceptInputType_maxRows: NumberInput;
static ngAcceptInputType_enabled: BooleanInput;
}
6 changes: 3 additions & 3 deletions src/material/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,9 @@ export class _MatMenuBase implements AfterContentInit, MatMenuPanel<MatMenuItem>
this._directDescendantItems.notifyOnChanges();
});
}

static ngAcceptInputType_overlapTrigger: BooleanInput;
static ngAcceptInputType_hasBackdrop: BooleanInput;
}

/** @docs-private We show the "_MatMenu" class as "MatMenu" in the docs. */
Expand Down Expand Up @@ -516,7 +519,4 @@ export class _MatMenu extends MatMenu {
@Inject(MAT_MENU_DEFAULT_OPTIONS) defaultOptions: MatMenuDefaultOptions) {
super(elementRef, ngZone, defaultOptions);
}

static ngAcceptInputType_overlapTrigger: BooleanInput;
static ngAcceptInputType_hasBackdrop: BooleanInput;
}
4 changes: 0 additions & 4 deletions src/material/progress-spinner/progress-spinner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,6 @@ export class MatSpinner extends MatProgressSpinner {
super(elementRef, platform, document, animationMode, defaults);
this.mode = 'indeterminate';
}

static ngAcceptInputType_diameter: NumberInput;
static ngAcceptInputType_strokeWidth: NumberInput;
static ngAcceptInputType_value: NumberInput;
}


Expand Down
5 changes: 0 additions & 5 deletions src/material/sidenav/sidenav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ export class MatSidenav extends MatDrawer {
static ngAcceptInputType_fixedInViewport: BooleanInput;
static ngAcceptInputType_fixedTopGap: NumberInput;
static ngAcceptInputType_fixedBottomGap: NumberInput;
static ngAcceptInputType_disableClose: BooleanInput;
static ngAcceptInputType_autoFocus: BooleanInput;
static ngAcceptInputType_opened: BooleanInput;
}


Expand Down Expand Up @@ -136,7 +133,5 @@ export class MatSidenavContainer extends MatDrawerContainer {
_allDrawers: QueryList<MatSidenav>;

@ContentChild(MatSidenavContent) _content: MatSidenavContent;

static ngAcceptInputType_autosize: BooleanInput;
static ngAcceptInputType_hasBackdrop: BooleanInput;
}
Loading