1
0
Fork 0
mirror of synced 2024-10-02 18:16:29 +13:00

Merge branch 'master' of github.com:Budibase/budibase into feature/handlebars-migration

This commit is contained in:
mike12345567 2021-01-22 10:49:03 +00:00
commit db5ce51c67
3 changed files with 39 additions and 11 deletions

View file

@ -32,7 +32,11 @@
$builderStore.previewType === "layout" || screenslotContext
// Update component context
$: componentStore.set({ id, styles: { ...styles, id, allowSelection } })
$: componentStore.set({
id,
children: children.length,
styles: { ...styles, id, allowSelection },
})
// Gets the component constructor for the specified component
const getComponentConstructor = component => {

View file

@ -1,13 +1,19 @@
<script>
import { getContext } from "svelte"
// Add this back once we can define specific design options to expose
// const { styleable } = getContext("sdk")
// const component = getContext("component")
const { styleable } = getContext("sdk")
const component = getContext("component")
export let icon = ""
export let size = "fa-lg"
export let color = "#000"
export let color = "#f00"
$: styles = {
...$component.styles,
normal: {
...$component.styles.normal,
color,
},
}
</script>
<i style={`color: ${color};`} class={`${icon} ${size}`} />
<i use:styleable={styles} class="{icon} {size}" />

View file

@ -24,9 +24,27 @@
</script>
<div use:styleable={$component.styles}>
{#if rows.length > 0}
{#each rows as row}
<DataProvider {row}>
{#if $component.children === 0}
<p>Add some components too.</p>
{:else}
<slot />
{/if}
</DataProvider>
{/each}
{:else}
<p>Feed me some data</p>
{/if}
</div>
<style>
p {
display: grid;
place-items: center;
background: #f5f5f5;
border: #ccc 1px solid;
padding: var(--spacing-m);
}
</style>