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