-
-
Notifications
You must be signed in to change notification settings - Fork 173
/
HstWrapper.vue
42 lines (38 loc) · 903 Bytes
/
HstWrapper.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<script lang="ts">
export default {
name: 'HstWrapper',
}
</script>
<script lang="ts" setup>
import { withDefaults, computed } from 'vue'
import { VTooltip as vTooltip } from 'floating-vue'
const props = withDefaults(defineProps<{
title?: string
tag?: string
}>(), {
tag: 'label',
})
</script>
<template>
<component
:is="tag"
class="htw-p-2 hover:htw-bg-primary-100 dark:hover:htw-bg-primary-800 htw-flex htw-gap-2 htw-flex-wrap"
>
<span
v-tooltip="{
content: title,
placement: 'left',
distance: 12,
}"
class="htw-w-28 htw-whitespace-nowrap htw-text-ellipsis htw-overflow-hidden htw-shrink-0"
>
{{ title }}
</span>
<span class="htw-grow htw-flex htw-items-center htw-gap-1">
<span class="htw-block htw-grow">
<slot />
</span>
<slot name="actions" />
</span>
</component>
</template>