Allow custom naming of components inside blocks for better ejection

This commit is contained in:
Andrew Kingston 2022-11-17 14:20:18 +00:00
parent 4e519d75b4
commit 539b6a8a96
2 changed files with 6 additions and 1 deletions

View File

@ -8,6 +8,7 @@
export let props export let props
export let styles export let styles
export let context export let context
export let name
export let order = 0 export let order = 0
export let containsSlot = false export let containsSlot = false
@ -25,7 +26,7 @@
$: instance = { $: instance = {
_component: `@budibase/standard-components/${type}`, _component: `@budibase/standard-components/${type}`,
_id: id, _id: id,
_instanceName: type[0].toUpperCase() + type.slice(1), _instanceName: name || type[0].toUpperCase() + type.slice(1),
_styles: { _styles: {
...styles, ...styles,
normal: styles?.normal || {}, normal: styles?.normal || {},

View File

@ -208,12 +208,14 @@
</BlockComponent> </BlockComponent>
{#if clickBehaviour === "details"} {#if clickBehaviour === "details"}
<BlockComponent <BlockComponent
name="Details side panel"
type="sidepanel" type="sidepanel"
bind:id={detailsSidePanelId} bind:id={detailsSidePanelId}
context="details-side-panel" context="details-side-panel"
order={2} order={2}
> >
<BlockComponent <BlockComponent
name="Details form block"
type="formblock" type="formblock"
props={{ props={{
dataSource, dataSource,
@ -230,12 +232,14 @@
{/if} {/if}
{#if showTitleButton && titleButtonClickBehaviour === "new"} {#if showTitleButton && titleButtonClickBehaviour === "new"}
<BlockComponent <BlockComponent
name="New row side panel"
type="sidepanel" type="sidepanel"
bind:id={newRowSidePanelId} bind:id={newRowSidePanelId}
context="new-side-panel" context="new-side-panel"
order={3} order={3}
> >
<BlockComponent <BlockComponent
name="New row form block"
type="formblock" type="formblock"
props={{ props={{
dataSource, dataSource,