From 48ed69b35eaed28ec12428e86e927e81db637b39 Mon Sep 17 00:00:00 2001 From: Rick Date: Sat, 23 Nov 2024 02:21:14 -0600 Subject: [PATCH] Implements "pause on hover" feature & exposes onMouseEnter and onMouseLeave callback props --- packages/primevue/src/toast/BaseToast.vue | 8 +++++ packages/primevue/src/toast/Toast.d.ts | 8 +++++ packages/primevue/src/toast/ToastMessage.vue | 35 +++++++++++++++++--- 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/packages/primevue/src/toast/BaseToast.vue b/packages/primevue/src/toast/BaseToast.vue index 3cd4dbb4ee..70f612ce2b 100644 --- a/packages/primevue/src/toast/BaseToast.vue +++ b/packages/primevue/src/toast/BaseToast.vue @@ -49,6 +49,14 @@ export default { closeButtonProps: { type: null, default: null + }, + onMouseEnter: { + type: Function, + default: undefined + }, + onMouseLeave: { + type: Function, + default: undefined } }, style: ToastStyle, diff --git a/packages/primevue/src/toast/Toast.d.ts b/packages/primevue/src/toast/Toast.d.ts index 6e5dece067..b0dea3f640 100755 --- a/packages/primevue/src/toast/Toast.d.ts +++ b/packages/primevue/src/toast/Toast.d.ts @@ -250,6 +250,14 @@ export interface ToastProps { * @defaultValue false */ unstyled?: boolean; + /** + * Used to specify a callback function to be run when the @mouseenter event is fired on the message component. + */ + onMouseEnter?: Function | undefined; + /** + * Used to specify a callback function to be run when the @mouseleave event is fired on the message component. + */ + onMouseLeave?: Function | undefined; } /** diff --git a/packages/primevue/src/toast/ToastMessage.vue b/packages/primevue/src/toast/ToastMessage.vue index 8e1a3988ce..1e200b7619 100755 --- a/packages/primevue/src/toast/ToastMessage.vue +++ b/packages/primevue/src/toast/ToastMessage.vue @@ -1,5 +1,5 @@