Merge pull request #4107 from mslourens/options_radio_button_alignment

#3397 - select radio buttons alignment setting
This commit is contained in:
Michael Drury 2022-01-19 14:47:12 +00:00 committed by GitHub
commit 2f64b186a2
2 changed files with 22 additions and 0 deletions

View File

@ -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", "type": "text",
"label": "Default value", "label": "Default value",

View File

@ -15,6 +15,7 @@
export let valueColumn export let valueColumn
export let customOptions export let customOptions
export let autocomplete = false export let autocomplete = false
export let direction = "vertical"
let fieldState let fieldState
let fieldApi let fieldApi
@ -64,6 +65,7 @@
disabled={fieldState.disabled} disabled={fieldState.disabled}
error={fieldState.error} error={fieldState.error}
{options} {options}
{direction}
on:change={e => fieldApi.setValue(e.detail)} on:change={e => fieldApi.setValue(e.detail)}
getOptionLabel={flatOptions ? x => x : x => x.label} getOptionLabel={flatOptions ? x => x : x => x.label}
getOptionValue={flatOptions ? x => x : x => x.value} getOptionValue={flatOptions ? x => x : x => x.value}