fix minor app issues

This commit is contained in:
Ruben Fiszel
2023-03-20 15:27:30 +01:00
parent 354e6c26fe
commit 1a628dd720
3 changed files with 12 additions and 5 deletions
@@ -22,7 +22,7 @@
let placeholder: string = 'Select an item'
let outputs = initOutput($worldStore, id, {
result: undefined
result: undefined as string | undefined
})
let value: string | undefined = outputs?.result.peak()
@@ -40,10 +40,15 @@
}
})
: []
let rawValue
if (defaultValue) {
value = JSON.stringify(defaultValue)
rawValue = defaultValue
} else if (listItems.length > 0) {
value = listItems[0]?.value
rawValue = items[0].value
}
if (rawValue) {
value = JSON.stringify(rawValue)
outputs?.result.set(rawValue)
}
}
@@ -62,7 +67,7 @@
try {
result = JSON.parse(e.detail?.['value'])
} catch (_) {}
value = result
value = e.detail?.['value']
outputs?.result.set(result)
}
@@ -58,7 +58,7 @@
{#key isNegativeAllowed}
{#key locale}
{#key currency}
<div on:pointerdown|stopPropagation={() => ($selectedComponent = id)}>
<div class="w-full" on:pointerdown|stopPropagation={() => ($selectedComponent = id)}>
<CurrencyInput
inputClasses={{
formatted: twMerge('px-2 w-full py-1.5 windmillapp', css?.input?.class),
@@ -79,6 +79,7 @@
$app.subgrids[subGridId] = e.detail
}
}}
onTopId={$selectedComponent}
let:dataItem
rowHeight={36}
cols={columnConfiguration}
@@ -141,6 +142,7 @@
</div>
{:else}
<GridViewer
onTopId={$selectedComponent}
items={$app.subgrids?.[subGridId] ?? []}
let:dataItem
rowHeight={36}