From f5732abe556b520d2fa556f6abc2538e0215f2c3 Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Wed, 19 Jan 2022 15:23:41 +0100 Subject: [PATCH] #3397 - select radio buttons alignment setting --- packages/client/manifest.json | 20 +++++++++++++++++++ .../components/app/forms/OptionsField.svelte | 2 ++ 2 files changed, 22 insertions(+) diff --git a/packages/client/manifest.json b/packages/client/manifest.json index e618ca1c11..3f8d4c0e3b 100644 --- a/packages/client/manifest.json +++ b/packages/client/manifest.json @@ -2065,6 +2065,26 @@ } ] }, + { + "type": "select", + "label": "Direction", + "key": "direction", + "defaultValue": "vertical", + "options": [ + { + "label": "Horizontal", + "value": "horizontal" + }, + { + "label": "Vertical", + "value": "vertical" + } + ], + "dependsOn": { + "setting": "optionsType", + "value": "radio" + } + }, { "type": "text", "label": "Default value", diff --git a/packages/client/src/components/app/forms/OptionsField.svelte b/packages/client/src/components/app/forms/OptionsField.svelte index 4ad8f4611e..8140600e7e 100644 --- a/packages/client/src/components/app/forms/OptionsField.svelte +++ b/packages/client/src/components/app/forms/OptionsField.svelte @@ -15,6 +15,7 @@ export let valueColumn export let customOptions export let autocomplete = false + export let direction = "vertical" let fieldState let fieldApi @@ -64,6 +65,7 @@ disabled={fieldState.disabled} error={fieldState.error} {options} + {direction} on:change={e => fieldApi.setValue(e.detail)} getOptionLabel={flatOptions ? x => x : x => x.label} getOptionValue={flatOptions ? x => x : x => x.value}