nodes/packages/ui/src/lib/Input.svelte
Max Richter 26d3f6a2f1
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 2m35s
fix: gravity node
2024-05-02 18:49:08 +02:00

27 lines
806 B
Svelte

<script lang="ts">
import Checkbox from './elements/Checkbox.svelte';
import Float from './elements/Float.svelte';
import Integer from './elements/Integer.svelte';
import Select from './elements/Select.svelte';
import type { NodeInput } from '@nodes/types';
import Vec3 from './elements/Vec3.svelte';
export let input: NodeInput;
export let value: any;
export let id: string;
</script>
{#if input.type === 'float'}
<Float {id} bind:value min={input?.min} max={input?.max} />
{:else if input.type === 'integer'}
<Integer {id} bind:value min={input?.min} max={input?.max} />
{:else if input.type === 'boolean'}
<Checkbox {id} bind:value />
{:else if input.type === 'select'}
<Select {id} bind:value options={input.options} />
{:else if input.type === 'vec3'}
<Vec3 {id} bind:value />
{/if}