This commit is contained in:
Pieter Vander Vennet 2025-08-15 20:10:36 +02:00
parent 0601a9df6f
commit 0452c84520

View file

@ -5,7 +5,6 @@
import type { Feature } from "geojson" import type { Feature } from "geojson"
import type { SpecialVisualizationState } from "../SpecialVisualization" import type { SpecialVisualizationState } from "../SpecialVisualization"
import type { Validator } from "./Validator"
import DistanceInput from "./Helpers/DistanceInput.svelte" import DistanceInput from "./Helpers/DistanceInput.svelte"
export let type: ValidatorType export let type: ValidatorType
@ -14,11 +13,13 @@
export let args: (string | number | boolean)[] | any = undefined export let args: (string | number | boolean)[] | any = undefined
export let state: SpecialVisualizationState = undefined export let state: SpecialVisualizationState = undefined
let validator = Validators.get(type) let validator = Validators.get(type)
let validatorHelper: Validator = validator.inputHelper let validatorHelper = validator.inputHelper
</script> </script>
{#if type === "distance"} {#if type === "distance"}
<DistanceInput {value} {feature} {state} {args} /> <DistanceInput {value} {feature} {state} {args} />
{:else if validatorHelper !== undefined} {:else if validatorHelper !== undefined}
<svelte:component this={validatorHelper} {value} {feature} {state} {args} on:submit /> <svelte:component this={validatorHelper} {value} {feature} {state} {args} on:submit />
{:else}
<slot name="fallback"/> <!-- Used in the FilterWithView to inject the helper -->
{/if} {/if}