2020-01-18 00:06:42 +01:00
|
|
|
<script>
|
2020-01-28 22:17:04 +01:00
|
|
|
import ComponentPanel from "./ComponentPanel.svelte";
|
|
|
|
import ComponentsList from "./ComponentsList.svelte";
|
2020-01-18 00:06:42 +01:00
|
|
|
|
2020-01-28 22:17:04 +01:00
|
|
|
let selected="properties";
|
2020-01-18 00:06:42 +01:00
|
|
|
|
2020-01-28 22:17:04 +01:00
|
|
|
const isSelected = tab =>
|
|
|
|
selected === tab;
|
2020-01-18 00:06:42 +01:00
|
|
|
|
2020-01-28 22:17:04 +01:00
|
|
|
const selectTab = tab =>
|
|
|
|
selected = tab;
|
2020-01-18 00:06:42 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="root">
|
|
|
|
|
|
|
|
<div class="switcher">
|
|
|
|
|
2020-01-20 18:13:58 +01:00
|
|
|
<button
|
2020-01-18 00:06:42 +01:00
|
|
|
class:selected={selected==="properties"}
|
|
|
|
on:click={() => selectTab("properties")}>
|
|
|
|
Properties
|
|
|
|
</button>
|
|
|
|
|
2020-01-20 18:13:58 +01:00
|
|
|
<button
|
2020-01-18 00:06:42 +01:00
|
|
|
class:selected={selected==="components"}
|
|
|
|
on:click={() => selectTab("components")}>
|
|
|
|
Components
|
|
|
|
</button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="panel">
|
|
|
|
{#if selected==="properties"}
|
2020-01-21 15:50:35 +01:00
|
|
|
<ComponentPanel />
|
2020-01-18 00:06:42 +01:00
|
|
|
{/if}
|
|
|
|
|
|
|
|
{#if selected==="components"}
|
2020-01-21 15:50:35 +01:00
|
|
|
<ComponentsList />
|
2020-01-18 00:06:42 +01:00
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
|
|
|
.root {
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2020-01-20 18:13:58 +01:00
|
|
|
padding: 2rem 1.5rem 2rem 1.5rem;
|
2020-01-18 00:06:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.switcher {
|
2020-01-20 18:13:58 +01:00
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
2020-01-21 15:50:35 +01:00
|
|
|
margin-bottom: 25px;
|
2020-01-18 00:06:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.switcher > button {
|
|
|
|
display: inline-block;
|
2020-01-20 18:13:58 +01:00
|
|
|
border: none;
|
2020-01-21 15:50:35 +01:00
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
2020-01-18 00:06:42 +01:00
|
|
|
cursor: pointer;
|
2020-01-20 18:13:58 +01:00
|
|
|
font-weight: 600;
|
|
|
|
font-size: 0.85rem;
|
|
|
|
text-transform: uppercase;
|
|
|
|
color: #999;
|
2020-02-01 00:29:49 +01:00
|
|
|
background-color: rgba(0,0,0,0);
|
2020-01-18 00:06:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.switcher > .selected {
|
2020-01-20 18:13:58 +01:00
|
|
|
color: #333;
|
2020-01-18 00:06:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.panel {
|
|
|
|
flex: 1 1 auto;
|
|
|
|
height: 0px;
|
|
|
|
overflow-y: auto;
|
|
|
|
}
|
|
|
|
|
2020-01-20 18:13:58 +01:00
|
|
|
</style>
|