feat: add text and date draw tools
This commit is contained in:
@@ -75,6 +75,14 @@
|
||||
pipetteActive={pipetteTargetId === param.id}
|
||||
onPipetteToggle={() => onPipetteToggle?.(param.id)}
|
||||
/>
|
||||
{:else if param.type === 'text'}
|
||||
<TextField
|
||||
id={param.id}
|
||||
label={paramLabel(tool, param)}
|
||||
type="text"
|
||||
placeholder={param.placeholder}
|
||||
bind:value={values[param.id]}
|
||||
/>
|
||||
{/if}
|
||||
</div>
|
||||
{/each}
|
||||
|
||||
@@ -10,11 +10,20 @@
|
||||
max?: number;
|
||||
step?: number;
|
||||
hint?: string;
|
||||
placeholder?: string;
|
||||
}
|
||||
|
||||
let { id, label, value = $bindable(''), type = 'text', min, max, step, hint }: Props = $props();
|
||||
let { id, label, value = $bindable(''), type = 'text', min, max, step, hint, placeholder }: Props =
|
||||
$props();
|
||||
</script>
|
||||
|
||||
<Field {id} {label} {hint}>
|
||||
<input class="control" {id} {type} min={min} max={max} step={step} bind:value />
|
||||
<input class="control" {id} {type} min={min} max={max} step={step} {placeholder} bind:value />
|
||||
</Field>
|
||||
|
||||
<style>
|
||||
input.control::placeholder {
|
||||
color: var(--text-muted);
|
||||
opacity: 0.7;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user