From e32f201485b04f7dfa0b339986ee9e7c352acbcc Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Wed, 2 Jan 2019 20:19:10 +0100 Subject: [PATCH] feat(ripples): support updating global ripple options at runtime * Allows updating any global ripple option at runtime. This makes it possible for developers to disable ripples at runtime. Closes #9729 --- src/dev-app/dev-app-module.ts | 3 + src/dev-app/dev-app.html | 3 + src/dev-app/dev-app.ts | 4 +- src/dev-app/ripple/ripple-options.ts | 21 ++++ src/lib/chips/BUILD.bazel | 1 + src/lib/chips/chip.spec.ts | 19 ++- src/lib/chips/chip.ts | 24 ++-- src/lib/core/ripple/ripple.md | 52 +++++++- src/lib/core/ripple/ripple.ts | 2 +- src/lib/tabs/tab-nav-bar/tab-nav-bar.spec.ts | 124 +++++++++++-------- src/lib/tabs/tab-nav-bar/tab-nav-bar.ts | 26 ++-- 11 files changed, 183 insertions(+), 96 deletions(-) create mode 100644 src/dev-app/ripple/ripple-options.ts diff --git a/src/dev-app/dev-app-module.ts b/src/dev-app/dev-app-module.ts index 2696a3d5600f..703c420369f0 100644 --- a/src/dev-app/dev-app-module.ts +++ b/src/dev-app/dev-app-module.ts @@ -12,6 +12,7 @@ import {CommonModule} from '@angular/common'; import {HttpClientModule} from '@angular/common/http'; import {NgModule} from '@angular/core'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; +import {MAT_RIPPLE_GLOBAL_OPTIONS} from '@angular/material'; import {ExampleModule} from '@angular/material-examples'; import {BrowserModule} from '@angular/platform-browser'; import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; @@ -50,6 +51,7 @@ import {ProgressBarDemo} from './progress-bar/progress-bar-demo'; import {ProgressSpinnerDemo} from './progress-spinner/progress-spinner-demo'; import {RadioDemo} from './radio/radio-demo'; import {RippleDemo} from './ripple/ripple-demo'; +import {DevAppRippleOptions} from './ripple/ripple-options'; import {DEV_APP_ROUTES} from './routes'; import {ScreenTypeDemo} from './screen-type/screen-type-demo'; import {SelectDemo} from './select/select-demo'; @@ -140,6 +142,7 @@ import {VirtualScrollDemo} from './virtual-scroll/virtual-scroll-demo'; ], providers: [ {provide: OverlayContainer, useClass: FullscreenOverlayContainer}, + {provide: MAT_RIPPLE_GLOBAL_OPTIONS, useExisting: DevAppRippleOptions}, ], entryComponents: [ ContentElementDialog, diff --git a/src/dev-app/dev-app.html b/src/dev-app/dev-app.html index 03be9382beaf..dfa9a3263bb2 100644 --- a/src/dev-app/dev-app.html +++ b/src/dev-app/dev-app.html @@ -34,6 +34,9 @@

Angular Material Demos

fullscreen +