Merge branch 'state-and-bindings-panels' of github.com:Budibase/budibase into state-and-bindings-panels

This commit is contained in:
Andrew Kingston 2025-01-21 15:45:15 +00:00
commit 5a38b9f5e8
No known key found for this signature in database
1 changed files with 39 additions and 3 deletions

View File

@ -1,15 +1,41 @@
<script> <script lang="ts">
import ScreenList from "./ScreenList/index.svelte" import ScreenList from "./ScreenList/index.svelte"
import ComponentList from "./ComponentList/index.svelte" import ComponentList from "./ComponentList/index.svelte"
import { getHorizontalResizeActions } from "@/components/common/resizable" import { getHorizontalResizeActions } from "@/components/common/resizable"
import { ActionButton } from "@budibase/bbui"
const [resizable, resizableHandle] = getHorizontalResizeActions() const [resizable, resizableHandle] = getHorizontalResizeActions()
enum Tabs {
Components = "Components",
Bindings = "Bindings",
State = "State",
}
let activeTab = Tabs.Components
</script> </script>
<div class="panel" use:resizable> <div class="panel" use:resizable>
<div class="content"> <div class="content">
<ScreenList /> <ScreenList />
<div class="tabs">
{#each Object.values(Tabs) as tab}
<ActionButton
quiet
selected={activeTab === tab}
on:click={() => (activeTab = tab)}
>
{tab}
</ActionButton>
{/each}
</div>
{#if activeTab === Tabs.Components}
<ComponentList /> <ComponentList />
{:else if activeTab === Tabs.Bindings}
<div class="tab-content">Bindings</div>
{:else if activeTab === Tabs.State}
<div class="tab-content">State</div>
{/if}
</div> </div>
<div class="divider"> <div class="divider">
<div class="dividerClickExtender" role="separator" use:resizableHandle /> <div class="dividerClickExtender" role="separator" use:resizableHandle />
@ -34,6 +60,17 @@
position: relative; position: relative;
} }
.tabs {
display: flex;
flex-direction: row;
gap: 8px;
padding: var(--spacing-m) var(--spacing-l);
border-bottom: var(--border-light);
}
.tab-content {
padding: var(--spacing-l);
}
.divider { .divider {
position: relative; position: relative;
height: 100%; height: 100%;
@ -45,7 +82,6 @@
background: var(--spectrum-global-color-gray-300); background: var(--spectrum-global-color-gray-300);
cursor: row-resize; cursor: row-resize;
} }
.dividerClickExtender { .dividerClickExtender {
position: absolute; position: absolute;
cursor: col-resize; cursor: col-resize;