From 3f56ca656dd66575dc2754a87f3fb04e293f5e0c Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Tue, 7 Jan 2025 14:28:22 +0300 Subject: [PATCH] Fixed #7053 --- packages/primevue/src/toast/BaseToast.vue | 4 ++++ packages/primevue/src/toast/Toast.d.ts | 20 ++++++++++++-------- packages/primevue/src/toast/ToastMessage.vue | 9 ++++++--- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/packages/primevue/src/toast/BaseToast.vue b/packages/primevue/src/toast/BaseToast.vue index 70f612ce2..eefe29167 100644 --- a/packages/primevue/src/toast/BaseToast.vue +++ b/packages/primevue/src/toast/BaseToast.vue @@ -57,6 +57,10 @@ export default { onMouseLeave: { type: Function, default: undefined + }, + onClick: { + 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 b0dea3f64..4c05b7fe9 100755 --- a/packages/primevue/src/toast/Toast.d.ts +++ b/packages/primevue/src/toast/Toast.d.ts @@ -231,6 +231,18 @@ export interface ToastProps { * @type {ToastMessageOptions} */ message?: ToastMessageOptions; + /** + * 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; + /** + * Used to specify a callback function to be run when the click event is fired on the message component. + */ + onClick?: Function | undefined; /** * It generates scoped CSS variables using design tokens for the component. */ @@ -250,14 +262,6 @@ 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 5430692f8..e3621fe8b 100755 --- a/packages/primevue/src/toast/ToastMessage.vue +++ b/packages/primevue/src/toast/ToastMessage.vue @@ -1,5 +1,5 @@