@eturnity/eturnity_reusable_components 8.13.3-EPDM-14657.2 → 8.13.3-EPDM-14657.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/package.json +1 -1
  2. package/src/TestChart.vue +29 -34
  3. package/src/assets/icons/collapse_arrow_icon_white.svg +1 -0
  4. package/src/assets/svgIcons/ac_power.svg +4 -0
  5. package/src/assets/svgIcons/arrow_long_left.svg +3 -0
  6. package/src/assets/svgIcons/arrow_long_right.svg +3 -0
  7. package/src/assets/svgIcons/chassis_ground_symbol.svg +27 -0
  8. package/src/assets/svgIcons/dc_power.svg +8 -0
  9. package/src/assets/svgIcons/double_arrow_long.svg +4 -0
  10. package/src/assets/svgIcons/ed_ac.svg +3 -0
  11. package/src/assets/svgIcons/ed_acgrid.svg +4 -0
  12. package/src/assets/svgIcons/ed_arrow_both.svg +7 -0
  13. package/src/assets/svgIcons/ed_arrow_left.svg +7 -0
  14. package/src/assets/svgIcons/ed_arrow_right.svg +7 -0
  15. package/src/assets/svgIcons/ed_battery.svg +10 -0
  16. package/src/assets/svgIcons/ed_batteryacinverter.svg +16 -0
  17. package/src/assets/svgIcons/ed_batteryintegratedinverter.svg +19 -0
  18. package/src/assets/svgIcons/ed_cirquitbreaker.svg +4 -0
  19. package/src/assets/svgIcons/ed_cirquitbreaker_magnetic.svg +6 -0
  20. package/src/assets/svgIcons/ed_cirquitbreaker_thermal.svg +4 -0
  21. package/src/assets/svgIcons/ed_cirquitbreaker_thermal_magnetic.svg +5 -0
  22. package/src/assets/svgIcons/ed_consumption.svg +3 -0
  23. package/src/assets/svgIcons/ed_dc.svg +6 -0
  24. package/src/assets/svgIcons/ed_disconnector.svg +4 -0
  25. package/src/assets/svgIcons/ed_disconnector_fuse.svg +4 -0
  26. package/src/assets/svgIcons/ed_disconnector_fuse_switch.svg +4 -0
  27. package/src/assets/svgIcons/ed_disconnector_loadbreak switch.svg +4 -0
  28. package/src/assets/svgIcons/ed_disconnector_switch.svg +4 -0
  29. package/src/assets/svgIcons/ed_disconnector_switch_auto_release.svg +5 -0
  30. package/src/assets/svgIcons/ed_energymanagement_rectangle.svg +3 -0
  31. package/src/assets/svgIcons/ed_evcharger.svg +19 -0
  32. package/src/assets/svgIcons/ed_flexiblecomponent_circle.svg +3 -0
  33. package/src/assets/svgIcons/ed_flexiblecomponent_square.svg +3 -0
  34. package/src/assets/svgIcons/ed_fuse.svg +3 -0
  35. package/src/assets/svgIcons/ed_ground.svg +5 -0
  36. package/src/assets/svgIcons/ed_heatpump.svg +4 -0
  37. package/src/assets/svgIcons/ed_icon_battery.svg +9 -0
  38. package/src/assets/svgIcons/ed_icon_circle.svg +3 -0
  39. package/src/assets/svgIcons/ed_icon_heatpump.svg +3 -0
  40. package/src/assets/svgIcons/ed_icon_inverter.svg +8 -0
  41. package/src/assets/svgIcons/ed_icon_optimizer.svg +11 -0
  42. package/src/assets/svgIcons/ed_integratedbatteryinverter.svg +10 -0
  43. package/src/assets/svgIcons/ed_inverter-blank.svg +3 -0
  44. package/src/assets/svgIcons/ed_mainsconnection.svg +3 -0
  45. package/src/assets/svgIcons/ed_meter_arrowleft.svg +4 -0
  46. package/src/assets/svgIcons/ed_meter_arrowright.svg +4 -0
  47. package/src/assets/svgIcons/ed_meter_bidirectional.svg +5 -0
  48. package/src/assets/svgIcons/ed_networkandsystemprotection_double.svg +14 -0
  49. package/src/assets/svgIcons/ed_networkandsystemprotection_single.svg +7 -0
  50. package/src/assets/svgIcons/ed_pvpanel.svg +7 -0
  51. package/src/assets/svgIcons/ed_rcd.svg +5 -0
  52. package/src/assets/svgIcons/ed_rcd_simple.svg +3 -0
  53. package/src/assets/svgIcons/ed_spd.svg +6 -0
  54. package/src/assets/svgIcons/ed_stringwithoptimizer.svg +33 -0
  55. package/src/assets/svgIcons/ed_stringwithoutoptimizer.svg +17 -0
  56. package/src/assets/svgIcons/ed_transformer.svg +3 -0
  57. package/src/assets/svgIcons/ground_symbol.svg +28 -0
  58. package/src/assets/svgIcons/house_sun.svg +3 -0
  59. package/src/assets/svgIcons/move_left.svg +3 -0
  60. package/src/assets/svgIcons/move_right.svg +3 -0
  61. package/src/assets/svgIcons/rectangle.svg +3 -0
  62. package/src/assets/svgIcons/text_icon.svg +3 -0
  63. package/src/assets/theme.js +1 -0
  64. package/src/components/banner/infoBanner/InfoBanner.spec.js +29 -42
  65. package/src/components/buttons/buttonIcon/index.vue +1 -1
  66. package/src/components/draggableCard/defaultProps.js +16 -0
  67. package/src/components/draggableCard/draggableCard.spec.js +99 -0
  68. package/src/components/draggableCard/draggableCard.stories.js +79 -0
  69. package/src/components/draggableCard/index.vue +363 -0
  70. package/src/components/errorMessage/errorMessage.spec.js +34 -0
  71. package/src/components/errorMessage/errorMessage.stories.js +35 -0
  72. package/src/components/filter/filterSettings.vue +2 -0
  73. package/src/components/icon/index.vue +18 -6
  74. package/src/components/infoText/index.vue +3 -3
  75. package/src/components/infoText/infoText.spec.js +6 -1
  76. package/src/components/inputs/checkbox/index.vue +2 -2
  77. package/src/components/inputs/select/index.vue +105 -18
  78. package/src/components/modals/actionModal/actionModal.spec.js +52 -0
  79. package/src/components/modals/actionModal/actionModal.stories.js +53 -0
  80. package/src/components/modals/actionModal/index.vue +6 -6
  81. package/src/components/modals/infoModal/index.vue +49 -19
  82. package/src/components/modals/infoModal/infoModal.spec.js +55 -0
  83. package/src/components/modals/infoModal/infoModal.stories.js +47 -0
  84. package/src/components/modals/modal/index.vue +21 -6
  85. package/src/components/pageSubtitle/PageSubtitle.stories.js +0 -1
  86. package/src/components/pageTitle/index.vue +3 -4
  87. package/src/components/spinner/index.vue +2 -2
  88. package/src/components/spinnerGif/index.vue +3 -3
  89. package/src/components/tableDropdown/index.vue +17 -9
  90. package/src/components/tables/mainTable/index.vue +4 -2
  91. package/src/helpers/dateTimeFormatting.js +51 -0
  92. package/src/main.js +0 -7
  93. package/src/router/dynamicRoutes.js +0 -12
  94. package/src/DemoCharts.vue +0 -424
