@tekkare/romulus 0.1.364 → 0.1.365
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.
|
@@ -88,6 +88,16 @@ function barWidth(row: RmHybridRow) {
|
|
|
88
88
|
return `${Math.min((share(row) * 100) / reference.value, 100)}%`
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Une colonne `extra` arrive souvent deja formatee, part comprise :
|
|
93
|
+
* "53 298 (11.3 %)". La part finale entre parentheses est detachee pour
|
|
94
|
+
* prendre le meme gris que celle de la colonne valeur.
|
|
95
|
+
*/
|
|
96
|
+
function splitShare(cell: string | number) {
|
|
97
|
+
const match = String(cell).match(/^(.*?)\s*(\([^()]*%\))$/)
|
|
98
|
+
return match ? { value: match[1], share: match[2] } : { value: cell, share: '' }
|
|
99
|
+
}
|
|
100
|
+
|
|
91
101
|
function toggle() {
|
|
92
102
|
showAll.value = !showAll.value
|
|
93
103
|
emit('showState', showAll.value)
|
|
@@ -117,7 +127,8 @@ function toggle() {
|
|
|
117
127
|
</span>
|
|
118
128
|
</td>
|
|
119
129
|
<td v-for="(cell, cellIndex) in row.extra ?? []" :key="cellIndex" class="rm-hybrid__value">
|
|
120
|
-
{{ cell }}
|
|
130
|
+
{{ splitShare(cell).value }}
|
|
131
|
+
<span v-if="splitShare(cell).share" class="rm-hybrid__share">{{ splitShare(cell).share }}</span>
|
|
121
132
|
</td>
|
|
122
133
|
</tr>
|
|
123
134
|
</tbody>
|