@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 CHANGED
@@ -1,4 +1,4 @@
1
- # Component Library v1.0.0-alpha.27
1
+ # Component Library v1.0.0-alpha.28
2
2
 
3
3
  This library provides custom UI components for USSSA applications.
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usssa/component-library",
3
- "version": "1.0.0-alpha.27",
3
+ "version": "1.0.0-alpha.28",
4
4
  "description": "A Quasar component library project",
5
5
  "productName": "Quasar component library App",
6
6
  "author": "Troy Moreland <troy.moreland@usssa.com>",
@@ -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
- {{ name }}
94
+ {{ initials }}
81
95
  </span>
82
96
  <UBadgeStd
83
97
  v-if="showIndicator"