@@ -0,0 +1,33 @@
1
+ <svg width="606" height="80" viewBox="0 0 606 80" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M176.756 10.2559L200.171 10.2559V9.25586H176.756V10.2559Z" fill="black"/>
3
+ <path d="M176.756 17.0851H181.634V16.0851H176.756V17.0851Z" fill="black"/>
4
+ <path d="M200.171 17.085H195.293V16.085H200.171V17.085Z" fill="black"/>
5
+ <path d="M185.537 17.085H191.391V16.085H185.537V17.085Z" fill="black"/>
6
+ <path d="M237.243 63.915H213.828V62.915H237.243V63.915Z" fill="black"/>
7
+ <path d="M218.706 70.7443H213.828V69.7443H218.706V70.7443Z" fill="black"/>
8
+ <path d="M232.365 70.7441H237.243V69.7441H232.365V70.7441Z" fill="black"/>
9
+ <path d="M228.463 70.7441H222.609V69.7441H228.463V70.7441Z" fill="black"/>
10
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M0 0V80H247V40.5H249V39.5H247V0H0ZM1 79V1H167L116 40.0244L167 79H1ZM245.294 1L168 78.2938V1H245.294ZM168.708 79H246V1.70804L168.708 79Z" fill="black"/>
11
+ <path d="M559.17 10.2559L535.756 10.2559V9.25586H559.17V10.2559Z" fill="black"/>
12
+ <path d="M540.634 17.0851H535.756V16.0851H540.634V17.0851Z" fill="black"/>
13
+ <path d="M554.293 17.085H559.171V16.085H554.293V17.085Z" fill="black"/>
14
+ <path d="M550.391 17.085H544.537V16.085H550.391V17.085Z" fill="black"/>
15
+ <path d="M572.828 63.915H596.243V62.915H572.828V63.915Z" fill="black"/>
16
+ <path d="M572.828 70.7443H577.706V69.7443H572.828V70.7443Z" fill="black"/>
17
+ <path d="M596.243 70.7441H591.365V69.7441H596.243V70.7441Z" fill="black"/>
18
+ <path d="M581.609 70.7441H587.463V69.7441H581.609V70.7441Z" fill="black"/>
19
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M359 80V40.5H357V39.5H359V0H606V80H359ZM360 79V1H526L475 40.0244L526 79H360ZM527 78.2938L604.294 1H527V78.2938ZM605 79H527.708L605 1.70804V79Z" fill="black"/>
20
+ <path d="M253 40.5H257V39.5H253V40.5Z" fill="black"/>
21
+ <path d="M261 40.5H265V39.5H261V40.5Z" fill="black"/>
22
+ <path d="M269 40.5H273V39.5H269V40.5Z" fill="black"/>
23
+ <path d="M277 40.5H281V39.5H277V40.5Z" fill="black"/>
24
+ <path d="M285 40.5H289V39.5H285V40.5Z" fill="black"/>
25
+ <path d="M293 40.5H297V39.5H293V40.5Z" fill="black"/>
26
+ <path d="M301 40.5H305V39.5H301V40.5Z" fill="black"/>
27
+ <path d="M309 40.5H313V39.5H309V40.5Z" fill="black"/>
28
+ <path d="M317 40.5H321V39.5H317V40.5Z" fill="black"/>
29
+ <path d="M325 40.5H329V39.5H325V40.5Z" fill="black"/>
30
+ <path d="M333 40.5H337V39.5H333V40.5Z" fill="black"/>
31
+ <path d="M341 40.5H345V39.5H341V40.5Z" fill="black"/>
32
+ <path d="M349 40.5H353V39.5H349V40.5Z" fill="black"/>
33
+ </svg>
@@ -0,0 +1,17 @@
1
+ <svg width="448" height="80" viewBox="0 0 448 80" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M0 0V80H168V40.5H170V39.5H168V0H0ZM1 79V1H166.9L116.025 40.001L166.897 79H1ZM166.93 79H167V1H166.93V79Z" fill="black"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M280 0V39.5H278V40.5H280V80H448V0H280ZM281 79V1H446.9L396.025 40.001L446.897 79H281ZM446.93 79H447V1H446.93V79Z" fill="black"/>
4
+ <path d="M174 40.5H178V39.5H174V40.5Z" fill="black"/>
5
+ <path d="M182 40.5H186V39.5H182V40.5Z" fill="black"/>
6
+ <path d="M190 40.5H194V39.5H190V40.5Z" fill="black"/>
7
+ <path d="M198 40.5H202V39.5H198V40.5Z" fill="black"/>
8
+ <path d="M206 40.5H210V39.5H206V40.5Z" fill="black"/>
9
+ <path d="M214 40.5H218V39.5H214V40.5Z" fill="black"/>
10
+ <path d="M222 40.5H226V39.5H222V40.5Z" fill="black"/>
11
+ <path d="M230 40.5H234V39.5H230V40.5Z" fill="black"/>
12
+ <path d="M238 40.5H242V39.5H238V40.5Z" fill="black"/>
13
+ <path d="M246 40.5H250V39.5H246V40.5Z" fill="black"/>
14
+ <path d="M254 40.5H258V39.5H254V40.5Z" fill="black"/>
15
+ <path d="M262 40.5H266V39.5H262V40.5Z" fill="black"/>
16
+ <path d="M270 40.5H274V39.5H270V40.5Z" fill="black"/>
17
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="174" height="45" viewBox="0 0 174 45" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M51.5223 21.5H0.5V22.5H51.5C51.5 34.6461 61.3539 44.5 73.5 44.5C78.3624 44.5 82.8574 42.9208 86.5 40.2476C90.1426 42.9208 94.6376 44.5 99.5 44.5C111.646 44.5 121.5 34.6461 121.5 22.5H173.5V21.5H121.478C120.954 9.81759 111.311 0.5 99.5 0.5C94.6376 0.5 90.1426 2.07918 86.5 4.75242C82.8574 2.07918 78.3624 0.5 73.5 0.5C61.689 0.5 52.0455 9.81759 51.5223 21.5ZM52.5 22.5C52.5 10.9061 61.9061 1.5 73.5 1.5C78.0373 1.5 82.2395 2.9406 85.674 5.38916C80.6886 9.42308 77.5 15.5907 77.5 22.5C77.5 29.4093 80.6886 35.5769 85.674 39.6108C82.2395 42.0594 78.0373 43.5 73.5 43.5C61.9061 43.5 52.5 34.0939 52.5 22.5ZM99.5 1.5C111.094 1.5 120.5 10.9061 120.5 22.5C120.5 34.0939 111.094 43.5 99.5 43.5C94.9627 43.5 90.7605 42.0594 87.326 39.6108C92.3114 35.5769 95.5 29.4093 95.5 22.5C95.5 15.5907 92.3114 9.42308 87.326 5.38916C90.7605 2.94061 94.9627 1.5 99.5 1.5ZM86.5 6.00912C91.3719 9.85562 94.5 15.814 94.5 22.5C94.5 29.186 91.3719 35.1444 86.5 38.9909C81.6281 35.1444 78.5 29.186 78.5 22.5C78.5 15.814 81.6281 9.85562 86.5 6.00912Z" fill="black"/>
3
+ </svg>
@@ -0,0 +1,28 @@
1
+ <svg
2
+ width="50"
3
+ height="50"
4
+ viewBox="0 0 25 50"
5
+ fill='white'
6
+ >
7
+ <defs
8
+ id="defs4" />
9
+ <g
10
+ id="layer1">
11
+ <path
12
+ d="M 0.5,24.5 L 24.5,24.5"
13
+ style="fill:lime;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
14
+ id="path4098" />
15
+ <path
16
+ d="M 4.5,27.5 L 20.5,27.5"
17
+ style="fill:lime;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
18
+ id="path4100" />
19
+ <path
20
+ d="M 16.5,30.5 L 8.5,30.5"
21
+ style="fill:lime;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
22
+ id="path4102" />
23
+ <path
24
+ d="M 12.5,24.5 L 12.5,4.5"
25
+ style="fill:lime;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
26
+ id="path4104" />
27
+ </g>
28
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M8 0.5C8.27614 0.5 8.5 0.723858 8.5 1V2.86667C8.5 3.14281 8.27614 3.36667 8 3.36667C7.72386 3.36667 7.5 3.14281 7.5 2.86667V1C7.5 0.723858 7.72386 0.5 8 0.5ZM0.5 8C0.5 7.72386 0.723858 7.5 1 7.5H2.86667C3.14281 7.5 3.36667 7.72386 3.36667 8C3.36667 8.27614 3.14281 8.5 2.86667 8.5H1C0.723858 8.5 0.5 8.27614 0.5 8ZM12.6333 8C12.6333 7.72386 12.8572 7.5 13.1333 7.5H15C15.2761 7.5 15.5 7.72386 15.5 8C15.5 8.27614 15.2761 8.5 15 8.5H13.1333C12.8572 8.5 12.6333 8.27614 12.6333 8ZM8.99987 10.8145C9.09475 11.0816 9.39061 11.2244 9.64095 11.0915C10.059 10.8696 10.4293 10.5644 10.728 10.1927C11.1343 9.6872 11.3922 9.0787 11.4728 8.43514C11.5535 7.79158 11.4537 7.13827 11.1847 6.54812C10.9156 5.95796 10.4879 5.45417 9.94915 5.09297C9.41045 4.73177 8.78197 4.52736 8.13385 4.50256C7.48573 4.47776 6.84347 4.63353 6.27873 4.9525C5.71399 5.27148 5.24899 5.7411 4.93563 6.30896C4.70526 6.72642 4.56349 7.1849 4.51696 7.65586C4.48909 7.93792 4.73355 8.15738 5.01665 8.14374C5.29975 8.1301 5.51274 7.8874 5.55771 7.60756C5.60274 7.32731 5.69588 7.05561 5.83426 6.80486C6.05573 6.40352 6.38437 6.07162 6.7835 5.84619C7.18262 5.62076 7.63654 5.51066 8.0946 5.52819C8.55265 5.54572 8.99683 5.69019 9.37756 5.94546C9.75829 6.20074 10.0606 6.55679 10.2507 6.97388C10.4409 7.39098 10.5114 7.8527 10.4544 8.30754C10.3974 8.76237 10.2152 9.19242 9.928 9.54971C9.74858 9.77293 9.5326 9.96227 9.29044 10.1103C9.04864 10.2582 8.90499 10.5474 8.99987 10.8145ZM5.17261 9.95833C5.36097 9.79137 5.64409 9.79046 5.83352 9.95621L8.82925 12.5775C8.93776 12.6724 9 12.8096 9 12.9538V14.5C9 14.7761 9.22386 15 9.5 15C9.77614 15 10 14.7761 10 14.5V12.9538C10 12.5212 9.81328 12.1097 9.48776 11.8249L6.49202 9.20363C5.92373 8.70638 5.0744 8.7091 4.5093 9.20998L1.50504 11.8728C1.18385 12.1575 1 12.5662 1 12.9954V14.5C1 14.7761 1.22386 15 1.5 15C1.77614 15 2 14.7761 2 14.5V12.9954C2 12.8523 2.06128 12.7161 2.16835 12.6212L5.17261 9.95833ZM3.40391 2.69668C3.20865 2.50142 2.89206 2.50142 2.6968 2.69668C2.50154 2.89194 2.50154 3.20852 2.6968 3.40379L4.01673 4.72372C4.212 4.91898 4.52858 4.91898 4.72384 4.72372C4.9191 4.52846 4.9191 4.21187 4.72384 4.01661L3.40391 2.69668ZM11.2764 4.01661C11.0811 4.21187 11.0811 4.52846 11.2764 4.72372C11.4716 4.91898 11.7882 4.91898 11.9835 4.72372L13.3034 3.40379C13.4987 3.20852 13.4987 2.89194 13.3034 2.69668C13.1081 2.50142 12.7916 2.50142 12.5963 2.69668L11.2764 4.01661ZM11.9835 11.2762C11.7882 11.081 11.4716 11.081 11.2764 11.2762C11.0811 11.4715 11.0811 11.7881 11.2764 11.9833L12.5963 13.3033C12.7916 13.4985 13.1081 13.4985 13.3034 13.3033C13.4987 13.108 13.4987 12.7914 13.3034 12.5962L11.9835 11.2762Z" fill="black"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M0.875 6.36364H4.55V14H9.45V6.36364H13.125L7 0L0.875 6.36364Z" fill="#B2B9C5" transform="rotate(-90 7 7)"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M0.875 6.36364H4.55V14H9.45V6.36364H13.125L7 0L0.875 6.36364Z" fill="#B2B9C5" transform="rotate(90 7 7)"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="2.5" y="2.5" width="11" height="11" rx="0.5" stroke="white"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.5 3C3.22386 3 3 3.22386 3 3.5V4.5C3 4.77614 2.77614 5 2.5 5C2.22386 5 2 4.77614 2 4.5V3.5C2 2.67157 2.67157 2 3.5 2H8H12.5C13.3284 2 14 2.67157 14 3.5V4.5C14 4.77614 13.7761 5 13.5 5C13.2239 5 13 4.77614 13 4.5V3.5C13 3.22386 12.7761 3 12.5 3H8.5V13H10.5C10.7761 13 11 13.2239 11 13.5C11 13.7761 10.7761 14 10.5 14H8H5.5C5.22386 14 5 13.7761 5 13.5C5 13.2239 5.22386 13 5.5 13H7.5V3H3.5Z" fill="white"/>
3
+ </svg>
@@ -71,6 +71,7 @@ const theme = (() => {
71
71
  transparentWhite2: '#ffffff32',
72
72
  transparentWhite1: '#ffffff16',
73
73
  transparentBlack1: '#263238e6',
74
+ transparentBlack2: '#263238e5',
74
75
  transparentBlue1: '#20a4cae6',
75
76
  blueElectric: '#66dffa',
76
77
  eturnityGrey: '#263238',
@@ -1,5 +1,4 @@
1
1
  /* eslint-disable */
2
- import { h } from 'vue'
3
2
  import { mount } from '@vue/test-utils'
4
3
  import InfoBanner from '@/components/banner/infoBanner'
5
4
  import theme from '@/assets/theme'
@@ -10,59 +9,47 @@ jest.mock('@/components/icon/iconCache.mjs', () => ({
10
9
  }))
11
10
 
12
11
  describe('Info Banner Component', () => {
13
- const props = {
14
- isOpen: false,
15
- buttonLabel: 'Gotcha',
16
- }
17
-
18
- const global = {
19
- provide: {
20
- theme,
21
- },
22
- }
23
-
24
- it('info banner is shown when isOpen props is true', async () => {
25
- const wrapper = mount(InfoBanner, {
26
- props,
27
- global,
12
+ let wrapper
13
+
14
+ beforeEach(() => {
15
+ wrapper = mount(InfoBanner, {
16
+ props: {
17
+ isOpen: true,
18
+ buttonLabel: 'Gotcha',
19
+ },
20
+ slots: {
21
+ title: 'Sample title',
22
+ body: 'Sample body text',
23
+ },
24
+ global: {
25
+ provide: {
26
+ theme,
27
+ },
28
+ },
29
+ })
28
30
  })
29
31
 
32
+
33
+ it('info banner is shown when isOpen props is true', async () => {
34
+
30
35
  const bannerWrapper = wrapper.find('[data-test-id="info_banner_wrapper"]')
31
36
  expect(bannerWrapper.exists()).toBe(true)
32
- expect(bannerWrapper.classes()).not.toContain('visible')
33
- expect(bannerWrapper.classes()).toContain('hidden')
34
- await wrapper.setProps({ isOpen: true })
35
- expect(bannerWrapper.classes()).toContain('visible')
36
- expect(bannerWrapper.classes()).not.toContain('hidden')
37
37
  })
38
38
 
39
- it('info banner slots is display when user passed slots content', async () => {
40
- const titleText = 'Sample title'
41
- const bodyText = 'Sample body text'
42
-
43
- const wrapper = mount(InfoBanner, {
44
- props,
45
- slots: {
46
- title: titleText,
47
- body: bodyText,
48
- },
49
- global,
50
- })
51
-
39
+
40
+ it('info banner slots is display when user passed slots content', () => {
52
41
  const modalTitleEl = wrapper.find('[data-test-id="modal_title"]')
53
- expect(modalTitleEl.text()).toBe(titleText)
42
+ expect(modalTitleEl.text()).toBe('Sample title')
54
43
  const modalBodyEl = wrapper.find('[data-test-id="modal_body"]')
55
- expect(modalBodyEl.text()).toBe(bodyText)
44
+ expect(modalBodyEl.text()).toBe('Sample body text')
56
45
  })
57
46
 
58
47
  it('info banner on-close event is emitted when modal close button is clicked', async () => {
59
- const wrapper = mount(InfoBanner, {
60
- props,
61
- global,
62
- })
63
-
64
48
  const modalCloseButton = wrapper.find('.close')
65
- await modalCloseButton.trigger('click')
49
+
50
+ modalCloseButton.trigger('click')
51
+ await wrapper.vm.$nextTick()
52
+
66
53
  expect(wrapper.emitted('on-close')).toBeTruthy()
67
54
  const emittedEvent = wrapper.emitted('on-close')
68
55
  expect(emittedEvent).toHaveLength(1)
@@ -75,7 +75,7 @@
75
75
  ? props.theme.mainButton[props.appTheme][props.type][props.variant]
76
76
  .disabled.textColor
77
77
  : props.customColor
78
- ? props.theme.colors.black
78
+ ? props.theme.colors.white
79
79
  : props.theme.mainButton[props.appTheme][props.type][props.variant]
80
80
  .default.textColor};
81
81
  background-color: ${(props) =>
@@ -0,0 +1,16 @@
1
+ const defaultProps = {
2
+ title: 'Sample Title',
3
+ infoText: 'Sample Info Text',
4
+ initialPosition: { top: '0px', left: '0px' },
5
+ minWidth: '284px',
6
+ maxWidth: '284px',
7
+ dragTargets: ['document'],
8
+ dragBounds: {},
9
+ sampleBody1:
10
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
11
+ sampleBody2:
12
+ 'Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.',
13
+ sampleFooter: 'Sample footer',
14
+ }
15
+
16
+ export default defaultProps
@@ -0,0 +1,99 @@
1
+ import { mount } from '@vue/test-utils'
2
+ import DraggableCard from '@/components/draggableCard'
3
+ import defaultProps from './defaultProps'
4
+
5
+ jest.mock('@/components/icon/iconCache.mjs', () => ({
6
+ // need to mock this due to how jest handles import.meta
7
+ fetchIcon: jest.fn(() => Promise.resolve('mocked-icon-url.svg')),
8
+ }))
9
+
10
+ describe('DraggableCard.vue', () => {
11
+ it('renders properly with required props', () => {
12
+ const wrapper = mount(DraggableCard, { props: defaultProps })
13
+ expect(
14
+ wrapper.find('[data-test-id="draggable_card_header"]').text()
15
+ ).toContain(defaultProps.title)
16
+
17
+ // Expect no footer rendered if not provided
18
+ const footerElement = wrapper.find('[data-test-id="draggable_card_footer"]')
19
+ expect(footerElement.exists()).toBe(false)
20
+ })
21
+
22
+ it('renders body slot content correctly', () => {
23
+ const wrapper = mount(DraggableCard, {
24
+ props: defaultProps,
25
+ slots: {
26
+ body: `
27
+ <div class="custom_body1">${defaultProps.sampleBody1}</div>
28
+ <div class="custom_body2">${defaultProps.sampleBody2}</div>
29
+ `,
30
+ },
31
+ })
32
+ expect(wrapper.find('.custom_body1').exists()).toBe(true)
33
+ expect(wrapper.text()).toContain(defaultProps.sampleBody1)
34
+ expect(wrapper.find('.custom_body2').exists()).toBe(true)
35
+ expect(wrapper.text()).toContain(defaultProps.sampleBody2)
36
+ })
37
+
38
+ it('renders footer slot content correctly', () => {
39
+ const wrapper = mount(DraggableCard, {
40
+ props: defaultProps,
41
+ slots: {
42
+ footer: `<div class="custom_footer">${defaultProps.sampleFooter}</div>`,
43
+ },
44
+ })
45
+ expect(
46
+ wrapper.find('[data-test-id="draggable_card_footer"]').exists()
47
+ ).toBe(true)
48
+ expect(wrapper.find('.custom_footer').exists()).toBe(true)
49
+ expect(wrapper.text()).toContain(defaultProps.sampleFooter)
50
+ })
51
+
52
+ it('emits "on-close" when close button is clicked', async () => {
53
+ const wrapper = mount(DraggableCard, { props: defaultProps })
54
+ await wrapper
55
+ .find('[data-test-id="draggable_card_close_button"]')
56
+ .trigger('click')
57
+ expect(wrapper.emitted('on-close')).toBeTruthy()
58
+ })
59
+
60
+ it('toggles collapse state when arrow icon is clicked', async () => {
61
+ const wrapper = mount(DraggableCard, {
62
+ props: { ...defaultProps, isCollapsible: true },
63
+ })
64
+ expect(wrapper.vm.isCollapsed).toBe(false)
65
+ await wrapper
66
+ .find('[data-test-id="draggable_card_collapse_button"]')
67
+ .trigger('click')
68
+ expect(wrapper.vm.isCollapsed).toBe(true)
69
+ })
70
+
71
+ it('handles drag start event', async () => {
72
+ const wrapper = mount(DraggableCard, { props: defaultProps })
73
+ await wrapper
74
+ .find('[data-test-id="draggable_card_drag_icon"]')
75
+ .trigger('mousedown', { clientX: 100, clientY: 100 })
76
+ expect(wrapper.vm.isDragging).toBe(true)
77
+ })
78
+
79
+ it('handles drag move event', async () => {
80
+ const wrapper = mount(DraggableCard, { props: defaultProps })
81
+ wrapper.vm.onDragStart(
82
+ { preventDefault: () => {}, clientX: 100, clientY: 100 },
83
+ false
84
+ )
85
+ wrapper.vm.onDrag({ preventDefault: () => {}, clientX: 120, clientY: 120 })
86
+ expect(wrapper.vm.eventCoordinates.x).toBe(120)
87
+ expect(wrapper.vm.eventCoordinates.y).toBe(120)
88
+ })
89
+
90
+ it('handles drag end event', async () => {
91
+ const wrapper = mount(DraggableCard, { props: defaultProps })
92
+ wrapper.vm.onDragStart(
93
+ { preventDefault: () => {}, clientX: 100, clientY: 100 },
94
+ false
95
+ )
96
+ wrapper.vm.onDragEnd()
97
+ expect(wrapper.vm.isDragging).toBe(false)
98
+ })
99
+ })
@@ -0,0 +1,79 @@
1
+ import defaultProps from './defaultProps'
2
+ import DraggableCard from './index.vue'
3
+ import styled from 'vue3-styled-components'
4
+ import theme from '@/assets/theme'
5
+
6
+ export default {
7
+ title: 'DraggableCard',
8
+ component: DraggableCard,
9
+ tags: ['autodocs'],
10
+ }
11
+
12
+ const TextContainer = styled.div`
13
+ font-family: ${theme.fonts.mainFont};
14
+ color: ${theme.colors.white};
15
+ font-weight: 400;
16
+ font-size: 14px;
17
+ line-height: 21px;
18
+ letter-spacing: 0%;
19
+ `
20
+
21
+ const CompleteTemplate = (args) => {
22
+ return {
23
+ components: { DraggableCard, TextContainer },
24
+ setup() {
25
+ return { args }
26
+ },
27
+ template: `
28
+ <DraggableCard v-bind="args">
29
+ <template #body>
30
+ <TextContainer>{{ args.sampleBody1 }}</TextContainer>
31
+ <TextContainer>{{ args.sampleBody2 }}</TextContainer>
32
+ </template>
33
+ <template #footer>
34
+ <TextContainer>{{ args.sampleFooter }}</TextContainer>
35
+ </template>
36
+ </DraggableCard>
37
+ `,
38
+ }
39
+ }
40
+
41
+ export const Default = CompleteTemplate.bind({})
42
+ Default.args = {
43
+ ...defaultProps,
44
+ }
45
+
46
+ export const NotCollapsible = CompleteTemplate.bind({})
47
+ NotCollapsible.args = {
48
+ ...defaultProps,
49
+ isCollapsible: false,
50
+ }
51
+
52
+ export const AdjustWidth = CompleteTemplate.bind({})
53
+ AdjustWidth.args = {
54
+ ...defaultProps,
55
+ minWidth: '100px',
56
+ maxWidth: '500px',
57
+ }
58
+
59
+ const NoFooterTemplate = (args) => {
60
+ return {
61
+ components: { DraggableCard, TextContainer },
62
+ setup() {
63
+ return { args }
64
+ },
65
+ template: `
66
+ <DraggableCard v-bind="args">
67
+ <template #body>
68
+ <TextContainer>{{ args.sampleBody1 }}</TextContainer>
69
+ <TextContainer>{{ args.sampleBody2 }}</TextContainer>
70
+ </template>
71
+ </DraggableCard>
72
+ `,
73
+ }
74
+ }
75
+
76
+ export const NoFooter = NoFooterTemplate.bind({})
77
+ NoFooter.args = {
78
+ ...defaultProps,
79
+ }