Update some more parts of the builder to use new form components

This commit is contained in:
Andrew Kingston 2021-04-16 13:07:38 +01:00
parent 9a2385e4b2
commit 68aca8b630
3 changed files with 21 additions and 25 deletions

View File

@ -32,9 +32,8 @@
<div class="control">
<Input
{thin}
value={readableValue}
on:change={event => onChange(event.target.value)}
on:change={event => onChange(event.detail)}
{placeholder} />
<div class="icon" on:click={bindingDrawer.show}>
<Icon name="lightning" />

View File

@ -53,15 +53,9 @@
<Label small>{fieldLabel}</Label>
{#if schemaFields}
<Select
thin
secondary
value={field[0]}
on:change={event => updateFieldName(idx, event.target.value)}>
<option value="" />
{#each schemaFields as schemaField}
<option value={schemaField.name}>{schemaField.name}</option>
{/each}
</Select>
on:change={event => updateFieldName(idx, event.detail)}
options={schemaFields.map(field => field.name)} />
{:else}
<Input
thin
@ -76,7 +70,11 @@
bindings={bindableProperties}
on:change={event => updateFieldValue(idx, event.detail)} />
<div class="remove-field-container">
<Button icon="Close" size="S" quiet on:click={() => removeField(field[0])} />
<Button
icon="Close"
size="S"
quiet
on:click={() => removeField(field[0])} />
</div>
{/each}
<div>

View File

@ -15,7 +15,7 @@
$store.selectedComponentId
)
$: schemaFields = getSchemaFields(parameters?.tableId)
$: tableOptions = $tables || []
$: tableOptions = $tables.list || []
const getSchemaFields = tableId => {
const { schema } = getSchemaForDatasource({ type: "table", tableId })
@ -35,20 +35,19 @@
</Body>
<div class="fields">
<Label small>Data Source</Label>
<Select thin secondary bind:value={parameters.providerId}>
<option value="">None</option>
{#each dataProviderComponents as provider}
<option value={provider._id}>{provider._instanceName}</option>
{/each}
</Select>
<Select
bind:value={parameters.providerId}
options={dataProviderComponents}
placeholder="None"
getOptionLabel={option => option._instanceName}
getOptionValue={option => option._id} />
<Label small>Table</Label>
<Select thin secondary bind:value={parameters.tableId}>
<option value="" />
{#each tableOptions as table}
<option value={table._id}>{table.name}</option>
{/each}
</Select>
<Select
bind:value={parameters.tableId}
options={tableOptions}
getOptionLabel={option => option.name}
getOptionValue={option => option._id} />
{#if parameters.tableId}
<SaveFields
@ -74,7 +73,7 @@
column-gap: var(--spacing-l);
row-gap: var(--spacing-s);
grid-template-columns: auto 1fr auto 1fr auto;
align-items: baseline;
align-items: center;
}
.fields :global(> div:nth-child(2)),