adds an empty state if there is no datasource selected.
This commit is contained in:
parent
cbaffe798a
commit
d4b27f7bc4
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
const { API, styleable, DataProvider } = getContext("sdk")
|
const { API, styleable, DataProvider } = getContext("sdk")
|
||||||
const component = getContext("component")
|
const component = getContext("component")
|
||||||
|
console.log($component)
|
||||||
const dataContext = getContext("data")
|
const dataContext = getContext("data")
|
||||||
|
|
||||||
export let datasource = []
|
export let datasource = []
|
||||||
|
@ -24,9 +25,23 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div use:styleable={$component.styles}>
|
<div use:styleable={$component.styles}>
|
||||||
|
{#if rows.length > 0}
|
||||||
{#each rows as row}
|
{#each rows as row}
|
||||||
<DataProvider {row}>
|
<DataProvider {row}>
|
||||||
<slot />
|
<slot />
|
||||||
</DataProvider>
|
</DataProvider>
|
||||||
{/each}
|
{/each}
|
||||||
|
{:else}
|
||||||
|
<p>Feed me some data</p>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
p {
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
background: #f5f5f5;
|
||||||
|
border: #ccc 1px solid;
|
||||||
|
padding: var(--spacing-m);
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in New Issue