From b1e76976a84ff65fd6f0e9a23ed80eda35af76e4 Mon Sep 17 00:00:00 2001 From: acondal Date: Mon, 12 Aug 2024 12:17:18 +0200 Subject: [PATCH] feat: Make events configurable via props --- .../src/components/modals/main-modal.vue | 80 +++++++++++++------ 1 file changed, 56 insertions(+), 24 deletions(-) diff --git a/packages/x-components/src/components/modals/main-modal.vue b/packages/x-components/src/components/modals/main-modal.vue index 9af67045c..c1d1a20dd 100644 --- a/packages/x-components/src/components/modals/main-modal.vue +++ b/packages/x-components/src/components/modals/main-modal.vue @@ -14,7 +14,7 @@ @@ -126,6 +119,45 @@ The `contentClass` prop can be used to add classes to the modal content. + +``` + +### Customizing the modal events + +The modal events can be customized by changing its props values: + +- To add or subtract events to open or close the modal, +- To modify or remove the default + [`UserClickedOutOfMainModal`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts) + that the modal emits. + +In this example, we are changing the `openEvents` prop to add another event, and removing the event +that the modal would emit when the user clicks out of the modal. + +```vue live + +