@dataloop-ai/components 0.17.62 → 0.17.63-rogue-hf1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
</template>
|
|
20
20
|
|
|
21
21
|
<script lang="ts">
|
|
22
|
-
import { defineComponent, ref, computed } from 'vue-demi'
|
|
22
|
+
import { defineComponent, ref, computed, toRef } from 'vue-demi'
|
|
23
23
|
import DlTooltip from '../../essential/DlTooltip/DlTooltip.vue'
|
|
24
24
|
import { useSizeObserver } from '../../../hooks/use-size-observer'
|
|
25
25
|
|
|
@@ -63,8 +63,8 @@ export default defineComponent({
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
setup(props) {
|
|
66
|
-
const {
|
|
67
|
-
|
|
66
|
+
const { split } = props
|
|
67
|
+
const textRef = toRef(props, 'text')
|
|
68
68
|
const splitPositionsRef = computed(() => {
|
|
69
69
|
return Math.min(
|
|
70
70
|
Math.max(props.splitPosition, 1),
|
|
@@ -75,15 +75,17 @@ export default defineComponent({
|
|
|
75
75
|
const dlEllipsisRef = ref(null)
|
|
76
76
|
const splitIndex = computed(() =>
|
|
77
77
|
split
|
|
78
|
-
? Math.round(
|
|
79
|
-
:
|
|
78
|
+
? Math.round(textRef.value.length * splitPositionsRef.value)
|
|
79
|
+
: textRef.value.length
|
|
80
80
|
)
|
|
81
81
|
|
|
82
|
-
const leftText = computed(() =>
|
|
83
|
-
|
|
82
|
+
const leftText = computed(() =>
|
|
83
|
+
textRef.value.slice(0, splitIndex.value)
|
|
84
|
+
)
|
|
85
|
+
const rightText = computed(() => textRef.value.slice(splitIndex.value))
|
|
84
86
|
|
|
85
87
|
const { hasEllipsis } = useSizeObserver(dlEllipsisRef)
|
|
86
|
-
const fullText = computed(() =>
|
|
88
|
+
const fullText = computed(() => textRef.value)
|
|
87
89
|
|
|
88
90
|
return {
|
|
89
91
|
leftText,
|