forked from MapComplete/MapComplete
Merge master
This commit is contained in:
commit
80168f5d0d
919 changed files with 95585 additions and 8504 deletions
27
src/UI/Studio/SchemaBasedInput.svelte
Normal file
27
src/UI/Studio/SchemaBasedInput.svelte
Normal file
|
@ -0,0 +1,27 @@
|
|||
<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";
|
||||
import RegisteredTagInput from "./RegisteredTagInput.svelte";
|
||||
import SchemaBasedTranslationInput from "./SchemaBasedTranslationInput.svelte";
|
||||
|
||||
export let schema: ConfigMeta
|
||||
export let state: EditLayerState
|
||||
export let path: (string | number)[] = []
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
{#if schema.type === "array"}
|
||||
<SchemaBasedArray {path} {state} {schema}/>
|
||||
{:else if schema.hints.typehint === "tag"}
|
||||
<RegisteredTagInput {state} {path} {schema}/>
|
||||
{:else if schema.type === "translation"}
|
||||
<SchemaBasedTranslationInput {path} {state} {schema}/>
|
||||
{:else if schema.hints.types}
|
||||
<SchemaBaseMultiType {path} {state} {schema}/>
|
||||
{:else}
|
||||
<SchemaBasedField {path} {state} {schema}/>
|
||||
{/if}
|
Loading…
Add table
Add a link
Reference in a new issue