@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.
- package/lib/cjs/Area.js +11 -11
- package/lib/cjs/Axis.js +18 -16
- package/lib/cjs/Axis.js.map +1 -1
- package/lib/cjs/Bar.js +16 -16
- package/lib/cjs/Bubble.js +14 -14
- package/lib/cjs/CompactHorizontalBar.js +20 -20
- package/lib/cjs/CompactHorizontalBar.js.map +1 -1
- package/lib/cjs/Donut.js +9 -9
- package/lib/cjs/Dots.js +8 -8
- package/lib/cjs/HorizontalBar.js +17 -17
- package/lib/cjs/HorizontalBar.js.map +1 -1
- package/lib/cjs/Hover.js +3 -3
- package/lib/cjs/Line.js +9 -9
- package/lib/cjs/Plot.js +6 -9
- package/lib/cjs/Plot.js.map +1 -1
- package/lib/cjs/Radar.js +19 -19
- package/lib/cjs/RadialTree.js +12 -12
- package/lib/cjs/RadialTree.js.map +1 -1
- package/lib/cjs/Reference.js +12 -12
- package/lib/cjs/ResponsiveContainer.js +2 -2
- package/lib/cjs/ResponsiveContainer.js.map +1 -1
- package/lib/cjs/ScatterPlot.js +9 -9
- package/lib/cjs/StackBar.js +3 -8
- package/lib/cjs/StackBar.js.map +1 -1
- package/lib/cjs/Tooltip.js +18 -19
- package/lib/cjs/Tooltip.js.map +1 -1
- package/lib/cjs/Venn.js +12 -12
- package/lib/cjs/Venn.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yModule.js +37 -79
- package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yView.js +39 -12
- package/lib/cjs/a11y/PlotA11yView.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/component/Chart/AbstractChart.js +9 -9
- 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.map +1 -1
- package/lib/cjs/component/Chart/AreaChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/BarChart.js +66 -19
- 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.type.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.js +8 -8
- package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.js +2 -2
- 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.type.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/VennChart.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/BaseLegend.js +1 -1
- 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 +6 -6
- 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 +23 -23
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +9 -9
- 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/Cigarette/Cigarette.js.map +1 -1
- package/lib/cjs/style/axis.shadow.css +3 -1
- 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/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/utils.js.map +1 -1
- package/lib/es6/Area.js +11 -11
- package/lib/es6/Axis.js +18 -16
- package/lib/es6/Axis.js.map +1 -1
- package/lib/es6/Bar.js +16 -16
- package/lib/es6/Bubble.js +14 -14
- package/lib/es6/CompactHorizontalBar.js +17 -17
- package/lib/es6/CompactHorizontalBar.js.map +1 -1
- package/lib/es6/Donut.js +9 -9
- package/lib/es6/Dots.js +8 -8
- package/lib/es6/HorizontalBar.js +17 -17
- package/lib/es6/HorizontalBar.js.map +1 -1
- package/lib/es6/Hover.js +3 -3
- package/lib/es6/Line.js +9 -9
- package/lib/es6/Plot.js +5 -8
- package/lib/es6/Plot.js.map +1 -1
- package/lib/es6/Radar.js +19 -19
- package/lib/es6/RadialTree.js +12 -12
- package/lib/es6/RadialTree.js.map +1 -1
- package/lib/es6/Reference.js +12 -12
- package/lib/es6/ResponsiveContainer.js +1 -1
- package/lib/es6/ResponsiveContainer.js.map +1 -1
- package/lib/es6/ScatterPlot.js +9 -9
- package/lib/es6/StackBar.js +3 -8
- package/lib/es6/StackBar.js.map +1 -1
- package/lib/es6/Tooltip.js +10 -11
- package/lib/es6/Tooltip.js.map +1 -1
- package/lib/es6/Venn.js +10 -10
- package/lib/es6/Venn.js.map +1 -1
- package/lib/es6/a11y/PlotA11yModule.js +36 -80
- package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
- package/lib/es6/a11y/PlotA11yView.js +37 -10
- package/lib/es6/a11y/PlotA11yView.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/component/Chart/AbstractChart.js +5 -5
- 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.map +1 -1
- package/lib/es6/component/Chart/AreaChart.type.js.map +1 -1
- package/lib/es6/component/Chart/BarChart.js +67 -20
- 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.type.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.js +1 -1
- package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.js +1 -1
- 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.type.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
- package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/BaseLegend.js +1 -1
- 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 +5 -5
- 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 +18 -18
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +7 -7
- 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.map +1 -1
- package/lib/es6/style/axis.shadow.css +3 -1
- 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/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.map +1 -1
- package/lib/esm/AnimatedClipPath.mjs +2 -7
- package/lib/esm/Area.mjs +14 -14
- package/lib/esm/Axis.mjs +21 -19
- package/lib/esm/Bar.mjs +17 -17
- package/lib/esm/Bubble.mjs +16 -16
- package/lib/esm/CompactHorizontalBar.mjs +20 -19
- package/lib/esm/Donut.mjs +15 -13
- package/lib/esm/Dots.mjs +10 -10
- package/lib/esm/HorizontalBar.mjs +18 -18
- package/lib/esm/Hover.mjs +6 -6
- package/lib/esm/Line.mjs +12 -12
- package/lib/esm/Plot.mjs +7 -10
- package/lib/esm/Radar.mjs +23 -23
- package/lib/esm/RadialTree.mjs +13 -13
- package/lib/esm/Reference.mjs +13 -13
- package/lib/esm/ResponsiveContainer.mjs +2 -2
- package/lib/esm/ScatterPlot.mjs +12 -11
- package/lib/esm/StackBar.mjs +4 -9
- package/lib/esm/StackedArea.mjs +2 -2
- package/lib/esm/Tooltip.mjs +13 -16
- package/lib/esm/Venn.mjs +13 -12
- package/lib/esm/a11y/PlotA11yModule.mjs +31 -69
- package/lib/esm/a11y/PlotA11yView.mjs +35 -10
- package/lib/esm/a11y/insights.mjs +2 -1
- package/lib/esm/a11y/intl.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/component/Chart/AbstractChart.mjs +12 -10
- package/lib/esm/component/Chart/AreaChart.mjs +5 -4
- package/lib/esm/component/Chart/BarChart.mjs +44 -3
- package/lib/esm/component/Chart/BubbleChart.mjs +3 -2
- package/lib/esm/component/Chart/CigaretteChart.mjs +6 -5
- package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +2 -1
- package/lib/esm/component/Chart/DonutChart.mjs +3 -2
- package/lib/esm/component/Chart/HistogramChart.mjs +5 -4
- package/lib/esm/component/Chart/LineChart.mjs +4 -3
- package/lib/esm/component/Chart/RadarChart.mjs +2 -1
- package/lib/esm/component/Chart/ScatterPlotChart.mjs +3 -2
- package/lib/esm/component/Chart/VennChart.mjs +2 -1
- package/lib/esm/component/ChartLegend/BaseLegend.mjs +1 -1
- package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +7 -7
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +21 -25
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +9 -9
- package/lib/esm/component/ChartLegend/index.mjs +2 -0
- package/lib/esm/component/StackGroupBar/StackGroupBar.mjs +1 -1
- package/lib/esm/createElement.mjs +2 -4
- package/lib/esm/index.mjs +1 -0
- package/lib/esm/style/axis.shadow.css +3 -1
- 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/utils.mjs +2 -2
- 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 +13 -2
- 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 +19 -19
|
@@ -13,10 +13,10 @@ var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSup
|
|
|
13
13
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _core = require("@semcore/core");
|
|
16
|
+
var _baseComponents = require("@semcore/base-components");
|
|
16
17
|
var _checkbox = _interopRequireDefault(require("@semcore/checkbox"));
|
|
17
18
|
var _resolveColorEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/resolveColorEnhance"));
|
|
18
19
|
var _uniqueID = _interopRequireDefault(require("@semcore/core/lib/utils/uniqueID"));
|
|
19
|
-
var _flexBox = require("@semcore/flex-box");
|
|
20
20
|
var _typography = require("@semcore/typography");
|
|
21
21
|
var _react = _interopRequireDefault(require("react"));
|
|
22
22
|
var _LegendItem = require("./LegendItem.type");
|
|
@@ -24,25 +24,25 @@ var _Pattern = require("../../../Pattern");
|
|
|
24
24
|
var _utils = require("../../../utils");
|
|
25
25
|
var _excluded = ["id", "checked", "color", "onChangeLegendItem", "shape"];
|
|
26
26
|
/*!__reshadow-styles__:"./legend-item.shadow.css"*/
|
|
27
|
-
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
27
|
+
var style = (/*__reshadow_css_start__*/_core.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_"),
|
|
28
28
|
/*__reshadow_css_end__*/
|
|
29
29
|
{
|
|
30
|
-
"__SLegendItem": "
|
|
31
|
-
"_disabled": "
|
|
32
|
-
"__SPointShape": "
|
|
33
|
-
"_color": "
|
|
34
|
-
"--color": "--
|
|
35
|
-
"_shape_Circle": "
|
|
36
|
-
"_size_l": "
|
|
37
|
-
"_size_m": "
|
|
38
|
-
"_shape_Line": "
|
|
39
|
-
"_shape_Square": "
|
|
40
|
-
"_shape_Pattern": "
|
|
41
|
-
"__SIcon": "
|
|
42
|
-
"__SLabel": "
|
|
43
|
-
"__SAdditionalLabel": "
|
|
44
|
-
"__SCount": "
|
|
45
|
-
"__SPatternSymbol": "
|
|
30
|
+
"__SLegendItem": "___SLegendItem_1v96z_gg_",
|
|
31
|
+
"_disabled": "__disabled_1v96z_gg_",
|
|
32
|
+
"__SPointShape": "___SPointShape_1v96z_gg_",
|
|
33
|
+
"_color": "__color_1v96z_gg_",
|
|
34
|
+
"--color": "--color_1v96z",
|
|
35
|
+
"_shape_Circle": "_shape_Circle_1v96z_gg_",
|
|
36
|
+
"_size_l": "_size_l_1v96z_gg_",
|
|
37
|
+
"_size_m": "_size_m_1v96z_gg_",
|
|
38
|
+
"_shape_Line": "_shape_Line_1v96z_gg_",
|
|
39
|
+
"_shape_Square": "_shape_Square_1v96z_gg_",
|
|
40
|
+
"_shape_Pattern": "_shape_Pattern_1v96z_gg_",
|
|
41
|
+
"__SIcon": "___SIcon_1v96z_gg_",
|
|
42
|
+
"__SLabel": "___SLabel_1v96z_gg_",
|
|
43
|
+
"__SAdditionalLabel": "___SAdditionalLabel_1v96z_gg_",
|
|
44
|
+
"__SCount": "___SCount_1v96z_gg_",
|
|
45
|
+
"__SPatternSymbol": "___SPatternSymbol_1v96z_gg_"
|
|
46
46
|
});
|
|
47
47
|
var enhance = [(0, _resolveColorEnhance["default"])(), (0, _uniqueID["default"])()];
|
|
48
48
|
var LegendItemRoot = /*#__PURE__*/function (_Component) {
|
|
@@ -157,7 +157,7 @@ var LegendItemRoot = /*#__PURE__*/function (_Component) {
|
|
|
157
157
|
value: function render() {
|
|
158
158
|
var _ref = this.asProps,
|
|
159
159
|
_ref7;
|
|
160
|
-
var SLegendItem =
|
|
160
|
+
var SLegendItem = _baseComponents.Flex;
|
|
161
161
|
var _this$asProps3 = this.asProps,
|
|
162
162
|
styles = _this$asProps3.styles,
|
|
163
163
|
Children = _this$asProps3.Children,
|
|
@@ -183,7 +183,7 @@ var LegendItemRoot = /*#__PURE__*/function (_Component) {
|
|
|
183
183
|
function Shape(props) {
|
|
184
184
|
var _ref2 = arguments[0],
|
|
185
185
|
_ref0;
|
|
186
|
-
var SPointShape =
|
|
186
|
+
var SPointShape = _baseComponents.Box;
|
|
187
187
|
var SPatternSymbol = _Pattern.PatternSymbol;
|
|
188
188
|
var styles = props.styles,
|
|
189
189
|
size = props.size,
|
|
@@ -203,7 +203,7 @@ function Shape(props) {
|
|
|
203
203
|
}
|
|
204
204
|
if (shape === 'Pattern') {
|
|
205
205
|
var _ref8;
|
|
206
|
-
return _ref8 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(
|
|
206
|
+
return _ref8 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(_baseComponents.Box, _ref8.cn("Box", {
|
|
207
207
|
"mr": 1
|
|
208
208
|
}), /*#__PURE__*/_react["default"].createElement(SPatternSymbol, _ref8.cn("SPatternSymbol", {
|
|
209
209
|
"color": color,
|
|
@@ -221,7 +221,7 @@ function Shape(props) {
|
|
|
221
221
|
"onFocus": onFocus,
|
|
222
222
|
"onBlur": onBlur,
|
|
223
223
|
"aria-labelledby": props['aria-labelledby']
|
|
224
|
-
})), patterns && /*#__PURE__*/_react["default"].createElement(
|
|
224
|
+
})), patterns && /*#__PURE__*/_react["default"].createElement(_baseComponents.Box, _ref9.cn("Box", {
|
|
225
225
|
"mt": '2px',
|
|
226
226
|
"mr": 1,
|
|
227
227
|
"onClick": function onClick() {
|
|
@@ -241,7 +241,7 @@ function Icon(_ref13) {
|
|
|
241
241
|
var styles = _ref13.styles,
|
|
242
242
|
hasChildren = _ref13.children,
|
|
243
243
|
Children = _ref13.Children;
|
|
244
|
-
var SIcon =
|
|
244
|
+
var SIcon = _baseComponents.Box;
|
|
245
245
|
if (!hasChildren) {
|
|
246
246
|
return null;
|
|
247
247
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendItem.js","names":["_core","require","_checkbox","_interopRequireDefault","_resolveColorEnhance","_uniqueID","_flexBox","_typography","_react","_LegendItem","_Pattern","_utils","_excluded","style","sstyled","insert","enhance","resolveColorEnhance","uniqueIDEnhancement","LegendItemRoot","_Component","_classCallCheck2","_callSuper2","arguments","_inherits2","_createClass2","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","_objectSpread2","children","icon","onClick","getLabelProps","_this$asProps2","_color","_shape","_objectWithoutProperties2","getAdditionalLabelProps","additionalInfo","undefined","getCountProps","count","render","_ref","_ref7","SLegendItem","Flex","_this$asProps3","styles","Children","disabled","StaticShapes","includes","createElement","cn","assignProps","Component","_defineProperty2","Fragment","LegendItemComponent","Shape","Icon","Label","AdditionalLabel","Count","_ref2","arguments[0]","_ref0","SPointShape","Box","SPatternSymbol","PatternSymbol","_props$patternKey","patternKey","getChartDefaultColorName","hasChildren","_ref8","_ref9","_ref13","_ref3","_ref1","SIcon","displayName","_ref14","_ref4","_ref10","SLabel","TypographyText","_ref15","_ref5","_ref11","SAdditionalLabel","_ref16","_ref6","_ref12","SCount","exports","createComponent"],"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":";;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,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C,EAAA,gBAAE,CACK,CAAC;AAEvB;AACAS,eAAe,CAACmB,WAAW,GAAG,iBAAiB;AAE/C,SAASlB,KAAKA,CAAA4B,MAAA,EAAmE;EAAA,IAAAC,KAAA,GAAA3B,YAAA;IAAA4B,MAAA;EAAA,IAAhE9C,MAAM,GAAA4C,MAAA,CAAN5C,MAAM;IAAY2B,WAAW,GAAAiB,MAAA,CAArB/D,QAAQ;IAAeoB,QAAQ,GAAA2C,MAAA,CAAR3C,QAAQ;EACtD,IAAM8C,MAAM,GAOMR,gBAAc;EALhC,IAAI,CAACZ,WAAW,EAAE;IAChB,OAAO,IAAI;EACb;EAEA,OAAAmB,MAAA,GAAO,IAAAtG,aAAO,EAACwD,MAAM,CAAC,eACpB9D,MAAA,YAAAmE,aAAA,CAAC0C,MAAM,EAAAD,MAAA,CAAAxC,EAAA,eAAA1B,cAAA,qBAAAlD,KAAA,CAAA6E,WAAA;IAAA,OAA6B;EAAW,GAAAsC,KAAA,kBAC7C3G,MAAA,YAAAmE,aAAA,CAACJ,QAAQ,EAAA6C,MAAA,CAAAxC,EAAA,gBAAE,CACL,CAAC;AAEb;AACAU,KAAK,CAACkB,WAAW,GAAG,OAAO;AAEpB,IAAMvB,mBAAmC,GAAAqC,OAAA,CAAArC,mBAAA,GAAG,IAAAsC,qBAAe,EAACpG,cAAc,EAAE;EACjF+D,KAAK,EAALA,KAAK;EACLC,IAAI,EAAJA,IAAI;EACJC,KAAK,EAALA,KAAK;EACLC,eAAe,EAAfA,eAAe;EACfC,KAAK,EAALA;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"LegendItem.js","names":["_core","require","_baseComponents","_checkbox","_interopRequireDefault","_resolveColorEnhance","_uniqueID","_typography","_react","_LegendItem","_Pattern","_utils","_excluded","style","sstyled","insert","enhance","resolveColorEnhance","uniqueIDEnhancement","LegendItemRoot","_Component","_classCallCheck2","_callSuper2","arguments","_inherits2","_createClass2","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","_objectSpread2","children","icon","onClick","getLabelProps","_this$asProps2","_color","_shape","_objectWithoutProperties2","getAdditionalLabelProps","additionalInfo","undefined","getCountProps","count","render","_ref","_ref7","SLegendItem","Flex","_this$asProps3","styles","Children","disabled","StaticShapes","includes","createElement","cn","assignProps","Component","_defineProperty2","Fragment","LegendItemComponent","Shape","Icon","Label","AdditionalLabel","Count","_ref2","arguments[0]","_ref0","SPointShape","Box","SPatternSymbol","PatternSymbol","_props$patternKey","patternKey","getChartDefaultColorName","hasChildren","_ref8","_ref9","_ref13","_ref3","_ref1","SIcon","displayName","_ref14","_ref4","_ref10","SLabel","TypographyText","_ref15","_ref5","_ref11","SAdditionalLabel","_ref16","_ref6","_ref12","SCount","exports","createComponent"],"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":";;;;;;;;;;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAFA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,oBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,SAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAEA,IAAAO,MAAA,GAAAJ,sBAAA,CAAAH,OAAA;AAGA,IAAAQ,WAAA,GAAAR,OAAA;AAOA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AAA0D,IAAAW,SAAA;AAAA;AAAA,IAAAC,KAAA,8BAAAb,KAAA,CAAAc,OAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAE1D,IAAMC,OAAO,GAAG,CAAC,IAAAC,+BAAmB,EAAC,CAAC,EAAE,IAAAC,oBAAmB,EAAC,CAAC,CAAU;AAAC,IAClEC,cAAc,0BAAAC,UAAA;EAAA,SAAAD,eAAA;IAAA,IAAAE,gBAAA,mBAAAF,cAAA;IAAA,WAAAG,WAAA,mBAAAH,cAAA,EAAAI,SAAA;EAAA;EAAA,IAAAC,UAAA,aAAAL,cAAA,EAAAC,UAAA;E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OAAA,CAAArC,mBAAA,GAAG,IAAAsC,qBAAe,EAACpG,cAAc,EAAE;EACjE+D,KAAK,EAALA,KAAK;EACLC,IAAI,EAAJA,IAAI;EACJC,KAAK,EAALA,KAAK;EACLC,eAAe,EAAfA,eAAe;EACfC,KAAK,EAALA;AACF,CAAC,CAAmB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendItem.type.js","names":["StaticShapes","exports"],"sources":["../../../../../src/component/ChartLegend/LegendItem/LegendItem.type.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"LegendItem.type.js","names":["StaticShapes","exports"],"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;;AAoFO,IAAMA,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAU","ignoreList":[]}
|
|
@@ -12,19 +12,19 @@ var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSup
|
|
|
12
12
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
14
|
var _core = require("@semcore/core");
|
|
15
|
-
var
|
|
15
|
+
var _baseComponents = require("@semcore/base-components");
|
|
16
16
|
var _react = _interopRequireDefault(require("react"));
|
|
17
17
|
var _BaseLegend2 = require("../BaseLegend");
|
|
18
18
|
var _LegendItem = require("../LegendItem/LegendItem");
|
|
19
19
|
/*!__reshadow-styles__:"./legend-table.shadow.css"*/
|
|
20
|
-
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
20
|
+
var style = (/*__reshadow_css_start__*/_core.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_"),
|
|
21
21
|
/*__reshadow_css_end__*/
|
|
22
22
|
{
|
|
23
|
-
"__SLegendTable": "
|
|
24
|
-
"_columns-count": "__columns-
|
|
25
|
-
"__SColumnItem": "
|
|
26
|
-
"_size_l": "
|
|
27
|
-
"_size_m": "
|
|
23
|
+
"__SLegendTable": "___SLegendTable_9jglg_gg_",
|
|
24
|
+
"_columns-count": "__columns-count_9jglg_gg_",
|
|
25
|
+
"__SColumnItem": "___SColumnItem_9jglg_gg_",
|
|
26
|
+
"_size_l": "_size_l_9jglg_gg_",
|
|
27
|
+
"_size_m": "_size_m_9jglg_gg_"
|
|
28
28
|
});
|
|
29
29
|
var LegendTableRoot = /*#__PURE__*/function (_BaseLegend) {
|
|
30
30
|
function LegendTableRoot() {
|
|
@@ -38,7 +38,7 @@ var LegendTableRoot = /*#__PURE__*/function (_BaseLegend) {
|
|
|
38
38
|
var _ref = this.asProps,
|
|
39
39
|
_ref3,
|
|
40
40
|
_items$;
|
|
41
|
-
var SLegendTable =
|
|
41
|
+
var SLegendTable = _baseComponents.Box;
|
|
42
42
|
var _this$asProps = this.asProps,
|
|
43
43
|
styles = _this$asProps.styles,
|
|
44
44
|
Children = _this$asProps.Children,
|
|
@@ -78,7 +78,7 @@ var LegendTableRoot = /*#__PURE__*/function (_BaseLegend) {
|
|
|
78
78
|
function ColumnComponent(props) {
|
|
79
79
|
var _ref2 = arguments[0],
|
|
80
80
|
_ref4;
|
|
81
|
-
var SColumnItem =
|
|
81
|
+
var SColumnItem = _baseComponents.Box;
|
|
82
82
|
var styles = props.styles,
|
|
83
83
|
index = props.index,
|
|
84
84
|
size = props.size,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendTable.js","names":["_core","require","
|
|
1
|
+
{"version":3,"file":"LegendTable.js","names":["_core","require","_baseComponents","_react","_interopRequireDefault","_BaseLegend2","_LegendItem","style","sstyled","insert","LegendTableRoot","_BaseLegend","_classCallCheck2","_callSuper2","arguments","_inherits2","_createClass2","key","value","render","_ref","asProps","_ref3","_items$","SLegendTable","Box","_this$asProps","styles","Children","_this$asProps$size","size","items","columnsCount","columns","length","createElement","cn","_objectSpread2","assignProps","map","_ref5","_index","id","_ref5$columns","Fragment","item","index","concat","LegendTable","Column","BaseLegend","_defineProperty2","children","LegendItem","ColumnComponent","props","_ref2","arguments[0]","_ref4","SColumnItem","gridColumnStart","gridColumnEnd","exports","createComponent","LegendItemComponent"],"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":";;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAIA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAA+D;AAAA,IAAAM,KAAA,8BAAAP,KAAA,CAAAQ,OAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAAA,IAEzDC,eAAe,0BAAAC,WAAA;EAAA,SAAAD,gBAAA;IAAA,IAAAE,gBAAA,mBAAAF,eAAA;IAAA,WAAAG,WAAA,mBAAAH,eAAA,EAAAI,SAAA;EAAA;EAAA,IAAAC,UAAA,aAAAL,eAAA,EAAAC,WAAA;EAAA,WAAAK,aAAA,aAAAN,eAAA;IAAAO,GAAA;IAAAC,KAAA,EAQnB,SAAAC,MAAMA,CAAA,EAAG;MAAA,IAAAC,IAAA,QAAAC,OAAA;QAAAC,KAAA;QAAAC,OAAA;MACP,IAAM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,OAAA,CAAAd,WAAA,GAAG,IAAAe,qBAAe,EAACrD,eAAe,EAAE;EAC1D2C,UAAU,EAAEW,+BAAmB;EAC/Bf,MAAM,EAAEK;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 {
|
|
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":["_core","require","_assignProps","_uniqueID","_interopRequireDefault","_react","_createElement","_Pattern","_utils","CigaretteBarRoot","_Component","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","_callSuper2","concat","_defineProperty2","React","createRef","handlers","hovered","setCursor","e","_this$asProps","asProps","onClick","dataKey","currentTarget","tagName","stopPropagation","value","_this$refElement$curr","refElement","current","style","setProperty","_inherits2","_createClass2","key","uncontrolledProps","getRect","_this$asProps2","x","y","width","height","radius","r","direction","index","xV","yV","widthV","heightV","roundedPath","render","_ref","SBar","Element","_this$asProps3","styles","color","data","hide","uid","duration","onMouseMove","onMouseLeave","transparent","resolveColor","patterns","dSvg","createElement","Fragment","sstyled","cn","undefined","callAllEventHandlers","handleMouseMove","handleMouseLeave","handleClick","PatternFill","Component","uniqueIDEnhancement","offset","defaultHovered","_default","exports"],"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,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAD,sBAAA,CAAAH,OAAA;AAEA,IAAAK,cAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAA0C,IAEpCQ,gBAAgB,0B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,IAAI,CAACY,eAAe,CAAC;QAAA,gBACtD,IAAAD,iCAAoB,EAACV,YAAY,EAAE,IAAI,CAACY,gBAAgB,CAAC;QAAA,eAC1D,IAAI,CAACC;MAAW,EAC9B,CAAC,GAEHV,QAAQ,iBACPtE,MAAA,YAAAwE,aAAA,CAACtE,QAAA,CAAA+E,WAAW,EAAAzB,IAAA,CAAAmB,EAAA;QAAA,SAAA5D,MAAA,CACHiD,GAAG,OAAAjD,MAAA,CAAIkC,KAAK;QAAA,cACPY,KAAK;QAAA,SACVQ,YAAY,CAACR,KAAK,CAAC;QAAA,YAChBS;MAAQ,EACnB,CAEW,CAAC;IAErB;EAAC;AAAA,EA7I4BY,eAAS;AAAA,IAAAlE,gBAAA,aAAlCZ,gBAAgB,iBACC,mBAAmB;AAAA,IAAAY,gBAAA,aADpCZ,gBAAgB,aAEH,CAAC,IAAA+E,oBAAmB,EAAC,CAAC,CAAC;AAAA,IAAAnE,gBAAA,aAFpCZ,gBAAgB,WAGL,CAAC,CAAC;AAAA,IAAAY,gBAAA,aAHbZ,gBAAgB,kBAKE;EACpBgF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;EACdnB,QAAQ,EAAE,GAAG;EACbjB,SAAS,EAAE,YAAY;EACvBqC,cAAc,EAAE;AAClB,CAAC;AAAA,IAAAC,QAAA,GAAAC,OAAA,cAsIY,IAAAf,yBAAa,EAACpE,gBAAgB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Cigarette.js","names":["_core","require","_assignProps","_uniqueID","_interopRequireDefault","_react","_createElement","_Pattern","_utils","CigaretteBarRoot","_Component","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","_callSuper2","concat","_defineProperty2","React","createRef","handlers","hovered","setCursor","e","_this$asProps","asProps","onClick","dataKey","currentTarget","tagName","stopPropagation","value","_this$refElement$curr","refElement","current","style","setProperty","_inherits2","_createClass2","key","uncontrolledProps","getRect","_this$asProps2","x","y","width","height","radius","r","direction","index","xV","yV","widthV","heightV","roundedPath","render","_ref","SBar","Element","_this$asProps3","styles","color","data","hide","uid","duration","onMouseMove","onMouseLeave","transparent","resolveColor","patterns","dSvg","createElement","Fragment","sstyled","cn","undefined","callAllEventHandlers","handleMouseMove","handleMouseLeave","handleClick","PatternFill","Component","uniqueIDEnhancement","offset","defaultHovered","_default","exports"],"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,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAD,sBAAA,CAAAH,OAAA;AAEA,IAAAK,cAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,I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AI;QAAA,mBAAAxD,MAAA,CACUkD,QAAQ;QAAA,eACZ,IAAAY,iCAAoB,EAACX,WAAW,EAAE,IAAI,CAACY,eAAe,CAAC;QAAA,gBACtD,IAAAD,iCAAoB,EAACV,YAAY,EAAE,IAAI,CAACY,gBAAgB,CAAC;QAAA,eAC1D,IAAI,CAACC;MAAW,EAC9B,CAAC,GAEHV,QAAQ,iBACPtE,MAAA,YAAAwE,aAAA,CAACtE,QAAA,CAAA+E,WAAW,EAAAzB,IAAA,CAAAmB,EAAA;QAAA,SAAA5D,MAAA,CACHiD,GAAG,OAAAjD,MAAA,CAAIkC,KAAK;QAAA,cACPY,KAAK;QAAA,SACVQ,YAAY,CAACR,KAAK,CAAC;QAAA,YAChBS;MAAQ,EACnB,CAEW,CAAC;IAErB;EAAC;AAAA,EA7I4BY,eAAS;AAAA,IAAAlE,gBAAA,aAAlCZ,gBAAgB,iBACC,mBAAmB;AAAA,IAAAY,gBAAA,aADpCZ,gBAAgB,aAEH,CAAC,IAAA+E,oBAAmB,EAAC,CAAC,CAAC;AAAA,IAAAnE,gBAAA,aAFpCZ,gBAAgB,WAGL,CAAC,CAAC;AAAA,IAAAY,gBAAA,aAHbZ,gBAAgB,kBAKE;EACpBgF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;EACdnB,QAAQ,EAAE,GAAG;EACbjB,SAAS,EAAE,YAAY;EACvBqC,cAAc,EAAE;AAClB,CAAC;AAAA,IAAAC,QAAA,GAAAC,OAAA,cAsIY,IAAAf,yBAAa,EAACpE,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[
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
+
}
|
|
@@ -1,39 +1,26 @@
|
|
|
1
|
-
@import './var.css';
|
|
2
|
-
|
|
3
1
|
SPlotA11yView {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
opacity: 0;
|
|
2
|
+
position: relative;
|
|
3
|
+
display: block;
|
|
7
4
|
background-color: var(--intergalactic-bg-primary-neutral, oklch(1 0 0));
|
|
8
5
|
color: var(--intergalactic-text-primary, oklch(0.1 0.03 137 / 0.899));
|
|
9
6
|
border: 3px solid var(--intergalactic-border-primary, oklch(0.137 0.026 175.7 / 0.161));
|
|
10
7
|
font-size: var(--intergalactic-fs-50, 10px);
|
|
11
|
-
|
|
8
|
+
z-index: var(--intergalactic-z-index-overlay, 500);
|
|
12
9
|
padding: 2px;
|
|
13
10
|
width: 200px;
|
|
14
11
|
height: 200px;
|
|
15
12
|
max-width: 80%;
|
|
16
13
|
max-height: 80%;
|
|
17
14
|
overflow: auto;
|
|
18
|
-
}
|
|
19
|
-
SPlotA11yView:focus-within,
|
|
20
|
-
SPlotA11yView:focus {
|
|
21
|
-
user-select: all;
|
|
22
|
-
pointer-events: all;
|
|
23
|
-
opacity: 1;
|
|
24
|
-
z-index: var(--intergalactic-z-index-overlay, 500);
|
|
25
|
-
position: relative;
|
|
26
|
-
display: block;
|
|
27
|
-
}
|
|
28
|
-
SPlotA11yView a {
|
|
29
|
-
cursor: pointer;
|
|
30
|
-
text-decoration: underline;
|
|
31
|
-
margin-bottom: var(--intergalactic-spacing-2x, 8px);
|
|
32
|
-
display: block;
|
|
33
|
-
}
|
|
34
15
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
16
|
+
a {
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
text-decoration: underline;
|
|
19
|
+
margin-bottom: var(--intergalactic-spacing-2x, 8px);
|
|
20
|
+
display: block;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
table, td, th {
|
|
24
|
+
border: 1px solid var(--intergalactic-border-primary, oklch(0.137 0.026 175.7 / 0.161));
|
|
25
|
+
}
|
|
39
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Axis.d.js","names":[],"sources":["../../../src/types/Axis.d.ts"],"sourcesContent":["import type { UnknownProperties } from '@semcore/core';\n\nimport type { Context } from './context';\nimport type { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface IXAxisProps extends XAxisProps, UnknownProperties {}\nexport type XAxisProps = Context & {\n /** The position of the axis relative chart\n * @default 'button' */\n position?: 'top' | 'right' | 'bottom' | 'left' | number;\n /** Element hide property\n * @default false */\n hide?: boolean;\n /** Values for axis ticks */\n ticks?: any[];\n};\n\n/** @deprecated */\nexport interface IYAxisProps extends YAxisProps, UnknownProperties {}\nexport type YAxisProps = Context & {\n /** The position of the axis relative chart\n * @default 'left' */\n position?: 'top' | 'right' | 'bottom' | 'left' | number;\n /** Element hide property\n * @default true */\n hide?: boolean;\n /** Values for axis ticks */\n ticks?: any[];\n};\n\n/** @deprecated */\nexport interface IAxisTicksProps extends AxisTicksProps, UnknownProperties {}\nexport type AxisTicksProps = Context & {\n /** The position of the axis relative chart */\n position?: 'top' | 'right' | 'bottom' | 'left';\n /** Element hide property */\n hide?: boolean;\n /** Values for axis ticks */\n ticks?: any[];\n /** Enables multiline tick labels, applicable only for band scales */\n multiline?: boolean;\n};\n\n/** @deprecated */\nexport interface IAxisGridProps extends AxisGridProps, UnknownProperties {}\nexport type AxisGridProps = Context & {\n /** Values for axis ticks */\n ticks?: any[];\n};\n\n/** @deprecated */\nexport interface IAxisTitleProps extends AxisTitleProps, UnknownProperties {}\nexport type AxisTitleProps = Context & {\n /** The position of the axis relative chart */\n position?: 'top' | 'right' | 'bottom' | 'left';\n\n /** For vertical titles disables characters rotation while puts\n * characters into the vertical column for better reading in some languages.\n * @default true for `zh` and `ja` locales and false for all others.\n */\n verticalWritingMode?: boolean;\n};\n\n/** @deprecated */\nexport interface IAxisTicksContext extends AxisTicksContext, UnknownProperties {}\nexport type AxisTicksContext = {\n /** Value element of data */\n /** @deprecated */\n value: any;\n /** Index element of data */\n index: number;\n /** Horizontal coordinate of tick */\n x: number;\n /** Vertical coordinate of tick */\n y: number;\n /** Size of plot */\n size: [width: number, height: number];\n};\n\ndeclare const XAxis: IntergalacticD3Component<'path', XAxisProps> & {\n Ticks: IntergalacticD3Component<'path', AxisTicksProps, AxisTicksContext>;\n Grid: IntergalacticD3Component<'path', AxisGridProps>;\n Title: IntergalacticD3Component<'text', AxisTitleProps>;\n};\n\ndeclare const YAxis: IntergalacticD3Component<'path', YAxisProps> & {\n Ticks: IntergalacticD3Component<'path', AxisTicksProps, AxisTicksContext>;\n Grid: IntergalacticD3Component<'path', AxisGridProps>;\n Title: IntergalacticD3Component<'text', AxisTitleProps>;\n};\n\nexport { XAxis, YAxis };\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Axis.d.js","names":[],"sources":["../../../src/types/Axis.d.ts"],"sourcesContent":["import type { UnknownProperties } from '@semcore/core';\n\nimport type { Context } from './context';\nimport type { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface IXAxisProps extends XAxisProps, UnknownProperties {}\nexport type XAxisProps = Context & {\n /** The position of the axis relative chart\n * @default 'button' */\n position?: 'top' | 'right' | 'bottom' | 'left' | number;\n /** Element hide property\n * @default false */\n hide?: boolean;\n /** Values for axis ticks */\n ticks?: any[];\n};\n\n/** @deprecated */\nexport interface IYAxisProps extends YAxisProps, UnknownProperties {}\nexport type YAxisProps = Context & {\n /** The position of the axis relative chart\n * @default 'left' */\n position?: 'top' | 'right' | 'bottom' | 'left' | number;\n /** Element hide property\n * @default true */\n hide?: boolean;\n /** Values for axis ticks */\n ticks?: any[];\n};\n\n/** @deprecated */\nexport interface IAxisTicksProps extends AxisTicksProps, UnknownProperties {}\nexport type AxisTicksProps = Context & {\n /** The position of the axis relative chart */\n position?: 'top' | 'right' | 'bottom' | 'left';\n /** Element hide property */\n hide?: boolean;\n /** Values for axis ticks */\n ticks?: any[];\n /** Enables multiline tick labels, applicable only for band scales */\n multiline?: boolean;\n /**\n * Enable `--intergalactic-text-primary` color for ticks\n */\n primaryText?: boolean;\n};\n\n/** @deprecated */\nexport interface IAxisGridProps extends AxisGridProps, UnknownProperties {}\nexport type AxisGridProps = Context & {\n /** Values for axis ticks */\n ticks?: any[];\n};\n\n/** @deprecated */\nexport interface IAxisTitleProps extends AxisTitleProps, UnknownProperties {}\nexport type AxisTitleProps = Context & {\n /** The position of the axis relative chart */\n position?: 'top' | 'right' | 'bottom' | 'left';\n\n /** For vertical titles disables characters rotation while puts\n * characters into the vertical column for better reading in some languages.\n * @default true for `zh` and `ja` locales and false for all others.\n */\n verticalWritingMode?: boolean;\n};\n\n/** @deprecated */\nexport interface IAxisTicksContext extends AxisTicksContext, UnknownProperties {}\nexport type AxisTicksContext = {\n /** Value element of data */\n /** @deprecated */\n value: any;\n /** Index element of data */\n index: number;\n /** Horizontal coordinate of tick */\n x: number;\n /** Vertical coordinate of tick */\n y: number;\n /** Size of plot */\n size: [width: number, height: number];\n};\n\ndeclare const XAxis: IntergalacticD3Component<'path', XAxisProps> & {\n Ticks: IntergalacticD3Component<'path', AxisTicksProps, AxisTicksContext>;\n Grid: IntergalacticD3Component<'path', AxisGridProps>;\n Title: IntergalacticD3Component<'text', AxisTitleProps>;\n};\n\ndeclare const YAxis: IntergalacticD3Component<'path', YAxisProps> & {\n Ticks: IntergalacticD3Component<'path', AxisTicksProps, AxisTicksContext>;\n Grid: IntergalacticD3Component<'path', AxisGridProps>;\n Title: IntergalacticD3Component<'text', AxisTitleProps>;\n};\n\nexport { XAxis, YAxis };\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompactHorizontalBar.d.js","names":[],"sources":["../../../src/types/CompactHorizontalBar.d.ts"],"sourcesContent":["import type { BoxProps } from '@semcore/
|
|
1
|
+
{"version":3,"file":"CompactHorizontalBar.d.js","names":[],"sources":["../../../src/types/CompactHorizontalBar.d.ts"],"sourcesContent":["import type { BoxProps } from '@semcore/base-components';\n\nimport type { BackgroundProps } from './Bar';\nimport type { Context } from './context';\nimport type { PatternsConfig } from './Pattern';\nimport type { IntergalacticD3Component } from './Plot';\nimport type { TooltipType } from './Tooltip';\n\nexport type CompactHorizontalBarProps = Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n /** Line color */\n color?: string;\n /**\n * Bars rounded corners\n * @default 2\n */\n radius?: number;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Enables element transparency */\n transparent?: boolean;\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n};\n\ntype BarContext = {\n /** Index in `data` array of the current items */\n index: number;\n};\n\nexport type CompactHorizontalBarHoverProps = BoxProps;\ntype Hover = IntergalacticD3Component<'rect', CompactHorizontalBarHoverProps, Context>;\nexport type CompactHorizontalBarAnnotationProps = BoxProps;\ntype Annotation = IntergalacticD3Component<\n 'foreignObject',\n CompactHorizontalBarAnnotationProps,\n Context & BarContext\n>;\nexport type CompactHorizontalBarLabelProps = BoxProps;\ntype Label = IntergalacticD3Component<'div', CompactHorizontalBarLabelProps, Context & BarContext>;\nexport type CompactHorizontalBarPercentProps = BoxProps;\nexport type CompactHorizontalBarPercentContext = {\n formatted: string;\n percent: number;\n} & BarContext;\ntype Percent = IntergalacticD3Component<\n 'div',\n CompactHorizontalBarPercentProps,\n Context & CompactHorizontalBarPercentContext\n>;\nexport type CompactHorizontalBarValueProps = BoxProps;\nexport type CompactHorizontalBarValueContext = { formatted: string; value: number } & BarContext;\ntype Value = IntergalacticD3Component<\n 'div',\n CompactHorizontalBarValueProps,\n Context & CompactHorizontalBarValueContext\n>;\nexport type CompactHorizontalBarBarProps = {};\ntype Bar = IntergalacticD3Component<'g', CompactHorizontalBarBarProps, Context & BarContext>;\nexport type CompactHorizontalBarBackgroundProps = BoxProps;\ntype Background = IntergalacticD3Component<'rect', BackgroundProps, Context & BarContext>;\nexport type CompactHorizontalBarFillProps = BoxProps & {\n patterns?: PatternsConfig;\n color?: string;\n transparent?: boolean;\n hide?: boolean;\n};\ntype Fill = IntergalacticD3Component<'rect', CompactHorizontalBarFillProps, Context & BarContext>;\n\ndeclare const CompactHorizontalBar: IntergalacticD3Component<\n 'g',\n CompactHorizontalBarProps,\n BarContext\n> & {\n Hover: Hover;\n Annotation: Annotation;\n Label: Label;\n Percent: Percent;\n Value: Value;\n Bar: Bar & {\n Background: Background;\n Fill: Fill;\n };\n Tooltip: TooltipType<BarContext>;\n};\n\nexport default CompactHorizontalBar;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hover.d.js","names":[],"sources":["../../../src/types/Hover.d.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"Hover.d.js","names":[],"sources":["../../../src/types/Hover.d.ts"],"sourcesContent":["import type { BoxProps } from '@semcore/base-components';\nimport type { UnknownProperties, ReturnEl } from '@semcore/core';\nimport type React from 'react';\n\nimport type { Context } from './context';\nimport type { IntergalacticD3Component } from './Plot';\nimport type { TooltipTypeBase } from './Tooltip';\n\n/** @deprecated */\nexport interface IHoverProps extends HoverProps, UnknownProperties {}\nexport type HoverProps = Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n};\n\ntype HoverTooltip = (<X, Y>(\n props: {\n /** Field name from `data` array item for the XAxis */\n x?: X;\n /** Field name from `data` array item for the YAxis */\n y?: Y;\n /** Handle click by trigger has an index - it is an index of the data array. */\n onClick?: (index: number, e: React.SyntheticEvent) => void;\n children: (props: {\n /** Index in `data` array of the current item */\n xIndex: X extends string ? number : never;\n /** Index in `data` array of the current item */\n yIndex: Y extends string ? number : never;\n }) => { children: ReturnEl };\n /** Flag for hide line on hovered value */\n hideHoverLine?: boolean | ((xIndex: number | null, yIndex: number | null) => boolean);\n } & Omit<BoxProps, 'children'>,\n) => ReturnEl) &\nTooltipTypeBase;\n\ntype HoverContext = {\n /** Index in `data` array of the current item */\n index: number;\n};\n\ndeclare const HoverLine: IntergalacticD3Component<'g', HoverProps, HoverContext> & {\n Tooltip: HoverTooltip;\n};\n\ndeclare const HoverRect: IntergalacticD3Component<'g', HoverProps, HoverContext> & {\n Tooltip: HoverTooltip;\n};\nexport { HoverLine, HoverRect };\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Line.d.js","names":[],"sources":["../../../src/types/Line.d.ts"],"sourcesContent":["import type { FadeInOutProps } from '@semcore/
|
|
1
|
+
{"version":3,"file":"Line.d.js","names":[],"sources":["../../../src/types/Line.d.ts"],"sourcesContent":["import type { FadeInOutProps } from '@semcore/base-components';\nimport type { UnknownProperties } from '@semcore/core';\nimport type { CurveFactory } from 'd3-shape';\n\nimport type { Context } from './context';\nimport type { PatternsConfig } from './Pattern';\nimport type { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface ILineProps extends LineProps, UnknownProperties {}\nexport type LineProps = Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n /** Line color */\n color?: string;\n /** Element hide property */\n hide?: boolean;\n /** Curve method */\n curve?: CurveFactory;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Enables element transparency */\n transparent?: boolean;\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n /** Callback triggered when a user clicks on a line */\n onClick?: (index: number, event: React.SyntheticEvent) => void;\n};\n\n/** @deprecated */\nexport interface ILineDotsProps extends LineDotsProps, UnknownProperties {}\nexport type LineDotsProps = Context &\n Omit<FadeInOutProps, 'display'> & {\n /** Show dots */\n display?: boolean | ((index: number, active: boolean, single: boolean) => boolean);\n /** Hide property */\n hide?: boolean;\n /** Index active of element */\n activeIndex?: number;\n /** Dot radius, radius of active dot is 4/3 times larger\n * @default 6\n */\n radius?: number;\n };\n\n/** @deprecated */\nexport interface ILineDotsContext extends LineDotsContext, UnknownProperties {}\nexport type LineDotsContext = {\n /** Value element of data */\n /** @deprecated */\n value?: any;\n /** Index element of data */\n index?: number;\n};\n\n/** @deprecated */\nexport interface ILineNullProps extends LineNullProps, UnknownProperties {}\nexport type LineNullProps = Context & {\n /** Hide property */\n hide?: boolean;\n};\n\nexport type LineAreaProps = Omit<LineProps, 'transparent'> & {\n /**\n * Field name from `data` (or from `area`, if passed) array for y0 point by the YAxis for the Area\n */\n y0: string;\n /**\n * Field name from `data` (or from `area`, if passed) array for y1 point by the YAxis for the Area\n */\n y1: string;\n\n /**\n * Optional data for render area\n */\n area?: Array<{ [key: string]: number }>;\n\n /**\n * If disabled, area will not be rendered if corresponding position data is null. That case you use\n * `interpolateValue` symbol for spot data interpolation.\n * @default true\n */\n autoInterpolate?: boolean;\n};\n\ndeclare const Line: IntergalacticD3Component<'line', LineProps, Context> & {\n Dots: IntergalacticD3Component<'circle', LineDotsProps, LineDotsContext>;\n Null: IntergalacticD3Component<'path', LineNullProps>;\n Area: IntergalacticD3Component<'path', LineAreaProps>;\n};\n\nexport default Line;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plot.d.js","names":[],"sources":["../../../src/types/Plot.d.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"Plot.d.js","names":[],"sources":["../../../src/types/Plot.d.ts"],"sourcesContent":["import type { BoxProps } from '@semcore/base-components';\nimport type { UnknownProperties, Intergalactic } from '@semcore/core';\n\nimport type { DataStructureHints } from './a11y/hints';\nimport type { Context } from './context';\nimport type { PatternsConfig } from './Pattern';\nimport type { PlotEventEmitter } from './utils';\n\n/** @deprecated */\nexport interface IPlotProps extends PlotProps, UnknownProperties {}\nexport type PlotProps = Context &\n BoxProps & {\n /** Width of the svg element\n * @default 0 */\n width?: number;\n /** Height of the svg element\n * @default 0 */\n height?: number;\n /** Human readable chart name (e.g \"Last market trends\") */\n label?: string;\n /**\n * Locale for displaying the days of a week and months, to be transferred to `Intl`\n * @default en\n * */\n locale?: NavigatorLanguage['language'];\n /**\n * Optional container for data hints (use it if you have a legend component upper in tree)\n */\n dataHints?: DataStructureHints;\n /** Optional prop to tune up alt text generating for charts */\n a11yAltTextConfig?: PlotSummarizerConfig;\n\n /** Enables charts patterns that enhances charts accessibility */\n patterns?: PatternsConfig;\n\n /** Event emitter for chart interactions */\n eventEmitter?: InstanceType<typeof PlotEventEmitter>;\n };\n\nexport type PlotSummarizerConfig = {\n /** Totally disable automatic data summarization */\n disable?: boolean;\n /** Disable automatic data summarization and use provided text */\n override?: string;\n /** Tuning up time series trends analyzing. Represents angle tangens of time series change of different strength */\n trendTangens?: {\n /** Angle tangens of time series that have meaningful trending change\n * @default 1/15\n */\n static?: number;\n /** Angle tangens of time series that have weak trending change\n * @default 1/10\n */\n weak?: number;\n /** Angle tangens of time series that have medium trending change\n * @default 1/5\n */\n medium?: number;\n /** Angle tangens of time series that have strong trending change\n * @default Infinity\n */\n strong?: number;\n };\n /** Tuning up time series local trends detection based on moving averages */\n movingAverage?: {\n /** Frame size of long moving average\n * @default Math.sqrt(data.length)\n */\n longSize?: number;\n /** Frame size of short moving average\n * @default Math.sqrt(data.length)/2\n */\n shortSize?: number;\n /** Absolute difference between values on moving averages crossing to\n * be handled as local trend change.\n * @default StandardDeviation/10\n */\n notableDiff?: number;\n };\n /** The way data to be interpreted as. By default is based on used used Plot elements and data structure.\n */\n dataType?: 'time-series' | 'points-cloud' | 'values-set';\n /** Grid size to split data of point clouds into clusters.\n */\n clustersGridSize?: number;\n /** Limits some output lists in chart alt text\n * @default 100\n * **/\n maxListSymbols?: number;\n /** Always add time to dates in chart alt text **/\n datesWithTime?: boolean;\n /** Described clusters count before text \"and X more\"\n * @default false\n * **/\n clustersLimit?: number;\n /** Described values count before text \"and X more\"\n * @default false\n * **/\n valuesLimit?: number;\n /** Described grouped value groups count before text \"and X more\"\n * @default false\n * **/\n groupsLimit?: number;\n /** Additional field for extra text description to the data\n * **/\n additionalFields?: string[];\n /** Allows to format titles (e.g. axes) in alt text and data table */\n titlesFormatter?: (key: string | number | null) => string | undefined;\n /** Allows to format values in alt text and data table */\n valuesFormatter?: (value: unknown, key: string | number | null) => string | undefined;\n};\n\n/** @deprecated */\nexport type MapProps<Props, Ctx = {}, UCProps = {}> = Props & {\n children?:\n | ((props: Props & Ctx, handlers: UCProps) => Props | React.PropsWithChildren)\n | React.ReactNode;\n};\n\nexport type IntergalacticD3Component<BaseTag extends Intergalactic.Tag, Props, Context = {}> = (<\n Tag extends Intergalactic.Tag = BaseTag,\n>(\n props: Intergalactic.InternalTypings.PropsRenderingResultComponentProps<Tag, Props, Context>,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\nIntergalactic.InternalTypings.ComponentAdditive<BaseTag, BaseTag, Props>;\n\ndeclare const Plot: IntergalacticD3Component<'svg', PlotProps, Context>;\nexport default Plot;\n"],"mappings":"","ignoreList":[]}
|