Andrew Kingston
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
14 additions and
8 deletions
-
packages/builder/src/builderStore/store/screenTemplates/utils/commonComponents.js
-
packages/builder/src/components/design/PropertiesPanel/ComponentSettingsSection.svelte
-
packages/standard-components/src/forms/OptionsField.svelte
|
|
|
@ -161,7 +161,11 @@ export function makeDatasourceFormComponents(datasource) { |
|
|
|
placeholder: field, |
|
|
|
}) |
|
|
|
if (fieldType === "options") { |
|
|
|
component.customProps({ placeholder: "Choose an option " }) |
|
|
|
component.customProps({ |
|
|
|
placeholder: "Choose an option", |
|
|
|
optionsType: "select", |
|
|
|
optionsSource: "schema", |
|
|
|
}) |
|
|
|
} |
|
|
|
if (fieldType === "link") { |
|
|
|
let placeholder = |
|
|
|
|
|
|
|
@ -71,7 +71,7 @@ |
|
|
|
/> |
|
|
|
{/if} |
|
|
|
{#if settings && settings.length > 0} |
|
|
|
{#each settings as setting} |
|
|
|
{#each settings as setting (setting.key)} |
|
|
|
{#if canRenderControl(setting)} |
|
|
|
<PropertyControl |
|
|
|
type={setting.type} |
|
|
|
@ -83,8 +83,8 @@ |
|
|
|
{componentInstance} |
|
|
|
onChange={val => updateProp(setting.key, val)} |
|
|
|
props={{ |
|
|
|
options: setting.options, |
|
|
|
placeholder: setting.placeholder, |
|
|
|
options: setting.options || [], |
|
|
|
placeholder: setting.placeholder || null, |
|
|
|
}} |
|
|
|
{bindings} |
|
|
|
{componentDefinition} |
|
|
|
|
|
|
|
@ -1,5 +1,5 @@ |
|
|
|
<script> |
|
|
|
import { CoreSelect, RadioGroup } from "@budibase/bbui" |
|
|
|
import { CoreSelect, CoreRadioGroup } from "@budibase/bbui" |
|
|
|
import Field from "./Field.svelte" |
|
|
|
|
|
|
|
export let field |
|
|
|
@ -74,7 +74,7 @@ |
|
|
|
bind:fieldSchema |
|
|
|
> |
|
|
|
{#if fieldState} |
|
|
|
{#if optionsType === "select"} |
|
|
|
{#if !optionsType || optionsType === "select"} |
|
|
|
<CoreSelect |
|
|
|
value={$fieldState.value} |
|
|
|
id={$fieldState.fieldId} |
|
|
|
@ -87,13 +87,15 @@ |
|
|
|
getOptionValue={flatOptions ? x => x : x => x.value} |
|
|
|
/> |
|
|
|
{:else if optionsType === "radio"} |
|
|
|
<RadioGroup |
|
|
|
<CoreRadioGroup |
|
|
|
value={$fieldState.value} |
|
|
|
id={$fieldState.fieldId} |
|
|
|
disabled={$fieldState.disabled} |
|
|
|
error={$fieldState.error} |
|
|
|
options={fieldSchema?.constraints?.inclusion ?? []} |
|
|
|
{options} |
|
|
|
on:change={e => fieldApi.setValue(e.detail)} |
|
|
|
getOptionLabel={flatOptions ? x => x : x => x.label} |
|
|
|
getOptionValue={flatOptions ? x => x : x => x.value} |
|
|
|
/> |
|
|
|
{/if} |
|
|
|
{/if} |
|
|
|
|