reflex/reflex/components/sonner
Masen Furer 76c8b2dfbd
Get action, cancel, on_dismiss and on_auto_close working for rx.toast (#3216)
* Get `action` and `cancel` working for rx.toast

Respect defaults set in ToastProvider toast_options when firing a toast with
it's own ToastProps set.

* Update reflex/components/sonner/toast.py

Co-authored-by: Thomas Brandého <thomas.brandeho@gmail.com>

* Move queueEvent formatting into rx.utils.format module

Implement on_auto_close and on_dismiss callbacks inside ToastProps

* Update rx.call_script to use new format.format_queue_events

Replace duplicate logic in rx.call_script for handling the callback function.

* Move PropsBase to reflex.components.props

This base class will be exposed via rx._x.PropsBase and can be shared by other
wrapped components that need to pass a JS object full of extra props.

---------

Co-authored-by: Thomas Brandého <thomas.brandeho@gmail.com>
2024-05-15 11:54:52 +02:00
..
__init__.py add toast component (#3186) 2024-05-03 12:09:11 -07:00
toast.py Get action, cancel, on_dismiss and on_auto_close working for rx.toast (#3216) 2024-05-15 11:54:52 +02:00
toast.pyi Get action, cancel, on_dismiss and on_auto_close working for rx.toast (#3216) 2024-05-15 11:54:52 +02:00