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,50 @@
1
+ /** @jsxRuntime classic */
2
+
3
+ /** @jsx jsx */
4
+ import PropTypes from "prop-types";
5
+ import { memo, forwardRef } from 'react';
6
+ import { jsx } from '@emotion/core';
7
+ const Circle = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
8
+ center,
9
+ color,
10
+ onMouseEnter,
11
+ onMouseLeave,
12
+ onTouchEnd,
13
+ onTouchStart,
14
+ className,
15
+ radius,
16
+ strokeColor,
17
+ strokeWidth,
18
+ name,
19
+ quantity
20
+ }, ref) => {
21
+ return jsx("ellipse", {
22
+ cx: center,
23
+ cy: center,
24
+ fill: color,
25
+ className: className,
26
+ onMouseEnter: onMouseEnter,
27
+ onMouseLeave: onMouseLeave,
28
+ onTouchEnd: onTouchEnd,
29
+ onTouchStart: onTouchStart,
30
+ rx: radius,
31
+ ry: radius,
32
+ stroke: strokeColor,
33
+ strokeWidth: strokeWidth
34
+ }, name);
35
+ }));
36
+ Circle.propTypes = {
37
+ className: PropTypes.string,
38
+ onMouseEnter: PropTypes.func,
39
+ onMouseLeave: PropTypes.func,
40
+ onTouchEnd: PropTypes.func,
41
+ onTouchStart: PropTypes.func,
42
+ center: PropTypes.number.isRequired,
43
+ color: PropTypes.string.isRequired,
44
+ radius: PropTypes.number.isRequired,
45
+ strokeColor: PropTypes.string,
46
+ strokeWidth: PropTypes.number,
47
+ name: PropTypes.string,
48
+ quantity: PropTypes.number
49
+ };
50
+ export default Circle;
@@ -0,0 +1,128 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ /** @jsxRuntime classic */
4
+
5
+ /** @jsx jsx */
6
+ import { useRef, memo, forwardRef } from 'react';
7
+ import PropTypes from "prop-types";
8
+ import { jsx, css } from '@emotion/core';
9
+ const Sector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
10
+ fill,
11
+ strokeColor,
12
+ strokeLinejoin,
13
+ strokeWidth,
14
+ onTouchStart,
15
+ onTouchEnd,
16
+ onMouseEnter,
17
+ onMouseLeave,
18
+ expandOnHover,
19
+ expandedIndex,
20
+ renderSelectedItem,
21
+ className,
22
+ path,
23
+ name,
24
+ quantity,
25
+ href,
26
+ transitionDuration,
27
+ transitionTimingFunction,
28
+ transitionProperty,
29
+ ...props
30
+ }, ref) => {
31
+ let result;
32
+
33
+ if (!ref) {
34
+ ref = useRef(null);
35
+ }
36
+
37
+ const pathRef = useRef(null);
38
+ const SectorCSS = expandOnHover || expandedIndex >= 0 ? css`
39
+ transition-property: ${transitionProperty};
40
+ cursor: pointer;
41
+ transition-timing-function: ${transitionTimingFunction};
42
+ transition-duration: ${transitionDuration};
43
+ &:hover {
44
+ box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.5), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
45
+ filter: drop-shadow( 0.05rem 0.05rem 0.1rem rgba(0, 0, 0, 0.5));
46
+ }
47
+ ` : css`
48
+ transition-property: all;
49
+ cursor: pointer;
50
+ transition-timing-function: ${transitionTimingFunction};
51
+ transition-duration: ${transitionDuration};
52
+ `;
53
+ const content = jsx("path", _extends({
54
+ d: path,
55
+ fill: fill,
56
+ ref: pathRef,
57
+ css: SectorCSS,
58
+ stroke: strokeColor,
59
+ className: className,
60
+ strokeWidth: strokeWidth,
61
+ strokeLinejoin: strokeLinejoin,
62
+ onTouchStart: onTouchStart,
63
+ onTouchEnd: onTouchEnd,
64
+ onMouseEnter: onMouseEnter,
65
+ onMouseLeave: onMouseLeave
66
+ }, props), renderSelectedItem);
67
+
68
+ if (href) {
69
+ result = jsx("a", {
70
+ href: href
71
+ }, content);
72
+ } else {
73
+ result = content;
74
+ }
75
+
76
+ return result;
77
+ }));
78
+ Sector.defaultProps = {
79
+ strokeColor: "#fff",
80
+ strokeWidth: 0,
81
+ strokeLinejoin: "round",
82
+ name: null,
83
+ quantity: null,
84
+ href: null,
85
+ transitionDuration: "0.5s",
86
+ transitionTimingFunction: "ease-in",
87
+ transitionProperty: 'd'
88
+ };
89
+ Sector.propTypes = {
90
+ /** the fill change color of pie chart */
91
+ fill: PropTypes.string.isRequired,
92
+
93
+ /** event click mouse in pie chart */
94
+ onMouseEnter: PropTypes.func,
95
+
96
+ /** event leave mouse in pie chart */
97
+ onMouseLeave: PropTypes.func,
98
+ onTouchEnd: PropTypes.func,
99
+ onTouchStart: PropTypes.func,
100
+
101
+ /** function displays selected items by custom, example:<br/>
102
+ * renderItem={(data, index) => index + ' - ' + data.name}<br/>
103
+ */
104
+ renderSelectedItem: PropTypes.func,
105
+ path: PropTypes.string.isRequired,
106
+
107
+ /** the StrokeColor change color border and Stroke */
108
+ strokeColor: PropTypes.string,
109
+
110
+ /** it can be applied to any element but it has effect only on the following nine */
111
+ strokeLinejoin: PropTypes.string,
112
+
113
+ /** The strokeWidth attribute is a presentation attribute defining the width of the stroke to be applied to the shape */
114
+ strokeWidth: PropTypes.number,
115
+
116
+ /** The title is add from the data */
117
+ name: PropTypes.string,
118
+ quantity: PropTypes.number,
119
+ href: PropTypes.string,
120
+
121
+ /** The transition-duration CSS property sets the length of time a transition animation should take to complete. Default 0.3s */
122
+ transitionDuration: PropTypes.string,
123
+
124
+ /** The transition-timing-function CSS property sets how intermediate values are calculated for CSS properties being affected*/
125
+ transitionTimingFunction: PropTypes.string,
126
+ className: PropTypes.string
127
+ };
128
+ export default Sector;
@@ -0,0 +1,224 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ /** @jsxRuntime classic */
4
+
5
+ /** @jsx jsx */
6
+ import { useState } from 'react';
7
+ import PropTypes from "prop-types";
8
+ import Sector from "./Sector";
9
+ import ReactDOMServer from 'react-dom/server';
10
+ import { jsx, css } from '@emotion/core';
11
+ import theme from '../../../theme/settings';
12
+ import { randomString, parseTextToHTML } from '../../../utils';
13
+
14
+ const Sectors = ({
15
+ center,
16
+ data,
17
+ onSectorHover,
18
+ expandSize,
19
+ strokeWidth,
20
+ strokeColor,
21
+ startAngle,
22
+ angleMargin,
23
+ strokeWidthTooltip,
24
+ strokeLinejoin,
25
+ transitionTimingFunction,
26
+ transitionProperty,
27
+ transitionDuration,
28
+ ...props
29
+ }) => {
30
+ const [id] = useState(randomString(6, {
31
+ allowNumber: false,
32
+ allowSymbol: false
33
+ }));
34
+ const [id1] = useState(randomString(6, {
35
+ allowNumber: false,
36
+ allowSymbol: false
37
+ }));
38
+ const total = data.reduce((prev, current) => current.quantity + prev, 0);
39
+ let angleStart = startAngle;
40
+ let angleEnd = startAngle;
41
+
42
+ const getPath = (d, i, e) => {
43
+ const anglePosition = (angleStart + angleEnd) / 2;
44
+ var rotateX = 0;
45
+ var rotateY = 0;
46
+ var xte = 0;
47
+ var yte = 0;
48
+
49
+ const measureText = (str, fontSize = 16) => {
50
+ const widths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2796875, 0.2765625, 0.3546875, 0.5546875, 0.5546875, 0.8890625, 0.665625, 0.190625, 0.3328125, 0.3328125, 0.3890625, 0.5828125, 0.2765625, 0.3328125, 0.2765625, 0.3015625, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.2765625, 0.2765625, 0.584375, 0.5828125, 0.584375, 0.5546875, 1.0140625, 0.665625, 0.665625, 0.721875, 0.721875, 0.665625, 0.609375, 0.7765625, 0.721875, 0.2765625, 0.5, 0.665625, 0.5546875, 0.8328125, 0.721875, 0.7765625, 0.665625, 0.7765625, 0.721875, 0.665625, 0.609375, 0.721875, 0.665625, 0.94375, 0.665625, 0.665625, 0.609375, 0.2765625, 0.3546875, 0.2765625, 0.4765625, 0.5546875, 0.3328125, 0.5546875, 0.5546875, 0.5, 0.5546875, 0.5546875, 0.2765625, 0.5546875, 0.5546875, 0.221875, 0.240625, 0.5, 0.221875, 0.8328125, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.3328125, 0.5, 0.2765625, 0.5546875, 0.5, 0.721875, 0.5, 0.5, 0.5, 0.3546875, 0.259375, 0.353125, 0.5890625];
51
+ const avg = 0.5279276315789471;
52
+ return str.split('').map(c => c.charCodeAt(0) < widths.length ? widths[c.charCodeAt(0)] : avg).reduce((cur, acc) => acc + cur) * fontSize;
53
+ };
54
+
55
+ const xPath = center + center * Math.cos(Math.PI * anglePosition / 180);
56
+ const yPath = center + center * Math.sin(Math.PI * anglePosition / 180);
57
+ const x1Path = center + center * 1.3 * Math.cos(Math.PI * anglePosition / 180);
58
+ const y1Path = center + center * 1.3 * Math.sin(Math.PI * anglePosition / 180);
59
+
60
+ if (anglePosition > 271 || anglePosition < 89) {
61
+ rotateX += x1Path + measureText((d.quantity / total * 100).toFixed(2) + '%') + 5;
62
+ rotateY += y1Path;
63
+ xte += x1Path + 30;
64
+ yte += y1Path - 6;
65
+ } else if (90 < anglePosition || anglePosition < 270) {
66
+ rotateX += x1Path - measureText((d.quantity / total * 100).toFixed(2) + '%') - 5;
67
+ rotateY += y1Path - 1;
68
+ xte += x1Path - 30;
69
+ yte += y1Path - 6;
70
+ }
71
+
72
+ const path1 = `
73
+ M${xPath},${yPath}
74
+ L${x1Path},${y1Path}
75
+ L${rotateX},${rotateY}
76
+ `;
77
+ const textChartCSS = css`
78
+ text-anchor: middle;
79
+ font-size: 16px;
80
+ font-family: ${theme.typography.fontFamily};
81
+ stroke-dasharray: 1000;
82
+ stroke-dashoffset: 1000;
83
+ animation: draw 8s ease-in-out forwards;
84
+ @keyframes draw {
85
+ to {
86
+ stroke-dashoffset: 0;
87
+ }
88
+ }
89
+ `;
90
+ const PathCSS = css`
91
+ cursor: pointer;
92
+ transition-timing-function: ${transitionTimingFunction};
93
+ transition-property: ${transitionProperty};
94
+ transition-duration: ${transitionDuration};
95
+ stroke-dasharray: 200;
96
+ stroke-dashoffset: 200;
97
+ animation: dash 1s linear forwards;
98
+ &:hover {
99
+ box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
100
+ filter: drop-shadow( 0.05rem 0.05rem 0.1rem rgba(0, 0, 0, 0.2));
101
+ }
102
+ @keyframes dash {
103
+ to {
104
+ stroke-dashoffset: 0;
105
+ }
106
+ }
107
+ `;
108
+ return jsx("g", {
109
+ key: "Path" + i
110
+ }, jsx("path", {
111
+ d: path1,
112
+ stroke: d.color,
113
+ css: PathCSS,
114
+ id: `${id}${i}`,
115
+ style: {
116
+ display: 'none'
117
+ },
118
+ strokeWidth: strokeWidthTooltip,
119
+ fill: 'none',
120
+ strokeLinejoin: strokeLinejoin
121
+ }), jsx("text", {
122
+ id: `${id1}${i}`,
123
+ x: xte,
124
+ y: yte,
125
+ style: {
126
+ display: 'none'
127
+ },
128
+ css: textChartCSS,
129
+ fill: d.color
130
+ }, (d.quantity / total * 100).toFixed(2), '%'));
131
+ };
132
+
133
+ return total > 0 ? jsx("g", null, data.map((d, i) => {
134
+ const isLarge = d.quantity / total > 0.5;
135
+ const angle = 360 * d.quantity / total;
136
+ const radius = center + (d.expanded === 'true' ? expandSize : 0) - strokeWidth / 2;
137
+ angleStart = angleEnd;
138
+ angleMargin = angleMargin > angle ? angle : angleMargin;
139
+ angleEnd = angleStart + angle - angleMargin;
140
+ const x1 = center + radius * Math.cos(Math.PI * angleStart / 180);
141
+ const y1 = center + radius * Math.sin(Math.PI * angleStart / 180);
142
+ const x2 = center + radius * Math.cos(Math.PI * angleEnd / 180);
143
+ const y2 = center + radius * Math.sin(Math.PI * angleEnd / 180);
144
+ const x = (x1 + x2) / 3;
145
+ const y = (y1 + y2) / 3;
146
+ const path = `
147
+ M${center},${center}
148
+ L${x1},${y1}
149
+ A${radius},${radius}
150
+ 0 ${isLarge ? 1 : 0},1
151
+ ${x2},${y2}
152
+ z
153
+ `;
154
+ angleEnd += angleMargin;
155
+
156
+ const MouseEnterTarget = (d, e, i) => {
157
+ if (onSectorHover) onSectorHover(d, i, e);
158
+ document.getElementById(`${id}` + i).style.display = 'block';
159
+ document.getElementById(`${id1}` + i).style.display = 'block';
160
+ };
161
+
162
+ const MouseLeaveTarget = (e, i) => {
163
+ if (onSectorHover) onSectorHover(null, null, e);
164
+ document.getElementById(`${id}` + i).style.display = 'none';
165
+ document.getElementById(`${id1}` + i).style.display = 'none';
166
+ };
167
+
168
+ return jsx("g", {
169
+ key: i,
170
+ id: "sector" + i
171
+ }, jsx(Sector, _extends({
172
+ key: "sector" + i,
173
+ fill: d.color,
174
+ path: path,
175
+ href: d.href,
176
+ strokeColor: strokeColor,
177
+ strokeWidth: strokeWidth,
178
+ total: total,
179
+ onMouseEnter: e => MouseEnterTarget(d, e, i),
180
+ onMouseLeave: e => MouseLeaveTarget(e, i),
181
+ onTouchEnd: e => onSectorHover(null, null, e),
182
+ onTouchStart: e => onSectorHover(d, i, e),
183
+ x: x + 15,
184
+ y: y + 16
185
+ }, props, d)), getPath(d, i));
186
+ })) : null;
187
+ };
188
+
189
+ Sectors.defaultProps = {
190
+ expandSize: 10,
191
+ strokeWidthTooltip: 2,
192
+ transitionTimingFunction: "ease-out",
193
+ strokeLinejoin: "round",
194
+ transitionProperty: 'd'
195
+ };
196
+ Sectors.propTypes = {
197
+ center: PropTypes.number.isRequired,
198
+
199
+ /** The array of elements that appear in the PieChart */
200
+ data: PropTypes.arrayOf(PropTypes.shape({
201
+ color: PropTypes.string.isRequired,
202
+ name: PropTypes.string,
203
+ quantity: PropTypes.number.isRequired
204
+ })).isRequired,
205
+
206
+ /** returns the data of the object to be hover */
207
+ onSectorHover: PropTypes.func,
208
+
209
+ /** the Size expand On Hover */
210
+ expandSize: PropTypes.number,
211
+
212
+ /** the StrokeWidth change color border and Stroke */
213
+ strokeColor: Sector.propTypes.strokeColor,
214
+
215
+ /** The strokeWidth attribute is a presentation attribute defining the width of the stroke to be applied to the shape */
216
+ strokeWidth: Sector.propTypes.strokeWidth,
217
+
218
+ /** The starting angle is drawn in a circle from data first */
219
+ startAngle: PropTypes.number,
220
+
221
+ /** */
222
+ angleMargin: PropTypes.number
223
+ };
224
+ export default Sectors;
@@ -0,0 +1,397 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ /** @jsxRuntime classic */
4
+
5
+ /** @jsx jsx */
6
+ import { useState, useRef, memo, forwardRef } from 'react';
7
+ import PropTypes from "prop-types";
8
+ import theme from '../../../theme/settings';
9
+ import { jsx, css } from '@emotion/core';
10
+ import Typography from '../../typography';
11
+ import { randomString } from '../../../utils';
12
+ import Circle from "./Circle";
13
+ import Sectors from "./Sectors";
14
+ import Sector from "./Sector";
15
+ const PieChart = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
16
+ expandOnHover,
17
+ renderSelectedItem,
18
+ type,
19
+ viewData,
20
+ onSectorHover,
21
+ expandSize,
22
+ data,
23
+ title,
24
+ Donut,
25
+ viewBoxSize,
26
+ width,
27
+ height,
28
+ ...props
29
+ }, ref) => {
30
+ const [id1] = useState(randomString(6, {
31
+ allowLowercase: false,
32
+ allowUppercase: false,
33
+ allowSymbol: false
34
+ }));
35
+ const [id2] = useState(randomString(6, {
36
+ allowLowercase: false,
37
+ allowUppercase: false,
38
+ allowSymbol: false
39
+ }));
40
+ const [id3] = useState(randomString(6, {
41
+ allowLowercase: false,
42
+ allowUppercase: false,
43
+ allowSymbol: false
44
+ }));
45
+
46
+ if (data[0] && !data[0].color) {
47
+ var colors = [];
48
+ let Count = data.length;
49
+
50
+ while (colors.length < Count) {
51
+ do {
52
+ var makeColorCode = '0123456789ABCDEF';
53
+ var code = '#';
54
+
55
+ for (var count = 0; count < 6; count++) {
56
+ code = code + makeColorCode[Math.floor(Math.random() * 16)];
57
+ }
58
+ } while (colors.indexOf(code) >= 0);
59
+
60
+ colors.push("#" + ("000000" + code.toString(16)).slice(-6));
61
+ }
62
+
63
+ for (let i in data) {
64
+ data[i].color = colors[i];
65
+ }
66
+ }
67
+
68
+ ;
69
+
70
+ const ZoomIn = () => {
71
+ let zoom = 0;
72
+ zoom = (width + height) / 2;
73
+ return zoom;
74
+ };
75
+
76
+ const svgCSS = css`
77
+ position: relative;
78
+ display: block;
79
+ margin: 0 auto;
80
+ overflow:hidden;
81
+ line-height:normal;
82
+ -webkit-tap-highlight-color:rgba(0, 0, 0, 0);
83
+ -ms-user-select:none;
84
+ -moz-user-select:none;
85
+ -webkit-user-select:none;
86
+ `;
87
+ const Pie = Donut ? css`
88
+ position: relative;
89
+ display: flex;
90
+ margin: 0 auto;
91
+ &:before{
92
+ content: '';
93
+ position: absolute;
94
+ display: block;
95
+ position: absolute;
96
+ display: flex;
97
+ top: 50%;
98
+ width: 50%;
99
+ height: 50%;
100
+ left: 50%;
101
+ transform: translate(-50%, -50%);
102
+ border-radius: 50%;
103
+ background-color: #111d5e;
104
+ }
105
+ ` : css`
106
+ position: relative;
107
+ display: flex;
108
+ margin: 0 auto;
109
+ `;
110
+ const dataCSS = css`
111
+ fill:rgba(0,0,0,0.54);
112
+ font-size: 16px;
113
+ font-family: ${theme.typography.fontFamily};
114
+ cursor:default;
115
+ `;
116
+ const padding1 = ZoomIn() / 10;
117
+ var padding = 0;
118
+
119
+ if (padding1 >= 60) {
120
+ padding += padding1 / 2;
121
+ } else {
122
+ padding += padding1;
123
+ }
124
+
125
+ const dem = data.length;
126
+ const position = (ZoomIn() - padding * 2) / dem;
127
+ const center = ZoomIn() / 4;
128
+ const dataWithValue = data.filter(d => d.quantity > 0);
129
+ const [isExpanded, setExpanded] = useState('false');
130
+ const expandedIndex = useRef(null);
131
+ const dataSource = data.map((item, i) => ({ ...item,
132
+ x: i * position
133
+ }));
134
+ const DataTitle = data.map((item, i) => ({ ...item,
135
+ x: position + i * 10
136
+ }));
137
+
138
+ const measureText = (str, fontSize = 16) => {
139
+ const widths = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2796875, 0.2765625, 0.3546875, 0.5546875, 0.5546875, 0.8890625, 0.665625, 0.190625, 0.3328125, 0.3328125, 0.3890625, 0.5828125, 0.2765625, 0.3328125, 0.2765625, 0.3015625, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.2765625, 0.2765625, 0.584375, 0.5828125, 0.584375, 0.5546875, 1.0140625, 0.665625, 0.665625, 0.721875, 0.721875, 0.665625, 0.609375, 0.7765625, 0.721875, 0.2765625, 0.5, 0.665625, 0.5546875, 0.8328125, 0.721875, 0.7765625, 0.665625, 0.7765625, 0.721875, 0.665625, 0.609375, 0.721875, 0.665625, 0.94375, 0.665625, 0.665625, 0.609375, 0.2765625, 0.3546875, 0.2765625, 0.4765625, 0.5546875, 0.3328125, 0.5546875, 0.5546875, 0.5, 0.5546875, 0.5546875, 0.2765625, 0.5546875, 0.5546875, 0.221875, 0.240625, 0.5, 0.221875, 0.8328125, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.3328125, 0.5, 0.2765625, 0.5546875, 0.5, 0.721875, 0.5, 0.5, 0.5, 0.3546875, 0.259375, 0.353125, 0.5890625];
140
+ const avg = 0.5279276315789471;
141
+ return str.split('').map(c => c.charCodeAt(0) < widths.length ? widths[c.charCodeAt(0)] : avg).reduce((cur, acc) => acc + cur) * fontSize;
142
+ };
143
+
144
+ const handleSectorHover = (data, index, e) => {
145
+ if (expandOnHover) {
146
+ setExpanded({
147
+ isExpanded: data ? 'true' : 'false'
148
+ });
149
+ expandedIndex.current = index !== null ? index : props.expandedIndex > -1 ? props.expandedIndex : null;
150
+ }
151
+
152
+ if (onSectorHover) {
153
+ onSectorHover(data, index, e);
154
+ }
155
+ };
156
+
157
+ const renderSingleData = (d, center) => {
158
+ return jsx(Circle, _extends({
159
+ center: center,
160
+ radius: center + (d.expanded || expandOnHover && expandedIndex === 0 ? expandSize : 0),
161
+ color: d.color,
162
+ onMouseEnter: e => handleSectorHover(d, 0, e),
163
+ onMouseLeave: e => handleSectorHover(null, null, e),
164
+ onTouchEnd: e => handleSectorHover(null, null, e),
165
+ onTouchStart: e => handleSectorHover(d, 0, e)
166
+ }, d));
167
+ };
168
+
169
+ const renderMultipleData = center => {
170
+ return jsx(Sectors, _extends({
171
+ center: center,
172
+ data: expandOnHover ? data.map((d, i) => ({ ...d,
173
+ expanded: `${isExpanded ? i === expandedIndex.current : i === props.expandedIndex}`
174
+ })) : data.map((d, i) => ({ ...d,
175
+ expanded: `${i === props.expandedIndex}`
176
+ }))
177
+ }, props, {
178
+ expandSize: expandSize,
179
+ expandOnHover: expandOnHover,
180
+ renderSelectedItem: renderSelectedItem,
181
+ onSectorHover: handleSectorHover
182
+ }));
183
+ };
184
+
185
+ return jsx("div", {
186
+ ref: ref,
187
+ className: `DGN-CUI-Container-PieChart`
188
+ }, dataWithValue && dataWithValue.length > 0 ? jsx("svg", {
189
+ width: ZoomIn(),
190
+ height: ZoomIn(),
191
+ css: svgCSS,
192
+ direction: "ltr"
193
+ }, jsx("defs", null, jsx("filter", {
194
+ id: `DGN_${id3}`,
195
+ x: "-50%",
196
+ y: "-50%",
197
+ width: "200%",
198
+ height: "200%",
199
+ transform: "translate(0,0)"
200
+ }, jsx("feGaussianBlur", {
201
+ in: "SourceGraphic",
202
+ result: "gaussianBlurResult",
203
+ stdDeviation: "3"
204
+ }), jsx("feOffset", {
205
+ in: "gaussianBlurResult",
206
+ result: "offsetResult",
207
+ dx: "2",
208
+ dy: "6"
209
+ }), jsx("feComposite", {
210
+ in: "floodResult",
211
+ in2: "offsetResult",
212
+ operator: "in",
213
+ result: "compositeResult"
214
+ }), jsx("feComposite", {
215
+ in: "SourceGraphic",
216
+ in2: "compositeResult",
217
+ operator: "over"
218
+ })), jsx("clipPath", {
219
+ id: `DGN_${id1}`
220
+ }, jsx("rect", {
221
+ x: "0",
222
+ y: "0",
223
+ width: ZoomIn(),
224
+ height: ZoomIn(),
225
+ transform: "translate(0,0)"
226
+ })), jsx("clipPath", {
227
+ id: `DGN_${id2}`
228
+ }, jsx("rect", {
229
+ x: "-141",
230
+ y: "-20",
231
+ width: "400",
232
+ height: "64",
233
+ transform: "translate(0,0)"
234
+ }))), jsx("rect", {
235
+ x: "0",
236
+ y: "0",
237
+ width: ZoomIn(),
238
+ height: ZoomIn(),
239
+ transform: "translate(0,0)",
240
+ fill: "gray",
241
+ opacity: "0.0001"
242
+ }), jsx("g", {
243
+ clipPath: `url(#DGN_${id2})`,
244
+ transform: `translate(${ZoomIn() / 2.5}, 30)`
245
+ }, jsx(Typography, {
246
+ type: 'title3',
247
+ fill: '#111d5e',
248
+ mapping: 'text'
249
+ }, title)), jsx("g", {
250
+ css: svgCSS,
251
+ transform: `translate(${ZoomIn() / 4}, ${ZoomIn() / 6})`
252
+ }, dataWithValue.length === 1 ? renderSingleData(dataWithValue[0], center) : renderMultipleData(center)), jsx("g", {
253
+ css: svgCSS,
254
+ transform: `translate(${ZoomIn() / 4}, ${ZoomIn() / 4})`
255
+ }, Donut ? jsx("circle", {
256
+ cx: center,
257
+ cy: center,
258
+ r: center / 1.5,
259
+ stroke: "none",
260
+ fill: "#fff"
261
+ }) : null), viewData ? jsx("g", {
262
+ clipPath: `url(#DGN_${id1})`,
263
+ transform: `translate(0,0)`
264
+ }, jsx("g", {
265
+ transform: `translate(${-padding}, ${ZoomIn() - 80})`
266
+ }, jsx("g", {
267
+ css: dataCSS
268
+ }, DataTitle.map((d, i) => {
269
+ return jsx("g", {
270
+ key: i,
271
+ transform: `translate(${5 - i * 10},${(d.x - position) * 2} )`,
272
+ className: 'item' + i
273
+ }, jsx("g", {
274
+ transform: `translate(${d.x - 20}, 0)`
275
+ }, jsx("rect", {
276
+ width: "8",
277
+ height: "8",
278
+ rx: "4",
279
+ fill: d.color
280
+ })), jsx(Typography, {
281
+ type: 'p3',
282
+ x: d.x,
283
+ y: "10",
284
+ mapping: 'text',
285
+ transform: "translate(0,0)",
286
+ fill: '#51A30'
287
+ }, d.name));
288
+ })))) : null) : jsx("svg", {
289
+ width: ZoomIn(),
290
+ height: ZoomIn(),
291
+ css: svgCSS,
292
+ direction: "ltr"
293
+ }, jsx("g", {
294
+ css: Pie,
295
+ transform: `translate(${ZoomIn() / 4}, ${ZoomIn() / 4})`
296
+ }, jsx("circle", {
297
+ cx: center,
298
+ cy: center,
299
+ r: center,
300
+ stroke: "none",
301
+ fill: "#AAACB4"
302
+ }), jsx(Typography, {
303
+ x: "25%",
304
+ y: "25%",
305
+ fill: ' #fff',
306
+ type: 'title1',
307
+ mapping: 'text',
308
+ textAnchor: "middle",
309
+ background: "#fff",
310
+ dy: ".3em"
311
+ }, "0%"))));
312
+ }));
313
+ PieChart.defaultProps = {
314
+ data: [],
315
+ type: 'h4',
316
+ title: '',
317
+ expandOnHover: true,
318
+ viewData: true,
319
+ name: null,
320
+ expandSize: Sectors.defaultProps.expandSize,
321
+ expandedIndex: -1,
322
+ onSectorHover: null,
323
+ strokeColor: Sector.defaultProps.strokeColor,
324
+ strokeLinejoin: Sector.defaultProps.strokeLinejoin,
325
+ strokeWidth: Sector.defaultProps.strokeWidth,
326
+ startAngle: 0,
327
+ angleMargin: 0,
328
+ width: 500,
329
+ height: 300,
330
+ Donut: false,
331
+ transitionDuration: Sector.defaultProps.transitionDuration,
332
+ transitionTimingFunction: Sector.defaultProps.transitionTimingFunction
333
+ };
334
+ PieChart.propTypes = {
335
+ /** the viewData will display information about the input data */
336
+ viewData: PropTypes.bool,
337
+
338
+ /** drawn Ratio of Width entered by user, default is: 900px */
339
+ width: PropTypes.number,
340
+
341
+ /** drawn Ratio of Height entered by user, default is: 500px */
342
+ height: PropTypes.number,
343
+
344
+ /** change from PieChart to DonutChart */
345
+ Donut: PropTypes.bool,
346
+
347
+ /** Typography of font in core, default: h4 */
348
+ type: PropTypes.string,
349
+
350
+ /** The array of elements that appear in the PieChart */
351
+ data: PropTypes.arrayOf(PropTypes.shape({
352
+ color: PropTypes.string,
353
+ name: PropTypes.string,
354
+ quantity: PropTypes.number.isRequired,
355
+ href: PropTypes.string
356
+ })).isRequired,
357
+
358
+ /** the animation expand On Hover */
359
+ expandOnHover: PropTypes.bool,
360
+
361
+ /** the Size expand On Hover */
362
+ expandSize: PropTypes.number,
363
+
364
+ /** the specified position is hovering by default */
365
+ expandedIndex: PropTypes.number,
366
+
367
+ /** returns the data of the object to be hover */
368
+ onSectorHover: PropTypes.func,
369
+
370
+ /** the StrokeWidth change color border and Stroke */
371
+ strokeColor: Sector.propTypes.strokeColor,
372
+
373
+ /** it can be applied to any element but it has effect only on the following nine */
374
+ strokeLinejoin: Sector.propTypes.strokeLinejoin,
375
+
376
+ /** The strokeWidth attribute is a presentation attribute defining the width of the stroke to be applied to the shape */
377
+ strokeWidth: Sector.propTypes.strokeWidth,
378
+
379
+ /** The starting angle is drawn in a circle from data first */
380
+ startAngle: PropTypes.number,
381
+
382
+ /** */
383
+ angleMargin: PropTypes.number,
384
+
385
+ /** The viewBox attribute defines the position and dimension, in user space, of an SVG viewport */
386
+ viewBoxSize: PropTypes.number,
387
+
388
+ /** The transition-duration CSS property sets the length of time a transition animation should take to complete. Default 0.3s */
389
+ transitionDuration: Sector.propTypes.transitionDuration,
390
+
391
+ /** The transition-timing-function CSS property sets how intermediate values are calculated for CSS properties being affected*/
392
+ transitionTimingFunction: Sector.propTypes.transitionTimingFunction,
393
+
394
+ /** The title is add from the data */
395
+ name: Sector.propTypes.name
396
+ };
397
+ export default PieChart;