@usssa/component-library 1.0.0-alpha.27 → 1.0.0-alpha.28
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/README.md +1 -1
- package/package.json +1 -1
- package/src/components/core/UAvatar.vue +15 -1
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
import UBadgeStd from './UBadgeStd.vue'
|
|
4
|
+
|
|
4
5
|
const props = defineProps({
|
|
5
6
|
color: {
|
|
6
7
|
type: String,
|
|
@@ -59,6 +60,19 @@ const labelSize = computed(() => {
|
|
|
59
60
|
|
|
60
61
|
return props.size
|
|
61
62
|
})
|
|
63
|
+
|
|
64
|
+
const initials = computed(() => {
|
|
65
|
+
if (props.name) {
|
|
66
|
+
const parts = props.name.split(' ')
|
|
67
|
+
|
|
68
|
+
if (parts.length === 1) return parts[0].substring(0, 2).toUpperCase()
|
|
69
|
+
|
|
70
|
+
return `${parts[0].substring(0, 1).toUpperCase()}${parts[1]
|
|
71
|
+
.substring(0, 1)
|
|
72
|
+
.toUpperCase()}`
|
|
73
|
+
}
|
|
74
|
+
return props?.name
|
|
75
|
+
})
|
|
62
76
|
</script>
|
|
63
77
|
|
|
64
78
|
<template>
|
|
@@ -77,7 +91,7 @@ const labelSize = computed(() => {
|
|
|
77
91
|
class="name"
|
|
78
92
|
:class="`text-${color} text-caption-${labelSize}`"
|
|
79
93
|
>
|
|
80
|
-
{{
|
|
94
|
+
{{ initials }}
|
|
81
95
|
</span>
|
|
82
96
|
<UBadgeStd
|
|
83
97
|
v-if="showIndicator"
|