init
All checks were successful
Deploy / build (push) Successful in 46s

This commit is contained in:
alsaze 2025-11-19 21:46:40 +03:00
parent df79f7e58d
commit 0276394b0c

View File

@ -8,7 +8,7 @@
:disabled="!tooltipEnabled"
:ui="{ text: 'whitespace-normal break-words', content: 'max-w-50 h-auto' }"
>
<span :class="textPrimary ? 'short-text--primary' : ''">{{ text }}</span>
<span :ref="checkSize" :class="textPrimary ? 'short-text--primary' : ''">{{ text }}</span>
<Icon
v-if="tooltipEnabled"
name="heroicons:information-circle"
@ -24,13 +24,13 @@
:disabled="!tooltipEnabled"
:ui="{ text: 'whitespace-normal break-words', content: 'max-w-80 h-auto' }"
>
<span :class="textPrimary ? 'short-text--primary' : ''">{{ text }}</span>
<span :ref="checkSize" :class="textPrimary ? 'short-text--primary' : ''">{{ text }}</span>
</UTooltip>
</div>
</template>
<script setup lang="ts">
import { onClickOutside } from '@vueuse/core'
import { onClickOutside, unrefElement } from '@vueuse/core'
defineProps<{ text: string, textPrimary?: boolean }>()
@ -43,6 +43,12 @@ const { isMobile } = useScreen()
onClickOutside(wrapper, () => {
open.value = false
})
function checkSize(_el: HTMLElement) {
const el = unrefElement(_el)
tooltipEnabled.value = el ? el.scrollWidth > el.clientWidth : false
}
</script>
<style lang="scss">