@erpsquad/common 1.8.7 → 1.8.9

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 (560) hide show
  1. package/dist/_virtual/ArrowDropDown/index.esm.js +5 -0
  2. package/dist/_virtual/ArrowDropDown/index.esm.js.map +1 -0
  3. package/dist/_virtual/ArrowDropDown/index.js +2 -0
  4. package/dist/_virtual/ArrowDropDown/index.js.map +1 -0
  5. package/dist/_virtual/ArrowDropUp/index.esm.js +5 -0
  6. package/dist/_virtual/ArrowDropUp/index.esm.js.map +1 -0
  7. package/dist/_virtual/ArrowDropUp/index.js +2 -0
  8. package/dist/_virtual/ArrowDropUp/index.js.map +1 -0
  9. package/dist/components/Dashboard/dashboard-card/index.esm.js +17 -0
  10. package/dist/components/Dashboard/dashboard-card/index.esm.js.map +1 -0
  11. package/dist/components/Dashboard/dashboard-card/index.js +6 -0
  12. package/dist/components/Dashboard/dashboard-card/index.js.map +1 -0
  13. package/dist/components/Dashboard/dashboard-header/index.esm.js +68 -0
  14. package/dist/components/Dashboard/dashboard-header/index.esm.js.map +1 -0
  15. package/dist/components/Dashboard/dashboard-header/index.js +7 -0
  16. package/dist/components/Dashboard/dashboard-header/index.js.map +1 -0
  17. package/dist/components/activityLog/activity-log/index.esm.js +104 -0
  18. package/dist/components/activityLog/activity-log/index.esm.js.map +1 -0
  19. package/dist/components/activityLog/activity-log/index.js +14 -0
  20. package/dist/components/activityLog/activity-log/index.js.map +1 -0
  21. package/dist/components/charts/ChartLegends/index.esm.js +31 -0
  22. package/dist/components/charts/ChartLegends/index.esm.js.map +1 -0
  23. package/dist/components/charts/ChartLegends/index.js +5 -0
  24. package/dist/components/charts/ChartLegends/index.js.map +1 -0
  25. package/dist/components/charts/areaLinerChart/index.esm.js +110 -0
  26. package/dist/components/charts/areaLinerChart/index.esm.js.map +1 -0
  27. package/dist/components/charts/areaLinerChart/index.js +4 -0
  28. package/dist/components/charts/areaLinerChart/index.js.map +1 -0
  29. package/dist/components/charts/bar-chart/bar-chart/index.esm.js +85 -0
  30. package/dist/components/charts/bar-chart/bar-chart/index.esm.js.map +1 -0
  31. package/dist/components/charts/bar-chart/bar-chart/index.js +2 -0
  32. package/dist/components/charts/bar-chart/bar-chart/index.js.map +1 -0
  33. package/dist/components/charts/barChart/barChart/index.esm.js +147 -0
  34. package/dist/components/charts/barChart/barChart/index.esm.js.map +1 -0
  35. package/dist/components/charts/barChart/barChart/index.js +2 -0
  36. package/dist/components/charts/barChart/barChart/index.js.map +1 -0
  37. package/dist/components/charts/barLineChart/barLinechart/index.esm.js +193 -0
  38. package/dist/components/charts/barLineChart/barLinechart/index.esm.js.map +1 -0
  39. package/dist/components/charts/barLineChart/barLinechart/index.js +11 -0
  40. package/dist/components/charts/barLineChart/barLinechart/index.js.map +1 -0
  41. package/dist/components/charts/donut-chart/donut-chart/index.esm.js +85 -0
  42. package/dist/components/charts/donut-chart/donut-chart/index.esm.js.map +1 -0
  43. package/dist/components/charts/donut-chart/donut-chart/index.js +6 -0
  44. package/dist/components/charts/donut-chart/donut-chart/index.js.map +1 -0
  45. package/dist/components/charts/donutChart/DonutChart/index.esm.js +96 -0
  46. package/dist/components/charts/donutChart/DonutChart/index.esm.js.map +1 -0
  47. package/dist/components/charts/donutChart/DonutChart/index.js +5 -0
  48. package/dist/components/charts/donutChart/DonutChart/index.js.map +1 -0
  49. package/dist/components/charts/groupBarChart/GroupBarChart/index.esm.js +92 -0
  50. package/dist/components/charts/groupBarChart/GroupBarChart/index.esm.js.map +1 -0
  51. package/dist/components/charts/groupBarChart/GroupBarChart/index.js +2 -0
  52. package/dist/components/charts/groupBarChart/GroupBarChart/index.js.map +1 -0
  53. package/dist/components/charts/line-chart/area-lineChart/index.esm.js +55 -0
  54. package/dist/components/charts/line-chart/area-lineChart/index.esm.js.map +1 -0
  55. package/dist/components/charts/line-chart/area-lineChart/index.js +2 -0
  56. package/dist/components/charts/line-chart/area-lineChart/index.js.map +1 -0
  57. package/dist/components/charts/line-chart/line-chart/index.esm.js +108 -0
  58. package/dist/components/charts/line-chart/line-chart/index.esm.js.map +1 -0
  59. package/dist/components/charts/line-chart/line-chart/index.js +2 -0
  60. package/dist/components/charts/line-chart/line-chart/index.js.map +1 -0
  61. package/dist/components/charts/multiLineChart/multi-line-chart/index.esm.js +100 -0
  62. package/dist/components/charts/multiLineChart/multi-line-chart/index.esm.js.map +1 -0
  63. package/dist/components/charts/multiLineChart/multi-line-chart/index.js +2 -0
  64. package/dist/components/charts/multiLineChart/multi-line-chart/index.js.map +1 -0
  65. package/dist/components/filter/filter/index.esm.js +1 -1
  66. package/dist/components/filter/filter/index.js +6 -6
  67. package/dist/components/grid/custom-grid-card/custom-grid-card/index.esm.js +131 -0
  68. package/dist/components/grid/custom-grid-card/custom-grid-card/index.esm.js.map +1 -0
  69. package/dist/components/grid/custom-grid-card/custom-grid-card/index.js +11 -0
  70. package/dist/components/grid/custom-grid-card/custom-grid-card/index.js.map +1 -0
  71. package/dist/components/grid/grid-card/grid-card/index.esm.js +102 -0
  72. package/dist/components/grid/grid-card/grid-card/index.esm.js.map +1 -0
  73. package/dist/components/grid/grid-card/grid-card/index.js +12 -0
  74. package/dist/components/grid/grid-card/grid-card/index.js.map +1 -0
  75. package/dist/components/grid/grid-wrapper/grid-wrapper/index.esm.js +17 -0
  76. package/dist/components/grid/grid-wrapper/grid-wrapper/index.esm.js.map +1 -0
  77. package/dist/components/grid/grid-wrapper/grid-wrapper/index.js +5 -0
  78. package/dist/components/grid/grid-wrapper/grid-wrapper/index.js.map +1 -0
  79. package/dist/components/index.d.ts +54 -12
  80. package/dist/components/index.esm.js +479 -431
  81. package/dist/components/index.esm.js.map +1 -1
  82. package/dist/components/index.js +1 -1
  83. package/dist/components/material-table/material-table/index.esm.js +2 -2
  84. package/dist/components/material-table/material-table/index.js +4 -4
  85. package/dist/components/mulitline/multiline/index.esm.js +62 -0
  86. package/dist/components/mulitline/multiline/index.esm.js.map +1 -0
  87. package/dist/components/mulitline/multiline/index.js +13 -0
  88. package/dist/components/mulitline/multiline/index.js.map +1 -0
  89. package/dist/components/reports/dynamic-report/dynamic-report/index.esm.js +472 -0
  90. package/dist/components/reports/dynamic-report/dynamic-report/index.esm.js.map +1 -0
  91. package/dist/components/reports/dynamic-report/dynamic-report/index.js +8 -0
  92. package/dist/components/reports/dynamic-report/dynamic-report/index.js.map +1 -0
  93. package/dist/components/reports/dynamic-report/dynamic-rows/index.esm.js +201 -0
  94. package/dist/components/reports/dynamic-report/dynamic-rows/index.esm.js.map +1 -0
  95. package/dist/components/reports/dynamic-report/dynamic-rows/index.js +6 -0
  96. package/dist/components/reports/dynamic-report/dynamic-rows/index.js.map +1 -0
  97. package/dist/components/rfq-response/item-response-details/index.esm.js +91 -0
  98. package/dist/components/rfq-response/item-response-details/index.esm.js.map +1 -0
  99. package/dist/components/rfq-response/item-response-details/index.js +9 -0
  100. package/dist/components/rfq-response/item-response-details/index.js.map +1 -0
  101. package/dist/constants/index.d.ts +4 -1
  102. package/dist/constants/index.esm.js +2 -0
  103. package/dist/constants/index.esm.js.map +1 -1
  104. package/dist/constants/index.js +1 -1
  105. package/dist/index.esm.js +571 -523
  106. package/dist/index.esm.js.map +1 -1
  107. package/dist/index.js +1 -1
  108. package/dist/node_modules/@mui/icons-material/ArrowDropDown/index.esm.js +18 -0
  109. package/dist/node_modules/@mui/icons-material/ArrowDropDown/index.esm.js.map +1 -0
  110. package/dist/node_modules/@mui/icons-material/ArrowDropDown/index.js +2 -0
  111. package/dist/node_modules/@mui/icons-material/ArrowDropDown/index.js.map +1 -0
  112. package/dist/node_modules/@mui/icons-material/ArrowDropUp/index.esm.js +18 -0
  113. package/dist/node_modules/@mui/icons-material/ArrowDropUp/index.esm.js.map +1 -0
  114. package/dist/node_modules/@mui/icons-material/ArrowDropUp/index.js +2 -0
  115. package/dist/node_modules/@mui/icons-material/ArrowDropUp/index.js.map +1 -0
  116. package/dist/node_modules/d3-array/src/ascending/index.esm.js +7 -0
  117. package/dist/node_modules/d3-array/src/ascending/index.esm.js.map +1 -0
  118. package/dist/node_modules/d3-array/src/ascending/index.js +2 -0
  119. package/dist/node_modules/d3-array/src/ascending/index.js.map +1 -0
  120. package/dist/node_modules/d3-array/src/bisect/index.esm.js +11 -0
  121. package/dist/node_modules/d3-array/src/bisect/index.esm.js.map +1 -0
  122. package/dist/node_modules/d3-array/src/bisect/index.js +2 -0
  123. package/dist/node_modules/d3-array/src/bisect/index.js.map +1 -0
  124. package/dist/node_modules/d3-array/src/bisector/index.esm.js +48 -0
  125. package/dist/node_modules/d3-array/src/bisector/index.esm.js.map +1 -0
  126. package/dist/node_modules/d3-array/src/bisector/index.js +2 -0
  127. package/dist/node_modules/d3-array/src/bisector/index.js.map +1 -0
  128. package/dist/node_modules/d3-array/src/descending/index.esm.js +7 -0
  129. package/dist/node_modules/d3-array/src/descending/index.esm.js.map +1 -0
  130. package/dist/node_modules/d3-array/src/descending/index.js +2 -0
  131. package/dist/node_modules/d3-array/src/descending/index.js.map +1 -0
  132. package/dist/node_modules/d3-array/src/max/index.esm.js +22 -0
  133. package/dist/node_modules/d3-array/src/max/index.esm.js.map +1 -0
  134. package/dist/node_modules/d3-array/src/max/index.js +2 -0
  135. package/dist/node_modules/d3-array/src/max/index.js.map +1 -0
  136. package/dist/node_modules/d3-array/src/min/index.esm.js +22 -0
  137. package/dist/node_modules/d3-array/src/min/index.esm.js.map +1 -0
  138. package/dist/node_modules/d3-array/src/min/index.js +2 -0
  139. package/dist/node_modules/d3-array/src/min/index.js.map +1 -0
  140. package/dist/node_modules/d3-array/src/number/index.esm.js +7 -0
  141. package/dist/node_modules/d3-array/src/number/index.esm.js.map +1 -0
  142. package/dist/node_modules/d3-array/src/number/index.js +2 -0
  143. package/dist/node_modules/d3-array/src/number/index.js.map +1 -0
  144. package/dist/node_modules/d3-array/src/range/index.esm.js +12 -0
  145. package/dist/node_modules/d3-array/src/range/index.esm.js.map +1 -0
  146. package/dist/node_modules/d3-array/src/range/index.js +2 -0
  147. package/dist/node_modules/d3-array/src/range/index.js.map +1 -0
  148. package/dist/node_modules/d3-array/src/ticks/index.esm.js +52 -0
  149. package/dist/node_modules/d3-array/src/ticks/index.esm.js.map +1 -0
  150. package/dist/node_modules/d3-array/src/ticks/index.js +2 -0
  151. package/dist/node_modules/d3-array/src/ticks/index.js.map +1 -0
  152. package/dist/node_modules/d3-axis/src/axis/index.esm.js +99 -0
  153. package/dist/node_modules/d3-axis/src/axis/index.esm.js.map +1 -0
  154. package/dist/node_modules/d3-axis/src/axis/index.js +2 -0
  155. package/dist/node_modules/d3-axis/src/axis/index.js.map +1 -0
  156. package/dist/node_modules/d3-axis/src/identity/index.esm.js +7 -0
  157. package/dist/node_modules/d3-axis/src/identity/index.esm.js.map +1 -0
  158. package/dist/node_modules/d3-axis/src/identity/index.js +2 -0
  159. package/dist/node_modules/d3-axis/src/identity/index.js.map +1 -0
  160. package/dist/node_modules/d3-color/src/color/index.esm.js +339 -0
  161. package/dist/node_modules/d3-color/src/color/index.esm.js.map +1 -0
  162. package/dist/node_modules/d3-color/src/color/index.js +2 -0
  163. package/dist/node_modules/d3-color/src/color/index.js.map +1 -0
  164. package/dist/node_modules/d3-color/src/define/index.esm.js +14 -0
  165. package/dist/node_modules/d3-color/src/define/index.esm.js.map +1 -0
  166. package/dist/node_modules/d3-color/src/define/index.js +2 -0
  167. package/dist/node_modules/d3-color/src/define/index.js.map +1 -0
  168. package/dist/node_modules/d3-format/src/defaultLocale/index.esm.js +21 -0
  169. package/dist/node_modules/d3-format/src/defaultLocale/index.esm.js.map +1 -0
  170. package/dist/node_modules/d3-format/src/defaultLocale/index.js +2 -0
  171. package/dist/node_modules/d3-format/src/defaultLocale/index.js.map +1 -0
  172. package/dist/node_modules/d3-format/src/exponent/index.esm.js +8 -0
  173. package/dist/node_modules/d3-format/src/exponent/index.esm.js.map +1 -0
  174. package/dist/node_modules/d3-format/src/exponent/index.js +2 -0
  175. package/dist/node_modules/d3-format/src/exponent/index.js.map +1 -0
  176. package/dist/node_modules/d3-format/src/formatDecimal/index.esm.js +16 -0
  177. package/dist/node_modules/d3-format/src/formatDecimal/index.esm.js.map +1 -0
  178. package/dist/node_modules/d3-format/src/formatDecimal/index.js +2 -0
  179. package/dist/node_modules/d3-format/src/formatDecimal/index.js.map +1 -0
  180. package/dist/node_modules/d3-format/src/formatGroup/index.esm.js +16 -0
  181. package/dist/node_modules/d3-format/src/formatGroup/index.esm.js.map +1 -0
  182. package/dist/node_modules/d3-format/src/formatGroup/index.js +2 -0
  183. package/dist/node_modules/d3-format/src/formatGroup/index.js.map +1 -0
  184. package/dist/node_modules/d3-format/src/formatNumerals/index.esm.js +11 -0
  185. package/dist/node_modules/d3-format/src/formatNumerals/index.esm.js.map +1 -0
  186. package/dist/node_modules/d3-format/src/formatNumerals/index.js +2 -0
  187. package/dist/node_modules/d3-format/src/formatNumerals/index.js.map +1 -0
  188. package/dist/node_modules/d3-format/src/formatPrefixAuto/index.esm.js +13 -0
  189. package/dist/node_modules/d3-format/src/formatPrefixAuto/index.esm.js.map +1 -0
  190. package/dist/node_modules/d3-format/src/formatPrefixAuto/index.js +2 -0
  191. package/dist/node_modules/d3-format/src/formatPrefixAuto/index.js.map +1 -0
  192. package/dist/node_modules/d3-format/src/formatRounded/index.esm.js +11 -0
  193. package/dist/node_modules/d3-format/src/formatRounded/index.esm.js.map +1 -0
  194. package/dist/node_modules/d3-format/src/formatRounded/index.js +2 -0
  195. package/dist/node_modules/d3-format/src/formatRounded/index.js.map +1 -0
  196. package/dist/node_modules/d3-format/src/formatSpecifier/index.esm.js +38 -0
  197. package/dist/node_modules/d3-format/src/formatSpecifier/index.esm.js.map +1 -0
  198. package/dist/node_modules/d3-format/src/formatSpecifier/index.js +2 -0
  199. package/dist/node_modules/d3-format/src/formatSpecifier/index.js.map +1 -0
  200. package/dist/node_modules/d3-format/src/formatTrim/index.esm.js +22 -0
  201. package/dist/node_modules/d3-format/src/formatTrim/index.esm.js.map +1 -0
  202. package/dist/node_modules/d3-format/src/formatTrim/index.js +2 -0
  203. package/dist/node_modules/d3-format/src/formatTrim/index.js.map +1 -0
  204. package/dist/node_modules/d3-format/src/formatTypes/index.esm.js +22 -0
  205. package/dist/node_modules/d3-format/src/formatTypes/index.esm.js.map +1 -0
  206. package/dist/node_modules/d3-format/src/formatTypes/index.js +2 -0
  207. package/dist/node_modules/d3-format/src/formatTypes/index.js.map +1 -0
  208. package/dist/node_modules/d3-format/src/identity/index.esm.js +7 -0
  209. package/dist/node_modules/d3-format/src/identity/index.esm.js.map +1 -0
  210. package/dist/node_modules/d3-format/src/identity/index.js +2 -0
  211. package/dist/node_modules/d3-format/src/identity/index.js.map +1 -0
  212. package/dist/node_modules/d3-format/src/locale/index.esm.js +83 -0
  213. package/dist/node_modules/d3-format/src/locale/index.esm.js.map +1 -0
  214. package/dist/node_modules/d3-format/src/locale/index.js +2 -0
  215. package/dist/node_modules/d3-format/src/locale/index.js.map +1 -0
  216. package/dist/node_modules/d3-format/src/precisionFixed/index.esm.js +8 -0
  217. package/dist/node_modules/d3-format/src/precisionFixed/index.esm.js.map +1 -0
  218. package/dist/node_modules/d3-format/src/precisionFixed/index.js +2 -0
  219. package/dist/node_modules/d3-format/src/precisionFixed/index.js.map +1 -0
  220. package/dist/node_modules/d3-format/src/precisionPrefix/index.esm.js +8 -0
  221. package/dist/node_modules/d3-format/src/precisionPrefix/index.esm.js.map +1 -0
  222. package/dist/node_modules/d3-format/src/precisionPrefix/index.js +2 -0
  223. package/dist/node_modules/d3-format/src/precisionPrefix/index.js.map +1 -0
  224. package/dist/node_modules/d3-format/src/precisionRound/index.esm.js +9 -0
  225. package/dist/node_modules/d3-format/src/precisionRound/index.esm.js.map +1 -0
  226. package/dist/node_modules/d3-format/src/precisionRound/index.js +2 -0
  227. package/dist/node_modules/d3-format/src/precisionRound/index.js.map +1 -0
  228. package/dist/node_modules/d3-interpolate/src/array/index.esm.js +14 -0
  229. package/dist/node_modules/d3-interpolate/src/array/index.esm.js.map +1 -0
  230. package/dist/node_modules/d3-interpolate/src/array/index.js +2 -0
  231. package/dist/node_modules/d3-interpolate/src/array/index.js.map +1 -0
  232. package/dist/node_modules/d3-interpolate/src/color/index.esm.js +25 -0
  233. package/dist/node_modules/d3-interpolate/src/color/index.esm.js.map +1 -0
  234. package/dist/node_modules/d3-interpolate/src/color/index.js +2 -0
  235. package/dist/node_modules/d3-interpolate/src/color/index.js.map +1 -0
  236. package/dist/node_modules/d3-interpolate/src/constant/index.esm.js +5 -0
  237. package/dist/node_modules/d3-interpolate/src/constant/index.esm.js.map +1 -0
  238. package/dist/node_modules/d3-interpolate/src/constant/index.js +2 -0
  239. package/dist/node_modules/d3-interpolate/src/constant/index.js.map +1 -0
  240. package/dist/node_modules/d3-interpolate/src/date/index.esm.js +10 -0
  241. package/dist/node_modules/d3-interpolate/src/date/index.esm.js.map +1 -0
  242. package/dist/node_modules/d3-interpolate/src/date/index.js +2 -0
  243. package/dist/node_modules/d3-interpolate/src/date/index.js.map +1 -0
  244. package/dist/node_modules/d3-interpolate/src/number/index.esm.js +9 -0
  245. package/dist/node_modules/d3-interpolate/src/number/index.esm.js.map +1 -0
  246. package/dist/node_modules/d3-interpolate/src/number/index.js +2 -0
  247. package/dist/node_modules/d3-interpolate/src/number/index.js.map +1 -0
  248. package/dist/node_modules/d3-interpolate/src/numberArray/index.esm.js +16 -0
  249. package/dist/node_modules/d3-interpolate/src/numberArray/index.esm.js.map +1 -0
  250. package/dist/node_modules/d3-interpolate/src/numberArray/index.js +2 -0
  251. package/dist/node_modules/d3-interpolate/src/numberArray/index.js.map +1 -0
  252. package/dist/node_modules/d3-interpolate/src/object/index.esm.js +21 -0
  253. package/dist/node_modules/d3-interpolate/src/object/index.esm.js.map +1 -0
  254. package/dist/node_modules/d3-interpolate/src/object/index.js +2 -0
  255. package/dist/node_modules/d3-interpolate/src/object/index.js.map +1 -0
  256. package/dist/node_modules/d3-interpolate/src/rgb/index.esm.js +21 -0
  257. package/dist/node_modules/d3-interpolate/src/rgb/index.esm.js.map +1 -0
  258. package/dist/node_modules/d3-interpolate/src/rgb/index.js +2 -0
  259. package/dist/node_modules/d3-interpolate/src/rgb/index.js.map +1 -0
  260. package/dist/node_modules/d3-interpolate/src/round/index.esm.js +9 -0
  261. package/dist/node_modules/d3-interpolate/src/round/index.esm.js.map +1 -0
  262. package/dist/node_modules/d3-interpolate/src/round/index.js +2 -0
  263. package/dist/node_modules/d3-interpolate/src/round/index.js.map +1 -0
  264. package/dist/node_modules/d3-interpolate/src/string/index.esm.js +44 -0
  265. package/dist/node_modules/d3-interpolate/src/string/index.esm.js.map +1 -0
  266. package/dist/node_modules/d3-interpolate/src/string/index.js +2 -0
  267. package/dist/node_modules/d3-interpolate/src/string/index.js.map +1 -0
  268. package/dist/node_modules/d3-interpolate/src/value/index.esm.js +17 -0
  269. package/dist/node_modules/d3-interpolate/src/value/index.esm.js.map +1 -0
  270. package/dist/node_modules/d3-interpolate/src/value/index.js +2 -0
  271. package/dist/node_modules/d3-interpolate/src/value/index.js.map +1 -0
  272. package/dist/node_modules/d3-path/src/path/index.esm.js +89 -0
  273. package/dist/node_modules/d3-path/src/path/index.esm.js.map +1 -0
  274. package/dist/node_modules/d3-path/src/path/index.js +2 -0
  275. package/dist/node_modules/d3-path/src/path/index.js.map +1 -0
  276. package/dist/node_modules/d3-scale/src/band/index.esm.js +71 -0
  277. package/dist/node_modules/d3-scale/src/band/index.esm.js.map +1 -0
  278. package/dist/node_modules/d3-scale/src/band/index.js +2 -0
  279. package/dist/node_modules/d3-scale/src/band/index.js.map +1 -0
  280. package/dist/node_modules/d3-scale/src/constant/index.esm.js +9 -0
  281. package/dist/node_modules/d3-scale/src/constant/index.esm.js.map +1 -0
  282. package/dist/node_modules/d3-scale/src/constant/index.js +2 -0
  283. package/dist/node_modules/d3-scale/src/constant/index.js.map +1 -0
  284. package/dist/node_modules/d3-scale/src/continuous/index.esm.js +96 -0
  285. package/dist/node_modules/d3-scale/src/continuous/index.esm.js.map +1 -0
  286. package/dist/node_modules/d3-scale/src/continuous/index.js +2 -0
  287. package/dist/node_modules/d3-scale/src/continuous/index.js.map +1 -0
  288. package/dist/node_modules/d3-scale/src/init/index.esm.js +17 -0
  289. package/dist/node_modules/d3-scale/src/init/index.esm.js.map +1 -0
  290. package/dist/node_modules/d3-scale/src/init/index.js +2 -0
  291. package/dist/node_modules/d3-scale/src/init/index.js.map +1 -0
  292. package/dist/node_modules/d3-scale/src/linear/index.esm.js +62 -0
  293. package/dist/node_modules/d3-scale/src/linear/index.esm.js.map +1 -0
  294. package/dist/node_modules/d3-scale/src/linear/index.js +2 -0
  295. package/dist/node_modules/d3-scale/src/linear/index.js.map +1 -0
  296. package/dist/node_modules/d3-scale/src/number/index.esm.js +7 -0
  297. package/dist/node_modules/d3-scale/src/number/index.esm.js.map +1 -0
  298. package/dist/node_modules/d3-scale/src/number/index.js +2 -0
  299. package/dist/node_modules/d3-scale/src/number/index.js.map +1 -0
  300. package/dist/node_modules/d3-scale/src/ordinal/index.esm.js +39 -0
  301. package/dist/node_modules/d3-scale/src/ordinal/index.esm.js.map +1 -0
  302. package/dist/node_modules/d3-scale/src/ordinal/index.js +2 -0
  303. package/dist/node_modules/d3-scale/src/ordinal/index.js.map +1 -0
  304. package/dist/node_modules/d3-scale/src/tickFormat/index.esm.js +35 -0
  305. package/dist/node_modules/d3-scale/src/tickFormat/index.esm.js.map +1 -0
  306. package/dist/node_modules/d3-scale/src/tickFormat/index.js +2 -0
  307. package/dist/node_modules/d3-scale/src/tickFormat/index.js.map +1 -0
  308. package/dist/node_modules/d3-selection/src/array/index.esm.js +7 -0
  309. package/dist/node_modules/d3-selection/src/array/index.esm.js.map +1 -0
  310. package/dist/node_modules/d3-selection/src/array/index.js +2 -0
  311. package/dist/node_modules/d3-selection/src/array/index.js.map +1 -0
  312. package/dist/node_modules/d3-selection/src/constant/index.esm.js +9 -0
  313. package/dist/node_modules/d3-selection/src/constant/index.esm.js.map +1 -0
  314. package/dist/node_modules/d3-selection/src/constant/index.js +2 -0
  315. package/dist/node_modules/d3-selection/src/constant/index.js.map +1 -0
  316. package/dist/node_modules/d3-selection/src/creator/index.esm.js +21 -0
  317. package/dist/node_modules/d3-selection/src/creator/index.esm.js.map +1 -0
  318. package/dist/node_modules/d3-selection/src/creator/index.js +2 -0
  319. package/dist/node_modules/d3-selection/src/creator/index.js.map +1 -0
  320. package/dist/node_modules/d3-selection/src/matcher/index.esm.js +15 -0
  321. package/dist/node_modules/d3-selection/src/matcher/index.esm.js.map +1 -0
  322. package/dist/node_modules/d3-selection/src/matcher/index.js +2 -0
  323. package/dist/node_modules/d3-selection/src/matcher/index.js.map +1 -0
  324. package/dist/node_modules/d3-selection/src/namespace/index.esm.js +10 -0
  325. package/dist/node_modules/d3-selection/src/namespace/index.esm.js.map +1 -0
  326. package/dist/node_modules/d3-selection/src/namespace/index.js +2 -0
  327. package/dist/node_modules/d3-selection/src/namespace/index.js.map +1 -0
  328. package/dist/node_modules/d3-selection/src/namespaces/index.esm.js +13 -0
  329. package/dist/node_modules/d3-selection/src/namespaces/index.esm.js.map +1 -0
  330. package/dist/node_modules/d3-selection/src/namespaces/index.js +2 -0
  331. package/dist/node_modules/d3-selection/src/namespaces/index.js.map +1 -0
  332. package/dist/node_modules/d3-selection/src/pointer/index.esm.js +23 -0
  333. package/dist/node_modules/d3-selection/src/pointer/index.esm.js.map +1 -0
  334. package/dist/node_modules/d3-selection/src/pointer/index.js +2 -0
  335. package/dist/node_modules/d3-selection/src/pointer/index.js.map +1 -0
  336. package/dist/node_modules/d3-selection/src/select/index.esm.js +8 -0
  337. package/dist/node_modules/d3-selection/src/select/index.esm.js.map +1 -0
  338. package/dist/node_modules/d3-selection/src/select/index.js +2 -0
  339. package/dist/node_modules/d3-selection/src/select/index.js.map +1 -0
  340. package/dist/node_modules/d3-selection/src/selection/append/index.esm.js +11 -0
  341. package/dist/node_modules/d3-selection/src/selection/append/index.esm.js.map +1 -0
  342. package/dist/node_modules/d3-selection/src/selection/append/index.js +2 -0
  343. package/dist/node_modules/d3-selection/src/selection/append/index.js.map +1 -0
  344. package/dist/node_modules/d3-selection/src/selection/attr/index.esm.js +47 -0
  345. package/dist/node_modules/d3-selection/src/selection/attr/index.esm.js.map +1 -0
  346. package/dist/node_modules/d3-selection/src/selection/attr/index.js +2 -0
  347. package/dist/node_modules/d3-selection/src/selection/attr/index.js.map +1 -0
  348. package/dist/node_modules/d3-selection/src/selection/call/index.esm.js +10 -0
  349. package/dist/node_modules/d3-selection/src/selection/call/index.esm.js.map +1 -0
  350. package/dist/node_modules/d3-selection/src/selection/call/index.js +2 -0
  351. package/dist/node_modules/d3-selection/src/selection/call/index.js.map +1 -0
  352. package/dist/node_modules/d3-selection/src/selection/classed/index.esm.js +65 -0
  353. package/dist/node_modules/d3-selection/src/selection/classed/index.esm.js.map +1 -0
  354. package/dist/node_modules/d3-selection/src/selection/classed/index.js +2 -0
  355. package/dist/node_modules/d3-selection/src/selection/classed/index.js.map +1 -0
  356. package/dist/node_modules/d3-selection/src/selection/clone/index.esm.js +15 -0
  357. package/dist/node_modules/d3-selection/src/selection/clone/index.esm.js.map +1 -0
  358. package/dist/node_modules/d3-selection/src/selection/clone/index.js +2 -0
  359. package/dist/node_modules/d3-selection/src/selection/clone/index.js.map +1 -0
  360. package/dist/node_modules/d3-selection/src/selection/data/index.esm.js +77 -0
  361. package/dist/node_modules/d3-selection/src/selection/data/index.esm.js.map +1 -0
  362. package/dist/node_modules/d3-selection/src/selection/data/index.js +2 -0
  363. package/dist/node_modules/d3-selection/src/selection/data/index.js.map +1 -0
  364. package/dist/node_modules/d3-selection/src/selection/datum/index.esm.js +7 -0
  365. package/dist/node_modules/d3-selection/src/selection/datum/index.esm.js.map +1 -0
  366. package/dist/node_modules/d3-selection/src/selection/datum/index.js +2 -0
  367. package/dist/node_modules/d3-selection/src/selection/datum/index.js.map +1 -0
  368. package/dist/node_modules/d3-selection/src/selection/dispatch/index.esm.js +29 -0
  369. package/dist/node_modules/d3-selection/src/selection/dispatch/index.esm.js.map +1 -0
  370. package/dist/node_modules/d3-selection/src/selection/dispatch/index.js +2 -0
  371. package/dist/node_modules/d3-selection/src/selection/dispatch/index.js.map +1 -0
  372. package/dist/node_modules/d3-selection/src/selection/each/index.esm.js +12 -0
  373. package/dist/node_modules/d3-selection/src/selection/each/index.esm.js.map +1 -0
  374. package/dist/node_modules/d3-selection/src/selection/each/index.js +2 -0
  375. package/dist/node_modules/d3-selection/src/selection/each/index.js.map +1 -0
  376. package/dist/node_modules/d3-selection/src/selection/empty/index.esm.js +7 -0
  377. package/dist/node_modules/d3-selection/src/selection/empty/index.esm.js.map +1 -0
  378. package/dist/node_modules/d3-selection/src/selection/empty/index.js +2 -0
  379. package/dist/node_modules/d3-selection/src/selection/empty/index.js.map +1 -0
  380. package/dist/node_modules/d3-selection/src/selection/enter/index.esm.js +32 -0
  381. package/dist/node_modules/d3-selection/src/selection/enter/index.esm.js.map +1 -0
  382. package/dist/node_modules/d3-selection/src/selection/enter/index.js +2 -0
  383. package/dist/node_modules/d3-selection/src/selection/enter/index.js.map +1 -0
  384. package/dist/node_modules/d3-selection/src/selection/exit/index.esm.js +9 -0
  385. package/dist/node_modules/d3-selection/src/selection/exit/index.esm.js.map +1 -0
  386. package/dist/node_modules/d3-selection/src/selection/exit/index.js +2 -0
  387. package/dist/node_modules/d3-selection/src/selection/exit/index.js.map +1 -0
  388. package/dist/node_modules/d3-selection/src/selection/filter/index.esm.js +17 -0
  389. package/dist/node_modules/d3-selection/src/selection/filter/index.esm.js.map +1 -0
  390. package/dist/node_modules/d3-selection/src/selection/filter/index.js +2 -0
  391. package/dist/node_modules/d3-selection/src/selection/filter/index.js.map +1 -0
  392. package/dist/node_modules/d3-selection/src/selection/html/index.esm.js +21 -0
  393. package/dist/node_modules/d3-selection/src/selection/html/index.esm.js.map +1 -0
  394. package/dist/node_modules/d3-selection/src/selection/html/index.js +2 -0
  395. package/dist/node_modules/d3-selection/src/selection/html/index.js.map +1 -0
  396. package/dist/node_modules/d3-selection/src/selection/index/index.esm.js +85 -0
  397. package/dist/node_modules/d3-selection/src/selection/index/index.esm.js.map +1 -0
  398. package/dist/node_modules/d3-selection/src/selection/index/index.js +2 -0
  399. package/dist/node_modules/d3-selection/src/selection/index/index.js.map +1 -0
  400. package/dist/node_modules/d3-selection/src/selection/insert/index.esm.js +15 -0
  401. package/dist/node_modules/d3-selection/src/selection/insert/index.esm.js.map +1 -0
  402. package/dist/node_modules/d3-selection/src/selection/insert/index.js +2 -0
  403. package/dist/node_modules/d3-selection/src/selection/insert/index.js.map +1 -0
  404. package/dist/node_modules/d3-selection/src/selection/iterator/index.esm.js +11 -0
  405. package/dist/node_modules/d3-selection/src/selection/iterator/index.esm.js.map +1 -0
  406. package/dist/node_modules/d3-selection/src/selection/iterator/index.js +2 -0
  407. package/dist/node_modules/d3-selection/src/selection/iterator/index.js.map +1 -0
  408. package/dist/node_modules/d3-selection/src/selection/join/index.esm.js +20 -0
  409. package/dist/node_modules/d3-selection/src/selection/join/index.esm.js.map +1 -0
  410. package/dist/node_modules/d3-selection/src/selection/join/index.js +2 -0
  411. package/dist/node_modules/d3-selection/src/selection/join/index.js.map +1 -0
  412. package/dist/node_modules/d3-selection/src/selection/lower/index.esm.js +10 -0
  413. package/dist/node_modules/d3-selection/src/selection/lower/index.esm.js.map +1 -0
  414. package/dist/node_modules/d3-selection/src/selection/lower/index.js +2 -0
  415. package/dist/node_modules/d3-selection/src/selection/lower/index.js.map +1 -0
  416. package/dist/node_modules/d3-selection/src/selection/merge/index.esm.js +19 -0
  417. package/dist/node_modules/d3-selection/src/selection/merge/index.esm.js.map +1 -0
  418. package/dist/node_modules/d3-selection/src/selection/merge/index.js +2 -0
  419. package/dist/node_modules/d3-selection/src/selection/merge/index.js.map +1 -0
  420. package/dist/node_modules/d3-selection/src/selection/node/index.esm.js +13 -0
  421. package/dist/node_modules/d3-selection/src/selection/node/index.esm.js.map +1 -0
  422. package/dist/node_modules/d3-selection/src/selection/node/index.js +2 -0
  423. package/dist/node_modules/d3-selection/src/selection/node/index.js.map +1 -0
  424. package/dist/node_modules/d3-selection/src/selection/nodes/index.esm.js +7 -0
  425. package/dist/node_modules/d3-selection/src/selection/nodes/index.esm.js.map +1 -0
  426. package/dist/node_modules/d3-selection/src/selection/nodes/index.js +2 -0
  427. package/dist/node_modules/d3-selection/src/selection/nodes/index.js.map +1 -0
  428. package/dist/node_modules/d3-selection/src/selection/on/index.esm.js +65 -0
  429. package/dist/node_modules/d3-selection/src/selection/on/index.esm.js.map +1 -0
  430. package/dist/node_modules/d3-selection/src/selection/on/index.js +2 -0
  431. package/dist/node_modules/d3-selection/src/selection/on/index.js.map +1 -0
  432. package/dist/node_modules/d3-selection/src/selection/order/index.esm.js +15 -0
  433. package/dist/node_modules/d3-selection/src/selection/order/index.esm.js.map +1 -0
  434. package/dist/node_modules/d3-selection/src/selection/order/index.js +2 -0
  435. package/dist/node_modules/d3-selection/src/selection/order/index.js.map +1 -0
  436. package/dist/node_modules/d3-selection/src/selection/property/index.esm.js +24 -0
  437. package/dist/node_modules/d3-selection/src/selection/property/index.esm.js.map +1 -0
  438. package/dist/node_modules/d3-selection/src/selection/property/index.js +2 -0
  439. package/dist/node_modules/d3-selection/src/selection/property/index.js.map +1 -0
  440. package/dist/node_modules/d3-selection/src/selection/raise/index.esm.js +10 -0
  441. package/dist/node_modules/d3-selection/src/selection/raise/index.esm.js.map +1 -0
  442. package/dist/node_modules/d3-selection/src/selection/raise/index.js +2 -0
  443. package/dist/node_modules/d3-selection/src/selection/raise/index.js.map +1 -0
  444. package/dist/node_modules/d3-selection/src/selection/remove/index.esm.js +11 -0
  445. package/dist/node_modules/d3-selection/src/selection/remove/index.esm.js.map +1 -0
  446. package/dist/node_modules/d3-selection/src/selection/remove/index.js +2 -0
  447. package/dist/node_modules/d3-selection/src/selection/remove/index.js.map +1 -0
  448. package/dist/node_modules/d3-selection/src/selection/select/index.esm.js +18 -0
  449. package/dist/node_modules/d3-selection/src/selection/select/index.esm.js.map +1 -0
  450. package/dist/node_modules/d3-selection/src/selection/select/index.js +2 -0
  451. package/dist/node_modules/d3-selection/src/selection/select/index.js.map +1 -0
  452. package/dist/node_modules/d3-selection/src/selection/selectAll/index.esm.js +25 -0
  453. package/dist/node_modules/d3-selection/src/selection/selectAll/index.esm.js.map +1 -0
  454. package/dist/node_modules/d3-selection/src/selection/selectAll/index.js +2 -0
  455. package/dist/node_modules/d3-selection/src/selection/selectAll/index.js.map +1 -0
  456. package/dist/node_modules/d3-selection/src/selection/selectChild/index.esm.js +17 -0
  457. package/dist/node_modules/d3-selection/src/selection/selectChild/index.esm.js.map +1 -0
  458. package/dist/node_modules/d3-selection/src/selection/selectChild/index.js +2 -0
  459. package/dist/node_modules/d3-selection/src/selection/selectChild/index.js.map +1 -0
  460. package/dist/node_modules/d3-selection/src/selection/selectChildren/index.esm.js +17 -0
  461. package/dist/node_modules/d3-selection/src/selection/selectChildren/index.esm.js.map +1 -0
  462. package/dist/node_modules/d3-selection/src/selection/selectChildren/index.js +2 -0
  463. package/dist/node_modules/d3-selection/src/selection/selectChildren/index.js.map +1 -0
  464. package/dist/node_modules/d3-selection/src/selection/size/index.esm.js +9 -0
  465. package/dist/node_modules/d3-selection/src/selection/size/index.esm.js.map +1 -0
  466. package/dist/node_modules/d3-selection/src/selection/size/index.js +2 -0
  467. package/dist/node_modules/d3-selection/src/selection/size/index.js.map +1 -0
  468. package/dist/node_modules/d3-selection/src/selection/sort/index.esm.js +23 -0
  469. package/dist/node_modules/d3-selection/src/selection/sort/index.esm.js.map +1 -0
  470. package/dist/node_modules/d3-selection/src/selection/sort/index.js +2 -0
  471. package/dist/node_modules/d3-selection/src/selection/sort/index.js.map +1 -0
  472. package/dist/node_modules/d3-selection/src/selection/sparse/index.esm.js +7 -0
  473. package/dist/node_modules/d3-selection/src/selection/sparse/index.esm.js.map +1 -0
  474. package/dist/node_modules/d3-selection/src/selection/sparse/index.js +2 -0
  475. package/dist/node_modules/d3-selection/src/selection/sparse/index.js.map +1 -0
  476. package/dist/node_modules/d3-selection/src/selection/style/index.esm.js +29 -0
  477. package/dist/node_modules/d3-selection/src/selection/style/index.esm.js.map +1 -0
  478. package/dist/node_modules/d3-selection/src/selection/style/index.js +2 -0
  479. package/dist/node_modules/d3-selection/src/selection/style/index.js.map +1 -0
  480. package/dist/node_modules/d3-selection/src/selection/text/index.esm.js +21 -0
  481. package/dist/node_modules/d3-selection/src/selection/text/index.esm.js.map +1 -0
  482. package/dist/node_modules/d3-selection/src/selection/text/index.js +2 -0
  483. package/dist/node_modules/d3-selection/src/selection/text/index.js.map +1 -0
  484. package/dist/node_modules/d3-selection/src/selector/index.esm.js +11 -0
  485. package/dist/node_modules/d3-selection/src/selector/index.esm.js.map +1 -0
  486. package/dist/node_modules/d3-selection/src/selector/index.js +2 -0
  487. package/dist/node_modules/d3-selection/src/selector/index.js.map +1 -0
  488. package/dist/node_modules/d3-selection/src/selectorAll/index.esm.js +12 -0
  489. package/dist/node_modules/d3-selection/src/selectorAll/index.esm.js.map +1 -0
  490. package/dist/node_modules/d3-selection/src/selectorAll/index.js +2 -0
  491. package/dist/node_modules/d3-selection/src/selectorAll/index.js.map +1 -0
  492. package/dist/node_modules/d3-selection/src/sourceEvent/index.esm.js +9 -0
  493. package/dist/node_modules/d3-selection/src/sourceEvent/index.esm.js.map +1 -0
  494. package/dist/node_modules/d3-selection/src/sourceEvent/index.js +2 -0
  495. package/dist/node_modules/d3-selection/src/sourceEvent/index.js.map +1 -0
  496. package/dist/node_modules/d3-selection/src/window/index.esm.js +7 -0
  497. package/dist/node_modules/d3-selection/src/window/index.esm.js.map +1 -0
  498. package/dist/node_modules/d3-selection/src/window/index.js +2 -0
  499. package/dist/node_modules/d3-selection/src/window/index.js.map +1 -0
  500. package/dist/node_modules/d3-shape/src/arc/index.esm.js +134 -0
  501. package/dist/node_modules/d3-shape/src/arc/index.esm.js.map +1 -0
  502. package/dist/node_modules/d3-shape/src/arc/index.js +2 -0
  503. package/dist/node_modules/d3-shape/src/arc/index.js.map +1 -0
  504. package/dist/node_modules/d3-shape/src/area/index.esm.js +82 -0
  505. package/dist/node_modules/d3-shape/src/area/index.esm.js.map +1 -0
  506. package/dist/node_modules/d3-shape/src/area/index.js +2 -0
  507. package/dist/node_modules/d3-shape/src/area/index.js.map +1 -0
  508. package/dist/node_modules/d3-shape/src/array/index.esm.js +7 -0
  509. package/dist/node_modules/d3-shape/src/array/index.esm.js.map +1 -0
  510. package/dist/node_modules/d3-shape/src/array/index.js +2 -0
  511. package/dist/node_modules/d3-shape/src/array/index.js.map +1 -0
  512. package/dist/node_modules/d3-shape/src/constant/index.esm.js +9 -0
  513. package/dist/node_modules/d3-shape/src/constant/index.esm.js.map +1 -0
  514. package/dist/node_modules/d3-shape/src/constant/index.js +2 -0
  515. package/dist/node_modules/d3-shape/src/constant/index.js.map +1 -0
  516. package/dist/node_modules/d3-shape/src/curve/linear/index.esm.js +39 -0
  517. package/dist/node_modules/d3-shape/src/curve/linear/index.esm.js.map +1 -0
  518. package/dist/node_modules/d3-shape/src/curve/linear/index.js +2 -0
  519. package/dist/node_modules/d3-shape/src/curve/linear/index.js.map +1 -0
  520. package/dist/node_modules/d3-shape/src/curve/monotone/index.esm.js +76 -0
  521. package/dist/node_modules/d3-shape/src/curve/monotone/index.esm.js.map +1 -0
  522. package/dist/node_modules/d3-shape/src/curve/monotone/index.js +2 -0
  523. package/dist/node_modules/d3-shape/src/curve/monotone/index.js.map +1 -0
  524. package/dist/node_modules/d3-shape/src/descending/index.esm.js +7 -0
  525. package/dist/node_modules/d3-shape/src/descending/index.esm.js.map +1 -0
  526. package/dist/node_modules/d3-shape/src/descending/index.js +2 -0
  527. package/dist/node_modules/d3-shape/src/descending/index.js.map +1 -0
  528. package/dist/node_modules/d3-shape/src/identity/index.esm.js +7 -0
  529. package/dist/node_modules/d3-shape/src/identity/index.esm.js.map +1 -0
  530. package/dist/node_modules/d3-shape/src/identity/index.js +2 -0
  531. package/dist/node_modules/d3-shape/src/identity/index.js.map +1 -0
  532. package/dist/node_modules/d3-shape/src/line/index.esm.js +42 -0
  533. package/dist/node_modules/d3-shape/src/line/index.esm.js.map +1 -0
  534. package/dist/node_modules/d3-shape/src/line/index.js +2 -0
  535. package/dist/node_modules/d3-shape/src/line/index.js.map +1 -0
  536. package/dist/node_modules/d3-shape/src/math/index.esm.js +33 -0
  537. package/dist/node_modules/d3-shape/src/math/index.esm.js.map +1 -0
  538. package/dist/node_modules/d3-shape/src/math/index.js +2 -0
  539. package/dist/node_modules/d3-shape/src/math/index.js.map +1 -0
  540. package/dist/node_modules/d3-shape/src/path/index.esm.js +20 -0
  541. package/dist/node_modules/d3-shape/src/path/index.esm.js.map +1 -0
  542. package/dist/node_modules/d3-shape/src/path/index.js +2 -0
  543. package/dist/node_modules/d3-shape/src/path/index.js.map +1 -0
  544. package/dist/node_modules/d3-shape/src/pie/index.esm.js +56 -0
  545. package/dist/node_modules/d3-shape/src/pie/index.esm.js.map +1 -0
  546. package/dist/node_modules/d3-shape/src/pie/index.js +2 -0
  547. package/dist/node_modules/d3-shape/src/pie/index.js.map +1 -0
  548. package/dist/node_modules/d3-shape/src/point/index.esm.js +11 -0
  549. package/dist/node_modules/d3-shape/src/point/index.esm.js.map +1 -0
  550. package/dist/node_modules/d3-shape/src/point/index.js +2 -0
  551. package/dist/node_modules/d3-shape/src/point/index.js.map +1 -0
  552. package/dist/node_modules/internmap/src/index/index.esm.js +44 -0
  553. package/dist/node_modules/internmap/src/index/index.esm.js.map +1 -0
  554. package/dist/node_modules/internmap/src/index/index.js +2 -0
  555. package/dist/node_modules/internmap/src/index/index.js.map +1 -0
  556. package/dist/style.css +2 -2
  557. package/dist/views/template-editor/components/EditorHeader/index.esm.js +1 -1
  558. package/dist/views/template-editor/components/EditorHeader/index.js +3 -3
  559. package/dist/views/template-editor/utils/index.d.ts +1 -1
  560. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/charts/line-chart/area-lineChart.tsx"],"sourcesContent":["import React, { useRef, useEffect, useState } from \"react\";\nimport * as d3 from \"d3\";\n\ninterface DataPoint {\n label: string;\n value: number;\n}\n\ninterface LineChartProps {\n data: DataPoint[];\n width?: number | string; // Accept string for percentage width\n height?: number | string;\n lineColor?: string;\n lineFillColor?: string;\n}\n\nconst AreaLineChart: React.FC<LineChartProps> = ({\n data,\n width = \"100%\", // Default to responsive width\n height = 200, // Set a default numeric height\n lineColor = \"#ADE7CB\",\n lineFillColor = \"#EBF9F2\",\n ...rest\n}) => {\n const svgRef = useRef<SVGSVGElement>(null);\n const containerRef = useRef<HTMLDivElement>(null); // Reference to the container\n const [containerWidth, setContainerWidth] = useState(0);\n\n useEffect(() => {\n // Set up ResizeObserver to track container width\n const resizeObserver = new ResizeObserver(() => {\n if (containerRef.current) {\n setContainerWidth(containerRef.current.clientWidth);\n }\n });\n\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current);\n setContainerWidth(containerRef.current.clientWidth);\n }\n\n return () => resizeObserver.disconnect();\n }, []);\n\n useEffect(() => {\n if (containerWidth === 0) return; // Skip rendering until we have a valid width\n\n const svg = d3.select(svgRef.current);\n svg.selectAll(\"*\").remove(); // Clear previous content\n\n const margin = { top: 5, left: 0, right: 0, bottom: 5 };\n const chartWidth = containerWidth - margin.left - margin.right; // Use container width\n const chartHeight = height as number;\n\n const x = d3\n .scaleLinear()\n .domain([0, data.length - 1])\n .range([0, chartWidth]);\n\n const y = d3\n .scaleLinear()\n .domain([0, d3.max(data, (d: DataPoint) => d.value) || 1]) // Fallback for empty data\n .range([chartHeight, 0]);\n\n const line = d3\n .line<DataPoint>()\n .x((_, i) => x(i))\n .y((d) => y(d.value));\n\n const area = d3\n .area<DataPoint>()\n .x((_, i) => x(i))\n .y0(chartHeight)\n .y1((d) => y(d.value));\n\n const chart = svg\n .append(\"g\")\n .attr(\"transform\", `translate(${margin.left},${margin.top})`);\n\n chart\n .append(\"path\")\n .datum(data)\n .attr(\"class\", \"line\")\n .attr(\"d\", line)\n .style(\"fill\", \"none\")\n .style(\"stroke\", lineColor)\n .style(\"stroke-width\", 5);\n\n chart\n .append(\"path\")\n .datum(data)\n .attr(\"class\", \"area\")\n .attr(\"d\", area)\n .style(\"fill\", lineFillColor);\n\n chart.selectAll(\".domain\").remove();\n chart.selectAll(\".tick line\").remove();\n }, [data, height, lineColor, lineFillColor, containerWidth]);\n\n return (\n <div ref={containerRef} style={{ width: width, height: height }}>\n <svg ref={svgRef} width=\"100%\" height=\"100%\" {...rest}></svg>\n </div>\n );\n};\n\nexport default AreaLineChart;\n"],"names":["data","width","height","lineColor","lineFillColor","rest","svgRef","useRef","containerRef","containerWidth","setContainerWidth","useState","useEffect","resizeObserver","ResizeObserver","current","clientWidth","observe","disconnect","svg","d3.select","selectAll","remove","chartWidth","chartHeight","x","d3.scaleLinear","domain","length","range","y","d3.max","d","value","line","d3.line","_","i","area","d3.area","y0","y1","chart","append","attr","datum","style","ref","children"],"mappings":"sdAgBgD,EAC9CA,OACAC,QAAQ,OACRC,SAAS,IACTC,YAAY,UACZC,gBAAgB,aACbC,MAEH,MAAMC,EAASC,EAAAA,OAAsB,MAC/BC,EAAeD,EAAAA,OAAuB,OACrCE,EAAgBC,GAAqBC,EAAAA,SAAS,GAyErD,OAvEAC,EAAAA,UAAU,KAER,MAAMC,EAAiB,IAAIC,eAAe,KACpCN,EAAaO,SACfL,EAAkBF,EAAaO,QAAQC,eAS3C,OALIR,EAAaO,UACfF,EAAeI,QAAQT,EAAaO,SACpCL,EAAkBF,EAAaO,QAAQC,cAGlC,IAAMH,EAAeK,cAC3B,IAEHN,EAAAA,UAAU,KACR,GAAuB,IAAnBH,EAAsB,OAE1B,MAAMU,EAAMC,EAAAA,QAAUd,EAAOS,SAC7BI,EAAIE,UAAU,KAAKC,SAEnB,MACMC,EAAad,EADY,EAAU,EAEnCe,EAActB,EAEduB,EAAIC,EAAAA,UAEPC,OAAO,CAAC,EAAG3B,EAAK4B,OAAS,IACzBC,MAAM,CAAC,EAAGN,IAEPO,EAAIJ,EAAAA,UAEPC,OAAO,CAAC,EAAGI,EAAAA,QAAO/B,EAAOgC,GAAiBA,EAAEC,QAAU,IACtDJ,MAAM,CAACL,EAAa,IAEjBU,EAAOC,EAAAA,UAEVV,EAAE,CAACW,EAAGC,IAAMZ,EAAEY,IACdP,EAAGE,GAAMF,EAAEE,EAAEC,QAEVK,EAAOC,EAAAA,UAEVd,EAAE,CAACW,EAAGC,IAAMZ,EAAEY,IACdG,GAAGhB,GACHiB,GAAIT,GAAMF,EAAEE,EAAEC,QAEXS,EAAQvB,EACXwB,OAAO,KACPC,KAAK,YAAa,kBAErBF,EACGC,OAAO,QACPE,MAAM7C,GACN4C,KAAK,QAAS,QACdA,KAAK,IAAKV,GACVY,MAAM,OAAQ,QACdA,MAAM,SAAU3C,GAChB2C,MAAM,eAAgB,GAEzBJ,EACGC,OAAO,QACPE,MAAM7C,GACN4C,KAAK,QAAS,QACdA,KAAK,IAAKN,GACVQ,MAAM,OAAQ1C,GAEjBsC,EAAMrB,UAAU,WAAWC,SAC3BoB,EAAMrB,UAAU,cAAcC,UAC7B,CAACtB,EAAME,EAAQC,EAAWC,EAAeK,yBAGzC,MAAA,CAAIsC,IAAKvC,EAAcsC,MAAO,CAAE7C,QAAcC,UAC7C8C,8BAAC,MAAA,CAAID,IAAKzC,EAAQL,MAAM,OAAOC,OAAO,UAAWG"}
