fix subgrids final
This commit is contained in:
@@ -10,14 +10,16 @@
|
||||
export let gridItems: GridItem[]
|
||||
</script>
|
||||
|
||||
{#each gridItems as gridItem (gridItem.data.id)}
|
||||
{#if gridItem.data.id === $selectedComponent}
|
||||
<ComponentPanel bind:gridItems bind:component={gridItem.data} />
|
||||
{:else if gridItem.data.type === 'tablecomponent'}
|
||||
<TablePanel bind:component={gridItem.data} />
|
||||
{:else if gridItem.data.subGrids}
|
||||
{#each gridItem.data.subGrids as subGrid}
|
||||
<svelte:self bind:gridItems={subGrid} />
|
||||
{/each}
|
||||
{/if}
|
||||
{/each}
|
||||
{#if gridItems}
|
||||
{#each gridItems as gridItem (gridItem.data.id)}
|
||||
{#if gridItem.data.id === $selectedComponent}
|
||||
<ComponentPanel bind:gridItems bind:component={gridItem.data} />
|
||||
{:else if gridItem.data.type === 'tablecomponent'}
|
||||
<TablePanel bind:component={gridItem.data} />
|
||||
{:else if gridItem.data.subGrids}
|
||||
{#each gridItem.data.subGrids as subGrid}
|
||||
<svelte:self bind:gridItems={subGrid} />
|
||||
{/each}
|
||||
{/if}
|
||||
{/each}
|
||||
{/if}
|
||||
|
||||
@@ -259,6 +259,9 @@ export function toKebabCase(text: string) {
|
||||
}
|
||||
|
||||
export function findParent(root: GridItem[], id: string): GridItem | undefined {
|
||||
if (!root) {
|
||||
return undefined
|
||||
}
|
||||
for (const a of root) {
|
||||
if (a.id === id) {
|
||||
return a
|
||||
|
||||
Reference in New Issue
Block a user