Budibase is an open-source low-code platform for creating internal apps in minutes. Supports PostgreSQL, MySQL, MSSQL, MongoDB, Rest API, Docker, K8s 🚀
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
1008 B

<script>
import { componentStore } from "../store"
import { getValidProps } from "../utils"
export let definition = {}
$: componentProps = getValidProps(definition)
$: children = definition._children
$: componentName = extractComponentName(definition._component)
$: constructor = componentStore.actions.getComponent(componentName)
$: id = `${componentName}-${definition._id}`
$: styles = { ...definition._styles, id }
// Extracts the actual component name from the library name
function extractComponentName(name) {
console.log(name)
if (name == null) {
console.log(definition)
}
const split = name.split("/")
return split[split.length - 1]
}
$: console.log("Rendering: " + componentName)
</script>
{#if constructor}
<svelte:component this={constructor} {...componentProps} {styles}>
{#if children && children.length}
{#each children as child}
<svelte:self definition={child} />
{/each}
{/if}
</svelte:component>
{/if}