@semcore/d3-chart 16.5.0 → 17.0.0-prerelease.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/lib/cjs/AnimatedClipPath.js +28 -41
- package/lib/cjs/AnimatedClipPath.js.map +1 -1
- package/lib/cjs/Area.js +187 -223
- package/lib/cjs/Area.js.map +1 -1
- package/lib/cjs/Axis.js +248 -327
- package/lib/cjs/Axis.js.map +1 -1
- package/lib/cjs/Bar.js +162 -185
- package/lib/cjs/Bar.js.map +1 -1
- package/lib/cjs/Bubble.js +219 -248
- package/lib/cjs/Bubble.js.map +1 -1
- package/lib/cjs/CompactHorizontalBar.js +448 -482
- package/lib/cjs/CompactHorizontalBar.js.map +1 -1
- package/lib/cjs/Donut.js +349 -396
- package/lib/cjs/Donut.js.map +1 -1
- package/lib/cjs/Dots.js +67 -86
- package/lib/cjs/Dots.js.map +1 -1
- package/lib/cjs/GroupBar.js +78 -93
- package/lib/cjs/GroupBar.js.map +1 -1
- package/lib/cjs/HorizontalBar.js +149 -167
- package/lib/cjs/HorizontalBar.js.map +1 -1
- package/lib/cjs/Hover.js +178 -207
- package/lib/cjs/Hover.js.map +1 -1
- package/lib/cjs/Line.js +182 -222
- package/lib/cjs/Line.js.map +1 -1
- package/lib/cjs/Pattern.js +124 -126
- package/lib/cjs/Pattern.js.map +1 -1
- package/lib/cjs/Plot.js +100 -126
- package/lib/cjs/Plot.js.map +1 -1
- package/lib/cjs/Radar.js +576 -681
- package/lib/cjs/Radar.js.map +1 -1
- package/lib/cjs/RadialTree.js +518 -571
- package/lib/cjs/RadialTree.js.map +1 -1
- package/lib/cjs/Reference.js +147 -178
- package/lib/cjs/Reference.js.map +1 -1
- package/lib/cjs/ResponsiveContainer.js +64 -82
- package/lib/cjs/ResponsiveContainer.js.map +1 -1
- package/lib/cjs/ScatterPlot.js +169 -199
- package/lib/cjs/ScatterPlot.js.map +1 -1
- package/lib/cjs/StackBar.js +135 -177
- package/lib/cjs/StackBar.js.map +1 -1
- package/lib/cjs/StackedArea.js +60 -73
- package/lib/cjs/StackedArea.js.map +1 -1
- package/lib/cjs/Tooltip.js +193 -208
- package/lib/cjs/Tooltip.js.map +1 -1
- package/lib/cjs/Venn.js +182 -217
- package/lib/cjs/Venn.js.map +1 -1
- package/lib/cjs/a11y/DataAccessibilityTable.js +45 -83
- package/lib/cjs/a11y/DataAccessibilityTable.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yModule.js +37 -97
- package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yView.js +97 -91
- package/lib/cjs/a11y/PlotA11yView.js.map +1 -1
- package/lib/cjs/a11y/bezier.js +17 -23
- package/lib/cjs/a11y/bezier.js.map +1 -1
- package/lib/cjs/a11y/focus.js +16 -16
- package/lib/cjs/a11y/focus.js.map +1 -1
- package/lib/cjs/a11y/hints.js +72 -75
- package/lib/cjs/a11y/hints.js.map +1 -1
- package/lib/cjs/a11y/insights.js +354 -525
- package/lib/cjs/a11y/insights.js.map +1 -1
- package/lib/cjs/a11y/intl.js +5 -5
- package/lib/cjs/a11y/intl.js.map +1 -1
- package/lib/cjs/a11y/locale.js +12 -19
- package/lib/cjs/a11y/locale.js.map +1 -1
- package/lib/cjs/a11y/serialize.js +164 -203
- package/lib/cjs/a11y/serialize.js.map +1 -1
- package/lib/cjs/a11y/summarize.js +7 -6
- package/lib/cjs/a11y/summarize.js.map +1 -1
- package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js +16 -16
- package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/a11y/translations/module/de.json +2 -2
- package/lib/cjs/a11y/translations/module/en.json +2 -2
- package/lib/cjs/a11y/translations/module/es.json +2 -2
- package/lib/cjs/a11y/translations/module/fr.json +2 -2
- package/lib/cjs/a11y/translations/module/it.json +2 -2
- package/lib/cjs/a11y/translations/module/ja.json +2 -2
- package/lib/cjs/a11y/translations/module/ko.json +2 -2
- package/lib/cjs/a11y/translations/module/nl.json +2 -2
- package/lib/cjs/a11y/translations/module/pl.json +2 -2
- package/lib/cjs/a11y/translations/module/pt.json +2 -2
- package/lib/cjs/a11y/translations/module/sv.json +2 -2
- package/lib/cjs/a11y/translations/module/tr.json +2 -2
- package/lib/cjs/a11y/translations/module/vi.json +2 -2
- package/lib/cjs/a11y/translations/module/zh.json +2 -2
- package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js +16 -16
- package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/color.js +1 -1
- package/lib/cjs/color.js.map +1 -1
- package/lib/cjs/component/Chart/AbstractChart.js +421 -466
- package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
- package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/AreaChart.js +97 -115
- package/lib/cjs/component/Chart/AreaChart.js.map +1 -1
- package/lib/cjs/component/Chart/AreaChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/BarChart.js +229 -216
- package/lib/cjs/component/Chart/BarChart.js.map +1 -1
- package/lib/cjs/component/Chart/BarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/BubbleChart.js +114 -136
- package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
- package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.js +280 -305
- package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.js +76 -108
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.js.map +1 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.js +80 -95
- package/lib/cjs/component/Chart/DonutChart.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/HistogramChart.js +126 -148
- package/lib/cjs/component/Chart/HistogramChart.js.map +1 -1
- package/lib/cjs/component/Chart/HistogramChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.js +95 -113
- package/lib/cjs/component/Chart/LineChart.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/RadarChart.js +84 -110
- package/lib/cjs/component/Chart/RadarChart.js.map +1 -1
- package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.js +119 -143
- package/lib/cjs/component/Chart/ScatterPlotChart.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/VennChart.js +103 -122
- package/lib/cjs/component/Chart/VennChart.js.map +1 -1
- package/lib/cjs/component/Chart/VennChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/index.js +2 -2
- package/lib/cjs/component/Chart/index.js.map +1 -1
- package/lib/cjs/component/ChartLegend/BaseLegend.js +72 -105
- package/lib/cjs/component/ChartLegend/BaseLegend.js.map +1 -1
- package/lib/cjs/component/ChartLegend/BaseLegend.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +58 -70
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +208 -221
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +63 -73
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/index.js +4 -4
- package/lib/cjs/component/ChartLegend/index.js.map +1 -1
- package/lib/cjs/component/Cigarette/Cigarette.js +115 -129
- package/lib/cjs/component/Cigarette/Cigarette.js.map +1 -1
- package/lib/cjs/component/StackGroupBar/StackGroupBar.js +107 -137
- package/lib/cjs/component/StackGroupBar/StackGroupBar.js.map +1 -1
- package/lib/cjs/component/SvgElement.js +7 -7
- package/lib/cjs/component/SvgElement.js.map +1 -1
- package/lib/cjs/createElement.js +66 -65
- package/lib/cjs/createElement.js.map +1 -1
- package/lib/cjs/index.js +62 -62
- package/lib/cjs/style/axis.shadow.css +3 -0
- package/lib/cjs/style/plot.shadow.css +1 -3
- package/lib/cjs/style/plotA11yModule.shadow.css +10 -11
- package/lib/cjs/style/plotA11yView.shadow.css +13 -26
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +15 -15
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/types/Axis.d.js.map +1 -1
- package/lib/cjs/types/CompactHorizontalBar.d.js.map +1 -1
- package/lib/cjs/types/Hover.d.js.map +1 -1
- package/lib/cjs/types/Line.d.js.map +1 -1
- package/lib/cjs/types/Plot.d.js.map +1 -1
- package/lib/cjs/types/Radar.d.js.map +1 -1
- package/lib/cjs/types/ResponsiveContainer.d.js.map +1 -1
- package/lib/cjs/types/Tooltip.d.js.map +1 -1
- package/lib/cjs/types/Venn.d.js.map +1 -1
- package/lib/cjs/types/index.d.js +80 -80
- package/lib/cjs/types/index.d.js.map +1 -1
- package/lib/cjs/utils.js +122 -145
- package/lib/cjs/utils.js.map +1 -1
- package/lib/es6/AnimatedClipPath.js +24 -37
- package/lib/es6/AnimatedClipPath.js.map +1 -1
- package/lib/es6/Area.js +179 -215
- package/lib/es6/Area.js.map +1 -1
- package/lib/es6/Axis.js +242 -321
- package/lib/es6/Axis.js.map +1 -1
- package/lib/es6/Bar.js +154 -177
- package/lib/es6/Bar.js.map +1 -1
- package/lib/es6/Bubble.js +206 -235
- package/lib/es6/Bubble.js.map +1 -1
- package/lib/es6/CompactHorizontalBar.js +433 -467
- package/lib/es6/CompactHorizontalBar.js.map +1 -1
- package/lib/es6/Donut.js +337 -384
- package/lib/es6/Donut.js.map +1 -1
- package/lib/es6/Dots.js +60 -79
- package/lib/es6/Dots.js.map +1 -1
- package/lib/es6/GroupBar.js +74 -89
- package/lib/es6/GroupBar.js.map +1 -1
- package/lib/es6/HorizontalBar.js +141 -159
- package/lib/es6/HorizontalBar.js.map +1 -1
- package/lib/es6/Hover.js +174 -203
- package/lib/es6/Hover.js.map +1 -1
- package/lib/es6/Line.js +173 -213
- package/lib/es6/Line.js.map +1 -1
- package/lib/es6/Pattern.js +68 -74
- package/lib/es6/Pattern.js.map +1 -1
- package/lib/es6/Plot.js +95 -121
- package/lib/es6/Plot.js.map +1 -1
- package/lib/es6/Radar.js +554 -659
- package/lib/es6/Radar.js.map +1 -1
- package/lib/es6/RadialTree.js +500 -553
- package/lib/es6/RadialTree.js.map +1 -1
- package/lib/es6/Reference.js +140 -171
- package/lib/es6/Reference.js.map +1 -1
- package/lib/es6/ResponsiveContainer.js +58 -76
- package/lib/es6/ResponsiveContainer.js.map +1 -1
- package/lib/es6/ScatterPlot.js +161 -191
- package/lib/es6/ScatterPlot.js.map +1 -1
- package/lib/es6/StackBar.js +130 -172
- package/lib/es6/StackBar.js.map +1 -1
- package/lib/es6/StackedArea.js +56 -69
- package/lib/es6/StackedArea.js.map +1 -1
- package/lib/es6/Tooltip.js +183 -198
- package/lib/es6/Tooltip.js.map +1 -1
- package/lib/es6/Venn.js +169 -204
- package/lib/es6/Venn.js.map +1 -1
- package/lib/es6/a11y/DataAccessibilityTable.js +41 -80
- package/lib/es6/a11y/DataAccessibilityTable.js.map +1 -1
- package/lib/es6/a11y/PlotA11yModule.js +35 -95
- package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
- package/lib/es6/a11y/PlotA11yView.js +89 -84
- package/lib/es6/a11y/PlotA11yView.js.map +1 -1
- package/lib/es6/a11y/bezier.js +16 -23
- package/lib/es6/a11y/bezier.js.map +1 -1
- package/lib/es6/a11y/focus.js +15 -16
- package/lib/es6/a11y/focus.js.map +1 -1
- package/lib/es6/a11y/hints.js +67 -73
- package/lib/es6/a11y/hints.js.map +1 -1
- package/lib/es6/a11y/insights.js +353 -524
- package/lib/es6/a11y/insights.js.map +1 -1
- package/lib/es6/a11y/intl.js +4 -5
- package/lib/es6/a11y/intl.js.map +1 -1
- package/lib/es6/a11y/locale.js +11 -18
- package/lib/es6/a11y/locale.js.map +1 -1
- package/lib/es6/a11y/serialize.js +162 -203
- package/lib/es6/a11y/serialize.js.map +1 -1
- package/lib/es6/a11y/summarize.js +6 -6
- package/lib/es6/a11y/summarize.js.map +1 -1
- package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js +15 -15
- package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/a11y/translations/module/de.json +2 -2
- package/lib/es6/a11y/translations/module/en.json +2 -2
- package/lib/es6/a11y/translations/module/es.json +2 -2
- package/lib/es6/a11y/translations/module/fr.json +2 -2
- package/lib/es6/a11y/translations/module/it.json +2 -2
- package/lib/es6/a11y/translations/module/ja.json +2 -2
- package/lib/es6/a11y/translations/module/ko.json +2 -2
- package/lib/es6/a11y/translations/module/nl.json +2 -2
- package/lib/es6/a11y/translations/module/pl.json +2 -2
- package/lib/es6/a11y/translations/module/pt.json +2 -2
- package/lib/es6/a11y/translations/module/sv.json +2 -2
- package/lib/es6/a11y/translations/module/tr.json +2 -2
- package/lib/es6/a11y/translations/module/vi.json +2 -2
- package/lib/es6/a11y/translations/module/zh.json +2 -2
- package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js +15 -15
- package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/color.js +1 -1
- package/lib/es6/color.js.map +1 -1
- package/lib/es6/component/Chart/AbstractChart.js +416 -462
- package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
- package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
- package/lib/es6/component/Chart/AreaChart.js +92 -111
- package/lib/es6/component/Chart/AreaChart.js.map +1 -1
- package/lib/es6/component/Chart/AreaChart.type.js.map +1 -1
- package/lib/es6/component/Chart/BarChart.js +225 -213
- package/lib/es6/component/Chart/BarChart.js.map +1 -1
- package/lib/es6/component/Chart/BarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/BubbleChart.js +109 -132
- package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
- package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.js +276 -301
- package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.js +70 -103
- package/lib/es6/component/Chart/CompactHorizontalBarChart.js.map +1 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.js +74 -90
- package/lib/es6/component/Chart/DonutChart.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.type.js.map +1 -1
- package/lib/es6/component/Chart/HistogramChart.js +121 -144
- package/lib/es6/component/Chart/HistogramChart.js.map +1 -1
- package/lib/es6/component/Chart/HistogramChart.type.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.js +90 -109
- package/lib/es6/component/Chart/LineChart.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
- package/lib/es6/component/Chart/RadarChart.js +80 -107
- package/lib/es6/component/Chart/RadarChart.js.map +1 -1
- package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.js +113 -138
- package/lib/es6/component/Chart/ScatterPlotChart.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.js +97 -117
- package/lib/es6/component/Chart/VennChart.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/BaseLegend.js +70 -104
- package/lib/es6/component/ChartLegend/BaseLegend.js.map +1 -1
- package/lib/es6/component/ChartLegend/BaseLegend.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +53 -65
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +198 -211
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +58 -68
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
- package/lib/es6/component/Cigarette/Cigarette.js +108 -122
- package/lib/es6/component/Cigarette/Cigarette.js.map +1 -1
- package/lib/es6/component/StackGroupBar/StackGroupBar.js +100 -130
- package/lib/es6/component/StackGroupBar/StackGroupBar.js.map +1 -1
- package/lib/es6/component/SvgElement.js +4 -5
- package/lib/es6/component/SvgElement.js.map +1 -1
- package/lib/es6/createElement.js +55 -54
- package/lib/es6/createElement.js.map +1 -1
- package/lib/es6/style/axis.shadow.css +3 -0
- package/lib/es6/style/plot.shadow.css +1 -3
- package/lib/es6/style/plotA11yModule.shadow.css +10 -11
- package/lib/es6/style/plotA11yView.shadow.css +13 -26
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +14 -14
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/types/Axis.d.js.map +1 -1
- package/lib/es6/types/CompactHorizontalBar.d.js.map +1 -1
- package/lib/es6/types/Hover.d.js.map +1 -1
- package/lib/es6/types/Line.d.js.map +1 -1
- package/lib/es6/types/Plot.d.js.map +1 -1
- package/lib/es6/types/Radar.d.js.map +1 -1
- package/lib/es6/types/ResponsiveContainer.d.js.map +1 -1
- package/lib/es6/types/Tooltip.d.js.map +1 -1
- package/lib/es6/types/Venn.d.js.map +1 -1
- package/lib/es6/utils.js +105 -144
- package/lib/es6/utils.js.map +1 -1
- package/lib/esm/AnimatedClipPath.mjs +24 -36
- package/lib/esm/Area.mjs +178 -149
- package/lib/esm/Axis.mjs +241 -242
- package/lib/esm/Bar.mjs +155 -137
- package/lib/esm/Bubble.mjs +205 -171
- package/lib/esm/CompactHorizontalBar.mjs +428 -383
- package/lib/esm/Donut.mjs +315 -266
- package/lib/esm/Dots.mjs +60 -49
- package/lib/esm/GroupBar.mjs +71 -75
- package/lib/esm/HorizontalBar.mjs +142 -120
- package/lib/esm/Hover.mjs +173 -163
- package/lib/esm/Line.mjs +174 -145
- package/lib/esm/Pattern.mjs +67 -63
- package/lib/esm/Plot.mjs +98 -95
- package/lib/esm/Radar.mjs +550 -498
- package/lib/esm/RadialTree.mjs +512 -416
- package/lib/esm/Reference.mjs +137 -122
- package/lib/esm/ResponsiveContainer.mjs +58 -69
- package/lib/esm/ScatterPlot.mjs +163 -162
- package/lib/esm/StackBar.mjs +126 -147
- package/lib/esm/StackedArea.mjs +53 -61
- package/lib/esm/Tooltip.mjs +185 -175
- package/lib/esm/Venn.mjs +170 -170
- package/lib/esm/a11y/DataAccessibilityTable.mjs +46 -73
- package/lib/esm/a11y/PlotA11yModule.mjs +37 -80
- package/lib/esm/a11y/PlotA11yView.mjs +99 -74
- package/lib/esm/a11y/bezier.mjs +16 -23
- package/lib/esm/a11y/focus.mjs +15 -16
- package/lib/esm/a11y/hints.mjs +65 -71
- package/lib/esm/a11y/insights.mjs +347 -495
- package/lib/esm/a11y/intl.mjs +4 -5
- package/lib/esm/a11y/locale.mjs +12 -14
- package/lib/esm/a11y/serialize.mjs +139 -152
- package/lib/esm/a11y/summarize.mjs +3 -3
- package/lib/esm/a11y/translations/module/__intergalactic-dynamic-locales.mjs +1 -1
- package/lib/esm/a11y/translations/module/de.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/en.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/es.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/fr.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/it.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/ja.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/ko.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/nl.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/pl.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/pt.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/sv.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/tr.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/vi.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/zh.json.mjs +2 -4
- package/lib/esm/a11y/translations/view/__intergalactic-dynamic-locales.mjs +1 -1
- package/lib/esm/color.mjs +1 -1
- package/lib/esm/component/Chart/AbstractChart.mjs +422 -415
- package/lib/esm/component/Chart/AreaChart.mjs +92 -91
- package/lib/esm/component/Chart/BarChart.mjs +225 -177
- package/lib/esm/component/Chart/BubbleChart.mjs +110 -118
- package/lib/esm/component/Chart/CigaretteChart.mjs +277 -268
- package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +70 -87
- package/lib/esm/component/Chart/DonutChart.mjs +74 -84
- package/lib/esm/component/Chart/HistogramChart.mjs +121 -117
- package/lib/esm/component/Chart/LineChart.mjs +90 -89
- package/lib/esm/component/Chart/RadarChart.mjs +81 -97
- package/lib/esm/component/Chart/ScatterPlotChart.mjs +113 -111
- package/lib/esm/component/Chart/VennChart.mjs +98 -111
- package/lib/esm/component/ChartLegend/BaseLegend.mjs +75 -97
- package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +54 -55
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +194 -165
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.type.mjs +1 -1
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +60 -58
- package/lib/esm/component/Cigarette/Cigarette.mjs +109 -99
- package/lib/esm/component/StackGroupBar/StackGroupBar.mjs +97 -111
- package/lib/esm/component/SvgElement.mjs +4 -4
- package/lib/esm/createElement.mjs +54 -37
- package/lib/esm/style/axis.shadow.css +3 -0
- package/lib/esm/style/plot.shadow.css +1 -3
- package/lib/esm/style/plotA11yModule.shadow.css +10 -11
- package/lib/esm/style/plotA11yView.shadow.css +13 -26
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +1 -1
- package/lib/esm/utils.mjs +103 -138
- package/lib/types/Axis.d.ts +4 -0
- package/lib/types/CompactHorizontalBar.d.ts +1 -1
- package/lib/types/Hover.d.ts +1 -1
- package/lib/types/Line.d.ts +1 -1
- package/lib/types/Plot.d.ts +1 -1
- package/lib/types/Radar.d.ts +1 -1
- package/lib/types/ResponsiveContainer.d.ts +1 -1
- package/lib/types/Tooltip.d.ts +1 -3
- package/lib/types/Venn.d.ts +1 -1
- package/lib/types/a11y/PlotA11yModule.d.ts +4 -11
- package/lib/types/a11y/PlotA11yView.d.ts +12 -1
- package/lib/types/a11y/translations/module/__intergalactic-dynamic-locales.d.ts +14 -14
- package/lib/types/component/Chart/AbstractChart.d.ts +1 -1
- package/lib/types/component/Chart/AbstractChart.type.d.ts +1 -1
- package/lib/types/component/Chart/AreaChart.type.d.ts +1 -1
- package/lib/types/component/Chart/BarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/BubbleChart.type.d.ts +1 -1
- package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/DonutChart.type.d.ts +1 -1
- package/lib/types/component/Chart/HistogramChart.type.d.ts +1 -1
- package/lib/types/component/Chart/LineChart.type.d.ts +1 -1
- package/lib/types/component/Chart/RadarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +1 -1
- package/lib/types/component/Chart/VennChart.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/BaseLegend.d.ts +1 -1
- package/lib/types/component/ChartLegend/BaseLegend.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts +1 -1
- package/lib/types/utils.d.ts +10 -10
- package/package.json +11 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VennChart.js","names":["_core","require","_i18nEnhance","_interopRequireDefault","_typography","_d3Scale","_react","_","
|
|
1
|
+
{"version":3,"file":"VennChart.js","names":["_core","require","_i18nEnhance","_interopRequireDefault","_typography","_d3Scale","_react","_","_AbstractChart","_intergalacticDynamicLocales","VennChartComponent","AbstractChart","xScale","asProps","scaleLinear","yScale","dataKeys","data","props","legendKeys","Object","keys","filter","item","isIntersection","test","defaultLegendProps","legendType","renderChart","onClickVennItem","dataDefinitions","highlightedLine","state","checkedLegendItems","checked","checkedLegendItemsMap","reduce","result","id","intersections","dataKey","push","default","createElement","Venn","onClick","map","index","Circle","key","name","label","color","transparent","intersectionKey","intersectionKeys","split","hasDisabledItems","some","undefined","find","legendItem","join","Intersection","renderTooltip","Tooltip","children","Fragment","Title","Text","bold","getLegendAriaLabel","getI18nText","chartType","_defineProperty2","direction","alignItems","marginY","marginX","i18nEnhance","localizedMessages","VennChart","exports","createComponent"],"sources":["../../../../src/component/Chart/VennChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { Text } from '@semcore/typography';\nimport { scaleLinear } from 'd3-scale';\nimport React from 'react';\n\nimport type { BaseChartProps } from './AbstractChart.type';\n// @ts-ignore\nimport { Venn } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport type { VennChartData, VennChartProps, VennChartType } from './VennChart.type';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\nimport type { LegendItem } from '../ChartLegend/LegendItem/LegendItem.type';\n\nclass VennChartComponent extends AbstractChart<\n VennChartData,\n VennChartProps,\n typeof VennChartComponent.enhance\n> {\n static displayName = 'Chart.Venn';\n\n static defaultProps: Partial<BaseChartProps<VennChartData>> = {\n direction: 'row-reverse',\n alignItems: 'flex-start',\n marginY: 0,\n marginX: 0,\n };\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n get xScale() {\n const { xScale } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n return scaleLinear();\n }\n\n get yScale() {\n const { yScale } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n return scaleLinear();\n }\n\n protected get dataKeys(): string[] {\n const { data } = this.props;\n\n const legendKeys: string[] = Object.keys(data).filter((item) => {\n const isIntersection = /\\//.test(item);\n\n return !isIntersection;\n });\n\n return legendKeys;\n }\n\n defaultLegendProps() {\n return {\n legendType: 'Table' as const,\n };\n }\n\n renderChart() {\n const { data, onClickVennItem } = this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n\n const checkedLegendItems = dataDefinitions.filter((item) => item.checked);\n const checkedLegendItemsMap = checkedLegendItems.reduce<Record<string, LegendItem>>(\n (result, item) => {\n result[item.id] = item;\n\n return result;\n },\n {},\n );\n\n const intersections = Object.keys(data).reduce<string[]>((result, dataKey) => {\n const isIntersection = /\\//.test(dataKey);\n\n if (isIntersection) {\n result.push(dataKey);\n }\n\n return result;\n }, []);\n\n return (\n <Venn onClick={onClickVennItem}>\n {checkedLegendItems.map((item, index) => {\n return (\n <Venn.Circle\n key={item.id}\n dataKey={item.id}\n name={item.label}\n color={item.color}\n transparent={highlightedLine !== -1 && highlightedLine !== index}\n />\n );\n })}\n\n {intersections.map((intersectionKey) => {\n const intersectionKeys = intersectionKey.split('/');\n\n const hasDisabledItems = intersectionKeys.some((key) => {\n return checkedLegendItemsMap[key] === undefined;\n });\n\n if (hasDisabledItems) {\n return null;\n }\n\n const name = intersectionKeys\n .map((id) => {\n return dataDefinitions.find((legendItem) => legendItem.id === id)?.label || '';\n })\n .join(' & ');\n\n return <Venn.Intersection key={intersectionKey} dataKey={intersectionKey} name={name} />;\n })}\n </Venn>\n );\n }\n\n renderTooltip() {\n return (\n <Venn.Tooltip>\n {({ name, dataKey, data }: any) => {\n return {\n children: (\n <>\n <Venn.Tooltip.Title>{name}</Venn.Tooltip.Title>\n <Text bold>{data[dataKey]}</Text>\n </>\n ),\n };\n }}\n </Venn.Tooltip>\n );\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Venn' });\n }\n}\n\nexport const VennChart: VennChartType = createComponent(VennChartComponent);\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AAIA,IAAAM,CAAA,GAAAN,OAAA;AACA,IAAAO,cAAA,GAAAP,OAAA;AAEA,IAAAQ,4BAAA,GAAAR,OAAA;AAJA;;AAOA,MAAMS,kBAAkB,SAASC,4BAAa,CAI5C;EAYA,IAAIC,MAAMA,CAAA,EAAG;IACX,MAAM;MAAEA;IAAO,CAAC,GAAG,IAAI,CAACC,OAAO;IAE/B,IAAID,MAAM,EAAE;MACV,OAAOA,MAAM;IACf;IAEA,OAAO,IAAAE,oBAAW,EAAC,CAAC;EACtB;EAEA,IAAIC,MAAMA,CAAA,EAAG;IACX,MAAM;MAAEA;IAAO,CAAC,GAAG,IAAI,CAACF,OAAO;IAE/B,IAAIE,MAAM,EAAE;MACV,OAAOA,MAAM;IACf;IAEA,OAAO,IAAAD,oBAAW,EAAC,CAAC;EACtB;EAEA,IAAcE,QAAQA,CAAA,EAA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CAACpC,CAAA,CAAAqC,IAAI,CAACqB,OAAO,QACV,CAAC;MAAEf,IAAI;MAAEV,OAAO;MAAEvB;IAAU,CAAC,KAAK;MACjC,OAAO;QACLiD,QAAQ,eACN5D,MAAA,CAAAoC,OAAA,CAAAC,aAAA,CAAArC,MAAA,CAAAoC,OAAA,CAAAyB,QAAA,qBACE7D,MAAA,CAAAoC,OAAA,CAAAC,aAAA,CAACpC,CAAA,CAAAqC,IAAI,CAACqB,OAAO,CAACG,KAAK,QAAElB,IAAyB,CAAC,eAC/C5C,MAAA,CAAAoC,OAAA,CAAAC,aAAA,CAACvC,WAAA,CAAAiE,IAAI;UAACC,IAAI;QAAA,GAAErD,IAAI,CAACuB,OAAO,CAAQ,CAChC;MAEN,CAAC;IACH,CACY,CAAC;EAEnB;EAEU+B,kBAAkBA,CAAA,EAAW;IACrC,OAAO,IAAI,CAAC1D,OAAO,CAAC2D,WAAW,CAAC,gBAAgB,EAAE;MAAEC,SAAS,EAAE;IAAO,CAAC,CAAC;EAC1E;AACF;AAAC,IAAAC,gBAAA,CAAAhC,OAAA,EAvIKhC,kBAAkB,iBAKD,YAAY;AAAA,IAAAgE,gBAAA,CAAAhC,OAAA,EAL7BhC,kBAAkB,kBAOwC;EAC5DiE,SAAS,EAAE,aAAa;EACxBC,UAAU,EAAE,YAAY;EACxBC,OAAO,EAAE,CAAC;EACVC,OAAO,EAAE;AACX,CAAC;AAAA,IAAAJ,gBAAA,CAAAhC,OAAA,EAZGhC,kBAAkB,aAcL,CAAC,IAAAqE,oBAAW,EAACC,8CAAiB,CAAC,CAAC;AA2H5C,MAAMC,SAAwB,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAAE,qBAAe,EAACzE,kBAAkB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VennChart.type.js","names":[],"sources":["../../../../src/component/Chart/VennChart.type.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"VennChart.type.js","names":[],"sources":["../../../../src/component/Chart/VennChart.type.ts"],"sourcesContent":["import type { Flex } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport type { ScaleLinear } from 'd3-scale';\n\nimport type { BaseChartProps } from './AbstractChart.type';\n\nexport type DataKey = string;\n\nexport type VennChartData = Record<DataKey, number>;\n\nexport type VennChartProps = Intergalactic.InternalTypings.EfficientOmit<\n BaseChartProps<VennChartData>,\n 'showTotalInTooltip'\n> & {\n /** Internal */\n groupKey?: never;\n /** Custom x-axis scale */\n xScale?: ScaleLinear<any, any>;\n /** Custom y-axis scale */\n yScale?: ScaleLinear<any, any>;\n /** Callback triggered when a user clicks on a circle */\n onClickVennItem?: (key: DataKey, e: React.SyntheticEvent) => void;\n};\n\nexport type VennChartType = Intergalactic.Component<typeof Flex, VennChartProps>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
var _AreaChart = require("./AreaChart");
|
|
8
8
|
var _BarChart = require("./BarChart");
|
|
9
9
|
var _BubbleChart = require("./BubbleChart");
|
|
@@ -15,7 +15,7 @@ var _LineChart = require("./LineChart");
|
|
|
15
15
|
var _RadarChart = require("./RadarChart");
|
|
16
16
|
var _ScatterPlotChart = require("./ScatterPlotChart");
|
|
17
17
|
var _VennChart = require("./VennChart");
|
|
18
|
-
var _default = exports
|
|
18
|
+
var _default = exports.default = {
|
|
19
19
|
Line: _LineChart.LineChart,
|
|
20
20
|
Bar: _BarChart.BarChart,
|
|
21
21
|
Histogram: _HistogramChart.HistogramChart,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_AreaChart","require","_BarChart","_BubbleChart","_CigaretteChart","_CompactHorizontalBarChart","_DonutChart","_HistogramChart","_LineChart","_RadarChart","_ScatterPlotChart","_VennChart","_default","exports","Line","LineChart","Bar","BarChart","Histogram","HistogramChart","ScatterPlot","ScatterPlotChart","Area","AreaChart","Bubble","BubbleChart","Donut","DonutChart","Venn","VennChart","Radar","RadarChart","Cigarette","CigaretteChart","CompactHorizontalBar","CompactHorizontalBarChart"],"sources":["../../../../src/component/Chart/index.ts"],"sourcesContent":["import { AreaChart } from './AreaChart';\nimport { BarChart } from './BarChart';\nimport { BubbleChart } from './BubbleChart';\nimport { CigaretteChart } from './CigaretteChart';\nimport { CompactHorizontalBarChart } from './CompactHorizontalBarChart';\nimport { DonutChart } from './DonutChart';\nimport { HistogramChart } from './HistogramChart';\nimport { LineChart } from './LineChart';\nimport { RadarChart } from './RadarChart';\nimport { ScatterPlotChart } from './ScatterPlotChart';\nimport { VennChart } from './VennChart';\n\nexport default {\n Line: LineChart,\n Bar: BarChart,\n Histogram: HistogramChart,\n ScatterPlot: ScatterPlotChart,\n Area: AreaChart,\n Bubble: BubbleChart,\n Donut: DonutChart,\n Venn: VennChart,\n Radar: RadarChart,\n Cigarette: CigaretteChart,\n CompactHorizontalBar: CompactHorizontalBarChart,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,0BAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,iBAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAAwC,IAAAW,QAAA,GAAAC,OAAA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["_AreaChart","require","_BarChart","_BubbleChart","_CigaretteChart","_CompactHorizontalBarChart","_DonutChart","_HistogramChart","_LineChart","_RadarChart","_ScatterPlotChart","_VennChart","_default","exports","default","Line","LineChart","Bar","BarChart","Histogram","HistogramChart","ScatterPlot","ScatterPlotChart","Area","AreaChart","Bubble","BubbleChart","Donut","DonutChart","Venn","VennChart","Radar","RadarChart","Cigarette","CigaretteChart","CompactHorizontalBar","CompactHorizontalBarChart"],"sources":["../../../../src/component/Chart/index.ts"],"sourcesContent":["import { AreaChart } from './AreaChart';\nimport { BarChart } from './BarChart';\nimport { BubbleChart } from './BubbleChart';\nimport { CigaretteChart } from './CigaretteChart';\nimport { CompactHorizontalBarChart } from './CompactHorizontalBarChart';\nimport { DonutChart } from './DonutChart';\nimport { HistogramChart } from './HistogramChart';\nimport { LineChart } from './LineChart';\nimport { RadarChart } from './RadarChart';\nimport { ScatterPlotChart } from './ScatterPlotChart';\nimport { VennChart } from './VennChart';\n\nexport default {\n Line: LineChart,\n Bar: BarChart,\n Histogram: HistogramChart,\n ScatterPlot: ScatterPlotChart,\n Area: AreaChart,\n Bubble: BubbleChart,\n Donut: DonutChart,\n Venn: VennChart,\n Radar: RadarChart,\n Cigarette: CigaretteChart,\n CompactHorizontalBar: CompactHorizontalBarChart,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,0BAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,iBAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAAwC,IAAAW,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEzB;EACbC,IAAI,EAAEC,oBAAS;EACfC,GAAG,EAAEC,kBAAQ;EACbC,SAAS,EAAEC,8BAAc;EACzBC,WAAW,EAAEC,kCAAgB;EAC7BC,IAAI,EAAEC,oBAAS;EACfC,MAAM,EAAEC,wBAAW;EACnBC,KAAK,EAAEC,sBAAU;EACjBC,IAAI,EAAEC,oBAAS;EACfC,KAAK,EAAEC,sBAAU;EACjBC,SAAS,EAAEC,8BAAc;EACzBC,oBAAoB,EAAEC;AACxB,CAAC","ignoreList":[]}
|
|
@@ -1,126 +1,93 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.BaseLegend = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
9
|
var _core = require("@semcore/core");
|
|
15
10
|
var _hints = require("../../a11y/hints");
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
(0,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (shape !== 'Checkbox') return;
|
|
28
|
-
(_this$props$onChangeV = (_this$props = _this.props).onChangeVisibleItem) === null || _this$props$onChangeV === void 0 || _this$props$onChangeV.call(_this$props, id, checked);
|
|
29
|
-
if (checked) {
|
|
30
|
-
var _this$props$onMouseEn, _this$props2;
|
|
31
|
-
(_this$props$onMouseEn = (_this$props2 = _this.props).onMouseEnterItem) === null || _this$props$onMouseEn === void 0 || _this$props$onMouseEn.call(_this$props2, id);
|
|
32
|
-
} else {
|
|
33
|
-
var _this$props$onMouseLe, _this$props3;
|
|
34
|
-
(_this$props$onMouseLe = (_this$props3 = _this.props).onMouseLeaveItem) === null || _this$props$onMouseLe === void 0 || _this$props$onMouseLe.call(_this$props3, id);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
11
|
+
class BaseLegend extends _core.Component {
|
|
12
|
+
constructor(...args) {
|
|
13
|
+
super(...args);
|
|
14
|
+
(0, _defineProperty2.default)(this, "onChangeLegendItem", shape => (id, checked) => {
|
|
15
|
+
if (shape !== 'Checkbox') return;
|
|
16
|
+
this.props.onChangeVisibleItem?.(id, checked);
|
|
17
|
+
if (checked) {
|
|
18
|
+
this.props.onMouseEnterItem?.(id);
|
|
19
|
+
} else {
|
|
20
|
+
this.props.onMouseLeaveItem?.(id);
|
|
21
|
+
}
|
|
37
22
|
});
|
|
38
|
-
(0, _defineProperty2
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return (_this$props$onMouseLe2 = (_this$props4 = _this.props).onMouseLeaveItem) === null || _this$props$onMouseLe2 === void 0 ? void 0 : _this$props$onMouseLe2.call(_this$props4, id);
|
|
44
|
-
}
|
|
45
|
-
(_this$props$onMouseEn2 = (_this$props5 = _this.props).onMouseEnterItem) === null || _this$props$onMouseEn2 === void 0 || _this$props$onMouseEn2.call(_this$props5, id);
|
|
46
|
-
};
|
|
23
|
+
(0, _defineProperty2.default)(this, "onFocusLegendItem", checked => id => {
|
|
24
|
+
if (!checked) {
|
|
25
|
+
return this.props.onMouseLeaveItem?.(id);
|
|
26
|
+
}
|
|
27
|
+
this.props.onMouseEnterItem?.(id);
|
|
47
28
|
});
|
|
48
|
-
(0, _defineProperty2
|
|
49
|
-
|
|
50
|
-
(_this$props$onMouseLe3 = (_this$props6 = _this.props).onMouseLeaveItem) === null || _this$props$onMouseLe3 === void 0 || _this$props$onMouseLe3.call(_this$props6, id);
|
|
29
|
+
(0, _defineProperty2.default)(this, "onBlurLegendItem", id => {
|
|
30
|
+
this.props.onMouseLeaveItem?.(id);
|
|
51
31
|
});
|
|
52
|
-
(0, _defineProperty2
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
(_this$props$onMouseEn3 = (_this$props7 = _this.props).onMouseEnterItem) === null || _this$props$onMouseEn3 === void 0 || _this$props$onMouseEn3.call(_this$props7, id, e);
|
|
32
|
+
(0, _defineProperty2.default)(this, "bindOnMouseEnterItem", id => {
|
|
33
|
+
return e => {
|
|
34
|
+
this.props.onMouseEnterItem?.(id, e);
|
|
56
35
|
};
|
|
57
36
|
});
|
|
58
|
-
(0, _defineProperty2
|
|
59
|
-
return
|
|
60
|
-
|
|
61
|
-
(_this$props$onMouseLe4 = (_this$props8 = _this.props).onMouseLeaveItem) === null || _this$props$onMouseLe4 === void 0 || _this$props$onMouseLe4.call(_this$props8, id, e);
|
|
37
|
+
(0, _defineProperty2.default)(this, "bindOnMouseLeaveItem", id => {
|
|
38
|
+
return e => {
|
|
39
|
+
this.props.onMouseLeaveItem?.(id, e);
|
|
62
40
|
};
|
|
63
41
|
});
|
|
64
|
-
return _this;
|
|
65
42
|
}
|
|
66
|
-
(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
43
|
+
componentDidMount() {
|
|
44
|
+
this.setHints();
|
|
45
|
+
}
|
|
46
|
+
componentDidUpdate(prevProps) {
|
|
47
|
+
if (prevProps.items !== this.props.items || prevProps.dataHints !== this.props.dataHints) {
|
|
70
48
|
this.setHints();
|
|
71
49
|
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
dataHintsHandler === null || dataHintsHandler === void 0 || dataHintsHandler.labelKey('value', legendItem.id, legendItem.label);
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
}, {
|
|
91
|
-
key: "getItem",
|
|
92
|
-
value: function getItem(index) {
|
|
93
|
-
var line = this.asProps.items[index];
|
|
94
|
-
if (line === undefined) {
|
|
95
|
-
throw new Error("No index \"".concat(index, "\" in lines"));
|
|
96
|
-
}
|
|
97
|
-
return line;
|
|
98
|
-
}
|
|
99
|
-
}, {
|
|
100
|
-
key: "getLegendItemProps",
|
|
101
|
-
value: function getLegendItemProps(_, index) {
|
|
102
|
-
var _this$asProps2 = this.asProps,
|
|
103
|
-
_this$asProps2$shape = _this$asProps2.shape,
|
|
104
|
-
shape = _this$asProps2$shape === void 0 ? 'Checkbox' : _this$asProps2$shape,
|
|
105
|
-
_this$asProps2$size = _this$asProps2.size,
|
|
106
|
-
size = _this$asProps2$size === void 0 ? 'm' : _this$asProps2$size,
|
|
107
|
-
patterns = _this$asProps2.patterns;
|
|
108
|
-
var line = this.getItem(index);
|
|
109
|
-
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, line), {}, {
|
|
110
|
-
shape: shape,
|
|
111
|
-
size: size,
|
|
112
|
-
onFocusLegendItem: this.onFocusLegendItem(line.checked),
|
|
113
|
-
onBlurLegendItem: this.onBlurLegendItem,
|
|
114
|
-
onChangeLegendItem: this.onChangeLegendItem(shape),
|
|
115
|
-
onMouseEnter: line.checked ? this.bindOnMouseEnterItem(line.id) : undefined,
|
|
116
|
-
onMouseLeave: this.bindOnMouseLeaveItem(line.id),
|
|
117
|
-
style: {
|
|
118
|
-
gridRowStart: "".concat(index + 1),
|
|
119
|
-
gridRowEnd: "".concat(index + 2)
|
|
120
|
-
},
|
|
121
|
-
patterns: patterns
|
|
122
|
-
});
|
|
50
|
+
}
|
|
51
|
+
setHints() {
|
|
52
|
+
const {
|
|
53
|
+
items,
|
|
54
|
+
dataHints
|
|
55
|
+
} = this.asProps;
|
|
56
|
+
const dataHintsHandler = dataHints ? (0, _hints.makeDataHintsHandlers)(dataHints) : undefined;
|
|
57
|
+
items.forEach(legendItem => {
|
|
58
|
+
dataHintsHandler?.labelKey('value', legendItem.id, legendItem.label);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
getItem(index) {
|
|
62
|
+
const line = this.asProps.items[index];
|
|
63
|
+
if (line === undefined) {
|
|
64
|
+
throw new Error(`No index "${index}" in lines`);
|
|
123
65
|
}
|
|
124
|
-
|
|
125
|
-
}
|
|
66
|
+
return line;
|
|
67
|
+
}
|
|
68
|
+
getLegendItemProps(_, index) {
|
|
69
|
+
const {
|
|
70
|
+
shape = 'Checkbox',
|
|
71
|
+
size = 'm',
|
|
72
|
+
patterns
|
|
73
|
+
} = this.asProps;
|
|
74
|
+
const line = this.getItem(index);
|
|
75
|
+
return {
|
|
76
|
+
...line,
|
|
77
|
+
shape,
|
|
78
|
+
size,
|
|
79
|
+
onFocusLegendItem: this.onFocusLegendItem(line.checked),
|
|
80
|
+
onBlurLegendItem: this.onBlurLegendItem,
|
|
81
|
+
onChangeLegendItem: this.onChangeLegendItem(shape),
|
|
82
|
+
onMouseEnter: line.checked ? this.bindOnMouseEnterItem(line.id) : undefined,
|
|
83
|
+
onMouseLeave: this.bindOnMouseLeaveItem(line.id),
|
|
84
|
+
style: {
|
|
85
|
+
gridRowStart: `${index + 1}`,
|
|
86
|
+
gridRowEnd: `${index + 2}`
|
|
87
|
+
},
|
|
88
|
+
patterns
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.BaseLegend = BaseLegend;
|
|
126
93
|
//# sourceMappingURL=BaseLegend.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseLegend.js","names":["_core","require","_hints","BaseLegend","
|
|
1
|
+
{"version":3,"file":"BaseLegend.js","names":["_core","require","_hints","BaseLegend","Component","constructor","args","_defineProperty2","default","shape","id","checked","props","onChangeVisibleItem","onMouseEnterItem","onMouseLeaveItem","e","componentDidMount","setHints","componentDidUpdate","prevProps","items","dataHints","asProps","dataHintsHandler","makeDataHintsHandlers","undefined","forEach","legendItem","labelKey","label","getItem","index","line","Error","getLegendItemProps","_","size","patterns","onFocusLegendItem","onBlurLegendItem","onChangeLegendItem","onMouseEnter","bindOnMouseEnterItem","onMouseLeave","bindOnMouseLeaveItem","style","gridRowStart","gridRowEnd","exports"],"sources":["../../../../src/component/ChartLegend/BaseLegend.tsx"],"sourcesContent":["import { Component, type Intergalactic } from '@semcore/core';\nimport type React from 'react';\n\nimport type { LegendProps } from './BaseLegend.type';\nimport { StaticShapes, type LegendItemKey, type LegendItemProps, type ShapeType } from './LegendItem/LegendItem.type';\nimport { makeDataHintsHandlers } from '../../a11y/hints';\n\nexport abstract class BaseLegend<T extends LegendProps, E extends readonly ((...args: any[]) => any)[] = never[]> extends Component<T, E> {\n componentDidMount() {\n this.setHints();\n }\n\n componentDidUpdate(prevProps: T) {\n if (prevProps.items !== this.props.items || prevProps.dataHints !== this.props.dataHints) {\n this.setHints();\n }\n }\n\n setHints() {\n const { items, dataHints } = this.asProps;\n const dataHintsHandler = dataHints ? makeDataHintsHandlers(dataHints) : undefined;\n\n items.forEach((legendItem) => {\n dataHintsHandler?.labelKey('value', legendItem.id, legendItem.label);\n });\n }\n\n getItem(index: number) {\n const line = this.asProps.items[index];\n\n if (line === undefined) {\n throw new Error(`No index \"${index}\" in lines`);\n }\n\n return line;\n }\n\n getLegendItemProps(\n _: {},\n index: number,\n ): LegendItemProps & Intergalactic.InternalTypings.ComponentPropsNesting<'div'> {\n const { shape = 'Checkbox', size = 'm', patterns } = this.asProps;\n const line = this.getItem(index);\n\n return {\n ...line,\n shape,\n size,\n onFocusLegendItem: this.onFocusLegendItem(line.checked),\n onBlurLegendItem: this.onBlurLegendItem,\n onChangeLegendItem: this.onChangeLegendItem(shape),\n onMouseEnter: line.checked ? this.bindOnMouseEnterItem(line.id) : undefined,\n onMouseLeave: this.bindOnMouseLeaveItem(line.id),\n style: { gridRowStart: `${index + 1}`, gridRowEnd: `${index + 2}` },\n patterns,\n };\n }\n\n onChangeLegendItem = (shape: ShapeType) => (id: LegendItemKey, checked: boolean) => {\n if (shape !== 'Checkbox') return;\n\n this.props.onChangeVisibleItem?.(id, checked);\n\n if (checked) {\n this.props.onMouseEnterItem?.(id);\n } else {\n this.props.onMouseLeaveItem?.(id);\n }\n };\n\n onFocusLegendItem = (checked: boolean) => (id: LegendItemKey) => {\n if (!checked) {\n return this.props.onMouseLeaveItem?.(id);\n }\n\n this.props.onMouseEnterItem?.(id);\n };\n\n onBlurLegendItem = (id: LegendItemKey) => {\n this.props.onMouseLeaveItem?.(id);\n };\n\n bindOnMouseEnterItem = (id: LegendItemKey) => {\n return (e: React.SyntheticEvent) => {\n this.props.onMouseEnterItem?.(id, e);\n };\n };\n\n bindOnMouseLeaveItem = (id: LegendItemKey) => {\n return (e: React.SyntheticEvent) => {\n this.props.onMouseLeaveItem?.(id, e);\n };\n };\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AAEO,MAAeE,UAAU,SAA0FC,eAAS,CAAO;EAAAC,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,8BAmDlHC,KAAgB,IAAK,CAACC,EAAiB,EAAEC,OAAgB,KAAK;MAClF,IAAIF,KAAK,KAAK,UAAU,EAAE;MAE1B,IAAI,CAACG,KAAK,CAACC,mBAAmB,GAAGH,EAAE,EAAEC,OAAO,CAAC;MAE7C,IAAIA,OAAO,EAAE;QACX,IAAI,CAACC,KAAK,CAACE,gBAAgB,GAAGJ,EAAE,CAAC;MACnC,CAAC,MAAM;QACL,IAAI,CAACE,KAAK,CAACG,gBAAgB,GAAGL,EAAE,CAAC;MACnC;IACF,CAAC;IAAA,IAAAH,gBAAA,CAAAC,OAAA,6BAEoBG,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3,"file":"BaseLegend.type.js","names":[],"sources":["../../../../src/component/ChartLegend/BaseLegend.type.ts"],"sourcesContent":["import type { BoxProps, FlexProps } from '@semcore/
|
|
1
|
+
{"version":3,"file":"BaseLegend.type.js","names":[],"sources":["../../../../src/component/ChartLegend/BaseLegend.type.ts"],"sourcesContent":["import type { BoxProps, FlexProps } from '@semcore/base-components';\n\nimport type { LegendItem, LegendItemKey, ShapeType } from './LegendItem/LegendItem.type';\nimport type { DataStructureHints } from '../../a11y/hints';\nimport type { PatternsConfig } from '../../Pattern';\nimport type { AriaNameProps } from '../Chart/AbstractChart.type';\n\nexport type LSize = 'm' | 'l';\n\nexport type BaseChartLegendProps = FlexProps &\n AriaNameProps & {\n /**\n * Size for legend items\n */\n size?: LSize;\n /**\n * Shape of data item on Legend panel\n */\n shape?: ShapeType;\n /**\n * Handler for change visible for data items. Doesn't work if Shape one of 'Circle' | 'Line' | 'Square'\n */\n onChangeVisibleItem?: (key: LegendItemKey, isVisible: boolean) => void;\n\n onMouseEnterItem?: (key: LegendItemKey, e?: React.SyntheticEvent) => void;\n\n onMouseLeaveItem?: (key: LegendItemKey, e?: React.SyntheticEvent) => void;\n\n dataHints?: DataStructureHints;\n };\n\nexport type LegendProps = BoxProps &\n BaseChartLegendProps & {\n /**\n * Legend items\n */\n items: LegendItem[];\n\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n };\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,93 +1,81 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.LegendFlex = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
9
|
var _core = require("@semcore/core");
|
|
10
|
+
var _baseComponents = require("@semcore/base-components");
|
|
15
11
|
var _checkbox = _interopRequireDefault(require("@semcore/checkbox"));
|
|
16
12
|
var _i18nEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/i18nEnhance"));
|
|
17
13
|
var _divider = _interopRequireDefault(require("@semcore/divider"));
|
|
18
|
-
var _flexBox = require("@semcore/flex-box");
|
|
19
14
|
var _react = _interopRequireDefault(require("react"));
|
|
20
15
|
var _intergalacticDynamicLocales = require("../../../translations/__intergalactic-dynamic-locales");
|
|
21
|
-
var
|
|
16
|
+
var _BaseLegend = require("../BaseLegend");
|
|
22
17
|
var _LegendItem = require("../LegendItem/LegendItem");
|
|
23
18
|
/*!__reshadow-styles__:"./legend-flex.shadow.css"*/
|
|
24
|
-
|
|
19
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SLegendFlex_ftcim_gg_._direction_row_ftcim_gg_{align-items:flex-start;align-content:flex-start;flex-wrap:wrap;gap:8px 16px}.___SLegendFlex_ftcim_gg_._direction_column_ftcim_gg_{align-items:flex-start;flex-wrap:wrap;gap:8px}", /*__inner_css_end__*/"ftcim_gg_"),
|
|
25
20
|
/*__reshadow_css_end__*/
|
|
26
21
|
{
|
|
27
|
-
"__SLegendFlex": "
|
|
28
|
-
"_direction_row": "
|
|
29
|
-
"_direction_column": "
|
|
22
|
+
"__SLegendFlex": "___SLegendFlex_ftcim_gg_",
|
|
23
|
+
"_direction_row": "_direction_row_ftcim_gg_",
|
|
24
|
+
"_direction_column": "_direction_column_ftcim_gg_"
|
|
30
25
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
class LegendFlexRoot extends _BaseLegend.BaseLegend {
|
|
27
|
+
renderTrend() {
|
|
28
|
+
const {
|
|
29
|
+
onTrendIsVisibleChange,
|
|
30
|
+
trendIsVisible,
|
|
31
|
+
trendLabel,
|
|
32
|
+
size,
|
|
33
|
+
getI18nText
|
|
34
|
+
} = this.asProps;
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement(_checkbox.default, {
|
|
36
|
+
checked: trendIsVisible,
|
|
37
|
+
onChange: onTrendIsVisibleChange,
|
|
38
|
+
theme: "gray-400",
|
|
39
|
+
label: trendLabel ?? getI18nText('trend'),
|
|
40
|
+
size: size
|
|
41
|
+
});
|
|
35
42
|
}
|
|
36
|
-
(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
size: size
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}, {
|
|
55
|
-
key: "render",
|
|
56
|
-
value: function render() {
|
|
57
|
-
var _ref = this.asProps,
|
|
58
|
-
_ref2;
|
|
59
|
-
var SLegendFlex = _flexBox.Flex;
|
|
60
|
-
var _this$asProps = this.asProps,
|
|
61
|
-
styles = _this$asProps.styles,
|
|
62
|
-
Children = _this$asProps.Children,
|
|
63
|
-
direction = _this$asProps.direction,
|
|
64
|
-
withTrend = _this$asProps.withTrend,
|
|
65
|
-
suffix = _this$asProps.suffix,
|
|
66
|
-
items = _this$asProps.items;
|
|
67
|
-
var orientation = direction === 'row' ? 'vertical' : 'horizontal';
|
|
68
|
-
return _ref2 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SLegendFlex, _ref2.cn("SLegendFlex", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
43
|
+
render() {
|
|
44
|
+
var _ref = this.asProps,
|
|
45
|
+
_ref2;
|
|
46
|
+
const SLegendFlex = _baseComponents.Flex;
|
|
47
|
+
const {
|
|
48
|
+
styles,
|
|
49
|
+
Children,
|
|
50
|
+
direction,
|
|
51
|
+
withTrend,
|
|
52
|
+
suffix,
|
|
53
|
+
items
|
|
54
|
+
} = this.asProps;
|
|
55
|
+
const orientation = direction === 'row' ? 'vertical' : 'horizontal';
|
|
56
|
+
return _ref2 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(SLegendFlex, _ref2.cn("SLegendFlex", {
|
|
57
|
+
...(0, _core.assignProps)({
|
|
69
58
|
"role": 'group'
|
|
70
|
-
}, _ref)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
(0, _defineProperty2
|
|
83
|
-
(0, _defineProperty2
|
|
84
|
-
(0, _defineProperty2
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
var LegendFlex = exports.LegendFlex = (0, _core.createComponent)(LegendFlexRoot, {
|
|
59
|
+
}, _ref)
|
|
60
|
+
}), items.map(({
|
|
61
|
+
id
|
|
62
|
+
}) => {
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement(Children, {
|
|
64
|
+
key: id
|
|
65
|
+
});
|
|
66
|
+
}), (withTrend || suffix) && /*#__PURE__*/_react.default.createElement(_divider.default, _ref2.cn("Divider", {
|
|
67
|
+
"orientation": orientation
|
|
68
|
+
})), withTrend && this.renderTrend(), suffix ? suffix : null);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
(0, _defineProperty2.default)(LegendFlexRoot, "displayName", 'LegendFlex');
|
|
72
|
+
(0, _defineProperty2.default)(LegendFlexRoot, "style", style);
|
|
73
|
+
(0, _defineProperty2.default)(LegendFlexRoot, "enhance", [(0, _i18nEnhance.default)(_intergalacticDynamicLocales.localizedMessages)]);
|
|
74
|
+
(0, _defineProperty2.default)(LegendFlexRoot, "defaultProps", () => ({
|
|
75
|
+
direction: 'row',
|
|
76
|
+
children: /*#__PURE__*/_react.default.createElement(LegendFlex.LegendItem, null)
|
|
77
|
+
}));
|
|
78
|
+
const LegendFlex = exports.LegendFlex = (0, _core.createComponent)(LegendFlexRoot, {
|
|
91
79
|
LegendItem: _LegendItem.LegendItemComponent
|
|
92
80
|
});
|
|
93
81
|
//# sourceMappingURL=LegendFlex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendFlex.js","names":["_core","require","_checkbox","_interopRequireDefault","_i18nEnhance","_divider","
|
|
1
|
+
{"version":3,"file":"LegendFlex.js","names":["_core","require","_baseComponents","_checkbox","_interopRequireDefault","_i18nEnhance","_divider","_react","_intergalacticDynamicLocales","_BaseLegend","_LegendItem","style","sstyled","insert","LegendFlexRoot","BaseLegend","renderTrend","onTrendIsVisibleChange","trendIsVisible","trendLabel","size","getI18nText","asProps","default","createElement","checked","onChange","theme","label","render","_ref","_ref2","SLegendFlex","Flex","styles","Children","direction","withTrend","suffix","items","orientation","cn","assignProps","map","id","key","_defineProperty2","i18nEnhance","localizedMessages","children","LegendFlex","LegendItem","exports","createComponent","LegendItemComponent"],"sources":["../../../../../src/component/ChartLegend/LegendFlex/LegendFlex.tsx"],"sourcesContent":["import { Flex } from '@semcore/base-components';\nimport Checkbox from '@semcore/checkbox';\nimport { createComponent, sstyled, Root } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport Divider from '@semcore/divider';\nimport React from 'react';\n\nimport style from './legend-flex.shadow.css';\nimport type { LegendFlexType, LegendFlexProps, TrendProps } from './LegendFlex.type';\nimport { localizedMessages } from '../../../translations/__intergalactic-dynamic-locales';\nimport { BaseLegend } from '../BaseLegend';\nimport { LegendItemComponent } from '../LegendItem/LegendItem';\n\nclass LegendFlexRoot extends BaseLegend<LegendFlexProps, typeof LegendFlexRoot.enhance> {\n static displayName = 'LegendFlex';\n static style = style;\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n static defaultProps = () => ({\n direction: 'row',\n children: <LegendFlex.LegendItem />,\n });\n\n renderTrend() {\n const { onTrendIsVisibleChange, trendIsVisible, trendLabel, size, getI18nText } = this\n .asProps as unknown as TrendProps & LegendFlexProps & { getI18nText: (s: string) => string };\n\n return (\n <Checkbox\n checked={trendIsVisible}\n onChange={onTrendIsVisibleChange}\n theme='gray-400'\n label={trendLabel ?? getI18nText('trend')}\n size={size}\n />\n );\n }\n\n render() {\n const SLegendFlex = Root;\n const { styles, Children, direction, withTrend, suffix, items } = this.asProps;\n const orientation = direction === 'row' ? 'vertical' : 'horizontal';\n\n return sstyled(styles)(\n <SLegendFlex render={Flex} role='group'>\n {items.map(({ id }) => {\n return <Children key={id} />;\n })}\n {(withTrend || suffix) && <Divider orientation={orientation} />}\n {withTrend && this.renderTrend()}\n {suffix ? suffix : null}\n </SLegendFlex>,\n );\n }\n}\n\nexport const LegendFlex = createComponent(LegendFlexRoot, {\n LegendItem: LegendItemComponent,\n}) as LegendFlexType;\n"],"mappings":";;;;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAFA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,YAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,QAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,MAAA,GAAAH,sBAAA,CAAAH,OAAA;AAIA,IAAAO,4BAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAA+D;AAAA,MAAAU,KA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,SAAS,IAAIC,MAAM,kBAAK/B,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAAClB,QAAA,CAAAiB,OAAO,EAAAQ,KAAA,CAAAU,EAAA;MAAA,eAAcD;IAAW,EAAG,CAAC,EAC9DH,SAAS,IAAI,IAAI,CAACrB,WAAW,CAAC,CAAC,EAC/BsB,MAAM,GAAGA,MAAM,GAAG,IACR,CAAC;EAElB;AACF;AAAC,IAAAQ,gBAAA,CAAAvB,OAAA,EA1CKT,cAAc,iBACG,YAAY;AAAA,IAAAgC,gBAAA,CAAAvB,OAAA,EAD7BT,cAAc,WAEHH,KAAK;AAAA,IAAAmC,gBAAA,CAAAvB,OAAA,EAFhBT,cAAc,aAID,CAAC,IAAAiC,oBAAW,EAACC,8CAAiB,CAAC,CAAC;AAAA,IAAAF,gBAAA,CAAAvB,OAAA,EAJ7CT,cAAc,kBAMI,OAAO;EAC3BsB,SAAS,EAAE,KAAK;EAChBa,QAAQ,eAAE1C,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAAC0B,UAAU,CAACC,UAAU,MAAE;AACpC,CAAC,CAAC;AAmCG,MAAMD,UAAU,GAAAE,OAAA,CAAAF,UAAA,GAAG,IAAAG,qBAAe,EAACvC,cAAc,EAAE;EACxDqC,UAAU,EAAEG;AACd,CAAC,CAAmB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendFlex.type.js","names":[],"sources":["../../../../../src/component/ChartLegend/LegendFlex/LegendFlex.type.ts"],"sourcesContent":["import type {
|
|
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":[]}
|