2023-08-21 01:51:35 -04:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { computed } from "vue";
|
2023-10-17 16:32:59 -04:00
|
|
|
import TooltippedLabel from "@/components/common/pv-tooltipped-label.vue";
|
2023-08-21 01:51:35 -04:00
|
|
|
|
2023-08-31 16:56:58 -04:00
|
|
|
const props = withDefaults(
|
|
|
|
|
defineProps<{
|
|
|
|
|
label?: string;
|
|
|
|
|
tooltip?: string;
|
|
|
|
|
// TODO fully update v-model usage in custom components on Vue3 update
|
|
|
|
|
value: number;
|
|
|
|
|
disabled?: boolean;
|
|
|
|
|
inputCols?: number;
|
|
|
|
|
list: string[];
|
|
|
|
|
}>(),
|
|
|
|
|
{
|
|
|
|
|
disabled: false,
|
|
|
|
|
inputCols: 8
|
|
|
|
|
}
|
|
|
|
|
);
|
2023-08-21 01:51:35 -04:00
|
|
|
|
|
|
|
|
const emit = defineEmits<{
|
2023-08-31 16:56:58 -04:00
|
|
|
(e: "input", value: number): void;
|
2023-08-21 01:51:35 -04:00
|
|
|
}>();
|
|
|
|
|
|
|
|
|
|
const localValue = computed({
|
|
|
|
|
get: () => props.value,
|
2023-08-31 16:56:58 -04:00
|
|
|
set: (v) => emit("input", v)
|
2023-08-21 01:51:35 -04:00
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
2019-09-28 21:42:04 +03:00
|
|
|
<template>
|
2020-06-26 04:39:14 -07:00
|
|
|
<div>
|
2023-08-31 16:56:58 -04:00
|
|
|
<v-row dense align="center">
|
2023-08-21 01:51:35 -04:00
|
|
|
<v-col :cols="12 - inputCols">
|
2023-08-31 16:56:58 -04:00
|
|
|
<tooltipped-label :tooltip="tooltip" :label="label" />
|
2022-01-16 08:25:37 -08:00
|
|
|
</v-col>
|
2023-08-21 01:51:35 -04:00
|
|
|
<v-col :cols="inputCols">
|
2023-08-31 16:56:58 -04:00
|
|
|
<v-radio-group v-model="localValue" row dark :mandatory="true">
|
2022-01-16 08:25:37 -08:00
|
|
|
<v-radio
|
2023-08-21 01:51:35 -04:00
|
|
|
v-for="(radioName, index) in list"
|
2022-01-16 08:25:37 -08:00
|
|
|
:key="index"
|
|
|
|
|
color="#ffd843"
|
2022-02-21 22:41:51 -05:00
|
|
|
:label="radioName"
|
2022-01-16 08:25:37 -08:00
|
|
|
:value="index"
|
|
|
|
|
:disabled="disabled"
|
|
|
|
|
/>
|
|
|
|
|
</v-radio-group>
|
|
|
|
|
</v-col>
|
|
|
|
|
</v-row>
|
2020-06-26 04:39:14 -07:00
|
|
|
</div>
|
2019-09-28 21:42:04 +03:00
|
|
|
</template>
|