1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-17 16:18:27 +09:00
cherrypick/packages/frontend/src/components/MkUsersTooltip.vue

52 lines
1013 B
Vue
Raw Normal View History

<template>
<MkTooltip ref="tooltip" :showing="showing" :target-element="targetElement" :max-width="250" @closed="emit('closed')">
2021-11-14 13:13:22 +09:00
<div class="beaffaef">
2021-11-19 19:36:12 +09:00
<div v-for="u in users" :key="u.id" class="user">
2021-11-14 13:13:22 +09:00
<MkAvatar class="avatar" :user="u"/>
<MkUserName class="name" :user="u" :nowrap="true"/>
</div>
<div v-if="users.length < count" class="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>
<style lang="scss" scoped>
2021-11-14 13:13:22 +09:00
.beaffaef {
font-size: 0.9em;
2021-11-14 13:13:22 +09:00
text-align: left;
> .user {
line-height: 24px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
&:not(:last-child) {
margin-bottom: 3px;
}
> .avatar {
width: 24px;
height: 24px;
margin-right: 3px;
}
}
}
</style>