@eturnity/eturnity_reusable_components 8.31.6 → 8.34.0-EPDM-13618.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (392) hide show
  1. package/dist/main.es100.js +7 -12
  2. package/dist/main.es101.js +6 -6
  3. package/dist/main.es102.js +8 -7
  4. package/dist/main.es103.js +15 -11
  5. package/dist/main.es104.js +8 -8
  6. package/dist/main.es105.js +10 -13
  7. package/dist/main.es106.js +5 -7
  8. package/dist/main.es107.js +3 -3
  9. package/dist/main.es108.js +6 -9
  10. package/dist/main.es109.js +17 -9
  11. package/dist/main.es110.js +10 -13
  12. package/dist/main.es111.js +6 -8
  13. package/dist/main.es112.js +8 -11
  14. package/dist/main.es113.js +7 -7
  15. package/dist/main.es114.js +7 -7
  16. package/dist/main.es115.js +24 -7
  17. package/dist/main.es116.js +10 -19
  18. package/dist/main.es117.js +12 -8
  19. package/dist/main.es118.js +7 -21
  20. package/dist/main.es119.js +22 -7
  21. package/dist/main.es12.js +2 -2
  22. package/dist/main.es120.js +20 -12
  23. package/dist/main.es121.js +12 -17
  24. package/dist/main.es122.js +12 -13
  25. package/dist/main.es123.js +7 -22
  26. package/dist/main.es124.js +11 -8
  27. package/dist/main.es125.js +8 -6
  28. package/dist/main.es126.js +6 -6
  29. package/dist/main.es127.js +6 -8
  30. package/dist/main.es128.js +6 -6
  31. package/dist/main.es129.js +3 -3
  32. package/dist/main.es13.js +5 -5
  33. package/dist/main.es130.js +9 -6
  34. package/dist/main.es131.js +6 -9
  35. package/dist/main.es132.js +15 -9
  36. package/dist/main.es133.js +11 -15
  37. package/dist/main.es134.js +5 -7
  38. package/dist/main.es135.js +14 -9
  39. package/dist/main.es136.js +9 -12
  40. package/dist/main.es137.js +26 -12
  41. package/dist/main.es138.js +16 -18
  42. package/dist/main.es139.js +9 -23
  43. package/dist/main.es14.js +3 -3
  44. package/dist/main.es140.js +7 -5
  45. package/dist/main.es141.js +5 -7
  46. package/dist/main.es142.js +16 -8
  47. package/dist/main.es143.js +8 -16
  48. package/dist/main.es144.js +3 -3
  49. package/dist/main.es145.js +3 -3
  50. package/dist/main.es146.js +5 -5
  51. package/dist/main.es147.js +3 -3
  52. package/dist/main.es148.js +3 -3
  53. package/dist/main.es149.js +4 -4
  54. package/dist/main.es15.js +22 -248
  55. package/dist/main.es150.js +3 -3
  56. package/dist/main.es151.js +3 -3
  57. package/dist/main.es152.js +4 -4
  58. package/dist/main.es153.js +4 -4
  59. package/dist/main.es154.js +5 -5
  60. package/dist/main.es155.js +5 -5
  61. package/dist/main.es156.js +3 -3
  62. package/dist/main.es157.js +4 -4
  63. package/dist/main.es158.js +4 -4
  64. package/dist/main.es159.js +3 -3
  65. package/dist/main.es16.js +1031 -174
  66. package/dist/main.es160.js +3 -3
  67. package/dist/main.es161.js +4 -4
  68. package/dist/main.es162.js +4 -4
  69. package/dist/main.es163.js +5 -5
  70. package/dist/main.es164.js +3 -3
  71. package/dist/main.es165.js +5 -5
  72. package/dist/main.es166.js +5 -5
  73. package/dist/main.es167.js +5 -5
  74. package/dist/main.es168.js +5 -5
  75. package/dist/main.es169.js +4 -4
  76. package/dist/main.es17.js +224 -21
  77. package/dist/main.es170.js +3 -3
  78. package/dist/main.es171.js +13 -6
  79. package/dist/main.es172.js +6 -13
  80. package/dist/main.es173.js +13 -6
  81. package/dist/main.es174.js +6 -6
  82. package/dist/main.es175.js +8 -15
  83. package/dist/main.es176.js +4 -4
  84. package/dist/main.es177.js +5 -5
  85. package/dist/main.es178.js +3 -3
  86. package/dist/main.es179.js +3 -3
  87. package/dist/main.es18.js +89 -1046
  88. package/dist/main.es180.js +3 -3
  89. package/dist/main.es181.js +3 -3
  90. package/dist/main.es182.js +5 -5
  91. package/dist/main.es183.js +4 -4
  92. package/dist/main.es184.js +5 -5
  93. package/dist/main.es185.js +3 -3
  94. package/dist/main.es186.js +5 -5
  95. package/dist/main.es187.js +3 -3
  96. package/dist/main.es188.js +5 -5
  97. package/dist/main.es189.js +5 -5
  98. package/dist/main.es19.js +68 -195
  99. package/dist/main.es190.js +5 -5
  100. package/dist/main.es191.js +17 -7
  101. package/dist/main.es192.js +8 -18
  102. package/dist/main.es193.js +7 -6
  103. package/dist/main.es194.js +6 -7
  104. package/dist/main.es195.js +6 -6
  105. package/dist/main.es196.js +4 -4
  106. package/dist/main.es197.js +5 -4
  107. package/dist/main.es198.js +6 -7
  108. package/dist/main.es199.js +7 -5
  109. package/dist/main.es20.js +172 -77
  110. package/dist/main.es200.js +5 -7
  111. package/dist/main.es201.js +7 -5
  112. package/dist/main.es202.js +4 -4
  113. package/dist/main.es203.js +12 -9
  114. package/dist/main.es204.js +11 -14
  115. package/dist/main.es205.js +16 -12
  116. package/dist/main.es206.js +8 -7
  117. package/dist/main.es207.js +9 -18
  118. package/dist/main.es208.js +9 -5
  119. package/dist/main.es209.js +4 -6
  120. package/dist/main.es21.js +2 -100
  121. package/dist/main.es210.js +9 -12
  122. package/dist/main.es211.js +13 -5
  123. package/dist/main.es212.js +11 -14
  124. package/dist/main.es213.js +8 -9
  125. package/dist/main.es214.js +15 -11
  126. package/dist/main.es215.js +8 -13
  127. package/dist/main.es216.js +7 -5
  128. package/dist/main.es217.js +13 -8
  129. package/dist/main.es218.js +7 -14
  130. package/dist/main.es219.js +8 -11
  131. package/dist/main.es22.js +505 -158
  132. package/dist/main.es220.js +8 -9
  133. package/dist/main.es221.js +8 -5
  134. package/dist/main.es222.js +8 -7
  135. package/dist/main.es223.js +7 -5
  136. package/dist/main.es224.js +8 -10
  137. package/dist/main.es225.js +16 -11
  138. package/dist/main.es226.js +18 -11
  139. package/dist/main.es227.js +9 -19
  140. package/dist/main.es228.js +6 -6
  141. package/dist/main.es229.js +5 -5
  142. package/dist/main.es23.js +24 -2
  143. package/dist/main.es230.js +3 -3
  144. package/dist/main.es231.js +6 -8
  145. package/dist/main.es232.js +28 -10
  146. package/dist/main.es233.js +9 -9
  147. package/dist/main.es234.js +12 -28
  148. package/dist/main.es235.js +5 -5
  149. package/dist/main.es236.js +6 -6
  150. package/dist/main.es237.js +4 -4
  151. package/dist/main.es238.js +6 -8
  152. package/dist/main.es239.js +8 -6
  153. package/dist/main.es24.js +188 -530
  154. package/dist/main.es240.js +5 -5
  155. package/dist/main.es241.js +6 -8
  156. package/dist/main.es242.js +5 -5
  157. package/dist/main.es243.js +7 -5
  158. package/dist/main.es244.js +5 -7
  159. package/dist/main.es245.js +14 -9
  160. package/dist/main.es246.js +10 -8
  161. package/dist/main.es247.js +9 -16
  162. package/dist/main.es248.js +8 -11
  163. package/dist/main.es249.js +15 -7
  164. package/dist/main.es25.js +61 -21
  165. package/dist/main.es250.js +5 -5
  166. package/dist/main.es251.js +8 -8
  167. package/dist/main.es252.js +8 -8
  168. package/dist/main.es253.js +11 -14
  169. package/dist/main.es254.js +5 -5
  170. package/dist/main.es255.js +4 -6
  171. package/dist/main.es256.js +4 -4
  172. package/dist/main.es257.js +8 -11
  173. package/dist/main.es258.js +7 -7
  174. package/dist/main.es259.js +11 -8
  175. package/dist/main.es26.js +248 -62
  176. package/dist/main.es260.js +4 -9
  177. package/dist/main.es261.js +9 -4
  178. package/dist/main.es262.js +8 -11
  179. package/dist/main.es263.js +13 -8
  180. package/dist/main.es264.js +4 -4
  181. package/dist/main.es265.js +5 -7
  182. package/dist/main.es266.js +5 -5
  183. package/dist/main.es267.js +8 -11
  184. package/dist/main.es268.js +11 -8
  185. package/dist/main.es269.js +6 -6
  186. package/dist/main.es27.js +26 -370
  187. package/dist/main.es270.js +15 -6
  188. package/dist/main.es271.js +7 -16
  189. package/dist/main.es272.js +16 -7
  190. package/dist/main.es273.js +16 -11
  191. package/dist/main.es274.js +9 -21
  192. package/dist/main.es275.js +17 -10
  193. package/dist/main.es276.js +9 -18
  194. package/dist/main.es277.js +4 -4
  195. package/dist/main.es278.js +3 -3
  196. package/dist/main.es279.js +3 -3
  197. package/dist/main.es28.js +15 -10
  198. package/dist/main.es280.js +25 -9
  199. package/dist/main.es281.js +11 -22
  200. package/dist/main.es282.js +7 -15
  201. package/dist/main.es283.js +4 -4
  202. package/dist/main.es284.js +13 -8
  203. package/dist/main.es285.js +6 -8
  204. package/dist/main.es286.js +27 -10
  205. package/dist/main.es287.js +10 -27
  206. package/dist/main.es288.js +10 -12
  207. package/dist/main.es289.js +8 -10
  208. package/dist/main.es29.js +12 -10
  209. package/dist/main.es290.js +9 -8
  210. package/dist/main.es291.js +13 -8
  211. package/dist/main.es292.js +5 -5
  212. package/dist/main.es293.js +7 -12
  213. package/dist/main.es294.js +22 -9
  214. package/dist/main.es295.js +8 -18
  215. package/dist/main.es296.js +7 -9
  216. package/dist/main.es297.js +9 -7
  217. package/dist/main.es298.js +11 -6
  218. package/dist/main.es299.js +8 -13
  219. package/dist/main.es30.js +17 -12
  220. package/dist/main.es300.js +5 -5
  221. package/dist/main.es301.js +7 -9
  222. package/dist/main.es302.js +17 -10
  223. package/dist/main.es303.js +9 -14
  224. package/dist/main.es304.js +7 -5
  225. package/dist/main.es305.js +13 -10
  226. package/dist/main.es306.js +9 -14
  227. package/dist/main.es307.js +7 -5
  228. package/dist/main.es308.js +5 -5
  229. package/dist/main.es309.js +5 -5
  230. package/dist/main.es31.js +8 -30
  231. package/dist/main.es310.js +5 -5
  232. package/dist/main.es311.js +8 -13
  233. package/dist/main.es312.js +13 -8
  234. package/dist/main.es313.js +4 -4
  235. package/dist/main.es314.js +12 -8
  236. package/dist/main.es315.js +18 -12
  237. package/dist/main.es316.js +15 -22
  238. package/dist/main.es317.js +15 -15
  239. package/dist/main.es318.js +12 -14
  240. package/dist/main.es319.js +8 -9
  241. package/dist/main.es32.js +24 -8
  242. package/dist/main.es320.js +15 -11
  243. package/dist/main.es321.js +9 -14
  244. package/dist/main.es322.js +5 -6
  245. package/dist/main.es323.js +14 -9
  246. package/dist/main.es324.js +11 -14
  247. package/dist/main.es325.js +6 -7
  248. package/dist/main.es326.js +5 -6
  249. package/dist/main.es327.js +8 -11
  250. package/dist/main.es328.js +7 -7
  251. package/dist/main.es329.js +11 -8
  252. package/dist/main.es33.js +7 -22
  253. package/dist/main.es330.js +4 -4
  254. package/dist/main.es331.js +7 -5
  255. package/dist/main.es332.js +23 -10
  256. package/dist/main.es333.js +12 -20
  257. package/dist/main.es334.js +9 -11
  258. package/dist/main.es335.js +12 -14
  259. package/dist/main.es336.js +7 -10
  260. package/dist/main.es337.js +6 -7
  261. package/dist/main.es338.js +7 -6
  262. package/dist/main.es339.js +13 -8
  263. package/dist/main.es34.js +7 -7
  264. package/dist/main.es340.js +9 -14
  265. package/dist/main.es341.js +6 -6
  266. package/dist/main.es342.js +26 -12
  267. package/dist/main.es343.js +7 -26
  268. package/dist/main.es344.js +9 -4
  269. package/dist/main.es345.js +5 -5
  270. package/dist/main.es346.js +6 -4
  271. package/dist/main.es347.js +6 -8
  272. package/dist/main.es348.js +5 -5
  273. package/dist/main.es349.js +6 -6
  274. package/dist/main.es35.js +13 -8
  275. package/dist/main.es350.js +8 -7
  276. package/dist/main.es351.js +8 -7
  277. package/dist/main.es352.js +5 -7
  278. package/dist/main.es353.js +6 -6
  279. package/dist/main.es354.js +4 -4
  280. package/dist/main.es355.js +4 -4
  281. package/dist/main.es356.js +8 -6
  282. package/dist/main.es357.js +5 -7
  283. package/dist/main.es358.js +17 -10
  284. package/dist/main.es359.js +11 -18
  285. package/dist/main.es36.js +14 -11
  286. package/dist/main.es360.js +16 -9
  287. package/dist/main.es361.js +8 -15
  288. package/dist/main.es362.js +6 -6
  289. package/dist/main.es363.js +14 -9
  290. package/dist/main.es364.js +9 -14
  291. package/dist/main.es365.js +3 -3
  292. package/dist/main.es366.js +5 -5
  293. package/dist/main.es367.js +14 -9
  294. package/dist/main.es368.js +14 -9
  295. package/dist/main.es369.js +11 -16
  296. package/dist/main.es37.js +8 -8
  297. package/dist/main.es370.js +4 -4
  298. package/dist/main.es371.js +11 -14
  299. package/dist/main.es372.js +5 -7
  300. package/dist/main.es373.js +8 -6
  301. package/dist/main.es374.js +4 -4
  302. package/dist/main.es375.js +17 -12
  303. package/dist/main.es376.js +12 -17
  304. package/dist/main.es377.js +23 -11
  305. package/dist/main.es378.js +7 -21
  306. package/dist/main.es379.js +4 -4
  307. package/dist/main.es38.js +9 -14
  308. package/dist/main.es380.js +6 -6
  309. package/dist/main.es381.js +6 -6
  310. package/dist/main.es382.js +52 -18
  311. package/dist/main.es383.js +369 -53
  312. package/dist/main.es386.js +1 -1
  313. package/dist/main.es39.js +29 -8
  314. package/dist/main.es40.js +13 -19
  315. package/dist/main.es41.js +10 -25
  316. package/dist/main.es42.js +7 -7
  317. package/dist/main.es43.js +8 -7
  318. package/dist/main.es44.js +22 -11
  319. package/dist/main.es45.js +10 -15
  320. package/dist/main.es46.js +16 -12
  321. package/dist/main.es47.js +9 -23
  322. package/dist/main.es48.js +7 -7
  323. package/dist/main.es49.js +11 -8
  324. package/dist/main.es5.js +3 -3
  325. package/dist/main.es50.js +13 -8
  326. package/dist/main.es51.js +8 -8
  327. package/dist/main.es52.js +9 -14
  328. package/dist/main.es53.js +3 -3
  329. package/dist/main.es54.js +14 -9
  330. package/dist/main.es55.js +9 -14
  331. package/dist/main.es56.js +13 -8
  332. package/dist/main.es57.js +11 -14
  333. package/dist/main.es58.js +7 -8
  334. package/dist/main.es59.js +7 -6
  335. package/dist/main.es6.js +4 -4
  336. package/dist/main.es60.js +5 -7
  337. package/dist/main.es61.js +8 -6
  338. package/dist/main.es62.js +6 -8
  339. package/dist/main.es63.js +5 -5
  340. package/dist/main.es64.js +8 -6
  341. package/dist/main.es65.js +8 -13
  342. package/dist/main.es66.js +11 -8
  343. package/dist/main.es67.js +4 -4
  344. package/dist/main.es68.js +7 -9
  345. package/dist/main.es69.js +9 -10
  346. package/dist/main.es70.js +11 -8
  347. package/dist/main.es71.js +14 -9
  348. package/dist/main.es72.js +6 -6
  349. package/dist/main.es73.js +8 -13
  350. package/dist/main.es74.js +4 -4
  351. package/dist/main.es742.js +21 -60
  352. package/dist/main.es743.js +60 -21
  353. package/dist/main.es75.js +4 -4
  354. package/dist/main.es76.js +4 -4
  355. package/dist/main.es77.js +20 -12
  356. package/dist/main.es78.js +22 -20
  357. package/dist/main.es79.js +10 -20
  358. package/dist/main.es8.js +12 -0
  359. package/dist/main.es80.js +6 -6
  360. package/dist/main.es81.js +14 -9
  361. package/dist/main.es82.js +8 -6
  362. package/dist/main.es83.js +17 -14
  363. package/dist/main.es84.js +13 -17
  364. package/dist/main.es85.js +12 -11
  365. package/dist/main.es86.js +8 -9
  366. package/dist/main.es87.js +8 -14
  367. package/dist/main.es88.js +10 -11
  368. package/dist/main.es89.js +13 -10
  369. package/dist/main.es9.js +2 -2
  370. package/dist/main.es90.js +14 -11
  371. package/dist/main.es91.js +18 -11
  372. package/dist/main.es92.js +8 -20
  373. package/dist/main.es93.js +7 -5
  374. package/dist/main.es94.js +6 -8
  375. package/dist/main.es95.js +14 -11
  376. package/dist/main.es96.js +19 -12
  377. package/dist/main.es97.js +9 -22
  378. package/dist/main.es98.js +17 -9
  379. package/dist/main.es99.js +6 -6
  380. package/package.json +1 -1
  381. package/src/assets/theme.js +12 -0
  382. package/src/components/buttons/mainButton/MainButton.stories.js +6 -0
  383. package/src/components/buttons/mainButton/index.vue +9 -1
  384. package/src/components/dropdown/Dropdown.stories.js +111 -39
  385. package/src/components/dropdown/defaultProps.js +7 -0
  386. package/src/components/dropdown/dropdown.spec.js +55 -0
  387. package/src/components/dropdown/index.vue +30 -21
  388. package/src/components/progressBar/ProgressBar.stories.js +62 -0
  389. package/src/components/progressBar/defaultProps.js +5 -0
  390. package/src/components/progressBar/index.vue +28 -56
  391. package/src/components/progressBar/progressBar.spec.js +52 -0
  392. package/src/components/tables/mainTable/index.vue +2 -1
