mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-11 08:07:15 +00:00
subgrid fix
This commit is contained in:
@@ -122,7 +122,9 @@
|
||||
{/if}
|
||||
</div>
|
||||
{:else if $app.subgrids}
|
||||
{JSON.stringify(resolvedConditions)}
|
||||
{#each resolvedConditions ?? [] as _res, i}
|
||||
{i}
|
||||
<SubGridEditor visible={false} {id} subGridId={`${id}-${i}`} />
|
||||
{/each}
|
||||
{/if}
|
||||
|
||||
@@ -153,75 +153,73 @@
|
||||
? 'divide-y flex-col'
|
||||
: 'flex-col'}"
|
||||
>
|
||||
{#if $app.subgrids?.[`${id}-0`]}
|
||||
{#if Array.isArray(result) && result.length > 0}
|
||||
{#each result ?? [] as value, index (index)}
|
||||
{@const inRange = index <= pagination.maxIndex && index >= pagination.indexOffset}
|
||||
<div
|
||||
style={inRange
|
||||
? `${
|
||||
isCard
|
||||
? `min-width: ${resolvedConfig.width?.configuration?.card?.minWidthPx}px; `
|
||||
: ''
|
||||
} max-height: ${resolvedConfig.heightPx}px;`
|
||||
: ''}
|
||||
class={inRange
|
||||
? `${
|
||||
$allIdsInPath.includes(id)
|
||||
? 'overflow-visible'
|
||||
: resolvedConfig.heightPx
|
||||
? 'overflow-auto'
|
||||
: ''
|
||||
} ${!isCard ? 'w-full' : resolvedConfig?.displayBorders ? 'border' : ''}`
|
||||
: 'h-0 float overflow-hidden invisible absolute'}
|
||||
{#if $app.subgrids?.[`${id}-0`] && Array.isArray(result) && result.length > 0}
|
||||
{#each result ?? [] as value, index (index)}
|
||||
{@const inRange = index <= pagination.maxIndex && index >= pagination.indexOffset}
|
||||
<div
|
||||
style={inRange
|
||||
? `${
|
||||
isCard
|
||||
? `min-width: ${resolvedConfig.width?.configuration?.card?.minWidthPx}px; `
|
||||
: ''
|
||||
} max-height: ${resolvedConfig.heightPx}px;`
|
||||
: ''}
|
||||
class={inRange
|
||||
? `${
|
||||
$allIdsInPath.includes(id)
|
||||
? 'overflow-visible'
|
||||
: resolvedConfig.heightPx
|
||||
? 'overflow-auto'
|
||||
: ''
|
||||
} ${!isCard ? 'w-full' : resolvedConfig?.displayBorders ? 'border' : ''}`
|
||||
: 'h-0 float overflow-hidden invisible absolute'}
|
||||
>
|
||||
<ListWrapper
|
||||
onSet={(id, value) => {
|
||||
if (!inputs[id]) {
|
||||
inputs[id] = { [index]: value }
|
||||
} else {
|
||||
inputs[id] = { ...inputs[id], [index]: value }
|
||||
}
|
||||
outputs?.inputs.set(inputs, true)
|
||||
}}
|
||||
onRemove={(id) => {
|
||||
if (inputs?.[id] == undefined) {
|
||||
return
|
||||
}
|
||||
if (index == 0) {
|
||||
delete inputs[id]
|
||||
inputs = { ...inputs }
|
||||
} else {
|
||||
delete inputs[id][index]
|
||||
inputs[id] = { ...inputs[id] }
|
||||
}
|
||||
outputs?.inputs.set(inputs, true)
|
||||
}}
|
||||
{value}
|
||||
{index}
|
||||
>
|
||||
<ListWrapper
|
||||
onSet={(id, value) => {
|
||||
if (!inputs[id]) {
|
||||
inputs[id] = { [index]: value }
|
||||
} else {
|
||||
inputs[id] = { ...inputs[id], [index]: value }
|
||||
<SubGridEditor
|
||||
visible={render && inRange}
|
||||
{id}
|
||||
subGridId={`${id}-0`}
|
||||
containerHeight={resolvedConfig.heightPx}
|
||||
on:focus={() => {
|
||||
if (!$connectingInput.opened) {
|
||||
$selectedComponent = [id]
|
||||
}
|
||||
outputs?.inputs.set(inputs, true)
|
||||
onFocus()
|
||||
}}
|
||||
onRemove={(id) => {
|
||||
if (inputs?.[id] == undefined) {
|
||||
return
|
||||
}
|
||||
if (index == 0) {
|
||||
delete inputs[id]
|
||||
inputs = { ...inputs }
|
||||
} else {
|
||||
delete inputs[id][index]
|
||||
inputs[id] = { ...inputs[id] }
|
||||
}
|
||||
outputs?.inputs.set(inputs, true)
|
||||
}}
|
||||
{value}
|
||||
{index}
|
||||
>
|
||||
<SubGridEditor
|
||||
visible={render && inRange}
|
||||
{id}
|
||||
subGridId={`${id}-0`}
|
||||
containerHeight={resolvedConfig.heightPx}
|
||||
on:focus={() => {
|
||||
if (!$connectingInput.opened) {
|
||||
$selectedComponent = [id]
|
||||
}
|
||||
onFocus()
|
||||
}}
|
||||
/>
|
||||
</ListWrapper>
|
||||
</div>
|
||||
{/each}
|
||||
{:else}
|
||||
<ListWrapper disabled value={undefined} index={0}>
|
||||
<SubGridEditor visible={false} {id} subGridId={`${id}-0`} />
|
||||
</ListWrapper>
|
||||
{#if !Array.isArray(result)}
|
||||
<div class="text-center text-tertiary">Input data is not an array</div>
|
||||
{/if}
|
||||
/>
|
||||
</ListWrapper>
|
||||
</div>
|
||||
{/each}
|
||||
{:else}
|
||||
<ListWrapper disabled value={undefined} index={0}>
|
||||
<SubGridEditor visible={false} {id} subGridId={`${id}-0`} />
|
||||
</ListWrapper>
|
||||
{#if !Array.isArray(result)}
|
||||
<div class="text-center text-tertiary">Input data is not an array</div>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -329,4 +329,8 @@
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
{#each $app?.subgrids?.[subGridId] ?? [] as item}
|
||||
<Component render={false} component={item.data} id={item.id} />
|
||||
{/each}
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user