|
|
@ -14,22 +14,18 @@ |
|
|
const block = getContext("block") |
|
|
const block = getContext("block") |
|
|
const rand = generate() |
|
|
const rand = generate() |
|
|
|
|
|
|
|
|
$: id = block.id + rand |
|
|
|
|
|
$: instance = createInstance(type, props, id) |
|
|
|
|
|
|
|
|
|
|
|
// Create a fake component instance so that we can use the core Component |
|
|
// Create a fake component instance so that we can use the core Component |
|
|
// to render this part of the block, taking advantage of binding enrichment |
|
|
// to render this part of the block, taking advantage of binding enrichment |
|
|
const createInstance = (type, props, id) => { |
|
|
$: id = block.id + rand |
|
|
return { |
|
|
$: instance = { |
|
|
_component: `@budibase/standard-components/${type}`, |
|
|
_component: `@budibase/standard-components/${type}`, |
|
|
_id: id, |
|
|
_id: id, |
|
|
_styles: { |
|
|
_styles: { |
|
|
normal: { |
|
|
normal: { |
|
|
...styles, |
|
|
...styles, |
|
|
}, |
|
|
|
|
|
}, |
|
|
}, |
|
|
...props, |
|
|
}, |
|
|
} |
|
|
...props, |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
|