diginet-core-ui 1.3.24

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 (360) hide show
  1. package/assets/avatar/default.svg +3 -0
  2. package/assets/images/menu/dhr/Default.svg +13 -0
  3. package/assets/images/menu/dhr/MHRM00N0001.svg +14 -0
  4. package/assets/images/menu/dhr/MHRM09N0001.svg +1 -0
  5. package/assets/images/menu/dhr/MHRM09N0002.svg +3 -0
  6. package/assets/images/menu/dhr/MHRM09N0003.svg +25 -0
  7. package/assets/images/menu/dhr/MHRM25N0001.svg +26 -0
  8. package/assets/images/menu/dhr/MHRM29N0001.svg +30 -0
  9. package/assets/images/menu/dhr/MHRM29N0015.svg +63 -0
  10. package/assets/images/menu/dhr/MHRM39N0012.svg +43 -0
  11. package/assets/images/menu/dhr/MHRM39N0013.svg +24 -0
  12. package/assets/images/menu/dhr/MHRM39N0014.svg +14 -0
  13. package/assets/images/menu/dhr/MHRM39N0015.svg +36 -0
  14. package/assets/images/menu/dhr/MHRM39N0016.svg +23 -0
  15. package/assets/images/menu/dhr/MHRM77N0001.svg +28 -0
  16. package/assets/images/menu/dhr/MHRM84N0001.svg +27 -0
  17. package/assets/images/menu/dhr/MHRM84N0002.svg +24 -0
  18. package/assets/images/menu/dhr/MHRM89N0001.svg +16 -0
  19. package/assets/images/menu/dhr/MHRP00N0001.svg +10 -0
  20. package/assets/images/menu/dhr/MHRP09N0001.svg +22 -0
  21. package/assets/images/menu/dhr/MHRP09N0002.svg +19 -0
  22. package/assets/images/menu/dhr/MHRP09N0003.svg +12 -0
  23. package/assets/images/menu/dhr/MHRP09N0004.svg +6 -0
  24. package/assets/images/menu/dhr/MHRP09N0005.svg +10 -0
  25. package/assets/images/menu/dhr/MHRP09N0006.svg +17 -0
  26. package/assets/images/menu/dhr/MHRP09N0007.svg +15 -0
  27. package/assets/images/menu/dhr/MHRP09N0008.svg +8 -0
  28. package/assets/images/menu/dhr/MHRP09N0009.svg +10 -0
  29. package/assets/images/menu/dhr/MHRP09N0010.svg +12 -0
  30. package/assets/images/menu/dhr/MHRP09N0011.svg +16 -0
  31. package/assets/images/menu/dhr/MHRP09N0012.svg +6 -0
  32. package/assets/images/menu/dhr/MHRP09N0013.svg +8 -0
  33. package/assets/images/menu/dhr/MHRP09N0014.svg +11 -0
  34. package/assets/images/menu/dhr/MHRP09N0015.svg +12 -0
  35. package/assets/images/menu/dhr/MHRP09N0016.svg +18 -0
  36. package/assets/images/menu/dhr/MHRP09N0017.svg +18 -0
  37. package/assets/images/menu/dhr/MHRP09N0018.svg +12 -0
  38. package/assets/images/menu/dhr/MHRP09N0019.svg +13 -0
  39. package/assets/images/menu/dhr/MHRP09N0020.svg +17 -0
  40. package/assets/images/menu/dhr/MHRP09N0021.svg +10 -0
  41. package/assets/images/menu/dhr/MHRP09N0022.svg +16 -0
  42. package/assets/images/menu/dhr/MHRP09N0023.svg +8 -0
  43. package/assets/images/menu/dhr/MHRP09N0024.svg +15 -0
  44. package/assets/images/menu/dhr/MHRP09N0025.svg +16 -0
  45. package/assets/images/menu/dhr/MHRP09N0026.svg +13 -0
  46. package/assets/images/menu/dhr/MHRP09N0027.svg +10 -0
  47. package/assets/images/menu/dhr/MHRP13N0001.svg +9 -0
  48. package/assets/images/menu/dhr/MHRP21N0001.svg +12 -0
  49. package/assets/images/menu/dhr/MHRP21N0002.svg +13 -0
  50. package/assets/images/menu/dhr/MHRP25N0001.svg +13 -0
  51. package/assets/images/menu/dhr/MHRP25N0002.svg +16 -0
  52. package/assets/images/menu/dhr/MHRP25N0003.svg +38 -0
  53. package/assets/images/menu/dhr/MHRP25N0004.svg +17 -0
  54. package/assets/images/menu/dhr/MHRP25N0005.svg +20 -0
  55. package/assets/images/menu/dhr/MHRP29N0001.svg +18 -0
  56. package/assets/images/menu/dhr/MHRP29N0002.svg +15 -0
  57. package/assets/images/menu/dhr/MHRP29N0003.svg +20 -0
  58. package/assets/images/menu/dhr/MHRP29N0004.svg +21 -0
  59. package/assets/images/menu/dhr/MHRP29N0005.svg +21 -0
  60. package/assets/images/menu/dhr/MHRP29N0006.svg +14 -0
  61. package/assets/images/menu/dhr/MHRP29N0007.svg +19 -0
  62. package/assets/images/menu/dhr/MHRP29N0008.svg +20 -0
  63. package/assets/images/menu/dhr/MHRP29N0009.svg +11 -0
  64. package/assets/images/menu/dhr/MHRP29N0010.svg +11 -0
  65. package/assets/images/menu/dhr/MHRP29N0011.svg +12 -0
  66. package/assets/images/menu/dhr/MHRP29N0013.svg +27 -0
  67. package/assets/images/menu/dhr/MHRP29N0014.svg +32 -0
  68. package/assets/images/menu/dhr/MHRP29N0016.svg +54 -0
  69. package/assets/images/menu/dhr/MHRP29N0017.svg +24 -0
  70. package/assets/images/menu/dhr/MHRP29N0018.svg +44 -0
  71. package/assets/images/menu/dhr/MHRP29N0019.svg +17 -0
  72. package/assets/images/menu/dhr/MHRP29N0020.svg +11 -0
  73. package/assets/images/menu/dhr/MHRP38N0001.svg +13 -0
  74. package/assets/images/menu/dhr/MHRP38N0002.svg +14 -0
  75. package/assets/images/menu/dhr/MHRP39N0001.svg +15 -0
  76. package/assets/images/menu/dhr/MHRP39N0002.svg +13 -0
  77. package/assets/images/menu/dhr/MHRP39N0003.svg +16 -0
  78. package/assets/images/menu/dhr/MHRP39N0004.svg +22 -0
  79. package/assets/images/menu/dhr/MHRP39N0005.svg +16 -0
  80. package/assets/images/menu/dhr/MHRP39N0006.svg +17 -0
  81. package/assets/images/menu/dhr/MHRP39N0007.svg +13 -0
  82. package/assets/images/menu/dhr/MHRP39N0008.svg +3 -0
  83. package/assets/images/menu/dhr/MHRP39N0009.svg +3 -0
  84. package/assets/images/menu/dhr/MHRP39N0010.svg +7 -0
  85. package/assets/images/menu/dhr/MHRP39N0011.svg +14 -0
  86. package/assets/images/menu/dhr/MHRP39N0013.svg +10 -0
  87. package/assets/images/menu/dhr/MHRP39N0014.svg +11 -0
  88. package/assets/images/menu/dhr/MHRP39N1222.svg +12 -0
  89. package/assets/images/menu/dhr/MHRP51N0001.svg +9 -0
  90. package/assets/images/menu/dhr/MHRP51N0002.svg +13 -0
  91. package/assets/images/menu/dhr/MHRP52N0001.svg +21 -0
  92. package/assets/images/menu/dhr/MHRP52N0002.svg +21 -0
  93. package/assets/images/menu/dhr/MHRP52N0003.svg +16 -0
  94. package/assets/images/menu/dhr/MHRP75N0001.svg +19 -0
  95. package/assets/images/menu/dhr/MHRP75N0002.svg +25 -0
  96. package/assets/images/menu/dhr/MHRP75N0003.svg +3 -0
  97. package/assets/images/menu/dhr/MHRP75N0006.svg +14 -0
  98. package/assets/images/menu/dhr/MHRP75N0007.svg +19 -0
  99. package/assets/images/menu/dhr/MHRP75N0008.svg +19 -0
  100. package/assets/images/menu/dhr/MHRP77N0007.svg +28 -0
  101. package/assets/images/menu/dhr/MHRP77N0008.svg +17 -0
  102. package/assets/images/menu/dhr/MHRP77N0009.svg +19 -0
  103. package/assets/images/menu/dhr/MHRP77N0010.svg +20 -0
  104. package/assets/images/menu/dhr/MHRP89N1000.svg +6 -0
  105. package/assets/images/menu/dhr/MHRP89N1001.svg +6 -0
  106. package/assets/images/menu/dhr/W00F0001.svg +3 -0
  107. package/assets/images/menu/dhr/W00F0002.svg +3 -0
  108. package/assets/images/menu/dhr/W00F0003.svg +3 -0
  109. package/assets/images/menu/dhr/W00F0004.svg +3 -0
  110. package/assets/images/menu/dhr/W00F0005.svg +1 -0
  111. package/assets/images/menu/dhr/W09F2000-WEB5.svg +17 -0
  112. package/assets/images/menu/dhr/W09F2000.svg +6 -0
  113. package/assets/images/menu/dhr/W09F2002-WEB5.svg +21 -0
  114. package/assets/images/menu/dhr/W09F2005-WEB5.svg +13 -0
  115. package/assets/images/menu/dhr/W09F2020-WEB5.svg +16 -0
  116. package/assets/images/menu/dhr/W09F2022-WEB5.svg +20 -0
  117. package/assets/images/menu/dhr/W09F2150-WEB5.svg +16 -0
  118. package/assets/images/menu/dhr/W09F2152-WEB5.svg +20 -0
  119. package/assets/images/menu/dhr/W09F2160-WEB5.svg +14 -0
  120. package/assets/images/menu/dhr/W09F2162-WEB5.svg +18 -0
  121. package/assets/images/menu/dhr/W29F4006-WEB5.svg +19 -0
  122. package/assets/images/menu/dhr/W75F2260-WEB5.svg +15 -0
  123. package/assets/images/menu/dhr/W75F2261-WEB5.svg +19 -0
  124. package/assets/images/menu/dhr/W75F3005-WEB5.svg +13 -0
  125. package/assets/images/menu/dhr/W75F4070-WEB5.svg +21 -0
  126. package/assets/images/menu/dhr/W75F4071-WEB5.svg +17 -0
  127. package/assets/images/menu/dhr/W75F4100-WEB5.svg +14 -0
  128. package/assets/images/menu/dhr/W77F1011.svg +19 -0
  129. package/assets/images/menu/dhr/W77F1013.svg +22 -0
  130. package/assets/images/menu/erp/W00F0001.svg +3 -0
  131. package/assets/images/menu/erp/W00F0002.svg +3 -0
  132. package/assets/images/menu/erp/W00F0003.svg +3 -0
  133. package/assets/images/menu/erp/W00F0004.svg +3 -0
  134. package/assets/images/menu/erp/W05F0001.svg +16 -0
  135. package/assets/images/menu/erp/W05F0001N0000.svg +16 -0
  136. package/assets/images/menu/erp/W05F0004N0000.svg +6 -0
  137. package/assets/images/menu/erp/W05F0006.svg +30 -0
  138. package/assets/images/menu/erp/W05F0007N0000.svg +6 -0
  139. package/assets/images/menu/erp/W05F0008.svg +14 -0
  140. package/assets/images/menu/erp/W05F4000.svg +9 -0
  141. package/assets/images/menu/erp/W06F0001.svg +17 -0
  142. package/assets/images/menu/erp/W06F0001N0000.svg +17 -0
  143. package/assets/images/menu/erp/W06F0004N0000.svg +22 -0
  144. package/assets/images/menu/erp/W06F0005.svg +22 -0
  145. package/assets/images/menu/erp/W06F0006.svg +55 -0
  146. package/assets/images/menu/erp/W06F0008.svg +17 -0
  147. package/assets/images/menu/erp/WA3F1025.svg +5 -0
  148. package/assets/images/menu/erp/WA3F2100.svg +10 -0
  149. package/components/accordion/context.js +6 -0
  150. package/components/accordion/css.js +159 -0
  151. package/components/accordion/details.js +60 -0
  152. package/components/accordion/group.js +122 -0
  153. package/components/accordion/index.js +117 -0
  154. package/components/accordion/summary.js +175 -0
  155. package/components/alert/index.js +264 -0
  156. package/components/alert/notify.js +192 -0
  157. package/components/avatar/index.js +556 -0
  158. package/components/badge/index.js +223 -0
  159. package/components/button/icon.js +493 -0
  160. package/components/button/index.js +653 -0
  161. package/components/button/more.js +135 -0
  162. package/components/button/ripple-effect.js +85 -0
  163. package/components/card/body-card.js +67 -0
  164. package/components/card/card.js +127 -0
  165. package/components/card/context.js +6 -0
  166. package/components/card/index.js +50 -0
  167. package/components/chart/Pie/Circle.js +50 -0
  168. package/components/chart/Pie/Sector.js +142 -0
  169. package/components/chart/Pie/Sectors.js +91 -0
  170. package/components/chart/Pie/index.js +311 -0
  171. package/components/chart/Pie-v2/Circle.js +50 -0
  172. package/components/chart/Pie-v2/Sector.js +128 -0
  173. package/components/chart/Pie-v2/Sectors.js +224 -0
  174. package/components/chart/Pie-v2/index.js +397 -0
  175. package/components/chart/bar/Axis.js +79 -0
  176. package/components/chart/bar/Bar.js +365 -0
  177. package/components/chart/bar/Grid.js +115 -0
  178. package/components/chart/bar/Labels.js +175 -0
  179. package/components/chart/bar/Points.js +111 -0
  180. package/components/chart/bar/index.js +172 -0
  181. package/components/chart/bar-v2/Axis.js +79 -0
  182. package/components/chart/bar-v2/Bar.js +374 -0
  183. package/components/chart/bar-v2/Grid.js +115 -0
  184. package/components/chart/bar-v2/Labels.js +175 -0
  185. package/components/chart/bar-v2/Points.js +111 -0
  186. package/components/chart/bar-v2/index.js +172 -0
  187. package/components/chart/line/Axis.js +79 -0
  188. package/components/chart/line/Grid.js +115 -0
  189. package/components/chart/line/Labels.js +172 -0
  190. package/components/chart/line/Path.js +163 -0
  191. package/components/chart/line/Point.js +348 -0
  192. package/components/chart/line/Title.js +56 -0
  193. package/components/chart/line/index.js +174 -0
  194. package/components/chart/line-v2/Axis.js +79 -0
  195. package/components/chart/line-v2/Grid.js +115 -0
  196. package/components/chart/line-v2/Labels.js +172 -0
  197. package/components/chart/line-v2/Path.js +163 -0
  198. package/components/chart/line-v2/Point.js +354 -0
  199. package/components/chart/line-v2/Title.js +56 -0
  200. package/components/chart/line-v2/index.js +174 -0
  201. package/components/check-text/index.js +157 -0
  202. package/components/check-text/interview-confirmation.js +172 -0
  203. package/components/check-text/interview-status.js +138 -0
  204. package/components/chip/attach.js +180 -0
  205. package/components/chip/index.js +340 -0
  206. package/components/collapse/index.js +67 -0
  207. package/components/dialogs/colors.js +11 -0
  208. package/components/divider/index.js +71 -0
  209. package/components/divider/style.js +12 -0
  210. package/components/form-control/attachment/index.js +1890 -0
  211. package/components/form-control/calendar/function.js +673 -0
  212. package/components/form-control/calendar/index.js +248 -0
  213. package/components/form-control/calendar/range.js +293 -0
  214. package/components/form-control/checkbox/index.js +306 -0
  215. package/components/form-control/control/index.js +92 -0
  216. package/components/form-control/date-picker/index-old.js +953 -0
  217. package/components/form-control/date-picker/index.js +676 -0
  218. package/components/form-control/date-range-picker/index.js +1305 -0
  219. package/components/form-control/dropdown/index.js +1865 -0
  220. package/components/form-control/dropdown-box/index.js +292 -0
  221. package/components/form-control/form/context.js +5 -0
  222. package/components/form-control/form/index.js +41 -0
  223. package/components/form-control/form-group/index.js +118 -0
  224. package/components/form-control/helper-text/index.js +71 -0
  225. package/components/form-control/input-base/index.js +733 -0
  226. package/components/form-control/label/index.js +73 -0
  227. package/components/form-control/money-input/index.js +491 -0
  228. package/components/form-control/number-input/index.js +633 -0
  229. package/components/form-control/phone-input/index.js +433 -0
  230. package/components/form-control/radio/index.js +263 -0
  231. package/components/form-control/text-input/index.js +523 -0
  232. package/components/form-control/time-picker/index.js +829 -0
  233. package/components/form-control/time-picker/swiper.js +590 -0
  234. package/components/form-control/toggle/index.js +250 -0
  235. package/components/form-view/helper-text.js +33 -0
  236. package/components/form-view/index.js +107 -0
  237. package/components/form-view/input.js +129 -0
  238. package/components/form-view/label.js +38 -0
  239. package/components/index.js +100 -0
  240. package/components/list/list-item-action.js +82 -0
  241. package/components/list/list-item-icon.js +76 -0
  242. package/components/list/list-item-text.js +57 -0
  243. package/components/list/list-item.js +114 -0
  244. package/components/list/list.js +155 -0
  245. package/components/list/sub-header.js +61 -0
  246. package/components/modal/body.js +71 -0
  247. package/components/modal/context.js +6 -0
  248. package/components/modal/footer.js +63 -0
  249. package/components/modal/header.js +108 -0
  250. package/components/modal/index.js +69 -0
  251. package/components/modal/modal.js +339 -0
  252. package/components/others/extra/index.js +124 -0
  253. package/components/others/scrollbar/index.js +95 -0
  254. package/components/paging/page-info.js +298 -0
  255. package/components/paging/page-selector.js +281 -0
  256. package/components/paper/index.js +119 -0
  257. package/components/popover/index.js +417 -0
  258. package/components/popup/danger_popup.js +215 -0
  259. package/components/popup/index.js +469 -0
  260. package/components/popup/proposals_popup.js +364 -0
  261. package/components/popup/v2/danger-popup.js +17 -0
  262. package/components/popup/v2/index.js +460 -0
  263. package/components/popup/v2/info-popup.js +17 -0
  264. package/components/popup/v2/success-popup.js +17 -0
  265. package/components/popup/v2/warning-popup.js +17 -0
  266. package/components/popup/v2/yes-no-popup.js +20 -0
  267. package/components/progress/circular.js +414 -0
  268. package/components/progress/linear.js +327 -0
  269. package/components/rating/index.js +392 -0
  270. package/components/slider/slider-container.js +356 -0
  271. package/components/slider/slider-item.js +183 -0
  272. package/components/status/index.js +123 -0
  273. package/components/tab/context.js +3 -0
  274. package/components/tab/tab-container.js +83 -0
  275. package/components/tab/tab-header.js +133 -0
  276. package/components/tab/tab-panel.js +51 -0
  277. package/components/tab/tab.js +206 -0
  278. package/components/tooltip/index.js +602 -0
  279. package/components/tooltip/portal.js +13 -0
  280. package/components/transfer/index.js +489 -0
  281. package/components/tree-view/css.js +94 -0
  282. package/components/tree-view/index.js +1009 -0
  283. package/components/typography/index.js +218 -0
  284. package/css/styles.css +1 -0
  285. package/css/styles.css.map +1 -0
  286. package/global/index.js +175 -0
  287. package/icons/basic.js +6326 -0
  288. package/icons/effect.js +171 -0
  289. package/icons/general/clock/clock.js +21 -0
  290. package/icons/general/color-handler/background.js +41 -0
  291. package/icons/general/color-handler/text.js +41 -0
  292. package/icons/general/emoji/emoji.js +35 -0
  293. package/icons/general/font-properties/bold.js +21 -0
  294. package/icons/general/font-properties/font-family.js +35 -0
  295. package/icons/general/font-properties/font-size.js +27 -0
  296. package/icons/general/font-properties/italic.js +21 -0
  297. package/icons/general/font-properties/underline.js +31 -0
  298. package/icons/general/hyperlink/hyperlink.js +38 -0
  299. package/icons/general/indent/decrease.js +55 -0
  300. package/icons/general/indent/increase.js +55 -0
  301. package/icons/general/index.js +21 -0
  302. package/icons/general/list/bullets.js +77 -0
  303. package/icons/general/list/numbering.js +71 -0
  304. package/icons/general/picture/picture.js +21 -0
  305. package/icons/general/steps/redo.js +21 -0
  306. package/icons/general/steps/undo.js +21 -0
  307. package/icons/general/text-align/center.js +21 -0
  308. package/icons/general/text-align/justify.js +21 -0
  309. package/icons/general/text-align/left.js +21 -0
  310. package/icons/general/text-align/right.js +21 -0
  311. package/icons/index.js +3 -0
  312. package/icons/menu/dhr.js +2440 -0
  313. package/icons/menu/erp.js +490 -0
  314. package/icons/menu/index.js +5 -0
  315. package/icons/menu/v2/index.js +52 -0
  316. package/locale/index.js +11 -0
  317. package/package.json +45 -0
  318. package/readme.md +517 -0
  319. package/styles/animation.js +890 -0
  320. package/styles/color-helper.js +504 -0
  321. package/styles/colors.js +306 -0
  322. package/styles/general.js +48 -0
  323. package/styles/media-queries.js +10 -0
  324. package/styles/typography.js +122 -0
  325. package/styles/utils.js +10 -0
  326. package/theme/index.js +5 -0
  327. package/theme/make-styles.js +95 -0
  328. package/theme/set-theme.js +39 -0
  329. package/theme/settings.js +230 -0
  330. package/theme/theme-provider.js +68 -0
  331. package/theme/theme.js +56 -0
  332. package/theme/with-styles.js +17 -0
  333. package/theme/with-theme.js +11 -0
  334. package/utils/array/array.js +186 -0
  335. package/utils/console.js +34 -0
  336. package/utils/date.js +471 -0
  337. package/utils/error/error.js +62 -0
  338. package/utils/error/errors.js +247 -0
  339. package/utils/getFileType.js +32 -0
  340. package/utils/index.js +23 -0
  341. package/utils/iterator.js +45 -0
  342. package/utils/map-parent.js +53 -0
  343. package/utils/number.js +64 -0
  344. package/utils/object/extend.js +57 -0
  345. package/utils/object/object.js +68 -0
  346. package/utils/parseHTML.js +8 -0
  347. package/utils/promisify.js +38 -0
  348. package/utils/randomString.js +33 -0
  349. package/utils/remove-unicode.js +6 -0
  350. package/utils/render-portal.js +90 -0
  351. package/utils/renderHTML.js +21 -0
  352. package/utils/renderIcon.js +57 -0
  353. package/utils/string/capitalize.js +3 -0
  354. package/utils/string/capitalizeSentenceCase.js +10 -0
  355. package/utils/string/string.js +81 -0
  356. package/utils/type.js +90 -0
  357. package/utils/updatePosition.js +36 -0
  358. package/utils/useOnClickOutside.js +23 -0
  359. package/utils/usePortal.js +56 -0
  360. package/utils/validate.js +149 -0
