@eturnity/eturnity_reusable_components 7.45.5-EPDM-12680.0 → 7.45.5-EPDM-12680.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "7.45.5-EPDM-12680.0",
3
+ "version": "7.45.5-EPDM-12680.2",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
@@ -645,7 +645,7 @@
645
645
  },
646
646
  showArrowControls: {
647
647
  type: Boolean,
648
- default: true,
648
+ default: false,
649
649
  },
650
650
  },
651
651
  data() {
@@ -9,18 +9,18 @@
9
9
  @click="toggleAllSections"
10
10
  />
11
11
  </PageTitleContainer>
12
- <SectionContainer v-for="item in dataList" :key="item.inverter_id">
12
+ <SectionContainer v-for="item in dataList" :key="item.inverterId">
13
13
  <TitleContainer>
14
- <IconWrapper size="20px" @click="toggleSection(item.inverter_id)">
14
+ <IconWrapper size="20px" @click="toggleSection(item.inverterId)">
15
15
  <RCIcon
16
16
  color="white"
17
- :name="isExpanded(item.inverter_id) ? 'arrow_up' : 'arrow_down'"
17
+ :name="isExpanded(item.inverterId) ? 'arrow_up' : 'arrow_down'"
18
18
  size="10px"
19
19
  />
20
20
  </IconWrapper>
21
21
  <TextContainer>
22
- <TitleText>{{ item.name }}</TitleText>
23
- <TitleSubText>{{ item.brand_name }}</TitleSubText>
22
+ <TitleText :title="item.model">{{ item.model }}</TitleText>
23
+ <TitleSubText>{{ item.brandName }}</TitleSubText>
24
24
  </TextContainer>
25
25
  <IconsContainer>
26
26
  <IconWrapper>
@@ -45,27 +45,27 @@
45
45
  </IconsContainer>
46
46
  </TitleContainer>
47
47
  <MarkersContainer>
48
- <MarkerItem background-color="green">{{ item.power }}%</MarkerItem>
48
+ <MarkerItem>??%</MarkerItem>
49
49
  <MarkerItem>{{
50
- item.has_template ? 'Template!' : 'No Template!'
50
+ item.hasTemplate ? 'Template!' : 'No Template!'
51
51
  }}</MarkerItem>
52
52
  <MarkerItem>
53
53
  <RCIcon color="white" :name="getIconName(item.type)" size="14px" />
54
54
  <div>{{ getTypeName(item.type) }}</div>
55
55
  </MarkerItem>
56
- <ContainerValue>{{ item.power_kWp }} kWp</ContainerValue>
56
+ <ContainerValue>? kWp</ContainerValue>
57
57
  </MarkersContainer>
58
58
  <BoxContainer
59
- v-for="mppt in item.mppts"
60
- v-show="isExpanded(item.id)"
61
- :key="mppt.id"
59
+ v-for="(mppt, index) in item.mppts"
60
+ v-show="isExpanded(item.inverterId)"
61
+ :key="mppt.mpptId"
62
62
  >
63
63
  <BoxTitleWrapper>
64
- <IconWrapper size="20px" @click="toggleMppt(mppt.id)">
64
+ <IconWrapper size="20px" @click="toggleMppt(mppt.mpptId)">
65
65
  <RCIcon
66
66
  color="white"
67
67
  cursor="pointer"
68
- :name="isMpptExpanded(mppt.id) ? 'arrow_up' : 'arrow_down'"
68
+ :name="isMpptExpanded(mppt.mpptId) ? 'arrow_up' : 'arrow_down'"
69
69
  size="10px"
70
70
  />
71
71
  </IconWrapper>
@@ -78,7 +78,11 @@
78
78
  name="string_design"
79
79
  size="11px"
80
80
  />
81
- <div>{{ mppt.num_strings }}/{{ mppt.num_strings_available }}</div>
81
+ <div>
82
+ {{ mppt.strings.length }}/{{
83
+ mppt.numberOfMppts ? mppt.numberOfMppts : 0
84
+ }}
85
+ </div>
82
86
  </BoxIconWrapper>
83
87
  <BoxIconWrapper>
84
88
  <RCIcon
@@ -87,17 +91,21 @@
87
91
  name="panels_tool"
88
92
  size="11px"
89
93
  />
90
- <div>{{ mppt.num_modules }}</div>
94
+ <div>{{ getNumberOfMpptModules(mppt.strings) }}</div>
91
95
  </BoxIconWrapper>
92
96
  </BoxIconsContainer>
93
97
  </BoxTitleWrapper>
94
- <div v-show="isMpptExpanded(mppt.id)">
95
- <StringBox v-for="string in mppt.strings" :key="string.id">
96
- <StringColorContainer :background-color="string.color" />
98
+ <div v-show="isMpptExpanded(mppt.mpptId)">
99
+ <StringBox v-for="(string, idx) in mppt.strings" :key="string.id">
100
+ <StringColorContainer
101
+ :background-color="
102
+ getStringColor(getGlobalStringIndex(item, mppt, idx))
103
+ "
104
+ />
97
105
  <StringContainer>
98
106
  <div>{{ string.name }}</div>
99
107
  <StringIconContainer>
100
- <div>{{ string.num_modules }}</div>
108
+ <div>{{ string.modules.length }}</div>
101
109
  <RCIcon color="white" name="module" size="14px" />
102
110
  </StringIconContainer>
103
111
  </StringContainer>
@@ -144,6 +152,9 @@
144
152
 
145
153
  const TitleText = styled.div`
146
154
  font-size: 13px;
155
+ white-space: nowrap;
156
+ overflow: hidden;
157
+ text-overflow: ellipsis;
147
158
  `
148
159
 
149
160
  const TitleSubText = styled.div`
@@ -152,6 +163,7 @@
152
163
 
153
164
  const MarkersContainer = styled.div`
154
165
  display: flex;
166
+ flex-wrap: wrap;
155
167
  gap: 8px;
156
168
  margin: 8px 0 16px 30px;
157
169
  align-items: end;
@@ -438,6 +450,50 @@
438
450
  },
