@semcore/d3-chart 16.5.0 → 17.0.0-prerelease.8

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 (439) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/lib/cjs/AnimatedClipPath.js +28 -41
  3. package/lib/cjs/AnimatedClipPath.js.map +1 -1
  4. package/lib/cjs/Area.js +187 -223
  5. package/lib/cjs/Area.js.map +1 -1
  6. package/lib/cjs/Axis.js +248 -327
  7. package/lib/cjs/Axis.js.map +1 -1
  8. package/lib/cjs/Bar.js +162 -185
  9. package/lib/cjs/Bar.js.map +1 -1
  10. package/lib/cjs/Bubble.js +219 -248
  11. package/lib/cjs/Bubble.js.map +1 -1
  12. package/lib/cjs/CompactHorizontalBar.js +448 -482
  13. package/lib/cjs/CompactHorizontalBar.js.map +1 -1
  14. package/lib/cjs/Donut.js +349 -396
  15. package/lib/cjs/Donut.js.map +1 -1
  16. package/lib/cjs/Dots.js +67 -86
  17. package/lib/cjs/Dots.js.map +1 -1
  18. package/lib/cjs/GroupBar.js +78 -93
  19. package/lib/cjs/GroupBar.js.map +1 -1
  20. package/lib/cjs/HorizontalBar.js +149 -167
  21. package/lib/cjs/HorizontalBar.js.map +1 -1
  22. package/lib/cjs/Hover.js +178 -207
  23. package/lib/cjs/Hover.js.map +1 -1
  24. package/lib/cjs/Line.js +182 -222
  25. package/lib/cjs/Line.js.map +1 -1
  26. package/lib/cjs/Pattern.js +124 -126
  27. package/lib/cjs/Pattern.js.map +1 -1
  28. package/lib/cjs/Plot.js +100 -126
  29. package/lib/cjs/Plot.js.map +1 -1
  30. package/lib/cjs/Radar.js +576 -681
  31. package/lib/cjs/Radar.js.map +1 -1
  32. package/lib/cjs/RadialTree.js +518 -571
  33. package/lib/cjs/RadialTree.js.map +1 -1
  34. package/lib/cjs/Reference.js +147 -178
  35. package/lib/cjs/Reference.js.map +1 -1
  36. package/lib/cjs/ResponsiveContainer.js +64 -82
  37. package/lib/cjs/ResponsiveContainer.js.map +1 -1
  38. package/lib/cjs/ScatterPlot.js +169 -199
  39. package/lib/cjs/ScatterPlot.js.map +1 -1
  40. package/lib/cjs/StackBar.js +135 -177
  41. package/lib/cjs/StackBar.js.map +1 -1
  42. package/lib/cjs/StackedArea.js +60 -73
  43. package/lib/cjs/StackedArea.js.map +1 -1
  44. package/lib/cjs/Tooltip.js +193 -208
  45. package/lib/cjs/Tooltip.js.map +1 -1
  46. package/lib/cjs/Venn.js +182 -217
  47. package/lib/cjs/Venn.js.map +1 -1
  48. package/lib/cjs/a11y/DataAccessibilityTable.js +45 -83
  49. package/lib/cjs/a11y/DataAccessibilityTable.js.map +1 -1
  50. package/lib/cjs/a11y/PlotA11yModule.js +37 -97
  51. package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
  52. package/lib/cjs/a11y/PlotA11yView.js +97 -91
  53. package/lib/cjs/a11y/PlotA11yView.js.map +1 -1
  54. package/lib/cjs/a11y/bezier.js +17 -23
  55. package/lib/cjs/a11y/bezier.js.map +1 -1
  56. package/lib/cjs/a11y/focus.js +16 -16
  57. package/lib/cjs/a11y/focus.js.map +1 -1
  58. package/lib/cjs/a11y/hints.js +72 -75
  59. package/lib/cjs/a11y/hints.js.map +1 -1
  60. package/lib/cjs/a11y/insights.js +354 -525
  61. package/lib/cjs/a11y/insights.js.map +1 -1
  62. package/lib/cjs/a11y/intl.js +5 -5
  63. package/lib/cjs/a11y/intl.js.map +1 -1
  64. package/lib/cjs/a11y/locale.js +12 -19
  65. package/lib/cjs/a11y/locale.js.map +1 -1
  66. package/lib/cjs/a11y/serialize.js +164 -203
  67. package/lib/cjs/a11y/serialize.js.map +1 -1
  68. package/lib/cjs/a11y/summarize.js +7 -6
  69. package/lib/cjs/a11y/summarize.js.map +1 -1
  70. package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js +16 -16
  71. package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
  72. package/lib/cjs/a11y/translations/module/de.json +2 -2
  73. package/lib/cjs/a11y/translations/module/en.json +2 -2
  74. package/lib/cjs/a11y/translations/module/es.json +2 -2
  75. package/lib/cjs/a11y/translations/module/fr.json +2 -2
  76. package/lib/cjs/a11y/translations/module/it.json +2 -2
  77. package/lib/cjs/a11y/translations/module/ja.json +2 -2
  78. package/lib/cjs/a11y/translations/module/ko.json +2 -2
  79. package/lib/cjs/a11y/translations/module/nl.json +2 -2
  80. package/lib/cjs/a11y/translations/module/pl.json +2 -2
  81. package/lib/cjs/a11y/translations/module/pt.json +2 -2
  82. package/lib/cjs/a11y/translations/module/sv.json +2 -2
  83. package/lib/cjs/a11y/translations/module/tr.json +2 -2
  84. package/lib/cjs/a11y/translations/module/vi.json +2 -2
  85. package/lib/cjs/a11y/translations/module/zh.json +2 -2
  86. package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js +16 -16
  87. package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
  88. package/lib/cjs/color.js +1 -1
  89. package/lib/cjs/color.js.map +1 -1
  90. package/lib/cjs/component/Chart/AbstractChart.js +421 -466
  91. package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
  92. package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
  93. package/lib/cjs/component/Chart/AreaChart.js +97 -115
  94. package/lib/cjs/component/Chart/AreaChart.js.map +1 -1
  95. package/lib/cjs/component/Chart/AreaChart.type.js.map +1 -1
  96. package/lib/cjs/component/Chart/BarChart.js +229 -216
  97. package/lib/cjs/component/Chart/BarChart.js.map +1 -1
  98. package/lib/cjs/component/Chart/BarChart.type.js.map +1 -1
  99. package/lib/cjs/component/Chart/BubbleChart.js +114 -136
  100. package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
  101. package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -1
  102. package/lib/cjs/component/Chart/CigaretteChart.js +280 -305
  103. package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
  104. package/lib/cjs/component/Chart/CompactHorizontalBarChart.js +76 -108
  105. package/lib/cjs/component/Chart/CompactHorizontalBarChart.js.map +1 -1
  106. package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
  107. package/lib/cjs/component/Chart/DonutChart.js +80 -95
  108. package/lib/cjs/component/Chart/DonutChart.js.map +1 -1
  109. package/lib/cjs/component/Chart/DonutChart.type.js.map +1 -1
  110. package/lib/cjs/component/Chart/HistogramChart.js +126 -148
  111. package/lib/cjs/component/Chart/HistogramChart.js.map +1 -1
  112. package/lib/cjs/component/Chart/HistogramChart.type.js.map +1 -1
  113. package/lib/cjs/component/Chart/LineChart.js +95 -113
  114. package/lib/cjs/component/Chart/LineChart.js.map +1 -1
  115. package/lib/cjs/component/Chart/LineChart.type.js.map +1 -1
  116. package/lib/cjs/component/Chart/RadarChart.js +84 -110
  117. package/lib/cjs/component/Chart/RadarChart.js.map +1 -1
  118. package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
  119. package/lib/cjs/component/Chart/ScatterPlotChart.js +119 -143
  120. package/lib/cjs/component/Chart/ScatterPlotChart.js.map +1 -1
  121. package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -1
  122. package/lib/cjs/component/Chart/VennChart.js +103 -122
  123. package/lib/cjs/component/Chart/VennChart.js.map +1 -1
  124. package/lib/cjs/component/Chart/VennChart.type.js.map +1 -1
  125. package/lib/cjs/component/Chart/index.js +2 -2
  126. package/lib/cjs/component/Chart/index.js.map +1 -1
  127. package/lib/cjs/component/ChartLegend/BaseLegend.js +72 -105
  128. package/lib/cjs/component/ChartLegend/BaseLegend.js.map +1 -1
  129. package/lib/cjs/component/ChartLegend/BaseLegend.type.js.map +1 -1
  130. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +58 -70
  131. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
  132. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
  133. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +208 -221
  134. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  135. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
  136. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
  137. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +63 -73
  138. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  139. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
  140. package/lib/cjs/component/ChartLegend/index.js +4 -4
  141. package/lib/cjs/component/ChartLegend/index.js.map +1 -1
  142. package/lib/cjs/component/Cigarette/Cigarette.js +115 -129
  143. package/lib/cjs/component/Cigarette/Cigarette.js.map +1 -1
  144. package/lib/cjs/component/StackGroupBar/StackGroupBar.js +107 -137
  145. package/lib/cjs/component/StackGroupBar/StackGroupBar.js.map +1 -1
  146. package/lib/cjs/component/SvgElement.js +7 -7
  147. package/lib/cjs/component/SvgElement.js.map +1 -1
  148. package/lib/cjs/createElement.js +66 -65
  149. package/lib/cjs/createElement.js.map +1 -1
  150. package/lib/cjs/index.js +62 -62
  151. package/lib/cjs/style/axis.shadow.css +3 -0
  152. package/lib/cjs/style/plot.shadow.css +1 -3
  153. package/lib/cjs/style/plotA11yModule.shadow.css +10 -11
  154. package/lib/cjs/style/plotA11yView.shadow.css +13 -26
  155. package/lib/cjs/translations/__intergalactic-dynamic-locales.js +15 -15
  156. package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
  157. package/lib/cjs/types/Axis.d.js.map +1 -1
  158. package/lib/cjs/types/CompactHorizontalBar.d.js.map +1 -1
  159. package/lib/cjs/types/Hover.d.js.map +1 -1
  160. package/lib/cjs/types/Line.d.js.map +1 -1
  161. package/lib/cjs/types/Plot.d.js.map +1 -1
  162. package/lib/cjs/types/Radar.d.js.map +1 -1
  163. package/lib/cjs/types/ResponsiveContainer.d.js.map +1 -1
  164. package/lib/cjs/types/Tooltip.d.js.map +1 -1
  165. package/lib/cjs/types/Venn.d.js.map +1 -1
  166. package/lib/cjs/types/index.d.js +80 -80
  167. package/lib/cjs/types/index.d.js.map +1 -1
  168. package/lib/cjs/utils.js +122 -145
  169. package/lib/cjs/utils.js.map +1 -1
  170. package/lib/es6/AnimatedClipPath.js +24 -37
  171. package/lib/es6/AnimatedClipPath.js.map +1 -1
  172. package/lib/es6/Area.js +179 -215
  173. package/lib/es6/Area.js.map +1 -1
  174. package/lib/es6/Axis.js +242 -321
  175. package/lib/es6/Axis.js.map +1 -1
  176. package/lib/es6/Bar.js +154 -177
  177. package/lib/es6/Bar.js.map +1 -1
  178. package/lib/es6/Bubble.js +206 -235
  179. package/lib/es6/Bubble.js.map +1 -1
  180. package/lib/es6/CompactHorizontalBar.js +433 -467
  181. package/lib/es6/CompactHorizontalBar.js.map +1 -1
  182. package/lib/es6/Donut.js +337 -384
  183. package/lib/es6/Donut.js.map +1 -1
  184. package/lib/es6/Dots.js +60 -79
  185. package/lib/es6/Dots.js.map +1 -1
  186. package/lib/es6/GroupBar.js +74 -89
  187. package/lib/es6/GroupBar.js.map +1 -1
  188. package/lib/es6/HorizontalBar.js +141 -159
  189. package/lib/es6/HorizontalBar.js.map +1 -1
  190. package/lib/es6/Hover.js +174 -203
  191. package/lib/es6/Hover.js.map +1 -1
  192. package/lib/es6/Line.js +173 -213
  193. package/lib/es6/Line.js.map +1 -1
  194. package/lib/es6/Pattern.js +68 -74
  195. package/lib/es6/Pattern.js.map +1 -1
  196. package/lib/es6/Plot.js +95 -121
  197. package/lib/es6/Plot.js.map +1 -1
  198. package/lib/es6/Radar.js +554 -659
  199. package/lib/es6/Radar.js.map +1 -1
  200. package/lib/es6/RadialTree.js +500 -553
  201. package/lib/es6/RadialTree.js.map +1 -1
  202. package/lib/es6/Reference.js +140 -171
  203. package/lib/es6/Reference.js.map +1 -1
  204. package/lib/es6/ResponsiveContainer.js +58 -76
  205. package/lib/es6/ResponsiveContainer.js.map +1 -1
  206. package/lib/es6/ScatterPlot.js +161 -191
  207. package/lib/es6/ScatterPlot.js.map +1 -1
  208. package/lib/es6/StackBar.js +130 -172
  209. package/lib/es6/StackBar.js.map +1 -1
  210. package/lib/es6/StackedArea.js +56 -69
  211. package/lib/es6/StackedArea.js.map +1 -1
  212. package/lib/es6/Tooltip.js +183 -198
  213. package/lib/es6/Tooltip.js.map +1 -1
  214. package/lib/es6/Venn.js +169 -204
  215. package/lib/es6/Venn.js.map +1 -1
  216. package/lib/es6/a11y/DataAccessibilityTable.js +41 -80
  217. package/lib/es6/a11y/DataAccessibilityTable.js.map +1 -1
  218. package/lib/es6/a11y/PlotA11yModule.js +35 -95
  219. package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
  220. package/lib/es6/a11y/PlotA11yView.js +89 -84
  221. package/lib/es6/a11y/PlotA11yView.js.map +1 -1
  222. package/lib/es6/a11y/bezier.js +16 -23
  223. package/lib/es6/a11y/bezier.js.map +1 -1
  224. package/lib/es6/a11y/focus.js +15 -16
  225. package/lib/es6/a11y/focus.js.map +1 -1
  226. package/lib/es6/a11y/hints.js +67 -73
  227. package/lib/es6/a11y/hints.js.map +1 -1
  228. package/lib/es6/a11y/insights.js +353 -524
  229. package/lib/es6/a11y/insights.js.map +1 -1
  230. package/lib/es6/a11y/intl.js +4 -5
  231. package/lib/es6/a11y/intl.js.map +1 -1
  232. package/lib/es6/a11y/locale.js +11 -18
  233. package/lib/es6/a11y/locale.js.map +1 -1
  234. package/lib/es6/a11y/serialize.js +162 -203
  235. package/lib/es6/a11y/serialize.js.map +1 -1
  236. package/lib/es6/a11y/summarize.js +6 -6
  237. package/lib/es6/a11y/summarize.js.map +1 -1
  238. package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js +15 -15
  239. package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
  240. package/lib/es6/a11y/translations/module/de.json +2 -2
  241. package/lib/es6/a11y/translations/module/en.json +2 -2
  242. package/lib/es6/a11y/translations/module/es.json +2 -2
  243. package/lib/es6/a11y/translations/module/fr.json +2 -2
  244. package/lib/es6/a11y/translations/module/it.json +2 -2
  245. package/lib/es6/a11y/translations/module/ja.json +2 -2
  246. package/lib/es6/a11y/translations/module/ko.json +2 -2
  247. package/lib/es6/a11y/translations/module/nl.json +2 -2
  248. package/lib/es6/a11y/translations/module/pl.json +2 -2
  249. package/lib/es6/a11y/translations/module/pt.json +2 -2
  250. package/lib/es6/a11y/translations/module/sv.json +2 -2
  251. package/lib/es6/a11y/translations/module/tr.json +2 -2
  252. package/lib/es6/a11y/translations/module/vi.json +2 -2
  253. package/lib/es6/a11y/translations/module/zh.json +2 -2
  254. package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js +15 -15
  255. package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
  256. package/lib/es6/color.js +1 -1
  257. package/lib/es6/color.js.map +1 -1
  258. package/lib/es6/component/Chart/AbstractChart.js +416 -462
  259. package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
  260. package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
  261. package/lib/es6/component/Chart/AreaChart.js +92 -111
  262. package/lib/es6/component/Chart/AreaChart.js.map +1 -1
  263. package/lib/es6/component/Chart/AreaChart.type.js.map +1 -1
  264. package/lib/es6/component/Chart/BarChart.js +225 -213
  265. package/lib/es6/component/Chart/BarChart.js.map +1 -1
  266. package/lib/es6/component/Chart/BarChart.type.js.map +1 -1
  267. package/lib/es6/component/Chart/BubbleChart.js +109 -132
  268. package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
  269. package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -1
  270. package/lib/es6/component/Chart/CigaretteChart.js +276 -301
  271. package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
  272. package/lib/es6/component/Chart/CompactHorizontalBarChart.js +70 -103
  273. package/lib/es6/component/Chart/CompactHorizontalBarChart.js.map +1 -1
  274. package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
  275. package/lib/es6/component/Chart/DonutChart.js +74 -90
  276. package/lib/es6/component/Chart/DonutChart.js.map +1 -1
  277. package/lib/es6/component/Chart/DonutChart.type.js.map +1 -1
  278. package/lib/es6/component/Chart/HistogramChart.js +121 -144
  279. package/lib/es6/component/Chart/HistogramChart.js.map +1 -1
  280. package/lib/es6/component/Chart/HistogramChart.type.js.map +1 -1
  281. package/lib/es6/component/Chart/LineChart.js +90 -109
  282. package/lib/es6/component/Chart/LineChart.js.map +1 -1
  283. package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
  284. package/lib/es6/component/Chart/RadarChart.js +80 -107
  285. package/lib/es6/component/Chart/RadarChart.js.map +1 -1
  286. package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
  287. package/lib/es6/component/Chart/ScatterPlotChart.js +113 -138
  288. package/lib/es6/component/Chart/ScatterPlotChart.js.map +1 -1
  289. package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
  290. package/lib/es6/component/Chart/VennChart.js +97 -117
  291. package/lib/es6/component/Chart/VennChart.js.map +1 -1
  292. package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
  293. package/lib/es6/component/ChartLegend/BaseLegend.js +70 -104
  294. package/lib/es6/component/ChartLegend/BaseLegend.js.map +1 -1
  295. package/lib/es6/component/ChartLegend/BaseLegend.type.js.map +1 -1
  296. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +53 -65
  297. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
  298. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
  299. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +198 -211
  300. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  301. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
  302. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
  303. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +58 -68
  304. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  305. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
  306. package/lib/es6/component/Cigarette/Cigarette.js +108 -122
  307. package/lib/es6/component/Cigarette/Cigarette.js.map +1 -1
  308. package/lib/es6/component/StackGroupBar/StackGroupBar.js +100 -130
  309. package/lib/es6/component/StackGroupBar/StackGroupBar.js.map +1 -1
  310. package/lib/es6/component/SvgElement.js +4 -5
  311. package/lib/es6/component/SvgElement.js.map +1 -1
  312. package/lib/es6/createElement.js +55 -54
  313. package/lib/es6/createElement.js.map +1 -1
  314. package/lib/es6/style/axis.shadow.css +3 -0
  315. package/lib/es6/style/plot.shadow.css +1 -3
  316. package/lib/es6/style/plotA11yModule.shadow.css +10 -11
  317. package/lib/es6/style/plotA11yView.shadow.css +13 -26
  318. package/lib/es6/translations/__intergalactic-dynamic-locales.js +14 -14
  319. package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
  320. package/lib/es6/types/Axis.d.js.map +1 -1
  321. package/lib/es6/types/CompactHorizontalBar.d.js.map +1 -1
  322. package/lib/es6/types/Hover.d.js.map +1 -1
  323. package/lib/es6/types/Line.d.js.map +1 -1
  324. package/lib/es6/types/Plot.d.js.map +1 -1
  325. package/lib/es6/types/Radar.d.js.map +1 -1
  326. package/lib/es6/types/ResponsiveContainer.d.js.map +1 -1
  327. package/lib/es6/types/Tooltip.d.js.map +1 -1
  328. package/lib/es6/types/Venn.d.js.map +1 -1
  329. package/lib/es6/utils.js +105 -144
  330. package/lib/es6/utils.js.map +1 -1
  331. package/lib/esm/AnimatedClipPath.mjs +24 -36
  332. package/lib/esm/Area.mjs +178 -149
  333. package/lib/esm/Axis.mjs +241 -242
  334. package/lib/esm/Bar.mjs +155 -137
  335. package/lib/esm/Bubble.mjs +205 -171
  336. package/lib/esm/CompactHorizontalBar.mjs +428 -383
  337. package/lib/esm/Donut.mjs +315 -266
  338. package/lib/esm/Dots.mjs +60 -49
  339. package/lib/esm/GroupBar.mjs +71 -75
  340. package/lib/esm/HorizontalBar.mjs +142 -120
  341. package/lib/esm/Hover.mjs +173 -163
  342. package/lib/esm/Line.mjs +174 -145
  343. package/lib/esm/Pattern.mjs +67 -63
  344. package/lib/esm/Plot.mjs +98 -95
  345. package/lib/esm/Radar.mjs +550 -498
  346. package/lib/esm/RadialTree.mjs +512 -416
  347. package/lib/esm/Reference.mjs +137 -122
  348. package/lib/esm/ResponsiveContainer.mjs +58 -69
  349. package/lib/esm/ScatterPlot.mjs +163 -162
  350. package/lib/esm/StackBar.mjs +126 -147
  351. package/lib/esm/StackedArea.mjs +53 -61
  352. package/lib/esm/Tooltip.mjs +185 -175
  353. package/lib/esm/Venn.mjs +170 -170
  354. package/lib/esm/a11y/DataAccessibilityTable.mjs +46 -73
  355. package/lib/esm/a11y/PlotA11yModule.mjs +37 -80
  356. package/lib/esm/a11y/PlotA11yView.mjs +99 -74
  357. package/lib/esm/a11y/bezier.mjs +16 -23
  358. package/lib/esm/a11y/focus.mjs +15 -16
  359. package/lib/esm/a11y/hints.mjs +65 -71
  360. package/lib/esm/a11y/insights.mjs +347 -495
  361. package/lib/esm/a11y/intl.mjs +4 -5
  362. package/lib/esm/a11y/locale.mjs +12 -14
  363. package/lib/esm/a11y/serialize.mjs +139 -152
  364. package/lib/esm/a11y/summarize.mjs +3 -3
  365. package/lib/esm/a11y/translations/module/__intergalactic-dynamic-locales.mjs +1 -1
  366. package/lib/esm/a11y/translations/module/de.json.mjs +2 -4
  367. package/lib/esm/a11y/translations/module/en.json.mjs +2 -4
  368. package/lib/esm/a11y/translations/module/es.json.mjs +2 -4
  369. package/lib/esm/a11y/translations/module/fr.json.mjs +2 -4
  370. package/lib/esm/a11y/translations/module/it.json.mjs +2 -4
  371. package/lib/esm/a11y/translations/module/ja.json.mjs +2 -4
  372. package/lib/esm/a11y/translations/module/ko.json.mjs +2 -4
  373. package/lib/esm/a11y/translations/module/nl.json.mjs +2 -4
  374. package/lib/esm/a11y/translations/module/pl.json.mjs +2 -4
  375. package/lib/esm/a11y/translations/module/pt.json.mjs +2 -4
  376. package/lib/esm/a11y/translations/module/sv.json.mjs +2 -4
  377. package/lib/esm/a11y/translations/module/tr.json.mjs +2 -4
  378. package/lib/esm/a11y/translations/module/vi.json.mjs +2 -4
  379. package/lib/esm/a11y/translations/module/zh.json.mjs +2 -4
  380. package/lib/esm/a11y/translations/view/__intergalactic-dynamic-locales.mjs +1 -1
  381. package/lib/esm/color.mjs +1 -1
  382. package/lib/esm/component/Chart/AbstractChart.mjs +422 -415
  383. package/lib/esm/component/Chart/AreaChart.mjs +92 -91
  384. package/lib/esm/component/Chart/BarChart.mjs +225 -177
  385. package/lib/esm/component/Chart/BubbleChart.mjs +110 -118
  386. package/lib/esm/component/Chart/CigaretteChart.mjs +277 -268
  387. package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +70 -87
  388. package/lib/esm/component/Chart/DonutChart.mjs +74 -84
  389. package/lib/esm/component/Chart/HistogramChart.mjs +121 -117
  390. package/lib/esm/component/Chart/LineChart.mjs +90 -89
  391. package/lib/esm/component/Chart/RadarChart.mjs +81 -97
  392. package/lib/esm/component/Chart/ScatterPlotChart.mjs +113 -111
  393. package/lib/esm/component/Chart/VennChart.mjs +98 -111
  394. package/lib/esm/component/ChartLegend/BaseLegend.mjs +75 -97
  395. package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +54 -55
  396. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +194 -165
  397. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.type.mjs +1 -1
  398. package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +60 -58
  399. package/lib/esm/component/Cigarette/Cigarette.mjs +109 -99
  400. package/lib/esm/component/StackGroupBar/StackGroupBar.mjs +97 -111
  401. package/lib/esm/component/SvgElement.mjs +4 -4
  402. package/lib/esm/createElement.mjs +54 -37
  403. package/lib/esm/style/axis.shadow.css +3 -0
  404. package/lib/esm/style/plot.shadow.css +1 -3
  405. package/lib/esm/style/plotA11yModule.shadow.css +10 -11
  406. package/lib/esm/style/plotA11yView.shadow.css +13 -26
  407. package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +1 -1
  408. package/lib/esm/utils.mjs +103 -138
  409. package/lib/types/Axis.d.ts +4 -0
  410. package/lib/types/CompactHorizontalBar.d.ts +1 -1
  411. package/lib/types/Hover.d.ts +1 -1
  412. package/lib/types/Line.d.ts +1 -1
  413. package/lib/types/Plot.d.ts +1 -1
  414. package/lib/types/Radar.d.ts +1 -1
  415. package/lib/types/ResponsiveContainer.d.ts +1 -1
  416. package/lib/types/Tooltip.d.ts +1 -3
  417. package/lib/types/Venn.d.ts +1 -1
  418. package/lib/types/a11y/PlotA11yModule.d.ts +4 -11
  419. package/lib/types/a11y/PlotA11yView.d.ts +12 -1
  420. package/lib/types/a11y/translations/module/__intergalactic-dynamic-locales.d.ts +14 -14
  421. package/lib/types/component/Chart/AbstractChart.d.ts +1 -1
  422. package/lib/types/component/Chart/AbstractChart.type.d.ts +1 -1
  423. package/lib/types/component/Chart/AreaChart.type.d.ts +1 -1
  424. package/lib/types/component/Chart/BarChart.type.d.ts +1 -1
  425. package/lib/types/component/Chart/BubbleChart.type.d.ts +1 -1
  426. package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +1 -1
  427. package/lib/types/component/Chart/DonutChart.type.d.ts +1 -1
  428. package/lib/types/component/Chart/HistogramChart.type.d.ts +1 -1
  429. package/lib/types/component/Chart/LineChart.type.d.ts +1 -1
  430. package/lib/types/component/Chart/RadarChart.type.d.ts +1 -1
  431. package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +1 -1
  432. package/lib/types/component/Chart/VennChart.type.d.ts +1 -1
  433. package/lib/types/component/ChartLegend/BaseLegend.d.ts +1 -1
  434. package/lib/types/component/ChartLegend/BaseLegend.type.d.ts +1 -1
  435. package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.type.d.ts +1 -1
  436. package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts +1 -1
  437. package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts +1 -1
  438. package/lib/types/utils.d.ts +10 -10
  439. package/package.json +11 -14
