Allow unselecting

This commit is contained in:
Adria Navarro 2025-03-14 12:49:02 +01:00
parent b2275c96c7
commit de5042253f
1 changed files with 11 additions and 3 deletions

View File

@ -10,7 +10,7 @@
} from "@budibase/bbui"
import { goto } from "@roxi/routify"
export let authConfigId: string
export let authConfigId: string | undefined
export let authConfigs: { label: string; value: string }[]
export let datasourceId: string
@ -27,7 +27,11 @@
}
function selectConfiguration(id: string) {
authConfigId = id
if (authConfigId === id) {
authConfigId = undefined
} else {
authConfigId = id
}
menu.hide()
}
</script>
@ -66,7 +70,11 @@
<!-- Hack to first config margin to not work as expected -->
<div class="spectrum-ActionGroup-item hidden" />
{#each authConfigs as config}
<ActionButton on:click={() => selectConfiguration(config.value)}>
<ActionButton
on:click={() => selectConfiguration(config.value)}
selected={config.value === authConfigId}
accentColor="#066CE7"
>
{config.label}
</ActionButton>
{/each}