@@ -0,0 +1,79 @@
1
+ /** @jsxRuntime classic */
2
+
3
+ /** @jsx jsx */
4
+ import PropTypes from "prop-types";
5
+ import { jsx } from '@emotion/core';
6
+
7
+ const Axis = ({
8
+ axisColor,
9
+ axisVisible,
10
+ axisWidth,
11
+ getX,
12
+ getY,
13
+ maxX,
14
+ maxY,
15
+ minX,
16
+ minY,
17
+ unitWidth
18
+ }) => {
19
+ // drawn Oxygen coordinate systems for width and height are entered or by default
20
+ return axisVisible ? jsx("g", {
21
+ className: 'DGN-Axis-LineChart',
22
+ stroke: axisColor,
23
+ strokeWidth: axisWidth
24
+ }, jsx("line", {
25
+ x1: getX(minX),
26
+ y1: getY(minY),
27
+ x2: getX(maxX + unitWidth + 0.5),
28
+ y2: getY(minY)
29
+ }), jsx("line", {
30
+ x1: getX(minX),
31
+ y1: getY(minX),
32
+ x2: getX(minX),
33
+ y2: getY(maxY + 10)
34
+ })) : null;
35
+ };
36
+
37
+ Axis.defaultProps = {
38
+ axisColor: '#7F828E',
39
+ axisVisible: true,
40
+ axisWidth: 0.5,
41
+ getX: x => x,
42
+ getY: quantity => quantity,
43
+ unitWidth: 1
44
+ };
45
+ Axis.propTypes = {
46
+ /** the axisColor change color */
47
+ axisColor: PropTypes.string,
48
+
49
+ /** the axisOpacity property sets the opacity of an element*/
50
+ axisOpacity: PropTypes.number,
51
+
52
+ /** the axisVisible Hide or show the Axis axis */
53
+ axisVisible: PropTypes.bool,
54
+
55
+ /** the axisWidth change the thickness of the column */
56
+ axisWidth: PropTypes.number,
57
+
58
+ /** the getX position x on Ox*/
59
+ getX: PropTypes.func,
60
+
61
+ /** the getY position y on Oy */
62
+ getY: PropTypes.func,
63
+
64
+ /** the maxX is maximum of Ox quantity returned by data*/
65
+ maxX: PropTypes.number,
66
+
67
+ /** the maxY is maximum of Oy quantity returned by data*/
68
+ maxY: PropTypes.number,
69
+
70
+ /** the minX is minimum of OX quantity returned by data*/
71
+ minX: PropTypes.number,
72
+
73
+ /** the minY is minimum of Oy quantity returned by data*/
74
+ minY: PropTypes.number,
75
+
76
+ /** the unitWidth */
77
+ unitWidth: PropTypes.number
78
+ };
79
+ export default Axis;
@@ -0,0 +1,115 @@
1
+ /** @jsxRuntime classic */
2
+
3
+ /** @jsx jsx */
4
+ import PropTypes from "prop-types";
5
+ import { jsx } from '@emotion/core';
6
+
7
+ const Grid = ({
8
+ getX,
9
+ getY,
10
+ gridColor,
11
+ GridLines,
12
+ gridWidth,
13
+ labelsCountY,
14
+ maxX,
15
+ maxY,
16
+ minX,
17
+ minY,
18
+ unitWidth
19
+ }) => {
20
+ let gridX = [];
21
+ let gridY = [];
22
+
23
+ for (let i = minX; i <= maxX; i++) {
24
+ gridX.push(jsx("line", {
25
+ key: i,
26
+ x1: getX(i + unitWidth / 1.5),
27
+ y1: getY(minY),
28
+ x2: getX(i + unitWidth / 1.5),
29
+ y2: getY(maxY + 10)
30
+ }));
31
+ }
32
+
33
+ const yStep = labelsCountY > 0 ? labelsCountY : unitWidth;
34
+
35
+ for (let i = minY; i <= maxY; i += Math.floor(maxY / yStep)) {
36
+ gridY.push(jsx("line", {
37
+ key: i,
38
+ x1: getX(minX),
39
+ y1: getY(i),
40
+ x2: getX(maxX + unitWidth + 0.5),
41
+ y2: getY(i)
42
+ }));
43
+ }
44
+
45
+ if (GridLines === 'full') {
46
+ return jsx("g", {
47
+ className: 'DGN-Grid-LineChart',
48
+ stroke: gridColor,
49
+ strokeWidth: gridWidth
50
+ }, gridX, gridY);
51
+ }
52
+
53
+ if (GridLines === 'horizontal') {
54
+ return jsx("g", {
55
+ className: 'DGN-Grid-LineChart',
56
+ stroke: gridColor,
57
+ strokeWidth: gridWidth
58
+ }, gridY);
59
+ }
60
+
61
+ if (GridLines === 'none') {
62
+ return null;
63
+ } else {
64
+ return jsx("g", {
65
+ className: 'DGN-Grid-LineChart',
66
+ stroke: gridColor,
67
+ strokeWidth: gridWidth
68
+ }, gridY);
69
+ }
70
+ };
71
+
72
+ Grid.propTypes = {
73
+ /** the getX position x on Ox*/
74
+ getX: PropTypes.func,
75
+
76
+ /** the getY position y on Oy */
77
+ getY: PropTypes.func,
78
+
79
+ /** change color of grid Line*/
80
+ gridColor: PropTypes.string,
81
+
82
+ /** change Line grid display style ['full' , 'horizontal', 'none'], default: 'full'*/
83
+ GridLines: PropTypes.string,
84
+
85
+ /** hiden or show grid Line*/
86
+ gridVisible: PropTypes.bool,
87
+ gridWidth: PropTypes.number,
88
+ labelsCountY: PropTypes.number,
89
+
90
+ /** the maxX is maximum of Ox quantity returned by data*/
91
+ maxX: PropTypes.number,
92
+
93
+ /** the maxY is maximum of Oy quantity returned by data*/
94
+ maxY: PropTypes.number,
95
+
96
+ /** the minX is minimum of OX quantity returned by data*/
97
+ minX: PropTypes.number,
98
+
99
+ /** the minY is minimum of Oy quantity returned by data*/
100
+ minY: PropTypes.number,
101
+
102
+ /** the unitWidth */
103
+ unitWidth: PropTypes.number
104
+ };
105
+ Grid.defaultProps = {
106
+ getX: x => x,
107
+ getY: y => y,
108
+ gridColor: 'rgba(127, 130, 142, 0.15)',
109
+ GridLines: 'full',
110
+ gridVisible: false,
111
+ gridWidth: 0.5,
112
+ labelsCountY: 5,
113
+ unitWidth: 1
114
+ };
115
+ export default Grid;
@@ -0,0 +1,172 @@
1
+ /** @jsxRuntime classic */
2
+
3
+ /** @jsx jsx */
4
+ import PropTypes from "prop-types";
5
+ import { jsx, css } from '@emotion/core';
6
+ import theme from '../../../theme/settings';
7
+
8
+ const Labels = ({
9
+ getX,
10
+ getY,
11
+ data,
12
+ labelsColor,
13
+ labelsCountY,
14
+ labelsFormatX,
15
+ labelsFormatY,
16
+ labelsHeightX,
17
+ labelsOffsetX,
18
+ labelStyle,
19
+ labelsOffsetY,
20
+ labelsVisible,
21
+ maxY,
22
+ minX,
23
+ unitWidth
24
+ }) => {
25
+ const FONT_SIZE = 12;
26
+ const labelContainerCSS = css`
27
+ transform: translate(0, ${labelsOffsetX}px);
28
+ `;
29
+ const Label = css`
30
+ align-items: center;
31
+ justify-content: center;
32
+ text-align: center;
33
+ `;
34
+ const LabelCSS = labelStyle === 'italic' ? css`
35
+ fill: ${theme.colors.secondary};
36
+ text-anchor: start;
37
+ font-size: ${FONT_SIZE}px;
38
+ font-family: ${theme.typography.fontFamily};
39
+ text-transform: capitalize;
40
+ cursor: pointer;
41
+ display: inline-block;
42
+ transform-box: fill-box;
43
+ transform: rotateZ(45deg);
44
+ ` : css`
45
+ color: ${theme.colors.secondary};
46
+ text-anchor: middle;
47
+ font-size: ${FONT_SIZE}px;
48
+ font-family: ${theme.typography.fontFamily};
49
+ text-transform: capitalize;
50
+ display: inline-block;
51
+ word-break: break-word;
52
+ `;
53
+
54
+ if (labelsVisible) {
55
+ let xLabels;
56
+ let yLabels;
57
+ let tile = 4;
58
+ let tile2 = 9;
59
+
60
+ const TiLe = () => {
61
+ if (viewBoxWidth >= 800) {
62
+ return tile;
63
+ } else {
64
+ return tile2;
65
+ }
66
+ };
67
+
68
+ xLabels = labelStyle === 'italic' ? data.map((point, x) => jsx("text", {
69
+ key: x,
70
+ css: LabelCSS,
71
+ fill: labelsColor,
72
+ x: getX(point.x + unitWidth / 1.5),
73
+ y: getY(0) + labelsHeightX
74
+ }, labelsFormatX(point.name))) : data.map((point, x) => jsx("foreignObject", {
75
+ key: x,
76
+ css: Label,
77
+ fill: labelsColor,
78
+ x: getX(point.x + unitWidth / TiLe()),
79
+ y: getY(0) + labelsHeightX,
80
+ width: "40",
81
+ height: "80"
82
+ }, jsx("span", {
83
+ css: LabelCSS
84
+ }, labelsFormatX(point.name))));
85
+ const yLabelsRange = [];
86
+ const yStep = labelsCountY > 0 ? labelsCountY : 1;
87
+
88
+ for (let i = 0; i <= maxY; i += Math.floor(maxY / yStep)) {
89
+ yLabelsRange.push(i);
90
+ }
91
+
92
+ yLabels = yLabelsRange.map(quantity => jsx("text", {
93
+ key: quantity,
94
+ fill: labelsColor,
95
+ x: getX(minX),
96
+ y: getY(quantity) + labelsHeightX / 3,
97
+ transform: `translate(-${labelsOffsetY}, 0)`,
98
+ textAnchor: "end",
99
+ style: {
100
+ fill: theme.colors.secondary,
101
+ fontSize: FONT_SIZE,
102
+ fontFamily: theme.typography.fontFamily
103
+ }
104
+ }, labelsFormatY(quantity)));
105
+ return jsx("g", {
106
+ className: 'DGN-Labels-LineChart'
107
+ }, xLabels && jsx("g", {
108
+ id: 'DGN-AxisX',
109
+ css: labelContainerCSS
110
+ }, xLabels), yLabels && jsx("g", {
111
+ id: 'DGN-AxisY'
112
+ }, yLabels));
113
+ } else {
114
+ return null;
115
+ }
116
+ };
117
+
118
+ Labels.defaultProps = {
119
+ getX: x => x,
120
+ getY: quantity => quantity,
121
+ labelsCharacterWidth: 10,
122
+ labelsColor: theme.colors.secondary,
123
+ labelsCountY: 5,
124
+ labelsFormatX: label => label,
125
+ labelsFormatY: quantity => quantity,
126
+ labelsHeightX: 5,
127
+ labelsOffsetX: 10,
128
+ labelsOffsetY: 10,
129
+ labelsStepX: 1,
130
+ labelsVisible: true,
131
+ unitWidth: 1,
132
+ labelStyle: 'italic'
133
+ };
134
+ Labels.propTypes = {
135
+ /** the getX position x on Ox*/
136
+ getX: PropTypes.func,
137
+
138
+ /** the getY position y on Oy */
139
+ getY: PropTypes.func,
140
+
141
+ /** the labelsColor change color */
142
+ labelsColor: PropTypes.string,
143
+
144
+ /** change style show of label ['', 'italic'], default: 'italic' */
145
+ labelStyle: PropTypes.string,
146
+ labelsCountY: PropTypes.number,
147
+ labelsFormatX: PropTypes.func,
148
+ labelsFormatY: PropTypes.func,
149
+ labelsHeightX: PropTypes.number,
150
+ labelsOffsetX: PropTypes.number,
151
+ labelsOffsetY: PropTypes.number,
152
+ labelsStepX: PropTypes.number,
153
+
154
+ /** change show or hiden of label */
155
+ labelsVisible: PropTypes.bool,
156
+
157
+ /** the maxX is maximum of Ox quantity returned by data*/
158
+ maxX: PropTypes.number,
159
+
160
+ /** the maxY is maximum of Oy quantity returned by data*/
161
+ maxY: PropTypes.number,
162
+
163
+ /** the minX is minimum of OX quantity returned by data*/
164
+ minX: PropTypes.number,
165
+
166
+ /** the minY is minimum of Oy quantity returned by data*/
167
+ minY: PropTypes.number,
168
+
169
+ /** the unitWidth */
170
+ unitWidth: PropTypes.number
171
+ };
172
+ export default Labels;
@@ -0,0 +1,163 @@
1
+ /** @jsxRuntime classic */
2
+
3
+ /** @jsx jsx */
4
+ import PropTypes from "prop-types";
5
+ import { jsx, css } from '@emotion/core';
6
+
7
+ const Path = ({
8
+ data,
9
+ getX,
10
+ getY,
11
+ Smooth,
12
+ PathVisible,
13
+ viewBoxWidth,
14
+ STROKE,
15
+ STROKEHover,
16
+ pathColor,
17
+ unitWidth
18
+ }) => {
19
+ const point = data.map(element => {
20
+ const x = getX(element.x + unitWidth / 1.5);
21
+ const y = getY(element.quantity);
22
+ return [x, y];
23
+ });
24
+ const Colors = data.map(element => {
25
+ const colors = element.color;
26
+ return colors;
27
+ });
28
+ const PathCSS = css`
29
+ stroke: ${pathColor};
30
+ stroke-width: ${STROKE};
31
+ stroke-linecap: round;
32
+ stroke-linejoin: round;
33
+ /* &:hover {
34
+ cursor: pointer;
35
+ stroke: ${pathColor};
36
+ stroke-linecap: round;
37
+ stroke-linejoin: round;
38
+ stroke-width: ${STROKEHover};
39
+ } */
40
+ `; // Properties of a line
41
+ // I: - pointA (array) [x,y]: coordinates
42
+ // - pointB (array) [x,y]: coordinates
43
+ // O: - (object) { length: l, angle: a }: properties of the line
44
+
45
+ const line = (pointA, pointB) => {
46
+ const lengthX = pointB[0] - pointA[0];
47
+ const lengthY = pointB[1] - pointA[1];
48
+ const Balance = 0.005 * Math.PI;
49
+ const Re = 0.38 * Math.PI;
50
+ let angle = Math.atan2(lengthY, lengthX);
51
+
52
+ if (angle < -0.32 * Math.PI) {
53
+ angle += Re; // make sure the returned angle is in the range of (-PI/2, 3PI/2]
54
+ }
55
+
56
+ if (angle > 0.16 * Math.PI) {
57
+ angle -= Balance;
58
+ } // console.log(angle);
59
+
60
+
61
+ return {
62
+ length: Math.sqrt(Math.pow(lengthX, 2) + Math.pow(lengthY, 2)),
63
+ angle
64
+ };
65
+ }; // Position of a control point
66
+ // I: - current (array) [x, y]: current point coordinates
67
+ // - previous (array) [x, y]: previous point coordinates
68
+ // - next (array) [x, y]: next point coordinates
69
+ // - reverse (boolean, optional): sets the direction
70
+ // O: - (array) [x,y]: a tuple of coordinates
71
+
72
+
73
+ const controlPoint = (current, previous, next, reverse) => {
74
+ // When 'current' is the first or last point of the array
75
+ // 'previous' or 'next' don't exist.
76
+ // Replace with 'current'
77
+ const c = current;
78
+ const p = previous ? previous : c;
79
+ const n = next ? next : c; // The smoothing ratio
80
+
81
+ const smoothing = 0.15; // Properties of the opposed-line
82
+
83
+ const o = line(p, n); // If is end-control-point, add PI to the angle to go backward
84
+
85
+ const rev = reverse ? Math.PI : 0; // The control point position is relative to the current point
86
+
87
+ const x = c[0] + Math.cos(o.angle + rev) * o.length * smoothing;
88
+ const y = c[1] + Math.sin(o.angle * 0.095 + rev) * o.length * smoothing;
89
+ return [x, y];
90
+ };
91
+
92
+ const svgPathRender = point => {
93
+ const d = point.reduce((acc, e, i, a) => {
94
+ if (i > 0) {
95
+ const cs = controlPoint(a[i - 1], a[i - 2], e);
96
+ const ce = controlPoint(e, a[i - 1], a[i + 1], true);
97
+ return `${acc} C ${cs[0]},${cs[1]} ${ce[0]},${ce[1]} ${e[0]},${e[1]}`;
98
+ } else {
99
+ return `${acc} M ${e[0]},${e[1]}`;
100
+ }
101
+ }, '');
102
+ return jsx("path", {
103
+ d: d,
104
+ css: PathCSS,
105
+ fill: "none"
106
+ });
107
+ };
108
+
109
+ const command = point => `L ${point[0]} ${point[1]} `;
110
+
111
+ const svgPath = points => {
112
+ // build the d attributes by looping over the points
113
+ const d = points.reduce((acc, point, i, a) => i === 0 // if first point
114
+ ? `M ${point[0]},${point[1]}` // else
115
+ : `${acc} ${command(point, i, a)}`, '');
116
+ return jsx("path", {
117
+ d: d,
118
+ css: PathCSS,
119
+ fill: "none"
120
+ });
121
+ };
122
+
123
+ return PathVisible ? jsx("g", {
124
+ className: 'DGN-Path-LineChart'
125
+ }, Smooth ? svgPathRender(point) : svgPath(point)) : null;
126
+ };
127
+
128
+ Path.defaultProps = {
129
+ data: PropTypes.arrayOf(PropTypes.shape({
130
+ x: PropTypes.number,
131
+ quantity: PropTypes.number
132
+ })).isRequired,
133
+
134
+ /** the getX position x on Ox*/
135
+ getX: PropTypes.func,
136
+
137
+ /** the getY position y on Oy */
138
+ getY: PropTypes.func,
139
+
140
+ /** The color of the line drawn is the default color according to the data returned from the API, otherwise it will be generated by the design. */
141
+ pathColor: PropTypes.string,
142
+
143
+ /** shows the line to be drawn */
144
+ PathVisible: PropTypes.bool,
145
+
146
+ /** show or hiden the line to be drawn smooth */
147
+ Smooth: PropTypes.bool,
148
+
149
+ /** the thickness of the line to be drawn */
150
+ STROKE: PropTypes.number,
151
+
152
+ /** the unitWidth */
153
+ unitWidth: PropTypes.number
154
+ };
155
+ Path.defaultProps = {
156
+ unitWidth: 1,
157
+ PathVisible: true,
158
+ pathColor: '#0095FF',
159
+ Smooth: false,
160
+ STROKE: 2,
161
+ STROKEHover: 3
162
+ };
163
+ export default Path;