2020-06-02 09:55:44 +12:00
|
|
|
<script>
|
|
|
|
import { backendUiStore } from "builderStore"
|
2020-08-19 04:14:35 +12:00
|
|
|
import { Input } from "@budibase/bbui"
|
2020-06-02 09:55:44 +12:00
|
|
|
|
|
|
|
export let value
|
|
|
|
</script>
|
|
|
|
|
2020-08-23 08:34:46 +12:00
|
|
|
<div class="bb-margin-xl block-field">
|
2020-08-31 01:49:25 +12:00
|
|
|
<select class="budibase__input" bind:value={value.model}>
|
|
|
|
{#each $backendUiStore.models as model}
|
|
|
|
<option value={model}>{model.name}</option>
|
|
|
|
{/each}
|
|
|
|
</select>
|
2020-06-02 09:55:44 +12:00
|
|
|
</div>
|
|
|
|
|
|
|
|
{#if value.model}
|
2020-08-23 08:34:46 +12:00
|
|
|
<div class="bb-margin-xl block-field">
|
2020-06-02 09:55:44 +12:00
|
|
|
<label class="uk-form-label fields">Fields</label>
|
|
|
|
{#each Object.keys(value.model.schema) as field}
|
2020-08-31 01:49:25 +12:00
|
|
|
<div class="bb-margin-xl">
|
2020-08-19 04:14:35 +12:00
|
|
|
<Input bind:value={value[field]} label={field} />
|
2020-06-02 09:55:44 +12:00
|
|
|
</div>
|
|
|
|
{/each}
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.fields {
|
|
|
|
font-weight: 500;
|
|
|
|
}
|
|
|
|
</style>
|