mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-24 16:01:42 +00:00
fix toggle binding in app
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
{options?.left}
|
||||
</span>
|
||||
{/if}
|
||||
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<div class="relative" on:click|stopPropagation>
|
||||
<input
|
||||
@@ -47,7 +48,6 @@
|
||||
on:click
|
||||
{disabled}
|
||||
type="checkbox"
|
||||
value={false}
|
||||
{id}
|
||||
class="sr-only peer"
|
||||
bind:checked
|
||||
|
||||
@@ -72,28 +72,22 @@
|
||||
|
||||
$: lastInput && $worldStore && debounce(handleConnection)
|
||||
|
||||
$: lastInput &&
|
||||
lastInput.type == 'template' &&
|
||||
$stateId &&
|
||||
$state &&
|
||||
debounce(async () => {
|
||||
let nvalue = await getValue(lastInput)
|
||||
if (!deepEqual(nvalue, value)) {
|
||||
value = nvalue
|
||||
}
|
||||
dispatch('done')
|
||||
})
|
||||
const reEvalTemplate = async () => {
|
||||
let nvalue = await getValue(lastInput)
|
||||
if (!deepEqual(nvalue, value)) {
|
||||
value = nvalue
|
||||
}
|
||||
}
|
||||
|
||||
$: lastInput &&
|
||||
lastInput.type == 'eval' &&
|
||||
$stateId &&
|
||||
$state &&
|
||||
debounce2(async () => {
|
||||
let nvalue = await evalExpr(lastInput)
|
||||
if (!deepEqual(nvalue, value)) {
|
||||
value = nvalue
|
||||
}
|
||||
})
|
||||
$: lastInput && lastInput.type == 'template' && $stateId && $state && debounce(reEvalTemplate)
|
||||
|
||||
const reEval = async () => {
|
||||
let nvalue = await evalExpr(lastInput)
|
||||
if (!deepEqual(nvalue, value)) {
|
||||
value = nvalue
|
||||
}
|
||||
}
|
||||
$: lastInput && lastInput.type == 'eval' && $stateId && $state && debounce2(reEval)
|
||||
|
||||
async function handleConnection() {
|
||||
if (lastInput?.type === 'connected') {
|
||||
|
||||
@@ -57,11 +57,10 @@
|
||||
{/each}
|
||||
|
||||
<InitializeComponent {id} />
|
||||
|
||||
<AlignWrapper {render} {horizontalAlignment} {verticalAlignment}>
|
||||
<Toggle
|
||||
size="sm"
|
||||
checked={resolvedConfig.defaultValue}
|
||||
bind:checked={resolvedConfig.defaultValue}
|
||||
options={{ right: resolvedConfig.label }}
|
||||
textClass={css?.text?.class ?? ''}
|
||||
textStyle={css?.text?.style ?? ''}
|
||||
|
||||
Reference in New Issue
Block a user