Update section component to use new placeholder styles
This commit is contained in:
parent
50d1ba6f37
commit
147e4b6292
|
@ -58,6 +58,7 @@
|
||||||
"type": "select",
|
"type": "select",
|
||||||
"label": "Direction",
|
"label": "Direction",
|
||||||
"key": "direction",
|
"key": "direction",
|
||||||
|
"key": "direction",
|
||||||
"showInBar": true,
|
"showInBar": true,
|
||||||
"options": [
|
"options": [
|
||||||
{
|
{
|
||||||
|
@ -172,6 +173,7 @@
|
||||||
"styleable": true,
|
"styleable": true,
|
||||||
"transitionable": true,
|
"transitionable": true,
|
||||||
"illegalChildren": ["Section"],
|
"illegalChildren": ["Section"],
|
||||||
|
"showEmptyState": false,
|
||||||
"settings": [
|
"settings": [
|
||||||
{
|
{
|
||||||
"type": "section",
|
"type": "section",
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
<script>
|
<script>
|
||||||
import { getContext } from "svelte"
|
import { getContext } from "svelte"
|
||||||
|
import Placeholder from "./Placeholder.svelte"
|
||||||
|
|
||||||
const { styleable, transition } = getContext("sdk")
|
const { styleable, transition, builderStore } = getContext("sdk")
|
||||||
const component = getContext("component")
|
const component = getContext("component")
|
||||||
|
|
||||||
export let type = "mainSidebar"
|
export let type = "mainSidebar"
|
||||||
export let gap = "16px"
|
export let gap = "16px"
|
||||||
export let minSize = 250
|
export let minSize = 250
|
||||||
|
@ -36,7 +38,9 @@
|
||||||
<slot />
|
<slot />
|
||||||
{#if layoutMap[type] - $component.children > 0}
|
{#if layoutMap[type] - $component.children > 0}
|
||||||
{#each new Array(layoutMap[type] - $component.children) as _}
|
{#each new Array(layoutMap[type] - $component.children) as _}
|
||||||
<p><i class="ri-image-line" />Add some components to display.</p>
|
<div class:placeholder={$builderStore.inBuilder}>
|
||||||
|
<Placeholder />
|
||||||
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
@ -79,4 +83,9 @@
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
color: var(--grey-5);
|
color: var(--grey-5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.placeholder {
|
||||||
|
border: 2px dashed var(--grey-5);
|
||||||
|
padding: var(--spacing-l);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue