Reuse fields

This commit is contained in:
Adria Navarro 2023-06-28 12:17:13 +01:00
parent 758b4f8254
commit 7037ee6a9f
1 changed files with 6 additions and 18 deletions

View File

@ -1,6 +1,7 @@
<script>
import { createEventDispatcher } from "svelte"
import { Label, Input, Layout, Accordion } from "@budibase/bbui"
import { Layout, Accordion } from "@budibase/bbui"
import ConfigInput from "../ConfigInput.svelte"
export let value
export let name
@ -27,23 +28,10 @@
>
<Layout gap="S">
{#each value as field}
<div class="form-row">
<Label>{field.name}</Label>
<Input
type={field.type}
<ConfigInput
{...field}
on:change={e => handleChange(field.key, e.detail)}
value={field.value}
/>
</div>
{/each}
</Layout>
</Accordion>
<style>
.form-row {
display: grid;
grid-template-columns: 20% 1fr;
grid-gap: var(--spacing-l);
align-items: center;
}
</style>