From 68d9a2bb40dd778713a2fb89b4c5244ece686344 Mon Sep 17 00:00:00 2001 From: Guilhem Date: Tue, 4 Feb 2025 17:40:01 +0000 Subject: [PATCH] use melt menu for AppMenu --- .../apps/components/display/AppMenu.svelte | 146 ++++++++++-------- .../lib/components/meltComponents/Menu.svelte | 4 +- .../components/meltComponents/Menubar.svelte | 2 +- 3 files changed, 83 insertions(+), 69 deletions(-) diff --git a/frontend/src/lib/components/apps/components/display/AppMenu.svelte b/frontend/src/lib/components/apps/components/display/AppMenu.svelte index fe105e6e5b..3dae672692 100644 --- a/frontend/src/lib/components/apps/components/display/AppMenu.svelte +++ b/frontend/src/lib/components/apps/components/display/AppMenu.svelte @@ -15,9 +15,10 @@ import { Button } from '$lib/components/common' import { loadIcon } from '../icon' import ResolveStyle from '../helpers/ResolveStyle.svelte' - import Menu from '$lib/components/common/menu/MenuV2.svelte' import { AppButton } from '../buttons' import AlignWrapper from '../helpers/AlignWrapper.svelte' + import { Menubar, Menu } from '$lib/components/meltComponents' + import { melt } from '@melt-ui/svelte' export let id: string export let configuration: RichConfigurations @@ -34,6 +35,7 @@ latestButtonClicked: undefined as string | undefined } }) + let menu: Menu | undefined = undefined const resolvedConfig = initConfig( components['menucomponent'].initialData.configuration, @@ -96,71 +98,83 @@ {#if render} - -
- -
+ + + +
+ +
+
-
- {#if menuItems.length > 0} - {#each menuItems as actionButton, actionIndex (actionButton?.id)} - {#if actionButton.type == 'buttoncomponent'} -
{ - outputs?.result.set({ - latestButtonClicked: actionButton.id - }) - }} - > - -
- {/if} - {/each} - {/if} -
-
+
+ {#if menuItems.length > 0} + {#each menuItems as actionButton, actionIndex (actionButton?.id)} + {#if actionButton.type == 'buttoncomponent'} +
{ + outputs?.result.set({ + latestButtonClicked: actionButton.id + }) + }} + > + +
+ {/if} + {/each} + {/if} +
+
+
{/if} diff --git a/frontend/src/lib/components/meltComponents/Menu.svelte b/frontend/src/lib/components/meltComponents/Menu.svelte index 44a96cae7f..820b2e5f04 100644 --- a/frontend/src/lib/components/meltComponents/Menu.svelte +++ b/frontend/src/lib/components/meltComponents/Menu.svelte @@ -37,10 +37,10 @@ } -
+
- diff --git a/frontend/src/lib/components/meltComponents/Menubar.svelte b/frontend/src/lib/components/meltComponents/Menubar.svelte index c1f4f5828a..b6a34f07a7 100644 --- a/frontend/src/lib/components/meltComponents/Menubar.svelte +++ b/frontend/src/lib/components/meltComponents/Menubar.svelte @@ -7,6 +7,6 @@ } = createMenubar() -
+