diff --git a/packages/builder/src/common/Icons/Events.svelte b/packages/builder/src/common/Icons/Events.svelte
index d3728b9901..b7d92481e3 100644
--- a/packages/builder/src/common/Icons/Events.svelte
+++ b/packages/builder/src/common/Icons/Events.svelte
@@ -4,5 +4,6 @@
width="24"
height="24">
-
+
diff --git a/packages/builder/src/common/Select.svelte b/packages/builder/src/common/Select.svelte
new file mode 100644
index 0000000000..9053803ca7
--- /dev/null
+++ b/packages/builder/src/common/Select.svelte
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+ {@html getIcon('chevron-down', '24')}
+
+
diff --git a/packages/builder/src/userInterface/EventsEditor/EventEditorModal.svelte b/packages/builder/src/userInterface/EventsEditor/EventEditorModal.svelte
index 6cb72f6310..3fa7ab44f9 100644
--- a/packages/builder/src/userInterface/EventsEditor/EventEditorModal.svelte
+++ b/packages/builder/src/userInterface/EventsEditor/EventEditorModal.svelte
@@ -1,49 +1,95 @@
-
- {action} Event
-
-
-
- .prop-container {
- flex: 1 1 auto;
- min-width: 250px;
- }
-
- .edit-icon:hover {
- cursor: pointer;
- }
-
\ No newline at end of file
+
+ {#if event}
+ {event.name}
+ {:else}
+ Create a New Component Event
+ {/if}
+ Click here to learn more about component events
+
+
+
+
Event Name
+
+
+
+
+
Event Type
+
+
+
+
+ Event Action(s)
+ {#if event.handlers}
+ {#each event.handlers as handler, index}
+ removeEventHandler(index)}
+ {handler} />
+
+ {/each}
+ {/if}
+ addEventHandler(newEventType)}>
+
+ Add Handler
+
+
diff --git a/packages/builder/src/userInterface/EventsEditor/EventsEditor.svelte b/packages/builder/src/userInterface/EventsEditor/EventsEditor.svelte
index fa21f2c56a..2947ca1b42 100644
--- a/packages/builder/src/userInterface/EventsEditor/EventsEditor.svelte
+++ b/packages/builder/src/userInterface/EventsEditor/EventsEditor.svelte
@@ -17,6 +17,7 @@
import PlusButton from "../../common/PlusButton.svelte";
import IconButton from "../../common/IconButton.svelte";
import Modal from "../../common/Modal.svelte";
+ import EventEditorModal from "./EventEditorModal.svelte";
import HandlerSelector from "./HandlerSelector.svelte";
import { PencilIcon } from "../../common/Icons";
@@ -28,12 +29,6 @@
export let onPropChanged = () => {};
export let components;
- // Structure
- // {
- // [eventName]: [{eventHandler}, {eventHandler1}],
- // [eventName1]: [{eventHandler}, {eventHandler1}],
- // }
-
let modalOpen = false;
let events = [];
let selectedEvent = {};
@@ -41,15 +36,6 @@
// TODO: only show events that have handlers
- // $: {
- // let componentEvents = {};
- // for (let propName in componentInfo) {
- // const isEventProp = findType(propName) === EVENT_TYPE;
- // if (isEventProp) componentEvents[propName] = componentInfo[propName];
- // }
- // events = componentEvents;
- // }
-
$: events =
componentInfo &&
Object.entries(componentInfo).filter(
@@ -64,8 +50,6 @@
.props[propName];
}
- console.log({ componentInfo, events, components });
-
const openModal = event => {
selectedEvent = event;
modalOpen = true;
@@ -111,8 +95,6 @@
handlers.splice(index, 1);
onPropChanged(newEventType, handlers);
};
-
- console.log("DA HANDLERS", selectedEvent.handlers);
@@ -210,7 +165,7 @@
{#each events as [name, handlers], index}
{#if handlers.length > 0}
openModal({ name, handlers, index })}>
{name}
EDIT
@@ -220,37 +175,11 @@
{/each}
-
- Create a New Component Event
- Click here to learn more about component events
-
- Event Name
-
-
- Event Type
-
-
- Event Action(s)
- {#if selectedEvent.handlers}
- {#each selectedEvent.handlers as handler, index}
-
-
- {/each}
- {/if}
- addEventHandler(newEventType)}>
-
- Add Handler
-
-
+
diff --git a/packages/builder/src/userInterface/EventsEditor/HandlerSelector.svelte b/packages/builder/src/userInterface/EventsEditor/HandlerSelector.svelte
index dffcb06278..9c30efb266 100644
--- a/packages/builder/src/userInterface/EventsEditor/HandlerSelector.svelte
+++ b/packages/builder/src/userInterface/EventsEditor/HandlerSelector.svelte
@@ -1,5 +1,6 @@