@@ -1 +1 @@
1
- {"version":3,"file":"VennChart.js","names":["_core","require","_i18nEnhance","_interopRequireDefault","_typography","_d3Scale","_react","_","_AbstractChart2","_intergalacticDynamicLocales","VennChartComponent","_AbstractChart","_classCallCheck2","_callSuper2","arguments","_inherits2","_createClass2","key","get","xScale","asProps","scaleLinear","yScale","data","props","legendKeys","Object","keys","filter","item","isIntersection","test","value","defaultLegendProps","legendType","renderChart","_this$asProps","onClickVennItem","_this$state","state","dataDefinitions","highlightedLine","checkedLegendItems","checked","checkedLegendItemsMap","reduce","result","id","intersections","dataKey","push","createElement","Venn","onClick","map","index","Circle","name","label","color","transparent","intersectionKey","intersectionKeys","split","hasDisabledItems","some","undefined","_dataDefinitions$find","find","legendItem","join","Intersection","renderTooltip","Tooltip","_ref","children","Fragment","Title","Text","bold","getLegendAriaLabel","getI18nText","chartType","AbstractChart","_defineProperty2","direction","alignItems","marginY","marginX","i18nEnhance","localizedMessages","VennChart","exports","createComponent"],"sources":["../../../../src/component/Chart/VennChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { Text } from '@semcore/typography';\nimport { scaleLinear } from 'd3-scale';\nimport React from 'react';\n\nimport type { BaseChartProps } from './AbstractChart.type';\n// @ts-ignore\nimport { Venn } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport type { VennChartData, VennChartProps, VennChartType } from './VennChart.type';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\nimport type { LegendItem } from '../ChartLegend/LegendItem/LegendItem.type';\n\nclass VennChartComponent extends AbstractChart<\n VennChartData,\n VennChartProps,\n typeof VennChartComponent.enhance\n> {\n static displayName = 'Chart.Venn';\n\n static defaultProps: Partial<BaseChartProps<VennChartData>> = {\n direction: 'row-reverse',\n alignItems: 'flex-start',\n marginY: 0,\n marginX: 0,\n };\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n get xScale() {\n const { xScale } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n return scaleLinear();\n }\n\n get yScale() {\n const { yScale } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n return scaleLinear();\n }\n\n protected get dataKeys(): string[] {\n const { data } = this.props;\n\n const legendKeys: string[] = Object.keys(data).filter((item) => {\n const isIntersection = /\\//.test(item);\n\n return !isIntersection;\n });\n\n return legendKeys;\n }\n\n defaultLegendProps() {\n return {\n legendType: 'Table' as const,\n };\n }\n\n renderChart() {\n const { data, onClickVennItem } = this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n\n const checkedLegendItems = dataDefinitions.filter((item) => item.checked);\n const checkedLegendItemsMap = checkedLegendItems.reduce<Record<string, LegendItem>>(\n (result, item) => {\n result[item.id] = item;\n\n return result;\n },\n {},\n );\n\n const intersections = Object.keys(data).reduce<string[]>((result, dataKey) => {\n const isIntersection = /\\//.test(dataKey);\n\n if (isIntersection) {\n result.push(dataKey);\n }\n\n return result;\n }, []);\n\n return (\n <Venn onClick={onClickVennItem}>\n {checkedLegendItems.map((item, index) => {\n return (\n <Venn.Circle\n key={item.id}\n dataKey={item.id}\n name={item.label}\n color={item.color}\n transparent={highlightedLine !== -1 && highlightedLine !== index}\n />\n );\n })}\n\n {intersections.map((intersectionKey) => {\n const intersectionKeys = intersectionKey.split('/');\n\n const hasDisabledItems = intersectionKeys.some((key) => {\n return checkedLegendItemsMap[key] === undefined;\n });\n\n if (hasDisabledItems) {\n return null;\n }\n\n const name = intersectionKeys\n .map((id) => {\n return dataDefinitions.find((legendItem) => legendItem.id === id)?.label || '';\n })\n .join(' & ');\n\n return <Venn.Intersection key={intersectionKey} dataKey={intersectionKey} name={name} />;\n })}\n </Venn>\n );\n }\n\n renderTooltip() {\n return (\n <Venn.Tooltip>\n {({ name, dataKey, data }: any) => {\n return {\n children: (\n <>\n <Venn.Tooltip.Title>{name}</Venn.Tooltip.Title>\n <Text bold>{data[dataKey]}</Text>\n </>\n ),\n };\n }}\n </Venn.Tooltip>\n );\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Venn' });\n }\n}\n\nexport const VennChart: VennChartType = createComponent(VennChartComponent);\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AAIA,IAAAM,CAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AAEA,IAAAQ,4BAAA,GAAAR,OAAA;AAJA;AAAA,IAOMS,kBAAkB,0BAAAC,cAAA;EAAA,SAAAD,mBAAA;IAAA,IAAAE,gBAAA,mBAAAF,kBAAA;IAAA,WAAAG,WAAA,mBAAAH,kBAAA,EAAAI,SAAA;EAAA;EAAA,IAAAC,UAAA,aAAAL,kBAAA,EAAAC,cAAA;EAAA,WAAAK,aAAA,aAAAN,kBAAA;IAAAO,GAAA;IAAAC,GAAA,EAgBtB,SAAAA,IAAA,EAAa;MACX,IAAQC,MAAM,GAAK,IAAI,CAACC,OAAO,CAAvBD,MAAM;MAEd,IAAIA,MAAM,EAAE;QACV,OAAOA,MAAM;MACf;MAEA,OAAO,IAAAE,oBAAW,EAAC,CAAC;IACtB;EAAC;IAAAJ,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAa;MACX,IAAQI,MAAM,GAAK,IAAI,CAACF,OAAO,CAAvBE,MAAM;MAEd,IAAIA,MAAM,EAAE;QACV,OAAOA,MAAM;MACf;MAEA,OAAO,IAAAD,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aAL7B1E,kBAAkB,kBAOwC;EAC5D2E,SAAS,EAAE,aAAa;EACxBC,UAAU,EAAE,YAAY;EACxBC,OAAO,EAAE,CAAC;EACVC,OAAO,EAAE;AACX,CAAC;AAAA,IAAAJ,gBAAA,aAZG1E,kBAAkB,aAcL,CAAC,IAAA+E,uBAAW,EAACC,8CAAiB,CAAC,CAAC;AA2H5C,IAAMC,SAAwB,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAAE,qBAAe,EAACnF,kBAAkB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"VennChart.js","names":["_core","require","_i18nEnhance","_interopRequireDefault","_typography","_d3Scale","_react","_","_AbstractChart","_intergalacticDynamicLocales","VennChartComponent","AbstractChart","xScale","asProps","scaleLinear","yScale","dataKeys","data","props","legendKeys","Object","keys","filter","item","isIntersection","test","defaultLegendProps","legendType","renderChart","onClickVennItem","dataDefinitions","highlightedLine","state","checkedLegendItems","checked","checkedLegendItemsMap","reduce","result","id","intersections","dataKey","push","default","createElement","Venn","onClick","map","index","Circle","key","name","label","color","transparent","intersectionKey","intersectionKeys","split","hasDisabledItems","some","undefined","find","legendItem","join","Intersection","renderTooltip","Tooltip","children","Fragment","Title","Text","bold","getLegendAriaLabel","getI18nText","chartType","_defineProperty2","direction","alignItems","marginY","marginX","i18nEnhance","localizedMessages","VennChart","exports","createComponent"],"sources":["../../../../src/component/Chart/VennChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { Text } from '@semcore/typography';\nimport { scaleLinear } from 'd3-scale';\nimport React from 'react';\n\nimport type { BaseChartProps } from './AbstractChart.type';\n// @ts-ignore\nimport { Venn } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport type { VennChartData, VennChartProps, VennChartType } from './VennChart.type';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\nimport type { LegendItem } from '../ChartLegend/LegendItem/LegendItem.type';\n\nclass VennChartComponent extends AbstractChart<\n VennChartData,\n VennChartProps,\n typeof VennChartComponent.enhance\n> {\n static displayName = 'Chart.Venn';\n\n static defaultProps: Partial<BaseChartProps<VennChartData>> = {\n direction: 'row-reverse',\n alignItems: 'flex-start',\n marginY: 0,\n marginX: 0,\n };\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n get xScale() {\n const { xScale } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n return scaleLinear();\n }\n\n get yScale() {\n const { yScale } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n return scaleLinear();\n }\n\n protected get dataKeys(): string[] {\n const { data } = this.props;\n\n const legendKeys: string[] = Object.keys(data).filter((item) => {\n const isIntersection = /\\//.test(item);\n\n return !isIntersection;\n });\n\n return legendKeys;\n }\n\n defaultLegendProps() {\n return {\n legendType: 'Table' as const,\n };\n }\n\n renderChart() {\n const { data, onClickVennItem } = this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n\n const checkedLegendItems = dataDefinitions.filter((item) => item.checked);\n const checkedLegendItemsMap = checkedLegendItems.reduce<Record<string, LegendItem>>(\n (result, item) => {\n result[item.id] = item;\n\n return result;\n },\n {},\n );\n\n const intersections = Object.keys(data).reduce<string[]>((result, dataKey) => {\n const isIntersection = /\\//.test(dataKey);\n\n if (isIntersection) {\n result.push(dataKey);\n }\n\n return result;\n }, []);\n\n return (\n <Venn onClick={onClickVennItem}>\n {checkedLegendItems.map((item, index) => {\n return (\n <Venn.Circle\n key={item.id}\n dataKey={item.id}\n name={item.label}\n color={item.color}\n transparent={highlightedLine !== -1 && highlightedLine !== index}\n />\n );\n })}\n\n {intersections.map((intersectionKey) => {\n const intersectionKeys = intersectionKey.split('/');\n\n const hasDisabledItems = intersectionKeys.some((key) => {\n return checkedLegendItemsMap[key] === undefined;\n });\n\n if (hasDisabledItems) {\n return null;\n }\n\n const name = intersectionKeys\n .map((id) => {\n return dataDefinitions.find((legendItem) => legendItem.id === id)?.label || '';\n })\n .join(' & ');\n\n return <Venn.Intersection key={intersectionKey} dataKey={intersectionKey} name={name} />;\n })}\n </Venn>\n );\n }\n\n renderTooltip() {\n return (\n <Venn.Tooltip>\n {({ name, dataKey, data }: any) => {\n return {\n children: (\n <>\n <Venn.Tooltip.Title>{name}</Venn.Tooltip.Title>\n <Text bold>{data[dataKey]}</Text>\n </>\n ),\n };\n }}\n </Venn.Tooltip>\n );\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Venn' });\n }\n}\n\nexport const VennChart: VennChartType = createComponent(VennChartComponent);\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AAIA,IAAAM,CAAA,GAAAN,OAAA;AACA,IAAAO,cAAA,GAAAP,OAAA;AAEA,IAAAQ,4BAAA,GAAAR,OAAA;AAJA;;AAOA,MAAMS,kBAAkB,SAASC,4BAAa,CAI5C;EAYA,IAAIC,MAAMA,CAAA,EAAG;IACX,MAAM;MAAEA;IAAO,CAAC,GAAG,IAAI,CAACC,OAAO;IAE/B,IAAID,MAAM,EAAE;MACV,OAAOA,MAAM;IACf;IAEA,OAAO,IAAAE,oBAAW,EAAC,CAAC;EACtB;EAEA,IAAIC,MAAMA,CAAA,EAAG;IACX,MAAM;MAAEA;IAAO,CAAC,GAAG,IAAI,CAACF,OAAO;IAE/B,IAAIE,MAAM,EAAE;MACV,OAAOA,MAAM;IACf;IAEA,OAAO,IAAAD,oBAAW,EAAC,CAAC;EACtB;EAEA,IAAcE,QAAQA,CAAA,EAAa;IACjC,MAAM;MAAEC;IAAK,CAAC,GAAG,IAAI,CAACC,KAAK;IAE3B,MAAMC,UAAoB,GAAGC,MAAM,CAACC,IAAI,CAACJ,IAAI,CAAC,CAACK,M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eACN5D,MAAA,CAAAoC,OAAA,CAAAC,aAAA,CAAArC,MAAA,CAAAoC,OAAA,CAAAyB,QAAA,qBACE7D,MAAA,CAAAoC,OAAA,CAAAC,aAAA,CAACpC,CAAA,CAAAqC,IAAI,CAACqB,OAAO,CAACG,KAAK,QAAElB,IAAyB,CAAC,eAC/C5C,MAAA,CAAAoC,OAAA,CAAAC,aAAA,CAACvC,WAAA,CAAAiE,IAAI;UAACC,IAAI;QAAA,GAAErD,IAAI,CAACuB,OAAO,CAAQ,CAChC;MAEN,CAAC;IACH,CACY,CAAC;EAEnB;EAEU+B,kBAAkBA,CAAA,EAAW;IACrC,OAAO,IAAI,CAAC1D,OAAO,CAAC2D,WAAW,CAAC,gBAAgB,EAAE;MAAEC,SAAS,EAAE;IAAO,CAAC,CAAC;EAC1E;AACF;AAAC,IAAAC,gBAAA,CAAAhC,OAAA,EAvIKhC,kBAAkB,iBAKD,YAAY;AAAA,IAAAgE,gBAAA,CAAAhC,OAAA,EAL7BhC,kBAAkB,kBAOwC;EAC5DiE,SAAS,EAAE,aAAa;EACxBC,UAAU,EAAE,YAAY;EACxBC,OAAO,EAAE,CAAC;EACVC,OAAO,EAAE;AACX,CAAC;AAAA,IAAAJ,gBAAA,CAAAhC,OAAA,EAZGhC,kBAAkB,aAcL,CAAC,IAAAqE,oBAAW,EAACC,8CAAiB,CAAC,CAAC;AA2H5C,MAAMC,SAAwB,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAAE,qBAAe,EAACzE,kBAAkB,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"VennChart.type.js","names":[],"sources":["../../../../src/component/Chart/VennChart.type.ts"],"sourcesContent":["import type { Intergalactic } from '@semcore/core';\nimport type { Flex } from '@semcore/flex-box';\nimport type { ScaleLinear } from 'd3-scale';\n\nimport type { BaseChartProps } from './AbstractChart.type';\n\nexport type DataKey = string;\n\nexport type VennChartData = Record<DataKey, number>;\n\nexport type VennChartProps = Intergalactic.InternalTypings.EfficientOmit<\n BaseChartProps<VennChartData>,\n 'showTotalInTooltip'\n> & {\n /** Internal */\n groupKey?: never;\n /** Custom x-axis scale */\n xScale?: ScaleLinear<any, any>;\n /** Custom y-axis scale */\n yScale?: ScaleLinear<any, any>;\n /** Callback triggered when a user clicks on a circle */\n onClickVennItem?: (key: DataKey, e: React.SyntheticEvent) => void;\n};\n\nexport type VennChartType = Intergalactic.Component<typeof Flex, VennChartProps>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"VennChart.type.js","names":[],"sources":["../../../../src/component/Chart/VennChart.type.ts"],"sourcesContent":["import type { Flex } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport type { ScaleLinear } from 'd3-scale';\n\nimport type { BaseChartProps } from './AbstractChart.type';\n\nexport type DataKey = string;\n\nexport type VennChartData = Record<DataKey, number>;\n\nexport type VennChartProps = Intergalactic.InternalTypings.EfficientOmit<\n BaseChartProps<VennChartData>,\n 'showTotalInTooltip'\n> & {\n /** Internal */\n groupKey?: never;\n /** Custom x-axis scale */\n xScale?: ScaleLinear<any, any>;\n /** Custom y-axis scale */\n yScale?: ScaleLinear<any, any>;\n /** Callback triggered when a user clicks on a circle */\n onClickVennItem?: (key: DataKey, e: React.SyntheticEvent) => void;\n};\n\nexport type VennChartType = Intergalactic.Component<typeof Flex, VennChartProps>;\n"],"mappings":"","ignoreList":[]}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = void 0;
6
+ exports.default = void 0;
7
7
  var _AreaChart = require("./AreaChart");
8
8
  var _BarChart = require("./BarChart");
9
9
  var _BubbleChart = require("./BubbleChart");
@@ -15,7 +15,7 @@ var _LineChart = require("./LineChart");
15
15
  var _RadarChart = require("./RadarChart");
16
16
  var _ScatterPlotChart = require("./ScatterPlotChart");
17
17
  var _VennChart = require("./VennChart");
18
- var _default = exports["default"] = {
18
+ var _default = exports.default = {
19
19
  Line: _LineChart.LineChart,
20
20
  Bar: _BarChart.BarChart,
21
21
  Histogram: _HistogramChart.HistogramChart,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_AreaChart","require","_BarChart","_BubbleChart","_CigaretteChart","_CompactHorizontalBarChart","_DonutChart","_HistogramChart","_LineChart","_RadarChart","_ScatterPlotChart","_VennChart","_default","exports","Line","LineChart","Bar","BarChart","Histogram","HistogramChart","ScatterPlot","ScatterPlotChart","Area","AreaChart","Bubble","BubbleChart","Donut","DonutChart","Venn","VennChart","Radar","RadarChart","Cigarette","CigaretteChart","CompactHorizontalBar","CompactHorizontalBarChart"],"sources":["../../../../src/component/Chart/index.ts"],"sourcesContent":["import { AreaChart } from './AreaChart';\nimport { BarChart } from './BarChart';\nimport { BubbleChart } from './BubbleChart';\nimport { CigaretteChart } from './CigaretteChart';\nimport { CompactHorizontalBarChart } from './CompactHorizontalBarChart';\nimport { DonutChart } from './DonutChart';\nimport { HistogramChart } from './HistogramChart';\nimport { LineChart } from './LineChart';\nimport { RadarChart } from './RadarChart';\nimport { ScatterPlotChart } from './ScatterPlotChart';\nimport { VennChart } from './VennChart';\n\nexport default {\n Line: LineChart,\n Bar: BarChart,\n Histogram: HistogramChart,\n ScatterPlot: ScatterPlotChart,\n Area: AreaChart,\n Bubble: BubbleChart,\n Donut: DonutChart,\n Venn: VennChart,\n Radar: RadarChart,\n Cigarette: CigaretteChart,\n CompactHorizontalBar: CompactHorizontalBarChart,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,0BAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,iBAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAAwC,IAAAW,QAAA,GAAAC,OAAA,cAEzB;EACbC,IAAI,EAAEC,oBAAS;EACfC,GAAG,EAAEC,kBAAQ;EACbC,SAAS,EAAEC,8BAAc;EACzBC,WAAW,EAAEC,kCAAgB;EAC7BC,IAAI,EAAEC,oBAAS;EACfC,MAAM,EAAEC,wBAAW;EACnBC,KAAK,EAAEC,sBAAU;EACjBC,IAAI,EAAEC,oBAAS;EACfC,KAAK,EAAEC,sBAAU;EACjBC,SAAS,EAAEC,8BAAc;EACzBC,oBAAoB,EAAEC;AACxB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_AreaChart","require","_BarChart","_BubbleChart","_CigaretteChart","_CompactHorizontalBarChart","_DonutChart","_HistogramChart","_LineChart","_RadarChart","_ScatterPlotChart","_VennChart","_default","exports","default","Line","LineChart","Bar","BarChart","Histogram","HistogramChart","ScatterPlot","ScatterPlotChart","Area","AreaChart","Bubble","BubbleChart","Donut","DonutChart","Venn","VennChart","Radar","RadarChart","Cigarette","CigaretteChart","CompactHorizontalBar","CompactHorizontalBarChart"],"sources":["../../../../src/component/Chart/index.ts"],"sourcesContent":["import { AreaChart } from './AreaChart';\nimport { BarChart } from './BarChart';\nimport { BubbleChart } from './BubbleChart';\nimport { CigaretteChart } from './CigaretteChart';\nimport { CompactHorizontalBarChart } from './CompactHorizontalBarChart';\nimport { DonutChart } from './DonutChart';\nimport { HistogramChart } from './HistogramChart';\nimport { LineChart } from './LineChart';\nimport { RadarChart } from './RadarChart';\nimport { ScatterPlotChart } from './ScatterPlotChart';\nimport { VennChart } from './VennChart';\n\nexport default {\n Line: LineChart,\n Bar: BarChart,\n Histogram: HistogramChart,\n ScatterPlot: ScatterPlotChart,\n Area: AreaChart,\n Bubble: BubbleChart,\n Donut: DonutChart,\n Venn: VennChart,\n Radar: RadarChart,\n Cigarette: CigaretteChart,\n CompactHorizontalBar: CompactHorizontalBarChart,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,0BAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,iBAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAAwC,IAAAW,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEzB;EACbC,IAAI,EAAEC,oBAAS;EACfC,GAAG,EAAEC,kBAAQ;EACbC,SAAS,EAAEC,8BAAc;EACzBC,WAAW,EAAEC,kCAAgB;EAC7BC,IAAI,EAAEC,oBAAS;EACfC,MAAM,EAAEC,wBAAW;EACnBC,KAAK,EAAEC,sBAAU;EACjBC,IAAI,EAAEC,oBAAS;EACfC,KAAK,EAAEC,sBAAU;EACjBC,SAAS,EAAEC,8BAAc;EACzBC,oBAAoB,EAAEC;AACxB,CAAC","ignoreList":[]}
@@ -1,126 +1,93 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.BaseLegend = void 0;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
12
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
9
  var _core = require("@semcore/core");
15
10
  var _hints = require("../../a11y/hints");
16
- var BaseLegend = exports.BaseLegend = /*#__PURE__*/function (_Component) {
17
- function BaseLegend() {
18
- var _this;
19
- (0, _classCallCheck2["default"])(this, BaseLegend);
20
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
21
- args[_key] = arguments[_key];
22
- }
23
- _this = (0, _callSuper2["default"])(this, BaseLegend, [].concat(args));
24
- (0, _defineProperty2["default"])(_this, "onChangeLegendItem", function (shape) {
25
- return function (id, checked) {
26
- var _this$props$onChangeV, _this$props;
27
- if (shape !== 'Checkbox') return;
28
- (_this$props$onChangeV = (_this$props = _this.props).onChangeVisibleItem) === null || _this$props$onChangeV === void 0 || _this$props$onChangeV.call(_this$props, id, checked);
29
- if (checked) {
30
- var _this$props$onMouseEn, _this$props2;
31
- (_this$props$onMouseEn = (_this$props2 = _this.props).onMouseEnterItem) === null || _this$props$onMouseEn === void 0 || _this$props$onMouseEn.call(_this$props2, id);
32
- } else {
33
- var _this$props$onMouseLe, _this$props3;
34
- (_this$props$onMouseLe = (_this$props3 = _this.props).onMouseLeaveItem) === null || _this$props$onMouseLe === void 0 || _this$props$onMouseLe.call(_this$props3, id);
35
- }
36
- };
11
+ class BaseLegend extends _core.Component {
12
+ constructor(...args) {
13
+ super(...args);
14
+ (0, _defineProperty2.default)(this, "onChangeLegendItem", shape => (id, checked) => {
15
+ if (shape !== 'Checkbox') return;
16
+ this.props.onChangeVisibleItem?.(id, checked);
17
+ if (checked) {
18
+ this.props.onMouseEnterItem?.(id);
19
+ } else {
20
+ this.props.onMouseLeaveItem?.(id);
21
+ }
37
22
  });
38
- (0, _defineProperty2["default"])(_this, "onFocusLegendItem", function (checked) {
39
- return function (id) {
40
- var _this$props$onMouseEn2, _this$props5;
41
- if (!checked) {
42
- var _this$props$onMouseLe2, _this$props4;
43
- return (_this$props$onMouseLe2 = (_this$props4 = _this.props).onMouseLeaveItem) === null || _this$props$onMouseLe2 === void 0 ? void 0 : _this$props$onMouseLe2.call(_this$props4, id);
44
- }
45
- (_this$props$onMouseEn2 = (_this$props5 = _this.props).onMouseEnterItem) === null || _this$props$onMouseEn2 === void 0 || _this$props$onMouseEn2.call(_this$props5, id);
46
- };
23
+ (0, _defineProperty2.default)(this, "onFocusLegendItem", checked => id => {
24
+ if (!checked) {
25
+ return this.props.onMouseLeaveItem?.(id);
26
+ }
27
+ this.props.onMouseEnterItem?.(id);
47
28
  });
48
- (0, _defineProperty2["default"])(_this, "onBlurLegendItem", function (id) {
49
- var _this$props$onMouseLe3, _this$props6;
50
- (_this$props$onMouseLe3 = (_this$props6 = _this.props).onMouseLeaveItem) === null || _this$props$onMouseLe3 === void 0 || _this$props$onMouseLe3.call(_this$props6, id);
29
+ (0, _defineProperty2.default)(this, "onBlurLegendItem", id => {
30
+ this.props.onMouseLeaveItem?.(id);
51
31
  });
52
- (0, _defineProperty2["default"])(_this, "bindOnMouseEnterItem", function (id) {
53
- return function (e) {
54
- var _this$props$onMouseEn3, _this$props7;
55
- (_this$props$onMouseEn3 = (_this$props7 = _this.props).onMouseEnterItem) === null || _this$props$onMouseEn3 === void 0 || _this$props$onMouseEn3.call(_this$props7, id, e);
32
+ (0, _defineProperty2.default)(this, "bindOnMouseEnterItem", id => {
33
+ return e => {
34
+ this.props.onMouseEnterItem?.(id, e);
56
35
  };
57
36
  });
58
- (0, _defineProperty2["default"])(_this, "bindOnMouseLeaveItem", function (id) {
59
- return function (e) {
60
- var _this$props$onMouseLe4, _this$props8;
61
- (_this$props$onMouseLe4 = (_this$props8 = _this.props).onMouseLeaveItem) === null || _this$props$onMouseLe4 === void 0 || _this$props$onMouseLe4.call(_this$props8, id, e);
37
+ (0, _defineProperty2.default)(this, "bindOnMouseLeaveItem", id => {
38
+ return e => {
39
+ this.props.onMouseLeaveItem?.(id, e);
62
40
  };
63
41
  });
64
- return _this;
65
42
  }
66
- (0, _inherits2["default"])(BaseLegend, _Component);
67
- return (0, _createClass2["default"])(BaseLegend, [{
68
- key: "componentDidMount",
69
- value: function componentDidMount() {
43
+ componentDidMount() {
44
+ this.setHints();
45
+ }
46
+ componentDidUpdate(prevProps) {
47
+ if (prevProps.items !== this.props.items || prevProps.dataHints !== this.props.dataHints) {
70
48
  this.setHints();
71
49
  }
72
- }, {
73
- key: "componentDidUpdate",
74
- value: function componentDidUpdate(prevProps) {
75
- if (prevProps.items !== this.props.items || prevProps.dataHints !== this.props.dataHints) {
76
- this.setHints();
77
- }
78
- }
79
- }, {
80
- key: "setHints",
81
- value: function setHints() {
82
- var _this$asProps = this.asProps,
83
- items = _this$asProps.items,
84
- dataHints = _this$asProps.dataHints;
85
- var dataHintsHandler = dataHints ? (0, _hints.makeDataHintsHandlers)(dataHints) : undefined;
86
- items.forEach(function (legendItem) {
87
- dataHintsHandler === null || dataHintsHandler === void 0 || dataHintsHandler.labelKey('value', legendItem.id, legendItem.label);
88
- });
89
- }
90
- }, {
91
- key: "getItem",
92
- value: function getItem(index) {
93
- var line = this.asProps.items[index];
94
- if (line === undefined) {
95
- throw new Error("No index \"".concat(index, "\" in lines"));
96
- }
97
- return line;
98
- }
99
- }, {
100
- key: "getLegendItemProps",
101
- value: function getLegendItemProps(_, index) {
102
- var _this$asProps2 = this.asProps,
103
- _this$asProps2$shape = _this$asProps2.shape,
104
- shape = _this$asProps2$shape === void 0 ? 'Checkbox' : _this$asProps2$shape,
105
- _this$asProps2$size = _this$asProps2.size,
106
- size = _this$asProps2$size === void 0 ? 'm' : _this$asProps2$size,
107
- patterns = _this$asProps2.patterns;
108
- var line = this.getItem(index);
109
- return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, line), {}, {
110
- shape: shape,
111
- size: size,
112
- onFocusLegendItem: this.onFocusLegendItem(line.checked),
113
- onBlurLegendItem: this.onBlurLegendItem,
114
- onChangeLegendItem: this.onChangeLegendItem(shape),
115
- onMouseEnter: line.checked ? this.bindOnMouseEnterItem(line.id) : undefined,
116
- onMouseLeave: this.bindOnMouseLeaveItem(line.id),
117
- style: {
118
- gridRowStart: "".concat(index + 1),
119
- gridRowEnd: "".concat(index + 2)
120
- },
121
- patterns: patterns
122
- });
50
+ }
51
+ setHints() {
52
+ const {
53
+ items,
54
+ dataHints
55
+ } = this.asProps;
56
+ const dataHintsHandler = dataHints ? (0, _hints.makeDataHintsHandlers)(dataHints) : undefined;
57
+ items.forEach(legendItem => {
58
+ dataHintsHandler?.labelKey('value', legendItem.id, legendItem.label);
59
+ });
60
+ }
61
+ getItem(index) {
62
+ const line = this.asProps.items[index];
63
+ if (line === undefined) {
64
+ throw new Error(`No index "${index}" in lines`);
123
65
  }
124
- }]);
125
- }(_core.Component);
66
+ return line;
67
+ }
68
+ getLegendItemProps(_, index) {
69
+ const {
70
+ shape = 'Checkbox',
71
+ size = 'm',
72
+ patterns
73
+ } = this.asProps;
74
+ const line = this.getItem(index);
75
+ return {
76
+ ...line,
77
+ shape,
78
+ size,
79
+ onFocusLegendItem: this.onFocusLegendItem(line.checked),
80
+ onBlurLegendItem: this.onBlurLegendItem,
81
+ onChangeLegendItem: this.onChangeLegendItem(shape),
82
+ onMouseEnter: line.checked ? this.bindOnMouseEnterItem(line.id) : undefined,
83
+ onMouseLeave: this.bindOnMouseLeaveItem(line.id),
84
+ style: {
85
+ gridRowStart: `${index + 1}`,
86
+ gridRowEnd: `${index + 2}`
87
+ },
88
+ patterns
89
+ };
90
+ }
91
+ }
92
+ exports.BaseLegend = BaseLegend;
126
93
  //# sourceMappingURL=BaseLegend.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseLegend.js","names":["_core","require","_hints","BaseLegend","exports","_Component","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","_callSuper2","concat","_defineProperty2","shape","id","checked","_this$props$onChangeV","_this$props","props","onChangeVisibleItem","call","_this$props$onMouseEn","_this$props2","onMouseEnterItem","_this$props$onMouseLe","_this$props3","onMouseLeaveItem","_this$props$onMouseEn2","_this$props5","_this$props$onMouseLe2","_this$props4","_this$props$onMouseLe3","_this$props6","e","_this$props$onMouseEn3","_this$props7","_this$props$onMouseLe4","_this$props8","_inherits2","_createClass2","key","value","componentDidMount","setHints","componentDidUpdate","prevProps","items","dataHints","_this$asProps","asProps","dataHintsHandler","makeDataHintsHandlers","undefined","forEach","legendItem","labelKey","label","getItem","index","line","Error","getLegendItemProps","_","_this$asProps2","_this$asProps2$shape","_this$asProps2$size","size","patterns","_objectSpread2","onFocusLegendItem","onBlurLegendItem","onChangeLegendItem","onMouseEnter","bindOnMouseEnterItem","onMouseLeave","bindOnMouseLeaveItem","style","gridRowStart","gridRowEnd","Component"],"sources":["../../../../src/component/ChartLegend/BaseLegend.tsx"],"sourcesContent":["import { Component, type Intergalactic } from '@semcore/core';\nimport type React from 'react';\n\nimport type { LegendProps } from './BaseLegend.type';\nimport { StaticShapes, type LegendItemKey, type LegendItemProps, type ShapeType } from './LegendItem/LegendItem.type';\nimport { makeDataHintsHandlers } from '../../a11y/hints';\n\nexport abstract class BaseLegend<T extends LegendProps> extends Component<T> {\n componentDidMount() {\n this.setHints();\n }\n\n componentDidUpdate(prevProps: T) {\n if (prevProps.items !== this.props.items || prevProps.dataHints !== this.props.dataHints) {\n this.setHints();\n }\n }\n\n setHints() {\n const { items, dataHints } = this.asProps;\n const dataHintsHandler = dataHints ? makeDataHintsHandlers(dataHints) : undefined;\n\n items.forEach((legendItem) => {\n dataHintsHandler?.labelKey('value', legendItem.id, legendItem.label);\n });\n }\n\n getItem(index: number) {\n const line = this.asProps.items[index];\n\n if (line === undefined) {\n throw new Error(`No index \"${index}\" in lines`);\n }\n\n return line;\n }\n\n getLegendItemProps(\n _: {},\n index: number,\n ): LegendItemProps & Intergalactic.InternalTypings.ComponentPropsNesting<'div'> {\n const { shape = 'Checkbox', size = 'm', patterns } = this.asProps;\n const line = this.getItem(index);\n\n return {\n ...line,\n shape,\n size,\n onFocusLegendItem: this.onFocusLegendItem(line.checked),\n onBlurLegendItem: this.onBlurLegendItem,\n onChangeLegendItem: this.onChangeLegendItem(shape),\n onMouseEnter: line.checked ? this.bindOnMouseEnterItem(line.id) : undefined,\n onMouseLeave: this.bindOnMouseLeaveItem(line.id),\n style: { gridRowStart: `${index + 1}`, gridRowEnd: `${index + 2}` },\n patterns,\n };\n }\n\n onChangeLegendItem = (shape: ShapeType) => (id: LegendItemKey, checked: boolean) => {\n if (shape !== 'Checkbox') return;\n\n this.props.onChangeVisibleItem?.(id, checked);\n\n if (checked) {\n this.props.onMouseEnterItem?.(id);\n } else {\n this.props.onMouseLeaveItem?.(id);\n }\n };\n\n onFocusLegendItem = (checked: boolean) => (id: LegendItemKey) => {\n if (!checked) {\n return this.props.onMouseLeaveItem?.(id);\n }\n\n this.props.onMouseEnterItem?.(id);\n };\n\n onBlurLegendItem = (id: LegendItemKey) => {\n this.props.onMouseLeaveItem?.(id);\n };\n\n bindOnMouseEnterItem = (id: LegendItemKey) => {\n return (e: React.SyntheticEvent) => {\n this.props.onMouseEnterItem?.(id, e);\n };\n };\n\n bindOnMouseLeaveItem = (id: LegendItemKey) => {\n return (e: React.SyntheticEvent) => {\n this.props.onMouseLeaveItem?.(id, e);\n };\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AAAyD,IAEnCE,UAAU,GAAAC,OAAA,CAAAD,UAAA,0BAAAE,UAAA;EAAA,SAAAF,WAAA;IAAA,IAAAG,KAAA;IAAA,IAAAC,gBAAA,mBAAAJ,UAAA;IAAA,SAAAK,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAAAP,KAAA,OAAAQ,WAAA,mBAAAX,UAAA,KAAAY,MAAA,CAAAJ,IAAA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AA,oBAAA;QAAAC,mBAAA,GAAAF,cAAA,CAAEG,IAAI;QAAJA,IAAI,GAAAD,mBAAA,cAAG,GAAG,GAAAA,mBAAA;QAAEE,QAAQ,GAAAJ,cAAA,CAARI,QAAQ;MAChD,IAAMR,IAAI,GAAG,IAAI,CAACF,OAAO,CAACC,KAAK,CAAC;MAEhC,WAAAU,cAAA,iBAAAA,cAAA,iBACKT,IAAI;QACP9C,KAAK,EAALA,KAAK;QACLqD,IAAI,EAAJA,IAAI;QACJG,iBAAiB,EAAE,IAAI,CAACA,iBAAiB,CAACV,IAAI,CAAC5C,OAAO,CAAC;QACvDuD,gBAAgB,EAAE,IAAI,CAACA,gBAAgB;QACvCC,kBAAkB,EAAE,IAAI,CAACA,kBAAkB,CAAC1D,KAAK,CAAC;QAClD2D,YAAY,EAAEb,IAAI,CAAC5C,OAAO,GAAG,IAAI,CAAC0D,oBAAoB,CAACd,IAAI,CAAC7C,EAAE,CAAC,GAAGsC,SAAS;QAC3EsB,YAAY,EAAE,IAAI,CAACC,oBAAoB,CAAChB,IAAI,CAAC7C,EAAE,CAAC;QAChD8D,KAAK,EAAE;UAAEC,YAAY,KAAAlE,MAAA,CAAK+C,KAAK,GAAG,CAAC,CAAE;UAAEoB,UAAU,KAAAnE,MAAA,CAAK+C,KAAK,GAAG,CAAC;QAAG,CAAC;QACnES,QAAQ,EAARA;MAAQ;IAEZ;EAAC;AAAA,EAjD6DY,eAAS","ignoreList":[]}
1
+ {"version":3,"file":"BaseLegend.js","names":["_core","require","_hints","BaseLegend","Component","constructor","args","_defineProperty2","default","shape","id","checked","props","onChangeVisibleItem","onMouseEnterItem","onMouseLeaveItem","e","componentDidMount","setHints","componentDidUpdate","prevProps","items","dataHints","asProps","dataHintsHandler","makeDataHintsHandlers","undefined","forEach","legendItem","labelKey","label","getItem","index","line","Error","getLegendItemProps","_","size","patterns","onFocusLegendItem","onBlurLegendItem","onChangeLegendItem","onMouseEnter","bindOnMouseEnterItem","onMouseLeave","bindOnMouseLeaveItem","style","gridRowStart","gridRowEnd","exports"],"sources":["../../../../src/component/ChartLegend/BaseLegend.tsx"],"sourcesContent":["import { Component, type Intergalactic } from '@semcore/core';\nimport type React from 'react';\n\nimport type { LegendProps } from './BaseLegend.type';\nimport { StaticShapes, type LegendItemKey, type LegendItemProps, type ShapeType } from './LegendItem/LegendItem.type';\nimport { makeDataHintsHandlers } from '../../a11y/hints';\n\nexport abstract class BaseLegend<T extends LegendProps, E extends readonly ((...args: any[]) => any)[] = never[]> extends Component<T, E> {\n componentDidMount() {\n this.setHints();\n }\n\n componentDidUpdate(prevProps: T) {\n if (prevProps.items !== this.props.items || prevProps.dataHints !== this.props.dataHints) {\n this.setHints();\n }\n }\n\n setHints() {\n const { items, dataHints } = this.asProps;\n const dataHintsHandler = dataHints ? makeDataHintsHandlers(dataHints) : undefined;\n\n items.forEach((legendItem) => {\n dataHintsHandler?.labelKey('value', legendItem.id, legendItem.label);\n });\n }\n\n getItem(index: number) {\n const line = this.asProps.items[index];\n\n if (line === undefined) {\n throw new Error(`No index \"${index}\" in lines`);\n }\n\n return line;\n }\n\n getLegendItemProps(\n _: {},\n index: number,\n ): LegendItemProps & Intergalactic.InternalTypings.ComponentPropsNesting<'div'> {\n const { shape = 'Checkbox', size = 'm', patterns } = this.asProps;\n const line = this.getItem(index);\n\n return {\n ...line,\n shape,\n size,\n onFocusLegendItem: this.onFocusLegendItem(line.checked),\n onBlurLegendItem: this.onBlurLegendItem,\n onChangeLegendItem: this.onChangeLegendItem(shape),\n onMouseEnter: line.checked ? this.bindOnMouseEnterItem(line.id) : undefined,\n onMouseLeave: this.bindOnMouseLeaveItem(line.id),\n style: { gridRowStart: `${index + 1}`, gridRowEnd: `${index + 2}` },\n patterns,\n };\n }\n\n onChangeLegendItem = (shape: ShapeType) => (id: LegendItemKey, checked: boolean) => {\n if (shape !== 'Checkbox') return;\n\n this.props.onChangeVisibleItem?.(id, checked);\n\n if (checked) {\n this.props.onMouseEnterItem?.(id);\n } else {\n this.props.onMouseLeaveItem?.(id);\n }\n };\n\n onFocusLegendItem = (checked: boolean) => (id: LegendItemKey) => {\n if (!checked) {\n return this.props.onMouseLeaveItem?.(id);\n }\n\n this.props.onMouseEnterItem?.(id);\n };\n\n onBlurLegendItem = (id: LegendItemKey) => {\n this.props.onMouseLeaveItem?.(id);\n };\n\n bindOnMouseEnterItem = (id: LegendItemKey) => {\n return (e: React.SyntheticEvent) => {\n this.props.onMouseEnterItem?.(id, e);\n };\n };\n\n bindOnMouseLeaveItem = (id: LegendItemKey) => {\n return (e: React.SyntheticEvent) => {\n this.props.onMouseLeaveItem?.(id, e);\n };\n };\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AAEO,MAAeE,UAAU,SAA0FC,eAAS,CAAO;EAAAC,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,8BAmDlHC,KAAgB,IAAK,CAACC,EAAiB,EAAEC,OAAgB,KAAK;MAClF,IAAIF,KAAK,KAAK,UAAU,EAAE;MAE1B,IAAI,CAACG,KAAK,CAACC,mBAAmB,GAAGH,EAAE,EAAEC,OAAO,CAAC;MAE7C,IAAIA,OAAO,EAAE;QACX,IAAI,CAACC,KAAK,CAACE,gBAAgB,GAAGJ,EAAE,CAAC;MACnC,CAAC,MAAM;QACL,IAAI,CAACE,KAAK,CAACG,gBAAgB,GAAGL,EAAE,CAAC;MACnC;IACF,CAAC;IAAA,IAAAH,gBAAA,CAAAC,OAAA,6BAEoBG,OAAgB,IAAMD,EAAiB,IAAK;MAC/D,IAAI,CAACC,OAAO,EAAE;QACZ,OAAO,IAAI,CAACC,KAAK,CAACG,gBAAgB,GAAGL,EAAE,CAAC;MAC1C;MAEA,IAAI,CAACE,KAAK,CAACE,gBAAgB,GAAGJ,EAAE,CAAC;IACnC,CAAC;IAAA,IAAAH,gBAAA,CAAAC,OAAA,4BAEmB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AS,EAAE;MACtB,MAAM,IAAIQ,KAAK,CAAC,aAAaF,KAAK,YAAY,CAAC;IACjD;IAEA,OAAOC,IAAI;EACb;EAEAE,kBAAkBA,CAChBC,CAAK,EACLJ,KAAa,EACiE;IAC9E,MAAM;MAAEvB,KAAK,GAAG,UAAU;MAAE4B,IAAI,GAAG,GAAG;MAAEC;IAAS,CAAC,GAAG,IAAI,CAACf,OAAO;IACjE,MAAMU,IAAI,GAAG,IAAI,CAACF,OAAO,CAACC,KAAK,CAAC;IAEhC,OAAO;MACL,GAAGC,IAAI;MACPxB,KAAK;MACL4B,IAAI;MACJE,iBAAiB,EAAE,IAAI,CAACA,iBAAiB,CAACN,IAAI,CAACtB,OAAO,CAAC;MACvD6B,gBAAgB,EAAE,IAAI,CAACA,gBAAgB;MACvCC,kBAAkB,EAAE,IAAI,CAACA,kBAAkB,CAAChC,KAAK,CAAC;MAClDiC,YAAY,EAAET,IAAI,CAACtB,OAAO,GAAG,IAAI,CAACgC,oBAAoB,CAACV,IAAI,CAACvB,EAAE,CAAC,GAAGgB,SAAS;MAC3EkB,YAAY,EAAE,IAAI,CAACC,oBAAoB,CAACZ,IAAI,CAACvB,EAAE,CAAC;MAChDoC,KAAK,EAAE;QAAEC,YAAY,EAAE,GAAGf,KAAK,GAAG,CAAC,EAAE;QAAEgB,UAAU,EAAE,GAAGhB,KAAK,GAAG,CAAC;MAAG,CAAC;MACnEM;IACF,CAAC;EACH;AAqCF;AAACW,OAAA,CAAA9C,UAAA,GAAAA,UAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"BaseLegend.type.js","names":[],"sources":["../../../../src/component/ChartLegend/BaseLegend.type.ts"],"sourcesContent":["import type { BoxProps, FlexProps } from '@semcore/flex-box';\n\nimport type { LegendItem, LegendItemKey, ShapeType } from './LegendItem/LegendItem.type';\nimport type { DataStructureHints } from '../../a11y/hints';\nimport type { PatternsConfig } from '../../Pattern';\nimport type { AriaNameProps } from '../Chart/AbstractChart.type';\n\nexport type LSize = 'm' | 'l';\n\nexport type BaseChartLegendProps = FlexProps &\n AriaNameProps & {\n /**\n * Size for legend items\n */\n size?: LSize;\n /**\n * Shape of data item on Legend panel\n */\n shape?: ShapeType;\n /**\n * Handler for change visible for data items. Doesn't work if Shape one of 'Circle' | 'Line' | 'Square'\n */\n onChangeVisibleItem?: (key: LegendItemKey, isVisible: boolean) => void;\n\n onMouseEnterItem?: (key: LegendItemKey, e?: React.SyntheticEvent) => void;\n\n onMouseLeaveItem?: (key: LegendItemKey, e?: React.SyntheticEvent) => void;\n\n dataHints?: DataStructureHints;\n };\n\nexport type LegendProps = BoxProps &\n BaseChartLegendProps & {\n /**\n * Legend items\n */\n items: LegendItem[];\n\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n };\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"BaseLegend.type.js","names":[],"sources":["../../../../src/component/ChartLegend/BaseLegend.type.ts"],"sourcesContent":["import type { BoxProps, FlexProps } from '@semcore/base-components';\n\nimport type { LegendItem, LegendItemKey, ShapeType } from './LegendItem/LegendItem.type';\nimport type { DataStructureHints } from '../../a11y/hints';\nimport type { PatternsConfig } from '../../Pattern';\nimport type { AriaNameProps } from '../Chart/AbstractChart.type';\n\nexport type LSize = 'm' | 'l';\n\nexport type BaseChartLegendProps = FlexProps &\n AriaNameProps & {\n /**\n * Size for legend items\n */\n size?: LSize;\n /**\n * Shape of data item on Legend panel\n */\n shape?: ShapeType;\n /**\n * Handler for change visible for data items. Doesn't work if Shape one of 'Circle' | 'Line' | 'Square'\n */\n onChangeVisibleItem?: (key: LegendItemKey, isVisible: boolean) => void;\n\n onMouseEnterItem?: (key: LegendItemKey, e?: React.SyntheticEvent) => void;\n\n onMouseLeaveItem?: (key: LegendItemKey, e?: React.SyntheticEvent) => void;\n\n dataHints?: DataStructureHints;\n };\n\nexport type LegendProps = BoxProps &\n BaseChartLegendProps & {\n /**\n * Legend items\n */\n items: LegendItem[];\n\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n };\n"],"mappings":"","ignoreList":[]}
@@ -1,93 +1,81 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.LegendFlex = void 0;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
12
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
9
  var _core = require("@semcore/core");
10
+ var _baseComponents = require("@semcore/base-components");
15
11
  var _checkbox = _interopRequireDefault(require("@semcore/checkbox"));
16
12
  var _i18nEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/i18nEnhance"));
17
13
  var _divider = _interopRequireDefault(require("@semcore/divider"));
18
- var _flexBox = require("@semcore/flex-box");
19
14
  var _react = _interopRequireDefault(require("react"));
20
15
  var _intergalacticDynamicLocales = require("../../../translations/__intergalactic-dynamic-locales");
21
- var _BaseLegend2 = require("../BaseLegend");
16
+ var _BaseLegend = require("../BaseLegend");
22
17
  var _LegendItem = require("../LegendItem/LegendItem");
23
18
  /*!__reshadow-styles__:"./legend-flex.shadow.css"*/
24
- var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SLegendFlex_qzq5k_gg_._direction_row_qzq5k_gg_{align-items:flex-start;align-content:flex-start;flex-wrap:wrap;gap:8px 16px}.___SLegendFlex_qzq5k_gg_._direction_column_qzq5k_gg_{align-items:flex-start;flex-wrap:wrap;gap:8px}", /*__inner_css_end__*/"qzq5k_gg_"),
19
+ const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SLegendFlex_ftcim_gg_._direction_row_ftcim_gg_{align-items:flex-start;align-content:flex-start;flex-wrap:wrap;gap:8px 16px}.___SLegendFlex_ftcim_gg_._direction_column_ftcim_gg_{align-items:flex-start;flex-wrap:wrap;gap:8px}", /*__inner_css_end__*/"ftcim_gg_"),
25
20
  /*__reshadow_css_end__*/
26
21
  {
27
- "__SLegendFlex": "___SLegendFlex_qzq5k_gg_",
28
- "_direction_row": "_direction_row_qzq5k_gg_",
29
- "_direction_column": "_direction_column_qzq5k_gg_"
22
+ "__SLegendFlex": "___SLegendFlex_ftcim_gg_",
23
+ "_direction_row": "_direction_row_ftcim_gg_",
24
+ "_direction_column": "_direction_column_ftcim_gg_"
30
25
  });
31
- var LegendFlexRoot = /*#__PURE__*/function (_BaseLegend) {
32
- function LegendFlexRoot() {
33
- (0, _classCallCheck2["default"])(this, LegendFlexRoot);
34
- return (0, _callSuper2["default"])(this, LegendFlexRoot, arguments);
26
+ class LegendFlexRoot extends _BaseLegend.BaseLegend {
27
+ renderTrend() {
28
+ const {
29
+ onTrendIsVisibleChange,
30
+ trendIsVisible,
31
+ trendLabel,
32
+ size,
33
+ getI18nText
34
+ } = this.asProps;
35
+ return /*#__PURE__*/_react.default.createElement(_checkbox.default, {
36
+ checked: trendIsVisible,
37
+ onChange: onTrendIsVisibleChange,
38
+ theme: "gray-400",
39
+ label: trendLabel ?? getI18nText('trend'),
40
+ size: size
41
+ });
35
42
  }
36
- (0, _inherits2["default"])(LegendFlexRoot, _BaseLegend);
37
- return (0, _createClass2["default"])(LegendFlexRoot, [{
38
- key: "renderTrend",
39
- value: function renderTrend() {
40
- var _ref3 = this.asProps,
41
- onTrendIsVisibleChange = _ref3.onTrendIsVisibleChange,
42
- trendIsVisible = _ref3.trendIsVisible,
43
- trendLabel = _ref3.trendLabel,
44
- size = _ref3.size,
45
- getI18nText = _ref3.getI18nText;
46
- return /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
47
- checked: trendIsVisible,
48
- onChange: onTrendIsVisibleChange,
49
- theme: "gray-400",
50
- label: trendLabel !== null && trendLabel !== void 0 ? trendLabel : getI18nText('trend'),
51
- size: size
52
- });
53
- }
54
- }, {
55
- key: "render",
56
- value: function render() {
57
- var _ref = this.asProps,
58
- _ref2;
59
- var SLegendFlex = _flexBox.Flex;
60
- var _this$asProps = this.asProps,
61
- styles = _this$asProps.styles,
62
- Children = _this$asProps.Children,
63
- direction = _this$asProps.direction,
64
- withTrend = _this$asProps.withTrend,
65
- suffix = _this$asProps.suffix,
66
- items = _this$asProps.items;
67
- var orientation = direction === 'row' ? 'vertical' : 'horizontal';
68
- return _ref2 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SLegendFlex, _ref2.cn("SLegendFlex", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
43
+ render() {
44
+ var _ref = this.asProps,
45
+ _ref2;
46
+ const SLegendFlex = _baseComponents.Flex;
47
+ const {
48
+ styles,
49
+ Children,
50
+ direction,
51
+ withTrend,
52
+ suffix,
53
+ items
54
+ } = this.asProps;
55
+ const orientation = direction === 'row' ? 'vertical' : 'horizontal';
56
+ return _ref2 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(SLegendFlex, _ref2.cn("SLegendFlex", {
57
+ ...(0, _core.assignProps)({
69
58
  "role": 'group'
70
- }, _ref))), items.map(function (_ref4) {
71
- var id = _ref4.id;
72
- return /*#__PURE__*/_react["default"].createElement(Children, {
73
- key: id
74
- });
75
- }), (withTrend || suffix) && /*#__PURE__*/_react["default"].createElement(_divider["default"], _ref2.cn("Divider", {
76
- "orientation": orientation
77
- })), withTrend && this.renderTrend(), suffix ? suffix : null);
78
- }
79
- }]);
80
- }(_BaseLegend2.BaseLegend);
81
- (0, _defineProperty2["default"])(LegendFlexRoot, "displayName", 'LegendFlex');
82
- (0, _defineProperty2["default"])(LegendFlexRoot, "style", style);
83
- (0, _defineProperty2["default"])(LegendFlexRoot, "enhance", [(0, _i18nEnhance["default"])(_intergalacticDynamicLocales.localizedMessages)]);
84
- (0, _defineProperty2["default"])(LegendFlexRoot, "defaultProps", function () {
85
- return {
86
- direction: 'row',
87
- children: /*#__PURE__*/_react["default"].createElement(LegendFlex.LegendItem, null)
88
- };
89
- });
90
- var LegendFlex = exports.LegendFlex = (0, _core.createComponent)(LegendFlexRoot, {
59
+ }, _ref)
60
+ }), items.map(({
61
+ id
62
+ }) => {
63
+ return /*#__PURE__*/_react.default.createElement(Children, {
64
+ key: id
65
+ });
66
+ }), (withTrend || suffix) && /*#__PURE__*/_react.default.createElement(_divider.default, _ref2.cn("Divider", {
67
+ "orientation": orientation
68
+ })), withTrend && this.renderTrend(), suffix ? suffix : null);
69
+ }
70
+ }
71
+ (0, _defineProperty2.default)(LegendFlexRoot, "displayName", 'LegendFlex');
72
+ (0, _defineProperty2.default)(LegendFlexRoot, "style", style);
73
+ (0, _defineProperty2.default)(LegendFlexRoot, "enhance", [(0, _i18nEnhance.default)(_intergalacticDynamicLocales.localizedMessages)]);
74
+ (0, _defineProperty2.default)(LegendFlexRoot, "defaultProps", () => ({
75
+ direction: 'row',
76
+ children: /*#__PURE__*/_react.default.createElement(LegendFlex.LegendItem, null)
77
+ }));
78
+ const LegendFlex = exports.LegendFlex = (0, _core.createComponent)(LegendFlexRoot, {
91
79
  LegendItem: _LegendItem.LegendItemComponent
92
80
  });
93
81
  //# sourceMappingURL=LegendFlex.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LegendFlex.js","names":["_core","require","_checkbox","_interopRequireDefault","_i18nEnhance","_divider","_flexBox","_react","_intergalacticDynamicLocales","_BaseLegend2","_LegendItem","style","sstyled","insert","LegendFlexRoot","_BaseLegend","_classCallCheck2","_callSuper2","arguments","_inherits2","_createClass2","key","value","renderTrend","_ref3","asProps","onTrendIsVisibleChange","trendIsVisible","trendLabel","size","getI18nText","createElement","checked","onChange","theme","label","render","_ref","_ref2","SLegendFlex","Flex","_this$asProps","styles","Children","direction","withTrend","suffix","items","orientation","cn","_objectSpread2","assignProps","map","_ref4","id","BaseLegend","_defineProperty2","i18nEnhance","localizedMessages","children","LegendFlex","LegendItem","exports","createComponent","LegendItemComponent"],"sources":["../../../../../src/component/ChartLegend/LegendFlex/LegendFlex.tsx"],"sourcesContent":["import Checkbox from '@semcore/checkbox';\nimport { createComponent, sstyled, Root } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport Divider from '@semcore/divider';\nimport { Flex } from '@semcore/flex-box';\nimport React from 'react';\n\nimport style from './legend-flex.shadow.css';\nimport type { LegendFlexType, LegendFlexProps, TrendProps } from './LegendFlex.type';\nimport { localizedMessages } from '../../../translations/__intergalactic-dynamic-locales';\nimport { BaseLegend } from '../BaseLegend';\nimport { LegendItemComponent } from '../LegendItem/LegendItem';\n\nclass LegendFlexRoot extends BaseLegend<LegendFlexProps> {\n static displayName = 'LegendFlex';\n static style = style;\n\n static enhance = [i18nEnhance(localizedMessages)];\n\n static defaultProps = () => ({\n direction: 'row',\n children: <LegendFlex.LegendItem />,\n });\n\n renderTrend() {\n const { onTrendIsVisibleChange, trendIsVisible, trendLabel, size, getI18nText } = this\n .asProps as TrendProps & LegendFlexProps & { getI18nText: (s: string) => string };\n\n return (\n <Checkbox\n checked={trendIsVisible}\n onChange={onTrendIsVisibleChange}\n theme='gray-400'\n label={trendLabel ?? getI18nText('trend')}\n size={size}\n />\n );\n }\n\n render() {\n const SLegendFlex = Root;\n const { styles, Children, direction, withTrend, suffix, items } = this.asProps;\n const orientation = direction === 'row' ? 'vertical' : 'horizontal';\n\n return sstyled(styles)(\n <SLegendFlex render={Flex} role='group'>\n {items.map(({ id }) => {\n return <Children key={id} />;\n })}\n {(withTrend || suffix) && <Divider orientation={orientation} />}\n {withTrend && this.renderTrend()}\n {suffix ? suffix : null}\n </SLeg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AC/BuB,MAAM,GAAGA,MAAM,GAAG,IACR,CAAC;IAElB;EAAC;AAAA,EAzC0BS,uBAAU;AAAA,IAAAC,gBAAA,aAAjC1C,cAAc,iBACG,YAAY;AAAA,IAAA0C,gBAAA,aAD7B1C,cAAc,WAEHH,KAAK;AAAA,IAAA6C,gBAAA,aAFhB1C,cAAc,aAID,CAAC,IAAA2C,uBAAW,EAACC,8CAAiB,CAAC,CAAC;AAAA,IAAAF,gBAAA,aAJ7C1C,cAAc,kBAMI;EAAA,OAAO;IAC3B8B,SAAS,EAAE,KAAK;IAChBe,QAAQ,eAAEpD,MAAA,YAAAwB,aAAA,CAAC6B,UAAU,CAACC,UAAU,MAAE;EACpC,CAAC;AAAA,CAAC;AAmCG,IAAMD,UAA0B,GAAAE,OAAA,CAAAF,UAAA,GAAG,IAAAG,qBAAe,EAACjD,cAAc,EAAE;EACxE+C,UAAU,EAAEG;AACd,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"LegendFlex.js","names":["_core","require","_baseComponents","_checkbox","_interopRequireDefault","_i18nEnhance","_divider","_react","_intergalacticDynamicLocales","_BaseLegend","_LegendItem","style","sstyled","insert","LegendFlexRoot","BaseLegend","renderTrend","onTrendIsVisibleChange","trendIsVisible","trendLabel","size","getI18nText","asProps","default","createElement","checked","onChange","theme","label","render","_ref","_ref2","SLegendFlex","Flex","styles","Children","direction","withTrend","suffix","items","orientation","cn","assignProps","map","id","key","_defineProperty2","i18nEnhance","localizedMessages","children","LegendFlex","LegendItem","exports","createComponent","LegendItemComponent"],"sources":["../../../../../src/component/ChartLegend/LegendFlex/LegendFlex.tsx"],"sourcesContent":["import { Flex } from '@semcore/base-components';\nimport Checkbox from '@semcore/checkbox';\nimport { createComponent, sstyled, Root } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport Divider from '@semcore/divider';\nimport React from 'react';\n\nimport style from './legend-flex.shadow.css';\nimport type { LegendFlexType, LegendFlexProps, TrendProps } from './LegendFlex.type';\nimport { localizedMessages } from '../../../translations/__intergalactic-dynamic-locales';\nimport { BaseLegend } from '../BaseLegend';\nimport { LegendItemComponent } from '../LegendItem/LegendItem';\n\nclass LegendFlexRoot extends BaseLegend<LegendFlexProps, typeof LegendFlexRoot.enhance> {\n static displayName = 'LegendFlex';\n static style = style;\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n static defaultProps = () => ({\n direction: 'row',\n children: <LegendFlex.LegendItem />,\n });\n\n renderTrend() {\n const { onTrendIsVisibleChange, trendIsVisible, trendLabel, size, getI18nText } = this\n .asProps as unknown as TrendProps & LegendFlexProps & { getI18nText: (s: string) => string };\n\n return (\n <Checkbox\n checked={trendIsVisible}\n onChange={onTrendIsVisibleChange}\n theme='gray-400'\n label={trendLabel ?? getI18nText('trend')}\n size={size}\n />\n );\n }\n\n render() {\n const SLegendFlex = Root;\n const { styles, Children, direction, withTrend, suffix, items } = this.asProps;\n const orientation = direction === 'row' ? 'vertical' : 'horizontal';\n\n return sstyled(styles)(\n <SLegendFlex render={Flex} role='group'>\n {items.map(({ id }) => {\n return <Children key={id} />;\n })}\n {(withTrend || suffix) && <Divider orientation={orientation} />}\n {withTrend && this.renderTrend()}\n {suffix ? suffix : null}\n </SLegendFlex>,\n );\n }\n}\n\nexport const LegendFlex = createComponent(LegendFlexRoot, {\n LegendItem: LegendItemComponent,\n}) as LegendFlexType;\n"],"mappings":";;;;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAFA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,YAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,QAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,MAAA,GAAAH,sBAAA,CAAAH,OAAA;AAIA,IAAAO,4BAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAA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9B,CAAC,CAAC,EACD,CAACP,SAAS,IAAIC,MAAM,kBAAK/B,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAAClB,QAAA,CAAAiB,OAAO,EAAAQ,KAAA,CAAAU,EAAA;MAAA,eAAcD;IAAW,EAAG,CAAC,EAC9DH,SAAS,IAAI,IAAI,CAACrB,WAAW,CAAC,CAAC,EAC/BsB,MAAM,GAAGA,MAAM,GAAG,IACR,CAAC;EAElB;AACF;AAAC,IAAAQ,gBAAA,CAAAvB,OAAA,EA1CKT,cAAc,iBACG,YAAY;AAAA,IAAAgC,gBAAA,CAAAvB,OAAA,EAD7BT,cAAc,WAEHH,KAAK;AAAA,IAAAmC,gBAAA,CAAAvB,OAAA,EAFhBT,cAAc,aAID,CAAC,IAAAiC,oBAAW,EAACC,8CAAiB,CAAC,CAAC;AAAA,IAAAF,gBAAA,CAAAvB,OAAA,EAJ7CT,cAAc,kBAMI,OAAO;EAC3BsB,SAAS,EAAE,KAAK;EAChBa,QAAQ,eAAE1C,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAAC0B,UAAU,CAACC,UAAU,MAAE;AACpC,CAAC,CAAC;AAmCG,MAAMD,UAAU,GAAAE,OAAA,CAAAF,UAAA,GAAG,IAAAG,qBAAe,EAACvC,cAAc,EAAE;EACxDqC,UAAU,EAAEG;AACd,CAAC,CAAmB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"LegendFlex.type.js","names":[],"sources":["../../../../../src/component/ChartLegend/LegendFlex/LegendFlex.type.ts"],"sourcesContent":["import type { Intergalactic } from '@semcore/core';\nimport type { Flex, FlexProps } from '@semcore/flex-box';\n\nimport type { LegendProps } from '../BaseLegend.type';\nimport type { LegendItemType } from '../LegendItem/LegendItem.type';\n\nexport type TrendProps = {\n /**\n * Flag for include trend LegendItem in Legend\n */\n withTrend: true;\n /**\n * Trend label (for localization)\n */\n trendLabel?: string;\n /**\n * Flag for describe are trend is visible\n */\n trendIsVisible: boolean;\n /**\n * Handler for change trend visibility\n */\n onTrendIsVisibleChange: (isVisible: boolean) => void;\n};\n\ntype SuffixProps = {\n /**\n * Element after all Legend items\n */\n suffix?: React.ReactElement;\n};\n\ntype AddonProps = ({ withTrend?: never } & SuffixProps) | ({ suffix?: never } & TrendProps);\n\nexport type LegendFlexProps = LegendProps & AddonProps & FlexProps;\n\nexport type LegendFlexType = Intergalactic.Component<typeof Flex, LegendFlexProps> & {\n LegendItem: LegendItemType;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"LegendFlex.type.js","names":[],"sources":["../../../../../src/component/ChartLegend/LegendFlex/LegendFlex.type.ts"],"sourcesContent":["import type { Flex, FlexProps } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\n\nimport type { LegendProps } from '../BaseLegend.type';\nimport type { LegendItemType } from '../LegendItem/LegendItem.type';\n\nexport type TrendProps = {\n /**\n * Flag for include trend LegendItem in Legend\n */\n withTrend: true;\n /**\n * Trend label (for localization)\n */\n trendLabel?: string;\n /**\n * Flag for describe are trend is visible\n */\n trendIsVisible: boolean;\n /**\n * Handler for change trend visibility\n */\n onTrendIsVisibleChange: (isVisible: boolean) => void;\n};\n\ntype SuffixProps = {\n /**\n * Element after all Legend items\n */\n suffix?: React.ReactElement;\n};\n\ntype AddonProps = ({ withTrend?: never } & SuffixProps) | ({ suffix?: never } & TrendProps);\n\nexport type LegendFlexProps = LegendProps & AddonProps & FlexProps;\n\nexport type LegendFlexType = Intergalactic.Component<typeof Flex, LegendFlexProps> & {\n LegendItem: LegendItemType;\n};\n"],"mappings":"","ignoreList":[]}