2023-07-27 08:31:52 +03:00
|
|
|
<!--
|
2024-02-13 17:59:27 +02:00
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-27 08:31:52 +03:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2022-01-31 14:07:33 +02:00
|
|
|
<template>
|
2023-05-19 07:58:09 +03:00
|
|
|
<MkTooltip ref="tooltip" :showing="showing" :x="x" :y="y" :maxWidth="340" :direction="'top'" :innerMargin="16" @closed="emit('closed')">
|
2023-01-15 02:14:17 +02:00
|
|
|
<div v-if="title || series">
|
|
|
|
<div v-if="title" :class="$style.title">{{ title }}</div>
|
2022-06-28 04:41:38 +03:00
|
|
|
<template v-if="series">
|
2023-01-15 02:14:17 +02:00
|
|
|
<div v-for="x in series">
|
|
|
|
<span :class="$style.color" :style="{ background: x.backgroundColor, borderColor: x.borderColor }"></span>
|
2022-06-28 04:41:38 +03:00
|
|
|
<span>{{ x.text }}</span>
|
|
|
|
</div>
|
|
|
|
</template>
|
2022-01-31 14:07:33 +02:00
|
|
|
</div>
|
|
|
|
</MkTooltip>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2022-06-28 04:41:38 +03:00
|
|
|
import { } from 'vue';
|
2022-09-06 12:21:49 +03:00
|
|
|
import MkTooltip from './MkTooltip.vue';
|
2022-01-31 14:07:33 +02:00
|
|
|
|
2022-12-22 09:59:11 +02:00
|
|
|
defineProps<{
|
2022-01-31 14:07:33 +02:00
|
|
|
showing: boolean;
|
|
|
|
x: number;
|
|
|
|
y: number;
|
2022-06-28 07:06:31 +03:00
|
|
|
title?: string;
|
|
|
|
series?: {
|
2022-01-31 14:07:33 +02:00
|
|
|
backgroundColor: string;
|
|
|
|
borderColor: string;
|
|
|
|
text: string;
|
|
|
|
}[];
|
|
|
|
}>();
|
|
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
|
(ev: 'closed'): void;
|
|
|
|
}>();
|
|
|
|
</script>
|
|
|
|
|
2023-01-15 02:14:17 +02:00
|
|
|
<style lang="scss" module>
|
|
|
|
.title {
|
|
|
|
margin-bottom: 4px;
|
|
|
|
}
|
2022-01-31 14:07:33 +02:00
|
|
|
|
2023-01-15 02:14:17 +02:00
|
|
|
.color {
|
|
|
|
display: inline-block;
|
|
|
|
width: 8px;
|
|
|
|
height: 8px;
|
|
|
|
border-width: 1px;
|
|
|
|
border-style: solid;
|
|
|
|
margin-right: 8px;
|
2022-01-31 14:07:33 +02:00
|
|
|
}
|
|
|
|
</style>
|