From 0146cd0c88681290010baa4a7eeffb4ec6e100d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Mon, 26 Apr 2021 17:34:28 +0200 Subject: [PATCH] converts component adding buttons in design section --- .../bbui/src/ActionMenu/ActionMenu.svelte | 5 +- packages/bbui/src/Menu/Item.svelte | 33 +++++++--- .../AppPreview/ComponentSelectionList.svelte | 65 +++++++------------ 3 files changed, 50 insertions(+), 53 deletions(-) diff --git a/packages/bbui/src/ActionMenu/ActionMenu.svelte b/packages/bbui/src/ActionMenu/ActionMenu.svelte index c412a2d2c1..f194b7b465 100644 --- a/packages/bbui/src/ActionMenu/ActionMenu.svelte +++ b/packages/bbui/src/ActionMenu/ActionMenu.svelte @@ -1,6 +1,9 @@ -
+
diff --git a/packages/bbui/src/Menu/Item.svelte b/packages/bbui/src/Menu/Item.svelte index 00ad3473ae..a942cce6e9 100644 --- a/packages/bbui/src/Menu/Item.svelte +++ b/packages/bbui/src/Menu/Item.svelte @@ -1,13 +1,26 @@ - \ No newline at end of file + diff --git a/packages/builder/src/components/design/AppPreview/ComponentSelectionList.svelte b/packages/builder/src/components/design/AppPreview/ComponentSelectionList.svelte index 4c4c3a1871..2ca53b4cf1 100644 --- a/packages/builder/src/components/design/AppPreview/ComponentSelectionList.svelte +++ b/packages/builder/src/components/design/AppPreview/ComponentSelectionList.svelte @@ -1,14 +1,8 @@ -
+ {#each enrichedStructure as item, idx} -
onItemChosen(item, idx)} - class:active={idx === selectedIndex}> - {#if item.icon}{/if} - {item.name} - {#if item.isCategory}{/if} -
+ + onItemChosen(item, idx, open)}> + {item.name} + + {#each item.children || [] as item} + {#if !item.showOnAsset || item.showOnAsset.includes($currentAssetName)} + + {item.name} + + {/if} + {/each} + {/each} -
- (selectedIndex = null)} - bind:this={popover} - {anchor} - align="left"> - - {#each enrichedStructure[selectedIndex].children as item} - {#if !item.showOnAsset || item.showOnAsset.includes($currentAssetName)} - onItemChosen(item)} /> - {/if} - {/each} - - +