@eturnity/eturnity_reusable_components 8.16.9-EPDM-14690.0 → 8.16.9-EPDM-14690.2
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
@@ -93,7 +93,7 @@
|
|
93
93
|
"
|
94
94
|
:is-read-only="true"
|
95
95
|
:min-decimals="0"
|
96
|
-
:number-precision="
|
96
|
+
:number-precision="0"
|
97
97
|
text-align="center"
|
98
98
|
:value="calculateTotalValue(item.label)"
|
99
99
|
/>
|
@@ -115,7 +115,7 @@
|
|
115
115
|
:disabled="isInputsDisabled"
|
116
116
|
input-height="36px"
|
117
117
|
:min-decimals="0"
|
118
|
-
:number-precision="
|
118
|
+
:number-precision="0"
|
119
119
|
text-align="center"
|
120
120
|
:value="item.value"
|
121
121
|
@input-blur="handleInputBlur($event, null, item.label, null)"
|
@@ -131,7 +131,6 @@
|
|
131
131
|
|
132
132
|
<script setup>
|
133
133
|
import { ref, watch, watchEffect, onMounted } from 'vue'
|
134
|
-
import styled from 'vue3-styled-components'
|
135
134
|
import InputNumber from '../inputs/inputNumber'
|
136
135
|
|
137
136
|
import {
|
@@ -188,21 +187,6 @@
|
|
188
187
|
|
189
188
|
const seriesData = ref([])
|
190
189
|
|
191
|
-
// onMounted(() => {
|
192
|
-
// seriesData.value = props.series.map((item) => {
|
193
|
-
// const data = item.data.map((d) => ({
|
194
|
-
// label: d.label,
|
195
|
-
// value: d.value,
|
196
|
-
// originalValue: d.value,
|
197
|
-
// }))
|
198
|
-
|
199
|
-
// return {
|
200
|
-
// name: item.name,
|
201
|
-
// data,
|
202
|
-
// }
|
203
|
-
// })
|
204
|
-
// })
|
205
|
-
|
206
190
|
watchEffect(() => {
|
207
191
|
let isNewSetOfSeries = false
|
208
192
|
const seriesDataCopy = [...seriesData.value]
|
@@ -279,7 +263,7 @@
|
|
279
263
|
|
280
264
|
const getDisplayValue = (data, label, shouldRound = true) => {
|
281
265
|
if (props.fieldMode === 'absolute') {
|
282
|
-
return data.find((d) => d.label === label)?.value
|
266
|
+
return data.find((d) => d.label === label)?.value
|
283
267
|
}
|
284
268
|
|
285
269
|
const value = data.find((d) => d.label === label)?.value || 0
|
@@ -252,10 +252,6 @@
|
|
252
252
|
type: String,
|
253
253
|
default: '',
|
254
254
|
},
|
255
|
-
valueFormatter: {
|
256
|
-
type: Function,
|
257
|
-
default: null,
|
258
|
-
},
|
259
255
|
isLegendShown: {
|
260
256
|
type: Boolean,
|
261
257
|
default: false,
|
@@ -388,7 +384,33 @@
|
|
388
384
|
}
|
389
385
|
|
390
386
|
const handleValueFormatter = (value) => {
|
391
|
-
|
387
|
+
let formattedValue = value
|
388
|
+
if (value < 1000) {
|
389
|
+
formattedValue = numberToString({
|
390
|
+
value: formattedValue,
|
391
|
+
numberPrecision: 0,
|
392
|
+
minDecimals: 0,
|
393
|
+
})
|
394
|
+
} else if (value < 1000000) {
|
395
|
+
formattedValue = numberToString({
|
396
|
+
value: Number(formattedValue / 1000),
|
397
|
+
numberPrecision: 2,
|
398
|
+
minDecimals: 2,
|
399
|
+
})
|
400
|
+
} else {
|
401
|
+
formattedValue = numberToString({
|
402
|
+
value: Number(formattedValue / 1000000),
|
403
|
+
numberPrecision: 2,
|
404
|
+
minDecimals: 2,
|
405
|
+
})
|
406
|
+
}
|
407
|
+
if (value < 1000) {
|
408
|
+
return `${formattedValue} kWh`
|
409
|
+
} else if (value < 1000000) {
|
410
|
+
return `${formattedValue} MWh`
|
411
|
+
} else {
|
412
|
+
return `${formattedValue} GWh`
|
413
|
+
}
|
392
414
|
}
|
393
415
|
|
394
416
|
const getYAxisLabel = (label) => {
|
@@ -59,8 +59,7 @@ export const InputGroup = styled('div', {
|
|
59
59
|
barWidth: Number,
|
60
60
|
isScrollable: Boolean,
|
61
61
|
})`
|
62
|
-
${(props) => (props.isScrollable ? 'min-width' : 'width')}
|
63
|
-
props.barWidth}px;
|
62
|
+
${(props) => (props.isScrollable ? 'min-width' : 'width')}: 70px;
|
64
63
|
display: flex;
|
65
64
|
justify-content: center;
|
66
65
|
position: relative;
|