@semcore/d3-chart 16.7.0-prerelease.1 → 16.7.0

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 (281) hide show
  1. package/lib/cjs/Area.js +11 -11
  2. package/lib/cjs/Axis.js +18 -16
  3. package/lib/cjs/Axis.js.map +1 -1
  4. package/lib/cjs/Bar.js +16 -16
  5. package/lib/cjs/Bubble.js +14 -14
  6. package/lib/cjs/CompactHorizontalBar.js +20 -20
  7. package/lib/cjs/CompactHorizontalBar.js.map +1 -1
  8. package/lib/cjs/Donut.js +9 -9
  9. package/lib/cjs/Dots.js +8 -8
  10. package/lib/cjs/HorizontalBar.js +17 -17
  11. package/lib/cjs/HorizontalBar.js.map +1 -1
  12. package/lib/cjs/Hover.js +3 -3
  13. package/lib/cjs/Line.js +9 -9
  14. package/lib/cjs/Plot.js +6 -9
  15. package/lib/cjs/Plot.js.map +1 -1
  16. package/lib/cjs/Radar.js +19 -19
  17. package/lib/cjs/RadialTree.js +12 -12
  18. package/lib/cjs/RadialTree.js.map +1 -1
  19. package/lib/cjs/Reference.js +12 -12
  20. package/lib/cjs/ResponsiveContainer.js +2 -2
  21. package/lib/cjs/ResponsiveContainer.js.map +1 -1
  22. package/lib/cjs/ScatterPlot.js +9 -9
  23. package/lib/cjs/StackBar.js +3 -8
  24. package/lib/cjs/StackBar.js.map +1 -1
  25. package/lib/cjs/Tooltip.js +18 -19
  26. package/lib/cjs/Tooltip.js.map +1 -1
  27. package/lib/cjs/Venn.js +12 -12
  28. package/lib/cjs/Venn.js.map +1 -1
  29. package/lib/cjs/a11y/PlotA11yModule.js +37 -79
  30. package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
  31. package/lib/cjs/a11y/PlotA11yView.js +39 -12
  32. package/lib/cjs/a11y/PlotA11yView.js.map +1 -1
  33. package/lib/cjs/a11y/translations/module/de.json +2 -2
  34. package/lib/cjs/a11y/translations/module/en.json +2 -2
  35. package/lib/cjs/a11y/translations/module/es.json +2 -2
  36. package/lib/cjs/a11y/translations/module/fr.json +2 -2
  37. package/lib/cjs/a11y/translations/module/it.json +2 -2
  38. package/lib/cjs/a11y/translations/module/ja.json +2 -2
  39. package/lib/cjs/a11y/translations/module/ko.json +2 -2
  40. package/lib/cjs/a11y/translations/module/nl.json +2 -2
  41. package/lib/cjs/a11y/translations/module/pl.json +2 -2
  42. package/lib/cjs/a11y/translations/module/pt.json +2 -2
  43. package/lib/cjs/a11y/translations/module/sv.json +2 -2
  44. package/lib/cjs/a11y/translations/module/tr.json +2 -2
  45. package/lib/cjs/a11y/translations/module/vi.json +2 -2
  46. package/lib/cjs/a11y/translations/module/zh.json +2 -2
  47. package/lib/cjs/component/Chart/AbstractChart.js +9 -9
  48. package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
  49. package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
  50. package/lib/cjs/component/Chart/AreaChart.js.map +1 -1
  51. package/lib/cjs/component/Chart/AreaChart.type.js.map +1 -1
  52. package/lib/cjs/component/Chart/BarChart.js +66 -19
  53. package/lib/cjs/component/Chart/BarChart.js.map +1 -1
  54. package/lib/cjs/component/Chart/BarChart.type.js.map +1 -1
  55. package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -1
  56. package/lib/cjs/component/Chart/CigaretteChart.js +8 -8
  57. package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
  58. package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
  59. package/lib/cjs/component/Chart/DonutChart.js +2 -2
  60. package/lib/cjs/component/Chart/DonutChart.js.map +1 -1
  61. package/lib/cjs/component/Chart/DonutChart.type.js.map +1 -1
  62. package/lib/cjs/component/Chart/HistogramChart.type.js.map +1 -1
  63. package/lib/cjs/component/Chart/LineChart.type.js.map +1 -1
  64. package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
  65. package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -1
  66. package/lib/cjs/component/Chart/VennChart.type.js.map +1 -1
  67. package/lib/cjs/component/ChartLegend/BaseLegend.js +1 -1
  68. package/lib/cjs/component/ChartLegend/BaseLegend.js.map +1 -1
  69. package/lib/cjs/component/ChartLegend/BaseLegend.type.js.map +1 -1
  70. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +6 -6
  71. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
  72. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
  73. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +23 -23
  74. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  75. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
  76. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +9 -9
  77. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  78. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
  79. package/lib/cjs/component/Cigarette/Cigarette.js.map +1 -1
  80. package/lib/cjs/style/axis.shadow.css +3 -1
  81. package/lib/cjs/style/plot.shadow.css +1 -3
  82. package/lib/cjs/style/plotA11yModule.shadow.css +10 -11
  83. package/lib/cjs/style/plotA11yView.shadow.css +13 -26
  84. package/lib/cjs/types/Axis.d.js.map +1 -1
  85. package/lib/cjs/types/CompactHorizontalBar.d.js.map +1 -1
  86. package/lib/cjs/types/Hover.d.js.map +1 -1
  87. package/lib/cjs/types/Line.d.js.map +1 -1
  88. package/lib/cjs/types/Plot.d.js.map +1 -1
  89. package/lib/cjs/types/Radar.d.js.map +1 -1
  90. package/lib/cjs/types/ResponsiveContainer.d.js.map +1 -1
  91. package/lib/cjs/types/Tooltip.d.js.map +1 -1
  92. package/lib/cjs/types/Venn.d.js.map +1 -1
  93. package/lib/cjs/utils.js.map +1 -1
  94. package/lib/es6/Area.js +11 -11
  95. package/lib/es6/Axis.js +18 -16
  96. package/lib/es6/Axis.js.map +1 -1
  97. package/lib/es6/Bar.js +16 -16
  98. package/lib/es6/Bubble.js +14 -14
  99. package/lib/es6/CompactHorizontalBar.js +17 -17
  100. package/lib/es6/CompactHorizontalBar.js.map +1 -1
  101. package/lib/es6/Donut.js +9 -9
  102. package/lib/es6/Dots.js +8 -8
  103. package/lib/es6/HorizontalBar.js +17 -17
  104. package/lib/es6/HorizontalBar.js.map +1 -1
  105. package/lib/es6/Hover.js +3 -3
  106. package/lib/es6/Line.js +9 -9
  107. package/lib/es6/Plot.js +5 -8
  108. package/lib/es6/Plot.js.map +1 -1
  109. package/lib/es6/Radar.js +19 -19
  110. package/lib/es6/RadialTree.js +12 -12
  111. package/lib/es6/RadialTree.js.map +1 -1
  112. package/lib/es6/Reference.js +12 -12
  113. package/lib/es6/ResponsiveContainer.js +1 -1
  114. package/lib/es6/ResponsiveContainer.js.map +1 -1
  115. package/lib/es6/ScatterPlot.js +9 -9
  116. package/lib/es6/StackBar.js +3 -8
  117. package/lib/es6/StackBar.js.map +1 -1
  118. package/lib/es6/Tooltip.js +10 -11
  119. package/lib/es6/Tooltip.js.map +1 -1
  120. package/lib/es6/Venn.js +10 -10
  121. package/lib/es6/Venn.js.map +1 -1
  122. package/lib/es6/a11y/PlotA11yModule.js +36 -80
  123. package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
  124. package/lib/es6/a11y/PlotA11yView.js +37 -10
  125. package/lib/es6/a11y/PlotA11yView.js.map +1 -1
  126. package/lib/es6/a11y/translations/module/de.json +2 -2
  127. package/lib/es6/a11y/translations/module/en.json +2 -2
  128. package/lib/es6/a11y/translations/module/es.json +2 -2
  129. package/lib/es6/a11y/translations/module/fr.json +2 -2
  130. package/lib/es6/a11y/translations/module/it.json +2 -2
  131. package/lib/es6/a11y/translations/module/ja.json +2 -2
  132. package/lib/es6/a11y/translations/module/ko.json +2 -2
  133. package/lib/es6/a11y/translations/module/nl.json +2 -2
  134. package/lib/es6/a11y/translations/module/pl.json +2 -2
  135. package/lib/es6/a11y/translations/module/pt.json +2 -2
  136. package/lib/es6/a11y/translations/module/sv.json +2 -2
  137. package/lib/es6/a11y/translations/module/tr.json +2 -2
  138. package/lib/es6/a11y/translations/module/vi.json +2 -2
  139. package/lib/es6/a11y/translations/module/zh.json +2 -2
  140. package/lib/es6/component/Chart/AbstractChart.js +5 -5
  141. package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
  142. package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
  143. package/lib/es6/component/Chart/AreaChart.js.map +1 -1
  144. package/lib/es6/component/Chart/AreaChart.type.js.map +1 -1
  145. package/lib/es6/component/Chart/BarChart.js +67 -20
  146. package/lib/es6/component/Chart/BarChart.js.map +1 -1
  147. package/lib/es6/component/Chart/BarChart.type.js.map +1 -1
  148. package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -1
  149. package/lib/es6/component/Chart/CigaretteChart.js +1 -1
  150. package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
  151. package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
  152. package/lib/es6/component/Chart/DonutChart.js +1 -1
  153. package/lib/es6/component/Chart/DonutChart.js.map +1 -1
  154. package/lib/es6/component/Chart/DonutChart.type.js.map +1 -1
  155. package/lib/es6/component/Chart/HistogramChart.type.js.map +1 -1
  156. package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
  157. package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
  158. package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
  159. package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
  160. package/lib/es6/component/ChartLegend/BaseLegend.js +1 -1
  161. package/lib/es6/component/ChartLegend/BaseLegend.js.map +1 -1
  162. package/lib/es6/component/ChartLegend/BaseLegend.type.js.map +1 -1
  163. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +5 -5
  164. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
  165. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
  166. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +18 -18
  167. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
  168. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
  169. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +7 -7
  170. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
  171. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
  172. package/lib/es6/component/Cigarette/Cigarette.js.map +1 -1
  173. package/lib/es6/style/axis.shadow.css +3 -1
  174. package/lib/es6/style/plot.shadow.css +1 -3
  175. package/lib/es6/style/plotA11yModule.shadow.css +10 -11
  176. package/lib/es6/style/plotA11yView.shadow.css +13 -26
  177. package/lib/es6/types/Axis.d.js.map +1 -1
  178. package/lib/es6/types/CompactHorizontalBar.d.js.map +1 -1
  179. package/lib/es6/types/Hover.d.js.map +1 -1
  180. package/lib/es6/types/Line.d.js.map +1 -1
  181. package/lib/es6/types/Plot.d.js.map +1 -1
  182. package/lib/es6/types/Radar.d.js.map +1 -1
  183. package/lib/es6/types/ResponsiveContainer.d.js.map +1 -1
  184. package/lib/es6/types/Tooltip.d.js.map +1 -1
  185. package/lib/es6/types/Venn.d.js.map +1 -1
  186. package/lib/es6/utils.js.map +1 -1
  187. package/lib/esm/AnimatedClipPath.mjs +2 -7
  188. package/lib/esm/Area.mjs +14 -14
  189. package/lib/esm/Axis.mjs +21 -19
  190. package/lib/esm/Bar.mjs +17 -17
  191. package/lib/esm/Bubble.mjs +16 -16
  192. package/lib/esm/CompactHorizontalBar.mjs +20 -19
  193. package/lib/esm/Donut.mjs +15 -13
  194. package/lib/esm/Dots.mjs +10 -10
  195. package/lib/esm/HorizontalBar.mjs +18 -18
  196. package/lib/esm/Hover.mjs +6 -6
  197. package/lib/esm/Line.mjs +12 -12
  198. package/lib/esm/Plot.mjs +7 -10
  199. package/lib/esm/Radar.mjs +23 -23
  200. package/lib/esm/RadialTree.mjs +13 -13
  201. package/lib/esm/Reference.mjs +13 -13
  202. package/lib/esm/ResponsiveContainer.mjs +2 -2
  203. package/lib/esm/ScatterPlot.mjs +12 -11
  204. package/lib/esm/StackBar.mjs +4 -9
  205. package/lib/esm/StackedArea.mjs +2 -2
  206. package/lib/esm/Tooltip.mjs +13 -16
  207. package/lib/esm/Venn.mjs +13 -12
  208. package/lib/esm/a11y/PlotA11yModule.mjs +31 -69
  209. package/lib/esm/a11y/PlotA11yView.mjs +35 -10
  210. package/lib/esm/a11y/insights.mjs +2 -1
  211. package/lib/esm/a11y/intl.mjs +1 -1
  212. package/lib/esm/a11y/translations/module/de.json.mjs +2 -4
  213. package/lib/esm/a11y/translations/module/en.json.mjs +2 -4
  214. package/lib/esm/a11y/translations/module/es.json.mjs +2 -4
  215. package/lib/esm/a11y/translations/module/fr.json.mjs +2 -4
  216. package/lib/esm/a11y/translations/module/it.json.mjs +2 -4
  217. package/lib/esm/a11y/translations/module/ja.json.mjs +2 -4
  218. package/lib/esm/a11y/translations/module/ko.json.mjs +2 -4
  219. package/lib/esm/a11y/translations/module/nl.json.mjs +2 -4
  220. package/lib/esm/a11y/translations/module/pl.json.mjs +2 -4
  221. package/lib/esm/a11y/translations/module/pt.json.mjs +2 -4
  222. package/lib/esm/a11y/translations/module/sv.json.mjs +2 -4
  223. package/lib/esm/a11y/translations/module/tr.json.mjs +2 -4
  224. package/lib/esm/a11y/translations/module/vi.json.mjs +2 -4
  225. package/lib/esm/a11y/translations/module/zh.json.mjs +2 -4
  226. package/lib/esm/component/Chart/AbstractChart.mjs +12 -10
  227. package/lib/esm/component/Chart/AreaChart.mjs +5 -4
  228. package/lib/esm/component/Chart/BarChart.mjs +44 -3
  229. package/lib/esm/component/Chart/BubbleChart.mjs +3 -2
  230. package/lib/esm/component/Chart/CigaretteChart.mjs +6 -5
  231. package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +2 -1
  232. package/lib/esm/component/Chart/DonutChart.mjs +3 -2
  233. package/lib/esm/component/Chart/HistogramChart.mjs +5 -4
  234. package/lib/esm/component/Chart/LineChart.mjs +4 -3
  235. package/lib/esm/component/Chart/RadarChart.mjs +2 -1
  236. package/lib/esm/component/Chart/ScatterPlotChart.mjs +3 -2
  237. package/lib/esm/component/Chart/VennChart.mjs +2 -1
  238. package/lib/esm/component/ChartLegend/BaseLegend.mjs +1 -1
  239. package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +7 -7
  240. package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +21 -25
  241. package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +9 -9
  242. package/lib/esm/component/ChartLegend/index.mjs +2 -0
  243. package/lib/esm/component/StackGroupBar/StackGroupBar.mjs +1 -1
  244. package/lib/esm/createElement.mjs +2 -4
  245. package/lib/esm/index.mjs +1 -0
  246. package/lib/esm/style/axis.shadow.css +3 -1
  247. package/lib/esm/style/plot.shadow.css +1 -3
  248. package/lib/esm/style/plotA11yModule.shadow.css +10 -11
  249. package/lib/esm/style/plotA11yView.shadow.css +13 -26
  250. package/lib/esm/utils.mjs +2 -2
  251. package/lib/types/Axis.d.ts +4 -0
  252. package/lib/types/CompactHorizontalBar.d.ts +1 -1
  253. package/lib/types/Hover.d.ts +1 -1
  254. package/lib/types/Line.d.ts +1 -1
  255. package/lib/types/Plot.d.ts +1 -1
  256. package/lib/types/Radar.d.ts +1 -1
  257. package/lib/types/ResponsiveContainer.d.ts +1 -1
  258. package/lib/types/Tooltip.d.ts +1 -3
  259. package/lib/types/Venn.d.ts +1 -1
  260. package/lib/types/a11y/PlotA11yModule.d.ts +4 -11
  261. package/lib/types/a11y/PlotA11yView.d.ts +13 -2
  262. package/lib/types/a11y/translations/module/__intergalactic-dynamic-locales.d.ts +14 -14
  263. package/lib/types/component/Chart/AbstractChart.d.ts +1 -1
  264. package/lib/types/component/Chart/AbstractChart.type.d.ts +1 -1
  265. package/lib/types/component/Chart/AreaChart.type.d.ts +1 -1
  266. package/lib/types/component/Chart/BarChart.type.d.ts +1 -1
  267. package/lib/types/component/Chart/BubbleChart.type.d.ts +1 -1
  268. package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +1 -1
  269. package/lib/types/component/Chart/DonutChart.type.d.ts +1 -1
  270. package/lib/types/component/Chart/HistogramChart.type.d.ts +1 -1
  271. package/lib/types/component/Chart/LineChart.type.d.ts +1 -1
  272. package/lib/types/component/Chart/RadarChart.type.d.ts +1 -1
  273. package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +1 -1
  274. package/lib/types/component/Chart/VennChart.type.d.ts +1 -1
  275. package/lib/types/component/ChartLegend/BaseLegend.d.ts +1 -1
  276. package/lib/types/component/ChartLegend/BaseLegend.type.d.ts +1 -1
  277. package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.type.d.ts +1 -1
  278. package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts +1 -1
  279. package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts +1 -1
  280. package/lib/types/utils.d.ts +10 -10
  281. package/package.json +19 -19
