yumechi-no-kuni/packages/frontend/src/components/MkUsersTooltip.vue

60 lines
1 KiB
Vue
Raw Normal View History

<template>
<MkTooltip ref="tooltip" :showing="showing" :target-element="targetElement" :max-width="250" @closed="emit('closed')">
2023-01-13 20:46:22 -06:00
<div :class="$style.root">
<div v-for="u in users" :key="u.id" :class="$style.user">
<MkAvatar :class="$style.avatar" :user="u"/>
2023-02-08 05:07:19 -06:00
<MkUserName :class="$style.name" :user="u" :nowrap="true"/>
2021-11-13 22:13:22 -06:00
</div>
2023-01-13 20:46:22 -06:00
<div v-if="users.length < count" :class="$style.omitted">+{{ count - users.length }}</div>
</div>
</MkTooltip>
</template>
<script lang="ts" setup>
import { } from 'vue';
import MkTooltip from './MkTooltip.vue';
defineProps<{
showing: boolean;
users: any[]; // TODO
count: number;
targetElement: HTMLElement;
}>();
const emit = defineEmits<{
(ev: 'closed'): void;
}>();
</script>
2023-01-13 20:46:22 -06:00
<style lang="scss" module>
.root {
font-size: 0.9em;
2021-11-13 22:13:22 -06:00
text-align: left;
2023-01-13 20:46:22 -06:00
}
.user {
line-height: 24px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
2021-11-13 22:13:22 -06:00
2023-01-13 20:46:22 -06:00
&:not(:last-child) {
margin-bottom: 3px;
2021-11-13 22:13:22 -06:00
}
}
2023-01-13 20:46:22 -06:00
.name {
}
.omitted {
}
.avatar {
width: 24px;
height: 24px;
margin-right: 3px;
}
</style>