refactor: change show mask flow - checkbox in params

This commit is contained in:
2026-08-24 06:02:32 +05:00
parent 306c26a360
commit 3a5acfbc45
3 changed files with 24 additions and 17 deletions
+15 -2
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import CheckboxField from '../ui/CheckboxField.svelte';
import ParamForm from '../ParamForm.svelte';
import type { ParamDef } from '$lib/registry';
@@ -7,16 +8,28 @@
values: Record<string, any>;
pipetteTargetId?: string | null;
onPipetteToggle?: (id: string) => void;
hasMask?: boolean;
showMask?: boolean;
}
let { params, values = $bindable(), pipetteTargetId = null, onPipetteToggle }: Props = $props();
let {
params,
values = $bindable(),
pipetteTargetId = null,
onPipetteToggle,
hasMask = false,
showMask = $bindable(false)
}: Props = $props();
</script>
<div class="panel root">
<h2 class="heading-section">Параметры</h2>
{#if hasMask}
<CheckboxField id="show-mask" label="Показать маску" bind:checked={showMask} />
{/if}
{#if params.length > 0}
<ParamForm {params} bind:values {pipetteTargetId} {onPipetteToggle} />
{:else}
{:else if !hasMask}
<p class="hint text-caption text-muted">
У этого инструмента нет параметров — результат уже готов.
</p>