2023-06-18 00:44:57 +02:00
|
|
|
<script lang="ts">
|
2023-08-23 11:11:53 +02:00
|
|
|
import type { ConfigMeta } from "./configMeta";
|
|
|
|
import SchemaBasedField from "./SchemaBasedField.svelte";
|
|
|
|
import EditLayerState from "./EditLayerState";
|
|
|
|
import SchemaBasedArray from "./SchemaBasedArray.svelte";
|
|
|
|
import SchemaBasedMultiType from "./SchemaBasedMultiType.svelte";
|
2023-10-06 23:56:50 +02:00
|
|
|
import ArrayMultiAnswer from "./ArrayMultiAnswer.svelte";
|
2023-10-07 03:07:32 +02:00
|
|
|
|
2023-08-23 11:11:53 +02:00
|
|
|
export let schema: ConfigMeta;
|
|
|
|
export let state: EditLayerState;
|
|
|
|
export let path: (string | number)[] = [];
|
|
|
|
|
2023-06-18 00:44:57 +02:00
|
|
|
</script>
|
2023-10-30 13:45:44 +01:00
|
|
|
{#if schema.hints?.typehint?.endsWith("[]")}
|
2023-08-23 11:11:53 +02:00
|
|
|
<!-- We cheat a bit here by matching this 'magical' type... -->
|
|
|
|
<SchemaBasedArray {path} {state} {schema} />
|
2023-10-24 22:01:10 +02:00
|
|
|
{:else if schema.type === "array" && schema.hints.multianswer === "true"}
|
2023-10-06 23:56:50 +02:00
|
|
|
<ArrayMultiAnswer {path} {state} {schema}/>
|
2023-08-08 13:52:58 +02:00
|
|
|
{:else if schema.type === "array"}
|
2023-08-23 11:11:53 +02:00
|
|
|
<SchemaBasedArray {path} {state} {schema} />
|
2023-11-07 02:13:16 +01:00
|
|
|
{:else if schema.hints?.types}
|
2023-08-23 11:11:53 +02:00
|
|
|
<SchemaBasedMultiType {path} {state} {schema} />
|
2023-06-18 00:44:57 +02:00
|
|
|
{:else}
|
2023-08-23 11:11:53 +02:00
|
|
|
<SchemaBasedField {path} {state} {schema} />
|
2023-06-18 00:44:57 +02:00
|
|
|
{/if}
|