@fishawack/lab-velocity 2.0.0-beta.59 → 2.0.0-beta.60
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.
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
)"
|
|
12
12
|
class="truncate color-9"
|
|
13
13
|
>
|
|
14
|
-
<strong>{{
|
|
14
|
+
<strong>{{ key }}</strong
|
|
15
15
|
><br />{{ value }}
|
|
16
16
|
</p>
|
|
17
17
|
</template>
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
)"
|
|
32
32
|
class="truncate"
|
|
33
33
|
>
|
|
34
|
-
<strong>{{
|
|
34
|
+
<strong>{{ key }}</strong
|
|
35
35
|
><br />{{ value }}
|
|
36
36
|
</p>
|
|
37
37
|
</template>
|
|
@@ -112,11 +112,26 @@ export default {
|
|
|
112
112
|
calendarFormat,
|
|
113
113
|
dateFormat,
|
|
114
114
|
|
|
115
|
+
formatKey(key) {
|
|
116
|
+
return key
|
|
117
|
+
.replace(/([a-z])([A-Z])/g, "$1 $2")
|
|
118
|
+
.replace(/[-_]/g, " ")
|
|
119
|
+
.replace(/\b\w/g, (c) => c.toUpperCase());
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
formatValue(value) {
|
|
123
|
+
if (value === null || value === "") return "—";
|
|
124
|
+
return value;
|
|
125
|
+
},
|
|
126
|
+
|
|
115
127
|
formatValues(values) {
|
|
116
128
|
if (!values) return [];
|
|
117
129
|
return Object.entries(values)
|
|
118
|
-
.filter(([key, value]) => value)
|
|
119
|
-
.map(([key, value]) => ({
|
|
130
|
+
.filter(([key, value]) => value !== undefined)
|
|
131
|
+
.map(([key, value]) => ({
|
|
132
|
+
key: this.formatKey(key),
|
|
133
|
+
value: this.formatValue(value),
|
|
134
|
+
}));
|
|
120
135
|
},
|
|
121
136
|
|
|
122
137
|
async fetchAudits() {
|