From be1fb82d1257325ba7102c9921498ba1dc530fbb Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Sun, 15 Aug 2021 15:18:08 +0200 Subject: [PATCH] refactor(multiple): clean up ripple overrides in MDC components Now that the default ripple timings have been aligned to MDC, we don't have to make any overrides in the various MDC components. --- .../mdc-button/BUILD.bazel | 1 - .../mdc-button/button-base.ts | 14 ------ .../mdc-button/button.html | 1 - .../mdc-checkbox/BUILD.bazel | 1 - .../mdc-checkbox/checkbox.html | 3 +- .../mdc-checkbox/checkbox.ts | 12 ------ .../mdc-chips/BUILD.bazel | 1 - .../mdc-chips/chip-option.html | 1 - .../mdc-chips/chip-row.html | 3 +- src/material-experimental/mdc-chips/chip.html | 1 - src/material-experimental/mdc-chips/chip.ts | 11 ----- .../mdc-list/BUILD.bazel | 1 - .../mdc-list/list-base.ts | 13 +----- .../mdc-menu/BUILD.bazel | 1 - .../mdc-menu/menu-item.html | 3 +- .../mdc-menu/menu-item.ts | 43 ++----------------- .../mdc-radio/BUILD.bazel | 1 - .../mdc-radio/radio.html | 3 +- src/material-experimental/mdc-radio/radio.ts | 13 ------ .../mdc-slide-toggle/BUILD.bazel | 1 - .../mdc-slide-toggle/slide-toggle.html | 3 +- .../mdc-slide-toggle/slide-toggle.ts | 20 +-------- 22 files changed, 10 insertions(+), 141 deletions(-) diff --git a/src/material-experimental/mdc-button/BUILD.bazel b/src/material-experimental/mdc-button/BUILD.bazel index 08f5234b3e64..aca24ef76421 100644 --- a/src/material-experimental/mdc-button/BUILD.bazel +++ b/src/material-experimental/mdc-button/BUILD.bazel @@ -28,7 +28,6 @@ ng_module( deps = [ "//src/cdk/platform", "//src/material-experimental/mdc-core", - "@npm//@material/ripple", ], ) diff --git a/src/material-experimental/mdc-button/button-base.ts b/src/material-experimental/mdc-button/button-base.ts index 84fafa308fe7..0e089a909f3b 100644 --- a/src/material-experimental/mdc-button/button-base.ts +++ b/src/material-experimental/mdc-button/button-base.ts @@ -17,9 +17,7 @@ import { mixinColor, mixinDisabled, mixinDisableRipple, - RippleAnimationConfig } from '@angular/material-experimental/mdc-core'; -import {numbers} from '@material/ripple'; import {FocusOrigin} from '@angular/cdk/a11y'; /** Inputs common to all buttons. */ @@ -38,12 +36,6 @@ export const MAT_BUTTON_HOST = { '[class.mat-mdc-button-base]': 'true', }; -/** Configuration for the ripple animation. */ -const RIPPLE_ANIMATION_CONFIG: RippleAnimationConfig = { - enterDuration: numbers.DEACTIVATION_TIMEOUT_MS, - exitDuration: numbers.FG_DEACTIVATION_MS -}; - /** List of classes to add to buttons instances based on host attribute selector. */ const HOST_SELECTOR_MDC_CLASS_PAIR: {selector: string, mdcClasses: string[]}[] = [ { @@ -86,12 +78,6 @@ export const _MatButtonMixin = mixinColor(mixinDisabled(mixinDisableRipple(class @Directive() export class MatButtonBase extends _MatButtonMixin implements CanDisable, CanColor, CanDisableRipple { - /** The ripple animation configuration to use for the buttons. */ - _rippleAnimation: RippleAnimationConfig = - this._animationMode === 'NoopAnimations' ? - {enterDuration: 0, exitDuration: 0} : - RIPPLE_ANIMATION_CONFIG; - /** Whether the ripple is centered on the button. */ _isRippleCentered = false; diff --git a/src/material-experimental/mdc-button/button.html b/src/material-experimental/mdc-button/button.html index e5abbe3801ee..acca8bffd4c9 100644 --- a/src/material-experimental/mdc-button/button.html +++ b/src/material-experimental/mdc-button/button.html @@ -17,7 +17,6 @@ diff --git a/src/material-experimental/mdc-checkbox/BUILD.bazel b/src/material-experimental/mdc-checkbox/BUILD.bazel index 70a2ce3bac51..2a3a07b54bbd 100644 --- a/src/material-experimental/mdc-checkbox/BUILD.bazel +++ b/src/material-experimental/mdc-checkbox/BUILD.bazel @@ -29,7 +29,6 @@ ng_module( "@npm//@angular/core", "@npm//@angular/forms", "@npm//@material/checkbox", - "@npm//@material/ripple", ], ) diff --git a/src/material-experimental/mdc-checkbox/checkbox.html b/src/material-experimental/mdc-checkbox/checkbox.html index a19e937c6e24..ab7e526e3c6e 100644 --- a/src/material-experimental/mdc-checkbox/checkbox.html +++ b/src/material-experimental/mdc-checkbox/checkbox.html @@ -34,8 +34,7 @@
+ [matRippleCentered]="true">