From 27188643e0cc24a623184b0458d6704f93c06a00 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Mon, 17 May 2021 01:11:35 +0530 Subject: [PATCH] Multi Collapse --- src/lib/components/card.svelte | 10 ++++- src/lib/components/history/history.svelte | 21 ++++------- src/lib/components/preset.svelte | 21 ++++++----- src/lib/components/tabs.svelte | 45 ++++++++++++----------- src/routes/edit.svelte | 43 +++++++++------------- 5 files changed, 71 insertions(+), 69 deletions(-) diff --git a/src/lib/components/card.svelte b/src/lib/components/card.svelte index 09cb8472..6b5e5458 100644 --- a/src/lib/components/card.svelte +++ b/src/lib/components/card.svelte @@ -1,11 +1,19 @@
- +
+ +
+ +
+
{#if isOpen}
diff --git a/src/lib/components/history/history.svelte b/src/lib/components/history/history.svelte index 6e08c835..ea218b5a 100644 --- a/src/lib/components/history/history.svelte +++ b/src/lib/components/history/history.svelte @@ -69,19 +69,14 @@ let isOpen = true; - -
-
- -
-
- - -
+ +
+ +
    {#each $historyStore as { state, time, name }} diff --git a/src/lib/components/preset.svelte b/src/lib/components/preset.svelte index 7a3f8475..6f5a84a9 100644 --- a/src/lib/components/preset.svelte +++ b/src/lib/components/preset.svelte @@ -1,5 +1,6 @@ -
    - {#each Object.keys(samples) as sample} - - {/each} -
    + +
    + {#each Object.keys(samples) as sample} + + {/each} +
    +
    diff --git a/src/lib/components/tabs.svelte b/src/lib/components/tabs.svelte index 81a880b0..70715f99 100644 --- a/src/lib/components/tabs.svelte +++ b/src/lib/components/tabs.svelte @@ -3,10 +3,11 @@ import { fade } from 'svelte/transition'; export let tabs: Tab[] = []; - export let activeTabID: string = tabs[0].id; export let title: string; - export let isOpen = false; + + let activeTabID: string = tabs[0]?.id; + const dispatch = createEventDispatcher(); const toggleTabs = (tab: Tab) => { activeTabID = tab.id; @@ -14,22 +15,24 @@ }; - (isOpen = !isOpen)}>{title} -{#if isOpen} - -{/if} +
    + (isOpen = !isOpen)}>{title} + {#if isOpen && tabs} + + {/if} +
    diff --git a/src/routes/edit.svelte b/src/routes/edit.svelte index 681eaf4e..0a6a19e7 100644 --- a/src/routes/edit.svelte +++ b/src/routes/edit.svelte @@ -4,7 +4,6 @@ import Preset from '$lib/components/preset.svelte'; import View from '$lib/components/view.svelte'; import Card from '$lib/components/card.svelte'; - import Tabs from '$lib/components/tabs.svelte'; import History from '$lib/components/history/history.svelte'; import { initURLSubscription, @@ -111,22 +110,17 @@
    - -
    -
    - -
    -
    - {#if !$codeStore.autoSync} - - {/if} - -
    + +
    + {#if !$codeStore.autoSync} + + {/if} +
    @@ -140,14 +134,13 @@
    - -
    -
    Diagram
    - -
    + + +