diff --git a/components/lib/ripple/Ripple.js b/components/lib/ripple/Ripple.js index 69a17995a..12d41892f 100644 --- a/components/lib/ripple/Ripple.js +++ b/components/lib/ripple/Ripple.js @@ -9,6 +9,8 @@ const Ripple = BaseRipple.extend('ripple', { this.bindEvents(this.$host); this.$host.setAttribute('data-pd-ripple', true); + this.$host.style['overflow'] = 'hidden'; + this.$host.style['position'] = 'relative'; } else { this.remove(this.$host); this.$host.removeAttribute('data-pd-ripple'); @@ -46,6 +48,9 @@ const Ripple = BaseRipple.extend('ripple', { let ink = this.getInk(el); if (ink) { + this.$host.style['overflow'] = ''; + this.$host.style['position'] = ''; + this.unbindEvents(el); ink.removeEventListener('animationend', this.onAnimationEnd); ink.remove(); diff --git a/components/lib/ripple/style/RippleStyle.js b/components/lib/ripple/style/RippleStyle.js index 5a8902ae1..d5246b6ee 100644 --- a/components/lib/ripple/style/RippleStyle.js +++ b/components/lib/ripple/style/RippleStyle.js @@ -1,15 +1,10 @@ import BaseStyle from 'primevue/base/style'; const theme = ({ dt }) => ` -.p-ripple { - overflow: hidden; - position: relative; -} - .p-ink { display: block; position: absolute; - background: rgba(255, 255, 255, 0.5); + background: ${dt('ripple.background')}; border-radius: 100%; transform: scale(0); pointer-events: none; diff --git a/components/lib/themes/aura/index.js b/components/lib/themes/aura/index.js index 325e40b68..75a2897db 100644 --- a/components/lib/themes/aura/index.js +++ b/components/lib/themes/aura/index.js @@ -56,6 +56,7 @@ import progressbar from 'primevue/themes/aura/progressbar'; import progressspinner from 'primevue/themes/aura/progressspinner'; import radiobutton from 'primevue/themes/aura/radiobutton'; import rating from 'primevue/themes/aura/rating'; +import ripple from 'primevue/themes/aura/ripple'; import scrollpanel from 'primevue/themes/aura/scrollpanel'; import scrolltop from 'primevue/themes/aura/scrolltop'; import select from 'primevue/themes/aura/select'; @@ -542,6 +543,7 @@ export default { toolbar }, directives: { - tooltip + tooltip, + ripple } }; diff --git a/components/lib/themes/aura/ripple/index.d.ts b/components/lib/themes/aura/ripple/index.d.ts new file mode 100644 index 000000000..e69de29bb diff --git a/components/lib/themes/aura/ripple/index.js b/components/lib/themes/aura/ripple/index.js new file mode 100644 index 000000000..f760c8d3d --- /dev/null +++ b/components/lib/themes/aura/ripple/index.js @@ -0,0 +1,10 @@ +export default { + colorScheme: { + light: { + background: 'rgba(0,0,0,0.5)' + }, + dark: { + background: 'rgba(255,255,255,0.5)' + } + } +}; diff --git a/components/lib/themes/aura/ripple/package.json b/components/lib/themes/aura/ripple/package.json new file mode 100644 index 000000000..f8e9d7ae0 --- /dev/null +++ b/components/lib/themes/aura/ripple/package.json @@ -0,0 +1,6 @@ +{ + "main": "./index.cjs.js", + "module": "./index.esm.js", + "unpkg": "./index.min.js", + "types": "./index.d.ts" +} diff --git a/components/lib/themes/lara/index.js b/components/lib/themes/lara/index.js index a44ec3487..ee5a2b41f 100644 --- a/components/lib/themes/lara/index.js +++ b/components/lib/themes/lara/index.js @@ -56,6 +56,7 @@ import progressbar from 'primevue/themes/lara/progressbar'; import progressspinner from 'primevue/themes/lara/progressspinner'; import radiobutton from 'primevue/themes/lara/radiobutton'; import rating from 'primevue/themes/lara/rating'; +import ripple from 'primevue/themes/lara/ripple'; import scrollpanel from 'primevue/themes/lara/scrollpanel'; import scrolltop from 'primevue/themes/lara/scrolltop'; import select from 'primevue/themes/lara/select'; @@ -547,6 +548,7 @@ export default { toolbar }, directives: { - tooltip + tooltip, + ripple } }; diff --git a/components/lib/themes/lara/ripple/index.d.ts b/components/lib/themes/lara/ripple/index.d.ts new file mode 100644 index 000000000..e69de29bb diff --git a/components/lib/themes/lara/ripple/index.js b/components/lib/themes/lara/ripple/index.js new file mode 100644 index 000000000..f760c8d3d --- /dev/null +++ b/components/lib/themes/lara/ripple/index.js @@ -0,0 +1,10 @@ +export default { + colorScheme: { + light: { + background: 'rgba(0,0,0,0.5)' + }, + dark: { + background: 'rgba(255,255,255,0.5)' + } + } +}; diff --git a/components/lib/themes/lara/ripple/package.json b/components/lib/themes/lara/ripple/package.json new file mode 100644 index 000000000..f8e9d7ae0 --- /dev/null +++ b/components/lib/themes/lara/ripple/package.json @@ -0,0 +1,6 @@ +{ + "main": "./index.cjs.js", + "module": "./index.esm.js", + "unpkg": "./index.min.js", + "types": "./index.d.ts" +} diff --git a/doc/ripple/CustomDoc.vue b/doc/ripple/CustomDoc.vue index 6d3859572..1328341ab 100644 --- a/doc/ripple/CustomDoc.vue +++ b/doc/ripple/CustomDoc.vue @@ -5,39 +5,9 @@