Component panel now uses Tabs component

This commit is contained in:
Keviin Åberg Kultalahti 2021-04-16 11:28:53 +02:00
parent 65309a5b98
commit 32c2aa00b0
3 changed files with 23 additions and 26 deletions

View File

@ -27,7 +27,6 @@
]
let modal
let routes = {}
$: selected = tabs.find(t => t.key === $params.assetType).title
const navigate = ({detail}) => {

View File

@ -1,6 +1,7 @@
<script>
import { get } from "svelte/store"
import { store, selectedComponent, currentAsset } from "builderStore"
import { Tabs, Tab } from '@budibase/bbui'
import { FrontendTypes } from "constants"
import CategoryTab from "./CategoryTab.svelte"
import DesignView from "./DesignView.svelte"
@ -44,47 +45,46 @@
}
</script>
<CategoryTab
onClick={category => (selectedCategory = category)}
{categories}
{selectedCategory} />
{#if definition && definition.name}
<div class="instance-name">{definition.name}</div>
{/if}
<div class="component-props-container">
{#if selectedCategory.value === 'design'}
<DesignView
<Tabs selected="Settings">
<Tab title="Settings">
<div class="tab-content-padding">
{#if definition && definition.name}
<div class="instance-name">{definition.name}</div>
{/if}
<DesignView
componentInstance={$selectedComponent}
componentDefinition={definition}
{onStyleChanged}
{onCustomStyleChanged}
{onUpdateTransition}
{onResetStyles} />
{:else if selectedCategory.value === 'settings'}
<SettingsView
</div>
</Tab>
<Tab title="Design">
<div class="tab-content-padding">
{#if definition && definition.name}
<div class="instance-name">{definition.name}</div>
{/if}
<SettingsView
componentInstance={$selectedComponent}
componentDefinition={definition}
{showDisplayName}
onChange={store.actions.components.updateProp}
onScreenPropChange={setAssetProps}
assetInstance={$store.currentView !== 'component' && $currentAsset} />
{/if}
</div>
</div>
</Tab>
</Tabs>
<style>
.component-props-container {
flex: 1 1 auto;
min-height: 0;
overflow-y: auto;
margin-left: -20px;
margin-right: -20px;
padding: 0 20px;
.tab-content-padding {
padding: 0 var(--spacing-s);
}
.instance-name {
font-size: var(--font-size-xs);
margin-bottom: var(--spacing-l);
font-weight: 500;
color: var(--grey-7);
}

View File

@ -206,8 +206,6 @@
flex-direction: column;
justify-content: flex-start;
align-items: stretch;
gap: var(--spacing-l);
padding: var(--spacing-l) var(--spacing-xl);
border-left: var(--border-light);
}
</style>