package/dist/main.es99.js CHANGED
@@ -2,17 +2,17 @@ import "./main.es3.js";
2
2
  import { openBlock, createElementBlock, createElementVNode as createBaseVNode } from "./main.es6.js";
3
3
  const _hoisted_1 = {
4
4
  xmlns: "http://www.w3.org/2000/svg",
5
- width: "13",
6
- height: "23",
5
+ width: "8",
6
+ height: "16",
7
7
  fill: "none"
8
8
  };
9
9
  const _hoisted_2 = /* @__PURE__ */ createBaseVNode("path", {
10
10
  fill: "#263238",
11
- d: "M21.5 14.75a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0M21.5 20a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0M21.5 25.25a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0"
11
+ d: "M21.5 14.75a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0M21.5 25.25a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0"
12
12
  }, null, -1);
13
13
  const _hoisted_3 = /* @__PURE__ */ createBaseVNode("path", {
14
14
  fill: "#99DB0C",
15
- d: "m28.94 7.96-3.78 3.73-2.1.25.25-2.1 3.73-3.78z"
15
+ d: "m22.94 18.96-3.78 3.73-2.1.25.25-2.1 3.73-3.78z"
16
16
  }, null, -1);
17
17
  const _hoisted_4 = [
18
18
  _hoisted_2,
@@ -21,8 +21,8 @@ const _hoisted_4 = [
21
21
  function render(_ctx, _cache) {
22
22
  return openBlock(), createElementBlock("svg", _hoisted_1, _hoisted_4);
23
23
  }
24
- const context_menu1 = { render };
24
+ const context_menu2 = { render };
25
25
  export {
26
- context_menu1 as default,
26
+ context_menu2 as default,
27
27
  render
28
28
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "8.31.6",
3
+ "version": "8.34.0-EPDM-13618.2",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
@@ -217,6 +217,18 @@ const theme = (() => {
217
217
  boxShadow: {
218
218
  card: '0px 2px 8px 2px rgba(0, 0, 0, 0.15)',
219
219
  },
220
+ progressBar: {
221
+ light: {
222
+ fillColor: semanticColors.purple[500],
223
+ backgroundColor: semanticColors.grey[200],
224
+ labelColor: semanticColors.grey[700],
225
+ },
226
+ dark: {
227
+ fillColor: colors.white,
228
+ backgroundColor: semanticColors.grey[700],
229
+ labelColor: semanticColors.grey[200],
230
+ },
231
+ },
220
232
  mainButton: {
221
233
  light: {
222
234
  // theme
@@ -104,6 +104,12 @@ WithIcon.args = {
104
104
  appTheme: 'light',
105
105
  }
106
106
 
107
+ export const WithIconLast = Template.bind({})
108
+ WithIconLast.args = {
109
+ ...WithIcon.args,
110
+ iconLast: true,
111
+ }
112
+
107
113
  export const Disabled = Template.bind({})
108
114
  Disabled.args = {
109
115
  type: 'primary',
@@ -15,7 +15,7 @@
15
15
  :variant="variant"
16
16
  :width="width"
17
17
  >
18
- <LabelComponent :has-icon="Boolean(icon)">
18
+ <LabelComponent :has-icon="Boolean(icon)" :reverse-direction="iconLast">
19
19
  <Icon
20
20
  v-if="icon"
21
21
  :color="getIconColor"
@@ -146,10 +146,13 @@
146
146
 
147
147
  const LabelAttrs = {
148
148
  hasIcon: Boolean,
149
+ reverseDirection: Boolean,
149
150
  }
150
151
 
151
152
  const LabelComponent = styled('span', LabelAttrs)`
152
153
  display: flex;
154
+ flex-direction: ${(props) =>
155
+ props.reverseDirection ? 'row-reverse' : 'row'};
153
156
  align-items: center;
154
157
  justify-content: center;
155
158
  gap: ${(props) => (props.hasIcon ? '5px' : '0')};
@@ -212,6 +215,11 @@
212
215
  default: '',
213
216
  type: String,
214
217
  },
218
+ iconLast: {
219
+ required: false,
220
+ default: false,
221
+ type: Boolean,
222
+ },
215
223
  iconAltStyle: {
216
224
  required: false,
217
225
  default: false,
@@ -1,53 +1,125 @@
1
+ import defaultDropdownProps from './defaultProps'
1
2
  import Dropdown from './index.vue'
3
+ import theme from '@/assets/theme'
2
4
 
3
5
  export default {
4
6
  title: 'Dropdown',
5
7
  component: Dropdown,
6
- // argTypes: {},
7
- }
8
-
9
- const Template = (args, { argTypes }) => ({
10
- // Components used in your story `template` are defined in the `components` object
11
- components: { Dropdown },
12
- // The story's `args` need to be mapped into the template through the `setup()` method
13
- props: Object.keys(argTypes),
14
- template: `<Dropdown v-bind="$props">
15
- <template #trigger>
16
- trigger button
17
- </template>
18
- <template #dropdown>
19
- <div>
20
- <h3>fully customizable dropdown</h3>
21
- <ul>
22
- <li>item</li>
23
- <li>item</li>
24
- <li>item</li>
25
- </ul>
8
+ tags: ['autodocs'],
9
+ argTypes: {
10
+ width: {
11
+ description: '',
12
+ },
13
+ gap: {
14
+ description: 'Gap between trigger and dropdown content',
15
+ },
16
+ justify: {
17
+ description:
18
+ 'Rule to allign the dropdown content relatively to the trigger',
19
+ control: 'select',
20
+ options: ['right', 'left'],
21
+ },
22
+ openingMode: {
23
+ description:
24
+ 'Way to open the dropdown content: eigther by clicking on trigger or hovering it',
25
+ control: 'select',
26
+ options: ['hover', 'click'],
27
+ },
28
+ backgroundColor: {
29
+ description: 'Backbround color of dropdown content',
30
+ control: {
31
+ type: 'color',
32
+ presetColors: [
33
+ theme.colors.white,
34
+ theme.colors.grey3,
35
+ theme.colors.grey4,
36
+ theme.colors.red,
37
+ ],
38
+ },
39
+ },
40
+
41
+ // slots
42
+ trigger: {
43
+ description: 'Trigger button slot',
44
+ },
45
+ dropdown: {
46
+ description: 'Dropdown content slot',
47
+ },
48
+ },
49
+ }
50
+
51
+ // To use:
52
+ // import Dropdown from '@eturnity/eturnity_reusable_components/src/components/dropdown'
53
+ // <Dropdown
54
+ // width="fit-content"
55
+ // gap="20px"
56
+ // justify="right"
57
+ // opening-mode="click"
58
+ // background-color="red"
59
+ // >
60
+ // <template #trigger>
61
+ // TRIGGER BUTTON
62
+ // </template>
63
+ // <template #dropdown>
64
+ // <div>
65
+ // <div>OPTION 1</div>
66
+ // <div>OPTION 2</div>
67
+ // </div>
68
+ // </template>
69
+ // <Dropdown/>
70
+
71
+ const Template = (args) => {
72
+ return {
73
+ components: { Dropdown },
74
+ setup() {
75
+ return { args }
76
+ },
77
+ template: `
78
+ <div style="margin-left: 30px;">
79
+ <Dropdown v-bind="args">
80
+ <template #trigger>
81
+ {{ args.trigger }}
82
+ </template>
83
+ <template #dropdown>
84
+ <div v-html="args.dropdown"></div>
85
+ </template>
86
+ </Dropdown>
26
87
  </div>
27
- </template>
28
- </Dropdown>`,
29
- // import Icon from "@eturnity/eturnity_reusable_components/src/components/icon"
30
- // How to use:
31
- //<icon
32
- // name="House" //required. a svg file named [name].svg should be present in /assets/svgIcons
33
- // color="red"
34
- // hoveredColor="blue"
35
- // size="60px" by default, this is 30px
36
- // />
37
- })
88
+ `,
89
+ }
90
+ }
38
91
 
39
92
  export const Default = Template.bind({})
40
93
  Default.args = {
41
- openingMode: 'click',
94
+ ...defaultDropdownProps,
95
+ }
96
+
97
+ export const DropdownWidth = Template.bind({})
98
+ DropdownWidth.args = {
99
+ ...defaultDropdownProps,
100
+ width: 'max-content',
101
+ }
102
+
103
+ export const DropdownGap = Template.bind({})
104
+ DropdownGap.args = {
105
+ ...defaultDropdownProps,
42
106
  gap: '0px',
43
- justify: 'left',
44
- width: '150px',
45
107
  }
46
108
 
47
- export const withHover = Template.bind({})
48
- withHover.args = {
49
- openingMode: 'hover',
50
- gap: '20px',
109
+ export const DropdownJustifyRight = Template.bind({})
110
+ DropdownJustifyRight.args = {
111
+ ...defaultDropdownProps,
51
112
  justify: 'right',
52
- width: '250px',
113
+ }
114
+
115
+ export const DropdownOpeningModeClick = Template.bind({})
116
+ DropdownOpeningModeClick.args = {
117
+ ...defaultDropdownProps,
118
+ openingMode: 'click',
119
+ }
120
+
121
+ export const DropdownBackgroundColor = Template.bind({})
122
+ DropdownBackgroundColor.args = {
123
+ ...defaultDropdownProps,
124
+ backgroundColor: theme.colors.red,
53
125
  }
@@ -0,0 +1,7 @@
1
+ const defaultProps = {
2
+ // info card content slot
3
+ trigger: 'TRIGGER BUTTON',
4
+ dropdown: `<div>DROPDOWN OPTION 1</div><div>DROPDOWN OPTION 2</div>`,
5
+ }
6
+
7
+ export default defaultProps
@@ -0,0 +1,55 @@
1
+ import { mount } from '@vue/test-utils'
2
+ import RCDropdown from '@/components/dropdown'
3
+ import defaultProps from './defaultProps'
4
+ import theme from '@/assets/theme'
5
+
6
+ jest.mock('@/components/icon/iconCache.mjs', () => ({
7
+ // need to mock this due to how jest handles import.meta
8
+ fetchIcon: jest.fn(() => Promise.resolve('mocked-icon-url.svg')),
9
+ }))
10
+
11
+ describe('dropdown/index.vue', () => {
12
+ it('dropdown is rendered with correct trigger text', async () => {
13
+ const wrapper = mount(RCDropdown, {
14
+ props: { ...defaultProps },
15
+ slots: { ...defaultProps },
16
+ global: {
17
+ provide: {
18
+ theme,
19
+ },
20
+ },
21
+ })
22
+
23
+ const dropdownTrigger = wrapper.find('[data-test-id="dropdown_trigger"]')
24
+
25
+ expect(dropdownTrigger.exists()).toBe(true)
26
+ expect(dropdownTrigger.text()).toContain(defaultProps.trigger)
27
+ })
28
+
29
+ it('dropdown opens on click only', async () => {
30
+ const wrapper = mount(RCDropdown, {
31
+ props: { ...defaultProps, openingMode: 'click' },
32
+ slots: { ...defaultProps },
33
+ global: {
34
+ provide: {
35
+ theme,
36
+ },
37
+ },
38
+ })
39
+
40
+ const dropdownTrigger = wrapper.find('[data-test-id="dropdown_trigger"]')
41
+ const dropdownDropdownWrapper = wrapper.find(
42
+ '[data-test-id="dropdown_dropdown_wrapper"]'
43
+ )
44
+
45
+ expect(dropdownDropdownWrapper.classes('openDropdown')).toBe(false)
46
+
47
+ await dropdownTrigger.trigger('hover')
48
+
49
+ expect(dropdownDropdownWrapper.classes('openDropdown')).toBe(false)
50
+
51
+ await dropdownTrigger.trigger('click')
52
+
53
+ expect(dropdownDropdownWrapper.classes('openDropdown')).toBe(true)
54
+ })
55
+ })
@@ -1,18 +1,26 @@
1
1
  <template>
2
- <Wrapper ref="dropdown" :opening-mode="openingMode">
3
- <WrapperButton @click="isOpenByClick = !isOpenByClick">
2
+ <Wrapper
3
+ data-test-id="dropdown_wrapper"
4
+ ref="dropdown"
5
+ :opening-mode="openingMode"
6
+ >
7
+ <WrapperButton
8
+ data-test-id="dropdown_trigger"
9
+ @click="toggleIsOpenByClick(!isOpenByClick)"
10
+ >
4
11
  <slot name="trigger"></slot>
5
12
  </WrapperButton>
6
13
  <WrapperDropdown
7
14
  :background-color="backgroundColor"
8
15
  class="dropdown-content"
9
- :class="{ openDropdown: isOpenByClick && openingMode == 'click' }"
16
+ :class="{ openDropdown: isOpenByClick && openingMode === 'click' }"
17
+ data-test-id="dropdown_dropdown_wrapper"
10
18
  :justify="justify"
11
- :position="position"
12
19
  :width="width"
13
20
  >
14
21
  <DropdownWindow
15
22
  :background-color="backgroundColor"
23
+ data-test-id="dropdown_dropdown_content"
16
24
  :gap="gap"
17
25
  :width="width"
18
26
  >
@@ -23,14 +31,6 @@
23
31
  </template>
24
32
 
25
33
  <script>
26
- // import Icon from "@eturnity/eturnity_reusable_components/src/components/icon"
27
- // How to use:
28
- //<DropdownComponent
29
- // width="300px"
30
- // backgroundColor="red">
31
-
32
- // <DropdownComponent/>
33
-
34
34
  import styled from 'vue3-styled-components'
35
35
 
36
36
  const wrapperAttrs = {
@@ -45,11 +45,11 @@
45
45
  position: relative;
46
46
 
47
47
  &:hover .dropdown-content {
48
- ${(props) => (props.openingMode == 'hover' ? 'display:block' : '')}
48
+ ${(props) => (props.openingMode === 'hover' ? 'display: block;' : '')}
49
49
  }
50
50
  & .openDropdown {
51
51
  ${(props) =>
52
- props.openingMode == 'click' ? 'display:block !important' : ''}
52
+ props.openingMode === 'click' ? 'display: block !important;' : ''}
53
53
  }
54
54
  `
55
55
  const WrapperDropdown = styled('div', wrapperAttrs)`
@@ -57,7 +57,7 @@
57
57
  display: none;
58
58
  position: absolute;
59
59
  z-index: 1;
60
- ${(props) => (props.justify == 'right' ? 'right:0;' : '')}
60
+ ${(props) => (props.justify === 'right' ? 'right: 0;' : '')}
61
61
  `
62
62
  const DropdownWindow = styled('div', wrapperAttrs)`
63
63
  width: ${(props) => props.width};
@@ -86,26 +86,27 @@
86
86
  props: {
87
87
  width: {
88
88
  required: false,
89
+ type: String,
89
90
  default: '300px',
90
91
  },
91
92
  gap: {
92
93
  required: false,
94
+ type: String,
93
95
  default: '10px',
94
96
  },
95
- position: {
96
- required: false,
97
- default: 'bottom',
98
- },
99
97
  justify: {
100
98
  required: false,
99
+ type: String,
101
100
  default: 'left',
102
101
  },
103
102
  openingMode: {
104
103
  required: false,
104
+ type: String,
105
105
  default: 'hover',
106
106
  },
107
107
  backgroundColor: {
108
108
  required: false,
109
+ type: String,
109
110
  default: 'white',
110
111
  },
111
112
  },
@@ -121,18 +122,26 @@
121
122
  document.removeEventListener('click', this.clickOutside)
122
123
  },
123
124
  methods: {
125
+ toggleIsOpenByClick(value) {
126
+ this.isOpenByClick = value
127
+ },
124
128
  clickOutside(event) {
125
129
  if (this.openingMode != 'click') return
126
130
  if (
127
131
  this.$refs.dropdown &&
128
- (this.$refs.dropdown.$el == event.target ||
132
+ (this.$refs.dropdown.$el === event.target ||
129
133
  this.$refs.dropdown.$el.contains(event.target))
130
134
  ) {
131
135
  return
132
136
  } else {
133
- this.isOpenByClick = false
137
+ this.toggleIsOpenByClick(false)
134
138
  }
135
139
  },
136
140
  },
141
+ watch: {
142
+ isOpenByClick(newVal) {
143
+ this.$emit('on-dropdown-toggle', newVal)
144
+ },
145
+ },
137
146
  }
138
147
  </script>
@@ -0,0 +1,62 @@
1
+ import defaultDropdownProps from './defaultProps'
2
+ import ProgressBar from './index.vue'
3
+ import theme from '@/assets/theme'
4
+
5
+ export default {
6
+ title: 'ProgressBar',
7
+ component: ProgressBar,
8
+ tags: ['autodocs'],
9
+ argTypes: {
10
+ fillProgress: {
11
+ description: 'Precentage of progress bar filled in with color',
12
+ },
13
+ labelText: {
14
+ description: 'Label text above the progress bar',
15
+ },
16
+ appTheme: {
17
+ description: 'App color theme',
18
+ control: 'select',
19
+ options: ['light', 'dark'],
20
+ },
21
+ },
22
+ }
23
+
24
+ // To use:
25
+ // import ProgressBar from "@eturnity/eturnity_reusable_components/src/components/progressBar"
26
+ // <ProgressBar
27
+ // :fill-progress="50"
28
+ // :label-text="some label text"
29
+ // />
30
+
31
+ const Template = (args) => {
32
+ return {
33
+ components: { ProgressBar },
34
+ setup() {
35
+ return { args }
36
+ },
37
+ provide: {
38
+ theme,
39
+ },
40
+ template: `
41
+ <ProgressBar v-bind="args"/>
42
+ `,
43
+ }
44
+ }
45
+
46
+ export const Default = Template.bind({})
47
+ Default.args = {
48
+ ...defaultDropdownProps,
49
+ }
50
+
51
+ export const ProgressBarLabelText = Template.bind({})
52
+ ProgressBarLabelText.args = {
53
+ ...defaultDropdownProps,
54
+ labelText: 'Progress Bar Label Text',
55
+ }
56
+
57
+ export const ProgressBarLabelTextAppThemeDark = Template.bind({})
58
+ ProgressBarLabelTextAppThemeDark.args = {
59
+ ...defaultDropdownProps,
60
+ labelText: 'Progress Bar Label Text',
61
+ appTheme: 'dark',
62
+ }
@@ -0,0 +1,5 @@
1
+ const defaultProps = {
2
+ fillProgress: '65',
3
+ }
4
+
5
+ export default defaultProps
@@ -1,36 +1,26 @@
1
1
  <template>
2
2
  <Container>
3
3
  <ProgressContainer
4
- :background-color="backgroundColor"
5
- class="progress-container"
6
- :max-width="maxWidth"
7
- :min-width="minWidth"
4
+ :app-theme="appTheme"
5
+ data-test-id="progress_bar_container"
8
6
  >
9
7
  <ProgressFill
10
- class="progress-bar"
11
- :fill-color="fillColor"
8
+ :app-theme="appTheme"
9
+ data-test-id="progress_bar_progress"
12
10
  :fill-progress="fillProgress"
13
11
  />
14
12
  </ProgressContainer>
15
- <LabelText v-if="stepNumber || labelText" class="progress-text">
16
- {{ labelText ? labelText : '' }}
17
- {{ stepNumber ? stepNumber : '' }}
13
+ <LabelText
14
+ v-if="labelText"
15
+ :app-theme="appTheme"
16
+ data-test-id="progress_bar_label"
17
+ >
18
+ {{ labelText }}
18
19
  </LabelText>
19
20
  </Container>
20
21
  </template>
21
22
 
22
23
  <script>
23
- // import ProgressBar from "@eturnity/eturnity_reusable_components/src/components/progressBar"
24
- //To Use:
25
- // <progress-bar
26
- // fillColor="#000"
27
- // backgroundColor="#888"
28
- // minWidth="150px"
29
- // maxWidth="100%"
30
- // :fillProgress="50" //should be a number for percent
31
- // stepNumber="4"
32
- // :labelText="translate('step')"
33
- // />
34
24
  import styled from 'vue3-styled-components'
35
25
 
36
26
  const Container = styled.div`
@@ -44,34 +34,34 @@
44
34
  `
45
35
 
46
36
  const containerProps = {
47
- backgroundColor: String,
48
- maxWidth: String,
49
- minWidth: String,
37
+ appTheme: String,
50
38
  }
51
39
  const ProgressContainer = styled('div', containerProps)`
52
40
  width: 100%;
53
- min-width: ${(props) => (props.minWidth ? props.minWidth : 'auto')};
54
- max-width: ${(props) => (props.maxWidth ? props.maxWidth : 'none')};
55
41
  height: 6px;
56
42
  background-color: ${(props) =>
57
- props.backgroundColor
58
- ? props.backgroundColor
59
- : props.theme.colors.lightGray};
43
+ props.theme.progressBar[props.appTheme].backgroundColor};
60
44
  @media (max-width: ${(props) => props.theme.screen.mobile}) {
61
45
  height: 4px;
62
46
  }
63
47
  `
64
48
 
65
- const fillProps = { fillColor: String, fillProgress: String | Number }
49
+ const fillProps = {
50
+ appTheme: String,
51
+ fillProgress: String | Number,
52
+ }
66
53
  const ProgressFill = styled('div', fillProps)`
67
54
  height: 100%;
68
55
  width: ${(props) => props.fillProgress + '%'};
69
56
  background-color: ${(props) =>
70
- props.fillColor ? props.fillColor : props.theme.colors.secondary};
57
+ props.theme.progressBar[props.appTheme].fillColor};
71
58
  `
72
59
 
73
- const LabelText = styled.div`
74
- color: ${(props) => props.theme.colors.darkGray};
60
+ const labelTextProps = {
61
+ appTheme: String,
62
+ }
63
+ const LabelText = styled('div', labelTextProps)`
64
+ color: ${(props) => props.theme.progressBar[props.appTheme].labelColor};
75
65
  font-size: 16px;
76
66
 
77
67
  @media (max-width: ${(props) => props.theme.screen.tablet}) {
@@ -88,37 +78,19 @@
88
78
  LabelText,
89
79
  },
90
80
  props: {
91
- fillColor: {
92
- required: false,
93
- type: String,
94
- default: null,
95
- },
96
- backgroundColor: {
97
- required: false,
98
- type: String,
99
- default: null,
100
- },
101
- minWidth: {
102
- required: false,
103
- type: String,
104
- default: null,
105
- },
106
- maxWidth: {
107
- required: false,
108
- type: String,
109
- default: null,
110
- },
111
81
  fillProgress: {
112
82
  required: false,
83
+ type: [String, Number],
113
84
  default: 0,
114
85
  },
115
86
  labelText: {
116
87
  required: false,
117
- default: null,
88
+ type: String,
89
+ default: '',
118
90
  },
119
- stepNumber: {
120
- required: false,
121
- default: null,
91
+ appTheme: {
92
+ type: String,
93
+ default: 'light',
122
94
  },
123
95
  },
124
96
  }