Fix validation value component always being an input
This commit is contained in:
parent
e3545bd02e
commit
25e891c189
|
@ -197,6 +197,8 @@
|
||||||
const removeRule = id => {
|
const removeRule = id => {
|
||||||
rules = rules.filter(link => link.id !== id)
|
rules = rules.filter(link => link.id !== id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$: console.log(fieldType)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<DrawerContent>
|
<DrawerContent>
|
||||||
|
@ -277,13 +279,13 @@
|
||||||
/>
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
<!-- Otherwise we render a component based on the type -->
|
<!-- Otherwise we render a component based on the type -->
|
||||||
{#if ["string", "number", "options", "longform"].includes(rule.type) || ["contains"]}
|
{#if ["string", "number", "options", "longform"].includes(rule.type)}
|
||||||
<Input
|
<Input
|
||||||
disabled={rule.constraint === "required"}
|
disabled={rule.constraint === "required"}
|
||||||
bind:value={rule.value}
|
bind:value={rule.value}
|
||||||
placeholder="Constraint value"
|
placeholder="Constraint value"
|
||||||
/>
|
/>
|
||||||
{:else if fieldType === "boolean"}
|
{:else if rule.type === "boolean"}
|
||||||
<Select
|
<Select
|
||||||
disabled={rule.constraint === "required"}
|
disabled={rule.constraint === "required"}
|
||||||
options={[
|
options={[
|
||||||
|
@ -292,7 +294,7 @@
|
||||||
]}
|
]}
|
||||||
bind:value={rule.value}
|
bind:value={rule.value}
|
||||||
/>
|
/>
|
||||||
{:else if fieldType === "datetime"}
|
{:else if rule.type === "datetime"}
|
||||||
<DatePicker
|
<DatePicker
|
||||||
enableTime={false}
|
enableTime={false}
|
||||||
disabled={rule.constraint === "required"}
|
disabled={rule.constraint === "required"}
|
||||||
|
|
Loading…
Reference in New Issue