@@ -1 +1 @@
1
- {"version":3,"file":"LineChart.type.js","names":[],"sources":["../../../../src/component/Chart/LineChart.type.ts"],"sourcesContent":["import type { Intergalactic } from '@semcore/core';\nimport type { Flex } from '@semcore/flex-box';\nimport type { ScaleLinear, ScaleTime } from 'd3-scale';\nimport type { CurveFactory } from 'd3-shape';\n\nimport type { BaseChartProps } from './AbstractChart.type';\nimport type { interpolateValue } from '../../utils';\nimport type { LegendItemKey } from '../ChartLegend/LegendItem/LegendItem.type';\n\ntype AreaItem = {\n x: number;\n y0: number;\n y1: number;\n};\n\nexport type LineChartData = Array<Record<string, string | number | typeof interpolateValue | Date>>;\n\nexport type LineChartProps = BaseChartProps<LineChartData> & {\n /** Field name that groups the data points */\n groupKey: string;\n /** Optional area data for rendering filled areas under lines */\n area?: Record<LegendItemKey, AreaItem[]>;\n /** Custom x-axis scale */\n xScale?: ScaleLinear<any, any> | ScaleTime<any, any>;\n /** Custom y-axis scale */\n yScale?: ScaleLinear<any, any>;\n /** Controls whether to display dots on the line chart */\n showDots?: boolean;\n /** D3 curve factory for line interpolation */\n curve?: CurveFactory;\n /** Curve factory specifically for area rendering */\n areaCurve?: CurveFactory;\n /** Callback triggered when a user clicks on a line */\n onClickLine?: (index: number, event: React.SyntheticEvent) => void;\n};\n\nexport type LineChartType = Intergalactic.Component<typeof Flex, LineChartProps>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"LineChart.type.js","names":[],"sources":["../../../../src/component/Chart/LineChart.type.ts"],"sourcesContent":["import type { Flex } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport type { ScaleLinear, ScaleTime } from 'd3-scale';\nimport type { CurveFactory } from 'd3-shape';\n\nimport type { BaseChartProps } from './AbstractChart.type';\nimport type { interpolateValue } from '../../utils';\nimport type { LegendItemKey } from '../ChartLegend/LegendItem/LegendItem.type';\n\ntype AreaItem = {\n x: number;\n y0: number;\n y1: number;\n};\n\nexport type LineChartData = Array<Record<string, string | number | typeof interpolateValue | Date>>;\n\nexport type LineChartProps = BaseChartProps<LineChartData> & {\n /** Field name that groups the data points */\n groupKey: string;\n /** Optional area data for rendering filled areas under lines */\n area?: Record<LegendItemKey, AreaItem[]>;\n /** Custom x-axis scale */\n xScale?: ScaleLinear<any, any> | ScaleTime<any, any>;\n /** Custom y-axis scale */\n yScale?: ScaleLinear<any, any>;\n /** Controls whether to display dots on the line chart */\n showDots?: boolean;\n /** D3 curve factory for line interpolation */\n curve?: CurveFactory;\n /** Curve factory specifically for area rendering */\n areaCurve?: CurveFactory;\n /** Callback triggered when a user clicks on a line */\n onClickLine?: (index: number, event: React.SyntheticEvent) => void;\n};\n\nexport type LineChartType = Intergalactic.Component<typeof Flex, LineChartProps>;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"RadarChart.type.js","names":[],"sources":["../../../../src/component/Chart/RadarChart.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 RadarChartData = Record<string, string[] | number[]>;\n\nexport type RadarChartProps = Intergalactic.InternalTypings.EfficientOmit<\n BaseChartProps<RadarChartData>,\n 'showTotalInTooltip' | 'showPercentValueInTooltip'\n> & {\n groupKey: string;\n scale?: ScaleLinear<any, any>;\n xScale?: never;\n yScale?: never;\n showDots?: boolean;\n circle?: boolean;\n /** Callback triggered when a user clicks on a chart at a position corresponding to a category */\n onClickRadar?: (index: number, e: React.SyntheticEvent) => void;\n};\n\nexport type RadarChartType = Intergalactic.Component<typeof Flex, RadarChartProps>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"RadarChart.type.js","names":[],"sources":["../../../../src/component/Chart/RadarChart.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 RadarChartData = Record<string, string[] | number[]>;\n\nexport type RadarChartProps = Intergalactic.InternalTypings.EfficientOmit<\n BaseChartProps<RadarChartData>,\n 'showTotalInTooltip' | 'showPercentValueInTooltip'\n> & {\n groupKey: string;\n scale?: ScaleLinear<any, any>;\n xScale?: never;\n yScale?: never;\n showDots?: boolean;\n circle?: boolean;\n /** Callback triggered when a user clicks on a chart at a position corresponding to a category */\n onClickRadar?: (index: number, e: React.SyntheticEvent) => void;\n};\n\nexport type RadarChartType = Intergalactic.Component<typeof Flex, RadarChartProps>;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"ScatterPlotChart.type.js","names":[],"sources":["../../../../src/component/Chart/ScatterPlotChart.type.ts"],"sourcesContent":["import type { Intergalactic } from '@semcore/core';\nimport type { Flex } from '@semcore/flex-box';\nimport type { ScaleLinear, ScaleTime } from 'd3-scale';\n\nimport type { BaseChartProps } from './AbstractChart.type';\nimport type { interpolateValue } from '../../utils';\n\nexport type ScatterPlotChartData = Array<Record<string, number | typeof interpolateValue | Date>>;\n\nexport type ScatterPlotChartProps = Intergalactic.InternalTypings.EfficientOmit<\n BaseChartProps<ScatterPlotChartData>,\n 'showTotalInTooltip'\n> & {\n /** Field name that groups the data points */\n groupKey: string;\n /** Custom x-axis scale */\n xScale?: ScaleLinear<any, any> | ScaleTime<any, any>;\n /** Custom y-axis scale */\n yScale?: ScaleLinear<any, any>;\n /** Optional field name for additional value data */\n valueKey?: string;\n /** Callback triggered when a user clicks on a scatter item */\n onClickScatterItem?: (index: number, event: React.SyntheticEvent) => void;\n};\n\nexport type ScatterPlotChartType = Intergalactic.Component<typeof Flex, ScatterPlotChartProps>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"ScatterPlotChart.type.js","names":[],"sources":["../../../../src/component/Chart/ScatterPlotChart.type.ts"],"sourcesContent":["import type { Flex } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport type { ScaleLinear, ScaleTime } from 'd3-scale';\n\nimport type { BaseChartProps } from './AbstractChart.type';\nimport type { interpolateValue } from '../../utils';\n\nexport type ScatterPlotChartData = Array<Record<string, number | typeof interpolateValue | Date>>;\n\nexport type ScatterPlotChartProps = Intergalactic.InternalTypings.EfficientOmit<\n BaseChartProps<ScatterPlotChartData>,\n 'showTotalInTooltip'\n> & {\n /** Field name that groups the data points */\n groupKey: string;\n /** Custom x-axis scale */\n xScale?: ScaleLinear<any, any> | ScaleTime<any, any>;\n /** Custom y-axis scale */\n yScale?: ScaleLinear<any, any>;\n /** Optional field name for additional value data */\n valueKey?: string;\n /** Callback triggered when a user clicks on a scatter item */\n onClickScatterItem?: (index: number, event: React.SyntheticEvent) => void;\n};\n\nexport type ScatterPlotChartType = Intergalactic.Component<typeof Flex, ScatterPlotChartProps>;\n"],"mappings":"","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":[]}
@@ -9,10 +9,10 @@ import { makeDataHintsHandlers } from '../../a11y/hints';
9
9
  export var BaseLegend = /*#__PURE__*/function (_Component) {
10
10
  function BaseLegend() {
11
11
  var _this;
12
- _classCallCheck(this, BaseLegend);
13
12
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
14
13
  args[_key] = arguments[_key];
15
14
  }
15
+ _classCallCheck(this, BaseLegend);
16
16
  _this = _callSuper(this, BaseLegend, [].concat(args));
17
17
  _defineProperty(_this, "onChangeLegendItem", function (shape) {
18
18
  return function (id, checked) {
@@ -1 +1 @@
1
- {"version":3,"file":"BaseLegend.js","names":["Component","makeDataHintsHandlers","BaseLegend","_Component","_this","_classCallCheck","_len","arguments","length","args","Array","_key","_callSuper","concat","_defineProperty","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","_inherits","_createClass","key","value","componentDidMount","setHints","componentDidUpdate","prevProps","items","dataHints","_this$asProps","asProps","dataHintsHandler","undefined","forEach","legendItem","labelKey","label","getItem","index","line","Error","getLegendItemProps","_","_this$asProps2","_this$asProps2$shape","_this$asProps2$size","size","patterns","_objectSpread","onFocusLegendItem","onBlurLegendItem","onChangeLegendItem","onMouseEnter","bindOnMouseEnterItem","onMouseLeave","bindOnMouseLeaveItem","style","gridRowStart","gridRowEnd"],"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,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AG,CAAC;QACnES,QAAQ,EAARA;MAAQ;IAEZ;EAAC;AAAA,EAjD6DpE,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"BaseLegend.js","names":["Component","makeDataHintsHandlers","BaseLegend","_Component","_this","_len","arguments","length","args","Array","_key","_classCallCheck","_callSuper","concat","_defineProperty","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","_inherits","_createClass","key","value","componentDidMount","setHints","componentDidUpdate","prevProps","items","dataHints","_this$asProps","asProps","dataHintsHandler","undefined","forEach","legendItem","labelKey","label","getItem","index","line","Error","getLegendItemProps","_","_this$asProps2","_this$asProps2$shape","_this$asProps2$size","size","patterns","_objectSpread","onFocusLegendItem","onBlurLegendItem","onChangeLegendItem","onMouseEnter","bindOnMouseEnterItem","onMouseLeave","bindOnMouseLeaveItem","style","gridRowStart","gridRowEnd"],"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,SAASA,SAAS,QAA4B,eAAe;AAK7D,SAASC,qBAAqB,QAAQ,kBAAkB;AAExD,WAAsBC,UAAU,0BAAAC,UAAA;EAAA,SAAAD,WAAA;IAAA,I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end.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":[]}
@@ -6,19 +6,19 @@ import _inherits from "@babel/runtime/helpers/inherits";
6
6
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
7
  import { sstyled as _sstyled } from "@semcore/core";
8
8
  import { assignProps as _assignProps } from "@semcore/core";
9
+ import { Flex } from '@semcore/base-components';
9
10
  import Checkbox from '@semcore/checkbox';
10
11
  import { createComponent, sstyled, Root } from '@semcore/core';
11
12
  import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
12
13
  import Divider from '@semcore/divider';
13
- import { Flex } from '@semcore/flex-box';
14
14
  import React from 'react';
15
15
  /*!__reshadow-styles__:"./legend-flex.shadow.css"*/
16
- var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SLegendFlex_s6sbj_gg_._direction_row_s6sbj_gg_{align-items:flex-start;align-content:flex-start;flex-wrap:wrap;gap:8px 16px}.___SLegendFlex_s6sbj_gg_._direction_column_s6sbj_gg_{align-items:flex-start;flex-wrap:wrap;gap:8px}", /*__inner_css_end__*/"s6sbj_gg_"),
16
+ var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SLegendFlex_5sqwz_gg_._direction_row_5sqwz_gg_{align-items:flex-start;align-content:flex-start;flex-wrap:wrap;gap:8px 16px}.___SLegendFlex_5sqwz_gg_._direction_column_5sqwz_gg_{align-items:flex-start;flex-wrap:wrap;gap:8px}", /*__inner_css_end__*/"5sqwz_gg_"),
17
17
  /*__reshadow_css_end__*/
18
18
  {
19
- "__SLegendFlex": "___SLegendFlex_s6sbj_gg_",
20
- "_direction_row": "_direction_row_s6sbj_gg_",
21
- "_direction_column": "_direction_column_s6sbj_gg_"
19
+ "__SLegendFlex": "___SLegendFlex_5sqwz_gg_",
20
+ "_direction_row": "_direction_row_5sqwz_gg_",
21
+ "_direction_column": "_direction_column_5sqwz_gg_"
22
22
  });
23
23
  import { localizedMessages } from '../../../translations/__intergalactic-dynamic-locales';
24
24
  import { BaseLegend } from '../BaseLegend';
@@ -1 +1 @@
1
- {"version":3,"file":"LegendFlex.js","names":["Checkbox","createComponent","sstyled","Root","i18nEnhance","Divider","Flex","React","style","_sstyled","insert","localizedMessages","BaseLegend","LegendItemComponent","LegendFlexRoot","_BaseLegend","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","renderTrend","_ref3","asProps","onTrendIsVisibleChange","trendIsVisible","trendLabel","size","getI18nText","createElement","checked","onChange","theme","label","render","_ref","_ref2","SLegendFlex","_this$asProps","styles","Children","direction","withTrend","suffix","items","orientation","cn","_objectSpread","_assignProps","map","_ref4","id","_defineProperty","children","LegendFlex","LegendItem"],"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 </SLegendFlex>,\n );\n }\n}\n\nexport const LegendFlex: LegendFlexType = createComponent(LegendFlexRoot, {\n LegendItem: LegendItemComponent,\n});\n"],"mappings":";;;;;;;;AAAA,OAAOA,QAAQ,MAAM,mBAAmB;AACxC,SAASC,eAAe,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AAC9D,OAAOC,WAAW,MAAM,8CAA8C;AACtE,OAAOC,OAAO,MAAM,kBAAkB;AACtC,SAASC,IAAI,QAAQ,mBAAmB;AACxC,OAAOC,KAAK,MAAM,OAAO;AAAC;AAAA,IAAAC,KAAA,8BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;AAAA;AAI1B,SAASC,iBAAiB,QAAQ,uDAAuD;AACzF,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,mBAAmB,QAAQ,0BAA0B;AAAC,IAEzDC,cAAc,0BAAAC,WAAA;EAAA,SAAAD,eAAA;IAAAE,eAAA,OAAAF,cAAA;IAAA,OAAAG,UAAA,OAAAH,cAAA,EAAAI,SAAA;EAAA;EAAAC,SAAA,CAAAL,cAAA,EAAAC,WAAA;EAAA,OAAAK,YAAA,CAAAN,cAAA;IAAAO,GAAA;IAAAC,KAAA,EAWlB,SAAAC,WAAWA,CAAA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AC,UAAAC,KAAA,EAAY;QAAA,IAATC,EAAE,GAAAD,KAAA,CAAFC,EAAE;QACd,oBAAO9C,KAAA,CAAAwB,aAAA,CAACW,QAAQ;UAACrB,GAAG,EAAEgC;QAAG,CAAE,CAAC;MAC9B,CAAC,CAAC,EACD,CAACT,SAAS,IAAIC,MAAM,kBAAKtC,KAAA,CAAAwB,aAAA,CAAC1B,OAAO,EAAAiC,KAAA,CAAAU,EAAA;QAAA,eAAcD;MAAW,EAAG,CAAC,EAC9DH,SAAS,IAAI,IAAI,CAACrB,WAAW,CAAC,CAAC,EAC/BsB,MAAM,GAAGA,MAAM,GAAG,IACR,CAAC;IAElB;EAAC;AAAA,EAzC0BjC,UAAU;AAAA0C,eAAA,CAAjCxC,cAAc,iBACG,YAAY;AAAAwC,eAAA,CAD7BxC,cAAc,WAEHN,KAAK;AAAA8C,eAAA,CAFhBxC,cAAc,aAID,CAACV,WAAW,CAACO,iBAAiB,CAAC,CAAC;AAAA2C,eAAA,CAJ7CxC,cAAc,kBAMI;EAAA,OAAO;IAC3B6B,SAAS,EAAE,KAAK;IAChBY,QAAQ,eAAEhD,KAAA,CAAAwB,aAAA,CAACyB,UAAU,CAACC,UAAU,MAAE;EACpC,CAAC;AAAA,CAAC;AAmCJ,OAAO,IAAMD,UAA0B,GAAGvD,eAAe,CAACa,cAAc,EAAE;EACxE2C,UAAU,EAAE5C;AACd,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"LegendFlex.js","names":["Flex","Checkbox","createComponent","sstyled","Root","i18nEnhance","Divider","React","style","_sstyled","insert","localizedMessages","BaseLegend","LegendItemComponent","LegendFlexRoot","_BaseLegend","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","renderTrend","_ref3","asProps","onTrendIsVisibleChange","trendIsVisible","trendLabel","size","getI18nText","createElement","checked","onChange","theme","label","render","_ref","_ref2","SLegendFlex","_this$asProps","styles","Children","direction","withTrend","suffix","items","orientation","cn","_objectSpread","_assignProps","map","_ref4","id","_defineProperty","children","LegendFlex","LegendItem"],"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":";;;;;;;;AAAA,SAASA,IAAI,QAAQ,0BAA0B;AAC/C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CAAC;AAAA2C,eAAA,CAJ7CxC,cAAc,kBAMI;EAAA,OAAO;IAC3B6B,SAAS,EAAE,KAAK;IAChBY,QAAQ,eAAEhD,KAAA,CAAAwB,aAAA,CAACyB,UAAU,CAACC,UAAU,MAAE;EACpC,CAAC;AAAA,CAAC;AAmCJ,OAAO,IAAMD,UAAU,GAAGtD,eAAe,CAACY,cAAc,EAAE;EACxD2C,UAAU,EAAE5C;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":[]}
@@ -13,33 +13,33 @@ import { assignProps as _assignProps3 } from "@semcore/core";
13
13
  import { assignProps as _assignProps2 } from "@semcore/core";
14
14
  import { assignProps as _assignProps } from "@semcore/core";
15
15
  var _excluded = ["id", "checked", "color", "onChangeLegendItem", "shape"];
16
+ import { Flex, Box } from '@semcore/base-components';
16
17
  import Checkbox from '@semcore/checkbox';
17
18
  import { createComponent, Component, sstyled, Root } from '@semcore/core';
18
19
  import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
19
20
  import uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';
20
- import { Flex, Box } from '@semcore/flex-box';
21
21
  import { Text as TypographyText } from '@semcore/typography';
22
22
  import React from 'react';
23
23
  /*!__reshadow-styles__:"./legend-item.shadow.css"*/
24
- var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SLegendItem_1onj5_gg_{min-width:0;align-items:flex-start}@media (hover:hover){.___SLegendItem_1onj5_gg_:hover{cursor:pointer}.___SLegendItem_1onj5_gg_.__disabled_1onj5_gg_:hover{cursor:default}}.___SPointShape_1onj5_gg_.__color_1onj5_gg_{background-color:var(--color_1onj5);margin-right:8px;flex-shrink:0}.___SPointShape_1onj5_gg_._shape_Circle_1onj5_gg_._size_l_1onj5_gg_{width:16px;height:16px;border-radius:8px;margin-top:4px}.___SPointShape_1onj5_gg_._shape_Circle_1onj5_gg_._size_m_1onj5_gg_{width:12px;height:12px;border-radius:6px;margin-top:4px}.___SPointShape_1onj5_gg_._shape_Line_1onj5_gg_._size_l_1onj5_gg_{width:16px;height:4px;border-radius:3px;margin-top:9px}.___SPointShape_1onj5_gg_._shape_Line_1onj5_gg_._size_m_1onj5_gg_{width:12px;height:4px;border-radius:3px;margin-top:8px}.___SPointShape_1onj5_gg_._shape_Square_1onj5_gg_._size_l_1onj5_gg_{width:16px;height:16px;border-radius:2px;margin-top:4px}.___SPointShape_1onj5_gg_._shape_Square_1onj5_gg_._size_m_1onj5_gg_{width:12px;height:12px;border-radius:2px;margin-top:4px}.___SPointShape_1onj5_gg_._shape_Pattern_1onj5_gg_{background-color:transparent;margin-right:4px}.___SIcon_1onj5_gg_{line-height:0;margin-right:4px}.___SIcon_1onj5_gg_._size_l_1onj5_gg_{margin-top:4px}.___SIcon_1onj5_gg_._size_m_1onj5_gg_{margin-top:2px}.___SLabel_1onj5_gg_{min-width:0}.___SAdditionalLabel_1onj5_gg_._size_l_1onj5_gg_,.___SCount_1onj5_gg_._size_l_1onj5_gg_,.___SLabel_1onj5_gg_._size_l_1onj5_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SAdditionalLabel_1onj5_gg_._size_m_1onj5_gg_,.___SCount_1onj5_gg_._size_m_1onj5_gg_,.___SLabel_1onj5_gg_._size_m_1onj5_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SAdditionalLabel_1onj5_gg_,.___SCount_1onj5_gg_{margin-left:4px}.___SAdditionalLabel_1onj5_gg_{white-space:nowrap;display:flex;align-items:flex-start}.___SAdditionalLabel_1onj5_gg_::before{content:\"\";display:inline-block;background-color:var(--intergalactic-text-secondary, rgba(0, 3, 0, 0.583));height:4px;width:4px;border-radius:2px;margin-right:4px}@supports (color:color(display-p3 0 0 0%)){.___SAdditionalLabel_1onj5_gg_::before{background-color:var(--intergalactic-text-secondary, rgba(0, 3, 0, 0.583))}@media (color-gamut:p3){.___SAdditionalLabel_1onj5_gg_::before{background-color:var(--intergalactic-text-secondary, color(display-p3 0.00228 0.01289 0.00252 / 0.583))}}}.___SAdditionalLabel_1onj5_gg_._size_l_1onj5_gg_::before{margin-top:10px}.___SAdditionalLabel_1onj5_gg_._size_m_1onj5_gg_::before{margin-top:8px}.___SPatternSymbol_1onj5_gg_{transform:scale(.8)}", /*__inner_css_end__*/"1onj5_gg_"),
24
+ var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SLegendItem_1v96z_gg_{min-width:0;align-items:flex-start}@media (hover:hover){.___SLegendItem_1v96z_gg_:hover{cursor:pointer}.___SLegendItem_1v96z_gg_.__disabled_1v96z_gg_:hover{cursor:default}}.___SPointShape_1v96z_gg_.__color_1v96z_gg_{background-color:var(--color_1v96z);margin-right:8px;flex-shrink:0}.___SPointShape_1v96z_gg_._shape_Circle_1v96z_gg_._size_l_1v96z_gg_{width:16px;height:16px;border-radius:8px;margin-top:4px}.___SPointShape_1v96z_gg_._shape_Circle_1v96z_gg_._size_m_1v96z_gg_{width:12px;height:12px;border-radius:6px;margin-top:4px}.___SPointShape_1v96z_gg_._shape_Line_1v96z_gg_._size_l_1v96z_gg_{width:16px;height:4px;border-radius:3px;margin-top:9px}.___SPointShape_1v96z_gg_._shape_Line_1v96z_gg_._size_m_1v96z_gg_{width:12px;height:4px;border-radius:3px;margin-top:8px}.___SPointShape_1v96z_gg_._shape_Square_1v96z_gg_._size_l_1v96z_gg_{width:16px;height:16px;border-radius:2px;margin-top:4px}.___SPointShape_1v96z_gg_._shape_Square_1v96z_gg_._size_m_1v96z_gg_{width:12px;height:12px;border-radius:2px;margin-top:4px}.___SPointShape_1v96z_gg_._shape_Pattern_1v96z_gg_{background-color:transparent;margin-right:4px}.___SIcon_1v96z_gg_{line-height:0;margin-right:4px}.___SIcon_1v96z_gg_._size_l_1v96z_gg_{margin-top:4px}.___SIcon_1v96z_gg_._size_m_1v96z_gg_{margin-top:2px}.___SLabel_1v96z_gg_{min-width:0}.___SAdditionalLabel_1v96z_gg_._size_l_1v96z_gg_,.___SCount_1v96z_gg_._size_l_1v96z_gg_,.___SLabel_1v96z_gg_._size_l_1v96z_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SAdditionalLabel_1v96z_gg_._size_m_1v96z_gg_,.___SCount_1v96z_gg_._size_m_1v96z_gg_,.___SLabel_1v96z_gg_._size_m_1v96z_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SAdditionalLabel_1v96z_gg_,.___SCount_1v96z_gg_{margin-left:4px}.___SAdditionalLabel_1v96z_gg_{white-space:nowrap;display:flex;align-items:flex-start}.___SAdditionalLabel_1v96z_gg_::before{content:\"\";display:inline-block;background-color:var(--intergalactic-text-secondary, rgba(0, 3, 0, 0.583));height:4px;width:4px;border-radius:2px;margin-right:4px}@supports (color:color(display-p3 0 0 0%)){.___SAdditionalLabel_1v96z_gg_::before{background-color:var(--intergalactic-text-secondary, rgba(0, 3, 0, 0.583))}@media (color-gamut:p3){.___SAdditionalLabel_1v96z_gg_::before{background-color:var(--intergalactic-text-secondary, color(display-p3 0.00228 0.01289 0.00252 / 0.583))}}}.___SAdditionalLabel_1v96z_gg_._size_l_1v96z_gg_::before{margin-top:10px}.___SAdditionalLabel_1v96z_gg_._size_m_1v96z_gg_::before{margin-top:8px}.___SPatternSymbol_1v96z_gg_{transform:scale(.8)}", /*__inner_css_end__*/"1v96z_gg_"),
25
25
  /*__reshadow_css_end__*/
26
26
  {
27
- "__SLegendItem": "___SLegendItem_1onj5_gg_",
28
- "_disabled": "__disabled_1onj5_gg_",
29
- "__SPointShape": "___SPointShape_1onj5_gg_",
30
- "_color": "__color_1onj5_gg_",
31
- "--color": "--color_1onj5",
32
- "_shape_Circle": "_shape_Circle_1onj5_gg_",
33
- "_size_l": "_size_l_1onj5_gg_",
34
- "_size_m": "_size_m_1onj5_gg_",
35
- "_shape_Line": "_shape_Line_1onj5_gg_",
36
- "_shape_Square": "_shape_Square_1onj5_gg_",
37
- "_shape_Pattern": "_shape_Pattern_1onj5_gg_",
38
- "__SIcon": "___SIcon_1onj5_gg_",
39
- "__SLabel": "___SLabel_1onj5_gg_",
40
- "__SAdditionalLabel": "___SAdditionalLabel_1onj5_gg_",
41
- "__SCount": "___SCount_1onj5_gg_",
42
- "__SPatternSymbol": "___SPatternSymbol_1onj5_gg_"
27
+ "__SLegendItem": "___SLegendItem_1v96z_gg_",
28
+ "_disabled": "__disabled_1v96z_gg_",
29
+ "__SPointShape": "___SPointShape_1v96z_gg_",
30
+ "_color": "__color_1v96z_gg_",
31
+ "--color": "--color_1v96z",
32
+ "_shape_Circle": "_shape_Circle_1v96z_gg_",
33
+ "_size_l": "_size_l_1v96z_gg_",
34
+ "_size_m": "_size_m_1v96z_gg_",
35
+ "_shape_Line": "_shape_Line_1v96z_gg_",
36
+ "_shape_Square": "_shape_Square_1v96z_gg_",
37
+ "_shape_Pattern": "_shape_Pattern_1v96z_gg_",
38
+ "__SIcon": "___SIcon_1v96z_gg_",
39
+ "__SLabel": "___SLabel_1v96z_gg_",
40
+ "__SAdditionalLabel": "___SAdditionalLabel_1v96z_gg_",
41
+ "__SCount": "___SCount_1v96z_gg_",
42
+ "__SPatternSymbol": "___SPatternSymbol_1v96z_gg_"
43
43
  });
44
44
  import { StaticShapes } from './LegendItem.type';
45
45
  import { PatternSymbol } from '../../../Pattern';
@@ -1 +1 @@
1
- {"version":3,"file":"LegendItem.js","names":["Checkbox","createComponent","Component","sstyled","Root","resolveColorEnhance","uniqueIDEnhancement","Flex","Box","Text","TypographyText","React","style","_sstyled","insert","StaticShapes","PatternSymbol","getChartDefaultColorName","enhance","LegendItemRoot","_Component","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","getUniqueID","uid","asProps","concat","getShapeProps","_this$asProps","checked","color","shape","label","id","size","resolveColor","patterns","onChangeLegendItem","onFocusLegendItem","onBlurLegendItem","onChange","onFocus","onBlur","getIconProps","props","_objectSpread","children","icon","onClick","getLabelProps","_this$asProps2","_color","_shape","_objectWithoutProperties","_excluded","getAdditionalLabelProps","additionalInfo","undefined","getCountProps","count","render","_ref","_ref7","SLegendItem","_this$asProps3","styles","Children","disabled","includes","createElement","cn","_assignProps","_defineProperty","Fragment","LegendItemComponent","Shape","Icon","Label","AdditionalLabel","Count","_ref2","arguments[0]","_ref0","SPointShape","SPatternSymbol","_props$patternKey","patternKey","hasChildren","_ref8","_ref9","_assignProps2","_ref13","_ref3","_ref1","SIcon","_assignProps3","displayName","_ref14","_ref4","_ref10","SLabel","_assignProps4","_ref15","_ref5","_ref11","SAdditionalLabel","_assignProps5","_ref16","_ref6","_ref12","SCount","_assignProps6"],"sources":["../../../../../src/component/ChartLegend/LegendItem/LegendItem.tsx"],"sourcesContent":["import Checkbox from '@semcore/checkbox';\nimport { createComponent, Component, sstyled, Root, type IRootComponentProps } from '@semcore/core';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport { Flex, Box } from '@semcore/flex-box';\nimport { Text as TypographyText } from '@semcore/typography';\nimport type { DOMAttributes } from 'react';\nimport React from 'react';\n\nimport style from './legend-item.shadow.css';\nimport {\n type ShapeProps,\n type LegendItemProps,\n type LegendItemType,\n type LegendItem,\n StaticShapes,\n} from './LegendItem.type';\nimport { PatternSymbol } from '../../../Pattern';\nimport { getChartDefaultColorName } from '../../../utils';\n\nconst enhance = [resolveColorEnhance(), uniqueIDEnhancement()] as const;\nclass LegendItemRoot extends Component<LegendItemProps, {}, {}, typeof enhance> {\n static displayName = 'LegendItem';\n static style = style;\n\n static enhance = enhance;\n\n static defaultProps = () => ({\n children: (\n <>\n <LegendItemComponent.Shape />\n <LegendItemComponent.Icon />\n <LegendItemComponent.Label />\n <LegendItemComponent.AdditionalLabel />\n <LegendItemComponent.Count />\n </>\n ),\n });\n\n getUniqueID() {\n const { uid } = this.asProps;\n return `chart-legend-item-${uid}`;\n }\n\n getShapeProps() {\n const { checked, color, shape, label, id, size, resolveColor, patterns, onChangeLegendItem, onFocusLegendItem, onBlurLegendItem } =\n this.asProps;\n return {\n label,\n shape,\n checked,\n 'color': resolveColor(color),\n 'patternKey': color,\n patterns,\n size,\n 'onChange': (value: boolean) => {\n onChangeLegendItem(id, value);\n },\n 'onFocus': () => onFocusLegendItem(id),\n 'onBlur': () => onBlurLegendItem(id),\n 'aria-labelledby': shape === 'Checkbox' ? this.getUniqueID() : null,\n };\n }\n\n getIconProps(): LegendItem & IRootComponentProps & { onClick: () => void } {\n const props = this.asProps;\n\n return {\n ...props,\n children: props.icon,\n onClick: () => props.onChangeLegendItem(props.id, !props.checked),\n };\n }\n\n getLabelProps(): Omit<LegendItem, 'color'> & IRootComponentProps & { onClick: () => void } {\n const { id, checked, color: _color, onChangeLegendItem, shape: _shape, ...props } = this.asProps;\n\n return {\n ...props,\n id: this.getUniqueID(),\n checked,\n onClick: () => onChangeLegendItem(id, !checked),\n children: props.label,\n };\n }\n\n getAdditionalLabelProps(): LegendItem & IRootComponentProps & { onClick: () => void } {\n const props = this.asProps;\n\n const { additionalInfo, onChangeLegendItem, id, checked } = props;\n\n return {\n ...props,\n children: additionalInfo && 'label' in additionalInfo ? `${additionalInfo.label}` : undefined,\n onClick: () => onChangeLegendItem(id, !checked),\n };\n }\n\n getCountProps(): LegendItem & IRootComponentProps & { onClick: () => void } {\n const props = this.asProps;\n\n const { additionalInfo, onChangeLegendItem, id, checked } = props;\n\n return {\n ...props,\n children:\n additionalInfo && 'count' in additionalInfo ? `(${additionalInfo.count})` : undefined,\n onClick: () => onChangeLegendItem(id, !checked),\n };\n }\n\n render() {\n const SLegendItem = Root;\n const { styles, Children, shape } = this.asProps;\n\n // @ts-ignore\n const disabled = StaticShapes.includes(shape) || shape === undefined;\n\n return sstyled(styles)(\n <SLegendItem render={Flex} disabled={disabled} __excludeProps={['id']}>\n <Children />\n </SLegendItem>,\n );\n }\n}\n\nfunction Shape(props: IRootComponentProps & ShapeProps & DOMAttributes<HTMLLabelElement>) {\n const SPointShape = Root;\n const SPatternSymbol = PatternSymbol;\n const {\n styles,\n size,\n shape,\n checked,\n color,\n patternKey = getChartDefaultColorName(0),\n Children,\n children: hasChildren,\n patterns,\n onChange,\n onFocus,\n onBlur,\n } = props;\n\n if (hasChildren) {\n return <Children />;\n }\n\n if (shape === 'Pattern') {\n return sstyled(styles)(\n <Box mr={1}>\n <SPatternSymbol color={color} patternKey={patternKey} aria-hidden />\n </Box>,\n );\n }\n\n if (shape === 'Checkbox') {\n return sstyled(styles)(\n <>\n <Checkbox\n size={size}\n checked={checked}\n theme={color}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n aria-labelledby={props['aria-labelledby']}\n />\n {patterns && (\n <Box mt='2px' mr={1} onClick={() => onChange(!checked)}>\n <SPatternSymbol color={color} patternKey={patternKey} aria-hidden />\n </Box>\n )}\n </>,\n );\n }\n\n return sstyled(styles)(\n <SPointShape render={Box}>\n <Children />\n </SPointShape>,\n );\n}\n\nfunction Icon({ styles, children: hasChildren, Children }: IRootComponentProps) {\n const SIcon = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SIcon render={Box} tag='span'>\n <Children />\n </SIcon>,\n );\n}\nIcon.displayName = 'Icon';\n\nfunction Label({ styles, children: hasChildren, Children }: IRootComponentProps) {\n const SLabel = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SLabel render={TypographyText} use='primary'>\n <Children />\n </SLabel>,\n );\n}\nLabel.displayName = 'Label';\n\nfunction AdditionalLabel({ styles, children: hasChildren, Children }: IRootComponentProps) {\n const SAdditionalLabel = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SAdditionalLabel render={TypographyText} use='secondary'>\n <Children />\n </SAdditionalLabel>,\n );\n}\nAdditionalLabel.displayName = 'AdditionalLabel';\n\nfunction Count({ styles, children: hasChildren, Children }: IRootComponentProps) {\n const SCount = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SCount render={TypographyText} use='secondary'>\n <Children />\n </SCount>,\n );\n}\nCount.displayName = 'Count';\n\nexport const LegendItemComponent: LegendItemType = createComponent(LegendItemRoot, {\n Shape,\n Icon,\n Label,\n AdditionalLabel,\n Count,\n});\n"],"mappings":";;;;;;;;;;;;;;;AAAA,OAAOA,QAAQ,MAAM,mBAAmB;AACxC,SAASC,eAAe,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAkC,eAAe;AACnG,OAAOC,mBAAmB,MAAM,sDAAsD;AACtF,OAAOC,mBAAmB,MAAM,kCAAkC;AAClE,SAASC,IAAI,EAAEC,GAAG,QAAQ,mBAAmB;AAC7C,SAASC,IAAI,IAAIC,cAAc,QAAQ,qBAAqB;AAE5D,OAAOC,KAAK,MAAM,OAAO;AAAC;AAAA,IAAAC,KAAA,8BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAG1B,SAKEC,YAAY,QACP,mBAAmB;AAC1B,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,wBAAwB,QAAQ,gBAAgB;AAEzD,IAAMC,OAAO,GAAG,CAACb,mBAAmB,CAAC,CAAC,EAAEC,mBAAmB,CAAC,CAAC,CAAU;AAAC,IAClEa,cAAc,0BAAAC,UAAA;EAAA,SAAAD,eAAA;IAAAE,eAAA,OAAAF,cAAA;IAAA,OAAAG,UAAA,OAAAH,cAAA,EAAAI,SAAA;EAAA;EAAAC,SAAA,CAAAL,cAAA,EAAAC,UAAA;EAAA,OAAAK,YAAA,CAAAN,cAAA;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Root","resolveColorEnhance","uniqueIDEnhancement","Text","TypographyText","React","style","_sstyled","insert","StaticShapes","PatternSymbol","getChartDefaultColorName","enhance","LegendItemRoot","_Component","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","getUniqueID","uid","asProps","concat","getShapeProps","_this$asProps","checked","color","shape","label","id","size","resolveColor","patterns","onChangeLegendItem","onFocusLegendItem","onBlurLegendItem","onChange","onFocus","onBlur","getIconProps","props","_objectSpread","children","icon","onClick","getLabelProps","_this$asProps2","_color","_shape","_objectWithoutProperties","_excluded","getAdditionalLabelProps","additionalInfo","undefined","getCountProps","count","render","_ref","_ref7","SLegendItem","_this$asProps3","styles","Children","disabled","includes","createElement","cn","_assignProps","_defineProperty","Fragment","LegendItemComponent","Shape","Icon","Label","AdditionalLabel","Count","_ref2","arguments[0]","_ref0","SPointShape","SPatternSymbol","_props$patternKey","patternKey","hasChildren","_ref8","_ref9","_assignProps2","_ref13","_ref3","_ref1","SIcon","_assignProps3","displayName","_ref14","_ref4","_ref10","SLabel","_assignProps4","_ref15","_ref5","_ref11","SAdditionalLabel","_assignProps5","_ref16","_ref6","_ref12","SCount","_assignProps6"],"sources":["../../../../../src/component/ChartLegend/LegendItem/LegendItem.tsx"],"sourcesContent":["import { Flex, Box } from '@semcore/base-components';\nimport Checkbox from '@semcore/checkbox';\nimport { createComponent, Component, sstyled, Root, type IRootComponentProps } from '@semcore/core';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport { Text as TypographyText } from '@semcore/typography';\nimport type { DOMAttributes } from 'react';\nimport React from 'react';\n\nimport style from './legend-item.shadow.css';\nimport {\n type ShapeProps,\n type LegendItemProps,\n type LegendItemType,\n type LegendItem,\n StaticShapes,\n} from './LegendItem.type';\nimport { PatternSymbol } from '../../../Pattern';\nimport { getChartDefaultColorName } from '../../../utils';\n\nconst enhance = [resolveColorEnhance(), uniqueIDEnhancement()] as const;\nclass LegendItemRoot extends Component<LegendItemProps, typeof enhance> {\n static displayName = 'LegendItem';\n static style = style;\n\n static enhance = enhance;\n\n static defaultProps = () => ({\n children: (\n <>\n <LegendItemComponent.Shape />\n <LegendItemComponent.Icon />\n <LegendItemComponent.Label />\n <LegendItemComponent.AdditionalLabel />\n <LegendItemComponent.Count />\n </>\n ),\n });\n\n getUniqueID() {\n const { uid } = this.asProps;\n return `chart-legend-item-${uid}`;\n }\n\n getShapeProps() {\n const { checked, color, shape, label, id, size, resolveColor, patterns, onChangeLegendItem, onFocusLegendItem, onBlurLegendItem } =\n this.asProps;\n return {\n label,\n shape,\n checked,\n 'color': resolveColor(color),\n 'patternKey': color,\n patterns,\n size,\n 'onChange': (value: boolean) => {\n onChangeLegendItem(id, value);\n },\n 'onFocus': () => onFocusLegendItem(id),\n 'onBlur': () => onBlurLegendItem(id),\n 'aria-labelledby': shape === 'Checkbox' ? this.getUniqueID() : null,\n };\n }\n\n getIconProps(): LegendItem & IRootComponentProps & { onClick: () => void } {\n const props = this.asProps;\n\n return {\n ...props,\n children: props.icon,\n onClick: () => props.onChangeLegendItem(props.id, !props.checked),\n };\n }\n\n getLabelProps(): Omit<LegendItem, 'color'> & IRootComponentProps & { onClick: () => void } {\n const { id, checked, color: _color, onChangeLegendItem, shape: _shape, ...props } = this.asProps;\n\n return {\n ...props,\n id: this.getUniqueID(),\n checked,\n onClick: () => onChangeLegendItem(id, !checked),\n children: props.label,\n };\n }\n\n getAdditionalLabelProps(): LegendItem & IRootComponentProps & { onClick: () => void } {\n const props = this.asProps;\n\n const { additionalInfo, onChangeLegendItem, id, checked } = props;\n\n return {\n ...props,\n children: additionalInfo && 'label' in additionalInfo ? `${additionalInfo.label}` : undefined,\n onClick: () => onChangeLegendItem(id, !checked),\n };\n }\n\n getCountProps(): LegendItem & IRootComponentProps & { onClick: () => void } {\n const props = this.asProps;\n\n const { additionalInfo, onChangeLegendItem, id, checked } = props;\n\n return {\n ...props,\n children:\n additionalInfo && 'count' in additionalInfo ? `(${additionalInfo.count})` : undefined,\n onClick: () => onChangeLegendItem(id, !checked),\n };\n }\n\n render() {\n const SLegendItem = Root;\n const { styles, Children, shape } = this.asProps;\n\n // @ts-ignore\n const disabled = StaticShapes.includes(shape) || shape === undefined;\n\n return sstyled(styles)(\n <SLegendItem render={Flex} disabled={disabled} __excludeProps={['id']}>\n <Children />\n </SLegendItem>,\n );\n }\n}\n\nfunction Shape(props: IRootComponentProps & ShapeProps & DOMAttributes<HTMLLabelElement>) {\n const SPointShape = Root;\n const SPatternSymbol = PatternSymbol;\n const {\n styles,\n size,\n shape,\n checked,\n color,\n patternKey = getChartDefaultColorName(0),\n Children,\n children: hasChildren,\n patterns,\n onChange,\n onFocus,\n onBlur,\n } = props;\n\n if (hasChildren) {\n return <Children />;\n }\n\n if (shape === 'Pattern') {\n return sstyled(styles)(\n <Box mr={1}>\n <SPatternSymbol color={color} patternKey={patternKey} aria-hidden />\n </Box>,\n );\n }\n\n if (shape === 'Checkbox') {\n return sstyled(styles)(\n <>\n <Checkbox\n size={size}\n checked={checked}\n theme={color}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n aria-labelledby={props['aria-labelledby']}\n />\n {patterns && (\n <Box mt='2px' mr={1} onClick={() => onChange(!checked)}>\n <SPatternSymbol color={color} patternKey={patternKey} aria-hidden />\n </Box>\n )}\n </>,\n );\n }\n\n return sstyled(styles)(\n <SPointShape render={Box}>\n <Children />\n </SPointShape>,\n );\n}\n\nfunction Icon({ styles, children: hasChildren, Children }: IRootComponentProps) {\n const SIcon = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SIcon render={Box} tag='span'>\n <Children />\n </SIcon>,\n );\n}\nIcon.displayName = 'Icon';\n\nfunction Label({ styles, children: hasChildren, Children }: IRootComponentProps) {\n const SLabel = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SLabel render={TypographyText} use='primary'>\n <Children />\n </SLabel>,\n );\n}\nLabel.displayName = 'Label';\n\nfunction AdditionalLabel({ styles, children: hasChildren, Children }: IRootComponentProps) {\n const SAdditionalLabel = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SAdditionalLabel render={TypographyText} use='secondary'>\n <Children />\n </SAdditionalLabel>,\n );\n}\nAdditionalLabel.displayName = 'AdditionalLabel';\n\nfunction Count({ styles, children: hasChildren, Children }: IRootComponentProps) {\n const SCount = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SCount render={TypographyText} use='secondary'>\n <Children />\n </SCount>,\n );\n}\nCount.displayName = 'Count';\n\nexport const LegendItemComponent = createComponent(LegendItemRoot, {\n Shape,\n Icon,\n Label,\n AdditionalLabel,\n Count,\n}) as LegendItemType;\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAASA,IAAI,EAAEC,GAAG,QAAQ,0BAA0B;AACpD,OAAOC,QAAQ,MAAM,mBAAmB;AACxC,SAASC,eAAe,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAkC,eAAe;AACnG,OAAOC,mBAAmB,MAAM,sDAAsD;AACtF,OAAOC,mBAAmB,MAAM,kCAAkC;AAClE,SAASC,IAAI,IAAIC,cAAc,QAAQ,qBAAqB;AAE5D,OAAOC,KAAK,MAAM,OAAO;AAAC;AAAA,IAAAC,KAAA,8BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAG1B,SAKEC,YAAY,QACP,mBAAmB;AAC1B,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,wBAAwB,QAAQ,gBAAgB;AAEzD,IAAMC,OAAO,GAAG,CAACX,mBAAmB,CAAC,CAAC,EAAEC,mBAAmB,CAAC,CAAC,CAAU;AAAC,IAClEW,cAAc,0BAAAC,UAAA;EAAA,SAAAD,eAAA;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AAK,EAALA,KAAK;EACLC,eAAe,EAAfA,eAAe;EACfC,KAAK,EAALA;AACF,CAAC,CAAmB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"LegendItem.type.js","names":["StaticShapes"],"sources":["../../../../../src/component/ChartLegend/LegendItem/LegendItem.type.ts"],"sourcesContent":["import type { Intergalactic, Root } from '@semcore/core';\nimport type { Flex } from '@semcore/flex-box';\nimport type Icon from '@semcore/icon';\nimport type { Text } from '@semcore/typography';\n\nimport type { PatternsConfig } from '../../../Pattern';\nimport type { LSize } from '../BaseLegend.type';\n\n/**\n * Key of chart data item\n */\nexport type LegendItemKey = string;\n\nexport type LegendItem = {\n /**\n * One of keys from data set\n */\n id: LegendItemKey;\n /**\n * Label for data item in Legend\n */\n label: string;\n /**\n * Flag for selected data item\n */\n checked: boolean;\n /**\n * Color of data item\n */\n color: string;\n /**\n * Icon before label\n */\n icon?: typeof Icon;\n /**\n * Additional info with sub-label or count\n */\n additionalInfo?: { label: string } | { count: number };\n\n patternKey?: string;\n\n /** Enables patterns symbols that enhances charts accessibility */\n patterns?: PatternsConfig;\n};\n\nexport type LegendItemProps = LegendItem & {\n /**\n * Size for legend item\n */\n size: LSize;\n /**\n * Shape of data item on Legend panel\n */\n shape: ShapeType;\n /**\n * Handler for select/deselect legend item.\n * !Need to redefine onClick, because we don't have `event` in it.\n * @deprecated\n */\n onClick?: () => void;\n\n /** Enables patterns symbols that enhances charts accessibility */\n patterns?: PatternsConfig;\n\n /**\n * Handler for select/deselect legend item\n */\n onChangeLegendItem: (id: LegendItemKey, checked: boolean) => void;\n\n /**\n * Handler for focus legend item\n */\n onFocusLegendItem: (id: LegendItemKey) => void;\n\n /**\n * Handler for focus out legend item\n */\n onBlurLegendItem: (id: LegendItemKey) => void;\n};\n\nexport type ShapeProps = LegendItem &\n (\n | {\n size: LSize;\n shape: Exclude<ShapeType, 'Checkbox'>;\n }\n | {\n 'size': LSize;\n 'shape': Extract<ShapeType, 'Checkbox'>;\n 'onChange': (checked: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => void;\n 'aria-labelledby'?: string;\n }\n );\n\nexport const StaticShapes = ['Circle', 'Line', 'Square', 'Pattern'] as const;\n\nexport type ShapeType = 'Checkbox' | typeof StaticShapes[number];\n\nexport type LegendItemType = Intergalactic.Component<typeof Flex, Partial<LegendItemProps>> & {\n Shape: Intergalactic.Component<typeof Root, Partial<ShapeProps>>;\n Icon: Intergalactic.Component<typeof Icon, Partial<LegendItem>>;\n Label: Intergalactic.Component<typeof Text, Partial<Omit<LegendItem, 'theme'>>>;\n AdditionalLabel: Intergalactic.Component<typeof Text, Partial<LegendItem>>;\n Count: Intergalactic.Component<typeof Text, Partial<LegendItem>>;\n};\n"],"mappings":"AAQA;AACA;AACA;;AAoFA,OAAO,IAAMA,YAAY,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAU","ignoreList":[]}
1
+ {"version":3,"file":"LegendItem.type.js","names":["StaticShapes"],"sources":["../../../../../src/component/ChartLegend/LegendItem/LegendItem.type.ts"],"sourcesContent":["import type { Flex } from '@semcore/base-components';\nimport type { Intergalactic, Root } from '@semcore/core';\nimport type Icon from '@semcore/icon';\nimport type { Text } from '@semcore/typography';\n\nimport type { PatternsConfig } from '../../../Pattern';\nimport type { LSize } from '../BaseLegend.type';\n\n/**\n * Key of chart data item\n */\nexport type LegendItemKey = string;\n\nexport type LegendItem = {\n /**\n * One of keys from data set\n */\n id: LegendItemKey;\n /**\n * Label for data item in Legend\n */\n label: string;\n /**\n * Flag for selected data item\n */\n checked: boolean;\n /**\n * Color of data item\n */\n color: string;\n /**\n * Icon before label\n */\n icon?: typeof Icon;\n /**\n * Additional info with sub-label or count\n */\n additionalInfo?: { label: string } | { count: number };\n\n patternKey?: string;\n\n /** Enables patterns symbols that enhances charts accessibility */\n patterns?: PatternsConfig;\n};\n\nexport type LegendItemProps = LegendItem & {\n /**\n * Size for legend item\n */\n size: LSize;\n /**\n * Shape of data item on Legend panel\n */\n shape: ShapeType;\n /**\n * Handler for select/deselect legend item.\n * !Need to redefine onClick, because we don't have `event` in it.\n * @deprecated\n */\n onClick?: () => void;\n\n /** Enables patterns symbols that enhances charts accessibility */\n patterns?: PatternsConfig;\n\n /**\n * Handler for select/deselect legend item\n */\n onChangeLegendItem: (id: LegendItemKey, checked: boolean) => void;\n\n /**\n * Handler for focus legend item\n */\n onFocusLegendItem: (id: LegendItemKey) => void;\n\n /**\n * Handler for focus out legend item\n */\n onBlurLegendItem: (id: LegendItemKey) => void;\n};\n\nexport type ShapeProps = LegendItem &\n (\n | {\n size: LSize;\n shape: Exclude<ShapeType, 'Checkbox'>;\n }\n | {\n 'size': LSize;\n 'shape': Extract<ShapeType, 'Checkbox'>;\n 'onChange': (checked: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => void;\n 'aria-labelledby'?: string;\n }\n );\n\nexport const StaticShapes = ['Circle', 'Line', 'Square', 'Pattern'] as const;\n\nexport type ShapeType = 'Checkbox' | typeof StaticShapes[number];\n\nexport type LegendItemType = Intergalactic.Component<typeof Flex, Partial<LegendItemProps>> & {\n Shape: Intergalactic.Component<typeof Root, Partial<ShapeProps>>;\n Icon: Intergalactic.Component<typeof Icon, Partial<LegendItem>>;\n Label: Intergalactic.Component<typeof Text, Partial<Omit<LegendItem, 'theme'>>>;\n AdditionalLabel: Intergalactic.Component<typeof Text, Partial<LegendItem>>;\n Count: Intergalactic.Component<typeof Text, Partial<LegendItem>>;\n};\n"],"mappings":"AAQA;AACA;AACA;;AAoFA,OAAO,IAAMA,YAAY,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAU","ignoreList":[]}
@@ -7,18 +7,18 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
7
  import { sstyled as _sstyled } from "@semcore/core";
8
8
  import { assignProps as _assignProps2 } from "@semcore/core";
9
9
  import { assignProps as _assignProps } from "@semcore/core";
10
+ import { Box } from '@semcore/base-components';
10
11
  import { createComponent, sstyled, Root } from '@semcore/core';
11
- import { Box } from '@semcore/flex-box';
12
12
  import React from 'react';
13
13
  /*!__reshadow-styles__:"./legend-table.shadow.css"*/
14
- var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SLegendTable_p31b3_gg_.__columns-count_p31b3_gg_{font-feature-settings:\"tnum\";font-variant-numeric:tabular-nums;display:grid;grid-template-columns:auto .2fr;align-items:center;height:-moz-fit-content;height:fit-content;grid-column-gap:16px;grid-row-gap:8px}.___SColumnItem_p31b3_gg_._size_l_p31b3_gg_{font-size:var(--intergalactic-fs-300, 16px);text-align:right}.___SColumnItem_p31b3_gg_._size_m_p31b3_gg_{font-size:var(--intergalactic-fs-200, 14px);text-align:right}", /*__inner_css_end__*/"p31b3_gg_"),
14
+ var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SLegendTable_9jglg_gg_.__columns-count_9jglg_gg_{font-feature-settings:\"tnum\";font-variant-numeric:tabular-nums;display:grid;grid-template-columns:auto .2fr;align-items:center;height:-moz-fit-content;height:fit-content;grid-column-gap:16px;grid-row-gap:8px}.___SColumnItem_9jglg_gg_._size_l_9jglg_gg_{font-size:var(--intergalactic-fs-300, 16px);text-align:right}.___SColumnItem_9jglg_gg_._size_m_9jglg_gg_{font-size:var(--intergalactic-fs-200, 14px);text-align:right}", /*__inner_css_end__*/"9jglg_gg_"),
15
15
  /*__reshadow_css_end__*/
16
16
  {
17
- "__SLegendTable": "___SLegendTable_p31b3_gg_",
18
- "_columns-count": "__columns-count_p31b3_gg_",
19
- "__SColumnItem": "___SColumnItem_p31b3_gg_",
20
- "_size_l": "_size_l_p31b3_gg_",
21
- "_size_m": "_size_m_p31b3_gg_"
17
+ "__SLegendTable": "___SLegendTable_9jglg_gg_",
18
+ "_columns-count": "__columns-count_9jglg_gg_",
19
+ "__SColumnItem": "___SColumnItem_9jglg_gg_",
20
+ "_size_l": "_size_l_9jglg_gg_",
21
+ "_size_m": "_size_m_9jglg_gg_"
22
22
  });
23
23
  import { BaseLegend } from '../BaseLegend';
24
24
  import { LegendItemComponent } from '../LegendItem/LegendItem';
@@ -1 +1 @@
1
- {"version":3,"file":"LegendTable.js","names":["createComponent","sstyled","Root","Box","React","style","_sstyled","insert","BaseLegend","LegendItemComponent","LegendTableRoot","_BaseLegend","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","render","_ref","asProps","_ref3","_items$","SLegendTable","_this$asProps","styles","Children","_this$asProps$size","size","items","columnsCount","columns","length","createElement","cn","_objectSpread","_assignProps","map","_ref5","_index","id","_ref5$columns","Fragment","item","index","concat","LegendTable","Column","_defineProperty","children","LegendItem","ColumnComponent","props","_ref2","arguments[0]","_ref4","SColumnItem","_assignProps2","gridColumnStart","gridColumnEnd"],"sources":["../../../../../src/component/ChartLegend/LegendTable/LegendTable.tsx"],"sourcesContent":["import { createComponent, sstyled, Root, type IRootComponentProps } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport React from 'react';\n\nimport style from './legend-table.shadow.css';\nimport type { LegendTableType, LegendTableProps, LegendColumnProps } from './LegendTable.type';\nimport { BaseLegend } from '../BaseLegend';\nimport { LegendItemComponent } from '../LegendItem/LegendItem';\n\nclass LegendTableRoot extends BaseLegend<LegendTableProps> {\n static displayName = 'LegendTable';\n static style = style;\n\n static defaultProps = () => ({\n children: <LegendTable.LegendItem />,\n });\n\n render() {\n const SLegendTable = Root;\n const { styles, Children, size = 'm', items } = this.asProps;\n const columnsCount = items[0]?.columns.length;\n\n return sstyled(styles)(\n <SLegendTable render={Box} columns-count={columnsCount + 1} role='group'>\n {items.map(({ id, columns = [] }, _index) => {\n return (\n <React.Fragment key={id}>\n <Children />\n {columns.map((item, index) => {\n return (\n <React.Fragment key={`${id}__${index}`}>\n <LegendTable.Column index={index} size={size} styles={styles}>\n {item}\n </LegendTable.Column>\n </React.Fragment>\n );\n })}\n </React.Fragment>\n );\n })}\n </SLegendTable>,\n );\n }\n}\n\nfunction ColumnComponent(props: LegendColumnProps & IRootComponentProps) {\n const SColumnItem = Root;\n const { styles, index, size, Children } = props;\n\n return sstyled(styles)(\n <SColumnItem\n style={{ gridColumnStart: `${index + 2}`, gridColumnEnd: `${index + 3}` }}\n render={Box}\n size={size}\n >\n <Children />\n </SColumnItem>,\n );\n}\n\nexport const LegendTable: LegendTableType = createComponent(LegendTableRoot, {\n LegendItem: LegendItemComponent,\n Column: ColumnComponent,\n});\n"],"mappings":";;;;;;;;;AAAA,SAASA,eAAe,EAAEC,OAAO,EAAEC,IAAI,QAAkC,eAAe;AACxF,SAASC,GAAG,QAAQ,mBAAmB;AACvC,OAAOC,KAAK,MAAM,OAAO;AAAC;AAAA,IAAAC,KAAA,8BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAI1B,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,mBAAmB,QAAQ,0BAA0B;AAAC,IAEzDC,eAAe,0BAAAC,WAAA;EAAA,SAAAD,gBAAA;IAAAE,eAAA,OAAAF,eAAA;IAAA,OAAAG,UAAA,OAAAH,eAAA,EAAAI,SAAA;EAAA;EAAAC,SAAA,CAAAL,eAAA,EAAAC,WAAA;EAAA,OAAAK,YAAA,CAAAN,eAAA;IAAAO,GAAA;IAAAC,KAAA,EAQnB,SAAAC,MAAMA,CAAA,EAAG;MAAA,IAAAC,IAAA,QAAAC,OAAA;QAAAC,KAAA;QAAAC,OAAA;MACP,IAAMC,YAAY,GAKMrB,GAAG;MAJ3B,IAAAsB,aAAA,GAAgD,IAAI,CAACJ,OAAO;QAApDK,MAAM,GAAAD,aAAA,CAANC,MAAM;QAAEC,QAAQ,GAAAF,aAAA,CAARE,QAAQ;QAAAC,kBAAA,GAAAH,aAAA,CAAEI,IAAI;QAAJA,IAAI,GAAAD,kBAAA,cAAG,GAAG,GAAAA,kBAAA;QAAEE,KAAK,GAAAL,aAAA,CAALK,KAAK;MAC3C,IAAMC,YAAY,I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OAAO;IAC3BwC,QAAQ,eAAE9C,KAAA,CAAA8B,aAAA,CAACa,WAAW,CAACI,UAAU,MAAE;EACrC,CAAC;AAAA,CAAC;AA8BJ,SAASC,eAAeA,CAACC,KAA8C,EAAE;EAAA,IAAAC,KAAA,GAAAC,YAAA;IAAAC,KAAA;EACvE,IAAMC,WAAW,GAMLtD,GAAG;EALf,IAAQuB,MAAM,GAA4B2B,KAAK,CAAvC3B,MAAM;IAAEmB,KAAK,GAAqBQ,KAAK,CAA/BR,KAAK;IAAEhB,IAAI,GAAewB,KAAK,CAAxBxB,IAAI;IAAEF,QAAQ,GAAK0B,KAAK,CAAlB1B,QAAQ;EAErC,OAAA6B,KAAA,GAAOvD,OAAO,CAACyB,MAAM,CAAC,eACpBtB,KAAA,CAAA8B,aAAA,CAACuB,WAAW,EAAAD,KAAA,CAAArB,EAAA,gBAAAC,aAAA,KAAAsB,aAAA;IAAA,SACH;MAAEC,eAAe,KAAAb,MAAA,CAAKD,KAAK,GAAG,CAAC,CAAE;MAAEe,aAAa,KAAAd,MAAA,CAAKD,KAAK,GAAG,CAAC;IAAG,CAAC;IAAA,QAEnEhB;EAAI,GAAAyB,KAAA,kBAEVlD,KAAA,CAAA8B,aAAA,CAACP,QAAQ,EAAA6B,KAAA,CAAArB,EAAA,gBAAE,CACA,CAAC;AAElB;AAEA,OAAO,IAAMY,WAA4B,GAAG/C,eAAe,CAACU,eAAe,EAAE;EAC3EyC,UAAU,EAAE1C,mBAAmB;EAC/BuC,MAAM,EAAEI;AACV,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"LegendTable.js","names":["Box","createComponent","sstyled","Root","React","style","_sstyled","insert","BaseLegend","LegendItemComponent","LegendTableRoot","_BaseLegend","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","render","_ref","asProps","_ref3","_items$","SLegendTable","_this$asProps","styles","Children","_this$asProps$size","size","items","columnsCount","columns","length","createElement","cn","_objectSpread","_assignProps","map","_ref5","_index","id","_ref5$columns","Fragment","item","index","concat","LegendTable","Column","_defineProperty","children","LegendItem","ColumnComponent","props","_ref2","arguments[0]","_ref4","SColumnItem","_assignProps2","gridColumnStart","gridColumnEnd"],"sources":["../../../../../src/component/ChartLegend/LegendTable/LegendTable.tsx"],"sourcesContent":["import { Box } from '@semcore/base-components';\nimport { createComponent, sstyled, Root, type IRootComponentProps } from '@semcore/core';\nimport React from 'react';\n\nimport style from './legend-table.shadow.css';\nimport type { LegendTableType, LegendTableProps, LegendColumnProps } from './LegendTable.type';\nimport { BaseLegend } from '../BaseLegend';\nimport { LegendItemComponent } from '../LegendItem/LegendItem';\n\nclass LegendTableRoot extends BaseLegend<LegendTableProps> {\n static displayName = 'LegendTable';\n static style = style;\n\n static defaultProps = () => ({\n children: <LegendTable.LegendItem />,\n });\n\n render() {\n const SLegendTable = Root;\n const { styles, Children, size = 'm', items } = this.asProps;\n const columnsCount = items[0]?.columns.length;\n\n return sstyled(styles)(\n <SLegendTable render={Box} columns-count={columnsCount + 1} role='group'>\n {items.map(({ id, columns = [] }, _index) => {\n return (\n <React.Fragment key={id}>\n <Children />\n {columns.map((item, index) => {\n return (\n <React.Fragment key={`${id}__${index}`}>\n <LegendTable.Column index={index} size={size} styles={styles}>\n {item}\n </LegendTable.Column>\n </React.Fragment>\n );\n })}\n </React.Fragment>\n );\n })}\n </SLegendTable>,\n );\n }\n}\n\nfunction ColumnComponent(props: LegendColumnProps & IRootComponentProps) {\n const SColumnItem = Root;\n const { styles, index, size, Children } = props;\n\n return sstyled(styles)(\n <SColumnItem\n style={{ gridColumnStart: `${index + 2}`, gridColumnEnd: `${index + 3}` }}\n render={Box}\n size={size}\n >\n <Children />\n </SColumnItem>,\n );\n}\n\nexport const LegendTable = createComponent(LegendTableRoot, {\n LegendItem: LegendItemComponent,\n Column: ColumnComponent,\n}) as LegendTableType;\n"],"mappings":";;;;;;;;;AAAA,SAASA,GAAG,QAAQ,0BAA0B;AAC9C,SAASC,eAAe,EAAEC,OAAO,EAAEC,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EF,QAAQ,GAAK0B,KAAK,CAAlB1B,QAAQ;EAErC,OAAA6B,KAAA,GAAOtD,OAAO,CAACwB,MAAM,CAAC,eACpBtB,KAAA,CAAA8B,aAAA,CAACuB,WAAW,EAAAD,KAAA,CAAArB,EAAA,gBAAAC,aAAA,KAAAsB,aAAA;IAAA,SACH;MAAEC,eAAe,KAAAb,MAAA,CAAKD,KAAK,GAAG,CAAC,CAAE;MAAEe,aAAa,KAAAd,MAAA,CAAKD,KAAK,GAAG,CAAC;IAAG,CAAC;IAAA,QAEnEhB;EAAI,GAAAyB,KAAA,kBAEVlD,KAAA,CAAA8B,aAAA,CAACP,QAAQ,EAAA6B,KAAA,CAAArB,EAAA,gBAAE,CACA,CAAC;AAElB;AAEA,OAAO,IAAMY,WAAW,GAAG9C,eAAe,CAACS,eAAe,EAAE;EAC1DyC,UAAU,EAAE1C,mBAAmB;EAC/BuC,MAAM,EAAEI;AACV,CAAC,CAAoB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"LegendTable.type.js","names":[],"sources":["../../../../../src/component/ChartLegend/LegendTable/LegendTable.type.ts"],"sourcesContent":["import type { Intergalactic } from '@semcore/core';\nimport type { Box } from '@semcore/flex-box';\nimport type React from 'react';\n\nimport type { LegendProps, LSize } from '../BaseLegend.type';\nimport type { LegendItem, LegendItemType } from '../LegendItem/LegendItem.type';\n\nexport type LegendTableProps = Intergalactic.InternalTypings.EfficientOmit<LegendProps, 'items'> & {\n /**\n * Legend items\n */\n items: Array<LegendItem & { columns: Array<React.ReactNode> }>;\n};\n\nexport type LegendColumnProps = {\n index: number;\n size: LSize;\n};\n\nexport type LegendTableType = Intergalactic.Component<typeof Box, LegendTableProps> & {\n LegendItem: LegendItemType;\n Column: Intergalactic.Component<typeof Box, Partial<LegendColumnProps>>;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"LegendTable.type.js","names":[],"sources":["../../../../../src/component/ChartLegend/LegendTable/LegendTable.type.ts"],"sourcesContent":["import type { Box } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport type React from 'react';\n\nimport type { LegendProps, LSize } from '../BaseLegend.type';\nimport type { LegendItem, LegendItemType } from '../LegendItem/LegendItem.type';\n\nexport type LegendTableProps = Intergalactic.InternalTypings.EfficientOmit<LegendProps, 'items'> & {\n /**\n * Legend items\n */\n items: Array<LegendItem & { columns: Array<React.ReactNode> }>;\n};\n\nexport type LegendColumnProps = {\n index: number;\n size: LSize;\n};\n\nexport type LegendTableType = Intergalactic.Component<typeof Box, LegendTableProps> & {\n LegendItem: LegendItemType;\n Column: Intergalactic.Component<typeof Box, Partial<LegendColumnProps>>;\n};\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Cigarette.js","names":["Component","sstyled","callAllEventHandlers","uniqueIDEnhancement","React","createElement","PatternFill","roundedPath","CigaretteBarRoot","_Component","_this","_classCallCheck","_len","arguments","length","args","Array","_key","_callSuper","concat","_defineProperty","createRef","handlers","hovered","setCursor","e","_this$asProps","asProps","onClick","dataKey","currentTarget","tagName","stopPropagation","value","_this$refElement$curr","refElement","current","style","setProperty","_inherits","_createClass","key","uncontrolledProps","getRect","_this$asProps2","x","y","width","height","radius","r","direction","index","xV","yV","widthV","heightV","render","_ref","SBar","Element","_this$asProps3","styles","color","data","hide","uid","duration","onMouseMove","onMouseLeave","transparent","resolveColor","patterns","dSvg","Fragment","cn","undefined","handleMouseMove","handleMouseLeave","handleClick","offset","defaultHovered"],"sources":["../../../../src/component/Cigarette/Cigarette.tsx"],"sourcesContent":["import { Component, sstyled } from '@semcore/core';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport React from 'react';\n\nimport createElement from '../../createElement';\nimport { PatternFill } from '../../Pattern';\nimport { roundedPath } from '../../utils';\n\nclass CigaretteBarRoot extends Component<any> {\n static displayName = 'Cigarette.BarItem';\n static enhance = [uniqueIDEnhancement()];\n static style = {};\n\n static defaultProps = {\n offset: [0, 0],\n duration: 500,\n direction: 'horizontal',\n defaultHovered: false,\n };\n\n refElement = React.createRef<SVGPathElement>();\n\n uncontrolledProps() {\n return {\n hovered: false,\n };\n }\n\n handleMouseMove = () => {\n this.handlers.hovered(true);\n this.setCursor('pointer');\n };\n\n handleMouseLeave = () => {\n this.handlers.hovered(false);\n this.setCursor('auto');\n };\n\n handleClick = (e: React.SyntheticEvent) => {\n const { onClick, dataKey } = this.asProps;\n\n if (onClick && e.currentTarget.tagName === 'path') {\n e.stopPropagation();\n\n onClick(dataKey, e);\n\n return false;\n }\n };\n\n setCursor = (value: 'pointer' | 'auto') => {\n const { onClick } = this.asProps;\n\n if (onClick) {\n this.refElement.current?.style.setProperty('cursor', value);\n }\n };\n\n getRect() {\n const { x, y, width, height, r: radius, direction, index, hovered } = this.asProps;\n\n let xV = x;\n let yV = y;\n let widthV = width;\n let heightV = height;\n\n if (hovered && direction === 'horizontal') {\n yV = yV - 2;\n heightV = heightV + 4;\n }\n\n if (hovered && direction === 'vertical') {\n xV = xV - 2;\n widthV = widthV + 4;\n }\n\n if (radius) {\n if (direction === 'horizontal') {\n if (index === 0) {\n return roundedPath(xV, yV, widthV, heightV, radius, true, false, true, false);\n } else {\n return roundedPath(xV, yV, widthV, heightV, radius, false, true, false, true);\n }\n } else {\n if (index === 0) {\n return roundedPath(xV, yV, widthV, heightV, radius, true, true, false, false);\n } else {\n return roundedPath(xV, yV, widthV, heightV, radius, false, false, true, true);\n }\n }\n }\n\n return roundedPath(xV, yV, widthV, heightV, radius);\n }\n\n render() {\n // @ts-ignore\n const SBar = this.Element;\n const {\n styles,\n color,\n data,\n dataKey,\n index,\n hide,\n uid,\n duration,\n onMouseMove,\n onMouseLeave,\n transparent,\n resolveColor,\n patterns,\n } = this.asProps;\n\n const dSvg = this.getRect();\n\n return (\n <React.Fragment key={`horizontal-bar-${index}`}>\n {sstyled(styles)(\n <SBar\n ref={this.refElement}\n aria-hidden\n render='path'\n clipPath={`url(#${uid})`}\n __excludeProps={['data', 'scale', 'value', 'offset']}\n childrenPosition='above'\n value={data[dataKey]}\n index={index}\n hide={hide}\n fill={resolveColor(color)}\n pattern={patterns ? `url(#${uid}-${index}-pattern)` : undefined}\n transparent={transparent}\n d={dSvg}\n use:duration={`${duration}ms`}\n onMouseMove={callAllEventHandlers(onMouseMove, this.handleMouseMove)}\n onMouseLeave={callAllEventHandlers(onMouseLeave, this.handleMouseLeave)}\n use:onClick={this.handleClick}\n />,\n )}\n {patterns && (\n <PatternFill\n id={`${uid}-${index}-pattern`}\n patternKey={color}\n color={resolveColor(color)}\n patterns={patterns}\n />\n )}\n </React.Fragment>\n );\n }\n}\n\nexport default createElement(CigaretteBarRoot);\n"],"mappings":";;;;;AAAA,SAASA,SAAS,EAAEC,OAAO,QAAQ,eAAe;AAClD,SAASC,oBAAoB,QAAQ,qCAAqC;AAC1E,OAAOC,mBAAmB,MAAM,kCAAkC;AAClE,OAAOC,KAAK,MAAM,OAAO;AAEzB,OAAOC,aAAa,MAAM,qBAAqB;AAC/C,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,WAAW,QAAQ,aAAa;AAAC,IAEpCC,gBAAgB,0BAAAC,UAAA;EAAA,SAAAD,iBAAA;IAAA,IAAAE,KAAA;IAAAC,eAAA,OAAAH,gBAAA;IAAA,SAAAI,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,GAAAQ,UAAA,OAAAV,gBAAA,KAAAW,MAAA,CAAAJ,IAAA;IAAAK,eAAA,CAAAV,KAAA,6BAYPN,KAAK,CAACiB,SAAS,CAAiB,CAAC;IAAAD,eAAA,CAAAV,KAAA,qBAQ5B,YAAM;MACtBA,KAAA,CAAK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,CAAC;AAAAY,eAAA,CAHbZ,gBAAgB,kBAKE;EACpBwE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;EACdb,QAAQ,EAAE,GAAG;EACbhB,SAAS,EAAE,YAAY;EACvB8B,cAAc,EAAE;AAClB,CAAC;AAsIH,eAAe5E,aAAa,CAACG,gBAAgB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Cigarette.js","names":["Component","sstyled","callAllEventHandlers","uniqueIDEnhancement","React","createElement","PatternFill","roundedPath","CigaretteBarRoot","_Component","_this","_classCallCheck","_len","arguments","length","args","Array","_key","_callSuper","concat","_defineProperty","createRef","handlers","hovered","setCursor","e","_this$asProps","asProps","onClick","dataKey","currentTarget","tagName","stopPropagation","value","_this$refElement$curr","refElement","current","style","setProperty","_inherits","_createClass","key","uncontrolledProps","getRect","_this$asProps2","x","y","width","height","radius","r","direction","index","xV","yV","widthV","heightV","render","_ref","SBar","Element","_this$asProps3","styles","color","data","hide","uid","duration","onMouseMove","onMouseLeave","transparent","resolveColor","patterns","dSvg","Fragment","cn","undefined","handleMouseMove","handleMouseLeave","handleClick","offset","defaultHovered"],"sources":["../../../../src/component/Cigarette/Cigarette.tsx"],"sourcesContent":["import { Component, sstyled } from '@semcore/core';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport React from 'react';\n\nimport createElement from '../../createElement';\nimport { PatternFill } from '../../Pattern';\nimport { roundedPath } from '../../utils';\n\nclass CigaretteBarRoot extends Component<any, [], { hovered: boolean }> {\n static displayName = 'Cigarette.BarItem';\n static enhance = [uniqueIDEnhancement()];\n static style = {};\n\n static defaultProps = {\n offset: [0, 0],\n duration: 500,\n direction: 'horizontal',\n defaultHovered: false,\n };\n\n refElement = React.createRef<SVGPathElement>();\n\n uncontrolledProps() {\n return {\n hovered: false,\n };\n }\n\n handleMouseMove = () => {\n this.handlers.hovered(true);\n this.setCursor('pointer');\n };\n\n handleMouseLeave = () => {\n this.handlers.hovered(false);\n this.setCursor('auto');\n };\n\n handleClick = (e: React.SyntheticEvent) => {\n const { onClick, dataKey } = this.asProps;\n\n if (onClick && e.currentTarget.tagName === 'path') {\n e.stopPropagation();\n\n onClick(dataKey, e);\n\n return false;\n }\n };\n\n setCursor = (value: 'pointer' | 'auto') => {\n const { onClick } = this.asProps;\n\n if (onClick) {\n this.refElement.current?.style.setProperty('cursor', value);\n }\n };\n\n getRect() {\n const { x, y, width, height, r: radius, direction, index, hovered } = this.asProps;\n\n let xV = x;\n let yV = y;\n let widthV = width;\n let heightV = height;\n\n if (hovered && direction === 'horizontal') {\n yV = yV - 2;\n heightV = heightV + 4;\n }\n\n if (hovered && direction === 'vertical') {\n xV = xV - 2;\n widthV = widthV + 4;\n }\n\n if (radius) {\n if (direction === 'horizontal') {\n if (index === 0) {\n return roundedPath(xV, yV, widthV, heightV, radius, true, false, true, false);\n } else {\n return roundedPath(xV, yV, widthV, heightV, radius, false, true, false, true);\n }\n } else {\n if (index === 0) {\n return roundedPath(xV, yV, widthV, heightV, radius, true, true, false, false);\n } else {\n return roundedPath(xV, yV, widthV, heightV, radius, false, false, true, true);\n }\n }\n }\n\n return roundedPath(xV, yV, widthV, heightV, radius);\n }\n\n render() {\n // @ts-ignore\n const SBar = this.Element;\n const {\n styles,\n color,\n data,\n dataKey,\n index,\n hide,\n uid,\n duration,\n onMouseMove,\n onMouseLeave,\n transparent,\n resolveColor,\n patterns,\n } = this.asProps;\n\n const dSvg = this.getRect();\n\n return (\n <React.Fragment key={`horizontal-bar-${index}`}>\n {sstyled(styles)(\n <SBar\n ref={this.refElement}\n aria-hidden\n render='path'\n clipPath={`url(#${uid})`}\n __excludeProps={['data', 'scale', 'value', 'offset']}\n childrenPosition='above'\n value={data[dataKey]}\n index={index}\n hide={hide}\n fill={resolveColor(color)}\n pattern={patterns ? `url(#${uid}-${index}-pattern)` : undefined}\n transparent={transparent}\n d={dSvg}\n use:duration={`${duration}ms`}\n onMouseMove={callAllEventHandlers(onMouseMove, this.handleMouseMove)}\n onMouseLeave={callAllEventHandlers(onMouseLeave, this.handleMouseLeave)}\n use:onClick={this.handleClick}\n />,\n )}\n {patterns && (\n <PatternFill\n id={`${uid}-${index}-pattern`}\n patternKey={color}\n color={resolveColor(color)}\n patterns={patterns}\n />\n )}\n </React.Fragment>\n );\n }\n}\n\nexport default createElement(CigaretteBarRoot);\n"],"mappings":";;;;;AAAA,SAASA,SAAS,EAAEC,OAAO,QAAQ,eAAe;AAClD,SAASC,oBAAoB,QAAQ,qCAAqC;AAC1E,OAAOC,mBAAmB,MAAM,kCAAkC;AAClE,OAAOC,KAAK,MAAM,OAAO;AAEzB,OAAOC,aAAa,MAAM,qBAAqB;AAC/C,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,WAAW,QAAQ,aAAa;AAAC,IAEpCC,gBAAgB,0BAAAC,UAAA;EAAA,SAAAD,iBAAA;IAAA,IAAAE,KAAA;IAAAC,eAAA,OAAAH,gBAAA;IAAA,SAAAI,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,GAAAQ,UAAA,OAAAV,gBAAA,KAAAW,MAAA,CAAAJ,IAAA;IAAAK,eAAA,CAAAV,KAAA,6BAYPN,KAAK,CAACiB,SAAS,CAAiB,CAAC;IAAAD,eAAA,CAAAV,KAAA,qBAQ5B,YAAM;MACtBA,KAAA,CAAKY,QAAQ,CAACC,OAAO,CAAC,IAAI,CAAC;MAC3Bb,KAAA,CAAKc,SAAS,CAAC,SAAS,CAAC;IAC3B,CAAC;IAAAJ,eAAA,CAAAV,KAAA,sBAEkB,YAAM;MACvBA,KAAA,CAAKY,QAAQ,CAACC,OAAO,CAAC,KAAK,CAAC;MAC5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gBAAgB,CAAC","ignoreList":[]}
@@ -10,6 +10,9 @@ STick {
10
10
  font-size: var(--intergalactic-fs-100, 12px);
11
11
  fill: var(--intergalactic-chart-grid-text-label, oklch(0.088 0.026 147.7 / 0.583));
12
12
  }
13
+ STick[primaryText] {
14
+ fill: var(--intergalactic-text-primary, oklch(0.1 0.03 137 / 0.899));
15
+ }
13
16
 
14
17
  STick[hide] {
15
18
  display: none;
@@ -69,7 +72,6 @@ STick[position='bottom'] {
69
72
 
70
73
  STick[position='right'] {
71
74
  transform: translateX(16px);
72
- text-anchor: start;
73
75
  dominant-baseline: middle;
74
76
 
75
77
  tspan {
@@ -1,5 +1,3 @@
1
- @import './var.css';
2
-
3
1
  SPlot {
4
2
  overflow: hidden;
5
3
  }
@@ -17,7 +15,7 @@ foreignObject[data-aria-only] {
17
15
  pointer-events: none;
18
16
  }
19
17
 
20
- SPlot[keyboardFocused] {
18
+ SPlot:has(foreignObject[data-aria-only]:focus-within) {
21
19
  @mixin focus-outline-mixin;
22
20
  border-radius: var(--intergalactic-surface-rounded, calc(6px + 2px));
23
21
  }
@@ -1,12 +1,11 @@
1
- @import './var.css';
2
-
3
1
  SPlotA11yModule {
4
- user-select: none;
5
- pointer-events: none;
6
- opacity: 0;
7
- }
8
- SPlotA11yModule:focus {
9
- user-select: all;
10
- pointer-events: all;
11
- opacity: 1;
12
- }
2
+ position: absolute;
3
+ width: 1px;
4
+ height: 1px;
5
+ padding: 0;
6
+ margin: -1px;
7
+ overflow: hidden;
8
+ clip: rect(0, 0, 0, 0);
9
+ white-space: nowrap;
10
+ border: 0,
11
+ }