@@ -0,0 +1,108 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useRef, useMemo, useEffect } from "react";
3
+ import band from "../../../../node_modules/d3-scale/src/band/index.esm.js";
4
+ import linear from "../../../../node_modules/d3-scale/src/linear/index.esm.js";
5
+ import max from "../../../../node_modules/d3-array/src/max/index.esm.js";
6
+ import select from "../../../../node_modules/d3-selection/src/select/index.esm.js";
7
+ import line from "../../../../node_modules/d3-shape/src/line/index.esm.js";
8
+ import { axisBottom, axisLeft } from "../../../../node_modules/d3-axis/src/axis/index.esm.js";
9
+ const formatNumber = (num) => {
10
+ if (num >= 1e9) return (num / 1e9).toFixed(1) + "B";
11
+ if (num >= 1e6) return (num / 1e6).toFixed(1) + "M";
12
+ if (num >= 1e3) return (num / 1e3).toFixed(1) + "K";
13
+ return num;
14
+ };
15
+ const LineChart = ({
16
+ data,
17
+ numOfLines = 5,
18
+ width = 500,
19
+ height = 300
20
+ }) => {
21
+ const svgRef = useRef(null);
22
+ const wrapperRef = useRef(null);
23
+ const maxValue = useMemo(() => {
24
+ return Math.max(...data.map((d) => d.value));
25
+ }, [data]);
26
+ const yAxisMaxValue = useMemo(() => {
27
+ return maxValue * 1.25;
28
+ }, [maxValue]);
29
+ const yAxisTicks = useMemo(() => {
30
+ const ticks = [];
31
+ const interval = yAxisMaxValue / numOfLines;
32
+ for (let i = 0; i <= numOfLines; i++) {
33
+ ticks.push(interval * i);
34
+ }
35
+ return ticks;
36
+ }, [yAxisMaxValue, numOfLines]);
37
+ const needsHorizontalScroll = data.length > 12;
38
+ const minGroupWidth = 120;
39
+ const calculatedChartWidth = needsHorizontalScroll ? Math.max(data.length * minGroupWidth, width) : width;
40
+ useEffect(() => {
41
+ const wrapper = wrapperRef.current;
42
+ const resizeObserver = new ResizeObserver((entries) => {
43
+ if (entries[0]) {
44
+ const newWidth = entries[0].contentRect.width;
45
+ setContainerWidth(newWidth);
46
+ }
47
+ });
48
+ if (wrapper) {
49
+ resizeObserver.observe(wrapper);
50
+ }
51
+ return () => {
52
+ if (wrapper) {
53
+ resizeObserver.unobserve(wrapper);
54
+ }
55
+ };
56
+ }, []);
57
+ useEffect(() => {
58
+ const svg = select(svgRef.current);
59
+ svg.selectAll("*").remove();
60
+ const margin = { top: 20, right: 20, bottom: 70, left: 40 };
61
+ const barWidth = calculatedChartWidth - margin.left - margin.right;
62
+ const barHeight = height - margin.top - margin.bottom;
63
+ const mousemove = (event, d) => {
64
+ const xPosition = event.offsetX + margin.left - 25;
65
+ const yPosition = event.offsetY + margin.top - 40;
66
+ const text = `${d.label} - ${d.value}`;
67
+ tooltip.attr("x", xPosition).attr("y", yPosition).style("opacity", 9).style("height", text.length >= 16 ? 50 : 35);
68
+ tooltipText.html(text);
69
+ };
70
+ const mouseleave = () => {
71
+ tooltip.style("opacity", 0);
72
+ };
73
+ const x = band().domain(data.map((d) => d.label)).range([0, barWidth]).padding(0.1);
74
+ const y = linear().domain([0, max(data, (d) => d.value)]).range([barHeight, 0]);
75
+ const chart = svg.append("g").attr("transform", `translate(${margin.left},${margin.top})`);
76
+ const line$1 = line().x((d) => x(d.label) + x.bandwidth() / 2).y((d) => y(d.value));
77
+ chart.append("path").datum(data).attr("class", "line").attr("d", line$1).style("fill", "none").style("stroke", "#357AF6").style("stroke-width", 2);
78
+ chart.selectAll(".point").data(data).enter().append("circle").attr("class", "point").attr("cx", (d) => x(d.label) + x.bandwidth() / 2).attr("cy", (d) => y(d.value)).attr("r", 4).style("fill", "#357AF6").on("mousemove", mousemove).on("mouseleave", mouseleave);
79
+ yAxisTicks.slice(1).forEach((tick) => {
80
+ chart.append("line").attr("class", "dotted-line").attr("x1", 0).attr("y1", y(tick)).attr("x2", width).attr("y2", y(tick)).style("stroke", "gray").style("stroke-dasharray", "3,3");
81
+ });
82
+ const xAxis = chart.append("g").attr("class", "x-axis").attr("transform", `translate(0, ${barHeight})`).call(axisBottom(x));
83
+ xAxis.selectAll(".tick line").remove();
84
+ const yAxis = chart.append("g").attr("class", "y-axis").call(
85
+ axisLeft(y).tickValues(yAxisTicks).tickFormat((d) => {
86
+ return formatNumber(d);
87
+ }).tickSizeOuter(0),
88
+ 0
89
+ );
90
+ yAxis.selectAll(".domain").remove();
91
+ yAxis.selectAll(".tick line").remove();
92
+ const tooltip = svg.append("foreignObject").attr("class", "tooltip").attr("width", 120).attr("height", 20).style("opacity", 0).style("position", "absolute").style("background-color", "white").style("border", "none").style("box-shadow", "0rem 0rem 0.469rem 0rem rgba(0, 0, 0, 0.15)").style("border-radius", "0.313rem").style("padding", "0.625rem").style("font-size", "0.75rem");
93
+ const tooltipText = tooltip.append("xhtml:div").style("font-size", "0.75rem").style("color", "black");
94
+ }, [data, height, width, yAxisMaxValue, yAxisTicks, calculatedChartWidth]);
95
+ return /* @__PURE__ */ jsx("div", { ref: wrapperRef, style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx(
96
+ "svg",
97
+ {
98
+ ref: svgRef,
99
+ width: calculatedChartWidth,
100
+ height,
101
+ viewBox: `0 0 ${calculatedChartWidth} ${height}`
102
+ }
103
+ ) });
104
+ };
105
+ export {
106
+ LineChart as default
107
+ };
108
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../../../../../src/components/charts/line-chart/line-chart.tsx"],"sourcesContent":["import React, { useRef, useEffect, useMemo } from \"react\";\nimport * as d3 from \"d3\";\n\ninterface DataPoint {\n label: string;\n value: number;\n}\n\ninterface LineChartProps {\n data: DataPoint[];\n numOfLines?: number;\n width?: number;\n height?: number;\n}\n\nconst formatNumber = (num: number) => {\n if (num >= 1e9) return (num / 1e9).toFixed(1) + \"B\";\n if (num >= 1e6) return (num / 1e6).toFixed(1) + \"M\";\n if (num >= 1e3) return (num / 1e3).toFixed(1) + \"K\";\n return num;\n};\n\nconst LineChart: React.FC<LineChartProps> = ({\n data,\n numOfLines = 5,\n width = 500,\n height = 300,\n}) => {\n const svgRef = useRef<SVGSVGElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const maxValue = useMemo(() => {\n return Math.max(...data.map((d) => d.value));\n }, [data]);\n\n const yAxisMaxValue = useMemo(() => {\n return maxValue * 1.25;\n }, [maxValue]);\n\n const yAxisTicks = useMemo(() => {\n const ticks = [];\n const interval = yAxisMaxValue / numOfLines;\n for (let i = 0; i <= numOfLines; i++) {\n ticks.push(interval * i);\n }\n return ticks;\n }, [yAxisMaxValue, numOfLines]);\n\n const needsHorizontalScroll = data.length > 12;\n const minGroupWidth = 120; \n const calculatedChartWidth = needsHorizontalScroll \n ? Math.max(data.length * minGroupWidth, width)\n : width;\n useEffect(() => {\n const wrapper = wrapperRef.current;\n\n const resizeObserver = new ResizeObserver((entries) => {\n if (entries[0]) {\n const newWidth = entries[0].contentRect.width;\n setContainerWidth(newWidth);\n }\n });\n\n if (wrapper) {\n resizeObserver.observe(wrapper);\n }\n\n return () => {\n if (wrapper) {\n resizeObserver.unobserve(wrapper);\n }\n };\n }, []);\n useEffect(() => {\n const svg = d3.select(svgRef.current);\n\n svg.selectAll(\"*\").remove();\n\n const margin = { top: 20, right: 20, bottom: 70, left: 40 };\n const barWidth = calculatedChartWidth - margin.left - margin.right;\n const barHeight = height - margin.top - margin.bottom;\n\n const mousemove = (event: any, d: any) => {\n\n const xPosition = event.offsetX + margin.left - 25;\n const yPosition = event.offsetY + margin.top - 40;\n const text = `${d.label} - ${d.value}`;\n tooltip\n .attr(\"x\", xPosition)\n .attr(\"y\", yPosition)\n .style(\"opacity\", 9)\n .style(\"height\", text.length >= 16 ? 50 : 35);\n\n tooltipText.html(text);\n };\n\n const mouseleave = () => {\n tooltip.style(\"opacity\", 0);\n };\n\n const x = d3\n .scaleBand()\n .domain(data.map((d: any) => d.label))\n .range([0, barWidth])\n .padding(0.1);\n\n const y = d3\n .scaleLinear()\n .domain([0, d3.max(data, (d: any) => d.value)])\n .range([barHeight, 0]);\n\n const chart = svg\n .append(\"g\")\n .attr(\"transform\", `translate(${margin.left},${margin.top})`);\n\n const line = d3\n .line<DataPoint>()\n //@ts-expect-error not applicable\n .x((d: any) => x(d.label) + x.bandwidth() / 2)\n .y((d: any) => y(d.value));\n\n chart\n .append(\"path\")\n .datum(data)\n .attr(\"class\", \"line\")\n .attr(\"d\", line)\n .style(\"fill\", \"none\")\n .style(\"stroke\", \"#357AF6\")\n .style(\"stroke-width\", 2);\n\n chart\n .selectAll(\".point\")\n .data(data)\n .enter()\n .append(\"circle\")\n .attr(\"class\", \"point\")\n //@ts-expect-error not applicable\n .attr(\"cx\", (d: any) => x(d.label) + x.bandwidth() / 2)\n .attr(\"cy\", (d: any) => y(d.value))\n .attr(\"r\", 4)\n .style(\"fill\", \"#357AF6\")\n .on(\"mousemove\", mousemove)\n .on(\"mouseleave\", mouseleave);\n\n yAxisTicks.slice(1).forEach((tick) => {\n chart\n .append(\"line\")\n .attr(\"class\", \"dotted-line\")\n .attr(\"x1\", 0)\n .attr(\"y1\", y(tick))\n .attr(\"x2\", width)\n .attr(\"y2\", y(tick))\n .style(\"stroke\", \"gray\")\n .style(\"stroke-dasharray\", \"3,3\");\n });\n\n const xAxis = chart\n .append(\"g\")\n .attr(\"class\", \"x-axis\")\n .attr(\"transform\", `translate(0, ${barHeight})`)\n .call(d3.axisBottom(x));\n\n xAxis.selectAll(\".tick line\").remove();\n\n const yAxis = chart\n .append(\"g\")\n .attr(\"class\", \"y-axis\")\n .call(\n d3\n .axisLeft(y)\n .tickValues(yAxisTicks)\n //@ts-expect-error not applicable\n .tickFormat((d: any) => {\n return formatNumber(d);\n })\n .tickSizeOuter(0),\n 0,\n );\n\n yAxis.selectAll(\".domain\").remove();\n yAxis.selectAll(\".tick line\").remove();\n\n const tooltip = svg\n .append(\"foreignObject\")\n .attr(\"class\", \"tooltip\")\n .attr(\"width\", 120)\n .attr(\"height\", 20)\n .style(\"opacity\", 0)\n .style(\"position\", \"absolute\")\n .style(\"background-color\", \"white\")\n .style(\"border\", \"none\")\n .style(\"box-shadow\", \"0rem 0rem 0.469rem 0rem rgba(0, 0, 0, 0.15)\")\n .style(\"border-radius\", \"0.313rem\")\n .style(\"padding\", \"0.625rem\")\n .style(\"font-size\", \"0.75rem\");\n\n const tooltipText = tooltip\n .append(\"xhtml:div\")\n .style(\"font-size\", \"0.75rem\")\n .style(\"color\", \"black\");\n }, [data, height, width, yAxisMaxValue, yAxisTicks, calculatedChartWidth]);\n\n return (\n <div ref={wrapperRef} style={{ width: '100%', height: '100%' }}>\n <svg \n ref={svgRef}\n width={calculatedChartWidth}\n height={height}\n viewBox={`0 0 ${calculatedChartWidth} ${height}`}\n />\n </div>\n );\n};\n\nexport default LineChart;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O,aAAa,CAAC;AAAA,MACvB,CAAC,EACA,cAAc,CAAC;AAAA,MAClB;AAAA,IAAA;AAGJ,UAAM,UAAU,SAAS,EAAE,OAAA;AAC3B,UAAM,UAAU,YAAY,EAAE,OAAA;AAE9B,UAAM,UAAU,IACb,OAAO,eAAe,EACtB,KAAK,SAAS,SAAS,EACvB,KAAK,SAAS,GAAG,EACjB,KAAK,UAAU,EAAE,EACjB,MAAM,WAAW,CAAC,EAClB,MAAM,YAAY,UAAU,EAC5B,MAAM,oBAAoB,OAAO,EACjC,MAAM,UAAU,MAAM,EACtB,MAAM,cAAc,6CAA6C,EACjE,MAAM,iBAAiB,UAAU,EACjC,MAAM,WAAW,UAAU,EAC3B,MAAM,aAAa,SAAS;AAE/B,UAAM,cAAc,QACjB,OAAO,WAAW,EAClB,MAAM,aAAa,SAAS,EAC5B,MAAM,SAAS,OAAO;AAAA,EAC3B,GAAG,CAAC,MAAM,QAAQ,OAAO,eAAe,YAAY,oBAAoB,CAAC;AAEzE,SACE,oBAAC,OAAA,EAAI,KAAK,YAAY,OAAO,EAAE,OAAO,QAAQ,QAAQ,OAAA,GAClD,UAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAK;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA,SAAS,OAAO,oBAAoB,IAAI,MAAM;AAAA,IAAA;AAAA,EAAA,GAEtD;AAEJ;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("../../../../node_modules/d3-scale/src/band/index.js"),s=require("../../../../node_modules/d3-scale/src/linear/index.js"),a=require("../../../../node_modules/d3-array/src/max/index.js"),l=require("../../../../node_modules/d3-selection/src/select/index.js"),n=require("../../../../node_modules/d3-shape/src/line/index.js"),o=require("../../../../node_modules/d3-axis/src/axis/index.js");exports.default=({data:i,numOfLines:d=5,width:c=500,height:u=300})=>{const m=t.useRef(null),h=t.useRef(null),p=t.useMemo(()=>Math.max(...i.map(e=>e.value)),[i]),y=t.useMemo(()=>1.25*p,[p]),x=t.useMemo(()=>{const e=[],t=y/d;for(let r=0;r<=d;r++)e.push(t*r);return e},[y,d]),f=i.length>12?Math.max(120*i.length,c):c;return t.useEffect(()=>{const e=h.current,t=new ResizeObserver(e=>{if(e[0]){const t=e[0].contentRect.width;setContainerWidth(t)}});return e&&t.observe(e),()=>{e&&t.unobserve(e)}},[]),t.useEffect(()=>{const e=l.default(m.current);e.selectAll("*").remove();const t=f-40-20,d=u-20-70,h=r.default().domain(i.map(e=>e.label)).range([0,t]).padding(.1),p=s.default().domain([0,a.default(i,e=>e.value)]).range([d,0]),y=e.append("g").attr("transform","translate(40,20)"),v=n.default().x(e=>h(e.label)+h.bandwidth()/2).y(e=>p(e.value));y.append("path").datum(i).attr("class","line").attr("d",v).style("fill","none").style("stroke","#357AF6").style("stroke-width",2),y.selectAll(".point").data(i).enter().append("circle").attr("class","point").attr("cx",e=>h(e.label)+h.bandwidth()/2).attr("cy",e=>p(e.value)).attr("r",4).style("fill","#357AF6").on("mousemove",(e,t)=>{const r=e.offsetX+40-25,s=e.offsetY+20-40,a=`${t.label} - ${t.value}`;b.attr("x",r).attr("y",s).style("opacity",9).style("height",a.length>=16?50:35),w.html(a)}).on("mouseleave",()=>{b.style("opacity",0)}),x.slice(1).forEach(e=>{y.append("line").attr("class","dotted-line").attr("x1",0).attr("y1",p(e)).attr("x2",c).attr("y2",p(e)).style("stroke","gray").style("stroke-dasharray","3,3")}),y.append("g").attr("class","x-axis").attr("transform",`translate(0, ${d})`).call(o.axisBottom(h)).selectAll(".tick line").remove();const g=y.append("g").attr("class","y-axis").call(o.axisLeft(p).tickValues(x).tickFormat(e=>{return(t=e)>=1e9?(t/1e9).toFixed(1)+"B":t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"K":t;var t}).tickSizeOuter(0),0);g.selectAll(".domain").remove(),g.selectAll(".tick line").remove();const b=e.append("foreignObject").attr("class","tooltip").attr("width",120).attr("height",20).style("opacity",0).style("position","absolute").style("background-color","white").style("border","none").style("box-shadow","0rem 0rem 0.469rem 0rem rgba(0, 0, 0, 0.15)").style("border-radius","0.313rem").style("padding","0.625rem").style("font-size","0.75rem"),w=b.append("xhtml:div").style("font-size","0.75rem").style("color","black")},[i,u,c,y,x,f]),/* @__PURE__ */e.jsx("div",{ref:h,style:{width:"100%",height:"100%"},children:/* @__PURE__ */e.jsx("svg",{ref:m,width:f,height:u,viewBox:`0 0 ${f} ${u}`})})};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/charts/line-chart/line-chart.tsx"],"sourcesContent":["import React, { useRef, useEffect, useMemo } from \"react\";\nimport * as d3 from \"d3\";\n\ninterface DataPoint {\n label: string;\n value: number;\n}\n\ninterface LineChartProps {\n data: DataPoint[];\n numOfLines?: number;\n width?: number;\n height?: number;\n}\n\nconst formatNumber = (num: number) => {\n if (num >= 1e9) return (num / 1e9).toFixed(1) + \"B\";\n if (num >= 1e6) return (num / 1e6).toFixed(1) + \"M\";\n if (num >= 1e3) return (num / 1e3).toFixed(1) + \"K\";\n return num;\n};\n\nconst LineChart: React.FC<LineChartProps> = ({\n data,\n numOfLines = 5,\n width = 500,\n height = 300,\n}) => {\n const svgRef = useRef<SVGSVGElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const maxValue = useMemo(() => {\n return Math.max(...data.map((d) => d.value));\n }, [data]);\n\n const yAxisMaxValue = useMemo(() => {\n return maxValue * 1.25;\n }, [maxValue]);\n\n const yAxisTicks = useMemo(() => {\n const ticks = [];\n const interval = yAxisMaxValue / numOfLines;\n for (let i = 0; i <= numOfLines; i++) {\n ticks.push(interval * i);\n }\n return ticks;\n }, [yAxisMaxValue, numOfLines]);\n\n const needsHorizontalScroll = data.length > 12;\n const minGroupWidth = 120; \n const calculatedChartWidth = needsHorizontalScroll \n ? Math.max(data.length * minGroupWidth, width)\n : width;\n useEffect(() => {\n const wrapper = wrapperRef.current;\n\n const resizeObserver = new ResizeObserver((entries) => {\n if (entries[0]) {\n const newWidth = entries[0].contentRect.width;\n setContainerWidth(newWidth);\n }\n });\n\n if (wrapper) {\n resizeObserver.observe(wrapper);\n }\n\n return () => {\n if (wrapper) {\n resizeObserver.unobserve(wrapper);\n }\n };\n }, []);\n useEffect(() => {\n const svg = d3.select(svgRef.current);\n\n svg.selectAll(\"*\").remove();\n\n const margin = { top: 20, right: 20, bottom: 70, left: 40 };\n const barWidth = calculatedChartWidth - margin.left - margin.right;\n const barHeight = height - margin.top - margin.bottom;\n\n const mousemove = (event: any, d: any) => {\n\n const xPosition = event.offsetX + margin.left - 25;\n const yPosition = event.offsetY + margin.top - 40;\n const text = `${d.label} - ${d.value}`;\n tooltip\n .attr(\"x\", xPosition)\n .attr(\"y\", yPosition)\n .style(\"opacity\", 9)\n .style(\"height\", text.length >= 16 ? 50 : 35);\n\n tooltipText.html(text);\n };\n\n const mouseleave = () => {\n tooltip.style(\"opacity\", 0);\n };\n\n const x = d3\n .scaleBand()\n .domain(data.map((d: any) => d.label))\n .range([0, barWidth])\n .padding(0.1);\n\n const y = d3\n .scaleLinear()\n .domain([0, d3.max(data, (d: any) => d.value)])\n .range([barHeight, 0]);\n\n const chart = svg\n .append(\"g\")\n .attr(\"transform\", `translate(${margin.left},${margin.top})`);\n\n const line = d3\n .line<DataPoint>()\n //@ts-expect-error not applicable\n .x((d: any) => x(d.label) + x.bandwidth() / 2)\n .y((d: any) => y(d.value));\n\n chart\n .append(\"path\")\n .datum(data)\n .attr(\"class\", \"line\")\n .attr(\"d\", line)\n .style(\"fill\", \"none\")\n .style(\"stroke\", \"#357AF6\")\n .style(\"stroke-width\", 2);\n\n chart\n .selectAll(\".point\")\n .data(data)\n .enter()\n .append(\"circle\")\n .attr(\"class\", \"point\")\n //@ts-expect-error not applicable\n .attr(\"cx\", (d: any) => x(d.label) + x.bandwidth() / 2)\n .attr(\"cy\", (d: any) => y(d.value))\n .attr(\"r\", 4)\n .style(\"fill\", \"#357AF6\")\n .on(\"mousemove\", mousemove)\n .on(\"mouseleave\", mouseleave);\n\n yAxisTicks.slice(1).forEach((tick) => {\n chart\n .append(\"line\")\n .attr(\"class\", \"dotted-line\")\n .attr(\"x1\", 0)\n .attr(\"y1\", y(tick))\n .attr(\"x2\", width)\n .attr(\"y2\", y(tick))\n .style(\"stroke\", \"gray\")\n .style(\"stroke-dasharray\", \"3,3\");\n });\n\n const xAxis = chart\n .append(\"g\")\n .attr(\"class\", \"x-axis\")\n .attr(\"transform\", `translate(0, ${barHeight})`)\n .call(d3.axisBottom(x));\n\n xAxis.selectAll(\".tick line\").remove();\n\n const yAxis = chart\n .append(\"g\")\n .attr(\"class\", \"y-axis\")\n .call(\n d3\n .axisLeft(y)\n .tickValues(yAxisTicks)\n //@ts-expect-error not applicable\n .tickFormat((d: any) => {\n return formatNumber(d);\n })\n .tickSizeOuter(0),\n 0,\n );\n\n yAxis.selectAll(\".domain\").remove();\n yAxis.selectAll(\".tick line\").remove();\n\n const tooltip = svg\n .append(\"foreignObject\")\n .attr(\"class\", \"tooltip\")\n .attr(\"width\", 120)\n .attr(\"height\", 20)\n .style(\"opacity\", 0)\n .style(\"position\", \"absolute\")\n .style(\"background-color\", \"white\")\n .style(\"border\", \"none\")\n .style(\"box-shadow\", \"0rem 0rem 0.469rem 0rem rgba(0, 0, 0, 0.15)\")\n .style(\"border-radius\", \"0.313rem\")\n .style(\"padding\", \"0.625rem\")\n .style(\"font-size\", \"0.75rem\");\n\n const tooltipText = tooltip\n .append(\"xhtml:div\")\n .style(\"font-size\", \"0.75rem\")\n .style(\"color\", \"black\");\n }, [data, height, width, yAxisMaxValue, yAxisTicks, calculatedChartWidth]);\n\n return (\n <div ref={wrapperRef} style={{ width: '100%', height: '100%' }}>\n <svg \n ref={svgRef}\n width={calculatedChartWidth}\n height={height}\n viewBox={`0 0 ${calculatedChartWidth} ${height}`}\n />\n </div>\n );\n};\n\nexport default LineChart;\n"],"names":["data","numOfLines","width","height","svgRef","useRef","wrapperRef","maxValue","useMemo","Math","max","map","d","value","yAxisMaxValue","yAxisTicks","ticks","interval","i","push","calculatedChartWidth","length","useEffect","wrapper","current","resizeObserver","ResizeObserver","entries","newWidth","contentRect","setContainerWidth","observe","unobserve","svg","d3.select","selectAll","remove","barWidth","barHeight","x","d3.scaleBand","domain","label","range","padding","y","d3.scaleLinear","d3.max","chart","append","attr","line","d3.line","bandwidth","datum","style","enter","on","event","xPosition","offsetX","yPosition","offsetY","text","tooltip","tooltipText","html","slice","forEach","tick","call","d3.axisBottom","yAxis","d3.axisLeft","tickValues","tickFormat","num","toFixed","tickSizeOuter","jsx","ref","children","viewBox"],"mappings":"shBAsB4C,EAC1CA,OACAC,aAAa,EACbC,QAAQ,IACRC,SAAS,QAET,MAAMC,EAASC,EAAAA,OAAsB,MAC/BC,EAAaD,EAAAA,OAAuB,MACpCE,EAAWC,EAAAA,QAAQ,IAChBC,KAAKC,OAAOV,EAAKW,IAAKC,GAAMA,EAAEC,QACpC,CAACb,IAEEc,EAAgBN,EAAAA,QAAQ,IACV,KAAXD,EACN,CAACA,IAEEQ,EAAaP,EAAAA,QAAQ,KACzB,MAAMQ,EAAQ,GACRC,EAAWH,EAAgBb,EACjC,IAAA,IAASiB,EAAI,EAAGA,GAAKjB,EAAYiB,IAC/BF,EAAMG,KAAKF,EAAWC,GAExB,OAAOF,GACN,CAACF,EAAeb,IAIbmB,EAFwBpB,EAAKqB,OAAS,GAGtCZ,KAAKC,IAFW,IAEPV,EAAKqB,OAAwBnB,GACtCA,EAsJN,OArJEoB,EAAAA,UAAU,KACN,MAAMC,EAAUjB,EAAWkB,QAErBC,EAAiB,IAAIC,eAAgBC,IACvC,GAAIA,EAAQ,GAAI,CACZ,MAAMC,EAAWD,EAAQ,GAAGE,YAAY3B,MACxC4B,kBAAkBF,EACtB,IAOJ,OAJIL,GACAE,EAAeM,QAAQR,GAGpB,KACCA,GACAE,EA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C,MAAA,CACGC,IAAK5E,EACLF,MAAOkB,EACPjB,SACA+E,QAAS,OAAO9D,KAAwBjB"}
@@ -0,0 +1,100 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useRef, useState, useEffect } from "react";
3
+ import linear from "../../../../node_modules/d3-scale/src/linear/index.esm.js";
4
+ import max from "../../../../node_modules/d3-array/src/max/index.esm.js";
5
+ import select from "../../../../node_modules/d3-selection/src/select/index.esm.js";
6
+ import { axisBottom, axisLeft } from "../../../../node_modules/d3-axis/src/axis/index.esm.js";
7
+ import line from "../../../../node_modules/d3-shape/src/line/index.esm.js";
8
+ import { monotoneX } from "../../../../node_modules/d3-shape/src/curve/monotone/index.esm.js";
9
+ import curveLinear from "../../../../node_modules/d3-shape/src/curve/linear/index.esm.js";
10
+ import { format } from "../../../../node_modules/d3-format/src/defaultLocale/index.esm.js";
11
+ const formatNumber = (num, symbol, labelType) => {
12
+ if (labelType === "inPercent") {
13
+ return `${format(".0%")(num / 100)}`;
14
+ } else if (labelType === "inValue") {
15
+ return `${symbol || ""} ${format(".2s")(num).replace("k", "K")}`;
16
+ }
17
+ return num.toString();
18
+ };
19
+ const MultiLineChart = ({
20
+ data,
21
+ yAxisData,
22
+ xAxisData,
23
+ colors = ["steelblue", "orange", "green", "red"],
24
+ // Default colors
25
+ height = 400,
26
+ margin = { top: 20, right: 50, bottom: 30, left: 50 },
27
+ line: line$1 = false,
28
+ yAxisLabelType = "inValue",
29
+ currency,
30
+ customLabelFormatter
31
+ }) => {
32
+ const svgRef = useRef(null);
33
+ const wrapperRef = useRef(null);
34
+ const [containerWidth, setContainerWidth] = useState(0);
35
+ useEffect(() => {
36
+ }, [yAxisLabelType]);
37
+ useEffect(() => {
38
+ const wrapper = wrapperRef.current;
39
+ const resizeObserver = new ResizeObserver((entries) => {
40
+ if (entries[0]) {
41
+ const newWidth = entries[0].contentRect.width;
42
+ setContainerWidth(newWidth);
43
+ }
44
+ });
45
+ if (wrapper) {
46
+ resizeObserver.observe(wrapper);
47
+ }
48
+ return () => {
49
+ if (wrapper) {
50
+ resizeObserver.unobserve(wrapper);
51
+ }
52
+ };
53
+ }, []);
54
+ useEffect(() => {
55
+ if (containerWidth === 0) return;
56
+ const svg = select(svgRef.current);
57
+ svg.selectAll("*").remove();
58
+ const innerWidth = containerWidth - margin.left - margin.right;
59
+ const innerHeight = height - margin.top - margin.bottom;
60
+ const x = linear().domain([0, xAxisData.length]).range([0, innerWidth]);
61
+ const y = linear().domain([0, max(yAxisData)]).nice().range([innerHeight, 0]);
62
+ const xAxis = svg.append("g").attr("class", "x-axis").attr("transform", `translate(${margin.left},${height - margin.bottom})`).call(
63
+ axisBottom(x).ticks(xAxisData.length - 1).tickFormat((d, i) => xAxisData[i])
64
+ );
65
+ xAxis.selectAll("text").attr("transform", "translate(20, 10)").style("text-anchor", "middle");
66
+ xAxis.select(".domain").attr("stroke", "none");
67
+ const yAxis = svg.append("g").attr("class", "y-axis").attr("transform", `translate(${margin.left},${margin.top})`).call(axisLeft(y).tickPadding(10).tickFormat(
68
+ (d) => customLabelFormatter ? customLabelFormatter(d) : formatNumber(d, currency, yAxisLabelType)
69
+ ).tickSizeOuter(0));
70
+ if (line$1) {
71
+ yAxis.selectAll(".grid-line").data(y.ticks()).enter().append("line").attr("class", "grid-line").attr("x1", 0).attr("x2", innerWidth).attr("y1", (d) => y(d)).attr("y2", (d) => y(d)).style("stroke", "#ddd").style("stroke-dasharray", "6,3").style("stroke-width", 1);
72
+ }
73
+ xAxis.selectAll(".tick line").remove();
74
+ yAxis.selectAll(".tick line").remove();
75
+ yAxis.select(".domain").attr("stroke", "none");
76
+ Object.keys(data).forEach((key, index) => {
77
+ var _a, _b, _c;
78
+ if (key !== "months") {
79
+ const chartLine = line().x((d, i) => x(i)).y((d) => y(d)).curve(data[key].isSmooth ? monotoneX : curveLinear);
80
+ svg.append("path").datum((_a = data[key]) == null ? void 0 : _a.data).attr("fill", "none").attr("stroke", colors[index % colors.length]).attr("stroke-width", 2).attr("transform", `translate(${margin.left},${margin.top})`).attr("d", chartLine).on("mouseover", function() {
81
+ select(this).attr("stroke-width", 4);
82
+ }).on("mouseout", function() {
83
+ select(this).attr("stroke-width", 2);
84
+ });
85
+ if ((_b = data[key]) == null ? void 0 : _b.displayDot) {
86
+ svg.selectAll(`.circle-${key}`).data((_c = data[key]) == null ? void 0 : _c.data).enter().append("circle").attr("class", `circle-${key}`).attr("cx", (d, i) => x(i) + margin.left).attr("cy", (d) => y(d) + margin.top).attr("r", 4).attr("fill", colors[index % colors.length]).attr("stroke", "white").attr("stroke-width", 1.5).on("mouseover", function() {
87
+ select(this).attr("r", 6);
88
+ }).on("mouseout", function() {
89
+ select(this).attr("r", 4);
90
+ });
91
+ }
92
+ }
93
+ });
94
+ }, [data, yAxisData, xAxisData, height, containerWidth, colors, margin, line$1, yAxisLabelType, currency, customLabelFormatter]);
95
+ return /* @__PURE__ */ jsx("div", { ref: wrapperRef, style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx("div", { style: { position: "relative" }, children: /* @__PURE__ */ jsx("svg", { ref: svgRef, width: "100%", height, viewBox: `0 0 ${containerWidth} ${height}` }) }) });
96
+ };
97
+ export {
98
+ MultiLineChart as default
99
+ };
100
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../../../../../src/components/charts/multiLineChart/multi-line-chart.tsx"],"sourcesContent":["import React, { useRef, useEffect, useState } from 'react';\nimport * as d3 from 'd3';\n\nexport interface IMultiLineChartProps {\n data: any;\n width?: number;\n height?: number;\n margin?: { top: number, right: number, bottom: number, left: number };\n yAxisData: any;\n xAxisData: any;\n colors?: string[];\n line?: boolean;\n yAxisLabelType?: 'inPercent' | 'inValue' | 'custom';\n customLabelFormatter?: (value: number) => string;\n currency?: string\n}\nconst formatNumber = (num: number, symbol: string, labelType: string) => {\n if (labelType === 'inPercent') {\n return `${d3.format(\".0%\")(num / 100)}`;\n } else if (labelType === 'inValue') {\n return `${symbol||''} ${d3.format(\".2s\")(num).replace('k', 'K')}`;\n }\n return num.toString();\n};\n\n\n\nconst MultiLineChart = ({\n data,\n yAxisData,\n xAxisData,\n colors = ['steelblue', 'orange', 'green', 'red'], // Default colors\n height = 400,\n margin = { top: 20, right: 50, bottom: 30, left: 50 },\n line = false,\n yAxisLabelType = 'inValue',\n currency,\n customLabelFormatter,\n}: IMultiLineChartProps) => {\n const svgRef = useRef<SVGSVGElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const [containerWidth, setContainerWidth] = useState<number>(0);\n\n useEffect(() => {\n }, [yAxisLabelType]);\n // ResizeObserver to adjust the chart size dynamically\n useEffect(() => {\n const wrapper = wrapperRef.current;\n\n const resizeObserver = new ResizeObserver((entries) => {\n if (entries[0]) {\n const newWidth = entries[0].contentRect.width;\n setContainerWidth(newWidth);\n }\n });\n\n if (wrapper) {\n resizeObserver.observe(wrapper);\n }\n\n return () => {\n if (wrapper) {\n resizeObserver.unobserve(wrapper);\n }\n };\n }, []);\n\n useEffect(() => {\n \n if (containerWidth === 0) return; \n\n const svg = d3.select(svgRef.current);\n svg.selectAll(\"*\").remove(); \n\n const innerWidth = containerWidth-margin.left- margin.right;\n const innerHeight = height - margin.top - margin.bottom;\n\n // Scales\n const x = d3.scaleLinear()\n .domain([0, xAxisData.length]) // Linear scale based on index of xAxisData\n .range([0, innerWidth]);\n\n const y = d3.scaleLinear()\n .domain([0, d3.max(yAxisData) as number])\n .nice()\n .range([innerHeight, 0]);\n\n\n // Append x-axis\n const xAxis = svg.append(\"g\")\n .attr(\"class\", \"x-axis\")\n .attr(\"transform\", `translate(${margin.left},${height - margin.bottom})`)\n .call(d3.axisBottom(x)\n .ticks(xAxisData.length - 1)\n .tickFormat((d, i) => xAxisData[i])\n );\n\n xAxis.selectAll(\"text\")\n .attr(\"transform\", \"translate(20, 10)\") // Push labels down by 10px\n .style(\"text-anchor\", \"middle\"); // Keep the labels centered\n xAxis.select(\".domain\").attr(\"stroke\", \"none\");\n\n // Append y-axis\n const yAxis = svg.append(\"g\")\n .attr(\"class\", \"y-axis\")\n .attr(\"transform\", `translate(${margin.left},${margin.top})`)\n .call(d3.axisLeft(y).tickPadding(10).tickFormat((d: any) =>\n customLabelFormatter\n ? customLabelFormatter(d)\n : formatNumber(d, currency, yAxisLabelType)\n )\n .tickSizeOuter(0) as any,);\n\n if (line) {\n yAxis.selectAll('.grid-line')\n .data(y.ticks())\n .enter()\n .append('line')\n .attr('class', 'grid-line')\n .attr('x1', 0)\n .attr('x2', innerWidth)\n .attr('y1', d => y(d))\n .attr('y2', d => y(d))\n .style('stroke', '#ddd')\n .style('stroke-dasharray', '6,3') // Dotted line\n .style('stroke-width', 1);\n }\n xAxis.selectAll(\".tick line\").remove();\n yAxis.selectAll(\".tick line\").remove();\n yAxis.select(\".domain\").attr(\"stroke\", \"none\");\n\n // Plot the lines for each dataset\n\n Object.keys(data).forEach((key, index) => {\n if (key !== 'months') {\n const chartLine = d3.line()\n .x((d, i) => x(i)) // Use index-based positioning for x-axis\n .y((d: any) => y(d)).curve(data[key].isSmooth ? d3.curveMonotoneX : d3.curveLinear);\n // Append the line\n svg.append(\"path\")\n .datum(data[key]?.data)\n .attr(\"fill\", \"none\")\n .attr(\"stroke\", colors[index % colors.length])\n .attr(\"stroke-width\", 2)\n .attr(\"transform\", `translate(${margin.left},${margin.top})`)\n .attr(\"d\", chartLine)\n .on(\"mouseover\", function () {\n d3.select(this).attr(\"stroke-width\", 4);\n })\n .on(\"mouseout\", function () {\n d3.select(this).attr(\"stroke-width\", 2);\n });\n\n\n\n // Append circles for each data point\n if (data[key]?.displayDot) {\n svg.selectAll(`.circle-${key}`)\n .data(data[key]?.data)\n .enter()\n .append(\"circle\")\n .attr(\"class\", `circle-${key}`)\n .attr(\"cx\", (d, i) => x(i) + margin.left) // Adjust for margin.left\n .attr(\"cy\", (d: any) => y(d) + margin.top) // Adjust for margin.top\n .attr(\"r\", 4) // Circle radius\n .attr(\"fill\", colors[index % colors.length])\n .attr(\"stroke\", \"white\") // Optional: adds a border for contrast\n .attr(\"stroke-width\", 1.5)\n .on(\"mouseover\", function () {\n d3.select(this).attr(\"r\", 6); // Increase size on hover\n })\n .on(\"mouseout\", function () {\n d3.select(this).attr(\"r\", 4); // Return to normal size\n });\n }\n\n }\n });\n }, [data, yAxisData, xAxisData, height, containerWidth, colors, margin, line, yAxisLabelType, currency, customLabelFormatter]);\n\n return (\n <div ref={wrapperRef} style={{ width: '100%', height: '100%' }}>\n <div style={{ position: 'relative' }}>\n <svg ref={svgRef} width=\"100%\" height={height} viewBox={`0 0 ${containerWidth} ${height}`} />\n </div>\n </div>\n );\n};\n\nexport default MultiLineChart;\n"],"names":["d3.format","line","d3.select","d3.scaleLinear","d3.max","d3.axisBottom","d3.axisLeft","d3.line","d3.curveMonotoneX","d3.curveLinear"],"mappings":";;;;;;;;;;AAgBA,MAAM,eAAe,CAAC,KAAa,QAAgB,cAAsB;AACrE,MAAI,cAAc,aAAa;AAC3B,WAAO,GAAGA,OAAU,KAAK,EAAE,MAAM,GAAG,CAAC;AAAA,EACzC,WAAW,cAAc,WAAW;AAChC,WAAO,GAAG,UAAQ,EAAE,IAAIA,OAAU,KAAK,EAAE,GAAG,EAAE,QAAQ,KAAK,GAAG,CAAC;AAAA,EACnE;AACA,SAAO,IAAI,SAAA;AACf;AAIA,MAAM,iBAAiB,CAAC;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS,CAAC,aAAa,UAAU,SAAS,KAAK;AAAA;AAAA,EAC/C,SAAS;AAAA,EACT,SAAS,EAAE,KAAK,IAAI,OAAO,IAAI,QAAQ,IAAI,MAAM,GAAA;AAAA,EAAG,MACpDC,SAAO;AAAA,EACP,iBAAiB;AAAA,EACjB;AAAA,EACA;AACJ,MAA4B;AACxB,QAAM,SAAS,OAAsB,IAAI;AACzC,QAAM,aAAa,OAAuB,IAAI;AAC9C,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAiB,CAAC;AA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AC/F,GACJ;AAER;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("../../../../node_modules/d3-scale/src/linear/index.js"),a=require("../../../../node_modules/d3-array/src/max/index.js"),s=require("../../../../node_modules/d3-selection/src/select/index.js"),o=require("../../../../node_modules/d3-axis/src/axis/index.js"),l=require("../../../../node_modules/d3-shape/src/line/index.js"),n=require("../../../../node_modules/d3-shape/src/curve/monotone/index.js"),i=require("../../../../node_modules/d3-shape/src/curve/linear/index.js"),d=require("../../../../node_modules/d3-format/src/defaultLocale/index.js");exports.default=({data:c,yAxisData:u,xAxisData:f,colors:m=["steelblue","orange","green","red"],height:h=400,margin:x={top:20,right:50,bottom:30,left:50},line:p=!1,yAxisLabelType:v="inValue",currency:g,customLabelFormatter:k})=>{const y=t.useRef(null),j=t.useRef(null),[$,b]=t.useState(0);return t.useEffect(()=>{},[v]),t.useEffect(()=>{const e=j.current,t=new ResizeObserver(e=>{if(e[0]){const t=e[0].contentRect.width;b(t)}});return e&&t.observe(e),()=>{e&&t.unobserve(e)}},[]),t.useEffect(()=>{if(0===$)return;const e=s.default(y.current);e.selectAll("*").remove();const t=$-x.left-x.right,j=h-x.top-x.bottom,b=r.default().domain([0,f.length]).range([0,t]),w=r.default().domain([0,a.default(u)]).nice().range([j,0]),q=e.append("g").attr("class","x-axis").attr("transform",`translate(${x.left},${h-x.bottom})`).call(o.axisBottom(b).ticks(f.length-1).tickFormat((e,t)=>f[t]));q.selectAll("text").attr("transform","translate(20, 10)").style("text-anchor","middle"),q.select(".domain").attr("stroke","none");const _=e.append("g").attr("class","y-axis").attr("transform",`translate(${x.left},${x.top})`).call(o.axisLeft(w).tickPadding(10).tickFormat(e=>{return k?k(e):(t=e,r=g,"inPercent"===(a=v)?`${d.format(".0%")(t/100)}`:"inValue"===a?`${r||""} ${d.format(".2s")(t).replace("k","K")}`:t.toString());var t,r,a}).tickSizeOuter(0));p&&_.selectAll(".grid-line").data(w.ticks()).enter().append("line").attr("class","grid-line").attr("x1",0).attr("x2",t).attr("y1",e=>w(e)).attr("y2",e=>w(e)).style("stroke","#ddd").style("stroke-dasharray","6,3").style("stroke-width",1),q.selectAll(".tick line").remove(),_.selectAll(".tick line").remove(),_.select(".domain").attr("stroke","none"),Object.keys(c).forEach((t,r)=>{var a,o,d;if("months"!==t){const u=l.default().x((e,t)=>b(t)).y(e=>w(e)).curve(c[t].isSmooth?n.monotoneX:i.default);e.append("path").datum(null==(a=c[t])?void 0:a.data).attr("fill","none").attr("stroke",m[r%m.length]).attr("stroke-width",2).attr("transform",`translate(${x.left},${x.top})`).attr("d",u).on("mouseover",function(){s.default(this).attr("stroke-width",4)}).on("mouseout",function(){s.default(this).attr("stroke-width",2)}),(null==(o=c[t])?void 0:o.displayDot)&&e.selectAll(`.circle-${t}`).data(null==(d=c[t])?void 0:d.data).enter().append("circle").attr("class",`circle-${t}`).attr("cx",(e,t)=>b(t)+x.left).attr("cy",e=>w(e)+x.top).attr("r",4).attr("fill",m[r%m.length]).attr("stroke","white").attr("stroke-width",1.5).on("mouseover",function(){s.default(this).attr("r",6)}).on("mouseout",function(){s.default(this).attr("r",4)})}})},[c,u,f,h,$,m,x,p,v,g,k]),/* @__PURE__ */e.jsx("div",{ref:j,style:{width:"100%",height:"100%"},children:/* @__PURE__ */e.jsx("div",{style:{position:"relative"},children:/* @__PURE__ */e.jsx("svg",{ref:y,width:"100%",height:h,viewBox:`0 0 ${$} ${h}`})})})};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/charts/multiLineChart/multi-line-chart.tsx"],"sourcesContent":["import React, { useRef, useEffect, useState } from 'react';\nimport * as d3 from 'd3';\n\nexport interface IMultiLineChartProps {\n data: any;\n width?: number;\n height?: number;\n margin?: { top: number, right: number, bottom: number, left: number };\n yAxisData: any;\n xAxisData: any;\n colors?: string[];\n line?: boolean;\n yAxisLabelType?: 'inPercent' | 'inValue' | 'custom';\n customLabelFormatter?: (value: number) => string;\n currency?: string\n}\nconst formatNumber = (num: number, symbol: string, labelType: string) => {\n if (labelType === 'inPercent') {\n return `${d3.format(\".0%\")(num / 100)}`;\n } else if (labelType === 'inValue') {\n return `${symbol||''} ${d3.format(\".2s\")(num).replace('k', 'K')}`;\n }\n return num.toString();\n};\n\n\n\nconst MultiLineChart = ({\n data,\n yAxisData,\n xAxisData,\n colors = ['steelblue', 'orange', 'green', 'red'], // Default colors\n height = 400,\n margin = { top: 20, right: 50, bottom: 30, left: 50 },\n line = false,\n yAxisLabelType = 'inValue',\n currency,\n customLabelFormatter,\n}: IMultiLineChartProps) => {\n const svgRef = useRef<SVGSVGElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const [containerWidth, setContainerWidth] = useState<number>(0);\n\n useEffect(() => {\n }, [yAxisLabelType]);\n // ResizeObserver to adjust the chart size dynamically\n useEffect(() => {\n const wrapper = wrapperRef.current;\n\n const resizeObserver = new ResizeObserver((entries) => {\n if (entries[0]) {\n const newWidth = entries[0].contentRect.width;\n setContainerWidth(newWidth);\n }\n });\n\n if (wrapper) {\n resizeObserver.observe(wrapper);\n }\n\n return () => {\n if (wrapper) {\n resizeObserver.unobserve(wrapper);\n }\n };\n }, []);\n\n useEffect(() => {\n \n if (containerWidth === 0) return; \n\n const svg = d3.select(svgRef.current);\n svg.selectAll(\"*\").remove(); \n\n const innerWidth = containerWidth-margin.left- margin.right;\n const innerHeight = height - margin.top - margin.bottom;\n\n // Scales\n const x = d3.scaleLinear()\n .domain([0, xAxisData.length]) // Linear scale based on index of xAxisData\n .range([0, innerWidth]);\n\n const y = d3.scaleLinear()\n .domain([0, d3.max(yAxisData) as number])\n .nice()\n .range([innerHeight, 0]);\n\n\n // Append x-axis\n const xAxis = svg.append(\"g\")\n .attr(\"class\", \"x-axis\")\n .attr(\"transform\", `translate(${margin.left},${height - margin.bottom})`)\n .call(d3.axisBottom(x)\n .ticks(xAxisData.length - 1)\n .tickFormat((d, i) => xAxisData[i])\n );\n\n xAxis.selectAll(\"text\")\n .attr(\"transform\", \"translate(20, 10)\") // Push labels down by 10px\n .style(\"text-anchor\", \"middle\"); // Keep the labels centered\n xAxis.select(\".domain\").attr(\"stroke\", \"none\");\n\n // Append y-axis\n const yAxis = svg.append(\"g\")\n .attr(\"class\", \"y-axis\")\n .attr(\"transform\", `translate(${margin.left},${margin.top})`)\n .call(d3.axisLeft(y).tickPadding(10).tickFormat((d: any) =>\n customLabelFormatter\n ? customLabelFormatter(d)\n : formatNumber(d, currency, yAxisLabelType)\n )\n .tickSizeOuter(0) as any,);\n\n if (line) {\n yAxis.selectAll('.grid-line')\n .data(y.ticks())\n .enter()\n .append('line')\n .attr('class', 'grid-line')\n .attr('x1', 0)\n .attr('x2', innerWidth)\n .attr('y1', d => y(d))\n .attr('y2', d => y(d))\n .style('stroke', '#ddd')\n .style('stroke-dasharray', '6,3') // Dotted line\n .style('stroke-width', 1);\n }\n xAxis.selectAll(\".tick line\").remove();\n yAxis.selectAll(\".tick line\").remove();\n yAxis.select(\".domain\").attr(\"stroke\", \"none\");\n\n // Plot the lines for each dataset\n\n Object.keys(data).forEach((key, index) => {\n if (key !== 'months') {\n const chartLine = d3.line()\n .x((d, i) => x(i)) // Use index-based positioning for x-axis\n .y((d: any) => y(d)).curve(data[key].isSmooth ? d3.curveMonotoneX : d3.curveLinear);\n // Append the line\n svg.append(\"path\")\n .datum(data[key]?.data)\n .attr(\"fill\", \"none\")\n .attr(\"stroke\", colors[index % colors.length])\n .attr(\"stroke-width\", 2)\n .attr(\"transform\", `translate(${margin.left},${margin.top})`)\n .attr(\"d\", chartLine)\n .on(\"mouseover\", function () {\n d3.select(this).attr(\"stroke-width\", 4);\n })\n .on(\"mouseout\", function () {\n d3.select(this).attr(\"stroke-width\", 2);\n });\n\n\n\n // Append circles for each data point\n if (data[key]?.displayDot) {\n svg.selectAll(`.circle-${key}`)\n .data(data[key]?.data)\n .enter()\n .append(\"circle\")\n .attr(\"class\", `circle-${key}`)\n .attr(\"cx\", (d, i) => x(i) + margin.left) // Adjust for margin.left\n .attr(\"cy\", (d: any) => y(d) + margin.top) // Adjust for margin.top\n .attr(\"r\", 4) // Circle radius\n .attr(\"fill\", colors[index % colors.length])\n .attr(\"stroke\", \"white\") // Optional: adds a border for contrast\n .attr(\"stroke-width\", 1.5)\n .on(\"mouseover\", function () {\n d3.select(this).attr(\"r\", 6); // Increase size on hover\n })\n .on(\"mouseout\", function () {\n d3.select(this).attr(\"r\", 4); // Return to normal size\n });\n }\n\n }\n });\n }, [data, yAxisData, xAxisData, height, containerWidth, colors, margin, line, yAxisLabelType, currency, customLabelFormatter]);\n\n return (\n <div ref={wrapperRef} style={{ width: '100%', height: '100%' }}>\n <div style={{ position: 'relative' }}>\n <svg ref={svgRef} width=\"100%\" height={height} viewBox={`0 0 ${containerWidth} ${height}`} />\n </div>\n </div>\n );\n};\n\nexport default MultiLineChart;\n"],"names":["data","yAxisData","xAxisData","colors","height","margin","top","right","bottom","left","line","yAxisLabelType","currency","customLabelFormatter","svgRef","useRef","wrapperRef","containerWidth","setContainerWidth","useState","useEffect","wrapper","current","resizeObserver","ResizeObserver","entries","newWidth","contentRect","width","observe","unobserve","svg","d3.select","selectAll","remove","innerWidth","innerHeight","x","d3.scaleLinear","domain","length","range","y","d3.max","nice","xAxis","append","attr","call","d3.axisBottom","ticks","tickFormat","d","i","style","select","yAxis","d3.axisLeft","tickPadding","num","symbol","labelType","d3.format","replace","toString","tickSizeOuter","enter","Object","keys","forEach","key","index","chartLine","d3.line","curve","isSmooth","d3.curveMonotoneX","d3.curveLinear","datum","_a","on","this","_b","displayDot","_c","jsx","ref","children","position","viewBox"],"mappings":"orBA2BuB,EACnBA,OACAC,YACAC,YACAC,SAAS,CAAC,YAAa,SAAU,QAAS,OAC1CC,SAAS,IACTC,SAAS,CAAEC,IAAK,GAAIC,MAAO,GAAIC,OAAQ,GAAIC,KAAM,IAAGC,KACpDA,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,eAAgB,EACzC,GACCiC,GAAG,WAAY,WACZhD,EAAAA,QAAUiD,MAAMlC,KAAK,eAAgB,EACzC,IAKA,OAAAmC,EAAAlF,EAAKsE,SAAL,EAAAY,EAAWC,aACXpD,EAAIE,UAAU,WAAWqC,KACpBtE,KAAK,OAAAoF,EAAApF,EAAKsE,SAAL,EAAAc,EAAWpF,MAChBkE,QACApB,OAAO,UACPC,KAAK,QAAS,UAAUuB,KACxBvB,KAAK,KAAM,CAACK,EAAGC,IAAMhB,EAAEgB,GAAKhD,EAAOI,MACnCsC,KAAK,KAAOK,GAAWV,EAAEU,GAAK/C,EAAOC,KACrCyC,KAAK,IAAK,GACVA,KAAK,OAAQ5C,EAAOoE,EAAQpE,EAAOqC,SACnCO,KAAK,SAAU,SACfA,KAAK,eAAgB,KACrBiC,GAAG,YAAa,WACbhD,EAAAA,QAAUiD,MAAMlC,KAAK,IAAK,EAC9B,GACCiC,GAAG,WAAY,WACZhD,EAAAA,QAAUiD,MAAMlC,KAAK,IAAK,EAC9B,EAGZ,KAEL,CAAC/C,EAAMC,EAAWC,EAAWE,EAAQa,EAAgBd,EAAQE,EAAQK,EAAMC,EAAgBC,EAAUC,qBAGpGwE,IAAC,MAAA,CAAIC,IAAKtE,EAAYsC,MAAO,CAAE1B,MAAO,OAAQxB,OAAQ,QAClDmF,wBAAAF,EAAAA,IAAC,MAAA,CAAI/B,MAAO,CAAEkC,SAAU,YACpBD,0BAAAF,IAAC,MAAA,CAAIC,IAAKxE,EAAQc,MAAM,OAAOxB,SAAgBqF,QAAS,OAAOxE,KAAkBb"}
@@ -30,13 +30,13 @@ import DialogTitle from "../../../node_modules/@mui/material/DialogTitle/DialogT
30
30
  import Box from "../../../node_modules/@mui/material/Box/Box/index.esm.js";
31
31
  import MenuItem from "../../../node_modules/@mui/material/MenuItem/MenuItem/index.esm.js";
32
32
  import IconButton from "../../../node_modules/@mui/material/IconButton/IconButton/index.esm.js";
33
+ import { Edit } from "../../icons/edit/index.esm.js";
33
34
  import OutlinedInput from "../../../node_modules/@mui/material/OutlinedInput/OutlinedInput/index.esm.js";
34
35
  import InputAdornment from "../../../node_modules/@mui/material/InputAdornment/InputAdornment/index.esm.js";
35
36
  import Close from "../../../node_modules/@mui/icons-material/esm/Close/index.esm.js";
36
37
  import DialogContent from "../../../node_modules/@mui/material/DialogContent/DialogContent/index.esm.js";
37
38
  import Alert from "../../../node_modules/@mui/material/Alert/Alert/index.esm.js";
38
39
  import DialogActions from "../../../node_modules/@mui/material/DialogActions/DialogActions/index.esm.js";
39
- import { Edit } from "../../icons/edit/index.esm.js";
40
40
  import { Trash } from "../../icons/trash/index.esm.js";
41
41
  setBaseUrl(`${void 0}/system-feature`);
42
42
  const initialQuery = { combinator: "and", rules: [] };
@@ -1,21 +1,21 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("react"),r=require("react-querybuilder"),t=;/* empty css */;/* empty css */var i=,/* empty css */n=,/* empty css */s=,/* empty css */a=,/* empty css */o=,/* empty css */u=,/* empty css */d=,/* empty css */c=,/* empty css */m=,/* empty css */f=,/* empty css */x=,/* empty css */p=,/* empty css */h=,/* empty css */j=,/* empty css */v=,/* empty css */g=,/* empty css */q=,/* empty css */y=require("lodash"),b=,/* empty css */S=,/* empty css */C=require("react-router-dom"),k=,/* empty css */_=,/* empty css */A=,/* empty css */I=,/* empty css */F=,/* empty css */N=,/* empty css */w=,/* empty css */E=,/* empty css */D=,/* empty css */z=,/* empty css */P=,/* empty css */T=,/* empty css */B=,/* empty css */M=;/* empty css */function R(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var L=/* @__PURE__ */R(y);j.setBaseUrl("undefined/system-feature");const Q={combinator:"and",rules:[]};exports.default=({open:y,onClose:R,savedFilters:O,fetchSavedFilters:V,onSaveFilter:W,onSelectedFilter:G,applyFilter:U,fields:K=[]})=>{const H=C.useLocation(),J=localStorage.getItem(v.auth.storageTokenKeyName),{updatePageInfo:X,activePage:Y,schemaFields:Z,setActivePage:$}=q.usePages();K=Z.length?g.generateFields(Z):K;const[ee,le]=l.useState(Q),[re,te]=l.useState(O??[]),[ie,ne]=l.useState(null),[se,ae]=l.useState(null),[oe,ue]=l.useState(null),{isRtl:de}=k.useLanguage(),ce=l.useMemo(()=>S.routeToResourceMap[H.pathname]||null,[H.pathname]);l.useEffect(()=>{O&&te(O)},[O]);const me=l.useCallback((e=!1)=>{let l=ee;if(pe(l))ue("Invalid filter");else if(e)l=Q,le(l);else{const e=l?g.generateQueryString(l):l;X({filters:l,filterQueryString:e}),R()}},[ee,U,R]),fe=e=>{e?(ne(e),le(e.query),G&&G(e)):(ne(null),le(Q),G&&G(null))},xe=e=>{const l=null==O?void 0:O.filter(l=>l.name.toLowerCase().includes(e.toLowerCase()));l&&te(l)};l.useEffect(()=>{let e=Q;L.default.isEmpty(Y.filters)||(e=Y.filters),le(e);const l=null==O?void 0:O.find(e=>{var l;return e.name===(null==(l=null==Y?void 0:Y.filters)?void 0:l.name)});ne(l||null)},[null==Y?void 0:Y.filters,O]);const pe=e=>{var l,r;let t=[];return null==(l=null==e?void 0:e.rules)||l.forEach(l=>{if(t.includes(l.field)&&"and"==e.combinator)return!0;t.push(l.field)}),t.length!==(null==(r=null==e?void 0:e.rules)?void 0:r.length)},he=e=>Array.isArray(e.rules)?e.rules.length?e.rules.some(he):!e.rules.length:!e.field||L.default.isEmpty(e.value)&&!["null","notNull"].includes(e.operator),je=l.useMemo(()=>he(ee)||oe,[ee,oe]);/* @__PURE__ */
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("react"),r=require("react-querybuilder"),t=;/* empty css */;/* empty css */var i=,/* empty css */n=,/* empty css */s=,/* empty css */a=,/* empty css */o=,/* empty css */u=,/* empty css */d=,/* empty css */c=,/* empty css */m=,/* empty css */f=,/* empty css */x=,/* empty css */p=,/* empty css */h=,/* empty css */j=,/* empty css */v=,/* empty css */g=,/* empty css */q=,/* empty css */y=require("lodash"),b=,/* empty css */S=,/* empty css */C=require("react-router-dom"),k=,/* empty css */_=,/* empty css */A=,/* empty css */I=,/* empty css */F=,/* empty css */N=,/* empty css */w=,/* empty css */E=,/* empty css */D=,/* empty css */z=,/* empty css */P=,/* empty css */T=,/* empty css */B=,/* empty css */M=;/* empty css */function R(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var L=/* @__PURE__ */R(y);j.setBaseUrl("undefined/system-feature");const Q={combinator:"and",rules:[]};exports.default=({open:y,onClose:R,savedFilters:O,fetchSavedFilters:V,onSaveFilter:W,onSelectedFilter:G,applyFilter:U,fields:K=[]})=>{const H=C.useLocation(),J=localStorage.getItem(v.auth.storageTokenKeyName),{updatePageInfo:X,activePage:Y,schemaFields:Z,setActivePage:$}=q.usePages();K=Z.length?g.generateFields(Z):K;const[ee,le]=l.useState(Q),[re,te]=l.useState(O??[]),[ie,ne]=l.useState(null),[se,ae]=l.useState(null),[oe,ue]=l.useState(null),{isRtl:de}=k.useLanguage(),ce=l.useMemo(()=>S.routeToResourceMap[H.pathname]||null,[H.pathname]);l.useEffect(()=>{O&&te(O)},[O]);const me=l.useCallback((e=!1)=>{let l=ee;if(pe(l))ue("Invalid filter");else if(e)l=Q,le(l);else{const e=l?g.generateQueryString(l):l;X({filters:l,filterQueryString:e}),R()}},[ee,U,R]),fe=e=>{e?(ne(e),le(e.query),G&&G(e)):(ne(null),le(Q),G&&G(null))},xe=e=>{const l=null==O?void 0:O.filter(l=>l.name.toLowerCase().includes(e.toLowerCase()));l&&te(l)};l.useEffect(()=>{let e=Q;L.default.isEmpty(Y.filters)||(e=Y.filters),le(e);const l=null==O?void 0:O.find(e=>{var l;return e.name===(null==(l=null==Y?void 0:Y.filters)?void 0:l.name)});ne(l||null)},[null==Y?void 0:Y.filters,O]);const pe=e=>{var l,r;let t=[];return null==(l=null==e?void 0:e.rules)||l.forEach(l=>{if(t.includes(l.field)&&"and"==e.combinator)return!0;t.push(l.field)}),t.length!==(null==(r=null==e?void 0:e.rules)?void 0:r.length)},he=e=>Array.isArray(e.rules)?e.rules.length?e.rules.some(he):!e.rules.length:!e.field||L.default.isEmpty(e.value)&&!["null","notNull"].includes(e.operator),je=l.useMemo(()=>he(ee)||oe,[ee,oe]);/* @__PURE__ */
2
2
  return e.jsx("div",{children:/* @__PURE__ */e.jsxs(_.default,{open:y,onClose:R,maxWidth:"md",fullWidth:!0,PaperProps:{sx:{borderRadius:2}},children:[
3
3
  /* @__PURE__ */e.jsxs(A.default,{className:"filter-header",children:[
4
4
  /* @__PURE__ */e.jsx(n.Typography,{type:"s3",weight:"medium",color:"theme.secondary.1000",children:"Filters"}),
5
5
  /* @__PURE__ */e.jsxs(I.default,{gap:1,display:"flex",children:[
6
- /* @__PURE__ */e.jsxs(i.default,{fullWidth:!0,size:"small",className:"filter-dropdown",value:ie?ie.name:"Saved Filters",onChange:e=>{const l=null==O?void 0:O.find(l=>l.name==e.target.value);fe(l)},variant:"outlined",onClose:()=>{setTimeout(()=>{xe("")},500)},input:ie?/* @__PURE__ */e.jsx(w.default,{label:"",endAdornment:/* @__PURE__ */e.jsx(E.default,{position:"end",children:/* @__PURE__ */e.jsx(N.default,{"aria-label":"clear selection",onClick:()=>{fe()},edge:"end",sx:{mr:1.5},size:"small",children:/* @__PURE__ */e.jsx(D.default,{sx:{fontSize:"1rem"}})})})}):void 0,children:[
6
+ /* @__PURE__ */e.jsxs(i.default,{fullWidth:!0,size:"small",className:"filter-dropdown",value:ie?ie.name:"Saved Filters",onChange:e=>{const l=null==O?void 0:O.find(l=>l.name==e.target.value);fe(l)},variant:"outlined",onClose:()=>{setTimeout(()=>{xe("")},500)},input:ie?/* @__PURE__ */e.jsx(E.default,{label:"",endAdornment:/* @__PURE__ */e.jsx(D.default,{position:"end",children:/* @__PURE__ */e.jsx(N.default,{"aria-label":"clear selection",onClick:()=>{fe()},edge:"end",sx:{mr:1.5},size:"small",children:/* @__PURE__ */e.jsx(z.default,{sx:{fontSize:"1rem"}})})})}):void 0,children:[
7
7
  /* @__PURE__ */e.jsx("div",{className:"searchbar-box-list",children:/* @__PURE__ */e.jsx(p.default,{placeholder:"Search Filters",handleSearch:e=>xe(e)})}),null==re?void 0:re.map(l=>/* @__PURE__ */e.jsxs(F.default,{value:null==l?void 0:l.name,className:"menu-list",selected:(null==ie?void 0:ie.name)==(null==l?void 0:l.name),children:[
8
8
  /* @__PURE__ */e.jsx(n.Typography,{color:"theme.secondary.1000",type:"s3",children:null==l?void 0:l.name}),
9
9
  /* @__PURE__ */e.jsxs("div",{className:"icon-list",children:[
10
- /* @__PURE__ */e.jsx(N.default,{size:"small",onClick:e=>{e.preventDefault(),e.stopPropagation(),ae(l)},children:/* @__PURE__ */e.jsx(B.Edit,{fontSize:"small",color:(null==ie?void 0:ie.name)==(null==l?void 0:l.name)?"theme.primary.800":"inherit"})}),
10
+ /* @__PURE__ */e.jsx(N.default,{size:"small",onClick:e=>{e.preventDefault(),e.stopPropagation(),ae(l)},children:/* @__PURE__ */e.jsx(w.Edit,{fontSize:"small",color:(null==ie?void 0:ie.name)==(null==l?void 0:l.name)?"theme.primary.800":"inherit"})}),
11
11
  /* @__PURE__ */e.jsx(N.default,{size:"small",onClick:e=>{e.preventDefault(),e.stopPropagation(),(async e=>{const l={"x-token":J,id:e};j.deleteV1FilterId(l).then(e=>{ne(null),le(Q),V&&V()}).catch(e=>{})})(l.id)},color:"error",children:/* @__PURE__ */e.jsx(M.Trash,{fontSize:"small",color:"theme.error.600"})})]})]},l.id))]}),
12
12
  /* @__PURE__ */e.jsx(h.default,{open:null!==se,onClose:()=>ae(null),handleSubmit:e=>(e=>{if(se)return(async(e,l)=>{const r={"x-token":J,id:e,name:l,module:(null==ce?void 0:ce.fieldResource)||(null==ce?void 0:ce.pageResource)};try{await j.putV1FilterId(r),V&&V(),b.enqueueSnackbar("Filters renamed successfully.")}catch(t){let e="Something went wrong on saving filters";return t instanceof Error&&(e=g.getErrorMessage(t.message)),b.enqueueSnackbar(e,{variant:"error"}),!1}return!0})(se.id,e)})(e),oldName:null==se?void 0:se.name}),
13
- /* @__PURE__ */e.jsx(I.default,{children:/* @__PURE__ */e.jsx(N.default,{size:"small",onClick:R,children:/* @__PURE__ */e.jsx(D.default,{fontSize:"small"})})})]})]}),
14
- /* @__PURE__ */e.jsxs(z.default,{className:"content",children:[oe&&/* @__PURE__ */e.jsx(P.default,{severity:"error",sx:{px:1,pt:.5,mb:1},children:/* @__PURE__ */e.jsx(n.Typography,{color:"error",type:"s4",children:oe})}),
13
+ /* @__PURE__ */e.jsx(I.default,{children:/* @__PURE__ */e.jsx(N.default,{size:"small",onClick:R,children:/* @__PURE__ */e.jsx(z.default,{fontSize:"small"})})})]})]}),
14
+ /* @__PURE__ */e.jsxs(P.default,{className:"content",children:[oe&&/* @__PURE__ */e.jsx(T.default,{severity:"error",sx:{px:1,pt:.5,mb:1},children:/* @__PURE__ */e.jsx(n.Typography,{color:"error",type:"s4",children:oe})}),
15
15
  /* @__PURE__ */e.jsxs(t.QueryBuilderMaterial,{children:[
16
16
  /* @__PURE__ */e.jsx(r.QueryBuilder,{fields:K||[],query:ee,onQueryChange:e=>{const l=e.rules.map((e,l)=>{var r,t;return{...e,value:e.field!==(null==(t=null==(r=ee.rules)?void 0:r[l])?void 0:t.field)||["null","notNull"].includes(e.operator)?"":e.value}});le({...e,rules:l}),ue(null),W&&W(e)},showCombinatorsBetweenRules:!0,controlClassnames:{header:"actions"},controlElements:{addRuleAction:u.default,addGroupAction:d.default,combinatorSelector:s.default,fieldSelector:o.default,operatorSelector:m.default,removeRuleAction:a.default,valueEditor:c.default,removeGroupAction:x.default}}),
17
17
  /* @__PURE__ */e.jsx(f.default,{variant:"text",className:de?"remove-filters_rtl":"remove-filters",onClick:()=>{me(!0)},disabled:je,children:"Clear all filters"})]})]}),
18
- /* @__PURE__ */e.jsx(T.default,{className:"filter-footer",children:/* @__PURE__ */e.jsxs(I.default,{sx:{display:"flex",alignItems:"center",justifyContent:ie?"space-between":"flex-end",width:"100%"},children:[ie&&/* @__PURE__ */e.jsx(I.default,{children:/* @__PURE__ */e.jsx(f.default,{onClick:async()=>{if(ie){const e={"x-token":J,id:ie.id,data:ee};j.putV1FilterId(e).then(e=>{V&&V(),$(e=>({...e,filters:{...e.filters,rules:ee.rules,combinator:ee.combinator,name:ie.name}}))}).catch(e=>b.enqueueSnackbar("Error renaming saved filters:",{variant:"error"}))}},children:"Update Seleted filter"})}),
18
+ /* @__PURE__ */e.jsx(B.default,{className:"filter-footer",children:/* @__PURE__ */e.jsxs(I.default,{sx:{display:"flex",alignItems:"center",justifyContent:ie?"space-between":"flex-end",width:"100%"},children:[ie&&/* @__PURE__ */e.jsx(I.default,{children:/* @__PURE__ */e.jsx(f.default,{onClick:async()=>{if(ie){const e={"x-token":J,id:ie.id,data:ee};j.putV1FilterId(e).then(e=>{V&&V(),$(e=>({...e,filters:{...e.filters,rules:ee.rules,combinator:ee.combinator,name:ie.name}}))}).catch(e=>b.enqueueSnackbar("Error renaming saved filters:",{variant:"error"}))}},children:"Update Seleted filter"})}),
19
19
  /* @__PURE__ */e.jsxs(I.default,{sx:{display:"flex",gap:1},children:[
20
20
  /* @__PURE__ */e.jsx(f.default,{className:"cancel-filter-btn",onClick:R,children:"Cancel"}),
21
21
  /* @__PURE__ */e.jsx(f.default,{disabled:je,onClick:()=>me(),children:"Apply"})]})]})})]})})};
@@ -0,0 +1,131 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { Typography } from "../../../typography/typography/index.esm.js";
4
+ import { formatDate } from "../../../../utils/dateFormat/index.esm.js";
5
+ import Menu from "../../../menu/menu/index.esm.js";
6
+ import Card from "../../../../node_modules/@mui/material/Card/Card/index.esm.js";
7
+ import CardContent from "../../../../node_modules/@mui/material/CardContent/CardContent/index.esm.js";
8
+ import Box from "../../../../node_modules/@mui/material/Box/Box/index.esm.js";
9
+ import IconButton from "../../../../node_modules/@mui/material/IconButton/IconButton/index.esm.js";
10
+ import MenuItem from "../../../../node_modules/@mui/material/MenuItem/MenuItem/index.esm.js";
11
+ import { MoreIcon } from "../../../icons/more/index.esm.js";
12
+ const CustomGridCard = ({
13
+ title,
14
+ subTitle,
15
+ children,
16
+ data,
17
+ rowActionMenu,
18
+ destructiveActionMenu
19
+ }) => {
20
+ const [rowAnchorEl, setRowAnchorEl] = useState(null);
21
+ const [row, setRow] = useState(null);
22
+ const handleMenuOpen = (e, currencyRow) => {
23
+ setRow(currencyRow);
24
+ setRowAnchorEl(e.currentTarget);
25
+ };
26
+ return /* @__PURE__ */ jsxs(
27
+ Card,
28
+ {
29
+ sx: {
30
+ width: "16.625rem",
31
+ borderRadius: "0.5rem",
32
+ border: "0.5px solid #eeeff1",
33
+ // backgroundColor: 'theme.secondary.100',
34
+ boxShadow: `
35
+ 0px 0px 2px 0px #e0e0e0,
36
+ 0px 1px 4px -2px rgba(24, 39, 75, 0.02),
37
+ 0px 4px 4px -2px rgba(24, 39, 75, 0.06);`
38
+ // m: 3
39
+ },
40
+ children: [
41
+ /* @__PURE__ */ jsxs(
42
+ CardContent,
43
+ {
44
+ sx: {
45
+ display: "flex",
46
+ flexDirection: "column",
47
+ padding: "1rem 1rem 1.25rem 1rem",
48
+ justifyContent: "space-between",
49
+ alignItems: "flex-start",
50
+ flexShrink: 0
51
+ },
52
+ children: [
53
+ /* @__PURE__ */ jsxs(
54
+ Box,
55
+ {
56
+ sx: {
57
+ display: "flex",
58
+ width: "100%",
59
+ justifyContent: "space-between",
60
+ alignItems: "flex-start"
61
+ // marginBottom: 1
62
+ },
63
+ children: [
64
+ /* @__PURE__ */ jsx(Typography, { type: "s3", weight: "medium", color: "theme.secondary.1000", children: title }),
65
+ /* @__PURE__ */ jsx(
66
+ IconButton,
67
+ {
68
+ color: "inherit",
69
+ size: "small",
70
+ onClick: (e) => handleMenuOpen(e, data),
71
+ children: /* @__PURE__ */ jsx(
72
+ MoreIcon,
73
+ {
74
+ sx: { transform: "rotate(90deg)" },
75
+ orient: "vertical",
76
+ fontSize: "small"
77
+ }
78
+ )
79
+ }
80
+ )
81
+ ]
82
+ }
83
+ ),
84
+ /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Typography, { type: "s4", color: "theme.secondary.800", children: subTitle }) }),
85
+ children,
86
+ (data == null ? void 0 : data.created_at) && /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Typography, { type: "s4", color: "theme.secondary.800", children: [
87
+ "Created On ",
88
+ formatDate(data == null ? void 0 : data.created_at, "DD MMM, YYYY")
89
+ ] }) })
90
+ ]
91
+ }
92
+ ),
93
+ /* @__PURE__ */ jsxs(
94
+ Menu,
95
+ {
96
+ anchorEl: rowAnchorEl,
97
+ open: Boolean(rowAnchorEl),
98
+ onClose: () => setRowAnchorEl(null),
99
+ children: [
100
+ /* @__PURE__ */ jsx(Box, { children: rowActionMenu.map((item) => /* @__PURE__ */ jsx(
101
+ MenuItem,
102
+ {
103
+ onClick: () => {
104
+ row && item.handleAction(row);
105
+ setRowAnchorEl(null);
106
+ },
107
+ children: /* @__PURE__ */ jsx(Typography, { type: "s4", color: "inherit", children: item.label })
108
+ }
109
+ )) }),
110
+ /* @__PURE__ */ jsx(Box, { className: "dropdown-inner--DestructiveHeader", children: destructiveActionMenu.map((item) => /* @__PURE__ */ jsx(
111
+ MenuItem,
112
+ {
113
+ onClick: () => {
114
+ row && item.handleAction(row);
115
+ setRowAnchorEl(null);
116
+ },
117
+ className: "dropdown-inner--DestructiveActions",
118
+ children: /* @__PURE__ */ jsx(Typography, { type: "s4", color: "inherit", children: item.label })
119
+ }
120
+ )) })
121
+ ]
122
+ }
123
+ )
124
+ ]
125
+ }
126
+ );
127
+ };
128
+ export {
129
+ CustomGridCard as default
130
+ };
131
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../../../../../src/components/grid/custom-grid-card/custom-grid-card.tsx"],"sourcesContent":["import { Box, Card, CardContent, IconButton, MenuItem } from '@mui/material';\nimport React, { useState } from 'react';\nimport Typography, { ITypography } from '../../typography/typography';\nimport { MoreIcon } from '../../icons';\nimport { formatDate } from '../../../utils/dateFormat';\n// import Chip from '../../chip/chip';\nimport Menu from '../../menu/menu';\n\ninterface CustomGridCardProps {\n\ttitle: React.ReactNode | string;\n\tsubTitle?: React.ReactNode | string;\n\tchildren?: React.ReactNode | string;\n\ttitleProps?: ITypography;\n\tdata: Record<any, any>;\n\trowActionMenu: any[];\n\tdestructiveActionMenu: any[];\n}\n\nconst CustomGridCard: React.FC<CustomGridCardProps> = ({\n\ttitle,\n\tsubTitle,\n\tchildren,\n\tdata,\n\trowActionMenu,\n\tdestructiveActionMenu\n}) => {\n\tconst [rowAnchorEl, setRowAnchorEl] = useState<HTMLElement | null>(null);\n\tconst [row, setRow] = useState<[] | null>(null);\n\n\tconst handleMenuOpen = (\n\t\te: React.MouseEvent<HTMLButtonElement>,\n\t\tcurrencyRow: []\n\t) => {\n\t\tsetRow(currencyRow);\n\t\tsetRowAnchorEl(e.currentTarget);\n\t};\n\n\treturn (\n\t\t<Card\n\t\t\tsx={{\n\t\t\t\twidth: '16.625rem',\n\t\t\t\tborderRadius: '0.5rem',\n\t\t\t\tborder: '0.5px solid #eeeff1',\n\t\t\t\t// backgroundColor: 'theme.secondary.100',\n\t\t\t\tboxShadow: `\n 0px 0px 2px 0px #e0e0e0,\n 0px 1px 4px -2px rgba(24, 39, 75, 0.02),\n 0px 4px 4px -2px rgba(24, 39, 75, 0.06);`\n\t\t\t\t// m: 3\n\t\t\t}}>\n\t\t\t<CardContent\n\t\t\t\tsx={{\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\tpadding: '1rem 1rem 1.25rem 1rem',\n\t\t\t\t\tjustifyContent: 'space-between',\n\t\t\t\t\talignItems: 'flex-start',\n\t\t\t\t\tflexShrink: 0\n\t\t\t\t}}>\n\t\t\t\t{/* Title & More Button */}\n\t\t\t\t<Box\n\t\t\t\t\tsx={{\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\tjustifyContent: 'space-between',\n\t\t\t\t\t\talignItems: 'flex-start'\n\t\t\t\t\t\t// marginBottom: 1\n\t\t\t\t\t}}>\n\t\t\t\t\t<Typography type='s3' weight='medium' color='theme.secondary.1000'>\n\t\t\t\t\t\t{title}\n\t\t\t\t\t</Typography>\n\t\t\t\t\t<IconButton\n\t\t\t\t\t\tcolor='inherit'\n\t\t\t\t\t\tsize='small'\n\t\t\t\t\t\tonClick={(e) => handleMenuOpen(e, data)}>\n\t\t\t\t\t\t<MoreIcon\n\t\t\t\t\t\t\tsx={{ transform: 'rotate(90deg)' }}\n\t\t\t\t\t\t\torient='vertical'\n\t\t\t\t\t\t\tfontSize='small'\n\t\t\t\t\t\t/>\n\t\t\t\t\t</IconButton>\n\t\t\t\t</Box>\n\t\t\t\t{/* Sub Title */}\n\t\t\t\t<Box>\n\t\t\t\t\t<Typography type='s4' color='theme.secondary.800'>\n\t\t\t\t\t\t{subTitle}\n\t\t\t\t\t</Typography>\n\t\t\t\t</Box>\n\t\t\t\t{children}\n\t\t\t\t{data?.created_at && (\n\t\t\t\t\t<Box>\n\t\t\t\t\t\t<Typography type='s4' color='theme.secondary.800'>\n\t\t\t\t\t\t\tCreated On {formatDate(data?.created_at, 'DD MMM, YYYY')}\n\t\t\t\t\t\t</Typography>\n\t\t\t\t\t</Box>\n\t\t\t\t)}\n\t\t\t</CardContent>\n\n\t\t\t{/* Action Menu */}\n\t\t\t<Menu\n\t\t\t\tanchorEl={rowAnchorEl}\n\t\t\t\topen={Boolean(rowAnchorEl)}\n\t\t\t\tonClose={() => setRowAnchorEl(null)}>\n\t\t\t\t<Box>\n\t\t\t\t\t{rowActionMenu.map((item) => (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\trow && item.handleAction(row);\n\t\t\t\t\t\t\t\tsetRowAnchorEl(null);\n\t\t\t\t\t\t\t}}>\n\t\t\t\t\t\t\t<Typography type='s4' color='inherit'>\n\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t))}\n\t\t\t\t</Box>\n\t\t\t\t<Box className='dropdown-inner--DestructiveHeader'>\n\t\t\t\t\t{destructiveActionMenu.map((item) => (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\trow && item.handleAction(row);\n\t\t\t\t\t\t\t\tsetRowAnchorEl(null);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tclassName='dropdown-inner--DestructiveActions'>\n\t\t\t\t\t\t\t<Typography type='s4' color='inherit'>\n\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t))}\n\t\t\t\t</Box>\n\t\t\t</Menu>\n\t\t</Card>\n\t);\n};\n\nexport default CustomGridCard;\n"],"names":[],"mappings":";;;;;;;;;;;AAkBA,MAAM,iBAAgD,CAAC;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,MAAM;AACL,QAAM,CAAC,aAAa,cAAc,IAAI,SAA6B,IAAI;AACvE,QAAM,CAAC,KAAK,MAAM,IAAI,SAAoB,IAAI;AAE9C,QAAM,iBAAiB,CACtB,GACA,gBACI;AACJ,WAAO,WAAW;AAClB,mBAAe,EAAE,aAAa;AAAA,EAC/B;AAEA,SACC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,IAAI;AAAA,QACH,OAAO;AAAA,QACP,cAAc;AAAA,QACd,QAAQ;AAAA;AAAA,QAER,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA,MAAA;AAAA,MAMZ,UAAA;AAAA,QAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACA,IAAI;AAAA,cACH,SAAS;AAAA,c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