2023-08-21 01:51:35 -04:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import TooltippedLabel from "@/components/common/cv-tooltipped-label.vue";
|
|
|
|
|
import { computed } from "vue";
|
|
|
|
|
|
|
|
|
|
const props = withDefaults(defineProps<{
|
|
|
|
|
label?: string,
|
|
|
|
|
tooltip?: string,
|
|
|
|
|
// TODO fully update v-model usage in custom components on Vue3 update
|
|
|
|
|
value: boolean,
|
|
|
|
|
disabled?: boolean,
|
|
|
|
|
labelCols?: number,
|
|
|
|
|
switchCols?: number
|
|
|
|
|
}>(), {
|
|
|
|
|
disabled: false,
|
|
|
|
|
labelCols: 2
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
|
|
(e: "input", value: boolean): void
|
|
|
|
|
}>();
|
|
|
|
|
|
|
|
|
|
const localValue = computed({
|
|
|
|
|
get: () => props.value,
|
|
|
|
|
set: v => emit("input", v)
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
2019-09-28 02:17:18 +03:00
|
|
|
<template>
|
2020-06-26 04:39:14 -07:00
|
|
|
<div>
|
|
|
|
|
<v-row
|
|
|
|
|
dense
|
|
|
|
|
align="center"
|
|
|
|
|
>
|
2023-08-21 01:51:35 -04:00
|
|
|
<v-col :cols="(12 - switchCols) || labelCols">
|
2020-07-31 13:50:50 -07:00
|
|
|
<tooltipped-label
|
|
|
|
|
:tooltip="tooltip"
|
2023-08-21 01:51:35 -04:00
|
|
|
:label="label"
|
2020-07-31 13:50:50 -07:00
|
|
|
/>
|
2020-06-26 04:39:14 -07:00
|
|
|
</v-col>
|
2023-08-21 01:51:35 -04:00
|
|
|
<v-col :cols="switchCols || (12 - labelCols)">
|
2020-06-26 04:39:14 -07:00
|
|
|
<v-switch
|
|
|
|
|
v-model="localValue"
|
|
|
|
|
dark
|
|
|
|
|
:disabled="disabled"
|
2020-06-28 03:11:09 -07:00
|
|
|
color="#ffd843"
|
2020-06-26 04:39:14 -07:00
|
|
|
/>
|
|
|
|
|
</v-col>
|
|
|
|
|
</v-row>
|
|
|
|
|
</div>
|
2019-09-28 02:17:18 +03:00
|
|
|
</template>
|