@eturnity/eturnity_reusable_components 8.7.2-EPDM-10609.15 → 8.7.2-EPDM-10679.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (392) hide show
  1. package/README.md +29 -29
  2. package/package.json +84 -84
  3. package/src/App.vue +30 -30
  4. package/src/Test.vue +128 -128
  5. package/src/assets/icons/arrow_down.svg +3 -3
  6. package/src/assets/icons/arrow_up_red.svg +3 -3
  7. package/src/assets/icons/black_spinner.svg +35 -35
  8. package/src/assets/icons/delete_icon.svg +11 -11
  9. package/src/assets/icons/delete_icon_gray.svg +11 -11
  10. package/src/assets/icons/drag_icon.svg +8 -8
  11. package/src/assets/icons/external_icon.svg +6 -6
  12. package/src/assets/icons/language_icon.svg +6 -6
  13. package/src/assets/icons/pdf_icon.svg +6 -6
  14. package/src/assets/icons/plus_button.svg +4 -4
  15. package/src/assets/icons/search_icon_black.svg +3 -3
  16. package/src/assets/icons/subposition_icon.svg +3 -3
  17. package/src/assets/icons/subposition_marker.svg +3 -3
  18. package/src/assets/icons/warning_icon.svg +3 -3
  19. package/src/assets/svgIcons/2d_active.svg +7 -7
  20. package/src/assets/svgIcons/2d_inactive.svg +8 -8
  21. package/src/assets/svgIcons/3d_active.svg +7 -7
  22. package/src/assets/svgIcons/3d_inactive.svg +8 -8
  23. package/src/assets/svgIcons/_readme.md +7 -7
  24. package/src/assets/svgIcons/accept.svg +5 -5
  25. package/src/assets/svgIcons/activate_panels_active.svg +22 -22
  26. package/src/assets/svgIcons/activate_panels_inactive.svg +20 -20
  27. package/src/assets/svgIcons/add_icon-1.svg +3 -3
  28. package/src/assets/svgIcons/add_icon.svg +4 -4
  29. package/src/assets/svgIcons/address_book.svg +3 -3
  30. package/src/assets/svgIcons/adjust_roof.svg +6 -6
  31. package/src/assets/svgIcons/after_sale_as_a_service.svg +6 -6
  32. package/src/assets/svgIcons/all_good.svg +3 -3
  33. package/src/assets/svgIcons/angle_active.svg +5 -5
  34. package/src/assets/svgIcons/angle_inactive.svg +4 -4
  35. package/src/assets/svgIcons/area_active.svg +11 -11
  36. package/src/assets/svgIcons/area_inactive.svg +26 -26
  37. package/src/assets/svgIcons/areas_tool.svg +14 -14
  38. package/src/assets/svgIcons/arrow_down.svg +3 -3
  39. package/src/assets/svgIcons/arrow_left.svg +4 -4
  40. package/src/assets/svgIcons/arrow_right.svg +4 -4
  41. package/src/assets/svgIcons/arrow_up.svg +3 -3
  42. package/src/assets/svgIcons/attachment.svg +3 -3
  43. package/src/assets/svgIcons/base_layer.svg +3 -3
  44. package/src/assets/svgIcons/battery.svg +3 -3
  45. package/src/assets/svgIcons/bell.svg +3 -3
  46. package/src/assets/svgIcons/bell_alt.svg +5 -5
  47. package/src/assets/svgIcons/bexio.svg +4 -4
  48. package/src/assets/svgIcons/bold.svg +3 -3
  49. package/src/assets/svgIcons/bom.svg +3 -3
  50. package/src/assets/svgIcons/bom_generation.svg +10 -10
  51. package/src/assets/svgIcons/bookmaker.svg +3 -3
  52. package/src/assets/svgIcons/bubble.svg +3 -3
  53. package/src/assets/svgIcons/bug.svg +5 -5
  54. package/src/assets/svgIcons/buildings.svg +55 -55
  55. package/src/assets/svgIcons/bullet_list.svg +8 -8
  56. package/src/assets/svgIcons/calendar.svg +7 -7
  57. package/src/assets/svgIcons/calendar_icon.svg +7 -7
  58. package/src/assets/svgIcons/call.svg +3 -3
  59. package/src/assets/svgIcons/camera.svg +3 -3
  60. package/src/assets/svgIcons/car.svg +3 -3
  61. package/src/assets/svgIcons/cart.svg +3 -3
  62. package/src/assets/svgIcons/charger_icon_white.svg +44 -44
  63. package/src/assets/svgIcons/checkbox.svg +3 -3
  64. package/src/assets/svgIcons/checkmark.svg +3 -3
  65. package/src/assets/svgIcons/clear_formatting.svg +7 -7
  66. package/src/assets/svgIcons/clickable_info.svg +4 -4
  67. package/src/assets/svgIcons/clip.svg +3 -3
  68. package/src/assets/svgIcons/clock.svg +17 -17
  69. package/src/assets/svgIcons/clock_full.svg +3 -3
  70. package/src/assets/svgIcons/close_for_modals,_tool_tips.svg +4 -4
  71. package/src/assets/svgIcons/co_branding.svg +5 -5
  72. package/src/assets/svgIcons/collapse.svg +4 -4
  73. package/src/assets/svgIcons/collapse_all.svg +3 -3
  74. package/src/assets/svgIcons/collections.svg +3 -3
  75. package/src/assets/svgIcons/component_library.svg +7 -7
  76. package/src/assets/svgIcons/consumption_tariffs.svg +43 -43
  77. package/src/assets/svgIcons/context_menu-1.svg +6 -6
  78. package/src/assets/svgIcons/context_menu-2.svg +5 -5
  79. package/src/assets/svgIcons/context_menu.svg +5 -5
  80. package/src/assets/svgIcons/context_menu_tabs.svg +5 -5
  81. package/src/assets/svgIcons/cross.svg +4 -4
  82. package/src/assets/svgIcons/current_variant.svg +4 -4
  83. package/src/assets/svgIcons/dashboard.svg +3 -3
  84. package/src/assets/svgIcons/data_transfer.svg +3 -3
  85. package/src/assets/svgIcons/deadline.svg +4 -4
  86. package/src/assets/svgIcons/deal_flow.svg +5 -5
  87. package/src/assets/svgIcons/delete.svg +4 -4
  88. package/src/assets/svgIcons/delete_area_active.svg +16 -16
  89. package/src/assets/svgIcons/delete_area_inactive.svg +15 -15
  90. package/src/assets/svgIcons/direction_active-1.svg +12 -12
  91. package/src/assets/svgIcons/direction_active.svg +5 -5
  92. package/src/assets/svgIcons/direction_arrow.svg +4 -4
  93. package/src/assets/svgIcons/direction_inactive.svg +4 -4
  94. package/src/assets/svgIcons/dislike.svg +3 -3
  95. package/src/assets/svgIcons/distance_tool.svg +8 -8
  96. package/src/assets/svgIcons/distances_active.svg +9 -9
  97. package/src/assets/svgIcons/distances_inactive.svg +8 -8
  98. package/src/assets/svgIcons/distort_tool.svg +10 -10
  99. package/src/assets/svgIcons/distort_tool2.svg +16 -16
  100. package/src/assets/svgIcons/document.svg +3 -3
  101. package/src/assets/svgIcons/documents.svg +4 -4
  102. package/src/assets/svgIcons/downarrow.svg +3 -3
  103. package/src/assets/svgIcons/download.svg +4 -4
  104. package/src/assets/svgIcons/drag_icon.svg +8 -8
  105. package/src/assets/svgIcons/draggable_corner.svg +5 -5
  106. package/src/assets/svgIcons/draw_tool.svg +3 -3
  107. package/src/assets/svgIcons/duplicate-1.svg +8 -8
  108. package/src/assets/svgIcons/duplicate-2.svg +5 -5
  109. package/src/assets/svgIcons/duplicate.svg +4 -4
  110. package/src/assets/svgIcons/e-mobility_configurator.svg +6 -6
  111. package/src/assets/svgIcons/e_signature.svg +5 -5
  112. package/src/assets/svgIcons/edit_button.svg +3 -3
  113. package/src/assets/svgIcons/electricity_tariff.svg +3 -3
  114. package/src/assets/svgIcons/email.svg +3 -3
  115. package/src/assets/svgIcons/ems-1.svg +3 -3
  116. package/src/assets/svgIcons/ems.svg +3 -3
  117. package/src/assets/svgIcons/end_of_the_list.svg +5 -5
  118. package/src/assets/svgIcons/erase.svg +4 -4
  119. package/src/assets/svgIcons/expand_all.svg +4 -4
  120. package/src/assets/svgIcons/export_document.svg +3 -3
  121. package/src/assets/svgIcons/external_icon.svg +5 -5
  122. package/src/assets/svgIcons/fav_icon.svg +4 -4
  123. package/src/assets/svgIcons/finance.svg +3 -3
  124. package/src/assets/svgIcons/financing_for_pv-1.svg +5 -5
  125. package/src/assets/svgIcons/financing_for_pv-2.svg +3 -3
  126. package/src/assets/svgIcons/financing_for_pv.svg +6 -6
  127. package/src/assets/svgIcons/finish-1.svg +4 -4
  128. package/src/assets/svgIcons/finish.svg +3 -3
  129. package/src/assets/svgIcons/flatten.svg +11 -11
  130. package/src/assets/svgIcons/flatten_roof.svg +20 -20
  131. package/src/assets/svgIcons/folder.svg +3 -3
  132. package/src/assets/svgIcons/free_technology.svg +5 -5
  133. package/src/assets/svgIcons/handle.svg +5 -5
  134. package/src/assets/svgIcons/heat_calc.svg +7 -7
  135. package/src/assets/svgIcons/height_equalize.svg +3 -3
  136. package/src/assets/svgIcons/height_snap.svg +3 -3
  137. package/src/assets/svgIcons/house.svg +3 -3
  138. package/src/assets/svgIcons/house_3d-1.svg +7 -7
  139. package/src/assets/svgIcons/house_3d.svg +7 -7
  140. package/src/assets/svgIcons/hybrid.svg +4 -4
  141. package/src/assets/svgIcons/inclination.svg +2 -2
  142. package/src/assets/svgIcons/info.svg +3 -3
  143. package/src/assets/svgIcons/initial_situation.svg +3 -3
  144. package/src/assets/svgIcons/integrations.svg +3 -3
  145. package/src/assets/svgIcons/intro-tour-1.svg +3 -3
  146. package/src/assets/svgIcons/intro-tour.svg +3 -3
  147. package/src/assets/svgIcons/inverter-1.svg +5 -5
  148. package/src/assets/svgIcons/inverter.svg +3 -3
  149. package/src/assets/svgIcons/italic.svg +3 -3
  150. package/src/assets/svgIcons/key.svg +3 -3
  151. package/src/assets/svgIcons/lake.svg +29 -29
  152. package/src/assets/svgIcons/layers_close.svg +4 -4
  153. package/src/assets/svgIcons/layers_open.svg +4 -4
  154. package/src/assets/svgIcons/lead_marketplace.svg +6 -6
  155. package/src/assets/svgIcons/lead_provider.svg +4 -4
  156. package/src/assets/svgIcons/length_2d.svg +2 -2
  157. package/src/assets/svgIcons/length_3d.svg +4 -4
  158. package/src/assets/svgIcons/length_calculator.svg +2 -2
  159. package/src/assets/svgIcons/length_in_2d_active.svg +12 -12
  160. package/src/assets/svgIcons/length_in_2d_inctive.svg +13 -13
  161. package/src/assets/svgIcons/light_bulb.svg +3 -3
  162. package/src/assets/svgIcons/like.svg +3 -3
  163. package/src/assets/svgIcons/line_graph.svg +3 -3
  164. package/src/assets/svgIcons/local_subsidies.svg +18 -18
  165. package/src/assets/svgIcons/location.svg +3 -3
  166. package/src/assets/svgIcons/lock.svg +3 -3
  167. package/src/assets/svgIcons/logout.svg +3 -3
  168. package/src/assets/svgIcons/loop.svg +3 -3
  169. package/src/assets/svgIcons/low-vegetation.svg +37 -37
  170. package/src/assets/svgIcons/lunch.svg +4 -4
  171. package/src/assets/svgIcons/magic_tool.svg +6 -6
  172. package/src/assets/svgIcons/map_icon.svg +5 -5
  173. package/src/assets/svgIcons/map_settings.svg +3 -3
  174. package/src/assets/svgIcons/margin_tool.svg +4 -4
  175. package/src/assets/svgIcons/meeting.svg +6 -6
  176. package/src/assets/svgIcons/module.svg +3 -3
  177. package/src/assets/svgIcons/move_copy.svg +4 -4
  178. package/src/assets/svgIcons/move_down.svg +3 -3
  179. package/src/assets/svgIcons/move_up.svg +3 -3
  180. package/src/assets/svgIcons/new_area_inactive.svg +11 -11
  181. package/src/assets/svgIcons/next.svg +4 -4
  182. package/src/assets/svgIcons/normal-tg.svg +30 -30
  183. package/src/assets/svgIcons/normal-vegetation.svg +53 -53
  184. package/src/assets/svgIcons/not_equal_to.svg +3 -3
  185. package/src/assets/svgIcons/numbered_list.svg +6 -6
  186. package/src/assets/svgIcons/obstacle_tool.svg +8 -8
  187. package/src/assets/svgIcons/obstacle_tool_origin.svg +3 -3
  188. package/src/assets/svgIcons/offset_tool.svg +8 -8
  189. package/src/assets/svgIcons/open-tg.svg +21 -21
  190. package/src/assets/svgIcons/optimizer.svg +6 -6
  191. package/src/assets/svgIcons/outline_tool.svg +11 -11
  192. package/src/assets/svgIcons/pan_tool.svg +12 -12
  193. package/src/assets/svgIcons/panels_tool.svg +8 -8
  194. package/src/assets/svgIcons/pen_tool.svg +4 -4
  195. package/src/assets/svgIcons/picker_tool.svg +4 -4
  196. package/src/assets/svgIcons/picture.svg +3 -3
  197. package/src/assets/svgIcons/pin.svg +5 -5
  198. package/src/assets/svgIcons/presentation.svg +3 -3
  199. package/src/assets/svgIcons/previous.svg +4 -4
  200. package/src/assets/svgIcons/profile-1.svg +4 -4
  201. package/src/assets/svgIcons/profile.svg +4 -4
  202. package/src/assets/svgIcons/profitability.svg +3 -3
  203. package/src/assets/svgIcons/project_analysis.svg +4 -4
  204. package/src/assets/svgIcons/project_settings.svg +4 -4
  205. package/src/assets/svgIcons/protected-tg.svg +47 -47
  206. package/src/assets/svgIcons/pv.svg +3 -3
  207. package/src/assets/svgIcons/quotations.svg +6 -6
  208. package/src/assets/svgIcons/redo.svg +6 -6
  209. package/src/assets/svgIcons/resizer.svg +5 -5
  210. package/src/assets/svgIcons/roof_layer.svg +3 -3
  211. package/src/assets/svgIcons/rotate_tool.svg +3 -3
  212. package/src/assets/svgIcons/rotate_view.svg +5 -5
  213. package/src/assets/svgIcons/ruler_tool.svg +3 -3
  214. package/src/assets/svgIcons/run_simulation.svg +3 -3
  215. package/src/assets/svgIcons/save.svg +3 -3
  216. package/src/assets/svgIcons/scaling_tool.svg +8 -8
  217. package/src/assets/svgIcons/sea.svg +34 -34
  218. package/src/assets/svgIcons/search.svg +3 -3
  219. package/src/assets/svgIcons/security.svg +3 -3
  220. package/src/assets/svgIcons/settings.svg +3 -3
  221. package/src/assets/svgIcons/show_in_a_new_tab.svg +12 -12
  222. package/src/assets/svgIcons/smartphone.svg +4 -4
  223. package/src/assets/svgIcons/solar_calc.svg +13 -13
  224. package/src/assets/svgIcons/solarmarkt.svg +3 -0
  225. package/src/assets/svgIcons/sorting.svg +4 -4
  226. package/src/assets/svgIcons/split.svg +12 -12
  227. package/src/assets/svgIcons/start_of_the_list.svg +5 -5
  228. package/src/assets/svgIcons/strikethrough.svg +4 -4
  229. package/src/assets/svgIcons/string_design.svg +5 -5
  230. package/src/assets/svgIcons/string_directions.svg +10 -10
  231. package/src/assets/svgIcons/subscriptions.svg +3 -3
  232. package/src/assets/svgIcons/subsidies-1.svg +5 -5
  233. package/src/assets/svgIcons/subsidies-2.svg +3 -3
  234. package/src/assets/svgIcons/subsidies.svg +3 -3
  235. package/src/assets/svgIcons/subtract_icon.svg +3 -3
  236. package/src/assets/svgIcons/suitcase.svg +3 -3
  237. package/src/assets/svgIcons/summer.svg +3 -3
  238. package/src/assets/svgIcons/template_icon_not_clickable.svg +6 -6
  239. package/src/assets/svgIcons/transfer.svg +4 -4
  240. package/src/assets/svgIcons/trim_tool.svg +4 -4
  241. package/src/assets/svgIcons/truck.svg +3 -3
  242. package/src/assets/svgIcons/underlined.svg +3 -3
  243. package/src/assets/svgIcons/undo.svg +6 -6
  244. package/src/assets/svgIcons/uparrow.svg +3 -3
  245. package/src/assets/svgIcons/update.svg +3 -3
  246. package/src/assets/svgIcons/upload_avatar-1.svg +12 -12
  247. package/src/assets/svgIcons/upload_avatar.svg +5 -5
  248. package/src/assets/svgIcons/upload_image.svg +8 -8
  249. package/src/assets/svgIcons/upload_image_tool.svg +7 -7
  250. package/src/assets/svgIcons/variants.svg +6 -6
  251. package/src/assets/svgIcons/vertical_tool.svg +3 -3
  252. package/src/assets/svgIcons/virtual_storage.svg +4 -4
  253. package/src/assets/svgIcons/warning.svg +4 -4
  254. package/src/assets/svgIcons/way.svg +5 -5
  255. package/src/assets/svgIcons/wifi.svg +3 -3
  256. package/src/assets/svgIcons/winter.svg +3 -3
  257. package/src/assets/svgIcons/workflow_template.svg +11 -11
  258. package/src/assets/tests/__mocks__/iconCache.js +1 -1
  259. package/src/assets/tests/__mocks__/svgMock.js +1 -1
  260. package/src/assets/tests/helpers.js +12 -12
  261. package/src/assets/theme.js +45 -46
  262. package/src/components/addNewButton/AddNewButton.stories.js +17 -17
  263. package/src/components/addNewButton/addNewButton.spec.js +23 -23
  264. package/src/components/addNewButton/index.vue +66 -66
  265. package/src/components/banner/actionBanner/ActionBanner.stories.js +45 -45
  266. package/src/components/banner/actionBanner/actionBanner.spec.js +76 -76
  267. package/src/components/banner/actionBanner/index.vue +86 -86
  268. package/src/components/banner/banner/Banner.stories.js +64 -64
  269. package/src/components/banner/banner/banner.spec.js +149 -149
  270. package/src/components/banner/banner/index.vue +205 -205
  271. package/src/components/banner/infoBanner/InfoBanner.spec.js +70 -70
  272. package/src/components/banner/infoBanner/InfoBanner.stories.js +42 -42
  273. package/src/components/banner/infoBanner/index.vue +97 -97
  274. package/src/components/banner/notificationBanner/index.vue +131 -131
  275. package/src/components/buttons/buttonIcon/index.vue +147 -147
  276. package/src/components/buttons/closeButton/CloseButton.stories.js +25 -25
  277. package/src/components/buttons/closeButton/index.vue +62 -62
  278. package/src/components/buttons/mainButton/MainButton.stories.js +51 -51
  279. package/src/components/buttons/mainButton/index.vue +174 -174
  280. package/src/components/buttons/mainButton/mainButton.spec.js +35 -35
  281. package/src/components/card/Card.stories.js +79 -79
  282. package/src/components/card/card.spec.js +135 -135
  283. package/src/components/card/index.vue +116 -116
  284. package/src/components/collapsableInfoText/index.vue +127 -127
  285. package/src/components/deleteIcon/DeleteIcon.stories.js +29 -29
  286. package/src/components/deleteIcon/index.vue +78 -78
  287. package/src/components/draggableInputHandle/index.vue +46 -46
  288. package/src/components/dropdown/Dropdown.stories.js +53 -53
  289. package/src/components/dropdown/index.vue +138 -138
  290. package/src/components/errorMessage/index.vue +64 -64
  291. package/src/components/filter/filterSettings.vue +669 -669
  292. package/src/components/filter/index.vue +154 -154
  293. package/src/components/filter/parentDropdown.vue +91 -91
  294. package/src/components/icon/Icons.stories.js +31 -31
  295. package/src/components/icon/icon.spec.js +66 -66
  296. package/src/components/icon/iconCache.mjs +23 -23
  297. package/src/components/icon/iconCollection.vue +83 -83
  298. package/src/components/icon/index.vue +177 -177
  299. package/src/components/iconWrapper/index.vue +184 -184
  300. package/src/components/infoCard/InfoCard.stories.js +170 -170
  301. package/src/components/infoCard/defaultProps.js +7 -7
  302. package/src/components/infoCard/index.vue +152 -152
  303. package/src/components/infoCard/infoCard.spec.js +64 -64
  304. package/src/components/infoText/index.vue +488 -511
  305. package/src/components/infoText/placeholder.vue +225 -225
  306. package/src/components/inputs/checkbox/Checkbox.stories.js +63 -63
  307. package/src/components/inputs/checkbox/checkbox.spec.js +109 -109
  308. package/src/components/inputs/checkbox/index.vue +241 -241
  309. package/src/components/inputs/inputNumber/InputNumber.stories.js +150 -150
  310. package/src/components/inputs/inputNumber/index.vue +985 -985
  311. package/src/components/inputs/inputNumberQuestion/index.vue +218 -218
  312. package/src/components/inputs/inputText/InputText.stories.js +70 -70
  313. package/src/components/inputs/inputText/index.vue +457 -457
  314. package/src/components/inputs/inputText/inputText.spec.js +588 -588
  315. package/src/components/inputs/radioButton/RadioButton.stories.js +77 -77
  316. package/src/components/inputs/radioButton/defaultProps.js +31 -31
  317. package/src/components/inputs/radioButton/index.vue +336 -336
  318. package/src/components/inputs/radioButton/radioButton.spec.js +306 -306
  319. package/src/components/inputs/searchInput/SearchInput.stories.js +66 -66
  320. package/src/components/inputs/searchInput/defaultProps.js +12 -12
  321. package/src/components/inputs/searchInput/index.vue +165 -165
  322. package/src/components/inputs/searchInput/searchInput.spec.js +64 -64
  323. package/src/components/inputs/select/index.vue +968 -968
  324. package/src/components/inputs/select/option/index.vue +165 -164
  325. package/src/components/inputs/select/select.stories.js +58 -58
  326. package/src/components/inputs/slider/index.vue +126 -126
  327. package/src/components/inputs/switchField/index.vue +254 -254
  328. package/src/components/inputs/textAreaInput/TextAreaInput.stories.js +127 -127
  329. package/src/components/inputs/textAreaInput/index.vue +204 -204
  330. package/src/components/inputs/toggle/Toggle.stories.js +77 -77
  331. package/src/components/inputs/toggle/index.vue +322 -322
  332. package/src/components/inputs/toggle/toggle.spec.js +102 -102
  333. package/src/components/label/index.vue +98 -98
  334. package/src/components/markerItem/index.vue +95 -95
  335. package/src/components/modals/actionModal/index.vue +64 -64
  336. package/src/components/modals/infoModal/index.vue +52 -52
  337. package/src/components/modals/modal/index.vue +185 -185
  338. package/src/components/modals/modal/modal.stories.js +31 -31
  339. package/src/components/navigationTabs/index.vue +114 -114
  340. package/src/components/pageSubtitle/PageSubtitle.stories.js +59 -59
  341. package/src/components/pageSubtitle/index.vue +78 -78
  342. package/src/components/pageSubtitle/pageSubtitle.spec.js +46 -46
  343. package/src/components/pageTitle/PageTitle.stories.js +95 -95
  344. package/src/components/pageTitle/index.vue +91 -91
  345. package/src/components/pageTitle/pageTitle.spec.js +46 -46
  346. package/src/components/pagination/index.vue +148 -148
  347. package/src/components/progressBar/index.vue +125 -125
  348. package/src/components/projectMarker/index.vue +300 -300
  349. package/src/components/rangeSlider/Slider.vue +578 -578
  350. package/src/components/rangeSlider/index.vue +517 -517
  351. package/src/components/rangeSlider/utils/dom.js +49 -49
  352. package/src/components/rangeSlider/utils/fns.js +26 -26
  353. package/src/components/roundTabs/index.vue +107 -107
  354. package/src/components/selectedOptions/index.vue +471 -471
  355. package/src/components/selectedOptions/selectedOptions.spec.js +176 -176
  356. package/src/components/selectedOptions/selectedOptions.stories.js +155 -155
  357. package/src/components/sideMenu/index.vue +279 -272
  358. package/src/components/spinner/Spinner.stories.js +34 -34
  359. package/src/components/spinner/index.vue +96 -96
  360. package/src/components/spinner/spinner.spec.js +69 -69
  361. package/src/components/spinnerGif/index.vue +98 -98
  362. package/src/components/stringDesign/DropdownMenu/index.vue +983 -983
  363. package/src/components/tableDropdown/index.vue +669 -685
  364. package/src/components/tables/mainTable/exampleNested.vue +328 -328
  365. package/src/components/tables/mainTable/index.vue +518 -518
  366. package/src/components/tables/viewTable/index.vue +195 -195
  367. package/src/components/tabsHeader/index.vue +83 -83
  368. package/src/components/threeDots/index.vue +413 -413
  369. package/src/components/videoThumbnail/index.vue +103 -103
  370. package/src/components/videoThumbnail/videoThumbnail.stories.js +33 -33
  371. package/src/helpers/currencyMapping.js +28 -28
  372. package/src/helpers/numberConverter.js +103 -103
  373. package/src/helpers/translateLang.js +128 -128
  374. package/src/main.js +7 -7
  375. package/src/mixins/inputValidations.js +97 -97
  376. package/src/router/dynamicRoutes.js +23 -23
  377. package/src/stories/Button.stories.js +48 -48
  378. package/src/stories/Button.vue +52 -52
  379. package/src/stories/Configure.mdx +364 -364
  380. package/src/stories/Header.stories.js +41 -41
  381. package/src/stories/Header.vue +59 -59
  382. package/src/stories/Page.stories.js +30 -30
  383. package/src/stories/Page.vue +83 -83
  384. package/src/stories/button.css +30 -30
  385. package/src/stories/header.css +32 -32
  386. package/src/stories/page.css +69 -69
  387. package/src/utils/index.js +12 -12
  388. package/src/assets/svgIcons/plus_button.svg +0 -4
  389. package/src/assets/svgIcons/star.svg +0 -3
  390. package/src/components/infoText/constants.js +0 -4
  391. package/src/components/infoText/infoText.spec.js +0 -62
  392. package/src/components/infoText/infoText.stories.js +0 -48
