aboutsummaryrefslogtreecommitdiff
path: root/resources/vue/components/StudipRadioButtonGroup.vue
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2025-11-28 18:05:28 +0100
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2025-11-28 18:05:28 +0100
commit8a25ca56359772bf5db58cd7b17dd41c4219cdeb (patch)
tree0bb676ff4a9a29fb8ead7f3614fd6cf58dfd7425 /resources/vue/components/StudipRadioButtonGroup.vue
parent6d1c9d981cdec20e56eccf250c5e5d61e5ba63a4 (diff)
add missing componentsplugin-administration-vue
Diffstat (limited to 'resources/vue/components/StudipRadioButtonGroup.vue')
-rw-r--r--resources/vue/components/StudipRadioButtonGroup.vue42
1 files changed, 42 insertions, 0 deletions
diff --git a/resources/vue/components/StudipRadioButtonGroup.vue b/resources/vue/components/StudipRadioButtonGroup.vue
new file mode 100644
index 0000000..e5fd5e7
--- /dev/null
+++ b/resources/vue/components/StudipRadioButtonGroup.vue
@@ -0,0 +1,42 @@
+<script setup lang="ts">
+import {computed, onMounted} from "vue";
+import StudipRadioButton from "./StudipRadioButton.vue";
+
+const props = defineProps<{
+ label: string;
+ modelValue: string | number | boolean;
+ name: string;
+ options: Record<string, string>
+}>();
+
+const emit = defineEmits(['update:modelValue']);
+
+const model = computed({
+ get() {
+ return props.modelValue;
+ },
+ set(newValue) {
+ emit('update:modelValue', newValue);
+ }
+})
+
+onMounted(() => {
+ document.addEventListener('focusin', event => console.log('focussed', event.target), {capture: true})
+})
+
+</script>
+<template>
+ <div role="radiogroup"
+ :aria-label="props.label"
+ >
+ <StudipRadioButton v-for="(optionLabel, key) in options"
+ :key="key"
+ :value="key"
+ :name="name"
+ v-model="model"
+ >
+ {{ optionLabel }}
+ </StudipRadioButton>
+
+ </div>
+</template>