mapcomplete/UI/Studio/SchemaBasedInput.svelte

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
823 B
Svelte
Raw Normal View History

<script lang="ts">
import type {ConfigMeta} from "./configMeta";
import SchemaBasedField from "./SchemaBasedField.svelte";
import EditLayerState from "./EditLayerState";
import SchemaBasedArray from "./SchemaBasedArray.svelte";
import SchemaBaseMultiType from "./SchemaBaseMultiType.svelte";
2023-06-22 15:07:14 +02:00
import RegisteredTagInput from "./RegisteredTagInput.svelte";
export let schema: ConfigMeta
export let state: EditLayerState
export let path: (string | number)[] = []
2023-06-22 15:07:14 +02:00
</script>
{#if schema.type === "array"}
<SchemaBasedArray {path} {state} {schema}/>
2023-06-22 15:07:14 +02:00
{:else if schema.hints.typehint === "tag"}
<RegisteredTagInput {state} {path} {schema}/>
{:else if schema.hints.types}
2023-06-22 15:07:14 +02:00
<SchemaBaseMultiType {path} {state} {schema}/>
{:else}
<SchemaBasedField {path} {state} {schema}/>
{/if}