@@ -1,983 +1,983 @@
1
- <template>
2
- <PageContainer>
3
- <PageTitleContainer data-id="string_design_expand_collapse_section">
4
- <SectionTitleText>{{ $gettext('inverters') }}</SectionTitleText>
5
- <ButtonIcon
6
- custom-color="black"
7
- :icon-name="hasExpandedSection ? 'collapse_all' : 'expand_all'"
8
- :text="$gettext(hasExpandedSection ? 'collapse_all' : 'expand_all')"
9
- @click="toggleAllSections"
10
- />
11
- </PageTitleContainer>
12
- <SectionContainer
13
- v-for="(item, index) in dataListToDisplay"
14
- :key="item.inverterId"
15
- >
16
- <TopContainer>
17
- <LeftContainer>
18
- <TitleContainer>
19
- <IconWrapper
20
- v-if="item.type != 'optimizer'"
21
- size="32px"
22
- @click="toggleSection(item.inverterId)"
23
- >
24
- <RCIcon
25
- v-if="isItemCollapsible(item)"
26
- color="white"
27
- :name="isExpanded(item.inverterId) ? 'arrow_up' : 'arrow_down'"
28
- size="10px"
29
- />
30
- <IconPlaceholder v-else />
31
- </IconWrapper>
32
- <TextContainer
33
- :style="{ marginLeft: item.type == 'optimizer' ? '32px' : '0' }"
34
- >
35
- <TitleText :title="item.model">
36
- {{
37
- (item.type === 'optimizer' || !hasExpandedSection) &&
38
- item.quantity
39
- ? item.quantity + ' x'
40
- : ''
41
- }}
42
- {{ item.model }}
43
- </TitleText>
44
- <TitleSubText>
45
- <span>{{ item.brandName }}</span>
46
- <template
47
- v-if="itemHasStrings(item) || item.type === 'optimizer'"
48
- >
49
- <ContainerValue
50
- v-if="
51
- item.getkWp() > 1 &&
52
- item.type !== 'optimizer' &&
53
- hasExpandedSection
54
- "
55
- >
56
- |
57
- {{
58
- numberToString({
59
- value: item.getkWp(),
60
- numberPrecision: 2,
61
- })
62
- }}
63
- kWp
64
- </ContainerValue>
65
- <ContainerValue
66
- v-else-if="item.type !== 'optimizer' && hasExpandedSection"
67
- >
68
- |
69
- {{
70
- numberToString({
71
- value: 1000 * item.getkWp(),
72
- numberPrecision: 2,
73
- minDecimals: 2,
74
- })
75
- }}
76
- Wp
77
- </ContainerValue>
78
- </template>
79
- </TitleSubText>
80
- </TextContainer>
81
- </TitleContainer>
82
- <MarkersContainer>
83
- <MarkerItem
84
- v-if="item.mppts.length && hasExpandedSection"
85
- :background-color="isTargetRatioInRange(item) ? 'green' : 'red'"
86
- >{{
87
- numberToString({
88
- value: 100 * item.getTargetRatio(),
89
- numberPrecision: 0,
90
- minDecimals: 0,
91
- })
92
- }}%
93
- </MarkerItem>
94
- <MarkerItem v-if="item.hasTemplate && !item.isLoading">
95
- <span
96
- :title="
97
- item.companyProductTemplateName
98
- ? item.companyProductTemplateName
99
- : $gettext('no_template_selected')
100
- "
101
- >
102
- {{
103
- item.companyProductTemplateName
104
- ? item.companyProductTemplateName
105
- : $gettext('no_template_selected')
106
- }}
107
- </span>
108
- </MarkerItem>
109
- <MarkerItem>
110
- <RCIcon color="white" :name="getIconName(item)" size="14px" />
111
- <MarkerText :title="getTypeName(item.type)">
112
- {{ getTypeName(item.type) }}
113
- </MarkerText>
114
- </MarkerItem>
115
- <MarkerItem
116
- v-if="item.type !== 'optimizer' && item.type !== 'storage'"
117
- :title="$gettext('AC power is the nominal AC output power.')"
118
- >
119
- {{
120
- numberToString({
121
- value: item.pacKw,
122
- numberPrecision: getNumberPrecision(item.pacKw),
123
- minDecimals: 0,
124
- })
125
- }}
126
- {{ $gettext('kWAC') }}
127
- </MarkerItem>
128
- <MarkerItem
129
- v-if="
130
- (!itemHasStrings(item) || !hasExpandedSection) &&
131
- item.type !== 'storage'
132
- "
133
- :title="$gettext('The DC power is the maximum DC input power.')"
134
- >
135
- {{
136
- numberToString({
137
- value: item.inputMaxPowerKw,
138
- numberPrecision: getNumberPrecision(item.inputMaxPowerKw),
139
- minDecimals: 0,
140
- })
141
- }}
142
- {{ $gettext('kWDC') }}
143
- </MarkerItem>
144
- <MarkerItem
145
- v-if="item.type == 'storage'"
146
- :title="$gettext('charging_ac_power_kva_marker_title')"
147
- >
148
- {{
149
- numberToString({
150
- value: item.chargingAcPowerKva,
151
- numberPrecision: getNumberPrecision(item.chargingAcPowerKva),
152
- minDecimals: 0,
153
- })
154
- }}
155
- {{ $gettext('kWAC') }}
156
- </MarkerItem>
157
- </MarkersContainer>
158
- <IconsContainer>
159
- <IconWrapper
160
- v-if="nonOptimizerInverterCount > 1 || item.type === 'optimizer'"
161
- @click="
162
- !item.isLoading && hasGroupedInverters(item)
163
- ? $emit('on-delete-grouped', item)
164
- : $emit('on-delete', item)
165
- "
166
- >
167
- <RCIcon
168
- :color="item.isLoading ? 'grey' : 'red'"
169
- :cursor="item.isLoading ? 'not-allowed' : 'pointer'"
170
- :is-disabled="item.isLoading"
171
- name="delete"
172
- size="14px"
173
- />
174
- </IconWrapper>
175
- <IconWrapper @click="!item.isLoading && $emit('on-edit', item)">
176
- <RCIcon
177
- :color="item.isLoading ? 'grey' : 'white'"
178
- :cursor="item.isLoading ? 'not-allowed' : 'pointer'"
179
- :is-disabled="item.isLoading"
180
- name="edit_button"
181
- size="14px"
182
- />
183
- </IconWrapper>
184
- <IconWrapper @click="$emit('on-datasheet', item)">
185
- <RCIcon
186
- color="white"
187
- cursor="pointer"
188
- name="document"
189
- size="14px"
190
- />
191
- </IconWrapper>
192
- </IconsContainer>
193
- </LeftContainer>
194
- <SortingContainer v-if="dataListToDisplay.length > 1">
195
- <SortingIconWrapper
196
- :data-test-id="'move_up_' + index"
197
- :is-disabled="index === 0"
198
- @click="index > 0 && handleMoveClick('up', index, item)"
199
- >
200
- <RCIcon
201
- :color="index === 0 ? 'grey6' : 'grey3'"
202
- :cursor="index === 0 ? 'not-allowed' : 'pointer'"
203
- name="move_up"
204
- size="14px"
205
- />
206
- </SortingIconWrapper>
207
- <SortingIconWrapper
208
- :data-test-id="'move_down_' + index"
209
- :is-disabled="index === dataListToDisplay.length - 1"
210
- @click="
211
- index < dataListToDisplay.length - 1 &&
212
- handleMoveClick('down', index, item)
213
- "
214
- >
215
- <RCIcon
216
- :color="
217
- index === dataListToDisplay.length - 1 ? 'grey6' : 'grey3'
218
- "
219
- :cursor="
220
- index === dataListToDisplay.length - 1
221
- ? 'not-allowed'
222
- : 'pointer'
223
- "
224
- :is-disabled="index === dataListToDisplay.length - 1"
225
- name="move_down"
226
- size="14px"
227
- />
228
- </SortingIconWrapper>
229
- </SortingContainer>
230
- </TopContainer>
231
- <BoxContainer
232
- v-for="mppt in item.mppts"
233
- v-show="isExpanded(item.inverterId)"
234
- :key="mppt.mpptId"
235
- >
236
- <BoxTitleWrapper>
237
- <IconWrapper
238
- v-if="itemHasStrings(item)"
239
- margin-left="4px"
240
- size="8px"
241
- @click="toggleMppt(mppt.mpptId)"
242
- >
243
- <RCIcon
244
- color="white"
245
- cursor="pointer"
246
- :name="isMpptExpanded(mppt.mpptId) ? 'arrow_up' : 'arrow_down'"
247
- size="10px"
248
- />
249
- </IconWrapper>
250
- <BoxTitleText>{{ mppt.name }}</BoxTitleText>
251
- <BoxIconsContainer>
252
- <BoxIconWrapper>
253
- <RCIcon
254
- color="white"
255
- cursor="pointer"
256
- name="string_design"
257
- size="11px"
258
- />
259
- <div>
260
- {{ mppt.strings.length }}/{{ mppt.getNumberOfTerminals() }}
261
- </div>
262
- </BoxIconWrapper>
263
- <BoxIconWrapper>
264
- <RCIcon
265
- color="white"
266
- cursor="pointer"
267
- name="panels_tool"
268
- size="11px"
269
- />
270
- <div>{{ getNumberOfMpptModules(mppt.strings) }}</div>
271
- </BoxIconWrapper>
272
- </BoxIconsContainer>
273
- </BoxTitleWrapper>
274
-
275
- <div v-show="isMpptExpanded(mppt.mpptId) && itemHasStrings(item)">
276
- <StringBox v-for="string in mppt.strings" :key="string.id">
277
- <StringColorContainer :background-color="string.color" />
278
- <StringContainer>
279
- <div>{{ string.name }}</div>
280
- <StringIconContainer>
281
- <div>{{ string.modules.length }}</div>
282
- <RCIcon color="white" name="module" size="14px" />
283
- </StringIconContainer>
284
- </StringContainer>
285
- </StringBox>
286
- </div>
287
- </BoxContainer>
288
- <template v-if="availableMPPTData(item)">
289
- <BoxContainer
290
- v-for="availableItem in availableMPPTData(item)"
291
- v-show="isExpanded(item.inverterId)"
292
- :key="availableItem.mpptId"
293
- >
294
- <BoxTitleWrapper>
295
- <IconWrapper
296
- v-if="itemHasStrings(item)"
297
- margin-left="4px"
298
- size="8px"
299
- @click="toggleMppt(availableItem.mpptId)"
300
- >
301
- <RCIcon
302
- color="white"
303
- cursor="pointer"
304
- :name="
305
- isMpptExpanded(availableItem.mpptId)
306
- ? 'arrow_up'
307
- : 'arrow_down'
308
- "
309
- size="10px"
310
- />
311
- </IconWrapper>
312
- <BoxTitleText>{{ availableItem.name }}</BoxTitleText>
313
- <BoxIconsContainer>
314
- <BoxIconWrapper>
315
- <RCIcon
316
- color="white"
317
- cursor="pointer"
318
- name="string_design"
319
- size="11px"
320
- />
321
- <div>0/{{ availableItem.numberOfTerminals }}</div>
322
- </BoxIconWrapper>
323
- <BoxIconWrapper>
324
- <RCIcon
325
- color="white"
326
- cursor="pointer"
327
- name="panels_tool"
328
- size="11px"
329
- />
330
- <div>0</div>
331
- </BoxIconWrapper>
332
- </BoxIconsContainer>
333
- </BoxTitleWrapper>
334
- <EmptyStringBox
335
- v-show="
336
- isMpptExpanded(availableItem.mpptId) && itemHasStrings(item)
337
- "
338
- />
339
- </BoxContainer>
340
- </template>
341
- <BoxContainer
342
- v-if="item.storageSystem && Object.keys(item.storageSystem).length > 0"
343
- v-show="isExpanded(item.inverterId)"
344
- :key="item.storageSystem.storage_system_id"
345
- >
346
- <BoxTitleWrapper>
347
- <IconWrapper
348
- margin-left="4px"
349
- size="8px"
350
- @click="toggleMppt(item.storageSystem.storage_system_id)"
351
- >
352
- <RCIcon
353
- color="white"
354
- cursor="pointer"
355
- :name="
356
- isMpptExpanded(item.storageSystem.storage_system_id)
357
- ? 'arrow_up'
358
- : 'arrow_down'
359
- "
360
- size="10px"
361
- />
362
- </IconWrapper>
363
- <BoxTitleText>{{ $gettext('battery') }}</BoxTitleText>
364
- </BoxTitleWrapper>
365
- <div v-show="isMpptExpanded(item.storageSystem.storage_system_id)">
366
- <BatteryBox>
367
- <RCIcon color="white" name="battery" size="14px" />
368
- <BatteryDetailsContainer>
369
- <BatteryType>{{ item.storageSystem.brand_name }}</BatteryType>
370
- <BatteryModel>{{ item.storageSystem.model }}</BatteryModel>
371
- </BatteryDetailsContainer>
372
- <BatteryValue>
373
- {{
374
- numberToString({
375
- value: item.storageSystem.nominal_capacity_kWh,
376
- numberPrecision: 2,
377
- minDecimals: 0,
378
- })
379
- }}
380
- kWh
381
- </BatteryValue>
382
- </BatteryBox>
383
- </div>
384
- </BoxContainer>
385
- </SectionContainer>
386
- <DividerContainer v-if="batteryData.length" />
387
- <UnassignedContainer v-if="batteryData.length">
388
- <SectionTitleText>{{ $gettext('battery_information') }}</SectionTitleText>
389
- <BatteryBox
390
- v-for="battery in batteryData"
391
- :key="battery.id"
392
- :is-unassigned="true"
393
- >
394
- <RCIcon color="black" name="battery" size="14px" />
395
- <BatteryDetailsContainer>
396
- <UnassignedType>{{ battery.brand_name }}</UnassignedType>
397
- <UnassignedModel>{{ battery.model }}</UnassignedModel>
398
- </BatteryDetailsContainer>
399
- <BatteryValue>
400
- {{
401
- numberToString({
402
- value: battery.nominal_capacity_kWh,
403
- numberPrecision: 2,
404
- minDecimals: 0,
405
- })
406
- }}
407
- kWh
408
- </BatteryValue>
409
- </BatteryBox>
410
- </UnassignedContainer>
411
- </PageContainer>
412
- </template>
413
-
414
- <script>
415
- // import DropdownMenu from '@eturnity/eturnity_reusable_components/src/components/stringDesign/DropdownMenu'
416
- import styled from 'vue3-styled-components'
417
- import RCIcon from '../../icon'
418
- import ButtonIcon from '../../buttons/buttonIcon'
419
- import { numberToString } from '../../../helpers/numberConverter'
420
-
421
- const PageContainer = styled.div`
422
- position: relative;
423
- `
424
-
425
- const SectionContainer = styled.div`
426
- &:not(:last-child) {
427
- margin-bottom: 8px;
428
- }
429
- background-color: ${(props) => props.theme.colors.black};
430
- padding: 8px;
431
- border-radius: 4px;
432
- color: ${(props) => props.theme.colors.white};
433
- `
434
-
435
- const TitleContainer = styled.div`
436
- display: flex;
437
- align-items: center;
438
- gap: 4px;
439
- `
440
-
441
- const IconsContainer = styled.div`
442
- display: flex;
443
- align-items: center;
444
- margin-left: 32px;
445
- margin-top: 4px;
446
- `
447
-
448
- const TextContainer = styled.div`
449
- display: grid;
450
- `
451
-
452
- const TitleText = styled.div`
453
- font-size: 14px;
454
- white-space: nowrap;
455
- overflow: hidden;
456
- text-overflow: ellipsis;
457
- `
458
-
459
- const TitleSubText = styled.div`
460
- font-size: 12px;
461
- display: flex;
462
- gap: 4px;
463
- `
464
-
465
- const MarkersContainer = styled.div`
466
- display: flex;
467
- flex-wrap: wrap;
468
- gap: 8px;
469
- margin: 4px 0 2px 32px;
470
- align-items: end;
471
- `
472
-
473
- const MarkerAttrs = { backgroundColor: String }
474
- const MarkerItem = styled('div', MarkerAttrs)`
475
- display: flex;
476
- gap: 5px;
477
- align-items: center;
478
- padding: 2px 7px;
479
- border-radius: 4px;
480
- background-color: ${(props) =>
481
- props.backgroundColor
482
- ? props.theme.colors[props.backgroundColor]
483
- : props.theme.colors.grey6};
484
- font-size: 11px;
485
- color: ${(props) => props.theme.colors.white};
486
- & > span {
487
- overflow: hidden;
488
- white-space: nowrap;
489
- text-overflow: ellipsis;
490
- max-width: 11ch;
491
- }
492
- `
493
-
494
- const MarkerText = styled.div`
495
- max-width: 11ch;
496
- white-space: nowrap;
497
- overflow: hidden;
498
- text-overflow: ellipsis;
499
- `
500
-
501
- const ContainerValue = styled.div`
502
- font-size: 12px;
503
- `
504
-
505
- const IconAttrs = {
506
- size: { type: String, default: '32px' },
507
- marginLeft: String,
508
- }
509
- const IconWrapper = styled('div', IconAttrs)`
510
- display: flex;
511
- align-items: center;
512
- justify-content: center;
513
- border-radius: 4px;
514
- cursor: pointer;
515
- width: ${(props) => props.size};
516
- height: ${(props) => props.size};
517
- margin-left: ${(props) => props.marginLeft};
518
- &:hover {
519
- background: ${(props) =>
520
- props.marginLeft ? 'transparent' : 'rgba(255, 255, 255, 0.1)'};
521
- }
522
-
523
- &:active {
524
- background: rgba(255, 255, 255, 0.2);
525
- }
526
- `
527
-
528
- const BoxContainer = styled.div`
529
- border-radius: 4px;
530
- background: ${(props) => props.theme.colors.grey6};
531
- padding: 8px;
532
- margin-top: 8px;
533
- margin-left: 30px;
534
- `
535
-
536
- const BoxTitleWrapper = styled.div`
537
- display: flex;
538
- align-items: center;
539
- gap: 8px;
540
- `
541
-
542
- const BoxTitleText = styled.div`
543
- font-size: 13px;
544
- `
545
-
546
- const BoxIconsContainer = styled.div`
547
- display: flex;
548
- gap: 8px;
549
- align-items: center;
550
- margin-left: auto;
551
- font-size: 11px;
552
- `
553
-
554
- const BoxIconWrapper = styled.div`
555
- display: flex;
556
- align-items: center;
557
- justify-content: center;
558
- gap: 4px;
559
- padding: 4px;
560
- `
561
-
562
- const StringBox = styled.div`
563
- display: grid;
564
- grid-template-columns: auto 1fr;
565
- margin-top: 8px;
566
- border-radius: 4px;
567
- border: 1px solid ${(props) => props.theme.colors.grey3};
568
- `
569
-
570
- const StringContainer = styled.div`
571
- display: flex;
572
- justify-content: space-between;
573
- gap: 8px;
574
- padding: 8px;
575
- font-size: 11px;
576
- `
577
-
578
- const StringColorAttrs = { backgroundColor: String }
579
- const StringColorContainer = styled('div', StringColorAttrs)`
580
- background-color: ${(props) => props.backgroundColor};
581
- width: 22px;
582
- min-height: 100%;
583
- border-top-left-radius: 2px;
584
- border-bottom-left-radius: 2px;
585
- `
586
-
587
- const StringIconContainer = styled.div`
588
- display: flex;
589
- align-items: center;
590
- justify-content: center;
591
- gap: 2px;
592
- padding: 0 4px;
593
- `
594
-
595
- const PageTitleContainer = styled.div`
596
- position: sticky;
597
- top: 0;
598
- background-color: ${(props) => props.theme.colors.black};
599
- z-index: 99;
600
- padding: 8px;
601
- display: flex;
602
- justify-content: space-between;
603
- align-items: center;
604
- padding-bottom: 8px;
605
- `
606
-
607
- const SectionTitleText = styled.div`
608
- font-size: 14px;
609
- font-weight: 700;
610
- color: ${(props) => props.theme.colors.white};
611
- `
612
-
613
- const BatteryBoxAttrs = { isUnassigned: Boolean }
614
- const BatteryBox = styled('div', BatteryBoxAttrs)`
615
- display: flex;
616
- align-items: center;
617
- gap: 8px;
618
- border: 1px solid ${(props) => props.theme.colors.white};
619
- border-radius: 4px;
620
- padding: 8px;
621
- margin-top: 8px;
622
- background-color: ${(props) =>
623
- props.isUnassigned ? props.theme.colors.grey2 : ''};
624
- `
625
-
626
- const BatteryDetailsContainer = styled.div`
627
- display: flex;
628
- flex-direction: column;
629
- gap: 4px;
630
- `
631
-
632
- const BatteryType = styled.div`
633
- font-size: 11px;
634
- `
635
-
636
- const BatteryModel = styled.div`
637
- font-size: 10px;
638
- `
639
-
640
- const BatteryValue = styled.div`
641
- font-size: 10px;
642
- align-self: flex-end;
643
- margin-left: auto;
644
- `
645
- const TopContainer = styled.div`
646
- display: flex;
647
- justify-content: space-between;
648
- `
649
-
650
- const LeftContainer = styled.div``
651
-
652
- const SortingContainer = styled.div`
653
- display: flex;
654
- flex-direction: column;
655
- align-items: center;
656
- `
657
-
658
- const SortingIconWrapperAttrs = { isDisabled: Boolean }
659
- const SortingIconWrapper = styled('div', SortingIconWrapperAttrs)`
660
- cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
661
- width: 30px;
662
- height: 30px;
663
- display: flex;
664
- align-items: center;
665
- justify-content: center;
666
-
667
- &:hover {
668
- background-color: ${(props) =>
669
- props.isDisabled ? 'transparent' : 'rgba(255, 255, 255, 0.1)'};
670
- border-radius: 4px;
671
- }
672
- `
673
-
674
- const UnassignedContainer = styled.div`
675
- margin-top: 8px;
676
- `
677
-
678
- const DividerContainer = styled.div`
679
- height: 0.5px;
680
- width: 100%;
681
- background-color: ${(props) => props.theme.colors.grey4};
682
- opacity: 0.6;
683
- `
684
-
685
- const UnassignedType = styled.div`
686
- font-size: 12px;
687
- line-height: 150%;
688
- `
689
-
690
- const UnassignedModel = styled.div`
691
- font-size: 10px;
692
- line-height: 150%;
693
- `
694
-
695
- const IconPlaceholder = styled.div`
696
- width: 32px;
697
- `
698
-
699
- const EmptyStringBox = styled.div`
700
- border: 0.8px dashed ${(props) => props.theme.colors.black};
701
- border-radius: 4px;
702
- padding: 8px 8px 8px 0;
703
- height: 32px;
704
- width: 233px;
705
- margin-top: 8px;
706
- `
707
-
708
- export default {
709
- name: 'DropdownMenu',
710
- components: {
711
- SectionContainer,
712
- TitleContainer,
713
- IconsContainer,
714
- TextContainer,
715
- TitleText,
716
- TitleSubText,
717
- RCIcon,
718
- MarkersContainer,
719
- MarkerItem,
720
- ContainerValue,
721
- IconWrapper,
722
- BoxContainer,
723
- BoxTitleWrapper,
724
- BoxTitleText,
725
- BoxIconsContainer,
726
- BoxIconWrapper,
727
- StringBox,
728
- StringContainer,
729
- StringColorContainer,
730
- StringIconContainer,
731
- PageTitleContainer,
732
- SectionTitleText,
733
- ButtonIcon,
734
- PageContainer,
735
- BatteryBox,
736
- BatteryDetailsContainer,
737
- BatteryType,
738
- BatteryModel,
739
- BatteryValue,
740
- TopContainer,
741
- LeftContainer,
742
- SortingContainer,
743
- SortingIconWrapper,
744
- UnassignedContainer,
745
- DividerContainer,
746
- UnassignedType,
747
- UnassignedModel,
748
- IconPlaceholder,
749
- EmptyStringBox,
750
- MarkerText,
751
- },
752
- props: {
753
- dataList: {
754
- required: true,
755
- type: Array,
756
- },
757
- batteryData: {
758
- required: true,
759
- type: Array,
760
- },
761
- inverterParameters: {
762
- required: true,
763
- type: Object,
764
- },
765
- isPvAndBatteryActive: {
766
- required: false,
767
- type: Boolean,
768
- },
769
- },
770
- emits: ['on-edit', 'on-move', 'on-delete', 'on-delete-grouped'],
771
- data() {
772
- return {
773
- expandedInverters: [],
774
- expandedMppts: [],
775
- numberToString,
776
- }
777
- },
778
- computed: {
779
- dataListToDisplay() {
780
- let data = this.hasExpandedSection
781
- ? this.dataList
782
- : this.compressedDataList
783
- return data.sort((a, b) => a.lineNr - b.lineNr)
784
- },
785
- hasExpandedSection() {
786
- return this.expandedInverters.length > 0
787
- },
788
- hasStringsOrStorage() {
789
- return this.dataList.some((item) => {
790
- return (
791
- item.mppts.some((mppt) => mppt.strings.length > 0) ||
792
- (item.storageSystem && Object.keys(item.storageSystem).length > 0)
793
- )
794
- })
795
- },
796
- nonOptimizerInverterCount() {
797
- return this.dataList.filter((item) => item.type !== 'optimizer').length
798
- },
799
- compressedDataList() {
800
- return this.dataList.reduce((acc, item) => {
801
- if (item.type == 'optimizer') {
802
- acc.push(item)
803
- return acc
804
- }
805
- const existingInverter = acc.find((inverter) => {
806
- return inverter.componentId == item.componentId
807
- })
808
- if (!existingInverter) {
809
- acc.push(item)
810
- item.quantity = 1
811
- } else {
812
- existingInverter.quantity++
813
- }
814
- return acc
815
- }, [])
816
- },
817
- },
818
- created() {
819
- // Expand all items on creation
820
- if (this.hasStringsOrStorage) {
821
- this.expandedInverters = this.dataList.map((item) => item.inverterId)
822
- this.expandedMppts = this.dataList.flatMap((item) => {
823
- const availableMppts = this.availableMPPTData(item)
824
- return [
825
- ...item.mppts.map((mppt) => mppt.mpptId),
826
- ...(item.storageSystem
827
- ? [item.storageSystem.storage_system_id]
828
- : []),
829
- ...(availableMppts?.map((mppt) => mppt.mpptId) || []),
830
- ]
831
- })
832
- }
833
- },
834
- methods: {
835
- hasGroupedInverters(item) {
836
- return item.type != 'optimizer' && item.quantity > 1
837
- },
838
- isTargetRatioInRange(inverter) {
839
- const currentTargetRatio = inverter.getTargetRatio()
840
- return (
841
- this.inverterParameters.target_power_ratio - 20 <=
842
- 100 * currentTargetRatio &&
843
- this.inverterParameters.target_power_ratio + 20 >=
844
- 100 * currentTargetRatio
845
- )
846
- },
847
- getNumberPrecision(value) {
848
- if (typeof value === 'string') {
849
- value = Number(value)
850
- }
851
- if (value < 10) {
852
- return 2
853
- } else if (value >= 10 && value < 100) {
854
- return 1
855
- } else {
856
- return 0
857
- }
858
- },
859
- getNumberOfMpptModules(strings) {
860
- return strings.reduce((acc, curr) => acc + curr.modules.length, 0)
861
- },
862
- availableMPPTData(item) {
863
- if (item.type === 'optimizer' || item.type === 'storage') {
864
- return []
865
- }
866
- const existingTrackerNumbers = item.mppts.map(
867
- (mppt) => mppt.trackerNumber
868
- )
869
- const filteredAvailableMPPTs = item.availableMPPTs.filter(
870
- (mppt) => !existingTrackerNumbers.includes(mppt.tracker_number)
871
- )
872
-
873
- let mpptData = []
874
- filteredAvailableMPPTs.forEach((mppt) => {
875
- mpptData.push({
876
- mpptId:
877
- 'available_mppt_' +
878
- item.companyComponentLibraryId +
879
- '_' +
880
- mppt.tracker_number,
881
- numberOfTerminals: mppt.number_of_terminals,
882
- name:
883
- 'MPPT ' +
884
- (item.mppts.length + filteredAvailableMPPTs.indexOf(mppt) + 1),
885
- })
886
- })
887
- return mpptData
888
- },
889
- isExpanded(id) {
890
- return this.expandedInverters.includes(id)
891
- },
892
- isMpptExpanded(id) {
893
- return this.expandedMppts.includes(id)
894
- },
895
- toggleSection(id) {
896
- const index = this.expandedInverters.indexOf(id)
897
- if (index === -1) {
898
- this.expandedInverters.push(id)
899
- } else {
900
- this.expandedInverters.splice(index, 1)
901
- }
902
- },
903
- toggleMppt(id) {
904
- const index = this.expandedMppts.indexOf(id)
905
- if (index === -1) {
906
- this.expandedMppts.push(id)
907
- } else {
908
- this.expandedMppts.splice(index, 1)
909
- }
910
- },
911
- toggleAllSections() {
912
- if (this.hasExpandedSection) {
913
- this.expandedInverters = []
914
- this.expandedMppts = []
915
- } else {
916
- this.expandedInverters = this.dataList.map((item) => item.inverterId)
917
- this.expandedMppts = this.dataList.flatMap((item) => {
918
- const hasStrings = !!item.getStrings().length
919
- return [
920
- ...(hasStrings ? item.mppts.map((mppt) => mppt.mpptId) : []),
921
- ...(item.storageSystem
922
- ? [item.storageSystem.storage_system_id]
923
- : []),
924
- ]
925
- })
926
- }
927
- },
928
- isItemCollapsible(item) {
929
- return (
930
- item.mppts.some((mppt) => mppt.strings.length > 0) ||
931
- (item.storageSystem && Object.keys(item.storageSystem).length > 0) ||
932
- item.availableMPPTs.length
933
- )
934
- },
935
- itemHasStrings(item) {
936
- return item.mppts.some((mppt) => mppt.strings.length > 0)
937
- },
938
- getTypeName(type) {
939
- const value = type.toLowerCase()
940
- switch (value) {
941
- case 'pv':
942
- return this.$gettext('PV')
943
- case 'pv_storage':
944
- return this.$gettext('hybrid')
945
- case 'storage':
946
- return this.$gettext('battery')
947
- case 'optimizer':
948
- return this.$gettext('inverter_type_optimizer')
949
- default:
950
- return this.$gettext('PV')
951
- }
952
- },
953
- getIconName(item) {
954
- const value =
955
- item.type === 'pv_storage'
956
- ? item.iconName.technology_choice
957
- : item.type
958
- switch (value) {
959
- case 'photovoltaics':
960
- return 'pv'
961
- case 'pv':
962
- return 'pv'
963
- case 'storage':
964
- return 'battery'
965
- case 'battery':
966
- return 'battery'
967
- case 'optimizer':
968
- return 'optimizer'
969
- default:
970
- return 'pv'
971
- }
972
- },
973
- handleMoveClick(direction, index, item) {
974
- this.$emit('on-move', {
975
- direction: direction,
976
- index: index,
977
- item: item,
978
- isExpanded: this.hasExpandedSection,
979
- })
980
- },
981
- },
982
- }
983
- </script>
1
+ <template>
2
+ <PageContainer>
3
+ <PageTitleContainer data-id="string_design_expand_collapse_section">
4
+ <SectionTitleText>{{ $gettext('inverters') }}</SectionTitleText>
5
+ <ButtonIcon
6
+ custom-color="black"
7
+ :icon-name="hasExpandedSection ? 'collapse_all' : 'expand_all'"
8
+ :text="$gettext(hasExpandedSection ? 'collapse_all' : 'expand_all')"
9
+ @click="toggleAllSections"
10
+ />
11
+ </PageTitleContainer>
12
+ <SectionContainer
13
+ v-for="(item, index) in dataListToDisplay"
14
+ :key="item.inverterId"
15
+ >
16
+ <TopContainer>
17
+ <LeftContainer>
18
+ <TitleContainer>
19
+ <IconWrapper
20
+ v-if="item.type != 'optimizer'"
21
+ size="32px"
22
+ @click="toggleSection(item.inverterId)"
23
+ >
24
+ <RCIcon
25
+ v-if="isItemCollapsible(item)"
26
+ color="white"
27
+ :name="isExpanded(item.inverterId) ? 'arrow_up' : 'arrow_down'"
28
+ size="10px"
29
+ />
30
+ <IconPlaceholder v-else />
31
+ </IconWrapper>
32
+ <TextContainer
33
+ :style="{ marginLeft: item.type == 'optimizer' ? '32px' : '0' }"
34
+ >
35
+ <TitleText :title="item.model">
36
+ {{
37
+ (item.type === 'optimizer' || !hasExpandedSection) &&
38
+ item.quantity
39
+ ? item.quantity + ' x'
40
+ : ''
41
+ }}
42
+ {{ item.model }}
43
+ </TitleText>
44
+ <TitleSubText>
45
+ <span>{{ item.brandName }}</span>
46
+ <template
47
+ v-if="itemHasStrings(item) || item.type === 'optimizer'"
48
+ >
49
+ <ContainerValue
50
+ v-if="
51
+ item.getkWp() > 1 &&
52
+ item.type !== 'optimizer' &&
53
+ hasExpandedSection
54
+ "
55
+ >
56
+ |
57
+ {{
58
+ numberToString({
59
+ value: item.getkWp(),
60
+ numberPrecision: 2,
61
+ })
62
+ }}
63
+ kWp
64
+ </ContainerValue>
65
+ <ContainerValue
66
+ v-else-if="item.type !== 'optimizer' && hasExpandedSection"
67
+ >
68
+ |
69
+ {{
70
+ numberToString({
71
+ value: 1000 * item.getkWp(),
72
+ numberPrecision: 2,
73
+ minDecimals: 2,
74
+ })
75
+ }}
76
+ Wp
77
+ </ContainerValue>
78
+ </template>
79
+ </TitleSubText>
80
+ </TextContainer>
81
+ </TitleContainer>
82
+ <MarkersContainer>
83
+ <MarkerItem
84
+ v-if="item.mppts.length && hasExpandedSection"
85
+ :background-color="isTargetRatioInRange(item) ? 'green' : 'red'"
86
+ >{{
87
+ numberToString({
88
+ value: 100 * item.getTargetRatio(),
89
+ numberPrecision: 0,
90
+ minDecimals: 0,
91
+ })
92
+ }}%
93
+ </MarkerItem>
94
+ <MarkerItem v-if="item.hasTemplate && !item.isLoading">
95
+ <span
96
+ :title="
97
+ item.companyProductTemplateName
98
+ ? item.companyProductTemplateName
99
+ : $gettext('no_template_selected')
100
+ "
101
+ >
102
+ {{
103
+ item.companyProductTemplateName
104
+ ? item.companyProductTemplateName
105
+ : $gettext('no_template_selected')
106
+ }}
107
+ </span>
108
+ </MarkerItem>
109
+ <MarkerItem>
110
+ <RCIcon color="white" :name="getIconName(item)" size="14px" />
111
+ <MarkerText :title="getTypeName(item.type)">
112
+ {{ getTypeName(item.type) }}
113
+ </MarkerText>
114
+ </MarkerItem>
115
+ <MarkerItem
116
+ v-if="item.type !== 'optimizer' && item.type !== 'storage'"
117
+ :title="$gettext('AC power is the nominal AC output power.')"
118
+ >
119
+ {{
120
+ numberToString({
121
+ value: item.pacKw,
122
+ numberPrecision: getNumberPrecision(item.pacKw),
123
+ minDecimals: 0,
124
+ })
125
+ }}
126
+ {{ $gettext('kWAC') }}
127
+ </MarkerItem>
128
+ <MarkerItem
129
+ v-if="
130
+ (!itemHasStrings(item) || !hasExpandedSection) &&
131
+ item.type !== 'storage'
132
+ "
133
+ :title="$gettext('The DC power is the maximum DC input power.')"
134
+ >
135
+ {{
136
+ numberToString({
137
+ value: item.inputMaxPowerKw,
138
+ numberPrecision: getNumberPrecision(item.inputMaxPowerKw),
139
+ minDecimals: 0,
140
+ })
141
+ }}
142
+ {{ $gettext('kWDC') }}
143
+ </MarkerItem>
144
+ <MarkerItem
145
+ v-if="item.type == 'storage'"
146
+ :title="$gettext('charging_ac_power_kva_marker_title')"
147
+ >
148
+ {{
149
+ numberToString({
150
+ value: item.chargingAcPowerKva,
151
+ numberPrecision: getNumberPrecision(item.chargingAcPowerKva),
152
+ minDecimals: 0,
153
+ })
154
+ }}
155
+ {{ $gettext('kWAC') }}
156
+ </MarkerItem>
157
+ </MarkersContainer>
158
+ <IconsContainer>
159
+ <IconWrapper
160
+ v-if="nonOptimizerInverterCount > 1 || item.type === 'optimizer'"
161
+ @click="
162
+ !item.isLoading && hasGroupedInverters(item)
163
+ ? $emit('on-delete-grouped', item)
164
+ : $emit('on-delete', item)
165
+ "
166
+ >
167
+ <RCIcon
168
+ :color="item.isLoading ? 'grey' : 'red'"
169
+ :cursor="item.isLoading ? 'not-allowed' : 'pointer'"
170
+ :is-disabled="item.isLoading"
171
+ name="delete"
172
+ size="14px"
173
+ />
174
+ </IconWrapper>
175
+ <IconWrapper @click="!item.isLoading && $emit('on-edit', item)">
176
+ <RCIcon
177
+ :color="item.isLoading ? 'grey' : 'white'"
178
+ :cursor="item.isLoading ? 'not-allowed' : 'pointer'"
179
+ :is-disabled="item.isLoading"
180
+ name="edit_button"
181
+ size="14px"
182
+ />
183
+ </IconWrapper>
184
+ <IconWrapper @click="$emit('on-datasheet', item)">
185
+ <RCIcon
186
+ color="white"
187
+ cursor="pointer"
188
+ name="document"
189
+ size="14px"
190
+ />
191
+ </IconWrapper>
192
+ </IconsContainer>
193
+ </LeftContainer>
194
+ <SortingContainer v-if="dataListToDisplay.length > 1">
195
+ <SortingIconWrapper
196
+ :data-test-id="'move_up_' + index"
197
+ :is-disabled="index === 0"
198
+ @click="index > 0 && handleMoveClick('up', index, item)"
199
+ >
200
+ <RCIcon
201
+ :color="index === 0 ? 'grey6' : 'grey3'"
202
+ :cursor="index === 0 ? 'not-allowed' : 'pointer'"
203
+ name="move_up"
204
+ size="14px"
205
+ />
206
+ </SortingIconWrapper>
207
+ <SortingIconWrapper
208
+ :data-test-id="'move_down_' + index"
209
+ :is-disabled="index === dataListToDisplay.length - 1"
210
+ @click="
211
+ index < dataListToDisplay.length - 1 &&
212
+ handleMoveClick('down', index, item)
213
+ "
214
+ >
215
+ <RCIcon
216
+ :color="
217
+ index === dataListToDisplay.length - 1 ? 'grey6' : 'grey3'
218
+ "
219
+ :cursor="
220
+ index === dataListToDisplay.length - 1
221
+ ? 'not-allowed'
222
+ : 'pointer'
223
+ "
224
+ :is-disabled="index === dataListToDisplay.length - 1"
225
+ name="move_down"
226
+ size="14px"
227
+ />
228
+ </SortingIconWrapper>
229
+ </SortingContainer>
230
+ </TopContainer>
231
+ <BoxContainer
232
+ v-for="mppt in item.mppts"
233
+ v-show="isExpanded(item.inverterId)"
234
+ :key="mppt.mpptId"
235
+ >
236
+ <BoxTitleWrapper>
237
+ <IconWrapper
238
+ v-if="itemHasStrings(item)"
239
+ margin-left="4px"
240
+ size="8px"
241
+ @click="toggleMppt(mppt.mpptId)"
242
+ >
243
+ <RCIcon
244
+ color="white"
245
+ cursor="pointer"
246
+ :name="isMpptExpanded(mppt.mpptId) ? 'arrow_up' : 'arrow_down'"
247
+ size="10px"
248
+ />
249
+ </IconWrapper>
250
+ <BoxTitleText>{{ mppt.name }}</BoxTitleText>
251
+ <BoxIconsContainer>
252
+ <BoxIconWrapper>
253
+ <RCIcon
254
+ color="white"
255
+ cursor="pointer"
256
+ name="string_design"
257
+ size="11px"
258
+ />
259
+ <div>
260
+ {{ mppt.strings.length }}/{{ mppt.getNumberOfTerminals() }}
261
+ </div>
262
+ </BoxIconWrapper>
263
+ <BoxIconWrapper>
264
+ <RCIcon
265
+ color="white"
266
+ cursor="pointer"
267
+ name="panels_tool"
268
+ size="11px"
269
+ />
270
+ <div>{{ getNumberOfMpptModules(mppt.strings) }}</div>
271
+ </BoxIconWrapper>
272
+ </BoxIconsContainer>
273
+ </BoxTitleWrapper>
274
+
275
+ <div v-show="isMpptExpanded(mppt.mpptId) && itemHasStrings(item)">
276
+ <StringBox v-for="string in mppt.strings" :key="string.id">
277
+ <StringColorContainer :background-color="string.color" />
278
+ <StringContainer>
279
+ <div>{{ string.name }}</div>
280
+ <StringIconContainer>
281
+ <div>{{ string.modules.length }}</div>
282
+ <RCIcon color="white" name="module" size="14px" />
283
+ </StringIconContainer>
284
+ </StringContainer>
285
+ </StringBox>
286
+ </div>
287
+ </BoxContainer>
288
+ <template v-if="availableMPPTData(item)">
289
+ <BoxContainer
290
+ v-for="availableItem in availableMPPTData(item)"
291
+ v-show="isExpanded(item.inverterId)"
292
+ :key="availableItem.mpptId"
293
+ >
294
+ <BoxTitleWrapper>
295
+ <IconWrapper
296
+ v-if="itemHasStrings(item)"
297
+ margin-left="4px"
298
+ size="8px"
299
+ @click="toggleMppt(availableItem.mpptId)"
300
+ >
301
+ <RCIcon
302
+ color="white"
303
+ cursor="pointer"
304
+ :name="
305
+ isMpptExpanded(availableItem.mpptId)
306
+ ? 'arrow_up'
307
+ : 'arrow_down'
308
+ "
309
+ size="10px"
310
+ />
311
+ </IconWrapper>
312
+ <BoxTitleText>{{ availableItem.name }}</BoxTitleText>
313
+ <BoxIconsContainer>
314
+ <BoxIconWrapper>
315
+ <RCIcon
316
+ color="white"
317
+ cursor="pointer"
318
+ name="string_design"
319
+ size="11px"
320
+ />
321
+ <div>0/{{ availableItem.numberOfTerminals }}</div>
322
+ </BoxIconWrapper>
323
+ <BoxIconWrapper>
324
+ <RCIcon
325
+ color="white"
326
+ cursor="pointer"
327
+ name="panels_tool"
328
+ size="11px"
329
+ />
330
+ <div>0</div>
331
+ </BoxIconWrapper>
332
+ </BoxIconsContainer>
333
+ </BoxTitleWrapper>
334
+ <EmptyStringBox
335
+ v-show="
336
+ isMpptExpanded(availableItem.mpptId) && itemHasStrings(item)
337
+ "
338
+ />
339
+ </BoxContainer>
340
+ </template>
341
+ <BoxContainer
342
+ v-if="item.storageSystem && Object.keys(item.storageSystem).length > 0"
343
+ v-show="isExpanded(item.inverterId)"
344
+ :key="item.storageSystem.storage_system_id"
345
+ >
346
+ <BoxTitleWrapper>
347
+ <IconWrapper
348
+ margin-left="4px"
349
+ size="8px"
350
+ @click="toggleMppt(item.storageSystem.storage_system_id)"
351
+ >
352
+ <RCIcon
353
+ color="white"
354
+ cursor="pointer"
355
+ :name="
356
+ isMpptExpanded(item.storageSystem.storage_system_id)
357
+ ? 'arrow_up'
358
+ : 'arrow_down'
359
+ "
360
+ size="10px"
361
+ />
362
+ </IconWrapper>
363
+ <BoxTitleText>{{ $gettext('battery') }}</BoxTitleText>
364
+ </BoxTitleWrapper>
365
+ <div v-show="isMpptExpanded(item.storageSystem.storage_system_id)">
366
+ <BatteryBox>
367
+ <RCIcon color="white" name="battery" size="14px" />
368
+ <BatteryDetailsContainer>
369
+ <BatteryType>{{ item.storageSystem.brand_name }}</BatteryType>
370
+ <BatteryModel>{{ item.storageSystem.model }}</BatteryModel>
371
+ </BatteryDetailsContainer>
372
+ <BatteryValue>
373
+ {{
374
+ numberToString({
375
+ value: item.storageSystem.nominal_capacity_kWh,
376
+ numberPrecision: 2,
377
+ minDecimals: 0,
378
+ })
379
+ }}
380
+ kWh
381
+ </BatteryValue>
382
+ </BatteryBox>
383
+ </div>
384
+ </BoxContainer>
385
+ </SectionContainer>
386
+ <DividerContainer v-if="batteryData.length" />
387
+ <UnassignedContainer v-if="batteryData.length">
388
+ <SectionTitleText>{{ $gettext('battery_information') }}</SectionTitleText>
389
+ <BatteryBox
390
+ v-for="battery in batteryData"
391
+ :key="battery.id"
392
+ :is-unassigned="true"
393
+ >
394
+ <RCIcon color="black" name="battery" size="14px" />
395
+ <BatteryDetailsContainer>
396
+ <UnassignedType>{{ battery.brand_name }}</UnassignedType>
397
+ <UnassignedModel>{{ battery.model }}</UnassignedModel>
398
+ </BatteryDetailsContainer>
399
+ <BatteryValue>
400
+ {{
401
+ numberToString({
402
+ value: battery.nominal_capacity_kWh,
403
+ numberPrecision: 2,
404
+ minDecimals: 0,
405
+ })
406
+ }}
407
+ kWh
408
+ </BatteryValue>
409
+ </BatteryBox>
410
+ </UnassignedContainer>
411
+ </PageContainer>
412
+ </template>
413
+
414
+ <script>
415
+ // import DropdownMenu from '@eturnity/eturnity_reusable_components/src/components/stringDesign/DropdownMenu'
416
+ import styled from 'vue3-styled-components'
417
+ import RCIcon from '../../icon'
418
+ import ButtonIcon from '../../buttons/buttonIcon'
419
+ import { numberToString } from '../../../helpers/numberConverter'
420
+
421
+ const PageContainer = styled.div`
422
+ position: relative;
423
+ `
424
+
425
+ const SectionContainer = styled.div`
426
+ &:not(:last-child) {
427
+ margin-bottom: 8px;
428
+ }
429
+ background-color: ${(props) => props.theme.colors.black};
430
+ padding: 8px;
431
+ border-radius: 4px;
432
+ color: ${(props) => props.theme.colors.white};
433
+ `
434
+
435
+ const TitleContainer = styled.div`
436
+ display: flex;
437
+ align-items: center;
438
+ gap: 4px;
439
+ `
440
+
441
+ const IconsContainer = styled.div`
442
+ display: flex;
443
+ align-items: center;
444
+ margin-left: 32px;
445
+ margin-top: 4px;
446
+ `
447
+
448
+ const TextContainer = styled.div`
449
+ display: grid;
450
+ `
451
+
452
+ const TitleText = styled.div`
453
+ font-size: 14px;
454
+ white-space: nowrap;
455
+ overflow: hidden;
456
+ text-overflow: ellipsis;
457
+ `
458
+
459
+ const TitleSubText = styled.div`
460
+ font-size: 12px;
461
+ display: flex;
462
+ gap: 4px;
463
+ `
464
+
465
+ const MarkersContainer = styled.div`
466
+ display: flex;
467
+ flex-wrap: wrap;
468
+ gap: 8px;
469
+ margin: 4px 0 2px 32px;
470
+ align-items: end;
471
+ `
472
+
473
+ const MarkerAttrs = { backgroundColor: String }
474
+ const MarkerItem = styled('div', MarkerAttrs)`
475
+ display: flex;
476
+ gap: 5px;
477
+ align-items: center;
478
+ padding: 2px 7px;
479
+ border-radius: 4px;
480
+ background-color: ${(props) =>
481
+ props.backgroundColor
482
+ ? props.theme.colors[props.backgroundColor]
483
+ : props.theme.colors.grey6};
484
+ font-size: 11px;
485
+ color: ${(props) => props.theme.colors.white};
486
+ & > span {
487
+ overflow: hidden;
488
+ white-space: nowrap;
489
+ text-overflow: ellipsis;
490
+ max-width: 11ch;
491
+ }
492
+ `
493
+
494
+ const MarkerText = styled.div`
495
+ max-width: 11ch;
496
+ white-space: nowrap;
497
+ overflow: hidden;
498
+ text-overflow: ellipsis;
499
+ `
500
+
501
+ const ContainerValue = styled.div`
502
+ font-size: 12px;
503
+ `
504
+
505
+ const IconAttrs = {
506
+ size: { type: String, default: '32px' },
507
+ marginLeft: String,
508
+ }
509
+ const IconWrapper = styled('div', IconAttrs)`
510
+ display: flex;
511
+ align-items: center;
512
+ justify-content: center;
513
+ border-radius: 4px;
514
+ cursor: pointer;
515
+ width: ${(props) => props.size};
516
+ height: ${(props) => props.size};
517
+ margin-left: ${(props) => props.marginLeft};
518
+ &:hover {
519
+ background: ${(props) =>
520
+ props.marginLeft ? 'transparent' : 'rgba(255, 255, 255, 0.1)'};
521
+ }
522
+
523
+ &:active {
524
+ background: rgba(255, 255, 255, 0.2);
525
+ }
526
+ `
527
+
528
+ const BoxContainer = styled.div`
529
+ border-radius: 4px;
530
+ background: ${(props) => props.theme.colors.grey6};
531
+ padding: 8px;
532
+ margin-top: 8px;
533
+ margin-left: 30px;
534
+ `
535
+
536
+ const BoxTitleWrapper = styled.div`
537
+ display: flex;
538
+ align-items: center;
539
+ gap: 8px;
540
+ `
541
+
542
+ const BoxTitleText = styled.div`
543
+ font-size: 13px;
544
+ `
545
+
546
+ const BoxIconsContainer = styled.div`
547
+ display: flex;
548
+ gap: 8px;
549
+ align-items: center;
550
+ margin-left: auto;
551
+ font-size: 11px;
552
+ `
553
+
554
+ const BoxIconWrapper = styled.div`
555
+ display: flex;
556
+ align-items: center;
557
+ justify-content: center;
558
+ gap: 4px;
559
+ padding: 4px;
560
+ `
561
+
562
+ const StringBox = styled.div`
563
+ display: grid;
564
+ grid-template-columns: auto 1fr;
565
+ margin-top: 8px;
566
+ border-radius: 4px;
567
+ border: 1px solid ${(props) => props.theme.colors.grey3};
568
+ `
569
+
570
+ const StringContainer = styled.div`
571
+ display: flex;
572
+ justify-content: space-between;
573
+ gap: 8px;
574
+ padding: 8px;
575
+ font-size: 11px;
576
+ `
577
+
578
+ const StringColorAttrs = { backgroundColor: String }
579
+ const StringColorContainer = styled('div', StringColorAttrs)`
580
+ background-color: ${(props) => props.backgroundColor};
581
+ width: 22px;
582
+ min-height: 100%;
583
+ border-top-left-radius: 2px;
584
+ border-bottom-left-radius: 2px;
585
+ `
586
+
587
+ const StringIconContainer = styled.div`
588
+ display: flex;
589
+ align-items: center;
590
+ justify-content: center;
591
+ gap: 2px;
592
+ padding: 0 4px;
593
+ `
594
+
595
+ const PageTitleContainer = styled.div`
596
+ position: sticky;
597
+ top: 0;
598
+ background-color: ${(props) => props.theme.colors.black};
599
+ z-index: 99;
600
+ padding: 8px;
601
+ display: flex;
602
+ justify-content: space-between;
603
+ align-items: center;
604
+ padding-bottom: 8px;
605
+ `
606
+
607
+ const SectionTitleText = styled.div`
608
+ font-size: 14px;
609
+ font-weight: 700;
610
+ color: ${(props) => props.theme.colors.white};
611
+ `
612
+
613
+ const BatteryBoxAttrs = { isUnassigned: Boolean }
614
+ const BatteryBox = styled('div', BatteryBoxAttrs)`
615
+ display: flex;
616
+ align-items: center;
617
+ gap: 8px;
618
+ border: 1px solid ${(props) => props.theme.colors.white};
619
+ border-radius: 4px;
620
+ padding: 8px;
621
+ margin-top: 8px;
622
+ background-color: ${(props) =>
623
+ props.isUnassigned ? props.theme.colors.grey2 : ''};
624
+ `
625
+
626
+ const BatteryDetailsContainer = styled.div`
627
+ display: flex;
628
+ flex-direction: column;
629
+ gap: 4px;
630
+ `
631
+
632
+ const BatteryType = styled.div`
633
+ font-size: 11px;
634
+ `
635
+
636
+ const BatteryModel = styled.div`
637
+ font-size: 10px;
638
+ `
639
+
640
+ const BatteryValue = styled.div`
641
+ font-size: 10px;
642
+ align-self: flex-end;
643
+ margin-left: auto;
644
+ `
645
+ const TopContainer = styled.div`
646
+ display: flex;
647
+ justify-content: space-between;
648
+ `
649
+
650
+ const LeftContainer = styled.div``
651
+
652
+ const SortingContainer = styled.div`
653
+ display: flex;
654
+ flex-direction: column;
655
+ align-items: center;
656
+ `
657
+
658
+ const SortingIconWrapperAttrs = { isDisabled: Boolean }
659
+ const SortingIconWrapper = styled('div', SortingIconWrapperAttrs)`
660
+ cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
661
+ width: 30px;
662
+ height: 30px;
663
+ display: flex;
664
+ align-items: center;
665
+ justify-content: center;
666
+
667
+ &:hover {
668
+ background-color: ${(props) =>
669
+ props.isDisabled ? 'transparent' : 'rgba(255, 255, 255, 0.1)'};
670
+ border-radius: 4px;
671
+ }
672
+ `
673
+
674
+ const UnassignedContainer = styled.div`
675
+ margin-top: 8px;
676
+ `
677
+
678
+ const DividerContainer = styled.div`
679
+ height: 0.5px;
680
+ width: 100%;
681
+ background-color: ${(props) => props.theme.colors.grey4};
682
+ opacity: 0.6;
683
+ `
684
+
685
+ const UnassignedType = styled.div`
686
+ font-size: 12px;
687
+ line-height: 150%;
688
+ `
689
+
690
+ const UnassignedModel = styled.div`
691
+ font-size: 10px;
692
+ line-height: 150%;
693
+ `
694
+
695
+ const IconPlaceholder = styled.div`
696
+ width: 32px;
697
+ `
698
+
699
+ const EmptyStringBox = styled.div`
700
+ border: 0.8px dashed ${(props) => props.theme.colors.black};
701
+ border-radius: 4px;
702
+ padding: 8px 8px 8px 0;
703
+ height: 32px;
704
+ width: 233px;
705
+ margin-top: 8px;
706
+ `
707
+
708
+ export default {
709
+ name: 'DropdownMenu',
710
+ components: {
711
+ SectionContainer,
712
+ TitleContainer,
713
+ IconsContainer,
714
+ TextContainer,
715
+ TitleText,
716
+ TitleSubText,
717
+ RCIcon,
718
+ MarkersContainer,
719
+ MarkerItem,
720
+ ContainerValue,
721
+ IconWrapper,
722
+ BoxContainer,
723
+ BoxTitleWrapper,
724
+ BoxTitleText,
725
+ BoxIconsContainer,
726
+ BoxIconWrapper,
727
+ StringBox,
728
+ StringContainer,
729
+ StringColorContainer,
730
+ StringIconContainer,
731
+ PageTitleContainer,
732
+ SectionTitleText,
733
+ ButtonIcon,
734
+ PageContainer,
735
+ BatteryBox,
736
+ BatteryDetailsContainer,
737
+ BatteryType,
738
+ BatteryModel,
739
+ BatteryValue,
740
+ TopContainer,
741
+ LeftContainer,
742
+ SortingContainer,
743
+ SortingIconWrapper,
744
+ UnassignedContainer,
745
+ DividerContainer,
746
+ UnassignedType,
747
+ UnassignedModel,
748
+ IconPlaceholder,
749
+ EmptyStringBox,
750
+ MarkerText,
751
+ },
752
+ props: {
753
+ dataList: {
754
+ required: true,
755
+ type: Array,
756
+ },
757
+ batteryData: {
758
+ required: true,
759
+ type: Array,
760
+ },
761
+ inverterParameters: {
762
+ required: true,
763
+ type: Object,
764
+ },
765
+ isPvAndBatteryActive: {
766
+ required: false,
767
+ type: Boolean,
768
+ },
769
+ },
770
+ emits: ['on-edit', 'on-move', 'on-delete', 'on-delete-grouped'],
771
+ data() {
772
+ return {
773
+ expandedInverters: [],
774
+ expandedMppts: [],
775
+ numberToString,
776
+ }
777
+ },
778
+ computed: {
779
+ dataListToDisplay() {
780
+ let data = this.hasExpandedSection
781
+ ? this.dataList
782
+ : this.compressedDataList
783
+ return data.sort((a, b) => a.lineNr - b.lineNr)
784
+ },
785
+ hasExpandedSection() {
786
+ return this.expandedInverters.length > 0
787
+ },
788
+ hasStringsOrStorage() {
789
+ return this.dataList.some((item) => {
790
+ return (
791
+ item.mppts.some((mppt) => mppt.strings.length > 0) ||
792
+ (item.storageSystem && Object.keys(item.storageSystem).length > 0)
793
+ )
794
+ })
795
+ },
796
+ nonOptimizerInverterCount() {
797
+ return this.dataList.filter((item) => item.type !== 'optimizer').length
798
+ },
799
+ compressedDataList() {
800
+ return this.dataList.reduce((acc, item) => {
801
+ if (item.type == 'optimizer') {
802
+ acc.push(item)
803
+ return acc
804
+ }
805
+ const existingInverter = acc.find((inverter) => {
806
+ return inverter.componentId == item.componentId
807
+ })
808
+ if (!existingInverter) {
809
+ acc.push(item)
810
+ item.quantity = 1
811
+ } else {
812
+ existingInverter.quantity++
813
+ }
814
+ return acc
815
+ }, [])
816
+ },
817
+ },
818
+ created() {
819
+ // Expand all items on creation
820
+ if (this.hasStringsOrStorage) {
821
+ this.expandedInverters = this.dataList.map((item) => item.inverterId)
822
+ this.expandedMppts = this.dataList.flatMap((item) => {
823
+ const availableMppts = this.availableMPPTData(item)
824
+ return [
825
+ ...item.mppts.map((mppt) => mppt.mpptId),
826
+ ...(item.storageSystem
827
+ ? [item.storageSystem.storage_system_id]
828
+ : []),
829
+ ...(availableMppts?.map((mppt) => mppt.mpptId) || []),
830
+ ]
831
+ })
832
+ }
833
+ },
834
+ methods: {
835
+ hasGroupedInverters(item) {
836
+ return item.type != 'optimizer' && item.quantity > 1
837
+ },
838
+ isTargetRatioInRange(inverter) {
839
+ const currentTargetRatio = inverter.getTargetRatio()
840
+ return (
841
+ this.inverterParameters.target_power_ratio - 20 <=
842
+ 100 * currentTargetRatio &&
843
+ this.inverterParameters.target_power_ratio + 20 >=
844
+ 100 * currentTargetRatio
845
+ )
846
+ },
847
+ getNumberPrecision(value) {
848
+ if (typeof value === 'string') {
849
+ value = Number(value)
850
+ }
851
+ if (value < 10) {
852
+ return 2
853
+ } else if (value >= 10 && value < 100) {
854
+ return 1
855
+ } else {
856
+ return 0
857
+ }
858
+ },
859
+ getNumberOfMpptModules(strings) {
860
+ return strings.reduce((acc, curr) => acc + curr.modules.length, 0)
861
+ },
862
+ availableMPPTData(item) {
863
+ if (item.type === 'optimizer' || item.type === 'storage') {
864
+ return []
865
+ }
866
+ const existingTrackerNumbers = item.mppts.map(
867
+ (mppt) => mppt.trackerNumber
868
+ )
869
+ const filteredAvailableMPPTs = item.availableMPPTs.filter(
870
+ (mppt) => !existingTrackerNumbers.includes(mppt.tracker_number)
871
+ )
872
+
873
+ let mpptData = []
874
+ filteredAvailableMPPTs.forEach((mppt) => {
875
+ mpptData.push({
876
+ mpptId:
877
+ 'available_mppt_' +
878
+ item.companyComponentLibraryId +
879
+ '_' +
880
+ mppt.tracker_number,
881
+ numberOfTerminals: mppt.number_of_terminals,
882
+ name:
883
+ 'MPPT ' +
884
+ (item.mppts.length + filteredAvailableMPPTs.indexOf(mppt) + 1),
885
+ })
886
+ })
887
+ return mpptData
888
+ },
889
+ isExpanded(id) {
890
+ return this.expandedInverters.includes(id)
891
+ },
892
+ isMpptExpanded(id) {
893
+ return this.expandedMppts.includes(id)
894
+ },
895
+ toggleSection(id) {
896
+ const index = this.expandedInverters.indexOf(id)
897
+ if (index === -1) {
898
+ this.expandedInverters.push(id)
899
+ } else {
900
+ this.expandedInverters.splice(index, 1)
901
+ }
902
+ },
903
+ toggleMppt(id) {
904
+ const index = this.expandedMppts.indexOf(id)
905
+ if (index === -1) {
906
+ this.expandedMppts.push(id)
907
+ } else {
908
+ this.expandedMppts.splice(index, 1)
909
+ }
910
+ },
911
+ toggleAllSections() {
912
+ if (this.hasExpandedSection) {
913
+ this.expandedInverters = []
914
+ this.expandedMppts = []
915
+ } else {
916
+ this.expandedInverters = this.dataList.map((item) => item.inverterId)
917
+ this.expandedMppts = this.dataList.flatMap((item) => {
918
+ const hasStrings = !!item.getStrings().length
919
+ return [
920
+ ...(hasStrings ? item.mppts.map((mppt) => mppt.mpptId) : []),
921
+ ...(item.storageSystem
922
+ ? [item.storageSystem.storage_system_id]
923
+ : []),
924
+ ]
925
+ })
926
+ }
927
+ },
928
+ isItemCollapsible(item) {
929
+ return (
930
+ item.mppts.some((mppt) => mppt.strings.length > 0) ||
931
+ (item.storageSystem && Object.keys(item.storageSystem).length > 0) ||
932
+ item.availableMPPTs.length
933
+ )
934
+ },
935
+ itemHasStrings(item) {
936
+ return item.mppts.some((mppt) => mppt.strings.length > 0)
937
+ },
938
+ getTypeName(type) {
939
+ const value = type.toLowerCase()
940
+ switch (value) {
941
+ case 'pv':
942
+ return this.$gettext('PV')
943
+ case 'pv_storage':
944
+ return this.$gettext('hybrid')
945
+ case 'storage':
946
+ return this.$gettext('battery')
947
+ case 'optimizer':
948
+ return this.$gettext('inverter_type_optimizer')
949
+ default:
950
+ return this.$gettext('PV')
951
+ }
952
+ },
953
+ getIconName(item) {
954
+ const value =
955
+ item.type === 'pv_storage'
956
+ ? item.iconName.technology_choice
957
+ : item.type
958
+ switch (value) {
959
+ case 'photovoltaics':
960
+ return 'pv'
961
+ case 'pv':
962
+ return 'pv'
963
+ case 'storage':
964
+ return 'battery'
965
+ case 'battery':
966
+ return 'battery'
967
+ case 'optimizer':
968
+ return 'optimizer'
969
+ default:
970
+ return 'pv'
971
+ }
972
+ },
973
+ handleMoveClick(direction, index, item) {
974
+ this.$emit('on-move', {
975
+ direction: direction,
976
+ index: index,
977
+ item: item,
978
+ isExpanded: this.hasExpandedSection,
979
+ })
980
+ },
981
+ },
982
+ }
983
+ </script>