439
451
  },
440
452
  methods: {
453
+ getGlobalStringIndex(inverter, currentMppt, stringIdx) {
454
+ // This might need to be optimized, but let's see after we get real data
455
+ let globalIndex = 0
456
+
457
+ // Count strings in previous inverters
458
+ const inverterIndex = this.dataList.findIndex(
459
+ (inv) => inv.inverterId === inverter.inverterId
460
+ )
461
+ for (let i = 0; i < inverterIndex; i++) {
462
+ for (const mppt of this.dataList[i].mppts) {
463
+ globalIndex += mppt.strings.length
464
+ }
465
+ }
466
+
467
+ // Count strings in previous MPPTs of current inverter
468
+ const mpptIndex = inverter.mppts.findIndex(
469
+ (mppt) => mppt.mpptId === currentMppt.mpptId
470
+ )
471
+ for (let i = 0; i < mpptIndex; i++) {
472
+ globalIndex += inverter.mppts[i].strings.length
473
+ }
474
+
475
+ // Add current string index
476
+ return globalIndex + stringIdx
477
+ },
478
+ getNumberOfMpptModules(strings) {
479
+ return strings.reduce((acc, curr) => acc + curr.modules.length, 0)
480
+ },
481
+ getStringColor(idx) {
482
+ // ToDo: get correct colors
483
+ const colors = [
484
+ '#FF6B6B', // coral red
485
+ '#4ECDC4', // turquoise
486
+ '#45B7D1', // sky blue
487
+ '#96CEB4', // sage green
488
+ '#FFEEAD', // cream yellow
489
+ '#D4A5A5', // dusty rose
490
+ '#9B59B6', // purple
491
+ '#3498DB', // bright blue
492
+ '#E67E22', // orange
493
+ '#27AE60', // emerald green
494
+ ]
495
+ return colors[idx]
496
+ },
441
497
  isExpanded(id) {
442
498
  return this.expandedInverters.includes(id)
443
499
  },
@@ -465,9 +521,9 @@
465
521
  this.expandedInverters = []
466
522
  this.expandedMppts = []
467
523
  } else {
468
- this.expandedInverters = this.dataList.map((item) => item.inverter_id)
524
+ this.expandedInverters = this.dataList.map((item) => item.inverterId)
469
525
  this.expandedMppts = this.dataList.flatMap((item) =>
470
- item.mppts.map((mppt) => mppt.id)
526
+ item.mppts.map((mppt) => mppt.mpptId)
471
527
  )
472
528
  }
473
529
  },